one 2.6.8 → 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
|
@@ -39,7 +39,7 @@ var import_stack_utils = require("./stack-utils/index.cjs");
|
|
|
39
39
|
var import_withLayoutContext = require("./withLayoutContext.cjs");
|
|
40
40
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
41
|
const NativeStackNavigator = (0, import_stack_navigator.createStackNavigator)().Navigator;
|
|
42
|
-
const RNStack = (0, import_withLayoutContext.withLayoutContext)(NativeStackNavigator);
|
|
42
|
+
const RNStack = (0, import_withLayoutContext.withLayoutContext)(NativeStackNavigator, void 0, { undeclaredRoutes: true });
|
|
43
43
|
function mapChildren(children) {
|
|
44
44
|
return import_react.Children.toArray(children).map((child, index) => {
|
|
45
45
|
if ((0, import_children.isChildOfType)(child, import_stack_utils.StackScreen)) {
|
|
@@ -41,7 +41,7 @@ var import_stack_navigator = require("./stack-navigator.native.js");
|
|
|
41
41
|
var import_stack_utils = require("./stack-utils/index.native.js");
|
|
42
42
|
var import_withLayoutContext = require("./withLayoutContext.native.js");
|
|
43
43
|
var NativeStackNavigator = (0, import_stack_navigator.createStackNavigator)().Navigator;
|
|
44
|
-
var RNStack = (0, import_withLayoutContext.withLayoutContext)(NativeStackNavigator);
|
|
44
|
+
var RNStack = (0, import_withLayoutContext.withLayoutContext)(NativeStackNavigator, void 0, { undeclaredRoutes: true });
|
|
45
45
|
function mapChildren(children) {
|
|
46
46
|
return import_react.Children.toArray(children).map(function(child, index) {
|
|
47
47
|
if ((0, import_children.isChildOfType)(child, import_stack_utils.StackScreen)) {
|
|
@@ -41,7 +41,7 @@ var import_stack_navigator = require("./stack-navigator.native.js");
|
|
|
41
41
|
var import_stack_utils = require("./stack-utils/index.native.js");
|
|
42
42
|
var import_withLayoutContext = require("./withLayoutContext.native.js");
|
|
43
43
|
var NativeStackNavigator = (0, import_stack_navigator.createStackNavigator)().Navigator;
|
|
44
|
-
var RNStack = (0, import_withLayoutContext.withLayoutContext)(NativeStackNavigator);
|
|
44
|
+
var RNStack = (0, import_withLayoutContext.withLayoutContext)(NativeStackNavigator, void 0, { undeclaredRoutes: true });
|
|
45
45
|
function mapChildren(children) {
|
|
46
46
|
return import_react.Children.toArray(children).map(function(child, index) {
|
|
47
47
|
if ((0, import_children.isChildOfType)(child, import_stack_utils.StackScreen)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.native.js","names":[],"sources":["cjs/layouts/Stack.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Stack_exports = {};\n__export(Stack_exports, {\n Stack: () => Stack,\n default: () => Stack_default\n});\nmodule.exports = __toCommonJS(Stack_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_children = require(\"../utils/children\");\nvar import_Protected = require(\"../views/Protected\");\nvar import_Screen = require(\"../views/Screen\");\nvar import_stack_navigator = require(\"./stack-navigator\");\nvar import_stack_utils = require(\"./stack-utils\");\nvar import_withLayoutContext = require(\"./withLayoutContext\");\nvar NativeStackNavigator = (0, import_stack_navigator.createStackNavigator)().Navigator;\nvar RNStack = (0, import_withLayoutContext.withLayoutContext)(NativeStackNavigator);\nfunction mapChildren(children) {\n return import_react.Children.toArray(children).map(function(child, index) {\n if ((0, import_children.isChildOfType)(child, import_stack_utils.StackScreen)) {\n var _child_props_name;\n var options = (0, import_stack_utils.appendScreenStackPropsToOptions)({}, child.props);\n var { children: _, ...rest } = child.props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Screen.Screen, {\n ...rest,\n options\n }, (_child_props_name = child.props.name) !== null && _child_props_name !== void 0 ? _child_props_name : index);\n }\n if ((0, import_children.isChildOfType)(child, import_Protected.Protected)) {\n return /* @__PURE__ */ import_react.default.cloneElement(child, {\n key: `protected-${index}`\n }, mapChildren(child.props.children));\n }\n if ((0, import_children.isChildOfType)(child, import_stack_utils.StackHeaderComponent)) {\n return null;\n }\n if ((0, import_children.isChildOfType)(child, import_stack_utils.StackToolbarComponent)) {\n return null;\n }\n if ((0, import_children.isChildOfType)(child, import_Screen.Screen)) {\n return child;\n }\n return null;\n }).filter(Boolean);\n}\nvar StackWithComposition = /* @__PURE__ */ import_react.default.forwardRef(function(props, ref) {\n var { children, screenOptions, ...rest } = props;\n var screenOptionsWithHeader = (0, import_react.useMemo)(function() {\n var stackHeader = import_react.Children.toArray(children).find(function(child) {\n return (0, import_children.isChildOfType)(child, import_stack_utils.StackHeaderComponent);\n });\n var stackToolbars = import_react.Children.toArray(children).filter(function(child) {\n return (0, import_children.isChildOfType)(child, import_stack_utils.StackToolbarComponent);\n });\n if (!stackHeader && !stackToolbars.length) return screenOptions;\n var applyComposition = function applyComposition2(opts) {\n var result = opts;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = stackToolbars[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var stackToolbar = _step.value;\n result = (0, import_stack_utils.appendStackToolbarPropsToOptions)(result, stackToolbar.props);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (stackHeader && (0, import_children.isChildOfType)(stackHeader, import_stack_utils.StackHeaderComponent)) {\n var headerProps = {\n children: stackHeader\n };\n result = (0, import_stack_utils.appendScreenStackPropsToOptions)(result, headerProps);\n }\n return result;\n };\n if (screenOptions) {\n if (typeof screenOptions === \"function\") {\n return function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var opts = screenOptions(...args);\n return applyComposition(opts);\n };\n }\n return applyComposition(screenOptions);\n }\n return applyComposition({});\n }, [\n children,\n screenOptions\n ]);\n var processedChildren = (0, import_react.useMemo)(function() {\n return mapChildren(children);\n }, [\n children\n ]);\n var navigatorProps = (0, import_react.useMemo)(function() {\n return (0, import_stack_navigator.getStackNavigatorProps)(children);\n }, [\n children\n ]);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RNStack, {\n ...rest,\n ...navigatorProps,\n ref,\n screenOptions: screenOptionsWithHeader,\n children: processedChildren\n });\n});\nvar StackToolbar = Object.assign(import_stack_utils.StackToolbarComponent, {\n Button: import_stack_utils.StackToolbarButton,\n Menu: import_stack_utils.StackToolbarMenu,\n MenuAction: import_stack_utils.StackToolbarMenuAction,\n Spacer: import_stack_utils.StackToolbarSpacer,\n SearchBarSlot: import_stack_utils.StackToolbarSearchBarSlot,\n Label: import_stack_utils.StackToolbarLabel,\n Icon: import_stack_utils.StackToolbarIcon,\n Badge: import_stack_utils.StackToolbarBadge\n});\nvar Stack = Object.assign(StackWithComposition, {\n Screen: import_stack_utils.StackScreen,\n Header: import_stack_utils.StackHeader,\n Toolbar: StackToolbar,\n Protected: import_Protected.Protected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;EACA,IAAI,eAAe;GACjB,IAAI,OAAO,kBAAkB,YAAY;IACvC,OAAO,WAAW;KAChB,KAAK,IAAI,OAAO,UAAU,QAAQ,OAAO,IAAI,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,MAAM,QAAQ;MACvF,KAAK,QAAQ,UAAU;KACzB;KACA,IAAI,OAAO,cAAc,GAAG,IAAI;KAChC,OAAO,iBAAiB,IAAI;IAC9B;GACF;GACA,OAAO,iBAAiB,aAAa;EACvC;EACA,OAAO,iBAAiB,CAAC,CAAC;CAC5B,GAAG,CACD,UACA,aACF,CAAC;CACD,IAAI,qBAAqB,GAAG,aAAa,QAAO,CAAE,WAAW;EAC3D,OAAO,YAAY,QAAQ;CAC7B,GAAG,CACD,QACF,CAAC;CACD,IAAI,kBAAkB,GAAG,aAAa,QAAO,CAAE,WAAW;EACxD,QAAQ,GAAG,uBAAuB,uBAAsB,CAAE,QAAQ;CACpE,GAAG,CACD,QACF,CAAC;CACD,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,SAAS;EAC1D,GAAG;EACH,GAAG;EACH;EACA,eAAe;EACf,UAAU;CACZ,CAAC;AACH,CAAC;AACD,IAAI,eAAe,OAAO,OAAO,mBAAmB,uBAAuB;CACzE,QAAQ,mBAAmB;CAC3B,MAAM,mBAAmB;CACzB,YAAY,mBAAmB;CAC/B,QAAQ,mBAAmB;CAC3B,eAAe,mBAAmB;CAClC,OAAO,mBAAmB;CAC1B,MAAM,mBAAmB;CACzB,OAAO,mBAAmB;AAC5B,CAAC;AACD,IAAI,QAAQ,OAAO,OAAO,sBAAsB;CAC9C,QAAQ,mBAAmB;CAC3B,QAAQ,mBAAmB;CAC3B,SAAS;CACT,WAAW,iBAAiB;CAC5B,WAAW,mBAAmB;AAChC,CAAC;AACD,IAAI,gBAAgB"}
|
|
1
|
+
{"version":3,"file":"Stack.native.js","names":[],"sources":["cjs/layouts/Stack.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Stack_exports = {};\n__export(Stack_exports, {\n Stack: () => Stack,\n default: () => Stack_default\n});\nmodule.exports = __toCommonJS(Stack_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_children = require(\"../utils/children\");\nvar import_Protected = require(\"../views/Protected\");\nvar import_Screen = require(\"../views/Screen\");\nvar import_stack_navigator = require(\"./stack-navigator\");\nvar import_stack_utils = require(\"./stack-utils\");\nvar import_withLayoutContext = require(\"./withLayoutContext\");\nvar NativeStackNavigator = (0, import_stack_navigator.createStackNavigator)().Navigator;\nvar RNStack = (0, import_withLayoutContext.withLayoutContext)(NativeStackNavigator, void 0, {\n undeclaredRoutes: true\n});\nfunction mapChildren(children) {\n return import_react.Children.toArray(children).map(function(child, index) {\n if ((0, import_children.isChildOfType)(child, import_stack_utils.StackScreen)) {\n var _child_props_name;\n var options = (0, import_stack_utils.appendScreenStackPropsToOptions)({}, child.props);\n var { children: _, ...rest } = child.props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Screen.Screen, {\n ...rest,\n options\n }, (_child_props_name = child.props.name) !== null && _child_props_name !== void 0 ? _child_props_name : index);\n }\n if ((0, import_children.isChildOfType)(child, import_Protected.Protected)) {\n return /* @__PURE__ */ import_react.default.cloneElement(child, {\n key: `protected-${index}`\n }, mapChildren(child.props.children));\n }\n if ((0, import_children.isChildOfType)(child, import_stack_utils.StackHeaderComponent)) {\n return null;\n }\n if ((0, import_children.isChildOfType)(child, import_stack_utils.StackToolbarComponent)) {\n return null;\n }\n if ((0, import_children.isChildOfType)(child, import_Screen.Screen)) {\n return child;\n }\n return null;\n }).filter(Boolean);\n}\nvar StackWithComposition = /* @__PURE__ */ import_react.default.forwardRef(function(props, ref) {\n var { children, screenOptions, ...rest } = props;\n var screenOptionsWithHeader = (0, import_react.useMemo)(function() {\n var stackHeader = import_react.Children.toArray(children).find(function(child) {\n return (0, import_children.isChildOfType)(child, import_stack_utils.StackHeaderComponent);\n });\n var stackToolbars = import_react.Children.toArray(children).filter(function(child) {\n return (0, import_children.isChildOfType)(child, import_stack_utils.StackToolbarComponent);\n });\n if (!stackHeader && !stackToolbars.length) return screenOptions;\n var applyComposition = function applyComposition2(opts) {\n var result = opts;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = stackToolbars[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var stackToolbar = _step.value;\n result = (0, import_stack_utils.appendStackToolbarPropsToOptions)(result, stackToolbar.props);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (stackHeader && (0, import_children.isChildOfType)(stackHeader, import_stack_utils.StackHeaderComponent)) {\n var headerProps = {\n children: stackHeader\n };\n result = (0, import_stack_utils.appendScreenStackPropsToOptions)(result, headerProps);\n }\n return result;\n };\n if (screenOptions) {\n if (typeof screenOptions === \"function\") {\n return function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var opts = screenOptions(...args);\n return applyComposition(opts);\n };\n }\n return applyComposition(screenOptions);\n }\n return applyComposition({});\n }, [\n children,\n screenOptions\n ]);\n var processedChildren = (0, import_react.useMemo)(function() {\n return mapChildren(children);\n }, [\n children\n ]);\n var navigatorProps = (0, import_react.useMemo)(function() {\n return (0, import_stack_navigator.getStackNavigatorProps)(children);\n }, [\n children\n ]);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RNStack, {\n ...rest,\n ...navigatorProps,\n ref,\n screenOptions: screenOptionsWithHeader,\n children: processedChildren\n });\n});\nvar StackToolbar = Object.assign(import_stack_utils.StackToolbarComponent, {\n Button: import_stack_utils.StackToolbarButton,\n Menu: import_stack_utils.StackToolbarMenu,\n MenuAction: import_stack_utils.StackToolbarMenuAction,\n Spacer: import_stack_utils.StackToolbarSpacer,\n SearchBarSlot: import_stack_utils.StackToolbarSearchBarSlot,\n Label: import_stack_utils.StackToolbarLabel,\n Icon: import_stack_utils.StackToolbarIcon,\n Badge: import_stack_utils.StackToolbarBadge\n});\nvar Stack = Object.assign(StackWithComposition, {\n Screen: import_stack_utils.StackScreen,\n Header: import_stack_utils.StackHeader,\n Toolbar: StackToolbar,\n Protected: import_Protected.Protected,\n SearchBar: import_stack_utils.StackHeaderSearchBar\n});\nvar Stack_default = Stack;\n//# sourceMappingURL=Stack.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;A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AM,QAAQ;MACvF,KAAK,QAAQ,UAAU;KACzB;KACA,IAAI,OAAO,cAAc,GAAG,IAAI;KAChC,OAAO,iBAAiB,IAAI;IAC9B;GACF;GACA,OAAO,iBAAiB,aAAa;EACvC;EACA,OAAO,iBAAiB,CAAC,CAAC;CAC5B,GAAG,CACD,UACA,aACF,CAAC;CACD,IAAI,qBAAqB,GAAG,aAAa,QAAO,CAAE,WAAW;EAC3D,OAAO,YAAY,QAAQ;CAC7B,GAAG,CACD,QACF,CAAC;CACD,IAAI,kBAAkB,GAAG,aAAa,QAAO,CAAE,WAAW;EACxD,QAAQ,GAAG,uBAAuB,uBAAsB,CAAE,QAAQ;CACpE,GAAG,CACD,QACF,CAAC;CACD,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,SAAS;EAC1D,GAAG;EACH,GAAG;EACH;EACA,eAAe;EACf,UAAU;CACZ,CAAC;AACH,CAAC;AACD,IAAI,eAAe,OAAO,OAAO,mBAAmB,uBAAuB;CACzE,QAAQ,mBAAmB;CAC3B,MAAM,mBAAmB;CACzB,YAAY,mBAAmB;CAC/B,QAAQ,mBAAmB;CAC3B,eAAe,mBAAmB;CAClC,OAAO,mBAAmB;CAC1B,MAAM,mBAAmB;CACzB,OAAO,mBAAmB;AAC5B,CAAC;AACD,IAAI,QAAQ,OAAO,OAAO,sBAAsB;CAC9C,QAAQ,mBAAmB;CAC3B,QAAQ,mBAAmB;CAC3B,SAAS;CACT,WAAW,iBAAiB;CAC5B,WAAW,mBAAmB;AAChC,CAAC;AACD,IAAI,gBAAgB"}
|
|
@@ -142,7 +142,7 @@ function withLayoutContext(Nav, processor, options) {
|
|
|
142
142
|
}, [currentPathname, protectedHref]);
|
|
143
143
|
const processed = processor ? processor(screens ?? []) : screens;
|
|
144
144
|
const sorted = (0, import_useScreens.useSortedScreens)(processed ?? [], {
|
|
145
|
-
|
|
145
|
+
remaining: options?.undeclaredRoutes ? "authored" : "none",
|
|
146
146
|
protectedScreens
|
|
147
147
|
});
|
|
148
148
|
if (!sorted.length) {
|
|
@@ -157,7 +157,7 @@ function withLayoutContext(Nav, processor, options) {
|
|
|
157
157
|
}, [currentPathname, protectedHref]);
|
|
158
158
|
var processed = processor ? processor(screens !== null && screens !== void 0 ? screens : []) : screens;
|
|
159
159
|
var sorted = (0, import_useScreens.useSortedScreens)(processed !== null && processed !== void 0 ? processed : [], {
|
|
160
|
-
|
|
160
|
+
remaining: (options === null || options === void 0 ? void 0 : options.undeclaredRoutes) ? "authored" : "none",
|
|
161
161
|
protectedScreens
|
|
162
162
|
});
|
|
163
163
|
if (!sorted.length) {
|
|
@@ -157,7 +157,7 @@ function withLayoutContext(Nav, processor, options) {
|
|
|
157
157
|
}, [currentPathname, protectedHref]);
|
|
158
158
|
var processed = processor ? processor(screens !== null && screens !== void 0 ? screens : []) : screens;
|
|
159
159
|
var sorted = (0, import_useScreens.useSortedScreens)(processed !== null && processed !== void 0 ? processed : [], {
|
|
160
|
-
|
|
160
|
+
remaining: (options === null || options === void 0 ? void 0 : options.undeclaredRoutes) ? "authored" : "none",
|
|
161
161
|
protectedScreens
|
|
162
162
|
});
|
|
163
163
|
if (!sorted.length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLayoutContext.native.js","names":[],"sources":["cjs/layouts/withLayoutContext.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar withLayoutContext_exports = {};\n__export(withLayoutContext_exports, {\n useFilterScreenChildren: () => useFilterScreenChildren,\n useResolvedGuardedRedirects: () => useResolvedGuardedRedirects,\n withLayoutContext: () => withLayoutContext\n});\nmodule.exports = __toCommonJS(withLayoutContext_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_matchers = require(\"../router/matchers\");\nvar import_Route = require(\"../router/Route\");\nvar import_router = require(\"../router/router\");\nvar import_useScreens = require(\"../router/useScreens\");\nvar import_sortRoutes = require(\"../router/sortRoutes\");\nvar import_withStaticProperties = require(\"../utils/withStaticProperties\");\nvar import_Protected = require(\"../views/Protected\");\nvar import_Screen = require(\"../views/Screen\");\nvar import_StackScreen = require(\"./stack-utils/StackScreen\");\nvar import_NativeNavigatorContext = require(\"./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 import_react.default.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__ */ import_react.default.isValidElement(child) && (child.type === import_Screen.Screen || child.type === import_StackScreen.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 ((0, import_Protected.isProtectedElement)(child)) {\n var guardFails = !child.props.guard;\n var excludeChildren = exclude || guardFails;\n var childRedirectTo = guardFails ? child.props.redirectTo : redirectTo;\n import_react.default.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 import_react.default.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 = (0, import_Route.useRouteNode)();\n return import_react.default.useMemo(function() {\n if (!node) {\n return guardedRedirects;\n }\n var defaultRoute = [\n ...node.children\n ].sort((0, import_sortRoutes.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 ? (0, import_matchers.stripInvisibleSegmentsFromPath)((0, import_matchers.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 (0, import_withStaticProperties.withStaticProperties)(/* @__PURE__ */ import_react.default.forwardRef(function(propsIn, ref) {\n var { children, ...props } = propsIn;\n var contextKey = (0, import_Route.useContextKey)();\n var { screens, protectedScreens, guardedRedirects } = useFilterScreenChildren(children, {\n contextKey\n });\n var resolvedGuardedRedirects = useResolvedGuardedRedirects(guardedRedirects);\n (0, import_router.registerProtectedRoutes)(contextKey, resolvedGuardedRedirects);\n var currentPathname = import_router.routeInfo === null || import_router.routeInfo === void 0 ? void 0 : import_router.routeInfo.pathname;\n var protectedHref = currentPathname ? (0, import_router.resolveProtectedHref)(currentPathname) : currentPathname;\n import_react.default.useEffect(function() {\n (0, import_router.registerProtectedRoutes)(contextKey, resolvedGuardedRedirects);\n return function() {\n (0, import_router.unregisterProtectedRoutes)(contextKey);\n };\n }, [\n contextKey,\n resolvedGuardedRedirects\n ]);\n import_react.default.useEffect(function() {\n if (currentPathname && protectedHref && protectedHref !== currentPathname) {\n (0, import_router.replace)(protectedHref);\n }\n }, [\n currentPathname,\n protectedHref\n ]);\n var processed = processor ? processor(screens !== null && screens !== void 0 ? screens : []) : screens;\n var sorted = (0, import_useScreens.useSortedScreens)(processed !== null && processed !== void 0 ? processed : [], {\n onlyMatching: true,\n protectedScreens\n });\n if (!sorted.length) {\n return null;\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_NativeNavigatorContext.IsWithinNativeNavigator.Provider, {\n value: true,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Nav, {\n ...options === null || options === void 0 ? void 0 : options.props,\n ...props,\n ref,\n children: sorted\n })\n });\n }), {\n Screen: import_Screen.Screen\n });\n}\n//# sourceMappingURL=withLayoutContext.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,4BAA4B,CAAC;AACjC,SAAS,2BAA2B;CAClC,+BA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AAe,IAAI;EACjG,aAAa,QAAQ,UAAU,WAAW;GACxC,CAAC,GAAG,cAAc,wBAAuB,CAAE,YAAY,wBAAwB;GAC/E,OAAO,WAAW;IAChB,CAAC,GAAG,cAAc,0BAAyB,CAAE,UAAU;GACzD;EACF,GAAG,CACD,YACA,wBACF,CAAC;EACD,aAAa,QAAQ,UAAU,WAAW;GACxC,IAAI,mBAAmB,iBAAiB,kBAAkB,iBAAiB;IACzE,CAAC,GAAG,cAAc,QAAO,CAAE,aAAa;GAC1C;EACF,GAAG,CACD,iBACA,aACF,CAAC;EACD,IAAI,YAAY,YAAY,UAAU,YAAY,QAAQ,YAAY,KAAK,IAAI,UAAU,CAAC,CAAC,IAAI;EAC/F,IAAI,UAAU,GAAG,kBAAkB,iBAAgB,CAAE,cAAc,QAAQ,cAAc,KAAK,IAAI,YAAY,CAAC,GAAG;GAChH,cAAc;GACd;EACF,CAAC;EACD,IAAI,CAAC,OAAO,QAAQ;GAClB,OAAO;EACT;EACA,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,8BAA8B,wBAAwB,UAAU;GACjH,OAAO;GACP,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,KAAK;IACzD,GAAG,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ;IAC7D,GAAG;IACH;IACA,UAAU;GACZ,CAAC;EACH,CAAC;CACH,CAAC,GAAG,EACF,QAAQ,cAAc,OACxB,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"withLayoutContext.native.js","names":[],"sources":["cjs/layouts/withLayoutContext.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar withLayoutContext_exports = {};\n__export(withLayoutContext_exports, {\n useFilterScreenChildren: () => useFilterScreenChildren,\n useResolvedGuardedRedirects: () => useResolvedGuardedRedirects,\n withLayoutContext: () => withLayoutContext\n});\nmodule.exports = __toCommonJS(withLayoutContext_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_matchers = require(\"../router/matchers\");\nvar import_Route = require(\"../router/Route\");\nvar import_router = require(\"../router/router\");\nvar import_useScreens = require(\"../router/useScreens\");\nvar import_sortRoutes = require(\"../router/sortRoutes\");\nvar import_withStaticProperties = require(\"../utils/withStaticProperties\");\nvar import_Protected = require(\"../views/Protected\");\nvar import_Screen = require(\"../views/Screen\");\nvar import_StackScreen = require(\"./stack-utils/StackScreen\");\nvar import_NativeNavigatorContext = require(\"./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 import_react.default.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__ */ import_react.default.isValidElement(child) && (child.type === import_Screen.Screen || child.type === import_StackScreen.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 ((0, import_Protected.isProtectedElement)(child)) {\n var guardFails = !child.props.guard;\n var excludeChildren = exclude || guardFails;\n var childRedirectTo = guardFails ? child.props.redirectTo : redirectTo;\n import_react.default.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 import_react.default.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 = (0, import_Route.useRouteNode)();\n return import_react.default.useMemo(function() {\n if (!node) {\n return guardedRedirects;\n }\n var defaultRoute = [\n ...node.children\n ].sort((0, import_sortRoutes.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 ? (0, import_matchers.stripInvisibleSegmentsFromPath)((0, import_matchers.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 (0, import_withStaticProperties.withStaticProperties)(/* @__PURE__ */ import_react.default.forwardRef(function(propsIn, ref) {\n var { children, ...props } = propsIn;\n var contextKey = (0, import_Route.useContextKey)();\n var { screens, protectedScreens, guardedRedirects } = useFilterScreenChildren(children, {\n contextKey\n });\n var resolvedGuardedRedirects = useResolvedGuardedRedirects(guardedRedirects);\n (0, import_router.registerProtectedRoutes)(contextKey, resolvedGuardedRedirects);\n var currentPathname = import_router.routeInfo === null || import_router.routeInfo === void 0 ? void 0 : import_router.routeInfo.pathname;\n var protectedHref = currentPathname ? (0, import_router.resolveProtectedHref)(currentPathname) : currentPathname;\n import_react.default.useEffect(function() {\n (0, import_router.registerProtectedRoutes)(contextKey, resolvedGuardedRedirects);\n return function() {\n (0, import_router.unregisterProtectedRoutes)(contextKey);\n };\n }, [\n contextKey,\n resolvedGuardedRedirects\n ]);\n import_react.default.useEffect(function() {\n if (currentPathname && protectedHref && protectedHref !== currentPathname) {\n (0, import_router.replace)(protectedHref);\n }\n }, [\n currentPathname,\n protectedHref\n ]);\n var processed = processor ? processor(screens !== null && screens !== void 0 ? screens : []) : screens;\n var sorted = (0, import_useScreens.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__ */ (0, import_jsx_runtime.jsx)(import_NativeNavigatorContext.IsWithinNativeNavigator.Provider, {\n value: true,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Nav, {\n ...options === null || options === void 0 ? void 0 : options.props,\n ...props,\n ref,\n children: sorted\n })\n });\n }), {\n Screen: import_Screen.Screen\n });\n}\n//# sourceMappingURL=withLayoutContext.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,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, initialRouteName, options) {
|
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
191
|
}).filter(Boolean);
|
|
192
|
-
|
|
192
|
+
const remaining = options?.remaining ?? "all";
|
|
193
|
+
if (remaining !== "none") ordered.push(...entries.filter((route) => remaining === "all" || !route.generated).sort((0, import_sortRoutes.sortRoutesWithInitial)(initialRouteName)).map((route) => ({
|
|
193
194
|
route,
|
|
194
195
|
props: {}
|
|
195
196
|
})));
|
|
@@ -168,6 +168,7 @@ function RootLayoutRenderer(param) {
|
|
|
168
168
|
return children;
|
|
169
169
|
}
|
|
170
170
|
function getSortedChildren(children, order, initialRouteName, options) {
|
|
171
|
+
var _ref;
|
|
171
172
|
if (!(order === null || order === void 0 ? void 0 : order.length)) return children.sort((0, import_sortRoutes.sortRoutesWithInitial)(initialRouteName)).map(function(route) {
|
|
172
173
|
return {
|
|
173
174
|
route,
|
|
@@ -207,7 +208,10 @@ function getSortedChildren(children, order, initialRouteName, options) {
|
|
|
207
208
|
}
|
|
208
209
|
};
|
|
209
210
|
}).filter(Boolean);
|
|
210
|
-
|
|
211
|
+
var remaining = (_ref = options === null || options === void 0 ? void 0 : options.remaining) !== null && _ref !== void 0 ? _ref : "all";
|
|
212
|
+
if (remaining !== "none") ordered.push(...entries.filter(function(route) {
|
|
213
|
+
return remaining === "all" || !route.generated;
|
|
214
|
+
}).sort((0, import_sortRoutes.sortRoutesWithInitial)(initialRouteName)).map(function(route) {
|
|
211
215
|
return {
|
|
212
216
|
route,
|
|
213
217
|
props: {}
|
|
@@ -168,6 +168,7 @@ function RootLayoutRenderer(param) {
|
|
|
168
168
|
return children;
|
|
169
169
|
}
|
|
170
170
|
function getSortedChildren(children, order, initialRouteName, options) {
|
|
171
|
+
var _ref;
|
|
171
172
|
if (!(order === null || order === void 0 ? void 0 : order.length)) return children.sort((0, import_sortRoutes.sortRoutesWithInitial)(initialRouteName)).map(function(route) {
|
|
172
173
|
return {
|
|
173
174
|
route,
|
|
@@ -207,7 +208,10 @@ function getSortedChildren(children, order, initialRouteName, options) {
|
|
|
207
208
|
}
|
|
208
209
|
};
|
|
209
210
|
}).filter(Boolean);
|
|
210
|
-
|
|
211
|
+
var remaining = (_ref = options === null || options === void 0 ? void 0 : options.remaining) !== null && _ref !== void 0 ? _ref : "all";
|
|
212
|
+
if (remaining !== "none") ordered.push(...entries.filter(function(route) {
|
|
213
|
+
return remaining === "all" || !route.generated;
|
|
214
|
+
}).sort((0, import_sortRoutes.sortRoutesWithInitial)(initialRouteName)).map(function(route) {
|
|
211
215
|
return {
|
|
212
216
|
route,
|
|
213
217
|
props: {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScreens.native.js","names":[],"sources":["cjs/router/useScreens.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useScreens_exports = {};\n__export(useScreens_exports, {\n\tGroup: () => Group,\n\tScreen: () => Screen,\n\tcreateGetIdForRoute: () => createGetIdForRoute,\n\tgetQualifiedRouteComponent: () => getQualifiedRouteComponent,\n\tuseSortedScreens: () => useSortedScreens\n});\nmodule.exports = __toCommonJS(useScreens_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = require(\"react\");\nvar import_core = require(\"@react-navigation/core\");\nvar import_react2 = __toESM(require(\"react\"), 1);\nrequire(\"../safe-area-context\");\nrequire(\"../server/ServerContextScript\");\nrequire(\"../skewProtection\");\nvar import_useMatches = require(\"../useMatches\");\nrequire(\"../utils/dynamicImport\");\nvar import_getPageExport = require(\"../utils/getPageExport\");\nvar import_EmptyRoute = require(\"../views/EmptyRoute\");\nvar import_Navigator = require(\"../views/Navigator\");\nvar import_RouteErrorView = require(\"../views/RouteErrorView\");\nvar import_Try = require(\"../views/Try\");\nvar import_ScrollBehavior = require(\"../views/ScrollBehavior\");\nrequire(\"../vite/DevHead\");\nvar import_one_server_only = require(\"../vite/one-server-only\");\nvar import_getReactNavigationConfig = require(\"../getReactNavigationConfig\");\nvar import_filterRootHTML = require(\"./filterRootHTML\");\nvar import_Route = require(\"./Route\");\nvar import_routeHmr = require(\"./routeHmr\");\nvar import_SpaShellContext = require(\"./SpaShellContext\");\nvar import_sortRoutes = require(\"./sortRoutes\");\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}\nfunction hasMetaCharset(children) {\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!children) return false;\n\t\tvar checkElement = function checkElement2(child) {\n\t\t\tif (!/* @__PURE__ */ import_react2.default.isValidElement(child)) return false;\n\t\t\tif (child.type === \"meta\") {\n\t\t\t\tvar props = child.props;\n\t\t\t\tif (\"charSet\" in props || \"charset\" in props) return true;\n\t\t\t}\n\t\t\tvar 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}\nvar { Screen, Group } = (0, import_core.createNavigatorFactory)({})();\n// require a real DOM query API, not just a (possibly polyfilled on\n// Expo/Hermes) `document` global — see getSafeWindowPathname in router.ts\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__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.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 out = LayoutComponent(layoutProps, forwardedRef);\n\tvar { children, bodyProps, head, htmlProps } = (0, import_filterRootHTML.filterRootHTML)(out);\n\tvar { children: headChildren, ...headProps } = (head === null || head === void 0 ? void 0 : head.props) || {};\n\t(0, import_one_server_only.useServerContext)();\n\treturn children;\n}\nfunction getSortedChildren(children, order, initialRouteName, options) {\n\tif (!(order === null || order === void 0 ? void 0 : order.length)) return children.sort((0, import_sortRoutes.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((0, import_sortRoutes.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 = (0, import_Route.useRouteNode)();\n\treturn import_react2.default.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 = (0, import_getPageExport.getPageExport)(component);\n\t\tif (exported && typeof exported === \"object\" && Object.keys(exported).length === 0) return {\n\t\t\tdefault: import_EmptyRoute.EmptyRoute,\n\t\t\tErrorBoundary,\n\t\t\tSuspenseFallback\n\t\t};\n\t}\n\treturn {\n\t\tdefault: (0, import_getPageExport.getPageExport)(component),\n\t\tErrorBoundary,\n\t\tSuspenseFallback\n\t};\n}\nfunction RouteSuspenseFallback(param) {\n\tvar { component: Component, route } = param;\n\tvar params = (0, import_react2.useContext)(import_Route.RouteParamsContext);\n\treturn Component ? /* @__PURE__ */ (0, import_jsx_runtime.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 = (0, import_one_server_only.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 = (0, import_useMatches.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__ */ import_react2.default.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) import_react2.default.useSyncExternalStore(import_routeHmr.subscribeRouteHmr, import_routeHmr.getRouteHmrEpoch, import_routeHmr.getRouteHmrEpoch);\n\t\tvar isSpaShell = (0, import_react2.useContext)(import_SpaShellContext.SpaShellContext);\n\t\tvar InheritedSuspenseFallback = (0, import_react2.useContext)(import_Route.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__ */ (0, import_jsx_runtime.jsx)(\"div\", { \"data-one-spa-content\": \"\" });\n\t\t}\n\t\tvar res = fromImport(value.loadRoute());\n\t\tvar Component = res.default || import_EmptyRoute.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__ */ (0, import_jsx_runtime.jsx)(import_Navigator.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__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.jsx)(RouteErrorBoundary, {\n\t\t\t\trouteName: value.route,\n\t\t\t\tchildren: CatchBoundary ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Try.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__ */ (0, import_jsx_runtime.jsx)(import_Route.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__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.jsx)(import_react2.Suspense, {\n\t\t\tfallback,\n\t\t\tchildren\n\t\t});\n\t};\n\tvar QualifiedRoute = /* @__PURE__ */ import_react2.default.forwardRef(function(param, ref) {\n\t\tvar { route, navigation, ...props } = param;\n\t\tvar InheritedSuspenseFallback = (0, import_react2.useContext)(import_Route.SuspenseFallbackContext);\n\t\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Route.Route, {\n\t\t\troute,\n\t\t\tnode: value,\n\t\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: wrapSuspense(/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.jsx)(import_ScrollBehavior.ScrollBehaviorRouteCommit, {})] }), InheritedSuspenseFallback) })\n\t\t});\n\t});\n\tQualifiedRoute.displayName = `Route(${value.route})`;\n\tvar Memoized = /* @__PURE__ */ (0, import_react2.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 = (0, import_getReactNavigationConfig.getReactNavigationRouteName)(route);\n\treturn /* @__PURE__ */ (0, import_react.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__ */ (0, import_jsx_runtime.jsx)(import_RouteErrorView.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})(import_react2.default.Component);\n//# sourceMappingURL=useScreens.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAC3D,CAAC;CACF;CACA,OAAO;AACR;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKpG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CACpE,OAAO;CACP,YAAY;AACb,CAAC,IAAI,QACL,GACD;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,qBAAqB,CAAC;AAC1B,SAAS,oBAAoB;CAC5B,aAAa;CACb,cAAc;CACd,2BAA2B;CAC3B,kCAAkC;CAClC,wBAAwB;AACzB,CAAC;AACD,OAAO,UAAU,a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K;EACxC;CACD,CAAC;AACF;AACA,IAAI,qCAAqC;CACxC,UAAU;CACV,OAAO;CACP,WAAW;AACZ;AACA,IAAI,qBAAqC,iBAAC,SAAS,kBAAkB;CACpE;CACA,UAAU,qBAAqB,gBAAgB;CAC/C,SAAS,oBAAoB,OAAO;EACnC,kBAAkB,MAAM,mBAAmB;EAC3C,IAAI,QAAQ,YAAY,MAAM,qBAAqB,CAAC,KAAK,CAAC;EAC1D,MAAM,QAAQ;EACd,OAAO;CACR;CACA,cAAc,qBAAqB;EAClC;GACC,KAAK;GACL,OAAO,SAAS,kBAAkB,OAAO,WAAW;IACnD,QAAQ,MAAM,uCAAuC,KAAK,MAAM,UAAU,KAAK,iBAAiB,QAAQ,MAAM,UAAU,MAAM;;EAEhI,MAAM,MAAM;;;EAGZ,UAAU,gBAAgB;IACxB,KAAK,SAAS,EAAE,UAAU,CAAC;GAC5B;EACD;EACA;GACC,KAAK;GACL,OAAO,SAAS,aAAa;IAC5B,KAAK,SAAS,kCAAkC;GACjD;EACD;EACA;GACC,KAAK;GACL,OAAO,SAAS,SAAS;IACxB,IAAI,KAAK,MAAM,UAAU;KACxB,IAAI,EAAE,OAAO,cAAc,KAAK;KAChC,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,sBAAsB,gBAAgB;MACxF,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,cAAc,QAAQ,SAAS"}
|
|
1
|
+
{"version":3,"file":"useScreens.native.js","names":[],"sources":["cjs/router/useScreens.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useScreens_exports = {};\n__export(useScreens_exports, {\n\tGroup: () => Group,\n\tScreen: () => Screen,\n\tcreateGetIdForRoute: () => createGetIdForRoute,\n\tgetQualifiedRouteComponent: () => getQualifiedRouteComponent,\n\tuseSortedScreens: () => useSortedScreens\n});\nmodule.exports = __toCommonJS(useScreens_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = require(\"react\");\nvar import_core = require(\"@react-navigation/core\");\nvar import_react2 = __toESM(require(\"react\"), 1);\nrequire(\"../safe-area-context\");\nrequire(\"../server/ServerContextScript\");\nrequire(\"../skewProtection\");\nvar import_useMatches = require(\"../useMatches\");\nrequire(\"../utils/dynamicImport\");\nvar import_getPageExport = require(\"../utils/getPageExport\");\nvar import_EmptyRoute = require(\"../views/EmptyRoute\");\nvar import_Navigator = require(\"../views/Navigator\");\nvar import_RouteErrorView = require(\"../views/RouteErrorView\");\nvar import_Try = require(\"../views/Try\");\nvar import_ScrollBehavior = require(\"../views/ScrollBehavior\");\nrequire(\"../vite/DevHead\");\nvar import_one_server_only = require(\"../vite/one-server-only\");\nvar import_getReactNavigationConfig = require(\"../getReactNavigationConfig\");\nvar import_filterRootHTML = require(\"./filterRootHTML\");\nvar import_Route = require(\"./Route\");\nvar import_routeHmr = require(\"./routeHmr\");\nvar import_SpaShellContext = require(\"./SpaShellContext\");\nvar import_sortRoutes = require(\"./sortRoutes\");\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}\nfunction hasMetaCharset(children) {\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!children) return false;\n\t\tvar checkElement = function checkElement2(child) {\n\t\t\tif (!/* @__PURE__ */ import_react2.default.isValidElement(child)) return false;\n\t\t\tif (child.type === \"meta\") {\n\t\t\t\tvar props = child.props;\n\t\t\t\tif (\"charSet\" in props || \"charset\" in props) return true;\n\t\t\t}\n\t\t\tvar 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}\nvar { Screen, Group } = (0, import_core.createNavigatorFactory)({})();\n// require a real DOM query API, not just a (possibly polyfilled on\n// Expo/Hermes) `document` global — see getSafeWindowPathname in router.ts\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__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.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 out = LayoutComponent(layoutProps, forwardedRef);\n\tvar { children, bodyProps, head, htmlProps } = (0, import_filterRootHTML.filterRootHTML)(out);\n\tvar { children: headChildren, ...headProps } = (head === null || head === void 0 ? void 0 : head.props) || {};\n\t(0, import_one_server_only.useServerContext)();\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((0, import_sortRoutes.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((0, import_sortRoutes.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 = (0, import_Route.useRouteNode)();\n\treturn import_react2.default.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 = (0, import_getPageExport.getPageExport)(component);\n\t\tif (exported && typeof exported === \"object\" && Object.keys(exported).length === 0) return {\n\t\t\tdefault: import_EmptyRoute.EmptyRoute,\n\t\t\tErrorBoundary,\n\t\t\tSuspenseFallback\n\t\t};\n\t}\n\treturn {\n\t\tdefault: (0, import_getPageExport.getPageExport)(component),\n\t\tErrorBoundary,\n\t\tSuspenseFallback\n\t};\n}\nfunction RouteSuspenseFallback(param) {\n\tvar { component: Component, route } = param;\n\tvar params = (0, import_react2.useContext)(import_Route.RouteParamsContext);\n\treturn Component ? /* @__PURE__ */ (0, import_jsx_runtime.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 = (0, import_one_server_only.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 = (0, import_useMatches.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__ */ import_react2.default.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) import_react2.default.useSyncExternalStore(import_routeHmr.subscribeRouteHmr, import_routeHmr.getRouteHmrEpoch, import_routeHmr.getRouteHmrEpoch);\n\t\tvar isSpaShell = (0, import_react2.useContext)(import_SpaShellContext.SpaShellContext);\n\t\tvar InheritedSuspenseFallback = (0, import_react2.useContext)(import_Route.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__ */ (0, import_jsx_runtime.jsx)(\"div\", { \"data-one-spa-content\": \"\" });\n\t\t}\n\t\tvar res = fromImport(value.loadRoute());\n\t\tvar Component = res.default || import_EmptyRoute.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__ */ (0, import_jsx_runtime.jsx)(import_Navigator.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__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.jsx)(RouteErrorBoundary, {\n\t\t\t\trouteName: value.route,\n\t\t\t\tchildren: CatchBoundary ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Try.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__ */ (0, import_jsx_runtime.jsx)(import_Route.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__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.jsx)(import_react2.Suspense, {\n\t\t\tfallback,\n\t\t\tchildren\n\t\t});\n\t};\n\tvar QualifiedRoute = /* @__PURE__ */ import_react2.default.forwardRef(function(param, ref) {\n\t\tvar { route, navigation, ...props } = param;\n\t\tvar InheritedSuspenseFallback = (0, import_react2.useContext)(import_Route.SuspenseFallbackContext);\n\t\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Route.Route, {\n\t\t\troute,\n\t\t\tnode: value,\n\t\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: wrapSuspense(/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.jsx)(import_ScrollBehavior.ScrollBehaviorRouteCommit, {})] }), InheritedSuspenseFallback) })\n\t\t});\n\t});\n\tQualifiedRoute.displayName = `Route(${value.route})`;\n\tvar Memoized = /* @__PURE__ */ (0, import_react2.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 = (0, import_getReactNavigationConfig.getReactNavigationRouteName)(route);\n\treturn /* @__PURE__ */ (0, import_react.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__ */ (0, import_jsx_runtime.jsx)(import_RouteErrorView.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})(import_react2.default.Component);\n//# sourceMappingURL=useScreens.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KA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C;EAC1D,MAAM,QAAQ;EACd,OAAO;CACR;CACA,cAAc,qBAAqB;EAClC;GACC,KAAK;GACL,OAAO,SAAS,kBAAkB,OAAO,WAAW;IACnD,QAAQ,MAAM,uCAAuC,KAAK,MAAM,UAAU,KAAK,iBAAiB,QAAQ,MAAM,UAAU,MAAM;;EAEhI,MAAM,MAAM;;;EAGZ,UAAU,gBAAgB;IACxB,KAAK,SAAS,EAAE,UAAU,CAAC;GAC5B;EACD;EACA;GACC,KAAK;GACL,OAAO,SAAS,aAAa;IAC5B,KAAK,SAAS,kCAAkC;GACjD;EACD;EACA;GACC,KAAK;GACL,OAAO,SAAS,SAAS;IACxB,IAAI,KAAK,MAAM,UAAU;KACxB,IAAI,EAAE,OAAO,cAAc,KAAK;KAChC,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,sBAAsB,gBAAgB;MACxF,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,cAAc,QAAQ,SAAS"}
|
|
@@ -8,7 +8,7 @@ import { withLayoutContext } from "./withLayoutContext.mjs";
|
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
|
|
10
10
|
const NativeStackNavigator = createStackNavigator().Navigator;
|
|
11
|
-
const RNStack = withLayoutContext(NativeStackNavigator);
|
|
11
|
+
const RNStack = withLayoutContext(NativeStackNavigator, void 0, { undeclaredRoutes: true });
|
|
12
12
|
function mapChildren(children) {
|
|
13
13
|
return Children.toArray(children).map((child, index) => {
|
|
14
14
|
if (isChildOfType(child, StackScreen)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.js","names":[],"sources":["esm/layouts/Stack.js"],"sourcesContent":["import React, { Children, useMemo } from \"react\";\nimport { isChildOfType } from \"../utils/children\";\nimport { Protected } from \"../views/Protected\";\nimport { Screen } from \"../views/Screen\";\nimport { createStackNavigator, getStackNavigatorProps } from \"./stack-navigator\";\nimport {\n appendScreenStackPropsToOptions,\n StackHeader,\n StackHeaderComponent,\n StackHeaderSearchBar,\n StackScreen,\n StackToolbarBadge,\n StackToolbarButton,\n StackToolbarComponent,\n StackToolbarIcon,\n StackToolbarLabel,\n StackToolbarMenu,\n StackToolbarMenuAction,\n StackToolbarSearchBarSlot,\n StackToolbarSpacer,\n appendStackToolbarPropsToOptions\n} from \"./stack-utils\";\nimport { withLayoutContext } from \"./withLayoutContext\";\nimport { jsx } from \"react/jsx-runtime\";\nconst NativeStackNavigator = createStackNavigator().Navigator;\nconst RNStack = withLayoutContext(NativeStackNavigator);\nfunction mapChildren(children) {\n return Children.toArray(children).map((child, index) => {\n if (isChildOfType(child, StackScreen)) {\n const options = appendScreenStackPropsToOptions({}, child.props);\n const { children: _, ...rest } = child.props;\n return /* @__PURE__ */ jsx(Screen, { ...rest, options }, child.props.name ?? index);\n }\n if (isChildOfType(child, Protected)) {\n return React.cloneElement(\n child,\n { key: `protected-${index}` },\n mapChildren(child.props.children)\n );\n }\n if (isChildOfType(child, StackHeaderComponent)) {\n return null;\n }\n if (isChildOfType(child, StackToolbarComponent)) {\n return null;\n }\n if (isChildOfType(child, Screen)) {\n return child;\n }\n return null;\n }).filter(Boolean);\n}\nconst StackWithComposition = React.forwardRef(\n (props, ref) => {\n const { children, screenOptions, ...rest } = props;\n const screenOptionsWithHeader = useMemo(() => {\n const stackHeader = Children.toArray(children).find(\n (child) => isChildOfType(child, StackHeaderComponent)\n );\n const stackToolbars = Children.toArray(children).filter(\n (child) => isChildOfType(child, StackToolbarComponent)\n );\n if (!stackHeader && !stackToolbars.length) return screenOptions;\n const applyComposition = (opts) => {\n let result = opts;\n for (const stackToolbar of stackToolbars) {\n result = appendStackToolbarPropsToOptions(\n result,\n stackToolbar.props\n );\n }\n if (stackHeader && isChildOfType(stackHeader, StackHeaderComponent)) {\n const headerProps = { children: stackHeader };\n result = appendScreenStackPropsToOptions(\n result,\n headerProps\n );\n }\n return result;\n };\n if (screenOptions) {\n if (typeof screenOptions === \"function\") {\n return (...args) => {\n const opts = screenOptions(...args);\n return applyComposition(opts);\n };\n }\n return applyComposition(screenOptions);\n }\n return applyComposition({});\n }, [children, screenOptions]);\n const processedChildren = useMemo(() => mapChildren(children), [children]);\n const navigatorProps = useMemo(() => getStackNavigatorProps(children), [children]);\n return /* @__PURE__ */ jsx(\n RNStack,\n {\n ...rest,\n ...navigatorProps,\n ref,\n screenOptions: screenOptionsWithHeader,\n children: processedChildren\n }\n );\n }\n);\nconst StackToolbar = Object.assign(StackToolbarComponent, {\n Button: StackToolbarButton,\n Menu: StackToolbarMenu,\n MenuAction: StackToolbarMenuAction,\n Spacer: StackToolbarSpacer,\n SearchBarSlot: StackToolbarSearchBarSlot,\n Label: StackToolbarLabel,\n Icon: StackToolbarIcon,\n Badge: StackToolbarBadge\n});\nconst Stack = Object.assign(StackWithComposition, {\n Screen: StackScreen,\n Header: StackHeader,\n Toolbar: StackToolbar,\n Protected,\n SearchBar: StackHeaderSearchBar\n});\nvar Stack_default = Stack;\nexport {\n Stack,\n Stack_default as default\n};\n//# sourceMappingURL=Stack.js.map\n"],"mappings":";;;;;;;;;;AAwBA,MAAM,uBAAuB,qBAAqB,CAAC,CAAC;AACpD,MAAM,UAAU,kBAAkB,
|
|
1
|
+
{"version":3,"file":"Stack.js","names":[],"sources":["esm/layouts/Stack.js"],"sourcesContent":["import React, { Children, useMemo } from \"react\";\nimport { isChildOfType } from \"../utils/children\";\nimport { Protected } from \"../views/Protected\";\nimport { Screen } from \"../views/Screen\";\nimport { createStackNavigator, getStackNavigatorProps } from \"./stack-navigator\";\nimport {\n appendScreenStackPropsToOptions,\n StackHeader,\n StackHeaderComponent,\n StackHeaderSearchBar,\n StackScreen,\n StackToolbarBadge,\n StackToolbarButton,\n StackToolbarComponent,\n StackToolbarIcon,\n StackToolbarLabel,\n StackToolbarMenu,\n StackToolbarMenuAction,\n StackToolbarSearchBarSlot,\n StackToolbarSpacer,\n appendStackToolbarPropsToOptions\n} from \"./stack-utils\";\nimport { withLayoutContext } from \"./withLayoutContext\";\nimport { jsx } from \"react/jsx-runtime\";\nconst NativeStackNavigator = createStackNavigator().Navigator;\nconst RNStack = withLayoutContext(NativeStackNavigator, void 0, { undeclaredRoutes: true });\nfunction mapChildren(children) {\n return Children.toArray(children).map((child, index) => {\n if (isChildOfType(child, StackScreen)) {\n const options = appendScreenStackPropsToOptions({}, child.props);\n const { children: _, ...rest } = child.props;\n return /* @__PURE__ */ jsx(Screen, { ...rest, options }, child.props.name ?? index);\n }\n if (isChildOfType(child, Protected)) {\n return React.cloneElement(\n child,\n { key: `protected-${index}` },\n mapChildren(child.props.children)\n );\n }\n if (isChildOfType(child, StackHeaderComponent)) {\n return null;\n }\n if (isChildOfType(child, StackToolbarComponent)) {\n return null;\n }\n if (isChildOfType(child, Screen)) {\n return child;\n }\n return null;\n }).filter(Boolean);\n}\nconst StackWithComposition = React.forwardRef(\n (props, ref) => {\n const { children, screenOptions, ...rest } = props;\n const screenOptionsWithHeader = useMemo(() => {\n const stackHeader = Children.toArray(children).find(\n (child) => isChildOfType(child, StackHeaderComponent)\n );\n const stackToolbars = Children.toArray(children).filter(\n (child) => isChildOfType(child, StackToolbarComponent)\n );\n if (!stackHeader && !stackToolbars.length) return screenOptions;\n const applyComposition = (opts) => {\n let result = opts;\n for (const stackToolbar of stackToolbars) {\n result = appendStackToolbarPropsToOptions(\n result,\n stackToolbar.props\n );\n }\n if (stackHeader && isChildOfType(stackHeader, StackHeaderComponent)) {\n const headerProps = { children: stackHeader };\n result = appendScreenStackPropsToOptions(\n result,\n headerProps\n );\n }\n return result;\n };\n if (screenOptions) {\n if (typeof screenOptions === \"function\") {\n return (...args) => {\n const opts = screenOptions(...args);\n return applyComposition(opts);\n };\n }\n return applyComposition(screenOptions);\n }\n return applyComposition({});\n }, [children, screenOptions]);\n const processedChildren = useMemo(() => mapChildren(children), [children]);\n const navigatorProps = useMemo(() => getStackNavigatorProps(children), [children]);\n return /* @__PURE__ */ jsx(\n RNStack,\n {\n ...rest,\n ...navigatorProps,\n ref,\n screenOptions: screenOptionsWithHeader,\n children: processedChildren\n }\n );\n }\n);\nconst StackToolbar = Object.assign(StackToolbarComponent, {\n Button: StackToolbarButton,\n Menu: StackToolbarMenu,\n MenuAction: StackToolbarMenuAction,\n Spacer: StackToolbarSpacer,\n SearchBarSlot: StackToolbarSearchBarSlot,\n Label: StackToolbarLabel,\n Icon: StackToolbarIcon,\n Badge: StackToolbarBadge\n});\nconst Stack = Object.assign(StackWithComposition, {\n Screen: StackScreen,\n Header: StackHeader,\n Toolbar: StackToolbar,\n Protected,\n SearchBar: StackHeaderSearchBar\n});\nvar Stack_default = Stack;\nexport {\n Stack,\n Stack_default as default\n};\n//# sourceMappingURL=Stack.js.map\n"],"mappings":";;;;;;;;;;AAwBA,MAAM,uBAAuB,qBAAqB,CAAC,CAAC;AACpD,MAAM,UAAU,kBAAkB,sBAAsB,KAAK,GAAG,EAAE,kBAAkB,KAAK,CAAC;AAC1F,SAAS,YAAY,UAAU;CAC7B,OAAO,SAAS,QAAQ,QAAQ,CAAC,CAAC,KAAK,OAAO,UAAU;EACtD,IAAI,cAAc,OAAO,WAAW,GAAG;GACrC,MAAM,UAAU,gCAAgC,CAAC,GAAG,MAAM,KAAK;GAC/D,MAAM,EAAE,UAAU,GAAG,GAAG,SAAS,MAAM;GACvC,OAAuB,oBAAI,QAAQ;IAAE,GAAG;IAAM;GAAQ,GAAG,MAAM,MAAM,QAAQ,KAAK;EACpF;EACA,IAAI,cAAc,OAAO,SAAS,GAAG;GACnC,OAAO,MAAM,aACX,OACA,EAAE,KAAK,aAAa,QAAQ,GAC5B,YAAY,MAAM,MAAM,QAAQ,CAClC;EACF;EACA,IA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,eAAe;EACf,UAAU;CACZ,CACF;AACF,CACF;AACA,MAAM,eAAe,OAAO,OAAO,uBAAuB;CACxD,QAAQ;CACR,MAAM;CACN,YAAY;CACZ,QAAQ;CACR,eAAe;CACf,OAAO;CACP,MAAM;CACN,OAAO;AACT,CAAC;AACD,MAAM,QAAQ,OAAO,OAAO,sBAAsB;CAChD,QAAQ;CACR,QAAQ;CACR,SAAS;CACT;CACA,WAAW;AACb,CAAC;AACD,IAAI,gBAAgB"}
|
|
@@ -8,7 +8,7 @@ import { StackHeader, StackHeaderComponent, StackHeaderSearchBar, StackScreen, S
|
|
|
8
8
|
import { withLayoutContext } from "./withLayoutContext.native.js";
|
|
9
9
|
|
|
10
10
|
var NativeStackNavigator = createStackNavigator().Navigator;
|
|
11
|
-
var RNStack = withLayoutContext(NativeStackNavigator);
|
|
11
|
+
var RNStack = withLayoutContext(NativeStackNavigator, void 0, { undeclaredRoutes: true });
|
|
12
12
|
function mapChildren(children) {
|
|
13
13
|
return Children.toArray(children).map(function(child, index) {
|
|
14
14
|
if (isChildOfType(child, StackScreen)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.native.js","names":[],"sources":["esm/layouts/Stack.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React, { Children, useMemo } from \"react\";\nimport { isChildOfType } from \"../utils/children\";\nimport { Protected } from \"../views/Protected\";\nimport { Screen } from \"../views/Screen\";\nimport { createStackNavigator, getStackNavigatorProps } from \"./stack-navigator\";\nimport { appendScreenStackPropsToOptions, StackHeader, StackHeaderComponent, StackHeaderSearchBar, StackScreen, StackToolbarBadge, StackToolbarButton, StackToolbarComponent, StackToolbarIcon, StackToolbarLabel, StackToolbarMenu, StackToolbarMenuAction, StackToolbarSearchBarSlot, StackToolbarSpacer, appendStackToolbarPropsToOptions } from \"./stack-utils\";\nimport { withLayoutContext } from \"./withLayoutContext\";\nvar NativeStackNavigator = createStackNavigator().Navigator;\nvar RNStack = withLayoutContext(NativeStackNavigator);\nfunction mapChildren(children) {\n return Children.toArray(children).map(function(child, index) {\n if (isChildOfType(child, StackScreen)) {\n var _child_props_name;\n var options = appendScreenStackPropsToOptions({}, child.props);\n var { children: _, ...rest } = child.props;\n return /* @__PURE__ */ _jsx(Screen, {\n ...rest,\n options\n }, (_child_props_name = child.props.name) !== null && _child_props_name !== void 0 ? _child_props_name : index);\n }\n if (isChildOfType(child, Protected)) {\n return /* @__PURE__ */ React.cloneElement(child, {\n key: `protected-${index}`\n }, mapChildren(child.props.children));\n }\n if (isChildOfType(child, StackHeaderComponent)) {\n return null;\n }\n if (isChildOfType(child, StackToolbarComponent)) {\n return null;\n }\n if (isChildOfType(child, Screen)) {\n return child;\n }\n return null;\n }).filter(Boolean);\n}\nvar StackWithComposition = /* @__PURE__ */ React.forwardRef(function(props, ref) {\n var { children, screenOptions, ...rest } = props;\n var screenOptionsWithHeader = useMemo(function() {\n var stackHeader = Children.toArray(children).find(function(child) {\n return isChildOfType(child, StackHeaderComponent);\n });\n var stackToolbars = Children.toArray(children).filter(function(child) {\n return isChildOfType(child, StackToolbarComponent);\n });\n if (!stackHeader && !stackToolbars.length) return screenOptions;\n var applyComposition = function applyComposition2(opts) {\n var result = opts;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = stackToolbars[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var stackToolbar = _step.value;\n result = appendStackToolbarPropsToOptions(result, stackToolbar.props);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (stackHeader && isChildOfType(stackHeader, StackHeaderComponent)) {\n var headerProps = {\n children: stackHeader\n };\n result = appendScreenStackPropsToOptions(result, headerProps);\n }\n return result;\n };\n if (screenOptions) {\n if (typeof screenOptions === \"function\") {\n return function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var opts = screenOptions(...args);\n return applyComposition(opts);\n };\n }\n return applyComposition(screenOptions);\n }\n return applyComposition({});\n }, [\n children,\n screenOptions\n ]);\n var processedChildren = useMemo(function() {\n return mapChildren(children);\n }, [\n children\n ]);\n var navigatorProps = useMemo(function() {\n return getStackNavigatorProps(children);\n }, [\n children\n ]);\n return /* @__PURE__ */ _jsx(RNStack, {\n ...rest,\n ...navigatorProps,\n ref,\n screenOptions: screenOptionsWithHeader,\n children: processedChildren\n });\n});\nvar StackToolbar = Object.assign(StackToolbarComponent, {\n Button: StackToolbarButton,\n Menu: StackToolbarMenu,\n MenuAction: StackToolbarMenuAction,\n Spacer: StackToolbarSpacer,\n SearchBarSlot: StackToolbarSearchBarSlot,\n Label: StackToolbarLabel,\n Icon: StackToolbarIcon,\n Badge: StackToolbarBadge\n});\nvar Stack = Object.assign(StackWithComposition, {\n Screen: StackScreen,\n Header: StackHeader,\n Toolbar: StackToolbar,\n Protected,\n SearchBar: StackHeaderSearchBar\n});\nvar Stack_default = Stack;\nexport {\n Stack,\n Stack_default as default\n};\n//# sourceMappingURL=Stack.js.map\n"],"mappings":";;;;;;;;;;AAQA,IAAI,uBAAuB,qBAAqB,CAAC,CAAC;AAClD,IAAI,UAAU,kBAAkB,
|
|
1
|
+
{"version":3,"file":"Stack.native.js","names":[],"sources":["esm/layouts/Stack.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React, { Children, useMemo } from \"react\";\nimport { isChildOfType } from \"../utils/children\";\nimport { Protected } from \"../views/Protected\";\nimport { Screen } from \"../views/Screen\";\nimport { createStackNavigator, getStackNavigatorProps } from \"./stack-navigator\";\nimport { appendScreenStackPropsToOptions, StackHeader, StackHeaderComponent, StackHeaderSearchBar, StackScreen, StackToolbarBadge, StackToolbarButton, StackToolbarComponent, StackToolbarIcon, StackToolbarLabel, StackToolbarMenu, StackToolbarMenuAction, StackToolbarSearchBarSlot, StackToolbarSpacer, appendStackToolbarPropsToOptions } from \"./stack-utils\";\nimport { withLayoutContext } from \"./withLayoutContext\";\nvar NativeStackNavigator = createStackNavigator().Navigator;\nvar RNStack = withLayoutContext(NativeStackNavigator, void 0, {\n undeclaredRoutes: true\n});\nfunction mapChildren(children) {\n return Children.toArray(children).map(function(child, index) {\n if (isChildOfType(child, StackScreen)) {\n var _child_props_name;\n var options = appendScreenStackPropsToOptions({}, child.props);\n var { children: _, ...rest } = child.props;\n return /* @__PURE__ */ _jsx(Screen, {\n ...rest,\n options\n }, (_child_props_name = child.props.name) !== null && _child_props_name !== void 0 ? _child_props_name : index);\n }\n if (isChildOfType(child, Protected)) {\n return /* @__PURE__ */ React.cloneElement(child, {\n key: `protected-${index}`\n }, mapChildren(child.props.children));\n }\n if (isChildOfType(child, StackHeaderComponent)) {\n return null;\n }\n if (isChildOfType(child, StackToolbarComponent)) {\n return null;\n }\n if (isChildOfType(child, Screen)) {\n return child;\n }\n return null;\n }).filter(Boolean);\n}\nvar StackWithComposition = /* @__PURE__ */ React.forwardRef(function(props, ref) {\n var { children, screenOptions, ...rest } = props;\n var screenOptionsWithHeader = useMemo(function() {\n var stackHeader = Children.toArray(children).find(function(child) {\n return isChildOfType(child, StackHeaderComponent);\n });\n var stackToolbars = Children.toArray(children).filter(function(child) {\n return isChildOfType(child, StackToolbarComponent);\n });\n if (!stackHeader && !stackToolbars.length) return screenOptions;\n var applyComposition = function applyComposition2(opts) {\n var result = opts;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = stackToolbars[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var stackToolbar = _step.value;\n result = appendStackToolbarPropsToOptions(result, stackToolbar.props);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (stackHeader && isChildOfType(stackHeader, StackHeaderComponent)) {\n var headerProps = {\n children: stackHeader\n };\n result = appendScreenStackPropsToOptions(result, headerProps);\n }\n return result;\n };\n if (screenOptions) {\n if (typeof screenOptions === \"function\") {\n return function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var opts = screenOptions(...args);\n return applyComposition(opts);\n };\n }\n return applyComposition(screenOptions);\n }\n return applyComposition({});\n }, [\n children,\n screenOptions\n ]);\n var processedChildren = useMemo(function() {\n return mapChildren(children);\n }, [\n children\n ]);\n var navigatorProps = useMemo(function() {\n return getStackNavigatorProps(children);\n }, [\n children\n ]);\n return /* @__PURE__ */ _jsx(RNStack, {\n ...rest,\n ...navigatorProps,\n ref,\n screenOptions: screenOptionsWithHeader,\n children: processedChildren\n });\n});\nvar StackToolbar = Object.assign(StackToolbarComponent, {\n Button: StackToolbarButton,\n Menu: StackToolbarMenu,\n MenuAction: StackToolbarMenuAction,\n Spacer: StackToolbarSpacer,\n SearchBarSlot: StackToolbarSearchBarSlot,\n Label: StackToolbarLabel,\n Icon: StackToolbarIcon,\n Badge: StackToolbarBadge\n});\nvar Stack = Object.assign(StackWithComposition, {\n Screen: StackScreen,\n Header: StackHeader,\n Toolbar: StackToolbar,\n Protected,\n SearchBar: StackHeaderSearchBar\n});\nvar Stack_default = Stack;\nexport {\n Stack,\n Stack_default as default\n};\n//# sourceMappingURL=Stack.js.map\n"],"mappings":";;;;;;;;;;AAQA,IAAI,uBAAuB,qBAAqB,CAAC,CAAC;AAClD,IAAI,UAAU,kBAAkB,sBAAsB,KAAK,GAAG,EAC5D,kBAAkB,KACpB,CAAC;AACD,SAAS,YAAY,UAAU;CAC7B,OAAO,SAAS,QAAQ,QAAQ,CAAC,CAAC,IAAI,SAAS,OAAO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CAAC;AACD,IAAI,QAAQ,OAAO,OAAO,sBAAsB;CAC9C,QAAQ;CACR,QAAQ;CACR,SAAS;CACT;CACA,WAAW;AACb,CAAC;AACD,IAAI,gBAAgB"}
|
|
@@ -110,7 +110,7 @@ function withLayoutContext(Nav, processor, options) {
|
|
|
110
110
|
}, [currentPathname, protectedHref]);
|
|
111
111
|
const processed = processor ? processor(screens ?? []) : screens;
|
|
112
112
|
const sorted = useSortedScreens(processed ?? [], {
|
|
113
|
-
|
|
113
|
+
remaining: options?.undeclaredRoutes ? "authored" : "none",
|
|
114
114
|
protectedScreens
|
|
115
115
|
});
|
|
116
116
|
if (!sorted.length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLayoutContext.js","names":[],"sources":["esm/layouts/withLayoutContext.js"],"sourcesContent":["import React from \"react\";\nimport { getContextKey, stripInvisibleSegmentsFromPath } from \"../router/matchers\";\nimport { useContextKey, useRouteNode } from \"../router/Route\";\nimport {\n registerProtectedRoutes,\n replace,\n resolveProtectedHref,\n routeInfo,\n unregisterProtectedRoutes\n} 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\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction useFilterScreenChildren(children, {\n isCustomNavigator,\n contextKey\n} = {}) {\n return React.useMemo(() => {\n const customChildren = [];\n const screens = [];\n const protectedScreens = /* @__PURE__ */ new Set();\n const guardedRedirects = /* @__PURE__ */ new Map();\n function flattenChild(child, exclude = false, redirectTo) {\n if (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(\n `<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 }\n if (process.env.NODE_ENV !== \"production\") {\n if ([\"children\", \"component\", \"getComponent\"].some(\n (key) => child.props && typeof child.props === \"object\" && key in child.props\n )) {\n throw new Error(\n `<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 }\n const 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 const guardFails = !child.props.guard;\n const excludeChildren = exclude || guardFails;\n const childRedirectTo = guardFails ? child.props.redirectTo : redirectTo;\n React.Children.forEach(child.props.children, (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(\n `[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 }\n React.Children.forEach(children, (child) => flattenChild(child));\n if (process.env.NODE_ENV !== \"production\") {\n const names = screens.map((screen) => screen.name);\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 }, [children, contextKey, isCustomNavigator]);\n}\nfunction useResolvedGuardedRedirects(guardedRedirects) {\n const node = useRouteNode();\n return React.useMemo(() => {\n if (!node) {\n return guardedRedirects;\n }\n const defaultRoute = [...node.children].sort(sortRoutesWithInitial(node.initialRouteName)).find((child) => {\n const normalized = child.route.replace(/\\/index$/, \"\");\n return !(guardedRedirects.has(child.route) || guardedRedirects.has(normalized));\n });\n const defaultHref = defaultRoute ? stripInvisibleSegmentsFromPath(getContextKey(defaultRoute.contextKey)) || \"/\" : void 0;\n return new Map(\n Array.from(guardedRedirects, ([name, redirectTo]) => [\n name,\n redirectTo ?? defaultHref\n ])\n );\n }, [guardedRedirects, node]);\n}\nfunction withLayoutContext(Nav, processor, options) {\n return withStaticProperties(\n React.forwardRef(\n (propsIn, ref) => {\n const { children, ...props } = propsIn;\n const contextKey = useContextKey();\n const { screens, protectedScreens, guardedRedirects } = useFilterScreenChildren(\n children,\n { contextKey }\n );\n const resolvedGuardedRedirects = useResolvedGuardedRedirects(guardedRedirects);\n registerProtectedRoutes(contextKey, resolvedGuardedRedirects);\n const currentPathname = routeInfo?.pathname;\n const protectedHref = currentPathname ? resolveProtectedHref(currentPathname) : currentPathname;\n React.useEffect(() => {\n registerProtectedRoutes(contextKey, resolvedGuardedRedirects);\n return () => {\n unregisterProtectedRoutes(contextKey);\n };\n }, [contextKey, resolvedGuardedRedirects]);\n React.useEffect(() => {\n if (currentPathname && protectedHref && protectedHref !== currentPathname) {\n replace(protectedHref);\n }\n }, [currentPathname, protectedHref]);\n const processed = processor ? processor(screens ?? []) : screens;\n const sorted = useSortedScreens(processed ?? [], {\n
|
|
1
|
+
{"version":3,"file":"withLayoutContext.js","names":[],"sources":["esm/layouts/withLayoutContext.js"],"sourcesContent":["import React from \"react\";\nimport { getContextKey, stripInvisibleSegmentsFromPath } from \"../router/matchers\";\nimport { useContextKey, useRouteNode } from \"../router/Route\";\nimport {\n registerProtectedRoutes,\n replace,\n resolveProtectedHref,\n routeInfo,\n unregisterProtectedRoutes\n} 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\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction useFilterScreenChildren(children, {\n isCustomNavigator,\n contextKey\n} = {}) {\n return React.useMemo(() => {\n const customChildren = [];\n const screens = [];\n const protectedScreens = /* @__PURE__ */ new Set();\n const guardedRedirects = /* @__PURE__ */ new Map();\n function flattenChild(child, exclude = false, redirectTo) {\n if (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(\n `<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 }\n if (process.env.NODE_ENV !== \"production\") {\n if ([\"children\", \"component\", \"getComponent\"].some(\n (key) => child.props && typeof child.props === \"object\" && key in child.props\n )) {\n throw new Error(\n `<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 }\n const 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 const guardFails = !child.props.guard;\n const excludeChildren = exclude || guardFails;\n const childRedirectTo = guardFails ? child.props.redirectTo : redirectTo;\n React.Children.forEach(child.props.children, (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(\n `[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 }\n React.Children.forEach(children, (child) => flattenChild(child));\n if (process.env.NODE_ENV !== \"production\") {\n const names = screens.map((screen) => screen.name);\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 }, [children, contextKey, isCustomNavigator]);\n}\nfunction useResolvedGuardedRedirects(guardedRedirects) {\n const node = useRouteNode();\n return React.useMemo(() => {\n if (!node) {\n return guardedRedirects;\n }\n const defaultRoute = [...node.children].sort(sortRoutesWithInitial(node.initialRouteName)).find((child) => {\n const normalized = child.route.replace(/\\/index$/, \"\");\n return !(guardedRedirects.has(child.route) || guardedRedirects.has(normalized));\n });\n const defaultHref = defaultRoute ? stripInvisibleSegmentsFromPath(getContextKey(defaultRoute.contextKey)) || \"/\" : void 0;\n return new Map(\n Array.from(guardedRedirects, ([name, redirectTo]) => [\n name,\n redirectTo ?? defaultHref\n ])\n );\n }, [guardedRedirects, node]);\n}\nfunction withLayoutContext(Nav, processor, options) {\n return withStaticProperties(\n React.forwardRef(\n (propsIn, ref) => {\n const { children, ...props } = propsIn;\n const contextKey = useContextKey();\n const { screens, protectedScreens, guardedRedirects } = useFilterScreenChildren(\n children,\n { contextKey }\n );\n const resolvedGuardedRedirects = useResolvedGuardedRedirects(guardedRedirects);\n registerProtectedRoutes(contextKey, resolvedGuardedRedirects);\n const currentPathname = routeInfo?.pathname;\n const protectedHref = currentPathname ? resolveProtectedHref(currentPathname) : currentPathname;\n React.useEffect(() => {\n registerProtectedRoutes(contextKey, resolvedGuardedRedirects);\n return () => {\n unregisterProtectedRoutes(contextKey);\n };\n }, [contextKey, resolvedGuardedRedirects]);\n React.useEffect(() => {\n if (currentPathname && protectedHref && protectedHref !== currentPathname) {\n replace(protectedHref);\n }\n }, [currentPathname, protectedHref]);\n const processed = processor ? processor(screens ?? []) : screens;\n const sorted = useSortedScreens(processed ?? [], {\n remaining: options?.undeclaredRoutes ? \"authored\" : \"none\",\n protectedScreens\n });\n if (!sorted.length) {\n return null;\n }\n return /* @__PURE__ */ jsx(IsWithinNativeNavigator.Provider, { value: true, children: /* @__PURE__ */ jsx(Nav, { ...options?.props, ...props, ref, children: sorted }) });\n }\n ),\n {\n Screen\n }\n );\n}\nexport {\n useFilterScreenChildren,\n useResolvedGuardedRedirects,\n with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BAA4B,gBAAgB;EAC7E,wBAAwB,YAAY,wBAAwB;EAC5D,MAAM,kBAAkB,WAAW;EACnC,MAAM,gBAAgB,kBAAkB,qBAAqB,eAAe,IAAI;EAChF,MAAM,gBAAgB;GACpB,wBAAwB,YAAY,wBAAwB;GAC5D,aAAa;IACX,0BAA0B,UAAU;GACtC;EACF,GAAG,CAAC,YAAY,wBAAwB,CAAC;EACzC,MAAM,gBAAgB;GACpB,IAAI,mBAAmB,iBAAiB,kBAAkB,iBAAiB;IACzE,QAAQ,aAAa;GACvB;EACF,GAAG,CAAC,iBAAiB,aAAa,CAAC;EACnC,MAAM,YAAY,YAAY,UAAU,WAAW,CAAC,CAAC,IAAI;EACzD,MAAM,SAAS,iBAAiB,aAAa,CAAC,GAAG;GAC/C,WAAW,SAAS,mBAAmB,aAAa;GACpD;EACF,CAAC;EACD,IAAI,CAAC,OAAO,QAAQ;GAClB,OAAO;EACT;EACA,OAAuB,oBAAI,wBAAwB,UAAU;GAAE,OAAO;GAAM,UAA0B,oBAAI,KAAK;IAAE,GAAG,SAAS;IAAO,GAAG;IAAO;IAAK,UAAU;GAAO,CAAC;EAAE,CAAC;CAC1K,CACF,GACA,EACE,OACF,CACF;AACF"}
|
|
@@ -123,7 +123,7 @@ function withLayoutContext(Nav, processor, options) {
|
|
|
123
123
|
}, [currentPathname, protectedHref]);
|
|
124
124
|
var processed = processor ? processor(screens !== null && screens !== void 0 ? screens : []) : screens;
|
|
125
125
|
var sorted = useSortedScreens(processed !== null && processed !== void 0 ? processed : [], {
|
|
126
|
-
|
|
126
|
+
remaining: (options === null || options === void 0 ? void 0 : options.undeclaredRoutes) ? "authored" : "none",
|
|
127
127
|
protectedScreens
|
|
128
128
|
});
|
|
129
129
|
if (!sorted.length) {
|