foldkit 0.56.0 → 0.57.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.
Files changed (70) hide show
  1. package/dist/devtools/overlay-styles.d.ts +1 -1
  2. package/dist/devtools/overlay-styles.d.ts.map +1 -1
  3. package/dist/devtools/overlay-styles.js +5 -1
  4. package/dist/devtools/overlay.d.ts.map +1 -1
  5. package/dist/devtools/overlay.js +52 -19
  6. package/dist/html/index.d.ts +3 -3
  7. package/dist/html/index.d.ts.map +1 -1
  8. package/dist/html/lazy.d.ts +7 -5
  9. package/dist/html/lazy.d.ts.map +1 -1
  10. package/dist/html/lazy.js +12 -8
  11. package/dist/runtime/runtime.d.ts.map +1 -1
  12. package/dist/runtime/runtime.js +2 -4
  13. package/dist/test/apps/disabledButton.d.ts +11 -3
  14. package/dist/test/apps/disabledButton.d.ts.map +1 -1
  15. package/dist/ui/combobox/multi.d.ts +31 -10
  16. package/dist/ui/combobox/multi.d.ts.map +1 -1
  17. package/dist/ui/combobox/public.d.ts +1 -2
  18. package/dist/ui/combobox/public.d.ts.map +1 -1
  19. package/dist/ui/combobox/public.js +1 -2
  20. package/dist/ui/combobox/shared.d.ts +33 -33
  21. package/dist/ui/combobox/shared.d.ts.map +1 -1
  22. package/dist/ui/combobox/shared.js +89 -112
  23. package/dist/ui/combobox/single.d.ts +31 -10
  24. package/dist/ui/combobox/single.d.ts.map +1 -1
  25. package/dist/ui/combobox/single.js +1 -5
  26. package/dist/ui/dialog/index.d.ts +10 -15
  27. package/dist/ui/dialog/index.d.ts.map +1 -1
  28. package/dist/ui/dialog/index.js +68 -73
  29. package/dist/ui/dialog/public.d.ts +1 -1
  30. package/dist/ui/dialog/public.d.ts.map +1 -1
  31. package/dist/ui/dialog/public.js +1 -1
  32. package/dist/ui/listbox/multi.d.ts +30 -9
  33. package/dist/ui/listbox/multi.d.ts.map +1 -1
  34. package/dist/ui/listbox/public.d.ts +1 -2
  35. package/dist/ui/listbox/public.d.ts.map +1 -1
  36. package/dist/ui/listbox/public.js +1 -2
  37. package/dist/ui/listbox/shared.d.ts +35 -36
  38. package/dist/ui/listbox/shared.d.ts.map +1 -1
  39. package/dist/ui/listbox/shared.js +106 -104
  40. package/dist/ui/listbox/single.d.ts +30 -9
  41. package/dist/ui/listbox/single.d.ts.map +1 -1
  42. package/dist/ui/listbox/single.js +9 -12
  43. package/dist/ui/menu/index.d.ts +22 -26
  44. package/dist/ui/menu/index.d.ts.map +1 -1
  45. package/dist/ui/menu/index.js +103 -91
  46. package/dist/ui/menu/public.d.ts +1 -2
  47. package/dist/ui/menu/public.d.ts.map +1 -1
  48. package/dist/ui/menu/public.js +1 -2
  49. package/dist/ui/popover/index.d.ts +21 -22
  50. package/dist/ui/popover/index.d.ts.map +1 -1
  51. package/dist/ui/popover/index.js +92 -75
  52. package/dist/ui/popover/public.d.ts +1 -2
  53. package/dist/ui/popover/public.d.ts.map +1 -1
  54. package/dist/ui/popover/public.js +1 -2
  55. package/dist/ui/transition/index.d.ts +8 -58
  56. package/dist/ui/transition/index.d.ts.map +1 -1
  57. package/dist/ui/transition/index.js +21 -111
  58. package/dist/ui/transition/public.d.ts +1 -1
  59. package/dist/ui/transition/public.d.ts.map +1 -1
  60. package/dist/ui/transition/public.js +1 -1
  61. package/dist/ui/transition/schema.d.ts +43 -0
  62. package/dist/ui/transition/schema.d.ts.map +1 -0
  63. package/dist/ui/transition/schema.js +35 -0
  64. package/dist/ui/transition/update.d.ts +22 -0
  65. package/dist/ui/transition/update.d.ts.map +1 -0
  66. package/dist/ui/transition/update.js +68 -0
  67. package/package.json +1 -1
  68. package/dist/ui/transition.d.ts +0 -5
  69. package/dist/ui/transition.d.ts.map +0 -1
  70. package/dist/ui/transition.js +0 -3
@@ -10,7 +10,11 @@ export declare const Model: S.extend<S.Struct<{
10
10
  nullable: typeof S.Boolean;
11
11
  immediate: typeof S.Boolean;
12
12
  selectInputOnFocus: typeof S.Boolean;
13
- transitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
13
+ transition: S.Struct<{
14
+ id: typeof S.String;
15
+ isShowing: typeof S.Boolean;
16
+ transitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
17
+ }>;
14
18
  maybeActiveItemIndex: S.OptionFromSelf<typeof S.Number>;
15
19
  activationTrigger: S.Literal<["Pointer", "Keyboard"]>;
16
20
  inputValue: typeof S.String;
@@ -36,7 +40,11 @@ export declare const update: (model: {
36
40
  readonly isOpen: boolean;
37
41
  readonly isAnimated: boolean;
38
42
  readonly isModal: boolean;
39
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
43
+ readonly transition: {
44
+ readonly id: string;
45
+ readonly isShowing: boolean;
46
+ readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
47
+ };
40
48
  readonly maybeActiveItemIndex: Option.Option<number>;
41
49
  readonly activationTrigger: "Pointer" | "Keyboard";
42
50
  readonly maybeLastPointerPosition: Option.Option<{
@@ -55,7 +63,11 @@ export declare const update: (model: {
55
63
  readonly isOpen: boolean;
56
64
  readonly isAnimated: boolean;
57
65
  readonly isModal: boolean;
58
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
66
+ readonly transition: {
67
+ readonly id: string;
68
+ readonly isShowing: boolean;
69
+ readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
70
+ };
59
71
  readonly maybeActiveItemIndex: Option.Option<number>;
60
72
  readonly activationTrigger: "Pointer" | "Keyboard";
61
73
  readonly maybeLastPointerPosition: Option.Option<{
@@ -89,10 +101,6 @@ export declare const update: (model: {
89
101
  readonly _tag: "CompletedScrollIntoView";
90
102
  } | {
91
103
  readonly _tag: "CompletedClickItem";
92
- } | {
93
- readonly _tag: "AdvancedTransitionFrame";
94
- } | {
95
- readonly _tag: "EndedTransition";
96
104
  } | {
97
105
  readonly _tag: "Opened";
98
106
  readonly maybeActiveItemIndex: Option.Option<number>;
@@ -119,7 +127,16 @@ export declare const update: (model: {
119
127
  } | {
120
128
  readonly _tag: "CompletedFocusInput";
121
129
  } | {
122
- readonly _tag: "DetectedInputMovement";
130
+ readonly _tag: "GotTransitionMessage";
131
+ readonly message: {
132
+ readonly _tag: "Showed";
133
+ } | {
134
+ readonly _tag: "Hidden";
135
+ } | {
136
+ readonly _tag: "AdvancedTransitionFrame";
137
+ } | {
138
+ readonly _tag: "EndedTransition";
139
+ };
123
140
  } | {
124
141
  readonly _tag: "UpdatedInputValue";
125
142
  readonly value: string;
@@ -136,7 +153,11 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
136
153
  readonly isOpen: boolean;
137
154
  readonly isAnimated: boolean;
138
155
  readonly isModal: boolean;
139
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
156
+ readonly transition: {
157
+ readonly id: string;
158
+ readonly isShowing: boolean;
159
+ readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
160
+ };
140
161
  readonly maybeActiveItemIndex: Option.Option<number>;
141
162
  readonly activationTrigger: "Pointer" | "Keyboard";
142
163
  readonly maybeLastPointerPosition: Option.Option<{
@@ -151,7 +172,7 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
151
172
  readonly maybeSelectedItem: Option.Option<string>;
152
173
  readonly maybeSelectedDisplayText: Option.Option<string>;
153
174
  };
154
- toParentMessage: (message: import("./shared").Opened | import("./shared").Closed | import("./shared").ClosedByTab | import("./shared").ActivatedItem | import("./shared").DeactivatedItem | import("./shared").SelectedItem | import("./shared").MovedPointerOverItem | import("./shared").RequestedItemClick | import("./shared").UpdatedInputValue | import("./shared").PressedToggleButton | import("./shared").CompletedLockScroll | import("./shared").CompletedUnlockScroll | import("./shared").CompletedSetupInert | import("./shared").CompletedTeardownInert | import("./shared").CompletedFocusInput | import("./shared").CompletedScrollIntoView | import("./shared").CompletedClickItem) => Message;
175
+ toParentMessage: (message: import("./shared").Opened | import("./shared").Closed | import("./shared").ClosedByTab | import("./shared").ActivatedItem | import("./shared").DeactivatedItem | import("./shared").SelectedItem | import("./shared").MovedPointerOverItem | import("./shared").RequestedItemClick | import("./shared").UpdatedInputValue | import("./shared").PressedToggleButton) => Message;
155
176
  onSelectedItem?: (value: string) => Message;
156
177
  items: readonly Item[];
157
178
  itemToConfig: (item: Item, context: Readonly<{
@@ -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,EAAE,KAAK,IAAI,EAAc,MAAM,YAAY,CAAA;AAElD,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EAKpB,MAAM,UAAU,CAAA;AAIjB,uJAAuJ;AACvJ,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;GAOjB,CAAA;AAED,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,8RAA8R;AAC9R,MAAM,MAAM,UAAU,GAAG,cAAc,GACrC,QAAQ,CAAC;IACP,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAC,CAAA;AAEJ,4IAA4I;AAC5I,eAAO,MAAM,IAAI,GAAI,QAAQ,UAAU,KAAG,KAMxC,CAAA;AAIF,uIAAuI;AACvI,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqDjB,CAAA;AAIF,wEAAwE;AACxE,MAAM,MAAM,UAAU,CAAC,OAAO,EAA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O,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiDjB,CAAA;AAIF,wEAAwE;AACxE,MAAM,MAAM,UAAU,CAAC,OAAO,EAAE,IAAI,SAAS,MAAM,IAAI,cAAc,CACnE,OAAO,EACP,IAAI,EACJ,KAAK,CACN,CAAA;AAED,0IAA0I;AAC1I,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAOf,CAAA;AAEF;mFACmF;AACnF,eAAO,MAAM,IAAI,GAAI,OAAO,EAAE,IAAI,SAAS,MAAM,EAC/C,cAAc,IAAI,CAChB,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,EACzB,OAAO,GAAG,iBAAiB,GAAG,gBAAgB,CAC/C,KACA,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,iBAAiB,CAAC,KACrE,IAAI,CAoBR,CAAA"}
@@ -44,11 +44,7 @@ export const update = makeUpdate({
44
44
  });
45
45
  return [
46
46
  nextModel,
47
- pipe(Array.getSomes([
48
- context.maybeNextFrame,
49
- context.maybeUnlockScroll,
50
- context.maybeRestoreInert,
51
- ]), Array.prepend(context.focusInput)),
47
+ pipe(Array.getSomes([context.maybeUnlockScroll, context.maybeRestoreInert]), Array.prepend(context.focusInput)),
52
48
  ];
53
49
  },
54
50
  handleImmediateActivation: (model, item, displayText) => evo(model, {
@@ -6,7 +6,11 @@ export declare const Model: S.Struct<{
6
6
  id: typeof S.String;
7
7
  isOpen: typeof S.Boolean;
8
8
  isAnimated: typeof S.Boolean;
9
- transitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
9
+ transition: S.Struct<{
10
+ id: typeof S.String;
11
+ isShowing: typeof S.Boolean;
12
+ transitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
13
+ }>;
10
14
  maybeFocusSelector: S.OptionFromSelf<typeof S.String>;
11
15
  }>;
12
16
  export type Model = typeof Model.Type;
@@ -18,18 +22,17 @@ export declare const Closed: import("../../schema").CallableTaggedStruct<"Closed
18
22
  export declare const CompletedShowDialog: import("../../schema").CallableTaggedStruct<"CompletedShowDialog", {}>;
19
23
  /** Sent when the close-dialog command completes (closeModal + scroll unlock). */
20
24
  export declare const CompletedCloseDialog: import("../../schema").CallableTaggedStruct<"CompletedCloseDialog", {}>;
21
- /** Sent internally when a double-rAF completes, advancing the transition to its animating phase. */
22
- export declare const AdvancedTransitionFrame: import("../../schema").CallableTaggedStruct<"AdvancedTransitionFrame", {}>;
23
- /** Sent internally when all CSS transitions on the dialog panel have completed. */
24
- export declare const EndedTransition: import("../../schema").CallableTaggedStruct<"EndedTransition", {}>;
25
+ /** Wraps a Transition submodel message for delegation. */
26
+ export declare const GotTransitionMessage: import("../../schema").CallableTaggedStruct<"GotTransitionMessage", {
27
+ message: S.Union<[import("../../schema").CallableTaggedStruct<"Showed", {}>, import("../../schema").CallableTaggedStruct<"Hidden", {}>, import("../../schema").CallableTaggedStruct<"AdvancedTransitionFrame", {}>, import("../../schema").CallableTaggedStruct<"EndedTransition", {}>]>;
28
+ }>;
25
29
  /** Union of all messages the dialog component can produce. */
26
30
  export declare const Message: S.Union<[
27
31
  typeof Opened,
28
32
  typeof Closed,
29
33
  typeof CompletedShowDialog,
30
34
  typeof CompletedCloseDialog,
31
- typeof AdvancedTransitionFrame,
32
- typeof EndedTransition
35
+ typeof GotTransitionMessage
33
36
  ]>;
34
37
  export type Opened = typeof Opened.Type;
35
38
  export type Closed = typeof Closed.Type;
@@ -46,10 +49,6 @@ export type InitConfig = Readonly<{
46
49
  /** Creates an initial dialog model from a config. Defaults to closed and non-animated. */
47
50
  export declare const init: (config: InitConfig) => Model;
48
51
  type UpdateReturn = readonly [Model, ReadonlyArray<Command.Command<Message>>];
49
- /** Advances the dialog's enter/leave transition by waiting a double-rAF. */
50
- export declare const RequestFrame: Command.CommandDefinition<"RequestFrame", {
51
- readonly _tag: "AdvancedTransitionFrame";
52
- }>;
53
52
  /** Locks page scroll and calls `showModal()` on the native dialog element. */
54
53
  export declare const ShowDialog: Command.CommandDefinition<"ShowDialog", {
55
54
  readonly _tag: "CompletedShowDialog";
@@ -58,10 +57,6 @@ export declare const ShowDialog: Command.CommandDefinition<"ShowDialog", {
58
57
  export declare const CloseDialog: Command.CommandDefinition<"CloseDialog", {
59
58
  readonly _tag: "CompletedCloseDialog";
60
59
  }>;
61
- /** Waits for all CSS transitions on the dialog panel to complete. */
62
- export declare const WaitForTransitions: Command.CommandDefinition<"WaitForTransitions", {
63
- readonly _tag: "EndedTransition";
64
- }>;
65
60
  /** Processes a dialog message and returns the next model and commands. */
66
61
  export declare const update: (model: Model, message: Message) => UpdateReturn;
67
62
  /** Returns the ID used for `aria-labelledby` on the dialog. Apply this to your title element. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEvE,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,IAAI,EAAoB,MAAM,YAAY,CAAA;AAQxE,oIAAoI;AACpI,eAAO,MAAM,KAAK;;;;;;EAMhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,wEAAwE;AACxE,eAAO,MAAM,MAAM,2DAAc,CAAA;AACjC,wHAAwH;AACxH,eAAO,MAAM,MAAM,2DAAc,CAAA;AACjC,6EAA6E;AAC7E,eAAO,MAAM,mBAA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CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACnD,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,kBAAkB,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACtD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;CAC/C,CAAC,CAAA;AAEF;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,OAAO,EAAE,QAAQ,UAAU,CAAC,OAAO,CAAC,KAAG,IA8G3D,CAAA;AAED;;;;oDAIoD;AACpD,eAAO,MAAM,IAAI,GAAI,OAAO,EAC1B,cAAc,IAAI,CAChB,UAAU,CAAC,OAAO,CAAC,EACnB,OAAO,GAAG,iBAAiB,GAAG,UAAU,GAAG,cAAc,CAC1D,KACA,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,EACvD,YAAY,EAAE,IAAI,KACf,IAAI,CAkBR,CAAA"}
@@ -1,18 +1,21 @@
1
- import { Array, Effect, Match as M, Option, Schema as S } from 'effect';
1
+ import { Effect, Match as M, Option, Schema as S } from 'effect';
2
2
  import * as Command from '../../command';
3
- import { OptionExt } from '../../effectExtensions';
4
3
  import { createLazy, html } from '../../html';
5
4
  import { m } from '../../message';
6
5
  import { evo } from '../../struct';
7
6
  import * as Task from '../../task';
8
- import { TransitionState } from '../transition';
7
+ // NOTE: Transition imports are split across schema + update to avoid a circular
8
+ // dependency: transition → html → runtime → devtools → dialog → transition.
9
+ // The barrel (../transition) imports from html, which starts the cycle.
10
+ import { Hidden as TransitionHidden, Message as TransitionMessage, Model as TransitionModel, Showed as TransitionShowed, init as transitionInit, } from '../transition/schema';
11
+ import { defaultLeaveCommand as transitionDefaultLeaveCommand, update as transitionUpdate, } from '../transition/update';
9
12
  // MODEL
10
13
  /** Schema for the dialog component's state, tracking its unique ID, open/closed status, animation support, and transition phase. */
11
14
  export const Model = S.Struct({
12
15
  id: S.String,
13
16
  isOpen: S.Boolean,
14
17
  isAnimated: S.Boolean,
15
- transitionState: TransitionState,
18
+ transition: TransitionModel,
16
19
  maybeFocusSelector: S.OptionFromSelf(S.String),
17
20
  });
18
21
  // MESSAGE
@@ -24,92 +27,84 @@ export const Closed = m('Closed');
24
27
  export const CompletedShowDialog = m('CompletedShowDialog');
25
28
  /** Sent when the close-dialog command completes (closeModal + scroll unlock). */
26
29
  export const CompletedCloseDialog = m('CompletedCloseDialog');
27
- /** Sent internally when a double-rAF completes, advancing the transition to its animating phase. */
28
- export const AdvancedTransitionFrame = m('AdvancedTransitionFrame');
29
- /** Sent internally when all CSS transitions on the dialog panel have completed. */
30
- export const EndedTransition = m('EndedTransition');
30
+ /** Wraps a Transition submodel message for delegation. */
31
+ export const GotTransitionMessage = m('GotTransitionMessage', {
32
+ message: TransitionMessage,
33
+ });
31
34
  /** Union of all messages the dialog component can produce. */
32
- export const Message = S.Union(Opened, Closed, CompletedShowDialog, CompletedCloseDialog, AdvancedTransitionFrame, EndedTransition);
35
+ export const Message = S.Union(Opened, Closed, CompletedShowDialog, CompletedCloseDialog, GotTransitionMessage);
33
36
  /** Creates an initial dialog model from a config. Defaults to closed and non-animated. */
34
37
  export const init = (config) => ({
35
38
  id: config.id,
36
39
  isOpen: config.isOpen ?? false,
37
40
  isAnimated: config.isAnimated ?? false,
38
- transitionState: 'Idle',
41
+ transition: transitionInit({
42
+ id: `${config.id}-panel`,
43
+ ...(config.isOpen !== undefined ? { isShowing: config.isOpen } : {}),
44
+ }),
39
45
  maybeFocusSelector: Option.fromNullable(config.focusSelector),
40
46
  });
41
47
  // UPDATE
42
48
  const dialogSelector = (id) => `#${id}`;
43
- const panelSelector = (id) => `#${id}-panel`;
44
49
  const withUpdateReturn = M.withReturnType();
45
- /** Advances the dialog's enter/leave transition by waiting a double-rAF. */
46
- export const RequestFrame = Command.define('RequestFrame', AdvancedTransitionFrame);
47
50
  /** Locks page scroll and calls `showModal()` on the native dialog element. */
48
51
  export const ShowDialog = Command.define('ShowDialog', CompletedShowDialog);
49
52
  /** Calls `close()` on the native dialog element and unlocks page scroll. */
50
53
  export const CloseDialog = Command.define('CloseDialog', CompletedCloseDialog);
51
- /** Waits for all CSS transitions on the dialog panel to complete. */
52
- export const WaitForTransitions = Command.define('WaitForTransitions', EndedTransition);
54
+ const closeDialog = (id) => CloseDialog(Task.closeModal(dialogSelector(id)).pipe(Effect.andThen(() => Task.unlockScroll), Effect.ignore, Effect.as(CompletedCloseDialog())));
55
+ const toParentMessage = (message) => GotTransitionMessage({ message });
56
+ const delegateToTransition = (model, transitionMessage) => {
57
+ const [nextTransition, transitionCommands, maybeOutMessage] = transitionUpdate(model.transition, transitionMessage);
58
+ const mappedCommands = transitionCommands.map(Command.mapEffect(Effect.map(toParentMessage)));
59
+ const additionalCommands = Option.match(maybeOutMessage, {
60
+ onNone: () => [],
61
+ onSome: M.type().pipe(M.tagsExhaustive({
62
+ StartedLeaveAnimating: () => [
63
+ Command.mapEffect(transitionDefaultLeaveCommand(nextTransition), Effect.map(toParentMessage)),
64
+ ],
65
+ TransitionedOut: () => [closeDialog(model.id)],
66
+ })),
67
+ });
68
+ return [
69
+ evo(model, { transition: () => nextTransition }),
70
+ [...mappedCommands, ...additionalCommands],
71
+ ];
72
+ };
53
73
  /** Processes a dialog message and returns the next model and commands. */
54
- export const update = (model, message) => {
55
- const maybeNextFrame = OptionExt.when(model.isAnimated, RequestFrame(Task.nextFrame.pipe(Effect.as(AdvancedTransitionFrame()))));
56
- return M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
57
- Opened: () => {
58
- const focusOptions = Option.match(model.maybeFocusSelector, {
59
- onNone: () => undefined,
60
- onSome: focusSelector => ({ focusSelector }),
61
- });
62
- const maybeShow = Option.liftPredicate(ShowDialog(Task.lockScroll.pipe(Effect.andThen(() => Task.showModal(dialogSelector(model.id), focusOptions)), Effect.ignore, Effect.as(CompletedShowDialog()))), () => !model.isOpen);
74
+ export const update = (model, message) => M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
75
+ Opened: () => {
76
+ const focusOptions = Option.match(model.maybeFocusSelector, {
77
+ onNone: () => undefined,
78
+ onSome: focusSelector => ({ focusSelector }),
79
+ });
80
+ const maybeShow = Option.liftPredicate(ShowDialog(Task.lockScroll.pipe(Effect.andThen(() => Task.showModal(dialogSelector(model.id), focusOptions)), Effect.ignore, Effect.as(CompletedShowDialog()))), () => !model.isOpen);
81
+ if (model.isAnimated) {
82
+ const [nextModel, transitionCommands] = delegateToTransition(model, TransitionShowed());
63
83
  return [
64
- evo(model, {
65
- isOpen: () => true,
66
- transitionState: () => (model.isAnimated ? 'EnterStart' : 'Idle'),
67
- }),
68
- Array.getSomes([maybeShow, maybeNextFrame]),
84
+ evo(nextModel, { isOpen: () => true }),
85
+ [...Option.toArray(maybeShow), ...transitionCommands],
69
86
  ];
70
- },
71
- Closed: () => {
72
- const isLeaving = model.transitionState === 'LeaveStart' ||
73
- model.transitionState === 'LeaveAnimating';
74
- if (isLeaving) {
75
- return [model, []];
76
- }
77
- if (model.isAnimated) {
78
- return [
79
- evo(model, {
80
- isOpen: () => false,
81
- transitionState: () => 'LeaveStart',
82
- }),
83
- Option.toArray(maybeNextFrame),
84
- ];
85
- }
86
- const maybeClose = Option.liftPredicate(CloseDialog(Task.closeModal(dialogSelector(model.id)).pipe(Effect.andThen(() => Task.unlockScroll), Effect.ignore, Effect.as(CompletedCloseDialog()))), () => model.isOpen);
87
- return [evo(model, { isOpen: () => false }), Option.toArray(maybeClose)];
88
- },
89
- AdvancedTransitionFrame: () => M.value(model.transitionState).pipe(withUpdateReturn, M.when('EnterStart', () => [
90
- evo(model, { transitionState: () => 'EnterAnimating' }),
91
- [
92
- WaitForTransitions(Task.waitForTransitions(panelSelector(model.id)).pipe(Effect.as(EndedTransition()))),
93
- ],
94
- ]), M.when('LeaveStart', () => [
95
- evo(model, { transitionState: () => 'LeaveAnimating' }),
96
- [
97
- WaitForTransitions(Task.waitForTransitions(panelSelector(model.id)).pipe(Effect.as(EndedTransition()))),
98
- ],
99
- ]), M.orElse(() => [model, []])),
100
- EndedTransition: () => M.value(model.transitionState).pipe(withUpdateReturn, M.when('EnterAnimating', () => [
101
- evo(model, { transitionState: () => 'Idle' }),
102
- [],
103
- ]), M.when('LeaveAnimating', () => [
104
- evo(model, { transitionState: () => 'Idle' }),
105
- [
106
- CloseDialog(Task.closeModal(dialogSelector(model.id)).pipe(Effect.andThen(() => Task.unlockScroll), Effect.ignore, Effect.as(CompletedCloseDialog()))),
107
- ],
108
- ]), M.orElse(() => [model, []])),
109
- CompletedShowDialog: () => [model, []],
110
- CompletedCloseDialog: () => [model, []],
111
- }));
112
- };
87
+ }
88
+ return [evo(model, { isOpen: () => true }), Option.toArray(maybeShow)];
89
+ },
90
+ Closed: () => {
91
+ const { transitionState } = model.transition;
92
+ const isLeaving = transitionState === 'LeaveStart' ||
93
+ transitionState === 'LeaveAnimating';
94
+ if (isLeaving) {
95
+ return [model, []];
96
+ }
97
+ if (model.isAnimated) {
98
+ const [nextModel, transitionCommands] = delegateToTransition(evo(model, { isOpen: () => false }), TransitionHidden());
99
+ return [nextModel, transitionCommands];
100
+ }
101
+ const maybeClose = Option.liftPredicate(closeDialog(model.id), () => model.isOpen);
102
+ return [evo(model, { isOpen: () => false }), Option.toArray(maybeClose)];
103
+ },
104
+ GotTransitionMessage: ({ message: transitionMessage }) => delegateToTransition(model, transitionMessage),
105
+ CompletedShowDialog: () => [model, []],
106
+ CompletedCloseDialog: () => [model, []],
107
+ }));
113
108
  // VIEW
114
109
  /** Returns the ID used for `aria-labelledby` on the dialog. Apply this to your title element. */
115
110
  export const titleId = (model) => `${model.id}-title`;
@@ -121,7 +116,7 @@ export const close = (model) => update(model, Closed());
121
116
  /** Renders a headless dialog component backed by the native `<dialog>` element with `showModal()`. */
122
117
  export const view = (config) => {
123
118
  const { AriaDescribedBy, AriaLabelledBy, Class, DataAttribute, Id, OnCancel, OnClick, Open, Style, keyed, } = html();
124
- const { model: { id, isOpen, transitionState }, toParentMessage, onClosed, panelContent, panelClassName, panelAttributes = [], backdropClassName, backdropAttributes = [], className, attributes = [], } = config;
119
+ const { model: { id, isOpen, transition: { transitionState }, }, toParentMessage, onClosed, panelContent, panelClassName, panelAttributes = [], backdropClassName, backdropAttributes = [], className, attributes = [], } = config;
125
120
  const dispatchClosed = () => onClosed ? onClosed() : toParentMessage(Closed());
126
121
  const isLeaving = transitionState === 'LeaveStart' || transitionState === 'LeaveAnimating';
127
122
  const isVisible = isOpen || isLeaving;
@@ -1,3 +1,3 @@
1
- export { init, update, close, view, lazy, titleId, descriptionId, Model, Message, Opened, Closed, CompletedShowDialog, CompletedCloseDialog, AdvancedTransitionFrame, EndedTransition, RequestFrame, ShowDialog, CloseDialog, WaitForTransitions, } from './index';
1
+ export { init, update, close, view, lazy, titleId, descriptionId, Model, Message, Opened, Closed, CompletedShowDialog, CompletedCloseDialog, GotTransitionMessage, ShowDialog, CloseDialog, } from './index';
2
2
  export type { InitConfig, ViewConfig } from './index';
3
3
  //# sourceMappingURL=public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/dialog/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,aAAa,EACb,KAAK,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,YAAY,EACZ,UAAU,EACV,WAAW,EACX,kBAAkB,GACnB,MAAM,SAAS,CAAA;AAEhB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/dialog/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,aAAa,EACb,KAAK,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,WAAW,GACZ,MAAM,SAAS,CAAA;AAEhB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA"}
@@ -1 +1 @@
1
- export { init, update, close, view, lazy, titleId, descriptionId, Model, Message, Opened, Closed, CompletedShowDialog, CompletedCloseDialog, AdvancedTransitionFrame, EndedTransition, RequestFrame, ShowDialog, CloseDialog, WaitForTransitions, } from './index';
1
+ export { init, update, close, view, lazy, titleId, descriptionId, Model, Message, Opened, Closed, CompletedShowDialog, CompletedCloseDialog, GotTransitionMessage, ShowDialog, CloseDialog, } from './index';
@@ -8,7 +8,11 @@ export declare const Model: S.extend<S.Struct<{
8
8
  isAnimated: typeof S.Boolean;
9
9
  isModal: typeof S.Boolean;
10
10
  orientation: S.Literal<["Vertical", "Horizontal"]>;
11
- transitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
11
+ transition: S.Struct<{
12
+ id: typeof S.String;
13
+ isShowing: typeof S.Boolean;
14
+ transitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
15
+ }>;
12
16
  maybeActiveItemIndex: S.OptionFromSelf<typeof S.Number>;
13
17
  activationTrigger: S.Literal<["Pointer", "Keyboard"]>;
14
18
  searchQuery: typeof S.String;
@@ -35,7 +39,11 @@ export declare const update: (model: {
35
39
  readonly isAnimated: boolean;
36
40
  readonly isModal: boolean;
37
41
  readonly orientation: "Vertical" | "Horizontal";
38
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
42
+ readonly transition: {
43
+ readonly id: string;
44
+ readonly isShowing: boolean;
45
+ readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
46
+ };
39
47
  readonly maybeActiveItemIndex: Option.Option<number>;
40
48
  readonly activationTrigger: "Pointer" | "Keyboard";
41
49
  readonly searchQuery: string;
@@ -53,7 +61,11 @@ export declare const update: (model: {
53
61
  readonly isAnimated: boolean;
54
62
  readonly isModal: boolean;
55
63
  readonly orientation: "Vertical" | "Horizontal";
56
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
64
+ readonly transition: {
65
+ readonly id: string;
66
+ readonly isShowing: boolean;
67
+ readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
68
+ };
57
69
  readonly maybeActiveItemIndex: Option.Option<number>;
58
70
  readonly activationTrigger: "Pointer" | "Keyboard";
59
71
  readonly searchQuery: string;
@@ -119,11 +131,16 @@ export declare const update: (model: {
119
131
  } | {
120
132
  readonly _tag: "SuppressedSpaceScroll";
121
133
  } | {
122
- readonly _tag: "AdvancedTransitionFrame";
123
- } | {
124
- readonly _tag: "EndedTransition";
125
- } | {
126
- readonly _tag: "DetectedButtonMovement";
134
+ readonly _tag: "GotTransitionMessage";
135
+ readonly message: {
136
+ readonly _tag: "Showed";
137
+ } | {
138
+ readonly _tag: "Hidden";
139
+ } | {
140
+ readonly _tag: "AdvancedTransitionFrame";
141
+ } | {
142
+ readonly _tag: "EndedTransition";
143
+ };
127
144
  } | {
128
145
  readonly _tag: "PressedPointerOnButton";
129
146
  readonly button: number;
@@ -140,7 +157,11 @@ export declare const view: <Message, Item>(config: Readonly<{
140
157
  readonly isAnimated: boolean;
141
158
  readonly isModal: boolean;
142
159
  readonly orientation: "Vertical" | "Horizontal";
143
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
160
+ readonly transition: {
161
+ readonly id: string;
162
+ readonly isShowing: boolean;
163
+ readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
164
+ };
144
165
  readonly maybeActiveItemIndex: Option.Option<number>;
145
166
  readonly activationTrigger: "Pointer" | "Keyboard";
146
167
  readonly searchQuery: string;
@@ -1 +1 @@
1
- {"version":3,"file":"multi.d.ts","sourceRoot":"","sources":["../../../src/ui/listbox/multi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,IAAI,CAAC,EAAQ,MAAM,QAAQ,CAAA;AAEzD,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,YAAY,CAAA;AAElD,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EAIpB,MAAM,UAAU,CAAA;AAIjB,iKAAiK;AACjK,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;GAEjB,CAAA;AAED,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,6RAA6R;AAC7R,MAAM,MAAM,UAAU,GAAG,cAAc,GACrC,QAAQ,CAAC;IACP,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CACtC,CAAC,CAAA;AAEJ,4HAA4H;AAC5H,eAAO,MAAM,IAAI,GAAI,QAAQ,UAAU,KAAG,KAGxC,CAAA;AAIF,wJAAwJ;AACxJ,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAMjB,CAAA;AAIF,sEAAsE;AACtE,MAAM,MAAM,UAAU,CAAC,OAAO,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAMjB,CAAA;AAIF,sEAAsE;AACtE,MAAM,MAAM,UAAU,CAAC,OAAO,EAAE,IAAI,IAAI,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;AAE5E,0JAA0J;AAC1J,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAYf,CAAA;AAEF;mFACmF;AACnF,eAAO,MAAM,IAAI,GAAI,OAAO,EAAE,IAAI,EAChC,cAAc,IAAI,CAChB,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,EACzB,OAAO,GAAG,iBAAiB,GAAG,gBAAgB,CAC/C,KACA,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,iBAAiB,CAAC,KACrE,IAAI,CAoBR,CAAA"}
@@ -1,6 +1,5 @@
1
1
  export { init, update, selectItem, view, lazy, Model } from './single';
2
- export { Message, Orientation, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusButton, CompletedFocusItems, CompletedScrollIntoView, CompletedClickItem, ClearedSearch, AdvancedTransitionFrame, EndedTransition, DetectedButtonMovement, RequestFrame, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusButton, FocusItems, ScrollIntoView, ClickItem, DelayClearSearch, WaitForTransitions, DetectMovementOrTransitionEnd, } from './shared';
3
- export { TransitionState } from '../transition';
2
+ export { Message, Orientation, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusButton, CompletedFocusItems, CompletedScrollIntoView, CompletedClickItem, ClearedSearch, GotTransitionMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusButton, FocusItems, ScrollIntoView, ClickItem, DelayClearSearch, DetectMovementOrTransitionEnd, } from './shared';
4
3
  export type { ActivationTrigger, Opened, Closed, ClosedByTab, ActivatedItem, DeactivatedItem, MovedPointerOverItem, RequestedItemClick, Searched, PressedPointerOnButton, IgnoredMouseClick, SuppressedSpaceScroll, ItemConfig, GroupHeading, } from './shared';
5
4
  export type { InitConfig, ViewConfig } from './single';
6
5
  export type { AnchorConfig } from '../anchor';
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/listbox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAEtE,OAAO,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACtB,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,UAAU,CAAA;AAEjB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C,YAAY,EACV,iBAAiB,EACjB,MAAM,EACN,MAAM,EACN,WAAW,EACX,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,QAAQ,EACR,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,YAAY,GACb,MAAM,UAAU,CAAA;AAEjB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAEtD,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/listbox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAEtE,OAAO,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,6BAA6B,GAC9B,MAAM,UAAU,CAAA;AAEjB,YAAY,EACV,iBAAiB,EACjB,MAAM,EACN,MAAM,EACN,WAAW,EACX,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,QAAQ,EACR,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,YAAY,GACb,MAAM,UAAU,CAAA;AAEjB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAEtD,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA"}
@@ -1,4 +1,3 @@
1
1
  export { init, update, selectItem, view, lazy, Model } from './single';
2
- export { Message, Orientation, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusButton, CompletedFocusItems, CompletedScrollIntoView, CompletedClickItem, ClearedSearch, AdvancedTransitionFrame, EndedTransition, DetectedButtonMovement, RequestFrame, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusButton, FocusItems, ScrollIntoView, ClickItem, DelayClearSearch, WaitForTransitions, DetectMovementOrTransitionEnd, } from './shared';
3
- export { TransitionState } from '../transition';
2
+ export { Message, Orientation, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusButton, CompletedFocusItems, CompletedScrollIntoView, CompletedClickItem, ClearedSearch, GotTransitionMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusButton, FocusItems, ScrollIntoView, ClickItem, DelayClearSearch, DetectMovementOrTransitionEnd, } from './shared';
4
3
  export * as Multi from './multiPublic';