one 2.14.2 → 2.15.0
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/Root.cjs +6 -1
- package/dist/cjs/Root.native.cjs +6 -1
- package/dist/cjs/Root.native.js +6 -1
- package/dist/cjs/Root.native.js.map +1 -1
- package/dist/cjs/platform/launchScreen/index.native.cjs +15 -1
- package/dist/cjs/platform/launchScreen/index.native.js +15 -1
- package/dist/cjs/platform/launchScreen/index.native.js.map +1 -1
- package/dist/cjs/router/LaunchScreenRelease.cjs +26 -0
- package/dist/cjs/router/LaunchScreenRelease.native.cjs +35 -0
- package/dist/cjs/router/LaunchScreenRelease.native.js +37 -0
- package/dist/cjs/router/LaunchScreenRelease.native.js.map +1 -0
- package/dist/esm/Root.mjs +6 -1
- package/dist/esm/Root.mjs.map +1 -1
- package/dist/esm/Root.native.js +6 -1
- package/dist/esm/Root.native.js.map +1 -1
- package/dist/esm/platform/launchScreen/index.native.js +11 -1
- package/dist/esm/platform/launchScreen/index.native.js.map +1 -1
- package/dist/esm/router/LaunchScreenRelease.mjs +6 -0
- package/dist/esm/router/LaunchScreenRelease.mjs.map +1 -0
- package/dist/esm/router/LaunchScreenRelease.native.js +14 -0
- package/dist/esm/router/LaunchScreenRelease.native.js.map +1 -0
- package/package.json +16 -16
- package/src/Root.tsx +2 -0
- package/src/native/appManifest.ts +1 -0
- package/src/native/index.ts +1 -0
- package/src/platform/launchScreen/index.native.ts +13 -0
- package/src/router/LaunchScreenRelease.native.tsx +20 -0
- package/src/router/LaunchScreenRelease.tsx +4 -0
- package/types/Root.d.ts.map +1 -1
- package/types/native/appManifest.d.ts +1 -1
- package/types/native/appManifest.d.ts.map +1 -1
- package/types/native/index.d.ts +1 -1
- package/types/native/index.d.ts.map +1 -1
- package/types/platform/launchScreen/index.native.d.ts +2 -0
- package/types/platform/launchScreen/index.native.d.ts.map +1 -1
- package/types/router/LaunchScreenRelease.d.ts +2 -0
- package/types/router/LaunchScreenRelease.d.ts.map +1 -0
- package/types/router/LaunchScreenRelease.native.d.ts +2 -0
- package/types/router/LaunchScreenRelease.native.d.ts.map +1 -0
package/dist/cjs/Root.cjs
CHANGED
|
@@ -33,6 +33,7 @@ var import_FlagsContext = require("./router/FlagsContext.cjs");
|
|
|
33
33
|
var import_linkingConfig = require("./router/linkingConfig.cjs");
|
|
34
34
|
var import_router = require("./router/router.cjs");
|
|
35
35
|
var import_serverLocationContext = require("./router/serverLocationContext.cjs");
|
|
36
|
+
var import_LaunchScreenRelease = require("./router/LaunchScreenRelease.cjs");
|
|
36
37
|
var import_useInitializeOneRouter = require("./router/useInitializeOneRouter.cjs");
|
|
37
38
|
var import_useViteRoutes = require("./router/useViteRoutes.cjs");
|
|
38
39
|
var import_evictOldest = require("./utils/evictOldest.cjs");
|
|
@@ -93,7 +94,11 @@ function Root(props) {
|
|
|
93
94
|
...navigationContainerProps,
|
|
94
95
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_serverLocationContext.ServerLocationContext.Provider, {
|
|
95
96
|
value: location,
|
|
96
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
97
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
98
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ScrollBehavior.ScrollBehavior, {}),
|
|
99
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_RootErrorBoundary.RootErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {}) }),
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LaunchScreenRelease.LaunchScreenRelease, {})
|
|
101
|
+
] })
|
|
97
102
|
})
|
|
98
103
|
})
|
|
99
104
|
}),
|
package/dist/cjs/Root.native.cjs
CHANGED
|
@@ -36,6 +36,7 @@ var import_FlagsContext = require("./router/FlagsContext.native.js");
|
|
|
36
36
|
var import_linkingConfig = require("./router/linkingConfig.native.js");
|
|
37
37
|
var import_router = require("./router/router.native.js");
|
|
38
38
|
var import_serverLocationContext = require("./router/serverLocationContext.native.js");
|
|
39
|
+
var import_LaunchScreenRelease = require("./router/LaunchScreenRelease.native.js");
|
|
39
40
|
var import_useInitializeOneRouter = require("./router/useInitializeOneRouter.native.js");
|
|
40
41
|
var import_useViteRoutes = require("./router/useViteRoutes.native.js");
|
|
41
42
|
var import_evictOldest = require("./utils/evictOldest.native.js");
|
|
@@ -100,7 +101,11 @@ function Root(props) {
|
|
|
100
101
|
...navigationContainerProps,
|
|
101
102
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_serverLocationContext.ServerLocationContext.Provider, {
|
|
102
103
|
value: location,
|
|
103
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
104
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ScrollBehavior.ScrollBehavior, {}),
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_RootErrorBoundary.RootErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {}) }),
|
|
107
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LaunchScreenRelease.LaunchScreenRelease, {})
|
|
108
|
+
] })
|
|
104
109
|
})
|
|
105
110
|
})
|
|
106
111
|
}),
|
package/dist/cjs/Root.native.js
CHANGED
|
@@ -36,6 +36,7 @@ var import_FlagsContext = require("./router/FlagsContext.native.js");
|
|
|
36
36
|
var import_linkingConfig = require("./router/linkingConfig.native.js");
|
|
37
37
|
var import_router = require("./router/router.native.js");
|
|
38
38
|
var import_serverLocationContext = require("./router/serverLocationContext.native.js");
|
|
39
|
+
var import_LaunchScreenRelease = require("./router/LaunchScreenRelease.native.js");
|
|
39
40
|
var import_useInitializeOneRouter = require("./router/useInitializeOneRouter.native.js");
|
|
40
41
|
var import_useViteRoutes = require("./router/useViteRoutes.native.js");
|
|
41
42
|
var import_evictOldest = require("./utils/evictOldest.native.js");
|
|
@@ -100,7 +101,11 @@ function Root(props) {
|
|
|
100
101
|
...navigationContainerProps,
|
|
101
102
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_serverLocationContext.ServerLocationContext.Provider, {
|
|
102
103
|
value: location,
|
|
103
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
104
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ScrollBehavior.ScrollBehavior, {}),
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_RootErrorBoundary.RootErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {}) }),
|
|
107
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LaunchScreenRelease.LaunchScreenRelease, {})
|
|
108
|
+
] })
|
|
104
109
|
})
|
|
105
110
|
})
|
|
106
111
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Root.native.js","names":[],"sources":["cjs/Root.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Root_exports = {};\n__export(Root_exports, {\n Root: () => Root\n});\nmodule.exports = __toCommonJS(Root_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_theme = require(\"./fork/theme\");\nvar import_color_scheme = require(\"@vxrn/color-scheme\");\nvar import_react = require(\"react\");\nvar import_constants = require(\"./constants\");\nvar import_screensFeatureFlags = require(\"./screensFeatureFlags\");\nvar import_SpaShellContext = require(\"./router/SpaShellContext\");\nvar import_NavigationContainer = require(\"./fork/NavigationContainer\");\nvar import_getURL = require(\"./getURL\");\nvar import_FlagsContext = require(\"./router/FlagsContext\");\nvar import_linkingConfig = require(\"./router/linkingConfig\");\nvar import_router = require(\"./router/router\");\nvar import_serverLocationContext = require(\"./router/serverLocationContext\");\nvar import_useInitializeOneRouter = require(\"./router/useInitializeOneRouter\");\nvar import_useViteRoutes = require(\"./router/useViteRoutes\");\nvar import_evictOldest = require(\"./utils/evictOldest\");\nvar import_useServerHeadInsertion = require(\"./useServerHeadInsertion\");\nvar import_PreloadLinks = require(\"./views/PreloadLinks\");\nvar import_safe_area_context = require(\"./safe-area-context\");\nvar import_RootErrorBoundary = require(\"./views/RootErrorBoundary\");\nvar import_ScrollBehavior = require(\"./views/ScrollBehavior\");\nvar ssrLocationCache = /* @__PURE__ */ new Map();\nfunction getCachedSSRLocation(path) {\n var url = ssrLocationCache.get(path);\n if (url) return url;\n url = new URL(path, (0, import_getURL.getURL)());\n (0, import_evictOldest.evictOldest)(ssrLocationCache, 5e3, 1e3);\n ssrLocationCache.set(path, url);\n return url;\n}\nvar ServerAsyncLocalIDContext = /* @__PURE__ */ (0, import_react.createContext)(null);\nfunction Root(props) {\n var _globalThis___vxrnrequestAsyncLocalStore;\n globalThis[\"__vxrnGetContextFromReactContext\"] = function() {\n return (0, import_react.useContext)(ServerAsyncLocalIDContext);\n };\n if (import_constants.isNative) {\n (0, import_screensFeatureFlags.initScreensFeatureFlags)();\n }\n var { path, routes, routeOptions, isClient, navigationContainerProps, onRenderId, linking } = props;\n var context = (0, import_useViteRoutes.useViteRoutes)(routes, props.routerRoot, routeOptions, globalThis[\"__vxrnVersion\"]);\n var location = import_constants.isNative ? void 0 : typeof window !== \"undefined\" && window.location ? new URL(path || window.location.href || \"/\", window.location.href) : getCachedSSRLocation(path || \"/\");\n var store = (0, import_useInitializeOneRouter.useInitializeOneRouter)(context, location, linking);\n var userScheme = (0, import_color_scheme.useUserScheme)();\n var Component = store.rootComponent;\n if (!Component) {\n throw new Error(`No root component found`);\n }\n var id = (0, import_react.useId)();\n onRenderId === null || onRenderId === void 0 ? void 0 : onRenderId(id);\n var value = process.env.VERCEL ? globalThis[\"__oneGlobalContextId\"] : ((_globalThis___vxrnrequestAsyncLocalStore = globalThis[\"__vxrnrequestAsyncLocalStore\"]) === null || _globalThis___vxrnrequestAsyncLocalStore === void 0 ? void 0 : _globalThis___vxrnrequestAsyncLocalStore.getStore()) || null;\n var deferredPreloads = props.deferredPreloads;\n var contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ServerAsyncLocalIDContext.Provider, {\n value,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_useServerHeadInsertion.ServerRenderID.Provider, {\n value: id,\n children: [\n typeof window === \"undefined\" && (deferredPreloads === null || deferredPreloads === void 0 ? void 0 : deferredPreloads.map(function(src) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"link\", {\n rel: \"modulepreload\",\n fetchPriority: \"low\",\n href: src\n }, src);\n })),\n /* one owns the safe area provider on every platform: apps read it\n through One.UI.SafeArea and never mount their own */\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_safe_area_context.SafeAreaProvider, {\n initialMetrics: import_safe_area_context.initialWindowMetrics,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_NavigationContainer.NavigationContainer, {\n ref: store.navigationRef,\n initialState: store.initialState,\n linking: (0, import_linkingConfig.getResolvedLinking)(),\n onUnhandledAction,\n onStateChange: import_router.handleNavigationContainerStateChange,\n theme: userScheme.value === \"dark\" ? import_theme.DarkTheme : import_theme.DefaultTheme,\n documentTitle: {\n enabled: false\n },\n ...navigationContainerProps,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_serverLocationContext.ServerLocationContext.Provider, {\n value: location,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ScrollBehavior.ScrollBehavior, {}),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_RootErrorBoundary.RootErrorBoundary, {\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {})\n })\n ]\n })\n })\n })\n }),\n typeof window !== \"undefined\" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_PreloadLinks.PreloadLinks, {}, \"preload-links\")\n ]\n })\n });\n if (props.flags) {\n contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FlagsContext.FlagsContext.Provider, {\n value: props.flags,\n children: contents\n });\n }\n if (!process.env.ONE_DISABLE_STRICT_MODE) {\n contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.StrictMode, {\n children: contents\n });\n }\n if (isClient) {\n var _globalThis_SERVER_CONTEXT_KEY;\n var serverMode = (_globalThis_SERVER_CONTEXT_KEY = globalThis[import_constants.SERVER_CONTEXT_KEY]) === null || _globalThis_SERVER_CONTEXT_KEY === void 0 ? void 0 : _globalThis_SERVER_CONTEXT_KEY.mode;\n if (serverMode === \"spa\") {\n var [show, setShow] = (0, import_react.useState)(false);\n (0, import_react.useLayoutEffect)(function() {\n setShow(true);\n }, []);\n return show ? contents : null;\n }\n if (serverMode === \"spa-shell\") {\n var [isSpaShell, setIsSpaShell] = (0, import_react.useState)(true);\n (0, import_react.useLayoutEffect)(function() {\n setIsSpaShell(false);\n }, []);\n (0, import_react.useLayoutEffect)(function() {\n if (!isSpaShell) {\n var initialPath = window.location.pathname + window.location.search;\n requestAnimationFrame(function() {\n var _store_navigationRef;\n if (window.location.pathname + window.location.search !== initialPath) return;\n if (store.lastIntendedPathname !== void 0) return;\n var nav = (_store_navigationRef = store.navigationRef) === null || _store_navigationRef === void 0 ? void 0 : _store_navigationRef.current;\n if (!nav) return;\n var linking2 = (0, import_linkingConfig.getResolvedLinking)();\n if (linking2 === null || linking2 === void 0 ? void 0 : linking2.getStateFromPath) {\n var freshState = linking2.getStateFromPath(initialPath, linking2.config);\n if (freshState) {\n nav.resetRoot(freshState);\n }\n }\n });\n }\n }, [\n isSpaShell\n ]);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SpaShellContext.SpaShellContext.Provider, {\n value: isSpaShell,\n children: contents\n });\n }\n return contents;\n }\n if (props.mode === \"spa-shell\") {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SpaShellContext.SpaShellContext.Provider, {\n value: true,\n children: contents\n });\n }\n return contents;\n}\nvar onUnhandledAction;\nif (process.env.NODE_ENV !== \"production\") {\n onUnhandledAction = function onUnhandledAction2(action) {\n var payload = action.payload;\n var message = `The action '${action.type}'${payload ? ` with payload ${JSON.stringify(action.payload)}` : \"\"} was not handled by any navigator.`;\n switch (action.type) {\n case \"NAVIGATE\":\n case \"PUSH\":\n case \"REPLACE\":\n case \"JUMP_TO\":\n if (payload === null || payload === void 0 ? void 0 : payload.name) {\n message += `\n\nDo you have a route named '${payload.name}'?`;\n } else {\n message += `\n\nYou need to pass the name of the screen to navigate to. This may be a bug.`;\n }\n break;\n case \"GO_BACK\":\n case \"POP\":\n case \"POP_TO_TOP\":\n message += `\n\nIs there any screen to go back to?`;\n break;\n case \"OPEN_DRAWER\":\n case \"CLOSE_DRAWER\":\n case \"TOGGLE_DRAWER\":\n message += `\n\nIs your screen inside a Drawer navigator?`;\n break;\n }\n message += `\n\nThis is a development-only warning and won't be shown in production.`;\n if (process.env.NODE_ENV === \"test\") {\n throw new Error(message);\n }\n console.error(message);\n };\n} else {\n onUnhandledAction = function onUnhandledAction2() {\n };\n}\n//# sourceMappingURL=Root.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,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,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,eAAe,CAAC;AACpB,SAAS,cAAc,EACrB,YAAY,KACd,CAAC;AACD,OAAO,UAAU,aAAa,YAAY;AAC1C,IAAI,qBAAqB,QAAQ,mBAAmB;AACpD,IAAI,eAAe,QAAQ,wBAAc;AACzC,IAAI,sBAAsB,QAAQ,oBAAoB;AACtD,IAAI,eAAe,QAAQ,OAAO;AAClC,IAAI,mBAAmB,QAAQ,uBAAa;AAC5C,IAAI,6BAA6B,QAAQ,iCAAuB;AAChE,IAAI,yBAAyB,QAAQ,oCAA0B;AAC/D,IAAI,6BAA6B,QAAQ,sCAA4B;AACrE,IAAI,gBAAgB,QAAQ,oBAAU;AACtC,IAA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AAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,MAAM;KAClE,WAAW;;6BAEQ,QAAQ,KAAK;IAClC,OAAO;KACL,WAAW;;;IAGb;IACA;GACF,KAAK;GACL,KAAK;GACL,KAAK;IACH,WAAW;;;IAGX;GACF,KAAK;GACL,KAAK;GACL,KAAK;IACH,WAAW;;;IAGX;EACJ;EACA,WAAW;;;EAGX,IAAI,QAAQ,IAAI,aAAa,QAAQ;GACnC,MAAM,IAAI,MAAM,OAAO;EACzB;EACA,QAAQ,MAAM,OAAO;CACvB;AACF,OAAO;CACL,oBAAoB,SAAS,qBAAqB,CAClD;AACF"}
|
|
1
|
+
{"version":3,"file":"Root.native.js","names":[],"sources":["cjs/Root.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Root_exports = {};\n__export(Root_exports, {\n Root: () => Root\n});\nmodule.exports = __toCommonJS(Root_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_theme = require(\"./fork/theme\");\nvar import_color_scheme = require(\"@vxrn/color-scheme\");\nvar import_react = require(\"react\");\nvar import_constants = require(\"./constants\");\nvar import_screensFeatureFlags = require(\"./screensFeatureFlags\");\nvar import_SpaShellContext = require(\"./router/SpaShellContext\");\nvar import_NavigationContainer = require(\"./fork/NavigationContainer\");\nvar import_getURL = require(\"./getURL\");\nvar import_FlagsContext = require(\"./router/FlagsContext\");\nvar import_linkingConfig = require(\"./router/linkingConfig\");\nvar import_router = require(\"./router/router\");\nvar import_serverLocationContext = require(\"./router/serverLocationContext\");\nvar import_LaunchScreenRelease = require(\"./router/LaunchScreenRelease\");\nvar import_useInitializeOneRouter = require(\"./router/useInitializeOneRouter\");\nvar import_useViteRoutes = require(\"./router/useViteRoutes\");\nvar import_evictOldest = require(\"./utils/evictOldest\");\nvar import_useServerHeadInsertion = require(\"./useServerHeadInsertion\");\nvar import_PreloadLinks = require(\"./views/PreloadLinks\");\nvar import_safe_area_context = require(\"./safe-area-context\");\nvar import_RootErrorBoundary = require(\"./views/RootErrorBoundary\");\nvar import_ScrollBehavior = require(\"./views/ScrollBehavior\");\nvar ssrLocationCache = /* @__PURE__ */ new Map();\nfunction getCachedSSRLocation(path) {\n var url = ssrLocationCache.get(path);\n if (url) return url;\n url = new URL(path, (0, import_getURL.getURL)());\n (0, import_evictOldest.evictOldest)(ssrLocationCache, 5e3, 1e3);\n ssrLocationCache.set(path, url);\n return url;\n}\nvar ServerAsyncLocalIDContext = /* @__PURE__ */ (0, import_react.createContext)(null);\nfunction Root(props) {\n var _globalThis___vxrnrequestAsyncLocalStore;\n globalThis[\"__vxrnGetContextFromReactContext\"] = function() {\n return (0, import_react.useContext)(ServerAsyncLocalIDContext);\n };\n if (import_constants.isNative) {\n (0, import_screensFeatureFlags.initScreensFeatureFlags)();\n }\n var { path, routes, routeOptions, isClient, navigationContainerProps, onRenderId, linking } = props;\n var context = (0, import_useViteRoutes.useViteRoutes)(routes, props.routerRoot, routeOptions, globalThis[\"__vxrnVersion\"]);\n var location = import_constants.isNative ? void 0 : typeof window !== \"undefined\" && window.location ? new URL(path || window.location.href || \"/\", window.location.href) : getCachedSSRLocation(path || \"/\");\n var store = (0, import_useInitializeOneRouter.useInitializeOneRouter)(context, location, linking);\n var userScheme = (0, import_color_scheme.useUserScheme)();\n var Component = store.rootComponent;\n if (!Component) {\n throw new Error(`No root component found`);\n }\n var id = (0, import_react.useId)();\n onRenderId === null || onRenderId === void 0 ? void 0 : onRenderId(id);\n var value = process.env.VERCEL ? globalThis[\"__oneGlobalContextId\"] : ((_globalThis___vxrnrequestAsyncLocalStore = globalThis[\"__vxrnrequestAsyncLocalStore\"]) === null || _globalThis___vxrnrequestAsyncLocalStore === void 0 ? void 0 : _globalThis___vxrnrequestAsyncLocalStore.getStore()) || null;\n var deferredPreloads = props.deferredPreloads;\n var contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ServerAsyncLocalIDContext.Provider, {\n value,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_useServerHeadInsertion.ServerRenderID.Provider, {\n value: id,\n children: [\n typeof window === \"undefined\" && (deferredPreloads === null || deferredPreloads === void 0 ? void 0 : deferredPreloads.map(function(src) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"link\", {\n rel: \"modulepreload\",\n fetchPriority: \"low\",\n href: src\n }, src);\n })),\n /* one owns the safe area provider on every platform: apps read it\n through One.UI.SafeArea and never mount their own */\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_safe_area_context.SafeAreaProvider, {\n initialMetrics: import_safe_area_context.initialWindowMetrics,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_NavigationContainer.NavigationContainer, {\n ref: store.navigationRef,\n initialState: store.initialState,\n linking: (0, import_linkingConfig.getResolvedLinking)(),\n onUnhandledAction,\n onStateChange: import_router.handleNavigationContainerStateChange,\n theme: userScheme.value === \"dark\" ? import_theme.DarkTheme : import_theme.DefaultTheme,\n documentTitle: {\n enabled: false\n },\n ...navigationContainerProps,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_serverLocationContext.ServerLocationContext.Provider, {\n value: location,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ScrollBehavior.ScrollBehavior, {}),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_RootErrorBoundary.RootErrorBoundary, {\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {})\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LaunchScreenRelease.LaunchScreenRelease, {})\n ]\n })\n })\n })\n }),\n typeof window !== \"undefined\" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_PreloadLinks.PreloadLinks, {}, \"preload-links\")\n ]\n })\n });\n if (props.flags) {\n contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FlagsContext.FlagsContext.Provider, {\n value: props.flags,\n children: contents\n });\n }\n if (!process.env.ONE_DISABLE_STRICT_MODE) {\n contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.StrictMode, {\n children: contents\n });\n }\n if (isClient) {\n var _globalThis_SERVER_CONTEXT_KEY;\n var serverMode = (_globalThis_SERVER_CONTEXT_KEY = globalThis[import_constants.SERVER_CONTEXT_KEY]) === null || _globalThis_SERVER_CONTEXT_KEY === void 0 ? void 0 : _globalThis_SERVER_CONTEXT_KEY.mode;\n if (serverMode === \"spa\") {\n var [show, setShow] = (0, import_react.useState)(false);\n (0, import_react.useLayoutEffect)(function() {\n setShow(true);\n }, []);\n return show ? contents : null;\n }\n if (serverMode === \"spa-shell\") {\n var [isSpaShell, setIsSpaShell] = (0, import_react.useState)(true);\n (0, import_react.useLayoutEffect)(function() {\n setIsSpaShell(false);\n }, []);\n (0, import_react.useLayoutEffect)(function() {\n if (!isSpaShell) {\n var initialPath = window.location.pathname + window.location.search;\n requestAnimationFrame(function() {\n var _store_navigationRef;\n if (window.location.pathname + window.location.search !== initialPath) return;\n if (store.lastIntendedPathname !== void 0) return;\n var nav = (_store_navigationRef = store.navigationRef) === null || _store_navigationRef === void 0 ? void 0 : _store_navigationRef.current;\n if (!nav) return;\n var linking2 = (0, import_linkingConfig.getResolvedLinking)();\n if (linking2 === null || linking2 === void 0 ? void 0 : linking2.getStateFromPath) {\n var freshState = linking2.getStateFromPath(initialPath, linking2.config);\n if (freshState) {\n nav.resetRoot(freshState);\n }\n }\n });\n }\n }, [\n isSpaShell\n ]);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SpaShellContext.SpaShellContext.Provider, {\n value: isSpaShell,\n children: contents\n });\n }\n return contents;\n }\n if (props.mode === \"spa-shell\") {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SpaShellContext.SpaShellContext.Provider, {\n value: true,\n children: contents\n });\n }\n return contents;\n}\nvar onUnhandledAction;\nif (process.env.NODE_ENV !== \"production\") {\n onUnhandledAction = function onUnhandledAction2(action) {\n var payload = action.payload;\n var message = `The action '${action.type}'${payload ? ` with payload ${JSON.stringify(action.payload)}` : \"\"} was not handled by any navigator.`;\n switch (action.type) {\n case \"NAVIGATE\":\n case \"PUSH\":\n case \"REPLACE\":\n case \"JUMP_TO\":\n if (payload === null || payload === void 0 ? void 0 : payload.name) {\n message += `\n\nDo you have a route named '${payload.name}'?`;\n } else {\n message += `\n\nYou need to pass the name of the screen to navigate to. This may be a bug.`;\n }\n break;\n case \"GO_BACK\":\n case \"POP\":\n case \"POP_TO_TOP\":\n message += `\n\nIs there any screen to go back to?`;\n break;\n case \"OPEN_DRAWER\":\n case \"CLOSE_DRAWER\":\n case \"TOGGLE_DRAWER\":\n message += `\n\nIs your screen inside a Drawer navigator?`;\n break;\n }\n message += `\n\nThis is a development-only warning and won't be shown in production.`;\n if (process.env.NODE_ENV === \"test\") {\n throw new Error(message);\n }\n console.error(message);\n };\n} else {\n onUnhandledAction = function onUnhandledAction2() {\n };\n}\n//# sourceMappingURL=Root.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAA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ACL,KAAK;IACH,WAAW;;;IAGX;EACJ;EACA,WAAW;;;EAGX,IAAI,QAAQ,IAAI,aAAa,QAAQ;GACnC,MAAM,IAAI,MAAM,OAAO;EACzB;EACA,QAAQ,MAAM,OAAO;CACvB;AACF,OAAO;CACL,oBAAoB,SAAS,qBAAqB,CAClD;AACF"}
|
|
@@ -21,7 +21,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
21
21
|
};
|
|
22
22
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
23
|
var index_native_exports = {};
|
|
24
|
-
__export(index_native_exports, {
|
|
24
|
+
__export(index_native_exports, {
|
|
25
|
+
LaunchScreen: () => LaunchScreen,
|
|
26
|
+
holdLaunchScreenForRouter: () => holdLaunchScreenForRouter,
|
|
27
|
+
releaseLaunchScreenForRouter: () => releaseLaunchScreenForRouter
|
|
28
|
+
});
|
|
25
29
|
module.exports = __toCommonJS(index_native_exports);
|
|
26
30
|
var import_react_native_nitro_modules = require("react-native-nitro-modules");
|
|
27
31
|
var import_Cover = require("./Cover.native.js");
|
|
@@ -29,12 +33,14 @@ var import_config = require("./config.native.js");
|
|
|
29
33
|
var _ref;
|
|
30
34
|
var _readLaunchScreenConfig;
|
|
31
35
|
var hybrid;
|
|
36
|
+
var appHolds = false;
|
|
32
37
|
function native() {
|
|
33
38
|
hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = import_react_native_nitro_modules.NitroModules.createHybridObject("OneLaunchScreen");
|
|
34
39
|
return hybrid;
|
|
35
40
|
}
|
|
36
41
|
var LaunchScreen = Object.freeze({
|
|
37
42
|
preventAutoHide() {
|
|
43
|
+
appHolds = true;
|
|
38
44
|
native().preventAutoHide();
|
|
39
45
|
},
|
|
40
46
|
hide(options) {
|
|
@@ -44,3 +50,11 @@ var LaunchScreen = Object.freeze({
|
|
|
44
50
|
Cover: import_Cover.Cover,
|
|
45
51
|
artworkWidth: (_ref = (_readLaunchScreenConfig = (0, import_config.readLaunchScreenConfig)()) === null || _readLaunchScreenConfig === void 0 ? void 0 : _readLaunchScreenConfig.width) !== null && _ref !== void 0 ? _ref : null
|
|
46
52
|
});
|
|
53
|
+
function holdLaunchScreenForRouter() {
|
|
54
|
+
if (!import_react_native_nitro_modules.NitroModules.hasHybridObject("OneLaunchScreen")) return false;
|
|
55
|
+
native().preventAutoHide();
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
function releaseLaunchScreenForRouter() {
|
|
59
|
+
if (!appHolds) native().hide(false);
|
|
60
|
+
}
|
|
@@ -21,7 +21,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
21
21
|
};
|
|
22
22
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
23
|
var index_native_exports = {};
|
|
24
|
-
__export(index_native_exports, {
|
|
24
|
+
__export(index_native_exports, {
|
|
25
|
+
LaunchScreen: () => LaunchScreen,
|
|
26
|
+
holdLaunchScreenForRouter: () => holdLaunchScreenForRouter,
|
|
27
|
+
releaseLaunchScreenForRouter: () => releaseLaunchScreenForRouter
|
|
28
|
+
});
|
|
25
29
|
module.exports = __toCommonJS(index_native_exports);
|
|
26
30
|
var import_react_native_nitro_modules = require("react-native-nitro-modules");
|
|
27
31
|
var import_Cover = require("./Cover.native.js");
|
|
@@ -29,12 +33,14 @@ var import_config = require("./config.native.js");
|
|
|
29
33
|
var _ref;
|
|
30
34
|
var _readLaunchScreenConfig;
|
|
31
35
|
var hybrid;
|
|
36
|
+
var appHolds = false;
|
|
32
37
|
function native() {
|
|
33
38
|
hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = import_react_native_nitro_modules.NitroModules.createHybridObject("OneLaunchScreen");
|
|
34
39
|
return hybrid;
|
|
35
40
|
}
|
|
36
41
|
var LaunchScreen = Object.freeze({
|
|
37
42
|
preventAutoHide() {
|
|
43
|
+
appHolds = true;
|
|
38
44
|
native().preventAutoHide();
|
|
39
45
|
},
|
|
40
46
|
hide(options) {
|
|
@@ -44,5 +50,13 @@ var LaunchScreen = Object.freeze({
|
|
|
44
50
|
Cover: import_Cover.Cover,
|
|
45
51
|
artworkWidth: (_ref = (_readLaunchScreenConfig = (0, import_config.readLaunchScreenConfig)()) === null || _readLaunchScreenConfig === void 0 ? void 0 : _readLaunchScreenConfig.width) !== null && _ref !== void 0 ? _ref : null
|
|
46
52
|
});
|
|
53
|
+
function holdLaunchScreenForRouter() {
|
|
54
|
+
if (!import_react_native_nitro_modules.NitroModules.hasHybridObject("OneLaunchScreen")) return false;
|
|
55
|
+
native().preventAutoHide();
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
function releaseLaunchScreenForRouter() {
|
|
59
|
+
if (!appHolds) native().hide(false);
|
|
60
|
+
}
|
|
47
61
|
|
|
48
62
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/platform/launchScreen/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_native_exports = {};\n__export(index_native_exports, {\n LaunchScreen: () => LaunchScreen\n});\nmodule.exports = __toCommonJS(index_native_exports);\nvar import_react_native_nitro_modules = require(\"react-native-nitro-modules\");\nvar import_Cover = require(\"./Cover.native\");\nvar import_config = require(\"./config\");\nvar _ref;\nvar _readLaunchScreenConfig;\nvar hybrid;\nfunction native() {\n hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = import_react_native_nitro_modules.NitroModules.createHybridObject(\"OneLaunchScreen\");\n return hybrid;\n}\nvar LaunchScreen = Object.freeze({\n preventAutoHide() {\n native().preventAutoHide();\n },\n hide(options) {\n var _ref2;\n native().hide((_ref2 = options === null || options === void 0 ? void 0 : options.fade) !== null && _ref2 !== void 0 ? _ref2 : false);\n },\n Cover: import_Cover.Cover,\n artworkWidth: (_ref = (_readLaunchScreenConfig = (0, import_config.readLaunchScreenConfig)()) === null || _readLaunchScreenConfig === void 0 ? void 0 : _readLaunchScreenConfig.width) !== null && _ref !== void 0 ? _ref : null\n});\n//# sourceMappingURL=index.native.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,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,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,uBAAuB,CAAC;AAC5B,SAAS,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/platform/launchScreen/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_native_exports = {};\n__export(index_native_exports, {\n LaunchScreen: () => LaunchScreen,\n holdLaunchScreenForRouter: () => holdLaunchScreenForRouter,\n releaseLaunchScreenForRouter: () => releaseLaunchScreenForRouter\n});\nmodule.exports = __toCommonJS(index_native_exports);\nvar import_react_native_nitro_modules = require(\"react-native-nitro-modules\");\nvar import_Cover = require(\"./Cover.native\");\nvar import_config = require(\"./config\");\nvar _ref;\nvar _readLaunchScreenConfig;\nvar hybrid;\nvar appHolds = false;\nfunction native() {\n hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = import_react_native_nitro_modules.NitroModules.createHybridObject(\"OneLaunchScreen\");\n return hybrid;\n}\nvar LaunchScreen = Object.freeze({\n preventAutoHide() {\n appHolds = true;\n native().preventAutoHide();\n },\n hide(options) {\n var _ref2;\n native().hide((_ref2 = options === null || options === void 0 ? void 0 : options.fade) !== null && _ref2 !== void 0 ? _ref2 : false);\n },\n Cover: import_Cover.Cover,\n artworkWidth: (_ref = (_readLaunchScreenConfig = (0, import_config.readLaunchScreenConfig)()) === null || _readLaunchScreenConfig === void 0 ? void 0 : _readLaunchScreenConfig.width) !== null && _ref !== void 0 ? _ref : null\n});\nfunction holdLaunchScreenForRouter() {\n if (!import_react_native_nitro_modules.NitroModules.hasHybridObject(\"OneLaunchScreen\")) return false;\n native().preventAutoHide();\n return true;\n}\nfunction releaseLaunchScreenForRouter() {\n if (!appHolds) native().hide(false);\n}\n//# sourceMappingURL=index.native.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,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,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,uBAAuB,CAAC;AAC5B,SAAS,sBAAsB;CAC7B,oBAAoB;CACpB,iCAAiC;CACjC,oCAAoC;AACtC,CAAC;AACD,OAAO,UAAU,aAAa,oBAAoB;AAClD,IAAI,oCAAoC,QAAQ,4BAA4B;AAC5E,IAAI,eAAe,QAAQ,mBAAgB;AAC3C,IAAI,gBAAgB,QAAQ,oBAAU;AACtC,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI,WAAW;AACf,SAAS,SAAS;CAChB,WAAW,QAAQ,WAAW,KAAK,IAAI,SAAS,SAAS,kCAAkC,aAAa,mBAAmB,iBAAiB;CAC5I,OAAO;AACT;AACA,IAAI,eAAe,OAAO,OAAO;CAC/B,kBAAkB;EAChB,WAAW;EACX,OAAO,CAAC,CAAC,gBAAgB;CAC3B;CACA,KAAK,SAAS;EACZ,IAAI;EACJ,OAAO,CAAC,CAAC,MAAM,QAAQ,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,UAAU,QAAQ,UAAU,KAAK,IAAI,QAAQ,KAAK;CACrI;CACA,OAAO,aAAa;CACpB,eAAe,QAAQ,2BAA2B,GAAG,cAAc,uBAAsB,CAAE,OAAO,QAAQ,4BAA4B,KAAK,IAAI,KAAK,IAAI,wBAAwB,WAAW,QAAQ,SAAS,KAAK,IAAI,OAAO;AAC9N,CAAC;AACD,SAAS,4BAA4B;CACnC,IAAI,CAAC,kCAAkC,aAAa,gBAAgB,iBAAiB,GAAG,OAAO;CAC/F,OAAO,CAAC,CAAC,gBAAgB;CACzB,OAAO;AACT;AACA,SAAS,+BAA+B;CACtC,IAAI,CAAC,UAAU,OAAO,CAAC,CAAC,KAAK,KAAK;AACpC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var LaunchScreenRelease_exports = {};
|
|
22
|
+
__export(LaunchScreenRelease_exports, { LaunchScreenRelease: () => LaunchScreenRelease });
|
|
23
|
+
module.exports = __toCommonJS(LaunchScreenRelease_exports);
|
|
24
|
+
function LaunchScreenRelease() {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
+
var LaunchScreenRelease_native_exports = {};
|
|
24
|
+
__export(LaunchScreenRelease_native_exports, { LaunchScreenRelease: () => LaunchScreenRelease });
|
|
25
|
+
module.exports = __toCommonJS(LaunchScreenRelease_native_exports);
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_react_native = require("react-native");
|
|
28
|
+
var import_launchScreen = require("../platform/launchScreen/index.native.js");
|
|
29
|
+
var holds = import_react_native.Platform.OS === "ios" && (0, import_launchScreen.holdLaunchScreenForRouter)();
|
|
30
|
+
function LaunchScreenRelease() {
|
|
31
|
+
(0, import_react.useLayoutEffect)(function() {
|
|
32
|
+
if (holds) (0, import_launchScreen.releaseLaunchScreenForRouter)();
|
|
33
|
+
}, []);
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
+
var LaunchScreenRelease_native_exports = {};
|
|
24
|
+
__export(LaunchScreenRelease_native_exports, { LaunchScreenRelease: () => LaunchScreenRelease });
|
|
25
|
+
module.exports = __toCommonJS(LaunchScreenRelease_native_exports);
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_react_native = require("react-native");
|
|
28
|
+
var import_launchScreen = require("../platform/launchScreen/index.native.js");
|
|
29
|
+
var holds = import_react_native.Platform.OS === "ios" && (0, import_launchScreen.holdLaunchScreenForRouter)();
|
|
30
|
+
function LaunchScreenRelease() {
|
|
31
|
+
(0, import_react.useLayoutEffect)(function() {
|
|
32
|
+
if (holds) (0, import_launchScreen.releaseLaunchScreenForRouter)();
|
|
33
|
+
}, []);
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=LaunchScreenRelease.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LaunchScreenRelease.native.js","names":[],"sources":["cjs/router/LaunchScreenRelease.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar LaunchScreenRelease_native_exports = {};\n__export(LaunchScreenRelease_native_exports, {\n LaunchScreenRelease: () => LaunchScreenRelease\n});\nmodule.exports = __toCommonJS(LaunchScreenRelease_native_exports);\nvar import_react = require(\"react\");\nvar import_react_native = require(\"react-native\");\nvar import_launchScreen = require(\"../platform/launchScreen/index.native\");\nvar holds = import_react_native.Platform.OS === \"ios\" && (0, import_launchScreen.holdLaunchScreenForRouter)();\nfunction LaunchScreenRelease() {\n (0, import_react.useLayoutEffect)(function() {\n if (holds) (0, import_launchScreen.releaseLaunchScreenForRouter)();\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./router/FlagsContext.mjs";
|
|
|
10
10
|
import { getResolvedLinking } from "./router/linkingConfig.mjs";
|
|
11
11
|
import { handleNavigationContainerStateChange } from "./router/router.mjs";
|
|
12
12
|
import { ServerLocationContext } from "./router/serverLocationContext.mjs";
|
|
13
|
+
import { LaunchScreenRelease } from "./router/LaunchScreenRelease.mjs";
|
|
13
14
|
import { useInitializeOneRouter } from "./router/useInitializeOneRouter.mjs";
|
|
14
15
|
import { useViteRoutes } from "./router/useViteRoutes.mjs";
|
|
15
16
|
import { evictOldest } from "./utils/evictOldest.mjs";
|
|
@@ -71,7 +72,11 @@ function Root(props) {
|
|
|
71
72
|
...navigationContainerProps,
|
|
72
73
|
children: /* @__PURE__ */ jsx(ServerLocationContext.Provider, {
|
|
73
74
|
value: location,
|
|
74
|
-
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
76
|
+
/* @__PURE__ */ jsx(ScrollBehavior, {}),
|
|
77
|
+
/* @__PURE__ */ jsx(RootErrorBoundary, { children: /* @__PURE__ */ jsx(Component, {}) }),
|
|
78
|
+
/* @__PURE__ */ jsx(LaunchScreenRelease, {})
|
|
79
|
+
] })
|
|
75
80
|
})
|
|
76
81
|
})
|
|
77
82
|
}),
|
package/dist/esm/Root.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Root.js","names":["UpstreamNavigationContainer"],"sources":["esm/Root.js"],"sourcesContent":["import { DarkTheme, DefaultTheme } from \"./fork/theme\";\nimport { useUserScheme } from \"@vxrn/color-scheme\";\nimport {\n createContext,\n StrictMode,\n useContext,\n useId,\n useLayoutEffect,\n useState\n} from \"react\";\nimport { SERVER_CONTEXT_KEY, isNative } from \"./constants\";\nimport { initScreensFeatureFlags } from \"./screensFeatureFlags\";\nimport { SpaShellContext } from \"./router/SpaShellContext\";\nimport { NavigationContainer as UpstreamNavigationContainer } from \"./fork/NavigationContainer\";\nimport { getURL } from \"./getURL\";\nimport { FlagsContext } from \"./router/FlagsContext\";\nimport { getResolvedLinking } from \"./router/linkingConfig\";\nimport { handleNavigationContainerStateChange } from \"./router/router\";\nimport { ServerLocationContext } from \"./router/serverLocationContext\";\nimport { useInitializeOneRouter } from \"./router/useInitializeOneRouter\";\nimport { useViteRoutes } from \"./router/useViteRoutes\";\nimport { evictOldest } from \"./utils/evictOldest\";\nimport { ServerRenderID } from \"./useServerHeadInsertion\";\nimport { PreloadLinks } from \"./views/PreloadLinks\";\nimport { SafeAreaProvider, initialWindowMetrics } from \"./safe-area-context\";\nimport { RootErrorBoundary } from \"./views/RootErrorBoundary\";\nimport { ScrollBehavior } from \"./views/ScrollBehavior\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nconst ssrLocationCache = /* @__PURE__ */ new Map();\nfunction getCachedSSRLocation(path) {\n let url = ssrLocationCache.get(path);\n if (url) return url;\n url = new URL(path, getURL());\n evictOldest(ssrLocationCache, 5e3, 1e3);\n ssrLocationCache.set(path, url);\n return url;\n}\nconst ServerAsyncLocalIDContext = createContext(null);\nfunction Root(props) {\n globalThis[\"__vxrnGetContextFromReactContext\"] = () => useContext(ServerAsyncLocalIDContext);\n if (isNative) {\n initScreensFeatureFlags();\n }\n const {\n path,\n routes,\n routeOptions,\n isClient,\n navigationContainerProps,\n onRenderId,\n linking\n } = props;\n const context = useViteRoutes(\n routes,\n props.routerRoot,\n routeOptions,\n globalThis[\"__vxrnVersion\"]\n );\n const location = isNative ? void 0 : typeof window !== \"undefined\" && window.location ? new URL(path || window.location.href || \"/\", window.location.href) : getCachedSSRLocation(path || \"/\");\n const store = useInitializeOneRouter(context, location, linking);\n const userScheme = useUserScheme();\n const Component = store.rootComponent;\n if (!Component) {\n throw new Error(`No root component found`);\n }\n const id = useId();\n onRenderId?.(id);\n const value = process.env.VERCEL ? globalThis[\"__oneGlobalContextId\"] : globalThis[\"__vxrnrequestAsyncLocalStore\"]?.getStore() || null;\n const deferredPreloads = props.deferredPreloads;\n let contents = /* @__PURE__ */ jsx(ServerAsyncLocalIDContext.Provider, { value, children: /* @__PURE__ */ jsxs(ServerRenderID.Provider, { value: id, children: [\n typeof window === \"undefined\" && deferredPreloads?.map((src) => /* @__PURE__ */ jsx(\"link\", { rel: \"modulepreload\", fetchPriority: \"low\", href: src }, src)),\n /* @__PURE__ */ jsx(SafeAreaProvider, { initialMetrics: initialWindowMetrics, children: /* @__PURE__ */ jsx(\n UpstreamNavigationContainer,\n {\n ref: store.navigationRef,\n initialState: store.initialState,\n linking: getResolvedLinking(),\n onUnhandledAction,\n onStateChange: handleNavigationContainerStateChange,\n theme: userScheme.value === \"dark\" ? DarkTheme : DefaultTheme,\n documentTitle: {\n enabled: false\n },\n ...navigationContainerProps,\n children: /* @__PURE__ */ jsx(ServerLocationContext.Provider, { value: location, children: /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(ScrollBehavior, {}),\n /* @__PURE__ */ jsx(RootErrorBoundary, { children: /* @__PURE__ */ jsx(Component, {}) })\n ] }) })\n }\n ) }),\n typeof window !== \"undefined\" && /* @__PURE__ */ jsx(PreloadLinks, {}, \"preload-links\")\n ] }) });\n if (props.flags) {\n contents = /* @__PURE__ */ jsx(FlagsContext.Provider, { value: props.flags, children: contents });\n }\n if (!process.env.ONE_DISABLE_STRICT_MODE) {\n contents = /* @__PURE__ */ jsx(StrictMode, { children: contents });\n }\n if (isClient) {\n const serverMode = globalThis[SERVER_CONTEXT_KEY]?.mode;\n if (serverMode === \"spa\") {\n const [show, setShow] = useState(false);\n useLayoutEffect(() => {\n setShow(true);\n }, []);\n return show ? contents : null;\n }\n if (serverMode === \"spa-shell\") {\n const [isSpaShell, setIsSpaShell] = useState(true);\n useLayoutEffect(() => {\n setIsSpaShell(false);\n }, []);\n useLayoutEffect(() => {\n if (!isSpaShell) {\n const initialPath = window.location.pathname + window.location.search;\n requestAnimationFrame(() => {\n if (window.location.pathname + window.location.search !== initialPath) return;\n if (store.lastIntendedPathname !== void 0) return;\n const nav = store.navigationRef?.current;\n if (!nav) return;\n const linking2 = getResolvedLinking();\n if (linking2?.getStateFromPath) {\n const freshState = linking2.getStateFromPath(initialPath, linking2.config);\n if (freshState) {\n nav.resetRoot(freshState);\n }\n }\n });\n }\n }, [isSpaShell]);\n return /* @__PURE__ */ jsx(SpaShellContext.Provider, { value: isSpaShell, children: contents });\n }\n return contents;\n }\n if (props.mode === \"spa-shell\") {\n return /* @__PURE__ */ jsx(SpaShellContext.Provider, { value: true, children: contents });\n }\n return contents;\n}\nlet onUnhandledAction;\nif (process.env.NODE_ENV !== \"production\") {\n onUnhandledAction = (action) => {\n const payload = action.payload;\n let message = `The action '${action.type}'${payload ? ` with payload ${JSON.stringify(action.payload)}` : \"\"} was not handled by any navigator.`;\n switch (action.type) {\n case \"NAVIGATE\":\n case \"PUSH\":\n case \"REPLACE\":\n case \"JUMP_TO\":\n if (payload?.name) {\n message += `\n\nDo you have a route named '${payload.name}'?`;\n } else {\n message += `\n\nYou need to pass the name of the screen to navigate to. This may be a bug.`;\n }\n break;\n case \"GO_BACK\":\n case \"POP\":\n case \"POP_TO_TOP\":\n message += `\n\nIs there any screen to go back to?`;\n break;\n case \"OPEN_DRAWER\":\n case \"CLOSE_DRAWER\":\n case \"TOGGLE_DRAWER\":\n message += `\n\nIs your screen inside a Drawer navigator?`;\n break;\n }\n message += `\n\nThis is a development-only warning and won't be shown in production.`;\n if (process.env.NODE_ENV === \"test\") {\n throw new Error(message);\n }\n console.error(message);\n };\n} else {\n onUnhandledAction = () => {\n };\n}\nexport {\n Root\n};\n//# sourceMappingURL=Root.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,mCAAmC,IAAI,IAAI;AACjD,SAAS,qBAAqB,MAAM;CAClC,IAAI,MAAM,iBAAiB,IAAI,IAAI;CACnC,IAAI,KAAK,OAAO;CAChB,MAAM,IAAI,IAAI,MAAM,OAAO,CAAC;CAC5B,YAAY,kBAAkB,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MACF;KACF,CAAC;IACH;GACF,GAAG,CAAC,UAAU,CAAC;GACf,OAAuB,oBAAI,gBAAgB,UAAU;IAAE,OAAO;IAAY,UAAU;GAAS,CAAC;EAChG;EACA,OAAO;CACT;CACA,IAAI,MAAM,SAAS,aAAa;EAC9B,OAAuB,oBAAI,gBAAgB,UAAU;GAAE,OAAO;GAAM,UAAU;EAAS,CAAC;CAC1F;CACA,OAAO;AACT;AACA,IAAI;AACJ,IAAI,QAAQ,IAAI,aAAa,cAAc;CACzC,qBAAqB,WAAW;EAC9B,MAAM,UAAU,OAAO;EACvB,IAAI,UAAU,eAAe,OAAO,KAAK,GAAG,UAAU,iBAAiB,KAAK,UAAU,OAAO,OAAO,MAAM,GAAG;EAC7G,QAAQ,OAAO,MAAf;GACE,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;IACH,IAAI,SAAS,MAAM;KACjB,WAAW;;6BAEQ,QAAQ,KAAK;IAClC,OAAO;KACL,WAAW;;;IAGb;IACA;GACF,KAAK;GACL,KAAK;GACL,KAAK;IACH,WAAW;;;IAGX;GACF,KAAK;GACL,KAAK;GACL,KAAK;IACH,WAAW;;;IAGX;EACJ;EACA,WAAW;;;EAGX,IAAI,QAAQ,IAAI,aAAa,QAAQ;GACnC,MAAM,IAAI,MAAM,OAAO;EACzB;EACA,QAAQ,MAAM,OAAO;CACvB;AACF,OAAO;CACL,0BAA0B,CAC1B;AACF"}
|
|
1
|
+
{"version":3,"file":"Root.js","names":["UpstreamNavigationContainer"],"sources":["esm/Root.js"],"sourcesContent":["import { DarkTheme, DefaultTheme } from \"./fork/theme\";\nimport { useUserScheme } from \"@vxrn/color-scheme\";\nimport {\n createContext,\n StrictMode,\n useContext,\n useId,\n useLayoutEffect,\n useState\n} from \"react\";\nimport { SERVER_CONTEXT_KEY, isNative } from \"./constants\";\nimport { initScreensFeatureFlags } from \"./screensFeatureFlags\";\nimport { SpaShellContext } from \"./router/SpaShellContext\";\nimport { NavigationContainer as UpstreamNavigationContainer } from \"./fork/NavigationContainer\";\nimport { getURL } from \"./getURL\";\nimport { FlagsContext } from \"./router/FlagsContext\";\nimport { getResolvedLinking } from \"./router/linkingConfig\";\nimport { handleNavigationContainerStateChange } from \"./router/router\";\nimport { ServerLocationContext } from \"./router/serverLocationContext\";\nimport { LaunchScreenRelease } from \"./router/LaunchScreenRelease\";\nimport { useInitializeOneRouter } from \"./router/useInitializeOneRouter\";\nimport { useViteRoutes } from \"./router/useViteRoutes\";\nimport { evictOldest } from \"./utils/evictOldest\";\nimport { ServerRenderID } from \"./useServerHeadInsertion\";\nimport { PreloadLinks } from \"./views/PreloadLinks\";\nimport { SafeAreaProvider, initialWindowMetrics } from \"./safe-area-context\";\nimport { RootErrorBoundary } from \"./views/RootErrorBoundary\";\nimport { ScrollBehavior } from \"./views/ScrollBehavior\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nconst ssrLocationCache = /* @__PURE__ */ new Map();\nfunction getCachedSSRLocation(path) {\n let url = ssrLocationCache.get(path);\n if (url) return url;\n url = new URL(path, getURL());\n evictOldest(ssrLocationCache, 5e3, 1e3);\n ssrLocationCache.set(path, url);\n return url;\n}\nconst ServerAsyncLocalIDContext = createContext(null);\nfunction Root(props) {\n globalThis[\"__vxrnGetContextFromReactContext\"] = () => useContext(ServerAsyncLocalIDContext);\n if (isNative) {\n initScreensFeatureFlags();\n }\n const {\n path,\n routes,\n routeOptions,\n isClient,\n navigationContainerProps,\n onRenderId,\n linking\n } = props;\n const context = useViteRoutes(\n routes,\n props.routerRoot,\n routeOptions,\n globalThis[\"__vxrnVersion\"]\n );\n const location = isNative ? void 0 : typeof window !== \"undefined\" && window.location ? new URL(path || window.location.href || \"/\", window.location.href) : getCachedSSRLocation(path || \"/\");\n const store = useInitializeOneRouter(context, location, linking);\n const userScheme = useUserScheme();\n const Component = store.rootComponent;\n if (!Component) {\n throw new Error(`No root component found`);\n }\n const id = useId();\n onRenderId?.(id);\n const value = process.env.VERCEL ? globalThis[\"__oneGlobalContextId\"] : globalThis[\"__vxrnrequestAsyncLocalStore\"]?.getStore() || null;\n const deferredPreloads = props.deferredPreloads;\n let contents = /* @__PURE__ */ jsx(ServerAsyncLocalIDContext.Provider, { value, children: /* @__PURE__ */ jsxs(ServerRenderID.Provider, { value: id, children: [\n typeof window === \"undefined\" && deferredPreloads?.map((src) => /* @__PURE__ */ jsx(\"link\", { rel: \"modulepreload\", fetchPriority: \"low\", href: src }, src)),\n /* @__PURE__ */ jsx(SafeAreaProvider, { initialMetrics: initialWindowMetrics, children: /* @__PURE__ */ jsx(\n UpstreamNavigationContainer,\n {\n ref: store.navigationRef,\n initialState: store.initialState,\n linking: getResolvedLinking(),\n onUnhandledAction,\n onStateChange: handleNavigationContainerStateChange,\n theme: userScheme.value === \"dark\" ? DarkTheme : DefaultTheme,\n documentTitle: {\n enabled: false\n },\n ...navigationContainerProps,\n children: /* @__PURE__ */ jsx(ServerLocationContext.Provider, { value: location, children: /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(ScrollBehavior, {}),\n /* @__PURE__ */ jsx(RootErrorBoundary, { children: /* @__PURE__ */ jsx(Component, {}) }),\n /* @__PURE__ */ jsx(LaunchScreenRelease, {})\n ] }) })\n }\n ) }),\n typeof window !== \"undefined\" && /* @__PURE__ */ jsx(PreloadLinks, {}, \"preload-links\")\n ] }) });\n if (props.flags) {\n contents = /* @__PURE__ */ jsx(FlagsContext.Provider, { value: props.flags, children: contents });\n }\n if (!process.env.ONE_DISABLE_STRICT_MODE) {\n contents = /* @__PURE__ */ jsx(StrictMode, { children: contents });\n }\n if (isClient) {\n const serverMode = globalThis[SERVER_CONTEXT_KEY]?.mode;\n if (serverMode === \"spa\") {\n const [show, setShow] = useState(false);\n useLayoutEffect(() => {\n setShow(true);\n }, []);\n return show ? contents : null;\n }\n if (serverMode === \"spa-shell\") {\n const [isSpaShell, setIsSpaShell] = useState(true);\n useLayoutEffect(() => {\n setIsSpaShell(false);\n }, []);\n useLayoutEffect(() => {\n if (!isSpaShell) {\n const initialPath = window.location.pathname + window.location.search;\n requestAnimationFrame(() => {\n if (window.location.pathname + window.location.search !== initialPath) return;\n if (store.lastIntendedPathname !== void 0) return;\n const nav = store.navigationRef?.current;\n if (!nav) return;\n const linking2 = getResolvedLinking();\n if (linking2?.getStateFromPath) {\n const freshState = linking2.getStateFromPath(initialPath, linking2.config);\n if (freshState) {\n nav.resetRoot(freshState);\n }\n }\n });\n }\n }, [isSpaShell]);\n return /* @__PURE__ */ jsx(SpaShellContext.Provider, { value: isSpaShell, children: contents });\n }\n return contents;\n }\n if (props.mode === \"spa-shell\") {\n return /* @__PURE__ */ jsx(SpaShellContext.Provider, { value: true, children: contents });\n }\n return contents;\n}\nlet onUnhandledAction;\nif (process.env.NODE_ENV !== \"production\") {\n onUnhandledAction = (action) => {\n const payload = action.payload;\n let message = `The action '${action.type}'${payload ? ` with payload ${JSON.stringify(action.payload)}` : \"\"} was not handled by any navigator.`;\n switch (action.type) {\n case \"NAVIGATE\":\n case \"PUSH\":\n case \"REPLACE\":\n case \"JUMP_TO\":\n if (payload?.name) {\n message += `\n\nDo you have a route named '${payload.name}'?`;\n } else {\n message += `\n\nYou need to pass the name of the screen to navigate to. This may be a bug.`;\n }\n break;\n case \"GO_BACK\":\n case \"POP\":\n case \"POP_TO_TOP\":\n message += `\n\nIs there any screen to go back to?`;\n break;\n case \"OPEN_DRAWER\":\n case \"CLOSE_DRAWER\":\n case \"TOGGLE_DRAWER\":\n message += `\n\nIs your screen inside a Drawer navigator?`;\n break;\n }\n message += `\n\nThis is a development-only warning and won't be shown in production.`;\n if (process.env.NODE_ENV === \"test\") {\n throw new Error(message);\n }\n console.error(message);\n };\n} else {\n onUnhandledAction = () => {\n };\n}\nexport {\n Root\n};\n//# sourceMappingURL=Root.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,mCAAmC,IAAI,IAAI;AACjD,SAAS,qBAAqB,MAAM;CAClC,IAAI,MAAM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AM,WAAW,mBAAmB;MACpC,IAAI,UAAU,kBAAkB;OAC9B,MAAM,aAAa,SAAS,iBAAiB,aAAa,SAAS,MAAM;OACzE,IAAI,YAAY;QACd,IAAI,UAAU,UAAU;OAC1B;MACF;KACF,CAAC;IACH;GACF,GAAG,CAAC,UAAU,CAAC;GACf,OAAuB,oBAAI,gBAAgB,UAAU;IAAE,OAAO;IAAY,UAAU;GAAS,CAAC;EAChG;EACA,OAAO;CACT;CACA,IAAI,MAAM,SAAS,aAAa;EAC9B,OAAuB,oBAAI,gBAAgB,UAAU;GAAE,OAAO;GAAM,UAAU;EAAS,CAAC;CAC1F;CACA,OAAO;AACT;AACA,IAAI;AACJ,IAAI,QAAQ,IAAI,aAAa,cAAc;CACzC,qBAAqB,WAAW;EAC9B,MAAM,UAAU,OAAO;EACvB,IAAI,UAAU,eAAe,OAAO,KAAK,GAAG,UAAU,iBAAiB,KAAK,UAAU,OAAO,OAAO,MAAM,GAAG;EAC7G,QAAQ,OAAO,MAAf;GACE,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;IACH,IAAI,SAAS,MAAM;KACjB,WAAW;;6BAEQ,QAAQ,KAAK;IAClC,OAAO;KACL,WAAW;;;IAGb;IACA;GACF,KAAK;GACL,KAAK;GACL,KAAK;IACH,WAAW;;;IAGX;GACF,KAAK;GACL,KAAK;GACL,KAAK;IACH,WAAW;;;IAGX;EACJ;EACA,WAAW;;;EAGX,IAAI,QAAQ,IAAI,aAAa,QAAQ;GACnC,MAAM,IAAI,MAAM,OAAO;EACzB;EACA,QAAQ,MAAM,OAAO;CACvB;AACF,OAAO;CACL,0BAA0B,CAC1B;AACF"}
|
package/dist/esm/Root.native.js
CHANGED
|
@@ -11,6 +11,7 @@ import { FlagsContext } from "./router/FlagsContext.native.js";
|
|
|
11
11
|
import { getResolvedLinking } from "./router/linkingConfig.native.js";
|
|
12
12
|
import { handleNavigationContainerStateChange } from "./router/router.native.js";
|
|
13
13
|
import { ServerLocationContext } from "./router/serverLocationContext.native.js";
|
|
14
|
+
import { LaunchScreenRelease } from "./router/LaunchScreenRelease.native.js";
|
|
14
15
|
import { useInitializeOneRouter } from "./router/useInitializeOneRouter.native.js";
|
|
15
16
|
import { useViteRoutes } from "./router/useViteRoutes.native.js";
|
|
16
17
|
import { evictOldest } from "./utils/evictOldest.native.js";
|
|
@@ -76,7 +77,11 @@ function Root(props) {
|
|
|
76
77
|
...navigationContainerProps,
|
|
77
78
|
children: /* @__PURE__ */ jsx(ServerLocationContext.Provider, {
|
|
78
79
|
value: location,
|
|
79
|
-
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
80
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
81
|
+
/* @__PURE__ */ jsx(ScrollBehavior, {}),
|
|
82
|
+
/* @__PURE__ */ jsx(RootErrorBoundary, { children: /* @__PURE__ */ jsx(Component, {}) }),
|
|
83
|
+
/* @__PURE__ */ jsx(LaunchScreenRelease, {})
|
|
84
|
+
] })
|
|
80
85
|
})
|
|
81
86
|
})
|
|
82
87
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Root.native.js","names":["UpstreamNavigationContainer","_Fragment"],"sources":["esm/Root.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { DarkTheme, DefaultTheme } from \"./fork/theme\";\nimport { useUserScheme } from \"@vxrn/color-scheme\";\nimport { createContext, StrictMode, useContext, useId, useLayoutEffect, useState } from \"react\";\nimport { SERVER_CONTEXT_KEY, isNative } from \"./constants\";\nimport { initScreensFeatureFlags } from \"./screensFeatureFlags\";\nimport { SpaShellContext } from \"./router/SpaShellContext\";\nimport { NavigationContainer as UpstreamNavigationContainer } from \"./fork/NavigationContainer\";\nimport { getURL } from \"./getURL\";\nimport { FlagsContext } from \"./router/FlagsContext\";\nimport { getResolvedLinking } from \"./router/linkingConfig\";\nimport { handleNavigationContainerStateChange } from \"./router/router\";\nimport { ServerLocationContext } from \"./router/serverLocationContext\";\nimport { useInitializeOneRouter } from \"./router/useInitializeOneRouter\";\nimport { useViteRoutes } from \"./router/useViteRoutes\";\nimport { evictOldest } from \"./utils/evictOldest\";\nimport { ServerRenderID } from \"./useServerHeadInsertion\";\nimport { PreloadLinks } from \"./views/PreloadLinks\";\nimport { SafeAreaProvider, initialWindowMetrics } from \"./safe-area-context\";\nimport { RootErrorBoundary } from \"./views/RootErrorBoundary\";\nimport { ScrollBehavior } from \"./views/ScrollBehavior\";\nvar ssrLocationCache = /* @__PURE__ */ new Map();\nfunction getCachedSSRLocation(path) {\n var url = ssrLocationCache.get(path);\n if (url) return url;\n url = new URL(path, getURL());\n evictOldest(ssrLocationCache, 5e3, 1e3);\n ssrLocationCache.set(path, url);\n return url;\n}\nvar ServerAsyncLocalIDContext = /* @__PURE__ */ createContext(null);\nfunction Root(props) {\n var _globalThis___vxrnrequestAsyncLocalStore;\n globalThis[\"__vxrnGetContextFromReactContext\"] = function() {\n return useContext(ServerAsyncLocalIDContext);\n };\n if (isNative) {\n initScreensFeatureFlags();\n }\n var { path, routes, routeOptions, isClient, navigationContainerProps, onRenderId, linking } = props;\n var context = useViteRoutes(routes, props.routerRoot, routeOptions, globalThis[\"__vxrnVersion\"]);\n var location = isNative ? void 0 : typeof window !== \"undefined\" && window.location ? new URL(path || window.location.href || \"/\", window.location.href) : getCachedSSRLocation(path || \"/\");\n var store = useInitializeOneRouter(context, location, linking);\n var userScheme = useUserScheme();\n var Component = store.rootComponent;\n if (!Component) {\n throw new Error(`No root component found`);\n }\n var id = useId();\n onRenderId === null || onRenderId === void 0 ? void 0 : onRenderId(id);\n var value = process.env.VERCEL ? globalThis[\"__oneGlobalContextId\"] : ((_globalThis___vxrnrequestAsyncLocalStore = globalThis[\"__vxrnrequestAsyncLocalStore\"]) === null || _globalThis___vxrnrequestAsyncLocalStore === void 0 ? void 0 : _globalThis___vxrnrequestAsyncLocalStore.getStore()) || null;\n var deferredPreloads = props.deferredPreloads;\n var contents = /* @__PURE__ */ _jsx(ServerAsyncLocalIDContext.Provider, {\n value,\n children: /* @__PURE__ */ _jsxs(ServerRenderID.Provider, {\n value: id,\n children: [\n typeof window === \"undefined\" && (deferredPreloads === null || deferredPreloads === void 0 ? void 0 : deferredPreloads.map(function(src) {\n return /* @__PURE__ */ _jsx(\"link\", {\n rel: \"modulepreload\",\n fetchPriority: \"low\",\n href: src\n }, src);\n })),\n /* one owns the safe area provider on every platform: apps read it\n through One.UI.SafeArea and never mount their own */\n /* @__PURE__ */ _jsx(SafeAreaProvider, {\n initialMetrics: initialWindowMetrics,\n children: /* @__PURE__ */ _jsx(UpstreamNavigationContainer, {\n ref: store.navigationRef,\n initialState: store.initialState,\n linking: getResolvedLinking(),\n onUnhandledAction,\n onStateChange: handleNavigationContainerStateChange,\n theme: userScheme.value === \"dark\" ? DarkTheme : DefaultTheme,\n documentTitle: {\n enabled: false\n },\n ...navigationContainerProps,\n children: /* @__PURE__ */ _jsx(ServerLocationContext.Provider, {\n value: location,\n children: /* @__PURE__ */ _jsxs(_Fragment, {\n children: [\n /* @__PURE__ */ _jsx(ScrollBehavior, {}),\n /* @__PURE__ */ _jsx(RootErrorBoundary, {\n children: /* @__PURE__ */ _jsx(Component, {})\n })\n ]\n })\n })\n })\n }),\n typeof window !== \"undefined\" && /* @__PURE__ */ _jsx(PreloadLinks, {}, \"preload-links\")\n ]\n })\n });\n if (props.flags) {\n contents = /* @__PURE__ */ _jsx(FlagsContext.Provider, {\n value: props.flags,\n children: contents\n });\n }\n if (!process.env.ONE_DISABLE_STRICT_MODE) {\n contents = /* @__PURE__ */ _jsx(StrictMode, {\n children: contents\n });\n }\n if (isClient) {\n var _globalThis_SERVER_CONTEXT_KEY;\n var serverMode = (_globalThis_SERVER_CONTEXT_KEY = globalThis[SERVER_CONTEXT_KEY]) === null || _globalThis_SERVER_CONTEXT_KEY === void 0 ? void 0 : _globalThis_SERVER_CONTEXT_KEY.mode;\n if (serverMode === \"spa\") {\n var [show, setShow] = useState(false);\n useLayoutEffect(function() {\n setShow(true);\n }, []);\n return show ? contents : null;\n }\n if (serverMode === \"spa-shell\") {\n var [isSpaShell, setIsSpaShell] = useState(true);\n useLayoutEffect(function() {\n setIsSpaShell(false);\n }, []);\n useLayoutEffect(function() {\n if (!isSpaShell) {\n var initialPath = window.location.pathname + window.location.search;\n requestAnimationFrame(function() {\n var _store_navigationRef;\n if (window.location.pathname + window.location.search !== initialPath) return;\n if (store.lastIntendedPathname !== void 0) return;\n var nav = (_store_navigationRef = store.navigationRef) === null || _store_navigationRef === void 0 ? void 0 : _store_navigationRef.current;\n if (!nav) return;\n var linking2 = getResolvedLinking();\n if (linking2 === null || linking2 === void 0 ? void 0 : linking2.getStateFromPath) {\n var freshState = linking2.getStateFromPath(initialPath, linking2.config);\n if (freshState) {\n nav.resetRoot(freshState);\n }\n }\n });\n }\n }, [\n isSpaShell\n ]);\n return /* @__PURE__ */ _jsx(SpaShellContext.Provider, {\n value: isSpaShell,\n children: contents\n });\n }\n return contents;\n }\n if (props.mode === \"spa-shell\") {\n return /* @__PURE__ */ _jsx(SpaShellContext.Provider, {\n value: true,\n children: contents\n });\n }\n return contents;\n}\nvar onUnhandledAction;\nif (process.env.NODE_ENV !== \"production\") {\n onUnhandledAction = function onUnhandledAction2(action) {\n var payload = action.payload;\n var message = `The action '${action.type}'${payload ? ` with payload ${JSON.stringify(action.payload)}` : \"\"} was not handled by any navigator.`;\n switch (action.type) {\n case \"NAVIGATE\":\n case \"PUSH\":\n case \"REPLACE\":\n case \"JUMP_TO\":\n if (payload === null || payload === void 0 ? void 0 : payload.name) {\n message += `\n\nDo you have a route named '${payload.name}'?`;\n } else {\n message += `\n\nYou need to pass the name of the screen to navigate to. This may be a bug.`;\n }\n break;\n case \"GO_BACK\":\n case \"POP\":\n case \"POP_TO_TOP\":\n message += `\n\nIs there any screen to go back to?`;\n break;\n case \"OPEN_DRAWER\":\n case \"CLOSE_DRAWER\":\n case \"TOGGLE_DRAWER\":\n message += `\n\nIs your screen inside a Drawer navigator?`;\n break;\n }\n message += `\n\nThis is a development-only warning and won't be shown in production.`;\n if (process.env.NODE_ENV === \"test\") {\n throw new Error(message);\n }\n console.error(message);\n };\n} else {\n onUnhandledAction = function onUnhandledAction2() {\n };\n}\nexport {\n Root\n};\n//# sourceMappingURL=Root.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAI,mCAAmC,IAAI,IAAI;AAC/C,SAAS,qBAAqB,MAAM;CAClC,IAAI,MAAM,iBAAiB,IAAI,IAAI;CACnC,IAAI,KAAK,OAAO;CAChB,MAAM,IAAI,IAAI,MAAM,OAAO,CAAC;CAC5B,YAAY,kBAAkB,KAAK,GAAG;CACtC,iBAAiB,IAAI,MAAM,GAAG;CAC9B,OAAO;AACT;AACA,IAAI,4BAA4C,8BAAc,IAAI;AAClE,SAAS,KAAK,OAAO;CACnB,IAAI;CACJ,WAAW,sCAAsC,WAAW;EAC1D,OAAO,WAAW,yBAAyB;CAC7C;CACA,IAAI,UAAU;EACZ,wBAAwB;CAC1B;CACA,IAAI,EAAE,MAAM,QAAQ,cAAc,UAAU,0BAA0B,YAAY,YAAY;CAC9F,IAAI,UAAU,cAAc,QAAQ,MAAM,YAAY,cAAc,WAAW,gBAAgB;CAC/F,IAAI,WAAW,WAAW,KAAK,IAAI,OAAO,WAAW,eAAe,OAAO,WAAW,IAAI,IAAI,QAAQ,OAAO,SAAS,QAAQ,KAAK,OAAO,SAAS,IAAI,IAAI,qBAAqB,QAAQ,GAAG;CAC3L,IAAI,QAAQ,uBAAuB,SAAS,UAAU,OAAO;CAC7D,IAAI,aAAa,cAAc;CAC/B,IAAI,YAAY,MAAM;CACtB,IAAI,CAAC,WAAW;EACd,MAAM,IAAI,MAAM,yBAAyB;CAC3C;CACA,IAAI,KAAK,MAAM;CACf,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW,EAAE;CACrE,IAAI,QAAQ,QAAQ,IAAI,SA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AAU,eAAe,OAAO,KAAK,GAAG,UAAU,iBAAiB,KAAK,UAAU,OAAO,OAAO,MAAM,GAAG;EAC7G,QAAQ,OAAO,MAAf;GACE,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;IACH,IAAI,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,MAAM;KAClE,WAAW;;6BAEQ,QAAQ,KAAK;IAClC,OAAO;KACL,WAAW;;;IAGb;IACA;GACF,KAAK;GACL,KAAK;GACL,KAAK;IACH,WAAW;;;IAGX;GACF,KAAK;GACL,KAAK;GACL,KAAK;IACH,WAAW;;;IAGX;EACJ;EACA,WAAW;;;EAGX,IAAI,QAAQ,IAAI,aAAa,QAAQ;GACnC,MAAM,IAAI,MAAM,OAAO;EACzB;EACA,QAAQ,MAAM,OAAO;CACvB;AACF,OAAO;CACL,oBAAoB,SAAS,qBAAqB,CAClD;AACF"}
|
|
1
|
+
{"version":3,"file":"Root.native.js","names":["UpstreamNavigationContainer","_Fragment"],"sources":["esm/Root.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { DarkTheme, DefaultTheme } from \"./fork/theme\";\nimport { useUserScheme } from \"@vxrn/color-scheme\";\nimport { createContext, StrictMode, useContext, useId, useLayoutEffect, useState } from \"react\";\nimport { SERVER_CONTEXT_KEY, isNative } from \"./constants\";\nimport { initScreensFeatureFlags } from \"./screensFeatureFlags\";\nimport { SpaShellContext } from \"./router/SpaShellContext\";\nimport { NavigationContainer as UpstreamNavigationContainer } from \"./fork/NavigationContainer\";\nimport { getURL } from \"./getURL\";\nimport { FlagsContext } from \"./router/FlagsContext\";\nimport { getResolvedLinking } from \"./router/linkingConfig\";\nimport { handleNavigationContainerStateChange } from \"./router/router\";\nimport { ServerLocationContext } from \"./router/serverLocationContext\";\nimport { LaunchScreenRelease } from \"./router/LaunchScreenRelease\";\nimport { useInitializeOneRouter } from \"./router/useInitializeOneRouter\";\nimport { useViteRoutes } from \"./router/useViteRoutes\";\nimport { evictOldest } from \"./utils/evictOldest\";\nimport { ServerRenderID } from \"./useServerHeadInsertion\";\nimport { PreloadLinks } from \"./views/PreloadLinks\";\nimport { SafeAreaProvider, initialWindowMetrics } from \"./safe-area-context\";\nimport { RootErrorBoundary } from \"./views/RootErrorBoundary\";\nimport { ScrollBehavior } from \"./views/ScrollBehavior\";\nvar ssrLocationCache = /* @__PURE__ */ new Map();\nfunction getCachedSSRLocation(path) {\n var url = ssrLocationCache.get(path);\n if (url) return url;\n url = new URL(path, getURL());\n evictOldest(ssrLocationCache, 5e3, 1e3);\n ssrLocationCache.set(path, url);\n return url;\n}\nvar ServerAsyncLocalIDContext = /* @__PURE__ */ createContext(null);\nfunction Root(props) {\n var _globalThis___vxrnrequestAsyncLocalStore;\n globalThis[\"__vxrnGetContextFromReactContext\"] = function() {\n return useContext(ServerAsyncLocalIDContext);\n };\n if (isNative) {\n initScreensFeatureFlags();\n }\n var { path, routes, routeOptions, isClient, navigationContainerProps, onRenderId, linking } = props;\n var context = useViteRoutes(routes, props.routerRoot, routeOptions, globalThis[\"__vxrnVersion\"]);\n var location = isNative ? void 0 : typeof window !== \"undefined\" && window.location ? new URL(path || window.location.href || \"/\", window.location.href) : getCachedSSRLocation(path || \"/\");\n var store = useInitializeOneRouter(context, location, linking);\n var userScheme = useUserScheme();\n var Component = store.rootComponent;\n if (!Component) {\n throw new Error(`No root component found`);\n }\n var id = useId();\n onRenderId === null || onRenderId === void 0 ? void 0 : onRenderId(id);\n var value = process.env.VERCEL ? globalThis[\"__oneGlobalContextId\"] : ((_globalThis___vxrnrequestAsyncLocalStore = globalThis[\"__vxrnrequestAsyncLocalStore\"]) === null || _globalThis___vxrnrequestAsyncLocalStore === void 0 ? void 0 : _globalThis___vxrnrequestAsyncLocalStore.getStore()) || null;\n var deferredPreloads = props.deferredPreloads;\n var contents = /* @__PURE__ */ _jsx(ServerAsyncLocalIDContext.Provider, {\n value,\n children: /* @__PURE__ */ _jsxs(ServerRenderID.Provider, {\n value: id,\n children: [\n typeof window === \"undefined\" && (deferredPreloads === null || deferredPreloads === void 0 ? void 0 : deferredPreloads.map(function(src) {\n return /* @__PURE__ */ _jsx(\"link\", {\n rel: \"modulepreload\",\n fetchPriority: \"low\",\n href: src\n }, src);\n })),\n /* one owns the safe area provider on every platform: apps read it\n through One.UI.SafeArea and never mount their own */\n /* @__PURE__ */ _jsx(SafeAreaProvider, {\n initialMetrics: initialWindowMetrics,\n children: /* @__PURE__ */ _jsx(UpstreamNavigationContainer, {\n ref: store.navigationRef,\n initialState: store.initialState,\n linking: getResolvedLinking(),\n onUnhandledAction,\n onStateChange: handleNavigationContainerStateChange,\n theme: userScheme.value === \"dark\" ? DarkTheme : DefaultTheme,\n documentTitle: {\n enabled: false\n },\n ...navigationContainerProps,\n children: /* @__PURE__ */ _jsx(ServerLocationContext.Provider, {\n value: location,\n children: /* @__PURE__ */ _jsxs(_Fragment, {\n children: [\n /* @__PURE__ */ _jsx(ScrollBehavior, {}),\n /* @__PURE__ */ _jsx(RootErrorBoundary, {\n children: /* @__PURE__ */ _jsx(Component, {})\n }),\n /* @__PURE__ */ _jsx(LaunchScreenRelease, {})\n ]\n })\n })\n })\n }),\n typeof window !== \"undefined\" && /* @__PURE__ */ _jsx(PreloadLinks, {}, \"preload-links\")\n ]\n })\n });\n if (props.flags) {\n contents = /* @__PURE__ */ _jsx(FlagsContext.Provider, {\n value: props.flags,\n children: contents\n });\n }\n if (!process.env.ONE_DISABLE_STRICT_MODE) {\n contents = /* @__PURE__ */ _jsx(StrictMode, {\n children: contents\n });\n }\n if (isClient) {\n var _globalThis_SERVER_CONTEXT_KEY;\n var serverMode = (_globalThis_SERVER_CONTEXT_KEY = globalThis[SERVER_CONTEXT_KEY]) === null || _globalThis_SERVER_CONTEXT_KEY === void 0 ? void 0 : _globalThis_SERVER_CONTEXT_KEY.mode;\n if (serverMode === \"spa\") {\n var [show, setShow] = useState(false);\n useLayoutEffect(function() {\n setShow(true);\n }, []);\n return show ? contents : null;\n }\n if (serverMode === \"spa-shell\") {\n var [isSpaShell, setIsSpaShell] = useState(true);\n useLayoutEffect(function() {\n setIsSpaShell(false);\n }, []);\n useLayoutEffect(function() {\n if (!isSpaShell) {\n var initialPath = window.location.pathname + window.location.search;\n requestAnimationFrame(function() {\n var _store_navigationRef;\n if (window.location.pathname + window.location.search !== initialPath) return;\n if (store.lastIntendedPathname !== void 0) return;\n var nav = (_store_navigationRef = store.navigationRef) === null || _store_navigationRef === void 0 ? void 0 : _store_navigationRef.current;\n if (!nav) return;\n var linking2 = getResolvedLinking();\n if (linking2 === null || linking2 === void 0 ? void 0 : linking2.getStateFromPath) {\n var freshState = linking2.getStateFromPath(initialPath, linking2.config);\n if (freshState) {\n nav.resetRoot(freshState);\n }\n }\n });\n }\n }, [\n isSpaShell\n ]);\n return /* @__PURE__ */ _jsx(SpaShellContext.Provider, {\n value: isSpaShell,\n children: contents\n });\n }\n return contents;\n }\n if (props.mode === \"spa-shell\") {\n return /* @__PURE__ */ _jsx(SpaShellContext.Provider, {\n value: true,\n children: contents\n });\n }\n return contents;\n}\nvar onUnhandledAction;\nif (process.env.NODE_ENV !== \"production\") {\n onUnhandledAction = function onUnhandledAction2(action) {\n var payload = action.payload;\n var message = `The action '${action.type}'${payload ? ` with payload ${JSON.stringify(action.payload)}` : \"\"} was not handled by any navigator.`;\n switch (action.type) {\n case \"NAVIGATE\":\n case \"PUSH\":\n case \"REPLACE\":\n case \"JUMP_TO\":\n if (payload === null || payload === void 0 ? void 0 : payload.name) {\n message += `\n\nDo you have a route named '${payload.name}'?`;\n } else {\n message += `\n\nYou need to pass the name of the screen to navigate to. This may be a bug.`;\n }\n break;\n case \"GO_BACK\":\n case \"POP\":\n case \"POP_TO_TOP\":\n message += `\n\nIs there any screen to go back to?`;\n break;\n case \"OPEN_DRAWER\":\n case \"CLOSE_DRAWER\":\n case \"TOGGLE_DRAWER\":\n message += `\n\nIs your screen inside a Drawer navigator?`;\n break;\n }\n message += `\n\nThis is a development-only warning and won't be shown in production.`;\n if (process.env.NODE_ENV === \"test\") {\n throw new Error(message);\n }\n console.error(message);\n };\n} else {\n onUnhandledAction = function onUnhandledAction2() {\n };\n}\nexport {\n Root\n};\n//# sourceMappingURL=Root.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAI,mCAAmC,IAAI,IAAI;AAC/C,SAAS,qBAAqB,MAAM;CAClC,IAAI,MAAM,iBAAiB,IAAI,IAAI;CACnC,IAAI,KAAK,OAAO;CAChB,MAAM,IAAI,IAAI,MAAM,OAAO,CAAC;CAC5B,YAAY,kBAAkB,KAAK,GAAG;CACtC,iBAAiB,IAAI,MAAM,GAAG;CAC9B,OAAO;AACT;AACA,IAAI,4BAA4C,8BAAc,IAAI;AAClE,SAAS,KAAK,OAAO;CACnB,IAAI;CACJ,WAAW,sCAAsC,WAAW;EAC1D,OAAO,WAAW,yBAAyB;CAC7C;CACA,IAAI,UAAU;EACZ,wBAAwB;CAC1B;CACA,IAAI,EAAE,MAAM,QAAQ,cAAc,UAAU,0BAA0B,YAAY,YAAY;CAC9F,IAAI,UAAU,cAAc,QAAQ,MAAM,YAAY,cAAc,WAAW,gBAAgB;CAC/F,IAAI,WAAW,WAAW,KAAK,IAAI,OAAO,WAAW,eAAe,OAAO,WAAW,IAAI,IAAI,QAAQ,OAAO,SAAS,QAAQ,KAAK,OAAO,SAAS,IAAI,IAAI,qBAAqB,QAAQ,GAAG;CAC3L,IAAI,QAAQ,uBAAuB,SAAS,UAAU,OAAO;CAC7D,IAAI,aAAa,cAAc;CAC/B,IAAI,YAAY,MAAM;CACtB,IAAI,CAAC,WAAW;EACd,MAAM,IAAI,MAAM,yBAAyB;CAC3C;CACA,IAAI,KAAK,MAAM;CACf,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW,EAAE;CACrE,IAAI,QAAQ,QAAQ,IAAI,SAAS,WAAW,4BAA4B,2CAA2C,WAAW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I,UAAU,eAAe,OAAO,KAAK,GAAG,UAAU,iBAAiB,KAAK,UAAU,OAAO,OAAO,MAAM,GAAG;EAC7G,QAAQ,OAAO,MAAf;GACE,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;IACH,IAAI,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,MAAM;KAClE,WAAW;;6BAEQ,QAAQ,KAAK;IAClC,OAAO;KACL,WAAW;;;IAGb;IACA;GACF,KAAK;GACL,KAAK;GACL,KAAK;IACH,WAAW;;;IAGX;GACF,KAAK;GACL,KAAK;GACL,KAAK;IACH,WAAW;;;IAGX;EACJ;EACA,WAAW;;;EAGX,IAAI,QAAQ,IAAI,aAAa,QAAQ;GACnC,MAAM,IAAI,MAAM,OAAO;EACzB;EACA,QAAQ,MAAM,OAAO;CACvB;AACF,OAAO;CACL,oBAAoB,SAAS,qBAAqB,CAClD;AACF"}
|
|
@@ -5,12 +5,14 @@ import { readLaunchScreenConfig } from "./config.native.js";
|
|
|
5
5
|
var _ref;
|
|
6
6
|
var _readLaunchScreenConfig;
|
|
7
7
|
var hybrid;
|
|
8
|
+
var appHolds = false;
|
|
8
9
|
function native() {
|
|
9
10
|
hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = NitroModules.createHybridObject("OneLaunchScreen");
|
|
10
11
|
return hybrid;
|
|
11
12
|
}
|
|
12
13
|
var LaunchScreen = Object.freeze({
|
|
13
14
|
preventAutoHide() {
|
|
15
|
+
appHolds = true;
|
|
14
16
|
native().preventAutoHide();
|
|
15
17
|
},
|
|
16
18
|
hide(options) {
|
|
@@ -20,6 +22,14 @@ var LaunchScreen = Object.freeze({
|
|
|
20
22
|
Cover,
|
|
21
23
|
artworkWidth: (_ref = (_readLaunchScreenConfig = readLaunchScreenConfig()) === null || _readLaunchScreenConfig === void 0 ? void 0 : _readLaunchScreenConfig.width) !== null && _ref !== void 0 ? _ref : null
|
|
22
24
|
});
|
|
25
|
+
function holdLaunchScreenForRouter() {
|
|
26
|
+
if (!NitroModules.hasHybridObject("OneLaunchScreen")) return false;
|
|
27
|
+
native().preventAutoHide();
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
function releaseLaunchScreenForRouter() {
|
|
31
|
+
if (!appHolds) native().hide(false);
|
|
32
|
+
}
|
|
23
33
|
|
|
24
|
-
export { LaunchScreen };
|
|
34
|
+
export { LaunchScreen, holdLaunchScreenForRouter, releaseLaunchScreenForRouter };
|
|
25
35
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["esm/platform/launchScreen/index.native.js"],"sourcesContent":["import { NitroModules } from \"react-native-nitro-modules\";\nimport { Cover } from \"./Cover.native\";\nimport { readLaunchScreenConfig } from \"./config\";\nvar _ref;\nvar _readLaunchScreenConfig;\nvar hybrid;\nfunction native() {\n hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = NitroModules.createHybridObject(\"OneLaunchScreen\");\n return hybrid;\n}\nvar LaunchScreen = Object.freeze({\n preventAutoHide() {\n native().preventAutoHide();\n },\n hide(options) {\n var _ref2;\n native().hide((_ref2 = options === null || options === void 0 ? void 0 : options.fade) !== null && _ref2 !== void 0 ? _ref2 : false);\n },\n Cover,\n artworkWidth: (_ref = (_readLaunchScreenConfig = readLaunchScreenConfig()) === null || _readLaunchScreenConfig === void 0 ? void 0 : _readLaunchScreenConfig.width) !== null && _ref !== void 0 ? _ref : null\n});\nexport {\n LaunchScreen\n};\n//# sourceMappingURL=index.native.js.map\n"],"mappings":";;;;;AAGA,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,SAAS,SAAS;CAChB,WAAW,QAAQ,WAAW,KAAK,IAAI,SAAS,SAAS,aAAa,mBAAmB,iBAAiB;CAC1G,OAAO;AACT;AACA,IAAI,eAAe,OAAO,OAAO;CAC/B,kBAAkB;EAChB,OAAO,CAAC,CAAC,gBAAgB;CAC3B;CACA,KAAK,SAAS;EACZ,IAAI;EACJ,OAAO,CAAC,CAAC,MAAM,QAAQ,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,UAAU,QAAQ,UAAU,KAAK,IAAI,QAAQ,KAAK;CACrI;CACA;CACA,eAAe,QAAQ,0BAA0B,uBAAuB,OAAO,QAAQ,4BAA4B,KAAK,IAAI,KAAK,IAAI,wBAAwB,WAAW,QAAQ,SAAS,KAAK,IAAI,OAAO;AAC3M,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["esm/platform/launchScreen/index.native.js"],"sourcesContent":["import { NitroModules } from \"react-native-nitro-modules\";\nimport { Cover } from \"./Cover.native\";\nimport { readLaunchScreenConfig } from \"./config\";\nvar _ref;\nvar _readLaunchScreenConfig;\nvar hybrid;\nvar appHolds = false;\nfunction native() {\n hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = NitroModules.createHybridObject(\"OneLaunchScreen\");\n return hybrid;\n}\nvar LaunchScreen = Object.freeze({\n preventAutoHide() {\n appHolds = true;\n native().preventAutoHide();\n },\n hide(options) {\n var _ref2;\n native().hide((_ref2 = options === null || options === void 0 ? void 0 : options.fade) !== null && _ref2 !== void 0 ? _ref2 : false);\n },\n Cover,\n artworkWidth: (_ref = (_readLaunchScreenConfig = readLaunchScreenConfig()) === null || _readLaunchScreenConfig === void 0 ? void 0 : _readLaunchScreenConfig.width) !== null && _ref !== void 0 ? _ref : null\n});\nfunction holdLaunchScreenForRouter() {\n if (!NitroModules.hasHybridObject(\"OneLaunchScreen\")) return false;\n native().preventAutoHide();\n return true;\n}\nfunction releaseLaunchScreenForRouter() {\n if (!appHolds) native().hide(false);\n}\nexport {\n LaunchScreen,\n holdLaunchScreenForRouter,\n releaseLaunchScreenForRouter\n};\n//# sourceMappingURL=index.native.js.map\n"],"mappings":";;;;;AAGA,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI,WAAW;AACf,SAAS,SAAS;CAChB,WAAW,QAAQ,WAAW,KAAK,IAAI,SAAS,SAAS,aAAa,mBAAmB,iBAAiB;CAC1G,OAAO;AACT;AACA,IAAI,eAAe,OAAO,OAAO;CAC/B,kBAAkB;EAChB,WAAW;EACX,OAAO,CAAC,CAAC,gBAAgB;CAC3B;CACA,KAAK,SAAS;EACZ,IAAI;EACJ,OAAO,CAAC,CAAC,MAAM,QAAQ,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,UAAU,QAAQ,UAAU,KAAK,IAAI,QAAQ,KAAK;CACrI;CACA;CACA,eAAe,QAAQ,0BAA0B,uBAAuB,OAAO,QAAQ,4BAA4B,KAAK,IAAI,KAAK,IAAI,wBAAwB,WAAW,QAAQ,SAAS,KAAK,IAAI,OAAO;AAC3M,CAAC;AACD,SAAS,4BAA4B;CACnC,IAAI,CAAC,aAAa,gBAAgB,iBAAiB,GAAG,OAAO;CAC7D,OAAO,CAAC,CAAC,gBAAgB;CACzB,OAAO;AACT;AACA,SAAS,+BAA+B;CACtC,IAAI,CAAC,UAAU,OAAO,CAAC,CAAC,KAAK,KAAK;AACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LaunchScreenRelease.js","names":[],"sources":["esm/router/LaunchScreenRelease.js"],"sourcesContent":["function LaunchScreenRelease() {\n return null;\n}\nexport {\n LaunchScreenRelease\n};\n//# sourceMappingURL=LaunchScreenRelease.js.map\n"],"mappings":";AAAA,SAAS,sBAAsB;CAC7B,OAAO;AACT"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useLayoutEffect } from "react";
|
|
2
|
+
import { Platform } from "react-native";
|
|
3
|
+
import { holdLaunchScreenForRouter, releaseLaunchScreenForRouter } from "../platform/launchScreen/index.native.js";
|
|
4
|
+
|
|
5
|
+
var holds = Platform.OS === "ios" && holdLaunchScreenForRouter();
|
|
6
|
+
function LaunchScreenRelease() {
|
|
7
|
+
useLayoutEffect(function() {
|
|
8
|
+
if (holds) releaseLaunchScreenForRouter();
|
|
9
|
+
}, []);
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { LaunchScreenRelease };
|
|
14
|
+
//# sourceMappingURL=LaunchScreenRelease.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LaunchScreenRelease.native.js","names":[],"sources":["esm/router/LaunchScreenRelease.native.js"],"sourcesContent":["import { useLayoutEffect } from \"react\";\nimport { Platform } from \"react-native\";\nimport { holdLaunchScreenForRouter, releaseLaunchScreenForRouter } from \"../platform/launchScreen/index.native\";\nvar holds = Platform.OS === \"ios\" && holdLaunchScreenForRouter();\nfunction LaunchScreenRelease() {\n useLayoutEffect(function() {\n if (holds) releaseLaunchScreenForRouter();\n }, []);\n return null;\n}\nexport {\n LaunchScreenRelease\n};\n//# sourceMappingURL=LaunchScreenRelease.native.js.map\n"],"mappings":";;;;;AAGA,IAAI,QAAQ,SAAS,OAAO,SAAS,0BAA0B;AAC/D,SAAS,sBAAsB;CAC7B,gBAAgB,WAAW;EACzB,IAAI,OAAO,6BAA6B;CAC1C,GAAG,CAAC,CAAC;CACL,OAAO;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "one",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.0",
|
|
4
4
|
"description": "One is a React framework for web, iOS, and Android apps.",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"sideEffects": [
|
|
@@ -282,15 +282,15 @@
|
|
|
282
282
|
"@react-navigation/routers": "8.0.0-alpha.21",
|
|
283
283
|
"@rozenite/middleware": "^2.5.0",
|
|
284
284
|
"@ungap/structured-clone": "^1.2.0",
|
|
285
|
-
"@vxrn/color-scheme": "2.
|
|
286
|
-
"@vxrn/compiler": "2.
|
|
287
|
-
"@vxrn/resolve": "2.
|
|
288
|
-
"@vxrn/tslib-lite": "2.
|
|
289
|
-
"@vxrn/use-isomorphic-layout-effect": "2.
|
|
290
|
-
"@vxrn/utils": "2.
|
|
285
|
+
"@vxrn/color-scheme": "2.15.0",
|
|
286
|
+
"@vxrn/compiler": "2.15.0",
|
|
287
|
+
"@vxrn/resolve": "2.15.0",
|
|
288
|
+
"@vxrn/tslib-lite": "2.15.0",
|
|
289
|
+
"@vxrn/use-isomorphic-layout-effect": "2.15.0",
|
|
290
|
+
"@vxrn/utils": "2.15.0",
|
|
291
291
|
"citty": "^0.1.6",
|
|
292
292
|
"core-js": "^3.38.1",
|
|
293
|
-
"create-vxrn": "2.
|
|
293
|
+
"create-vxrn": "2.15.0",
|
|
294
294
|
"escape-string-regexp": "^5.0.0",
|
|
295
295
|
"fast-deep-equal": "^3.1.3",
|
|
296
296
|
"fast-glob": "^3.3.3",
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
"tsconfig-paths": "^4",
|
|
313
313
|
"use-latest-callback": "^0.3.5",
|
|
314
314
|
"vite": "^8.2.2",
|
|
315
|
-
"vxrn": "2.
|
|
315
|
+
"vxrn": "2.15.0",
|
|
316
316
|
"web-streams-polyfill": "^4.3.0",
|
|
317
317
|
"ws": "^8.21.0",
|
|
318
318
|
"xxhashjs": "^0.2.2"
|
|
@@ -342,7 +342,7 @@
|
|
|
342
342
|
"@babel/types": "^7.28.5",
|
|
343
343
|
"babel-dead-code-elimination": "1.0.10",
|
|
344
344
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
345
|
-
"@vxrn/vite-plugin-metro": "2.
|
|
345
|
+
"@vxrn/vite-plugin-metro": "2.15.0"
|
|
346
346
|
},
|
|
347
347
|
"peerDependenciesMeta": {
|
|
348
348
|
"@react-native/babel-preset": {
|
|
@@ -404,19 +404,19 @@
|
|
|
404
404
|
}
|
|
405
405
|
},
|
|
406
406
|
"devDependencies": {
|
|
407
|
-
"@tamagui/sheet": "3.2.
|
|
407
|
+
"@tamagui/sheet": "3.2.4",
|
|
408
408
|
"@callstack/liquid-glass": "^0.8.1",
|
|
409
409
|
"@react-native/babel-plugin-codegen": "0.88.0",
|
|
410
410
|
"@react-native/codegen": "^0.88.0",
|
|
411
411
|
"@react-navigation/core": "8.0.0-alpha.41",
|
|
412
412
|
"@react-navigation/drawer": "8.0.0-alpha.58",
|
|
413
413
|
"@react-navigation/native": "8.0.0-alpha.51",
|
|
414
|
-
"@tamagui/build": "3.2.
|
|
414
|
+
"@tamagui/build": "3.2.4",
|
|
415
415
|
"@types/node": "^24.10.0",
|
|
416
416
|
"@types/react-dom": "^19.3.0",
|
|
417
417
|
"@types/react-test-renderer": "^19.1.0",
|
|
418
418
|
"@types/xxhashjs": "^0.2.4",
|
|
419
|
-
"@vxrn/emitter": "2.
|
|
419
|
+
"@vxrn/emitter": "2.15.0",
|
|
420
420
|
"depcheck": "^1.4.7",
|
|
421
421
|
"esbuild": "^0.25.12",
|
|
422
422
|
"immer": "^10.1.1",
|
|
@@ -435,7 +435,7 @@
|
|
|
435
435
|
"typescript": "7.0.2",
|
|
436
436
|
"vitest": "^4.1.0",
|
|
437
437
|
"yoga-layout": "^3.2.1",
|
|
438
|
-
"@tamagui/web": "3.2.
|
|
438
|
+
"@tamagui/web": "3.2.4",
|
|
439
439
|
"@babel/core": "^7.28.5",
|
|
440
440
|
"@babel/generator": "7.29.7",
|
|
441
441
|
"@babel/parser": "^7.28.5",
|
|
@@ -444,7 +444,7 @@
|
|
|
444
444
|
"@babel/types": "^7.28.5",
|
|
445
445
|
"babel-dead-code-elimination": "1.0.10",
|
|
446
446
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
447
|
-
"@vxrn/vite-plugin-metro": "2.
|
|
447
|
+
"@vxrn/vite-plugin-metro": "2.15.0"
|
|
448
448
|
},
|
|
449
449
|
"publishConfig": {
|
|
450
450
|
"access": "public"
|
|
@@ -612,7 +612,7 @@
|
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
614
|
},
|
|
615
|
-
"releaseSourceCommit": "
|
|
615
|
+
"releaseSourceCommit": "25aca02a5be98e8f28143e439d9e8f8e7ed5c0a8",
|
|
616
616
|
"repository": {
|
|
617
617
|
"type": "git",
|
|
618
618
|
"url": "git+https://github.com/onejs/one.git",
|
package/src/Root.tsx
CHANGED
|
@@ -21,6 +21,7 @@ import { FlagsContext } from './router/FlagsContext'
|
|
|
21
21
|
import { getResolvedLinking } from './router/linkingConfig'
|
|
22
22
|
import { handleNavigationContainerStateChange } from './router/router'
|
|
23
23
|
import { ServerLocationContext } from './router/serverLocationContext'
|
|
24
|
+
import { LaunchScreenRelease } from './router/LaunchScreenRelease'
|
|
24
25
|
import { useInitializeOneRouter } from './router/useInitializeOneRouter'
|
|
25
26
|
import { useViteRoutes } from './router/useViteRoutes'
|
|
26
27
|
import type { GlobbedRouteImports } from './types'
|
|
@@ -168,6 +169,7 @@ export function Root(props: RootProps) {
|
|
|
168
169
|
<RootErrorBoundary>
|
|
169
170
|
<Component />
|
|
170
171
|
</RootErrorBoundary>
|
|
172
|
+
<LaunchScreenRelease />
|
|
171
173
|
</>
|
|
172
174
|
</ServerLocationContext.Provider>
|
|
173
175
|
</UpstreamNavigationContainer>
|
package/src/native/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type {
|
|
|
11
11
|
export type { LaunchScreenApi, LaunchScreenCoverProps, LaunchScreenHideOptions }
|
|
12
12
|
|
|
13
13
|
let hybrid: OneLaunchScreen | undefined
|
|
14
|
+
let appHolds = false
|
|
14
15
|
|
|
15
16
|
function native(): OneLaunchScreen {
|
|
16
17
|
hybrid ??= NitroModules.createHybridObject<OneLaunchScreen>('OneLaunchScreen')
|
|
@@ -19,6 +20,7 @@ function native(): OneLaunchScreen {
|
|
|
19
20
|
|
|
20
21
|
export const LaunchScreen: LaunchScreenApi = Object.freeze({
|
|
21
22
|
preventAutoHide() {
|
|
23
|
+
appHolds = true
|
|
22
24
|
native().preventAutoHide()
|
|
23
25
|
},
|
|
24
26
|
|
|
@@ -29,3 +31,14 @@ export const LaunchScreen: LaunchScreenApi = Object.freeze({
|
|
|
29
31
|
Cover,
|
|
30
32
|
artworkWidth: readLaunchScreenConfig()?.width ?? null,
|
|
31
33
|
})
|
|
34
|
+
|
|
35
|
+
// an app built without one's native module has no launch screen to hold.
|
|
36
|
+
export function holdLaunchScreenForRouter(): boolean {
|
|
37
|
+
if (!NitroModules.hasHybridObject('OneLaunchScreen')) return false
|
|
38
|
+
native().preventAutoHide()
|
|
39
|
+
return true
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function releaseLaunchScreenForRouter() {
|
|
43
|
+
if (!appHolds) native().hide(false)
|
|
44
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useLayoutEffect } from 'react'
|
|
2
|
+
import { Platform } from 'react-native'
|
|
3
|
+
import {
|
|
4
|
+
holdLaunchScreenForRouter,
|
|
5
|
+
releaseLaunchScreenForRouter,
|
|
6
|
+
} from '../platform/launchScreen/index.native'
|
|
7
|
+
|
|
8
|
+
// ios releases the launch screen on react native's first content, which is the
|
|
9
|
+
// router's provider shell: native resolves its initial url asynchronously, so
|
|
10
|
+
// the root layout, where an app calls preventAutoHide, evaluates only after
|
|
11
|
+
// that release and the app shows an empty window in between. the router holds
|
|
12
|
+
// it from before its first commit until its first route renders.
|
|
13
|
+
const holds = Platform.OS === 'ios' && holdLaunchScreenForRouter()
|
|
14
|
+
|
|
15
|
+
export function LaunchScreenRelease() {
|
|
16
|
+
useLayoutEffect(() => {
|
|
17
|
+
if (holds) releaseLaunchScreenForRouter()
|
|
18
|
+
}, [])
|
|
19
|
+
return null
|
|
20
|
+
}
|
package/types/Root.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Root.d.ts","sourceRoot":"","sources":["../src/Root.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AAG1F,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AAMd,OAAO,KAAK,EAAE,gBAAgB,EAA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AAE,MAAM,CAAA;gBACZ,IAAI,EAAE,MAAM,CAAA;gBACZ,MAAM,EAAE,MAAM,CAAA;gBACd,YAAY,EAAE,MAAM,CAAA;aACrB,CAAA;SACF,CAAA;KACF,CAAA;CACF,CAAA;AAKD,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,sCAiLpC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { appIconPreviewResources, expoClientFromNativeApp, validateNativeApp, type NativeAppIcon, type NativeAppManifest, } from '@vxrn/utils/nativeAppManifest';
|
|
1
|
+
export { appIconPreviewResources, expoClientFromNativeApp, validateNativeApp, type NativeAppIcon, type NativeAppPatch, type NativeAppManifest, } from '@vxrn/utils/nativeAppManifest';
|
|
2
2
|
//# sourceMappingURL=appManifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appManifest.d.ts","sourceRoot":"","sources":["../../src/native/appManifest.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACvB,MAAM,+BAA+B,CAAA"}
|
|
1
|
+
{"version":3,"file":"appManifest.d.ts","sourceRoot":"","sources":["../../src/native/appManifest.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB,MAAM,+BAA+B,CAAA"}
|
package/types/native/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { expoClientFromNativeApp, validateNativeApp, type NativeAppIcon, type NativeAppManifest, } from './appManifest';
|
|
1
|
+
export { expoClientFromNativeApp, validateNativeApp, type NativeAppIcon, type NativeAppManifest, type NativeAppPatch, } from './appManifest';
|
|
2
2
|
export { ONE_PLATFORM_ENV, ONE_PUBLIC_PREFIX, pickOnePublicEnv, type OnePlatformKey, } from './env';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/native/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/native/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,cAAc,GACpB,MAAM,OAAO,CAAA"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { LaunchScreen as LaunchScreenApi, LaunchScreenCoverProps, LaunchScreenHideOptions } from './types';
|
|
2
2
|
export type { LaunchScreenApi, LaunchScreenCoverProps, LaunchScreenHideOptions };
|
|
3
3
|
export declare const LaunchScreen: LaunchScreenApi;
|
|
4
|
+
export declare function holdLaunchScreenForRouter(): boolean;
|
|
5
|
+
export declare function releaseLaunchScreenForRouter(): void;
|
|
4
6
|
//# sourceMappingURL=index.native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/platform/launchScreen/index.native.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,YAAY,IAAI,eAAe,EAC/B,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAEhB,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/platform/launchScreen/index.native.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,YAAY,IAAI,eAAe,EAC/B,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAEhB,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,CAAA;AAUhF,eAAO,MAAM,YAAY,EAAE,eAYzB,CAAA;AAGF,wBAAgB,yBAAyB,IAAI,OAAO,CAInD;AAED,wBAAgB,4BAA4B,SAE3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LaunchScreenRelease.d.ts","sourceRoot":"","sources":["../../src/router/LaunchScreenRelease.tsx"],"names":[],"mappings":"AACA,wBAAgB,mBAAmB,SAElC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LaunchScreenRelease.native.d.ts","sourceRoot":"","sources":["../../src/router/LaunchScreenRelease.native.tsx"],"names":[],"mappings":"AAcA,wBAAgB,mBAAmB,SAKlC"}
|