@askrjs/askr 0.0.91 → 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.
Files changed (95) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/dist/{access-Dpfoi4cA.js → access-d_DCdwqn.js} +8 -2
  3. package/dist/actions/index.d.ts +1 -1
  4. package/dist/actions/index.js +4 -3
  5. package/dist/{activity-dKH6nlpj.js → activity-BshyLB3_.js} +9 -5
  6. package/dist/{activity-CF2_JvJs.d.ts → activity-CJIQyo5X.d.ts} +5 -1
  7. package/dist/benchmark.d.ts +1 -1
  8. package/dist/benchmark.js +8 -8
  9. package/dist/boot/index.d.ts +12 -4
  10. package/dist/boot/index.js +1 -1
  11. package/dist/{boot-D3zVVWuN.js → boot-BsMB_ySP.js} +34 -22
  12. package/dist/{cleanup-c837KVij.js → cleanup-DefafSjG.js} +8 -5
  13. package/dist/{component-cleanup-BUfUleGZ.js → component-cleanup-hrqSikl2.js} +3 -3
  14. package/dist/{component-internal-C4uwwUaK.js → component-internal-DOVVMjG7.js} +8 -6
  15. package/dist/{component-scope-DzJEbYGE.js → component-scope-4I3yEMkb.js} +13 -1
  16. package/dist/components/index.d.ts +7 -2
  17. package/dist/components/index.js +2 -2
  18. package/dist/{compose-ref-Cc_YkUpM.js → compose-ref-1Fhs7mbF.js} +13 -0
  19. package/dist/{compose-ref-Cizq72-x.d.ts → compose-ref-DOJHoW5X.d.ts} +3 -0
  20. package/dist/control/index.d.ts +1 -1
  21. package/dist/control/index.js +1 -1
  22. package/dist/{control-CsGs2bLS.d.ts → control-DdFw-Caz.d.ts} +1 -1
  23. package/dist/{control-CON10J1p.js → control-DqOzkgc7.js} +9 -5
  24. package/dist/{csp-nonce-DH0TrDij.js → csp-nonce-BBxq1zq4.js} +8 -1
  25. package/dist/data/index.d.ts +1 -2
  26. package/dist/data/index.js +3 -3
  27. package/dist/{data-Bh_3OETq.js → data-DYqokZzc.js} +23 -12
  28. package/dist/{data-runtime-wbooGyu7.js → data-runtime-JxoRgrrt.js} +3 -1
  29. package/dist/{deferred-D6nZaIPs.js → deferred-BS0Xpstg.js} +10 -5
  30. package/dist/{effect-lnxQIpJG.js → effect-BdvdgMvV.js} +73 -14
  31. package/dist/{fastlane-CrfB3QG0.js → fastlane-DGo7SxBQ.js} +23 -4
  32. package/dist/{for-internal-Bsm0B8GZ.js → for-internal-jrliHZmF.js} +6 -6
  33. package/dist/foundations/icon/index.d.ts +14 -3
  34. package/dist/foundations/icon/index.js +8 -0
  35. package/dist/foundations/index.d.ts +2 -2
  36. package/dist/foundations/index.js +1 -1
  37. package/dist/foundations/interactions/index.d.ts +18 -2
  38. package/dist/foundations/interactions/index.js +1 -1
  39. package/dist/foundations/state/index.d.ts +8 -1
  40. package/dist/foundations/state/index.js +7 -1
  41. package/dist/foundations/structures/index.d.ts +2 -2
  42. package/dist/foundations/structures/index.js +1 -1
  43. package/dist/foundations/utilities/index.d.ts +2 -2
  44. package/dist/foundations/utilities/index.js +1 -1
  45. package/dist/fx/index.d.ts +10 -1
  46. package/dist/fx/index.js +8 -2
  47. package/dist/{index-Cf2ANwPL.d.ts → index-C29SEGIv.d.ts} +30 -3
  48. package/dist/{index-BnU0NPwM.d.ts → index-CzH-0LcA.d.ts} +18 -0
  49. package/dist/index-KQ7Vl4-8.d.ts +1364 -0
  50. package/dist/index.d.ts +3 -7
  51. package/dist/index.js +34 -18
  52. package/dist/{interactions-CWkNEq_C.js → interactions-B4XaFxt1.js} +6 -1
  53. package/dist/{jsx-C3IECePB.js → jsx-DRS-qjiN.js} +2 -0
  54. package/dist/jsx-dev-runtime.d.ts +2 -3
  55. package/dist/jsx-dev-runtime.js +1 -1
  56. package/dist/jsx-runtime-BTzDdBJ_.d.ts +2 -0
  57. package/dist/{jsx-runtime-LHh5tcTe.d.ts → jsx-runtime-Cdd6Gkb0.d.ts} +4 -3
  58. package/dist/jsx-runtime.d.ts +2 -2
  59. package/dist/jsx-runtime.js +1 -1
  60. package/dist/{lifecycle-batch-Dfpid9-A.js → lifecycle-batch-BH0fax4F.js} +2 -2
  61. package/dist/{lifecycle-operations-CMK1AN2C.js → lifecycle-operations-Qxq6ABrC.js} +7 -2
  62. package/dist/{manifest-fBb2ynKL.js → manifest-D6rfj_jC.js} +5 -1
  63. package/dist/{navigate-BO7M2iUG.d.ts → navigate-BL_FIIJ6.d.ts} +6 -1
  64. package/dist/{navigate-CnQMXze1.js → navigate-CECCMPAr.js} +16 -11
  65. package/dist/{query-registry-B4LpVtlT.js → query-registry-CimB1YeW.js} +11 -1
  66. package/dist/{readable-B5NtV7V0.js → readable-BsdGWsDE.js} +9 -6
  67. package/dist/{renderer-y2DL627q.js → renderer-CLvq458M.js} +235 -189
  68. package/dist/{resolution-C9A31xQi.js → resolution-D8PgnTzh.js} +12 -6
  69. package/dist/{resource-operation-whZDJAYv.js → resource-operation-CLQXCn1p.js} +5 -5
  70. package/dist/resources/index.d.ts +15 -2
  71. package/dist/resources/index.js +7 -6
  72. package/dist/{route-matching-xlgdQXg_.js → route-matching-Bo6UqG-5.js} +13 -4
  73. package/dist/router/index.d.ts +46 -6
  74. package/dist/router/index.js +16 -9
  75. package/dist/{selector-BLNkRZ2i.js → selector-CyK-sDwB.js} +24 -6
  76. package/dist/ssg/index.d.ts +5 -2
  77. package/dist/ssg/index.js +6 -6
  78. package/dist/ssr/index.d.ts +16 -5
  79. package/dist/ssr/index.js +1 -1
  80. package/dist/{ssr-DNJUPmMq.js → ssr-8_vHDWqV.js} +20 -12
  81. package/dist/{state-DCjONcHK.js → state-DmkGM_LN.js} +5 -5
  82. package/dist/{structures-m-cphWI-.js → structures-umvVUD-M.js} +20 -6
  83. package/dist/testing/index.d.ts +31 -3
  84. package/dist/testing/index.js +24 -6
  85. package/dist/{jsx-BYXe_Nnk.d.ts → types-DkVJhVs9.d.ts} +20 -0
  86. package/dist/{verify-hydration-D8938Fw2.js → verify-hydration-jf8X2V3x.js} +1 -1
  87. package/package.json +1 -1
  88. package/dist/control-D-FIa-n-.d.ts +0 -451
  89. package/dist/index-BU17hud9.d.ts +0 -52
  90. package/dist/index-CPlPDbEY.d.ts +0 -64
  91. package/dist/index-Izwp_ESC.d.ts +0 -458
  92. package/dist/jsx-runtime-BqhMEuT4.d.ts +0 -2
  93. package/dist/scheduler-CmLO4Dfm.d.ts +0 -65
  94. package/dist/types-CsPtBGWb.d.ts +0 -16
  95. package/dist/types-iAmDSV6o.d.ts +0 -179
@@ -1,3 +1,2 @@
1
- import { a as Mutation, c as QueryConsistency, f as QueryPrefetchContext, h as ServerQueryHandler, i as InvalidateOptions, l as QueryDefinition, m as QueryStaleReason, n as DataRuntimeOptions, o as MutationOptions, p as QueryScope, r as InvalidateOnIntervalOptions, s as Query, t as DataRuntime, u as QueryKeyPart } from "../types-iAmDSV6o.js";
2
- import { a as defineServerQueries, c as prefetchQuery, d as invalidateOnInterval, f as queryScope, g as createMutation, h as createQuery, i as defineQuery, l as serveQuery, m as getDefaultDataRuntime, n as ServerQueryRegistry, o as dehydrateDataRuntime, p as createDataRuntime, r as createQueryPrefetchContext, s as hydrateDataRuntime, t as ServerQueryEntry, u as invalidate } from "../index-CPlPDbEY.js";
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";
3
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 };
@@ -1,4 +1,4 @@
1
- import { i as getDefaultDataRuntime, t as createDataRuntime } from "../data-runtime-wbooGyu7.js";
2
- import { c as queryScope, n as createMutation, o as invalidate, s as invalidateOnInterval, t as createQuery } from "../data-Bh_3OETq.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-B4LpVtlT.js";
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, v as logger } from "./access-Dpfoi4cA.js";
2
- import { d as getCurrentAppRenderRuntime, 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";
1
+ import { n as enqueueRuntimeTask, y as logger } from "./access-d_DCdwqn.js";
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-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-CMK1AN2C.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-wbooGyu7.js";
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();
@@ -339,12 +350,12 @@ var QueryCell = class {
339
350
  }
340
351
  ensureStarted() {
341
352
  if (this.destroyed || this.state.data !== null || this.pendingRefresh || this.startQueued || this.options.skipInitialFetch) return;
342
- this.queueStart("initial");
353
+ this.queueStart();
343
354
  }
344
355
  refresh() {
345
356
  if (this.destroyed) return Promise.resolve();
346
357
  if (this.pendingRefresh) return this.pendingRefresh;
347
- this.queueStart("manual");
358
+ this.queueStart();
348
359
  return this.pendingRefresh ?? Promise.resolve();
349
360
  }
350
361
  invalidate() {
@@ -353,7 +364,7 @@ var QueryCell = class {
353
364
  this.controller?.abort();
354
365
  this.finishPendingRefresh(this.pendingRefreshToken);
355
366
  }
356
- this.queueStart("invalidate");
367
+ this.queueStart();
357
368
  }
358
369
  markPendingWrite() {
359
370
  if (this.destroyed) return;
@@ -367,7 +378,7 @@ var QueryCell = class {
367
378
  staleReason: null
368
379
  });
369
380
  }
370
- queueStart(reason) {
381
+ queueStart() {
371
382
  if (this.destroyed) return;
372
383
  this.startQueued = true;
373
384
  const token = ++this.pendingRefreshToken;
@@ -379,7 +390,7 @@ var QueryCell = class {
379
390
  this.finishPendingRefresh(token);
380
391
  return;
381
392
  }
382
- this.start(reason).finally(() => {
393
+ this.start().finally(() => {
383
394
  this.finishPendingRefresh(token);
384
395
  });
385
396
  });
@@ -400,7 +411,7 @@ var QueryCell = class {
400
411
  };
401
412
  notifySource(this.source);
402
413
  }
403
- async start(reason) {
414
+ async start() {
404
415
  if (this.destroyed) return;
405
416
  this.generation += 1;
406
417
  const generation = this.generation;
@@ -412,7 +423,7 @@ var QueryCell = class {
412
423
  loading: !hasData,
413
424
  refreshing: hasData,
414
425
  stale: hasData,
415
- consistency: reason === "pending-write" ? "pending-write" : hasData ? "refreshing" : "fresh",
426
+ consistency: hasData ? "refreshing" : "fresh",
416
427
  error: null,
417
428
  staleReason: null
418
429
  });
@@ -1,4 +1,4 @@
1
- import { d as getCurrentAppRenderRuntime } from "./component-scope-DzJEbYGE.js";
1
+ import { d as getCurrentAppRenderRuntime } from "./component-scope-4I3yEMkb.js";
2
2
  import { n as getActiveRenderContext } from "./render-context-B7ohlh6t.js";
3
3
  //#region src/data/invalidation-listeners.ts
4
4
  const invalidationListeners = /* @__PURE__ */ new Set();
@@ -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
  }
@@ -1,9 +1,9 @@
1
- import { d as getCurrentAppRenderRuntime, f as getCurrentComponentInstance } from "./component-scope-DzJEbYGE.js";
2
- import { i as getExecutionModel } from "./manifest-fBb2ynKL.js";
1
+ import { d as getCurrentAppRenderRuntime, f as getCurrentComponentInstance } from "./component-scope-4I3yEMkb.js";
2
+ import { i as getExecutionModel } from "./manifest-D6rfj_jC.js";
3
3
  import { n as getActiveRenderContext, r as getCurrentRenderData } from "./render-context-B7ohlh6t.js";
4
- import { t as resource } from "./resource-operation-whZDJAYv.js";
5
- 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-xlgdQXg_.js";
6
- import { _ as createRouteHandler, d as DEFERRED_BOUNDARY, p as isDeferred, s as guardHydratedRouteData } from "./resolution-C9A31xQi.js";
4
+ import { t as resource } from "./resource-operation-CLQXCn1p.js";
5
+ 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-Bo6UqG-5.js";
6
+ import { _ as createRouteHandler, d as DEFERRED_BOUNDARY, p as isDeferred, s as guardHydratedRouteData } from "./resolution-D8PgnTzh.js";
7
7
  import { allOf } from "@askrjs/auth";
8
8
  //#region src/router/access.ts
9
9
  function compileNodePolicies(node) {
@@ -167,12 +167,14 @@ function page(path, Component, optionsOrFn, maybeFn) {
167
167
  if (typeof fn !== "function") throw new Error("page(path, Component, fn) requires a route definition callback as the final argument.");
168
168
  pushPageScope(path, Component, options, fn);
169
169
  }
170
+ /** Declare the index route for the enclosing `page()` scope. */
170
171
  function index(Component, options) {
171
172
  const pageScope = getCurrentPageScope();
172
173
  if (pageScope?.hasIndex) throw new Error("page() cannot declare multiple index routes.");
173
174
  if (pageScope) pageScope.hasIndex = true;
174
175
  registerRouteAtResolvedPath(resolveIndexPath(), Component, options);
175
176
  }
177
+ /** Declare the catch-all `/*` fallback route for the enclosing scope. */
176
178
  function fallback(Component) {
177
179
  if (hasActivePageScope()) {
178
180
  if (getCurrentScopeKind() !== "page") throw new Error("fallback() inside page() must be declared directly in the page scope, not inside nested group().");
@@ -225,6 +227,7 @@ function awaitWithSignal(promise, signal) {
225
227
  });
226
228
  });
227
229
  }
230
+ /** Recursively await any {@link Deferred} values nested within `input`, returning it once fully resolved. */
228
231
  async function resolveDeferredValues(input, signal) {
229
232
  const seen = /* @__PURE__ */ new Set();
230
233
  const visit = async (value) => {
@@ -242,6 +245,7 @@ async function resolveDeferredValues(input, signal) {
242
245
  await visit(input);
243
246
  return input;
244
247
  }
248
+ /** Read the current route's server loader data during render or hydration. */
245
249
  function routeData() {
246
250
  const envelope = getCurrentRenderData();
247
251
  if (envelope) return guardHydratedRouteData(envelope.route, envelope.framework);
@@ -252,6 +256,7 @@ function routeData() {
252
256
  function rejectedChild(props, error) {
253
257
  return typeof props.rejected === "function" ? props.rejected(error) : props.rejected ?? null;
254
258
  }
259
+ /** Render a {@link Deferred} value's fulfilled state, a pending placeholder, or a rejected fallback. */
255
260
  function Resolve(props) {
256
261
  if (props.value.state === "fulfilled") return props.children(props.value.value);
257
262
  if (props.value.state === "rejected") return rejectedChild(props, props.value.error);
@@ -1,5 +1,5 @@
1
- import { t as enqueueRuntimeLane } from "./access-Dpfoi4cA.js";
2
- import { m as withFineGrainedReadTracking } from "./readable-B5NtV7V0.js";
1
+ import { t as enqueueRuntimeLane } from "./access-d_DCdwqn.js";
2
+ import { m as withFineGrainedReadTracking } from "./readable-BsdGWsDE.js";
3
3
  //#region src/runtime/effect.ts
4
4
  const SOURCE_EFFECTS = Symbol("askr.source-effects");
5
5
  const effectSources = /* @__PURE__ */ new WeakMap();
@@ -92,15 +92,28 @@ function evaluateAndCommitEffect(effect) {
92
92
  effect._pendingFineGrainedReadSource = null;
93
93
  effect._pendingFineGrainedReadSources = null;
94
94
  try {
95
- const value = withFineGrainedReadTracking(effect, effect.compute);
96
- const pendingAdditionalSources = effect._pendingFineGrainedReadSources;
97
- const hasPendingCollection = isEffectReadSourceCollection(pendingAdditionalSources);
98
- commitEffectResult(effect, value, hasPendingCollection ? pendingAdditionalSources : effect._pendingFineGrainedReadSource, pendingAdditionalSources && !hasPendingCollection ? pendingAdditionalSources : null);
95
+ let value;
96
+ try {
97
+ value = withFineGrainedReadTracking(effect, effect.compute);
98
+ } catch (error) {
99
+ if (!effect.hasValue) {
100
+ const [nextSources, nextSource2] = getPendingEffectSources(effect);
101
+ commitEffectSubscriptions(effect, nextSources, nextSource2);
102
+ }
103
+ throw error;
104
+ }
105
+ const [nextSources, nextSource2] = getPendingEffectSources(effect);
106
+ commitEffectResult(effect, value, nextSources, nextSource2);
99
107
  } finally {
100
108
  effect._pendingFineGrainedReadSource = null;
101
109
  effect._pendingFineGrainedReadSources = null;
102
110
  }
103
111
  }
112
+ function getPendingEffectSources(effect) {
113
+ const pendingAdditionalSources = effect._pendingFineGrainedReadSources;
114
+ const hasPendingCollection = isEffectReadSourceCollection(pendingAdditionalSources);
115
+ return [hasPendingCollection ? pendingAdditionalSources : effect._pendingFineGrainedReadSource, pendingAdditionalSources && !hasPendingCollection ? pendingAdditionalSources : null];
116
+ }
104
117
  function commitEffectSubscriptions(effect, nextSources, nextSource2) {
105
118
  const previousSources = effect.readSources;
106
119
  const previousSource2 = effect.readSource2;
@@ -144,17 +157,26 @@ function commitEffectSubscriptions(effect, nextSources, nextSource2) {
144
157
  }
145
158
  function commitEffectResult(effect, value, nextSources, nextSource2) {
146
159
  const previousValue = effect.lastValue;
147
- if (!effect.hasValue || !effect.equals(previousValue, value)) effect.commit(value, effect.hasValue ? previousValue : void 0);
160
+ const shouldCommit = !effect.hasValue || !effect.equals(previousValue, value);
148
161
  commitEffectSubscriptions(effect, nextSources, nextSource2);
162
+ if (shouldCommit) effect.commit(value, effect.hasValue ? previousValue : void 0);
149
163
  effect.lastValue = value;
150
164
  effect.hasValue = true;
151
165
  }
166
+ function handleEffectError(effect, error) {
167
+ if (effect.onError) {
168
+ effect.onError(error);
169
+ return;
170
+ }
171
+ throw error;
172
+ }
152
173
  function flushLaneEffects(lane) {
153
174
  hasPendingLaneFlush[lane] = false;
154
175
  const effects = dirtyEffectsByLane[lane];
155
176
  if (effects.size === 0) return;
156
177
  const pending = effects.values();
157
178
  const effectRuns = /* @__PURE__ */ new Map();
179
+ let failures = null;
158
180
  let next = pending.next();
159
181
  while (!next.done) {
160
182
  const effect = next.value;
@@ -167,18 +189,27 @@ function flushLaneEffects(lane) {
167
189
  effectRuns.set(effect, runCount);
168
190
  if (runCount > MAX_EFFECT_RUNS_PER_FLUSH) {
169
191
  const error = /* @__PURE__ */ new Error(`[Askr] fine-grained effect exceeded ${MAX_EFFECT_RUNS_PER_FLUSH} runs in one flush. Likely reactive cycle.`);
170
- if (effect.onError) effect.onError(error);
171
- else throw error;
192
+ try {
193
+ handleEffectError(effect, error);
194
+ } catch (unhandledError) {
195
+ (failures ??= []).push(unhandledError);
196
+ }
172
197
  next = pending.next();
173
198
  continue;
174
199
  }
175
200
  try {
176
201
  evaluateAndCommitEffect(effect);
177
202
  } catch (error) {
178
- effect.onError?.(error);
203
+ try {
204
+ handleEffectError(effect, error);
205
+ } catch (unhandledError) {
206
+ (failures ??= []).push(unhandledError);
207
+ }
179
208
  }
180
209
  next = pending.next();
181
210
  }
211
+ if (failures?.length === 1) throw failures[0];
212
+ if (failures && failures.length > 1) throw new AggregateError(failures, "Fine-grained effect failures");
182
213
  }
183
214
  function scheduleLaneFlush(lane) {
184
215
  if (hasPendingLaneFlush[lane]) return;
@@ -189,7 +220,11 @@ function unscheduleEffect(effect) {
189
220
  dirtyEffectsByLane[effect.lane].delete(effect);
190
221
  }
191
222
  function recomputeEffectNow(effect) {
192
- evaluateAndCommitEffect(effect);
223
+ try {
224
+ evaluateAndCommitEffect(effect);
225
+ } catch (error) {
226
+ handleEffectError(effect, error);
227
+ }
193
228
  }
194
229
  function markFineGrainedEffectsDirtySource(source) {
195
230
  const registered = getRegisteredEffects(source);
@@ -235,9 +270,23 @@ var FineGrainedEffectImpl = class {
235
270
  }
236
271
  updateCompute(nextCompute) {
237
272
  if (!this.isActive) return;
273
+ const previousCompute = this.compute;
274
+ const previousReadSources = this.readSources;
275
+ const previousReadSource2 = this.readSource2;
276
+ const previousHasValue = this.hasValue;
277
+ const previousLastValue = this.lastValue;
238
278
  this.compute = nextCompute;
239
279
  unscheduleEffect(this);
240
- recomputeEffectNow(this);
280
+ try {
281
+ recomputeEffectNow(this);
282
+ } catch (error) {
283
+ this.compute = previousCompute;
284
+ unscheduleEffect(this);
285
+ commitEffectSubscriptions(this, previousReadSources, previousReadSource2);
286
+ this.hasValue = previousHasValue;
287
+ this.lastValue = previousLastValue;
288
+ throw error;
289
+ }
241
290
  }
242
291
  flush() {
243
292
  if (!this.isActive) return;
@@ -247,13 +296,23 @@ var FineGrainedEffectImpl = class {
247
296
  };
248
297
  function createFineGrainedEffect(options) {
249
298
  const effect = new FineGrainedEffectImpl(options.lane, options.compute, options.commit, options.equals ?? Object.is, options.onError, options._owner);
250
- recomputeEffectNow(effect);
299
+ try {
300
+ recomputeEffectNow(effect);
301
+ } catch (error) {
302
+ effect.cleanup();
303
+ throw error;
304
+ }
251
305
  return effect;
252
306
  }
253
307
  /** @internal Allocation-sensitive variant for shared renderer callbacks. */
254
308
  function createOwnedFineGrainedEffect(lane, compute, commit, equals, onError, owner) {
255
309
  const effect = new FineGrainedEffectImpl(lane, compute, commit, equals, onError, owner);
256
- recomputeEffectNow(effect);
310
+ try {
311
+ recomputeEffectNow(effect);
312
+ } catch (error) {
313
+ effect.cleanup();
314
+ throw error;
315
+ }
257
316
  return effect;
258
317
  }
259
318
  //#endregion
@@ -1,6 +1,6 @@
1
- import { b as isDevelopmentEnvironment, l as runRuntimeWithSyncProgress, o as getRuntimeRenderer, u as setRuntimeBulkCommitProbe } from "./access-Dpfoi4cA.js";
2
- import { i as isFragmentType } from "./jsx-C3IECePB.js";
3
- import { i as finalizeReadableSubscriptions } from "./readable-B5NtV7V0.js";
1
+ import { d as setRuntimeBulkCommitProbe, o as getRuntimeRenderer, u as runRuntimeWithSyncProgress, x as isDevelopmentEnvironment } from "./access-d_DCdwqn.js";
2
+ import { i as isFragmentType } from "./jsx-DRS-qjiN.js";
3
+ import { i as finalizeReadableSubscriptions, l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty } from "./readable-BsdGWsDE.js";
4
4
  //#region src/runtime/dev-namespace.ts
5
5
  /**
6
6
  * Set a value in the dev namespace (no-op in production).
@@ -14,18 +14,37 @@ const incDevCounter = () => {};
14
14
  //#endregion
15
15
  //#region src/runtime/fastlane.ts
16
16
  let _bulkCommitActive = false;
17
+ let _bulkCommitDepth = 0;
17
18
  let _appliedParents = null;
19
+ let _deferredReadableSources = null;
18
20
  function enterBulkCommit() {
21
+ _bulkCommitDepth += 1;
22
+ if (_bulkCommitDepth > 1) return;
19
23
  _bulkCommitActive = true;
20
24
  _appliedParents = /* @__PURE__ */ new WeakSet();
25
+ _deferredReadableSources = /* @__PURE__ */ new Set();
21
26
  }
22
27
  function exitBulkCommit() {
28
+ if (_bulkCommitDepth === 0) return;
29
+ _bulkCommitDepth -= 1;
30
+ if (_bulkCommitDepth > 0) return;
23
31
  _bulkCommitActive = false;
32
+ const deferredReadableSources = _deferredReadableSources;
24
33
  _appliedParents = null;
34
+ _deferredReadableSources = null;
35
+ if (!deferredReadableSources) return;
36
+ for (const source of deferredReadableSources) {
37
+ markReadableDerivedSubscribersDirty(source);
38
+ markReactivePropsDirtySource(source);
39
+ notifyReadableReaders(source);
40
+ }
25
41
  }
26
42
  function isBulkCommitActive() {
27
43
  return _bulkCommitActive;
28
44
  }
45
+ function deferBulkCommitReadableNotification(source) {
46
+ _deferredReadableSources?.add(source);
47
+ }
29
48
  function markFastPathApplied(parent) {
30
49
  if (!_appliedParents) return;
31
50
  try {
@@ -144,4 +163,4 @@ function tryRuntimeFastLaneSync(instance, result) {
144
163
  }
145
164
  setRuntimeBulkCommitProbe(isBulkCommitActive);
146
165
  //#endregion
147
- export { setDevValue as a, incDevCounter as i, markFastPathApplied as n, tryRuntimeFastLaneSync as r, isBulkCommitActive as t };
166
+ export { incDevCounter as a, tryRuntimeFastLaneSync as i, isBulkCommitActive as n, setDevValue as o, markFastPathApplied as r, deferBulkCommitReadableNotification as t };
@@ -1,10 +1,10 @@
1
1
  import { n as _isDOMElement } from "./vnode-D24p6IW2.js";
2
- import { b as isDevelopmentEnvironment, o as getRuntimeRenderer, v as logger } from "./access-Dpfoi4cA.js";
3
- import { h as getCurrentStateIndex, i as claimHookIndex, o as clearRenderTracking, p as getCurrentInstance } from "./component-scope-DzJEbYGE.js";
4
- import { h as haveEquivalentContextFrames, n as createComponentInstance, s as renderScopedComponent, v as rebaseVNodeTreeWithContextFrame } from "./component-internal-C4uwwUaK.js";
5
- import { d as shouldCoalesceFineGrainedItemReads, l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-B5NtV7V0.js";
6
- import { i as unregisterOwnedChildScope, r as registerOwnedChildScope, t as cleanupComponent } from "./component-cleanup-BUfUleGZ.js";
7
- import { o as finalizeInlineReadSubscriptions, u as registerLifecycleTransaction } from "./lifecycle-batch-Dfpid9-A.js";
2
+ import { o as getRuntimeRenderer, x as isDevelopmentEnvironment, y as logger } from "./access-d_DCdwqn.js";
3
+ import { h as getCurrentStateIndex, i as claimHookIndex, o as clearRenderTracking, p as getCurrentInstance } from "./component-scope-4I3yEMkb.js";
4
+ import { h as haveEquivalentContextFrames, n as createComponentInstance, s as renderScopedComponent, v as rebaseVNodeTreeWithContextFrame } from "./component-internal-DOVVMjG7.js";
5
+ import { d as shouldCoalesceFineGrainedItemReads, l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-BsdGWsDE.js";
6
+ import { i as unregisterOwnedChildScope, r as registerOwnedChildScope, t as cleanupComponent } from "./component-cleanup-hrqSikl2.js";
7
+ import { o as finalizeInlineReadSubscriptions, u as registerLifecycleTransaction } from "./lifecycle-batch-BH0fax4F.js";
8
8
  //#region src/runtime/child-scope.ts
9
9
  const EMPTY_CHILD_SCOPE_PROPS = {};
10
10
  const childScopesByInstance = /* @__PURE__ */ new WeakMap();
@@ -1,9 +1,11 @@
1
- import { r as JSXElement, s as Props } from "../../jsx-BYXe_Nnk.js";
2
- import "../../types-CsPtBGWb.js";
3
- import { t as Ref } from "../../compose-ref-Cizq72-x.js";
1
+ import { r as JSXElement, s as Props } from "../../types-DkVJhVs9.js";
2
+ import { t as Ref } from "../../compose-ref-DOJHoW5X.js";
4
3
  //#region src/foundations/icon/icon.types.d.ts
4
+ /** Named icon size presets, mapped to CSS variables at render time. */
5
5
  type IconSizeToken = 'sm' | 'md' | 'lg' | 'xl';
6
+ /** Camel-cased CSS style object accepted by icon `style` props. */
6
7
  type IconStyleObject = Record<string, unknown>;
8
+ /** Props specific to the icon contract, independent of the underlying `<svg>` props. */
7
9
  type IconOwnProps = {
8
10
  size?: number | string;
9
11
  strokeWidth?: number;
@@ -13,18 +15,26 @@ type IconOwnProps = {
13
15
  style?: string | IconStyleObject;
14
16
  iconName?: string;
15
17
  };
18
+ /** Full prop set accepted by {@link IconBase} and generated icon components. */
16
19
  type IconProps = Omit<Props, 'children' | 'class' | 'color' | 'height' | 'ref' | 'role' | 'stroke' | 'stroke-width' | 'style' | 'title' | 'width'> & IconOwnProps & {
17
20
  children?: unknown;
18
21
  ref?: Ref<SVGSVGElement>;
19
22
  };
20
23
  //#endregion
21
24
  //#region src/foundations/icon/icon.d.ts
25
+ /** Check whether `value` is one of the named icon size tokens ('sm'|'md'|'lg'|'xl'). */
22
26
  declare function isIconSizeToken(value: unknown): value is IconSizeToken;
27
+ /** Normalize a numeric icon size to a `px` string; strings pass through unchanged. */
23
28
  declare function normalizeIconSizeValue(size: number | string): string;
29
+ /** Resolve a size (token or literal) to a CSS `var(--ak-icon-size-*, ...)` expression or literal value. */
24
30
  declare function resolveIconSizeVariable(size: number | string): string;
31
+ /** Resolve a stroke width to a CSS `var(--ak-icon-stroke-width-*, ...)` expression, scoped to `sizeToken` when given. */
25
32
  declare function resolveIconStrokeWidthVariable(strokeWidth: number, sizeToken: IconSizeToken | undefined): string;
33
+ /** Serialize an inline style object (or pass through a string) to a CSS declaration string. */
26
34
  declare function serializeIconStyle(style: string | IconStyleObject | undefined): string;
35
+ /** Join non-empty CSS declaration fragments with `;`, dropping any that are blank. */
27
36
  declare function joinIconStyle(...styles: Array<string | undefined>): string | undefined;
37
+ /** Compute the shared SVG attributes and inline style implementing the icon size/stroke/color contract. */
28
38
  declare function getIconContractProps({ size, strokeWidth, color, title, style, iconName }: Pick<IconProps, 'color' | 'iconName' | 'size' | 'strokeWidth' | 'style' | 'title'>): {
29
39
  sizeToken: IconSizeToken | undefined;
30
40
  decorative: string | undefined;
@@ -46,6 +56,7 @@ declare function getIconContractProps({ size, strokeWidth, color, title, style,
46
56
  'data-color': string | undefined;
47
57
  };
48
58
  };
59
+ /** Base `<svg>` wrapper implementing the icon contract; generated icon components render into it. */
49
60
  declare function IconBase({ size, strokeWidth, color, title, class: className, style, iconName, children, ref, ...rest }: IconProps): JSXElement;
50
61
  //#endregion
51
62
  export { IconBase, type IconOwnProps, type IconProps, type IconSizeToken, type IconStyleObject, getIconContractProps, isIconSizeToken, joinIconStyle, normalizeIconSizeValue, resolveIconSizeVariable, resolveIconStrokeWidthVariable, serializeIconStyle };
@@ -6,17 +6,21 @@ const ICON_SIZE_TOKENS = [
6
6
  "lg",
7
7
  "xl"
8
8
  ];
9
+ /** Check whether `value` is one of the named icon size tokens ('sm'|'md'|'lg'|'xl'). */
9
10
  function isIconSizeToken(value) {
10
11
  return typeof value === "string" && ICON_SIZE_TOKENS.includes(value);
11
12
  }
13
+ /** Normalize a numeric icon size to a `px` string; strings pass through unchanged. */
12
14
  function normalizeIconSizeValue(size) {
13
15
  if (typeof size === "number") return `${size}px`;
14
16
  return size;
15
17
  }
18
+ /** Resolve a size (token or literal) to a CSS `var(--ak-icon-size-*, ...)` expression or literal value. */
16
19
  function resolveIconSizeVariable(size) {
17
20
  if (isIconSizeToken(size)) return `var(--ak-icon-size-${size}, var(--ak-icon-size-md, 1.25rem))`;
18
21
  return normalizeIconSizeValue(size);
19
22
  }
23
+ /** Resolve a stroke width to a CSS `var(--ak-icon-stroke-width-*, ...)` expression, scoped to `sizeToken` when given. */
20
24
  function resolveIconStrokeWidthVariable(strokeWidth, sizeToken) {
21
25
  if (sizeToken) return `var(--ak-icon-stroke-width-${sizeToken}, var(--ak-icon-stroke-width-md, ${strokeWidth}))`;
22
26
  return `var(--ak-icon-stroke-width-md, ${strokeWidth})`;
@@ -24,15 +28,18 @@ function resolveIconStrokeWidthVariable(strokeWidth, sizeToken) {
24
28
  function camelToKebab(key) {
25
29
  return key.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);
26
30
  }
31
+ /** Serialize an inline style object (or pass through a string) to a CSS declaration string. */
27
32
  function serializeIconStyle(style) {
28
33
  if (!style) return "";
29
34
  if (typeof style === "string") return style.trim();
30
35
  return Object.entries(style).filter(([, value]) => value !== void 0 && value !== null).map(([key, value]) => `${camelToKebab(key)}:${String(value)}`).join(";");
31
36
  }
37
+ /** Join non-empty CSS declaration fragments with `;`, dropping any that are blank. */
32
38
  function joinIconStyle(...styles) {
33
39
  const merged = styles.map((style) => style?.trim()).filter(Boolean);
34
40
  return merged.length > 0 ? merged.join(";") : void 0;
35
41
  }
42
+ /** Compute the shared SVG attributes and inline style implementing the icon size/stroke/color contract. */
36
43
  function getIconContractProps({ size = 20, strokeWidth = 2, color = "currentColor", title, style, iconName }) {
37
44
  const sizeToken = isIconSizeToken(size) ? size : void 0;
38
45
  const decorative = title ? void 0 : "true";
@@ -61,6 +68,7 @@ function getIconContractProps({ size = 20, strokeWidth = 2, color = "currentColo
61
68
  }
62
69
  };
63
70
  }
71
+ /** Base `<svg>` wrapper implementing the icon contract; generated icon components render into it. */
64
72
  function IconBase({ size = 20, strokeWidth = 2, color = "currentColor", title, class: className, style, iconName, children, ref, ...rest }) {
65
73
  const { attrs } = getIconContractProps({
66
74
  size,
@@ -1,3 +1,3 @@
1
- import { r as JSXElement } from "../jsx-BYXe_Nnk.js";
2
- import { c as DefaultPortal, d as definePortal, f as Presence, h as SlotProps, l as Portal, m as Slot, p as PresenceProps, u as PortalProps, v as LayoutComponent, y as layout } from "../index-Cf2ANwPL.js";
1
+ import { r as JSXElement } from "../types-DkVJhVs9.js";
2
+ import { c as DefaultPortal, d as definePortal, f as Presence, h as SlotProps, l as Portal, m as Slot, p as PresenceProps, u as PortalProps, v as LayoutComponent, y as layout } from "../index-C29SEGIv.js";
3
3
  export { DefaultPortal, type JSXElement, type LayoutComponent, Portal, type PortalProps, Presence, type PresenceProps, Slot, type SlotProps, definePortal, layout };
@@ -1,2 +1,2 @@
1
- import { a as definePortal, c as layout, i as Portal, o as Presence, r as DefaultPortal, s as Slot } from "../structures-m-cphWI-.js";
1
+ import { a as definePortal, c as layout, i as Portal, o as Presence, r as DefaultPortal, s as Slot } from "../structures-umvVUD-M.js";
2
2
  export { DefaultPortal, Portal, Presence, Slot, definePortal, layout };