one 1.1.320 → 1.1.321
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/Root.js +182 -0
- package/dist/cjs/Route.js +45 -0
- package/dist/cjs/cleanUrl.js +41 -0
- package/dist/cjs/cli/label-process.js +25 -0
- package/dist/cjs/cli/main.js +46 -0
- package/dist/cjs/cli/patch.js +34 -0
- package/dist/cjs/cli/prebuild.js +34 -0
- package/dist/cjs/cli/run.js +52 -0
- package/dist/cjs/cli/runAndroid.js +34 -0
- package/dist/cjs/cli/runIos.js +34 -0
- package/dist/cjs/cli.js +220 -0
- package/dist/cjs/clientLoaderResolver.js +32 -0
- package/dist/cjs/config.js +27 -0
- package/dist/cjs/constants.js +28 -0
- package/dist/cjs/createApp.js +46 -0
- package/dist/cjs/createHandleRequest.js +138 -0
- package/dist/cjs/createRoute.js +37 -0
- package/dist/cjs/fallbackViews/Sitemap.js +82 -0
- package/dist/cjs/fallbackViews/Unmatched.js +58 -0
- package/dist/cjs/fork/NavigationContainer.js +85 -0
- package/dist/cjs/fork/createMemoryHistory.js +100 -0
- package/dist/cjs/fork/extractPathFromURL.js +62 -0
- package/dist/cjs/fork/findFocusedRoute.js +26 -0
- package/dist/cjs/fork/getPathFromState.js +265 -0
- package/dist/cjs/fork/getStateFromPath.js +381 -0
- package/dist/cjs/fork/useLinking.js +182 -0
- package/dist/cjs/fork/validatePathConfig.js +46 -0
- package/dist/cjs/getLinkingConfig.js +59 -0
- package/dist/cjs/getReactNavigationConfig.js +69 -0
- package/dist/cjs/getRoutes.js +294 -0
- package/dist/cjs/getURL.js +24 -0
- package/dist/cjs/head/Head.js +23 -0
- package/dist/cjs/head/HeadModule.js +22 -0
- package/dist/cjs/head/index.js +15 -0
- package/dist/cjs/head/types.js +14 -0
- package/dist/cjs/head/url.js +52 -0
- package/dist/cjs/hooks.js +99 -0
- package/dist/cjs/imperative-api.js +45 -0
- package/dist/cjs/import-mode/index.js +21 -0
- package/dist/cjs/import-mode/index.web.js +21 -0
- package/dist/cjs/index.js +65 -0
- package/dist/cjs/interfaces/router.js +23 -0
- package/dist/cjs/layouts/Drawer.js +24 -0
- package/dist/cjs/layouts/Stack.js +24 -0
- package/dist/cjs/layouts/Tabs.js +52 -0
- package/dist/cjs/layouts/withLayoutContext.js +77 -0
- package/dist/cjs/link/Link.js +98 -0
- package/dist/cjs/link/Redirect.js +31 -0
- package/dist/cjs/link/href.js +50 -0
- package/dist/cjs/link/linking.js +82 -0
- package/dist/cjs/link/path.js +65 -0
- package/dist/cjs/link/useLinkTo.js +42 -0
- package/dist/cjs/link/useLoadedNavigation.js +50 -0
- package/dist/cjs/matchers.js +68 -0
- package/dist/cjs/platform.js +21 -0
- package/dist/cjs/polyfills-mobile.js +26 -0
- package/dist/cjs/polyfills-server.js +23 -0
- package/dist/cjs/render.js +44 -0
- package/dist/cjs/router/RouterStore.js +14 -0
- package/dist/cjs/router/getNormalizedStatePath.js +50 -0
- package/dist/cjs/router/lastAction.js +25 -0
- package/dist/cjs/router/router.js +345 -0
- package/dist/cjs/router/serverLocationContext.js +22 -0
- package/dist/cjs/router/useInitializeOneRouter.js +43 -0
- package/dist/cjs/serve.js +184 -0
- package/dist/cjs/server/createRoutesManifest.js +40 -0
- package/dist/cjs/server/getServerManifest.js +109 -0
- package/dist/cjs/server-render.js +42 -0
- package/dist/cjs/sortRoutes.js +64 -0
- package/dist/cjs/typed-routes/generateRouteTypes.js +33 -0
- package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.js +83 -0
- package/dist/cjs/types.js +14 -0
- package/dist/cjs/useFocusEffect.js +79 -0
- package/dist/cjs/useLoader.js +97 -0
- package/dist/cjs/useNavigation.js +60 -0
- package/dist/cjs/useScreens.js +176 -0
- package/dist/cjs/useViteRoutes.js +77 -0
- package/dist/cjs/utils/assertIsReady.js +26 -0
- package/dist/cjs/utils/dynamicImport.js +24 -0
- package/dist/cjs/utils/existsAsync.js +28 -0
- package/dist/cjs/utils/getPageExport.js +38 -0
- package/dist/cjs/utils/globDir.js +37 -0
- package/dist/cjs/utils/hashString.js +32 -0
- package/dist/cjs/utils/isResponse.js +23 -0
- package/dist/cjs/utils/isStatus.js +23 -0
- package/dist/cjs/utils/promiseWithResolvers.js +26 -0
- package/dist/cjs/utils/rand.js +21 -0
- package/dist/cjs/utils/redirect.js +28 -0
- package/dist/cjs/utils/removeSearch.js +23 -0
- package/dist/cjs/utils/removeUndefined.js +26 -0
- package/dist/cjs/utils/url.js +31 -0
- package/dist/cjs/utils/weakKey.js +24 -0
- package/dist/cjs/utils/weakMemo.js +30 -0
- package/dist/cjs/views/EmptyRoute.js +25 -0
- package/dist/cjs/views/ErrorBoundary.js +33 -0
- package/dist/cjs/views/LoadProgressBar.js +83 -0
- package/dist/cjs/views/Navigator.js +101 -0
- package/dist/cjs/views/PreloadLinks.js +42 -0
- package/dist/cjs/views/RootErrorBoundary.js +47 -0
- package/dist/cjs/views/Screen.js +29 -0
- package/dist/cjs/views/ScrollRestoration.js +70 -0
- package/dist/cjs/views/Try.js +44 -0
- package/dist/cjs/vite/build.js +377 -0
- package/dist/cjs/vite/clientTreeShakePlugin.js +76 -0
- package/dist/cjs/vite/constants.js +22 -0
- package/dist/cjs/vite/createFileSystemRouter.cjs +2 -1
- package/dist/cjs/vite/createFileSystemRouter.js +244 -0
- package/dist/cjs/vite/createFileSystemRouter.js.map +6 -0
- package/dist/cjs/vite/createFileSystemRouter.native.js +2 -1
- package/dist/cjs/vite/createFileSystemRouter.native.js.map +2 -2
- package/dist/cjs/vite/customNodeExternals.js +52 -0
- package/dist/cjs/vite/ensureTsConfig.js +66 -0
- package/dist/cjs/vite/findDepsToOptimize.js +66 -0
- package/dist/cjs/vite/fixDependenciesPlugin.js +43 -0
- package/dist/cjs/vite/generateTypesForRoutes.js +36 -0
- package/dist/cjs/vite/getManifest.js +27 -0
- package/dist/cjs/vite/headers.js +39 -0
- package/dist/cjs/vite/makePluginWebOnly.js +27 -0
- package/dist/cjs/vite/one.js +290 -0
- package/dist/cjs/vite/removeReactNativeWebAnimatedPlugin.js +50 -0
- package/dist/cjs/vite/replaceLoader.js +34 -0
- package/dist/cjs/vite/resolveAPIRequest.js +71 -0
- package/dist/cjs/vite/server.js +16 -0
- package/dist/cjs/vite/types.js +14 -0
- package/dist/cjs/vite/virtualEntryPlugin.js +67 -0
- package/dist/cjs/vite/vitePluginSsrCss.js +130 -0
- package/dist/cjs/vite.cjs +2 -0
- package/dist/cjs/vite.js +29 -0
- package/dist/cjs/vite.js.map +6 -0
- package/dist/cjs/vite.native.js +3 -1
- package/dist/cjs/vite.native.js.map +1 -1
- package/dist/cjs/zero/getQueryKey.js +24 -0
- package/dist/cjs/zero/isZeroQuery.js +23 -0
- package/dist/cjs/zero/resolveQuery.js +38 -0
- package/dist/cjs/zero/subscribeToQuery.js +28 -0
- package/dist/cjs/zero/types.js +14 -0
- package/dist/cjs/zero/useQuery.js +47 -0
- package/dist/cjs/zero/useQueryZero.js +38 -0
- package/dist/cjs/zero.js +23 -0
- package/dist/esm/vite/createFileSystemRouter.js +2 -1
- package/dist/esm/vite/createFileSystemRouter.js.map +1 -1
- package/dist/esm/vite/createFileSystemRouter.mjs +2 -1
- package/dist/esm/vite/createFileSystemRouter.mjs.map +1 -1
- package/dist/esm/vite/createFileSystemRouter.native.js +2 -1
- package/dist/esm/vite/createFileSystemRouter.native.js.map +2 -2
- package/dist/esm/vite.js +2 -0
- package/dist/esm/vite.js.map +1 -1
- package/dist/esm/vite.mjs +2 -1
- package/dist/esm/vite.mjs.map +1 -1
- package/dist/esm/vite.native.js +2 -0
- package/dist/esm/vite.native.js.map +2 -2
- package/package.json +8 -8
- package/src/vite/createFileSystemRouter.tsx +1 -1
- package/src/vite.ts +1 -0
- package/types/vite.d.ts +1 -0
- package/types/vite.d.ts.map +1 -1
- package/dist/cjs/createApp.native.cjs +0 -38
- package/dist/cjs/createApp.native.cjs.map +0 -6
- package/dist/cjs/fork/NavigationContainer.native.cjs +0 -103
- package/dist/cjs/fork/NavigationContainer.native.cjs.map +0 -6
- package/dist/cjs/fork/useLinking.native.cjs +0 -126
- package/dist/cjs/fork/useLinking.native.cjs.map +0 -6
- package/dist/cjs/getURL.native.cjs +0 -48
- package/dist/cjs/getURL.native.cjs.map +0 -6
- package/dist/cjs/head/Head.android.cjs +0 -28
- package/dist/cjs/head/Head.android.cjs.map +0 -6
- package/dist/cjs/head/Head.ios.cjs +0 -210
- package/dist/cjs/head/Head.ios.cjs.map +0 -6
- package/dist/cjs/import-mode/index.android.cjs +0 -26
- package/dist/cjs/import-mode/index.android.cjs.map +0 -6
- package/dist/cjs/import-mode/index.ios.cjs +0 -26
- package/dist/cjs/import-mode/index.ios.cjs.map +0 -6
- package/dist/cjs/import-mode/index.native.cjs +0 -26
- package/dist/cjs/import-mode/index.native.cjs.map +0 -6
- package/dist/cjs/render.native.cjs +0 -28
- package/dist/cjs/render.native.cjs.map +0 -6
- package/dist/cjs/views/PreloadLinks.native.cjs +0 -28
- package/dist/cjs/views/PreloadLinks.native.cjs.map +0 -6
- package/dist/cjs/vite/createFileSystemRouter.cjs.map +0 -6
- package/dist/cjs/vite/headers.native.cjs +0 -32
- package/dist/cjs/vite/headers.native.cjs.map +0 -6
- package/dist/cjs/vite.cjs.map +0 -6
- /package/dist/cjs/{Root.cjs.map → Root.js.map} +0 -0
- /package/dist/cjs/{Route.cjs.map → Route.js.map} +0 -0
- /package/dist/cjs/{cleanUrl.cjs.map → cleanUrl.js.map} +0 -0
- /package/dist/cjs/cli/{label-process.cjs.map → label-process.js.map} +0 -0
- /package/dist/cjs/cli/{main.cjs.map → main.js.map} +0 -0
- /package/dist/cjs/cli/{patch.cjs.map → patch.js.map} +0 -0
- /package/dist/cjs/cli/{prebuild.cjs.map → prebuild.js.map} +0 -0
- /package/dist/cjs/cli/{run.cjs.map → run.js.map} +0 -0
- /package/dist/cjs/cli/{runAndroid.cjs.map → runAndroid.js.map} +0 -0
- /package/dist/cjs/cli/{runIos.cjs.map → runIos.js.map} +0 -0
- /package/dist/cjs/{cli.cjs.map → cli.js.map} +0 -0
- /package/dist/cjs/{clientLoaderResolver.cjs.map → clientLoaderResolver.js.map} +0 -0
- /package/dist/cjs/{config.cjs.map → config.js.map} +0 -0
- /package/dist/cjs/{constants.cjs.map → constants.js.map} +0 -0
- /package/dist/cjs/{createApp.cjs.map → createApp.js.map} +0 -0
- /package/dist/cjs/{createHandleRequest.cjs.map → createHandleRequest.js.map} +0 -0
- /package/dist/cjs/{createRoute.cjs.map → createRoute.js.map} +0 -0
- /package/dist/cjs/fallbackViews/{Sitemap.cjs.map → Sitemap.js.map} +0 -0
- /package/dist/cjs/fallbackViews/{Unmatched.cjs.map → Unmatched.js.map} +0 -0
- /package/dist/cjs/fork/{NavigationContainer.cjs.map → NavigationContainer.js.map} +0 -0
- /package/dist/cjs/fork/{createMemoryHistory.cjs.map → createMemoryHistory.js.map} +0 -0
- /package/dist/cjs/fork/{extractPathFromURL.cjs.map → extractPathFromURL.js.map} +0 -0
- /package/dist/cjs/fork/{findFocusedRoute.cjs.map → findFocusedRoute.js.map} +0 -0
- /package/dist/cjs/fork/{getPathFromState.cjs.map → getPathFromState.js.map} +0 -0
- /package/dist/cjs/fork/{getStateFromPath.cjs.map → getStateFromPath.js.map} +0 -0
- /package/dist/cjs/fork/{useLinking.cjs.map → useLinking.js.map} +0 -0
- /package/dist/cjs/fork/{validatePathConfig.cjs.map → validatePathConfig.js.map} +0 -0
- /package/dist/cjs/{getLinkingConfig.cjs.map → getLinkingConfig.js.map} +0 -0
- /package/dist/cjs/{getReactNavigationConfig.cjs.map → getReactNavigationConfig.js.map} +0 -0
- /package/dist/cjs/{getRoutes.cjs.map → getRoutes.js.map} +0 -0
- /package/dist/cjs/{getURL.cjs.map → getURL.js.map} +0 -0
- /package/dist/cjs/head/{Head.cjs.map → Head.js.map} +0 -0
- /package/dist/cjs/head/{HeadModule.cjs.map → HeadModule.js.map} +0 -0
- /package/dist/cjs/head/{index.cjs.map → index.js.map} +0 -0
- /package/dist/cjs/head/{types.cjs.map → types.js.map} +0 -0
- /package/dist/cjs/head/{url.cjs.map → url.js.map} +0 -0
- /package/dist/cjs/{hooks.cjs.map → hooks.js.map} +0 -0
- /package/dist/cjs/{imperative-api.cjs.map → imperative-api.js.map} +0 -0
- /package/dist/cjs/import-mode/{index.cjs.map → index.js.map} +0 -0
- /package/dist/cjs/import-mode/{index.web.cjs.map → index.web.js.map} +0 -0
- /package/dist/cjs/{index.cjs.map → index.js.map} +0 -0
- /package/dist/cjs/interfaces/{router.cjs.map → router.js.map} +0 -0
- /package/dist/cjs/layouts/{Drawer.cjs.map → Drawer.js.map} +0 -0
- /package/dist/cjs/layouts/{Stack.cjs.map → Stack.js.map} +0 -0
- /package/dist/cjs/layouts/{Tabs.cjs.map → Tabs.js.map} +0 -0
- /package/dist/cjs/layouts/{withLayoutContext.cjs.map → withLayoutContext.js.map} +0 -0
- /package/dist/cjs/link/{Link.cjs.map → Link.js.map} +0 -0
- /package/dist/cjs/link/{Redirect.cjs.map → Redirect.js.map} +0 -0
- /package/dist/cjs/link/{href.cjs.map → href.js.map} +0 -0
- /package/dist/cjs/link/{linking.cjs.map → linking.js.map} +0 -0
- /package/dist/cjs/link/{path.cjs.map → path.js.map} +0 -0
- /package/dist/cjs/link/{useLinkTo.cjs.map → useLinkTo.js.map} +0 -0
- /package/dist/cjs/link/{useLoadedNavigation.cjs.map → useLoadedNavigation.js.map} +0 -0
- /package/dist/cjs/{matchers.cjs.map → matchers.js.map} +0 -0
- /package/dist/cjs/{platform.cjs.map → platform.js.map} +0 -0
- /package/dist/cjs/{polyfills-mobile.cjs.map → polyfills-mobile.js.map} +0 -0
- /package/dist/cjs/{polyfills-server.cjs.map → polyfills-server.js.map} +0 -0
- /package/dist/cjs/{render.cjs.map → render.js.map} +0 -0
- /package/dist/cjs/router/{RouterStore.cjs.map → RouterStore.js.map} +0 -0
- /package/dist/cjs/router/{getNormalizedStatePath.cjs.map → getNormalizedStatePath.js.map} +0 -0
- /package/dist/cjs/router/{lastAction.cjs.map → lastAction.js.map} +0 -0
- /package/dist/cjs/router/{router.cjs.map → router.js.map} +0 -0
- /package/dist/cjs/router/{serverLocationContext.cjs.map → serverLocationContext.js.map} +0 -0
- /package/dist/cjs/router/{useInitializeOneRouter.cjs.map → useInitializeOneRouter.js.map} +0 -0
- /package/dist/cjs/{serve.cjs.map → serve.js.map} +0 -0
- /package/dist/cjs/server/{createRoutesManifest.cjs.map → createRoutesManifest.js.map} +0 -0
- /package/dist/cjs/server/{getServerManifest.cjs.map → getServerManifest.js.map} +0 -0
- /package/dist/cjs/{server-render.cjs.map → server-render.js.map} +0 -0
- /package/dist/cjs/{sortRoutes.cjs.map → sortRoutes.js.map} +0 -0
- /package/dist/cjs/typed-routes/{generateRouteTypes.cjs.map → generateRouteTypes.js.map} +0 -0
- /package/dist/cjs/typed-routes/{getTypedRoutesDeclarationFile.cjs.map → getTypedRoutesDeclarationFile.js.map} +0 -0
- /package/dist/cjs/{types.cjs.map → types.js.map} +0 -0
- /package/dist/cjs/{useFocusEffect.cjs.map → useFocusEffect.js.map} +0 -0
- /package/dist/cjs/{useLoader.cjs.map → useLoader.js.map} +0 -0
- /package/dist/cjs/{useNavigation.cjs.map → useNavigation.js.map} +0 -0
- /package/dist/cjs/{useScreens.cjs.map → useScreens.js.map} +0 -0
- /package/dist/cjs/{useViteRoutes.cjs.map → useViteRoutes.js.map} +0 -0
- /package/dist/cjs/utils/{assertIsReady.cjs.map → assertIsReady.js.map} +0 -0
- /package/dist/cjs/utils/{dynamicImport.cjs.map → dynamicImport.js.map} +0 -0
- /package/dist/cjs/utils/{existsAsync.cjs.map → existsAsync.js.map} +0 -0
- /package/dist/cjs/utils/{getPageExport.cjs.map → getPageExport.js.map} +0 -0
- /package/dist/cjs/utils/{globDir.cjs.map → globDir.js.map} +0 -0
- /package/dist/cjs/utils/{hashString.cjs.map → hashString.js.map} +0 -0
- /package/dist/cjs/utils/{isResponse.cjs.map → isResponse.js.map} +0 -0
- /package/dist/cjs/utils/{isStatus.cjs.map → isStatus.js.map} +0 -0
- /package/dist/cjs/utils/{promiseWithResolvers.cjs.map → promiseWithResolvers.js.map} +0 -0
- /package/dist/cjs/utils/{rand.cjs.map → rand.js.map} +0 -0
- /package/dist/cjs/utils/{redirect.cjs.map → redirect.js.map} +0 -0
- /package/dist/cjs/utils/{removeSearch.cjs.map → removeSearch.js.map} +0 -0
- /package/dist/cjs/utils/{removeUndefined.cjs.map → removeUndefined.js.map} +0 -0
- /package/dist/cjs/utils/{url.cjs.map → url.js.map} +0 -0
- /package/dist/cjs/utils/{weakKey.cjs.map → weakKey.js.map} +0 -0
- /package/dist/cjs/utils/{weakMemo.cjs.map → weakMemo.js.map} +0 -0
- /package/dist/cjs/views/{EmptyRoute.cjs.map → EmptyRoute.js.map} +0 -0
- /package/dist/cjs/views/{ErrorBoundary.cjs.map → ErrorBoundary.js.map} +0 -0
- /package/dist/cjs/views/{LoadProgressBar.cjs.map → LoadProgressBar.js.map} +0 -0
- /package/dist/cjs/views/{Navigator.cjs.map → Navigator.js.map} +0 -0
- /package/dist/cjs/views/{PreloadLinks.cjs.map → PreloadLinks.js.map} +0 -0
- /package/dist/cjs/views/{RootErrorBoundary.cjs.map → RootErrorBoundary.js.map} +0 -0
- /package/dist/cjs/views/{Screen.cjs.map → Screen.js.map} +0 -0
- /package/dist/cjs/views/{ScrollRestoration.cjs.map → ScrollRestoration.js.map} +0 -0
- /package/dist/cjs/views/{Try.cjs.map → Try.js.map} +0 -0
- /package/dist/cjs/vite/{build.cjs.map → build.js.map} +0 -0
- /package/dist/cjs/vite/{clientTreeShakePlugin.cjs.map → clientTreeShakePlugin.js.map} +0 -0
- /package/dist/cjs/vite/{constants.cjs.map → constants.js.map} +0 -0
- /package/dist/cjs/vite/{customNodeExternals.cjs.map → customNodeExternals.js.map} +0 -0
- /package/dist/cjs/vite/{ensureTsConfig.cjs.map → ensureTsConfig.js.map} +0 -0
- /package/dist/cjs/vite/{findDepsToOptimize.cjs.map → findDepsToOptimize.js.map} +0 -0
- /package/dist/cjs/vite/{fixDependenciesPlugin.cjs.map → fixDependenciesPlugin.js.map} +0 -0
- /package/dist/cjs/vite/{generateTypesForRoutes.cjs.map → generateTypesForRoutes.js.map} +0 -0
- /package/dist/cjs/vite/{getManifest.cjs.map → getManifest.js.map} +0 -0
- /package/dist/cjs/vite/{headers.cjs.map → headers.js.map} +0 -0
- /package/dist/cjs/vite/{makePluginWebOnly.cjs.map → makePluginWebOnly.js.map} +0 -0
- /package/dist/cjs/vite/{one.cjs.map → one.js.map} +0 -0
- /package/dist/cjs/vite/{removeReactNativeWebAnimatedPlugin.cjs.map → removeReactNativeWebAnimatedPlugin.js.map} +0 -0
- /package/dist/cjs/vite/{replaceLoader.cjs.map → replaceLoader.js.map} +0 -0
- /package/dist/cjs/vite/{resolveAPIRequest.cjs.map → resolveAPIRequest.js.map} +0 -0
- /package/dist/cjs/vite/{server.cjs.map → server.js.map} +0 -0
- /package/dist/cjs/vite/{types.cjs.map → types.js.map} +0 -0
- /package/dist/cjs/vite/{virtualEntryPlugin.cjs.map → virtualEntryPlugin.js.map} +0 -0
- /package/dist/cjs/vite/{vitePluginSsrCss.cjs.map → vitePluginSsrCss.js.map} +0 -0
- /package/dist/cjs/zero/{getQueryKey.cjs.map → getQueryKey.js.map} +0 -0
- /package/dist/cjs/zero/{isZeroQuery.cjs.map → isZeroQuery.js.map} +0 -0
- /package/dist/cjs/zero/{resolveQuery.cjs.map → resolveQuery.js.map} +0 -0
- /package/dist/cjs/zero/{subscribeToQuery.cjs.map → subscribeToQuery.js.map} +0 -0
- /package/dist/cjs/zero/{types.cjs.map → types.js.map} +0 -0
- /package/dist/cjs/zero/{useQuery.cjs.map → useQuery.js.map} +0 -0
- /package/dist/cjs/zero/{useQueryZero.cjs.map → useQueryZero.js.map} +0 -0
- /package/dist/cjs/{zero.cjs.map → zero.js.map} +0 -0
@@ -0,0 +1,85 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
7
|
+
for (var name in all)
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
11
|
+
for (let key of __getOwnPropNames(from))
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
13
|
+
return to;
|
14
|
+
};
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
16
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
17
|
+
// file that has been converted to a CommonJS file using a Babel-
|
18
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
19
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
21
|
+
mod
|
22
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
23
|
+
var NavigationContainer_exports = {};
|
24
|
+
__export(NavigationContainer_exports, {
|
25
|
+
default: () => NavigationContainer_default
|
26
|
+
});
|
27
|
+
module.exports = __toCommonJS(NavigationContainer_exports);
|
28
|
+
var import_core = require("@react-navigation/core"), import_native = require("@react-navigation/native"), React = __toESM(require("react"), 1), import_useLinking = __toESM(require("./useLinking"), 1), import_jsx_runtime = require("react/jsx-runtime");
|
29
|
+
global.REACT_NAVIGATION_DEVTOOLS = /* @__PURE__ */ new WeakMap();
|
30
|
+
function NavigationContainerInner({
|
31
|
+
theme = import_native.DefaultTheme,
|
32
|
+
linking,
|
33
|
+
fallback = null,
|
34
|
+
documentTitle,
|
35
|
+
onReady,
|
36
|
+
...rest
|
37
|
+
}, ref) {
|
38
|
+
const isLinkingEnabled = linking ? linking.enabled !== !1 : !1;
|
39
|
+
linking?.config && (0, import_core.validatePathConfig)(linking.config);
|
40
|
+
const refContainer = React.useRef(null), { getInitialState } = (0, import_useLinking.default)(refContainer, {
|
41
|
+
independent: rest.independent,
|
42
|
+
enabled: isLinkingEnabled,
|
43
|
+
prefixes: [],
|
44
|
+
...linking
|
45
|
+
});
|
46
|
+
if (React.useEffect(() => {
|
47
|
+
refContainer.current && REACT_NAVIGATION_DEVTOOLS.set(refContainer.current, {
|
48
|
+
get linking() {
|
49
|
+
return {
|
50
|
+
...linking,
|
51
|
+
enabled: isLinkingEnabled,
|
52
|
+
prefixes: linking?.prefixes ?? [],
|
53
|
+
getStateFromPath: linking?.getStateFromPath ?? import_core.getStateFromPath,
|
54
|
+
getPathFromState: linking?.getPathFromState ?? import_core.getPathFromState,
|
55
|
+
getActionFromState: linking?.getActionFromState ?? import_core.getActionFromState
|
56
|
+
};
|
57
|
+
}
|
58
|
+
});
|
59
|
+
}), cache.val === 0 && (cache.promise = new Promise((res) => {
|
60
|
+
getInitialState().then((val) => {
|
61
|
+
cache.val = val, cache.done = !0, res();
|
62
|
+
});
|
63
|
+
})), !cache.done)
|
64
|
+
throw cache.promise;
|
65
|
+
const initialState = cache.val;
|
66
|
+
React.useImperativeHandle(ref, () => refContainer.current);
|
67
|
+
const linkingContext = React.useMemo(() => ({ options: linking }), [linking]);
|
68
|
+
return React.useEffect(() => {
|
69
|
+
onReady?.();
|
70
|
+
}, [onReady]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_native.LinkingContext.Provider, { value: linkingContext, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_native.ThemeProvider, { value: theme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
71
|
+
import_core.BaseNavigationContainer,
|
72
|
+
{
|
73
|
+
...rest,
|
74
|
+
initialState: rest.initialState == null ? initialState : rest.initialState,
|
75
|
+
ref: refContainer
|
76
|
+
}
|
77
|
+
) }) });
|
78
|
+
}
|
79
|
+
const cache = {
|
80
|
+
done: !1,
|
81
|
+
promise: null,
|
82
|
+
val: 0
|
83
|
+
}, NavigationContainer = React.forwardRef(NavigationContainerInner);
|
84
|
+
var NavigationContainer_default = NavigationContainer;
|
85
|
+
//# sourceMappingURL=NavigationContainer.js.map
|
@@ -0,0 +1,100 @@
|
|
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)
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
10
|
+
for (let key of __getOwnPropNames(from))
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
12
|
+
return to;
|
13
|
+
};
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
15
|
+
var createMemoryHistory_exports = {};
|
16
|
+
__export(createMemoryHistory_exports, {
|
17
|
+
default: () => createMemoryHistory
|
18
|
+
});
|
19
|
+
module.exports = __toCommonJS(createMemoryHistory_exports);
|
20
|
+
var import_non_secure = require("nanoid/non-secure");
|
21
|
+
function createMemoryHistory() {
|
22
|
+
let index = 0, items = [];
|
23
|
+
const pending = [], interrupt = () => {
|
24
|
+
pending.forEach((it) => {
|
25
|
+
const cb = it.cb;
|
26
|
+
it.cb = () => cb(!0);
|
27
|
+
});
|
28
|
+
};
|
29
|
+
return {
|
30
|
+
get index() {
|
31
|
+
const id = window.history.state?.id;
|
32
|
+
if (id) {
|
33
|
+
const index2 = items.findIndex((item) => item.id === id);
|
34
|
+
return index2 > -1 ? index2 : 0;
|
35
|
+
}
|
36
|
+
return 0;
|
37
|
+
},
|
38
|
+
get(index2) {
|
39
|
+
return items[index2];
|
40
|
+
},
|
41
|
+
backIndex({ path }) {
|
42
|
+
for (let i = index - 1; i >= 0; i--)
|
43
|
+
if (items[i].path === path)
|
44
|
+
return i;
|
45
|
+
return -1;
|
46
|
+
},
|
47
|
+
push({ path, state }) {
|
48
|
+
interrupt();
|
49
|
+
const id = (0, import_non_secure.nanoid)();
|
50
|
+
items = items.slice(0, index + 1), items.push({ path, state, id }), index = items.length - 1, window.history.pushState({ id }, "", path);
|
51
|
+
},
|
52
|
+
replace({ path, state }) {
|
53
|
+
interrupt();
|
54
|
+
const id = window.history.state?.id ?? (0, import_non_secure.nanoid)();
|
55
|
+
let pathWithHash = path;
|
56
|
+
!items.length || items.findIndex((item) => item.id === id) < 0 ? (pathWithHash = pathWithHash + location.hash, items = [{ path: pathWithHash, state, id }], index = 0) : (items[index].path === path && (pathWithHash = pathWithHash + location.hash), items[index] = { path, state, id }), window.history.replaceState({ id }, "", pathWithHash);
|
57
|
+
},
|
58
|
+
// `history.go(n)` is asynchronous, there are couple of things to keep in mind:
|
59
|
+
// - it won't do anything if we can't go `n` steps, the `popstate` event won't fire.
|
60
|
+
// - each `history.go(n)` call will trigger a separate `popstate` event with correct location.
|
61
|
+
// - the `popstate` event fires before the next frame after calling `history.go(n)`.
|
62
|
+
// This method differs from `history.go(n)` in the sense that it'll go back as many steps it can.
|
63
|
+
go(n) {
|
64
|
+
interrupt();
|
65
|
+
const nextIndex = index + n, lastItemIndex = items.length - 1;
|
66
|
+
if (n < 0 && !items[nextIndex] ? (n = -index, index = 0) : n > 0 && nextIndex > lastItemIndex ? (n = lastItemIndex - index, index = lastItemIndex) : index = nextIndex, n !== 0)
|
67
|
+
return new Promise((resolve, reject) => {
|
68
|
+
const done = (interrupted) => {
|
69
|
+
if (clearTimeout(timer), interrupted) {
|
70
|
+
reject(new Error("History was changed during navigation."));
|
71
|
+
return;
|
72
|
+
}
|
73
|
+
const { title } = window.document;
|
74
|
+
window.document.title = "", window.document.title = title, resolve();
|
75
|
+
};
|
76
|
+
pending.push({ ref: done, cb: done });
|
77
|
+
const timer = setTimeout(() => {
|
78
|
+
const index2 = pending.findIndex((it) => it.ref === done);
|
79
|
+
index2 > -1 && (pending[index2].cb(), pending.splice(index2, 1));
|
80
|
+
}, 100), onPopState = () => {
|
81
|
+
const id = window.history.state?.id, currentIndex = items.findIndex((item) => item.id === id);
|
82
|
+
index = Math.max(currentIndex, 0);
|
83
|
+
const last = pending.pop();
|
84
|
+
window.removeEventListener("popstate", onPopState), last?.cb();
|
85
|
+
};
|
86
|
+
window.addEventListener("popstate", onPopState), window.history.go(n);
|
87
|
+
});
|
88
|
+
},
|
89
|
+
// The `popstate` event is triggered when history changes, except `pushState` and `replaceState`
|
90
|
+
// If we call `history.go(n)` ourselves, we don't want it to trigger the listener
|
91
|
+
// Here we normalize it so that only external changes (e.g. user pressing back/forward) trigger the listener
|
92
|
+
listen(listener) {
|
93
|
+
const onPopState = () => {
|
94
|
+
pending.length || listener();
|
95
|
+
};
|
96
|
+
return window.addEventListener("popstate", onPopState), () => window.removeEventListener("popstate", onPopState);
|
97
|
+
}
|
98
|
+
};
|
99
|
+
}
|
100
|
+
//# sourceMappingURL=createMemoryHistory.js.map
|
@@ -0,0 +1,62 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
7
|
+
for (var name in all)
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
11
|
+
for (let key of __getOwnPropNames(from))
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
13
|
+
return to;
|
14
|
+
};
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
16
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
17
|
+
// file that has been converted to a CommonJS file using a Babel-
|
18
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
19
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
21
|
+
mod
|
22
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
23
|
+
var extractPathFromURL_exports = {};
|
24
|
+
__export(extractPathFromURL_exports, {
|
25
|
+
adjustPathname: () => adjustPathname,
|
26
|
+
extractExpoPathFromURL: () => extractExpoPathFromURL
|
27
|
+
});
|
28
|
+
module.exports = __toCommonJS(extractPathFromURL_exports);
|
29
|
+
var import_url_parse = __toESM(require("url-parse"), 1);
|
30
|
+
function extractExactPathFromURL(url) {
|
31
|
+
if (
|
32
|
+
// If a universal link / app link / web URL is used, we should use the path
|
33
|
+
// from the URL, while stripping the origin.
|
34
|
+
url.match(/^https?:\/\//)
|
35
|
+
) {
|
36
|
+
const { origin, href } = new import_url_parse.default(url);
|
37
|
+
return href.replace(origin, "");
|
38
|
+
}
|
39
|
+
return fromDeepLink(url);
|
40
|
+
}
|
41
|
+
function isExpoDevelopmentClient(url) {
|
42
|
+
return !!url.hostname.match(/^expo-development-client$/);
|
43
|
+
}
|
44
|
+
function fromDeepLink(url) {
|
45
|
+
const res = new import_url_parse.default(url, !0);
|
46
|
+
if (isExpoDevelopmentClient(res)) {
|
47
|
+
if (!res.query || !res.query.url)
|
48
|
+
return "";
|
49
|
+
const incomingUrl = res.query.url;
|
50
|
+
return extractExactPathFromURL(decodeURI(incomingUrl));
|
51
|
+
}
|
52
|
+
const qs = res.query ? Object.entries(res.query).map(([k, v]) => `${k}=${decodeURIComponent(v)}`).join("&") : "";
|
53
|
+
let results = "";
|
54
|
+
return res.host && (results += res.host), res.pathname && (results += res.pathname), qs && (results += "?" + qs), results;
|
55
|
+
}
|
56
|
+
function extractExpoPathFromURL(url = "") {
|
57
|
+
return extractExactPathFromURL(url).replace(/^\//, "");
|
58
|
+
}
|
59
|
+
function adjustPathname(url) {
|
60
|
+
return url.hostname === "exp.host" || url.hostname === "u.expo.dev" ? url.pathname.split("/").slice(2).join("/") : url.pathname;
|
61
|
+
}
|
62
|
+
//# sourceMappingURL=extractPathFromURL.js.map
|
@@ -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)
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
10
|
+
for (let key of __getOwnPropNames(from))
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
12
|
+
return to;
|
13
|
+
};
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
15
|
+
var findFocusedRoute_exports = {};
|
16
|
+
__export(findFocusedRoute_exports, {
|
17
|
+
findFocusedRoute: () => findFocusedRoute
|
18
|
+
});
|
19
|
+
module.exports = __toCommonJS(findFocusedRoute_exports);
|
20
|
+
function findFocusedRoute(state) {
|
21
|
+
let current = state;
|
22
|
+
for (; current?.routes[current.index ?? 0].state != null; )
|
23
|
+
current = current.routes[current.index ?? 0].state;
|
24
|
+
return current?.routes[current?.index ?? 0];
|
25
|
+
}
|
26
|
+
//# sourceMappingURL=findFocusedRoute.js.map
|
@@ -0,0 +1,265 @@
|
|
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)
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
10
|
+
for (let key of __getOwnPropNames(from))
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
12
|
+
return to;
|
13
|
+
};
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
15
|
+
var getPathFromState_exports = {};
|
16
|
+
__export(getPathFromState_exports, {
|
17
|
+
appendBaseUrl: () => appendBaseUrl,
|
18
|
+
deepEqual: () => deepEqual,
|
19
|
+
default: () => getPathFromState,
|
20
|
+
getPathDataFromState: () => getPathDataFromState
|
21
|
+
});
|
22
|
+
module.exports = __toCommonJS(getPathFromState_exports);
|
23
|
+
var import_core = require("@react-navigation/core"), import_matchers = require("../matchers");
|
24
|
+
const DEFAULT_SCREENS = {}, getActiveRoute = (state) => {
|
25
|
+
const route = typeof state.index == "number" ? state.routes[state.index] : state.routes[state.routes.length - 1];
|
26
|
+
return route.state ? getActiveRoute(route.state) : route && isInvalidParams(route.params) ? getActiveRoute(createFakeState(route.params)) : route;
|
27
|
+
};
|
28
|
+
function createFakeState(params) {
|
29
|
+
return {
|
30
|
+
stale: !1,
|
31
|
+
type: "UNKNOWN",
|
32
|
+
key: "UNKNOWN",
|
33
|
+
index: 0,
|
34
|
+
routeNames: [],
|
35
|
+
routes: [
|
36
|
+
{
|
37
|
+
key: "UNKNOWN",
|
38
|
+
name: params.screen,
|
39
|
+
params: params.params,
|
40
|
+
path: params.path
|
41
|
+
}
|
42
|
+
]
|
43
|
+
};
|
44
|
+
}
|
45
|
+
function segmentMatchesConvention(segment) {
|
46
|
+
return segment === "index" || (0, import_matchers.matchDynamicName)(segment) != null || (0, import_matchers.matchGroupName)(segment) != null || (0, import_matchers.matchDeepDynamicRouteName)(segment) != null;
|
47
|
+
}
|
48
|
+
function encodeURIComponentPreservingBrackets(str) {
|
49
|
+
return encodeURIComponent(str).replace(/%5B/g, "[").replace(/%5D/g, "]");
|
50
|
+
}
|
51
|
+
function getPathFromState(state, _options) {
|
52
|
+
return getPathDataFromState(state, _options).path;
|
53
|
+
}
|
54
|
+
function getPathDataFromState(state, _options = { screens: DEFAULT_SCREENS }) {
|
55
|
+
if (state == null)
|
56
|
+
throw Error("Got 'undefined' for the navigation state. You must pass a valid state object.");
|
57
|
+
const { preserveGroups, preserveDynamicRoutes, ...options } = _options;
|
58
|
+
if ((0, import_core.validatePathConfig)(options), Object.is(options.screens, DEFAULT_SCREENS))
|
59
|
+
throw Error("You must pass a 'screens' object to 'getPathFromState' to generate a path.");
|
60
|
+
return getPathFromResolvedState(
|
61
|
+
state,
|
62
|
+
// Create a normalized configs object which will be easier to use
|
63
|
+
createNormalizedConfigs(options.screens),
|
64
|
+
{ preserveGroups, preserveDynamicRoutes }
|
65
|
+
);
|
66
|
+
}
|
67
|
+
function processParamsWithUserSettings(configItem, params) {
|
68
|
+
const stringify = configItem?.stringify;
|
69
|
+
return Object.fromEntries(
|
70
|
+
Object.entries(params).map(([key, value]) => [
|
71
|
+
key,
|
72
|
+
// TODO: Strip nullish values here.
|
73
|
+
stringify?.[key] ? stringify[key](value) : (
|
74
|
+
// Preserve rest params
|
75
|
+
Array.isArray(value) ? value : String(value)
|
76
|
+
)
|
77
|
+
])
|
78
|
+
);
|
79
|
+
}
|
80
|
+
function deepEqual(a, b) {
|
81
|
+
if (a === b)
|
82
|
+
return !0;
|
83
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
84
|
+
if (a.length !== b.length)
|
85
|
+
return !1;
|
86
|
+
for (let i = 0; i < a.length; i++)
|
87
|
+
if (!deepEqual(a[i], b[i]))
|
88
|
+
return !1;
|
89
|
+
return !0;
|
90
|
+
}
|
91
|
+
if (typeof a == "object" && typeof b == "object") {
|
92
|
+
const keysA = Object.keys(a), keysB = Object.keys(b);
|
93
|
+
if (keysA.length !== keysB.length)
|
94
|
+
return !1;
|
95
|
+
for (const key of keysA)
|
96
|
+
if (!deepEqual(a[key], b[key]))
|
97
|
+
return !1;
|
98
|
+
return !0;
|
99
|
+
}
|
100
|
+
return !1;
|
101
|
+
}
|
102
|
+
function walkConfigItems(route, focusedRoute, configs, {
|
103
|
+
preserveDynamicRoutes
|
104
|
+
}) {
|
105
|
+
!route.state && isInvalidParams(route.params) && (route.state = createFakeState(route.params));
|
106
|
+
let pattern = null, focusedParams, hash;
|
107
|
+
const collectedParams = {};
|
108
|
+
for (; route.name in configs; ) {
|
109
|
+
const configItem = configs[route.name], inputPattern = configItem.pattern;
|
110
|
+
if (inputPattern == null)
|
111
|
+
throw new Error("Unexpected: No pattern found for route " + route.name);
|
112
|
+
if (pattern = inputPattern, route.params) {
|
113
|
+
route.params["#"] && (hash = route.params["#"], delete route.params["#"]);
|
114
|
+
const params = processParamsWithUserSettings(configItem, route.params);
|
115
|
+
pattern != null && Object.assign(collectedParams, params), deepEqual(focusedRoute, route) && (preserveDynamicRoutes ? focusedParams = params : focusedParams = getParamsWithConventionsCollapsed({
|
116
|
+
params,
|
117
|
+
pattern,
|
118
|
+
routeName: route.name
|
119
|
+
}));
|
120
|
+
}
|
121
|
+
if (!route.state && isInvalidParams(route.params) && (route.state = createFakeState(route.params)), !configItem.screens || route.state === void 0) {
|
122
|
+
configItem.initialRouteName && configItem.screens && configItem.initialRouteName in configItem.screens && configItem.screens[configItem.initialRouteName]?.pattern && (pattern = configItem.screens[configItem.initialRouteName].pattern, focusedParams && (preserveDynamicRoutes || (focusedParams = getParamsWithConventionsCollapsed({
|
123
|
+
params: focusedParams,
|
124
|
+
pattern,
|
125
|
+
routeName: route.name
|
126
|
+
}))));
|
127
|
+
break;
|
128
|
+
}
|
129
|
+
const index = route.state.index ?? route.state.routes.length - 1, nextRoute = route.state.routes[index], nestedScreens = configItem.screens;
|
130
|
+
if (nestedScreens && nextRoute.name in nestedScreens)
|
131
|
+
route = nextRoute, configs = nestedScreens;
|
132
|
+
else
|
133
|
+
break;
|
134
|
+
}
|
135
|
+
if (pattern == null)
|
136
|
+
throw new Error(
|
137
|
+
`No pattern found for route "${route.name}". Options are: ${Object.keys(configs).join(", ")}.`
|
138
|
+
);
|
139
|
+
return pattern && !focusedParams && focusedRoute.params && (preserveDynamicRoutes ? focusedParams = focusedRoute.params : focusedParams = getParamsWithConventionsCollapsed({
|
140
|
+
params: focusedRoute.params,
|
141
|
+
pattern,
|
142
|
+
routeName: route.name
|
143
|
+
}), Object.assign(focusedParams, collectedParams)), {
|
144
|
+
pattern,
|
145
|
+
nextRoute: route,
|
146
|
+
focusedParams,
|
147
|
+
hash,
|
148
|
+
params: collectedParams
|
149
|
+
};
|
150
|
+
}
|
151
|
+
function getPathFromResolvedState(state, configs, {
|
152
|
+
preserveGroups,
|
153
|
+
preserveDynamicRoutes
|
154
|
+
}) {
|
155
|
+
let path = "", current = state, hash;
|
156
|
+
const allParams = {};
|
157
|
+
for (; current; ) {
|
158
|
+
path += "/";
|
159
|
+
const route = current.routes[current.index ?? 0];
|
160
|
+
!route.state && isInvalidParams(route.params) && (route.state = createFakeState(route.params));
|
161
|
+
const {
|
162
|
+
pattern,
|
163
|
+
params: params2,
|
164
|
+
nextRoute,
|
165
|
+
focusedParams,
|
166
|
+
hash: $hash
|
167
|
+
} = walkConfigItems(route, getActiveRoute(current), { ...configs }, { preserveDynamicRoutes });
|
168
|
+
if ($hash && (hash = $hash), Object.assign(allParams, params2), path += getPathWithConventionsCollapsed({
|
169
|
+
pattern,
|
170
|
+
routePath: nextRoute.path,
|
171
|
+
params: allParams,
|
172
|
+
initialRouteName: configs[nextRoute.name]?.initialRouteName,
|
173
|
+
preserveGroups,
|
174
|
+
preserveDynamicRoutes
|
175
|
+
}), nextRoute.state && // NOTE: The upstream implementation allows for sending in synthetic states (states that weren't generated by `getStateFromPath`)
|
176
|
+
// and any invalid routes will simply be ignored.
|
177
|
+
// Because of this, we need to check if the next route is valid before continuing, otherwise our more strict
|
178
|
+
// implementation will throw an error.
|
179
|
+
configs[nextRoute.state.routes?.[nextRoute.state?.index ?? 0]?.name])
|
180
|
+
current = nextRoute.state;
|
181
|
+
else {
|
182
|
+
if (focusedParams && // note: using [...route] is returning an array which shouldn't go on search, this is just
|
183
|
+
// an initial hacky test to work around this as we dont want to pass that to search
|
184
|
+
!Array.isArray(focusedParams)) {
|
185
|
+
for (const param in focusedParams)
|
186
|
+
focusedParams[param] === "undefined" && delete focusedParams[param];
|
187
|
+
const query = new URLSearchParams(focusedParams).toString();
|
188
|
+
query && (path += `?${query}`);
|
189
|
+
}
|
190
|
+
break;
|
191
|
+
}
|
192
|
+
}
|
193
|
+
hash && (allParams["#"] = hash, path += `#${hash}`);
|
194
|
+
const params = decodeParams(allParams);
|
195
|
+
return { path: appendBaseUrl(basicSanitizePath(path)), params };
|
196
|
+
}
|
197
|
+
function decodeParams(params) {
|
198
|
+
const parsed = {};
|
199
|
+
for (const [key, value] of Object.entries(params))
|
200
|
+
try {
|
201
|
+
Array.isArray(value) ? parsed[key] = value.map((v) => decodeURIComponent(v)) : parsed[key] = decodeURIComponent(value);
|
202
|
+
} catch {
|
203
|
+
parsed[key] = value;
|
204
|
+
}
|
205
|
+
return parsed;
|
206
|
+
}
|
207
|
+
function getPathWithConventionsCollapsed({
|
208
|
+
pattern,
|
209
|
+
routePath,
|
210
|
+
params,
|
211
|
+
preserveGroups,
|
212
|
+
preserveDynamicRoutes,
|
213
|
+
initialRouteName
|
214
|
+
}) {
|
215
|
+
const segments = pattern.split("/");
|
216
|
+
return segments.map((p, i) => {
|
217
|
+
const name = getParamName(p);
|
218
|
+
return p.startsWith("*") ? preserveDynamicRoutes ? name === "not-found" ? "+not-found" : `[...${name}]` : params[name] ? Array.isArray(params[name]) ? params[name].join("/") : params[name] : i === 0 ? routePath : routePath?.split("/").slice(i + 1).join("/") : p.startsWith(":") ? preserveDynamicRoutes ? `[${name}]` : params[name] : !preserveGroups && (0, import_matchers.matchGroupName)(p) != null ? segments.length - 1 === i && initialRouteName ? segmentMatchesConvention(initialRouteName) ? "" : encodeURIComponentPreservingBrackets(initialRouteName) : "" : encodeURIComponentPreservingBrackets(p);
|
219
|
+
}).map((v) => v ?? "").join("/");
|
220
|
+
}
|
221
|
+
function getParamsWithConventionsCollapsed({
|
222
|
+
pattern,
|
223
|
+
routeName,
|
224
|
+
params
|
225
|
+
}) {
|
226
|
+
const processedParams = { ...params }, segments = pattern.split("/");
|
227
|
+
if (segments.filter((segment) => segment.startsWith(":")).forEach((segment) => {
|
228
|
+
const name = getParamName(segment);
|
229
|
+
delete processedParams[name];
|
230
|
+
}), segments.some((segment) => segment.startsWith("*"))) {
|
231
|
+
const name = (0, import_matchers.testNotFound)(routeName) ? "not-found" : (0, import_matchers.matchDeepDynamicRouteName)(routeName) ?? routeName;
|
232
|
+
delete processedParams[name];
|
233
|
+
}
|
234
|
+
return processedParams;
|
235
|
+
}
|
236
|
+
function basicSanitizePath(path) {
|
237
|
+
const simplifiedPath = path.replace(/\/+/g, "/");
|
238
|
+
return simplifiedPath.length <= 1 ? simplifiedPath : simplifiedPath.replace(/\/$/, "");
|
239
|
+
}
|
240
|
+
function isInvalidParams(params) {
|
241
|
+
return params ? "params" in params && typeof params.params == "object" && params.params ? !0 : "initial" in params && typeof params.initial == "boolean" && // "path" in params &&
|
242
|
+
"screen" in params : !1;
|
243
|
+
}
|
244
|
+
const getParamName = (pattern) => pattern.replace(/^[:*]/, "").replace(/\?$/, ""), joinPaths = (...paths) => [].concat(...paths.map((p) => p.split("/"))).filter(Boolean).join("/"), createConfigItem = (config, parentPattern) => {
|
245
|
+
if (typeof config == "string")
|
246
|
+
return { pattern: parentPattern ? joinPaths(parentPattern, config) : config };
|
247
|
+
if (config.exact && config.path === void 0)
|
248
|
+
throw new Error(
|
249
|
+
"A 'path' needs to be specified when specifying 'exact: true'. If you don't want this screen in the URL, specify it as empty string, e.g. `path: ''`."
|
250
|
+
);
|
251
|
+
const pattern = config.exact !== !0 ? joinPaths(parentPattern || "", config.path || "") : config.path || "", screens = config.screens ? createNormalizedConfigs(config.screens, pattern) : void 0;
|
252
|
+
return {
|
253
|
+
// Normalize pattern to remove any leading, trailing slashes, duplicate slashes etc.
|
254
|
+
pattern: pattern?.split("/").filter(Boolean).join("/"),
|
255
|
+
stringify: config.stringify,
|
256
|
+
screens,
|
257
|
+
initialRouteName: config.initialRouteName
|
258
|
+
};
|
259
|
+
}, createNormalizedConfigs = (options, pattern) => Object.fromEntries(
|
260
|
+
Object.entries(options).map(([name, c]) => [name, createConfigItem(c, pattern)])
|
261
|
+
);
|
262
|
+
function appendBaseUrl(path, baseUrl = process.env.EXPO_BASE_URL) {
|
263
|
+
return process.env.NODE_ENV !== "development" && baseUrl ? `/${baseUrl.replace(/^\/+/, "").replace(/\/$/, "")}${path}` : path;
|
264
|
+
}
|
265
|
+
//# sourceMappingURL=getPathFromState.js.map
|