foldkit 0.71.0 → 0.72.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/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/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 +1 -1
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +1 -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/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 +5 -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
package/dist/task/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { getTime, getTimeZone, getZonedTime, getZonedTimeIn } from './time';
|
|
|
3
3
|
export { advanceFocus, focus, showModal, closeModal, clickElement, scrollIntoView, } from './dom';
|
|
4
4
|
export type { FocusDirection } from './dom';
|
|
5
5
|
export { detectElementMovement } from './elementMovement';
|
|
6
|
-
export { delay, nextFrame,
|
|
6
|
+
export { delay, nextFrame, waitForAnimationSettled } from './timing';
|
|
7
7
|
export { randomInt, uuid } from './random';
|
|
8
8
|
export { lockScroll, unlockScroll } from './scrollLock';
|
|
9
9
|
export { inertOthers, restoreInert } from './inert';
|
package/dist/task/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAC3E,OAAO,EACL,YAAY,EACZ,KAAK,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,cAAc,GACf,MAAM,OAAO,CAAA;AACd,YAAY,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAC3E,OAAO,EACL,YAAY,EACZ,KAAK,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,cAAc,GACf,MAAM,OAAO,CAAA;AACd,YAAY,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA"}
|
package/dist/task/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export { ElementNotFound, TimeZoneError } from './error';
|
|
|
2
2
|
export { getTime, getTimeZone, getZonedTime, getZonedTimeIn } from './time';
|
|
3
3
|
export { advanceFocus, focus, showModal, closeModal, clickElement, scrollIntoView, } from './dom';
|
|
4
4
|
export { detectElementMovement } from './elementMovement';
|
|
5
|
-
export { delay, nextFrame,
|
|
5
|
+
export { delay, nextFrame, waitForAnimationSettled } from './timing';
|
|
6
6
|
export { randomInt, uuid } from './random';
|
|
7
7
|
export { lockScroll, unlockScroll } from './scrollLock';
|
|
8
8
|
export { inertOthers, restoreInert } from './inert';
|
package/dist/task/public.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ElementNotFound, TimeZoneError, getTime, getTimeZone, getZonedTime, getZonedTimeIn, focus, showModal, closeModal, clickElement, delay, scrollIntoView, randomInt, uuid, nextFrame,
|
|
1
|
+
export { ElementNotFound, TimeZoneError, getTime, getTimeZone, getZonedTime, getZonedTimeIn, focus, showModal, closeModal, clickElement, delay, scrollIntoView, randomInt, uuid, nextFrame, waitForAnimationSettled, } from './index';
|
|
2
2
|
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/task/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,aAAa,EACb,OAAO,EACP,WAAW,EACX,YAAY,EACZ,cAAc,EACd,KAAK,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,EACL,cAAc,EACd,SAAS,EACT,IAAI,EACJ,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/task/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,aAAa,EACb,OAAO,EACP,WAAW,EACX,YAAY,EACZ,cAAc,EACd,KAAK,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,EACL,cAAc,EACd,SAAS,EACT,IAAI,EACJ,SAAS,EACT,uBAAuB,GACxB,MAAM,SAAS,CAAA"}
|
package/dist/task/public.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ElementNotFound, TimeZoneError, getTime, getTimeZone, getZonedTime, getZonedTimeIn, focus, showModal, closeModal, clickElement, delay, scrollIntoView, randomInt, uuid, nextFrame,
|
|
1
|
+
export { ElementNotFound, TimeZoneError, getTime, getTimeZone, getZonedTime, getZonedTimeIn, focus, showModal, closeModal, clickElement, delay, scrollIntoView, randomInt, uuid, nextFrame, waitForAnimationSettled, } from './index';
|
package/dist/task/timing.d.ts
CHANGED
|
@@ -22,14 +22,18 @@ export declare const delay: (duration: Duration.DurationInput) => Effect.Effect<
|
|
|
22
22
|
*/
|
|
23
23
|
export declare const nextFrame: Effect.Effect<void>;
|
|
24
24
|
/**
|
|
25
|
-
* Waits for all CSS
|
|
26
|
-
*
|
|
27
|
-
* immediately if the element is missing or has no
|
|
25
|
+
* Waits for all CSS animations on the element matching the selector to settle.
|
|
26
|
+
* Covers both CSS transitions and CSS keyframe animations via the Web Animations
|
|
27
|
+
* API. Falls back to completing immediately if the element is missing or has no
|
|
28
|
+
* active animations.
|
|
29
|
+
*
|
|
30
|
+
* Leave animations must be finite. `animation-iteration-count: infinite` will
|
|
31
|
+
* keep the underlying `.finished` promise pending and hang the caller.
|
|
28
32
|
*
|
|
29
33
|
* @example
|
|
30
34
|
* ```typescript
|
|
31
|
-
* Task.
|
|
35
|
+
* Task.waitForAnimationSettled('#menu-items').pipe(Effect.as(EndedAnimation()))
|
|
32
36
|
* ```
|
|
33
37
|
*/
|
|
34
|
-
export declare const
|
|
38
|
+
export declare const waitForAnimationSettled: (selector: string) => Effect.Effect<void>;
|
|
35
39
|
//# sourceMappingURL=timing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../../src/task/timing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEzC;;;;;;;;GAQG;AACH,eAAO,MAAM,KAAK,GAAI,UAAU,QAAQ,CAAC,aAAa,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CACnD,CAAA;AAExB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAMxC,CAAA;AAEF
|
|
1
|
+
{"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../../src/task/timing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEzC;;;;;;;;GAQG;AACH,eAAO,MAAM,KAAK,GAAI,UAAU,QAAQ,CAAC,aAAa,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CACnD,CAAA;AAExB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAMxC,CAAA;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,CAYjB,CAAA"}
|
package/dist/task/timing.js
CHANGED
|
@@ -28,24 +28,24 @@ export const nextFrame = Effect.async(resume => {
|
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
30
|
/**
|
|
31
|
-
* Waits for all CSS
|
|
32
|
-
*
|
|
33
|
-
* immediately if the element is missing or has no
|
|
31
|
+
* Waits for all CSS animations on the element matching the selector to settle.
|
|
32
|
+
* Covers both CSS transitions and CSS keyframe animations via the Web Animations
|
|
33
|
+
* API. Falls back to completing immediately if the element is missing or has no
|
|
34
|
+
* active animations.
|
|
35
|
+
*
|
|
36
|
+
* Leave animations must be finite. `animation-iteration-count: infinite` will
|
|
37
|
+
* keep the underlying `.finished` promise pending and hang the caller.
|
|
34
38
|
*
|
|
35
39
|
* @example
|
|
36
40
|
* ```typescript
|
|
37
|
-
* Task.
|
|
41
|
+
* Task.waitForAnimationSettled('#menu-items').pipe(Effect.as(EndedAnimation()))
|
|
38
42
|
* ```
|
|
39
43
|
*/
|
|
40
|
-
export const
|
|
44
|
+
export const waitForAnimationSettled = (selector) => Effect.async(resume => {
|
|
41
45
|
requestAnimationFrame(async () => {
|
|
42
46
|
const element = document.querySelector(selector);
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
.getAnimations()
|
|
46
|
-
.filter(animation => 'transitionProperty' in animation)
|
|
47
|
-
: [];
|
|
48
|
-
await Promise.allSettled(cssTransitions.map(({ finished }) => finished));
|
|
47
|
+
const animations = element instanceof HTMLElement ? element.getAnimations() : [];
|
|
48
|
+
await Promise.allSettled(animations.map(({ finished }) => finished));
|
|
49
49
|
resume(Effect.void);
|
|
50
50
|
});
|
|
51
51
|
});
|
|
@@ -7,7 +7,7 @@ export declare const Model: S.Struct<{
|
|
|
7
7
|
id: typeof S.String;
|
|
8
8
|
isOpen: typeof S.Boolean;
|
|
9
9
|
isAnimated: typeof S.Boolean;
|
|
10
|
-
|
|
10
|
+
animation: S.Struct<{
|
|
11
11
|
id: typeof S.String;
|
|
12
12
|
isShowing: typeof S.Boolean;
|
|
13
13
|
transitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
@@ -19,13 +19,13 @@ export type Model = typeof Model.Type;
|
|
|
19
19
|
export declare const ClickedToggle: import("../../schema").CallableTaggedStruct<"ClickedToggle", {}>;
|
|
20
20
|
export declare const ClickedSubmit: import("../../schema").CallableTaggedStruct<"ClickedSubmit", {}>;
|
|
21
21
|
export declare const GotDialogMessage: import("../../schema").CallableTaggedStruct<"GotDialogMessage", {
|
|
22
|
-
message: S.Union<[import("../../schema").CallableTaggedStruct<"Opened", {}>, import("../../schema").CallableTaggedStruct<"Closed", {}>, import("../../schema").CallableTaggedStruct<"CompletedShowDialog", {}>, import("../../schema").CallableTaggedStruct<"CompletedCloseDialog", {}>, import("../../schema").CallableTaggedStruct<"
|
|
23
|
-
message: S.Union<[import("../../schema").CallableTaggedStruct<"Showed", {}>, import("../../schema").CallableTaggedStruct<"Hid", {}>, import("../../schema").CallableTaggedStruct<"
|
|
22
|
+
message: S.Union<[import("../../schema").CallableTaggedStruct<"Opened", {}>, import("../../schema").CallableTaggedStruct<"Closed", {}>, import("../../schema").CallableTaggedStruct<"CompletedShowDialog", {}>, import("../../schema").CallableTaggedStruct<"CompletedCloseDialog", {}>, import("../../schema").CallableTaggedStruct<"GotAnimationMessage", {
|
|
23
|
+
message: S.Union<[import("../../schema").CallableTaggedStruct<"Showed", {}>, import("../../schema").CallableTaggedStruct<"Hid", {}>, import("../../schema").CallableTaggedStruct<"AdvancedAnimationFrame", {}>, import("../../schema").CallableTaggedStruct<"EndedAnimation", {}>]>;
|
|
24
24
|
}>]>;
|
|
25
25
|
}>;
|
|
26
26
|
export declare const Message: S.Union<[import("../../schema").CallableTaggedStruct<"ClickedToggle", {}>, import("../../schema").CallableTaggedStruct<"ClickedSubmit", {}>, import("../../schema").CallableTaggedStruct<"GotDialogMessage", {
|
|
27
|
-
message: S.Union<[import("../../schema").CallableTaggedStruct<"Opened", {}>, import("../../schema").CallableTaggedStruct<"Closed", {}>, import("../../schema").CallableTaggedStruct<"CompletedShowDialog", {}>, import("../../schema").CallableTaggedStruct<"CompletedCloseDialog", {}>, import("../../schema").CallableTaggedStruct<"
|
|
28
|
-
message: S.Union<[import("../../schema").CallableTaggedStruct<"Showed", {}>, import("../../schema").CallableTaggedStruct<"Hid", {}>, import("../../schema").CallableTaggedStruct<"
|
|
27
|
+
message: S.Union<[import("../../schema").CallableTaggedStruct<"Opened", {}>, import("../../schema").CallableTaggedStruct<"Closed", {}>, import("../../schema").CallableTaggedStruct<"CompletedShowDialog", {}>, import("../../schema").CallableTaggedStruct<"CompletedCloseDialog", {}>, import("../../schema").CallableTaggedStruct<"GotAnimationMessage", {
|
|
28
|
+
message: S.Union<[import("../../schema").CallableTaggedStruct<"Showed", {}>, import("../../schema").CallableTaggedStruct<"Hid", {}>, import("../../schema").CallableTaggedStruct<"AdvancedAnimationFrame", {}>, import("../../schema").CallableTaggedStruct<"EndedAnimation", {}>]>;
|
|
29
29
|
}>]>;
|
|
30
30
|
}>]>;
|
|
31
31
|
export type Message = typeof Message.Type;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type Attribute, type Html, type TagName } from '../../html';
|
|
2
|
-
import {
|
|
3
|
-
import { RequestFrame,
|
|
2
|
+
import { AdvancedAnimationFrame, EndedAnimation, Hid, Message, Model, OutMessage, Showed, StartedLeaveAnimating, TransitionState, TransitionedOut, init } from './schema';
|
|
3
|
+
import { RequestFrame, WaitForAnimationSettled, defaultLeaveCommand, update } from './update';
|
|
4
4
|
export type { InitConfig } from './schema';
|
|
5
|
-
export {
|
|
6
|
-
export { RequestFrame,
|
|
7
|
-
/** Configuration for rendering
|
|
5
|
+
export { AdvancedAnimationFrame, EndedAnimation, Hid, init, Message, Model, OutMessage, Showed, StartedLeaveAnimating, TransitionState, TransitionedOut, };
|
|
6
|
+
export { RequestFrame, WaitForAnimationSettled, defaultLeaveCommand, update };
|
|
7
|
+
/** Configuration for rendering an animation with `view`. */
|
|
8
8
|
export type ViewConfig<Message> = Readonly<{
|
|
9
9
|
model: Model;
|
|
10
10
|
content: Html;
|
|
@@ -16,16 +16,17 @@ export type ViewConfig<Message> = Readonly<{
|
|
|
16
16
|
* when hidden (collapsed to zero height) instead of being removed. */
|
|
17
17
|
animateSize?: boolean;
|
|
18
18
|
}>;
|
|
19
|
-
/** Renders a headless
|
|
19
|
+
/** Renders a headless animation wrapper that coordinates CSS transitions and
|
|
20
|
+
* CSS keyframe animations via data attributes.
|
|
20
21
|
*
|
|
21
|
-
* Data attributes reflect the current
|
|
22
|
+
* Data attributes reflect the current lifecycle phase:
|
|
22
23
|
* - `data-closed` — element is in its hidden/initial state
|
|
23
24
|
* - `data-enter` — enter animation is active
|
|
24
25
|
* - `data-leave` — leave animation is active
|
|
25
26
|
* - `data-transition` — any animation is active
|
|
26
27
|
*/
|
|
27
28
|
export declare const view: <Message>(config: ViewConfig<Message>) => Html;
|
|
28
|
-
/** Creates a memoized
|
|
29
|
+
/** Creates a memoized animation view. Static config (className, element, etc.)
|
|
29
30
|
* is captured in a closure. Dynamic fields — `model` and `content` — are
|
|
30
31
|
* compared by reference per render via `createLazy`. */
|
|
31
32
|
export declare const lazy: <Message>(staticConfig: Omit<ViewConfig<Message>, "model" | "content">) => ((model: Model, content: Html) => Html);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/animation/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,OAAO,EAGb,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,GAAG,EACH,OAAO,EACP,KAAK,EACL,UAAU,EACV,MAAM,EACN,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,IAAI,EACL,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,mBAAmB,EACnB,MAAM,EACP,MAAM,UAAU,CAAA;AAEjB,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,GAAG,EACH,IAAI,EACJ,OAAO,EACP,KAAK,EACL,UAAU,EACV,MAAM,EACN,qBAAqB,EACrB,eAAe,EACf,eAAe,GAChB,CAAA;AAED,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,EAAE,CAAA;AAI7E,4DAA4D;AAC5D,MAAM,MAAM,UAAU,CAAC,OAAO,IAAI,QAAQ,CAAC;IACzC,KAAK,EAAE,KAAK,CAAA;IACZ,OAAO,EAAE,IAAI,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;2EAEuE;IACvE,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC,CAAA;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,GAAI,OAAO,EAAE,QAAQ,UAAU,CAAC,OAAO,CAAC,KAAG,IA+F3D,CAAA;AAED;;yDAEyD;AACzD,eAAO,MAAM,IAAI,GAAI,OAAO,EAC1B,cAAc,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC,KAC3D,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,KAAK,IAAI,CAaxC,CAAA"}
|
|
@@ -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";
|