react-router 7.18.2 → 7.18.4
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 +15 -0
- package/dist/development/{browser-DBmQ1yAR.d.mts → browser-BR5QG7ZC.d.mts} +1 -1
- package/dist/development/{browser-B2PdsXXH.d.ts → browser-eq4RgLsD.d.ts} +1 -1
- package/dist/development/{chunk-HHGH3NKS.js → chunk-GR4NQCSD.js} +122 -19
- package/dist/development/{chunk-ZA36QIGN.mjs → chunk-H4DAEOV7.mjs} +16 -8
- package/dist/development/{chunk-7XGYIT3M.js → chunk-HQO5H5CC.js} +103 -103
- package/dist/{production/chunk-VJZ67BZE.js → development/chunk-LVPI3KDG.js} +7 -7
- package/dist/development/{chunk-62JRHF6Z.mjs → chunk-OB3PAWPO.mjs} +117 -14
- package/dist/{production/context-CeD5LmaF.d.mts → development/context-nqAapj74.d.mts} +9 -0
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.d.ts +2 -2
- package/dist/development/dom-export.js +45 -32
- package/dist/development/dom-export.mjs +17 -4
- package/dist/{production/index-react-server-client-3ykjivgQ.d.ts → development/index-react-server-client-BjY-eKuf.d.ts} +2 -1
- package/dist/{production/index-react-server-client-CACgcj2J.d.mts → development/index-react-server-client-K63fpMH4.d.mts} +1 -1
- package/dist/development/index-react-server-client.d.mts +2 -2
- package/dist/development/index-react-server-client.d.ts +2 -2
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.d.mts +8 -0
- package/dist/development/index-react-server.d.ts +8 -0
- package/dist/development/index-react-server.js +25 -9
- package/dist/development/index-react-server.mjs +25 -9
- package/dist/development/index.d.mts +6 -6
- package/dist/development/index.d.ts +6 -6
- package/dist/development/index.js +102 -94
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-Dkmpzd13.d.ts → development/instrumentation-B7w3_Eo9.d.ts} +8 -0
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/production/{browser-DBmQ1yAR.d.mts → browser-BR5QG7ZC.d.mts} +1 -1
- package/dist/production/{browser-B2PdsXXH.d.ts → browser-eq4RgLsD.d.ts} +1 -1
- package/dist/production/{chunk-FDTIF24W.js → chunk-AOOKMWND.js} +103 -103
- package/dist/production/{chunk-SJTG3J2Q.mjs → chunk-G2MPF4YY.mjs} +16 -8
- package/dist/production/{chunk-YBLPXYCV.mjs → chunk-Q34X6AWR.mjs} +117 -14
- package/dist/{development/chunk-3UVS743K.js → production/chunk-QURBR4FZ.js} +7 -7
- package/dist/production/{chunk-TP6EHSSF.js → chunk-YNGRUB6F.js} +122 -19
- package/dist/{development/context-CeD5LmaF.d.mts → production/context-nqAapj74.d.mts} +9 -0
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.d.ts +2 -2
- package/dist/production/dom-export.js +45 -32
- package/dist/production/dom-export.mjs +17 -4
- package/dist/{development/index-react-server-client-3ykjivgQ.d.ts → production/index-react-server-client-BjY-eKuf.d.ts} +2 -1
- package/dist/{development/index-react-server-client-CACgcj2J.d.mts → production/index-react-server-client-K63fpMH4.d.mts} +1 -1
- package/dist/production/index-react-server-client.d.mts +2 -2
- package/dist/production/index-react-server-client.d.ts +2 -2
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.d.mts +8 -0
- package/dist/production/index-react-server.d.ts +8 -0
- package/dist/production/index-react-server.js +25 -9
- package/dist/production/index-react-server.mjs +25 -9
- package/dist/production/index.d.mts +6 -6
- package/dist/production/index.d.ts +6 -6
- package/dist/production/index.js +102 -94
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-Dkmpzd13.d.ts → production/instrumentation-B7w3_Eo9.d.ts} +8 -0
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- 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 _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.4
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -784,13 +784,16 @@ function matchPathImpl(pattern, pathname, matcher, compiledParams) {
|
|
|
784
784
|
let match = pathname.match(matcher);
|
|
785
785
|
if (!match) return null;
|
|
786
786
|
let matchedPathname = match[0];
|
|
787
|
-
let pathnameBase = matchedPathname
|
|
787
|
+
let pathnameBase = removeTrailingSlash(matchedPathname, 1);
|
|
788
788
|
let captureGroups = match.slice(1);
|
|
789
789
|
let params = compiledParams.reduce(
|
|
790
790
|
(memo2, { paramName, isOptional }, index) => {
|
|
791
791
|
if (paramName === "*") {
|
|
792
792
|
let splatValue = captureGroups[index] || "";
|
|
793
|
-
pathnameBase =
|
|
793
|
+
pathnameBase = removeTrailingSlash(
|
|
794
|
+
matchedPathname.slice(0, matchedPathname.length - splatValue.length),
|
|
795
|
+
1
|
|
796
|
+
);
|
|
794
797
|
}
|
|
795
798
|
const value = captureGroups[index];
|
|
796
799
|
if (isOptional && !value) {
|
|
@@ -880,7 +883,7 @@ function resolvePath(to, fromPathname = "/") {
|
|
|
880
883
|
let pathname;
|
|
881
884
|
if (toPathname) {
|
|
882
885
|
toPathname = removeDoubleSlashes(toPathname);
|
|
883
|
-
if (toPathname.startsWith("/")) {
|
|
886
|
+
if (toPathname.startsWith("/") || toPathname.startsWith("\\")) {
|
|
884
887
|
pathname = resolvePathname(toPathname.substring(1), "/");
|
|
885
888
|
} else {
|
|
886
889
|
pathname = resolvePathname(toPathname, fromPathname);
|
|
@@ -968,7 +971,13 @@ function resolveTo(toArg, routePathnames, locationPathname, isPathRelative = fal
|
|
|
968
971
|
}
|
|
969
972
|
var removeDoubleSlashes = (path) => path.replace(/[\\/]{2,}/g, "/");
|
|
970
973
|
var joinPaths = (paths) => removeDoubleSlashes(paths.join("/"));
|
|
971
|
-
|
|
974
|
+
function removeTrailingSlash(path, minLength = 0) {
|
|
975
|
+
let end = path.length;
|
|
976
|
+
while (end > minLength && path.charCodeAt(end - 1) === 47) {
|
|
977
|
+
end--;
|
|
978
|
+
}
|
|
979
|
+
return end === path.length ? path : path.slice(0, end);
|
|
980
|
+
}
|
|
972
981
|
var normalizePathname = (pathname) => removeTrailingSlash(pathname).replace(/^\/*/, "/");
|
|
973
982
|
var normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
|
|
974
983
|
var normalizeHash = (hash) => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash;
|
|
@@ -1341,6 +1350,51 @@ function isPlainObject(thing) {
|
|
|
1341
1350
|
return proto === Object.prototype || proto === null || Object.getOwnPropertyNames(proto).sort().join("\0") === objectProtoNames;
|
|
1342
1351
|
}
|
|
1343
1352
|
|
|
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
|
+
|
|
1344
1398
|
// lib/router/router.ts
|
|
1345
1399
|
var validMutationMethodsArr = [
|
|
1346
1400
|
"POST",
|
|
@@ -1764,7 +1818,7 @@ function createRouter(init) {
|
|
|
1764
1818
|
init.history.replace(location, location.state);
|
|
1765
1819
|
}
|
|
1766
1820
|
let viewTransitionOpts;
|
|
1767
|
-
if (pendingAction === "POP" /* Pop */) {
|
|
1821
|
+
if (pendingAction === "POP" /* Pop */ && !isUninterruptedRevalidation && location !== state.location) {
|
|
1768
1822
|
let priorPaths = appliedViewTransitions.get(state.location.pathname);
|
|
1769
1823
|
if (priorPaths && priorPaths.has(location.pathname)) {
|
|
1770
1824
|
viewTransitionOpts = {
|
|
@@ -1852,11 +1906,21 @@ function createRouter(init) {
|
|
|
1852
1906
|
...opts.mask
|
|
1853
1907
|
};
|
|
1854
1908
|
maskPath = {
|
|
1855
|
-
pathname: "",
|
|
1856
|
-
search: "",
|
|
1857
|
-
hash: ""
|
|
1858
|
-
...partialPath
|
|
1909
|
+
pathname: _nullishCoalesce(partialPath.pathname, () => ( "")),
|
|
1910
|
+
search: _nullishCoalesce(partialPath.search, () => ( "")),
|
|
1911
|
+
hash: _nullishCoalesce(partialPath.hash, () => ( ""))
|
|
1859
1912
|
};
|
|
1913
|
+
if (PROTOCOL_RELATIVE_URL_REGEX.test(maskPath.pathname)) {
|
|
1914
|
+
throw new Error("External navigation is not allowed");
|
|
1915
|
+
} else if (maskPath.pathname.startsWith("\\")) {
|
|
1916
|
+
maskPath.pathname = maskPath.pathname.replace(/^\\+/, "/");
|
|
1917
|
+
}
|
|
1918
|
+
validateNavigationTarget(
|
|
1919
|
+
typeof opts.mask === "string" ? opts.mask : createPath(opts.mask),
|
|
1920
|
+
createPath(maskPath),
|
|
1921
|
+
init.history.createURL("/"),
|
|
1922
|
+
"reject"
|
|
1923
|
+
);
|
|
1860
1924
|
}
|
|
1861
1925
|
let currentLocation = state.location;
|
|
1862
1926
|
let nextLocation = createLocation(
|
|
@@ -1870,6 +1934,12 @@ function createRouter(init) {
|
|
|
1870
1934
|
...nextLocation,
|
|
1871
1935
|
...init.history.encodeLocation(nextLocation)
|
|
1872
1936
|
};
|
|
1937
|
+
validateNavigationTarget(
|
|
1938
|
+
to == null ? init.history.createHref(state.location) : typeof to === "string" ? to : createPath(to),
|
|
1939
|
+
init.history.createHref(nextLocation.mask || nextLocation),
|
|
1940
|
+
init.history.createURL("/"),
|
|
1941
|
+
"reject"
|
|
1942
|
+
);
|
|
1873
1943
|
let userReplace = opts && opts.replace != null ? opts.replace : void 0;
|
|
1874
1944
|
let historyAction = "PUSH" /* Push */;
|
|
1875
1945
|
if (userReplace === true) {
|
|
@@ -2880,12 +2950,20 @@ function createRouter(init) {
|
|
|
2880
2950
|
}
|
|
2881
2951
|
let location = redirect2.response.headers.get("Location");
|
|
2882
2952
|
invariant(location, "Expected a Location header on the redirect Response");
|
|
2953
|
+
let originalLocation = location;
|
|
2954
|
+
let currentUrl = new URL(request.url);
|
|
2883
2955
|
location = normalizeRedirectLocation(
|
|
2884
2956
|
location,
|
|
2885
|
-
|
|
2957
|
+
currentUrl,
|
|
2886
2958
|
basename,
|
|
2887
2959
|
init.history
|
|
2888
2960
|
);
|
|
2961
|
+
validateNavigationTarget(
|
|
2962
|
+
originalLocation,
|
|
2963
|
+
location,
|
|
2964
|
+
currentUrl,
|
|
2965
|
+
"allow-explicit"
|
|
2966
|
+
);
|
|
2889
2967
|
let redirectLocation = createLocation(state.location, location, {
|
|
2890
2968
|
_isRedirect: true
|
|
2891
2969
|
});
|
|
@@ -3404,6 +3482,7 @@ function createRouter(init) {
|
|
|
3404
3482
|
// Passthrough to history-aware createHref used by useHref so we get proper
|
|
3405
3483
|
// hash-aware URLs in DOM paths
|
|
3406
3484
|
createHref: (to) => init.history.createHref(to),
|
|
3485
|
+
createURL: (to) => init.history.createURL(to),
|
|
3407
3486
|
encodeLocation: (to) => init.history.encodeLocation(to),
|
|
3408
3487
|
getFetcher,
|
|
3409
3488
|
resetFetcher,
|
|
@@ -5244,7 +5323,7 @@ var invalidProtocols = [
|
|
|
5244
5323
|
function hasInvalidProtocol(location) {
|
|
5245
5324
|
try {
|
|
5246
5325
|
return invalidProtocols.includes(new URL(location).protocol);
|
|
5247
|
-
} catch (
|
|
5326
|
+
} catch (e4) {
|
|
5248
5327
|
return false;
|
|
5249
5328
|
}
|
|
5250
5329
|
}
|
|
@@ -6514,6 +6593,9 @@ var ESCAPE_REGEX = /[&><\u2028\u2029]/g;
|
|
|
6514
6593
|
function escapeHtml(html) {
|
|
6515
6594
|
return html.replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match]);
|
|
6516
6595
|
}
|
|
6596
|
+
function escapeAttribute(value) {
|
|
6597
|
+
return value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
6598
|
+
}
|
|
6517
6599
|
|
|
6518
6600
|
// lib/dom/ssr/invariant.ts
|
|
6519
6601
|
function invariant2(value, message) {
|
|
@@ -7085,7 +7167,7 @@ function decodeRedirectErrorDigest(digest) {
|
|
|
7085
7167
|
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") {
|
|
7086
7168
|
return parsed;
|
|
7087
7169
|
}
|
|
7088
|
-
} catch (
|
|
7170
|
+
} catch (e5) {
|
|
7089
7171
|
}
|
|
7090
7172
|
}
|
|
7091
7173
|
}
|
|
@@ -7102,7 +7184,7 @@ function decodeRouteErrorResponseDigest(digest) {
|
|
|
7102
7184
|
parsed.data
|
|
7103
7185
|
);
|
|
7104
7186
|
}
|
|
7105
|
-
} catch (
|
|
7187
|
+
} catch (e6) {
|
|
7106
7188
|
}
|
|
7107
7189
|
}
|
|
7108
7190
|
}
|
|
@@ -7195,6 +7277,12 @@ function useNavigateUnstable() {
|
|
|
7195
7277
|
if (dataRouterContext == null && basename !== "/") {
|
|
7196
7278
|
path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
|
|
7197
7279
|
}
|
|
7280
|
+
validateNavigationTarget(
|
|
7281
|
+
typeof to === "string" ? to : createPath(to),
|
|
7282
|
+
navigator.createHref(path),
|
|
7283
|
+
getNavigatorCurrentUrl(navigator),
|
|
7284
|
+
"reject"
|
|
7285
|
+
);
|
|
7198
7286
|
(!!options.replace ? navigator.replace : navigator.push)(
|
|
7199
7287
|
path,
|
|
7200
7288
|
options.state,
|
|
@@ -7436,7 +7524,7 @@ function RSCErrorHandler({
|
|
|
7436
7524
|
children,
|
|
7437
7525
|
error
|
|
7438
7526
|
}) {
|
|
7439
|
-
let { basename } = React3.useContext(NavigationContext);
|
|
7527
|
+
let { basename, navigator } = React3.useContext(NavigationContext);
|
|
7440
7528
|
if (typeof error === "object" && error && "digest" in error && typeof error.digest === "string") {
|
|
7441
7529
|
let redirect2 = decodeRedirectErrorDigest(error.digest);
|
|
7442
7530
|
if (redirect2) {
|
|
@@ -7444,6 +7532,12 @@ function RSCErrorHandler({
|
|
|
7444
7532
|
if (existingRedirect) throw existingRedirect;
|
|
7445
7533
|
let parsed = parseToInfo(redirect2.location, basename);
|
|
7446
7534
|
let target = parsed.absoluteURL || parsed.to;
|
|
7535
|
+
validateNavigationTarget(
|
|
7536
|
+
redirect2.location,
|
|
7537
|
+
target,
|
|
7538
|
+
getNavigatorCurrentUrl(navigator),
|
|
7539
|
+
"allow-explicit"
|
|
7540
|
+
);
|
|
7447
7541
|
if (hasInvalidProtocol(target)) {
|
|
7448
7542
|
throw new Error("Invalid redirect location");
|
|
7449
7543
|
}
|
|
@@ -8685,7 +8779,7 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
|
|
|
8685
8779
|
return;
|
|
8686
8780
|
}
|
|
8687
8781
|
sessionStorage.setItem(MANIFEST_VERSION_STORAGE_KEY, manifest.version);
|
|
8688
|
-
} catch (
|
|
8782
|
+
} catch (e7) {
|
|
8689
8783
|
}
|
|
8690
8784
|
window.location.href = errorReloadPath;
|
|
8691
8785
|
console.warn("Detected manifest version mismatch, reloading...");
|
|
@@ -8696,7 +8790,7 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
|
|
|
8696
8790
|
}
|
|
8697
8791
|
try {
|
|
8698
8792
|
sessionStorage.removeItem(MANIFEST_VERSION_STORAGE_KEY);
|
|
8699
|
-
} catch (
|
|
8793
|
+
} catch (e8) {
|
|
8700
8794
|
}
|
|
8701
8795
|
serverPatches = await res.json();
|
|
8702
8796
|
} catch (e) {
|
|
@@ -9730,6 +9824,7 @@ function RouterProvider({
|
|
|
9730
9824
|
let navigator = React9.useMemo(() => {
|
|
9731
9825
|
return {
|
|
9732
9826
|
createHref: router.createHref,
|
|
9827
|
+
createURL: router.createURL,
|
|
9733
9828
|
encodeLocation: router.encodeLocation,
|
|
9734
9829
|
go: (n) => router.navigate(n),
|
|
9735
9830
|
push: (to, state2, opts) => router.navigate(to, {
|
|
@@ -9862,7 +9957,7 @@ function Navigate({
|
|
|
9862
9957
|
// the router loaded. We can help them understand how to avoid that.
|
|
9863
9958
|
`<Navigate> may be used only in the context of a <Router> component.`
|
|
9864
9959
|
);
|
|
9865
|
-
let { static: isStatic } = React9.useContext(NavigationContext);
|
|
9960
|
+
let { static: isStatic, navigator } = React9.useContext(NavigationContext);
|
|
9866
9961
|
warning(
|
|
9867
9962
|
!isStatic,
|
|
9868
9963
|
`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`
|
|
@@ -9876,6 +9971,12 @@ function Navigate({
|
|
|
9876
9971
|
locationPathname,
|
|
9877
9972
|
relative === "path"
|
|
9878
9973
|
);
|
|
9974
|
+
validateNavigationTarget(
|
|
9975
|
+
typeof to === "string" ? to : createPath(to),
|
|
9976
|
+
navigator.createHref(path),
|
|
9977
|
+
getNavigatorCurrentUrl(navigator),
|
|
9978
|
+
"reject"
|
|
9979
|
+
);
|
|
9879
9980
|
let jsonPath = JSON.stringify(path);
|
|
9880
9981
|
React9.useEffect(() => {
|
|
9881
9982
|
navigate(JSON.parse(jsonPath), { replace: replace2, state, relative });
|
|
@@ -10304,4 +10405,6 @@ function withErrorBoundaryProps(ErrorBoundary) {
|
|
|
10304
10405
|
|
|
10305
10406
|
|
|
10306
10407
|
|
|
10307
|
-
|
|
10408
|
+
|
|
10409
|
+
|
|
10410
|
+
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.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.validateNavigationTarget = validateNavigationTarget; 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.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;
|
|
@@ -207,6 +207,14 @@ interface Router$1 {
|
|
|
207
207
|
* @param location
|
|
208
208
|
*/
|
|
209
209
|
createHref(location: Location | URL): string;
|
|
210
|
+
/**
|
|
211
|
+
* @private
|
|
212
|
+
* PRIVATE - DO NOT USE
|
|
213
|
+
*
|
|
214
|
+
* Utility function to create a URL for the given location
|
|
215
|
+
* @param location
|
|
216
|
+
*/
|
|
217
|
+
createURL?(to: To): URL;
|
|
210
218
|
/**
|
|
211
219
|
* @private
|
|
212
220
|
* PRIVATE - DO NOT USE
|
|
@@ -1751,6 +1759,7 @@ interface NavigateOptions {
|
|
|
1751
1759
|
*/
|
|
1752
1760
|
interface Navigator {
|
|
1753
1761
|
createHref: History["createHref"];
|
|
1762
|
+
createURL?: History["createURL"];
|
|
1754
1763
|
encodeLocation?: History["encodeLocation"];
|
|
1755
1764
|
go: History["go"];
|
|
1756
1765
|
push(to: To, state?: any, opts?: NavigateOptions): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
2
|
+
import { a as RouterProviderProps$1, R as RouterInit, C as ClientInstrumentation, b as ClientOnErrorFunction } from './context-nqAapj74.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-BR5QG7ZC.mjs';
|
|
4
4
|
import './data-DEjBmEfD.mjs';
|
|
5
5
|
|
|
6
6
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
3
|
+
import { C as ClientInstrumentation } from './instrumentation-B7w3_Eo9.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-eq4RgLsD.js';
|
|
5
5
|
import './data-CjO11-hU.js';
|
|
6
6
|
|
|
7
7
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
@@ -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.4
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkQURBR4FZjs = require('./chunk-QURBR4FZ.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -37,7 +37,8 @@ var _chunkVJZ67BZEjs = require('./chunk-VJZ67BZE.js');
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
var _chunkYNGRUB6Fjs = require('./chunk-YNGRUB6F.js');
|
|
41
42
|
|
|
42
43
|
// lib/dom-export/dom-router-provider.tsx
|
|
43
44
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react);
|
|
@@ -213,7 +214,7 @@ function HydratedRouter(props) {
|
|
|
213
214
|
}, []);
|
|
214
215
|
React2.useEffect(() => {
|
|
215
216
|
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
|
|
216
|
-
document.querySelectorAll(`[${
|
|
217
|
+
document.querySelectorAll(`[${_chunkYNGRUB6Fjs.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
|
217
218
|
}
|
|
218
219
|
}, [criticalCss]);
|
|
219
220
|
let [location2, setLocation] = React2.useState(router.state.location);
|
|
@@ -307,8 +308,14 @@ function createCallServer({
|
|
|
307
308
|
Promise.resolve(payloadPromise).then(async (payload) => {
|
|
308
309
|
if (payload.type === "redirect") {
|
|
309
310
|
let location2 = normalizeRedirectLocation(payload.location);
|
|
311
|
+
_chunkYNGRUB6Fjs.validateNavigationTarget.call(void 0,
|
|
312
|
+
payload.location,
|
|
313
|
+
location2,
|
|
314
|
+
new URL(window.location.href),
|
|
315
|
+
"allow-explicit"
|
|
316
|
+
);
|
|
310
317
|
if (payload.reload || isExternalLocation(location2)) {
|
|
311
|
-
if (
|
|
318
|
+
if (_chunkYNGRUB6Fjs.hasInvalidProtocol.call(void 0, location2)) {
|
|
312
319
|
throw new Error("Invalid redirect location");
|
|
313
320
|
}
|
|
314
321
|
window.location.href = location2;
|
|
@@ -328,8 +335,14 @@ function createCallServer({
|
|
|
328
335
|
if (rerender && landedActionId < actionId && globalVar.__routerActionID <= actionId) {
|
|
329
336
|
if (rerender.type === "redirect") {
|
|
330
337
|
let location2 = normalizeRedirectLocation(rerender.location);
|
|
338
|
+
_chunkYNGRUB6Fjs.validateNavigationTarget.call(void 0,
|
|
339
|
+
rerender.location,
|
|
340
|
+
location2,
|
|
341
|
+
new URL(window.location.href),
|
|
342
|
+
"allow-explicit"
|
|
343
|
+
);
|
|
331
344
|
if (rerender.reload || isExternalLocation(location2)) {
|
|
332
|
-
if (
|
|
345
|
+
if (_chunkYNGRUB6Fjs.hasInvalidProtocol.call(void 0, location2)) {
|
|
333
346
|
throw new Error("Invalid redirect location");
|
|
334
347
|
}
|
|
335
348
|
window.location.href = location2;
|
|
@@ -394,7 +407,7 @@ function createRouterFromPayload({
|
|
|
394
407
|
};
|
|
395
408
|
if (payload.type !== "render") throw new Error("Invalid payload type");
|
|
396
409
|
globalVar.__reactRouterRouteModules = _nullishCoalesce(globalVar.__reactRouterRouteModules, () => ( {}));
|
|
397
|
-
|
|
410
|
+
_chunkQURBR4FZjs.populateRSCRouteModules.call(void 0, globalVar.__reactRouterRouteModules, payload.matches);
|
|
398
411
|
let routes = payload.matches.reduceRight((previous, match) => {
|
|
399
412
|
const route = createRouteFromServerManifest(
|
|
400
413
|
match,
|
|
@@ -408,12 +421,12 @@ function createRouterFromPayload({
|
|
|
408
421
|
return [route];
|
|
409
422
|
}, []);
|
|
410
423
|
let applyPatchesPromise;
|
|
411
|
-
globalVar.__reactRouterDataRouter =
|
|
424
|
+
globalVar.__reactRouterDataRouter = _chunkYNGRUB6Fjs.createRouter.call(void 0, {
|
|
412
425
|
routes,
|
|
413
426
|
getContext,
|
|
414
427
|
basename: payload.basename,
|
|
415
|
-
history:
|
|
416
|
-
hydrationData:
|
|
428
|
+
history: _chunkYNGRUB6Fjs.createBrowserHistory.call(void 0, ),
|
|
429
|
+
hydrationData: _chunkQURBR4FZjs.getHydrationData.call(void 0, {
|
|
417
430
|
state: {
|
|
418
431
|
loaderData: payload.loaderData,
|
|
419
432
|
actionData: payload.actionData,
|
|
@@ -422,7 +435,7 @@ function createRouterFromPayload({
|
|
|
422
435
|
routes,
|
|
423
436
|
getRouteInfo: (routeId) => {
|
|
424
437
|
let match = payload.matches.find((m) => m.id === routeId);
|
|
425
|
-
|
|
438
|
+
_chunkYNGRUB6Fjs.invariant.call(void 0, match, "Route not found in payload");
|
|
426
439
|
return {
|
|
427
440
|
clientLoader: match.clientLoader,
|
|
428
441
|
hasLoader: match.hasLoader,
|
|
@@ -537,9 +550,9 @@ function createRouterFromPayload({
|
|
|
537
550
|
routeModules: globalVar.__reactRouterRouteModules
|
|
538
551
|
};
|
|
539
552
|
}
|
|
540
|
-
var renderedRoutesContext =
|
|
553
|
+
var renderedRoutesContext = _chunkYNGRUB6Fjs.createContext.call(void 0, );
|
|
541
554
|
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
|
542
|
-
let dataStrategy =
|
|
555
|
+
let dataStrategy = _chunkYNGRUB6Fjs.getSingleFetchDataStrategyImpl.call(void 0,
|
|
543
556
|
getRouter,
|
|
544
557
|
(match) => {
|
|
545
558
|
let M = match;
|
|
@@ -596,20 +609,20 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
|
|
|
596
609
|
function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {
|
|
597
610
|
return async (args, basename, trailingSlashAware, targetRoutes) => {
|
|
598
611
|
let { request, context } = args;
|
|
599
|
-
let url =
|
|
612
|
+
let url = _chunkYNGRUB6Fjs.singleFetchUrl.call(void 0, request.url, basename, trailingSlashAware, "rsc");
|
|
600
613
|
if (request.method === "GET") {
|
|
601
|
-
url =
|
|
614
|
+
url = _chunkYNGRUB6Fjs.stripIndexParam.call(void 0, url);
|
|
602
615
|
if (targetRoutes) {
|
|
603
616
|
url.searchParams.set("_routes", targetRoutes.join(","));
|
|
604
617
|
}
|
|
605
618
|
}
|
|
606
619
|
let res = await fetchImplementation(
|
|
607
|
-
new Request(url, await
|
|
620
|
+
new Request(url, await _chunkYNGRUB6Fjs.createRequestInit.call(void 0, request))
|
|
608
621
|
);
|
|
609
622
|
if (res.status >= 400 && !res.headers.has("X-Remix-Response")) {
|
|
610
|
-
throw new (0,
|
|
623
|
+
throw new (0, _chunkYNGRUB6Fjs.ErrorResponseImpl)(res.status, res.statusText, await res.text());
|
|
611
624
|
}
|
|
612
|
-
|
|
625
|
+
_chunkYNGRUB6Fjs.invariant.call(void 0, res.body, "No response body to decode");
|
|
613
626
|
try {
|
|
614
627
|
const payload = await createFromReadableStream(res.body, {
|
|
615
628
|
temporaryReferences: void 0
|
|
@@ -633,7 +646,7 @@ function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation)
|
|
|
633
646
|
}
|
|
634
647
|
context.get(renderedRoutesContext).push(...payload.matches);
|
|
635
648
|
let results = { routes: {} };
|
|
636
|
-
const dataKey =
|
|
649
|
+
const dataKey = _chunkYNGRUB6Fjs.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
|
|
637
650
|
for (let [routeId, data] of Object.entries(payload[dataKey] || {})) {
|
|
638
651
|
results.routes[routeId] = { data };
|
|
639
652
|
}
|
|
@@ -666,7 +679,7 @@ function RSCHydratedRouter({
|
|
|
666
679
|
[createFromReadableStream, payload, fetchImplementation, getContext]
|
|
667
680
|
);
|
|
668
681
|
React3.useEffect(() => {
|
|
669
|
-
|
|
682
|
+
_chunkYNGRUB6Fjs.setIsHydrated.call(void 0, );
|
|
670
683
|
}, []);
|
|
671
684
|
React3.useLayoutEffect(() => {
|
|
672
685
|
const globalVar = window;
|
|
@@ -774,8 +787,8 @@ function RSCHydratedRouter({
|
|
|
774
787
|
},
|
|
775
788
|
routeModules
|
|
776
789
|
};
|
|
777
|
-
return /* @__PURE__ */ React3.createElement(
|
|
778
|
-
|
|
790
|
+
return /* @__PURE__ */ React3.createElement(_chunkYNGRUB6Fjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunkQURBR4FZjs.RSCRouterGlobalErrorBoundary, { location: state.location }, /* @__PURE__ */ React3.createElement(_chunkYNGRUB6Fjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
|
|
791
|
+
_chunkYNGRUB6Fjs.RouterProvider,
|
|
779
792
|
{
|
|
780
793
|
router: transitionEnabledRouter,
|
|
781
794
|
flushSync: ReactDOM2.flushSync
|
|
@@ -791,8 +804,8 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
791
804
|
// the server loader flow regardless of whether the client loader calls
|
|
792
805
|
// `serverLoader` or not, otherwise we'll have nothing to render.
|
|
793
806
|
match.hasComponent && !match.element;
|
|
794
|
-
|
|
795
|
-
|
|
807
|
+
_chunkYNGRUB6Fjs.invariant.call(void 0, window.__reactRouterRouteModules);
|
|
808
|
+
_chunkQURBR4FZjs.populateRSCRouteModules.call(void 0, window.__reactRouterRouteModules, match);
|
|
796
809
|
let dataRoute = {
|
|
797
810
|
id: match.id,
|
|
798
811
|
element: match.element,
|
|
@@ -840,7 +853,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
840
853
|
return await callSingleFetch(singleFetch);
|
|
841
854
|
}
|
|
842
855
|
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
|
843
|
-
throw
|
|
856
|
+
throw _chunkYNGRUB6Fjs.noActionDefinedError.call(void 0, "action", match.id);
|
|
844
857
|
},
|
|
845
858
|
path: match.path,
|
|
846
859
|
shouldRevalidate: match.shouldRevalidate,
|
|
@@ -852,7 +865,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
852
865
|
hasClientAction: match.clientAction != null
|
|
853
866
|
};
|
|
854
867
|
if (typeof dataRoute.loader === "function") {
|
|
855
|
-
dataRoute.loader.hydrate =
|
|
868
|
+
dataRoute.loader.hydrate = _chunkYNGRUB6Fjs.shouldHydrateRouteLoader.call(void 0,
|
|
856
869
|
match.id,
|
|
857
870
|
match.clientLoader,
|
|
858
871
|
match.hasLoader,
|
|
@@ -862,7 +875,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
862
875
|
return dataRoute;
|
|
863
876
|
}
|
|
864
877
|
function callSingleFetch(singleFetch) {
|
|
865
|
-
|
|
878
|
+
_chunkYNGRUB6Fjs.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
|
|
866
879
|
return singleFetch();
|
|
867
880
|
}
|
|
868
881
|
function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
@@ -870,7 +883,7 @@ function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
|
870
883
|
let fn = type === "action" ? "serverAction()" : "serverLoader()";
|
|
871
884
|
let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
|
|
872
885
|
console.error(msg);
|
|
873
|
-
throw new (0,
|
|
886
|
+
throw new (0, _chunkYNGRUB6Fjs.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
|
|
874
887
|
}
|
|
875
888
|
}
|
|
876
889
|
var nextPaths = /* @__PURE__ */ new Set();
|
|
@@ -893,12 +906,12 @@ function getManifestUrl(paths) {
|
|
|
893
906
|
return url;
|
|
894
907
|
}
|
|
895
908
|
async function fetchAndApplyManifestPatches(paths, createFromReadableStream, fetchImplementation, signal) {
|
|
896
|
-
paths =
|
|
909
|
+
paths = _chunkYNGRUB6Fjs.getPathsWithAncestors.call(void 0, paths);
|
|
897
910
|
let url = getManifestUrl(paths);
|
|
898
911
|
if (url == null) {
|
|
899
912
|
return;
|
|
900
913
|
}
|
|
901
|
-
if (url.toString().length >
|
|
914
|
+
if (url.toString().length > _chunkYNGRUB6Fjs.URL_LIMIT) {
|
|
902
915
|
nextPaths.clear();
|
|
903
916
|
return;
|
|
904
917
|
}
|
|
@@ -942,8 +955,8 @@ function isExternalLocation(location2) {
|
|
|
942
955
|
return newLocation.origin !== window.location.origin;
|
|
943
956
|
}
|
|
944
957
|
function normalizeRedirectLocation(location2) {
|
|
945
|
-
if (
|
|
946
|
-
let path =
|
|
958
|
+
if (_chunkYNGRUB6Fjs.PROTOCOL_RELATIVE_URL_REGEX.test(location2)) {
|
|
959
|
+
let path = _chunkYNGRUB6Fjs.resolvePath.call(void 0, location2);
|
|
947
960
|
return path.pathname + path.search + path.hash;
|
|
948
961
|
}
|
|
949
962
|
return location2;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.18.
|
|
2
|
+
* react-router v7.18.4
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
RSCRouterGlobalErrorBoundary,
|
|
14
14
|
getHydrationData,
|
|
15
15
|
populateRSCRouteModules
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-G2MPF4YY.mjs";
|
|
17
17
|
import {
|
|
18
18
|
CRITICAL_CSS_DATA_ATTRIBUTE,
|
|
19
19
|
ErrorResponseImpl,
|
|
@@ -45,8 +45,9 @@ import {
|
|
|
45
45
|
shouldHydrateRouteLoader,
|
|
46
46
|
singleFetchUrl,
|
|
47
47
|
stripIndexParam,
|
|
48
|
-
useFogOFWarDiscovery
|
|
49
|
-
|
|
48
|
+
useFogOFWarDiscovery,
|
|
49
|
+
validateNavigationTarget
|
|
50
|
+
} from "./chunk-Q34X6AWR.mjs";
|
|
50
51
|
|
|
51
52
|
// lib/dom-export/dom-router-provider.tsx
|
|
52
53
|
import * as React from "react";
|
|
@@ -299,6 +300,12 @@ function createCallServer({
|
|
|
299
300
|
Promise.resolve(payloadPromise).then(async (payload) => {
|
|
300
301
|
if (payload.type === "redirect") {
|
|
301
302
|
let location2 = normalizeRedirectLocation(payload.location);
|
|
303
|
+
validateNavigationTarget(
|
|
304
|
+
payload.location,
|
|
305
|
+
location2,
|
|
306
|
+
new URL(window.location.href),
|
|
307
|
+
"allow-explicit"
|
|
308
|
+
);
|
|
302
309
|
if (payload.reload || isExternalLocation(location2)) {
|
|
303
310
|
if (hasInvalidProtocol(location2)) {
|
|
304
311
|
throw new Error("Invalid redirect location");
|
|
@@ -320,6 +327,12 @@ function createCallServer({
|
|
|
320
327
|
if (rerender && landedActionId < actionId && globalVar.__routerActionID <= actionId) {
|
|
321
328
|
if (rerender.type === "redirect") {
|
|
322
329
|
let location2 = normalizeRedirectLocation(rerender.location);
|
|
330
|
+
validateNavigationTarget(
|
|
331
|
+
rerender.location,
|
|
332
|
+
location2,
|
|
333
|
+
new URL(window.location.href),
|
|
334
|
+
"allow-explicit"
|
|
335
|
+
);
|
|
323
336
|
if (rerender.reload || isExternalLocation(location2)) {
|
|
324
337
|
if (hasInvalidProtocol(location2)) {
|
|
325
338
|
throw new Error("Invalid redirect location");
|