@typed/ui 1.0.0-beta.3 → 1.0.0-beta.5
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.
- package/README.md +53 -9
- package/dist/Alert.d.ts +78 -0
- package/dist/Alert.d.ts.map +1 -0
- package/dist/Alert.js +37 -0
- package/dist/Button.d.ts +144 -0
- package/dist/Button.d.ts.map +1 -0
- package/dist/Button.js +38 -0
- package/dist/Carousel.d.ts +547 -0
- package/dist/Carousel.d.ts.map +1 -0
- package/dist/Carousel.js +387 -0
- package/dist/Checkbox.d.ts +203 -0
- package/dist/Checkbox.d.ts.map +1 -0
- package/dist/Checkbox.js +140 -0
- package/dist/Collection.d.ts +254 -0
- package/dist/Collection.d.ts.map +1 -0
- package/dist/Collection.js +218 -0
- package/dist/Combobox.d.ts +516 -0
- package/dist/Combobox.d.ts.map +1 -0
- package/dist/Combobox.js +371 -0
- package/dist/Component.d.ts +127 -0
- package/dist/Component.d.ts.map +1 -0
- package/dist/Component.js +60 -0
- package/dist/Composite.d.ts +823 -0
- package/dist/Composite.d.ts.map +1 -0
- package/dist/Composite.js +615 -0
- package/dist/Dialog.d.ts +544 -0
- package/dist/Dialog.d.ts.map +1 -0
- package/dist/Dialog.js +355 -0
- package/dist/Disclosure.d.ts +219 -0
- package/dist/Disclosure.d.ts.map +1 -0
- package/dist/Disclosure.js +128 -0
- package/dist/Dom/Events.d.ts +122 -0
- package/dist/Dom/Events.d.ts.map +1 -0
- package/dist/Dom/Events.js +192 -0
- package/dist/Dom/Props.d.ts +161 -0
- package/dist/Dom/Props.d.ts.map +1 -0
- package/dist/Dom/Props.js +110 -0
- package/dist/Dom/Refs.d.ts +58 -0
- package/dist/Dom/Refs.d.ts.map +1 -0
- package/dist/Dom/Refs.js +61 -0
- package/dist/Dom/Render.d.ts +59 -0
- package/dist/Dom/Render.d.ts.map +1 -0
- package/dist/Dom/Render.js +71 -0
- package/dist/Dom/Types.d.ts +570 -0
- package/dist/Dom/Types.d.ts.map +1 -0
- package/dist/Dom/Types.js +1 -0
- package/dist/Dom/index.d.ts +20 -0
- package/dist/Dom/index.d.ts.map +1 -0
- package/dist/Dom/index.js +8 -0
- package/dist/Dom.d.ts +14 -0
- package/dist/Dom.d.ts.map +1 -0
- package/dist/Dom.js +13 -0
- package/dist/Focusable.d.ts +85 -0
- package/dist/Focusable.d.ts.map +1 -0
- package/dist/Focusable.js +35 -0
- package/dist/Form.d.ts +1695 -0
- package/dist/Form.d.ts.map +1 -0
- package/dist/Form.js +987 -0
- package/dist/Grid.d.ts +569 -0
- package/dist/Grid.d.ts.map +1 -0
- package/dist/Grid.js +379 -0
- package/dist/Group.d.ts +147 -0
- package/dist/Group.d.ts.map +1 -0
- package/dist/Group.js +63 -0
- package/dist/Heading.d.ts +86 -0
- package/dist/Heading.d.ts.map +1 -0
- package/dist/Heading.js +48 -0
- package/dist/Hovercard.d.ts +297 -0
- package/dist/Hovercard.d.ts.map +1 -0
- package/dist/Hovercard.js +188 -0
- package/dist/HttpRouter.d.ts +129 -6
- package/dist/HttpRouter.d.ts.map +1 -1
- package/dist/HttpRouter.js +197 -54
- package/dist/Link.d.ts +67 -28
- package/dist/Link.d.ts.map +1 -1
- package/dist/Link.js +91 -37
- package/dist/Listbox.d.ts +437 -0
- package/dist/Listbox.d.ts.map +1 -0
- package/dist/Listbox.js +316 -0
- package/dist/Menu.d.ts +972 -0
- package/dist/Menu.d.ts.map +1 -0
- package/dist/Menu.js +731 -0
- package/dist/Menubar.d.ts +367 -0
- package/dist/Menubar.d.ts.map +1 -0
- package/dist/Menubar.js +265 -0
- package/dist/Meter.d.ts +217 -0
- package/dist/Meter.d.ts.map +1 -0
- package/dist/Meter.js +94 -0
- package/dist/NativeDetails.d.ts +41 -0
- package/dist/NativeDetails.d.ts.map +1 -0
- package/dist/NativeDetails.js +40 -0
- package/dist/NativeDialog.d.ts +64 -0
- package/dist/NativeDialog.d.ts.map +1 -0
- package/dist/NativeDialog.js +50 -0
- package/dist/NativePopover.d.ts +41 -0
- package/dist/NativePopover.d.ts.map +1 -0
- package/dist/NativePopover.js +46 -0
- package/dist/Popover.d.ts +241 -0
- package/dist/Popover.d.ts.map +1 -0
- package/dist/Popover.js +141 -0
- package/dist/RadioGroup.d.ts +432 -0
- package/dist/RadioGroup.d.ts.map +1 -0
- package/dist/RadioGroup.js +291 -0
- package/dist/Role.d.ts +64 -0
- package/dist/Role.d.ts.map +1 -0
- package/dist/Role.js +27 -0
- package/dist/Select.d.ts +529 -0
- package/dist/Select.d.ts.map +1 -0
- package/dist/Select.js +407 -0
- package/dist/Separator.d.ts +54 -0
- package/dist/Separator.d.ts.map +1 -0
- package/dist/Separator.js +26 -0
- package/dist/Slider.d.ts +188 -0
- package/dist/Slider.d.ts.map +1 -0
- package/dist/Slider.js +96 -0
- package/dist/SpinButton.d.ts +188 -0
- package/dist/SpinButton.d.ts.map +1 -0
- package/dist/SpinButton.js +96 -0
- package/dist/Storybook.d.ts +76 -0
- package/dist/Storybook.d.ts.map +1 -0
- package/dist/Storybook.js +102 -0
- package/dist/Switch.d.ts +187 -0
- package/dist/Switch.d.ts.map +1 -0
- package/dist/Switch.js +116 -0
- package/dist/Tab.d.ts +26 -0
- package/dist/Tab.d.ts.map +1 -0
- package/dist/Tab.js +25 -0
- package/dist/Tabs.d.ts +591 -0
- package/dist/Tabs.d.ts.map +1 -0
- package/dist/Tabs.js +346 -0
- package/dist/Toolbar.d.ts +366 -0
- package/dist/Toolbar.d.ts.map +1 -0
- package/dist/Toolbar.js +245 -0
- package/dist/Tooltip.d.ts +296 -0
- package/dist/Tooltip.d.ts.map +1 -0
- package/dist/Tooltip.js +172 -0
- package/dist/Tree.d.ts +591 -0
- package/dist/Tree.d.ts.map +1 -0
- package/dist/Tree.js +434 -0
- package/dist/TreeGrid.d.ts +645 -0
- package/dist/TreeGrid.d.ts.map +1 -0
- package/dist/TreeGrid.js +420 -0
- package/dist/VisuallyHidden.d.ts +54 -0
- package/dist/VisuallyHidden.d.ts.map +1 -0
- package/dist/VisuallyHidden.js +27 -0
- package/dist/WindowSplitter.d.ts +376 -0
- package/dist/WindowSplitter.d.ts.map +1 -0
- package/dist/WindowSplitter.js +222 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -0
- package/package.json +42 -15
- package/src/HttpRouter.test.ts +0 -294
- package/src/HttpRouter.ts +0 -168
- package/src/Link.test.ts +0 -84
- package/src/Link.ts +0 -107
- package/src/index.ts +0 -2
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
import type * as Effect from "effect/Effect";
|
|
2
|
+
import type * as Scope from "effect/Scope";
|
|
3
|
+
import type * as Stream from "effect/Stream";
|
|
4
|
+
import type { RefSubject } from "@typed/fx";
|
|
5
|
+
import type { Fx } from "@typed/fx/Fx";
|
|
6
|
+
import type { EventHandler, Renderable, RenderEvent, RenderTemplate } from "@typed/template";
|
|
7
|
+
/**
|
|
8
|
+
* Any value accepted by Typed's renderable conversion protocol.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* ## Why
|
|
12
|
+
* Host components accept static values, Effects, Fx streams, templates, and
|
|
13
|
+
* other renderables through one type without imposing a virtual DOM.
|
|
14
|
+
*
|
|
15
|
+
* ## Ownership and lifetime
|
|
16
|
+
* The eventual renderer Scope owns reactive inputs and their cleanup; this
|
|
17
|
+
* alias itself acquires nothing.
|
|
18
|
+
*
|
|
19
|
+
* @since 1.0.0
|
|
20
|
+
* @category models
|
|
21
|
+
*/
|
|
22
|
+
export type RenderableInput<A = any> = Renderable.Any<A>;
|
|
23
|
+
/**
|
|
24
|
+
* An Effect accepted at a DOM host boundary while preserving error and service inference.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* ## Why
|
|
28
|
+
* The union prevents `never` channels from being widened when heterogeneous
|
|
29
|
+
* host inputs are inferred.
|
|
30
|
+
*
|
|
31
|
+
* ## Ownership and lifetime
|
|
32
|
+
* The Effect stays lazy and is owned by the Scope that renders the host.
|
|
33
|
+
*
|
|
34
|
+
* @since 1.0.0
|
|
35
|
+
* @category models
|
|
36
|
+
*/
|
|
37
|
+
export type EffectInput<A = any> = Effect.Effect<A, any, any> | Effect.Effect<A, never, never> | Effect.Effect<never, any, any> | Effect.Effect<never, never, any>;
|
|
38
|
+
/**
|
|
39
|
+
* An Fx accepted at a DOM host boundary while preserving error and service inference.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* ## Why
|
|
43
|
+
* The explicit union retains precise `never` channels during conditional and
|
|
44
|
+
* mapped-type inference used by custom hosts.
|
|
45
|
+
*
|
|
46
|
+
* ## Ownership and lifetime
|
|
47
|
+
* Supplying an Fx starts no work. Its rendering Scope owns subscription and interruption.
|
|
48
|
+
*
|
|
49
|
+
* @since 1.0.0
|
|
50
|
+
* @category models
|
|
51
|
+
*/
|
|
52
|
+
export type FxInput<A = any> = Fx<A, any, any> | Fx<A, never, never> | Fx<never, any, any> | Fx<never, never, any>;
|
|
53
|
+
/**
|
|
54
|
+
* Output that a host override may return.
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* ## Why
|
|
58
|
+
* Both one-shot Effects and push-based Fx streams can represent render output,
|
|
59
|
+
* so external hosts need not adopt a framework-specific mounting protocol.
|
|
60
|
+
*
|
|
61
|
+
* ## Ownership and lifetime
|
|
62
|
+
* `renderHost` lifts an Effect into Fx; the component Scope owns either form.
|
|
63
|
+
*
|
|
64
|
+
* @since 1.0.0
|
|
65
|
+
* @category models
|
|
66
|
+
*/
|
|
67
|
+
export type HostResult = FxInput<RenderEvent> | EffectInput<RenderEvent>;
|
|
68
|
+
/**
|
|
69
|
+
* A property name recognized as a native DOM event handler.
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* ## Why
|
|
73
|
+
* Typed supports element properties such as `onclick` and template event keys
|
|
74
|
+
* such as `@click` without synthetic events.
|
|
75
|
+
*
|
|
76
|
+
* ## Ownership and lifetime
|
|
77
|
+
* The key owns nothing; the rendered template installs and removes the real DOM listener.
|
|
78
|
+
*
|
|
79
|
+
* @since 1.0.0
|
|
80
|
+
* @category type-level
|
|
81
|
+
*/
|
|
82
|
+
export type EventHandlerProperty = `on${string}` | `@${string}`;
|
|
83
|
+
/**
|
|
84
|
+
* Extracts the native Event parameter from an event-handler input.
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* ## Why
|
|
88
|
+
* Host prop merging must preserve the concrete browser event type while
|
|
89
|
+
* combining user and internal handlers.
|
|
90
|
+
*
|
|
91
|
+
* ## Ownership and lifetime
|
|
92
|
+
* Type-only; listener lifetime remains owned by the rendered template Scope.
|
|
93
|
+
*
|
|
94
|
+
* @since 1.0.0
|
|
95
|
+
* @category type-level
|
|
96
|
+
*/
|
|
97
|
+
export type EventOf<Handler> = NonNullable<Handler> extends (...args: infer Args) => any ? Args[0] extends globalThis.Event ? Args[0] : globalThis.Event : globalThis.Event;
|
|
98
|
+
/**
|
|
99
|
+
* Native `on*` handlers supported by a concrete DOM element.
|
|
100
|
+
*
|
|
101
|
+
* @remarks
|
|
102
|
+
* ## Why
|
|
103
|
+
* The browser's own element interface supplies event names and event types,
|
|
104
|
+
* keeping custom hosts aligned with web standards.
|
|
105
|
+
*
|
|
106
|
+
* ## Ownership and lifetime
|
|
107
|
+
* Handlers run as Effects and are detached with the rendering Scope.
|
|
108
|
+
*
|
|
109
|
+
* @since 1.0.0
|
|
110
|
+
* @category dom-types
|
|
111
|
+
*/
|
|
112
|
+
export type ElementEventHandlers<Element extends globalThis.Element> = {
|
|
113
|
+
readonly [K in keyof Element as K extends `on${string}` ? K : never]?: EffectInput | EventHandler.EventHandler<EventOf<Element[K]>, any, any> | null;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Template `@event` handlers for real DOM events.
|
|
117
|
+
*
|
|
118
|
+
* @remarks
|
|
119
|
+
* ## Why
|
|
120
|
+
* Custom or future event names remain expressible without waiting for a DOM
|
|
121
|
+
* interface update and without introducing a synthetic event layer.
|
|
122
|
+
*
|
|
123
|
+
* ## Ownership and lifetime
|
|
124
|
+
* The template Scope owns listener installation, abortion, and removal.
|
|
125
|
+
*
|
|
126
|
+
* @since 1.0.0
|
|
127
|
+
* @category dom-types
|
|
128
|
+
*/
|
|
129
|
+
export type TemplateEventHandlers = {
|
|
130
|
+
readonly [K in `@${string}`]?: EffectInput | EventHandler.EventHandler<Event, any, any> | null;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Callback invoked with the exact mounted DOM element.
|
|
134
|
+
*
|
|
135
|
+
* @remarks
|
|
136
|
+
* ## Why
|
|
137
|
+
* A ref can initialize imperative web-standard APIs or return Effect, Stream,
|
|
138
|
+
* or Fx work without replacing the node or hiding its identity.
|
|
139
|
+
*
|
|
140
|
+
* ## Ownership and lifetime
|
|
141
|
+
* Returned Effect, Stream, or Fx work runs in the element's rendering Scope and
|
|
142
|
+
* is interrupted when that Scope closes.
|
|
143
|
+
*
|
|
144
|
+
* @since 1.0.0
|
|
145
|
+
* @category dom-types
|
|
146
|
+
*/
|
|
147
|
+
export type ElementRefCallback<Element extends globalThis.Element> = (element: Element) => void | EffectInput | Stream.Stream<any, any, any> | Stream.Stream<any, never, never> | Fx<any, any, any> | Fx<any, never, never>;
|
|
148
|
+
/**
|
|
149
|
+
* Optional ref contract shared by DOM-backed component options.
|
|
150
|
+
*
|
|
151
|
+
* @remarks
|
|
152
|
+
* ## Why
|
|
153
|
+
* It supports both ordinary element callbacks and a `RefSubject` hydration
|
|
154
|
+
* owner at the same host boundary.
|
|
155
|
+
*
|
|
156
|
+
* ## Ownership and lifetime
|
|
157
|
+
* A mounted element may have only one hydration owner. Composed ordinary refs
|
|
158
|
+
* share the rendering Scope and must not outlive the element.
|
|
159
|
+
*
|
|
160
|
+
* @since 1.0.0
|
|
161
|
+
* @category dom-types
|
|
162
|
+
*/
|
|
163
|
+
export type ElementRef<Element extends globalThis.Element> = {
|
|
164
|
+
/** The callback or sole hydration owner for the mounted element. */
|
|
165
|
+
readonly ref?: ElementRefCallback<Element> | RefSubject.HydrationRef<any, any>;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Produces `Output` only when two types are mutually assignable.
|
|
169
|
+
*
|
|
170
|
+
* @remarks
|
|
171
|
+
* ## Why
|
|
172
|
+
* DOM host types use exact equality to identify writable properties safely.
|
|
173
|
+
*
|
|
174
|
+
* ## Ownership and lifetime
|
|
175
|
+
* Type-only and resource-free.
|
|
176
|
+
*
|
|
177
|
+
* @since 1.0.0
|
|
178
|
+
* @category type-level
|
|
179
|
+
*/
|
|
180
|
+
export type IfEquals<X, Y, Output> = (<T>() => T extends X ? 1 : 2) extends <T>() => (T extends Y ? 1 : 2) ? Output : never;
|
|
181
|
+
/**
|
|
182
|
+
* Selects writable keys from a structural type.
|
|
183
|
+
*
|
|
184
|
+
* @remarks
|
|
185
|
+
* ## Why
|
|
186
|
+
* Host props must not promise assignment to browser-owned readonly DOM fields.
|
|
187
|
+
*
|
|
188
|
+
* ## Ownership and lifetime
|
|
189
|
+
* Type-only and resource-free.
|
|
190
|
+
*
|
|
191
|
+
* @since 1.0.0
|
|
192
|
+
* @category type-level
|
|
193
|
+
*/
|
|
194
|
+
export type WritableKeys<T> = {
|
|
195
|
+
[K in keyof T]-?: IfEquals<{
|
|
196
|
+
[P in K]: T[P];
|
|
197
|
+
}, {
|
|
198
|
+
-readonly [P in K]: T[P];
|
|
199
|
+
}, K>;
|
|
200
|
+
}[keyof T];
|
|
201
|
+
/**
|
|
202
|
+
* Reactive writable properties for a DOM element, excluding events and refs.
|
|
203
|
+
*
|
|
204
|
+
* @remarks
|
|
205
|
+
* ## Why
|
|
206
|
+
* Property assignment preserves native element behavior for values that are
|
|
207
|
+
* not accurately represented as string attributes.
|
|
208
|
+
*
|
|
209
|
+
* ## Ownership and lifetime
|
|
210
|
+
* Reactive values are subscribed within the rendered part's Scope; the exact
|
|
211
|
+
* element remains browser-owned DOM rather than a virtual-node copy.
|
|
212
|
+
*
|
|
213
|
+
* @since 1.0.0
|
|
214
|
+
* @category dom-types
|
|
215
|
+
*/
|
|
216
|
+
export type ElementProperties<Element extends globalThis.Element> = {
|
|
217
|
+
readonly [K in WritableKeys<Element> as K extends string ? K extends `on${string}` | "ref" ? never : K : never]?: RenderableInput<Element[K] | null | undefined>;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Complete event, ref, and writable-property options for an element.
|
|
221
|
+
*
|
|
222
|
+
* @remarks
|
|
223
|
+
* ## Why
|
|
224
|
+
* Library authors can describe custom hosts directly in terms of the DOM API.
|
|
225
|
+
*
|
|
226
|
+
* ## Ownership and lifetime
|
|
227
|
+
* Rendering owns subscriptions and listeners; callers retain ownership of
|
|
228
|
+
* unrelated classes, attributes, children, and surrounding nodes.
|
|
229
|
+
*
|
|
230
|
+
* @since 1.0.0
|
|
231
|
+
* @category dom-types
|
|
232
|
+
*/
|
|
233
|
+
export type ElementOptions<Element extends globalThis.Element> = ElementEventHandlers<Element> & TemplateEventHandlers & ElementRef<Element> & ElementProperties<Element>;
|
|
234
|
+
type StringAttributeValue = RenderableInput<string | null | undefined>;
|
|
235
|
+
type AttributeValue = RenderableInput<string | number | boolean | null | undefined>;
|
|
236
|
+
type BooleanAttributeValue = RenderableInput<boolean | null | undefined>;
|
|
237
|
+
type DataAttributeValue = RenderableInput;
|
|
238
|
+
type StyleValue = RenderableInput<string | CSSStyleDeclaration | Partial<CSSStyleDeclaration> | null | undefined>;
|
|
239
|
+
type PopoverTargetActionValue = RenderableInput<"toggle" | "show" | "hide" | null | undefined>;
|
|
240
|
+
type CommandValue = RenderableInput<"show-modal" | "close" | "request-close" | "show-popover" | "hide-popover" | "toggle-popover" | `--${string}` | null | undefined>;
|
|
241
|
+
/**
|
|
242
|
+
* Web-standard attributes and Typed template prefixes accepted by every host.
|
|
243
|
+
*
|
|
244
|
+
* @remarks
|
|
245
|
+
* ## Why
|
|
246
|
+
* Attribute, ARIA, data, boolean (`?name`), dataset (`.data`), command, and
|
|
247
|
+
* popover fields stay available to component users instead of being filtered
|
|
248
|
+
* through a framework-owned prop vocabulary.
|
|
249
|
+
*
|
|
250
|
+
* ## Ownership and lifetime
|
|
251
|
+
* Scalar parts retain direct references to their targets and update locally.
|
|
252
|
+
* The renderer removes only values installed through the corresponding part.
|
|
253
|
+
*
|
|
254
|
+
* @since 1.0.0
|
|
255
|
+
* @category dom-types
|
|
256
|
+
*/
|
|
257
|
+
export type TemplateAttributeProps = {
|
|
258
|
+
readonly id?: StringAttributeValue;
|
|
259
|
+
readonly class?: StringAttributeValue;
|
|
260
|
+
readonly className?: StringAttributeValue;
|
|
261
|
+
readonly for?: StringAttributeValue;
|
|
262
|
+
readonly tabindex?: AttributeValue;
|
|
263
|
+
readonly value?: AttributeValue;
|
|
264
|
+
readonly min?: AttributeValue;
|
|
265
|
+
readonly max?: AttributeValue;
|
|
266
|
+
readonly low?: AttributeValue;
|
|
267
|
+
readonly high?: AttributeValue;
|
|
268
|
+
readonly optimum?: AttributeValue;
|
|
269
|
+
readonly step?: AttributeValue;
|
|
270
|
+
readonly role?: StringAttributeValue;
|
|
271
|
+
readonly style?: StyleValue;
|
|
272
|
+
readonly popover?: StringAttributeValue;
|
|
273
|
+
readonly popovertarget?: StringAttributeValue;
|
|
274
|
+
readonly popovertargetaction?: PopoverTargetActionValue;
|
|
275
|
+
readonly command?: CommandValue;
|
|
276
|
+
readonly commandfor?: StringAttributeValue;
|
|
277
|
+
readonly ".data"?: Readonly<Record<string, RenderableInput>>;
|
|
278
|
+
} & {
|
|
279
|
+
readonly [K in `aria-${string}`]?: AttributeValue;
|
|
280
|
+
} & {
|
|
281
|
+
readonly [K in `data-${string}`]?: DataAttributeValue;
|
|
282
|
+
} & {
|
|
283
|
+
readonly [K in `?${string}`]?: BooleanAttributeValue;
|
|
284
|
+
};
|
|
285
|
+
type BoundElementProperty = "checked" | "indeterminate" | "selected" | "selectedIndex" | "value";
|
|
286
|
+
/**
|
|
287
|
+
* Dot-prefixed live form-control properties supported by an element.
|
|
288
|
+
*
|
|
289
|
+
* @remarks
|
|
290
|
+
* ## Why
|
|
291
|
+
* Values such as `checked` and `selectedIndex` are live DOM state; binding the
|
|
292
|
+
* property avoids lossy attribute reflection.
|
|
293
|
+
*
|
|
294
|
+
* ## Ownership and lifetime
|
|
295
|
+
* The binding is active only for the rendered part's Scope and does not replace
|
|
296
|
+
* the element or synthesize browser state.
|
|
297
|
+
*
|
|
298
|
+
* @since 1.0.0
|
|
299
|
+
* @category dom-types
|
|
300
|
+
*/
|
|
301
|
+
export type BoundElementProperties<Element extends globalThis.Element> = {
|
|
302
|
+
readonly [K in Extract<keyof Element, BoundElementProperty> as `.${K}`]?: RenderableInput<Element[K] | null | undefined>;
|
|
303
|
+
};
|
|
304
|
+
/**
|
|
305
|
+
* Public props accepted by a DOM host for a concrete element type.
|
|
306
|
+
*
|
|
307
|
+
* @remarks
|
|
308
|
+
* ## Why
|
|
309
|
+
* `HostProps` combines native properties, attributes, events, refs, and bound
|
|
310
|
+
* control state in one exact DOM-first contract.
|
|
311
|
+
*
|
|
312
|
+
* ## Ownership and lifetime
|
|
313
|
+
* The host owns only the parts it renders. Existing nodes, unrelated
|
|
314
|
+
* attributes, and external listeners remain untouched.
|
|
315
|
+
*
|
|
316
|
+
* @since 1.0.0
|
|
317
|
+
* @category dom-types
|
|
318
|
+
*/
|
|
319
|
+
export type HostProps<Element extends globalThis.Element> = Omit<ElementOptions<Element>, keyof TemplateAttributeProps> & TemplateAttributeProps & BoundElementProperties<Element>;
|
|
320
|
+
/**
|
|
321
|
+
* Function signature for rendering an arbitrary DOM host.
|
|
322
|
+
*
|
|
323
|
+
* @remarks
|
|
324
|
+
* ## Why
|
|
325
|
+
* Components can target native templates or external DOM-producing systems
|
|
326
|
+
* through the same `Fx<RenderEvent, E, R>` substrate.
|
|
327
|
+
*
|
|
328
|
+
* ## Ownership and lifetime
|
|
329
|
+
* Returning a value starts no work by itself. The caller's rendering Scope owns
|
|
330
|
+
* the returned Effect or Fx and any nodes represented by its render events.
|
|
331
|
+
*
|
|
332
|
+
* @since 1.0.0
|
|
333
|
+
* @category dom-hosts
|
|
334
|
+
*/
|
|
335
|
+
export type HostRenderer<Element extends globalThis.Element, A = RenderEvent, E = never, R = never, Props extends HostProps<Element> = HostProps<Element>, Content extends RenderableInput = RenderableInput> = (props: Props, content: Content) => Fx<A, E, R> | Effect.Effect<A, E, R>;
|
|
336
|
+
/**
|
|
337
|
+
* Component-local replacement for its default host element.
|
|
338
|
+
*
|
|
339
|
+
* @remarks
|
|
340
|
+
* ## Why
|
|
341
|
+
* A component can preserve state, behavior, and accessibility props while a
|
|
342
|
+
* caller chooses the element or external renderer that receives them.
|
|
343
|
+
*
|
|
344
|
+
* ## Ownership and lifetime
|
|
345
|
+
* The override owns output it creates. It must apply the supplied merged props
|
|
346
|
+
* so event ordering, disabled behavior, refs, and accessibility remain intact.
|
|
347
|
+
*
|
|
348
|
+
* @since 1.0.0
|
|
349
|
+
* @category dom-hosts
|
|
350
|
+
*/
|
|
351
|
+
export type HostOverride<Props, Content extends RenderableInput, Result extends HostResult = HostResult> = (props: Props, content: Content) => Result;
|
|
352
|
+
/**
|
|
353
|
+
* Shared options for a component with an overridable DOM host.
|
|
354
|
+
*
|
|
355
|
+
* @remarks
|
|
356
|
+
* ## Why
|
|
357
|
+
* Components expose ordinary DOM props and refs instead of hiding their host.
|
|
358
|
+
*
|
|
359
|
+
* ## Ownership and lifetime
|
|
360
|
+
* The component Scope owns rendered props and the ref lifetime; unmentioned DOM
|
|
361
|
+
* remains outside the component's ownership.
|
|
362
|
+
*
|
|
363
|
+
* @since 1.0.0
|
|
364
|
+
* @category dom-hosts
|
|
365
|
+
*/
|
|
366
|
+
export interface HostOptions<Element extends globalThis.Element> extends ElementRef<Element> {
|
|
367
|
+
/** User-owned DOM props merged with the component's required internal props. */
|
|
368
|
+
readonly props?: HostProps<Element>;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Native HTML, SVG, and MathML element type lookup by tag name.
|
|
372
|
+
*
|
|
373
|
+
* @remarks
|
|
374
|
+
* ## Why
|
|
375
|
+
* Custom hosts infer from the platform's own tag maps, with HTML taking
|
|
376
|
+
* precedence for colliding names.
|
|
377
|
+
*
|
|
378
|
+
* ## Ownership and lifetime
|
|
379
|
+
* Type-only and resource-free.
|
|
380
|
+
*
|
|
381
|
+
* @since 1.0.0
|
|
382
|
+
* @category type-level
|
|
383
|
+
*/
|
|
384
|
+
export type ElementByTagName = HTMLElementTagNameMap & Omit<SVGElementTagNameMap, keyof HTMLElementTagNameMap> & Omit<MathMLElementTagNameMap, keyof HTMLElementTagNameMap | keyof SVGElementTagNameMap>;
|
|
385
|
+
/**
|
|
386
|
+
* Element options indexed by native tag name.
|
|
387
|
+
*
|
|
388
|
+
* @remarks
|
|
389
|
+
* ## Why
|
|
390
|
+
* Generic host utilities can retain exact platform event and property types.
|
|
391
|
+
*
|
|
392
|
+
* ## Ownership and lifetime
|
|
393
|
+
* Type-only; rendered options follow the selected host's Scope.
|
|
394
|
+
*
|
|
395
|
+
* @since 1.0.0
|
|
396
|
+
* @category type-level
|
|
397
|
+
*/
|
|
398
|
+
export type OptionsByTagName = {
|
|
399
|
+
readonly [Tag in keyof ElementByTagName]: ElementOptions<ElementByTagName[Tag]>;
|
|
400
|
+
};
|
|
401
|
+
/**
|
|
402
|
+
* Element options for one native tag.
|
|
403
|
+
*
|
|
404
|
+
* @remarks
|
|
405
|
+
* ## Why
|
|
406
|
+
* Avoids repeating indexed-access machinery in host component signatures.
|
|
407
|
+
*
|
|
408
|
+
* ## Ownership and lifetime
|
|
409
|
+
* Type-only; rendering determines lifetime.
|
|
410
|
+
*
|
|
411
|
+
* @since 1.0.0
|
|
412
|
+
* @category type-level
|
|
413
|
+
*/
|
|
414
|
+
export type OptionsForTag<Tag extends keyof ElementByTagName> = OptionsByTagName[Tag];
|
|
415
|
+
/**
|
|
416
|
+
* Complete host props indexed by native tag name.
|
|
417
|
+
*
|
|
418
|
+
* @remarks
|
|
419
|
+
* ## Why
|
|
420
|
+
* Generic component factories can expose the exact props of their chosen host.
|
|
421
|
+
*
|
|
422
|
+
* ## Ownership and lifetime
|
|
423
|
+
* Type-only; rendered prop parts are Scope-owned.
|
|
424
|
+
*
|
|
425
|
+
* @since 1.0.0
|
|
426
|
+
* @category type-level
|
|
427
|
+
*/
|
|
428
|
+
export type HostPropsByTagName = {
|
|
429
|
+
readonly [Tag in keyof ElementByTagName]: HostProps<ElementByTagName[Tag]>;
|
|
430
|
+
};
|
|
431
|
+
/**
|
|
432
|
+
* Host props for one native tag.
|
|
433
|
+
*
|
|
434
|
+
* @remarks
|
|
435
|
+
* ## Why
|
|
436
|
+
* Provides a readable public alias for tag-specific host APIs.
|
|
437
|
+
*
|
|
438
|
+
* ## Ownership and lifetime
|
|
439
|
+
* Type-only; rendered prop parts are Scope-owned.
|
|
440
|
+
*
|
|
441
|
+
* @since 1.0.0
|
|
442
|
+
* @category type-level
|
|
443
|
+
*/
|
|
444
|
+
export type HostPropsForTag<Tag extends keyof ElementByTagName> = HostPropsByTagName[Tag];
|
|
445
|
+
/**
|
|
446
|
+
* Renderer signature specialized to a native tag name.
|
|
447
|
+
*
|
|
448
|
+
* @remarks
|
|
449
|
+
* ## Why
|
|
450
|
+
* External or custom hosts can preserve tag-specific props while returning any
|
|
451
|
+
* Effect/Fx render-event producer.
|
|
452
|
+
*
|
|
453
|
+
* ## Ownership and lifetime
|
|
454
|
+
* The running rendering Scope owns returned work and its output range.
|
|
455
|
+
*
|
|
456
|
+
* @since 1.0.0
|
|
457
|
+
* @category dom-hosts
|
|
458
|
+
*/
|
|
459
|
+
export type HostRendererForTag<Tag extends keyof ElementByTagName, A = RenderEvent, E = never, R = never, Props extends HostPropsForTag<Tag> = HostPropsForTag<Tag>, Content extends RenderableInput = RenderableInput> = (props: Props, content: Content) => Fx<A, E, R> | Effect.Effect<A, E, R>;
|
|
460
|
+
/**
|
|
461
|
+
* Host options specialized to one native tag.
|
|
462
|
+
*
|
|
463
|
+
* @remarks
|
|
464
|
+
* ## Why
|
|
465
|
+
* Useful for component factories whose tag is a generic parameter.
|
|
466
|
+
*
|
|
467
|
+
* ## Ownership and lifetime
|
|
468
|
+
* Props become Scope-owned render parts when the host is mounted.
|
|
469
|
+
*
|
|
470
|
+
* @since 1.0.0
|
|
471
|
+
* @category dom-hosts
|
|
472
|
+
*/
|
|
473
|
+
export interface HostOptionsForTag<Tag extends keyof ElementByTagName> {
|
|
474
|
+
/** User props for the selected native tag. */
|
|
475
|
+
readonly props?: HostPropsForTag<Tag>;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Effect or `EventHandler` accepted for one real DOM event.
|
|
479
|
+
*
|
|
480
|
+
* @remarks
|
|
481
|
+
* ## Why
|
|
482
|
+
* Components can accept a simple Effect or preserve listener options through
|
|
483
|
+
* `EventHandler` without wrapping browser events in synthetic objects.
|
|
484
|
+
*
|
|
485
|
+
* ## Ownership and lifetime
|
|
486
|
+
* The template Scope installs/removes the listener; an AbortSignal or `once`
|
|
487
|
+
* option may end the handler sooner.
|
|
488
|
+
*
|
|
489
|
+
* @since 1.0.0
|
|
490
|
+
* @category events
|
|
491
|
+
*/
|
|
492
|
+
export type EventHandlerInput<Ev extends Event = Event, E = any, R = any> = Effect.Effect<unknown, E, R> | EventHandler.EventHandler<Ev, E, R> | null | undefined;
|
|
493
|
+
/**
|
|
494
|
+
* JavaScript's two absent-value types.
|
|
495
|
+
*
|
|
496
|
+
* @remarks
|
|
497
|
+
* ## Why
|
|
498
|
+
* Internal prop helpers consistently treat `null` and `undefined` as absent.
|
|
499
|
+
*
|
|
500
|
+
* ## Ownership and lifetime
|
|
501
|
+
* Type-only and resource-free.
|
|
502
|
+
*
|
|
503
|
+
* @since 1.0.0
|
|
504
|
+
* @category type-level
|
|
505
|
+
*/
|
|
506
|
+
export type Nullish = null | undefined;
|
|
507
|
+
/**
|
|
508
|
+
* Removes nullish values from a type.
|
|
509
|
+
*
|
|
510
|
+
* @remarks
|
|
511
|
+
* ## Why
|
|
512
|
+
* Component-required defaults can be represented precisely after fallback.
|
|
513
|
+
*
|
|
514
|
+
* ## Ownership and lifetime
|
|
515
|
+
* Type-only and resource-free.
|
|
516
|
+
*
|
|
517
|
+
* @since 1.0.0
|
|
518
|
+
* @category type-level
|
|
519
|
+
*/
|
|
520
|
+
export type NonNullish<Value> = Exclude<Value, Nullish>;
|
|
521
|
+
/**
|
|
522
|
+
* Safely selects a property type, yielding `undefined` for non-objects or absent keys.
|
|
523
|
+
*
|
|
524
|
+
* @remarks
|
|
525
|
+
* ## Why
|
|
526
|
+
* Generic component options remain precise without unsafe indexed access.
|
|
527
|
+
*
|
|
528
|
+
* ## Ownership and lifetime
|
|
529
|
+
* Type-only and resource-free.
|
|
530
|
+
*
|
|
531
|
+
* @since 1.0.0
|
|
532
|
+
* @category type-level
|
|
533
|
+
*/
|
|
534
|
+
export type Property<Value, Key extends PropertyKey> = Value extends object ? Key extends keyof Value ? Value[Key] : undefined : undefined;
|
|
535
|
+
/**
|
|
536
|
+
* Helpers available while constructing component-owned host props.
|
|
537
|
+
*
|
|
538
|
+
* @remarks
|
|
539
|
+
* ## Why
|
|
540
|
+
* Internal defaults can read generic options while retaining exact non-nullish
|
|
541
|
+
* output types.
|
|
542
|
+
*
|
|
543
|
+
* ## Ownership and lifetime
|
|
544
|
+
* Helpers retain only the options object during synchronous prop construction.
|
|
545
|
+
*
|
|
546
|
+
* @since 1.0.0
|
|
547
|
+
* @category dom-hosts
|
|
548
|
+
*/
|
|
549
|
+
export interface InternalPropsHelpers<Options> {
|
|
550
|
+
/** Reads an option and substitutes `fallback` only for `null` or `undefined`. */
|
|
551
|
+
readonly property: <const Key extends PropertyKey, const Fallback>(key: Key, fallback: Fallback) => NonNullish<Property<Options, Key>> | Fallback;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Standard Fx result of a DOM-backed component.
|
|
555
|
+
*
|
|
556
|
+
* @remarks
|
|
557
|
+
* ## Why
|
|
558
|
+
* The alias derives error/service channels from renderable inputs and makes
|
|
559
|
+
* Scope plus `RenderTemplate` requirements explicit.
|
|
560
|
+
*
|
|
561
|
+
* ## Ownership and lifetime
|
|
562
|
+
* The required Scope owns DOM parts, listeners, refs, subscriptions, and
|
|
563
|
+
* cleanup. The host may modify only its represented DOM range.
|
|
564
|
+
*
|
|
565
|
+
* @since 1.0.0
|
|
566
|
+
* @category models
|
|
567
|
+
*/
|
|
568
|
+
export type HostComponent<Inputs> = Fx<RenderEvent, Renderable.Error<Inputs>, Renderable.Services<Inputs> | Scope.Scope | RenderTemplate>;
|
|
569
|
+
export {};
|
|
570
|
+
//# sourceMappingURL=Types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../src/Dom/Types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE7F;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAEzD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,GAAG,IAC3B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAC1B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAA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;;;;;;;;;GAYG;AACH,MAAM,MAAM,UAAU,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAExD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,QAAQ,CAAC,KAAK,EAAE,GAAG,SAAS,WAAW,IAAI,KAAK,SAAS,MAAM,GACvE,GAAG,SAAS,MAAM,KAAK,GACrB,KAAK,CAAC,GAAG,CAAC,GACV,SAAS,GACX,SAAS,CAAC;AAEd;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,oBAAoB,CAAC,OAAO;IAC3C,iFAAiF;IACjF,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,SAAS,WAAW,EAAE,KAAK,CAAC,QAAQ,EAC/D,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,KACf,UAAU,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;CACpD;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,aAAa,CAAC,MAAM,IAAI,EAAE,CACpC,WAAW,EACX,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,EACxB,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,GAAG,cAAc,CAC3D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public DOM host types.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* These exports describe native properties, attributes, events, refs, custom
|
|
6
|
+
* host overrides, and the Scope-owned render result without a virtual DOM API.
|
|
7
|
+
*
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
* @category dom
|
|
10
|
+
*/
|
|
11
|
+
export type { BoundElementProperties, ElementByTagName, ElementEventHandlers, ElementOptions, ElementProperties, ElementRef, ElementRefCallback, EventHandlerInput, EventHandlerProperty, EventOf, HostOptions, HostOptionsForTag, HostOverride, HostProps, HostPropsByTagName, HostPropsForTag, HostRenderer, HostRendererForTag, IfEquals, InternalPropsHelpers, NonNullish, Nullish, OptionsByTagName, OptionsForTag, Property, TemplateAttributeProps, TemplateEventHandlers, WritableKeys, } from "./Types.js";
|
|
12
|
+
/** Native event composition and event-state readers. @since 1.0.0 @category events */
|
|
13
|
+
export { chainEvent, currentTarget, toggleState } from "./Events.js";
|
|
14
|
+
/** Element ref composition with single-owner hydration enforcement. @since 1.0.0 @category refs */
|
|
15
|
+
export { composeRefs } from "./Refs.js";
|
|
16
|
+
/** Deterministic user/internal host-prop merging. @since 1.0.0 @category dom-hosts */
|
|
17
|
+
export { mergeProps, type MergedHostProps, type RenderHostProps } from "./Props.js";
|
|
18
|
+
/** Default and overrideable DOM host rendering boundaries. @since 1.0.0 @category dom-hosts */
|
|
19
|
+
export { renderDivHost, renderHost } from "./Render.js";
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Dom/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,YAAY,EACV,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,oBAAoB,EACpB,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,sBAAsB,EACtB,qBAAqB,EACrB,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,sFAAsF;AACtF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACrE,mGAAmG;AACnG,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,sFAAsF;AACtF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AACpF,+FAA+F;AAC/F,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Native event composition and event-state readers. @since 1.0.0 @category events */
|
|
2
|
+
export { chainEvent, currentTarget, toggleState } from "./Events.js";
|
|
3
|
+
/** Element ref composition with single-owner hydration enforcement. @since 1.0.0 @category refs */
|
|
4
|
+
export { composeRefs } from "./Refs.js";
|
|
5
|
+
/** Deterministic user/internal host-prop merging. @since 1.0.0 @category dom-hosts */
|
|
6
|
+
export { mergeProps } from "./Props.js";
|
|
7
|
+
/** Default and overrideable DOM host rendering boundaries. @since 1.0.0 @category dom-hosts */
|
|
8
|
+
export { renderDivHost, renderHost } from "./Render.js";
|
package/dist/Dom.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM-first host, event, ref, prop-merging, and rendering contracts.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Typed components expose the platform DOM as their host API. Existing node
|
|
6
|
+
* identity, unrelated class names/attributes, real DOM events, and web-standard
|
|
7
|
+
* behavior remain available. Host render work and cleanup are owned by the
|
|
8
|
+
* running Effect Scope.
|
|
9
|
+
*
|
|
10
|
+
* @since 1.0.0
|
|
11
|
+
* @category dom
|
|
12
|
+
*/
|
|
13
|
+
export * from "./Dom/index.js";
|
|
14
|
+
//# sourceMappingURL=Dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dom.d.ts","sourceRoot":"","sources":["../src/Dom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,cAAc,gBAAgB,CAAC"}
|
package/dist/Dom.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM-first host, event, ref, prop-merging, and rendering contracts.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Typed components expose the platform DOM as their host API. Existing node
|
|
6
|
+
* identity, unrelated class names/attributes, real DOM events, and web-standard
|
|
7
|
+
* behavior remain available. Host render work and cleanup are owned by the
|
|
8
|
+
* running Effect Scope.
|
|
9
|
+
*
|
|
10
|
+
* @since 1.0.0
|
|
11
|
+
* @category dom
|
|
12
|
+
*/
|
|
13
|
+
export * from "./Dom/index.js";
|