one 1.1.319 → 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/{getURL.native.cjs → cli/patch.cjs} +11 -15
- package/dist/cjs/cli/patch.js +34 -0
- package/dist/cjs/cli/patch.js.map +6 -0
- package/dist/cjs/cli/patch.native.js +39 -0
- package/dist/cjs/cli/patch.native.js.map +6 -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.cjs +17 -0
- package/dist/cjs/cli.js +220 -0
- package/dist/cjs/{cli.cjs.map → cli.js.map} +1 -1
- package/dist/cjs/cli.native.js +12 -0
- package/dist/cjs/cli.native.js.map +2 -2
- 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/cli/patch.js +10 -0
- package/dist/esm/cli/patch.js.map +6 -0
- package/dist/esm/cli/patch.mjs +10 -0
- package/dist/esm/cli/patch.mjs.map +1 -0
- package/dist/esm/cli/patch.native.js +10 -0
- package/dist/esm/cli/patch.native.js.map +6 -0
- package/dist/esm/cli.js +12 -0
- package/dist/esm/cli.js.map +1 -1
- package/dist/esm/cli.mjs +17 -0
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/cli.native.js +12 -0
- package/dist/esm/cli.native.js.map +2 -2
- 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/cli/patch.ts +6 -0
- package/src/cli.ts +14 -0
- package/src/vite/createFileSystemRouter.tsx +1 -1
- package/src/vite.ts +1 -0
- package/types/cli/patch.d.ts +2 -0
- package/types/cli/patch.d.ts.map +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.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/{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/{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,182 @@
|
|
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 useLinking_exports = {};
|
24
|
+
__export(useLinking_exports, {
|
25
|
+
default: () => useLinking,
|
26
|
+
series: () => series
|
27
|
+
});
|
28
|
+
module.exports = __toCommonJS(useLinking_exports);
|
29
|
+
var import_core = require("@react-navigation/core"), import_fast_deep_equal = __toESM(require("fast-deep-equal"), 1), React = __toESM(require("react"), 1), import_createMemoryHistory = __toESM(require("./createMemoryHistory"), 1), import_serverLocationContext = require("../router/serverLocationContext"), import_getPathFromState = require("./getPathFromState");
|
30
|
+
const historyGlobal = (0, import_createMemoryHistory.default)();
|
31
|
+
typeof window < "u" && historyGlobal.listen(() => {
|
32
|
+
globalThis.__vxrntodopath = window.location.pathname;
|
33
|
+
});
|
34
|
+
const findMatchingState = (a, b) => {
|
35
|
+
if (a === void 0 || b === void 0 || a.key !== b.key)
|
36
|
+
return [void 0, void 0];
|
37
|
+
const aHistoryLength = a.history ? a.history.length : a.routes.length, bHistoryLength = b.history ? b.history.length : b.routes.length, aRoute = a.routes[a.index], bRoute = b.routes[b.index], aChildState = aRoute.state, bChildState = bRoute.state;
|
38
|
+
return aHistoryLength !== bHistoryLength || aRoute.key !== bRoute.key || aChildState === void 0 || bChildState === void 0 || aChildState.key !== bChildState.key ? [a, b] : findMatchingState(aChildState, bChildState);
|
39
|
+
}, series = (cb) => {
|
40
|
+
let queue = Promise.resolve();
|
41
|
+
return () => {
|
42
|
+
queue = queue.then(cb);
|
43
|
+
};
|
44
|
+
};
|
45
|
+
let linkingHandlers = [];
|
46
|
+
function useLinking(ref, {
|
47
|
+
independent,
|
48
|
+
enabled = !0,
|
49
|
+
config,
|
50
|
+
getStateFromPath = import_core.getStateFromPath,
|
51
|
+
getPathFromState = import_core.getPathFromState,
|
52
|
+
getActionFromState = import_core.getActionFromState
|
53
|
+
}) {
|
54
|
+
React.useEffect(() => {
|
55
|
+
if (process.env.NODE_ENV === "production" || independent)
|
56
|
+
return;
|
57
|
+
enabled !== !1 && linkingHandlers.length && console.error(
|
58
|
+
[
|
59
|
+
"Looks like you have configured linking in multiple places. This is likely an error since deep links should only be handled in one place to avoid conflicts. Make sure that:",
|
60
|
+
"- You don't have multiple NavigationContainers in the app each with 'linking' enabled",
|
61
|
+
"- Only a single instance of the root component is rendered"
|
62
|
+
].join(`
|
63
|
+
`).trim()
|
64
|
+
);
|
65
|
+
const handler = Symbol();
|
66
|
+
return enabled !== !1 && linkingHandlers.push(handler), () => {
|
67
|
+
const index = linkingHandlers.indexOf(handler);
|
68
|
+
index > -1 && linkingHandlers.splice(index, 1);
|
69
|
+
};
|
70
|
+
}, [enabled, independent]);
|
71
|
+
const [history] = React.useState(historyGlobal), enabledRef = React.useRef(enabled), configRef = React.useRef(config), getStateFromPathRef = React.useRef(getStateFromPath), getPathFromStateRef = React.useRef(getPathFromState), getActionFromStateRef = React.useRef(getActionFromState);
|
72
|
+
React.useEffect(() => {
|
73
|
+
enabledRef.current = enabled, configRef.current = config, getStateFromPathRef.current = getStateFromPath, getPathFromStateRef.current = getPathFromState, getActionFromStateRef.current = getActionFromState;
|
74
|
+
});
|
75
|
+
const server = { location: React.useContext(import_serverLocationContext.ServerLocationContext) }, getInitialState = React.useCallback(() => {
|
76
|
+
let value;
|
77
|
+
if (enabledRef.current) {
|
78
|
+
const location2 = server?.location ?? (typeof window < "u" ? window.location : void 0), path = location2 ? location2.pathname + location2.search : void 0;
|
79
|
+
path && (value = getStateFromPathRef.current(path, configRef.current));
|
80
|
+
}
|
81
|
+
const thenable = {
|
82
|
+
// biome-ignore lint/suspicious/noThenProperty: <explanation>
|
83
|
+
then(onfulfilled) {
|
84
|
+
return Promise.resolve(onfulfilled ? onfulfilled(value) : value);
|
85
|
+
},
|
86
|
+
catch() {
|
87
|
+
return thenable;
|
88
|
+
}
|
89
|
+
};
|
90
|
+
return thenable;
|
91
|
+
}, []), previousIndexRef = React.useRef(void 0), previousStateRef = React.useRef(void 0), pendingPopStatePathRef = React.useRef(void 0);
|
92
|
+
return React.useEffect(() => (previousIndexRef.current = history.index, history.listen(() => {
|
93
|
+
const navigation = ref.current;
|
94
|
+
if (!navigation || !enabled)
|
95
|
+
return;
|
96
|
+
const { location: location2 } = window, path = location2.pathname + location2.search, index = history.index, previousIndex = previousIndexRef.current ?? 0;
|
97
|
+
previousIndexRef.current = index, pendingPopStatePathRef.current = path;
|
98
|
+
const record = history.get(index);
|
99
|
+
if (record?.path === path && record?.state) {
|
100
|
+
navigation.resetRoot(record.state);
|
101
|
+
return;
|
102
|
+
}
|
103
|
+
const state = getStateFromPathRef.current(path, configRef.current);
|
104
|
+
if (state) {
|
105
|
+
const rootState = navigation.getRootState();
|
106
|
+
if (state.routes.some((r) => !rootState?.routeNames.includes(r.name))) {
|
107
|
+
console.warn(
|
108
|
+
"The navigation state parsed from the URL contains routes not present in the root navigator. This usually means that the linking configuration doesn't match the navigation structure. See https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration."
|
109
|
+
);
|
110
|
+
return;
|
111
|
+
}
|
112
|
+
if (index > previousIndex) {
|
113
|
+
const action = getActionFromStateRef.current(state, configRef.current);
|
114
|
+
if (action !== void 0)
|
115
|
+
try {
|
116
|
+
navigation.dispatch(action);
|
117
|
+
} catch (e) {
|
118
|
+
console.warn(
|
119
|
+
`An error occurred when trying to handle the link '${path}': ${typeof e == "object" && e != null && "message" in e ? e.message : e}`
|
120
|
+
);
|
121
|
+
}
|
122
|
+
else
|
123
|
+
navigation.resetRoot(state);
|
124
|
+
} else
|
125
|
+
navigation.resetRoot(state);
|
126
|
+
} else
|
127
|
+
navigation.resetRoot(state);
|
128
|
+
})), [enabled, history, ref]), React.useEffect(() => {
|
129
|
+
if (!enabled)
|
130
|
+
return;
|
131
|
+
const getPathForRoute = (route, state) => {
|
132
|
+
if (route?.path) {
|
133
|
+
const stateForPath = getStateFromPathRef.current(route.path, configRef.current);
|
134
|
+
if (stateForPath) {
|
135
|
+
const focusedRoute = (0, import_core.findFocusedRoute)(stateForPath);
|
136
|
+
if (focusedRoute && focusedRoute.name === route.name && (0, import_fast_deep_equal.default)(focusedRoute.params, route.params))
|
137
|
+
return (0, import_getPathFromState.appendBaseUrl)(route.path);
|
138
|
+
}
|
139
|
+
}
|
140
|
+
return getPathFromStateRef.current(state, configRef.current);
|
141
|
+
};
|
142
|
+
if (ref.current) {
|
143
|
+
const state = ref.current.getRootState();
|
144
|
+
if (state) {
|
145
|
+
const route = (0, import_core.findFocusedRoute)(state), path = getPathForRoute(route, state);
|
146
|
+
previousStateRef.current === void 0 && (previousStateRef.current = state), history.replace({ path, state });
|
147
|
+
}
|
148
|
+
}
|
149
|
+
const onStateChange = async () => {
|
150
|
+
const navigation = ref.current;
|
151
|
+
if (!navigation || !enabled)
|
152
|
+
return;
|
153
|
+
const previousState = previousStateRef.current, state = navigation.getRootState();
|
154
|
+
if (!state)
|
155
|
+
return;
|
156
|
+
const pendingPath = pendingPopStatePathRef.current, route = (0, import_core.findFocusedRoute)(state), path = getPathForRoute(route, state);
|
157
|
+
previousStateRef.current = state, pendingPopStatePathRef.current = void 0;
|
158
|
+
const [previousFocusedState, focusedState] = findMatchingState(previousState, state);
|
159
|
+
if (previousFocusedState && focusedState && // We should only handle push/pop if path changed from what was in last `popstate`
|
160
|
+
// Otherwise it's likely a change triggered by `popstate`
|
161
|
+
path !== pendingPath) {
|
162
|
+
const historyDelta = (focusedState.history ? focusedState.history.length : focusedState.routes.length) - (previousFocusedState.history ? previousFocusedState.history.length : previousFocusedState.routes.length);
|
163
|
+
if (historyDelta > 0)
|
164
|
+
history.push({ path, state });
|
165
|
+
else if (historyDelta < 0) {
|
166
|
+
const nextIndex = history.backIndex({ path }), currentIndex = history.index;
|
167
|
+
try {
|
168
|
+
nextIndex !== -1 && nextIndex < currentIndex && // We should only go back if the entry exists and it's less than current index
|
169
|
+
history.get(nextIndex - currentIndex) ? await history.go(nextIndex - currentIndex) : await history.go(historyDelta), history.replace({ path, state });
|
170
|
+
} catch {
|
171
|
+
}
|
172
|
+
} else
|
173
|
+
history.replace({ path, state });
|
174
|
+
} else
|
175
|
+
history.replace({ path, state });
|
176
|
+
};
|
177
|
+
return ref.current?.addListener("state", series(onStateChange));
|
178
|
+
}, [enabled, history, ref]), {
|
179
|
+
getInitialState
|
180
|
+
};
|
181
|
+
}
|
182
|
+
//# sourceMappingURL=useLinking.js.map
|
@@ -0,0 +1,46 @@
|
|
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 validatePathConfig_exports = {};
|
16
|
+
__export(validatePathConfig_exports, {
|
17
|
+
default: () => validatePathConfig
|
18
|
+
});
|
19
|
+
module.exports = __toCommonJS(validatePathConfig_exports);
|
20
|
+
const formatToList = (items) => items.map((key) => `- ${key}`).join(`
|
21
|
+
`);
|
22
|
+
function validatePathConfig(config, root = !0) {
|
23
|
+
const validKeys = ["initialRouteName", "screens", "_route"];
|
24
|
+
root || validKeys.push("path", "exact", "stringify", "parse");
|
25
|
+
const invalidKeys = Object.keys(config).filter((key) => !validKeys.includes(key));
|
26
|
+
if (invalidKeys.length)
|
27
|
+
throw new Error(
|
28
|
+
`Found invalid properties in the configuration:
|
29
|
+
${formatToList(
|
30
|
+
invalidKeys
|
31
|
+
)}
|
32
|
+
|
33
|
+
Did you forget to specify them under a 'screens' property?
|
34
|
+
|
35
|
+
You can only specify the following properties:
|
36
|
+
${formatToList(
|
37
|
+
validKeys
|
38
|
+
)}
|
39
|
+
|
40
|
+
See https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration.`
|
41
|
+
);
|
42
|
+
config.screens && Object.entries(config.screens).forEach(([_, value]) => {
|
43
|
+
typeof value != "string" && validatePathConfig(value, !1);
|
44
|
+
});
|
45
|
+
}
|
46
|
+
//# sourceMappingURL=validatePathConfig.js.map
|
@@ -0,0 +1,59 @@
|
|
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 getLinkingConfig_exports = {};
|
16
|
+
__export(getLinkingConfig_exports, {
|
17
|
+
getLinkingConfig: () => getLinkingConfig,
|
18
|
+
getNavigationConfig: () => getNavigationConfig,
|
19
|
+
stateCache: () => stateCache
|
20
|
+
});
|
21
|
+
module.exports = __toCommonJS(getLinkingConfig_exports);
|
22
|
+
var import_native = require("@react-navigation/native"), import_getReactNavigationConfig = require("./getReactNavigationConfig"), import_linking = require("./link/linking");
|
23
|
+
function getNavigationConfig(routes, metaOnly = !0) {
|
24
|
+
return (0, import_getReactNavigationConfig.getReactNavigationConfig)(routes, metaOnly);
|
25
|
+
}
|
26
|
+
function getLinkingConfig(routes, metaOnly = !0) {
|
27
|
+
return {
|
28
|
+
prefixes: [],
|
29
|
+
// @ts-expect-error
|
30
|
+
config: getNavigationConfig(routes, metaOnly),
|
31
|
+
// A custom getInitialURL is used on native to ensure the app always starts at
|
32
|
+
// the root path if it's launched from something other than a deep link.
|
33
|
+
// This helps keep the native functionality working like the web functionality.
|
34
|
+
// For example, if you had a root navigator where the first screen was `/settings` and the second was `/index`
|
35
|
+
// then `/index` would be used on web and `/settings` would be used on native.
|
36
|
+
getInitialURL: import_linking.getInitialURL,
|
37
|
+
subscribe: import_linking.addEventListener,
|
38
|
+
getStateFromPath: getStateFromPathMemoized,
|
39
|
+
getPathFromState(state, options) {
|
40
|
+
return (0, import_linking.getPathFromState)(state, {
|
41
|
+
screens: [],
|
42
|
+
...this.config,
|
43
|
+
...options
|
44
|
+
}) ?? "/";
|
45
|
+
},
|
46
|
+
// Add all functions to ensure the types never need to fallback.
|
47
|
+
// This is a convenience for usage in the package.
|
48
|
+
getActionFromState: import_native.getActionFromState
|
49
|
+
};
|
50
|
+
}
|
51
|
+
const stateCache = /* @__PURE__ */ new Map();
|
52
|
+
function getStateFromPathMemoized(path, options) {
|
53
|
+
const cached = stateCache.get(path);
|
54
|
+
if (cached)
|
55
|
+
return cached;
|
56
|
+
const result = (0, import_linking.getStateFromPath)(path, options);
|
57
|
+
return stateCache.set(path, result), result;
|
58
|
+
}
|
59
|
+
//# sourceMappingURL=getLinkingConfig.js.map
|
@@ -0,0 +1,69 @@
|
|
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 getReactNavigationConfig_exports = {};
|
16
|
+
__export(getReactNavigationConfig_exports, {
|
17
|
+
getReactNavigationConfig: () => getReactNavigationConfig,
|
18
|
+
getReactNavigationScreensConfig: () => getReactNavigationScreensConfig
|
19
|
+
});
|
20
|
+
module.exports = __toCommonJS(getReactNavigationConfig_exports);
|
21
|
+
var import_matchers = require("./matchers");
|
22
|
+
function convertDynamicRouteToReactNavigation(segment) {
|
23
|
+
if (segment === "index")
|
24
|
+
return "";
|
25
|
+
const rest = (0, import_matchers.matchDeepDynamicRouteName)(segment);
|
26
|
+
if (rest != null)
|
27
|
+
return "*" + rest;
|
28
|
+
const dynamicName = (0, import_matchers.matchDynamicName)(segment);
|
29
|
+
return dynamicName != null ? `:${dynamicName}` : segment;
|
30
|
+
}
|
31
|
+
function parseRouteSegments(segments) {
|
32
|
+
return (
|
33
|
+
// NOTE: When there are nested routes without layouts
|
34
|
+
// the node.route will be something like `app/home/index`
|
35
|
+
// this needs to be split to ensure each segment is parsed correctly.
|
36
|
+
segments.split("/").map(convertDynamicRouteToReactNavigation).filter(Boolean).join("/")
|
37
|
+
);
|
38
|
+
}
|
39
|
+
function convertRouteNodeToScreen(node, metaOnly) {
|
40
|
+
const path = parseRouteSegments(node.route);
|
41
|
+
if (!node.children.length)
|
42
|
+
return metaOnly ? path : {
|
43
|
+
path,
|
44
|
+
screens: {},
|
45
|
+
_route: node
|
46
|
+
};
|
47
|
+
const screens = getReactNavigationScreensConfig(node.children, metaOnly), screen = {
|
48
|
+
path,
|
49
|
+
screens,
|
50
|
+
// NOTE: This is bad because it forces all Layout Routes
|
51
|
+
// to be loaded into memory. We should move towards a system where
|
52
|
+
// the initial route name is either loaded asynchronously in the Layout Route
|
53
|
+
// or defined via a file system convention.
|
54
|
+
initialRouteName: node.initialRouteName
|
55
|
+
};
|
56
|
+
return metaOnly || (screen._route = node), screen;
|
57
|
+
}
|
58
|
+
function getReactNavigationScreensConfig(nodes, metaOnly) {
|
59
|
+
return Object.fromEntries(
|
60
|
+
nodes.map((node) => [node.route, convertRouteNodeToScreen(node, metaOnly)])
|
61
|
+
);
|
62
|
+
}
|
63
|
+
function getReactNavigationConfig(routes, metaOnly) {
|
64
|
+
return {
|
65
|
+
initialRouteName: routes.initialRouteName,
|
66
|
+
screens: getReactNavigationScreensConfig(routes.children, metaOnly)
|
67
|
+
};
|
68
|
+
}
|
69
|
+
//# sourceMappingURL=getReactNavigationConfig.js.map
|
@@ -0,0 +1,294 @@
|
|
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 getRoutes_exports = {};
|
16
|
+
__export(getRoutes_exports, {
|
17
|
+
extrapolateGroups: () => extrapolateGroups,
|
18
|
+
generateDynamic: () => generateDynamic,
|
19
|
+
getExactRoutes: () => getExactRoutes,
|
20
|
+
getIgnoreList: () => getIgnoreList,
|
21
|
+
getRoutes: () => getRoutes
|
22
|
+
});
|
23
|
+
module.exports = __toCommonJS(getRoutes_exports);
|
24
|
+
var import_config = require("./config"), import_matchers = require("./matchers"), import_getPageExport = require("./utils/getPageExport");
|
25
|
+
const validPlatforms = /* @__PURE__ */ new Set(["android", "ios", "native", "web"]);
|
26
|
+
function getRoutes(contextModule, options = {}) {
|
27
|
+
const directoryTree = getDirectoryTree(contextModule, options);
|
28
|
+
if (!directoryTree)
|
29
|
+
return null;
|
30
|
+
const rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);
|
31
|
+
return options.ignoreEntryPoints || crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options), rootNode;
|
32
|
+
}
|
33
|
+
function getExactRoutes(contextModule, options = {}) {
|
34
|
+
return getRoutes(contextModule, {
|
35
|
+
...options,
|
36
|
+
skipGenerated: !0
|
37
|
+
});
|
38
|
+
}
|
39
|
+
function getDirectoryTree(contextModule, options) {
|
40
|
+
const importMode = options.importMode || process.env.One_ROUTER_IMPORT_MODE, ignoreList = [/^\.\/\+html\.[tj]sx?$/];
|
41
|
+
options.ignore && ignoreList.push(...options.ignore), options.preserveApiRoutes || ignoreList.push(/\+api\.[tj]sx?$/);
|
42
|
+
const rootDirectory = {
|
43
|
+
files: /* @__PURE__ */ new Map(),
|
44
|
+
subdirectories: /* @__PURE__ */ new Map()
|
45
|
+
};
|
46
|
+
let hasRoutes = !1, isValid = !1;
|
47
|
+
for (const filePath of contextModule.keys()) {
|
48
|
+
if (ignoreList.some((regex) => regex.test(filePath)))
|
49
|
+
continue;
|
50
|
+
isValid = !0;
|
51
|
+
const meta = getFileMeta(filePath, options);
|
52
|
+
if (meta.specificity < 0)
|
53
|
+
continue;
|
54
|
+
const type = meta.isLayout ? "layout" : meta.renderMode || (0, import_config.getDefaultRenderMode)();
|
55
|
+
let node = {
|
56
|
+
type,
|
57
|
+
loadRoute() {
|
58
|
+
if (options.ignoreRequireErrors)
|
59
|
+
try {
|
60
|
+
return contextModule(filePath);
|
61
|
+
} catch {
|
62
|
+
return {};
|
63
|
+
}
|
64
|
+
else
|
65
|
+
return contextModule(filePath);
|
66
|
+
},
|
67
|
+
contextKey: filePath,
|
68
|
+
route: "",
|
69
|
+
// This is overwritten during hoisting based upon the _layout
|
70
|
+
dynamic: null,
|
71
|
+
children: []
|
72
|
+
// While we are building the directory tree, we don't know the node's children just yet. This is added during hoisting
|
73
|
+
};
|
74
|
+
if (!(process.env.NODE_ENV === "development" && node.type !== "api" && importMode === "sync" && !(0, import_getPageExport.getPageExport)(node.loadRoute())))
|
75
|
+
for (const route of extrapolateGroups(meta.route)) {
|
76
|
+
const subdirectoryParts = route.split("/").slice(0, -1);
|
77
|
+
let directory = rootDirectory;
|
78
|
+
for (const part of subdirectoryParts) {
|
79
|
+
let subDirectory = directory.subdirectories.get(part);
|
80
|
+
subDirectory || (subDirectory = {
|
81
|
+
files: /* @__PURE__ */ new Map(),
|
82
|
+
subdirectories: /* @__PURE__ */ new Map()
|
83
|
+
}, directory.subdirectories.set(part, subDirectory)), directory = subDirectory;
|
84
|
+
}
|
85
|
+
if (node = { ...node, route }, meta.isLayout) {
|
86
|
+
directory.layout ??= [];
|
87
|
+
const existing = directory.layout[meta.specificity];
|
88
|
+
if (existing) {
|
89
|
+
if (process.env.NODE_ENV !== "production")
|
90
|
+
throw new Error(
|
91
|
+
`The layouts "${filePath}" and "${existing.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`
|
92
|
+
);
|
93
|
+
} else
|
94
|
+
node = getLayoutNode(node, options), directory.layout[meta.specificity] = node;
|
95
|
+
} else if (type === "api") {
|
96
|
+
const fileKey = `${route}+api`;
|
97
|
+
let nodes = directory.files.get(fileKey);
|
98
|
+
nodes || (nodes = [], directory.files.set(fileKey, nodes));
|
99
|
+
const existing = nodes[0];
|
100
|
+
if (existing) {
|
101
|
+
if (process.env.NODE_ENV !== "production")
|
102
|
+
throw new Error(
|
103
|
+
`The API route file "${filePath}" and "${existing.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`
|
104
|
+
);
|
105
|
+
} else
|
106
|
+
nodes[0] = node;
|
107
|
+
} else {
|
108
|
+
let nodes = directory.files.get(route);
|
109
|
+
nodes || (nodes = [], directory.files.set(route, nodes));
|
110
|
+
const existing = nodes[meta.specificity];
|
111
|
+
if (existing) {
|
112
|
+
if (process.env.NODE_ENV !== "production")
|
113
|
+
throw new Error(
|
114
|
+
`The route files "${filePath}" and "${existing.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`
|
115
|
+
);
|
116
|
+
} else
|
117
|
+
hasRoutes ||= !0, nodes[meta.specificity] = node;
|
118
|
+
}
|
119
|
+
}
|
120
|
+
}
|
121
|
+
return isValid ? (rootDirectory.layout || (rootDirectory.layout = [
|
122
|
+
{
|
123
|
+
type: "layout",
|
124
|
+
loadRoute: () => ({
|
125
|
+
default: require("./views/Navigator").DefaultNavigator
|
126
|
+
}),
|
127
|
+
// Generate a fake file name for the directory
|
128
|
+
contextKey: "router/build/views/Navigator.js",
|
129
|
+
route: "",
|
130
|
+
generated: !0,
|
131
|
+
dynamic: null,
|
132
|
+
children: []
|
133
|
+
}
|
134
|
+
]), options.skipGenerated || (hasRoutes && appendSitemapRoute(rootDirectory), appendNotFoundRoute(rootDirectory)), rootDirectory) : null;
|
135
|
+
}
|
136
|
+
function flattenDirectoryTreeToRoutes(directory, options, layout, pathToRemove = "") {
|
137
|
+
if (directory.layout) {
|
138
|
+
const previousLayout = layout;
|
139
|
+
layout = getMostSpecific(directory.layout), previousLayout && previousLayout.children.push(layout), options.internal_stripLoadRoute && delete layout.loadRoute;
|
140
|
+
const newRoute = layout.route.replace(pathToRemove, "");
|
141
|
+
pathToRemove = layout.route ? `${layout.route}/` : "", layout.route = newRoute, layout.dynamic = generateDynamic(layout.route);
|
142
|
+
}
|
143
|
+
if (!layout) throw new Error("One Internal Error: No nearest layout");
|
144
|
+
for (const routes of directory.files.values()) {
|
145
|
+
const routeNode = getMostSpecific(routes);
|
146
|
+
routeNode.route = routeNode.route.replace(pathToRemove, ""), routeNode.dynamic = generateDynamic(routeNode.route), options.internal_stripLoadRoute && delete routeNode.loadRoute, layout.children.push(routeNode);
|
147
|
+
}
|
148
|
+
for (const child of directory.subdirectories.values())
|
149
|
+
flattenDirectoryTreeToRoutes(child, options, layout, pathToRemove);
|
150
|
+
return layout;
|
151
|
+
}
|
152
|
+
function getFileMeta(key, options) {
|
153
|
+
key = key.replace(/^\.\//, "");
|
154
|
+
const parts = key.split("/");
|
155
|
+
let route = (0, import_matchers.removeSupportedExtensions)(key);
|
156
|
+
const filename = parts[parts.length - 1], filenameWithoutExtensions = (0, import_matchers.removeSupportedExtensions)(filename), isLayout = filenameWithoutExtensions.startsWith("_layout"), [_fullname, renderModeFound] = filename.match(/\+(api|ssg|ssr|spa)\.(\w+\.)?[jt]sx?$/) || [], renderMode = renderModeFound;
|
157
|
+
if (filenameWithoutExtensions.startsWith("(") && filenameWithoutExtensions.endsWith(")"))
|
158
|
+
throw new Error(`Invalid route ./${key}. Routes cannot end with '(group)' syntax`);
|
159
|
+
if (renderMode !== "api" && filename.startsWith("+") && filenameWithoutExtensions !== "+not-found") {
|
160
|
+
const renamedRoute = [...parts.slice(0, -1), filename.slice(1)].join("/");
|
161
|
+
throw new Error(
|
162
|
+
`Invalid route ./${key}. Route nodes cannot start with the '+' character. "Please rename to ${renamedRoute}"`
|
163
|
+
);
|
164
|
+
}
|
165
|
+
let specificity = 0;
|
166
|
+
const platformExtension = filenameWithoutExtensions.split(".")[1], hasPlatformExtension = validPlatforms.has(platformExtension), usePlatformRoutes = options.platformRoutes ?? !0;
|
167
|
+
if (hasPlatformExtension) {
|
168
|
+
if (usePlatformRoutes && options.platform ? platformExtension === options.platform ? specificity = 2 : platformExtension === "native" && options.platform !== "web" ? specificity = 1 : platformExtension !== options.platform && (specificity = -1) : specificity = -1, renderMode === "api" && specificity !== 0)
|
169
|
+
throw new Error(
|
170
|
+
`Api routes cannot have platform extensions. Please remove '.${platformExtension}' from './${key}'`
|
171
|
+
);
|
172
|
+
route = route.replace(new RegExp(`.${platformExtension}$`), "");
|
173
|
+
}
|
174
|
+
return {
|
175
|
+
route,
|
176
|
+
specificity,
|
177
|
+
isLayout,
|
178
|
+
renderMode
|
179
|
+
};
|
180
|
+
}
|
181
|
+
function getMostSpecific(routes) {
|
182
|
+
const route = routes[routes.length - 1];
|
183
|
+
if (!routes[0])
|
184
|
+
throw new Error(
|
185
|
+
` [one] The file ${route.contextKey} does not have a fallback sibling file without a platform extension in routes (${routes[0]}, ${routes.length}):
|
186
|
+
${routes.map((r) => r.contextKey || "NONE").join(`
|
187
|
+
`)}.`
|
188
|
+
);
|
189
|
+
return routes[routes.length - 1];
|
190
|
+
}
|
191
|
+
function getIgnoreList(options) {
|
192
|
+
const ignore = [/^\.\/\+html\.[tj]sx?$/, ...options?.ignore ?? []];
|
193
|
+
return options?.preserveApiRoutes !== !0 && ignore.push(/\+api\.[tj]sx?$/), ignore;
|
194
|
+
}
|
195
|
+
function extrapolateGroups(key, keys = /* @__PURE__ */ new Set()) {
|
196
|
+
const match = (0, import_matchers.matchArrayGroupName)(key);
|
197
|
+
if (!match)
|
198
|
+
return keys.add(key), keys;
|
199
|
+
const groups = match.split(",");
|
200
|
+
if (new Set(groups).size !== groups.length)
|
201
|
+
throw new Error(`Array syntax cannot contain duplicate group name "${groups}" in "${key}".`);
|
202
|
+
if (groups.length === 1)
|
203
|
+
return keys.add(key), keys;
|
204
|
+
for (const group of groups)
|
205
|
+
extrapolateGroups(key.replace(match, group.trim()), keys);
|
206
|
+
return keys;
|
207
|
+
}
|
208
|
+
function generateDynamic(path) {
|
209
|
+
const dynamic = path.split("/").map((part) => {
|
210
|
+
if (part === "+not-found")
|
211
|
+
return {
|
212
|
+
name: "+not-found",
|
213
|
+
deep: !0,
|
214
|
+
notFound: !0
|
215
|
+
};
|
216
|
+
const deepDynamicName = (0, import_matchers.matchDeepDynamicRouteName)(part), dynamicName = deepDynamicName ?? (0, import_matchers.matchDynamicName)(part);
|
217
|
+
return dynamicName ? { name: dynamicName, deep: !!deepDynamicName } : null;
|
218
|
+
}).filter((part) => !!part);
|
219
|
+
return dynamic.length === 0 ? null : dynamic;
|
220
|
+
}
|
221
|
+
function appendSitemapRoute(directory) {
|
222
|
+
directory.files.has("_sitemap") || directory.files.set("_sitemap", [
|
223
|
+
{
|
224
|
+
loadRoute() {
|
225
|
+
return { default: () => null, getNavOptions: () => {
|
226
|
+
} };
|
227
|
+
},
|
228
|
+
route: "_sitemap",
|
229
|
+
type: "ssg",
|
230
|
+
contextKey: "",
|
231
|
+
generated: !0,
|
232
|
+
internal: !0,
|
233
|
+
dynamic: null,
|
234
|
+
children: []
|
235
|
+
}
|
236
|
+
]);
|
237
|
+
}
|
238
|
+
function appendNotFoundRoute(directory) {
|
239
|
+
directory.files.has("+not-found") || directory.files.set("+not-found", [
|
240
|
+
{
|
241
|
+
loadRoute() {
|
242
|
+
return { default: () => null };
|
243
|
+
},
|
244
|
+
type: "spa",
|
245
|
+
route: "+not-found",
|
246
|
+
contextKey: "",
|
247
|
+
generated: !0,
|
248
|
+
internal: !0,
|
249
|
+
dynamic: [{ name: "+not-found", deep: !0, notFound: !0 }],
|
250
|
+
children: []
|
251
|
+
}
|
252
|
+
]);
|
253
|
+
}
|
254
|
+
function getLayoutNode(node, options) {
|
255
|
+
const groupName = (0, import_matchers.matchGroupName)(node.route);
|
256
|
+
let initialRouteName = node.children.find((child) => child.route.replace(/\/index$/, "") === groupName)?.route;
|
257
|
+
return {
|
258
|
+
...node,
|
259
|
+
route: node.route.replace(/\/?_layout$/, ""),
|
260
|
+
children: [],
|
261
|
+
// Each layout should have its own children
|
262
|
+
initialRouteName
|
263
|
+
};
|
264
|
+
}
|
265
|
+
function crawlAndAppendInitialRoutesAndEntryFiles(node, options, entryPoints = []) {
|
266
|
+
if (node.type === "spa" || node.type === "ssg" || node.type === "ssr")
|
267
|
+
node.entryPoints = [.../* @__PURE__ */ new Set([...entryPoints, node.contextKey])];
|
268
|
+
else if (node.type === "layout") {
|
269
|
+
if (!node.children)
|
270
|
+
throw new Error(`Layout "${node.contextKey}" does not contain any child routes`);
|
271
|
+
entryPoints = [...entryPoints, node.contextKey];
|
272
|
+
const groupName = (0, import_matchers.matchGroupName)(node.route);
|
273
|
+
let initialRouteName = node.children.find((child) => child.route.replace(/\/index$/, "") === groupName)?.route;
|
274
|
+
if (!options.internal_stripLoadRoute) {
|
275
|
+
const loaded = node.loadRoute();
|
276
|
+
loaded?.unstable_settings && (initialRouteName = loaded.unstable_settings.initialRouteName ?? initialRouteName, groupName && (initialRouteName = loaded.unstable_settings?.[groupName]?.initialRouteName ?? initialRouteName));
|
277
|
+
}
|
278
|
+
if (initialRouteName) {
|
279
|
+
const initialRoute = node.children.find((child) => child.route === initialRouteName);
|
280
|
+
if (!initialRoute) {
|
281
|
+
const validInitialRoutes = node.children.filter((child) => !child.generated).map((child) => `'${child.route}'`).join(", ");
|
282
|
+
throw groupName ? new Error(
|
283
|
+
`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}' for group '(${groupName})'. Valid options are: ${validInitialRoutes}`
|
284
|
+
) : new Error(
|
285
|
+
`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}'. Valid options are: ${validInitialRoutes}`
|
286
|
+
);
|
287
|
+
}
|
288
|
+
node.initialRouteName = initialRouteName, entryPoints.push(initialRoute.contextKey);
|
289
|
+
}
|
290
|
+
for (const child of node.children)
|
291
|
+
crawlAndAppendInitialRoutesAndEntryFiles(child, options, entryPoints);
|
292
|
+
}
|
293
|
+
}
|
294
|
+
//# sourceMappingURL=getRoutes.js.map
|
@@ -0,0 +1,24 @@
|
|
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 getURL_exports = {};
|
16
|
+
__export(getURL_exports, {
|
17
|
+
getURL: () => getURL
|
18
|
+
});
|
19
|
+
module.exports = __toCommonJS(getURL_exports);
|
20
|
+
const CLIENT_BASE_URL = typeof window < "u" && window.location ? `${window.location.protocol}//${window.location.host}` : "";
|
21
|
+
function getURL() {
|
22
|
+
return CLIENT_BASE_URL || process.env.ONE_SERVER_URL || "http://localhost";
|
23
|
+
}
|
24
|
+
//# sourceMappingURL=getURL.js.map
|