@tanstack/react-router 0.0.1-beta.223 → 0.0.1-beta.225
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/build/cjs/CatchBoundary.js +3 -6
- package/build/cjs/CatchBoundary.js.map +1 -1
- package/build/cjs/Matches.js +8 -15
- package/build/cjs/Matches.js.map +1 -1
- package/build/cjs/RouterProvider.js +61 -968
- package/build/cjs/RouterProvider.js.map +1 -1
- package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +1 -3
- package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/build/cjs/awaited.js +0 -2
- package/build/cjs/awaited.js.map +1 -1
- package/build/cjs/defer.js +0 -2
- package/build/cjs/defer.js.map +1 -1
- package/build/cjs/fileRoute.js +0 -2
- package/build/cjs/fileRoute.js.map +1 -1
- package/build/cjs/index.js +3 -16
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/lazyRouteComponent.js +3 -6
- package/build/cjs/lazyRouteComponent.js.map +1 -1
- package/build/cjs/link.js +4 -7
- package/build/cjs/link.js.map +1 -1
- package/build/cjs/path.js +0 -2
- package/build/cjs/path.js.map +1 -1
- package/build/cjs/qss.js +0 -2
- package/build/cjs/qss.js.map +1 -1
- package/build/cjs/redirects.js +0 -2
- package/build/cjs/redirects.js.map +1 -1
- package/build/cjs/route.js +2 -7
- package/build/cjs/route.js.map +1 -1
- package/build/cjs/router.js +949 -42
- package/build/cjs/router.js.map +1 -1
- package/build/cjs/scroll-restoration.js +8 -15
- package/build/cjs/scroll-restoration.js.map +1 -1
- package/build/cjs/searchParams.js +0 -2
- package/build/cjs/searchParams.js.map +1 -1
- package/build/cjs/useBlocker.js +3 -6
- package/build/cjs/useBlocker.js.map +1 -1
- package/build/cjs/useNavigate.js +3 -6
- package/build/cjs/useNavigate.js.map +1 -1
- package/build/cjs/useParams.js +0 -2
- package/build/cjs/useParams.js.map +1 -1
- package/build/cjs/useSearch.js +0 -2
- package/build/cjs/useSearch.js.map +1 -1
- package/build/cjs/utils.js +9 -6
- package/build/cjs/utils.js.map +1 -1
- package/build/esm/index.js +889 -878
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +3494 -2700
- package/build/stats-react.json +374 -368
- package/build/types/CatchBoundary.d.ts +2 -2
- package/build/types/Matches.d.ts +3 -3
- package/build/types/RouterProvider.d.ts +4 -23
- package/build/types/awaited.d.ts +1 -0
- package/build/types/fileRoute.d.ts +4 -3
- package/build/types/route.d.ts +1 -0
- package/build/types/router.d.ts +50 -5
- package/build/umd/index.development.js +865 -857
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +2 -2
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/RouterProvider.tsx +57 -1314
- package/src/fileRoute.ts +1 -1
- package/src/route.ts +23 -0
- package/src/router.ts +1320 -45
- package/src/scroll-restoration.tsx +5 -5
|
@@ -10,12 +10,9 @@
|
|
|
10
10
|
*/
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
14
|
-
|
|
15
13
|
var React = require('react');
|
|
16
14
|
|
|
17
|
-
function
|
|
18
|
-
if (e && e.__esModule) return e;
|
|
15
|
+
function _interopNamespaceDefault(e) {
|
|
19
16
|
var n = Object.create(null);
|
|
20
17
|
if (e) {
|
|
21
18
|
Object.keys(e).forEach(function (k) {
|
|
@@ -28,11 +25,11 @@ function _interopNamespace(e) {
|
|
|
28
25
|
}
|
|
29
26
|
});
|
|
30
27
|
}
|
|
31
|
-
n
|
|
28
|
+
n.default = e;
|
|
32
29
|
return Object.freeze(n);
|
|
33
30
|
}
|
|
34
31
|
|
|
35
|
-
var React__namespace = /*#__PURE__*/
|
|
32
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
36
33
|
|
|
37
34
|
function CatchBoundary(props) {
|
|
38
35
|
const errorComponent = props.errorComponent ?? ErrorComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatchBoundary.js","sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as React from 'react'\n\nexport function CatchBoundary(props: {\n resetKey: string\n children: any\n errorComponent?: any\n onCatch: (error: any) => void\n}) {\n const errorComponent = props.errorComponent ?? ErrorComponent\n\n return (\n <CatchBoundaryImpl\n resetKey={props.resetKey}\n onCatch={props.onCatch}\n children={({ error }) => {\n if (error) {\n return React.createElement(errorComponent, {\n error,\n })\n }\n\n return props.children\n }}\n />\n )\n}\n\nexport class CatchBoundaryImpl extends React.Component<{\n resetKey: string\n children: (props: { error: any; reset: () => void }) => any\n onCatch?: (error: any) => void\n}> {\n state = { error: null } as any\n static getDerivedStateFromError(error: any) {\n return { error }\n }\n componentDidUpdate(\n prevProps: Readonly<{\n resetKey: string\n children: (props: { error: any; reset: () => void }) => any\n onCatch?: ((error: any, info: any) => void) | undefined\n }>,\n prevState: any,\n ): void {\n if (prevState.error && prevProps.resetKey !== this.props.resetKey) {\n this.setState({ error: null })\n }\n }\n componentDidCatch(error: any) {\n console.error(error)\n this.props.onCatch?.(error)\n }\n render() {\n return this.props.children(this.state)\n }\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n const [show, setShow] = React.useState(process.env.NODE_ENV !== 'production')\n\n return (\n <div style={{ padding: '.5rem', maxWidth: '100%' }}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '.5rem' }}>\n <strong style={{ fontSize: '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n fontSize: '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n fontWeight: 'bold',\n borderRadius: '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show ? (\n <div>\n <pre\n style={{\n fontSize: '.7em',\n border: '1px solid red',\n borderRadius: '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>\n ) : null}\n </div>\n )\n}\n"],"names":["CatchBoundary","props","errorComponent","ErrorComponent","React","createElement","CatchBoundaryImpl","resetKey","onCatch","children","error","Component","state","getDerivedStateFromError","componentDidUpdate","prevProps","prevState","setState","componentDidCatch","console","render","show","setShow","useState","process","env","NODE_ENV","style","padding","maxWidth","display","alignItems","gap","fontSize","appearance","border","fontWeight","borderRadius","onClick","d","height","color","overflow","message"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CatchBoundary.js","sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as React from 'react'\n\nexport function CatchBoundary(props: {\n resetKey: string\n children: any\n errorComponent?: any\n onCatch: (error: any) => void\n}) {\n const errorComponent = props.errorComponent ?? ErrorComponent\n\n return (\n <CatchBoundaryImpl\n resetKey={props.resetKey}\n onCatch={props.onCatch}\n children={({ error }) => {\n if (error) {\n return React.createElement(errorComponent, {\n error,\n })\n }\n\n return props.children\n }}\n />\n )\n}\n\nexport class CatchBoundaryImpl extends React.Component<{\n resetKey: string\n children: (props: { error: any; reset: () => void }) => any\n onCatch?: (error: any) => void\n}> {\n state = { error: null } as any\n static getDerivedStateFromError(error: any) {\n return { error }\n }\n componentDidUpdate(\n prevProps: Readonly<{\n resetKey: string\n children: (props: { error: any; reset: () => void }) => any\n onCatch?: ((error: any, info: any) => void) | undefined\n }>,\n prevState: any,\n ): void {\n if (prevState.error && prevProps.resetKey !== this.props.resetKey) {\n this.setState({ error: null })\n }\n }\n componentDidCatch(error: any) {\n console.error(error)\n this.props.onCatch?.(error)\n }\n render() {\n return this.props.children(this.state)\n }\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n const [show, setShow] = React.useState(process.env.NODE_ENV !== 'production')\n\n return (\n <div style={{ padding: '.5rem', maxWidth: '100%' }}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '.5rem' }}>\n <strong style={{ fontSize: '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n fontSize: '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n fontWeight: 'bold',\n borderRadius: '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show ? (\n <div>\n <pre\n style={{\n fontSize: '.7em',\n border: '1px solid red',\n borderRadius: '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>\n ) : null}\n </div>\n )\n}\n"],"names":["CatchBoundary","props","errorComponent","ErrorComponent","React","createElement","CatchBoundaryImpl","resetKey","onCatch","children","error","Component","state","getDerivedStateFromError","componentDidUpdate","prevProps","prevState","setState","componentDidCatch","console","render","show","setShow","useState","process","env","NODE_ENV","style","padding","maxWidth","display","alignItems","gap","fontSize","appearance","border","fontWeight","borderRadius","onClick","d","height","color","overflow","message"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,SAASA,aAAaA,CAACC,KAK7B,EAAE;AACD,EAAA,MAAMC,cAAc,GAAGD,KAAK,CAACC,cAAc,IAAIC,cAAc,CAAA;AAE7D,EAAA,oBACEC,gBAAA,CAAAC,aAAA,CAACC,iBAAiB,EAAA;IAChBC,QAAQ,EAAEN,KAAK,CAACM,QAAS;IACzBC,OAAO,EAAEP,KAAK,CAACO,OAAQ;AACvBC,IAAAA,QAAQ,EAAEA,CAAC;AAAEC,MAAAA,KAAAA;AAAM,KAAC,KAAK;AACvB,MAAA,IAAIA,KAAK,EAAE;AACT,QAAA,oBAAON,gBAAK,CAACC,aAAa,CAACH,cAAc,EAAE;AACzCQ,UAAAA,KAAAA;AACF,SAAC,CAAC,CAAA;AACJ,OAAA;MAEA,OAAOT,KAAK,CAACQ,QAAQ,CAAA;AACvB,KAAA;AAAE,GACH,CAAC,CAAA;AAEN,CAAA;AAEO,MAAMH,iBAAiB,SAASF,gBAAK,C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AAA,KAAK,CAACiC,OAAc,CAAC,GAAG,IAC7C,CACF,CAAC,GACJ,IACD,CAAC,CAAA;AAEV;;;;;;"}
|
package/build/cjs/Matches.js
CHANGED
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
*/
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
14
|
-
|
|
15
13
|
var React = require('react');
|
|
16
14
|
var invariant = require('tiny-invariant');
|
|
17
15
|
var warning = require('tiny-warning');
|
|
@@ -19,10 +17,7 @@ var CatchBoundary = require('./CatchBoundary.js');
|
|
|
19
17
|
var RouterProvider = require('./RouterProvider.js');
|
|
20
18
|
var route = require('./route.js');
|
|
21
19
|
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
function _interopNamespace(e) {
|
|
25
|
-
if (e && e.__esModule) return e;
|
|
20
|
+
function _interopNamespaceDefault(e) {
|
|
26
21
|
var n = Object.create(null);
|
|
27
22
|
if (e) {
|
|
28
23
|
Object.keys(e).forEach(function (k) {
|
|
@@ -35,13 +30,11 @@ function _interopNamespace(e) {
|
|
|
35
30
|
}
|
|
36
31
|
});
|
|
37
32
|
}
|
|
38
|
-
n
|
|
33
|
+
n.default = e;
|
|
39
34
|
return Object.freeze(n);
|
|
40
35
|
}
|
|
41
36
|
|
|
42
|
-
var React__namespace = /*#__PURE__*/
|
|
43
|
-
var invariant__default = /*#__PURE__*/_interopDefaultLegacy(invariant);
|
|
44
|
-
var warning__default = /*#__PURE__*/_interopDefaultLegacy(warning);
|
|
37
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
45
38
|
|
|
46
39
|
function Matches() {
|
|
47
40
|
const {
|
|
@@ -68,7 +61,7 @@ function Matches() {
|
|
|
68
61
|
resetKey: locationKey,
|
|
69
62
|
errorComponent: errorComponent,
|
|
70
63
|
onCatch: () => {
|
|
71
|
-
|
|
64
|
+
warning(false, `Error in router! Consider setting an 'errorComponent' in your RootRoute! 👍`);
|
|
72
65
|
}
|
|
73
66
|
}, matches.length ? /*#__PURE__*/React__namespace.createElement(Match, {
|
|
74
67
|
matches: matches
|
|
@@ -114,7 +107,7 @@ function Match({
|
|
|
114
107
|
resetKey: locationKey,
|
|
115
108
|
errorComponent: errorComponent,
|
|
116
109
|
onCatch: () => {
|
|
117
|
-
|
|
110
|
+
warning(false, `Error in route match: ${match.id}`);
|
|
118
111
|
}
|
|
119
112
|
}, /*#__PURE__*/React__namespace.createElement(MatchInner, {
|
|
120
113
|
match: match
|
|
@@ -149,7 +142,7 @@ function MatchInner({
|
|
|
149
142
|
}
|
|
150
143
|
return /*#__PURE__*/React__namespace.createElement(Outlet, null);
|
|
151
144
|
}
|
|
152
|
-
|
|
145
|
+
invariant(false, 'Idle routeMatch status encountered during rendering! You should never see this. File an issue!');
|
|
153
146
|
}
|
|
154
147
|
function Outlet() {
|
|
155
148
|
const matches = React__namespace.useContext(matchesContext).slice(1);
|
|
@@ -194,12 +187,12 @@ function useMatch(opts) {
|
|
|
194
187
|
}
|
|
195
188
|
});
|
|
196
189
|
if (opts?.strict ?? true) {
|
|
197
|
-
|
|
190
|
+
invariant(nearestMatchRouteId == matchRouteId, `useMatch("${matchRouteId}") is being called in a component that is meant to render the '${nearestMatchRouteId}' route. Did you mean to 'useMatch("${matchRouteId}", { strict: false })' or 'useRoute("${matchRouteId}")' instead?`);
|
|
198
191
|
}
|
|
199
192
|
const matchSelection = RouterProvider.useRouterState({
|
|
200
193
|
select: state => {
|
|
201
194
|
const match = opts?.from ? state.matches.find(d => d.routeId === opts?.from) : state.matches.find(d => d.id === nearestMatch.id);
|
|
202
|
-
|
|
195
|
+
invariant(match, `Could not find ${opts?.from ? `an active match from "${opts.from}"` : 'a nearest match!'}`);
|
|
203
196
|
return opts?.select ? opts.select(match) : match;
|
|
204
197
|
}
|
|
205
198
|
});
|
package/build/cjs/Matches.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Matches.js","sources":["../../src/Matches.tsx"],"sourcesContent":["import * as React from 'react'\nimport invariant from 'tiny-invariant'\nimport warning from 'tiny-warning'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter, useRouterState } from './RouterProvider'\nimport { ResolveRelativePath, ToOptions } from './link'\nimport { AnyRoute, ReactNode, rootRouteId } from './route'\nimport {\n FullSearchSchema,\n ParseRoute,\n RouteById,\n RouteByPath,\n RouteIds,\n RoutePaths,\n} from './routeInfo'\nimport { RegisteredRouter } from './router'\nimport { NoInfer, StrictOrFrom } from './utils'\n\nexport interface RouteMatch<\n TRouteTree extends AnyRoute = AnyRoute,\n TRouteId extends RouteIds<TRouteTree> = ParseRoute<TRouteTree>['id'],\n> {\n id: string\n routeId: TRouteId\n pathname: string\n params: RouteById<TRouteTree, TRouteId>['types']['allParams']\n status: 'pending' | 'success' | 'error'\n isFetching: boolean\n invalid: boolean\n error: unknown\n paramsError: unknown\n searchError: unknown\n updatedAt: number\n loadPromise?: Promise<void>\n loaderData?: RouteById<TRouteTree, TRouteId>['types']['loaderData']\n __resolveLoadPromise?: () => void\n context: RouteById<TRouteTree, TRouteId>['types']['allContext']\n routeSearch: RouteById<TRouteTree, TRouteId>['types']['searchSchema']\n search: FullSearchSchema<TRouteTree> &\n RouteById<TRouteTree, TRouteId>['types']['fullSearchSchema']\n fetchedAt: number\n shouldReloadDeps: any\n abortController: AbortController\n cause: 'enter' | 'stay'\n}\n\nexport type AnyRouteMatch = RouteMatch<any>\n\nexport function Matches() {\n const { routesById, state } = useRouter()\n const { matches } = state\n\n const locationKey = useRouterState().location.state.key\n\n const route = routesById[rootRouteId]!\n\n const errorComponent = React.useCallback(\n (props: any) => {\n return React.createElement(ErrorComponent, {\n ...props,\n useMatch: route.useMatch,\n useRouteContext: route.useRouteContext,\n useSearch: route.useSearch,\n useParams: route.useParams,\n })\n },\n [route],\n )\n\n return (\n <matchesContext.Provider value={matches}>\n <CatchBoundary\n resetKey={locationKey}\n errorComponent={errorComponent}\n onCatch={() => {\n warning(\n false,\n `Error in router! Consider setting an 'errorComponent' in your RootRoute! 👍`,\n )\n }}\n >\n {matches.length ? <Match matches={matches} /> : null}\n </CatchBoundary>\n </matchesContext.Provider>\n )\n}\n\nconst defaultPending = () => null\nfunction SafeFragment(props: any) {\n return <>{props.children}</>\n}\n\nexport function Match({ matches }: { matches: RouteMatch[] }) {\n const { options, routesById } = useRouter()\n const match = matches[0]!\n const routeId = match?.routeId\n const route = routesById[routeId]!\n const locationKey = useRouterState().location.state?.key\n\n const PendingComponent = (route.options.pendingComponent ??\n options.defaultPendingComponent ??\n defaultPending) as any\n\n const routeErrorComponent =\n route.options.errorComponent ??\n options.defaultErrorComponent ??\n ErrorComponent\n\n const ResolvedSuspenseBoundary = route.options.wrapInSuspense\n ? React.Suspense\n : SafeFragment\n\n const errorComponent = routeErrorComponent\n ? React.useCallback(\n (props: any) => {\n return React.createElement(routeErrorComponent, {\n ...props,\n useMatch: route.useMatch,\n useRouteContext: route.useRouteContext,\n useSearch: route.useSearch,\n useParams: route.useParams,\n })\n },\n [route],\n )\n : undefined\n\n return (\n <matchesContext.Provider value={matches}>\n <ResolvedSuspenseBoundary\n fallback={React.createElement(PendingComponent, {\n useMatch: route.useMatch,\n useRouteContext: route.useRouteContext,\n useSearch: route.useSearch,\n useParams: route.useParams,\n })}\n >\n {errorComponent ? (\n <CatchBoundary\n resetKey={locationKey}\n errorComponent={errorComponent}\n onCatch={() => {\n warning(false, `Error in route match: ${match.id}`)\n }}\n >\n <MatchInner match={match} />\n </CatchBoundary>\n ) : (\n <SafeFragment>\n <MatchInner match={match} />\n </SafeFragment>\n )}\n </ResolvedSuspenseBoundary>\n </matchesContext.Provider>\n )\n}\nfunction MatchInner({ match }: { match: RouteMatch }): any {\n const { options, routesById } = useRouter()\n const route = routesById[match.routeId]!\n\n if (match.status === 'error') {\n throw match.error\n }\n\n if (match.status === 'pending') {\n throw match.loadPromise\n }\n\n if (match.status === 'success') {\n let comp = route.options.component ?? options.defaultComponent\n\n if (comp) {\n return React.createElement(comp, {\n useMatch: route.useMatch,\n useRouteContext: route.useRouteContext as any,\n useSearch: route.useSearch,\n useParams: route.useParams as any,\n useLoaderData: route.useLoaderData,\n })\n }\n\n return <Outlet />\n }\n\n invariant(\n false,\n 'Idle routeMatch status encountered during rendering! You should never see this. File an issue!',\n )\n}\n\nexport function Outlet() {\n const matches = React.useContext(matchesContext).slice(1)\n\n if (!matches[0]) {\n return null\n }\n\n return <Match matches={matches} />\n}\n\nexport interface MatchRouteOptions {\n pending?: boolean\n caseSensitive?: boolean\n includeSearch?: boolean\n fuzzy?: boolean\n}\n\nexport type MakeUseMatchRouteOptions<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> = '/',\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> = '/',\n TMaskTo extends string = '',\n> = ToOptions<AnyRoute, TFrom, TTo, TMaskFrom, TMaskTo> & MatchRouteOptions\n\nexport function useMatchRoute<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n>() {\n const { matchRoute } = useRouter()\n\n return React.useCallback(\n <\n TFrom extends RoutePaths<TRouteTree> = '/',\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> = '/',\n TMaskTo extends string = '',\n TResolved extends string = ResolveRelativePath<TFrom, NoInfer<TTo>>,\n >(\n opts: MakeUseMatchRouteOptions<\n TRouteTree,\n TFrom,\n TTo,\n TMaskFrom,\n TMaskTo\n >,\n ): false | RouteById<TRouteTree, TResolved>['types']['allParams'] => {\n const { pending, caseSensitive, ...rest } = opts\n\n return matchRoute(rest as any, {\n pending,\n caseSensitive,\n })\n },\n [],\n )\n}\n\nexport type MakeMatchRouteOptions<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> = '/',\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> = '/',\n TMaskTo extends string = '',\n> = ToOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> &\n MatchRouteOptions & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ((\n params?: RouteByPath<\n TRouteTree,\n ResolveRelativePath<TFrom, NoInfer<TTo>>\n >['types']['allParams'],\n ) => ReactNode)\n | React.ReactNode\n }\n\nexport function MatchRoute<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> = '/',\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> = '/',\n TMaskTo extends string = '',\n>(\n props: MakeMatchRouteOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>,\n): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n if (typeof props.children === 'function') {\n return (props.children as any)(params)\n }\n\n return !!params ? props.children : null\n}\n\nexport function useMatch<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>,\n TStrict extends boolean = true,\n TRouteMatchState = RouteMatch<TRouteTree, TFrom>,\n TSelected = TRouteMatchState,\n>(\n opts: StrictOrFrom<TFrom> & {\n select?: (match: TRouteMatchState) => TSelected\n },\n): TStrict extends true ? TSelected : TSelected | undefined {\n const nearestMatch = React.useContext(matchesContext)[0]!\n const nearestMatchRouteId = nearestMatch?.routeId\n\n const matchRouteId = useRouterState({\n select: (state) => {\n const match = opts?.from\n ? state.matches.find((d) => d.routeId === opts?.from)\n : state.matches.find((d) => d.id === nearestMatch.id)\n\n return match!.routeId\n },\n })\n\n if (opts?.strict ?? true) {\n invariant(\n nearestMatchRouteId == matchRouteId,\n `useMatch(\"${\n matchRouteId as string\n }\") is being called in a component that is meant to render the '${nearestMatchRouteId}' route. Did you mean to 'useMatch(\"${\n matchRouteId as string\n }\", { strict: false })' or 'useRoute(\"${\n matchRouteId as string\n }\")' instead?`,\n )\n }\n\n const matchSelection = useRouterState({\n select: (state) => {\n const match = opts?.from\n ? state.matches.find((d) => d.routeId === opts?.from)\n : state.matches.find((d) => d.id === nearestMatch.id)\n\n invariant(\n match,\n `Could not find ${\n opts?.from\n ? `an active match from \"${opts.from}\"`\n : 'a nearest match!'\n }`,\n )\n\n return opts?.select ? opts.select(match as any) : match\n },\n })\n\n return matchSelection as any\n}\n\nexport const matchesContext = React.createContext<RouteMatch[]>(null!)\n\nexport function useMatches<T = RouteMatch[]>(opts?: {\n select?: (matches: RouteMatch[]) => T\n}): T {\n const contextMatches = React.useContext(matchesContext)\n\n return useRouterState({\n select: (state) => {\n const matches = state.matches.slice(\n state.matches.findIndex((d) => d.id === contextMatches[0]?.id),\n )\n return opts?.select ? opts.select(matches) : (matches as T)\n },\n })\n}\n\nexport function useLoaderData<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>,\n TStrict extends boolean = true,\n TRouteMatch extends RouteMatch<TRouteTree, TFrom> = RouteMatch<\n TRouteTree,\n TFrom\n >,\n TSelected = TRouteMatch['loaderData'],\n>(\n opts: StrictOrFrom<TFrom> & {\n select?: (match: TRouteMatch) => TSelected\n },\n): TStrict extends true ? TSelected : TSelected | undefined {\n const match = useMatch({ ...opts, select: undefined })!\n\n return typeof opts.select === 'function'\n ? opts.select(match?.loaderData)\n : match?.loaderData\n}\n"],"names":["Matches","routesById","state","useRouter","matches","locationKey","useRouterState","location","key","route","rootRouteId","errorComponent","React","useCallback","props","createElement","ErrorComponent","useMatch","useRouteContext","useSearch","useParams","matchesContext","Provider","value","CatchBoundary","resetKey","onCatch","warning","length","Match","defaultPending","SafeFragment","Fragment","children","options","match","routeId","PendingComponent","pendingComponent","defaultPendingComponent","routeErrorComponent","defaultErrorComponent","ResolvedSuspenseBoundary","wrapInSuspense","Suspense","undefined","fallback","id","MatchInner","status","error","loadPromise","comp","component","defaultComponent","useLoaderData","Outlet","invariant","useContext","slice","useMatchRoute","matchRoute","opts","pending","caseSensitive","rest","MatchRoute","params","nearestMatch","nearestMatchRouteId","matchRouteId","select","from","find","d","strict","matchSelection","createContext","useMatches","contextMatches","findIndex","loaderData"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDO,SAASA,OAAOA,GAAG;EACxB,MAAM;IAAEC,UAAU;AAAEC,IAAAA,KAAAA;GAAO,GAAGC,wBAAS,EAAE,CAAA;EACzC,MAAM;AAAEC,IAAAA,OAAAA;AAAQ,GAAC,GAAGF,KAAK,CAAA;EAEzB,MAAMG,WAAW,GAAGC,6BAAc,EAAE,CAACC,QAAQ,CAACL,KAAK,CAACM,GAAG,CAAA;AAEvD,EAAA,MAAMC,OAAK,GAAGR,UAAU,CAACS,iBAAW,CAAE,CAAA;AAEtC,EAAA,MAAMC,cAAc,GAAGC,gBAAK,CAACC,WAAW,CACrCC,KAAU,IAAK;AACd,IAAA,oBAAOF,gBAAK,CAACG,aAAa,CAACC,4BAAc,EAAE;AACzC,MAAA,GAAGF,KAAK;MACRG,QAAQ,EAAER,OAAK,CAACQ,QAAQ;MACxBC,eAAe,EAAET,OAAK,CAACS,eAAe;MACtCC,SAAS,EAAEV,OAAK,CAACU,SAAS;MAC1BC,SAAS,EAAEX,OAAK,CAACW,SAAAA;AACnB,KAAC,CAAC,CAAA;AACJ,GAAC,EACD,CAACX,OAAK,CACR,CAAC,CAAA;AAED,EAAA,oBACEG,gBAAA,CAAAG,aAAA,CAACM,cAAc,CAACC,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEnB,OAAAA;AAAQ,GAAA,eACtCQ,gBAAA,CAAAG,aAAA,CAACS,2BAAa,EAAA;AACZC,IAAAA,QAAQ,EAAEpB,WAAY;AACtBM,IAAAA,cAAc,EAAEA,cAAe;IAC/Be,OAAO,EAAEA,MAAM;AACbC,MAAAA,2BAAO,CACL,KAAK,EACJ,CAAA,2EAAA,CACH,CAAC,CAAA;AACH,KAAA;GAECvB,EAAAA,OAAO,CAACwB,MAAM,gB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nimport invariant from 'tiny-invariant'\nimport warning from 'tiny-warning'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter, useRouterState } from './RouterProvider'\nimport { ResolveRelativePath, ToOptions } from './link'\nimport { AnyRoute, ReactNode, rootRouteId } from './route'\nimport {\n FullSearchSchema,\n ParseRoute,\n RouteById,\n RouteByPath,\n RouteIds,\n RoutePaths,\n} from './routeInfo'\nimport { RegisteredRouter } from './router'\nimport { NoInfer, StrictOrFrom } from './utils'\n\nexport interface RouteMatch<\n TRouteTree extends AnyRoute = AnyRoute,\n TRouteId extends RouteIds<TRouteTree> = ParseRoute<TRouteTree>['id'],\n> {\n id: string\n routeId: TRouteId\n pathname: string\n params: RouteById<TRouteTree, TRouteId>['types']['allParams']\n status: 'pending' | 'success' | 'error'\n isFetching: boolean\n invalid: boolean\n error: unknown\n paramsError: unknown\n searchError: unknown\n updatedAt: number\n loadPromise?: Promise<void>\n loaderData?: RouteById<TRouteTree, TRouteId>['types']['loaderData']\n __resolveLoadPromise?: () => void\n context: RouteById<TRouteTree, TRouteId>['types']['allContext']\n routeSearch: RouteById<TRouteTree, TRouteId>['types']['searchSchema']\n search: FullSearchSchema<TRouteTree> &\n RouteById<TRouteTree, TRouteId>['types']['fullSearchSchema']\n fetchedAt: number\n shouldReloadDeps: any\n abortController: AbortController\n cause: 'enter' | 'stay'\n}\n\nexport type AnyRouteMatch = RouteMatch<any>\n\nexport function Matches() {\n const { routesById, state } = useRouter()\n const { matches } = state\n\n const locationKey = useRouterState().location.state.key\n\n const route = routesById[rootRouteId]!\n\n const errorComponent = React.useCallback(\n (props: any) => {\n return React.createElement(ErrorComponent, {\n ...props,\n useMatch: route.useMatch,\n useRouteContext: route.useRouteContext,\n useSearch: route.useSearch,\n useParams: route.useParams,\n })\n },\n [route],\n )\n\n return (\n <matchesContext.Provider value={matches}>\n <CatchBoundary\n resetKey={locationKey}\n errorComponent={errorComponent}\n onCatch={() => {\n warning(\n false,\n `Error in router! Consider setting an 'errorComponent' in your RootRoute! 👍`,\n )\n }}\n >\n {matches.length ? <Match matches={matches} /> : null}\n </CatchBoundary>\n </matchesContext.Provider>\n )\n}\n\nconst defaultPending = () => null\nfunction SafeFragment(props: any) {\n return <>{props.children}</>\n}\n\nexport function Match({ matches }: { matches: RouteMatch[] }) {\n const { options, routesById } = useRouter()\n const match = matches[0]!\n const routeId = match?.routeId\n const route = routesById[routeId]!\n const locationKey = useRouterState().location.state?.key\n\n const PendingComponent = (route.options.pendingComponent ??\n options.defaultPendingComponent ??\n defaultPending) as any\n\n const routeErrorComponent =\n route.options.errorComponent ??\n options.defaultErrorComponent ??\n ErrorComponent\n\n const ResolvedSuspenseBoundary = route.options.wrapInSuspense\n ? React.Suspense\n : SafeFragment\n\n const errorComponent = routeErrorComponent\n ? React.useCallback(\n (props: any) => {\n return React.createElement(routeErrorComponent, {\n ...props,\n useMatch: route.useMatch,\n useRouteContext: route.useRouteContext,\n useSearch: route.useSearch,\n useParams: route.useParams,\n })\n },\n [route],\n )\n : undefined\n\n return (\n <matchesContext.Provider value={matches}>\n <ResolvedSuspenseBoundary\n fallback={React.createElement(PendingComponent, {\n useMatch: route.useMatch,\n useRouteContext: route.useRouteContext,\n useSearch: route.useSearch,\n useParams: route.useParams,\n })}\n >\n {errorComponent ? (\n <CatchBoundary\n resetKey={locationKey}\n errorComponent={errorComponent}\n onCatch={() => {\n warning(false, `Error in route match: ${match.id}`)\n }}\n >\n <MatchInner match={match} />\n </CatchBoundary>\n ) : (\n <SafeFragment>\n <MatchInner match={match} />\n </SafeFragment>\n )}\n </ResolvedSuspenseBoundary>\n </matchesContext.Provider>\n )\n}\nfunction MatchInner({ match }: { match: RouteMatch }): any {\n const { options, routesById } = useRouter()\n const route = routesById[match.routeId]!\n\n if (match.status === 'error') {\n throw match.error\n }\n\n if (match.status === 'pending') {\n throw match.loadPromise\n }\n\n if (match.status === 'success') {\n let comp = route.options.component ?? options.defaultComponent\n\n if (comp) {\n return React.createElement(comp, {\n useMatch: route.useMatch,\n useRouteContext: route.useRouteContext as any,\n useSearch: route.useSearch,\n useParams: route.useParams as any,\n useLoaderData: route.useLoaderData,\n })\n }\n\n return <Outlet />\n }\n\n invariant(\n false,\n 'Idle routeMatch status encountered during rendering! You should never see this. File an issue!',\n )\n}\n\nexport function Outlet() {\n const matches = React.useContext(matchesContext).slice(1)\n\n if (!matches[0]) {\n return null\n }\n\n return <Match matches={matches} />\n}\n\nexport interface MatchRouteOptions {\n pending?: boolean\n caseSensitive?: boolean\n includeSearch?: boolean\n fuzzy?: boolean\n}\n\nexport type MakeUseMatchRouteOptions<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> = '/',\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> = '/',\n TMaskTo extends string = '',\n> = ToOptions<AnyRoute, TFrom, TTo, TMaskFrom, TMaskTo> & MatchRouteOptions\n\nexport function useMatchRoute<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n>() {\n const { matchRoute } = useRouter()\n\n return React.useCallback(\n <\n TFrom extends RoutePaths<TRouteTree> = '/',\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> = '/',\n TMaskTo extends string = '',\n TResolved extends string = ResolveRelativePath<TFrom, NoInfer<TTo>>,\n >(\n opts: MakeUseMatchRouteOptions<\n TRouteTree,\n TFrom,\n TTo,\n TMaskFrom,\n TMaskTo\n >,\n ): false | RouteById<TRouteTree, TResolved>['types']['allParams'] => {\n const { pending, caseSensitive, ...rest } = opts\n\n return matchRoute(rest as any, {\n pending,\n caseSensitive,\n })\n },\n [],\n )\n}\n\nexport type MakeMatchRouteOptions<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> = '/',\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> = '/',\n TMaskTo extends string = '',\n> = ToOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> &\n MatchRouteOptions & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ((\n params?: RouteByPath<\n TRouteTree,\n ResolveRelativePath<TFrom, NoInfer<TTo>>\n >['types']['allParams'],\n ) => ReactNode)\n | React.ReactNode\n }\n\nexport function MatchRoute<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> = '/',\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> = '/',\n TMaskTo extends string = '',\n>(\n props: MakeMatchRouteOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>,\n): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n if (typeof props.children === 'function') {\n return (props.children as any)(params)\n }\n\n return !!params ? props.children : null\n}\n\nexport function useMatch<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>,\n TStrict extends boolean = true,\n TRouteMatchState = RouteMatch<TRouteTree, TFrom>,\n TSelected = TRouteMatchState,\n>(\n opts: StrictOrFrom<TFrom> & {\n select?: (match: TRouteMatchState) => TSelected\n },\n): TStrict extends true ? TSelected : TSelected | undefined {\n const nearestMatch = React.useContext(matchesContext)[0]!\n const nearestMatchRouteId = nearestMatch?.routeId\n\n const matchRouteId = useRouterState({\n select: (state) => {\n const match = opts?.from\n ? state.matches.find((d) => d.routeId === opts?.from)\n : state.matches.find((d) => d.id === nearestMatch.id)\n\n return match!.routeId\n },\n })\n\n if (opts?.strict ?? true) {\n invariant(\n nearestMatchRouteId == matchRouteId,\n `useMatch(\"${\n matchRouteId as string\n }\") is being called in a component that is meant to render the '${nearestMatchRouteId}' route. Did you mean to 'useMatch(\"${\n matchRouteId as string\n }\", { strict: false })' or 'useRoute(\"${\n matchRouteId as string\n }\")' instead?`,\n )\n }\n\n const matchSelection = useRouterState({\n select: (state) => {\n const match = opts?.from\n ? state.matches.find((d) => d.routeId === opts?.from)\n : state.matches.find((d) => d.id === nearestMatch.id)\n\n invariant(\n match,\n `Could not find ${\n opts?.from\n ? `an active match from \"${opts.from}\"`\n : 'a nearest match!'\n }`,\n )\n\n return opts?.select ? opts.select(match as any) : match\n },\n })\n\n return matchSelection as any\n}\n\nexport const matchesContext = React.createContext<RouteMatch[]>(null!)\n\nexport function useMatches<T = RouteMatch[]>(opts?: {\n select?: (matches: RouteMatch[]) => T\n}): T {\n const contextMatches = React.useContext(matchesContext)\n\n return useRouterState({\n select: (state) => {\n const matches = state.matches.slice(\n state.matches.findIndex((d) => d.id === contextMatches[0]?.id),\n )\n return opts?.select ? opts.select(matches) : (matches as T)\n },\n })\n}\n\nexport function useLoaderData<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>,\n TStrict extends boolean = true,\n TRouteMatch extends RouteMatch<TRouteTree, TFrom> = RouteMatch<\n TRouteTree,\n TFrom\n >,\n TSelected = TRouteMatch['loaderData'],\n>(\n opts: StrictOrFrom<TFrom> & {\n select?: (match: TRouteMatch) => TSelected\n },\n): TStrict extends true ? TSelected : TSelected | undefined {\n const match = useMatch({ ...opts, select: undefined })!\n\n return typeof opts.select === 'function'\n ? opts.select(match?.loaderData)\n : match?.loaderData\n}\n"],"names":["Matches","routesById","state","useRouter","matches","locationKey","useRouterState","location","key","route","rootRouteId","errorComponent","React","useCallback","props","createElement","ErrorComponent","useMatch","useRouteContext","useSearch","useParams","matchesContext","Provider","value","CatchBoundary","resetKey","onCatch","warning","length","Match","defaultPending","SafeFragment","Fragment","children","options","match","routeId","PendingComponent","pendingComponent","defaultPendingComponent","routeErrorComponent","defaultErrorComponent","ResolvedSuspenseBoundary","wrapInSuspense","Suspense","undefined","fallback","id","MatchInner","status","error","loadPromise","comp","component","defaultComponent","useLoaderData","Outlet","invariant","useContext","slice","useMatchRoute","matchRoute","opts","pending","caseSensitive","rest","MatchRoute","params","nearestMatch","nearestMatchRouteId","matchRouteId","select","from","find","d","strict","matchSelection","createContext","useMatches","contextMatches","findIndex","loaderData"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDO,SAASA,OAAOA,GAAG;EACxB,MAAM;IAAEC,UAAU;AAAEC,IAAAA,KAAAA;GAAO,GAAGC,wBAAS,EAAE,CAAA;EACzC,MAAM;AAAEC,IAAAA,OAAAA;AAAQ,GAAC,GAAGF,KAAK,CAAA;EAEzB,MAAMG,WAAW,GAAGC,6BAAc,EAAE,CAACC,QAAQ,CAACL,KAAK,CAACM,GAAG,CAAA;AAEvD,EAAA,MAAMC,OAAK,GAAGR,UAAU,CAACS,iBAAW,CAAE,CAAA;AAEtC,EAAA,MAAMC,cAAc,GAAGC,gBAAK,CAACC,WAAW,CACrCC,KAAU,IAAK;AACd,IAAA,oBAAOF,gBAAK,CAACG,aAAa,CAACC,4BAAc,EAAE;AACzC,MAAA,GAAGF,KAAK;MACRG,QAAQ,EAAER,OAAK,CAACQ,QAAQ;MACxBC,eAAe,EAAET,OAAK,CAACS,eAAe;MACtCC,SAAS,EAAEV,OAAK,CAACU,SAAS;MAC1BC,SAAS,EAAEX,OAAK,CAACW,SAAAA;AACnB,KAAC,CAAC,CAAA;AACJ,GAAC,EACD,CAACX,OAAK,CACR,CAAC,CAAA;AAED,EAAA,oBACEG,gBAAA,CAAAG,aAAA,CAACM,cAAc,CAACC,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEnB,OAAAA;AAAQ,GAAA,eACtCQ,gBAAA,CAAAG,aAAA,CAACS,2BAAa,EAAA;AACZC,IAAAA,QAAQ,EAAEpB,WAAY;AACtBM,IAAAA,cAAc,EAAEA,cAAe;IAC/Be,OAAO,EAAEA,MAAM;AACbC,MAAAA,OAAO,CACL,KAAK,EACJ,CAAA,2EAAA,CACH,CAAC,CAAA;AACH,KAAA;GAECvB,EAAAA,OAAO,CAACwB,MAAM,gBAAGhB,gBAAA,CAAAG,aAAA,CAACc,KAAK,EAAA;AAACz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