@depup/tanstack__react-router 1.167.1-depup.0 → 1.167.3-depup.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/README.md +2 -2
- package/dist/cjs/Asset.cjs +115 -174
- package/dist/cjs/Asset.cjs.map +1 -1
- package/dist/cjs/CatchBoundary.cjs +92 -108
- package/dist/cjs/CatchBoundary.cjs.map +1 -1
- package/dist/cjs/ClientOnly.cjs +47 -13
- package/dist/cjs/ClientOnly.cjs.map +1 -1
- package/dist/cjs/HeadContent.cjs +23 -12
- package/dist/cjs/HeadContent.cjs.map +1 -1
- package/dist/cjs/HeadContent.dev.cjs +33 -38
- package/dist/cjs/HeadContent.dev.cjs.map +1 -1
- package/dist/cjs/Match.cjs +190 -247
- package/dist/cjs/Match.cjs.map +1 -1
- package/dist/cjs/Matches.cjs +131 -118
- package/dist/cjs/Matches.cjs.map +1 -1
- package/dist/cjs/RouterProvider.cjs +43 -27
- package/dist/cjs/RouterProvider.cjs.map +1 -1
- package/dist/cjs/SafeFragment.cjs +9 -5
- package/dist/cjs/SafeFragment.cjs.map +1 -1
- package/dist/cjs/ScriptOnce.cjs +17 -19
- package/dist/cjs/ScriptOnce.cjs.map +1 -1
- package/dist/cjs/Scripts.cjs +56 -54
- package/dist/cjs/Scripts.cjs.map +1 -1
- package/dist/cjs/ScrollRestoration.cjs +26 -30
- package/dist/cjs/ScrollRestoration.cjs.map +1 -1
- package/dist/cjs/Transitioner.cjs +109 -116
- package/dist/cjs/Transitioner.cjs.map +1 -1
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/cjs/awaited.cjs +28 -43
- package/dist/cjs/awaited.cjs.map +1 -1
- package/dist/cjs/fileRoute.cjs +133 -95
- package/dist/cjs/fileRoute.cjs.map +1 -1
- package/dist/cjs/headContentUtils.cjs +144 -181
- package/dist/cjs/headContentUtils.cjs.map +1 -1
- package/dist/cjs/index.cjs +249 -178
- package/dist/cjs/index.dev.cjs +249 -178
- package/dist/cjs/lazyRouteComponent.cjs +52 -67
- package/dist/cjs/lazyRouteComponent.cjs.map +1 -1
- package/dist/cjs/link.cjs +462 -556
- package/dist/cjs/link.cjs.map +1 -1
- package/dist/cjs/matchContext.cjs +9 -25
- package/dist/cjs/matchContext.cjs.map +1 -1
- package/dist/cjs/not-found.cjs +25 -32
- package/dist/cjs/not-found.cjs.map +1 -1
- package/dist/cjs/renderRouteNotFound.cjs +25 -19
- package/dist/cjs/renderRouteNotFound.cjs.map +1 -1
- package/dist/cjs/route.cjs +258 -178
- package/dist/cjs/route.cjs.map +1 -1
- package/dist/cjs/router.cjs +29 -16
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/routerContext.cjs +8 -22
- package/dist/cjs/routerContext.cjs.map +1 -1
- package/dist/cjs/scroll-restoration.cjs +23 -36
- package/dist/cjs/scroll-restoration.cjs.map +1 -1
- package/dist/cjs/ssr/RouterClient.cjs +16 -22
- package/dist/cjs/ssr/RouterClient.cjs.map +1 -1
- package/dist/cjs/ssr/RouterServer.cjs +10 -6
- package/dist/cjs/ssr/RouterServer.cjs.map +1 -1
- package/dist/cjs/ssr/client.cjs +10 -10
- package/dist/cjs/ssr/defaultRenderHandler.cjs +13 -14
- package/dist/cjs/ssr/defaultRenderHandler.cjs.map +1 -1
- package/dist/cjs/ssr/defaultStreamHandler.cjs +14 -15
- package/dist/cjs/ssr/defaultStreamHandler.cjs.map +1 -1
- package/dist/cjs/ssr/renderRouterToStream.cjs +51 -71
- package/dist/cjs/ssr/renderRouterToStream.cjs.map +1 -1
- package/dist/cjs/ssr/renderRouterToString.cjs +26 -29
- package/dist/cjs/ssr/renderRouterToString.cjs.map +1 -1
- package/dist/cjs/ssr/server.cjs +18 -18
- package/dist/cjs/useBlocker.cjs +126 -162
- package/dist/cjs/useBlocker.cjs.map +1 -1
- package/dist/cjs/useCanGoBack.cjs +6 -5
- package/dist/cjs/useCanGoBack.cjs.map +1 -1
- package/dist/cjs/useLoaderData.cjs +24 -12
- package/dist/cjs/useLoaderData.cjs.map +1 -1
- package/dist/cjs/useLoaderDeps.cjs +23 -11
- package/dist/cjs/useLoaderDeps.cjs.map +1 -1
- package/dist/cjs/useLocation.cjs +17 -7
- package/dist/cjs/useLocation.cjs.map +1 -1
- package/dist/cjs/useMatch.cjs +25 -44
- package/dist/cjs/useMatch.cjs.map +1 -1
- package/dist/cjs/useNavigate.cjs +53 -43
- package/dist/cjs/useNavigate.cjs.map +1 -1
- package/dist/cjs/useParams.cjs +27 -14
- package/dist/cjs/useParams.cjs.map +1 -1
- package/dist/cjs/useRouteContext.cjs +9 -8
- package/dist/cjs/useRouteContext.cjs.map +1 -1
- package/dist/cjs/useRouter.cjs +23 -29
- package/dist/cjs/useRouter.cjs.map +1 -1
- package/dist/cjs/useRouterState.cjs +40 -35
- package/dist/cjs/useRouterState.cjs.map +1 -1
- package/dist/cjs/useSearch.cjs +26 -13
- package/dist/cjs/useSearch.cjs.map +1 -1
- package/dist/cjs/utils.cjs +81 -51
- package/dist/cjs/utils.cjs.map +1 -1
- package/dist/esm/Asset.js +112 -156
- package/dist/esm/Asset.js.map +1 -1
- package/dist/esm/CatchBoundary.js +90 -92
- package/dist/esm/CatchBoundary.js.map +1 -1
- package/dist/esm/ClientOnly.js +45 -14
- package/dist/esm/ClientOnly.js.map +1 -1
- package/dist/esm/HeadContent.dev.js +31 -21
- package/dist/esm/HeadContent.dev.js.map +1 -1
- package/dist/esm/HeadContent.js +20 -11
- package/dist/esm/HeadContent.js.map +1 -1
- package/dist/esm/Match.js +181 -226
- package/dist/esm/Match.js.map +1 -1
- package/dist/esm/Matches.js +125 -103
- package/dist/esm/Matches.js.map +1 -1
- package/dist/esm/RouterProvider.js +41 -28
- package/dist/esm/RouterProvider.js.map +1 -1
- package/dist/esm/SafeFragment.js +8 -6
- package/dist/esm/SafeFragment.js.map +1 -1
- package/dist/esm/ScriptOnce.js +15 -18
- package/dist/esm/ScriptOnce.js.map +1 -1
- package/dist/esm/Scripts.js +55 -54
- package/dist/esm/Scripts.js.map +1 -1
- package/dist/esm/ScrollRestoration.js +25 -31
- package/dist/esm/ScrollRestoration.js.map +1 -1
- package/dist/esm/Transitioner.js +106 -98
- package/dist/esm/Transitioner.js.map +1 -1
- package/dist/esm/awaited.js +26 -27
- package/dist/esm/awaited.js.map +1 -1
- package/dist/esm/fileRoute.js +127 -96
- package/dist/esm/fileRoute.js.map +1 -1
- package/dist/esm/headContentUtils.js +141 -163
- package/dist/esm/headContentUtils.js.map +1 -1
- package/dist/esm/index.dev.js +16 -117
- package/dist/esm/index.js +18 -118
- package/dist/esm/lazyRouteComponent.js +50 -50
- package/dist/esm/lazyRouteComponent.js.map +1 -1
- package/dist/esm/link.js +459 -541
- package/dist/esm/link.js.map +1 -1
- package/dist/esm/matchContext.js +8 -10
- package/dist/esm/matchContext.js.map +1 -1
- package/dist/esm/not-found.js +22 -32
- package/dist/esm/not-found.js.map +1 -1
- package/dist/esm/renderRouteNotFound.js +21 -18
- package/dist/esm/renderRouteNotFound.js.map +1 -1
- package/dist/esm/route.js +249 -180
- package/dist/esm/route.js.map +1 -1
- package/dist/esm/router.js +28 -17
- package/dist/esm/router.js.map +1 -1
- package/dist/esm/routerContext.js +7 -6
- package/dist/esm/routerContext.js.map +1 -1
- package/dist/esm/scroll-restoration.js +21 -35
- package/dist/esm/scroll-restoration.js.map +1 -1
- package/dist/esm/ssr/RouterClient.js +14 -21
- package/dist/esm/ssr/RouterClient.js.map +1 -1
- package/dist/esm/ssr/RouterServer.js +8 -6
- package/dist/esm/ssr/RouterServer.js.map +1 -1
- package/dist/esm/ssr/client.js +1 -4
- package/dist/esm/ssr/defaultRenderHandler.js +12 -13
- package/dist/esm/ssr/defaultRenderHandler.js.map +1 -1
- package/dist/esm/ssr/defaultStreamHandler.js +13 -14
- package/dist/esm/ssr/defaultStreamHandler.js.map +1 -1
- package/dist/esm/ssr/renderRouterToStream.js +48 -70
- package/dist/esm/ssr/renderRouterToStream.js.map +1 -1
- package/dist/esm/ssr/renderRouterToString.js +24 -29
- package/dist/esm/ssr/renderRouterToString.js.map +1 -1
- package/dist/esm/ssr/server.js +3 -10
- package/dist/esm/useBlocker.js +124 -146
- 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 +24 -12
- package/dist/esm/useLoaderData.js.map +1 -1
- package/dist/esm/useLoaderDeps.js +23 -11
- package/dist/esm/useLoaderDeps.js.map +1 -1
- package/dist/esm/useLocation.js +17 -7
- package/dist/esm/useLocation.js.map +1 -1
- package/dist/esm/useMatch.js +21 -26
- package/dist/esm/useMatch.js.map +1 -1
- package/dist/esm/useNavigate.js +50 -26
- package/dist/esm/useNavigate.js.map +1 -1
- package/dist/esm/useParams.js +27 -14
- 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 +20 -12
- package/dist/esm/useRouter.js.map +1 -1
- package/dist/esm/useRouterState.js +38 -34
- package/dist/esm/useRouterState.js.map +1 -1
- package/dist/esm/useSearch.js +26 -13
- package/dist/esm/useSearch.js.map +1 -1
- package/dist/esm/utils.js +80 -39
- package/dist/esm/utils.js.map +1 -1
- package/package.json +5 -5
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/index.dev.cjs.map +0 -1
- package/dist/cjs/ssr/client.cjs.map +0 -1
- package/dist/cjs/ssr/server.cjs.map +0 -1
- 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
package/dist/esm/useNavigate.js
CHANGED
|
@@ -1,32 +1,56 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { useLayoutEffect } from "./utils.js";
|
|
3
2
|
import { useRouter } from "./useRouter.js";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
//#region src/useNavigate.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Imperative navigation hook.
|
|
7
|
+
*
|
|
8
|
+
* Returns a stable `navigate(options)` function to change the current location
|
|
9
|
+
* programmatically. Prefer the `Link` component for user-initiated navigation,
|
|
10
|
+
* and use this hook from effects, callbacks, or handlers where imperative
|
|
11
|
+
* navigation is required.
|
|
12
|
+
*
|
|
13
|
+
* Options:
|
|
14
|
+
* - `from`: Optional route base used to resolve relative `to` paths.
|
|
15
|
+
*
|
|
16
|
+
* @returns A function that accepts `NavigateOptions`.
|
|
17
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useNavigateHook
|
|
18
|
+
*/
|
|
4
19
|
function useNavigate(_defaultOpts) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
[_defaultOpts?.from, router]
|
|
14
|
-
);
|
|
20
|
+
const router = useRouter();
|
|
21
|
+
return React$1.useCallback((options) => {
|
|
22
|
+
return router.navigate({
|
|
23
|
+
...options,
|
|
24
|
+
from: options.from ?? _defaultOpts?.from
|
|
25
|
+
});
|
|
26
|
+
}, [_defaultOpts?.from, router]);
|
|
15
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Component that triggers a navigation when rendered. Navigation executes
|
|
30
|
+
* in an effect after mount/update.
|
|
31
|
+
*
|
|
32
|
+
* Props are the same as `NavigateOptions` used by `navigate()`.
|
|
33
|
+
*
|
|
34
|
+
* @returns null
|
|
35
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/navigateComponent
|
|
36
|
+
*/
|
|
16
37
|
function Navigate(props) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
38
|
+
const router = useRouter();
|
|
39
|
+
const navigate = useNavigate();
|
|
40
|
+
const previousPropsRef = React$1.useRef(null);
|
|
41
|
+
useLayoutEffect(() => {
|
|
42
|
+
if (previousPropsRef.current !== props) {
|
|
43
|
+
navigate(props);
|
|
44
|
+
previousPropsRef.current = props;
|
|
45
|
+
}
|
|
46
|
+
}, [
|
|
47
|
+
router,
|
|
48
|
+
props,
|
|
49
|
+
navigate
|
|
50
|
+
]);
|
|
51
|
+
return null;
|
|
27
52
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=useNavigate.js.map
|
|
53
|
+
//#endregion
|
|
54
|
+
export { Navigate, useNavigate };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=useNavigate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavigate.js","sources":["../../src/useNavigate.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useLayoutEffect } from './utils'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n FromPathOption,\n NavigateOptions,\n RegisteredRouter,\n UseNavigateResult,\n} from '@tanstack/router-core'\n\n/**\n * Imperative navigation hook.\n *\n * Returns a stable `navigate(options)` function to change the current location\n * programmatically. Prefer the `Link` component for user-initiated navigation,\n * and use this hook from effects, callbacks, or handlers where imperative\n * navigation is required.\n *\n * Options:\n * - `from`: Optional route base used to resolve relative `to` paths.\n *\n * @returns A function that accepts `NavigateOptions`.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useNavigateHook\n */\nexport function useNavigate<\n TRouter extends AnyRouter = RegisteredRouter,\n TDefaultFrom extends string = string,\n>(_defaultOpts?: {\n from?: FromPathOption<TRouter, TDefaultFrom>\n}): UseNavigateResult<TDefaultFrom> {\n const router = useRouter()\n\n return React.useCallback(\n (options: NavigateOptions) => {\n return router.navigate({\n ...options,\n from: options.from ?? _defaultOpts?.from,\n })\n },\n [_defaultOpts?.from, router],\n ) as UseNavigateResult<TDefaultFrom>\n}\n\n/**\n * Component that triggers a navigation when rendered. Navigation executes\n * in an effect after mount/update.\n *\n * Props are the same as `NavigateOptions` used by `navigate()`.\n *\n * @returns null\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/navigateComponent\n */\nexport function Navigate<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(props: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): null {\n const router = useRouter()\n const navigate = useNavigate()\n\n const previousPropsRef = React.useRef<NavigateOptions<\n TRouter,\n TFrom,\n TTo,\n TMaskFrom,\n TMaskTo\n > | null>(null)\n useLayoutEffect(() => {\n if (previousPropsRef.current !== props) {\n navigate(props)\n previousPropsRef.current = props\n }\n }, [router, props, navigate])\n return null\n}\n"],"
|
|
1
|
+
{"version":3,"file":"useNavigate.js","names":[],"sources":["../../src/useNavigate.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useLayoutEffect } from './utils'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n FromPathOption,\n NavigateOptions,\n RegisteredRouter,\n UseNavigateResult,\n} from '@tanstack/router-core'\n\n/**\n * Imperative navigation hook.\n *\n * Returns a stable `navigate(options)` function to change the current location\n * programmatically. Prefer the `Link` component for user-initiated navigation,\n * and use this hook from effects, callbacks, or handlers where imperative\n * navigation is required.\n *\n * Options:\n * - `from`: Optional route base used to resolve relative `to` paths.\n *\n * @returns A function that accepts `NavigateOptions`.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useNavigateHook\n */\nexport function useNavigate<\n TRouter extends AnyRouter = RegisteredRouter,\n TDefaultFrom extends string = string,\n>(_defaultOpts?: {\n from?: FromPathOption<TRouter, TDefaultFrom>\n}): UseNavigateResult<TDefaultFrom> {\n const router = useRouter()\n\n return React.useCallback(\n (options: NavigateOptions) => {\n return router.navigate({\n ...options,\n from: options.from ?? _defaultOpts?.from,\n })\n },\n [_defaultOpts?.from, router],\n ) as UseNavigateResult<TDefaultFrom>\n}\n\n/**\n * Component that triggers a navigation when rendered. Navigation executes\n * in an effect after mount/update.\n *\n * Props are the same as `NavigateOptions` used by `navigate()`.\n *\n * @returns null\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/navigateComponent\n */\nexport function Navigate<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(props: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): null {\n const router = useRouter()\n const navigate = useNavigate()\n\n const previousPropsRef = React.useRef<NavigateOptions<\n TRouter,\n TFrom,\n TTo,\n TMaskFrom,\n TMaskTo\n > | null>(null)\n useLayoutEffect(() => {\n if (previousPropsRef.current !== props) {\n navigate(props)\n previousPropsRef.current = props\n }\n }, [router, props, navigate])\n return null\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,SAAgB,YAGd,cAEkC;CAClC,MAAM,SAAS,WAAW;AAE1B,QAAO,QAAM,aACV,YAA6B;AAC5B,SAAO,OAAO,SAAS;GACrB,GAAG;GACH,MAAM,QAAQ,QAAQ,cAAc;GACrC,CAAC;IAEJ,CAAC,cAAc,MAAM,OAAO,CAC7B;;;;;;;;;;;AAYH,SAAgB,SAMd,OAAuE;CACvE,MAAM,SAAS,WAAW;CAC1B,MAAM,WAAW,aAAa;CAE9B,MAAM,mBAAmB,QAAM,OAMrB,KAAK;AACf,uBAAsB;AACpB,MAAI,iBAAiB,YAAY,OAAO;AACtC,YAAS,MAAM;AACf,oBAAiB,UAAU;;IAE5B;EAAC;EAAQ;EAAO;EAAS,CAAC;AAC7B,QAAO"}
|
package/dist/esm/useParams.js
CHANGED
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
import { useMatch } from "./useMatch.js";
|
|
2
|
+
//#region src/useParams.tsx
|
|
3
|
+
/**
|
|
4
|
+
* Access the current route's path parameters with type-safety.
|
|
5
|
+
*
|
|
6
|
+
* Options:
|
|
7
|
+
* - `from`/`strict`: Specify the matched route and whether to enforce strict typing
|
|
8
|
+
* - `select`: Project the params object to a derived value for memoized renders
|
|
9
|
+
* - `structuralSharing`: Enable structural sharing for stable references
|
|
10
|
+
* - `shouldThrow`: Throw if the route is not found in strict contexts
|
|
11
|
+
*
|
|
12
|
+
* @returns The params object (or selected value) for the matched route.
|
|
13
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useParamsHook
|
|
14
|
+
*/
|
|
2
15
|
function useParams(opts) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
return useMatch({
|
|
17
|
+
from: opts.from,
|
|
18
|
+
shouldThrow: opts.shouldThrow,
|
|
19
|
+
structuralSharing: opts.structuralSharing,
|
|
20
|
+
strict: opts.strict,
|
|
21
|
+
select: (match) => {
|
|
22
|
+
const params = opts.strict === false ? match.params : match._strictParams;
|
|
23
|
+
return opts.select ? opts.select(params) : params;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
13
26
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=useParams.js.map
|
|
27
|
+
//#endregion
|
|
28
|
+
export { useParams };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=useParams.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useParams.js","sources":["../../src/useParams.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type {\n StructuralSharingOption,\n ValidateSelected,\n} from './structuralSharing'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseParams,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n UseParamsResult,\n} from '@tanstack/router-core'\n\nexport interface UseParamsBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n TStructuralSharing,\n> {\n select?: (\n params: ResolveUseParams<TRouter, TFrom, TStrict>,\n ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n shouldThrow?: TThrow\n}\n\nexport type UseParamsOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n TStructuralSharing,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseParamsBaseOptions<\n TRouter,\n TFrom,\n TStrict,\n TThrow,\n TSelected,\n TStructuralSharing\n > &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseParamsRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts?: UseParamsBaseOptions<\n TRouter,\n TFrom,\n /* TStrict */ true,\n /* TThrow */ true,\n TSelected,\n TStructuralSharing\n > &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n) => UseParamsResult<TRouter, TFrom, true, TSelected>\n\n/**\n * Access the current route's path parameters with type-safety.\n *\n * Options:\n * - `from`/`strict`: Specify the matched route and whether to enforce strict typing\n * - `select`: Project the params object to a derived value for memoized renders\n * - `structuralSharing`: Enable structural sharing for stable references\n * - `shouldThrow`: Throw if the route is not found in strict contexts\n *\n * @returns The params object (or selected value) for the matched route.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useParamsHook\n */\nexport function useParams<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts: UseParamsOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected,\n TStructuralSharing\n >,\n): ThrowOrOptional<\n UseParamsResult<TRouter, TFrom, TStrict, TSelected>,\n TThrow\n> {\n return useMatch({\n from: opts.from!,\n shouldThrow: opts.shouldThrow,\n structuralSharing: opts.structuralSharing,\n strict: opts.strict,\n select: (match) => {\n const params = opts.strict === false ? match.params : match._strictParams\n\n return opts.select ? opts.select(params) : params\n },\n }) as any\n}\n"],"
|
|
1
|
+
{"version":3,"file":"useParams.js","names":[],"sources":["../../src/useParams.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type {\n StructuralSharingOption,\n ValidateSelected,\n} from './structuralSharing'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseParams,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n UseParamsResult,\n} from '@tanstack/router-core'\n\nexport interface UseParamsBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n TStructuralSharing,\n> {\n select?: (\n params: ResolveUseParams<TRouter, TFrom, TStrict>,\n ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n shouldThrow?: TThrow\n}\n\nexport type UseParamsOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n TStructuralSharing,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseParamsBaseOptions<\n TRouter,\n TFrom,\n TStrict,\n TThrow,\n TSelected,\n TStructuralSharing\n > &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseParamsRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts?: UseParamsBaseOptions<\n TRouter,\n TFrom,\n /* TStrict */ true,\n /* TThrow */ true,\n TSelected,\n TStructuralSharing\n > &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n) => UseParamsResult<TRouter, TFrom, true, TSelected>\n\n/**\n * Access the current route's path parameters with type-safety.\n *\n * Options:\n * - `from`/`strict`: Specify the matched route and whether to enforce strict typing\n * - `select`: Project the params object to a derived value for memoized renders\n * - `structuralSharing`: Enable structural sharing for stable references\n * - `shouldThrow`: Throw if the route is not found in strict contexts\n *\n * @returns The params object (or selected value) for the matched route.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useParamsHook\n */\nexport function useParams<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts: UseParamsOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected,\n TStructuralSharing\n >,\n): ThrowOrOptional<\n UseParamsResult<TRouter, TFrom, TStrict, TSelected>,\n TThrow\n> {\n return useMatch({\n from: opts.from!,\n shouldThrow: opts.shouldThrow,\n structuralSharing: opts.structuralSharing,\n strict: opts.strict,\n select: (match) => {\n const params = opts.strict === false ? match.params : match._strictParams\n\n return opts.select ? opts.select(params) : params\n },\n }) as any\n}\n"],"mappings":";;;;;;;;;;;;;;AA2EA,SAAgB,UAQd,MAWA;AACA,QAAO,SAAS;EACd,MAAM,KAAK;EACX,aAAa,KAAK;EAClB,mBAAmB,KAAK;EACxB,QAAQ,KAAK;EACb,SAAS,UAAU;GACjB,MAAM,SAAS,KAAK,WAAW,QAAQ,MAAM,SAAS,MAAM;AAE5D,UAAO,KAAK,SAAS,KAAK,OAAO,OAAO,GAAG;;EAE9C,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useMatch } from "./useMatch.js";
|
|
2
|
+
//#region src/useRouteContext.ts
|
|
2
3
|
function useRouteContext(opts) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
return useMatch({
|
|
5
|
+
...opts,
|
|
6
|
+
select: (match) => opts.select ? opts.select(match.context) : match.context
|
|
7
|
+
});
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=useRouteContext.js.map
|
|
9
|
+
//#endregion
|
|
10
|
+
export { useRouteContext };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=useRouteContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouteContext.js","sources":["../../src/useRouteContext.ts"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type {\n AnyRouter,\n RegisteredRouter,\n UseRouteContextBaseOptions,\n UseRouteContextOptions,\n UseRouteContextResult,\n} from '@tanstack/router-core'\n\nexport type UseRouteContextRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseRouteContextBaseOptions<TRouter, TFrom, true, TSelected>,\n) => UseRouteContextResult<TRouter, TFrom, true, TSelected>\n\nexport function useRouteContext<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseRouteContextOptions<TRouter, TFrom, TStrict, TSelected>,\n): UseRouteContextResult<TRouter, TFrom, TStrict, TSelected> {\n return useMatch({\n ...(opts as any),\n select: (match) =>\n opts.select ? opts.select(match.context) : match.context,\n }) as UseRouteContextResult<TRouter, TFrom, TStrict, TSelected>\n}\n"],"
|
|
1
|
+
{"version":3,"file":"useRouteContext.js","names":[],"sources":["../../src/useRouteContext.ts"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type {\n AnyRouter,\n RegisteredRouter,\n UseRouteContextBaseOptions,\n UseRouteContextOptions,\n UseRouteContextResult,\n} from '@tanstack/router-core'\n\nexport type UseRouteContextRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseRouteContextBaseOptions<TRouter, TFrom, true, TSelected>,\n) => UseRouteContextResult<TRouter, TFrom, true, TSelected>\n\nexport function useRouteContext<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseRouteContextOptions<TRouter, TFrom, TStrict, TSelected>,\n): UseRouteContextResult<TRouter, TFrom, TStrict, TSelected> {\n return useMatch({\n ...(opts as any),\n select: (match) =>\n opts.select ? opts.select(match.context) : match.context,\n }) as UseRouteContextResult<TRouter, TFrom, TStrict, TSelected>\n}\n"],"mappings":";;AAgBA,SAAgB,gBAMd,MAC2D;AAC3D,QAAO,SAAS;EACd,GAAI;EACJ,SAAS,UACP,KAAK,SAAS,KAAK,OAAO,MAAM,QAAQ,GAAG,MAAM;EACpD,CAAC"}
|
package/dist/esm/useRouter.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import warning from "tiny-warning";
|
|
3
1
|
import { routerContext } from "./routerContext.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import warning from "tiny-warning";
|
|
4
|
+
//#region src/useRouter.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Access the current TanStack Router instance from React context.
|
|
7
|
+
* Must be used within a `RouterProvider`.
|
|
8
|
+
*
|
|
9
|
+
* Options:
|
|
10
|
+
* - `warn`: Log a warning if no router context is found (default: true).
|
|
11
|
+
*
|
|
12
|
+
* @returns The registered router instance.
|
|
13
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterHook
|
|
14
|
+
*/
|
|
4
15
|
function useRouter(opts) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"useRouter must be used inside a <RouterProvider> component!"
|
|
9
|
-
);
|
|
10
|
-
return value;
|
|
16
|
+
const value = React$1.useContext(routerContext);
|
|
17
|
+
warning(!((opts?.warn ?? true) && !value), "useRouter must be used inside a <RouterProvider> component!");
|
|
18
|
+
return value;
|
|
11
19
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=useRouter.js.map
|
|
20
|
+
//#endregion
|
|
21
|
+
export { useRouter };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=useRouter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouter.js","sources":["../../src/useRouter.tsx"],"sourcesContent":["import * as React from 'react'\nimport warning from 'tiny-warning'\nimport { routerContext } from './routerContext'\nimport type { AnyRouter, RegisteredRouter } from '@tanstack/router-core'\n\n/**\n * Access the current TanStack Router instance from React context.\n * Must be used within a `RouterProvider`.\n *\n * Options:\n * - `warn`: Log a warning if no router context is found (default: true).\n *\n * @returns The registered router instance.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterHook\n */\nexport function useRouter<TRouter extends AnyRouter = RegisteredRouter>(opts?: {\n warn?: boolean\n}): TRouter {\n const value = React.useContext(routerContext)\n warning(\n !((opts?.warn ?? true) && !value),\n 'useRouter must be used inside a <RouterProvider> component!',\n )\n return value as any\n}\n"],"
|
|
1
|
+
{"version":3,"file":"useRouter.js","names":[],"sources":["../../src/useRouter.tsx"],"sourcesContent":["import * as React from 'react'\nimport warning from 'tiny-warning'\nimport { routerContext } from './routerContext'\nimport type { AnyRouter, RegisteredRouter } from '@tanstack/router-core'\n\n/**\n * Access the current TanStack Router instance from React context.\n * Must be used within a `RouterProvider`.\n *\n * Options:\n * - `warn`: Log a warning if no router context is found (default: true).\n *\n * @returns The registered router instance.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterHook\n */\nexport function useRouter<TRouter extends AnyRouter = RegisteredRouter>(opts?: {\n warn?: boolean\n}): TRouter {\n const value = React.useContext(routerContext)\n warning(\n !((opts?.warn ?? true) && !value),\n 'useRouter must be used inside a <RouterProvider> component!',\n )\n return value as any\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,SAAgB,UAAwD,MAE5D;CACV,MAAM,QAAQ,QAAM,WAAW,cAAc;AAC7C,SACE,GAAG,MAAM,QAAQ,SAAS,CAAC,QAC3B,8DACD;AACD,QAAO"}
|
|
@@ -1,38 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRef } from "react";
|
|
1
|
+
import { useRouter } from "./useRouter.js";
|
|
3
2
|
import { replaceEqualDeep } from "@tanstack/router-core";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { useStore } from "@tanstack/react-store";
|
|
4
5
|
import { isServer } from "@tanstack/router-core/isServer";
|
|
5
|
-
|
|
6
|
+
//#region src/useRouterState.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Subscribe to the router's state store with optional selection and
|
|
9
|
+
* structural sharing for render optimization.
|
|
10
|
+
*
|
|
11
|
+
* Options:
|
|
12
|
+
* - `select`: Project the full router state to a derived slice
|
|
13
|
+
* - `structuralSharing`: Replace-equal semantics for stable references
|
|
14
|
+
* - `router`: Read state from a specific router instance instead of context
|
|
15
|
+
*
|
|
16
|
+
* @returns The selected router state (or the full state by default).
|
|
17
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterStateHook
|
|
18
|
+
*/
|
|
6
19
|
function useRouterState(opts) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
opts.select(state)
|
|
26
|
-
);
|
|
27
|
-
previousResult.current = newSlice;
|
|
28
|
-
return newSlice;
|
|
29
|
-
}
|
|
30
|
-
return opts.select(state);
|
|
31
|
-
}
|
|
32
|
-
return state;
|
|
33
|
-
});
|
|
20
|
+
const contextRouter = useRouter({ warn: opts?.router === void 0 });
|
|
21
|
+
const router = opts?.router || contextRouter;
|
|
22
|
+
if (isServer ?? router.isServer) {
|
|
23
|
+
const state = router.state;
|
|
24
|
+
return opts?.select ? opts.select(state) : state;
|
|
25
|
+
}
|
|
26
|
+
const previousResult = useRef(void 0);
|
|
27
|
+
return useStore(router.__store, (state) => {
|
|
28
|
+
if (opts?.select) {
|
|
29
|
+
if (opts.structuralSharing ?? router.options.defaultStructuralSharing) {
|
|
30
|
+
const newSlice = replaceEqualDeep(previousResult.current, opts.select(state));
|
|
31
|
+
previousResult.current = newSlice;
|
|
32
|
+
return newSlice;
|
|
33
|
+
}
|
|
34
|
+
return opts.select(state);
|
|
35
|
+
}
|
|
36
|
+
return state;
|
|
37
|
+
});
|
|
34
38
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
//# sourceMappingURL=useRouterState.js.map
|
|
39
|
+
//#endregion
|
|
40
|
+
export { useRouterState };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=useRouterState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouterState.js","sources":["../../src/useRouterState.tsx"],"sourcesContent":["import { useStore } from '@tanstack/react-store'\nimport { useRef } from 'react'\nimport { replaceEqualDeep } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterState,\n} from '@tanstack/router-core'\nimport type {\n StructuralSharingOption,\n ValidateSelected,\n} from './structuralSharing'\n\nexport type UseRouterStateOptions<\n TRouter extends AnyRouter,\n TSelected,\n TStructuralSharing,\n> = {\n router?: TRouter\n select?: (\n state: RouterState<TRouter['routeTree']>,\n ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n} & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseRouterStateResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? RouterState<TRouter['routeTree']> : TSelected\n\n/**\n * Subscribe to the router's state store with optional selection and\n * structural sharing for render optimization.\n *\n * Options:\n * - `select`: Project the full router state to a derived slice\n * - `structuralSharing`: Replace-equal semantics for stable references\n * - `router`: Read state from a specific router instance instead of context\n *\n * @returns The selected router state (or the full state by default).\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterStateHook\n */\nexport function useRouterState<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts?: UseRouterStateOptions<TRouter, TSelected, TStructuralSharing>,\n): UseRouterStateResult<TRouter, TSelected> {\n const contextRouter = useRouter<TRouter>({\n warn: opts?.router === undefined,\n })\n const router = opts?.router || contextRouter\n\n // During SSR we render exactly once and do not need reactivity.\n // Avoid subscribing to the store (and any structural sharing work) on the server.\n const _isServer = isServer ?? router.isServer\n if (_isServer) {\n const state = router.state as RouterState<TRouter['routeTree']>\n return (opts?.select ? opts.select(state) : state) as UseRouterStateResult<\n TRouter,\n TSelected\n >\n }\n\n const previousResult =\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useRef<ValidateSelected<TRouter, TSelected, TStructuralSharing>>(undefined)\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStore(router.__store, (state) => {\n if (opts?.select) {\n if (opts.structuralSharing ?? router.options.defaultStructuralSharing) {\n const newSlice = replaceEqualDeep(\n previousResult.current,\n opts.select(state),\n )\n previousResult.current = newSlice\n return newSlice\n }\n return opts.select(state)\n }\n return state\n }) as UseRouterStateResult<TRouter, TSelected>\n}\n"],"
|
|
1
|
+
{"version":3,"file":"useRouterState.js","names":[],"sources":["../../src/useRouterState.tsx"],"sourcesContent":["import { useStore } from '@tanstack/react-store'\nimport { useRef } from 'react'\nimport { replaceEqualDeep } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterState,\n} from '@tanstack/router-core'\nimport type {\n StructuralSharingOption,\n ValidateSelected,\n} from './structuralSharing'\n\nexport type UseRouterStateOptions<\n TRouter extends AnyRouter,\n TSelected,\n TStructuralSharing,\n> = {\n router?: TRouter\n select?: (\n state: RouterState<TRouter['routeTree']>,\n ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n} & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseRouterStateResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? RouterState<TRouter['routeTree']> : TSelected\n\n/**\n * Subscribe to the router's state store with optional selection and\n * structural sharing for render optimization.\n *\n * Options:\n * - `select`: Project the full router state to a derived slice\n * - `structuralSharing`: Replace-equal semantics for stable references\n * - `router`: Read state from a specific router instance instead of context\n *\n * @returns The selected router state (or the full state by default).\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterStateHook\n */\nexport function useRouterState<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts?: UseRouterStateOptions<TRouter, TSelected, TStructuralSharing>,\n): UseRouterStateResult<TRouter, TSelected> {\n const contextRouter = useRouter<TRouter>({\n warn: opts?.router === undefined,\n })\n const router = opts?.router || contextRouter\n\n // During SSR we render exactly once and do not need reactivity.\n // Avoid subscribing to the store (and any structural sharing work) on the server.\n const _isServer = isServer ?? router.isServer\n if (_isServer) {\n const state = router.state as RouterState<TRouter['routeTree']>\n return (opts?.select ? opts.select(state) : state) as UseRouterStateResult<\n TRouter,\n TSelected\n >\n }\n\n const previousResult =\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useRef<ValidateSelected<TRouter, TSelected, TStructuralSharing>>(undefined)\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStore(router.__store, (state) => {\n if (opts?.select) {\n if (opts.structuralSharing ?? router.options.defaultStructuralSharing) {\n const newSlice = replaceEqualDeep(\n previousResult.current,\n opts.select(state),\n )\n previousResult.current = newSlice\n return newSlice\n }\n return opts.select(state)\n }\n return state\n }) as UseRouterStateResult<TRouter, TSelected>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA2CA,SAAgB,eAKd,MAC0C;CAC1C,MAAM,gBAAgB,UAAmB,EACvC,MAAM,MAAM,WAAW,KAAA,GACxB,CAAC;CACF,MAAM,SAAS,MAAM,UAAU;AAK/B,KADkB,YAAY,OAAO,UACtB;EACb,MAAM,QAAQ,OAAO;AACrB,SAAQ,MAAM,SAAS,KAAK,OAAO,MAAM,GAAG;;CAM9C,MAAM,iBAEJ,OAAiE,KAAA,EAAU;AAG7E,QAAO,SAAS,OAAO,UAAU,UAAU;AACzC,MAAI,MAAM,QAAQ;AAChB,OAAI,KAAK,qBAAqB,OAAO,QAAQ,0BAA0B;IACrE,MAAM,WAAW,iBACf,eAAe,SACf,KAAK,OAAO,MAAM,CACnB;AACD,mBAAe,UAAU;AACzB,WAAO;;AAET,UAAO,KAAK,OAAO,MAAM;;AAE3B,SAAO;GACP"}
|
package/dist/esm/useSearch.js
CHANGED
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
import { useMatch } from "./useMatch.js";
|
|
2
|
+
//#region src/useSearch.tsx
|
|
3
|
+
/**
|
|
4
|
+
* Read and select the current route's search parameters with type-safety.
|
|
5
|
+
*
|
|
6
|
+
* Options:
|
|
7
|
+
* - `from`/`strict`: Control which route's search is read and how strictly it's typed
|
|
8
|
+
* - `select`: Map the search object to a derived value for render optimization
|
|
9
|
+
* - `structuralSharing`: Enable structural sharing for stable references
|
|
10
|
+
* - `shouldThrow`: Throw when the route is not found (strict contexts)
|
|
11
|
+
*
|
|
12
|
+
* @returns The search object (or selected value) for the matched route.
|
|
13
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useSearchHook
|
|
14
|
+
*/
|
|
2
15
|
function useSearch(opts) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
16
|
+
return useMatch({
|
|
17
|
+
from: opts.from,
|
|
18
|
+
strict: opts.strict,
|
|
19
|
+
shouldThrow: opts.shouldThrow,
|
|
20
|
+
structuralSharing: opts.structuralSharing,
|
|
21
|
+
select: (match) => {
|
|
22
|
+
return opts.select ? opts.select(match.search) : match.search;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
12
25
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=useSearch.js.map
|
|
26
|
+
//#endregion
|
|
27
|
+
export { useSearch };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=useSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearch.js","sources":["../../src/useSearch.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type {\n StructuralSharingOption,\n ValidateSelected,\n} from './structuralSharing'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseSearch,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n UseSearchResult,\n} from '@tanstack/router-core'\n\nexport interface UseSearchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n TStructuralSharing,\n> {\n select?: (\n state: ResolveUseSearch<TRouter, TFrom, TStrict>,\n ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n shouldThrow?: TThrow\n}\n\nexport type UseSearchOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n TStructuralSharing,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseSearchBaseOptions<\n TRouter,\n TFrom,\n TStrict,\n TThrow,\n TSelected,\n TStructuralSharing\n > &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseSearchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts?: UseSearchBaseOptions<\n TRouter,\n TFrom,\n /* TStrict */ true,\n /* TThrow */ true,\n TSelected,\n TStructuralSharing\n > &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n) => UseSearchResult<TRouter, TFrom, true, TSelected>\n\n/**\n * Read and select the current route's search parameters with type-safety.\n *\n * Options:\n * - `from`/`strict`: Control which route's search is read and how strictly it's typed\n * - `select`: Map the search object to a derived value for render optimization\n * - `structuralSharing`: Enable structural sharing for stable references\n * - `shouldThrow`: Throw when the route is not found (strict contexts)\n *\n * @returns The search object (or selected value) for the matched route.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useSearchHook\n */\nexport function useSearch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts: UseSearchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected,\n TStructuralSharing\n >,\n): ThrowOrOptional<\n UseSearchResult<TRouter, TFrom, TStrict, TSelected>,\n TThrow\n> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n shouldThrow: opts.shouldThrow,\n structuralSharing: opts.structuralSharing,\n select: (match: any) => {\n return opts.select ? opts.select(match.search) : match.search\n },\n }) as any\n}\n"],"
|
|
1
|
+
{"version":3,"file":"useSearch.js","names":[],"sources":["../../src/useSearch.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type {\n StructuralSharingOption,\n ValidateSelected,\n} from './structuralSharing'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseSearch,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n UseSearchResult,\n} from '@tanstack/router-core'\n\nexport interface UseSearchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n TStructuralSharing,\n> {\n select?: (\n state: ResolveUseSearch<TRouter, TFrom, TStrict>,\n ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n shouldThrow?: TThrow\n}\n\nexport type UseSearchOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n TStructuralSharing,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseSearchBaseOptions<\n TRouter,\n TFrom,\n TStrict,\n TThrow,\n TSelected,\n TStructuralSharing\n > &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseSearchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts?: UseSearchBaseOptions<\n TRouter,\n TFrom,\n /* TStrict */ true,\n /* TThrow */ true,\n TSelected,\n TStructuralSharing\n > &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n) => UseSearchResult<TRouter, TFrom, true, TSelected>\n\n/**\n * Read and select the current route's search parameters with type-safety.\n *\n * Options:\n * - `from`/`strict`: Control which route's search is read and how strictly it's typed\n * - `select`: Map the search object to a derived value for render optimization\n * - `structuralSharing`: Enable structural sharing for stable references\n * - `shouldThrow`: Throw when the route is not found (strict contexts)\n *\n * @returns The search object (or selected value) for the matched route.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useSearchHook\n */\nexport function useSearch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts: UseSearchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected,\n TStructuralSharing\n >,\n): ThrowOrOptional<\n UseSearchResult<TRouter, TFrom, TStrict, TSelected>,\n TThrow\n> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n shouldThrow: opts.shouldThrow,\n structuralSharing: opts.structuralSharing,\n select: (match: any) => {\n return opts.select ? opts.select(match.search) : match.search\n },\n }) as any\n}\n"],"mappings":";;;;;;;;;;;;;;AA2EA,SAAgB,UAQd,MAWA;AACA,QAAO,SAAS;EACd,MAAM,KAAK;EACX,QAAQ,KAAK;EACb,aAAa,KAAK;EAClB,mBAAmB,KAAK;EACxB,SAAS,UAAe;AACtB,UAAO,KAAK,SAAS,KAAK,OAAO,MAAM,OAAO,GAAG,MAAM;;EAE1D,CAAC"}
|
package/dist/esm/utils.js
CHANGED
|
@@ -1,45 +1,86 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
/**
|
|
3
|
+
* React.use if available (React 19+), undefined otherwise.
|
|
4
|
+
* Use dynamic lookup to avoid Webpack compilation errors with React 18.
|
|
5
|
+
*/
|
|
6
|
+
var reactUse = React$1["use"];
|
|
7
|
+
var useLayoutEffect = typeof window !== "undefined" ? React$1.useLayoutEffect : React$1.useEffect;
|
|
8
|
+
/**
|
|
9
|
+
* Taken from https://www.developerway.com/posts/implementing-advanced-use-previous-hook#part3
|
|
10
|
+
*/
|
|
5
11
|
function usePrevious(value) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
return ref.current.prev;
|
|
12
|
+
const ref = React$1.useRef({
|
|
13
|
+
value,
|
|
14
|
+
prev: null
|
|
15
|
+
});
|
|
16
|
+
const current = ref.current.value;
|
|
17
|
+
if (value !== current) ref.current = {
|
|
18
|
+
value,
|
|
19
|
+
prev: current
|
|
20
|
+
};
|
|
21
|
+
return ref.current.prev;
|
|
18
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* React hook to wrap `IntersectionObserver`.
|
|
25
|
+
*
|
|
26
|
+
* This hook will create an `IntersectionObserver` and observe the ref passed to it.
|
|
27
|
+
*
|
|
28
|
+
* When the intersection changes, the callback will be called with the `IntersectionObserverEntry`.
|
|
29
|
+
*
|
|
30
|
+
* @param ref - The ref to observe
|
|
31
|
+
* @param intersectionObserverOptions - The options to pass to the IntersectionObserver
|
|
32
|
+
* @param options - The options to pass to the hook
|
|
33
|
+
* @param callback - The callback to call when the intersection changes
|
|
34
|
+
* @returns The IntersectionObserver instance
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* const MyComponent = () => {
|
|
38
|
+
* const ref = React.useRef<HTMLDivElement>(null)
|
|
39
|
+
* useIntersectionObserver(
|
|
40
|
+
* ref,
|
|
41
|
+
* (entry) => { doSomething(entry) },
|
|
42
|
+
* { rootMargin: '10px' },
|
|
43
|
+
* { disabled: false }
|
|
44
|
+
* )
|
|
45
|
+
* return <div ref={ref} />
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
19
48
|
function useIntersectionObserver(ref, callback, intersectionObserverOptions = {}, options = {}) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
49
|
+
React$1.useEffect(() => {
|
|
50
|
+
if (!ref.current || options.disabled || typeof IntersectionObserver !== "function") return;
|
|
51
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
52
|
+
callback(entry);
|
|
53
|
+
}, intersectionObserverOptions);
|
|
54
|
+
observer.observe(ref.current);
|
|
55
|
+
return () => {
|
|
56
|
+
observer.disconnect();
|
|
57
|
+
};
|
|
58
|
+
}, [
|
|
59
|
+
callback,
|
|
60
|
+
intersectionObserverOptions,
|
|
61
|
+
options.disabled,
|
|
62
|
+
ref
|
|
63
|
+
]);
|
|
32
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* React hook to take a `React.ForwardedRef` and returns a `ref` that can be used on a DOM element.
|
|
67
|
+
*
|
|
68
|
+
* @param ref - The forwarded ref
|
|
69
|
+
* @returns The inner ref returned by `useRef`
|
|
70
|
+
* @example
|
|
71
|
+
* ```tsx
|
|
72
|
+
* const MyComponent = React.forwardRef((props, ref) => {
|
|
73
|
+
* const innerRef = useForwardedRef(ref)
|
|
74
|
+
* return <div ref={innerRef} />
|
|
75
|
+
* })
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
33
78
|
function useForwardedRef(ref) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
79
|
+
const innerRef = React$1.useRef(null);
|
|
80
|
+
React$1.useImperativeHandle(ref, () => innerRef.current, []);
|
|
81
|
+
return innerRef;
|
|
37
82
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
useLayoutEffect,
|
|
43
|
-
usePrevious
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=utils.js.map
|
|
83
|
+
//#endregion
|
|
84
|
+
export { reactUse, useForwardedRef, useIntersectionObserver, useLayoutEffect, usePrevious };
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=utils.js.map
|
package/dist/esm/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/utils.ts"],"sourcesContent":["import * as React from 'react'\n\n// Safe version of React.use() that will not cause compilation errors against\n// React 18 with Webpack, which statically analyzes imports and fails when it\n// sees React.use referenced (since 'use' is not exported from React 18).\n// This uses a dynamic string lookup to avoid the static analysis.\nconst REACT_USE = 'use'\n\n/**\n * React.use if available (React 19+), undefined otherwise.\n * Use dynamic lookup to avoid Webpack compilation errors with React 18.\n */\nexport const reactUse:\n | (<T>(usable: Promise<T> | React.Context<T>) => T)\n | undefined = (React as any)[REACT_USE]\n\nexport function useStableCallback<T extends (...args: Array<any>) => any>(\n fn: T,\n): T {\n const fnRef = React.useRef(fn)\n fnRef.current = fn\n\n const ref = React.useRef((...args: Array<any>) => fnRef.current(...args))\n return ref.current as T\n}\n\nexport const useLayoutEffect =\n typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect\n\n/**\n * Taken from https://www.developerway.com/posts/implementing-advanced-use-previous-hook#part3\n */\nexport function usePrevious<T>(value: T): T | null {\n // initialise the ref with previous and current values\n const ref = React.useRef<{ value: T; prev: T | null }>({\n value: value,\n prev: null,\n })\n\n const current = ref.current.value\n\n // if the value passed into hook doesn't match what we store as \"current\"\n // move the \"current\" to the \"previous\"\n // and store the passed value as \"current\"\n if (value !== current) {\n ref.current = {\n value: value,\n prev: current,\n }\n }\n\n // return the previous value only\n return ref.current.prev\n}\n\n/**\n * React hook to wrap `IntersectionObserver`.\n *\n * This hook will create an `IntersectionObserver` and observe the ref passed to it.\n *\n * When the intersection changes, the callback will be called with the `IntersectionObserverEntry`.\n *\n * @param ref - The ref to observe\n * @param intersectionObserverOptions - The options to pass to the IntersectionObserver\n * @param options - The options to pass to the hook\n * @param callback - The callback to call when the intersection changes\n * @returns The IntersectionObserver instance\n * @example\n * ```tsx\n * const MyComponent = () => {\n * const ref = React.useRef<HTMLDivElement>(null)\n * useIntersectionObserver(\n * ref,\n * (entry) => { doSomething(entry) },\n * { rootMargin: '10px' },\n * { disabled: false }\n * )\n * return <div ref={ref} />\n * ```\n */\nexport function useIntersectionObserver<T extends Element>(\n ref: React.RefObject<T | null>,\n callback: (entry: IntersectionObserverEntry | undefined) => void,\n intersectionObserverOptions: IntersectionObserverInit = {},\n options: { disabled?: boolean } = {},\n) {\n React.useEffect(() => {\n if (\n !ref.current ||\n options.disabled ||\n typeof IntersectionObserver !== 'function'\n ) {\n return\n }\n\n const observer = new IntersectionObserver(([entry]) => {\n callback(entry)\n }, intersectionObserverOptions)\n\n observer.observe(ref.current)\n\n return () => {\n observer.disconnect()\n }\n }, [callback, intersectionObserverOptions, options.disabled, ref])\n}\n\n/**\n * React hook to take a `React.ForwardedRef` and returns a `ref` that can be used on a DOM element.\n *\n * @param ref - The forwarded ref\n * @returns The inner ref returned by `useRef`\n * @example\n * ```tsx\n * const MyComponent = React.forwardRef((props, ref) => {\n * const innerRef = useForwardedRef(ref)\n * return <div ref={innerRef} />\n * })\n * ```\n */\nexport function useForwardedRef<T>(ref?: React.ForwardedRef<T>) {\n const innerRef = React.useRef<T>(null)\n React.useImperativeHandle(ref, () => innerRef.current!, [])\n return innerRef\n}\n"],"
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../src/utils.ts"],"sourcesContent":["import * as React from 'react'\n\n// Safe version of React.use() that will not cause compilation errors against\n// React 18 with Webpack, which statically analyzes imports and fails when it\n// sees React.use referenced (since 'use' is not exported from React 18).\n// This uses a dynamic string lookup to avoid the static analysis.\nconst REACT_USE = 'use'\n\n/**\n * React.use if available (React 19+), undefined otherwise.\n * Use dynamic lookup to avoid Webpack compilation errors with React 18.\n */\nexport const reactUse:\n | (<T>(usable: Promise<T> | React.Context<T>) => T)\n | undefined = (React as any)[REACT_USE]\n\nexport function useStableCallback<T extends (...args: Array<any>) => any>(\n fn: T,\n): T {\n const fnRef = React.useRef(fn)\n fnRef.current = fn\n\n const ref = React.useRef((...args: Array<any>) => fnRef.current(...args))\n return ref.current as T\n}\n\nexport const useLayoutEffect =\n typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect\n\n/**\n * Taken from https://www.developerway.com/posts/implementing-advanced-use-previous-hook#part3\n */\nexport function usePrevious<T>(value: T): T | null {\n // initialise the ref with previous and current values\n const ref = React.useRef<{ value: T; prev: T | null }>({\n value: value,\n prev: null,\n })\n\n const current = ref.current.value\n\n // if the value passed into hook doesn't match what we store as \"current\"\n // move the \"current\" to the \"previous\"\n // and store the passed value as \"current\"\n if (value !== current) {\n ref.current = {\n value: value,\n prev: current,\n }\n }\n\n // return the previous value only\n return ref.current.prev\n}\n\n/**\n * React hook to wrap `IntersectionObserver`.\n *\n * This hook will create an `IntersectionObserver` and observe the ref passed to it.\n *\n * When the intersection changes, the callback will be called with the `IntersectionObserverEntry`.\n *\n * @param ref - The ref to observe\n * @param intersectionObserverOptions - The options to pass to the IntersectionObserver\n * @param options - The options to pass to the hook\n * @param callback - The callback to call when the intersection changes\n * @returns The IntersectionObserver instance\n * @example\n * ```tsx\n * const MyComponent = () => {\n * const ref = React.useRef<HTMLDivElement>(null)\n * useIntersectionObserver(\n * ref,\n * (entry) => { doSomething(entry) },\n * { rootMargin: '10px' },\n * { disabled: false }\n * )\n * return <div ref={ref} />\n * ```\n */\nexport function useIntersectionObserver<T extends Element>(\n ref: React.RefObject<T | null>,\n callback: (entry: IntersectionObserverEntry | undefined) => void,\n intersectionObserverOptions: IntersectionObserverInit = {},\n options: { disabled?: boolean } = {},\n) {\n React.useEffect(() => {\n if (\n !ref.current ||\n options.disabled ||\n typeof IntersectionObserver !== 'function'\n ) {\n return\n }\n\n const observer = new IntersectionObserver(([entry]) => {\n callback(entry)\n }, intersectionObserverOptions)\n\n observer.observe(ref.current)\n\n return () => {\n observer.disconnect()\n }\n }, [callback, intersectionObserverOptions, options.disabled, ref])\n}\n\n/**\n * React hook to take a `React.ForwardedRef` and returns a `ref` that can be used on a DOM element.\n *\n * @param ref - The forwarded ref\n * @returns The inner ref returned by `useRef`\n * @example\n * ```tsx\n * const MyComponent = React.forwardRef((props, ref) => {\n * const innerRef = useForwardedRef(ref)\n * return <div ref={innerRef} />\n * })\n * ```\n */\nexport function useForwardedRef<T>(ref?: React.ForwardedRef<T>) {\n const innerRef = React.useRef<T>(null)\n React.useImperativeHandle(ref, () => innerRef.current!, [])\n return innerRef\n}\n"],"mappings":";;;;;AAYA,IAAa,WAEI,QARC;AAoBlB,IAAa,kBACX,OAAO,WAAW,cAAc,QAAM,kBAAkB,QAAM;;;;AAKhE,SAAgB,YAAe,OAAoB;CAEjD,MAAM,MAAM,QAAM,OAAqC;EAC9C;EACP,MAAM;EACP,CAAC;CAEF,MAAM,UAAU,IAAI,QAAQ;AAK5B,KAAI,UAAU,QACZ,KAAI,UAAU;EACL;EACP,MAAM;EACP;AAIH,QAAO,IAAI,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BrB,SAAgB,wBACd,KACA,UACA,8BAAwD,EAAE,EAC1D,UAAkC,EAAE,EACpC;AACA,SAAM,gBAAgB;AACpB,MACE,CAAC,IAAI,WACL,QAAQ,YACR,OAAO,yBAAyB,WAEhC;EAGF,MAAM,WAAW,IAAI,sBAAsB,CAAC,WAAW;AACrD,YAAS,MAAM;KACd,4BAA4B;AAE/B,WAAS,QAAQ,IAAI,QAAQ;AAE7B,eAAa;AACX,YAAS,YAAY;;IAEtB;EAAC;EAAU;EAA6B,QAAQ;EAAU;EAAI,CAAC;;;;;;;;;;;;;;;AAgBpE,SAAgB,gBAAmB,KAA6B;CAC9D,MAAM,WAAW,QAAM,OAAU,KAAK;AACtC,SAAM,oBAAoB,WAAW,SAAS,SAAU,EAAE,CAAC;AAC3D,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/tanstack__react-router",
|
|
3
|
-
"version": "1.167.
|
|
3
|
+
"version": "1.167.3-depup.0",
|
|
4
4
|
"description": "[DepUp] Modern and scalable routing for React applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"isbot": "^5.1.36",
|
|
86
86
|
"tiny-invariant": "^1.3.3",
|
|
87
87
|
"tiny-warning": "^1.0.3",
|
|
88
|
-
"@tanstack/history": "1.161.
|
|
89
|
-
"@tanstack/router-core": "1.167.
|
|
88
|
+
"@tanstack/history": "1.161.6",
|
|
89
|
+
"@tanstack/router-core": "1.167.3"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@testing-library/jest-dom": "^6.6.3",
|
|
@@ -135,8 +135,8 @@
|
|
|
135
135
|
},
|
|
136
136
|
"depsUpdated": 2,
|
|
137
137
|
"originalPackage": "@tanstack/react-router",
|
|
138
|
-
"originalVersion": "1.167.
|
|
139
|
-
"processedAt": "2026-03-
|
|
138
|
+
"originalVersion": "1.167.3",
|
|
139
|
+
"processedAt": "2026-03-16T00:39:27.694Z",
|
|
140
140
|
"smokeTest": "passed"
|
|
141
141
|
}
|
|
142
142
|
}
|
package/dist/cjs/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.dev.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.dev.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|