@tanstack/react-router 0.0.1-beta.8 → 0.0.1-beta.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Tanner Linsley
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -16,34 +16,16 @@ function _extends() {
16
16
  _extends = Object.assign ? Object.assign.bind() : function (target) {
17
17
  for (var i = 1; i < arguments.length; i++) {
18
18
  var source = arguments[i];
19
-
20
19
  for (var key in source) {
21
20
  if (Object.prototype.hasOwnProperty.call(source, key)) {
22
21
  target[key] = source[key];
23
22
  }
24
23
  }
25
24
  }
26
-
27
25
  return target;
28
26
  };
29
27
  return _extends.apply(this, arguments);
30
28
  }
31
29
 
32
- function _objectWithoutPropertiesLoose(source, excluded) {
33
- if (source == null) return {};
34
- var target = {};
35
- var sourceKeys = Object.keys(source);
36
- var key, i;
37
-
38
- for (i = 0; i < sourceKeys.length; i++) {
39
- key = sourceKeys[i];
40
- if (excluded.indexOf(key) >= 0) continue;
41
- target[key] = source[key];
42
- }
43
-
44
- return target;
45
- }
46
-
47
30
  exports["extends"] = _extends;
48
- exports.objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose;
49
31
  //# sourceMappingURL=_rollupPluginBabelHelpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_rollupPluginBabelHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"_rollupPluginBabelHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,468 @@
1
+ /**
2
+ * react-router
3
+ *
4
+ * Copyright (c) TanStack
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
11
+ 'use strict';
12
+
13
+ Object.defineProperty(exports, '__esModule', { value: true });
14
+
15
+ var _rollupPluginBabelHelpers = require('./_virtual/_rollupPluginBabelHelpers.js');
16
+ var React = require('react');
17
+ var router = require('@tanstack/router');
18
+ var reactStore = require('@tanstack/react-store');
19
+
20
+ function _interopNamespace(e) {
21
+ if (e && e.__esModule) return e;
22
+ var n = Object.create(null);
23
+ if (e) {
24
+ Object.keys(e).forEach(function (k) {
25
+ if (k !== 'default') {
26
+ var d = Object.getOwnPropertyDescriptor(e, k);
27
+ Object.defineProperty(n, k, d.get ? d : {
28
+ enumerable: true,
29
+ get: function () { return e[k]; }
30
+ });
31
+ }
32
+ });
33
+ }
34
+ n["default"] = e;
35
+ return Object.freeze(n);
36
+ }
37
+
38
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
39
+
40
+ //
41
+
42
+ function lazy(importer) {
43
+ const lazyComp = /*#__PURE__*/React__namespace.lazy(importer);
44
+ const finalComp = lazyComp;
45
+ finalComp.preload = async () => {
46
+ {
47
+ await importer();
48
+ }
49
+ };
50
+ return finalComp;
51
+ }
52
+ //
53
+
54
+ function useLinkProps(options) {
55
+ const router$1 = useRouterContext();
56
+ const {
57
+ // custom props
58
+ type,
59
+ children,
60
+ target,
61
+ activeProps = () => ({
62
+ className: 'active'
63
+ }),
64
+ inactiveProps = () => ({}),
65
+ activeOptions,
66
+ disabled,
67
+ // fromCurrent,
68
+ hash,
69
+ search,
70
+ params,
71
+ to = '.',
72
+ preload,
73
+ preloadDelay,
74
+ replace,
75
+ // element props
76
+ style,
77
+ className,
78
+ onClick,
79
+ onFocus,
80
+ onMouseEnter,
81
+ onMouseLeave,
82
+ onTouchStart,
83
+ ...rest
84
+ } = options;
85
+ const linkInfo = router$1.buildLink(options);
86
+ if (linkInfo.type === 'external') {
87
+ const {
88
+ href
89
+ } = linkInfo;
90
+ return {
91
+ href
92
+ };
93
+ }
94
+ const {
95
+ handleClick,
96
+ handleFocus,
97
+ handleEnter,
98
+ handleLeave,
99
+ handleTouchStart,
100
+ isActive,
101
+ next
102
+ } = linkInfo;
103
+ const reactHandleClick = e => {
104
+ if (React__namespace.startTransition) {
105
+ // This is a hack for react < 18
106
+ React__namespace.startTransition(() => {
107
+ handleClick(e);
108
+ });
109
+ } else {
110
+ handleClick(e);
111
+ }
112
+ };
113
+ const composeHandlers = handlers => e => {
114
+ if (e.persist) e.persist();
115
+ handlers.filter(Boolean).forEach(handler => {
116
+ if (e.defaultPrevented) return;
117
+ handler(e);
118
+ });
119
+ };
120
+
121
+ // Get the active props
122
+ const resolvedActiveProps = isActive ? router.functionalUpdate(activeProps, {}) ?? {} : {};
123
+
124
+ // Get the inactive props
125
+ const resolvedInactiveProps = isActive ? {} : router.functionalUpdate(inactiveProps, {}) ?? {};
126
+ return {
127
+ ...resolvedActiveProps,
128
+ ...resolvedInactiveProps,
129
+ ...rest,
130
+ href: disabled ? undefined : next.href,
131
+ onClick: composeHandlers([onClick, reactHandleClick]),
132
+ onFocus: composeHandlers([onFocus, handleFocus]),
133
+ onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),
134
+ onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),
135
+ onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),
136
+ target,
137
+ style: {
138
+ ...style,
139
+ ...resolvedActiveProps.style,
140
+ ...resolvedInactiveProps.style
141
+ },
142
+ className: [className, resolvedActiveProps.className, resolvedInactiveProps.className].filter(Boolean).join(' ') || undefined,
143
+ ...(disabled ? {
144
+ role: 'link',
145
+ 'aria-disabled': true
146
+ } : undefined),
147
+ ['data-status']: isActive ? 'active' : undefined
148
+ };
149
+ }
150
+ const Link = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
151
+ const linkProps = useLinkProps(props);
152
+ return /*#__PURE__*/React__namespace.createElement("a", _rollupPluginBabelHelpers["extends"]({
153
+ ref: ref
154
+ }, linkProps, {
155
+ children: typeof props.children === 'function' ? props.children({
156
+ isActive: linkProps['data-status'] === 'active'
157
+ }) : props.children
158
+ }));
159
+ });
160
+ function Navigate(props) {
161
+ const router = useRouterContext();
162
+ React__namespace.useLayoutEffect(() => {
163
+ router.navigate(props);
164
+ }, []);
165
+ return null;
166
+ }
167
+ const matchesContext = /*#__PURE__*/React__namespace.createContext(null);
168
+ const routerContext = /*#__PURE__*/React__namespace.createContext(null);
169
+ class ReactRouter extends router.Router {
170
+ constructor(opts) {
171
+ super({
172
+ ...opts,
173
+ loadComponent: async component => {
174
+ if (component.preload) {
175
+ await component.preload();
176
+ }
177
+ return component;
178
+ }
179
+ });
180
+ }
181
+ }
182
+ function RouterProvider({
183
+ router: router$1,
184
+ ...rest
185
+ }) {
186
+ router$1.update(rest);
187
+ const currentMatches = reactStore.useStore(router$1.__store, s => s.currentMatches);
188
+ React__namespace.useEffect(router$1.mount, [router$1]);
189
+ return /*#__PURE__*/React__namespace.createElement(routerContext.Provider, {
190
+ value: {
191
+ router: router$1
192
+ }
193
+ }, /*#__PURE__*/React__namespace.createElement(matchesContext.Provider, {
194
+ value: [undefined, ...currentMatches]
195
+ }, /*#__PURE__*/React__namespace.createElement(CatchBoundary, {
196
+ errorComponent: ErrorComponent,
197
+ onCatch: () => {
198
+ router.warning(false, `Error in router! Consider setting an 'errorComponent' in your RootRoute! 👍`);
199
+ }
200
+ }, /*#__PURE__*/React__namespace.createElement(Outlet, null))));
201
+ }
202
+ function useRouterContext() {
203
+ const value = React__namespace.useContext(routerContext);
204
+ router.warning(value, 'useRouter must be used inside a <Router> component!');
205
+ reactStore.useStore(value.router.__store);
206
+ return value.router;
207
+ }
208
+ function useRouter(track, shallow) {
209
+ const router = useRouterContext();
210
+ reactStore.useStore(router.__store, track, shallow);
211
+ return router;
212
+ }
213
+ function useMatches() {
214
+ return React__namespace.useContext(matchesContext);
215
+ }
216
+ function useMatch(opts) {
217
+ const router$1 = useRouterContext();
218
+ const nearestMatch = useMatches()[0];
219
+ const match = opts?.from ? router$1.state.currentMatches.find(d => d.route.id === opts?.from) : nearestMatch;
220
+ router.invariant(match, `Could not find ${opts?.from ? `an active match from "${opts.from}"` : 'a nearest match!'}`);
221
+ if (opts?.strict ?? true) {
222
+ router.invariant(nearestMatch.route.id == match?.route.id, `useMatch("${match?.route.id}") is being called in a component that is meant to render the '${nearestMatch.route.id}' route. Did you mean to 'useMatch("${match?.route.id}", { strict: false })' or 'useRoute("${match?.route.id}")' instead?`);
223
+ }
224
+ reactStore.useStore(match.__store, d => opts?.track?.(match) ?? match, opts?.shallow);
225
+ return match;
226
+ }
227
+ function useRoute(routeId) {
228
+ const router$1 = useRouterContext();
229
+ const resolvedRoute = router$1.getRoute(routeId);
230
+ router.invariant(resolvedRoute, `Could not find a route for route "${routeId}"! Did you forget to add it to your route?`);
231
+ return resolvedRoute;
232
+ }
233
+ function useSearch(opts) {
234
+ const {
235
+ track,
236
+ ...matchOpts
237
+ } = opts;
238
+ const match = useMatch(matchOpts);
239
+ reactStore.useStore(match.__store, d => opts?.track?.(d.search) ?? d.search, true);
240
+ return match.state.search;
241
+ }
242
+ function useParams(opts) {
243
+ const router$1 = useRouterContext();
244
+ reactStore.useStore(router$1.__store, d => {
245
+ const params = router.last(d.currentMatches)?.params;
246
+ return opts?.track?.(params) ?? params;
247
+ }, true);
248
+ return router.last(router$1.state.currentMatches)?.params;
249
+ }
250
+ function useNavigate(defaultOpts) {
251
+ const router = useRouterContext();
252
+ return React__namespace.useCallback(opts => {
253
+ return router.navigate({
254
+ ...defaultOpts,
255
+ ...opts
256
+ });
257
+ }, []);
258
+ }
259
+ function useMatchRoute() {
260
+ const router = useRouterContext();
261
+ return React__namespace.useCallback(opts => {
262
+ const {
263
+ pending,
264
+ caseSensitive,
265
+ ...rest
266
+ } = opts;
267
+ return router.matchRoute(rest, {
268
+ pending,
269
+ caseSensitive
270
+ });
271
+ }, []);
272
+ }
273
+ function MatchRoute(props) {
274
+ const matchRoute = useMatchRoute();
275
+ const params = matchRoute(props);
276
+ if (!params) {
277
+ return null;
278
+ }
279
+ if (typeof props.children === 'function') {
280
+ return props.children(params);
281
+ }
282
+ return params ? props.children : null;
283
+ }
284
+ function Outlet() {
285
+ const matches = useMatches().slice(1);
286
+ const match = matches[0];
287
+ if (!match) {
288
+ return null;
289
+ }
290
+ return /*#__PURE__*/React__namespace.createElement(SubOutlet, {
291
+ matches: matches,
292
+ match: match
293
+ });
294
+ }
295
+ function SubOutlet({
296
+ matches,
297
+ match
298
+ }) {
299
+ const router$1 = useRouterContext();
300
+ reactStore.useStore(match.__store, store => [store.status, store.error], true);
301
+ const defaultPending = React__namespace.useCallback(() => null, []);
302
+ const PendingComponent = match.pendingComponent ?? router$1.options.defaultPendingComponent ?? defaultPending;
303
+ const errorComponent = match.errorComponent ?? router$1.options.defaultErrorComponent;
304
+ const ResolvedSuspenseBoundary = match.route.options.wrapInSuspense ?? true ? React__namespace.Suspense : SafeFragment;
305
+ const ResolvedCatchBoundary = errorComponent ? CatchBoundary : SafeFragment;
306
+ return /*#__PURE__*/React__namespace.createElement(matchesContext.Provider, {
307
+ value: matches
308
+ }, /*#__PURE__*/React__namespace.createElement(ResolvedSuspenseBoundary, {
309
+ fallback: /*#__PURE__*/React__namespace.createElement(PendingComponent, null)
310
+ }, /*#__PURE__*/React__namespace.createElement(ResolvedCatchBoundary, {
311
+ key: match.route.id,
312
+ errorComponent: errorComponent,
313
+ onCatch: () => {
314
+ router.warning(false, `Error in route match: ${match.id}`);
315
+ }
316
+ }, /*#__PURE__*/React__namespace.createElement(Inner, {
317
+ match: match
318
+ }))));
319
+ }
320
+ function Inner(props) {
321
+ const router$1 = useRouterContext();
322
+ if (props.match.state.status === 'error') {
323
+ throw props.match.state.error;
324
+ }
325
+ if (props.match.state.status === 'success') {
326
+ return /*#__PURE__*/React__namespace.createElement(props.match.component ?? router$1.options.defaultComponent ?? Outlet);
327
+ }
328
+ if (props.match.state.status === 'pending') {
329
+ throw props.match.__loadPromise;
330
+ }
331
+ router.invariant(false, 'Idle routeMatch status encountered during rendering! You should never see this. File an issue!');
332
+ }
333
+ function SafeFragment(props) {
334
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, props.children);
335
+ }
336
+
337
+ // This is the messiest thing ever... I'm either seriously tired (likely) or
338
+ // there has to be a better way to reset error boundaries when the
339
+ // router's location key changes.
340
+
341
+ class CatchBoundary extends React__namespace.Component {
342
+ state = {
343
+ error: false,
344
+ info: undefined
345
+ };
346
+ componentDidCatch(error, info) {
347
+ this.props.onCatch(error, info);
348
+ console.error(error);
349
+ this.setState({
350
+ error,
351
+ info
352
+ });
353
+ }
354
+ render() {
355
+ return /*#__PURE__*/React__namespace.createElement(CatchBoundaryInner, _rollupPluginBabelHelpers["extends"]({}, this.props, {
356
+ errorState: this.state,
357
+ reset: () => this.setState({})
358
+ }));
359
+ }
360
+ }
361
+ function CatchBoundaryInner(props) {
362
+ const [activeErrorState, setActiveErrorState] = React__namespace.useState(props.errorState);
363
+ const router = useRouterContext();
364
+ const errorComponent = props.errorComponent ?? ErrorComponent;
365
+ const prevKeyRef = React__namespace.useRef('');
366
+ React__namespace.useEffect(() => {
367
+ if (activeErrorState) {
368
+ if (router.state.currentLocation.key !== prevKeyRef.current) {
369
+ setActiveErrorState({});
370
+ }
371
+ }
372
+ prevKeyRef.current = router.state.currentLocation.key;
373
+ }, [activeErrorState, router.state.currentLocation.key]);
374
+ React__namespace.useEffect(() => {
375
+ if (props.errorState.error) {
376
+ setActiveErrorState(props.errorState);
377
+ }
378
+ // props.reset()
379
+ }, [props.errorState.error]);
380
+ if (props.errorState.error && activeErrorState.error) {
381
+ return /*#__PURE__*/React__namespace.createElement(errorComponent, activeErrorState);
382
+ }
383
+ return props.children;
384
+ }
385
+ function ErrorComponent({
386
+ error
387
+ }) {
388
+ return /*#__PURE__*/React__namespace.createElement("div", {
389
+ style: {
390
+ padding: '.5rem',
391
+ maxWidth: '100%'
392
+ }
393
+ }, /*#__PURE__*/React__namespace.createElement("strong", {
394
+ style: {
395
+ fontSize: '1.2rem'
396
+ }
397
+ }, "Something went wrong!"), /*#__PURE__*/React__namespace.createElement("div", {
398
+ style: {
399
+ height: '.5rem'
400
+ }
401
+ }), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("pre", {
402
+ style: {
403
+ fontSize: '.7em',
404
+ border: '1px solid red',
405
+ borderRadius: '.25rem',
406
+ padding: '.5rem',
407
+ color: 'red',
408
+ overflow: 'auto'
409
+ }
410
+ }, error.message ? /*#__PURE__*/React__namespace.createElement("code", null, error.message) : null)));
411
+ }
412
+ function useBlocker(message, condition = true) {
413
+ const router = useRouter();
414
+ React__namespace.useEffect(() => {
415
+ if (!condition) return;
416
+ let unblock = router.history.block((retry, cancel) => {
417
+ if (window.confirm(message)) {
418
+ unblock();
419
+ retry();
420
+ } else {
421
+ cancel();
422
+ }
423
+ });
424
+ return unblock;
425
+ });
426
+ }
427
+ function Block({
428
+ message,
429
+ condition,
430
+ children
431
+ }) {
432
+ useBlocker(message, condition);
433
+ return children ?? null;
434
+ }
435
+
436
+ Object.defineProperty(exports, 'useStore', {
437
+ enumerable: true,
438
+ get: function () { return reactStore.useStore; }
439
+ });
440
+ exports.Block = Block;
441
+ exports.ErrorComponent = ErrorComponent;
442
+ exports.Link = Link;
443
+ exports.MatchRoute = MatchRoute;
444
+ exports.Navigate = Navigate;
445
+ exports.Outlet = Outlet;
446
+ exports.ReactRouter = ReactRouter;
447
+ exports.RouterProvider = RouterProvider;
448
+ exports.lazy = lazy;
449
+ exports.matchesContext = matchesContext;
450
+ exports.routerContext = routerContext;
451
+ exports.useBlocker = useBlocker;
452
+ exports.useLinkProps = useLinkProps;
453
+ exports.useMatch = useMatch;
454
+ exports.useMatchRoute = useMatchRoute;
455
+ exports.useMatches = useMatches;
456
+ exports.useNavigate = useNavigate;
457
+ exports.useParams = useParams;
458
+ exports.useRoute = useRoute;
459
+ exports.useRouter = useRouter;
460
+ exports.useRouterContext = useRouterContext;
461
+ exports.useSearch = useSearch;
462
+ Object.keys(router).forEach(function (k) {
463
+ if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
464
+ enumerable: true,
465
+ get: function () { return router[k]; }
466
+ });
467
+ });
468
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {\n RegisteredRoutesInfo,\n RegisteredRouter,\n RouterStore,\n last,\n warning,\n RouterOptions,\n RouteMatch,\n MatchRouteOptions,\n AnyRoutesInfo,\n DefaultRoutesInfo,\n functionalUpdate,\n RoutesInfo,\n ValidFromPath,\n LinkOptions,\n RouteByPath,\n ResolveRelativePath,\n NoInfer,\n ToOptions,\n invariant,\n Router,\n AnyRootRoute,\n RootRoute,\n AnyRouteMatch,\n NavigateOptions,\n RouterConstructorOptions,\n} from '@tanstack/router'\nimport { useStore } from '@tanstack/react-store'\n\n//\n\nexport * from '@tanstack/router'\n\nexport { useStore }\n\n//\n\ntype ReactNode = any\n\nexport type SyncRouteComponent<TProps = {}> = (props: TProps) => ReactNode\n\nexport type RouteComponent<TProps = {}> = SyncRouteComponent<TProps> & {\n preload?: () => Promise<void>\n}\n\nexport function lazy(\n importer: () => Promise<{ default: SyncRouteComponent }>,\n): RouteComponent {\n const lazyComp = React.lazy(importer as any)\n let preloaded: Promise<SyncRouteComponent>\n\n const finalComp = lazyComp as unknown as RouteComponent\n\n finalComp.preload = async () => {\n if (!preloaded) {\n await importer()\n }\n }\n\n return finalComp\n}\n\nexport type LinkPropsOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = LinkOptions<RegisteredRoutesInfo, TFrom, TTo> & {\n // A function that returns additional props for the `active` state of this link. These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n activeProps?:\n | React.AnchorHTMLAttributes<HTMLAnchorElement>\n | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>)\n // A function that returns additional props for the `inactive` state of this link. These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n inactiveProps?:\n | React.AnchorHTMLAttributes<HTMLAnchorElement>\n | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>)\n}\n\nexport type MakeUseMatchRouteOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = ToOptions<RegisteredRoutesInfo, TFrom, TTo> & MatchRouteOptions\n\nexport type MakeMatchRouteOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = ToOptions<RegisteredRoutesInfo, TFrom, TTo> &\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 | ReactNode\n | ((\n params: RouteByPath<\n RegisteredRoutesInfo,\n ResolveRelativePath<TFrom, NoInfer<TTo>>\n >['__types']['allParams'],\n ) => ReactNode)\n }\n\nexport type MakeLinkPropsOptions<\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n> = LinkPropsOptions<TFrom, TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement>\n\nexport type MakeLinkOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = LinkPropsOptions<TFrom, TTo> &\n React.AnchorHTMLAttributes<HTMLAnchorElement> &\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {\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?: ReactNode | ((state: { isActive: boolean }) => ReactNode)\n }\n\ndeclare module '@tanstack/router' {\n interface FrameworkGenerics {\n Component: RouteComponent\n ErrorComponent: RouteComponent<{\n error: Error\n info: { componentStack: string }\n }>\n }\n\n interface RouterOptions<TRouteTree> {\n // ssrFooter?: () => JSX.Element | Node\n }\n\n interface FrameworkRouteOptions {\n wrapInSuspense?: boolean\n }\n}\n\nexport type PromptProps = {\n message: string\n condition?: boolean | any\n children?: ReactNode\n}\n\n//\n\nexport function useLinkProps<\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n>(\n options: MakeLinkPropsOptions<TFrom, TTo>,\n): React.AnchorHTMLAttributes<HTMLAnchorElement> {\n const router = useRouterContext()\n\n const {\n // custom props\n type,\n children,\n target,\n activeProps = () => ({ className: 'active' }),\n inactiveProps = () => ({}),\n activeOptions,\n disabled,\n // fromCurrent,\n hash,\n search,\n params,\n to = '.',\n preload,\n preloadDelay,\n replace,\n // element props\n style,\n className,\n onClick,\n onFocus,\n onMouseEnter,\n onMouseLeave,\n onTouchStart,\n ...rest\n } = options\n\n const linkInfo = router.buildLink(options as any)\n\n if (linkInfo.type === 'external') {\n const { href } = linkInfo\n return { href }\n }\n\n const {\n handleClick,\n handleFocus,\n handleEnter,\n handleLeave,\n handleTouchStart,\n isActive,\n next,\n } = linkInfo\n\n const reactHandleClick = (e: Event) => {\n if (React.startTransition) {\n // This is a hack for react < 18\n React.startTransition(() => {\n handleClick(e)\n })\n } else {\n handleClick(e)\n }\n }\n\n const composeHandlers =\n (handlers: (undefined | ((e: any) => void))[]) =>\n (e: React.SyntheticEvent) => {\n if (e.persist) e.persist()\n handlers.filter(Boolean).forEach((handler) => {\n if (e.defaultPrevented) return\n handler!(e)\n })\n }\n\n // Get the active props\n const resolvedActiveProps: React.HTMLAttributes<HTMLAnchorElement> = isActive\n ? functionalUpdate(activeProps as any, {}) ?? {}\n : {}\n\n // Get the inactive props\n const resolvedInactiveProps: React.HTMLAttributes<HTMLAnchorElement> =\n isActive ? {} : functionalUpdate(inactiveProps, {}) ?? {}\n\n return {\n ...resolvedActiveProps,\n ...resolvedInactiveProps,\n ...rest,\n href: disabled ? undefined : next.href,\n onClick: composeHandlers([onClick, reactHandleClick]),\n onFocus: composeHandlers([onFocus, handleFocus]),\n onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),\n onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),\n onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),\n target,\n style: {\n ...style,\n ...resolvedActiveProps.style,\n ...resolvedInactiveProps.style,\n },\n className:\n [\n className,\n resolvedActiveProps.className,\n resolvedInactiveProps.className,\n ]\n .filter(Boolean)\n .join(' ') || undefined,\n ...(disabled\n ? {\n role: 'link',\n 'aria-disabled': true,\n }\n : undefined),\n ['data-status']: isActive ? 'active' : undefined,\n }\n}\n\nexport interface LinkFn<\n TDefaultFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TDefaultTo extends string = '',\n> {\n <\n TFrom extends RegisteredRoutesInfo['routePaths'] = TDefaultFrom,\n TTo extends string = TDefaultTo,\n >(\n props: MakeLinkOptions<TFrom, TTo> & React.RefAttributes<HTMLAnchorElement>,\n ): ReactNode\n}\n\nexport const Link: LinkFn = React.forwardRef((props: any, ref) => {\n const linkProps = useLinkProps(props)\n\n return (\n <a\n {...{\n ref: ref as any,\n ...linkProps,\n children:\n typeof props.children === 'function'\n ? props.children({\n isActive: (linkProps as any)['data-status'] === 'active',\n })\n : props.children,\n }}\n />\n )\n}) as any\n\nexport function Navigate<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n>(props: NavigateOptions<RegisteredRoutesInfo, TFrom, TTo>): null {\n const router = useRouterContext()\n\n React.useLayoutEffect(() => {\n router.navigate(props as any)\n }, [])\n\n return null\n}\n\ntype MatchesContextValue = AnyRouteMatch[]\n\nexport const matchesContext = React.createContext<MatchesContextValue>(null!)\nexport const routerContext = React.createContext<{ router: RegisteredRouter }>(\n null!,\n)\n\nexport type MatchesProviderProps = {\n value: MatchesContextValue\n children: ReactNode\n}\n\nexport class ReactRouter<\n TRouteConfig extends AnyRootRoute = RootRoute,\n TRoutesInfo extends AnyRoutesInfo = RoutesInfo<TRouteConfig>,\n> extends Router<TRouteConfig, TRoutesInfo> {\n constructor(opts: RouterConstructorOptions<TRouteConfig>) {\n super({\n ...opts,\n loadComponent: async (component) => {\n if (component.preload) {\n await component.preload()\n }\n\n return component as any\n },\n })\n }\n}\n\nexport type RouterProps<\n TRouteConfig extends AnyRootRoute = RootRoute,\n TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo,\n> = RouterOptions<TRouteConfig> & {\n router: Router<TRouteConfig, TRoutesInfo>\n}\n\nexport function RouterProvider<\n TRouteConfig extends AnyRootRoute = RootRoute,\n TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo,\n>({ router, ...rest }: RouterProps<TRouteConfig, TRoutesInfo>) {\n router.update(rest)\n\n const currentMatches = useStore(router.__store, (s) => s.currentMatches)\n\n React.useEffect(router.mount, [router])\n\n return (\n <routerContext.Provider value={{ router: router as any }}>\n <matchesContext.Provider value={[undefined!, ...currentMatches]}>\n <CatchBoundary\n errorComponent={ErrorComponent}\n onCatch={() => {\n warning(\n false,\n `Error in router! Consider setting an 'errorComponent' in your RootRoute! 👍`,\n )\n }}\n >\n <Outlet />\n </CatchBoundary>\n </matchesContext.Provider>\n </routerContext.Provider>\n )\n}\n\nexport function useRouterContext(): RegisteredRouter {\n const value = React.useContext(routerContext)\n warning(value, 'useRouter must be used inside a <Router> component!')\n\n useStore(value.router.__store)\n\n return value.router\n}\n\nexport function useRouter<T = RouterStore>(\n track?: (state: Router['__store']) => T,\n shallow?: boolean,\n): RegisteredRouter {\n const router = useRouterContext()\n useStore(router.__store, track as any, shallow)\n return router\n}\n\nexport function useMatches(): RouteMatch[] {\n return React.useContext(matchesContext)\n}\n\nexport function useMatch<\n TFrom extends keyof RegisteredRoutesInfo['routesById'],\n TStrict extends boolean = true,\n TRouteMatch = RouteMatch<\n RegisteredRoutesInfo,\n RegisteredRoutesInfo['routesById'][TFrom]\n >,\n>(opts?: {\n from: TFrom\n strict?: TStrict\n track?: (match: TRouteMatch) => any\n shallow?: boolean\n}): TStrict extends true ? TRouteMatch : TRouteMatch | undefined {\n const router = useRouterContext()\n const nearestMatch = useMatches()[0]!\n const match = opts?.from\n ? router.state.currentMatches.find((d) => d.route.id === opts?.from)\n : nearestMatch\n\n invariant(\n match,\n `Could not find ${\n opts?.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'\n }`,\n )\n\n if (opts?.strict ?? true) {\n invariant(\n nearestMatch.route.id == match?.route.id,\n `useMatch(\"${\n match?.route.id as string\n }\") is being called in a component that is meant to render the '${\n nearestMatch.route.id\n }' route. Did you mean to 'useMatch(\"${\n match?.route.id as string\n }\", { strict: false })' or 'useRoute(\"${\n match?.route.id as string\n }\")' instead?`,\n )\n }\n\n useStore(\n match!.__store as any,\n (d) => opts?.track?.(match as any) ?? match,\n opts?.shallow,\n )\n\n return match as any\n}\n\nexport function useRoute<\n TId extends keyof RegisteredRoutesInfo['routesById'] = '/',\n>(routeId: TId): RegisteredRoutesInfo['routesById'][TId] {\n const router = useRouterContext()\n const resolvedRoute = router.getRoute(routeId as any)\n\n invariant(\n resolvedRoute,\n `Could not find a route for route \"${\n routeId as string\n }\"! Did you forget to add it to your route?`,\n )\n\n return resolvedRoute as any\n}\n\nexport function useSearch<\n TFrom extends keyof RegisteredRoutesInfo['routesById'],\n TStrict extends boolean = true,\n TSearch = RegisteredRoutesInfo['routesById'][TFrom]['__types']['fullSearchSchema'],\n TSelected = TSearch,\n>(opts?: {\n from: TFrom\n strict?: TStrict\n track?: (search: TSearch) => TSelected\n}): TStrict extends true ? TSelected : TSelected | undefined {\n const { track, ...matchOpts } = opts as any\n const match = useMatch(matchOpts)\n useStore(match.__store, (d: any) => opts?.track?.(d.search) ?? d.search, true)\n\n return (match as unknown as RouteMatch).state.search as any\n}\n\nexport function useParams<\n TFrom extends keyof RegisteredRoutesInfo['routesById'] = '/',\n TDefaultSelected = RegisteredRoutesInfo['allParams'] &\n RegisteredRoutesInfo['routesById'][TFrom]['__types']['allParams'],\n TSelected = TDefaultSelected,\n>(opts?: {\n from: TFrom\n track?: (search: TDefaultSelected) => TSelected\n}): TSelected {\n const router = useRouterContext()\n useStore(\n router.__store,\n (d) => {\n const params = last(d.currentMatches)?.params as any\n return opts?.track?.(params) ?? params\n },\n true,\n )\n\n return last(router.state.currentMatches)?.params as any\n}\n\nexport function useNavigate<\n TDefaultFrom extends keyof RegisteredRoutesInfo['routesById'] = '/',\n>(defaultOpts?: { from?: TDefaultFrom }) {\n const router = useRouterContext()\n return React.useCallback(\n <\n TFrom extends keyof RegisteredRoutesInfo['routesById'] = TDefaultFrom,\n TTo extends string = '',\n >(\n opts?: MakeLinkOptions<TFrom, TTo>,\n ) => {\n return router.navigate({ ...defaultOpts, ...(opts as any) })\n },\n [],\n )\n}\n\nexport function useMatchRoute() {\n const router = useRouterContext()\n\n return React.useCallback(\n <\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n >(\n opts: MakeUseMatchRouteOptions<TFrom, TTo>,\n ) => {\n const { pending, caseSensitive, ...rest } = opts\n\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n })\n },\n [],\n )\n}\n\nexport function MatchRoute<\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n>(props: MakeMatchRouteOptions<TFrom, TTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props)\n\n if (!params) {\n return null\n }\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 Outlet() {\n const matches = useMatches().slice(1)\n const match = matches[0]\n\n if (!match) {\n return null\n }\n\n return <SubOutlet matches={matches} match={match} />\n}\n\nfunction SubOutlet({\n matches,\n match,\n}: {\n matches: RouteMatch[]\n match: RouteMatch\n}) {\n const router = useRouterContext()\n useStore(match!.__store, (store) => [store.status, store.error], true)\n\n const defaultPending = React.useCallback(() => null, [])\n\n const PendingComponent = (match.pendingComponent ??\n router.options.defaultPendingComponent ??\n defaultPending) as any\n\n const errorComponent =\n match.errorComponent ?? router.options.defaultErrorComponent\n\n const ResolvedSuspenseBoundary =\n match.route.options.wrapInSuspense ?? true ? React.Suspense : SafeFragment\n const ResolvedCatchBoundary = errorComponent ? CatchBoundary : SafeFragment\n\n return (\n <matchesContext.Provider value={matches}>\n <ResolvedSuspenseBoundary fallback={<PendingComponent />}>\n <ResolvedCatchBoundary\n key={match.route.id}\n errorComponent={errorComponent}\n onCatch={() => {\n warning(false, `Error in route match: ${match.id}`)\n }}\n >\n <Inner match={match} />\n </ResolvedCatchBoundary>\n </ResolvedSuspenseBoundary>\n </matchesContext.Provider>\n )\n}\n\nfunction Inner(props: { match: RouteMatch }): any {\n const router = useRouterContext()\n\n if (props.match.state.status === 'error') {\n throw props.match.state.error\n }\n\n if (props.match.state.status === 'success') {\n return React.createElement(\n (props.match.component as any) ??\n router.options.defaultComponent ??\n Outlet,\n )\n }\n\n if (props.match.state.status === 'pending') {\n throw props.match.__loadPromise\n }\n\n invariant(\n false,\n 'Idle routeMatch status encountered during rendering! You should never see this. File an issue!',\n )\n}\n\nfunction SafeFragment(props: any) {\n return <>{props.children}</>\n}\n\n// This is the messiest thing ever... I'm either seriously tired (likely) or\n// there has to be a better way to reset error boundaries when the\n// router's location key changes.\n\nclass CatchBoundary extends React.Component<{\n children: any\n errorComponent: any\n onCatch: (error: any, info: any) => void\n}> {\n state = {\n error: false,\n info: undefined,\n }\n componentDidCatch(error: any, info: any) {\n this.props.onCatch(error, info)\n console.error(error)\n this.setState({\n error,\n info,\n })\n }\n render() {\n return (\n <CatchBoundaryInner\n {...this.props}\n errorState={this.state}\n reset={() => this.setState({})}\n />\n )\n }\n}\n\nfunction CatchBoundaryInner(props: {\n children: any\n errorComponent: any\n errorState: { error: unknown; info: any }\n reset: () => void\n}) {\n const [activeErrorState, setActiveErrorState] = React.useState(\n props.errorState,\n )\n const router = useRouterContext()\n const errorComponent = props.errorComponent ?? ErrorComponent\n const prevKeyRef = React.useRef('' as any)\n\n React.useEffect(() => {\n if (activeErrorState) {\n if (router.state.currentLocation.key !== prevKeyRef.current) {\n setActiveErrorState({} as any)\n }\n }\n\n prevKeyRef.current = router.state.currentLocation.key\n }, [activeErrorState, router.state.currentLocation.key])\n\n React.useEffect(() => {\n if (props.errorState.error) {\n setActiveErrorState(props.errorState)\n }\n // props.reset()\n }, [props.errorState.error])\n\n if (props.errorState.error && activeErrorState.error) {\n return React.createElement(errorComponent, activeErrorState)\n }\n\n return props.children\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n return (\n <div style={{ padding: '.5rem', maxWidth: '100%' }}>\n <strong style={{ fontSize: '1.2rem' }}>Something went wrong!</strong>\n <div style={{ height: '.5rem' }} />\n <div>\n <pre\n style={{\n fontSize: '.7em',\n border: '1px solid red',\n borderRadius: '.25rem',\n padding: '.5rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>\n </div>\n )\n}\n\nexport function useBlocker(\n message: string,\n condition: boolean | any = true,\n): void {\n const router = useRouter()\n\n React.useEffect(() => {\n if (!condition) return\n\n let unblock = router.history.block((retry, cancel) => {\n if (window.confirm(message)) {\n unblock()\n retry()\n } else {\n cancel()\n }\n })\n\n return unblock\n })\n}\n\nexport function Block({ message, condition, children }: PromptProps) {\n useBlocker(message, condition)\n return (children ?? null) as ReactNode\n}\n"],"names":["lazy","importer","lazyComp","React","finalComp","preload","useLinkProps","options","router","useRouterContext","type","children","target","activeProps","className","inactiveProps","activeOptions","disabled","hash","search","params","to","preloadDelay","replace","style","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","rest","linkInfo","buildLink","href","handleClick","handleFocus","handleEnter","handleLeave","handleTouchStart","isActive","next","reactHandleClick","e","startTransition","composeHandlers","handlers","persist","filter","Boolean","forEach","handler","defaultPrevented","resolvedActiveProps","functionalUpdate","resolvedInactiveProps","undefined","join","role","Link","forwardRef","props","ref","linkProps","_extends","Navigate","useLayoutEffect","navigate","matchesContext","createContext","routerContext","ReactRouter","Router","constructor","opts","loadComponent","component","RouterProvider","update","currentMatches","useStore","__store","s","useEffect","mount","ErrorComponent","warning","value","useContext","useRouter","track","shallow","useMatches","useMatch","nearestMatch","match","from","state","find","d","route","id","invariant","strict","useRoute","routeId","resolvedRoute","getRoute","useSearch","matchOpts","useParams","last","useNavigate","defaultOpts","useCallback","useMatchRoute","pending","caseSensitive","matchRoute","MatchRoute","Outlet","matches","slice","SubOutlet","store","status","error","defaultPending","PendingComponent","pendingComponent","defaultPendingComponent","errorComponent","defaultErrorComponent","ResolvedSuspenseBoundary","wrapInSuspense","Suspense","SafeFragment","ResolvedCatchBoundary","CatchBoundary","Inner","createElement","defaultComponent","__loadPromise","Component","info","componentDidCatch","onCatch","console","setState","render","CatchBoundaryInner","activeErrorState","setActiveErrorState","useState","errorState","prevKeyRef","useRef","currentLocation","key","current","padding","maxWidth","fontSize","height","border","borderRadius","color","overflow","message","useBlocker","condition","unblock","history","block","retry","cancel","window","confirm","Block"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA;;AAUO,SAASA,IAAI,CAClBC,QAAwD,EACxC;AAChB,EAAA,MAAMC,QAAQ,gBAAGC,gBAAK,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