@askrjs/askr 0.0.66 → 0.0.68

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 (70) hide show
  1. package/dist/actions/index.d.ts +1 -1
  2. package/dist/actions/index.js +1 -1
  3. package/dist/{authoring-Di8MInO-.js → authoring-uaJ556aG.js} +1 -1
  4. package/dist/benchmark.d.ts +1 -0
  5. package/dist/benchmark.js +7 -7
  6. package/dist/boot/index.d.ts +7 -6
  7. package/dist/boot/index.js +1 -1
  8. package/dist/{boot-B4UZumvB.js → boot-C8UOxI4f.js} +10 -9
  9. package/dist/{cleanup-B6KovDZZ.js → cleanup-UyStxIHG.js} +22 -8
  10. package/dist/component-cleanup-1ZFoLLHt.js +141 -0
  11. package/dist/{component-internal-CbALfPGD.js → component-internal-CPjM4n8M.js} +23 -3
  12. package/dist/components/index.d.ts +1 -2
  13. package/dist/control/index.d.ts +1 -1
  14. package/dist/control/index.js +1 -1
  15. package/dist/{control-B5xu8v4m.d.ts → control-BjYBlytA.d.ts} +0 -1
  16. package/dist/{control-KVP6LMEQ.js → control-CA45Yvvu.js} +3 -3
  17. package/dist/{control-CMzFPMjr.d.ts → control-DO-iBEtV.d.ts} +0 -1
  18. package/dist/{csp-nonce-C-8E85El.js → csp-nonce-HGZ0vbqT.js} +1 -1
  19. package/dist/data/index.js +1 -1
  20. package/dist/{data-DvYo_dHd.js → data-DHt_zO1G.js} +2 -2
  21. package/dist/{deferred-Eh9bCVGH.js → deferred-zHtUheIQ.js} +4 -4
  22. package/dist/{effect-D_4zf_wy.js → effect-CFUzIpqX.js} +1 -1
  23. package/dist/fastlane-BTcFCMnm.js +147 -0
  24. package/dist/{for-internal-B2rBq6yB.js → for-internal-BtK9Htl0.js} +4 -3
  25. package/dist/foundations/icon/index.d.ts +3 -21
  26. package/dist/foundations/index.d.ts +1 -1
  27. package/dist/foundations/index.js +1 -1
  28. package/dist/foundations/interactions/index.d.ts +31 -26
  29. package/dist/foundations/state/index.d.ts +1 -2
  30. package/dist/foundations/state/index.js +1 -1
  31. package/dist/foundations/structures/index.d.ts +1 -1
  32. package/dist/foundations/structures/index.js +1 -1
  33. package/dist/fx/index.d.ts +0 -1
  34. package/dist/{index-NKPpdRh9.d.ts → index-BFnTM1a8.d.ts} +2 -1
  35. package/dist/{index-Bjm0__Rr.d.ts → index-DSClfSoC.d.ts} +3 -7
  36. package/dist/{index-Byqjltu2.d.ts → index-Dh6ZF9yW.d.ts} +1 -2
  37. package/dist/{index-PgRn5wmg.d.ts → index-DjusBb1I.d.ts} +45 -5
  38. package/dist/index.d.ts +4 -4
  39. package/dist/index.js +8 -8
  40. package/dist/jsx-dev-runtime.d.ts +2 -1
  41. package/dist/jsx-runtime-X2SX2y8V.d.ts +2 -0
  42. package/dist/{jsx-runtime-iTU73uwP.d.ts → jsx-runtime-aYZ8zb4q.d.ts} +2 -1
  43. package/dist/jsx-runtime.d.ts +1 -1
  44. package/dist/{component-lifecycle-DEMPihoZ.js → lifecycle-batch-COgl8jMS.js} +3 -160
  45. package/dist/{lifecycle-operations-Dj5lK1K7.js → lifecycle-operations-SlPEK68H.js} +1 -1
  46. package/dist/navigate-CV-RDqYP.d.ts +20 -0
  47. package/dist/{navigate-QMRcR581.js → navigate-DpR-cML9.js} +9 -50
  48. package/dist/{portal-D2tPWNrC.js → portal-D7TC986A.js} +3 -2
  49. package/dist/{fastlane-C8PYPotF.js → readable-BYSoWJSv.js} +2 -146
  50. package/dist/{renderer-aUD-acDe.js → renderer-bZ0315dE.js} +25 -12
  51. package/dist/{resource-operation-Dz2Nxi1q.js → resource-operation-BJiLoLYZ.js} +3 -3
  52. package/dist/resources/index.d.ts +0 -1
  53. package/dist/resources/index.js +2 -2
  54. package/dist/router/index.d.ts +20 -15
  55. package/dist/router/index.js +45 -3
  56. package/dist/{router-4EhVGcma.d.ts → router-C0XQA62W.d.ts} +3 -4
  57. package/dist/{selector-pApF_lGd.js → selector-DueeR6Oz.js} +1 -1
  58. package/dist/ssg/index.d.ts +22 -11
  59. package/dist/ssg/index.js +3 -3
  60. package/dist/ssr/index.d.ts +6 -5
  61. package/dist/ssr/index.js +1 -1
  62. package/dist/{ssr-Y8Pq8riM.js → ssr-vE-KUgDV.js} +8 -7
  63. package/dist/{state-Cc5HumQ0.js → state-CVuQVjvK.js} +2 -1
  64. package/dist/testing/index.d.ts +1 -2
  65. package/dist/types-DEhT-Nrv.d.ts +63 -0
  66. package/dist/{verify-hydration-BcZXRU-q.js → verify-hydration-ChyEiBAn.js} +1 -1
  67. package/package.json +1 -1
  68. package/dist/jsx-runtime-BVVgDSdq.d.ts +0 -1
  69. package/dist/navigate-BVDCzOuB.d.ts +0 -34
  70. package/dist/types-4k3RFEaC.d.ts +0 -19
@@ -1,9 +1,10 @@
1
1
  import { n as _isDOMElement } from "./vnode-D24p6IW2.js";
2
2
  import { b as isDevelopmentEnvironment, o as getRuntimeRenderer, v as logger } from "./access-ePqdQqkV.js";
3
- import { f as notifyReadableReaders, l as markReactivePropsDirtySource, m as shouldCoalesceFineGrainedItemReads, p as recordReadableRead, u as markReadableDerivedSubscribersDirty } from "./fastlane-C8PYPotF.js";
4
- import { n as createComponentInstance, s as renderScopedComponent } from "./component-internal-CbALfPGD.js";
3
+ import { n as createComponentInstance, s as renderScopedComponent } from "./component-internal-CPjM4n8M.js";
4
+ import { d as shouldCoalesceFineGrainedItemReads, l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-BYSoWJSv.js";
5
5
  import { h as getCurrentStateIndex, i as claimHookIndex, o as clearRenderTracking, p as getCurrentInstance } from "./component-scope-CC3cojX9.js";
6
- import { _ as registerOwnedChildScope, c as finalizeInlineReadSubscriptions, f as registerLifecycleTransaction, h as cleanupComponent, v as unregisterOwnedChildScope } from "./component-lifecycle-DEMPihoZ.js";
6
+ import { i as unregisterOwnedChildScope, r as registerOwnedChildScope, t as cleanupComponent } from "./component-cleanup-1ZFoLLHt.js";
7
+ import { o as finalizeInlineReadSubscriptions, u as registerLifecycleTransaction } from "./lifecycle-batch-COgl8jMS.js";
7
8
  //#region src/runtime/child-scope.ts
8
9
  const EMPTY_CHILD_SCOPE_PROPS = {};
9
10
  const childScopesByInstance = /* @__PURE__ */ new WeakMap();
@@ -1,6 +1,6 @@
1
1
  import { r as JSXElement, s as Props } from "../../jsx-Dvr2SGRG.js";
2
+ import "../../types-DEhT-Nrv.js";
2
3
  import { t as Ref } from "../../compose-ref-Cizq72-x.js";
3
-
4
4
  //#region src/foundations/icon/icon.types.d.ts
5
5
  type IconSizeToken = 'sm' | 'md' | 'lg' | 'xl';
6
6
  type IconStyleObject = Record<string, unknown>;
@@ -25,14 +25,7 @@ declare function resolveIconSizeVariable(size: number | string): string;
25
25
  declare function resolveIconStrokeWidthVariable(strokeWidth: number, sizeToken: IconSizeToken | undefined): string;
26
26
  declare function serializeIconStyle(style: string | IconStyleObject | undefined): string;
27
27
  declare function joinIconStyle(...styles: Array<string | undefined>): string | undefined;
28
- declare function getIconContractProps({
29
- size,
30
- strokeWidth,
31
- color,
32
- title,
33
- style,
34
- iconName
35
- }: Pick<IconProps, 'color' | 'iconName' | 'size' | 'strokeWidth' | 'style' | 'title'>): {
28
+ declare function getIconContractProps({ size, strokeWidth, color, title, style, iconName }: Pick<IconProps, 'color' | 'iconName' | 'size' | 'strokeWidth' | 'style' | 'title'>): {
36
29
  sizeToken: IconSizeToken | undefined;
37
30
  decorative: string | undefined;
38
31
  iconStyle: string | undefined;
@@ -53,17 +46,6 @@ declare function getIconContractProps({
53
46
  'data-color': string | undefined;
54
47
  };
55
48
  };
56
- declare function IconBase({
57
- size,
58
- strokeWidth,
59
- color,
60
- title,
61
- class: className,
62
- style,
63
- iconName,
64
- children,
65
- ref,
66
- ...rest
67
- }: IconProps): JSXElement;
49
+ declare function IconBase({ size, strokeWidth, color, title, class: className, style, iconName, children, ref, ...rest }: IconProps): JSXElement;
68
50
  //#endregion
69
51
  export { IconBase, type IconOwnProps, type IconProps, type IconSizeToken, type IconStyleObject, getIconContractProps, isIconSizeToken, joinIconStyle, normalizeIconSizeValue, resolveIconSizeVariable, resolveIconStrokeWidthVariable, serializeIconStyle };
@@ -1,3 +1,3 @@
1
1
  import { r as JSXElement } from "../jsx-Dvr2SGRG.js";
2
- import { _ as definePortal, c as Presence, d as SlotProps, f as LayoutComponent, g as PortalProps, h as Portal, l as PresenceProps, m as DefaultPortal, p as layout, u as Slot } from "../index-PgRn5wmg.js";
2
+ import { _ as definePortal, c as Presence, d as SlotProps, f as LayoutComponent, g as PortalProps, h as Portal, l as PresenceProps, m as DefaultPortal, p as layout, u as Slot } from "../index-DjusBb1I.js";
3
3
  export { DefaultPortal, type JSXElement, type LayoutComponent, Portal, type PortalProps, Presence, type PresenceProps, Slot, type SlotProps, definePortal, layout };
@@ -1,3 +1,3 @@
1
- import { i as definePortal, n as Portal, t as DefaultPortal } from "../portal-D2tPWNrC.js";
1
+ import { i as definePortal, n as Portal, t as DefaultPortal } from "../portal-D7TC986A.js";
2
2
  import { a as layout, i as Slot, r as Presence } from "../structures-DUB3HchX.js";
3
3
  export { DefaultPortal, Portal, Presence, Slot, definePortal, layout };
@@ -1,6 +1,5 @@
1
1
  import { t as Ref } from "../../compose-ref-Cizq72-x.js";
2
2
  import { d as KeyboardLikeEvent, f as PointerLikeEvent, l as DefaultPreventable, p as PropagationStoppable } from "../../index-BnU0NPwM.js";
3
-
4
3
  //#region src/foundations/interactions/pressable.d.ts
5
4
  /**
6
5
  * pressable
@@ -52,11 +51,7 @@ interface PressableResult {
52
51
  onKeyUp?: (e: KeyboardLikeEvent) => void;
53
52
  'aria-disabled'?: 'true';
54
53
  }
55
- declare function pressable({
56
- disabled,
57
- onPress,
58
- isNativeButton
59
- }: PressableOptions): PressableResult;
54
+ declare function pressable({ disabled, onPress, isNativeButton }: PressableOptions): PressableResult;
60
55
  //#endregion
61
56
  //#region src/foundations/interactions/dismissable.d.ts
62
57
  /**
@@ -117,11 +112,7 @@ interface DismissableOptions {
117
112
  */
118
113
  onDismiss?: (trigger: 'escape' | 'outside') => void;
119
114
  }
120
- declare function dismissable({
121
- node,
122
- disabled,
123
- onDismiss
124
- }: DismissableOptions): {
115
+ declare function dismissable({ node, disabled, onDismiss }: DismissableOptions): {
125
116
  onKeyDown: (e: KeyboardLikeEvent) => void;
126
117
  onPointerDownCapture: (e: PointerLikeEvent) => void;
127
118
  };
@@ -141,10 +132,7 @@ interface FocusableResult {
141
132
  tabIndex?: number;
142
133
  'aria-disabled'?: 'true';
143
134
  }
144
- declare function focusable({
145
- disabled,
146
- tabIndex
147
- }: FocusableOptions): FocusableResult;
135
+ declare function focusable({ disabled, tabIndex }: FocusableOptions): FocusableResult;
148
136
  //#endregion
149
137
  //#region src/foundations/interactions/hoverable.d.ts
150
138
  /**
@@ -162,11 +150,7 @@ interface HoverableResult {
162
150
  onPointerEnter?: (e: HoverEvent) => void;
163
151
  onPointerLeave?: (e: HoverEvent) => void;
164
152
  }
165
- declare function hoverable({
166
- disabled,
167
- onEnter,
168
- onLeave
169
- }: HoverableOptions): HoverableResult;
153
+ declare function hoverable({ disabled, onEnter, onLeave }: HoverableOptions): HoverableResult;
170
154
  //#endregion
171
155
  //#region src/foundations/interactions/roving-focus.d.ts
172
156
  type Orientation = 'horizontal' | 'vertical' | 'both';
@@ -215,6 +199,32 @@ interface RovingFocusResult {
215
199
  };
216
200
  }
217
201
  declare function rovingFocus(options: RovingFocusOptions): RovingFocusResult;
202
+ /**
203
+ * USAGE EXAMPLE:
204
+ *
205
+ * function Menu() {
206
+ * const [focusIndex, setFocusIndex] = state(0);
207
+ * const items = ['File', 'Edit', 'View'];
208
+ *
209
+ * const navigation = rovingFocus({
210
+ * currentIndex: focusIndex(),
211
+ * itemCount: items.length,
212
+ * orientation: 'horizontal',
213
+ * loop: true,
214
+ * onNavigate: setFocusIndex,
215
+ * });
216
+ *
217
+ * return (
218
+ * <div {...navigation.container}>
219
+ * {items.map((label, index) => (
220
+ * <button {...navigation.item(index)}>
221
+ * {label}
222
+ * </button>
223
+ * ))}
224
+ * </div>
225
+ * );
226
+ * }
227
+ */
218
228
  //#endregion
219
229
  //#region src/foundations/interactions/interaction-policy.d.ts
220
230
  interface InteractionPolicyInput {
@@ -231,12 +241,7 @@ interface InteractionPolicyInput {
231
241
  * THE interaction policy. Components MUST use this, NEVER implement
232
242
  * interaction logic directly.
233
243
  */
234
- declare function applyInteractionPolicy({
235
- isNative,
236
- disabled,
237
- onPress,
238
- ref
239
- }: InteractionPolicyInput): {
244
+ declare function applyInteractionPolicy({ isNative, disabled, onPress, ref }: InteractionPolicyInput): {
240
245
  disabled: true | undefined;
241
246
  onClick: (e: Event) => void;
242
247
  ref: Ref<unknown>;
@@ -1,5 +1,4 @@
1
- import { m as State } from "../../control-CMzFPMjr.js";
2
-
1
+ import { m as State } from "../../control-DO-iBEtV.js";
3
2
  //#region src/foundations/state/controllable.d.ts
4
3
  declare function isControlled<T>(value: T | undefined): value is T;
5
4
  declare function resolveControllable<T>(value: T | undefined, defaultValue: T): {
@@ -1,4 +1,4 @@
1
- import { t as state } from "../../state-Cc5HumQ0.js";
1
+ import { t as state } from "../../state-CVuQVjvK.js";
2
2
  //#region src/foundations/state/controllable.ts
3
3
  /**
4
4
  * controllable
@@ -1,3 +1,3 @@
1
1
  import { r as JSXElement } from "../../jsx-Dvr2SGRG.js";
2
- import { _ as definePortal, a as Collection, c as Presence, d as SlotProps, f as LayoutComponent, g as PortalProps, h as Portal, i as createLayer, l as PresenceProps, m as DefaultPortal, n as LayerManager, o as CollectionItem, p as layout, r as LayerOptions, s as createCollection, t as Layer, u as Slot } from "../../index-PgRn5wmg.js";
2
+ import { _ as definePortal, a as Collection, c as Presence, d as SlotProps, f as LayoutComponent, g as PortalProps, h as Portal, i as createLayer, l as PresenceProps, m as DefaultPortal, n as LayerManager, o as CollectionItem, p as layout, r as LayerOptions, s as createCollection, t as Layer, u as Slot } from "../../index-DjusBb1I.js";
3
3
  export { type Collection, type CollectionItem, DefaultPortal, type JSXElement, type Layer, type LayerManager, type LayerOptions, type LayoutComponent, Portal, type PortalProps, Presence, type PresenceProps, Slot, type SlotProps, createCollection, createLayer, definePortal, layout };
@@ -1,3 +1,3 @@
1
- import { i as definePortal, n as Portal, t as DefaultPortal } from "../../portal-D2tPWNrC.js";
1
+ import { i as definePortal, n as Portal, t as DefaultPortal } from "../../portal-D7TC986A.js";
2
2
  import { a as layout, i as Slot, n as createCollection, r as Presence, t as createLayer } from "../../structures-DUB3HchX.js";
3
3
  export { DefaultPortal, Portal, Presence, Slot, createCollection, createLayer, definePortal, layout };
@@ -1,5 +1,4 @@
1
1
  import { n as scheduleEventHandler } from "../scheduler-CmLO4Dfm.js";
2
-
3
2
  //#region src/fx/timing.d.ts
4
3
  /**
5
4
  * Timing utilities — pure helpers for common async patterns
@@ -1,5 +1,6 @@
1
- import { i as Scope, n as ReadableSource, r as ComponentInstance } from "./control-CMzFPMjr.js";
1
+ import { i as Scope, n as ReadableSource, r as ComponentInstance } from "./control-DO-iBEtV.js";
2
2
  import { t as Scheduler } from "./scheduler-CmLO4Dfm.js";
3
+ import "./jsx-runtime-X2SX2y8V.js";
3
4
  //#region src/runtime/runtime.d.ts
4
5
  interface RuntimeKeyedReorderDecision {
5
6
  useFastPath: boolean;
@@ -1,7 +1,7 @@
1
- import { c as RenderableChild, g as StateTuple } from "./control-CMzFPMjr.js";
1
+ import { c as RenderableChild, g as StateTuple } from "./control-DO-iBEtV.js";
2
2
  import { r as JSXElement } from "./jsx-Dvr2SGRG.js";
3
+ import "./index-BFnTM1a8.js";
3
4
  import { ObjectSchema } from "@askrjs/schema";
4
-
5
5
  //#region src/actions/index.d.ts
6
6
  interface ActionDescriptor<TInput extends Record<string, unknown> = Record<string, unknown>> {
7
7
  readonly id: string;
@@ -14,11 +14,7 @@ declare function defineAction<TInput extends Record<string, unknown>>(options: {
14
14
  readonly invalidates?: readonly string[];
15
15
  }): ActionDescriptor<TInput>;
16
16
  /** A native form bound to a declared action; it is not a synthetic event API. */
17
- declare function ActionForm<TInput extends Record<string, unknown>>({
18
- action,
19
- children,
20
- ...props
21
- }: {
17
+ declare function ActionForm<TInput extends Record<string, unknown>>({ action, children, ...props }: {
22
18
  readonly action: ActionDescriptor<TInput>;
23
19
  readonly children?: RenderableChild;
24
20
  readonly [key: string]: unknown;
@@ -1,6 +1,5 @@
1
- import { c as RenderableChild, l as VNode, t as ForEachSource } from "./control-CMzFPMjr.js";
1
+ import { c as RenderableChild, l as VNode, t as ForEachSource } from "./control-DO-iBEtV.js";
2
2
  import { r as JSXElement } from "./jsx-Dvr2SGRG.js";
3
-
4
3
  //#region src/control/shared.d.ts
5
4
  type BoundaryChild = RenderableChild;
6
5
  //#endregion
@@ -1,5 +1,6 @@
1
- import { c as RenderableChild } from "./control-CMzFPMjr.js";
1
+ import { c as RenderableChild } from "./control-DO-iBEtV.js";
2
2
  import { r as JSXElement } from "./jsx-Dvr2SGRG.js";
3
+ import "./types-DEhT-Nrv.js";
3
4
  //#region src/runtime/portal.d.ts
4
5
  interface Portal<T extends RenderableChild = RenderableChild> {
5
6
  (): unknown;
@@ -102,10 +103,7 @@ interface PresenceProps {
102
103
  * children are removed immediately. Animation must be layered above
103
104
  * this primitive.
104
105
  */
105
- declare function Presence({
106
- present,
107
- children
108
- }: PresenceProps): JSXElement | null;
106
+ declare function Presence({ present, children }: PresenceProps): JSXElement | null;
109
107
  //#endregion
110
108
  //#region src/foundations/structures/collection.d.ts
111
109
  /**
@@ -156,6 +154,24 @@ interface Collection<TNode, TMetadata = unknown> {
156
154
  size(): number;
157
155
  }
158
156
  declare function createCollection<TNode, TMetadata = unknown>(): Collection<TNode, TMetadata>;
157
+ /**
158
+ * USAGE EXAMPLE:
159
+ *
160
+ * // Create a collection for menu items
161
+ * const menuItems = createCollection<HTMLElement, { disabled: boolean }>();
162
+ *
163
+ * // Register items
164
+ * const unregister1 = menuItems.register(element1, { disabled: false });
165
+ * const unregister2 = menuItems.register(element2, { disabled: true });
166
+ *
167
+ * // Query items
168
+ * const allItems = menuItems.items();
169
+ * const enabledItems = allItems.filter(item => !item.metadata.disabled);
170
+ *
171
+ * // Cleanup
172
+ * unregister1();
173
+ * unregister2();
174
+ */
159
175
  //#endregion
160
176
  //#region src/foundations/structures/layer.d.ts
161
177
  /**
@@ -235,5 +251,29 @@ interface LayerManager {
235
251
  handleOutsidePointer(e: PointerEvent): void;
236
252
  }
237
253
  declare function createLayer(): LayerManager;
254
+ /**
255
+ * USAGE EXAMPLE:
256
+ *
257
+ * const layerManager = createLayer();
258
+ *
259
+ * function Modal({ onClose }) {
260
+ * const modalRef = ref<HTMLDivElement>();
261
+ *
262
+ * const layer = layerManager.register({
263
+ * node: modalRef.current,
264
+ * onEscape: onClose,
265
+ * onOutsidePointer: onClose,
266
+ * });
267
+ *
268
+ * onUnmount(() => layer.unregister());
269
+ *
270
+ * return (
271
+ * <div ref={modalRef}>
272
+ * <h1>Modal</h1>
273
+ * {layer.isTop() && <p>I am on top!</p>}
274
+ * </div>
275
+ * );
276
+ * }
277
+ */
238
278
  //#endregion
239
279
  export { definePortal as _, Collection as a, Presence as c, SlotProps as d, LayoutComponent as f, PortalProps as g, Portal as h, createLayer as i, PresenceProps as l, DefaultPortal as m, LayerManager as n, CollectionItem as o, layout as p, LayerOptions as r, createCollection as s, Layer as t, Slot as u };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { _ as state, a as defineScope, g as StateTuple, h as StateSetter, i as Scope, m as State, o as readScope } from "./control-CMzFPMjr.js";
1
+ import { _ as state, a as defineScope, g as StateTuple, h as StateSetter, i as Scope, m as State, o as readScope } from "./control-DO-iBEtV.js";
2
2
  import { s as Props, t as Fragment } from "./jsx-Dvr2SGRG.js";
3
3
  import { t as getSignal } from "./component-scope-CvPba6O6.js";
4
- import { a as Derived, c as AskrRuntimeOptions, d as createRuntime, f as getDefaultRuntime, i as selector, l as RuntimeKeyedReorderDecision, n as cspNonce, o as derive, r as Selector, s as AskrRuntime, t as CspNonceScope, u as RuntimeRendererHost } from "./index-NKPpdRh9.js";
5
- 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-Byqjltu2.js";
6
- import { i as jsxs, n as jsx } from "./jsx-runtime-iTU73uwP.js";
4
+ import { a as Derived, c as AskrRuntimeOptions, d as createRuntime, f as getDefaultRuntime, i as selector, l as RuntimeKeyedReorderDecision, n as cspNonce, o as derive, r as Selector, s as AskrRuntime, t as CspNonceScope, u as RuntimeRendererHost } from "./index-BFnTM1a8.js";
5
+ 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-Dh6ZF9yW.js";
6
+ import { i as jsxs, n as jsx } from "./jsx-runtime-aYZ8zb4q.js";
7
7
  import { A as ServerQueryHandler, D as QueryPrefetchContext, T as QueryDefinition, a as defineServerQueries, c as prefetchQuery, g as createQuery, i as defineQuery, l as serveQuery, o as dehydrateDataRuntime, s as hydrateDataRuntime, v as DataRuntime } from "./index-Bki2rqcr.js";
8
8
  export { AskrRuntime, type AskrRuntimeOptions, Case, type CaseProps, CspNonceScope, type DataRuntime, type Derived, For, type ForProps, Fragment, Match, type MatchProps, type Props, type QueryDefinition, type QueryPrefetchContext, type RuntimeKeyedReorderDecision, type RuntimeRendererHost, type Scope, type Selector, type ServerQueryHandler, Show, type ShowProps, type State, type StateSetter, type StateTuple, createQuery, createRuntime, cspNonce, defineQuery, defineScope, defineServerQueries, dehydrateDataRuntime, derive, getDefaultRuntime, getSignal, hydrateDataRuntime, jsx, jsxs, prefetchQuery, readScope, selector, serveQuery, state };
package/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import { a as getRuntimeFlushVersion, d as AskrRuntime, m as getDefaultRuntime, p as createRuntime, t as enqueueRuntimeLane } from "./access-ePqdQqkV.js";
2
- import { f as notifyReadableReaders, g as withDerivedReadTracking, h as syncDerivedDependencySubscriptions, l as markReactivePropsDirtySource, o as clearDerivedDependencySubscriptions, p as recordReadableRead, u as markReadableDerivedSubscribersDirty } from "./fastlane-C8PYPotF.js";
3
2
  import { n as Fragment } from "./jsx-CUpRxrLH.js";
4
- import { l as defineScope, m as readScope } from "./component-internal-CbALfPGD.js";
3
+ import { h as readScope, u as defineScope } from "./component-internal-CPjM4n8M.js";
4
+ import { f as syncDerivedDependencySubscriptions, l as notifyReadableReaders, o as markReactivePropsDirtySource, p as withDerivedReadTracking, r as clearDerivedDependencySubscriptions, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-BYSoWJSv.js";
5
5
  import { g as getSignal, i as claimHookIndex, p as getCurrentInstance } from "./component-scope-CC3cojX9.js";
6
6
  import { n as isSnapshotSource } from "./snapshot-source-BB42xgwb.js";
7
- import { t as installRendererBridge } from "./renderer-aUD-acDe.js";
8
- import { t as state } from "./state-Cc5HumQ0.js";
9
- import { t as selector } from "./selector-pApF_lGd.js";
7
+ import { t as installRendererBridge } from "./renderer-bZ0315dE.js";
8
+ import { t as state } from "./state-CVuQVjvK.js";
9
+ import { t as selector } from "./selector-DueeR6Oz.js";
10
10
  import { jsx, jsxs } from "./jsx-runtime.js";
11
- import { n as cspNonce, t as CspNonceScope } from "./csp-nonce-C-8E85El.js";
12
- import { i as For, n as Match, r as Show, t as Case } from "./control-KVP6LMEQ.js";
13
- import { t as createQuery } from "./data-DvYo_dHd.js";
11
+ import { n as cspNonce, t as CspNonceScope } from "./csp-nonce-HGZ0vbqT.js";
12
+ import { i as For, n as Match, r as Show, t as Case } from "./control-CA45Yvvu.js";
13
+ import { t as createQuery } from "./data-DHt_zO1G.js";
14
14
  import { a as hydrateDataRuntime, i as dehydrateDataRuntime, n as defineQuery, o as prefetchQuery, r as defineServerQueries, s as serveQuery } from "./query-registry-CQIT4mXr.js";
15
15
  //#region src/runtime/derive.ts
16
16
  const deriveCells = /* @__PURE__ */ new WeakMap();
@@ -1,5 +1,6 @@
1
1
  import { a as IntrinsicFallbackProps, i as JSXElementType, n as JSXComponent, o as KnownIntrinsicElementProps, r as JSXElement, s as Props, t as Fragment } from "./jsx-Dvr2SGRG.js";
2
- import { t as EagerControlPrimitive } from "./control-B5xu8v4m.js";
2
+ import { t as EagerControlPrimitive } from "./control-BjYBlytA.js";
3
+ import "./types-DEhT-Nrv.js";
3
4
  //#region src/jsx/jsx-dev-runtime.d.ts
4
5
  declare namespace JSX {
5
6
  interface Element extends JSXElement {
@@ -0,0 +1,2 @@
1
+ import "./types-DEhT-Nrv.js";
2
+ import "./jsx-runtime-aYZ8zb4q.js";
@@ -1,5 +1,6 @@
1
1
  import { a as IntrinsicFallbackProps, o as KnownIntrinsicElementProps, r as JSXElement, s as Props } from "./jsx-Dvr2SGRG.js";
2
- import { t as EagerControlPrimitive } from "./control-B5xu8v4m.js";
2
+ import { t as EagerControlPrimitive } from "./control-BjYBlytA.js";
3
+ import "./types-DEhT-Nrv.js";
3
4
  //#region src/jsx/jsx-runtime.d.ts
4
5
  declare namespace JSX {
5
6
  interface Element extends JSXElement {
@@ -1,3 +1,3 @@
1
1
  import { i as JSXElementType, n as JSXComponent, r as JSXElement, t as Fragment } from "./jsx-Dvr2SGRG.js";
2
- import { i as jsxs, n as jsx, r as jsxDEV, t as JSX } from "./jsx-runtime-iTU73uwP.js";
2
+ import { i as jsxs, n as jsx, r as jsxDEV, t as JSX } from "./jsx-runtime-aYZ8zb4q.js";
3
3
  export { Fragment, JSX, type JSXComponent, type JSXElement, type JSXElementType, jsx, jsxDEV, jsxs };
@@ -1,143 +1,5 @@
1
- import { b as isDevelopmentEnvironment, v as logger, x as isProductionEnvironment } from "./access-ePqdQqkV.js";
2
- import { a as cleanupReadableSubscriptions, c as finalizeReadableSubscriptionsFromSnapshot, i as cleanupReadableSubscriptionSources, t as isBulkCommitActive } from "./fastlane-C8PYPotF.js";
3
- import { a as clearCurrentComponentScope, y as restoreCurrentComponentScope } from "./component-scope-CC3cojX9.js";
4
- //#region src/runtime/state-diagnostics.ts
5
- /**
6
- * Report state cells that were never read during a component's completed
7
- * lifetime. A branch that has not rendered yet is not evidence that its state
8
- * is unused, so this diagnostic belongs at unmount rather than every commit.
9
- */
10
- function warnUnusedStateReads(instance) {
11
- if (isProductionEnvironment() || !instance.mounted) return;
12
- const stateValues = instance.stateValues;
13
- if (!stateValues) return;
14
- for (let i = 0; i < stateValues.length; i++) {
15
- const state = stateValues[i];
16
- const diagnosticEligible = state?._unusedStateDiagnosticEligible;
17
- const hasCommittedUsage = (state?._readers?.size ?? 0) > 0 || (state?._derivedSubscribers?.size ?? 0) > 0;
18
- if (state && diagnosticEligible !== false && !state._hasEverBeenRead && !hasCommittedUsage) {
19
- const warnings = instance.devWarningsEmitted ??= /* @__PURE__ */ new Set();
20
- const key = `unused-state:${i}`;
21
- if (warnings.has(key)) continue;
22
- warnings.add(key);
23
- try {
24
- const name = instance.fn?.name || "<anonymous>";
25
- logger.warn(`[askr] Unused state variable detected in ${name} at index ${i}. State should be read during render or removed.`);
26
- } catch {
27
- logger.warn("[askr] Unused state variable detected. State should be read during render or removed.");
28
- }
29
- }
30
- }
31
- }
32
- //#endregion
33
- //#region src/runtime/component-cleanup.ts
34
- /**
35
- * Component cleanup and owned child-scope bookkeeping.
36
- */
37
- /**
38
- * Dispose an inactive ownership generation without swapping it back onto the
39
- * component instance that now represents a different live route.
40
- */
41
- function cleanupComponentGeneration(instance, generation) {
42
- const savedScope = clearCurrentComponentScope();
43
- try {
44
- const cleanupErrors = instance.cleanupStrict ? [] : void 0;
45
- const recordCleanupError = (message, err) => {
46
- if (cleanupErrors) cleanupErrors.push(err);
47
- else if (isDevelopmentEnvironment()) logger.warn(message, err);
48
- };
49
- const ownedChildScopes = generation.ownedChildScopes;
50
- if (ownedChildScopes && ownedChildScopes.size > 0) {
51
- for (const scope of ownedChildScopes) try {
52
- scope.dispose();
53
- } catch (err) {
54
- recordCleanupError("[Askr] child scope cleanup threw:", err);
55
- }
56
- ownedChildScopes.clear();
57
- }
58
- try {
59
- cleanupReadableSubscriptionSources(instance, generation.readSources, generation.ownershipGeneration);
60
- } catch (err) {
61
- recordCleanupError("[Askr] readable subscription cleanup threw:", err);
62
- }
63
- const cleanupFns = generation.cleanupFns;
64
- generation.cleanupFns = void 0;
65
- if (cleanupFns) for (const cleanup of cleanupFns) try {
66
- cleanup();
67
- } catch (err) {
68
- recordCleanupError("[Askr] cleanup function threw:", err);
69
- }
70
- try {
71
- if (generation.abortController && !generation.abortController.signal.aborted) generation.abortController.abort();
72
- } catch (err) {
73
- recordCleanupError("[Askr] abort controller cleanup threw:", err);
74
- }
75
- generation.abortController = null;
76
- if (cleanupErrors && cleanupErrors.length > 0) throw new AggregateError(cleanupErrors, `Cleanup failed for component ${instance.id}`);
77
- } finally {
78
- restoreCurrentComponentScope(savedScope);
79
- }
80
- }
81
- /**
82
- * Clean up component resources on unmount or route changes.
83
- */
84
- function cleanupComponent(instance) {
85
- const savedScope = clearCurrentComponentScope();
86
- try {
87
- warnUnusedStateReads(instance);
88
- const cleanupErrors = instance.cleanupStrict ? [] : void 0;
89
- const recordCleanupError = (message, err) => {
90
- if (cleanupErrors) cleanupErrors.push(err);
91
- else if (isDevelopmentEnvironment()) logger.warn(message, err);
92
- };
93
- const ownedChildScopes = instance._ownedChildScopes;
94
- if (ownedChildScopes && ownedChildScopes.size > 0) {
95
- instance._ownedChildScopes = /* @__PURE__ */ new Set();
96
- for (const scope of ownedChildScopes) try {
97
- scope.dispose();
98
- } catch (err) {
99
- recordCleanupError("[Askr] child scope cleanup threw:", err);
100
- }
101
- }
102
- const cleanupFns = instance.cleanupFns;
103
- instance.cleanupFns = void 0;
104
- if (cleanupFns) for (const cleanup of cleanupFns) try {
105
- cleanup();
106
- } catch (err) {
107
- recordCleanupError("[Askr] cleanup function threw:", err);
108
- }
109
- try {
110
- cleanupReadableSubscriptions(instance);
111
- } catch (err) {
112
- recordCleanupError("[Askr] readable subscription cleanup threw:", err);
113
- }
114
- try {
115
- if (instance.abortController && !instance.abortController.signal.aborted) instance.abortController.abort();
116
- } catch (err) {
117
- recordCleanupError("[Askr] abort controller cleanup threw:", err);
118
- }
119
- instance.abortController = null;
120
- instance.lifecycleGeneration++;
121
- instance.evaluationGeneration++;
122
- instance.mountOperations = void 0;
123
- instance.commitOperations = void 0;
124
- instance.lifecycleSlots = void 0;
125
- instance.hasPendingUpdate = false;
126
- instance.notifyUpdate = null;
127
- instance._placeholder = void 0;
128
- instance.mounted = false;
129
- if (cleanupErrors && cleanupErrors.length > 0) throw new AggregateError(cleanupErrors, `Cleanup failed for component ${instance.id}`);
130
- } finally {
131
- restoreCurrentComponentScope(savedScope);
132
- }
133
- }
134
- function registerOwnedChildScope(instance, scope) {
135
- (instance._ownedChildScopes ??= /* @__PURE__ */ new Set()).add(scope);
136
- }
137
- function unregisterOwnedChildScope(instance, scope) {
138
- instance._ownedChildScopes?.delete(scope);
139
- }
140
- //#endregion
1
+ import { v as logger } from "./access-ePqdQqkV.js";
2
+ import { a as finalizeReadableSubscriptionsFromSnapshot } from "./readable-BYSoWJSv.js";
141
3
  //#region src/common/promise.ts
142
4
  function isPromiseLike(value) {
143
5
  return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
@@ -367,23 +229,4 @@ function discardLifecycleCommitBatch(batch) {
367
229
  }
368
230
  }
369
231
  //#endregion
370
- //#region src/runtime/component-lifecycle.ts
371
- function registerCommitOperationForInstance(instance, operation) {
372
- if (instance) {
373
- if (isBulkCommitActive()) {
374
- if (isDevelopmentEnvironment()) throw new Error("registerCommitOperation called during bulk commit fast-lane");
375
- return;
376
- }
377
- (instance.commitOperations ??= []).push(operation);
378
- }
379
- }
380
- function commitLifecycleForInstance(instance, wasFirstMount) {
381
- if ((instance.mountOperations?.length ?? 0) === 0 && (instance.commitOperations?.length ?? 0) === 0) return;
382
- if (enqueueLifecycleCommitForInstance(instance, wasFirstMount)) return;
383
- executeCommittedLifecycleOperations(instance, wasFirstMount);
384
- }
385
- function commitRenderedComponent(instance) {
386
- if (instance.mounted && (instance.commitOperations?.length ?? 0) > 0) commitLifecycleForInstance(instance, false);
387
- }
388
- //#endregion
389
- export { registerOwnedChildScope as _, captureInlineRenderSnapshot as a, finalizeInlineReadSubscriptions as c, registerLifecycleRollback as d, registerLifecycleTransaction as f, cleanupComponentGeneration as g, cleanupComponent as h, beginLifecycleCommitBatch as i, flushLifecycleCommitBatch as l, isPromiseLike as m, commitRenderedComponent as n, discardLifecycleCommitBatch as o, discardCommitOperations as p, registerCommitOperationForInstance as r, drainLifecycleCommitErrors as s, commitLifecycleForInstance as t, getCurrentLifecycleCommitBatch as u, unregisterOwnedChildScope as v };
232
+ export { enqueueLifecycleCommitForInstance as a, getCurrentLifecycleCommitBatch as c, discardCommitOperations as d, executeCommittedLifecycleOperations as f, drainLifecycleCommitErrors as i, registerLifecycleRollback as l, captureInlineRenderSnapshot as n, finalizeInlineReadSubscriptions as o, isPromiseLike as p, discardLifecycleCommitBatch as r, flushLifecycleCommitBatch as s, beginLifecycleCommitBatch as t, registerLifecycleTransaction as u };
@@ -1,4 +1,4 @@
1
- import { a as registerCommitOperation } from "./component-internal-CbALfPGD.js";
1
+ import { a as registerCommitOperation } from "./component-internal-CPjM4n8M.js";
2
2
  import { f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-CC3cojX9.js";
3
3
  import { t as isRouteActivityActive } from "./route-activity-CNJfpwx-.js";
4
4
  //#region src/runtime/lifecycle-operations.ts
@@ -0,0 +1,20 @@
1
+ import "./router-C0XQA62W.js";
2
+ //#region src/router/navigation-scroll.d.ts
3
+ type NavigationScrollBehavior = 'top' | 'preserve';
4
+ type HistoryScrollBehavior = 'restore' | 'top' | 'preserve';
5
+ type ScrollRestorationOptions = {
6
+ navigation?: NavigationScrollBehavior;
7
+ history?: HistoryScrollBehavior;
8
+ };
9
+ //#endregion
10
+ //#region src/router/navigation-targets.d.ts
11
+ type NavigateOptions = {
12
+ history?: 'push' | 'replace';
13
+ replace?: boolean;
14
+ scroll?: NavigationScrollBehavior;
15
+ };
16
+ //#endregion
17
+ //#region src/router/navigate.d.ts
18
+ declare function navigate(path: string, options?: NavigateOptions): void;
19
+ //#endregion
20
+ export { ScrollRestorationOptions as a, NavigationScrollBehavior as i, NavigateOptions as n, HistoryScrollBehavior as r, navigate as t };