@askrjs/askr 0.0.65 → 0.0.67
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/actions/index.d.ts +1 -1
- package/dist/actions/index.js +1 -1
- package/dist/{authoring-CXMPffwN.js → authoring-uaJ556aG.js} +2 -2
- package/dist/benchmark.d.ts +1 -0
- package/dist/benchmark.js +7 -7
- package/dist/boot/index.d.ts +7 -6
- package/dist/boot/index.js +1 -1
- package/dist/{boot-OnYuVVfg.js → boot-DjTa12LD.js} +15 -13
- package/dist/{cleanup-B6KovDZZ.js → cleanup-B0kFA4Fv.js} +3 -2
- package/dist/component-cleanup-1ZFoLLHt.js +141 -0
- package/dist/{component-internal-CbALfPGD.js → component-internal-CPjM4n8M.js} +23 -3
- package/dist/components/index.d.ts +1 -2
- package/dist/control/index.d.ts +1 -1
- package/dist/control/index.js +1 -1
- package/dist/{control-B5xu8v4m.d.ts → control-BjYBlytA.d.ts} +0 -1
- package/dist/{control-KVP6LMEQ.js → control-CA45Yvvu.js} +3 -3
- package/dist/{control-CMzFPMjr.d.ts → control-DO-iBEtV.d.ts} +0 -1
- package/dist/{csp-nonce-C-8E85El.js → csp-nonce-HGZ0vbqT.js} +1 -1
- package/dist/data/index.js +1 -1
- package/dist/{data-DvYo_dHd.js → data-DHt_zO1G.js} +2 -2
- package/dist/{deferred-B71c2eio.js → deferred-zHtUheIQ.js} +29 -27
- package/dist/{effect-D_4zf_wy.js → effect-CFUzIpqX.js} +1 -1
- package/dist/fastlane-BTcFCMnm.js +147 -0
- package/dist/{for-internal-B2rBq6yB.js → for-internal-BtK9Htl0.js} +4 -3
- package/dist/foundations/icon/index.d.ts +3 -21
- package/dist/foundations/index.d.ts +1 -1
- package/dist/foundations/index.js +1 -1
- package/dist/foundations/interactions/index.d.ts +31 -26
- package/dist/foundations/state/index.d.ts +1 -2
- package/dist/foundations/state/index.js +1 -1
- package/dist/foundations/structures/index.d.ts +1 -1
- package/dist/foundations/structures/index.js +1 -1
- package/dist/fx/index.d.ts +0 -1
- package/dist/{index-NKPpdRh9.d.ts → index-BFnTM1a8.d.ts} +2 -1
- package/dist/{index-Bjm0__Rr.d.ts → index-DSClfSoC.d.ts} +3 -7
- package/dist/{index-Byqjltu2.d.ts → index-Dh6ZF9yW.d.ts} +1 -2
- package/dist/{index-PgRn5wmg.d.ts → index-DjusBb1I.d.ts} +45 -5
- package/dist/index.d.ts +4 -4
- package/dist/index.js +8 -8
- package/dist/jsx-dev-runtime.d.ts +2 -1
- package/dist/jsx-runtime-X2SX2y8V.d.ts +2 -0
- package/dist/{jsx-runtime-iTU73uwP.d.ts → jsx-runtime-aYZ8zb4q.d.ts} +2 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/{component-lifecycle-DEMPihoZ.js → lifecycle-batch-COgl8jMS.js} +3 -160
- package/dist/{lifecycle-operations-Dj5lK1K7.js → lifecycle-operations-SlPEK68H.js} +1 -1
- package/dist/{navigate-DTZ2SM8_.js → navigate-CJySBpA9.js} +12 -56
- package/dist/navigate-CV-RDqYP.d.ts +20 -0
- package/dist/{portal-D2tPWNrC.js → portal-D7TC986A.js} +3 -2
- package/dist/{fastlane-C8PYPotF.js → readable-BYSoWJSv.js} +2 -146
- package/dist/{renderer-aUD-acDe.js → renderer-Dwkk68c5.js} +25 -12
- package/dist/{resource-operation-Dz2Nxi1q.js → resource-operation-BJiLoLYZ.js} +3 -3
- package/dist/resources/index.d.ts +0 -1
- package/dist/resources/index.js +2 -2
- package/dist/{route-matching-C93To416.js → route-matching-DLBWDeXX.js} +2 -4
- package/dist/router/index.d.ts +21 -16
- package/dist/router/index.js +45 -3
- package/dist/{router-eRoaj11J.d.ts → router-C0XQA62W.d.ts} +8 -5
- package/dist/{selector-pApF_lGd.js → selector-DueeR6Oz.js} +1 -1
- package/dist/ssg/index.d.ts +22 -11
- package/dist/ssg/index.js +3 -3
- package/dist/ssr/index.d.ts +6 -5
- package/dist/ssr/index.js +1 -1
- package/dist/{ssr-C0hzqhY8.js → ssr-vE-KUgDV.js} +13 -21
- package/dist/{state-Cc5HumQ0.js → state-CVuQVjvK.js} +2 -1
- package/dist/testing/index.d.ts +1 -2
- package/dist/testing/index.js +2 -2
- package/dist/types-DEhT-Nrv.d.ts +63 -0
- package/dist/{verify-hydration-BdKE9Hi8.js → verify-hydration-ChyEiBAn.js} +1 -1
- package/package.json +1 -1
- package/dist/jsx-runtime-BVVgDSdq.d.ts +0 -1
- package/dist/navigate-BVDCzOuB.d.ts +0 -34
- package/dist/types-4k3RFEaC.d.ts +0 -19
package/dist/router/index.d.ts
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
|
-
import { c as RenderableChild } from "../control-
|
|
1
|
+
import { c as RenderableChild } from "../control-DO-iBEtV.js";
|
|
2
2
|
import { r as JSXElement, s as Props } from "../jsx-Dvr2SGRG.js";
|
|
3
|
-
import
|
|
4
|
-
import { a as
|
|
3
|
+
import "../types-DEhT-Nrv.js";
|
|
4
|
+
import { A as RouteRecord, B as RouteSnapshot, C as RouteMetaSource, D as RoutePathParams, E as RouteParams, F as RouteRenderResult, I as RouteRequestOptions, L as RouteRequestResult, M as RouteRefSearch, N as RouteRegistry, O as RoutePolicy, P as RouteRegistryOptions, R as RouteSearch, S as RouteMeta, T as RouteOptions, _ as RouteDefinition, a as AccessRedirectDecision, b as RouteManifest, c as LayoutScopeRecord, d as ParsedSegment, f as Route, g as RouteContext, h as RouteComponent, i as AccessDenyStatus, j as RouteRef, k as RouteQuery, l as PageHelperOptions, m as RouteAuthResolver, n as AccessDecision, o as AccessRedirectStatus, p as RouteAuthOptions, r as AccessDenyDecision, s as GroupHelperOptions, t as AccessAllowDecision, u as PageScopeRecord, v as RouteDestination, w as RouteMode, x as RouteMatch, y as RouteHandler, z as RouteSearchValue } from "../router-C0XQA62W.js";
|
|
5
|
+
import { a as ScrollRestorationOptions, i as NavigationScrollBehavior, n as NavigateOptions, r as HistoryScrollBehavior, t as navigate } from "../navigate-CV-RDqYP.js";
|
|
5
6
|
import { AuthContext, AuthContext as AuthContext$1, AuthRequirement, AuthRequirement as AuthRequirement$1 } from "@askrjs/auth";
|
|
6
7
|
import { ObjectSchema } from "@askrjs/schema";
|
|
7
|
-
|
|
8
|
+
//#region src/router/route-query.d.ts
|
|
9
|
+
type RouteQueryParamValue = string | number | boolean | null | undefined;
|
|
10
|
+
type RouteQueryParamInput = RouteQueryParamValue | readonly RouteQueryParamValue[];
|
|
11
|
+
type RouteQueryUpdates = Record<string, RouteQueryParamInput>;
|
|
12
|
+
type RouteQueryUpdater = (searchParams: URLSearchParams) => void;
|
|
13
|
+
type UpdateRouteQueryOptions = {
|
|
14
|
+
/**
|
|
15
|
+
* Defaults to replace so high-frequency controls such as search inputs do not
|
|
16
|
+
* create one browser-history entry per character.
|
|
17
|
+
*/
|
|
18
|
+
history?: 'push' | 'replace';
|
|
19
|
+
replace?: boolean;
|
|
20
|
+
};
|
|
21
|
+
declare function updateRouteQuery(updates: RouteQueryUpdates | RouteQueryUpdater, options?: UpdateRouteQueryOptions): void;
|
|
22
|
+
//#endregion
|
|
8
23
|
//#region src/router/internal-types.d.ts
|
|
9
24
|
type AnyRouteComponent = (...args: any[]) => RenderableChild;
|
|
10
25
|
//#endregion
|
|
@@ -32,7 +47,7 @@ declare function currentRoute<TParams extends RouteParams = RouteParams>(): Rout
|
|
|
32
47
|
declare function currentAuth(): AuthContext$1;
|
|
33
48
|
//#endregion
|
|
34
49
|
//#region src/router/resolution.d.ts
|
|
35
|
-
declare function resolveRouteRequest(target: string, options
|
|
50
|
+
declare function resolveRouteRequest(target: string, options: RouteRequestOptions): RouteRequestResult | Promise<RouteRequestResult>;
|
|
36
51
|
//#endregion
|
|
37
52
|
//#region src/router/manifest.d.ts
|
|
38
53
|
declare function createRouteRegistry(definition: RouteDefinition, options?: RouteRegistryOptions): RouteRegistry;
|
|
@@ -148,16 +163,6 @@ type LinkProps = LinkBaseProps & ({
|
|
|
148
163
|
* - Keyboard handling automatic
|
|
149
164
|
* - Composable via mergeProps
|
|
150
165
|
*/
|
|
151
|
-
declare function Link({
|
|
152
|
-
href: suppliedHref,
|
|
153
|
-
to,
|
|
154
|
-
class: className,
|
|
155
|
-
children,
|
|
156
|
-
rel,
|
|
157
|
-
target,
|
|
158
|
-
'aria-current': ariaCurrent,
|
|
159
|
-
'aria-label': ariaLabel,
|
|
160
|
-
...rest
|
|
161
|
-
}: LinkProps): JSXElement;
|
|
166
|
+
declare function Link({ href: suppliedHref, to, class: className, children, rel, target, 'aria-current': ariaCurrent, 'aria-label': ariaLabel, ...rest }: LinkProps): JSXElement;
|
|
162
167
|
//#endregion
|
|
163
168
|
export { type AccessDecision, type AccessDenyDecision, type AccessRedirectDecision, type AuthContext, type AuthRequirement, type Deferred, type DeferredState, type GroupHelperOptions, type HistoryScrollBehavior, type LayoutScopeRecord, type LazyRouteComponent, Link, type LinkProps, type NavigateOptions, type NavigationScrollBehavior, Outlet, type PageHelperOptions, type PageScopeRecord, type ParsedSegment, Resolve, type ResolveProps, type Route, type RouteAuthOptions, type RouteAuthResolver, type RouteComponent, type RouteContext, type RouteDefinition, type RouteDestination, type RouteHandler, type RouteManifest, type RouteMatch, type RouteMeta, type RouteMetaSource, type RouteMode, type RouteOptions, type RouteParams, type RoutePathParams, type RoutePolicy, type RouteQuery, type RouteQueryParamInput, type RouteQueryParamValue, type RouteQueryUpdater, type RouteQueryUpdates, type RouteRecord, type RouteRef, type RouteRegistry, type RouteRegistryOptions, type RouteRenderResult, type RouteRequestOptions, type RouteRequestResult, type RouteSearch, type RouteSearchValue, type RouteSnapshot, type ScrollRestorationOptions, type UpdateRouteQueryOptions, allow, createRouteRegistry, currentAuth, currentRoute, defer, deny, fallback, forbidden, group, index, isDeferred, lazy, navigate, notFound, page, reconcileRouteMeta, redirect, resolveDeferredValues, resolveRouteMeta, resolveRouteRequest, route, routeData, serializeRouteMeta, to$1 as to, unauthorized, updateRouteQuery };
|
package/dist/router/index.js
CHANGED
|
@@ -1,9 +1,51 @@
|
|
|
1
|
-
import { C as lazy, a as resolveDeferredValues, b as Outlet,
|
|
1
|
+
import { C as lazy, a as resolveDeferredValues, b as Outlet, i as isDeferred, l as createRouteRegistry, m as resolveRouteRequest, n as Resolve, r as defer, s as routeData, y as currentAuth } from "../deferred-zHtUheIQ.js";
|
|
2
2
|
import { jsx } from "../jsx-runtime.js";
|
|
3
|
-
import { a as route, i as page, n as group, r as index, t as fallback } from "../authoring-
|
|
4
|
-
import { a as
|
|
3
|
+
import { a as route, i as page, n as group, r as index, t as fallback } from "../authoring-uaJ556aG.js";
|
|
4
|
+
import { _ as currentRoute, a as serializeRouteMeta, c as getCurrentHref, d as parseTargetUrl, h as syncRegisteredRouteSnapshot, i as resolveRouteMeta, l as getRegisteredAppsSnapshot, m as syncAppRegistrationLocation, n as navigate, p as setCurrentRouteLocation, r as reconcileRouteMeta, s as saveScrollPosition, u as getWindowHref } from "../navigate-CJySBpA9.js";
|
|
5
5
|
import { o as mergeProps } from "../compose-ref-Cc_YkUpM.js";
|
|
6
6
|
import { t as applyInteractionPolicy } from "../interactions-w7gQN4ha.js";
|
|
7
|
+
//#region src/router/route-query.ts
|
|
8
|
+
function getRouteQueryHistoryMode(options) {
|
|
9
|
+
if (options.history) return options.history;
|
|
10
|
+
return options.replace === false ? "push" : "replace";
|
|
11
|
+
}
|
|
12
|
+
function setRouteQueryValue(searchParams, key, value) {
|
|
13
|
+
searchParams.delete(key);
|
|
14
|
+
if (Array.isArray(value)) {
|
|
15
|
+
for (const entry of value) {
|
|
16
|
+
if (entry === null || entry === void 0) continue;
|
|
17
|
+
searchParams.append(key, String(entry));
|
|
18
|
+
}
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (value === null || value === void 0) return;
|
|
22
|
+
searchParams.set(key, String(value));
|
|
23
|
+
}
|
|
24
|
+
function applyRouteQueryUpdates(searchParams, updates) {
|
|
25
|
+
if (typeof updates === "function") {
|
|
26
|
+
updates(searchParams);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
for (const [key, value] of Object.entries(updates)) setRouteQueryValue(searchParams, key, value);
|
|
30
|
+
}
|
|
31
|
+
function updateRouteQuery(updates, options = {}) {
|
|
32
|
+
if (typeof window === "undefined") return;
|
|
33
|
+
const url = parseTargetUrl(getWindowHref());
|
|
34
|
+
applyRouteQueryUpdates(url.searchParams, updates);
|
|
35
|
+
const href = `${url.pathname}${url.search}${url.hash}`;
|
|
36
|
+
if (href === getWindowHref()) return;
|
|
37
|
+
const historyMode = getRouteQueryHistoryMode(options);
|
|
38
|
+
if (historyMode === "push") saveScrollPosition(getCurrentHref());
|
|
39
|
+
const state = window.history.state && typeof window.history.state === "object" ? window.history.state : {};
|
|
40
|
+
window.history[historyMode === "replace" ? "replaceState" : "pushState"]({
|
|
41
|
+
...state,
|
|
42
|
+
path: href
|
|
43
|
+
}, "", href);
|
|
44
|
+
setCurrentRouteLocation(url.pathname, href);
|
|
45
|
+
for (const app of getRegisteredAppsSnapshot()) syncAppRegistrationLocation(app, url.pathname, href);
|
|
46
|
+
syncRegisteredRouteSnapshot();
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
7
49
|
//#region src/router/policy.ts
|
|
8
50
|
function allow() {
|
|
9
51
|
return { kind: "allow" };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { c as RenderableChild } from "./control-
|
|
1
|
+
import { c as RenderableChild } from "./control-DO-iBEtV.js";
|
|
2
2
|
import { D as QueryPrefetchContext, u as CoreTelemetry } from "./index-Bki2rqcr.js";
|
|
3
|
-
import { t as ActionDescriptor } from "./index-
|
|
3
|
+
import { t as ActionDescriptor } from "./index-DSClfSoC.js";
|
|
4
4
|
import { AuthContext, AuthRequirement } from "@askrjs/auth";
|
|
5
5
|
import { InferSchema, ObjectSchema } from "@askrjs/schema";
|
|
6
|
-
|
|
7
6
|
//#region src/common/router.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* Common call contracts: Router types
|
|
@@ -14,7 +13,7 @@ type TrimRoutePathSlashes<Path extends string> = Path extends `/${infer Rest}` ?
|
|
|
14
13
|
type TrimRoutePathWhitespace<Path extends string> = Path extends `${' ' | '\n' | '\t' | '\r'}${infer Rest}` ? TrimRoutePathWhitespace<Rest> : Path extends `${infer Rest}${' ' | '\n' | '\t' | '\r'}` ? TrimRoutePathWhitespace<Rest> : Path;
|
|
15
14
|
type ExtractRouteSegmentParam<Segment extends string> = Segment extends `{${infer Param}}` ? TrimRoutePathWhitespace<Param> extends `*${infer SplatParam}` ? TrimRoutePathWhitespace<SplatParam> extends '' ? never : TrimRoutePathWhitespace<SplatParam> extends '*' ? never : TrimRoutePathWhitespace<SplatParam> : TrimRoutePathWhitespace<Param> extends '' ? never : TrimRoutePathWhitespace<Param> : Segment extends '*' ? '*' : never;
|
|
16
15
|
type ExtractRoutePathParamNames<Path extends string> = TrimRoutePathSlashes<StripRoutePathSuffix<Path>> extends `${infer Segment}/${infer Rest}` ? ExtractRouteSegmentParam<Segment> | ExtractRoutePathParamNames<Rest> : ExtractRouteSegmentParam<TrimRoutePathSlashes<StripRoutePathSuffix<Path>>>;
|
|
17
|
-
type RoutePathParams<Path extends string> = [ExtractRoutePathParamNames<Path>] extends [never] ? Record<never, string> : { [Key in ExtractRoutePathParamNames<Path>]: string };
|
|
16
|
+
type RoutePathParams<Path extends string> = [ExtractRoutePathParamNames<Path>] extends [never] ? Record<never, string> : { [Key in ExtractRoutePathParamNames<Path>]: string; };
|
|
18
17
|
/**
|
|
19
18
|
* A route page component: a regular component that receives route params as
|
|
20
19
|
* props derived from the URL pattern.
|
|
@@ -154,7 +153,8 @@ interface RouteRegistryOptions {
|
|
|
154
153
|
}
|
|
155
154
|
type RouteDefinition = () => void;
|
|
156
155
|
interface RouteRequestOptions {
|
|
157
|
-
|
|
156
|
+
/** Explicit route source shared by the application renderers. */
|
|
157
|
+
registry: RouteRegistry;
|
|
158
158
|
mode?: RouteMode;
|
|
159
159
|
/** @internal Hydration adopts server loader data instead of rerunning it. */
|
|
160
160
|
load?: boolean;
|
|
@@ -226,6 +226,7 @@ interface RouteManifest {
|
|
|
226
226
|
records: RouteRecord[];
|
|
227
227
|
auth?: RouteAuthOptions;
|
|
228
228
|
}
|
|
229
|
+
declare const routeRegistryBrand: unique symbol;
|
|
229
230
|
interface RouteHandler<TParams extends RouteParams = RouteParams> {
|
|
230
231
|
(params: TParams, context?: {
|
|
231
232
|
signal: AbortSignal;
|
|
@@ -237,6 +238,8 @@ interface Route<TParams extends RouteParams = RouteParams> {
|
|
|
237
238
|
namespace?: string;
|
|
238
239
|
}
|
|
239
240
|
interface RouteRegistry {
|
|
241
|
+
/** Internal brand: registries must come from createRouteRegistry(). */
|
|
242
|
+
readonly [routeRegistryBrand]: true;
|
|
240
243
|
manifest: RouteManifest;
|
|
241
244
|
routes: readonly Route[];
|
|
242
245
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as enqueueRuntimeLane } from "./access-ePqdQqkV.js";
|
|
2
|
-
import {
|
|
2
|
+
import { c as markReadableUsage, f as syncDerivedDependencySubscriptions, l as notifyReadableReaders, o as markReactivePropsDirtySource, p as withDerivedReadTracking, r as clearDerivedDependencySubscriptions, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-BYSoWJSv.js";
|
|
3
3
|
import { i as claimHookIndex, p as getCurrentInstance } from "./component-scope-CC3cojX9.js";
|
|
4
4
|
//#region src/runtime/selector-store.ts
|
|
5
5
|
const dirtySelectorRecords = /* @__PURE__ */ new Set();
|
package/dist/ssg/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { d as DocumentRenderContext, f as DocumentRenderer, u as DocumentRenderArgs } from "../control-
|
|
2
|
-
import { D as RoutePathParams, N as RouteRegistry, O as RoutePolicy, T as RouteOptions, y as RouteHandler } from "../router-
|
|
1
|
+
import { d as DocumentRenderContext, f as DocumentRenderer, u as DocumentRenderArgs } from "../control-DO-iBEtV.js";
|
|
2
|
+
import { D as RoutePathParams, N as RouteRegistry, O as RoutePolicy, T as RouteOptions, y as RouteHandler } from "../router-C0XQA62W.js";
|
|
3
3
|
import { AuthRequirement } from "@askrjs/auth";
|
|
4
|
+
import "node:fs/promises";
|
|
4
5
|
//#region src/ssg/types.d.ts
|
|
5
6
|
type SSGMode = 'full' | 'incremental';
|
|
6
7
|
type RouteRenderStatus = 'success' | 'error' | 'skipped' | 'removed';
|
|
@@ -68,7 +69,8 @@ interface SSGAssetSource {
|
|
|
68
69
|
}
|
|
69
70
|
/** Options for createStaticGen */
|
|
70
71
|
type SSGOptions<TRoutes extends readonly RouteConfig[] = RouteConfig[]> = SSGBaseOptions & {
|
|
71
|
-
/** Explicit route registry captured with `createRouteRegistry()`. */
|
|
72
|
+
/** Explicit route registry captured with `createRouteRegistry()`. */
|
|
73
|
+
registry: RouteRegistry;
|
|
72
74
|
};
|
|
73
75
|
/** Options for a single generation run */
|
|
74
76
|
interface SSGGenerateOptions {
|
|
@@ -161,14 +163,23 @@ interface SSGMetadata extends Record<string, unknown> {
|
|
|
161
163
|
invalidatedRoutes: string[];
|
|
162
164
|
/** Per-route details */
|
|
163
165
|
routes: Array<{
|
|
164
|
-
/** URL path */
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
166
|
+
/** URL path */
|
|
167
|
+
path: string;
|
|
168
|
+
/** Output file path relative to outputDir */
|
|
169
|
+
filePath: string;
|
|
170
|
+
/** File size in bytes */
|
|
171
|
+
fileSize: number;
|
|
172
|
+
/** Render duration in milliseconds */
|
|
173
|
+
renderDuration: number;
|
|
174
|
+
/** Number of resources discovered and rendered */
|
|
175
|
+
resourceCount: number;
|
|
176
|
+
/** Render or generation status */
|
|
177
|
+
status: RouteRenderStatus;
|
|
178
|
+
/** Why this route was rendered, skipped, or removed */
|
|
179
|
+
reason: RouteRenderReason;
|
|
180
|
+
/** Whether the output file was written during this run */
|
|
181
|
+
written: boolean;
|
|
182
|
+
/** Error message if rendering failed */
|
|
172
183
|
error?: string;
|
|
173
184
|
}>;
|
|
174
185
|
}
|
package/dist/ssg/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "../access-ePqdQqkV.js";
|
|
2
|
-
import { S as getRenderHandler, a as resolveDeferredValues, l as createRouteRegistry, u as bindResolvedRouteData } from "../deferred-
|
|
3
|
-
import { a as route } from "../authoring-
|
|
2
|
+
import { S as getRenderHandler, a as resolveDeferredValues, l as createRouteRegistry, u as bindResolvedRouteData } from "../deferred-zHtUheIQ.js";
|
|
3
|
+
import { a as route } from "../authoring-uaJ556aG.js";
|
|
4
4
|
import { n as renderDocument } from "../ssr-CbQO5xd3.js";
|
|
5
|
-
import { n as renderToString } from "../ssr-
|
|
5
|
+
import { n as renderToString } from "../ssr-vE-KUgDV.js";
|
|
6
6
|
import * as fs from "node:fs/promises";
|
|
7
7
|
import * as pathModule from "node:path";
|
|
8
8
|
import * as os from "node:os";
|
package/dist/ssr/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { c as RenderableChild, d as DocumentRenderContext, f as DocumentRenderer, p as SSRData, u as DocumentRenderArgs } from "../control-
|
|
1
|
+
import { c as RenderableChild, d as DocumentRenderContext, f as DocumentRenderer, p as SSRData, u as DocumentRenderArgs } from "../control-DO-iBEtV.js";
|
|
2
2
|
import { r as JSXElement, s as Props } from "../jsx-Dvr2SGRG.js";
|
|
3
3
|
import { D as QueryPrefetchContext, n as ServerQueryRegistry, u as CoreTelemetry, v as DataRuntime } from "../index-Bki2rqcr.js";
|
|
4
|
-
import { A as RouteRecord, L as RouteRequestResult, N as RouteRegistry, a as AccessRedirectDecision, f as Route, p as RouteAuthOptions, r as AccessDenyDecision, y as RouteHandler } from "../router-
|
|
4
|
+
import { A as RouteRecord, L as RouteRequestResult, N as RouteRegistry, a as AccessRedirectDecision, f as Route, p as RouteAuthOptions, r as AccessDenyDecision, y as RouteHandler } from "../router-C0XQA62W.js";
|
|
5
5
|
import { AuthContext } from "@askrjs/auth";
|
|
6
|
-
|
|
7
6
|
//#region src/common/page-render-envelope.d.ts
|
|
8
7
|
declare const PAGE_RENDER_ENVELOPE_VERSION: 1;
|
|
9
8
|
interface PageRenderEnvelope {
|
|
@@ -95,7 +94,8 @@ type RouteRenderOptions = SSRRouteSource & {
|
|
|
95
94
|
request?: Request;
|
|
96
95
|
dataRuntime?: DataRuntime;
|
|
97
96
|
queryPrefetch?: QueryPrefetchContext;
|
|
98
|
-
telemetry?: Pick<CoreTelemetry, 'ssrRender'>;
|
|
97
|
+
telemetry?: Pick<CoreTelemetry, 'ssrRender'>;
|
|
98
|
+
/** @internal Precomposed page state used by hydration verification. */
|
|
99
99
|
envelope?: PageRenderEnvelope;
|
|
100
100
|
cspNonce?: string;
|
|
101
101
|
};
|
|
@@ -132,7 +132,8 @@ type SSRComponent = (props: Props, context?: {
|
|
|
132
132
|
//#region src/ssr/render-sync.d.ts
|
|
133
133
|
declare function renderToStringSync(component: (props?: Record<string, unknown>) => VNode | JSXElement | string | number | boolean | null | undefined, props?: Record<string, unknown>, options?: {
|
|
134
134
|
seed?: number;
|
|
135
|
-
data?: SSRData;
|
|
135
|
+
data?: SSRData;
|
|
136
|
+
/** @internal A composed page render envelope. */
|
|
136
137
|
envelope?: PageRenderEnvelope;
|
|
137
138
|
cspNonce?: string;
|
|
138
139
|
}): string;
|
package/dist/ssr/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { u as SSRDataMissingError } from "../render-context-Clw3rFiO.js";
|
|
2
|
-
import { a as renderResolvedToStringSync, c as createRenderContext, d as withRenderContextAsync, i as renderRouteRequestToString, l as getRenderContext, n as renderToString, o as renderToStringSync, r as renderRouteRequest, s as resolveRequest, t as renderToStream, u as withRenderContext } from "../ssr-
|
|
2
|
+
import { a as renderResolvedToStringSync, c as createRenderContext, d as withRenderContextAsync, i as renderRouteRequestToString, l as getRenderContext, n as renderToString, o as renderToStringSync, r as renderRouteRequest, s as resolveRequest, t as renderToStream, u as withRenderContext } from "../ssr-vE-KUgDV.js";
|
|
3
3
|
export { SSRDataMissingError, createRenderContext, getRenderContext, renderResolvedToStringSync, renderRouteRequest, renderRouteRequestToString, renderToStream, renderToString, renderToStringSync, resolveRequest, withRenderContext, withRenderContextAsync };
|
|
@@ -2,19 +2,20 @@ import { t as __CONTROL_BOUNDARY__ } from "./control-DhFRTIoE.js";
|
|
|
2
2
|
import { t as __ERROR_BOUNDARY__ } from "./vnode-D24p6IW2.js";
|
|
3
3
|
import { v as logger } from "./access-ePqdQqkV.js";
|
|
4
4
|
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-CUpRxrLH.js";
|
|
5
|
-
import {
|
|
5
|
+
import { f as getExecutionContextFrame, l as callWithContext, m as markVNodeTreeWithContextFrame, n as createComponentInstance, p as getVNodeContextFrame } from "./component-internal-CPjM4n8M.js";
|
|
6
6
|
import { f as getCurrentComponentInstance, w as setCurrentComponentInstance } from "./component-scope-CC3cojX9.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { t as cleanupComponent } from "./component-cleanup-1ZFoLLHt.js";
|
|
8
|
+
import { p as isPromiseLike } from "./lifecycle-batch-COgl8jMS.js";
|
|
9
|
+
import { g as evaluateShowState, h as evaluateCaseState, i as evaluateForState, o as rollbackForStateTransaction, r as commitForStateTransaction } from "./for-internal-BtK9Htl0.js";
|
|
10
|
+
import { _ as isPageRenderEnvelope, g as isEmptyPageRenderEnvelope, h as createPageRenderEnvelope, i as isDeferred, l as createRouteRegistry, m as resolveRouteRequest, t as DEFERRED_BOUNDARY } from "./deferred-zHtUheIQ.js";
|
|
10
11
|
import { c as stopRenderPhase$1, o as startRenderPhase$1, t as configureRenderContextProvider, u as SSRDataMissingError } from "./render-context-Clw3rFiO.js";
|
|
11
|
-
import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-
|
|
12
|
+
import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-D7TC986A.js";
|
|
12
13
|
import { t as getPublicAttributeName } from "./attr-names-CjhzmHOn.js";
|
|
13
|
-
import { r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-
|
|
14
|
+
import { r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-HGZ0vbqT.js";
|
|
14
15
|
import { t as createDataRuntime } from "./data-runtime-SJ1BSUvk.js";
|
|
15
16
|
import { c as withTelemetry, i as dehydrateDataRuntime, t as createQueryPrefetchContext } from "./query-registry-CQIT4mXr.js";
|
|
16
|
-
import { a as resolveRouteFromRoutes, t as _resolveRouteMatchFromRoutes } from "./route-matching-
|
|
17
|
-
import { a as route } from "./authoring-
|
|
17
|
+
import { a as resolveRouteFromRoutes, t as _resolveRouteMatchFromRoutes } from "./route-matching-DLBWDeXX.js";
|
|
18
|
+
import { a as route } from "./authoring-uaJ556aG.js";
|
|
18
19
|
import { n as renderDocument, t as SSR_RENDER_DATA_ATTR } from "./ssr-CbQO5xd3.js";
|
|
19
20
|
//#region src/ssr/escape.ts
|
|
20
21
|
/**
|
|
@@ -359,23 +360,14 @@ function routeHasSSRLoader(manifest, route) {
|
|
|
359
360
|
});
|
|
360
361
|
}
|
|
361
362
|
function resolvePolicyAwareSSRRoute(opts, routeTable) {
|
|
362
|
-
const manifest = opts.registry
|
|
363
|
-
if (!manifest) {
|
|
364
|
-
const matched = _resolveRouteMatchFromRoutes(new URL(opts.url, "http://localhost").pathname, routeTable);
|
|
365
|
-
if (!matched) throw new Error(`SSR: no route found for url: ${opts.url}`);
|
|
366
|
-
return {
|
|
367
|
-
url: opts.url,
|
|
368
|
-
route: matched.route,
|
|
369
|
-
params: matched.params
|
|
370
|
-
};
|
|
371
|
-
}
|
|
363
|
+
const manifest = opts.registry.manifest;
|
|
372
364
|
let href = opts.url;
|
|
373
365
|
const visited = /* @__PURE__ */ new Set();
|
|
374
366
|
for (let redirects = 0; redirects <= MAX_SSR_REDIRECTS; redirects += 1) {
|
|
375
367
|
const matched = _resolveRouteMatchFromRoutes(new URL(href, "http://localhost").pathname, routeTable);
|
|
376
368
|
if (!matched) throw new Error(`SSR: no route found for url: ${href}`);
|
|
377
369
|
const resolved = getRouteRequestResultSync(resolveRouteRequest(href, {
|
|
378
|
-
|
|
370
|
+
registry: opts.registry,
|
|
379
371
|
mode: "ssr"
|
|
380
372
|
}));
|
|
381
373
|
if (resolved === null) throw new Error(`SSR: no route found for url: ${href}`);
|
|
@@ -493,7 +485,7 @@ async function resolveRequest(opts) {
|
|
|
493
485
|
if (!opts?.registry) throw new TypeError("resolveRequest requires opts.registry.");
|
|
494
486
|
const { url, auth, authContext, request, signal } = opts;
|
|
495
487
|
return await resolveRouteRequest(url, {
|
|
496
|
-
|
|
488
|
+
registry: opts.registry,
|
|
497
489
|
mode: "ssr",
|
|
498
490
|
auth,
|
|
499
491
|
authContext,
|
|
@@ -1390,7 +1382,7 @@ async function renderRouteRequestInternal(options) {
|
|
|
1390
1382
|
});
|
|
1391
1383
|
return withTelemetry(options.telemetry?.ssrRender, {}, () => withRenderContextAsync(context, async () => {
|
|
1392
1384
|
const resolved = await resolveRouteRequest(options.url, {
|
|
1393
|
-
|
|
1385
|
+
registry: options.registry,
|
|
1394
1386
|
mode: "ssr",
|
|
1395
1387
|
auth: options.auth ?? manifest.auth,
|
|
1396
1388
|
authContext: options.authContext,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { x as isProductionEnvironment } from "./access-ePqdQqkV.js";
|
|
2
|
-
import {
|
|
2
|
+
import { t as isBulkCommitActive } from "./fastlane-BTcFCMnm.js";
|
|
3
|
+
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-BYSoWJSv.js";
|
|
3
4
|
import { i as claimHookIndex, p as getCurrentInstance } from "./component-scope-CC3cojX9.js";
|
|
4
5
|
//#region src/runtime/state.ts
|
|
5
6
|
/**
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { C as Query, k as QueryStaleReason } from "../index-Bki2rqcr.js";
|
|
2
|
-
import { N as RouteRegistry, x as RouteMatch } from "../router-
|
|
3
|
-
|
|
2
|
+
import { N as RouteRegistry, x as RouteMatch } from "../router-C0XQA62W.js";
|
|
4
3
|
//#region src/testing/index.d.ts
|
|
5
4
|
type MockRefresh = () => void | Promise<void>;
|
|
6
5
|
interface MockQueryOptions {
|
package/dist/testing/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as addInvalidationListener } from "../invalidation-listeners-Des3AHYs.js";
|
|
2
|
-
import { r as computeRouteActivityMatches } from "../route-matching-
|
|
2
|
+
import { r as computeRouteActivityMatches } from "../route-matching-DLBWDeXX.js";
|
|
3
3
|
//#region src/testing/index.ts
|
|
4
4
|
function normalizeRefresh(options) {
|
|
5
5
|
return async () => {
|
|
@@ -116,7 +116,7 @@ function createInvalidationRecorder() {
|
|
|
116
116
|
}
|
|
117
117
|
function matchRoute(path, options) {
|
|
118
118
|
if (!options?.registry) throw new TypeError("matchRoute requires options.registry.");
|
|
119
|
-
return computeRouteActivityMatches(path, {
|
|
119
|
+
return computeRouteActivityMatches(path, { registry: options.registry })[0] ?? null;
|
|
120
120
|
}
|
|
121
121
|
function getRoutePatternRecords(options) {
|
|
122
122
|
if (!options?.registry) throw new TypeError("getRouteWarnings requires options.registry.");
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { o as KnownIntrinsicElementProps, r as JSXElement, s as Props } from "./jsx-Dvr2SGRG.js";
|
|
2
|
+
//#region src/jsx/types.d.ts
|
|
3
|
+
declare global {
|
|
4
|
+
namespace JSX {
|
|
5
|
+
interface Element extends JSXElement {
|
|
6
|
+
readonly __askrJsxElementBrand?: never;
|
|
7
|
+
}
|
|
8
|
+
interface IntrinsicElements {
|
|
9
|
+
a: KnownIntrinsicElementProps['a'];
|
|
10
|
+
article: KnownIntrinsicElementProps['article'];
|
|
11
|
+
aside: KnownIntrinsicElementProps['aside'];
|
|
12
|
+
blockquote: KnownIntrinsicElementProps['blockquote'];
|
|
13
|
+
button: KnownIntrinsicElementProps['button'];
|
|
14
|
+
caption: KnownIntrinsicElementProps['caption'];
|
|
15
|
+
circle: KnownIntrinsicElementProps['circle'];
|
|
16
|
+
code: KnownIntrinsicElementProps['code'];
|
|
17
|
+
div: KnownIntrinsicElementProps['div'];
|
|
18
|
+
em: KnownIntrinsicElementProps['em'];
|
|
19
|
+
figcaption: KnownIntrinsicElementProps['figcaption'];
|
|
20
|
+
figure: KnownIntrinsicElementProps['figure'];
|
|
21
|
+
form: KnownIntrinsicElementProps['form'];
|
|
22
|
+
footer: KnownIntrinsicElementProps['footer'];
|
|
23
|
+
g: KnownIntrinsicElementProps['g'];
|
|
24
|
+
h1: KnownIntrinsicElementProps['h1'];
|
|
25
|
+
h2: KnownIntrinsicElementProps['h2'];
|
|
26
|
+
h3: KnownIntrinsicElementProps['h3'];
|
|
27
|
+
h4: KnownIntrinsicElementProps['h4'];
|
|
28
|
+
h5: KnownIntrinsicElementProps['h5'];
|
|
29
|
+
h6: KnownIntrinsicElementProps['h6'];
|
|
30
|
+
header: KnownIntrinsicElementProps['header'];
|
|
31
|
+
img: KnownIntrinsicElementProps['img'];
|
|
32
|
+
input: KnownIntrinsicElementProps['input'];
|
|
33
|
+
label: KnownIntrinsicElementProps['label'];
|
|
34
|
+
li: KnownIntrinsicElementProps['li'];
|
|
35
|
+
main: KnownIntrinsicElementProps['main'];
|
|
36
|
+
nav: KnownIntrinsicElementProps['nav'];
|
|
37
|
+
ol: KnownIntrinsicElementProps['ol'];
|
|
38
|
+
option: KnownIntrinsicElementProps['option'];
|
|
39
|
+
p: KnownIntrinsicElementProps['p'];
|
|
40
|
+
path: KnownIntrinsicElementProps['path'];
|
|
41
|
+
pre: KnownIntrinsicElementProps['pre'];
|
|
42
|
+
select: KnownIntrinsicElementProps['select'];
|
|
43
|
+
section: KnownIntrinsicElementProps['section'];
|
|
44
|
+
span: KnownIntrinsicElementProps['span'];
|
|
45
|
+
strong: KnownIntrinsicElementProps['strong'];
|
|
46
|
+
svg: KnownIntrinsicElementProps['svg'];
|
|
47
|
+
table: KnownIntrinsicElementProps['table'];
|
|
48
|
+
tbody: KnownIntrinsicElementProps['tbody'];
|
|
49
|
+
td: KnownIntrinsicElementProps['td'];
|
|
50
|
+
textarea: KnownIntrinsicElementProps['textarea'];
|
|
51
|
+
th: KnownIntrinsicElementProps['th'];
|
|
52
|
+
thead: KnownIntrinsicElementProps['thead'];
|
|
53
|
+
tr: KnownIntrinsicElementProps['tr'];
|
|
54
|
+
ul: KnownIntrinsicElementProps['ul'];
|
|
55
|
+
}
|
|
56
|
+
interface ElementAttributesProperty {
|
|
57
|
+
props: Props;
|
|
58
|
+
}
|
|
59
|
+
interface ElementChildrenAttribute {
|
|
60
|
+
children: unknown;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as SSR_RENDER_DATA_ATTR } from "./ssr-CbQO5xd3.js";
|
|
2
|
-
import { a as renderResolvedToStringSync } from "./ssr-
|
|
2
|
+
import { a as renderResolvedToStringSync } from "./ssr-vE-KUgDV.js";
|
|
3
3
|
//#region src/ssr/verify-hydration.ts
|
|
4
4
|
function normalizeHydrationHtml(html) {
|
|
5
5
|
const template = document.createElement("template");
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
//#region src/router/navigation-scroll.d.ts
|
|
2
|
-
type NavigationScrollBehavior = 'top' | 'preserve';
|
|
3
|
-
type HistoryScrollBehavior = 'restore' | 'top' | 'preserve';
|
|
4
|
-
type ScrollRestorationOptions = {
|
|
5
|
-
navigation?: NavigationScrollBehavior;
|
|
6
|
-
history?: HistoryScrollBehavior;
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/router/navigation-targets.d.ts
|
|
10
|
-
type NavigateOptions = {
|
|
11
|
-
history?: 'push' | 'replace';
|
|
12
|
-
replace?: boolean;
|
|
13
|
-
scroll?: NavigationScrollBehavior;
|
|
14
|
-
};
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/router/route-query.d.ts
|
|
17
|
-
type RouteQueryParamValue = string | number | boolean | null | undefined;
|
|
18
|
-
type RouteQueryParamInput = RouteQueryParamValue | readonly RouteQueryParamValue[];
|
|
19
|
-
type RouteQueryUpdates = Record<string, RouteQueryParamInput>;
|
|
20
|
-
type RouteQueryUpdater = (searchParams: URLSearchParams) => void;
|
|
21
|
-
type UpdateRouteQueryOptions = {
|
|
22
|
-
/**
|
|
23
|
-
* Defaults to replace so high-frequency controls such as search inputs do not
|
|
24
|
-
* create one browser-history entry per character.
|
|
25
|
-
*/
|
|
26
|
-
history?: 'push' | 'replace';
|
|
27
|
-
replace?: boolean;
|
|
28
|
-
};
|
|
29
|
-
declare function updateRouteQuery(updates: RouteQueryUpdates | RouteQueryUpdater, options?: UpdateRouteQueryOptions): void;
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/router/navigate.d.ts
|
|
32
|
-
declare function navigate(path: string, options?: NavigateOptions): void;
|
|
33
|
-
//#endregion
|
|
34
|
-
export { RouteQueryUpdates as a, NavigateOptions as c, ScrollRestorationOptions as d, RouteQueryUpdater as i, HistoryScrollBehavior as l, RouteQueryParamInput as n, UpdateRouteQueryOptions as o, RouteQueryParamValue as r, updateRouteQuery as s, navigate as t, NavigationScrollBehavior as u };
|
package/dist/types-4k3RFEaC.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { a as IntrinsicFallbackProps, o as KnownIntrinsicElementProps, r as JSXElement, s as Props } from "./jsx-Dvr2SGRG.js";
|
|
2
|
-
|
|
3
|
-
//#region src/jsx/types.d.ts
|
|
4
|
-
declare global {
|
|
5
|
-
namespace JSX {
|
|
6
|
-
interface Element extends JSXElement {
|
|
7
|
-
readonly __askrJsxElementBrand?: never;
|
|
8
|
-
}
|
|
9
|
-
interface IntrinsicElements extends KnownIntrinsicElementProps {
|
|
10
|
-
[elem: string]: IntrinsicFallbackProps | KnownIntrinsicElementProps[keyof KnownIntrinsicElementProps];
|
|
11
|
-
}
|
|
12
|
-
interface ElementAttributesProperty {
|
|
13
|
-
props: Props;
|
|
14
|
-
}
|
|
15
|
-
interface ElementChildrenAttribute {
|
|
16
|
-
children: unknown;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|