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
|
/**
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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
|
opts?.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,
|
|
@@ -8126,20 +8170,22 @@ function encode(input, options) {
|
|
|
8126
8170
|
};
|
|
8127
8171
|
const textEncoder = new TextEncoder();
|
|
8128
8172
|
let lastSentIndex = 0;
|
|
8173
|
+
let cancelled = false;
|
|
8129
8174
|
const readable = new ReadableStream({
|
|
8130
8175
|
async start(controller) {
|
|
8176
|
+
const enqueue = (chunk) => {
|
|
8177
|
+
if (!cancelled) controller.enqueue(chunk);
|
|
8178
|
+
};
|
|
8131
8179
|
const id = await flatten.call(encoder, input);
|
|
8132
8180
|
if (Array.isArray(id)) {
|
|
8133
8181
|
throw new Error("This should never happen");
|
|
8134
8182
|
}
|
|
8135
8183
|
if (id < 0) {
|
|
8136
|
-
|
|
8184
|
+
enqueue(textEncoder.encode(`${id}
|
|
8137
8185
|
`));
|
|
8138
8186
|
} else {
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
`)
|
|
8142
|
-
);
|
|
8187
|
+
enqueue(textEncoder.encode(`[${encoder.stringified.join(",")}]
|
|
8188
|
+
`));
|
|
8143
8189
|
lastSentIndex = encoder.stringified.length - 1;
|
|
8144
8190
|
}
|
|
8145
8191
|
const seenPromises = /* @__PURE__ */ new WeakSet();
|
|
@@ -8174,7 +8220,7 @@ function encode(input, options) {
|
|
|
8174
8220
|
processingChain = processingChain.then(async () => {
|
|
8175
8221
|
const id2 = await flatten.call(encoder, resolved);
|
|
8176
8222
|
if (Array.isArray(id2)) {
|
|
8177
|
-
|
|
8223
|
+
enqueue(
|
|
8178
8224
|
textEncoder.encode(
|
|
8179
8225
|
`${TYPE_PROMISE}${deferredId}:[["${TYPE_PREVIOUS_RESOLVED}",${id2[0]}]]
|
|
8180
8226
|
`
|
|
@@ -8183,7 +8229,7 @@ function encode(input, options) {
|
|
|
8183
8229
|
encoder.index++;
|
|
8184
8230
|
lastSentIndex++;
|
|
8185
8231
|
} else if (id2 < 0) {
|
|
8186
|
-
|
|
8232
|
+
enqueue(
|
|
8187
8233
|
textEncoder.encode(
|
|
8188
8234
|
`${TYPE_PROMISE}${deferredId}:${id2}
|
|
8189
8235
|
`
|
|
@@ -8191,7 +8237,7 @@ function encode(input, options) {
|
|
|
8191
8237
|
);
|
|
8192
8238
|
} else {
|
|
8193
8239
|
const values = encoder.stringified.slice(lastSentIndex + 1).join(",");
|
|
8194
|
-
|
|
8240
|
+
enqueue(
|
|
8195
8241
|
textEncoder.encode(
|
|
8196
8242
|
`${TYPE_PROMISE}${deferredId}:[${values}]
|
|
8197
8243
|
`
|
|
@@ -8209,7 +8255,7 @@ function encode(input, options) {
|
|
|
8209
8255
|
}
|
|
8210
8256
|
const id2 = await flatten.call(encoder, reason);
|
|
8211
8257
|
if (Array.isArray(id2)) {
|
|
8212
|
-
|
|
8258
|
+
enqueue(
|
|
8213
8259
|
textEncoder.encode(
|
|
8214
8260
|
`${TYPE_ERROR}${deferredId}:[["${TYPE_PREVIOUS_RESOLVED}",${id2[0]}]]
|
|
8215
8261
|
`
|
|
@@ -8218,7 +8264,7 @@ function encode(input, options) {
|
|
|
8218
8264
|
encoder.index++;
|
|
8219
8265
|
lastSentIndex++;
|
|
8220
8266
|
} else if (id2 < 0) {
|
|
8221
|
-
|
|
8267
|
+
enqueue(
|
|
8222
8268
|
textEncoder.encode(
|
|
8223
8269
|
`${TYPE_ERROR}${deferredId}:${id2}
|
|
8224
8270
|
`
|
|
@@ -8226,7 +8272,7 @@ function encode(input, options) {
|
|
|
8226
8272
|
);
|
|
8227
8273
|
} else {
|
|
8228
8274
|
const values = encoder.stringified.slice(lastSentIndex + 1).join(",");
|
|
8229
|
-
|
|
8275
|
+
enqueue(
|
|
8230
8276
|
textEncoder.encode(
|
|
8231
8277
|
`${TYPE_ERROR}${deferredId}:[${values}]
|
|
8232
8278
|
`
|
|
@@ -8248,8 +8294,11 @@ function encode(input, options) {
|
|
|
8248
8294
|
}
|
|
8249
8295
|
await Promise.all(Object.values(encoder.deferred));
|
|
8250
8296
|
await processingChain;
|
|
8251
|
-
controller.close();
|
|
8297
|
+
if (!cancelled) controller.close();
|
|
8252
8298
|
onComplete?.();
|
|
8299
|
+
},
|
|
8300
|
+
cancel() {
|
|
8301
|
+
cancelled = true;
|
|
8253
8302
|
}
|
|
8254
8303
|
});
|
|
8255
8304
|
return readable;
|
|
@@ -10433,7 +10482,7 @@ var isBrowser2 = typeof window !== "undefined" && typeof window.document !== "un
|
|
|
10433
10482
|
try {
|
|
10434
10483
|
if (isBrowser2) {
|
|
10435
10484
|
window.__reactRouterVersion = // @ts-expect-error
|
|
10436
|
-
"7.18.
|
|
10485
|
+
"7.18.7";
|
|
10437
10486
|
}
|
|
10438
10487
|
} catch (e) {
|
|
10439
10488
|
}
|
|
@@ -10682,6 +10731,8 @@ var Link = React10.forwardRef(
|
|
|
10682
10731
|
}
|
|
10683
10732
|
}
|
|
10684
10733
|
let isSpaLink = !(parsed.isExternal || reloadDocument);
|
|
10734
|
+
let renderedHref = (isSpaLink ? maskedHref : void 0) || parsed.absoluteURL || href;
|
|
10735
|
+
validateDocumentNavigationTarget(renderedHref);
|
|
10685
10736
|
let link = (
|
|
10686
10737
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
10687
10738
|
/* @__PURE__ */ React10.createElement(
|
|
@@ -10689,7 +10740,7 @@ var Link = React10.forwardRef(
|
|
|
10689
10740
|
{
|
|
10690
10741
|
...rest,
|
|
10691
10742
|
...prefetchHandlers,
|
|
10692
|
-
href:
|
|
10743
|
+
href: renderedHref,
|
|
10693
10744
|
onClick: isSpaLink ? handleClick : onClick,
|
|
10694
10745
|
ref: mergeRefs(forwardedRef, prefetchRef),
|
|
10695
10746
|
target,
|
|
@@ -11055,7 +11106,9 @@ function useFormAction(action, { relative } = {}) {
|
|
|
11055
11106
|
if (basename !== "/") {
|
|
11056
11107
|
path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
|
|
11057
11108
|
}
|
|
11058
|
-
|
|
11109
|
+
let formAction = createPath(path);
|
|
11110
|
+
validateDocumentNavigationTarget(formAction);
|
|
11111
|
+
return formAction;
|
|
11059
11112
|
}
|
|
11060
11113
|
function useFetcher({
|
|
11061
11114
|
key
|
|
@@ -11591,6 +11644,8 @@ export {
|
|
|
11591
11644
|
invariant,
|
|
11592
11645
|
createPath,
|
|
11593
11646
|
parsePath,
|
|
11647
|
+
validateDocumentNavigationTarget,
|
|
11648
|
+
validateNavigationTarget,
|
|
11594
11649
|
createContext,
|
|
11595
11650
|
RouterContextProvider,
|
|
11596
11651
|
convertRoutesToDataRoutes,
|
|
@@ -11607,7 +11662,6 @@ export {
|
|
|
11607
11662
|
ErrorResponseImpl,
|
|
11608
11663
|
isRouteErrorResponse,
|
|
11609
11664
|
instrumentHandler,
|
|
11610
|
-
validateNavigationTarget,
|
|
11611
11665
|
IDLE_NAVIGATION,
|
|
11612
11666
|
IDLE_FETCHER,
|
|
11613
11667
|
IDLE_BLOCKER,
|
|
@@ -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 _chunkJAAIXHP6js = require('./chunk-JAAIXHP6.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 = _chunkJAAIXHP6js.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 (_chunkJAAIXHP6js.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 (_chunkJAAIXHP6js.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
|
+
_chunkJAAIXHP6js.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 = _chunkJAAIXHP6js.useRouteError.call(void 0, );
|
|
150
150
|
if (hasRootLayout === void 0) {
|
|
151
151
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
152
152
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as HTMLFormMethod, n as FormEncType, o as LoaderFunctionArgs, p as MiddlewareEnabled, c as RouterContextProvider, q as AppLoadContext, r as RouteObject, s as History, t as MaybePromise, u as MapRoutePropertiesFunction, v as Action, L as Location, w as DataRouteMatch, x as Submission, y as RouteData, z as DataStrategyFunction, B as PatchRoutesOnNavigationFunction, E as DataRouteObject, I as RouteBranch, J as RouteManifest, U as UIMatch, T as To, K as Path, P as Params, O as InitialEntry, Q as NonIndexRouteObject, V as LazyRouteFunction, W as IndexRouteObject, X as RouteMatch, Y as TrackedPromise } from './data-
|
|
1
|
+
import { m as HTMLFormMethod, n as FormEncType, o as LoaderFunctionArgs, p as MiddlewareEnabled, c as RouterContextProvider, q as AppLoadContext, r as RouteObject, s as History, t as MaybePromise, u as MapRoutePropertiesFunction, v as Action, L as Location, w as DataRouteMatch, x as Submission, y as RouteData, z as DataStrategyFunction, B as PatchRoutesOnNavigationFunction, E as DataRouteObject, I as RouteBranch, J as RouteManifest, U as UIMatch, T as To, K as Path, P as Params, O as InitialEntry, Q as NonIndexRouteObject, V as LazyRouteFunction, W as IndexRouteObject, X as RouteMatch, Y as TrackedPromise } from './data-BfpvlkTw.mjs';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
type ServerInstrumentation = {
|
|
@@ -1036,6 +1036,8 @@ interface PathMatch<ParamKey extends string = string> {
|
|
|
1036
1036
|
* Performs pattern matching on a URL pathname and returns information about
|
|
1037
1037
|
* the match.
|
|
1038
1038
|
*
|
|
1039
|
+
* Throws if the pattern contains more than 12 optional (`?`) markers.
|
|
1040
|
+
*
|
|
1039
1041
|
* @public
|
|
1040
1042
|
* @category Utils
|
|
1041
1043
|
* @param pattern The pattern to match against the URL pathname. This can be a
|
|
@@ -1036,6 +1036,8 @@ interface PathMatch<ParamKey extends string = string> {
|
|
|
1036
1036
|
* Performs pattern matching on a URL pathname and returns information about
|
|
1037
1037
|
* the match.
|
|
1038
1038
|
*
|
|
1039
|
+
* Throws if the pattern contains more than 12 optional (`?`) markers.
|
|
1040
|
+
*
|
|
1039
1041
|
* @public
|
|
1040
1042
|
* @category Utils
|
|
1041
1043
|
* @param pattern The pattern to match against the URL pathname. This can be a
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { a as RouterProviderProps$1, R as RouterInit, C as ClientInstrumentation, b as ClientOnErrorFunction } from './context-
|
|
3
|
-
export { D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, R as unstable_RSCHydratedRouter, d as unstable_RSCManifestPayload, e as unstable_RSCPayload, f as unstable_RSCRenderPayload, c as unstable_createCallServer } from './browser-
|
|
4
|
-
import './data-
|
|
2
|
+
import { a as RouterProviderProps$1, R as RouterInit, C as ClientInstrumentation, b as ClientOnErrorFunction } from './context-BbKau8k8.mjs';
|
|
3
|
+
export { D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, R as unstable_RSCHydratedRouter, d as unstable_RSCManifestPayload, e as unstable_RSCPayload, f as unstable_RSCRenderPayload, c as unstable_createCallServer } from './browser-yuOIt-hO.mjs';
|
|
4
|
+
import './data-BfpvlkTw.mjs';
|
|
5
5
|
|
|
6
6
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
7
7
|
declare function RouterProvider(props: RouterProviderProps): React.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { RouterProviderProps as RouterProviderProps$1, RouterInit, ClientOnErrorFunction } from 'react-router';
|
|
3
|
-
import { C as ClientInstrumentation } from './instrumentation-
|
|
4
|
-
export { D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, R as unstable_RSCHydratedRouter, d as unstable_RSCManifestPayload, e as unstable_RSCPayload, f as unstable_RSCRenderPayload, c as unstable_createCallServer } from './browser-
|
|
5
|
-
import './data-
|
|
3
|
+
import { C as ClientInstrumentation } from './instrumentation-z0GQ7yJ2.js';
|
|
4
|
+
export { D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, R as unstable_RSCHydratedRouter, d as unstable_RSCManifestPayload, e as unstable_RSCPayload, f as unstable_RSCRenderPayload, c as unstable_createCallServer } from './browser-QWJf_b8Q.js';
|
|
5
|
+
import './data-DNyB6ouY.js';
|
|
6
6
|
|
|
7
7
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
8
8
|
declare function RouterProvider(props: RouterProviderProps): React.JSX.Element;
|