react-router-dom 6.30.3 → 6.30.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 +8 -0
- package/dist/index.js +24 -32
- package/dist/index.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/react-router-dom.development.js +5 -3
- package/dist/react-router-dom.development.js.map +1 -1
- package/dist/react-router-dom.production.min.js +2 -2
- package/dist/react-router-dom.production.min.js.map +1 -1
- package/dist/server.js +2 -2
- package/dist/umd/react-router-dom.development.js +25 -31
- package/dist/umd/react-router-dom.development.js.map +1 -1
- package/dist/umd/react-router-dom.production.min.js +2 -2
- package/dist/umd/react-router-dom.production.min.js.map +1 -1
- package/package.json +3 -3
- package/server.js +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React Router DOM v6.30.
|
|
2
|
+
* React Router DOM v6.30.4
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -36,30 +36,22 @@
|
|
|
36
36
|
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
37
37
|
|
|
38
38
|
function _extends() {
|
|
39
|
-
_extends = Object.assign ? Object.assign.bind() : function (
|
|
40
|
-
for (var
|
|
41
|
-
var
|
|
42
|
-
for (var
|
|
43
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
44
|
-
target[key] = source[key];
|
|
45
|
-
}
|
|
46
|
-
}
|
|
39
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
40
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
41
|
+
var t = arguments[e];
|
|
42
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
47
43
|
}
|
|
48
|
-
return
|
|
49
|
-
};
|
|
50
|
-
return _extends.apply(this, arguments);
|
|
44
|
+
return n;
|
|
45
|
+
}, _extends.apply(null, arguments);
|
|
51
46
|
}
|
|
52
|
-
function _objectWithoutPropertiesLoose(
|
|
53
|
-
if (
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
key = sourceKeys[i];
|
|
59
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
60
|
-
target[key] = source[key];
|
|
47
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
48
|
+
if (null == r) return {};
|
|
49
|
+
var t = {};
|
|
50
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
51
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
52
|
+
t[n] = r[n];
|
|
61
53
|
}
|
|
62
|
-
return
|
|
54
|
+
return t;
|
|
63
55
|
}
|
|
64
56
|
|
|
65
57
|
const defaultMethod = "get";
|
|
@@ -85,9 +77,8 @@
|
|
|
85
77
|
!target || target === "_self") &&
|
|
86
78
|
// Let browser handle "target=_blank" etc.
|
|
87
79
|
!isModifiedEvent(event) // Ignore clicks with modifier keys
|
|
88
|
-
|
|
80
|
+
;
|
|
89
81
|
}
|
|
90
|
-
|
|
91
82
|
/**
|
|
92
83
|
* Creates a URLSearchParams object using the given initializer.
|
|
93
84
|
*
|
|
@@ -273,6 +264,7 @@
|
|
|
273
264
|
////////////////////////////////////////////////////////////////////////////////
|
|
274
265
|
//#region Routers
|
|
275
266
|
////////////////////////////////////////////////////////////////////////////////
|
|
267
|
+
|
|
276
268
|
function createBrowserRouter(routes, opts) {
|
|
277
269
|
return router.createRouter({
|
|
278
270
|
basename: opts == null ? void 0 : opts.basename,
|
|
@@ -362,6 +354,7 @@
|
|
|
362
354
|
////////////////////////////////////////////////////////////////////////////////
|
|
363
355
|
//#region Contexts
|
|
364
356
|
////////////////////////////////////////////////////////////////////////////////
|
|
357
|
+
|
|
365
358
|
const ViewTransitionContext = /*#__PURE__*/React__namespace.createContext({
|
|
366
359
|
isTransitioning: false
|
|
367
360
|
});
|
|
@@ -1032,11 +1025,11 @@
|
|
|
1032
1025
|
* This component will emulate the browser's scroll restoration on location
|
|
1033
1026
|
* changes.
|
|
1034
1027
|
*/
|
|
1035
|
-
function ScrollRestoration(
|
|
1028
|
+
function ScrollRestoration(_ref0) {
|
|
1036
1029
|
let {
|
|
1037
1030
|
getKey,
|
|
1038
1031
|
storageKey
|
|
1039
|
-
} =
|
|
1032
|
+
} = _ref0;
|
|
1040
1033
|
useScrollRestoration({
|
|
1041
1034
|
getKey,
|
|
1042
1035
|
storageKey
|
|
@@ -1262,6 +1255,7 @@
|
|
|
1262
1255
|
return reactRouter.createPath(path);
|
|
1263
1256
|
}
|
|
1264
1257
|
// TODO: (v7) Change the useFetcher generic default from `any` to `unknown`
|
|
1258
|
+
|
|
1265
1259
|
/**
|
|
1266
1260
|
* Interacts with route loaders and actions without causing a navigation. Great
|
|
1267
1261
|
* for any interaction that stays on the same page.
|
|
@@ -1350,8 +1344,8 @@
|
|
|
1350
1344
|
*/
|
|
1351
1345
|
function useFetchers() {
|
|
1352
1346
|
let state = useDataRouterState(DataRouterStateHook.UseFetchers);
|
|
1353
|
-
return Array.from(state.fetchers.entries()).map(
|
|
1354
|
-
let [key, fetcher] =
|
|
1347
|
+
return Array.from(state.fetchers.entries()).map(_ref1 => {
|
|
1348
|
+
let [key, fetcher] = _ref1;
|
|
1355
1349
|
return _extends({}, fetcher, {
|
|
1356
1350
|
key
|
|
1357
1351
|
});
|
|
@@ -1421,7 +1415,7 @@
|
|
|
1421
1415
|
// Enable scroll restoration in the router
|
|
1422
1416
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1423
1417
|
React__namespace.useLayoutEffect(() => {
|
|
1424
|
-
let getKeyWithoutBasename = getKey && basename !== "/" ? (location, matches) => getKey(
|
|
1418
|
+
let getKeyWithoutBasename = getKey && basename !== "/" ? (location, matches) => getKey(// Strip the basename to match useLocation()
|
|
1425
1419
|
_extends({}, location, {
|
|
1426
1420
|
pathname: router.stripBasename(location.pathname, basename) || location.pathname
|
|
1427
1421
|
}), matches) : getKey;
|
|
@@ -1517,11 +1511,11 @@
|
|
|
1517
1511
|
* very incorrectly in some cases) across browsers if user click addition
|
|
1518
1512
|
* back/forward navigations while the confirm is open. Use at your own risk.
|
|
1519
1513
|
*/
|
|
1520
|
-
function usePrompt(
|
|
1514
|
+
function usePrompt(_ref10) {
|
|
1521
1515
|
let {
|
|
1522
1516
|
when,
|
|
1523
1517
|
message
|
|
1524
|
-
} =
|
|
1518
|
+
} = _ref10;
|
|
1525
1519
|
let blocker = reactRouter.useBlocker(when);
|
|
1526
1520
|
React__namespace.useEffect(() => {
|
|
1527
1521
|
if (blocker.state === "blocked") {
|