react-router 7.9.1 → 7.9.2-pre.1
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/CHANGELOG.md +25 -9
- package/dist/development/{chunk-B7RQU5TL.mjs → chunk-I4PRIPRX.mjs} +178 -26
- package/dist/{production/chunk-RCAZODXZ.mjs → development/chunk-ITFVGECV.mjs} +155 -65
- package/dist/development/{chunk-PW3F6ATG.js → chunk-MVCD4EFU.js} +102 -70
- package/dist/{production/chunk-3SXVZXGI.js → development/chunk-XCFBICS6.js} +277 -157
- package/dist/development/{context-CIdFp11b.d.mts → context-BqL5Eckq.d.mts} +20 -0
- package/dist/development/dom-export.d.mts +1 -1
- package/dist/development/dom-export.js +3 -3
- package/dist/development/dom-export.mjs +3 -3
- package/dist/development/{index-react-server-client-BeVfPpWg.d.mts → index-react-server-client-2EDmGlsZ.d.mts} +40 -24
- package/dist/{production/index-react-server-client-BYr9g50r.d.ts → development/index-react-server-client-DKvU8YRr.d.ts} +39 -23
- package/dist/development/index-react-server-client.d.mts +3 -3
- package/dist/development/index-react-server-client.d.ts +2 -2
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.d.mts +10 -0
- package/dist/development/index-react-server.d.ts +10 -0
- package/dist/development/index-react-server.js +3 -3
- package/dist/development/index-react-server.mjs +3 -3
- package/dist/development/index.d.mts +16 -12
- package/dist/development/index.d.ts +14 -10
- package/dist/development/index.js +250 -160
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.d.mts +2 -2
- package/dist/development/lib/types/internal.d.ts +1 -1
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{route-data-Bpm4liR_.d.mts → route-data-CDwqkzPE.d.mts} +1 -1
- package/dist/{production/routeModules-DnUHijGz.d.ts → development/routeModules-BmVo7q9e.d.ts} +20 -0
- package/dist/production/{chunk-HMYSPRGR.js → chunk-4FAGWJMT.js} +102 -70
- package/dist/{development/chunk-LWNHKVDL.js → production/chunk-MKNSEQLS.js} +277 -157
- package/dist/{development/chunk-SKNKB5VI.mjs → production/chunk-RXSRHQUT.mjs} +155 -65
- package/dist/production/{chunk-P25HWPOZ.mjs → chunk-SKKC22F5.mjs} +178 -26
- package/dist/production/{context-CIdFp11b.d.mts → context-BqL5Eckq.d.mts} +20 -0
- package/dist/production/dom-export.d.mts +1 -1
- package/dist/production/dom-export.js +3 -3
- package/dist/production/dom-export.mjs +3 -3
- package/dist/production/{index-react-server-client-BeVfPpWg.d.mts → index-react-server-client-2EDmGlsZ.d.mts} +40 -24
- package/dist/{development/index-react-server-client-BYr9g50r.d.ts → production/index-react-server-client-DKvU8YRr.d.ts} +39 -23
- package/dist/production/index-react-server-client.d.mts +3 -3
- package/dist/production/index-react-server-client.d.ts +2 -2
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.d.mts +10 -0
- package/dist/production/index-react-server.d.ts +10 -0
- package/dist/production/index-react-server.js +3 -3
- package/dist/production/index-react-server.mjs +3 -3
- package/dist/production/index.d.mts +16 -12
- package/dist/production/index.d.ts +14 -10
- package/dist/production/index.js +250 -160
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.d.mts +2 -2
- package/dist/production/lib/types/internal.d.ts +1 -1
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{route-data-Bpm4liR_.d.mts → route-data-CDwqkzPE.d.mts} +1 -1
- package/dist/{development/routeModules-DnUHijGz.d.ts → production/routeModules-BmVo7q9e.d.ts} +20 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
2
|
-
* react-router v7.9.1
|
|
2
|
+
* react-router v7.9.2-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
var
|
|
64
|
+
var _chunkMVCD4EFUjs = require('./chunk-MVCD4EFU.js');
|
|
65
65
|
|
|
66
66
|
// lib/components.tsx
|
|
67
67
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react);
|
|
@@ -72,9 +72,9 @@ function mapRouteProperties(route) {
|
|
|
72
72
|
hasErrorBoundary: route.hasErrorBoundary || route.ErrorBoundary != null || route.errorElement != null
|
|
73
73
|
};
|
|
74
74
|
if (route.Component) {
|
|
75
|
-
if (
|
|
75
|
+
if (_chunkMVCD4EFUjs.ENABLE_DEV_WARNINGS) {
|
|
76
76
|
if (route.element) {
|
|
77
|
-
|
|
77
|
+
_chunkMVCD4EFUjs.warning.call(void 0,
|
|
78
78
|
false,
|
|
79
79
|
"You should not include both `Component` and `element` on your route - `Component` will be used."
|
|
80
80
|
);
|
|
@@ -86,9 +86,9 @@ function mapRouteProperties(route) {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
if (route.HydrateFallback) {
|
|
89
|
-
if (
|
|
89
|
+
if (_chunkMVCD4EFUjs.ENABLE_DEV_WARNINGS) {
|
|
90
90
|
if (route.hydrateFallbackElement) {
|
|
91
|
-
|
|
91
|
+
_chunkMVCD4EFUjs.warning.call(void 0,
|
|
92
92
|
false,
|
|
93
93
|
"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."
|
|
94
94
|
);
|
|
@@ -100,9 +100,9 @@ function mapRouteProperties(route) {
|
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
if (route.ErrorBoundary) {
|
|
103
|
-
if (
|
|
103
|
+
if (_chunkMVCD4EFUjs.ENABLE_DEV_WARNINGS) {
|
|
104
104
|
if (route.errorElement) {
|
|
105
|
-
|
|
105
|
+
_chunkMVCD4EFUjs.warning.call(void 0,
|
|
106
106
|
false,
|
|
107
107
|
"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."
|
|
108
108
|
);
|
|
@@ -120,11 +120,11 @@ var hydrationRouteProperties = [
|
|
|
120
120
|
"hydrateFallbackElement"
|
|
121
121
|
];
|
|
122
122
|
function createMemoryRouter(routes, opts) {
|
|
123
|
-
return
|
|
123
|
+
return _chunkMVCD4EFUjs.createRouter.call(void 0, {
|
|
124
124
|
basename: _optionalChain([opts, 'optionalAccess', _2 => _2.basename]),
|
|
125
125
|
getContext: _optionalChain([opts, 'optionalAccess', _3 => _3.getContext]),
|
|
126
126
|
future: _optionalChain([opts, 'optionalAccess', _4 => _4.future]),
|
|
127
|
-
history:
|
|
127
|
+
history: _chunkMVCD4EFUjs.createMemoryHistory.call(void 0, {
|
|
128
128
|
initialEntries: _optionalChain([opts, 'optionalAccess', _5 => _5.initialEntries]),
|
|
129
129
|
initialIndex: _optionalChain([opts, 'optionalAccess', _6 => _6.initialIndex])
|
|
130
130
|
}),
|
|
@@ -155,6 +155,119 @@ var Deferred = class {
|
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
|
+
function shallowDiff(a, b) {
|
|
159
|
+
if (a === b) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
let aKeys = Object.keys(a);
|
|
163
|
+
let bKeys = Object.keys(b);
|
|
164
|
+
if (aKeys.length !== bKeys.length) {
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
for (let key of aKeys) {
|
|
168
|
+
if (a[key] !== b[key]) {
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
function UNSTABLE_TransitionEnabledRouterProvider({
|
|
175
|
+
router,
|
|
176
|
+
flushSync: reactDomFlushSyncImpl,
|
|
177
|
+
unstable_onError
|
|
178
|
+
}) {
|
|
179
|
+
let fetcherData = React.useRef(/* @__PURE__ */ new Map());
|
|
180
|
+
let [revalidating, startRevalidation] = React.useTransition();
|
|
181
|
+
let [state, setState] = React.useState(router.state);
|
|
182
|
+
router.__setPendingRerender = (promise) => startRevalidation(
|
|
183
|
+
// @ts-expect-error - need react 19 types for this to be async
|
|
184
|
+
async () => {
|
|
185
|
+
const rerender = await promise;
|
|
186
|
+
startRevalidation(() => {
|
|
187
|
+
rerender();
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
let navigator = React.useMemo(() => {
|
|
192
|
+
return {
|
|
193
|
+
createHref: router.createHref,
|
|
194
|
+
encodeLocation: router.encodeLocation,
|
|
195
|
+
go: (n) => router.navigate(n),
|
|
196
|
+
push: (to, state2, opts) => router.navigate(to, {
|
|
197
|
+
state: state2,
|
|
198
|
+
preventScrollReset: _optionalChain([opts, 'optionalAccess', _10 => _10.preventScrollReset])
|
|
199
|
+
}),
|
|
200
|
+
replace: (to, state2, opts) => router.navigate(to, {
|
|
201
|
+
replace: true,
|
|
202
|
+
state: state2,
|
|
203
|
+
preventScrollReset: _optionalChain([opts, 'optionalAccess', _11 => _11.preventScrollReset])
|
|
204
|
+
})
|
|
205
|
+
};
|
|
206
|
+
}, [router]);
|
|
207
|
+
let basename = router.basename || "/";
|
|
208
|
+
let dataRouterContext = React.useMemo(
|
|
209
|
+
() => ({
|
|
210
|
+
router,
|
|
211
|
+
navigator,
|
|
212
|
+
static: false,
|
|
213
|
+
basename,
|
|
214
|
+
unstable_onError
|
|
215
|
+
}),
|
|
216
|
+
[router, navigator, basename, unstable_onError]
|
|
217
|
+
);
|
|
218
|
+
React.useLayoutEffect(() => {
|
|
219
|
+
return router.subscribe(
|
|
220
|
+
(newState, { deletedFetchers, flushSync, viewTransitionOpts }) => {
|
|
221
|
+
newState.fetchers.forEach((fetcher, key) => {
|
|
222
|
+
if (fetcher.data !== void 0) {
|
|
223
|
+
fetcherData.current.set(key, fetcher.data);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
deletedFetchers.forEach((key) => fetcherData.current.delete(key));
|
|
227
|
+
const diff = shallowDiff(state, newState);
|
|
228
|
+
if (!diff) return;
|
|
229
|
+
if (flushSync) {
|
|
230
|
+
if (reactDomFlushSyncImpl) {
|
|
231
|
+
reactDomFlushSyncImpl(() => setState(newState));
|
|
232
|
+
} else {
|
|
233
|
+
setState(newState);
|
|
234
|
+
}
|
|
235
|
+
} else {
|
|
236
|
+
React.startTransition(() => {
|
|
237
|
+
setState(newState);
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
}, [router, reactDomFlushSyncImpl, state]);
|
|
243
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(_chunkMVCD4EFUjs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React.createElement(
|
|
244
|
+
_chunkMVCD4EFUjs.DataRouterStateContext.Provider,
|
|
245
|
+
{
|
|
246
|
+
value: {
|
|
247
|
+
...state,
|
|
248
|
+
revalidation: revalidating ? "loading" : state.revalidation
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
/* @__PURE__ */ React.createElement(_chunkMVCD4EFUjs.FetchersContext.Provider, { value: fetcherData.current }, /* @__PURE__ */ React.createElement(
|
|
252
|
+
Router,
|
|
253
|
+
{
|
|
254
|
+
basename,
|
|
255
|
+
location: state.location,
|
|
256
|
+
navigationType: state.historyAction,
|
|
257
|
+
navigator
|
|
258
|
+
},
|
|
259
|
+
/* @__PURE__ */ React.createElement(
|
|
260
|
+
MemoizedDataRoutes,
|
|
261
|
+
{
|
|
262
|
+
routes: router.routes,
|
|
263
|
+
future: router.future,
|
|
264
|
+
state,
|
|
265
|
+
unstable_onError
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
))
|
|
269
|
+
)), null);
|
|
270
|
+
}
|
|
158
271
|
function RouterProvider({
|
|
159
272
|
router,
|
|
160
273
|
flushSync: reactDomFlushSyncImpl,
|
|
@@ -174,7 +287,7 @@ function RouterProvider({
|
|
|
174
287
|
setStateImpl((prevState) => {
|
|
175
288
|
if (newState.errors && unstable_onError) {
|
|
176
289
|
Object.entries(newState.errors).forEach(([routeId, error]) => {
|
|
177
|
-
if (_optionalChain([prevState, 'access',
|
|
290
|
+
if (_optionalChain([prevState, 'access', _12 => _12.errors, 'optionalAccess', _13 => _13[routeId]]) !== error) {
|
|
178
291
|
unstable_onError(error);
|
|
179
292
|
}
|
|
180
293
|
});
|
|
@@ -192,12 +305,12 @@ function RouterProvider({
|
|
|
192
305
|
}
|
|
193
306
|
});
|
|
194
307
|
deletedFetchers.forEach((key) => fetcherData.current.delete(key));
|
|
195
|
-
|
|
308
|
+
_chunkMVCD4EFUjs.warnOnce.call(void 0,
|
|
196
309
|
flushSync === false || reactDomFlushSyncImpl != null,
|
|
197
310
|
'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.'
|
|
198
311
|
);
|
|
199
312
|
let isViewTransitionAvailable = router.window != null && router.window.document != null && typeof router.window.document.startViewTransition === "function";
|
|
200
|
-
|
|
313
|
+
_chunkMVCD4EFUjs.warnOnce.call(void 0,
|
|
201
314
|
viewTransitionOpts == null || isViewTransitionAvailable,
|
|
202
315
|
"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."
|
|
203
316
|
);
|
|
@@ -309,12 +422,12 @@ function RouterProvider({
|
|
|
309
422
|
go: (n) => router.navigate(n),
|
|
310
423
|
push: (to, state2, opts) => router.navigate(to, {
|
|
311
424
|
state: state2,
|
|
312
|
-
preventScrollReset: _optionalChain([opts, 'optionalAccess',
|
|
425
|
+
preventScrollReset: _optionalChain([opts, 'optionalAccess', _14 => _14.preventScrollReset])
|
|
313
426
|
}),
|
|
314
427
|
replace: (to, state2, opts) => router.navigate(to, {
|
|
315
428
|
replace: true,
|
|
316
429
|
state: state2,
|
|
317
|
-
preventScrollReset: _optionalChain([opts, 'optionalAccess',
|
|
430
|
+
preventScrollReset: _optionalChain([opts, 'optionalAccess', _15 => _15.preventScrollReset])
|
|
318
431
|
})
|
|
319
432
|
};
|
|
320
433
|
}, [router]);
|
|
@@ -329,7 +442,7 @@ function RouterProvider({
|
|
|
329
442
|
}),
|
|
330
443
|
[router, navigator, basename, unstable_onError]
|
|
331
444
|
);
|
|
332
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
445
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(_chunkMVCD4EFUjs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React.createElement(_chunkMVCD4EFUjs.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React.createElement(_chunkMVCD4EFUjs.FetchersContext.Provider, { value: fetcherData.current }, /* @__PURE__ */ React.createElement(_chunkMVCD4EFUjs.ViewTransitionContext.Provider, { value: vtContext }, /* @__PURE__ */ React.createElement(
|
|
333
446
|
Router,
|
|
334
447
|
{
|
|
335
448
|
basename,
|
|
@@ -355,7 +468,7 @@ function DataRoutes({
|
|
|
355
468
|
state,
|
|
356
469
|
unstable_onError
|
|
357
470
|
}) {
|
|
358
|
-
return
|
|
471
|
+
return _chunkMVCD4EFUjs.useRoutesImpl.call(void 0, routes, void 0, state, unstable_onError, future);
|
|
359
472
|
}
|
|
360
473
|
function MemoryRouter({
|
|
361
474
|
basename,
|
|
@@ -365,7 +478,7 @@ function MemoryRouter({
|
|
|
365
478
|
}) {
|
|
366
479
|
let historyRef = React.useRef();
|
|
367
480
|
if (historyRef.current == null) {
|
|
368
|
-
historyRef.current =
|
|
481
|
+
historyRef.current = _chunkMVCD4EFUjs.createMemoryHistory.call(void 0, {
|
|
369
482
|
initialEntries,
|
|
370
483
|
initialIndex,
|
|
371
484
|
v5Compat: true
|
|
@@ -400,23 +513,23 @@ function Navigate({
|
|
|
400
513
|
state,
|
|
401
514
|
relative
|
|
402
515
|
}) {
|
|
403
|
-
|
|
404
|
-
|
|
516
|
+
_chunkMVCD4EFUjs.invariant.call(void 0,
|
|
517
|
+
_chunkMVCD4EFUjs.useInRouterContext.call(void 0, ),
|
|
405
518
|
// TODO: This error is probably because they somehow have 2 versions of
|
|
406
519
|
// the router loaded. We can help them understand how to avoid that.
|
|
407
520
|
`<Navigate> may be used only in the context of a <Router> component.`
|
|
408
521
|
);
|
|
409
|
-
let { static: isStatic } = React.useContext(
|
|
410
|
-
|
|
522
|
+
let { static: isStatic } = React.useContext(_chunkMVCD4EFUjs.NavigationContext);
|
|
523
|
+
_chunkMVCD4EFUjs.warning.call(void 0,
|
|
411
524
|
!isStatic,
|
|
412
525
|
`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`
|
|
413
526
|
);
|
|
414
|
-
let { matches } = React.useContext(
|
|
415
|
-
let { pathname: locationPathname } =
|
|
416
|
-
let navigate =
|
|
417
|
-
let path =
|
|
527
|
+
let { matches } = React.useContext(_chunkMVCD4EFUjs.RouteContext);
|
|
528
|
+
let { pathname: locationPathname } = _chunkMVCD4EFUjs.useLocation.call(void 0, );
|
|
529
|
+
let navigate = _chunkMVCD4EFUjs.useNavigate.call(void 0, );
|
|
530
|
+
let path = _chunkMVCD4EFUjs.resolveTo.call(void 0,
|
|
418
531
|
to,
|
|
419
|
-
|
|
532
|
+
_chunkMVCD4EFUjs.getResolveToMatches.call(void 0, matches),
|
|
420
533
|
locationPathname,
|
|
421
534
|
relative === "path"
|
|
422
535
|
);
|
|
@@ -427,10 +540,10 @@ function Navigate({
|
|
|
427
540
|
return null;
|
|
428
541
|
}
|
|
429
542
|
function Outlet(props) {
|
|
430
|
-
return
|
|
543
|
+
return _chunkMVCD4EFUjs.useOutlet.call(void 0, props.context);
|
|
431
544
|
}
|
|
432
545
|
function Route(props) {
|
|
433
|
-
|
|
546
|
+
_chunkMVCD4EFUjs.invariant.call(void 0,
|
|
434
547
|
false,
|
|
435
548
|
`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`
|
|
436
549
|
);
|
|
@@ -443,8 +556,8 @@ function Router({
|
|
|
443
556
|
navigator,
|
|
444
557
|
static: staticProp = false
|
|
445
558
|
}) {
|
|
446
|
-
|
|
447
|
-
!
|
|
559
|
+
_chunkMVCD4EFUjs.invariant.call(void 0,
|
|
560
|
+
!_chunkMVCD4EFUjs.useInRouterContext.call(void 0, ),
|
|
448
561
|
`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`
|
|
449
562
|
);
|
|
450
563
|
let basename = basenameProp.replace(/^\/*/, "/");
|
|
@@ -458,7 +571,7 @@ function Router({
|
|
|
458
571
|
[basename, navigator, staticProp]
|
|
459
572
|
);
|
|
460
573
|
if (typeof locationProp === "string") {
|
|
461
|
-
locationProp =
|
|
574
|
+
locationProp = _chunkMVCD4EFUjs.parsePath.call(void 0, locationProp);
|
|
462
575
|
}
|
|
463
576
|
let {
|
|
464
577
|
pathname = "/",
|
|
@@ -468,7 +581,7 @@ function Router({
|
|
|
468
581
|
key = "default"
|
|
469
582
|
} = locationProp;
|
|
470
583
|
let locationContext = React.useMemo(() => {
|
|
471
|
-
let trailingPathname =
|
|
584
|
+
let trailingPathname = _chunkMVCD4EFUjs.stripBasename.call(void 0, pathname, basename);
|
|
472
585
|
if (trailingPathname == null) {
|
|
473
586
|
return null;
|
|
474
587
|
}
|
|
@@ -483,33 +596,33 @@ function Router({
|
|
|
483
596
|
navigationType
|
|
484
597
|
};
|
|
485
598
|
}, [basename, pathname, search, hash, state, key, navigationType]);
|
|
486
|
-
|
|
599
|
+
_chunkMVCD4EFUjs.warning.call(void 0,
|
|
487
600
|
locationContext != null,
|
|
488
601
|
`<Router basename="${basename}"> is not able to match the URL "${pathname}${search}${hash}" because it does not start with the basename, so the <Router> won't render anything.`
|
|
489
602
|
);
|
|
490
603
|
if (locationContext == null) {
|
|
491
604
|
return null;
|
|
492
605
|
}
|
|
493
|
-
return /* @__PURE__ */ React.createElement(
|
|
606
|
+
return /* @__PURE__ */ React.createElement(_chunkMVCD4EFUjs.NavigationContext.Provider, { value: navigationContext }, /* @__PURE__ */ React.createElement(_chunkMVCD4EFUjs.LocationContext.Provider, { children, value: locationContext }));
|
|
494
607
|
}
|
|
495
608
|
function Routes({
|
|
496
609
|
children,
|
|
497
610
|
location
|
|
498
611
|
}) {
|
|
499
|
-
return
|
|
612
|
+
return _chunkMVCD4EFUjs.useRoutes.call(void 0, createRoutesFromChildren(children), location);
|
|
500
613
|
}
|
|
501
614
|
function Await({
|
|
502
615
|
children,
|
|
503
616
|
errorElement,
|
|
504
617
|
resolve
|
|
505
618
|
}) {
|
|
506
|
-
let dataRouterContext = React.useContext(
|
|
619
|
+
let dataRouterContext = React.useContext(_chunkMVCD4EFUjs.DataRouterContext);
|
|
507
620
|
return /* @__PURE__ */ React.createElement(
|
|
508
621
|
AwaitErrorBoundary,
|
|
509
622
|
{
|
|
510
623
|
resolve,
|
|
511
624
|
errorElement,
|
|
512
|
-
unstable_onError: _optionalChain([dataRouterContext, 'optionalAccess',
|
|
625
|
+
unstable_onError: _optionalChain([dataRouterContext, 'optionalAccess', _16 => _16.unstable_onError])
|
|
513
626
|
},
|
|
514
627
|
/* @__PURE__ */ React.createElement(ResolveAwait, null, children)
|
|
515
628
|
);
|
|
@@ -558,7 +671,7 @@ var AwaitErrorBoundary = class extends React.Component {
|
|
|
558
671
|
promise = resolve.then(
|
|
559
672
|
(data) => Object.defineProperty(resolve, "_data", { get: () => data }),
|
|
560
673
|
(error) => {
|
|
561
|
-
_optionalChain([this, 'access',
|
|
674
|
+
_optionalChain([this, 'access', _17 => _17.props, 'access', _18 => _18.unstable_onError, 'optionalCall', _19 => _19(error)]);
|
|
562
675
|
Object.defineProperty(resolve, "_error", { get: () => error });
|
|
563
676
|
}
|
|
564
677
|
);
|
|
@@ -567,10 +680,10 @@ var AwaitErrorBoundary = class extends React.Component {
|
|
|
567
680
|
throw promise._error;
|
|
568
681
|
}
|
|
569
682
|
if (status === 2 /* error */) {
|
|
570
|
-
return /* @__PURE__ */ React.createElement(
|
|
683
|
+
return /* @__PURE__ */ React.createElement(_chunkMVCD4EFUjs.AwaitContext.Provider, { value: promise, children: errorElement });
|
|
571
684
|
}
|
|
572
685
|
if (status === 1 /* success */) {
|
|
573
|
-
return /* @__PURE__ */ React.createElement(
|
|
686
|
+
return /* @__PURE__ */ React.createElement(_chunkMVCD4EFUjs.AwaitContext.Provider, { value: promise, children });
|
|
574
687
|
}
|
|
575
688
|
throw promise;
|
|
576
689
|
}
|
|
@@ -578,7 +691,7 @@ var AwaitErrorBoundary = class extends React.Component {
|
|
|
578
691
|
function ResolveAwait({
|
|
579
692
|
children
|
|
580
693
|
}) {
|
|
581
|
-
let data =
|
|
694
|
+
let data = _chunkMVCD4EFUjs.useAsyncValue.call(void 0, );
|
|
582
695
|
let toRender = typeof children === "function" ? children(data) : children;
|
|
583
696
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, toRender);
|
|
584
697
|
}
|
|
@@ -596,11 +709,11 @@ function createRoutesFromChildren(children, parentPath = []) {
|
|
|
596
709
|
);
|
|
597
710
|
return;
|
|
598
711
|
}
|
|
599
|
-
|
|
712
|
+
_chunkMVCD4EFUjs.invariant.call(void 0,
|
|
600
713
|
element.type === Route,
|
|
601
714
|
`[${typeof element.type === "string" ? element.type : element.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`
|
|
602
715
|
);
|
|
603
|
-
|
|
716
|
+
_chunkMVCD4EFUjs.invariant.call(void 0,
|
|
604
717
|
!element.props.index || !element.props.children,
|
|
605
718
|
"An index route cannot have child routes."
|
|
606
719
|
);
|
|
@@ -611,6 +724,7 @@ function createRoutesFromChildren(children, parentPath = []) {
|
|
|
611
724
|
Component: element.props.Component,
|
|
612
725
|
index: element.props.index,
|
|
613
726
|
path: element.props.path,
|
|
727
|
+
middleware: element.props.middleware,
|
|
614
728
|
loader: element.props.loader,
|
|
615
729
|
action: element.props.action,
|
|
616
730
|
hydrateFallbackElement: element.props.hydrateFallbackElement,
|
|
@@ -634,14 +748,14 @@ function createRoutesFromChildren(children, parentPath = []) {
|
|
|
634
748
|
}
|
|
635
749
|
var createRoutesFromElements = createRoutesFromChildren;
|
|
636
750
|
function renderMatches(matches) {
|
|
637
|
-
return
|
|
751
|
+
return _chunkMVCD4EFUjs._renderMatches.call(void 0, matches);
|
|
638
752
|
}
|
|
639
753
|
function useRouteComponentProps() {
|
|
640
754
|
return {
|
|
641
|
-
params:
|
|
642
|
-
loaderData:
|
|
643
|
-
actionData:
|
|
644
|
-
matches:
|
|
755
|
+
params: _chunkMVCD4EFUjs.useParams.call(void 0, ),
|
|
756
|
+
loaderData: _chunkMVCD4EFUjs.useLoaderData.call(void 0, ),
|
|
757
|
+
actionData: _chunkMVCD4EFUjs.useActionData.call(void 0, ),
|
|
758
|
+
matches: _chunkMVCD4EFUjs.useMatches.call(void 0, )
|
|
645
759
|
};
|
|
646
760
|
}
|
|
647
761
|
function WithComponentProps({
|
|
@@ -658,9 +772,9 @@ function withComponentProps(Component2) {
|
|
|
658
772
|
}
|
|
659
773
|
function useHydrateFallbackProps() {
|
|
660
774
|
return {
|
|
661
|
-
params:
|
|
662
|
-
loaderData:
|
|
663
|
-
actionData:
|
|
775
|
+
params: _chunkMVCD4EFUjs.useParams.call(void 0, ),
|
|
776
|
+
loaderData: _chunkMVCD4EFUjs.useLoaderData.call(void 0, ),
|
|
777
|
+
actionData: _chunkMVCD4EFUjs.useActionData.call(void 0, )
|
|
664
778
|
};
|
|
665
779
|
}
|
|
666
780
|
function WithHydrateFallbackProps({
|
|
@@ -677,10 +791,10 @@ function withHydrateFallbackProps(HydrateFallback) {
|
|
|
677
791
|
}
|
|
678
792
|
function useErrorBoundaryProps() {
|
|
679
793
|
return {
|
|
680
|
-
params:
|
|
681
|
-
loaderData:
|
|
682
|
-
actionData:
|
|
683
|
-
error:
|
|
794
|
+
params: _chunkMVCD4EFUjs.useParams.call(void 0, ),
|
|
795
|
+
loaderData: _chunkMVCD4EFUjs.useLoaderData.call(void 0, ),
|
|
796
|
+
actionData: _chunkMVCD4EFUjs.useActionData.call(void 0, ),
|
|
797
|
+
error: _chunkMVCD4EFUjs.useRouteError.call(void 0, )
|
|
684
798
|
};
|
|
685
799
|
}
|
|
686
800
|
function WithErrorBoundaryProps({
|
|
@@ -765,7 +879,7 @@ var supportedFormEncTypes = /* @__PURE__ */ new Set([
|
|
|
765
879
|
]);
|
|
766
880
|
function getFormEncType(encType) {
|
|
767
881
|
if (encType != null && !supportedFormEncTypes.has(encType)) {
|
|
768
|
-
|
|
882
|
+
_chunkMVCD4EFUjs.warning.call(void 0,
|
|
769
883
|
false,
|
|
770
884
|
`"${encType}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`
|
|
771
885
|
);
|
|
@@ -781,7 +895,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
781
895
|
let body;
|
|
782
896
|
if (isFormElement(target)) {
|
|
783
897
|
let attr = target.getAttribute("action");
|
|
784
|
-
action = attr ?
|
|
898
|
+
action = attr ? _chunkMVCD4EFUjs.stripBasename.call(void 0, attr, basename) : null;
|
|
785
899
|
method = target.getAttribute("method") || defaultMethod;
|
|
786
900
|
encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
|
|
787
901
|
formData = new FormData(target);
|
|
@@ -793,7 +907,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
793
907
|
);
|
|
794
908
|
}
|
|
795
909
|
let attr = target.getAttribute("formaction") || form.getAttribute("action");
|
|
796
|
-
action = attr ?
|
|
910
|
+
action = attr ? _chunkMVCD4EFUjs.stripBasename.call(void 0, attr, basename) : null;
|
|
797
911
|
method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
|
|
798
912
|
encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
|
|
799
913
|
formData = new FormData(form, target);
|
|
@@ -830,42 +944,42 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
|
|
|
830
944
|
try {
|
|
831
945
|
if (isBrowser) {
|
|
832
946
|
window.__reactRouterVersion = // @ts-expect-error
|
|
833
|
-
"7.9.1";
|
|
947
|
+
"7.9.2-pre.1";
|
|
834
948
|
}
|
|
835
949
|
} catch (e) {
|
|
836
950
|
}
|
|
837
951
|
function createBrowserRouter(routes, opts) {
|
|
838
|
-
return
|
|
839
|
-
basename: _optionalChain([opts, 'optionalAccess',
|
|
840
|
-
getContext: _optionalChain([opts, 'optionalAccess',
|
|
841
|
-
future: _optionalChain([opts, 'optionalAccess',
|
|
842
|
-
history:
|
|
843
|
-
hydrationData: _optionalChain([opts, 'optionalAccess',
|
|
952
|
+
return _chunkMVCD4EFUjs.createRouter.call(void 0, {
|
|
953
|
+
basename: _optionalChain([opts, 'optionalAccess', _20 => _20.basename]),
|
|
954
|
+
getContext: _optionalChain([opts, 'optionalAccess', _21 => _21.getContext]),
|
|
955
|
+
future: _optionalChain([opts, 'optionalAccess', _22 => _22.future]),
|
|
956
|
+
history: _chunkMVCD4EFUjs.createBrowserHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _23 => _23.window]) }),
|
|
957
|
+
hydrationData: _optionalChain([opts, 'optionalAccess', _24 => _24.hydrationData]) || parseHydrationData(),
|
|
844
958
|
routes,
|
|
845
959
|
mapRouteProperties,
|
|
846
960
|
hydrationRouteProperties,
|
|
847
|
-
dataStrategy: _optionalChain([opts, 'optionalAccess',
|
|
848
|
-
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess',
|
|
849
|
-
window: _optionalChain([opts, 'optionalAccess',
|
|
961
|
+
dataStrategy: _optionalChain([opts, 'optionalAccess', _25 => _25.dataStrategy]),
|
|
962
|
+
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _26 => _26.patchRoutesOnNavigation]),
|
|
963
|
+
window: _optionalChain([opts, 'optionalAccess', _27 => _27.window])
|
|
850
964
|
}).initialize();
|
|
851
965
|
}
|
|
852
966
|
function createHashRouter(routes, opts) {
|
|
853
|
-
return
|
|
854
|
-
basename: _optionalChain([opts, 'optionalAccess',
|
|
855
|
-
getContext: _optionalChain([opts, 'optionalAccess',
|
|
856
|
-
future: _optionalChain([opts, 'optionalAccess',
|
|
857
|
-
history:
|
|
858
|
-
hydrationData: _optionalChain([opts, 'optionalAccess',
|
|
967
|
+
return _chunkMVCD4EFUjs.createRouter.call(void 0, {
|
|
968
|
+
basename: _optionalChain([opts, 'optionalAccess', _28 => _28.basename]),
|
|
969
|
+
getContext: _optionalChain([opts, 'optionalAccess', _29 => _29.getContext]),
|
|
970
|
+
future: _optionalChain([opts, 'optionalAccess', _30 => _30.future]),
|
|
971
|
+
history: _chunkMVCD4EFUjs.createHashHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _31 => _31.window]) }),
|
|
972
|
+
hydrationData: _optionalChain([opts, 'optionalAccess', _32 => _32.hydrationData]) || parseHydrationData(),
|
|
859
973
|
routes,
|
|
860
974
|
mapRouteProperties,
|
|
861
975
|
hydrationRouteProperties,
|
|
862
|
-
dataStrategy: _optionalChain([opts, 'optionalAccess',
|
|
863
|
-
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess',
|
|
864
|
-
window: _optionalChain([opts, 'optionalAccess',
|
|
976
|
+
dataStrategy: _optionalChain([opts, 'optionalAccess', _33 => _33.dataStrategy]),
|
|
977
|
+
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _34 => _34.patchRoutesOnNavigation]),
|
|
978
|
+
window: _optionalChain([opts, 'optionalAccess', _35 => _35.window])
|
|
865
979
|
}).initialize();
|
|
866
980
|
}
|
|
867
981
|
function parseHydrationData() {
|
|
868
|
-
let state = _optionalChain([window, 'optionalAccess',
|
|
982
|
+
let state = _optionalChain([window, 'optionalAccess', _36 => _36.__staticRouterHydrationData]);
|
|
869
983
|
if (state && state.errors) {
|
|
870
984
|
state = {
|
|
871
985
|
...state,
|
|
@@ -880,7 +994,7 @@ function deserializeErrors(errors) {
|
|
|
880
994
|
let serialized = {};
|
|
881
995
|
for (let [key, val] of entries) {
|
|
882
996
|
if (val && val.__type === "RouteErrorResponse") {
|
|
883
|
-
serialized[key] = new (0,
|
|
997
|
+
serialized[key] = new (0, _chunkMVCD4EFUjs.ErrorResponseImpl)(
|
|
884
998
|
val.status,
|
|
885
999
|
val.statusText,
|
|
886
1000
|
val.data,
|
|
@@ -916,7 +1030,7 @@ function BrowserRouter({
|
|
|
916
1030
|
}) {
|
|
917
1031
|
let historyRef = React2.useRef();
|
|
918
1032
|
if (historyRef.current == null) {
|
|
919
|
-
historyRef.current =
|
|
1033
|
+
historyRef.current = _chunkMVCD4EFUjs.createBrowserHistory.call(void 0, { window: window2, v5Compat: true });
|
|
920
1034
|
}
|
|
921
1035
|
let history = historyRef.current;
|
|
922
1036
|
let [state, setStateImpl] = React2.useState({
|
|
@@ -944,7 +1058,7 @@ function BrowserRouter({
|
|
|
944
1058
|
function HashRouter({ basename, children, window: window2 }) {
|
|
945
1059
|
let historyRef = React2.useRef();
|
|
946
1060
|
if (historyRef.current == null) {
|
|
947
|
-
historyRef.current =
|
|
1061
|
+
historyRef.current = _chunkMVCD4EFUjs.createHashHistory.call(void 0, { window: window2, v5Compat: true });
|
|
948
1062
|
}
|
|
949
1063
|
let history = historyRef.current;
|
|
950
1064
|
let [state, setStateImpl] = React2.useState({
|
|
@@ -1013,7 +1127,7 @@ var Link = React2.forwardRef(
|
|
|
1013
1127
|
viewTransition,
|
|
1014
1128
|
...rest
|
|
1015
1129
|
}, forwardedRef) {
|
|
1016
|
-
let { basename } = React2.useContext(
|
|
1130
|
+
let { basename } = React2.useContext(_chunkMVCD4EFUjs.NavigationContext);
|
|
1017
1131
|
let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX.test(to);
|
|
1018
1132
|
let absoluteHref;
|
|
1019
1133
|
let isExternal = false;
|
|
@@ -1023,22 +1137,22 @@ var Link = React2.forwardRef(
|
|
|
1023
1137
|
try {
|
|
1024
1138
|
let currentUrl = new URL(window.location.href);
|
|
1025
1139
|
let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
|
|
1026
|
-
let path =
|
|
1140
|
+
let path = _chunkMVCD4EFUjs.stripBasename.call(void 0, targetUrl.pathname, basename);
|
|
1027
1141
|
if (targetUrl.origin === currentUrl.origin && path != null) {
|
|
1028
1142
|
to = path + targetUrl.search + targetUrl.hash;
|
|
1029
1143
|
} else {
|
|
1030
1144
|
isExternal = true;
|
|
1031
1145
|
}
|
|
1032
1146
|
} catch (e) {
|
|
1033
|
-
|
|
1147
|
+
_chunkMVCD4EFUjs.warning.call(void 0,
|
|
1034
1148
|
false,
|
|
1035
1149
|
`<Link to="${to}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
1036
1150
|
);
|
|
1037
1151
|
}
|
|
1038
1152
|
}
|
|
1039
1153
|
}
|
|
1040
|
-
let href =
|
|
1041
|
-
let [shouldPrefetch, prefetchRef, prefetchHandlers] =
|
|
1154
|
+
let href = _chunkMVCD4EFUjs.useHref.call(void 0, to, { relative });
|
|
1155
|
+
let [shouldPrefetch, prefetchRef, prefetchHandlers] = _chunkMVCD4EFUjs.usePrefetchBehavior.call(void 0,
|
|
1042
1156
|
prefetch,
|
|
1043
1157
|
rest
|
|
1044
1158
|
);
|
|
@@ -1065,13 +1179,13 @@ var Link = React2.forwardRef(
|
|
|
1065
1179
|
...prefetchHandlers,
|
|
1066
1180
|
href: absoluteHref || href,
|
|
1067
1181
|
onClick: isExternal || reloadDocument ? onClick : handleClick,
|
|
1068
|
-
ref:
|
|
1182
|
+
ref: _chunkMVCD4EFUjs.mergeRefs.call(void 0, forwardedRef, prefetchRef),
|
|
1069
1183
|
target,
|
|
1070
1184
|
"data-discover": !isAbsolute && discover === "render" ? "true" : void 0
|
|
1071
1185
|
}
|
|
1072
1186
|
)
|
|
1073
1187
|
);
|
|
1074
|
-
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, link, /* @__PURE__ */ React2.createElement(
|
|
1188
|
+
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, link, /* @__PURE__ */ React2.createElement(_chunkMVCD4EFUjs.PrefetchPageLinks, { page: href })) : link;
|
|
1075
1189
|
}
|
|
1076
1190
|
);
|
|
1077
1191
|
Link.displayName = "Link";
|
|
@@ -1087,10 +1201,10 @@ var NavLink = React2.forwardRef(
|
|
|
1087
1201
|
children,
|
|
1088
1202
|
...rest
|
|
1089
1203
|
}, ref) {
|
|
1090
|
-
let path =
|
|
1091
|
-
let location =
|
|
1092
|
-
let routerState = React2.useContext(
|
|
1093
|
-
let { navigator, basename } = React2.useContext(
|
|
1204
|
+
let path = _chunkMVCD4EFUjs.useResolvedPath.call(void 0, to, { relative: rest.relative });
|
|
1205
|
+
let location = _chunkMVCD4EFUjs.useLocation.call(void 0, );
|
|
1206
|
+
let routerState = React2.useContext(_chunkMVCD4EFUjs.DataRouterStateContext);
|
|
1207
|
+
let { navigator, basename } = React2.useContext(_chunkMVCD4EFUjs.NavigationContext);
|
|
1094
1208
|
let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1095
1209
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1096
1210
|
useViewTransitionState(path) && viewTransition === true;
|
|
@@ -1103,7 +1217,7 @@ var NavLink = React2.forwardRef(
|
|
|
1103
1217
|
toPathname = toPathname.toLowerCase();
|
|
1104
1218
|
}
|
|
1105
1219
|
if (nextLocationPathname && basename) {
|
|
1106
|
-
nextLocationPathname =
|
|
1220
|
+
nextLocationPathname = _chunkMVCD4EFUjs.stripBasename.call(void 0, nextLocationPathname, basename) || nextLocationPathname;
|
|
1107
1221
|
}
|
|
1108
1222
|
const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
|
|
1109
1223
|
let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
|
|
@@ -1167,7 +1281,7 @@ var Form = React2.forwardRef(
|
|
|
1167
1281
|
if (event.defaultPrevented) return;
|
|
1168
1282
|
event.preventDefault();
|
|
1169
1283
|
let submitter = event.nativeEvent.submitter;
|
|
1170
|
-
let submitMethod = _optionalChain([submitter, 'optionalAccess',
|
|
1284
|
+
let submitMethod = _optionalChain([submitter, 'optionalAccess', _37 => _37.getAttribute, 'call', _38 => _38("formmethod")]) || method;
|
|
1171
1285
|
submit(submitter || event.currentTarget, {
|
|
1172
1286
|
fetcherKey,
|
|
1173
1287
|
method: submitMethod,
|
|
@@ -1198,10 +1312,10 @@ function ScrollRestoration({
|
|
|
1198
1312
|
storageKey,
|
|
1199
1313
|
...props
|
|
1200
1314
|
}) {
|
|
1201
|
-
let remixContext = React2.useContext(
|
|
1202
|
-
let { basename } = React2.useContext(
|
|
1203
|
-
let location =
|
|
1204
|
-
let matches =
|
|
1315
|
+
let remixContext = React2.useContext(_chunkMVCD4EFUjs.FrameworkContext);
|
|
1316
|
+
let { basename } = React2.useContext(_chunkMVCD4EFUjs.NavigationContext);
|
|
1317
|
+
let location = _chunkMVCD4EFUjs.useLocation.call(void 0, );
|
|
1318
|
+
let matches = _chunkMVCD4EFUjs.useMatches.call(void 0, );
|
|
1205
1319
|
useScrollRestoration({ getKey, storageKey });
|
|
1206
1320
|
let ssrKey = React2.useMemo(
|
|
1207
1321
|
() => {
|
|
@@ -1255,13 +1369,13 @@ function getDataRouterConsoleError(hookName) {
|
|
|
1255
1369
|
return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1256
1370
|
}
|
|
1257
1371
|
function useDataRouterContext(hookName) {
|
|
1258
|
-
let ctx = React2.useContext(
|
|
1259
|
-
|
|
1372
|
+
let ctx = React2.useContext(_chunkMVCD4EFUjs.DataRouterContext);
|
|
1373
|
+
_chunkMVCD4EFUjs.invariant.call(void 0, ctx, getDataRouterConsoleError(hookName));
|
|
1260
1374
|
return ctx;
|
|
1261
1375
|
}
|
|
1262
1376
|
function useDataRouterState(hookName) {
|
|
1263
|
-
let state = React2.useContext(
|
|
1264
|
-
|
|
1377
|
+
let state = React2.useContext(_chunkMVCD4EFUjs.DataRouterStateContext);
|
|
1378
|
+
_chunkMVCD4EFUjs.invariant.call(void 0, state, getDataRouterConsoleError(hookName));
|
|
1265
1379
|
return state;
|
|
1266
1380
|
}
|
|
1267
1381
|
function useLinkClickHandler(to, {
|
|
@@ -1272,14 +1386,14 @@ function useLinkClickHandler(to, {
|
|
|
1272
1386
|
relative,
|
|
1273
1387
|
viewTransition
|
|
1274
1388
|
} = {}) {
|
|
1275
|
-
let navigate =
|
|
1276
|
-
let location =
|
|
1277
|
-
let path =
|
|
1389
|
+
let navigate = _chunkMVCD4EFUjs.useNavigate.call(void 0, );
|
|
1390
|
+
let location = _chunkMVCD4EFUjs.useLocation.call(void 0, );
|
|
1391
|
+
let path = _chunkMVCD4EFUjs.useResolvedPath.call(void 0, to, { relative });
|
|
1278
1392
|
return React2.useCallback(
|
|
1279
1393
|
(event) => {
|
|
1280
1394
|
if (shouldProcessLinkClick(event, target)) {
|
|
1281
1395
|
event.preventDefault();
|
|
1282
|
-
let replace = replaceProp !== void 0 ? replaceProp :
|
|
1396
|
+
let replace = replaceProp !== void 0 ? replaceProp : _chunkMVCD4EFUjs.createPath.call(void 0, location) === _chunkMVCD4EFUjs.createPath.call(void 0, path);
|
|
1283
1397
|
navigate(to, {
|
|
1284
1398
|
replace,
|
|
1285
1399
|
state,
|
|
@@ -1304,13 +1418,13 @@ function useLinkClickHandler(to, {
|
|
|
1304
1418
|
);
|
|
1305
1419
|
}
|
|
1306
1420
|
function useSearchParams(defaultInit) {
|
|
1307
|
-
|
|
1421
|
+
_chunkMVCD4EFUjs.warning.call(void 0,
|
|
1308
1422
|
typeof URLSearchParams !== "undefined",
|
|
1309
1423
|
`You cannot use the \`useSearchParams\` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.`
|
|
1310
1424
|
);
|
|
1311
1425
|
let defaultSearchParamsRef = React2.useRef(createSearchParams(defaultInit));
|
|
1312
1426
|
let hasSetSearchParamsRef = React2.useRef(false);
|
|
1313
|
-
let location =
|
|
1427
|
+
let location = _chunkMVCD4EFUjs.useLocation.call(void 0, );
|
|
1314
1428
|
let searchParams = React2.useMemo(
|
|
1315
1429
|
() => (
|
|
1316
1430
|
// Only merge in the defaults if we haven't yet called setSearchParams.
|
|
@@ -1323,7 +1437,7 @@ function useSearchParams(defaultInit) {
|
|
|
1323
1437
|
),
|
|
1324
1438
|
[location.search]
|
|
1325
1439
|
);
|
|
1326
|
-
let navigate =
|
|
1440
|
+
let navigate = _chunkMVCD4EFUjs.useNavigate.call(void 0, );
|
|
1327
1441
|
let setSearchParams = React2.useCallback(
|
|
1328
1442
|
(nextInit, navigateOptions) => {
|
|
1329
1443
|
const newSearchParams = createSearchParams(
|
|
@@ -1340,8 +1454,8 @@ var fetcherId = 0;
|
|
|
1340
1454
|
var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
|
|
1341
1455
|
function useSubmit() {
|
|
1342
1456
|
let { router } = useDataRouterContext("useSubmit" /* UseSubmit */);
|
|
1343
|
-
let { basename } = React2.useContext(
|
|
1344
|
-
let currentRouteId =
|
|
1457
|
+
let { basename } = React2.useContext(_chunkMVCD4EFUjs.NavigationContext);
|
|
1458
|
+
let currentRouteId = _chunkMVCD4EFUjs.useRouteId.call(void 0, );
|
|
1345
1459
|
return React2.useCallback(
|
|
1346
1460
|
async (target, options = {}) => {
|
|
1347
1461
|
let { action, method, encType, formData, body } = getFormSubmissionInfo(
|
|
@@ -1377,12 +1491,12 @@ function useSubmit() {
|
|
|
1377
1491
|
);
|
|
1378
1492
|
}
|
|
1379
1493
|
function useFormAction(action, { relative } = {}) {
|
|
1380
|
-
let { basename } = React2.useContext(
|
|
1381
|
-
let routeContext = React2.useContext(
|
|
1382
|
-
|
|
1494
|
+
let { basename } = React2.useContext(_chunkMVCD4EFUjs.NavigationContext);
|
|
1495
|
+
let routeContext = React2.useContext(_chunkMVCD4EFUjs.RouteContext);
|
|
1496
|
+
_chunkMVCD4EFUjs.invariant.call(void 0, routeContext, "useFormAction must be used inside a RouteContext");
|
|
1383
1497
|
let [match] = routeContext.matches.slice(-1);
|
|
1384
|
-
let path = { ...
|
|
1385
|
-
let location =
|
|
1498
|
+
let path = { ..._chunkMVCD4EFUjs.useResolvedPath.call(void 0, action ? action : ".", { relative }) };
|
|
1499
|
+
let location = _chunkMVCD4EFUjs.useLocation.call(void 0, );
|
|
1386
1500
|
if (action == null) {
|
|
1387
1501
|
path.search = location.search;
|
|
1388
1502
|
let params = new URLSearchParams(path.search);
|
|
@@ -1399,21 +1513,21 @@ function useFormAction(action, { relative } = {}) {
|
|
|
1399
1513
|
path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
|
|
1400
1514
|
}
|
|
1401
1515
|
if (basename !== "/") {
|
|
1402
|
-
path.pathname = path.pathname === "/" ? basename :
|
|
1516
|
+
path.pathname = path.pathname === "/" ? basename : _chunkMVCD4EFUjs.joinPaths.call(void 0, [basename, path.pathname]);
|
|
1403
1517
|
}
|
|
1404
|
-
return
|
|
1518
|
+
return _chunkMVCD4EFUjs.createPath.call(void 0, path);
|
|
1405
1519
|
}
|
|
1406
1520
|
function useFetcher({
|
|
1407
1521
|
key
|
|
1408
1522
|
} = {}) {
|
|
1409
1523
|
let { router } = useDataRouterContext("useFetcher" /* UseFetcher */);
|
|
1410
1524
|
let state = useDataRouterState("useFetcher" /* UseFetcher */);
|
|
1411
|
-
let fetcherData = React2.useContext(
|
|
1412
|
-
let route = React2.useContext(
|
|
1413
|
-
let routeId = _optionalChain([route, 'access',
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1525
|
+
let fetcherData = React2.useContext(_chunkMVCD4EFUjs.FetchersContext);
|
|
1526
|
+
let route = React2.useContext(_chunkMVCD4EFUjs.RouteContext);
|
|
1527
|
+
let routeId = _optionalChain([route, 'access', _39 => _39.matches, 'access', _40 => _40[route.matches.length - 1], 'optionalAccess', _41 => _41.route, 'access', _42 => _42.id]);
|
|
1528
|
+
_chunkMVCD4EFUjs.invariant.call(void 0, fetcherData, `useFetcher must be used inside a FetchersContext`);
|
|
1529
|
+
_chunkMVCD4EFUjs.invariant.call(void 0, route, `useFetcher must be used inside a RouteContext`);
|
|
1530
|
+
_chunkMVCD4EFUjs.invariant.call(void 0,
|
|
1417
1531
|
routeId != null,
|
|
1418
1532
|
`useFetcher can only be used on routes that contain a unique "id"`
|
|
1419
1533
|
);
|
|
@@ -1428,7 +1542,7 @@ function useFetcher({
|
|
|
1428
1542
|
}, [router, fetcherKey]);
|
|
1429
1543
|
let load = React2.useCallback(
|
|
1430
1544
|
async (href, opts) => {
|
|
1431
|
-
|
|
1545
|
+
_chunkMVCD4EFUjs.invariant.call(void 0, routeId, "No routeId available for fetcher.load()");
|
|
1432
1546
|
await router.fetch(fetcherKey, routeId, href, opts);
|
|
1433
1547
|
},
|
|
1434
1548
|
[fetcherKey, routeId, router]
|
|
@@ -1444,6 +1558,7 @@ function useFetcher({
|
|
|
1444
1558
|
},
|
|
1445
1559
|
[fetcherKey, submitImpl]
|
|
1446
1560
|
);
|
|
1561
|
+
let unstable_reset = React2.useCallback((opts) => router.resetFetcher(fetcherKey, opts), [router, fetcherKey]);
|
|
1447
1562
|
let FetcherForm = React2.useMemo(() => {
|
|
1448
1563
|
let FetcherForm2 = React2.forwardRef(
|
|
1449
1564
|
(props, ref) => {
|
|
@@ -1453,17 +1568,18 @@ function useFetcher({
|
|
|
1453
1568
|
FetcherForm2.displayName = "fetcher.Form";
|
|
1454
1569
|
return FetcherForm2;
|
|
1455
1570
|
}, [fetcherKey]);
|
|
1456
|
-
let fetcher = state.fetchers.get(fetcherKey) ||
|
|
1571
|
+
let fetcher = state.fetchers.get(fetcherKey) || _chunkMVCD4EFUjs.IDLE_FETCHER;
|
|
1457
1572
|
let data = fetcherData.get(fetcherKey);
|
|
1458
1573
|
let fetcherWithComponents = React2.useMemo(
|
|
1459
1574
|
() => ({
|
|
1460
1575
|
Form: FetcherForm,
|
|
1461
1576
|
submit,
|
|
1462
1577
|
load,
|
|
1578
|
+
unstable_reset,
|
|
1463
1579
|
...fetcher,
|
|
1464
1580
|
data
|
|
1465
1581
|
}),
|
|
1466
|
-
[FetcherForm, submit, load, fetcher, data]
|
|
1582
|
+
[FetcherForm, submit, load, unstable_reset, fetcher, data]
|
|
1467
1583
|
);
|
|
1468
1584
|
return fetcherWithComponents;
|
|
1469
1585
|
}
|
|
@@ -1483,7 +1599,7 @@ function getScrollRestorationKey(location, matches, basename, getKey) {
|
|
|
1483
1599
|
key = getKey(
|
|
1484
1600
|
{
|
|
1485
1601
|
...location,
|
|
1486
|
-
pathname:
|
|
1602
|
+
pathname: _chunkMVCD4EFUjs.stripBasename.call(void 0, location.pathname, basename) || location.pathname
|
|
1487
1603
|
},
|
|
1488
1604
|
matches
|
|
1489
1605
|
);
|
|
@@ -1504,10 +1620,10 @@ function useScrollRestoration({
|
|
|
1504
1620
|
let { restoreScrollPosition, preventScrollReset } = useDataRouterState(
|
|
1505
1621
|
"useScrollRestoration" /* UseScrollRestoration */
|
|
1506
1622
|
);
|
|
1507
|
-
let { basename } = React2.useContext(
|
|
1508
|
-
let location =
|
|
1509
|
-
let matches =
|
|
1510
|
-
let navigation =
|
|
1623
|
+
let { basename } = React2.useContext(_chunkMVCD4EFUjs.NavigationContext);
|
|
1624
|
+
let location = _chunkMVCD4EFUjs.useLocation.call(void 0, );
|
|
1625
|
+
let matches = _chunkMVCD4EFUjs.useMatches.call(void 0, );
|
|
1626
|
+
let navigation = _chunkMVCD4EFUjs.useNavigation.call(void 0, );
|
|
1511
1627
|
React2.useEffect(() => {
|
|
1512
1628
|
window.history.scrollRestoration = "manual";
|
|
1513
1629
|
return () => {
|
|
@@ -1526,7 +1642,7 @@ function useScrollRestoration({
|
|
|
1526
1642
|
JSON.stringify(savedScrollPositions)
|
|
1527
1643
|
);
|
|
1528
1644
|
} catch (error) {
|
|
1529
|
-
|
|
1645
|
+
_chunkMVCD4EFUjs.warning.call(void 0,
|
|
1530
1646
|
false,
|
|
1531
1647
|
`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${error}).`
|
|
1532
1648
|
);
|
|
@@ -1547,7 +1663,7 @@ function useScrollRestoration({
|
|
|
1547
1663
|
}
|
|
1548
1664
|
}, [storageKey]);
|
|
1549
1665
|
React2.useLayoutEffect(() => {
|
|
1550
|
-
let disableScrollRestoration = _optionalChain([router, 'optionalAccess',
|
|
1666
|
+
let disableScrollRestoration = _optionalChain([router, 'optionalAccess', _43 => _43.enableScrollRestoration, 'call', _44 => _44(
|
|
1551
1667
|
savedScrollPositions,
|
|
1552
1668
|
() => window.scrollY,
|
|
1553
1669
|
getKey ? (location2, matches2) => getScrollRestorationKey(location2, matches2, basename, getKey) : void 0
|
|
@@ -1573,7 +1689,7 @@ function useScrollRestoration({
|
|
|
1573
1689
|
}
|
|
1574
1690
|
}
|
|
1575
1691
|
} catch (e2) {
|
|
1576
|
-
|
|
1692
|
+
_chunkMVCD4EFUjs.warning.call(void 0,
|
|
1577
1693
|
false,
|
|
1578
1694
|
`"${location.hash.slice(
|
|
1579
1695
|
1
|
|
@@ -1611,7 +1727,7 @@ function usePrompt({
|
|
|
1611
1727
|
when,
|
|
1612
1728
|
message
|
|
1613
1729
|
}) {
|
|
1614
|
-
let blocker =
|
|
1730
|
+
let blocker = _chunkMVCD4EFUjs.useBlocker.call(void 0, when);
|
|
1615
1731
|
React2.useEffect(() => {
|
|
1616
1732
|
if (blocker.state === "blocked") {
|
|
1617
1733
|
let proceed = window.confirm(message);
|
|
@@ -1629,21 +1745,21 @@ function usePrompt({
|
|
|
1629
1745
|
}, [blocker, when]);
|
|
1630
1746
|
}
|
|
1631
1747
|
function useViewTransitionState(to, { relative } = {}) {
|
|
1632
|
-
let vtContext = React2.useContext(
|
|
1633
|
-
|
|
1748
|
+
let vtContext = React2.useContext(_chunkMVCD4EFUjs.ViewTransitionContext);
|
|
1749
|
+
_chunkMVCD4EFUjs.invariant.call(void 0,
|
|
1634
1750
|
vtContext != null,
|
|
1635
1751
|
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1636
1752
|
);
|
|
1637
1753
|
let { basename } = useDataRouterContext(
|
|
1638
1754
|
"useViewTransitionState" /* useViewTransitionState */
|
|
1639
1755
|
);
|
|
1640
|
-
let path =
|
|
1756
|
+
let path = _chunkMVCD4EFUjs.useResolvedPath.call(void 0, to, { relative });
|
|
1641
1757
|
if (!vtContext.isTransitioning) {
|
|
1642
1758
|
return false;
|
|
1643
1759
|
}
|
|
1644
|
-
let currentPath =
|
|
1645
|
-
let nextPath =
|
|
1646
|
-
return
|
|
1760
|
+
let currentPath = _chunkMVCD4EFUjs.stripBasename.call(void 0, vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
|
|
1761
|
+
let nextPath = _chunkMVCD4EFUjs.stripBasename.call(void 0, vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
|
|
1762
|
+
return _chunkMVCD4EFUjs.matchPath.call(void 0, path.pathname, nextPath) != null || _chunkMVCD4EFUjs.matchPath.call(void 0, path.pathname, currentPath) != null;
|
|
1647
1763
|
}
|
|
1648
1764
|
|
|
1649
1765
|
// lib/dom/server.tsx
|
|
@@ -1654,7 +1770,7 @@ function StaticRouter({
|
|
|
1654
1770
|
location: locationProp = "/"
|
|
1655
1771
|
}) {
|
|
1656
1772
|
if (typeof locationProp === "string") {
|
|
1657
|
-
locationProp =
|
|
1773
|
+
locationProp = _chunkMVCD4EFUjs.parsePath.call(void 0, locationProp);
|
|
1658
1774
|
}
|
|
1659
1775
|
let action = "POP" /* Pop */;
|
|
1660
1776
|
let location = {
|
|
@@ -1683,7 +1799,7 @@ function StaticRouterProvider({
|
|
|
1683
1799
|
hydrate = true,
|
|
1684
1800
|
nonce
|
|
1685
1801
|
}) {
|
|
1686
|
-
|
|
1802
|
+
_chunkMVCD4EFUjs.invariant.call(void 0,
|
|
1687
1803
|
router && context,
|
|
1688
1804
|
"You must provide `router` and `context` to <StaticRouterProvider>"
|
|
1689
1805
|
);
|
|
@@ -1706,7 +1822,7 @@ function StaticRouterProvider({
|
|
|
1706
1822
|
hydrateScript = `window.__staticRouterHydrationData = JSON.parse(${json});`;
|
|
1707
1823
|
}
|
|
1708
1824
|
let { state } = dataRouterContext.router;
|
|
1709
|
-
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
|
1825
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(_chunkMVCD4EFUjs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React3.createElement(_chunkMVCD4EFUjs.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React3.createElement(_chunkMVCD4EFUjs.FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ React3.createElement(_chunkMVCD4EFUjs.ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ React3.createElement(
|
|
1710
1826
|
Router,
|
|
1711
1827
|
{
|
|
1712
1828
|
basename: dataRouterContext.basename,
|
|
@@ -1737,14 +1853,14 @@ function DataRoutes2({
|
|
|
1737
1853
|
future,
|
|
1738
1854
|
state
|
|
1739
1855
|
}) {
|
|
1740
|
-
return
|
|
1856
|
+
return _chunkMVCD4EFUjs.useRoutesImpl.call(void 0, routes, void 0, state, void 0, future);
|
|
1741
1857
|
}
|
|
1742
1858
|
function serializeErrors(errors) {
|
|
1743
1859
|
if (!errors) return null;
|
|
1744
1860
|
let entries = Object.entries(errors);
|
|
1745
1861
|
let serialized = {};
|
|
1746
1862
|
for (let [key, val] of entries) {
|
|
1747
|
-
if (
|
|
1863
|
+
if (_chunkMVCD4EFUjs.isRouteErrorResponse.call(void 0, val)) {
|
|
1748
1864
|
serialized[key] = { ...val, __type: "RouteErrorResponse" };
|
|
1749
1865
|
} else if (val instanceof Error) {
|
|
1750
1866
|
serialized[key] = {
|
|
@@ -1794,14 +1910,14 @@ function getStatelessNavigator() {
|
|
|
1794
1910
|
};
|
|
1795
1911
|
}
|
|
1796
1912
|
function createStaticHandler2(routes, opts) {
|
|
1797
|
-
return
|
|
1913
|
+
return _chunkMVCD4EFUjs.createStaticHandler.call(void 0, routes, {
|
|
1798
1914
|
...opts,
|
|
1799
1915
|
mapRouteProperties
|
|
1800
1916
|
});
|
|
1801
1917
|
}
|
|
1802
1918
|
function createStaticRouter(routes, context, opts = {}) {
|
|
1803
1919
|
let manifest = {};
|
|
1804
|
-
let dataRoutes =
|
|
1920
|
+
let dataRoutes = _chunkMVCD4EFUjs.convertRoutesToDataRoutes.call(void 0,
|
|
1805
1921
|
routes,
|
|
1806
1922
|
mapRouteProperties,
|
|
1807
1923
|
void 0,
|
|
@@ -1822,7 +1938,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1822
1938
|
get future() {
|
|
1823
1939
|
return {
|
|
1824
1940
|
v8_middleware: false,
|
|
1825
|
-
..._optionalChain([opts, 'optionalAccess',
|
|
1941
|
+
..._optionalChain([opts, 'optionalAccess', _45 => _45.future])
|
|
1826
1942
|
};
|
|
1827
1943
|
},
|
|
1828
1944
|
get state() {
|
|
@@ -1834,7 +1950,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1834
1950
|
actionData: context.actionData,
|
|
1835
1951
|
errors: context.errors,
|
|
1836
1952
|
initialized: true,
|
|
1837
|
-
navigation:
|
|
1953
|
+
navigation: _chunkMVCD4EFUjs.IDLE_NAVIGATION,
|
|
1838
1954
|
restoreScrollPosition: null,
|
|
1839
1955
|
preventScrollReset: false,
|
|
1840
1956
|
revalidation: "idle",
|
|
@@ -1869,16 +1985,19 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1869
1985
|
createHref,
|
|
1870
1986
|
encodeLocation,
|
|
1871
1987
|
getFetcher() {
|
|
1872
|
-
return
|
|
1988
|
+
return _chunkMVCD4EFUjs.IDLE_FETCHER;
|
|
1873
1989
|
},
|
|
1874
1990
|
deleteFetcher() {
|
|
1875
1991
|
throw msg("deleteFetcher");
|
|
1876
1992
|
},
|
|
1993
|
+
resetFetcher() {
|
|
1994
|
+
throw msg("resetFetcher");
|
|
1995
|
+
},
|
|
1877
1996
|
dispose() {
|
|
1878
1997
|
throw msg("dispose");
|
|
1879
1998
|
},
|
|
1880
1999
|
getBlocker() {
|
|
1881
|
-
return
|
|
2000
|
+
return _chunkMVCD4EFUjs.IDLE_BLOCKER;
|
|
1882
2001
|
},
|
|
1883
2002
|
deleteBlocker() {
|
|
1884
2003
|
throw msg("deleteBlocker");
|
|
@@ -1896,10 +2015,10 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1896
2015
|
};
|
|
1897
2016
|
}
|
|
1898
2017
|
function createHref(to) {
|
|
1899
|
-
return typeof to === "string" ? to :
|
|
2018
|
+
return typeof to === "string" ? to : _chunkMVCD4EFUjs.createPath.call(void 0, to);
|
|
1900
2019
|
}
|
|
1901
2020
|
function encodeLocation(to) {
|
|
1902
|
-
let href = typeof to === "string" ? to :
|
|
2021
|
+
let href = typeof to === "string" ? to : _chunkMVCD4EFUjs.createPath.call(void 0, to);
|
|
1903
2022
|
href = href.replace(/ $/, "%20");
|
|
1904
2023
|
let encoded = ABSOLUTE_URL_REGEX2.test(href) ? new URL(href) : new URL(href, "http://localhost");
|
|
1905
2024
|
return {
|
|
@@ -1966,4 +2085,5 @@ function htmlEscape(str) {
|
|
|
1966
2085
|
|
|
1967
2086
|
|
|
1968
2087
|
|
|
1969
|
-
|
|
2088
|
+
|
|
2089
|
+
exports.mapRouteProperties = mapRouteProperties; exports.hydrationRouteProperties = hydrationRouteProperties; exports.createMemoryRouter = createMemoryRouter; exports.UNSTABLE_TransitionEnabledRouterProvider = UNSTABLE_TransitionEnabledRouterProvider; exports.RouterProvider = RouterProvider; exports.MemoryRouter = MemoryRouter; exports.Navigate = Navigate; exports.Outlet = Outlet; exports.Route = Route; exports.Router = Router; exports.Routes = Routes; exports.Await = Await; exports.createRoutesFromChildren = createRoutesFromChildren; exports.createRoutesFromElements = createRoutesFromElements; exports.renderMatches = renderMatches; exports.WithComponentProps = WithComponentProps; exports.withComponentProps = withComponentProps; exports.WithHydrateFallbackProps = WithHydrateFallbackProps; exports.withHydrateFallbackProps = withHydrateFallbackProps; exports.WithErrorBoundaryProps = WithErrorBoundaryProps; exports.withErrorBoundaryProps = withErrorBoundaryProps; exports.createSearchParams = createSearchParams; exports.createBrowserRouter = createBrowserRouter; exports.createHashRouter = createHashRouter; exports.BrowserRouter = BrowserRouter; exports.HashRouter = HashRouter; exports.HistoryRouter = HistoryRouter; exports.Link = Link; exports.NavLink = NavLink; exports.Form = Form; exports.ScrollRestoration = ScrollRestoration; exports.useLinkClickHandler = useLinkClickHandler; exports.useSearchParams = useSearchParams; exports.useSubmit = useSubmit; exports.useFormAction = useFormAction; exports.useFetcher = useFetcher; exports.useFetchers = useFetchers; exports.useScrollRestoration = useScrollRestoration; exports.useBeforeUnload = useBeforeUnload; exports.usePrompt = usePrompt; exports.useViewTransitionState = useViewTransitionState; exports.StaticRouter = StaticRouter; exports.StaticRouterProvider = StaticRouterProvider; exports.createStaticHandler = createStaticHandler2; exports.createStaticRouter = createStaticRouter;
|