react-router 0.0.0-experimental-aecfb0db1 → 0.0.0-experimental-5bbc45fb6
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/development/{chunk-RXFCVJK2.mjs → chunk-EKICUOCX.mjs} +10 -19
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.js +1 -1
- package/dist/development/dom-export.mjs +2 -2
- package/dist/development/index.d.mts +16 -21
- package/dist/development/index.d.ts +13 -19
- package/dist/development/index.js +10 -19
- package/dist/development/index.mjs +2 -2
- package/dist/development/lib/types/{route-module.d.mts → internal.d.mts} +83 -16
- package/dist/{production/lib/types/route-module.d.mts → development/lib/types/internal.d.ts} +82 -16
- package/dist/development/lib/types/{route-module.js → internal.js} +4 -4
- package/dist/development/lib/types/{route-module.mjs → internal.mjs} +1 -1
- package/dist/development/{lib-BJBhVBWN.d.mts → lib-DOOHL1pK.d.mts} +1 -1
- package/dist/development/{route-data-fNWkI-4T.d.ts → register-DEZBC9Yl.d.ts} +19 -1
- package/dist/development/register-e9PGCFx1.d.mts +10 -0
- package/dist/development/{route-data-BmDen1H_.d.mts → route-data-BwJdBC92.d.mts} +10 -1
- package/dist/production/{chunk-TLRBG5AD.mjs → chunk-5UK3OH7I.mjs} +10 -19
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.js +1 -1
- package/dist/production/dom-export.mjs +2 -2
- package/dist/production/index.d.mts +16 -21
- package/dist/production/index.d.ts +13 -19
- package/dist/production/index.js +10 -19
- package/dist/production/index.mjs +2 -2
- package/dist/{development/lib/types/route-module.d.ts → production/lib/types/internal.d.mts} +83 -16
- package/dist/production/lib/types/{route-module.d.ts → internal.d.ts} +82 -16
- package/dist/production/lib/types/{route-module.js → internal.js} +4 -4
- package/dist/production/lib/types/{route-module.mjs → internal.mjs} +1 -1
- package/dist/production/{lib-BJBhVBWN.d.mts → lib-DOOHL1pK.d.mts} +1 -1
- package/dist/production/{route-data-fNWkI-4T.d.ts → register-DEZBC9Yl.d.ts} +19 -1
- package/dist/production/register-e9PGCFx1.d.mts +10 -0
- package/dist/production/{route-data-BmDen1H_.d.mts → route-data-BwJdBC92.d.mts} +10 -1
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-5bbc45fb6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -5502,25 +5502,11 @@ function RouterProvider({
|
|
|
5502
5502
|
viewTransitionOpts == null || isViewTransitionAvailable,
|
|
5503
5503
|
"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."
|
|
5504
5504
|
);
|
|
5505
|
-
const resetTransition = () => {
|
|
5506
|
-
setRenderDfd(void 0);
|
|
5507
|
-
setTransition(void 0);
|
|
5508
|
-
setPendingState(void 0);
|
|
5509
|
-
setVtContext({ isTransitioning: false });
|
|
5510
|
-
};
|
|
5511
5505
|
if (!viewTransitionOpts || !isViewTransitionAvailable) {
|
|
5512
|
-
renderDfd?.resolve();
|
|
5513
|
-
transition?.skipTransition();
|
|
5514
5506
|
if (reactDomFlushSyncImpl && flushSync) {
|
|
5515
|
-
reactDomFlushSyncImpl(() =>
|
|
5516
|
-
setStateImpl(newState);
|
|
5517
|
-
resetTransition();
|
|
5518
|
-
});
|
|
5507
|
+
reactDomFlushSyncImpl(() => setStateImpl(newState));
|
|
5519
5508
|
} else {
|
|
5520
|
-
React3.startTransition(() =>
|
|
5521
|
-
setStateImpl(newState);
|
|
5522
|
-
resetTransition();
|
|
5523
|
-
});
|
|
5509
|
+
React3.startTransition(() => setStateImpl(newState));
|
|
5524
5510
|
}
|
|
5525
5511
|
return;
|
|
5526
5512
|
}
|
|
@@ -5541,7 +5527,12 @@ function RouterProvider({
|
|
|
5541
5527
|
reactDomFlushSyncImpl(() => setStateImpl(newState));
|
|
5542
5528
|
});
|
|
5543
5529
|
t.finished.finally(() => {
|
|
5544
|
-
reactDomFlushSyncImpl(() =>
|
|
5530
|
+
reactDomFlushSyncImpl(() => {
|
|
5531
|
+
setRenderDfd(void 0);
|
|
5532
|
+
setTransition(void 0);
|
|
5533
|
+
setPendingState(void 0);
|
|
5534
|
+
setVtContext({ isTransitioning: false });
|
|
5535
|
+
});
|
|
5545
5536
|
});
|
|
5546
5537
|
reactDomFlushSyncImpl(() => setTransition(t));
|
|
5547
5538
|
return;
|
|
@@ -8649,7 +8640,7 @@ function mergeRefs(...refs) {
|
|
|
8649
8640
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
8650
8641
|
try {
|
|
8651
8642
|
if (isBrowser) {
|
|
8652
|
-
window.__reactRouterVersion = "0.0.0-experimental-
|
|
8643
|
+
window.__reactRouterVersion = "0.0.0-experimental-5bbc45fb6";
|
|
8653
8644
|
}
|
|
8654
8645
|
} catch (e) {
|
|
8655
8646
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterProviderProps$1 } from './lib-
|
|
3
|
-
import { R as RouterInit } from './route-data-
|
|
2
|
+
import { R as RouterProviderProps$1 } from './lib-DOOHL1pK.mjs';
|
|
3
|
+
import { R as RouterInit } from './route-data-BwJdBC92.mjs';
|
|
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 v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-5bbc45fb6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
invariant,
|
|
26
26
|
mapRouteProperties,
|
|
27
27
|
useFogOFWarDiscovery
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-EKICUOCX.mjs";
|
|
29
29
|
|
|
30
30
|
// lib/dom-export/dom-router-provider.tsx
|
|
31
31
|
import * as React from "react";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { a as Router, b as RouteModules, D as DataStrategyFunction, T as To, c as RelativeRoutingType, L as Location, A as Action, P as ParamParseKey, d as Path, e as PathPattern, f as PathMatch, N as NavigateOptions, g as Params
|
|
2
|
-
export { W as ActionFunctionArgs, av as ClientActionFunction, aw as ClientActionFunctionArgs, ax as ClientLoaderFunctionArgs, ar as DataRouteMatch, X as DataStrategyFunctionArgs, Y as DataStrategyMatch, Z as DataStrategyResult, $ as ErrorResponse, J as Fetcher, a0 as FormEncType, a1 as FormMethod, aF as Future, G as GetScrollPositionFunction, z as GetScrollRestorationKeyFunction, a2 as HTMLFormMethod, ay as HeadersArgs, az as HeadersFunction, aD as HtmlLinkDescriptor, ah as IDLE_BLOCKER, ag as IDLE_FETCHER, af as IDLE_NAVIGATION, a3 as LazyRouteFunction, aE as LinkDescriptor, a4 as LoaderFunctionArgs, aA as MetaArgs, aB as MetaDescriptor, K as NavigationStates, as as Navigator, aC as PageLinkDescriptor, at as PatchRoutesOnNavigationFunctionArgs, a6 as PathParam, a7 as RedirectFunction, au as RouteMatch, V as RouterFetchOptions, R as RouterInit, Q as RouterNavigateOptions, O as RouterSubscriber, a9 as ShouldRevalidateFunction, aa as ShouldRevalidateFunctionArgs, aL as UNSAFE_DataRouterContext, aM as UNSAFE_DataRouterStateContext, _ as UNSAFE_DataWithResponseInit, aK as UNSAFE_ErrorResponseImpl, aN as UNSAFE_FetchersContext, aO as UNSAFE_LocationContext, aP as UNSAFE_NavigationContext, aQ as UNSAFE_RouteContext, aR as UNSAFE_ViewTransitionContext, aH as UNSAFE_createBrowserHistory, aJ as UNSAFE_createRouter, aI as UNSAFE_invariant, ad as createPath, ai as data, aj as generatePath, ak as isRouteErrorResponse, al as matchPath, am as matchRoutes, ae as parsePath, an as redirect, ao as redirectDocument, ap as replace, aq as resolvePath, a5 as unstable_MiddlewareFunction, a8 as unstable_RouterContext, ac as unstable_RouterContextProvider, aG as unstable_SerializesTo, ab as unstable_createContext } from './route-data-
|
|
3
|
-
import { A as AssetsManifest, E as EntryContext, F as FutureConfig$1, S as ServerBuild } from './lib-
|
|
4
|
-
export { f as Await, a as AwaitProps, Q as BrowserRouter, B as BrowserRouterProps, D as DOMRouterOpts, v as FetcherFormProps, C as FetcherSubmitFunction, a6 as FetcherSubmitOptions, G as FetcherWithComponents, X as Form, w as FormProps, ah as HandleDataRequestFunction, ai as HandleDocumentRequestFunction, aj as HandleErrorFunction, T as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, U as Link, s as LinkProps, ad as Links, g as MemoryRouter, M as MemoryRouterOpts, b as MemoryRouterProps, ac as Meta, W as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a7 as ParamKeyValuePair, P as PathRouteProps, af 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, ae as Scripts, ag as ScriptsProps, Y as ScrollRestoration, x as ScrollRestorationProps, ak as ServerEntryModule, y as SetURLSearchParams, z as SubmitFunction, a8 as SubmitOptions, aa as SubmitTarget, an as UNSAFE_FrameworkContext, ao as UNSAFE_createClientRoutes, ap as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, al as UNSAFE_hydrationRouteProperties, am as UNSAFE_mapRouteProperties, aq as UNSAFE_shouldHydrateRouteLoader, ar as UNSAFE_useScrollRestoration, a9 as URLSearchParamsInit, J as createBrowserRouter, K as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, ab as createSearchParams, r as renderMatches, V as unstable_HistoryRouter, a4 as unstable_usePrompt, a3 as useBeforeUnload, a1 as useFetcher, a2 as useFetchers, a0 as useFormAction, Z as useLinkClickHandler, _ as useSearchParams, $ as useSubmit, a5 as useViewTransitionState } from './lib-
|
|
1
|
+
import { a as Router, b as RouteModules, D as DataStrategyFunction, T as To, c as RelativeRoutingType, L as Location, A as Action, P as ParamParseKey, d as Path, e as PathPattern, f as PathMatch, N as NavigateOptions, g as Params, h as RouteObject, i as Navigation, j as RevalidationState, U as UIMatch, S as SerializeFrom, B as BlockerFunction, k as Blocker, l as StaticHandlerContext, m as StaticHandler, F as FutureConfig, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, u as unstable_InitialContext, n as IndexRouteObject, o as LoaderFunction, p as ActionFunction, M as MetaFunction, q as LinksFunction, r as NonIndexRouteObject, s as MiddlewareEnabled, t as AppLoadContext, E as Equal, v as RouterState, w as PatchRoutesOnNavigationFunction, x as DataRouteObject, y as ClientLoaderFunction } from './route-data-BwJdBC92.mjs';
|
|
2
|
+
export { W as ActionFunctionArgs, av as ClientActionFunction, aw as ClientActionFunctionArgs, ax as ClientLoaderFunctionArgs, ar as DataRouteMatch, X as DataStrategyFunctionArgs, Y as DataStrategyMatch, Z as DataStrategyResult, $ as ErrorResponse, J as Fetcher, a0 as FormEncType, a1 as FormMethod, aF as Future, G as GetScrollPositionFunction, z as GetScrollRestorationKeyFunction, a2 as HTMLFormMethod, ay as HeadersArgs, az as HeadersFunction, aD as HtmlLinkDescriptor, ah as IDLE_BLOCKER, ag as IDLE_FETCHER, af as IDLE_NAVIGATION, a3 as LazyRouteFunction, aE as LinkDescriptor, a4 as LoaderFunctionArgs, aA as MetaArgs, aB as MetaDescriptor, K as NavigationStates, as as Navigator, aC as PageLinkDescriptor, at as PatchRoutesOnNavigationFunctionArgs, a6 as PathParam, a7 as RedirectFunction, au as RouteMatch, V as RouterFetchOptions, R as RouterInit, Q as RouterNavigateOptions, O as RouterSubscriber, a9 as ShouldRevalidateFunction, aa as ShouldRevalidateFunctionArgs, aL as UNSAFE_DataRouterContext, aM as UNSAFE_DataRouterStateContext, _ as UNSAFE_DataWithResponseInit, aK as UNSAFE_ErrorResponseImpl, aN as UNSAFE_FetchersContext, aO as UNSAFE_LocationContext, aP as UNSAFE_NavigationContext, aQ as UNSAFE_RouteContext, aR as UNSAFE_ViewTransitionContext, aH as UNSAFE_createBrowserHistory, aJ as UNSAFE_createRouter, aI as UNSAFE_invariant, ad as createPath, ai as data, aj as generatePath, ak as isRouteErrorResponse, al as matchPath, am as matchRoutes, ae as parsePath, an as redirect, ao as redirectDocument, ap as replace, aq as resolvePath, a5 as unstable_MiddlewareFunction, a8 as unstable_RouterContext, ac as unstable_RouterContextProvider, aG as unstable_SerializesTo, ab as unstable_createContext } from './route-data-BwJdBC92.mjs';
|
|
3
|
+
import { A as AssetsManifest, E as EntryContext, F as FutureConfig$1, S as ServerBuild } from './lib-DOOHL1pK.mjs';
|
|
4
|
+
export { f as Await, a as AwaitProps, Q as BrowserRouter, B as BrowserRouterProps, D as DOMRouterOpts, v as FetcherFormProps, C as FetcherSubmitFunction, a6 as FetcherSubmitOptions, G as FetcherWithComponents, X as Form, w as FormProps, ah as HandleDataRequestFunction, ai as HandleDocumentRequestFunction, aj as HandleErrorFunction, T as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, U as Link, s as LinkProps, ad as Links, g as MemoryRouter, M as MemoryRouterOpts, b as MemoryRouterProps, ac as Meta, W as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a7 as ParamKeyValuePair, P as PathRouteProps, af 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, ae as Scripts, ag as ScriptsProps, Y as ScrollRestoration, x as ScrollRestorationProps, ak as ServerEntryModule, y as SetURLSearchParams, z as SubmitFunction, a8 as SubmitOptions, aa as SubmitTarget, an as UNSAFE_FrameworkContext, ao as UNSAFE_createClientRoutes, ap as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, al as UNSAFE_hydrationRouteProperties, am as UNSAFE_mapRouteProperties, aq as UNSAFE_shouldHydrateRouteLoader, ar as UNSAFE_useScrollRestoration, a9 as URLSearchParamsInit, J as createBrowserRouter, K as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, ab as createSearchParams, r as renderMatches, V as unstable_HistoryRouter, a4 as unstable_usePrompt, a3 as useBeforeUnload, a1 as useFetcher, a2 as useFetchers, a0 as useFormAction, Z as useLinkClickHandler, _ as useSearchParams, $ as useSubmit, a5 as useViewTransitionState } from './lib-DOOHL1pK.mjs';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { ReactElement } from 'react';
|
|
7
7
|
import { ParseOptions, SerializeOptions } from 'cookie';
|
|
8
8
|
export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerializeOptions } from 'cookie';
|
|
9
|
+
import { R as Register } from './register-e9PGCFx1.mjs';
|
|
9
10
|
|
|
10
11
|
declare const SingleFetchRedirectSymbol: unique symbol;
|
|
11
12
|
declare function getTurboStreamSingleFetchDataStrategy(getRouter: () => Router, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, basename: string | undefined): DataStrategyFunction;
|
|
@@ -147,7 +148,7 @@ declare function useOutlet(context?: unknown): React.ReactElement | null;
|
|
|
147
148
|
*/
|
|
148
149
|
declare function useParams<ParamsOrKey extends string | Record<string, string | undefined> = string>(): Readonly<[
|
|
149
150
|
ParamsOrKey
|
|
150
|
-
] extends [string] ? Params
|
|
151
|
+
] extends [string] ? Params<ParamsOrKey> : Partial<ParamsOrKey>>;
|
|
151
152
|
/**
|
|
152
153
|
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.
|
|
153
154
|
|
|
@@ -730,23 +731,17 @@ type DevServerHooks = {
|
|
|
730
731
|
};
|
|
731
732
|
declare function setDevServerHooks(devServerHooks: DevServerHooks): void;
|
|
732
733
|
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
type AnyParams = Record<string, Record<string, string | undefined>>;
|
|
743
|
-
type Params = Register extends {
|
|
744
|
-
params: infer RegisteredParams extends AnyParams;
|
|
745
|
-
} ? RegisteredParams : AnyParams;
|
|
734
|
+
type AnyParams = Record<string, string | undefined>;
|
|
735
|
+
type AnyPages = Record<string, {
|
|
736
|
+
params: AnyParams;
|
|
737
|
+
}>;
|
|
738
|
+
type Pages = Register extends {
|
|
739
|
+
pages: infer RegisteredPages extends AnyPages;
|
|
740
|
+
} ? RegisteredPages : AnyPages;
|
|
746
741
|
type Args = {
|
|
747
|
-
[K in keyof
|
|
742
|
+
[K in keyof Pages]: ToArgs<Pages[K]["params"]>;
|
|
748
743
|
};
|
|
749
|
-
type ToArgs<T> = Equal<T, {}> extends true ? [] : Partial<T> extends T ? [T] | [] : [
|
|
744
|
+
type ToArgs<T extends AnyParams> = Equal<T, {}> extends true ? [] : Partial<T> extends T ? [T] | [] : [
|
|
750
745
|
T
|
|
751
746
|
];
|
|
752
747
|
/**
|
|
@@ -797,4 +792,4 @@ declare function getHydrationData(state: {
|
|
|
797
792
|
hasHydrateFallback: boolean;
|
|
798
793
|
}, location: Path, basename: string | undefined, isSpaMode: boolean): HydrationState;
|
|
799
794
|
|
|
800
|
-
export { ActionFunction, AppLoadContext, Blocker, BlockerFunction, ClientLoaderFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, DataRouteObject, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, Location, MetaFunction, type NavigateFunction, NavigateOptions, Navigation, Action as NavigationType, NonIndexRouteObject, ParamParseKey, Params
|
|
795
|
+
export { ActionFunction, AppLoadContext, Blocker, BlockerFunction, ClientLoaderFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, DataRouteObject, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, Location, MetaFunction, type NavigateFunction, NavigateOptions, Navigation, Action as NavigationType, NonIndexRouteObject, ParamParseKey, Params, PatchRoutesOnNavigationFunction, Path, PathMatch, PathPattern, Register, RelativeRoutingType, type RequestHandler, RevalidationState, RouteObject, RouterState, type RoutesTestStubProps, ServerBuild, 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, MiddlewareEnabled as UNSAFE_MiddlewareEnabled, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getHydrationData as UNSAFE_getHydrationData, getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction, getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy, useFogOFWarDiscovery as UNSAFE_useFogOFWarDiscovery, createCookie, createCookieSessionStorage, createMemorySessionStorage, createRequestHandler, createRoutesStub, createSession, createSessionStorage, createStaticHandler, createStaticRouter, href, isCookie, isSession, unstable_InitialContext, 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,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteObject, a as RouterInit, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, P as PatchRoutesOnNavigationFunction, b as Router$1, T as To, c as RelativeRoutingType, N as NonIndexRouteObject, L as LazyRouteFunction, d as IndexRouteObject, e as Location, A as Action, f as Navigator, g as RouteMatch, h as RouteManifest, S as ServerRouteModule, M as MiddlewareEnabled, u as unstable_RouterContextProvider, i as AppLoadContext, j as LoaderFunctionArgs, k as ActionFunctionArgs, l as StaticHandlerContext, m as RouteModules, n as DataRouteObject, C as ClientLoaderFunction, o as ParamParseKey, p as Path, q as PathPattern, r as PathMatch, s as NavigateOptions, t as Params
|
|
2
|
-
export {
|
|
1
|
+
import { R as RouteObject, a as RouterInit, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, P as PatchRoutesOnNavigationFunction, b as Router$1, T as To, c as RelativeRoutingType, N as NonIndexRouteObject, L as LazyRouteFunction, d as IndexRouteObject, e as Location, A as Action, f as Navigator, g as RouteMatch, h as RouteManifest, S as ServerRouteModule, M as MiddlewareEnabled, u as unstable_RouterContextProvider, i as AppLoadContext, j as LoaderFunctionArgs, k as ActionFunctionArgs, l as StaticHandlerContext, m as RouteModules, n as DataRouteObject, C as ClientLoaderFunction, o as ParamParseKey, p as Path, q as PathPattern, r as PathMatch, s as NavigateOptions, t as Params, v as Navigation, w as RevalidationState, U as UIMatch, x as SerializeFrom, B as BlockerFunction, y as Blocker, z as HTMLFormMethod, E as FormEncType, G as PageLinkDescriptor, J as History, K as GetScrollRestorationKeyFunction, O as Fetcher, Q as StaticHandler, V as CreateStaticHandlerOptions$1, W as unstable_InitialContext, X as LoaderFunction, Y as ActionFunction, Z as MetaFunction, _ as LinksFunction, $ as Equal, a0 as Register, a1 as RouterState } from './register-DEZBC9Yl.js';
|
|
2
|
+
export { aA as ClientActionFunction, aB as ClientActionFunctionArgs, aC as ClientLoaderFunctionArgs, ay as DataRouteMatch, a7 as DataStrategyFunctionArgs, a8 as DataStrategyMatch, a9 as DataStrategyResult, ab as ErrorResponse, ac as FormMethod, aJ as Future, a2 as GetScrollPositionFunction, aD as HeadersArgs, aE as HeadersFunction, aH as HtmlLinkDescriptor, ao as IDLE_BLOCKER, an as IDLE_FETCHER, am as IDLE_NAVIGATION, aI as LinkDescriptor, aF as MetaArgs, aG as MetaDescriptor, a3 as NavigationStates, az as PatchRoutesOnNavigationFunctionArgs, ae as PathParam, af as RedirectFunction, a6 as RouterFetchOptions, a5 as RouterNavigateOptions, a4 as RouterSubscriber, ah as ShouldRevalidateFunction, ai as ShouldRevalidateFunctionArgs, aP as UNSAFE_DataRouterContext, aQ as UNSAFE_DataRouterStateContext, aa as UNSAFE_DataWithResponseInit, aO as UNSAFE_ErrorResponseImpl, aR as UNSAFE_FetchersContext, aS as UNSAFE_LocationContext, aT as UNSAFE_NavigationContext, aU as UNSAFE_RouteContext, aV as UNSAFE_ViewTransitionContext, aL as UNSAFE_createBrowserHistory, aN as UNSAFE_createRouter, aM as UNSAFE_invariant, ak as createPath, ap as data, aq as generatePath, ar as isRouteErrorResponse, as as matchPath, at as matchRoutes, al as parsePath, au as redirect, av as redirectDocument, aw as replace, ax as resolvePath, ad as unstable_MiddlewareFunction, ag as unstable_RouterContext, aK as unstable_SerializesTo, aj as unstable_createContext } from './register-DEZBC9Yl.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ReactElement } from 'react';
|
|
5
5
|
import { ParseOptions, SerializeOptions } from 'cookie';
|
|
@@ -689,7 +689,7 @@ declare function useOutlet(context?: unknown): React.ReactElement | null;
|
|
|
689
689
|
*/
|
|
690
690
|
declare function useParams<ParamsOrKey extends string | Record<string, string | undefined> = string>(): Readonly<[
|
|
691
691
|
ParamsOrKey
|
|
692
|
-
] extends [string] ? Params
|
|
692
|
+
] extends [string] ? Params<ParamsOrKey> : Partial<ParamsOrKey>>;
|
|
693
693
|
/**
|
|
694
694
|
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.
|
|
695
695
|
|
|
@@ -2460,23 +2460,17 @@ type DevServerHooks = {
|
|
|
2460
2460
|
};
|
|
2461
2461
|
declare function setDevServerHooks(devServerHooks: DevServerHooks): void;
|
|
2462
2462
|
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
}
|
|
2471
|
-
|
|
2472
|
-
type AnyParams = Record<string, Record<string, string | undefined>>;
|
|
2473
|
-
type Params = Register extends {
|
|
2474
|
-
params: infer RegisteredParams extends AnyParams;
|
|
2475
|
-
} ? RegisteredParams : AnyParams;
|
|
2463
|
+
type AnyParams = Record<string, string | undefined>;
|
|
2464
|
+
type AnyPages = Record<string, {
|
|
2465
|
+
params: AnyParams;
|
|
2466
|
+
}>;
|
|
2467
|
+
type Pages = Register extends {
|
|
2468
|
+
pages: infer RegisteredPages extends AnyPages;
|
|
2469
|
+
} ? RegisteredPages : AnyPages;
|
|
2476
2470
|
type Args = {
|
|
2477
|
-
[K in keyof
|
|
2471
|
+
[K in keyof Pages]: ToArgs<Pages[K]["params"]>;
|
|
2478
2472
|
};
|
|
2479
|
-
type ToArgs<T> = Equal<T, {}> extends true ? [] : Partial<T> extends T ? [T] | [] : [
|
|
2473
|
+
type ToArgs<T extends AnyParams> = Equal<T, {}> extends true ? [] : Partial<T> extends T ? [T] | [] : [
|
|
2480
2474
|
T
|
|
2481
2475
|
];
|
|
2482
2476
|
/**
|
|
@@ -2527,4 +2521,4 @@ declare function getHydrationData(state: {
|
|
|
2527
2521
|
hasHydrateFallback: boolean;
|
|
2528
2522
|
}, location: Path, basename: string | undefined, isSpaMode: boolean): HydrationState;
|
|
2529
2523
|
|
|
2530
|
-
export { ActionFunction, ActionFunctionArgs, AppLoadContext, Await, type AwaitProps, Blocker, BlockerFunction, BrowserRouter, type BrowserRouterProps, ClientLoaderFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, type DOMRouterOpts, DataRouteObject, Router$1 as DataRouter, DataStrategyFunction, type EntryContext, Fetcher, type FetcherFormProps, type FetcherSubmitFunction, type FetcherSubmitOptions, type FetcherWithComponents, type FlashSessionData, Form, FormEncType, type FormProps, GetScrollRestorationKeyFunction, HTMLFormMethod, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HashRouter, type HashRouterProps, type HistoryRouterProps, HydrationState, IndexRouteObject, type IndexRouteProps, InitialEntry, type IsCookieFunction, type IsSessionFunction, type LayoutRouteProps, LazyRouteFunction, Link, type LinkProps, Links, LinksFunction, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouter, type MemoryRouterOpts, type MemoryRouterProps, Meta, MetaFunction, NavLink, type NavLinkProps, type NavLinkRenderProps, Navigate, type NavigateFunction, NavigateOptions, type NavigateProps, Navigation, Action as NavigationType, Navigator, NonIndexRouteObject, Outlet, type OutletProps, PageLinkDescriptor, type ParamKeyValuePair, ParamParseKey, Params
|
|
2524
|
+
export { ActionFunction, ActionFunctionArgs, AppLoadContext, Await, type AwaitProps, Blocker, BlockerFunction, BrowserRouter, type BrowserRouterProps, ClientLoaderFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, type DOMRouterOpts, DataRouteObject, Router$1 as DataRouter, DataStrategyFunction, type EntryContext, Fetcher, type FetcherFormProps, type FetcherSubmitFunction, type FetcherSubmitOptions, type FetcherWithComponents, type FlashSessionData, Form, FormEncType, type FormProps, GetScrollRestorationKeyFunction, HTMLFormMethod, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HashRouter, type HashRouterProps, type HistoryRouterProps, HydrationState, IndexRouteObject, type IndexRouteProps, InitialEntry, type IsCookieFunction, type IsSessionFunction, type LayoutRouteProps, LazyRouteFunction, Link, type LinkProps, Links, LinksFunction, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouter, type MemoryRouterOpts, type MemoryRouterProps, Meta, MetaFunction, NavLink, type NavLinkProps, type NavLinkRenderProps, Navigate, type NavigateFunction, NavigateOptions, type NavigateProps, Navigation, Action as NavigationType, Navigator, NonIndexRouteObject, Outlet, type OutletProps, PageLinkDescriptor, type ParamKeyValuePair, ParamParseKey, Params, PatchRoutesOnNavigationFunction, Path, PathMatch, PathPattern, type PathRouteProps, PrefetchPageLinks, Register, RelativeRoutingType, type RequestHandler, RevalidationState, Route$1 as Route, RouteMatch, RouteObject, type RouteProps, Router, RouterInit, type RouterProps, RouterProvider, type RouterProviderProps, RouterState, Routes, type RoutesProps, type RoutesTestStubProps, Scripts, type ScriptsProps, ScrollRestoration, type ScrollRestorationProps, type ServerBuild, type ServerEntryModule, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, type SetURLSearchParams, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, type SubmitFunction, type SubmitOptions, type SubmitTarget, To, UIMatch, type AssetsManifest as UNSAFE_AssetsManifest, FrameworkContext as UNSAFE_FrameworkContext, MiddlewareEnabled as UNSAFE_MiddlewareEnabled, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, createClientRoutes as UNSAFE_createClientRoutes, createClientRoutesWithHMRRevalidationOptOut as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getHydrationData as UNSAFE_getHydrationData, getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction, getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy, hydrationRouteProperties as UNSAFE_hydrationRouteProperties, mapRouteProperties as UNSAFE_mapRouteProperties, shouldHydrateRouteLoader as UNSAFE_shouldHydrateRouteLoader, useFogOFWarDiscovery as UNSAFE_useFogOFWarDiscovery, useScrollRestoration as UNSAFE_useScrollRestoration, type URLSearchParamsInit, createBrowserRouter, createCookie, createCookieSessionStorage, createHashRouter, createMemoryRouter, createMemorySessionStorage, createRequestHandler, createRoutesFromChildren, createRoutesFromElements, createRoutesStub, createSearchParams, createSession, createSessionStorage, createStaticHandler, createStaticRouter, href, isCookie, isSession, renderMatches, HistoryRouter as unstable_HistoryRouter, unstable_InitialContext, unstable_RouterContextProvider, setDevServerHooks as unstable_setDevServerHooks, usePrompt as unstable_usePrompt, useActionData, useAsyncError, useAsyncValue, useBeforeUnload, useBlocker, useFetcher, useFetchers, useFormAction, useHref, useInRouterContext, useLinkClickHandler, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, useSearchParams, useSubmit, useViewTransitionState };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-5bbc45fb6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -5652,25 +5652,11 @@ function RouterProvider({
|
|
|
5652
5652
|
viewTransitionOpts == null || isViewTransitionAvailable,
|
|
5653
5653
|
"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."
|
|
5654
5654
|
);
|
|
5655
|
-
const resetTransition = () => {
|
|
5656
|
-
setRenderDfd(void 0);
|
|
5657
|
-
setTransition(void 0);
|
|
5658
|
-
setPendingState(void 0);
|
|
5659
|
-
setVtContext({ isTransitioning: false });
|
|
5660
|
-
};
|
|
5661
5655
|
if (!viewTransitionOpts || !isViewTransitionAvailable) {
|
|
5662
|
-
renderDfd?.resolve();
|
|
5663
|
-
transition?.skipTransition();
|
|
5664
5656
|
if (reactDomFlushSyncImpl && flushSync) {
|
|
5665
|
-
reactDomFlushSyncImpl(() =>
|
|
5666
|
-
setStateImpl(newState);
|
|
5667
|
-
resetTransition();
|
|
5668
|
-
});
|
|
5657
|
+
reactDomFlushSyncImpl(() => setStateImpl(newState));
|
|
5669
5658
|
} else {
|
|
5670
|
-
React3.startTransition(() =>
|
|
5671
|
-
setStateImpl(newState);
|
|
5672
|
-
resetTransition();
|
|
5673
|
-
});
|
|
5659
|
+
React3.startTransition(() => setStateImpl(newState));
|
|
5674
5660
|
}
|
|
5675
5661
|
return;
|
|
5676
5662
|
}
|
|
@@ -5691,7 +5677,12 @@ function RouterProvider({
|
|
|
5691
5677
|
reactDomFlushSyncImpl(() => setStateImpl(newState));
|
|
5692
5678
|
});
|
|
5693
5679
|
t.finished.finally(() => {
|
|
5694
|
-
reactDomFlushSyncImpl(() =>
|
|
5680
|
+
reactDomFlushSyncImpl(() => {
|
|
5681
|
+
setRenderDfd(void 0);
|
|
5682
|
+
setTransition(void 0);
|
|
5683
|
+
setPendingState(void 0);
|
|
5684
|
+
setVtContext({ isTransitioning: false });
|
|
5685
|
+
});
|
|
5695
5686
|
});
|
|
5696
5687
|
reactDomFlushSyncImpl(() => setTransition(t));
|
|
5697
5688
|
return;
|
|
@@ -8799,7 +8790,7 @@ function mergeRefs(...refs) {
|
|
|
8799
8790
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
8800
8791
|
try {
|
|
8801
8792
|
if (isBrowser) {
|
|
8802
|
-
window.__reactRouterVersion = "0.0.0-experimental-
|
|
8793
|
+
window.__reactRouterVersion = "0.0.0-experimental-5bbc45fb6";
|
|
8803
8794
|
}
|
|
8804
8795
|
} catch (e) {
|
|
8805
8796
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-5bbc45fb6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -125,7 +125,7 @@ import {
|
|
|
125
125
|
useSearchParams,
|
|
126
126
|
useSubmit,
|
|
127
127
|
useViewTransitionState
|
|
128
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-EKICUOCX.mjs";
|
|
129
129
|
export {
|
|
130
130
|
Await,
|
|
131
131
|
BrowserRouter,
|
|
@@ -1,6 +1,57 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as Register } from '../../register-e9PGCFx1.mjs';
|
|
2
|
+
import { aV as Normalize, aW as ServerDataFrom, aX as ClientDataFrom, aY as Func, aE as LinkDescriptor, E as Equal, L as Location, aB as MetaDescriptor, aZ as unstable_MiddlewareNextFunction, ac as unstable_RouterContextProvider, s as MiddlewareEnabled, t as AppLoadContext, a_ as Pretty } from '../../route-data-BwJdBC92.mjs';
|
|
2
3
|
import 'react';
|
|
3
4
|
|
|
5
|
+
type AnyRoutes = Record<string, {
|
|
6
|
+
parentId?: string;
|
|
7
|
+
path?: string;
|
|
8
|
+
index?: boolean;
|
|
9
|
+
file: string;
|
|
10
|
+
params: Record<string, string | undefined>;
|
|
11
|
+
}>;
|
|
12
|
+
type RoutesPre = Register extends {
|
|
13
|
+
routesPre: infer RegisteredRoutes extends AnyRoutes;
|
|
14
|
+
} ? RegisteredRoutes : AnyRoutes;
|
|
15
|
+
type RouteId = keyof RoutesPre;
|
|
16
|
+
type GetParents<Id extends RouteId> = RoutesPre[Id] extends {
|
|
17
|
+
parentId: infer P extends RouteId;
|
|
18
|
+
} ? [
|
|
19
|
+
...GetParents<P>,
|
|
20
|
+
P
|
|
21
|
+
] : [
|
|
22
|
+
];
|
|
23
|
+
type _GetChildren<Id extends RouteId> = {
|
|
24
|
+
[K in RouteId]: RoutesPre[K] extends {
|
|
25
|
+
parentId: Id;
|
|
26
|
+
} ? RoutesPre[K] extends {
|
|
27
|
+
index: true;
|
|
28
|
+
} ? [K] : RoutesPre[K] extends {
|
|
29
|
+
path: undefined;
|
|
30
|
+
} ? [K, ...GetChildren<K>] : [
|
|
31
|
+
K
|
|
32
|
+
] | [K, ...GetChildren<K>] : [
|
|
33
|
+
];
|
|
34
|
+
}[RouteId];
|
|
35
|
+
type GetChildren<Id extends RouteId> = _GetChildren<Id> extends [] ? [] : Exclude<_GetChildren<Id>, []>;
|
|
36
|
+
type GetBranch<Id extends RouteId> = [
|
|
37
|
+
...GetParents<Id>,
|
|
38
|
+
Id,
|
|
39
|
+
..._GetChildren<Id>
|
|
40
|
+
];
|
|
41
|
+
type Branches = {
|
|
42
|
+
[Id in RouteId]: GetBranch<Id>;
|
|
43
|
+
};
|
|
44
|
+
type PartialParams = {
|
|
45
|
+
[Id in RouteId]: RoutesPre[Id]["params"];
|
|
46
|
+
};
|
|
47
|
+
type BranchParams<Branch extends Array<RouteId>> = Branch extends [
|
|
48
|
+
infer Id extends RouteId,
|
|
49
|
+
...infer Ids extends Array<RouteId>
|
|
50
|
+
] ? PartialParams[Id] & BranchParams<Ids> : {};
|
|
51
|
+
type Params = {
|
|
52
|
+
[Id in RouteId]: Normalize<BranchParams<Branches[Id]>>;
|
|
53
|
+
};
|
|
54
|
+
|
|
4
55
|
type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
|
|
5
56
|
type MaybePromise<T> = T | Promise<T>;
|
|
6
57
|
type RouteModule = {
|
|
@@ -11,30 +62,28 @@ type RouteModule = {
|
|
|
11
62
|
clientLoader?: Func;
|
|
12
63
|
action?: Func;
|
|
13
64
|
clientAction?: Func;
|
|
14
|
-
HydrateFallback?:
|
|
15
|
-
default?:
|
|
16
|
-
ErrorBoundary?:
|
|
65
|
+
HydrateFallback?: Func;
|
|
66
|
+
default?: Func;
|
|
67
|
+
ErrorBoundary?: Func;
|
|
17
68
|
[key: string]: unknown;
|
|
18
69
|
};
|
|
19
|
-
type
|
|
20
|
-
type RouteInfo = {
|
|
21
|
-
parents: RouteInfo[];
|
|
22
|
-
module: RouteModule;
|
|
23
|
-
id: unknown;
|
|
24
|
-
file: string;
|
|
25
|
-
path: string;
|
|
70
|
+
type Props = {
|
|
26
71
|
params: unknown;
|
|
27
72
|
loaderData: unknown;
|
|
28
73
|
actionData: unknown;
|
|
29
74
|
};
|
|
30
|
-
type
|
|
75
|
+
type RouteInfo = Props & {
|
|
76
|
+
parents: Props[];
|
|
77
|
+
module: RouteModule;
|
|
78
|
+
};
|
|
79
|
+
type MetaMatch<T extends Props> = Pretty<Pick<T, "params"> & {
|
|
31
80
|
pathname: string;
|
|
32
81
|
meta: MetaDescriptor[];
|
|
33
82
|
data: T["loaderData"];
|
|
34
83
|
handle?: unknown;
|
|
35
84
|
error?: unknown;
|
|
36
85
|
}>;
|
|
37
|
-
type MetaMatches<T extends
|
|
86
|
+
type MetaMatches<T extends Props[]> = T extends [infer F extends Props, ...infer R extends Props[]] ? [MetaMatch<F>, ...MetaMatches<R>] : Array<MetaMatch<RouteInfo> | undefined>;
|
|
38
87
|
type CreateMetaArgs<T extends RouteInfo> = {
|
|
39
88
|
/** This is the current router `Location` object. This is useful for generating tags for routes at specific paths or query parameters. */
|
|
40
89
|
location: Location;
|
|
@@ -155,12 +204,12 @@ type CreateHydrateFallbackProps<T extends RouteInfo> = {
|
|
|
155
204
|
loaderData?: T["loaderData"];
|
|
156
205
|
actionData?: T["actionData"];
|
|
157
206
|
};
|
|
158
|
-
type Match<T extends
|
|
207
|
+
type Match<T extends Props> = Pretty<Pick<T, "params"> & {
|
|
159
208
|
pathname: string;
|
|
160
209
|
data: T["loaderData"];
|
|
161
210
|
handle: unknown;
|
|
162
211
|
}>;
|
|
163
|
-
type Matches<T extends
|
|
212
|
+
type Matches<T extends Props[]> = T extends [infer F extends Props, ...infer R extends Props[]] ? [Match<F>, ...Matches<R>] : Array<Match<Props> | undefined>;
|
|
164
213
|
type CreateComponentProps<T extends RouteInfo> = {
|
|
165
214
|
/**
|
|
166
215
|
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
|
@@ -204,5 +253,23 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = {
|
|
|
204
253
|
loaderData?: T["loaderData"];
|
|
205
254
|
actionData?: T["actionData"];
|
|
206
255
|
};
|
|
256
|
+
type RouteModuleAnnotations<Info extends RouteInfo> = {
|
|
257
|
+
LinkDescriptors: LinkDescriptor[];
|
|
258
|
+
LinksFunction: () => LinkDescriptor[];
|
|
259
|
+
MetaArgs: CreateMetaArgs<Info>;
|
|
260
|
+
MetaDescriptors: MetaDescriptors;
|
|
261
|
+
MetaFunction: (args: CreateMetaArgs<Info>) => MetaDescriptors;
|
|
262
|
+
HeadersArgs: HeadersArgs;
|
|
263
|
+
HeadersFunction: (args: HeadersArgs) => Headers | HeadersInit;
|
|
264
|
+
unstable_MiddlewareFunction: CreateServerMiddlewareFunction<Info>;
|
|
265
|
+
unstable_ClientMiddlewareFunction: CreateClientMiddlewareFunction<Info>;
|
|
266
|
+
LoaderArgs: CreateServerLoaderArgs<Info>;
|
|
267
|
+
ClientLoaderArgs: CreateClientLoaderArgs<Info>;
|
|
268
|
+
ActionArgs: CreateServerActionArgs<Info>;
|
|
269
|
+
ClientActionArgs: CreateClientActionArgs<Info>;
|
|
270
|
+
HydrateFallbackProps: CreateHydrateFallbackProps<Info>;
|
|
271
|
+
ComponentProps: CreateComponentProps<Info>;
|
|
272
|
+
ErrorBoundaryProps: CreateErrorBoundaryProps<Info>;
|
|
273
|
+
};
|
|
207
274
|
|
|
208
|
-
export type { CreateActionData,
|
|
275
|
+
export type { CreateActionData, CreateLoaderData, Params, RouteModuleAnnotations };
|
package/dist/{production/lib/types/route-module.d.mts → development/lib/types/internal.d.ts}
RENAMED
|
@@ -1,6 +1,56 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aW as Normalize, a0 as Register, aX as ServerDataFrom, aY as ClientDataFrom, aZ as Func, aI as LinkDescriptor, $ as Equal, e as Location, aG as MetaDescriptor, a_ as unstable_MiddlewareNextFunction, u as unstable_RouterContextProvider, M as MiddlewareEnabled, i as AppLoadContext, a$ as Pretty } from '../../register-DEZBC9Yl.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
|
|
4
|
+
type AnyRoutes = Record<string, {
|
|
5
|
+
parentId?: string;
|
|
6
|
+
path?: string;
|
|
7
|
+
index?: boolean;
|
|
8
|
+
file: string;
|
|
9
|
+
params: Record<string, string | undefined>;
|
|
10
|
+
}>;
|
|
11
|
+
type RoutesPre = Register extends {
|
|
12
|
+
routesPre: infer RegisteredRoutes extends AnyRoutes;
|
|
13
|
+
} ? RegisteredRoutes : AnyRoutes;
|
|
14
|
+
type RouteId = keyof RoutesPre;
|
|
15
|
+
type GetParents<Id extends RouteId> = RoutesPre[Id] extends {
|
|
16
|
+
parentId: infer P extends RouteId;
|
|
17
|
+
} ? [
|
|
18
|
+
...GetParents<P>,
|
|
19
|
+
P
|
|
20
|
+
] : [
|
|
21
|
+
];
|
|
22
|
+
type _GetChildren<Id extends RouteId> = {
|
|
23
|
+
[K in RouteId]: RoutesPre[K] extends {
|
|
24
|
+
parentId: Id;
|
|
25
|
+
} ? RoutesPre[K] extends {
|
|
26
|
+
index: true;
|
|
27
|
+
} ? [K] : RoutesPre[K] extends {
|
|
28
|
+
path: undefined;
|
|
29
|
+
} ? [K, ...GetChildren<K>] : [
|
|
30
|
+
K
|
|
31
|
+
] | [K, ...GetChildren<K>] : [
|
|
32
|
+
];
|
|
33
|
+
}[RouteId];
|
|
34
|
+
type GetChildren<Id extends RouteId> = _GetChildren<Id> extends [] ? [] : Exclude<_GetChildren<Id>, []>;
|
|
35
|
+
type GetBranch<Id extends RouteId> = [
|
|
36
|
+
...GetParents<Id>,
|
|
37
|
+
Id,
|
|
38
|
+
..._GetChildren<Id>
|
|
39
|
+
];
|
|
40
|
+
type Branches = {
|
|
41
|
+
[Id in RouteId]: GetBranch<Id>;
|
|
42
|
+
};
|
|
43
|
+
type PartialParams = {
|
|
44
|
+
[Id in RouteId]: RoutesPre[Id]["params"];
|
|
45
|
+
};
|
|
46
|
+
type BranchParams<Branch extends Array<RouteId>> = Branch extends [
|
|
47
|
+
infer Id extends RouteId,
|
|
48
|
+
...infer Ids extends Array<RouteId>
|
|
49
|
+
] ? PartialParams[Id] & BranchParams<Ids> : {};
|
|
50
|
+
type Params = {
|
|
51
|
+
[Id in RouteId]: Normalize<BranchParams<Branches[Id]>>;
|
|
52
|
+
};
|
|
53
|
+
|
|
4
54
|
type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
|
|
5
55
|
type MaybePromise<T> = T | Promise<T>;
|
|
6
56
|
type RouteModule = {
|
|
@@ -11,30 +61,28 @@ type RouteModule = {
|
|
|
11
61
|
clientLoader?: Func;
|
|
12
62
|
action?: Func;
|
|
13
63
|
clientAction?: Func;
|
|
14
|
-
HydrateFallback?:
|
|
15
|
-
default?:
|
|
16
|
-
ErrorBoundary?:
|
|
64
|
+
HydrateFallback?: Func;
|
|
65
|
+
default?: Func;
|
|
66
|
+
ErrorBoundary?: Func;
|
|
17
67
|
[key: string]: unknown;
|
|
18
68
|
};
|
|
19
|
-
type
|
|
20
|
-
type RouteInfo = {
|
|
21
|
-
parents: RouteInfo[];
|
|
22
|
-
module: RouteModule;
|
|
23
|
-
id: unknown;
|
|
24
|
-
file: string;
|
|
25
|
-
path: string;
|
|
69
|
+
type Props = {
|
|
26
70
|
params: unknown;
|
|
27
71
|
loaderData: unknown;
|
|
28
72
|
actionData: unknown;
|
|
29
73
|
};
|
|
30
|
-
type
|
|
74
|
+
type RouteInfo = Props & {
|
|
75
|
+
parents: Props[];
|
|
76
|
+
module: RouteModule;
|
|
77
|
+
};
|
|
78
|
+
type MetaMatch<T extends Props> = Pretty<Pick<T, "params"> & {
|
|
31
79
|
pathname: string;
|
|
32
80
|
meta: MetaDescriptor[];
|
|
33
81
|
data: T["loaderData"];
|
|
34
82
|
handle?: unknown;
|
|
35
83
|
error?: unknown;
|
|
36
84
|
}>;
|
|
37
|
-
type MetaMatches<T extends
|
|
85
|
+
type MetaMatches<T extends Props[]> = T extends [infer F extends Props, ...infer R extends Props[]] ? [MetaMatch<F>, ...MetaMatches<R>] : Array<MetaMatch<RouteInfo> | undefined>;
|
|
38
86
|
type CreateMetaArgs<T extends RouteInfo> = {
|
|
39
87
|
/** This is the current router `Location` object. This is useful for generating tags for routes at specific paths or query parameters. */
|
|
40
88
|
location: Location;
|
|
@@ -155,12 +203,12 @@ type CreateHydrateFallbackProps<T extends RouteInfo> = {
|
|
|
155
203
|
loaderData?: T["loaderData"];
|
|
156
204
|
actionData?: T["actionData"];
|
|
157
205
|
};
|
|
158
|
-
type Match<T extends
|
|
206
|
+
type Match<T extends Props> = Pretty<Pick<T, "params"> & {
|
|
159
207
|
pathname: string;
|
|
160
208
|
data: T["loaderData"];
|
|
161
209
|
handle: unknown;
|
|
162
210
|
}>;
|
|
163
|
-
type Matches<T extends
|
|
211
|
+
type Matches<T extends Props[]> = T extends [infer F extends Props, ...infer R extends Props[]] ? [Match<F>, ...Matches<R>] : Array<Match<Props> | undefined>;
|
|
164
212
|
type CreateComponentProps<T extends RouteInfo> = {
|
|
165
213
|
/**
|
|
166
214
|
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
|
@@ -204,5 +252,23 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = {
|
|
|
204
252
|
loaderData?: T["loaderData"];
|
|
205
253
|
actionData?: T["actionData"];
|
|
206
254
|
};
|
|
255
|
+
type RouteModuleAnnotations<Info extends RouteInfo> = {
|
|
256
|
+
LinkDescriptors: LinkDescriptor[];
|
|
257
|
+
LinksFunction: () => LinkDescriptor[];
|
|
258
|
+
MetaArgs: CreateMetaArgs<Info>;
|
|
259
|
+
MetaDescriptors: MetaDescriptors;
|
|
260
|
+
MetaFunction: (args: CreateMetaArgs<Info>) => MetaDescriptors;
|
|
261
|
+
HeadersArgs: HeadersArgs;
|
|
262
|
+
HeadersFunction: (args: HeadersArgs) => Headers | HeadersInit;
|
|
263
|
+
unstable_MiddlewareFunction: CreateServerMiddlewareFunction<Info>;
|
|
264
|
+
unstable_ClientMiddlewareFunction: CreateClientMiddlewareFunction<Info>;
|
|
265
|
+
LoaderArgs: CreateServerLoaderArgs<Info>;
|
|
266
|
+
ClientLoaderArgs: CreateClientLoaderArgs<Info>;
|
|
267
|
+
ActionArgs: CreateServerActionArgs<Info>;
|
|
268
|
+
ClientActionArgs: CreateClientActionArgs<Info>;
|
|
269
|
+
HydrateFallbackProps: CreateHydrateFallbackProps<Info>;
|
|
270
|
+
ComponentProps: CreateComponentProps<Info>;
|
|
271
|
+
ErrorBoundaryProps: CreateErrorBoundaryProps<Info>;
|
|
272
|
+
};
|
|
207
273
|
|
|
208
|
-
export type { CreateActionData,
|
|
274
|
+
export type { CreateActionData, CreateLoaderData, Params, RouteModuleAnnotations };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-5bbc45fb6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -23,6 +23,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
23
23
|
};
|
|
24
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
25
|
|
|
26
|
-
// lib/types/
|
|
27
|
-
var
|
|
28
|
-
module.exports = __toCommonJS(
|
|
26
|
+
// lib/types/internal.ts
|
|
27
|
+
var internal_exports = {};
|
|
28
|
+
module.exports = __toCommonJS(internal_exports);
|