one 1.1.538 → 1.1.539
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.native.js +83 -61
- package/dist/cjs/Root.native.js.map +1 -6
- package/dist/cjs/babel-plugins/one-router-metro.native.js +31 -20
- package/dist/cjs/babel-plugins/one-router-metro.native.js.map +1 -6
- package/dist/cjs/cli/build.native.js +340 -277
- package/dist/cjs/cli/build.native.js.map +1 -6
- package/dist/cjs/cli/buildPage.native.js +65 -36
- package/dist/cjs/cli/buildPage.native.js.map +1 -6
- package/dist/cjs/cli/checkNodeVersion.native.js +17 -14
- package/dist/cjs/cli/checkNodeVersion.native.js.map +1 -6
- package/dist/cjs/cli/dev.native.js +55 -37
- package/dist/cjs/cli/dev.native.js.map +1 -6
- package/dist/cjs/cli/label-process.native.js +20 -16
- package/dist/cjs/cli/label-process.native.js.map +1 -6
- package/dist/cjs/cli/main.native.js +37 -22
- package/dist/cjs/cli/main.native.js.map +1 -6
- package/dist/cjs/cli/patch.native.js +28 -19
- package/dist/cjs/cli/patch.native.js.map +1 -6
- package/dist/cjs/cli/prebuild.native.js +26 -18
- package/dist/cjs/cli/prebuild.native.js.map +1 -6
- package/dist/cjs/cli/runAndroid.native.js +26 -18
- package/dist/cjs/cli/runAndroid.native.js.map +1 -6
- package/dist/cjs/cli/runIos.native.js +26 -18
- package/dist/cjs/cli/runIos.native.js.map +1 -6
- package/dist/cjs/cli.native.js +281 -220
- package/dist/cjs/cli.native.js.map +1 -6
- package/dist/cjs/clientLoaderResolver.native.js +21 -19
- package/dist/cjs/clientLoaderResolver.native.js.map +1 -6
- package/dist/cjs/config.native.js +26 -21
- package/dist/cjs/config.native.js.map +1 -6
- package/dist/cjs/constants.native.js +36 -30
- package/dist/cjs/constants.native.js.map +1 -6
- package/dist/cjs/createApp.native.js +26 -21
- package/dist/cjs/createApp.native.js.map +1 -6
- package/dist/cjs/createHandleRequest.native.js +94 -85
- package/dist/cjs/createHandleRequest.native.js.map +1 -6
- package/dist/cjs/createMiddleware.native.js +17 -14
- package/dist/cjs/createMiddleware.native.js.map +1 -6
- package/dist/cjs/fallbackViews/Sitemap.native.js +21 -17
- package/dist/cjs/fallbackViews/Sitemap.native.js.map +1 -6
- package/dist/cjs/fallbackViews/Unmatched.native.js +27 -19
- package/dist/cjs/fallbackViews/Unmatched.native.js.map +1 -6
- package/dist/cjs/fork/NavigationContainer.native.js +93 -64
- package/dist/cjs/fork/NavigationContainer.native.js.map +1 -6
- package/dist/cjs/fork/__tests__/getPathFromState.test.cjs +9 -10
- package/dist/cjs/fork/__tests__/getPathFromState.test.js +3 -3
- package/dist/cjs/fork/__tests__/getPathFromState.test.js.map +1 -1
- package/dist/cjs/fork/__tests__/getPathFromState.test.native.js +1144 -1288
- package/dist/cjs/fork/__tests__/getPathFromState.test.native.js.map +1 -6
- package/dist/cjs/fork/__tests__/getStateFromPath.test.cjs +5 -7
- package/dist/cjs/fork/__tests__/getStateFromPath.test.js +5 -5
- package/dist/cjs/fork/__tests__/getStateFromPath.test.js.map +1 -1
- package/dist/cjs/fork/__tests__/getStateFromPath.test.native.js +1881 -2104
- package/dist/cjs/fork/__tests__/getStateFromPath.test.native.js.map +1 -6
- package/dist/cjs/fork/_shared.native.js +19 -19
- package/dist/cjs/fork/_shared.native.js.map +1 -6
- package/dist/cjs/fork/createMemoryHistory.native.js +131 -109
- package/dist/cjs/fork/createMemoryHistory.native.js.map +1 -6
- package/dist/cjs/fork/extractPathFromURL.native.js +43 -41
- package/dist/cjs/fork/extractPathFromURL.native.js.map +1 -6
- package/dist/cjs/fork/findFocusedRoute.native.js +20 -16
- package/dist/cjs/fork/findFocusedRoute.native.js.map +1 -6
- package/dist/cjs/fork/getPathFromState-mods.native.js +37 -25
- package/dist/cjs/fork/getPathFromState-mods.native.js.map +1 -6
- package/dist/cjs/fork/getPathFromState.native.js +112 -107
- package/dist/cjs/fork/getPathFromState.native.js.map +1 -6
- package/dist/cjs/fork/getPathFromState.test.native.js +63 -74
- package/dist/cjs/fork/getPathFromState.test.native.js.map +1 -6
- package/dist/cjs/fork/getStateFromPath-mods.native.js +126 -131
- package/dist/cjs/fork/getStateFromPath-mods.native.js.map +1 -6
- package/dist/cjs/fork/getStateFromPath.native.js +271 -240
- package/dist/cjs/fork/getStateFromPath.native.js.map +1 -6
- package/dist/cjs/fork/getStateFromPath.test.native.js +167 -306
- package/dist/cjs/fork/getStateFromPath.test.native.js.map +1 -6
- package/dist/cjs/fork/useBackButton.native.js +28 -23
- package/dist/cjs/fork/useBackButton.native.js.map +1 -6
- package/dist/cjs/fork/useDocumentTitle.native.js +17 -15
- package/dist/cjs/fork/useDocumentTitle.native.js.map +1 -6
- package/dist/cjs/fork/useLinking.native.js +111 -100
- package/dist/cjs/fork/useLinking.native.js.map +1 -6
- package/dist/cjs/fork/useThenable.native.js +41 -44
- package/dist/cjs/fork/useThenable.native.js.map +1 -6
- package/dist/cjs/fork/validatePathConfig.native.js +48 -49
- package/dist/cjs/fork/validatePathConfig.native.js.map +1 -6
- package/dist/cjs/getReactNavigationConfig.native.js +36 -39
- package/dist/cjs/getReactNavigationConfig.native.js.map +1 -6
- package/dist/cjs/getURL.native.js +25 -17
- package/dist/cjs/getURL.native.js.map +1 -6
- package/dist/cjs/head/Head.android.js +20 -16
- package/dist/cjs/head/Head.android.js.map +1 -6
- package/dist/cjs/head/Head.ios.js +162 -156
- package/dist/cjs/head/Head.ios.js.map +1 -6
- package/dist/cjs/head/Head.native.js +24 -18
- package/dist/cjs/head/Head.native.js.map +1 -6
- package/dist/cjs/head/HeadModule.native.js +21 -16
- package/dist/cjs/head/HeadModule.native.js.map +1 -6
- package/dist/cjs/head/index.native.js +13 -12
- package/dist/cjs/head/index.native.js.map +1 -6
- package/dist/cjs/head/types.native.js +9 -5
- package/dist/cjs/head/types.native.js.map +1 -6
- package/dist/cjs/head/url.js +2 -2
- package/dist/cjs/head/url.js.map +1 -1
- package/dist/cjs/head/url.native.js +23 -20
- package/dist/cjs/head/url.native.js.map +1 -6
- package/dist/cjs/hooks.native.js +62 -67
- package/dist/cjs/hooks.native.js.map +1 -6
- package/dist/cjs/href.native.js +18 -16
- package/dist/cjs/href.native.js.map +1 -6
- package/dist/cjs/import-mode/index.android.js +18 -10
- package/dist/cjs/import-mode/index.android.js.map +1 -6
- package/dist/cjs/import-mode/index.ios.js +18 -10
- package/dist/cjs/import-mode/index.ios.js.map +1 -6
- package/dist/cjs/import-mode/index.native.js +16 -9
- package/dist/cjs/import-mode/index.native.js.map +1 -6
- package/dist/cjs/index.native.js +57 -63
- package/dist/cjs/index.native.js.map +1 -6
- package/dist/cjs/interfaces/router.native.js +17 -14
- package/dist/cjs/interfaces/router.native.js.map +1 -6
- package/dist/cjs/layouts/Drawer.native.js +22 -15
- package/dist/cjs/layouts/Drawer.native.js.map +1 -6
- package/dist/cjs/layouts/Stack.native.js +22 -15
- package/dist/cjs/layouts/Stack.native.js.map +1 -6
- package/dist/cjs/layouts/Tabs.native.js +76 -63
- package/dist/cjs/layouts/Tabs.native.js.map +1 -6
- package/dist/cjs/layouts/withLayoutContext.native.js +67 -56
- package/dist/cjs/layouts/withLayoutContext.native.js.map +1 -6
- package/dist/cjs/link/Link.native.js +94 -89
- package/dist/cjs/link/Link.native.js.map +1 -6
- package/dist/cjs/link/Redirect.native.js +25 -20
- package/dist/cjs/link/Redirect.native.js.map +1 -6
- package/dist/cjs/link/href.native.js +42 -38
- package/dist/cjs/link/href.native.js.map +1 -6
- package/dist/cjs/link/linking.native.js +63 -61
- package/dist/cjs/link/linking.native.js.map +1 -6
- package/dist/cjs/link/path.native.js +34 -38
- package/dist/cjs/link/path.native.js.map +1 -6
- package/dist/cjs/link/useLinkTo.native.js +36 -30
- package/dist/cjs/link/useLinkTo.native.js.map +1 -6
- package/dist/cjs/link/useLoadedNavigation.native.js +40 -40
- package/dist/cjs/link/useLoadedNavigation.native.js.map +1 -6
- package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js +115 -112
- package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js.map +1 -6
- package/dist/cjs/polyfills-mobile.native.js +28 -15
- package/dist/cjs/polyfills-mobile.native.js.map +1 -6
- package/dist/cjs/polyfills-server.native.js +19 -13
- package/dist/cjs/polyfills-server.native.js.map +1 -6
- package/dist/cjs/render.native.js +16 -13
- package/dist/cjs/render.native.js.map +1 -6
- package/dist/cjs/router/FlagsContext.native.js +19 -15
- package/dist/cjs/router/FlagsContext.native.js.map +1 -6
- package/dist/cjs/router/Route.native.js +39 -28
- package/dist/cjs/router/Route.native.js.map +1 -6
- package/dist/cjs/router/RouteInfoContext.native.js +37 -21
- package/dist/cjs/router/RouteInfoContext.native.js.map +1 -6
- package/dist/cjs/router/RouterStore.native.js +9 -5
- package/dist/cjs/router/RouterStore.native.js.map +1 -6
- package/dist/cjs/router/createRoute.native.js +31 -26
- package/dist/cjs/router/createRoute.native.js.map +1 -6
- package/dist/cjs/router/filterRootHTML.native.js +40 -24
- package/dist/cjs/router/filterRootHTML.native.js.map +1 -6
- package/dist/cjs/router/getLinkingConfig.native.js +24 -21
- package/dist/cjs/router/getLinkingConfig.native.js.map +1 -6
- package/dist/cjs/router/getNormalizedStatePath.native.js +32 -28
- package/dist/cjs/router/getNormalizedStatePath.native.js.map +1 -6
- package/dist/cjs/router/getRoutes.native.js +261 -273
- package/dist/cjs/router/getRoutes.native.js.map +1 -6
- package/dist/cjs/router/glob-patterns.native.js +21 -24
- package/dist/cjs/router/glob-patterns.native.js.map +1 -6
- package/dist/cjs/router/imperative-api.native.js +39 -32
- package/dist/cjs/router/imperative-api.native.js.map +1 -6
- package/dist/cjs/router/lastAction.native.js +24 -20
- package/dist/cjs/router/lastAction.native.js.map +1 -6
- package/dist/cjs/router/matchers.native.js +18 -26
- package/dist/cjs/router/matchers.native.js.map +1 -6
- package/dist/cjs/router/matchers.test.native.js +19 -17
- package/dist/cjs/router/matchers.test.native.js.map +1 -6
- package/dist/cjs/router/router.native.js +156 -150
- package/dist/cjs/router/router.native.js.map +1 -6
- package/dist/cjs/router/serverLocationContext.native.js +19 -15
- package/dist/cjs/router/serverLocationContext.native.js.map +1 -6
- package/dist/cjs/router/sortRoutes.native.js +37 -44
- package/dist/cjs/router/sortRoutes.native.js.map +1 -6
- package/dist/cjs/router/useInitializeOneRouter.native.js +28 -20
- package/dist/cjs/router/useInitializeOneRouter.native.js.map +1 -6
- package/dist/cjs/router/useNavigation.native.js +42 -35
- package/dist/cjs/router/useNavigation.native.js.map +1 -6
- package/dist/cjs/router/useScreens.native.js +280 -248
- package/dist/cjs/router/useScreens.native.js.map +1 -6
- package/dist/cjs/router/useViteRoutes.native.js +36 -31
- package/dist/cjs/router/useViteRoutes.native.js.map +1 -6
- package/dist/cjs/router/utils/getNavigateAction.native.js +33 -23
- package/dist/cjs/router/utils/getNavigateAction.native.js.map +1 -6
- package/dist/cjs/router/utils/getNavigateAction.test.native.js +142 -197
- package/dist/cjs/router/utils/getNavigateAction.test.native.js.map +1 -6
- package/dist/cjs/serve-worker.native.js +25 -16
- package/dist/cjs/serve-worker.native.js.map +1 -6
- package/dist/cjs/serve.native.js +50 -25
- package/dist/cjs/serve.native.js.map +1 -6
- package/dist/cjs/server/ServerContextScript.native.js +31 -26
- package/dist/cjs/server/ServerContextScript.native.js.map +1 -6
- package/dist/cjs/server/createRoutesManifest.native.js +26 -23
- package/dist/cjs/server/createRoutesManifest.native.js.map +1 -6
- package/dist/cjs/server/getServerManifest.native.js +107 -87
- package/dist/cjs/server/getServerManifest.native.js.map +1 -6
- package/dist/cjs/server/oneServe.native.js +199 -132
- package/dist/cjs/server/oneServe.native.js.map +1 -6
- package/dist/cjs/server/setServerGlobals.native.js +17 -14
- package/dist/cjs/server/setServerGlobals.native.js.map +1 -6
- package/dist/cjs/server/setupBuildOptions.native.js +17 -14
- package/dist/cjs/server/setupBuildOptions.native.js.map +1 -6
- package/dist/cjs/server/setupServerGlobals.native.js +3 -2
- package/dist/cjs/server/setupServerGlobals.native.js.map +1 -6
- package/dist/cjs/server-render.native.js +39 -29
- package/dist/cjs/server-render.native.js.map +1 -6
- package/dist/cjs/setup.native.js.map +1 -6
- package/dist/cjs/testing-utils.native.js +39 -41
- package/dist/cjs/testing-utils.native.js.map +1 -6
- package/dist/cjs/typed-routes/generateRouteTypes.native.js +36 -22
- package/dist/cjs/typed-routes/generateRouteTypes.native.js.map +1 -6
- package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.native.js +53 -47
- package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.native.js.map +1 -6
- package/dist/cjs/types.native.js +9 -5
- package/dist/cjs/types.native.js.map +1 -6
- package/dist/cjs/useFocusEffect.native.js +39 -36
- package/dist/cjs/useFocusEffect.native.js.map +1 -6
- package/dist/cjs/useLoader.native.js +67 -52
- package/dist/cjs/useLoader.native.js.map +1 -6
- package/dist/cjs/useServerHeadInsertion.native.js +32 -25
- package/dist/cjs/useServerHeadInsertion.native.js.map +1 -6
- package/dist/cjs/utils/assertIsReady.native.js +18 -16
- package/dist/cjs/utils/assertIsReady.native.js.map +1 -6
- package/dist/cjs/utils/cleanUrl.native.js +26 -19
- package/dist/cjs/utils/cleanUrl.native.js.map +1 -6
- package/dist/cjs/utils/dynamicImport.native.js +18 -15
- package/dist/cjs/utils/dynamicImport.native.js.map +1 -6
- package/dist/cjs/utils/ensureExists.native.js +18 -16
- package/dist/cjs/utils/ensureExists.native.js.map +1 -6
- package/dist/cjs/utils/existsAsync.native.js +27 -23
- package/dist/cjs/utils/existsAsync.native.js.map +1 -6
- package/dist/cjs/utils/getPageExport.native.js +34 -30
- package/dist/cjs/utils/getPageExport.native.js.map +1 -6
- package/dist/cjs/utils/getPathnameFromFilePath.native.js +36 -27
- package/dist/cjs/utils/getPathnameFromFilePath.native.js.map +1 -6
- package/dist/cjs/utils/getRouterRootFromOneOptions.native.js +17 -14
- package/dist/cjs/utils/getRouterRootFromOneOptions.native.js.map +1 -6
- package/dist/cjs/utils/globDir.native.js +24 -18
- package/dist/cjs/utils/globDir.native.js.map +1 -6
- package/dist/cjs/utils/hashString.native.js +23 -17
- package/dist/cjs/utils/hashString.native.js.map +1 -6
- package/dist/cjs/utils/isResponse.native.js +21 -15
- package/dist/cjs/utils/isResponse.native.js.map +1 -6
- package/dist/cjs/utils/isRolldown.native.js +24 -19
- package/dist/cjs/utils/isRolldown.native.js.map +1 -6
- package/dist/cjs/utils/isStatus.native.js +17 -14
- package/dist/cjs/utils/isStatus.native.js.map +1 -6
- package/dist/cjs/utils/platform.native.js +17 -14
- package/dist/cjs/utils/platform.native.js.map +1 -6
- package/dist/cjs/utils/promiseWithResolvers.native.js +22 -17
- package/dist/cjs/utils/promiseWithResolvers.native.js.map +1 -6
- package/dist/cjs/utils/rand.native.js +18 -15
- package/dist/cjs/utils/rand.native.js.map +1 -6
- package/dist/cjs/utils/redirect.native.js +26 -21
- package/dist/cjs/utils/redirect.native.js.map +1 -6
- package/dist/cjs/utils/removeSearch.native.js +17 -14
- package/dist/cjs/utils/removeSearch.native.js.map +1 -6
- package/dist/cjs/utils/removeUndefined.native.js +18 -16
- package/dist/cjs/utils/removeUndefined.native.js.map +1 -6
- package/dist/cjs/utils/toAbsolute.native.js +21 -17
- package/dist/cjs/utils/toAbsolute.native.js.map +1 -6
- package/dist/cjs/utils/url.native.js +17 -16
- package/dist/cjs/utils/url.native.js.map +1 -6
- package/dist/cjs/utils/useConstant.native.js +26 -21
- package/dist/cjs/utils/useConstant.native.js.map +1 -6
- package/dist/cjs/utils/weakKey.native.js +25 -21
- package/dist/cjs/utils/weakKey.native.js.map +1 -6
- package/dist/cjs/utils/weakMemo.native.js +23 -18
- package/dist/cjs/utils/weakMemo.native.js.map +1 -6
- package/dist/cjs/utils/withStaticProperties.native.js +48 -35
- package/dist/cjs/utils/withStaticProperties.native.js.map +1 -6
- package/dist/cjs/vercel/build/buildVercelOutputDirectory.native.js +120 -95
- package/dist/cjs/vercel/build/buildVercelOutputDirectory.native.js.map +1 -6
- package/dist/cjs/vercel/build/config/vc-build-output-config-base.native.js +17 -14
- package/dist/cjs/vercel/build/config/vc-build-output-config-base.native.js.map +1 -6
- package/dist/cjs/vercel/build/config/vc-config-base.native.js +17 -14
- package/dist/cjs/vercel/build/config/vc-config-base.native.js.map +1 -6
- package/dist/cjs/vercel/build/config/vc-package-base.native.js +17 -14
- package/dist/cjs/vercel/build/config/vc-package-base.native.js.map +1 -6
- package/dist/cjs/vercel/build/generate/createApiServerlessFunction.native.js +60 -71
- package/dist/cjs/vercel/build/generate/createApiServerlessFunction.native.js.map +1 -6
- package/dist/cjs/vercel/build/generate/createSsrServerlessFunction.native.js +36 -24
- package/dist/cjs/vercel/build/generate/createSsrServerlessFunction.native.js.map +1 -6
- package/dist/cjs/vercel/build/getPathFromRoute.native.js +18 -15
- package/dist/cjs/vercel/build/getPathFromRoute.native.js.map +1 -6
- package/dist/cjs/views/EmptyRoute.native.js +19 -15
- package/dist/cjs/views/EmptyRoute.native.js.map +1 -6
- package/dist/cjs/views/ErrorBoundary.native.js +33 -19
- package/dist/cjs/views/ErrorBoundary.native.js.map +1 -6
- package/dist/cjs/views/LoadProgressBar.native.js +75 -67
- package/dist/cjs/views/LoadProgressBar.native.js.map +1 -6
- package/dist/cjs/views/Navigator.native.js +99 -64
- package/dist/cjs/views/Navigator.native.js.map +1 -6
- package/dist/cjs/views/OneStackRouter.native.js +27 -23
- package/dist/cjs/views/OneStackRouter.native.js.map +1 -6
- package/dist/cjs/views/PreloadLinks.native.js +16 -13
- package/dist/cjs/views/PreloadLinks.native.js.map +1 -6
- package/dist/cjs/views/RootErrorBoundary.native.js +54 -53
- package/dist/cjs/views/RootErrorBoundary.native.js.map +1 -6
- package/dist/cjs/views/Screen.native.js +28 -22
- package/dist/cjs/views/Screen.native.js.map +1 -6
- package/dist/cjs/views/ScrollBehavior.native.js +54 -43
- package/dist/cjs/views/ScrollBehavior.native.js.map +1 -6
- package/dist/cjs/views/Try.native.js +60 -54
- package/dist/cjs/views/Try.native.js.map +1 -6
- package/dist/cjs/vite/DevHead.native.js +19 -15
- package/dist/cjs/vite/DevHead.native.js.map +1 -6
- package/dist/cjs/vite/constants.native.js +20 -17
- package/dist/cjs/vite/constants.native.js.map +1 -6
- package/dist/cjs/vite/customNodeExternals.native.js +35 -25
- package/dist/cjs/vite/customNodeExternals.native.js.map +1 -6
- package/dist/cjs/vite/ensureTsConfig.native.js +21 -16
- package/dist/cjs/vite/ensureTsConfig.native.js.map +1 -6
- package/dist/cjs/vite/findDepsToOptimize.native.js +46 -43
- package/dist/cjs/vite/findDepsToOptimize.native.js.map +1 -6
- package/dist/cjs/vite/getManifest.native.js +23 -16
- package/dist/cjs/vite/getManifest.native.js.map +1 -6
- package/dist/cjs/vite/loadConfig.native.js +22 -22
- package/dist/cjs/vite/loadConfig.native.js.map +1 -6
- package/dist/cjs/vite/makePluginWebOnly.native.js +20 -19
- package/dist/cjs/vite/makePluginWebOnly.native.js.map +1 -6
- package/dist/cjs/vite/one-server-only.native.js +24 -33
- package/dist/cjs/vite/one-server-only.native.js.map +1 -6
- package/dist/cjs/vite/one.native.js +202 -181
- package/dist/cjs/vite/one.native.js.map +1 -6
- package/dist/cjs/vite/plugins/SSRCSSPlugin.native.js +75 -74
- package/dist/cjs/vite/plugins/SSRCSSPlugin.native.js.map +1 -6
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js +69 -56
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js.map +1 -6
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js +154 -108
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -6
- package/dist/cjs/vite/plugins/fixDependenciesPlugin.native.js +25 -16
- package/dist/cjs/vite/plugins/fixDependenciesPlugin.native.js.map +1 -6
- package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.native.js +33 -24
- package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.native.js.map +1 -6
- package/dist/cjs/vite/plugins/removeReactNativeWebAnimatedPlugin.native.js +26 -24
- package/dist/cjs/vite/plugins/removeReactNativeWebAnimatedPlugin.native.js.map +1 -6
- package/dist/cjs/vite/plugins/useDomPlugin.native.js +32 -26
- package/dist/cjs/vite/plugins/useDomPlugin.native.js.map +1 -6
- package/dist/cjs/vite/plugins/virtualEntryConstants.native.js +24 -20
- package/dist/cjs/vite/plugins/virtualEntryConstants.native.js.map +1 -6
- package/dist/cjs/vite/plugins/virtualEntryPlugin.native.js +38 -45
- package/dist/cjs/vite/plugins/virtualEntryPlugin.native.js.map +1 -6
- package/dist/cjs/vite/replaceLoader.native.js +26 -20
- package/dist/cjs/vite/replaceLoader.native.js.map +1 -6
- package/dist/cjs/vite/resolveResponse.native.js +59 -42
- package/dist/cjs/vite/resolveResponse.native.js.map +1 -6
- package/dist/cjs/vite/types.native.js +9 -5
- package/dist/cjs/vite/types.native.js.map +1 -6
- package/dist/cjs/vite.native.js +26 -22
- package/dist/cjs/vite.native.js.map +1 -6
- package/dist/cjs/zero/getQueryKey.native.js +18 -15
- package/dist/cjs/zero/getQueryKey.native.js.map +1 -6
- package/dist/cjs/zero/isZeroQuery.native.js +23 -15
- package/dist/cjs/zero/isZeroQuery.native.js.map +1 -6
- package/dist/cjs/zero/resolveQuery.native.js +23 -19
- package/dist/cjs/zero/resolveQuery.native.js.map +1 -6
- package/dist/cjs/zero/subscribeToQuery.native.js +18 -15
- package/dist/cjs/zero/subscribeToQuery.native.js.map +1 -6
- package/dist/cjs/zero/types.native.js +9 -5
- package/dist/cjs/zero/types.native.js.map +1 -6
- package/dist/cjs/zero/useQuery.js +2 -2
- package/dist/cjs/zero/useQuery.js.map +1 -1
- package/dist/cjs/zero/useQuery.native.js +30 -19
- package/dist/cjs/zero/useQuery.native.js.map +1 -6
- package/dist/cjs/zero/useQueryZero.native.js +35 -34
- package/dist/cjs/zero/useQueryZero.native.js.map +1 -6
- package/dist/cjs/zero.native.js +20 -17
- package/dist/cjs/zero.native.js.map +1 -6
- package/dist/esm/cli/build.native.js +2 -2
- package/dist/esm/cli/build.native.js.map +1 -1
- package/dist/esm/cli/buildPage.native.js +5 -2
- package/dist/esm/cli/buildPage.native.js.map +1 -1
- package/dist/esm/cli/label-process.native.js +1 -1
- package/dist/esm/cli/main.native.js +2 -2
- package/dist/esm/cli.native.js +3 -3
- package/dist/esm/createApp.native.js.map +1 -1
- package/dist/esm/fork/__tests__/getPathFromState.test.js +3 -3
- package/dist/esm/fork/__tests__/getPathFromState.test.js.map +1 -1
- package/dist/esm/fork/__tests__/getPathFromState.test.mjs +9 -10
- package/dist/esm/fork/__tests__/getPathFromState.test.mjs.map +1 -1
- package/dist/esm/fork/__tests__/getPathFromState.test.native.js.map +1 -1
- package/dist/esm/fork/__tests__/getStateFromPath.test.js +5 -5
- package/dist/esm/fork/__tests__/getStateFromPath.test.js.map +1 -1
- package/dist/esm/fork/__tests__/getStateFromPath.test.mjs +5 -7
- package/dist/esm/fork/__tests__/getStateFromPath.test.mjs.map +1 -1
- package/dist/esm/fork/__tests__/getStateFromPath.test.native.js.map +1 -1
- package/dist/esm/fork/getStateFromPath.native.js +6 -1
- package/dist/esm/fork/getStateFromPath.native.js.map +1 -1
- package/dist/esm/fork/useBackButton.native.js.map +1 -1
- package/dist/esm/fork/useDocumentTitle.native.js.map +1 -1
- package/dist/esm/fork/useLinking.native.js +6 -1
- package/dist/esm/fork/useLinking.native.js.map +1 -1
- package/dist/esm/fork/validatePathConfig.native.js +7 -2
- package/dist/esm/fork/validatePathConfig.native.js.map +1 -1
- package/dist/esm/getURL.native.js.map +1 -1
- package/dist/esm/head/Head.android.js.map +1 -1
- package/dist/esm/head/Head.ios.js +7 -2
- package/dist/esm/head/Head.ios.js.map +1 -1
- package/dist/esm/head/url.js +2 -2
- package/dist/esm/head/url.js.map +1 -1
- package/dist/esm/head/url.native.js.map +1 -1
- package/dist/esm/import-mode/index.android.js.map +1 -1
- package/dist/esm/import-mode/index.ios.js.map +1 -1
- package/dist/esm/import-mode/index.native.js.map +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.native.js +2 -2
- package/dist/esm/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
- package/dist/esm/render.native.js.map +1 -1
- package/dist/esm/router/filterRootHTML.native.js +6 -1
- package/dist/esm/router/filterRootHTML.native.js.map +1 -1
- package/dist/esm/router/router.native.js +6 -1
- package/dist/esm/router/router.native.js.map +1 -1
- package/dist/esm/router/useScreens.native.js +7 -4
- package/dist/esm/router/useScreens.native.js.map +1 -1
- package/dist/esm/server/oneServe.native.js +1 -1
- package/dist/esm/testing-utils.native.js +1 -1
- package/dist/esm/typed-routes/generateRouteTypes.native.js +2 -2
- package/dist/esm/useLoader.native.js +5 -2
- package/dist/esm/useLoader.native.js.map +1 -1
- package/dist/esm/utils/existsAsync.native.js +1 -1
- package/dist/esm/utils/getPathnameFromFilePath.native.js +1 -1
- package/dist/esm/utils/isResponse.native.js +4 -1
- package/dist/esm/utils/isResponse.native.js.map +1 -1
- package/dist/esm/utils/toAbsolute.native.js +1 -1
- package/dist/esm/utils/withStaticProperties.native.js +6 -1
- package/dist/esm/utils/withStaticProperties.native.js.map +1 -1
- package/dist/esm/vercel/build/buildVercelOutputDirectory.native.js +1 -1
- package/dist/esm/vercel/build/generate/createApiServerlessFunction.native.js +1 -1
- package/dist/esm/vercel/build/generate/createSsrServerlessFunction.native.js +1 -1
- package/dist/esm/views/PreloadLinks.native.js.map +1 -1
- package/dist/esm/views/RootErrorBoundary.native.js +4 -1
- package/dist/esm/vite/customNodeExternals.native.js +2 -2
- package/dist/esm/vite/ensureTsConfig.native.js +1 -1
- package/dist/esm/vite/findDepsToOptimize.native.js +3 -3
- package/dist/esm/vite/one-server-only.native.js.map +1 -1
- package/dist/esm/vite/one.native.js +8 -3
- package/dist/esm/vite/one.native.js.map +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js +8 -5
- package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js +8 -5
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/fixDependenciesPlugin.native.js +6 -1
- package/dist/esm/vite/plugins/fixDependenciesPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.native.js +1 -1
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/useDomPlugin.native.js +1 -1
- package/dist/esm/vite/resolveResponse.native.js +9 -1
- package/dist/esm/vite/resolveResponse.native.js.map +1 -1
- package/dist/esm/zero/isZeroQuery.native.js +6 -1
- package/dist/esm/zero/isZeroQuery.native.js.map +1 -1
- package/dist/esm/zero/useQuery.js +2 -2
- package/dist/esm/zero/useQuery.js.map +1 -1
- package/dist/esm/zero/useQuery.native.js.map +1 -1
- package/package.json +10 -10
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf,
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
8
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: !0
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
__copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
16
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
23
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
24
|
// file that has been converted to a CommonJS file using a Babel-
|
|
19
25
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
26
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: !0
|
|
30
|
+
}) : target, mod)),
|
|
31
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: !0
|
|
33
|
+
}), mod);
|
|
24
34
|
var useScreens_exports = {};
|
|
25
35
|
__export(useScreens_exports, {
|
|
26
36
|
Group: () => Group,
|
|
@@ -30,18 +40,30 @@ __export(useScreens_exports, {
|
|
|
30
40
|
useSortedScreens: () => useSortedScreens
|
|
31
41
|
});
|
|
32
42
|
module.exports = __toCommonJS(useScreens_exports);
|
|
33
|
-
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
43
|
+
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
44
|
+
import_react = require("react"),
|
|
45
|
+
import_core = require("@react-navigation/core"),
|
|
46
|
+
import_elements = require("@react-navigation/elements"),
|
|
47
|
+
import_react2 = __toESM(require("react"), 1),
|
|
48
|
+
import_react_native = require("react-native"),
|
|
49
|
+
import_ServerContextScript = require("../server/ServerContextScript.native.js"),
|
|
50
|
+
import_getPageExport = require("../utils/getPageExport.native.js"),
|
|
51
|
+
import_EmptyRoute = require("../views/EmptyRoute.native.js"),
|
|
52
|
+
import_Try = require("../views/Try.native.js"),
|
|
53
|
+
import_DevHead = require("../vite/DevHead.native.js"),
|
|
54
|
+
import_one_server_only = require("../vite/one-server-only.native.js"),
|
|
55
|
+
import_filterRootHTML = require("./filterRootHTML.native.js"),
|
|
56
|
+
import_Route = require("./Route.native.js"),
|
|
57
|
+
import_sortRoutes = require("./sortRoutes.native.js");
|
|
34
58
|
function _assert_this_initialized(self) {
|
|
35
|
-
if (self === void 0)
|
|
36
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
59
|
+
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
37
60
|
return self;
|
|
38
61
|
}
|
|
39
62
|
function _call_super(_this, derived, args) {
|
|
40
63
|
return derived = _get_prototype_of(derived), _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
41
64
|
}
|
|
42
65
|
function _class_call_check(instance, Constructor) {
|
|
43
|
-
if (!(instance instanceof Constructor))
|
|
44
|
-
throw new TypeError("Cannot call a class as a function");
|
|
66
|
+
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
|
|
45
67
|
}
|
|
46
68
|
function _defineProperties(target, props) {
|
|
47
69
|
for (var i = 0; i < props.length; i++) {
|
|
@@ -53,13 +75,12 @@ function _create_class(Constructor, protoProps, staticProps) {
|
|
|
53
75
|
return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
|
|
54
76
|
}
|
|
55
77
|
function _get_prototype_of(o) {
|
|
56
|
-
return _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function(o2) {
|
|
78
|
+
return _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function (o2) {
|
|
57
79
|
return o2.__proto__ || Object.getPrototypeOf(o2);
|
|
58
80
|
}, _get_prototype_of(o);
|
|
59
81
|
}
|
|
60
82
|
function _inherits(subClass, superClass) {
|
|
61
|
-
if (typeof superClass != "function" && superClass !== null)
|
|
62
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
83
|
+
if (typeof superClass != "function" && superClass !== null) throw new TypeError("Super expression must either be null or a function");
|
|
63
84
|
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
64
85
|
constructor: {
|
|
65
86
|
value: subClass,
|
|
@@ -68,68 +89,77 @@ function _inherits(subClass, superClass) {
|
|
|
68
89
|
}
|
|
69
90
|
}), superClass && _set_prototype_of(subClass, superClass);
|
|
70
91
|
}
|
|
92
|
+
function _instanceof(left, right) {
|
|
93
|
+
return right != null && typeof Symbol < "u" && right[Symbol.hasInstance] ? !!right[Symbol.hasInstance](left) : left instanceof right;
|
|
94
|
+
}
|
|
71
95
|
function _possible_constructor_return(self, call) {
|
|
72
96
|
return call && (_type_of(call) === "object" || typeof call == "function") ? call : _assert_this_initialized(self);
|
|
73
97
|
}
|
|
74
98
|
function _set_prototype_of(o, p) {
|
|
75
|
-
return _set_prototype_of = Object.setPrototypeOf || function(o2, p2) {
|
|
99
|
+
return _set_prototype_of = Object.setPrototypeOf || function (o2, p2) {
|
|
76
100
|
return o2.__proto__ = p2, o2;
|
|
77
101
|
}, _set_prototype_of(o, p);
|
|
78
102
|
}
|
|
79
103
|
function _type_of(obj) {
|
|
80
104
|
"@swc/helpers - typeof";
|
|
105
|
+
|
|
81
106
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
82
107
|
}
|
|
83
108
|
function _is_native_reflect_construct() {
|
|
84
109
|
try {
|
|
85
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
return (_is_native_reflect_construct = function() {
|
|
110
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
111
|
+
} catch {}
|
|
112
|
+
return (_is_native_reflect_construct = function () {
|
|
90
113
|
return !!result;
|
|
91
114
|
})();
|
|
92
115
|
}
|
|
93
|
-
var {
|
|
116
|
+
var {
|
|
117
|
+
Screen,
|
|
118
|
+
Group
|
|
119
|
+
} = (0, import_core.createNavigatorFactory)({})();
|
|
94
120
|
function getSortedChildren(children, order, initialRouteName, options) {
|
|
95
|
-
if (!
|
|
96
|
-
return children.sort((0, import_sortRoutes.sortRoutesWithInitial)(initialRouteName)).map(function(route) {
|
|
97
|
-
return {
|
|
98
|
-
route,
|
|
99
|
-
props: {}
|
|
100
|
-
};
|
|
101
|
-
});
|
|
102
|
-
var entries = [
|
|
103
|
-
...children
|
|
104
|
-
], ordered = order.map(function(param) {
|
|
105
|
-
var { name, redirect, initialParams, listeners, options: _$options, getId } = param;
|
|
106
|
-
if (!entries.length)
|
|
107
|
-
return console.warn(`[Layout children]: Too many screens defined. Route "${name}" is extraneous.`), null;
|
|
108
|
-
var matchIndex = entries.findIndex(function(child) {
|
|
109
|
-
return child.route === name;
|
|
110
|
-
});
|
|
111
|
-
if (matchIndex === -1)
|
|
112
|
-
return console.warn(`[Layout children]: No route named "${name}" exists in nested children:`, children.map(function(param2) {
|
|
113
|
-
var { route } = param2;
|
|
114
|
-
return route;
|
|
115
|
-
})), null;
|
|
116
|
-
var match = entries[matchIndex];
|
|
117
|
-
if (entries.splice(matchIndex, 1), redirect) {
|
|
118
|
-
if (typeof redirect == "string")
|
|
119
|
-
throw new Error("Redirecting to a specific route is not supported yet.");
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
121
|
+
if (!order?.length) return children.sort((0, import_sortRoutes.sortRoutesWithInitial)(initialRouteName)).map(function (route) {
|
|
122
122
|
return {
|
|
123
|
-
route
|
|
124
|
-
props: {
|
|
123
|
+
route,
|
|
124
|
+
props: {}
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
var entries = [...children],
|
|
128
|
+
ordered = order.map(function (param) {
|
|
129
|
+
var {
|
|
130
|
+
name,
|
|
131
|
+
redirect,
|
|
125
132
|
initialParams,
|
|
126
133
|
listeners,
|
|
127
134
|
options: _$options,
|
|
128
135
|
getId
|
|
136
|
+
} = param;
|
|
137
|
+
if (!entries.length) return console.warn(`[Layout children]: Too many screens defined. Route "${name}" is extraneous.`), null;
|
|
138
|
+
var matchIndex = entries.findIndex(function (child) {
|
|
139
|
+
return child.route === name;
|
|
140
|
+
});
|
|
141
|
+
if (matchIndex === -1) return console.warn(`[Layout children]: No route named "${name}" exists in nested children:`, children.map(function (param2) {
|
|
142
|
+
var {
|
|
143
|
+
route
|
|
144
|
+
} = param2;
|
|
145
|
+
return route;
|
|
146
|
+
})), null;
|
|
147
|
+
var match = entries[matchIndex];
|
|
148
|
+
if (entries.splice(matchIndex, 1), redirect) {
|
|
149
|
+
if (typeof redirect == "string") throw new Error("Redirecting to a specific route is not supported yet.");
|
|
150
|
+
return null;
|
|
129
151
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
152
|
+
return {
|
|
153
|
+
route: match,
|
|
154
|
+
props: {
|
|
155
|
+
initialParams,
|
|
156
|
+
listeners,
|
|
157
|
+
options: _$options,
|
|
158
|
+
getId
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}).filter(Boolean);
|
|
162
|
+
return options?.onlyMatching || ordered.push(...entries.sort((0, import_sortRoutes.sortRoutesWithInitial)(initialRouteName)).map(function (route) {
|
|
133
163
|
return {
|
|
134
164
|
route,
|
|
135
165
|
props: {}
|
|
@@ -137,95 +167,111 @@ function getSortedChildren(children, order, initialRouteName, options) {
|
|
|
137
167
|
})), ordered;
|
|
138
168
|
}
|
|
139
169
|
function useSortedScreens(order, options) {
|
|
140
|
-
var node = (0, import_Route.useRouteNode)(),
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
node
|
|
148
|
-
order
|
|
149
|
-
]);
|
|
170
|
+
var node = (0, import_Route.useRouteNode)(),
|
|
171
|
+
sortedScreens = import_react2.default.useMemo(function () {
|
|
172
|
+
var _node_children,
|
|
173
|
+
sorted = !(node == null || (_node_children = node.children) === null || _node_children === void 0) && _node_children.length ? getSortedChildren(node.children, order, node.initialRouteName, options) : [];
|
|
174
|
+
return sorted.map(function (value) {
|
|
175
|
+
return routeToScreen(value.route, value.props);
|
|
176
|
+
});
|
|
177
|
+
}, [node?.children, node?.initialRouteName, order]);
|
|
150
178
|
return sortedScreens;
|
|
151
179
|
}
|
|
152
180
|
function fromImport(param) {
|
|
153
|
-
var {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
181
|
+
var {
|
|
182
|
+
ErrorBoundary,
|
|
183
|
+
...component
|
|
184
|
+
} = param;
|
|
185
|
+
if (ErrorBoundary) return {
|
|
186
|
+
default: /* @__PURE__ */import_react2.default.forwardRef(function (props, ref) {
|
|
187
|
+
var children = /* @__PURE__ */import_react2.default.createElement((0, import_getPageExport.getPageExport)(component) || import_EmptyRoute.EmptyRoute, {
|
|
188
|
+
...props,
|
|
189
|
+
ref
|
|
190
|
+
});
|
|
191
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Try.Try, {
|
|
192
|
+
catch: ErrorBoundary,
|
|
193
|
+
children
|
|
194
|
+
});
|
|
195
|
+
})
|
|
196
|
+
};
|
|
167
197
|
if (process.env.NODE_ENV !== "production") {
|
|
168
198
|
var exported = (0, import_getPageExport.getPageExport)(component);
|
|
169
|
-
if (exported && typeof exported
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
};
|
|
199
|
+
if (exported && (typeof exported > "u" ? "undefined" : _type_of(exported)) === "object" && Object.keys(exported).length === 0) return {
|
|
200
|
+
default: import_EmptyRoute.EmptyRoute
|
|
201
|
+
};
|
|
173
202
|
}
|
|
174
203
|
return {
|
|
175
204
|
default: (0, import_getPageExport.getPageExport)(component)
|
|
176
205
|
};
|
|
177
206
|
}
|
|
178
|
-
var qualifiedStore = /* @__PURE__ */
|
|
207
|
+
var qualifiedStore = /* @__PURE__ */new WeakMap();
|
|
179
208
|
function getQualifiedRouteComponent(value) {
|
|
180
|
-
if (value && qualifiedStore.has(value))
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
route,
|
|
205
|
-
navigation,
|
|
206
|
-
// Pass all other props to the component
|
|
207
|
-
...props
|
|
208
|
-
} = param;
|
|
209
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Route.Route, {
|
|
210
|
-
route,
|
|
211
|
-
node: value,
|
|
212
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
213
|
-
children: wrapSuspense(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScreenComponent, {
|
|
209
|
+
if (value && qualifiedStore.has(value)) return qualifiedStore.get(value);
|
|
210
|
+
var ScreenComponent = /* @__PURE__ */import_react2.default.forwardRef(function (props, ref) {
|
|
211
|
+
var res = value.loadRoute(),
|
|
212
|
+
Component = (0, import_getPageExport.getPageExport)(fromImport(res));
|
|
213
|
+
if (process.env.NODE_ENV === "development" && process.env.DEBUG === "one" && (console.groupCollapsed(`Render ${props.key} ${props.segment}`), console.info("value", value), console.info("Component", Component), console.groupEnd()), props.segment === "") {
|
|
214
|
+
var _serverContext_css,
|
|
215
|
+
out = Component(props, ref),
|
|
216
|
+
{
|
|
217
|
+
children,
|
|
218
|
+
bodyProps,
|
|
219
|
+
head,
|
|
220
|
+
htmlProps
|
|
221
|
+
} = (0, import_filterRootHTML.filterRootHTML)(out),
|
|
222
|
+
{
|
|
223
|
+
children: headChildren,
|
|
224
|
+
...headProps
|
|
225
|
+
} = head?.props || {},
|
|
226
|
+
serverContext = (0, import_one_server_only.useServerContext)(),
|
|
227
|
+
finalChildren = children;
|
|
228
|
+
return finalChildren;
|
|
229
|
+
}
|
|
230
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(RouteErrorBoundary, {
|
|
231
|
+
routeName: value.route,
|
|
232
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(Component, {
|
|
214
233
|
...props,
|
|
215
|
-
ref
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
234
|
+
ref
|
|
235
|
+
})
|
|
236
|
+
});
|
|
237
|
+
}),
|
|
238
|
+
wrapSuspense = function (children) {
|
|
239
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.Suspense, {
|
|
240
|
+
fallback: null,
|
|
241
|
+
children
|
|
242
|
+
});
|
|
243
|
+
},
|
|
244
|
+
QualifiedRoute = /* @__PURE__ */import_react2.default.forwardRef(function (param, ref) {
|
|
245
|
+
var {
|
|
246
|
+
// Remove these React Navigation props to
|
|
247
|
+
// enforce usage of router hooks (where the query params are correct).
|
|
248
|
+
route,
|
|
249
|
+
navigation,
|
|
250
|
+
// Pass all other props to the component
|
|
251
|
+
...props
|
|
252
|
+
} = param;
|
|
253
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Route.Route, {
|
|
254
|
+
route,
|
|
255
|
+
node: value,
|
|
256
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
257
|
+
children: wrapSuspense(/* @__PURE__ */(0, import_jsx_runtime.jsx)(ScreenComponent, {
|
|
258
|
+
...props,
|
|
259
|
+
ref,
|
|
260
|
+
// Expose the template segment path, e.g. `(home)`, `[foo]`, `index`
|
|
261
|
+
// the intention is to make it possible to deduce shared routes.
|
|
262
|
+
segment: value.route
|
|
263
|
+
}))
|
|
264
|
+
})
|
|
265
|
+
});
|
|
221
266
|
});
|
|
222
|
-
});
|
|
223
|
-
return QualifiedRoute.displayName = `Route(${value.route})`, qualifiedStore.set(value, QualifiedRoute), /* @__PURE__ */ (0, import_react2.memo)(QualifiedRoute);
|
|
267
|
+
return QualifiedRoute.displayName = `Route(${value.route})`, qualifiedStore.set(value, QualifiedRoute), /* @__PURE__ */(0, import_react2.memo)(QualifiedRoute);
|
|
224
268
|
}
|
|
225
269
|
function createGetIdForRoute(route) {
|
|
226
|
-
var include = /* @__PURE__ */
|
|
270
|
+
var include = /* @__PURE__ */new Map();
|
|
227
271
|
if (route.dynamic) {
|
|
228
|
-
var _iteratorNormalCompletion = !0,
|
|
272
|
+
var _iteratorNormalCompletion = !0,
|
|
273
|
+
_didIteratorError = !1,
|
|
274
|
+
_iteratorError = void 0;
|
|
229
275
|
try {
|
|
230
276
|
for (var _iterator = route.dynamic[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
231
277
|
var segment = _step.value;
|
|
@@ -237,16 +283,22 @@ function createGetIdForRoute(route) {
|
|
|
237
283
|
try {
|
|
238
284
|
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
239
285
|
} finally {
|
|
240
|
-
if (_didIteratorError)
|
|
241
|
-
throw _iteratorError;
|
|
286
|
+
if (_didIteratorError) throw _iteratorError;
|
|
242
287
|
}
|
|
243
288
|
}
|
|
244
289
|
}
|
|
245
|
-
return function() {
|
|
246
|
-
var {
|
|
290
|
+
return function () {
|
|
291
|
+
var {
|
|
292
|
+
params = {}
|
|
293
|
+
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {},
|
|
294
|
+
segments = [],
|
|
295
|
+
_iteratorNormalCompletion2 = !0,
|
|
296
|
+
_didIteratorError2 = !1,
|
|
297
|
+
_iteratorError2 = void 0;
|
|
247
298
|
try {
|
|
248
299
|
for (var _iterator2 = include.values()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
|
|
249
|
-
var dynamic = _step2.value,
|
|
300
|
+
var dynamic = _step2.value,
|
|
301
|
+
value = params?.[dynamic.name];
|
|
250
302
|
Array.isArray(value) && value.length > 0 ? segments.push(value.join("/")) : value && !Array.isArray(value) ? segments.push(value) : dynamic.deep ? segments.push(`[...${dynamic.name}]`) : segments.push(`[${dynamic.name}]`);
|
|
251
303
|
}
|
|
252
304
|
} catch (err) {
|
|
@@ -255,8 +307,7 @@ function createGetIdForRoute(route) {
|
|
|
255
307
|
try {
|
|
256
308
|
!_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
|
|
257
309
|
} finally {
|
|
258
|
-
if (_didIteratorError2)
|
|
259
|
-
throw _iteratorError2;
|
|
310
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
260
311
|
}
|
|
261
312
|
}
|
|
262
313
|
var _segments_join;
|
|
@@ -264,19 +315,26 @@ function createGetIdForRoute(route) {
|
|
|
264
315
|
};
|
|
265
316
|
}
|
|
266
317
|
function routeToScreen(route) {
|
|
267
|
-
var {
|
|
268
|
-
|
|
318
|
+
var {
|
|
319
|
+
options,
|
|
320
|
+
...props
|
|
321
|
+
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
322
|
+
return /* @__PURE__ */(0, import_react.createElement)(Screen, {
|
|
269
323
|
// Users can override the screen getId function.
|
|
270
324
|
getId: createGetIdForRoute(route),
|
|
271
325
|
...props,
|
|
272
326
|
name: route.route,
|
|
273
327
|
key: route.route,
|
|
274
|
-
options: function(args) {
|
|
275
|
-
var _route_loadRoute,
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
328
|
+
options: function (args) {
|
|
329
|
+
var _route_loadRoute,
|
|
330
|
+
staticOptions = route.generated ? (_route_loadRoute = route.loadRoute()) === null || _route_loadRoute === void 0 ? void 0 : _route_loadRoute.getNavOptions : null,
|
|
331
|
+
staticResult = typeof staticOptions == "function" ? staticOptions(args) : staticOptions,
|
|
332
|
+
dynamicResult = typeof options == "function" ? options?.(args) : options,
|
|
333
|
+
output = {
|
|
334
|
+
...staticResult,
|
|
335
|
+
...dynamicResult
|
|
336
|
+
};
|
|
337
|
+
return route.generated && (output.tabBarButton = function () {
|
|
280
338
|
return null;
|
|
281
339
|
}, output.drawerItemStyle = {
|
|
282
340
|
height: 0,
|
|
@@ -296,30 +354,29 @@ function routeToScreen(route) {
|
|
|
296
354
|
// }
|
|
297
355
|
// return children
|
|
298
356
|
// }}
|
|
299
|
-
getComponent: function() {
|
|
357
|
+
getComponent: function () {
|
|
300
358
|
return getQualifiedRouteComponent(route);
|
|
301
359
|
}
|
|
302
360
|
});
|
|
303
361
|
}
|
|
304
362
|
var ROUTE_ERROR_BOUNDARY_INITIAL_STATE = {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
},
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
{
|
|
363
|
+
hasError: !1,
|
|
364
|
+
error: null,
|
|
365
|
+
errorInfo: null
|
|
366
|
+
},
|
|
367
|
+
RouteErrorBoundary = /* @__PURE__ */function (_React_Component) {
|
|
368
|
+
"use strict";
|
|
369
|
+
|
|
370
|
+
_inherits(RouteErrorBoundary2, _React_Component);
|
|
371
|
+
function RouteErrorBoundary2(props) {
|
|
372
|
+
_class_call_check(this, RouteErrorBoundary2);
|
|
373
|
+
var _this;
|
|
374
|
+
return _this = _call_super(this, RouteErrorBoundary2, [props]), _this.state = ROUTE_ERROR_BOUNDARY_INITIAL_STATE, _this;
|
|
375
|
+
}
|
|
376
|
+
return _create_class(RouteErrorBoundary2, [{
|
|
320
377
|
key: "componentDidCatch",
|
|
321
|
-
value: function(error, errorInfo) {
|
|
322
|
-
console.error(`Error occurred while running route "${this.props.routeName}": ${error
|
|
378
|
+
value: function (error, errorInfo) {
|
|
379
|
+
console.error(`Error occurred while running route "${this.props.routeName}": ${_instanceof(error, Error) ? error.message : error}
|
|
323
380
|
|
|
324
381
|
${error.stack}
|
|
325
382
|
|
|
@@ -328,118 +385,93 @@ ${errorInfo.componentStack}`), this.setState({
|
|
|
328
385
|
errorInfo
|
|
329
386
|
});
|
|
330
387
|
}
|
|
331
|
-
},
|
|
332
|
-
{
|
|
388
|
+
}, {
|
|
333
389
|
key: "clearError",
|
|
334
|
-
value: function() {
|
|
390
|
+
value: function () {
|
|
335
391
|
this.setState(ROUTE_ERROR_BOUNDARY_INITIAL_STATE);
|
|
336
392
|
}
|
|
337
|
-
},
|
|
338
|
-
{
|
|
393
|
+
}, {
|
|
339
394
|
key: "render",
|
|
340
|
-
value: function() {
|
|
395
|
+
value: function () {
|
|
341
396
|
if (this.state.hasError) {
|
|
342
|
-
var {
|
|
343
|
-
|
|
397
|
+
var {
|
|
398
|
+
error,
|
|
399
|
+
errorInfo
|
|
400
|
+
} = this.state;
|
|
401
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.SafeAreaView, {
|
|
344
402
|
style: {
|
|
345
403
|
backgroundColor: "#000"
|
|
346
404
|
},
|
|
347
|
-
children: /* @__PURE__ */
|
|
405
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_react_native.View, {
|
|
348
406
|
style: {
|
|
349
407
|
margin: 16,
|
|
350
408
|
gap: 16
|
|
351
409
|
},
|
|
352
|
-
children: [
|
|
353
|
-
|
|
410
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_react_native.Text, {
|
|
411
|
+
style: {
|
|
412
|
+
alignSelf: "flex-start",
|
|
413
|
+
padding: 5,
|
|
414
|
+
margin: -5,
|
|
415
|
+
backgroundColor: "red",
|
|
416
|
+
color: "white",
|
|
417
|
+
fontSize: 20,
|
|
418
|
+
fontFamily: "monospace"
|
|
419
|
+
},
|
|
420
|
+
children: ['Error on route "', this.props.routeName, '"']
|
|
421
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.Text, {
|
|
422
|
+
style: {
|
|
423
|
+
color: "white",
|
|
424
|
+
fontSize: 16,
|
|
425
|
+
fontFamily: "monospace"
|
|
426
|
+
},
|
|
427
|
+
children: _instanceof(error, Error) ? error.message : error
|
|
428
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.TouchableOpacity, {
|
|
429
|
+
onPress: this.clearError.bind(this),
|
|
430
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.Text, {
|
|
354
431
|
style: {
|
|
355
432
|
alignSelf: "flex-start",
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
backgroundColor: "
|
|
359
|
-
color: "
|
|
360
|
-
fontSize:
|
|
433
|
+
margin: -6,
|
|
434
|
+
padding: 6,
|
|
435
|
+
backgroundColor: "white",
|
|
436
|
+
color: "black",
|
|
437
|
+
fontSize: 14,
|
|
361
438
|
fontFamily: "monospace"
|
|
362
439
|
},
|
|
363
|
-
children:
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
/* @__PURE__ */
|
|
440
|
+
children: "Retry"
|
|
441
|
+
})
|
|
442
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_react_native.ScrollView, {
|
|
443
|
+
contentContainerStyle: {
|
|
444
|
+
gap: 12
|
|
445
|
+
},
|
|
446
|
+
children: [_instanceof(error, Error) ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.Text, {
|
|
370
447
|
style: {
|
|
371
448
|
color: "white",
|
|
372
|
-
fontSize:
|
|
449
|
+
fontSize: 12,
|
|
373
450
|
fontFamily: "monospace"
|
|
374
451
|
},
|
|
375
|
-
children: error
|
|
376
|
-
}),
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
alignSelf: "flex-start",
|
|
382
|
-
margin: -6,
|
|
383
|
-
padding: 6,
|
|
384
|
-
backgroundColor: "white",
|
|
385
|
-
color: "black",
|
|
386
|
-
fontSize: 14,
|
|
387
|
-
fontFamily: "monospace"
|
|
388
|
-
},
|
|
389
|
-
children: "Retry"
|
|
390
|
-
})
|
|
391
|
-
}),
|
|
392
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.ScrollView, {
|
|
393
|
-
contentContainerStyle: {
|
|
394
|
-
gap: 12
|
|
452
|
+
children: error.stack
|
|
453
|
+
}) : null, errorInfo?.componentStack ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_react_native.Text, {
|
|
454
|
+
style: {
|
|
455
|
+
color: "white",
|
|
456
|
+
fontSize: 12,
|
|
457
|
+
fontFamily: "monospace"
|
|
395
458
|
},
|
|
396
|
-
children: [
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
color: "white",
|
|
400
|
-
fontSize: 12,
|
|
401
|
-
fontFamily: "monospace"
|
|
402
|
-
},
|
|
403
|
-
children: error.stack
|
|
404
|
-
}) : null,
|
|
405
|
-
errorInfo != null && errorInfo.componentStack ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.Text, {
|
|
406
|
-
style: {
|
|
407
|
-
color: "white",
|
|
408
|
-
fontSize: 12,
|
|
409
|
-
fontFamily: "monospace"
|
|
410
|
-
},
|
|
411
|
-
children: [
|
|
412
|
-
"Component Stack: ",
|
|
413
|
-
errorInfo.componentStack
|
|
414
|
-
]
|
|
415
|
-
}) : null
|
|
416
|
-
]
|
|
417
|
-
})
|
|
418
|
-
]
|
|
459
|
+
children: ["Component Stack: ", errorInfo.componentStack]
|
|
460
|
+
}) : null]
|
|
461
|
+
})]
|
|
419
462
|
})
|
|
420
463
|
});
|
|
421
464
|
}
|
|
422
465
|
return this.props.children;
|
|
423
466
|
}
|
|
424
|
-
}
|
|
425
|
-
], [
|
|
426
|
-
{
|
|
467
|
+
}], [{
|
|
427
468
|
key: "getDerivedStateFromError",
|
|
428
|
-
value: function(error) {
|
|
469
|
+
value: function (error) {
|
|
429
470
|
return {
|
|
430
471
|
hasError: !0,
|
|
431
472
|
error
|
|
432
473
|
};
|
|
433
474
|
}
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
438
|
-
0 && (module.exports = {
|
|
439
|
-
Group,
|
|
440
|
-
Screen,
|
|
441
|
-
createGetIdForRoute,
|
|
442
|
-
getQualifiedRouteComponent,
|
|
443
|
-
useSortedScreens
|
|
444
|
-
});
|
|
445
|
-
//# sourceMappingURL=useScreens.js.map
|
|
475
|
+
}]), RouteErrorBoundary2;
|
|
476
|
+
}(import_react2.default.Component);
|
|
477
|
+
//# sourceMappingURL=useScreens.native.js.map
|