foldkit 0.82.9 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/devTools/overlay.d.ts.map +1 -1
- package/dist/devTools/overlay.js +66 -4
- package/dist/devTools/protocol.d.ts +19 -2
- package/dist/devTools/protocol.d.ts.map +1 -1
- package/dist/devTools/protocol.js +5 -2
- package/dist/devTools/serialize.d.ts.map +1 -1
- package/dist/devTools/serialize.js +2 -0
- package/dist/devTools/store.d.ts +5 -1
- package/dist/devTools/store.d.ts.map +1 -1
- package/dist/devTools/store.js +37 -1
- package/dist/devTools/webSocketBridge.js +1 -0
- package/dist/html/index.d.ts +11 -0
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +58 -39
- package/dist/mount/index.d.ts +14 -1
- package/dist/mount/index.d.ts.map +1 -1
- package/dist/mount/index.js +9 -1
- package/dist/mount/public.d.ts +1 -1
- package/dist/mount/public.d.ts.map +1 -1
- package/dist/mount/public.js +1 -1
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +38 -3
- package/dist/scene/public.d.ts +2 -0
- package/dist/scene/public.d.ts.map +1 -0
- package/dist/scene/public.js +1 -0
- package/dist/story/public.d.ts +2 -0
- package/dist/story/public.d.ts.map +1 -0
- package/dist/story/public.js +1 -0
- package/dist/test/apps/mountPanel.d.ts +42 -0
- package/dist/test/apps/mountPanel.d.ts.map +1 -0
- package/dist/test/apps/mountPanel.js +76 -0
- package/dist/test/internal.d.ts +38 -0
- package/dist/test/internal.d.ts.map +1 -1
- package/dist/test/internal.js +75 -0
- package/dist/test/scene.d.ts +37 -14
- package/dist/test/scene.d.ts.map +1 -1
- package/dist/test/scene.js +141 -8
- package/dist/test/story.d.ts +17 -13
- package/dist/test/story.d.ts.map +1 -1
- package/dist/test/story.js +19 -5
- package/dist/ui/anchor.d.ts +6 -0
- package/dist/ui/anchor.d.ts.map +1 -1
- package/dist/ui/anchor.js +27 -16
- package/dist/ui/animation/index.d.ts +4 -4
- package/dist/ui/animation/index.d.ts.map +1 -1
- package/dist/ui/button/index.d.ts +6 -6
- package/dist/ui/button/index.d.ts.map +1 -1
- package/dist/ui/calendar/index.js +2 -2
- package/dist/ui/checkbox/index.d.ts +10 -10
- package/dist/ui/checkbox/index.d.ts.map +1 -1
- package/dist/ui/checkbox/index.js +2 -2
- package/dist/ui/combobox/multi.d.ts +18 -14
- package/dist/ui/combobox/multi.d.ts.map +1 -1
- package/dist/ui/combobox/multi.js +2 -2
- package/dist/ui/combobox/public.d.ts +1 -1
- package/dist/ui/combobox/public.d.ts.map +1 -1
- package/dist/ui/combobox/public.js +1 -1
- package/dist/ui/combobox/shared.d.ts +44 -13
- package/dist/ui/combobox/shared.d.ts.map +1 -1
- package/dist/ui/combobox/shared.js +27 -4
- package/dist/ui/combobox/single.d.ts +18 -14
- package/dist/ui/combobox/single.d.ts.map +1 -1
- package/dist/ui/combobox/single.js +2 -2
- package/dist/ui/datePicker/index.d.ts +1 -1
- package/dist/ui/datePicker/index.js +2 -2
- package/dist/ui/dialog/index.d.ts +8 -8
- package/dist/ui/dialog/index.d.ts.map +1 -1
- package/dist/ui/dialog/index.js +2 -2
- package/dist/ui/disclosure/index.d.ts +8 -8
- package/dist/ui/disclosure/index.d.ts.map +1 -1
- package/dist/ui/disclosure/index.js +2 -2
- package/dist/ui/dragAndDrop/index.d.ts +5 -5
- package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
- package/dist/ui/fieldset/index.d.ts +7 -7
- package/dist/ui/fieldset/index.d.ts.map +1 -1
- package/dist/ui/fileDrop/index.js +2 -2
- package/dist/ui/input/index.d.ts +8 -8
- package/dist/ui/input/index.d.ts.map +1 -1
- package/dist/ui/listbox/multi.d.ts +16 -12
- package/dist/ui/listbox/multi.d.ts.map +1 -1
- package/dist/ui/listbox/multi.js +2 -2
- package/dist/ui/listbox/public.d.ts +1 -1
- package/dist/ui/listbox/public.d.ts.map +1 -1
- package/dist/ui/listbox/public.js +1 -1
- package/dist/ui/listbox/shared.d.ts +35 -11
- package/dist/ui/listbox/shared.d.ts.map +1 -1
- package/dist/ui/listbox/shared.js +22 -3
- package/dist/ui/listbox/single.d.ts +16 -12
- package/dist/ui/listbox/single.d.ts.map +1 -1
- package/dist/ui/listbox/single.js +2 -2
- package/dist/ui/menu/index.d.ts +34 -12
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +24 -5
- package/dist/ui/menu/public.d.ts +1 -1
- package/dist/ui/menu/public.d.ts.map +1 -1
- package/dist/ui/menu/public.js +1 -1
- package/dist/ui/popover/index.d.ts +26 -10
- package/dist/ui/popover/index.d.ts.map +1 -1
- package/dist/ui/popover/index.js +20 -4
- package/dist/ui/popover/public.d.ts +1 -1
- package/dist/ui/popover/public.d.ts.map +1 -1
- package/dist/ui/popover/public.js +1 -1
- package/dist/ui/radioGroup/index.d.ts +13 -13
- package/dist/ui/radioGroup/index.d.ts.map +1 -1
- package/dist/ui/radioGroup/index.js +2 -2
- package/dist/ui/select/index.d.ts +8 -8
- package/dist/ui/select/index.d.ts.map +1 -1
- package/dist/ui/slider/index.d.ts +12 -12
- package/dist/ui/slider/index.d.ts.map +1 -1
- package/dist/ui/slider/index.js +2 -2
- package/dist/ui/switch/index.d.ts +10 -10
- package/dist/ui/switch/index.d.ts.map +1 -1
- package/dist/ui/switch/index.js +2 -2
- package/dist/ui/tabs/index.d.ts +11 -11
- package/dist/ui/tabs/index.d.ts.map +1 -1
- package/dist/ui/tabs/index.js +2 -2
- package/dist/ui/textarea/index.d.ts +8 -8
- package/dist/ui/textarea/index.d.ts.map +1 -1
- package/dist/ui/toast/index.js +2 -2
- package/dist/ui/tooltip/index.d.ts +14 -7
- package/dist/ui/tooltip/index.d.ts.map +1 -1
- package/dist/ui/tooltip/index.js +6 -3
- package/dist/ui/tooltip/public.d.ts +1 -1
- package/dist/ui/tooltip/public.d.ts.map +1 -1
- package/dist/ui/tooltip/public.js +1 -1
- package/dist/ui/virtualList/index.d.ts +4 -4
- package/dist/ui/virtualList/index.d.ts.map +1 -1
- package/package.json +9 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Effect, Option, Schema as S } from 'effect';
|
|
2
2
|
import * as Command from '../../command/index.js';
|
|
3
3
|
import { type Attribute, type Html } from '../../html/index.js';
|
|
4
|
+
import * as Mount from '../../mount/index.js';
|
|
4
5
|
import type { AnchorConfig } from '../anchor.js';
|
|
5
6
|
import { groupContiguous } from '../group.js';
|
|
6
7
|
export { groupContiguous };
|
|
@@ -95,6 +96,8 @@ export declare const CompletedAnchorMount: import("../../schema/index.js").Calla
|
|
|
95
96
|
export declare const CompletedAttachPreventBlur: import("../../schema/index.js").CallableTaggedStruct<"CompletedAttachPreventBlur", {}>;
|
|
96
97
|
/** Sent when the input mounts and the focus listener that auto-selects on focus is attached. Update no-ops; surfaces the listener-attach side effect for DevTools. */
|
|
97
98
|
export declare const CompletedAttachSelectOnFocus: import("../../schema/index.js").CallableTaggedStruct<"CompletedAttachSelectOnFocus", {}>;
|
|
99
|
+
/** Sent when the combobox backdrop mounts and is portaled to the document body. Update no-ops; surfaces the portal side effect for DevTools. */
|
|
100
|
+
export declare const CompletedBackdropPortal: import("../../schema/index.js").CallableTaggedStruct<"CompletedBackdropPortal", {}>;
|
|
98
101
|
/** Wraps an Animation submodel message for delegation. */
|
|
99
102
|
export declare const GotAnimationMessage: import("../../schema/index.js").CallableTaggedStruct<"GotAnimationMessage", {
|
|
100
103
|
message: S.Union<[import("../../schema/index.js").CallableTaggedStruct<"Showed", {}>, import("../../schema/index.js").CallableTaggedStruct<"Hid", {}>, import("../../schema/index.js").CallableTaggedStruct<"AdvancedAnimationFrame", {}>, import("../../schema/index.js").CallableTaggedStruct<"EndedAnimation", {}>]>;
|
|
@@ -125,6 +128,7 @@ export declare const Message: S.Union<[
|
|
|
125
128
|
typeof CompletedAnchorMount,
|
|
126
129
|
typeof CompletedAttachPreventBlur,
|
|
127
130
|
typeof CompletedAttachSelectOnFocus,
|
|
131
|
+
typeof CompletedBackdropPortal,
|
|
128
132
|
typeof GotAnimationMessage,
|
|
129
133
|
typeof UpdatedInputValue,
|
|
130
134
|
typeof PressedToggleButton
|
|
@@ -226,6 +230,8 @@ export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
|
|
|
226
230
|
readonly _tag: "CompletedClickItem";
|
|
227
231
|
} | {
|
|
228
232
|
readonly _tag: "CompletedAnchorMount";
|
|
233
|
+
} | {
|
|
234
|
+
readonly _tag: "CompletedBackdropPortal";
|
|
229
235
|
} | {
|
|
230
236
|
readonly _tag: "Opened";
|
|
231
237
|
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
@@ -275,6 +281,31 @@ export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
|
|
|
275
281
|
readonly _tag: "PressedToggleButton";
|
|
276
282
|
}, never, never>;
|
|
277
283
|
}>[]];
|
|
284
|
+
/** The anchor-positioning Mount this Combobox renders when an anchor is
|
|
285
|
+
* configured. Exposed so Scene tests can call
|
|
286
|
+
* `Scene.Mount.resolve(ComboboxAnchor, CompletedAnchorMount())`. */
|
|
287
|
+
export declare const ComboboxAnchor: Mount.MountDefinition<"ComboboxAnchor", {
|
|
288
|
+
readonly _tag: "CompletedAnchorMount";
|
|
289
|
+
}>;
|
|
290
|
+
/** The Mount this Combobox renders to install a `pointerdown`-cancelling
|
|
291
|
+
* capture listener that prevents blur on item presses. Exposed so Scene
|
|
292
|
+
* tests can call
|
|
293
|
+
* `Scene.Mount.resolve(ComboboxAttachPreventBlur, CompletedAttachPreventBlur())`. */
|
|
294
|
+
export declare const ComboboxAttachPreventBlur: Mount.MountDefinition<"ComboboxAttachPreventBlur", {
|
|
295
|
+
readonly _tag: "CompletedAttachPreventBlur";
|
|
296
|
+
}>;
|
|
297
|
+
/** The Mount this Combobox renders to install the input's select-on-focus
|
|
298
|
+
* behavior. Exposed so Scene tests can call
|
|
299
|
+
* `Scene.Mount.resolve(ComboboxAttachSelectOnFocus, CompletedAttachSelectOnFocus())`. */
|
|
300
|
+
export declare const ComboboxAttachSelectOnFocus: Mount.MountDefinition<"ComboboxAttachSelectOnFocus", {
|
|
301
|
+
readonly _tag: "CompletedAttachSelectOnFocus";
|
|
302
|
+
}>;
|
|
303
|
+
/** The backdrop-portaling Mount this Combobox renders. Exposed so Scene tests can
|
|
304
|
+
* call `Scene.Mount.resolve(ComboboxBackdropPortal, CompletedBackdropPortal())` to
|
|
305
|
+
* acknowledge the mount produced by the rendered backdrop. */
|
|
306
|
+
export declare const ComboboxBackdropPortal: Mount.MountDefinition<"ComboboxBackdropPortal", {
|
|
307
|
+
readonly _tag: "CompletedBackdropPortal";
|
|
308
|
+
}>;
|
|
278
309
|
/** Configuration for an individual combobox item's appearance. */
|
|
279
310
|
export type ItemConfig = Readonly<{
|
|
280
311
|
className?: string;
|
|
@@ -286,10 +317,10 @@ export type GroupHeading = Readonly<{
|
|
|
286
317
|
className?: string;
|
|
287
318
|
}>;
|
|
288
319
|
/** Configuration for rendering a combobox with `view`. */
|
|
289
|
-
export type BaseViewConfig<
|
|
320
|
+
export type BaseViewConfig<ParentMessage, Item extends string, Model extends BaseModel> = Readonly<{
|
|
290
321
|
model: Model;
|
|
291
|
-
toParentMessage: (message: Opened | Closed | BlurredInput | ActivatedItem | DeactivatedItem | SelectedItem | MovedPointerOverItem | RequestedItemClick | UpdatedInputValue | PressedToggleButton | typeof CompletedAnchorMount.Type | typeof CompletedAttachPreventBlur.Type | typeof CompletedAttachSelectOnFocus.Type) =>
|
|
292
|
-
onSelectedItem?: (value: string) =>
|
|
322
|
+
toParentMessage: (message: Opened | Closed | BlurredInput | ActivatedItem | DeactivatedItem | SelectedItem | MovedPointerOverItem | RequestedItemClick | UpdatedInputValue | PressedToggleButton | typeof CompletedAnchorMount.Type | typeof CompletedAttachPreventBlur.Type | typeof CompletedAttachSelectOnFocus.Type | typeof CompletedBackdropPortal.Type) => ParentMessage;
|
|
323
|
+
onSelectedItem?: (value: string) => ParentMessage;
|
|
293
324
|
items: ReadonlyArray<Item>;
|
|
294
325
|
itemToConfig: (item: Item, context: Readonly<{
|
|
295
326
|
isActive: boolean;
|
|
@@ -300,21 +331,21 @@ export type BaseViewConfig<Message, Item extends string, Model extends BaseModel
|
|
|
300
331
|
itemToDisplayText: (item: Item, index: number) => string;
|
|
301
332
|
isItemDisabled?: (item: Item, index: number) => boolean;
|
|
302
333
|
inputClassName?: string;
|
|
303
|
-
inputAttributes?: ReadonlyArray<Attribute<
|
|
334
|
+
inputAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
304
335
|
inputPlaceholder?: string;
|
|
305
336
|
inputWrapperClassName?: string;
|
|
306
|
-
inputWrapperAttributes?: ReadonlyArray<Attribute<
|
|
337
|
+
inputWrapperAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
307
338
|
itemsClassName?: string;
|
|
308
|
-
itemsAttributes?: ReadonlyArray<Attribute<
|
|
339
|
+
itemsAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
309
340
|
itemsScrollClassName?: string;
|
|
310
|
-
itemsScrollAttributes?: ReadonlyArray<Attribute<
|
|
341
|
+
itemsScrollAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
311
342
|
backdropClassName?: string;
|
|
312
|
-
backdropAttributes?: ReadonlyArray<Attribute<
|
|
343
|
+
backdropAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
313
344
|
className?: string;
|
|
314
|
-
attributes?: ReadonlyArray<Attribute<
|
|
345
|
+
attributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
315
346
|
buttonContent?: Html;
|
|
316
347
|
buttonClassName?: string;
|
|
317
|
-
buttonAttributes?: ReadonlyArray<Attribute<
|
|
348
|
+
buttonAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
318
349
|
formName?: string;
|
|
319
350
|
isDisabled?: boolean;
|
|
320
351
|
isInvalid?: boolean;
|
|
@@ -322,9 +353,9 @@ export type BaseViewConfig<Message, Item extends string, Model extends BaseModel
|
|
|
322
353
|
itemGroupKey?: (item: Item, index: number) => string;
|
|
323
354
|
groupToHeading?: (groupKey: string) => GroupHeading | undefined;
|
|
324
355
|
groupClassName?: string;
|
|
325
|
-
groupAttributes?: ReadonlyArray<Attribute<
|
|
356
|
+
groupAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
326
357
|
separatorClassName?: string;
|
|
327
|
-
separatorAttributes?: ReadonlyArray<Attribute<
|
|
358
|
+
separatorAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
328
359
|
anchor?: AnchorConfig;
|
|
329
360
|
}>;
|
|
330
361
|
/** Variant-specific view behavior injected into the shared combobox view factory. */
|
|
@@ -333,5 +364,5 @@ export type ViewBehavior<Model extends BaseModel> = Readonly<{
|
|
|
333
364
|
ariaMultiSelectable: boolean;
|
|
334
365
|
}>;
|
|
335
366
|
/** Creates a combobox view function from variant-specific behavior. Shared rendering logic (input, items, transitions, keyboard navigation) is handled internally; only selection display varies by variant. */
|
|
336
|
-
export declare const makeView: <Model extends BaseModel>(behavior: ViewBehavior<Model>) => <
|
|
367
|
+
export declare const makeView: <Model extends BaseModel>(behavior: ViewBehavior<Model>) => <ParentMessage, Item extends string>(config: BaseViewConfig<ParentMessage, Item, Model>) => Html;
|
|
337
368
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAEN,MAAM,EAGN,MAAM,IAAI,CAAC,EAEZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAEjD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EAGV,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/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AAmB,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;IAC7D,MAAM,CAAC,EAAE,YAAY,CAAA;CACtB,CAAC,CAAA;AAIF,qFAAqF;AACrF,MAAM,MAAM,YAAY,CAAC,KAAK,SAAS,SAAS,IAAI,QAAQ,CAAC;IAC3D,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAA;IAC5D,mBAAmB,EAAE,OAAO,CAAA;CAC7B,CAAC,CAAA;AAEF,gNAAgN;AAChN,eAAO,MAAM,QAAQ,GAClB,KAAK,SAAS,SAAS,EAAE,UAAU,YAAY,CAAC,KAAK,CAAC,MACtD,aAAa,EAAE,IAAI,SAAS,MAAM,EACjC,QAAQ,cAAc,CAAC,aAAa,EAAE,IAAI,EAAE,KAAK,CAAC,KACjD,IA2jBF,CAAA"}
|
|
@@ -6,7 +6,7 @@ import { m } from '../../message/index.js';
|
|
|
6
6
|
import * as Mount from '../../mount/index.js';
|
|
7
7
|
import { makeConstrainedEvo } from '../../struct/index.js';
|
|
8
8
|
import * as Task from '../../task/index.js';
|
|
9
|
-
import { anchorSetup } from '../anchor.js';
|
|
9
|
+
import { anchorSetup, portalToBody } from '../anchor.js';
|
|
10
10
|
// NOTE: Animation imports are split across schema + update to avoid a circular
|
|
11
11
|
// dependency: animation → html → runtime → devtools → combobox → animation.
|
|
12
12
|
// The barrel (../animation) imports from html, which starts the cycle.
|
|
@@ -100,6 +100,8 @@ export const CompletedAnchorMount = m('CompletedAnchorMount');
|
|
|
100
100
|
export const CompletedAttachPreventBlur = m('CompletedAttachPreventBlur');
|
|
101
101
|
/** Sent when the input mounts and the focus listener that auto-selects on focus is attached. Update no-ops; surfaces the listener-attach side effect for DevTools. */
|
|
102
102
|
export const CompletedAttachSelectOnFocus = m('CompletedAttachSelectOnFocus');
|
|
103
|
+
/** Sent when the combobox backdrop mounts and is portaled to the document body. Update no-ops; surfaces the portal side effect for DevTools. */
|
|
104
|
+
export const CompletedBackdropPortal = m('CompletedBackdropPortal');
|
|
103
105
|
/** Wraps an Animation submodel message for delegation. */
|
|
104
106
|
export const GotAnimationMessage = m('GotAnimationMessage', {
|
|
105
107
|
message: AnimationMessage,
|
|
@@ -130,6 +132,7 @@ export const Message = S.Union([
|
|
|
130
132
|
CompletedAnchorMount,
|
|
131
133
|
CompletedAttachPreventBlur,
|
|
132
134
|
CompletedAttachSelectOnFocus,
|
|
135
|
+
CompletedBackdropPortal,
|
|
133
136
|
GotAnimationMessage,
|
|
134
137
|
UpdatedInputValue,
|
|
135
138
|
PressedToggleButton,
|
|
@@ -331,12 +334,27 @@ export const makeUpdate = (handlers) => {
|
|
|
331
334
|
CompletedAnchorMount: () => [model, []],
|
|
332
335
|
CompletedAttachPreventBlur: () => [model, []],
|
|
333
336
|
CompletedAttachSelectOnFocus: () => [model, []],
|
|
337
|
+
CompletedBackdropPortal: () => [model, []],
|
|
334
338
|
}));
|
|
335
339
|
};
|
|
336
340
|
};
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
341
|
+
/** The anchor-positioning Mount this Combobox renders when an anchor is
|
|
342
|
+
* configured. Exposed so Scene tests can call
|
|
343
|
+
* `Scene.Mount.resolve(ComboboxAnchor, CompletedAnchorMount())`. */
|
|
344
|
+
export const ComboboxAnchor = Mount.define('ComboboxAnchor', CompletedAnchorMount);
|
|
345
|
+
/** The Mount this Combobox renders to install a `pointerdown`-cancelling
|
|
346
|
+
* capture listener that prevents blur on item presses. Exposed so Scene
|
|
347
|
+
* tests can call
|
|
348
|
+
* `Scene.Mount.resolve(ComboboxAttachPreventBlur, CompletedAttachPreventBlur())`. */
|
|
349
|
+
export const ComboboxAttachPreventBlur = Mount.define('ComboboxAttachPreventBlur', CompletedAttachPreventBlur);
|
|
350
|
+
/** The Mount this Combobox renders to install the input's select-on-focus
|
|
351
|
+
* behavior. Exposed so Scene tests can call
|
|
352
|
+
* `Scene.Mount.resolve(ComboboxAttachSelectOnFocus, CompletedAttachSelectOnFocus())`. */
|
|
353
|
+
export const ComboboxAttachSelectOnFocus = Mount.define('ComboboxAttachSelectOnFocus', CompletedAttachSelectOnFocus);
|
|
354
|
+
/** The backdrop-portaling Mount this Combobox renders. Exposed so Scene tests can
|
|
355
|
+
* call `Scene.Mount.resolve(ComboboxBackdropPortal, CompletedBackdropPortal())` to
|
|
356
|
+
* acknowledge the mount produced by the rendered backdrop. */
|
|
357
|
+
export const ComboboxBackdropPortal = Mount.define('ComboboxBackdropPortal', CompletedBackdropPortal);
|
|
340
358
|
const attachPreventBlurOnPointerDown = ComboboxAttachPreventBlur((element) => Effect.sync(() => {
|
|
341
359
|
const handler = (event) => {
|
|
342
360
|
event.preventDefault();
|
|
@@ -361,6 +379,10 @@ const attachSelectOnFocus = ComboboxAttachSelectOnFocus((element) => Effect.sync
|
|
|
361
379
|
cleanup: () => element.removeEventListener('focus', handler),
|
|
362
380
|
};
|
|
363
381
|
}));
|
|
382
|
+
const portalBackdropOnMount = ComboboxBackdropPortal((element) => Effect.sync(() => ({
|
|
383
|
+
message: CompletedBackdropPortal(),
|
|
384
|
+
cleanup: portalToBody(element),
|
|
385
|
+
})));
|
|
364
386
|
/** Creates a combobox view function from variant-specific behavior. Shared rendering logic (input, items, transitions, keyboard navigation) is handled internally; only selection display varies by variant. */
|
|
365
387
|
export const makeView = (behavior) => (config) => {
|
|
366
388
|
const { div, input, AriaActiveDescendant, AriaControls, AriaDisabled, AriaExpanded, AriaInvalid, AriaLabelledBy, AriaMultiSelectable, AriaSelected, Attribute, Autocomplete, Class, DataAttribute, Id, Name, OnBlur, OnClick, OnFocus, OnInput, OnKeyDownPreventDefault, OnMount, OnPointerLeave, OnPointerMove, Placeholder, Role, Style, Tabindex, Type, Value, keyed, } = html();
|
|
@@ -596,6 +618,7 @@ export const makeView = (behavior) => (config) => {
|
|
|
596
618
|
});
|
|
597
619
|
};
|
|
598
620
|
const backdrop = keyed('div')(`${id}-backdrop`, [
|
|
621
|
+
OnMount(Mount.mapMessage(portalBackdropOnMount, toParentMessage)),
|
|
599
622
|
...(isLeaving ? [] : [OnClick(toParentMessage(Closed()))]),
|
|
600
623
|
...(backdropClassName ? [Class(backdropClassName)] : []),
|
|
601
624
|
...backdropAttributes,
|
|
@@ -99,6 +99,8 @@ export declare const update: (model: {
|
|
|
99
99
|
readonly _tag: "CompletedClickItem";
|
|
100
100
|
} | {
|
|
101
101
|
readonly _tag: "CompletedAnchorMount";
|
|
102
|
+
} | {
|
|
103
|
+
readonly _tag: "CompletedBackdropPortal";
|
|
102
104
|
} | {
|
|
103
105
|
readonly _tag: "Opened";
|
|
104
106
|
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
@@ -158,9 +160,9 @@ export declare const close: (model: Model) => readonly [Model, ReadonlyArray<Com
|
|
|
158
160
|
* focus commands. Use this in domain-event handlers when the combobox uses `onSelectedItem`. */
|
|
159
161
|
export declare const selectItem: (model: Model, item: string, displayText: string) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
160
162
|
/** Configuration for rendering a single-select combobox with `view`. */
|
|
161
|
-
export type ViewConfig<
|
|
163
|
+
export type ViewConfig<ParentMessage, Item extends string> = BaseViewConfig<ParentMessage, Item, Model>;
|
|
162
164
|
/** Renders a headless single-select combobox with keyboard navigation, selection tracking, and aria-activedescendant focus management. */
|
|
163
|
-
export declare const view: <
|
|
165
|
+
export declare const view: <ParentMessage, Item extends string>(config: Readonly<{
|
|
164
166
|
model: {
|
|
165
167
|
readonly id: string;
|
|
166
168
|
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
@@ -190,8 +192,10 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
|
|
|
190
192
|
readonly _tag: "CompletedAttachPreventBlur";
|
|
191
193
|
} | {
|
|
192
194
|
readonly _tag: "CompletedAttachSelectOnFocus";
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
+
} | {
|
|
196
|
+
readonly _tag: "CompletedBackdropPortal";
|
|
197
|
+
}) => ParentMessage;
|
|
198
|
+
onSelectedItem?: (value: string) => ParentMessage;
|
|
195
199
|
items: readonly Item[];
|
|
196
200
|
itemToConfig: (item: Item, context: Readonly<{
|
|
197
201
|
isActive: boolean;
|
|
@@ -205,21 +209,21 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
|
|
|
205
209
|
itemToDisplayText: (item: Item, index: number) => string;
|
|
206
210
|
isItemDisabled?: (item: Item, index: number) => boolean;
|
|
207
211
|
inputClassName?: string;
|
|
208
|
-
inputAttributes?: readonly import("../../html/index.js").Attribute<
|
|
212
|
+
inputAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
209
213
|
inputPlaceholder?: string;
|
|
210
214
|
inputWrapperClassName?: string;
|
|
211
|
-
inputWrapperAttributes?: readonly import("../../html/index.js").Attribute<
|
|
215
|
+
inputWrapperAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
212
216
|
itemsClassName?: string;
|
|
213
|
-
itemsAttributes?: readonly import("../../html/index.js").Attribute<
|
|
217
|
+
itemsAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
214
218
|
itemsScrollClassName?: string;
|
|
215
|
-
itemsScrollAttributes?: readonly import("../../html/index.js").Attribute<
|
|
219
|
+
itemsScrollAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
216
220
|
backdropClassName?: string;
|
|
217
|
-
backdropAttributes?: readonly import("../../html/index.js").Attribute<
|
|
221
|
+
backdropAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
218
222
|
className?: string;
|
|
219
|
-
attributes?: readonly import("../../html/index.js").Attribute<
|
|
223
|
+
attributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
220
224
|
buttonContent?: Html;
|
|
221
225
|
buttonClassName?: string;
|
|
222
|
-
buttonAttributes?: readonly import("../../html/index.js").Attribute<
|
|
226
|
+
buttonAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
223
227
|
formName?: string;
|
|
224
228
|
isDisabled?: boolean;
|
|
225
229
|
isInvalid?: boolean;
|
|
@@ -230,9 +234,9 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
|
|
|
230
234
|
className?: string;
|
|
231
235
|
}> | undefined;
|
|
232
236
|
groupClassName?: string;
|
|
233
|
-
groupAttributes?: readonly import("../../html/index.js").Attribute<
|
|
237
|
+
groupAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
234
238
|
separatorClassName?: string;
|
|
235
|
-
separatorAttributes?: readonly import("../../html/index.js").Attribute<
|
|
239
|
+
separatorAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
236
240
|
anchor?: Readonly<{
|
|
237
241
|
placement?: import("@floating-ui/dom").Placement;
|
|
238
242
|
gap?: number;
|
|
@@ -243,5 +247,5 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
|
|
|
243
247
|
}>) => Html;
|
|
244
248
|
/** Creates a memoized single-select combobox view. Static config is captured in a closure;
|
|
245
249
|
* only `model` and `toParentMessage` are compared per render via `createLazy`. */
|
|
246
|
-
export declare const lazy: <
|
|
250
|
+
export declare const lazy: <ParentMessage, Item extends string>(staticConfig: Omit<ViewConfig<ParentMessage, Item>, "model" | "toParentMessage" | "onSelectedItem">) => ((model: Model, toParentMessage: BaseViewConfig<ParentMessage, Item, Model>["toParentMessage"]) => Html);
|
|
247
251
|
//# sourceMappingURL=single.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/single.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,IAAI,CAAC,EAAQ,MAAM,QAAQ,CAAA;AAEzD,OAAO,KAAK,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,qBAAqB,CAAA;AAE3D,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAA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EAAE,cAAc,CAC7B,aAAa,EACb,IAAI,EACJ,KAAK,CACN,CAAC,iBAAiB,CAAC,KACjB,IAAI,CAoBR,CAAA"}
|
|
@@ -71,9 +71,9 @@ export const view = makeView({
|
|
|
71
71
|
* only `model` and `toParentMessage` are compared per render via `createLazy`. */
|
|
72
72
|
export const lazy = (staticConfig) => {
|
|
73
73
|
const lazyView = createLazy();
|
|
74
|
-
return (model, toParentMessage) => lazyView((currentModel,
|
|
74
|
+
return (model, toParentMessage) => lazyView((currentModel, currentToParentMessage) => view({
|
|
75
75
|
...staticConfig,
|
|
76
76
|
model: currentModel,
|
|
77
|
-
toParentMessage:
|
|
77
|
+
toParentMessage: currentToParentMessage,
|
|
78
78
|
}), [model, toParentMessage]);
|
|
79
79
|
};
|
|
@@ -105,7 +105,7 @@ export declare const GotPopoverMessage: import("../../schema/index.js").Callable
|
|
|
105
105
|
message: S.Union<[import("../../schema/index.js").CallableTaggedStruct<"Opened", {}>, import("../../schema/index.js").CallableTaggedStruct<"Closed", {}>, import("../../schema/index.js").CallableTaggedStruct<"BlurredPanel", {}>, import("../../schema/index.js").CallableTaggedStruct<"PressedPointerOnButton", {
|
|
106
106
|
pointerType: S.String;
|
|
107
107
|
button: S.Number;
|
|
108
|
-
}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusPanel", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusButton", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedLockScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedUnlockScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedSetupInert", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedTeardownInert", {}>, import("../../schema/index.js").CallableTaggedStruct<"IgnoredMouseClick", {}>, import("../../schema/index.js").CallableTaggedStruct<"SuppressedSpaceScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedAnchorMount", {}>, import("../../schema/index.js").CallableTaggedStruct<"GotAnimationMessage", {
|
|
108
|
+
}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusPanel", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusButton", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedLockScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedUnlockScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedSetupInert", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedTeardownInert", {}>, import("../../schema/index.js").CallableTaggedStruct<"IgnoredMouseClick", {}>, import("../../schema/index.js").CallableTaggedStruct<"SuppressedSpaceScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedAnchorMount", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedBackdropPortal", {}>, import("../../schema/index.js").CallableTaggedStruct<"GotAnimationMessage", {
|
|
109
109
|
message: S.Union<[import("../../schema/index.js").CallableTaggedStruct<"Showed", {}>, import("../../schema/index.js").CallableTaggedStruct<"Hid", {}>, import("../../schema/index.js").CallableTaggedStruct<"AdvancedAnimationFrame", {}>, import("../../schema/index.js").CallableTaggedStruct<"EndedAnimation", {}>]>;
|
|
110
110
|
}>]>;
|
|
111
111
|
}>;
|
|
@@ -264,9 +264,9 @@ export const view = (config) => {
|
|
|
264
264
|
* only `model` and `toParentMessage` are compared per render via `createLazy`. */
|
|
265
265
|
export const lazy = (staticConfig) => {
|
|
266
266
|
const lazyView = createLazy();
|
|
267
|
-
return (model, toParentMessage) => lazyView((currentModel,
|
|
267
|
+
return (model, toParentMessage) => lazyView((currentModel, currentToParentMessage) => view({
|
|
268
268
|
...staticConfig,
|
|
269
269
|
model: currentModel,
|
|
270
|
-
toParentMessage:
|
|
270
|
+
toParentMessage: currentToParentMessage,
|
|
271
271
|
}), [model, toParentMessage]);
|
|
272
272
|
};
|
|
@@ -64,17 +64,17 @@ export declare const titleId: (model: Model) => string;
|
|
|
64
64
|
/** Returns the ID used for `aria-describedby` on the dialog. Apply this to your description element. */
|
|
65
65
|
export declare const descriptionId: (model: Model) => string;
|
|
66
66
|
/** Configuration for rendering a dialog with `view`. */
|
|
67
|
-
export type ViewConfig<
|
|
67
|
+
export type ViewConfig<ParentMessage> = Readonly<{
|
|
68
68
|
model: Model;
|
|
69
|
-
toParentMessage: (message: Closed | CompletedShowDialog | CompletedCloseDialog) =>
|
|
70
|
-
onClosed?: () =>
|
|
69
|
+
toParentMessage: (message: Closed | CompletedShowDialog | CompletedCloseDialog) => ParentMessage;
|
|
70
|
+
onClosed?: () => ParentMessage;
|
|
71
71
|
panelContent: Html;
|
|
72
72
|
panelClassName?: string;
|
|
73
|
-
panelAttributes?: ReadonlyArray<Attribute<
|
|
73
|
+
panelAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
74
74
|
backdropClassName?: string;
|
|
75
|
-
backdropAttributes?: ReadonlyArray<Attribute<
|
|
75
|
+
backdropAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
76
76
|
className?: string;
|
|
77
|
-
attributes?: ReadonlyArray<Attribute<
|
|
77
|
+
attributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
78
78
|
}>;
|
|
79
79
|
/** Programmatically opens the dialog, updating the model and returning
|
|
80
80
|
* show commands. Use this in domain-event handlers to open the dialog. */
|
|
@@ -83,12 +83,12 @@ export declare const open: (model: Model) => readonly [Model, ReadonlyArray<Comm
|
|
|
83
83
|
* close commands. Use this in domain-event handlers when the dialog uses `onClosed`. */
|
|
84
84
|
export declare const close: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
85
85
|
/** Renders a headless dialog component backed by the native `<dialog>` element with `showModal()`. */
|
|
86
|
-
export declare const view: <
|
|
86
|
+
export declare const view: <ParentMessage>(config: ViewConfig<ParentMessage>) => Html;
|
|
87
87
|
/** Creates a memoized dialog view. Static config (className, panelClassName,
|
|
88
88
|
* etc.) is captured in a closure. Dynamic fields — `model`, `toParentMessage`,
|
|
89
89
|
* and `panelContent` — are compared by reference per render via `createLazy`.
|
|
90
90
|
* When any of them change, the view re-renders; otherwise the cached VNode is
|
|
91
91
|
* reused and snabbdom skips the entire subtree. */
|
|
92
|
-
export declare const lazy: <
|
|
92
|
+
export declare const lazy: <ParentMessage>(staticConfig: Omit<ViewConfig<ParentMessage>, "model" | "toParentMessage" | "onClosed" | "panelContent">) => ((model: Model, toParentMessage: ViewConfig<ParentMessage>["toParentMessage"], panelContent: Html) => Html);
|
|
93
93
|
export {};
|
|
94
94
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhE,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EAGV,MAAM,qBAAqB,CAAA;AAsB5B,6IAA6I;AAC7I,eAAO,MAAM,KAAK;;;;;;;;;;EAMhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,wEAAwE;AACxE,eAAO,MAAM,MAAM,oEAAc,CAAA;AACjC,wHAAwH;AACxH,eAAO,MAAM,MAAM,oEAAc,CAAA;AACjC,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,iFAA2B,CAAA;AAC3D,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,kFAA4B,CAAA;AAC7D,0DAA0D;AAC1D,eAAO,MAAM,mBAAmB;;EAE9B,CAAA;AAEF,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,KAAK,CAC3B;IACE,OAAO,MAAM;IACb,OAAO,MAAM;IACb,OAAO,mBAAmB;IAC1B,OAAO,oBAAoB;IAC3B,OAAO,mBAAmB;CAC3B,CAOD,CAAA;AAEF,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM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S,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAClC,CAAA;AAEzB;yFACyF;AACzF,eAAO,MAAM,KAAK,GAChB,OAAO,KAAK,KACX,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAClC,CAAA;AAEzB,sGAAsG;AACtG,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,QAAQ,UAAU,CAAC,aAAa,CAAC,KAChC,IA8GF,CAAA;AAED;;;;oDAIoD;AACpD,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,cAAc,IAAI,CAChB,UAAU,CAAC,aAAa,CAAC,EACzB,OAAO,GAAG,iBAAiB,GAAG,UAAU,GAAG,cAAc,CAC1D,KACA,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,iBAAiB,CAAC,EAC7D,YAAY,EAAE,IAAI,KACf,IAAI,CAkBR,CAAA"}
|
package/dist/ui/dialog/index.js
CHANGED
|
@@ -189,10 +189,10 @@ export const view = (config) => {
|
|
|
189
189
|
* reused and snabbdom skips the entire subtree. */
|
|
190
190
|
export const lazy = (staticConfig) => {
|
|
191
191
|
const lazyView = createLazy();
|
|
192
|
-
return (model, toParentMessage, panelContent) => lazyView((currentModel,
|
|
192
|
+
return (model, toParentMessage, panelContent) => lazyView((currentModel, currentToParentMessage, currentPanelContent) => view({
|
|
193
193
|
...staticConfig,
|
|
194
194
|
model: currentModel,
|
|
195
|
-
toParentMessage:
|
|
195
|
+
toParentMessage: currentToParentMessage,
|
|
196
196
|
panelContent: currentPanelContent,
|
|
197
197
|
}), [model, toParentMessage, panelContent]);
|
|
198
198
|
};
|
|
@@ -37,22 +37,22 @@ export declare const FocusButton: Command.CommandDefinition<"FocusButton", {
|
|
|
37
37
|
/** Processes a disclosure message and returns the next model and commands. */
|
|
38
38
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
39
39
|
/** Configuration for rendering a disclosure with `view`. */
|
|
40
|
-
export type ViewConfig<
|
|
40
|
+
export type ViewConfig<ParentMessage> = Readonly<{
|
|
41
41
|
model: Model;
|
|
42
|
-
toParentMessage: (message: Toggled | Closed | CompletedFocusButton) =>
|
|
43
|
-
onToggled?: () =>
|
|
42
|
+
toParentMessage: (message: Toggled | Closed | CompletedFocusButton) => ParentMessage;
|
|
43
|
+
onToggled?: () => ParentMessage;
|
|
44
44
|
buttonClassName?: string;
|
|
45
|
-
buttonAttributes?: ReadonlyArray<Attribute<
|
|
45
|
+
buttonAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
46
46
|
buttonContent: Html;
|
|
47
47
|
panelClassName?: string;
|
|
48
|
-
panelAttributes?: ReadonlyArray<Attribute<
|
|
48
|
+
panelAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
49
49
|
panelContent: Html;
|
|
50
50
|
isDisabled?: boolean;
|
|
51
51
|
persistPanel?: boolean;
|
|
52
52
|
buttonElement?: TagName;
|
|
53
53
|
panelElement?: TagName;
|
|
54
54
|
className?: string;
|
|
55
|
-
attributes?: ReadonlyArray<Attribute<
|
|
55
|
+
attributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
56
56
|
}>;
|
|
57
57
|
/** Programmatically toggles the disclosure, updating the model and returning
|
|
58
58
|
* focus commands. Use this in domain-event handlers when the disclosure uses `onToggled`. */
|
|
@@ -61,8 +61,8 @@ export declare const toggle: (model: Model) => readonly [Model, ReadonlyArray<Co
|
|
|
61
61
|
* focus commands. Use this in domain-event handlers to close the disclosure. */
|
|
62
62
|
export declare const close: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
63
63
|
/** Renders a headless disclosure component with accessible ARIA attributes and keyboard support. */
|
|
64
|
-
export declare const view: <
|
|
64
|
+
export declare const view: <ParentMessage>(config: ViewConfig<ParentMessage>) => Html;
|
|
65
65
|
/** Creates a memoized disclosure view. Static config is captured in a closure;
|
|
66
66
|
* only `model` and `toParentMessage` are compared per render via `createLazy`. */
|
|
67
|
-
export declare const lazy: <
|
|
67
|
+
export declare const lazy: <ParentMessage>(staticConfig: Omit<ViewConfig<ParentMessage>, "model" | "toParentMessage" | "onToggled">) => ((model: Model, toParentMessage: ViewConfig<ParentMessage>["toParentMessage"]) => Html);
|
|
68
68
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/disclosure/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhE,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,OAAO,EAGb,MAAM,qBAAqB,CAAA;AAO5B,kGAAkG;AAClG,eAAO,MAAM,KAAK;;;EAGhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,iFAAiF;AACjF,eAAO,MAAM,OAAO,qEAAe,CAAA;AACnC,gFAAgF;AAChF,eAAO,MAAM,MAAM,oEAAc,CAAA;AACjC,kEAAkE;AAClE,eAAO,MAAM,oBAAoB,kFAA4B,CAAA;AAE7D,kEAAkE;AAClE,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,KAAK,CAC3B;IAAC,OAAO,OAAO;IAAE,OAAO,MAAM;IAAE,OAAO,oBAAoB;CAAC,CACV,CAAA;AAEpD,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AACzC,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AACvC,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAC,IAAI,CAAA;AAEnE,MAAM,MAAM,OAAO,GAAG,OAAO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;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;CACrD,CAAC,CAAA;AAEF;8FAC8F;AAC9F,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,KACX,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CACjC,CAAA;AAE1B;iFACiF;AACjF,eAAO,MAAM,KAAK,GAChB,OAAO,KAAK,KACX,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAClC,CAAA;AAEzB,oGAAoG;AACpG,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,QAAQ,UAAU,CAAC,aAAa,CAAC,KAChC,IAyGF,CAAA;AAED;mFACmF;AACnF,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,cAAc,IAAI,CAChB,UAAU,CAAC,aAAa,CAAC,EACzB,OAAO,GAAG,iBAAiB,GAAG,WAAW,CAC1C,KACA,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,iBAAiB,CAAC,KAC1D,IAAI,CAgBR,CAAA"}
|
|
@@ -105,9 +105,9 @@ export const view = (config) => {
|
|
|
105
105
|
* only `model` and `toParentMessage` are compared per render via `createLazy`. */
|
|
106
106
|
export const lazy = (staticConfig) => {
|
|
107
107
|
const lazyView = createLazy();
|
|
108
|
-
return (model, toParentMessage) => lazyView((currentModel,
|
|
108
|
+
return (model, toParentMessage) => lazyView((currentModel, currentToParentMessage) => view({
|
|
109
109
|
...staticConfig,
|
|
110
110
|
model: currentModel,
|
|
111
|
-
toParentMessage:
|
|
111
|
+
toParentMessage: currentToParentMessage,
|
|
112
112
|
}), [model, toParentMessage]);
|
|
113
113
|
};
|
|
@@ -260,19 +260,19 @@ export declare const subscriptions: import("../../runtime/subscription.js").Subs
|
|
|
260
260
|
/** Messages the draggable view helper can dispatch. */
|
|
261
261
|
export type DraggableMessage = typeof PressedDraggable.Type | typeof ActivatedKeyboardDrag.Type;
|
|
262
262
|
/** Configuration for creating draggable attributes with `draggable`. */
|
|
263
|
-
export type DraggableConfig<
|
|
263
|
+
export type DraggableConfig<ParentMessage> = Readonly<{
|
|
264
264
|
model: Model;
|
|
265
|
-
toParentMessage: (message: DraggableMessage) =>
|
|
265
|
+
toParentMessage: (message: DraggableMessage) => ParentMessage;
|
|
266
266
|
itemId: string;
|
|
267
267
|
containerId: string;
|
|
268
268
|
index: number;
|
|
269
269
|
}>;
|
|
270
270
|
/** Returns attributes the parent attaches to a draggable element. Handles pointer-down, keyboard activation, and ARIA. */
|
|
271
|
-
export declare const draggable: <
|
|
271
|
+
export declare const draggable: <ParentMessage>(config: DraggableConfig<ParentMessage>) => ReadonlyArray<Attribute<ParentMessage>>;
|
|
272
272
|
/** Returns attributes the parent attaches to a droppable container element. */
|
|
273
|
-
export declare const droppable: <
|
|
273
|
+
export declare const droppable: <ParentMessage>(containerId: string, label?: string) => ReadonlyArray<Attribute<ParentMessage>>;
|
|
274
274
|
/** Returns attributes the parent attaches to a sortable item element. Typically combined with `draggable`. */
|
|
275
|
-
export declare const sortable: <
|
|
275
|
+
export declare const sortable: <ParentMessage>(itemId: string) => ReadonlyArray<Attribute<ParentMessage>>;
|
|
276
276
|
/** Returns positioning styles for the ghost element, or None when not dragging with a pointer. */
|
|
277
277
|
export declare const ghostStyle: (model: Model) => Option.Option<Record<string, string>>;
|
|
278
278
|
/** Returns true when the component is actively dragging (pointer or keyboard). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/dragAndDrop/index.ts"],"names":[],"mappings":"A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1B,OAAO,KAAK,KACX,MAAM,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,IAAI,CAUpC,CAAA"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { Attribute } from '../../html/index.js';
|
|
2
2
|
import type { Html } from '../../html/index.js';
|
|
3
3
|
/** Attribute groups the fieldset component provides to the consumer's `toView` callback. */
|
|
4
|
-
export type FieldsetAttributes<
|
|
5
|
-
fieldset: ReadonlyArray<Attribute<
|
|
6
|
-
legend: ReadonlyArray<Attribute<
|
|
7
|
-
description: ReadonlyArray<Attribute<
|
|
4
|
+
export type FieldsetAttributes<ParentMessage> = Readonly<{
|
|
5
|
+
fieldset: ReadonlyArray<Attribute<ParentMessage>>;
|
|
6
|
+
legend: ReadonlyArray<Attribute<ParentMessage>>;
|
|
7
|
+
description: ReadonlyArray<Attribute<ParentMessage>>;
|
|
8
8
|
}>;
|
|
9
9
|
/** Configuration for rendering a fieldset with `view`. */
|
|
10
|
-
export type ViewConfig<
|
|
10
|
+
export type ViewConfig<ParentMessage> = Readonly<{
|
|
11
11
|
id: string;
|
|
12
|
-
toView: (attributes: FieldsetAttributes<
|
|
12
|
+
toView: (attributes: FieldsetAttributes<ParentMessage>) => Html;
|
|
13
13
|
isDisabled?: boolean;
|
|
14
14
|
}>;
|
|
15
15
|
/** Generates the legend element ID from the fieldset's base ID. */
|
|
@@ -17,5 +17,5 @@ export declare const legendId: (id: string) => string;
|
|
|
17
17
|
/** Generates the description element ID from the fieldset's base ID. */
|
|
18
18
|
export declare const descriptionId: (id: string) => string;
|
|
19
19
|
/** Renders an accessible fieldset by building ARIA attribute groups and delegating layout to the consumer's `toView` callback. */
|
|
20
|
-
export declare const view: <
|
|
20
|
+
export declare const view: <ParentMessage>(config: ViewConfig<ParentMessage>) => Html;
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/fieldset/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAI/C,4FAA4F;AAC5F,MAAM,MAAM,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/fieldset/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAI/C,4FAA4F;AAC5F,MAAM,MAAM,kBAAkB,CAAC,aAAa,IAAI,QAAQ,CAAC;IACvD,QAAQ,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;IACjD,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;IAC/C,WAAW,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;CACrD,CAAC,CAAA;AAEF,0DAA0D;AAC1D,MAAM,MAAM,UAAU,CAAC,aAAa,IAAI,QAAQ,CAAC;IAC/C,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,CAAC,UAAU,EAAE,kBAAkB,CAAC,aAAa,CAAC,KAAK,IAAI,CAAA;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC,CAAA;AAEF,mEAAmE;AACnE,eAAO,MAAM,QAAQ,GAAI,IAAI,MAAM,KAAG,MAAwB,CAAA;AAE9D,wEAAwE;AACxE,eAAO,MAAM,aAAa,GAAI,IAAI,MAAM,KAAG,MAA6B,CAAA;AAExE,kIAAkI;AAClI,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,QAAQ,UAAU,CAAC,aAAa,CAAC,KAChC,IAwBF,CAAA"}
|