foldkit 0.71.0 → 0.73.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/dist/html/index.d.ts +4 -4
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +1 -1
- package/dist/task/index.d.ts +1 -1
- package/dist/task/index.d.ts.map +1 -1
- package/dist/task/index.js +1 -1
- package/dist/task/public.d.ts +1 -1
- package/dist/task/public.d.ts.map +1 -1
- package/dist/task/public.js +1 -1
- package/dist/task/timing.d.ts +9 -5
- package/dist/task/timing.d.ts.map +1 -1
- package/dist/task/timing.js +11 -11
- package/dist/test/apps/disabledButton.d.ts +5 -5
- package/dist/test/apps/pointer.d.ts.map +1 -1
- package/dist/test/apps/pointer.js +2 -2
- package/dist/test/scene.d.ts +2 -0
- package/dist/test/scene.d.ts.map +1 -1
- package/dist/test/scene.js +12 -2
- package/dist/ui/{transition → animation}/index.d.ts +9 -8
- package/dist/ui/animation/index.d.ts.map +1 -0
- package/dist/ui/{transition → animation}/index.js +8 -7
- package/dist/ui/animation/public.d.ts +3 -0
- package/dist/ui/animation/public.d.ts.map +1 -0
- package/dist/ui/animation/public.js +1 -0
- package/dist/ui/{transition → animation}/schema.d.ts +14 -14
- package/dist/ui/animation/schema.d.ts.map +1 -0
- package/dist/ui/animation/schema.js +35 -0
- package/dist/ui/{transition → animation}/update.d.ts +7 -7
- package/dist/ui/animation/update.d.ts.map +1 -0
- package/dist/ui/{transition → animation}/update.js +12 -12
- package/dist/ui/combobox/multi.d.ts +7 -7
- 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 +13 -13
- package/dist/ui/combobox/shared.d.ts.map +1 -1
- package/dist/ui/combobox/shared.js +31 -31
- package/dist/ui/combobox/single.d.ts +7 -7
- package/dist/ui/datePicker/index.d.ts +3 -3
- package/dist/ui/dialog/index.d.ts +7 -7
- package/dist/ui/dialog/index.d.ts.map +1 -1
- package/dist/ui/dialog/index.js +28 -28
- package/dist/ui/dialog/public.d.ts +1 -1
- package/dist/ui/dialog/public.d.ts.map +1 -1
- package/dist/ui/dialog/public.js +1 -1
- package/dist/ui/index.d.ts +2 -1
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +2 -1
- package/dist/ui/listbox/multi.d.ts +7 -7
- 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 +13 -13
- package/dist/ui/listbox/shared.d.ts.map +1 -1
- package/dist/ui/listbox/shared.js +29 -29
- package/dist/ui/listbox/single.d.ts +7 -7
- package/dist/ui/menu/index.d.ts +11 -11
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +29 -29
- 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 +12 -12
- package/dist/ui/popover/index.d.ts.map +1 -1
- package/dist/ui/popover/index.js +30 -30
- 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/slider/index.d.ts +171 -0
- package/dist/ui/slider/index.d.ts.map +1 -0
- package/dist/ui/slider/index.js +319 -0
- package/dist/ui/slider/public.d.ts +3 -0
- package/dist/ui/slider/public.d.ts.map +1 -0
- package/dist/ui/slider/public.js +1 -0
- package/dist/ui/toast/index.d.ts +44 -44
- package/dist/ui/toast/index.d.ts.map +1 -1
- package/dist/ui/toast/index.js +7 -7
- package/dist/ui/toast/public.d.ts +1 -1
- package/dist/ui/toast/public.d.ts.map +1 -1
- package/dist/ui/toast/public.js +1 -1
- package/dist/ui/toast/schema.d.ts +11 -11
- package/dist/ui/toast/schema.d.ts.map +1 -1
- package/dist/ui/toast/schema.js +7 -7
- package/dist/ui/toast/update.d.ts +35 -35
- package/dist/ui/toast/update.d.ts.map +1 -1
- package/dist/ui/toast/update.js +16 -16
- package/package.json +9 -5
- package/dist/ui/transition/index.d.ts.map +0 -1
- package/dist/ui/transition/public.d.ts +0 -3
- package/dist/ui/transition/public.d.ts.map +0 -1
- package/dist/ui/transition/public.js +0 -1
- package/dist/ui/transition/schema.d.ts.map +0 -1
- package/dist/ui/transition/schema.js +0 -35
- package/dist/ui/transition/update.d.ts.map +0 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Match as M } from 'effect';
|
|
2
2
|
import { createLazy, html, } from '../../html';
|
|
3
|
-
import {
|
|
4
|
-
import { RequestFrame,
|
|
5
|
-
export {
|
|
6
|
-
export { RequestFrame,
|
|
7
|
-
/** Renders a headless
|
|
3
|
+
import { AdvancedAnimationFrame, EndedAnimation, Hid, Message, Model, OutMessage, Showed, StartedLeaveAnimating, TransitionState, TransitionedOut, init, } from './schema';
|
|
4
|
+
import { RequestFrame, WaitForAnimationSettled, defaultLeaveCommand, update, } from './update';
|
|
5
|
+
export { AdvancedAnimationFrame, EndedAnimation, Hid, init, Message, Model, OutMessage, Showed, StartedLeaveAnimating, TransitionState, TransitionedOut, };
|
|
6
|
+
export { RequestFrame, WaitForAnimationSettled, defaultLeaveCommand, update };
|
|
7
|
+
/** Renders a headless animation wrapper that coordinates CSS transitions and
|
|
8
|
+
* CSS keyframe animations via data attributes.
|
|
8
9
|
*
|
|
9
|
-
* Data attributes reflect the current
|
|
10
|
+
* Data attributes reflect the current lifecycle phase:
|
|
10
11
|
* - `data-closed` — element is in its hidden/initial state
|
|
11
12
|
* - `data-enter` — enter animation is active
|
|
12
13
|
* - `data-leave` — leave animation is active
|
|
@@ -70,7 +71,7 @@ export const view = (config) => {
|
|
|
70
71
|
...attributes,
|
|
71
72
|
], [content]);
|
|
72
73
|
};
|
|
73
|
-
/** Creates a memoized
|
|
74
|
+
/** Creates a memoized animation view. Static config (className, element, etc.)
|
|
74
75
|
* is captured in a closure. Dynamic fields — `model` and `content` — are
|
|
75
76
|
* compared by reference per render via `createLazy`. */
|
|
76
77
|
export const lazy = (staticConfig) => {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { init, update, view, lazy, defaultLeaveCommand, Model, Message, OutMessage, Showed, Hid, AdvancedAnimationFrame, EndedAnimation, StartedLeaveAnimating, TransitionedOut, TransitionState, RequestFrame, WaitForAnimationSettled, } from './index';
|
|
2
|
+
export type { InitConfig, ViewConfig } from './index';
|
|
3
|
+
//# sourceMappingURL=public.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/animation/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,mBAAmB,EACnB,KAAK,EACL,OAAO,EACP,UAAU,EACV,MAAM,EACN,GAAG,EACH,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,uBAAuB,GACxB,MAAM,SAAS,CAAA;AAEhB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { init, update, view, lazy, defaultLeaveCommand, Model, Message, OutMessage, Showed, Hid, AdvancedAnimationFrame, EndedAnimation, StartedLeaveAnimating, TransitionedOut, TransitionState, RequestFrame, WaitForAnimationSettled, } from './index';
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { Schema as S } from 'effect';
|
|
2
|
-
/** Schema for the
|
|
2
|
+
/** Schema for the animation lifecycle state, tracking enter/leave phases. */
|
|
3
3
|
export declare const TransitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
4
4
|
export type TransitionState = typeof TransitionState.Type;
|
|
5
|
-
/** Schema for the
|
|
5
|
+
/** Schema for the animation component's state, tracking its unique ID, visibility intent, and lifecycle phase. */
|
|
6
6
|
export declare const Model: S.Struct<{
|
|
7
7
|
id: typeof S.String;
|
|
8
8
|
isShowing: typeof S.Boolean;
|
|
9
9
|
transitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
10
10
|
}>;
|
|
11
11
|
export type Model = typeof Model.Type;
|
|
12
|
-
/** Sent when the
|
|
12
|
+
/** Sent when the animation should enter (become visible). Starts the enter sequence. */
|
|
13
13
|
export declare const Showed: import("../../schema").CallableTaggedStruct<"Showed", {}>;
|
|
14
|
-
/** Sent when the
|
|
14
|
+
/** Sent when the animation should leave (become hidden). Starts the leave sequence. */
|
|
15
15
|
export declare const Hid: import("../../schema").CallableTaggedStruct<"Hid", {}>;
|
|
16
|
-
/** Sent internally when a double-rAF completes, advancing the
|
|
17
|
-
export declare const
|
|
18
|
-
/** Sent internally when all CSS
|
|
19
|
-
export declare const
|
|
20
|
-
/** Union of all messages the
|
|
16
|
+
/** Sent internally when a double-rAF completes, advancing the lifecycle to its animating phase. */
|
|
17
|
+
export declare const AdvancedAnimationFrame: import("../../schema").CallableTaggedStruct<"AdvancedAnimationFrame", {}>;
|
|
18
|
+
/** Sent internally when all CSS animations on the element have settled. Covers both CSS transitions and CSS keyframe animations. */
|
|
19
|
+
export declare const EndedAnimation: import("../../schema").CallableTaggedStruct<"EndedAnimation", {}>;
|
|
20
|
+
/** Union of all messages the animation component can produce. */
|
|
21
21
|
export declare const Message: S.Union<[
|
|
22
22
|
typeof Showed,
|
|
23
23
|
typeof Hid,
|
|
24
|
-
typeof
|
|
25
|
-
typeof
|
|
24
|
+
typeof AdvancedAnimationFrame,
|
|
25
|
+
typeof EndedAnimation
|
|
26
26
|
]>;
|
|
27
27
|
export type Message = typeof Message.Type;
|
|
28
28
|
export type Showed = typeof Showed.Type;
|
|
29
29
|
export type Hid = typeof Hid.Type;
|
|
30
|
-
/** Sent to the parent when the leave
|
|
30
|
+
/** Sent to the parent when the leave sequence advances to LeaveAnimating. The parent is responsible for providing the command that detects when the leave animation completes (e.g. WaitForAnimationSettled or a racing command). Use `defaultLeaveCommand` for the standard behavior. */
|
|
31
31
|
export declare const StartedLeaveAnimating: import("../../schema").CallableTaggedStruct<"StartedLeaveAnimating", {}>;
|
|
32
32
|
/** Sent to the parent when the leave animation completes. The parent can use this to unmount content or update its own state. */
|
|
33
33
|
export declare const TransitionedOut: import("../../schema").CallableTaggedStruct<"TransitionedOut", {}>;
|
|
34
34
|
export declare const OutMessage: S.Union<[import("../../schema").CallableTaggedStruct<"StartedLeaveAnimating", {}>, import("../../schema").CallableTaggedStruct<"TransitionedOut", {}>]>;
|
|
35
35
|
export type OutMessage = typeof OutMessage.Type;
|
|
36
|
-
/** Configuration for creating
|
|
36
|
+
/** Configuration for creating an animation model with `init`. */
|
|
37
37
|
export type InitConfig = Readonly<{
|
|
38
38
|
id: string;
|
|
39
39
|
isShowing?: boolean;
|
|
40
40
|
}>;
|
|
41
|
-
/** Creates an initial
|
|
41
|
+
/** Creates an initial animation model from a config. Defaults to hidden. */
|
|
42
42
|
export declare const init: (config: InitConfig) => Model;
|
|
43
43
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/ui/animation/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAMpC,6EAA6E;AAC7E,eAAO,MAAM,eAAe,qFAM3B,CAAA;AACD,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAIzD,kHAAkH;AAClH,eAAO,MAAM,KAAK;;;;EAIhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,wFAAwF;AACxF,eAAO,MAAM,MAAM,2DAAc,CAAA;AACjC,uFAAuF;AACvF,eAAO,MAAM,GAAG,wDAAW,CAAA;AAC3B,mGAAmG;AACnG,eAAO,MAAM,sBAAsB,2EAA8B,CAAA;AACjE,oIAAoI;AACpI,eAAO,MAAM,cAAc,mEAAsB,CAAA;AAEjD,iEAAiE;AACjE,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,KAAK,CAC3B;IACE,OAAO,MAAM;IACb,OAAO,GAAG;IACV,OAAO,sBAAsB;IAC7B,OAAO,cAAc;CACtB,CAC6D,CAAA;AAChE,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AACvC,MAAM,MAAM,GAAG,GAAG,OAAO,GAAG,CAAC,IAAI,CAAA;AAIjC,0RAA0R;AAC1R,eAAO,MAAM,qBAAqB,0EAA6B,CAAA;AAC/D,iIAAiI;AACjI,eAAO,MAAM,eAAe,oEAAuB,CAAA;AAEnD,eAAO,MAAM,UAAU,yJAAkD,CAAA;AACzE,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAI/C,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAC,CAAA;AAEF,4EAA4E;AAC5E,eAAO,MAAM,IAAI,GAAI,QAAQ,UAAU,KAAG,KAIxC,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Schema as S } from 'effect';
|
|
2
|
+
import { m } from '../../message';
|
|
3
|
+
// TRANSITION STATE
|
|
4
|
+
/** Schema for the animation lifecycle state, tracking enter/leave phases. */
|
|
5
|
+
export const TransitionState = S.Literal('Idle', 'EnterStart', 'EnterAnimating', 'LeaveStart', 'LeaveAnimating');
|
|
6
|
+
// MODEL
|
|
7
|
+
/** Schema for the animation component's state, tracking its unique ID, visibility intent, and lifecycle phase. */
|
|
8
|
+
export const Model = S.Struct({
|
|
9
|
+
id: S.String,
|
|
10
|
+
isShowing: S.Boolean,
|
|
11
|
+
transitionState: TransitionState,
|
|
12
|
+
});
|
|
13
|
+
// MESSAGE
|
|
14
|
+
/** Sent when the animation should enter (become visible). Starts the enter sequence. */
|
|
15
|
+
export const Showed = m('Showed');
|
|
16
|
+
/** Sent when the animation should leave (become hidden). Starts the leave sequence. */
|
|
17
|
+
export const Hid = m('Hid');
|
|
18
|
+
/** Sent internally when a double-rAF completes, advancing the lifecycle to its animating phase. */
|
|
19
|
+
export const AdvancedAnimationFrame = m('AdvancedAnimationFrame');
|
|
20
|
+
/** Sent internally when all CSS animations on the element have settled. Covers both CSS transitions and CSS keyframe animations. */
|
|
21
|
+
export const EndedAnimation = m('EndedAnimation');
|
|
22
|
+
/** Union of all messages the animation component can produce. */
|
|
23
|
+
export const Message = S.Union(Showed, Hid, AdvancedAnimationFrame, EndedAnimation);
|
|
24
|
+
// OUT MESSAGE
|
|
25
|
+
/** Sent to the parent when the leave sequence advances to LeaveAnimating. The parent is responsible for providing the command that detects when the leave animation completes (e.g. WaitForAnimationSettled or a racing command). Use `defaultLeaveCommand` for the standard behavior. */
|
|
26
|
+
export const StartedLeaveAnimating = m('StartedLeaveAnimating');
|
|
27
|
+
/** Sent to the parent when the leave animation completes. The parent can use this to unmount content or update its own state. */
|
|
28
|
+
export const TransitionedOut = m('TransitionedOut');
|
|
29
|
+
export const OutMessage = S.Union(StartedLeaveAnimating, TransitionedOut);
|
|
30
|
+
/** Creates an initial animation model from a config. Defaults to hidden. */
|
|
31
|
+
export const init = (config) => ({
|
|
32
|
+
id: config.id,
|
|
33
|
+
isShowing: config.isShowing ?? false,
|
|
34
|
+
transitionState: 'Idle',
|
|
35
|
+
});
|
|
@@ -6,17 +6,17 @@ type UpdateReturn = readonly [
|
|
|
6
6
|
ReadonlyArray<Command.Command<Message>>,
|
|
7
7
|
Option.Option<OutMessage>
|
|
8
8
|
];
|
|
9
|
-
/** Advances the
|
|
9
|
+
/** Advances the enter/leave lifecycle by waiting a double-rAF. */
|
|
10
10
|
export declare const RequestFrame: Command.CommandDefinition<"RequestFrame", {
|
|
11
|
-
readonly _tag: "
|
|
11
|
+
readonly _tag: "AdvancedAnimationFrame";
|
|
12
12
|
}>;
|
|
13
|
-
/** Waits for all CSS
|
|
14
|
-
export declare const
|
|
15
|
-
readonly _tag: "
|
|
13
|
+
/** Waits for all CSS animations on the element to settle. Covers both CSS transitions and CSS keyframe animations. */
|
|
14
|
+
export declare const WaitForAnimationSettled: Command.CommandDefinition<"WaitForAnimationSettled", {
|
|
15
|
+
readonly _tag: "EndedAnimation";
|
|
16
16
|
}>;
|
|
17
|
-
/** Processes
|
|
17
|
+
/** Processes an animation message and returns the next model, commands, and optional OutMessage. */
|
|
18
18
|
export declare const update: (model: Model, message: Message) => UpdateReturn;
|
|
19
|
-
/** Creates the standard leave-phase command that waits for CSS
|
|
19
|
+
/** Creates the standard leave-phase command that waits for CSS animations on the element to settle. Use this when handling the `StartedLeaveAnimating` OutMessage for components that don't need custom leave behavior. */
|
|
20
20
|
export declare const defaultLeaveCommand: (model: Model) => Command.Command<Message>;
|
|
21
21
|
export {};
|
|
22
22
|
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/ui/animation/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEnD,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AAGxC,OAAO,EAGL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,UAAU,EAGhB,MAAM,UAAU,CAAA;AAMjB,KAAK,YAAY,GAAG,SAAS;IAC3B,KAAK;IACL,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;CAC1B,CAAA;AAGD,kEAAkE;AAClE,eAAO,MAAM,YAAY;;EAGxB,CAAA;AACD,sHAAsH;AACtH,eAAO,MAAM,uBAAuB;;EAGnC,CAAA;AAED,oGAAoG;AACpG,eAAO,MAAM,MAAM,GAAI,OAAO,KAAK,EAAE,SAAS,OAAO,KAAG,YAiFvD,CAAA;AAED,2NAA2N;AAC3N,eAAO,MAAM,mBAAmB,GAAI,OAAO,KAAK,KAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAKvE,CAAA"}
|
|
@@ -2,17 +2,17 @@ import { Effect, Match as M, Option } from 'effect';
|
|
|
2
2
|
import * as Command from '../../command';
|
|
3
3
|
import { evo } from '../../struct';
|
|
4
4
|
import * as Task from '../../task';
|
|
5
|
-
import {
|
|
5
|
+
import { AdvancedAnimationFrame, EndedAnimation, StartedLeaveAnimating, TransitionedOut, } from './schema';
|
|
6
6
|
// UPDATE
|
|
7
7
|
const elementSelector = (id) => `#${id}`;
|
|
8
8
|
const withUpdateReturn = M.withReturnType();
|
|
9
|
-
/** Advances the
|
|
10
|
-
export const RequestFrame = Command.define('RequestFrame',
|
|
11
|
-
/** Waits for all CSS
|
|
12
|
-
export const
|
|
13
|
-
/** Processes
|
|
9
|
+
/** Advances the enter/leave lifecycle by waiting a double-rAF. */
|
|
10
|
+
export const RequestFrame = Command.define('RequestFrame', AdvancedAnimationFrame);
|
|
11
|
+
/** Waits for all CSS animations on the element to settle. Covers both CSS transitions and CSS keyframe animations. */
|
|
12
|
+
export const WaitForAnimationSettled = Command.define('WaitForAnimationSettled', EndedAnimation);
|
|
13
|
+
/** Processes an animation message and returns the next model, commands, and optional OutMessage. */
|
|
14
14
|
export const update = (model, message) => {
|
|
15
|
-
const maybeNextFrame = RequestFrame(Task.nextFrame.pipe(Effect.as(
|
|
15
|
+
const maybeNextFrame = RequestFrame(Task.nextFrame.pipe(Effect.as(AdvancedAnimationFrame())));
|
|
16
16
|
return M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
|
|
17
17
|
Showed: () => {
|
|
18
18
|
if (model.isShowing) {
|
|
@@ -42,10 +42,10 @@ export const update = (model, message) => {
|
|
|
42
42
|
Option.none(),
|
|
43
43
|
];
|
|
44
44
|
},
|
|
45
|
-
|
|
45
|
+
AdvancedAnimationFrame: () => M.value(model.transitionState).pipe(withUpdateReturn, M.when('EnterStart', () => [
|
|
46
46
|
evo(model, { transitionState: () => 'EnterAnimating' }),
|
|
47
47
|
[
|
|
48
|
-
|
|
48
|
+
WaitForAnimationSettled(Task.waitForAnimationSettled(elementSelector(model.id)).pipe(Effect.as(EndedAnimation()))),
|
|
49
49
|
],
|
|
50
50
|
Option.none(),
|
|
51
51
|
]), M.when('LeaveStart', () => [
|
|
@@ -53,7 +53,7 @@ export const update = (model, message) => {
|
|
|
53
53
|
[],
|
|
54
54
|
Option.some(StartedLeaveAnimating()),
|
|
55
55
|
]), M.orElse(() => [model, [], Option.none()])),
|
|
56
|
-
|
|
56
|
+
EndedAnimation: () => M.value(model.transitionState).pipe(withUpdateReturn, M.when('EnterAnimating', () => [
|
|
57
57
|
evo(model, { transitionState: () => 'Idle' }),
|
|
58
58
|
[],
|
|
59
59
|
Option.none(),
|
|
@@ -64,5 +64,5 @@ export const update = (model, message) => {
|
|
|
64
64
|
]), M.orElse(() => [model, [], Option.none()])),
|
|
65
65
|
}));
|
|
66
66
|
};
|
|
67
|
-
/** Creates the standard leave-phase command that waits for CSS
|
|
68
|
-
export const defaultLeaveCommand = (model) =>
|
|
67
|
+
/** Creates the standard leave-phase command that waits for CSS animations on the element to settle. Use this when handling the `StartedLeaveAnimating` OutMessage for components that don't need custom leave behavior. */
|
|
68
|
+
export const defaultLeaveCommand = (model) => WaitForAnimationSettled(Task.waitForAnimationSettled(elementSelector(model.id)).pipe(Effect.as(EndedAnimation())));
|
|
@@ -11,7 +11,7 @@ export declare const Model: S.extend<S.Struct<{
|
|
|
11
11
|
nullable: typeof S.Boolean;
|
|
12
12
|
immediate: typeof S.Boolean;
|
|
13
13
|
selectInputOnFocus: typeof S.Boolean;
|
|
14
|
-
|
|
14
|
+
animation: S.Struct<{
|
|
15
15
|
id: typeof S.String;
|
|
16
16
|
isShowing: typeof S.Boolean;
|
|
17
17
|
transitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
@@ -39,7 +39,7 @@ export declare const update: (model: {
|
|
|
39
39
|
readonly isOpen: boolean;
|
|
40
40
|
readonly isAnimated: boolean;
|
|
41
41
|
readonly isModal: boolean;
|
|
42
|
-
readonly
|
|
42
|
+
readonly animation: {
|
|
43
43
|
readonly id: string;
|
|
44
44
|
readonly isShowing: boolean;
|
|
45
45
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
@@ -61,7 +61,7 @@ export declare const update: (model: {
|
|
|
61
61
|
readonly isOpen: boolean;
|
|
62
62
|
readonly isAnimated: boolean;
|
|
63
63
|
readonly isModal: boolean;
|
|
64
|
-
readonly
|
|
64
|
+
readonly animation: {
|
|
65
65
|
readonly id: string;
|
|
66
66
|
readonly isShowing: boolean;
|
|
67
67
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
@@ -124,15 +124,15 @@ export declare const update: (model: {
|
|
|
124
124
|
} | {
|
|
125
125
|
readonly _tag: "CompletedFocusInput";
|
|
126
126
|
} | {
|
|
127
|
-
readonly _tag: "
|
|
127
|
+
readonly _tag: "GotAnimationMessage";
|
|
128
128
|
readonly message: {
|
|
129
129
|
readonly _tag: "Showed";
|
|
130
130
|
} | {
|
|
131
131
|
readonly _tag: "Hid";
|
|
132
132
|
} | {
|
|
133
|
-
readonly _tag: "
|
|
133
|
+
readonly _tag: "AdvancedAnimationFrame";
|
|
134
134
|
} | {
|
|
135
|
-
readonly _tag: "
|
|
135
|
+
readonly _tag: "EndedAnimation";
|
|
136
136
|
};
|
|
137
137
|
} | {
|
|
138
138
|
readonly _tag: "UpdatedInputValue";
|
|
@@ -158,7 +158,7 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
|
|
|
158
158
|
readonly isOpen: boolean;
|
|
159
159
|
readonly isAnimated: boolean;
|
|
160
160
|
readonly isModal: boolean;
|
|
161
|
-
readonly
|
|
161
|
+
readonly animation: {
|
|
162
162
|
readonly id: string;
|
|
163
163
|
readonly isShowing: boolean;
|
|
164
164
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { init, update, open, close, selectItem, view, lazy, Model, } from './single';
|
|
2
|
-
export { Message, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem,
|
|
2
|
+
export { Message, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusInput, ScrollIntoView, ClickItem, DetectMovementOrAnimationEnd, } from './shared';
|
|
3
3
|
export type { ActivationTrigger, Opened, Closed, ClosedByTab, ActivatedItem, DeactivatedItem, MovedPointerOverItem, RequestedItemClick, UpdatedInputValue, PressedToggleButton, ItemConfig, GroupHeading, } from './shared';
|
|
4
4
|
export type { InitConfig, ViewConfig } from './single';
|
|
5
5
|
export type { AnchorConfig } from '../anchor';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,KAAK,GACN,MAAM,UAAU,CAAA;AAEjB,OAAO,EACL,OAAO,EACP,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,KAAK,GACN,MAAM,UAAU,CAAA;AAEjB,OAAO,EACL,OAAO,EACP,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,4BAA4B,GAC7B,MAAM,UAAU,CAAA;AAEjB,YAAY,EACV,iBAAiB,EACjB,MAAM,EACN,MAAM,EACN,WAAW,EACX,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,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,3 +1,3 @@
|
|
|
1
1
|
export { init, update, open, close, selectItem, view, lazy, Model, } from './single';
|
|
2
|
-
export { Message, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem,
|
|
2
|
+
export { Message, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusInput, ScrollIntoView, ClickItem, DetectMovementOrAnimationEnd, } from './shared';
|
|
3
3
|
export * as Multi from './multiPublic';
|
|
@@ -16,7 +16,7 @@ export declare const BaseModel: S.Struct<{
|
|
|
16
16
|
nullable: typeof S.Boolean;
|
|
17
17
|
immediate: typeof S.Boolean;
|
|
18
18
|
selectInputOnFocus: typeof S.Boolean;
|
|
19
|
-
|
|
19
|
+
animation: S.Struct<{
|
|
20
20
|
id: typeof S.String;
|
|
21
21
|
isShowing: typeof S.Boolean;
|
|
22
22
|
transitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
@@ -89,9 +89,9 @@ export declare const CompletedFocusInput: import("../../schema").CallableTaggedS
|
|
|
89
89
|
export declare const CompletedScrollIntoView: import("../../schema").CallableTaggedStruct<"CompletedScrollIntoView", {}>;
|
|
90
90
|
/** Sent when the programmatic item click command completes. */
|
|
91
91
|
export declare const CompletedClickItem: import("../../schema").CallableTaggedStruct<"CompletedClickItem", {}>;
|
|
92
|
-
/** Wraps
|
|
93
|
-
export declare const
|
|
94
|
-
message: S.Union<[import("../../schema").CallableTaggedStruct<"Showed", {}>, import("../../schema").CallableTaggedStruct<"Hid", {}>, import("../../schema").CallableTaggedStruct<"
|
|
92
|
+
/** Wraps an Animation submodel message for delegation. */
|
|
93
|
+
export declare const GotAnimationMessage: import("../../schema").CallableTaggedStruct<"GotAnimationMessage", {
|
|
94
|
+
message: S.Union<[import("../../schema").CallableTaggedStruct<"Showed", {}>, import("../../schema").CallableTaggedStruct<"Hid", {}>, import("../../schema").CallableTaggedStruct<"AdvancedAnimationFrame", {}>, import("../../schema").CallableTaggedStruct<"EndedAnimation", {}>]>;
|
|
95
95
|
}>;
|
|
96
96
|
/** Sent when the user types in the input. */
|
|
97
97
|
export declare const UpdatedInputValue: import("../../schema").CallableTaggedStruct<"UpdatedInputValue", {
|
|
@@ -116,7 +116,7 @@ export declare const Message: S.Union<[
|
|
|
116
116
|
typeof CompletedFocusInput,
|
|
117
117
|
typeof CompletedScrollIntoView,
|
|
118
118
|
typeof CompletedClickItem,
|
|
119
|
-
typeof
|
|
119
|
+
typeof GotAnimationMessage,
|
|
120
120
|
typeof UpdatedInputValue,
|
|
121
121
|
typeof PressedToggleButton
|
|
122
122
|
]>;
|
|
@@ -179,17 +179,17 @@ export declare const ScrollIntoView: Command.CommandDefinition<"ScrollIntoView",
|
|
|
179
179
|
export declare const ClickItem: Command.CommandDefinition<"ClickItem", {
|
|
180
180
|
readonly _tag: "CompletedClickItem";
|
|
181
181
|
}>;
|
|
182
|
-
/** Detects whether the combobox input wrapper moved or the leave
|
|
183
|
-
export declare const
|
|
184
|
-
readonly _tag: "
|
|
182
|
+
/** Detects whether the combobox input wrapper moved or the leave animation ended — whichever comes first. Both outcomes signal the Animation submodel that leave is complete. */
|
|
183
|
+
export declare const DetectMovementOrAnimationEnd: Command.CommandDefinition<"DetectMovementOrAnimationEnd", {
|
|
184
|
+
readonly _tag: "GotAnimationMessage";
|
|
185
185
|
readonly message: {
|
|
186
186
|
readonly _tag: "Showed";
|
|
187
187
|
} | {
|
|
188
188
|
readonly _tag: "Hid";
|
|
189
189
|
} | {
|
|
190
|
-
readonly _tag: "
|
|
190
|
+
readonly _tag: "AdvancedAnimationFrame";
|
|
191
191
|
} | {
|
|
192
|
-
readonly _tag: "
|
|
192
|
+
readonly _tag: "EndedAnimation";
|
|
193
193
|
};
|
|
194
194
|
}>;
|
|
195
195
|
/** Creates a combobox update function from variant-specific handlers. Shared logic (open, close, activate, transition) is handled internally; only close, selection, and immediate-activation behavior varies by variant. */
|
|
@@ -243,15 +243,15 @@ export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
|
|
|
243
243
|
} | {
|
|
244
244
|
readonly _tag: "CompletedFocusInput";
|
|
245
245
|
} | {
|
|
246
|
-
readonly _tag: "
|
|
246
|
+
readonly _tag: "GotAnimationMessage";
|
|
247
247
|
readonly message: {
|
|
248
248
|
readonly _tag: "Showed";
|
|
249
249
|
} | {
|
|
250
250
|
readonly _tag: "Hid";
|
|
251
251
|
} | {
|
|
252
|
-
readonly _tag: "
|
|
252
|
+
readonly _tag: "AdvancedAnimationFrame";
|
|
253
253
|
} | {
|
|
254
|
-
readonly _tag: "
|
|
254
|
+
readonly _tag: "EndedAnimation";
|
|
255
255
|
};
|
|
256
256
|
} | {
|
|
257
257
|
readonly _tag: "UpdatedInputValue";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAEN,MAAM,EAEN,MAAM,IAAI,CAAC,EAEZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,IAAI,EAAQ,MAAM,YAAY,CAAA;AAK5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAEN,MAAM,EAEN,MAAM,IAAI,CAAC,EAEZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,IAAI,EAAQ,MAAM,YAAY,CAAA;AAK5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAc7C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG1C,OAAO,EAAE,eAAe,EAAE,CAAA;AAI1B,6FAA6F;AAC7F,eAAO,MAAM,iBAAiB,oCAAmC,CAAA;AACjE,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAA;AAE7D,oKAAoK;AACpK,eAAO,MAAM,SAAS;;;;;;;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CAAC,OAAO,CAAC,CAAC,CAAA;IACvD,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,OAAO,EAAE,IAAI,SAAS,MAAM,EAC3B,QAAQ,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,KAC3C,IA+iBF,CAAA"}
|
|
@@ -6,13 +6,13 @@ import { m } from '../../message';
|
|
|
6
6
|
import { makeConstrainedEvo } from '../../struct';
|
|
7
7
|
import * as Task from '../../task';
|
|
8
8
|
import { anchorHooks } from '../anchor';
|
|
9
|
+
// NOTE: Animation imports are split across schema + update to avoid a circular
|
|
10
|
+
// dependency: animation → html → runtime → devtools → combobox → animation.
|
|
11
|
+
// The barrel (../animation) imports from html, which starts the cycle.
|
|
12
|
+
import { EndedAnimation as AnimationEndedAnimation, Hid as AnimationHid, Message as AnimationMessage, Model as AnimationModel, Showed as AnimationShowed, init as animationInit, } from '../animation/schema';
|
|
13
|
+
import { update as animationUpdate } from '../animation/update';
|
|
9
14
|
import { groupContiguous } from '../group';
|
|
10
15
|
import { findFirstEnabledIndex, keyToIndex } from '../keyboard';
|
|
11
|
-
// NOTE: Transition imports are split across schema + update to avoid a circular
|
|
12
|
-
// dependency: transition → html → runtime → devtools → combobox → transition.
|
|
13
|
-
// The barrel (../transition) imports from html, which starts the cycle.
|
|
14
|
-
import { EndedTransition as TransitionEndedTransition, Hid as TransitionHid, Message as TransitionMessage, Model as TransitionModel, Showed as TransitionShowed, init as transitionInit, } from '../transition/schema';
|
|
15
|
-
import { update as transitionUpdate } from '../transition/update';
|
|
16
16
|
export { groupContiguous };
|
|
17
17
|
// MODEL
|
|
18
18
|
/** Schema for the activation trigger — whether the user interacted via mouse or keyboard. */
|
|
@@ -26,7 +26,7 @@ export const BaseModel = S.Struct({
|
|
|
26
26
|
nullable: S.Boolean,
|
|
27
27
|
immediate: S.Boolean,
|
|
28
28
|
selectInputOnFocus: S.Boolean,
|
|
29
|
-
|
|
29
|
+
animation: AnimationModel,
|
|
30
30
|
maybeActiveItemIndex: S.OptionFromSelf(S.Number),
|
|
31
31
|
activationTrigger: ActivationTrigger,
|
|
32
32
|
inputValue: S.String,
|
|
@@ -41,7 +41,7 @@ export const baseInit = (config) => ({
|
|
|
41
41
|
nullable: config.nullable ?? false,
|
|
42
42
|
immediate: config.immediate ?? false,
|
|
43
43
|
selectInputOnFocus: config.selectInputOnFocus ?? false,
|
|
44
|
-
|
|
44
|
+
animation: animationInit({ id: `${config.id}-items` }),
|
|
45
45
|
maybeActiveItemIndex: Option.none(),
|
|
46
46
|
activationTrigger: 'Keyboard',
|
|
47
47
|
inputValue: '',
|
|
@@ -93,9 +93,9 @@ export const CompletedFocusInput = m('CompletedFocusInput');
|
|
|
93
93
|
export const CompletedScrollIntoView = m('CompletedScrollIntoView');
|
|
94
94
|
/** Sent when the programmatic item click command completes. */
|
|
95
95
|
export const CompletedClickItem = m('CompletedClickItem');
|
|
96
|
-
/** Wraps
|
|
97
|
-
export const
|
|
98
|
-
message:
|
|
96
|
+
/** Wraps an Animation submodel message for delegation. */
|
|
97
|
+
export const GotAnimationMessage = m('GotAnimationMessage', {
|
|
98
|
+
message: AnimationMessage,
|
|
99
99
|
});
|
|
100
100
|
/** Sent when the user types in the input. */
|
|
101
101
|
export const UpdatedInputValue = m('UpdatedInputValue', {
|
|
@@ -104,7 +104,7 @@ export const UpdatedInputValue = m('UpdatedInputValue', {
|
|
|
104
104
|
/** Sent when the optional toggle button is clicked. */
|
|
105
105
|
export const PressedToggleButton = m('PressedToggleButton');
|
|
106
106
|
/** Union of all messages the combobox component can produce. */
|
|
107
|
-
export const Message = S.Union(Opened, Closed, ClosedByTab, ActivatedItem, DeactivatedItem, SelectedItem, MovedPointerOverItem, RequestedItemClick, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem,
|
|
107
|
+
export const Message = S.Union(Opened, Closed, ClosedByTab, ActivatedItem, DeactivatedItem, SelectedItem, MovedPointerOverItem, RequestedItemClick, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem, GotAnimationMessage, UpdatedInputValue, PressedToggleButton);
|
|
108
108
|
// SELECTORS
|
|
109
109
|
export const inputSelector = (id) => `#${id}-input`;
|
|
110
110
|
export const inputWrapperSelector = (id) => `#${id}-input-wrapper`;
|
|
@@ -134,26 +134,26 @@ export const FocusInput = Command.define('FocusInput', CompletedFocusInput);
|
|
|
134
134
|
export const ScrollIntoView = Command.define('ScrollIntoView', CompletedScrollIntoView);
|
|
135
135
|
/** Programmatically clicks the active combobox item's DOM element. */
|
|
136
136
|
export const ClickItem = Command.define('ClickItem', CompletedClickItem);
|
|
137
|
-
/** Detects whether the combobox input wrapper moved or the leave
|
|
138
|
-
export const
|
|
139
|
-
const
|
|
140
|
-
const [
|
|
141
|
-
const mappedCommands =
|
|
137
|
+
/** Detects whether the combobox input wrapper moved or the leave animation ended — whichever comes first. Both outcomes signal the Animation submodel that leave is complete. */
|
|
138
|
+
export const DetectMovementOrAnimationEnd = Command.define('DetectMovementOrAnimationEnd', GotAnimationMessage);
|
|
139
|
+
const delegateToAnimation = (model, animationMessage) => {
|
|
140
|
+
const [nextAnimation, animationCommands, maybeOutMessage] = animationUpdate(model.animation, animationMessage);
|
|
141
|
+
const mappedCommands = animationCommands.map(Command.mapEffect(Effect.map(message => GotAnimationMessage({ message }))));
|
|
142
142
|
const additionalCommands = Option.match(maybeOutMessage, {
|
|
143
143
|
onNone: () => [],
|
|
144
144
|
onSome: M.type().pipe(M.tagsExhaustive({
|
|
145
145
|
StartedLeaveAnimating: () => [
|
|
146
|
-
|
|
147
|
-
message:
|
|
148
|
-
}))), Task.
|
|
149
|
-
message:
|
|
146
|
+
DetectMovementOrAnimationEnd(Effect.raceFirst(Task.detectElementMovement(inputWrapperSelector(model.id)).pipe(Effect.as(GotAnimationMessage({
|
|
147
|
+
message: AnimationEndedAnimation(),
|
|
148
|
+
}))), Task.waitForAnimationSettled(itemsSelector(model.id)).pipe(Effect.as(GotAnimationMessage({
|
|
149
|
+
message: AnimationEndedAnimation(),
|
|
150
150
|
}))))),
|
|
151
151
|
],
|
|
152
152
|
TransitionedOut: () => [],
|
|
153
153
|
})),
|
|
154
154
|
});
|
|
155
155
|
return [
|
|
156
|
-
constrainedEvo(model, {
|
|
156
|
+
constrainedEvo(model, { animation: () => nextAnimation }),
|
|
157
157
|
[...mappedCommands, ...additionalCommands],
|
|
158
158
|
];
|
|
159
159
|
};
|
|
@@ -171,12 +171,12 @@ export const makeUpdate = (handlers) => {
|
|
|
171
171
|
const focusInput = FocusInput(Task.focus(inputSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusInput())));
|
|
172
172
|
const openCombobox = (baseModel) => {
|
|
173
173
|
if (model.isAnimated) {
|
|
174
|
-
const [nextModel,
|
|
174
|
+
const [nextModel, animationCommands] = delegateToAnimation(baseModel, AnimationShowed());
|
|
175
175
|
return [
|
|
176
176
|
constrainedEvo(nextModel, { isOpen: () => true }),
|
|
177
177
|
[
|
|
178
178
|
...Array.getSomes([maybeLockScroll, maybeInertOthers]),
|
|
179
|
-
...
|
|
179
|
+
...animationCommands,
|
|
180
180
|
],
|
|
181
181
|
];
|
|
182
182
|
}
|
|
@@ -188,8 +188,8 @@ export const makeUpdate = (handlers) => {
|
|
|
188
188
|
const closeCombobox = (baseModel, commands) => {
|
|
189
189
|
const closed = handlers.handleClose(baseModel);
|
|
190
190
|
if (model.isAnimated) {
|
|
191
|
-
const [nextModel,
|
|
192
|
-
return [nextModel, [...commands, ...
|
|
191
|
+
const [nextModel, animationCommands] = delegateToAnimation(closed, AnimationHid());
|
|
192
|
+
return [nextModel, [...commands, ...animationCommands]];
|
|
193
193
|
}
|
|
194
194
|
return [closed, commands];
|
|
195
195
|
};
|
|
@@ -251,8 +251,8 @@ export const makeUpdate = (handlers) => {
|
|
|
251
251
|
maybeRestoreInert,
|
|
252
252
|
});
|
|
253
253
|
if (model.isOpen && !nextModel.isOpen && model.isAnimated) {
|
|
254
|
-
const [transitionedModel,
|
|
255
|
-
return [transitionedModel, [...commands, ...
|
|
254
|
+
const [transitionedModel, animationCommands] = delegateToAnimation(nextModel, AnimationHid());
|
|
255
|
+
return [transitionedModel, [...commands, ...animationCommands]];
|
|
256
256
|
}
|
|
257
257
|
return [nextModel, commands];
|
|
258
258
|
},
|
|
@@ -291,7 +291,7 @@ export const makeUpdate = (handlers) => {
|
|
|
291
291
|
}));
|
|
292
292
|
return [nextModel, [focusInput, ...commands]];
|
|
293
293
|
},
|
|
294
|
-
|
|
294
|
+
GotAnimationMessage: ({ message: animationMessage }) => delegateToAnimation(model, animationMessage),
|
|
295
295
|
CompletedLockScroll: () => [model, []],
|
|
296
296
|
CompletedUnlockScroll: () => [model, []],
|
|
297
297
|
CompletedSetupInert: () => [model, []],
|
|
@@ -305,7 +305,7 @@ export const makeUpdate = (handlers) => {
|
|
|
305
305
|
/** 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. */
|
|
306
306
|
export const makeView = (behavior) => (config) => {
|
|
307
307
|
const { div, input, AriaActiveDescendant, AriaControls, AriaDisabled, AriaExpanded, AriaInvalid, AriaLabelledBy, AriaMultiSelectable, AriaSelected, Attribute, Autocomplete, Class, DataAttribute, Id, Name, OnBlur, OnClick, OnDestroy, OnFocus, OnInput, OnInsert, OnKeyDownPreventDefault, OnPointerLeave, OnPointerMove, Placeholder, Role, Style, Tabindex, Type, Value, keyed, } = html();
|
|
308
|
-
const { model: { id, isOpen, immediate,
|
|
308
|
+
const { model: { id, isOpen, immediate, animation: { transitionState }, maybeActiveItemIndex, }, toParentMessage, onSelectedItem, items, itemToConfig, itemToValue, itemToDisplayText, isItemDisabled, inputClassName, inputAttributes = [], inputPlaceholder, inputWrapperClassName, inputWrapperAttributes = [], itemsClassName, itemsAttributes = [], itemsScrollClassName, itemsScrollAttributes = [], backdropClassName, backdropAttributes = [], className, attributes = [], buttonContent, buttonClassName, buttonAttributes = [], formName, isDisabled, isInvalid, openOnFocus, itemGroupKey, groupToHeading, groupClassName, groupAttributes = [], separatorClassName, separatorAttributes = [], anchor, } = config;
|
|
309
309
|
const dispatchSelectedItem = (item, index) => onSelectedItem
|
|
310
310
|
? onSelectedItem(itemToValue(item, index))
|
|
311
311
|
: toParentMessage(SelectedItem({
|
|
@@ -314,7 +314,7 @@ export const makeView = (behavior) => (config) => {
|
|
|
314
314
|
}));
|
|
315
315
|
const isLeaving = transitionState === 'LeaveStart' || transitionState === 'LeaveAnimating';
|
|
316
316
|
const isVisible = isOpen || isLeaving;
|
|
317
|
-
const
|
|
317
|
+
const animationAttributes = M.value(transitionState).pipe(M.when('EnterStart', () => [
|
|
318
318
|
DataAttribute('closed', ''),
|
|
319
319
|
DataAttribute('enter', ''),
|
|
320
320
|
DataAttribute('transition', ''),
|
|
@@ -458,7 +458,7 @@ export const makeView = (behavior) => (config) => {
|
|
|
458
458
|
AriaLabelledBy(`${id}-input`),
|
|
459
459
|
Tabindex(-1),
|
|
460
460
|
...anchorAttributes,
|
|
461
|
-
...
|
|
461
|
+
...animationAttributes,
|
|
462
462
|
...(itemsClassName ? [Class(itemsClassName)] : []),
|
|
463
463
|
...itemsAttributes,
|
|
464
464
|
];
|