@derivesome/tree-web 0.1.1

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 (73) hide show
  1. package/.package.json.~undo-tree~ +10 -0
  2. package/.tsconfig.json.~undo-tree~ +6 -0
  3. package/dist/cjs/css.d.ts +5 -0
  4. package/dist/cjs/css.d.ts.map +1 -0
  5. package/dist/cjs/css.js +14 -0
  6. package/dist/cjs/css.js.map +1 -0
  7. package/dist/cjs/index.d.ts +5 -0
  8. package/dist/cjs/index.d.ts.map +1 -0
  9. package/dist/cjs/index.js +21 -0
  10. package/dist/cjs/index.js.map +1 -0
  11. package/dist/cjs/jsx-globals.d.ts +826 -0
  12. package/dist/cjs/jsx-globals.d.ts.map +1 -0
  13. package/dist/cjs/jsx-globals.js +18 -0
  14. package/dist/cjs/jsx-globals.js.map +1 -0
  15. package/dist/cjs/mount.d.ts +2 -0
  16. package/dist/cjs/mount.d.ts.map +1 -0
  17. package/dist/cjs/mount.js +9 -0
  18. package/dist/cjs/mount.js.map +1 -0
  19. package/dist/cjs/renderer.d.ts +3 -0
  20. package/dist/cjs/renderer.d.ts.map +1 -0
  21. package/dist/cjs/renderer.js +123 -0
  22. package/dist/cjs/renderer.js.map +1 -0
  23. package/dist/esm/css.d.ts +5 -0
  24. package/dist/esm/css.d.ts.map +1 -0
  25. package/dist/esm/css.js +14 -0
  26. package/dist/esm/css.js.map +1 -0
  27. package/dist/esm/index.d.ts +5 -0
  28. package/dist/esm/index.d.ts.map +1 -0
  29. package/dist/esm/index.js +21 -0
  30. package/dist/esm/index.js.map +1 -0
  31. package/dist/esm/jsx-globals.d.ts +826 -0
  32. package/dist/esm/jsx-globals.d.ts.map +1 -0
  33. package/dist/esm/jsx-globals.js +18 -0
  34. package/dist/esm/jsx-globals.js.map +1 -0
  35. package/dist/esm/mount.d.ts +2 -0
  36. package/dist/esm/mount.d.ts.map +1 -0
  37. package/dist/esm/mount.js +9 -0
  38. package/dist/esm/mount.js.map +1 -0
  39. package/dist/esm/renderer.d.ts +3 -0
  40. package/dist/esm/renderer.d.ts.map +1 -0
  41. package/dist/esm/renderer.js +123 -0
  42. package/dist/esm/renderer.js.map +1 -0
  43. package/package.json +47 -0
  44. package/package.json~ +53 -0
  45. package/src/.context.ts.~undo-tree~ +6 -0
  46. package/src/.css.ts.~undo-tree~ +6 -0
  47. package/src/.index.ts.~undo-tree~ +8 -0
  48. package/src/.jsx-globals.ts.~undo-tree~ +192 -0
  49. package/src/.jsx-types.ts.~undo-tree~ +23 -0
  50. package/src/.mount.test.ts.~undo-tree~ +438 -0
  51. package/src/.mount.ts.~undo-tree~ +16 -0
  52. package/src/.renderer.ts.~undo-tree~ +96 -0
  53. package/src/.tree.ts.~undo-tree~ +489 -0
  54. package/src/.velement.ts.~undo-tree~ +1738 -0
  55. package/src/context.ts~ +0 -0
  56. package/src/css.ts +13 -0
  57. package/src/css.ts~ +13 -0
  58. package/src/index.ts +4 -0
  59. package/src/index.ts~ +4 -0
  60. package/src/jsx-globals.ts +861 -0
  61. package/src/jsx-globals.ts~ +854 -0
  62. package/src/jsx-types.ts~ +772 -0
  63. package/src/mount.test.ts~ +375 -0
  64. package/src/mount.ts +6 -0
  65. package/src/mount.ts~ +10 -0
  66. package/src/renderer.ts +133 -0
  67. package/src/renderer.ts~ +133 -0
  68. package/src/tree.ts~ +212 -0
  69. package/src/velement.ts~ +856 -0
  70. package/tsconfig.cjs.json +10 -0
  71. package/tsconfig.esm.json +10 -0
  72. package/tsconfig.json +23 -0
  73. package/tsconfig.json~ +23 -0
@@ -0,0 +1,861 @@
1
+ /**
2
+ * JSX type definitions and global ambient declarations for @derivesome/tree-web.
3
+ *
4
+ * A prop value can be:
5
+ * - Static: T
6
+ * - Reactive: Reference<T> (from @derivesome/core)
7
+ * - Computed: () => T
8
+ *
9
+ * Event handler props (onClick, onInput, …) are always static functions and
10
+ * are NOT wrapped in Reactive<T>.
11
+ */
12
+ import {
13
+ Component,
14
+ createNode,
15
+ TreeNodeProps,
16
+ type TreeNode,
17
+ } from "@derivesome/tree";
18
+ import { Derived, Reference } from "@derivesome/core";
19
+ import { CSSProperties } from "./css";
20
+
21
+ /**
22
+ * A prop value that may be static, a reactive reference, or a computed function.
23
+ *
24
+ * Uses `ReadonlyReference<T>` (bivariant `observe`, covariant `get`/`peek`) rather than
25
+ * `Reference<T>` (invariant due to `set`) so that e.g. `ref(0)` (`Reference<number>`) is
26
+ * accepted wherever `Reactive<string | number>` is expected.
27
+ */
28
+ export type Reactive<T> = T | Reference<T> | Derived<T> | (() => T);
29
+
30
+ export type Child = unknown | TreeNode | TreeNode[];
31
+
32
+ // ── Event handlers ────────────────────────────────────────────────────────────
33
+
34
+ export interface DOMEventHandlers<Target = HTMLElement> {
35
+ // Mouse
36
+ onClick?: (e: MouseEvent & { target: Target }) => void;
37
+ onDblClick?: (e: MouseEvent & { target: Target }) => void;
38
+ onMouseDown?: (e: MouseEvent & { target: Target }) => void;
39
+ onMouseUp?: (e: MouseEvent & { target: Target }) => void;
40
+ onMouseMove?: (e: MouseEvent & { target: Target }) => void;
41
+ onMouseEnter?: (e: MouseEvent & { target: Target }) => void;
42
+ onMouseLeave?: (e: MouseEvent & { target: Target }) => void;
43
+ onMouseOver?: (e: MouseEvent & { target: Target }) => void;
44
+ onMouseOut?: (e: MouseEvent & { target: Target }) => void;
45
+ onContextMenu?: (e: MouseEvent & { target: Target }) => void;
46
+ // Keyboard
47
+ onKeyDown?: (e: KeyboardEvent & { target: Target }) => void;
48
+ onKeyUp?: (e: KeyboardEvent & { target: Target }) => void;
49
+ onKeyPress?: (e: KeyboardEvent & { target: Target }) => void;
50
+ // Input / form
51
+ onInput?: (e: InputEvent & { target: Target }) => void;
52
+ onChange?: (e: Event & { target: Target }) => void;
53
+ onSubmit?: (e: SubmitEvent & { target: Target }) => void;
54
+ onReset?: (e: Event & { target: Target }) => void;
55
+ onFocus?: (e: FocusEvent & { target: Target }) => void;
56
+ onBlur?: (e: FocusEvent & { target: Target }) => void;
57
+ onSelect?: (e: Event & { target: Target }) => void;
58
+ // Pointer
59
+ onPointerDown?: (e: PointerEvent & { target: Target }) => void;
60
+ onPointerUp?: (e: PointerEvent & { target: Target }) => void;
61
+ onPointerMove?: (e: PointerEvent & { target: Target }) => void;
62
+ onPointerEnter?: (e: PointerEvent & { target: Target }) => void;
63
+ onPointerLeave?: (e: PointerEvent & { target: Target }) => void;
64
+ onPointerCancel?: (e: PointerEvent & { target: Target }) => void;
65
+ onPointerOver?: (e: PointerEvent & { target: Target }) => void;
66
+ onPointerOut?: (e: PointerEvent & { target: Target }) => void;
67
+ onGotPointerCapture?: (e: PointerEvent & { target: Target }) => void;
68
+ onLostPointerCapture?: (e: PointerEvent & { target: Target }) => void;
69
+ // Touch
70
+ onTouchStart?: (e: TouchEvent & { target: Target }) => void;
71
+ onTouchEnd?: (e: TouchEvent & { target: Target }) => void;
72
+ onTouchMove?: (e: TouchEvent & { target: Target }) => void;
73
+ onTouchCancel?: (e: TouchEvent & { target: Target }) => void;
74
+ // Wheel / scroll
75
+ onWheel?: (e: WheelEvent & { target: Target }) => void;
76
+ onScroll?: (e: Event & { target: Target }) => void;
77
+ onScrollEnd?: (e: Event & { target: Target }) => void;
78
+ // Clipboard
79
+ onCopy?: (e: ClipboardEvent & { target: Target }) => void;
80
+ onCut?: (e: ClipboardEvent & { target: Target }) => void;
81
+ onPaste?: (e: ClipboardEvent & { target: Target }) => void;
82
+ // Drag
83
+ onDrag?: (e: DragEvent & { target: Target }) => void;
84
+ onDragStart?: (e: DragEvent & { target: Target }) => void;
85
+ onDragEnd?: (e: DragEvent & { target: Target }) => void;
86
+ onDragEnter?: (e: DragEvent & { target: Target }) => void;
87
+ onDragOver?: (e: DragEvent & { target: Target }) => void;
88
+ onDragLeave?: (e: DragEvent & { target: Target }) => void;
89
+ onDrop?: (e: DragEvent & { target: Target }) => void;
90
+ // Animation / transition
91
+ onAnimationStart?: (e: AnimationEvent & { target: Target }) => void;
92
+ onAnimationEnd?: (e: AnimationEvent & { target: Target }) => void;
93
+ onAnimationIteration?: (e: AnimationEvent & { target: Target }) => void;
94
+ onAnimationCancel?: (e: AnimationEvent & { target: Target }) => void;
95
+ onTransitionStart?: (e: TransitionEvent & { target: Target }) => void;
96
+ onTransitionEnd?: (e: TransitionEvent & { target: Target }) => void;
97
+ onTransitionCancel?: (e: TransitionEvent & { target: Target }) => void;
98
+ // Load
99
+ onLoad?: (e: Event & { target: Target }) => void;
100
+ onError?: (e: Event & { target: Target }) => void;
101
+ onAbort?: (e: Event & { target: Target }) => void;
102
+ // Misc
103
+ onResize?: (e: UIEvent & { target: Target }) => void;
104
+ onBeforeInput?: (e: InputEvent & { target: Target }) => void;
105
+ onCompositionStart?: (e: CompositionEvent & { target: Target }) => void;
106
+ onCompositionUpdate?: (e: CompositionEvent & { target: Target }) => void;
107
+ onCompositionEnd?: (e: CompositionEvent & { target: Target }) => void;
108
+ }
109
+
110
+ // ── Base HTML attributes ──────────────────────────────────────────────────────
111
+
112
+ export interface HTMLAttributes<
113
+ Target = HTMLElement,
114
+ > extends DOMEventHandlers<Target> {
115
+ /** Child nodes passed between JSX tags. */
116
+ children?: Child;
117
+ /** Reconciliation key for list rendering. */
118
+ key?: string | number;
119
+ /** Callback ref — called with the DOM element after it is inserted into the parent. */
120
+ ref?: (el: Element) => void;
121
+ // Global HTML attributes
122
+ id?: Reactive<string>;
123
+ class?: Reactive<string>;
124
+ className?: Reactive<string>;
125
+ style?: Reactive<string | CSSProperties>;
126
+ title?: Reactive<string>;
127
+ lang?: Reactive<string>;
128
+ dir?: Reactive<"ltr" | "rtl" | "auto">;
129
+ tabIndex?: Reactive<number>;
130
+ hidden?: Reactive<boolean>;
131
+ draggable?: Reactive<boolean | "true" | "false">;
132
+ spellCheck?: Reactive<boolean>;
133
+ translate?: Reactive<"yes" | "no">;
134
+ contentEditable?: Reactive<
135
+ boolean | "true" | "false" | "inherit" | "plaintext-only"
136
+ >;
137
+ slot?: Reactive<string>;
138
+ part?: Reactive<string>;
139
+ exportparts?: Reactive<string>;
140
+ // ARIA
141
+ role?: Reactive<string>;
142
+ "aria-label"?: Reactive<string>;
143
+ "aria-labelledby"?: Reactive<string>;
144
+ "aria-describedby"?: Reactive<string>;
145
+ "aria-details"?: Reactive<string>;
146
+ "aria-hidden"?: Reactive<boolean | "true" | "false">;
147
+ "aria-expanded"?: Reactive<boolean | "true" | "false">;
148
+ "aria-checked"?: Reactive<boolean | "true" | "false" | "mixed">;
149
+ "aria-selected"?: Reactive<boolean | "true" | "false">;
150
+ "aria-disabled"?: Reactive<boolean | "true" | "false">;
151
+ "aria-required"?: Reactive<boolean | "true" | "false">;
152
+ "aria-readonly"?: Reactive<boolean | "true" | "false">;
153
+ "aria-invalid"?: Reactive<
154
+ boolean | "true" | "false" | "grammar" | "spelling"
155
+ >;
156
+ "aria-current"?: Reactive<
157
+ boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time"
158
+ >;
159
+ "aria-live"?: Reactive<"off" | "assertive" | "polite">;
160
+ "aria-atomic"?: Reactive<boolean | "true" | "false">;
161
+ "aria-relevant"?: Reactive<
162
+ "additions" | "additions text" | "all" | "removals" | "text"
163
+ >;
164
+ "aria-busy"?: Reactive<boolean | "true" | "false">;
165
+ "aria-controls"?: Reactive<string>;
166
+ "aria-owns"?: Reactive<string>;
167
+ "aria-flowto"?: Reactive<string>;
168
+ "aria-activedescendant"?: Reactive<string>;
169
+ "aria-colcount"?: Reactive<number>;
170
+ "aria-colindex"?: Reactive<number>;
171
+ "aria-colspan"?: Reactive<number>;
172
+ "aria-rowcount"?: Reactive<number>;
173
+ "aria-rowindex"?: Reactive<number>;
174
+ "aria-rowspan"?: Reactive<number>;
175
+ "aria-posinset"?: Reactive<number>;
176
+ "aria-setsize"?: Reactive<number>;
177
+ "aria-level"?: Reactive<number>;
178
+ "aria-multiline"?: Reactive<boolean | "true" | "false">;
179
+ "aria-multiselectable"?: Reactive<boolean | "true" | "false">;
180
+ "aria-orientation"?: Reactive<"horizontal" | "vertical">;
181
+ "aria-haspopup"?: Reactive<
182
+ boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog"
183
+ >;
184
+ "aria-sort"?: Reactive<"none" | "ascending" | "descending" | "other">;
185
+ "aria-valuemin"?: Reactive<number>;
186
+ "aria-valuemax"?: Reactive<number>;
187
+ "aria-valuenow"?: Reactive<number>;
188
+ "aria-valuetext"?: Reactive<string>;
189
+ "aria-autocomplete"?: Reactive<"none" | "inline" | "list" | "both">;
190
+ "aria-keyshortcuts"?: Reactive<string>;
191
+ "aria-roledescription"?: Reactive<string>;
192
+ "aria-placeholder"?: Reactive<string>;
193
+ // data-* catch-all
194
+ [key: `data-${string}`]: Reactive<string | number | boolean | undefined>;
195
+ }
196
+
197
+ // ── Element-specific attributes ───────────────────────────────────────────────
198
+
199
+ export interface AnchorAttributes extends HTMLAttributes<HTMLAnchorElement> {
200
+ href?: Reactive<string>;
201
+ target?: Reactive<"_blank" | "_self" | "_parent" | "_top" | (string & {})>;
202
+ rel?: Reactive<string>;
203
+ download?: Reactive<string | boolean>;
204
+ hrefLang?: Reactive<string>;
205
+ type?: Reactive<string>;
206
+ ping?: Reactive<string>;
207
+ referrerPolicy?: Reactive<ReferrerPolicy>;
208
+ }
209
+
210
+ export interface ButtonAttributes extends HTMLAttributes<HTMLButtonElement> {
211
+ type?: Reactive<"button" | "submit" | "reset">;
212
+ disabled?: Reactive<boolean>;
213
+ name?: Reactive<string>;
214
+ value?: Reactive<string>;
215
+ form?: Reactive<string>;
216
+ formAction?: Reactive<string>;
217
+ formMethod?: Reactive<"get" | "post">;
218
+ formEncType?: Reactive<string>;
219
+ formNoValidate?: Reactive<boolean>;
220
+ formTarget?: Reactive<string>;
221
+ autoFocus?: Reactive<boolean>;
222
+ popoverTarget?: Reactive<string>;
223
+ popoverTargetAction?: Reactive<"show" | "hide" | "toggle">;
224
+ }
225
+
226
+ export interface InputAttributes extends HTMLAttributes<HTMLInputElement> {
227
+ type?: Reactive<
228
+ | "text"
229
+ | "password"
230
+ | "email"
231
+ | "number"
232
+ | "tel"
233
+ | "url"
234
+ | "search"
235
+ | "date"
236
+ | "time"
237
+ | "datetime-local"
238
+ | "month"
239
+ | "week"
240
+ | "color"
241
+ | "file"
242
+ | "checkbox"
243
+ | "radio"
244
+ | "range"
245
+ | "hidden"
246
+ | "submit"
247
+ | "reset"
248
+ | "button"
249
+ | "image"
250
+ >;
251
+ value?: Reactive<string | number>;
252
+ defaultValue?: Reactive<string | number>;
253
+ checked?: Reactive<boolean>;
254
+ defaultChecked?: Reactive<boolean>;
255
+ placeholder?: Reactive<string>;
256
+ disabled?: Reactive<boolean>;
257
+ readOnly?: Reactive<boolean>;
258
+ required?: Reactive<boolean>;
259
+ multiple?: Reactive<boolean>;
260
+ min?: Reactive<string | number>;
261
+ max?: Reactive<string | number>;
262
+ step?: Reactive<string | number>;
263
+ minLength?: Reactive<number>;
264
+ maxLength?: Reactive<number>;
265
+ accept?: Reactive<string>;
266
+ autoComplete?: Reactive<string>;
267
+ autoFocus?: Reactive<boolean>;
268
+ name?: Reactive<string>;
269
+ pattern?: Reactive<string>;
270
+ size?: Reactive<number>;
271
+ src?: Reactive<string>;
272
+ width?: Reactive<number | string>;
273
+ height?: Reactive<number | string>;
274
+ list?: Reactive<string>;
275
+ form?: Reactive<string>;
276
+ capture?: Reactive<"user" | "environment">;
277
+ indeterminate?: Reactive<boolean>;
278
+ }
279
+
280
+ export interface SelectAttributes extends HTMLAttributes<HTMLSelectElement> {
281
+ value?: Reactive<string | number | string[]>;
282
+ defaultValue?: Reactive<string | number | string[]>;
283
+ disabled?: Reactive<boolean>;
284
+ multiple?: Reactive<boolean>;
285
+ name?: Reactive<string>;
286
+ required?: Reactive<boolean>;
287
+ size?: Reactive<number>;
288
+ autoFocus?: Reactive<boolean>;
289
+ form?: Reactive<string>;
290
+ }
291
+
292
+ export interface TextareaAttributes extends HTMLAttributes<HTMLTextAreaElement> {
293
+ value?: Reactive<string>;
294
+ defaultValue?: Reactive<string>;
295
+ disabled?: Reactive<boolean>;
296
+ readOnly?: Reactive<boolean>;
297
+ required?: Reactive<boolean>;
298
+ placeholder?: Reactive<string>;
299
+ rows?: Reactive<number>;
300
+ cols?: Reactive<number>;
301
+ minLength?: Reactive<number>;
302
+ maxLength?: Reactive<number>;
303
+ name?: Reactive<string>;
304
+ wrap?: Reactive<"hard" | "soft">;
305
+ autoFocus?: Reactive<boolean>;
306
+ autoComplete?: Reactive<string>;
307
+ form?: Reactive<string>;
308
+ spellCheck?: Reactive<boolean>;
309
+ resize?: Reactive<"none" | "both" | "horizontal" | "vertical">;
310
+ }
311
+
312
+ export interface FormAttributes extends HTMLAttributes<HTMLFormElement> {
313
+ action?: Reactive<string>;
314
+ method?: Reactive<"get" | "post" | "dialog">;
315
+ encType?: Reactive<string>;
316
+ noValidate?: Reactive<boolean>;
317
+ target?: Reactive<string>;
318
+ name?: Reactive<string>;
319
+ autoComplete?: Reactive<"on" | "off">;
320
+ }
321
+
322
+ export interface LabelAttributes extends HTMLAttributes<HTMLLabelElement> {
323
+ for?: Reactive<string>;
324
+ htmlFor?: Reactive<string>;
325
+ form?: Reactive<string>;
326
+ }
327
+
328
+ export interface FieldsetAttributes extends HTMLAttributes<HTMLFieldSetElement> {
329
+ disabled?: Reactive<boolean>;
330
+ name?: Reactive<string>;
331
+ form?: Reactive<string>;
332
+ }
333
+
334
+ export interface OptionAttributes extends HTMLAttributes<HTMLOptionElement> {
335
+ value?: Reactive<string | number>;
336
+ selected?: Reactive<boolean>;
337
+ disabled?: Reactive<boolean>;
338
+ label?: Reactive<string>;
339
+ }
340
+
341
+ export interface OptGroupAttributes extends HTMLAttributes<HTMLOptGroupElement> {
342
+ label?: Reactive<string>;
343
+ disabled?: Reactive<boolean>;
344
+ }
345
+
346
+ export interface ImgAttributes extends HTMLAttributes<HTMLImageElement> {
347
+ src?: Reactive<string>;
348
+ alt?: Reactive<string>;
349
+ width?: Reactive<number | string>;
350
+ height?: Reactive<number | string>;
351
+ loading?: Reactive<"eager" | "lazy">;
352
+ decoding?: Reactive<"auto" | "async" | "sync">;
353
+ crossOrigin?: Reactive<"anonymous" | "use-credentials">;
354
+ srcSet?: Reactive<string>;
355
+ sizes?: Reactive<string>;
356
+ referrerPolicy?: Reactive<ReferrerPolicy>;
357
+ fetchPriority?: Reactive<"high" | "low" | "auto">;
358
+ isMap?: Reactive<boolean>;
359
+ useMap?: Reactive<string>;
360
+ }
361
+
362
+ export interface MediaAttributes<
363
+ Target = HTMLMediaElement,
364
+ > extends HTMLAttributes<Target> {
365
+ src?: Reactive<string>;
366
+ autoPlay?: Reactive<boolean>;
367
+ controls?: Reactive<boolean>;
368
+ loop?: Reactive<boolean>;
369
+ muted?: Reactive<boolean>;
370
+ preload?: Reactive<"auto" | "metadata" | "none">;
371
+ crossOrigin?: Reactive<"anonymous" | "use-credentials">;
372
+ width?: Reactive<number | string>;
373
+ height?: Reactive<number | string>;
374
+ onPlay?: (e: Event) => void;
375
+ onPause?: (e: Event) => void;
376
+ onEnded?: (e: Event) => void;
377
+ onTimeUpdate?: (e: Event) => void;
378
+ onLoadedData?: (e: Event) => void;
379
+ onLoadedMetadata?: (e: Event) => void;
380
+ onCanPlay?: (e: Event) => void;
381
+ onCanPlayThrough?: (e: Event) => void;
382
+ onVolumeChange?: (e: Event) => void;
383
+ onSeeked?: (e: Event) => void;
384
+ onSeeking?: (e: Event) => void;
385
+ onDurationChange?: (e: Event) => void;
386
+ onProgress?: (e: Event) => void;
387
+ onWaiting?: (e: Event) => void;
388
+ onStalled?: (e: Event) => void;
389
+ onSuspend?: (e: Event) => void;
390
+ onRateChange?: (e: Event) => void;
391
+ onEmptied?: (e: Event) => void;
392
+ }
393
+
394
+ export interface VideoAttributes extends MediaAttributes<HTMLVideoElement> {
395
+ poster?: Reactive<string>;
396
+ playsInline?: Reactive<boolean>;
397
+ }
398
+
399
+ export interface CanvasAttributes extends HTMLAttributes<HTMLCanvasElement> {
400
+ width?: Reactive<number | string>;
401
+ height?: Reactive<number | string>;
402
+ }
403
+
404
+ export interface IframeAttributes extends HTMLAttributes<HTMLIFrameElement> {
405
+ src?: Reactive<string>;
406
+ srcdoc?: Reactive<string>;
407
+ name?: Reactive<string>;
408
+ width?: Reactive<number | string>;
409
+ height?: Reactive<number | string>;
410
+ allow?: Reactive<string>;
411
+ allowFullScreen?: Reactive<boolean>;
412
+ loading?: Reactive<"eager" | "lazy">;
413
+ sandbox?: Reactive<string>;
414
+ referrerPolicy?: Reactive<ReferrerPolicy>;
415
+ }
416
+
417
+ export interface SourceAttributes extends HTMLAttributes<HTMLSourceElement> {
418
+ src?: Reactive<string>;
419
+ srcSet?: Reactive<string>;
420
+ media?: Reactive<string>;
421
+ type?: Reactive<string>;
422
+ sizes?: Reactive<string>;
423
+ width?: Reactive<number | string>;
424
+ height?: Reactive<number | string>;
425
+ }
426
+
427
+ export interface TrackAttributes extends HTMLAttributes<HTMLTrackElement> {
428
+ src?: Reactive<string>;
429
+ kind?: Reactive<
430
+ "subtitles" | "captions" | "descriptions" | "chapters" | "metadata"
431
+ >;
432
+ srcLang?: Reactive<string>;
433
+ label?: Reactive<string>;
434
+ default?: Reactive<boolean>;
435
+ }
436
+
437
+ export interface LinkAttributes extends HTMLAttributes<HTMLLinkElement> {
438
+ href?: Reactive<string>;
439
+ rel?: Reactive<string>;
440
+ type?: Reactive<string>;
441
+ media?: Reactive<string>;
442
+ crossOrigin?: Reactive<"anonymous" | "use-credentials">;
443
+ as?: Reactive<string>;
444
+ integrity?: Reactive<string>;
445
+ hrefLang?: Reactive<string>;
446
+ sizes?: Reactive<string>;
447
+ fetchPriority?: Reactive<"high" | "low" | "auto">;
448
+ }
449
+
450
+ export interface MetaAttributes extends HTMLAttributes<HTMLMetaElement> {
451
+ name?: Reactive<string>;
452
+ content?: Reactive<string>;
453
+ charset?: Reactive<string>;
454
+ httpEquiv?: Reactive<string>;
455
+ property?: Reactive<string>;
456
+ }
457
+
458
+ export interface ScriptAttributes extends HTMLAttributes<HTMLScriptElement> {
459
+ src?: Reactive<string>;
460
+ type?: Reactive<string>;
461
+ async?: Reactive<boolean>;
462
+ defer?: Reactive<boolean>;
463
+ crossOrigin?: Reactive<"anonymous" | "use-credentials">;
464
+ integrity?: Reactive<string>;
465
+ noModule?: Reactive<boolean>;
466
+ nonce?: Reactive<string>;
467
+ }
468
+
469
+ export interface StyleAttributes extends HTMLAttributes<HTMLStyleElement> {
470
+ media?: Reactive<string>;
471
+ nonce?: Reactive<string>;
472
+ scoped?: Reactive<boolean>;
473
+ }
474
+
475
+ export interface TableCellAttributes extends HTMLAttributes<HTMLTableCellElement> {
476
+ colSpan?: Reactive<number>;
477
+ rowSpan?: Reactive<number>;
478
+ headers?: Reactive<string>;
479
+ scope?: Reactive<"col" | "colgroup" | "row" | "rowgroup">;
480
+ abbr?: Reactive<string>;
481
+ }
482
+
483
+ export interface ColAttributes extends HTMLAttributes<HTMLTableColElement> {
484
+ span?: Reactive<number>;
485
+ }
486
+
487
+ export interface DetailsAttributes extends HTMLAttributes<HTMLDetailsElement> {
488
+ open?: Reactive<boolean>;
489
+ }
490
+
491
+ export interface DialogAttributes extends HTMLAttributes<HTMLDialogElement> {
492
+ open?: Reactive<boolean>;
493
+ onClose?: (e: Event) => void;
494
+ onCancel?: (e: Event) => void;
495
+ }
496
+
497
+ export interface ProgressAttributes extends HTMLAttributes<HTMLProgressElement> {
498
+ value?: Reactive<number>;
499
+ max?: Reactive<number>;
500
+ }
501
+
502
+ export interface MeterAttributes extends HTMLAttributes<HTMLMeterElement> {
503
+ value?: Reactive<number>;
504
+ min?: Reactive<number>;
505
+ max?: Reactive<number>;
506
+ low?: Reactive<number>;
507
+ high?: Reactive<number>;
508
+ optimum?: Reactive<number>;
509
+ }
510
+
511
+ export interface OutputAttributes extends HTMLAttributes {
512
+ for?: Reactive<string>;
513
+ htmlFor?: Reactive<string>;
514
+ form?: Reactive<string>;
515
+ name?: Reactive<string>;
516
+ }
517
+
518
+ export interface ObjectAttributes extends HTMLAttributes {
519
+ data?: Reactive<string>;
520
+ type?: Reactive<string>;
521
+ name?: Reactive<string>;
522
+ width?: Reactive<number | string>;
523
+ height?: Reactive<number | string>;
524
+ form?: Reactive<string>;
525
+ }
526
+
527
+ export interface BlockquoteAttributes extends HTMLAttributes {
528
+ cite?: Reactive<string>;
529
+ }
530
+
531
+ export interface TimeAttributes extends HTMLAttributes<HTMLTimeElement> {
532
+ dateTime?: Reactive<string>;
533
+ }
534
+
535
+ export interface QAttributes extends HTMLAttributes {
536
+ cite?: Reactive<string>;
537
+ }
538
+
539
+ export interface OlAttributes extends HTMLAttributes<HTMLOListElement> {
540
+ reversed?: Reactive<boolean>;
541
+ start?: Reactive<number>;
542
+ type?: Reactive<"1" | "a" | "A" | "i" | "I">;
543
+ }
544
+
545
+ export interface LiAttributes extends HTMLAttributes<HTMLLIElement> {
546
+ value?: Reactive<number>;
547
+ }
548
+
549
+ // ── SVG attributes ────────────────────────────────────────────────────────────
550
+
551
+ export interface SVGAttributes<
552
+ Target = SVGElement,
553
+ > extends DOMEventHandlers<Target> {
554
+ children?: Child;
555
+ /** Callback ref — called with the SVG element after it is inserted into the parent. */
556
+ ref?: (el: Element) => void;
557
+ // Allow key for reconciliation
558
+ id?: Reactive<string>;
559
+ class?: Reactive<string>;
560
+ className?: Reactive<string>;
561
+ style?: Reactive<string | CSSProperties>;
562
+ tabIndex?: Reactive<number>;
563
+ // Presentation
564
+ fill?: Reactive<string>;
565
+ fillOpacity?: Reactive<number | string>;
566
+ "fill-opacity"?: Reactive<number | string>;
567
+ fillRule?: Reactive<"nonzero" | "evenodd" | "inherit">;
568
+ "fill-rule"?: Reactive<"nonzero" | "evenodd" | "inherit">;
569
+ stroke?: Reactive<string>;
570
+ strokeWidth?: Reactive<number | string>;
571
+ "stroke-width"?: Reactive<number | string>;
572
+ strokeOpacity?: Reactive<number | string>;
573
+ "stroke-opacity"?: Reactive<number | string>;
574
+ strokeLinecap?: Reactive<"butt" | "round" | "square">;
575
+ "stroke-linecap"?: Reactive<"butt" | "round" | "square">;
576
+ strokeLinejoin?: Reactive<
577
+ "arcs" | "bevel" | "miter" | "miter-clip" | "round"
578
+ >;
579
+ "stroke-linejoin"?: Reactive<
580
+ "arcs" | "bevel" | "miter" | "miter-clip" | "round"
581
+ >;
582
+ strokeDasharray?: Reactive<string | number>;
583
+ "stroke-dasharray"?: Reactive<string | number>;
584
+ strokeDashoffset?: Reactive<string | number>;
585
+ "stroke-dashoffset"?: Reactive<string | number>;
586
+ opacity?: Reactive<number | string>;
587
+ // Geometry
588
+ x?: Reactive<number | string>;
589
+ y?: Reactive<number | string>;
590
+ x1?: Reactive<number | string>;
591
+ y1?: Reactive<number | string>;
592
+ x2?: Reactive<number | string>;
593
+ y2?: Reactive<number | string>;
594
+ cx?: Reactive<number | string>;
595
+ cy?: Reactive<number | string>;
596
+ r?: Reactive<number | string>;
597
+ rx?: Reactive<number | string>;
598
+ ry?: Reactive<number | string>;
599
+ d?: Reactive<string>;
600
+ points?: Reactive<string>;
601
+ width?: Reactive<number | string>;
602
+ height?: Reactive<number | string>;
603
+ // Transform / layout
604
+ transform?: Reactive<string>;
605
+ viewBox?: Reactive<string>;
606
+ preserveAspectRatio?: Reactive<string>;
607
+ // Text
608
+ "text-anchor"?: Reactive<"start" | "middle" | "end">;
609
+ textAnchor?: Reactive<"start" | "middle" | "end">;
610
+ "dominant-baseline"?: Reactive<string>;
611
+ dominantBaseline?: Reactive<string>;
612
+ "font-size"?: Reactive<string | number>;
613
+ fontSize?: Reactive<string | number>;
614
+ "font-family"?: Reactive<string>;
615
+ fontFamily?: Reactive<string>;
616
+ "font-weight"?: Reactive<string | number>;
617
+ fontWeight?: Reactive<string | number>;
618
+ "font-style"?: Reactive<string>;
619
+ fontStyle?: Reactive<string>;
620
+ // Misc
621
+ mask?: Reactive<string>;
622
+ "clip-path"?: Reactive<string>;
623
+ clipPath?: Reactive<string>;
624
+ filter?: Reactive<string>;
625
+ href?: Reactive<string>;
626
+ "xlink:href"?: Reactive<string>;
627
+ xmlns?: string;
628
+ [key: `data-${string}`]: Reactive<string | number | boolean | undefined>;
629
+ }
630
+
631
+ export interface SVGSvgAttributes extends SVGAttributes<SVGSVGElement> {
632
+ xmlns?: string;
633
+ version?: Reactive<string>;
634
+ }
635
+
636
+ export interface SVGStopAttributes extends SVGAttributes<SVGStopElement> {
637
+ offset?: Reactive<string | number>;
638
+ "stop-color"?: Reactive<string>;
639
+ stopColor?: Reactive<string>;
640
+ "stop-opacity"?: Reactive<number | string>;
641
+ stopOpacity?: Reactive<number | string>;
642
+ }
643
+
644
+ // ── Intrinsic elements map (defined once, shared by module and global JSX) ────
645
+
646
+ export interface IntrinsicElementsMap {
647
+ // ── Content sectioning ──────────────────────────────────────────────────
648
+ div: HTMLAttributes;
649
+ span: HTMLAttributes;
650
+ p: HTMLAttributes;
651
+ h1: HTMLAttributes;
652
+ h2: HTMLAttributes;
653
+ h3: HTMLAttributes;
654
+ h4: HTMLAttributes;
655
+ h5: HTMLAttributes;
656
+ h6: HTMLAttributes;
657
+ header: HTMLAttributes;
658
+ footer: HTMLAttributes;
659
+ main: HTMLAttributes;
660
+ nav: HTMLAttributes;
661
+ aside: HTMLAttributes;
662
+ article: HTMLAttributes;
663
+ section: HTMLAttributes;
664
+ address: HTMLAttributes;
665
+ hgroup: HTMLAttributes;
666
+ search: HTMLAttributes;
667
+ // ── Text content ────────────────────────────────────────────────────────
668
+ ul: HTMLAttributes;
669
+ ol: OlAttributes;
670
+ li: LiAttributes;
671
+ dl: HTMLAttributes;
672
+ dt: HTMLAttributes;
673
+ dd: HTMLAttributes;
674
+ figure: HTMLAttributes;
675
+ figcaption: HTMLAttributes;
676
+ hr: HTMLAttributes;
677
+ pre: HTMLAttributes;
678
+ blockquote: BlockquoteAttributes;
679
+ // ── Inline text ─────────────────────────────────────────────────────────
680
+ a: AnchorAttributes;
681
+ abbr: HTMLAttributes;
682
+ b: HTMLAttributes;
683
+ bdi: HTMLAttributes;
684
+ bdo: HTMLAttributes;
685
+ br: HTMLAttributes;
686
+ cite: HTMLAttributes;
687
+ code: HTMLAttributes;
688
+ data: HTMLAttributes;
689
+ dfn: HTMLAttributes;
690
+ em: HTMLAttributes;
691
+ i: HTMLAttributes;
692
+ kbd: HTMLAttributes;
693
+ mark: HTMLAttributes;
694
+ q: QAttributes;
695
+ rp: HTMLAttributes;
696
+ rt: HTMLAttributes;
697
+ ruby: HTMLAttributes;
698
+ s: HTMLAttributes;
699
+ samp: HTMLAttributes;
700
+ small: HTMLAttributes;
701
+ strong: HTMLAttributes;
702
+ sub: HTMLAttributes;
703
+ sup: HTMLAttributes;
704
+ time: TimeAttributes;
705
+ u: HTMLAttributes;
706
+ var: HTMLAttributes;
707
+ wbr: HTMLAttributes;
708
+ // ── Forms ────────────────────────────────────────────────────────────────
709
+ form: FormAttributes;
710
+ input: InputAttributes;
711
+ button: ButtonAttributes;
712
+ select: SelectAttributes;
713
+ textarea: TextareaAttributes;
714
+ label: LabelAttributes;
715
+ fieldset: FieldsetAttributes;
716
+ legend: HTMLAttributes;
717
+ datalist: HTMLAttributes;
718
+ optgroup: OptGroupAttributes;
719
+ option: OptionAttributes;
720
+ output: OutputAttributes;
721
+ progress: ProgressAttributes;
722
+ meter: MeterAttributes;
723
+ // ── Interactive ──────────────────────────────────────────────────────────
724
+ details: DetailsAttributes;
725
+ summary: HTMLAttributes;
726
+ dialog: DialogAttributes;
727
+ menu: HTMLAttributes;
728
+ // ── Embedded content ─────────────────────────────────────────────────────
729
+ img: ImgAttributes;
730
+ picture: HTMLAttributes;
731
+ source: SourceAttributes;
732
+ iframe: IframeAttributes;
733
+ embed: HTMLAttributes;
734
+ object: ObjectAttributes;
735
+ map: HTMLAttributes;
736
+ area: HTMLAttributes;
737
+ canvas: CanvasAttributes;
738
+ // ── Media ────────────────────────────────────────────────────────────────
739
+ audio: MediaAttributes;
740
+ video: VideoAttributes;
741
+ track: TrackAttributes;
742
+ // ── Scripting ────────────────────────────────────────────────────────────
743
+ script: ScriptAttributes;
744
+ noscript: HTMLAttributes;
745
+ template: HTMLAttributes;
746
+ slot: HTMLAttributes;
747
+ // ── Table ────────────────────────────────────────────────────────────────
748
+ table: HTMLAttributes;
749
+ caption: HTMLAttributes;
750
+ colgroup: HTMLAttributes;
751
+ col: ColAttributes;
752
+ thead: HTMLAttributes;
753
+ tbody: HTMLAttributes;
754
+ tfoot: HTMLAttributes;
755
+ tr: HTMLAttributes;
756
+ td: TableCellAttributes;
757
+ th: TableCellAttributes;
758
+ // ── Metadata ─────────────────────────────────────────────────────────────
759
+ head: HTMLAttributes;
760
+ title: HTMLAttributes;
761
+ base: HTMLAttributes;
762
+ link: LinkAttributes;
763
+ meta: MetaAttributes;
764
+ style: StyleAttributes;
765
+ // ── Root ─────────────────────────────────────────────────────────────────
766
+ html: HTMLAttributes;
767
+ body: HTMLAttributes;
768
+ // ── SVG ──────────────────────────────────────────────────────────────────
769
+ svg: SVGSvgAttributes;
770
+ path: SVGAttributes;
771
+ circle: SVGAttributes;
772
+ rect: SVGAttributes;
773
+ ellipse: SVGAttributes;
774
+ line: SVGAttributes;
775
+ polyline: SVGAttributes;
776
+ polygon: SVGAttributes;
777
+ text: SVGAttributes;
778
+ tspan: SVGAttributes;
779
+ g: SVGAttributes;
780
+ defs: SVGAttributes;
781
+ use: SVGAttributes;
782
+ symbol: SVGAttributes;
783
+ marker: SVGAttributes;
784
+ clipPath: SVGAttributes;
785
+ mask: SVGAttributes;
786
+ pattern: SVGAttributes;
787
+ linearGradient: SVGAttributes;
788
+ radialGradient: SVGAttributes;
789
+ stop: SVGStopAttributes;
790
+ image: SVGAttributes;
791
+ filter: SVGAttributes;
792
+ feBlend: SVGAttributes;
793
+ feColorMatrix: SVGAttributes;
794
+ feComponentTransfer: SVGAttributes;
795
+ feComposite: SVGAttributes;
796
+ feConvolveMatrix: SVGAttributes;
797
+ feDiffuseLighting: SVGAttributes;
798
+ feDisplacementMap: SVGAttributes;
799
+ feFlood: SVGAttributes;
800
+ feGaussianBlur: SVGAttributes;
801
+ feImage: SVGAttributes;
802
+ feMerge: SVGAttributes;
803
+ feMorphology: SVGAttributes;
804
+ feOffset: SVGAttributes;
805
+ feSpecularLighting: SVGAttributes;
806
+ feTile: SVGAttributes;
807
+ feTurbulence: SVGAttributes;
808
+ foreignObject: SVGAttributes;
809
+ animate: SVGAttributes;
810
+ animateMotion: SVGAttributes;
811
+ animateTransform: SVGAttributes;
812
+ mpath: SVGAttributes;
813
+ set: SVGAttributes;
814
+ }
815
+
816
+ export interface UnknownElementsMap extends IntrinsicElementsMap {
817
+ [key: string | symbol]: TreeNodeProps;
818
+ }
819
+
820
+ // ── Global ambient declarations ───────────────────────────────────────────────
821
+
822
+ declare global {
823
+ export namespace JSX {
824
+ export type Element = any;
825
+
826
+ /** Tells TypeScript which prop holds children. */
827
+ export interface ElementChildrenAttribute {
828
+ children: unknown;
829
+ }
830
+
831
+ export interface IntrinsicElements extends UnknownElementsMap {}
832
+
833
+ export type IntrinsicAttributes =
834
+ IntrinsicElements[keyof IntrinsicElements];
835
+ export type Attributes = IntrinsicElements[keyof IntrinsicElements];
836
+
837
+ export type ElementType =
838
+ | keyof IntrinsicElements
839
+ | Component
840
+ | null
841
+ | undefined
842
+ | false
843
+ | true
844
+ | boolean
845
+ | string
846
+ | (string & {})
847
+ | string[]
848
+ | (string & {})[]
849
+ | {};
850
+ }
851
+
852
+ export var React: typeof createNode;
853
+ export var ds_jsx: typeof createNode;
854
+ export var Fragment: typeof createNode;
855
+ }
856
+
857
+ globalThis.ds_jsx = createNode;
858
+ globalThis.React = createNode;
859
+ globalThis.Fragment = createNode;
860
+
861
+ export {};