foldkit 0.83.0 → 0.85.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 +50 -5
- 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/task/dom.d.ts +11 -7
- package/dist/task/dom.d.ts.map +1 -1
- package/dist/task/dom.js +11 -7
- 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 +43 -0
- package/dist/test/internal.d.ts.map +1 -1
- package/dist/test/internal.js +93 -0
- package/dist/test/scene.d.ts +40 -14
- package/dist/test/scene.d.ts.map +1 -1
- package/dist/test/scene.js +195 -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/combobox/multi.d.ts +10 -10
- 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 +41 -15
- package/dist/ui/combobox/shared.d.ts.map +1 -1
- package/dist/ui/combobox/shared.js +45 -32
- package/dist/ui/combobox/single.d.ts +10 -10
- package/dist/ui/datePicker/index.d.ts +1 -1
- package/dist/ui/listbox/multi.d.ts +4 -8
- package/dist/ui/listbox/multi.d.ts.map +1 -1
- 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 +20 -12
- package/dist/ui/listbox/shared.d.ts.map +1 -1
- package/dist/ui/listbox/shared.js +26 -35
- package/dist/ui/listbox/single.d.ts +4 -8
- package/dist/ui/listbox/single.d.ts.map +1 -1
- package/dist/ui/menu/index.d.ts +18 -8
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +30 -35
- 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 +18 -5
- package/dist/ui/popover/index.d.ts.map +1 -1
- package/dist/ui/popover/index.js +25 -19
- 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/tooltip/index.d.ts +10 -3
- package/dist/ui/tooltip/index.d.ts.map +1 -1
- package/dist/ui/tooltip/index.js +13 -10
- 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/package.json +9 -1
package/dist/ui/menu/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { 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
|
import { resolveTypeaheadMatch } from '../typeahead.js';
|
|
@@ -95,11 +96,9 @@ export declare const IgnoredMouseClick: import("../../schema/index.js").Callable
|
|
|
95
96
|
/** Sent when a Space key-up is captured to prevent page scrolling. */
|
|
96
97
|
export declare const SuppressedSpaceScroll: import("../../schema/index.js").CallableTaggedStruct<"SuppressedSpaceScroll", {}>;
|
|
97
98
|
/** Sent when the menu items panel mounts and Floating UI has positioned it. Update no-ops; the side effect is the act of positioning, surfaced for DevTools observability. */
|
|
98
|
-
export declare const
|
|
99
|
-
/** Sent when the menu items panel mounts and the no-anchor focus fallback runs. Update no-ops; the side effect is the focus call, surfaced for DevTools observability. */
|
|
100
|
-
export declare const CompletedFocusItemsOnMount: import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusItemsOnMount", {}>;
|
|
99
|
+
export declare const CompletedAnchorMenu: import("../../schema/index.js").CallableTaggedStruct<"CompletedAnchorMenu", {}>;
|
|
101
100
|
/** Sent when the menu backdrop mounts and is portaled to the document body. Update no-ops; surfaces the portal side effect for DevTools. */
|
|
102
|
-
export declare const
|
|
101
|
+
export declare const CompletedPortalMenuBackdrop: import("../../schema/index.js").CallableTaggedStruct<"CompletedPortalMenuBackdrop", {}>;
|
|
103
102
|
/** Wraps an Animation submodel message for delegation. */
|
|
104
103
|
export declare const GotAnimationMessage: import("../../schema/index.js").CallableTaggedStruct<"GotAnimationMessage", {
|
|
105
104
|
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", {}>]>;
|
|
@@ -141,9 +140,8 @@ export declare const Message: S.Union<[
|
|
|
141
140
|
typeof CompletedAdvanceFocus,
|
|
142
141
|
typeof IgnoredMouseClick,
|
|
143
142
|
typeof SuppressedSpaceScroll,
|
|
144
|
-
typeof
|
|
145
|
-
typeof
|
|
146
|
-
typeof CompletedBackdropPortal,
|
|
143
|
+
typeof CompletedAnchorMenu,
|
|
144
|
+
typeof CompletedPortalMenuBackdrop,
|
|
147
145
|
typeof GotAnimationMessage,
|
|
148
146
|
typeof PressedPointerOnButton,
|
|
149
147
|
typeof ReleasedPointerOnItems
|
|
@@ -224,6 +222,18 @@ export declare const DetectMovementOrAnimationEnd: Command.CommandDefinition<"De
|
|
|
224
222
|
}>;
|
|
225
223
|
/** Processes a menu message and returns the next model and commands. */
|
|
226
224
|
export declare const update: (model: Model, message: Message) => UpdateReturn;
|
|
225
|
+
/** The anchor-positioning Mount this Menu renders on its panel. Exposed so
|
|
226
|
+
* Scene tests can call `Scene.Mount.resolve(AnchorMenu, CompletedAnchorMenu())`
|
|
227
|
+
* to acknowledge the mount produced by the rendered panel. */
|
|
228
|
+
export declare const AnchorMenu: Mount.MountDefinition<"AnchorMenu", {
|
|
229
|
+
readonly _tag: "CompletedAnchorMenu";
|
|
230
|
+
}>;
|
|
231
|
+
/** The backdrop-portaling Mount this Menu renders. Exposed so Scene tests can
|
|
232
|
+
* call `Scene.Mount.resolve(PortalMenuBackdrop, CompletedPortalMenuBackdrop())` to
|
|
233
|
+
* acknowledge the mount produced by the rendered backdrop. */
|
|
234
|
+
export declare const PortalMenuBackdrop: Mount.MountDefinition<"PortalMenuBackdrop", {
|
|
235
|
+
readonly _tag: "CompletedPortalMenuBackdrop";
|
|
236
|
+
}>;
|
|
227
237
|
/** Programmatically opens the menu, updating the model and returning
|
|
228
238
|
* focus and modal commands. Use this in domain-event handlers to open the menu. */
|
|
229
239
|
export declare const open: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
@@ -246,7 +256,7 @@ export type GroupHeading = Readonly<{
|
|
|
246
256
|
/** Configuration for rendering a menu with `view`. */
|
|
247
257
|
export type ViewConfig<ParentMessage, Item extends string> = Readonly<{
|
|
248
258
|
model: Model;
|
|
249
|
-
toParentMessage: (message: Opened | Closed | BlurredItems | ActivatedItem | DeactivatedItem | SelectedItem | MovedPointerOverItem | RequestedItemClick | Searched | PressedPointerOnButton | ReleasedPointerOnItems | IgnoredMouseClick | SuppressedSpaceScroll | typeof
|
|
259
|
+
toParentMessage: (message: Opened | Closed | BlurredItems | ActivatedItem | DeactivatedItem | SelectedItem | MovedPointerOverItem | RequestedItemClick | Searched | PressedPointerOnButton | ReleasedPointerOnItems | IgnoredMouseClick | SuppressedSpaceScroll | typeof CompletedAnchorMenu.Type | typeof CompletedPortalMenuBackdrop.Type) => ParentMessage;
|
|
250
260
|
onSelectedItem?: (index: number) => ParentMessage;
|
|
251
261
|
items: ReadonlyArray<Item>;
|
|
252
262
|
itemToConfig: (item: Item, context: Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,MAAM,IAAI,CAAC,EAGZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAEjD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EAIV,MAAM,qBAAqB,CAAA;AAE5B,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAA;AAI7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAchD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAM7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAIvD,6FAA6F;AAC7F,eAAO,MAAM,iBAAiB,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G,iBAAiB,GAAG,gBAAgB,CAC/C,KACA,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,iBAAiB,CAAC,KAChE,IAAI,CAmBR,CAAA"}
|
package/dist/ui/menu/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Array, Effect, Equal,
|
|
1
|
+
import { Array, Effect, Equal, Match as M, Option, Predicate, Schema as S, String as Str, pipe, } from 'effect';
|
|
2
2
|
import * as Command from '../../command/index.js';
|
|
3
3
|
import { OptionExt } from '../../effectExtensions/index.js';
|
|
4
4
|
import { createLazy, html, } from '../../html/index.js';
|
|
@@ -96,11 +96,9 @@ export const IgnoredMouseClick = m('IgnoredMouseClick');
|
|
|
96
96
|
/** Sent when a Space key-up is captured to prevent page scrolling. */
|
|
97
97
|
export const SuppressedSpaceScroll = m('SuppressedSpaceScroll');
|
|
98
98
|
/** Sent when the menu items panel mounts and Floating UI has positioned it. Update no-ops; the side effect is the act of positioning, surfaced for DevTools observability. */
|
|
99
|
-
export const
|
|
100
|
-
/** Sent when the menu items panel mounts and the no-anchor focus fallback runs. Update no-ops; the side effect is the focus call, surfaced for DevTools observability. */
|
|
101
|
-
export const CompletedFocusItemsOnMount = m('CompletedFocusItemsOnMount');
|
|
99
|
+
export const CompletedAnchorMenu = m('CompletedAnchorMenu');
|
|
102
100
|
/** Sent when the menu backdrop mounts and is portaled to the document body. Update no-ops; surfaces the portal side effect for DevTools. */
|
|
103
|
-
export const
|
|
101
|
+
export const CompletedPortalMenuBackdrop = m('CompletedPortalMenuBackdrop');
|
|
104
102
|
/** Wraps an Animation submodel message for delegation. */
|
|
105
103
|
export const GotAnimationMessage = m('GotAnimationMessage', {
|
|
106
104
|
message: AnimationMessage,
|
|
@@ -142,9 +140,8 @@ export const Message = S.Union([
|
|
|
142
140
|
CompletedAdvanceFocus,
|
|
143
141
|
IgnoredMouseClick,
|
|
144
142
|
SuppressedSpaceScroll,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
CompletedBackdropPortal,
|
|
143
|
+
CompletedAnchorMenu,
|
|
144
|
+
CompletedPortalMenuBackdrop,
|
|
148
145
|
GotAnimationMessage,
|
|
149
146
|
PressedPointerOnButton,
|
|
150
147
|
ReleasedPointerOnItems,
|
|
@@ -234,7 +231,11 @@ export const update = (model, message) => {
|
|
|
234
231
|
]).pipe(Effect.as(CompletedSetupInert()))));
|
|
235
232
|
const maybeRestoreInert = OptionExt.when(model.isModal, RestoreInert(Task.restoreInert(model.id).pipe(Effect.as(CompletedTeardownInert()))));
|
|
236
233
|
const focusButton = FocusButton(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton())));
|
|
237
|
-
const
|
|
234
|
+
const focusItems = FocusItems(Task.focus(itemsSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusItems())));
|
|
235
|
+
const openCommands = [
|
|
236
|
+
...Array.getSomes([maybeLockScroll, maybeInertOthers]),
|
|
237
|
+
focusItems,
|
|
238
|
+
];
|
|
238
239
|
const closeWithFocusCommands = [
|
|
239
240
|
focusButton,
|
|
240
241
|
...Array.getSomes([maybeUnlockScroll, maybeRestoreInert]),
|
|
@@ -395,27 +396,22 @@ export const update = (model, message) => {
|
|
|
395
396
|
[],
|
|
396
397
|
],
|
|
397
398
|
SuppressedSpaceScroll: () => [model, []],
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
CompletedBackdropPortal: () => [model, []],
|
|
399
|
+
CompletedAnchorMenu: () => [model, []],
|
|
400
|
+
CompletedPortalMenuBackdrop: () => [model, []],
|
|
401
401
|
}));
|
|
402
402
|
};
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
};
|
|
403
|
+
/** The anchor-positioning Mount this Menu renders on its panel. Exposed so
|
|
404
|
+
* Scene tests can call `Scene.Mount.resolve(AnchorMenu, CompletedAnchorMenu())`
|
|
405
|
+
* to acknowledge the mount produced by the rendered panel. */
|
|
406
|
+
export const AnchorMenu = Mount.define('AnchorMenu', CompletedAnchorMenu);
|
|
407
|
+
/** The backdrop-portaling Mount this Menu renders. Exposed so Scene tests can
|
|
408
|
+
* call `Scene.Mount.resolve(PortalMenuBackdrop, CompletedPortalMenuBackdrop())` to
|
|
409
|
+
* acknowledge the mount produced by the rendered backdrop. */
|
|
410
|
+
export const PortalMenuBackdrop = Mount.define('PortalMenuBackdrop', CompletedPortalMenuBackdrop);
|
|
411
|
+
const portalMenuBackdrop = PortalMenuBackdrop((element) => Effect.sync(() => {
|
|
412
|
+
const cleanup = portalToBody(element);
|
|
413
|
+
return { message: CompletedPortalMenuBackdrop(), cleanup };
|
|
414
414
|
}));
|
|
415
|
-
const portalBackdropOnMount = MenuBackdropPortal((element) => Effect.sync(() => ({
|
|
416
|
-
message: CompletedBackdropPortal(),
|
|
417
|
-
cleanup: portalToBody(element),
|
|
418
|
-
})));
|
|
419
415
|
/** Programmatically opens the menu, updating the model and returning
|
|
420
416
|
* focus and modal commands. Use this in domain-event handlers to open the menu. */
|
|
421
417
|
export const open = (model) => update(model, Opened({ maybeActiveItemIndex: Option.none() }));
|
|
@@ -528,16 +524,15 @@ export const view = (config) => {
|
|
|
528
524
|
const anchorAttributes = anchor
|
|
529
525
|
? [
|
|
530
526
|
Style({ position: 'absolute', margin: '0', visibility: 'hidden' }),
|
|
531
|
-
OnMount(Mount.mapMessage(
|
|
532
|
-
|
|
533
|
-
cleanup: anchorSetup({
|
|
527
|
+
OnMount(Mount.mapMessage(AnchorMenu((items) => Effect.sync(() => {
|
|
528
|
+
const cleanup = anchorSetup({
|
|
534
529
|
buttonId: `${id}-button`,
|
|
535
530
|
anchor,
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
}))
|
|
531
|
+
})(items);
|
|
532
|
+
return { message: CompletedAnchorMenu(), cleanup };
|
|
533
|
+
})), toParentMessage)),
|
|
539
534
|
]
|
|
540
|
-
: [
|
|
535
|
+
: [];
|
|
541
536
|
const itemsContainerAttributes = [
|
|
542
537
|
Id(`${id}-items`),
|
|
543
538
|
Role('menu'),
|
|
@@ -629,7 +624,7 @@ export const view = (config) => {
|
|
|
629
624
|
});
|
|
630
625
|
};
|
|
631
626
|
const backdrop = keyed('div')(`${id}-backdrop`, [
|
|
632
|
-
OnMount(Mount.mapMessage(
|
|
627
|
+
OnMount(Mount.mapMessage(portalMenuBackdrop, toParentMessage)),
|
|
633
628
|
...(isLeaving ? [] : [OnClick(toParentMessage(Closed()))]),
|
|
634
629
|
...(backdropClassName ? [Class(backdropClassName)] : []),
|
|
635
630
|
...backdropAttributes,
|
package/dist/ui/menu/public.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { init, update, open, close, selectItem, view, lazy, Model, Message, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusItems, CompletedFocusButton, CompletedScrollIntoView, CompletedClickItem,
|
|
1
|
+
export { init, update, open, close, selectItem, view, lazy, Model, Message, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusItems, CompletedFocusButton, CompletedScrollIntoView, CompletedClickItem, CompletedAnchorMenu, CompletedPortalMenuBackdrop, AnchorMenu, PortalMenuBackdrop, ClearedSearch, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusItems, FocusButton, ScrollIntoView, ClickItem, DelayClearSearch, DetectMovementOrAnimationEnd, } from './index.js';
|
|
2
2
|
export type { ActivationTrigger, Opened, Closed, BlurredItems, ActivatedItem, DeactivatedItem, MovedPointerOverItem, RequestedItemClick, Searched, PressedPointerOnButton, ReleasedPointerOnItems, IgnoredMouseClick, SuppressedSpaceScroll, InitConfig, ViewConfig, ItemConfig, GroupHeading, } from './index.js';
|
|
3
3
|
export type { AnchorConfig } from '../anchor.js';
|
|
4
4
|
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/menu/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/menu/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,EAC3B,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,WAAW,EACX,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,iBAAiB,EACjB,MAAM,EACN,MAAM,EACN,YAAY,EACZ,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,QAAQ,EACR,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,GACb,MAAM,YAAY,CAAA;AAEnB,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA"}
|
package/dist/ui/menu/public.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { init, update, open, close, selectItem, view, lazy, Model, Message, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusItems, CompletedFocusButton, CompletedScrollIntoView, CompletedClickItem,
|
|
1
|
+
export { init, update, open, close, selectItem, view, lazy, Model, Message, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusItems, CompletedFocusButton, CompletedScrollIntoView, CompletedClickItem, CompletedAnchorMenu, CompletedPortalMenuBackdrop, AnchorMenu, PortalMenuBackdrop, ClearedSearch, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusItems, FocusButton, ScrollIntoView, ClickItem, DelayClearSearch, DetectMovementOrAnimationEnd, } from './index.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { 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
|
/** Schema for the popover component's state, tracking open/closed status and animation lifecycle. */
|
|
6
7
|
export declare const Model: S.Struct<{
|
|
@@ -45,9 +46,9 @@ export declare const IgnoredMouseClick: import("../../schema/index.js").Callable
|
|
|
45
46
|
/** Sent when a Space key-up is captured to prevent page scrolling. */
|
|
46
47
|
export declare const SuppressedSpaceScroll: import("../../schema/index.js").CallableTaggedStruct<"SuppressedSpaceScroll", {}>;
|
|
47
48
|
/** Sent when the popover panel mounts and Floating UI has positioned it. Update no-ops; the side effect is the act of positioning, surfaced for DevTools observability. */
|
|
48
|
-
export declare const
|
|
49
|
+
export declare const CompletedAnchorPopover: import("../../schema/index.js").CallableTaggedStruct<"CompletedAnchorPopover", {}>;
|
|
49
50
|
/** Sent when the popover backdrop mounts and is portaled to the document body. Update no-ops; surfaces the portal side effect for DevTools. */
|
|
50
|
-
export declare const
|
|
51
|
+
export declare const CompletedPortalPopoverBackdrop: import("../../schema/index.js").CallableTaggedStruct<"CompletedPortalPopoverBackdrop", {}>;
|
|
51
52
|
/** Wraps an Animation submodel message for delegation. */
|
|
52
53
|
export declare const GotAnimationMessage: import("../../schema/index.js").CallableTaggedStruct<"GotAnimationMessage", {
|
|
53
54
|
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", {}>]>;
|
|
@@ -66,8 +67,8 @@ export declare const Message: S.Union<[
|
|
|
66
67
|
typeof CompletedTeardownInert,
|
|
67
68
|
typeof IgnoredMouseClick,
|
|
68
69
|
typeof SuppressedSpaceScroll,
|
|
69
|
-
typeof
|
|
70
|
-
typeof
|
|
70
|
+
typeof CompletedAnchorPopover,
|
|
71
|
+
typeof CompletedPortalPopoverBackdrop,
|
|
71
72
|
typeof GotAnimationMessage
|
|
72
73
|
]>;
|
|
73
74
|
export type Opened = typeof Opened.Type;
|
|
@@ -126,6 +127,18 @@ export declare const DetectMovementOrAnimationEnd: Command.CommandDefinition<"De
|
|
|
126
127
|
}>;
|
|
127
128
|
/** Processes a popover message and returns the next model and commands. */
|
|
128
129
|
export declare const update: (model: Model, message: Message) => UpdateReturn;
|
|
130
|
+
/** The anchor-positioning Mount this Popover renders on its panel. Exposed so
|
|
131
|
+
* Scene tests can call `Scene.Mount.resolve(AnchorPopover, CompletedAnchorPopover())`
|
|
132
|
+
* to acknowledge the mount produced by the rendered panel. */
|
|
133
|
+
export declare const AnchorPopover: Mount.MountDefinition<"AnchorPopover", {
|
|
134
|
+
readonly _tag: "CompletedAnchorPopover";
|
|
135
|
+
}>;
|
|
136
|
+
/** The backdrop-portaling Mount this Popover renders. Exposed so Scene tests can
|
|
137
|
+
* call `Scene.Mount.resolve(PortalPopoverBackdrop, CompletedPortalPopoverBackdrop())` to
|
|
138
|
+
* acknowledge the mount produced by the rendered backdrop. */
|
|
139
|
+
export declare const PortalPopoverBackdrop: Mount.MountDefinition<"PortalPopoverBackdrop", {
|
|
140
|
+
readonly _tag: "CompletedPortalPopoverBackdrop";
|
|
141
|
+
}>;
|
|
129
142
|
/** Programmatically opens the popover, updating the model and returning
|
|
130
143
|
* focus and modal commands. Use this in domain-event handlers when the popover uses `onOpened`. */
|
|
131
144
|
export declare const open: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
@@ -135,7 +148,7 @@ export declare const close: (model: Model) => readonly [Model, ReadonlyArray<Com
|
|
|
135
148
|
/** Configuration for rendering a popover with `view`. */
|
|
136
149
|
export type ViewConfig<ParentMessage> = Readonly<{
|
|
137
150
|
model: Model;
|
|
138
|
-
toParentMessage: (message: Opened | Closed | BlurredPanel | PressedPointerOnButton | IgnoredMouseClick | SuppressedSpaceScroll | typeof
|
|
151
|
+
toParentMessage: (message: Opened | Closed | BlurredPanel | PressedPointerOnButton | IgnoredMouseClick | SuppressedSpaceScroll | typeof CompletedAnchorPopover.Type | typeof CompletedPortalPopoverBackdrop.Type) => ParentMessage;
|
|
139
152
|
onOpened?: () => ParentMessage;
|
|
140
153
|
onClosed?: () => ParentMessage;
|
|
141
154
|
anchor: AnchorConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/popover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE9E,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAEjD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EAIV,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui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a,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,aAAa,CAAA;IAC9B,QAAQ,CAAC,EAAE,MAAM,aAAa,CAAA;IAC9B,MAAM,EAAE,YAAY,CAAA;IACpB,aAAa,EAAE,IAAI,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;IAC1D,YAAY,EAAE,IAAI,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;IACzD,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,kBAAkB,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;IAC5D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;CACrD,CAAC,CAAA;AAEF,yKAAyK;AACzK,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,QAAQ,UAAU,CAAC,aAAa,CAAC,KAChC,IAsNF,CAAA;AAED;mFACmF;AACnF,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,cAAc,IAAI,CAChB,UAAU,CAAC,aAAa,CAAC,EACzB,OAAO,GAAG,iBAAiB,GAAG,UAAU,GAAG,UAAU,CACtD,KACA,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,iBAAiB,CAAC,KAC1D,IAAI,CAgBR,CAAA"}
|
package/dist/ui/popover/index.js
CHANGED
|
@@ -52,9 +52,9 @@ export const IgnoredMouseClick = m('IgnoredMouseClick');
|
|
|
52
52
|
/** Sent when a Space key-up is captured to prevent page scrolling. */
|
|
53
53
|
export const SuppressedSpaceScroll = m('SuppressedSpaceScroll');
|
|
54
54
|
/** Sent when the popover panel mounts and Floating UI has positioned it. Update no-ops; the side effect is the act of positioning, surfaced for DevTools observability. */
|
|
55
|
-
export const
|
|
55
|
+
export const CompletedAnchorPopover = m('CompletedAnchorPopover');
|
|
56
56
|
/** Sent when the popover backdrop mounts and is portaled to the document body. Update no-ops; surfaces the portal side effect for DevTools. */
|
|
57
|
-
export const
|
|
57
|
+
export const CompletedPortalPopoverBackdrop = m('CompletedPortalPopoverBackdrop');
|
|
58
58
|
/** Wraps an Animation submodel message for delegation. */
|
|
59
59
|
export const GotAnimationMessage = m('GotAnimationMessage', {
|
|
60
60
|
message: AnimationMessage,
|
|
@@ -73,8 +73,8 @@ export const Message = S.Union([
|
|
|
73
73
|
CompletedTeardownInert,
|
|
74
74
|
IgnoredMouseClick,
|
|
75
75
|
SuppressedSpaceScroll,
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
CompletedAnchorPopover,
|
|
77
|
+
CompletedPortalPopoverBackdrop,
|
|
78
78
|
GotAnimationMessage,
|
|
79
79
|
]);
|
|
80
80
|
// INIT
|
|
@@ -208,16 +208,22 @@ export const update = (model, message) => {
|
|
|
208
208
|
[],
|
|
209
209
|
],
|
|
210
210
|
SuppressedSpaceScroll: () => [model, []],
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
CompletedAnchorPopover: () => [model, []],
|
|
212
|
+
CompletedPortalPopoverBackdrop: () => [model, []],
|
|
213
213
|
}));
|
|
214
214
|
};
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
215
|
+
/** The anchor-positioning Mount this Popover renders on its panel. Exposed so
|
|
216
|
+
* Scene tests can call `Scene.Mount.resolve(AnchorPopover, CompletedAnchorPopover())`
|
|
217
|
+
* to acknowledge the mount produced by the rendered panel. */
|
|
218
|
+
export const AnchorPopover = Mount.define('AnchorPopover', CompletedAnchorPopover);
|
|
219
|
+
/** The backdrop-portaling Mount this Popover renders. Exposed so Scene tests can
|
|
220
|
+
* call `Scene.Mount.resolve(PortalPopoverBackdrop, CompletedPortalPopoverBackdrop())` to
|
|
221
|
+
* acknowledge the mount produced by the rendered backdrop. */
|
|
222
|
+
export const PortalPopoverBackdrop = Mount.define('PortalPopoverBackdrop', CompletedPortalPopoverBackdrop);
|
|
223
|
+
const portalPopoverBackdrop = PortalPopoverBackdrop((element) => Effect.sync(() => {
|
|
224
|
+
const cleanup = portalToBody(element);
|
|
225
|
+
return { message: CompletedPortalPopoverBackdrop(), cleanup };
|
|
226
|
+
}));
|
|
221
227
|
/** Programmatically opens the popover, updating the model and returning
|
|
222
228
|
* focus and modal commands. Use this in domain-event handlers when the popover uses `onOpened`. */
|
|
223
229
|
export const open = (model) => update(model, Opened());
|
|
@@ -288,19 +294,19 @@ export const view = (config) => {
|
|
|
288
294
|
...(buttonClassName ? [Class(buttonClassName)] : []),
|
|
289
295
|
...buttonAttributes,
|
|
290
296
|
];
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
cleanup: anchorSetup({
|
|
297
|
+
const anchorPopover = Mount.mapMessage(AnchorPopover((items) => Effect.sync(() => {
|
|
298
|
+
const cleanup = anchorSetup({
|
|
294
299
|
buttonId: `${id}-button`,
|
|
295
300
|
anchor,
|
|
296
301
|
interceptTab: false,
|
|
297
302
|
focusAfterPosition: true,
|
|
298
303
|
...(focusSelector !== undefined && { focusSelector }),
|
|
299
|
-
})(items)
|
|
300
|
-
|
|
304
|
+
})(items);
|
|
305
|
+
return { message: CompletedAnchorPopover(), cleanup };
|
|
306
|
+
})), toParentMessage);
|
|
301
307
|
const anchorAttributes = [
|
|
302
308
|
Style({ position: 'absolute', margin: '0', visibility: 'hidden' }),
|
|
303
|
-
OnMount(
|
|
309
|
+
OnMount(anchorPopover),
|
|
304
310
|
];
|
|
305
311
|
const resolvedPanelAttributes = [
|
|
306
312
|
Id(`${id}-panel`),
|
|
@@ -317,7 +323,7 @@ export const view = (config) => {
|
|
|
317
323
|
...panelAttributes,
|
|
318
324
|
];
|
|
319
325
|
const backdrop = keyed('div')(`${id}-backdrop`, [
|
|
320
|
-
OnMount(Mount.mapMessage(
|
|
326
|
+
OnMount(Mount.mapMessage(portalPopoverBackdrop, toParentMessage)),
|
|
321
327
|
...(isLeaving ? [] : [OnClick(dispatchClosed())]),
|
|
322
328
|
...(backdropClassName ? [Class(backdropClassName)] : []),
|
|
323
329
|
...backdropAttributes,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { init, update, open, close, view, lazy, Model, Message, Opened, Closed, CompletedFocusPanel, CompletedFocusButton, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert,
|
|
1
|
+
export { init, update, open, close, view, lazy, Model, Message, Opened, Closed, CompletedFocusPanel, CompletedFocusButton, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedAnchorPopover, CompletedPortalPopoverBackdrop, AnchorPopover, PortalPopoverBackdrop, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusPanel, FocusButton, DetectMovementOrAnimationEnd, } from './index.js';
|
|
2
2
|
export type { BlurredPanel, PressedPointerOnButton, IgnoredMouseClick, SuppressedSpaceScroll, InitConfig, ViewConfig, } from './index.js';
|
|
3
3
|
export type { AnchorConfig } from '../anchor.js';
|
|
4
4
|
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/popover/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/popover/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,WAAW,EACX,4BAA4B,GAC7B,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,UAAU,GACX,MAAM,YAAY,CAAA;AAEnB,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { init, update, open, close, view, lazy, Model, Message, Opened, Closed, CompletedFocusPanel, CompletedFocusButton, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert,
|
|
1
|
+
export { init, update, open, close, view, lazy, Model, Message, Opened, Closed, CompletedFocusPanel, CompletedFocusButton, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedAnchorPopover, CompletedPortalPopoverBackdrop, AnchorPopover, PortalPopoverBackdrop, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusPanel, FocusButton, DetectMovementOrAnimationEnd, } from './index.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Duration, 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
|
/** Schema for the tooltip component's state. `isOpen` is visibility; `isHovered` tracks pointer on trigger; `isFocused` tracks tooltip-affirming focus on the trigger (focus arriving without a preceding mouse press — keyboard, touch, or pen; mouse-click-induced focus is excluded since it doesn't affirm the user wants the tooltip visible); `isDismissed` suppresses re-opening after the user dismissed the tooltip (via Escape or left-click) until they disengage (leave or blur). `showDelay` is the hover-to-show duration. `maybeLastPointerType` records the most recent pointer type that pressed the trigger, so a mouse-click-induced focus can be distinguished from other focus. */
|
|
6
7
|
export declare const Model: S.Struct<{
|
|
@@ -38,7 +39,7 @@ export declare const ChangedShowDelay: import("../../schema/index.js").CallableT
|
|
|
38
39
|
showDelay: S.DurationFromMillis;
|
|
39
40
|
}>;
|
|
40
41
|
/** Sent when the tooltip panel mounts and Floating UI has positioned it. Update no-ops; the side effect is the act of positioning, surfaced for DevTools observability. */
|
|
41
|
-
export declare const
|
|
42
|
+
export declare const CompletedAnchorTooltip: import("../../schema/index.js").CallableTaggedStruct<"CompletedAnchorTooltip", {}>;
|
|
42
43
|
/** Union of all messages the tooltip component can produce. */
|
|
43
44
|
export declare const Message: S.Union<[
|
|
44
45
|
typeof EnteredTrigger,
|
|
@@ -49,7 +50,7 @@ export declare const Message: S.Union<[
|
|
|
49
50
|
typeof PressedPointerOnTrigger,
|
|
50
51
|
typeof ElapsedShowDelay,
|
|
51
52
|
typeof ChangedShowDelay,
|
|
52
|
-
typeof
|
|
53
|
+
typeof CompletedAnchorTooltip
|
|
53
54
|
]>;
|
|
54
55
|
export type EnteredTrigger = typeof EnteredTrigger.Type;
|
|
55
56
|
export type LeftTrigger = typeof LeftTrigger.Type;
|
|
@@ -71,6 +72,12 @@ export declare const ShowAfterDelay: Command.CommandDefinition<"ShowAfterDelay",
|
|
|
71
72
|
readonly _tag: "ElapsedShowDelay";
|
|
72
73
|
readonly version: number;
|
|
73
74
|
}>;
|
|
75
|
+
/** The anchor-positioning Mount this Tooltip renders on its panel. Exposed so
|
|
76
|
+
* Scene tests can call `Scene.Mount.resolve(AnchorTooltip, CompletedAnchorTooltip())`
|
|
77
|
+
* to acknowledge the mount produced by the rendered panel. */
|
|
78
|
+
export declare const AnchorTooltip: Mount.MountDefinition<"AnchorTooltip", {
|
|
79
|
+
readonly _tag: "CompletedAnchorTooltip";
|
|
80
|
+
}>;
|
|
74
81
|
/** Processes a tooltip message and returns the next model and commands. */
|
|
75
82
|
export declare const update: (model: Model, message: Message) => UpdateReturn;
|
|
76
83
|
/** Programmatically updates the tooltip's hover show-delay. Use this in response to user preference changes, input-method switches, or reduced-motion settings. The new delay applies to the next hover; any pending timer is unaffected (its stale version will discard harmlessly when it fires). */
|
|
@@ -78,7 +85,7 @@ export declare const setShowDelay: (model: Model, showDelay: Duration.Input) =>
|
|
|
78
85
|
/** Configuration for rendering a tooltip with `view`. */
|
|
79
86
|
export type ViewConfig<ParentMessage> = Readonly<{
|
|
80
87
|
model: Model;
|
|
81
|
-
toParentMessage: (message: EnteredTrigger | LeftTrigger | FocusedTrigger | BlurredTrigger | PressedEscape | PressedPointerOnTrigger | typeof
|
|
88
|
+
toParentMessage: (message: EnteredTrigger | LeftTrigger | FocusedTrigger | BlurredTrigger | PressedEscape | PressedPointerOnTrigger | typeof CompletedAnchorTooltip.Type) => ParentMessage;
|
|
82
89
|
anchor: AnchorConfig;
|
|
83
90
|
triggerContent: Html;
|
|
84
91
|
triggerClassName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMR,MAAM,IAAI,CAAC,EACZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAEjD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EAIV,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../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,KAAK,CAAA;IACZ,eAAe,EAAE,CACf,OAAO,EACH,cAAc,GACd,WAAW,GACX,cAAc,GACd,cAAc,GACd,aAAa,GACb,uBAAuB,GACvB,OAAO,sBAAsB,CAAC,IAAI,KACnC,aAAa,CAAA;IAClB,MAAM,EAAE,YAAY,CAAA;IACpB,cAAc,EAAE,IAAI,CAAA;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,iBAAiB,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;IAC3D,OAAO,EAAE,IAAI,CAAA;IACb,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;IACzD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;CACrD,CAAC,CAAA;AAEF,8SAA8S;AAC9S,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,QAAQ,UAAU,CAAC,aAAa,CAAC,KAChC,IAsHF,CAAA;AAED;mFACmF;AACnF,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,cAAc,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC,KACzE,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,iBAAiB,CAAC,KAC1D,IAAI,CAgBR,CAAA"}
|
package/dist/ui/tooltip/index.js
CHANGED
|
@@ -44,7 +44,7 @@ export const ChangedShowDelay = m('ChangedShowDelay', {
|
|
|
44
44
|
showDelay: S.DurationFromMillis,
|
|
45
45
|
});
|
|
46
46
|
/** Sent when the tooltip panel mounts and Floating UI has positioned it. Update no-ops; the side effect is the act of positioning, surfaced for DevTools observability. */
|
|
47
|
-
export const
|
|
47
|
+
export const CompletedAnchorTooltip = m('CompletedAnchorTooltip');
|
|
48
48
|
/** Union of all messages the tooltip component can produce. */
|
|
49
49
|
export const Message = S.Union([
|
|
50
50
|
EnteredTrigger,
|
|
@@ -55,7 +55,7 @@ export const Message = S.Union([
|
|
|
55
55
|
PressedPointerOnTrigger,
|
|
56
56
|
ElapsedShowDelay,
|
|
57
57
|
ChangedShowDelay,
|
|
58
|
-
|
|
58
|
+
CompletedAnchorTooltip,
|
|
59
59
|
]);
|
|
60
60
|
// INIT
|
|
61
61
|
const DEFAULT_SHOW_DELAY = Duration.millis(500);
|
|
@@ -76,7 +76,10 @@ export const init = (config) => ({
|
|
|
76
76
|
const withUpdateReturn = M.withReturnType();
|
|
77
77
|
/** Waits for the tooltip's show delay before emitting `ElapsedShowDelay`. The version is echoed back so a stale timer is ignored when the user leaves before the delay fires. */
|
|
78
78
|
export const ShowAfterDelay = Command.define('ShowAfterDelay', ElapsedShowDelay);
|
|
79
|
-
|
|
79
|
+
/** The anchor-positioning Mount this Tooltip renders on its panel. Exposed so
|
|
80
|
+
* Scene tests can call `Scene.Mount.resolve(AnchorTooltip, CompletedAnchorTooltip())`
|
|
81
|
+
* to acknowledge the mount produced by the rendered panel. */
|
|
82
|
+
export const AnchorTooltip = Mount.define('AnchorTooltip', CompletedAnchorTooltip);
|
|
80
83
|
/** Processes a tooltip message and returns the next model and commands. */
|
|
81
84
|
export const update = (model, message) => M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
|
|
82
85
|
EnteredTrigger: () => {
|
|
@@ -183,7 +186,7 @@ export const update = (model, message) => M.value(message).pipe(withUpdateReturn
|
|
|
183
186
|
evo(model, { showDelay: () => showDelay }),
|
|
184
187
|
[],
|
|
185
188
|
],
|
|
186
|
-
|
|
189
|
+
CompletedAnchorTooltip: () => [model, []],
|
|
187
190
|
}));
|
|
188
191
|
/** Programmatically updates the tooltip's hover show-delay. Use this in response to user preference changes, input-method switches, or reduced-motion settings. The new delay applies to the next hover; any pending timer is unaffected (its stale version will discard harmlessly when it fires). */
|
|
189
192
|
export const setShowDelay = (model, showDelay) => update(model, ChangedShowDelay({ showDelay: Duration.fromInputUnsafe(showDelay) }));
|
|
@@ -211,14 +214,14 @@ export const view = (config) => {
|
|
|
211
214
|
...(triggerClassName ? [Class(triggerClassName)] : []),
|
|
212
215
|
...triggerAttributes,
|
|
213
216
|
];
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
cleanup: anchorSetup({
|
|
217
|
+
const anchorTooltip = Mount.mapMessage(AnchorTooltip((items) => Effect.sync(() => {
|
|
218
|
+
const cleanup = anchorSetup({
|
|
217
219
|
buttonId: `${id}-trigger`,
|
|
218
220
|
anchor,
|
|
219
221
|
interceptTab: false,
|
|
220
|
-
})(items)
|
|
221
|
-
|
|
222
|
+
})(items);
|
|
223
|
+
return { message: CompletedAnchorTooltip(), cleanup };
|
|
224
|
+
})), toParentMessage);
|
|
222
225
|
const anchorAttributes = [
|
|
223
226
|
Style({
|
|
224
227
|
position: 'absolute',
|
|
@@ -226,7 +229,7 @@ export const view = (config) => {
|
|
|
226
229
|
visibility: 'hidden',
|
|
227
230
|
pointerEvents: 'none',
|
|
228
231
|
}),
|
|
229
|
-
OnMount(
|
|
232
|
+
OnMount(anchorTooltip),
|
|
230
233
|
];
|
|
231
234
|
const resolvedPanelAttributes = [
|
|
232
235
|
Id(`${id}-panel`),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { init, update, view, lazy, setShowDelay, Model, Message, EnteredTrigger, LeftTrigger, FocusedTrigger, BlurredTrigger, PressedEscape, PressedPointerOnTrigger, ElapsedShowDelay, ChangedShowDelay, ShowAfterDelay,
|
|
1
|
+
export { init, update, view, lazy, setShowDelay, Model, Message, EnteredTrigger, LeftTrigger, FocusedTrigger, BlurredTrigger, PressedEscape, PressedPointerOnTrigger, ElapsedShowDelay, ChangedShowDelay, ShowAfterDelay, CompletedAnchorTooltip, AnchorTooltip, } from './index.js';
|
|
2
2
|
export type { InitConfig, ViewConfig } from './index.js';
|
|
3
3
|
export type { AnchorConfig } from '../anchor.js';
|
|
4
4
|
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/tooltip/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,OAAO,EACP,cAAc,EACd,WAAW,EACX,cAAc,EACd,cAAc,EACd,aAAa,EACb,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/tooltip/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,OAAO,EACP,cAAc,EACd,WAAW,EACX,cAAc,EACd,cAAc,EACd,aAAa,EACb,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,aAAa,GACd,MAAM,YAAY,CAAA;AAEnB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAExD,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { init, update, view, lazy, setShowDelay, Model, Message, EnteredTrigger, LeftTrigger, FocusedTrigger, BlurredTrigger, PressedEscape, PressedPointerOnTrigger, ElapsedShowDelay, ChangedShowDelay, ShowAfterDelay,
|
|
1
|
+
export { init, update, view, lazy, setShowDelay, Model, Message, EnteredTrigger, LeftTrigger, FocusedTrigger, BlurredTrigger, PressedEscape, PressedPointerOnTrigger, ElapsedShowDelay, ChangedShowDelay, ShowAfterDelay, CompletedAnchorTooltip, AnchorTooltip, } from './index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foldkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.85.0",
|
|
4
4
|
"description": "A TypeScript frontend framework, built on Effect and architected like Elm",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -47,6 +47,14 @@
|
|
|
47
47
|
"types": "./dist/runtime/public.d.ts",
|
|
48
48
|
"import": "./dist/runtime/public.js"
|
|
49
49
|
},
|
|
50
|
+
"./scene": {
|
|
51
|
+
"types": "./dist/scene/public.d.ts",
|
|
52
|
+
"import": "./dist/scene/public.js"
|
|
53
|
+
},
|
|
54
|
+
"./story": {
|
|
55
|
+
"types": "./dist/story/public.d.ts",
|
|
56
|
+
"import": "./dist/story/public.js"
|
|
57
|
+
},
|
|
50
58
|
"./hmr-protocol": {
|
|
51
59
|
"types": "./dist/runtime/hmrProtocolPublic.d.ts",
|
|
52
60
|
"import": "./dist/runtime/hmrProtocolPublic.js"
|