react-router 0.0.0-experimental-4e44d47 → 0.0.0-experimental-3df673e
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/dist/{production/chunk-IZVJSKMU.mjs → development/chunk-27W3PGKT.mjs} +3 -3
- package/dist/development/{chunk-XVVWTPHF.mjs → chunk-5FNKA3AJ.mjs} +20 -18
- package/dist/{production/chunk-UNIYMJFU.js → development/chunk-HMTR6AB3.js} +134 -134
- package/dist/development/{chunk-7B7CUJYE.js → chunk-OAO2BCWA.js} +19 -17
- package/dist/development/dom-export.d.mts +1 -1
- package/dist/development/dom-export.d.ts +1 -1
- package/dist/development/dom-export.js +3 -3
- package/dist/development/dom-export.mjs +3 -3
- package/dist/development/{index-react-server-client-83aVZHgI.d.ts → index-react-server-client-CCykjjOv.d.ts} +2 -2
- package/dist/{production/index-react-server-client-BDG19ZQl.d.mts → development/index-react-server-client-vPxdwQO-.d.mts} +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.d.mts +3 -3
- package/dist/development/index-react-server.d.ts +3 -3
- package/dist/development/index-react-server.js +11 -11
- package/dist/development/index-react-server.mjs +11 -11
- package/dist/development/index.d.mts +6 -6
- package/dist/development/index.d.ts +6 -6
- package/dist/development/index.js +99 -99
- package/dist/development/index.mjs +3 -3
- package/dist/development/{instrumentation-XYmrzhe3.d.ts → instrumentation-BsMyG4uF.d.ts} +2 -2
- 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/{production/routeModules-Bu1JamQV.d.ts → development/routeModules-BsBQDHG4.d.ts} +3 -3
- package/dist/development/{routeModules-CtCOLGtG.d.mts → routeModules-DSpLybMz.d.mts} +3 -3
- package/dist/development/{router-2BoB34m1.d.mts → router-B02dMGKy.d.mts} +2 -2
- package/dist/{development/chunk-MTLWRICG.js → production/chunk-BJWGLTLV.js} +134 -134
- package/dist/{development/chunk-PSQFTIPQ.mjs → production/chunk-IFXZKZUN.mjs} +3 -3
- package/dist/production/{chunk-OXRQQZPR.js → chunk-NZTFTCSL.js} +19 -17
- package/dist/production/{chunk-GSSVRQ6M.mjs → chunk-XWLYGPB7.mjs} +20 -18
- package/dist/production/dom-export.d.mts +1 -1
- package/dist/production/dom-export.d.ts +1 -1
- package/dist/production/dom-export.js +3 -3
- package/dist/production/dom-export.mjs +3 -3
- package/dist/production/{index-react-server-client-83aVZHgI.d.ts → index-react-server-client-CCykjjOv.d.ts} +2 -2
- package/dist/{development/index-react-server-client-BDG19ZQl.d.mts → production/index-react-server-client-vPxdwQO-.d.mts} +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.d.mts +3 -3
- package/dist/production/index-react-server.d.ts +3 -3
- package/dist/production/index-react-server.js +11 -11
- package/dist/production/index-react-server.mjs +11 -11
- package/dist/production/index.d.mts +6 -6
- package/dist/production/index.d.ts +6 -6
- package/dist/production/index.js +99 -99
- package/dist/production/index.mjs +3 -3
- package/dist/production/{instrumentation-XYmrzhe3.d.ts → instrumentation-BsMyG4uF.d.ts} +2 -2
- 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/{development/routeModules-Bu1JamQV.d.ts → production/routeModules-BsBQDHG4.d.ts} +3 -3
- package/dist/production/{routeModules-CtCOLGtG.d.mts → routeModules-DSpLybMz.d.mts} +3 -3
- package/dist/production/{router-2BoB34m1.d.mts → router-B02dMGKy.d.mts} +2 -2
- 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 _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 v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-3df673e
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
var
|
|
64
|
+
var _chunkOAO2BCWAjs = require('./chunk-OAO2BCWA.js');
|
|
65
65
|
|
|
66
66
|
// lib/components.tsx
|
|
67
67
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react);
|
|
@@ -72,9 +72,9 @@ function mapRouteProperties(route) {
|
|
|
72
72
|
hasErrorBoundary: route.hasErrorBoundary || route.ErrorBoundary != null || route.errorElement != null
|
|
73
73
|
};
|
|
74
74
|
if (route.Component) {
|
|
75
|
-
if (
|
|
75
|
+
if (_chunkOAO2BCWAjs.ENABLE_DEV_WARNINGS) {
|
|
76
76
|
if (route.element) {
|
|
77
|
-
|
|
77
|
+
_chunkOAO2BCWAjs.warning.call(void 0,
|
|
78
78
|
false,
|
|
79
79
|
"You should not include both `Component` and `element` on your route - `Component` will be used."
|
|
80
80
|
);
|
|
@@ -86,9 +86,9 @@ function mapRouteProperties(route) {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
if (route.HydrateFallback) {
|
|
89
|
-
if (
|
|
89
|
+
if (_chunkOAO2BCWAjs.ENABLE_DEV_WARNINGS) {
|
|
90
90
|
if (route.hydrateFallbackElement) {
|
|
91
|
-
|
|
91
|
+
_chunkOAO2BCWAjs.warning.call(void 0,
|
|
92
92
|
false,
|
|
93
93
|
"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."
|
|
94
94
|
);
|
|
@@ -100,9 +100,9 @@ function mapRouteProperties(route) {
|
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
if (route.ErrorBoundary) {
|
|
103
|
-
if (
|
|
103
|
+
if (_chunkOAO2BCWAjs.ENABLE_DEV_WARNINGS) {
|
|
104
104
|
if (route.errorElement) {
|
|
105
|
-
|
|
105
|
+
_chunkOAO2BCWAjs.warning.call(void 0,
|
|
106
106
|
false,
|
|
107
107
|
"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."
|
|
108
108
|
);
|
|
@@ -120,11 +120,11 @@ var hydrationRouteProperties = [
|
|
|
120
120
|
"hydrateFallbackElement"
|
|
121
121
|
];
|
|
122
122
|
function createMemoryRouter(routes, opts) {
|
|
123
|
-
return
|
|
123
|
+
return _chunkOAO2BCWAjs.createRouter.call(void 0, {
|
|
124
124
|
basename: _optionalChain([opts, 'optionalAccess', _2 => _2.basename]),
|
|
125
125
|
getContext: _optionalChain([opts, 'optionalAccess', _3 => _3.getContext]),
|
|
126
126
|
future: _optionalChain([opts, 'optionalAccess', _4 => _4.future]),
|
|
127
|
-
history:
|
|
127
|
+
history: _chunkOAO2BCWAjs.createMemoryHistory.call(void 0, {
|
|
128
128
|
initialEntries: _optionalChain([opts, 'optionalAccess', _5 => _5.initialEntries]),
|
|
129
129
|
initialIndex: _optionalChain([opts, 'optionalAccess', _6 => _6.initialIndex])
|
|
130
130
|
}),
|
|
@@ -241,15 +241,15 @@ function UNSTABLE_TransitionEnabledRouterProvider({
|
|
|
241
241
|
}
|
|
242
242
|
);
|
|
243
243
|
}, [router, reactDomFlushSyncImpl, state]);
|
|
244
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
245
|
-
|
|
244
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(_chunkOAO2BCWAjs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React.createElement(
|
|
245
|
+
_chunkOAO2BCWAjs.DataRouterStateContext.Provider,
|
|
246
246
|
{
|
|
247
247
|
value: {
|
|
248
248
|
...state,
|
|
249
249
|
revalidation: revalidating ? "loading" : state.revalidation
|
|
250
250
|
}
|
|
251
251
|
},
|
|
252
|
-
/* @__PURE__ */ React.createElement(
|
|
252
|
+
/* @__PURE__ */ React.createElement(_chunkOAO2BCWAjs.FetchersContext.Provider, { value: fetcherData.current }, /* @__PURE__ */ React.createElement(
|
|
253
253
|
Router,
|
|
254
254
|
{
|
|
255
255
|
basename,
|
|
@@ -306,12 +306,12 @@ function RouterProvider({
|
|
|
306
306
|
}
|
|
307
307
|
});
|
|
308
308
|
deletedFetchers.forEach((key) => fetcherData.current.delete(key));
|
|
309
|
-
|
|
309
|
+
_chunkOAO2BCWAjs.warnOnce.call(void 0,
|
|
310
310
|
flushSync === false || reactDomFlushSyncImpl != null,
|
|
311
311
|
'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.'
|
|
312
312
|
);
|
|
313
313
|
let isViewTransitionAvailable = router.window != null && router.window.document != null && typeof router.window.document.startViewTransition === "function";
|
|
314
|
-
|
|
314
|
+
_chunkOAO2BCWAjs.warnOnce.call(void 0,
|
|
315
315
|
viewTransitionOpts == null || isViewTransitionAvailable,
|
|
316
316
|
"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."
|
|
317
317
|
);
|
|
@@ -443,7 +443,7 @@ function RouterProvider({
|
|
|
443
443
|
}),
|
|
444
444
|
[router, navigator, basename, unstable_onError]
|
|
445
445
|
);
|
|
446
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
446
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(_chunkOAO2BCWAjs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React.createElement(_chunkOAO2BCWAjs.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React.createElement(_chunkOAO2BCWAjs.FetchersContext.Provider, { value: fetcherData.current }, /* @__PURE__ */ React.createElement(_chunkOAO2BCWAjs.ViewTransitionContext.Provider, { value: vtContext }, /* @__PURE__ */ React.createElement(
|
|
447
447
|
Router,
|
|
448
448
|
{
|
|
449
449
|
basename,
|
|
@@ -469,7 +469,7 @@ function DataRoutes({
|
|
|
469
469
|
state,
|
|
470
470
|
unstable_onError
|
|
471
471
|
}) {
|
|
472
|
-
return
|
|
472
|
+
return _chunkOAO2BCWAjs.useRoutesImpl.call(void 0, routes, void 0, state, unstable_onError, future);
|
|
473
473
|
}
|
|
474
474
|
function MemoryRouter({
|
|
475
475
|
basename,
|
|
@@ -479,7 +479,7 @@ function MemoryRouter({
|
|
|
479
479
|
}) {
|
|
480
480
|
let historyRef = React.useRef();
|
|
481
481
|
if (historyRef.current == null) {
|
|
482
|
-
historyRef.current =
|
|
482
|
+
historyRef.current = _chunkOAO2BCWAjs.createMemoryHistory.call(void 0, {
|
|
483
483
|
initialEntries,
|
|
484
484
|
initialIndex,
|
|
485
485
|
v5Compat: true
|
|
@@ -514,23 +514,23 @@ function Navigate({
|
|
|
514
514
|
state,
|
|
515
515
|
relative
|
|
516
516
|
}) {
|
|
517
|
-
|
|
518
|
-
|
|
517
|
+
_chunkOAO2BCWAjs.invariant.call(void 0,
|
|
518
|
+
_chunkOAO2BCWAjs.useInRouterContext.call(void 0, ),
|
|
519
519
|
// TODO: This error is probably because they somehow have 2 versions of
|
|
520
520
|
// the router loaded. We can help them understand how to avoid that.
|
|
521
521
|
`<Navigate> may be used only in the context of a <Router> component.`
|
|
522
522
|
);
|
|
523
|
-
let { static: isStatic } = React.useContext(
|
|
524
|
-
|
|
523
|
+
let { static: isStatic } = React.useContext(_chunkOAO2BCWAjs.NavigationContext);
|
|
524
|
+
_chunkOAO2BCWAjs.warning.call(void 0,
|
|
525
525
|
!isStatic,
|
|
526
526
|
`<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.`
|
|
527
527
|
);
|
|
528
|
-
let { matches } = React.useContext(
|
|
529
|
-
let { pathname: locationPathname } =
|
|
530
|
-
let navigate =
|
|
531
|
-
let path =
|
|
528
|
+
let { matches } = React.useContext(_chunkOAO2BCWAjs.RouteContext);
|
|
529
|
+
let { pathname: locationPathname } = _chunkOAO2BCWAjs.useLocation.call(void 0, );
|
|
530
|
+
let navigate = _chunkOAO2BCWAjs.useNavigate.call(void 0, );
|
|
531
|
+
let path = _chunkOAO2BCWAjs.resolveTo.call(void 0,
|
|
532
532
|
to,
|
|
533
|
-
|
|
533
|
+
_chunkOAO2BCWAjs.getResolveToMatches.call(void 0, matches),
|
|
534
534
|
locationPathname,
|
|
535
535
|
relative === "path"
|
|
536
536
|
);
|
|
@@ -541,10 +541,10 @@ function Navigate({
|
|
|
541
541
|
return null;
|
|
542
542
|
}
|
|
543
543
|
function Outlet(props) {
|
|
544
|
-
return
|
|
544
|
+
return _chunkOAO2BCWAjs.useOutlet.call(void 0, props.context);
|
|
545
545
|
}
|
|
546
546
|
function Route(props) {
|
|
547
|
-
|
|
547
|
+
_chunkOAO2BCWAjs.invariant.call(void 0,
|
|
548
548
|
false,
|
|
549
549
|
`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`
|
|
550
550
|
);
|
|
@@ -557,8 +557,8 @@ function Router({
|
|
|
557
557
|
navigator,
|
|
558
558
|
static: staticProp = false
|
|
559
559
|
}) {
|
|
560
|
-
|
|
561
|
-
!
|
|
560
|
+
_chunkOAO2BCWAjs.invariant.call(void 0,
|
|
561
|
+
!_chunkOAO2BCWAjs.useInRouterContext.call(void 0, ),
|
|
562
562
|
`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`
|
|
563
563
|
);
|
|
564
564
|
let basename = basenameProp.replace(/^\/*/, "/");
|
|
@@ -572,7 +572,7 @@ function Router({
|
|
|
572
572
|
[basename, navigator, staticProp]
|
|
573
573
|
);
|
|
574
574
|
if (typeof locationProp === "string") {
|
|
575
|
-
locationProp =
|
|
575
|
+
locationProp = _chunkOAO2BCWAjs.parsePath.call(void 0, locationProp);
|
|
576
576
|
}
|
|
577
577
|
let {
|
|
578
578
|
pathname = "/",
|
|
@@ -582,7 +582,7 @@ function Router({
|
|
|
582
582
|
key = "default"
|
|
583
583
|
} = locationProp;
|
|
584
584
|
let locationContext = React.useMemo(() => {
|
|
585
|
-
let trailingPathname =
|
|
585
|
+
let trailingPathname = _chunkOAO2BCWAjs.stripBasename.call(void 0, pathname, basename);
|
|
586
586
|
if (trailingPathname == null) {
|
|
587
587
|
return null;
|
|
588
588
|
}
|
|
@@ -597,27 +597,27 @@ function Router({
|
|
|
597
597
|
navigationType
|
|
598
598
|
};
|
|
599
599
|
}, [basename, pathname, search, hash, state, key, navigationType]);
|
|
600
|
-
|
|
600
|
+
_chunkOAO2BCWAjs.warning.call(void 0,
|
|
601
601
|
locationContext != null,
|
|
602
602
|
`<Router basename="${basename}"> is not able to match the URL "${pathname}${search}${hash}" because it does not start with the basename, so the <Router> won't render anything.`
|
|
603
603
|
);
|
|
604
604
|
if (locationContext == null) {
|
|
605
605
|
return null;
|
|
606
606
|
}
|
|
607
|
-
return /* @__PURE__ */ React.createElement(
|
|
607
|
+
return /* @__PURE__ */ React.createElement(_chunkOAO2BCWAjs.NavigationContext.Provider, { value: navigationContext }, /* @__PURE__ */ React.createElement(_chunkOAO2BCWAjs.LocationContext.Provider, { children, value: locationContext }));
|
|
608
608
|
}
|
|
609
609
|
function Routes({
|
|
610
610
|
children,
|
|
611
611
|
location
|
|
612
612
|
}) {
|
|
613
|
-
return
|
|
613
|
+
return _chunkOAO2BCWAjs.useRoutes.call(void 0, createRoutesFromChildren(children), location);
|
|
614
614
|
}
|
|
615
615
|
function Await({
|
|
616
616
|
children,
|
|
617
617
|
errorElement,
|
|
618
618
|
resolve
|
|
619
619
|
}) {
|
|
620
|
-
let dataRouterContext = React.useContext(
|
|
620
|
+
let dataRouterContext = React.useContext(_chunkOAO2BCWAjs.DataRouterContext);
|
|
621
621
|
return /* @__PURE__ */ React.createElement(
|
|
622
622
|
AwaitErrorBoundary,
|
|
623
623
|
{
|
|
@@ -681,10 +681,10 @@ var AwaitErrorBoundary = class extends React.Component {
|
|
|
681
681
|
throw promise._error;
|
|
682
682
|
}
|
|
683
683
|
if (status === 2 /* error */) {
|
|
684
|
-
return /* @__PURE__ */ React.createElement(
|
|
684
|
+
return /* @__PURE__ */ React.createElement(_chunkOAO2BCWAjs.AwaitContext.Provider, { value: promise, children: errorElement });
|
|
685
685
|
}
|
|
686
686
|
if (status === 1 /* success */) {
|
|
687
|
-
return /* @__PURE__ */ React.createElement(
|
|
687
|
+
return /* @__PURE__ */ React.createElement(_chunkOAO2BCWAjs.AwaitContext.Provider, { value: promise, children });
|
|
688
688
|
}
|
|
689
689
|
throw promise;
|
|
690
690
|
}
|
|
@@ -692,7 +692,7 @@ var AwaitErrorBoundary = class extends React.Component {
|
|
|
692
692
|
function ResolveAwait({
|
|
693
693
|
children
|
|
694
694
|
}) {
|
|
695
|
-
let data =
|
|
695
|
+
let data = _chunkOAO2BCWAjs.useAsyncValue.call(void 0, );
|
|
696
696
|
let toRender = typeof children === "function" ? children(data) : children;
|
|
697
697
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, toRender);
|
|
698
698
|
}
|
|
@@ -710,11 +710,11 @@ function createRoutesFromChildren(children, parentPath = []) {
|
|
|
710
710
|
);
|
|
711
711
|
return;
|
|
712
712
|
}
|
|
713
|
-
|
|
713
|
+
_chunkOAO2BCWAjs.invariant.call(void 0,
|
|
714
714
|
element.type === Route,
|
|
715
715
|
`[${typeof element.type === "string" ? element.type : element.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`
|
|
716
716
|
);
|
|
717
|
-
|
|
717
|
+
_chunkOAO2BCWAjs.invariant.call(void 0,
|
|
718
718
|
!element.props.index || !element.props.children,
|
|
719
719
|
"An index route cannot have child routes."
|
|
720
720
|
);
|
|
@@ -749,14 +749,14 @@ function createRoutesFromChildren(children, parentPath = []) {
|
|
|
749
749
|
}
|
|
750
750
|
var createRoutesFromElements = createRoutesFromChildren;
|
|
751
751
|
function renderMatches(matches) {
|
|
752
|
-
return
|
|
752
|
+
return _chunkOAO2BCWAjs._renderMatches.call(void 0, matches);
|
|
753
753
|
}
|
|
754
754
|
function useRouteComponentProps() {
|
|
755
755
|
return {
|
|
756
|
-
params:
|
|
757
|
-
loaderData:
|
|
758
|
-
actionData:
|
|
759
|
-
matches:
|
|
756
|
+
params: _chunkOAO2BCWAjs.useParams.call(void 0, ),
|
|
757
|
+
loaderData: _chunkOAO2BCWAjs.useLoaderData.call(void 0, ),
|
|
758
|
+
actionData: _chunkOAO2BCWAjs.useActionData.call(void 0, ),
|
|
759
|
+
matches: _chunkOAO2BCWAjs.useMatches.call(void 0, )
|
|
760
760
|
};
|
|
761
761
|
}
|
|
762
762
|
function WithComponentProps({
|
|
@@ -773,9 +773,9 @@ function withComponentProps(Component2) {
|
|
|
773
773
|
}
|
|
774
774
|
function useHydrateFallbackProps() {
|
|
775
775
|
return {
|
|
776
|
-
params:
|
|
777
|
-
loaderData:
|
|
778
|
-
actionData:
|
|
776
|
+
params: _chunkOAO2BCWAjs.useParams.call(void 0, ),
|
|
777
|
+
loaderData: _chunkOAO2BCWAjs.useLoaderData.call(void 0, ),
|
|
778
|
+
actionData: _chunkOAO2BCWAjs.useActionData.call(void 0, )
|
|
779
779
|
};
|
|
780
780
|
}
|
|
781
781
|
function WithHydrateFallbackProps({
|
|
@@ -792,10 +792,10 @@ function withHydrateFallbackProps(HydrateFallback) {
|
|
|
792
792
|
}
|
|
793
793
|
function useErrorBoundaryProps() {
|
|
794
794
|
return {
|
|
795
|
-
params:
|
|
796
|
-
loaderData:
|
|
797
|
-
actionData:
|
|
798
|
-
error:
|
|
795
|
+
params: _chunkOAO2BCWAjs.useParams.call(void 0, ),
|
|
796
|
+
loaderData: _chunkOAO2BCWAjs.useLoaderData.call(void 0, ),
|
|
797
|
+
actionData: _chunkOAO2BCWAjs.useActionData.call(void 0, ),
|
|
798
|
+
error: _chunkOAO2BCWAjs.useRouteError.call(void 0, )
|
|
799
799
|
};
|
|
800
800
|
}
|
|
801
801
|
function WithErrorBoundaryProps({
|
|
@@ -880,7 +880,7 @@ var supportedFormEncTypes = /* @__PURE__ */ new Set([
|
|
|
880
880
|
]);
|
|
881
881
|
function getFormEncType(encType) {
|
|
882
882
|
if (encType != null && !supportedFormEncTypes.has(encType)) {
|
|
883
|
-
|
|
883
|
+
_chunkOAO2BCWAjs.warning.call(void 0,
|
|
884
884
|
false,
|
|
885
885
|
`"${encType}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`
|
|
886
886
|
);
|
|
@@ -896,7 +896,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
896
896
|
let body;
|
|
897
897
|
if (isFormElement(target)) {
|
|
898
898
|
let attr = target.getAttribute("action");
|
|
899
|
-
action = attr ?
|
|
899
|
+
action = attr ? _chunkOAO2BCWAjs.stripBasename.call(void 0, attr, basename) : null;
|
|
900
900
|
method = target.getAttribute("method") || defaultMethod;
|
|
901
901
|
encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
|
|
902
902
|
formData = new FormData(target);
|
|
@@ -908,7 +908,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
908
908
|
);
|
|
909
909
|
}
|
|
910
910
|
let attr = target.getAttribute("formaction") || form.getAttribute("action");
|
|
911
|
-
action = attr ?
|
|
911
|
+
action = attr ? _chunkOAO2BCWAjs.stripBasename.call(void 0, attr, basename) : null;
|
|
912
912
|
method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
|
|
913
913
|
encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
|
|
914
914
|
formData = new FormData(form, target);
|
|
@@ -945,16 +945,16 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
|
|
|
945
945
|
try {
|
|
946
946
|
if (isBrowser) {
|
|
947
947
|
window.__reactRouterVersion = // @ts-expect-error
|
|
948
|
-
"0.0.0-experimental-
|
|
948
|
+
"0.0.0-experimental-3df673e";
|
|
949
949
|
}
|
|
950
950
|
} catch (e) {
|
|
951
951
|
}
|
|
952
952
|
function createBrowserRouter(routes, opts) {
|
|
953
|
-
return
|
|
953
|
+
return _chunkOAO2BCWAjs.createRouter.call(void 0, {
|
|
954
954
|
basename: _optionalChain([opts, 'optionalAccess', _21 => _21.basename]),
|
|
955
955
|
getContext: _optionalChain([opts, 'optionalAccess', _22 => _22.getContext]),
|
|
956
956
|
future: _optionalChain([opts, 'optionalAccess', _23 => _23.future]),
|
|
957
|
-
history:
|
|
957
|
+
history: _chunkOAO2BCWAjs.createBrowserHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _24 => _24.window]) }),
|
|
958
958
|
hydrationData: _optionalChain([opts, 'optionalAccess', _25 => _25.hydrationData]) || parseHydrationData(),
|
|
959
959
|
routes,
|
|
960
960
|
mapRouteProperties,
|
|
@@ -966,11 +966,11 @@ function createBrowserRouter(routes, opts) {
|
|
|
966
966
|
}).initialize();
|
|
967
967
|
}
|
|
968
968
|
function createHashRouter(routes, opts) {
|
|
969
|
-
return
|
|
969
|
+
return _chunkOAO2BCWAjs.createRouter.call(void 0, {
|
|
970
970
|
basename: _optionalChain([opts, 'optionalAccess', _30 => _30.basename]),
|
|
971
971
|
getContext: _optionalChain([opts, 'optionalAccess', _31 => _31.getContext]),
|
|
972
972
|
future: _optionalChain([opts, 'optionalAccess', _32 => _32.future]),
|
|
973
|
-
history:
|
|
973
|
+
history: _chunkOAO2BCWAjs.createHashHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _33 => _33.window]) }),
|
|
974
974
|
hydrationData: _optionalChain([opts, 'optionalAccess', _34 => _34.hydrationData]) || parseHydrationData(),
|
|
975
975
|
routes,
|
|
976
976
|
mapRouteProperties,
|
|
@@ -997,7 +997,7 @@ function deserializeErrors(errors) {
|
|
|
997
997
|
let serialized = {};
|
|
998
998
|
for (let [key, val] of entries) {
|
|
999
999
|
if (val && val.__type === "RouteErrorResponse") {
|
|
1000
|
-
serialized[key] = new (0,
|
|
1000
|
+
serialized[key] = new (0, _chunkOAO2BCWAjs.ErrorResponseImpl)(
|
|
1001
1001
|
val.status,
|
|
1002
1002
|
val.statusText,
|
|
1003
1003
|
val.data,
|
|
@@ -1033,7 +1033,7 @@ function BrowserRouter({
|
|
|
1033
1033
|
}) {
|
|
1034
1034
|
let historyRef = React2.useRef();
|
|
1035
1035
|
if (historyRef.current == null) {
|
|
1036
|
-
historyRef.current =
|
|
1036
|
+
historyRef.current = _chunkOAO2BCWAjs.createBrowserHistory.call(void 0, { window: window2, v5Compat: true });
|
|
1037
1037
|
}
|
|
1038
1038
|
let history = historyRef.current;
|
|
1039
1039
|
let [state, setStateImpl] = React2.useState({
|
|
@@ -1061,7 +1061,7 @@ function BrowserRouter({
|
|
|
1061
1061
|
function HashRouter({ basename, children, window: window2 }) {
|
|
1062
1062
|
let historyRef = React2.useRef();
|
|
1063
1063
|
if (historyRef.current == null) {
|
|
1064
|
-
historyRef.current =
|
|
1064
|
+
historyRef.current = _chunkOAO2BCWAjs.createHashHistory.call(void 0, { window: window2, v5Compat: true });
|
|
1065
1065
|
}
|
|
1066
1066
|
let history = historyRef.current;
|
|
1067
1067
|
let [state, setStateImpl] = React2.useState({
|
|
@@ -1130,7 +1130,7 @@ var Link = React2.forwardRef(
|
|
|
1130
1130
|
viewTransition,
|
|
1131
1131
|
...rest
|
|
1132
1132
|
}, forwardedRef) {
|
|
1133
|
-
let { basename } = React2.useContext(
|
|
1133
|
+
let { basename } = React2.useContext(_chunkOAO2BCWAjs.NavigationContext);
|
|
1134
1134
|
let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX.test(to);
|
|
1135
1135
|
let absoluteHref;
|
|
1136
1136
|
let isExternal = false;
|
|
@@ -1140,22 +1140,22 @@ var Link = React2.forwardRef(
|
|
|
1140
1140
|
try {
|
|
1141
1141
|
let currentUrl = new URL(window.location.href);
|
|
1142
1142
|
let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
|
|
1143
|
-
let path =
|
|
1143
|
+
let path = _chunkOAO2BCWAjs.stripBasename.call(void 0, targetUrl.pathname, basename);
|
|
1144
1144
|
if (targetUrl.origin === currentUrl.origin && path != null) {
|
|
1145
1145
|
to = path + targetUrl.search + targetUrl.hash;
|
|
1146
1146
|
} else {
|
|
1147
1147
|
isExternal = true;
|
|
1148
1148
|
}
|
|
1149
1149
|
} catch (e) {
|
|
1150
|
-
|
|
1150
|
+
_chunkOAO2BCWAjs.warning.call(void 0,
|
|
1151
1151
|
false,
|
|
1152
1152
|
`<Link to="${to}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
1153
1153
|
);
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
1156
|
}
|
|
1157
|
-
let href =
|
|
1158
|
-
let [shouldPrefetch, prefetchRef, prefetchHandlers] =
|
|
1157
|
+
let href = _chunkOAO2BCWAjs.useHref.call(void 0, to, { relative });
|
|
1158
|
+
let [shouldPrefetch, prefetchRef, prefetchHandlers] = _chunkOAO2BCWAjs.usePrefetchBehavior.call(void 0,
|
|
1159
1159
|
prefetch,
|
|
1160
1160
|
rest
|
|
1161
1161
|
);
|
|
@@ -1182,13 +1182,13 @@ var Link = React2.forwardRef(
|
|
|
1182
1182
|
...prefetchHandlers,
|
|
1183
1183
|
href: absoluteHref || href,
|
|
1184
1184
|
onClick: isExternal || reloadDocument ? onClick : handleClick,
|
|
1185
|
-
ref:
|
|
1185
|
+
ref: _chunkOAO2BCWAjs.mergeRefs.call(void 0, forwardedRef, prefetchRef),
|
|
1186
1186
|
target,
|
|
1187
1187
|
"data-discover": !isAbsolute && discover === "render" ? "true" : void 0
|
|
1188
1188
|
}
|
|
1189
1189
|
)
|
|
1190
1190
|
);
|
|
1191
|
-
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, link, /* @__PURE__ */ React2.createElement(
|
|
1191
|
+
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, link, /* @__PURE__ */ React2.createElement(_chunkOAO2BCWAjs.PrefetchPageLinks, { page: href })) : link;
|
|
1192
1192
|
}
|
|
1193
1193
|
);
|
|
1194
1194
|
Link.displayName = "Link";
|
|
@@ -1204,10 +1204,10 @@ var NavLink = React2.forwardRef(
|
|
|
1204
1204
|
children,
|
|
1205
1205
|
...rest
|
|
1206
1206
|
}, ref) {
|
|
1207
|
-
let path =
|
|
1208
|
-
let location =
|
|
1209
|
-
let routerState = React2.useContext(
|
|
1210
|
-
let { navigator, basename } = React2.useContext(
|
|
1207
|
+
let path = _chunkOAO2BCWAjs.useResolvedPath.call(void 0, to, { relative: rest.relative });
|
|
1208
|
+
let location = _chunkOAO2BCWAjs.useLocation.call(void 0, );
|
|
1209
|
+
let routerState = React2.useContext(_chunkOAO2BCWAjs.DataRouterStateContext);
|
|
1210
|
+
let { navigator, basename } = React2.useContext(_chunkOAO2BCWAjs.NavigationContext);
|
|
1211
1211
|
let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1212
1212
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1213
1213
|
useViewTransitionState(path) && viewTransition === true;
|
|
@@ -1220,7 +1220,7 @@ var NavLink = React2.forwardRef(
|
|
|
1220
1220
|
toPathname = toPathname.toLowerCase();
|
|
1221
1221
|
}
|
|
1222
1222
|
if (nextLocationPathname && basename) {
|
|
1223
|
-
nextLocationPathname =
|
|
1223
|
+
nextLocationPathname = _chunkOAO2BCWAjs.stripBasename.call(void 0, nextLocationPathname, basename) || nextLocationPathname;
|
|
1224
1224
|
}
|
|
1225
1225
|
const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
|
|
1226
1226
|
let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
|
|
@@ -1315,10 +1315,10 @@ function ScrollRestoration({
|
|
|
1315
1315
|
storageKey,
|
|
1316
1316
|
...props
|
|
1317
1317
|
}) {
|
|
1318
|
-
let remixContext = React2.useContext(
|
|
1319
|
-
let { basename } = React2.useContext(
|
|
1320
|
-
let location =
|
|
1321
|
-
let matches =
|
|
1318
|
+
let remixContext = React2.useContext(_chunkOAO2BCWAjs.FrameworkContext);
|
|
1319
|
+
let { basename } = React2.useContext(_chunkOAO2BCWAjs.NavigationContext);
|
|
1320
|
+
let location = _chunkOAO2BCWAjs.useLocation.call(void 0, );
|
|
1321
|
+
let matches = _chunkOAO2BCWAjs.useMatches.call(void 0, );
|
|
1322
1322
|
useScrollRestoration({ getKey, storageKey });
|
|
1323
1323
|
let ssrKey = React2.useMemo(
|
|
1324
1324
|
() => {
|
|
@@ -1372,13 +1372,13 @@ function getDataRouterConsoleError(hookName) {
|
|
|
1372
1372
|
return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1373
1373
|
}
|
|
1374
1374
|
function useDataRouterContext(hookName) {
|
|
1375
|
-
let ctx = React2.useContext(
|
|
1376
|
-
|
|
1375
|
+
let ctx = React2.useContext(_chunkOAO2BCWAjs.DataRouterContext);
|
|
1376
|
+
_chunkOAO2BCWAjs.invariant.call(void 0, ctx, getDataRouterConsoleError(hookName));
|
|
1377
1377
|
return ctx;
|
|
1378
1378
|
}
|
|
1379
1379
|
function useDataRouterState(hookName) {
|
|
1380
|
-
let state = React2.useContext(
|
|
1381
|
-
|
|
1380
|
+
let state = React2.useContext(_chunkOAO2BCWAjs.DataRouterStateContext);
|
|
1381
|
+
_chunkOAO2BCWAjs.invariant.call(void 0, state, getDataRouterConsoleError(hookName));
|
|
1382
1382
|
return state;
|
|
1383
1383
|
}
|
|
1384
1384
|
function useLinkClickHandler(to, {
|
|
@@ -1389,14 +1389,14 @@ function useLinkClickHandler(to, {
|
|
|
1389
1389
|
relative,
|
|
1390
1390
|
viewTransition
|
|
1391
1391
|
} = {}) {
|
|
1392
|
-
let navigate =
|
|
1393
|
-
let location =
|
|
1394
|
-
let path =
|
|
1392
|
+
let navigate = _chunkOAO2BCWAjs.useNavigate.call(void 0, );
|
|
1393
|
+
let location = _chunkOAO2BCWAjs.useLocation.call(void 0, );
|
|
1394
|
+
let path = _chunkOAO2BCWAjs.useResolvedPath.call(void 0, to, { relative });
|
|
1395
1395
|
return React2.useCallback(
|
|
1396
1396
|
(event) => {
|
|
1397
1397
|
if (shouldProcessLinkClick(event, target)) {
|
|
1398
1398
|
event.preventDefault();
|
|
1399
|
-
let replace = replaceProp !== void 0 ? replaceProp :
|
|
1399
|
+
let replace = replaceProp !== void 0 ? replaceProp : _chunkOAO2BCWAjs.createPath.call(void 0, location) === _chunkOAO2BCWAjs.createPath.call(void 0, path);
|
|
1400
1400
|
navigate(to, {
|
|
1401
1401
|
replace,
|
|
1402
1402
|
state,
|
|
@@ -1421,13 +1421,13 @@ function useLinkClickHandler(to, {
|
|
|
1421
1421
|
);
|
|
1422
1422
|
}
|
|
1423
1423
|
function useSearchParams(defaultInit) {
|
|
1424
|
-
|
|
1424
|
+
_chunkOAO2BCWAjs.warning.call(void 0,
|
|
1425
1425
|
typeof URLSearchParams !== "undefined",
|
|
1426
1426
|
`You cannot use the \`useSearchParams\` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.`
|
|
1427
1427
|
);
|
|
1428
1428
|
let defaultSearchParamsRef = React2.useRef(createSearchParams(defaultInit));
|
|
1429
1429
|
let hasSetSearchParamsRef = React2.useRef(false);
|
|
1430
|
-
let location =
|
|
1430
|
+
let location = _chunkOAO2BCWAjs.useLocation.call(void 0, );
|
|
1431
1431
|
let searchParams = React2.useMemo(
|
|
1432
1432
|
() => (
|
|
1433
1433
|
// Only merge in the defaults if we haven't yet called setSearchParams.
|
|
@@ -1440,7 +1440,7 @@ function useSearchParams(defaultInit) {
|
|
|
1440
1440
|
),
|
|
1441
1441
|
[location.search]
|
|
1442
1442
|
);
|
|
1443
|
-
let navigate =
|
|
1443
|
+
let navigate = _chunkOAO2BCWAjs.useNavigate.call(void 0, );
|
|
1444
1444
|
let setSearchParams = React2.useCallback(
|
|
1445
1445
|
(nextInit, navigateOptions) => {
|
|
1446
1446
|
const newSearchParams = createSearchParams(
|
|
@@ -1457,8 +1457,8 @@ var fetcherId = 0;
|
|
|
1457
1457
|
var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
|
|
1458
1458
|
function useSubmit() {
|
|
1459
1459
|
let { router } = useDataRouterContext("useSubmit" /* UseSubmit */);
|
|
1460
|
-
let { basename } = React2.useContext(
|
|
1461
|
-
let currentRouteId =
|
|
1460
|
+
let { basename } = React2.useContext(_chunkOAO2BCWAjs.NavigationContext);
|
|
1461
|
+
let currentRouteId = _chunkOAO2BCWAjs.useRouteId.call(void 0, );
|
|
1462
1462
|
return React2.useCallback(
|
|
1463
1463
|
async (target, options = {}) => {
|
|
1464
1464
|
let { action, method, encType, formData, body } = getFormSubmissionInfo(
|
|
@@ -1494,12 +1494,12 @@ function useSubmit() {
|
|
|
1494
1494
|
);
|
|
1495
1495
|
}
|
|
1496
1496
|
function useFormAction(action, { relative } = {}) {
|
|
1497
|
-
let { basename } = React2.useContext(
|
|
1498
|
-
let routeContext = React2.useContext(
|
|
1499
|
-
|
|
1497
|
+
let { basename } = React2.useContext(_chunkOAO2BCWAjs.NavigationContext);
|
|
1498
|
+
let routeContext = React2.useContext(_chunkOAO2BCWAjs.RouteContext);
|
|
1499
|
+
_chunkOAO2BCWAjs.invariant.call(void 0, routeContext, "useFormAction must be used inside a RouteContext");
|
|
1500
1500
|
let [match] = routeContext.matches.slice(-1);
|
|
1501
|
-
let path = { ...
|
|
1502
|
-
let location =
|
|
1501
|
+
let path = { ..._chunkOAO2BCWAjs.useResolvedPath.call(void 0, action ? action : ".", { relative }) };
|
|
1502
|
+
let location = _chunkOAO2BCWAjs.useLocation.call(void 0, );
|
|
1503
1503
|
if (action == null) {
|
|
1504
1504
|
path.search = location.search;
|
|
1505
1505
|
let params = new URLSearchParams(path.search);
|
|
@@ -1516,21 +1516,21 @@ function useFormAction(action, { relative } = {}) {
|
|
|
1516
1516
|
path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
|
|
1517
1517
|
}
|
|
1518
1518
|
if (basename !== "/") {
|
|
1519
|
-
path.pathname = path.pathname === "/" ? basename :
|
|
1519
|
+
path.pathname = path.pathname === "/" ? basename : _chunkOAO2BCWAjs.joinPaths.call(void 0, [basename, path.pathname]);
|
|
1520
1520
|
}
|
|
1521
|
-
return
|
|
1521
|
+
return _chunkOAO2BCWAjs.createPath.call(void 0, path);
|
|
1522
1522
|
}
|
|
1523
1523
|
function useFetcher({
|
|
1524
1524
|
key
|
|
1525
1525
|
} = {}) {
|
|
1526
1526
|
let { router } = useDataRouterContext("useFetcher" /* UseFetcher */);
|
|
1527
1527
|
let state = useDataRouterState("useFetcher" /* UseFetcher */);
|
|
1528
|
-
let fetcherData = React2.useContext(
|
|
1529
|
-
let route = React2.useContext(
|
|
1528
|
+
let fetcherData = React2.useContext(_chunkOAO2BCWAjs.FetchersContext);
|
|
1529
|
+
let route = React2.useContext(_chunkOAO2BCWAjs.RouteContext);
|
|
1530
1530
|
let routeId = _optionalChain([route, 'access', _42 => _42.matches, 'access', _43 => _43[route.matches.length - 1], 'optionalAccess', _44 => _44.route, 'access', _45 => _45.id]);
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1531
|
+
_chunkOAO2BCWAjs.invariant.call(void 0, fetcherData, `useFetcher must be used inside a FetchersContext`);
|
|
1532
|
+
_chunkOAO2BCWAjs.invariant.call(void 0, route, `useFetcher must be used inside a RouteContext`);
|
|
1533
|
+
_chunkOAO2BCWAjs.invariant.call(void 0,
|
|
1534
1534
|
routeId != null,
|
|
1535
1535
|
`useFetcher can only be used on routes that contain a unique "id"`
|
|
1536
1536
|
);
|
|
@@ -1545,7 +1545,7 @@ function useFetcher({
|
|
|
1545
1545
|
}, [router, fetcherKey]);
|
|
1546
1546
|
let load = React2.useCallback(
|
|
1547
1547
|
async (href, opts) => {
|
|
1548
|
-
|
|
1548
|
+
_chunkOAO2BCWAjs.invariant.call(void 0, routeId, "No routeId available for fetcher.load()");
|
|
1549
1549
|
await router.fetch(fetcherKey, routeId, href, opts);
|
|
1550
1550
|
},
|
|
1551
1551
|
[fetcherKey, routeId, router]
|
|
@@ -1571,7 +1571,7 @@ function useFetcher({
|
|
|
1571
1571
|
FetcherForm2.displayName = "fetcher.Form";
|
|
1572
1572
|
return FetcherForm2;
|
|
1573
1573
|
}, [fetcherKey]);
|
|
1574
|
-
let fetcher = state.fetchers.get(fetcherKey) ||
|
|
1574
|
+
let fetcher = state.fetchers.get(fetcherKey) || _chunkOAO2BCWAjs.IDLE_FETCHER;
|
|
1575
1575
|
let data = fetcherData.get(fetcherKey);
|
|
1576
1576
|
let fetcherWithComponents = React2.useMemo(
|
|
1577
1577
|
() => ({
|
|
@@ -1602,7 +1602,7 @@ function getScrollRestorationKey(location, matches, basename, getKey) {
|
|
|
1602
1602
|
key = getKey(
|
|
1603
1603
|
{
|
|
1604
1604
|
...location,
|
|
1605
|
-
pathname:
|
|
1605
|
+
pathname: _chunkOAO2BCWAjs.stripBasename.call(void 0, location.pathname, basename) || location.pathname
|
|
1606
1606
|
},
|
|
1607
1607
|
matches
|
|
1608
1608
|
);
|
|
@@ -1623,10 +1623,10 @@ function useScrollRestoration({
|
|
|
1623
1623
|
let { restoreScrollPosition, preventScrollReset } = useDataRouterState(
|
|
1624
1624
|
"useScrollRestoration" /* UseScrollRestoration */
|
|
1625
1625
|
);
|
|
1626
|
-
let { basename } = React2.useContext(
|
|
1627
|
-
let location =
|
|
1628
|
-
let matches =
|
|
1629
|
-
let navigation =
|
|
1626
|
+
let { basename } = React2.useContext(_chunkOAO2BCWAjs.NavigationContext);
|
|
1627
|
+
let location = _chunkOAO2BCWAjs.useLocation.call(void 0, );
|
|
1628
|
+
let matches = _chunkOAO2BCWAjs.useMatches.call(void 0, );
|
|
1629
|
+
let navigation = _chunkOAO2BCWAjs.useNavigation.call(void 0, );
|
|
1630
1630
|
React2.useEffect(() => {
|
|
1631
1631
|
window.history.scrollRestoration = "manual";
|
|
1632
1632
|
return () => {
|
|
@@ -1645,7 +1645,7 @@ function useScrollRestoration({
|
|
|
1645
1645
|
JSON.stringify(savedScrollPositions)
|
|
1646
1646
|
);
|
|
1647
1647
|
} catch (error) {
|
|
1648
|
-
|
|
1648
|
+
_chunkOAO2BCWAjs.warning.call(void 0,
|
|
1649
1649
|
false,
|
|
1650
1650
|
`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${error}).`
|
|
1651
1651
|
);
|
|
@@ -1692,7 +1692,7 @@ function useScrollRestoration({
|
|
|
1692
1692
|
}
|
|
1693
1693
|
}
|
|
1694
1694
|
} catch (e2) {
|
|
1695
|
-
|
|
1695
|
+
_chunkOAO2BCWAjs.warning.call(void 0,
|
|
1696
1696
|
false,
|
|
1697
1697
|
`"${location.hash.slice(
|
|
1698
1698
|
1
|
|
@@ -1730,7 +1730,7 @@ function usePrompt({
|
|
|
1730
1730
|
when,
|
|
1731
1731
|
message
|
|
1732
1732
|
}) {
|
|
1733
|
-
let blocker =
|
|
1733
|
+
let blocker = _chunkOAO2BCWAjs.useBlocker.call(void 0, when);
|
|
1734
1734
|
React2.useEffect(() => {
|
|
1735
1735
|
if (blocker.state === "blocked") {
|
|
1736
1736
|
let proceed = window.confirm(message);
|
|
@@ -1748,21 +1748,21 @@ function usePrompt({
|
|
|
1748
1748
|
}, [blocker, when]);
|
|
1749
1749
|
}
|
|
1750
1750
|
function useViewTransitionState(to, { relative } = {}) {
|
|
1751
|
-
let vtContext = React2.useContext(
|
|
1752
|
-
|
|
1751
|
+
let vtContext = React2.useContext(_chunkOAO2BCWAjs.ViewTransitionContext);
|
|
1752
|
+
_chunkOAO2BCWAjs.invariant.call(void 0,
|
|
1753
1753
|
vtContext != null,
|
|
1754
1754
|
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1755
1755
|
);
|
|
1756
1756
|
let { basename } = useDataRouterContext(
|
|
1757
1757
|
"useViewTransitionState" /* useViewTransitionState */
|
|
1758
1758
|
);
|
|
1759
|
-
let path =
|
|
1759
|
+
let path = _chunkOAO2BCWAjs.useResolvedPath.call(void 0, to, { relative });
|
|
1760
1760
|
if (!vtContext.isTransitioning) {
|
|
1761
1761
|
return false;
|
|
1762
1762
|
}
|
|
1763
|
-
let currentPath =
|
|
1764
|
-
let nextPath =
|
|
1765
|
-
return
|
|
1763
|
+
let currentPath = _chunkOAO2BCWAjs.stripBasename.call(void 0, vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
|
|
1764
|
+
let nextPath = _chunkOAO2BCWAjs.stripBasename.call(void 0, vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
|
|
1765
|
+
return _chunkOAO2BCWAjs.matchPath.call(void 0, path.pathname, nextPath) != null || _chunkOAO2BCWAjs.matchPath.call(void 0, path.pathname, currentPath) != null;
|
|
1766
1766
|
}
|
|
1767
1767
|
|
|
1768
1768
|
// lib/dom/server.tsx
|
|
@@ -1773,7 +1773,7 @@ function StaticRouter({
|
|
|
1773
1773
|
location: locationProp = "/"
|
|
1774
1774
|
}) {
|
|
1775
1775
|
if (typeof locationProp === "string") {
|
|
1776
|
-
locationProp =
|
|
1776
|
+
locationProp = _chunkOAO2BCWAjs.parsePath.call(void 0, locationProp);
|
|
1777
1777
|
}
|
|
1778
1778
|
let action = "POP" /* Pop */;
|
|
1779
1779
|
let location = {
|
|
@@ -1802,7 +1802,7 @@ function StaticRouterProvider({
|
|
|
1802
1802
|
hydrate = true,
|
|
1803
1803
|
nonce
|
|
1804
1804
|
}) {
|
|
1805
|
-
|
|
1805
|
+
_chunkOAO2BCWAjs.invariant.call(void 0,
|
|
1806
1806
|
router && context,
|
|
1807
1807
|
"You must provide `router` and `context` to <StaticRouterProvider>"
|
|
1808
1808
|
);
|
|
@@ -1825,7 +1825,7 @@ function StaticRouterProvider({
|
|
|
1825
1825
|
hydrateScript = `window.__staticRouterHydrationData = JSON.parse(${json});`;
|
|
1826
1826
|
}
|
|
1827
1827
|
let { state } = dataRouterContext.router;
|
|
1828
|
-
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
|
1828
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(_chunkOAO2BCWAjs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React3.createElement(_chunkOAO2BCWAjs.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React3.createElement(_chunkOAO2BCWAjs.FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ React3.createElement(_chunkOAO2BCWAjs.ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ React3.createElement(
|
|
1829
1829
|
Router,
|
|
1830
1830
|
{
|
|
1831
1831
|
basename: dataRouterContext.basename,
|
|
@@ -1856,14 +1856,14 @@ function DataRoutes2({
|
|
|
1856
1856
|
future,
|
|
1857
1857
|
state
|
|
1858
1858
|
}) {
|
|
1859
|
-
return
|
|
1859
|
+
return _chunkOAO2BCWAjs.useRoutesImpl.call(void 0, routes, void 0, state, void 0, future);
|
|
1860
1860
|
}
|
|
1861
1861
|
function serializeErrors(errors) {
|
|
1862
1862
|
if (!errors) return null;
|
|
1863
1863
|
let entries = Object.entries(errors);
|
|
1864
1864
|
let serialized = {};
|
|
1865
1865
|
for (let [key, val] of entries) {
|
|
1866
|
-
if (
|
|
1866
|
+
if (_chunkOAO2BCWAjs.isRouteErrorResponse.call(void 0, val)) {
|
|
1867
1867
|
serialized[key] = { ...val, __type: "RouteErrorResponse" };
|
|
1868
1868
|
} else if (val instanceof Error) {
|
|
1869
1869
|
serialized[key] = {
|
|
@@ -1913,14 +1913,14 @@ function getStatelessNavigator() {
|
|
|
1913
1913
|
};
|
|
1914
1914
|
}
|
|
1915
1915
|
function createStaticHandler2(routes, opts) {
|
|
1916
|
-
return
|
|
1916
|
+
return _chunkOAO2BCWAjs.createStaticHandler.call(void 0, routes, {
|
|
1917
1917
|
...opts,
|
|
1918
1918
|
mapRouteProperties
|
|
1919
1919
|
});
|
|
1920
1920
|
}
|
|
1921
1921
|
function createStaticRouter(routes, context, opts = {}) {
|
|
1922
1922
|
let manifest = {};
|
|
1923
|
-
let dataRoutes =
|
|
1923
|
+
let dataRoutes = _chunkOAO2BCWAjs.convertRoutesToDataRoutes.call(void 0,
|
|
1924
1924
|
routes,
|
|
1925
1925
|
mapRouteProperties,
|
|
1926
1926
|
void 0,
|
|
@@ -1953,7 +1953,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1953
1953
|
actionData: context.actionData,
|
|
1954
1954
|
errors: context.errors,
|
|
1955
1955
|
initialized: true,
|
|
1956
|
-
navigation:
|
|
1956
|
+
navigation: _chunkOAO2BCWAjs.IDLE_NAVIGATION,
|
|
1957
1957
|
restoreScrollPosition: null,
|
|
1958
1958
|
preventScrollReset: false,
|
|
1959
1959
|
revalidation: "idle",
|
|
@@ -1988,7 +1988,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1988
1988
|
createHref,
|
|
1989
1989
|
encodeLocation,
|
|
1990
1990
|
getFetcher() {
|
|
1991
|
-
return
|
|
1991
|
+
return _chunkOAO2BCWAjs.IDLE_FETCHER;
|
|
1992
1992
|
},
|
|
1993
1993
|
deleteFetcher() {
|
|
1994
1994
|
throw msg("deleteFetcher");
|
|
@@ -2000,7 +2000,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
2000
2000
|
throw msg("dispose");
|
|
2001
2001
|
},
|
|
2002
2002
|
getBlocker() {
|
|
2003
|
-
return
|
|
2003
|
+
return _chunkOAO2BCWAjs.IDLE_BLOCKER;
|
|
2004
2004
|
},
|
|
2005
2005
|
deleteBlocker() {
|
|
2006
2006
|
throw msg("deleteBlocker");
|
|
@@ -2018,10 +2018,10 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
2018
2018
|
};
|
|
2019
2019
|
}
|
|
2020
2020
|
function createHref(to) {
|
|
2021
|
-
return typeof to === "string" ? to :
|
|
2021
|
+
return typeof to === "string" ? to : _chunkOAO2BCWAjs.createPath.call(void 0, to);
|
|
2022
2022
|
}
|
|
2023
2023
|
function encodeLocation(to) {
|
|
2024
|
-
let href = typeof to === "string" ? to :
|
|
2024
|
+
let href = typeof to === "string" ? to : _chunkOAO2BCWAjs.createPath.call(void 0, to);
|
|
2025
2025
|
href = href.replace(/ $/, "%20");
|
|
2026
2026
|
let encoded = ABSOLUTE_URL_REGEX2.test(href) ? new URL(href) : new URL(href, "http://localhost");
|
|
2027
2027
|
return {
|