react-router 7.9.5 → 7.9.6-pre.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -10
- package/dist/development/{browser-DM83uryY.d.ts → browser-BbBXFHbO.d.ts} +1 -1
- package/dist/development/{browser-DfMfSvsC.d.mts → browser-C07r42Tt.d.mts} +1 -1
- package/dist/development/{chunk-VNR6V74N.js → chunk-CYHICRRW.js} +124 -52
- package/dist/development/{chunk-UIGDSWPH.mjs → chunk-DKSAHU2I.mjs} +95 -23
- package/dist/{production/chunk-ERPFE3MR.js → development/chunk-HSVNPM3C.js} +93 -93
- package/dist/{production/chunk-CWEARR4H.js → development/chunk-OLIKX45O.js} +7 -7
- package/dist/development/{chunk-JG3XND5A.mjs → chunk-RGKEVI2W.mjs} +2 -2
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.d.ts +2 -2
- package/dist/development/dom-export.js +26 -26
- package/dist/development/dom-export.mjs +3 -3
- package/dist/{production/index-react-server-client-BSxMvS7Z.d.ts → development/index-react-server-client-Da3kmxNd.d.ts} +1 -1
- package/dist/development/{index-react-server-client-B0vnxMMk.d.mts → index-react-server-client-rcoGPJhU.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.js +25 -4
- package/dist/development/index-react-server.mjs +25 -4
- package/dist/development/index.d.mts +8 -8
- package/dist/development/index.d.ts +8 -8
- package/dist/development/index.js +76 -76
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-iAqbU5Q4.d.ts → development/instrumentation-Unc20tLk.d.ts} +5 -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-c-dooqKE.d.ts → register-BpU9rFBJ.d.ts} +1 -1
- package/dist/development/{register-_G476ptB.d.mts → register-QkB3HGjm.d.mts} +1 -1
- package/dist/development/{router-DIAPGK5f.d.mts → router-CAvh_Drx.d.mts} +5 -1
- package/dist/production/{browser-DM83uryY.d.ts → browser-BbBXFHbO.d.ts} +1 -1
- package/dist/production/{browser-DfMfSvsC.d.mts → browser-C07r42Tt.d.mts} +1 -1
- package/dist/production/{chunk-EAE7427A.js → chunk-2DNJUQK6.js} +124 -52
- package/dist/{development/chunk-IXESJAGJ.js → production/chunk-EDK3MRM6.js} +93 -93
- package/dist/{development/chunk-FQEOJFGW.js → production/chunk-JLDESRHY.js} +7 -7
- package/dist/production/{chunk-TPBVZP6U.mjs → chunk-LC2OWLJG.mjs} +2 -2
- package/dist/production/{chunk-RZ6LZWMW.mjs → chunk-LESYMMDQ.mjs} +95 -23
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.d.ts +2 -2
- package/dist/production/dom-export.js +26 -26
- package/dist/production/dom-export.mjs +3 -3
- package/dist/{development/index-react-server-client-BSxMvS7Z.d.ts → production/index-react-server-client-Da3kmxNd.d.ts} +1 -1
- package/dist/production/{index-react-server-client-B0vnxMMk.d.mts → index-react-server-client-rcoGPJhU.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.js +25 -4
- package/dist/production/index-react-server.mjs +25 -4
- package/dist/production/index.d.mts +8 -8
- package/dist/production/index.d.ts +8 -8
- package/dist/production/index.js +76 -76
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-iAqbU5Q4.d.ts → production/instrumentation-Unc20tLk.d.ts} +5 -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-c-dooqKE.d.ts → register-BpU9rFBJ.d.ts} +1 -1
- package/dist/production/{register-_G476ptB.d.mts → register-QkB3HGjm.d.mts} +1 -1
- package/dist/production/{router-DIAPGK5f.d.mts → router-CAvh_Drx.d.mts} +5 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.9.
|
|
2
|
+
* react-router v7.9.6-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -811,13 +811,36 @@ function prependBasename({
|
|
|
811
811
|
}) {
|
|
812
812
|
return pathname === "/" ? basename : joinPaths([basename, pathname]);
|
|
813
813
|
}
|
|
814
|
+
var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
815
|
+
var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
|
|
814
816
|
function resolvePath(to, fromPathname = "/") {
|
|
815
817
|
let {
|
|
816
818
|
pathname: toPathname,
|
|
817
819
|
search = "",
|
|
818
820
|
hash = ""
|
|
819
821
|
} = typeof to === "string" ? parsePath(to) : to;
|
|
820
|
-
let pathname
|
|
822
|
+
let pathname;
|
|
823
|
+
if (toPathname) {
|
|
824
|
+
if (isAbsoluteUrl(toPathname)) {
|
|
825
|
+
pathname = toPathname;
|
|
826
|
+
} else {
|
|
827
|
+
if (toPathname.includes("//")) {
|
|
828
|
+
let oldPathname = toPathname;
|
|
829
|
+
toPathname = toPathname.replace(/\/\/+/g, "/");
|
|
830
|
+
warning(
|
|
831
|
+
false,
|
|
832
|
+
`Pathnames cannot have embedded double slashes - normalizing ${oldPathname} -> ${toPathname}`
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
if (toPathname.startsWith("/")) {
|
|
836
|
+
pathname = resolvePathname(toPathname.substring(1), "/");
|
|
837
|
+
} else {
|
|
838
|
+
pathname = resolvePathname(toPathname, fromPathname);
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
} else {
|
|
842
|
+
pathname = fromPathname;
|
|
843
|
+
}
|
|
821
844
|
return {
|
|
822
845
|
pathname,
|
|
823
846
|
search: normalizeSearch(search),
|
|
@@ -1265,8 +1288,6 @@ var IDLE_BLOCKER = {
|
|
|
1265
1288
|
reset: void 0,
|
|
1266
1289
|
location: void 0
|
|
1267
1290
|
};
|
|
1268
|
-
var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
1269
|
-
var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
|
|
1270
1291
|
var defaultMapRouteProperties = (route) => ({
|
|
1271
1292
|
hasErrorBoundary: Boolean(route.hasErrorBoundary)
|
|
1272
1293
|
});
|
|
@@ -2306,6 +2327,14 @@ function createRouter(init) {
|
|
|
2306
2327
|
key
|
|
2307
2328
|
);
|
|
2308
2329
|
let actionResult = actionResults[match.route.id];
|
|
2330
|
+
if (!actionResult) {
|
|
2331
|
+
for (let match2 of fetchMatches) {
|
|
2332
|
+
if (actionResults[match2.route.id]) {
|
|
2333
|
+
actionResult = actionResults[match2.route.id];
|
|
2334
|
+
break;
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2309
2338
|
if (fetchRequest.signal.aborted) {
|
|
2310
2339
|
if (fetchControllers.get(key) === abortController) {
|
|
2311
2340
|
fetchControllers.delete(key);
|
|
@@ -2962,23 +2991,43 @@ function createRouter(init) {
|
|
|
2962
2991
|
return { type: "aborted" };
|
|
2963
2992
|
}
|
|
2964
2993
|
let newMatches = matchRoutes(routesToUse, pathname, basename);
|
|
2994
|
+
let newPartialMatches = null;
|
|
2965
2995
|
if (newMatches) {
|
|
2966
|
-
|
|
2996
|
+
if (Object.keys(newMatches[0].params).length === 0) {
|
|
2997
|
+
return { type: "success", matches: newMatches };
|
|
2998
|
+
} else {
|
|
2999
|
+
newPartialMatches = matchRoutesImpl(
|
|
3000
|
+
routesToUse,
|
|
3001
|
+
pathname,
|
|
3002
|
+
basename,
|
|
3003
|
+
true
|
|
3004
|
+
);
|
|
3005
|
+
let matchedDeeper = newPartialMatches && partialMatches.length < newPartialMatches.length && compareMatches(
|
|
3006
|
+
partialMatches,
|
|
3007
|
+
newPartialMatches.slice(0, partialMatches.length)
|
|
3008
|
+
);
|
|
3009
|
+
if (!matchedDeeper) {
|
|
3010
|
+
return { type: "success", matches: newMatches };
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
2967
3013
|
}
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
)) {
|
|
3014
|
+
if (!newPartialMatches) {
|
|
3015
|
+
newPartialMatches = matchRoutesImpl(
|
|
3016
|
+
routesToUse,
|
|
3017
|
+
pathname,
|
|
3018
|
+
basename,
|
|
3019
|
+
true
|
|
3020
|
+
);
|
|
3021
|
+
}
|
|
3022
|
+
if (!newPartialMatches || compareMatches(partialMatches, newPartialMatches)) {
|
|
2977
3023
|
return { type: "success", matches: null };
|
|
2978
3024
|
}
|
|
2979
3025
|
partialMatches = newPartialMatches;
|
|
2980
3026
|
}
|
|
2981
3027
|
}
|
|
3028
|
+
function compareMatches(a, b) {
|
|
3029
|
+
return a.length === b.length && a.every((m, i) => m.route.id === b[i].route.id);
|
|
3030
|
+
}
|
|
2982
3031
|
function _internalSetRoutes(newRoutes) {
|
|
2983
3032
|
manifest = {};
|
|
2984
3033
|
inFlightDataRoutes = convertRoutesToDataRoutes(
|
|
@@ -5589,8 +5638,8 @@ var RenderErrorBoundary = class extends React2.Component {
|
|
|
5589
5638
|
};
|
|
5590
5639
|
}
|
|
5591
5640
|
componentDidCatch(error, errorInfo) {
|
|
5592
|
-
if (this.props.
|
|
5593
|
-
this.props.
|
|
5641
|
+
if (this.props.onError) {
|
|
5642
|
+
this.props.onError(error, errorInfo);
|
|
5594
5643
|
} else {
|
|
5595
5644
|
console.error(
|
|
5596
5645
|
"React Router caught the following error during render",
|
|
@@ -5668,6 +5717,13 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, uns
|
|
|
5668
5717
|
}
|
|
5669
5718
|
}
|
|
5670
5719
|
}
|
|
5720
|
+
let onError = dataRouterState && unstable_onError ? (error, errorInfo) => {
|
|
5721
|
+
unstable_onError(error, {
|
|
5722
|
+
location: dataRouterState.location,
|
|
5723
|
+
params: dataRouterState.matches?.[0]?.params ?? {},
|
|
5724
|
+
errorInfo
|
|
5725
|
+
});
|
|
5726
|
+
} : void 0;
|
|
5671
5727
|
return renderedMatches.reduceRight(
|
|
5672
5728
|
(outlet, match, index) => {
|
|
5673
5729
|
let error;
|
|
@@ -5728,7 +5784,7 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, uns
|
|
|
5728
5784
|
error,
|
|
5729
5785
|
children: getChildren(),
|
|
5730
5786
|
routeContext: { outlet: null, matches: matches2, isDataRoute: true },
|
|
5731
|
-
|
|
5787
|
+
onError
|
|
5732
5788
|
}
|
|
5733
5789
|
) : getChildren();
|
|
5734
5790
|
},
|
|
@@ -6140,7 +6196,10 @@ function RouterProvider({
|
|
|
6140
6196
|
if (newState.errors && unstable_onError) {
|
|
6141
6197
|
Object.entries(newState.errors).forEach(([routeId, error]) => {
|
|
6142
6198
|
if (prevState.errors?.[routeId] !== error) {
|
|
6143
|
-
unstable_onError(error
|
|
6199
|
+
unstable_onError(error, {
|
|
6200
|
+
location: newState.location,
|
|
6201
|
+
params: newState.matches[0]?.params ?? {}
|
|
6202
|
+
});
|
|
6144
6203
|
}
|
|
6145
6204
|
});
|
|
6146
6205
|
}
|
|
@@ -6469,12 +6528,25 @@ function Await({
|
|
|
6469
6528
|
resolve
|
|
6470
6529
|
}) {
|
|
6471
6530
|
let dataRouterContext = React3.useContext(DataRouterContext);
|
|
6531
|
+
let dataRouterStateContext = React3.useContext(DataRouterStateContext);
|
|
6532
|
+
let onError = React3.useCallback(
|
|
6533
|
+
(error, errorInfo) => {
|
|
6534
|
+
if (dataRouterContext && dataRouterContext.unstable_onError && dataRouterStateContext) {
|
|
6535
|
+
dataRouterContext.unstable_onError(error, {
|
|
6536
|
+
location: dataRouterStateContext.location,
|
|
6537
|
+
params: dataRouterStateContext.matches?.[0]?.params || {},
|
|
6538
|
+
errorInfo
|
|
6539
|
+
});
|
|
6540
|
+
}
|
|
6541
|
+
},
|
|
6542
|
+
[dataRouterContext, dataRouterStateContext]
|
|
6543
|
+
);
|
|
6472
6544
|
return /* @__PURE__ */ React3.createElement(
|
|
6473
6545
|
AwaitErrorBoundary,
|
|
6474
6546
|
{
|
|
6475
6547
|
resolve,
|
|
6476
6548
|
errorElement,
|
|
6477
|
-
|
|
6549
|
+
onError
|
|
6478
6550
|
},
|
|
6479
6551
|
/* @__PURE__ */ React3.createElement(ResolveAwait, null, children)
|
|
6480
6552
|
);
|
|
@@ -6488,8 +6560,8 @@ var AwaitErrorBoundary = class extends React3.Component {
|
|
|
6488
6560
|
return { error };
|
|
6489
6561
|
}
|
|
6490
6562
|
componentDidCatch(error, errorInfo) {
|
|
6491
|
-
if (this.props.
|
|
6492
|
-
this.props.
|
|
6563
|
+
if (this.props.onError) {
|
|
6564
|
+
this.props.onError(error, errorInfo);
|
|
6493
6565
|
} else {
|
|
6494
6566
|
console.error(
|
|
6495
6567
|
"<Await> caught the following error during render",
|
|
@@ -6523,7 +6595,7 @@ var AwaitErrorBoundary = class extends React3.Component {
|
|
|
6523
6595
|
promise = resolve.then(
|
|
6524
6596
|
(data2) => Object.defineProperty(resolve, "_data", { get: () => data2 }),
|
|
6525
6597
|
(error) => {
|
|
6526
|
-
this.props.
|
|
6598
|
+
this.props.onError?.(error);
|
|
6527
6599
|
Object.defineProperty(resolve, "_error", { get: () => error });
|
|
6528
6600
|
}
|
|
6529
6601
|
);
|
|
@@ -9466,7 +9538,7 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
|
|
|
9466
9538
|
try {
|
|
9467
9539
|
if (isBrowser) {
|
|
9468
9540
|
window.__reactRouterVersion = // @ts-expect-error
|
|
9469
|
-
"7.9.
|
|
9541
|
+
"7.9.6-pre.1";
|
|
9470
9542
|
}
|
|
9471
9543
|
} catch (e) {
|
|
9472
9544
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { f as RouterProviderProps$1, e as RouterInit, u as unstable_ClientInstrumentation, g as unstable_ClientOnErrorFunction } from './router-
|
|
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 { f as RouterProviderProps$1, e as RouterInit, u as unstable_ClientInstrumentation, g as unstable_ClientOnErrorFunction } from './router-CAvh_Drx.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-C07r42Tt.mjs';
|
|
4
4
|
|
|
5
5
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
6
6
|
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { RouterProviderProps as RouterProviderProps$1, RouterInit, unstable_ClientOnErrorFunction } from 'react-router';
|
|
3
|
-
import { u as unstable_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 { u as unstable_ClientInstrumentation } from './instrumentation-Unc20tLk.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-BbBXFHbO.js';
|
|
5
5
|
|
|
6
6
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
7
7
|
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
|
@@ -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.9.
|
|
2
|
+
* react-router v7.9.6-pre.1
|
|
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 _chunkJLDESRHYjs = require('./chunk-JLDESRHY.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -32,7 +32,7 @@ var _chunkCWEARR4Hjs = require('./chunk-CWEARR4H.js');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunk2DNJUQK6js = require('./chunk-2DNJUQK6.js');
|
|
36
36
|
|
|
37
37
|
// lib/dom-export/dom-router-provider.tsx
|
|
38
38
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react);
|
|
@@ -204,7 +204,7 @@ function HydratedRouter(props) {
|
|
|
204
204
|
}, []);
|
|
205
205
|
React2.useEffect(() => {
|
|
206
206
|
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
|
|
207
|
-
document.querySelectorAll(`[${
|
|
207
|
+
document.querySelectorAll(`[${_chunk2DNJUQK6js.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
|
208
208
|
}
|
|
209
209
|
}, [criticalCss]);
|
|
210
210
|
let [location2, setLocation] = React2.useState(router.state.location);
|
|
@@ -373,10 +373,10 @@ function createRouterFromPayload({
|
|
|
373
373
|
};
|
|
374
374
|
if (payload.type !== "render") throw new Error("Invalid payload type");
|
|
375
375
|
globalVar.__reactRouterRouteModules = _nullishCoalesce(globalVar.__reactRouterRouteModules, () => ( {}));
|
|
376
|
-
|
|
376
|
+
_chunkJLDESRHYjs.populateRSCRouteModules.call(void 0, globalVar.__reactRouterRouteModules, payload.matches);
|
|
377
377
|
let patches = /* @__PURE__ */ new Map();
|
|
378
378
|
_optionalChain([payload, 'access', _22 => _22.patches, 'optionalAccess', _23 => _23.forEach, 'call', _24 => _24((patch) => {
|
|
379
|
-
|
|
379
|
+
_chunk2DNJUQK6js.invariant.call(void 0, patch.parentId, "Invalid patch parentId");
|
|
380
380
|
if (!patches.has(patch.parentId)) {
|
|
381
381
|
patches.set(patch.parentId, []);
|
|
382
382
|
}
|
|
@@ -398,12 +398,12 @@ function createRouterFromPayload({
|
|
|
398
398
|
}
|
|
399
399
|
return [route];
|
|
400
400
|
}, []);
|
|
401
|
-
globalVar.__reactRouterDataRouter =
|
|
401
|
+
globalVar.__reactRouterDataRouter = _chunk2DNJUQK6js.createRouter.call(void 0, {
|
|
402
402
|
routes,
|
|
403
403
|
getContext,
|
|
404
404
|
basename: payload.basename,
|
|
405
|
-
history:
|
|
406
|
-
hydrationData:
|
|
405
|
+
history: _chunk2DNJUQK6js.createBrowserHistory.call(void 0, ),
|
|
406
|
+
hydrationData: _chunkJLDESRHYjs.getHydrationData.call(void 0, {
|
|
407
407
|
state: {
|
|
408
408
|
loaderData: payload.loaderData,
|
|
409
409
|
actionData: payload.actionData,
|
|
@@ -412,7 +412,7 @@ function createRouterFromPayload({
|
|
|
412
412
|
routes,
|
|
413
413
|
getRouteInfo: (routeId) => {
|
|
414
414
|
let match = payload.matches.find((m) => m.id === routeId);
|
|
415
|
-
|
|
415
|
+
_chunk2DNJUQK6js.invariant.call(void 0, match, "Route not found in payload");
|
|
416
416
|
return {
|
|
417
417
|
clientLoader: match.clientLoader,
|
|
418
418
|
hasLoader: match.hasLoader,
|
|
@@ -510,9 +510,9 @@ function createRouterFromPayload({
|
|
|
510
510
|
routeModules: globalVar.__reactRouterRouteModules
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
|
-
var renderedRoutesContext =
|
|
513
|
+
var renderedRoutesContext = _chunk2DNJUQK6js.createContext.call(void 0, );
|
|
514
514
|
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
|
515
|
-
let dataStrategy =
|
|
515
|
+
let dataStrategy = _chunk2DNJUQK6js.getSingleFetchDataStrategyImpl.call(void 0,
|
|
516
516
|
getRouter,
|
|
517
517
|
(match) => {
|
|
518
518
|
let M = match;
|
|
@@ -566,20 +566,20 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
|
|
|
566
566
|
function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {
|
|
567
567
|
return async (args, basename, targetRoutes) => {
|
|
568
568
|
let { request, context } = args;
|
|
569
|
-
let url =
|
|
569
|
+
let url = _chunk2DNJUQK6js.singleFetchUrl.call(void 0, request.url, basename, "rsc");
|
|
570
570
|
if (request.method === "GET") {
|
|
571
|
-
url =
|
|
571
|
+
url = _chunk2DNJUQK6js.stripIndexParam.call(void 0, url);
|
|
572
572
|
if (targetRoutes) {
|
|
573
573
|
url.searchParams.set("_routes", targetRoutes.join(","));
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
let res = await fetchImplementation(
|
|
577
|
-
new Request(url, await
|
|
577
|
+
new Request(url, await _chunk2DNJUQK6js.createRequestInit.call(void 0, request))
|
|
578
578
|
);
|
|
579
579
|
if (res.status >= 400 && !res.headers.has("X-Remix-Response")) {
|
|
580
|
-
throw new (0,
|
|
580
|
+
throw new (0, _chunk2DNJUQK6js.ErrorResponseImpl)(res.status, res.statusText, await res.text());
|
|
581
581
|
}
|
|
582
|
-
|
|
582
|
+
_chunk2DNJUQK6js.invariant.call(void 0, res.body, "No response body to decode");
|
|
583
583
|
try {
|
|
584
584
|
const payload = await createFromReadableStream(res.body, {
|
|
585
585
|
temporaryReferences: void 0
|
|
@@ -603,7 +603,7 @@ function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation)
|
|
|
603
603
|
}
|
|
604
604
|
context.get(renderedRoutesContext).push(...payload.matches);
|
|
605
605
|
let results = { routes: {} };
|
|
606
|
-
const dataKey =
|
|
606
|
+
const dataKey = _chunk2DNJUQK6js.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
|
|
607
607
|
for (let [routeId, data] of Object.entries(payload[dataKey] || {})) {
|
|
608
608
|
results.routes[routeId] = { data };
|
|
609
609
|
}
|
|
@@ -636,7 +636,7 @@ function RSCHydratedRouter({
|
|
|
636
636
|
[createFromReadableStream, payload, fetchImplementation, getContext]
|
|
637
637
|
);
|
|
638
638
|
React3.useEffect(() => {
|
|
639
|
-
|
|
639
|
+
_chunk2DNJUQK6js.setIsHydrated.call(void 0, );
|
|
640
640
|
}, []);
|
|
641
641
|
React3.useLayoutEffect(() => {
|
|
642
642
|
const globalVar = window;
|
|
@@ -723,7 +723,7 @@ function RSCHydratedRouter({
|
|
|
723
723
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
724
724
|
routeModules
|
|
725
725
|
};
|
|
726
|
-
return /* @__PURE__ */ React3.createElement(
|
|
726
|
+
return /* @__PURE__ */ React3.createElement(_chunk2DNJUQK6js.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunkJLDESRHYjs.RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React3.createElement(_chunk2DNJUQK6js.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(_chunk2DNJUQK6js.UNSTABLE_TransitionEnabledRouterProvider, { router: router2, flushSync: ReactDOM2.flushSync }))));
|
|
727
727
|
}
|
|
728
728
|
function createRouteFromServerManifest(match, payload) {
|
|
729
729
|
let hasInitialData = payload && match.id in payload.loaderData;
|
|
@@ -734,8 +734,8 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
734
734
|
// the server loader flow regardless of whether the client loader calls
|
|
735
735
|
// `serverLoader` or not, otherwise we'll have nothing to render.
|
|
736
736
|
match.hasComponent && !match.element;
|
|
737
|
-
|
|
738
|
-
|
|
737
|
+
_chunk2DNJUQK6js.invariant.call(void 0, window.__reactRouterRouteModules);
|
|
738
|
+
_chunkJLDESRHYjs.populateRSCRouteModules.call(void 0, window.__reactRouterRouteModules, match);
|
|
739
739
|
let dataRoute = {
|
|
740
740
|
id: match.id,
|
|
741
741
|
element: match.element,
|
|
@@ -785,7 +785,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
785
785
|
return await callSingleFetch(singleFetch);
|
|
786
786
|
}
|
|
787
787
|
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
|
788
|
-
throw
|
|
788
|
+
throw _chunk2DNJUQK6js.noActionDefinedError.call(void 0, "action", match.id);
|
|
789
789
|
},
|
|
790
790
|
path: match.path,
|
|
791
791
|
shouldRevalidate: match.shouldRevalidate,
|
|
@@ -798,7 +798,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
798
798
|
hasShouldRevalidate: match.shouldRevalidate != null
|
|
799
799
|
};
|
|
800
800
|
if (typeof dataRoute.loader === "function") {
|
|
801
|
-
dataRoute.loader.hydrate =
|
|
801
|
+
dataRoute.loader.hydrate = _chunk2DNJUQK6js.shouldHydrateRouteLoader.call(void 0,
|
|
802
802
|
match.id,
|
|
803
803
|
match.clientLoader,
|
|
804
804
|
match.hasLoader,
|
|
@@ -808,7 +808,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
808
808
|
return dataRoute;
|
|
809
809
|
}
|
|
810
810
|
function callSingleFetch(singleFetch) {
|
|
811
|
-
|
|
811
|
+
_chunk2DNJUQK6js.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
|
|
812
812
|
return singleFetch();
|
|
813
813
|
}
|
|
814
814
|
function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
@@ -816,7 +816,7 @@ function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
|
816
816
|
let fn = type === "action" ? "serverAction()" : "serverLoader()";
|
|
817
817
|
let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
|
|
818
818
|
console.error(msg);
|
|
819
|
-
throw new (0,
|
|
819
|
+
throw new (0, _chunk2DNJUQK6js.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
822
|
var nextPaths = /* @__PURE__ */ new Set();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.9.
|
|
2
|
+
* react-router v7.9.6-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
deserializeErrors,
|
|
15
15
|
getHydrationData,
|
|
16
16
|
populateRSCRouteModules
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-LC2OWLJG.mjs";
|
|
18
18
|
import {
|
|
19
19
|
CRITICAL_CSS_DATA_ATTRIBUTE,
|
|
20
20
|
ErrorResponseImpl,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
singleFetchUrl,
|
|
44
44
|
stripIndexParam,
|
|
45
45
|
useFogOFWarDiscovery
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-LESYMMDQ.mjs";
|
|
47
47
|
|
|
48
48
|
// lib/dom-export/dom-router-provider.tsx
|
|
49
49
|
import * as React from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bE as RouteManifest, o as RouteModules, Q as HydrationState, a1 as DataRouteObject, a as ClientLoaderFunction, a5 as StaticHandlerContext, bF as ServerRouteModule, q as MiddlewareEnabled, c as RouterContextProvider, r as AppLoadContext, al as LoaderFunctionArgs, ac as ActionFunctionArgs, au as unstable_ServerInstrumentation, aj as HTMLFormMethod, ah as FormEncType, w as RelativeRoutingType, bh as PageLinkDescriptor, T as To, bG as History, a4 as GetScrollRestorationKeyFunction, e as RouterInit, bH as FutureConfig$1, u as unstable_ClientInstrumentation, p as DataStrategyFunction, a0 as PatchRoutesOnNavigationFunction, s as NavigateOptions, a6 as Fetcher, K as RouteObject, n as Router, v as SerializeFrom, B as BlockerFunction, L as Location, bI as CreateStaticHandlerOptions$1, a2 as StaticHandler } from './instrumentation-
|
|
1
|
+
import { bE as RouteManifest, o as RouteModules, Q as HydrationState, a1 as DataRouteObject, a as ClientLoaderFunction, a5 as StaticHandlerContext, bF as ServerRouteModule, q as MiddlewareEnabled, c as RouterContextProvider, r as AppLoadContext, al as LoaderFunctionArgs, ac as ActionFunctionArgs, au as unstable_ServerInstrumentation, aj as HTMLFormMethod, ah as FormEncType, w as RelativeRoutingType, bh as PageLinkDescriptor, T as To, bG as History, a4 as GetScrollRestorationKeyFunction, e as RouterInit, bH as FutureConfig$1, u as unstable_ClientInstrumentation, p as DataStrategyFunction, a0 as PatchRoutesOnNavigationFunction, s as NavigateOptions, a6 as Fetcher, K as RouteObject, n as Router, v as SerializeFrom, B as BlockerFunction, L as Location, bI as CreateStaticHandlerOptions$1, a2 as StaticHandler } from './instrumentation-Unc20tLk.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
interface Route {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bE as RouteManifest, q as RouteModules, W as HydrationState, a3 as DataRouteObject, a as ClientLoaderFunction, a7 as StaticHandlerContext, bF as ServerRouteModule, s as MiddlewareEnabled, c as RouterContextProvider, t as AppLoadContext, an as LoaderFunctionArgs, ae as ActionFunctionArgs, aw as unstable_ServerInstrumentation, al as HTMLFormMethod, aj as FormEncType, y as RelativeRoutingType, bh as PageLinkDescriptor, T as To, bG as History, a6 as GetScrollRestorationKeyFunction, e as RouterInit, bH as FutureConfig$1, u as unstable_ClientInstrumentation, r as DataStrategyFunction, a2 as PatchRoutesOnNavigationFunction, v as NavigateOptions, a8 as Fetcher, Q as RouteObject, p as Router, x as SerializeFrom, B as BlockerFunction, L as Location, bI as CreateStaticHandlerOptions$1, a4 as StaticHandler } from './router-
|
|
1
|
+
import { bE as RouteManifest, q as RouteModules, W as HydrationState, a3 as DataRouteObject, a as ClientLoaderFunction, a7 as StaticHandlerContext, bF as ServerRouteModule, s as MiddlewareEnabled, c as RouterContextProvider, t as AppLoadContext, an as LoaderFunctionArgs, ae as ActionFunctionArgs, aw as unstable_ServerInstrumentation, al as HTMLFormMethod, aj as FormEncType, y as RelativeRoutingType, bh as PageLinkDescriptor, T as To, bG as History, a6 as GetScrollRestorationKeyFunction, e as RouterInit, bH as FutureConfig$1, u as unstable_ClientInstrumentation, r as DataStrategyFunction, a2 as PatchRoutesOnNavigationFunction, v as NavigateOptions, a8 as Fetcher, Q as RouteObject, p as Router, x as SerializeFrom, B as BlockerFunction, L as Location, bI as CreateStaticHandlerOptions$1, a4 as StaticHandler } from './router-CAvh_Drx.mjs';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
interface Route {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { b2 as MemoryRouter, b3 as Navigate, b4 as Outlet, b5 as Route, b6 as Router, b7 as RouterProvider, b8 as Routes, aR as UNSAFE_AwaitContextProvider, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps } from './router-
|
|
2
|
-
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-
|
|
1
|
+
export { b2 as MemoryRouter, b3 as Navigate, b4 as Outlet, b5 as Route, b6 as Router, b7 as RouterProvider, b8 as Routes, aR as UNSAFE_AwaitContextProvider, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps } from './router-CAvh_Drx.mjs';
|
|
2
|
+
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-rcoGPJhU.mjs';
|
|
3
3
|
import 'react';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { b2 as MemoryRouter, b3 as Navigate, b4 as Outlet, b5 as Route, b6 as Router, b7 as RouterProvider, b8 as Routes, aP as UNSAFE_AwaitContextProvider, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps } from './instrumentation-
|
|
2
|
-
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-
|
|
1
|
+
export { b2 as MemoryRouter, b3 as Navigate, b4 as Outlet, b5 as Route, b6 as Router, b7 as RouterProvider, b8 as Routes, aP as UNSAFE_AwaitContextProvider, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps } from './instrumentation-Unc20tLk.js';
|
|
2
|
+
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-Da3kmxNd.js';
|
|
3
3
|
import 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
|
|
2
|
-
* react-router v7.9.
|
|
2
|
+
* react-router v7.9.6-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _chunkEDK3MRM6js = require('./chunk-EDK3MRM6.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -34,7 +34,7 @@ var _chunkERPFE3MRjs = require('./chunk-ERPFE3MR.js');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunk2DNJUQK6js = require('./chunk-2DNJUQK6.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -58,4 +58,4 @@ var _chunkEAE7427Ajs = require('./chunk-EAE7427A.js');
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
exports.BrowserRouter =
|
|
61
|
+
exports.BrowserRouter = _chunkEDK3MRM6js.BrowserRouter; exports.Form = _chunkEDK3MRM6js.Form; exports.HashRouter = _chunkEDK3MRM6js.HashRouter; exports.Link = _chunkEDK3MRM6js.Link; exports.Links = _chunk2DNJUQK6js.Links; exports.MemoryRouter = _chunk2DNJUQK6js.MemoryRouter; exports.Meta = _chunk2DNJUQK6js.Meta; exports.NavLink = _chunkEDK3MRM6js.NavLink; exports.Navigate = _chunk2DNJUQK6js.Navigate; exports.Outlet = _chunk2DNJUQK6js.Outlet; exports.Route = _chunk2DNJUQK6js.Route; exports.Router = _chunk2DNJUQK6js.Router; exports.RouterProvider = _chunk2DNJUQK6js.RouterProvider; exports.Routes = _chunk2DNJUQK6js.Routes; exports.ScrollRestoration = _chunkEDK3MRM6js.ScrollRestoration; exports.StaticRouter = _chunkEDK3MRM6js.StaticRouter; exports.StaticRouterProvider = _chunkEDK3MRM6js.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunk2DNJUQK6js.AwaitContextProvider; exports.UNSAFE_WithComponentProps = _chunk2DNJUQK6js.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunk2DNJUQK6js.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunk2DNJUQK6js.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkEDK3MRM6js.HistoryRouter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.9.
|
|
2
|
+
* react-router v7.9.6-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
WithComponentProps,
|
|
33
33
|
WithErrorBoundaryProps,
|
|
34
34
|
WithHydrateFallbackProps
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-LESYMMDQ.mjs";
|
|
36
36
|
export {
|
|
37
37
|
BrowserRouter,
|
|
38
38
|
Form,
|
|
@@ -27,7 +27,7 @@ function _interopNamespace(e) {
|
|
|
27
27
|
var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* react-router v7.9.
|
|
30
|
+
* react-router v7.9.6-pre.1
|
|
31
31
|
*
|
|
32
32
|
* Copyright (c) Remix Software Inc.
|
|
33
33
|
*
|
|
@@ -707,13 +707,36 @@ function prependBasename({
|
|
|
707
707
|
}) {
|
|
708
708
|
return pathname === "/" ? basename : joinPaths([basename, pathname]);
|
|
709
709
|
}
|
|
710
|
+
var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
711
|
+
var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
|
|
710
712
|
function resolvePath(to, fromPathname = "/") {
|
|
711
713
|
let {
|
|
712
714
|
pathname: toPathname,
|
|
713
715
|
search = "",
|
|
714
716
|
hash = ""
|
|
715
717
|
} = typeof to === "string" ? parsePath(to) : to;
|
|
716
|
-
let pathname
|
|
718
|
+
let pathname;
|
|
719
|
+
if (toPathname) {
|
|
720
|
+
if (isAbsoluteUrl(toPathname)) {
|
|
721
|
+
pathname = toPathname;
|
|
722
|
+
} else {
|
|
723
|
+
if (toPathname.includes("//")) {
|
|
724
|
+
let oldPathname = toPathname;
|
|
725
|
+
toPathname = toPathname.replace(/\/\/+/g, "/");
|
|
726
|
+
warning(
|
|
727
|
+
false,
|
|
728
|
+
`Pathnames cannot have embedded double slashes - normalizing ${oldPathname} -> ${toPathname}`
|
|
729
|
+
);
|
|
730
|
+
}
|
|
731
|
+
if (toPathname.startsWith("/")) {
|
|
732
|
+
pathname = resolvePathname(toPathname.substring(1), "/");
|
|
733
|
+
} else {
|
|
734
|
+
pathname = resolvePathname(toPathname, fromPathname);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
} else {
|
|
738
|
+
pathname = fromPathname;
|
|
739
|
+
}
|
|
717
740
|
return {
|
|
718
741
|
pathname,
|
|
719
742
|
search: normalizeSearch(search),
|
|
@@ -866,8 +889,6 @@ var validRequestMethodsArr = [
|
|
|
866
889
|
];
|
|
867
890
|
var validRequestMethods = new Set(validRequestMethodsArr);
|
|
868
891
|
var redirectStatusCodes = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
|
|
869
|
-
var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
870
|
-
var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
|
|
871
892
|
var defaultMapRouteProperties = (route) => ({
|
|
872
893
|
hasErrorBoundary: Boolean(route.hasErrorBoundary)
|
|
873
894
|
});
|
|
@@ -6,7 +6,7 @@ export { BrowserRouter, Form, HashRouter, Link, Links, MemoryRouter, Meta, NavLi
|
|
|
6
6
|
import { serialize, parse } from 'cookie';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* react-router v7.9.
|
|
9
|
+
* react-router v7.9.6-pre.1
|
|
10
10
|
*
|
|
11
11
|
* Copyright (c) Remix Software Inc.
|
|
12
12
|
*
|
|
@@ -686,13 +686,36 @@ function prependBasename({
|
|
|
686
686
|
}) {
|
|
687
687
|
return pathname === "/" ? basename : joinPaths([basename, pathname]);
|
|
688
688
|
}
|
|
689
|
+
var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
690
|
+
var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
|
|
689
691
|
function resolvePath(to, fromPathname = "/") {
|
|
690
692
|
let {
|
|
691
693
|
pathname: toPathname,
|
|
692
694
|
search = "",
|
|
693
695
|
hash = ""
|
|
694
696
|
} = typeof to === "string" ? parsePath(to) : to;
|
|
695
|
-
let pathname
|
|
697
|
+
let pathname;
|
|
698
|
+
if (toPathname) {
|
|
699
|
+
if (isAbsoluteUrl(toPathname)) {
|
|
700
|
+
pathname = toPathname;
|
|
701
|
+
} else {
|
|
702
|
+
if (toPathname.includes("//")) {
|
|
703
|
+
let oldPathname = toPathname;
|
|
704
|
+
toPathname = toPathname.replace(/\/\/+/g, "/");
|
|
705
|
+
warning(
|
|
706
|
+
false,
|
|
707
|
+
`Pathnames cannot have embedded double slashes - normalizing ${oldPathname} -> ${toPathname}`
|
|
708
|
+
);
|
|
709
|
+
}
|
|
710
|
+
if (toPathname.startsWith("/")) {
|
|
711
|
+
pathname = resolvePathname(toPathname.substring(1), "/");
|
|
712
|
+
} else {
|
|
713
|
+
pathname = resolvePathname(toPathname, fromPathname);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
} else {
|
|
717
|
+
pathname = fromPathname;
|
|
718
|
+
}
|
|
696
719
|
return {
|
|
697
720
|
pathname,
|
|
698
721
|
search: normalizeSearch(search),
|
|
@@ -845,8 +868,6 @@ var validRequestMethodsArr = [
|
|
|
845
868
|
];
|
|
846
869
|
var validRequestMethods = new Set(validRequestMethodsArr);
|
|
847
870
|
var redirectStatusCodes = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
|
|
848
|
-
var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
849
|
-
var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
|
|
850
871
|
var defaultMapRouteProperties = (route) => ({
|
|
851
872
|
hasErrorBoundary: Boolean(route.hasErrorBoundary)
|
|
852
873
|
});
|