@fictjs/runtime 0.0.13 → 0.0.14

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 (52) hide show
  1. package/dist/advanced.cjs +79 -0
  2. package/dist/advanced.cjs.map +1 -0
  3. package/dist/advanced.d.cts +50 -0
  4. package/dist/advanced.d.ts +50 -0
  5. package/dist/advanced.js +79 -0
  6. package/dist/advanced.js.map +1 -0
  7. package/dist/chunk-624QY53A.cjs +45 -0
  8. package/dist/chunk-624QY53A.cjs.map +1 -0
  9. package/dist/chunk-F3AIYQB7.js +45 -0
  10. package/dist/chunk-F3AIYQB7.js.map +1 -0
  11. package/dist/chunk-GJTYOFMO.cjs +109 -0
  12. package/dist/chunk-GJTYOFMO.cjs.map +1 -0
  13. package/dist/chunk-IUZXKAAY.js +109 -0
  14. package/dist/chunk-IUZXKAAY.js.map +1 -0
  15. package/dist/chunk-PMF6MWEV.cjs +3301 -0
  16. package/dist/chunk-PMF6MWEV.cjs.map +1 -0
  17. package/dist/chunk-RY4WDS6R.js +3301 -0
  18. package/dist/chunk-RY4WDS6R.js.map +1 -0
  19. package/dist/context-B7UYnfzM.d.ts +153 -0
  20. package/dist/context-UXySaqI_.d.cts +153 -0
  21. package/dist/effect-Auji1rz9.d.cts +350 -0
  22. package/dist/effect-Auji1rz9.d.ts +350 -0
  23. package/dist/index.cjs +98 -3558
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +5 -1358
  26. package/dist/index.d.ts +5 -1358
  27. package/dist/index.dev.js +240 -1698
  28. package/dist/index.dev.js.map +1 -1
  29. package/dist/index.js +63 -3435
  30. package/dist/index.js.map +1 -1
  31. package/dist/internal.cjs +901 -0
  32. package/dist/internal.cjs.map +1 -0
  33. package/dist/internal.d.cts +158 -0
  34. package/dist/internal.d.ts +158 -0
  35. package/dist/internal.js +901 -0
  36. package/dist/internal.js.map +1 -0
  37. package/dist/{jsx-dev-runtime.d.ts → props-CrOMYbLv.d.cts} +107 -18
  38. package/dist/{jsx-dev-runtime.d.cts → props-ES0Ag_Wd.d.ts} +107 -18
  39. package/dist/scope-DKYzWfTn.d.cts +55 -0
  40. package/dist/scope-S6eAzBJZ.d.ts +55 -0
  41. package/package.json +11 -1
  42. package/src/advanced.ts +101 -0
  43. package/src/constants.ts +3 -26
  44. package/src/context.ts +300 -0
  45. package/src/delegated-events.ts +24 -0
  46. package/src/index.ts +41 -112
  47. package/src/internal.ts +130 -0
  48. package/src/props.ts +48 -46
  49. package/src/store.ts +47 -7
  50. package/src/versioned-signal.ts +3 -3
  51. package/dist/jsx-runtime.d.cts +0 -671
  52. package/dist/jsx-runtime.d.ts +0 -671
package/dist/index.d.ts CHANGED
@@ -1,503 +1,7 @@
1
- /**
2
- * Signal accessor - function to get/set signal value
3
- */
4
- interface SignalAccessor<T> {
5
- (): T;
6
- (value: T): void;
7
- }
8
- /**
9
- * Computed accessor - function to get computed value
10
- */
11
- type ComputedAccessor<T> = () => T;
12
- /**
13
- * Effect scope disposer - function to dispose an effect scope
14
- */
15
- type EffectScopeDisposer = () => void;
16
- /**
17
- * Create a reactive signal
18
- * @param initialValue - The initial value
19
- * @returns A signal accessor function
20
- */
21
- declare function signal<T>(initialValue: T): SignalAccessor<T>;
22
- /**
23
- * Create a reactive effect scope
24
- * @param fn - The scope function
25
- * @returns An effect scope disposer function
26
- */
27
- declare function effectScope(fn: () => void): EffectScopeDisposer;
28
- declare const $state: <T>(value: T) => T;
29
- /**
30
- * Create a selector signal that efficiently updates only when the selected key matches.
31
- * Useful for large lists where only one item is selected.
32
- *
33
- * @param source - The source signal returning the current key
34
- * @param equalityFn - Optional equality function
35
- * @returns A selector function that takes a key and returns a boolean signal accessor
36
- */
37
- declare function createSelector<T>(source: () => T, equalityFn?: (a: T, b: T) => boolean): (key: T) => boolean;
38
-
39
- type Store<T> = T;
40
- /**
41
- * Create a Store: a reactive proxy that allows fine-grained access and mutation.
42
- *
43
- * @param initialValue - The initial state object
44
- * @returns [store, setStore]
45
- */
46
- declare function createStore<T extends object>(initialValue: T): [Store<T>, (fn: (state: T) => void | T) => void];
47
-
48
- type Memo<T> = () => T;
49
- declare function createMemo<T>(fn: () => T): Memo<T>;
50
- declare const $memo: typeof createMemo;
51
-
52
- /** Any DOM node that can be rendered */
53
- type DOMElement = Node;
54
- /** Cleanup function type */
55
- type Cleanup = () => void;
56
- /** Fict Virtual Node - represents a component or element in the virtual tree */
57
- interface FictVNode {
58
- /** Element type: tag name, Fragment symbol, or component function */
59
- type: string | symbol | ((props: Record<string, unknown>) => FictNode);
60
- /** Props passed to the element/component */
61
- props: Record<string, unknown> | null;
62
- /** Optional key for list rendering optimization */
63
- key?: string | undefined;
64
- }
65
- /**
66
- * Fict Node - represents any renderable value
67
- * This type covers all possible values that can appear in JSX
68
- */
69
- type FictNode = FictVNode | FictNode[] | Node | string | number | boolean | null | undefined;
70
- /** Props that all components receive */
71
- interface BaseProps {
72
- /** Optional key for list rendering */
73
- key?: string | number;
74
- /** Optional children */
75
- children?: FictNode | FictNode[];
76
- }
77
- /** A Fict component function */
78
- type Component<P extends Record<string, unknown> = Record<string, unknown>> = (props: P & BaseProps) => FictNode;
79
- /** Props with children */
80
- type PropsWithChildren<P = unknown> = P & {
81
- children?: FictNode | FictNode[];
82
- };
83
- interface ErrorInfo {
84
- source: 'render' | 'effect' | 'event' | 'renderChild' | 'cleanup';
85
- componentName?: string;
86
- eventName?: string;
87
- }
88
- /** Event handler type for type-safe event handling */
89
- type EventHandler<E extends Event = Event> = (event: E) => void;
90
- /** Ref callback type */
91
- type RefCallback<T extends Element = HTMLElement> = (element: T) => void;
92
- /** Ref object type (for future use with createRef) */
93
- interface RefObject<T extends Element = HTMLElement> {
94
- current: T | null;
95
- }
96
- /** Ref type that can be either callback or object */
97
- type Ref<T extends Element = HTMLElement> = RefCallback<T> | RefObject<T>;
98
- /** CSS style value - can be string or number (number becomes px) */
99
- type StyleValue = string | number;
100
- /** CSS style object */
101
- type CSSStyleObject = {
102
- [K in keyof CSSStyleDeclaration]?: StyleValue;
103
- } & Record<string, StyleValue>;
104
- /** Style prop type - can be string or object */
105
- type StyleProp = string | CSSStyleObject | null | undefined;
106
- /** Class object for conditional classes */
107
- type ClassObject = Record<string, boolean | undefined | null>;
108
- /** Class prop type - can be string or object */
109
- type ClassProp = string | ClassObject | null | undefined;
110
- interface SuspenseToken {
111
- then: Promise<unknown>['then'];
112
- }
113
-
114
- /**
115
- * Effect callback run synchronously; async callbacks are not tracked after the first await.
116
- * TypeScript will reject `async () => {}` here—split async work or read signals before awaiting.
117
- */
118
- type Effect = () => void | Cleanup;
119
- declare function createEffect(fn: Effect): () => void;
120
- declare const $effect: typeof createEffect;
121
- declare function createRenderEffect(fn: Effect): () => void;
122
-
123
- /**
124
- * Fict Reactive DOM Binding System
125
- *
126
- * This module provides the core mechanisms for reactive DOM updates.
127
- * It bridges the gap between Fict's reactive system (signals, effects)
128
- * and the DOM, enabling fine-grained updates without a virtual DOM.
129
- *
130
- * Design Philosophy:
131
- * - Values wrapped in functions `() => T` are treated as reactive
132
- * - Static values are applied once without tracking
133
- * - The compiler transforms JSX expressions to use these primitives
134
- */
135
-
136
- /** A reactive value that can be either static or a getter function */
137
- type MaybeReactive<T> = T | (() => T);
138
- /** Internal type for createElement function reference */
139
- type CreateElementFn = (node: FictNode) => Node;
140
- /** Handle returned by conditional/list bindings for cleanup */
141
- interface BindingHandle {
142
- /** Marker node(s) used for positioning */
143
- marker: Comment | DocumentFragment;
144
- /** Flush pending content - call after markers are inserted into DOM */
145
- flush?: () => void;
146
- /** Dispose function to clean up the binding */
147
- dispose: Cleanup;
148
- }
149
- /** Managed child node with its dispose function */
150
- /**
151
- * Check if a value is reactive (a getter function)
152
- * Note: Event handlers (functions that take arguments) are NOT reactive values
153
- */
154
- declare function isReactive(value: unknown): value is () => unknown;
155
- /**
156
- * Unwrap a potentially reactive value to get the actual value
157
- */
158
- declare function unwrap<T>(value: MaybeReactive<T>): T;
159
- /**
160
- * Invoke an event handler or handler accessor in a safe way.
161
- * Supports handlers that return another handler and handlers that expect an
162
- * optional data payload followed by the event.
163
- */
164
- declare function callEventHandler(handler: EventListenerOrEventListenerObject | null | undefined, event: Event, node?: EventTarget | null, data?: unknown): void;
165
- /**
166
- * Create a text node that reactively updates when the value changes.
167
- *
168
- * @example
169
- * ```ts
170
- * // Static text
171
- * createTextBinding("Hello")
172
- *
173
- * // Reactive text (compiler output)
174
- * createTextBinding(() => $count())
175
- * ```
176
- */
177
- declare function createTextBinding(value: MaybeReactive<unknown>): Text;
178
- /**
179
- * Bind a reactive value to an existing text node.
180
- * This is a convenience function for binding to existing DOM nodes.
181
- */
182
- declare function bindText(textNode: Text, getValue: () => unknown): Cleanup;
183
- /** Attribute setter function type */
184
- type AttributeSetter = (el: Element, key: string, value: unknown) => void;
185
- /**
186
- * Create a reactive attribute binding on an element.
187
- *
188
- * @example
189
- * ```ts
190
- * // Static attribute
191
- * createAttributeBinding(button, 'disabled', false, setAttribute)
192
- *
193
- * // Reactive attribute (compiler output)
194
- * createAttributeBinding(button, 'disabled', () => !$isValid(), setAttribute)
195
- * ```
196
- */
197
- declare function createAttributeBinding(el: Element, key: string, value: MaybeReactive<unknown>, setter: AttributeSetter): void;
198
- /**
199
- * Bind a reactive value to an element's attribute.
200
- */
201
- declare function bindAttribute(el: Element, key: string, getValue: () => unknown): Cleanup;
202
- /**
203
- * Bind a reactive value to an element's property.
204
- */
205
- declare function bindProperty(el: Element, key: string, getValue: () => unknown): Cleanup;
206
- /**
207
- * Apply styles to an element, supporting reactive style objects/strings.
208
- */
209
- declare function createStyleBinding(el: Element, value: MaybeReactive<string | Record<string, string | number> | null | undefined>): void;
210
- /**
211
- * Bind a reactive style value to an existing element.
212
- */
213
- declare function bindStyle(el: Element, getValue: () => string | Record<string, string | number> | null | undefined): Cleanup;
214
- /**
215
- * Apply class to an element, supporting reactive class values.
216
- */
217
- declare function createClassBinding(el: Element, value: MaybeReactive<string | Record<string, boolean> | null | undefined>): void;
218
- /**
219
- * Bind a reactive class value to an existing element.
220
- */
221
- declare function bindClass(el: Element, getValue: () => string | Record<string, boolean> | null | undefined): Cleanup;
222
- /**
223
- * Exported classList function for direct use (compatible with dom-expressions)
224
- */
225
- declare function classList(node: Element, value: Record<string, boolean> | null | undefined, prev?: Record<string, boolean>): Record<string, boolean>;
226
- /**
227
- * Insert reactive content into a parent element.
228
- * This is a simpler API than createChildBinding for basic cases.
229
- *
230
- * @param parent - The parent element to insert into
231
- * @param getValue - Function that returns the value to render
232
- * @param markerOrCreateElement - Optional marker node to insert before, or createElementFn
233
- * @param createElementFn - Optional function to create DOM elements (when marker is provided)
234
- */
235
- declare function insert(parent: ParentNode & Node, getValue: () => FictNode, markerOrCreateElement?: Node | CreateElementFn, createElementFn?: CreateElementFn): Cleanup;
236
- /**
237
- * Create a reactive child binding that updates when the child value changes.
238
- * This is used for dynamic expressions like `{show && <Modal />}` or `{items.map(...)}`.
239
- *
240
- * @example
241
- * ```ts
242
- * // Reactive child (compiler output for {count})
243
- * createChildBinding(parent, () => $count(), createElement)
244
- *
245
- * // Reactive conditional (compiler output for {show && <Modal />})
246
- * createChildBinding(parent, () => $show() && jsx(Modal, {}), createElement)
247
- * ```
248
- */
249
- declare function createChildBinding(parent: ParentNode & Node, getValue: () => FictNode, createElementFn: CreateElementFn): BindingHandle;
250
- declare global {
251
- interface Element {
252
- _$host?: Element;
253
- [key: `$$${string}`]: EventListener | [EventListener, unknown] | undefined;
254
- [key: `$$${string}Data`]: unknown;
255
- }
256
- interface Document extends Record<string, unknown> {
257
- }
258
- }
259
- /**
260
- * Initialize event delegation for a set of event names.
261
- * Events will be handled at the document level and dispatched to the appropriate handlers.
262
- *
263
- * @param eventNames - Array of event names to delegate
264
- * @param doc - The document to attach handlers to (default: window.document)
265
- *
266
- * @example
267
- * ```ts
268
- * // Called automatically by the compiler for delegated events
269
- * delegateEvents(['click', 'input', 'keydown'])
270
- * ```
271
- */
272
- declare function delegateEvents(eventNames: string[], doc?: Document): void;
273
- /**
274
- * Clear all delegated event handlers from a document.
275
- *
276
- * @param doc - The document to clear handlers from (default: window.document)
277
- */
278
- declare function clearDelegatedEvents(doc?: Document): void;
279
- /**
280
- * Add an event listener to an element.
281
- * If the event is in DelegatedEvents, it uses event delegation for better performance.
282
- *
283
- * @param node - The element to add the listener to
284
- * @param name - The event name (lowercase)
285
- * @param handler - The event handler or [handler, data] tuple
286
- * @param delegate - Whether to use delegation (auto-detected based on event name)
287
- */
288
- declare function addEventListener(node: Element, name: string, handler: EventListener | [EventListener, unknown] | null | undefined, delegate?: boolean): void;
289
- /**
290
- * Bind an event listener to an element.
291
- * Uses event delegation for better performance when applicable.
292
- *
293
- * @example
294
- * ```ts
295
- * // Static event
296
- * bindEvent(button, 'click', handleClick)
297
- *
298
- * // Reactive event (compiler output)
299
- * bindEvent(button, 'click', () => $handler())
300
- *
301
- * // With modifiers
302
- * bindEvent(button, 'click', handler, { capture: true, passive: true, once: true })
303
- * ```
304
- */
305
- declare function bindEvent(el: Element, eventName: string, handler: EventListenerOrEventListenerObject | null | undefined, options?: boolean | AddEventListenerOptions): Cleanup;
306
- /**
307
- * Bind a ref to an element.
308
- * Supports both callback refs and ref objects.
309
- *
310
- * @param el - The element to bind the ref to
311
- * @param ref - Either a callback function, a ref object, or a reactive getter
312
- * @returns Cleanup function
313
- *
314
- * @example
315
- * ```ts
316
- * // Callback ref
317
- * bindRef(el, (element) => { store.input = element })
318
- *
319
- * // Ref object
320
- * const inputRef = createRef()
321
- * bindRef(el, inputRef)
322
- *
323
- * // Reactive ref (compiler output)
324
- * bindRef(el, () => props.ref)
325
- * ```
326
- */
327
- declare function bindRef(el: Element, ref: unknown): Cleanup;
328
- /**
329
- * Apply spread props to an element with reactive updates.
330
- * This handles dynamic spread like `<div {...props}>`.
331
- *
332
- * @param node - The element to apply props to
333
- * @param props - The props object (may have reactive getters)
334
- * @param isSVG - Whether this is an SVG element
335
- * @param skipChildren - Whether to skip children handling
336
- * @returns The previous props for tracking changes
337
- *
338
- * @example
339
- * ```ts
340
- * // Compiler output for <div {...props} />
341
- * spread(el, props, false, false)
342
- * ```
343
- */
344
- declare function spread(node: Element, props?: Record<string, unknown>, isSVG?: boolean, skipChildren?: boolean): Record<string, unknown>;
345
- /**
346
- * Assign props to a node, tracking previous values for efficient updates.
347
- * This is the core prop assignment logic used by spread.
348
- *
349
- * @param node - The element to assign props to
350
- * @param props - New props object
351
- * @param isSVG - Whether this is an SVG element
352
- * @param skipChildren - Whether to skip children handling
353
- * @param prevProps - Previous props for comparison
354
- * @param skipRef - Whether to skip ref handling
355
- */
356
- declare function assign(node: Element, props: Record<string, unknown>, isSVG?: boolean, skipChildren?: boolean, prevProps?: Record<string, unknown>, skipRef?: boolean): void;
357
- /**
358
- * Create a conditional rendering binding.
359
- * Efficiently renders one of two branches based on a condition.
360
- *
361
- * This is an optimized version for `{condition ? <A /> : <B />}` patterns
362
- * where both branches are known statically.
363
- *
364
- * @example
365
- * ```ts
366
- * // Compiler output for {show ? <A /> : <B />}
367
- * createConditional(
368
- * () => $show(),
369
- * () => jsx(A, {}),
370
- * () => jsx(B, {}),
371
- * createElement
372
- * )
373
- * ```
374
- */
375
- declare function createConditional(condition: () => boolean, renderTrue: () => FictNode, createElementFn: CreateElementFn, renderFalse?: () => FictNode): BindingHandle;
376
- /**
377
- * Create a show/hide binding that uses CSS display instead of DOM manipulation.
378
- * More efficient than conditional when the content is expensive to create.
379
- *
380
- * @example
381
- * ```ts
382
- * createShow(container, () => $visible())
383
- * ```
384
- */
385
- declare function createShow(el: Element & {
386
- style: CSSStyleDeclaration;
387
- }, condition: () => boolean, displayValue?: string): void;
388
- /**
389
- * Create a portal that renders content into a different DOM container.
390
- *
391
- * @example
392
- * ```ts
393
- * createPortal(
394
- * document.body,
395
- * () => jsx(Modal, { children: 'Hello' }),
396
- * createElement
397
- * )
398
- * ```
399
- */
400
- declare function createPortal(container: ParentNode & Node, render: () => FictNode, createElementFn: CreateElementFn): BindingHandle;
401
-
402
- interface ReactiveScope {
403
- run<T>(fn: () => T): T;
404
- stop(): void;
405
- }
406
- /**
407
- * Create an explicit reactive scope that can contain effects/memos and be stopped manually.
408
- * The scope registers with the current root for cleanup.
409
- */
410
- declare function createScope(): ReactiveScope;
411
- /**
412
- * Run a block of reactive code inside a managed scope that follows a boolean flag.
413
- * When the flag turns false, the scope is disposed and all contained effects/memos are cleaned up.
414
- */
415
- declare function runInScope(flag: MaybeReactive<boolean>, fn: () => void): void;
416
-
417
- interface HookContext {
418
- slots: unknown[];
419
- cursor: number;
420
- rendering?: boolean;
421
- }
422
- declare function __fictUseContext(): HookContext;
423
- declare function __fictPushContext(): HookContext;
424
- declare function __fictPopContext(): void;
425
- declare function __fictResetContext(): void;
426
- declare function __fictUseSignal<T>(ctx: HookContext, initial: T, slot?: number): SignalAccessor<T>;
427
- declare function __fictUseMemo<T>(ctx: HookContext, fn: () => T, slot?: number): ComputedAccessor<T>;
428
- declare function __fictUseEffect(ctx: HookContext, fn: () => void, slot?: number): void;
429
- declare function __fictRender<T>(ctx: HookContext, fn: () => T): T;
430
-
431
- interface VersionedSignalOptions<T> {
432
- equals?: (prev: T, next: T) => boolean;
433
- }
434
- interface VersionedSignal<T> {
435
- /** Reactive read that tracks both the value and version counter */
436
- read: () => T;
437
- /** Write a new value, forcing a version bump when value is equal */
438
- write: (next: T) => void;
439
- /** Force a version bump without changing the value */
440
- force: () => void;
441
- /** Read the current version without creating a dependency */
442
- peekVersion: () => number;
443
- /** Read the current value without tracking */
444
- peekValue: () => T;
445
- }
446
- /**
447
- * Create a signal wrapper that forces subscribers to update when the same reference is written.
448
- *
449
- * Useful for compiler-generated keyed list items where updates may reuse the same object reference.
450
- */
451
- declare function createVersionedSignal<T>(initialValue: T, options?: VersionedSignalOptions<T>): VersionedSignal<T>;
452
-
453
- /**
454
- * @internal
455
- * Marks a zero-arg getter so props proxy can lazily evaluate it.
456
- * Users normally never call this directly; the compiler injects it.
457
- */
458
- declare function __fictProp<T>(getter: () => T): () => T;
459
- declare function createPropsProxy<T extends Record<string, unknown>>(props: T): T;
460
- /**
461
- * Create a rest-like props object while preserving prop getters.
462
- * Excludes the specified keys from the returned object.
463
- */
464
- declare function __fictPropsRest<T extends Record<string, unknown>>(props: T, exclude: (string | number | symbol)[]): Record<string, unknown>;
465
- /**
466
- * Merge multiple props-like objects while preserving lazy getters.
467
- * Later sources override earlier ones.
468
- *
469
- * Uses lazy lookup strategy - properties are only accessed when read,
470
- * avoiding upfront iteration of all keys.
471
- */
472
- type MergeSource<T extends Record<string, unknown>> = T | (() => T);
473
- declare function mergeProps<T extends Record<string, unknown>>(...sources: (MergeSource<T> | null | undefined)[]): Record<string, unknown>;
474
- type PropGetter<T> = (() => T) & {
475
- __fictProp: true;
476
- };
477
- /**
478
- * Memoize a prop getter to cache expensive computations.
479
- * Use when prop expressions involve heavy calculations.
480
- *
481
- * @example
482
- * ```tsx
483
- * // Without useProp - recomputes on every access
484
- * <Child data={expensiveComputation(list, filter)} />
485
- *
486
- * // With useProp - cached until dependencies change, auto-unwrapped by props proxy
487
- * const memoizedData = useProp(() => expensiveComputation(list, filter))
488
- * <Child data={memoizedData} />
489
- * ```
490
- */
491
- declare function useProp<T>(getter: () => T): PropGetter<T>;
492
-
493
- type LifecycleFn = () => void | Cleanup;
494
- declare function onMount(fn: LifecycleFn): void;
495
- declare function onDestroy(fn: LifecycleFn): void;
496
- declare function onCleanup(fn: Cleanup): void;
497
- declare function createRoot<T>(fn: () => T): {
498
- dispose: () => void;
499
- value: T;
500
- };
1
+ export { F as Fragment, J as JSX, M as Memo, e as createElement, c as createMemo, d as createRoot, m as mergeProps, b as onCleanup, a as onDestroy, o as onMount, p as prop, r as render } from './props-ES0Ag_Wd.js';
2
+ import { R as RefObject, B as BaseProps, F as FictNode, S as SuspenseToken } from './effect-Auji1rz9.js';
3
+ export { p as ClassProp, C as Cleanup, l as Component, D as DOMElement, E as Effect, r as ErrorInfo, q as EventHandler, k as FictVNode, P as PropsWithChildren, m as Ref, n as RefCallback, o as StyleProp, h as createEffect, j as createPortal } from './effect-Auji1rz9.js';
4
+ export { C as Context, P as ProviderProps, c as createContext, h as hasContext, u as useContext } from './context-B7UYnfzM.js';
501
5
 
502
6
  /**
503
7
  * Create a ref object for DOM element references.
@@ -596,722 +100,6 @@ declare function useDeferredValue<T>(getValue: () => T): () => T;
596
100
  declare function batch<T>(fn: () => T): T;
597
101
  declare function untrack<T>(fn: () => T): T;
598
102
 
599
- interface CycleProtectionOptions {
600
- maxFlushCyclesPerMicrotask?: number;
601
- maxEffectRunsPerFlush?: number;
602
- windowSize?: number;
603
- highUsageRatio?: number;
604
- maxRootReentrantDepth?: number;
605
- enableWindowWarning?: boolean;
606
- devMode?: boolean;
607
- }
608
- declare let setCycleProtectionOptions: (opts: CycleProtectionOptions) => void;
609
-
610
- declare const Fragment: unique symbol;
611
- declare namespace JSX {
612
- type Element = FictNode;
613
- interface IntrinsicElements {
614
- html: HTMLAttributes<HTMLHtmlElement>;
615
- head: HTMLAttributes<HTMLHeadElement>;
616
- body: HTMLAttributes<HTMLBodyElement>;
617
- title: HTMLAttributes<HTMLTitleElement>;
618
- meta: MetaHTMLAttributes<HTMLMetaElement>;
619
- link: LinkHTMLAttributes<HTMLLinkElement>;
620
- style: StyleHTMLAttributes<HTMLStyleElement>;
621
- script: ScriptHTMLAttributes<HTMLScriptElement>;
622
- noscript: HTMLAttributes<HTMLElement>;
623
- div: HTMLAttributes<HTMLDivElement>;
624
- span: HTMLAttributes<HTMLSpanElement>;
625
- main: HTMLAttributes<HTMLElement>;
626
- header: HTMLAttributes<HTMLElement>;
627
- footer: HTMLAttributes<HTMLElement>;
628
- section: HTMLAttributes<HTMLElement>;
629
- article: HTMLAttributes<HTMLElement>;
630
- aside: HTMLAttributes<HTMLElement>;
631
- nav: HTMLAttributes<HTMLElement>;
632
- address: HTMLAttributes<HTMLElement>;
633
- h1: HTMLAttributes<HTMLHeadingElement>;
634
- h2: HTMLAttributes<HTMLHeadingElement>;
635
- h3: HTMLAttributes<HTMLHeadingElement>;
636
- h4: HTMLAttributes<HTMLHeadingElement>;
637
- h5: HTMLAttributes<HTMLHeadingElement>;
638
- h6: HTMLAttributes<HTMLHeadingElement>;
639
- hgroup: HTMLAttributes<HTMLElement>;
640
- p: HTMLAttributes<HTMLParagraphElement>;
641
- blockquote: BlockquoteHTMLAttributes<HTMLQuoteElement>;
642
- pre: HTMLAttributes<HTMLPreElement>;
643
- figure: HTMLAttributes<HTMLElement>;
644
- figcaption: HTMLAttributes<HTMLElement>;
645
- hr: HTMLAttributes<HTMLHRElement>;
646
- br: HTMLAttributes<HTMLBRElement>;
647
- wbr: HTMLAttributes<HTMLElement>;
648
- a: AnchorHTMLAttributes<HTMLAnchorElement>;
649
- abbr: HTMLAttributes<HTMLElement>;
650
- b: HTMLAttributes<HTMLElement>;
651
- bdi: HTMLAttributes<HTMLElement>;
652
- bdo: HTMLAttributes<HTMLElement>;
653
- cite: HTMLAttributes<HTMLElement>;
654
- code: HTMLAttributes<HTMLElement>;
655
- data: DataHTMLAttributes<HTMLDataElement>;
656
- dfn: HTMLAttributes<HTMLElement>;
657
- em: HTMLAttributes<HTMLElement>;
658
- i: HTMLAttributes<HTMLElement>;
659
- kbd: HTMLAttributes<HTMLElement>;
660
- mark: HTMLAttributes<HTMLElement>;
661
- q: QuoteHTMLAttributes<HTMLQuoteElement>;
662
- rp: HTMLAttributes<HTMLElement>;
663
- rt: HTMLAttributes<HTMLElement>;
664
- ruby: HTMLAttributes<HTMLElement>;
665
- s: HTMLAttributes<HTMLElement>;
666
- samp: HTMLAttributes<HTMLElement>;
667
- small: HTMLAttributes<HTMLElement>;
668
- strong: HTMLAttributes<HTMLElement>;
669
- sub: HTMLAttributes<HTMLElement>;
670
- sup: HTMLAttributes<HTMLElement>;
671
- time: TimeHTMLAttributes<HTMLTimeElement>;
672
- u: HTMLAttributes<HTMLElement>;
673
- var: HTMLAttributes<HTMLElement>;
674
- ul: HTMLAttributes<HTMLUListElement>;
675
- ol: OlHTMLAttributes<HTMLOListElement>;
676
- li: LiHTMLAttributes<HTMLLIElement>;
677
- dl: HTMLAttributes<HTMLDListElement>;
678
- dt: HTMLAttributes<HTMLElement>;
679
- dd: HTMLAttributes<HTMLElement>;
680
- menu: HTMLAttributes<HTMLMenuElement>;
681
- table: TableHTMLAttributes<HTMLTableElement>;
682
- caption: HTMLAttributes<HTMLTableCaptionElement>;
683
- colgroup: ColgroupHTMLAttributes<HTMLTableColElement>;
684
- col: ColHTMLAttributes<HTMLTableColElement>;
685
- thead: HTMLAttributes<HTMLTableSectionElement>;
686
- tbody: HTMLAttributes<HTMLTableSectionElement>;
687
- tfoot: HTMLAttributes<HTMLTableSectionElement>;
688
- tr: HTMLAttributes<HTMLTableRowElement>;
689
- th: ThHTMLAttributes<HTMLTableCellElement>;
690
- td: TdHTMLAttributes<HTMLTableCellElement>;
691
- form: FormHTMLAttributes<HTMLFormElement>;
692
- fieldset: FieldsetHTMLAttributes<HTMLFieldSetElement>;
693
- legend: HTMLAttributes<HTMLLegendElement>;
694
- label: LabelHTMLAttributes<HTMLLabelElement>;
695
- input: InputHTMLAttributes<HTMLInputElement>;
696
- button: ButtonHTMLAttributes<HTMLButtonElement>;
697
- select: SelectHTMLAttributes<HTMLSelectElement>;
698
- datalist: HTMLAttributes<HTMLDataListElement>;
699
- optgroup: OptgroupHTMLAttributes<HTMLOptGroupElement>;
700
- option: OptionHTMLAttributes<HTMLOptionElement>;
701
- textarea: TextareaHTMLAttributes<HTMLTextAreaElement>;
702
- output: OutputHTMLAttributes<HTMLOutputElement>;
703
- progress: ProgressHTMLAttributes<HTMLProgressElement>;
704
- meter: MeterHTMLAttributes<HTMLMeterElement>;
705
- details: DetailsHTMLAttributes<HTMLDetailsElement>;
706
- summary: HTMLAttributes<HTMLElement>;
707
- dialog: DialogHTMLAttributes<HTMLDialogElement>;
708
- img: ImgHTMLAttributes<HTMLImageElement>;
709
- picture: HTMLAttributes<HTMLPictureElement>;
710
- source: SourceHTMLAttributes<HTMLSourceElement>;
711
- audio: AudioVideoHTMLAttributes<HTMLAudioElement>;
712
- video: AudioVideoHTMLAttributes<HTMLVideoElement>;
713
- track: TrackHTMLAttributes<HTMLTrackElement>;
714
- map: MapHTMLAttributes<HTMLMapElement>;
715
- area: AreaHTMLAttributes<HTMLAreaElement>;
716
- iframe: IframeHTMLAttributes<HTMLIFrameElement>;
717
- embed: EmbedHTMLAttributes<HTMLEmbedElement>;
718
- object: ObjectHTMLAttributes<HTMLObjectElement>;
719
- param: ParamHTMLAttributes<HTMLParamElement>;
720
- canvas: CanvasHTMLAttributes<HTMLCanvasElement>;
721
- svg: SVGAttributes<SVGSVGElement>;
722
- path: SVGAttributes<SVGPathElement>;
723
- circle: SVGAttributes<SVGCircleElement>;
724
- rect: SVGAttributes<SVGRectElement>;
725
- line: SVGAttributes<SVGLineElement>;
726
- polyline: SVGAttributes<SVGPolylineElement>;
727
- polygon: SVGAttributes<SVGPolygonElement>;
728
- ellipse: SVGAttributes<SVGEllipseElement>;
729
- g: SVGAttributes<SVGGElement>;
730
- defs: SVGAttributes<SVGDefsElement>;
731
- use: SVGAttributes<SVGUseElement>;
732
- text: SVGAttributes<SVGTextElement>;
733
- tspan: SVGAttributes<SVGTSpanElement>;
734
- template: HTMLAttributes<HTMLTemplateElement>;
735
- slot: SlotHTMLAttributes<HTMLSlotElement>;
736
- portal: HTMLAttributes<HTMLElement>;
737
- }
738
- interface ElementChildrenAttribute {
739
- children: unknown;
740
- }
741
- }
742
- interface HTMLAttributes<T> {
743
- children?: FictNode | FictNode[];
744
- key?: string | number;
745
- id?: string;
746
- class?: string;
747
- style?: string | Record<string, string | number>;
748
- title?: string;
749
- lang?: string;
750
- dir?: 'ltr' | 'rtl' | 'auto';
751
- hidden?: boolean | 'hidden' | 'until-found';
752
- tabIndex?: number;
753
- draggable?: boolean | 'true' | 'false';
754
- contentEditable?: boolean | 'true' | 'false' | 'inherit';
755
- spellCheck?: boolean | 'true' | 'false';
756
- translate?: 'yes' | 'no';
757
- inert?: boolean;
758
- popover?: 'auto' | 'manual';
759
- autofocus?: boolean;
760
- slot?: string;
761
- accessKey?: string;
762
- onClick?: (e: MouseEvent) => void;
763
- onDblClick?: (e: MouseEvent) => void;
764
- onMouseDown?: (e: MouseEvent) => void;
765
- onMouseUp?: (e: MouseEvent) => void;
766
- onMouseMove?: (e: MouseEvent) => void;
767
- onMouseEnter?: (e: MouseEvent) => void;
768
- onMouseLeave?: (e: MouseEvent) => void;
769
- onMouseOver?: (e: MouseEvent) => void;
770
- onMouseOut?: (e: MouseEvent) => void;
771
- onContextMenu?: (e: MouseEvent) => void;
772
- onInput?: (e: InputEvent) => void;
773
- onChange?: (e: Event) => void;
774
- onSubmit?: (e: SubmitEvent) => void;
775
- onReset?: (e: Event) => void;
776
- onKeyDown?: (e: KeyboardEvent) => void;
777
- onKeyUp?: (e: KeyboardEvent) => void;
778
- onKeyPress?: (e: KeyboardEvent) => void;
779
- onFocus?: (e: FocusEvent) => void;
780
- onBlur?: (e: FocusEvent) => void;
781
- onScroll?: (e: Event) => void;
782
- onWheel?: (e: WheelEvent) => void;
783
- onLoad?: (e: Event) => void;
784
- onError?: (e: Event) => void;
785
- onDrag?: (e: DragEvent) => void;
786
- onDragStart?: (e: DragEvent) => void;
787
- onDragEnd?: (e: DragEvent) => void;
788
- onDragEnter?: (e: DragEvent) => void;
789
- onDragLeave?: (e: DragEvent) => void;
790
- onDragOver?: (e: DragEvent) => void;
791
- onDrop?: (e: DragEvent) => void;
792
- onTouchStart?: (e: TouchEvent) => void;
793
- onTouchMove?: (e: TouchEvent) => void;
794
- onTouchEnd?: (e: TouchEvent) => void;
795
- onTouchCancel?: (e: TouchEvent) => void;
796
- onAnimationStart?: (e: AnimationEvent) => void;
797
- onAnimationEnd?: (e: AnimationEvent) => void;
798
- onAnimationIteration?: (e: AnimationEvent) => void;
799
- onTransitionEnd?: (e: TransitionEvent) => void;
800
- onPointerDown?: (e: PointerEvent) => void;
801
- onPointerUp?: (e: PointerEvent) => void;
802
- onPointerMove?: (e: PointerEvent) => void;
803
- onPointerEnter?: (e: PointerEvent) => void;
804
- onPointerLeave?: (e: PointerEvent) => void;
805
- onPointerOver?: (e: PointerEvent) => void;
806
- onPointerOut?: (e: PointerEvent) => void;
807
- onPointerCancel?: (e: PointerEvent) => void;
808
- ref?: ((el: T | null) => void) | {
809
- current: T | null;
810
- };
811
- role?: string;
812
- 'aria-hidden'?: boolean | 'true' | 'false';
813
- 'aria-label'?: string;
814
- 'aria-labelledby'?: string;
815
- 'aria-describedby'?: string;
816
- 'aria-live'?: 'off' | 'polite' | 'assertive';
817
- 'aria-atomic'?: boolean | 'true' | 'false';
818
- 'aria-busy'?: boolean | 'true' | 'false';
819
- 'aria-current'?: boolean | 'true' | 'false' | 'page' | 'step' | 'location' | 'date' | 'time';
820
- 'aria-disabled'?: boolean | 'true' | 'false';
821
- 'aria-expanded'?: boolean | 'true' | 'false';
822
- 'aria-haspopup'?: boolean | 'true' | 'false' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
823
- 'aria-pressed'?: boolean | 'true' | 'false' | 'mixed';
824
- 'aria-selected'?: boolean | 'true' | 'false';
825
- 'aria-checked'?: boolean | 'true' | 'false' | 'mixed';
826
- 'aria-controls'?: string;
827
- 'aria-owns'?: string;
828
- 'aria-activedescendant'?: string;
829
- 'aria-valuemin'?: number;
830
- 'aria-valuemax'?: number;
831
- 'aria-valuenow'?: number;
832
- 'aria-valuetext'?: string;
833
- 'aria-orientation'?: 'horizontal' | 'vertical';
834
- 'aria-readonly'?: boolean | 'true' | 'false';
835
- 'aria-required'?: boolean | 'true' | 'false';
836
- 'aria-invalid'?: boolean | 'true' | 'false' | 'grammar' | 'spelling';
837
- 'aria-errormessage'?: string;
838
- 'aria-modal'?: boolean | 'true' | 'false';
839
- 'aria-placeholder'?: string;
840
- 'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other';
841
- 'aria-colcount'?: number;
842
- 'aria-colindex'?: number;
843
- 'aria-colspan'?: number;
844
- 'aria-rowcount'?: number;
845
- 'aria-rowindex'?: number;
846
- 'aria-rowspan'?: number;
847
- 'aria-setsize'?: number;
848
- 'aria-posinset'?: number;
849
- 'aria-level'?: number;
850
- 'aria-multiselectable'?: boolean | 'true' | 'false';
851
- 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';
852
- 'aria-details'?: string;
853
- 'aria-keyshortcuts'?: string;
854
- 'aria-roledescription'?: string;
855
- [key: `data-${string}`]: string | number | boolean | undefined;
856
- }
857
- interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
858
- href?: string;
859
- target?: '_self' | '_blank' | '_parent' | '_top' | string;
860
- rel?: string;
861
- download?: boolean | string;
862
- hreflang?: string;
863
- type?: string;
864
- referrerPolicy?: ReferrerPolicy;
865
- ping?: string;
866
- }
867
- interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
868
- type?: 'button' | 'submit' | 'reset';
869
- disabled?: boolean;
870
- name?: string;
871
- value?: string;
872
- form?: string;
873
- formAction?: string;
874
- formEncType?: string;
875
- formMethod?: string;
876
- formNoValidate?: boolean;
877
- formTarget?: string;
878
- popovertarget?: string;
879
- popovertargetaction?: 'show' | 'hide' | 'toggle';
880
- }
881
- interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
882
- type?: string;
883
- value?: string | number | readonly string[];
884
- defaultValue?: string | number | readonly string[];
885
- checked?: boolean;
886
- defaultChecked?: boolean;
887
- disabled?: boolean;
888
- placeholder?: string;
889
- name?: string;
890
- form?: string;
891
- required?: boolean;
892
- readonly?: boolean;
893
- multiple?: boolean;
894
- min?: number | string;
895
- max?: number | string;
896
- minLength?: number;
897
- maxLength?: number;
898
- step?: number | string;
899
- pattern?: string;
900
- size?: number;
901
- accept?: string;
902
- capture?: boolean | 'user' | 'environment';
903
- list?: string;
904
- autoComplete?: string;
905
- autoCapitalize?: string;
906
- inputMode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
907
- enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
908
- height?: number | string;
909
- width?: number | string;
910
- alt?: string;
911
- src?: string;
912
- formAction?: string;
913
- formEncType?: string;
914
- formMethod?: string;
915
- formNoValidate?: boolean;
916
- formTarget?: string;
917
- }
918
- interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
919
- action?: string;
920
- method?: 'get' | 'post' | 'dialog';
921
- encType?: string;
922
- target?: string;
923
- name?: string;
924
- noValidate?: boolean;
925
- autoComplete?: 'on' | 'off';
926
- acceptCharset?: string;
927
- }
928
- interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
929
- src?: string;
930
- alt?: string;
931
- width?: number | string;
932
- height?: number | string;
933
- srcSet?: string;
934
- sizes?: string;
935
- loading?: 'eager' | 'lazy';
936
- decoding?: 'async' | 'auto' | 'sync';
937
- crossOrigin?: 'anonymous' | 'use-credentials';
938
- referrerPolicy?: ReferrerPolicy;
939
- useMap?: string;
940
- isMap?: boolean;
941
- fetchPriority?: 'auto' | 'high' | 'low';
942
- }
943
- interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
944
- value?: string | number;
945
- defaultValue?: string;
946
- disabled?: boolean;
947
- placeholder?: string;
948
- name?: string;
949
- form?: string;
950
- required?: boolean;
951
- readonly?: boolean;
952
- rows?: number;
953
- cols?: number;
954
- minLength?: number;
955
- maxLength?: number;
956
- wrap?: 'hard' | 'soft' | 'off';
957
- autoComplete?: string;
958
- }
959
- interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
960
- value?: string | number | readonly string[];
961
- defaultValue?: string | number | readonly string[];
962
- disabled?: boolean;
963
- name?: string;
964
- form?: string;
965
- required?: boolean;
966
- multiple?: boolean;
967
- size?: number;
968
- autoComplete?: string;
969
- }
970
- interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
971
- value?: string | number;
972
- disabled?: boolean;
973
- selected?: boolean;
974
- label?: string;
975
- }
976
- interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
977
- disabled?: boolean;
978
- label?: string;
979
- }
980
- interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
981
- for?: string;
982
- htmlFor?: string;
983
- form?: string;
984
- }
985
- interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
986
- disabled?: boolean;
987
- name?: string;
988
- form?: string;
989
- }
990
- interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
991
- for?: string;
992
- htmlFor?: string;
993
- form?: string;
994
- name?: string;
995
- }
996
- interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
997
- value?: number | string;
998
- max?: number | string;
999
- }
1000
- interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
1001
- value?: number | string;
1002
- min?: number | string;
1003
- max?: number | string;
1004
- low?: number | string;
1005
- high?: number | string;
1006
- optimum?: number | string;
1007
- }
1008
- interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
1009
- cellPadding?: number | string;
1010
- cellSpacing?: number | string;
1011
- border?: number | string;
1012
- }
1013
- interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
1014
- colSpan?: number;
1015
- rowSpan?: number;
1016
- scope?: 'row' | 'col' | 'rowgroup' | 'colgroup';
1017
- abbr?: string;
1018
- headers?: string;
1019
- }
1020
- interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
1021
- colSpan?: number;
1022
- rowSpan?: number;
1023
- headers?: string;
1024
- }
1025
- interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
1026
- span?: number;
1027
- }
1028
- interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
1029
- span?: number;
1030
- }
1031
- interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
1032
- start?: number;
1033
- reversed?: boolean;
1034
- type?: '1' | 'a' | 'A' | 'i' | 'I';
1035
- }
1036
- interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
1037
- value?: number;
1038
- }
1039
- interface AudioVideoHTMLAttributes<T> extends HTMLAttributes<T> {
1040
- src?: string;
1041
- controls?: boolean;
1042
- autoPlay?: boolean;
1043
- loop?: boolean;
1044
- muted?: boolean;
1045
- preload?: 'none' | 'metadata' | 'auto';
1046
- crossOrigin?: 'anonymous' | 'use-credentials';
1047
- poster?: string;
1048
- width?: number | string;
1049
- height?: number | string;
1050
- playsInline?: boolean;
1051
- disableRemotePlayback?: boolean;
1052
- onPlay?: (e: Event) => void;
1053
- onPause?: (e: Event) => void;
1054
- onEnded?: (e: Event) => void;
1055
- onTimeUpdate?: (e: Event) => void;
1056
- onVolumeChange?: (e: Event) => void;
1057
- onSeeking?: (e: Event) => void;
1058
- onSeeked?: (e: Event) => void;
1059
- onLoadedData?: (e: Event) => void;
1060
- onLoadedMetadata?: (e: Event) => void;
1061
- onCanPlay?: (e: Event) => void;
1062
- onCanPlayThrough?: (e: Event) => void;
1063
- onWaiting?: (e: Event) => void;
1064
- onPlaying?: (e: Event) => void;
1065
- onProgress?: (e: Event) => void;
1066
- onDurationChange?: (e: Event) => void;
1067
- onRateChange?: (e: Event) => void;
1068
- onStalled?: (e: Event) => void;
1069
- onSuspend?: (e: Event) => void;
1070
- onEmptied?: (e: Event) => void;
1071
- }
1072
- interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
1073
- src?: string;
1074
- srcSet?: string;
1075
- sizes?: string;
1076
- type?: string;
1077
- media?: string;
1078
- width?: number | string;
1079
- height?: number | string;
1080
- }
1081
- interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
1082
- src?: string;
1083
- srcLang?: string;
1084
- label?: string;
1085
- kind?: 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata';
1086
- default?: boolean;
1087
- }
1088
- interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
1089
- src?: string;
1090
- srcDoc?: string;
1091
- name?: string;
1092
- width?: number | string;
1093
- height?: number | string;
1094
- allow?: string;
1095
- allowFullScreen?: boolean;
1096
- sandbox?: string;
1097
- loading?: 'eager' | 'lazy';
1098
- referrerPolicy?: ReferrerPolicy;
1099
- }
1100
- interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
1101
- src?: string;
1102
- type?: string;
1103
- width?: number | string;
1104
- height?: number | string;
1105
- }
1106
- interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
1107
- data?: string;
1108
- type?: string;
1109
- name?: string;
1110
- width?: number | string;
1111
- height?: number | string;
1112
- form?: string;
1113
- useMap?: string;
1114
- }
1115
- interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
1116
- name?: string;
1117
- value?: string;
1118
- }
1119
- interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
1120
- width?: number | string;
1121
- height?: number | string;
1122
- }
1123
- interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
1124
- name?: string;
1125
- }
1126
- interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
1127
- alt?: string;
1128
- coords?: string;
1129
- href?: string;
1130
- hreflang?: string;
1131
- download?: boolean | string;
1132
- rel?: string;
1133
- shape?: 'rect' | 'circle' | 'poly' | 'default';
1134
- target?: string;
1135
- referrerPolicy?: ReferrerPolicy;
1136
- ping?: string;
1137
- }
1138
- interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
1139
- open?: boolean;
1140
- onToggle?: (e: Event) => void;
1141
- }
1142
- interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
1143
- open?: boolean;
1144
- onClose?: (e: Event) => void;
1145
- onCancel?: (e: Event) => void;
1146
- }
1147
- interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
1148
- cite?: string;
1149
- }
1150
- interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
1151
- cite?: string;
1152
- }
1153
- interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
1154
- dateTime?: string;
1155
- }
1156
- interface DataHTMLAttributes<T> extends HTMLAttributes<T> {
1157
- value?: string;
1158
- }
1159
- interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
1160
- name?: string;
1161
- content?: string;
1162
- httpEquiv?: string;
1163
- charSet?: string;
1164
- property?: string;
1165
- }
1166
- interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
1167
- href?: string;
1168
- rel?: string;
1169
- type?: string;
1170
- media?: string;
1171
- as?: string;
1172
- crossOrigin?: 'anonymous' | 'use-credentials';
1173
- referrerPolicy?: ReferrerPolicy;
1174
- sizes?: string;
1175
- hreflang?: string;
1176
- integrity?: string;
1177
- fetchPriority?: 'auto' | 'high' | 'low';
1178
- disabled?: boolean;
1179
- }
1180
- interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
1181
- media?: string;
1182
- nonce?: string;
1183
- blocking?: string;
1184
- }
1185
- interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
1186
- src?: string;
1187
- type?: string;
1188
- async?: boolean;
1189
- defer?: boolean;
1190
- crossOrigin?: 'anonymous' | 'use-credentials';
1191
- integrity?: string;
1192
- noModule?: boolean;
1193
- nonce?: string;
1194
- referrerPolicy?: ReferrerPolicy;
1195
- fetchPriority?: 'auto' | 'high' | 'low';
1196
- blocking?: string;
1197
- }
1198
- interface SlotHTMLAttributes<T> extends HTMLAttributes<T> {
1199
- name?: string;
1200
- onSlotchange?: (e: Event) => void;
1201
- }
1202
- interface SVGAttributes<T> extends HTMLAttributes<T> {
1203
- viewBox?: string;
1204
- xmlns?: string;
1205
- xmlnsXlink?: string;
1206
- fill?: string;
1207
- stroke?: string;
1208
- strokeWidth?: string | number;
1209
- strokeLinecap?: 'butt' | 'round' | 'square';
1210
- strokeLinejoin?: 'miter' | 'round' | 'bevel';
1211
- strokeDasharray?: string;
1212
- strokeDashoffset?: string | number;
1213
- strokeOpacity?: string | number;
1214
- fillOpacity?: string | number;
1215
- opacity?: string | number;
1216
- transform?: string;
1217
- transformOrigin?: string;
1218
- clipPath?: string;
1219
- mask?: string;
1220
- filter?: string;
1221
- d?: string;
1222
- cx?: string | number;
1223
- cy?: string | number;
1224
- r?: string | number;
1225
- rx?: string | number;
1226
- ry?: string | number;
1227
- x?: string | number;
1228
- y?: string | number;
1229
- x1?: string | number;
1230
- y1?: string | number;
1231
- x2?: string | number;
1232
- y2?: string | number;
1233
- width?: string | number;
1234
- height?: string | number;
1235
- points?: string;
1236
- pathLength?: string | number;
1237
- textAnchor?: 'start' | 'middle' | 'end';
1238
- dominantBaseline?: string;
1239
- dx?: string | number;
1240
- dy?: string | number;
1241
- fontSize?: string | number;
1242
- fontFamily?: string;
1243
- fontWeight?: string | number;
1244
- href?: string;
1245
- xlinkHref?: string;
1246
- gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
1247
- gradientTransform?: string;
1248
- spreadMethod?: 'pad' | 'reflect' | 'repeat';
1249
- offset?: string | number;
1250
- stopColor?: string;
1251
- stopOpacity?: string | number;
1252
- clipPathUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
1253
- maskUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
1254
- maskContentUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
1255
- preserveAspectRatio?: string;
1256
- markerStart?: string;
1257
- markerMid?: string;
1258
- markerEnd?: string;
1259
- vectorEffect?: string;
1260
- }
1261
-
1262
- /**
1263
- * Fict DOM Rendering System
1264
- *
1265
- * This module provides DOM rendering capabilities with reactive bindings.
1266
- * It transforms JSX virtual nodes into actual DOM elements, automatically
1267
- * setting up reactive updates for dynamic values.
1268
- *
1269
- * Key Features:
1270
- * - Reactive text content: `{count}` updates when count changes
1271
- * - Reactive attributes: `disabled={!isValid}` updates reactively
1272
- * - Reactive children: `{show && <Modal />}` handles conditionals
1273
- * - List rendering: `{items.map(...)}` with efficient keyed updates
1274
- */
1275
-
1276
- /**
1277
- * Render a Fict view into a container element.
1278
- *
1279
- * @param view - A function that returns the view to render
1280
- * @param container - The DOM container to render into
1281
- * @returns A teardown function to unmount the view
1282
- *
1283
- * @example
1284
- * ```ts
1285
- * const unmount = render(() => <App />, document.getElementById('root')!)
1286
- * // Later: unmount()
1287
- * ```
1288
- */
1289
- declare function render(view: () => FictNode, container: HTMLElement): () => void;
1290
- /**
1291
- * Create a DOM element from a Fict node.
1292
- * This is the main entry point for converting virtual nodes to real DOM.
1293
- *
1294
- * Supports:
1295
- * - Native DOM nodes (passed through)
1296
- * - Null/undefined/false (empty text node)
1297
- * - Arrays (DocumentFragment)
1298
- * - Strings/numbers (text nodes)
1299
- * - Booleans (empty text node)
1300
- * - VNodes (components or HTML elements)
1301
- * - Reactive values (functions returning any of the above)
1302
- */
1303
- declare function createElement(node: FictNode): DOMElement;
1304
- /**
1305
- * Create a template cloning factory from an HTML string.
1306
- * Used by the compiler for efficient DOM generation.
1307
- *
1308
- * @param html - The HTML string to create a template from
1309
- * @param isImportNode - Use importNode for elements like img/iframe
1310
- * @param isSVG - Whether the template is SVG content
1311
- * @param isMathML - Whether the template is MathML content
1312
- */
1313
- declare function template(html: string, isImportNode?: boolean, isSVG?: boolean, isMathML?: boolean): () => Node;
1314
-
1315
103
  interface ErrorBoundaryProps extends BaseProps {
1316
104
  fallback: FictNode | ((err: unknown) => FictNode);
1317
105
  onError?: (err: unknown) => void;
@@ -1333,145 +121,4 @@ interface SuspenseHandle {
1333
121
  declare function createSuspenseToken(): SuspenseHandle;
1334
122
  declare function Suspense(props: SuspenseProps): FictNode;
1335
123
 
1336
- /**
1337
- * Fict DOM Constants
1338
- *
1339
- * Property constants and configurations for DOM attribute handling.
1340
- * Borrowed from dom-expressions for comprehensive DOM support.
1341
- */
1342
- declare const BooleanAttributes: Set<string>;
1343
- declare const Properties: Set<string>;
1344
- /**
1345
- * Properties that represent children/content
1346
- */
1347
- declare const ChildProperties: Set<string>;
1348
- /**
1349
- * React compatibility aliases (className -> class)
1350
- */
1351
- declare const Aliases: Record<string, string>;
1352
- /**
1353
- * Get the property alias for a given attribute and tag name
1354
- */
1355
- declare function getPropAlias(prop: string, tagName: string): string | undefined;
1356
- declare const DelegatedEvents: Set<string>;
1357
- declare const SVGElements: Set<string>;
1358
- /**
1359
- * SVG attribute namespaces
1360
- */
1361
- declare const SVGNamespace: Record<string, string>;
1362
- declare const UnitlessStyles: Set<string>;
1363
-
1364
- /**
1365
- * Fict DOM Reconciliation
1366
- *
1367
- * Efficient array reconciliation algorithm based on udomdiff.
1368
- * https://github.com/WebReflection/udomdiff
1369
- *
1370
- * This algorithm uses a 5-step strategy:
1371
- * 1. Common prefix - skip matching nodes at start
1372
- * 2. Common suffix - skip matching nodes at end
1373
- * 3. Append - insert remaining new nodes
1374
- * 4. Remove - remove remaining old nodes
1375
- * 5. Swap/Map fallback - handle complex rearrangements
1376
- *
1377
- * Most real-world updates (95%+) use fast paths without building a Map.
1378
- */
1379
- /**
1380
- * Reconcile two arrays of DOM nodes, efficiently updating the DOM.
1381
- *
1382
- * @param parentNode - The parent element containing the nodes
1383
- * @param a - The old array of nodes (currently in DOM)
1384
- * @param b - The new array of nodes (target state)
1385
- *
1386
- * **Note:** This function may mutate the input array `a` during the swap
1387
- * optimization (step 5a). If you need to preserve the original array,
1388
- * pass a shallow copy: `reconcileArrays(parent, [...oldNodes], newNodes)`.
1389
- *
1390
- * @example
1391
- * ```ts
1392
- * const oldNodes = [node1, node2, node3]
1393
- * const newNodes = [node1, node4, node3] // node2 replaced with node4
1394
- * reconcileArrays(parent, oldNodes, newNodes)
1395
- * ```
1396
- */
1397
- declare function reconcileArrays(parentNode: ParentNode, a: Node[], b: Node[]): void;
1398
-
1399
- interface FictDevtoolsHook {
1400
- registerSignal: (id: number, value: unknown) => void;
1401
- updateSignal: (id: number, value: unknown) => void;
1402
- registerEffect: (id: number) => void;
1403
- effectRun: (id: number) => void;
1404
- cycleDetected?: (payload: {
1405
- reason: string;
1406
- detail?: Record<string, unknown>;
1407
- }) => void;
1408
- }
1409
- declare function getDevtoolsHook(): FictDevtoolsHook | undefined;
1410
-
1411
- /**
1412
- * Low-level DOM node helpers shared across runtime modules.
1413
- * Keep this file dependency-free to avoid module cycles.
1414
- */
1415
- /**
1416
- * Convert a value to a flat array of DOM nodes.
1417
- * Defensively handles proxies and non-DOM values.
1418
- */
1419
- declare function toNodeArray(node: Node | Node[] | unknown): Node[];
1420
- /**
1421
- * Insert nodes before an anchor node, preserving order.
1422
- * Uses DocumentFragment for batch insertion when inserting multiple nodes.
1423
- */
1424
- declare function insertNodesBefore(parent: ParentNode & Node, nodes: Node[], anchor: Node | null): void;
1425
- /**
1426
- * Remove an array of nodes from the DOM.
1427
- */
1428
- declare function removeNodes(nodes: Node[]): void;
1429
-
1430
- /**
1431
- * List Helpers for Compiler-Generated Fine-Grained Updates
1432
- *
1433
- * These helpers are used by the compiler to generate efficient keyed list rendering.
1434
- * They provide low-level primitives for DOM node manipulation without rebuilding.
1435
- */
1436
-
1437
- /**
1438
- * Binding handle returned by createKeyedList for compiler-generated code
1439
- */
1440
- interface KeyedListBinding {
1441
- /** Document fragment placeholder inserted by the compiler/runtime */
1442
- marker: DocumentFragment;
1443
- /** Start marker comment node */
1444
- startMarker: Comment;
1445
- /** End marker comment node */
1446
- endMarker: Comment;
1447
- /** Flush pending items - call after markers are inserted into DOM */
1448
- flush?: () => void;
1449
- /** Cleanup function */
1450
- dispose: () => void;
1451
- }
1452
- type FineGrainedRenderItem<T> = (itemSig: SignalAccessor<T>, indexSig: SignalAccessor<number>, key: string | number) => Node[];
1453
- /**
1454
- * Move nodes to a position before the anchor node.
1455
- * This is optimized to avoid unnecessary DOM operations.
1456
- *
1457
- * @param parent - Parent node to move nodes within
1458
- * @param nodes - Array of nodes to move
1459
- * @param anchor - Node to insert before (or null for end)
1460
- */
1461
- declare function moveNodesBefore(parent: Node, nodes: Node[], anchor: Node | null): void;
1462
- /**
1463
- * Check if a node is between two markers
1464
- */
1465
- declare function isNodeBetweenMarkers(node: Node, startMarker: Comment, endMarker: Comment): boolean;
1466
- /**
1467
- * Create a keyed list binding with automatic diffing and DOM updates.
1468
- * This is used by compiler-generated code for efficient list rendering.
1469
- *
1470
- * @param getItems - Function that returns the current array of items
1471
- * @param keyFn - Function to extract unique key from each item
1472
- * @param renderItem - Function that creates DOM nodes for each item
1473
- * @returns Binding handle with markers and dispose function
1474
- */
1475
- declare function createKeyedList<T>(getItems: () => T[], keyFn: (item: T, index: number) => string | number, renderItem: FineGrainedRenderItem<T>, needsIndex?: boolean): KeyedListBinding;
1476
-
1477
- export { $effect, $memo, $state, Aliases, type AttributeSetter, type BaseProps, type BindingHandle, BooleanAttributes, ChildProperties, type ClassProp, type Cleanup, type Component, type CreateElementFn, type DOMElement, DelegatedEvents, type Effect, ErrorBoundary, type ErrorInfo, type EventHandler, type FictDevtoolsHook, type FictNode, type FictVNode, Fragment, JSX, type KeyedListBinding, type MaybeReactive, type Memo, Properties, type PropsWithChildren, type ReactiveScope, type Ref, type RefCallback, type RefObject, SVGElements, SVGNamespace, type SignalAccessor as Signal, type Store, type StyleProp, Suspense, type SuspenseToken, UnitlessStyles, type VersionedSignal, type VersionedSignalOptions, __fictPopContext, __fictProp, __fictPropsRest, __fictPushContext, __fictRender, __fictResetContext, __fictUseContext, __fictUseEffect, __fictUseMemo, __fictUseSignal, addEventListener, assign, batch, bindAttribute, bindClass, bindEvent, bindProperty, bindRef, bindStyle, bindText, callEventHandler, classList, clearDelegatedEvents, createAttributeBinding, createChildBinding, createClassBinding, createConditional, createEffect, createElement, createKeyedList, createMemo, createPortal, createPropsProxy, createRef, createRenderEffect, createRoot, createScope, createSelector, createShow, signal as createSignal, createStore, createStyleBinding, createSuspenseToken, createTextBinding, createVersionedSignal, delegateEvents, effectScope, getDevtoolsHook, getPropAlias, insert, insertNodesBefore, isNodeBetweenMarkers, isReactive, mergeProps, moveNodesBefore, onCleanup, onDestroy, onMount, __fictProp as prop, reconcileArrays, removeNodes, render, runInScope, setCycleProtectionOptions, spread, startTransition, template, toNodeArray, untrack, unwrap, useDeferredValue, useProp, useTransition };
124
+ export { BaseProps, ErrorBoundary, FictNode, RefObject, Suspense, SuspenseToken, batch, createRef, createSuspenseToken, startTransition, untrack, useDeferredValue, useTransition };