react-router 0.0.0-experimental-00e730ed0 → 0.0.0-experimental-93ddf3985

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.
Files changed (35) hide show
  1. package/dist/development/{chunk-W26YWAGH.mjs → chunk-H6SUWWJW.mjs} +2 -2
  2. package/dist/development/dom-export.d.mts +2 -2
  3. package/dist/development/dom-export.js +1 -1
  4. package/dist/development/dom-export.mjs +2 -2
  5. package/dist/development/index.d.mts +9 -15
  6. package/dist/development/index.d.ts +5 -12
  7. package/dist/development/index.js +2 -2
  8. package/dist/development/index.mjs +2 -2
  9. package/dist/development/lib/types/internal.d.mts +39 -103
  10. package/dist/development/lib/types/internal.d.ts +38 -102
  11. package/dist/development/lib/types/internal.js +1 -1
  12. package/dist/development/lib/types/internal.mjs +1 -1
  13. package/dist/development/{lib-DRnPBLeb.d.mts → lib-B8x_tOvL.d.mts} +1 -1
  14. package/dist/{production/register-BPC2Sp5k.d.ts → development/register-BkDIKxVz.d.ts} +63 -14
  15. package/dist/development/register-DeIo2iHO.d.mts +24 -0
  16. package/dist/development/{route-data-Wlht-qYx.d.mts → route-data-WyrduLgj.d.mts} +49 -14
  17. package/dist/production/{chunk-2WAHFPTY.mjs → chunk-XAIJRHVU.mjs} +2 -2
  18. package/dist/production/dom-export.d.mts +2 -2
  19. package/dist/production/dom-export.js +1 -1
  20. package/dist/production/dom-export.mjs +2 -2
  21. package/dist/production/index.d.mts +9 -15
  22. package/dist/production/index.d.ts +5 -12
  23. package/dist/production/index.js +2 -2
  24. package/dist/production/index.mjs +2 -2
  25. package/dist/production/lib/types/internal.d.mts +39 -103
  26. package/dist/production/lib/types/internal.d.ts +38 -102
  27. package/dist/production/lib/types/internal.js +1 -1
  28. package/dist/production/lib/types/internal.mjs +1 -1
  29. package/dist/production/{lib-DRnPBLeb.d.mts → lib-B8x_tOvL.d.mts} +1 -1
  30. package/dist/{development/register-BPC2Sp5k.d.ts → production/register-BkDIKxVz.d.ts} +63 -14
  31. package/dist/production/register-DeIo2iHO.d.mts +24 -0
  32. package/dist/production/{route-data-Wlht-qYx.d.mts → route-data-WyrduLgj.d.mts} +49 -14
  33. package/package.json +1 -1
  34. package/dist/development/register-e9PGCFx1.d.mts +0 -10
  35. package/dist/production/register-e9PGCFx1.d.mts +0 -10
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-00e730ed0
2
+ * react-router v0.0.0-experimental-93ddf3985
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -8679,7 +8679,7 @@ function mergeRefs(...refs) {
8679
8679
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
8680
8680
  try {
8681
8681
  if (isBrowser) {
8682
- window.__reactRouterVersion = "0.0.0-experimental-00e730ed0";
8682
+ window.__reactRouterVersion = "0.0.0-experimental-93ddf3985";
8683
8683
  }
8684
8684
  } catch (e) {
8685
8685
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { R as RouterProviderProps$1 } from './lib-DRnPBLeb.mjs';
3
- import { R as RouterInit } from './route-data-Wlht-qYx.mjs';
2
+ import { R as RouterProviderProps$1 } from './lib-B8x_tOvL.mjs';
3
+ import { R as RouterInit } from './route-data-WyrduLgj.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-00e730ed0
2
+ * react-router v0.0.0-experimental-93ddf3985
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-00e730ed0
2
+ * react-router v0.0.0-experimental-93ddf3985
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-W26YWAGH.mjs";
28
+ } from "./chunk-H6SUWWJW.mjs";
29
29
 
30
30
  // lib/dom-export/dom-router-provider.tsx
31
31
  import * as React from "react";
@@ -1,12 +1,13 @@
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, U as UIMatch, S as SerializeFrom, B as BlockerFunction, j as Blocker, k as StaticHandlerContext, l as StaticHandler, F as FutureConfig, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, u as unstable_InitialContext, m as IndexRouteObject, n as NonIndexRouteObject, o as LoaderFunction, p as ActionFunction, M as MetaFunction, q as LinksFunction, r as MiddlewareEnabled, s as AppLoadContext, E as Equal, t as RouterState, v as PatchRoutesOnNavigationFunction, w as DataRouteObject, x as ClientLoaderFunction } from './route-data-Wlht-qYx.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, z as Fetcher, a0 as FormEncType, a1 as FormMethod, aF as Future, G as GetScrollPositionFunction, y 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, J as NavigationStates, as as Navigator, aC as PageLinkDescriptor, at as PatchRoutesOnNavigationFunctionArgs, a6 as PathParam, a7 as RedirectFunction, V as RevalidationState, au as RouteMatch, Q as RouterFetchOptions, R as RouterInit, O as RouterNavigateOptions, K 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-Wlht-qYx.mjs';
3
- import { A as AssetsManifest, E as EntryContext, F as FutureConfig$1, S as ServerBuild } from './lib-DRnPBLeb.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-DRnPBLeb.mjs';
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, U as UIMatch, S as SerializeFrom, B as BlockerFunction, j as Blocker, k as StaticHandlerContext, l as StaticHandler, F as FutureConfig, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, u as unstable_InitialContext, m as IndexRouteObject, n as NonIndexRouteObject, o as LoaderFunction, p as ActionFunction, M as MetaFunction, q as LinksFunction, r as MiddlewareEnabled, s as AppLoadContext, E as Equal, t as RouterState, v as PatchRoutesOnNavigationFunction, w as DataRouteObject, x as ClientLoaderFunction } from './route-data-WyrduLgj.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, z as Fetcher, a0 as FormEncType, a1 as FormMethod, aF as Future, G as GetScrollPositionFunction, y 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, J as NavigationStates, as as Navigator, aC as PageLinkDescriptor, at as PatchRoutesOnNavigationFunctionArgs, a6 as PathParam, a7 as RedirectFunction, V as RevalidationState, au as RouteMatch, Q as RouterFetchOptions, R as RouterInit, O as RouterNavigateOptions, K 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-WyrduLgj.mjs';
3
+ import { A as AssetsManifest, E as EntryContext, F as FutureConfig$1, S as ServerBuild } from './lib-B8x_tOvL.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-B8x_tOvL.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
+ import { P as Pages } from './register-DeIo2iHO.mjs';
10
+ export { R as Register } from './register-DeIo2iHO.mjs';
10
11
 
11
12
  declare const SingleFetchRedirectSymbol: unique symbol;
12
13
  declare function getTurboStreamSingleFetchDataStrategy(getRouter: () => Router, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, basename: string | undefined): DataStrategyFunction;
@@ -745,18 +746,11 @@ type DevServerHooks = {
745
746
  };
746
747
  declare function setDevServerHooks(devServerHooks: DevServerHooks): void;
747
748
 
748
- type AnyParams = Record<string, string | undefined>;
749
- type AnyPages = Record<string, {
750
- params: AnyParams;
751
- }>;
752
- type Pages = Register extends {
753
- pages: infer RegisteredPages extends AnyPages;
754
- } ? RegisteredPages : AnyPages;
755
749
  type Args = {
756
750
  [K in keyof Pages]: ToArgs<Pages[K]["params"]>;
757
751
  };
758
- type ToArgs<T extends AnyParams> = Equal<T, {}> extends true ? [] : Partial<T> extends T ? [T] | [] : [
759
- T
752
+ type ToArgs<Params extends Record<string, string | undefined>> = Equal<Params, {}> extends true ? [] : Partial<Params> extends Params ? [Params] | [] : [
753
+ Params
760
754
  ];
761
755
  /**
762
756
  Returns a resolved URL path for the specified route.
@@ -806,4 +800,4 @@ declare function getHydrationData(state: {
806
800
  hasHydrateFallback: boolean;
807
801
  }, location: Path, basename: string | undefined, isSpaMode: boolean): HydrationState;
808
802
 
809
- 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, 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 };
803
+ 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, RelativeRoutingType, type RequestHandler, 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, v as Navigation, U as UIMatch, w as SerializeFrom, B as BlockerFunction, x as Blocker, y as HTMLFormMethod, z as FormEncType, E as PageLinkDescriptor, G as History, J as GetScrollRestorationKeyFunction, K as Fetcher, O as StaticHandler, Q as CreateStaticHandlerOptions$1, V as unstable_InitialContext, W as LoaderFunction, X as ActionFunction, Y as MetaFunction, Z as LinksFunction, _ as Equal, $ as Register, a0 as RouterState } from './register-BPC2Sp5k.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, a1 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, a2 as NavigationStates, az as PatchRoutesOnNavigationFunctionArgs, ae as PathParam, af as RedirectFunction, a6 as RevalidationState, a5 as RouterFetchOptions, a4 as RouterNavigateOptions, a3 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-BPC2Sp5k.js';
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, U as UIMatch, w as SerializeFrom, B as BlockerFunction, x as Blocker, y as HTMLFormMethod, z as FormEncType, E as PageLinkDescriptor, G as History, J as GetScrollRestorationKeyFunction, K as Fetcher, O as StaticHandler, Q as CreateStaticHandlerOptions$1, V as unstable_InitialContext, W as LoaderFunction, X as ActionFunction, Y as MetaFunction, Z as LinksFunction, _ as Pages, $ as Equal, a0 as RouterState } from './register-BkDIKxVz.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, a1 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, a2 as NavigationStates, az as PatchRoutesOnNavigationFunctionArgs, ae as PathParam, af as RedirectFunction, aL as Register, a6 as RevalidationState, a5 as RouterFetchOptions, a4 as RouterNavigateOptions, a3 as RouterSubscriber, ah as ShouldRevalidateFunction, ai as ShouldRevalidateFunctionArgs, aQ as UNSAFE_DataRouterContext, aR as UNSAFE_DataRouterStateContext, aa as UNSAFE_DataWithResponseInit, aP as UNSAFE_ErrorResponseImpl, aS as UNSAFE_FetchersContext, aT as UNSAFE_LocationContext, aU as UNSAFE_NavigationContext, aV as UNSAFE_RouteContext, aW as UNSAFE_ViewTransitionContext, aM as UNSAFE_createBrowserHistory, aO as UNSAFE_createRouter, aN 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-BkDIKxVz.js';
3
3
  import * as React from 'react';
4
4
  import { ReactElement } from 'react';
5
5
  import { ParseOptions, SerializeOptions } from 'cookie';
@@ -2474,18 +2474,11 @@ type DevServerHooks = {
2474
2474
  };
2475
2475
  declare function setDevServerHooks(devServerHooks: DevServerHooks): void;
2476
2476
 
2477
- type AnyParams = Record<string, string | undefined>;
2478
- type AnyPages = Record<string, {
2479
- params: AnyParams;
2480
- }>;
2481
- type Pages = Register extends {
2482
- pages: infer RegisteredPages extends AnyPages;
2483
- } ? RegisteredPages : AnyPages;
2484
2477
  type Args = {
2485
2478
  [K in keyof Pages]: ToArgs<Pages[K]["params"]>;
2486
2479
  };
2487
- type ToArgs<T extends AnyParams> = Equal<T, {}> extends true ? [] : Partial<T> extends T ? [T] | [] : [
2488
- T
2480
+ type ToArgs<Params extends Record<string, string | undefined>> = Equal<Params, {}> extends true ? [] : Partial<Params> extends Params ? [Params] | [] : [
2481
+ Params
2489
2482
  ];
2490
2483
  /**
2491
2484
  Returns a resolved URL path for the specified route.
@@ -2535,4 +2528,4 @@ declare function getHydrationData(state: {
2535
2528
  hasHydrateFallback: boolean;
2536
2529
  }, location: Path, basename: string | undefined, isSpaMode: boolean): HydrationState;
2537
2530
 
2538
- 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, 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 };
2531
+ 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, RelativeRoutingType, type RequestHandler, 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-00e730ed0
2
+ * react-router v0.0.0-experimental-93ddf3985
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -8829,7 +8829,7 @@ function mergeRefs(...refs) {
8829
8829
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
8830
8830
  try {
8831
8831
  if (isBrowser) {
8832
- window.__reactRouterVersion = "0.0.0-experimental-00e730ed0";
8832
+ window.__reactRouterVersion = "0.0.0-experimental-93ddf3985";
8833
8833
  }
8834
8834
  } catch (e) {
8835
8835
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-00e730ed0
2
+ * react-router v0.0.0-experimental-93ddf3985
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-W26YWAGH.mjs";
128
+ } from "./chunk-H6SUWWJW.mjs";
129
129
  export {
130
130
  Await,
131
131
  BrowserRouter,
@@ -1,102 +1,42 @@
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, r as MiddlewareEnabled, s as AppLoadContext, a_ as Pretty } from '../../route-data-Wlht-qYx.mjs';
1
+ import { aE as LinkDescriptor, aV as RouteModule, L as Location, aB as MetaDescriptor, aW as unstable_MiddlewareNextFunction, aX as ServerDataFrom, ac as unstable_RouterContextProvider, r as MiddlewareEnabled, s as AppLoadContext, aY as Pretty, aZ as GetLoaderData, a_ as Normalize, a$ as GetActionData } from '../../route-data-WyrduLgj.mjs';
2
+ import { a as RouteFiles, P as Pages } from '../../register-DeIo2iHO.mjs';
3
3
  import 'react';
4
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
- ...(RoutesPre[Id] extends {
40
- path: undefined;
41
- } ? GetChildren<Id> : _GetChildren<Id>)
42
- ];
43
- type Branches = {
44
- [Id in RouteId]: GetBranch<Id>;
45
- };
46
- type PartialParams = {
47
- [Id in RouteId]: RoutesPre[Id]["params"];
48
- };
49
- type BranchParams<Branch extends Array<RouteId>> = Branch extends [
50
- infer Id extends RouteId,
51
- ...infer Ids extends Array<RouteId>
52
- ] ? PartialParams[Id] & BranchParams<Ids> : {};
53
- type Params = {
54
- [Id in RouteId]: Normalize<BranchParams<Branches[Id]>>;
55
- };
56
-
57
- type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
58
5
  type MaybePromise<T> = T | Promise<T>;
59
- type RouteModule = {
60
- meta?: Func;
61
- links?: Func;
62
- headers?: Func;
63
- loader?: Func;
64
- clientLoader?: Func;
65
- action?: Func;
66
- clientAction?: Func;
67
- HydrateFallback?: Func;
68
- default?: Func;
69
- ErrorBoundary?: Func;
70
- [key: string]: unknown;
71
- };
72
6
  type Props = {
73
7
  params: unknown;
74
8
  loaderData: unknown;
75
9
  actionData: unknown;
76
10
  };
77
11
  type RouteInfo = Props & {
78
- parents: Props[];
12
+ module: RouteModule;
13
+ matches: Array<MatchInfo>;
14
+ };
15
+ type MatchInfo = {
16
+ id: string;
79
17
  module: RouteModule;
80
18
  };
81
- type MetaMatch<T extends Props> = Pretty<Pick<T, "params"> & {
19
+ type MetaMatch<T extends MatchInfo> = Pretty<{
20
+ id: T["id"];
21
+ params: Record<string, string | undefined>;
82
22
  pathname: string;
83
23
  meta: MetaDescriptor[];
84
- data: T["loaderData"];
24
+ data: GetLoaderData<T["module"]>;
85
25
  handle?: unknown;
86
26
  error?: unknown;
87
27
  }>;
88
- type MetaMatches<T extends Props[]> = T extends [infer F extends Props, ...infer R extends Props[]] ? [MetaMatch<F>, ...MetaMatches<R>] : Array<MetaMatch<RouteInfo> | undefined>;
28
+ type MetaMatches<T extends Array<MatchInfo>> = T extends [infer F extends MatchInfo, ...infer R extends Array<MatchInfo>] ? [MetaMatch<F>, ...MetaMatches<R>] : Array<MetaMatch<MatchInfo> | undefined>;
89
29
  type CreateMetaArgs<T extends RouteInfo> = {
90
30
  /** This is the current router `Location` object. This is useful for generating tags for routes at specific paths or query parameters. */
91
31
  location: Location;
92
32
  /** {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route. */
93
33
  params: T["params"];
94
34
  /** The return value for this route's server loader function */
95
- data: T["loaderData"];
35
+ data: T["loaderData"] | undefined;
96
36
  /** Thrown errors that trigger error boundaries will be passed to the meta function. This is useful for generating metadata for error pages. */
97
37
  error?: unknown;
98
38
  /** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
99
- matches: MetaMatches<[...T["parents"], T]>;
39
+ matches: MetaMatches<T["matches"]>;
100
40
  };
101
41
  type MetaDescriptors = MetaDescriptor[];
102
42
  type HeadersArgs = {
@@ -105,26 +45,6 @@ type HeadersArgs = {
105
45
  actionHeaders: Headers;
106
46
  errorHeaders: Headers | undefined;
107
47
  };
108
- type IsHydrate<ClientLoader> = ClientLoader extends {
109
- hydrate: true;
110
- } ? true : ClientLoader extends {
111
- hydrate: false;
112
- } ? false : false;
113
- type CreateLoaderData<T extends RouteModule> = _CreateLoaderData<ServerDataFrom<T["loader"]>, ClientDataFrom<T["clientLoader"]>, IsHydrate<T["clientLoader"]>, T extends {
114
- HydrateFallback: Func;
115
- } ? true : false>;
116
- type _CreateLoaderData<ServerLoaderData, ClientLoaderData, ClientLoaderHydrate extends boolean, HasHydrateFallback> = [
117
- HasHydrateFallback,
118
- ClientLoaderHydrate
119
- ] extends [true, true] ? IsDefined<ClientLoaderData> extends true ? ClientLoaderData : undefined : [
120
- IsDefined<ClientLoaderData>,
121
- IsDefined<ServerLoaderData>
122
- ] extends [true, true] ? ServerLoaderData | ClientLoaderData : IsDefined<ClientLoaderData> extends true ? ClientLoaderData : IsDefined<ServerLoaderData> extends true ? ServerLoaderData : undefined;
123
- type CreateActionData<T extends RouteModule> = _CreateActionData<ServerDataFrom<T["action"]>, ClientDataFrom<T["clientAction"]>>;
124
- type _CreateActionData<ServerActionData, ClientActionData> = Awaited<[
125
- IsDefined<ServerActionData>,
126
- IsDefined<ClientActionData>
127
- ] extends [true, true] ? ServerActionData | ClientActionData : IsDefined<ClientActionData> extends true ? ClientActionData : IsDefined<ServerActionData> extends true ? ServerActionData : undefined>;
128
48
  type ClientDataFunctionArgs<T extends RouteInfo> = {
129
49
  /**
130
50
  * A {@link https://developer.mozilla.org/en-US/docs/Web/API/Request Fetch Request instance} which you can use to read the URL, the method, the "content-type" header, and the request body from the request.
@@ -148,9 +68,12 @@ type ClientDataFunctionArgs<T extends RouteInfo> = {
148
68
  **/
149
69
  params: T["params"];
150
70
  /**
151
- * This is a `RouterContextProvider` instance generated from your router's
152
- * `unstable_getContext` function and/or populated from route middleware
153
- * functions.
71
+ * When `future.unstable_middleware` is not enabled, this is undefined.
72
+ *
73
+ * When `future.unstable_middleware` is enabled, this is an instance of
74
+ * `unstable_RouterContextProvider` and can be used to access context values
75
+ * from your route middlewares. You may pass in initial context values in your
76
+ * `<HydratedRouter unstable_getContext>` prop
154
77
  */
155
78
  context: unstable_RouterContextProvider;
156
79
  };
@@ -203,12 +126,14 @@ type CreateHydrateFallbackProps<T extends RouteInfo> = {
203
126
  loaderData?: T["loaderData"];
204
127
  actionData?: T["actionData"];
205
128
  };
206
- type Match<T extends Props> = Pretty<Pick<T, "params"> & {
129
+ type Match<T extends MatchInfo> = Pretty<{
130
+ id: T["id"];
131
+ params: Record<string, string | undefined>;
207
132
  pathname: string;
208
- data: T["loaderData"];
133
+ data: GetLoaderData<T["module"]>;
209
134
  handle: unknown;
210
135
  }>;
211
- type Matches<T extends Props[]> = T extends [infer F extends Props, ...infer R extends Props[]] ? [Match<F>, ...Matches<R>] : Array<Match<Props> | undefined>;
136
+ type Matches<T extends Array<MatchInfo>> = T extends [infer F extends MatchInfo, ...infer R extends Array<MatchInfo>] ? [Match<F>, ...Matches<R>] : Array<Match<MatchInfo> | undefined>;
212
137
  type CreateComponentProps<T extends RouteInfo> = {
213
138
  /**
214
139
  * {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
@@ -230,7 +155,7 @@ type CreateComponentProps<T extends RouteInfo> = {
230
155
  /** The data returned from the `action` or `clientAction` following an action submission. */
231
156
  actionData?: T["actionData"];
232
157
  /** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
233
- matches: Matches<[...T["parents"], T]>;
158
+ matches: Matches<T["matches"]>;
234
159
  };
235
160
  type CreateErrorBoundaryProps<T extends RouteInfo> = {
236
161
  /**
@@ -252,7 +177,7 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = {
252
177
  loaderData?: T["loaderData"];
253
178
  actionData?: T["actionData"];
254
179
  };
255
- type RouteModuleAnnotations<Info extends RouteInfo> = {
180
+ type GetAnnotations<Info extends RouteInfo> = {
256
181
  LinkDescriptors: LinkDescriptor[];
257
182
  LinksFunction: () => LinkDescriptor[];
258
183
  MetaArgs: CreateMetaArgs<Info>;
@@ -271,4 +196,15 @@ type RouteModuleAnnotations<Info extends RouteInfo> = {
271
196
  ErrorBoundaryProps: CreateErrorBoundaryProps<Info>;
272
197
  };
273
198
 
274
- export type { CreateActionData, CreateLoaderData, Params, RouteModuleAnnotations };
199
+ type Params<RouteFile extends keyof RouteFiles> = Normalize<Pages[RouteFiles[RouteFile]["page"]]["params"]>;
200
+
201
+ type GetInfo<T extends {
202
+ file: keyof RouteFiles;
203
+ module: RouteModule;
204
+ }> = {
205
+ params: Params<T["file"]>;
206
+ loaderData: GetLoaderData<T["module"]>;
207
+ actionData: GetActionData<T["module"]>;
208
+ };
209
+
210
+ export type { GetAnnotations, GetInfo };
@@ -1,101 +1,41 @@
1
- import { aW as Normalize, $ 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-BPC2Sp5k.js';
1
+ import { aI as LinkDescriptor, aX as RouteModule, e as Location, aG as MetaDescriptor, aY as unstable_MiddlewareNextFunction, aZ as ServerDataFrom, u as unstable_RouterContextProvider, M as MiddlewareEnabled, i as AppLoadContext, a_ as Pretty, a$ as GetLoaderData, b0 as RouteFiles, b1 as Normalize, _ as Pages, b2 as GetActionData } from '../../register-BkDIKxVz.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
- ...(RoutesPre[Id] extends {
39
- path: undefined;
40
- } ? GetChildren<Id> : _GetChildren<Id>)
41
- ];
42
- type Branches = {
43
- [Id in RouteId]: GetBranch<Id>;
44
- };
45
- type PartialParams = {
46
- [Id in RouteId]: RoutesPre[Id]["params"];
47
- };
48
- type BranchParams<Branch extends Array<RouteId>> = Branch extends [
49
- infer Id extends RouteId,
50
- ...infer Ids extends Array<RouteId>
51
- ] ? PartialParams[Id] & BranchParams<Ids> : {};
52
- type Params = {
53
- [Id in RouteId]: Normalize<BranchParams<Branches[Id]>>;
54
- };
55
-
56
- type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
57
4
  type MaybePromise<T> = T | Promise<T>;
58
- type RouteModule = {
59
- meta?: Func;
60
- links?: Func;
61
- headers?: Func;
62
- loader?: Func;
63
- clientLoader?: Func;
64
- action?: Func;
65
- clientAction?: Func;
66
- HydrateFallback?: Func;
67
- default?: Func;
68
- ErrorBoundary?: Func;
69
- [key: string]: unknown;
70
- };
71
5
  type Props = {
72
6
  params: unknown;
73
7
  loaderData: unknown;
74
8
  actionData: unknown;
75
9
  };
76
10
  type RouteInfo = Props & {
77
- parents: Props[];
11
+ module: RouteModule;
12
+ matches: Array<MatchInfo>;
13
+ };
14
+ type MatchInfo = {
15
+ id: string;
78
16
  module: RouteModule;
79
17
  };
80
- type MetaMatch<T extends Props> = Pretty<Pick<T, "params"> & {
18
+ type MetaMatch<T extends MatchInfo> = Pretty<{
19
+ id: T["id"];
20
+ params: Record<string, string | undefined>;
81
21
  pathname: string;
82
22
  meta: MetaDescriptor[];
83
- data: T["loaderData"];
23
+ data: GetLoaderData<T["module"]>;
84
24
  handle?: unknown;
85
25
  error?: unknown;
86
26
  }>;
87
- type MetaMatches<T extends Props[]> = T extends [infer F extends Props, ...infer R extends Props[]] ? [MetaMatch<F>, ...MetaMatches<R>] : Array<MetaMatch<RouteInfo> | undefined>;
27
+ type MetaMatches<T extends Array<MatchInfo>> = T extends [infer F extends MatchInfo, ...infer R extends Array<MatchInfo>] ? [MetaMatch<F>, ...MetaMatches<R>] : Array<MetaMatch<MatchInfo> | undefined>;
88
28
  type CreateMetaArgs<T extends RouteInfo> = {
89
29
  /** This is the current router `Location` object. This is useful for generating tags for routes at specific paths or query parameters. */
90
30
  location: Location;
91
31
  /** {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route. */
92
32
  params: T["params"];
93
33
  /** The return value for this route's server loader function */
94
- data: T["loaderData"];
34
+ data: T["loaderData"] | undefined;
95
35
  /** Thrown errors that trigger error boundaries will be passed to the meta function. This is useful for generating metadata for error pages. */
96
36
  error?: unknown;
97
37
  /** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
98
- matches: MetaMatches<[...T["parents"], T]>;
38
+ matches: MetaMatches<T["matches"]>;
99
39
  };
100
40
  type MetaDescriptors = MetaDescriptor[];
101
41
  type HeadersArgs = {
@@ -104,26 +44,6 @@ type HeadersArgs = {
104
44
  actionHeaders: Headers;
105
45
  errorHeaders: Headers | undefined;
106
46
  };
107
- type IsHydrate<ClientLoader> = ClientLoader extends {
108
- hydrate: true;
109
- } ? true : ClientLoader extends {
110
- hydrate: false;
111
- } ? false : false;
112
- type CreateLoaderData<T extends RouteModule> = _CreateLoaderData<ServerDataFrom<T["loader"]>, ClientDataFrom<T["clientLoader"]>, IsHydrate<T["clientLoader"]>, T extends {
113
- HydrateFallback: Func;
114
- } ? true : false>;
115
- type _CreateLoaderData<ServerLoaderData, ClientLoaderData, ClientLoaderHydrate extends boolean, HasHydrateFallback> = [
116
- HasHydrateFallback,
117
- ClientLoaderHydrate
118
- ] extends [true, true] ? IsDefined<ClientLoaderData> extends true ? ClientLoaderData : undefined : [
119
- IsDefined<ClientLoaderData>,
120
- IsDefined<ServerLoaderData>
121
- ] extends [true, true] ? ServerLoaderData | ClientLoaderData : IsDefined<ClientLoaderData> extends true ? ClientLoaderData : IsDefined<ServerLoaderData> extends true ? ServerLoaderData : undefined;
122
- type CreateActionData<T extends RouteModule> = _CreateActionData<ServerDataFrom<T["action"]>, ClientDataFrom<T["clientAction"]>>;
123
- type _CreateActionData<ServerActionData, ClientActionData> = Awaited<[
124
- IsDefined<ServerActionData>,
125
- IsDefined<ClientActionData>
126
- ] extends [true, true] ? ServerActionData | ClientActionData : IsDefined<ClientActionData> extends true ? ClientActionData : IsDefined<ServerActionData> extends true ? ServerActionData : undefined>;
127
47
  type ClientDataFunctionArgs<T extends RouteInfo> = {
128
48
  /**
129
49
  * A {@link https://developer.mozilla.org/en-US/docs/Web/API/Request Fetch Request instance} which you can use to read the URL, the method, the "content-type" header, and the request body from the request.
@@ -147,9 +67,12 @@ type ClientDataFunctionArgs<T extends RouteInfo> = {
147
67
  **/
148
68
  params: T["params"];
149
69
  /**
150
- * This is a `RouterContextProvider` instance generated from your router's
151
- * `unstable_getContext` function and/or populated from route middleware
152
- * functions.
70
+ * When `future.unstable_middleware` is not enabled, this is undefined.
71
+ *
72
+ * When `future.unstable_middleware` is enabled, this is an instance of
73
+ * `unstable_RouterContextProvider` and can be used to access context values
74
+ * from your route middlewares. You may pass in initial context values in your
75
+ * `<HydratedRouter unstable_getContext>` prop
153
76
  */
154
77
  context: unstable_RouterContextProvider;
155
78
  };
@@ -202,12 +125,14 @@ type CreateHydrateFallbackProps<T extends RouteInfo> = {
202
125
  loaderData?: T["loaderData"];
203
126
  actionData?: T["actionData"];
204
127
  };
205
- type Match<T extends Props> = Pretty<Pick<T, "params"> & {
128
+ type Match<T extends MatchInfo> = Pretty<{
129
+ id: T["id"];
130
+ params: Record<string, string | undefined>;
206
131
  pathname: string;
207
- data: T["loaderData"];
132
+ data: GetLoaderData<T["module"]>;
208
133
  handle: unknown;
209
134
  }>;
210
- type Matches<T extends Props[]> = T extends [infer F extends Props, ...infer R extends Props[]] ? [Match<F>, ...Matches<R>] : Array<Match<Props> | undefined>;
135
+ type Matches<T extends Array<MatchInfo>> = T extends [infer F extends MatchInfo, ...infer R extends Array<MatchInfo>] ? [Match<F>, ...Matches<R>] : Array<Match<MatchInfo> | undefined>;
211
136
  type CreateComponentProps<T extends RouteInfo> = {
212
137
  /**
213
138
  * {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
@@ -229,7 +154,7 @@ type CreateComponentProps<T extends RouteInfo> = {
229
154
  /** The data returned from the `action` or `clientAction` following an action submission. */
230
155
  actionData?: T["actionData"];
231
156
  /** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
232
- matches: Matches<[...T["parents"], T]>;
157
+ matches: Matches<T["matches"]>;
233
158
  };
234
159
  type CreateErrorBoundaryProps<T extends RouteInfo> = {
235
160
  /**
@@ -251,7 +176,7 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = {
251
176
  loaderData?: T["loaderData"];
252
177
  actionData?: T["actionData"];
253
178
  };
254
- type RouteModuleAnnotations<Info extends RouteInfo> = {
179
+ type GetAnnotations<Info extends RouteInfo> = {
255
180
  LinkDescriptors: LinkDescriptor[];
256
181
  LinksFunction: () => LinkDescriptor[];
257
182
  MetaArgs: CreateMetaArgs<Info>;
@@ -270,4 +195,15 @@ type RouteModuleAnnotations<Info extends RouteInfo> = {
270
195
  ErrorBoundaryProps: CreateErrorBoundaryProps<Info>;
271
196
  };
272
197
 
273
- export type { CreateActionData, CreateLoaderData, Params, RouteModuleAnnotations };
198
+ type Params<RouteFile extends keyof RouteFiles> = Normalize<Pages[RouteFiles[RouteFile]["page"]]["params"]>;
199
+
200
+ type GetInfo<T extends {
201
+ file: keyof RouteFiles;
202
+ module: RouteModule;
203
+ }> = {
204
+ params: Params<T["file"]>;
205
+ loaderData: GetLoaderData<T["module"]>;
206
+ actionData: GetActionData<T["module"]>;
207
+ };
208
+
209
+ export type { GetAnnotations, GetInfo };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-00e730ed0
2
+ * react-router v0.0.0-experimental-93ddf3985
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *