@typed/ui 1.0.0-beta.5 → 1.0.0-beta.7
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/dist/Alert.d.ts +35 -41
- package/dist/Alert.d.ts.map +1 -1
- package/dist/Alert.js +23 -20
- package/dist/Button.d.ts +34 -78
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +16 -12
- package/dist/Carousel.d.ts +35 -236
- package/dist/Carousel.d.ts.map +1 -1
- package/dist/Carousel.js +13 -136
- package/dist/Checkbox.d.ts +55 -90
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox.js +44 -38
- package/dist/Collection.d.ts +15 -15
- package/dist/Collection.js +7 -7
- package/dist/Combobox.d.ts +38 -187
- package/dist/Combobox.d.ts.map +1 -1
- package/dist/Combobox.js +9 -80
- package/dist/Component.d.ts +30 -24
- package/dist/Component.d.ts.map +1 -1
- package/dist/Component.js +23 -12
- package/dist/Composite.d.ts +50 -50
- package/dist/Composite.js +20 -20
- package/dist/Dialog.d.ts +34 -34
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Dialog.js +16 -14
- package/dist/Disclosure.d.ts +15 -15
- package/dist/Disclosure.js +6 -6
- package/dist/Dom/Events.d.ts +4 -4
- package/dist/Dom/Events.js +4 -4
- package/dist/Dom/Props.d.ts +9 -9
- package/dist/Dom/Props.js +4 -4
- package/dist/Dom/Refs.d.ts +2 -2
- package/dist/Dom/Refs.js +1 -1
- package/dist/Dom/Render.d.ts +2 -2
- package/dist/Dom/Render.js +2 -2
- package/dist/Dom/Types.d.ts +33 -33
- package/dist/Dom/index.d.ts +5 -5
- package/dist/Dom/index.d.ts.map +1 -1
- package/dist/Dom/index.js +4 -4
- package/dist/Dom.d.ts +1 -1
- package/dist/Dom.js +1 -1
- package/dist/Focusable.d.ts +5 -5
- package/dist/Focusable.js +1 -1
- package/dist/Form.d.ts +565 -533
- package/dist/Form.d.ts.map +1 -1
- package/dist/Form.js +350 -195
- package/dist/Grid.d.ts +39 -220
- package/dist/Grid.d.ts.map +1 -1
- package/dist/Grid.js +12 -107
- package/dist/Group.d.ts +50 -69
- package/dist/Group.d.ts.map +1 -1
- package/dist/Group.js +33 -25
- package/dist/Heading.d.ts +41 -40
- package/dist/Heading.d.ts.map +1 -1
- package/dist/Heading.js +26 -16
- package/dist/Hovercard.d.ts +18 -18
- package/dist/Hovercard.js +6 -6
- package/dist/HttpRouter.d.ts +3 -3
- package/dist/HttpRouter.js +5 -5
- package/dist/Link.d.ts +17 -21
- package/dist/Link.d.ts.map +1 -1
- package/dist/Link.js +11 -0
- package/dist/Listbox.d.ts +31 -163
- package/dist/Listbox.d.ts.map +1 -1
- package/dist/Listbox.js +9 -80
- package/dist/Menu.d.ts +67 -376
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Menu.js +17 -179
- package/dist/Menubar.d.ts +24 -142
- package/dist/Menubar.d.ts.map +1 -1
- package/dist/Menubar.js +8 -66
- package/dist/Meter.d.ts +72 -132
- package/dist/Meter.d.ts.map +1 -1
- package/dist/Meter.js +35 -42
- package/dist/NativeDetails.d.ts +1 -1
- package/dist/NativeDetails.js +1 -1
- package/dist/NativeDialog.d.ts +7 -5
- package/dist/NativeDialog.d.ts.map +1 -1
- package/dist/NativeDialog.js +42 -4
- package/dist/NativePopover.d.ts +6 -4
- package/dist/NativePopover.d.ts.map +1 -1
- package/dist/NativePopover.js +43 -5
- package/dist/Popover.d.ts +18 -19
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Popover.js +7 -8
- package/dist/RadioGroup.d.ts +86 -188
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup.js +55 -105
- package/dist/Role.d.ts +4 -4
- package/dist/Role.js +1 -1
- package/dist/Select.d.ts +109 -220
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +67 -117
- package/dist/Separator.d.ts +30 -26
- package/dist/Separator.d.ts.map +1 -1
- package/dist/Separator.js +16 -10
- package/dist/Slider.d.ts +64 -111
- package/dist/Slider.d.ts.map +1 -1
- package/dist/Slider.js +47 -42
- package/dist/SpinButton.d.ts +64 -111
- package/dist/SpinButton.d.ts.map +1 -1
- package/dist/SpinButton.js +47 -42
- package/dist/Storybook.d.ts +2 -2
- package/dist/Storybook.js +1 -1
- package/dist/Switch.d.ts +52 -91
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Switch.js +30 -36
- package/dist/Tabs.d.ts +44 -224
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/Tabs.js +10 -94
- package/dist/Toolbar.d.ts +24 -142
- package/dist/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar.js +8 -66
- package/dist/Tooltip.d.ts +20 -20
- package/dist/Tooltip.js +6 -6
- package/dist/Tree.d.ts +43 -229
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Tree.js +12 -113
- package/dist/TreeGrid.d.ts +45 -264
- package/dist/TreeGrid.d.ts.map +1 -1
- package/dist/TreeGrid.js +13 -125
- package/dist/VisuallyHidden.d.ts +41 -27
- package/dist/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden.js +27 -10
- package/dist/WindowSplitter.d.ts +68 -108
- package/dist/WindowSplitter.d.ts.map +1 -1
- package/dist/WindowSplitter.js +106 -23
- package/package.json +9 -8
package/dist/Dom/Events.js
CHANGED
|
@@ -62,7 +62,7 @@ import { EventHandler } from "@typed/template";
|
|
|
62
62
|
* ```
|
|
63
63
|
*
|
|
64
64
|
* @since 1.0.0
|
|
65
|
-
* @category
|
|
65
|
+
* @category Event composition
|
|
66
66
|
*/
|
|
67
67
|
export function chainEvent(user, internal) {
|
|
68
68
|
const userHandler = toEventHandler(user);
|
|
@@ -135,7 +135,7 @@ function trackPreventDefault(event) {
|
|
|
135
135
|
* Pure predicate; it installs no listener and retains no key.
|
|
136
136
|
*
|
|
137
137
|
* @since 1.0.0
|
|
138
|
-
* @category
|
|
138
|
+
* @category Event inspection
|
|
139
139
|
*/
|
|
140
140
|
export function isEventKey(key) {
|
|
141
141
|
return key[0] === "@" || (key[0] === "o" && key[1] === "n");
|
|
@@ -161,7 +161,7 @@ export function isEventKey(key) {
|
|
|
161
161
|
* ```
|
|
162
162
|
*
|
|
163
163
|
* @since 1.0.0
|
|
164
|
-
* @category
|
|
164
|
+
* @category Event inspection
|
|
165
165
|
*/
|
|
166
166
|
export function currentTarget(event) {
|
|
167
167
|
if (event.currentTarget === null) {
|
|
@@ -181,7 +181,7 @@ export function currentTarget(event) {
|
|
|
181
181
|
* Pure read of the current event; no state or listener is retained.
|
|
182
182
|
*
|
|
183
183
|
* @since 1.0.0
|
|
184
|
-
* @category
|
|
184
|
+
* @category Event inspection
|
|
185
185
|
*/
|
|
186
186
|
export function toggleState(event) {
|
|
187
187
|
const value = Reflect.get(event, "newState");
|
package/dist/Dom/Props.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ type MergedEvents<User, Internal> = {
|
|
|
19
19
|
* The resulting event/ref work is owned by the host's rendering Scope.
|
|
20
20
|
*
|
|
21
21
|
* @since 1.0.0
|
|
22
|
-
* @category
|
|
22
|
+
* @category Prop composition
|
|
23
23
|
*/
|
|
24
24
|
export type MergedHostProps<User, Internal> = Omit<ObjectValue<User>, keyof ObjectValue<Internal> | EventHandlerProperty | "ref"> & Omit<ObjectValue<Internal>, EventHandlerProperty | "ref"> & MergedEvents<User, Internal> & {
|
|
25
25
|
readonly ref?: ComposedRef<PropsRef<Internal>, PropsRef<User>>;
|
|
@@ -35,7 +35,7 @@ export type MergedHostProps<User, Internal> = Omit<ObjectValue<User>, keyof Obje
|
|
|
35
35
|
* Type-only; the rendered host owns listener/ref lifetime.
|
|
36
36
|
*
|
|
37
37
|
* @since 1.0.0
|
|
38
|
-
* @category
|
|
38
|
+
* @category Prop forwarding
|
|
39
39
|
*/
|
|
40
40
|
export type ForwardedHostKeys<Options> = Extract<keyof ObjectValue<Options>, EventHandlerProperty | "ref">;
|
|
41
41
|
/**
|
|
@@ -49,7 +49,7 @@ export type ForwardedHostKeys<Options> = Extract<keyof ObjectValue<Options>, Eve
|
|
|
49
49
|
* Type-only; the rendered host owns listener/ref lifetime.
|
|
50
50
|
*
|
|
51
51
|
* @since 1.0.0
|
|
52
|
-
* @category
|
|
52
|
+
* @category Prop forwarding
|
|
53
53
|
*/
|
|
54
54
|
export type ForwardedHostProps<Options> = Pick<ObjectValue<Options>, ForwardedHostKeys<Options>>;
|
|
55
55
|
/**
|
|
@@ -63,7 +63,7 @@ export type ForwardedHostProps<Options> = Pick<ObjectValue<Options>, ForwardedHo
|
|
|
63
63
|
* Type-only; runtime ownership begins when the host renders.
|
|
64
64
|
*
|
|
65
65
|
* @since 1.0.0
|
|
66
|
-
* @category
|
|
66
|
+
* @category Prop composition
|
|
67
67
|
*/
|
|
68
68
|
export type HostOptionProps<Options> = MergedHostProps<Property<Options, "props">, ForwardedHostProps<Options>>;
|
|
69
69
|
/**
|
|
@@ -78,7 +78,7 @@ export type HostOptionProps<Options> = MergedHostProps<Property<Options, "props"
|
|
|
78
78
|
* The rendering Scope owns composed listeners and refs.
|
|
79
79
|
*
|
|
80
80
|
* @since 1.0.0
|
|
81
|
-
* @category
|
|
81
|
+
* @category Prop composition
|
|
82
82
|
*/
|
|
83
83
|
export type RenderHostProps<Options, Internal> = MergedHostProps<HostOptionProps<Options>, Internal>;
|
|
84
84
|
/**
|
|
@@ -112,7 +112,7 @@ export type RenderHostProps<Options, Internal> = MergedHostProps<HostOptionProps
|
|
|
112
112
|
* ```
|
|
113
113
|
*
|
|
114
114
|
* @since 1.0.0
|
|
115
|
-
* @category
|
|
115
|
+
* @category Prop composition
|
|
116
116
|
*/
|
|
117
117
|
export declare function mergeProps<const User extends object | undefined, const Internal extends object>(user: User, internal: Internal): MergedHostProps<User, Internal>;
|
|
118
118
|
/**
|
|
@@ -126,7 +126,7 @@ export declare function mergeProps<const User extends object | undefined, const
|
|
|
126
126
|
* Pure read; no value is retained.
|
|
127
127
|
*
|
|
128
128
|
* @since 1.0.0
|
|
129
|
-
* @category
|
|
129
|
+
* @category Property inspection
|
|
130
130
|
*/
|
|
131
131
|
export declare function getProperty<const Value, const Key extends PropertyKey>(value: Value, key: Key): Property<Value, Key>;
|
|
132
132
|
/**
|
|
@@ -140,7 +140,7 @@ export declare function getProperty<const Value, const Key extends PropertyKey>(
|
|
|
140
140
|
* The helper closes over `options` only during synchronous prop construction.
|
|
141
141
|
*
|
|
142
142
|
* @since 1.0.0
|
|
143
|
-
* @category
|
|
143
|
+
* @category Internal prop defaults
|
|
144
144
|
*/
|
|
145
145
|
export declare function makeInternalPropsHelpers<const Options>(options: Options): InternalPropsHelpers<Options>;
|
|
146
146
|
/**
|
|
@@ -154,7 +154,7 @@ export declare function makeInternalPropsHelpers<const Options>(options: Options
|
|
|
154
154
|
* Returns a shallow object. The rendering Scope owns any contained listener/ref work.
|
|
155
155
|
*
|
|
156
156
|
* @since 1.0.0
|
|
157
|
-
* @category
|
|
157
|
+
* @category Prop forwarding
|
|
158
158
|
*/
|
|
159
159
|
export declare function forwardHostProps<const Options extends object>(options: Options): ForwardedHostProps<Options>;
|
|
160
160
|
export {};
|
package/dist/Dom/Props.js
CHANGED
|
@@ -31,7 +31,7 @@ import { composeRefs } from "./Refs.js";
|
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
33
|
* @since 1.0.0
|
|
34
|
-
* @category
|
|
34
|
+
* @category Prop composition
|
|
35
35
|
*/
|
|
36
36
|
export function mergeProps(user, internal) {
|
|
37
37
|
if (!user)
|
|
@@ -61,7 +61,7 @@ export function mergeProps(user, internal) {
|
|
|
61
61
|
* Pure read; no value is retained.
|
|
62
62
|
*
|
|
63
63
|
* @since 1.0.0
|
|
64
|
-
* @category
|
|
64
|
+
* @category Property inspection
|
|
65
65
|
*/
|
|
66
66
|
export function getProperty(value, key) {
|
|
67
67
|
return (value === null || value === undefined ? undefined : Reflect.get(Object(value), key));
|
|
@@ -77,7 +77,7 @@ export function getProperty(value, key) {
|
|
|
77
77
|
* The helper closes over `options` only during synchronous prop construction.
|
|
78
78
|
*
|
|
79
79
|
* @since 1.0.0
|
|
80
|
-
* @category
|
|
80
|
+
* @category Internal prop defaults
|
|
81
81
|
*/
|
|
82
82
|
export function makeInternalPropsHelpers(options) {
|
|
83
83
|
return {
|
|
@@ -98,7 +98,7 @@ export function makeInternalPropsHelpers(options) {
|
|
|
98
98
|
* Returns a shallow object. The rendering Scope owns any contained listener/ref work.
|
|
99
99
|
*
|
|
100
100
|
* @since 1.0.0
|
|
101
|
-
* @category
|
|
101
|
+
* @category Prop forwarding
|
|
102
102
|
*/
|
|
103
103
|
export function forwardHostProps(options) {
|
|
104
104
|
const props = {};
|
package/dist/Dom/Refs.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ type HydrationProtocol<Ref> = NonNullable<Ref> extends RefSubject.HydrationRef<i
|
|
|
21
21
|
* on the composed callback.
|
|
22
22
|
*
|
|
23
23
|
* @since 1.0.0
|
|
24
|
-
* @category
|
|
24
|
+
* @category Ref composition
|
|
25
25
|
*/
|
|
26
26
|
export type ComposedRef<First, Second> = ((element: RefTarget<First> & RefTarget<Second>) => Effect.Effect<void, RefError<First> | RefError<Second>, RefServices<First> | RefServices<Second>>) & HydrationProtocol<First> & HydrationProtocol<Second>;
|
|
27
27
|
/**
|
|
@@ -51,7 +51,7 @@ export type ComposedRef<First, Second> = ((element: RefTarget<First> & RefTarget
|
|
|
51
51
|
* ```
|
|
52
52
|
*
|
|
53
53
|
* @since 1.0.0
|
|
54
|
-
* @category
|
|
54
|
+
* @category Ref composition
|
|
55
55
|
*/
|
|
56
56
|
export declare function composeRefs<const First extends RefInput | null | undefined, const Second extends RefInput | null | undefined = undefined>(first: First, second?: Second): ComposedRef<First, Second> | undefined;
|
|
57
57
|
export {};
|
package/dist/Dom/Refs.js
CHANGED
package/dist/Dom/Render.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ import type { HostComponent, HostOptions, HostOverride, HostProps, HostResult, I
|
|
|
30
30
|
* ```
|
|
31
31
|
*
|
|
32
32
|
* @since 1.0.0
|
|
33
|
-
* @category
|
|
33
|
+
* @category Host rendering
|
|
34
34
|
*/
|
|
35
35
|
export declare function renderHost<Element extends globalThis.Element>(): <const Options extends HostOptions<Element>, const Internal extends HostProps<Element>, const Content extends RenderableInput, const Fallback extends HostResult, const Host extends HostResult = never>(options: Options, host: HostOverride<RenderHostProps<Options, Internal>, Content, Host> | undefined, buildInternal: (helpers: InternalPropsHelpers<Options>) => Internal, content: Content, fallback: (props: RenderHostProps<Options, Internal>, content: Content) => Fallback) => HostComponent<Options | Host>;
|
|
36
36
|
/**
|
|
@@ -53,7 +53,7 @@ export declare function renderHost<Element extends globalThis.Element>(): <const
|
|
|
53
53
|
* ```
|
|
54
54
|
*
|
|
55
55
|
* @since 1.0.0
|
|
56
|
-
* @category
|
|
56
|
+
* @category Host rendering
|
|
57
57
|
*/
|
|
58
58
|
export declare function renderDivHost<const Props extends HostProps<HTMLDivElement>, const Content extends RenderableInput>(props: Props, content: Content): HostComponent<Props | Content>;
|
|
59
59
|
//# sourceMappingURL=Render.d.ts.map
|
package/dist/Dom/Render.js
CHANGED
|
@@ -32,7 +32,7 @@ import { forwardHostProps, getProperty, makeInternalPropsHelpers, mergeProps, }
|
|
|
32
32
|
* ```
|
|
33
33
|
*
|
|
34
34
|
* @since 1.0.0
|
|
35
|
-
* @category
|
|
35
|
+
* @category Host rendering
|
|
36
36
|
*/
|
|
37
37
|
export function renderHost() {
|
|
38
38
|
return function (options, host, buildInternal, content, fallback) {
|
|
@@ -61,7 +61,7 @@ export function renderHost() {
|
|
|
61
61
|
* ```
|
|
62
62
|
*
|
|
63
63
|
* @since 1.0.0
|
|
64
|
-
* @category
|
|
64
|
+
* @category Host rendering
|
|
65
65
|
*/
|
|
66
66
|
export function renderDivHost(props, content) {
|
|
67
67
|
return html `<div ...${props}>${content}</div>`;
|
package/dist/Dom/Types.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import type { EventHandler, Renderable, RenderEvent, RenderTemplate } from "@typ
|
|
|
17
17
|
* alias itself acquires nothing.
|
|
18
18
|
*
|
|
19
19
|
* @since 1.0.0
|
|
20
|
-
* @category
|
|
20
|
+
* @category Host input types
|
|
21
21
|
*/
|
|
22
22
|
export type RenderableInput<A = any> = Renderable.Any<A>;
|
|
23
23
|
/**
|
|
@@ -32,7 +32,7 @@ export type RenderableInput<A = any> = Renderable.Any<A>;
|
|
|
32
32
|
* The Effect stays lazy and is owned by the Scope that renders the host.
|
|
33
33
|
*
|
|
34
34
|
* @since 1.0.0
|
|
35
|
-
* @category
|
|
35
|
+
* @category Host input types
|
|
36
36
|
*/
|
|
37
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
38
|
/**
|
|
@@ -47,7 +47,7 @@ export type EffectInput<A = any> = Effect.Effect<A, any, any> | Effect.Effect<A,
|
|
|
47
47
|
* Supplying an Fx starts no work. Its rendering Scope owns subscription and interruption.
|
|
48
48
|
*
|
|
49
49
|
* @since 1.0.0
|
|
50
|
-
* @category
|
|
50
|
+
* @category Host input types
|
|
51
51
|
*/
|
|
52
52
|
export type FxInput<A = any> = Fx<A, any, any> | Fx<A, never, never> | Fx<never, any, any> | Fx<never, never, any>;
|
|
53
53
|
/**
|
|
@@ -62,7 +62,7 @@ export type FxInput<A = any> = Fx<A, any, any> | Fx<A, never, never> | Fx<never,
|
|
|
62
62
|
* `renderHost` lifts an Effect into Fx; the component Scope owns either form.
|
|
63
63
|
*
|
|
64
64
|
* @since 1.0.0
|
|
65
|
-
* @category
|
|
65
|
+
* @category Host rendering types
|
|
66
66
|
*/
|
|
67
67
|
export type HostResult = FxInput<RenderEvent> | EffectInput<RenderEvent>;
|
|
68
68
|
/**
|
|
@@ -77,7 +77,7 @@ export type HostResult = FxInput<RenderEvent> | EffectInput<RenderEvent>;
|
|
|
77
77
|
* The key owns nothing; the rendered template installs and removes the real DOM listener.
|
|
78
78
|
*
|
|
79
79
|
* @since 1.0.0
|
|
80
|
-
* @category
|
|
80
|
+
* @category Event input types
|
|
81
81
|
*/
|
|
82
82
|
export type EventHandlerProperty = `on${string}` | `@${string}`;
|
|
83
83
|
/**
|
|
@@ -92,7 +92,7 @@ export type EventHandlerProperty = `on${string}` | `@${string}`;
|
|
|
92
92
|
* Type-only; listener lifetime remains owned by the rendered template Scope.
|
|
93
93
|
*
|
|
94
94
|
* @since 1.0.0
|
|
95
|
-
* @category
|
|
95
|
+
* @category Event input types
|
|
96
96
|
*/
|
|
97
97
|
export type EventOf<Handler> = NonNullable<Handler> extends (...args: infer Args) => any ? Args[0] extends globalThis.Event ? Args[0] : globalThis.Event : globalThis.Event;
|
|
98
98
|
/**
|
|
@@ -107,7 +107,7 @@ export type EventOf<Handler> = NonNullable<Handler> extends (...args: infer Args
|
|
|
107
107
|
* Handlers run as Effects and are detached with the rendering Scope.
|
|
108
108
|
*
|
|
109
109
|
* @since 1.0.0
|
|
110
|
-
* @category
|
|
110
|
+
* @category Event input types
|
|
111
111
|
*/
|
|
112
112
|
export type ElementEventHandlers<Element extends globalThis.Element> = {
|
|
113
113
|
readonly [K in keyof Element as K extends `on${string}` ? K : never]?: EffectInput | EventHandler.EventHandler<EventOf<Element[K]>, any, any> | null;
|
|
@@ -124,7 +124,7 @@ export type ElementEventHandlers<Element extends globalThis.Element> = {
|
|
|
124
124
|
* The template Scope owns listener installation, abortion, and removal.
|
|
125
125
|
*
|
|
126
126
|
* @since 1.0.0
|
|
127
|
-
* @category
|
|
127
|
+
* @category Event input types
|
|
128
128
|
*/
|
|
129
129
|
export type TemplateEventHandlers = {
|
|
130
130
|
readonly [K in `@${string}`]?: EffectInput | EventHandler.EventHandler<Event, any, any> | null;
|
|
@@ -142,7 +142,7 @@ export type TemplateEventHandlers = {
|
|
|
142
142
|
* is interrupted when that Scope closes.
|
|
143
143
|
*
|
|
144
144
|
* @since 1.0.0
|
|
145
|
-
* @category
|
|
145
|
+
* @category Element ref types
|
|
146
146
|
*/
|
|
147
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
148
|
/**
|
|
@@ -158,7 +158,7 @@ export type ElementRefCallback<Element extends globalThis.Element> = (element: E
|
|
|
158
158
|
* share the rendering Scope and must not outlive the element.
|
|
159
159
|
*
|
|
160
160
|
* @since 1.0.0
|
|
161
|
-
* @category
|
|
161
|
+
* @category Element ref types
|
|
162
162
|
*/
|
|
163
163
|
export type ElementRef<Element extends globalThis.Element> = {
|
|
164
164
|
/** The callback or sole hydration owner for the mounted element. */
|
|
@@ -175,7 +175,7 @@ export type ElementRef<Element extends globalThis.Element> = {
|
|
|
175
175
|
* Type-only and resource-free.
|
|
176
176
|
*
|
|
177
177
|
* @since 1.0.0
|
|
178
|
-
* @category type
|
|
178
|
+
* @category Property type utilities
|
|
179
179
|
*/
|
|
180
180
|
export type IfEquals<X, Y, Output> = (<T>() => T extends X ? 1 : 2) extends <T>() => (T extends Y ? 1 : 2) ? Output : never;
|
|
181
181
|
/**
|
|
@@ -189,7 +189,7 @@ export type IfEquals<X, Y, Output> = (<T>() => T extends X ? 1 : 2) extends <T>(
|
|
|
189
189
|
* Type-only and resource-free.
|
|
190
190
|
*
|
|
191
191
|
* @since 1.0.0
|
|
192
|
-
* @category type
|
|
192
|
+
* @category Property type utilities
|
|
193
193
|
*/
|
|
194
194
|
export type WritableKeys<T> = {
|
|
195
195
|
[K in keyof T]-?: IfEquals<{
|
|
@@ -211,7 +211,7 @@ export type WritableKeys<T> = {
|
|
|
211
211
|
* element remains browser-owned DOM rather than a virtual-node copy.
|
|
212
212
|
*
|
|
213
213
|
* @since 1.0.0
|
|
214
|
-
* @category
|
|
214
|
+
* @category Host input types
|
|
215
215
|
*/
|
|
216
216
|
export type ElementProperties<Element extends globalThis.Element> = {
|
|
217
217
|
readonly [K in WritableKeys<Element> as K extends string ? K extends `on${string}` | "ref" ? never : K : never]?: RenderableInput<Element[K] | null | undefined>;
|
|
@@ -228,7 +228,7 @@ export type ElementProperties<Element extends globalThis.Element> = {
|
|
|
228
228
|
* unrelated classes, attributes, children, and surrounding nodes.
|
|
229
229
|
*
|
|
230
230
|
* @since 1.0.0
|
|
231
|
-
* @category
|
|
231
|
+
* @category Host input types
|
|
232
232
|
*/
|
|
233
233
|
export type ElementOptions<Element extends globalThis.Element> = ElementEventHandlers<Element> & TemplateEventHandlers & ElementRef<Element> & ElementProperties<Element>;
|
|
234
234
|
type StringAttributeValue = RenderableInput<string | null | undefined>;
|
|
@@ -252,7 +252,7 @@ type CommandValue = RenderableInput<"show-modal" | "close" | "request-close" | "
|
|
|
252
252
|
* The renderer removes only values installed through the corresponding part.
|
|
253
253
|
*
|
|
254
254
|
* @since 1.0.0
|
|
255
|
-
* @category
|
|
255
|
+
* @category Host input types
|
|
256
256
|
*/
|
|
257
257
|
export type TemplateAttributeProps = {
|
|
258
258
|
readonly id?: StringAttributeValue;
|
|
@@ -296,7 +296,7 @@ type BoundElementProperty = "checked" | "indeterminate" | "selected" | "selected
|
|
|
296
296
|
* the element or synthesize browser state.
|
|
297
297
|
*
|
|
298
298
|
* @since 1.0.0
|
|
299
|
-
* @category
|
|
299
|
+
* @category Host input types
|
|
300
300
|
*/
|
|
301
301
|
export type BoundElementProperties<Element extends globalThis.Element> = {
|
|
302
302
|
readonly [K in Extract<keyof Element, BoundElementProperty> as `.${K}`]?: RenderableInput<Element[K] | null | undefined>;
|
|
@@ -314,7 +314,7 @@ export type BoundElementProperties<Element extends globalThis.Element> = {
|
|
|
314
314
|
* attributes, and external listeners remain untouched.
|
|
315
315
|
*
|
|
316
316
|
* @since 1.0.0
|
|
317
|
-
* @category
|
|
317
|
+
* @category Host input types
|
|
318
318
|
*/
|
|
319
319
|
export type HostProps<Element extends globalThis.Element> = Omit<ElementOptions<Element>, keyof TemplateAttributeProps> & TemplateAttributeProps & BoundElementProperties<Element>;
|
|
320
320
|
/**
|
|
@@ -330,7 +330,7 @@ export type HostProps<Element extends globalThis.Element> = Omit<ElementOptions<
|
|
|
330
330
|
* the returned Effect or Fx and any nodes represented by its render events.
|
|
331
331
|
*
|
|
332
332
|
* @since 1.0.0
|
|
333
|
-
* @category
|
|
333
|
+
* @category Host rendering types
|
|
334
334
|
*/
|
|
335
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
336
|
/**
|
|
@@ -346,7 +346,7 @@ export type HostRenderer<Element extends globalThis.Element, A = RenderEvent, E
|
|
|
346
346
|
* so event ordering, disabled behavior, refs, and accessibility remain intact.
|
|
347
347
|
*
|
|
348
348
|
* @since 1.0.0
|
|
349
|
-
* @category
|
|
349
|
+
* @category Host rendering types
|
|
350
350
|
*/
|
|
351
351
|
export type HostOverride<Props, Content extends RenderableInput, Result extends HostResult = HostResult> = (props: Props, content: Content) => Result;
|
|
352
352
|
/**
|
|
@@ -361,7 +361,7 @@ export type HostOverride<Props, Content extends RenderableInput, Result extends
|
|
|
361
361
|
* remains outside the component's ownership.
|
|
362
362
|
*
|
|
363
363
|
* @since 1.0.0
|
|
364
|
-
* @category
|
|
364
|
+
* @category Host input types
|
|
365
365
|
*/
|
|
366
366
|
export interface HostOptions<Element extends globalThis.Element> extends ElementRef<Element> {
|
|
367
367
|
/** User-owned DOM props merged with the component's required internal props. */
|
|
@@ -379,7 +379,7 @@ export interface HostOptions<Element extends globalThis.Element> extends Element
|
|
|
379
379
|
* Type-only and resource-free.
|
|
380
380
|
*
|
|
381
381
|
* @since 1.0.0
|
|
382
|
-
* @category
|
|
382
|
+
* @category Host input types
|
|
383
383
|
*/
|
|
384
384
|
export type ElementByTagName = HTMLElementTagNameMap & Omit<SVGElementTagNameMap, keyof HTMLElementTagNameMap> & Omit<MathMLElementTagNameMap, keyof HTMLElementTagNameMap | keyof SVGElementTagNameMap>;
|
|
385
385
|
/**
|
|
@@ -393,7 +393,7 @@ export type ElementByTagName = HTMLElementTagNameMap & Omit<SVGElementTagNameMap
|
|
|
393
393
|
* Type-only; rendered options follow the selected host's Scope.
|
|
394
394
|
*
|
|
395
395
|
* @since 1.0.0
|
|
396
|
-
* @category
|
|
396
|
+
* @category Host input types
|
|
397
397
|
*/
|
|
398
398
|
export type OptionsByTagName = {
|
|
399
399
|
readonly [Tag in keyof ElementByTagName]: ElementOptions<ElementByTagName[Tag]>;
|
|
@@ -409,7 +409,7 @@ export type OptionsByTagName = {
|
|
|
409
409
|
* Type-only; rendering determines lifetime.
|
|
410
410
|
*
|
|
411
411
|
* @since 1.0.0
|
|
412
|
-
* @category
|
|
412
|
+
* @category Host input types
|
|
413
413
|
*/
|
|
414
414
|
export type OptionsForTag<Tag extends keyof ElementByTagName> = OptionsByTagName[Tag];
|
|
415
415
|
/**
|
|
@@ -423,7 +423,7 @@ export type OptionsForTag<Tag extends keyof ElementByTagName> = OptionsByTagName
|
|
|
423
423
|
* Type-only; rendered prop parts are Scope-owned.
|
|
424
424
|
*
|
|
425
425
|
* @since 1.0.0
|
|
426
|
-
* @category
|
|
426
|
+
* @category Host input types
|
|
427
427
|
*/
|
|
428
428
|
export type HostPropsByTagName = {
|
|
429
429
|
readonly [Tag in keyof ElementByTagName]: HostProps<ElementByTagName[Tag]>;
|
|
@@ -439,7 +439,7 @@ export type HostPropsByTagName = {
|
|
|
439
439
|
* Type-only; rendered prop parts are Scope-owned.
|
|
440
440
|
*
|
|
441
441
|
* @since 1.0.0
|
|
442
|
-
* @category
|
|
442
|
+
* @category Host input types
|
|
443
443
|
*/
|
|
444
444
|
export type HostPropsForTag<Tag extends keyof ElementByTagName> = HostPropsByTagName[Tag];
|
|
445
445
|
/**
|
|
@@ -454,7 +454,7 @@ export type HostPropsForTag<Tag extends keyof ElementByTagName> = HostPropsByTag
|
|
|
454
454
|
* The running rendering Scope owns returned work and its output range.
|
|
455
455
|
*
|
|
456
456
|
* @since 1.0.0
|
|
457
|
-
* @category
|
|
457
|
+
* @category Host rendering types
|
|
458
458
|
*/
|
|
459
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
460
|
/**
|
|
@@ -468,7 +468,7 @@ export type HostRendererForTag<Tag extends keyof ElementByTagName, A = RenderEve
|
|
|
468
468
|
* Props become Scope-owned render parts when the host is mounted.
|
|
469
469
|
*
|
|
470
470
|
* @since 1.0.0
|
|
471
|
-
* @category
|
|
471
|
+
* @category Host input types
|
|
472
472
|
*/
|
|
473
473
|
export interface HostOptionsForTag<Tag extends keyof ElementByTagName> {
|
|
474
474
|
/** User props for the selected native tag. */
|
|
@@ -487,7 +487,7 @@ export interface HostOptionsForTag<Tag extends keyof ElementByTagName> {
|
|
|
487
487
|
* option may end the handler sooner.
|
|
488
488
|
*
|
|
489
489
|
* @since 1.0.0
|
|
490
|
-
* @category
|
|
490
|
+
* @category Event input types
|
|
491
491
|
*/
|
|
492
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
493
|
/**
|
|
@@ -501,7 +501,7 @@ export type EventHandlerInput<Ev extends Event = Event, E = any, R = any> = Effe
|
|
|
501
501
|
* Type-only and resource-free.
|
|
502
502
|
*
|
|
503
503
|
* @since 1.0.0
|
|
504
|
-
* @category type
|
|
504
|
+
* @category Property type utilities
|
|
505
505
|
*/
|
|
506
506
|
export type Nullish = null | undefined;
|
|
507
507
|
/**
|
|
@@ -515,7 +515,7 @@ export type Nullish = null | undefined;
|
|
|
515
515
|
* Type-only and resource-free.
|
|
516
516
|
*
|
|
517
517
|
* @since 1.0.0
|
|
518
|
-
* @category type
|
|
518
|
+
* @category Property type utilities
|
|
519
519
|
*/
|
|
520
520
|
export type NonNullish<Value> = Exclude<Value, Nullish>;
|
|
521
521
|
/**
|
|
@@ -529,7 +529,7 @@ export type NonNullish<Value> = Exclude<Value, Nullish>;
|
|
|
529
529
|
* Type-only and resource-free.
|
|
530
530
|
*
|
|
531
531
|
* @since 1.0.0
|
|
532
|
-
* @category type
|
|
532
|
+
* @category Property type utilities
|
|
533
533
|
*/
|
|
534
534
|
export type Property<Value, Key extends PropertyKey> = Value extends object ? Key extends keyof Value ? Value[Key] : undefined : undefined;
|
|
535
535
|
/**
|
|
@@ -544,7 +544,7 @@ export type Property<Value, Key extends PropertyKey> = Value extends object ? Ke
|
|
|
544
544
|
* Helpers retain only the options object during synchronous prop construction.
|
|
545
545
|
*
|
|
546
546
|
* @since 1.0.0
|
|
547
|
-
* @category
|
|
547
|
+
* @category Internal prop defaults
|
|
548
548
|
*/
|
|
549
549
|
export interface InternalPropsHelpers<Options> {
|
|
550
550
|
/** Reads an option and substitutes `fallback` only for `null` or `undefined`. */
|
|
@@ -563,7 +563,7 @@ export interface InternalPropsHelpers<Options> {
|
|
|
563
563
|
* cleanup. The host may modify only its represented DOM range.
|
|
564
564
|
*
|
|
565
565
|
* @since 1.0.0
|
|
566
|
-
* @category
|
|
566
|
+
* @category Host rendering types
|
|
567
567
|
*/
|
|
568
568
|
export type HostComponent<Inputs> = Fx<RenderEvent, Renderable.Error<Inputs>, Renderable.Services<Inputs> | Scope.Scope | RenderTemplate>;
|
|
569
569
|
export {};
|
package/dist/Dom/index.d.ts
CHANGED
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
* host overrides, and the Scope-owned render result without a virtual DOM API.
|
|
7
7
|
*
|
|
8
8
|
* @since 1.0.0
|
|
9
|
-
* @category
|
|
9
|
+
* @category DOM host contracts
|
|
10
10
|
*/
|
|
11
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
|
|
12
|
+
/** Native event composition and event-state readers. @since 1.0.0 @category events*/
|
|
13
13
|
export { chainEvent, currentTarget, toggleState } from "./Events.js";
|
|
14
|
-
/** Element ref composition with single-owner hydration enforcement. @since 1.0.0 @category refs
|
|
14
|
+
/** Element ref composition with single-owner hydration enforcement. @since 1.0.0 @category refs*/
|
|
15
15
|
export { composeRefs } from "./Refs.js";
|
|
16
|
-
/** Deterministic user/internal host-prop merging. @since 1.0.0 @category dom-hosts
|
|
16
|
+
/** Deterministic user/internal host-prop merging. @since 1.0.0 @category dom-hosts*/
|
|
17
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
|
|
18
|
+
/** Default and overrideable DOM host rendering boundaries. @since 1.0.0 @category dom-hosts*/
|
|
19
19
|
export { renderDivHost, renderHost } from "./Render.js";
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/Dom/index.d.ts.map
CHANGED
|
@@ -1 +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,
|
|
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,qFAAqF;AACrF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACrE,kGAAkG;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,qFAAqF;AACrF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AACpF,8FAA8F;AAC9F,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/Dom/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/** Native event composition and event-state readers. @since 1.0.0 @category events
|
|
1
|
+
/** Native event composition and event-state readers. @since 1.0.0 @category events*/
|
|
2
2
|
export { chainEvent, currentTarget, toggleState } from "./Events.js";
|
|
3
|
-
/** Element ref composition with single-owner hydration enforcement. @since 1.0.0 @category refs
|
|
3
|
+
/** Element ref composition with single-owner hydration enforcement. @since 1.0.0 @category refs*/
|
|
4
4
|
export { composeRefs } from "./Refs.js";
|
|
5
|
-
/** Deterministic user/internal host-prop merging. @since 1.0.0 @category dom-hosts
|
|
5
|
+
/** Deterministic user/internal host-prop merging. @since 1.0.0 @category dom-hosts*/
|
|
6
6
|
export { mergeProps } from "./Props.js";
|
|
7
|
-
/** Default and overrideable DOM host rendering boundaries. @since 1.0.0 @category dom-hosts
|
|
7
|
+
/** Default and overrideable DOM host rendering boundaries. @since 1.0.0 @category dom-hosts*/
|
|
8
8
|
export { renderDivHost, renderHost } from "./Render.js";
|
package/dist/Dom.d.ts
CHANGED
package/dist/Dom.js
CHANGED
package/dist/Focusable.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import type { HostResult } from "./Dom/Types.js";
|
|
|
17
17
|
* The model is inert; rendered dynamic values live for the component Scope.
|
|
18
18
|
*
|
|
19
19
|
* @since 1.0.0
|
|
20
|
-
* @category
|
|
20
|
+
* @category Keyboard focus
|
|
21
21
|
*/
|
|
22
22
|
export interface FocusableOptions extends Dom.HostOptions<HTMLDivElement> {
|
|
23
23
|
/** Content rendered inside the focusable host.
|
|
@@ -27,7 +27,7 @@ export interface FocusableOptions extends Dom.HostOptions<HTMLDivElement> {
|
|
|
27
27
|
* ## Ownership and lifetime
|
|
28
28
|
* Dynamic content follows the rendered Scope and is released with it.
|
|
29
29
|
* @since 1.0.0
|
|
30
|
-
* @category content
|
|
30
|
+
* @category Rendered content
|
|
31
31
|
*/
|
|
32
32
|
readonly content: Renderable.Any;
|
|
33
33
|
/** Optional ARIA role for the focus target.
|
|
@@ -37,7 +37,7 @@ export interface FocusableOptions extends Dom.HostOptions<HTMLDivElement> {
|
|
|
37
37
|
* ## Ownership and lifetime
|
|
38
38
|
* The reflected value retains no resources.
|
|
39
39
|
* @since 1.0.0
|
|
40
|
-
* @category
|
|
40
|
+
* @category Semantic roles
|
|
41
41
|
*/
|
|
42
42
|
readonly role?: Renderable.Any<string | null | undefined>;
|
|
43
43
|
/** Tab order value; defaults to zero.
|
|
@@ -47,7 +47,7 @@ export interface FocusableOptions extends Dom.HostOptions<HTMLDivElement> {
|
|
|
47
47
|
* ## Ownership and lifetime
|
|
48
48
|
* Dynamic values are observed only for the component Scope.
|
|
49
49
|
* @since 1.0.0
|
|
50
|
-
* @category
|
|
50
|
+
* @category Keyboard focus
|
|
51
51
|
*/
|
|
52
52
|
readonly tabIndex?: Renderable.Any<number | null | undefined>;
|
|
53
53
|
}
|
|
@@ -78,7 +78,7 @@ type FocusableInternalProps<Options extends FocusableOptions> = ReturnType<typeo
|
|
|
78
78
|
* ```
|
|
79
79
|
*
|
|
80
80
|
* @since 1.0.0
|
|
81
|
-
* @category
|
|
81
|
+
* @category Keyboard focus
|
|
82
82
|
*/
|
|
83
83
|
export declare function Focusable<const Options extends FocusableOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, FocusableInternalProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
|
|
84
84
|
export {};
|
package/dist/Focusable.js
CHANGED
|
@@ -28,7 +28,7 @@ function internalProps({ property, }) {
|
|
|
28
28
|
* ```
|
|
29
29
|
*
|
|
30
30
|
* @since 1.0.0
|
|
31
|
-
* @category
|
|
31
|
+
* @category Keyboard focus
|
|
32
32
|
*/
|
|
33
33
|
export function Focusable(options, host) {
|
|
34
34
|
return Dom.renderHost()(options, host, internalProps, options.content, (props, content) => html `<div ...${props}>${content}</div>`);
|