react-router 7.2.0-pre.0 → 7.2.0-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 +34 -0
- package/dist/development/{chunk-HLU4BUUT.mjs → chunk-FXE4ZOSB.mjs} +41 -22
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.d.ts +2 -2
- package/dist/development/dom-export.js +1 -1
- package/dist/development/dom-export.mjs +2 -2
- package/dist/{production/fog-of-war-Ax4Jg2xL.d.ts → development/fog-of-war-rn7nVSAv.d.ts} +1 -1
- package/dist/development/{fog-of-war-Cyo_TZuh.d.mts → fog-of-war-yKFj2vdd.d.mts} +1 -1
- package/dist/development/index.d.mts +37 -6
- package/dist/development/index.d.ts +37 -6
- package/dist/development/index.js +42 -22
- package/dist/development/index.mjs +4 -2
- package/dist/development/lib/types/route-module.d.mts +1 -1
- package/dist/development/lib/types/route-module.d.ts +1 -1
- package/dist/development/lib/types/route-module.js +1 -1
- package/dist/development/lib/types/route-module.mjs +1 -1
- package/dist/development/{route-data-DQbTMaUY.d.ts → route-data-CfLfC_Bh.d.mts} +1 -1
- package/dist/{production/route-data-DQbTMaUY.d.mts → development/route-data-CfLfC_Bh.d.ts} +1 -1
- package/dist/production/{chunk-IA3JXIZE.mjs → chunk-3BG6WSY4.mjs} +41 -22
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.d.ts +2 -2
- package/dist/production/dom-export.js +1 -1
- package/dist/production/dom-export.mjs +2 -2
- package/dist/{development/fog-of-war-Ax4Jg2xL.d.ts → production/fog-of-war-rn7nVSAv.d.ts} +1 -1
- package/dist/production/{fog-of-war-Cyo_TZuh.d.mts → fog-of-war-yKFj2vdd.d.mts} +1 -1
- package/dist/production/index.d.mts +37 -6
- package/dist/production/index.d.ts +37 -6
- package/dist/production/index.js +42 -22
- package/dist/production/index.mjs +4 -2
- package/dist/production/lib/types/route-module.d.mts +1 -1
- package/dist/production/lib/types/route-module.d.ts +1 -1
- package/dist/production/lib/types/route-module.js +1 -1
- package/dist/production/lib/types/route-module.mjs +1 -1
- package/dist/production/{route-data-DQbTMaUY.d.ts → route-data-CfLfC_Bh.d.mts} +1 -1
- package/dist/{development/route-data-DQbTMaUY.d.mts → production/route-data-CfLfC_Bh.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.2.0-pre.
|
|
2
|
+
* react-router v7.2.0-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -73,6 +73,7 @@ import {
|
|
|
73
73
|
generatePath,
|
|
74
74
|
getPatchRoutesOnNavigationFunction,
|
|
75
75
|
getSingleFetchDataStrategy,
|
|
76
|
+
href,
|
|
76
77
|
invariant,
|
|
77
78
|
isCookie,
|
|
78
79
|
isRouteErrorResponse,
|
|
@@ -120,7 +121,7 @@ import {
|
|
|
120
121
|
useSearchParams,
|
|
121
122
|
useSubmit,
|
|
122
123
|
useViewTransitionState
|
|
123
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-FXE4ZOSB.mjs";
|
|
124
125
|
export {
|
|
125
126
|
Await,
|
|
126
127
|
BrowserRouter,
|
|
@@ -190,6 +191,7 @@ export {
|
|
|
190
191
|
createStaticRouter,
|
|
191
192
|
data,
|
|
192
193
|
generatePath,
|
|
194
|
+
href,
|
|
193
195
|
isCookie,
|
|
194
196
|
isRouteErrorResponse,
|
|
195
197
|
isSession,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { az as LinkDescriptor, aw as MetaDescriptor, aN as ServerDataFrom, aO as ClientDataFrom, aP as Func, E as Equal, aQ as Pretty } from '../../route-data-CfLfC_Bh.mjs';
|
|
2
2
|
import { A as AppLoadContext } from '../../data-CQbyyGzl.mjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { az as LinkDescriptor, aw as MetaDescriptor, aN as ServerDataFrom, aO as ClientDataFrom, aP as Func, E as Equal, aQ as Pretty } from '../../route-data-CfLfC_Bh.js';
|
|
2
2
|
import { A as AppLoadContext } from '../../data-CQbyyGzl.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
@@ -1576,4 +1576,4 @@ type ServerDataFrom<T> = ServerData<DataFrom<T>>;
|
|
|
1576
1576
|
type ClientDataFrom<T> = ClientData<DataFrom<T>>;
|
|
1577
1577
|
type SerializeFrom<T> = T extends (...args: infer Args) => unknown ? Args extends [ClientLoaderFunctionArgs | ClientActionFunctionArgs] ? ClientDataFrom<T> : ServerDataFrom<T> : T;
|
|
1578
1578
|
|
|
1579
|
-
export { type
|
|
1579
|
+
export { type HTMLFormMethod as $, type ActionFunctionArgs as A, type BlockerFunction as B, type CreateStaticHandlerOptions as C, type DataStrategyFunction as D, type Equal as E, type FutureConfig as F, type GetScrollPositionFunction as G, type HydrationState as H, type InitialEntry as I, type RouterSubscriber as J, type RouterNavigateOptions as K, type LoaderFunctionArgs as L, type MetaFunction as M, type NavigateOptions as N, type RouterFetchOptions as O, type ParamParseKey as P, type DataStrategyFunctionArgs as Q, type RouteModules as R, type ServerRouteModule as S, type To as T, type UIMatch as U, type DataStrategyMatch as V, type DataStrategyResult as W, DataWithResponseInit as X, type ErrorResponse as Y, type FormEncType as Z, type FormMethod as _, type Router as a, type LazyRouteFunction as a0, type PathParam as a1, type RedirectFunction as a2, type ShouldRevalidateFunction as a3, type ShouldRevalidateFunctionArgs as a4, createPath as a5, parsePath as a6, IDLE_NAVIGATION as a7, IDLE_FETCHER as a8, IDLE_BLOCKER as a9, createBrowserHistory as aA, invariant as aB, createRouter as aC, ErrorResponseImpl as aD, DataRouterContext as aE, DataRouterStateContext as aF, FetchersContext as aG, LocationContext as aH, NavigationContext as aI, RouteContext as aJ, ViewTransitionContext as aK, type RouteModule as aL, type History as aM, type ServerDataFrom as aN, type ClientDataFrom as aO, type Func as aP, type Pretty as aQ, data as aa, generatePath as ab, isRouteErrorResponse as ac, matchPath as ad, matchRoutes as ae, redirect as af, redirectDocument as ag, replace as ah, resolvePath as ai, type DataRouteMatch as aj, type DataRouteObject as ak, type Navigator as al, type PatchRoutesOnNavigationFunction as am, type PatchRoutesOnNavigationFunctionArgs as an, type RouteMatch as ao, type ClientActionFunction as ap, type ClientActionFunctionArgs as aq, type ClientLoaderFunction as ar, type ClientLoaderFunctionArgs as as, type HeadersArgs as at, type HeadersFunction as au, type MetaArgs as av, type MetaDescriptor as aw, type PageLinkDescriptor as ax, type HtmlLinkDescriptor as ay, type LinkDescriptor as az, type RouteManifest as b, type RelativeRoutingType as c, type Location as d, Action as e, type Path as f, type PathPattern as g, type PathMatch as h, type Params as i, type RouteObject as j, type Navigation as k, type RevalidationState as l, type SerializeFrom as m, type Blocker as n, type StaticHandlerContext as o, type StaticHandler as p, type IndexRouteObject as q, type LoaderFunction as r, type ActionFunction as s, type LinksFunction as t, type NonIndexRouteObject as u, type RouterState as v, type GetScrollRestorationKeyFunction as w, type Fetcher as x, type NavigationStates as y, type RouterInit as z };
|
|
@@ -1576,4 +1576,4 @@ type ServerDataFrom<T> = ServerData<DataFrom<T>>;
|
|
|
1576
1576
|
type ClientDataFrom<T> = ClientData<DataFrom<T>>;
|
|
1577
1577
|
type SerializeFrom<T> = T extends (...args: infer Args) => unknown ? Args extends [ClientLoaderFunctionArgs | ClientActionFunctionArgs] ? ClientDataFrom<T> : ServerDataFrom<T> : T;
|
|
1578
1578
|
|
|
1579
|
-
export { type
|
|
1579
|
+
export { type HTMLFormMethod as $, type ActionFunctionArgs as A, type BlockerFunction as B, type CreateStaticHandlerOptions as C, type DataStrategyFunction as D, type Equal as E, type FutureConfig as F, type GetScrollPositionFunction as G, type HydrationState as H, type InitialEntry as I, type RouterSubscriber as J, type RouterNavigateOptions as K, type LoaderFunctionArgs as L, type MetaFunction as M, type NavigateOptions as N, type RouterFetchOptions as O, type ParamParseKey as P, type DataStrategyFunctionArgs as Q, type RouteModules as R, type ServerRouteModule as S, type To as T, type UIMatch as U, type DataStrategyMatch as V, type DataStrategyResult as W, DataWithResponseInit as X, type ErrorResponse as Y, type FormEncType as Z, type FormMethod as _, type Router as a, type LazyRouteFunction as a0, type PathParam as a1, type RedirectFunction as a2, type ShouldRevalidateFunction as a3, type ShouldRevalidateFunctionArgs as a4, createPath as a5, parsePath as a6, IDLE_NAVIGATION as a7, IDLE_FETCHER as a8, IDLE_BLOCKER as a9, createBrowserHistory as aA, invariant as aB, createRouter as aC, ErrorResponseImpl as aD, DataRouterContext as aE, DataRouterStateContext as aF, FetchersContext as aG, LocationContext as aH, NavigationContext as aI, RouteContext as aJ, ViewTransitionContext as aK, type RouteModule as aL, type History as aM, type ServerDataFrom as aN, type ClientDataFrom as aO, type Func as aP, type Pretty as aQ, data as aa, generatePath as ab, isRouteErrorResponse as ac, matchPath as ad, matchRoutes as ae, redirect as af, redirectDocument as ag, replace as ah, resolvePath as ai, type DataRouteMatch as aj, type DataRouteObject as ak, type Navigator as al, type PatchRoutesOnNavigationFunction as am, type PatchRoutesOnNavigationFunctionArgs as an, type RouteMatch as ao, type ClientActionFunction as ap, type ClientActionFunctionArgs as aq, type ClientLoaderFunction as ar, type ClientLoaderFunctionArgs as as, type HeadersArgs as at, type HeadersFunction as au, type MetaArgs as av, type MetaDescriptor as aw, type PageLinkDescriptor as ax, type HtmlLinkDescriptor as ay, type LinkDescriptor as az, type RouteManifest as b, type RelativeRoutingType as c, type Location as d, Action as e, type Path as f, type PathPattern as g, type PathMatch as h, type Params as i, type RouteObject as j, type Navigation as k, type RevalidationState as l, type SerializeFrom as m, type Blocker as n, type StaticHandlerContext as o, type StaticHandler as p, type IndexRouteObject as q, type LoaderFunction as r, type ActionFunction as s, type LinksFunction as t, type NonIndexRouteObject as u, type RouterState as v, type GetScrollRestorationKeyFunction as w, type Fetcher as x, type NavigationStates as y, type RouterInit as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.2.0-pre.
|
|
2
|
+
* react-router v7.2.0-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -154,13 +154,13 @@ function createHashHistory(options = {}) {
|
|
|
154
154
|
}
|
|
155
155
|
function createHashHref(window2, to) {
|
|
156
156
|
let base = window2.document.querySelector("base");
|
|
157
|
-
let
|
|
157
|
+
let href2 = "";
|
|
158
158
|
if (base && base.getAttribute("href")) {
|
|
159
159
|
let url = window2.location.href;
|
|
160
160
|
let hashIndex = url.indexOf("#");
|
|
161
|
-
|
|
161
|
+
href2 = hashIndex === -1 ? url : url.slice(0, hashIndex);
|
|
162
162
|
}
|
|
163
|
-
return
|
|
163
|
+
return href2 + "#" + (typeof to === "string" ? to : createPath(to));
|
|
164
164
|
}
|
|
165
165
|
function validateHashLocation(location, to) {
|
|
166
166
|
warning(
|
|
@@ -302,13 +302,13 @@ function getUrlBasedHistory(getLocation, createHref2, validateLocation, options
|
|
|
302
302
|
}
|
|
303
303
|
function createURL(to) {
|
|
304
304
|
let base = window2.location.origin !== "null" ? window2.location.origin : window2.location.href;
|
|
305
|
-
let
|
|
306
|
-
|
|
305
|
+
let href2 = typeof to === "string" ? to : createPath(to);
|
|
306
|
+
href2 = href2.replace(/ $/, "%20");
|
|
307
307
|
invariant(
|
|
308
308
|
base,
|
|
309
|
-
`No window.location.(origin|href) available to create URL for href: ${
|
|
309
|
+
`No window.location.(origin|href) available to create URL for href: ${href2}`
|
|
310
310
|
);
|
|
311
|
-
return new URL(
|
|
311
|
+
return new URL(href2, base);
|
|
312
312
|
}
|
|
313
313
|
let history = {
|
|
314
314
|
get action() {
|
|
@@ -1710,7 +1710,7 @@ function createRouter(init) {
|
|
|
1710
1710
|
});
|
|
1711
1711
|
return new Map(state.fetchers);
|
|
1712
1712
|
}
|
|
1713
|
-
async function fetch2(key, routeId,
|
|
1713
|
+
async function fetch2(key, routeId, href2, opts) {
|
|
1714
1714
|
abortFetcher(key);
|
|
1715
1715
|
let flushSync = (opts && opts.flushSync) === true;
|
|
1716
1716
|
let routesToUse = inFlightDataRoutes || dataRoutes;
|
|
@@ -1718,7 +1718,7 @@ function createRouter(init) {
|
|
|
1718
1718
|
state.location,
|
|
1719
1719
|
state.matches,
|
|
1720
1720
|
basename,
|
|
1721
|
-
|
|
1721
|
+
href2,
|
|
1722
1722
|
routeId,
|
|
1723
1723
|
opts?.relative
|
|
1724
1724
|
);
|
|
@@ -5356,7 +5356,7 @@ function getKeyedLinksForMatches(matches, routeModules, manifest) {
|
|
|
5356
5356
|
let module = routeModules[match.route.id];
|
|
5357
5357
|
let route = manifest.routes[match.route.id];
|
|
5358
5358
|
return [
|
|
5359
|
-
route && route.css ? route.css.map((
|
|
5359
|
+
route && route.css ? route.css.map((href2) => ({ rel: "stylesheet", href: href2 })) : [],
|
|
5360
5360
|
module?.links?.() || []
|
|
5361
5361
|
];
|
|
5362
5362
|
}).flat(2);
|
|
@@ -5365,7 +5365,7 @@ function getKeyedLinksForMatches(matches, routeModules, manifest) {
|
|
|
5365
5365
|
}
|
|
5366
5366
|
function getRouteCssDescriptors(route) {
|
|
5367
5367
|
if (!route.css) return [];
|
|
5368
|
-
return route.css.map((
|
|
5368
|
+
return route.css.map((href2) => ({ rel: "stylesheet", href: href2 }));
|
|
5369
5369
|
}
|
|
5370
5370
|
async function prefetchRouteCss(route) {
|
|
5371
5371
|
if (!route.css) return;
|
|
@@ -6868,7 +6868,7 @@ function PrefetchPageLinksImpl({
|
|
|
6868
6868
|
[newMatchesForAssets, manifest]
|
|
6869
6869
|
);
|
|
6870
6870
|
let keyedPrefetchLinks = useKeyedPrefetchLinks(newMatchesForAssets);
|
|
6871
|
-
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, dataHrefs.map((
|
|
6871
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, dataHrefs.map((href2) => /* @__PURE__ */ React9.createElement("link", { key: href2, rel: "prefetch", as: "fetch", href: href2, ...linkProps })), moduleHrefs.map((href2) => /* @__PURE__ */ React9.createElement("link", { key: href2, rel: "modulepreload", href: href2, ...linkProps })), keyedPrefetchLinks.map(({ key, link }) => (
|
|
6872
6872
|
// these don't spread `linkProps` because they are full link descriptors
|
|
6873
6873
|
// already with their own props
|
|
6874
6874
|
/* @__PURE__ */ React9.createElement("link", { key, ...link })
|
|
@@ -7108,7 +7108,7 @@ function mergeRefs(...refs) {
|
|
|
7108
7108
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
7109
7109
|
try {
|
|
7110
7110
|
if (isBrowser) {
|
|
7111
|
-
window.__reactRouterVersion = "7.2.0-pre.
|
|
7111
|
+
window.__reactRouterVersion = "7.2.0-pre.1";
|
|
7112
7112
|
}
|
|
7113
7113
|
} catch (e) {
|
|
7114
7114
|
}
|
|
@@ -7311,7 +7311,7 @@ var Link = React10.forwardRef(
|
|
|
7311
7311
|
}
|
|
7312
7312
|
}
|
|
7313
7313
|
}
|
|
7314
|
-
let
|
|
7314
|
+
let href2 = useHref(to, { relative });
|
|
7315
7315
|
let [shouldPrefetch, prefetchRef, prefetchHandlers] = usePrefetchBehavior(
|
|
7316
7316
|
prefetch,
|
|
7317
7317
|
rest
|
|
@@ -7337,7 +7337,7 @@ var Link = React10.forwardRef(
|
|
|
7337
7337
|
{
|
|
7338
7338
|
...rest,
|
|
7339
7339
|
...prefetchHandlers,
|
|
7340
|
-
href: absoluteHref ||
|
|
7340
|
+
href: absoluteHref || href2,
|
|
7341
7341
|
onClick: isExternal || reloadDocument ? onClick : handleClick,
|
|
7342
7342
|
ref: mergeRefs(forwardedRef, prefetchRef),
|
|
7343
7343
|
target,
|
|
@@ -7345,7 +7345,7 @@ var Link = React10.forwardRef(
|
|
|
7345
7345
|
}
|
|
7346
7346
|
)
|
|
7347
7347
|
);
|
|
7348
|
-
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React10.createElement(React10.Fragment, null, link, /* @__PURE__ */ React10.createElement(PrefetchPageLinks, { page:
|
|
7348
|
+
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React10.createElement(React10.Fragment, null, link, /* @__PURE__ */ React10.createElement(PrefetchPageLinks, { page: href2 })) : link;
|
|
7349
7349
|
}
|
|
7350
7350
|
);
|
|
7351
7351
|
Link.displayName = "Link";
|
|
@@ -7701,9 +7701,9 @@ function useFetcher({
|
|
|
7701
7701
|
return () => router.deleteFetcher(fetcherKey);
|
|
7702
7702
|
}, [router, fetcherKey]);
|
|
7703
7703
|
let load = React10.useCallback(
|
|
7704
|
-
async (
|
|
7704
|
+
async (href2, opts) => {
|
|
7705
7705
|
invariant(routeId, "No routeId available for fetcher.load()");
|
|
7706
|
-
await router.fetch(fetcherKey, routeId,
|
|
7706
|
+
await router.fetch(fetcherKey, routeId, href2, opts);
|
|
7707
7707
|
},
|
|
7708
7708
|
[fetcherKey, routeId, router]
|
|
7709
7709
|
);
|
|
@@ -8160,9 +8160,9 @@ function createHref(to) {
|
|
|
8160
8160
|
return typeof to === "string" ? to : createPath(to);
|
|
8161
8161
|
}
|
|
8162
8162
|
function encodeLocation(to) {
|
|
8163
|
-
let
|
|
8164
|
-
|
|
8165
|
-
let encoded = ABSOLUTE_URL_REGEX3.test(
|
|
8163
|
+
let href2 = typeof to === "string" ? to : createPath(to);
|
|
8164
|
+
href2 = href2.replace(/ $/, "%20");
|
|
8165
|
+
let encoded = ABSOLUTE_URL_REGEX3.test(href2) ? new URL(href2) : new URL(href2, "http://localhost");
|
|
8166
8166
|
return {
|
|
8167
8167
|
pathname: encoded.pathname,
|
|
8168
8168
|
search: encoded.search,
|
|
@@ -9638,6 +9638,24 @@ function createMemorySessionStorage({ cookie } = {}) {
|
|
|
9638
9638
|
});
|
|
9639
9639
|
}
|
|
9640
9640
|
|
|
9641
|
+
// lib/href.ts
|
|
9642
|
+
function href(path, ...args) {
|
|
9643
|
+
let params = args[0];
|
|
9644
|
+
return path.split("/").map((segment) => {
|
|
9645
|
+
const match = segment.match(/^:([\w-]+)(\?)?/);
|
|
9646
|
+
if (!match) return segment;
|
|
9647
|
+
const param = match[1];
|
|
9648
|
+
const value = params ? params[param] : void 0;
|
|
9649
|
+
const isRequired = match[2] === void 0;
|
|
9650
|
+
if (isRequired && value === void 0) {
|
|
9651
|
+
throw Error(
|
|
9652
|
+
`Path '${path}' requires param '${param}' but it was not provided`
|
|
9653
|
+
);
|
|
9654
|
+
}
|
|
9655
|
+
return value;
|
|
9656
|
+
}).filter((segment) => segment !== void 0).join("/");
|
|
9657
|
+
}
|
|
9658
|
+
|
|
9641
9659
|
// lib/dom/ssr/errors.ts
|
|
9642
9660
|
function deserializeErrors2(errors) {
|
|
9643
9661
|
if (!errors) return null;
|
|
@@ -9786,5 +9804,6 @@ export {
|
|
|
9786
9804
|
createSessionStorage,
|
|
9787
9805
|
createCookieSessionStorage,
|
|
9788
9806
|
createMemorySessionStorage,
|
|
9807
|
+
href,
|
|
9789
9808
|
deserializeErrors2 as deserializeErrors
|
|
9790
9809
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterProviderProps$1 } from './fog-of-war-
|
|
3
|
-
import './route-data-
|
|
2
|
+
import { R as RouterProviderProps$1 } from './fog-of-war-yKFj2vdd.mjs';
|
|
3
|
+
import './route-data-CfLfC_Bh.mjs';
|
|
4
4
|
|
|
5
5
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
6
6
|
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterProviderProps$1 } from './fog-of-war-
|
|
3
|
-
import './route-data-
|
|
2
|
+
import { R as RouterProviderProps$1 } from './fog-of-war-rn7nVSAv.js';
|
|
3
|
+
import './route-data-CfLfC_Bh.js';
|
|
4
4
|
|
|
5
5
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
6
6
|
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.2.0-pre.
|
|
2
|
+
* react-router v7.2.0-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
matchRoutes,
|
|
26
26
|
shouldHydrateRouteLoader,
|
|
27
27
|
useFogOFWarDiscovery
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-3BG6WSY4.mjs";
|
|
29
29
|
|
|
30
30
|
// lib/dom-export/dom-router-provider.tsx
|
|
31
31
|
import * as React from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction,
|
|
2
|
+
import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, am as PatchRoutesOnNavigationFunction, a as Router$1, T as To, c as RelativeRoutingType, u as NonIndexRouteObject, a0 as LazyRouteFunction, q as IndexRouteObject, d as Location, e as Action, al as Navigator, ao as RouteMatch, o as StaticHandlerContext, b as RouteManifest, R as RouteModules, ak as DataRouteObject, aL as RouteModule, $ as HTMLFormMethod, Z as FormEncType, ax as PageLinkDescriptor, aM as History, w as GetScrollRestorationKeyFunction, N as NavigateOptions, x as Fetcher, m as SerializeFrom, B as BlockerFunction } from './route-data-CfLfC_Bh.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @private
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction,
|
|
2
|
+
import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, am as PatchRoutesOnNavigationFunction, a as Router$1, T as To, c as RelativeRoutingType, u as NonIndexRouteObject, a0 as LazyRouteFunction, q as IndexRouteObject, d as Location, e as Action, al as Navigator, ao as RouteMatch, o as StaticHandlerContext, b as RouteManifest, R as RouteModules, ak as DataRouteObject, aL as RouteModule, $ as HTMLFormMethod, Z as FormEncType, ax as PageLinkDescriptor, aM as History, w as GetScrollRestorationKeyFunction, N as NavigateOptions, x as Fetcher, m as SerializeFrom, B as BlockerFunction } from './route-data-CfLfC_Bh.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @private
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as RouteModules, a as Router, D as DataStrategyFunction, b as RouteManifest, S as ServerRouteModule, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, c as RelativeRoutingType, d as Location, e as Action, P as ParamParseKey, f as Path, g as PathPattern, h as PathMatch, N as NavigateOptions, i as Params, j as RouteObject, k as Navigation, l as RevalidationState, U as UIMatch, m as SerializeFrom, B as BlockerFunction, n as Blocker, o as StaticHandlerContext, p as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, q as IndexRouteObject, r as LoaderFunction, s as ActionFunction, M as MetaFunction, t as LinksFunction, u as NonIndexRouteObject, v as RouterState } from './route-data-
|
|
2
|
-
export {
|
|
3
|
-
import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-
|
|
4
|
-
export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-
|
|
1
|
+
import { R as RouteModules, a as Router, D as DataStrategyFunction, b as RouteManifest, S as ServerRouteModule, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, c as RelativeRoutingType, d as Location, e as Action, P as ParamParseKey, f as Path, g as PathPattern, h as PathMatch, N as NavigateOptions, i as Params$1, j as RouteObject, k as Navigation, l as RevalidationState, U as UIMatch, m as SerializeFrom, B as BlockerFunction, n as Blocker, o as StaticHandlerContext, p as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, q as IndexRouteObject, r as LoaderFunction, s as ActionFunction, M as MetaFunction, t as LinksFunction, u as NonIndexRouteObject, E as Equal, v as RouterState } from './route-data-CfLfC_Bh.mjs';
|
|
2
|
+
export { ap as ClientActionFunction, aq as ClientActionFunctionArgs, ar as ClientLoaderFunction, as as ClientLoaderFunctionArgs, aj as DataRouteMatch, ak as DataRouteObject, Q as DataStrategyFunctionArgs, V as DataStrategyMatch, W as DataStrategyResult, Y as ErrorResponse, x as Fetcher, Z as FormEncType, _ as FormMethod, G as GetScrollPositionFunction, w as GetScrollRestorationKeyFunction, $ as HTMLFormMethod, at as HeadersArgs, au as HeadersFunction, ay as HtmlLinkDescriptor, a9 as IDLE_BLOCKER, a8 as IDLE_FETCHER, a7 as IDLE_NAVIGATION, a0 as LazyRouteFunction, az as LinkDescriptor, av as MetaArgs, aw as MetaDescriptor, y as NavigationStates, al as Navigator, ax as PageLinkDescriptor, am as PatchRoutesOnNavigationFunction, an as PatchRoutesOnNavigationFunctionArgs, a1 as PathParam, a2 as RedirectFunction, ao as RouteMatch, O as RouterFetchOptions, z as RouterInit, K as RouterNavigateOptions, J as RouterSubscriber, a3 as ShouldRevalidateFunction, a4 as ShouldRevalidateFunctionArgs, aE as UNSAFE_DataRouterContext, aF as UNSAFE_DataRouterStateContext, X as UNSAFE_DataWithResponseInit, aD as UNSAFE_ErrorResponseImpl, aG as UNSAFE_FetchersContext, aH as UNSAFE_LocationContext, aI as UNSAFE_NavigationContext, aJ as UNSAFE_RouteContext, aK as UNSAFE_ViewTransitionContext, aA as UNSAFE_createBrowserHistory, aC as UNSAFE_createRouter, aB as UNSAFE_invariant, a5 as createPath, aa as data, ab as generatePath, ac as isRouteErrorResponse, ad as matchPath, ae as matchRoutes, a6 as parsePath, af as redirect, ag as redirectDocument, ah as replace, ai as resolvePath } from './route-data-CfLfC_Bh.mjs';
|
|
3
|
+
import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-yKFj2vdd.mjs';
|
|
4
|
+
export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-yKFj2vdd.mjs';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { ReactElement } from 'react';
|
|
7
7
|
import { ParseOptions, SerializeOptions } from 'cookie';
|
|
@@ -194,7 +194,7 @@ declare function useOutlet(context?: unknown): React.ReactElement | null;
|
|
|
194
194
|
*/
|
|
195
195
|
declare function useParams<ParamsOrKey extends string | Record<string, string | undefined> = string>(): Readonly<[
|
|
196
196
|
ParamsOrKey
|
|
197
|
-
] extends [string] ? Params<ParamsOrKey> : Partial<ParamsOrKey>>;
|
|
197
|
+
] extends [string] ? Params$1<ParamsOrKey> : Partial<ParamsOrKey>>;
|
|
198
198
|
/**
|
|
199
199
|
Resolves the pathname of the given `to` value against the current location. Similar to {@link useHref}, but returns a {@link Path} instead of a string.
|
|
200
200
|
|
|
@@ -782,6 +782,37 @@ type DevServerHooks = {
|
|
|
782
782
|
};
|
|
783
783
|
declare function setDevServerHooks(devServerHooks: DevServerHooks): void;
|
|
784
784
|
|
|
785
|
+
/**
|
|
786
|
+
* Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
|
|
787
|
+
* React Router should handle this for you via type generation.
|
|
788
|
+
*
|
|
789
|
+
* For more on declaration merging and module augmentation, see https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation .
|
|
790
|
+
*/
|
|
791
|
+
interface Register {
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
type AnyParams = Record<string, Record<string, string | undefined>>;
|
|
795
|
+
type Params = Register extends {
|
|
796
|
+
params: infer RegisteredParams extends AnyParams;
|
|
797
|
+
} ? RegisteredParams : AnyParams;
|
|
798
|
+
type Args = {
|
|
799
|
+
[K in keyof Params]: ToArgs<Params[K]>;
|
|
800
|
+
};
|
|
801
|
+
type ToArgs<T> = Equal<T, {}> extends true ? [] : Partial<T> extends T ? [T] | [] : [
|
|
802
|
+
T
|
|
803
|
+
];
|
|
804
|
+
/**
|
|
805
|
+
Returns a resolved URL path for the specified route.
|
|
806
|
+
|
|
807
|
+
```tsx
|
|
808
|
+
const h = href("/:lang?/about", { lang: "en" })
|
|
809
|
+
// -> `/en/about`
|
|
810
|
+
|
|
811
|
+
<Link to={href("/products/:id", { id: "abc123" })} />
|
|
812
|
+
```
|
|
813
|
+
*/
|
|
814
|
+
declare function href<Path extends keyof Args>(path: Path, ...args: Args[Path]): string;
|
|
815
|
+
|
|
785
816
|
declare function deserializeErrors(errors: RouterState["errors"]): RouterState["errors"];
|
|
786
817
|
|
|
787
818
|
type RemixErrorBoundaryProps = React.PropsWithChildren<{
|
|
@@ -805,4 +836,4 @@ declare class RemixErrorBoundary extends React.Component<RemixErrorBoundaryProps
|
|
|
805
836
|
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
806
837
|
}
|
|
807
838
|
|
|
808
|
-
export { ActionFunction, ActionFunctionArgs, AppLoadContext$1 as AppLoadContext, Blocker, BlockerFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, LoaderFunctionArgs, Location, MetaFunction, type NavigateFunction, NavigateOptions, Navigation, Action as NavigationType, NonIndexRouteObject, ParamParseKey, Params, Path, PathMatch, PathPattern, RelativeRoutingType, type RequestHandler, RevalidationState, RouteObject, RouterState, type RoutesTestStubProps, type ServerBuild, type ServerEntryModule, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, To, UIMatch, AssetsManifest as UNSAFE_AssetsManifest, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getSingleFetchDataStrategy as UNSAFE_getSingleFetchDataStrategy, createCookie, createCookieSessionStorage, createMemorySessionStorage, createRequestHandler, createRoutesStub, createSession, createSessionStorage, createStaticHandler, createStaticRouter, isCookie, isSession, setDevServerHooks as unstable_setDevServerHooks, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
|
|
839
|
+
export { ActionFunction, ActionFunctionArgs, AppLoadContext$1 as AppLoadContext, Blocker, BlockerFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, LoaderFunctionArgs, Location, MetaFunction, type NavigateFunction, NavigateOptions, Navigation, Action as NavigationType, NonIndexRouteObject, ParamParseKey, Params$1 as Params, Path, PathMatch, PathPattern, type Register, RelativeRoutingType, type RequestHandler, RevalidationState, RouteObject, RouterState, type RoutesTestStubProps, type ServerBuild, type ServerEntryModule, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, To, UIMatch, AssetsManifest as UNSAFE_AssetsManifest, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getSingleFetchDataStrategy as UNSAFE_getSingleFetchDataStrategy, createCookie, createCookieSessionStorage, createMemorySessionStorage, createRequestHandler, createRoutesStub, createSession, createSessionStorage, createStaticHandler, createStaticRouter, href, isCookie, isSession, setDevServerHooks as unstable_setDevServerHooks, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as RouteModules, a as Router, D as DataStrategyFunction, b as RouteManifest, S as ServerRouteModule, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, c as RelativeRoutingType, d as Location, e as Action, P as ParamParseKey, f as Path, g as PathPattern, h as PathMatch, N as NavigateOptions, i as Params, j as RouteObject, k as Navigation, l as RevalidationState, U as UIMatch, m as SerializeFrom, B as BlockerFunction, n as Blocker, o as StaticHandlerContext, p as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, q as IndexRouteObject, r as LoaderFunction, s as ActionFunction, M as MetaFunction, t as LinksFunction, u as NonIndexRouteObject, v as RouterState } from './route-data-
|
|
2
|
-
export {
|
|
3
|
-
import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-
|
|
4
|
-
export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-
|
|
1
|
+
import { R as RouteModules, a as Router, D as DataStrategyFunction, b as RouteManifest, S as ServerRouteModule, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, c as RelativeRoutingType, d as Location, e as Action, P as ParamParseKey, f as Path, g as PathPattern, h as PathMatch, N as NavigateOptions, i as Params$1, j as RouteObject, k as Navigation, l as RevalidationState, U as UIMatch, m as SerializeFrom, B as BlockerFunction, n as Blocker, o as StaticHandlerContext, p as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, q as IndexRouteObject, r as LoaderFunction, s as ActionFunction, M as MetaFunction, t as LinksFunction, u as NonIndexRouteObject, E as Equal, v as RouterState } from './route-data-CfLfC_Bh.js';
|
|
2
|
+
export { ap as ClientActionFunction, aq as ClientActionFunctionArgs, ar as ClientLoaderFunction, as as ClientLoaderFunctionArgs, aj as DataRouteMatch, ak as DataRouteObject, Q as DataStrategyFunctionArgs, V as DataStrategyMatch, W as DataStrategyResult, Y as ErrorResponse, x as Fetcher, Z as FormEncType, _ as FormMethod, G as GetScrollPositionFunction, w as GetScrollRestorationKeyFunction, $ as HTMLFormMethod, at as HeadersArgs, au as HeadersFunction, ay as HtmlLinkDescriptor, a9 as IDLE_BLOCKER, a8 as IDLE_FETCHER, a7 as IDLE_NAVIGATION, a0 as LazyRouteFunction, az as LinkDescriptor, av as MetaArgs, aw as MetaDescriptor, y as NavigationStates, al as Navigator, ax as PageLinkDescriptor, am as PatchRoutesOnNavigationFunction, an as PatchRoutesOnNavigationFunctionArgs, a1 as PathParam, a2 as RedirectFunction, ao as RouteMatch, O as RouterFetchOptions, z as RouterInit, K as RouterNavigateOptions, J as RouterSubscriber, a3 as ShouldRevalidateFunction, a4 as ShouldRevalidateFunctionArgs, aE as UNSAFE_DataRouterContext, aF as UNSAFE_DataRouterStateContext, X as UNSAFE_DataWithResponseInit, aD as UNSAFE_ErrorResponseImpl, aG as UNSAFE_FetchersContext, aH as UNSAFE_LocationContext, aI as UNSAFE_NavigationContext, aJ as UNSAFE_RouteContext, aK as UNSAFE_ViewTransitionContext, aA as UNSAFE_createBrowserHistory, aC as UNSAFE_createRouter, aB as UNSAFE_invariant, a5 as createPath, aa as data, ab as generatePath, ac as isRouteErrorResponse, ad as matchPath, ae as matchRoutes, a6 as parsePath, af as redirect, ag as redirectDocument, ah as replace, ai as resolvePath } from './route-data-CfLfC_Bh.js';
|
|
3
|
+
import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-rn7nVSAv.js';
|
|
4
|
+
export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-rn7nVSAv.js';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { ReactElement } from 'react';
|
|
7
7
|
import { ParseOptions, SerializeOptions } from 'cookie';
|
|
@@ -194,7 +194,7 @@ declare function useOutlet(context?: unknown): React.ReactElement | null;
|
|
|
194
194
|
*/
|
|
195
195
|
declare function useParams<ParamsOrKey extends string | Record<string, string | undefined> = string>(): Readonly<[
|
|
196
196
|
ParamsOrKey
|
|
197
|
-
] extends [string] ? Params<ParamsOrKey> : Partial<ParamsOrKey>>;
|
|
197
|
+
] extends [string] ? Params$1<ParamsOrKey> : Partial<ParamsOrKey>>;
|
|
198
198
|
/**
|
|
199
199
|
Resolves the pathname of the given `to` value against the current location. Similar to {@link useHref}, but returns a {@link Path} instead of a string.
|
|
200
200
|
|
|
@@ -782,6 +782,37 @@ type DevServerHooks = {
|
|
|
782
782
|
};
|
|
783
783
|
declare function setDevServerHooks(devServerHooks: DevServerHooks): void;
|
|
784
784
|
|
|
785
|
+
/**
|
|
786
|
+
* Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
|
|
787
|
+
* React Router should handle this for you via type generation.
|
|
788
|
+
*
|
|
789
|
+
* For more on declaration merging and module augmentation, see https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation .
|
|
790
|
+
*/
|
|
791
|
+
interface Register {
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
type AnyParams = Record<string, Record<string, string | undefined>>;
|
|
795
|
+
type Params = Register extends {
|
|
796
|
+
params: infer RegisteredParams extends AnyParams;
|
|
797
|
+
} ? RegisteredParams : AnyParams;
|
|
798
|
+
type Args = {
|
|
799
|
+
[K in keyof Params]: ToArgs<Params[K]>;
|
|
800
|
+
};
|
|
801
|
+
type ToArgs<T> = Equal<T, {}> extends true ? [] : Partial<T> extends T ? [T] | [] : [
|
|
802
|
+
T
|
|
803
|
+
];
|
|
804
|
+
/**
|
|
805
|
+
Returns a resolved URL path for the specified route.
|
|
806
|
+
|
|
807
|
+
```tsx
|
|
808
|
+
const h = href("/:lang?/about", { lang: "en" })
|
|
809
|
+
// -> `/en/about`
|
|
810
|
+
|
|
811
|
+
<Link to={href("/products/:id", { id: "abc123" })} />
|
|
812
|
+
```
|
|
813
|
+
*/
|
|
814
|
+
declare function href<Path extends keyof Args>(path: Path, ...args: Args[Path]): string;
|
|
815
|
+
|
|
785
816
|
declare function deserializeErrors(errors: RouterState["errors"]): RouterState["errors"];
|
|
786
817
|
|
|
787
818
|
type RemixErrorBoundaryProps = React.PropsWithChildren<{
|
|
@@ -805,4 +836,4 @@ declare class RemixErrorBoundary extends React.Component<RemixErrorBoundaryProps
|
|
|
805
836
|
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
806
837
|
}
|
|
807
838
|
|
|
808
|
-
export { ActionFunction, ActionFunctionArgs, AppLoadContext$1 as AppLoadContext, Blocker, BlockerFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, LoaderFunctionArgs, Location, MetaFunction, type NavigateFunction, NavigateOptions, Navigation, Action as NavigationType, NonIndexRouteObject, ParamParseKey, Params, Path, PathMatch, PathPattern, RelativeRoutingType, type RequestHandler, RevalidationState, RouteObject, RouterState, type RoutesTestStubProps, type ServerBuild, type ServerEntryModule, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, To, UIMatch, AssetsManifest as UNSAFE_AssetsManifest, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getSingleFetchDataStrategy as UNSAFE_getSingleFetchDataStrategy, createCookie, createCookieSessionStorage, createMemorySessionStorage, createRequestHandler, createRoutesStub, createSession, createSessionStorage, createStaticHandler, createStaticRouter, isCookie, isSession, setDevServerHooks as unstable_setDevServerHooks, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
|
|
839
|
+
export { ActionFunction, ActionFunctionArgs, AppLoadContext$1 as AppLoadContext, Blocker, BlockerFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, LoaderFunctionArgs, Location, MetaFunction, type NavigateFunction, NavigateOptions, Navigation, Action as NavigationType, NonIndexRouteObject, ParamParseKey, Params$1 as Params, Path, PathMatch, PathPattern, type Register, RelativeRoutingType, type RequestHandler, RevalidationState, RouteObject, RouterState, type RoutesTestStubProps, type ServerBuild, type ServerEntryModule, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, To, UIMatch, AssetsManifest as UNSAFE_AssetsManifest, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getSingleFetchDataStrategy as UNSAFE_getSingleFetchDataStrategy, createCookie, createCookieSessionStorage, createMemorySessionStorage, createRequestHandler, createRoutesStub, createSession, createSessionStorage, createStaticHandler, createStaticRouter, href, isCookie, isSession, setDevServerHooks as unstable_setDevServerHooks, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
|