@askrjs/askr 0.3.0 → 0.4.0

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 (123) hide show
  1. package/CHANGELOG.md +874 -0
  2. package/README.md +61 -29
  3. package/capabilities.json +19 -9
  4. package/dist/actions/index.js +56 -12
  5. package/dist/benchmark.js +10 -15
  6. package/dist/boot/index.d.ts +3 -2
  7. package/dist/boot/index.js +1 -1
  8. package/dist/boot-DaoTYoCw.js +3989 -0
  9. package/dist/browser-activity-CB8e-V4f.js +220 -0
  10. package/dist/components/index.d.ts +8 -1
  11. package/dist/components/index.js +1 -43
  12. package/dist/{aria-hKjThHcp.js → compose-ref-DWzdbxsD.js} +41 -4
  13. package/dist/control/index.d.ts +2 -0
  14. package/dist/control/index.js +1 -1
  15. package/dist/control-nfpT2fbK.js +209 -0
  16. package/dist/core.d.ts +5 -9
  17. package/dist/csp-nonce-DwGw1A6Q.js +35 -0
  18. package/dist/data/index.js +3 -3
  19. package/dist/{data-2edW0jhF.js → data-BCwClJiF.js} +283 -94
  20. package/dist/data-runtime-C1bFAlba.js +242 -0
  21. package/dist/{deferred-CbgNhf67.js → deferred-bEEHHvic.js} +42 -20
  22. package/dist/domains/actions.d.ts +8 -3
  23. package/dist/domains/component.d.ts +1 -107
  24. package/dist/domains/context.d.ts +0 -15
  25. package/dist/domains/control.d.ts +36 -249
  26. package/dist/domains/data.d.ts +31 -13
  27. package/dist/domains/diagnostics.d.ts +1 -2
  28. package/dist/domains/lifecycle.d.ts +2 -5
  29. package/dist/domains/refs.d.ts +0 -2
  30. package/dist/domains/routing.d.ts +43 -8
  31. package/dist/domains/scheduler.d.ts +1 -76
  32. package/dist/domains/server.d.ts +5 -2
  33. package/dist/domains/state.d.ts +2 -5
  34. package/dist/domains/telemetry.d.ts +0 -2
  35. package/dist/elements.d.ts +214 -51
  36. package/dist/error-boundary-Bpwofwps.js +293 -0
  37. package/dist/foundations/icon/index.d.ts +0 -58
  38. package/dist/foundations/icon/index.js +2 -2
  39. package/dist/foundations/index.js +2 -1
  40. package/dist/foundations/interactions/index.js +1 -1
  41. package/dist/foundations/state/index.d.ts +3 -3
  42. package/dist/foundations/state/index.js +5 -3
  43. package/dist/foundations/structures/index.js +2 -1
  44. package/dist/foundations/utilities/index.d.ts +2 -0
  45. package/dist/foundations/utilities/index.js +1 -2
  46. package/dist/fx/index.d.ts +31 -58
  47. package/dist/fx/index.js +313 -195
  48. package/dist/hooks-BimKStr4.js +202 -0
  49. package/dist/index.d.ts +11 -74
  50. package/dist/index.js +8 -447
  51. package/dist/instance-BAnfmXOR.js +988 -0
  52. package/dist/{interactions-CTeACdT_.js → interactions-D2BoREb-.js} +3 -2
  53. package/dist/jsx-dev-runtime.d.ts +41 -18
  54. package/dist/jsx-dev-runtime.js +1 -6
  55. package/dist/{jsx-runtime-CPJXAOBF.js → jsx-runtime-C4idqHY0.js} +18 -7
  56. package/dist/jsx-runtime.js +1 -1
  57. package/dist/jsx.d.ts +61 -37
  58. package/dist/{manifest-D1P3UNWV.js → manifest-CW9gyNBY.js} +3 -3
  59. package/dist/{navigate-prC5V8XV.js → navigate-CP_0Zy5U.js} +454 -87
  60. package/dist/navigation.d.ts +12 -3
  61. package/dist/peer-types.d.ts +8 -0
  62. package/dist/portal-DuOKfnLa.js +349 -0
  63. package/dist/promise-Dz8iIHAm.js +16 -0
  64. package/dist/query-registry-WMCN0BJL.js +320 -0
  65. package/dist/readable-DFWOsTac.js +21 -0
  66. package/dist/{render-context-B7ohlh6t.js → render-context-DGHnEveC.js} +27 -11
  67. package/dist/render-sync-IC5lMFpq.js +1240 -0
  68. package/dist/resolution-Cx82-xjW.js +1244 -0
  69. package/dist/resource-CLjB7RBQ.js +377 -0
  70. package/dist/resources/index.d.ts +21 -11
  71. package/dist/resources/index.js +45 -244
  72. package/dist/router/index.d.ts +14 -5
  73. package/dist/router/index.js +22 -53
  74. package/dist/scope-CwpVSHVf.js +55 -0
  75. package/dist/{shared-kU8yvryp.js → shared-O2ZnmYAf.js} +1 -7
  76. package/dist/{snapshot-source-An4iKajG.js → snapshot-Cjx4N988.js} +6 -1
  77. package/dist/ssg/index.d.ts +1 -2
  78. package/dist/ssg/index.js +5 -13
  79. package/dist/ssr/index.d.ts +26 -28
  80. package/dist/ssr/index.js +4 -4
  81. package/dist/{ssr-CiNm6Vzl.js → ssr-BJ8ug7zH.js} +133 -122
  82. package/dist/ssr-DoV-vJ-5.js +229 -0
  83. package/dist/state-DWO1KzkX.js +232 -0
  84. package/dist/structures-D4dDMqHX.js +231 -0
  85. package/dist/testing/index.d.ts +8 -4
  86. package/dist/testing/index.js +29 -34
  87. package/dist/url-CnbfpX0K.js +185 -0
  88. package/dist/utilities.d.ts +48 -2
  89. package/dist/verify-hydration-DpVaDnqz.js +152 -0
  90. package/package.json +19 -9
  91. package/dist/access-CEA2pOry.js +0 -1046
  92. package/dist/activity-oy2YFTFF.js +0 -201
  93. package/dist/boot-BMBMWUGI.js +0 -1084
  94. package/dist/capabilities-Bbf0mlp9.js +0 -42
  95. package/dist/compose-ref-v0qGlHoN.js +0 -26
  96. package/dist/control-BR_mrX__.js +0 -173
  97. package/dist/control-C-ApnFs1.js +0 -20
  98. package/dist/csp-nonce-BfFWcd0w.js +0 -173
  99. package/dist/data-runtime-CxoY98lX.js +0 -149
  100. package/dist/default-portal-runtime-DvMvWJVp.js +0 -20
  101. package/dist/dom-renderer.d.ts +0 -77
  102. package/dist/domains/renderer.d.ts +0 -127
  103. package/dist/eager-control.d.ts +0 -8
  104. package/dist/effect-C3Zsc1k6.js +0 -292
  105. package/dist/for-state-BDykeOJL.js +0 -1753
  106. package/dist/instance-VAFYVJOa.js +0 -1027
  107. package/dist/notify-DxxuDPeY.js +0 -266
  108. package/dist/portal-w3oQ6oQU.js +0 -29
  109. package/dist/query-registry-LrYpQsDJ.js +0 -83
  110. package/dist/render-resolved-BC0W7_5b.js +0 -1123
  111. package/dist/renderer-CT0HeY58.js +0 -8623
  112. package/dist/resolution-3DskUkjG.js +0 -577
  113. package/dist/resource-18-sFRl9.js +0 -344
  114. package/dist/route-matching-CUzZ31gT.js +0 -551
  115. package/dist/router-internal-7nuNEHfG.js +0 -36
  116. package/dist/scope-Cq_iYbTR.js +0 -403
  117. package/dist/selector-BSPVkjKP.js +0 -311
  118. package/dist/ssr-EPjwJH5R.js +0 -29
  119. package/dist/state-BXJfudq1.js +0 -91
  120. package/dist/structures-CjEzfj4h.js +0 -654
  121. package/dist/timer-C7uqnJVt.js +0 -85
  122. package/dist/verify-hydration-ikaxotf7.js +0 -27
  123. package/dist/vnode-D24p6IW2.js +0 -7
@@ -1,7 +1,5 @@
1
1
  import { JSXElementType, JSXElement, Props } from '../elements.js';
2
2
  import '../jsx-globals.js';
3
- import { AuthContext, AuthRequirement } from '@askrjs/auth';
4
- import { InferSchema, ObjectSchema } from '@askrjs/schema';
5
3
  import { action } from './actions.js';
6
4
 
7
5
  interface TelemetryFields {
@@ -25,6 +25,8 @@ type IntrinsicDataValue = string | number | boolean | null | undefined;
25
25
  type IntrinsicBooleanValue = boolean | null | undefined;
26
26
  type IntrinsicNumberValue = number | null | undefined;
27
27
  type IntrinsicTextValue = string | null | undefined;
28
+ /** Enumerated attributes where `false` renders `"false"` (see keepsFalseValue). */
29
+ type IntrinsicEnumeratedValue = string | boolean | null | undefined;
28
30
  type IntrinsicTextLikeValue = string | number | null | undefined;
29
31
  type IntrinsicStyleEntryValue = string | number | null | undefined | false;
30
32
  type IntrinsicStyleObject = Record<string, IntrinsicStyleEntryValue>;
@@ -40,57 +42,154 @@ type IntrinsicFormValue =
40
42
  | readonly string[]
41
43
  | null
42
44
  | undefined;
43
- type IntrinsicRefTarget = Element | null;
44
- type IntrinsicRef =
45
- | BivariantHandler<IntrinsicRefTarget>
45
+ type IntrinsicRef<T extends Element = Element> =
46
+ | BivariantHandler<T | null>
46
47
  | {
47
- current: IntrinsicRefTarget;
48
+ current: T | null;
48
49
  }
49
50
  | null
50
51
  | undefined;
52
+ /** MathML elements that lib.dom's MathMLElementTagNameMap does not list. */
53
+ type MathMLExtraTag = 'mglyph' | 'menclose' | 'mlabeledtr' | 'none';
54
+ type IntrinsicElementForTag<Tag extends string> =
55
+ Tag extends keyof HTMLElementTagNameMap
56
+ ? HTMLElementTagNameMap[Tag]
57
+ : Tag extends keyof SVGElementTagNameMap
58
+ ? SVGElementTagNameMap[Tag]
59
+ : Tag extends keyof MathMLElementTagNameMap | MathMLExtraTag
60
+ ? MathMLElement
61
+ : Element;
51
62
  interface IntrinsicEventProps {
52
- onAbort?: BivariantHandler<Event>;
53
- onBlur?: BivariantHandler<FocusEvent>;
54
- onChange?: BivariantHandler<Event>;
55
- onClick?: BivariantHandler<MouseEvent>;
56
- onDblClick?: BivariantHandler<MouseEvent>;
57
- onFocus?: BivariantHandler<FocusEvent>;
58
- onInput?: BivariantHandler<InputEvent>;
59
- onKeyDown?: BivariantHandler<KeyboardEvent>;
60
- onKeyUp?: BivariantHandler<KeyboardEvent>;
61
- onMouseDown?: BivariantHandler<MouseEvent>;
62
- onMouseEnter?: BivariantHandler<MouseEvent>;
63
- onMouseLeave?: BivariantHandler<MouseEvent>;
64
- onMouseMove?: BivariantHandler<MouseEvent>;
65
- onMouseOut?: BivariantHandler<MouseEvent>;
66
- onMouseOver?: BivariantHandler<MouseEvent>;
67
- onMouseUp?: BivariantHandler<MouseEvent>;
68
- onPointerDown?: BivariantHandler<PointerEvent>;
69
- onPointerDownCapture?: BivariantHandler<PointerEvent>;
70
- onPointerEnter?: BivariantHandler<PointerEvent>;
71
- onPointerLeave?: BivariantHandler<PointerEvent>;
72
- onPointerMove?: BivariantHandler<PointerEvent>;
73
- onPointerUp?: BivariantHandler<PointerEvent>;
74
- onScroll?: BivariantHandler<Event>;
75
- onSubmit?: BivariantHandler<SubmitEvent>;
76
- onTouchEnd?: BivariantHandler<TouchEvent>;
77
- onTouchStart?: BivariantHandler<TouchEvent>;
78
- onWheel?: BivariantHandler<WheelEvent>;
63
+ onAbort?: BivariantHandler<Event> | null;
64
+ onAnimationCancel?: BivariantHandler<AnimationEvent> | null;
65
+ onAnimationEnd?: BivariantHandler<AnimationEvent> | null;
66
+ onAnimationIteration?: BivariantHandler<AnimationEvent> | null;
67
+ onAnimationStart?: BivariantHandler<AnimationEvent> | null;
68
+ onAuxClick?: BivariantHandler<PointerEvent> | null;
69
+ onBeforeInput?: BivariantHandler<InputEvent> | null;
70
+ onBeforeMatch?: BivariantHandler<Event> | null;
71
+ onBeforeToggle?: BivariantHandler<ToggleEvent> | null;
72
+ onBlur?: BivariantHandler<FocusEvent> | null;
73
+ onCancel?: BivariantHandler<Event> | null;
74
+ onCanPlay?: BivariantHandler<Event> | null;
75
+ onCanPlayThrough?: BivariantHandler<Event> | null;
76
+ onChange?: BivariantHandler<Event> | null;
77
+ onClick?: BivariantHandler<MouseEvent> | null;
78
+ onClose?: BivariantHandler<Event> | null;
79
+ onCommand?: BivariantHandler<Event> | null;
80
+ onCompositionEnd?: BivariantHandler<CompositionEvent> | null;
81
+ onCompositionStart?: BivariantHandler<CompositionEvent> | null;
82
+ onCompositionUpdate?: BivariantHandler<CompositionEvent> | null;
83
+ onContextLost?: BivariantHandler<Event> | null;
84
+ onContextMenu?: BivariantHandler<PointerEvent> | null;
85
+ onContextRestored?: BivariantHandler<Event> | null;
86
+ onCopy?: BivariantHandler<ClipboardEvent> | null;
87
+ onCueChange?: BivariantHandler<Event> | null;
88
+ onCut?: BivariantHandler<ClipboardEvent> | null;
89
+ onDblClick?: BivariantHandler<MouseEvent> | null;
90
+ onDrag?: BivariantHandler<DragEvent> | null;
91
+ onDragEnd?: BivariantHandler<DragEvent> | null;
92
+ onDragEnter?: BivariantHandler<DragEvent> | null;
93
+ onDragLeave?: BivariantHandler<DragEvent> | null;
94
+ onDragOver?: BivariantHandler<DragEvent> | null;
95
+ onDragStart?: BivariantHandler<DragEvent> | null;
96
+ onDrop?: BivariantHandler<DragEvent> | null;
97
+ onDurationChange?: BivariantHandler<Event> | null;
98
+ onEmptied?: BivariantHandler<Event> | null;
99
+ onEnded?: BivariantHandler<Event> | null;
100
+ onError?: BivariantHandler<ErrorEvent> | null;
101
+ onFocus?: BivariantHandler<FocusEvent> | null;
102
+ onFocusIn?: BivariantHandler<FocusEvent> | null;
103
+ onFocusOut?: BivariantHandler<FocusEvent> | null;
104
+ onFormData?: BivariantHandler<FormDataEvent> | null;
105
+ onGotPointerCapture?: BivariantHandler<PointerEvent> | null;
106
+ onInput?: BivariantHandler<InputEvent> | null;
107
+ onInvalid?: BivariantHandler<Event> | null;
108
+ onKeyDown?: BivariantHandler<KeyboardEvent> | null;
109
+ onKeyPress?: BivariantHandler<KeyboardEvent> | null;
110
+ onKeyUp?: BivariantHandler<KeyboardEvent> | null;
111
+ onLoad?: BivariantHandler<Event> | null;
112
+ onLoadedData?: BivariantHandler<Event> | null;
113
+ onLoadedMetadata?: BivariantHandler<Event> | null;
114
+ onLoadStart?: BivariantHandler<Event> | null;
115
+ onLostPointerCapture?: BivariantHandler<PointerEvent> | null;
116
+ onMouseDown?: BivariantHandler<MouseEvent> | null;
117
+ onMouseEnter?: BivariantHandler<MouseEvent> | null;
118
+ onMouseLeave?: BivariantHandler<MouseEvent> | null;
119
+ onMouseMove?: BivariantHandler<MouseEvent> | null;
120
+ onMouseOut?: BivariantHandler<MouseEvent> | null;
121
+ onMouseOver?: BivariantHandler<MouseEvent> | null;
122
+ onMouseUp?: BivariantHandler<MouseEvent> | null;
123
+ onPaste?: BivariantHandler<ClipboardEvent> | null;
124
+ onPause?: BivariantHandler<Event> | null;
125
+ onPlay?: BivariantHandler<Event> | null;
126
+ onPlaying?: BivariantHandler<Event> | null;
127
+ onPointerCancel?: BivariantHandler<PointerEvent> | null;
128
+ onPointerDown?: BivariantHandler<PointerEvent> | null;
129
+ onPointerEnter?: BivariantHandler<PointerEvent> | null;
130
+ onPointerLeave?: BivariantHandler<PointerEvent> | null;
131
+ onPointerMove?: BivariantHandler<PointerEvent> | null;
132
+ onPointerOut?: BivariantHandler<PointerEvent> | null;
133
+ onPointerOver?: BivariantHandler<PointerEvent> | null;
134
+ onPointerRawUpdate?: BivariantHandler<Event> | null;
135
+ onPointerUp?: BivariantHandler<PointerEvent> | null;
136
+ onProgress?: BivariantHandler<ProgressEvent<EventTarget>> | null;
137
+ onRateChange?: BivariantHandler<Event> | null;
138
+ onReset?: BivariantHandler<Event> | null;
139
+ onResize?: BivariantHandler<UIEvent> | null;
140
+ onScroll?: BivariantHandler<Event> | null;
141
+ onScrollEnd?: BivariantHandler<Event> | null;
142
+ onSecurityPolicyViolation?: BivariantHandler<SecurityPolicyViolationEvent> | null;
143
+ onSeeked?: BivariantHandler<Event> | null;
144
+ onSeeking?: BivariantHandler<Event> | null;
145
+ onSelect?: BivariantHandler<Event> | null;
146
+ onSelectionChange?: BivariantHandler<Event> | null;
147
+ onSelectStart?: BivariantHandler<Event> | null;
148
+ onSlotChange?: BivariantHandler<Event> | null;
149
+ onStalled?: BivariantHandler<Event> | null;
150
+ onSubmit?: BivariantHandler<SubmitEvent> | null;
151
+ onSuspend?: BivariantHandler<Event> | null;
152
+ onTimeUpdate?: BivariantHandler<Event> | null;
153
+ onToggle?: BivariantHandler<ToggleEvent> | null;
154
+ onTouchCancel?: BivariantHandler<TouchEvent> | null;
155
+ onTouchEnd?: BivariantHandler<TouchEvent> | null;
156
+ onTouchMove?: BivariantHandler<TouchEvent> | null;
157
+ onTouchStart?: BivariantHandler<TouchEvent> | null;
158
+ onTransitionCancel?: BivariantHandler<TransitionEvent> | null;
159
+ onTransitionEnd?: BivariantHandler<TransitionEvent> | null;
160
+ onTransitionRun?: BivariantHandler<TransitionEvent> | null;
161
+ onTransitionStart?: BivariantHandler<TransitionEvent> | null;
162
+ onVolumeChange?: BivariantHandler<Event> | null;
163
+ onWaiting?: BivariantHandler<Event> | null;
164
+ onWebkitAnimationEnd?: BivariantHandler<Event> | null;
165
+ onWebkitAnimationIteration?: BivariantHandler<Event> | null;
166
+ onWebkitAnimationStart?: BivariantHandler<Event> | null;
167
+ onWebkitTransitionEnd?: BivariantHandler<Event> | null;
168
+ onWheel?: BivariantHandler<WheelEvent> | null;
79
169
  }
170
+ type CapturedIntrinsicEventProps = {
171
+ [
172
+ Name in keyof IntrinsicEventProps as `${Name & string}Capture`
173
+ ]?: IntrinsicEventProps[Name];
174
+ };
80
175
  /**
81
176
  * Props understood specially by intrinsic JSX elements.
82
177
  *
83
178
  * This stays separate from Props so component-level prop bags can remain
84
179
  * intentionally generic while JSX element usage gets stronger contracts.
85
180
  */
86
- interface IntrinsicProps extends IntrinsicEventProps {
87
- key?: string | number | symbol;
181
+ interface IntrinsicProps
182
+ extends IntrinsicEventProps, CapturedIntrinsicEventProps {
183
+ /** JSX keys are string or number; symbol keys stay in the generic Props bag. */
184
+ key?: string | number;
88
185
  children?: unknown;
89
186
  /**
90
187
  * Leaves descendant DOM ownership to an imperative widget after mount.
91
188
  * Askr will continue updating the host element's props, events, and ref.
92
189
  */
93
190
  imperativeChildren?: boolean;
191
+ /** Raw HTML for the element's content, written as given (not escaped). */
192
+ dangerouslySetInnerHTML?: { __html: string | null | undefined } | null;
94
193
  class?: ReactiveProp<IntrinsicClassValue>;
95
194
  className?: ReactiveProp<IntrinsicClassValue>;
96
195
  style?: ReactiveProp<IntrinsicStyleValue>;
@@ -102,13 +201,24 @@ interface IntrinsicProps extends IntrinsicEventProps {
102
201
  hidden?: ReactiveProp<IntrinsicBooleanValue>;
103
202
  dir?: ReactiveProp<IntrinsicTextValue>;
104
203
  lang?: ReactiveProp<IntrinsicTextValue>;
105
- contentEditable?: ReactiveProp<IntrinsicTextValue>;
106
- draggable?: ReactiveProp<IntrinsicTextValue>;
204
+ contentEditable?: ReactiveProp<IntrinsicEnumeratedValue>;
205
+ draggable?: ReactiveProp<IntrinsicEnumeratedValue>;
107
206
  enterKeyHint?: ReactiveProp<IntrinsicTextValue>;
108
207
  inputMode?: ReactiveProp<IntrinsicTextValue>;
109
- spellCheck?: ReactiveProp<IntrinsicTextValue>;
208
+ spellCheck?: ReactiveProp<IntrinsicEnumeratedValue>;
209
+ writingSuggestions?: ReactiveProp<IntrinsicEnumeratedValue>;
110
210
  [attr: `aria-${string}`]: ReactiveProp<IntrinsicAriaValue>;
111
211
  [attr: `data-${string}`]: ReactiveProp<IntrinsicDataValue>;
212
+ /**
213
+ * Assigns the DOM property after the prefix, verbatim (`prop:srcObject`).
214
+ * Never written as an attribute, and never rendered by SSR.
215
+ */
216
+ [prop: `prop:${string}`]: unknown;
217
+ /**
218
+ * Writes the attribute after the prefix as named, where Askr would otherwise
219
+ * set a property (`attr:config` on a custom element).
220
+ */
221
+ [attr: `attr:${string}`]: ReactiveProp<IntrinsicDataValue>;
112
222
  }
113
223
  /**
114
224
  * Fallback intrinsic props for arbitrary tag names and dynamic prop spreads.
@@ -197,6 +307,11 @@ interface AnchorIntrinsicProps extends IntrinsicProps {
197
307
  }
198
308
  interface ButtonIntrinsicProps extends IntrinsicProps {
199
309
  disabled?: ReactiveProp<IntrinsicBooleanValue>;
310
+ formAction?: ReactiveProp<IntrinsicTextValue>;
311
+ formEncType?: ReactiveProp<IntrinsicTextValue>;
312
+ formMethod?: ReactiveProp<IntrinsicTextValue>;
313
+ formNoValidate?: ReactiveProp<IntrinsicBooleanValue>;
314
+ formTarget?: ReactiveProp<IntrinsicTextValue>;
200
315
  name?: ReactiveProp<IntrinsicTextValue>;
201
316
  type?: ReactiveProp<IntrinsicTextValue>;
202
317
  value?: ReactiveProp<IntrinsicFormValue>;
@@ -215,10 +330,17 @@ interface ImageIntrinsicProps extends IntrinsicProps {
215
330
  width?: ReactiveProp<IntrinsicTextLikeValue>;
216
331
  }
217
332
  interface InputIntrinsicProps extends IntrinsicProps {
333
+ formAction?: ReactiveProp<IntrinsicTextValue>;
334
+ formEncType?: ReactiveProp<IntrinsicTextValue>;
335
+ formMethod?: ReactiveProp<IntrinsicTextValue>;
336
+ formNoValidate?: ReactiveProp<IntrinsicBooleanValue>;
337
+ formTarget?: ReactiveProp<IntrinsicTextValue>;
218
338
  autoComplete?: ReactiveProp<IntrinsicTextValue>;
219
339
  autocomplete?: ReactiveProp<IntrinsicTextValue>;
220
340
  checked?: ReactiveProp<IntrinsicBooleanValue>;
221
341
  disabled?: ReactiveProp<IntrinsicBooleanValue>;
342
+ /** Sets the `indeterminate` property; there is no attribute to render. */
343
+ indeterminate?: ReactiveProp<IntrinsicBooleanValue>;
222
344
  maxLength?: ReactiveProp<IntrinsicNumberValue>;
223
345
  maxlength?: ReactiveProp<IntrinsicNumberValue>;
224
346
  minLength?: ReactiveProp<IntrinsicNumberValue>;
@@ -240,13 +362,56 @@ type OutputIntrinsicProps = StructuredContentIntrinsicProps<{
240
362
  name?: ReactiveProp<IntrinsicTextValue>;
241
363
  }>;
242
364
  type SvgPresentationIntrinsicAllowedProps = {
365
+ alignmentBaseline?: ReactiveProp<IntrinsicTextLikeValue>;
366
+ baselineShift?: ReactiveProp<IntrinsicTextLikeValue>;
367
+ clipPath?: ReactiveProp<IntrinsicTextLikeValue>;
243
368
  clipRule?: ReactiveProp<IntrinsicTextValue>;
369
+ colorInterpolation?: ReactiveProp<IntrinsicTextLikeValue>;
370
+ colorInterpolationFilters?: ReactiveProp<IntrinsicTextLikeValue>;
371
+ colorRendering?: ReactiveProp<IntrinsicTextLikeValue>;
372
+ dominantBaseline?: ReactiveProp<IntrinsicTextLikeValue>;
244
373
  fill?: ReactiveProp<IntrinsicTextValue>;
374
+ fillOpacity?: ReactiveProp<IntrinsicTextLikeValue>;
245
375
  fillRule?: ReactiveProp<IntrinsicTextValue>;
376
+ floodColor?: ReactiveProp<IntrinsicTextLikeValue>;
377
+ floodOpacity?: ReactiveProp<IntrinsicTextLikeValue>;
378
+ fontFamily?: ReactiveProp<IntrinsicTextLikeValue>;
379
+ fontSize?: ReactiveProp<IntrinsicTextLikeValue>;
380
+ fontSizeAdjust?: ReactiveProp<IntrinsicTextLikeValue>;
381
+ fontStretch?: ReactiveProp<IntrinsicTextLikeValue>;
382
+ fontStyle?: ReactiveProp<IntrinsicTextLikeValue>;
383
+ fontVariant?: ReactiveProp<IntrinsicTextLikeValue>;
384
+ fontWeight?: ReactiveProp<IntrinsicTextLikeValue>;
385
+ imageRendering?: ReactiveProp<IntrinsicTextLikeValue>;
386
+ letterSpacing?: ReactiveProp<IntrinsicTextLikeValue>;
387
+ lightingColor?: ReactiveProp<IntrinsicTextLikeValue>;
388
+ markerEnd?: ReactiveProp<IntrinsicTextLikeValue>;
389
+ markerMid?: ReactiveProp<IntrinsicTextLikeValue>;
390
+ markerStart?: ReactiveProp<IntrinsicTextLikeValue>;
391
+ maskType?: ReactiveProp<IntrinsicTextLikeValue>;
392
+ paintOrder?: ReactiveProp<IntrinsicTextLikeValue>;
393
+ pointerEvents?: ReactiveProp<IntrinsicTextLikeValue>;
394
+ shapeRendering?: ReactiveProp<IntrinsicTextLikeValue>;
395
+ stopColor?: ReactiveProp<IntrinsicTextLikeValue>;
396
+ stopOpacity?: ReactiveProp<IntrinsicTextLikeValue>;
246
397
  stroke?: ReactiveProp<IntrinsicTextValue>;
398
+ strokeDasharray?: ReactiveProp<IntrinsicTextLikeValue>;
399
+ strokeDashoffset?: ReactiveProp<IntrinsicTextLikeValue>;
247
400
  strokeLinecap?: ReactiveProp<IntrinsicTextValue>;
248
401
  strokeLinejoin?: ReactiveProp<IntrinsicTextValue>;
402
+ strokeMiterlimit?: ReactiveProp<IntrinsicTextLikeValue>;
403
+ strokeOpacity?: ReactiveProp<IntrinsicTextLikeValue>;
249
404
  strokeWidth?: ReactiveProp<IntrinsicTextLikeValue>;
405
+ textAnchor?: ReactiveProp<IntrinsicTextLikeValue>;
406
+ textDecoration?: ReactiveProp<IntrinsicTextLikeValue>;
407
+ textOverflow?: ReactiveProp<IntrinsicTextLikeValue>;
408
+ textRendering?: ReactiveProp<IntrinsicTextLikeValue>;
409
+ transformOrigin?: ReactiveProp<IntrinsicTextLikeValue>;
410
+ unicodeBidi?: ReactiveProp<IntrinsicTextLikeValue>;
411
+ vectorEffect?: ReactiveProp<IntrinsicTextLikeValue>;
412
+ whiteSpace?: ReactiveProp<IntrinsicTextLikeValue>;
413
+ wordSpacing?: ReactiveProp<IntrinsicTextLikeValue>;
414
+ writingMode?: ReactiveProp<IntrinsicTextLikeValue>;
250
415
  };
251
416
  type SvgIntrinsicProps = StructuredContentIntrinsicProps<
252
417
  SvgPresentationIntrinsicAllowedProps & {
@@ -310,7 +475,7 @@ interface TextareaIntrinsicProps extends IntrinsicProps {
310
475
  rows?: ReactiveProp<IntrinsicNumberValue>;
311
476
  value?: ReactiveProp<IntrinsicTextValue>;
312
477
  }
313
- interface KnownIntrinsicElementProps {
478
+ interface KnownIntrinsicElementPropsBase {
314
479
  a: AnchorIntrinsicProps;
315
480
  article: LayoutIntrinsicProps;
316
481
  aside: LayoutIntrinsicProps;
@@ -363,6 +528,15 @@ interface KnownIntrinsicElementProps {
363
528
  tr: LayoutIntrinsicProps;
364
529
  ul: LayoutIntrinsicProps;
365
530
  }
531
+ type WithElementRef<Props, Target extends Element> = {
532
+ [Key in keyof Props]: Key extends 'ref' ? IntrinsicRef<Target> : Props[Key];
533
+ };
534
+ type KnownIntrinsicElementProps = {
535
+ [Tag in keyof KnownIntrinsicElementPropsBase]: WithElementRef<
536
+ KnownIntrinsicElementPropsBase[Tag],
537
+ IntrinsicElementForTag<Tag>
538
+ >;
539
+ };
366
540
  /** The element type marker for JSX fragments (`<>...</>`), groups children without a wrapper element. */
367
541
  declare const Fragment: unique symbol;
368
542
  /** A component function accepting `TProps`, usable as a JSX element's `type`. */
@@ -382,22 +556,11 @@ interface JSXElement {
382
556
  /** Optional key (normalized by runtime) */
383
557
  key?: string | number | null;
384
558
  }
385
- declare global {
386
- namespace JSX {
387
- interface Element extends JSXElement {
388
- readonly __askrJsxElementBrand?: never;
389
- }
390
- interface IntrinsicElements extends KnownIntrinsicElementProps {}
391
- interface ElementAttributesProperty {
392
- props: Props;
393
- }
394
- interface ElementChildrenAttribute {
395
- children: unknown;
396
- }
397
- }
398
- }
399
559
  export {
400
560
  IntrinsicFallbackProps,
561
+ MathMLExtraTag,
562
+ IntrinsicRef,
563
+ IntrinsicElementForTag,
401
564
  JSXElementType,
402
565
  JSXComponent,
403
566
  KnownIntrinsicElementProps,
@@ -0,0 +1,293 @@
1
+ import { F as logger, I as isDevelopmentEnvironment, d as recordUndo, s as requireInstance } from "./instance-BAnfmXOR.js";
2
+ import { i as isFragmentType, n as Fragment, r as STATIC_CHILDREN, t as ELEMENT_TYPE } from "./jsx-DRS-qjiN.js";
3
+ import { c as onCommit, o as hookSlot } from "./hooks-BimKStr4.js";
4
+ /** Explicitly adopted DOM node, used by an error-boundary fallback. */
5
+ const NATIVE_TYPE = Symbol.for("askr.core.native");
6
+ /**
7
+ * Element type rendering its children in place but owned by `props.owner`:
8
+ * portal content lives at its host's position and in its writer's lifetime.
9
+ */
10
+ const OWNED_TYPE = Symbol.for("askr.core.owned");
11
+ function propsOf(vnode) {
12
+ const props = vnode.props ?? {};
13
+ if (props.children === void 0 && vnode.children !== void 0) return {
14
+ ...props,
15
+ children: vnode.children
16
+ };
17
+ return props;
18
+ }
19
+ function keyOf(vnode) {
20
+ const key = vnode.key ?? vnode.props?.key;
21
+ return key === null || key === void 0 ? void 0 : key;
22
+ }
23
+ function isHostNode(value) {
24
+ return typeof Node !== "undefined" && value instanceof Node;
25
+ }
26
+ /** A function child's result treats nested functions as values. */
27
+ function functionChildOutput(value) {
28
+ if (typeof value === "function") return null;
29
+ if (Array.isArray(value)) {
30
+ const mapped = value.map(functionChildOutput);
31
+ if (value[STATIC_CHILDREN]) Object.defineProperty(mapped, STATIC_CHILDREN, { value: true });
32
+ return mapped;
33
+ }
34
+ if (value && typeof value === "object") {
35
+ const vnode = value;
36
+ if (isFragmentType(vnode.type)) {
37
+ const props = propsOf(vnode);
38
+ return {
39
+ ...vnode,
40
+ props: {
41
+ ...props,
42
+ children: functionChildOutput(props.children)
43
+ }
44
+ };
45
+ }
46
+ }
47
+ return value;
48
+ }
49
+ /** The descriptor's identity for matching against a previous render. */
50
+ function descriptorType(child) {
51
+ switch (child.kind) {
52
+ case 0: return child.tag;
53
+ case 2: return child.fn;
54
+ case 7: return child.node;
55
+ default: return child.kind;
56
+ }
57
+ }
58
+ function normalizeChildren(value, out = []) {
59
+ if (value === null || value === void 0 || typeof value === "boolean") return out;
60
+ switch (typeof value) {
61
+ case "string":
62
+ out.push({
63
+ kind: 1,
64
+ key: void 0,
65
+ text: value
66
+ });
67
+ return out;
68
+ case "number":
69
+ case "bigint":
70
+ out.push({
71
+ kind: 1,
72
+ key: void 0,
73
+ text: String(value)
74
+ });
75
+ return out;
76
+ case "function":
77
+ out.push({
78
+ kind: 4,
79
+ key: void 0,
80
+ fn: value
81
+ });
82
+ return out;
83
+ case "object": break;
84
+ default:
85
+ out.push({
86
+ kind: 1,
87
+ key: void 0,
88
+ text: String(value)
89
+ });
90
+ return out;
91
+ }
92
+ if (Array.isArray(value)) {
93
+ for (const item of value) normalizeChildren(item, out);
94
+ return out;
95
+ }
96
+ if (isHostNode(value)) return out;
97
+ const vnode = value;
98
+ const type = vnode.type;
99
+ if (type === void 0) {
100
+ if (Symbol.iterator in value) {
101
+ for (const item of value) normalizeChildren(item, out);
102
+ return out;
103
+ }
104
+ return out;
105
+ }
106
+ const key = keyOf(vnode);
107
+ if (typeof type === "string") out.push({
108
+ kind: 0,
109
+ key,
110
+ tag: type,
111
+ props: propsOf(vnode)
112
+ });
113
+ else if (typeof type === "function") out.push({
114
+ kind: 2,
115
+ key,
116
+ fn: type,
117
+ props: propsOf(vnode)
118
+ });
119
+ else if (type === OWNED_TYPE) {
120
+ const props = propsOf(vnode);
121
+ out.push({
122
+ kind: 3,
123
+ key,
124
+ children: props.children,
125
+ owner: props.owner
126
+ });
127
+ } else if (isFragmentType(type)) out.push({
128
+ kind: 3,
129
+ key,
130
+ children: propsOf(vnode).children
131
+ });
132
+ else if (type === NATIVE_TYPE) out.push({
133
+ kind: 7,
134
+ key: void 0,
135
+ node: propsOf(vnode).node
136
+ });
137
+ else throw new Error(`[Askr] Unknown element type: ${String(type)}`);
138
+ return out;
139
+ }
140
+ //#endregion
141
+ //#region src/core/api/error-boundary.ts
142
+ function boundaryState(slot) {
143
+ return {
144
+ caught: slot.caught,
145
+ error: slot.error,
146
+ resetKey: slot.resetKey
147
+ };
148
+ }
149
+ function restoreBoundaryState(slot, previous) {
150
+ slot.caught = previous.caught;
151
+ slot.error = previous.error;
152
+ slot.resetKey = previous.resetKey;
153
+ }
154
+ const boundarySlots = /* @__PURE__ */ new WeakMap();
155
+ const recoveryHolds = /* @__PURE__ */ new WeakMap();
156
+ /** The nearest ErrorBoundary above `owner`, or null. */
157
+ function nearestErrorBoundary(owner) {
158
+ for (let current = owner?.parent ?? null; current; current = current.parent) if (boundarySlots.has(current)) return current;
159
+ return null;
160
+ }
161
+ /**
162
+ * While `boundary` shows its fallback, defer `release` until the boundary
163
+ * commits a recovery or ends. Returns false (and does not call `release`)
164
+ * when the boundary is not showing a fallback.
165
+ */
166
+ function holdUntilBoundaryRecovers(boundary, release) {
167
+ if (boundary.disposed || !boundarySlots.get(boundary)?.caught) return false;
168
+ let holds = recoveryHolds.get(boundary);
169
+ if (!holds) {
170
+ holds = /* @__PURE__ */ new Set();
171
+ recoveryHolds.set(boundary, holds);
172
+ boundary.onCleanup(() => releaseHolds(boundary));
173
+ }
174
+ holds.add(release);
175
+ return true;
176
+ }
177
+ function releaseHolds(boundary) {
178
+ const holds = recoveryHolds.get(boundary);
179
+ if (!holds) return;
180
+ recoveryHolds.delete(boundary);
181
+ for (const release of holds) release();
182
+ }
183
+ function errorMessage(error) {
184
+ if (error instanceof Error) return error.message || error.name;
185
+ if (typeof error === "string") return error;
186
+ try {
187
+ return JSON.stringify(error);
188
+ } catch {
189
+ return String(error);
190
+ }
191
+ }
192
+ function element(type, props) {
193
+ if (Array.isArray(props.children)) Object.defineProperty(props.children, STATIC_CHILDREN, { value: true });
194
+ return {
195
+ $$typeof: ELEMENT_TYPE,
196
+ type,
197
+ props,
198
+ key: null
199
+ };
200
+ }
201
+ function defaultFallback(error, reset) {
202
+ return element("div", {
203
+ role: "alert",
204
+ "data-askr-error-boundary": "true",
205
+ style: {
206
+ boxSizing: "border-box",
207
+ padding: "1rem",
208
+ border: "1px solid currentColor",
209
+ borderRadius: "0.75rem",
210
+ display: "grid",
211
+ gap: "0.75rem",
212
+ maxWidth: "100%"
213
+ },
214
+ children: [
215
+ element("strong", { children: "Something went wrong while rendering this view." }),
216
+ element("p", {
217
+ style: { margin: "0" },
218
+ children: "The app recovered into a visible fallback so the error is not hidden in the console."
219
+ }),
220
+ element("details", {
221
+ open: isDevelopmentEnvironment(),
222
+ children: [element("summary", { children: "Error details" }), element("pre", {
223
+ style: {
224
+ margin: "0",
225
+ whiteSpace: "pre-wrap",
226
+ wordBreak: "break-word"
227
+ },
228
+ children: errorMessage(error)
229
+ })]
230
+ }),
231
+ element("button", {
232
+ type: "button",
233
+ onClick: reset,
234
+ children: "Try again"
235
+ })
236
+ ]
237
+ });
238
+ }
239
+ function ErrorBoundary(props) {
240
+ const instance = requireInstance("ErrorBoundary()");
241
+ const slot = hookSlot(instance, "errorBoundary", () => ({
242
+ caught: false,
243
+ error: void 0,
244
+ resetKey: props.resetKey
245
+ }));
246
+ if (!Object.is(slot.resetKey, props.resetKey)) {
247
+ const previous = boundaryState(slot);
248
+ recordUndo(() => restoreBoundaryState(slot, previous));
249
+ slot.resetKey = props.resetKey;
250
+ slot.caught = false;
251
+ slot.error = void 0;
252
+ }
253
+ const previousBoundary = instance.boundary;
254
+ instance.boundary = (error) => {
255
+ if (slot.caught && Object.is(slot.resetKey, props.resetKey)) return false;
256
+ const previous = boundaryState(slot);
257
+ recordUndo(() => restoreBoundaryState(slot, previous));
258
+ slot.resetKey = props.resetKey;
259
+ slot.caught = true;
260
+ slot.error = error;
261
+ try {
262
+ props.onError?.(error);
263
+ } catch (hookError) {
264
+ logger.error("[Askr] ErrorBoundary onError handler threw:", hookError);
265
+ }
266
+ logger.error("[Askr] ErrorBoundary caught render error:", error);
267
+ return true;
268
+ };
269
+ recordUndo(() => {
270
+ instance.boundary = previousBoundary;
271
+ });
272
+ boundarySlots.set(instance, slot);
273
+ if (!slot.caught) {
274
+ if (recoveryHolds.has(instance)) onCommit(instance, () => releaseHolds(instance));
275
+ return {
276
+ $$typeof: ELEMENT_TYPE,
277
+ type: Fragment,
278
+ props: { children: props.children },
279
+ key: null
280
+ };
281
+ }
282
+ const reset = () => {
283
+ if (!slot.caught) return;
284
+ slot.caught = false;
285
+ slot.error = void 0;
286
+ instance.computation.invalidate();
287
+ };
288
+ const fallback = props.fallback;
289
+ const output = typeof fallback === "function" ? fallback(slot.error, reset) : fallback ?? defaultFallback(slot.error, reset);
290
+ return typeof Node !== "undefined" && output instanceof Node ? element(NATIVE_TYPE, { node: output }) : output;
291
+ }
292
+ //#endregion
293
+ export { descriptorType as a, OWNED_TYPE as i, holdUntilBoundaryRecovers as n, functionChildOutput as o, nearestErrorBoundary as r, normalizeChildren as s, ErrorBoundary as t };