react-router 7.9.6-pre.1 → 7.10.0-pre.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 +69 -4
- package/dist/development/{browser-C07r42Tt.d.mts → browser-BHySFrZ2.d.mts} +1 -1
- package/dist/development/{browser-BbBXFHbO.d.ts → browser-eL-tAN4R.d.ts} +1 -1
- package/dist/development/{chunk-HSVNPM3C.js → chunk-2VILFZWG.js} +167 -123
- package/dist/development/{chunk-DKSAHU2I.mjs → chunk-4BTFPFZR.mjs} +208 -221
- package/dist/development/{chunk-RGKEVI2W.mjs → chunk-CECIHG5K.mjs} +15 -5
- package/dist/development/{chunk-CYHICRRW.js → chunk-M4WLV5HP.js} +201 -258
- package/dist/development/{chunk-OLIKX45O.js → chunk-Z4R76DXJ.js} +7 -7
- package/dist/development/dom-export.d.mts +21 -2
- package/dist/development/dom-export.d.ts +21 -2
- package/dist/development/dom-export.js +158 -103
- package/dist/development/dom-export.mjs +133 -79
- package/dist/development/{index-react-server-client-Da3kmxNd.d.ts → index-react-server-client-CNrKUHDv.d.ts} +59 -7
- package/dist/{production/index-react-server-client-rcoGPJhU.d.mts → development/index-react-server-client-DYtvZPLT.d.mts} +59 -7
- package/dist/development/index-react-server-client.d.mts +2 -2
- 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 +19 -4
- package/dist/development/index-react-server.d.ts +19 -4
- package/dist/development/index-react-server.js +30 -24
- package/dist/development/index-react-server.mjs +30 -24
- package/dist/development/index.d.mts +19 -15
- package/dist/development/index.d.ts +19 -15
- package/dist/development/index.js +92 -82
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-Unc20tLk.d.ts → development/instrumentation-Dwf-sTWa.d.ts} +66 -8
- 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-BpU9rFBJ.d.ts → register-BnQsYkwj.d.ts} +1 -1
- package/dist/development/{register-QkB3HGjm.d.mts → register-C97Jz2jB.d.mts} +1 -1
- package/dist/development/{router-CAvh_Drx.d.mts → router-Dgz_Mh9m.d.mts} +66 -8
- package/dist/production/{browser-C07r42Tt.d.mts → browser-BHySFrZ2.d.mts} +1 -1
- package/dist/production/{browser-BbBXFHbO.d.ts → browser-eL-tAN4R.d.ts} +1 -1
- package/dist/production/{chunk-2DNJUQK6.js → chunk-55FFLVQP.js} +201 -258
- package/dist/production/{chunk-EDK3MRM6.js → chunk-5DTJHKF7.js} +167 -123
- package/dist/production/{chunk-LESYMMDQ.mjs → chunk-KJ5676BZ.mjs} +208 -221
- package/dist/production/{chunk-LC2OWLJG.mjs → chunk-QKAGOFED.mjs} +15 -5
- package/dist/production/{chunk-JLDESRHY.js → chunk-SGCRBGEM.js} +7 -7
- package/dist/production/dom-export.d.mts +21 -2
- package/dist/production/dom-export.d.ts +21 -2
- package/dist/production/dom-export.js +158 -103
- package/dist/production/dom-export.mjs +133 -79
- package/dist/production/{index-react-server-client-Da3kmxNd.d.ts → index-react-server-client-CNrKUHDv.d.ts} +59 -7
- package/dist/{development/index-react-server-client-rcoGPJhU.d.mts → production/index-react-server-client-DYtvZPLT.d.mts} +59 -7
- package/dist/production/index-react-server-client.d.mts +2 -2
- 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 +19 -4
- package/dist/production/index-react-server.d.ts +19 -4
- package/dist/production/index-react-server.js +30 -24
- package/dist/production/index-react-server.mjs +30 -24
- package/dist/production/index.d.mts +19 -15
- package/dist/production/index.d.ts +19 -15
- package/dist/production/index.js +92 -82
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-Unc20tLk.d.ts → production/instrumentation-Dwf-sTWa.d.ts} +66 -8
- 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/production/{register-BpU9rFBJ.d.ts → register-BnQsYkwj.d.ts} +1 -1
- package/dist/production/{register-QkB3HGjm.d.mts → register-C97Jz2jB.d.mts} +1 -1
- package/dist/production/{router-CAvh_Drx.d.mts → router-Dgz_Mh9m.d.mts} +66 -8
- 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.10.0-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
var
|
|
51
|
+
var _chunk55FFLVQPjs = require('./chunk-55FFLVQP.js');
|
|
52
52
|
|
|
53
53
|
// lib/dom/dom.ts
|
|
54
54
|
var defaultMethod = "get";
|
|
55
55
|
var defaultEncType = "application/x-www-form-urlencoded";
|
|
56
56
|
function isHtmlElement(object) {
|
|
57
|
-
return
|
|
57
|
+
return typeof HTMLElement !== "undefined" && object instanceof HTMLElement;
|
|
58
58
|
}
|
|
59
59
|
function isButtonElement(object) {
|
|
60
60
|
return isHtmlElement(object) && object.tagName.toLowerCase() === "button";
|
|
@@ -119,7 +119,7 @@ var supportedFormEncTypes = /* @__PURE__ */ new Set([
|
|
|
119
119
|
]);
|
|
120
120
|
function getFormEncType(encType) {
|
|
121
121
|
if (encType != null && !supportedFormEncTypes.has(encType)) {
|
|
122
|
-
|
|
122
|
+
_chunk55FFLVQPjs.warning.call(void 0,
|
|
123
123
|
false,
|
|
124
124
|
`"${encType}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`
|
|
125
125
|
);
|
|
@@ -135,7 +135,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
135
135
|
let body;
|
|
136
136
|
if (isFormElement(target)) {
|
|
137
137
|
let attr = target.getAttribute("action");
|
|
138
|
-
action = attr ?
|
|
138
|
+
action = attr ? _chunk55FFLVQPjs.stripBasename.call(void 0, attr, basename) : null;
|
|
139
139
|
method = target.getAttribute("method") || defaultMethod;
|
|
140
140
|
encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
|
|
141
141
|
formData = new FormData(target);
|
|
@@ -147,7 +147,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
147
147
|
);
|
|
148
148
|
}
|
|
149
149
|
let attr = target.getAttribute("formaction") || form.getAttribute("action");
|
|
150
|
-
action = attr ?
|
|
150
|
+
action = attr ? _chunk55FFLVQPjs.stripBasename.call(void 0, attr, basename) : null;
|
|
151
151
|
method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
|
|
152
152
|
encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
|
|
153
153
|
formData = new FormData(form, target);
|
|
@@ -184,20 +184,20 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
|
|
|
184
184
|
try {
|
|
185
185
|
if (isBrowser) {
|
|
186
186
|
window.__reactRouterVersion = // @ts-expect-error
|
|
187
|
-
"7.
|
|
187
|
+
"7.10.0-pre.0";
|
|
188
188
|
}
|
|
189
189
|
} catch (e) {
|
|
190
190
|
}
|
|
191
191
|
function createBrowserRouter(routes, opts) {
|
|
192
|
-
return
|
|
192
|
+
return _chunk55FFLVQPjs.createRouter.call(void 0, {
|
|
193
193
|
basename: _optionalChain([opts, 'optionalAccess', _2 => _2.basename]),
|
|
194
194
|
getContext: _optionalChain([opts, 'optionalAccess', _3 => _3.getContext]),
|
|
195
195
|
future: _optionalChain([opts, 'optionalAccess', _4 => _4.future]),
|
|
196
|
-
history:
|
|
196
|
+
history: _chunk55FFLVQPjs.createBrowserHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _5 => _5.window]) }),
|
|
197
197
|
hydrationData: _optionalChain([opts, 'optionalAccess', _6 => _6.hydrationData]) || parseHydrationData(),
|
|
198
198
|
routes,
|
|
199
|
-
mapRouteProperties:
|
|
200
|
-
hydrationRouteProperties:
|
|
199
|
+
mapRouteProperties: _chunk55FFLVQPjs.mapRouteProperties,
|
|
200
|
+
hydrationRouteProperties: _chunk55FFLVQPjs.hydrationRouteProperties,
|
|
201
201
|
dataStrategy: _optionalChain([opts, 'optionalAccess', _7 => _7.dataStrategy]),
|
|
202
202
|
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _8 => _8.patchRoutesOnNavigation]),
|
|
203
203
|
window: _optionalChain([opts, 'optionalAccess', _9 => _9.window]),
|
|
@@ -205,15 +205,15 @@ function createBrowserRouter(routes, opts) {
|
|
|
205
205
|
}).initialize();
|
|
206
206
|
}
|
|
207
207
|
function createHashRouter(routes, opts) {
|
|
208
|
-
return
|
|
208
|
+
return _chunk55FFLVQPjs.createRouter.call(void 0, {
|
|
209
209
|
basename: _optionalChain([opts, 'optionalAccess', _11 => _11.basename]),
|
|
210
210
|
getContext: _optionalChain([opts, 'optionalAccess', _12 => _12.getContext]),
|
|
211
211
|
future: _optionalChain([opts, 'optionalAccess', _13 => _13.future]),
|
|
212
|
-
history:
|
|
212
|
+
history: _chunk55FFLVQPjs.createHashHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _14 => _14.window]) }),
|
|
213
213
|
hydrationData: _optionalChain([opts, 'optionalAccess', _15 => _15.hydrationData]) || parseHydrationData(),
|
|
214
214
|
routes,
|
|
215
|
-
mapRouteProperties:
|
|
216
|
-
hydrationRouteProperties:
|
|
215
|
+
mapRouteProperties: _chunk55FFLVQPjs.mapRouteProperties,
|
|
216
|
+
hydrationRouteProperties: _chunk55FFLVQPjs.hydrationRouteProperties,
|
|
217
217
|
dataStrategy: _optionalChain([opts, 'optionalAccess', _16 => _16.dataStrategy]),
|
|
218
218
|
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _17 => _17.patchRoutesOnNavigation]),
|
|
219
219
|
window: _optionalChain([opts, 'optionalAccess', _18 => _18.window]),
|
|
@@ -236,7 +236,7 @@ function deserializeErrors(errors) {
|
|
|
236
236
|
let serialized = {};
|
|
237
237
|
for (let [key, val] of entries) {
|
|
238
238
|
if (val && val.__type === "RouteErrorResponse") {
|
|
239
|
-
serialized[key] = new (0,
|
|
239
|
+
serialized[key] = new (0, _chunk55FFLVQPjs.ErrorResponseImpl)(
|
|
240
240
|
val.status,
|
|
241
241
|
val.statusText,
|
|
242
242
|
val.data,
|
|
@@ -268,11 +268,12 @@ function deserializeErrors(errors) {
|
|
|
268
268
|
function BrowserRouter({
|
|
269
269
|
basename,
|
|
270
270
|
children,
|
|
271
|
+
unstable_useTransitions,
|
|
271
272
|
window: window2
|
|
272
273
|
}) {
|
|
273
274
|
let historyRef = React.useRef();
|
|
274
275
|
if (historyRef.current == null) {
|
|
275
|
-
historyRef.current =
|
|
276
|
+
historyRef.current = _chunk55FFLVQPjs.createBrowserHistory.call(void 0, { window: window2, v5Compat: true });
|
|
276
277
|
}
|
|
277
278
|
let history = historyRef.current;
|
|
278
279
|
let [state, setStateImpl] = React.useState({
|
|
@@ -281,26 +282,36 @@ function BrowserRouter({
|
|
|
281
282
|
});
|
|
282
283
|
let setState = React.useCallback(
|
|
283
284
|
(newState) => {
|
|
284
|
-
|
|
285
|
+
if (unstable_useTransitions === false) {
|
|
286
|
+
setStateImpl(newState);
|
|
287
|
+
} else {
|
|
288
|
+
React.startTransition(() => setStateImpl(newState));
|
|
289
|
+
}
|
|
285
290
|
},
|
|
286
|
-
[
|
|
291
|
+
[unstable_useTransitions]
|
|
287
292
|
);
|
|
288
293
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
289
294
|
return /* @__PURE__ */ React.createElement(
|
|
290
|
-
|
|
295
|
+
_chunk55FFLVQPjs.Router,
|
|
291
296
|
{
|
|
292
297
|
basename,
|
|
293
298
|
children,
|
|
294
299
|
location: state.location,
|
|
295
300
|
navigationType: state.action,
|
|
296
|
-
navigator: history
|
|
301
|
+
navigator: history,
|
|
302
|
+
unstable_useTransitions: unstable_useTransitions === true
|
|
297
303
|
}
|
|
298
304
|
);
|
|
299
305
|
}
|
|
300
|
-
function HashRouter({
|
|
306
|
+
function HashRouter({
|
|
307
|
+
basename,
|
|
308
|
+
children,
|
|
309
|
+
unstable_useTransitions,
|
|
310
|
+
window: window2
|
|
311
|
+
}) {
|
|
301
312
|
let historyRef = React.useRef();
|
|
302
313
|
if (historyRef.current == null) {
|
|
303
|
-
historyRef.current =
|
|
314
|
+
historyRef.current = _chunk55FFLVQPjs.createHashHistory.call(void 0, { window: window2, v5Compat: true });
|
|
304
315
|
}
|
|
305
316
|
let history = historyRef.current;
|
|
306
317
|
let [state, setStateImpl] = React.useState({
|
|
@@ -309,26 +320,32 @@ function HashRouter({ basename, children, window: window2 }) {
|
|
|
309
320
|
});
|
|
310
321
|
let setState = React.useCallback(
|
|
311
322
|
(newState) => {
|
|
312
|
-
|
|
323
|
+
if (unstable_useTransitions === false) {
|
|
324
|
+
setStateImpl(newState);
|
|
325
|
+
} else {
|
|
326
|
+
React.startTransition(() => setStateImpl(newState));
|
|
327
|
+
}
|
|
313
328
|
},
|
|
314
|
-
[
|
|
329
|
+
[unstable_useTransitions]
|
|
315
330
|
);
|
|
316
331
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
317
332
|
return /* @__PURE__ */ React.createElement(
|
|
318
|
-
|
|
333
|
+
_chunk55FFLVQPjs.Router,
|
|
319
334
|
{
|
|
320
335
|
basename,
|
|
321
336
|
children,
|
|
322
337
|
location: state.location,
|
|
323
338
|
navigationType: state.action,
|
|
324
|
-
navigator: history
|
|
339
|
+
navigator: history,
|
|
340
|
+
unstable_useTransitions: unstable_useTransitions === true
|
|
325
341
|
}
|
|
326
342
|
);
|
|
327
343
|
}
|
|
328
344
|
function HistoryRouter({
|
|
329
345
|
basename,
|
|
330
346
|
children,
|
|
331
|
-
history
|
|
347
|
+
history,
|
|
348
|
+
unstable_useTransitions
|
|
332
349
|
}) {
|
|
333
350
|
let [state, setStateImpl] = React.useState({
|
|
334
351
|
action: history.action,
|
|
@@ -336,19 +353,24 @@ function HistoryRouter({
|
|
|
336
353
|
});
|
|
337
354
|
let setState = React.useCallback(
|
|
338
355
|
(newState) => {
|
|
339
|
-
|
|
356
|
+
if (unstable_useTransitions === false) {
|
|
357
|
+
setStateImpl(newState);
|
|
358
|
+
} else {
|
|
359
|
+
React.startTransition(() => setStateImpl(newState));
|
|
360
|
+
}
|
|
340
361
|
},
|
|
341
|
-
[
|
|
362
|
+
[unstable_useTransitions]
|
|
342
363
|
);
|
|
343
364
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
344
365
|
return /* @__PURE__ */ React.createElement(
|
|
345
|
-
|
|
366
|
+
_chunk55FFLVQPjs.Router,
|
|
346
367
|
{
|
|
347
368
|
basename,
|
|
348
369
|
children,
|
|
349
370
|
location: state.location,
|
|
350
371
|
navigationType: state.action,
|
|
351
|
-
navigator: history
|
|
372
|
+
navigator: history,
|
|
373
|
+
unstable_useTransitions: unstable_useTransitions === true
|
|
352
374
|
}
|
|
353
375
|
);
|
|
354
376
|
}
|
|
@@ -369,7 +391,7 @@ var Link = React.forwardRef(
|
|
|
369
391
|
viewTransition,
|
|
370
392
|
...rest
|
|
371
393
|
}, forwardedRef) {
|
|
372
|
-
let { basename } = React.useContext(
|
|
394
|
+
let { basename, unstable_useTransitions } = React.useContext(_chunk55FFLVQPjs.NavigationContext);
|
|
373
395
|
let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX.test(to);
|
|
374
396
|
let absoluteHref;
|
|
375
397
|
let isExternal = false;
|
|
@@ -379,22 +401,22 @@ var Link = React.forwardRef(
|
|
|
379
401
|
try {
|
|
380
402
|
let currentUrl = new URL(window.location.href);
|
|
381
403
|
let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
|
|
382
|
-
let path =
|
|
404
|
+
let path = _chunk55FFLVQPjs.stripBasename.call(void 0, targetUrl.pathname, basename);
|
|
383
405
|
if (targetUrl.origin === currentUrl.origin && path != null) {
|
|
384
406
|
to = path + targetUrl.search + targetUrl.hash;
|
|
385
407
|
} else {
|
|
386
408
|
isExternal = true;
|
|
387
409
|
}
|
|
388
410
|
} catch (e) {
|
|
389
|
-
|
|
411
|
+
_chunk55FFLVQPjs.warning.call(void 0,
|
|
390
412
|
false,
|
|
391
413
|
`<Link to="${to}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
392
414
|
);
|
|
393
415
|
}
|
|
394
416
|
}
|
|
395
417
|
}
|
|
396
|
-
let href =
|
|
397
|
-
let [shouldPrefetch, prefetchRef, prefetchHandlers] =
|
|
418
|
+
let href = _chunk55FFLVQPjs.useHref.call(void 0, to, { relative });
|
|
419
|
+
let [shouldPrefetch, prefetchRef, prefetchHandlers] = _chunk55FFLVQPjs.usePrefetchBehavior.call(void 0,
|
|
398
420
|
prefetch,
|
|
399
421
|
rest
|
|
400
422
|
);
|
|
@@ -404,7 +426,8 @@ var Link = React.forwardRef(
|
|
|
404
426
|
target,
|
|
405
427
|
preventScrollReset,
|
|
406
428
|
relative,
|
|
407
|
-
viewTransition
|
|
429
|
+
viewTransition,
|
|
430
|
+
unstable_useTransitions
|
|
408
431
|
});
|
|
409
432
|
function handleClick(event) {
|
|
410
433
|
if (onClick) onClick(event);
|
|
@@ -421,13 +444,13 @@ var Link = React.forwardRef(
|
|
|
421
444
|
...prefetchHandlers,
|
|
422
445
|
href: absoluteHref || href,
|
|
423
446
|
onClick: isExternal || reloadDocument ? onClick : handleClick,
|
|
424
|
-
ref:
|
|
447
|
+
ref: _chunk55FFLVQPjs.mergeRefs.call(void 0, forwardedRef, prefetchRef),
|
|
425
448
|
target,
|
|
426
449
|
"data-discover": !isAbsolute && discover === "render" ? "true" : void 0
|
|
427
450
|
}
|
|
428
451
|
)
|
|
429
452
|
);
|
|
430
|
-
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(
|
|
453
|
+
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(_chunk55FFLVQPjs.PrefetchPageLinks, { page: href })) : link;
|
|
431
454
|
}
|
|
432
455
|
);
|
|
433
456
|
Link.displayName = "Link";
|
|
@@ -443,10 +466,10 @@ var NavLink = React.forwardRef(
|
|
|
443
466
|
children,
|
|
444
467
|
...rest
|
|
445
468
|
}, ref) {
|
|
446
|
-
let path =
|
|
447
|
-
let location =
|
|
448
|
-
let routerState = React.useContext(
|
|
449
|
-
let { navigator, basename } = React.useContext(
|
|
469
|
+
let path = _chunk55FFLVQPjs.useResolvedPath.call(void 0, to, { relative: rest.relative });
|
|
470
|
+
let location = _chunk55FFLVQPjs.useLocation.call(void 0, );
|
|
471
|
+
let routerState = React.useContext(_chunk55FFLVQPjs.DataRouterStateContext);
|
|
472
|
+
let { navigator, basename } = React.useContext(_chunk55FFLVQPjs.NavigationContext);
|
|
450
473
|
let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
|
|
451
474
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
452
475
|
useViewTransitionState(path) && viewTransition === true;
|
|
@@ -459,7 +482,7 @@ var NavLink = React.forwardRef(
|
|
|
459
482
|
toPathname = toPathname.toLowerCase();
|
|
460
483
|
}
|
|
461
484
|
if (nextLocationPathname && basename) {
|
|
462
|
-
nextLocationPathname =
|
|
485
|
+
nextLocationPathname = _chunk55FFLVQPjs.stripBasename.call(void 0, nextLocationPathname, basename) || nextLocationPathname;
|
|
463
486
|
}
|
|
464
487
|
const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
|
|
465
488
|
let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
|
|
@@ -514,6 +537,7 @@ var Form = React.forwardRef(
|
|
|
514
537
|
viewTransition,
|
|
515
538
|
...props
|
|
516
539
|
}, forwardedRef) => {
|
|
540
|
+
let { unstable_useTransitions } = React.useContext(_chunk55FFLVQPjs.NavigationContext);
|
|
517
541
|
let submit = useSubmit();
|
|
518
542
|
let formAction = useFormAction(action, { relative });
|
|
519
543
|
let formMethod = method.toLowerCase() === "get" ? "get" : "post";
|
|
@@ -524,7 +548,7 @@ var Form = React.forwardRef(
|
|
|
524
548
|
event.preventDefault();
|
|
525
549
|
let submitter = event.nativeEvent.submitter;
|
|
526
550
|
let submitMethod = _optionalChain([submitter, 'optionalAccess', _21 => _21.getAttribute, 'call', _22 => _22("formmethod")]) || method;
|
|
527
|
-
submit(submitter || event.currentTarget, {
|
|
551
|
+
let doSubmit = () => submit(submitter || event.currentTarget, {
|
|
528
552
|
fetcherKey,
|
|
529
553
|
method: submitMethod,
|
|
530
554
|
navigate,
|
|
@@ -534,6 +558,11 @@ var Form = React.forwardRef(
|
|
|
534
558
|
preventScrollReset,
|
|
535
559
|
viewTransition
|
|
536
560
|
});
|
|
561
|
+
if (unstable_useTransitions && navigate !== false) {
|
|
562
|
+
React.startTransition(() => doSubmit());
|
|
563
|
+
} else {
|
|
564
|
+
doSubmit();
|
|
565
|
+
}
|
|
537
566
|
};
|
|
538
567
|
return /* @__PURE__ */ React.createElement(
|
|
539
568
|
"form",
|
|
@@ -554,10 +583,10 @@ function ScrollRestoration({
|
|
|
554
583
|
storageKey,
|
|
555
584
|
...props
|
|
556
585
|
}) {
|
|
557
|
-
let remixContext = React.useContext(
|
|
558
|
-
let { basename } = React.useContext(
|
|
559
|
-
let location =
|
|
560
|
-
let matches =
|
|
586
|
+
let remixContext = React.useContext(_chunk55FFLVQPjs.FrameworkContext);
|
|
587
|
+
let { basename } = React.useContext(_chunk55FFLVQPjs.NavigationContext);
|
|
588
|
+
let location = _chunk55FFLVQPjs.useLocation.call(void 0, );
|
|
589
|
+
let matches = _chunk55FFLVQPjs.useMatches.call(void 0, );
|
|
561
590
|
useScrollRestoration({ getKey, storageKey });
|
|
562
591
|
let ssrKey = React.useMemo(
|
|
563
592
|
() => {
|
|
@@ -611,13 +640,13 @@ function getDataRouterConsoleError(hookName) {
|
|
|
611
640
|
return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
612
641
|
}
|
|
613
642
|
function useDataRouterContext(hookName) {
|
|
614
|
-
let ctx = React.useContext(
|
|
615
|
-
|
|
643
|
+
let ctx = React.useContext(_chunk55FFLVQPjs.DataRouterContext);
|
|
644
|
+
_chunk55FFLVQPjs.invariant.call(void 0, ctx, getDataRouterConsoleError(hookName));
|
|
616
645
|
return ctx;
|
|
617
646
|
}
|
|
618
647
|
function useDataRouterState(hookName) {
|
|
619
|
-
let state = React.useContext(
|
|
620
|
-
|
|
648
|
+
let state = React.useContext(_chunk55FFLVQPjs.DataRouterStateContext);
|
|
649
|
+
_chunk55FFLVQPjs.invariant.call(void 0, state, getDataRouterConsoleError(hookName));
|
|
621
650
|
return state;
|
|
622
651
|
}
|
|
623
652
|
function useLinkClickHandler(to, {
|
|
@@ -626,23 +655,29 @@ function useLinkClickHandler(to, {
|
|
|
626
655
|
state,
|
|
627
656
|
preventScrollReset,
|
|
628
657
|
relative,
|
|
629
|
-
viewTransition
|
|
658
|
+
viewTransition,
|
|
659
|
+
unstable_useTransitions
|
|
630
660
|
} = {}) {
|
|
631
|
-
let navigate =
|
|
632
|
-
let location =
|
|
633
|
-
let path =
|
|
661
|
+
let navigate = _chunk55FFLVQPjs.useNavigate.call(void 0, );
|
|
662
|
+
let location = _chunk55FFLVQPjs.useLocation.call(void 0, );
|
|
663
|
+
let path = _chunk55FFLVQPjs.useResolvedPath.call(void 0, to, { relative });
|
|
634
664
|
return React.useCallback(
|
|
635
665
|
(event) => {
|
|
636
666
|
if (shouldProcessLinkClick(event, target)) {
|
|
637
667
|
event.preventDefault();
|
|
638
|
-
let replace = replaceProp !== void 0 ? replaceProp :
|
|
639
|
-
navigate(to, {
|
|
668
|
+
let replace = replaceProp !== void 0 ? replaceProp : _chunk55FFLVQPjs.createPath.call(void 0, location) === _chunk55FFLVQPjs.createPath.call(void 0, path);
|
|
669
|
+
let doNavigate = () => navigate(to, {
|
|
640
670
|
replace,
|
|
641
671
|
state,
|
|
642
672
|
preventScrollReset,
|
|
643
673
|
relative,
|
|
644
674
|
viewTransition
|
|
645
675
|
});
|
|
676
|
+
if (unstable_useTransitions) {
|
|
677
|
+
React.startTransition(() => doNavigate());
|
|
678
|
+
} else {
|
|
679
|
+
doNavigate();
|
|
680
|
+
}
|
|
646
681
|
}
|
|
647
682
|
},
|
|
648
683
|
[
|
|
@@ -655,18 +690,19 @@ function useLinkClickHandler(to, {
|
|
|
655
690
|
to,
|
|
656
691
|
preventScrollReset,
|
|
657
692
|
relative,
|
|
658
|
-
viewTransition
|
|
693
|
+
viewTransition,
|
|
694
|
+
unstable_useTransitions
|
|
659
695
|
]
|
|
660
696
|
);
|
|
661
697
|
}
|
|
662
698
|
function useSearchParams(defaultInit) {
|
|
663
|
-
|
|
699
|
+
_chunk55FFLVQPjs.warning.call(void 0,
|
|
664
700
|
typeof URLSearchParams !== "undefined",
|
|
665
701
|
`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.`
|
|
666
702
|
);
|
|
667
703
|
let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));
|
|
668
704
|
let hasSetSearchParamsRef = React.useRef(false);
|
|
669
|
-
let location =
|
|
705
|
+
let location = _chunk55FFLVQPjs.useLocation.call(void 0, );
|
|
670
706
|
let searchParams = React.useMemo(
|
|
671
707
|
() => (
|
|
672
708
|
// Only merge in the defaults if we haven't yet called setSearchParams.
|
|
@@ -679,7 +715,7 @@ function useSearchParams(defaultInit) {
|
|
|
679
715
|
),
|
|
680
716
|
[location.search]
|
|
681
717
|
);
|
|
682
|
-
let navigate =
|
|
718
|
+
let navigate = _chunk55FFLVQPjs.useNavigate.call(void 0, );
|
|
683
719
|
let setSearchParams = React.useCallback(
|
|
684
720
|
(nextInit, navigateOptions) => {
|
|
685
721
|
const newSearchParams = createSearchParams(
|
|
@@ -696,8 +732,10 @@ var fetcherId = 0;
|
|
|
696
732
|
var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
|
|
697
733
|
function useSubmit() {
|
|
698
734
|
let { router } = useDataRouterContext("useSubmit" /* UseSubmit */);
|
|
699
|
-
let { basename } = React.useContext(
|
|
700
|
-
let currentRouteId =
|
|
735
|
+
let { basename } = React.useContext(_chunk55FFLVQPjs.NavigationContext);
|
|
736
|
+
let currentRouteId = _chunk55FFLVQPjs.useRouteId.call(void 0, );
|
|
737
|
+
let routerFetch = router.fetch;
|
|
738
|
+
let routerNavigate = router.navigate;
|
|
701
739
|
return React.useCallback(
|
|
702
740
|
async (target, options = {}) => {
|
|
703
741
|
let { action, method, encType, formData, body } = getFormSubmissionInfo(
|
|
@@ -706,7 +744,7 @@ function useSubmit() {
|
|
|
706
744
|
);
|
|
707
745
|
if (options.navigate === false) {
|
|
708
746
|
let key = options.fetcherKey || getUniqueFetcherId();
|
|
709
|
-
await
|
|
747
|
+
await routerFetch(key, currentRouteId, options.action || action, {
|
|
710
748
|
preventScrollReset: options.preventScrollReset,
|
|
711
749
|
formData,
|
|
712
750
|
body,
|
|
@@ -715,7 +753,7 @@ function useSubmit() {
|
|
|
715
753
|
flushSync: options.flushSync
|
|
716
754
|
});
|
|
717
755
|
} else {
|
|
718
|
-
await
|
|
756
|
+
await routerNavigate(options.action || action, {
|
|
719
757
|
preventScrollReset: options.preventScrollReset,
|
|
720
758
|
formData,
|
|
721
759
|
body,
|
|
@@ -729,16 +767,16 @@ function useSubmit() {
|
|
|
729
767
|
});
|
|
730
768
|
}
|
|
731
769
|
},
|
|
732
|
-
[
|
|
770
|
+
[routerFetch, routerNavigate, basename, currentRouteId]
|
|
733
771
|
);
|
|
734
772
|
}
|
|
735
773
|
function useFormAction(action, { relative } = {}) {
|
|
736
|
-
let { basename } = React.useContext(
|
|
737
|
-
let routeContext = React.useContext(
|
|
738
|
-
|
|
774
|
+
let { basename } = React.useContext(_chunk55FFLVQPjs.NavigationContext);
|
|
775
|
+
let routeContext = React.useContext(_chunk55FFLVQPjs.RouteContext);
|
|
776
|
+
_chunk55FFLVQPjs.invariant.call(void 0, routeContext, "useFormAction must be used inside a RouteContext");
|
|
739
777
|
let [match] = routeContext.matches.slice(-1);
|
|
740
|
-
let path = { ...
|
|
741
|
-
let location =
|
|
778
|
+
let path = { ..._chunk55FFLVQPjs.useResolvedPath.call(void 0, action ? action : ".", { relative }) };
|
|
779
|
+
let location = _chunk55FFLVQPjs.useLocation.call(void 0, );
|
|
742
780
|
if (action == null) {
|
|
743
781
|
path.search = location.search;
|
|
744
782
|
let params = new URLSearchParams(path.search);
|
|
@@ -755,21 +793,21 @@ function useFormAction(action, { relative } = {}) {
|
|
|
755
793
|
path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
|
|
756
794
|
}
|
|
757
795
|
if (basename !== "/") {
|
|
758
|
-
path.pathname = path.pathname === "/" ? basename :
|
|
796
|
+
path.pathname = path.pathname === "/" ? basename : _chunk55FFLVQPjs.joinPaths.call(void 0, [basename, path.pathname]);
|
|
759
797
|
}
|
|
760
|
-
return
|
|
798
|
+
return _chunk55FFLVQPjs.createPath.call(void 0, path);
|
|
761
799
|
}
|
|
762
800
|
function useFetcher({
|
|
763
801
|
key
|
|
764
802
|
} = {}) {
|
|
765
803
|
let { router } = useDataRouterContext("useFetcher" /* UseFetcher */);
|
|
766
804
|
let state = useDataRouterState("useFetcher" /* UseFetcher */);
|
|
767
|
-
let fetcherData = React.useContext(
|
|
768
|
-
let route = React.useContext(
|
|
805
|
+
let fetcherData = React.useContext(_chunk55FFLVQPjs.FetchersContext);
|
|
806
|
+
let route = React.useContext(_chunk55FFLVQPjs.RouteContext);
|
|
769
807
|
let routeId = _optionalChain([route, 'access', _23 => _23.matches, 'access', _24 => _24[route.matches.length - 1], 'optionalAccess', _25 => _25.route, 'access', _26 => _26.id]);
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
808
|
+
_chunk55FFLVQPjs.invariant.call(void 0, fetcherData, `useFetcher must be used inside a FetchersContext`);
|
|
809
|
+
_chunk55FFLVQPjs.invariant.call(void 0, route, `useFetcher must be used inside a RouteContext`);
|
|
810
|
+
_chunk55FFLVQPjs.invariant.call(void 0,
|
|
773
811
|
routeId != null,
|
|
774
812
|
`useFetcher can only be used on routes that contain a unique "id"`
|
|
775
813
|
);
|
|
@@ -778,16 +816,17 @@ function useFetcher({
|
|
|
778
816
|
if (key && key !== fetcherKey) {
|
|
779
817
|
setFetcherKey(key);
|
|
780
818
|
}
|
|
819
|
+
let { deleteFetcher, getFetcher, resetFetcher, fetch: routerFetch } = router;
|
|
781
820
|
React.useEffect(() => {
|
|
782
|
-
|
|
783
|
-
return () =>
|
|
784
|
-
}, [
|
|
821
|
+
getFetcher(fetcherKey);
|
|
822
|
+
return () => deleteFetcher(fetcherKey);
|
|
823
|
+
}, [deleteFetcher, getFetcher, fetcherKey]);
|
|
785
824
|
let load = React.useCallback(
|
|
786
825
|
async (href, opts) => {
|
|
787
|
-
|
|
788
|
-
await
|
|
826
|
+
_chunk55FFLVQPjs.invariant.call(void 0, routeId, "No routeId available for fetcher.load()");
|
|
827
|
+
await routerFetch(fetcherKey, routeId, href, opts);
|
|
789
828
|
},
|
|
790
|
-
[fetcherKey, routeId,
|
|
829
|
+
[fetcherKey, routeId, routerFetch]
|
|
791
830
|
);
|
|
792
831
|
let submitImpl = useSubmit();
|
|
793
832
|
let submit = React.useCallback(
|
|
@@ -800,7 +839,10 @@ function useFetcher({
|
|
|
800
839
|
},
|
|
801
840
|
[fetcherKey, submitImpl]
|
|
802
841
|
);
|
|
803
|
-
let
|
|
842
|
+
let reset = React.useCallback(
|
|
843
|
+
(opts) => resetFetcher(fetcherKey, opts),
|
|
844
|
+
[resetFetcher, fetcherKey]
|
|
845
|
+
);
|
|
804
846
|
let FetcherForm = React.useMemo(() => {
|
|
805
847
|
let FetcherForm2 = React.forwardRef(
|
|
806
848
|
(props, ref) => {
|
|
@@ -810,18 +852,18 @@ function useFetcher({
|
|
|
810
852
|
FetcherForm2.displayName = "fetcher.Form";
|
|
811
853
|
return FetcherForm2;
|
|
812
854
|
}, [fetcherKey]);
|
|
813
|
-
let fetcher = state.fetchers.get(fetcherKey) ||
|
|
855
|
+
let fetcher = state.fetchers.get(fetcherKey) || _chunk55FFLVQPjs.IDLE_FETCHER;
|
|
814
856
|
let data = fetcherData.get(fetcherKey);
|
|
815
857
|
let fetcherWithComponents = React.useMemo(
|
|
816
858
|
() => ({
|
|
817
859
|
Form: FetcherForm,
|
|
818
860
|
submit,
|
|
819
861
|
load,
|
|
820
|
-
|
|
862
|
+
reset,
|
|
821
863
|
...fetcher,
|
|
822
864
|
data
|
|
823
865
|
}),
|
|
824
|
-
[FetcherForm, submit, load,
|
|
866
|
+
[FetcherForm, submit, load, reset, fetcher, data]
|
|
825
867
|
);
|
|
826
868
|
return fetcherWithComponents;
|
|
827
869
|
}
|
|
@@ -841,7 +883,7 @@ function getScrollRestorationKey(location, matches, basename, getKey) {
|
|
|
841
883
|
key = getKey(
|
|
842
884
|
{
|
|
843
885
|
...location,
|
|
844
|
-
pathname:
|
|
886
|
+
pathname: _chunk55FFLVQPjs.stripBasename.call(void 0, location.pathname, basename) || location.pathname
|
|
845
887
|
},
|
|
846
888
|
matches
|
|
847
889
|
);
|
|
@@ -862,10 +904,10 @@ function useScrollRestoration({
|
|
|
862
904
|
let { restoreScrollPosition, preventScrollReset } = useDataRouterState(
|
|
863
905
|
"useScrollRestoration" /* UseScrollRestoration */
|
|
864
906
|
);
|
|
865
|
-
let { basename } = React.useContext(
|
|
866
|
-
let location =
|
|
867
|
-
let matches =
|
|
868
|
-
let navigation =
|
|
907
|
+
let { basename } = React.useContext(_chunk55FFLVQPjs.NavigationContext);
|
|
908
|
+
let location = _chunk55FFLVQPjs.useLocation.call(void 0, );
|
|
909
|
+
let matches = _chunk55FFLVQPjs.useMatches.call(void 0, );
|
|
910
|
+
let navigation = _chunk55FFLVQPjs.useNavigation.call(void 0, );
|
|
869
911
|
React.useEffect(() => {
|
|
870
912
|
window.history.scrollRestoration = "manual";
|
|
871
913
|
return () => {
|
|
@@ -884,7 +926,7 @@ function useScrollRestoration({
|
|
|
884
926
|
JSON.stringify(savedScrollPositions)
|
|
885
927
|
);
|
|
886
928
|
} catch (error) {
|
|
887
|
-
|
|
929
|
+
_chunk55FFLVQPjs.warning.call(void 0,
|
|
888
930
|
false,
|
|
889
931
|
`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${error}).`
|
|
890
932
|
);
|
|
@@ -931,7 +973,7 @@ function useScrollRestoration({
|
|
|
931
973
|
}
|
|
932
974
|
}
|
|
933
975
|
} catch (e2) {
|
|
934
|
-
|
|
976
|
+
_chunk55FFLVQPjs.warning.call(void 0,
|
|
935
977
|
false,
|
|
936
978
|
`"${location.hash.slice(
|
|
937
979
|
1
|
|
@@ -969,7 +1011,7 @@ function usePrompt({
|
|
|
969
1011
|
when,
|
|
970
1012
|
message
|
|
971
1013
|
}) {
|
|
972
|
-
let blocker =
|
|
1014
|
+
let blocker = _chunk55FFLVQPjs.useBlocker.call(void 0, when);
|
|
973
1015
|
React.useEffect(() => {
|
|
974
1016
|
if (blocker.state === "blocked") {
|
|
975
1017
|
let proceed = window.confirm(message);
|
|
@@ -987,21 +1029,21 @@ function usePrompt({
|
|
|
987
1029
|
}, [blocker, when]);
|
|
988
1030
|
}
|
|
989
1031
|
function useViewTransitionState(to, { relative } = {}) {
|
|
990
|
-
let vtContext = React.useContext(
|
|
991
|
-
|
|
1032
|
+
let vtContext = React.useContext(_chunk55FFLVQPjs.ViewTransitionContext);
|
|
1033
|
+
_chunk55FFLVQPjs.invariant.call(void 0,
|
|
992
1034
|
vtContext != null,
|
|
993
1035
|
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
994
1036
|
);
|
|
995
1037
|
let { basename } = useDataRouterContext(
|
|
996
1038
|
"useViewTransitionState" /* useViewTransitionState */
|
|
997
1039
|
);
|
|
998
|
-
let path =
|
|
1040
|
+
let path = _chunk55FFLVQPjs.useResolvedPath.call(void 0, to, { relative });
|
|
999
1041
|
if (!vtContext.isTransitioning) {
|
|
1000
1042
|
return false;
|
|
1001
1043
|
}
|
|
1002
|
-
let currentPath =
|
|
1003
|
-
let nextPath =
|
|
1004
|
-
return
|
|
1044
|
+
let currentPath = _chunk55FFLVQPjs.stripBasename.call(void 0, vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
|
|
1045
|
+
let nextPath = _chunk55FFLVQPjs.stripBasename.call(void 0, vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
|
|
1046
|
+
return _chunk55FFLVQPjs.matchPath.call(void 0, path.pathname, nextPath) != null || _chunk55FFLVQPjs.matchPath.call(void 0, path.pathname, currentPath) != null;
|
|
1005
1047
|
}
|
|
1006
1048
|
|
|
1007
1049
|
// lib/dom/server.tsx
|
|
@@ -1012,7 +1054,7 @@ function StaticRouter({
|
|
|
1012
1054
|
location: locationProp = "/"
|
|
1013
1055
|
}) {
|
|
1014
1056
|
if (typeof locationProp === "string") {
|
|
1015
|
-
locationProp =
|
|
1057
|
+
locationProp = _chunk55FFLVQPjs.parsePath.call(void 0, locationProp);
|
|
1016
1058
|
}
|
|
1017
1059
|
let action = "POP" /* Pop */;
|
|
1018
1060
|
let location = {
|
|
@@ -1024,14 +1066,15 @@ function StaticRouter({
|
|
|
1024
1066
|
};
|
|
1025
1067
|
let staticNavigator = getStatelessNavigator();
|
|
1026
1068
|
return /* @__PURE__ */ React2.createElement(
|
|
1027
|
-
|
|
1069
|
+
_chunk55FFLVQPjs.Router,
|
|
1028
1070
|
{
|
|
1029
1071
|
basename,
|
|
1030
1072
|
children,
|
|
1031
1073
|
location,
|
|
1032
1074
|
navigationType: action,
|
|
1033
1075
|
navigator: staticNavigator,
|
|
1034
|
-
static: true
|
|
1076
|
+
static: true,
|
|
1077
|
+
unstable_useTransitions: false
|
|
1035
1078
|
}
|
|
1036
1079
|
);
|
|
1037
1080
|
}
|
|
@@ -1041,7 +1084,7 @@ function StaticRouterProvider({
|
|
|
1041
1084
|
hydrate = true,
|
|
1042
1085
|
nonce
|
|
1043
1086
|
}) {
|
|
1044
|
-
|
|
1087
|
+
_chunk55FFLVQPjs.invariant.call(void 0,
|
|
1045
1088
|
router && context,
|
|
1046
1089
|
"You must provide `router` and `context` to <StaticRouterProvider>"
|
|
1047
1090
|
);
|
|
@@ -1064,14 +1107,15 @@ function StaticRouterProvider({
|
|
|
1064
1107
|
hydrateScript = `window.__staticRouterHydrationData = JSON.parse(${json});`;
|
|
1065
1108
|
}
|
|
1066
1109
|
let { state } = dataRouterContext.router;
|
|
1067
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
|
1068
|
-
|
|
1110
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(_chunk55FFLVQPjs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React2.createElement(_chunk55FFLVQPjs.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React2.createElement(_chunk55FFLVQPjs.FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ React2.createElement(_chunk55FFLVQPjs.ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ React2.createElement(
|
|
1111
|
+
_chunk55FFLVQPjs.Router,
|
|
1069
1112
|
{
|
|
1070
1113
|
basename: dataRouterContext.basename,
|
|
1071
1114
|
location: state.location,
|
|
1072
1115
|
navigationType: state.historyAction,
|
|
1073
1116
|
navigator: dataRouterContext.navigator,
|
|
1074
|
-
static: dataRouterContext.static
|
|
1117
|
+
static: dataRouterContext.static,
|
|
1118
|
+
unstable_useTransitions: false
|
|
1075
1119
|
},
|
|
1076
1120
|
/* @__PURE__ */ React2.createElement(
|
|
1077
1121
|
DataRoutes,
|
|
@@ -1095,14 +1139,14 @@ function DataRoutes({
|
|
|
1095
1139
|
future,
|
|
1096
1140
|
state
|
|
1097
1141
|
}) {
|
|
1098
|
-
return
|
|
1142
|
+
return _chunk55FFLVQPjs.useRoutesImpl.call(void 0, routes, void 0, state, void 0, future);
|
|
1099
1143
|
}
|
|
1100
1144
|
function serializeErrors(errors) {
|
|
1101
1145
|
if (!errors) return null;
|
|
1102
1146
|
let entries = Object.entries(errors);
|
|
1103
1147
|
let serialized = {};
|
|
1104
1148
|
for (let [key, val] of entries) {
|
|
1105
|
-
if (
|
|
1149
|
+
if (_chunk55FFLVQPjs.isRouteErrorResponse.call(void 0, val)) {
|
|
1106
1150
|
serialized[key] = { ...val, __type: "RouteErrorResponse" };
|
|
1107
1151
|
} else if (val instanceof Error) {
|
|
1108
1152
|
serialized[key] = {
|
|
@@ -1152,16 +1196,16 @@ function getStatelessNavigator() {
|
|
|
1152
1196
|
};
|
|
1153
1197
|
}
|
|
1154
1198
|
function createStaticHandler2(routes, opts) {
|
|
1155
|
-
return
|
|
1199
|
+
return _chunk55FFLVQPjs.createStaticHandler.call(void 0, routes, {
|
|
1156
1200
|
...opts,
|
|
1157
|
-
mapRouteProperties:
|
|
1201
|
+
mapRouteProperties: _chunk55FFLVQPjs.mapRouteProperties
|
|
1158
1202
|
});
|
|
1159
1203
|
}
|
|
1160
1204
|
function createStaticRouter(routes, context, opts = {}) {
|
|
1161
1205
|
let manifest = {};
|
|
1162
|
-
let dataRoutes =
|
|
1206
|
+
let dataRoutes = _chunk55FFLVQPjs.convertRoutesToDataRoutes.call(void 0,
|
|
1163
1207
|
routes,
|
|
1164
|
-
|
|
1208
|
+
_chunk55FFLVQPjs.mapRouteProperties,
|
|
1165
1209
|
void 0,
|
|
1166
1210
|
manifest
|
|
1167
1211
|
);
|
|
@@ -1192,7 +1236,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1192
1236
|
actionData: context.actionData,
|
|
1193
1237
|
errors: context.errors,
|
|
1194
1238
|
initialized: true,
|
|
1195
|
-
navigation:
|
|
1239
|
+
navigation: _chunk55FFLVQPjs.IDLE_NAVIGATION,
|
|
1196
1240
|
restoreScrollPosition: null,
|
|
1197
1241
|
preventScrollReset: false,
|
|
1198
1242
|
revalidation: "idle",
|
|
@@ -1227,7 +1271,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1227
1271
|
createHref,
|
|
1228
1272
|
encodeLocation,
|
|
1229
1273
|
getFetcher() {
|
|
1230
|
-
return
|
|
1274
|
+
return _chunk55FFLVQPjs.IDLE_FETCHER;
|
|
1231
1275
|
},
|
|
1232
1276
|
deleteFetcher() {
|
|
1233
1277
|
throw msg("deleteFetcher");
|
|
@@ -1239,7 +1283,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1239
1283
|
throw msg("dispose");
|
|
1240
1284
|
},
|
|
1241
1285
|
getBlocker() {
|
|
1242
|
-
return
|
|
1286
|
+
return _chunk55FFLVQPjs.IDLE_BLOCKER;
|
|
1243
1287
|
},
|
|
1244
1288
|
deleteBlocker() {
|
|
1245
1289
|
throw msg("deleteBlocker");
|
|
@@ -1257,10 +1301,10 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1257
1301
|
};
|
|
1258
1302
|
}
|
|
1259
1303
|
function createHref(to) {
|
|
1260
|
-
return typeof to === "string" ? to :
|
|
1304
|
+
return typeof to === "string" ? to : _chunk55FFLVQPjs.createPath.call(void 0, to);
|
|
1261
1305
|
}
|
|
1262
1306
|
function encodeLocation(to) {
|
|
1263
|
-
let href = typeof to === "string" ? to :
|
|
1307
|
+
let href = typeof to === "string" ? to : _chunk55FFLVQPjs.createPath.call(void 0, to);
|
|
1264
1308
|
href = href.replace(/ $/, "%20");
|
|
1265
1309
|
let encoded = ABSOLUTE_URL_REGEX2.test(href) ? new URL(href) : new URL(href, "http://localhost");
|
|
1266
1310
|
return {
|