@tanstack/vue-router 0.0.1 → 1.140.0
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/LICENSE +21 -0
- package/README.md +66 -45
- package/dist/esm/Asset.d.ts +2 -0
- package/dist/esm/Asset.js +33 -0
- package/dist/esm/Asset.js.map +1 -0
- package/dist/esm/CatchBoundary.d.ts +19 -0
- package/dist/esm/CatchBoundary.js +135 -0
- package/dist/esm/CatchBoundary.js.map +1 -0
- package/dist/esm/ClientOnly.d.ts +67 -0
- package/dist/esm/HeadContent.d.ts +10 -0
- package/dist/esm/HeadContent.js +116 -0
- package/dist/esm/HeadContent.js.map +1 -0
- package/dist/esm/Match.d.ts +25 -0
- package/dist/esm/Match.js +262 -0
- package/dist/esm/Match.js.map +1 -0
- package/dist/esm/Matches.d.ts +39 -0
- package/dist/esm/Matches.js +186 -0
- package/dist/esm/Matches.js.map +1 -0
- package/dist/esm/RouterProvider.d.ts +33 -0
- package/dist/esm/RouterProvider.js +65 -0
- package/dist/esm/RouterProvider.js.map +1 -0
- package/dist/esm/SafeFragment.d.ts +4 -0
- package/dist/esm/ScriptOnce.d.ts +5 -0
- package/dist/esm/ScriptOnce.js +21 -0
- package/dist/esm/ScriptOnce.js.map +1 -0
- package/dist/esm/Scripts.d.ts +1 -0
- package/dist/esm/Scripts.js +46 -0
- package/dist/esm/Scripts.js.map +1 -0
- package/dist/esm/ScrollRestoration.d.ts +14 -0
- package/dist/esm/ScrollRestoration.js +36 -0
- package/dist/esm/ScrollRestoration.js.map +1 -0
- package/dist/esm/Transitioner.d.ts +2 -0
- package/dist/esm/Transitioner.js +154 -0
- package/dist/esm/Transitioner.js.map +1 -0
- package/dist/esm/awaited.d.ts +12 -0
- package/dist/esm/awaited.js +40 -0
- package/dist/esm/awaited.js.map +1 -0
- package/dist/esm/fileRoute.d.ts +54 -0
- package/dist/esm/fileRoute.js +103 -0
- package/dist/esm/fileRoute.js.map +1 -0
- package/dist/esm/history.d.ts +8 -0
- package/dist/esm/index.d.ts +51 -0
- package/dist/esm/index.js +138 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lazyRouteComponent.d.ts +8 -0
- package/dist/esm/lazyRouteComponent.js +106 -0
- package/dist/esm/lazyRouteComponent.js.map +1 -0
- package/dist/esm/link.d.ts +61 -0
- package/dist/esm/link.js +376 -0
- package/dist/esm/link.js.map +1 -0
- package/dist/esm/matchContext.d.ts +20 -0
- package/dist/esm/matchContext.js +16 -0
- package/dist/esm/matchContext.js.map +1 -0
- package/dist/esm/not-found.d.ts +12 -0
- package/dist/esm/not-found.js +45 -0
- package/dist/esm/not-found.js.map +1 -0
- package/dist/esm/renderRouteNotFound.d.ts +11 -0
- package/dist/esm/renderRouteNotFound.js +19 -0
- package/dist/esm/renderRouteNotFound.js.map +1 -0
- package/dist/esm/route.d.ts +96 -0
- package/dist/esm/route.js +176 -0
- package/dist/esm/route.js.map +1 -0
- package/dist/esm/router.d.ts +69 -0
- package/dist/esm/router.js +14 -0
- package/dist/esm/router.js.map +1 -0
- package/dist/esm/routerContext.d.ts +21 -0
- package/dist/esm/routerContext.js +21 -0
- package/dist/esm/routerContext.js.map +1 -0
- package/dist/esm/scroll-restoration.d.ts +1 -0
- package/dist/esm/scroll-restoration.js +21 -0
- package/dist/esm/scroll-restoration.js.map +1 -0
- package/dist/esm/typePrimitives.d.ts +10 -0
- package/dist/esm/useBlocker.d.ts +66 -0
- package/dist/esm/useBlocker.js +295 -0
- package/dist/esm/useBlocker.js.map +1 -0
- package/dist/esm/useCanGoBack.d.ts +1 -0
- package/dist/esm/useCanGoBack.js +8 -0
- package/dist/esm/useCanGoBack.js.map +1 -0
- package/dist/esm/useLoaderData.d.ts +8 -0
- package/dist/esm/useLoaderData.js +14 -0
- package/dist/esm/useLoaderData.js.map +1 -0
- package/dist/esm/useLoaderDeps.d.ts +7 -0
- package/dist/esm/useLoaderDeps.js +17 -0
- package/dist/esm/useLoaderDeps.js.map +1 -0
- package/dist/esm/useLocation.d.ts +7 -0
- package/dist/esm/useLocation.js +10 -0
- package/dist/esm/useLocation.js.map +1 -0
- package/dist/esm/useMatch.d.ts +10 -0
- package/dist/esm/useMatch.js +39 -0
- package/dist/esm/useMatch.js.map +1 -0
- package/dist/esm/useNavigate.d.ts +5 -0
- package/dist/esm/useNavigate.js +29 -0
- package/dist/esm/useNavigate.js.map +1 -0
- package/dist/esm/useParams.d.ts +9 -0
- package/dist/esm/useParams.js +15 -0
- package/dist/esm/useParams.js.map +1 -0
- package/dist/esm/useRouteContext.d.ts +4 -0
- package/dist/esm/useRouteContext.js +11 -0
- package/dist/esm/useRouteContext.js.map +1 -0
- package/dist/esm/useRouter.d.ts +4 -0
- package/dist/esm/useRouter.js +12 -0
- package/dist/esm/useRouter.js.map +1 -0
- package/dist/esm/useRouterState.d.ts +8 -0
- package/dist/esm/useRouterState.js +20 -0
- package/dist/esm/useRouterState.js.map +1 -0
- package/dist/esm/useSearch.d.ts +9 -0
- package/dist/esm/useSearch.js +15 -0
- package/dist/esm/useSearch.js.map +1 -0
- package/dist/esm/utils.d.ts +40 -0
- package/dist/esm/utils.js +44 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/source/Asset.d.ts +2 -0
- package/dist/source/Asset.jsx +22 -0
- package/dist/source/Asset.jsx.map +1 -0
- package/dist/source/CatchBoundary.d.ts +19 -0
- package/dist/source/CatchBoundary.jsx +134 -0
- package/dist/source/CatchBoundary.jsx.map +1 -0
- package/dist/source/ClientOnly.d.ts +67 -0
- package/dist/source/ClientOnly.jsx +63 -0
- package/dist/source/ClientOnly.jsx.map +1 -0
- package/dist/source/HeadContent.d.ts +10 -0
- package/dist/source/HeadContent.jsx +133 -0
- package/dist/source/HeadContent.jsx.map +1 -0
- package/dist/source/Match.d.ts +25 -0
- package/dist/source/Match.jsx +316 -0
- package/dist/source/Match.jsx.map +1 -0
- package/dist/source/Matches.d.ts +39 -0
- package/dist/source/Matches.jsx +191 -0
- package/dist/source/Matches.jsx.map +1 -0
- package/dist/source/RouterProvider.d.ts +33 -0
- package/dist/source/RouterProvider.jsx +63 -0
- package/dist/source/RouterProvider.jsx.map +1 -0
- package/dist/source/SafeFragment.d.ts +4 -0
- package/dist/source/SafeFragment.jsx +10 -0
- package/dist/source/SafeFragment.jsx.map +1 -0
- package/dist/source/ScriptOnce.d.ts +5 -0
- package/dist/source/ScriptOnce.jsx +17 -0
- package/dist/source/ScriptOnce.jsx.map +1 -0
- package/dist/source/Scripts.d.ts +1 -0
- package/dist/source/Scripts.jsx +49 -0
- package/dist/source/Scripts.jsx.map +1 -0
- package/dist/source/ScrollRestoration.d.ts +14 -0
- package/dist/source/ScrollRestoration.jsx +37 -0
- package/dist/source/ScrollRestoration.jsx.map +1 -0
- package/dist/source/Transitioner.d.ts +2 -0
- package/dist/source/Transitioner.jsx +181 -0
- package/dist/source/Transitioner.jsx.map +1 -0
- package/dist/source/awaited.d.ts +12 -0
- package/dist/source/awaited.jsx +38 -0
- package/dist/source/awaited.jsx.map +1 -0
- package/dist/source/fileRoute.d.ts +54 -0
- package/dist/source/fileRoute.js +98 -0
- package/dist/source/fileRoute.js.map +1 -0
- package/dist/source/history.d.ts +8 -0
- package/dist/source/history.js +2 -0
- package/dist/source/history.js.map +1 -0
- package/dist/source/index.d.ts +51 -0
- package/dist/source/index.jsx +40 -0
- package/dist/source/index.jsx.map +1 -0
- package/dist/source/lazyRouteComponent.d.ts +8 -0
- package/dist/source/lazyRouteComponent.jsx +135 -0
- package/dist/source/lazyRouteComponent.jsx.map +1 -0
- package/dist/source/link.d.ts +61 -0
- package/dist/source/link.jsx +495 -0
- package/dist/source/link.jsx.map +1 -0
- package/dist/source/matchContext.d.ts +20 -0
- package/dist/source/matchContext.jsx +32 -0
- package/dist/source/matchContext.jsx.map +1 -0
- package/dist/source/not-found.d.ts +12 -0
- package/dist/source/not-found.jsx +48 -0
- package/dist/source/not-found.jsx.map +1 -0
- package/dist/source/renderRouteNotFound.d.ts +11 -0
- package/dist/source/renderRouteNotFound.jsx +24 -0
- package/dist/source/renderRouteNotFound.jsx.map +1 -0
- package/dist/source/route.d.ts +97 -0
- package/dist/source/route.js +167 -0
- package/dist/source/route.js.map +1 -0
- package/dist/source/router.d.ts +70 -0
- package/dist/source/router.js +10 -0
- package/dist/source/router.js.map +1 -0
- package/dist/source/routerContext.d.ts +21 -0
- package/dist/source/routerContext.jsx +37 -0
- package/dist/source/routerContext.jsx.map +1 -0
- package/dist/source/scroll-restoration.d.ts +1 -0
- package/dist/source/scroll-restoration.jsx +16 -0
- package/dist/source/scroll-restoration.jsx.map +1 -0
- package/dist/source/typePrimitives.d.ts +10 -0
- package/dist/source/typePrimitives.js +2 -0
- package/dist/source/typePrimitives.js.map +1 -0
- package/dist/source/useBlocker.d.ts +66 -0
- package/dist/source/useBlocker.jsx +308 -0
- package/dist/source/useBlocker.jsx.map +1 -0
- package/dist/source/useCanGoBack.d.ts +1 -0
- package/dist/source/useCanGoBack.js +5 -0
- package/dist/source/useCanGoBack.js.map +1 -0
- package/dist/source/useLoaderData.d.ts +8 -0
- package/dist/source/useLoaderData.jsx +11 -0
- package/dist/source/useLoaderData.jsx.map +1 -0
- package/dist/source/useLoaderDeps.d.ts +7 -0
- package/dist/source/useLoaderDeps.jsx +11 -0
- package/dist/source/useLoaderDeps.jsx.map +1 -0
- package/dist/source/useLocation.d.ts +7 -0
- package/dist/source/useLocation.jsx +7 -0
- package/dist/source/useLocation.jsx.map +1 -0
- package/dist/source/useMatch.d.ts +10 -0
- package/dist/source/useMatch.jsx +46 -0
- package/dist/source/useMatch.jsx.map +1 -0
- package/dist/source/useNavigate.d.ts +5 -0
- package/dist/source/useNavigate.jsx +18 -0
- package/dist/source/useNavigate.jsx.map +1 -0
- package/dist/source/useParams.d.ts +9 -0
- package/dist/source/useParams.jsx +12 -0
- package/dist/source/useParams.jsx.map +1 -0
- package/dist/source/useRouteContext.d.ts +4 -0
- package/dist/source/useRouteContext.js +8 -0
- package/dist/source/useRouteContext.js.map +1 -0
- package/dist/source/useRouter.d.ts +4 -0
- package/dist/source/useRouter.jsx +9 -0
- package/dist/source/useRouter.jsx.map +1 -0
- package/dist/source/useRouterState.d.ts +8 -0
- package/dist/source/useRouterState.jsx +19 -0
- package/dist/source/useRouterState.jsx.map +1 -0
- package/dist/source/useSearch.d.ts +9 -0
- package/dist/source/useSearch.jsx +12 -0
- package/dist/source/useSearch.jsx.map +1 -0
- package/dist/source/utils.d.ts +40 -0
- package/dist/source/utils.js +78 -0
- package/dist/source/utils.js.map +1 -0
- package/package.json +77 -7
- package/src/Asset.tsx +23 -0
- package/src/CatchBoundary.tsx +186 -0
- package/src/ClientOnly.tsx +75 -0
- package/src/HeadContent.tsx +159 -0
- package/src/Match.tsx +415 -0
- package/src/Matches.tsx +349 -0
- package/src/RouterProvider.tsx +117 -0
- package/src/SafeFragment.tsx +10 -0
- package/src/ScriptOnce.tsx +30 -0
- package/src/Scripts.tsx +65 -0
- package/src/ScrollRestoration.tsx +69 -0
- package/src/Transitioner.tsx +213 -0
- package/src/awaited.tsx +54 -0
- package/src/fileRoute.ts +271 -0
- package/src/history.ts +9 -0
- package/src/index.tsx +346 -0
- package/src/lazyRouteComponent.tsx +173 -0
- package/src/link.tsx +765 -0
- package/src/matchContext.tsx +41 -0
- package/src/not-found.tsx +55 -0
- package/src/renderRouteNotFound.tsx +35 -0
- package/src/route.ts +658 -0
- package/src/router.ts +103 -0
- package/src/routerContext.tsx +53 -0
- package/src/scroll-restoration.tsx +29 -0
- package/src/typePrimitives.ts +74 -0
- package/src/useBlocker.tsx +501 -0
- package/src/useCanGoBack.ts +5 -0
- package/src/useLoaderData.tsx +50 -0
- package/src/useLoaderDeps.tsx +46 -0
- package/src/useLocation.tsx +30 -0
- package/src/useMatch.tsx +127 -0
- package/src/useNavigate.tsx +40 -0
- package/src/useParams.tsx +71 -0
- package/src/useRouteContext.ts +31 -0
- package/src/useRouter.tsx +15 -0
- package/src/useRouterState.tsx +43 -0
- package/src/useSearch.tsx +71 -0
- package/src/utils.ts +111 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as Vue from 'vue';
|
|
2
|
+
import warning from 'tiny-warning';
|
|
3
|
+
import { DefaultGlobalNotFound } from './not-found';
|
|
4
|
+
/**
|
|
5
|
+
* Renders a not found component for a route when no matching route is found.
|
|
6
|
+
*
|
|
7
|
+
* @param router - The router instance containing the route configuration
|
|
8
|
+
* @param route - The route that triggered the not found state
|
|
9
|
+
* @param data - Additional data to pass to the not found component
|
|
10
|
+
* @returns The rendered not found component or a default fallback component
|
|
11
|
+
*/
|
|
12
|
+
export function renderRouteNotFound(router, route, data) {
|
|
13
|
+
if (!route.options.notFoundComponent) {
|
|
14
|
+
if (router.options.defaultNotFoundComponent) {
|
|
15
|
+
return Vue.h(router.options.defaultNotFoundComponent, data);
|
|
16
|
+
}
|
|
17
|
+
if (process.env.NODE_ENV === 'development') {
|
|
18
|
+
warning(route.options.notFoundComponent, `A notFoundError was encountered on the route with ID "${route.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`);
|
|
19
|
+
}
|
|
20
|
+
return Vue.h(DefaultGlobalNotFound);
|
|
21
|
+
}
|
|
22
|
+
return Vue.h(route.options.notFoundComponent, data);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=renderRouteNotFound.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderRouteNotFound.jsx","sourceRoot":"","sources":["../../src/renderRouteNotFound.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,OAAO,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAGnD;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAiB,EACjB,KAAe,EACf,IAAS;IAET,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;QACrC,IAAI,MAAM,CAAC,OAAO,CAAC,wBAAwB,EAAE,CAAC;YAC5C,OAAO,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,wBAA+B,EAAE,IAAI,CAAC,CAAA;QACpE,CAAC;QAED,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;YAC3C,OAAO,CACL,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAC/B,yDAAyD,KAAK,CAAC,EAAE,oPAAoP,CACtT,CAAA;QACH,CAAC;QAED,OAAO,GAAG,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAA;IACrC,CAAC;IAED,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAwB,EAAE,IAAI,CAAC,CAAA;AAC5D,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { BaseRootRoute, BaseRoute, BaseRouteApi } from '@tanstack/router-core';
|
|
2
|
+
import type { AnyContext, AnyRoute, AnyRouter, ConstrainLiteral, ErrorComponentProps, NotFoundError, NotFoundRouteProps, Register, RegisteredRouter, ResolveFullPath, ResolveId, ResolveParams, RootRoute as RootRouteCore, RootRouteId, RootRouteOptions, RouteConstraints, Route as RouteCore, RouteIds, RouteMask, RouteOptions, RouteTypesById, RouterCore, ToMaskOptions, UseNavigateResult } from '@tanstack/router-core';
|
|
3
|
+
import type { UseLoaderDataRoute } from './useLoaderData';
|
|
4
|
+
import type { UseMatchRoute } from './useMatch';
|
|
5
|
+
import type { UseLoaderDepsRoute } from './useLoaderDeps';
|
|
6
|
+
import type { UseParamsRoute } from './useParams';
|
|
7
|
+
import type { UseSearchRoute } from './useSearch';
|
|
8
|
+
import type * as Vue from 'vue';
|
|
9
|
+
import type { UseRouteContextRoute } from './useRouteContext';
|
|
10
|
+
type VueSFC = {
|
|
11
|
+
readonly __name?: string;
|
|
12
|
+
setup?: (...args: Array<any>) => any;
|
|
13
|
+
render?: Function;
|
|
14
|
+
};
|
|
15
|
+
declare module '@tanstack/router-core' {
|
|
16
|
+
interface UpdatableRouteOptionsExtensions {
|
|
17
|
+
component?: RouteComponent | VueSFC;
|
|
18
|
+
errorComponent?: false | null | undefined | ErrorRouteComponent | VueSFC;
|
|
19
|
+
notFoundComponent?: NotFoundRouteComponent | VueSFC;
|
|
20
|
+
pendingComponent?: RouteComponent | VueSFC;
|
|
21
|
+
}
|
|
22
|
+
interface RouteExtensions<in out TId extends string, in out TFullPath extends string> {
|
|
23
|
+
useMatch: UseMatchRoute<TId>;
|
|
24
|
+
useRouteContext: UseRouteContextRoute<TId>;
|
|
25
|
+
useSearch: UseSearchRoute<TId>;
|
|
26
|
+
useParams: UseParamsRoute<TId>;
|
|
27
|
+
useLoaderDeps: UseLoaderDepsRoute<TId>;
|
|
28
|
+
useLoaderData: UseLoaderDataRoute<TId>;
|
|
29
|
+
useNavigate: () => UseNavigateResult<TFullPath>;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export declare function getRouteApi<const TId, TRouter extends AnyRouter = RegisteredRouter>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>): RouteApi<TId, TRouter>;
|
|
33
|
+
export declare class RouteApi<TId, TRouter extends AnyRouter = RegisteredRouter> extends BaseRouteApi<TId, TRouter> {
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Use the `getRouteApi` function instead.
|
|
36
|
+
*/
|
|
37
|
+
constructor({ id }: {
|
|
38
|
+
id: TId;
|
|
39
|
+
});
|
|
40
|
+
useMatch: UseMatchRoute<TId>;
|
|
41
|
+
useRouteContext: UseRouteContextRoute<TId>;
|
|
42
|
+
useSearch: UseSearchRoute<TId>;
|
|
43
|
+
useParams: UseParamsRoute<TId>;
|
|
44
|
+
useLoaderDeps: UseLoaderDepsRoute<TId>;
|
|
45
|
+
useLoaderData: UseLoaderDataRoute<TId>;
|
|
46
|
+
useNavigate: () => UseNavigateResult<RouteTypesById<TRouter, TId>["fullPath"]>;
|
|
47
|
+
notFound: (opts?: NotFoundError) => NotFoundError;
|
|
48
|
+
}
|
|
49
|
+
export declare class Route<in out TRegister = unknown, in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute, in out TPath extends RouteConstraints['TPath'] = '/', in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, TPath>, in out TCustomId extends RouteConstraints['TCustomId'] = string, in out TId extends RouteConstraints['TId'] = ResolveId<TParentRoute, TCustomId, TPath>, in out TSearchValidator = undefined, in out TParams = ResolveParams<TPath>, in out TRouterContext = AnyContext, in out TRouteContextFn = AnyContext, in out TBeforeLoadFn = AnyContext, in out TLoaderDeps extends Record<string, any> = {}, in out TLoaderFn = undefined, in out TChildren = unknown, in out TFileRouteTypes = unknown, in out TSSR = unknown, in out TMiddlewares = unknown, in out THandlers = undefined> extends BaseRoute<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, TMiddlewares, THandlers> implements RouteCore<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, TMiddlewares, THandlers> {
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated Use the `createRoute` function instead.
|
|
52
|
+
*/
|
|
53
|
+
constructor(options?: RouteOptions<TRegister, TParentRoute, TId, TCustomId, TFullPath, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TSSR, TMiddlewares, THandlers>);
|
|
54
|
+
useMatch: UseMatchRoute<TId>;
|
|
55
|
+
useRouteContext: UseRouteContextRoute<TId>;
|
|
56
|
+
useSearch: UseSearchRoute<TId>;
|
|
57
|
+
useParams: UseParamsRoute<TId>;
|
|
58
|
+
useLoaderDeps: UseLoaderDepsRoute<TId>;
|
|
59
|
+
useLoaderData: UseLoaderDataRoute<TId>;
|
|
60
|
+
useNavigate: () => UseNavigateResult<TFullPath>;
|
|
61
|
+
}
|
|
62
|
+
export declare function createRoute<TRegister = unknown, TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute, TPath extends RouteConstraints['TPath'] = '/', TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, TPath>, TCustomId extends RouteConstraints['TCustomId'] = string, TId extends RouteConstraints['TId'] = ResolveId<TParentRoute, TCustomId, TPath>, TSearchValidator = undefined, TParams = ResolveParams<TPath>, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TChildren = unknown, TSSR = unknown, THandlers = undefined>(options: RouteOptions<TRegister, TParentRoute, TId, TCustomId, TFullPath, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, AnyContext, TRouteContextFn, TBeforeLoadFn, TSSR, THandlers>): Route<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, AnyContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, unknown, TSSR, THandlers>;
|
|
63
|
+
export type AnyRootRoute = RootRoute<any, any, any, any, any, any, any, any, any, any>;
|
|
64
|
+
export declare function createRootRouteWithContext<TRouterContext extends {}>(): <TRegister = Register, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TSearchValidator = undefined, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TSSR = unknown, THandlers = undefined>(options?: RootRouteOptions<TRegister, TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TSSR, THandlers>) => RootRoute<TRegister, TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, unknown, unknown, TSSR, THandlers>;
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated Use the `createRootRouteWithContext` function instead.
|
|
67
|
+
*/
|
|
68
|
+
export declare const rootRouteWithContext: typeof createRootRouteWithContext;
|
|
69
|
+
export declare class RootRoute<in out TRegister = Register, in out TSearchValidator = undefined, in out TRouterContext = {}, in out TRouteContextFn = AnyContext, in out TBeforeLoadFn = AnyContext, in out TLoaderDeps extends Record<string, any> = {}, in out TLoaderFn = undefined, in out TChildren = unknown, in out TFileRouteTypes = unknown, in out TSSR = unknown, in out THandlers = undefined> extends BaseRootRoute<TRegister, TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, THandlers> implements RootRouteCore<TRegister, TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, THandlers> {
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.
|
|
72
|
+
*/
|
|
73
|
+
constructor(options?: RootRouteOptions<TRegister, TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TSSR, THandlers>);
|
|
74
|
+
useMatch: UseMatchRoute<RootRouteId>;
|
|
75
|
+
useRouteContext: UseRouteContextRoute<RootRouteId>;
|
|
76
|
+
useSearch: UseSearchRoute<RootRouteId>;
|
|
77
|
+
useParams: UseParamsRoute<RootRouteId>;
|
|
78
|
+
useLoaderDeps: UseLoaderDepsRoute<RootRouteId>;
|
|
79
|
+
useLoaderData: UseLoaderDataRoute<RootRouteId>;
|
|
80
|
+
useNavigate: () => UseNavigateResult<"/">;
|
|
81
|
+
}
|
|
82
|
+
export declare function createRouteMask<TRouteTree extends AnyRoute, TFrom extends string, TTo extends string>(opts: {
|
|
83
|
+
routeTree: TRouteTree;
|
|
84
|
+
} & ToMaskOptions<RouterCore<TRouteTree, 'never', false>, TFrom, TTo>): RouteMask<TRouteTree>;
|
|
85
|
+
export type VueNode = Vue.VNode;
|
|
86
|
+
export type SyncRouteComponent<TProps> = (props: TProps) => Vue.VNode;
|
|
87
|
+
export type AsyncRouteComponent<TProps> = SyncRouteComponent<TProps> & {
|
|
88
|
+
preload?: () => Promise<void>;
|
|
89
|
+
};
|
|
90
|
+
export type RouteComponent<TProps = any> = AsyncRouteComponent<TProps>;
|
|
91
|
+
export type ErrorRouteComponent = RouteComponent<ErrorComponentProps>;
|
|
92
|
+
export type NotFoundRouteComponent = SyncRouteComponent<NotFoundRouteProps>;
|
|
93
|
+
export declare class NotFoundRoute<TRegister, TParentRoute extends AnyRootRoute, TRouterContext = AnyContext, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TSearchValidator = undefined, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TChildren = unknown, TSSR = unknown, THandlers = undefined> extends Route<TRegister, TParentRoute, '/404', '/404', '404', '404', TSearchValidator, {}, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TSSR, THandlers> {
|
|
94
|
+
constructor(options: Omit<RouteOptions<TRegister, TParentRoute, string, string, string, string, TSearchValidator, {}, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TSSR, THandlers>, 'caseSensitive' | 'parseParams' | 'stringifyParams' | 'path' | 'id' | 'params'>);
|
|
95
|
+
}
|
|
96
|
+
export declare function createRootRoute<TRegister = Register, TSearchValidator = undefined, TRouterContext = {}, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TSSR = unknown, THandlers = undefined>(options?: RootRouteOptions<TRegister, TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TSSR, THandlers>): RootRoute<TRegister, TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, unknown, unknown, TSSR, THandlers>;
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { BaseRootRoute, BaseRoute, BaseRouteApi, notFound, } from '@tanstack/router-core';
|
|
2
|
+
import { useLoaderData } from './useLoaderData';
|
|
3
|
+
import { useLoaderDeps } from './useLoaderDeps';
|
|
4
|
+
import { useParams } from './useParams';
|
|
5
|
+
import { useSearch } from './useSearch';
|
|
6
|
+
import { useNavigate } from './useNavigate';
|
|
7
|
+
import { useMatch } from './useMatch';
|
|
8
|
+
import { useRouter } from './useRouter';
|
|
9
|
+
export function getRouteApi(id) {
|
|
10
|
+
return new RouteApi({ id });
|
|
11
|
+
}
|
|
12
|
+
export class RouteApi extends BaseRouteApi {
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Use the `getRouteApi` function instead.
|
|
15
|
+
*/
|
|
16
|
+
constructor({ id }) {
|
|
17
|
+
super({ id });
|
|
18
|
+
this.useMatch = (opts) => {
|
|
19
|
+
return useMatch({
|
|
20
|
+
select: opts?.select,
|
|
21
|
+
from: this.id,
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
this.useRouteContext = (opts) => {
|
|
25
|
+
return useMatch({
|
|
26
|
+
from: this.id,
|
|
27
|
+
select: (d) => (opts?.select ? opts.select(d.context) : d.context),
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
this.useSearch = (opts) => {
|
|
31
|
+
return useSearch({
|
|
32
|
+
select: opts?.select,
|
|
33
|
+
from: this.id,
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
this.useParams = (opts) => {
|
|
37
|
+
return useParams({
|
|
38
|
+
select: opts?.select,
|
|
39
|
+
from: this.id,
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
this.useLoaderDeps = (opts) => {
|
|
43
|
+
return useLoaderDeps({ ...opts, from: this.id, strict: false });
|
|
44
|
+
};
|
|
45
|
+
this.useLoaderData = (opts) => {
|
|
46
|
+
return useLoaderData({ ...opts, from: this.id, strict: false });
|
|
47
|
+
};
|
|
48
|
+
this.useNavigate = () => {
|
|
49
|
+
const router = useRouter();
|
|
50
|
+
return useNavigate({ from: router.routesById[this.id].fullPath });
|
|
51
|
+
};
|
|
52
|
+
this.notFound = (opts) => {
|
|
53
|
+
return notFound({ routeId: this.id, ...opts });
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export class Route extends BaseRoute {
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated Use the `createRoute` function instead.
|
|
60
|
+
*/
|
|
61
|
+
constructor(options) {
|
|
62
|
+
super(options);
|
|
63
|
+
this.useMatch = (opts) => {
|
|
64
|
+
return useMatch({
|
|
65
|
+
select: opts?.select,
|
|
66
|
+
from: this.id,
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
this.useRouteContext = (opts) => {
|
|
70
|
+
return useMatch({
|
|
71
|
+
...opts,
|
|
72
|
+
from: this.id,
|
|
73
|
+
select: (d) => (opts?.select ? opts.select(d.context) : d.context),
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
this.useSearch = (opts) => {
|
|
77
|
+
return useSearch({
|
|
78
|
+
select: opts?.select,
|
|
79
|
+
from: this.id,
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
this.useParams = (opts) => {
|
|
83
|
+
return useParams({
|
|
84
|
+
select: opts?.select,
|
|
85
|
+
from: this.id,
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
this.useLoaderDeps = (opts) => {
|
|
89
|
+
return useLoaderDeps({ ...opts, from: this.id });
|
|
90
|
+
};
|
|
91
|
+
this.useLoaderData = (opts) => {
|
|
92
|
+
return useLoaderData({ ...opts, from: this.id });
|
|
93
|
+
};
|
|
94
|
+
this.useNavigate = () => {
|
|
95
|
+
return useNavigate({ from: this.fullPath });
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
export function createRoute(options) {
|
|
100
|
+
return new Route(options);
|
|
101
|
+
}
|
|
102
|
+
export function createRootRouteWithContext() {
|
|
103
|
+
return (options) => {
|
|
104
|
+
return createRootRoute(options);
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* @deprecated Use the `createRootRouteWithContext` function instead.
|
|
109
|
+
*/
|
|
110
|
+
export const rootRouteWithContext = createRootRouteWithContext;
|
|
111
|
+
export class RootRoute extends BaseRootRoute {
|
|
112
|
+
/**
|
|
113
|
+
* @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.
|
|
114
|
+
*/
|
|
115
|
+
constructor(options) {
|
|
116
|
+
super(options);
|
|
117
|
+
this.useMatch = (opts) => {
|
|
118
|
+
return useMatch({
|
|
119
|
+
select: opts?.select,
|
|
120
|
+
from: this.id,
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
this.useRouteContext = (opts) => {
|
|
124
|
+
return useMatch({
|
|
125
|
+
...opts,
|
|
126
|
+
from: this.id,
|
|
127
|
+
select: (d) => (opts?.select ? opts.select(d.context) : d.context),
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
this.useSearch = (opts) => {
|
|
131
|
+
return useSearch({
|
|
132
|
+
select: opts?.select,
|
|
133
|
+
from: this.id,
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
this.useParams = (opts) => {
|
|
137
|
+
return useParams({
|
|
138
|
+
select: opts?.select,
|
|
139
|
+
from: this.id,
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
this.useLoaderDeps = (opts) => {
|
|
143
|
+
return useLoaderDeps({ ...opts, from: this.id });
|
|
144
|
+
};
|
|
145
|
+
this.useLoaderData = (opts) => {
|
|
146
|
+
return useLoaderData({ ...opts, from: this.id });
|
|
147
|
+
};
|
|
148
|
+
this.useNavigate = () => {
|
|
149
|
+
return useNavigate({ from: this.fullPath });
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
export function createRouteMask(opts) {
|
|
154
|
+
return opts;
|
|
155
|
+
}
|
|
156
|
+
export class NotFoundRoute extends Route {
|
|
157
|
+
constructor(options) {
|
|
158
|
+
super({
|
|
159
|
+
...options,
|
|
160
|
+
id: '404',
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
export function createRootRoute(options) {
|
|
165
|
+
return new RootRoute(options);
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../src/route.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,GACT,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAkEvC,MAAM,UAAU,WAAW,CAGzB,EAAyD;IACzD,OAAO,IAAI,QAAQ,CAAe,EAAE,EAAE,EAAE,CAAC,CAAA;AAC3C,CAAC;AAED,MAAM,OAAO,QAGX,SAAQ,YAA0B;IAClC;;OAEG;IACH,YAAY,EAAE,EAAE,EAAe;QAC7B,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QAGf,aAAQ,GAAuB,CAAC,IAAI,EAAE,EAAE;YACtC,OAAO,QAAQ,CAAC;gBACd,MAAM,EAAE,IAAI,EAAE,MAAM;gBACpB,IAAI,EAAE,IAAI,CAAC,EAAE;aACP,CAAQ,CAAA;QAClB,CAAC,CAAA;QAED,oBAAe,GAA8B,CAAC,IAAI,EAAE,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|
1
|
+
import { RouterCore } from '@tanstack/router-core';
|
|
2
|
+
import type { RouterHistory } from '@tanstack/history';
|
|
3
|
+
import type { AnyRoute, CreateRouterFn, RouterConstructorOptions, TrailingSlashOption } from '@tanstack/router-core';
|
|
4
|
+
import type { ErrorRouteComponent, NotFoundRouteComponent, RouteComponent } from './route';
|
|
5
|
+
import type { VNode } from 'vue';
|
|
6
|
+
declare module '@tanstack/router-core' {
|
|
7
|
+
interface RouterOptionsExtensions {
|
|
8
|
+
/**
|
|
9
|
+
* The default `component` a route should use if no component is provided.
|
|
10
|
+
*
|
|
11
|
+
* @default Outlet
|
|
12
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultcomponent-property)
|
|
13
|
+
*/
|
|
14
|
+
defaultComponent?: RouteComponent;
|
|
15
|
+
/**
|
|
16
|
+
* The default `errorComponent` a route should use if no error component is provided.
|
|
17
|
+
*
|
|
18
|
+
* @default ErrorComponent
|
|
19
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaulterrorcomponent-property)
|
|
20
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#handling-errors-with-routeoptionserrorcomponent)
|
|
21
|
+
*/
|
|
22
|
+
defaultErrorComponent?: ErrorRouteComponent;
|
|
23
|
+
/**
|
|
24
|
+
* The default `pendingComponent` a route should use if no pending component is provided.
|
|
25
|
+
*
|
|
26
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultpendingcomponent-property)
|
|
27
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#showing-a-pending-component)
|
|
28
|
+
*/
|
|
29
|
+
defaultPendingComponent?: RouteComponent;
|
|
30
|
+
/**
|
|
31
|
+
* The default `notFoundComponent` a route should use if no notFound component is provided.
|
|
32
|
+
*
|
|
33
|
+
* @default NotFound
|
|
34
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultnotfoundcomponent-property)
|
|
35
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/not-found-errors#default-router-wide-not-found-handling)
|
|
36
|
+
*/
|
|
37
|
+
defaultNotFoundComponent?: NotFoundRouteComponent;
|
|
38
|
+
/**
|
|
39
|
+
* A component that will be used to wrap the entire router.
|
|
40
|
+
*
|
|
41
|
+
* This is useful for providing a context to the entire router.
|
|
42
|
+
*
|
|
43
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#wrap-property)
|
|
44
|
+
*/
|
|
45
|
+
Wrap?: (props: {
|
|
46
|
+
children: any;
|
|
47
|
+
}) => VNode;
|
|
48
|
+
/**
|
|
49
|
+
* A component that will be used to wrap the inner contents of the router.
|
|
50
|
+
*
|
|
51
|
+
* This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.
|
|
52
|
+
*
|
|
53
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#innerwrap-property)
|
|
54
|
+
*/
|
|
55
|
+
InnerWrap?: (props: {
|
|
56
|
+
children: any;
|
|
57
|
+
}) => VNode;
|
|
58
|
+
/**
|
|
59
|
+
* The default `onCatch` handler for errors caught by the Router ErrorBoundary
|
|
60
|
+
*
|
|
61
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)
|
|
62
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)
|
|
63
|
+
*/
|
|
64
|
+
defaultOnCatch?: (error: Error) => void;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export declare const createRouter: CreateRouterFn;
|
|
68
|
+
export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailingSlashOption extends TrailingSlashOption = 'never', in out TDefaultStructuralSharingOption extends boolean = false, in out TRouterHistory extends RouterHistory = RouterHistory, in out TDehydrated extends Record<string, any> = Record<string, any>> extends RouterCore<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated> {
|
|
69
|
+
constructor(options: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>);
|
|
70
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RouterCore } from '@tanstack/router-core';
|
|
2
|
+
export const createRouter = (options) => {
|
|
3
|
+
return new Router(options);
|
|
4
|
+
};
|
|
5
|
+
export class Router extends RouterCore {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AA0ElD,MAAM,CAAC,MAAM,YAAY,GAAmB,CAAC,OAAO,EAAE,EAAE;IACtD,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,CAAA;AAC5B,CAAC,CAAA;AAED,MAAM,OAAO,MAMX,SAAQ,UAMT;IACC,YACE,OAMC;QAED,KAAK,CAAC,OAAO,CAAC,CAAA;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as Vue from 'vue';
|
|
2
|
+
import type { AnyRouter } from '@tanstack/router-core';
|
|
3
|
+
export declare const RouterSymbol: Vue.InjectionKey<AnyRouter>;
|
|
4
|
+
declare global {
|
|
5
|
+
interface Window {
|
|
6
|
+
__TSR_ROUTER_CONTEXT__?: Vue.InjectionKey<AnyRouter>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Gets the router context, handling server-side rendering
|
|
11
|
+
* and ensuring a single instance across the application
|
|
12
|
+
*/
|
|
13
|
+
export declare function getRouterContext(): Vue.InjectionKey<AnyRouter>;
|
|
14
|
+
/**
|
|
15
|
+
* Provides the router to all child components
|
|
16
|
+
*/
|
|
17
|
+
export declare function provideRouter(router: AnyRouter): void;
|
|
18
|
+
/**
|
|
19
|
+
* Injects the router from the component tree
|
|
20
|
+
*/
|
|
21
|
+
export declare function injectRouter(): AnyRouter;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as Vue from 'vue';
|
|
2
|
+
// Create a router context symbol
|
|
3
|
+
export const RouterSymbol = Symbol('TanStackRouter');
|
|
4
|
+
/**
|
|
5
|
+
* Gets the router context, handling server-side rendering
|
|
6
|
+
* and ensuring a single instance across the application
|
|
7
|
+
*/
|
|
8
|
+
export function getRouterContext() {
|
|
9
|
+
if (typeof document === 'undefined') {
|
|
10
|
+
// For SSR, return the symbol directly
|
|
11
|
+
return RouterSymbol;
|
|
12
|
+
}
|
|
13
|
+
// In the browser, check if we have a cached context
|
|
14
|
+
if (window.__TSR_ROUTER_CONTEXT__) {
|
|
15
|
+
return window.__TSR_ROUTER_CONTEXT__;
|
|
16
|
+
}
|
|
17
|
+
// Create and cache the context
|
|
18
|
+
window.__TSR_ROUTER_CONTEXT__ = RouterSymbol;
|
|
19
|
+
return RouterSymbol;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Provides the router to all child components
|
|
23
|
+
*/
|
|
24
|
+
export function provideRouter(router) {
|
|
25
|
+
Vue.provide(getRouterContext(), router);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Injects the router from the component tree
|
|
29
|
+
*/
|
|
30
|
+
export function injectRouter() {
|
|
31
|
+
const router = Vue.inject(getRouterContext(), null);
|
|
32
|
+
if (!router) {
|
|
33
|
+
throw new Error('No TanStack Router found in component tree. Did you forget to add a RouterProvider component?');
|
|
34
|
+
}
|
|
35
|
+
return router;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=routerContext.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routerContext.jsx","sourceRoot":"","sources":["../../src/routerContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAG1B,iCAAiC;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAChC,gBAAgB,CACc,CAAA;AAQhC;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;QACpC,sCAAsC;QACtC,OAAO,YAAY,CAAA;IACrB,CAAC;IAED,oDAAoD;IACpD,IAAI,MAAM,CAAC,sBAAsB,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC,sBAAsB,CAAA;IACtC,CAAC;IAED,+BAA+B;IAC/B,MAAM,CAAC,sBAAsB,GAAG,YAAY,CAAA;IAC5C,OAAO,YAAY,CAAA;AACrB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAAiB;IAC7C,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,MAAM,CAAC,CAAA;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAmB,gBAAgB,EAAE,EAAE,IAAI,CAAC,CAAA;IACrE,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,+FAA+F,CAChG,CAAA;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ScrollRestoration(): import("vue/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defaultGetScrollRestorationKey, restoreScroll, storageKey, } from '@tanstack/router-core';
|
|
2
|
+
import { useRouter } from './useRouter';
|
|
3
|
+
import { ScriptOnce } from './ScriptOnce';
|
|
4
|
+
export function ScrollRestoration() {
|
|
5
|
+
const router = useRouter();
|
|
6
|
+
const getKey = router.options.getScrollRestorationKey || defaultGetScrollRestorationKey;
|
|
7
|
+
const userKey = getKey(router.latestLocation);
|
|
8
|
+
const resolvedKey = userKey !== defaultGetScrollRestorationKey(router.latestLocation)
|
|
9
|
+
? userKey
|
|
10
|
+
: null;
|
|
11
|
+
if (!router.isScrollRestoring || !router.isServer) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return (<ScriptOnce children={`(${restoreScroll.toString()})(${JSON.stringify(storageKey)},${JSON.stringify(resolvedKey)}, undefined, true)`} log={false}/>);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=scroll-restoration.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-restoration.jsx","sourceRoot":"","sources":["../../src/scroll-restoration.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,aAAa,EACb,UAAU,GACX,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,UAAU,iBAAiB;IAC/B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,MAAM,GACV,MAAM,CAAC,OAAO,CAAC,uBAAuB,IAAI,8BAA8B,CAAA;IAC1E,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;IAC7C,MAAM,WAAW,GACf,OAAO,KAAK,8BAA8B,CAAC,MAAM,CAAC,cAAc,CAAC;QAC/D,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,IAAI,CAAA;IAEV,IAAI,CAAC,MAAM,CAAC,iBAAiB,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAClD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,CACL,CAAC,UAAU,CACT,QAAQ,CAAC,CAAC,IAAI,aAAa,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,oBAAoB,CAAC,CACzH,GAAG,CAAC,CAAC,KAAK,CAAC,EACX,CACH,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LinkComponentProps } from './link';
|
|
2
|
+
import type { UseParamsOptions } from './useParams';
|
|
3
|
+
import type { UseSearchOptions } from './useSearch';
|
|
4
|
+
import type { AnyRouter, Constrain, InferFrom, InferMaskFrom, InferMaskTo, InferSelected, InferShouldThrow, InferStrict, InferTo, RegisteredRouter } from '@tanstack/router-core';
|
|
5
|
+
export type ValidateLinkOptions<TRouter extends AnyRouter = RegisteredRouter, TOptions = unknown, TDefaultFrom extends string = string, TComp = 'a'> = Constrain<TOptions, LinkComponentProps<TComp, TRouter, InferFrom<TOptions, TDefaultFrom>, InferTo<TOptions>, InferMaskFrom<TOptions>, InferMaskTo<TOptions>>>;
|
|
6
|
+
export type ValidateLinkOptionsArray<TRouter extends AnyRouter = RegisteredRouter, TOptions extends ReadonlyArray<any> = ReadonlyArray<unknown>, TDefaultFrom extends string = string, TComp = 'a'> = {
|
|
7
|
+
[K in keyof TOptions]: ValidateLinkOptions<TRouter, TOptions[K], TDefaultFrom, TComp>;
|
|
8
|
+
};
|
|
9
|
+
export type ValidateUseSearchOptions<TOptions, TRouter extends AnyRouter = RegisteredRouter> = Constrain<TOptions, UseSearchOptions<TRouter, InferFrom<TOptions>, InferStrict<TOptions>, InferShouldThrow<TOptions>, InferSelected<TOptions>>>;
|
|
10
|
+
export type ValidateUseParamsOptions<TOptions, TRouter extends AnyRouter = RegisteredRouter> = Constrain<TOptions, UseParamsOptions<TRouter, InferFrom<TOptions>, InferStrict<TOptions>, InferShouldThrow<TOptions>, InferSelected<TOptions>>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typePrimitives.js","sourceRoot":"","sources":["../../src/typePrimitives.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as Vue from 'vue';
|
|
2
|
+
import type { HistoryAction } from '@tanstack/history';
|
|
3
|
+
import type { AnyRoute, AnyRouter, ParseRoute, RegisteredRouter } from '@tanstack/router-core';
|
|
4
|
+
interface ShouldBlockFnLocation<out TRouteId, out TFullPath, out TAllParams, out TFullSearchSchema> {
|
|
5
|
+
routeId: TRouteId;
|
|
6
|
+
fullPath: TFullPath;
|
|
7
|
+
pathname: string;
|
|
8
|
+
params: TAllParams;
|
|
9
|
+
search: TFullSearchSchema;
|
|
10
|
+
}
|
|
11
|
+
type MakeShouldBlockFnLocationUnion<TRouter extends AnyRouter = RegisteredRouter, TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>> = TRoute extends any ? ShouldBlockFnLocation<TRoute['id'], TRoute['fullPath'], TRoute['types']['allParams'], TRoute['types']['fullSearchSchema']> : never;
|
|
12
|
+
type BlockerResolver<TRouter extends AnyRouter = RegisteredRouter> = {
|
|
13
|
+
status: 'blocked';
|
|
14
|
+
current: MakeShouldBlockFnLocationUnion<TRouter>;
|
|
15
|
+
next: MakeShouldBlockFnLocationUnion<TRouter>;
|
|
16
|
+
action: HistoryAction;
|
|
17
|
+
proceed: () => void;
|
|
18
|
+
reset: () => void;
|
|
19
|
+
} | {
|
|
20
|
+
status: 'idle';
|
|
21
|
+
current: undefined;
|
|
22
|
+
next: undefined;
|
|
23
|
+
action: undefined;
|
|
24
|
+
proceed: undefined;
|
|
25
|
+
reset: undefined;
|
|
26
|
+
};
|
|
27
|
+
type ShouldBlockFnArgs<TRouter extends AnyRouter = RegisteredRouter> = {
|
|
28
|
+
current: MakeShouldBlockFnLocationUnion<TRouter>;
|
|
29
|
+
next: MakeShouldBlockFnLocationUnion<TRouter>;
|
|
30
|
+
action: HistoryAction;
|
|
31
|
+
};
|
|
32
|
+
export type ShouldBlockFn<TRouter extends AnyRouter = RegisteredRouter> = (args: ShouldBlockFnArgs<TRouter>) => boolean | Promise<boolean>;
|
|
33
|
+
export type UseBlockerOpts<TRouter extends AnyRouter = RegisteredRouter, TWithResolver extends boolean = boolean> = {
|
|
34
|
+
shouldBlockFn: ShouldBlockFn<TRouter>;
|
|
35
|
+
enableBeforeUnload?: boolean | (() => boolean);
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
withResolver?: TWithResolver;
|
|
38
|
+
};
|
|
39
|
+
type LegacyBlockerFn = () => Promise<any> | any;
|
|
40
|
+
type LegacyBlockerOpts = {
|
|
41
|
+
blockerFn?: LegacyBlockerFn;
|
|
42
|
+
condition?: boolean | any;
|
|
43
|
+
};
|
|
44
|
+
export declare function useBlocker<TRouter extends AnyRouter = RegisteredRouter, TWithResolver extends boolean = false>(opts: UseBlockerOpts<TRouter, TWithResolver>): TWithResolver extends true ? Vue.Ref<BlockerResolver<TRouter>> : void;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated Use the shouldBlockFn property instead
|
|
47
|
+
*/
|
|
48
|
+
export declare function useBlocker(blockerFnOrOpts?: LegacyBlockerOpts): Vue.Ref<BlockerResolver>;
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated Use the UseBlockerOpts object syntax instead
|
|
51
|
+
*/
|
|
52
|
+
export declare function useBlocker(blockerFn?: LegacyBlockerFn, condition?: boolean | any): Vue.Ref<BlockerResolver>;
|
|
53
|
+
export declare function Block<TRouter extends AnyRouter = RegisteredRouter, TWithResolver extends boolean = boolean>(opts: PromptProps<TRouter, TWithResolver>): Vue.VNode;
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated Use the UseBlockerOpts property instead
|
|
56
|
+
*/
|
|
57
|
+
export declare function Block(opts: LegacyPromptProps): Vue.VNode;
|
|
58
|
+
type LegacyPromptProps = {
|
|
59
|
+
blockerFn?: LegacyBlockerFn;
|
|
60
|
+
condition?: boolean | any;
|
|
61
|
+
children?: Vue.VNode | ((params: BlockerResolver) => Vue.VNode);
|
|
62
|
+
};
|
|
63
|
+
type PromptProps<TRouter extends AnyRouter = RegisteredRouter, TWithResolver extends boolean = boolean, TParams = TWithResolver extends true ? BlockerResolver<TRouter> : void> = UseBlockerOpts<TRouter, TWithResolver> & {
|
|
64
|
+
children?: Vue.VNode | ((params: TParams) => Vue.VNode);
|
|
65
|
+
};
|
|
66
|
+
export {};
|