@askrjs/askr 0.0.92 → 0.0.94
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/CHANGELOG.md +3 -0
- package/dist/{access-DSkccuEI.js → access-d_DCdwqn.js} +3 -0
- package/dist/actions/index.d.ts +1 -1
- package/dist/actions/index.js +3 -2
- package/dist/{activity-DodHdC0L.js → activity-BshyLB3_.js} +4 -2
- package/dist/{activity-DxUcygE5.d.ts → activity-CJIQyo5X.d.ts} +5 -1
- package/dist/benchmark.d.ts +1 -1
- package/dist/benchmark.js +8 -8
- package/dist/boot/index.d.ts +12 -3
- package/dist/boot/index.js +1 -1
- package/dist/{boot-D71bjP4r.js → boot-BsMB_ySP.js} +21 -15
- package/dist/{cleanup-DAAhJjx5.js → cleanup-DefafSjG.js} +4 -4
- package/dist/{component-cleanup-CJCfu5ed.js → component-cleanup-hrqSikl2.js} +2 -2
- package/dist/{component-internal-DlAkCgBE.js → component-internal-DOVVMjG7.js} +7 -5
- package/dist/components/index.d.ts +7 -2
- package/dist/components/index.js +1 -1
- package/dist/{compose-ref-Cc_YkUpM.js → compose-ref-1Fhs7mbF.js} +13 -0
- package/dist/{compose-ref-Cizq72-x.d.ts → compose-ref-DOJHoW5X.d.ts} +3 -0
- package/dist/control/index.d.ts +1 -1
- package/dist/control/index.js +1 -1
- package/dist/{control-CdzY49Q2.d.ts → control-DdFw-Caz.d.ts} +1 -1
- package/dist/{control-Dv540XtV.js → control-DqOzkgc7.js} +9 -5
- package/dist/{csp-nonce-ByMbWv8s.js → csp-nonce-BBxq1zq4.js} +8 -1
- package/dist/data/index.d.ts +1 -1
- package/dist/data/index.js +3 -3
- package/dist/{data-DcikEH9N.js → data-DYqokZzc.js} +15 -4
- package/dist/{data-runtime-oIdQWnPW.js → data-runtime-JxoRgrrt.js} +2 -0
- package/dist/{deferred-B6CafO5u.js → deferred-BS0Xpstg.js} +8 -3
- package/dist/{effect-BdZcHblj.js → effect-BdvdgMvV.js} +2 -2
- package/dist/{fastlane-B2s24fWt.js → fastlane-DGo7SxBQ.js} +3 -3
- package/dist/{for-internal-T1C7jd7x.js → for-internal-jrliHZmF.js} +5 -5
- package/dist/foundations/icon/index.d.ts +14 -2
- package/dist/foundations/icon/index.js +8 -0
- package/dist/foundations/index.d.ts +2 -2
- package/dist/foundations/index.js +1 -1
- package/dist/foundations/interactions/index.d.ts +18 -2
- package/dist/foundations/interactions/index.js +1 -1
- package/dist/foundations/state/index.d.ts +8 -1
- package/dist/foundations/state/index.js +7 -1
- package/dist/foundations/structures/index.d.ts +2 -2
- package/dist/foundations/structures/index.js +1 -1
- package/dist/foundations/utilities/index.d.ts +2 -2
- package/dist/foundations/utilities/index.js +1 -1
- package/dist/fx/index.d.ts +10 -1
- package/dist/fx/index.js +7 -1
- package/dist/{index-oswRaMn6.d.ts → index-C29SEGIv.d.ts} +30 -2
- package/dist/{index-BnU0NPwM.d.ts → index-CzH-0LcA.d.ts} +18 -0
- package/dist/{index-DA3g8lm8.d.ts → index-KQ7Vl4-8.d.ts} +414 -5
- package/dist/index.d.ts +3 -4
- package/dist/index.js +13 -12
- package/dist/{interactions-CWkNEq_C.js → interactions-B4XaFxt1.js} +6 -1
- package/dist/{jsx-C3IECePB.js → jsx-DRS-qjiN.js} +2 -0
- package/dist/jsx-dev-runtime.d.ts +2 -2
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-runtime-BTzDdBJ_.d.ts +2 -0
- package/dist/{jsx-runtime-Cfb2umb4.d.ts → jsx-runtime-Cdd6Gkb0.d.ts} +4 -2
- package/dist/jsx-runtime.d.ts +2 -2
- package/dist/jsx-runtime.js +1 -1
- package/dist/{lifecycle-batch-Cyfd07rf.js → lifecycle-batch-BH0fax4F.js} +2 -2
- package/dist/{lifecycle-operations-CQ8fsc94.js → lifecycle-operations-Qxq6ABrC.js} +6 -1
- package/dist/{manifest-Dv0bO6kg.js → manifest-D6rfj_jC.js} +4 -0
- package/dist/{navigate-CZHPEUC4.d.ts → navigate-BL_FIIJ6.d.ts} +6 -1
- package/dist/{navigate-BbWj-QU-.js → navigate-CECCMPAr.js} +13 -10
- package/dist/{query-registry-qm13pEdK.js → query-registry-CimB1YeW.js} +11 -1
- package/dist/{readable-B99wh5Z_.js → readable-BsdGWsDE.js} +1 -1
- package/dist/{renderer-C6jz9nIN.js → renderer-CLvq458M.js} +10 -10
- package/dist/{resolution-B21kmOkp.js → resolution-D8PgnTzh.js} +11 -5
- package/dist/{resource-operation-CaAttQqz.js → resource-operation-CLQXCn1p.js} +4 -4
- package/dist/resources/index.d.ts +15 -2
- package/dist/resources/index.js +6 -5
- package/dist/router/index.d.ts +46 -4
- package/dist/router/index.js +15 -8
- package/dist/{selector-BLWwI55m.js → selector-CyK-sDwB.js} +4 -3
- package/dist/ssg/index.d.ts +5 -1
- package/dist/ssg/index.js +5 -5
- package/dist/ssr/index.d.ts +16 -3
- package/dist/ssr/index.js +1 -1
- package/dist/{ssr-CaZfvQWn.js → ssr-8_vHDWqV.js} +18 -10
- package/dist/{state-XPZYUzHL.js → state-DmkGM_LN.js} +3 -3
- package/dist/{structures-DKjkAmM5.js → structures-umvVUD-M.js} +19 -5
- package/dist/testing/index.d.ts +31 -2
- package/dist/testing/index.js +23 -5
- package/dist/{types-BA9FJtfR.d.ts → types-DkVJhVs9.d.ts} +4 -0
- package/dist/{verify-hydration-CcF-HJil.js → verify-hydration-jf8X2V3x.js} +1 -1
- package/package.json +1 -1
- package/dist/index-2bk8nldG.d.ts +0 -241
- package/dist/jsx-runtime-C_0v1pMN.d.ts +0 -2
- package/dist/scheduler-CmLO4Dfm.d.ts +0 -65
package/CHANGELOG.md
CHANGED
|
@@ -432,6 +432,7 @@ function createMissingRendererHost() {
|
|
|
432
432
|
markReactivePropsDirtySource() {}
|
|
433
433
|
};
|
|
434
434
|
}
|
|
435
|
+
/** A scheduler + renderer host pairing; owns scheduling and renderer wiring for an app instance. */
|
|
435
436
|
var AskrRuntime = class {
|
|
436
437
|
constructor(options = {}) {
|
|
437
438
|
this.scheduler = options.scheduler ?? globalScheduler;
|
|
@@ -445,9 +446,11 @@ var AskrRuntime = class {
|
|
|
445
446
|
}
|
|
446
447
|
};
|
|
447
448
|
const defaultRuntime = new AskrRuntime({ scheduler: globalScheduler });
|
|
449
|
+
/** Create a new {@link AskrRuntime} instance with its own scheduler/renderer wiring. */
|
|
448
450
|
function createRuntime(options = {}) {
|
|
449
451
|
return new AskrRuntime(options);
|
|
450
452
|
}
|
|
453
|
+
/** Get the process-wide default {@link AskrRuntime}. */
|
|
451
454
|
function getDefaultRuntime() {
|
|
452
455
|
return defaultRuntime;
|
|
453
456
|
}
|
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-KQ7Vl4-8.js";
|
|
2
2
|
export { ActionDescriptor, ActionForm, ActionStatus, ActionValidationError, action, defineAction };
|
package/dist/actions/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { d as getCurrentAppRenderRuntime } from "../component-scope-4I3yEMkb.js";
|
|
2
2
|
import { r as getCurrentRenderData } from "../render-context-B7ohlh6t.js";
|
|
3
|
-
import { t as state } from "../state-
|
|
3
|
+
import { t as state } from "../state-DmkGM_LN.js";
|
|
4
4
|
import { jsx, jsxs } from "../jsx-runtime.js";
|
|
5
|
-
import { c as resolveDataRuntimeState, s as invalidateQueriesForRuntime } from "../data-runtime-
|
|
5
|
+
import { c as resolveDataRuntimeState, s as invalidateQueriesForRuntime } from "../data-runtime-JxoRgrrt.js";
|
|
6
6
|
//#region src/actions/runtime.ts
|
|
7
7
|
const emptyFramework = Object.freeze({});
|
|
8
8
|
/** @internal Read Askr-owned state from the current application root. */
|
|
@@ -15,6 +15,7 @@ function csrfToken() {
|
|
|
15
15
|
const value = getCurrentRenderData()?.framework.csrf ?? readActionFramework().csrf;
|
|
16
16
|
return typeof value === "string" ? value : void 0;
|
|
17
17
|
}
|
|
18
|
+
/** Declare a server action with a stable id, input schema, and query prefixes to invalidate on success. */
|
|
18
19
|
function defineAction(options) {
|
|
19
20
|
if (!options.id) throw new Error("defineAction requires a stable id.");
|
|
20
21
|
if (options.input.kind !== "object") throw new Error("defineAction input must be an object schema.");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as getCurrentAppRenderRuntime, f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-4I3yEMkb.js";
|
|
2
|
-
import { a as registerCommitOperation } from "./component-internal-
|
|
3
|
-
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-
|
|
2
|
+
import { a as registerCommitOperation } from "./component-internal-DOVVMjG7.js";
|
|
3
|
+
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-BsdGWsDE.js";
|
|
4
4
|
import { n as getActiveRenderContext } from "./render-context-B7ohlh6t.js";
|
|
5
5
|
import { n as syncRouteActivitySnapshot } from "./route-activity-CNJfpwx-.js";
|
|
6
6
|
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-Bo6UqG-5.js";
|
|
@@ -33,6 +33,7 @@ function routeSignature(route) {
|
|
|
33
33
|
let currentRouteSnapshot = buildRouteSnapshot("/", "", "");
|
|
34
34
|
const currentRouteSource = (() => currentRouteSnapshot);
|
|
35
35
|
currentRouteSource._readers = /* @__PURE__ */ new Map();
|
|
36
|
+
/** Register a callback to run whenever the active route changes, with optional cleanup. */
|
|
36
37
|
function onRouteChange(fn, options = {}) {
|
|
37
38
|
const instance = getCurrentComponentInstance();
|
|
38
39
|
if (!instance) return;
|
|
@@ -179,6 +180,7 @@ function readCurrentRouteSnapshot() {
|
|
|
179
180
|
matches: Object.freeze(matches)
|
|
180
181
|
});
|
|
181
182
|
}
|
|
183
|
+
/** Read the currently active route's {@link RouteSnapshot}; reactive during component render. */
|
|
182
184
|
function currentRoute() {
|
|
183
185
|
const instance = getCurrentComponentInstance();
|
|
184
186
|
if (!instance) throw new Error("currentRoute() can only be called during component render execution. Call currentRoute() from inside your component function.");
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ct as RouteParams, Lt as RouteSnapshot } from "./index-KQ7Vl4-8.js";
|
|
2
2
|
//#region src/router/activity.d.ts
|
|
3
|
+
/** Options for {@link onRouteChange}. */
|
|
3
4
|
interface RouteChangeOptions {
|
|
4
5
|
immediate?: boolean;
|
|
5
6
|
}
|
|
7
|
+
/** Optional cleanup returned by an {@link onRouteChange} callback, run before the next change. */
|
|
6
8
|
type RouteChangeCleanup = void | (() => void);
|
|
9
|
+
/** Register a callback to run whenever the active route changes, with optional cleanup. */
|
|
7
10
|
declare function onRouteChange(fn: (current: RouteSnapshot, previous: RouteSnapshot | null) => RouteChangeCleanup, options?: RouteChangeOptions): void;
|
|
11
|
+
/** Read the currently active route's {@link RouteSnapshot}; reactive during component render. */
|
|
8
12
|
declare function currentRoute<TParams extends RouteParams = RouteParams>(): RouteSnapshot<TParams>;
|
|
9
13
|
//#endregion
|
|
10
14
|
export { onRouteChange as i, RouteChangeOptions as n, currentRoute as r, RouteChangeCleanup as t };
|
package/dist/benchmark.d.ts
CHANGED
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-d_DCdwqn.js";
|
|
2
|
+
import { t as installRendererBridge } from "./renderer-CLvq458M.js";
|
|
3
|
+
import { t as state } from "./state-DmkGM_LN.js";
|
|
4
|
+
import { t as selector } from "./selector-CyK-sDwB.js";
|
|
5
|
+
import { i as For } from "./control-DqOzkgc7.js";
|
|
6
6
|
import { jsx, jsxs } from "./jsx-runtime.js";
|
|
7
|
-
import { t as createIsland } from "./boot-
|
|
7
|
+
import { t as createIsland } from "./boot-BsMB_ySP.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.94",
|
|
67
|
+
buildLabel: "0.0.94-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 {
|
|
3
|
-
import { a as ScrollRestorationOptions } from "../navigate-CZHPEUC4.js";
|
|
1
|
+
import { At as RouteRegistry, nn as ComponentFunction, ut as RouteAuthOptions, zt as DataRuntime } from "../index-KQ7Vl4-8.js";
|
|
2
|
+
import { a as ScrollRestorationOptions } from "../navigate-BL_FIIJ6.js";
|
|
4
3
|
//#region src/boot/types.d.ts
|
|
4
|
+
/** Configuration for {@link createIsland}: mounts one component onto existing DOM. */
|
|
5
5
|
type IslandConfig = {
|
|
6
6
|
root: Element | string;
|
|
7
7
|
component: ComponentFunction;
|
|
@@ -9,6 +9,7 @@ type IslandConfig = {
|
|
|
9
9
|
cleanupStrict?: boolean;
|
|
10
10
|
routes?: never;
|
|
11
11
|
};
|
|
12
|
+
/** Configuration for {@link createIslands}: mounts several islands at once. */
|
|
12
13
|
type IslandsConfig = {
|
|
13
14
|
islands: IslandConfig[];
|
|
14
15
|
cspNonce?: string;
|
|
@@ -16,6 +17,7 @@ type IslandsConfig = {
|
|
|
16
17
|
type BootRouteSource = {
|
|
17
18
|
registry: RouteRegistry;
|
|
18
19
|
};
|
|
20
|
+
/** Configuration for {@link createSPA}. */
|
|
19
21
|
type SPAConfig = BootRouteSource & {
|
|
20
22
|
root: Element | string;
|
|
21
23
|
cspNonce?: string;
|
|
@@ -27,6 +29,7 @@ type SPAConfig = BootRouteSource & {
|
|
|
27
29
|
cleanupStrict?: boolean;
|
|
28
30
|
component?: never;
|
|
29
31
|
};
|
|
32
|
+
/** Configuration for {@link hydrateSPA}. */
|
|
30
33
|
type HydrateSPAConfig = BootRouteSource & {
|
|
31
34
|
root: Element | string;
|
|
32
35
|
cspNonce?: string;
|
|
@@ -45,7 +48,13 @@ type HydrateSPAConfig = BootRouteSource & {
|
|
|
45
48
|
};
|
|
46
49
|
//#endregion
|
|
47
50
|
//#region src/boot/root-lifecycle.d.ts
|
|
51
|
+
/**
|
|
52
|
+
* Tear down the app mounted at `root`: runs its cleanup callbacks, clears
|
|
53
|
+
* route state if it was the last routed root, and removes bookkeeping for
|
|
54
|
+
* the root element.
|
|
55
|
+
*/
|
|
48
56
|
declare function cleanupApp(root: Element | string): void;
|
|
57
|
+
/** Check whether an app instance is currently mounted at `root`. */
|
|
49
58
|
declare function hasApp(root: Element | string): boolean;
|
|
50
59
|
//#endregion
|
|
51
60
|
//#region src/boot/index.d.ts
|
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-BsMB_ySP.js";
|
|
2
2
|
export { cleanupApp, createIsland, createIslands, createSPA, hasApp, hydrateSPA };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { S as isProductionEnvironment, r as flushRuntimeScheduler, x as isDevelopmentEnvironment, y as logger } from "./access-
|
|
2
|
-
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-
|
|
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 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-
|
|
7
|
-
import { _ as teardownNodeSubtree, d as removeAllListeners } from "./cleanup-
|
|
8
|
-
import { r as assertExecutionModel, t as _applyManifest } from "./manifest-
|
|
1
|
+
import { S as isProductionEnvironment, r as flushRuntimeScheduler, x as isDevelopmentEnvironment, y as logger } from "./access-d_DCdwqn.js";
|
|
2
|
+
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-DRS-qjiN.js";
|
|
3
|
+
import { n as createComponentInstance, r as executeComponent } from "./component-internal-DOVVMjG7.js";
|
|
4
|
+
import { t as cleanupComponent } from "./component-cleanup-hrqSikl2.js";
|
|
5
|
+
import { p as isPromiseLike } from "./lifecycle-batch-BH0fax4F.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-CLvq458M.js";
|
|
7
|
+
import { _ as teardownNodeSubtree, d as removeAllListeners } from "./cleanup-DefafSjG.js";
|
|
8
|
+
import { r as assertExecutionModel, t as _applyManifest } from "./manifest-D6rfj_jC.js";
|
|
9
9
|
import { d as stopHydrationRenderPhase, l as startHydrationRenderPhase, y as pageRenderEnvelope } from "./render-context-B7ohlh6t.js";
|
|
10
|
-
import { r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-
|
|
11
|
-
import { i as getDefaultDataRuntime } from "./data-runtime-
|
|
12
|
-
import { a as hydrateDataRuntime } from "./query-registry-
|
|
10
|
+
import { r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-BBxq1zq4.js";
|
|
11
|
+
import { i as getDefaultDataRuntime } from "./data-runtime-JxoRgrrt.js";
|
|
12
|
+
import { a as hydrateDataRuntime } from "./query-registry-CimB1YeW.js";
|
|
13
13
|
import { I as lockRouteRegistration, P as hasRegisteredRoutes, _ as clearRouteState, m as _setActiveRouteAuthOptions } from "./route-matching-Bo6UqG-5.js";
|
|
14
|
-
import { a as resolveRouteRequest, i as hasRouteRenderData, m as reviveDeferredValue, n as getRouteRenderContext, r as getRouteRenderData } from "./resolution-
|
|
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-
|
|
14
|
+
import { a as resolveRouteRequest, i as hasRouteRenderData, m as reviveDeferredValue, n as getRouteRenderContext, r as getRouteRenderData } from "./resolution-D8PgnTzh.js";
|
|
15
|
+
import { o as createAppRenderRuntime, r as setServerLocation } from "./activity-BshyLB3_.js";
|
|
16
|
+
import { f as registerAppInstance, g as unregisterAppInstance, i as resolveRouteMeta, o as configureScrollRestoration, r as reconcileRouteMeta, t as initializeNavigation } from "./navigate-CECCMPAr.js";
|
|
17
17
|
import { n as disposeRegisteredDefaultPortalScope, r as getDefaultPortalHost } from "./default-portal-runtime-DvMvWJVp.js";
|
|
18
18
|
import "./ssr-DSHd_Q9K.js";
|
|
19
19
|
//#region src/boot/hydration.ts
|
|
@@ -358,6 +358,11 @@ async function registerAppNavigation(rootElement, path, source) {
|
|
|
358
358
|
registerAppInstance(instance, path, source);
|
|
359
359
|
initializeNavigation();
|
|
360
360
|
}
|
|
361
|
+
/**
|
|
362
|
+
* Tear down the app mounted at `root`: runs its cleanup callbacks, clears
|
|
363
|
+
* route state if it was the last routed root, and removes bookkeeping for
|
|
364
|
+
* the root element.
|
|
365
|
+
*/
|
|
361
366
|
function cleanupApp(root) {
|
|
362
367
|
const rootElement = resolveRootElement(root);
|
|
363
368
|
if (!rootElement) return;
|
|
@@ -374,6 +379,7 @@ function cleanupApp(root) {
|
|
|
374
379
|
} catch {}
|
|
375
380
|
}
|
|
376
381
|
}
|
|
382
|
+
/** Check whether an app instance is currently mounted at `root`. */
|
|
377
383
|
function hasApp(root) {
|
|
378
384
|
const rootElement = resolveRootElement(root);
|
|
379
385
|
if (!rootElement) return false;
|
|
@@ -604,7 +610,7 @@ async function hydrateSPA(config) {
|
|
|
604
610
|
cspNonce: config.cspNonce
|
|
605
611
|
}));
|
|
606
612
|
if (shouldVerifyHydrationMarkup(config)) {
|
|
607
|
-
const { verifyHydrationSyncForUrl } = await import("./verify-hydration-
|
|
613
|
+
const { verifyHydrationSyncForUrl } = await import("./verify-hydration-jf8X2V3x.js");
|
|
608
614
|
if (!verifyHydrationSyncForUrl({
|
|
609
615
|
root: rootElement,
|
|
610
616
|
url: currentUrl,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { l as runRuntimeHandlerScope, y as logger } from "./access-
|
|
2
|
-
import "./fastlane-
|
|
1
|
+
import { l as runRuntimeHandlerScope, y as logger } from "./access-d_DCdwqn.js";
|
|
2
|
+
import "./fastlane-DGo7SxBQ.js";
|
|
3
3
|
import { T as withAppRenderRuntime, d as getCurrentAppRenderRuntime } from "./component-scope-4I3yEMkb.js";
|
|
4
|
-
import { t as cleanupComponent } from "./component-cleanup-
|
|
5
|
-
import { u as registerLifecycleTransaction } from "./lifecycle-batch-
|
|
4
|
+
import { t as cleanupComponent } from "./component-cleanup-hrqSikl2.js";
|
|
5
|
+
import { u as registerLifecycleTransaction } from "./lifecycle-batch-BH0fax4F.js";
|
|
6
6
|
//#region src/runtime/events.ts
|
|
7
7
|
/**
|
|
8
8
|
* Event delegation system for Askr
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as isProductionEnvironment, x as isDevelopmentEnvironment, y as logger } from "./access-
|
|
1
|
+
import { S as isProductionEnvironment, x as isDevelopmentEnvironment, y as logger } from "./access-d_DCdwqn.js";
|
|
2
2
|
import { a as clearCurrentComponentScope, y as restoreCurrentComponentScope } from "./component-scope-4I3yEMkb.js";
|
|
3
|
-
import { n as cleanupReadableSubscriptions, t as cleanupReadableSubscriptionSources } from "./readable-
|
|
3
|
+
import { n as cleanupReadableSubscriptions, t as cleanupReadableSubscriptionSources } from "./readable-BsdGWsDE.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 { S as isProductionEnvironment, n as enqueueRuntimeTask, o as getRuntimeRenderer, x as isDevelopmentEnvironment, y as logger } from "./access-
|
|
3
|
-
import { i as tryRuntimeFastLaneSync, n as isBulkCommitActive } from "./fastlane-
|
|
2
|
+
import { S as isProductionEnvironment, n as enqueueRuntimeTask, o as getRuntimeRenderer, x as isDevelopmentEnvironment, y as logger } from "./access-d_DCdwqn.js";
|
|
3
|
+
import { i as tryRuntimeFastLaneSync, n as isBulkCommitActive } from "./fastlane-DGo7SxBQ.js";
|
|
4
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-4I3yEMkb.js";
|
|
5
|
-
import { r as STATIC_CHILDREN, t as ELEMENT_TYPE } from "./jsx-
|
|
6
|
-
import { i as finalizeReadableSubscriptions } from "./readable-
|
|
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-
|
|
5
|
+
import { r as STATIC_CHILDREN, t as ELEMENT_TYPE } from "./jsx-DRS-qjiN.js";
|
|
6
|
+
import { i as finalizeReadableSubscriptions } from "./readable-BsdGWsDE.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-BH0fax4F.js";
|
|
8
8
|
//#region src/runtime/context.ts
|
|
9
9
|
const TransparentContextScopeComponent = markTransparentComponentResult(ContextScopeComponent);
|
|
10
10
|
let nextScopeIdentityKey = 0;
|
|
@@ -211,6 +211,7 @@ function withAsyncResourceContext(frame, fn) {
|
|
|
211
211
|
currentAsyncResourceFrame = oldFrame;
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
+
/** Create a new lexical {@link Scope} with `defaultValue`, readable via {@link readScope}. */
|
|
214
215
|
function defineScope(defaultValue) {
|
|
215
216
|
const key = Symbol("AskrContext");
|
|
216
217
|
const identityKey = nextScopeIdentityKey++;
|
|
@@ -241,6 +242,7 @@ function preserveStaticChildrenMarker(source, target) {
|
|
|
241
242
|
function isPresentRenderable(value) {
|
|
242
243
|
return value !== null && value !== void 0 && value !== false;
|
|
243
244
|
}
|
|
245
|
+
/** Read the current value of a {@link Scope} during component render or an async resource. */
|
|
244
246
|
function readScope(context) {
|
|
245
247
|
const frame = currentContextFrame || currentAsyncResourceFrame;
|
|
246
248
|
if (!frame) throw new Error("readScope() can only be called during component render or async resource execution. Ensure you are calling this from inside your component or resource function.");
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as JSXElement, s as Props } from "../types-
|
|
1
|
+
import { in as VNode } from "../index-KQ7Vl4-8.js";
|
|
2
|
+
import { r as JSXElement, s as Props } from "../types-DkVJhVs9.js";
|
|
3
3
|
//#region src/common/error-boundary.d.ts
|
|
4
4
|
type ErrorBoundaryContent = VNode | readonly VNode[];
|
|
5
5
|
type ErrorBoundaryFallbackValue = ErrorBoundaryContent | Node;
|
|
6
|
+
/** Renders a fallback for the caught error; call `reset` to retry the children. */
|
|
6
7
|
type ErrorBoundaryFallbackRender = (error: unknown, reset: () => void) => ErrorBoundaryFallbackValue;
|
|
8
|
+
/** Props for {@link ErrorBoundary}. */
|
|
7
9
|
interface ErrorBoundaryProps extends Props {
|
|
8
10
|
children?: ErrorBoundaryContent;
|
|
11
|
+
/** Static fallback content, or a render function receiving the error and a reset callback. */
|
|
9
12
|
fallback?: ErrorBoundaryFallbackValue | ErrorBoundaryFallbackRender;
|
|
13
|
+
/** Called with the caught error when the boundary trips. */
|
|
10
14
|
onError?: (error: unknown) => void;
|
|
15
|
+
/** Changing this value resets the boundary, re-rendering the children. */
|
|
11
16
|
resetKey?: unknown;
|
|
12
17
|
}
|
|
13
18
|
//#endregion
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __ERROR_BOUNDARY__ } from "../vnode-D24p6IW2.js";
|
|
2
2
|
import { f as getCurrentComponentInstance } from "../component-scope-4I3yEMkb.js";
|
|
3
|
-
import { t as ELEMENT_TYPE } from "../jsx-
|
|
3
|
+
import { t as ELEMENT_TYPE } from "../jsx-DRS-qjiN.js";
|
|
4
4
|
//#region src/components/error-boundary.tsx
|
|
5
5
|
function ensureBoundaryState(instance, resetKey) {
|
|
6
6
|
const boundaryState = instance.errorBoundaryState ?? (instance.errorBoundaryState = {
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
function isDefaultPrevented(value) {
|
|
3
3
|
return typeof value === "object" && value !== null && "defaultPrevented" in value && value.defaultPrevented === true;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* Compose two optional event handlers into one, running `first` then
|
|
7
|
+
* `second` unless `first` marked the event as default-prevented.
|
|
8
|
+
*/
|
|
5
9
|
function composeHandlers(first, second, options) {
|
|
6
10
|
if (!first && !second) return noop;
|
|
7
11
|
if (!first) return second;
|
|
@@ -44,6 +48,10 @@ function noop() {}
|
|
|
44
48
|
function isEventHandlerKey(key) {
|
|
45
49
|
return key.startsWith("on");
|
|
46
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Merge `base` props over `injected` props: non-handler keys in `base` win,
|
|
53
|
+
* and matching event handlers are composed (`injected` runs first).
|
|
54
|
+
*/
|
|
47
55
|
function mergeProps(base, injected) {
|
|
48
56
|
const baseKeys = Object.keys(base);
|
|
49
57
|
if (baseKeys.length === 0) return injected;
|
|
@@ -64,17 +72,21 @@ function mergeProps(base, injected) {
|
|
|
64
72
|
/**
|
|
65
73
|
* Tiny aria helpers
|
|
66
74
|
*/
|
|
75
|
+
/** Build an `aria-disabled` prop object; omitted entirely when `disabled` is falsy. */
|
|
67
76
|
function ariaDisabled(disabled) {
|
|
68
77
|
return disabled ? { "aria-disabled": "true" } : {};
|
|
69
78
|
}
|
|
79
|
+
/** Build an `aria-expanded` prop object; omitted when `expanded` is `undefined`. */
|
|
70
80
|
function ariaExpanded(expanded) {
|
|
71
81
|
return expanded === void 0 ? {} : { "aria-expanded": String(expanded) };
|
|
72
82
|
}
|
|
83
|
+
/** Build an `aria-selected` prop object; omitted when `selected` is `undefined`. */
|
|
73
84
|
function ariaSelected(selected) {
|
|
74
85
|
return selected === void 0 ? {} : { "aria-selected": String(selected) };
|
|
75
86
|
}
|
|
76
87
|
//#endregion
|
|
77
88
|
//#region src/foundations/utilities/compose-ref.ts
|
|
89
|
+
/** Write `value` to a {@link Ref}, ignoring failures on readonly object refs. */
|
|
78
90
|
function setRef(ref, value) {
|
|
79
91
|
if (!ref) return;
|
|
80
92
|
if (typeof ref === "function") {
|
|
@@ -83,6 +95,7 @@ function setRef(ref, value) {
|
|
|
83
95
|
}
|
|
84
96
|
if (Object.isExtensible(ref)) ref.current = value;
|
|
85
97
|
}
|
|
98
|
+
/** Combine multiple refs into one callback ref that writes to all of them. */
|
|
86
99
|
function composeRefs(...refs) {
|
|
87
100
|
return (value) => {
|
|
88
101
|
for (const ref of refs) setRef(ref, value);
|
|
@@ -17,10 +17,13 @@
|
|
|
17
17
|
* composeRefs applies refs in array order (left to right).
|
|
18
18
|
* All refs are called even if one fails.
|
|
19
19
|
*/
|
|
20
|
+
/** A callback ref, an object ref, or a nullish value (no-op). */
|
|
20
21
|
type Ref<T> = ((value: T | null) => void) | {
|
|
21
22
|
current: T | null;
|
|
22
23
|
} | null | undefined;
|
|
24
|
+
/** Write `value` to a {@link Ref}, ignoring failures on readonly object refs. */
|
|
23
25
|
declare function setRef<T>(ref: Ref<T>, value: T | null): void;
|
|
26
|
+
/** Combine multiple refs into one callback ref that writes to all of them. */
|
|
24
27
|
declare function composeRefs<T>(...refs: Array<Ref<T>>): (value: T | null) => void;
|
|
25
28
|
//#endregion
|
|
26
29
|
export { composeRefs as n, setRef as r, Ref as t };
|
package/dist/control/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as Case, F as ShowProps, I as For, L as ForProps, M as Match, N as MatchProps, P as Show, j as CaseProps } from "../index-KQ7Vl4-8.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-DqOzkgc7.js";
|
|
2
2
|
export { Case, For, Match, Show };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as Props } from "./types-
|
|
1
|
+
import { s as Props } from "./types-DkVJhVs9.js";
|
|
2
2
|
//#region src/common/control.d.ts
|
|
3
3
|
declare const EAGER_CONTROL_PRIMITIVE: unique symbol;
|
|
4
4
|
type EagerControlPrimitive<P extends Props = Props> = ((props: P) => unknown) & {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { i as markEagerControlPrimitive, t as __CONTROL_BOUNDARY__ } from "./control-C-ApnFs1.js";
|
|
2
|
-
import { x as isDevelopmentEnvironment } from "./access-
|
|
3
|
-
import { n as Fragment } from "./jsx-
|
|
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-
|
|
2
|
+
import { x as isDevelopmentEnvironment } from "./access-d_DCdwqn.js";
|
|
3
|
+
import { n as Fragment } from "./jsx-DRS-qjiN.js";
|
|
4
|
+
import { m as createShowState, p as createCaseState, s as useForState } from "./for-internal-jrliHZmF.js";
|
|
5
|
+
import { t as createFineGrainedEffect } from "./effect-BdvdgMvV.js";
|
|
6
|
+
import { t as state } from "./state-DmkGM_LN.js";
|
|
7
7
|
//#region src/control/shared.ts
|
|
8
8
|
function normalizeBoundaryChild(value) {
|
|
9
9
|
if (Array.isArray(value)) {
|
|
@@ -77,6 +77,7 @@ function createForBoundary(props) {
|
|
|
77
77
|
function ForPrimitive(props) {
|
|
78
78
|
return createForBoundary(props);
|
|
79
79
|
}
|
|
80
|
+
/** Render a keyed or indexed list, reconciling items by key instead of position. */
|
|
80
81
|
const For = markEagerControlPrimitive(ForPrimitive);
|
|
81
82
|
//#endregion
|
|
82
83
|
//#region src/control/show.ts
|
|
@@ -103,6 +104,7 @@ function ShowPrimitive(props) {
|
|
|
103
104
|
_controlState: showState
|
|
104
105
|
};
|
|
105
106
|
}
|
|
107
|
+
/** Conditionally render children based on `when`, narrowing truthy values for the render function form. */
|
|
106
108
|
const Show = markEagerControlPrimitive(ShowPrimitive);
|
|
107
109
|
//#endregion
|
|
108
110
|
//#region src/control/case.ts
|
|
@@ -118,6 +120,7 @@ function flattenChildren(children) {
|
|
|
118
120
|
}
|
|
119
121
|
return result;
|
|
120
122
|
}
|
|
123
|
+
/** Declares one branch of a {@link Case}; only valid as its direct child. */
|
|
121
124
|
function Match(_props) {
|
|
122
125
|
if (isDevelopmentEnvironment()) throw new Error("[askr] <Match> may only be used as a direct child of <Case>.");
|
|
123
126
|
return null;
|
|
@@ -164,6 +167,7 @@ function CasePrimitive(props) {
|
|
|
164
167
|
_controlState: caseState
|
|
165
168
|
};
|
|
166
169
|
}
|
|
170
|
+
/** Render the first matching {@link Match} child (by `when`), or `fallback` if none match. */
|
|
167
171
|
const Case = markEagerControlPrimitive(CasePrimitive);
|
|
168
172
|
//#endregion
|
|
169
173
|
export { For as i, Match as n, Show as r, Case as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as readScope, d as defineScope } from "./component-internal-
|
|
1
|
+
import { _ as readScope, d as defineScope } from "./component-internal-DOVVMjG7.js";
|
|
2
2
|
//#region src/common/url.ts
|
|
3
3
|
const SAFE_URL_SCHEMES = /* @__PURE__ */ new Set([
|
|
4
4
|
"http",
|
|
@@ -35,7 +35,14 @@ function isUnsafeUrlAttribute(key, value) {
|
|
|
35
35
|
const ROUTE_ROOT_COMPONENT = Symbol.for("askr.route-root-component");
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/csp-nonce.ts
|
|
38
|
+
/** Lexical scope carrying the CSP nonce for the current render, if any. */
|
|
38
39
|
const CspNonceScope = defineScope(void 0);
|
|
40
|
+
/**
|
|
41
|
+
* Read the CSP nonce for the current render from {@link CspNonceScope}.
|
|
42
|
+
*
|
|
43
|
+
* @returns The active nonce, or `undefined` when called outside of a
|
|
44
|
+
* component render or when no nonce was configured.
|
|
45
|
+
*/
|
|
39
46
|
function cspNonce() {
|
|
40
47
|
try {
|
|
41
48
|
return readScope(CspNonceScope);
|
package/dist/data/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as DataRuntimeOptions, Gt as Query, Ht as InvalidateOptions, Jt as QueryKeyPart, Kt as QueryConsistency, Qt as ServerQueryHandler, S as createMutation, Ut as Mutation, Vt as InvalidateOnIntervalOptions, Wt as MutationOptions, Xt as QueryScope, Yt as QueryPrefetchContext, Zt as QueryStaleReason, _ as invalidateOnInterval, b as getDefaultDataRuntime, c as ServerQueryRegistry, d as defineServerQueries, f as dehydrateDataRuntime, g as invalidate, h as serveQuery, l as createQueryPrefetchContext, m as prefetchQuery, p as hydrateDataRuntime, qt as QueryDefinition, s as ServerQueryEntry, u as defineQuery, v as queryScope, x as createQuery, y as createDataRuntime, zt as DataRuntime } from "../index-KQ7Vl4-8.js";
|
|
2
2
|
export { type DataRuntime, type DataRuntimeOptions, type InvalidateOnIntervalOptions, type InvalidateOptions, type Mutation, type MutationOptions, type Query, type QueryConsistency, type QueryDefinition, type QueryKeyPart, type QueryPrefetchContext, type QueryScope, type QueryStaleReason, type ServerQueryEntry, type ServerQueryHandler, type ServerQueryRegistry, createDataRuntime, createMutation, createQuery, createQueryPrefetchContext, defineQuery, defineServerQueries, dehydrateDataRuntime, getDefaultDataRuntime, hydrateDataRuntime, invalidate, invalidateOnInterval, prefetchQuery, queryScope, serveQuery };
|
package/dist/data/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as getDefaultDataRuntime, t as createDataRuntime } from "../data-runtime-
|
|
2
|
-
import { c as queryScope, n as createMutation, o as invalidate, s as invalidateOnInterval, t as createQuery } from "../data-
|
|
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-
|
|
1
|
+
import { i as getDefaultDataRuntime, t as createDataRuntime } from "../data-runtime-JxoRgrrt.js";
|
|
2
|
+
import { c as queryScope, n as createMutation, o as invalidate, s as invalidateOnInterval, t as createQuery } from "../data-DYqokZzc.js";
|
|
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-CimB1YeW.js";
|
|
4
4
|
export { createDataRuntime, createMutation, createQuery, createQueryPrefetchContext, defineQuery, defineServerQueries, dehydrateDataRuntime, getDefaultDataRuntime, hydrateDataRuntime, invalidate, invalidateOnInterval, prefetchQuery, queryScope, serveQuery };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as enqueueRuntimeTask, y as logger } from "./access-
|
|
1
|
+
import { n as enqueueRuntimeTask, y as logger } from "./access-d_DCdwqn.js";
|
|
2
2
|
import { d as getCurrentAppRenderRuntime, f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-4I3yEMkb.js";
|
|
3
|
-
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-
|
|
3
|
+
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-BsdGWsDE.js";
|
|
4
4
|
import { n as getActiveRenderContext } from "./render-context-B7ohlh6t.js";
|
|
5
|
-
import { i as routeActive, n as documentVisible, o as timer, s as windowFocused } from "./lifecycle-operations-
|
|
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-
|
|
5
|
+
import { i as routeActive, n as documentVisible, o as timer, s as windowFocused } from "./lifecycle-operations-Qxq6ABrC.js";
|
|
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-JxoRgrrt.js";
|
|
7
7
|
//#region src/data/query-key.ts
|
|
8
8
|
function serializeQueryKeyNumber(part) {
|
|
9
9
|
if (Number.isNaN(part)) return "NaN";
|
|
@@ -44,13 +44,19 @@ function createQueryScope(namespace, invalidate) {
|
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/data/invalidation.ts
|
|
47
|
+
/** Mark all cached queries whose key starts with `prefix` as stale, triggering a refresh. */
|
|
47
48
|
function invalidate(prefix, options) {
|
|
48
49
|
invalidateQueriesForRuntime(resolveDataRuntimeState(options?.runtime), prefix, options?.markPendingWrite ?? false);
|
|
49
50
|
}
|
|
51
|
+
/** Create a {@link QueryScope} that namespaces keys and invalidations under `namespace`. */
|
|
50
52
|
function queryScope(namespace) {
|
|
51
53
|
return createQueryScope(namespace, invalidate);
|
|
52
54
|
}
|
|
53
55
|
const INVALIDATE_ON_INTERVAL_OPTIONS_ERROR = "[Askr] invalidateOnInterval() requires an options object with a finite numeric intervalMs.";
|
|
56
|
+
/**
|
|
57
|
+
* Periodically invalidate queries matching `prefix` on a fixed interval,
|
|
58
|
+
* optionally gated by active route, document visibility, or window focus.
|
|
59
|
+
*/
|
|
54
60
|
function invalidateOnInterval(prefix, options) {
|
|
55
61
|
if (!options || typeof options !== "object" || typeof options.intervalMs !== "number" || !Number.isFinite(options.intervalMs)) throw new Error(INVALIDATE_ON_INTERVAL_OPTIONS_ERROR);
|
|
56
62
|
const runtimeState = resolveDataRuntimeState(options.runtime);
|
|
@@ -190,6 +196,11 @@ var MutationCell = class {
|
|
|
190
196
|
});
|
|
191
197
|
}
|
|
192
198
|
};
|
|
199
|
+
/**
|
|
200
|
+
* Create a reactive {@link Mutation} cell bound to the current component,
|
|
201
|
+
* running `options.action` on `execute()` and optionally invalidating
|
|
202
|
+
* affected query prefixes on success.
|
|
203
|
+
*/
|
|
193
204
|
function createMutation(options) {
|
|
194
205
|
if (options.key !== void 0 && options.key.length === 0) throw new TypeError("createMutation key must be a non-empty string.");
|
|
195
206
|
const instance = getCurrentComponentInstance();
|
|
@@ -27,6 +27,7 @@ function createDataRuntimeState(queryCache, queryData, queryTestOverrides, mutat
|
|
|
27
27
|
mutationTestOverrides
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
+
/** Create a new, isolated {@link DataRuntime} with its own query/mutation caches. */
|
|
30
31
|
function createDataRuntime(options = {}) {
|
|
31
32
|
const runtime = Object.freeze({
|
|
32
33
|
queryCache: options.queryCache ?? /* @__PURE__ */ new Map(),
|
|
@@ -39,6 +40,7 @@ function createDataRuntime(options = {}) {
|
|
|
39
40
|
return runtime;
|
|
40
41
|
}
|
|
41
42
|
const defaultDataRuntime = createDataRuntime();
|
|
43
|
+
/** Get the process-wide default {@link DataRuntime} used when none is provided explicitly. */
|
|
42
44
|
function getDefaultDataRuntime() {
|
|
43
45
|
return defaultDataRuntime;
|
|
44
46
|
}
|