react-router 7.10.1 → 7.11.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 +29 -11
- package/dist/development/{browser-BpxEZgZC.d.ts → browser-Cv4JZyZ5.d.mts} +4 -3
- package/dist/{production/browser-BpxEZgZC.d.ts → development/browser-o-qhcuhA.d.ts} +4 -3
- package/dist/{production/chunk-B3F6YMOF.js → development/chunk-JKMHOZYW.js} +111 -121
- package/dist/development/{chunk-WWGJGFF6.mjs → chunk-KRMLYMWA.mjs} +231 -74
- package/dist/{production/chunk-YO5R3LGQ.js → development/chunk-OVG6YSZ5.js} +7 -7
- package/dist/development/{chunk-PMGK554W.mjs → chunk-QMKP6CC3.mjs} +147 -38
- package/dist/development/{chunk-RBZI3ZHD.js → chunk-UO7KGW2U.js} +279 -110
- package/dist/development/dom-export.d.mts +11 -10
- package/dist/development/dom-export.d.ts +12 -11
- package/dist/development/dom-export.js +30 -31
- package/dist/development/dom-export.mjs +6 -7
- package/dist/{production/index-react-server-client-CCjKYJTH.d.ts → development/index-react-server-client-Cv5Q9lf0.d.ts} +60 -14
- package/dist/development/{index-react-server-client-CipGfVBI.d.mts → index-react-server-client-P7VgYu6T.d.mts} +60 -14
- 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 +4 -2
- package/dist/development/index-react-server.d.ts +4 -2
- package/dist/development/index-react-server.js +72 -19
- package/dist/development/index-react-server.mjs +72 -19
- package/dist/development/index.d.mts +17 -16
- package/dist/development/index.d.ts +17 -16
- package/dist/development/index.js +220 -111
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-BB0wRuqz.d.ts → development/instrumentation-BlrVzjbg.d.ts} +30 -15
- 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-ODDAAYlf.d.ts → register-BGQUMCK4.d.ts} +1 -1
- package/dist/development/{register-C1RwVJAt.d.mts → register-DTJJbt1o.d.mts} +1 -1
- package/dist/development/{router-CwNp5l9u.d.mts → router-5fbeEIMQ.d.mts} +30 -15
- package/dist/{development/browser-C5z6FZmz.d.mts → production/browser-Cv4JZyZ5.d.mts} +4 -3
- package/dist/production/{browser-C5z6FZmz.d.mts → browser-o-qhcuhA.d.ts} +4 -3
- package/dist/production/{chunk-UQPBOMFP.js → chunk-AO22ZXHI.js} +279 -110
- package/dist/production/{chunk-ANIOYBQK.mjs → chunk-IDHO4Q57.mjs} +231 -74
- package/dist/production/{chunk-TDCOAFPJ.mjs → chunk-J4JITZ76.mjs} +147 -38
- package/dist/{development/chunk-HMTWJNYB.js → production/chunk-M5W3Q3T5.js} +111 -121
- package/dist/{development/chunk-FKYGG5Z2.js → production/chunk-YGB3JEIP.js} +7 -7
- package/dist/production/dom-export.d.mts +11 -10
- package/dist/production/dom-export.d.ts +12 -11
- package/dist/production/dom-export.js +30 -31
- package/dist/production/dom-export.mjs +6 -7
- package/dist/{development/index-react-server-client-CCjKYJTH.d.ts → production/index-react-server-client-Cv5Q9lf0.d.ts} +60 -14
- package/dist/production/{index-react-server-client-CipGfVBI.d.mts → index-react-server-client-P7VgYu6T.d.mts} +60 -14
- 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 +4 -2
- package/dist/production/index-react-server.d.ts +4 -2
- package/dist/production/index-react-server.js +72 -19
- package/dist/production/index-react-server.mjs +72 -19
- package/dist/production/index.d.mts +17 -16
- package/dist/production/index.d.ts +17 -16
- package/dist/production/index.js +220 -111
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-BB0wRuqz.d.ts → production/instrumentation-BlrVzjbg.d.ts} +30 -15
- 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-ODDAAYlf.d.ts → register-BGQUMCK4.d.ts} +1 -1
- package/dist/production/{register-C1RwVJAt.d.mts → register-DTJJbt1o.d.mts} +1 -1
- package/dist/production/{router-CwNp5l9u.d.mts → router-5fbeEIMQ.d.mts} +30 -15
- package/package.json +5 -4
|
@@ -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.11.0-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
|
|
52
|
+
var _chunkUO7KGW2Ujs = require('./chunk-UO7KGW2U.js');
|
|
52
53
|
|
|
53
54
|
// lib/dom/dom.ts
|
|
54
55
|
var defaultMethod = "get";
|
|
@@ -119,7 +120,7 @@ var supportedFormEncTypes = /* @__PURE__ */ new Set([
|
|
|
119
120
|
]);
|
|
120
121
|
function getFormEncType(encType) {
|
|
121
122
|
if (encType != null && !supportedFormEncTypes.has(encType)) {
|
|
122
|
-
|
|
123
|
+
_chunkUO7KGW2Ujs.warning.call(void 0,
|
|
123
124
|
false,
|
|
124
125
|
`"${encType}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`
|
|
125
126
|
);
|
|
@@ -135,7 +136,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
135
136
|
let body;
|
|
136
137
|
if (isFormElement(target)) {
|
|
137
138
|
let attr = target.getAttribute("action");
|
|
138
|
-
action = attr ?
|
|
139
|
+
action = attr ? _chunkUO7KGW2Ujs.stripBasename.call(void 0, attr, basename) : null;
|
|
139
140
|
method = target.getAttribute("method") || defaultMethod;
|
|
140
141
|
encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
|
|
141
142
|
formData = new FormData(target);
|
|
@@ -147,7 +148,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
147
148
|
);
|
|
148
149
|
}
|
|
149
150
|
let attr = target.getAttribute("formaction") || form.getAttribute("action");
|
|
150
|
-
action = attr ?
|
|
151
|
+
action = attr ? _chunkUO7KGW2Ujs.stripBasename.call(void 0, attr, basename) : null;
|
|
151
152
|
method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
|
|
152
153
|
encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
|
|
153
154
|
formData = new FormData(form, target);
|
|
@@ -184,20 +185,20 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
|
|
|
184
185
|
try {
|
|
185
186
|
if (isBrowser) {
|
|
186
187
|
window.__reactRouterVersion = // @ts-expect-error
|
|
187
|
-
"7.
|
|
188
|
+
"7.11.0-pre.0";
|
|
188
189
|
}
|
|
189
190
|
} catch (e) {
|
|
190
191
|
}
|
|
191
192
|
function createBrowserRouter(routes, opts) {
|
|
192
|
-
return
|
|
193
|
+
return _chunkUO7KGW2Ujs.createRouter.call(void 0, {
|
|
193
194
|
basename: _optionalChain([opts, 'optionalAccess', _2 => _2.basename]),
|
|
194
195
|
getContext: _optionalChain([opts, 'optionalAccess', _3 => _3.getContext]),
|
|
195
196
|
future: _optionalChain([opts, 'optionalAccess', _4 => _4.future]),
|
|
196
|
-
history:
|
|
197
|
+
history: _chunkUO7KGW2Ujs.createBrowserHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _5 => _5.window]) }),
|
|
197
198
|
hydrationData: _optionalChain([opts, 'optionalAccess', _6 => _6.hydrationData]) || parseHydrationData(),
|
|
198
199
|
routes,
|
|
199
|
-
mapRouteProperties:
|
|
200
|
-
hydrationRouteProperties:
|
|
200
|
+
mapRouteProperties: _chunkUO7KGW2Ujs.mapRouteProperties,
|
|
201
|
+
hydrationRouteProperties: _chunkUO7KGW2Ujs.hydrationRouteProperties,
|
|
201
202
|
dataStrategy: _optionalChain([opts, 'optionalAccess', _7 => _7.dataStrategy]),
|
|
202
203
|
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _8 => _8.patchRoutesOnNavigation]),
|
|
203
204
|
window: _optionalChain([opts, 'optionalAccess', _9 => _9.window]),
|
|
@@ -205,15 +206,15 @@ function createBrowserRouter(routes, opts) {
|
|
|
205
206
|
}).initialize();
|
|
206
207
|
}
|
|
207
208
|
function createHashRouter(routes, opts) {
|
|
208
|
-
return
|
|
209
|
+
return _chunkUO7KGW2Ujs.createRouter.call(void 0, {
|
|
209
210
|
basename: _optionalChain([opts, 'optionalAccess', _11 => _11.basename]),
|
|
210
211
|
getContext: _optionalChain([opts, 'optionalAccess', _12 => _12.getContext]),
|
|
211
212
|
future: _optionalChain([opts, 'optionalAccess', _13 => _13.future]),
|
|
212
|
-
history:
|
|
213
|
+
history: _chunkUO7KGW2Ujs.createHashHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _14 => _14.window]) }),
|
|
213
214
|
hydrationData: _optionalChain([opts, 'optionalAccess', _15 => _15.hydrationData]) || parseHydrationData(),
|
|
214
215
|
routes,
|
|
215
|
-
mapRouteProperties:
|
|
216
|
-
hydrationRouteProperties:
|
|
216
|
+
mapRouteProperties: _chunkUO7KGW2Ujs.mapRouteProperties,
|
|
217
|
+
hydrationRouteProperties: _chunkUO7KGW2Ujs.hydrationRouteProperties,
|
|
217
218
|
dataStrategy: _optionalChain([opts, 'optionalAccess', _16 => _16.dataStrategy]),
|
|
218
219
|
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _17 => _17.patchRoutesOnNavigation]),
|
|
219
220
|
window: _optionalChain([opts, 'optionalAccess', _18 => _18.window]),
|
|
@@ -236,7 +237,7 @@ function deserializeErrors(errors) {
|
|
|
236
237
|
let serialized = {};
|
|
237
238
|
for (let [key, val] of entries) {
|
|
238
239
|
if (val && val.__type === "RouteErrorResponse") {
|
|
239
|
-
serialized[key] = new (0,
|
|
240
|
+
serialized[key] = new (0, _chunkUO7KGW2Ujs.ErrorResponseImpl)(
|
|
240
241
|
val.status,
|
|
241
242
|
val.statusText,
|
|
242
243
|
val.data,
|
|
@@ -273,7 +274,7 @@ function BrowserRouter({
|
|
|
273
274
|
}) {
|
|
274
275
|
let historyRef = React.useRef();
|
|
275
276
|
if (historyRef.current == null) {
|
|
276
|
-
historyRef.current =
|
|
277
|
+
historyRef.current = _chunkUO7KGW2Ujs.createBrowserHistory.call(void 0, { window: window2, v5Compat: true });
|
|
277
278
|
}
|
|
278
279
|
let history = historyRef.current;
|
|
279
280
|
let [state, setStateImpl] = React.useState({
|
|
@@ -292,14 +293,14 @@ function BrowserRouter({
|
|
|
292
293
|
);
|
|
293
294
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
294
295
|
return /* @__PURE__ */ React.createElement(
|
|
295
|
-
|
|
296
|
+
_chunkUO7KGW2Ujs.Router,
|
|
296
297
|
{
|
|
297
298
|
basename,
|
|
298
299
|
children,
|
|
299
300
|
location: state.location,
|
|
300
301
|
navigationType: state.action,
|
|
301
302
|
navigator: history,
|
|
302
|
-
unstable_useTransitions
|
|
303
|
+
unstable_useTransitions
|
|
303
304
|
}
|
|
304
305
|
);
|
|
305
306
|
}
|
|
@@ -311,7 +312,7 @@ function HashRouter({
|
|
|
311
312
|
}) {
|
|
312
313
|
let historyRef = React.useRef();
|
|
313
314
|
if (historyRef.current == null) {
|
|
314
|
-
historyRef.current =
|
|
315
|
+
historyRef.current = _chunkUO7KGW2Ujs.createHashHistory.call(void 0, { window: window2, v5Compat: true });
|
|
315
316
|
}
|
|
316
317
|
let history = historyRef.current;
|
|
317
318
|
let [state, setStateImpl] = React.useState({
|
|
@@ -330,14 +331,14 @@ function HashRouter({
|
|
|
330
331
|
);
|
|
331
332
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
332
333
|
return /* @__PURE__ */ React.createElement(
|
|
333
|
-
|
|
334
|
+
_chunkUO7KGW2Ujs.Router,
|
|
334
335
|
{
|
|
335
336
|
basename,
|
|
336
337
|
children,
|
|
337
338
|
location: state.location,
|
|
338
339
|
navigationType: state.action,
|
|
339
340
|
navigator: history,
|
|
340
|
-
unstable_useTransitions
|
|
341
|
+
unstable_useTransitions
|
|
341
342
|
}
|
|
342
343
|
);
|
|
343
344
|
}
|
|
@@ -363,14 +364,14 @@ function HistoryRouter({
|
|
|
363
364
|
);
|
|
364
365
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
365
366
|
return /* @__PURE__ */ React.createElement(
|
|
366
|
-
|
|
367
|
+
_chunkUO7KGW2Ujs.Router,
|
|
367
368
|
{
|
|
368
369
|
basename,
|
|
369
370
|
children,
|
|
370
371
|
location: state.location,
|
|
371
372
|
navigationType: state.action,
|
|
372
373
|
navigator: history,
|
|
373
|
-
unstable_useTransitions
|
|
374
|
+
unstable_useTransitions
|
|
374
375
|
}
|
|
375
376
|
);
|
|
376
377
|
}
|
|
@@ -389,34 +390,15 @@ var Link = React.forwardRef(
|
|
|
389
390
|
to,
|
|
390
391
|
preventScrollReset,
|
|
391
392
|
viewTransition,
|
|
393
|
+
unstable_defaultShouldRevalidate,
|
|
392
394
|
...rest
|
|
393
395
|
}, forwardedRef) {
|
|
394
|
-
let { basename, unstable_useTransitions } = React.useContext(
|
|
396
|
+
let { basename, unstable_useTransitions } = React.useContext(_chunkUO7KGW2Ujs.NavigationContext);
|
|
395
397
|
let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX.test(to);
|
|
396
|
-
let
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
if (isBrowser) {
|
|
401
|
-
try {
|
|
402
|
-
let currentUrl = new URL(window.location.href);
|
|
403
|
-
let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
|
|
404
|
-
let path = _chunkUQPBOMFPjs.stripBasename.call(void 0, targetUrl.pathname, basename);
|
|
405
|
-
if (targetUrl.origin === currentUrl.origin && path != null) {
|
|
406
|
-
to = path + targetUrl.search + targetUrl.hash;
|
|
407
|
-
} else {
|
|
408
|
-
isExternal = true;
|
|
409
|
-
}
|
|
410
|
-
} catch (e) {
|
|
411
|
-
_chunkUQPBOMFPjs.warning.call(void 0,
|
|
412
|
-
false,
|
|
413
|
-
`<Link to="${to}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
414
|
-
);
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
let href = _chunkUQPBOMFPjs.useHref.call(void 0, to, { relative });
|
|
419
|
-
let [shouldPrefetch, prefetchRef, prefetchHandlers] = _chunkUQPBOMFPjs.usePrefetchBehavior.call(void 0,
|
|
398
|
+
let parsed = _chunkUO7KGW2Ujs.parseToInfo.call(void 0, to, basename);
|
|
399
|
+
to = parsed.to;
|
|
400
|
+
let href = _chunkUO7KGW2Ujs.useHref.call(void 0, to, { relative });
|
|
401
|
+
let [shouldPrefetch, prefetchRef, prefetchHandlers] = _chunkUO7KGW2Ujs.usePrefetchBehavior.call(void 0,
|
|
420
402
|
prefetch,
|
|
421
403
|
rest
|
|
422
404
|
);
|
|
@@ -427,6 +409,7 @@ var Link = React.forwardRef(
|
|
|
427
409
|
preventScrollReset,
|
|
428
410
|
relative,
|
|
429
411
|
viewTransition,
|
|
412
|
+
unstable_defaultShouldRevalidate,
|
|
430
413
|
unstable_useTransitions
|
|
431
414
|
});
|
|
432
415
|
function handleClick(event) {
|
|
@@ -442,15 +425,15 @@ var Link = React.forwardRef(
|
|
|
442
425
|
{
|
|
443
426
|
...rest,
|
|
444
427
|
...prefetchHandlers,
|
|
445
|
-
href:
|
|
446
|
-
onClick: isExternal || reloadDocument ? onClick : handleClick,
|
|
447
|
-
ref:
|
|
428
|
+
href: parsed.absoluteURL || href,
|
|
429
|
+
onClick: parsed.isExternal || reloadDocument ? onClick : handleClick,
|
|
430
|
+
ref: _chunkUO7KGW2Ujs.mergeRefs.call(void 0, forwardedRef, prefetchRef),
|
|
448
431
|
target,
|
|
449
432
|
"data-discover": !isAbsolute && discover === "render" ? "true" : void 0
|
|
450
433
|
}
|
|
451
434
|
)
|
|
452
435
|
);
|
|
453
|
-
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(
|
|
436
|
+
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(_chunkUO7KGW2Ujs.PrefetchPageLinks, { page: href })) : link;
|
|
454
437
|
}
|
|
455
438
|
);
|
|
456
439
|
Link.displayName = "Link";
|
|
@@ -466,10 +449,10 @@ var NavLink = React.forwardRef(
|
|
|
466
449
|
children,
|
|
467
450
|
...rest
|
|
468
451
|
}, ref) {
|
|
469
|
-
let path =
|
|
470
|
-
let location =
|
|
471
|
-
let routerState = React.useContext(
|
|
472
|
-
let { navigator, basename } = React.useContext(
|
|
452
|
+
let path = _chunkUO7KGW2Ujs.useResolvedPath.call(void 0, to, { relative: rest.relative });
|
|
453
|
+
let location = _chunkUO7KGW2Ujs.useLocation.call(void 0, );
|
|
454
|
+
let routerState = React.useContext(_chunkUO7KGW2Ujs.DataRouterStateContext);
|
|
455
|
+
let { navigator, basename } = React.useContext(_chunkUO7KGW2Ujs.NavigationContext);
|
|
473
456
|
let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
|
|
474
457
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
475
458
|
useViewTransitionState(path) && viewTransition === true;
|
|
@@ -482,7 +465,7 @@ var NavLink = React.forwardRef(
|
|
|
482
465
|
toPathname = toPathname.toLowerCase();
|
|
483
466
|
}
|
|
484
467
|
if (nextLocationPathname && basename) {
|
|
485
|
-
nextLocationPathname =
|
|
468
|
+
nextLocationPathname = _chunkUO7KGW2Ujs.stripBasename.call(void 0, nextLocationPathname, basename) || nextLocationPathname;
|
|
486
469
|
}
|
|
487
470
|
const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
|
|
488
471
|
let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
|
|
@@ -535,9 +518,10 @@ var Form = React.forwardRef(
|
|
|
535
518
|
relative,
|
|
536
519
|
preventScrollReset,
|
|
537
520
|
viewTransition,
|
|
521
|
+
unstable_defaultShouldRevalidate,
|
|
538
522
|
...props
|
|
539
523
|
}, forwardedRef) => {
|
|
540
|
-
let { unstable_useTransitions } = React.useContext(
|
|
524
|
+
let { unstable_useTransitions } = React.useContext(_chunkUO7KGW2Ujs.NavigationContext);
|
|
541
525
|
let submit = useSubmit();
|
|
542
526
|
let formAction = useFormAction(action, { relative });
|
|
543
527
|
let formMethod = method.toLowerCase() === "get" ? "get" : "post";
|
|
@@ -556,7 +540,8 @@ var Form = React.forwardRef(
|
|
|
556
540
|
state,
|
|
557
541
|
relative,
|
|
558
542
|
preventScrollReset,
|
|
559
|
-
viewTransition
|
|
543
|
+
viewTransition,
|
|
544
|
+
unstable_defaultShouldRevalidate
|
|
560
545
|
});
|
|
561
546
|
if (unstable_useTransitions && navigate !== false) {
|
|
562
547
|
React.startTransition(() => doSubmit());
|
|
@@ -583,10 +568,10 @@ function ScrollRestoration({
|
|
|
583
568
|
storageKey,
|
|
584
569
|
...props
|
|
585
570
|
}) {
|
|
586
|
-
let remixContext = React.useContext(
|
|
587
|
-
let { basename } = React.useContext(
|
|
588
|
-
let location =
|
|
589
|
-
let matches =
|
|
571
|
+
let remixContext = React.useContext(_chunkUO7KGW2Ujs.FrameworkContext);
|
|
572
|
+
let { basename } = React.useContext(_chunkUO7KGW2Ujs.NavigationContext);
|
|
573
|
+
let location = _chunkUO7KGW2Ujs.useLocation.call(void 0, );
|
|
574
|
+
let matches = _chunkUO7KGW2Ujs.useMatches.call(void 0, );
|
|
590
575
|
useScrollRestoration({ getKey, storageKey });
|
|
591
576
|
let ssrKey = React.useMemo(
|
|
592
577
|
() => {
|
|
@@ -640,13 +625,13 @@ function getDataRouterConsoleError(hookName) {
|
|
|
640
625
|
return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
641
626
|
}
|
|
642
627
|
function useDataRouterContext(hookName) {
|
|
643
|
-
let ctx = React.useContext(
|
|
644
|
-
|
|
628
|
+
let ctx = React.useContext(_chunkUO7KGW2Ujs.DataRouterContext);
|
|
629
|
+
_chunkUO7KGW2Ujs.invariant.call(void 0, ctx, getDataRouterConsoleError(hookName));
|
|
645
630
|
return ctx;
|
|
646
631
|
}
|
|
647
632
|
function useDataRouterState(hookName) {
|
|
648
|
-
let state = React.useContext(
|
|
649
|
-
|
|
633
|
+
let state = React.useContext(_chunkUO7KGW2Ujs.DataRouterStateContext);
|
|
634
|
+
_chunkUO7KGW2Ujs.invariant.call(void 0, state, getDataRouterConsoleError(hookName));
|
|
650
635
|
return state;
|
|
651
636
|
}
|
|
652
637
|
function useLinkClickHandler(to, {
|
|
@@ -656,22 +641,24 @@ function useLinkClickHandler(to, {
|
|
|
656
641
|
preventScrollReset,
|
|
657
642
|
relative,
|
|
658
643
|
viewTransition,
|
|
644
|
+
unstable_defaultShouldRevalidate,
|
|
659
645
|
unstable_useTransitions
|
|
660
646
|
} = {}) {
|
|
661
|
-
let navigate =
|
|
662
|
-
let location =
|
|
663
|
-
let path =
|
|
647
|
+
let navigate = _chunkUO7KGW2Ujs.useNavigate.call(void 0, );
|
|
648
|
+
let location = _chunkUO7KGW2Ujs.useLocation.call(void 0, );
|
|
649
|
+
let path = _chunkUO7KGW2Ujs.useResolvedPath.call(void 0, to, { relative });
|
|
664
650
|
return React.useCallback(
|
|
665
651
|
(event) => {
|
|
666
652
|
if (shouldProcessLinkClick(event, target)) {
|
|
667
653
|
event.preventDefault();
|
|
668
|
-
let replace = replaceProp !== void 0 ? replaceProp :
|
|
654
|
+
let replace = replaceProp !== void 0 ? replaceProp : _chunkUO7KGW2Ujs.createPath.call(void 0, location) === _chunkUO7KGW2Ujs.createPath.call(void 0, path);
|
|
669
655
|
let doNavigate = () => navigate(to, {
|
|
670
656
|
replace,
|
|
671
657
|
state,
|
|
672
658
|
preventScrollReset,
|
|
673
659
|
relative,
|
|
674
|
-
viewTransition
|
|
660
|
+
viewTransition,
|
|
661
|
+
unstable_defaultShouldRevalidate
|
|
675
662
|
});
|
|
676
663
|
if (unstable_useTransitions) {
|
|
677
664
|
React.startTransition(() => doNavigate());
|
|
@@ -691,18 +678,19 @@ function useLinkClickHandler(to, {
|
|
|
691
678
|
preventScrollReset,
|
|
692
679
|
relative,
|
|
693
680
|
viewTransition,
|
|
681
|
+
unstable_defaultShouldRevalidate,
|
|
694
682
|
unstable_useTransitions
|
|
695
683
|
]
|
|
696
684
|
);
|
|
697
685
|
}
|
|
698
686
|
function useSearchParams(defaultInit) {
|
|
699
|
-
|
|
687
|
+
_chunkUO7KGW2Ujs.warning.call(void 0,
|
|
700
688
|
typeof URLSearchParams !== "undefined",
|
|
701
689
|
`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.`
|
|
702
690
|
);
|
|
703
691
|
let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));
|
|
704
692
|
let hasSetSearchParamsRef = React.useRef(false);
|
|
705
|
-
let location =
|
|
693
|
+
let location = _chunkUO7KGW2Ujs.useLocation.call(void 0, );
|
|
706
694
|
let searchParams = React.useMemo(
|
|
707
695
|
() => (
|
|
708
696
|
// Only merge in the defaults if we haven't yet called setSearchParams.
|
|
@@ -715,7 +703,7 @@ function useSearchParams(defaultInit) {
|
|
|
715
703
|
),
|
|
716
704
|
[location.search]
|
|
717
705
|
);
|
|
718
|
-
let navigate =
|
|
706
|
+
let navigate = _chunkUO7KGW2Ujs.useNavigate.call(void 0, );
|
|
719
707
|
let setSearchParams = React.useCallback(
|
|
720
708
|
(nextInit, navigateOptions) => {
|
|
721
709
|
const newSearchParams = createSearchParams(
|
|
@@ -732,8 +720,8 @@ var fetcherId = 0;
|
|
|
732
720
|
var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
|
|
733
721
|
function useSubmit() {
|
|
734
722
|
let { router } = useDataRouterContext("useSubmit" /* UseSubmit */);
|
|
735
|
-
let { basename } = React.useContext(
|
|
736
|
-
let currentRouteId =
|
|
723
|
+
let { basename } = React.useContext(_chunkUO7KGW2Ujs.NavigationContext);
|
|
724
|
+
let currentRouteId = _chunkUO7KGW2Ujs.useRouteId.call(void 0, );
|
|
737
725
|
let routerFetch = router.fetch;
|
|
738
726
|
let routerNavigate = router.navigate;
|
|
739
727
|
return React.useCallback(
|
|
@@ -745,6 +733,7 @@ function useSubmit() {
|
|
|
745
733
|
if (options.navigate === false) {
|
|
746
734
|
let key = options.fetcherKey || getUniqueFetcherId();
|
|
747
735
|
await routerFetch(key, currentRouteId, options.action || action, {
|
|
736
|
+
unstable_defaultShouldRevalidate: options.unstable_defaultShouldRevalidate,
|
|
748
737
|
preventScrollReset: options.preventScrollReset,
|
|
749
738
|
formData,
|
|
750
739
|
body,
|
|
@@ -754,6 +743,7 @@ function useSubmit() {
|
|
|
754
743
|
});
|
|
755
744
|
} else {
|
|
756
745
|
await routerNavigate(options.action || action, {
|
|
746
|
+
unstable_defaultShouldRevalidate: options.unstable_defaultShouldRevalidate,
|
|
757
747
|
preventScrollReset: options.preventScrollReset,
|
|
758
748
|
formData,
|
|
759
749
|
body,
|
|
@@ -771,12 +761,12 @@ function useSubmit() {
|
|
|
771
761
|
);
|
|
772
762
|
}
|
|
773
763
|
function useFormAction(action, { relative } = {}) {
|
|
774
|
-
let { basename } = React.useContext(
|
|
775
|
-
let routeContext = React.useContext(
|
|
776
|
-
|
|
764
|
+
let { basename } = React.useContext(_chunkUO7KGW2Ujs.NavigationContext);
|
|
765
|
+
let routeContext = React.useContext(_chunkUO7KGW2Ujs.RouteContext);
|
|
766
|
+
_chunkUO7KGW2Ujs.invariant.call(void 0, routeContext, "useFormAction must be used inside a RouteContext");
|
|
777
767
|
let [match] = routeContext.matches.slice(-1);
|
|
778
|
-
let path = { ...
|
|
779
|
-
let location =
|
|
768
|
+
let path = { ..._chunkUO7KGW2Ujs.useResolvedPath.call(void 0, action ? action : ".", { relative }) };
|
|
769
|
+
let location = _chunkUO7KGW2Ujs.useLocation.call(void 0, );
|
|
780
770
|
if (action == null) {
|
|
781
771
|
path.search = location.search;
|
|
782
772
|
let params = new URLSearchParams(path.search);
|
|
@@ -793,21 +783,21 @@ function useFormAction(action, { relative } = {}) {
|
|
|
793
783
|
path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
|
|
794
784
|
}
|
|
795
785
|
if (basename !== "/") {
|
|
796
|
-
path.pathname = path.pathname === "/" ? basename :
|
|
786
|
+
path.pathname = path.pathname === "/" ? basename : _chunkUO7KGW2Ujs.joinPaths.call(void 0, [basename, path.pathname]);
|
|
797
787
|
}
|
|
798
|
-
return
|
|
788
|
+
return _chunkUO7KGW2Ujs.createPath.call(void 0, path);
|
|
799
789
|
}
|
|
800
790
|
function useFetcher({
|
|
801
791
|
key
|
|
802
792
|
} = {}) {
|
|
803
793
|
let { router } = useDataRouterContext("useFetcher" /* UseFetcher */);
|
|
804
794
|
let state = useDataRouterState("useFetcher" /* UseFetcher */);
|
|
805
|
-
let fetcherData = React.useContext(
|
|
806
|
-
let route = React.useContext(
|
|
795
|
+
let fetcherData = React.useContext(_chunkUO7KGW2Ujs.FetchersContext);
|
|
796
|
+
let route = React.useContext(_chunkUO7KGW2Ujs.RouteContext);
|
|
807
797
|
let routeId = _optionalChain([route, 'access', _23 => _23.matches, 'access', _24 => _24[route.matches.length - 1], 'optionalAccess', _25 => _25.route, 'access', _26 => _26.id]);
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
798
|
+
_chunkUO7KGW2Ujs.invariant.call(void 0, fetcherData, `useFetcher must be used inside a FetchersContext`);
|
|
799
|
+
_chunkUO7KGW2Ujs.invariant.call(void 0, route, `useFetcher must be used inside a RouteContext`);
|
|
800
|
+
_chunkUO7KGW2Ujs.invariant.call(void 0,
|
|
811
801
|
routeId != null,
|
|
812
802
|
`useFetcher can only be used on routes that contain a unique "id"`
|
|
813
803
|
);
|
|
@@ -823,7 +813,7 @@ function useFetcher({
|
|
|
823
813
|
}, [deleteFetcher, getFetcher, fetcherKey]);
|
|
824
814
|
let load = React.useCallback(
|
|
825
815
|
async (href, opts) => {
|
|
826
|
-
|
|
816
|
+
_chunkUO7KGW2Ujs.invariant.call(void 0, routeId, "No routeId available for fetcher.load()");
|
|
827
817
|
await routerFetch(fetcherKey, routeId, href, opts);
|
|
828
818
|
},
|
|
829
819
|
[fetcherKey, routeId, routerFetch]
|
|
@@ -852,7 +842,7 @@ function useFetcher({
|
|
|
852
842
|
FetcherForm2.displayName = "fetcher.Form";
|
|
853
843
|
return FetcherForm2;
|
|
854
844
|
}, [fetcherKey]);
|
|
855
|
-
let fetcher = state.fetchers.get(fetcherKey) ||
|
|
845
|
+
let fetcher = state.fetchers.get(fetcherKey) || _chunkUO7KGW2Ujs.IDLE_FETCHER;
|
|
856
846
|
let data = fetcherData.get(fetcherKey);
|
|
857
847
|
let fetcherWithComponents = React.useMemo(
|
|
858
848
|
() => ({
|
|
@@ -883,7 +873,7 @@ function getScrollRestorationKey(location, matches, basename, getKey) {
|
|
|
883
873
|
key = getKey(
|
|
884
874
|
{
|
|
885
875
|
...location,
|
|
886
|
-
pathname:
|
|
876
|
+
pathname: _chunkUO7KGW2Ujs.stripBasename.call(void 0, location.pathname, basename) || location.pathname
|
|
887
877
|
},
|
|
888
878
|
matches
|
|
889
879
|
);
|
|
@@ -904,10 +894,10 @@ function useScrollRestoration({
|
|
|
904
894
|
let { restoreScrollPosition, preventScrollReset } = useDataRouterState(
|
|
905
895
|
"useScrollRestoration" /* UseScrollRestoration */
|
|
906
896
|
);
|
|
907
|
-
let { basename } = React.useContext(
|
|
908
|
-
let location =
|
|
909
|
-
let matches =
|
|
910
|
-
let navigation =
|
|
897
|
+
let { basename } = React.useContext(_chunkUO7KGW2Ujs.NavigationContext);
|
|
898
|
+
let location = _chunkUO7KGW2Ujs.useLocation.call(void 0, );
|
|
899
|
+
let matches = _chunkUO7KGW2Ujs.useMatches.call(void 0, );
|
|
900
|
+
let navigation = _chunkUO7KGW2Ujs.useNavigation.call(void 0, );
|
|
911
901
|
React.useEffect(() => {
|
|
912
902
|
window.history.scrollRestoration = "manual";
|
|
913
903
|
return () => {
|
|
@@ -926,7 +916,7 @@ function useScrollRestoration({
|
|
|
926
916
|
JSON.stringify(savedScrollPositions)
|
|
927
917
|
);
|
|
928
918
|
} catch (error) {
|
|
929
|
-
|
|
919
|
+
_chunkUO7KGW2Ujs.warning.call(void 0,
|
|
930
920
|
false,
|
|
931
921
|
`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${error}).`
|
|
932
922
|
);
|
|
@@ -973,7 +963,7 @@ function useScrollRestoration({
|
|
|
973
963
|
}
|
|
974
964
|
}
|
|
975
965
|
} catch (e2) {
|
|
976
|
-
|
|
966
|
+
_chunkUO7KGW2Ujs.warning.call(void 0,
|
|
977
967
|
false,
|
|
978
968
|
`"${location.hash.slice(
|
|
979
969
|
1
|
|
@@ -1011,7 +1001,7 @@ function usePrompt({
|
|
|
1011
1001
|
when,
|
|
1012
1002
|
message
|
|
1013
1003
|
}) {
|
|
1014
|
-
let blocker =
|
|
1004
|
+
let blocker = _chunkUO7KGW2Ujs.useBlocker.call(void 0, when);
|
|
1015
1005
|
React.useEffect(() => {
|
|
1016
1006
|
if (blocker.state === "blocked") {
|
|
1017
1007
|
let proceed = window.confirm(message);
|
|
@@ -1029,21 +1019,21 @@ function usePrompt({
|
|
|
1029
1019
|
}, [blocker, when]);
|
|
1030
1020
|
}
|
|
1031
1021
|
function useViewTransitionState(to, { relative } = {}) {
|
|
1032
|
-
let vtContext = React.useContext(
|
|
1033
|
-
|
|
1022
|
+
let vtContext = React.useContext(_chunkUO7KGW2Ujs.ViewTransitionContext);
|
|
1023
|
+
_chunkUO7KGW2Ujs.invariant.call(void 0,
|
|
1034
1024
|
vtContext != null,
|
|
1035
1025
|
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1036
1026
|
);
|
|
1037
1027
|
let { basename } = useDataRouterContext(
|
|
1038
1028
|
"useViewTransitionState" /* useViewTransitionState */
|
|
1039
1029
|
);
|
|
1040
|
-
let path =
|
|
1030
|
+
let path = _chunkUO7KGW2Ujs.useResolvedPath.call(void 0, to, { relative });
|
|
1041
1031
|
if (!vtContext.isTransitioning) {
|
|
1042
1032
|
return false;
|
|
1043
1033
|
}
|
|
1044
|
-
let currentPath =
|
|
1045
|
-
let nextPath =
|
|
1046
|
-
return
|
|
1034
|
+
let currentPath = _chunkUO7KGW2Ujs.stripBasename.call(void 0, vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
|
|
1035
|
+
let nextPath = _chunkUO7KGW2Ujs.stripBasename.call(void 0, vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
|
|
1036
|
+
return _chunkUO7KGW2Ujs.matchPath.call(void 0, path.pathname, nextPath) != null || _chunkUO7KGW2Ujs.matchPath.call(void 0, path.pathname, currentPath) != null;
|
|
1047
1037
|
}
|
|
1048
1038
|
|
|
1049
1039
|
// lib/dom/server.tsx
|
|
@@ -1054,7 +1044,7 @@ function StaticRouter({
|
|
|
1054
1044
|
location: locationProp = "/"
|
|
1055
1045
|
}) {
|
|
1056
1046
|
if (typeof locationProp === "string") {
|
|
1057
|
-
locationProp =
|
|
1047
|
+
locationProp = _chunkUO7KGW2Ujs.parsePath.call(void 0, locationProp);
|
|
1058
1048
|
}
|
|
1059
1049
|
let action = "POP" /* Pop */;
|
|
1060
1050
|
let location = {
|
|
@@ -1066,7 +1056,7 @@ function StaticRouter({
|
|
|
1066
1056
|
};
|
|
1067
1057
|
let staticNavigator = getStatelessNavigator();
|
|
1068
1058
|
return /* @__PURE__ */ React2.createElement(
|
|
1069
|
-
|
|
1059
|
+
_chunkUO7KGW2Ujs.Router,
|
|
1070
1060
|
{
|
|
1071
1061
|
basename,
|
|
1072
1062
|
children,
|
|
@@ -1084,7 +1074,7 @@ function StaticRouterProvider({
|
|
|
1084
1074
|
hydrate = true,
|
|
1085
1075
|
nonce
|
|
1086
1076
|
}) {
|
|
1087
|
-
|
|
1077
|
+
_chunkUO7KGW2Ujs.invariant.call(void 0,
|
|
1088
1078
|
router && context,
|
|
1089
1079
|
"You must provide `router` and `context` to <StaticRouterProvider>"
|
|
1090
1080
|
);
|
|
@@ -1107,8 +1097,8 @@ function StaticRouterProvider({
|
|
|
1107
1097
|
hydrateScript = `window.__staticRouterHydrationData = JSON.parse(${json});`;
|
|
1108
1098
|
}
|
|
1109
1099
|
let { state } = dataRouterContext.router;
|
|
1110
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
|
1111
|
-
|
|
1100
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(_chunkUO7KGW2Ujs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React2.createElement(_chunkUO7KGW2Ujs.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React2.createElement(_chunkUO7KGW2Ujs.FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ React2.createElement(_chunkUO7KGW2Ujs.ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ React2.createElement(
|
|
1101
|
+
_chunkUO7KGW2Ujs.Router,
|
|
1112
1102
|
{
|
|
1113
1103
|
basename: dataRouterContext.basename,
|
|
1114
1104
|
location: state.location,
|
|
@@ -1139,14 +1129,14 @@ function DataRoutes({
|
|
|
1139
1129
|
future,
|
|
1140
1130
|
state
|
|
1141
1131
|
}) {
|
|
1142
|
-
return
|
|
1132
|
+
return _chunkUO7KGW2Ujs.useRoutesImpl.call(void 0, routes, void 0, state, void 0, future);
|
|
1143
1133
|
}
|
|
1144
1134
|
function serializeErrors(errors) {
|
|
1145
1135
|
if (!errors) return null;
|
|
1146
1136
|
let entries = Object.entries(errors);
|
|
1147
1137
|
let serialized = {};
|
|
1148
1138
|
for (let [key, val] of entries) {
|
|
1149
|
-
if (
|
|
1139
|
+
if (_chunkUO7KGW2Ujs.isRouteErrorResponse.call(void 0, val)) {
|
|
1150
1140
|
serialized[key] = { ...val, __type: "RouteErrorResponse" };
|
|
1151
1141
|
} else if (val instanceof Error) {
|
|
1152
1142
|
serialized[key] = {
|
|
@@ -1196,16 +1186,16 @@ function getStatelessNavigator() {
|
|
|
1196
1186
|
};
|
|
1197
1187
|
}
|
|
1198
1188
|
function createStaticHandler2(routes, opts) {
|
|
1199
|
-
return
|
|
1189
|
+
return _chunkUO7KGW2Ujs.createStaticHandler.call(void 0, routes, {
|
|
1200
1190
|
...opts,
|
|
1201
|
-
mapRouteProperties:
|
|
1191
|
+
mapRouteProperties: _chunkUO7KGW2Ujs.mapRouteProperties
|
|
1202
1192
|
});
|
|
1203
1193
|
}
|
|
1204
1194
|
function createStaticRouter(routes, context, opts = {}) {
|
|
1205
1195
|
let manifest = {};
|
|
1206
|
-
let dataRoutes =
|
|
1196
|
+
let dataRoutes = _chunkUO7KGW2Ujs.convertRoutesToDataRoutes.call(void 0,
|
|
1207
1197
|
routes,
|
|
1208
|
-
|
|
1198
|
+
_chunkUO7KGW2Ujs.mapRouteProperties,
|
|
1209
1199
|
void 0,
|
|
1210
1200
|
manifest
|
|
1211
1201
|
);
|
|
@@ -1236,7 +1226,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1236
1226
|
actionData: context.actionData,
|
|
1237
1227
|
errors: context.errors,
|
|
1238
1228
|
initialized: true,
|
|
1239
|
-
navigation:
|
|
1229
|
+
navigation: _chunkUO7KGW2Ujs.IDLE_NAVIGATION,
|
|
1240
1230
|
restoreScrollPosition: null,
|
|
1241
1231
|
preventScrollReset: false,
|
|
1242
1232
|
revalidation: "idle",
|
|
@@ -1271,7 +1261,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1271
1261
|
createHref,
|
|
1272
1262
|
encodeLocation,
|
|
1273
1263
|
getFetcher() {
|
|
1274
|
-
return
|
|
1264
|
+
return _chunkUO7KGW2Ujs.IDLE_FETCHER;
|
|
1275
1265
|
},
|
|
1276
1266
|
deleteFetcher() {
|
|
1277
1267
|
throw msg("deleteFetcher");
|
|
@@ -1283,7 +1273,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1283
1273
|
throw msg("dispose");
|
|
1284
1274
|
},
|
|
1285
1275
|
getBlocker() {
|
|
1286
|
-
return
|
|
1276
|
+
return _chunkUO7KGW2Ujs.IDLE_BLOCKER;
|
|
1287
1277
|
},
|
|
1288
1278
|
deleteBlocker() {
|
|
1289
1279
|
throw msg("deleteBlocker");
|
|
@@ -1301,10 +1291,10 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1301
1291
|
};
|
|
1302
1292
|
}
|
|
1303
1293
|
function createHref(to) {
|
|
1304
|
-
return typeof to === "string" ? to :
|
|
1294
|
+
return typeof to === "string" ? to : _chunkUO7KGW2Ujs.createPath.call(void 0, to);
|
|
1305
1295
|
}
|
|
1306
1296
|
function encodeLocation(to) {
|
|
1307
|
-
let href = typeof to === "string" ? to :
|
|
1297
|
+
let href = typeof to === "string" ? to : _chunkUO7KGW2Ujs.createPath.call(void 0, to);
|
|
1308
1298
|
href = href.replace(/ $/, "%20");
|
|
1309
1299
|
let encoded = ABSOLUTE_URL_REGEX2.test(href) ? new URL(href) : new URL(href, "http://localhost");
|
|
1310
1300
|
return {
|