react-router 0.0.0-experimental-a26b992a1 → 0.0.0-experimental-312bddb22
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/dom-export.mjs +1 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.mjs +69 -196
- package/dist/index.mjs.map +1 -1
- package/dist/main-dom-export.js +1 -1
- package/dist/main.js +1 -1
- package/dist/react-router-dom.development.js +1 -1
- package/dist/react-router-dom.production.min.js +1 -1
- package/dist/react-router.development.js +70 -107
- package/dist/react-router.development.js.map +1 -1
- package/dist/react-router.production.min.js +2 -2
- package/dist/react-router.production.min.js.map +1 -1
- package/dist/umd/react-router-dom.development.js +1 -1
- package/dist/umd/react-router-dom.production.min.js +1 -1
- package/dist/umd/react-router.development.js +76 -203
- package/dist/umd/react-router.development.js.map +1 -1
- package/dist/umd/react-router.production.min.js +2 -2
- package/dist/umd/react-router.production.min.js.map +1 -1
- package/package.json +2 -2
- package/dist/lib/server-runtime/formData.d.ts +0 -15
- package/dist/lib/server-runtime/upload/errors.d.ts +0 -5
- package/dist/lib/server-runtime/upload/memoryUploadHandler.d.ts +0 -21
package/dist/dom-export.mjs
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -24,20 +24,15 @@ export { ServerRouter } from "./lib/dom/ssr/server";
|
|
|
24
24
|
export type { RoutesTestStubProps } from "./lib/dom/ssr/routes-test-stub";
|
|
25
25
|
export { createRoutesStub } from "./lib/dom/ssr/routes-test-stub";
|
|
26
26
|
export { createCookie, isCookie } from "./lib/server-runtime/cookies";
|
|
27
|
-
export { composeUploadHandlers as unstable_composeUploadHandlers, parseMultipartFormData as unstable_parseMultipartFormData, } from "./lib/server-runtime/formData";
|
|
28
27
|
export { createRequestHandler } from "./lib/server-runtime/server";
|
|
29
28
|
export { createSession, createSessionStorage, isSession, } from "./lib/server-runtime/sessions";
|
|
30
29
|
export { createCookieSessionStorage } from "./lib/server-runtime/sessions/cookieStorage";
|
|
31
30
|
export { createMemorySessionStorage } from "./lib/server-runtime/sessions/memoryStorage";
|
|
32
|
-
export { createMemoryUploadHandler as unstable_createMemoryUploadHandler } from "./lib/server-runtime/upload/memoryUploadHandler";
|
|
33
|
-
export { MaxPartSizeExceededError } from "./lib/server-runtime/upload/errors";
|
|
34
31
|
export { setDevServerHooks as unstable_setDevServerHooks } from "./lib/server-runtime/dev";
|
|
35
32
|
export type { IsCookieFunction } from "./lib/server-runtime/cookies";
|
|
36
33
|
export type { CreateRequestHandlerFunction } from "./lib/server-runtime/server";
|
|
37
34
|
export type { IsSessionFunction } from "./lib/server-runtime/sessions";
|
|
38
35
|
export type { HandleDataRequestFunction, HandleDocumentRequestFunction, HandleErrorFunction, ServerBuild, ServerEntryModule, } from "./lib/server-runtime/build";
|
|
39
|
-
export type { UploadHandlerPart, UploadHandler, } from "./lib/server-runtime/formData";
|
|
40
|
-
export type { MemoryUploadHandlerOptions, MemoryUploadHandlerFilterArgs, } from "./lib/server-runtime/upload/memoryUploadHandler";
|
|
41
36
|
export type { Cookie, CookieOptions, CookieParseOptions, CookieSerializeOptions, CookieSignatureOptions, } from "./lib/server-runtime/cookies";
|
|
42
37
|
export type { AppLoadContext } from "./lib/server-runtime/data";
|
|
43
38
|
export type { PageLinkDescriptor, HtmlLinkDescriptor, LinkDescriptor, } from "./lib/router/links";
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React Router v0.0.0-experimental-
|
|
2
|
+
* React Router v0.0.0-experimental-312bddb22
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -11,53 +11,8 @@
|
|
|
11
11
|
import * as React from 'react';
|
|
12
12
|
import { decode, encode } from 'turbo-stream';
|
|
13
13
|
import { parse, serialize } from 'cookie';
|
|
14
|
-
import { streamMultipart } from '@web3-storage/multipart-parser';
|
|
15
14
|
import { splitCookiesString } from 'set-cookie-parser';
|
|
16
15
|
|
|
17
|
-
function _asyncIterator(iterable) {
|
|
18
|
-
var method,
|
|
19
|
-
async,
|
|
20
|
-
sync,
|
|
21
|
-
retry = 2;
|
|
22
|
-
for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) {
|
|
23
|
-
if (async && null != (method = iterable[async])) return method.call(iterable);
|
|
24
|
-
if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable));
|
|
25
|
-
async = "@@asyncIterator", sync = "@@iterator";
|
|
26
|
-
}
|
|
27
|
-
throw new TypeError("Object is not async iterable");
|
|
28
|
-
}
|
|
29
|
-
function AsyncFromSyncIterator(s) {
|
|
30
|
-
function AsyncFromSyncIteratorContinuation(r) {
|
|
31
|
-
if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object."));
|
|
32
|
-
var done = r.done;
|
|
33
|
-
return Promise.resolve(r.value).then(function (value) {
|
|
34
|
-
return {
|
|
35
|
-
value: value,
|
|
36
|
-
done: done
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return AsyncFromSyncIterator = function (s) {
|
|
41
|
-
this.s = s, this.n = s.next;
|
|
42
|
-
}, AsyncFromSyncIterator.prototype = {
|
|
43
|
-
s: null,
|
|
44
|
-
n: null,
|
|
45
|
-
next: function () {
|
|
46
|
-
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
|
|
47
|
-
},
|
|
48
|
-
return: function (value) {
|
|
49
|
-
var ret = this.s.return;
|
|
50
|
-
return void 0 === ret ? Promise.resolve({
|
|
51
|
-
value: value,
|
|
52
|
-
done: !0
|
|
53
|
-
}) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments));
|
|
54
|
-
},
|
|
55
|
-
throw: function (value) {
|
|
56
|
-
var thr = this.s.return;
|
|
57
|
-
return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));
|
|
58
|
-
}
|
|
59
|
-
}, new AsyncFromSyncIterator(s);
|
|
60
|
-
}
|
|
61
16
|
function _extends() {
|
|
62
17
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
63
18
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -2275,9 +2230,9 @@ function createRouter(init) {
|
|
|
2275
2230
|
return;
|
|
2276
2231
|
}
|
|
2277
2232
|
let match = getTargetMatch(matches, path);
|
|
2278
|
-
|
|
2233
|
+
let preventScrollReset = (opts && opts.preventScrollReset) === true;
|
|
2279
2234
|
if (submission && isMutationMethod(submission.formMethod)) {
|
|
2280
|
-
await handleFetcherAction(key, routeId, path, match, matches, fogOfWar.active, flushSync, submission);
|
|
2235
|
+
await handleFetcherAction(key, routeId, path, match, matches, fogOfWar.active, flushSync, preventScrollReset, submission);
|
|
2281
2236
|
return;
|
|
2282
2237
|
}
|
|
2283
2238
|
// Store off the match so we can call it's shouldRevalidate on subsequent
|
|
@@ -2286,11 +2241,11 @@ function createRouter(init) {
|
|
|
2286
2241
|
routeId,
|
|
2287
2242
|
path
|
|
2288
2243
|
});
|
|
2289
|
-
await handleFetcherLoader(key, routeId, path, match, matches, fogOfWar.active, flushSync, submission);
|
|
2244
|
+
await handleFetcherLoader(key, routeId, path, match, matches, fogOfWar.active, flushSync, preventScrollReset, submission);
|
|
2290
2245
|
}
|
|
2291
2246
|
// Call the action for the matched fetcher.submit(), and then handle redirects,
|
|
2292
2247
|
// errors, and revalidation
|
|
2293
|
-
async function handleFetcherAction(key, routeId, path, match, requestMatches, isFogOfWar, flushSync, submission) {
|
|
2248
|
+
async function handleFetcherAction(key, routeId, path, match, requestMatches, isFogOfWar, flushSync, preventScrollReset, submission) {
|
|
2294
2249
|
interruptActiveLoads();
|
|
2295
2250
|
fetchLoadMatches.delete(key);
|
|
2296
2251
|
function detectAndHandle405Error(m) {
|
|
@@ -2379,7 +2334,8 @@ function createRouter(init) {
|
|
|
2379
2334
|
fetchRedirectIds.add(key);
|
|
2380
2335
|
updateFetcherState(key, getLoadingFetcher(submission));
|
|
2381
2336
|
return startRedirectNavigation(fetchRequest, actionResult, false, {
|
|
2382
|
-
fetcherSubmission: submission
|
|
2337
|
+
fetcherSubmission: submission,
|
|
2338
|
+
preventScrollReset
|
|
2383
2339
|
});
|
|
2384
2340
|
}
|
|
2385
2341
|
}
|
|
@@ -2434,7 +2390,9 @@ function createRouter(init) {
|
|
|
2434
2390
|
revalidatingFetchers.forEach(r => fetchControllers.delete(r.key));
|
|
2435
2391
|
let redirect = findRedirect(loaderResults);
|
|
2436
2392
|
if (redirect) {
|
|
2437
|
-
return startRedirectNavigation(revalidationRequest, redirect.result, false
|
|
2393
|
+
return startRedirectNavigation(revalidationRequest, redirect.result, false, {
|
|
2394
|
+
preventScrollReset
|
|
2395
|
+
});
|
|
2438
2396
|
}
|
|
2439
2397
|
redirect = findRedirect(fetcherResults);
|
|
2440
2398
|
if (redirect) {
|
|
@@ -2442,7 +2400,9 @@ function createRouter(init) {
|
|
|
2442
2400
|
// fetchRedirectIds so it doesn't get revalidated on the next set of
|
|
2443
2401
|
// loader executions
|
|
2444
2402
|
fetchRedirectIds.add(redirect.key);
|
|
2445
|
-
return startRedirectNavigation(revalidationRequest, redirect.result, false
|
|
2403
|
+
return startRedirectNavigation(revalidationRequest, redirect.result, false, {
|
|
2404
|
+
preventScrollReset
|
|
2405
|
+
});
|
|
2446
2406
|
}
|
|
2447
2407
|
// Process and commit output from loaders
|
|
2448
2408
|
let {
|
|
@@ -2481,7 +2441,7 @@ function createRouter(init) {
|
|
|
2481
2441
|
}
|
|
2482
2442
|
}
|
|
2483
2443
|
// Call the matched loader for fetcher.load(), handling redirects, errors, etc.
|
|
2484
|
-
async function handleFetcherLoader(key, routeId, path, match, matches, isFogOfWar, flushSync, submission) {
|
|
2444
|
+
async function handleFetcherLoader(key, routeId, path, match, matches, isFogOfWar, flushSync, preventScrollReset, submission) {
|
|
2485
2445
|
let existingFetcher = state.fetchers.get(key);
|
|
2486
2446
|
updateFetcherState(key, getLoadingFetcher(submission, existingFetcher ? existingFetcher.data : undefined), {
|
|
2487
2447
|
flushSync
|
|
@@ -2540,7 +2500,9 @@ function createRouter(init) {
|
|
|
2540
2500
|
return;
|
|
2541
2501
|
} else {
|
|
2542
2502
|
fetchRedirectIds.add(key);
|
|
2543
|
-
await startRedirectNavigation(fetchRequest, result, false
|
|
2503
|
+
await startRedirectNavigation(fetchRequest, result, false, {
|
|
2504
|
+
preventScrollReset
|
|
2505
|
+
});
|
|
2544
2506
|
return;
|
|
2545
2507
|
}
|
|
2546
2508
|
}
|
|
@@ -2575,6 +2537,7 @@ function createRouter(init) {
|
|
|
2575
2537
|
let {
|
|
2576
2538
|
submission,
|
|
2577
2539
|
fetcherSubmission,
|
|
2540
|
+
preventScrollReset,
|
|
2578
2541
|
replace
|
|
2579
2542
|
} = _temp2 === void 0 ? {} : _temp2;
|
|
2580
2543
|
if (redirect.response.headers.has("X-Remix-Revalidate")) {
|
|
@@ -2632,7 +2595,7 @@ function createRouter(init) {
|
|
|
2632
2595
|
formAction: location
|
|
2633
2596
|
}),
|
|
2634
2597
|
// Preserve these flags across redirects
|
|
2635
|
-
preventScrollReset: pendingPreventScrollReset,
|
|
2598
|
+
preventScrollReset: preventScrollReset || pendingPreventScrollReset,
|
|
2636
2599
|
enableViewTransition: isNavigation ? pendingViewTransitionEnabled : undefined
|
|
2637
2600
|
});
|
|
2638
2601
|
} else {
|
|
@@ -2644,7 +2607,7 @@ function createRouter(init) {
|
|
|
2644
2607
|
// Send fetcher submissions through for shouldRevalidate
|
|
2645
2608
|
fetcherSubmission,
|
|
2646
2609
|
// Preserve these flags across redirects
|
|
2647
|
-
preventScrollReset: pendingPreventScrollReset,
|
|
2610
|
+
preventScrollReset: preventScrollReset || pendingPreventScrollReset,
|
|
2648
2611
|
enableViewTransition: isNavigation ? pendingViewTransitionEnabled : undefined
|
|
2649
2612
|
});
|
|
2650
2613
|
}
|
|
@@ -3508,9 +3471,21 @@ function normalizeTo(location, matches, basename, to, fromRouteId, relative) {
|
|
|
3508
3471
|
path.search = location.search;
|
|
3509
3472
|
path.hash = location.hash;
|
|
3510
3473
|
}
|
|
3511
|
-
//
|
|
3512
|
-
if ((to == null || to === "" || to === ".") && activeRouteMatch
|
|
3513
|
-
|
|
3474
|
+
// Account for `?index` params when routing to the current location
|
|
3475
|
+
if ((to == null || to === "" || to === ".") && activeRouteMatch) {
|
|
3476
|
+
let nakedIndex = hasNakedIndexQuery(path.search);
|
|
3477
|
+
if (activeRouteMatch.route.index && !nakedIndex) {
|
|
3478
|
+
// Add one when we're targeting an index route
|
|
3479
|
+
path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
|
|
3480
|
+
} else if (!activeRouteMatch.route.index && nakedIndex) {
|
|
3481
|
+
// Remove existing ones when we're not
|
|
3482
|
+
let params = new URLSearchParams(path.search);
|
|
3483
|
+
let indexValues = params.getAll("index");
|
|
3484
|
+
params.delete("index");
|
|
3485
|
+
indexValues.filter(v => v).forEach(v => params.append("index", v));
|
|
3486
|
+
let qs = params.toString();
|
|
3487
|
+
path.search = qs ? "?" + qs : "";
|
|
3488
|
+
}
|
|
3514
3489
|
}
|
|
3515
3490
|
// If we're operating within a basename, prepend it to the pathname. If
|
|
3516
3491
|
// this is a root navigation, then just use the raw basename which allows
|
|
@@ -3858,10 +3833,31 @@ function patchRoutesImpl(routeId, children, routesToUse, manifest, mapRoutePrope
|
|
|
3858
3833
|
// Don't patch in routes we already know about so that `patch` is idempotent
|
|
3859
3834
|
// to simplify user-land code. This is useful because we re-call the
|
|
3860
3835
|
// `patchRoutesOnNavigation` function for matched routes with params.
|
|
3861
|
-
let uniqueChildren = children.filter(
|
|
3836
|
+
let uniqueChildren = children.filter(newRoute => !childrenToPatch.some(existingRoute => isSameRoute(newRoute, existingRoute)));
|
|
3862
3837
|
let newRoutes = convertRoutesToDataRoutes(uniqueChildren, mapRouteProperties, [routeId || "_", "patch", String(((_childrenToPatch = childrenToPatch) == null ? void 0 : _childrenToPatch.length) || "0")], manifest);
|
|
3863
3838
|
childrenToPatch.push(...newRoutes);
|
|
3864
3839
|
}
|
|
3840
|
+
function isSameRoute(newRoute, existingRoute) {
|
|
3841
|
+
// Most optimal check is by id
|
|
3842
|
+
if ("id" in newRoute && "id" in existingRoute && newRoute.id === existingRoute.id) {
|
|
3843
|
+
return true;
|
|
3844
|
+
}
|
|
3845
|
+
// Second is by pathing differences
|
|
3846
|
+
if (!(newRoute.index === existingRoute.index && newRoute.path === existingRoute.path && newRoute.caseSensitive === existingRoute.caseSensitive)) {
|
|
3847
|
+
return false;
|
|
3848
|
+
}
|
|
3849
|
+
// Pathless layout routes are trickier since we need to check children.
|
|
3850
|
+
// If they have no children then they're the same as far as we can tell
|
|
3851
|
+
if ((!newRoute.children || newRoute.children.length === 0) && (!existingRoute.children || existingRoute.children.length === 0)) {
|
|
3852
|
+
return true;
|
|
3853
|
+
}
|
|
3854
|
+
// Otherwise, we look to see if every child in the new route is already
|
|
3855
|
+
// represented in the existing route's children
|
|
3856
|
+
return newRoute.children.every((aChild, i) => {
|
|
3857
|
+
var _existingRoute$childr;
|
|
3858
|
+
return (_existingRoute$childr = existingRoute.children) == null ? void 0 : _existingRoute$childr.some(bChild => isSameRoute(aChild, bChild));
|
|
3859
|
+
});
|
|
3860
|
+
}
|
|
3865
3861
|
/**
|
|
3866
3862
|
* Execute route.lazy() methods to lazily load route modules (loader, action,
|
|
3867
3863
|
* shouldRevalidate) and update the routeManifest in place which shares objects
|
|
@@ -7229,6 +7225,11 @@ function singleFetchUrl(reqUrl) {
|
|
|
7229
7225
|
}
|
|
7230
7226
|
async function fetchAndDecode(url, init) {
|
|
7231
7227
|
let res = await fetch(url, init);
|
|
7228
|
+
// If this 404'd without hitting the running server (most likely in a
|
|
7229
|
+
// pre-rendered app using a CDN), then bubble a standard 404 ErrorResponse
|
|
7230
|
+
if (res.status === 404 && !res.headers.has("X-Remix-Response")) {
|
|
7231
|
+
throw new ErrorResponseImpl(404, "Not Found", true);
|
|
7232
|
+
}
|
|
7232
7233
|
!res.body ? process.env.NODE_ENV !== "production" ? invariant$1(false, "No response body to decode") : invariant$1(false) : void 0;
|
|
7233
7234
|
try {
|
|
7234
7235
|
let decoded = await decodeViaTurboStream(res.body, window);
|
|
@@ -9334,9 +9335,13 @@ action, _temp2) {
|
|
|
9334
9335
|
// since it might not apply to our contextual route. We add it back based
|
|
9335
9336
|
// on match.route.index below
|
|
9336
9337
|
let params = new URLSearchParams(path.search);
|
|
9337
|
-
|
|
9338
|
+
let indexValues = params.getAll("index");
|
|
9339
|
+
let hasNakedIndexParam = indexValues.some(v => v === "");
|
|
9340
|
+
if (hasNakedIndexParam) {
|
|
9338
9341
|
params.delete("index");
|
|
9339
|
-
|
|
9342
|
+
indexValues.filter(v => v).forEach(v => params.append("index", v));
|
|
9343
|
+
let qs = params.toString();
|
|
9344
|
+
path.search = qs ? "?" + qs : "";
|
|
9340
9345
|
}
|
|
9341
9346
|
}
|
|
9342
9347
|
if ((!action || action === ".") && match.route.index) {
|
|
@@ -10348,70 +10353,6 @@ function warnOnceAboutExpiresCookie(name, expires) {
|
|
|
10348
10353
|
warnOnce(!expires, "The \"" + name + "\" cookie has an \"expires\" property set. " + "This will cause the expires value to not be updated when the session is committed. " + "Instead, you should set the expires value when serializing the cookie. " + "You can use `commitSession(session, { expires })` if using a session storage object, " + "or `cookie.serialize(\"value\", { expires })` if you're using the cookie directly.");
|
|
10349
10354
|
}
|
|
10350
10355
|
|
|
10351
|
-
function composeUploadHandlers() {
|
|
10352
|
-
for (var _len = arguments.length, handlers = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10353
|
-
handlers[_key] = arguments[_key];
|
|
10354
|
-
}
|
|
10355
|
-
return async part => {
|
|
10356
|
-
for (let handler of handlers) {
|
|
10357
|
-
let value = await handler(part);
|
|
10358
|
-
if (typeof value !== "undefined" && value !== null) {
|
|
10359
|
-
return value;
|
|
10360
|
-
}
|
|
10361
|
-
}
|
|
10362
|
-
return undefined;
|
|
10363
|
-
};
|
|
10364
|
-
}
|
|
10365
|
-
/**
|
|
10366
|
-
* Allows you to handle multipart forms (file uploads) for your app.
|
|
10367
|
-
*
|
|
10368
|
-
* TODO: Update this comment
|
|
10369
|
-
* @see https://remix.run/utils/parse-multipart-form-data
|
|
10370
|
-
*/
|
|
10371
|
-
async function parseMultipartFormData(request, uploadHandler) {
|
|
10372
|
-
let contentType = request.headers.get("Content-Type") || "";
|
|
10373
|
-
let [type, boundary] = contentType.split(/\s*;\s*boundary=/);
|
|
10374
|
-
if (!request.body || !boundary || type !== "multipart/form-data") {
|
|
10375
|
-
throw new TypeError("Could not parse content as FormData.");
|
|
10376
|
-
}
|
|
10377
|
-
let formData = new FormData();
|
|
10378
|
-
let parts = streamMultipart(request.body, boundary);
|
|
10379
|
-
var _iteratorAbruptCompletion = false;
|
|
10380
|
-
var _didIteratorError = false;
|
|
10381
|
-
var _iteratorError;
|
|
10382
|
-
try {
|
|
10383
|
-
for (var _iterator = _asyncIterator(parts), _step; _iteratorAbruptCompletion = !(_step = await _iterator.next()).done; _iteratorAbruptCompletion = false) {
|
|
10384
|
-
let part = _step.value;
|
|
10385
|
-
{
|
|
10386
|
-
if (part.done) break;
|
|
10387
|
-
if (typeof part.filename === "string") {
|
|
10388
|
-
// only pass basename as the multipart/form-data spec recommends
|
|
10389
|
-
// https://datatracker.ietf.org/doc/html/rfc7578#section-4.2
|
|
10390
|
-
part.filename = part.filename.split(/[/\\]/).pop();
|
|
10391
|
-
}
|
|
10392
|
-
let value = await uploadHandler(part);
|
|
10393
|
-
if (typeof value !== "undefined" && value !== null) {
|
|
10394
|
-
formData.append(part.name, value);
|
|
10395
|
-
}
|
|
10396
|
-
}
|
|
10397
|
-
}
|
|
10398
|
-
} catch (err) {
|
|
10399
|
-
_didIteratorError = true;
|
|
10400
|
-
_iteratorError = err;
|
|
10401
|
-
} finally {
|
|
10402
|
-
try {
|
|
10403
|
-
if (_iteratorAbruptCompletion && _iterator.return != null) {
|
|
10404
|
-
await _iterator.return();
|
|
10405
|
-
}
|
|
10406
|
-
} finally {
|
|
10407
|
-
if (_didIteratorError) {
|
|
10408
|
-
throw _iteratorError;
|
|
10409
|
-
}
|
|
10410
|
-
}
|
|
10411
|
-
}
|
|
10412
|
-
return formData;
|
|
10413
|
-
}
|
|
10414
|
-
|
|
10415
10356
|
function createEntryRouteModules(manifest) {
|
|
10416
10357
|
return Object.keys(manifest).reduce((memo, routeId) => {
|
|
10417
10358
|
memo[routeId] = manifest[routeId].module;
|
|
@@ -11594,74 +11535,6 @@ function createMemorySessionStorage(_temp) {
|
|
|
11594
11535
|
});
|
|
11595
11536
|
}
|
|
11596
11537
|
|
|
11597
|
-
class MaxPartSizeExceededError extends Error {
|
|
11598
|
-
constructor(field, maxBytes) {
|
|
11599
|
-
super("Field \"" + field + "\" exceeded upload size of " + maxBytes + " bytes.");
|
|
11600
|
-
this.field = field;
|
|
11601
|
-
this.maxBytes = maxBytes;
|
|
11602
|
-
}
|
|
11603
|
-
}
|
|
11604
|
-
|
|
11605
|
-
function createMemoryUploadHandler(_temp) {
|
|
11606
|
-
let {
|
|
11607
|
-
filter,
|
|
11608
|
-
maxPartSize = 3000000
|
|
11609
|
-
} = _temp === void 0 ? {} : _temp;
|
|
11610
|
-
return async _ref => {
|
|
11611
|
-
let {
|
|
11612
|
-
filename,
|
|
11613
|
-
contentType,
|
|
11614
|
-
name,
|
|
11615
|
-
data
|
|
11616
|
-
} = _ref;
|
|
11617
|
-
if (filter && !(await filter({
|
|
11618
|
-
filename,
|
|
11619
|
-
contentType,
|
|
11620
|
-
name
|
|
11621
|
-
}))) {
|
|
11622
|
-
return undefined;
|
|
11623
|
-
}
|
|
11624
|
-
let size = 0;
|
|
11625
|
-
let chunks = [];
|
|
11626
|
-
var _iteratorAbruptCompletion = false;
|
|
11627
|
-
var _didIteratorError = false;
|
|
11628
|
-
var _iteratorError;
|
|
11629
|
-
try {
|
|
11630
|
-
for (var _iterator = _asyncIterator(data), _step; _iteratorAbruptCompletion = !(_step = await _iterator.next()).done; _iteratorAbruptCompletion = false) {
|
|
11631
|
-
let chunk = _step.value;
|
|
11632
|
-
{
|
|
11633
|
-
size += chunk.byteLength;
|
|
11634
|
-
if (size > maxPartSize) {
|
|
11635
|
-
throw new MaxPartSizeExceededError(name, maxPartSize);
|
|
11636
|
-
}
|
|
11637
|
-
chunks.push(chunk);
|
|
11638
|
-
}
|
|
11639
|
-
}
|
|
11640
|
-
} catch (err) {
|
|
11641
|
-
_didIteratorError = true;
|
|
11642
|
-
_iteratorError = err;
|
|
11643
|
-
} finally {
|
|
11644
|
-
try {
|
|
11645
|
-
if (_iteratorAbruptCompletion && _iterator.return != null) {
|
|
11646
|
-
await _iterator.return();
|
|
11647
|
-
}
|
|
11648
|
-
} finally {
|
|
11649
|
-
if (_didIteratorError) {
|
|
11650
|
-
throw _iteratorError;
|
|
11651
|
-
}
|
|
11652
|
-
}
|
|
11653
|
-
}
|
|
11654
|
-
if (typeof filename === "string") {
|
|
11655
|
-
return new File(chunks, filename, {
|
|
11656
|
-
type: contentType
|
|
11657
|
-
});
|
|
11658
|
-
}
|
|
11659
|
-
return await new Blob(chunks, {
|
|
11660
|
-
type: contentType
|
|
11661
|
-
}).text();
|
|
11662
|
-
};
|
|
11663
|
-
}
|
|
11664
|
-
|
|
11665
11538
|
function deserializeErrors(errors) {
|
|
11666
11539
|
if (!errors) return null;
|
|
11667
11540
|
let entries = Object.entries(errors);
|
|
@@ -11698,5 +11571,5 @@ function deserializeErrors(errors) {
|
|
|
11698
11571
|
return serialized;
|
|
11699
11572
|
}
|
|
11700
11573
|
|
|
11701
|
-
export { Await, BrowserRouter, Form, HashRouter, IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, Link, Links,
|
|
11574
|
+
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, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteContext as UNSAFE_RouteContext, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, ViewTransitionContext as UNSAFE_ViewTransitionContext, createBrowserHistory as UNSAFE_createBrowserHistory, createClientRoutes as UNSAFE_createClientRoutes, createClientRoutesWithHMRRevalidationOptOut as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, createRouter as UNSAFE_createRouter, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction, getSingleFetchDataStrategy$1 as UNSAFE_getSingleFetchDataStrategy, invariant$2 as UNSAFE_invariant, mapRouteProperties as UNSAFE_mapRouteProperties, shouldHydrateRouteLoader as UNSAFE_shouldHydrateRouteLoader, useFogOFWarDiscovery as UNSAFE_useFogOFWarDiscovery, useScrollRestoration as UNSAFE_useScrollRestoration, createBrowserRouter, createCookie, createCookieSessionStorage, createHashRouter, createMemoryRouter, createMemorySessionStorage, createPath, createRequestHandler, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, createRoutesStub, createSearchParams, createSession, createSessionStorage, createStaticHandler, createStaticRouter, data, generatePath, isCookie, isRouteErrorResponse, isSession, json$1 as json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, replace, resolvePath, HistoryRouter as unstable_HistoryRouter, 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 };
|
|
11702
11575
|
//# sourceMappingURL=index.mjs.map
|