react-router 7.14.1 → 7.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +105 -0
- package/dist/development/{browser-D-3-U2Jj.d.mts → browser-CRsXgNrY.d.mts} +2 -2
- package/dist/{production/browser-D-3-U2Jj.d.mts → development/browser-wDl1FZEL.d.ts} +2 -2
- package/dist/{production/chunk-3SUPTI2U.js → development/chunk-2D5H3HU3.js} +7 -7
- package/dist/development/{chunk-OE4NN4TA.mjs → chunk-5KNZJZUH.mjs} +362 -213
- package/dist/development/{chunk-YMKMFAYZ.js → chunk-AM3XM4LS.js} +314 -172
- package/dist/development/{chunk-BFXCU3MI.mjs → chunk-RMD3H4O3.mjs} +81 -62
- package/dist/development/{chunk-3F6IB66O.js → chunk-Z5YQYACE.js} +146 -139
- package/dist/{production/context-BzhbVly6.d.mts → development/context-BQs41HrG.d.mts} +94 -42
- package/dist/development/{routeModules-CM_clkdE.d.ts → data-BVUf681J.d.mts} +89 -56
- package/dist/{production/routeModules-CM_clkdE.d.ts → development/data-BqZ2x964.d.ts} +79 -46
- package/dist/development/dom-export.d.mts +9 -9
- package/dist/development/dom-export.d.ts +9 -9
- package/dist/development/dom-export.js +37 -40
- package/dist/development/dom-export.mjs +12 -15
- package/dist/development/{index-react-server-client-CimaPp9o.d.ts → index-react-server-client-CSv-KZBk.d.ts} +123 -121
- package/dist/{production/index-react-server-client-WSaoxloq.d.mts → development/index-react-server-client-Ck_yZ1qL.d.mts} +102 -100
- package/dist/development/index-react-server-client.d.mts +3 -3
- package/dist/development/index-react-server-client.d.ts +3 -3
- 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 +107 -36
- package/dist/development/index-react-server.d.ts +107 -36
- package/dist/development/index-react-server.js +60 -33
- package/dist/development/index-react-server.mjs +60 -33
- package/dist/development/index.d.mts +11 -11
- package/dist/development/index.d.ts +11 -11
- package/dist/development/index.js +174 -155
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-CMVbvxj9.d.ts → development/instrumentation-DlJ2QV7d.d.ts} +73 -21
- package/dist/development/lib/types/internal.d.mts +2 -2
- package/dist/development/lib/types/internal.d.ts +2 -2
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{register-D1WlEpq9.d.ts → register-Bsscfj79.d.ts} +1 -1
- package/dist/{production/register-D1WlEpq9.d.ts → development/register-Df8okEea.d.mts} +1 -1
- package/dist/production/{browser-CtktEGQs.d.ts → browser-CRsXgNrY.d.mts} +2 -2
- package/dist/{development/browser-CtktEGQs.d.ts → production/browser-wDl1FZEL.d.ts} +2 -2
- package/dist/production/{chunk-G5ZWO7Q6.mjs → chunk-23ZOHYE5.mjs} +81 -62
- package/dist/{development/chunk-7VLQJKNG.js → production/chunk-7YXKJMLN.js} +7 -7
- package/dist/production/{chunk-SPR7R4GU.mjs → chunk-GM3PW4GX.mjs} +362 -213
- package/dist/production/{chunk-UVEQGZIH.js → chunk-LCJTIOKZ.js} +314 -172
- package/dist/production/{chunk-LIOP3ILM.js → chunk-YBQJ3ABE.js} +146 -139
- package/dist/{development/context-BzhbVly6.d.mts → production/context-BQs41HrG.d.mts} +94 -42
- package/dist/{development/routeModules-Djumx26z.d.mts → production/data-BVUf681J.d.mts} +79 -46
- package/dist/production/{routeModules-Djumx26z.d.mts → data-BqZ2x964.d.ts} +89 -56
- package/dist/production/dom-export.d.mts +9 -9
- package/dist/production/dom-export.d.ts +9 -9
- package/dist/production/dom-export.js +37 -40
- package/dist/production/dom-export.mjs +12 -15
- package/dist/production/{index-react-server-client-CimaPp9o.d.ts → index-react-server-client-CSv-KZBk.d.ts} +123 -121
- package/dist/{development/index-react-server-client-WSaoxloq.d.mts → production/index-react-server-client-Ck_yZ1qL.d.mts} +102 -100
- package/dist/production/index-react-server-client.d.mts +3 -3
- package/dist/production/index-react-server-client.d.ts +3 -3
- 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 +107 -36
- package/dist/production/index-react-server.d.ts +107 -36
- package/dist/production/index-react-server.js +60 -33
- package/dist/production/index-react-server.mjs +60 -33
- package/dist/production/index.d.mts +11 -11
- package/dist/production/index.d.ts +11 -11
- package/dist/production/index.js +174 -155
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-CMVbvxj9.d.ts → production/instrumentation-DlJ2QV7d.d.ts} +73 -21
- package/dist/production/lib/types/internal.d.mts +2 -2
- package/dist/production/lib/types/internal.d.ts +2 -2
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/{development/register-aE9ob3TK.d.mts → production/register-Bsscfj79.d.ts} +1 -1
- package/dist/production/{register-aE9ob3TK.d.mts → register-Df8okEea.d.mts} +1 -1
- 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.
|
|
2
|
+
* react-router v7.15.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
var
|
|
54
|
+
var _chunkLCJTIOKZjs = require('./chunk-LCJTIOKZ.js');
|
|
55
55
|
|
|
56
56
|
// lib/dom/dom.ts
|
|
57
57
|
var defaultMethod = "get";
|
|
@@ -122,7 +122,7 @@ var supportedFormEncTypes = /* @__PURE__ */ new Set([
|
|
|
122
122
|
]);
|
|
123
123
|
function getFormEncType(encType) {
|
|
124
124
|
if (encType != null && !supportedFormEncTypes.has(encType)) {
|
|
125
|
-
|
|
125
|
+
_chunkLCJTIOKZjs.warning.call(void 0,
|
|
126
126
|
false,
|
|
127
127
|
`"${encType}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`
|
|
128
128
|
);
|
|
@@ -138,7 +138,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
138
138
|
let body;
|
|
139
139
|
if (isFormElement(target)) {
|
|
140
140
|
let attr = target.getAttribute("action");
|
|
141
|
-
action = attr ?
|
|
141
|
+
action = attr ? _chunkLCJTIOKZjs.stripBasename.call(void 0, attr, basename) : null;
|
|
142
142
|
method = target.getAttribute("method") || defaultMethod;
|
|
143
143
|
encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
|
|
144
144
|
formData = new FormData(target);
|
|
@@ -150,7 +150,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
150
150
|
);
|
|
151
151
|
}
|
|
152
152
|
let attr = target.getAttribute("formaction") || form.getAttribute("action");
|
|
153
|
-
action = attr ?
|
|
153
|
+
action = attr ? _chunkLCJTIOKZjs.stripBasename.call(void 0, attr, basename) : null;
|
|
154
154
|
method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
|
|
155
155
|
encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
|
|
156
156
|
formData = new FormData(form, target);
|
|
@@ -187,40 +187,40 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
|
|
|
187
187
|
try {
|
|
188
188
|
if (isBrowser) {
|
|
189
189
|
window.__reactRouterVersion = // @ts-expect-error
|
|
190
|
-
"7.
|
|
190
|
+
"7.15.0";
|
|
191
191
|
}
|
|
192
192
|
} catch (e) {
|
|
193
193
|
}
|
|
194
194
|
function createBrowserRouter(routes, opts) {
|
|
195
|
-
return
|
|
195
|
+
return _chunkLCJTIOKZjs.createRouter.call(void 0, {
|
|
196
196
|
basename: _optionalChain([opts, 'optionalAccess', _2 => _2.basename]),
|
|
197
197
|
getContext: _optionalChain([opts, 'optionalAccess', _3 => _3.getContext]),
|
|
198
198
|
future: _optionalChain([opts, 'optionalAccess', _4 => _4.future]),
|
|
199
|
-
history:
|
|
199
|
+
history: _chunkLCJTIOKZjs.createBrowserHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _5 => _5.window]) }),
|
|
200
200
|
hydrationData: _optionalChain([opts, 'optionalAccess', _6 => _6.hydrationData]) || parseHydrationData(),
|
|
201
201
|
routes,
|
|
202
|
-
mapRouteProperties:
|
|
203
|
-
hydrationRouteProperties:
|
|
202
|
+
mapRouteProperties: _chunkLCJTIOKZjs.mapRouteProperties,
|
|
203
|
+
hydrationRouteProperties: _chunkLCJTIOKZjs.hydrationRouteProperties,
|
|
204
204
|
dataStrategy: _optionalChain([opts, 'optionalAccess', _7 => _7.dataStrategy]),
|
|
205
205
|
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _8 => _8.patchRoutesOnNavigation]),
|
|
206
206
|
window: _optionalChain([opts, 'optionalAccess', _9 => _9.window]),
|
|
207
|
-
|
|
207
|
+
instrumentations: _optionalChain([opts, 'optionalAccess', _10 => _10.instrumentations])
|
|
208
208
|
}).initialize();
|
|
209
209
|
}
|
|
210
210
|
function createHashRouter(routes, opts) {
|
|
211
|
-
return
|
|
211
|
+
return _chunkLCJTIOKZjs.createRouter.call(void 0, {
|
|
212
212
|
basename: _optionalChain([opts, 'optionalAccess', _11 => _11.basename]),
|
|
213
213
|
getContext: _optionalChain([opts, 'optionalAccess', _12 => _12.getContext]),
|
|
214
214
|
future: _optionalChain([opts, 'optionalAccess', _13 => _13.future]),
|
|
215
|
-
history:
|
|
215
|
+
history: _chunkLCJTIOKZjs.createHashHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _14 => _14.window]) }),
|
|
216
216
|
hydrationData: _optionalChain([opts, 'optionalAccess', _15 => _15.hydrationData]) || parseHydrationData(),
|
|
217
217
|
routes,
|
|
218
|
-
mapRouteProperties:
|
|
219
|
-
hydrationRouteProperties:
|
|
218
|
+
mapRouteProperties: _chunkLCJTIOKZjs.mapRouteProperties,
|
|
219
|
+
hydrationRouteProperties: _chunkLCJTIOKZjs.hydrationRouteProperties,
|
|
220
220
|
dataStrategy: _optionalChain([opts, 'optionalAccess', _16 => _16.dataStrategy]),
|
|
221
221
|
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _17 => _17.patchRoutesOnNavigation]),
|
|
222
222
|
window: _optionalChain([opts, 'optionalAccess', _18 => _18.window]),
|
|
223
|
-
|
|
223
|
+
instrumentations: _optionalChain([opts, 'optionalAccess', _19 => _19.instrumentations])
|
|
224
224
|
}).initialize();
|
|
225
225
|
}
|
|
226
226
|
function parseHydrationData() {
|
|
@@ -239,7 +239,7 @@ function deserializeErrors(errors) {
|
|
|
239
239
|
let serialized = {};
|
|
240
240
|
for (let [key, val] of entries) {
|
|
241
241
|
if (val && val.__type === "RouteErrorResponse") {
|
|
242
|
-
serialized[key] = new (0,
|
|
242
|
+
serialized[key] = new (0, _chunkLCJTIOKZjs.ErrorResponseImpl)(
|
|
243
243
|
val.status,
|
|
244
244
|
val.statusText,
|
|
245
245
|
val.data,
|
|
@@ -271,12 +271,12 @@ function deserializeErrors(errors) {
|
|
|
271
271
|
function BrowserRouter({
|
|
272
272
|
basename,
|
|
273
273
|
children,
|
|
274
|
-
|
|
274
|
+
useTransitions,
|
|
275
275
|
window: window2
|
|
276
276
|
}) {
|
|
277
277
|
let historyRef = React.useRef();
|
|
278
278
|
if (historyRef.current == null) {
|
|
279
|
-
historyRef.current =
|
|
279
|
+
historyRef.current = _chunkLCJTIOKZjs.createBrowserHistory.call(void 0, { window: window2, v5Compat: true });
|
|
280
280
|
}
|
|
281
281
|
let history = historyRef.current;
|
|
282
282
|
let [state, setStateImpl] = React.useState({
|
|
@@ -285,36 +285,36 @@ function BrowserRouter({
|
|
|
285
285
|
});
|
|
286
286
|
let setState = React.useCallback(
|
|
287
287
|
(newState) => {
|
|
288
|
-
if (
|
|
288
|
+
if (useTransitions === false) {
|
|
289
289
|
setStateImpl(newState);
|
|
290
290
|
} else {
|
|
291
291
|
React.startTransition(() => setStateImpl(newState));
|
|
292
292
|
}
|
|
293
293
|
},
|
|
294
|
-
[
|
|
294
|
+
[useTransitions]
|
|
295
295
|
);
|
|
296
296
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
297
297
|
return /* @__PURE__ */ React.createElement(
|
|
298
|
-
|
|
298
|
+
_chunkLCJTIOKZjs.Router,
|
|
299
299
|
{
|
|
300
300
|
basename,
|
|
301
301
|
children,
|
|
302
302
|
location: state.location,
|
|
303
303
|
navigationType: state.action,
|
|
304
304
|
navigator: history,
|
|
305
|
-
|
|
305
|
+
useTransitions
|
|
306
306
|
}
|
|
307
307
|
);
|
|
308
308
|
}
|
|
309
309
|
function HashRouter({
|
|
310
310
|
basename,
|
|
311
311
|
children,
|
|
312
|
-
|
|
312
|
+
useTransitions,
|
|
313
313
|
window: window2
|
|
314
314
|
}) {
|
|
315
315
|
let historyRef = React.useRef();
|
|
316
316
|
if (historyRef.current == null) {
|
|
317
|
-
historyRef.current =
|
|
317
|
+
historyRef.current = _chunkLCJTIOKZjs.createHashHistory.call(void 0, { window: window2, v5Compat: true });
|
|
318
318
|
}
|
|
319
319
|
let history = historyRef.current;
|
|
320
320
|
let [state, setStateImpl] = React.useState({
|
|
@@ -323,24 +323,24 @@ function HashRouter({
|
|
|
323
323
|
});
|
|
324
324
|
let setState = React.useCallback(
|
|
325
325
|
(newState) => {
|
|
326
|
-
if (
|
|
326
|
+
if (useTransitions === false) {
|
|
327
327
|
setStateImpl(newState);
|
|
328
328
|
} else {
|
|
329
329
|
React.startTransition(() => setStateImpl(newState));
|
|
330
330
|
}
|
|
331
331
|
},
|
|
332
|
-
[
|
|
332
|
+
[useTransitions]
|
|
333
333
|
);
|
|
334
334
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
335
335
|
return /* @__PURE__ */ React.createElement(
|
|
336
|
-
|
|
336
|
+
_chunkLCJTIOKZjs.Router,
|
|
337
337
|
{
|
|
338
338
|
basename,
|
|
339
339
|
children,
|
|
340
340
|
location: state.location,
|
|
341
341
|
navigationType: state.action,
|
|
342
342
|
navigator: history,
|
|
343
|
-
|
|
343
|
+
useTransitions
|
|
344
344
|
}
|
|
345
345
|
);
|
|
346
346
|
}
|
|
@@ -348,7 +348,7 @@ function HistoryRouter({
|
|
|
348
348
|
basename,
|
|
349
349
|
children,
|
|
350
350
|
history,
|
|
351
|
-
|
|
351
|
+
useTransitions
|
|
352
352
|
}) {
|
|
353
353
|
let [state, setStateImpl] = React.useState({
|
|
354
354
|
action: history.action,
|
|
@@ -356,24 +356,24 @@ function HistoryRouter({
|
|
|
356
356
|
});
|
|
357
357
|
let setState = React.useCallback(
|
|
358
358
|
(newState) => {
|
|
359
|
-
if (
|
|
359
|
+
if (useTransitions === false) {
|
|
360
360
|
setStateImpl(newState);
|
|
361
361
|
} else {
|
|
362
362
|
React.startTransition(() => setStateImpl(newState));
|
|
363
363
|
}
|
|
364
364
|
},
|
|
365
|
-
[
|
|
365
|
+
[useTransitions]
|
|
366
366
|
);
|
|
367
367
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
368
368
|
return /* @__PURE__ */ React.createElement(
|
|
369
|
-
|
|
369
|
+
_chunkLCJTIOKZjs.Router,
|
|
370
370
|
{
|
|
371
371
|
basename,
|
|
372
372
|
children,
|
|
373
373
|
location: state.location,
|
|
374
374
|
navigationType: state.action,
|
|
375
375
|
navigator: history,
|
|
376
|
-
|
|
376
|
+
useTransitions
|
|
377
377
|
}
|
|
378
378
|
);
|
|
379
379
|
}
|
|
@@ -387,48 +387,48 @@ var Link = React.forwardRef(
|
|
|
387
387
|
relative,
|
|
388
388
|
reloadDocument,
|
|
389
389
|
replace,
|
|
390
|
-
|
|
390
|
+
mask,
|
|
391
391
|
state,
|
|
392
392
|
target,
|
|
393
393
|
to,
|
|
394
394
|
preventScrollReset,
|
|
395
395
|
viewTransition,
|
|
396
|
-
|
|
396
|
+
defaultShouldRevalidate,
|
|
397
397
|
...rest
|
|
398
398
|
}, forwardedRef) {
|
|
399
|
-
let { basename, navigator,
|
|
399
|
+
let { basename, navigator, useTransitions } = React.useContext(_chunkLCJTIOKZjs.NavigationContext);
|
|
400
400
|
let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX.test(to);
|
|
401
|
-
let parsed =
|
|
401
|
+
let parsed = _chunkLCJTIOKZjs.parseToInfo.call(void 0, to, basename);
|
|
402
402
|
to = parsed.to;
|
|
403
|
-
let href =
|
|
404
|
-
let location =
|
|
403
|
+
let href = _chunkLCJTIOKZjs.useHref.call(void 0, to, { relative });
|
|
404
|
+
let location = _chunkLCJTIOKZjs.useLocation.call(void 0, );
|
|
405
405
|
let maskedHref = null;
|
|
406
|
-
if (
|
|
407
|
-
let resolved =
|
|
408
|
-
|
|
406
|
+
if (mask) {
|
|
407
|
+
let resolved = _chunkLCJTIOKZjs.resolveTo.call(void 0,
|
|
408
|
+
mask,
|
|
409
409
|
[],
|
|
410
|
-
location.
|
|
410
|
+
location.mask ? location.mask.pathname : "/",
|
|
411
411
|
true
|
|
412
412
|
);
|
|
413
413
|
if (basename !== "/") {
|
|
414
|
-
resolved.pathname = resolved.pathname === "/" ? basename :
|
|
414
|
+
resolved.pathname = resolved.pathname === "/" ? basename : _chunkLCJTIOKZjs.joinPaths.call(void 0, [basename, resolved.pathname]);
|
|
415
415
|
}
|
|
416
416
|
maskedHref = navigator.createHref(resolved);
|
|
417
417
|
}
|
|
418
|
-
let [shouldPrefetch, prefetchRef, prefetchHandlers] =
|
|
418
|
+
let [shouldPrefetch, prefetchRef, prefetchHandlers] = _chunkLCJTIOKZjs.usePrefetchBehavior.call(void 0,
|
|
419
419
|
prefetch,
|
|
420
420
|
rest
|
|
421
421
|
);
|
|
422
422
|
let internalOnClick = useLinkClickHandler(to, {
|
|
423
423
|
replace,
|
|
424
|
-
|
|
424
|
+
mask,
|
|
425
425
|
state,
|
|
426
426
|
target,
|
|
427
427
|
preventScrollReset,
|
|
428
428
|
relative,
|
|
429
429
|
viewTransition,
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
defaultShouldRevalidate,
|
|
431
|
+
useTransitions
|
|
432
432
|
});
|
|
433
433
|
function handleClick(event) {
|
|
434
434
|
if (onClick) onClick(event);
|
|
@@ -446,13 +446,13 @@ var Link = React.forwardRef(
|
|
|
446
446
|
...prefetchHandlers,
|
|
447
447
|
href: (isSpaLink ? maskedHref : void 0) || parsed.absoluteURL || href,
|
|
448
448
|
onClick: isSpaLink ? handleClick : onClick,
|
|
449
|
-
ref:
|
|
449
|
+
ref: _chunkLCJTIOKZjs.mergeRefs.call(void 0, forwardedRef, prefetchRef),
|
|
450
450
|
target,
|
|
451
451
|
"data-discover": !isAbsolute && discover === "render" ? "true" : void 0
|
|
452
452
|
}
|
|
453
453
|
)
|
|
454
454
|
);
|
|
455
|
-
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(
|
|
455
|
+
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(_chunkLCJTIOKZjs.PrefetchPageLinks, { page: href })) : link;
|
|
456
456
|
}
|
|
457
457
|
);
|
|
458
458
|
Link.displayName = "Link";
|
|
@@ -468,10 +468,10 @@ var NavLink = React.forwardRef(
|
|
|
468
468
|
children,
|
|
469
469
|
...rest
|
|
470
470
|
}, ref) {
|
|
471
|
-
let path =
|
|
472
|
-
let location =
|
|
473
|
-
let routerState = React.useContext(
|
|
474
|
-
let { navigator, basename } = React.useContext(
|
|
471
|
+
let path = _chunkLCJTIOKZjs.useResolvedPath.call(void 0, to, { relative: rest.relative });
|
|
472
|
+
let location = _chunkLCJTIOKZjs.useLocation.call(void 0, );
|
|
473
|
+
let routerState = React.useContext(_chunkLCJTIOKZjs.DataRouterStateContext);
|
|
474
|
+
let { navigator, basename } = React.useContext(_chunkLCJTIOKZjs.NavigationContext);
|
|
475
475
|
let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
|
|
476
476
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
477
477
|
useViewTransitionState(path) && viewTransition === true;
|
|
@@ -484,7 +484,7 @@ var NavLink = React.forwardRef(
|
|
|
484
484
|
toPathname = toPathname.toLowerCase();
|
|
485
485
|
}
|
|
486
486
|
if (nextLocationPathname && basename) {
|
|
487
|
-
nextLocationPathname =
|
|
487
|
+
nextLocationPathname = _chunkLCJTIOKZjs.stripBasename.call(void 0, nextLocationPathname, basename) || nextLocationPathname;
|
|
488
488
|
}
|
|
489
489
|
const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
|
|
490
490
|
let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
|
|
@@ -537,10 +537,10 @@ var Form = React.forwardRef(
|
|
|
537
537
|
relative,
|
|
538
538
|
preventScrollReset,
|
|
539
539
|
viewTransition,
|
|
540
|
-
|
|
540
|
+
defaultShouldRevalidate,
|
|
541
541
|
...props
|
|
542
542
|
}, forwardedRef) => {
|
|
543
|
-
let {
|
|
543
|
+
let { useTransitions } = React.useContext(_chunkLCJTIOKZjs.NavigationContext);
|
|
544
544
|
let submit = useSubmit();
|
|
545
545
|
let formAction = useFormAction(action, { relative });
|
|
546
546
|
let formMethod = method.toLowerCase() === "get" ? "get" : "post";
|
|
@@ -560,9 +560,9 @@ var Form = React.forwardRef(
|
|
|
560
560
|
relative,
|
|
561
561
|
preventScrollReset,
|
|
562
562
|
viewTransition,
|
|
563
|
-
|
|
563
|
+
defaultShouldRevalidate
|
|
564
564
|
});
|
|
565
|
-
if (
|
|
565
|
+
if (useTransitions && navigate !== false) {
|
|
566
566
|
React.startTransition(() => doSubmit());
|
|
567
567
|
} else {
|
|
568
568
|
doSubmit();
|
|
@@ -587,10 +587,10 @@ function ScrollRestoration({
|
|
|
587
587
|
storageKey,
|
|
588
588
|
...props
|
|
589
589
|
}) {
|
|
590
|
-
let remixContext = React.useContext(
|
|
591
|
-
let { basename } = React.useContext(
|
|
592
|
-
let location =
|
|
593
|
-
let matches =
|
|
590
|
+
let remixContext = React.useContext(_chunkLCJTIOKZjs.FrameworkContext);
|
|
591
|
+
let { basename } = React.useContext(_chunkLCJTIOKZjs.NavigationContext);
|
|
592
|
+
let location = _chunkLCJTIOKZjs.useLocation.call(void 0, );
|
|
593
|
+
let matches = _chunkLCJTIOKZjs.useMatches.call(void 0, );
|
|
594
594
|
useScrollRestoration({ getKey, storageKey });
|
|
595
595
|
let ssrKey = React.useMemo(
|
|
596
596
|
() => {
|
|
@@ -632,9 +632,9 @@ function ScrollRestoration({
|
|
|
632
632
|
...props,
|
|
633
633
|
suppressHydrationWarning: true,
|
|
634
634
|
dangerouslySetInnerHTML: {
|
|
635
|
-
__html: `(${restoreScroll})(${
|
|
635
|
+
__html: `(${restoreScroll})(${_chunkLCJTIOKZjs.escapeHtml.call(void 0,
|
|
636
636
|
JSON.stringify(storageKey || SCROLL_RESTORATION_STORAGE_KEY)
|
|
637
|
-
)}, ${
|
|
637
|
+
)}, ${_chunkLCJTIOKZjs.escapeHtml.call(void 0, JSON.stringify(ssrKey))})`
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
640
|
);
|
|
@@ -644,44 +644,44 @@ function getDataRouterConsoleError(hookName) {
|
|
|
644
644
|
return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
645
645
|
}
|
|
646
646
|
function useDataRouterContext(hookName) {
|
|
647
|
-
let ctx = React.useContext(
|
|
648
|
-
|
|
647
|
+
let ctx = React.useContext(_chunkLCJTIOKZjs.DataRouterContext);
|
|
648
|
+
_chunkLCJTIOKZjs.invariant.call(void 0, ctx, getDataRouterConsoleError(hookName));
|
|
649
649
|
return ctx;
|
|
650
650
|
}
|
|
651
651
|
function useDataRouterState(hookName) {
|
|
652
|
-
let state = React.useContext(
|
|
653
|
-
|
|
652
|
+
let state = React.useContext(_chunkLCJTIOKZjs.DataRouterStateContext);
|
|
653
|
+
_chunkLCJTIOKZjs.invariant.call(void 0, state, getDataRouterConsoleError(hookName));
|
|
654
654
|
return state;
|
|
655
655
|
}
|
|
656
656
|
function useLinkClickHandler(to, {
|
|
657
657
|
target,
|
|
658
658
|
replace: replaceProp,
|
|
659
|
-
|
|
659
|
+
mask,
|
|
660
660
|
state,
|
|
661
661
|
preventScrollReset,
|
|
662
662
|
relative,
|
|
663
663
|
viewTransition,
|
|
664
|
-
|
|
665
|
-
|
|
664
|
+
defaultShouldRevalidate,
|
|
665
|
+
useTransitions
|
|
666
666
|
} = {}) {
|
|
667
|
-
let navigate =
|
|
668
|
-
let location =
|
|
669
|
-
let path =
|
|
667
|
+
let navigate = _chunkLCJTIOKZjs.useNavigate.call(void 0, );
|
|
668
|
+
let location = _chunkLCJTIOKZjs.useLocation.call(void 0, );
|
|
669
|
+
let path = _chunkLCJTIOKZjs.useResolvedPath.call(void 0, to, { relative });
|
|
670
670
|
return React.useCallback(
|
|
671
671
|
(event) => {
|
|
672
672
|
if (shouldProcessLinkClick(event, target)) {
|
|
673
673
|
event.preventDefault();
|
|
674
|
-
let replace = replaceProp !== void 0 ? replaceProp :
|
|
674
|
+
let replace = replaceProp !== void 0 ? replaceProp : _chunkLCJTIOKZjs.createPath.call(void 0, location) === _chunkLCJTIOKZjs.createPath.call(void 0, path);
|
|
675
675
|
let doNavigate = () => navigate(to, {
|
|
676
676
|
replace,
|
|
677
|
-
|
|
677
|
+
mask,
|
|
678
678
|
state,
|
|
679
679
|
preventScrollReset,
|
|
680
680
|
relative,
|
|
681
681
|
viewTransition,
|
|
682
|
-
|
|
682
|
+
defaultShouldRevalidate
|
|
683
683
|
});
|
|
684
|
-
if (
|
|
684
|
+
if (useTransitions) {
|
|
685
685
|
React.startTransition(() => doNavigate());
|
|
686
686
|
} else {
|
|
687
687
|
doNavigate();
|
|
@@ -693,26 +693,26 @@ function useLinkClickHandler(to, {
|
|
|
693
693
|
navigate,
|
|
694
694
|
path,
|
|
695
695
|
replaceProp,
|
|
696
|
-
|
|
696
|
+
mask,
|
|
697
697
|
state,
|
|
698
698
|
target,
|
|
699
699
|
to,
|
|
700
700
|
preventScrollReset,
|
|
701
701
|
relative,
|
|
702
702
|
viewTransition,
|
|
703
|
-
|
|
704
|
-
|
|
703
|
+
defaultShouldRevalidate,
|
|
704
|
+
useTransitions
|
|
705
705
|
]
|
|
706
706
|
);
|
|
707
707
|
}
|
|
708
708
|
function useSearchParams(defaultInit) {
|
|
709
|
-
|
|
709
|
+
_chunkLCJTIOKZjs.warning.call(void 0,
|
|
710
710
|
typeof URLSearchParams !== "undefined",
|
|
711
711
|
`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.`
|
|
712
712
|
);
|
|
713
713
|
let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));
|
|
714
714
|
let hasSetSearchParamsRef = React.useRef(false);
|
|
715
|
-
let location =
|
|
715
|
+
let location = _chunkLCJTIOKZjs.useLocation.call(void 0, );
|
|
716
716
|
let searchParams = React.useMemo(
|
|
717
717
|
() => (
|
|
718
718
|
// Only merge in the defaults if we haven't yet called setSearchParams.
|
|
@@ -725,7 +725,7 @@ function useSearchParams(defaultInit) {
|
|
|
725
725
|
),
|
|
726
726
|
[location.search]
|
|
727
727
|
);
|
|
728
|
-
let navigate =
|
|
728
|
+
let navigate = _chunkLCJTIOKZjs.useNavigate.call(void 0, );
|
|
729
729
|
let setSearchParams = React.useCallback(
|
|
730
730
|
(nextInit, navigateOptions) => {
|
|
731
731
|
const newSearchParams = createSearchParams(
|
|
@@ -742,8 +742,8 @@ var fetcherId = 0;
|
|
|
742
742
|
var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
|
|
743
743
|
function useSubmit() {
|
|
744
744
|
let { router } = useDataRouterContext("useSubmit" /* UseSubmit */);
|
|
745
|
-
let { basename } = React.useContext(
|
|
746
|
-
let currentRouteId =
|
|
745
|
+
let { basename } = React.useContext(_chunkLCJTIOKZjs.NavigationContext);
|
|
746
|
+
let currentRouteId = _chunkLCJTIOKZjs.useRouteId.call(void 0, );
|
|
747
747
|
let routerFetch = router.fetch;
|
|
748
748
|
let routerNavigate = router.navigate;
|
|
749
749
|
return React.useCallback(
|
|
@@ -755,7 +755,7 @@ function useSubmit() {
|
|
|
755
755
|
if (options.navigate === false) {
|
|
756
756
|
let key = options.fetcherKey || getUniqueFetcherId();
|
|
757
757
|
await routerFetch(key, currentRouteId, options.action || action, {
|
|
758
|
-
|
|
758
|
+
defaultShouldRevalidate: options.defaultShouldRevalidate,
|
|
759
759
|
preventScrollReset: options.preventScrollReset,
|
|
760
760
|
formData,
|
|
761
761
|
body,
|
|
@@ -765,7 +765,7 @@ function useSubmit() {
|
|
|
765
765
|
});
|
|
766
766
|
} else {
|
|
767
767
|
await routerNavigate(options.action || action, {
|
|
768
|
-
|
|
768
|
+
defaultShouldRevalidate: options.defaultShouldRevalidate,
|
|
769
769
|
preventScrollReset: options.preventScrollReset,
|
|
770
770
|
formData,
|
|
771
771
|
body,
|
|
@@ -783,12 +783,12 @@ function useSubmit() {
|
|
|
783
783
|
);
|
|
784
784
|
}
|
|
785
785
|
function useFormAction(action, { relative } = {}) {
|
|
786
|
-
let { basename } = React.useContext(
|
|
787
|
-
let routeContext = React.useContext(
|
|
788
|
-
|
|
786
|
+
let { basename } = React.useContext(_chunkLCJTIOKZjs.NavigationContext);
|
|
787
|
+
let routeContext = React.useContext(_chunkLCJTIOKZjs.RouteContext);
|
|
788
|
+
_chunkLCJTIOKZjs.invariant.call(void 0, routeContext, "useFormAction must be used inside a RouteContext");
|
|
789
789
|
let [match] = routeContext.matches.slice(-1);
|
|
790
|
-
let path = { ...
|
|
791
|
-
let location =
|
|
790
|
+
let path = { ..._chunkLCJTIOKZjs.useResolvedPath.call(void 0, action ? action : ".", { relative }) };
|
|
791
|
+
let location = _chunkLCJTIOKZjs.useLocation.call(void 0, );
|
|
792
792
|
if (action == null) {
|
|
793
793
|
path.search = location.search;
|
|
794
794
|
let params = new URLSearchParams(path.search);
|
|
@@ -805,21 +805,21 @@ function useFormAction(action, { relative } = {}) {
|
|
|
805
805
|
path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
|
|
806
806
|
}
|
|
807
807
|
if (basename !== "/") {
|
|
808
|
-
path.pathname = path.pathname === "/" ? basename :
|
|
808
|
+
path.pathname = path.pathname === "/" ? basename : _chunkLCJTIOKZjs.joinPaths.call(void 0, [basename, path.pathname]);
|
|
809
809
|
}
|
|
810
|
-
return
|
|
810
|
+
return _chunkLCJTIOKZjs.createPath.call(void 0, path);
|
|
811
811
|
}
|
|
812
812
|
function useFetcher({
|
|
813
813
|
key
|
|
814
814
|
} = {}) {
|
|
815
815
|
let { router } = useDataRouterContext("useFetcher" /* UseFetcher */);
|
|
816
816
|
let state = useDataRouterState("useFetcher" /* UseFetcher */);
|
|
817
|
-
let fetcherData = React.useContext(
|
|
818
|
-
let route = React.useContext(
|
|
817
|
+
let fetcherData = React.useContext(_chunkLCJTIOKZjs.FetchersContext);
|
|
818
|
+
let route = React.useContext(_chunkLCJTIOKZjs.RouteContext);
|
|
819
819
|
let routeId = _optionalChain([route, 'access', _23 => _23.matches, 'access', _24 => _24[route.matches.length - 1], 'optionalAccess', _25 => _25.route, 'access', _26 => _26.id]);
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
820
|
+
_chunkLCJTIOKZjs.invariant.call(void 0, fetcherData, `useFetcher must be used inside a FetchersContext`);
|
|
821
|
+
_chunkLCJTIOKZjs.invariant.call(void 0, route, `useFetcher must be used inside a RouteContext`);
|
|
822
|
+
_chunkLCJTIOKZjs.invariant.call(void 0,
|
|
823
823
|
routeId != null,
|
|
824
824
|
`useFetcher can only be used on routes that contain a unique "id"`
|
|
825
825
|
);
|
|
@@ -835,7 +835,7 @@ function useFetcher({
|
|
|
835
835
|
}, [deleteFetcher, getFetcher, fetcherKey]);
|
|
836
836
|
let load = React.useCallback(
|
|
837
837
|
async (href, opts) => {
|
|
838
|
-
|
|
838
|
+
_chunkLCJTIOKZjs.invariant.call(void 0, routeId, "No routeId available for fetcher.load()");
|
|
839
839
|
await routerFetch(fetcherKey, routeId, href, opts);
|
|
840
840
|
},
|
|
841
841
|
[fetcherKey, routeId, routerFetch]
|
|
@@ -864,7 +864,7 @@ function useFetcher({
|
|
|
864
864
|
FetcherForm2.displayName = "fetcher.Form";
|
|
865
865
|
return FetcherForm2;
|
|
866
866
|
}, [fetcherKey]);
|
|
867
|
-
let fetcher = state.fetchers.get(fetcherKey) ||
|
|
867
|
+
let fetcher = state.fetchers.get(fetcherKey) || _chunkLCJTIOKZjs.IDLE_FETCHER;
|
|
868
868
|
let data = fetcherData.get(fetcherKey);
|
|
869
869
|
let fetcherWithComponents = React.useMemo(
|
|
870
870
|
() => ({
|
|
@@ -895,7 +895,7 @@ function getScrollRestorationKey(location, matches, basename, getKey) {
|
|
|
895
895
|
key = getKey(
|
|
896
896
|
{
|
|
897
897
|
...location,
|
|
898
|
-
pathname:
|
|
898
|
+
pathname: _chunkLCJTIOKZjs.stripBasename.call(void 0, location.pathname, basename) || location.pathname
|
|
899
899
|
},
|
|
900
900
|
matches
|
|
901
901
|
);
|
|
@@ -916,10 +916,10 @@ function useScrollRestoration({
|
|
|
916
916
|
let { restoreScrollPosition, preventScrollReset } = useDataRouterState(
|
|
917
917
|
"useScrollRestoration" /* UseScrollRestoration */
|
|
918
918
|
);
|
|
919
|
-
let { basename } = React.useContext(
|
|
920
|
-
let location =
|
|
921
|
-
let matches =
|
|
922
|
-
let navigation =
|
|
919
|
+
let { basename } = React.useContext(_chunkLCJTIOKZjs.NavigationContext);
|
|
920
|
+
let location = _chunkLCJTIOKZjs.useLocation.call(void 0, );
|
|
921
|
+
let matches = _chunkLCJTIOKZjs.useMatches.call(void 0, );
|
|
922
|
+
let navigation = _chunkLCJTIOKZjs.useNavigation.call(void 0, );
|
|
923
923
|
React.useEffect(() => {
|
|
924
924
|
window.history.scrollRestoration = "manual";
|
|
925
925
|
return () => {
|
|
@@ -938,7 +938,7 @@ function useScrollRestoration({
|
|
|
938
938
|
JSON.stringify(savedScrollPositions)
|
|
939
939
|
);
|
|
940
940
|
} catch (error) {
|
|
941
|
-
|
|
941
|
+
_chunkLCJTIOKZjs.warning.call(void 0,
|
|
942
942
|
false,
|
|
943
943
|
`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${error}).`
|
|
944
944
|
);
|
|
@@ -985,7 +985,7 @@ function useScrollRestoration({
|
|
|
985
985
|
}
|
|
986
986
|
}
|
|
987
987
|
} catch (e2) {
|
|
988
|
-
|
|
988
|
+
_chunkLCJTIOKZjs.warning.call(void 0,
|
|
989
989
|
false,
|
|
990
990
|
`"${location.hash.slice(
|
|
991
991
|
1
|
|
@@ -1023,7 +1023,7 @@ function usePrompt({
|
|
|
1023
1023
|
when,
|
|
1024
1024
|
message
|
|
1025
1025
|
}) {
|
|
1026
|
-
let blocker =
|
|
1026
|
+
let blocker = _chunkLCJTIOKZjs.useBlocker.call(void 0, when);
|
|
1027
1027
|
React.useEffect(() => {
|
|
1028
1028
|
if (blocker.state === "blocked") {
|
|
1029
1029
|
let proceed = window.confirm(message);
|
|
@@ -1041,21 +1041,21 @@ function usePrompt({
|
|
|
1041
1041
|
}, [blocker, when]);
|
|
1042
1042
|
}
|
|
1043
1043
|
function useViewTransitionState(to, { relative } = {}) {
|
|
1044
|
-
let vtContext = React.useContext(
|
|
1045
|
-
|
|
1044
|
+
let vtContext = React.useContext(_chunkLCJTIOKZjs.ViewTransitionContext);
|
|
1045
|
+
_chunkLCJTIOKZjs.invariant.call(void 0,
|
|
1046
1046
|
vtContext != null,
|
|
1047
1047
|
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1048
1048
|
);
|
|
1049
1049
|
let { basename } = useDataRouterContext(
|
|
1050
1050
|
"useViewTransitionState" /* useViewTransitionState */
|
|
1051
1051
|
);
|
|
1052
|
-
let path =
|
|
1052
|
+
let path = _chunkLCJTIOKZjs.useResolvedPath.call(void 0, to, { relative });
|
|
1053
1053
|
if (!vtContext.isTransitioning) {
|
|
1054
1054
|
return false;
|
|
1055
1055
|
}
|
|
1056
|
-
let currentPath =
|
|
1057
|
-
let nextPath =
|
|
1058
|
-
return
|
|
1056
|
+
let currentPath = _chunkLCJTIOKZjs.stripBasename.call(void 0, vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
|
|
1057
|
+
let nextPath = _chunkLCJTIOKZjs.stripBasename.call(void 0, vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
|
|
1058
|
+
return _chunkLCJTIOKZjs.matchPath.call(void 0, path.pathname, nextPath) != null || _chunkLCJTIOKZjs.matchPath.call(void 0, path.pathname, currentPath) != null;
|
|
1059
1059
|
}
|
|
1060
1060
|
|
|
1061
1061
|
// lib/dom/server.tsx
|
|
@@ -1066,7 +1066,7 @@ function StaticRouter({
|
|
|
1066
1066
|
location: locationProp = "/"
|
|
1067
1067
|
}) {
|
|
1068
1068
|
if (typeof locationProp === "string") {
|
|
1069
|
-
locationProp =
|
|
1069
|
+
locationProp = _chunkLCJTIOKZjs.parsePath.call(void 0, locationProp);
|
|
1070
1070
|
}
|
|
1071
1071
|
let action = "POP" /* Pop */;
|
|
1072
1072
|
let location = {
|
|
@@ -1075,11 +1075,11 @@ function StaticRouter({
|
|
|
1075
1075
|
hash: locationProp.hash || "",
|
|
1076
1076
|
state: locationProp.state != null ? locationProp.state : null,
|
|
1077
1077
|
key: locationProp.key || "default",
|
|
1078
|
-
|
|
1078
|
+
mask: void 0
|
|
1079
1079
|
};
|
|
1080
1080
|
let staticNavigator = getStatelessNavigator();
|
|
1081
1081
|
return /* @__PURE__ */ React2.createElement(
|
|
1082
|
-
|
|
1082
|
+
_chunkLCJTIOKZjs.Router,
|
|
1083
1083
|
{
|
|
1084
1084
|
basename,
|
|
1085
1085
|
children,
|
|
@@ -1087,7 +1087,7 @@ function StaticRouter({
|
|
|
1087
1087
|
navigationType: action,
|
|
1088
1088
|
navigator: staticNavigator,
|
|
1089
1089
|
static: true,
|
|
1090
|
-
|
|
1090
|
+
useTransitions: false
|
|
1091
1091
|
}
|
|
1092
1092
|
);
|
|
1093
1093
|
}
|
|
@@ -1097,7 +1097,7 @@ function StaticRouterProvider({
|
|
|
1097
1097
|
hydrate = true,
|
|
1098
1098
|
nonce
|
|
1099
1099
|
}) {
|
|
1100
|
-
|
|
1100
|
+
_chunkLCJTIOKZjs.invariant.call(void 0,
|
|
1101
1101
|
router && context,
|
|
1102
1102
|
"You must provide `router` and `context` to <StaticRouterProvider>"
|
|
1103
1103
|
);
|
|
@@ -1116,23 +1116,24 @@ function StaticRouterProvider({
|
|
|
1116
1116
|
actionData: context.actionData,
|
|
1117
1117
|
errors: serializeErrors(context.errors)
|
|
1118
1118
|
};
|
|
1119
|
-
let json =
|
|
1119
|
+
let json = _chunkLCJTIOKZjs.escapeHtml.call(void 0, JSON.stringify(JSON.stringify(data)));
|
|
1120
1120
|
hydrateScript = `window.__staticRouterHydrationData = JSON.parse(${json});`;
|
|
1121
1121
|
}
|
|
1122
1122
|
let { state } = dataRouterContext.router;
|
|
1123
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
|
1124
|
-
|
|
1123
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(_chunkLCJTIOKZjs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React2.createElement(_chunkLCJTIOKZjs.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React2.createElement(_chunkLCJTIOKZjs.FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ React2.createElement(_chunkLCJTIOKZjs.ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ React2.createElement(
|
|
1124
|
+
_chunkLCJTIOKZjs.Router,
|
|
1125
1125
|
{
|
|
1126
1126
|
basename: dataRouterContext.basename,
|
|
1127
1127
|
location: state.location,
|
|
1128
1128
|
navigationType: state.historyAction,
|
|
1129
1129
|
navigator: dataRouterContext.navigator,
|
|
1130
1130
|
static: dataRouterContext.static,
|
|
1131
|
-
|
|
1131
|
+
useTransitions: false
|
|
1132
1132
|
},
|
|
1133
1133
|
/* @__PURE__ */ React2.createElement(
|
|
1134
|
-
|
|
1134
|
+
_chunkLCJTIOKZjs.DataRoutes,
|
|
1135
1135
|
{
|
|
1136
|
+
manifest: router.manifest,
|
|
1136
1137
|
routes: router.routes,
|
|
1137
1138
|
future: router.future,
|
|
1138
1139
|
state,
|
|
@@ -1153,7 +1154,7 @@ function serializeErrors(errors) {
|
|
|
1153
1154
|
let entries = Object.entries(errors);
|
|
1154
1155
|
let serialized = {};
|
|
1155
1156
|
for (let [key, val] of entries) {
|
|
1156
|
-
if (
|
|
1157
|
+
if (_chunkLCJTIOKZjs.isRouteErrorResponse.call(void 0, val)) {
|
|
1157
1158
|
serialized[key] = { ...val, __type: "RouteErrorResponse" };
|
|
1158
1159
|
} else if (val instanceof Error) {
|
|
1159
1160
|
serialized[key] = {
|
|
@@ -1203,16 +1204,16 @@ function getStatelessNavigator() {
|
|
|
1203
1204
|
};
|
|
1204
1205
|
}
|
|
1205
1206
|
function createStaticHandler2(routes, opts) {
|
|
1206
|
-
return
|
|
1207
|
+
return _chunkLCJTIOKZjs.createStaticHandler.call(void 0, routes, {
|
|
1207
1208
|
...opts,
|
|
1208
|
-
mapRouteProperties:
|
|
1209
|
+
mapRouteProperties: _chunkLCJTIOKZjs.mapRouteProperties
|
|
1209
1210
|
});
|
|
1210
1211
|
}
|
|
1211
1212
|
function createStaticRouter(routes, context, opts = {}) {
|
|
1212
1213
|
let manifest = {};
|
|
1213
|
-
let dataRoutes =
|
|
1214
|
+
let dataRoutes = _chunkLCJTIOKZjs.convertRoutesToDataRoutes.call(void 0,
|
|
1214
1215
|
routes,
|
|
1215
|
-
|
|
1216
|
+
_chunkLCJTIOKZjs.mapRouteProperties,
|
|
1216
1217
|
void 0,
|
|
1217
1218
|
manifest
|
|
1218
1219
|
);
|
|
@@ -1231,7 +1232,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1231
1232
|
get future() {
|
|
1232
1233
|
return {
|
|
1233
1234
|
v8_middleware: false,
|
|
1234
|
-
|
|
1235
|
+
v8_passThroughRequests: false,
|
|
1235
1236
|
..._optionalChain([opts, 'optionalAccess', _29 => _29.future])
|
|
1236
1237
|
};
|
|
1237
1238
|
},
|
|
@@ -1245,7 +1246,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1245
1246
|
errors: context.errors,
|
|
1246
1247
|
initialized: true,
|
|
1247
1248
|
renderFallback: false,
|
|
1248
|
-
navigation:
|
|
1249
|
+
navigation: _chunkLCJTIOKZjs.IDLE_NAVIGATION,
|
|
1249
1250
|
restoreScrollPosition: null,
|
|
1250
1251
|
preventScrollReset: false,
|
|
1251
1252
|
revalidation: "idle",
|
|
@@ -1256,6 +1257,12 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1256
1257
|
get routes() {
|
|
1257
1258
|
return dataRoutes;
|
|
1258
1259
|
},
|
|
1260
|
+
get branches() {
|
|
1261
|
+
return opts.branches;
|
|
1262
|
+
},
|
|
1263
|
+
get manifest() {
|
|
1264
|
+
return manifest;
|
|
1265
|
+
},
|
|
1259
1266
|
get window() {
|
|
1260
1267
|
return void 0;
|
|
1261
1268
|
},
|
|
@@ -1280,7 +1287,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1280
1287
|
createHref,
|
|
1281
1288
|
encodeLocation,
|
|
1282
1289
|
getFetcher() {
|
|
1283
|
-
return
|
|
1290
|
+
return _chunkLCJTIOKZjs.IDLE_FETCHER;
|
|
1284
1291
|
},
|
|
1285
1292
|
deleteFetcher() {
|
|
1286
1293
|
throw msg("deleteFetcher");
|
|
@@ -1292,7 +1299,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1292
1299
|
throw msg("dispose");
|
|
1293
1300
|
},
|
|
1294
1301
|
getBlocker() {
|
|
1295
|
-
return
|
|
1302
|
+
return _chunkLCJTIOKZjs.IDLE_BLOCKER;
|
|
1296
1303
|
},
|
|
1297
1304
|
deleteBlocker() {
|
|
1298
1305
|
throw msg("deleteBlocker");
|
|
@@ -1310,10 +1317,10 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1310
1317
|
};
|
|
1311
1318
|
}
|
|
1312
1319
|
function createHref(to) {
|
|
1313
|
-
return typeof to === "string" ? to :
|
|
1320
|
+
return typeof to === "string" ? to : _chunkLCJTIOKZjs.createPath.call(void 0, to);
|
|
1314
1321
|
}
|
|
1315
1322
|
function encodeLocation(to) {
|
|
1316
|
-
let href = typeof to === "string" ? to :
|
|
1323
|
+
let href = typeof to === "string" ? to : _chunkLCJTIOKZjs.createPath.call(void 0, to);
|
|
1317
1324
|
href = href.replace(/ $/, "%20");
|
|
1318
1325
|
let encoded = ABSOLUTE_URL_REGEX2.test(href) ? new URL(href) : new URL(href, "http://localhost");
|
|
1319
1326
|
return {
|