one 2.13.8 → 2.13.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cli/checkNodeVersion.cjs +4 -9
- package/dist/cjs/cli/checkNodeVersion.native.cjs +6 -9
- package/dist/cjs/cli/checkNodeVersion.native.js +6 -9
- package/dist/cjs/cli/checkNodeVersion.native.js.map +1 -1
- package/dist/cjs/metro-config/getViteMetroPluginOptions.cjs +4 -10
- package/dist/cjs/metro-config/getViteMetroPluginOptions.native.cjs +4 -10
- package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js +4 -10
- package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
- package/dist/cjs/router/useScreens.cjs +1 -1
- package/dist/cjs/router/useScreens.native.cjs +2 -1
- package/dist/cjs/router/useScreens.native.js +2 -1
- package/dist/cjs/router/useScreens.native.js.map +1 -1
- package/dist/esm/cli/checkNodeVersion.mjs +4 -9
- package/dist/esm/cli/checkNodeVersion.mjs.map +1 -1
- package/dist/esm/cli/checkNodeVersion.native.js +6 -9
- package/dist/esm/cli/checkNodeVersion.native.js.map +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.mjs +4 -10
- package/dist/esm/metro-config/getViteMetroPluginOptions.mjs.map +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.native.js +4 -10
- package/dist/esm/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
- package/dist/esm/router/useScreens.mjs +1 -1
- package/dist/esm/router/useScreens.mjs.map +1 -1
- package/dist/esm/router/useScreens.native.js +2 -1
- package/dist/esm/router/useScreens.native.js.map +1 -1
- package/ios/Generated/OneNativeTabViewView.swift +2 -1
- package/package.json +13 -13
- package/run.mjs +7 -0
- package/src/cli/checkNodeVersion.ts +6 -11
- package/src/metro-config/getViteMetroPluginOptions.integration.test.ts +33 -3
- package/src/metro-config/getViteMetroPluginOptions.ts +5 -11
- package/src/native/packedClosure.test.ts +59 -22
- package/src/router/useScreens.tsx +1 -1
- package/types/cli/checkNodeVersion.d.ts.map +1 -1
- package/types/metro-config/getViteMetroPluginOptions.d.ts +1 -1
- package/types/metro-config/getViteMetroPluginOptions.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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\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,G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oBAAI,gBAAgB;IAC1C,WAAW,KAAK,MAAM;IACtB;IACA;IACA,SAAS,KAAK,WAAW,KAAK,IAAI;GACnC,CAAC;EACF;EACA,OAAO,KAAK,MAAM;CACnB;AACD"}
|
|
1
|
+
{"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\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\t...props,\n\t\tgetId: props.getId ?? createGetIdForRoute(route),\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,CA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AAuB,oBAAI,gBAAgB;IAC1C,WAAW,KAAK,MAAM;IACtB;IACA;IACA,SAAS,KAAK,WAAW,KAAK,IAAI;GACnC,CAAC;EACF;EACA,OAAO,KAAK,MAAM;CACnB;AACD"}
|
|
@@ -369,10 +369,11 @@ function createGetIdForRoute(route) {
|
|
|
369
369
|
}
|
|
370
370
|
function routeToScreen(route) {
|
|
371
371
|
var { options, ...props } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
372
|
+
var _props_getId;
|
|
372
373
|
var navigationRouteName = getReactNavigationRouteName(route);
|
|
373
374
|
return /* @__PURE__ */ createElement(Screen, {
|
|
374
|
-
getId: createGetIdForRoute(route),
|
|
375
375
|
...props,
|
|
376
|
+
getId: (_props_getId = props.getId) !== null && _props_getId !== void 0 ? _props_getId : createGetIdForRoute(route),
|
|
376
377
|
name: navigationRouteName,
|
|
377
378
|
key: navigationRouteName,
|
|
378
379
|
options: function options1(args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScreens.native.js","names":[],"sources":["esm/router/useScreens.native.js"],"sourcesContent":["import { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport React, { Suspense, createElement, memo, useContext } from \"react\";\nimport { createNavigatorFactory } from \"@react-navigation/core\";\nimport { getClientMatchesSnapshot } from \"../useMatches\";\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 { getServerContext, useServerContext } from \"../vite/one-server-only\";\nimport { getReactNavigationRouteName } from \"../getReactNavigationConfig\";\nimport { filterRootHTML } from \"./filterRootHTML\";\nimport { Route, RouteParamsContext, SuspenseFallbackContext, useRouteNode } from \"./Route\";\nimport { getRouteHmrEpoch, subscribeRouteHmr } from \"./routeHmr\";\nimport { SpaShellContext } from \"./SpaShellContext\";\nimport { sortRoutesWithInitial } from \"./sortRoutes\";\n\nfunction _assert_this_initialized(self) {\n\tif (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n\treturn self;\n}\nfunction _call_super(_this, derived, args) {\n\tderived = _get_prototype_of(derived);\n\treturn _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));\n}\nfunction _class_call_check(instance, Constructor) {\n\tif (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction _defineProperties(target, props) {\n\tfor (var i = 0; i < props.length; i++) {\n\t\tvar descriptor = props[i];\n\t\tdescriptor.enumerable = descriptor.enumerable || false;\n\t\tdescriptor.configurable = true;\n\t\tif (\"value\" in descriptor) descriptor.writable = true;\n\t\tObject.defineProperty(target, descriptor.key, descriptor);\n\t}\n}\nfunction _create_class(Constructor, protoProps, staticProps) {\n\tif (protoProps) _defineProperties(Constructor.prototype, protoProps);\n\tif (staticProps) _defineProperties(Constructor, staticProps);\n\treturn Constructor;\n}\nfunction _get_prototype_of(o) {\n\t_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o2) {\n\t\treturn o2.__proto__ || Object.getPrototypeOf(o2);\n\t};\n\treturn _get_prototype_of(o);\n}\nfunction _inherits(subClass, superClass) {\n\tif (typeof superClass !== \"function\" && superClass !== null) throw new TypeError(\"Super expression must either be null or a function\");\n\tsubClass.prototype = Object.create(superClass && superClass.prototype, { constructor: {\n\t\tvalue: subClass,\n\t\twritable: true,\n\t\tconfigurable: true\n\t} });\n\tif (superClass) _set_prototype_of(subClass, superClass);\n}\nfunction _is_native_reflect_construct() {\n\ttry {\n\t\tvar result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));\n\t} catch (_) {}\n\treturn (_is_native_reflect_construct = function() {\n\t\treturn !!result;\n\t})();\n}\nfunction _possible_constructor_return(self, call) {\n\tif (call && (_type_of(call) === \"object\" || typeof call === \"function\")) return call;\n\treturn _assert_this_initialized(self);\n}\nfunction _set_prototype_of(o, p) {\n\t_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o2, p2) {\n\t\to2.__proto__ = p2;\n\t\treturn o2;\n\t};\n\treturn _set_prototype_of(o, p);\n}\nfunction _type_of(obj) {\n\t\"@swc/helpers - typeof\";\n\treturn obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar { Screen, Group } = createNavigatorFactory({})();\ntypeof document !== \"undefined\" && typeof document.querySelectorAll === \"function\" && (function() {\n\tvar elements = [];\n\tdocument.querySelectorAll(\"style[id^=\\\"__one_css_\\\"], link[rel=\\\"stylesheet\\\"][data-one-css]\").forEach(function(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\tvar 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})();\nfunction RootLayoutRenderer(param) {\n\tvar { LayoutComponent, layoutProps, forwardedRef } = param;\n\tif (process.env.NODE_ENV === \"development\" && false);\n\tvar { children, bodyProps, head, htmlProps } = filterRootHTML(LayoutComponent(layoutProps, forwardedRef));\n\tvar { children: headChildren, ...headProps } = (head === null || head === void 0 ? void 0 : head.props) || {};\n\tuseServerContext();\n\treturn children;\n}\nfunction getSortedChildren(children, order, initialRouteName, options) {\n\tvar _ref;\n\tif (!(order === null || order === void 0 ? void 0 : order.length)) return children.sort(sortRoutesWithInitial(initialRouteName)).map(function(route) {\n\t\treturn {\n\t\t\troute,\n\t\t\tprops: {}\n\t\t};\n\t});\n\tvar entries = [...children];\n\tvar ordered = order.map(function(param) {\n\t\tvar { name, redirect, initialParams, listeners, options: _$options, getId } = param;\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\tvar matchIndex = entries.findIndex(function(child) {\n\t\t\treturn child.route === name;\n\t\t});\n\t\tif (matchIndex === -1) {\n\t\t\tconsole.warn(`[Layout children]: No route named \"${name}\" exists in nested children:`, children.map(function(param2) {\n\t\t\t\tvar { route } = param2;\n\t\t\t\treturn route;\n\t\t\t}));\n\t\t\treturn null;\n\t\t}\n\t\tvar 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: _$options,\n\t\t\t\tgetId\n\t\t\t}\n\t\t};\n\t}).filter(Boolean);\n\tvar remaining = (_ref = options === null || options === void 0 ? void 0 : options.remaining) !== null && _ref !== void 0 ? _ref : \"all\";\n\tif (remaining !== \"none\") ordered.push(...entries.filter(function(route) {\n\t\treturn remaining === \"all\" || !route.generated;\n\t}).sort(sortRoutesWithInitial(initialRouteName)).map(function(route) {\n\t\treturn {\n\t\t\troute,\n\t\t\tprops: {}\n\t\t};\n\t}));\n\treturn ordered;\n}\nfunction useSortedScreens(order, options) {\n\tvar node = useRouteNode();\n\treturn React.useMemo(function() {\n\t\tvar _node_children;\n\t\treturn ((node === null || node === void 0 ? void 0 : (_node_children = node.children) === null || _node_children === void 0 ? void 0 : _node_children.length) ? getSortedChildren(node.children, order, node.initialRouteName, options) : []).filter(function(value) {\n\t\t\tvar _options_protectedScreens, _options_protectedScreens1;\n\t\t\tvar routeName = value.route.route;\n\t\t\tvar normalized = routeName.replace(/\\/index$/, \"\");\n\t\t\treturn !((options === null || options === void 0 ? void 0 : (_options_protectedScreens = options.protectedScreens) === null || _options_protectedScreens === void 0 ? void 0 : _options_protectedScreens.has(routeName)) || (options === null || options === void 0 ? void 0 : (_options_protectedScreens1 = options.protectedScreens) === null || _options_protectedScreens1 === void 0 ? void 0 : _options_protectedScreens1.has(normalized)));\n\t\t}).map(function(value) {\n\t\t\treturn routeToScreen(value.route, value.props);\n\t\t});\n\t}, [\n\t\tnode === null || node === void 0 ? void 0 : node.children,\n\t\tnode === null || node === void 0 ? void 0 : node.initialRouteName,\n\t\torder,\n\t\toptions === null || options === void 0 ? void 0 : options.protectedScreens\n\t]);\n}\nfunction fromImport(param) {\n\tvar { ErrorBoundary, SuspenseFallback, ...component } = param;\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tvar 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(param) {\n\tvar { component: Component, route } = param;\n\tvar params = useContext(RouteParamsContext);\n\treturn Component ? /* @__PURE__ */ jsx(Component, {\n\t\troute,\n\t\tparams: params !== null && params !== void 0 ? params : {}\n\t}) : null;\n}\nvar qualifiedStore = /* @__PURE__ */ new WeakMap();\nfunction getRouteMatchesForProps() {\n\tvar _ref;\n\tvar _getServerContext;\n\tvar serverMatches = (_ref = (_getServerContext = getServerContext()) === null || _getServerContext === void 0 ? void 0 : _getServerContext.matches) !== null && _ref !== void 0 ? _ref : [];\n\tif (process.env.VITE_ENVIRONMENT === \"ssr\") return serverMatches;\n\tvar clientMatches = getClientMatchesSnapshot();\n\treturn clientMatches.length ? clientMatches : serverMatches;\n}\nfunction getQualifiedRouteComponent(value) {\n\tif (value && qualifiedStore.has(value)) return qualifiedStore.get(value);\n\tvar ScreenComponent = /* @__PURE__ */ React.forwardRef(function(props, ref) {\n\t\tvar _value_children;\n\t\tif (process.env.NODE_ENV === \"development\" && false);\n\t\tif (process.env.NODE_ENV === \"development\" && true) React.useSyncExternalStore(subscribeRouteHmr, getRouteHmrEpoch, getRouteHmrEpoch);\n\t\tvar isSpaShell = useContext(SpaShellContext);\n\t\tvar InheritedSuspenseFallback = useContext(SuspenseFallbackContext);\n\t\tvar matches = getRouteMatchesForProps();\n\t\tif (isSpaShell && props.segment !== \"\") {\n\t\t\tvar _value_children1;\n\t\t\tif (!(((_value_children1 = value.children) === null || _value_children1 === void 0 ? void 0 : _value_children1.length) && (value.layoutRenderMode === \"ssg\" || value.layoutRenderMode === \"ssr\"))) return /* @__PURE__ */ jsx(\"div\", { \"data-one-spa-content\": \"\" });\n\t\t}\n\t\tvar res = fromImport(value.loadRoute());\n\t\tvar Component = res.default || EmptyRoute;\n\t\tvar CatchBoundary = res.ErrorBoundary;\n\t\tvar LayoutSuspenseFallback = value.type === \"layout\" ? res.SuspenseFallback : void 0;\n\t\tvar match = matches.find(function(match2) {\n\t\t\treturn match2.routeId === value.contextKey;\n\t\t}) || (!((_value_children = value.children) === null || _value_children === void 0 ? void 0 : _value_children.length) ? matches[matches.length - 1] : void 0);\n\t\tvar 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\tvar slotProps = {};\n\t\tif (value.slots && value.slots.size > 0) {\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = value.slots[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar [slotName] = _step.value;\n\t\t\t\t\tslotProps[slotName] = /* @__PURE__ */ jsx(NamedSlot, {\n\t\t\t\t\t\tname: slotName,\n\t\t\t\t\t\tlayoutContextKey: value.contextKey\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvar 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\tvar 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\tvar providedSuspenseFallback = LayoutSuspenseFallback !== null && LayoutSuspenseFallback !== void 0 ? 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\tvar wrapSuspense = function wrapSuspense2(children, SuspenseFallback) {\n\t\tvar 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_NATIVE === \"0\" || globalThis.__ONE_DISABLE_SUSPENSE_ROUTES__ === true) return children;\n\t\treturn /* @__PURE__ */ jsx(Suspense, {\n\t\t\tfallback,\n\t\t\tchildren\n\t\t});\n\t};\n\tvar QualifiedRoute = /* @__PURE__ */ React.forwardRef(function(param, ref) {\n\t\tvar { route, navigation, ...props } = param;\n\t\tvar 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\tvar Memoized = /* @__PURE__ */ memo(QualifiedRoute);\n\tqualifiedStore.set(value, Memoized);\n\treturn Memoized;\n}\nfunction createGetIdForRoute(route) {\n\tvar include = /* @__PURE__ */ new Map();\n\tif (route.dynamic) {\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = route.dynamic[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar segment = _step.value;\n\t\t\t\tinclude.set(segment.name, segment);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t}\n\treturn function() {\n\t\tvar { params = {} } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\t\tvar _segments_join;\n\t\tvar segments = [];\n\t\tvar _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator2 = include.values()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t\t\t\tvar dynamic = _step2.value;\n\t\t\t\tvar value = params === null || params === void 0 ? void 0 : params[dynamic.name];\n\t\t\t\tif (Array.isArray(value) && value.length > 0) segments.push(value.join(\"/\"));\n\t\t\t\telse if (value && !Array.isArray(value)) segments.push(value);\n\t\t\t\telse if (dynamic.deep) segments.push(`[...${dynamic.name}]`);\n\t\t\t\telse segments.push(`[${dynamic.name}]`);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError2 = true;\n\t\t\t_iteratorError2 = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError2) throw _iteratorError2;\n\t\t\t}\n\t\t}\n\t\treturn (_segments_join = segments.join(\"/\")) !== null && _segments_join !== void 0 ? _segments_join : route.contextKey;\n\t};\n}\nfunction routeToScreen(route) {\n\tvar { options, ...props } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n\tvar 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: function options1(args) {\n\t\t\tvar _route_loadRoute;\n\t\t\tvar staticOptions = route.generated ? (_route_loadRoute = route.loadRoute()) === null || _route_loadRoute === void 0 ? void 0 : _route_loadRoute.getNavOptions : null;\n\t\t\tvar staticResult = typeof staticOptions === \"function\" ? staticOptions(args) : staticOptions;\n\t\t\tvar dynamicResult = typeof options === \"function\" ? options === null || options === void 0 ? void 0 : options(args) : options;\n\t\t\tvar 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 = function() {\n\t\t\t\t\treturn null;\n\t\t\t\t};\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: function getComponent() {\n\t\t\treturn getQualifiedRouteComponent(route);\n\t\t}\n\t});\n}\nvar ROUTE_ERROR_BOUNDARY_INITIAL_STATE = {\n\thasError: false,\n\terror: null,\n\terrorInfo: null\n};\nvar RouteErrorBoundary = /* @__PURE__ */ (function(_React_Component) {\n\t\"use strict\";\n\t_inherits(RouteErrorBoundary2, _React_Component);\n\tfunction RouteErrorBoundary2(props) {\n\t\t_class_call_check(this, RouteErrorBoundary2);\n\t\tvar _this = _call_super(this, RouteErrorBoundary2, [props]);\n\t\t_this.state = ROUTE_ERROR_BOUNDARY_INITIAL_STATE;\n\t\treturn _this;\n\t}\n\t_create_class(RouteErrorBoundary2, [\n\t\t{\n\t\t\tkey: \"componentDidCatch\",\n\t\t\tvalue: function componentDidCatch(error, errorInfo) {\n\t\t\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\t\t\tthis.setState({ errorInfo });\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tkey: \"clearError\",\n\t\t\tvalue: function clearError() {\n\t\t\t\tthis.setState(ROUTE_ERROR_BOUNDARY_INITIAL_STATE);\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tkey: \"render\",\n\t\t\tvalue: function render() {\n\t\t\t\tif (this.state.hasError) {\n\t\t\t\t\tvar { error, errorInfo } = this.state;\n\t\t\t\t\treturn /* @__PURE__ */ jsx(RouteErrorView, {\n\t\t\t\t\t\trouteName: this.props.routeName,\n\t\t\t\t\t\terror,\n\t\t\t\t\t\terrorInfo,\n\t\t\t\t\t\tonRetry: this.clearError.bind(this)\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this.props.children;\n\t\t\t}\n\t\t}\n\t], [{\n\t\tkey: \"getDerivedStateFromError\",\n\t\tvalue: function getDerivedStateFromError(error) {\n\t\t\treturn {\n\t\t\t\thasError: true,\n\t\t\t\terror\n\t\t\t};\n\t\t}\n\t}]);\n\treturn RouteErrorBoundary2;\n})(React.Component);\n\nexport { Group, Screen, createGetIdForRoute, getQualifiedRouteComponent, useSortedScreens };"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,SAAS,yBAAyB,MAAM;CACvC,IAAI,SAAS,KAAK,GAAG,MAAM,IAAI,eAAe,2DAA2D;CACzG,OAAO;AACR;AACA,SAAS,YAAY,OAAO,SAAS,MAAM;CAC1C,UAAU,kBAAkB,OAAO;CACnC,OAAO,6BAA6B,OAAO,6BAA6B,IAAI,QAAQ,UAAU,SAAS,QAAQ,CAAC,GAAG,kBAAkB,KAAK,CAAC,CAAC,WAAW,IAAI,QAAQ,MAAM,OAAO,IAAI,CAAC;AACtL;AACA,SAAS,kBAAkB,UAAU,aAAa;CACjD,IAAI,EAAE,oBAAoB,cAAc,MAAM,IAAI,UAAU,mCAAmC;AAChG;AACA,SAAS,kBAAkB,QAAQ,OAAO;CACzC,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACtC,IAAI,aAAa,MAA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CAC/C,SAAS,oBAAoB,OAAO;EACnC,kBAAkB,MAAM,mBAAmB;EAC3C,IAAI,QAAQ,YAAY,MAAM,qBAAqB,CAAC,KAAK,CAAC;EAC1D,MAAM,QAAQ;EACd,OAAO;CACR;CACA,cAAc,qBAAqB;EAClC;GACC,KAAK;GACL,OAAO,SAAS,kBAAkB,OAAO,WAAW;IACnD,QAAQ,MAAM,uCAAuC,KAAK,MAAM,UAAU,KAAK,iBAAiB,QAAQ,MAAM,UAAU,MAAM;;EAEhI,MAAM,MAAM;;;EAGZ,UAAU,gBAAgB;IACxB,KAAK,SAAS,EAAE,UAAU,CAAC;GAC5B;EACD;EACA;GACC,KAAK;GACL,OAAO,SAAS,aAAa;IAC5B,KAAK,SAAS,kCAAkC;GACjD;EACD;EACA;GACC,KAAK;GACL,OAAO,SAAS,SAAS;IACxB,IAAI,KAAK,MAAM,UAAU;KACxB,IAAI,EAAE,OAAO,cAAc,KAAK;KAChC,OAAuB,oBAAI,gBAAgB;MAC1C,WAAW,KAAK,MAAM;MACtB;MACA;MACA,SAAS,KAAK,WAAW,KAAK,IAAI;KACnC,CAAC;IACF;IACA,OAAO,KAAK,MAAM;GACnB;EACD;CACD,GAAG,CAAC;EACH,KAAK;EACL,OAAO,SAAS,yBAAyB,OAAO;GAC/C,OAAO;IACN,UAAU;IACV;GACD;EACD;CACD,CAAC,CAAC;CACF,OAAO;AACR,EAAC,CAAE,MAAM,SAAS"}
|
|
1
|
+
{"version":3,"file":"useScreens.native.js","names":[],"sources":["esm/router/useScreens.native.js"],"sourcesContent":["import { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport React, { Suspense, createElement, memo, useContext } from \"react\";\nimport { createNavigatorFactory } from \"@react-navigation/core\";\nimport { getClientMatchesSnapshot } from \"../useMatches\";\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 { getServerContext, useServerContext } from \"../vite/one-server-only\";\nimport { getReactNavigationRouteName } from \"../getReactNavigationConfig\";\nimport { filterRootHTML } from \"./filterRootHTML\";\nimport { Route, RouteParamsContext, SuspenseFallbackContext, useRouteNode } from \"./Route\";\nimport { getRouteHmrEpoch, subscribeRouteHmr } from \"./routeHmr\";\nimport { SpaShellContext } from \"./SpaShellContext\";\nimport { sortRoutesWithInitial } from \"./sortRoutes\";\n\nfunction _assert_this_initialized(self) {\n\tif (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n\treturn self;\n}\nfunction _call_super(_this, derived, args) {\n\tderived = _get_prototype_of(derived);\n\treturn _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));\n}\nfunction _class_call_check(instance, Constructor) {\n\tif (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction _defineProperties(target, props) {\n\tfor (var i = 0; i < props.length; i++) {\n\t\tvar descriptor = props[i];\n\t\tdescriptor.enumerable = descriptor.enumerable || false;\n\t\tdescriptor.configurable = true;\n\t\tif (\"value\" in descriptor) descriptor.writable = true;\n\t\tObject.defineProperty(target, descriptor.key, descriptor);\n\t}\n}\nfunction _create_class(Constructor, protoProps, staticProps) {\n\tif (protoProps) _defineProperties(Constructor.prototype, protoProps);\n\tif (staticProps) _defineProperties(Constructor, staticProps);\n\treturn Constructor;\n}\nfunction _get_prototype_of(o) {\n\t_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o2) {\n\t\treturn o2.__proto__ || Object.getPrototypeOf(o2);\n\t};\n\treturn _get_prototype_of(o);\n}\nfunction _inherits(subClass, superClass) {\n\tif (typeof superClass !== \"function\" && superClass !== null) throw new TypeError(\"Super expression must either be null or a function\");\n\tsubClass.prototype = Object.create(superClass && superClass.prototype, { constructor: {\n\t\tvalue: subClass,\n\t\twritable: true,\n\t\tconfigurable: true\n\t} });\n\tif (superClass) _set_prototype_of(subClass, superClass);\n}\nfunction _is_native_reflect_construct() {\n\ttry {\n\t\tvar result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));\n\t} catch (_) {}\n\treturn (_is_native_reflect_construct = function() {\n\t\treturn !!result;\n\t})();\n}\nfunction _possible_constructor_return(self, call) {\n\tif (call && (_type_of(call) === \"object\" || typeof call === \"function\")) return call;\n\treturn _assert_this_initialized(self);\n}\nfunction _set_prototype_of(o, p) {\n\t_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o2, p2) {\n\t\to2.__proto__ = p2;\n\t\treturn o2;\n\t};\n\treturn _set_prototype_of(o, p);\n}\nfunction _type_of(obj) {\n\t\"@swc/helpers - typeof\";\n\treturn obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar { Screen, Group } = createNavigatorFactory({})();\ntypeof document !== \"undefined\" && typeof document.querySelectorAll === \"function\" && (function() {\n\tvar elements = [];\n\tdocument.querySelectorAll(\"style[id^=\\\"__one_css_\\\"], link[rel=\\\"stylesheet\\\"][data-one-css]\").forEach(function(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\tvar 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})();\nfunction RootLayoutRenderer(param) {\n\tvar { LayoutComponent, layoutProps, forwardedRef } = param;\n\tif (process.env.NODE_ENV === \"development\" && false);\n\tvar { children, bodyProps, head, htmlProps } = filterRootHTML(LayoutComponent(layoutProps, forwardedRef));\n\tvar { children: headChildren, ...headProps } = (head === null || head === void 0 ? void 0 : head.props) || {};\n\tuseServerContext();\n\treturn children;\n}\nfunction getSortedChildren(children, order, initialRouteName, options) {\n\tvar _ref;\n\tif (!(order === null || order === void 0 ? void 0 : order.length)) return children.sort(sortRoutesWithInitial(initialRouteName)).map(function(route) {\n\t\treturn {\n\t\t\troute,\n\t\t\tprops: {}\n\t\t};\n\t});\n\tvar entries = [...children];\n\tvar ordered = order.map(function(param) {\n\t\tvar { name, redirect, initialParams, listeners, options: _$options, getId } = param;\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\tvar matchIndex = entries.findIndex(function(child) {\n\t\t\treturn child.route === name;\n\t\t});\n\t\tif (matchIndex === -1) {\n\t\t\tconsole.warn(`[Layout children]: No route named \"${name}\" exists in nested children:`, children.map(function(param2) {\n\t\t\t\tvar { route } = param2;\n\t\t\t\treturn route;\n\t\t\t}));\n\t\t\treturn null;\n\t\t}\n\t\tvar 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: _$options,\n\t\t\t\tgetId\n\t\t\t}\n\t\t};\n\t}).filter(Boolean);\n\tvar remaining = (_ref = options === null || options === void 0 ? void 0 : options.remaining) !== null && _ref !== void 0 ? _ref : \"all\";\n\tif (remaining !== \"none\") ordered.push(...entries.filter(function(route) {\n\t\treturn remaining === \"all\" || !route.generated;\n\t}).sort(sortRoutesWithInitial(initialRouteName)).map(function(route) {\n\t\treturn {\n\t\t\troute,\n\t\t\tprops: {}\n\t\t};\n\t}));\n\treturn ordered;\n}\nfunction useSortedScreens(order, options) {\n\tvar node = useRouteNode();\n\treturn React.useMemo(function() {\n\t\tvar _node_children;\n\t\treturn ((node === null || node === void 0 ? void 0 : (_node_children = node.children) === null || _node_children === void 0 ? void 0 : _node_children.length) ? getSortedChildren(node.children, order, node.initialRouteName, options) : []).filter(function(value) {\n\t\t\tvar _options_protectedScreens, _options_protectedScreens1;\n\t\t\tvar routeName = value.route.route;\n\t\t\tvar normalized = routeName.replace(/\\/index$/, \"\");\n\t\t\treturn !((options === null || options === void 0 ? void 0 : (_options_protectedScreens = options.protectedScreens) === null || _options_protectedScreens === void 0 ? void 0 : _options_protectedScreens.has(routeName)) || (options === null || options === void 0 ? void 0 : (_options_protectedScreens1 = options.protectedScreens) === null || _options_protectedScreens1 === void 0 ? void 0 : _options_protectedScreens1.has(normalized)));\n\t\t}).map(function(value) {\n\t\t\treturn routeToScreen(value.route, value.props);\n\t\t});\n\t}, [\n\t\tnode === null || node === void 0 ? void 0 : node.children,\n\t\tnode === null || node === void 0 ? void 0 : node.initialRouteName,\n\t\torder,\n\t\toptions === null || options === void 0 ? void 0 : options.protectedScreens\n\t]);\n}\nfunction fromImport(param) {\n\tvar { ErrorBoundary, SuspenseFallback, ...component } = param;\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tvar 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(param) {\n\tvar { component: Component, route } = param;\n\tvar params = useContext(RouteParamsContext);\n\treturn Component ? /* @__PURE__ */ jsx(Component, {\n\t\troute,\n\t\tparams: params !== null && params !== void 0 ? params : {}\n\t}) : null;\n}\nvar qualifiedStore = /* @__PURE__ */ new WeakMap();\nfunction getRouteMatchesForProps() {\n\tvar _ref;\n\tvar _getServerContext;\n\tvar serverMatches = (_ref = (_getServerContext = getServerContext()) === null || _getServerContext === void 0 ? void 0 : _getServerContext.matches) !== null && _ref !== void 0 ? _ref : [];\n\tif (process.env.VITE_ENVIRONMENT === \"ssr\") return serverMatches;\n\tvar clientMatches = getClientMatchesSnapshot();\n\treturn clientMatches.length ? clientMatches : serverMatches;\n}\nfunction getQualifiedRouteComponent(value) {\n\tif (value && qualifiedStore.has(value)) return qualifiedStore.get(value);\n\tvar ScreenComponent = /* @__PURE__ */ React.forwardRef(function(props, ref) {\n\t\tvar _value_children;\n\t\tif (process.env.NODE_ENV === \"development\" && false);\n\t\tif (process.env.NODE_ENV === \"development\" && true) React.useSyncExternalStore(subscribeRouteHmr, getRouteHmrEpoch, getRouteHmrEpoch);\n\t\tvar isSpaShell = useContext(SpaShellContext);\n\t\tvar InheritedSuspenseFallback = useContext(SuspenseFallbackContext);\n\t\tvar matches = getRouteMatchesForProps();\n\t\tif (isSpaShell && props.segment !== \"\") {\n\t\t\tvar _value_children1;\n\t\t\tif (!(((_value_children1 = value.children) === null || _value_children1 === void 0 ? void 0 : _value_children1.length) && (value.layoutRenderMode === \"ssg\" || value.layoutRenderMode === \"ssr\"))) return /* @__PURE__ */ jsx(\"div\", { \"data-one-spa-content\": \"\" });\n\t\t}\n\t\tvar res = fromImport(value.loadRoute());\n\t\tvar Component = res.default || EmptyRoute;\n\t\tvar CatchBoundary = res.ErrorBoundary;\n\t\tvar LayoutSuspenseFallback = value.type === \"layout\" ? res.SuspenseFallback : void 0;\n\t\tvar match = matches.find(function(match2) {\n\t\t\treturn match2.routeId === value.contextKey;\n\t\t}) || (!((_value_children = value.children) === null || _value_children === void 0 ? void 0 : _value_children.length) ? matches[matches.length - 1] : void 0);\n\t\tvar 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\tvar slotProps = {};\n\t\tif (value.slots && value.slots.size > 0) {\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = value.slots[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar [slotName] = _step.value;\n\t\t\t\t\tslotProps[slotName] = /* @__PURE__ */ jsx(NamedSlot, {\n\t\t\t\t\t\tname: slotName,\n\t\t\t\t\t\tlayoutContextKey: value.contextKey\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvar 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\tvar 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\tvar providedSuspenseFallback = LayoutSuspenseFallback !== null && LayoutSuspenseFallback !== void 0 ? 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\tvar wrapSuspense = function wrapSuspense2(children, SuspenseFallback) {\n\t\tvar 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_NATIVE === \"0\" || globalThis.__ONE_DISABLE_SUSPENSE_ROUTES__ === true) return children;\n\t\treturn /* @__PURE__ */ jsx(Suspense, {\n\t\t\tfallback,\n\t\t\tchildren\n\t\t});\n\t};\n\tvar QualifiedRoute = /* @__PURE__ */ React.forwardRef(function(param, ref) {\n\t\tvar { route, navigation, ...props } = param;\n\t\tvar 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\tvar Memoized = /* @__PURE__ */ memo(QualifiedRoute);\n\tqualifiedStore.set(value, Memoized);\n\treturn Memoized;\n}\nfunction createGetIdForRoute(route) {\n\tvar include = /* @__PURE__ */ new Map();\n\tif (route.dynamic) {\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = route.dynamic[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar segment = _step.value;\n\t\t\t\tinclude.set(segment.name, segment);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t}\n\treturn function() {\n\t\tvar { params = {} } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\t\tvar _segments_join;\n\t\tvar segments = [];\n\t\tvar _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator2 = include.values()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t\t\t\tvar dynamic = _step2.value;\n\t\t\t\tvar value = params === null || params === void 0 ? void 0 : params[dynamic.name];\n\t\t\t\tif (Array.isArray(value) && value.length > 0) segments.push(value.join(\"/\"));\n\t\t\t\telse if (value && !Array.isArray(value)) segments.push(value);\n\t\t\t\telse if (dynamic.deep) segments.push(`[...${dynamic.name}]`);\n\t\t\t\telse segments.push(`[${dynamic.name}]`);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError2 = true;\n\t\t\t_iteratorError2 = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError2) throw _iteratorError2;\n\t\t\t}\n\t\t}\n\t\treturn (_segments_join = segments.join(\"/\")) !== null && _segments_join !== void 0 ? _segments_join : route.contextKey;\n\t};\n}\nfunction routeToScreen(route) {\n\tvar { options, ...props } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n\tvar _props_getId;\n\tvar navigationRouteName = getReactNavigationRouteName(route);\n\treturn /* @__PURE__ */ createElement(Screen, {\n\t\t...props,\n\t\tgetId: (_props_getId = props.getId) !== null && _props_getId !== void 0 ? _props_getId : createGetIdForRoute(route),\n\t\tname: navigationRouteName,\n\t\tkey: navigationRouteName,\n\t\toptions: function options1(args) {\n\t\t\tvar _route_loadRoute;\n\t\t\tvar staticOptions = route.generated ? (_route_loadRoute = route.loadRoute()) === null || _route_loadRoute === void 0 ? void 0 : _route_loadRoute.getNavOptions : null;\n\t\t\tvar staticResult = typeof staticOptions === \"function\" ? staticOptions(args) : staticOptions;\n\t\t\tvar dynamicResult = typeof options === \"function\" ? options === null || options === void 0 ? void 0 : options(args) : options;\n\t\t\tvar 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 = function() {\n\t\t\t\t\treturn null;\n\t\t\t\t};\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: function getComponent() {\n\t\t\treturn getQualifiedRouteComponent(route);\n\t\t}\n\t});\n}\nvar ROUTE_ERROR_BOUNDARY_INITIAL_STATE = {\n\thasError: false,\n\terror: null,\n\terrorInfo: null\n};\nvar RouteErrorBoundary = /* @__PURE__ */ (function(_React_Component) {\n\t\"use strict\";\n\t_inherits(RouteErrorBoundary2, _React_Component);\n\tfunction RouteErrorBoundary2(props) {\n\t\t_class_call_check(this, RouteErrorBoundary2);\n\t\tvar _this = _call_super(this, RouteErrorBoundary2, [props]);\n\t\t_this.state = ROUTE_ERROR_BOUNDARY_INITIAL_STATE;\n\t\treturn _this;\n\t}\n\t_create_class(RouteErrorBoundary2, [\n\t\t{\n\t\t\tkey: \"componentDidCatch\",\n\t\t\tvalue: function componentDidCatch(error, errorInfo) {\n\t\t\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\t\t\tthis.setState({ errorInfo });\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tkey: \"clearError\",\n\t\t\tvalue: function clearError() {\n\t\t\t\tthis.setState(ROUTE_ERROR_BOUNDARY_INITIAL_STATE);\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tkey: \"render\",\n\t\t\tvalue: function render() {\n\t\t\t\tif (this.state.hasError) {\n\t\t\t\t\tvar { error, errorInfo } = this.state;\n\t\t\t\t\treturn /* @__PURE__ */ jsx(RouteErrorView, {\n\t\t\t\t\t\trouteName: this.props.routeName,\n\t\t\t\t\t\terror,\n\t\t\t\t\t\terrorInfo,\n\t\t\t\t\t\tonRetry: this.clearError.bind(this)\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this.props.children;\n\t\t\t}\n\t\t}\n\t], [{\n\t\tkey: \"getDerivedStateFromError\",\n\t\tvalue: function getDerivedStateFromError(error) {\n\t\t\treturn {\n\t\t\t\thasError: true,\n\t\t\t\terror\n\t\t\t};\n\t\t}\n\t}]);\n\treturn RouteErrorBoundary2;\n})(React.Component);\n\nexport { Group, Screen, createGetIdForRoute, getQualifiedRouteComponent, useSortedScreens };"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,SAAS,yBAAyB,MAAM;CACvC,IAAI,SAAS,KAAK,GAAG,MAAM,IAAI,eAAe,2DAA2D;CACzG,OAAO;AACR;AACA,SAAS,YAAY,OAAO,SAAS,MAAM;CAC1C,UAAU,kBAAkB,OAAO;CACnC,OAAO,6BAA6B,OAAO,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CACD,CAAC,CAAC;CACF,OAAO;AACR,EAAC,CAAE,MAAM,SAAS"}
|
|
@@ -165,7 +165,7 @@ private struct ActionTabHook: UIViewRepresentable {
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
//
|
|
168
|
+
// navigation and tab bars follow the scroll view named for their top and bottom edges.
|
|
169
169
|
// SwiftUI names the ScrollViews it draws itself, but a React Native ScrollView is a UIScrollView
|
|
170
170
|
// inside a representable it cannot see, so the page's first scroll view is named on every
|
|
171
171
|
// controller from the page's root up to the tab bar controller.
|
|
@@ -173,6 +173,7 @@ private func nameContentScrollView(of page: UIView, from controller: UIViewContr
|
|
|
173
173
|
guard let scrollView = firstScrollView(in: page) else { return }
|
|
174
174
|
var next: UIViewController? = controller
|
|
175
175
|
while let current = next, current !== tabBarController {
|
|
176
|
+
if current.contentScrollView(for: .top) !== scrollView { current.setContentScrollView(scrollView, for: .top) }
|
|
176
177
|
if current.contentScrollView(for: .bottom) !== scrollView { current.setContentScrollView(scrollView, for: .bottom) }
|
|
177
178
|
next = current.parent
|
|
178
179
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "one",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.10",
|
|
4
4
|
"description": "One is a React framework for web, iOS, and Android apps.",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"sideEffects": [
|
|
@@ -282,15 +282,15 @@
|
|
|
282
282
|
"@react-navigation/routers": "8.0.0-alpha.21",
|
|
283
283
|
"@rozenite/middleware": "^2.5.0",
|
|
284
284
|
"@ungap/structured-clone": "^1.2.0",
|
|
285
|
-
"@vxrn/color-scheme": "2.13.
|
|
286
|
-
"@vxrn/compiler": "2.13.
|
|
287
|
-
"@vxrn/resolve": "2.13.
|
|
288
|
-
"@vxrn/tslib-lite": "2.13.
|
|
289
|
-
"@vxrn/use-isomorphic-layout-effect": "2.13.
|
|
290
|
-
"@vxrn/utils": "2.13.
|
|
285
|
+
"@vxrn/color-scheme": "2.13.10",
|
|
286
|
+
"@vxrn/compiler": "2.13.10",
|
|
287
|
+
"@vxrn/resolve": "2.13.10",
|
|
288
|
+
"@vxrn/tslib-lite": "2.13.10",
|
|
289
|
+
"@vxrn/use-isomorphic-layout-effect": "2.13.10",
|
|
290
|
+
"@vxrn/utils": "2.13.10",
|
|
291
291
|
"citty": "^0.1.6",
|
|
292
292
|
"core-js": "^3.38.1",
|
|
293
|
-
"create-vxrn": "2.13.
|
|
293
|
+
"create-vxrn": "2.13.10",
|
|
294
294
|
"escape-string-regexp": "^5.0.0",
|
|
295
295
|
"fast-deep-equal": "^3.1.3",
|
|
296
296
|
"fast-glob": "^3.3.3",
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
"tsconfig-paths": "^4",
|
|
313
313
|
"use-latest-callback": "^0.3.5",
|
|
314
314
|
"vite": "^8.2.2",
|
|
315
|
-
"vxrn": "2.13.
|
|
315
|
+
"vxrn": "2.13.10",
|
|
316
316
|
"web-streams-polyfill": "^4.3.0",
|
|
317
317
|
"ws": "^8.21.0",
|
|
318
318
|
"xxhashjs": "^0.2.2"
|
|
@@ -342,7 +342,7 @@
|
|
|
342
342
|
"@babel/types": "^7.28.5",
|
|
343
343
|
"babel-dead-code-elimination": "1.0.10",
|
|
344
344
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
345
|
-
"@vxrn/vite-plugin-metro": "2.13.
|
|
345
|
+
"@vxrn/vite-plugin-metro": "2.13.10"
|
|
346
346
|
},
|
|
347
347
|
"peerDependenciesMeta": {
|
|
348
348
|
"@react-native/babel-preset": {
|
|
@@ -416,7 +416,7 @@
|
|
|
416
416
|
"@types/react-dom": "^19.3.0",
|
|
417
417
|
"@types/react-test-renderer": "^19.1.0",
|
|
418
418
|
"@types/xxhashjs": "^0.2.4",
|
|
419
|
-
"@vxrn/emitter": "2.13.
|
|
419
|
+
"@vxrn/emitter": "2.13.10",
|
|
420
420
|
"depcheck": "^1.4.7",
|
|
421
421
|
"esbuild": "^0.25.12",
|
|
422
422
|
"immer": "^10.1.1",
|
|
@@ -444,7 +444,7 @@
|
|
|
444
444
|
"@babel/types": "^7.28.5",
|
|
445
445
|
"babel-dead-code-elimination": "1.0.10",
|
|
446
446
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
447
|
-
"@vxrn/vite-plugin-metro": "2.13.
|
|
447
|
+
"@vxrn/vite-plugin-metro": "2.13.10"
|
|
448
448
|
},
|
|
449
449
|
"publishConfig": {
|
|
450
450
|
"access": "public"
|
|
@@ -612,7 +612,7 @@
|
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
614
|
},
|
|
615
|
-
"releaseSourceCommit": "
|
|
615
|
+
"releaseSourceCommit": "10ae059cc30ab9f70a12d9711ba8346d596d61d2",
|
|
616
616
|
"repository": {
|
|
617
617
|
"type": "git",
|
|
618
618
|
"url": "git+https://github.com/onejs/one.git",
|
package/run.mjs
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
// before cli-dev-memory and cli, which load rolldown. matches checkNodeVersion.ts.
|
|
4
|
+
const [major, minor] = process.versions.node.split('.').map((part) => Number(part))
|
|
5
|
+
if (!((major === 20 && minor >= 19) || (major === 22 && minor >= 12) || major > 22)) {
|
|
6
|
+
console.error('One requires Node ^20.19.0 || >=22.12.0')
|
|
7
|
+
process.exit(1)
|
|
8
|
+
}
|
|
9
|
+
|
|
3
10
|
if (process.argv[2] === 'dev') {
|
|
4
11
|
const { initializeDevAllocator } = await import('./dist/esm/cli-dev-memory.mjs')
|
|
5
12
|
await initializeDevAllocator()
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
+
// process.versions.node is "20.19.0". process.version is "v20.19.0", and +"v20" is NaN.
|
|
2
|
+
// rolldown and vite require this range. keep run.mjs in step with it.
|
|
1
3
|
export function checkNodeVersion() {
|
|
2
|
-
const [major, minor] = process.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
process.exit(1)
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
if (+major === 20 && +minor < 12) {
|
|
10
|
-
console.error(`One requires Node >= 20.11 (for import.meta.dirname support)`)
|
|
11
|
-
process.exit(1)
|
|
12
|
-
}
|
|
4
|
+
const [major, minor] = process.versions.node.split('.').map((part) => Number(part))
|
|
5
|
+
if ((major === 20 && minor >= 19) || (major === 22 && minor >= 12) || major > 22) return
|
|
6
|
+
console.error('One requires Node ^20.19.0 || >=22.12.0')
|
|
7
|
+
process.exit(1)
|
|
13
8
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
2
|
import os from 'node:os'
|
|
3
3
|
import path from 'node:path'
|
|
4
|
+
import { createRequire } from 'node:module'
|
|
4
5
|
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
5
6
|
import { getViteMetroPluginOptions } from './getViteMetroPluginOptions'
|
|
6
7
|
|
|
@@ -37,9 +38,7 @@ describe('getViteMetroPluginOptions babel-config coexistence', () => {
|
|
|
37
38
|
projectRoot: isolatedApp,
|
|
38
39
|
relativeRouterRoot: 'app',
|
|
39
40
|
})
|
|
40
|
-
).toThrow(
|
|
41
|
-
/Metro requires @vxrn\/vite-plugin-metro and babel-preset-expo in the app.*Install with/
|
|
42
|
-
)
|
|
41
|
+
).toThrow(/Metro requires @vxrn\/vite-plugin-metro in the app.*Install with/)
|
|
43
42
|
} finally {
|
|
44
43
|
fs.rmSync(isolatedApp, { recursive: true, force: true })
|
|
45
44
|
}
|
|
@@ -58,6 +57,37 @@ describe('getViteMetroPluginOptions babel-config coexistence', () => {
|
|
|
58
57
|
expect(opts?.babelConfig?.plugins?.length).toBe(5)
|
|
59
58
|
})
|
|
60
59
|
|
|
60
|
+
it('starts Metro without the unused Expo preset in an isolated app', () => {
|
|
61
|
+
const isolatedApp = fs.mkdtempSync(path.join(os.tmpdir(), 'one-metro-no-expo-'))
|
|
62
|
+
const workspaceRoot = path.resolve(__dirname, '../../../../')
|
|
63
|
+
try {
|
|
64
|
+
fs.writeFileSync(
|
|
65
|
+
path.join(isolatedApp, 'package.json'),
|
|
66
|
+
JSON.stringify({ name: 'tmp' })
|
|
67
|
+
)
|
|
68
|
+
fs.writeFileSync(
|
|
69
|
+
path.join(isolatedApp, 'tsconfig.json'),
|
|
70
|
+
JSON.stringify({ compilerOptions: { paths: {} } })
|
|
71
|
+
)
|
|
72
|
+
for (const name of ['one', '@vxrn/utils', '@vxrn/vite-plugin-metro']) {
|
|
73
|
+
const destination = path.join(isolatedApp, 'node_modules', name)
|
|
74
|
+
fs.mkdirSync(path.dirname(destination), { recursive: true })
|
|
75
|
+
fs.symlinkSync(path.join(workspaceRoot, 'node_modules', name), destination, 'dir')
|
|
76
|
+
}
|
|
77
|
+
expect(() =>
|
|
78
|
+
createRequire(isolatedApp + '/').resolve('babel-preset-expo')
|
|
79
|
+
).toThrow()
|
|
80
|
+
const opts = getViteMetroPluginOptions({
|
|
81
|
+
projectRoot: isolatedApp,
|
|
82
|
+
relativeRouterRoot: 'app',
|
|
83
|
+
})
|
|
84
|
+
expect(opts.oneViteMetroBabelConfig).toBe(true)
|
|
85
|
+
expect(opts.babelConfig?.plugins).toHaveLength(5)
|
|
86
|
+
} finally {
|
|
87
|
+
fs.rmSync(isolatedApp, { recursive: true, force: true })
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
|
|
61
91
|
it('still injects One plugins when the user has a babel.config.cjs', () => {
|
|
62
92
|
const cfgPath = path.join(tmpDir, 'babel.config.cjs')
|
|
63
93
|
fs.writeFileSync(cfgPath, "module.exports = require('one/babel-preset')\n")
|
|
@@ -19,19 +19,13 @@ export function getViteMetroPluginOptions({
|
|
|
19
19
|
Parameters<typeof metroPlugin>[0]
|
|
20
20
|
>['defaultConfigOverrides']
|
|
21
21
|
setupFile?: string | { native?: string; ios?: string; android?: string }
|
|
22
|
-
}): Parameters<typeof metroPlugin>[0] {
|
|
22
|
+
}): NonNullable<Parameters<typeof metroPlugin>[0]> {
|
|
23
23
|
const require = createRequire(projectRoot + '/')
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return false
|
|
28
|
-
} catch {
|
|
29
|
-
return true
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
if (missing.length) {
|
|
24
|
+
try {
|
|
25
|
+
require.resolve('@vxrn/vite-plugin-metro')
|
|
26
|
+
} catch {
|
|
33
27
|
throw new Error(
|
|
34
|
-
`[one] Metro requires
|
|
28
|
+
`[one] Metro requires @vxrn/vite-plugin-metro in the app at ${projectRoot}. Install with your package manager, or remove native.bundler: 'metro' to use One's default native bundler.`
|
|
35
29
|
)
|
|
36
30
|
}
|
|
37
31
|
|
|
@@ -43,7 +43,9 @@ for (const name of readdirSync(tmpdir())) {
|
|
|
43
43
|
}
|
|
44
44
|
const scratchDirs: string[] = []
|
|
45
45
|
function makeScratch(name: string): string {
|
|
46
|
-
const dir = realpathSync(
|
|
46
|
+
const dir = realpathSync(
|
|
47
|
+
mkdtempSync(join(tmpdir(), `one-packed-${name}-${process.pid}-`))
|
|
48
|
+
)
|
|
47
49
|
scratchDirs.push(dir)
|
|
48
50
|
return dir
|
|
49
51
|
}
|
|
@@ -251,7 +253,7 @@ console.log('one/native ok ' + url);
|
|
|
251
253
|
expect(out).not.toContain(workspaceRoot)
|
|
252
254
|
})
|
|
253
255
|
|
|
254
|
-
it('keeps the
|
|
256
|
+
it('keeps the packed closure Expo-free and bundles Metro without an Expo preset', () => {
|
|
255
257
|
const tmp = makeScratch('metro')
|
|
256
258
|
const tarballs = join(tmp, 'tarballs')
|
|
257
259
|
mkdirSync(tarballs)
|
|
@@ -410,25 +412,17 @@ if (!config.dependencies['react-native-nitro-modules']) {
|
|
|
410
412
|
encoding: 'utf8',
|
|
411
413
|
})
|
|
412
414
|
|
|
413
|
-
expect(() =>
|
|
414
|
-
execFileSync(
|
|
415
|
-
process.execPath,
|
|
416
|
-
['-e', "require('./metro.config.cjs').catch((error) => { console.error(error.message); process.exitCode = 1 })"],
|
|
417
|
-
{ cwd: appDir, encoding: 'utf8' }
|
|
418
|
-
)
|
|
419
|
-
).toThrow(/Metro requires babel-preset-expo in the app.*Install with/)
|
|
420
|
-
|
|
421
|
-
const expoPresetVersion = JSON.parse(
|
|
422
|
-
readFileSync(join(workspaceRoot, '../node_modules/babel-preset-expo/package.json'), 'utf8')
|
|
423
|
-
).version
|
|
424
|
-
execFileSync('bun', ['add', '-d', `babel-preset-expo@${expoPresetVersion}`], {
|
|
425
|
-
cwd: appDir,
|
|
426
|
-
encoding: 'utf8',
|
|
427
|
-
timeout: 180_000,
|
|
428
|
-
})
|
|
429
415
|
expect(
|
|
430
416
|
existsSync(join(appDir, 'node_modules', 'babel-preset-expo', 'package.json'))
|
|
431
|
-
).toBe(
|
|
417
|
+
).toBe(false)
|
|
418
|
+
execFileSync(
|
|
419
|
+
process.execPath,
|
|
420
|
+
[
|
|
421
|
+
'-e',
|
|
422
|
+
"require('./metro.config.cjs').catch((error) => { console.error(error.message); process.exitCode = 1 })",
|
|
423
|
+
],
|
|
424
|
+
{ cwd: appDir, encoding: 'utf8' }
|
|
425
|
+
)
|
|
432
426
|
|
|
433
427
|
// the installed package supplies real runtime facades. an app with no local
|
|
434
428
|
// ios prebuild must bundle those same files, without fabricated SDK modules.
|
|
@@ -444,14 +438,21 @@ if (!config.dependencies['react-native-nitro-modules']) {
|
|
|
444
438
|
// keeps only phase lines.
|
|
445
439
|
writeFileSync(
|
|
446
440
|
join(appDir, 'metro-build.cjs'),
|
|
447
|
-
`
|
|
441
|
+
`process.env.ONE_METRO_NATIVE_TRANSFORMS = '1'
|
|
442
|
+
const { loadConfig } = require('metro-config')
|
|
448
443
|
const { runMetro } = require('metro')
|
|
449
444
|
const output = require('metro/private/shared/output/bundle')
|
|
450
445
|
const path = require('node:path')
|
|
446
|
+
const fs = require('node:fs')
|
|
447
|
+
const assert = require('node:assert/strict')
|
|
448
|
+
const formatBundlingError = require('metro/private/lib/formatBundlingError').default
|
|
449
|
+
const { patchMetroServerWithViteConfigAndMetroPluginOptions } = require('@vxrn/vite-plugin-metro')
|
|
450
|
+
const { buildOneBabelPlugins } = require('one/babel-preset')
|
|
451
451
|
const started = Date.now()
|
|
452
452
|
const stamp = () => '+' + ((Date.now() - started) / 1000).toFixed(1) + 's'
|
|
453
453
|
async function build() {
|
|
454
454
|
const config = await loadConfig({ config: 'metro.config.cjs', maxWorkers: 2 })
|
|
455
|
+
assert.equal(config.transformerPath, require.resolve('@vxrn/vite-plugin-metro/transformer/metroNativeWorker'))
|
|
455
456
|
config.reporter = {
|
|
456
457
|
update(event) {
|
|
457
458
|
if (event.type === 'initialize_done') console.log(stamp() + ' haste ready')
|
|
@@ -460,8 +461,43 @@ async function build() {
|
|
|
460
461
|
else if (event.type === 'bundle_build_failed' || event.type === 'initialize_failed') console.log(stamp() + ' failed ' + event.type)
|
|
461
462
|
},
|
|
462
463
|
}
|
|
464
|
+
const syntaxCases = [
|
|
465
|
+
['broken.tsx', '// ascii', '\\n'],
|
|
466
|
+
['broken-unicode.tsx', '// café🙂', '\\n'],
|
|
467
|
+
['broken-crlf.tsx', '// café🙂', '\\r\\n'],
|
|
468
|
+
]
|
|
469
|
+
for (const [filename, heading, newline] of syntaxCases) {
|
|
470
|
+
fs.writeFileSync(filename, [heading, '// second', '// third', 'const greeting = ;', ''].join(newline))
|
|
471
|
+
}
|
|
463
472
|
const server = await runMetro(config, { watch: false })
|
|
473
|
+
// use the same server patch as one's native bundle command.
|
|
474
|
+
patchMetroServerWithViteConfigAndMetroPluginOptions(
|
|
475
|
+
server,
|
|
476
|
+
{ root: process.cwd(), mode: 'development', base: '/', env: {} },
|
|
477
|
+
{
|
|
478
|
+
oneViteMetroBabelConfig: true,
|
|
479
|
+
babelConfig: { plugins: buildOneBabelPlugins({
|
|
480
|
+
projectRoot: process.cwd(), relativeRouterRoot: 'app', includeImportMetaEnv: false,
|
|
481
|
+
}) },
|
|
482
|
+
}
|
|
483
|
+
)
|
|
464
484
|
try {
|
|
485
|
+
for (const [filename] of syntaxCases) {
|
|
486
|
+
let response
|
|
487
|
+
try {
|
|
488
|
+
await output.build(server, {
|
|
489
|
+
entryFile: filename, platform: 'android', dev: true, minify: false,
|
|
490
|
+
})
|
|
491
|
+
} catch (error) {
|
|
492
|
+
response = JSON.parse(JSON.stringify(formatBundlingError(error)))
|
|
493
|
+
}
|
|
494
|
+
assert.equal(response?.type, 'TransformError', JSON.stringify(response))
|
|
495
|
+
assert.equal(response.filename, filename)
|
|
496
|
+
assert.equal(response.lineNumber, 4)
|
|
497
|
+
assert.equal(response.column, 17)
|
|
498
|
+
assert.match(response.message, /Unexpected token/)
|
|
499
|
+
console.log(stamp() + ' Android syntax error location: ' + filename + ':4:17')
|
|
500
|
+
}
|
|
465
501
|
for (const dev of [true, false]) {
|
|
466
502
|
const bundle = await output.build(server, {
|
|
467
503
|
entryFile: 'node_modules/one/metro-entry.js',
|
|
@@ -489,8 +525,9 @@ build().catch(error => { console.error(error); process.exitCode = 1 })
|
|
|
489
525
|
timeout: 180_000,
|
|
490
526
|
})
|
|
491
527
|
for (const dev of ['true', 'false']) {
|
|
492
|
-
expect(readFileSync(join(appDir, `bundle.${dev}.js`)).byteLength)
|
|
493
|
-
|
|
528
|
+
expect(readFileSync(join(appDir, `bundle.${dev}.js`)).byteLength).toBeGreaterThan(
|
|
529
|
+
1_000_000
|
|
530
|
+
)
|
|
494
531
|
}
|
|
495
532
|
})
|
|
496
533
|
|