@tanstack/vue-router 1.167.1 → 1.167.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/Asset.js +107 -151
- package/dist/esm/Asset.js.map +1 -1
- package/dist/esm/Body.js +15 -24
- package/dist/esm/Body.js.map +1 -1
- package/dist/esm/CatchBoundary.js +112 -130
- package/dist/esm/CatchBoundary.js.map +1 -1
- package/dist/esm/ClientOnly.js +59 -29
- package/dist/esm/ClientOnly.js.map +1 -1
- package/dist/esm/HeadContent.dev.js +29 -23
- package/dist/esm/HeadContent.dev.js.map +1 -1
- package/dist/esm/HeadContent.js +21 -16
- package/dist/esm/HeadContent.js.map +1 -1
- package/dist/esm/Html.js +42 -61
- package/dist/esm/Html.js.map +1 -1
- package/dist/esm/Match.js +238 -319
- package/dist/esm/Match.js.map +1 -1
- package/dist/esm/Matches.js +127 -170
- package/dist/esm/Matches.js.map +1 -1
- package/dist/esm/RouterProvider.js +50 -65
- package/dist/esm/RouterProvider.js.map +1 -1
- package/dist/esm/ScriptOnce.js +31 -36
- package/dist/esm/ScriptOnce.js.map +1 -1
- package/dist/esm/Scripts.js +79 -101
- package/dist/esm/Scripts.js.map +1 -1
- package/dist/esm/ScrollRestoration.js +25 -29
- package/dist/esm/ScrollRestoration.js.map +1 -1
- package/dist/esm/Transitioner.js +146 -164
- package/dist/esm/Transitioner.js.map +1 -1
- package/dist/esm/awaited.js +27 -34
- package/dist/esm/awaited.js.map +1 -1
- package/dist/esm/fileRoute.js +90 -92
- package/dist/esm/fileRoute.js.map +1 -1
- package/dist/esm/headContentUtils.js +92 -123
- package/dist/esm/headContentUtils.js.map +1 -1
- package/dist/esm/index.dev.js +16 -118
- package/dist/esm/index.js +18 -119
- package/dist/esm/lazyRouteComponent.js +69 -82
- package/dist/esm/lazyRouteComponent.js.map +1 -1
- package/dist/esm/link.js +364 -385
- package/dist/esm/link.js.map +1 -1
- package/dist/esm/matchContext.js +16 -11
- package/dist/esm/matchContext.js.map +1 -1
- package/dist/esm/not-found.js +30 -40
- package/dist/esm/not-found.js.map +1 -1
- package/dist/esm/renderRouteNotFound.js +20 -15
- package/dist/esm/renderRouteNotFound.js.map +1 -1
- package/dist/esm/route.js +196 -174
- package/dist/esm/route.js.map +1 -1
- package/dist/esm/router.js +11 -11
- package/dist/esm/router.js.map +1 -1
- package/dist/esm/routerContext.js +10 -7
- package/dist/esm/routerContext.js.map +1 -1
- package/dist/esm/scroll-restoration.js +39 -50
- package/dist/esm/scroll-restoration.js.map +1 -1
- package/dist/esm/ssr/RouterClient.js +29 -43
- package/dist/esm/ssr/RouterClient.js.map +1 -1
- package/dist/esm/ssr/RouterServer.js +29 -32
- package/dist/esm/ssr/RouterServer.js.map +1 -1
- package/dist/esm/ssr/client.js +1 -4
- package/dist/esm/ssr/defaultRenderHandler.js +11 -13
- package/dist/esm/ssr/defaultRenderHandler.js.map +1 -1
- package/dist/esm/ssr/defaultStreamHandler.js +12 -15
- package/dist/esm/ssr/defaultStreamHandler.js.map +1 -1
- package/dist/esm/ssr/renderRouterToStream.js +47 -65
- package/dist/esm/ssr/renderRouterToStream.js.map +1 -1
- package/dist/esm/ssr/renderRouterToString.js +24 -32
- package/dist/esm/ssr/renderRouterToString.js.map +1 -1
- package/dist/esm/ssr/server.js +3 -10
- package/dist/esm/useBlocker.js +243 -287
- package/dist/esm/useBlocker.js.map +1 -1
- package/dist/esm/useCanGoBack.js +6 -5
- package/dist/esm/useCanGoBack.js.map +1 -1
- package/dist/esm/useLoaderData.js +12 -11
- package/dist/esm/useLoaderData.js.map +1 -1
- package/dist/esm/useLoaderDeps.js +12 -14
- package/dist/esm/useLoaderDeps.js.map +1 -1
- package/dist/esm/useLocation.js +6 -7
- package/dist/esm/useLocation.js.map +1 -1
- package/dist/esm/useMatch.js +27 -35
- package/dist/esm/useMatch.js.map +1 -1
- package/dist/esm/useNavigate.js +18 -24
- package/dist/esm/useNavigate.js.map +1 -1
- package/dist/esm/useParams.js +13 -12
- package/dist/esm/useParams.js.map +1 -1
- package/dist/esm/useRouteContext.js +9 -8
- package/dist/esm/useRouteContext.js.map +1 -1
- package/dist/esm/useRouter.js +9 -8
- package/dist/esm/useRouter.js.map +1 -1
- package/dist/esm/useRouterState.js +18 -22
- package/dist/esm/useRouterState.js.map +1 -1
- package/dist/esm/useSearch.js +13 -12
- package/dist/esm/useSearch.js.map +1 -1
- package/dist/esm/utils.js +59 -38
- package/dist/esm/utils.js.map +1 -1
- package/package.json +3 -3
- package/dist/esm/index.dev.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/ssr/client.js.map +0 -1
- package/dist/esm/ssr/server.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileRoute.js","sources":["../../src/fileRoute.ts"],"sourcesContent":["import warning from 'tiny-warning'\nimport { createRoute } from './route'\n\nimport { useMatch } from './useMatch'\nimport { useLoaderDeps } from './useLoaderDeps'\nimport { useLoaderData } from './useLoaderData'\nimport { useSearch } from './useSearch'\nimport { useParams } from './useParams'\nimport { useNavigate } from './useNavigate'\nimport { useRouter } from './useRouter'\nimport { useRouteContext } from './useRouteContext'\nimport type { UseParamsRoute } from './useParams'\nimport type { UseMatchRoute } from './useMatch'\nimport type { UseSearchRoute } from './useSearch'\nimport type {\n AnyContext,\n AnyRoute,\n AnyRouter,\n Constrain,\n ConstrainLiteral,\n FileBaseRouteOptions,\n FileRoutesByPath,\n LazyRouteOptions,\n Register,\n RegisteredRouter,\n ResolveParams,\n Route,\n RouteById,\n RouteConstraints,\n RouteIds,\n RouteLoaderEntry,\n UpdatableRouteOptions,\n UseNavigateResult,\n} from '@tanstack/router-core'\nimport type { UseLoaderDepsRoute } from './useLoaderDeps'\nimport type { UseLoaderDataRoute } from './useLoaderData'\nimport type { UseRouteContextRoute } from './useRouteContext'\n\nexport function createFileRoute<\n TFilePath extends keyof FileRoutesByPath,\n TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],\n TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'],\n TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'],\n TFullPath extends RouteConstraints['TFullPath'] =\n FileRoutesByPath[TFilePath]['fullPath'],\n>(\n path?: TFilePath,\n): FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>['createRoute'] {\n if (typeof path === 'object') {\n return new FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>(path, {\n silent: true,\n }).createRoute(path) as any\n }\n return new FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>(path, {\n silent: true,\n }).createRoute\n}\n\n/**\n @deprecated It's no longer recommended to use the `FileRoute` class directly.\n Instead, use `createFileRoute('/path/to/file')(options)` to create a file route.\n*/\nexport class FileRoute<\n TFilePath extends keyof FileRoutesByPath,\n TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],\n TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'],\n TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'],\n TFullPath extends RouteConstraints['TFullPath'] =\n FileRoutesByPath[TFilePath]['fullPath'],\n> {\n silent?: boolean\n\n constructor(\n public path?: TFilePath,\n _opts?: { silent: boolean },\n ) {\n this.silent = _opts?.silent\n }\n\n createRoute = <\n TRegister = Register,\n TSearchValidator = undefined,\n TParams = ResolveParams<TPath>,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n TSSR = unknown,\n TMiddlewares = unknown,\n THandlers = undefined,\n >(\n options?: FileBaseRouteOptions<\n TRegister,\n TParentRoute,\n TId,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n AnyContext,\n TSSR,\n TMiddlewares,\n THandlers\n > &\n UpdatableRouteOptions<\n TParentRoute,\n TId,\n TFullPath,\n TParams,\n TSearchValidator,\n TLoaderFn,\n TLoaderDeps,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn\n >,\n ): Route<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TFilePath,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown,\n TSSR,\n TMiddlewares,\n THandlers\n > => {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n this.silent,\n 'FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.',\n )\n }\n const route = createRoute(options as any)\n ;(route as any).isRoot = false\n return route as any\n }\n}\n\n/**\n @deprecated It's recommended not to split loaders into separate files.\n Instead, place the loader function in the the main route file, inside the\n `createFileRoute('/path/to/file)(options)` options.\n*/\nexport function FileRouteLoader<\n TFilePath extends keyof FileRoutesByPath,\n TRoute extends FileRoutesByPath[TFilePath]['preLoaderRoute'],\n>(\n _path: TFilePath,\n): <TLoaderFn>(\n loaderFn: Constrain<\n TLoaderFn,\n RouteLoaderEntry<\n Register,\n TRoute['parentRoute'],\n TRoute['types']['id'],\n TRoute['types']['params'],\n TRoute['types']['loaderDeps'],\n TRoute['types']['routerContext'],\n TRoute['types']['routeContextFn'],\n TRoute['types']['beforeLoadFn']\n >\n >,\n) => TLoaderFn {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n false,\n `FileRouteLoader is deprecated and will be removed in the next major version. Please place the loader function in the the main route file, inside the \\`createFileRoute('/path/to/file')(options)\\` options`,\n )\n }\n return (loaderFn) => loaderFn as any\n}\n\ndeclare module '@tanstack/router-core' {\n export interface LazyRoute<in out TRoute extends AnyRoute> {\n useMatch: UseMatchRoute<TRoute['id']>\n useRouteContext: UseRouteContextRoute<TRoute['id']>\n useSearch: UseSearchRoute<TRoute['id']>\n useParams: UseParamsRoute<TRoute['id']>\n useLoaderDeps: UseLoaderDepsRoute<TRoute['id']>\n useLoaderData: UseLoaderDataRoute<TRoute['id']>\n useNavigate: () => UseNavigateResult<TRoute['fullPath']>\n }\n}\n\nexport class LazyRoute<TRoute extends AnyRoute> {\n options: {\n id: string\n } & LazyRouteOptions\n\n constructor(\n opts: {\n id: string\n } & LazyRouteOptions,\n ) {\n this.options = opts\n }\n\n useMatch: UseMatchRoute<TRoute['id']> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.options.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TRoute['id']> = (opts) => {\n return useRouteContext({ ...(opts as any), from: this.options.id }) as any\n }\n\n useSearch: UseSearchRoute<TRoute['id']> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.options.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TRoute['id']> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.options.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TRoute['id']> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.options.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TRoute['id']> = (opts) => {\n return useLoaderData({ ...opts, from: this.options.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<TRoute['fullPath']> => {\n const router = useRouter()\n return useNavigate({ from: router.routesById[this.options.id].fullPath })\n }\n}\n\nexport function createLazyRoute<\n TRouter extends AnyRouter = RegisteredRouter,\n TId extends string = string,\n TRoute extends AnyRoute = RouteById<TRouter['routeTree'], TId>,\n>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {\n return (opts: LazyRouteOptions) => {\n return new LazyRoute<TRoute>({\n id: id,\n ...opts,\n })\n }\n}\nexport function createLazyFileRoute<\n TFilePath extends keyof FileRoutesByPath,\n TRoute extends FileRoutesByPath[TFilePath]['preLoaderRoute'],\n>(id: TFilePath): (opts: LazyRouteOptions) => LazyRoute<TRoute> {\n if (typeof id === 'object') {\n return new LazyRoute<TRoute>(id) as any\n }\n\n return (opts: LazyRouteOptions) => new LazyRoute<TRoute>({ id, ...opts })\n}\n"],"
|
|
1
|
+
{"version":3,"file":"fileRoute.js","names":[],"sources":["../../src/fileRoute.ts"],"sourcesContent":["import warning from 'tiny-warning'\nimport { createRoute } from './route'\n\nimport { useMatch } from './useMatch'\nimport { useLoaderDeps } from './useLoaderDeps'\nimport { useLoaderData } from './useLoaderData'\nimport { useSearch } from './useSearch'\nimport { useParams } from './useParams'\nimport { useNavigate } from './useNavigate'\nimport { useRouter } from './useRouter'\nimport { useRouteContext } from './useRouteContext'\nimport type { UseParamsRoute } from './useParams'\nimport type { UseMatchRoute } from './useMatch'\nimport type { UseSearchRoute } from './useSearch'\nimport type {\n AnyContext,\n AnyRoute,\n AnyRouter,\n Constrain,\n ConstrainLiteral,\n FileBaseRouteOptions,\n FileRoutesByPath,\n LazyRouteOptions,\n Register,\n RegisteredRouter,\n ResolveParams,\n Route,\n RouteById,\n RouteConstraints,\n RouteIds,\n RouteLoaderEntry,\n UpdatableRouteOptions,\n UseNavigateResult,\n} from '@tanstack/router-core'\nimport type { UseLoaderDepsRoute } from './useLoaderDeps'\nimport type { UseLoaderDataRoute } from './useLoaderData'\nimport type { UseRouteContextRoute } from './useRouteContext'\n\nexport function createFileRoute<\n TFilePath extends keyof FileRoutesByPath,\n TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],\n TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'],\n TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'],\n TFullPath extends RouteConstraints['TFullPath'] =\n FileRoutesByPath[TFilePath]['fullPath'],\n>(\n path?: TFilePath,\n): FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>['createRoute'] {\n if (typeof path === 'object') {\n return new FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>(path, {\n silent: true,\n }).createRoute(path) as any\n }\n return new FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>(path, {\n silent: true,\n }).createRoute\n}\n\n/**\n @deprecated It's no longer recommended to use the `FileRoute` class directly.\n Instead, use `createFileRoute('/path/to/file')(options)` to create a file route.\n*/\nexport class FileRoute<\n TFilePath extends keyof FileRoutesByPath,\n TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],\n TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'],\n TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'],\n TFullPath extends RouteConstraints['TFullPath'] =\n FileRoutesByPath[TFilePath]['fullPath'],\n> {\n silent?: boolean\n\n constructor(\n public path?: TFilePath,\n _opts?: { silent: boolean },\n ) {\n this.silent = _opts?.silent\n }\n\n createRoute = <\n TRegister = Register,\n TSearchValidator = undefined,\n TParams = ResolveParams<TPath>,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n TSSR = unknown,\n TMiddlewares = unknown,\n THandlers = undefined,\n >(\n options?: FileBaseRouteOptions<\n TRegister,\n TParentRoute,\n TId,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n AnyContext,\n TSSR,\n TMiddlewares,\n THandlers\n > &\n UpdatableRouteOptions<\n TParentRoute,\n TId,\n TFullPath,\n TParams,\n TSearchValidator,\n TLoaderFn,\n TLoaderDeps,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn\n >,\n ): Route<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TFilePath,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown,\n TSSR,\n TMiddlewares,\n THandlers\n > => {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n this.silent,\n 'FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.',\n )\n }\n const route = createRoute(options as any)\n ;(route as any).isRoot = false\n return route as any\n }\n}\n\n/**\n @deprecated It's recommended not to split loaders into separate files.\n Instead, place the loader function in the the main route file, inside the\n `createFileRoute('/path/to/file)(options)` options.\n*/\nexport function FileRouteLoader<\n TFilePath extends keyof FileRoutesByPath,\n TRoute extends FileRoutesByPath[TFilePath]['preLoaderRoute'],\n>(\n _path: TFilePath,\n): <TLoaderFn>(\n loaderFn: Constrain<\n TLoaderFn,\n RouteLoaderEntry<\n Register,\n TRoute['parentRoute'],\n TRoute['types']['id'],\n TRoute['types']['params'],\n TRoute['types']['loaderDeps'],\n TRoute['types']['routerContext'],\n TRoute['types']['routeContextFn'],\n TRoute['types']['beforeLoadFn']\n >\n >,\n) => TLoaderFn {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n false,\n `FileRouteLoader is deprecated and will be removed in the next major version. Please place the loader function in the the main route file, inside the \\`createFileRoute('/path/to/file')(options)\\` options`,\n )\n }\n return (loaderFn) => loaderFn as any\n}\n\ndeclare module '@tanstack/router-core' {\n export interface LazyRoute<in out TRoute extends AnyRoute> {\n useMatch: UseMatchRoute<TRoute['id']>\n useRouteContext: UseRouteContextRoute<TRoute['id']>\n useSearch: UseSearchRoute<TRoute['id']>\n useParams: UseParamsRoute<TRoute['id']>\n useLoaderDeps: UseLoaderDepsRoute<TRoute['id']>\n useLoaderData: UseLoaderDataRoute<TRoute['id']>\n useNavigate: () => UseNavigateResult<TRoute['fullPath']>\n }\n}\n\nexport class LazyRoute<TRoute extends AnyRoute> {\n options: {\n id: string\n } & LazyRouteOptions\n\n constructor(\n opts: {\n id: string\n } & LazyRouteOptions,\n ) {\n this.options = opts\n }\n\n useMatch: UseMatchRoute<TRoute['id']> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.options.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TRoute['id']> = (opts) => {\n return useRouteContext({ ...(opts as any), from: this.options.id }) as any\n }\n\n useSearch: UseSearchRoute<TRoute['id']> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.options.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TRoute['id']> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.options.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TRoute['id']> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.options.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TRoute['id']> = (opts) => {\n return useLoaderData({ ...opts, from: this.options.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<TRoute['fullPath']> => {\n const router = useRouter()\n return useNavigate({ from: router.routesById[this.options.id].fullPath })\n }\n}\n\nexport function createLazyRoute<\n TRouter extends AnyRouter = RegisteredRouter,\n TId extends string = string,\n TRoute extends AnyRoute = RouteById<TRouter['routeTree'], TId>,\n>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {\n return (opts: LazyRouteOptions) => {\n return new LazyRoute<TRoute>({\n id: id,\n ...opts,\n })\n }\n}\nexport function createLazyFileRoute<\n TFilePath extends keyof FileRoutesByPath,\n TRoute extends FileRoutesByPath[TFilePath]['preLoaderRoute'],\n>(id: TFilePath): (opts: LazyRouteOptions) => LazyRoute<TRoute> {\n if (typeof id === 'object') {\n return new LazyRoute<TRoute>(id) as any\n }\n\n return (opts: LazyRouteOptions) => new LazyRoute<TRoute>({ id, ...opts })\n}\n"],"mappings":";;;;;;;;;;;AAsCA,SAAgB,gBAQd,MAC0E;AAC1E,KAAI,OAAO,SAAS,SAClB,QAAO,IAAI,UAA0D,MAAM,EACzE,QAAQ,MACT,CAAC,CAAC,YAAY,KAAK;AAEtB,QAAO,IAAI,UAA0D,MAAM,EACzE,QAAQ,MACT,CAAC,CAAC;;;;;;AAOL,IAAa,YAAb,MAOE;CAGA,YACE,MACA,OACA;AAFO,OAAA,OAAA;sBAmBP,YAgDG;AACH,OAAA,QAAA,IAAA,aAA6B,aAC3B,SACE,KAAK,QACL,kIACD;GAEH,MAAM,QAAQ,YAAY,QAAe;AACvC,SAAc,SAAS;AACzB,UAAO;;AAzEP,OAAK,SAAS,OAAO;;;;;;;;AAkFzB,SAAgB,gBAId,OAea;AACb,KAAA,QAAA,IAAA,aAA6B,aAC3B,SACE,OACA,6MACD;AAEH,SAAQ,aAAa;;AAevB,IAAa,YAAb,MAAgD;CAK9C,YACE,MAGA;mBAIuC,SAAS;AAChD,UAAO,SAAS;IACd,QAAQ,MAAM;IACd,MAAM,KAAK,QAAQ;IACpB,CAAQ;;0BAG4C,SAAS;AAC9D,UAAO,gBAAgB;IAAE,GAAI;IAAc,MAAM,KAAK,QAAQ;IAAI,CAAC;;oBAG1B,SAAS;AAClD,UAAO,UAAU;IACf,QAAQ,MAAM;IACd,MAAM,KAAK,QAAQ;IACpB,CAAQ;;oBAGgC,SAAS;AAClD,UAAO,UAAU;IACf,QAAQ,MAAM;IACd,MAAM,KAAK,QAAQ;IACpB,CAAQ;;wBAGwC,SAAS;AAC1D,UAAO,cAAc;IAAE,GAAG;IAAM,MAAM,KAAK,QAAQ;IAAI,CAAQ;;wBAGd,SAAS;AAC1D,UAAO,cAAc;IAAE,GAAG;IAAM,MAAM,KAAK,QAAQ;IAAI,CAAQ;;2BAGN;AAEzD,UAAO,YAAY,EAAE,MADN,WAAW,CACQ,WAAW,KAAK,QAAQ,IAAI,UAAU,CAAC;;AAtCzE,OAAK,UAAU;;;AA0CnB,SAAgB,gBAId,IAA2D;AAC3D,SAAQ,SAA2B;AACjC,SAAO,IAAI,UAAkB;GACvB;GACJ,GAAG;GACJ,CAAC;;;AAGN,SAAgB,oBAGd,IAA8D;AAC9D,KAAI,OAAO,OAAO,SAChB,QAAO,IAAI,UAAkB,GAAG;AAGlC,SAAQ,SAA2B,IAAI,UAAkB;EAAE;EAAI,GAAG;EAAM,CAAC"}
|
|
@@ -1,128 +1,97 @@
|
|
|
1
|
-
import * as Vue from "vue";
|
|
2
|
-
import { escapeHtml } from "@tanstack/router-core";
|
|
3
1
|
import { useRouter } from "./useRouter.js";
|
|
4
2
|
import { useRouterState } from "./useRouterState.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
select: (state) => state.matches.map((match) => match.headScripts).flat(1).filter(Boolean).map(({
|
|
87
|
-
children,
|
|
88
|
-
...script
|
|
89
|
-
}) => ({
|
|
90
|
-
tag: "script",
|
|
91
|
-
attrs: {
|
|
92
|
-
...script
|
|
93
|
-
},
|
|
94
|
-
children
|
|
95
|
-
}))
|
|
96
|
-
});
|
|
97
|
-
const manifestAssets = useRouterState({
|
|
98
|
-
select: (state) => {
|
|
99
|
-
const manifest = router.ssr?.manifest;
|
|
100
|
-
const assets = state.matches.map((match) => manifest?.routes[match.routeId]?.assets ?? []).filter(Boolean).flat(1).filter((asset) => asset.tag === "link").map((asset) => ({
|
|
101
|
-
tag: "link",
|
|
102
|
-
attrs: {
|
|
103
|
-
...asset.attrs
|
|
104
|
-
}
|
|
105
|
-
}));
|
|
106
|
-
return assets;
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
return () => uniqBy([...manifestAssets.value, ...meta.value, ...preloadMeta.value, ...links.value, ...headScripts.value], (d) => {
|
|
110
|
-
return JSON.stringify(d);
|
|
111
|
-
});
|
|
3
|
+
import { escapeHtml } from "@tanstack/router-core";
|
|
4
|
+
import * as Vue from "vue";
|
|
5
|
+
//#region src/headContentUtils.tsx
|
|
6
|
+
var useTags = () => {
|
|
7
|
+
const router = useRouter();
|
|
8
|
+
const routeMeta = useRouterState({ select: (state) => {
|
|
9
|
+
return state.matches.map((match) => match.meta).filter(Boolean);
|
|
10
|
+
} });
|
|
11
|
+
const meta = Vue.computed(() => {
|
|
12
|
+
const resultMeta = [];
|
|
13
|
+
const metaByAttribute = {};
|
|
14
|
+
let title;
|
|
15
|
+
[...routeMeta.value].reverse().forEach((metas) => {
|
|
16
|
+
[...metas].reverse().forEach((m) => {
|
|
17
|
+
if (!m) return;
|
|
18
|
+
if (m.title) {
|
|
19
|
+
if (!title) title = {
|
|
20
|
+
tag: "title",
|
|
21
|
+
children: m.title
|
|
22
|
+
};
|
|
23
|
+
} else if ("script:ld+json" in m) try {
|
|
24
|
+
const json = JSON.stringify(m["script:ld+json"]);
|
|
25
|
+
resultMeta.push({
|
|
26
|
+
tag: "script",
|
|
27
|
+
attrs: { type: "application/ld+json" },
|
|
28
|
+
children: escapeHtml(json)
|
|
29
|
+
});
|
|
30
|
+
} catch {}
|
|
31
|
+
else {
|
|
32
|
+
const attribute = m.name ?? m.property;
|
|
33
|
+
if (attribute) if (metaByAttribute[attribute]) return;
|
|
34
|
+
else metaByAttribute[attribute] = true;
|
|
35
|
+
resultMeta.push({
|
|
36
|
+
tag: "meta",
|
|
37
|
+
attrs: { ...m }
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
if (title) resultMeta.push(title);
|
|
43
|
+
resultMeta.reverse();
|
|
44
|
+
return resultMeta;
|
|
45
|
+
});
|
|
46
|
+
const links = useRouterState({ select: (state) => state.matches.map((match) => match.links).filter(Boolean).flat(1).map((link) => ({
|
|
47
|
+
tag: "link",
|
|
48
|
+
attrs: { ...link }
|
|
49
|
+
})) });
|
|
50
|
+
const preloadMeta = useRouterState({ select: (state) => {
|
|
51
|
+
const preloadMeta = [];
|
|
52
|
+
state.matches.map((match) => router.looseRoutesById[match.routeId]).forEach((route) => router.ssr?.manifest?.routes[route.id]?.preloads?.filter(Boolean).forEach((preload) => {
|
|
53
|
+
preloadMeta.push({
|
|
54
|
+
tag: "link",
|
|
55
|
+
attrs: {
|
|
56
|
+
rel: "modulepreload",
|
|
57
|
+
href: preload
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}));
|
|
61
|
+
return preloadMeta;
|
|
62
|
+
} });
|
|
63
|
+
const headScripts = useRouterState({ select: (state) => state.matches.map((match) => match.headScripts).flat(1).filter(Boolean).map(({ children, ...script }) => ({
|
|
64
|
+
tag: "script",
|
|
65
|
+
attrs: { ...script },
|
|
66
|
+
children
|
|
67
|
+
})) });
|
|
68
|
+
const manifestAssets = useRouterState({ select: (state) => {
|
|
69
|
+
const manifest = router.ssr?.manifest;
|
|
70
|
+
return state.matches.map((match) => manifest?.routes[match.routeId]?.assets ?? []).filter(Boolean).flat(1).filter((asset) => asset.tag === "link").map((asset) => ({
|
|
71
|
+
tag: "link",
|
|
72
|
+
attrs: { ...asset.attrs }
|
|
73
|
+
}));
|
|
74
|
+
} });
|
|
75
|
+
return () => uniqBy([
|
|
76
|
+
...manifestAssets.value,
|
|
77
|
+
...meta.value,
|
|
78
|
+
...preloadMeta.value,
|
|
79
|
+
...links.value,
|
|
80
|
+
...headScripts.value
|
|
81
|
+
], (d) => {
|
|
82
|
+
return JSON.stringify(d);
|
|
83
|
+
});
|
|
112
84
|
};
|
|
113
85
|
function uniqBy(arr, fn) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return true;
|
|
122
|
-
});
|
|
86
|
+
const seen = /* @__PURE__ */ new Set();
|
|
87
|
+
return arr.filter((item) => {
|
|
88
|
+
const key = fn(item);
|
|
89
|
+
if (seen.has(key)) return false;
|
|
90
|
+
seen.add(key);
|
|
91
|
+
return true;
|
|
92
|
+
});
|
|
123
93
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
//# sourceMappingURL=headContentUtils.js.map
|
|
94
|
+
//#endregion
|
|
95
|
+
export { useTags };
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=headContentUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headContentUtils.js","sources":["../../src/headContentUtils.tsx"],"sourcesContent":["import * as Vue from 'vue'\n\nimport { escapeHtml } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport { useRouterState } from './useRouterState'\nimport type { RouterManagedTag } from '@tanstack/router-core'\n\nexport const useTags = () => {\n const router = useRouter()\n\n const routeMeta = useRouterState({\n select: (state) => {\n return state.matches.map((match) => match.meta!).filter(Boolean)\n },\n })\n\n const meta: Vue.Ref<Array<RouterManagedTag>> = Vue.computed(() => {\n const resultMeta: Array<RouterManagedTag> = []\n const metaByAttribute: Record<string, true> = {}\n let title: RouterManagedTag | undefined\n ;[...routeMeta.value].reverse().forEach((metas) => {\n ;[...metas].reverse().forEach((m) => {\n if (!m) return\n\n if (m.title) {\n if (!title) {\n title = {\n tag: 'title',\n children: m.title,\n }\n }\n } else if ('script:ld+json' in m) {\n // Handle JSON-LD structured data\n // Content is HTML-escaped to prevent XSS when injected via innerHTML\n try {\n const json = JSON.stringify(m['script:ld+json'])\n resultMeta.push({\n tag: 'script',\n attrs: {\n type: 'application/ld+json',\n },\n children: escapeHtml(json),\n })\n } catch {\n // Skip invalid JSON-LD objects\n }\n } else {\n const attribute = m.name ?? m.property\n if (attribute) {\n if (metaByAttribute[attribute]) {\n return\n } else {\n metaByAttribute[attribute] = true\n }\n }\n\n resultMeta.push({\n tag: 'meta',\n attrs: {\n ...m,\n },\n })\n }\n })\n })\n\n if (title) {\n resultMeta.push(title)\n }\n\n resultMeta.reverse()\n\n return resultMeta\n })\n\n const links = useRouterState({\n select: (state) =>\n state.matches\n .map((match) => match.links!)\n .filter(Boolean)\n .flat(1)\n .map((link) => ({\n tag: 'link',\n attrs: {\n ...link,\n },\n })) as Array<RouterManagedTag>,\n })\n\n const preloadMeta = useRouterState({\n select: (state) => {\n const preloadMeta: Array<RouterManagedTag> = []\n\n state.matches\n .map((match) => router.looseRoutesById[match.routeId]!)\n .forEach((route) =>\n router.ssr?.manifest?.routes[route.id]?.preloads\n ?.filter(Boolean)\n .forEach((preload) => {\n preloadMeta.push({\n tag: 'link',\n attrs: {\n rel: 'modulepreload',\n href: preload,\n },\n })\n }),\n )\n\n return preloadMeta\n },\n })\n\n const headScripts = useRouterState({\n select: (state) =>\n (\n state.matches\n .map((match) => match.headScripts!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...script }) => ({\n tag: 'script',\n attrs: {\n ...script,\n },\n children,\n })),\n })\n\n const manifestAssets = useRouterState({\n select: (state) => {\n const manifest = router.ssr?.manifest\n\n const assets = state.matches\n .map((match) => manifest?.routes[match.routeId]?.assets ?? [])\n .filter(Boolean)\n .flat(1)\n .filter((asset) => asset.tag === 'link')\n .map(\n (asset) =>\n ({\n tag: 'link',\n attrs: { ...asset.attrs },\n }) satisfies RouterManagedTag,\n )\n\n return assets\n },\n })\n\n return () =>\n uniqBy(\n [\n ...manifestAssets.value,\n ...meta.value,\n ...preloadMeta.value,\n ...links.value,\n ...headScripts.value,\n ] as Array<RouterManagedTag>,\n (d) => {\n return JSON.stringify(d)\n },\n )\n}\n\nexport function uniqBy<T>(arr: Array<T>, fn: (item: T) => string) {\n const seen = new Set<string>()\n return arr.filter((item) => {\n const key = fn(item)\n if (seen.has(key)) {\n return false\n }\n seen.add(key)\n return true\n })\n}\n"],"
|
|
1
|
+
{"version":3,"file":"headContentUtils.js","names":["Vue","escapeHtml","useRouter","useRouterState","useTags","router","routeMeta","select","state","matches","map","match","meta","filter","Boolean","computed","resultMeta","metaByAttribute","title","value","reverse","forEach","metas","m","tag","children","json","JSON","stringify","push","attrs","type","attribute","name","property","links","flat","link","preloadMeta","looseRoutesById","routeId","route","ssr","manifest","routes","id","preloads","preload","rel","href","headScripts","script","manifestAssets","assets","asset","uniqBy","d","arr","fn","seen","Set","item","key","has","add"],"sources":["../../src/headContentUtils.tsx"],"sourcesContent":["import * as Vue from 'vue'\n\nimport { escapeHtml } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport { useRouterState } from './useRouterState'\nimport type { RouterManagedTag } from '@tanstack/router-core'\n\nexport const useTags = () => {\n const router = useRouter()\n\n const routeMeta = useRouterState({\n select: (state) => {\n return state.matches.map((match) => match.meta!).filter(Boolean)\n },\n })\n\n const meta: Vue.Ref<Array<RouterManagedTag>> = Vue.computed(() => {\n const resultMeta: Array<RouterManagedTag> = []\n const metaByAttribute: Record<string, true> = {}\n let title: RouterManagedTag | undefined\n ;[...routeMeta.value].reverse().forEach((metas) => {\n ;[...metas].reverse().forEach((m) => {\n if (!m) return\n\n if (m.title) {\n if (!title) {\n title = {\n tag: 'title',\n children: m.title,\n }\n }\n } else if ('script:ld+json' in m) {\n // Handle JSON-LD structured data\n // Content is HTML-escaped to prevent XSS when injected via innerHTML\n try {\n const json = JSON.stringify(m['script:ld+json'])\n resultMeta.push({\n tag: 'script',\n attrs: {\n type: 'application/ld+json',\n },\n children: escapeHtml(json),\n })\n } catch {\n // Skip invalid JSON-LD objects\n }\n } else {\n const attribute = m.name ?? m.property\n if (attribute) {\n if (metaByAttribute[attribute]) {\n return\n } else {\n metaByAttribute[attribute] = true\n }\n }\n\n resultMeta.push({\n tag: 'meta',\n attrs: {\n ...m,\n },\n })\n }\n })\n })\n\n if (title) {\n resultMeta.push(title)\n }\n\n resultMeta.reverse()\n\n return resultMeta\n })\n\n const links = useRouterState({\n select: (state) =>\n state.matches\n .map((match) => match.links!)\n .filter(Boolean)\n .flat(1)\n .map((link) => ({\n tag: 'link',\n attrs: {\n ...link,\n },\n })) as Array<RouterManagedTag>,\n })\n\n const preloadMeta = useRouterState({\n select: (state) => {\n const preloadMeta: Array<RouterManagedTag> = []\n\n state.matches\n .map((match) => router.looseRoutesById[match.routeId]!)\n .forEach((route) =>\n router.ssr?.manifest?.routes[route.id]?.preloads\n ?.filter(Boolean)\n .forEach((preload) => {\n preloadMeta.push({\n tag: 'link',\n attrs: {\n rel: 'modulepreload',\n href: preload,\n },\n })\n }),\n )\n\n return preloadMeta\n },\n })\n\n const headScripts = useRouterState({\n select: (state) =>\n (\n state.matches\n .map((match) => match.headScripts!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...script }) => ({\n tag: 'script',\n attrs: {\n ...script,\n },\n children,\n })),\n })\n\n const manifestAssets = useRouterState({\n select: (state) => {\n const manifest = router.ssr?.manifest\n\n const assets = state.matches\n .map((match) => manifest?.routes[match.routeId]?.assets ?? [])\n .filter(Boolean)\n .flat(1)\n .filter((asset) => asset.tag === 'link')\n .map(\n (asset) =>\n ({\n tag: 'link',\n attrs: { ...asset.attrs },\n }) satisfies RouterManagedTag,\n )\n\n return assets\n },\n })\n\n return () =>\n uniqBy(\n [\n ...manifestAssets.value,\n ...meta.value,\n ...preloadMeta.value,\n ...links.value,\n ...headScripts.value,\n ] as Array<RouterManagedTag>,\n (d) => {\n return JSON.stringify(d)\n },\n )\n}\n\nexport function uniqBy<T>(arr: Array<T>, fn: (item: T) => string) {\n const seen = new Set<string>()\n return arr.filter((item) => {\n const key = fn(item)\n if (seen.has(key)) {\n return false\n }\n seen.add(key)\n return true\n })\n}\n"],"mappings":"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"}
|
package/dist/esm/index.dev.js
CHANGED
|
@@ -1,136 +1,34 @@
|
|
|
1
|
-
import { DEFAULT_PROTOCOL_ALLOWLIST, SearchParamError, cleanPath, composeRewrites, createControlledPromise, createRouterConfig, createSerializationAdapter, deepEqual, defaultParseSearch, defaultStringifySearch, defer, functionalUpdate, interpolatePath, isMatch, isNotFound, isPlainArray, isPlainObject, isRedirect, joinPaths, lazyFn, notFound, parseSearchWith, redirect, replaceEqualDeep, resolvePath, retainSearchParams, rootRouteId, stringifySearchWith, stripSearchParams, trimPath, trimPathLeft, trimPathRight } from "@tanstack/router-core";
|
|
2
|
-
import { createBrowserHistory, createHashHistory, createHistory, createMemoryHistory } from "@tanstack/history";
|
|
3
1
|
import { Await, useAwaited } from "./awaited.js";
|
|
4
2
|
import { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { useRouter } from "./useRouter.js";
|
|
4
|
+
import { useRouterState } from "./useRouterState.js";
|
|
5
|
+
import { ClientOnly } from "./ClientOnly.js";
|
|
6
|
+
import { CatchNotFound, DefaultGlobalNotFound } from "./not-found.js";
|
|
7
|
+
import { ScriptOnce } from "./ScriptOnce.js";
|
|
9
8
|
import { Match, Outlet } from "./Match.js";
|
|
9
|
+
import { MatchRoute, Matches, useChildMatches, useMatchRoute, useMatches, useParentMatches } from "./Matches.js";
|
|
10
|
+
import { Link, createLink, linkOptions, useLinkProps } from "./link.js";
|
|
10
11
|
import { useMatch } from "./useMatch.js";
|
|
11
|
-
import { useLoaderDeps } from "./useLoaderDeps.js";
|
|
12
12
|
import { useLoaderData } from "./useLoaderData.js";
|
|
13
|
+
import { useLoaderDeps } from "./useLoaderDeps.js";
|
|
14
|
+
import { useParams } from "./useParams.js";
|
|
15
|
+
import { useSearch } from "./useSearch.js";
|
|
16
|
+
import { Navigate, useNavigate } from "./useNavigate.js";
|
|
17
|
+
import { useRouteContext } from "./useRouteContext.js";
|
|
13
18
|
import { NotFoundRoute, RootRoute, Route, RouteApi, createRootRoute, createRootRouteWithContext, createRoute, createRouteMask, getRouteApi, rootRouteWithContext } from "./route.js";
|
|
19
|
+
import { FileRoute, FileRouteLoader, LazyRoute, createFileRoute, createLazyFileRoute, createLazyRoute } from "./fileRoute.js";
|
|
20
|
+
import { lazyRouteComponent } from "./lazyRouteComponent.js";
|
|
14
21
|
import { Router, createRouter } from "./router.js";
|
|
15
22
|
import { RouterContextProvider, RouterProvider } from "./RouterProvider.js";
|
|
16
23
|
import { ScrollRestoration, useElementScrollRestoration } from "./ScrollRestoration.js";
|
|
17
24
|
import { Block, useBlocker } from "./useBlocker.js";
|
|
18
|
-
import { Navigate, useNavigate } from "./useNavigate.js";
|
|
19
|
-
import { useParams } from "./useParams.js";
|
|
20
|
-
import { useSearch } from "./useSearch.js";
|
|
21
|
-
import { useRouteContext } from "./useRouteContext.js";
|
|
22
|
-
import { useRouter } from "./useRouter.js";
|
|
23
|
-
import { useRouterState } from "./useRouterState.js";
|
|
24
25
|
import { useLocation } from "./useLocation.js";
|
|
25
26
|
import { useCanGoBack } from "./useCanGoBack.js";
|
|
26
|
-
import { CatchNotFound, DefaultGlobalNotFound } from "./not-found.js";
|
|
27
|
-
import { ScriptOnce } from "./ScriptOnce.js";
|
|
28
27
|
import { Asset } from "./Asset.js";
|
|
29
28
|
import { useTags } from "./headContentUtils.js";
|
|
30
29
|
import { Scripts } from "./Scripts.js";
|
|
31
30
|
import { Body } from "./Body.js";
|
|
32
31
|
import { Html } from "./Html.js";
|
|
33
|
-
import {
|
|
32
|
+
import { DEFAULT_PROTOCOL_ALLOWLIST, SearchParamError, cleanPath, composeRewrites, createBrowserHistory, createControlledPromise, createHashHistory, createHistory, createMemoryHistory, createRouterConfig, createSerializationAdapter, deepEqual, defaultParseSearch, defaultStringifySearch, defer, functionalUpdate, interpolatePath, isMatch, isNotFound, isPlainArray, isPlainObject, isRedirect, joinPaths, lazyFn, notFound, parseSearchWith, redirect, replaceEqualDeep, resolvePath, retainSearchParams, rootRouteId, stringifySearchWith, stripSearchParams, trimPath, trimPathLeft, trimPathRight } from "./index.js";
|
|
34
33
|
import { HeadContent } from "./HeadContent.dev.js";
|
|
35
|
-
export {
|
|
36
|
-
Asset,
|
|
37
|
-
Await,
|
|
38
|
-
Block,
|
|
39
|
-
Body,
|
|
40
|
-
CatchBoundary,
|
|
41
|
-
CatchNotFound,
|
|
42
|
-
ClientOnly,
|
|
43
|
-
DEFAULT_PROTOCOL_ALLOWLIST,
|
|
44
|
-
DefaultGlobalNotFound,
|
|
45
|
-
ErrorComponent,
|
|
46
|
-
FileRoute,
|
|
47
|
-
FileRouteLoader,
|
|
48
|
-
HeadContent,
|
|
49
|
-
Html,
|
|
50
|
-
LazyRoute,
|
|
51
|
-
Link,
|
|
52
|
-
Match,
|
|
53
|
-
MatchRoute,
|
|
54
|
-
Matches,
|
|
55
|
-
Navigate,
|
|
56
|
-
NotFoundRoute,
|
|
57
|
-
Outlet,
|
|
58
|
-
RootRoute,
|
|
59
|
-
Route,
|
|
60
|
-
RouteApi,
|
|
61
|
-
Router,
|
|
62
|
-
RouterContextProvider,
|
|
63
|
-
RouterProvider,
|
|
64
|
-
ScriptOnce,
|
|
65
|
-
Scripts,
|
|
66
|
-
ScrollRestoration,
|
|
67
|
-
SearchParamError,
|
|
68
|
-
cleanPath,
|
|
69
|
-
composeRewrites,
|
|
70
|
-
createBrowserHistory,
|
|
71
|
-
createControlledPromise,
|
|
72
|
-
createFileRoute,
|
|
73
|
-
createHashHistory,
|
|
74
|
-
createHistory,
|
|
75
|
-
createLazyFileRoute,
|
|
76
|
-
createLazyRoute,
|
|
77
|
-
createLink,
|
|
78
|
-
createMemoryHistory,
|
|
79
|
-
createRootRoute,
|
|
80
|
-
createRootRouteWithContext,
|
|
81
|
-
createRoute,
|
|
82
|
-
createRouteMask,
|
|
83
|
-
createRouter,
|
|
84
|
-
createRouterConfig,
|
|
85
|
-
createSerializationAdapter,
|
|
86
|
-
deepEqual,
|
|
87
|
-
defaultParseSearch,
|
|
88
|
-
defaultStringifySearch,
|
|
89
|
-
defer,
|
|
90
|
-
functionalUpdate,
|
|
91
|
-
getRouteApi,
|
|
92
|
-
interpolatePath,
|
|
93
|
-
isMatch,
|
|
94
|
-
isNotFound,
|
|
95
|
-
isPlainArray,
|
|
96
|
-
isPlainObject,
|
|
97
|
-
isRedirect,
|
|
98
|
-
joinPaths,
|
|
99
|
-
lazyFn,
|
|
100
|
-
lazyRouteComponent,
|
|
101
|
-
linkOptions,
|
|
102
|
-
notFound,
|
|
103
|
-
parseSearchWith,
|
|
104
|
-
redirect,
|
|
105
|
-
replaceEqualDeep,
|
|
106
|
-
resolvePath,
|
|
107
|
-
retainSearchParams,
|
|
108
|
-
rootRouteId,
|
|
109
|
-
rootRouteWithContext,
|
|
110
|
-
stringifySearchWith,
|
|
111
|
-
stripSearchParams,
|
|
112
|
-
trimPath,
|
|
113
|
-
trimPathLeft,
|
|
114
|
-
trimPathRight,
|
|
115
|
-
useAwaited,
|
|
116
|
-
useBlocker,
|
|
117
|
-
useCanGoBack,
|
|
118
|
-
useChildMatches,
|
|
119
|
-
useElementScrollRestoration,
|
|
120
|
-
useLinkProps,
|
|
121
|
-
useLoaderData,
|
|
122
|
-
useLoaderDeps,
|
|
123
|
-
useLocation,
|
|
124
|
-
useMatch,
|
|
125
|
-
useMatchRoute,
|
|
126
|
-
useMatches,
|
|
127
|
-
useNavigate,
|
|
128
|
-
useParams,
|
|
129
|
-
useParentMatches,
|
|
130
|
-
useRouteContext,
|
|
131
|
-
useRouter,
|
|
132
|
-
useRouterState,
|
|
133
|
-
useSearch,
|
|
134
|
-
useTags
|
|
135
|
-
};
|
|
136
|
-
//# sourceMappingURL=index.dev.js.map
|
|
34
|
+
export { Asset, Await, Block, Body, CatchBoundary, CatchNotFound, ClientOnly, DEFAULT_PROTOCOL_ALLOWLIST, DefaultGlobalNotFound, ErrorComponent, FileRoute, FileRouteLoader, HeadContent, Html, LazyRoute, Link, Match, MatchRoute, Matches, Navigate, NotFoundRoute, Outlet, RootRoute, Route, RouteApi, Router, RouterContextProvider, RouterProvider, ScriptOnce, Scripts, ScrollRestoration, SearchParamError, cleanPath, composeRewrites, createBrowserHistory, createControlledPromise, createFileRoute, createHashHistory, createHistory, createLazyFileRoute, createLazyRoute, createLink, createMemoryHistory, createRootRoute, createRootRouteWithContext, createRoute, createRouteMask, createRouter, createRouterConfig, createSerializationAdapter, deepEqual, defaultParseSearch, defaultStringifySearch, defer, functionalUpdate, getRouteApi, interpolatePath, isMatch, isNotFound, isPlainArray, isPlainObject, isRedirect, joinPaths, lazyFn, lazyRouteComponent, linkOptions, notFound, parseSearchWith, redirect, replaceEqualDeep, resolvePath, retainSearchParams, rootRouteId, rootRouteWithContext, stringifySearchWith, stripSearchParams, trimPath, trimPathLeft, trimPathRight, useAwaited, useBlocker, useCanGoBack, useChildMatches, useElementScrollRestoration, useLinkProps, useLoaderData, useLoaderDeps, useLocation, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useParentMatches, useRouteContext, useRouter, useRouterState, useSearch, useTags };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,136 +1,35 @@
|
|
|
1
|
-
import { DEFAULT_PROTOCOL_ALLOWLIST, SearchParamError, cleanPath, composeRewrites, createControlledPromise, createRouterConfig, createSerializationAdapter, deepEqual, defaultParseSearch, defaultStringifySearch, defer, functionalUpdate, interpolatePath, isMatch, isNotFound, isPlainArray, isPlainObject, isRedirect, joinPaths, lazyFn, notFound, parseSearchWith, redirect, replaceEqualDeep, resolvePath, retainSearchParams, rootRouteId, stringifySearchWith, stripSearchParams, trimPath, trimPathLeft, trimPathRight } from "@tanstack/router-core";
|
|
2
|
-
import { createBrowserHistory, createHashHistory, createHistory, createMemoryHistory } from "@tanstack/history";
|
|
3
1
|
import { Await, useAwaited } from "./awaited.js";
|
|
4
2
|
import { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { useRouter } from "./useRouter.js";
|
|
4
|
+
import { useRouterState } from "./useRouterState.js";
|
|
5
|
+
import { ClientOnly } from "./ClientOnly.js";
|
|
6
|
+
import { CatchNotFound, DefaultGlobalNotFound } from "./not-found.js";
|
|
7
|
+
import { ScriptOnce } from "./ScriptOnce.js";
|
|
9
8
|
import { Match, Outlet } from "./Match.js";
|
|
9
|
+
import { MatchRoute, Matches, useChildMatches, useMatchRoute, useMatches, useParentMatches } from "./Matches.js";
|
|
10
|
+
import { Link, createLink, linkOptions, useLinkProps } from "./link.js";
|
|
10
11
|
import { useMatch } from "./useMatch.js";
|
|
11
|
-
import { useLoaderDeps } from "./useLoaderDeps.js";
|
|
12
12
|
import { useLoaderData } from "./useLoaderData.js";
|
|
13
|
+
import { useLoaderDeps } from "./useLoaderDeps.js";
|
|
14
|
+
import { useParams } from "./useParams.js";
|
|
15
|
+
import { useSearch } from "./useSearch.js";
|
|
16
|
+
import { Navigate, useNavigate } from "./useNavigate.js";
|
|
17
|
+
import { useRouteContext } from "./useRouteContext.js";
|
|
13
18
|
import { NotFoundRoute, RootRoute, Route, RouteApi, createRootRoute, createRootRouteWithContext, createRoute, createRouteMask, getRouteApi, rootRouteWithContext } from "./route.js";
|
|
19
|
+
import { FileRoute, FileRouteLoader, LazyRoute, createFileRoute, createLazyFileRoute, createLazyRoute } from "./fileRoute.js";
|
|
20
|
+
import { lazyRouteComponent } from "./lazyRouteComponent.js";
|
|
14
21
|
import { Router, createRouter } from "./router.js";
|
|
15
22
|
import { RouterContextProvider, RouterProvider } from "./RouterProvider.js";
|
|
16
23
|
import { ScrollRestoration, useElementScrollRestoration } from "./ScrollRestoration.js";
|
|
17
24
|
import { Block, useBlocker } from "./useBlocker.js";
|
|
18
|
-
import { Navigate, useNavigate } from "./useNavigate.js";
|
|
19
|
-
import { useParams } from "./useParams.js";
|
|
20
|
-
import { useSearch } from "./useSearch.js";
|
|
21
|
-
import { useRouteContext } from "./useRouteContext.js";
|
|
22
|
-
import { useRouter } from "./useRouter.js";
|
|
23
|
-
import { useRouterState } from "./useRouterState.js";
|
|
24
25
|
import { useLocation } from "./useLocation.js";
|
|
25
26
|
import { useCanGoBack } from "./useCanGoBack.js";
|
|
26
|
-
import { CatchNotFound, DefaultGlobalNotFound } from "./not-found.js";
|
|
27
|
-
import { ScriptOnce } from "./ScriptOnce.js";
|
|
28
27
|
import { Asset } from "./Asset.js";
|
|
29
|
-
import { HeadContent } from "./HeadContent.js";
|
|
30
28
|
import { useTags } from "./headContentUtils.js";
|
|
29
|
+
import { HeadContent } from "./HeadContent.js";
|
|
31
30
|
import { Scripts } from "./Scripts.js";
|
|
32
31
|
import { Body } from "./Body.js";
|
|
33
32
|
import { Html } from "./Html.js";
|
|
34
|
-
import {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
Await,
|
|
38
|
-
Block,
|
|
39
|
-
Body,
|
|
40
|
-
CatchBoundary,
|
|
41
|
-
CatchNotFound,
|
|
42
|
-
ClientOnly,
|
|
43
|
-
DEFAULT_PROTOCOL_ALLOWLIST,
|
|
44
|
-
DefaultGlobalNotFound,
|
|
45
|
-
ErrorComponent,
|
|
46
|
-
FileRoute,
|
|
47
|
-
FileRouteLoader,
|
|
48
|
-
HeadContent,
|
|
49
|
-
Html,
|
|
50
|
-
LazyRoute,
|
|
51
|
-
Link,
|
|
52
|
-
Match,
|
|
53
|
-
MatchRoute,
|
|
54
|
-
Matches,
|
|
55
|
-
Navigate,
|
|
56
|
-
NotFoundRoute,
|
|
57
|
-
Outlet,
|
|
58
|
-
RootRoute,
|
|
59
|
-
Route,
|
|
60
|
-
RouteApi,
|
|
61
|
-
Router,
|
|
62
|
-
RouterContextProvider,
|
|
63
|
-
RouterProvider,
|
|
64
|
-
ScriptOnce,
|
|
65
|
-
Scripts,
|
|
66
|
-
ScrollRestoration,
|
|
67
|
-
SearchParamError,
|
|
68
|
-
cleanPath,
|
|
69
|
-
composeRewrites,
|
|
70
|
-
createBrowserHistory,
|
|
71
|
-
createControlledPromise,
|
|
72
|
-
createFileRoute,
|
|
73
|
-
createHashHistory,
|
|
74
|
-
createHistory,
|
|
75
|
-
createLazyFileRoute,
|
|
76
|
-
createLazyRoute,
|
|
77
|
-
createLink,
|
|
78
|
-
createMemoryHistory,
|
|
79
|
-
createRootRoute,
|
|
80
|
-
createRootRouteWithContext,
|
|
81
|
-
createRoute,
|
|
82
|
-
createRouteMask,
|
|
83
|
-
createRouter,
|
|
84
|
-
createRouterConfig,
|
|
85
|
-
createSerializationAdapter,
|
|
86
|
-
deepEqual,
|
|
87
|
-
defaultParseSearch,
|
|
88
|
-
defaultStringifySearch,
|
|
89
|
-
defer,
|
|
90
|
-
functionalUpdate,
|
|
91
|
-
getRouteApi,
|
|
92
|
-
interpolatePath,
|
|
93
|
-
isMatch,
|
|
94
|
-
isNotFound,
|
|
95
|
-
isPlainArray,
|
|
96
|
-
isPlainObject,
|
|
97
|
-
isRedirect,
|
|
98
|
-
joinPaths,
|
|
99
|
-
lazyFn,
|
|
100
|
-
lazyRouteComponent,
|
|
101
|
-
linkOptions,
|
|
102
|
-
notFound,
|
|
103
|
-
parseSearchWith,
|
|
104
|
-
redirect,
|
|
105
|
-
replaceEqualDeep,
|
|
106
|
-
resolvePath,
|
|
107
|
-
retainSearchParams,
|
|
108
|
-
rootRouteId,
|
|
109
|
-
rootRouteWithContext,
|
|
110
|
-
stringifySearchWith,
|
|
111
|
-
stripSearchParams,
|
|
112
|
-
trimPath,
|
|
113
|
-
trimPathLeft,
|
|
114
|
-
trimPathRight,
|
|
115
|
-
useAwaited,
|
|
116
|
-
useBlocker,
|
|
117
|
-
useCanGoBack,
|
|
118
|
-
useChildMatches,
|
|
119
|
-
useElementScrollRestoration,
|
|
120
|
-
useLinkProps,
|
|
121
|
-
useLoaderData,
|
|
122
|
-
useLoaderDeps,
|
|
123
|
-
useLocation,
|
|
124
|
-
useMatch,
|
|
125
|
-
useMatchRoute,
|
|
126
|
-
useMatches,
|
|
127
|
-
useNavigate,
|
|
128
|
-
useParams,
|
|
129
|
-
useParentMatches,
|
|
130
|
-
useRouteContext,
|
|
131
|
-
useRouter,
|
|
132
|
-
useRouterState,
|
|
133
|
-
useSearch,
|
|
134
|
-
useTags
|
|
135
|
-
};
|
|
136
|
-
//# sourceMappingURL=index.js.map
|
|
33
|
+
import { DEFAULT_PROTOCOL_ALLOWLIST, SearchParamError, cleanPath, composeRewrites, createControlledPromise, createRouterConfig, createSerializationAdapter, deepEqual, defaultParseSearch, defaultStringifySearch, defer, functionalUpdate, interpolatePath, isMatch, isNotFound, isPlainArray, isPlainObject, isRedirect, joinPaths, lazyFn, notFound, parseSearchWith, redirect, replaceEqualDeep, resolvePath, retainSearchParams, rootRouteId, stringifySearchWith, stripSearchParams, trimPath, trimPathLeft, trimPathRight } from "@tanstack/router-core";
|
|
34
|
+
import { createBrowserHistory, createHashHistory, createHistory, createMemoryHistory } from "@tanstack/history";
|
|
35
|
+
export { Asset, Await, Block, Body, CatchBoundary, CatchNotFound, ClientOnly, DEFAULT_PROTOCOL_ALLOWLIST, DefaultGlobalNotFound, ErrorComponent, FileRoute, FileRouteLoader, HeadContent, Html, LazyRoute, Link, Match, MatchRoute, Matches, Navigate, NotFoundRoute, Outlet, RootRoute, Route, RouteApi, Router, RouterContextProvider, RouterProvider, ScriptOnce, Scripts, ScrollRestoration, SearchParamError, cleanPath, composeRewrites, createBrowserHistory, createControlledPromise, createFileRoute, createHashHistory, createHistory, createLazyFileRoute, createLazyRoute, createLink, createMemoryHistory, createRootRoute, createRootRouteWithContext, createRoute, createRouteMask, createRouter, createRouterConfig, createSerializationAdapter, deepEqual, defaultParseSearch, defaultStringifySearch, defer, functionalUpdate, getRouteApi, interpolatePath, isMatch, isNotFound, isPlainArray, isPlainObject, isRedirect, joinPaths, lazyFn, lazyRouteComponent, linkOptions, notFound, parseSearchWith, redirect, replaceEqualDeep, resolvePath, retainSearchParams, rootRouteId, rootRouteWithContext, stringifySearchWith, stripSearchParams, trimPath, trimPathLeft, trimPathRight, useAwaited, useBlocker, useCanGoBack, useChildMatches, useElementScrollRestoration, useLinkProps, useLoaderData, useLoaderDeps, useLocation, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useParentMatches, useRouteContext, useRouter, useRouterState, useSearch, useTags };
|