react-router 0.0.0-experimental-b9cf540fe → 0.0.0-experimental-a2c4d7fad
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/{chunk-T4L7PBNQ.mjs → chunk-O7PZGOV2.mjs} +6 -27
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.d.ts +2 -2
- package/dist/development/dom-export.js +4 -9
- package/dist/development/dom-export.mjs +5 -10
- package/dist/{production/fog-of-war-D8U3moAU.d.mts → development/fog-of-war-DhdpvlSf.d.mts} +1 -1
- package/dist/development/{fog-of-war-DjxZtxiP.d.ts → fog-of-war-DstSnxnE.d.ts} +1 -1
- package/dist/development/index.d.mts +4 -8
- package/dist/development/index.d.ts +4 -8
- package/dist/development/index.js +6 -27
- package/dist/development/index.mjs +2 -2
- package/dist/development/lib/types/index.d.mts +73 -0
- package/dist/development/lib/types/index.d.ts +73 -0
- package/dist/development/lib/types/index.js +28 -0
- package/dist/development/lib/types/index.mjs +10 -0
- package/dist/development/lib/types/route-module.d.mts +1 -5
- package/dist/development/lib/types/route-module.d.ts +1 -5
- package/dist/development/lib/types/route-module.js +1 -1
- package/dist/development/lib/types/route-module.mjs +1 -1
- package/dist/development/{route-data-DQbTMaUY.d.ts → route-data-Cceggzl6.d.mts} +1 -1
- package/dist/{production/route-data-DQbTMaUY.d.mts → development/route-data-Cceggzl6.d.ts} +1 -1
- package/dist/production/{chunk-JOASWB7J.mjs → chunk-EAHMQJZV.mjs} +6 -27
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.d.ts +2 -2
- package/dist/production/dom-export.js +4 -9
- package/dist/production/dom-export.mjs +5 -10
- package/dist/{development/fog-of-war-D8U3moAU.d.mts → production/fog-of-war-DhdpvlSf.d.mts} +1 -1
- package/dist/production/{fog-of-war-DjxZtxiP.d.ts → fog-of-war-DstSnxnE.d.ts} +1 -1
- package/dist/production/index.d.mts +4 -8
- package/dist/production/index.d.ts +4 -8
- package/dist/production/index.js +6 -27
- package/dist/production/index.mjs +2 -2
- package/dist/production/lib/types/index.d.mts +73 -0
- package/dist/production/lib/types/index.d.ts +73 -0
- package/dist/production/lib/types/index.js +28 -0
- package/dist/production/lib/types/index.mjs +10 -0
- package/dist/production/lib/types/route-module.d.mts +1 -5
- package/dist/production/lib/types/route-module.d.ts +1 -5
- package/dist/production/lib/types/route-module.js +1 -1
- package/dist/production/lib/types/route-module.mjs +1 -1
- package/dist/production/{route-data-DQbTMaUY.d.ts → route-data-Cceggzl6.d.mts} +1 -1
- package/dist/{development/route-data-DQbTMaUY.d.mts → production/route-data-Cceggzl6.d.ts} +1 -1
- package/package.json +9 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-a2c4d7fad
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -7087,7 +7087,7 @@ function mergeRefs(...refs) {
|
|
|
7087
7087
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
7088
7088
|
try {
|
|
7089
7089
|
if (isBrowser) {
|
|
7090
|
-
window.__reactRouterVersion = "0.0.0-experimental-
|
|
7090
|
+
window.__reactRouterVersion = "0.0.0-experimental-a2c4d7fad";
|
|
7091
7091
|
}
|
|
7092
7092
|
} catch (e) {
|
|
7093
7093
|
}
|
|
@@ -9092,7 +9092,6 @@ var createRequestHandler = (build, mode) => {
|
|
|
9092
9092
|
errorHandler = derived.errorHandler;
|
|
9093
9093
|
}
|
|
9094
9094
|
let url = new URL(request.url);
|
|
9095
|
-
let normalizedPath = url.pathname.replace(/\.data$/, "").replace(/^\/_root$/, "/").replace(/(.)\/$/, "$1");
|
|
9096
9095
|
let params = {};
|
|
9097
9096
|
let handleError = (error) => {
|
|
9098
9097
|
if (mode === "development" /* Development */) {
|
|
@@ -9104,25 +9103,6 @@ var createRequestHandler = (build, mode) => {
|
|
|
9104
9103
|
request
|
|
9105
9104
|
});
|
|
9106
9105
|
};
|
|
9107
|
-
if (!_build.ssr && _build.prerender.length > 0 && // Look with/without the trailing slash to be sure
|
|
9108
|
-
!_build.prerender.includes(normalizedPath) && !_build.prerender.includes(normalizedPath + "/")) {
|
|
9109
|
-
errorHandler(
|
|
9110
|
-
new ErrorResponseImpl(
|
|
9111
|
-
404,
|
|
9112
|
-
"Not Found",
|
|
9113
|
-
`Refusing to SSR the path \`${normalizedPath}\` because \`ssr:false\` is set and the path is not included in the \`prerender\` config, so in production the path will be a 404.`
|
|
9114
|
-
),
|
|
9115
|
-
{
|
|
9116
|
-
context: loadContext,
|
|
9117
|
-
params,
|
|
9118
|
-
request
|
|
9119
|
-
}
|
|
9120
|
-
);
|
|
9121
|
-
return new Response("Not Found", {
|
|
9122
|
-
status: 404,
|
|
9123
|
-
statusText: "Not Found"
|
|
9124
|
-
});
|
|
9125
|
-
}
|
|
9126
9106
|
let manifestUrl = `${_build.basename ?? "/"}/__manifest`.replace(
|
|
9127
9107
|
/\/+/g,
|
|
9128
9108
|
"/"
|
|
@@ -9143,7 +9123,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
9143
9123
|
let response;
|
|
9144
9124
|
if (url.pathname.endsWith(".data")) {
|
|
9145
9125
|
let handlerUrl = new URL(request.url);
|
|
9146
|
-
handlerUrl.pathname =
|
|
9126
|
+
handlerUrl.pathname = handlerUrl.pathname.replace(/\.data$/, "").replace(/^\/_root$/, "/");
|
|
9147
9127
|
let singleFetchMatches = matchServerRoutes(
|
|
9148
9128
|
routes,
|
|
9149
9129
|
handlerUrl.pathname,
|
|
@@ -9283,7 +9263,6 @@ async function handleSingleFetchRequest(serverMode, build, staticHandler, reques
|
|
|
9283
9263
|
);
|
|
9284
9264
|
}
|
|
9285
9265
|
async function handleDocumentRequest(serverMode, build, staticHandler, request, loadContext, handleError, criticalCss) {
|
|
9286
|
-
let isSpaMode = request.headers.has("X-React-Router-SPA-Mode");
|
|
9287
9266
|
let context;
|
|
9288
9267
|
try {
|
|
9289
9268
|
context = await staticHandler.query(request, {
|
|
@@ -9323,7 +9302,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
9323
9302
|
criticalCss,
|
|
9324
9303
|
future: build.future,
|
|
9325
9304
|
ssr: build.ssr,
|
|
9326
|
-
isSpaMode
|
|
9305
|
+
isSpaMode: build.isSpaMode
|
|
9327
9306
|
}),
|
|
9328
9307
|
serverHandoffStream: encodeViaTurboStream(
|
|
9329
9308
|
state,
|
|
@@ -9334,7 +9313,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
9334
9313
|
renderMeta: {},
|
|
9335
9314
|
future: build.future,
|
|
9336
9315
|
ssr: build.ssr,
|
|
9337
|
-
isSpaMode,
|
|
9316
|
+
isSpaMode: build.isSpaMode,
|
|
9338
9317
|
serializeError: (err) => serializeError(err, serverMode)
|
|
9339
9318
|
};
|
|
9340
9319
|
let handleDocumentRequestFunction = build.entry.module.default;
|
|
@@ -9380,7 +9359,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
9380
9359
|
basename: build.basename,
|
|
9381
9360
|
future: build.future,
|
|
9382
9361
|
ssr: build.ssr,
|
|
9383
|
-
isSpaMode
|
|
9362
|
+
isSpaMode: build.isSpaMode
|
|
9384
9363
|
}),
|
|
9385
9364
|
serverHandoffStream: encodeViaTurboStream(
|
|
9386
9365
|
state2,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterProviderProps$1 } from './fog-of-war-
|
|
3
|
-
import './route-data-
|
|
2
|
+
import { R as RouterProviderProps$1 } from './fog-of-war-DhdpvlSf.mjs';
|
|
3
|
+
import './route-data-Cceggzl6.mjs';
|
|
4
4
|
|
|
5
5
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
6
6
|
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterProviderProps$1 } from './fog-of-war-
|
|
3
|
-
import './route-data-
|
|
2
|
+
import { R as RouterProviderProps$1 } from './fog-of-war-DstSnxnE.js';
|
|
3
|
+
import './route-data-Cceggzl6.js';
|
|
4
4
|
|
|
5
5
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
6
6
|
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-a2c4d7fad
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -5520,13 +5520,10 @@ function createHydratedRouter() {
|
|
|
5520
5520
|
ssrInfo.context.isSpaMode
|
|
5521
5521
|
);
|
|
5522
5522
|
let hydrationData = void 0;
|
|
5523
|
-
|
|
5524
|
-
if (ssrInfo.context.isSpaMode) {
|
|
5525
|
-
hydrationData = { loaderData };
|
|
5526
|
-
} else {
|
|
5523
|
+
if (!ssrInfo.context.isSpaMode) {
|
|
5527
5524
|
hydrationData = {
|
|
5528
5525
|
...ssrInfo.context.state,
|
|
5529
|
-
loaderData: { ...loaderData }
|
|
5526
|
+
loaderData: { ...ssrInfo.context.state.loaderData }
|
|
5530
5527
|
};
|
|
5531
5528
|
let initialMatches = matchRoutes(
|
|
5532
5529
|
routes,
|
|
@@ -5559,9 +5556,7 @@ function createHydratedRouter() {
|
|
|
5559
5556
|
basename: ssrInfo.context.basename,
|
|
5560
5557
|
hydrationData,
|
|
5561
5558
|
mapRouteProperties,
|
|
5562
|
-
|
|
5563
|
-
// to fetch `.data` requests from and no prerendered `.data` files to serve
|
|
5564
|
-
dataStrategy: ssrInfo.context.isSpaMode ? void 0 : getSingleFetchDataStrategy(
|
|
5559
|
+
dataStrategy: getSingleFetchDataStrategy(
|
|
5565
5560
|
ssrInfo.manifest,
|
|
5566
5561
|
ssrInfo.routeModules,
|
|
5567
5562
|
() => router2
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-a2c4d7fad
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
matchRoutes,
|
|
26
26
|
shouldHydrateRouteLoader,
|
|
27
27
|
useFogOFWarDiscovery
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-O7PZGOV2.mjs";
|
|
29
29
|
|
|
30
30
|
// lib/dom-export/dom-router-provider.tsx
|
|
31
31
|
import * as React from "react";
|
|
@@ -82,13 +82,10 @@ function createHydratedRouter() {
|
|
|
82
82
|
ssrInfo.context.isSpaMode
|
|
83
83
|
);
|
|
84
84
|
let hydrationData = void 0;
|
|
85
|
-
|
|
86
|
-
if (ssrInfo.context.isSpaMode) {
|
|
87
|
-
hydrationData = { loaderData };
|
|
88
|
-
} else {
|
|
85
|
+
if (!ssrInfo.context.isSpaMode) {
|
|
89
86
|
hydrationData = {
|
|
90
87
|
...ssrInfo.context.state,
|
|
91
|
-
loaderData: { ...loaderData }
|
|
88
|
+
loaderData: { ...ssrInfo.context.state.loaderData }
|
|
92
89
|
};
|
|
93
90
|
let initialMatches = matchRoutes(
|
|
94
91
|
routes,
|
|
@@ -121,9 +118,7 @@ function createHydratedRouter() {
|
|
|
121
118
|
basename: ssrInfo.context.basename,
|
|
122
119
|
hydrationData,
|
|
123
120
|
mapRouteProperties,
|
|
124
|
-
|
|
125
|
-
// to fetch `.data` requests from and no prerendered `.data` files to serve
|
|
126
|
-
dataStrategy: ssrInfo.context.isSpaMode ? void 0 : getSingleFetchDataStrategy(
|
|
121
|
+
dataStrategy: getSingleFetchDataStrategy(
|
|
127
122
|
ssrInfo.manifest,
|
|
128
123
|
ssrInfo.routeModules,
|
|
129
124
|
() => router2
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, al as PatchRoutesOnNavigationFunction, a as Router$1, T as To, c as RelativeRoutingType, u as NonIndexRouteObject, $ as LazyRouteFunction, q as IndexRouteObject, d as Location, e as Action, ak as Navigator, an as RouteMatch, o as StaticHandlerContext, b as RouteManifest, R as RouteModules, aj as DataRouteObject, aK as RouteModule, _ as HTMLFormMethod, Y as FormEncType, aw as PageLinkDescriptor, aL as History, w as GetScrollRestorationKeyFunction, N as NavigateOptions, x as Fetcher, m as SerializeFrom, B as BlockerFunction } from './route-data-
|
|
2
|
+
import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, al as PatchRoutesOnNavigationFunction, a as Router$1, T as To, c as RelativeRoutingType, u as NonIndexRouteObject, $ as LazyRouteFunction, q as IndexRouteObject, d as Location, e as Action, ak as Navigator, an as RouteMatch, o as StaticHandlerContext, b as RouteManifest, R as RouteModules, aj as DataRouteObject, aK as RouteModule, _ as HTMLFormMethod, Y as FormEncType, aw as PageLinkDescriptor, aL as History, w as GetScrollRestorationKeyFunction, N as NavigateOptions, x as Fetcher, m as SerializeFrom, B as BlockerFunction } from './route-data-Cceggzl6.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @private
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, al as PatchRoutesOnNavigationFunction, a as Router$1, T as To, c as RelativeRoutingType, u as NonIndexRouteObject, $ as LazyRouteFunction, q as IndexRouteObject, d as Location, e as Action, ak as Navigator, an as RouteMatch, o as StaticHandlerContext, b as RouteManifest, R as RouteModules, aj as DataRouteObject, aK as RouteModule, _ as HTMLFormMethod, Y as FormEncType, aw as PageLinkDescriptor, aL as History, w as GetScrollRestorationKeyFunction, N as NavigateOptions, x as Fetcher, m as SerializeFrom, B as BlockerFunction } from './route-data-
|
|
2
|
+
import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, al as PatchRoutesOnNavigationFunction, a as Router$1, T as To, c as RelativeRoutingType, u as NonIndexRouteObject, $ as LazyRouteFunction, q as IndexRouteObject, d as Location, e as Action, ak as Navigator, an as RouteMatch, o as StaticHandlerContext, b as RouteManifest, R as RouteModules, aj as DataRouteObject, aK as RouteModule, _ as HTMLFormMethod, Y as FormEncType, aw as PageLinkDescriptor, aL as History, w as GetScrollRestorationKeyFunction, N as NavigateOptions, x as Fetcher, m as SerializeFrom, B as BlockerFunction } from './route-data-Cceggzl6.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @private
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as RouteModules, a as Router, D as DataStrategyFunction, b as RouteManifest, S as ServerRouteModule, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, c as RelativeRoutingType, d as Location, e as Action, P as ParamParseKey, f as Path, g as PathPattern, h as PathMatch, N as NavigateOptions, i as Params, j as RouteObject, k as Navigation, l as RevalidationState, U as UIMatch, m as SerializeFrom, B as BlockerFunction, n as Blocker, o as StaticHandlerContext, p as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, q as IndexRouteObject, r as LoaderFunction, s as ActionFunction, M as MetaFunction, t as LinksFunction, u as NonIndexRouteObject, v as RouterState } from './route-data-
|
|
2
|
-
export { ao as ClientActionFunction, ap as ClientActionFunctionArgs, aq as ClientLoaderFunction, ar as ClientLoaderFunctionArgs, ai as DataRouteMatch, aj as DataRouteObject, O as DataStrategyFunctionArgs, Q as DataStrategyMatch, V as DataStrategyResult, X as ErrorResponse, x as Fetcher, Y as FormEncType, Z as FormMethod, G as GetScrollPositionFunction, w as GetScrollRestorationKeyFunction, _ as HTMLFormMethod, as as HeadersArgs, at as HeadersFunction, ax as HtmlLinkDescriptor, a8 as IDLE_BLOCKER, a7 as IDLE_FETCHER, a6 as IDLE_NAVIGATION, $ as LazyRouteFunction, ay as LinkDescriptor, au as MetaArgs, av as MetaDescriptor, y as NavigationStates, ak as Navigator, aw as PageLinkDescriptor, al as PatchRoutesOnNavigationFunction, am as PatchRoutesOnNavigationFunctionArgs, a0 as PathParam, a1 as RedirectFunction, an as RouteMatch, K as RouterFetchOptions, z as RouterInit, J as RouterNavigateOptions, E as RouterSubscriber, a2 as ShouldRevalidateFunction, a3 as ShouldRevalidateFunctionArgs, aD as UNSAFE_DataRouterContext, aE as UNSAFE_DataRouterStateContext, W as UNSAFE_DataWithResponseInit, aC as UNSAFE_ErrorResponseImpl, aF as UNSAFE_FetchersContext, aG as UNSAFE_LocationContext, aH as UNSAFE_NavigationContext, aI as UNSAFE_RouteContext, aJ as UNSAFE_ViewTransitionContext, az as UNSAFE_createBrowserHistory, aB as UNSAFE_createRouter, aA as UNSAFE_invariant, a4 as createPath, a9 as data, aa as generatePath, ab as isRouteErrorResponse, ac as matchPath, ad as matchRoutes, a5 as parsePath, ae as redirect, af as redirectDocument, ag as replace, ah as resolvePath } from './route-data-
|
|
3
|
-
import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-
|
|
4
|
-
export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-
|
|
1
|
+
import { R as RouteModules, a as Router, D as DataStrategyFunction, b as RouteManifest, S as ServerRouteModule, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, c as RelativeRoutingType, d as Location, e as Action, P as ParamParseKey, f as Path, g as PathPattern, h as PathMatch, N as NavigateOptions, i as Params, j as RouteObject, k as Navigation, l as RevalidationState, U as UIMatch, m as SerializeFrom, B as BlockerFunction, n as Blocker, o as StaticHandlerContext, p as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, q as IndexRouteObject, r as LoaderFunction, s as ActionFunction, M as MetaFunction, t as LinksFunction, u as NonIndexRouteObject, v as RouterState } from './route-data-Cceggzl6.mjs';
|
|
2
|
+
export { ao as ClientActionFunction, ap as ClientActionFunctionArgs, aq as ClientLoaderFunction, ar as ClientLoaderFunctionArgs, ai as DataRouteMatch, aj as DataRouteObject, O as DataStrategyFunctionArgs, Q as DataStrategyMatch, V as DataStrategyResult, X as ErrorResponse, x as Fetcher, Y as FormEncType, Z as FormMethod, G as GetScrollPositionFunction, w as GetScrollRestorationKeyFunction, _ as HTMLFormMethod, as as HeadersArgs, at as HeadersFunction, ax as HtmlLinkDescriptor, a8 as IDLE_BLOCKER, a7 as IDLE_FETCHER, a6 as IDLE_NAVIGATION, $ as LazyRouteFunction, ay as LinkDescriptor, au as MetaArgs, av as MetaDescriptor, y as NavigationStates, ak as Navigator, aw as PageLinkDescriptor, al as PatchRoutesOnNavigationFunction, am as PatchRoutesOnNavigationFunctionArgs, a0 as PathParam, a1 as RedirectFunction, an as RouteMatch, K as RouterFetchOptions, z as RouterInit, J as RouterNavigateOptions, E as RouterSubscriber, a2 as ShouldRevalidateFunction, a3 as ShouldRevalidateFunctionArgs, aD as UNSAFE_DataRouterContext, aE as UNSAFE_DataRouterStateContext, W as UNSAFE_DataWithResponseInit, aC as UNSAFE_ErrorResponseImpl, aF as UNSAFE_FetchersContext, aG as UNSAFE_LocationContext, aH as UNSAFE_NavigationContext, aI as UNSAFE_RouteContext, aJ as UNSAFE_ViewTransitionContext, az as UNSAFE_createBrowserHistory, aB as UNSAFE_createRouter, aA as UNSAFE_invariant, a4 as createPath, a9 as data, aa as generatePath, ab as isRouteErrorResponse, ac as matchPath, ad as matchRoutes, a5 as parsePath, ae as redirect, af as redirectDocument, ag as replace, ah as resolvePath } from './route-data-Cceggzl6.mjs';
|
|
3
|
+
import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-DhdpvlSf.mjs';
|
|
4
|
+
export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-DhdpvlSf.mjs';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { ReactElement } from 'react';
|
|
7
7
|
import { ParseOptions, SerializeOptions } from 'cookie';
|
|
@@ -44,11 +44,7 @@ interface ServerBuild {
|
|
|
44
44
|
assetsBuildDirectory: string;
|
|
45
45
|
future: FutureConfig;
|
|
46
46
|
ssr: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* @deprecated This is now done via a custom header during prerendering
|
|
49
|
-
*/
|
|
50
47
|
isSpaMode: boolean;
|
|
51
|
-
prerender: string[];
|
|
52
48
|
}
|
|
53
49
|
interface HandleDocumentRequestFunction {
|
|
54
50
|
(request: Request, responseStatusCode: number, responseHeaders: Headers, context: EntryContext, loadContext: AppLoadContext$1): Promise<Response> | Response;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as RouteModules, a as Router, D as DataStrategyFunction, b as RouteManifest, S as ServerRouteModule, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, c as RelativeRoutingType, d as Location, e as Action, P as ParamParseKey, f as Path, g as PathPattern, h as PathMatch, N as NavigateOptions, i as Params, j as RouteObject, k as Navigation, l as RevalidationState, U as UIMatch, m as SerializeFrom, B as BlockerFunction, n as Blocker, o as StaticHandlerContext, p as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, q as IndexRouteObject, r as LoaderFunction, s as ActionFunction, M as MetaFunction, t as LinksFunction, u as NonIndexRouteObject, v as RouterState } from './route-data-
|
|
2
|
-
export { ao as ClientActionFunction, ap as ClientActionFunctionArgs, aq as ClientLoaderFunction, ar as ClientLoaderFunctionArgs, ai as DataRouteMatch, aj as DataRouteObject, O as DataStrategyFunctionArgs, Q as DataStrategyMatch, V as DataStrategyResult, X as ErrorResponse, x as Fetcher, Y as FormEncType, Z as FormMethod, G as GetScrollPositionFunction, w as GetScrollRestorationKeyFunction, _ as HTMLFormMethod, as as HeadersArgs, at as HeadersFunction, ax as HtmlLinkDescriptor, a8 as IDLE_BLOCKER, a7 as IDLE_FETCHER, a6 as IDLE_NAVIGATION, $ as LazyRouteFunction, ay as LinkDescriptor, au as MetaArgs, av as MetaDescriptor, y as NavigationStates, ak as Navigator, aw as PageLinkDescriptor, al as PatchRoutesOnNavigationFunction, am as PatchRoutesOnNavigationFunctionArgs, a0 as PathParam, a1 as RedirectFunction, an as RouteMatch, K as RouterFetchOptions, z as RouterInit, J as RouterNavigateOptions, E as RouterSubscriber, a2 as ShouldRevalidateFunction, a3 as ShouldRevalidateFunctionArgs, aD as UNSAFE_DataRouterContext, aE as UNSAFE_DataRouterStateContext, W as UNSAFE_DataWithResponseInit, aC as UNSAFE_ErrorResponseImpl, aF as UNSAFE_FetchersContext, aG as UNSAFE_LocationContext, aH as UNSAFE_NavigationContext, aI as UNSAFE_RouteContext, aJ as UNSAFE_ViewTransitionContext, az as UNSAFE_createBrowserHistory, aB as UNSAFE_createRouter, aA as UNSAFE_invariant, a4 as createPath, a9 as data, aa as generatePath, ab as isRouteErrorResponse, ac as matchPath, ad as matchRoutes, a5 as parsePath, ae as redirect, af as redirectDocument, ag as replace, ah as resolvePath } from './route-data-
|
|
3
|
-
import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-
|
|
4
|
-
export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-
|
|
1
|
+
import { R as RouteModules, a as Router, D as DataStrategyFunction, b as RouteManifest, S as ServerRouteModule, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, c as RelativeRoutingType, d as Location, e as Action, P as ParamParseKey, f as Path, g as PathPattern, h as PathMatch, N as NavigateOptions, i as Params, j as RouteObject, k as Navigation, l as RevalidationState, U as UIMatch, m as SerializeFrom, B as BlockerFunction, n as Blocker, o as StaticHandlerContext, p as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, q as IndexRouteObject, r as LoaderFunction, s as ActionFunction, M as MetaFunction, t as LinksFunction, u as NonIndexRouteObject, v as RouterState } from './route-data-Cceggzl6.js';
|
|
2
|
+
export { ao as ClientActionFunction, ap as ClientActionFunctionArgs, aq as ClientLoaderFunction, ar as ClientLoaderFunctionArgs, ai as DataRouteMatch, aj as DataRouteObject, O as DataStrategyFunctionArgs, Q as DataStrategyMatch, V as DataStrategyResult, X as ErrorResponse, x as Fetcher, Y as FormEncType, Z as FormMethod, G as GetScrollPositionFunction, w as GetScrollRestorationKeyFunction, _ as HTMLFormMethod, as as HeadersArgs, at as HeadersFunction, ax as HtmlLinkDescriptor, a8 as IDLE_BLOCKER, a7 as IDLE_FETCHER, a6 as IDLE_NAVIGATION, $ as LazyRouteFunction, ay as LinkDescriptor, au as MetaArgs, av as MetaDescriptor, y as NavigationStates, ak as Navigator, aw as PageLinkDescriptor, al as PatchRoutesOnNavigationFunction, am as PatchRoutesOnNavigationFunctionArgs, a0 as PathParam, a1 as RedirectFunction, an as RouteMatch, K as RouterFetchOptions, z as RouterInit, J as RouterNavigateOptions, E as RouterSubscriber, a2 as ShouldRevalidateFunction, a3 as ShouldRevalidateFunctionArgs, aD as UNSAFE_DataRouterContext, aE as UNSAFE_DataRouterStateContext, W as UNSAFE_DataWithResponseInit, aC as UNSAFE_ErrorResponseImpl, aF as UNSAFE_FetchersContext, aG as UNSAFE_LocationContext, aH as UNSAFE_NavigationContext, aI as UNSAFE_RouteContext, aJ as UNSAFE_ViewTransitionContext, az as UNSAFE_createBrowserHistory, aB as UNSAFE_createRouter, aA as UNSAFE_invariant, a4 as createPath, a9 as data, aa as generatePath, ab as isRouteErrorResponse, ac as matchPath, ad as matchRoutes, a5 as parsePath, ae as redirect, af as redirectDocument, ag as replace, ah as resolvePath } from './route-data-Cceggzl6.js';
|
|
3
|
+
import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-DstSnxnE.js';
|
|
4
|
+
export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-DstSnxnE.js';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { ReactElement } from 'react';
|
|
7
7
|
import { ParseOptions, SerializeOptions } from 'cookie';
|
|
@@ -44,11 +44,7 @@ interface ServerBuild {
|
|
|
44
44
|
assetsBuildDirectory: string;
|
|
45
45
|
future: FutureConfig;
|
|
46
46
|
ssr: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* @deprecated This is now done via a custom header during prerendering
|
|
49
|
-
*/
|
|
50
47
|
isSpaMode: boolean;
|
|
51
|
-
prerender: string[];
|
|
52
48
|
}
|
|
53
49
|
interface HandleDocumentRequestFunction {
|
|
54
50
|
(request: Request, responseStatusCode: number, responseHeaders: Headers, context: EntryContext, loadContext: AppLoadContext$1): Promise<Response> | Response;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-a2c4d7fad
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -7232,7 +7232,7 @@ function mergeRefs(...refs) {
|
|
|
7232
7232
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
7233
7233
|
try {
|
|
7234
7234
|
if (isBrowser) {
|
|
7235
|
-
window.__reactRouterVersion = "0.0.0-experimental-
|
|
7235
|
+
window.__reactRouterVersion = "0.0.0-experimental-a2c4d7fad";
|
|
7236
7236
|
}
|
|
7237
7237
|
} catch (e) {
|
|
7238
7238
|
}
|
|
@@ -9237,7 +9237,6 @@ var createRequestHandler = (build, mode) => {
|
|
|
9237
9237
|
errorHandler = derived.errorHandler;
|
|
9238
9238
|
}
|
|
9239
9239
|
let url = new URL(request.url);
|
|
9240
|
-
let normalizedPath = url.pathname.replace(/\.data$/, "").replace(/^\/_root$/, "/").replace(/(.)\/$/, "$1");
|
|
9241
9240
|
let params = {};
|
|
9242
9241
|
let handleError = (error) => {
|
|
9243
9242
|
if (mode === "development" /* Development */) {
|
|
@@ -9249,25 +9248,6 @@ var createRequestHandler = (build, mode) => {
|
|
|
9249
9248
|
request
|
|
9250
9249
|
});
|
|
9251
9250
|
};
|
|
9252
|
-
if (!_build.ssr && _build.prerender.length > 0 && // Look with/without the trailing slash to be sure
|
|
9253
|
-
!_build.prerender.includes(normalizedPath) && !_build.prerender.includes(normalizedPath + "/")) {
|
|
9254
|
-
errorHandler(
|
|
9255
|
-
new ErrorResponseImpl(
|
|
9256
|
-
404,
|
|
9257
|
-
"Not Found",
|
|
9258
|
-
`Refusing to SSR the path \`${normalizedPath}\` because \`ssr:false\` is set and the path is not included in the \`prerender\` config, so in production the path will be a 404.`
|
|
9259
|
-
),
|
|
9260
|
-
{
|
|
9261
|
-
context: loadContext,
|
|
9262
|
-
params,
|
|
9263
|
-
request
|
|
9264
|
-
}
|
|
9265
|
-
);
|
|
9266
|
-
return new Response("Not Found", {
|
|
9267
|
-
status: 404,
|
|
9268
|
-
statusText: "Not Found"
|
|
9269
|
-
});
|
|
9270
|
-
}
|
|
9271
9251
|
let manifestUrl = `${_build.basename ?? "/"}/__manifest`.replace(
|
|
9272
9252
|
/\/+/g,
|
|
9273
9253
|
"/"
|
|
@@ -9288,7 +9268,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
9288
9268
|
let response;
|
|
9289
9269
|
if (url.pathname.endsWith(".data")) {
|
|
9290
9270
|
let handlerUrl = new URL(request.url);
|
|
9291
|
-
handlerUrl.pathname =
|
|
9271
|
+
handlerUrl.pathname = handlerUrl.pathname.replace(/\.data$/, "").replace(/^\/_root$/, "/");
|
|
9292
9272
|
let singleFetchMatches = matchServerRoutes(
|
|
9293
9273
|
routes,
|
|
9294
9274
|
handlerUrl.pathname,
|
|
@@ -9428,7 +9408,6 @@ async function handleSingleFetchRequest(serverMode, build, staticHandler, reques
|
|
|
9428
9408
|
);
|
|
9429
9409
|
}
|
|
9430
9410
|
async function handleDocumentRequest(serverMode, build, staticHandler, request, loadContext, handleError, criticalCss) {
|
|
9431
|
-
let isSpaMode = request.headers.has("X-React-Router-SPA-Mode");
|
|
9432
9411
|
let context;
|
|
9433
9412
|
try {
|
|
9434
9413
|
context = await staticHandler.query(request, {
|
|
@@ -9468,7 +9447,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
9468
9447
|
criticalCss,
|
|
9469
9448
|
future: build.future,
|
|
9470
9449
|
ssr: build.ssr,
|
|
9471
|
-
isSpaMode
|
|
9450
|
+
isSpaMode: build.isSpaMode
|
|
9472
9451
|
}),
|
|
9473
9452
|
serverHandoffStream: encodeViaTurboStream(
|
|
9474
9453
|
state,
|
|
@@ -9479,7 +9458,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
9479
9458
|
renderMeta: {},
|
|
9480
9459
|
future: build.future,
|
|
9481
9460
|
ssr: build.ssr,
|
|
9482
|
-
isSpaMode,
|
|
9461
|
+
isSpaMode: build.isSpaMode,
|
|
9483
9462
|
serializeError: (err) => serializeError(err, serverMode)
|
|
9484
9463
|
};
|
|
9485
9464
|
let handleDocumentRequestFunction = build.entry.module.default;
|
|
@@ -9525,7 +9504,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
9525
9504
|
basename: build.basename,
|
|
9526
9505
|
future: build.future,
|
|
9527
9506
|
ssr: build.ssr,
|
|
9528
|
-
isSpaMode
|
|
9507
|
+
isSpaMode: build.isSpaMode
|
|
9529
9508
|
}),
|
|
9530
9509
|
serverHandoffStream: encodeViaTurboStream(
|
|
9531
9510
|
state2,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-a2c4d7fad
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -120,7 +120,7 @@ import {
|
|
|
120
120
|
useSearchParams,
|
|
121
121
|
useSubmit,
|
|
122
122
|
useViewTransitionState
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-O7PZGOV2.mjs";
|
|
124
124
|
export {
|
|
125
125
|
Await,
|
|
126
126
|
BrowserRouter,
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { CreateLoaderData, CreateActionData } from './route-module.mjs';
|
|
2
|
+
import { aM as Pretty } from '../../route-data-Cceggzl6.mjs';
|
|
3
|
+
import '../../data-CQbyyGzl.mjs';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
interface Register {
|
|
7
|
+
}
|
|
8
|
+
type AnyRoutes = Record<string, {
|
|
9
|
+
parentId: string | undefined;
|
|
10
|
+
path: string | undefined;
|
|
11
|
+
module: Record<string, unknown>;
|
|
12
|
+
}>;
|
|
13
|
+
type UserRoutes = Register extends {
|
|
14
|
+
routes: infer TRoutes extends AnyRoutes;
|
|
15
|
+
} ? TRoutes : AnyRoutes;
|
|
16
|
+
type RouteId = keyof UserRoutes;
|
|
17
|
+
type Data = {
|
|
18
|
+
[Id in RouteId]: {
|
|
19
|
+
loaderData: CreateLoaderData<UserRoutes[Id]["module"]>;
|
|
20
|
+
actionData: CreateActionData<UserRoutes[Id]["module"]>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
type Branches = {
|
|
24
|
+
[Id in RouteId]: GetBranch<Id>;
|
|
25
|
+
};
|
|
26
|
+
type Params = {
|
|
27
|
+
[Id in RouteId]: Pretty<BranchParams<Branches[Id]>>;
|
|
28
|
+
};
|
|
29
|
+
type Routes = {
|
|
30
|
+
[Id in RouteId]: {
|
|
31
|
+
params: Params[Id];
|
|
32
|
+
module: UserRoutes[Id]["module"];
|
|
33
|
+
loaderData: Data[Id]["loaderData"];
|
|
34
|
+
actionData: Data[Id]["actionData"];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
type PartialParams = {
|
|
38
|
+
[Id in RouteId]: UserRoutes[Id]["path"] extends string ? ParseParams<UserRoutes[Id]["path"]> : {};
|
|
39
|
+
};
|
|
40
|
+
type BranchParams<Branch extends Array<RouteId>> = Branch extends [
|
|
41
|
+
infer Id extends RouteId,
|
|
42
|
+
...infer Ids extends Array<RouteId>
|
|
43
|
+
] ? PartialParams[Id] & BranchParams<Ids> : {};
|
|
44
|
+
type Regex_az = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z";
|
|
45
|
+
type Regez_AZ = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z";
|
|
46
|
+
type Regex_09 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
|
|
47
|
+
type Regex_w = Regex_az | Regez_AZ | Regex_09 | "_";
|
|
48
|
+
type ParamChar = Regex_w | "-";
|
|
49
|
+
type RegexMatchPlus<CharPattern extends string, T extends string> = T extends `${infer First}${infer Rest}` ? First extends CharPattern ? RegexMatchPlus<CharPattern, Rest> extends never ? First : `${First}${RegexMatchPlus<CharPattern, Rest>}` : never : never;
|
|
50
|
+
type _ParseParams<Path extends string> = Path extends `${infer L}/${infer R}` ? _ParseParams<L> & _ParseParams<R> : Path extends `:${infer Param}` ? Param extends `${infer Optional}?${string}` ? RegexMatchPlus<ParamChar, Optional> extends infer Id extends string ? {
|
|
51
|
+
[K in Id]?: string;
|
|
52
|
+
} : {} : RegexMatchPlus<ParamChar, Param> extends infer Id extends string ? {
|
|
53
|
+
[K in Id]: string;
|
|
54
|
+
} : {} : {};
|
|
55
|
+
type ParseParams<Path extends string> = Path extends "*" | "/*" ? "*" : Path extends `${infer Rest}/*` ? Pretty<_ParseParams<Rest> & {
|
|
56
|
+
"*": string;
|
|
57
|
+
}> : Pretty<_ParseParams<Path>>;
|
|
58
|
+
type GetParents<Id extends RouteId> = UserRoutes[Id] extends {
|
|
59
|
+
parentId: infer P extends RouteId;
|
|
60
|
+
} ? [...GetParents<P>, P] : [];
|
|
61
|
+
type _GetChildren<Id extends RouteId> = {
|
|
62
|
+
[K in RouteId]: UserRoutes[K] extends {
|
|
63
|
+
parentId: Id;
|
|
64
|
+
} ? [K, ..._GetChildren<K>] : [];
|
|
65
|
+
}[RouteId];
|
|
66
|
+
type GetChildren<Id extends RouteId> = _GetChildren<Id> extends [] ? [] : Exclude<_GetChildren<Id>, []>;
|
|
67
|
+
type GetBranch<Id extends RouteId> = [
|
|
68
|
+
...GetParents<Id>,
|
|
69
|
+
Id,
|
|
70
|
+
...GetChildren<Id>
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
export type { Register, Routes };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { CreateLoaderData, CreateActionData } from './route-module.js';
|
|
2
|
+
import { aM as Pretty } from '../../route-data-Cceggzl6.js';
|
|
3
|
+
import '../../data-CQbyyGzl.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
interface Register {
|
|
7
|
+
}
|
|
8
|
+
type AnyRoutes = Record<string, {
|
|
9
|
+
parentId: string | undefined;
|
|
10
|
+
path: string | undefined;
|
|
11
|
+
module: Record<string, unknown>;
|
|
12
|
+
}>;
|
|
13
|
+
type UserRoutes = Register extends {
|
|
14
|
+
routes: infer TRoutes extends AnyRoutes;
|
|
15
|
+
} ? TRoutes : AnyRoutes;
|
|
16
|
+
type RouteId = keyof UserRoutes;
|
|
17
|
+
type Data = {
|
|
18
|
+
[Id in RouteId]: {
|
|
19
|
+
loaderData: CreateLoaderData<UserRoutes[Id]["module"]>;
|
|
20
|
+
actionData: CreateActionData<UserRoutes[Id]["module"]>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
type Branches = {
|
|
24
|
+
[Id in RouteId]: GetBranch<Id>;
|
|
25
|
+
};
|
|
26
|
+
type Params = {
|
|
27
|
+
[Id in RouteId]: Pretty<BranchParams<Branches[Id]>>;
|
|
28
|
+
};
|
|
29
|
+
type Routes = {
|
|
30
|
+
[Id in RouteId]: {
|
|
31
|
+
params: Params[Id];
|
|
32
|
+
module: UserRoutes[Id]["module"];
|
|
33
|
+
loaderData: Data[Id]["loaderData"];
|
|
34
|
+
actionData: Data[Id]["actionData"];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
type PartialParams = {
|
|
38
|
+
[Id in RouteId]: UserRoutes[Id]["path"] extends string ? ParseParams<UserRoutes[Id]["path"]> : {};
|
|
39
|
+
};
|
|
40
|
+
type BranchParams<Branch extends Array<RouteId>> = Branch extends [
|
|
41
|
+
infer Id extends RouteId,
|
|
42
|
+
...infer Ids extends Array<RouteId>
|
|
43
|
+
] ? PartialParams[Id] & BranchParams<Ids> : {};
|
|
44
|
+
type Regex_az = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z";
|
|
45
|
+
type Regez_AZ = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z";
|
|
46
|
+
type Regex_09 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
|
|
47
|
+
type Regex_w = Regex_az | Regez_AZ | Regex_09 | "_";
|
|
48
|
+
type ParamChar = Regex_w | "-";
|
|
49
|
+
type RegexMatchPlus<CharPattern extends string, T extends string> = T extends `${infer First}${infer Rest}` ? First extends CharPattern ? RegexMatchPlus<CharPattern, Rest> extends never ? First : `${First}${RegexMatchPlus<CharPattern, Rest>}` : never : never;
|
|
50
|
+
type _ParseParams<Path extends string> = Path extends `${infer L}/${infer R}` ? _ParseParams<L> & _ParseParams<R> : Path extends `:${infer Param}` ? Param extends `${infer Optional}?${string}` ? RegexMatchPlus<ParamChar, Optional> extends infer Id extends string ? {
|
|
51
|
+
[K in Id]?: string;
|
|
52
|
+
} : {} : RegexMatchPlus<ParamChar, Param> extends infer Id extends string ? {
|
|
53
|
+
[K in Id]: string;
|
|
54
|
+
} : {} : {};
|
|
55
|
+
type ParseParams<Path extends string> = Path extends "*" | "/*" ? "*" : Path extends `${infer Rest}/*` ? Pretty<_ParseParams<Rest> & {
|
|
56
|
+
"*": string;
|
|
57
|
+
}> : Pretty<_ParseParams<Path>>;
|
|
58
|
+
type GetParents<Id extends RouteId> = UserRoutes[Id] extends {
|
|
59
|
+
parentId: infer P extends RouteId;
|
|
60
|
+
} ? [...GetParents<P>, P] : [];
|
|
61
|
+
type _GetChildren<Id extends RouteId> = {
|
|
62
|
+
[K in RouteId]: UserRoutes[K] extends {
|
|
63
|
+
parentId: Id;
|
|
64
|
+
} ? [K, ..._GetChildren<K>] : [];
|
|
65
|
+
}[RouteId];
|
|
66
|
+
type GetChildren<Id extends RouteId> = _GetChildren<Id> extends [] ? [] : Exclude<_GetChildren<Id>, []>;
|
|
67
|
+
type GetBranch<Id extends RouteId> = [
|
|
68
|
+
...GetParents<Id>,
|
|
69
|
+
Id,
|
|
70
|
+
...GetChildren<Id>
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
export type { Register, Routes };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* react-router v0.0.0-experimental-a2c4d7fad
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Remix Software Inc.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
"use strict";
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
14
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
|
|
26
|
+
// lib/types/index.ts
|
|
27
|
+
var types_exports = {};
|
|
28
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ay as LinkDescriptor, av as MetaDescriptor,
|
|
1
|
+
import { ay as LinkDescriptor, av as MetaDescriptor, aN as ServerDataFrom, aO as ClientDataFrom, aP as Func, aQ as Equal, aM as Pretty } from '../../route-data-Cceggzl6.mjs';
|
|
2
2
|
import { A as AppLoadContext } from '../../data-CQbyyGzl.mjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
@@ -21,8 +21,6 @@ type RouteInfo = {
|
|
|
21
21
|
parents: RouteInfo[];
|
|
22
22
|
module: RouteModule;
|
|
23
23
|
id: unknown;
|
|
24
|
-
file: string;
|
|
25
|
-
path: string;
|
|
26
24
|
params: unknown;
|
|
27
25
|
loaderData: unknown;
|
|
28
26
|
actionData: unknown;
|
|
@@ -86,8 +84,6 @@ type CreateClientActionArgs<T extends RouteInfo> = ClientDataFunctionArgs<T> & {
|
|
|
86
84
|
};
|
|
87
85
|
type CreateHydrateFallbackProps<T extends RouteInfo> = {
|
|
88
86
|
params: T["params"];
|
|
89
|
-
loaderData?: T["loaderData"];
|
|
90
|
-
actionData?: T["actionData"];
|
|
91
87
|
};
|
|
92
88
|
type Match<T extends RouteInfo> = Pretty<Pick<T, "id" | "params"> & {
|
|
93
89
|
pathname: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ay as LinkDescriptor, av as MetaDescriptor,
|
|
1
|
+
import { ay as LinkDescriptor, av as MetaDescriptor, aN as ServerDataFrom, aO as ClientDataFrom, aP as Func, aQ as Equal, aM as Pretty } from '../../route-data-Cceggzl6.js';
|
|
2
2
|
import { A as AppLoadContext } from '../../data-CQbyyGzl.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
@@ -21,8 +21,6 @@ type RouteInfo = {
|
|
|
21
21
|
parents: RouteInfo[];
|
|
22
22
|
module: RouteModule;
|
|
23
23
|
id: unknown;
|
|
24
|
-
file: string;
|
|
25
|
-
path: string;
|
|
26
24
|
params: unknown;
|
|
27
25
|
loaderData: unknown;
|
|
28
26
|
actionData: unknown;
|
|
@@ -86,8 +84,6 @@ type CreateClientActionArgs<T extends RouteInfo> = ClientDataFunctionArgs<T> & {
|
|
|
86
84
|
};
|
|
87
85
|
type CreateHydrateFallbackProps<T extends RouteInfo> = {
|
|
88
86
|
params: T["params"];
|
|
89
|
-
loaderData?: T["loaderData"];
|
|
90
|
-
actionData?: T["actionData"];
|
|
91
87
|
};
|
|
92
88
|
type Match<T extends RouteInfo> = Pretty<Pick<T, "id" | "params"> & {
|
|
93
89
|
pathname: string;
|