Added router
This commit is contained in:
226
node_modules/react-router/dist/development/browser-7LYX59NK.d.mts
generated
vendored
Normal file
226
node_modules/react-router/dist/development/browser-7LYX59NK.d.mts
generated
vendored
Normal file
@@ -0,0 +1,226 @@
|
||||
import { AsyncLocalStorage } from 'node:async_hooks';
|
||||
import * as React from 'react';
|
||||
import { u as unstable_RouterContextProvider, i as ActionFunction, C as ClientActionFunction, j as ClientLoaderFunction, k as HeadersFunction, l as LinksFunction, m as LoaderFunction, M as MetaFunction, S as ShouldRevalidateFunction, c as Location, h as Params } from './route-data-CqEmXQub.mjs';
|
||||
|
||||
type ServerContext = {
|
||||
redirect?: Response;
|
||||
};
|
||||
declare global {
|
||||
var ___reactRouterServerStorage___: AsyncLocalStorage<ServerContext> | undefined;
|
||||
}
|
||||
type RSCRouteConfigEntryBase = {
|
||||
action?: ActionFunction;
|
||||
clientAction?: ClientActionFunction;
|
||||
clientLoader?: ClientLoaderFunction;
|
||||
ErrorBoundary?: React.ComponentType<any>;
|
||||
handle?: any;
|
||||
headers?: HeadersFunction;
|
||||
HydrateFallback?: React.ComponentType<any>;
|
||||
Layout?: React.ComponentType<any>;
|
||||
links?: LinksFunction;
|
||||
loader?: LoaderFunction;
|
||||
meta?: MetaFunction;
|
||||
shouldRevalidate?: ShouldRevalidateFunction;
|
||||
};
|
||||
type RSCRouteConfigEntry = RSCRouteConfigEntryBase & {
|
||||
id: string;
|
||||
path?: string;
|
||||
Component?: React.ComponentType<any>;
|
||||
lazy?: () => Promise<RSCRouteConfigEntryBase & ({
|
||||
default?: React.ComponentType<any>;
|
||||
Component?: never;
|
||||
} | {
|
||||
default?: never;
|
||||
Component?: React.ComponentType<any>;
|
||||
})>;
|
||||
} & ({
|
||||
index: true;
|
||||
} | {
|
||||
children?: RSCRouteConfigEntry[];
|
||||
});
|
||||
type RSCRouteConfig = Array<RSCRouteConfigEntry>;
|
||||
type RSCRouteManifest = {
|
||||
clientAction?: ClientActionFunction;
|
||||
clientLoader?: ClientLoaderFunction;
|
||||
element?: React.ReactElement | false;
|
||||
errorElement?: React.ReactElement;
|
||||
handle?: any;
|
||||
hasAction: boolean;
|
||||
hasComponent: boolean;
|
||||
hasErrorBoundary: boolean;
|
||||
hasLoader: boolean;
|
||||
hydrateFallbackElement?: React.ReactElement;
|
||||
id: string;
|
||||
index?: boolean;
|
||||
links?: LinksFunction;
|
||||
meta?: MetaFunction;
|
||||
parentId?: string;
|
||||
path?: string;
|
||||
shouldRevalidate?: ShouldRevalidateFunction;
|
||||
};
|
||||
type RSCRouteMatch = RSCRouteManifest & {
|
||||
params: Params;
|
||||
pathname: string;
|
||||
pathnameBase: string;
|
||||
};
|
||||
type RSCRenderPayload = {
|
||||
type: "render";
|
||||
actionData: Record<string, any> | null;
|
||||
basename: string | undefined;
|
||||
errors: Record<string, any> | null;
|
||||
loaderData: Record<string, any>;
|
||||
location: Location;
|
||||
matches: RSCRouteMatch[];
|
||||
patches?: RSCRouteManifest[];
|
||||
nonce?: string;
|
||||
formState?: unknown;
|
||||
};
|
||||
type RSCManifestPayload = {
|
||||
type: "manifest";
|
||||
patches: RSCRouteManifest[];
|
||||
};
|
||||
type RSCActionPayload = {
|
||||
type: "action";
|
||||
actionResult: Promise<unknown>;
|
||||
rerender?: Promise<RSCRenderPayload | RSCRedirectPayload>;
|
||||
};
|
||||
type RSCRedirectPayload = {
|
||||
type: "redirect";
|
||||
status: number;
|
||||
location: string;
|
||||
replace: boolean;
|
||||
reload: boolean;
|
||||
actionResult?: Promise<unknown>;
|
||||
};
|
||||
type RSCPayload = RSCRenderPayload | RSCManifestPayload | RSCActionPayload | RSCRedirectPayload;
|
||||
type RSCMatch = {
|
||||
statusCode: number;
|
||||
headers: Headers;
|
||||
payload: RSCPayload;
|
||||
};
|
||||
type DecodeActionFunction = (formData: FormData) => Promise<() => Promise<unknown>>;
|
||||
type DecodeFormStateFunction = (result: unknown, formData: FormData) => unknown;
|
||||
type DecodeReplyFunction = (reply: FormData | string, { temporaryReferences }: {
|
||||
temporaryReferences: unknown;
|
||||
}) => Promise<unknown[]>;
|
||||
type LoadServerActionFunction = (id: string) => Promise<Function>;
|
||||
/**
|
||||
* Matches the given routes to a Request and returns a RSC Response encoding an
|
||||
* `RSCPayload` for consumption by a RSC enabled client router.
|
||||
*
|
||||
* @example
|
||||
* import {
|
||||
* createTemporaryReferenceSet,
|
||||
* decodeAction,
|
||||
* decodeReply,
|
||||
* loadServerAction,
|
||||
* renderToReadableStream,
|
||||
* } from "@vitejs/plugin-rsc/rsc";
|
||||
* import { unstable_matchRSCServerRequest as matchRSCServerRequest } from "react-router";
|
||||
*
|
||||
* matchRSCServerRequest({
|
||||
* createTemporaryReferenceSet,
|
||||
* decodeAction,
|
||||
* decodeFormState,
|
||||
* decodeReply,
|
||||
* loadServerAction,
|
||||
* request,
|
||||
* routes: routes(),
|
||||
* generateResponse(match) {
|
||||
* return new Response(
|
||||
* renderToReadableStream(match.payload),
|
||||
* {
|
||||
* status: match.statusCode,
|
||||
* headers: match.headers,
|
||||
* }
|
||||
* );
|
||||
* },
|
||||
* });
|
||||
*
|
||||
* @name unstable_matchRSCServerRequest
|
||||
* @public
|
||||
* @category RSC
|
||||
* @mode data
|
||||
* @param opts Options
|
||||
* @param opts.basename The basename to use when matching the request.
|
||||
* @param opts.decodeAction Your `react-server-dom-xyz/server`'s `decodeAction`
|
||||
* function, responsible for loading a server action.
|
||||
* @param opts.decodeReply Your `react-server-dom-xyz/server`'s `decodeReply`
|
||||
* function, used to decode the server function's arguments and bind them to the
|
||||
* implementation for invocation by the router.
|
||||
* @param opts.decodeFormState A function responsible for decoding form state for
|
||||
* progressively enhanceable forms with `useActionState` using your
|
||||
* `react-server-dom-xyz/server`'s `decodeFormState`.
|
||||
* @param opts.generateResponse A function responsible for using your
|
||||
* `renderToReadableStream` to generate a Response encoding the `RSCPayload`.
|
||||
* @param opts.loadServerAction Your `react-server-dom-xyz/server`'s
|
||||
* `loadServerAction` function, used to load a server action by ID.
|
||||
* @param opts.request The request to match against.
|
||||
* @param opts.requestContext An instance of `unstable_RouterContextProvider`
|
||||
* that should be created per request, to be passed to loaders, actions and middleware.
|
||||
* @param opts.routes Your route definitions.
|
||||
* @param opts.createTemporaryReferenceSet A function that returns a temporary
|
||||
* reference set for the request, used to track temporary references in the RSC stream.
|
||||
* @param opts.onError An optional error handler that will be called with any
|
||||
* errors that occur during the request processing.
|
||||
* @returns A Response that contains the RSC data for hydration.
|
||||
*/
|
||||
declare function matchRSCServerRequest({ createTemporaryReferenceSet, basename, decodeReply, requestContext, loadServerAction, decodeAction, decodeFormState, onError, request, routes, generateResponse, }: {
|
||||
createTemporaryReferenceSet: () => unknown;
|
||||
basename?: string;
|
||||
decodeReply?: DecodeReplyFunction;
|
||||
decodeAction?: DecodeActionFunction;
|
||||
decodeFormState?: DecodeFormStateFunction;
|
||||
requestContext?: unstable_RouterContextProvider;
|
||||
loadServerAction?: LoadServerActionFunction;
|
||||
onError?: (error: unknown) => void;
|
||||
request: Request;
|
||||
routes: RSCRouteConfigEntry[];
|
||||
generateResponse: (match: RSCMatch, { temporaryReferences, }: {
|
||||
temporaryReferences: unknown;
|
||||
}) => Response;
|
||||
}): Promise<Response>;
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__FLIGHT_DATA: any[];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Get the prerendered RSC stream for hydration. Usually passed directly to your
|
||||
* `react-server-dom-xyz/client`'s `createFromReadableStream`.
|
||||
*
|
||||
* @example
|
||||
* import { startTransition, StrictMode } from "react";
|
||||
* import { hydrateRoot } from "react-dom/client";
|
||||
* import {
|
||||
* unstable_getRSCStream as getRSCStream,
|
||||
* unstable_RSCHydratedRouter as RSCHydratedRouter,
|
||||
* } from "react-router";
|
||||
* import type { unstable_RSCPayload as RSCPayload } from "react-router";
|
||||
*
|
||||
* createFromReadableStream(getRSCStream()).then(
|
||||
* (payload: RSCServerPayload) => {
|
||||
* startTransition(async () => {
|
||||
* hydrateRoot(
|
||||
* document,
|
||||
* <StrictMode>
|
||||
* <RSCHydratedRouter ...props />
|
||||
* </StrictMode>,
|
||||
* {
|
||||
* // Options
|
||||
* }
|
||||
* );
|
||||
* });
|
||||
* }
|
||||
* );
|
||||
*
|
||||
* @name unstable_getRSCStream
|
||||
* @public
|
||||
* @category RSC
|
||||
* @mode data
|
||||
* @returns A `ReadableStream` that contains the RSC data for hydration.
|
||||
*/
|
||||
declare function getRSCStream(): ReadableStream<any>;
|
||||
|
||||
export { type DecodeActionFunction as D, type LoadServerActionFunction as L, type RSCPayload as R, type DecodeFormStateFunction as a, type DecodeReplyFunction as b, type RSCManifestPayload as c, type RSCMatch as d, type RSCRenderPayload as e, type RSCRouteManifest as f, getRSCStream as g, type RSCRouteMatch as h, type RSCRouteConfigEntry as i, type RSCRouteConfig as j, matchRSCServerRequest as m };
|
||||
10071
node_modules/react-router/dist/development/chunk-C37GKA54.mjs
generated
vendored
Normal file
10071
node_modules/react-router/dist/development/chunk-C37GKA54.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
8220
node_modules/react-router/dist/development/chunk-K7YFBME3.js
generated
vendored
Normal file
8220
node_modules/react-router/dist/development/chunk-K7YFBME3.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2698
node_modules/react-router/dist/development/chunk-KIUJAIYX.mjs
generated
vendored
Normal file
2698
node_modules/react-router/dist/development/chunk-KIUJAIYX.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1928
node_modules/react-router/dist/development/chunk-R73PQUJU.js
generated
vendored
Normal file
1928
node_modules/react-router/dist/development/chunk-R73PQUJU.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
802
node_modules/react-router/dist/development/components-CjQijYga.d.mts
generated
vendored
Normal file
802
node_modules/react-router/dist/development/components-CjQijYga.d.mts
generated
vendored
Normal file
@@ -0,0 +1,802 @@
|
||||
import { R as Router$1, I as InitialEntry, T as To, a as RelativeRoutingType, N as NonIndexRouteObject, L as LazyRouteFunction, b as IndexRouteObject, c as Location, A as Action, d as Navigator, e as RouterInit, F as FutureConfig, H as HydrationState, D as DataStrategyFunction, P as PatchRoutesOnNavigationFunction, f as RouteObject, g as RouteMatch, h as Params, U as UIMatch } from './route-data-CqEmXQub.mjs';
|
||||
import * as React from 'react';
|
||||
|
||||
declare function mapRouteProperties(route: RouteObject): Partial<RouteObject> & {
|
||||
hasErrorBoundary: boolean;
|
||||
};
|
||||
declare const hydrationRouteProperties: (keyof RouteObject)[];
|
||||
/**
|
||||
* @category Data Routers
|
||||
*/
|
||||
interface MemoryRouterOpts {
|
||||
/**
|
||||
* Basename path for the application.
|
||||
*/
|
||||
basename?: string;
|
||||
/**
|
||||
* Function to provide the initial context values for all client side
|
||||
* navigations/fetches
|
||||
*/
|
||||
unstable_getContext?: RouterInit["unstable_getContext"];
|
||||
/**
|
||||
* Future flags to enable for the router.
|
||||
*/
|
||||
future?: Partial<FutureConfig>;
|
||||
/**
|
||||
* Hydration data to initialize the router with if you have already performed
|
||||
* data loading on the server.
|
||||
*/
|
||||
hydrationData?: HydrationState;
|
||||
/**
|
||||
* Initial entries in the in-memory history stack
|
||||
*/
|
||||
initialEntries?: InitialEntry[];
|
||||
/**
|
||||
* Index of {@link initialEntries} the application should initialize to
|
||||
*/
|
||||
initialIndex?: number;
|
||||
/**
|
||||
* Override the default data strategy of loading in parallel.
|
||||
* Only intended for advanced usage.
|
||||
*/
|
||||
dataStrategy?: DataStrategyFunction;
|
||||
/**
|
||||
* Lazily define portions of the route tree on navigations.
|
||||
*/
|
||||
patchRoutesOnNavigation?: PatchRoutesOnNavigationFunction;
|
||||
}
|
||||
/**
|
||||
* Create a new {@link DataRouter} that manages the application path using an
|
||||
* in-memory [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History)
|
||||
* stack. Useful for non-browser environments without a DOM API.
|
||||
*
|
||||
* @public
|
||||
* @category Data Routers
|
||||
* @mode data
|
||||
* @param routes Application routes
|
||||
* @param opts Options
|
||||
* @param {MemoryRouterOpts.basename} opts.basename n/a
|
||||
* @param {MemoryRouterOpts.dataStrategy} opts.dataStrategy n/a
|
||||
* @param {MemoryRouterOpts.future} opts.future n/a
|
||||
* @param {MemoryRouterOpts.unstable_getContext} opts.unstable_getContext n/a
|
||||
* @param {MemoryRouterOpts.hydrationData} opts.hydrationData n/a
|
||||
* @param {MemoryRouterOpts.initialEntries} opts.initialEntries n/a
|
||||
* @param {MemoryRouterOpts.initialIndex} opts.initialIndex n/a
|
||||
* @param {MemoryRouterOpts.patchRoutesOnNavigation} opts.patchRoutesOnNavigation n/a
|
||||
* @returns An initialized {@link DataRouter} to pass to {@link RouterProvider | `<RouterProvider>`}
|
||||
*/
|
||||
declare function createMemoryRouter(routes: RouteObject[], opts?: MemoryRouterOpts): Router$1;
|
||||
/**
|
||||
* @category Types
|
||||
*/
|
||||
interface RouterProviderProps {
|
||||
/**
|
||||
* The {@link DataRouter} instance to use for navigation and data fetching.
|
||||
*/
|
||||
router: Router$1;
|
||||
/**
|
||||
* The [`ReactDOM.flushSync`](https://react.dev/reference/react-dom/flushSync)
|
||||
* implementation to use for flushing updates.
|
||||
*
|
||||
* You usually don't have to worry about this:
|
||||
* - The `RouterProvider` exported from `react-router/dom` handles this internally for you
|
||||
* - If you are rendering in a non-DOM environment, you can import
|
||||
* `RouterProvider` from `react-router` and ignore this prop
|
||||
*/
|
||||
flushSync?: (fn: () => unknown) => undefined;
|
||||
}
|
||||
/**
|
||||
* Render the UI for the given {@link DataRouter}. This component should
|
||||
* typically be at the top of an app's element tree.
|
||||
*
|
||||
* @example
|
||||
* import { createBrowserRouter } from "react-router";
|
||||
* import { RouterProvider } from "react-router/dom";
|
||||
* import { createRoot } from "react-dom/client";
|
||||
*
|
||||
* const router = createBrowserRouter(routes);
|
||||
* createRoot(document.getElementById("root")).render(
|
||||
* <RouterProvider router={router} />
|
||||
* );
|
||||
*
|
||||
* @public
|
||||
* @category Data Routers
|
||||
* @mode data
|
||||
* @param props Props
|
||||
* @param {RouterProviderProps.flushSync} props.flushSync n/a
|
||||
* @param {RouterProviderProps.router} props.router n/a
|
||||
* @returns React element for the rendered router
|
||||
*/
|
||||
declare function RouterProvider({ router, flushSync: reactDomFlushSyncImpl, }: RouterProviderProps): React.ReactElement;
|
||||
/**
|
||||
* @category Types
|
||||
*/
|
||||
interface MemoryRouterProps {
|
||||
/**
|
||||
* Application basename
|
||||
*/
|
||||
basename?: string;
|
||||
/**
|
||||
* Nested {@link Route} elements describing the route tree
|
||||
*/
|
||||
children?: React.ReactNode;
|
||||
/**
|
||||
* Initial entries in the in-memory history stack
|
||||
*/
|
||||
initialEntries?: InitialEntry[];
|
||||
/**
|
||||
* Index of {@link initialEntries} the application should initialize to
|
||||
*/
|
||||
initialIndex?: number;
|
||||
}
|
||||
/**
|
||||
* A declarative {@link Router | `<Router>`} that stores all entries in memory.
|
||||
*
|
||||
* @public
|
||||
* @category Declarative Routers
|
||||
* @mode declarative
|
||||
* @param props Props
|
||||
* @param {MemoryRouterProps.basename} props.basename n/a
|
||||
* @param {MemoryRouterProps.children} props.children n/a
|
||||
* @param {MemoryRouterProps.initialEntries} props.initialEntries n/a
|
||||
* @param {MemoryRouterProps.initialIndex} props.initialIndex n/a
|
||||
* @returns A declarative in memory router for client side routing.
|
||||
*/
|
||||
declare function MemoryRouter({ basename, children, initialEntries, initialIndex, }: MemoryRouterProps): React.ReactElement;
|
||||
/**
|
||||
* @category Types
|
||||
*/
|
||||
interface NavigateProps {
|
||||
/**
|
||||
* The path to navigate to. This can be a string or a {@link Path} object
|
||||
*/
|
||||
to: To;
|
||||
/**
|
||||
* Whether to replace the current entry in the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History)
|
||||
* stack
|
||||
*/
|
||||
replace?: boolean;
|
||||
/**
|
||||
* State to pass to the new {@link Location} to store in [`history.state`](https://developer.mozilla.org/en-US/docs/Web/API/History/state).
|
||||
*/
|
||||
state?: any;
|
||||
/**
|
||||
* How to interpret relative routing in the {@link to} prop.
|
||||
* See {@link RelativeRoutingType}.
|
||||
*/
|
||||
relative?: RelativeRoutingType;
|
||||
}
|
||||
/**
|
||||
* A component-based version of {@link useNavigate} to use in a
|
||||
* [`React.Component` class](https://react.dev/reference/react/Component) where
|
||||
* hooks cannot be used.
|
||||
*
|
||||
* It's recommended to avoid using this component in favor of {@link useNavigate}.
|
||||
*
|
||||
* @example
|
||||
* <Navigate to="/tasks" />
|
||||
*
|
||||
* @public
|
||||
* @category Components
|
||||
* @param props Props
|
||||
* @param {NavigateProps.relative} props.relative n/a
|
||||
* @param {NavigateProps.replace} props.replace n/a
|
||||
* @param {NavigateProps.state} props.state n/a
|
||||
* @param {NavigateProps.to} props.to n/a
|
||||
* @returns {void}
|
||||
*
|
||||
*/
|
||||
declare function Navigate({ to, replace, state, relative, }: NavigateProps): null;
|
||||
/**
|
||||
* @category Types
|
||||
*/
|
||||
interface OutletProps {
|
||||
/**
|
||||
* Provides a context value to the element tree below the outlet. Use when
|
||||
* the parent route needs to provide values to child routes.
|
||||
*
|
||||
* ```tsx
|
||||
* <Outlet context={myContextValue} />
|
||||
* ```
|
||||
*
|
||||
* Access the context with {@link useOutletContext}.
|
||||
*/
|
||||
context?: unknown;
|
||||
}
|
||||
/**
|
||||
* Renders the matching child route of a parent route or nothing if no child
|
||||
* route matches.
|
||||
*
|
||||
* @example
|
||||
* import { Outlet } from "react-router";
|
||||
*
|
||||
* export default function SomeParent() {
|
||||
* return (
|
||||
* <div>
|
||||
* <h1>Parent Content</h1>
|
||||
* <Outlet />
|
||||
* </div>
|
||||
* );
|
||||
* }
|
||||
*
|
||||
* @public
|
||||
* @category Components
|
||||
* @param props Props
|
||||
* @param {OutletProps.context} props.context n/a
|
||||
* @returns React element for the rendered outlet or `null` if no child route matches.
|
||||
*/
|
||||
declare function Outlet(props: OutletProps): React.ReactElement | null;
|
||||
/**
|
||||
* @category Types
|
||||
*/
|
||||
interface PathRouteProps {
|
||||
/**
|
||||
* Whether the path should be case-sensitive. Defaults to `false`.
|
||||
*/
|
||||
caseSensitive?: NonIndexRouteObject["caseSensitive"];
|
||||
/**
|
||||
* The path pattern to match. If unspecified or empty, then this becomes a
|
||||
* layout route.
|
||||
*/
|
||||
path?: NonIndexRouteObject["path"];
|
||||
/**
|
||||
* The unique identifier for this route (for use with {@link DataRouter}s)
|
||||
*/
|
||||
id?: NonIndexRouteObject["id"];
|
||||
/**
|
||||
* A function that returns a promise that resolves to the route object.
|
||||
* Used for code-splitting routes.
|
||||
* See [`lazy`](../../start/data/route-object#lazy).
|
||||
*/
|
||||
lazy?: LazyRouteFunction<NonIndexRouteObject>;
|
||||
/**
|
||||
* The route loader.
|
||||
* See [`loader`](../../start/data/route-object#loader).
|
||||
*/
|
||||
loader?: NonIndexRouteObject["loader"];
|
||||
/**
|
||||
* The route action.
|
||||
* See [`action`](../../start/data/route-object#action).
|
||||
*/
|
||||
action?: NonIndexRouteObject["action"];
|
||||
hasErrorBoundary?: NonIndexRouteObject["hasErrorBoundary"];
|
||||
/**
|
||||
* The route shouldRevalidate function.
|
||||
* See [`shouldRevalidate`](../../start/data/route-object#shouldRevalidate).
|
||||
*/
|
||||
shouldRevalidate?: NonIndexRouteObject["shouldRevalidate"];
|
||||
/**
|
||||
* The route handle.
|
||||
*/
|
||||
handle?: NonIndexRouteObject["handle"];
|
||||
/**
|
||||
* Whether this is an index route.
|
||||
*/
|
||||
index?: false;
|
||||
/**
|
||||
* Child Route components
|
||||
*/
|
||||
children?: React.ReactNode;
|
||||
/**
|
||||
* The React element to render when this Route matches.
|
||||
* Mutually exclusive with {@link Component}.
|
||||
*/
|
||||
element?: React.ReactNode | null;
|
||||
/**
|
||||
* The React element to render while this router is loading data.
|
||||
* Mutually exclusive with {@link HydrateFallback}.
|
||||
*/
|
||||
hydrateFallbackElement?: React.ReactNode | null;
|
||||
/**
|
||||
* The React element to render at this route if an error occurs.
|
||||
* Mutually exclusive with {@link ErrorBoundary}.
|
||||
*/
|
||||
errorElement?: React.ReactNode | null;
|
||||
/**
|
||||
* The React Component to render when this route matches.
|
||||
* Mutually exclusive with {@link element}.
|
||||
*/
|
||||
Component?: React.ComponentType | null;
|
||||
/**
|
||||
* The React Component to render while this router is loading data.
|
||||
* Mutually exclusive with {@link hydrateFallbackElement}.
|
||||
*/
|
||||
HydrateFallback?: React.ComponentType | null;
|
||||
/**
|
||||
* The React Component to render at this route if an error occurs.
|
||||
* Mutually exclusive with {@link errorElement}.
|
||||
*/
|
||||
ErrorBoundary?: React.ComponentType | null;
|
||||
}
|
||||
/**
|
||||
* @category Types
|
||||
*/
|
||||
interface LayoutRouteProps extends PathRouteProps {
|
||||
}
|
||||
/**
|
||||
* @category Types
|
||||
*/
|
||||
interface IndexRouteProps {
|
||||
/**
|
||||
* Whether the path should be case-sensitive. Defaults to `false`.
|
||||
*/
|
||||
caseSensitive?: IndexRouteObject["caseSensitive"];
|
||||
/**
|
||||
* The path pattern to match. If unspecified or empty, then this becomes a
|
||||
* layout route.
|
||||
*/
|
||||
path?: IndexRouteObject["path"];
|
||||
/**
|
||||
* The unique identifier for this route (for use with {@link DataRouter}s)
|
||||
*/
|
||||
id?: IndexRouteObject["id"];
|
||||
/**
|
||||
* A function that returns a promise that resolves to the route object.
|
||||
* Used for code-splitting routes.
|
||||
* See [`lazy`](../../start/data/route-object#lazy).
|
||||
*/
|
||||
lazy?: LazyRouteFunction<IndexRouteObject>;
|
||||
/**
|
||||
* The route loader.
|
||||
* See [`loader`](../../start/data/route-object#loader).
|
||||
*/
|
||||
loader?: IndexRouteObject["loader"];
|
||||
/**
|
||||
* The route action.
|
||||
* See [`action`](../../start/data/route-object#action).
|
||||
*/
|
||||
action?: IndexRouteObject["action"];
|
||||
hasErrorBoundary?: IndexRouteObject["hasErrorBoundary"];
|
||||
/**
|
||||
* The route shouldRevalidate function.
|
||||
* See [`shouldRevalidate`](../../start/data/route-object#shouldRevalidate).
|
||||
*/
|
||||
shouldRevalidate?: IndexRouteObject["shouldRevalidate"];
|
||||
/**
|
||||
* The route handle.
|
||||
*/
|
||||
handle?: IndexRouteObject["handle"];
|
||||
/**
|
||||
* Whether this is an index route.
|
||||
*/
|
||||
index: true;
|
||||
/**
|
||||
* Child Route components
|
||||
*/
|
||||
children?: undefined;
|
||||
/**
|
||||
* The React element to render when this Route matches.
|
||||
* Mutually exclusive with {@link Component}.
|
||||
*/
|
||||
element?: React.ReactNode | null;
|
||||
/**
|
||||
* The React element to render while this router is loading data.
|
||||
* Mutually exclusive with {@link HydrateFallback}.
|
||||
*/
|
||||
hydrateFallbackElement?: React.ReactNode | null;
|
||||
/**
|
||||
* The React element to render at this route if an error occurs.
|
||||
* Mutually exclusive with {@link ErrorBoundary}.
|
||||
*/
|
||||
errorElement?: React.ReactNode | null;
|
||||
/**
|
||||
* The React Component to render when this route matches.
|
||||
* Mutually exclusive with {@link element}.
|
||||
*/
|
||||
Component?: React.ComponentType | null;
|
||||
/**
|
||||
* The React Component to render while this router is loading data.
|
||||
* Mutually exclusive with {@link hydrateFallbackElement}.
|
||||
*/
|
||||
HydrateFallback?: React.ComponentType | null;
|
||||
/**
|
||||
* The React Component to render at this route if an error occurs.
|
||||
* Mutually exclusive with {@link errorElement}.
|
||||
*/
|
||||
ErrorBoundary?: React.ComponentType | null;
|
||||
}
|
||||
type RouteProps = PathRouteProps | LayoutRouteProps | IndexRouteProps;
|
||||
/**
|
||||
* Configures an element to render when a pattern matches the current location.
|
||||
* It must be rendered within a {@link Routes} element. Note that these routes
|
||||
* do not participate in data loading, actions, code splitting, or any other
|
||||
* route module features.
|
||||
*
|
||||
* @example
|
||||
* // Usually used in a declarative router
|
||||
* function App() {
|
||||
* return (
|
||||
* <BrowserRouter>
|
||||
* <Routes>
|
||||
* <Route index element={<StepOne />} />
|
||||
* <Route path="step-2" element={<StepTwo />} />
|
||||
* <Route path="step-3" element={<StepThree />} />
|
||||
* </Routes>
|
||||
* </BrowserRouter>
|
||||
* );
|
||||
* }
|
||||
*
|
||||
* // But can be used with a data router as well if you prefer the JSX notation
|
||||
* const routes = createRoutesFromElements(
|
||||
* <>
|
||||
* <Route index loader={step1Loader} Component={StepOne} />
|
||||
* <Route path="step-2" loader={step2Loader} Component={StepTwo} />
|
||||
* <Route path="step-3" loader={step3Loader} Component={StepThree} />
|
||||
* </>
|
||||
* );
|
||||
*
|
||||
* const router = createBrowserRouter(routes);
|
||||
*
|
||||
* function App() {
|
||||
* return <RouterProvider router={router} />;
|
||||
* }
|
||||
*
|
||||
* @public
|
||||
* @category Components
|
||||
* @param props Props
|
||||
* @param {PathRouteProps.action} props.action n/a
|
||||
* @param {PathRouteProps.caseSensitive} props.caseSensitive n/a
|
||||
* @param {PathRouteProps.Component} props.Component n/a
|
||||
* @param {PathRouteProps.children} props.children n/a
|
||||
* @param {PathRouteProps.element} props.element n/a
|
||||
* @param {PathRouteProps.ErrorBoundary} props.ErrorBoundary n/a
|
||||
* @param {PathRouteProps.errorElement} props.errorElement n/a
|
||||
* @param {PathRouteProps.handle} props.handle n/a
|
||||
* @param {PathRouteProps.HydrateFallback} props.HydrateFallback n/a
|
||||
* @param {PathRouteProps.hydrateFallbackElement} props.hydrateFallbackElement n/a
|
||||
* @param {PathRouteProps.id} props.id n/a
|
||||
* @param {PathRouteProps.index} props.index n/a
|
||||
* @param {PathRouteProps.lazy} props.lazy n/a
|
||||
* @param {PathRouteProps.loader} props.loader n/a
|
||||
* @param {PathRouteProps.path} props.path n/a
|
||||
* @param {PathRouteProps.shouldRevalidate} props.shouldRevalidate n/a
|
||||
* @returns {void}
|
||||
*/
|
||||
declare function Route(props: RouteProps): React.ReactElement | null;
|
||||
/**
|
||||
* @category Types
|
||||
*/
|
||||
interface RouterProps {
|
||||
/**
|
||||
* The base path for the application. This is prepended to all locations
|
||||
*/
|
||||
basename?: string;
|
||||
/**
|
||||
* Nested {@link Route} elements describing the route tree
|
||||
*/
|
||||
children?: React.ReactNode;
|
||||
/**
|
||||
* The location to match against. Defaults to the current location.
|
||||
* This can be a string or a {@link Location} object.
|
||||
*/
|
||||
location: Partial<Location> | string;
|
||||
/**
|
||||
* The type of navigation that triggered this location change.
|
||||
* Defaults to {@link NavigationType.Pop}.
|
||||
*/
|
||||
navigationType?: Action;
|
||||
/**
|
||||
* The navigator to use for navigation. This is usually a history object
|
||||
* or a custom navigator that implements the {@link Navigator} interface.
|
||||
*/
|
||||
navigator: Navigator;
|
||||
/**
|
||||
* Whether this router is static or not (used for SSR). If `true`, the router
|
||||
* will not be reactive to location changes.
|
||||
*/
|
||||
static?: boolean;
|
||||
}
|
||||
/**
|
||||
* Provides location context for the rest of the app.
|
||||
*
|
||||
* Note: You usually won't render a `<Router>` directly. Instead, you'll render a
|
||||
* router that is more specific to your environment such as a {@link BrowserRouter}
|
||||
* in web browsers or a {@link ServerRouter} for server rendering.
|
||||
*
|
||||
* @public
|
||||
* @category Declarative Routers
|
||||
* @mode declarative
|
||||
* @param props Props
|
||||
* @param {RouterProps.basename} props.basename n/a
|
||||
* @param {RouterProps.children} props.children n/a
|
||||
* @param {RouterProps.location} props.location n/a
|
||||
* @param {RouterProps.navigationType} props.navigationType n/a
|
||||
* @param {RouterProps.navigator} props.navigator n/a
|
||||
* @param {RouterProps.static} props.static n/a
|
||||
* @returns React element for the rendered router or `null` if the location does
|
||||
* not match the {@link props.basename}
|
||||
*/
|
||||
declare function Router({ basename: basenameProp, children, location: locationProp, navigationType, navigator, static: staticProp, }: RouterProps): React.ReactElement | null;
|
||||
/**
|
||||
* @category Types
|
||||
*/
|
||||
interface RoutesProps {
|
||||
/**
|
||||
* Nested {@link Route} elements
|
||||
*/
|
||||
children?: React.ReactNode;
|
||||
/**
|
||||
* The {@link Location} to match against. Defaults to the current location.
|
||||
*/
|
||||
location?: Partial<Location> | string;
|
||||
}
|
||||
/**
|
||||
* Renders a branch of {@link Route | `<Route>`s} that best matches the current
|
||||
* location. Note that these routes do not participate in [data loading](../../start/framework/route-module#loader),
|
||||
* [`action`](../../start/framework/route-module#action), code splitting, or
|
||||
* any other [route module](../../start/framework/route-module) features.
|
||||
*
|
||||
* @example
|
||||
* import { Route, Routes } from "react-router";
|
||||
*
|
||||
* <Routes>
|
||||
* <Route index element={<StepOne />} />
|
||||
* <Route path="step-2" element={<StepTwo />} />
|
||||
* <Route path="step-3" element={<StepThree />}>
|
||||
* </Routes>
|
||||
*
|
||||
* @public
|
||||
* @category Components
|
||||
* @param props Props
|
||||
* @param {RoutesProps.children} props.children n/a
|
||||
* @param {RoutesProps.location} props.location n/a
|
||||
* @returns React element for the rendered routes or `null` if no route matches
|
||||
*/
|
||||
declare function Routes({ children, location, }: RoutesProps): React.ReactElement | null;
|
||||
interface AwaitResolveRenderFunction<Resolve = any> {
|
||||
(data: Awaited<Resolve>): React.ReactNode;
|
||||
}
|
||||
/**
|
||||
* @category Types
|
||||
*/
|
||||
interface AwaitProps<Resolve> {
|
||||
/**
|
||||
* When using a function, the resolved value is provided as the parameter.
|
||||
*
|
||||
* ```tsx [2]
|
||||
* <Await resolve={reviewsPromise}>
|
||||
* {(resolvedReviews) => <Reviews items={resolvedReviews} />}
|
||||
* </Await>
|
||||
* ```
|
||||
*
|
||||
* When using React elements, {@link useAsyncValue} will provide the
|
||||
* resolved value:
|
||||
*
|
||||
* ```tsx [2]
|
||||
* <Await resolve={reviewsPromise}>
|
||||
* <Reviews />
|
||||
* </Await>
|
||||
*
|
||||
* function Reviews() {
|
||||
* const resolvedReviews = useAsyncValue();
|
||||
* return <div>...</div>;
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
children: React.ReactNode | AwaitResolveRenderFunction<Resolve>;
|
||||
/**
|
||||
* The error element renders instead of the `children` when the [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
||||
* rejects.
|
||||
*
|
||||
* ```tsx
|
||||
* <Await
|
||||
* errorElement={<div>Oops</div>}
|
||||
* resolve={reviewsPromise}
|
||||
* >
|
||||
* <Reviews />
|
||||
* </Await>
|
||||
* ```
|
||||
*
|
||||
* To provide a more contextual error, you can use the {@link useAsyncError} in a
|
||||
* child component
|
||||
*
|
||||
* ```tsx
|
||||
* <Await
|
||||
* errorElement={<ReviewsError />}
|
||||
* resolve={reviewsPromise}
|
||||
* >
|
||||
* <Reviews />
|
||||
* </Await>
|
||||
*
|
||||
* function ReviewsError() {
|
||||
* const error = useAsyncError();
|
||||
* return <div>Error loading reviews: {error.message}</div>;
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* If you do not provide an `errorElement`, the rejected value will bubble up
|
||||
* to the nearest route-level [`ErrorBoundary`](../../start/framework/route-module#errorboundary)
|
||||
* and be accessible via the {@link useRouteError} hook.
|
||||
*/
|
||||
errorElement?: React.ReactNode;
|
||||
/**
|
||||
* Takes a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
||||
* returned from a [`loader`](../../start/framework/route-module#loader) to be
|
||||
* resolved and rendered.
|
||||
*
|
||||
* ```tsx
|
||||
* import { Await, useLoaderData } from "react-router";
|
||||
*
|
||||
* export async function loader() {
|
||||
* let reviews = getReviews(); // not awaited
|
||||
* let book = await getBook();
|
||||
* return {
|
||||
* book,
|
||||
* reviews, // this is a promise
|
||||
* };
|
||||
* }
|
||||
*
|
||||
* export default function Book() {
|
||||
* const {
|
||||
* book,
|
||||
* reviews, // this is the same promise
|
||||
* } = useLoaderData();
|
||||
*
|
||||
* return (
|
||||
* <div>
|
||||
* <h1>{book.title}</h1>
|
||||
* <p>{book.description}</p>
|
||||
* <React.Suspense fallback={<ReviewsSkeleton />}>
|
||||
* <Await
|
||||
* // and is the promise we pass to Await
|
||||
* resolve={reviews}
|
||||
* >
|
||||
* <Reviews />
|
||||
* </Await>
|
||||
* </React.Suspense>
|
||||
* </div>
|
||||
* );
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
resolve: Resolve;
|
||||
}
|
||||
/**
|
||||
* Used to render promise values with automatic error handling.
|
||||
*
|
||||
* **Note:** `<Await>` expects to be rendered inside a [`<React.Suspense>`](https://react.dev/reference/react/Suspense)
|
||||
*
|
||||
* @example
|
||||
* import { Await, useLoaderData } from "react-router";
|
||||
*
|
||||
* export async function loader() {
|
||||
* // not awaited
|
||||
* const reviews = getReviews();
|
||||
* // awaited (blocks the transition)
|
||||
* const book = await fetch("/api/book").then((res) => res.json());
|
||||
* return { book, reviews };
|
||||
* }
|
||||
*
|
||||
* function Book() {
|
||||
* const { book, reviews } = useLoaderData();
|
||||
* return (
|
||||
* <div>
|
||||
* <h1>{book.title}</h1>
|
||||
* <p>{book.description}</p>
|
||||
* <React.Suspense fallback={<ReviewsSkeleton />}>
|
||||
* <Await
|
||||
* resolve={reviews}
|
||||
* errorElement={
|
||||
* <div>Could not load reviews 😬</div>
|
||||
* }
|
||||
* children={(resolvedReviews) => (
|
||||
* <Reviews items={resolvedReviews} />
|
||||
* )}
|
||||
* />
|
||||
* </React.Suspense>
|
||||
* </div>
|
||||
* );
|
||||
* }
|
||||
*
|
||||
* @public
|
||||
* @category Components
|
||||
* @mode framework
|
||||
* @mode data
|
||||
* @param props Props
|
||||
* @param {AwaitProps.children} props.children n/a
|
||||
* @param {AwaitProps.errorElement} props.errorElement n/a
|
||||
* @param {AwaitProps.resolve} props.resolve n/a
|
||||
* @returns React element for the rendered awaited value
|
||||
*/
|
||||
declare function Await<Resolve>({ children, errorElement, resolve, }: AwaitProps<Resolve>): React.JSX.Element;
|
||||
/**
|
||||
* Creates a route config from a React "children" object, which is usually
|
||||
* either a `<Route>` element or an array of them. Used internally by
|
||||
* `<Routes>` to create a route config from its children.
|
||||
*
|
||||
* @category Utils
|
||||
* @mode data
|
||||
* @param children The React children to convert into a route config
|
||||
* @param parentPath The path of the parent route, used to generate unique IDs.
|
||||
* @returns An array of {@link RouteObject}s that can be used with a {@link DataRouter}
|
||||
*/
|
||||
declare function createRoutesFromChildren(children: React.ReactNode, parentPath?: number[]): RouteObject[];
|
||||
/**
|
||||
* Create route objects from JSX elements instead of arrays of objects.
|
||||
*
|
||||
* @example
|
||||
* const routes = createRoutesFromElements(
|
||||
* <>
|
||||
* <Route index loader={step1Loader} Component={StepOne} />
|
||||
* <Route path="step-2" loader={step2Loader} Component={StepTwo} />
|
||||
* <Route path="step-3" loader={step3Loader} Component={StepThree} />
|
||||
* </>
|
||||
* );
|
||||
*
|
||||
* const router = createBrowserRouter(routes);
|
||||
*
|
||||
* function App() {
|
||||
* return <RouterProvider router={router} />;
|
||||
* }
|
||||
*
|
||||
* @name createRoutesFromElements
|
||||
* @public
|
||||
* @category Utils
|
||||
* @mode data
|
||||
* @param children The React children to convert into a route config
|
||||
* @param parentPath The path of the parent route, used to generate unique IDs.
|
||||
* This is used for internal recursion and is not intended to be used by the
|
||||
* application developer.
|
||||
* @returns An array of {@link RouteObject}s that can be used with a {@link DataRouter}
|
||||
*/
|
||||
declare const createRoutesFromElements: typeof createRoutesFromChildren;
|
||||
/**
|
||||
* Renders the result of {@link matchRoutes} into a React element.
|
||||
*
|
||||
* @public
|
||||
* @category Utils
|
||||
* @param matches The array of {@link RouteMatch | route matches} to render
|
||||
* @returns A React element that renders the matched routes or `null` if no matches
|
||||
*/
|
||||
declare function renderMatches(matches: RouteMatch[] | null): React.ReactElement | null;
|
||||
declare function useRouteComponentProps(): {
|
||||
params: Readonly<Params<string>>;
|
||||
loaderData: any;
|
||||
actionData: any;
|
||||
matches: UIMatch<unknown, unknown>[];
|
||||
};
|
||||
type RouteComponentProps = ReturnType<typeof useRouteComponentProps>;
|
||||
type RouteComponentType = React.ComponentType<RouteComponentProps>;
|
||||
declare function WithComponentProps({ children, }: {
|
||||
children: React.ReactElement;
|
||||
}): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
||||
declare function withComponentProps(Component: RouteComponentType): () => React.ReactElement<{
|
||||
params: Readonly<Params<string>>;
|
||||
loaderData: any;
|
||||
actionData: any;
|
||||
matches: UIMatch<unknown, unknown>[];
|
||||
}, string | React.JSXElementConstructor<any>>;
|
||||
declare function useHydrateFallbackProps(): {
|
||||
params: Readonly<Params<string>>;
|
||||
loaderData: any;
|
||||
actionData: any;
|
||||
};
|
||||
type HydrateFallbackProps = ReturnType<typeof useHydrateFallbackProps>;
|
||||
type HydrateFallbackType = React.ComponentType<HydrateFallbackProps>;
|
||||
declare function WithHydrateFallbackProps({ children, }: {
|
||||
children: React.ReactElement;
|
||||
}): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
||||
declare function withHydrateFallbackProps(HydrateFallback: HydrateFallbackType): () => React.ReactElement<{
|
||||
params: Readonly<Params<string>>;
|
||||
loaderData: any;
|
||||
actionData: any;
|
||||
}, string | React.JSXElementConstructor<any>>;
|
||||
declare function useErrorBoundaryProps(): {
|
||||
params: Readonly<Params<string>>;
|
||||
loaderData: any;
|
||||
actionData: any;
|
||||
error: unknown;
|
||||
};
|
||||
type ErrorBoundaryProps = ReturnType<typeof useErrorBoundaryProps>;
|
||||
type ErrorBoundaryType = React.ComponentType<ErrorBoundaryProps>;
|
||||
declare function WithErrorBoundaryProps({ children, }: {
|
||||
children: React.ReactElement;
|
||||
}): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
||||
declare function withErrorBoundaryProps(ErrorBoundary: ErrorBoundaryType): () => React.ReactElement<{
|
||||
params: Readonly<Params<string>>;
|
||||
loaderData: any;
|
||||
actionData: any;
|
||||
error: unknown;
|
||||
}, string | React.JSXElementConstructor<any>>;
|
||||
|
||||
export { type AwaitProps as A, type ErrorBoundaryType as E, type HydrateFallbackType as H, type IndexRouteProps as I, type LayoutRouteProps as L, type MemoryRouterOpts as M, type NavigateProps as N, type OutletProps as O, type PathRouteProps as P, type RouterProviderProps as R, WithComponentProps as W, type RouteComponentType as a, type MemoryRouterProps as b, type RouteProps as c, type RouterProps as d, type RoutesProps as e, Await as f, MemoryRouter as g, Navigate as h, Outlet as i, Route as j, Router as k, RouterProvider as l, Routes as m, createMemoryRouter as n, createRoutesFromChildren as o, createRoutesFromElements as p, hydrationRouteProperties as q, renderMatches as r, mapRouteProperties as s, WithHydrateFallbackProps as t, withHydrateFallbackProps as u, WithErrorBoundaryProps as v, withComponentProps as w, withErrorBoundaryProps as x };
|
||||
32
node_modules/react-router/dist/development/dom-export.d.mts
generated
vendored
Normal file
32
node_modules/react-router/dist/development/dom-export.d.mts
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import * as React from 'react';
|
||||
import { R as RouterProviderProps$1 } from './components-CjQijYga.mjs';
|
||||
import './browser-7LYX59NK.mjs';
|
||||
import { e as RouterInit } from './route-data-CqEmXQub.mjs';
|
||||
import 'node:async_hooks';
|
||||
|
||||
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
||||
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
||||
|
||||
interface HydratedRouterProps {
|
||||
/**
|
||||
* Context object to passed through to `createBrowserRouter` and made available
|
||||
* to `clientLoader`/`clientActon` functions
|
||||
*/
|
||||
unstable_getContext?: RouterInit["unstable_getContext"];
|
||||
}
|
||||
/**
|
||||
* Framework-mode router component to be used to to hydrate a router from a
|
||||
* `ServerRouter`. See [`entry.client.tsx`](../api/framework-conventions/entry.client.tsx).
|
||||
*
|
||||
* @public
|
||||
* @category Framework Routers
|
||||
* @mode framework
|
||||
* @param props Props
|
||||
* @param props.unstable_getContext Context object to passed through to
|
||||
* {@link createBrowserRouter} and made available to `clientLoader`/`clientAction`
|
||||
* functions
|
||||
* @returns A React element that represents the hydrated application.
|
||||
*/
|
||||
declare function HydratedRouter(props: HydratedRouterProps): React.JSX.Element;
|
||||
|
||||
export { HydratedRouter, RouterProvider, type RouterProviderProps };
|
||||
29
node_modules/react-router/dist/development/dom-export.d.ts
generated
vendored
Normal file
29
node_modules/react-router/dist/development/dom-export.d.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import * as React from 'react';
|
||||
import { RouterProviderProps as RouterProviderProps$1, RouterInit } from 'react-router';
|
||||
|
||||
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
||||
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
||||
|
||||
interface HydratedRouterProps {
|
||||
/**
|
||||
* Context object to passed through to `createBrowserRouter` and made available
|
||||
* to `clientLoader`/`clientActon` functions
|
||||
*/
|
||||
unstable_getContext?: RouterInit["unstable_getContext"];
|
||||
}
|
||||
/**
|
||||
* Framework-mode router component to be used to to hydrate a router from a
|
||||
* `ServerRouter`. See [`entry.client.tsx`](../api/framework-conventions/entry.client.tsx).
|
||||
*
|
||||
* @public
|
||||
* @category Framework Routers
|
||||
* @mode framework
|
||||
* @param props Props
|
||||
* @param props.unstable_getContext Context object to passed through to
|
||||
* {@link createBrowserRouter} and made available to `clientLoader`/`clientAction`
|
||||
* functions
|
||||
* @returns A React element that represents the hydrated application.
|
||||
*/
|
||||
declare function HydratedRouter(props: HydratedRouterProps): React.JSX.Element;
|
||||
|
||||
export { HydratedRouter, RouterProvider, type RouterProviderProps };
|
||||
234
node_modules/react-router/dist/development/dom-export.js
generated
vendored
Normal file
234
node_modules/react-router/dist/development/dom-export.js
generated
vendored
Normal file
@@ -0,0 +1,234 @@
|
||||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
||||
* react-router v7.7.1
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
"use client";
|
||||
|
||||
|
||||
var _chunkK7YFBME3js = require('./chunk-K7YFBME3.js');
|
||||
|
||||
// lib/dom-export/dom-router-provider.tsx
|
||||
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react);
|
||||
var _reactdom = require('react-dom'); var ReactDOM = _interopRequireWildcard(_reactdom);
|
||||
var _reactrouter = require('react-router');
|
||||
function RouterProvider(props) {
|
||||
return /* @__PURE__ */ React.createElement(_reactrouter.RouterProvider, { flushSync: ReactDOM.flushSync, ...props });
|
||||
}
|
||||
|
||||
// lib/dom-export/hydrated-router.tsx
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var ssrInfo = null;
|
||||
var router = null;
|
||||
function initSsrInfo() {
|
||||
if (!ssrInfo && window.__reactRouterContext && window.__reactRouterManifest && window.__reactRouterRouteModules) {
|
||||
if (window.__reactRouterManifest.sri === true) {
|
||||
const importMap = document.querySelector("script[rr-importmap]");
|
||||
if (_optionalChain([importMap, 'optionalAccess', _ => _.textContent])) {
|
||||
try {
|
||||
window.__reactRouterManifest.sri = JSON.parse(
|
||||
importMap.textContent
|
||||
).integrity;
|
||||
} catch (err) {
|
||||
console.error("Failed to parse import map", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
ssrInfo = {
|
||||
context: window.__reactRouterContext,
|
||||
manifest: window.__reactRouterManifest,
|
||||
routeModules: window.__reactRouterRouteModules,
|
||||
stateDecodingPromise: void 0,
|
||||
router: void 0,
|
||||
routerInitialized: false
|
||||
};
|
||||
}
|
||||
}
|
||||
function createHydratedRouter({
|
||||
unstable_getContext
|
||||
}) {
|
||||
initSsrInfo();
|
||||
if (!ssrInfo) {
|
||||
throw new Error(
|
||||
"You must be using the SSR features of React Router in order to skip passing a `router` prop to `<RouterProvider>`"
|
||||
);
|
||||
}
|
||||
let localSsrInfo = ssrInfo;
|
||||
if (!ssrInfo.stateDecodingPromise) {
|
||||
let stream = ssrInfo.context.stream;
|
||||
_reactrouter.UNSAFE_invariant.call(void 0, stream, "No stream found for single fetch decoding");
|
||||
ssrInfo.context.stream = void 0;
|
||||
ssrInfo.stateDecodingPromise = _reactrouter.UNSAFE_decodeViaTurboStream.call(void 0, stream, window).then((value) => {
|
||||
ssrInfo.context.state = value.value;
|
||||
localSsrInfo.stateDecodingPromise.value = true;
|
||||
}).catch((e) => {
|
||||
localSsrInfo.stateDecodingPromise.error = e;
|
||||
});
|
||||
}
|
||||
if (ssrInfo.stateDecodingPromise.error) {
|
||||
throw ssrInfo.stateDecodingPromise.error;
|
||||
}
|
||||
if (!ssrInfo.stateDecodingPromise.value) {
|
||||
throw ssrInfo.stateDecodingPromise;
|
||||
}
|
||||
let routes = _reactrouter.UNSAFE_createClientRoutes.call(void 0,
|
||||
ssrInfo.manifest.routes,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.state,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.isSpaMode
|
||||
);
|
||||
let hydrationData = void 0;
|
||||
if (ssrInfo.context.isSpaMode) {
|
||||
let { loaderData } = ssrInfo.context.state;
|
||||
if (_optionalChain([ssrInfo, 'access', _2 => _2.manifest, 'access', _3 => _3.routes, 'access', _4 => _4.root, 'optionalAccess', _5 => _5.hasLoader]) && loaderData && "root" in loaderData) {
|
||||
hydrationData = {
|
||||
loaderData: {
|
||||
root: loaderData.root
|
||||
}
|
||||
};
|
||||
}
|
||||
} else {
|
||||
hydrationData = _reactrouter.UNSAFE_getHydrationData.call(void 0,
|
||||
ssrInfo.context.state,
|
||||
routes,
|
||||
(routeId) => ({
|
||||
clientLoader: _optionalChain([ssrInfo, 'access', _6 => _6.routeModules, 'access', _7 => _7[routeId], 'optionalAccess', _8 => _8.clientLoader]),
|
||||
hasLoader: _optionalChain([ssrInfo, 'access', _9 => _9.manifest, 'access', _10 => _10.routes, 'access', _11 => _11[routeId], 'optionalAccess', _12 => _12.hasLoader]) === true,
|
||||
hasHydrateFallback: _optionalChain([ssrInfo, 'access', _13 => _13.routeModules, 'access', _14 => _14[routeId], 'optionalAccess', _15 => _15.HydrateFallback]) != null
|
||||
}),
|
||||
window.location,
|
||||
_optionalChain([window, 'access', _16 => _16.__reactRouterContext, 'optionalAccess', _17 => _17.basename]),
|
||||
ssrInfo.context.isSpaMode
|
||||
);
|
||||
if (hydrationData && hydrationData.errors) {
|
||||
hydrationData.errors = _reactrouter.UNSAFE_deserializeErrors.call(void 0, hydrationData.errors);
|
||||
}
|
||||
}
|
||||
let router2 = _reactrouter.UNSAFE_createRouter.call(void 0, {
|
||||
routes,
|
||||
history: _reactrouter.UNSAFE_createBrowserHistory.call(void 0, ),
|
||||
basename: ssrInfo.context.basename,
|
||||
unstable_getContext,
|
||||
hydrationData,
|
||||
hydrationRouteProperties: _reactrouter.UNSAFE_hydrationRouteProperties,
|
||||
mapRouteProperties: _reactrouter.UNSAFE_mapRouteProperties,
|
||||
future: {
|
||||
unstable_middleware: ssrInfo.context.future.unstable_middleware
|
||||
},
|
||||
dataStrategy: _reactrouter.UNSAFE_getTurboStreamSingleFetchDataStrategy.call(void 0,
|
||||
() => router2,
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.basename
|
||||
),
|
||||
patchRoutesOnNavigation: _reactrouter.UNSAFE_getPatchRoutesOnNavigationFunction.call(void 0,
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.routeDiscovery,
|
||||
ssrInfo.context.isSpaMode,
|
||||
ssrInfo.context.basename
|
||||
)
|
||||
});
|
||||
ssrInfo.router = router2;
|
||||
if (router2.state.initialized) {
|
||||
ssrInfo.routerInitialized = true;
|
||||
router2.initialize();
|
||||
}
|
||||
router2.createRoutesForHMR = /* spacer so ts-ignore does not affect the right hand of the assignment */
|
||||
_reactrouter.UNSAFE_createClientRoutesWithHMRRevalidationOptOut;
|
||||
window.__reactRouterDataRouter = router2;
|
||||
return router2;
|
||||
}
|
||||
function HydratedRouter(props) {
|
||||
if (!router) {
|
||||
router = createHydratedRouter({
|
||||
unstable_getContext: props.unstable_getContext
|
||||
});
|
||||
}
|
||||
let [criticalCss, setCriticalCss] = React2.useState(
|
||||
process.env.NODE_ENV === "development" ? _optionalChain([ssrInfo, 'optionalAccess', _18 => _18.context, 'access', _19 => _19.criticalCss]) : void 0
|
||||
);
|
||||
React2.useEffect(() => {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
setCriticalCss(void 0);
|
||||
}
|
||||
}, []);
|
||||
React2.useEffect(() => {
|
||||
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
|
||||
document.querySelectorAll(`[${_chunkK7YFBME3js.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
||||
}
|
||||
}, [criticalCss]);
|
||||
let [location, setLocation] = React2.useState(router.state.location);
|
||||
React2.useLayoutEffect(() => {
|
||||
if (ssrInfo && ssrInfo.router && !ssrInfo.routerInitialized) {
|
||||
ssrInfo.routerInitialized = true;
|
||||
ssrInfo.router.initialize();
|
||||
}
|
||||
}, []);
|
||||
React2.useLayoutEffect(() => {
|
||||
if (ssrInfo && ssrInfo.router) {
|
||||
return ssrInfo.router.subscribe((newState) => {
|
||||
if (newState.location !== location) {
|
||||
setLocation(newState.location);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, [location]);
|
||||
_reactrouter.UNSAFE_invariant.call(void 0, ssrInfo, "ssrInfo unavailable for HydratedRouter");
|
||||
_reactrouter.UNSAFE_useFogOFWarDiscovery.call(void 0,
|
||||
router,
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.routeDiscovery,
|
||||
ssrInfo.context.isSpaMode
|
||||
);
|
||||
return (
|
||||
// This fragment is important to ensure we match the <ServerRouter> JSX
|
||||
// structure so that useId values hydrate correctly
|
||||
/* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
||||
_reactrouter.UNSAFE_FrameworkContext.Provider,
|
||||
{
|
||||
value: {
|
||||
manifest: ssrInfo.manifest,
|
||||
routeModules: ssrInfo.routeModules,
|
||||
future: ssrInfo.context.future,
|
||||
criticalCss,
|
||||
ssr: ssrInfo.context.ssr,
|
||||
isSpaMode: ssrInfo.context.isSpaMode,
|
||||
routeDiscovery: ssrInfo.context.routeDiscovery
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ React2.createElement(_reactrouter.UNSAFE_RemixErrorBoundary, { location }, /* @__PURE__ */ React2.createElement(RouterProvider, { router }))
|
||||
), /* @__PURE__ */ React2.createElement(React2.Fragment, null))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
exports.HydratedRouter = HydratedRouter; exports.RouterProvider = RouterProvider;
|
||||
234
node_modules/react-router/dist/development/dom-export.mjs
generated
vendored
Normal file
234
node_modules/react-router/dist/development/dom-export.mjs
generated
vendored
Normal file
@@ -0,0 +1,234 @@
|
||||
/**
|
||||
* react-router v7.7.1
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
"use client";
|
||||
import {
|
||||
deserializeErrors,
|
||||
getHydrationData
|
||||
} from "./chunk-KIUJAIYX.mjs";
|
||||
import {
|
||||
CRITICAL_CSS_DATA_ATTRIBUTE,
|
||||
FrameworkContext,
|
||||
RemixErrorBoundary,
|
||||
RouterProvider,
|
||||
createBrowserHistory,
|
||||
createClientRoutes,
|
||||
createClientRoutesWithHMRRevalidationOptOut,
|
||||
createRouter,
|
||||
decodeViaTurboStream,
|
||||
getPatchRoutesOnNavigationFunction,
|
||||
getTurboStreamSingleFetchDataStrategy,
|
||||
hydrationRouteProperties,
|
||||
invariant,
|
||||
mapRouteProperties,
|
||||
useFogOFWarDiscovery
|
||||
} from "./chunk-C37GKA54.mjs";
|
||||
|
||||
// lib/dom-export/dom-router-provider.tsx
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
function RouterProvider2(props) {
|
||||
return /* @__PURE__ */ React.createElement(RouterProvider, { flushSync: ReactDOM.flushSync, ...props });
|
||||
}
|
||||
|
||||
// lib/dom-export/hydrated-router.tsx
|
||||
import * as React2 from "react";
|
||||
var ssrInfo = null;
|
||||
var router = null;
|
||||
function initSsrInfo() {
|
||||
if (!ssrInfo && window.__reactRouterContext && window.__reactRouterManifest && window.__reactRouterRouteModules) {
|
||||
if (window.__reactRouterManifest.sri === true) {
|
||||
const importMap = document.querySelector("script[rr-importmap]");
|
||||
if (importMap?.textContent) {
|
||||
try {
|
||||
window.__reactRouterManifest.sri = JSON.parse(
|
||||
importMap.textContent
|
||||
).integrity;
|
||||
} catch (err) {
|
||||
console.error("Failed to parse import map", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
ssrInfo = {
|
||||
context: window.__reactRouterContext,
|
||||
manifest: window.__reactRouterManifest,
|
||||
routeModules: window.__reactRouterRouteModules,
|
||||
stateDecodingPromise: void 0,
|
||||
router: void 0,
|
||||
routerInitialized: false
|
||||
};
|
||||
}
|
||||
}
|
||||
function createHydratedRouter({
|
||||
unstable_getContext
|
||||
}) {
|
||||
initSsrInfo();
|
||||
if (!ssrInfo) {
|
||||
throw new Error(
|
||||
"You must be using the SSR features of React Router in order to skip passing a `router` prop to `<RouterProvider>`"
|
||||
);
|
||||
}
|
||||
let localSsrInfo = ssrInfo;
|
||||
if (!ssrInfo.stateDecodingPromise) {
|
||||
let stream = ssrInfo.context.stream;
|
||||
invariant(stream, "No stream found for single fetch decoding");
|
||||
ssrInfo.context.stream = void 0;
|
||||
ssrInfo.stateDecodingPromise = decodeViaTurboStream(stream, window).then((value) => {
|
||||
ssrInfo.context.state = value.value;
|
||||
localSsrInfo.stateDecodingPromise.value = true;
|
||||
}).catch((e) => {
|
||||
localSsrInfo.stateDecodingPromise.error = e;
|
||||
});
|
||||
}
|
||||
if (ssrInfo.stateDecodingPromise.error) {
|
||||
throw ssrInfo.stateDecodingPromise.error;
|
||||
}
|
||||
if (!ssrInfo.stateDecodingPromise.value) {
|
||||
throw ssrInfo.stateDecodingPromise;
|
||||
}
|
||||
let routes = createClientRoutes(
|
||||
ssrInfo.manifest.routes,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.state,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.isSpaMode
|
||||
);
|
||||
let hydrationData = void 0;
|
||||
if (ssrInfo.context.isSpaMode) {
|
||||
let { loaderData } = ssrInfo.context.state;
|
||||
if (ssrInfo.manifest.routes.root?.hasLoader && loaderData && "root" in loaderData) {
|
||||
hydrationData = {
|
||||
loaderData: {
|
||||
root: loaderData.root
|
||||
}
|
||||
};
|
||||
}
|
||||
} else {
|
||||
hydrationData = getHydrationData(
|
||||
ssrInfo.context.state,
|
||||
routes,
|
||||
(routeId) => ({
|
||||
clientLoader: ssrInfo.routeModules[routeId]?.clientLoader,
|
||||
hasLoader: ssrInfo.manifest.routes[routeId]?.hasLoader === true,
|
||||
hasHydrateFallback: ssrInfo.routeModules[routeId]?.HydrateFallback != null
|
||||
}),
|
||||
window.location,
|
||||
window.__reactRouterContext?.basename,
|
||||
ssrInfo.context.isSpaMode
|
||||
);
|
||||
if (hydrationData && hydrationData.errors) {
|
||||
hydrationData.errors = deserializeErrors(hydrationData.errors);
|
||||
}
|
||||
}
|
||||
let router2 = createRouter({
|
||||
routes,
|
||||
history: createBrowserHistory(),
|
||||
basename: ssrInfo.context.basename,
|
||||
unstable_getContext,
|
||||
hydrationData,
|
||||
hydrationRouteProperties,
|
||||
mapRouteProperties,
|
||||
future: {
|
||||
unstable_middleware: ssrInfo.context.future.unstable_middleware
|
||||
},
|
||||
dataStrategy: getTurboStreamSingleFetchDataStrategy(
|
||||
() => router2,
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.basename
|
||||
),
|
||||
patchRoutesOnNavigation: getPatchRoutesOnNavigationFunction(
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.routeDiscovery,
|
||||
ssrInfo.context.isSpaMode,
|
||||
ssrInfo.context.basename
|
||||
)
|
||||
});
|
||||
ssrInfo.router = router2;
|
||||
if (router2.state.initialized) {
|
||||
ssrInfo.routerInitialized = true;
|
||||
router2.initialize();
|
||||
}
|
||||
router2.createRoutesForHMR = /* spacer so ts-ignore does not affect the right hand of the assignment */
|
||||
createClientRoutesWithHMRRevalidationOptOut;
|
||||
window.__reactRouterDataRouter = router2;
|
||||
return router2;
|
||||
}
|
||||
function HydratedRouter(props) {
|
||||
if (!router) {
|
||||
router = createHydratedRouter({
|
||||
unstable_getContext: props.unstable_getContext
|
||||
});
|
||||
}
|
||||
let [criticalCss, setCriticalCss] = React2.useState(
|
||||
process.env.NODE_ENV === "development" ? ssrInfo?.context.criticalCss : void 0
|
||||
);
|
||||
React2.useEffect(() => {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
setCriticalCss(void 0);
|
||||
}
|
||||
}, []);
|
||||
React2.useEffect(() => {
|
||||
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
|
||||
document.querySelectorAll(`[${CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
||||
}
|
||||
}, [criticalCss]);
|
||||
let [location, setLocation] = React2.useState(router.state.location);
|
||||
React2.useLayoutEffect(() => {
|
||||
if (ssrInfo && ssrInfo.router && !ssrInfo.routerInitialized) {
|
||||
ssrInfo.routerInitialized = true;
|
||||
ssrInfo.router.initialize();
|
||||
}
|
||||
}, []);
|
||||
React2.useLayoutEffect(() => {
|
||||
if (ssrInfo && ssrInfo.router) {
|
||||
return ssrInfo.router.subscribe((newState) => {
|
||||
if (newState.location !== location) {
|
||||
setLocation(newState.location);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, [location]);
|
||||
invariant(ssrInfo, "ssrInfo unavailable for HydratedRouter");
|
||||
useFogOFWarDiscovery(
|
||||
router,
|
||||
ssrInfo.manifest,
|
||||
ssrInfo.routeModules,
|
||||
ssrInfo.context.ssr,
|
||||
ssrInfo.context.routeDiscovery,
|
||||
ssrInfo.context.isSpaMode
|
||||
);
|
||||
return (
|
||||
// This fragment is important to ensure we match the <ServerRouter> JSX
|
||||
// structure so that useId values hydrate correctly
|
||||
/* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
||||
FrameworkContext.Provider,
|
||||
{
|
||||
value: {
|
||||
manifest: ssrInfo.manifest,
|
||||
routeModules: ssrInfo.routeModules,
|
||||
future: ssrInfo.context.future,
|
||||
criticalCss,
|
||||
ssr: ssrInfo.context.ssr,
|
||||
isSpaMode: ssrInfo.context.isSpaMode,
|
||||
routeDiscovery: ssrInfo.context.routeDiscovery
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ React2.createElement(RemixErrorBoundary, { location }, /* @__PURE__ */ React2.createElement(RouterProvider2, { router }))
|
||||
), /* @__PURE__ */ React2.createElement(React2.Fragment, null))
|
||||
);
|
||||
}
|
||||
export {
|
||||
HydratedRouter,
|
||||
RouterProvider2 as RouterProvider
|
||||
};
|
||||
3163
node_modules/react-router/dist/development/index-react-server-client-Bi_fx8qz.d.ts
generated
vendored
Normal file
3163
node_modules/react-router/dist/development/index-react-server-client-Bi_fx8qz.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2366
node_modules/react-router/dist/development/index-react-server-client-KLg-U4nr.d.mts
generated
vendored
Normal file
2366
node_modules/react-router/dist/development/index-react-server-client-KLg-U4nr.d.mts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
node_modules/react-router/dist/development/index-react-server-client.d.mts
generated
vendored
Normal file
4
node_modules/react-router/dist/development/index-react-server-client.d.mts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export { f as Await, g as MemoryRouter, h as Navigate, i as Outlet, j as Route, k as Router, l as RouterProvider, m as Routes, W as UNSAFE_WithComponentProps, v as UNSAFE_WithErrorBoundaryProps, t as UNSAFE_WithHydrateFallbackProps } from './components-CjQijYga.mjs';
|
||||
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-KLg-U4nr.mjs';
|
||||
import './route-data-CqEmXQub.mjs';
|
||||
import 'react';
|
||||
3
node_modules/react-router/dist/development/index-react-server-client.d.ts
generated
vendored
Normal file
3
node_modules/react-router/dist/development/index-react-server-client.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { h as Await, V as BrowserRouter, _ as Form, W as HashRouter, X as Link, am as Links, i as MemoryRouter, al as Meta, Z as NavLink, j as Navigate, k as Outlet, l as Route, m as Router, n as RouterProvider, o as Routes, $ as ScrollRestoration, aj as StaticRouter, ak as StaticRouterProvider, ay as UNSAFE_WithComponentProps, aC as UNSAFE_WithErrorBoundaryProps, aA as UNSAFE_WithHydrateFallbackProps, Y as unstable_HistoryRouter } from './index-react-server-client-Bi_fx8qz.js';
|
||||
import './routeModules-BR2FO0ix.js';
|
||||
import 'react';
|
||||
61
node_modules/react-router/dist/development/index-react-server-client.js
generated
vendored
Normal file
61
node_modules/react-router/dist/development/index-react-server-client.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
|
||||
* react-router v7.7.1
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
"use client";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var _chunkR73PQUJUjs = require('./chunk-R73PQUJU.js');
|
||||
|
||||
|
||||
|
||||
var _chunkK7YFBME3js = require('./chunk-K7YFBME3.js');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
exports.Await = _chunkR73PQUJUjs.Await; exports.BrowserRouter = _chunkR73PQUJUjs.BrowserRouter; exports.Form = _chunkR73PQUJUjs.Form; exports.HashRouter = _chunkR73PQUJUjs.HashRouter; exports.Link = _chunkR73PQUJUjs.Link; exports.Links = _chunkK7YFBME3js.Links; exports.MemoryRouter = _chunkR73PQUJUjs.MemoryRouter; exports.Meta = _chunkK7YFBME3js.Meta; exports.NavLink = _chunkR73PQUJUjs.NavLink; exports.Navigate = _chunkR73PQUJUjs.Navigate; exports.Outlet = _chunkR73PQUJUjs.Outlet; exports.Route = _chunkR73PQUJUjs.Route; exports.Router = _chunkR73PQUJUjs.Router; exports.RouterProvider = _chunkR73PQUJUjs.RouterProvider; exports.Routes = _chunkR73PQUJUjs.Routes; exports.ScrollRestoration = _chunkR73PQUJUjs.ScrollRestoration; exports.StaticRouter = _chunkR73PQUJUjs.StaticRouter; exports.StaticRouterProvider = _chunkR73PQUJUjs.StaticRouterProvider; exports.UNSAFE_WithComponentProps = _chunkR73PQUJUjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkR73PQUJUjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkR73PQUJUjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkR73PQUJUjs.HistoryRouter;
|
||||
59
node_modules/react-router/dist/development/index-react-server-client.mjs
generated
vendored
Normal file
59
node_modules/react-router/dist/development/index-react-server-client.mjs
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* react-router v7.7.1
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
"use client";
|
||||
import {
|
||||
Await,
|
||||
BrowserRouter,
|
||||
Form,
|
||||
HashRouter,
|
||||
HistoryRouter,
|
||||
Link,
|
||||
Links,
|
||||
MemoryRouter,
|
||||
Meta,
|
||||
NavLink,
|
||||
Navigate,
|
||||
Outlet,
|
||||
Route,
|
||||
Router,
|
||||
RouterProvider,
|
||||
Routes,
|
||||
ScrollRestoration,
|
||||
StaticRouter,
|
||||
StaticRouterProvider,
|
||||
WithComponentProps,
|
||||
WithErrorBoundaryProps,
|
||||
WithHydrateFallbackProps
|
||||
} from "./chunk-C37GKA54.mjs";
|
||||
export {
|
||||
Await,
|
||||
BrowserRouter,
|
||||
Form,
|
||||
HashRouter,
|
||||
Link,
|
||||
Links,
|
||||
MemoryRouter,
|
||||
Meta,
|
||||
NavLink,
|
||||
Navigate,
|
||||
Outlet,
|
||||
Route,
|
||||
Router,
|
||||
RouterProvider,
|
||||
Routes,
|
||||
ScrollRestoration,
|
||||
StaticRouter,
|
||||
StaticRouterProvider,
|
||||
WithComponentProps as UNSAFE_WithComponentProps,
|
||||
WithErrorBoundaryProps as UNSAFE_WithErrorBoundaryProps,
|
||||
WithHydrateFallbackProps as UNSAFE_WithHydrateFallbackProps,
|
||||
HistoryRouter as unstable_HistoryRouter
|
||||
};
|
||||
1970
node_modules/react-router/dist/development/index-react-server.d.mts
generated
vendored
Normal file
1970
node_modules/react-router/dist/development/index-react-server.d.mts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1970
node_modules/react-router/dist/development/index-react-server.d.ts
generated
vendored
Normal file
1970
node_modules/react-router/dist/development/index-react-server.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3218
node_modules/react-router/dist/development/index-react-server.js
generated
vendored
Normal file
3218
node_modules/react-router/dist/development/index-react-server.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3106
node_modules/react-router/dist/development/index-react-server.mjs
generated
vendored
Normal file
3106
node_modules/react-router/dist/development/index-react-server.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1426
node_modules/react-router/dist/development/index.d.mts
generated
vendored
Normal file
1426
node_modules/react-router/dist/development/index.d.mts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1643
node_modules/react-router/dist/development/index.d.ts
generated
vendored
Normal file
1643
node_modules/react-router/dist/development/index.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2889
node_modules/react-router/dist/development/index.js
generated
vendored
Normal file
2889
node_modules/react-router/dist/development/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
273
node_modules/react-router/dist/development/index.mjs
generated
vendored
Normal file
273
node_modules/react-router/dist/development/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,273 @@
|
||||
/**
|
||||
* react-router v7.7.1
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
"use client";
|
||||
import {
|
||||
RSCDefaultRootErrorBoundary,
|
||||
RSCHydratedRouter,
|
||||
RSCStaticRouter,
|
||||
ServerMode,
|
||||
ServerRouter,
|
||||
createCallServer,
|
||||
createCookie,
|
||||
createCookieSessionStorage,
|
||||
createMemorySessionStorage,
|
||||
createRequestHandler,
|
||||
createRoutesStub,
|
||||
createSession,
|
||||
createSessionStorage,
|
||||
deserializeErrors,
|
||||
getHydrationData,
|
||||
getRSCStream,
|
||||
href,
|
||||
isCookie,
|
||||
isSession,
|
||||
routeRSCServerRequest,
|
||||
setDevServerHooks
|
||||
} from "./chunk-KIUJAIYX.mjs";
|
||||
import {
|
||||
Action,
|
||||
Await,
|
||||
BrowserRouter,
|
||||
DataRouterContext,
|
||||
DataRouterStateContext,
|
||||
ErrorResponseImpl,
|
||||
FetchersContext,
|
||||
Form,
|
||||
FrameworkContext,
|
||||
HashRouter,
|
||||
HistoryRouter,
|
||||
IDLE_BLOCKER,
|
||||
IDLE_FETCHER,
|
||||
IDLE_NAVIGATION,
|
||||
Link,
|
||||
Links,
|
||||
LocationContext,
|
||||
MemoryRouter,
|
||||
Meta,
|
||||
NavLink,
|
||||
Navigate,
|
||||
NavigationContext,
|
||||
Outlet,
|
||||
PrefetchPageLinks,
|
||||
RemixErrorBoundary,
|
||||
Route,
|
||||
RouteContext,
|
||||
Router,
|
||||
RouterProvider,
|
||||
Routes,
|
||||
Scripts,
|
||||
ScrollRestoration,
|
||||
SingleFetchRedirectSymbol,
|
||||
StaticRouter,
|
||||
StaticRouterProvider,
|
||||
ViewTransitionContext,
|
||||
WithComponentProps,
|
||||
WithErrorBoundaryProps,
|
||||
WithHydrateFallbackProps,
|
||||
createBrowserHistory,
|
||||
createBrowserRouter,
|
||||
createClientRoutes,
|
||||
createClientRoutesWithHMRRevalidationOptOut,
|
||||
createHashRouter,
|
||||
createMemoryRouter,
|
||||
createPath,
|
||||
createRouter,
|
||||
createRoutesFromChildren,
|
||||
createRoutesFromElements,
|
||||
createSearchParams,
|
||||
createStaticHandler2 as createStaticHandler,
|
||||
createStaticRouter,
|
||||
data,
|
||||
decodeViaTurboStream,
|
||||
generatePath,
|
||||
getPatchRoutesOnNavigationFunction,
|
||||
getTurboStreamSingleFetchDataStrategy,
|
||||
hydrationRouteProperties,
|
||||
invariant,
|
||||
isRouteErrorResponse,
|
||||
mapRouteProperties,
|
||||
matchPath,
|
||||
matchRoutes,
|
||||
parsePath,
|
||||
redirect,
|
||||
redirectDocument,
|
||||
renderMatches,
|
||||
replace,
|
||||
resolvePath,
|
||||
shouldHydrateRouteLoader,
|
||||
unstable_RouterContextProvider,
|
||||
unstable_createContext,
|
||||
useActionData,
|
||||
useAsyncError,
|
||||
useAsyncValue,
|
||||
useBeforeUnload,
|
||||
useBlocker,
|
||||
useFetcher,
|
||||
useFetchers,
|
||||
useFogOFWarDiscovery,
|
||||
useFormAction,
|
||||
useHref,
|
||||
useInRouterContext,
|
||||
useLinkClickHandler,
|
||||
useLoaderData,
|
||||
useLocation,
|
||||
useMatch,
|
||||
useMatches,
|
||||
useNavigate,
|
||||
useNavigation,
|
||||
useNavigationType,
|
||||
useOutlet,
|
||||
useOutletContext,
|
||||
useParams,
|
||||
usePrompt,
|
||||
useResolvedPath,
|
||||
useRevalidator,
|
||||
useRouteError,
|
||||
useRouteLoaderData,
|
||||
useRoutes,
|
||||
useScrollRestoration,
|
||||
useSearchParams,
|
||||
useSubmit,
|
||||
useViewTransitionState,
|
||||
withComponentProps,
|
||||
withErrorBoundaryProps,
|
||||
withHydrateFallbackProps
|
||||
} from "./chunk-C37GKA54.mjs";
|
||||
export {
|
||||
Await,
|
||||
BrowserRouter,
|
||||
Form,
|
||||
HashRouter,
|
||||
IDLE_BLOCKER,
|
||||
IDLE_FETCHER,
|
||||
IDLE_NAVIGATION,
|
||||
Link,
|
||||
Links,
|
||||
MemoryRouter,
|
||||
Meta,
|
||||
NavLink,
|
||||
Navigate,
|
||||
Action as NavigationType,
|
||||
Outlet,
|
||||
PrefetchPageLinks,
|
||||
Route,
|
||||
Router,
|
||||
RouterProvider,
|
||||
Routes,
|
||||
Scripts,
|
||||
ScrollRestoration,
|
||||
ServerRouter,
|
||||
StaticRouter,
|
||||
StaticRouterProvider,
|
||||
DataRouterContext as UNSAFE_DataRouterContext,
|
||||
DataRouterStateContext as UNSAFE_DataRouterStateContext,
|
||||
ErrorResponseImpl as UNSAFE_ErrorResponseImpl,
|
||||
FetchersContext as UNSAFE_FetchersContext,
|
||||
FrameworkContext as UNSAFE_FrameworkContext,
|
||||
LocationContext as UNSAFE_LocationContext,
|
||||
NavigationContext as UNSAFE_NavigationContext,
|
||||
RSCDefaultRootErrorBoundary as UNSAFE_RSCDefaultRootErrorBoundary,
|
||||
RemixErrorBoundary as UNSAFE_RemixErrorBoundary,
|
||||
RouteContext as UNSAFE_RouteContext,
|
||||
ServerMode as UNSAFE_ServerMode,
|
||||
SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol,
|
||||
ViewTransitionContext as UNSAFE_ViewTransitionContext,
|
||||
WithComponentProps as UNSAFE_WithComponentProps,
|
||||
WithErrorBoundaryProps as UNSAFE_WithErrorBoundaryProps,
|
||||
WithHydrateFallbackProps as UNSAFE_WithHydrateFallbackProps,
|
||||
createBrowserHistory as UNSAFE_createBrowserHistory,
|
||||
createClientRoutes as UNSAFE_createClientRoutes,
|
||||
createClientRoutesWithHMRRevalidationOptOut as UNSAFE_createClientRoutesWithHMRRevalidationOptOut,
|
||||
createRouter as UNSAFE_createRouter,
|
||||
decodeViaTurboStream as UNSAFE_decodeViaTurboStream,
|
||||
deserializeErrors as UNSAFE_deserializeErrors,
|
||||
getHydrationData as UNSAFE_getHydrationData,
|
||||
getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction,
|
||||
getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy,
|
||||
hydrationRouteProperties as UNSAFE_hydrationRouteProperties,
|
||||
invariant as UNSAFE_invariant,
|
||||
mapRouteProperties as UNSAFE_mapRouteProperties,
|
||||
shouldHydrateRouteLoader as UNSAFE_shouldHydrateRouteLoader,
|
||||
useFogOFWarDiscovery as UNSAFE_useFogOFWarDiscovery,
|
||||
useScrollRestoration as UNSAFE_useScrollRestoration,
|
||||
withComponentProps as UNSAFE_withComponentProps,
|
||||
withErrorBoundaryProps as UNSAFE_withErrorBoundaryProps,
|
||||
withHydrateFallbackProps as UNSAFE_withHydrateFallbackProps,
|
||||
createBrowserRouter,
|
||||
createCookie,
|
||||
createCookieSessionStorage,
|
||||
createHashRouter,
|
||||
createMemoryRouter,
|
||||
createMemorySessionStorage,
|
||||
createPath,
|
||||
createRequestHandler,
|
||||
createRoutesFromChildren,
|
||||
createRoutesFromElements,
|
||||
createRoutesStub,
|
||||
createSearchParams,
|
||||
createSession,
|
||||
createSessionStorage,
|
||||
createStaticHandler,
|
||||
createStaticRouter,
|
||||
data,
|
||||
generatePath,
|
||||
href,
|
||||
isCookie,
|
||||
isRouteErrorResponse,
|
||||
isSession,
|
||||
matchPath,
|
||||
matchRoutes,
|
||||
parsePath,
|
||||
redirect,
|
||||
redirectDocument,
|
||||
renderMatches,
|
||||
replace,
|
||||
resolvePath,
|
||||
HistoryRouter as unstable_HistoryRouter,
|
||||
RSCHydratedRouter as unstable_RSCHydratedRouter,
|
||||
RSCStaticRouter as unstable_RSCStaticRouter,
|
||||
unstable_RouterContextProvider,
|
||||
createCallServer as unstable_createCallServer,
|
||||
unstable_createContext,
|
||||
getRSCStream as unstable_getRSCStream,
|
||||
routeRSCServerRequest as unstable_routeRSCServerRequest,
|
||||
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
|
||||
};
|
||||
146
node_modules/react-router/dist/development/lib/types/internal.d.mts
generated
vendored
Normal file
146
node_modules/react-router/dist/development/lib/types/internal.d.mts
generated
vendored
Normal file
@@ -0,0 +1,146 @@
|
||||
import { n as RouteModule, o as LinkDescriptor, c as Location, p as Pretty, q as MetaDescriptor, G as GetLoaderData, r as ServerDataFunctionArgs, s as unstable_MiddlewareNextFunction, t as ClientDataFunctionArgs, v as ServerDataFrom, w as Normalize, x as GetActionData } from '../../route-data-CqEmXQub.mjs';
|
||||
import { R as RouteFiles, P as Pages } from '../../register-DiOIlEq5.mjs';
|
||||
import 'react';
|
||||
|
||||
type MaybePromise<T> = T | Promise<T>;
|
||||
type Props = {
|
||||
params: unknown;
|
||||
loaderData: unknown;
|
||||
actionData: unknown;
|
||||
};
|
||||
type RouteInfo = Props & {
|
||||
module: RouteModule;
|
||||
matches: Array<MatchInfo>;
|
||||
};
|
||||
type MatchInfo = {
|
||||
id: string;
|
||||
module: RouteModule;
|
||||
};
|
||||
type MetaMatch<T extends MatchInfo> = Pretty<{
|
||||
id: T["id"];
|
||||
params: Record<string, string | undefined>;
|
||||
pathname: string;
|
||||
meta: MetaDescriptor[];
|
||||
data: GetLoaderData<T["module"]>;
|
||||
handle?: unknown;
|
||||
error?: unknown;
|
||||
}>;
|
||||
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>;
|
||||
type CreateMetaArgs<T extends RouteInfo> = {
|
||||
/** This is the current router `Location` object. This is useful for generating tags for routes at specific paths or query parameters. */
|
||||
location: Location;
|
||||
/** {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route. */
|
||||
params: T["params"];
|
||||
/** The return value for this route's server loader function */
|
||||
data: T["loaderData"] | undefined;
|
||||
/** Thrown errors that trigger error boundaries will be passed to the meta function. This is useful for generating metadata for error pages. */
|
||||
error?: unknown;
|
||||
/** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
|
||||
matches: MetaMatches<T["matches"]>;
|
||||
};
|
||||
type MetaDescriptors = MetaDescriptor[];
|
||||
type HeadersArgs = {
|
||||
loaderHeaders: Headers;
|
||||
parentHeaders: Headers;
|
||||
actionHeaders: Headers;
|
||||
errorHeaders: Headers | undefined;
|
||||
};
|
||||
type CreateServerMiddlewareFunction<T extends RouteInfo> = (args: ServerDataFunctionArgs<T["params"]>, next: unstable_MiddlewareNextFunction<Response>) => MaybePromise<Response | void>;
|
||||
type CreateClientMiddlewareFunction<T extends RouteInfo> = (args: ClientDataFunctionArgs<T["params"]>, next: unstable_MiddlewareNextFunction<undefined>) => MaybePromise<void>;
|
||||
type CreateServerLoaderArgs<T extends RouteInfo> = ServerDataFunctionArgs<T["params"]>;
|
||||
type CreateClientLoaderArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["params"]> & {
|
||||
/** This is an asynchronous function to get the data from the server loader for this route. On client-side navigations, this will make a {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server loader. If you opt-into running your clientLoader on hydration, then this function will return the data that was already loaded on the server (via Promise.resolve). */
|
||||
serverLoader: () => Promise<ServerDataFrom<T["module"]["loader"]>>;
|
||||
};
|
||||
type CreateServerActionArgs<T extends RouteInfo> = ServerDataFunctionArgs<T["params"]>;
|
||||
type CreateClientActionArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["params"]> & {
|
||||
/** This is an asynchronous function that makes the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server action for this route. */
|
||||
serverAction: () => Promise<ServerDataFrom<T["module"]["action"]>>;
|
||||
};
|
||||
type CreateHydrateFallbackProps<T extends RouteInfo> = {
|
||||
params: T["params"];
|
||||
loaderData?: T["loaderData"];
|
||||
actionData?: T["actionData"];
|
||||
};
|
||||
type Match<T extends MatchInfo> = Pretty<{
|
||||
id: T["id"];
|
||||
params: Record<string, string | undefined>;
|
||||
pathname: string;
|
||||
data: GetLoaderData<T["module"]>;
|
||||
handle: unknown;
|
||||
}>;
|
||||
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>;
|
||||
type CreateComponentProps<T extends RouteInfo> = {
|
||||
/**
|
||||
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
||||
* @example
|
||||
* // app/routes.ts
|
||||
* route("teams/:teamId", "./team.tsx"),
|
||||
*
|
||||
* // app/team.tsx
|
||||
* export default function Component({
|
||||
* params,
|
||||
* }: Route.ComponentProps) {
|
||||
* params.teamId;
|
||||
* // ^ string
|
||||
* }
|
||||
**/
|
||||
params: T["params"];
|
||||
/** The data returned from the `loader` or `clientLoader` */
|
||||
loaderData: T["loaderData"];
|
||||
/** The data returned from the `action` or `clientAction` following an action submission. */
|
||||
actionData?: T["actionData"];
|
||||
/** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
|
||||
matches: Matches<T["matches"]>;
|
||||
};
|
||||
type CreateErrorBoundaryProps<T extends RouteInfo> = {
|
||||
/**
|
||||
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
||||
* @example
|
||||
* // app/routes.ts
|
||||
* route("teams/:teamId", "./team.tsx"),
|
||||
*
|
||||
* // app/team.tsx
|
||||
* export function ErrorBoundary({
|
||||
* params,
|
||||
* }: Route.ErrorBoundaryProps) {
|
||||
* params.teamId;
|
||||
* // ^ string
|
||||
* }
|
||||
**/
|
||||
params: T["params"];
|
||||
error: unknown;
|
||||
loaderData?: T["loaderData"];
|
||||
actionData?: T["actionData"];
|
||||
};
|
||||
type GetAnnotations<Info extends RouteInfo> = {
|
||||
LinkDescriptors: LinkDescriptor[];
|
||||
LinksFunction: () => LinkDescriptor[];
|
||||
MetaArgs: CreateMetaArgs<Info>;
|
||||
MetaDescriptors: MetaDescriptors;
|
||||
MetaFunction: (args: CreateMetaArgs<Info>) => MetaDescriptors;
|
||||
HeadersArgs: HeadersArgs;
|
||||
HeadersFunction: (args: HeadersArgs) => Headers | HeadersInit;
|
||||
unstable_MiddlewareFunction: CreateServerMiddlewareFunction<Info>;
|
||||
unstable_ClientMiddlewareFunction: CreateClientMiddlewareFunction<Info>;
|
||||
LoaderArgs: CreateServerLoaderArgs<Info>;
|
||||
ClientLoaderArgs: CreateClientLoaderArgs<Info>;
|
||||
ActionArgs: CreateServerActionArgs<Info>;
|
||||
ClientActionArgs: CreateClientActionArgs<Info>;
|
||||
HydrateFallbackProps: CreateHydrateFallbackProps<Info>;
|
||||
ComponentProps: CreateComponentProps<Info>;
|
||||
ErrorBoundaryProps: CreateErrorBoundaryProps<Info>;
|
||||
};
|
||||
|
||||
type Params<RouteFile extends keyof RouteFiles> = Normalize<Pages[RouteFiles[RouteFile]["page"]]["params"]>;
|
||||
|
||||
type GetInfo<T extends {
|
||||
file: keyof RouteFiles;
|
||||
module: RouteModule;
|
||||
}> = {
|
||||
params: Params<T["file"]>;
|
||||
loaderData: GetLoaderData<T["module"]>;
|
||||
actionData: GetActionData<T["module"]>;
|
||||
};
|
||||
|
||||
export type { GetAnnotations, GetInfo };
|
||||
146
node_modules/react-router/dist/development/lib/types/internal.d.ts
generated
vendored
Normal file
146
node_modules/react-router/dist/development/lib/types/internal.d.ts
generated
vendored
Normal file
@@ -0,0 +1,146 @@
|
||||
import { R as RouteModule, L as LinkDescriptor, a as Location, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, u as unstable_MiddlewareNextFunction, C as ClientDataFunctionArgs, b as ServerDataFrom, N as Normalize, c as GetActionData } from '../../routeModules-BR2FO0ix.js';
|
||||
import { R as RouteFiles, P as Pages } from '../../register-DiOIlEq5.js';
|
||||
import 'react';
|
||||
|
||||
type MaybePromise<T> = T | Promise<T>;
|
||||
type Props = {
|
||||
params: unknown;
|
||||
loaderData: unknown;
|
||||
actionData: unknown;
|
||||
};
|
||||
type RouteInfo = Props & {
|
||||
module: RouteModule;
|
||||
matches: Array<MatchInfo>;
|
||||
};
|
||||
type MatchInfo = {
|
||||
id: string;
|
||||
module: RouteModule;
|
||||
};
|
||||
type MetaMatch<T extends MatchInfo> = Pretty<{
|
||||
id: T["id"];
|
||||
params: Record<string, string | undefined>;
|
||||
pathname: string;
|
||||
meta: MetaDescriptor[];
|
||||
data: GetLoaderData<T["module"]>;
|
||||
handle?: unknown;
|
||||
error?: unknown;
|
||||
}>;
|
||||
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>;
|
||||
type CreateMetaArgs<T extends RouteInfo> = {
|
||||
/** This is the current router `Location` object. This is useful for generating tags for routes at specific paths or query parameters. */
|
||||
location: Location;
|
||||
/** {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route. */
|
||||
params: T["params"];
|
||||
/** The return value for this route's server loader function */
|
||||
data: T["loaderData"] | undefined;
|
||||
/** Thrown errors that trigger error boundaries will be passed to the meta function. This is useful for generating metadata for error pages. */
|
||||
error?: unknown;
|
||||
/** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
|
||||
matches: MetaMatches<T["matches"]>;
|
||||
};
|
||||
type MetaDescriptors = MetaDescriptor[];
|
||||
type HeadersArgs = {
|
||||
loaderHeaders: Headers;
|
||||
parentHeaders: Headers;
|
||||
actionHeaders: Headers;
|
||||
errorHeaders: Headers | undefined;
|
||||
};
|
||||
type CreateServerMiddlewareFunction<T extends RouteInfo> = (args: ServerDataFunctionArgs<T["params"]>, next: unstable_MiddlewareNextFunction<Response>) => MaybePromise<Response | void>;
|
||||
type CreateClientMiddlewareFunction<T extends RouteInfo> = (args: ClientDataFunctionArgs<T["params"]>, next: unstable_MiddlewareNextFunction<undefined>) => MaybePromise<void>;
|
||||
type CreateServerLoaderArgs<T extends RouteInfo> = ServerDataFunctionArgs<T["params"]>;
|
||||
type CreateClientLoaderArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["params"]> & {
|
||||
/** This is an asynchronous function to get the data from the server loader for this route. On client-side navigations, this will make a {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server loader. If you opt-into running your clientLoader on hydration, then this function will return the data that was already loaded on the server (via Promise.resolve). */
|
||||
serverLoader: () => Promise<ServerDataFrom<T["module"]["loader"]>>;
|
||||
};
|
||||
type CreateServerActionArgs<T extends RouteInfo> = ServerDataFunctionArgs<T["params"]>;
|
||||
type CreateClientActionArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["params"]> & {
|
||||
/** This is an asynchronous function that makes the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server action for this route. */
|
||||
serverAction: () => Promise<ServerDataFrom<T["module"]["action"]>>;
|
||||
};
|
||||
type CreateHydrateFallbackProps<T extends RouteInfo> = {
|
||||
params: T["params"];
|
||||
loaderData?: T["loaderData"];
|
||||
actionData?: T["actionData"];
|
||||
};
|
||||
type Match<T extends MatchInfo> = Pretty<{
|
||||
id: T["id"];
|
||||
params: Record<string, string | undefined>;
|
||||
pathname: string;
|
||||
data: GetLoaderData<T["module"]>;
|
||||
handle: unknown;
|
||||
}>;
|
||||
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>;
|
||||
type CreateComponentProps<T extends RouteInfo> = {
|
||||
/**
|
||||
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
||||
* @example
|
||||
* // app/routes.ts
|
||||
* route("teams/:teamId", "./team.tsx"),
|
||||
*
|
||||
* // app/team.tsx
|
||||
* export default function Component({
|
||||
* params,
|
||||
* }: Route.ComponentProps) {
|
||||
* params.teamId;
|
||||
* // ^ string
|
||||
* }
|
||||
**/
|
||||
params: T["params"];
|
||||
/** The data returned from the `loader` or `clientLoader` */
|
||||
loaderData: T["loaderData"];
|
||||
/** The data returned from the `action` or `clientAction` following an action submission. */
|
||||
actionData?: T["actionData"];
|
||||
/** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
|
||||
matches: Matches<T["matches"]>;
|
||||
};
|
||||
type CreateErrorBoundaryProps<T extends RouteInfo> = {
|
||||
/**
|
||||
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
||||
* @example
|
||||
* // app/routes.ts
|
||||
* route("teams/:teamId", "./team.tsx"),
|
||||
*
|
||||
* // app/team.tsx
|
||||
* export function ErrorBoundary({
|
||||
* params,
|
||||
* }: Route.ErrorBoundaryProps) {
|
||||
* params.teamId;
|
||||
* // ^ string
|
||||
* }
|
||||
**/
|
||||
params: T["params"];
|
||||
error: unknown;
|
||||
loaderData?: T["loaderData"];
|
||||
actionData?: T["actionData"];
|
||||
};
|
||||
type GetAnnotations<Info extends RouteInfo> = {
|
||||
LinkDescriptors: LinkDescriptor[];
|
||||
LinksFunction: () => LinkDescriptor[];
|
||||
MetaArgs: CreateMetaArgs<Info>;
|
||||
MetaDescriptors: MetaDescriptors;
|
||||
MetaFunction: (args: CreateMetaArgs<Info>) => MetaDescriptors;
|
||||
HeadersArgs: HeadersArgs;
|
||||
HeadersFunction: (args: HeadersArgs) => Headers | HeadersInit;
|
||||
unstable_MiddlewareFunction: CreateServerMiddlewareFunction<Info>;
|
||||
unstable_ClientMiddlewareFunction: CreateClientMiddlewareFunction<Info>;
|
||||
LoaderArgs: CreateServerLoaderArgs<Info>;
|
||||
ClientLoaderArgs: CreateClientLoaderArgs<Info>;
|
||||
ActionArgs: CreateServerActionArgs<Info>;
|
||||
ClientActionArgs: CreateClientActionArgs<Info>;
|
||||
HydrateFallbackProps: CreateHydrateFallbackProps<Info>;
|
||||
ComponentProps: CreateComponentProps<Info>;
|
||||
ErrorBoundaryProps: CreateErrorBoundaryProps<Info>;
|
||||
};
|
||||
|
||||
type Params<RouteFile extends keyof RouteFiles> = Normalize<Pages[RouteFiles[RouteFile]["page"]]["params"]>;
|
||||
|
||||
type GetInfo<T extends {
|
||||
file: keyof RouteFiles;
|
||||
module: RouteModule;
|
||||
}> = {
|
||||
params: Params<T["file"]>;
|
||||
loaderData: GetLoaderData<T["module"]>;
|
||||
actionData: GetActionData<T["module"]>;
|
||||
};
|
||||
|
||||
export type { GetAnnotations, GetInfo };
|
||||
10
node_modules/react-router/dist/development/lib/types/internal.js
generated
vendored
Normal file
10
node_modules/react-router/dist/development/lib/types/internal.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
"use strict";/**
|
||||
* react-router v7.7.1
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
10
node_modules/react-router/dist/development/lib/types/internal.mjs
generated
vendored
Normal file
10
node_modules/react-router/dist/development/lib/types/internal.mjs
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* react-router v7.7.1
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
24
node_modules/react-router/dist/development/register-DiOIlEq5.d.mts
generated
vendored
Normal file
24
node_modules/react-router/dist/development/register-DiOIlEq5.d.mts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
|
||||
* React Router should handle this for you via type generation.
|
||||
*
|
||||
* For more on declaration merging and module augmentation, see https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation .
|
||||
*/
|
||||
interface Register {
|
||||
}
|
||||
type AnyParams = Record<string, string | undefined>;
|
||||
type AnyPages = Record<string, {
|
||||
params: AnyParams;
|
||||
}>;
|
||||
type Pages = Register extends {
|
||||
pages: infer Registered extends AnyPages;
|
||||
} ? Registered : AnyPages;
|
||||
type AnyRouteFiles = Record<string, {
|
||||
id: string;
|
||||
page: string;
|
||||
}>;
|
||||
type RouteFiles = Register extends {
|
||||
routeFiles: infer Registered extends AnyRouteFiles;
|
||||
} ? Registered : AnyRouteFiles;
|
||||
|
||||
export type { Pages as P, RouteFiles as R, Register as a };
|
||||
24
node_modules/react-router/dist/development/register-DiOIlEq5.d.ts
generated
vendored
Normal file
24
node_modules/react-router/dist/development/register-DiOIlEq5.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
|
||||
* React Router should handle this for you via type generation.
|
||||
*
|
||||
* For more on declaration merging and module augmentation, see https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation .
|
||||
*/
|
||||
interface Register {
|
||||
}
|
||||
type AnyParams = Record<string, string | undefined>;
|
||||
type AnyPages = Record<string, {
|
||||
params: AnyParams;
|
||||
}>;
|
||||
type Pages = Register extends {
|
||||
pages: infer Registered extends AnyPages;
|
||||
} ? Registered : AnyPages;
|
||||
type AnyRouteFiles = Record<string, {
|
||||
id: string;
|
||||
page: string;
|
||||
}>;
|
||||
type RouteFiles = Register extends {
|
||||
routeFiles: infer Registered extends AnyRouteFiles;
|
||||
} ? Registered : AnyRouteFiles;
|
||||
|
||||
export type { Pages as P, RouteFiles as R, Register as a };
|
||||
1916
node_modules/react-router/dist/development/route-data-CqEmXQub.d.mts
generated
vendored
Normal file
1916
node_modules/react-router/dist/development/route-data-CqEmXQub.d.mts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1916
node_modules/react-router/dist/development/routeModules-BR2FO0ix.d.ts
generated
vendored
Normal file
1916
node_modules/react-router/dist/development/routeModules-BR2FO0ix.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user