@askrjs/askr 0.0.83 → 0.0.85
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/{access-ePqdQqkV.js → access-Dpfoi4cA.js} +7 -1
- package/dist/actions/index.d.ts +1 -1
- package/dist/actions/index.js +1 -1
- package/dist/{activity-CXEaU-Al.d.ts → activity-B1I5HJQI.d.ts} +1 -1
- package/dist/{activity-CnSRFO3d.js → activity-Jd9CgEa3.js} +52 -15
- package/dist/{authoring-DbGEgg40.js → authoring-DdQ3pHqt.js} +6 -3
- package/dist/benchmark.js +8 -8
- package/dist/boot/index.d.ts +3 -3
- package/dist/boot/index.js +1 -1
- package/dist/{boot-uK1hzONI.js → boot-DWe880Et.js} +16 -15
- package/dist/{cleanup-CEF-cX49.js → cleanup-c837KVij.js} +17 -7
- package/dist/{component-cleanup-oWN45rfa.js → component-cleanup-BUfUleGZ.js} +2 -2
- package/dist/{component-internal-DsM75Gl1.js → component-internal-DcrLymUJ.js} +9 -6
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/control/index.d.ts +1 -1
- package/dist/control/index.js +1 -1
- package/dist/{control-Cix3yjVf.d.ts → control-DhUZU4_V.d.ts} +2 -1
- package/dist/{control-C0X1zgrM.js → control-oLADku43.js} +4 -4
- package/dist/{csp-nonce-DDt0UNdt.js → csp-nonce-Bc52OIVc.js} +19 -2
- package/dist/data/index.js +1 -1
- package/dist/{data-G0hURNm_.js → data-Dkqb8_QP.js} +3 -3
- package/dist/{deferred-rdHAgyKe.js → deferred-vUOy-awa.js} +198 -16
- package/dist/{effect-2IIWvUjG.js → effect-lnxQIpJG.js} +2 -2
- package/dist/{fastlane-CkBXZ_3K.js → fastlane-CrfB3QG0.js} +2 -2
- package/dist/{for-internal-DRbV0h1d.js → for-internal-B_mnQhan.js} +55 -22
- package/dist/foundations/index.d.ts +1 -1
- package/dist/foundations/index.js +2 -2
- package/dist/foundations/state/index.d.ts +1 -1
- package/dist/foundations/state/index.js +1 -1
- package/dist/foundations/structures/index.d.ts +2 -2
- package/dist/foundations/structures/index.js +3 -3
- package/dist/fx/index.js +1 -1
- package/dist/{index-Vs1EeWEr.d.ts → index-Bkh9S9-t.d.ts} +6 -2
- package/dist/{index-TlEvex-C.d.ts → index-pIgGaXvS.d.ts} +21 -4
- package/dist/{index-ho0Htetw.d.ts → index-r-nt13FE.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -10
- package/dist/{lifecycle-batch-CwHCDseR.js → lifecycle-batch-Dfpid9-A.js} +45 -24
- package/dist/{lifecycle-operations-BJfxWUJr.js → lifecycle-operations-BrYrBsXY.js} +1 -1
- package/dist/{navigate-DfY1BUYc.d.ts → navigate-NyIjQUwI.d.ts} +1 -1
- package/dist/{navigate-Crvd5gUG.js → navigate-b4GGxO_l.js} +15 -14
- package/dist/{portal-BZ_rN17v.js → portal-BVWjAhNQ.js} +5 -5
- package/dist/{readable-B3VIOfd7.js → readable-B5NtV7V0.js} +3 -3
- package/dist/{renderer-VSw0KKDG.js → renderer-CZzNtoj2.js} +3355 -2813
- package/dist/resources/index.d.ts +2 -2
- package/dist/resources/index.js +5 -5
- package/dist/{route-matching-BUwz4kfl.js → route-matching-DHduNiGk.js} +49 -6
- package/dist/router/index.d.ts +7 -7
- package/dist/router/index.js +9 -7
- package/dist/{selector-DVwvof1M.js → selector-Ck_Pp9av.js} +2 -2
- package/dist/ssg/index.d.ts +10 -4
- package/dist/ssg/index.js +30 -15
- package/dist/ssr/index.d.ts +7 -3
- package/dist/ssr/index.js +1 -1
- package/dist/{ssr-C_Ql5_Kg.js → ssr-CpiBHMNv.js} +40 -26
- package/dist/ssr-DSHd_Q9K.js +25 -0
- package/dist/{state-BCl9DeiN.js → state-DCjONcHK.js} +4 -3
- package/dist/{structures-D3vO-WMN.js → structures-DSLF_iis.js} +4 -2
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +3 -3
- package/dist/{verify-hydration-CNLXUcuR.js → verify-hydration-C3QBBQqR.js} +2 -2
- package/package.json +3 -3
- package/dist/ssr-CbQO5xd3.js +0 -12
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { a as clearCurrentComponentScope, y as restoreCurrentComponentScope } from "./component-scope-DzJEbYGE.js";
|
|
1
2
|
//#region src/common/env.ts
|
|
2
3
|
function normalizeEnv(source) {
|
|
3
4
|
if (!source) return {};
|
|
@@ -471,7 +472,12 @@ function enqueueRuntimeLane(lane, task) {
|
|
|
471
472
|
getRuntimeScheduler().enqueueInLane(lane, task);
|
|
472
473
|
}
|
|
473
474
|
function runRuntimeHandlerScope(fn, flushMode = "defer") {
|
|
474
|
-
|
|
475
|
+
const savedScope = clearCurrentComponentScope();
|
|
476
|
+
try {
|
|
477
|
+
return getRuntimeScheduler().runInHandlerScope(fn, flushMode);
|
|
478
|
+
} finally {
|
|
479
|
+
restoreCurrentComponentScope(savedScope);
|
|
480
|
+
}
|
|
475
481
|
}
|
|
476
482
|
function runRuntimeWithSyncProgress(fn) {
|
|
477
483
|
return getRuntimeScheduler().runWithSyncProgress(fn);
|
package/dist/actions/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as action, i as ActionValidationError, n as ActionForm, o as defineAction, r as ActionStatus, t as ActionDescriptor } from "../index-
|
|
1
|
+
import { a as action, i as ActionValidationError, n as ActionForm, o as defineAction, r as ActionStatus, t as ActionDescriptor } from "../index-pIgGaXvS.js";
|
|
2
2
|
export { ActionDescriptor, ActionForm, ActionStatus, ActionValidationError, action, defineAction };
|
package/dist/actions/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as getCurrentAppRenderRuntime } from "../component-scope-DzJEbYGE.js";
|
|
2
2
|
import { r as getCurrentRenderData } from "../render-context-D-DFk2WN.js";
|
|
3
|
-
import { t as state } from "../state-
|
|
3
|
+
import { t as state } from "../state-DCjONcHK.js";
|
|
4
4
|
import { jsx, jsxs } from "../jsx-runtime.js";
|
|
5
5
|
import { c as resolveDataRuntimeState, s as invalidateQueriesForRuntime } from "../data-runtime-D68YOo9L.js";
|
|
6
6
|
//#region src/actions/runtime.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as registerCommitOperation } from "./component-internal-DsM75Gl1.js";
|
|
2
|
-
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-B3VIOfd7.js";
|
|
3
1
|
import { d as getCurrentAppRenderRuntime, f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-DzJEbYGE.js";
|
|
2
|
+
import { a as registerCommitOperation } from "./component-internal-DcrLymUJ.js";
|
|
3
|
+
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-B5NtV7V0.js";
|
|
4
4
|
import { n as getActiveRenderContext } from "./render-context-D-DFk2WN.js";
|
|
5
|
-
import { c as
|
|
5
|
+
import { b as getActiveRoutes, c as removeRouteBasePath, d as deepFreeze, f as makeQuery, n as computeMatchesFromRoutes, p as parseLocation, y as getActiveRouteBasePath } from "./route-matching-DHduNiGk.js";
|
|
6
6
|
import { n as syncRouteActivitySnapshot } from "./route-activity-CNJfpwx-.js";
|
|
7
7
|
//#region src/common/app-render-runtime.ts
|
|
8
8
|
const stagedRouteLocations = /* @__PURE__ */ new WeakMap();
|
|
@@ -79,18 +79,34 @@ function onRouteChange(fn, options = {}) {
|
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
let serverLocation = null;
|
|
82
|
+
function logicalRoutePathname(pathname) {
|
|
83
|
+
const logical = removeRouteBasePath(pathname, getActiveRouteBasePath());
|
|
84
|
+
return logical === void 0 ? void 0 : parseLocation(logical).pathname;
|
|
85
|
+
}
|
|
86
|
+
function routePathname(pathname) {
|
|
87
|
+
const logical = logicalRoutePathname(pathname);
|
|
88
|
+
return logical === void 0 ? {
|
|
89
|
+
pathname: parseLocation(pathname).pathname,
|
|
90
|
+
withinBasePath: false
|
|
91
|
+
} : {
|
|
92
|
+
pathname: logical,
|
|
93
|
+
withinBasePath: true
|
|
94
|
+
};
|
|
95
|
+
}
|
|
82
96
|
function setServerLocation(url) {
|
|
83
97
|
serverLocation = url;
|
|
84
98
|
if (url) {
|
|
85
|
-
const
|
|
86
|
-
syncRouteActivitySnapshot(
|
|
99
|
+
const location = routePathname(parseLocation(url).pathname);
|
|
100
|
+
syncRouteActivitySnapshot(location.pathname, location.withinBasePath ? computeMatchesFromRoutes(location.pathname, getActiveRoutes()) : []);
|
|
87
101
|
return;
|
|
88
102
|
}
|
|
89
103
|
syncRouteActivitySnapshot(currentRouteSnapshot.path, currentRouteSnapshot.matches);
|
|
90
104
|
}
|
|
91
105
|
function buildRouteSnapshot(pathname, search, hash) {
|
|
106
|
+
const location = routePathname(pathname);
|
|
107
|
+
pathname = location.pathname;
|
|
92
108
|
const query = makeQuery(search);
|
|
93
|
-
const matches = computeMatchesFromRoutes(pathname, getActiveRoutes());
|
|
109
|
+
const matches = location.withinBasePath ? computeMatchesFromRoutes(pathname, getActiveRoutes()) : [];
|
|
94
110
|
return Object.freeze({
|
|
95
111
|
path: pathname,
|
|
96
112
|
params: deepFreeze({ ...matches[0]?.params }),
|
|
@@ -101,7 +117,7 @@ function buildRouteSnapshot(pathname, search, hash) {
|
|
|
101
117
|
}
|
|
102
118
|
function setCurrentRouteSnapshot(pathname, search, hash, activityMatches) {
|
|
103
119
|
currentRouteSnapshot = buildRouteSnapshot(pathname, search, hash);
|
|
104
|
-
syncRouteActivitySnapshot(
|
|
120
|
+
syncRouteActivitySnapshot(currentRouteSnapshot.path, activityMatches ?? currentRouteSnapshot.matches);
|
|
105
121
|
const instance = getCurrentComponentInstance();
|
|
106
122
|
markReadableDerivedSubscribersDirty(currentRouteSource);
|
|
107
123
|
markReactivePropsDirtySource(currentRouteSource);
|
|
@@ -109,27 +125,48 @@ function setCurrentRouteSnapshot(pathname, search, hash, activityMatches) {
|
|
|
109
125
|
}
|
|
110
126
|
function readCurrentRouteLocation() {
|
|
111
127
|
const renderContext = getActiveRenderContext();
|
|
112
|
-
if (renderContext?.url)
|
|
128
|
+
if (renderContext?.url) {
|
|
129
|
+
const parsed = parseLocation(renderContext.url);
|
|
130
|
+
const location = routePathname(parsed.pathname);
|
|
131
|
+
return {
|
|
132
|
+
...parsed,
|
|
133
|
+
...location
|
|
134
|
+
};
|
|
135
|
+
}
|
|
113
136
|
const stagedRouteLocation = getStagedAppRenderRouteLocation(getCurrentAppRenderRuntime());
|
|
114
|
-
if (stagedRouteLocation)
|
|
137
|
+
if (stagedRouteLocation) {
|
|
138
|
+
const parsed = parseLocation(stagedRouteLocation);
|
|
139
|
+
const location = routePathname(parsed.pathname);
|
|
140
|
+
return {
|
|
141
|
+
...parsed,
|
|
142
|
+
...location
|
|
143
|
+
};
|
|
144
|
+
}
|
|
115
145
|
if (typeof window !== "undefined" && window.location) return {
|
|
116
|
-
|
|
146
|
+
...routePathname(window.location.pathname || "/"),
|
|
117
147
|
search: window.location.search || "",
|
|
118
148
|
hash: window.location.hash || ""
|
|
119
149
|
};
|
|
120
|
-
if (serverLocation)
|
|
150
|
+
if (serverLocation) {
|
|
151
|
+
const parsed = parseLocation(serverLocation);
|
|
152
|
+
const location = routePathname(parsed.pathname);
|
|
153
|
+
return {
|
|
154
|
+
...parsed,
|
|
155
|
+
...location
|
|
156
|
+
};
|
|
157
|
+
}
|
|
121
158
|
return {
|
|
122
|
-
|
|
159
|
+
...routePathname(currentRouteSnapshot.path),
|
|
123
160
|
search: "",
|
|
124
161
|
hash: currentRouteSnapshot.hash ?? ""
|
|
125
162
|
};
|
|
126
163
|
}
|
|
127
164
|
function readCurrentRouteSnapshot() {
|
|
128
165
|
if (!getCurrentComponentInstance()) throw new Error("currentRoute() can only be called during component render execution. Call currentRoute() from inside your component function.");
|
|
129
|
-
const { pathname, search, hash } = readCurrentRouteLocation();
|
|
166
|
+
const { pathname, search, hash, withinBasePath } = readCurrentRouteLocation();
|
|
130
167
|
const query = makeQuery(search);
|
|
131
|
-
const matches = computeMatchesFromRoutes(pathname, getActiveRoutes());
|
|
132
|
-
const params = deepFreeze({ ...getActiveRenderContext()?.params ?? matches[0]?.params ?? {} });
|
|
168
|
+
const matches = withinBasePath ? computeMatchesFromRoutes(pathname, getActiveRoutes()) : [];
|
|
169
|
+
const params = deepFreeze({ ...(withinBasePath ? getActiveRenderContext()?.params : void 0) ?? matches[0]?.params ?? {} });
|
|
133
170
|
return Object.freeze({
|
|
134
171
|
path: pathname,
|
|
135
172
|
params,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { f as getCurrentComponentInstance } from "./component-scope-DzJEbYGE.js";
|
|
2
|
-
import {
|
|
3
|
-
import { A as
|
|
2
|
+
import { A as getExecutionModel, T as createRouteHandler } from "./deferred-vUOy-awa.js";
|
|
3
|
+
import { A as getDefaultRouteBasePath, C as getCurrentInheritedPolicies, D as getCurrentPathPrefix, E as getCurrentPageScope, F as insertRecordSorted, H as computeRank, L as pushRegistrationScope, N as hasActivePageScope, O as getCurrentScopeKind, S as getCurrentInheritedMeta, T as getCurrentPageChain, U as normalizeRouteSegmentName, W as parseSegments, g as assertRouteRegistrationUnlocked, h as addRouteToStores, w as getCurrentLayoutChain, x as getCurrentInheritedAuthRequirements } from "./route-matching-DHduNiGk.js";
|
|
4
4
|
import { allOf } from "@askrjs/auth";
|
|
5
5
|
//#region src/router/access.ts
|
|
6
6
|
function compileNodePolicies(node) {
|
|
@@ -92,11 +92,13 @@ function pushPageScope(path, Component, options, fn) {
|
|
|
92
92
|
function normalizeRouteOptions(options) {
|
|
93
93
|
if (!options) return;
|
|
94
94
|
const loader = options.loader;
|
|
95
|
+
const dehydrate = options.dehydrate;
|
|
95
96
|
const preload = options.preload;
|
|
96
97
|
const policies = compileNodePolicies(options);
|
|
97
|
-
if (!loader && !preload && !options.entries && policies.length === 0 && !options.title && !options.namespace && !options.search && !options.meta && !options.actions && options.auth === void 0) return;
|
|
98
|
+
if (!loader && !dehydrate && !preload && !options.entries && policies.length === 0 && !options.title && !options.namespace && !options.search && !options.meta && !options.actions && options.auth === void 0) return;
|
|
98
99
|
return {
|
|
99
100
|
...loader ? { loader } : {},
|
|
101
|
+
...dehydrate ? { dehydrate } : {},
|
|
100
102
|
...preload ? { preload } : {},
|
|
101
103
|
...options.entries ? { entries: options.entries } : {},
|
|
102
104
|
...options.auth !== void 0 ? { auth: options.auth } : {},
|
|
@@ -193,6 +195,7 @@ function route(path, Component, options) {
|
|
|
193
195
|
registerRouteAtResolvedPath(resolveRouteRegistrationPath(path), Component, options);
|
|
194
196
|
return Object.freeze({
|
|
195
197
|
path: resolveRouteRegistrationPath(path),
|
|
198
|
+
...getDefaultRouteBasePath() ? { basePath: getDefaultRouteBasePath() } : {},
|
|
196
199
|
...options?.search ? { searchSchema: options.search } : {}
|
|
197
200
|
});
|
|
198
201
|
}
|
package/dist/benchmark.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { r as flushRuntimeScheduler } from "./access-
|
|
2
|
-
import { t as installRendererBridge } from "./renderer-
|
|
3
|
-
import { t as state } from "./state-
|
|
4
|
-
import { t as selector } from "./selector-
|
|
5
|
-
import { i as For } from "./control-
|
|
1
|
+
import { r as flushRuntimeScheduler } from "./access-Dpfoi4cA.js";
|
|
2
|
+
import { t as installRendererBridge } from "./renderer-CZzNtoj2.js";
|
|
3
|
+
import { t as state } from "./state-DCjONcHK.js";
|
|
4
|
+
import { t as selector } from "./selector-Ck_Pp9av.js";
|
|
5
|
+
import { i as For } from "./control-oLADku43.js";
|
|
6
6
|
import { jsx, jsxs } from "./jsx-runtime.js";
|
|
7
|
-
import { t as createIsland } from "./boot-
|
|
7
|
+
import { t as createIsland } from "./boot-DWe880Et.js";
|
|
8
8
|
//#region src/bench/components/benchmark-row.tsx
|
|
9
9
|
function BenchmarkRow({ item, isSelected, onSelect, onRemove }) {
|
|
10
10
|
return /* @__PURE__ */ jsxs("tr", {
|
|
@@ -63,8 +63,8 @@ function BenchmarkTable({ rows, isSelected, onSelect, onRemove }) {
|
|
|
63
63
|
installRendererBridge();
|
|
64
64
|
const benchmarkMetadata = {
|
|
65
65
|
packageName: "@askrjs/askr",
|
|
66
|
-
packageVersion: "0.0.
|
|
67
|
-
buildLabel: "0.0.
|
|
66
|
+
packageVersion: "0.0.85",
|
|
67
|
+
buildLabel: "0.0.85-local"
|
|
68
68
|
};
|
|
69
69
|
function getBenchmarkMetadata() {
|
|
70
70
|
return { ...benchmarkMetadata };
|
package/dist/boot/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { W as RouteRegistry, w as RouteAuthOptions } from "../index-
|
|
1
|
+
import { l as ComponentFunction } from "../control-DhUZU4_V.js";
|
|
2
|
+
import { W as RouteRegistry, w as RouteAuthOptions } from "../index-pIgGaXvS.js";
|
|
3
3
|
import { v as DataRuntime } from "../index-5S-fi2xy.js";
|
|
4
|
-
import { a as ScrollRestorationOptions } from "../navigate-
|
|
4
|
+
import { a as ScrollRestorationOptions } from "../navigate-NyIjQUwI.js";
|
|
5
5
|
//#region src/boot/types.d.ts
|
|
6
6
|
type IslandConfig = {
|
|
7
7
|
root: Element | string;
|
package/dist/boot/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as cleanupApp, i as hydrateSPA, n as createIslands, o as hasApp, r as createSPA, t as createIsland } from "../boot-
|
|
1
|
+
import { a as cleanupApp, i as hydrateSPA, n as createIslands, o as hasApp, r as createSPA, t as createIsland } from "../boot-DWe880Et.js";
|
|
2
2
|
export { cleanupApp, createIsland, createIslands, createSPA, hasApp, hydrateSPA };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { b as isDevelopmentEnvironment, r as flushRuntimeScheduler, v as logger, x as isProductionEnvironment } from "./access-
|
|
1
|
+
import { b as isDevelopmentEnvironment, r as flushRuntimeScheduler, v as logger, x as isProductionEnvironment } from "./access-Dpfoi4cA.js";
|
|
2
2
|
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-C3IECePB.js";
|
|
3
|
-
import { n as createComponentInstance, r as executeComponent } from "./component-internal-
|
|
4
|
-
import { t as cleanupComponent } from "./component-cleanup-
|
|
5
|
-
import { p as isPromiseLike } from "./lifecycle-batch-
|
|
6
|
-
import { a as
|
|
7
|
-
import { _ as teardownNodeSubtree, d as removeAllListeners } from "./cleanup-
|
|
8
|
-
import {
|
|
3
|
+
import { n as createComponentInstance, r as executeComponent } from "./component-internal-DcrLymUJ.js";
|
|
4
|
+
import { t as cleanupComponent } from "./component-cleanup-BUfUleGZ.js";
|
|
5
|
+
import { p as isPromiseLike } from "./lifecycle-batch-Dfpid9-A.js";
|
|
6
|
+
import { a as setStaticChildSlotsCacheEnabled, c as endHydrationDirectListenerMode, d as discardHydrationListenerTransaction, i as registerDeferredHydrationBoundary, l as beginHydrationListenerTransaction, n as activateHydrationBoundary$1, o as withIntrinsicHydrationAdoption, r as clearDeferredHydrationBoundaries, s as beginHydrationDirectListenerMode, t as installRendererBridge, u as commitHydrationListenerTransaction } from "./renderer-CZzNtoj2.js";
|
|
7
|
+
import { _ as teardownNodeSubtree, d as removeAllListeners } from "./cleanup-c837KVij.js";
|
|
8
|
+
import { S as pageRenderEnvelope, c as _applyManifest, d as getRouteRenderContext, f as getRouteRenderData, k as assertExecutionModel, m as resolveRouteRequest, o as reviveDeferredValue, p as hasRouteRenderData } from "./deferred-vUOy-awa.js";
|
|
9
9
|
import { c as stopHydrationRenderPhase, o as startHydrationRenderPhase } from "./render-context-D-DFk2WN.js";
|
|
10
|
-
import {
|
|
11
|
-
import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-
|
|
12
|
-
import { r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-
|
|
10
|
+
import { I as lockRouteRegistration, P as hasRegisteredRoutes, _ as clearRouteState, m as _setActiveRouteAuthOptions } from "./route-matching-DHduNiGk.js";
|
|
11
|
+
import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-BVWjAhNQ.js";
|
|
12
|
+
import { r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-Bc52OIVc.js";
|
|
13
13
|
import { i as getDefaultDataRuntime } from "./data-runtime-D68YOo9L.js";
|
|
14
14
|
import { a as hydrateDataRuntime } from "./query-registry-BL6rjGsO.js";
|
|
15
|
-
import { o as createAppRenderRuntime, r as setServerLocation } from "./activity-
|
|
16
|
-
import { f as registerAppInstance, g as unregisterAppInstance, i as resolveRouteMeta, o as configureScrollRestoration, r as reconcileRouteMeta, t as initializeNavigation } from "./navigate-
|
|
17
|
-
import "./ssr-
|
|
15
|
+
import { o as createAppRenderRuntime, r as setServerLocation } from "./activity-Jd9CgEa3.js";
|
|
16
|
+
import { f as registerAppInstance, g as unregisterAppInstance, i as resolveRouteMeta, o as configureScrollRestoration, r as reconcileRouteMeta, t as initializeNavigation } from "./navigate-b4GGxO_l.js";
|
|
17
|
+
import "./ssr-DSHd_Q9K.js";
|
|
18
18
|
//#region src/boot/hydration.ts
|
|
19
19
|
const DEFERRED_PAYLOAD = "__askr_deferred__";
|
|
20
20
|
function applyDeferredStreamPatches(rootElement) {
|
|
@@ -493,7 +493,8 @@ async function createSPA(config) {
|
|
|
493
493
|
};
|
|
494
494
|
_setActiveRouteAuthOptions(routeAuth);
|
|
495
495
|
if (isProductionEnvironment()) lockRouteRegistration();
|
|
496
|
-
const { path, resolved } = await resolveInitialRoute(routeAuth, { registry: config.registry });
|
|
496
|
+
const { path, href: currentUrl, resolved } = await resolveInitialRoute(routeAuth, { registry: config.registry });
|
|
497
|
+
setServerLocation(currentUrl);
|
|
497
498
|
const appRuntime = createAppRenderRuntime(resolved?.kind === "render" && hasRouteRenderData(resolved) ? {
|
|
498
499
|
route: getRouteRenderData(resolved),
|
|
499
500
|
hasRoute: true
|
|
@@ -585,7 +586,7 @@ async function hydrateSPA(config) {
|
|
|
585
586
|
cspNonce: config.cspNonce
|
|
586
587
|
}));
|
|
587
588
|
if (shouldVerifyHydrationMarkup(config)) {
|
|
588
|
-
const { verifyHydrationSyncForUrl } = await import("./verify-hydration-
|
|
589
|
+
const { verifyHydrationSyncForUrl } = await import("./verify-hydration-C3QBBQqR.js");
|
|
589
590
|
if (!verifyHydrationSyncForUrl({
|
|
590
591
|
root: rootElement,
|
|
591
592
|
url: currentUrl,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as runRuntimeHandlerScope, v as logger } from "./access-
|
|
2
|
-
import "./fastlane-
|
|
3
|
-
import { t as cleanupComponent } from "./component-cleanup-
|
|
4
|
-
import { u as registerLifecycleTransaction } from "./lifecycle-batch-
|
|
1
|
+
import { c as runRuntimeHandlerScope, v as logger } from "./access-Dpfoi4cA.js";
|
|
2
|
+
import "./fastlane-CrfB3QG0.js";
|
|
3
|
+
import { t as cleanupComponent } from "./component-cleanup-BUfUleGZ.js";
|
|
4
|
+
import { u as registerLifecycleTransaction } from "./lifecycle-batch-Dfpid9-A.js";
|
|
5
5
|
//#region src/runtime/events.ts
|
|
6
6
|
/**
|
|
7
7
|
* Event delegation system for Askr
|
|
@@ -37,7 +37,7 @@ const DELEGATED_EVENTS = [
|
|
|
37
37
|
"touchcancel"
|
|
38
38
|
];
|
|
39
39
|
function createDelegatedEventFacade(event, currentTarget) {
|
|
40
|
-
return new Proxy(event, { get(target, property,
|
|
40
|
+
return new Proxy(event, { get(target, property, _receiver) {
|
|
41
41
|
if (property === "currentTarget") return currentTarget;
|
|
42
42
|
const value = Reflect.get(target, property, target);
|
|
43
43
|
return typeof value === "function" ? value.bind(target) : value;
|
|
@@ -74,13 +74,23 @@ const containerDelegatedListeners = /* @__PURE__ */ new Map();
|
|
|
74
74
|
function isEventDelegationEnabled() {
|
|
75
75
|
return eventDelegationEnabled;
|
|
76
76
|
}
|
|
77
|
+
function usesDelegatedCapture(eventName) {
|
|
78
|
+
return eventName === "focus" || eventName === "blur" || eventName === "scroll";
|
|
79
|
+
}
|
|
80
|
+
function removeContainerDelegatedListener(container, eventName, handler) {
|
|
81
|
+
if (usesDelegatedCapture(eventName)) {
|
|
82
|
+
container.removeEventListener(eventName, handler, true);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
container.removeEventListener(eventName, handler);
|
|
86
|
+
}
|
|
77
87
|
function decrementContainerListenerUsage(entry) {
|
|
78
88
|
const listeners = containerDelegatedListeners.get(entry.container);
|
|
79
89
|
const listener = listeners?.get(entry.eventName);
|
|
80
90
|
if (!listener) return;
|
|
81
91
|
listener.usage -= 1;
|
|
82
92
|
if (listener.usage > 0) return;
|
|
83
|
-
entry.container
|
|
93
|
+
removeContainerDelegatedListener(entry.container, entry.eventName, listener.handler);
|
|
84
94
|
listeners?.delete(entry.eventName);
|
|
85
95
|
if (listeners?.size === 0) containerDelegatedListeners.delete(entry.container);
|
|
86
96
|
}
|
|
@@ -140,7 +150,7 @@ function attachDelegatedListener(container, element, eventName, handler, origina
|
|
|
140
150
|
}, "sync");
|
|
141
151
|
};
|
|
142
152
|
const passiveOptions = getPassiveOptions(eventName);
|
|
143
|
-
const listenerOptions = eventName
|
|
153
|
+
const listenerOptions = usesDelegatedCapture(eventName) ? {
|
|
144
154
|
...passiveOptions ?? options,
|
|
145
155
|
capture: true
|
|
146
156
|
} : passiveOptions ?? options;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as isDevelopmentEnvironment, v as logger, x as isProductionEnvironment } from "./access-
|
|
2
|
-
import { n as cleanupReadableSubscriptions, t as cleanupReadableSubscriptionSources } from "./readable-B3VIOfd7.js";
|
|
1
|
+
import { b as isDevelopmentEnvironment, v as logger, x as isProductionEnvironment } from "./access-Dpfoi4cA.js";
|
|
3
2
|
import { a as clearCurrentComponentScope, y as restoreCurrentComponentScope } from "./component-scope-DzJEbYGE.js";
|
|
3
|
+
import { n as cleanupReadableSubscriptions, t as cleanupReadableSubscriptionSources } from "./readable-B5NtV7V0.js";
|
|
4
4
|
//#region src/runtime/state-diagnostics.ts
|
|
5
5
|
/**
|
|
6
6
|
* Report state cells that were never read during a component's completed
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as markTransparentComponentResult, i as markEagerControlPrimitive } from "./control-C-ApnFs1.js";
|
|
2
|
-
import { b as isDevelopmentEnvironment, n as enqueueRuntimeTask, o as getRuntimeRenderer, v as logger, x as isProductionEnvironment } from "./access-
|
|
3
|
-
import { r as tryRuntimeFastLaneSync, t as isBulkCommitActive } from "./fastlane-
|
|
4
|
-
import { r as STATIC_CHILDREN, t as ELEMENT_TYPE } from "./jsx-C3IECePB.js";
|
|
5
|
-
import { i as finalizeReadableSubscriptions } from "./readable-B3VIOfd7.js";
|
|
2
|
+
import { b as isDevelopmentEnvironment, n as enqueueRuntimeTask, o as getRuntimeRenderer, v as logger, x as isProductionEnvironment } from "./access-Dpfoi4cA.js";
|
|
3
|
+
import { r as tryRuntimeFastLaneSync, t as isBulkCommitActive } from "./fastlane-CrfB3QG0.js";
|
|
6
4
|
import { C as restoreRenderScopedComponent, S as restoreInlineRenderTracking, _ as getSignalForInstance, b as restoreDomCommitScope, c as enterDomCommitScope, f as getCurrentComponentInstance, l as enterRenderScopedComponent, m as getCurrentPortalScope, n as captureInlineComponentScope, o as clearRenderTracking, p as getCurrentInstance, r as captureInlineRenderTracking, s as enterComponentExecutionScope, t as beginRenderTracking, u as exitComponentExecutionScope, v as resetRenderState, x as restoreInlineComponentScope } from "./component-scope-DzJEbYGE.js";
|
|
7
|
-
import {
|
|
5
|
+
import { r as STATIC_CHILDREN, t as ELEMENT_TYPE } from "./jsx-C3IECePB.js";
|
|
6
|
+
import { i as finalizeReadableSubscriptions } from "./readable-B5NtV7V0.js";
|
|
7
|
+
import { a as enqueueLifecycleCommitForInstance, d as discardCommitOperations, f as executeCommittedLifecycleOperations, n as captureInlineRenderSnapshot$1, o as finalizeInlineReadSubscriptions, p as isPromiseLike, r as discardLifecycleCommitBatch, s as flushLifecycleCommitBatch, t as beginLifecycleCommitBatch } from "./lifecycle-batch-Dfpid9-A.js";
|
|
8
8
|
//#region src/runtime/context.ts
|
|
9
9
|
const TransparentContextScopeComponent = markTransparentComponentResult(ContextScopeComponent);
|
|
10
10
|
let nextScopeIdentityKey = 0;
|
|
@@ -442,7 +442,7 @@ function commitToTarget(instance, result, host) {
|
|
|
442
442
|
try {
|
|
443
443
|
try {
|
|
444
444
|
withContext(executionFrame, () => {
|
|
445
|
-
renderer.evaluate(result, target, void 0, instance);
|
|
445
|
+
if (!renderer.replaceComponentRange(instance, result, target)) renderer.evaluate(result, target, void 0, instance);
|
|
446
446
|
});
|
|
447
447
|
} catch (err) {
|
|
448
448
|
discardLifecycleCommitBatch(lifecycleBatch);
|
|
@@ -512,6 +512,7 @@ function ensurePendingRunTask(instance) {
|
|
|
512
512
|
const existing = instance._pendingRunTask;
|
|
513
513
|
if (existing) return existing;
|
|
514
514
|
const task = () => {
|
|
515
|
+
if (!instance.hasPendingUpdate) return;
|
|
515
516
|
instance.hasPendingUpdate = false;
|
|
516
517
|
if (instance.notifyUpdate === null) return;
|
|
517
518
|
runScheduledComponent(instance, {
|
|
@@ -647,6 +648,7 @@ function renderComponentInline(instance) {
|
|
|
647
648
|
if (!hadToken) beginRenderTracking(instance);
|
|
648
649
|
try {
|
|
649
650
|
const result = executeComponentSync(instance);
|
|
651
|
+
if (!hadToken) instance.hasPendingUpdate = false;
|
|
650
652
|
if (!hadToken) finalizeInlineReadSubscriptions(instance, instance._currentRenderToken, instance._pendingReadSources, instance._pendingReadSourceVersions);
|
|
651
653
|
commitRenderedComponent(instance);
|
|
652
654
|
return result;
|
|
@@ -684,6 +686,7 @@ function executeComponentSync(instance) {
|
|
|
684
686
|
function executeComponent(instance) {
|
|
685
687
|
instance.abortController = null;
|
|
686
688
|
instance.notifyUpdate = instance._enqueueRun;
|
|
689
|
+
instance.hasPendingUpdate = true;
|
|
687
690
|
enqueueRuntimeTask(ensurePendingRunTask(instance));
|
|
688
691
|
}
|
|
689
692
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as VNode } from "../control-DhUZU4_V.js";
|
|
2
2
|
import { r as JSXElement, s as Props } from "../jsx-Dvr2SGRG.js";
|
|
3
3
|
//#region src/common/error-boundary.d.ts
|
|
4
4
|
type ErrorBoundaryContent = VNode | readonly VNode[];
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __ERROR_BOUNDARY__ } from "../vnode-D24p6IW2.js";
|
|
2
|
-
import { t as ELEMENT_TYPE } from "../jsx-C3IECePB.js";
|
|
3
2
|
import { f as getCurrentComponentInstance } from "../component-scope-DzJEbYGE.js";
|
|
3
|
+
import { t as ELEMENT_TYPE } from "../jsx-C3IECePB.js";
|
|
4
4
|
//#region src/components/error-boundary.tsx
|
|
5
5
|
function ensureBoundaryState(instance, resetKey) {
|
|
6
6
|
const boundaryState = instance.errorBoundaryState ?? (instance.errorBoundaryState = {
|
package/dist/control/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Show, c as ForProps, i as MatchProps, n as CaseProps, o as ShowProps, r as Match, s as For, t as Case } from "../index-
|
|
1
|
+
import { a as Show, c as ForProps, i as MatchProps, n as CaseProps, o as ShowProps, r as Match, s as For, t as Case } from "../index-r-nt13FE.js";
|
|
2
2
|
export { Case, type CaseProps, For, type ForProps, Match, type MatchProps, Show, type ShowProps };
|
package/dist/control/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as For, n as Match, r as Show, t as Case } from "../control-
|
|
1
|
+
import { i as For, n as Match, r as Show, t as Case } from "../control-oLADku43.js";
|
|
2
2
|
export { Case, For, Match, Show };
|
|
@@ -82,6 +82,7 @@ interface DocumentRenderArgs {
|
|
|
82
82
|
context: DocumentRenderContext;
|
|
83
83
|
}
|
|
84
84
|
type DocumentRenderer = (args: DocumentRenderArgs) => string;
|
|
85
|
+
type SSRStyleRegistrationValidation = 'warn' | 'error' | 'off';
|
|
85
86
|
/** Full context for sink-based streaming SSR */
|
|
86
87
|
type SSRContext = {
|
|
87
88
|
url: string;
|
|
@@ -445,4 +446,4 @@ interface ControlTransaction {
|
|
|
445
446
|
registered: boolean;
|
|
446
447
|
}
|
|
447
448
|
//#endregion
|
|
448
|
-
export {
|
|
449
|
+
export { SSRStyleRegistrationValidation as _, ComponentInstance as a, StateTuple as b, readScope as c, VNode as d, DocumentRenderArgs as f, SSRStyleRegistration as g, SSRData as h, ReadableSource as i, ComponentFunction as l, DocumentRenderer as m, ChildScope as n, Scope as o, DocumentRenderContext as p, DOMRange as r, defineScope as s, ForEachSource as t, RenderableChild as u, State as v, state as x, StateSetter as y };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { i as markEagerControlPrimitive, t as __CONTROL_BOUNDARY__ } from "./control-C-ApnFs1.js";
|
|
2
|
-
import { b as isDevelopmentEnvironment } from "./access-
|
|
2
|
+
import { b as isDevelopmentEnvironment } from "./access-Dpfoi4cA.js";
|
|
3
3
|
import { n as Fragment } from "./jsx-C3IECePB.js";
|
|
4
|
-
import { m as createShowState, p as createCaseState, s as useForState } from "./for-internal-
|
|
5
|
-
import { t as createFineGrainedEffect } from "./effect-
|
|
6
|
-
import { t as state } from "./state-
|
|
4
|
+
import { m as createShowState, p as createCaseState, s as useForState } from "./for-internal-B_mnQhan.js";
|
|
5
|
+
import { t as createFineGrainedEffect } from "./effect-lnxQIpJG.js";
|
|
6
|
+
import { t as state } from "./state-DCjONcHK.js";
|
|
7
7
|
//#region src/control/shared.ts
|
|
8
8
|
function normalizeBoundaryChild(value) {
|
|
9
9
|
if (Array.isArray(value)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as readScope, u as defineScope } from "./component-internal-
|
|
1
|
+
import { g as readScope, u as defineScope } from "./component-internal-DcrLymUJ.js";
|
|
2
2
|
//#region src/common/url.ts
|
|
3
3
|
const SAFE_URL_SCHEMES = /* @__PURE__ */ new Set([
|
|
4
4
|
"http",
|
|
@@ -13,6 +13,23 @@ function isSafeHref(value) {
|
|
|
13
13
|
const scheme = URL_SCHEME_RE.exec(compact)?.[1]?.toLowerCase();
|
|
14
14
|
return scheme === void 0 || SAFE_URL_SCHEMES.has(scheme);
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Attribute names (lowercased) that can carry a browser-navigable/executable
|
|
18
|
+
* URL and must be checked against isSafeHref. Shared between the client
|
|
19
|
+
* renderer (renderer/attributes.ts) and SSR (ssr/attrs.ts) so their unsafe-
|
|
20
|
+
* URL handling can't drift. Deliberately excludes `src`: it covers a much
|
|
21
|
+
* wider range of legitimate non-navigable values (data: image URIs, blob:
|
|
22
|
+
* URLs, etc.) where the same scheme allowlist would be overly aggressive.
|
|
23
|
+
*/
|
|
24
|
+
const UNSAFE_URL_SCHEME_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
25
|
+
"href",
|
|
26
|
+
"formaction",
|
|
27
|
+
"action",
|
|
28
|
+
"xlink:href"
|
|
29
|
+
]);
|
|
30
|
+
function isUnsafeUrlAttribute(key, value) {
|
|
31
|
+
return UNSAFE_URL_SCHEME_ATTRIBUTES.has(key.toLowerCase()) && !isSafeHref(String(value));
|
|
32
|
+
}
|
|
16
33
|
//#endregion
|
|
17
34
|
//#region src/common/router-internal.ts
|
|
18
35
|
const ROUTE_ROOT_COMPONENT = Symbol.for("askr.route-root-component");
|
|
@@ -45,4 +62,4 @@ function validateCspNonce(value) {
|
|
|
45
62
|
return value;
|
|
46
63
|
}
|
|
47
64
|
//#endregion
|
|
48
|
-
export { isSafeHref as a, ROUTE_ROOT_COMPONENT as i, cspNonce as n, validateCspNonce as r, CspNonceScope as t };
|
|
65
|
+
export { isSafeHref as a, ROUTE_ROOT_COMPONENT as i, cspNonce as n, isUnsafeUrlAttribute as o, validateCspNonce as r, CspNonceScope as t };
|
package/dist/data/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { i as getDefaultDataRuntime, t as createDataRuntime } from "../data-runtime-D68YOo9L.js";
|
|
2
|
-
import { a as queryScope, i as invalidateOnInterval, n as createMutation, r as invalidate, t as createQuery } from "../data-
|
|
2
|
+
import { a as queryScope, i as invalidateOnInterval, n as createMutation, r as invalidate, t as createQuery } from "../data-Dkqb8_QP.js";
|
|
3
3
|
import { a as hydrateDataRuntime, i as dehydrateDataRuntime, n as defineQuery, o as prefetchQuery, r as defineServerQueries, s as serveQuery, t as createQueryPrefetchContext } from "../query-registry-BL6rjGsO.js";
|
|
4
4
|
export { createDataRuntime, createMutation, createQuery, createQueryPrefetchContext, defineQuery, defineServerQueries, dehydrateDataRuntime, getDefaultDataRuntime, hydrateDataRuntime, invalidate, invalidateOnInterval, prefetchQuery, queryScope, serveQuery };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as enqueueRuntimeTask, v as logger } from "./access-
|
|
2
|
-
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-B3VIOfd7.js";
|
|
1
|
+
import { n as enqueueRuntimeTask, v as logger } from "./access-Dpfoi4cA.js";
|
|
3
2
|
import { f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-DzJEbYGE.js";
|
|
3
|
+
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-B5NtV7V0.js";
|
|
4
4
|
import { n as getActiveRenderContext } from "./render-context-D-DFk2WN.js";
|
|
5
|
-
import { i as routeActive, n as documentVisible, o as timer, s as windowFocused } from "./lifecycle-operations-
|
|
5
|
+
import { i as routeActive, n as documentVisible, o as timer, s as windowFocused } from "./lifecycle-operations-BrYrBsXY.js";
|
|
6
6
|
import { a as getMutationSlotStore, c as resolveDataRuntimeState, i as getDefaultDataRuntime, n as ensureMutationCleanup, o as getQuerySlotStore, r as ensureQueryCleanup, s as invalidateQueriesForRuntime } from "./data-runtime-D68YOo9L.js";
|
|
7
7
|
//#region src/data/query-key.ts
|
|
8
8
|
function serializeQueryKeyNumber(part) {
|