@tanstack/react-router 0.0.1-beta.28 → 0.0.1-beta.280

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.
Files changed (106) hide show
  1. package/LICENSE +21 -0
  2. package/build/cjs/CatchBoundary.js +128 -0
  3. package/build/cjs/CatchBoundary.js.map +1 -0
  4. package/build/cjs/Matches.js +233 -0
  5. package/build/cjs/Matches.js.map +1 -0
  6. package/build/cjs/RouterProvider.js +170 -0
  7. package/build/cjs/RouterProvider.js.map +1 -0
  8. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +2 -22
  9. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  10. package/build/cjs/awaited.js +43 -0
  11. package/build/cjs/awaited.js.map +1 -0
  12. package/build/cjs/defer.js +37 -0
  13. package/build/cjs/defer.js.map +1 -0
  14. package/build/cjs/fileRoute.js +27 -0
  15. package/build/cjs/fileRoute.js.map +1 -0
  16. package/build/cjs/index.js +130 -0
  17. package/build/cjs/index.js.map +1 -0
  18. package/build/cjs/lazyRouteComponent.js +54 -0
  19. package/build/cjs/lazyRouteComponent.js.map +1 -0
  20. package/build/cjs/link.js +223 -0
  21. package/build/cjs/link.js.map +1 -0
  22. package/build/cjs/path.js +214 -0
  23. package/build/cjs/path.js.map +1 -0
  24. package/build/cjs/qss.js +63 -0
  25. package/build/cjs/qss.js.map +1 -0
  26. package/build/cjs/redirects.js +28 -0
  27. package/build/cjs/redirects.js.map +1 -0
  28. package/build/cjs/route.js +191 -0
  29. package/build/cjs/route.js.map +1 -0
  30. package/build/cjs/router.js +1049 -0
  31. package/build/cjs/router.js.map +1 -0
  32. package/build/cjs/scroll-restoration.js +202 -0
  33. package/build/cjs/scroll-restoration.js.map +1 -0
  34. package/build/cjs/searchParams.js +81 -0
  35. package/build/cjs/searchParams.js.map +1 -0
  36. package/build/cjs/useBlocker.js +55 -0
  37. package/build/cjs/useBlocker.js.map +1 -0
  38. package/build/cjs/useNavigate.js +86 -0
  39. package/build/cjs/useNavigate.js.map +1 -0
  40. package/build/cjs/useParams.js +26 -0
  41. package/build/cjs/useParams.js.map +1 -0
  42. package/build/cjs/useSearch.js +25 -0
  43. package/build/cjs/useSearch.js.map +1 -0
  44. package/build/cjs/utils.js +239 -0
  45. package/build/cjs/utils.js.map +1 -0
  46. package/build/esm/index.js +2255 -2571
  47. package/build/esm/index.js.map +1 -1
  48. package/build/stats-html.html +3498 -2694
  49. package/build/stats-react.json +1204 -44
  50. package/build/types/CatchBoundary.d.ts +36 -0
  51. package/build/types/Matches.d.ts +62 -0
  52. package/build/types/RouterProvider.d.ts +35 -0
  53. package/build/types/awaited.d.ts +9 -0
  54. package/build/types/defer.d.ts +19 -0
  55. package/build/types/fileRoute.d.ts +38 -0
  56. package/build/types/history.d.ts +7 -0
  57. package/build/types/index.d.ts +27 -114
  58. package/build/types/lazyRouteComponent.d.ts +2 -0
  59. package/build/types/link.d.ts +91 -0
  60. package/build/types/location.d.ts +12 -0
  61. package/build/types/path.d.ts +17 -0
  62. package/build/types/qss.d.ts +2 -0
  63. package/build/types/redirects.d.ts +11 -0
  64. package/build/types/route.d.ts +282 -0
  65. package/build/types/routeInfo.d.ts +22 -0
  66. package/build/types/router.d.ts +188 -0
  67. package/build/types/scroll-restoration.d.ts +18 -0
  68. package/build/types/searchParams.d.ts +7 -0
  69. package/build/types/useBlocker.d.ts +9 -0
  70. package/build/types/useNavigate.d.ts +19 -0
  71. package/build/types/useParams.d.ts +7 -0
  72. package/build/types/useSearch.d.ts +7 -0
  73. package/build/types/utils.d.ts +66 -0
  74. package/build/umd/index.development.js +2858 -2548
  75. package/build/umd/index.development.js.map +1 -1
  76. package/build/umd/index.production.js +4 -4
  77. package/build/umd/index.production.js.map +1 -1
  78. package/package.json +11 -10
  79. package/src/CatchBoundary.tsx +101 -0
  80. package/src/Matches.tsx +421 -0
  81. package/src/RouterProvider.tsx +252 -0
  82. package/src/awaited.tsx +40 -0
  83. package/src/defer.ts +55 -0
  84. package/src/fileRoute.ts +152 -0
  85. package/src/history.ts +8 -0
  86. package/src/index.tsx +28 -761
  87. package/src/lazyRouteComponent.tsx +33 -0
  88. package/src/link.tsx +598 -0
  89. package/src/location.ts +13 -0
  90. package/src/path.ts +261 -0
  91. package/src/qss.ts +53 -0
  92. package/src/redirects.ts +39 -0
  93. package/src/route.ts +872 -0
  94. package/src/routeInfo.ts +70 -0
  95. package/src/router.ts +1630 -0
  96. package/src/scroll-restoration.tsx +230 -0
  97. package/src/searchParams.ts +79 -0
  98. package/src/useBlocker.tsx +27 -0
  99. package/src/useNavigate.tsx +111 -0
  100. package/src/useParams.tsx +25 -0
  101. package/src/useSearch.tsx +25 -0
  102. package/src/utils.ts +350 -0
  103. package/build/cjs/react-router/src/index.js +0 -508
  104. package/build/cjs/react-router/src/index.js.map +0 -1
  105. package/build/cjs/router-core/build/esm/index.js +0 -2530
  106. package/build/cjs/router-core/build/esm/index.js.map +0 -1
@@ -1,508 +0,0 @@
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 shim = require('use-sync-external-store/shim');
18
- var index = require('../../router-core/build/esm/index.js');
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
- const _excluded = ["type", "children", "target", "activeProps", "inactiveProps", "activeOptions", "disabled", "hash", "search", "params", "to", "preload", "preloadDelay", "preloadMaxAge", "replace", "style", "className", "onClick", "onFocus", "onMouseEnter", "onMouseLeave", "onTouchStart", "onTouchEnd"],
41
- _excluded2 = ["pending", "caseSensitive", "children"],
42
- _excluded3 = ["children", "router"];
43
- function lazy(importer) {
44
- const lazyComp = /*#__PURE__*/React__namespace.lazy(importer);
45
- let promise;
46
- let resolvedComp;
47
- const forwardedComp = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
48
- const resolvedCompRef = React__namespace.useRef(resolvedComp || lazyComp);
49
- return /*#__PURE__*/React__namespace.createElement(resolvedCompRef.current, _rollupPluginBabelHelpers["extends"]({}, ref ? {
50
- ref
51
- } : {}, props));
52
- });
53
- const finalComp = forwardedComp;
54
-
55
- finalComp.preload = () => {
56
- if (!promise) {
57
- promise = importer().then(module => {
58
- resolvedComp = module.default;
59
- return resolvedComp;
60
- });
61
- }
62
-
63
- return promise;
64
- };
65
-
66
- return finalComp;
67
- }
68
- //
69
- function Link(props) {
70
- const router = useRouter();
71
- return /*#__PURE__*/React__namespace.createElement(router.Link, props);
72
- }
73
- const matchesContext = /*#__PURE__*/React__namespace.createContext(null);
74
- const routerContext = /*#__PURE__*/React__namespace.createContext(null);
75
- function MatchesProvider(props) {
76
- return /*#__PURE__*/React__namespace.createElement(matchesContext.Provider, props);
77
- }
78
-
79
- const useRouterSubscription = router => {
80
- shim.useSyncExternalStore(cb => router.subscribe(() => cb()), () => router.state, () => router.state);
81
- };
82
-
83
- function createReactRouter(opts) {
84
- const makeRouteExt = (route, router) => {
85
- return {
86
- useRoute: function useRoute(subRouteId) {
87
- if (subRouteId === void 0) {
88
- subRouteId = '.';
89
- }
90
-
91
- const resolvedRouteId = router.resolvePath(route.routeId, subRouteId);
92
- const resolvedRoute = router.getRoute(resolvedRouteId);
93
- useRouterSubscription(router);
94
- index.invariant(resolvedRoute, "Could not find a route for route \"" + resolvedRouteId + "\"! Did you forget to add it to your route config?");
95
- return resolvedRoute;
96
- },
97
- linkProps: options => {
98
- var _functionalUpdate, _functionalUpdate2;
99
-
100
- const {
101
- // custom props
102
- target,
103
- activeProps = () => ({
104
- className: 'active'
105
- }),
106
- inactiveProps = () => ({}),
107
- disabled,
108
- // element props
109
- style,
110
- className,
111
- onClick,
112
- onFocus,
113
- onMouseEnter,
114
- onMouseLeave
115
- } = options,
116
- rest = _rollupPluginBabelHelpers.objectWithoutPropertiesLoose(options, _excluded);
117
-
118
- const linkInfo = route.buildLink(options);
119
-
120
- if (linkInfo.type === 'external') {
121
- const {
122
- href
123
- } = linkInfo;
124
- return {
125
- href
126
- };
127
- }
128
-
129
- const {
130
- handleClick,
131
- handleFocus,
132
- handleEnter,
133
- handleLeave,
134
- isActive,
135
- next
136
- } = linkInfo;
137
-
138
- const reactHandleClick = e => {
139
- if (React__namespace.startTransition) // This is a hack for react < 18
140
- React__namespace.startTransition(() => {
141
- handleClick(e);
142
- });else handleClick(e);
143
- };
144
-
145
- const composeHandlers = handlers => e => {
146
- e.persist();
147
- handlers.forEach(handler => {
148
- if (handler) handler(e);
149
- });
150
- }; // Get the active props
151
-
152
-
153
- const resolvedActiveProps = isActive ? (_functionalUpdate = index.functionalUpdate(activeProps, {})) != null ? _functionalUpdate : {} : {}; // Get the inactive props
154
-
155
- const resolvedInactiveProps = isActive ? {} : (_functionalUpdate2 = index.functionalUpdate(inactiveProps, {})) != null ? _functionalUpdate2 : {};
156
- return _rollupPluginBabelHelpers["extends"]({}, resolvedActiveProps, resolvedInactiveProps, rest, {
157
- href: disabled ? undefined : next.href,
158
- onClick: composeHandlers([reactHandleClick, onClick]),
159
- onFocus: composeHandlers([handleFocus, onFocus]),
160
- onMouseEnter: composeHandlers([handleEnter, onMouseEnter]),
161
- onMouseLeave: composeHandlers([handleLeave, onMouseLeave]),
162
- target,
163
- style: _rollupPluginBabelHelpers["extends"]({}, style, resolvedActiveProps.style, resolvedInactiveProps.style),
164
- className: [className, resolvedActiveProps.className, resolvedInactiveProps.className].filter(Boolean).join(' ') || undefined
165
- }, disabled ? {
166
- role: 'link',
167
- 'aria-disabled': true
168
- } : undefined, {
169
- ['data-status']: isActive ? 'active' : undefined
170
- });
171
- },
172
- Link: /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
173
- const linkProps = route.linkProps(props);
174
- useRouterSubscription(router);
175
- return /*#__PURE__*/React__namespace.createElement("a", _rollupPluginBabelHelpers["extends"]({
176
- ref: ref
177
- }, linkProps, {
178
- children: typeof props.children === 'function' ? props.children({
179
- isActive: linkProps['data-status'] === 'active'
180
- }) : props.children
181
- }));
182
- }),
183
- MatchRoute: opts => {
184
- const {
185
- pending,
186
- caseSensitive
187
- } = opts,
188
- rest = _rollupPluginBabelHelpers.objectWithoutPropertiesLoose(opts, _excluded2);
189
-
190
- const params = route.matchRoute(rest, {
191
- pending,
192
- caseSensitive
193
- });
194
-
195
- if (!params) {
196
- return null;
197
- }
198
-
199
- return typeof opts.children === 'function' ? opts.children(params) : opts.children;
200
- }
201
- };
202
- };
203
-
204
- const coreRouter = index.createRouter(_rollupPluginBabelHelpers["extends"]({}, opts, {
205
- createRouter: router => {
206
- const routerExt = {
207
- useState: () => {
208
- useRouterSubscription(router);
209
- return router.state;
210
- },
211
- useMatch: (routeId, opts) => {
212
- var _useMatches, _opts$strict;
213
-
214
- useRouterSubscription(router);
215
- index.invariant(routeId !== index.rootRouteId, "\"" + index.rootRouteId + "\" cannot be used with useMatch! Did you mean to useRoute(\"" + index.rootRouteId + "\")?");
216
- const runtimeMatch = (_useMatches = useMatches()) == null ? void 0 : _useMatches[0];
217
- const match = router.state.matches.find(d => d.routeId === routeId);
218
-
219
- if ((_opts$strict = opts == null ? void 0 : opts.strict) != null ? _opts$strict : true) {
220
- index.invariant(match, "Could not find an active match for \"" + routeId + "\"!");
221
- index.invariant(runtimeMatch.routeId == (match == null ? void 0 : match.routeId), "useMatch(\"" + (match == null ? void 0 : match.routeId) + "\") is being called in a component that is meant to render the '" + runtimeMatch.routeId + "' route. Did you mean to 'useMatch(\"" + (match == null ? void 0 : match.routeId) + "\", { strict: false })' or 'useRoute(\"" + (match == null ? void 0 : match.routeId) + "\")' instead?");
222
- }
223
-
224
- return match;
225
- }
226
- };
227
- const routeExt = makeRouteExt(router.getRoute(index.rootRouteId), router);
228
- Object.assign(router, routerExt, routeExt);
229
- },
230
- createRoute: _ref => {
231
- let {
232
- router,
233
- route
234
- } = _ref;
235
- const routeExt = makeRouteExt(route, router);
236
- Object.assign(route, routeExt);
237
- },
238
- loadComponent: async component => {
239
- if (component.preload && typeof document !== 'undefined') {
240
- component.preload(); // return await component.preload()
241
- }
242
-
243
- return component;
244
- }
245
- }));
246
- return coreRouter;
247
- }
248
- function RouterProvider(_ref2) {
249
- var _router$options$useCo;
250
-
251
- let {
252
- children,
253
- router
254
- } = _ref2,
255
- rest = _rollupPluginBabelHelpers.objectWithoutPropertiesLoose(_ref2, _excluded3);
256
-
257
- router.update(rest);
258
- const defaultRouterContext = React__namespace.useRef({});
259
- const userContext = (_router$options$useCo = router.options.useContext == null ? void 0 : router.options.useContext()) != null ? _router$options$useCo : defaultRouterContext.current;
260
- router.context = userContext;
261
- useRouterSubscription(router);
262
- React__namespace.useEffect(() => {
263
- return router.mount();
264
- }, [router]);
265
- return /*#__PURE__*/React__namespace.createElement(routerContext.Provider, {
266
- value: {
267
- router: router
268
- }
269
- }, /*#__PURE__*/React__namespace.createElement(MatchesProvider, {
270
- value: router.state.matches
271
- }, children != null ? children : /*#__PURE__*/React__namespace.createElement(Outlet, null)));
272
- }
273
- function useRouter() {
274
- const value = React__namespace.useContext(routerContext);
275
- index.warning(!value, 'useRouter must be used inside a <Router> component!');
276
- useRouterSubscription(value.router);
277
- return value.router;
278
- }
279
- function useMatches() {
280
- return React__namespace.useContext(matchesContext);
281
- }
282
- function useMatch(routeId, opts) {
283
- const router = useRouter();
284
- return router.useMatch(routeId, opts);
285
- }
286
- function useNearestMatch() {
287
- var _useMatches2;
288
-
289
- const runtimeMatch = (_useMatches2 = useMatches()) == null ? void 0 : _useMatches2[0];
290
- index.invariant(runtimeMatch, "Could not find a nearest match!");
291
- return runtimeMatch;
292
- }
293
- function useRoute(routeId) {
294
- const router = useRouter();
295
- return router.useRoute(routeId);
296
- }
297
- function useSearch(_routeId) {
298
- return useRouter().state.location.search;
299
- }
300
- function linkProps(props) {
301
- const router = useRouter();
302
- return router.linkProps(props);
303
- }
304
- function MatchRoute(props) {
305
- const router = useRouter();
306
- return /*#__PURE__*/React__namespace.createElement(router.MatchRoute, props);
307
- }
308
- function Outlet() {
309
- var _ref3, _match$__$pendingComp, _match$__$errorCompon;
310
-
311
- const router = useRouter();
312
- const matches = useMatches().slice(1);
313
- const match = matches[0];
314
- const defaultPending = React__namespace.useCallback(() => null, []);
315
-
316
- if (!match) {
317
- return null;
318
- }
319
-
320
- const PendingComponent = (_ref3 = (_match$__$pendingComp = match.__.pendingComponent) != null ? _match$__$pendingComp : router.options.defaultPendingComponent) != null ? _ref3 : defaultPending;
321
- const errorComponent = (_match$__$errorCompon = match.__.errorComponent) != null ? _match$__$errorCompon : router.options.defaultErrorComponent;
322
- return /*#__PURE__*/React__namespace.createElement(MatchesProvider, {
323
- value: matches
324
- }, /*#__PURE__*/React__namespace.createElement(React__namespace.Suspense, {
325
- fallback: /*#__PURE__*/React__namespace.createElement(PendingComponent, null)
326
- }, /*#__PURE__*/React__namespace.createElement(CatchBoundary, {
327
- errorComponent: errorComponent,
328
- key: match.routeId
329
- }, (() => {
330
- if (match.status === 'error') {
331
- throw match.error;
332
- }
333
-
334
- if (match.status === 'success') {
335
- var _ref4, _ref5;
336
-
337
- return /*#__PURE__*/React__namespace.createElement((_ref4 = (_ref5 = match.__.component) != null ? _ref5 : router.options.defaultComponent) != null ? _ref4 : Outlet);
338
- }
339
-
340
- throw match.__.loadPromise;
341
- })())));
342
- }
343
-
344
- class CatchBoundary extends React__namespace.Component {
345
- constructor() {
346
- super(...arguments);
347
- this.state = {
348
- error: false,
349
- info: undefined
350
- };
351
- }
352
-
353
- componentDidCatch(error, info) {
354
- console.error(error);
355
- this.setState({
356
- error,
357
- info
358
- });
359
- }
360
-
361
- render() {
362
- return /*#__PURE__*/React__namespace.createElement(CatchBoundaryInner, _rollupPluginBabelHelpers["extends"]({}, this.props, {
363
- errorState: this.state,
364
- reset: () => this.setState({})
365
- }));
366
- }
367
-
368
- } // This is the messiest thing ever... I'm either seriously tired (likely) or
369
- // there has to be a better way to reset error boundaries when the
370
- // router's location key changes.
371
-
372
-
373
- function CatchBoundaryInner(props) {
374
- var _props$errorComponent;
375
-
376
- const [activeErrorState, setActiveErrorState] = React__namespace.useState(props.errorState);
377
- const router = useRouter();
378
- const errorComponent = (_props$errorComponent = props.errorComponent) != null ? _props$errorComponent : DefaultErrorBoundary;
379
- React__namespace.useEffect(() => {
380
- if (activeErrorState) {
381
- let prevKey = router.state.location.key;
382
- return router.subscribe(() => {
383
- if (router.state.location.key !== prevKey) {
384
- prevKey = router.state.location.key;
385
- setActiveErrorState({});
386
- }
387
- });
388
- }
389
-
390
- return;
391
- }, [activeErrorState]);
392
- React__namespace.useEffect(() => {
393
- if (props.errorState.error) {
394
- setActiveErrorState(props.errorState);
395
- }
396
-
397
- props.reset();
398
- }, [props.errorState.error]);
399
-
400
- if (activeErrorState.error) {
401
- return /*#__PURE__*/React__namespace.createElement(errorComponent, activeErrorState);
402
- }
403
-
404
- return props.children;
405
- }
406
-
407
- function DefaultErrorBoundary(_ref6) {
408
- let {
409
- error
410
- } = _ref6;
411
- return /*#__PURE__*/React__namespace.createElement("div", {
412
- style: {
413
- padding: '.5rem',
414
- maxWidth: '100%'
415
- }
416
- }, /*#__PURE__*/React__namespace.createElement("strong", {
417
- style: {
418
- fontSize: '1.2rem'
419
- }
420
- }, "Something went wrong!"), /*#__PURE__*/React__namespace.createElement("div", {
421
- style: {
422
- height: '.5rem'
423
- }
424
- }), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("pre", null, error.message ? /*#__PURE__*/React__namespace.createElement("code", {
425
- style: {
426
- fontSize: '.7em',
427
- border: '1px solid red',
428
- borderRadius: '.25rem',
429
- padding: '.5rem',
430
- color: 'red'
431
- }
432
- }, error.message) : null)));
433
- }
434
- function usePrompt(message, when) {
435
- const router = useRouter();
436
- React__namespace.useEffect(() => {
437
- if (!when) return;
438
- let unblock = router.history.block(transition => {
439
- if (window.confirm(message)) {
440
- unblock();
441
- transition.retry();
442
- } else {
443
- router.location.pathname = window.location.pathname;
444
- }
445
- });
446
- return unblock;
447
- }, [when, location, message]);
448
- }
449
- function Prompt(_ref7) {
450
- let {
451
- message,
452
- when,
453
- children
454
- } = _ref7;
455
- usePrompt(message, when != null ? when : true);
456
- return children != null ? children : null;
457
- }
458
-
459
- exports.cleanPath = index.cleanPath;
460
- exports.createBrowserHistory = index.createBrowserHistory;
461
- exports.createHashHistory = index.createHashHistory;
462
- exports.createMemoryHistory = index.createMemoryHistory;
463
- exports.createRoute = index.createRoute;
464
- exports.createRouteConfig = index.createRouteConfig;
465
- exports.createRouteMatch = index.createRouteMatch;
466
- exports.createRouter = index.createRouter;
467
- exports.decode = index.decode;
468
- exports.defaultParseSearch = index.defaultParseSearch;
469
- exports.defaultStringifySearch = index.defaultStringifySearch;
470
- exports.encode = index.encode;
471
- exports.functionalUpdate = index.functionalUpdate;
472
- exports.interpolatePath = index.interpolatePath;
473
- exports.invariant = index.invariant;
474
- exports.joinPaths = index.joinPaths;
475
- exports.last = index.last;
476
- exports.matchByPath = index.matchByPath;
477
- exports.matchPathname = index.matchPathname;
478
- exports.parsePathname = index.parsePathname;
479
- exports.parseSearchWith = index.parseSearchWith;
480
- exports.pick = index.pick;
481
- exports.replaceEqualDeep = index.replaceEqualDeep;
482
- exports.resolvePath = index.resolvePath;
483
- exports.rootRouteId = index.rootRouteId;
484
- exports.stringifySearchWith = index.stringifySearchWith;
485
- exports.trimPath = index.trimPath;
486
- exports.trimPathLeft = index.trimPathLeft;
487
- exports.trimPathRight = index.trimPathRight;
488
- exports.warning = index.warning;
489
- exports.DefaultErrorBoundary = DefaultErrorBoundary;
490
- exports.Link = Link;
491
- exports.MatchRoute = MatchRoute;
492
- exports.MatchesProvider = MatchesProvider;
493
- exports.Outlet = Outlet;
494
- exports.Prompt = Prompt;
495
- exports.RouterProvider = RouterProvider;
496
- exports.createReactRouter = createReactRouter;
497
- exports.lazy = lazy;
498
- exports.linkProps = linkProps;
499
- exports.matchesContext = matchesContext;
500
- exports.routerContext = routerContext;
501
- exports.useMatch = useMatch;
502
- exports.useMatches = useMatches;
503
- exports.useNearestMatch = useNearestMatch;
504
- exports.usePrompt = usePrompt;
505
- exports.useRoute = useRoute;
506
- exports.useRouter = useRouter;
507
- exports.useSearch = useSearch;
508
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/index.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { useSyncExternalStore } from 'use-sync-external-store/shim'\n\nimport {\n AnyRoute,\n CheckId,\n rootRouteId,\n Route,\n RouterContext,\n RouterState,\n ToIdOption,\n} from '@tanstack/router-core'\nimport {\n warning,\n RouterOptions,\n RouteMatch,\n MatchRouteOptions,\n RouteConfig,\n AnyRouteConfig,\n AnyAllRouteInfo,\n DefaultAllRouteInfo,\n functionalUpdate,\n createRouter,\n AnyRouteInfo,\n AllRouteInfo,\n RouteInfo,\n ValidFromPath,\n LinkOptions,\n RouteInfoByPath,\n ResolveRelativePath,\n NoInfer,\n ToOptions,\n invariant,\n Router,\n} from '@tanstack/router-core'\nimport { restElement } from '@babel/types'\n\nexport * from '@tanstack/router-core'\n\nexport interface RegisterRouter {\n // router: Router\n}\n\nexport type RegisteredRouter = RegisterRouter extends {\n router: Router<infer TRouteConfig, infer TAllRouteInfo>\n}\n ? Router<TRouteConfig, TAllRouteInfo>\n : Router\n\nexport type RegisteredAllRouteInfo = RegisterRouter extends {\n router: Router<infer TRouteConfig, infer TAllRouteInfo>\n}\n ? TAllRouteInfo\n : AnyAllRouteInfo\n\nexport type SyncRouteComponent<TProps = {}> = (\n props: TProps,\n) => JSX.Element | React.ReactNode\n\nexport type RouteComponent<TProps = {}> = SyncRouteComponent<TProps> & {\n preload?: () => Promise<SyncRouteComponent<TProps>>\n}\n\nexport function lazy(\n importer: () => Promise<{ default: SyncRouteComponent }>,\n): RouteComponent {\n const lazyComp = React.lazy(importer as any)\n let promise: Promise<SyncRouteComponent>\n let resolvedComp: SyncRouteComponent\n\n const forwardedComp = React.forwardRef((props, ref) => {\n const resolvedCompRef = React.useRef(resolvedComp || lazyComp)\n return React.createElement(\n resolvedCompRef.current as any,\n { ...(ref ? { ref } : {}), ...props } as any,\n )\n })\n\n const finalComp = forwardedComp as unknown as RouteComponent\n\n finalComp.preload = () => {\n if (!promise) {\n promise = importer().then((module) => {\n resolvedComp = module.default\n return resolvedComp\n })\n }\n\n return promise\n }\n\n return finalComp\n}\n\ntype LinkPropsOptions<\n TAllRouteInfo extends AnyAllRouteInfo,\n TFrom extends ValidFromPath<TAllRouteInfo>,\n TTo extends string,\n> = LinkOptions<TAllRouteInfo, 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\ntype MakeMatchRouteOptions<\n TAllRouteInfo extends AnyAllRouteInfo,\n TFrom extends ValidFromPath<TAllRouteInfo>,\n TTo extends string,\n> = ToOptions<TAllRouteInfo, 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 | React.ReactNode\n | ((\n params: RouteInfoByPath<\n TAllRouteInfo,\n ResolveRelativePath<TFrom, NoInfer<TTo>>\n >['allParams'],\n ) => React.ReactNode)\n }\n\ntype MakeLinkPropsOptions<\n TAllRouteInfo extends AnyAllRouteInfo,\n TFrom extends ValidFromPath<TAllRouteInfo>,\n TTo extends string,\n> = LinkPropsOptions<TAllRouteInfo, TFrom, TTo> &\n React.AnchorHTMLAttributes<HTMLAnchorElement>\n\ntype MakeLinkOptions<\n TAllRouteInfo extends AnyAllRouteInfo,\n TFrom extends ValidFromPath<TAllRouteInfo>,\n TTo extends string,\n> = LinkPropsOptions<TAllRouteInfo, 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?:\n | React.ReactNode\n | ((state: { isActive: boolean }) => React.ReactNode)\n }\n\ndeclare module '@tanstack/router-core' {\n interface FrameworkGenerics {\n Component: RouteComponent\n ErrorComponent: RouteComponent<{\n error: unknown\n info: { componentStack: string }\n }>\n }\n\n interface RouterOptions<TRouteConfig extends AnyRouteConfig> {\n useContext?: () => RouterContext\n }\n\n interface Router<\n TRouteConfig extends AnyRouteConfig = RouteConfig,\n TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>,\n > {\n useState: () => RouterState\n useRoute: <TId extends keyof TAllRouteInfo['routeInfoById']>(\n routeId: TId,\n ) => Route<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TId]>\n useNearestMatch: () => RouteMatch<TAllRouteInfo, RouteInfo>\n useMatch: <\n TId extends keyof TAllRouteInfo['routeInfoById'],\n TStrict extends boolean = true,\n >(\n routeId: TId,\n opts?: { strict?: TStrict },\n ) => TStrict extends true\n ? RouteMatch<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TId]>\n :\n | RouteMatch<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TId]>\n | undefined\n linkProps: <TTo extends string = '.'>(\n props: MakeLinkPropsOptions<TAllRouteInfo, '/', TTo>,\n ) => React.AnchorHTMLAttributes<HTMLAnchorElement>\n Link: <TTo extends string = '.'>(\n props: MakeLinkOptions<TAllRouteInfo, '/', TTo>,\n ) => JSX.Element\n MatchRoute: <TTo extends string = '.'>(\n props: MakeMatchRouteOptions<TAllRouteInfo, '/', TTo>,\n ) => JSX.Element\n }\n\n interface Route<\n TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo,\n TRouteInfo extends AnyRouteInfo = RouteInfo,\n > {\n useRoute: <\n TTo extends string = '.',\n TResolved extends string = ResolveRelativePath<\n TRouteInfo['id'],\n NoInfer<TTo>\n >,\n >(\n routeId: CheckId<\n TAllRouteInfo,\n TResolved,\n ToIdOption<TAllRouteInfo, TRouteInfo['id'], TTo>\n >,\n opts?: { strict?: boolean },\n ) => Route<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TResolved]>\n linkProps: <TTo extends string = '.'>(\n props: MakeLinkPropsOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo>,\n ) => React.AnchorHTMLAttributes<HTMLAnchorElement>\n Link: <TTo extends string = '.'>(\n props: MakeLinkOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo>,\n ) => JSX.Element\n MatchRoute: <TTo extends string = '.'>(\n props: MakeMatchRouteOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo>,\n ) => JSX.Element\n }\n}\n\nexport type PromptProps = {\n message: string\n when?: boolean | any\n children?: React.ReactNode\n}\n\n//\n\nexport function Link<TTo extends string = '.'>(\n props: MakeLinkOptions<RegisteredAllRouteInfo, '/', TTo>,\n): JSX.Element {\n const router = useRouter()\n return <router.Link {...(props as any)} />\n}\n\nexport const matchesContext = React.createContext<RouteMatch[]>(null!)\nexport const routerContext = React.createContext<{ router: RegisteredRouter }>(\n null!,\n)\n\nexport type MatchesProviderProps = {\n value: RouteMatch[]\n children: React.ReactNode\n}\n\nexport function MatchesProvider(props: MatchesProviderProps) {\n return <matchesContext.Provider {...props} />\n}\n\nconst useRouterSubscription = (router: Router<any, any>) => {\n useSyncExternalStore(\n (cb) => router.subscribe(() => cb()),\n () => router.state,\n () => router.state,\n )\n}\n\nexport function createReactRouter<\n TRouteConfig extends AnyRouteConfig = RouteConfig,\n>(opts: RouterOptions<TRouteConfig>): Router<TRouteConfig> {\n const makeRouteExt = (\n route: AnyRoute,\n router: Router<any, any>,\n ): Pick<AnyRoute, 'useRoute' | 'linkProps' | 'Link' | 'MatchRoute'> => {\n return {\n useRoute: (subRouteId = '.' as any) => {\n const resolvedRouteId = router.resolvePath(\n route.routeId,\n subRouteId as string,\n )\n const resolvedRoute = router.getRoute(resolvedRouteId)\n useRouterSubscription(router)\n invariant(\n resolvedRoute,\n `Could not find a route for route \"${\n resolvedRouteId as string\n }\"! Did you forget to add it to your route config?`,\n )\n return resolvedRoute\n },\n linkProps: (options) => {\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 preloadMaxAge,\n replace,\n // element props\n style,\n className,\n onClick,\n onFocus,\n onMouseEnter,\n onMouseLeave,\n onTouchStart,\n onTouchEnd,\n ...rest\n } = options\n\n const linkInfo = route.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 isActive,\n next,\n } = linkInfo\n\n const reactHandleClick = (e: Event) => {\n if (React.startTransition) // This is a hack for react < 18\n React.startTransition(() => {handleClick(e)})\n else handleClick(e)\n }\n\n const composeHandlers =\n (handlers: (undefined | ((e: any) => void))[]) =>\n (e: React.SyntheticEvent) => {\n e.persist()\n handlers.forEach((handler) => {\n if (handler) handler(e)\n })\n }\n\n // Get the active props\n const resolvedActiveProps: React.HTMLAttributes<HTMLAnchorElement> =\n isActive ? functionalUpdate(activeProps, {}) ?? {} : {}\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([reactHandleClick, onClick]),\n onFocus: composeHandlers([handleFocus, onFocus]),\n onMouseEnter: composeHandlers([handleEnter, onMouseEnter]),\n onMouseLeave: composeHandlers([handleLeave, onMouseLeave]),\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 Link: React.forwardRef((props: any, ref) => {\n const linkProps = route.linkProps(props)\n\n useRouterSubscription(router)\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 MatchRoute: (opts) => {\n const { pending, caseSensitive, children, ...rest } = opts\n\n const params = route.matchRoute(rest as any, {\n pending,\n caseSensitive,\n })\n\n if (!params) {\n return null\n }\n\n return typeof opts.children === 'function'\n ? opts.children(params as any)\n : (opts.children as any)\n },\n }\n }\n\n const coreRouter = createRouter<TRouteConfig>({\n ...opts,\n createRouter: (router) => {\n const routerExt: Pick<Router<any, any>, 'useMatch' | 'useState'> = {\n useState: () => {\n useRouterSubscription(router)\n return router.state\n },\n useMatch: (routeId, opts) => {\n useRouterSubscription(router)\n\n invariant(\n routeId !== rootRouteId,\n `\"${rootRouteId}\" cannot be used with useMatch! Did you mean to useRoute(\"${rootRouteId}\")?`,\n )\n\n const runtimeMatch = useMatches()?.[0]!\n const match = router.state.matches.find((d) => d.routeId === routeId)\n\n if (opts?.strict ?? true) {\n invariant(\n match,\n `Could not find an active match for \"${routeId as string}\"!`,\n )\n\n invariant(\n runtimeMatch.routeId == match?.routeId,\n `useMatch(\"${\n match?.routeId as string\n }\") is being called in a component that is meant to render the '${\n runtimeMatch.routeId\n }' route. Did you mean to 'useMatch(\"${\n match?.routeId as string\n }\", { strict: false })' or 'useRoute(\"${\n match?.routeId as string\n }\")' instead?`,\n )\n }\n\n return match as any\n },\n }\n\n const routeExt = makeRouteExt(router.getRoute(rootRouteId), router)\n\n Object.assign(router, routerExt, routeExt)\n },\n createRoute: ({ router, route }) => {\n const routeExt = makeRouteExt(route, router)\n\n Object.assign(route, routeExt)\n },\n loadComponent: async (component) => {\n if (component.preload && typeof document !== 'undefined') {\n component.preload()\n // return await component.preload()\n }\n\n return component as any\n },\n })\n\n return coreRouter as any\n}\n\nexport type RouterProps<\n TRouteConfig extends AnyRouteConfig = RouteConfig,\n TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo,\n> = RouterOptions<TRouteConfig> & {\n router: Router<TRouteConfig, TAllRouteInfo>\n // Children will default to `<Outlet />` if not provided\n children?: React.ReactNode\n}\n\nexport function RouterProvider<\n TRouteConfig extends AnyRouteConfig = RouteConfig,\n TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo,\n>({ children, router, ...rest }: RouterProps<TRouteConfig, TAllRouteInfo>) {\n router.update(rest)\n\n const defaultRouterContext = React.useRef({})\n\n const userContext =\n router.options.useContext?.() ?? defaultRouterContext.current\n\n router.context = userContext\n\n useRouterSubscription(router)\n React.useEffect(() => {\n return router.mount()\n }, [router])\n\n return (\n <routerContext.Provider value={{ router: router as any }}>\n <MatchesProvider value={router.state.matches}>\n {children ?? <Outlet />}\n </MatchesProvider>\n </routerContext.Provider>\n )\n}\n\nexport function useRouter(): RegisteredRouter {\n const value = React.useContext(routerContext)\n warning(!value, 'useRouter must be used inside a <Router> component!')\n\n useRouterSubscription(value.router)\n\n return value.router\n}\n\nexport function useMatches(): RouteMatch[] {\n return React.useContext(matchesContext)\n}\n\nexport function useMatch<\n TId extends keyof RegisteredAllRouteInfo['routeInfoById'],\n TStrict extends boolean = true,\n>(\n routeId: TId,\n opts?: { strict?: TStrict },\n): TStrict extends true\n ? RouteMatch<\n RegisteredAllRouteInfo,\n RegisteredAllRouteInfo['routeInfoById'][TId]\n >\n :\n | RouteMatch<\n RegisteredAllRouteInfo,\n RegisteredAllRouteInfo['routeInfoById'][TId]\n >\n | undefined {\n const router = useRouter()\n return router.useMatch(routeId as any, opts) as any\n}\n\nexport function useNearestMatch(): RouteMatch<\n RegisteredAllRouteInfo,\n RouteInfo\n> {\n const runtimeMatch = useMatches()?.[0]!\n\n invariant(runtimeMatch, `Could not find a nearest match!`)\n\n return runtimeMatch as any\n}\n\nexport function useRoute<\n TId extends keyof RegisteredAllRouteInfo['routeInfoById'],\n>(\n routeId: TId,\n): Route<RegisteredAllRouteInfo, RegisteredAllRouteInfo['routeInfoById'][TId]> {\n const router = useRouter()\n return router.useRoute(routeId as any) as any\n}\n\nexport function useSearch<\n TId extends keyof RegisteredAllRouteInfo['routeInfoById'] = keyof RegisteredAllRouteInfo['routeInfoById'],\n>(_routeId?: TId): RegisteredAllRouteInfo['fullSearchSchema'] {\n return useRouter().state.location.search\n}\n\nexport function linkProps<TTo extends string = '.'>(\n props: MakeLinkPropsOptions<RegisteredAllRouteInfo, '/', TTo>,\n): React.AnchorHTMLAttributes<HTMLAnchorElement> {\n const router = useRouter()\n return router.linkProps(props as any)\n}\n\nexport function MatchRoute<TTo extends string = '.'>(\n props: MakeMatchRouteOptions<RegisteredAllRouteInfo, '/', TTo>,\n): JSX.Element {\n const router = useRouter()\n return React.createElement(router.MatchRoute, props as any)\n}\n\nexport function Outlet() {\n const router = useRouter()\n const matches = useMatches().slice(1)\n const match = matches[0]\n\n const defaultPending = React.useCallback(() => null, [])\n\n if (!match) {\n return null\n }\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 return (\n <MatchesProvider value={matches}>\n <React.Suspense fallback={<PendingComponent />}>\n <CatchBoundary errorComponent={errorComponent} key={match.routeId}>\n {\n ((): React.ReactNode => {\n if (match.status === 'error') {\n throw match.error\n }\n\n if (match.status === 'success') {\n return React.createElement(\n (match.__.component as any) ??\n router.options.defaultComponent ??\n Outlet,\n )\n }\n throw match.__.loadPromise\n })() as JSX.Element\n }\n </CatchBoundary>\n </React.Suspense>\n </MatchesProvider>\n )\n}\n\nclass CatchBoundary extends React.Component<{\n children: any\n errorComponent: any\n}> {\n state = {\n error: false,\n info: undefined,\n }\n\n componentDidCatch(error: any, info: any) {\n console.error(error)\n\n this.setState({\n error,\n info,\n })\n }\n\n render() {\n return (\n <CatchBoundaryInner\n {...this.props}\n errorState={this.state}\n reset={() => this.setState({})}\n />\n )\n }\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.\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 = useRouter()\n const errorComponent = props.errorComponent ?? DefaultErrorBoundary\n\n React.useEffect(() => {\n if (activeErrorState) {\n let prevKey = router.state.location.key\n return router.subscribe(() => {\n if (router.state.location.key !== prevKey) {\n prevKey = router.state.location.key\n setActiveErrorState({} as any)\n }\n })\n }\n\n return\n }, [activeErrorState])\n\n React.useEffect(() => {\n if (props.errorState.error) {\n setActiveErrorState(props.errorState)\n }\n props.reset()\n }, [props.errorState.error])\n\n if (activeErrorState.error) {\n return React.createElement(errorComponent, activeErrorState)\n }\n\n return props.children\n}\n\nexport function DefaultErrorBoundary({ 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 {error.message ? (\n <code\n style={{\n fontSize: '.7em',\n border: '1px solid red',\n borderRadius: '.25rem',\n padding: '.5rem',\n color: 'red',\n }}\n >\n {error.message}\n </code>\n ) : null}\n </pre>\n </div>\n </div>\n )\n}\n\nexport function usePrompt(message: string, when: boolean | any): void {\n const router = useRouter()\n\n React.useEffect(() => {\n if (!when) return\n\n let unblock = router.history.block((transition) => {\n if (window.confirm(message)) {\n unblock()\n transition.retry()\n } else {\n router.location.pathname = window.location.pathname\n }\n })\n\n return unblock\n }, [when, location, message])\n}\n\nexport function Prompt({ message, when, children }: PromptProps) {\n usePrompt(message, when ?? true)\n return (children ?? null) as React.ReactNode\n}\n"],"names":["lazy","importer","lazyComp","React","promise","resolvedComp","forwardedComp","forwardRef","props","ref","resolvedCompRef","useRef","createElement","current","finalComp","preload","then","module","default","Link","router","useRouter","matchesContext","createContext","routerContext","MatchesProvider","useRouterSubscription","useSyncExternalStore","cb","subscribe","state","createReactRouter","opts","makeRouteExt","route","useRoute","subRouteId","resolvedRouteId","resolvePath","routeId","resolvedRoute","getRoute","invariant","linkProps","options","target","activeProps","className","inactiveProps","disabled","style","onClick","onFocus","onMouseEnter","onMouseLeave","rest","linkInfo","buildLink","type","href","handleClick","handleFocus","handleEnter","handleLeave","isActive","next","reactHandleClick","e","startTransition","composeHandlers","handlers","persist","forEach","handler","resolvedActiveProps","functionalUpdate","resolvedInactiveProps","_extends","undefined","filter","Boolean","join","role","children","MatchRoute","pending","caseSensitive","params","matchRoute","coreRouter","createRouter","routerExt","useState","useMatch","rootRouteId","runtimeMatch","useMatches","match","matches","find","d","strict","routeExt","Object","assign","createRoute","loadComponent","component","document","RouterProvider","_objectWithoutPropertiesLoose","update","defaultRouterContext","userContext","useContext","context","useEffect","mount","value","warning","useNearestMatch","useSearch","_routeId","location","search","Outlet","slice","defaultPending","useCallback","PendingComponent","__","pendingComponent","defaultPendingComponent","errorComponent","defaultErrorComponent","status","error","defaultComponent","loadPromise","CatchBoundary","Component","info","componentDidCatch","console","setState","render","CatchBoundaryInner","activeErrorState","setActiveErrorState","errorState","DefaultErrorBoundary","prevKey","key","reset","padding","maxWidth","fontSize","height","message","border","borderRadius","color","usePrompt","when","unblock","history","block","transition","window","confirm","retry","pathname","Prompt"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEO,SAASA,IAAT,CACLC,QADK,EAEW;AAChB,EAAA,MAAMC,QAAQ,gBAAGC,gBAAK,CAACH,IAAN,CAAWC,QAAX,CAAjB,CAAA;AACA,EAAA,IAAIG,OAAJ,CAAA;AACA,EAAA,IAAIC,YAAJ,CAAA;EAEA,MAAMC,aAAa,gBAAGH,gBAAK,CAACI,UAAN,CAAiB,CAACC,KAAD,EAAQC,GAAR,KAAgB;IACrD,MAAMC,eAAe,GAAGP,gBAAK,CAACQ,MAAN,CAAaN,YAAY,IAAIH,QAA7B,CAAxB,CAAA;IACA,oBAAOC,gBAAK,CAACS,aAAN,CACLF,eAAe,CAACG,OADX,EAECJ,oCAAAA,CAAAA,EAAAA,EAAAA,GAAG,GAAG;AAAEA,MAAAA,GAAAA;AAAF,KAAH,GAAa,EAFjB,EAEyBD,KAFzB,CAAP,CAAA,CAAA;AAID,GANqB,CAAtB,CAAA;EAQA,MAAMM,SAAS,GAAGR,aAAlB,CAAA;;EAEAQ,SAAS,CAACC,OAAV,GAAoB,MAAM;IACxB,IAAI,CAACX,OAAL,EAAc;AACZA,MAAAA,OAAO,GAAGH,QAAQ,EAAA,CAAGe,IAAX,CAAiBC,MAAD,IAAY;QACpCZ,YAAY,GAAGY,MAAM,CAACC,OAAtB,CAAA;AACA,QAAA,OAAOb,YAAP,CAAA;AACD,OAHS,CAAV,CAAA;AAID,KAAA;;AAED,IAAA,OAAOD,OAAP,CAAA;GARF,CAAA;;AAWA,EAAA,OAAOU,SAAP,CAAA;AACD,C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