UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

1 lines • 24.2 kB
{"version":3,"file":"useScreens.js","names":[],"sources":["esm/router/useScreens.js"],"sourcesContent":["import { createNavigatorFactory } from \"@react-navigation/core\";\nimport React, { Suspense, createElement, memo, useContext, useEffect, useState } from \"react\";\nimport { SafeAreaProvider } from \"../safe-area-context\";\nimport { ServerContextScript } from \"../server/ServerContextScript\";\nimport { checkSkewAndReload } from \"../skewProtection\";\nimport { getClientMatchesSnapshot } from \"../useMatches\";\nimport { handleSkewError, isChunkLoadError } from \"../utils/dynamicImport\";\nimport { getPageExport } from \"../utils/getPageExport\";\nimport { EmptyRoute } from \"../views/EmptyRoute\";\nimport { NamedSlot } from \"../views/Navigator\";\nimport { RouteErrorView } from \"../views/RouteErrorView\";\nimport { Try } from \"../views/Try\";\nimport { ScrollBehaviorRouteCommit } from \"../views/ScrollBehavior\";\nimport { DevHead } from \"../vite/DevHead\";\nimport { getServerContext, useServerContext } from \"../vite/one-server-only\";\nimport { getReactNavigationRouteName } from \"../getReactNavigationConfig\";\nimport { filterRootHTML } from \"./filterRootHTML\";\nimport { Route, RouteParamsContext, SuspenseFallbackContext, useRouteNode } from \"./Route\";\nimport { SpaShellContext } from \"./SpaShellContext\";\nimport { sortRoutesWithInitial } from \"./sortRoutes\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\n\nfunction hasMetaCharset(children) {\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!children) return false;\n\t\tconst checkElement = (child) => {\n\t\t\tif (!React.isValidElement(child)) return false;\n\t\t\tif (child.type === \"meta\") {\n\t\t\t\tconst props = child.props;\n\t\t\t\tif (\"charSet\" in props || \"charset\" in props) return true;\n\t\t\t}\n\t\t\tconst childProps = child.props;\n\t\t\tif (childProps.children) return hasMetaCharset(childProps.children);\n\t\t\treturn false;\n\t\t};\n\t\tif (Array.isArray(children)) return children.some(checkElement);\n\t\treturn checkElement(children);\n\t}\n\treturn true;\n}\nconst { Screen, Group } = createNavigatorFactory({})();\nconst cachedInlineCSSElements = typeof document !== \"undefined\" && typeof document.querySelectorAll === \"function\" ? (() => {\n\tconst elements = [];\n\tdocument.querySelectorAll(\"style[id^=\\\"__one_css_\\\"], link[rel=\\\"stylesheet\\\"][data-one-css]\").forEach((el, i) => {\n\t\tif (el.tagName === \"STYLE\") elements.push(/* @__PURE__ */ jsx(\"style\", {\n\t\t\tid: el.id,\n\t\t\tdangerouslySetInnerHTML: { __html: el.innerHTML }\n\t\t}, `inline-css-${i}`));\n\t\telse {\n\t\t\tconst href = el.getAttribute(\"href\");\n\t\t\telements.push(/* @__PURE__ */ jsx(\"link\", {\n\t\t\t\trel: \"stylesheet\",\n\t\t\t\thref,\n\t\t\t\t\"data-one-css\": \"\"\n\t\t\t}, href));\n\t\t}\n\t});\n\treturn elements;\n})() : [];\nconst SSR_SAFE_METRICS = {\n\tframe: {\n\t\tx: 0,\n\t\ty: 0,\n\t\twidth: 0,\n\t\theight: 0\n\t},\n\tinsets: {\n\t\ttop: 0,\n\t\tleft: 0,\n\t\tright: 0,\n\t\tbottom: 0\n\t}\n};\nfunction RootLayoutRenderer({ LayoutComponent, layoutProps, forwardedRef }) {\n\tif (process.env.NODE_ENV === \"development\" && true) {\n\t\tconst [, setHmrKey] = useState(0);\n\t\tuseEffect(() => {\n\t\t\tconst handler = () => setHmrKey((k) => k + 1);\n\t\t\twindow.addEventListener(\"one-hmr-update\", handler);\n\t\t\treturn () => window.removeEventListener(\"one-hmr-update\", handler);\n\t\t}, []);\n\t}\n\tconst { children, bodyProps, head, htmlProps } = filterRootHTML(LayoutComponent(layoutProps, forwardedRef));\n\tconst { children: headChildren, ...headProps } = head?.props || {};\n\tconst serverContext = useServerContext();\n\tlet finalChildren = children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!hasMetaCharset(headChildren)) console.warn(`[one] Missing <meta charSet=\"utf-8\" /> in your root _layout.tsx <head>. This can cause React hydration issues due to encoding mismatch. Add it as the first element in your <head> tag.`);\n\t}\n\tfinalChildren = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(\"head\", {\n\t\t...headProps,\n\t\tchildren: [\n\t\t\t/* @__PURE__ */ jsx(DevHead, {}),\n\t\t\t/* @__PURE__ */ jsx(\"script\", { dangerouslySetInnerHTML: { __html: `globalThis['global'] = globalThis` } }),\n\t\t\tserverContext?.cssContents?.length || serverContext?.cssInlineCount ? serverContext?.cssContents ? serverContext.cssContents.map((content, i) => content ? /* @__PURE__ */ jsx(\"style\", {\n\t\t\t\tid: `__one_css_${i}`,\n\t\t\t\tdangerouslySetInnerHTML: { __html: content }\n\t\t\t}, `inline-css-${i}`) : serverContext.css?.[i] ? /* @__PURE__ */ jsx(\"link\", {\n\t\t\t\trel: \"stylesheet\",\n\t\t\t\thref: serverContext.css[i]\n\t\t\t}, serverContext.css[i]) : null) : cachedInlineCSSElements : serverContext?.css?.map((file) => /* @__PURE__ */ jsx(\"link\", {\n\t\t\t\trel: \"stylesheet\",\n\t\t\t\thref: file\n\t\t\t}, file)),\n\t\t\t/* @__PURE__ */ jsx(ServerContextScript, {}),\n\t\t\theadChildren\n\t\t]\n\t}, \"head\"), /* @__PURE__ */ jsx(\"body\", {\n\t\tsuppressHydrationWarning: true,\n\t\t...bodyProps,\n\t\tchildren: /* @__PURE__ */ jsx(SafeAreaProvider, {\n\t\t\tinitialMetrics: SSR_SAFE_METRICS,\n\t\t\tchildren: finalChildren\n\t\t})\n\t}, \"body\")] });\n\treturn /* @__PURE__ */ jsx(\"html\", {\n\t\tsuppressHydrationWarning: true,\n\t\tlang: \"en-US\",\n\t\t...htmlProps,\n\t\tchildren: finalChildren\n\t});\n}\nfunction getSortedChildren(children, order, initialRouteName, options) {\n\tif (!order?.length) return children.sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({\n\t\troute,\n\t\tprops: {}\n\t}));\n\tconst entries = [...children];\n\tconst ordered = order.map(({ name, redirect, initialParams, listeners, options: options2, getId }) => {\n\t\tif (!entries.length) {\n\t\t\tconsole.warn(`[Layout children]: Too many screens defined. Route \"${name}\" is extraneous.`);\n\t\t\treturn null;\n\t\t}\n\t\tconst matchIndex = entries.findIndex((child) => child.route === name);\n\t\tif (matchIndex === -1) {\n\t\t\tconsole.warn(`[Layout children]: No route named \"${name}\" exists in nested children:`, children.map(({ route }) => route));\n\t\t\treturn null;\n\t\t}\n\t\tconst match = entries[matchIndex];\n\t\tentries.splice(matchIndex, 1);\n\t\tif (redirect) {\n\t\t\tif (typeof redirect === \"string\") throw new Error(`Redirecting to a specific route is not supported yet.`);\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\troute: match,\n\t\t\tprops: {\n\t\t\t\tinitialParams,\n\t\t\t\tlisteners,\n\t\t\t\toptions: options2,\n\t\t\t\tgetId\n\t\t\t}\n\t\t};\n\t}).filter(Boolean);\n\tconst remaining = options?.remaining ?? \"all\";\n\tif (remaining !== \"none\") ordered.push(...entries.filter((route) => remaining === \"all\" || !route.generated).sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({\n\t\troute,\n\t\tprops: {}\n\t})));\n\treturn ordered;\n}\nfunction useSortedScreens(order, options) {\n\tconst node = useRouteNode();\n\treturn React.useMemo(() => {\n\t\treturn (node?.children?.length ? getSortedChildren(node.children, order, node.initialRouteName, options) : []).filter((value) => {\n\t\t\tconst routeName = value.route.route;\n\t\t\tconst normalized = routeName.replace(/\\/index$/, \"\");\n\t\t\treturn !(options?.protectedScreens?.has(routeName) || options?.protectedScreens?.has(normalized));\n\t\t}).map((value) => routeToScreen(value.route, value.props));\n\t}, [\n\t\tnode?.children,\n\t\tnode?.initialRouteName,\n\t\torder,\n\t\toptions?.protectedScreens\n\t]);\n}\nfunction fromImport({ ErrorBoundary, SuspenseFallback, ...component }) {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconst exported = getPageExport(component);\n\t\tif (exported && typeof exported === \"object\" && Object.keys(exported).length === 0) return {\n\t\t\tdefault: EmptyRoute,\n\t\t\tErrorBoundary,\n\t\t\tSuspenseFallback\n\t\t};\n\t}\n\treturn {\n\t\tdefault: getPageExport(component),\n\t\tErrorBoundary,\n\t\tSuspenseFallback\n\t};\n}\nfunction RouteSuspenseFallback({ component: Component, route }) {\n\tconst params = useContext(RouteParamsContext);\n\treturn Component ? /* @__PURE__ */ jsx(Component, {\n\t\troute,\n\t\tparams: params ?? {}\n\t}) : null;\n}\nconst qualifiedStore = /* @__PURE__ */ new WeakMap();\nfunction getRouteMatchesForProps() {\n\tconst serverMatches = getServerContext()?.matches ?? [];\n\tif (process.env.VITE_ENVIRONMENT === \"ssr\") return serverMatches;\n\tconst clientMatches = getClientMatchesSnapshot();\n\treturn clientMatches.length ? clientMatches : serverMatches;\n}\nfunction getQualifiedRouteComponent(value) {\n\tif (value && qualifiedStore.has(value)) return qualifiedStore.get(value);\n\tconst ScreenComponent = React.forwardRef((props, ref) => {\n\t\tif (process.env.NODE_ENV === \"development\" && true) {\n\t\t\tconst [, setHmrKey] = useState(0);\n\t\t\tuseEffect(() => {\n\t\t\t\tconst handler = () => setHmrKey((k) => k + 1);\n\t\t\t\twindow.addEventListener(\"one-hmr-update\", handler);\n\t\t\t\treturn () => window.removeEventListener(\"one-hmr-update\", handler);\n\t\t\t}, []);\n\t\t}\n\t\tif (process.env.NODE_ENV === \"development\" && false);\n\t\tconst isSpaShell = useContext(SpaShellContext);\n\t\tconst InheritedSuspenseFallback = useContext(SuspenseFallbackContext);\n\t\tconst matches = getRouteMatchesForProps();\n\t\tif (isSpaShell && props.segment !== \"\") {\n\t\t\tif (!(value.children?.length && (value.layoutRenderMode === \"ssg\" || value.layoutRenderMode === \"ssr\"))) return /* @__PURE__ */ jsx(\"div\", { \"data-one-spa-content\": \"\" });\n\t\t}\n\t\tconst res = fromImport(value.loadRoute());\n\t\tconst Component = res.default || EmptyRoute;\n\t\tconst CatchBoundary = res.ErrorBoundary;\n\t\tconst LayoutSuspenseFallback = value.type === \"layout\" ? res.SuspenseFallback : void 0;\n\t\tconst match = matches.find((match2) => match2.routeId === value.contextKey) || (!value.children?.length ? matches[matches.length - 1] : void 0);\n\t\tconst loaderDataProps = match && \"loaderData\" in match ? { loaderData: match.loaderData } : {};\n\t\tif (process.env.NODE_ENV === \"development\" && process.env.DEBUG === \"one\") {\n\t\t\tconsole.groupCollapsed(`Render ${props.key} ${props.segment}`);\n\t\t\tconsole.info(`value`, value);\n\t\t\tconsole.info(`Component`, Component);\n\t\t\tconsole.groupEnd();\n\t\t}\n\t\tconst slotProps = {};\n\t\tif (value.slots && value.slots.size > 0) for (const [slotName] of value.slots) slotProps[slotName] = /* @__PURE__ */ jsx(NamedSlot, {\n\t\t\tname: slotName,\n\t\t\tlayoutContextKey: value.contextKey\n\t\t});\n\t\tlet rendered;\n\t\tif (props.segment === \"\") rendered = /* @__PURE__ */ jsx(RootLayoutRenderer, {\n\t\t\tLayoutComponent: Component,\n\t\t\tlayoutProps: {\n\t\t\t\t...props,\n\t\t\t\t...slotProps,\n\t\t\t\t...loaderDataProps\n\t\t\t},\n\t\t\tforwardedRef: ref\n\t\t});\n\t\telse {\n\t\t\tconst page = /* @__PURE__ */ jsx(Component, {\n\t\t\t\t...props,\n\t\t\t\t...slotProps,\n\t\t\t\t...loaderDataProps,\n\t\t\t\tref\n\t\t\t});\n\t\t\trendered = /* @__PURE__ */ jsx(RouteErrorBoundary, {\n\t\t\t\trouteName: value.route,\n\t\t\t\tchildren: CatchBoundary ? /* @__PURE__ */ jsx(Try, {\n\t\t\t\t\tcatch: CatchBoundary,\n\t\t\t\t\tchildren: page\n\t\t\t\t}) : page\n\t\t\t});\n\t\t}\n\t\tif (value.type !== \"layout\") return rendered;\n\t\tconst providedSuspenseFallback = LayoutSuspenseFallback ?? InheritedSuspenseFallback;\n\t\treturn /* @__PURE__ */ jsx(SuspenseFallbackContext.Provider, {\n\t\t\tvalue: providedSuspenseFallback,\n\t\t\tchildren: LayoutSuspenseFallback ? wrapSuspense(rendered, LayoutSuspenseFallback) : rendered\n\t\t});\n\t});\n\tconst wrapSuspense = (children, SuspenseFallback) => {\n\t\tconst fallback = /* @__PURE__ */ jsx(RouteSuspenseFallback, {\n\t\t\tcomponent: SuspenseFallback,\n\t\t\troute: value.contextKey\n\t\t});\n\t\tif (process.env.ONE_SUSPEND_ROUTES === \"1\" && globalThis.__ONE_DISABLE_SUSPENSE_ROUTES__ !== true) return /* @__PURE__ */ jsx(Suspense, {\n\t\t\tfallback,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t};\n\tconst QualifiedRoute = React.forwardRef(({ route, navigation, ...props }, ref) => {\n\t\tconst InheritedSuspenseFallback = useContext(SuspenseFallbackContext);\n\t\treturn /* @__PURE__ */ jsx(Route, {\n\t\t\troute,\n\t\t\tnode: value,\n\t\t\tchildren: /* @__PURE__ */ jsx(Fragment, { children: wrapSuspense(/* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ScreenComponent, {\n\t\t\t\t...props,\n\t\t\t\tref,\n\t\t\t\tsegment: value.route\n\t\t\t}), process.env.VITE_ENVIRONMENT === \"client\" && value.type !== \"layout\" && navigation && /* @__PURE__ */ jsx(ScrollBehaviorRouteCommit, {})] }), InheritedSuspenseFallback) })\n\t\t});\n\t});\n\tQualifiedRoute.displayName = `Route(${value.route})`;\n\tconst Memoized = memo(QualifiedRoute);\n\tqualifiedStore.set(value, Memoized);\n\treturn Memoized;\n}\nfunction createGetIdForRoute(route) {\n\tconst include = /* @__PURE__ */ new Map();\n\tif (route.dynamic) for (const segment of route.dynamic) include.set(segment.name, segment);\n\treturn ({ params = {} } = {}) => {\n\t\tconst segments = [];\n\t\tfor (const dynamic of include.values()) {\n\t\t\tconst value = params?.[dynamic.name];\n\t\t\tif (Array.isArray(value) && value.length > 0) segments.push(value.join(\"/\"));\n\t\t\telse if (value && !Array.isArray(value)) segments.push(value);\n\t\t\telse if (dynamic.deep) segments.push(`[...${dynamic.name}]`);\n\t\t\telse segments.push(`[${dynamic.name}]`);\n\t\t}\n\t\treturn segments.join(\"/\") ?? route.contextKey;\n\t};\n}\nfunction routeToScreen(route, { options, ...props } = {}) {\n\tconst navigationRouteName = getReactNavigationRouteName(route);\n\treturn /* @__PURE__ */ createElement(Screen, {\n\t\tgetId: createGetIdForRoute(route),\n\t\t...props,\n\t\tname: navigationRouteName,\n\t\tkey: navigationRouteName,\n\t\toptions: (args) => {\n\t\t\tconst staticOptions = route.generated ? route.loadRoute()?.getNavOptions : null;\n\t\t\tconst staticResult = typeof staticOptions === \"function\" ? staticOptions(args) : staticOptions;\n\t\t\tconst dynamicResult = typeof options === \"function\" ? options?.(args) : options;\n\t\t\tconst output = {\n\t\t\t\t...staticResult,\n\t\t\t\t...dynamicResult\n\t\t\t};\n\t\t\tif (route.generated) {\n\t\t\t\toutput.tabBarButton = () => null;\n\t\t\t\toutput.drawerItemStyle = {\n\t\t\t\t\theight: 0,\n\t\t\t\t\tdisplay: \"none\"\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn output;\n\t\t},\n\t\tgetComponent: () => {\n\t\t\treturn getQualifiedRouteComponent(route);\n\t\t}\n\t});\n}\nconst ROUTE_ERROR_BOUNDARY_INITIAL_STATE = {\n\thasError: false,\n\terror: null,\n\terrorInfo: null\n};\nvar RouteErrorBoundary = class extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = ROUTE_ERROR_BOUNDARY_INITIAL_STATE;\n\t}\n\tstatic getDerivedStateFromError(error) {\n\t\treturn {\n\t\t\thasError: true,\n\t\t\terror\n\t\t};\n\t}\n\tcomponentDidCatch(error, errorInfo) {\n\t\tconsole.error(`Error occurred while running route \"${this.props.routeName}\": ${error instanceof Error ? error.message : error}\n\n${error.stack}\n\nComponent Stack:\n${errorInfo.componentStack}`);\n\t\tthis.setState({ errorInfo });\n\t\tif (process.env.NODE_ENV === \"production\" && process.env.ONE_SKEW_PROTECTION !== \"false\") if (isChunkLoadError(error)) handleSkewError();\n\t\telse checkSkewAndReload();\n\t}\n\tclearError() {\n\t\tthis.setState(ROUTE_ERROR_BOUNDARY_INITIAL_STATE);\n\t}\n\trender() {\n\t\tif (this.state.hasError) {\n\t\t\tconst { error, errorInfo } = this.state;\n\t\t\treturn /* @__PURE__ */ jsx(RouteErrorView, {\n\t\t\t\trouteName: this.props.routeName,\n\t\t\t\terror,\n\t\t\t\terrorInfo,\n\t\t\t\tonRetry: this.clearError.bind(this)\n\t\t\t});\n\t\t}\n\t\treturn this.props.children;\n\t}\n};\n\nexport { Group, Screen, createGetIdForRoute, getQualifiedRouteComponent, useSortedScreens };"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,eAAe,UAAU;CACjC,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC3C,IAAI,CAAC,UAAU,OAAO;EACtB,MAAM,gBAAgB,UAAU;GAC/B,IAAI,CAAC,MAAM,eAAe,KAAK,GAAG,OAAO;GACzC,IAAI,MAAM,SAAS,QAAQ;IAC1B,MAAM,QAAQ,MAAM;IACpB,IAAI,aAAa,SAAS,aAAa,OAAO,OAAO;GACtD;GACA,MAAM,aAAa,MAAM;GACzB,IAAI,WAAW,UAAU,OAAO,eAAe,WAAW,QAAQ;GAClE,OAAO;EACR;EACA,IAAI,MAAM,QAAQ,QAAQ,GAAG,OAAO,SAAS,KAAK,YAAY;EAC9D,OAAO,aAAa,QAAQ;CAC7B;CACA,OAAO;AACR;AACA,MAAM,EAAE,QAAQ,UAAU,uBAAuB,CAAC,CAAC,CAAC,CAAC;AACrD,MAAM,0BAA0B,OAAO,aAAa,eAAe,OAAO,SAAS,qBAAqB,oBAAoB;CAC3H,MAAM,WAAW,CAAC;CAClB,SAAS,iBAAiB,mEAAmE,CAAC,CAAC,SAAS,IAAI,MAAM;EACjH,IAAI,GAAG,YAAY,SAAS,SAAS,KAAqB,oBAAI,SAAS;GACtE,IAAI,GAAG;GACP,yBAAyB,EAAE,QAAQ,GAAG,UAAU;EACjD,GAAG,cAAc,GAAG,CAAC;OAChB;GACJ,MAAM,OAAO,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