react-router 7.18.5 → 7.18.7
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 +28 -0
- package/dist/development/{browser-7x6a6gQP.d.ts → browser-QWJf_b8Q.d.ts} +2 -2
- package/dist/development/{browser-CiGxXXOl.d.mts → browser-yuOIt-hO.d.mts} +2 -2
- package/dist/development/{chunk-NDF5KBLP.js → chunk-6VUODQWR.js} +109 -104
- package/dist/development/{chunk-2ZBLYC7V.js → chunk-EYW3HBBI.js} +116 -66
- package/dist/development/{chunk-IFHLIXZW.js → chunk-FLL7MJ4N.js} +7 -7
- package/dist/development/{chunk-JAHXRPFV.mjs → chunk-IXMWVLYF.mjs} +14 -5
- package/dist/development/{chunk-6KYCQHYJ.mjs → chunk-Z7SQORRT.mjs} +118 -64
- package/dist/{production/context-BlYKn1tE.d.mts → development/context-BbKau8k8.d.mts} +1 -1
- package/dist/development/{data-DEjBmEfD.d.mts → data-BfpvlkTw.d.mts} +2 -0
- package/dist/{production/data-CjO11-hU.d.ts → development/data-DNyB6ouY.d.ts} +2 -0
- package/dist/development/dom-export.d.mts +3 -3
- package/dist/development/dom-export.d.ts +3 -3
- package/dist/development/dom-export.js +38 -36
- package/dist/development/dom-export.mjs +7 -5
- package/dist/development/{index-react-server-client-KK-TR-t7.d.mts → index-react-server-client-DF1LPF_n.d.mts} +2 -2
- package/dist/{production/index-react-server-client-BaaZU3sM.d.ts → development/index-react-server-client-DxC4rwQS.d.ts} +2 -2
- 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.js +130 -59
- package/dist/development/index-react-server.mjs +130 -59
- package/dist/development/index.d.mts +11 -11
- package/dist/development/index.d.ts +11 -11
- package/dist/development/index.js +111 -102
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-CPkMwccd.d.ts → development/instrumentation-z0GQ7yJ2.d.ts} +1 -1
- 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-CmkRspdl.d.mts → register-B8pHflrz.d.mts} +1 -1
- package/dist/development/{register-roq_0qYo.d.ts → register-Dnr_kGGI.d.ts} +1 -1
- package/dist/production/{browser-7x6a6gQP.d.ts → browser-QWJf_b8Q.d.ts} +2 -2
- package/dist/production/{browser-CiGxXXOl.d.mts → browser-yuOIt-hO.d.mts} +2 -2
- package/dist/production/{chunk-75HN637G.js → chunk-6AFDAMLF.js} +109 -104
- package/dist/production/{chunk-IAM5GYT3.mjs → chunk-D2GT6IUW.mjs} +14 -5
- package/dist/production/{chunk-HNBICOIU.js → chunk-JAAIXHP6.js} +116 -66
- package/dist/production/{chunk-7RTFRKQW.mjs → chunk-OCNYVWSN.mjs} +118 -64
- package/dist/production/{chunk-K3NA4NUH.js → chunk-RFC7P4DG.js} +7 -7
- package/dist/{development/context-BlYKn1tE.d.mts → production/context-BbKau8k8.d.mts} +1 -1
- package/dist/production/{data-DEjBmEfD.d.mts → data-BfpvlkTw.d.mts} +2 -0
- package/dist/{development/data-CjO11-hU.d.ts → production/data-DNyB6ouY.d.ts} +2 -0
- package/dist/production/dom-export.d.mts +3 -3
- package/dist/production/dom-export.d.ts +3 -3
- package/dist/production/dom-export.js +38 -36
- package/dist/production/dom-export.mjs +7 -5
- package/dist/production/{index-react-server-client-KK-TR-t7.d.mts → index-react-server-client-DF1LPF_n.d.mts} +2 -2
- package/dist/{development/index-react-server-client-BaaZU3sM.d.ts → production/index-react-server-client-DxC4rwQS.d.ts} +2 -2
- 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.js +130 -59
- package/dist/production/index-react-server.mjs +130 -59
- package/dist/production/index.d.mts +11 -11
- package/dist/production/index.d.ts +11 -11
- package/dist/production/index.js +111 -102
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-CPkMwccd.d.ts → production/instrumentation-z0GQ7yJ2.d.ts} +1 -1
- 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-CmkRspdl.d.mts → register-B8pHflrz.d.mts} +1 -1
- package/dist/production/{register-roq_0qYo.d.ts → register-Dnr_kGGI.d.ts} +1 -1
- package/package.json +5 -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 _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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.18.
|
|
2
|
+
* react-router v7.18.7
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -386,6 +386,67 @@ function createBrowserURLImpl(windowImpl, to, isAbsolute = false) {
|
|
|
386
386
|
return new URL(href, base);
|
|
387
387
|
}
|
|
388
388
|
|
|
389
|
+
// lib/router/navigation.ts
|
|
390
|
+
var DEFAULT_NAVIGATION_URL = new URL("http://localhost");
|
|
391
|
+
function getNavigatorCurrentUrl(navigator) {
|
|
392
|
+
if (navigator.createURL) {
|
|
393
|
+
return navigator.createURL("/");
|
|
394
|
+
}
|
|
395
|
+
try {
|
|
396
|
+
return new URL(navigator.createHref("/"), DEFAULT_NAVIGATION_URL);
|
|
397
|
+
} catch (e2) {
|
|
398
|
+
return DEFAULT_NAVIGATION_URL;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function isSameOrigin(a, b) {
|
|
402
|
+
return a.origin === b.origin && (a.origin !== "null" || a.protocol === b.protocol && a.host === b.host);
|
|
403
|
+
}
|
|
404
|
+
function isExplicitUrl(destination, target) {
|
|
405
|
+
if (destination.startsWith("//")) {
|
|
406
|
+
return true;
|
|
407
|
+
}
|
|
408
|
+
let protocol = target.protocol.toLowerCase();
|
|
409
|
+
if (!destination.toLowerCase().startsWith(protocol)) {
|
|
410
|
+
return false;
|
|
411
|
+
}
|
|
412
|
+
return target.host === "" || destination.slice(protocol.length).startsWith("//");
|
|
413
|
+
}
|
|
414
|
+
function validateDocumentNavigationTarget(destination) {
|
|
415
|
+
let normalized = destination.replace(/[\t\n\r]/g, "");
|
|
416
|
+
let start = 0;
|
|
417
|
+
while (normalized.charCodeAt(start) <= 32) start++;
|
|
418
|
+
normalized = normalized.slice(start);
|
|
419
|
+
if (!ABSOLUTE_URL_REGEX.test(normalized)) return;
|
|
420
|
+
let target;
|
|
421
|
+
try {
|
|
422
|
+
target = new URL(destination, DEFAULT_NAVIGATION_URL);
|
|
423
|
+
} catch (e3) {
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
if (!isExplicitUrl(destination, target)) {
|
|
427
|
+
throw new Error("External navigation is not allowed");
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
function validateNavigationTarget(original, resolved, currentUrl, externalPolicy) {
|
|
431
|
+
let originalUrl = null;
|
|
432
|
+
try {
|
|
433
|
+
originalUrl = original == null ? null : new URL(original, currentUrl);
|
|
434
|
+
} catch (e4) {
|
|
435
|
+
}
|
|
436
|
+
let resolvedUrl = new URL(resolved, currentUrl);
|
|
437
|
+
let originalIsExternal = originalUrl != null && !isSameOrigin(originalUrl, currentUrl);
|
|
438
|
+
let resolvedIsExternal = !isSameOrigin(resolvedUrl, currentUrl);
|
|
439
|
+
if (externalPolicy === "reject") {
|
|
440
|
+
if (originalIsExternal || resolvedIsExternal) {
|
|
441
|
+
throw new Error("External navigation is not allowed");
|
|
442
|
+
}
|
|
443
|
+
} else if (resolvedIsExternal) {
|
|
444
|
+
if (originalUrl == null || !isExplicitUrl(original, originalUrl) || !isSameOrigin(originalUrl, resolvedUrl)) {
|
|
445
|
+
throw new Error("External navigation is not allowed");
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
389
450
|
// lib/router/utils.ts
|
|
390
451
|
function createContext(defaultValue) {
|
|
391
452
|
return { defaultValue };
|
|
@@ -767,14 +828,29 @@ function generatePath(originalPath, params = {}) {
|
|
|
767
828
|
}
|
|
768
829
|
return segment.replace(/\?$/g, "");
|
|
769
830
|
}).filter((segment) => !!segment);
|
|
770
|
-
|
|
831
|
+
let result = (prefix + segments.join("/")).replace(/^[\\/]{2,}/, "/");
|
|
832
|
+
if (!prefix && (path.startsWith(":") || path === "*")) {
|
|
833
|
+
result = result.replace(/^([a-z][a-z0-9+.-]*):/i, "$1%3A");
|
|
834
|
+
}
|
|
835
|
+
validateDocumentNavigationTarget(result);
|
|
836
|
+
return result;
|
|
771
837
|
}
|
|
838
|
+
var MAX_OPTIONAL_PATH_SEGMENTS = 12;
|
|
772
839
|
function matchPath(pattern, pathname) {
|
|
773
840
|
if (typeof pattern === "string") {
|
|
774
841
|
pattern = { path: pattern, caseSensitive: false, end: true };
|
|
775
842
|
}
|
|
843
|
+
let { path } = pattern;
|
|
844
|
+
let optionalSegments = 0;
|
|
845
|
+
for (let index = path.indexOf("?"); index !== -1; index = path.indexOf("?", index + 1)) {
|
|
846
|
+
if (++optionalSegments > MAX_OPTIONAL_PATH_SEGMENTS) {
|
|
847
|
+
throw new Error(
|
|
848
|
+
`Path pattern ${JSON.stringify(path)} exceeds the limit of ${MAX_OPTIONAL_PATH_SEGMENTS} optional segments.`
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
776
852
|
let [matcher, compiledParams] = compilePath(
|
|
777
|
-
|
|
853
|
+
path,
|
|
778
854
|
pattern.caseSensitive,
|
|
779
855
|
pattern.end
|
|
780
856
|
);
|
|
@@ -995,6 +1071,7 @@ function data(data2, init) {
|
|
|
995
1071
|
);
|
|
996
1072
|
}
|
|
997
1073
|
var redirect = (url, init = 302) => {
|
|
1074
|
+
validateDocumentNavigationTarget(url);
|
|
998
1075
|
let responseInit = init;
|
|
999
1076
|
if (typeof responseInit === "number") {
|
|
1000
1077
|
responseInit = { status: responseInit };
|
|
@@ -1350,51 +1427,6 @@ function isPlainObject(thing) {
|
|
|
1350
1427
|
return proto === Object.prototype || proto === null || Object.getOwnPropertyNames(proto).sort().join("\0") === objectProtoNames;
|
|
1351
1428
|
}
|
|
1352
1429
|
|
|
1353
|
-
// lib/router/navigation.ts
|
|
1354
|
-
var DEFAULT_NAVIGATION_URL = new URL("http://localhost");
|
|
1355
|
-
function getNavigatorCurrentUrl(navigator) {
|
|
1356
|
-
if (navigator.createURL) {
|
|
1357
|
-
return navigator.createURL("/");
|
|
1358
|
-
}
|
|
1359
|
-
try {
|
|
1360
|
-
return new URL(navigator.createHref("/"), DEFAULT_NAVIGATION_URL);
|
|
1361
|
-
} catch (e2) {
|
|
1362
|
-
return DEFAULT_NAVIGATION_URL;
|
|
1363
|
-
}
|
|
1364
|
-
}
|
|
1365
|
-
function isSameOrigin(a, b) {
|
|
1366
|
-
return a.origin === b.origin && (a.origin !== "null" || a.protocol === b.protocol && a.host === b.host);
|
|
1367
|
-
}
|
|
1368
|
-
function isExplicitUrl(destination, target) {
|
|
1369
|
-
if (destination.startsWith("//")) {
|
|
1370
|
-
return true;
|
|
1371
|
-
}
|
|
1372
|
-
let protocol = target.protocol.toLowerCase();
|
|
1373
|
-
if (!destination.toLowerCase().startsWith(protocol)) {
|
|
1374
|
-
return false;
|
|
1375
|
-
}
|
|
1376
|
-
return target.host === "" || destination.slice(protocol.length).startsWith("//");
|
|
1377
|
-
}
|
|
1378
|
-
function validateNavigationTarget(original, resolved, currentUrl, externalPolicy) {
|
|
1379
|
-
let originalUrl = null;
|
|
1380
|
-
try {
|
|
1381
|
-
originalUrl = original == null ? null : new URL(original, currentUrl);
|
|
1382
|
-
} catch (e3) {
|
|
1383
|
-
}
|
|
1384
|
-
let resolvedUrl = new URL(resolved, currentUrl);
|
|
1385
|
-
let originalIsExternal = originalUrl != null && !isSameOrigin(originalUrl, currentUrl);
|
|
1386
|
-
let resolvedIsExternal = !isSameOrigin(resolvedUrl, currentUrl);
|
|
1387
|
-
if (externalPolicy === "reject") {
|
|
1388
|
-
if (originalIsExternal || resolvedIsExternal) {
|
|
1389
|
-
throw new Error("External navigation is not allowed");
|
|
1390
|
-
}
|
|
1391
|
-
} else if (resolvedIsExternal) {
|
|
1392
|
-
if (originalUrl == null || !isExplicitUrl(original, originalUrl) || !isSameOrigin(originalUrl, resolvedUrl)) {
|
|
1393
|
-
throw new Error("External navigation is not allowed");
|
|
1394
|
-
}
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
1430
|
// lib/router/router.ts
|
|
1399
1431
|
var validMutationMethodsArr = [
|
|
1400
1432
|
"POST",
|
|
@@ -2527,6 +2559,12 @@ function createRouter(init) {
|
|
|
2527
2559
|
routeId,
|
|
2528
2560
|
_optionalChain([opts, 'optionalAccess', _23 => _23.relative])
|
|
2529
2561
|
);
|
|
2562
|
+
validateNavigationTarget(
|
|
2563
|
+
null,
|
|
2564
|
+
normalizedPath,
|
|
2565
|
+
init.history.createURL("/"),
|
|
2566
|
+
"reject"
|
|
2567
|
+
);
|
|
2530
2568
|
let matches = matchRoutesImpl(
|
|
2531
2569
|
routesToUse,
|
|
2532
2570
|
normalizedPath,
|
|
@@ -5297,6 +5335,12 @@ function normalizeRelativeRoutingRedirectResponse(response, request, routeId, ma
|
|
|
5297
5335
|
location,
|
|
5298
5336
|
"Redirects returned/thrown from loaders/actions must have a Location header"
|
|
5299
5337
|
);
|
|
5338
|
+
validateNavigationTarget(
|
|
5339
|
+
location,
|
|
5340
|
+
location,
|
|
5341
|
+
new URL(request.url),
|
|
5342
|
+
"allow-explicit"
|
|
5343
|
+
);
|
|
5300
5344
|
if (!isAbsoluteUrl(location)) {
|
|
5301
5345
|
let trimmedMatches = matches.slice(
|
|
5302
5346
|
0,
|
|
@@ -5328,7 +5372,7 @@ var invalidProtocols = [
|
|
|
5328
5372
|
function hasInvalidProtocol(location) {
|
|
5329
5373
|
try {
|
|
5330
5374
|
return invalidProtocols.includes(new URL(location).protocol);
|
|
5331
|
-
} catch (
|
|
5375
|
+
} catch (e5) {
|
|
5332
5376
|
return false;
|
|
5333
5377
|
}
|
|
5334
5378
|
}
|
|
@@ -6449,20 +6493,22 @@ function encode(input, options) {
|
|
|
6449
6493
|
};
|
|
6450
6494
|
const textEncoder = new TextEncoder();
|
|
6451
6495
|
let lastSentIndex = 0;
|
|
6496
|
+
let cancelled = false;
|
|
6452
6497
|
const readable = new ReadableStream({
|
|
6453
6498
|
async start(controller) {
|
|
6499
|
+
const enqueue = (chunk) => {
|
|
6500
|
+
if (!cancelled) controller.enqueue(chunk);
|
|
6501
|
+
};
|
|
6454
6502
|
const id = await flatten.call(encoder, input);
|
|
6455
6503
|
if (Array.isArray(id)) {
|
|
6456
6504
|
throw new Error("This should never happen");
|
|
6457
6505
|
}
|
|
6458
6506
|
if (id < 0) {
|
|
6459
|
-
|
|
6507
|
+
enqueue(textEncoder.encode(`${id}
|
|
6460
6508
|
`));
|
|
6461
6509
|
} else {
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
`)
|
|
6465
|
-
);
|
|
6510
|
+
enqueue(textEncoder.encode(`[${encoder.stringified.join(",")}]
|
|
6511
|
+
`));
|
|
6466
6512
|
lastSentIndex = encoder.stringified.length - 1;
|
|
6467
6513
|
}
|
|
6468
6514
|
const seenPromises = /* @__PURE__ */ new WeakSet();
|
|
@@ -6497,7 +6543,7 @@ function encode(input, options) {
|
|
|
6497
6543
|
processingChain = processingChain.then(async () => {
|
|
6498
6544
|
const id2 = await flatten.call(encoder, resolved);
|
|
6499
6545
|
if (Array.isArray(id2)) {
|
|
6500
|
-
|
|
6546
|
+
enqueue(
|
|
6501
6547
|
textEncoder.encode(
|
|
6502
6548
|
`${TYPE_PROMISE}${deferredId}:[["${TYPE_PREVIOUS_RESOLVED}",${id2[0]}]]
|
|
6503
6549
|
`
|
|
@@ -6506,7 +6552,7 @@ function encode(input, options) {
|
|
|
6506
6552
|
encoder.index++;
|
|
6507
6553
|
lastSentIndex++;
|
|
6508
6554
|
} else if (id2 < 0) {
|
|
6509
|
-
|
|
6555
|
+
enqueue(
|
|
6510
6556
|
textEncoder.encode(
|
|
6511
6557
|
`${TYPE_PROMISE}${deferredId}:${id2}
|
|
6512
6558
|
`
|
|
@@ -6514,7 +6560,7 @@ function encode(input, options) {
|
|
|
6514
6560
|
);
|
|
6515
6561
|
} else {
|
|
6516
6562
|
const values = encoder.stringified.slice(lastSentIndex + 1).join(",");
|
|
6517
|
-
|
|
6563
|
+
enqueue(
|
|
6518
6564
|
textEncoder.encode(
|
|
6519
6565
|
`${TYPE_PROMISE}${deferredId}:[${values}]
|
|
6520
6566
|
`
|
|
@@ -6532,7 +6578,7 @@ function encode(input, options) {
|
|
|
6532
6578
|
}
|
|
6533
6579
|
const id2 = await flatten.call(encoder, reason);
|
|
6534
6580
|
if (Array.isArray(id2)) {
|
|
6535
|
-
|
|
6581
|
+
enqueue(
|
|
6536
6582
|
textEncoder.encode(
|
|
6537
6583
|
`${TYPE_ERROR}${deferredId}:[["${TYPE_PREVIOUS_RESOLVED}",${id2[0]}]]
|
|
6538
6584
|
`
|
|
@@ -6541,7 +6587,7 @@ function encode(input, options) {
|
|
|
6541
6587
|
encoder.index++;
|
|
6542
6588
|
lastSentIndex++;
|
|
6543
6589
|
} else if (id2 < 0) {
|
|
6544
|
-
|
|
6590
|
+
enqueue(
|
|
6545
6591
|
textEncoder.encode(
|
|
6546
6592
|
`${TYPE_ERROR}${deferredId}:${id2}
|
|
6547
6593
|
`
|
|
@@ -6549,7 +6595,7 @@ function encode(input, options) {
|
|
|
6549
6595
|
);
|
|
6550
6596
|
} else {
|
|
6551
6597
|
const values = encoder.stringified.slice(lastSentIndex + 1).join(",");
|
|
6552
|
-
|
|
6598
|
+
enqueue(
|
|
6553
6599
|
textEncoder.encode(
|
|
6554
6600
|
`${TYPE_ERROR}${deferredId}:[${values}]
|
|
6555
6601
|
`
|
|
@@ -6571,8 +6617,11 @@ function encode(input, options) {
|
|
|
6571
6617
|
}
|
|
6572
6618
|
await Promise.all(Object.values(encoder.deferred));
|
|
6573
6619
|
await processingChain;
|
|
6574
|
-
controller.close();
|
|
6620
|
+
if (!cancelled) controller.close();
|
|
6575
6621
|
_optionalChain([onComplete, 'optionalCall', _82 => _82()]);
|
|
6622
|
+
},
|
|
6623
|
+
cancel() {
|
|
6624
|
+
cancelled = true;
|
|
6576
6625
|
}
|
|
6577
6626
|
});
|
|
6578
6627
|
return readable;
|
|
@@ -7185,7 +7234,7 @@ function decodeRedirectErrorDigest(digest) {
|
|
|
7185
7234
|
if (typeof parsed === "object" && parsed && typeof parsed.status === "number" && typeof parsed.statusText === "string" && typeof parsed.location === "string" && typeof parsed.reloadDocument === "boolean" && typeof parsed.replace === "boolean") {
|
|
7186
7235
|
return parsed;
|
|
7187
7236
|
}
|
|
7188
|
-
} catch (
|
|
7237
|
+
} catch (e6) {
|
|
7189
7238
|
}
|
|
7190
7239
|
}
|
|
7191
7240
|
}
|
|
@@ -7202,7 +7251,7 @@ function decodeRouteErrorResponseDigest(digest) {
|
|
|
7202
7251
|
parsed.data
|
|
7203
7252
|
);
|
|
7204
7253
|
}
|
|
7205
|
-
} catch (
|
|
7254
|
+
} catch (e7) {
|
|
7206
7255
|
}
|
|
7207
7256
|
}
|
|
7208
7257
|
}
|
|
@@ -8804,7 +8853,7 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
|
|
|
8804
8853
|
return;
|
|
8805
8854
|
}
|
|
8806
8855
|
sessionStorage.setItem(MANIFEST_VERSION_STORAGE_KEY, manifest.version);
|
|
8807
|
-
} catch (
|
|
8856
|
+
} catch (e8) {
|
|
8808
8857
|
}
|
|
8809
8858
|
window.location.href = errorReloadPath;
|
|
8810
8859
|
console.warn("Detected manifest version mismatch, reloading...");
|
|
@@ -8815,7 +8864,7 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
|
|
|
8815
8864
|
}
|
|
8816
8865
|
try {
|
|
8817
8866
|
sessionStorage.removeItem(MANIFEST_VERSION_STORAGE_KEY);
|
|
8818
|
-
} catch (
|
|
8867
|
+
} catch (e9) {
|
|
8819
8868
|
}
|
|
8820
8869
|
serverPatches = await res.json();
|
|
8821
8870
|
} catch (e) {
|
|
@@ -10434,4 +10483,5 @@ function withErrorBoundaryProps(ErrorBoundary) {
|
|
|
10434
10483
|
|
|
10435
10484
|
|
|
10436
10485
|
|
|
10437
|
-
|
|
10486
|
+
|
|
10487
|
+
exports.ABSOLUTE_URL_REGEX = ABSOLUTE_URL_REGEX; exports.PROTOCOL_RELATIVE_URL_REGEX = PROTOCOL_RELATIVE_URL_REGEX; exports.Action = Action; exports.createMemoryHistory = createMemoryHistory; exports.createBrowserHistory = createBrowserHistory; exports.createHashHistory = createHashHistory; exports.invariant = invariant; exports.warning = warning; exports.createPath = createPath; exports.parsePath = parsePath; exports.validateDocumentNavigationTarget = validateDocumentNavigationTarget; exports.validateNavigationTarget = validateNavigationTarget; exports.createContext = createContext; exports.RouterContextProvider = RouterContextProvider; exports.convertRoutesToDataRoutes = convertRoutesToDataRoutes; exports.matchRoutes = matchRoutes; exports.matchRoutesImpl = matchRoutesImpl; exports.generatePath = generatePath; exports.matchPath = matchPath; exports.stripBasename = stripBasename; exports.resolvePath = resolvePath; exports.resolveTo = resolveTo; exports.joinPaths = joinPaths; exports.data = data; exports.redirect = redirect; exports.redirectDocument = redirectDocument; exports.replace = replace; exports.SUPPORTED_ERROR_TYPES = SUPPORTED_ERROR_TYPES; exports.ErrorResponseImpl = ErrorResponseImpl; exports.isRouteErrorResponse = isRouteErrorResponse; exports.parseToInfo = parseToInfo; exports.escapeHtml = escapeHtml; exports.escapeAttribute = escapeAttribute; exports.encode = encode; exports.instrumentHandler = instrumentHandler; exports.IDLE_NAVIGATION = IDLE_NAVIGATION; exports.IDLE_FETCHER = IDLE_FETCHER; exports.IDLE_BLOCKER = IDLE_BLOCKER; exports.createRouter = createRouter; exports.createStaticHandler = createStaticHandler; exports.getStaticContextFromError = getStaticContextFromError; exports.hasInvalidProtocol = hasInvalidProtocol; exports.isDataWithResponseInit = isDataWithResponseInit; exports.isResponse = isResponse; exports.isRedirectStatusCode = isRedirectStatusCode; exports.isRedirectResponse = isRedirectResponse; exports.isMutationMethod = isMutationMethod; exports.createRequestInit = createRequestInit; exports.SingleFetchRedirectSymbol = SingleFetchRedirectSymbol; exports.SINGLE_FETCH_REDIRECT_STATUS = SINGLE_FETCH_REDIRECT_STATUS; exports.NO_BODY_STATUS_CODES = NO_BODY_STATUS_CODES; exports.StreamTransfer = StreamTransfer; exports.getTurboStreamSingleFetchDataStrategy = getTurboStreamSingleFetchDataStrategy; exports.getSingleFetchDataStrategyImpl = getSingleFetchDataStrategyImpl; exports.stripIndexParam = stripIndexParam; exports.singleFetchUrl = singleFetchUrl; exports.decodeViaTurboStream = decodeViaTurboStream; exports.DataRouterContext = DataRouterContext; exports.DataRouterStateContext = DataRouterStateContext; exports.RSCRouterContext = RSCRouterContext; exports.ViewTransitionContext = ViewTransitionContext; exports.FetchersContext = FetchersContext; exports.AwaitContextProvider = AwaitContextProvider; exports.NavigationContext = NavigationContext; exports.LocationContext = LocationContext; exports.RouteContext = RouteContext; exports.ENABLE_DEV_WARNINGS = ENABLE_DEV_WARNINGS; exports.warnOnce = warnOnce; exports.decodeRedirectErrorDigest = decodeRedirectErrorDigest; exports.decodeRouteErrorResponseDigest = decodeRouteErrorResponseDigest; exports.useHref = useHref; exports.useInRouterContext = useInRouterContext; exports.useLocation = useLocation; exports.useNavigationType = useNavigationType; exports.useMatch = useMatch; exports.useNavigate = useNavigate; exports.useOutletContext = useOutletContext; exports.useOutlet = useOutlet; exports.useParams = useParams; exports.useResolvedPath = useResolvedPath; exports.useRoutes = useRoutes; exports.useRouteId = useRouteId; exports.useNavigation = useNavigation; exports.useRevalidator = useRevalidator; exports.useMatches = useMatches; exports.useLoaderData = useLoaderData; exports.useRouteLoaderData = useRouteLoaderData; exports.useActionData = useActionData; exports.useRouteError = useRouteError; exports.useAsyncValue = useAsyncValue; exports.useAsyncError = useAsyncError; exports.useBlocker = useBlocker; exports.useRoute = useRoute; exports.useRouterState = useRouterState; exports.RemixErrorBoundary = RemixErrorBoundary; exports.createServerRoutes = createServerRoutes; exports.createClientRoutesWithHMRRevalidationOptOut = createClientRoutesWithHMRRevalidationOptOut; exports.noActionDefinedError = noActionDefinedError; exports.createClientRoutes = createClientRoutes; exports.shouldHydrateRouteLoader = shouldHydrateRouteLoader; exports.URL_LIMIT = URL_LIMIT; exports.getPathsWithAncestors = getPathsWithAncestors; exports.isFogOfWarEnabled = isFogOfWarEnabled; exports.shouldUseInitialRouteDiscovery = shouldUseInitialRouteDiscovery; exports.getPatchRoutesOnNavigationFunction = getPatchRoutesOnNavigationFunction; exports.useFogOFWarDiscovery = useFogOFWarDiscovery; exports.getManifestPath = getManifestPath; exports.FrameworkContext = FrameworkContext; exports.usePrefetchBehavior = usePrefetchBehavior; exports.CRITICAL_CSS_DATA_ATTRIBUTE = CRITICAL_CSS_DATA_ATTRIBUTE; exports.Links = Links; exports.PrefetchPageLinks = PrefetchPageLinks; exports.Meta = Meta; exports.setIsHydrated = setIsHydrated; exports.Scripts = Scripts; exports.mergeRefs = mergeRefs; exports.mapRouteProperties = mapRouteProperties; exports.hydrationRouteProperties = hydrationRouteProperties; exports.createMemoryRouter = createMemoryRouter; exports.RouterProvider = RouterProvider; exports.DataRoutes = DataRoutes2; exports.MemoryRouter = MemoryRouter; exports.Navigate = Navigate; exports.Outlet = Outlet; exports.Route = Route; exports.Router = Router; exports.Routes = Routes; exports.Await = Await; exports.createRoutesFromChildren = createRoutesFromChildren; exports.createRoutesFromElements = createRoutesFromElements; exports.renderMatches = renderMatches; exports.WithComponentProps = WithComponentProps; exports.withComponentProps = withComponentProps; exports.WithHydrateFallbackProps = WithHydrateFallbackProps; exports.withHydrateFallbackProps = withHydrateFallbackProps; exports.WithErrorBoundaryProps = WithErrorBoundaryProps; exports.withErrorBoundaryProps = withErrorBoundaryProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/**
|
|
2
|
-
* react-router v7.18.
|
|
2
|
+
* react-router v7.18.7
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkEYW3HBBIjs = require('./chunk-EYW3HBBI.js');
|
|
18
18
|
|
|
19
19
|
// lib/dom/ssr/hydration.tsx
|
|
20
20
|
function getHydrationData({
|
|
@@ -29,12 +29,12 @@ function getHydrationData({
|
|
|
29
29
|
...state,
|
|
30
30
|
loaderData: { ...state.loaderData }
|
|
31
31
|
};
|
|
32
|
-
let initialMatches =
|
|
32
|
+
let initialMatches = _chunkEYW3HBBIjs.matchRoutes.call(void 0, routes, location, basename);
|
|
33
33
|
if (initialMatches) {
|
|
34
34
|
for (let match of initialMatches) {
|
|
35
35
|
let routeId = match.route.id;
|
|
36
36
|
let routeInfo = getRouteInfo(routeId);
|
|
37
|
-
if (
|
|
37
|
+
if (_chunkEYW3HBBIjs.shouldHydrateRouteLoader.call(void 0,
|
|
38
38
|
routeId,
|
|
39
39
|
routeInfo.clientLoader,
|
|
40
40
|
routeInfo.hasLoader,
|
|
@@ -112,7 +112,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
);
|
|
115
|
-
if (
|
|
115
|
+
if (_chunkEYW3HBBIjs.isRouteErrorResponse.call(void 0, error)) {
|
|
116
116
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
117
117
|
ErrorWrapper,
|
|
118
118
|
{
|
|
@@ -120,7 +120,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
120
120
|
title: "Unhandled Thrown Response!"
|
|
121
121
|
},
|
|
122
122
|
/* @__PURE__ */ _react2.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
|
|
123
|
-
|
|
123
|
+
_chunkEYW3HBBIjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
let errorInstance;
|
|
@@ -146,7 +146,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
146
146
|
function RSCDefaultRootErrorBoundary({
|
|
147
147
|
hasRootLayout
|
|
148
148
|
}) {
|
|
149
|
-
let error =
|
|
149
|
+
let error = _chunkEYW3HBBIjs.useRouteError.call(void 0, );
|
|
150
150
|
if (hasRootLayout === void 0) {
|
|
151
151
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
152
152
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.18.
|
|
2
|
+
* react-router v7.18.7
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -54,11 +54,12 @@ import {
|
|
|
54
54
|
shouldUseInitialRouteDiscovery,
|
|
55
55
|
stripBasename,
|
|
56
56
|
useRouteError,
|
|
57
|
+
validateDocumentNavigationTarget,
|
|
57
58
|
warnOnce,
|
|
58
59
|
withComponentProps,
|
|
59
60
|
withErrorBoundaryProps,
|
|
60
61
|
withHydrateFallbackProps
|
|
61
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-Z7SQORRT.mjs";
|
|
62
63
|
|
|
63
64
|
// lib/dom/ssr/server.tsx
|
|
64
65
|
import * as React from "react";
|
|
@@ -887,7 +888,9 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
887
888
|
return handleQueryError(error);
|
|
888
889
|
}
|
|
889
890
|
} : void 0,
|
|
890
|
-
|
|
891
|
+
// Normalize the original request because handlerRequest may already have
|
|
892
|
+
// its .data suffix removed when v8_passThroughRequests is disabled.
|
|
893
|
+
normalizePath: () => getNormalizedPath(request, build.basename, build.future)
|
|
891
894
|
});
|
|
892
895
|
return handleQueryResult(result);
|
|
893
896
|
} catch (error) {
|
|
@@ -952,7 +955,9 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
952
955
|
return handleQueryError(error);
|
|
953
956
|
}
|
|
954
957
|
} : void 0,
|
|
955
|
-
|
|
958
|
+
// Normalize the original request because handlerRequest may already have
|
|
959
|
+
// its .data suffix removed when v8_passThroughRequests is disabled.
|
|
960
|
+
normalizePath: () => getNormalizedPath(request, build.basename, build.future)
|
|
956
961
|
});
|
|
957
962
|
return handleQueryResult(result);
|
|
958
963
|
} catch (error) {
|
|
@@ -1307,6 +1312,8 @@ function derive(build, mode) {
|
|
|
1307
1312
|
);
|
|
1308
1313
|
}
|
|
1309
1314
|
if (request.method === "HEAD") {
|
|
1315
|
+
response.body?.cancel().catch(() => {
|
|
1316
|
+
});
|
|
1310
1317
|
return new Response(null, {
|
|
1311
1318
|
headers: response.headers,
|
|
1312
1319
|
status: response.status,
|
|
@@ -1819,7 +1826,9 @@ function href(path, ...args) {
|
|
|
1819
1826
|
result += "/" + value;
|
|
1820
1827
|
}
|
|
1821
1828
|
}
|
|
1822
|
-
|
|
1829
|
+
result = result.replace(/^[\\/]{2,}/, "/") || "/";
|
|
1830
|
+
validateDocumentNavigationTarget(result);
|
|
1831
|
+
return result;
|
|
1823
1832
|
}
|
|
1824
1833
|
function trimTrailingSplat(path) {
|
|
1825
1834
|
let i = path.length - 1;
|