one 2.6.9 → 2.6.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/layouts/Stack.cjs +1 -1
- package/dist/cjs/layouts/Stack.native.cjs +1 -1
- package/dist/cjs/layouts/Stack.native.js +1 -1
- package/dist/cjs/layouts/Stack.native.js.map +1 -1
- package/dist/cjs/layouts/withLayoutContext.cjs +1 -1
- package/dist/cjs/layouts/withLayoutContext.native.cjs +1 -1
- package/dist/cjs/layouts/withLayoutContext.native.js +1 -1
- package/dist/cjs/layouts/withLayoutContext.native.js.map +1 -1
- package/dist/cjs/router/useScreens.cjs +2 -1
- package/dist/cjs/router/useScreens.native.cjs +5 -1
- package/dist/cjs/router/useScreens.native.js +5 -1
- package/dist/cjs/router/useScreens.native.js.map +1 -1
- package/dist/esm/layouts/Stack.mjs +1 -1
- package/dist/esm/layouts/Stack.mjs.map +1 -1
- package/dist/esm/layouts/Stack.native.js +1 -1
- package/dist/esm/layouts/Stack.native.js.map +1 -1
- package/dist/esm/layouts/withLayoutContext.mjs +1 -1
- package/dist/esm/layouts/withLayoutContext.mjs.map +1 -1
- package/dist/esm/layouts/withLayoutContext.native.js +1 -1
- package/dist/esm/layouts/withLayoutContext.native.js.map +1 -1
- package/dist/esm/router/useScreens.mjs +2 -1
- package/dist/esm/router/useScreens.mjs.map +1 -1
- package/dist/esm/router/useScreens.native.js +5 -1
- package/dist/esm/router/useScreens.native.js.map +1 -1
- package/package.json +12 -12
- package/src/layouts/Stack.tsx +1 -1
- package/src/layouts/withLayoutContext.test.tsx +53 -1
- package/src/layouts/withLayoutContext.tsx +7 -2
- package/src/router/useScreens.tsx +9 -3
- package/types/layouts/withLayoutContext.d.ts +2 -1
- package/types/layouts/withLayoutContext.d.ts.map +1 -1
- package/types/router/useScreens.d.ts +3 -1
- package/types/router/useScreens.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLayoutContext.native.js","names":[],"sources":["esm/layouts/withLayoutContext.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from \"react\";\nimport { getContextKey, stripInvisibleSegmentsFromPath } from \"../router/matchers\";\nimport { useContextKey, useRouteNode } from \"../router/Route\";\nimport { registerProtectedRoutes, replace, resolveProtectedHref, routeInfo, unregisterProtectedRoutes } from \"../router/router\";\nimport { useSortedScreens } from \"../router/useScreens\";\nimport { sortRoutesWithInitial } from \"../router/sortRoutes\";\nimport { withStaticProperties } from \"../utils/withStaticProperties\";\nimport { isProtectedElement } from \"../views/Protected\";\nimport { Screen } from \"../views/Screen\";\nimport { StackScreen } from \"./stack-utils/StackScreen\";\nimport { IsWithinNativeNavigator } from \"./NativeNavigatorContext\";\nfunction useFilterScreenChildren(children) {\n var { isCustomNavigator, contextKey } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : (\n /** Used for sending developer hints */\n {}\n );\n return React.useMemo(function() {\n var customChildren = [];\n var screens = [];\n var protectedScreens = /* @__PURE__ */ new Set();\n var guardedRedirects = /* @__PURE__ */ new Map();\n function flattenChild(child) {\n var exclude = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, redirectTo = arguments.length > 2 ? arguments[2] : void 0;\n if (/* @__PURE__ */ React.isValidElement(child) && (child.type === Screen || child.type === StackScreen)) {\n if (typeof child.props === \"object\" && child.props && \"name\" in child.props && !child.props.name) {\n throw new Error(`<Screen /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must have a \\`name\\` prop when used as a child of a Layout Route.`);\n }\n if (process.env.NODE_ENV !== \"production\") {\n if ([\n \"children\",\n \"component\",\n \"getComponent\"\n ].some(function(key) {\n return child.props && typeof child.props === \"object\" && key in child.props;\n })) {\n throw new Error(`<Screen /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must not have a \\`children\\`, \\`component\\`, or \\`getComponent\\` prop when used as a child of a Layout Route`);\n }\n }\n var screenProps = child.props;\n if (exclude && screenProps.name) {\n protectedScreens.add(screenProps.name);\n guardedRedirects.set(screenProps.name, redirectTo);\n } else {\n screens.push(screenProps);\n }\n return;\n }\n if (isProtectedElement(child)) {\n var guardFails = !child.props.guard;\n var excludeChildren = exclude || guardFails;\n var childRedirectTo = guardFails ? child.props.redirectTo : redirectTo;\n React.Children.forEach(child.props.children, function(nested) {\n flattenChild(nested, excludeChildren, childRedirectTo);\n });\n return;\n }\n if (isCustomNavigator) {\n customChildren.push(child);\n } else if (child != null && process.env.NODE_ENV === \"development\") {\n console.warn(`[one] a non-<Screen> child of the navigator at \"app${contextKey}/_layout\" renders on web only. On native this navigator is drawn by react-navigation and the child is ignored.`);\n }\n }\n React.Children.forEach(children, function(child) {\n return flattenChild(child);\n });\n if (process.env.NODE_ENV !== \"production\") {\n var names = screens.map(function(screen) {\n return screen.name;\n });\n if (names && new Set(names).size !== names.length) {\n throw new Error(\"Screen names must be unique: \" + names);\n }\n }\n return {\n screens,\n children: customChildren,\n protectedScreens,\n guardedRedirects\n };\n }, [\n children,\n contextKey,\n isCustomNavigator\n ]);\n}\nfunction useResolvedGuardedRedirects(guardedRedirects) {\n var node = useRouteNode();\n return React.useMemo(function() {\n if (!node) {\n return guardedRedirects;\n }\n var defaultRoute = [\n ...node.children\n ].sort(sortRoutesWithInitial(node.initialRouteName)).find(function(child) {\n var normalized = child.route.replace(/\\/index$/, \"\");\n return !(guardedRedirects.has(child.route) || guardedRedirects.has(normalized));\n });\n var defaultHref = defaultRoute ? stripInvisibleSegmentsFromPath(getContextKey(defaultRoute.contextKey)) || \"/\" : void 0;\n return new Map(Array.from(guardedRedirects, function(param) {\n var [name, redirectTo] = param;\n return [\n name,\n redirectTo !== null && redirectTo !== void 0 ? redirectTo : defaultHref\n ];\n }));\n }, [\n guardedRedirects,\n node\n ]);\n}\nfunction withLayoutContext(Nav, processor, options) {\n return withStaticProperties(/* @__PURE__ */ React.forwardRef(function(propsIn, ref) {\n var { children, ...props } = propsIn;\n var contextKey = useContextKey();\n var { screens, protectedScreens, guardedRedirects } = useFilterScreenChildren(children, {\n contextKey\n });\n var resolvedGuardedRedirects = useResolvedGuardedRedirects(guardedRedirects);\n registerProtectedRoutes(contextKey, resolvedGuardedRedirects);\n var currentPathname = routeInfo === null || routeInfo === void 0 ? void 0 : routeInfo.pathname;\n var protectedHref = currentPathname ? resolveProtectedHref(currentPathname) : currentPathname;\n React.useEffect(function() {\n registerProtectedRoutes(contextKey, resolvedGuardedRedirects);\n return function() {\n unregisterProtectedRoutes(contextKey);\n };\n }, [\n contextKey,\n resolvedGuardedRedirects\n ]);\n React.useEffect(function() {\n if (currentPathname && protectedHref && protectedHref !== currentPathname) {\n replace(protectedHref);\n }\n }, [\n currentPathname,\n protectedHref\n ]);\n var processed = processor ? processor(screens !== null && screens !== void 0 ? screens : []) : screens;\n var sorted = useSortedScreens(processed !== null && processed !== void 0 ? processed : [], {\n onlyMatching: true,\n protectedScreens\n });\n if (!sorted.length) {\n return null;\n }\n return /* @__PURE__ */ _jsx(IsWithinNativeNavigator.Provider, {\n value: true,\n children: /* @__PURE__ */ _jsx(Nav, {\n ...options === null || options === void 0 ? void 0 : options.props,\n ...props,\n ref,\n children: sorted\n })\n });\n }), {\n Screen\n });\n}\nexport {\n useFilterScreenChildren,\n useResolvedGuardedRedirects,\n withLayoutContext\n};\n//# sourceMappingURL=withLayoutContext.js.map\n"],"mappings":";;;;;;;;;;;;;;AAYA,SAAS,wBAAwB,UAAU;CACzC,IAAI,EAAE,mBAAmB,eAAe,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU;;CAElG,CAAC;CAEH,OAAO,MAAM,QAAQ,WAAW;EAC9B,IAAI,iBAAiB,CAAC;EACtB,IAAI,UAAU,CAAC;EACf,IAAI,mCAAmC,IAAI,IAAI;EAC/C,IAAI,mCAAmC,IAAI,IAAI;EAC/C,SAAS,aAAa,OAAO;GAC3B,IAAI,UAAU,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,OA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KAAK,IAAI,KAAK,IAAI,UAAU;EACtF,IAAI,gBAAgB,kBAAkB,qBAAqB,eAAe,IAAI;EAC9E,MAAM,UAAU,WAAW;GACzB,wBAAwB,YAAY,wBAAwB;GAC5D,OAAO,WAAW;IAChB,0BAA0B,UAAU;GACtC;EACF,GAAG,CACD,YACA,wBACF,CAAC;EACD,MAAM,UAAU,WAAW;GACzB,IAAI,mBAAmB,iBAAiB,kBAAkB,iBAAiB;IACzE,QAAQ,aAAa;GACvB;EACF,GAAG,CACD,iBACA,aACF,CAAC;EACD,IAAI,YAAY,YAAY,UAAU,YAAY,QAAQ,YAAY,KAAK,IAAI,UAAU,CAAC,CAAC,IAAI;EAC/F,IAAI,SAAS,iBAAiB,cAAc,QAAQ,cAAc,KAAK,IAAI,YAAY,CAAC,GAAG;GACzF,cAAc;GACd;EACF,CAAC;EACD,IAAI,CAAC,OAAO,QAAQ;GAClB,OAAO;EACT;EACA,OAAuB,oBAAK,wBAAwB,UAAU;GAC5D,OAAO;GACP,UAA0B,oBAAK,KAAK;IAClC,GAAG,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ;IAC7D,GAAG;IACH;IACA,UAAU;GACZ,CAAC;EACH,CAAC;CACH,CAAC,GAAG,EACF,OACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"withLayoutContext.native.js","names":[],"sources":["esm/layouts/withLayoutContext.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from \"react\";\nimport { getContextKey, stripInvisibleSegmentsFromPath } from \"../router/matchers\";\nimport { useContextKey, useRouteNode } from \"../router/Route\";\nimport { registerProtectedRoutes, replace, resolveProtectedHref, routeInfo, unregisterProtectedRoutes } from \"../router/router\";\nimport { useSortedScreens } from \"../router/useScreens\";\nimport { sortRoutesWithInitial } from \"../router/sortRoutes\";\nimport { withStaticProperties } from \"../utils/withStaticProperties\";\nimport { isProtectedElement } from \"../views/Protected\";\nimport { Screen } from \"../views/Screen\";\nimport { StackScreen } from \"./stack-utils/StackScreen\";\nimport { IsWithinNativeNavigator } from \"./NativeNavigatorContext\";\nfunction useFilterScreenChildren(children) {\n var { isCustomNavigator, contextKey } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : (\n /** Used for sending developer hints */\n {}\n );\n return React.useMemo(function() {\n var customChildren = [];\n var screens = [];\n var protectedScreens = /* @__PURE__ */ new Set();\n var guardedRedirects = /* @__PURE__ */ new Map();\n function flattenChild(child) {\n var exclude = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, redirectTo = arguments.length > 2 ? arguments[2] : void 0;\n if (/* @__PURE__ */ React.isValidElement(child) && (child.type === Screen || child.type === StackScreen)) {\n if (typeof child.props === \"object\" && child.props && \"name\" in child.props && !child.props.name) {\n throw new Error(`<Screen /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must have a \\`name\\` prop when used as a child of a Layout Route.`);\n }\n if (process.env.NODE_ENV !== \"production\") {\n if ([\n \"children\",\n \"component\",\n \"getComponent\"\n ].some(function(key) {\n return child.props && typeof child.props === \"object\" && key in child.props;\n })) {\n throw new Error(`<Screen /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must not have a \\`children\\`, \\`component\\`, or \\`getComponent\\` prop when used as a child of a Layout Route`);\n }\n }\n var screenProps = child.props;\n if (exclude && screenProps.name) {\n protectedScreens.add(screenProps.name);\n guardedRedirects.set(screenProps.name, redirectTo);\n } else {\n screens.push(screenProps);\n }\n return;\n }\n if (isProtectedElement(child)) {\n var guardFails = !child.props.guard;\n var excludeChildren = exclude || guardFails;\n var childRedirectTo = guardFails ? child.props.redirectTo : redirectTo;\n React.Children.forEach(child.props.children, function(nested) {\n flattenChild(nested, excludeChildren, childRedirectTo);\n });\n return;\n }\n if (isCustomNavigator) {\n customChildren.push(child);\n } else if (child != null && process.env.NODE_ENV === \"development\") {\n console.warn(`[one] a non-<Screen> child of the navigator at \"app${contextKey}/_layout\" renders on web only. On native this navigator is drawn by react-navigation and the child is ignored.`);\n }\n }\n React.Children.forEach(children, function(child) {\n return flattenChild(child);\n });\n if (process.env.NODE_ENV !== \"production\") {\n var names = screens.map(function(screen) {\n return screen.name;\n });\n if (names && new Set(names).size !== names.length) {\n throw new Error(\"Screen names must be unique: \" + names);\n }\n }\n return {\n screens,\n children: customChildren,\n protectedScreens,\n guardedRedirects\n };\n }, [\n children,\n contextKey,\n isCustomNavigator\n ]);\n}\nfunction useResolvedGuardedRedirects(guardedRedirects) {\n var node = useRouteNode();\n return React.useMemo(function() {\n if (!node) {\n return guardedRedirects;\n }\n var defaultRoute = [\n ...node.children\n ].sort(sortRoutesWithInitial(node.initialRouteName)).find(function(child) {\n var normalized = child.route.replace(/\\/index$/, \"\");\n return !(guardedRedirects.has(child.route) || guardedRedirects.has(normalized));\n });\n var defaultHref = defaultRoute ? stripInvisibleSegmentsFromPath(getContextKey(defaultRoute.contextKey)) || \"/\" : void 0;\n return new Map(Array.from(guardedRedirects, function(param) {\n var [name, redirectTo] = param;\n return [\n name,\n redirectTo !== null && redirectTo !== void 0 ? redirectTo : defaultHref\n ];\n }));\n }, [\n guardedRedirects,\n node\n ]);\n}\nfunction withLayoutContext(Nav, processor, options) {\n return withStaticProperties(/* @__PURE__ */ React.forwardRef(function(propsIn, ref) {\n var { children, ...props } = propsIn;\n var contextKey = useContextKey();\n var { screens, protectedScreens, guardedRedirects } = useFilterScreenChildren(children, {\n contextKey\n });\n var resolvedGuardedRedirects = useResolvedGuardedRedirects(guardedRedirects);\n registerProtectedRoutes(contextKey, resolvedGuardedRedirects);\n var currentPathname = routeInfo === null || routeInfo === void 0 ? void 0 : routeInfo.pathname;\n var protectedHref = currentPathname ? resolveProtectedHref(currentPathname) : currentPathname;\n React.useEffect(function() {\n registerProtectedRoutes(contextKey, resolvedGuardedRedirects);\n return function() {\n unregisterProtectedRoutes(contextKey);\n };\n }, [\n contextKey,\n resolvedGuardedRedirects\n ]);\n React.useEffect(function() {\n if (currentPathname && protectedHref && protectedHref !== currentPathname) {\n replace(protectedHref);\n }\n }, [\n currentPathname,\n protectedHref\n ]);\n var processed = processor ? processor(screens !== null && screens !== void 0 ? screens : []) : screens;\n var sorted = useSortedScreens(processed !== null && processed !== void 0 ? processed : [], {\n remaining: (options === null || options === void 0 ? void 0 : options.undeclaredRoutes) ? \"authored\" : \"none\",\n protectedScreens\n });\n if (!sorted.length) {\n return null;\n }\n return /* @__PURE__ */ _jsx(IsWithinNativeNavigator.Provider, {\n value: true,\n children: /* @__PURE__ */ _jsx(Nav, {\n ...options === null || options === void 0 ? void 0 : options.props,\n ...props,\n ref,\n children: sorted\n })\n });\n }), {\n Screen\n });\n}\nexport {\n useFilterScreenChildren,\n useResolvedGuardedRedirects,\n withLayoutContext\n};\n//# sourceMappingURL=withLayoutContext.js.map\n"],"mappings":";;;;;;;;;;;;;;AAYA,SAAS,wBAAwB,UAAU;CACzC,IAAI,EAAE,mBAAmB,eAAe,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU;;CAElG,CAAC;CAEH,OAAO,MAAM,QAAQ,WAAW;EAC9B,IAAI,iBAAiB,CAAC;EACtB,IAAI,UAAU,CAAC;EACf,IAAI,mCAAmC,IAAI,IAAI;EAC/C,IAAI,mCAAmC,IAAI,IAAI;EAC/C,SAAS,aAAa,OAAO;GAC3B,IAAI,UAAU,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,OAAO,aAAa,UAAU,SAAS,IAAI,UAAU,KAAK,KAAK;GAC9I,IAAoB,sBAAM,eAAe,KAAK,MAAM,MAAM,SAAS,UAAU,MAAM,SAAS,cAAc;IACxG,IAAI,OAAO,MAAM,UAAU,YAAY,MAAM,SAAS,UAAU,MAAM,SAAS,CAAC,MAAM,MAAM,MAAM;KAChG,MAAM,IAAI,MAAM,sDAAsD,WAAW,6EAA6E;IAChK;IACA,IAAI,QAAQ,IAAI,aAAa,cAAc;KACzC,IAAI;MACF;MACA;MACA;KACF,CAAC,CAAC,KAAK,S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AY,YAAY,UAAU,YAAY,QAAQ,YAAY,KAAK,IAAI,UAAU,CAAC,CAAC,IAAI;EAC/F,IAAI,SAAS,iBAAiB,cAAc,QAAQ,cAAc,KAAK,IAAI,YAAY,CAAC,GAAG;GACzF,YAAY,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,oBAAoB,aAAa;GACvG;EACF,CAAC;EACD,IAAI,CAAC,OAAO,QAAQ;GAClB,OAAO;EACT;EACA,OAAuB,oBAAK,wBAAwB,UAAU;GAC5D,OAAO;GACP,UAA0B,oBAAK,KAAK;IAClC,GAAG,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ;IAC7D,GAAG;IACH;IACA,UAAU;GACZ,CAAC;EACH,CAAC;CACH,CAAC,GAAG,EACF,OACF,CAAC;AACH"}
|
|
@@ -152,7 +152,8 @@ function getSortedChildren(children, order, initialRouteName, options) {
|
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
154
|
}).filter(Boolean);
|
|
155
|
-
|
|
155
|
+
const remaining = options?.remaining ?? "all";
|
|
156
|
+
if (remaining !== "none") ordered.push(...entries.filter((route) => remaining === "all" || !route.generated).sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({
|
|
156
157
|
route,
|
|
157
158
|
props: {}
|
|
158
159
|
})));
|
|
@@ -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\t/* @__PURE__ */ jsx(\"script\", { dangerouslySetInnerHTML: { __html: `globalThis['global'] = globalThis` } }),\n\t\t\tserverContext?.cssContents?.length || serverContext?.cssInlineCount ? serverContext?.cssContents ? serverContext.cssContents.map((content, i) => content ? /* @__PURE__ */ jsx(\"style\", {\n\t\t\t\tid: `__one_css_${i}`,\n\t\t\t\tdangerouslySetInnerHTML: { __html: content }\n\t\t\t}, `inline-css-${i}`) : serverContext.css?.[i] ? /* @__PURE__ */ jsx(\"link\", {\n\t\t\t\trel: \"stylesheet\",\n\t\t\t\thref: serverContext.css[i]\n\t\t\t}, serverContext.css[i]) : null) : cachedInlineCSSElements : serverContext?.css?.map((file) => /* @__PURE__ */ jsx(\"link\", {\n\t\t\t\trel: \"stylesheet\",\n\t\t\t\thref: file\n\t\t\t}, file)),\n\t\t\t/* @__PURE__ */ jsx(ServerContextScript, {}),\n\t\t\theadChildren\n\t\t]\n\t}, \"head\"), /* @__PURE__ */ jsx(\"body\", {\n\t\tsuppressHydrationWarning: true,\n\t\t...bodyProps,\n\t\tchildren: /* @__PURE__ */ jsx(SafeAreaProvider, {\n\t\t\tinitialMetrics: SSR_SAFE_METRICS,\n\t\t\tchildren: finalChildren\n\t\t})\n\t}, \"body\")] });\n\treturn /* @__PURE__ */ jsx(\"html\", {\n\t\tsuppressHydrationWarning: true,\n\t\tlang: \"en-US\",\n\t\t...htmlProps,\n\t\tchildren: finalChildren\n\t});\n}\nfunction getSortedChildren(children, order, initialRouteName, options) {\n\tif (!order?.length) return children.sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({\n\t\troute,\n\t\tprops: {}\n\t}));\n\tconst entries = [...children];\n\tconst ordered = order.map(({ name, redirect, initialParams, listeners, options: options2, getId }) => {\n\t\tif (!entries.length) {\n\t\t\tconsole.warn(`[Layout children]: Too many screens defined. Route \"${name}\" is extraneous.`);\n\t\t\treturn null;\n\t\t}\n\t\tconst matchIndex = entries.findIndex((child) => child.route === name);\n\t\tif (matchIndex === -1) {\n\t\t\tconsole.warn(`[Layout children]: No route named \"${name}\" exists in nested children:`, children.map(({ route }) => route));\n\t\t\treturn null;\n\t\t}\n\t\tconst match = entries[matchIndex];\n\t\tentries.splice(matchIndex, 1);\n\t\tif (redirect) {\n\t\t\tif (typeof redirect === \"string\") throw new Error(`Redirecting to a specific route is not supported yet.`);\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\troute: match,\n\t\t\tprops: {\n\t\t\t\tinitialParams,\n\t\t\t\tlisteners,\n\t\t\t\toptions: options2,\n\t\t\t\tgetId\n\t\t\t}\n\t\t};\n\t}).filter(Boolean);\n\tif (!options?.onlyMatching) ordered.push(...entries.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,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K;EACxC;CACD,CAAC;AACF;AACA,MAAM,qCAAqC;CAC1C,UAAU;CACV,OAAO;CACP,WAAW;AACZ;AACA,IAAI,qBAAqB,cAAc,MAAM,UAAU;CACtD,YAAY,OAAO;EAClB,MAAM,KAAK;EACX,KAAK,QAAQ;CACd;CACA,OAAO,yBAAyB,OAAO;EACtC,OAAO;GACN,UAAU;GACV;EACD;CACD;CACA,kBAAkB,OAAO,WAAW;EACnC,QAAQ,MAAM,uCAAuC,KAAK,MAAM,UAAU,KAAK,iBAAiB,QAAQ,MAAM,UAAU,MAAM;;EAE9H,MAAM,MAAM;;;EAGZ,UAAU,gBAAgB;EAC1B,KAAK,SAAS,EAAE,UAAU,CAAC;EAC3B,IAAI,QAAQ,IAAI,aAAa,gBAAgB,QAAQ,IAAI,wBAAwB,SAAS,IAAI,iBAAiB,KAAK,GAAG,gBAAgB;OAClI,mBAAmB;CACzB;CACA,aAAa;EACZ,KAAK,SAAS,kCAAkC;CACjD;CACA,SAAS;EACR,IAAI,KAAK,MAAM,UAAU;GACxB,MAAM,EAAE,OAAO,cAAc,KAAK;GAClC,OAAuB,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\t/* @__PURE__ */ jsx(\"script\", { dangerouslySetInnerHTML: { __html: `globalThis['global'] = globalThis` } }),\n\t\t\tserverContext?.cssContents?.length || serverContext?.cssInlineCount ? serverContext?.cssContents ? serverContext.cssContents.map((content, i) => content ? /* @__PURE__ */ jsx(\"style\", {\n\t\t\t\tid: `__one_css_${i}`,\n\t\t\t\tdangerouslySetInnerHTML: { __html: content }\n\t\t\t}, `inline-css-${i}`) : serverContext.css?.[i] ? /* @__PURE__ */ jsx(\"link\", {\n\t\t\t\trel: \"stylesheet\",\n\t\t\t\thref: serverContext.css[i]\n\t\t\t}, serverContext.css[i]) : null) : cachedInlineCSSElements : serverContext?.css?.map((file) => /* @__PURE__ */ jsx(\"link\", {\n\t\t\t\trel: \"stylesheet\",\n\t\t\t\thref: file\n\t\t\t}, file)),\n\t\t\t/* @__PURE__ */ jsx(ServerContextScript, {}),\n\t\t\theadChildren\n\t\t]\n\t}, \"head\"), /* @__PURE__ */ jsx(\"body\", {\n\t\tsuppressHydrationWarning: true,\n\t\t...bodyProps,\n\t\tchildren: /* @__PURE__ */ jsx(SafeAreaProvider, {\n\t\t\tinitialMetrics: SSR_SAFE_METRICS,\n\t\t\tchildren: finalChildren\n\t\t})\n\t}, \"body\")] });\n\treturn /* @__PURE__ */ jsx(\"html\", {\n\t\tsuppressHydrationWarning: true,\n\t\tlang: \"en-US\",\n\t\t...htmlProps,\n\t\tchildren: finalChildren\n\t});\n}\nfunction getSortedChildren(children, order, initialRouteName, options) {\n\tif (!order?.length) return children.sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({\n\t\troute,\n\t\tprops: {}\n\t}));\n\tconst entries = [...children];\n\tconst ordered = order.map(({ name, redirect, initialParams, listeners, options: options2, getId }) => {\n\t\tif (!entries.length) {\n\t\t\tconsole.warn(`[Layout children]: Too many screens defined. Route \"${name}\" is extraneous.`);\n\t\t\treturn null;\n\t\t}\n\t\tconst matchIndex = entries.findIndex((child) => child.route === name);\n\t\tif (matchIndex === -1) {\n\t\t\tconsole.warn(`[Layout children]: No route named \"${name}\" exists in nested children:`, children.map(({ route }) => route));\n\t\t\treturn null;\n\t\t}\n\t\tconst match = entries[matchIndex];\n\t\tentries.splice(matchIndex, 1);\n\t\tif (redirect) {\n\t\t\tif (typeof redirect === \"string\") throw new Error(`Redirecting to a specific route is not supported yet.`);\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\troute: match,\n\t\t\tprops: {\n\t\t\t\tinitialParams,\n\t\t\t\tlisteners,\n\t\t\t\toptions: options2,\n\t\t\t\tgetId\n\t\t\t}\n\t\t};\n\t}).filter(Boolean);\n\tconst remaining = options?.remaining ?? \"all\";\n\tif (remaining !== \"none\") ordered.push(...entries.filter((route) => remaining === \"all\" || !route.generated).sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({\n\t\troute,\n\t\tprops: {}\n\t})));\n\treturn ordered;\n}\nfunction useSortedScreens(order, options) {\n\tconst node = useRouteNode();\n\treturn React.useMemo(() => {\n\t\treturn (node?.children?.length ? getSortedChildren(node.children, order, node.initialRouteName, options) : []).filter((value) => {\n\t\t\tconst routeName = value.route.route;\n\t\t\tconst normalized = routeName.replace(/\\/index$/, \"\");\n\t\t\treturn !(options?.protectedScreens?.has(routeName) || options?.protectedScreens?.has(normalized));\n\t\t}).map((value) => routeToScreen(value.route, value.props));\n\t}, [\n\t\tnode?.children,\n\t\tnode?.initialRouteName,\n\t\torder,\n\t\toptions?.protectedScreens\n\t]);\n}\nfunction fromImport({ ErrorBoundary, SuspenseFallback, ...component }) {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconst exported = getPageExport(component);\n\t\tif (exported && typeof exported === \"object\" && Object.keys(exported).length === 0) return {\n\t\t\tdefault: EmptyRoute,\n\t\t\tErrorBoundary,\n\t\t\tSuspenseFallback\n\t\t};\n\t}\n\treturn {\n\t\tdefault: getPageExport(component),\n\t\tErrorBoundary,\n\t\tSuspenseFallback\n\t};\n}\nfunction RouteSuspenseFallback({ component: Component, route }) {\n\tconst params = useContext(RouteParamsContext);\n\treturn Component ? /* @__PURE__ */ jsx(Component, {\n\t\troute,\n\t\tparams: params ?? {}\n\t}) : null;\n}\nconst qualifiedStore = /* @__PURE__ */ new WeakMap();\nfunction getRouteMatchesForProps() {\n\tconst serverMatches = getServerContext()?.matches ?? [];\n\tif (process.env.VITE_ENVIRONMENT === \"ssr\") return serverMatches;\n\tconst clientMatches = getClientMatchesSnapshot();\n\treturn clientMatches.length ? clientMatches : serverMatches;\n}\nfunction getQualifiedRouteComponent(value) {\n\tif (value && qualifiedStore.has(value)) return qualifiedStore.get(value);\n\tconst ScreenComponent = React.forwardRef((props, ref) => {\n\t\tif (process.env.NODE_ENV === \"development\" && true) {\n\t\t\tconst [, setHmrKey] = useState(0);\n\t\t\tuseEffect(() => {\n\t\t\t\tconst handler = () => setHmrKey((k) => k + 1);\n\t\t\t\twindow.addEventListener(\"one-hmr-update\", handler);\n\t\t\t\treturn () => window.removeEventListener(\"one-hmr-update\", handler);\n\t\t\t}, []);\n\t\t}\n\t\tif (process.env.NODE_ENV === \"development\" && false);\n\t\tconst isSpaShell = useContext(SpaShellContext);\n\t\tconst InheritedSuspenseFallback = useContext(SuspenseFallbackContext);\n\t\tconst matches = getRouteMatchesForProps();\n\t\tif (isSpaShell && props.segment !== \"\") {\n\t\t\tif (!(value.children?.length && (value.layoutRenderMode === \"ssg\" || value.layoutRenderMode === \"ssr\"))) return /* @__PURE__ */ jsx(\"div\", { \"data-one-spa-content\": \"\" });\n\t\t}\n\t\tconst res = fromImport(value.loadRoute());\n\t\tconst Component = res.default || EmptyRoute;\n\t\tconst CatchBoundary = res.ErrorBoundary;\n\t\tconst LayoutSuspenseFallback = value.type === \"layout\" ? res.SuspenseFallback : void 0;\n\t\tconst match = matches.find((match2) => match2.routeId === value.contextKey) || (!value.children?.length ? matches[matches.length - 1] : void 0);\n\t\tconst loaderDataProps = match && \"loaderData\" in match ? { loaderData: match.loaderData } : {};\n\t\tif (process.env.NODE_ENV === \"development\" && process.env.DEBUG === \"one\") {\n\t\t\tconsole.groupCollapsed(`Render ${props.key} ${props.segment}`);\n\t\t\tconsole.info(`value`, value);\n\t\t\tconsole.info(`Component`, Component);\n\t\t\tconsole.groupEnd();\n\t\t}\n\t\tconst slotProps = {};\n\t\tif (value.slots && value.slots.size > 0) for (const [slotName] of value.slots) slotProps[slotName] = /* @__PURE__ */ jsx(NamedSlot, {\n\t\t\tname: slotName,\n\t\t\tlayoutContextKey: value.contextKey\n\t\t});\n\t\tlet rendered;\n\t\tif (props.segment === \"\") rendered = /* @__PURE__ */ jsx(RootLayoutRenderer, {\n\t\t\tLayoutComponent: Component,\n\t\t\tlayoutProps: {\n\t\t\t\t...props,\n\t\t\t\t...slotProps,\n\t\t\t\t...loaderDataProps\n\t\t\t},\n\t\t\tforwardedRef: ref\n\t\t});\n\t\telse {\n\t\t\tconst page = /* @__PURE__ */ jsx(Component, {\n\t\t\t\t...props,\n\t\t\t\t...slotProps,\n\t\t\t\t...loaderDataProps,\n\t\t\t\tref\n\t\t\t});\n\t\t\trendered = /* @__PURE__ */ jsx(RouteErrorBoundary, {\n\t\t\t\trouteName: value.route,\n\t\t\t\tchildren: CatchBoundary ? /* @__PURE__ */ jsx(Try, {\n\t\t\t\t\tcatch: CatchBoundary,\n\t\t\t\t\tchildren: page\n\t\t\t\t}) : page\n\t\t\t});\n\t\t}\n\t\tif (value.type !== \"layout\") return rendered;\n\t\tconst providedSuspenseFallback = LayoutSuspenseFallback ?? InheritedSuspenseFallback;\n\t\treturn /* @__PURE__ */ jsx(SuspenseFallbackContext.Provider, {\n\t\t\tvalue: providedSuspenseFallback,\n\t\t\tchildren: LayoutSuspenseFallback ? wrapSuspense(rendered, LayoutSuspenseFallback) : rendered\n\t\t});\n\t});\n\tconst wrapSuspense = (children, SuspenseFallback) => {\n\t\tconst fallback = /* @__PURE__ */ jsx(RouteSuspenseFallback, {\n\t\t\tcomponent: SuspenseFallback,\n\t\t\troute: value.contextKey\n\t\t});\n\t\tif (process.env.ONE_SUSPEND_ROUTES === \"1\" && globalThis.__ONE_DISABLE_SUSPENSE_ROUTES__ !== true) return /* @__PURE__ */ jsx(Suspense, {\n\t\t\tfallback,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t};\n\tconst QualifiedRoute = React.forwardRef(({ route, navigation, ...props }, ref) => {\n\t\tconst InheritedSuspenseFallback = useContext(SuspenseFallbackContext);\n\t\treturn /* @__PURE__ */ jsx(Route, {\n\t\t\troute,\n\t\t\tnode: value,\n\t\t\tchildren: /* @__PURE__ */ jsx(Fragment, { children: wrapSuspense(/* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ScreenComponent, {\n\t\t\t\t...props,\n\t\t\t\tref,\n\t\t\t\tsegment: value.route\n\t\t\t}), process.env.VITE_ENVIRONMENT === \"client\" && value.type !== \"layout\" && navigation && /* @__PURE__ */ jsx(ScrollBehaviorRouteCommit, {})] }), InheritedSuspenseFallback) })\n\t\t});\n\t});\n\tQualifiedRoute.displayName = `Route(${value.route})`;\n\tconst Memoized = memo(QualifiedRoute);\n\tqualifiedStore.set(value, Memoized);\n\treturn Memoized;\n}\nfunction createGetIdForRoute(route) {\n\tconst include = /* @__PURE__ */ new Map();\n\tif (route.dynamic) for (const segment of route.dynamic) include.set(segment.name, segment);\n\treturn ({ params = {} } = {}) => {\n\t\tconst segments = [];\n\t\tfor (const dynamic of include.values()) {\n\t\t\tconst value = params?.[dynamic.name];\n\t\t\tif (Array.isArray(value) && value.length > 0) segments.push(value.join(\"/\"));\n\t\t\telse if (value && !Array.isArray(value)) segments.push(value);\n\t\t\telse if (dynamic.deep) segments.push(`[...${dynamic.name}]`);\n\t\t\telse segments.push(`[${dynamic.name}]`);\n\t\t}\n\t\treturn segments.join(\"/\") ?? route.contextKey;\n\t};\n}\nfunction routeToScreen(route, { options, ...props } = {}) {\n\tconst navigationRouteName = getReactNavigationRouteName(route);\n\treturn /* @__PURE__ */ createElement(Screen, {\n\t\tgetId: createGetIdForRoute(route),\n\t\t...props,\n\t\tname: navigationRouteName,\n\t\tkey: navigationRouteName,\n\t\toptions: (args) => {\n\t\t\tconst staticOptions = route.generated ? route.loadRoute()?.getNavOptions : null;\n\t\t\tconst staticResult = typeof staticOptions === \"function\" ? staticOptions(args) : staticOptions;\n\t\t\tconst dynamicResult = typeof options === \"function\" ? options?.(args) : options;\n\t\t\tconst output = {\n\t\t\t\t...staticResult,\n\t\t\t\t...dynamicResult\n\t\t\t};\n\t\t\tif (route.generated) {\n\t\t\t\toutput.tabBarButton = () => null;\n\t\t\t\toutput.drawerItemStyle = {\n\t\t\t\t\theight: 0,\n\t\t\t\t\tdisplay: \"none\"\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn output;\n\t\t},\n\t\tgetComponent: () => {\n\t\t\treturn getQualifiedRouteComponent(route);\n\t\t}\n\t});\n}\nconst ROUTE_ERROR_BOUNDARY_INITIAL_STATE = {\n\thasError: false,\n\terror: null,\n\terrorInfo: null\n};\nvar RouteErrorBoundary = class extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = ROUTE_ERROR_BOUNDARY_INITIAL_STATE;\n\t}\n\tstatic getDerivedStateFromError(error) {\n\t\treturn {\n\t\t\thasError: true,\n\t\t\terror\n\t\t};\n\t}\n\tcomponentDidCatch(error, errorInfo) {\n\t\tconsole.error(`Error occurred while running route \"${this.props.routeName}\": ${error instanceof Error ? error.message : error}\n\n${error.stack}\n\nComponent Stack:\n${errorInfo.componentStack}`);\n\t\tthis.setState({ errorInfo });\n\t\tif (process.env.NODE_ENV === \"production\" && process.env.ONE_SKEW_PROTECTION !== \"false\") if (isChunkLoadError(error)) handleSkewError();\n\t\telse checkSkewAndReload();\n\t}\n\tclearError() {\n\t\tthis.setState(ROUTE_ERROR_BOUNDARY_INITIAL_STATE);\n\t}\n\trender() {\n\t\tif (this.state.hasError) {\n\t\t\tconst { error, errorInfo } = this.state;\n\t\t\treturn /* @__PURE__ */ jsx(RouteErrorView, {\n\t\t\t\trouteName: this.props.routeName,\n\t\t\t\terror,\n\t\t\t\terrorInfo,\n\t\t\t\tonRetry: this.clearError.bind(this)\n\t\t\t});\n\t\t}\n\t\treturn this.props.children;\n\t}\n};\n\nexport { Group, Screen, createGetIdForRoute, getQualifiedRouteComponent, useSortedScreens };"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,eAAe,UAAU;CACjC,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC3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IACpB,OAAO,qBAAqB;IAC5B,OAAO,kBAAkB;KACxB,QAAQ;KACR,SAAS;IACV;GACD;GACA,OAAO;EACR;EACA,oBAAoB;GACnB,OAAO,2BAA2B,KAAK;EACxC;CACD,CAAC;AACF;AACA,MAAM,qCAAqC;CAC1C,UAAU;CACV,OAAO;CACP,WAAW;AACZ;AACA,IAAI,qBAAqB,cAAc,MAAM,UAAU;CACtD,YAAY,OAAO;EAClB,MAAM,KAAK;EACX,KAAK,QAAQ;CACd;CACA,OAAO,yBAAyB,OAAO;EACtC,OAAO;GACN,UAAU;GACV;EACD;CACD;CACA,kBAAkB,OAAO,WAAW;EACnC,QAAQ,MAAM,uCAAuC,KAAK,MAAM,UAAU,KAAK,iBAAiB,QAAQ,MAAM,UAAU,MAAM;;EAE9H,MAAM,MAAM;;;EAGZ,UAAU,gBAAgB;EAC1B,KAAK,SAAS,EAAE,UAAU,CAAC;EAC3B,IAAI,QAAQ,IAAI,aAAa,gBAAgB,QAAQ,IAAI,wBAAwB,SAAS,IAAI,iBAAiB,KAAK,GAAG,gBAAgB;OAClI,mBAAmB;CACzB;CACA,aAAa;EACZ,KAAK,SAAS,kCAAkC;CACjD;CACA,SAAS;EACR,IAAI,KAAK,MAAM,UAAU;GACxB,MAAM,EAAE,OAAO,cAAc,KAAK;GAClC,OAAuB,oBAAI,gBAAgB;IAC1C,WAAW,KAAK,MAAM;IACtB;IACA;IACA,SAAS,KAAK,WAAW,KAAK,IAAI;GACnC,CAAC;EACF;EACA,OAAO,KAAK,MAAM;CACnB;AACD"}
|
|
@@ -107,6 +107,7 @@ function RootLayoutRenderer(param) {
|
|
|
107
107
|
return children;
|
|
108
108
|
}
|
|
109
109
|
function getSortedChildren(children, order, initialRouteName, options) {
|
|
110
|
+
var _ref;
|
|
110
111
|
if (!(order === null || order === void 0 ? void 0 : order.length)) return children.sort(sortRoutesWithInitial(initialRouteName)).map(function(route) {
|
|
111
112
|
return {
|
|
112
113
|
route,
|
|
@@ -146,7 +147,10 @@ function getSortedChildren(children, order, initialRouteName, options) {
|
|
|
146
147
|
}
|
|
147
148
|
};
|
|
148
149
|
}).filter(Boolean);
|
|
149
|
-
|
|
150
|
+
var remaining = (_ref = options === null || options === void 0 ? void 0 : options.remaining) !== null && _ref !== void 0 ? _ref : "all";
|
|
151
|
+
if (remaining !== "none") ordered.push(...entries.filter(function(route) {
|
|
152
|
+
return remaining === "all" || !route.generated;
|
|
153
|
+
}).sort(sortRoutesWithInitial(initialRouteName)).map(function(route) {
|
|
150
154
|
return {
|
|
151
155
|
route,
|
|
152
156
|
props: {}
|
|
@@ -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\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\tif (!(options === null || options === void 0 ? void 0 : options.onlyMatching)) ordered.push(...entries.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,MAAM;EACvB,WAAW,aAAa,WAAW,cAAc;EACjD,WAAW,eAAe;EAC1B,IAAI,WAAW,YAAY,WAAW,WAAW;EACjD,OAAO,eAAe,QAAQ,WAAW,KAAK,UAAU;CACzD;AACD;AACA,SAAS,cAAc,aAAa,YAAY,aAAa;CAC5D,IAAI,YAAY,kBAAkB,YAAY,WAAW,UAAU;CACnE,IAAI,aAAa,kBAAkB,aAAa,WAAW;CAC3D,OAAO;AACR;AACA,SAAS,kBAAkB,GAAG;CAC7B,oBAAoB,OAAO,iBAAiB,OAAO,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K;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 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,MAAM;EACvB,WAAW,aAAa,WAAW,cAAc;EACjD,WAAW,eAAe;EAC1B,IAAI,WAAW,YAAY,WAAW,WAAW;EACjD,OAAO,eAAe,QAAQ,WAAW,KAAK,UAAU;CACzD;AACD;AACA,SAAS,cAAc,aAAa,YAAY,aAAa;CAC5D,IAAI,YAAY,kBAAkB,YAAY,WAAW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AO,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "one",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.10",
|
|
4
4
|
"description": "One is a React framework for web, iOS, and Android apps.",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"sideEffects": [
|
|
@@ -236,18 +236,18 @@
|
|
|
236
236
|
"@react-navigation/native-stack": "8.0.0-alpha.58",
|
|
237
237
|
"@react-navigation/routers": "8.0.0-alpha.20",
|
|
238
238
|
"@ungap/structured-clone": "^1.2.0",
|
|
239
|
-
"@vxrn/color-scheme": "2.6.
|
|
240
|
-
"@vxrn/compiler": "2.6.
|
|
241
|
-
"@vxrn/resolve": "2.6.
|
|
242
|
-
"@vxrn/tslib-lite": "2.6.
|
|
243
|
-
"@vxrn/use-isomorphic-layout-effect": "2.6.
|
|
244
|
-
"@vxrn/utils": "2.6.
|
|
245
|
-
"@vxrn/vite-plugin-metro": "2.6.
|
|
239
|
+
"@vxrn/color-scheme": "2.6.10",
|
|
240
|
+
"@vxrn/compiler": "2.6.10",
|
|
241
|
+
"@vxrn/resolve": "2.6.10",
|
|
242
|
+
"@vxrn/tslib-lite": "2.6.10",
|
|
243
|
+
"@vxrn/use-isomorphic-layout-effect": "2.6.10",
|
|
244
|
+
"@vxrn/utils": "2.6.10",
|
|
245
|
+
"@vxrn/vite-plugin-metro": "2.6.10",
|
|
246
246
|
"babel-dead-code-elimination": "1.0.10",
|
|
247
247
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
248
248
|
"citty": "^0.1.6",
|
|
249
249
|
"core-js": "^3.38.1",
|
|
250
|
-
"create-vxrn": "2.6.
|
|
250
|
+
"create-vxrn": "2.6.10",
|
|
251
251
|
"escape-string-regexp": "^5.0.0",
|
|
252
252
|
"fast-deep-equal": "^3.1.3",
|
|
253
253
|
"fast-glob": "^3.3.3",
|
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
"tsconfig-paths": "^4",
|
|
270
270
|
"use-latest-callback": "^0.2.3",
|
|
271
271
|
"vite": "^8.2.2",
|
|
272
|
-
"vxrn": "2.6.
|
|
272
|
+
"vxrn": "2.6.10",
|
|
273
273
|
"web-streams-polyfill": "^4.3.0",
|
|
274
274
|
"ws": "^8.21.0",
|
|
275
275
|
"xxhashjs": "^0.2.2"
|
|
@@ -337,7 +337,7 @@
|
|
|
337
337
|
"@types/react-dom": "^19.2.2",
|
|
338
338
|
"@types/react-test-renderer": "^19.1.0",
|
|
339
339
|
"@types/xxhashjs": "^0.2.4",
|
|
340
|
-
"@vxrn/emitter": "2.6.
|
|
340
|
+
"@vxrn/emitter": "2.6.10",
|
|
341
341
|
"depcheck": "^1.4.7",
|
|
342
342
|
"esbuild": "^0.25.12",
|
|
343
343
|
"immer": "^10.1.1",
|
|
@@ -513,7 +513,7 @@
|
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
},
|
|
516
|
-
"releaseSourceCommit": "
|
|
516
|
+
"releaseSourceCommit": "5039cc0477e19b5e228772869db111e5e348b29a",
|
|
517
517
|
"repository": {
|
|
518
518
|
"type": "git",
|
|
519
519
|
"url": "git+https://github.com/onejs/one.git",
|
package/src/layouts/Stack.tsx
CHANGED
|
@@ -37,7 +37,7 @@ const RNStack = withLayoutContext<
|
|
|
37
37
|
typeof NativeStackNavigator,
|
|
38
38
|
StackNavigationState<ParamListBase>,
|
|
39
39
|
NativeStackNavigationEventMap
|
|
40
|
-
>(NativeStackNavigator)
|
|
40
|
+
>(NativeStackNavigator, undefined, { undeclaredRoutes: true })
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Pre-process children to convert StackScreen (with Header children) to Screen (with options).
|
|
@@ -4,7 +4,8 @@ import { describe, expect, it } from 'vitest'
|
|
|
4
4
|
import { Protected } from '../views/Protected'
|
|
5
5
|
import { Screen } from '../views/Screen'
|
|
6
6
|
import { processNativeTabsScreens } from './nativeTabsOptions'
|
|
7
|
-
import { useFilterScreenChildren } from './withLayoutContext'
|
|
7
|
+
import { useFilterScreenChildren, withLayoutContext } from './withLayoutContext'
|
|
8
|
+
import { Route, type RouteNode } from '../router/Route'
|
|
8
9
|
|
|
9
10
|
function readGuardedRedirects(children: React.ReactNode) {
|
|
10
11
|
let result: ReturnType<typeof useFilterScreenChildren> | undefined
|
|
@@ -88,3 +89,54 @@ describe('native Tabs options', () => {
|
|
|
88
89
|
)
|
|
89
90
|
})
|
|
90
91
|
})
|
|
92
|
+
|
|
93
|
+
describe('layout routes', () => {
|
|
94
|
+
function route(name: string, extra: Partial<RouteNode> = {}): RouteNode {
|
|
95
|
+
return {
|
|
96
|
+
type: 'ssg',
|
|
97
|
+
route: name,
|
|
98
|
+
contextKey: `./${name}.tsx`,
|
|
99
|
+
loadRoute: () => ({ default: () => null }),
|
|
100
|
+
children: [],
|
|
101
|
+
dynamic: null,
|
|
102
|
+
...extra,
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// the screen names a navigator receives for a layout with three child files
|
|
107
|
+
function screenNames(options: Parameters<typeof withLayoutContext>[2]) {
|
|
108
|
+
let names: string[] = []
|
|
109
|
+
function Navigator({ children }: { children: React.ReactNode }) {
|
|
110
|
+
names = React.Children.map(children, (child: any) => child.props.name) ?? []
|
|
111
|
+
return null
|
|
112
|
+
}
|
|
113
|
+
const Layout = withLayoutContext(Navigator, undefined, options)
|
|
114
|
+
const layout: RouteNode = {
|
|
115
|
+
...route('_layout'),
|
|
116
|
+
type: 'layout',
|
|
117
|
+
children: [
|
|
118
|
+
route('index'),
|
|
119
|
+
route('detail'),
|
|
120
|
+
route('+not-found', { generated: true, internal: true }),
|
|
121
|
+
],
|
|
122
|
+
}
|
|
123
|
+
act(() => {
|
|
124
|
+
TestRenderer.create(
|
|
125
|
+
<Route node={layout}>
|
|
126
|
+
<Layout>
|
|
127
|
+
<Screen name="detail" />
|
|
128
|
+
</Layout>
|
|
129
|
+
</Route>
|
|
130
|
+
)
|
|
131
|
+
})
|
|
132
|
+
return names
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
it('stacks register undeclared child files after the declared screens', () => {
|
|
136
|
+
expect(screenNames({ undeclaredRoutes: true })).toEqual(['detail', 'index'])
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
it('other navigators keep only the declared screens', () => {
|
|
140
|
+
expect(screenNames(undefined)).toEqual(['detail'])
|
|
141
|
+
})
|
|
142
|
+
})
|
|
@@ -167,7 +167,12 @@ export function withLayoutContext<
|
|
|
167
167
|
processor?: (
|
|
168
168
|
options: ScreenProps<TOptions, State, EventMap>[]
|
|
169
169
|
) => ScreenProps<TOptions, State, EventMap>[],
|
|
170
|
-
options?: {
|
|
170
|
+
options?: {
|
|
171
|
+
props?: any
|
|
172
|
+
// a stack only shows the screen it navigates to, so undeclared files stay
|
|
173
|
+
// reachable as expo-router keeps them; tabs and drawers list every screen
|
|
174
|
+
undeclaredRoutes?: boolean
|
|
175
|
+
}
|
|
171
176
|
) {
|
|
172
177
|
return withStaticProperties(
|
|
173
178
|
React.forwardRef<unknown, PickPartial<React.ComponentProps<T>, 'children'>>(
|
|
@@ -204,7 +209,7 @@ export function withLayoutContext<
|
|
|
204
209
|
|
|
205
210
|
const processed = processor ? processor(screens ?? ([] as any)) : screens
|
|
206
211
|
const sorted = useSortedScreens((processed ?? []) as any, {
|
|
207
|
-
|
|
212
|
+
remaining: options?.undeclaredRoutes ? 'authored' : 'none',
|
|
208
213
|
protectedScreens,
|
|
209
214
|
})
|
|
210
215
|
|
|
@@ -254,11 +254,15 @@ export type ScreenProps<
|
|
|
254
254
|
getId?: ({ params }: { params?: Record<string, any> }) => string | undefined
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
+
// which undeclared child routes follow the declared screens: every one, only
|
|
258
|
+
// files the app wrote (not the generated sitemap or +not-found), or none
|
|
259
|
+
type Remaining = 'all' | 'authored' | 'none'
|
|
260
|
+
|
|
257
261
|
function getSortedChildren(
|
|
258
262
|
children: RouteNode[],
|
|
259
263
|
order?: ScreenProps[],
|
|
260
264
|
initialRouteName?: string,
|
|
261
|
-
options?: {
|
|
265
|
+
options?: { remaining?: Remaining }
|
|
262
266
|
): { route: RouteNode; props: Partial<ScreenProps> }[] {
|
|
263
267
|
if (!order?.length) {
|
|
264
268
|
return children
|
|
@@ -307,9 +311,11 @@ function getSortedChildren(
|
|
|
307
311
|
}[]
|
|
308
312
|
|
|
309
313
|
// Add any remaining children
|
|
310
|
-
|
|
314
|
+
const remaining = options?.remaining ?? 'all'
|
|
315
|
+
if (remaining !== 'none') {
|
|
311
316
|
ordered.push(
|
|
312
317
|
...entries
|
|
318
|
+
.filter((route) => remaining === 'all' || !route.generated)
|
|
313
319
|
.sort(sortRoutesWithInitial(initialRouteName))
|
|
314
320
|
.map((route) => ({ route, props: {} }))
|
|
315
321
|
)
|
|
@@ -324,7 +330,7 @@ function getSortedChildren(
|
|
|
324
330
|
export function useSortedScreens(
|
|
325
331
|
order: ScreenProps[],
|
|
326
332
|
options?: {
|
|
327
|
-
|
|
333
|
+
remaining?: Remaining
|
|
328
334
|
/** Set of route names to filter out (protected routes with guard=false) */
|
|
329
335
|
protectedScreens?: Set<string>
|
|
330
336
|
}
|
|
@@ -20,7 +20,8 @@ export declare function useResolvedGuardedRedirects(guardedRedirects: Map<string
|
|
|
20
20
|
}> | undefined>;
|
|
21
21
|
/** Return a navigator that automatically injects matched routes and renders nothing when there are no children. Return type with children prop optional */
|
|
22
22
|
export declare function withLayoutContext<TOptions extends object, T extends React.ComponentType<any>, State extends NavigationState, EventMap extends EventMapBase>(Nav: T, processor?: (options: ScreenProps<TOptions, State, EventMap>[]) => ScreenProps<TOptions, State, EventMap>[], options?: {
|
|
23
|
-
props
|
|
23
|
+
props?: any;
|
|
24
|
+
undeclaredRoutes?: boolean;
|
|
24
25
|
}): React.ForwardRefExoticComponent<React.PropsWithoutRef<PickPartial<React.ComponentProps<T>, "children">> & React.RefAttributes<unknown>> & {
|
|
25
26
|
Screen: React.ComponentType<ScreenProps<TOptions, State, EventMap>>;
|
|
26
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLayoutContext.d.ts","sourceRoot":"","sources":["../../src/layouts/withLayoutContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAUrD,OAAO,EAAE,KAAK,WAAW,EAAoB,MAAM,sBAAsB,CAAA;AAEzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAO3C,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,EACE,iBAAiB,EACjB,UAAU,GACX,GAAE;IACD,iBAAiB,CAA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,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC;;gBA0B1D;AAED,2JAA2J;AAC3J,wBAAgB,iBAAiB,CAC/B,QAAQ,SAAS,MAAM,EACvB,CAAC,SAAS,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,EAClC,KAAK,SAAS,eAAe,EAC7B,QAAQ,SAAS,YAAY,EAE7B,GAAG,EAAE,CAAC,EACN,SAAS,CAAC,EAAE,CACV,OAAO,EAAE,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,KAC9C,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,EAC7C,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,GAAG,CAAA;IAGX,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;YAwDqB,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;EAGlF"}
|
|
@@ -44,11 +44,12 @@ export type ScreenProps<TOptions extends Record<string, any> = Record<string, an
|
|
|
44
44
|
params?: Record<string, any>;
|
|
45
45
|
}) => string | undefined;
|
|
46
46
|
};
|
|
47
|
+
type Remaining = 'all' | 'authored' | 'none';
|
|
47
48
|
/**
|
|
48
49
|
* @returns React Navigation screens sorted by the `route` property.
|
|
49
50
|
*/
|
|
50
51
|
export declare function useSortedScreens(order: ScreenProps[], options?: {
|
|
51
|
-
|
|
52
|
+
remaining?: Remaining;
|
|
52
53
|
/** Set of route names to filter out (protected routes with guard=false) */
|
|
53
54
|
protectedScreens?: Set<string>;
|
|
54
55
|
}): React.ReactNode[];
|
|
@@ -58,4 +59,5 @@ export declare function getQualifiedRouteComponent(value: RouteNode): React.Name
|
|
|
58
59
|
export declare function createGetIdForRoute(route: Pick<RouteNode, 'dynamic' | 'route' | 'contextKey' | 'children'>): ({ params }?: {
|
|
59
60
|
params?: Record<string, any>;
|
|
60
61
|
}) => string;
|
|
62
|
+
export {};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