react-router 7.17.0 → 7.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -1
- package/dist/development/{browser-D3uq9sI1.d.ts → browser-B2PdsXXH.d.ts} +2 -2
- package/dist/development/{browser-CGcs-0pD.d.mts → browser-DBmQ1yAR.d.mts} +2 -2
- package/dist/development/{chunk-PBLBZ3QU.js → chunk-EVX4J2F5.js} +7 -7
- package/dist/development/{chunk-PULC7NLK.js → chunk-G5KIBF6U.js} +111 -108
- package/dist/{production/chunk-5TQZEVD5.mjs → development/chunk-IJF3QNGC.mjs} +45 -113
- package/dist/development/{chunk-6CSD65Y2.mjs → chunk-KS7C4IRE.mjs} +115 -38
- package/dist/development/{chunk-KFNXW4AL.js → chunk-SA4DP3SF.js} +113 -35
- package/dist/{production/context-CmHpk1Ws.d.mts → development/context-CeD5LmaF.d.mts} +12 -4
- package/dist/{production/data-D4xhSy90.d.ts → development/data-CjO11-hU.d.ts} +9 -1
- package/dist/development/{data-U8FS-wNn.d.mts → data-DEjBmEfD.d.mts} +9 -1
- package/dist/development/dom-export.d.mts +3 -3
- package/dist/development/dom-export.d.ts +3 -3
- package/dist/development/dom-export.js +46 -44
- package/dist/development/dom-export.mjs +23 -21
- package/dist/development/{index-react-server-client-CwU9bE5R.d.ts → index-react-server-client-3ykjivgQ.d.ts} +29 -7
- package/dist/development/{index-react-server-client-DPrDrCew.d.mts → index-react-server-client-CACgcj2J.d.mts} +19 -5
- 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 +9 -1
- package/dist/development/index-react-server.d.ts +9 -1
- package/dist/development/index-react-server.js +144 -121
- package/dist/development/index-react-server.mjs +143 -120
- package/dist/development/index.d.mts +15 -14
- package/dist/development/index.d.ts +15 -14
- package/dist/development/index.js +137 -205
- package/dist/development/index.mjs +3 -5
- package/dist/{production/instrumentation-1q4YhLGP.d.ts → development/instrumentation-Dkmpzd13.d.ts} +2 -2
- 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-CqK96Zfk.d.mts → register-CmkRspdl.d.mts} +1 -1
- package/dist/development/{register-CNAx3TXj.d.ts → register-roq_0qYo.d.ts} +1 -1
- package/dist/production/{browser-D3uq9sI1.d.ts → browser-B2PdsXXH.d.ts} +2 -2
- package/dist/production/{browser-CGcs-0pD.d.mts → browser-DBmQ1yAR.d.mts} +2 -2
- package/dist/{development/chunk-ASILSGTR.mjs → production/chunk-3MA7PLKB.mjs} +45 -113
- package/dist/production/{chunk-OSYEOCBT.mjs → chunk-3WDNQUW5.mjs} +115 -38
- package/dist/production/{chunk-CTIXC7EV.js → chunk-GOIER6ML.js} +7 -7
- package/dist/production/{chunk-RTRY3JFT.js → chunk-IEF7VMTA.js} +113 -35
- package/dist/production/{chunk-EN242BO4.js → chunk-WICLSFKL.js} +111 -108
- package/dist/{development/context-CmHpk1Ws.d.mts → production/context-CeD5LmaF.d.mts} +12 -4
- package/dist/{development/data-D4xhSy90.d.ts → production/data-CjO11-hU.d.ts} +9 -1
- package/dist/production/{data-U8FS-wNn.d.mts → data-DEjBmEfD.d.mts} +9 -1
- package/dist/production/dom-export.d.mts +3 -3
- package/dist/production/dom-export.d.ts +3 -3
- package/dist/production/dom-export.js +46 -44
- package/dist/production/dom-export.mjs +23 -21
- package/dist/production/{index-react-server-client-CwU9bE5R.d.ts → index-react-server-client-3ykjivgQ.d.ts} +29 -7
- package/dist/production/{index-react-server-client-DPrDrCew.d.mts → index-react-server-client-CACgcj2J.d.mts} +19 -5
- 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 +9 -1
- package/dist/production/index-react-server.d.ts +9 -1
- package/dist/production/index-react-server.js +144 -121
- package/dist/production/index-react-server.mjs +143 -120
- package/dist/production/index.d.mts +15 -14
- package/dist/production/index.d.ts +15 -14
- package/dist/production/index.js +137 -205
- package/dist/production/index.mjs +3 -5
- package/dist/{development/instrumentation-1q4YhLGP.d.ts → production/instrumentation-Dkmpzd13.d.ts} +2 -2
- 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-CqK96Zfk.d.mts → register-CmkRspdl.d.mts} +1 -1
- package/dist/production/{register-CNAx3TXj.d.ts → register-roq_0qYo.d.ts} +1 -1
- package/docs/explanation/type-safety.md +1 -1
- package/docs/how-to/headers.md +2 -1
- package/docs/how-to/security.md +8 -6
- package/docs/how-to/status.md +1 -1
- package/docs/start/data/installation.md +4 -0
- package/docs/start/framework/deploying.md +4 -0
- package/docs/upgrading/future.md +222 -12
- package/docs/upgrading/remix.md +2 -2
- 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.18.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -51,7 +51,9 @@
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
var _chunkSA4DP3SFjs = require('./chunk-SA4DP3SF.js');
|
|
55
57
|
|
|
56
58
|
// lib/dom/dom.ts
|
|
57
59
|
var defaultMethod = "get";
|
|
@@ -122,7 +124,7 @@ var supportedFormEncTypes = /* @__PURE__ */ new Set([
|
|
|
122
124
|
]);
|
|
123
125
|
function getFormEncType(encType) {
|
|
124
126
|
if (encType != null && !supportedFormEncTypes.has(encType)) {
|
|
125
|
-
|
|
127
|
+
_chunkSA4DP3SFjs.warning.call(void 0,
|
|
126
128
|
false,
|
|
127
129
|
`"${encType}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`
|
|
128
130
|
);
|
|
@@ -138,7 +140,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
138
140
|
let body;
|
|
139
141
|
if (isFormElement(target)) {
|
|
140
142
|
let attr = target.getAttribute("action");
|
|
141
|
-
action = attr ?
|
|
143
|
+
action = attr ? _chunkSA4DP3SFjs.stripBasename.call(void 0, attr, basename) : null;
|
|
142
144
|
method = target.getAttribute("method") || defaultMethod;
|
|
143
145
|
encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
|
|
144
146
|
formData = new FormData(target);
|
|
@@ -150,7 +152,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
150
152
|
);
|
|
151
153
|
}
|
|
152
154
|
let attr = target.getAttribute("formaction") || form.getAttribute("action");
|
|
153
|
-
action = attr ?
|
|
155
|
+
action = attr ? _chunkSA4DP3SFjs.stripBasename.call(void 0, attr, basename) : null;
|
|
154
156
|
method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
|
|
155
157
|
encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
|
|
156
158
|
formData = new FormData(form, target);
|
|
@@ -187,20 +189,20 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
|
|
|
187
189
|
try {
|
|
188
190
|
if (isBrowser) {
|
|
189
191
|
window.__reactRouterVersion = // @ts-expect-error
|
|
190
|
-
"7.
|
|
192
|
+
"7.18.1";
|
|
191
193
|
}
|
|
192
194
|
} catch (e) {
|
|
193
195
|
}
|
|
194
196
|
function createBrowserRouter(routes, opts) {
|
|
195
|
-
return
|
|
197
|
+
return _chunkSA4DP3SFjs.createRouter.call(void 0, {
|
|
196
198
|
basename: _optionalChain([opts, 'optionalAccess', _2 => _2.basename]),
|
|
197
199
|
getContext: _optionalChain([opts, 'optionalAccess', _3 => _3.getContext]),
|
|
198
200
|
future: _optionalChain([opts, 'optionalAccess', _4 => _4.future]),
|
|
199
|
-
history:
|
|
201
|
+
history: _chunkSA4DP3SFjs.createBrowserHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _5 => _5.window]) }),
|
|
200
202
|
hydrationData: _optionalChain([opts, 'optionalAccess', _6 => _6.hydrationData]) || parseHydrationData(),
|
|
201
203
|
routes,
|
|
202
|
-
mapRouteProperties:
|
|
203
|
-
hydrationRouteProperties:
|
|
204
|
+
mapRouteProperties: _chunkSA4DP3SFjs.mapRouteProperties,
|
|
205
|
+
hydrationRouteProperties: _chunkSA4DP3SFjs.hydrationRouteProperties,
|
|
204
206
|
dataStrategy: _optionalChain([opts, 'optionalAccess', _7 => _7.dataStrategy]),
|
|
205
207
|
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _8 => _8.patchRoutesOnNavigation]),
|
|
206
208
|
window: _optionalChain([opts, 'optionalAccess', _9 => _9.window]),
|
|
@@ -208,15 +210,15 @@ function createBrowserRouter(routes, opts) {
|
|
|
208
210
|
}).initialize();
|
|
209
211
|
}
|
|
210
212
|
function createHashRouter(routes, opts) {
|
|
211
|
-
return
|
|
213
|
+
return _chunkSA4DP3SFjs.createRouter.call(void 0, {
|
|
212
214
|
basename: _optionalChain([opts, 'optionalAccess', _11 => _11.basename]),
|
|
213
215
|
getContext: _optionalChain([opts, 'optionalAccess', _12 => _12.getContext]),
|
|
214
216
|
future: _optionalChain([opts, 'optionalAccess', _13 => _13.future]),
|
|
215
|
-
history:
|
|
217
|
+
history: _chunkSA4DP3SFjs.createHashHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _14 => _14.window]) }),
|
|
216
218
|
hydrationData: _optionalChain([opts, 'optionalAccess', _15 => _15.hydrationData]) || parseHydrationData(),
|
|
217
219
|
routes,
|
|
218
|
-
mapRouteProperties:
|
|
219
|
-
hydrationRouteProperties:
|
|
220
|
+
mapRouteProperties: _chunkSA4DP3SFjs.mapRouteProperties,
|
|
221
|
+
hydrationRouteProperties: _chunkSA4DP3SFjs.hydrationRouteProperties,
|
|
220
222
|
dataStrategy: _optionalChain([opts, 'optionalAccess', _16 => _16.dataStrategy]),
|
|
221
223
|
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _17 => _17.patchRoutesOnNavigation]),
|
|
222
224
|
window: _optionalChain([opts, 'optionalAccess', _18 => _18.window]),
|
|
@@ -239,14 +241,14 @@ function deserializeErrors(errors) {
|
|
|
239
241
|
let serialized = {};
|
|
240
242
|
for (let [key, val] of entries) {
|
|
241
243
|
if (val && val.__type === "RouteErrorResponse") {
|
|
242
|
-
serialized[key] = new (0,
|
|
244
|
+
serialized[key] = new (0, _chunkSA4DP3SFjs.ErrorResponseImpl)(
|
|
243
245
|
val.status,
|
|
244
246
|
val.statusText,
|
|
245
247
|
val.data,
|
|
246
248
|
val.internal === true
|
|
247
249
|
);
|
|
248
250
|
} else if (val && val.__type === "Error") {
|
|
249
|
-
if (val.__subType) {
|
|
251
|
+
if (typeof val.__subType === "string" && _chunkSA4DP3SFjs.SUPPORTED_ERROR_TYPES.includes(val.__subType)) {
|
|
250
252
|
let ErrorConstructor = window[val.__subType];
|
|
251
253
|
if (typeof ErrorConstructor === "function") {
|
|
252
254
|
try {
|
|
@@ -276,7 +278,7 @@ function BrowserRouter({
|
|
|
276
278
|
}) {
|
|
277
279
|
let historyRef = React.useRef();
|
|
278
280
|
if (historyRef.current == null) {
|
|
279
|
-
historyRef.current =
|
|
281
|
+
historyRef.current = _chunkSA4DP3SFjs.createBrowserHistory.call(void 0, { window: window2, v5Compat: true });
|
|
280
282
|
}
|
|
281
283
|
let history = historyRef.current;
|
|
282
284
|
let [state, setStateImpl] = React.useState({
|
|
@@ -295,7 +297,7 @@ function BrowserRouter({
|
|
|
295
297
|
);
|
|
296
298
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
297
299
|
return /* @__PURE__ */ React.createElement(
|
|
298
|
-
|
|
300
|
+
_chunkSA4DP3SFjs.Router,
|
|
299
301
|
{
|
|
300
302
|
basename,
|
|
301
303
|
children,
|
|
@@ -314,7 +316,7 @@ function HashRouter({
|
|
|
314
316
|
}) {
|
|
315
317
|
let historyRef = React.useRef();
|
|
316
318
|
if (historyRef.current == null) {
|
|
317
|
-
historyRef.current =
|
|
319
|
+
historyRef.current = _chunkSA4DP3SFjs.createHashHistory.call(void 0, { window: window2, v5Compat: true });
|
|
318
320
|
}
|
|
319
321
|
let history = historyRef.current;
|
|
320
322
|
let [state, setStateImpl] = React.useState({
|
|
@@ -333,7 +335,7 @@ function HashRouter({
|
|
|
333
335
|
);
|
|
334
336
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
335
337
|
return /* @__PURE__ */ React.createElement(
|
|
336
|
-
|
|
338
|
+
_chunkSA4DP3SFjs.Router,
|
|
337
339
|
{
|
|
338
340
|
basename,
|
|
339
341
|
children,
|
|
@@ -366,7 +368,7 @@ function HistoryRouter({
|
|
|
366
368
|
);
|
|
367
369
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
368
370
|
return /* @__PURE__ */ React.createElement(
|
|
369
|
-
|
|
371
|
+
_chunkSA4DP3SFjs.Router,
|
|
370
372
|
{
|
|
371
373
|
basename,
|
|
372
374
|
children,
|
|
@@ -378,7 +380,6 @@ function HistoryRouter({
|
|
|
378
380
|
);
|
|
379
381
|
}
|
|
380
382
|
HistoryRouter.displayName = "unstable_HistoryRouter";
|
|
381
|
-
var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
382
383
|
var Link = React.forwardRef(
|
|
383
384
|
function LinkWithRef({
|
|
384
385
|
onClick,
|
|
@@ -396,26 +397,26 @@ var Link = React.forwardRef(
|
|
|
396
397
|
defaultShouldRevalidate,
|
|
397
398
|
...rest
|
|
398
399
|
}, forwardedRef) {
|
|
399
|
-
let { basename, navigator, useTransitions } = React.useContext(
|
|
400
|
-
let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX.test(to);
|
|
401
|
-
let parsed =
|
|
400
|
+
let { basename, navigator, useTransitions } = React.useContext(_chunkSA4DP3SFjs.NavigationContext);
|
|
401
|
+
let isAbsolute = typeof to === "string" && _chunkSA4DP3SFjs.ABSOLUTE_URL_REGEX.test(to);
|
|
402
|
+
let parsed = _chunkSA4DP3SFjs.parseToInfo.call(void 0, to, basename);
|
|
402
403
|
to = parsed.to;
|
|
403
|
-
let href =
|
|
404
|
-
let location =
|
|
404
|
+
let href = _chunkSA4DP3SFjs.useHref.call(void 0, to, { relative });
|
|
405
|
+
let location = _chunkSA4DP3SFjs.useLocation.call(void 0, );
|
|
405
406
|
let maskedHref = null;
|
|
406
407
|
if (mask) {
|
|
407
|
-
let resolved =
|
|
408
|
+
let resolved = _chunkSA4DP3SFjs.resolveTo.call(void 0,
|
|
408
409
|
mask,
|
|
409
410
|
[],
|
|
410
411
|
location.mask ? location.mask.pathname : "/",
|
|
411
412
|
true
|
|
412
413
|
);
|
|
413
414
|
if (basename !== "/") {
|
|
414
|
-
resolved.pathname = resolved.pathname === "/" ? basename :
|
|
415
|
+
resolved.pathname = resolved.pathname === "/" ? basename : _chunkSA4DP3SFjs.joinPaths.call(void 0, [basename, resolved.pathname]);
|
|
415
416
|
}
|
|
416
417
|
maskedHref = navigator.createHref(resolved);
|
|
417
418
|
}
|
|
418
|
-
let [shouldPrefetch, prefetchRef, prefetchHandlers] =
|
|
419
|
+
let [shouldPrefetch, prefetchRef, prefetchHandlers] = _chunkSA4DP3SFjs.usePrefetchBehavior.call(void 0,
|
|
419
420
|
prefetch,
|
|
420
421
|
rest
|
|
421
422
|
);
|
|
@@ -446,13 +447,13 @@ var Link = React.forwardRef(
|
|
|
446
447
|
...prefetchHandlers,
|
|
447
448
|
href: (isSpaLink ? maskedHref : void 0) || parsed.absoluteURL || href,
|
|
448
449
|
onClick: isSpaLink ? handleClick : onClick,
|
|
449
|
-
ref:
|
|
450
|
+
ref: _chunkSA4DP3SFjs.mergeRefs.call(void 0, forwardedRef, prefetchRef),
|
|
450
451
|
target,
|
|
451
452
|
"data-discover": !isAbsolute && discover === "render" ? "true" : void 0
|
|
452
453
|
}
|
|
453
454
|
)
|
|
454
455
|
);
|
|
455
|
-
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(
|
|
456
|
+
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(_chunkSA4DP3SFjs.PrefetchPageLinks, { page: href })) : link;
|
|
456
457
|
}
|
|
457
458
|
);
|
|
458
459
|
Link.displayName = "Link";
|
|
@@ -468,10 +469,10 @@ var NavLink = React.forwardRef(
|
|
|
468
469
|
children,
|
|
469
470
|
...rest
|
|
470
471
|
}, ref) {
|
|
471
|
-
let path =
|
|
472
|
-
let location =
|
|
473
|
-
let routerState = React.useContext(
|
|
474
|
-
let { navigator, basename } = React.useContext(
|
|
472
|
+
let path = _chunkSA4DP3SFjs.useResolvedPath.call(void 0, to, { relative: rest.relative });
|
|
473
|
+
let location = _chunkSA4DP3SFjs.useLocation.call(void 0, );
|
|
474
|
+
let routerState = React.useContext(_chunkSA4DP3SFjs.DataRouterStateContext);
|
|
475
|
+
let { navigator, basename } = React.useContext(_chunkSA4DP3SFjs.NavigationContext);
|
|
475
476
|
let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
|
|
476
477
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
477
478
|
useViewTransitionState(path) && viewTransition === true;
|
|
@@ -484,7 +485,7 @@ var NavLink = React.forwardRef(
|
|
|
484
485
|
toPathname = toPathname.toLowerCase();
|
|
485
486
|
}
|
|
486
487
|
if (nextLocationPathname && basename) {
|
|
487
|
-
nextLocationPathname =
|
|
488
|
+
nextLocationPathname = _chunkSA4DP3SFjs.stripBasename.call(void 0, nextLocationPathname, basename) || nextLocationPathname;
|
|
488
489
|
}
|
|
489
490
|
const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
|
|
490
491
|
let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
|
|
@@ -540,11 +541,11 @@ var Form = React.forwardRef(
|
|
|
540
541
|
defaultShouldRevalidate,
|
|
541
542
|
...props
|
|
542
543
|
}, forwardedRef) => {
|
|
543
|
-
let { useTransitions } = React.useContext(
|
|
544
|
+
let { useTransitions } = React.useContext(_chunkSA4DP3SFjs.NavigationContext);
|
|
544
545
|
let submit = useSubmit();
|
|
545
546
|
let formAction = useFormAction(action, { relative });
|
|
546
547
|
let formMethod = method.toLowerCase() === "get" ? "get" : "post";
|
|
547
|
-
let isAbsolute = typeof action === "string" && ABSOLUTE_URL_REGEX.test(action);
|
|
548
|
+
let isAbsolute = typeof action === "string" && _chunkSA4DP3SFjs.ABSOLUTE_URL_REGEX.test(action);
|
|
548
549
|
let submitHandler = (event) => {
|
|
549
550
|
onSubmit && onSubmit(event);
|
|
550
551
|
if (event.defaultPrevented) return;
|
|
@@ -587,10 +588,10 @@ function ScrollRestoration({
|
|
|
587
588
|
storageKey,
|
|
588
589
|
...props
|
|
589
590
|
}) {
|
|
590
|
-
let remixContext = React.useContext(
|
|
591
|
-
let { basename } = React.useContext(
|
|
592
|
-
let location =
|
|
593
|
-
let matches =
|
|
591
|
+
let remixContext = React.useContext(_chunkSA4DP3SFjs.FrameworkContext);
|
|
592
|
+
let { basename } = React.useContext(_chunkSA4DP3SFjs.NavigationContext);
|
|
593
|
+
let location = _chunkSA4DP3SFjs.useLocation.call(void 0, );
|
|
594
|
+
let matches = _chunkSA4DP3SFjs.useMatches.call(void 0, );
|
|
594
595
|
useScrollRestoration({ getKey, storageKey });
|
|
595
596
|
let ssrKey = React.useMemo(
|
|
596
597
|
() => {
|
|
@@ -626,15 +627,18 @@ function ScrollRestoration({
|
|
|
626
627
|
sessionStorage.removeItem(storageKey2);
|
|
627
628
|
}
|
|
628
629
|
}).toString();
|
|
630
|
+
if (props.nonce == null && _optionalChain([remixContext, 'optionalAccess', _23 => _23.nonce])) {
|
|
631
|
+
props.nonce = remixContext.nonce;
|
|
632
|
+
}
|
|
629
633
|
return /* @__PURE__ */ React.createElement(
|
|
630
634
|
"script",
|
|
631
635
|
{
|
|
632
636
|
...props,
|
|
633
637
|
suppressHydrationWarning: true,
|
|
634
638
|
dangerouslySetInnerHTML: {
|
|
635
|
-
__html: `(${restoreScroll})(${
|
|
639
|
+
__html: `(${restoreScroll})(${_chunkSA4DP3SFjs.escapeHtml.call(void 0,
|
|
636
640
|
JSON.stringify(storageKey || SCROLL_RESTORATION_STORAGE_KEY)
|
|
637
|
-
)}, ${
|
|
641
|
+
)}, ${_chunkSA4DP3SFjs.escapeHtml.call(void 0, JSON.stringify(ssrKey))})`
|
|
638
642
|
}
|
|
639
643
|
}
|
|
640
644
|
);
|
|
@@ -644,13 +648,13 @@ function getDataRouterConsoleError(hookName) {
|
|
|
644
648
|
return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
645
649
|
}
|
|
646
650
|
function useDataRouterContext(hookName) {
|
|
647
|
-
let ctx = React.useContext(
|
|
648
|
-
|
|
651
|
+
let ctx = React.useContext(_chunkSA4DP3SFjs.DataRouterContext);
|
|
652
|
+
_chunkSA4DP3SFjs.invariant.call(void 0, ctx, getDataRouterConsoleError(hookName));
|
|
649
653
|
return ctx;
|
|
650
654
|
}
|
|
651
655
|
function useDataRouterState(hookName) {
|
|
652
|
-
let state = React.useContext(
|
|
653
|
-
|
|
656
|
+
let state = React.useContext(_chunkSA4DP3SFjs.DataRouterStateContext);
|
|
657
|
+
_chunkSA4DP3SFjs.invariant.call(void 0, state, getDataRouterConsoleError(hookName));
|
|
654
658
|
return state;
|
|
655
659
|
}
|
|
656
660
|
function useLinkClickHandler(to, {
|
|
@@ -664,14 +668,14 @@ function useLinkClickHandler(to, {
|
|
|
664
668
|
defaultShouldRevalidate,
|
|
665
669
|
useTransitions
|
|
666
670
|
} = {}) {
|
|
667
|
-
let navigate =
|
|
668
|
-
let location =
|
|
669
|
-
let path =
|
|
671
|
+
let navigate = _chunkSA4DP3SFjs.useNavigate.call(void 0, );
|
|
672
|
+
let location = _chunkSA4DP3SFjs.useLocation.call(void 0, );
|
|
673
|
+
let path = _chunkSA4DP3SFjs.useResolvedPath.call(void 0, to, { relative });
|
|
670
674
|
return React.useCallback(
|
|
671
675
|
(event) => {
|
|
672
676
|
if (shouldProcessLinkClick(event, target)) {
|
|
673
677
|
event.preventDefault();
|
|
674
|
-
let replace = replaceProp !== void 0 ? replaceProp :
|
|
678
|
+
let replace = replaceProp !== void 0 ? replaceProp : _chunkSA4DP3SFjs.createPath.call(void 0, location) === _chunkSA4DP3SFjs.createPath.call(void 0, path);
|
|
675
679
|
let doNavigate = () => navigate(to, {
|
|
676
680
|
replace,
|
|
677
681
|
mask,
|
|
@@ -706,13 +710,13 @@ function useLinkClickHandler(to, {
|
|
|
706
710
|
);
|
|
707
711
|
}
|
|
708
712
|
function useSearchParams(defaultInit) {
|
|
709
|
-
|
|
713
|
+
_chunkSA4DP3SFjs.warning.call(void 0,
|
|
710
714
|
typeof URLSearchParams !== "undefined",
|
|
711
715
|
`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
716
|
);
|
|
713
717
|
let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));
|
|
714
718
|
let hasSetSearchParamsRef = React.useRef(false);
|
|
715
|
-
let location =
|
|
719
|
+
let location = _chunkSA4DP3SFjs.useLocation.call(void 0, );
|
|
716
720
|
let searchParams = React.useMemo(
|
|
717
721
|
() => (
|
|
718
722
|
// Only merge in the defaults if we haven't yet called setSearchParams.
|
|
@@ -725,7 +729,7 @@ function useSearchParams(defaultInit) {
|
|
|
725
729
|
),
|
|
726
730
|
[location.search]
|
|
727
731
|
);
|
|
728
|
-
let navigate =
|
|
732
|
+
let navigate = _chunkSA4DP3SFjs.useNavigate.call(void 0, );
|
|
729
733
|
let setSearchParams = React.useCallback(
|
|
730
734
|
(nextInit, navigateOptions) => {
|
|
731
735
|
const newSearchParams = createSearchParams(
|
|
@@ -742,8 +746,8 @@ var fetcherId = 0;
|
|
|
742
746
|
var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
|
|
743
747
|
function useSubmit() {
|
|
744
748
|
let { router } = useDataRouterContext("useSubmit" /* UseSubmit */);
|
|
745
|
-
let { basename } = React.useContext(
|
|
746
|
-
let currentRouteId =
|
|
749
|
+
let { basename } = React.useContext(_chunkSA4DP3SFjs.NavigationContext);
|
|
750
|
+
let currentRouteId = _chunkSA4DP3SFjs.useRouteId.call(void 0, );
|
|
747
751
|
let routerFetch = router.fetch;
|
|
748
752
|
let routerNavigate = router.navigate;
|
|
749
753
|
return React.useCallback(
|
|
@@ -783,12 +787,12 @@ function useSubmit() {
|
|
|
783
787
|
);
|
|
784
788
|
}
|
|
785
789
|
function useFormAction(action, { relative } = {}) {
|
|
786
|
-
let { basename } = React.useContext(
|
|
787
|
-
let routeContext = React.useContext(
|
|
788
|
-
|
|
790
|
+
let { basename } = React.useContext(_chunkSA4DP3SFjs.NavigationContext);
|
|
791
|
+
let routeContext = React.useContext(_chunkSA4DP3SFjs.RouteContext);
|
|
792
|
+
_chunkSA4DP3SFjs.invariant.call(void 0, routeContext, "useFormAction must be used inside a RouteContext");
|
|
789
793
|
let [match] = routeContext.matches.slice(-1);
|
|
790
|
-
let path = { ...
|
|
791
|
-
let location =
|
|
794
|
+
let path = { ..._chunkSA4DP3SFjs.useResolvedPath.call(void 0, action ? action : ".", { relative }) };
|
|
795
|
+
let location = _chunkSA4DP3SFjs.useLocation.call(void 0, );
|
|
792
796
|
if (action == null) {
|
|
793
797
|
path.search = location.search;
|
|
794
798
|
let params = new URLSearchParams(path.search);
|
|
@@ -805,21 +809,21 @@ function useFormAction(action, { relative } = {}) {
|
|
|
805
809
|
path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
|
|
806
810
|
}
|
|
807
811
|
if (basename !== "/") {
|
|
808
|
-
path.pathname = path.pathname === "/" ? basename :
|
|
812
|
+
path.pathname = path.pathname === "/" ? basename : _chunkSA4DP3SFjs.joinPaths.call(void 0, [basename, path.pathname]);
|
|
809
813
|
}
|
|
810
|
-
return
|
|
814
|
+
return _chunkSA4DP3SFjs.createPath.call(void 0, path);
|
|
811
815
|
}
|
|
812
816
|
function useFetcher({
|
|
813
817
|
key
|
|
814
818
|
} = {}) {
|
|
815
819
|
let { router } = useDataRouterContext("useFetcher" /* UseFetcher */);
|
|
816
820
|
let state = useDataRouterState("useFetcher" /* UseFetcher */);
|
|
817
|
-
let fetcherData = React.useContext(
|
|
818
|
-
let route = React.useContext(
|
|
819
|
-
let routeId = _optionalChain([route, 'access',
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
821
|
+
let fetcherData = React.useContext(_chunkSA4DP3SFjs.FetchersContext);
|
|
822
|
+
let route = React.useContext(_chunkSA4DP3SFjs.RouteContext);
|
|
823
|
+
let routeId = _optionalChain([route, 'access', _24 => _24.matches, 'access', _25 => _25[route.matches.length - 1], 'optionalAccess', _26 => _26.route, 'access', _27 => _27.id]);
|
|
824
|
+
_chunkSA4DP3SFjs.invariant.call(void 0, fetcherData, `useFetcher must be used inside a FetchersContext`);
|
|
825
|
+
_chunkSA4DP3SFjs.invariant.call(void 0, route, `useFetcher must be used inside a RouteContext`);
|
|
826
|
+
_chunkSA4DP3SFjs.invariant.call(void 0,
|
|
823
827
|
routeId != null,
|
|
824
828
|
`useFetcher can only be used on routes that contain a unique "id"`
|
|
825
829
|
);
|
|
@@ -835,7 +839,7 @@ function useFetcher({
|
|
|
835
839
|
}, [deleteFetcher, getFetcher, fetcherKey]);
|
|
836
840
|
let load = React.useCallback(
|
|
837
841
|
async (href, opts) => {
|
|
838
|
-
|
|
842
|
+
_chunkSA4DP3SFjs.invariant.call(void 0, routeId, "No routeId available for fetcher.load()");
|
|
839
843
|
await routerFetch(fetcherKey, routeId, href, opts);
|
|
840
844
|
},
|
|
841
845
|
[fetcherKey, routeId, routerFetch]
|
|
@@ -864,7 +868,7 @@ function useFetcher({
|
|
|
864
868
|
FetcherForm2.displayName = "fetcher.Form";
|
|
865
869
|
return FetcherForm2;
|
|
866
870
|
}, [fetcherKey]);
|
|
867
|
-
let fetcher = state.fetchers.get(fetcherKey) ||
|
|
871
|
+
let fetcher = state.fetchers.get(fetcherKey) || _chunkSA4DP3SFjs.IDLE_FETCHER;
|
|
868
872
|
let data = fetcherData.get(fetcherKey);
|
|
869
873
|
let fetcherWithComponents = React.useMemo(
|
|
870
874
|
() => ({
|
|
@@ -898,7 +902,7 @@ function getScrollRestorationKey(location, matches, basename, getKey) {
|
|
|
898
902
|
key = getKey(
|
|
899
903
|
{
|
|
900
904
|
...location,
|
|
901
|
-
pathname:
|
|
905
|
+
pathname: _chunkSA4DP3SFjs.stripBasename.call(void 0, location.pathname, basename) || location.pathname
|
|
902
906
|
},
|
|
903
907
|
matches
|
|
904
908
|
);
|
|
@@ -919,10 +923,10 @@ function useScrollRestoration({
|
|
|
919
923
|
let { restoreScrollPosition, preventScrollReset } = useDataRouterState(
|
|
920
924
|
"useScrollRestoration" /* UseScrollRestoration */
|
|
921
925
|
);
|
|
922
|
-
let { basename } = React.useContext(
|
|
923
|
-
let location =
|
|
924
|
-
let matches =
|
|
925
|
-
let navigation =
|
|
926
|
+
let { basename } = React.useContext(_chunkSA4DP3SFjs.NavigationContext);
|
|
927
|
+
let location = _chunkSA4DP3SFjs.useLocation.call(void 0, );
|
|
928
|
+
let matches = _chunkSA4DP3SFjs.useMatches.call(void 0, );
|
|
929
|
+
let navigation = _chunkSA4DP3SFjs.useNavigation.call(void 0, );
|
|
926
930
|
React.useEffect(() => {
|
|
927
931
|
window.history.scrollRestoration = "manual";
|
|
928
932
|
return () => {
|
|
@@ -941,7 +945,7 @@ function useScrollRestoration({
|
|
|
941
945
|
JSON.stringify(savedScrollPositions)
|
|
942
946
|
);
|
|
943
947
|
} catch (error) {
|
|
944
|
-
|
|
948
|
+
_chunkSA4DP3SFjs.warning.call(void 0,
|
|
945
949
|
false,
|
|
946
950
|
`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${error}).`
|
|
947
951
|
);
|
|
@@ -962,7 +966,7 @@ function useScrollRestoration({
|
|
|
962
966
|
}
|
|
963
967
|
}, [storageKey]);
|
|
964
968
|
React.useLayoutEffect(() => {
|
|
965
|
-
let disableScrollRestoration = _optionalChain([router, 'optionalAccess',
|
|
969
|
+
let disableScrollRestoration = _optionalChain([router, 'optionalAccess', _28 => _28.enableScrollRestoration, 'call', _29 => _29(
|
|
966
970
|
savedScrollPositions,
|
|
967
971
|
() => window.scrollY,
|
|
968
972
|
getKey ? (location2, matches2) => getScrollRestorationKey(location2, matches2, basename, getKey) : void 0
|
|
@@ -988,7 +992,7 @@ function useScrollRestoration({
|
|
|
988
992
|
}
|
|
989
993
|
}
|
|
990
994
|
} catch (e2) {
|
|
991
|
-
|
|
995
|
+
_chunkSA4DP3SFjs.warning.call(void 0,
|
|
992
996
|
false,
|
|
993
997
|
`"${location.hash.slice(
|
|
994
998
|
1
|
|
@@ -1026,7 +1030,7 @@ function usePrompt({
|
|
|
1026
1030
|
when,
|
|
1027
1031
|
message
|
|
1028
1032
|
}) {
|
|
1029
|
-
let blocker =
|
|
1033
|
+
let blocker = _chunkSA4DP3SFjs.useBlocker.call(void 0, when);
|
|
1030
1034
|
React.useEffect(() => {
|
|
1031
1035
|
if (blocker.state === "blocked") {
|
|
1032
1036
|
let proceed = window.confirm(message);
|
|
@@ -1044,21 +1048,21 @@ function usePrompt({
|
|
|
1044
1048
|
}, [blocker, when]);
|
|
1045
1049
|
}
|
|
1046
1050
|
function useViewTransitionState(to, { relative } = {}) {
|
|
1047
|
-
let vtContext = React.useContext(
|
|
1048
|
-
|
|
1051
|
+
let vtContext = React.useContext(_chunkSA4DP3SFjs.ViewTransitionContext);
|
|
1052
|
+
_chunkSA4DP3SFjs.invariant.call(void 0,
|
|
1049
1053
|
vtContext != null,
|
|
1050
1054
|
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1051
1055
|
);
|
|
1052
1056
|
let { basename } = useDataRouterContext(
|
|
1053
1057
|
"useViewTransitionState" /* useViewTransitionState */
|
|
1054
1058
|
);
|
|
1055
|
-
let path =
|
|
1059
|
+
let path = _chunkSA4DP3SFjs.useResolvedPath.call(void 0, to, { relative });
|
|
1056
1060
|
if (!vtContext.isTransitioning) {
|
|
1057
1061
|
return false;
|
|
1058
1062
|
}
|
|
1059
|
-
let currentPath =
|
|
1060
|
-
let nextPath =
|
|
1061
|
-
return
|
|
1063
|
+
let currentPath = _chunkSA4DP3SFjs.stripBasename.call(void 0, vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
|
|
1064
|
+
let nextPath = _chunkSA4DP3SFjs.stripBasename.call(void 0, vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
|
|
1065
|
+
return _chunkSA4DP3SFjs.matchPath.call(void 0, path.pathname, nextPath) != null || _chunkSA4DP3SFjs.matchPath.call(void 0, path.pathname, currentPath) != null;
|
|
1062
1066
|
}
|
|
1063
1067
|
|
|
1064
1068
|
// lib/dom/server.tsx
|
|
@@ -1069,7 +1073,7 @@ function StaticRouter({
|
|
|
1069
1073
|
location: locationProp = "/"
|
|
1070
1074
|
}) {
|
|
1071
1075
|
if (typeof locationProp === "string") {
|
|
1072
|
-
locationProp =
|
|
1076
|
+
locationProp = _chunkSA4DP3SFjs.parsePath.call(void 0, locationProp);
|
|
1073
1077
|
}
|
|
1074
1078
|
let action = "POP" /* Pop */;
|
|
1075
1079
|
let location = {
|
|
@@ -1082,7 +1086,7 @@ function StaticRouter({
|
|
|
1082
1086
|
};
|
|
1083
1087
|
let staticNavigator = getStatelessNavigator();
|
|
1084
1088
|
return /* @__PURE__ */ React2.createElement(
|
|
1085
|
-
|
|
1089
|
+
_chunkSA4DP3SFjs.Router,
|
|
1086
1090
|
{
|
|
1087
1091
|
basename,
|
|
1088
1092
|
children,
|
|
@@ -1100,7 +1104,7 @@ function StaticRouterProvider({
|
|
|
1100
1104
|
hydrate = true,
|
|
1101
1105
|
nonce
|
|
1102
1106
|
}) {
|
|
1103
|
-
|
|
1107
|
+
_chunkSA4DP3SFjs.invariant.call(void 0,
|
|
1104
1108
|
router && context,
|
|
1105
1109
|
"You must provide `router` and `context` to <StaticRouterProvider>"
|
|
1106
1110
|
);
|
|
@@ -1119,12 +1123,12 @@ function StaticRouterProvider({
|
|
|
1119
1123
|
actionData: context.actionData,
|
|
1120
1124
|
errors: serializeErrors(context.errors)
|
|
1121
1125
|
};
|
|
1122
|
-
let json =
|
|
1126
|
+
let json = _chunkSA4DP3SFjs.escapeHtml.call(void 0, JSON.stringify(JSON.stringify(data)));
|
|
1123
1127
|
hydrateScript = `window.__staticRouterHydrationData = JSON.parse(${json});`;
|
|
1124
1128
|
}
|
|
1125
1129
|
let { state } = dataRouterContext.router;
|
|
1126
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
|
1127
|
-
|
|
1130
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(_chunkSA4DP3SFjs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React2.createElement(_chunkSA4DP3SFjs.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React2.createElement(_chunkSA4DP3SFjs.FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ React2.createElement(_chunkSA4DP3SFjs.ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ React2.createElement(
|
|
1131
|
+
_chunkSA4DP3SFjs.Router,
|
|
1128
1132
|
{
|
|
1129
1133
|
basename: dataRouterContext.basename,
|
|
1130
1134
|
location: state.location,
|
|
@@ -1134,7 +1138,7 @@ function StaticRouterProvider({
|
|
|
1134
1138
|
useTransitions: false
|
|
1135
1139
|
},
|
|
1136
1140
|
/* @__PURE__ */ React2.createElement(
|
|
1137
|
-
|
|
1141
|
+
_chunkSA4DP3SFjs.DataRoutes,
|
|
1138
1142
|
{
|
|
1139
1143
|
manifest: router.manifest,
|
|
1140
1144
|
routes: router.routes,
|
|
@@ -1157,7 +1161,7 @@ function serializeErrors(errors) {
|
|
|
1157
1161
|
let entries = Object.entries(errors);
|
|
1158
1162
|
let serialized = {};
|
|
1159
1163
|
for (let [key, val] of entries) {
|
|
1160
|
-
if (
|
|
1164
|
+
if (_chunkSA4DP3SFjs.isRouteErrorResponse.call(void 0, val)) {
|
|
1161
1165
|
serialized[key] = { ...val, __type: "RouteErrorResponse" };
|
|
1162
1166
|
} else if (val instanceof Error) {
|
|
1163
1167
|
serialized[key] = {
|
|
@@ -1207,16 +1211,16 @@ function getStatelessNavigator() {
|
|
|
1207
1211
|
};
|
|
1208
1212
|
}
|
|
1209
1213
|
function createStaticHandler2(routes, opts) {
|
|
1210
|
-
return
|
|
1214
|
+
return _chunkSA4DP3SFjs.createStaticHandler.call(void 0, routes, {
|
|
1211
1215
|
...opts,
|
|
1212
|
-
mapRouteProperties:
|
|
1216
|
+
mapRouteProperties: _chunkSA4DP3SFjs.mapRouteProperties
|
|
1213
1217
|
});
|
|
1214
1218
|
}
|
|
1215
1219
|
function createStaticRouter(routes, context, opts = {}) {
|
|
1216
1220
|
let manifest = {};
|
|
1217
|
-
let dataRoutes =
|
|
1221
|
+
let dataRoutes = _chunkSA4DP3SFjs.convertRoutesToDataRoutes.call(void 0,
|
|
1218
1222
|
routes,
|
|
1219
|
-
|
|
1223
|
+
_chunkSA4DP3SFjs.mapRouteProperties,
|
|
1220
1224
|
void 0,
|
|
1221
1225
|
manifest
|
|
1222
1226
|
);
|
|
@@ -1237,7 +1241,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1237
1241
|
v8_middleware: false,
|
|
1238
1242
|
v8_passThroughRequests: false,
|
|
1239
1243
|
v8_trailingSlashAwareDataRequests: false,
|
|
1240
|
-
..._optionalChain([opts, 'optionalAccess',
|
|
1244
|
+
..._optionalChain([opts, 'optionalAccess', _30 => _30.future])
|
|
1241
1245
|
};
|
|
1242
1246
|
},
|
|
1243
1247
|
get state() {
|
|
@@ -1250,7 +1254,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1250
1254
|
errors: context.errors,
|
|
1251
1255
|
initialized: true,
|
|
1252
1256
|
renderFallback: false,
|
|
1253
|
-
navigation:
|
|
1257
|
+
navigation: _chunkSA4DP3SFjs.IDLE_NAVIGATION,
|
|
1254
1258
|
restoreScrollPosition: null,
|
|
1255
1259
|
preventScrollReset: false,
|
|
1256
1260
|
revalidation: "idle",
|
|
@@ -1291,7 +1295,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1291
1295
|
createHref,
|
|
1292
1296
|
encodeLocation,
|
|
1293
1297
|
getFetcher() {
|
|
1294
|
-
return
|
|
1298
|
+
return _chunkSA4DP3SFjs.IDLE_FETCHER;
|
|
1295
1299
|
},
|
|
1296
1300
|
deleteFetcher() {
|
|
1297
1301
|
throw msg("deleteFetcher");
|
|
@@ -1303,7 +1307,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1303
1307
|
throw msg("dispose");
|
|
1304
1308
|
},
|
|
1305
1309
|
getBlocker() {
|
|
1306
|
-
return
|
|
1310
|
+
return _chunkSA4DP3SFjs.IDLE_BLOCKER;
|
|
1307
1311
|
},
|
|
1308
1312
|
deleteBlocker() {
|
|
1309
1313
|
throw msg("deleteBlocker");
|
|
@@ -1321,19 +1325,18 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1321
1325
|
};
|
|
1322
1326
|
}
|
|
1323
1327
|
function createHref(to) {
|
|
1324
|
-
return typeof to === "string" ? to :
|
|
1328
|
+
return typeof to === "string" ? to : _chunkSA4DP3SFjs.createPath.call(void 0, to);
|
|
1325
1329
|
}
|
|
1326
1330
|
function encodeLocation(to) {
|
|
1327
|
-
let href = typeof to === "string" ? to :
|
|
1331
|
+
let href = typeof to === "string" ? to : _chunkSA4DP3SFjs.createPath.call(void 0, to);
|
|
1328
1332
|
href = href.replace(/ $/, "%20");
|
|
1329
|
-
let encoded =
|
|
1333
|
+
let encoded = _chunkSA4DP3SFjs.ABSOLUTE_URL_REGEX.test(href) ? new URL(href) : new URL(href, "http://localhost");
|
|
1330
1334
|
return {
|
|
1331
1335
|
pathname: encoded.pathname,
|
|
1332
1336
|
search: encoded.search,
|
|
1333
1337
|
hash: encoded.hash
|
|
1334
1338
|
};
|
|
1335
1339
|
}
|
|
1336
|
-
var ABSOLUTE_URL_REGEX2 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
1337
1340
|
|
|
1338
1341
|
|
|
1339
1342
|
|