foldkit 0.86.0 → 0.88.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/command/index.d.ts +60 -13
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +41 -16
- package/dist/command/public.d.ts +1 -1
- package/dist/command/public.d.ts.map +1 -1
- package/dist/devTools/overlay.d.ts +44 -20
- package/dist/devTools/overlay.d.ts.map +1 -1
- package/dist/devTools/overlay.js +120 -79
- package/dist/devTools/protocol.d.ts +48 -11
- package/dist/devTools/protocol.d.ts.map +1 -1
- package/dist/devTools/protocol.js +8 -3
- package/dist/devTools/serialize.d.ts +8 -2
- package/dist/devTools/serialize.d.ts.map +1 -1
- package/dist/devTools/serialize.js +11 -2
- package/dist/devTools/store.d.ts +8 -4
- package/dist/devTools/store.d.ts.map +1 -1
- package/dist/devTools/store.js +6 -6
- package/dist/devTools/webSocketBridge.d.ts.map +1 -1
- package/dist/devTools/webSocketBridge.js +2 -2
- package/dist/{task → dom}/dom.d.ts +10 -10
- package/dist/dom/dom.d.ts.map +1 -0
- package/dist/{task → dom}/dom.js +15 -15
- package/dist/{task → dom}/elementMovement.d.ts +1 -1
- package/dist/dom/elementMovement.d.ts.map +1 -0
- package/dist/{task → dom}/elementMovement.js +3 -3
- package/dist/{task → dom}/error.d.ts +0 -8
- package/dist/dom/error.d.ts.map +1 -0
- package/dist/{task → dom}/error.js +0 -3
- package/dist/dom/index.d.ts +8 -0
- package/dist/dom/index.d.ts.map +1 -0
- package/dist/dom/index.js +6 -0
- package/dist/{task → dom}/inert.d.ts +4 -3
- package/dist/dom/inert.d.ts.map +1 -0
- package/dist/{task → dom}/inert.js +4 -3
- package/dist/dom/public.d.ts +3 -0
- package/dist/dom/public.d.ts.map +1 -0
- package/dist/dom/public.js +1 -0
- package/dist/{task → dom}/scrollLock.d.ts +3 -3
- package/dist/dom/scrollLock.d.ts.map +1 -0
- package/dist/{task → dom}/scrollLock.js +3 -3
- package/dist/dom/waitForAnimation.d.ts +17 -0
- package/dist/dom/waitForAnimation.d.ts.map +1 -0
- package/dist/dom/waitForAnimation.js +23 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/render/index.d.ts +2 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +1 -0
- package/dist/render/public.d.ts +2 -0
- package/dist/render/public.d.ts.map +1 -0
- package/dist/render/public.js +1 -0
- package/dist/render/render.d.ts +40 -0
- package/dist/render/render.d.ts.map +1 -0
- package/dist/render/render.js +48 -0
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +12 -5
- package/dist/test/apps/counter.d.ts +14 -13
- package/dist/test/apps/counter.d.ts.map +1 -1
- package/dist/test/apps/counter.js +6 -3
- package/dist/test/apps/formChild.d.ts +4 -17
- package/dist/test/apps/formChild.d.ts.map +1 -1
- package/dist/test/apps/formChild.js +4 -6
- package/dist/test/apps/login.d.ts +3 -6
- package/dist/test/apps/login.d.ts.map +1 -1
- package/dist/test/apps/login.js +2 -3
- package/dist/test/apps/resumeUpload.d.ts +9 -7
- package/dist/test/apps/resumeUpload.d.ts.map +1 -1
- package/dist/test/apps/resumeUpload.js +4 -6
- package/dist/test/internal.d.ts +58 -13
- package/dist/test/internal.d.ts.map +1 -1
- package/dist/test/internal.js +121 -39
- package/dist/test/scene.d.ts +14 -3
- package/dist/test/scene.d.ts.map +1 -1
- package/dist/test/scene.js +21 -15
- package/dist/test/story.d.ts +15 -5
- package/dist/test/story.d.ts.map +1 -1
- package/dist/test/story.js +22 -15
- package/dist/ui/animation/update.d.ts +7 -5
- package/dist/ui/animation/update.d.ts.map +1 -1
- package/dist/ui/animation/update.js +8 -9
- package/dist/ui/calendar/index.d.ts +7 -8
- package/dist/ui/calendar/index.d.ts.map +1 -1
- package/dist/ui/calendar/index.js +8 -11
- package/dist/ui/calendar/public.d.ts +1 -1
- package/dist/ui/calendar/public.d.ts.map +1 -1
- package/dist/ui/calendar/public.js +1 -1
- package/dist/ui/combobox/multi.d.ts +1 -0
- package/dist/ui/combobox/multi.d.ts.map +1 -1
- package/dist/ui/combobox/shared.d.ts +32 -17
- package/dist/ui/combobox/shared.d.ts.map +1 -1
- package/dist/ui/combobox/shared.js +18 -29
- package/dist/ui/combobox/single.d.ts +1 -0
- package/dist/ui/combobox/single.d.ts.map +1 -1
- package/dist/ui/dialog/index.d.ts +10 -5
- package/dist/ui/dialog/index.d.ts.map +1 -1
- package/dist/ui/dialog/index.js +12 -11
- package/dist/ui/disclosure/index.d.ts +5 -3
- package/dist/ui/disclosure/index.d.ts.map +1 -1
- package/dist/ui/disclosure/index.js +4 -4
- package/dist/ui/dragAndDrop/index.d.ts +14 -7
- package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
- package/dist/ui/dragAndDrop/index.js +20 -9
- package/dist/ui/listbox/multi.d.ts +2 -1
- package/dist/ui/listbox/multi.d.ts.map +1 -1
- package/dist/ui/listbox/shared.d.ts +41 -22
- package/dist/ui/listbox/shared.d.ts.map +1 -1
- package/dist/ui/listbox/shared.js +22 -35
- package/dist/ui/listbox/single.d.ts +2 -1
- package/dist/ui/listbox/single.d.ts.map +1 -1
- package/dist/ui/menu/index.d.ts +40 -22
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +26 -38
- package/dist/ui/popover/index.d.ts +26 -16
- package/dist/ui/popover/index.d.ts.map +1 -1
- package/dist/ui/popover/index.js +15 -22
- package/dist/ui/radioGroup/index.d.ts +6 -3
- package/dist/ui/radioGroup/index.d.ts.map +1 -1
- package/dist/ui/radioGroup/index.js +6 -11
- package/dist/ui/tabs/index.d.ts +6 -3
- package/dist/ui/tabs/index.d.ts.map +1 -1
- package/dist/ui/tabs/index.js +14 -24
- package/dist/ui/toast/index.d.ts +4 -0
- package/dist/ui/toast/index.d.ts.map +1 -1
- package/dist/ui/toast/update.d.ts +11 -3
- package/dist/ui/toast/update.d.ts.map +1 -1
- package/dist/ui/toast/update.js +8 -5
- package/dist/ui/tooltip/index.d.ts +6 -3
- package/dist/ui/tooltip/index.d.ts.map +1 -1
- package/dist/ui/tooltip/index.js +2 -5
- package/dist/ui/virtualList/index.d.ts +7 -3
- package/dist/ui/virtualList/index.d.ts.map +1 -1
- package/dist/ui/virtualList/index.js +15 -4
- package/package.json +9 -5
- package/dist/task/dom.d.ts.map +0 -1
- package/dist/task/elementMovement.d.ts.map +0 -1
- package/dist/task/error.d.ts.map +0 -1
- package/dist/task/index.d.ts +0 -10
- package/dist/task/index.d.ts.map +0 -1
- package/dist/task/index.js +0 -8
- package/dist/task/inert.d.ts.map +0 -1
- package/dist/task/public.d.ts +0 -2
- package/dist/task/public.d.ts.map +0 -1
- package/dist/task/public.js +0 -1
- package/dist/task/random.d.ts +0 -21
- package/dist/task/random.d.ts.map +0 -1
- package/dist/task/random.js +0 -20
- package/dist/task/scrollLock.d.ts.map +0 -1
- package/dist/task/time.d.ts +0 -43
- package/dist/task/time.d.ts.map +0 -1
- package/dist/task/time.js +0 -53
- package/dist/task/timing.d.ts +0 -62
- package/dist/task/timing.d.ts.map +0 -1
- package/dist/task/timing.js +0 -77
package/dist/task/time.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { DateTime, Effect } from 'effect';
|
|
2
|
-
import { TimeZoneError } from './error.js';
|
|
3
|
-
/**
|
|
4
|
-
* Gets the current UTC time.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* Task.getTime.pipe(Effect.map(utc => GotTime({ utc })))
|
|
9
|
-
* ```
|
|
10
|
-
*/
|
|
11
|
-
export declare const getTime: Effect.Effect<DateTime.Utc>;
|
|
12
|
-
/**
|
|
13
|
-
* Gets the system timezone.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```typescript
|
|
17
|
-
* Task.getTimeZone.pipe(Effect.map(zone => GotTimeZone({ zone })))
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export declare const getTimeZone: Effect.Effect<DateTime.TimeZone>;
|
|
21
|
-
/**
|
|
22
|
-
* Gets the current time in the system timezone.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* Task.getZonedTime.pipe(Effect.map(zoned => GotTime({ zoned })))
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare const getZonedTime: Effect.Effect<DateTime.Zoned>;
|
|
30
|
-
/**
|
|
31
|
-
* Gets the current time in a specific timezone.
|
|
32
|
-
* Fails with `TimeZoneError` if the timezone ID is invalid.
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```typescript
|
|
36
|
-
* Task.getZonedTimeIn('America/New_York').pipe(
|
|
37
|
-
* Effect.map(zoned => GotNYTime({ zoned })),
|
|
38
|
-
* Effect.catch(() => Effect.succeed(FailedGetTimeZone())),
|
|
39
|
-
* )
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
export declare const getZonedTimeIn: (zoneId: string) => Effect.Effect<DateTime.Zoned, TimeZoneError>;
|
|
43
|
-
//# sourceMappingURL=time.d.ts.map
|
package/dist/task/time.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/task/time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAgB,CAAA;AAEhE;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAExD,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAMtD,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,GACzB,QAAQ,MAAM,KACb,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAQ1C,CAAA"}
|
package/dist/task/time.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { DateTime, Effect, Option } from 'effect';
|
|
2
|
-
import { TimeZoneError } from './error.js';
|
|
3
|
-
/**
|
|
4
|
-
* Gets the current UTC time.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* Task.getTime.pipe(Effect.map(utc => GotTime({ utc })))
|
|
9
|
-
* ```
|
|
10
|
-
*/
|
|
11
|
-
export const getTime = DateTime.now;
|
|
12
|
-
/**
|
|
13
|
-
* Gets the system timezone.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```typescript
|
|
17
|
-
* Task.getTimeZone.pipe(Effect.map(zone => GotTimeZone({ zone })))
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export const getTimeZone = Effect.sync(() => DateTime.zoneMakeLocal());
|
|
21
|
-
/**
|
|
22
|
-
* Gets the current time in the system timezone.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* Task.getZonedTime.pipe(Effect.map(zoned => GotTime({ zoned })))
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export const getZonedTime = Effect.gen(function* () {
|
|
30
|
-
const utc = yield* DateTime.now;
|
|
31
|
-
const zone = DateTime.zoneMakeLocal();
|
|
32
|
-
return DateTime.setZone(utc, zone);
|
|
33
|
-
});
|
|
34
|
-
/**
|
|
35
|
-
* Gets the current time in a specific timezone.
|
|
36
|
-
* Fails with `TimeZoneError` if the timezone ID is invalid.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```typescript
|
|
40
|
-
* Task.getZonedTimeIn('America/New_York').pipe(
|
|
41
|
-
* Effect.map(zoned => GotNYTime({ zoned })),
|
|
42
|
-
* Effect.catch(() => Effect.succeed(FailedGetTimeZone())),
|
|
43
|
-
* )
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
export const getZonedTimeIn = (zoneId) => Effect.gen(function* () {
|
|
47
|
-
const utc = yield* DateTime.now;
|
|
48
|
-
const maybeZone = DateTime.zoneMakeNamed(zoneId);
|
|
49
|
-
if (Option.isNone(maybeZone)) {
|
|
50
|
-
return yield* Effect.fail(new TimeZoneError({ zoneId }));
|
|
51
|
-
}
|
|
52
|
-
return DateTime.setZone(utc, maybeZone.value);
|
|
53
|
-
});
|
package/dist/task/timing.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Duration, Effect } from 'effect';
|
|
2
|
-
/**
|
|
3
|
-
* Waits for the given duration before completing.
|
|
4
|
-
* Useful for debouncing, such as clearing a typeahead search query.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* Task.delay('1 second').pipe(Effect.as(TimedOut()))
|
|
9
|
-
* ```
|
|
10
|
-
*/
|
|
11
|
-
export declare const delay: (duration: Duration.Input) => Effect.Effect<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Completes after the runtime's next render commits. The runtime batches
|
|
14
|
-
* renders to `requestAnimationFrame`, so a Command, Subscription, or other
|
|
15
|
-
* Effect that runs immediately after a dirtying Message would otherwise
|
|
16
|
-
* query the DOM before the matching VDOM patch has applied. Yield this
|
|
17
|
-
* before any DOM read or write whose target was just brought into existence
|
|
18
|
-
* (or moved, or had its attributes changed) by the same Message.
|
|
19
|
-
*
|
|
20
|
-
* The Task DOM helpers (`focus`, `clickElement`, `scrollIntoView`, etc.)
|
|
21
|
-
* already gate themselves with this internally; reach for `afterRender`
|
|
22
|
-
* directly when building custom Commands or DOM-observing Subscriptions
|
|
23
|
-
* that need the same guarantee.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```typescript
|
|
27
|
-
* Effect.gen(function* () {
|
|
28
|
-
* yield* Task.afterRender
|
|
29
|
-
* const element = document.getElementById(id)
|
|
30
|
-
* // element reflects the post-Message DOM
|
|
31
|
-
* })
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export declare const afterRender: Effect.Effect<void>;
|
|
35
|
-
/**
|
|
36
|
-
* Completes after two animation frames, ensuring the browser has painted
|
|
37
|
-
* the current state before proceeding. Used for CSS transition orchestration —
|
|
38
|
-
* the double-rAF guarantees the "from" state is visible before transitioning
|
|
39
|
-
* to the "to" state.
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```typescript
|
|
43
|
-
* Task.nextFrame.pipe(Effect.as(TransitionFrameAdvanced()))
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
export declare const nextFrame: Effect.Effect<void>;
|
|
47
|
-
/**
|
|
48
|
-
* Waits for all CSS animations on the element matching the selector to settle.
|
|
49
|
-
* Covers both CSS transitions and CSS keyframe animations via the Web Animations
|
|
50
|
-
* API. Falls back to completing immediately if the element is missing or has no
|
|
51
|
-
* active animations.
|
|
52
|
-
*
|
|
53
|
-
* Leave animations must be finite. `animation-iteration-count: infinite` will
|
|
54
|
-
* keep the underlying `.finished` promise pending and hang the caller.
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```typescript
|
|
58
|
-
* Task.waitForAnimationSettled('#menu-items').pipe(Effect.as(EndedAnimation()))
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
export declare const waitForAnimationSettled: (selector: string) => Effect.Effect<void>;
|
|
62
|
-
//# sourceMappingURL=timing.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,KAAK,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAC3C,CAAA;AAExB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAK3C,CAAA;AAED;;;;;;;;;;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
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { Effect } from 'effect';
|
|
2
|
-
/**
|
|
3
|
-
* Waits for the given duration before completing.
|
|
4
|
-
* Useful for debouncing, such as clearing a typeahead search query.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* Task.delay('1 second').pipe(Effect.as(TimedOut()))
|
|
9
|
-
* ```
|
|
10
|
-
*/
|
|
11
|
-
export const delay = (duration) => Effect.sleep(duration);
|
|
12
|
-
/**
|
|
13
|
-
* Completes after the runtime's next render commits. The runtime batches
|
|
14
|
-
* renders to `requestAnimationFrame`, so a Command, Subscription, or other
|
|
15
|
-
* Effect that runs immediately after a dirtying Message would otherwise
|
|
16
|
-
* query the DOM before the matching VDOM patch has applied. Yield this
|
|
17
|
-
* before any DOM read or write whose target was just brought into existence
|
|
18
|
-
* (or moved, or had its attributes changed) by the same Message.
|
|
19
|
-
*
|
|
20
|
-
* The Task DOM helpers (`focus`, `clickElement`, `scrollIntoView`, etc.)
|
|
21
|
-
* already gate themselves with this internally; reach for `afterRender`
|
|
22
|
-
* directly when building custom Commands or DOM-observing Subscriptions
|
|
23
|
-
* that need the same guarantee.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```typescript
|
|
27
|
-
* Effect.gen(function* () {
|
|
28
|
-
* yield* Task.afterRender
|
|
29
|
-
* const element = document.getElementById(id)
|
|
30
|
-
* // element reflects the post-Message DOM
|
|
31
|
-
* })
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export const afterRender = Effect.callback(resume => {
|
|
35
|
-
const handle = requestAnimationFrame(() => resume(Effect.void));
|
|
36
|
-
return Effect.sync(() => cancelAnimationFrame(handle));
|
|
37
|
-
});
|
|
38
|
-
/**
|
|
39
|
-
* Completes after two animation frames, ensuring the browser has painted
|
|
40
|
-
* the current state before proceeding. Used for CSS transition orchestration —
|
|
41
|
-
* the double-rAF guarantees the "from" state is visible before transitioning
|
|
42
|
-
* to the "to" state.
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* ```typescript
|
|
46
|
-
* Task.nextFrame.pipe(Effect.as(TransitionFrameAdvanced()))
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
export const nextFrame = Effect.callback(resume => {
|
|
50
|
-
requestAnimationFrame(() => {
|
|
51
|
-
requestAnimationFrame(() => {
|
|
52
|
-
resume(Effect.void);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
/**
|
|
57
|
-
* Waits for all CSS animations on the element matching the selector to settle.
|
|
58
|
-
* Covers both CSS transitions and CSS keyframe animations via the Web Animations
|
|
59
|
-
* API. Falls back to completing immediately if the element is missing or has no
|
|
60
|
-
* active animations.
|
|
61
|
-
*
|
|
62
|
-
* Leave animations must be finite. `animation-iteration-count: infinite` will
|
|
63
|
-
* keep the underlying `.finished` promise pending and hang the caller.
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```typescript
|
|
67
|
-
* Task.waitForAnimationSettled('#menu-items').pipe(Effect.as(EndedAnimation()))
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
export const waitForAnimationSettled = (selector) => Effect.callback(resume => {
|
|
71
|
-
requestAnimationFrame(async () => {
|
|
72
|
-
const element = document.querySelector(selector);
|
|
73
|
-
const animations = element instanceof HTMLElement ? element.getAnimations() : [];
|
|
74
|
-
await Promise.allSettled(animations.map(({ finished }) => finished));
|
|
75
|
-
resume(Effect.void);
|
|
76
|
-
});
|
|
77
|
-
});
|