one 1.1.298 → 1.1.300
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/cleanUrl.js +1 -1
- package/dist/cjs/cleanUrl.js.map +1 -1
- package/dist/cjs/cleanUrl.native.js +1 -1
- package/dist/cjs/cleanUrl.native.js.map +1 -1
- package/dist/cjs/cli/runAndroid.js +34 -0
- package/dist/cjs/cli/runAndroid.js.map +6 -0
- package/dist/cjs/cli/runAndroid.native.js +39 -0
- package/dist/cjs/cli/runAndroid.native.js.map +6 -0
- package/dist/cjs/cli/runIos.js +34 -0
- package/dist/cjs/cli/runIos.js.map +6 -0
- package/dist/cjs/cli/runIos.native.js +39 -0
- package/dist/cjs/cli/runIos.native.js.map +6 -0
- package/dist/cjs/cli.js +23 -1
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/cli.native.js +25 -1
- package/dist/cjs/cli.native.js.map +2 -2
- package/dist/cjs/createHandleRequest.js +2 -2
- package/dist/cjs/createHandleRequest.js.map +1 -1
- package/dist/cjs/createHandleRequest.native.js +2 -2
- package/dist/cjs/createHandleRequest.native.js.map +2 -2
- package/dist/cjs/vite/createFileSystemRouter.js +1 -1
- package/dist/cjs/vite/createFileSystemRouter.js.map +1 -1
- package/dist/cjs/vite/createFileSystemRouter.native.js +1 -1
- package/dist/cjs/vite/createFileSystemRouter.native.js.map +1 -1
- package/dist/cjs/vite/replaceLoader.js +7 -1
- package/dist/cjs/vite/replaceLoader.js.map +1 -1
- package/dist/cjs/vite/replaceLoader.native.js +7 -1
- package/dist/cjs/vite/replaceLoader.native.js.map +1 -1
- package/dist/esm/Root.native.js +110 -104
- package/dist/esm/Root.native.js.map +6 -1
- package/dist/esm/Route.native.js +12 -10
- package/dist/esm/Route.native.js.map +6 -1
- package/dist/esm/cleanUrl.js +1 -1
- package/dist/esm/cleanUrl.js.map +1 -1
- package/dist/esm/cleanUrl.mjs +1 -1
- package/dist/esm/cleanUrl.mjs.map +1 -1
- package/dist/esm/cleanUrl.native.js +13 -14
- package/dist/esm/cleanUrl.native.js.map +6 -1
- package/dist/esm/cli/label-process.native.js +5 -4
- package/dist/esm/cli/label-process.native.js.map +6 -1
- package/dist/esm/cli/main.native.js +8 -13
- package/dist/esm/cli/main.native.js.map +6 -1
- package/dist/esm/cli/prebuild.native.js +5 -5
- package/dist/esm/cli/prebuild.native.js.map +6 -1
- package/dist/esm/cli/run.native.js +21 -28
- package/dist/esm/cli/run.native.js.map +6 -1
- package/dist/esm/cli/runAndroid.js +10 -0
- package/dist/esm/cli/runAndroid.js.map +6 -0
- package/dist/esm/cli/runAndroid.mjs +10 -0
- package/dist/esm/cli/runAndroid.mjs.map +1 -0
- package/dist/esm/cli/runAndroid.native.js +10 -0
- package/dist/esm/cli/runAndroid.native.js.map +6 -0
- package/dist/esm/cli/runIos.js +10 -0
- package/dist/esm/cli/runIos.js.map +6 -0
- package/dist/esm/cli/runIos.mjs +10 -0
- package/dist/esm/cli/runIos.mjs.map +1 -0
- package/dist/esm/cli/runIos.native.js +10 -0
- package/dist/esm/cli/runIos.native.js.map +6 -0
- package/dist/esm/cli.js +23 -1
- package/dist/esm/cli.js.map +1 -1
- package/dist/esm/cli.mjs +33 -1
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/cli.native.js +143 -148
- package/dist/esm/cli.native.js.map +6 -1
- package/dist/esm/clientLoaderResolver.native.js +9 -6
- package/dist/esm/clientLoaderResolver.native.js.map +6 -1
- package/dist/esm/config.native.js +12 -11
- package/dist/esm/config.native.js.map +6 -1
- package/dist/esm/constants.native.js +7 -5
- package/dist/esm/constants.native.js.map +6 -1
- package/dist/esm/createApp.native.js +13 -9
- package/dist/esm/createApp.native.js.map +6 -1
- package/dist/esm/createHandleRequest.js +2 -2
- package/dist/esm/createHandleRequest.js.map +1 -1
- package/dist/esm/createHandleRequest.mjs +2 -2
- package/dist/esm/createHandleRequest.mjs.map +1 -1
- package/dist/esm/createHandleRequest.native.js +57 -66
- package/dist/esm/createHandleRequest.native.js.map +6 -1
- package/dist/esm/createRoute.native.js +16 -16
- package/dist/esm/createRoute.native.js.map +6 -1
- package/dist/esm/fallbackViews/Sitemap.native.js +6 -3
- package/dist/esm/fallbackViews/Sitemap.native.js.map +6 -1
- package/dist/esm/fallbackViews/Unmatched.native.js +5 -3
- package/dist/esm/fallbackViews/Unmatched.native.js.map +6 -1
- package/dist/esm/fork/NavigationContainer.native.js +24 -31
- package/dist/esm/fork/NavigationContainer.native.js.map +6 -1
- package/dist/esm/fork/createMemoryHistory.native.js +99 -115
- package/dist/esm/fork/createMemoryHistory.native.js.map +6 -1
- package/dist/esm/fork/extractPathFromURL.native.js +16 -15
- package/dist/esm/fork/extractPathFromURL.native.js.map +6 -1
- package/dist/esm/fork/findFocusedRoute.native.js +6 -5
- package/dist/esm/fork/findFocusedRoute.native.js.map +6 -1
- package/dist/esm/fork/getPathFromState.native.js +127 -140
- package/dist/esm/fork/getPathFromState.native.js.map +6 -1
- package/dist/esm/fork/getStateFromPath.native.js +292 -288
- package/dist/esm/fork/getStateFromPath.native.js.map +6 -1
- package/dist/esm/fork/useLinking.native.js +70 -61
- package/dist/esm/fork/useLinking.native.js.map +6 -1
- package/dist/esm/fork/validatePathConfig.native.js +15 -9
- package/dist/esm/fork/validatePathConfig.native.js.map +6 -1
- package/dist/esm/getLinkingConfig.native.js +11 -6
- package/dist/esm/getLinkingConfig.native.js.map +6 -1
- package/dist/esm/getReactNavigationConfig.native.js +28 -20
- package/dist/esm/getReactNavigationConfig.native.js.map +6 -1
- package/dist/esm/getRoutes.native.js +249 -229
- package/dist/esm/getRoutes.native.js.map +6 -1
- package/dist/esm/getURL.native.js +4 -4
- package/dist/esm/getURL.native.js.map +6 -1
- package/dist/esm/head/Head.android.js +5 -3
- package/dist/esm/head/Head.android.js.map +6 -1
- package/dist/esm/head/Head.ios.js +144 -132
- package/dist/esm/head/Head.ios.js.map +6 -1
- package/dist/esm/head/Head.native.js +7 -7
- package/dist/esm/head/Head.native.js.map +6 -1
- package/dist/esm/head/HeadModule.native.js +6 -6
- package/dist/esm/head/HeadModule.native.js.map +6 -1
- package/dist/esm/head/index.native.js +2 -2
- package/dist/esm/head/index.native.js.map +6 -1
- package/dist/esm/head/types.native.js +1 -2
- package/dist/esm/head/types.native.js.map +6 -1
- package/dist/esm/head/url.native.js +10 -8
- package/dist/esm/head/url.native.js.map +6 -1
- package/dist/esm/hooks.native.js +53 -34
- package/dist/esm/hooks.native.js.map +6 -1
- package/dist/esm/imperative-api.native.js +9 -6
- package/dist/esm/imperative-api.native.js.map +6 -1
- package/dist/esm/import-mode/index.android.js +4 -3
- package/dist/esm/import-mode/index.android.js.map +6 -1
- package/dist/esm/import-mode/index.ios.js +4 -3
- package/dist/esm/import-mode/index.ios.js.map +6 -1
- package/dist/esm/import-mode/index.native.js +3 -1
- package/dist/esm/import-mode/index.native.js.map +6 -1
- package/dist/esm/index.native.js +65 -27
- package/dist/esm/index.native.js.map +6 -1
- package/dist/esm/interfaces/router.native.js +4 -2
- package/dist/esm/interfaces/router.native.js.map +6 -1
- package/dist/esm/layouts/Drawer.native.js +7 -6
- package/dist/esm/layouts/Drawer.native.js.map +6 -1
- package/dist/esm/layouts/Stack.native.js +7 -6
- package/dist/esm/layouts/Stack.native.js.map +6 -1
- package/dist/esm/layouts/Tabs.native.js +42 -39
- package/dist/esm/layouts/Tabs.native.js.map +6 -1
- package/dist/esm/layouts/withLayoutContext.native.js +51 -48
- package/dist/esm/layouts/withLayoutContext.native.js.map +6 -1
- package/dist/esm/link/Link.native.js +62 -53
- package/dist/esm/link/Link.native.js.map +6 -1
- package/dist/esm/link/Redirect.native.js +8 -9
- package/dist/esm/link/Redirect.native.js.map +6 -1
- package/dist/esm/link/href.native.js +28 -27
- package/dist/esm/link/href.native.js.map +6 -1
- package/dist/esm/link/linking.native.js +51 -40
- package/dist/esm/link/linking.native.js.map +6 -1
- package/dist/esm/link/path.native.js +28 -19
- package/dist/esm/link/path.native.js.map +6 -1
- package/dist/esm/link/useLinkTo.native.js +22 -20
- package/dist/esm/link/useLinkTo.native.js.map +6 -1
- package/dist/esm/link/useLoadedNavigation.native.js +30 -23
- package/dist/esm/link/useLoadedNavigation.native.js.map +6 -1
- package/dist/esm/matchers.native.js +16 -3
- package/dist/esm/matchers.native.js.map +6 -1
- package/dist/esm/platform.native.js +4 -2
- package/dist/esm/platform.native.js.map +6 -1
- package/dist/esm/polyfills-mobile.native.js +4 -5
- package/dist/esm/polyfills-mobile.native.js.map +6 -1
- package/dist/esm/polyfills-server.native.js +1 -1
- package/dist/esm/polyfills-server.native.js.map +6 -1
- package/dist/esm/render.native.js +3 -1
- package/dist/esm/render.native.js.map +6 -1
- package/dist/esm/router/RouterStore.native.js +1 -2
- package/dist/esm/router/RouterStore.native.js.map +6 -1
- package/dist/esm/router/constants.native.js +4 -2
- package/dist/esm/router/constants.native.js.map +6 -1
- package/dist/esm/router/getNormalizedStatePath.native.js +18 -17
- package/dist/esm/router/getNormalizedStatePath.native.js.map +6 -1
- package/dist/esm/router/lastAction.native.js +10 -9
- package/dist/esm/router/lastAction.native.js.map +6 -1
- package/dist/esm/router/router.native.js +135 -114
- package/dist/esm/router/router.native.js.map +6 -1
- package/dist/esm/router/serverLocationContext.native.js +4 -2
- package/dist/esm/router/serverLocationContext.native.js.map +6 -1
- package/dist/esm/router/useInitializeOneRouter.native.js +8 -5
- package/dist/esm/router/useInitializeOneRouter.native.js.map +6 -1
- package/dist/esm/serve.native.js +77 -104
- package/dist/esm/serve.native.js.map +6 -1
- package/dist/esm/server/createRoutesManifest.native.js +14 -11
- package/dist/esm/server/createRoutesManifest.native.js.map +6 -1
- package/dist/esm/server/getServerManifest.native.js +61 -67
- package/dist/esm/server/getServerManifest.native.js.map +6 -1
- package/dist/esm/server-render.native.js +9 -10
- package/dist/esm/server-render.native.js.map +6 -1
- package/dist/esm/sortRoutes.native.js +27 -17
- package/dist/esm/sortRoutes.native.js.map +6 -1
- package/dist/esm/typed-routes/generateRouteTypes.native.js +10 -11
- package/dist/esm/typed-routes/generateRouteTypes.native.js.map +6 -1
- package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js +38 -37
- package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js.map +6 -1
- package/dist/esm/types.native.js +1 -2
- package/dist/esm/types.native.js.map +6 -1
- package/dist/esm/useFocusEffect.native.js +25 -22
- package/dist/esm/useFocusEffect.native.js.map +6 -1
- package/dist/esm/useLoader.native.js +50 -50
- package/dist/esm/useLoader.native.js.map +6 -1
- package/dist/esm/useNavigation.native.js +23 -19
- package/dist/esm/useNavigation.native.js.map +6 -1
- package/dist/esm/useScreens.native.js +143 -160
- package/dist/esm/useScreens.native.js.map +6 -1
- package/dist/esm/useViteRoutes.native.js +25 -28
- package/dist/esm/useViteRoutes.native.js.map +6 -1
- package/dist/esm/utils/assertIsReady.native.js +6 -3
- package/dist/esm/utils/assertIsReady.native.js.map +6 -1
- package/dist/esm/utils/dynamicImport.native.js +5 -3
- package/dist/esm/utils/dynamicImport.native.js.map +6 -1
- package/dist/esm/utils/existsAsync.native.js +6 -4
- package/dist/esm/utils/existsAsync.native.js.map +6 -1
- package/dist/esm/utils/getPageExport.native.js +12 -11
- package/dist/esm/utils/getPageExport.native.js.map +6 -1
- package/dist/esm/utils/globDir.native.js +5 -3
- package/dist/esm/utils/globDir.native.js.map +6 -1
- package/dist/esm/utils/hashString.native.js +4 -2
- package/dist/esm/utils/hashString.native.js.map +6 -1
- package/dist/esm/utils/isResponse.native.js +4 -2
- package/dist/esm/utils/isResponse.native.js.map +6 -1
- package/dist/esm/utils/isStatus.native.js +4 -2
- package/dist/esm/utils/isStatus.native.js.map +6 -1
- package/dist/esm/utils/promiseWithResolvers.native.js +7 -7
- package/dist/esm/utils/promiseWithResolvers.native.js.map +6 -1
- package/dist/esm/utils/rand.native.js +5 -3
- package/dist/esm/utils/rand.native.js.map +6 -1
- package/dist/esm/utils/redirect.native.js +7 -5
- package/dist/esm/utils/redirect.native.js.map +6 -1
- package/dist/esm/utils/removeSearch.native.js +4 -2
- package/dist/esm/utils/removeSearch.native.js.map +6 -1
- package/dist/esm/utils/removeUndefined.native.js +6 -3
- package/dist/esm/utils/removeUndefined.native.js.map +6 -1
- package/dist/esm/utils/requireResolve.native.js +4 -2
- package/dist/esm/utils/requireResolve.native.js.map +6 -1
- package/dist/esm/utils/url.native.js +6 -2
- package/dist/esm/utils/url.native.js.map +6 -1
- package/dist/esm/utils/weakKey.native.js +11 -10
- package/dist/esm/utils/weakKey.native.js.map +6 -1
- package/dist/esm/utils/weakMemo.native.js +8 -8
- package/dist/esm/utils/weakMemo.native.js.map +6 -1
- package/dist/esm/views/EmptyRoute.native.js +5 -3
- package/dist/esm/views/EmptyRoute.native.js.map +6 -1
- package/dist/esm/views/ErrorBoundary.native.js +5 -8
- package/dist/esm/views/ErrorBoundary.native.js.map +6 -1
- package/dist/esm/views/LoadProgressBar.native.js +58 -57
- package/dist/esm/views/LoadProgressBar.native.js.map +6 -1
- package/dist/esm/views/Navigator.native.js +54 -71
- package/dist/esm/views/Navigator.native.js.map +6 -1
- package/dist/esm/views/PreloadLinks.native.js +3 -1
- package/dist/esm/views/PreloadLinks.native.js.map +6 -1
- package/dist/esm/views/RootErrorBoundary.native.js +39 -29
- package/dist/esm/views/RootErrorBoundary.native.js.map +6 -1
- package/dist/esm/views/Screen.native.js +12 -12
- package/dist/esm/views/Screen.native.js.map +6 -1
- package/dist/esm/views/ScrollRestoration.native.js +27 -27
- package/dist/esm/views/ScrollRestoration.native.js.map +6 -1
- package/dist/esm/views/Try.native.js +40 -37
- package/dist/esm/views/Try.native.js.map +6 -1
- package/dist/esm/vite/build.native.js +260 -295
- package/dist/esm/vite/build.native.js.map +6 -1
- package/dist/esm/vite/clientTreeShakePlugin.native.js +34 -33
- package/dist/esm/vite/clientTreeShakePlugin.native.js.map +6 -1
- package/dist/esm/vite/constants.native.js +6 -4
- package/dist/esm/vite/constants.native.js.map +6 -1
- package/dist/esm/vite/createFileSystemRouter.js +1 -1
- package/dist/esm/vite/createFileSystemRouter.js.map +1 -1
- package/dist/esm/vite/createFileSystemRouter.mjs +1 -1
- package/dist/esm/vite/createFileSystemRouter.mjs.map +1 -1
- package/dist/esm/vite/createFileSystemRouter.native.js +100 -131
- package/dist/esm/vite/createFileSystemRouter.native.js.map +6 -1
- package/dist/esm/vite/customNodeExternals.native.js +9 -10
- package/dist/esm/vite/customNodeExternals.native.js.map +6 -1
- package/dist/esm/vite/ensureTsConfig.native.js +7 -5
- package/dist/esm/vite/ensureTsConfig.native.js.map +6 -1
- package/dist/esm/vite/findDepsToOptimize.native.js +27 -19
- package/dist/esm/vite/findDepsToOptimize.native.js.map +6 -1
- package/dist/esm/vite/fixDependenciesPlugin.native.js +5 -3
- package/dist/esm/vite/fixDependenciesPlugin.native.js.map +6 -1
- package/dist/esm/vite/generateTypesForRoutes.native.js +9 -9
- package/dist/esm/vite/generateTypesForRoutes.native.js.map +6 -1
- package/dist/esm/vite/getManifest.native.js +6 -4
- package/dist/esm/vite/getManifest.native.js.map +6 -1
- package/dist/esm/vite/headers.native.js +11 -5
- package/dist/esm/vite/headers.native.js.map +6 -1
- package/dist/esm/vite/loadEnv.native.js +7 -6
- package/dist/esm/vite/loadEnv.native.js.map +6 -1
- package/dist/esm/vite/makePluginWebOnly.native.js +9 -5
- package/dist/esm/vite/makePluginWebOnly.native.js.map +6 -1
- package/dist/esm/vite/one.native.js +142 -127
- package/dist/esm/vite/one.native.js.map +6 -1
- package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js +14 -11
- package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js.map +6 -1
- package/dist/esm/vite/replaceLoader.js +7 -1
- package/dist/esm/vite/replaceLoader.js.map +1 -1
- package/dist/esm/vite/replaceLoader.mjs +5 -1
- package/dist/esm/vite/replaceLoader.mjs.map +1 -1
- package/dist/esm/vite/replaceLoader.native.js +13 -10
- package/dist/esm/vite/replaceLoader.native.js.map +6 -1
- package/dist/esm/vite/resolveAPIRequest.native.js +44 -47
- package/dist/esm/vite/resolveAPIRequest.native.js.map +6 -1
- package/dist/esm/vite/server.native.js +5 -4
- package/dist/esm/vite/server.native.js.map +6 -1
- package/dist/esm/vite/types.native.js +1 -2
- package/dist/esm/vite/types.native.js.map +6 -1
- package/dist/esm/vite/virtualEntryPlugin.native.js +21 -16
- package/dist/esm/vite/virtualEntryPlugin.native.js.map +6 -1
- package/dist/esm/vite/vitePluginSsrCss.native.js +61 -50
- package/dist/esm/vite/vitePluginSsrCss.native.js.map +6 -1
- package/dist/esm/vite.native.js +19 -10
- package/dist/esm/vite.native.js.map +6 -1
- package/dist/esm/zero/getQueryKey.native.js +5 -3
- package/dist/esm/zero/getQueryKey.native.js.map +6 -1
- package/dist/esm/zero/isZeroQuery.native.js +4 -2
- package/dist/esm/zero/isZeroQuery.native.js.map +6 -1
- package/dist/esm/zero/resolveQuery.native.js +9 -8
- package/dist/esm/zero/resolveQuery.native.js.map +6 -1
- package/dist/esm/zero/subscribeToQuery.native.js +5 -3
- package/dist/esm/zero/subscribeToQuery.native.js.map +6 -1
- package/dist/esm/zero/types.native.js +1 -2
- package/dist/esm/zero/types.native.js.map +6 -1
- package/dist/esm/zero/useQuery.native.js +12 -12
- package/dist/esm/zero/useQuery.native.js.map +6 -1
- package/dist/esm/zero/useQueryZero.native.js +24 -20
- package/dist/esm/zero/useQueryZero.native.js.map +6 -1
- package/dist/esm/zero.native.js +9 -5
- package/dist/esm/zero.native.js.map +6 -1
- package/package.json +7 -7
- package/src/cleanUrl.ts +1 -1
- package/src/cli/runAndroid.ts +6 -0
- package/src/cli/runIos.ts +6 -0
- package/src/cli.ts +27 -1
- package/src/createHandleRequest.ts +7 -0
- package/src/vite/createFileSystemRouter.tsx +1 -2
- package/src/vite/replaceLoader.ts +7 -1
- package/types/cli/runAndroid.d.ts +2 -0
- package/types/cli/runAndroid.d.ts.map +1 -0
- package/types/cli/runIos.d.ts +2 -0
- package/types/cli/runIos.d.ts.map +1 -0
- package/types/createHandleRequest.d.ts.map +1 -1
- package/types/vite/createFileSystemRouter.d.ts.map +1 -1
- package/types/vite/replaceLoader.d.ts.map +1 -1
@@ -2,60 +2,53 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createElement as _createElement } from "react";
|
3
3
|
import { createNavigatorFactory } from "@react-navigation/core";
|
4
4
|
import React, { Suspense, useEffect, useState } from "react";
|
5
|
-
import { Route, useRouteNode } from "./Route
|
5
|
+
import { Route, useRouteNode } from "./Route";
|
6
6
|
import One_ROUTER_IMPORT_MODE from "./import-mode";
|
7
|
-
import { sortRoutesWithInitial } from "./sortRoutes
|
8
|
-
import { EmptyRoute } from "./views/EmptyRoute
|
9
|
-
import { RootErrorBoundary } from "./views/RootErrorBoundary
|
10
|
-
import { Try } from "./views/Try
|
11
|
-
import { getPageExport } from "./utils/getPageExport
|
12
|
-
var {
|
13
|
-
Screen,
|
14
|
-
Group
|
15
|
-
} = createNavigatorFactory({})();
|
7
|
+
import { sortRoutesWithInitial } from "./sortRoutes";
|
8
|
+
import { EmptyRoute } from "./views/EmptyRoute";
|
9
|
+
import { RootErrorBoundary } from "./views/RootErrorBoundary";
|
10
|
+
import { Try } from "./views/Try";
|
11
|
+
import { getPageExport } from "./utils/getPageExport";
|
12
|
+
var { Screen, Group } = createNavigatorFactory({})();
|
16
13
|
function getSortedChildren(children, order, initialRouteName) {
|
17
|
-
if (!order?.length)
|
14
|
+
if (!order?.length)
|
15
|
+
return children.sort(sortRoutesWithInitial(initialRouteName)).map(function(route) {
|
16
|
+
return {
|
17
|
+
route,
|
18
|
+
props: {}
|
19
|
+
};
|
20
|
+
});
|
21
|
+
var entries = [
|
22
|
+
...children
|
23
|
+
], ordered = order.map(function(param) {
|
24
|
+
var { name, redirect, initialParams, listeners, options, getId } = param;
|
25
|
+
if (!entries.length)
|
26
|
+
return console.warn(`[Layout children]: Too many screens defined. Route "${name}" is extraneous.`), null;
|
27
|
+
var matchIndex = entries.findIndex(function(child) {
|
28
|
+
return child.route === name;
|
29
|
+
});
|
30
|
+
if (matchIndex === -1)
|
31
|
+
return console.warn(`[Layout children]: No route named "${name}" exists in nested children:`, children.map(function(param2) {
|
32
|
+
var { route } = param2;
|
33
|
+
return route;
|
34
|
+
})), null;
|
35
|
+
var match = entries[matchIndex];
|
36
|
+
if (entries.splice(matchIndex, 1), redirect) {
|
37
|
+
if (typeof redirect == "string")
|
38
|
+
throw new Error("Redirecting to a specific route is not supported yet.");
|
39
|
+
return null;
|
40
|
+
}
|
18
41
|
return {
|
19
|
-
route,
|
20
|
-
props: {
|
21
|
-
};
|
22
|
-
});
|
23
|
-
var entries = [...children],
|
24
|
-
ordered = order.map(function (param) {
|
25
|
-
var {
|
26
|
-
name,
|
27
|
-
redirect,
|
42
|
+
route: match,
|
43
|
+
props: {
|
28
44
|
initialParams,
|
29
45
|
listeners,
|
30
46
|
options,
|
31
47
|
getId
|
32
|
-
} = param;
|
33
|
-
if (!entries.length) return console.warn(`[Layout children]: Too many screens defined. Route "${name}" is extraneous.`), null;
|
34
|
-
var matchIndex = entries.findIndex(function (child) {
|
35
|
-
return child.route === name;
|
36
|
-
});
|
37
|
-
if (matchIndex === -1) return console.warn(`[Layout children]: No route named "${name}" exists in nested children:`, children.map(function (param2) {
|
38
|
-
var {
|
39
|
-
route
|
40
|
-
} = param2;
|
41
|
-
return route;
|
42
|
-
})), null;
|
43
|
-
var match = entries[matchIndex];
|
44
|
-
if (entries.splice(matchIndex, 1), redirect) {
|
45
|
-
if (typeof redirect == "string") throw new Error("Redirecting to a specific route is not supported yet.");
|
46
|
-
return null;
|
47
48
|
}
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
initialParams,
|
52
|
-
listeners,
|
53
|
-
options,
|
54
|
-
getId
|
55
|
-
}
|
56
|
-
};
|
57
|
-
}).filter(Boolean);
|
58
|
-
return ordered.push(...entries.sort(sortRoutesWithInitial(initialRouteName)).map(function (route) {
|
49
|
+
};
|
50
|
+
}).filter(Boolean);
|
51
|
+
return ordered.push(...entries.sort(sortRoutesWithInitial(initialRouteName)).map(function(route) {
|
59
52
|
return {
|
60
53
|
route,
|
61
54
|
props: {}
|
@@ -63,57 +56,59 @@ function getSortedChildren(children, order, initialRouteName) {
|
|
63
56
|
})), ordered;
|
64
57
|
}
|
65
58
|
function useSortedScreens(order) {
|
66
|
-
var node = useRouteNode(),
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
59
|
+
var node = useRouteNode(), sortedScreens = React.useMemo(function() {
|
60
|
+
var _node_children, sorted = !(node == null || (_node_children = node.children) === null || _node_children === void 0) && _node_children.length ? getSortedChildren(node.children, order, node.initialRouteName) : [];
|
61
|
+
return sorted.map(function(value) {
|
62
|
+
return routeToScreen(value.route, value.props);
|
63
|
+
});
|
64
|
+
}, [
|
65
|
+
node?.children,
|
66
|
+
node?.initialRouteName,
|
67
|
+
order
|
68
|
+
]);
|
74
69
|
return sortedScreens;
|
75
70
|
}
|
76
71
|
function fromImport(param) {
|
77
|
-
var {
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
})
|
92
|
-
};
|
72
|
+
var { ErrorBoundary, ...component } = param;
|
73
|
+
if (ErrorBoundary)
|
74
|
+
return {
|
75
|
+
default: /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
76
|
+
var children = /* @__PURE__ */ React.createElement(getPageExport(component) || EmptyRoute, {
|
77
|
+
...props,
|
78
|
+
ref
|
79
|
+
});
|
80
|
+
return /* @__PURE__ */ _jsx(Try, {
|
81
|
+
catch: ErrorBoundary,
|
82
|
+
children
|
83
|
+
});
|
84
|
+
})
|
85
|
+
};
|
93
86
|
if (process.env.NODE_ENV !== "production") {
|
94
87
|
var exported = getPageExport(component);
|
95
|
-
if (exported && typeof exported == "object" && Object.keys(exported).length === 0)
|
96
|
-
|
97
|
-
|
88
|
+
if (exported && typeof exported == "object" && Object.keys(exported).length === 0)
|
89
|
+
return {
|
90
|
+
default: EmptyRoute
|
91
|
+
};
|
98
92
|
}
|
99
93
|
return {
|
100
94
|
default: getPageExport(component)
|
101
95
|
};
|
102
96
|
}
|
103
|
-
var qualifiedStore = /* @__PURE__ */new WeakMap();
|
97
|
+
var qualifiedStore = /* @__PURE__ */ new WeakMap();
|
104
98
|
function getQualifiedRouteComponent(value) {
|
105
|
-
if (value && qualifiedStore.has(value))
|
99
|
+
if (value && qualifiedStore.has(value))
|
100
|
+
return qualifiedStore.get(value);
|
106
101
|
var ScreenComponent;
|
107
|
-
One_ROUTER_IMPORT_MODE === "lazy" ? ScreenComponent = /* @__PURE__ */React.forwardRef(function
|
102
|
+
One_ROUTER_IMPORT_MODE === "lazy" ? ScreenComponent = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
108
103
|
var [loaded, setLoaded] = useState(null);
|
109
|
-
if (useEffect(function
|
104
|
+
if (useEffect(function() {
|
110
105
|
try {
|
111
106
|
var found = value.loadRoute();
|
112
107
|
found && setLoaded(found);
|
113
108
|
} catch (err) {
|
114
|
-
err instanceof Promise ? err.then(function
|
109
|
+
err instanceof Promise ? err.then(function(res) {
|
115
110
|
setLoaded(res);
|
116
|
-
}).catch(function
|
111
|
+
}).catch(function(err2) {
|
117
112
|
console.error("Error loading route", err2);
|
118
113
|
}) : setLoaded(err);
|
119
114
|
}
|
@@ -121,76 +116,70 @@ function getQualifiedRouteComponent(value) {
|
|
121
116
|
var Component = getPageExport(fromImport(loaded));
|
122
117
|
return (
|
123
118
|
// <Suspense fallback={null}>
|
124
|
-
/* @__PURE__ */
|
125
|
-
_jsx(Component, {
|
119
|
+
/* @__PURE__ */ _jsx(Component, {
|
126
120
|
...props,
|
127
121
|
ref
|
128
122
|
})
|
129
123
|
);
|
130
124
|
}
|
131
125
|
return null;
|
132
|
-
}) : ScreenComponent = /* @__PURE__ */React.forwardRef(function
|
133
|
-
var res = value.loadRoute(),
|
134
|
-
Component = getPageExport(fromImport(res));
|
126
|
+
}) : ScreenComponent = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
127
|
+
var res = value.loadRoute(), Component = getPageExport(fromImport(res));
|
135
128
|
return (
|
136
129
|
// <Suspense fallback={null}>
|
137
|
-
/* @__PURE__ */
|
138
|
-
_jsx(Component, {
|
130
|
+
/* @__PURE__ */ _jsx(Component, {
|
139
131
|
...props,
|
140
132
|
ref
|
141
133
|
})
|
142
134
|
);
|
143
135
|
});
|
144
|
-
var wrapSuspense = function
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
}
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
} = param;
|
167
|
-
return useEffect(function () {},
|
136
|
+
var wrapSuspense = function(children) {
|
137
|
+
return /* @__PURE__ */ _jsx(Suspense, {
|
138
|
+
fallback: /* @__PURE__ */ _jsx(SuspenseFallback, {
|
139
|
+
route: value
|
140
|
+
}),
|
141
|
+
children
|
142
|
+
});
|
143
|
+
}, getLoadable = function(props, ref) {
|
144
|
+
return /* @__PURE__ */ _jsx(RootErrorBoundary, {
|
145
|
+
children: wrapSuspense(/* @__PURE__ */ _jsx(ScreenComponent, {
|
146
|
+
...props,
|
147
|
+
ref,
|
148
|
+
// Expose the template segment path, e.g. `(home)`, `[foo]`, `index`
|
149
|
+
// the intention is to make it possible to deduce shared routes.
|
150
|
+
segment: value.route
|
151
|
+
}))
|
152
|
+
});
|
153
|
+
}, SuspenseFallback = function(param) {
|
154
|
+
var { route } = param;
|
155
|
+
return useEffect(
|
156
|
+
function() {
|
157
|
+
},
|
168
158
|
// console.info(`⚠️ Suspended:`, route)
|
169
|
-
[
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
159
|
+
[
|
160
|
+
route
|
161
|
+
]
|
162
|
+
), null;
|
163
|
+
}, QualifiedRoute = /* @__PURE__ */ React.forwardRef(function(param, ref) {
|
164
|
+
var {
|
165
|
+
// Remove these React Navigation props to
|
166
|
+
// enforce usage of router hooks (where the query params are correct).
|
167
|
+
route,
|
168
|
+
navigation,
|
169
|
+
// Pass all other props to the component
|
170
|
+
...props
|
171
|
+
} = param, loadable = getLoadable(props, ref);
|
172
|
+
return /* @__PURE__ */ _jsx(Route, {
|
173
|
+
node: value,
|
174
|
+
children: loadable
|
185
175
|
});
|
176
|
+
});
|
186
177
|
return QualifiedRoute.displayName = `Route(${value.route})`, qualifiedStore.set(value, QualifiedRoute), QualifiedRoute;
|
187
178
|
}
|
188
179
|
function createGetIdForRoute(route) {
|
189
|
-
var include = /* @__PURE__ */new Map();
|
180
|
+
var include = /* @__PURE__ */ new Map();
|
190
181
|
if (route.dynamic) {
|
191
|
-
var _iteratorNormalCompletion = !0,
|
192
|
-
_didIteratorError = !1,
|
193
|
-
_iteratorError = void 0;
|
182
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
194
183
|
try {
|
195
184
|
for (var _iterator = route.dynamic[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
196
185
|
var segment = _step.value;
|
@@ -202,22 +191,16 @@ function createGetIdForRoute(route) {
|
|
202
191
|
try {
|
203
192
|
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
204
193
|
} finally {
|
205
|
-
if (_didIteratorError)
|
194
|
+
if (_didIteratorError)
|
195
|
+
throw _iteratorError;
|
206
196
|
}
|
207
197
|
}
|
208
198
|
}
|
209
|
-
return function
|
210
|
-
var {
|
211
|
-
params = {}
|
212
|
-
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {},
|
213
|
-
segments = [],
|
214
|
-
_iteratorNormalCompletion2 = !0,
|
215
|
-
_didIteratorError2 = !1,
|
216
|
-
_iteratorError2 = void 0;
|
199
|
+
return function() {
|
200
|
+
var { params = {} } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, segments = [], _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
|
217
201
|
try {
|
218
202
|
for (var _iterator2 = include.values()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
|
219
|
-
var dynamic = _step2.value,
|
220
|
-
value = params?.[dynamic.name];
|
203
|
+
var dynamic = _step2.value, value = params?.[dynamic.name];
|
221
204
|
Array.isArray(value) && value.length > 0 ? segments.push(value.join("/")) : value && !Array.isArray(value) ? segments.push(value) : dynamic.deep ? segments.push(`[...${dynamic.name}]`) : segments.push(`[${dynamic.name}]`);
|
222
205
|
}
|
223
206
|
} catch (err) {
|
@@ -226,7 +209,8 @@ function createGetIdForRoute(route) {
|
|
226
209
|
try {
|
227
210
|
!_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
|
228
211
|
} finally {
|
229
|
-
if (_didIteratorError2)
|
212
|
+
if (_didIteratorError2)
|
213
|
+
throw _iteratorError2;
|
230
214
|
}
|
231
215
|
}
|
232
216
|
var _segments_join;
|
@@ -234,36 +218,35 @@ function createGetIdForRoute(route) {
|
|
234
218
|
};
|
235
219
|
}
|
236
220
|
function routeToScreen(route) {
|
237
|
-
var {
|
238
|
-
|
239
|
-
...props
|
240
|
-
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
241
|
-
return /* @__PURE__ */_createElement(Screen, {
|
221
|
+
var { options, ...props } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
222
|
+
return /* @__PURE__ */ _createElement(Screen, {
|
242
223
|
// Users can override the screen getId function.
|
243
224
|
getId: createGetIdForRoute(route),
|
244
225
|
...props,
|
245
226
|
name: route.route,
|
246
227
|
key: route.route,
|
247
|
-
options: function
|
248
|
-
var _route_loadRoute,
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
...staticResult,
|
254
|
-
...dynamicResult
|
255
|
-
};
|
256
|
-
return route.generated && (output.tabBarButton = function () {
|
228
|
+
options: function(args) {
|
229
|
+
var _route_loadRoute, staticOptions = route.generated ? (_route_loadRoute = route.loadRoute()) === null || _route_loadRoute === void 0 ? void 0 : _route_loadRoute.getNavOptions : null, staticResult = typeof staticOptions == "function" ? staticOptions(args) : staticOptions, dynamicResult = typeof options == "function" ? options?.(args) : options, output = {
|
230
|
+
...staticResult,
|
231
|
+
...dynamicResult
|
232
|
+
};
|
233
|
+
return route.generated && (output.tabBarButton = function() {
|
257
234
|
return null;
|
258
235
|
}, output.drawerItemStyle = {
|
259
236
|
height: 0,
|
260
237
|
display: "none"
|
261
238
|
}), output;
|
262
239
|
},
|
263
|
-
getComponent: function
|
240
|
+
getComponent: function() {
|
264
241
|
return getQualifiedRouteComponent(route);
|
265
242
|
}
|
266
243
|
});
|
267
244
|
}
|
268
|
-
export {
|
269
|
-
|
245
|
+
export {
|
246
|
+
Group,
|
247
|
+
Screen,
|
248
|
+
createGetIdForRoute,
|
249
|
+
getQualifiedRouteComponent,
|
250
|
+
useSortedScreens
|
251
|
+
};
|
252
|
+
//# sourceMappingURL=useScreens.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/Users/n8/one/packages/one/src/useScreens.tsx"],
|
4
|
+
"mappings": ";;AAAA,SAASA,8BAA8B;AAQvC,OAAOC,SAASC,UAAUC,WAAWC,gBAAgB;AACrD,SACEC,OACAC,oBAIK;AACP,OAAOC,4BAA4B;AACnC,SAASC,6BAA6B;AACtC,SAASC,kBAAkB;AAC3B,SAASC,yBAAyB;AAClC,SAASC,WAAW;AACpB,SAASC,qBAAqB;AAIvB,IAAM,EAAEC,QAAQ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IAAAC,kBAAA;;;SAAAF,8BAAAG,WAAA,UAAA,QAAAA,WAAA,OAAA;;YAAAF;gBAAAC;;;QAeEH;AAAP,YAAOA,iBAAAA,SAASS,KAAK,GAAA,OAAA,QAAdT,mBAAAA,SAAAA,iBAAsB1E,MAAMqF;EACrC;AACF;AAEA,SAASzD,cAAc5B,OAAgB;MAAE,EAAEQ,SAAS,GAAGP,MAAAA,IAAd,UAAA,SAAA,KAAA,UAAA,CAAA,MAAA,SAAA,UAAA,CAAA,IAA8C,CAAC;AACtF,SACE,+BAACV,QAAAA;;IAECkB,OAAO4D,oBAAoBrE,KAAAA;IAC1B,GAAGC;IACJG,MAAMJ,MAAMA;IACZsF,KAAKtF,MAAMA;IACXQ,SAAS,SAAC+E,MAAAA;UAEgCvF,kBAAlCwF,gBAAgBxF,MAAMyF,aAAYzF,mBAAAA,MAAMoD,UAAS,OAAA,QAAfpD,qBAAAA,SAAAA,SAAAA,iBAAmB0F,gBAAgB,MACrEC,eACJ,OAAOH,iBAAkB,aAAaA,cAAcD,IAAAA,IAAQC,eACxDI,gBAAgB,OAAOpF,WAAY,aAAaA,UAAU+E,IAAAA,IAAQ/E,SAClEqF,SAAS;QACb,GAAGF;QACH,GAAGC;MACL;AAGA,aAAI5F,MAAMyF,cACRI,OAAOC,eAAe,WAAA;eAAM;SAE5BD,OAAOE,kBAAkB;QAAEC,QAAQ;QAAGC,SAAS;MAAO,IAGjDJ;IACT;IACAK,cAAc,WAAA;aAAMrD,2BAA2B7C,KAAAA;;;AAGrD;",
|
5
|
+
"names": ["createNavigatorFactory", "React", "Suspense", "useEffect", "useState", "Route", "useRouteNode", "One_ROUTER_IMPORT_MODE", "sortRoutesWithInitial", "EmptyRoute", "RootErrorBoundary", "Try", "getPageExport", "Screen", "Group", "getSortedChildren", "children", "order", "initialRouteName", "length", "sort", "map", "route", "props", "entries", "ordered", "name", "redirect", "initialParams", "listeners", "options", "getId", "console", "warn", "matchIndex", "findIndex", "child", "param", "match", "splice", "Error", "filter", "Boolean", "push", "useSortedScreens", "node", "sortedScreens", "useMemo", "sorted", "value", "routeToScreen", "fromImport", "ErrorBoundary", "component", "default", "forwardRef", "ref", "createElement", "catch", "process", "env", "NODE_ENV", "exported", "Object", "keys", "qualifiedStore", "WeakMap", "getQualifiedRouteComponent", "has", "get", "ScreenComponent", "loaded", "setLoaded", "found", "loadRoute", "err", "Promise", "then", "res", "error", "Component", "wrapSuspense", "fallback", "SuspenseFallback", "getLoadable", "segment", "QualifiedRoute", "navigation", "loadable", "displayName", "set", "createGetIdForRoute", "include", "Map", "dynamic", "params", "segments", "_iteratorNormalCompletion", "_didIteratorError", "_iteratorError", "_iterator", "values", "_step", "Array", "isArray", "join", "deep", "contextKey", "key", "args", "staticOptions", "generated", "getNavOptions", "staticResult", "dynamicResult", "output", "tabBarButton", "drawerItemStyle", "height", "display", "getComponent"]
|
6
|
+
}
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import { getLoaderPath } from "./cleanUrl
|
2
|
-
import { dynamicImport } from "./utils/dynamicImport
|
3
|
-
var lastVersion = 0,
|
4
|
-
context;
|
1
|
+
import { getLoaderPath } from "./cleanUrl";
|
2
|
+
import { dynamicImport } from "./utils/dynamicImport";
|
3
|
+
var lastVersion = 0, context;
|
5
4
|
function useViteRoutes(routes, options, version) {
|
6
5
|
return version && version > lastVersion && (context = null, lastVersion = version), context || loadRoutes(routes, options), context;
|
7
6
|
}
|
@@ -9,50 +8,48 @@ function loadRoutes(paths, options) {
|
|
9
8
|
return context || (globalThis.__importMetaGlobbed = paths, context = globbedRoutesToRouteContext(paths, options), context);
|
10
9
|
}
|
11
10
|
function globbedRoutesToRouteContext(paths, options) {
|
12
|
-
var routesSync = {},
|
13
|
-
|
14
|
-
loadedRoutes = {},
|
15
|
-
clears = {};
|
16
|
-
Object.keys(paths).map(function (path) {
|
11
|
+
var routesSync = {}, promises = {}, loadedRoutes = {}, clears = {};
|
12
|
+
Object.keys(paths).map(function(path) {
|
17
13
|
var _options_routeModes;
|
18
14
|
if (!paths[path]) {
|
19
15
|
console.error(`Error: Missing route at path ${path}`);
|
20
16
|
return;
|
21
17
|
}
|
22
|
-
var loadRouteFunction = paths[path],
|
23
|
-
|
24
|
-
shouldRewrite = typeof window < "u" && window.location && !import.meta.env.PROD,
|
25
|
-
originalPath = pathWithoutRelative.slice(1).replace(/\.[jt]sx?$/, "");
|
26
|
-
(options == null || (_options_routeModes = options.routeModes) === null || _options_routeModes === void 0 ? void 0 : _options_routeModes[originalPath]) === "spa" ? (console.info(`Spa mode: ${originalPath}`), loadedRoutes[pathWithoutRelative] = function () {
|
18
|
+
var loadRouteFunction = paths[path], pathWithoutRelative = path.replace("/app/", "./"), shouldRewrite = typeof window < "u" && window.location && !import.meta.env.PROD, originalPath = pathWithoutRelative.slice(1).replace(/\.[jt]sx?$/, "");
|
19
|
+
(options == null || (_options_routeModes = options.routeModes) === null || _options_routeModes === void 0 ? void 0 : _options_routeModes[originalPath]) === "spa" ? (console.info(`Spa mode: ${originalPath}`), loadedRoutes[pathWithoutRelative] = function() {
|
27
20
|
return null;
|
28
|
-
}) : shouldRewrite ? routesSync[pathWithoutRelative] = path.includes("_layout.") || path.includes("+spa") ? loadRouteFunction : function
|
29
|
-
var _globalThis___vxrntodopath,
|
30
|
-
realPath = ((_globalThis___vxrntodopath = globalThis.__vxrntodopath) !== null && _globalThis___vxrntodopath !== void 0 ? _globalThis___vxrntodopath : window.location.pathname).trim(),
|
31
|
-
importUrl = getLoaderPath(realPath);
|
21
|
+
}) : shouldRewrite ? routesSync[pathWithoutRelative] = path.includes("_layout.") || path.includes("+spa") ? loadRouteFunction : function() {
|
22
|
+
var _globalThis___vxrntodopath, realPath = ((_globalThis___vxrntodopath = globalThis.__vxrntodopath) !== null && _globalThis___vxrntodopath !== void 0 ? _globalThis___vxrntodopath : window.location.pathname).trim(), importUrl = getLoaderPath(realPath);
|
32
23
|
return dynamicImport(importUrl);
|
33
24
|
} : routesSync[pathWithoutRelative] = loadRouteFunction;
|
34
25
|
});
|
35
26
|
var moduleKeys = Object.keys(routesSync);
|
36
27
|
function resolve(id) {
|
37
|
-
if (clearTimeout(clears[id]), loadedRoutes[id])
|
38
|
-
|
39
|
-
|
40
|
-
return
|
28
|
+
if (clearTimeout(clears[id]), loadedRoutes[id])
|
29
|
+
return loadedRoutes[id];
|
30
|
+
if (typeof routesSync[id] != "function")
|
31
|
+
return routesSync[id];
|
32
|
+
throw promises[id] || (promises[id] = routesSync[id]().then(function(val) {
|
33
|
+
return loadedRoutes[id] = val, delete promises[id], clears[id] = setTimeout(function() {
|
41
34
|
delete loadedRoutes[id];
|
42
35
|
}, 500), val;
|
43
|
-
}).catch(function
|
36
|
+
}).catch(function(err) {
|
44
37
|
console.error("Error loading route", id, err, new Error().stack), loadedRoutes[id] = {
|
45
|
-
default: function
|
38
|
+
default: function() {
|
46
39
|
return null;
|
47
40
|
}
|
48
41
|
}, delete promises[id];
|
49
42
|
}), process.env.NODE_ENV === "development" && (promises[id].stack = new Error().stack)), promises[id];
|
50
43
|
}
|
51
|
-
return resolve.keys = function
|
44
|
+
return resolve.keys = function() {
|
52
45
|
return moduleKeys;
|
53
|
-
}, resolve.id = "", resolve.resolve = function
|
46
|
+
}, resolve.id = "", resolve.resolve = function(id) {
|
54
47
|
return id;
|
55
48
|
}, resolve;
|
56
49
|
}
|
57
|
-
export {
|
58
|
-
|
50
|
+
export {
|
51
|
+
globbedRoutesToRouteContext,
|
52
|
+
loadRoutes,
|
53
|
+
useViteRoutes
|
54
|
+
};
|
55
|
+
//# sourceMappingURL=useViteRoutes.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/Users/n8/one/packages/one/src/useViteRoutes.tsx"],
|
4
|
+
"mappings": "AAAA,SAASA,qBAAqB;AAE9B,SAASC,qBAAqB;AAK9B,IAAIC,cAAc,GACdC;AAGG,SAASC,cACdC,QACAC,SACAC,SAAgB;AAEhB,SAAIA,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CAAA;AAEA,MAAMiB,aAAavB,OAAOC,KAAKL,UAAAA;AAE/B,WAAS4B,QAAQC,IAAU;AAEzB,QADAC,aAAa3B,OAAO0B,EAAAA,CAAG,GACnB3B,aAAa2B,EAAAA;AACf,aAAO3B,aAAa2B,EAAAA;AAEtB,QAAI,OAAO7B,WAAW6B,EAAAA,KAAQ;AAC5B,aAAO7B,WAAW6B,EAAAA;AAEpB,UAAK5B,SAAS4B,EAAAA,MACZ5B,SAAS4B,EAAAA,IAAM7B,WAAW6B,EAAAA,EAAG,EAC1BE,KAAK,SAACC,KAAAA;AACL9B,0BAAa2B,EAAAA,IAAMG,KACnB,OAAO/B,SAAS4B,EAAAA,GAGhB1B,OAAO0B,EAAAA,IAAMI,WAAW,WAAA;AACtB,eAAO/B,aAAa2B,EAAAA;MACtB,GAAG,GAAA,GAEIG;IACT,CAAA,EACCE,MAAM,SAACC,KAAAA;AACN3B,cAAQC,MAAM,uBAAuBoB,IAAIM,KAAK,IAAIC,MAAAA,EAAQC,KAAK,GAC/DnC,aAAa2B,EAAAA,IAAM;QACjBS,SAAS,WAAA;iBAAM;;MAkBjB,GACA,OAAOrC,SAAS4B,EAAAA;IAClB,CAAA,GAEEU,QAAQvB,IAAIwB,aAAa,kBAC3BvC,SAAS4B,EAAAA,EAAIQ,QAAQ,IAAID,MAAAA,EAAQC,SAO/BpC,SAAS4B,EAAAA;EACjB;AAEAD,iBAAQvB,OAAO,WAAA;WAAMsB;KACrBC,QAAQC,KAAK,IACbD,QAAQA,UAAU,SAACC,IAAAA;WAAeA;KAE3BD;AACT;",
|
5
|
+
"names": ["getLoaderPath", "dynamicImport", "lastVersion", "context", "useViteRoutes", "routes", "options", "version", "loadRoutes", "paths", "globalThis", "globbedRoutesToRouteContext", "routesSync", "promises", "loadedRoutes", "clears", "Object", "keys", "map", "path", "console", "error", "loadRouteFunction", "pathWithoutRelative", "replace", "shouldRewrite", "window", "location", "env", "PROD", "originalPath", "slice", "routeModes", "info", "includes", "realPath", "pathname", "trim", "importUrl", "moduleKeys", "resolve", "id", "clearTimeout", "then", "val", "setTimeout", "catch", "err", "Error", "stack", "default", "process", "NODE_ENV"]
|
6
|
+
}
|
@@ -1,5 +1,8 @@
|
|
1
1
|
function assertIsReady(navigationRef) {
|
2
|
-
if (!navigationRef.isReady())
|
2
|
+
if (!navigationRef.isReady())
|
3
|
+
throw new Error("Attempted to navigate before mounting the Root Layout component. Ensure the Root Layout component is rendering a Slot, or other navigator on the first render.");
|
3
4
|
}
|
4
|
-
export {
|
5
|
-
|
5
|
+
export {
|
6
|
+
assertIsReady
|
7
|
+
};
|
8
|
+
//# sourceMappingURL=assertIsReady.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/utils/Users/n8/one/packages/one/src/utils/assertIsReady.ts"],
|
4
|
+
"mappings": "AAEO,SAASA,cAAcC,eAAsC;AAClE,MAAI,CAACA,cAAcC,QAAO;AACxB,UAAM,IAAIC,MACR,gKAAA;AAGN;",
|
5
|
+
"names": ["assertIsReady", "navigationRef", "isReady", "Error"]
|
6
|
+
}
|
@@ -1,5 +1,7 @@
|
|
1
|
-
var dynamicImport = function
|
1
|
+
var dynamicImport = function(path) {
|
2
2
|
return console.info("dynamicImport TODO", path), require(path);
|
3
3
|
};
|
4
|
-
export {
|
5
|
-
|
4
|
+
export {
|
5
|
+
dynamicImport
|
6
|
+
};
|
7
|
+
//# sourceMappingURL=dynamicImport.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/utils/Users/n8/one/packages/one/src/utils/dynamicImport.ts"],
|
4
|
+
"mappings": "AAEO,IAAMA,gBAAgB,SAACC,MAAAA;AAI1BC,iBAAQC,KAAK,sBAAsBF,IAAAA,GAC5BG,QAAQH,IAAAA;AASnB;",
|
5
|
+
"names": ["dynamicImport", "path", "console", "info", "require"]
|
6
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { exists } from "node:fs";
|
2
|
-
var existsAsync = function
|
3
|
-
return new Promise(function
|
2
|
+
var existsAsync = function(file) {
|
3
|
+
return new Promise(function(res, rej) {
|
4
4
|
try {
|
5
5
|
exists(file, res);
|
6
6
|
} catch {
|
@@ -8,5 +8,7 @@ var existsAsync = function (file) {
|
|
8
8
|
}
|
9
9
|
});
|
10
10
|
};
|
11
|
-
export {
|
12
|
-
|
11
|
+
export {
|
12
|
+
existsAsync
|
13
|
+
};
|
14
|
+
//# sourceMappingURL=existsAsync.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/utils/Users/n8/one/packages/one/src/utils/existsAsync.ts"],
|
4
|
+
"mappings": "AAAA,SAASA,cAAc;AAEhB,IAAMC,cAAc,SAACC,MAAAA;AAC1B,SAAO,IAAIC,QAAQ,SAACC,KAAKC,KAAAA;AACvB,QAAI;AACFL,aAAOE,MAAME,GAAAA;IACf,QAAQ;AACN,aAAO;IACT;EACF,CAAA;AACF;",
|
5
|
+
"names": ["exists", "existsAsync", "file", "Promise", "res", "rej"]
|
6
|
+
}
|