@foldkit/ui 0.136.0 → 0.137.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/anchor.d.ts +7 -1
- package/dist/anchor.d.ts.map +1 -1
- package/dist/anchor.js +77 -26
- package/dist/animation/index.d.ts +5 -5
- package/dist/animation/index.d.ts.map +1 -1
- package/dist/animation/index.js +4 -4
- package/dist/animation/public.d.ts +1 -1
- package/dist/animation/public.d.ts.map +1 -1
- package/dist/animation/public.js +1 -1
- package/dist/animation/schema.d.ts +2 -2
- package/dist/animation/schema.d.ts.map +1 -1
- package/dist/animation/schema.js +2 -2
- package/dist/animation/update.d.ts +3 -3
- package/dist/animation/update.d.ts.map +1 -1
- package/dist/animation/update.js +8 -8
- package/dist/combobox/multi.d.ts +1 -1
- package/dist/combobox/shared.d.ts +4 -3
- package/dist/combobox/shared.d.ts.map +1 -1
- package/dist/combobox/single.d.ts +1 -1
- package/dist/datePicker/index.d.ts +2 -2
- package/dist/dialog/index.d.ts +2 -2
- package/dist/dragAndDrop/index.d.ts +7 -7
- package/dist/dragAndDrop/index.d.ts.map +1 -1
- package/dist/dragAndDrop/index.js +8 -8
- package/dist/dragAndDrop/public.d.ts +1 -1
- package/dist/dragAndDrop/public.d.ts.map +1 -1
- package/dist/dragAndDrop/public.js +1 -1
- package/dist/listbox/multi.d.ts +2 -2
- package/dist/listbox/public.d.ts +1 -1
- package/dist/listbox/public.d.ts.map +1 -1
- package/dist/listbox/public.js +1 -1
- package/dist/listbox/shared.d.ts +9 -8
- package/dist/listbox/shared.d.ts.map +1 -1
- package/dist/listbox/shared.js +9 -7
- package/dist/listbox/single.d.ts +2 -2
- package/dist/menu/index.d.ts +7 -6
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +9 -7
- package/dist/menu/public.d.ts +1 -1
- package/dist/menu/public.d.ts.map +1 -1
- package/dist/menu/public.js +1 -1
- package/dist/popover/index.d.ts +4 -3
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.d.ts +2 -2
- package/dist/toast/index.d.ts +19 -18
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +5 -4
- package/dist/toast/public.d.ts +1 -1
- package/dist/toast/public.d.ts.map +1 -1
- package/dist/toast/public.js +1 -1
- package/dist/toast/schema.d.ts +5 -5
- package/dist/toast/schema.d.ts.map +1 -1
- package/dist/toast/schema.js +2 -2
- package/dist/toast/test.d.ts +6 -5
- package/dist/toast/test.d.ts.map +1 -1
- package/dist/toast/test.js +8 -7
- package/dist/toast/update.d.ts +14 -14
- package/dist/toast/update.d.ts.map +1 -1
- package/dist/toast/update.js +7 -7
- package/dist/tooltip/index.d.ts +2 -177
- package/dist/tooltip/index.d.ts.map +1 -1
- package/dist/tooltip/index.js +2 -260
- package/dist/tooltip/message.d.ts +53 -0
- package/dist/tooltip/message.d.ts.map +1 -0
- package/dist/tooltip/message.js +45 -0
- package/dist/tooltip/public.d.ts +1 -1
- package/dist/tooltip/public.d.ts.map +1 -1
- package/dist/tooltip/public.js +1 -1
- package/dist/tooltip/tooltip.d.ts +130 -0
- package/dist/tooltip/tooltip.d.ts.map +1 -0
- package/dist/tooltip/tooltip.js +226 -0
- package/package.json +2 -2
package/dist/toast/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Schema as S } from 'effect';
|
|
2
2
|
import { type ChildAttribute, type Html } from 'foldkit/html';
|
|
3
|
-
import { Dismissed, DismissedAll,
|
|
4
|
-
import {
|
|
3
|
+
import { CompletedWaitBeforeDismissal, Dismissed, DismissedAll, GotAnimationMessage, HoveredEntry, LeftEntry, Position, Variant } from './schema.js';
|
|
4
|
+
import { WaitBeforeDismissal } from './update.js';
|
|
5
5
|
export type { InitConfig } from './schema.js';
|
|
6
6
|
export type { ShowInput } from './update.js';
|
|
7
7
|
export * as test from './test.js';
|
|
8
|
-
export { Variant, Position, Dismissed, DismissedAll,
|
|
8
|
+
export { Variant, Position, Dismissed, DismissedAll, CompletedWaitBeforeDismissal, HoveredEntry, LeftEntry, GotAnimationMessage, WaitBeforeDismissal, };
|
|
9
9
|
/** Handlers passed to `entryToView`. Spread `dismiss` onto a close
|
|
10
10
|
* button's attribute array (typically inside `h.button([...dismiss])`)
|
|
11
11
|
* to let users dismiss the entry manually. The attribute carries the
|
|
@@ -27,7 +27,8 @@ export type EntryHandlers = Readonly<{
|
|
|
27
27
|
* Consume the bound module's exports everywhere. `Toast.Model` in your app
|
|
28
28
|
* Model, `Toast.Message` in your parent Message union, `Toast.show` /
|
|
29
29
|
* `Toast.dismiss` in your update, `Toast.view` in your view. The top-level
|
|
30
|
-
* exports (`Variant`, `Position`, static message tags,
|
|
30
|
+
* exports (`Variant`, `Position`, static message tags,
|
|
31
|
+
* `WaitBeforeDismissal`) are
|
|
31
32
|
* payload-independent and safe to reference when you need them without a
|
|
32
33
|
* bound module, but the typical path is through the factory return.
|
|
33
34
|
*
|
|
@@ -67,7 +68,7 @@ export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
67
68
|
} | {
|
|
68
69
|
readonly _tag: "DismissedAll";
|
|
69
70
|
} | {
|
|
70
|
-
readonly _tag: "
|
|
71
|
+
readonly _tag: "CompletedWaitBeforeDismissal";
|
|
71
72
|
readonly entryId: string;
|
|
72
73
|
readonly version: number;
|
|
73
74
|
} | {
|
|
@@ -84,7 +85,7 @@ export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
84
85
|
} | {
|
|
85
86
|
readonly _tag: "Hid";
|
|
86
87
|
} | {
|
|
87
|
-
readonly _tag: "
|
|
88
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
88
89
|
} | {
|
|
89
90
|
readonly _tag: "EndedAnimation";
|
|
90
91
|
};
|
|
@@ -169,7 +170,7 @@ export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
169
170
|
}>;
|
|
170
171
|
}>, import("foldkit/schema").CallableTaggedStruct<"Dismissed", {
|
|
171
172
|
entryId: S.String;
|
|
172
|
-
}>, import("foldkit/schema").CallableTaggedStruct<"DismissedAll", {}>, import("foldkit/schema").CallableTaggedStruct<"
|
|
173
|
+
}>, import("foldkit/schema").CallableTaggedStruct<"DismissedAll", {}>, import("foldkit/schema").CallableTaggedStruct<"CompletedWaitBeforeDismissal", {
|
|
173
174
|
entryId: S.String;
|
|
174
175
|
version: S.Number;
|
|
175
176
|
}>, import("foldkit/schema").CallableTaggedStruct<"HoveredEntry", {
|
|
@@ -178,7 +179,7 @@ export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
178
179
|
entryId: S.String;
|
|
179
180
|
}>, import("foldkit/schema").CallableTaggedStruct<"GotAnimationMessage", {
|
|
180
181
|
entryId: S.String;
|
|
181
|
-
message: S.Union<[import("foldkit/schema").CallableTaggedStruct<"Showed", {}>, import("foldkit/schema").CallableTaggedStruct<"Hid", {}>, import("foldkit/schema").CallableTaggedStruct<"
|
|
182
|
+
message: S.Union<[import("foldkit/schema").CallableTaggedStruct<"Showed", {}>, import("foldkit/schema").CallableTaggedStruct<"Hid", {}>, import("foldkit/schema").CallableTaggedStruct<"CompletedWaitForPaint", {}>, import("foldkit/schema").CallableTaggedStruct<"EndedAnimation", {}>]>;
|
|
182
183
|
}>]>;
|
|
183
184
|
readonly OutMessage: S.Union<readonly [import("foldkit/schema").CallableTaggedStruct<"DismissedToast", {
|
|
184
185
|
payload: S.Codec<A, I, never, never>;
|
|
@@ -245,7 +246,7 @@ export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
245
246
|
} | {
|
|
246
247
|
readonly _tag: "DismissedAll";
|
|
247
248
|
} | {
|
|
248
|
-
readonly _tag: "
|
|
249
|
+
readonly _tag: "CompletedWaitBeforeDismissal";
|
|
249
250
|
readonly entryId: string;
|
|
250
251
|
readonly version: number;
|
|
251
252
|
} | {
|
|
@@ -262,7 +263,7 @@ export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
262
263
|
} | {
|
|
263
264
|
readonly _tag: "Hid";
|
|
264
265
|
} | {
|
|
265
|
-
readonly _tag: "
|
|
266
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
266
267
|
} | {
|
|
267
268
|
readonly _tag: "EndedAnimation";
|
|
268
269
|
};
|
|
@@ -308,7 +309,7 @@ export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
308
309
|
} | {
|
|
309
310
|
readonly _tag: "DismissedAll";
|
|
310
311
|
} | {
|
|
311
|
-
readonly _tag: "
|
|
312
|
+
readonly _tag: "CompletedWaitBeforeDismissal";
|
|
312
313
|
readonly entryId: string;
|
|
313
314
|
readonly version: number;
|
|
314
315
|
} | {
|
|
@@ -325,7 +326,7 @@ export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
325
326
|
} | {
|
|
326
327
|
readonly _tag: "Hid";
|
|
327
328
|
} | {
|
|
328
|
-
readonly _tag: "
|
|
329
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
329
330
|
} | {
|
|
330
331
|
readonly _tag: "EndedAnimation";
|
|
331
332
|
};
|
|
@@ -398,7 +399,7 @@ export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
398
399
|
} | {
|
|
399
400
|
readonly _tag: "DismissedAll";
|
|
400
401
|
} | {
|
|
401
|
-
readonly _tag: "
|
|
402
|
+
readonly _tag: "CompletedWaitBeforeDismissal";
|
|
402
403
|
readonly entryId: string;
|
|
403
404
|
readonly version: number;
|
|
404
405
|
} | {
|
|
@@ -415,7 +416,7 @@ export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
415
416
|
} | {
|
|
416
417
|
readonly _tag: "Hid";
|
|
417
418
|
} | {
|
|
418
|
-
readonly _tag: "
|
|
419
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
419
420
|
} | {
|
|
420
421
|
readonly _tag: "EndedAnimation";
|
|
421
422
|
};
|
|
@@ -483,7 +484,7 @@ export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
483
484
|
} | {
|
|
484
485
|
readonly _tag: "DismissedAll";
|
|
485
486
|
} | {
|
|
486
|
-
readonly _tag: "
|
|
487
|
+
readonly _tag: "CompletedWaitBeforeDismissal";
|
|
487
488
|
readonly entryId: string;
|
|
488
489
|
readonly version: number;
|
|
489
490
|
} | {
|
|
@@ -500,7 +501,7 @@ export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
500
501
|
} | {
|
|
501
502
|
readonly _tag: "Hid";
|
|
502
503
|
} | {
|
|
503
|
-
readonly _tag: "
|
|
504
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
504
505
|
} | {
|
|
505
506
|
readonly _tag: "EndedAnimation";
|
|
506
507
|
};
|
|
@@ -568,7 +569,7 @@ export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
568
569
|
} | {
|
|
569
570
|
readonly _tag: "DismissedAll";
|
|
570
571
|
} | {
|
|
571
|
-
readonly _tag: "
|
|
572
|
+
readonly _tag: "CompletedWaitBeforeDismissal";
|
|
572
573
|
readonly entryId: string;
|
|
573
574
|
readonly version: number;
|
|
574
575
|
} | {
|
|
@@ -585,7 +586,7 @@ export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
585
586
|
} | {
|
|
586
587
|
readonly _tag: "Hid";
|
|
587
588
|
} | {
|
|
588
|
-
readonly _tag: "
|
|
589
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
589
590
|
} | {
|
|
590
591
|
readonly _tag: "EndedAnimation";
|
|
591
592
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAChD,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,IAAI,EAAmB,MAAM,cAAc,CAAA;AAG9E,OAAO,EACL,SAAS,EACT,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAChD,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,IAAI,EAAmB,MAAM,cAAc,CAAA;AAG9E,OAAO,EACL,4BAA4B,EAC5B,SAAS,EACT,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,OAAO,EACR,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,mBAAmB,EAAe,MAAM,aAAa,CAAA;AAE9D,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,OAAO,EACL,OAAO,EACP,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,4BAA4B,EAC5B,YAAY,EACZ,SAAS,EACT,mBAAmB,EACnB,mBAAmB,GACpB,CAAA;AA0ED;;;;qDAIqD;AACrD,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;CACvC,CAAC,CAAA;AAIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAUzC,QAAQ;qBACL,CAAC,KAAK;;;;;;;;;;;;SAAO,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI;oBAChD,MAAM;6BACG,MAAM;yBACV,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyF1B,CAAA"}
|
package/dist/toast/index.js
CHANGED
|
@@ -2,10 +2,10 @@ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
|
2
2
|
import { Match as M } from 'effect';
|
|
3
3
|
import { childAttributes } from 'foldkit/html';
|
|
4
4
|
import { defineView } from 'foldkit/submodel';
|
|
5
|
-
import { Dismissed, DismissedAll,
|
|
6
|
-
import {
|
|
5
|
+
import { CompletedWaitBeforeDismissal, Dismissed, DismissedAll, GotAnimationMessage, HoveredEntry, LeftEntry, Position, Variant, } from './schema.js';
|
|
6
|
+
import { WaitBeforeDismissal, makeRuntime } from './update.js';
|
|
7
7
|
export * as test from './test.js';
|
|
8
|
-
export { Variant, Position, Dismissed, DismissedAll,
|
|
8
|
+
export { Variant, Position, Dismissed, DismissedAll, CompletedWaitBeforeDismissal, HoveredEntry, LeftEntry, GotAnimationMessage, WaitBeforeDismissal, };
|
|
9
9
|
const variantToRole = (variant) => __foldkitBrandViewResult((M.value(variant).pipe(M.withReturnType(), M.when('Info', () => __foldkitBrandViewResult(('status'), "@foldkit/ui/toast/index.js#anonymous")), M.when('Success', () => __foldkitBrandViewResult(('status'), "@foldkit/ui/toast/index.js#anonymous~2")), M.when('Warning', () => __foldkitBrandViewResult(('alert'), "@foldkit/ui/toast/index.js#anonymous~3")), M.when('Error', () => __foldkitBrandViewResult(('alert'), "@foldkit/ui/toast/index.js#anonymous~4")), M.exhaustive)), "@foldkit/ui/toast/index.js#variantToRole");
|
|
10
10
|
const positionToContainerStyle = (position) => {
|
|
11
11
|
const base = {
|
|
@@ -66,7 +66,8 @@ const DEFAULT_ARIA_LABEL = 'Notifications';
|
|
|
66
66
|
* Consume the bound module's exports everywhere. `Toast.Model` in your app
|
|
67
67
|
* Model, `Toast.Message` in your parent Message union, `Toast.show` /
|
|
68
68
|
* `Toast.dismiss` in your update, `Toast.view` in your view. The top-level
|
|
69
|
-
* exports (`Variant`, `Position`, static message tags,
|
|
69
|
+
* exports (`Variant`, `Position`, static message tags,
|
|
70
|
+
* `WaitBeforeDismissal`) are
|
|
70
71
|
* payload-independent and safe to reference when you need them without a
|
|
71
72
|
* bound module, but the typical path is through the factory return.
|
|
72
73
|
*
|
package/dist/toast/public.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { make, Variant, Position, Dismissed, DismissedAll,
|
|
1
|
+
export { make, Variant, Position, Dismissed, DismissedAll, CompletedWaitBeforeDismissal, HoveredEntry, LeftEntry, GotAnimationMessage, WaitBeforeDismissal, } from './index.js';
|
|
2
2
|
export * as test from './test.js';
|
|
3
3
|
export type { EntryHandlers } from './index.js';
|
|
4
4
|
export type { InitConfig, ShowInput } from './index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/toast/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/toast/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,4BAA4B,EAC5B,YAAY,EACZ,SAAS,EACT,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,YAAY,CAAA;AAEnB,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC/C,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACvD,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/toast/public.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { make, Variant, Position, Dismissed, DismissedAll,
|
|
1
|
+
export { make, Variant, Position, Dismissed, DismissedAll, CompletedWaitBeforeDismissal, HoveredEntry, LeftEntry, GotAnimationMessage, WaitBeforeDismissal, } from './index.js';
|
|
2
2
|
export * as test from './test.js';
|
package/dist/toast/schema.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export declare const DismissedAll: import("foldkit/schema").CallableTaggedStruct
|
|
|
61
61
|
/** Sent when an entry's auto-dismiss timer fires. Carries a version echoed
|
|
62
62
|
* from the scheduling moment so stale timers (from hover or manual dismiss)
|
|
63
63
|
* are discarded. */
|
|
64
|
-
export declare const
|
|
64
|
+
export declare const CompletedWaitBeforeDismissal: import("foldkit/schema").CallableTaggedStruct<"CompletedWaitBeforeDismissal", {
|
|
65
65
|
entryId: S.String;
|
|
66
66
|
version: S.Number;
|
|
67
67
|
}>;
|
|
@@ -78,11 +78,11 @@ export declare const LeftEntry: import("foldkit/schema").CallableTaggedStruct<"L
|
|
|
78
78
|
/** Wraps a single entry's Animation submodel message for delegation. */
|
|
79
79
|
export declare const GotAnimationMessage: import("foldkit/schema").CallableTaggedStruct<"GotAnimationMessage", {
|
|
80
80
|
entryId: S.String;
|
|
81
|
-
message: S.Union<[import("foldkit/schema").CallableTaggedStruct<"Showed", {}>, import("foldkit/schema").CallableTaggedStruct<"Hid", {}>, import("foldkit/schema").CallableTaggedStruct<"
|
|
81
|
+
message: S.Union<[import("foldkit/schema").CallableTaggedStruct<"Showed", {}>, import("foldkit/schema").CallableTaggedStruct<"Hid", {}>, import("foldkit/schema").CallableTaggedStruct<"CompletedWaitForPaint", {}>, import("foldkit/schema").CallableTaggedStruct<"EndedAnimation", {}>]>;
|
|
82
82
|
}>;
|
|
83
83
|
export type Dismissed = typeof Dismissed.Type;
|
|
84
84
|
export type DismissedAll = typeof DismissedAll.Type;
|
|
85
|
-
export type
|
|
85
|
+
export type CompletedWaitBeforeDismissal = typeof CompletedWaitBeforeDismissal.Type;
|
|
86
86
|
export type HoveredEntry = typeof HoveredEntry.Type;
|
|
87
87
|
export type LeftEntry = typeof LeftEntry.Type;
|
|
88
88
|
export type GotAnimationMessage = typeof GotAnimationMessage.Type;
|
|
@@ -120,7 +120,7 @@ export declare const makeMessage: <A, I>(payloadSchema: S.Codec<A, I>) => S.Unio
|
|
|
120
120
|
}>;
|
|
121
121
|
}>, import("foldkit/schema").CallableTaggedStruct<"Dismissed", {
|
|
122
122
|
entryId: S.String;
|
|
123
|
-
}>, import("foldkit/schema").CallableTaggedStruct<"DismissedAll", {}>, import("foldkit/schema").CallableTaggedStruct<"
|
|
123
|
+
}>, import("foldkit/schema").CallableTaggedStruct<"DismissedAll", {}>, import("foldkit/schema").CallableTaggedStruct<"CompletedWaitBeforeDismissal", {
|
|
124
124
|
entryId: S.String;
|
|
125
125
|
version: S.Number;
|
|
126
126
|
}>, import("foldkit/schema").CallableTaggedStruct<"HoveredEntry", {
|
|
@@ -129,7 +129,7 @@ export declare const makeMessage: <A, I>(payloadSchema: S.Codec<A, I>) => S.Unio
|
|
|
129
129
|
entryId: S.String;
|
|
130
130
|
}>, import("foldkit/schema").CallableTaggedStruct<"GotAnimationMessage", {
|
|
131
131
|
entryId: S.String;
|
|
132
|
-
message: S.Union<[import("foldkit/schema").CallableTaggedStruct<"Showed", {}>, import("foldkit/schema").CallableTaggedStruct<"Hid", {}>, import("foldkit/schema").CallableTaggedStruct<"
|
|
132
|
+
message: S.Union<[import("foldkit/schema").CallableTaggedStruct<"Showed", {}>, import("foldkit/schema").CallableTaggedStruct<"Hid", {}>, import("foldkit/schema").CallableTaggedStruct<"CompletedWaitForPaint", {}>, import("foldkit/schema").CallableTaggedStruct<"EndedAnimation", {}>]>;
|
|
133
133
|
}>]>;
|
|
134
134
|
/** Factory for `DismissedToast`, the OutMessage emitted once an entry has
|
|
135
135
|
* finished dismissing (leave-animation `TransitionedOut`). Carries the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/toast/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAU9C;;;;kDAIkD;AAClD,eAAO,MAAM,OAAO,8DAAsD,CAAA;AAC1E,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,gFAAgF;AAChF,eAAO,MAAM,QAAQ,wGAOnB,CAAA;AACF,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAA;AAI3C;;;;;4BAK4B;AAC5B,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;EASxD,CAAA;AAIJ;;;;wCAIwC;AACxC,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;EAMxD,CAAA;AAIJ;wEACwE;AACxE,eAAO,MAAM,SAAS;;EAAwC,CAAA;AAC9D,uEAAuE;AACvE,eAAO,MAAM,YAAY,mEAAoB,CAAA;AAC7C;;qBAEqB;AACrB,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/toast/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAU9C;;;;kDAIkD;AAClD,eAAO,MAAM,OAAO,8DAAsD,CAAA;AAC1E,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,gFAAgF;AAChF,eAAO,MAAM,QAAQ,wGAOnB,CAAA;AACF,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAA;AAI3C;;;;;4BAK4B;AAC5B,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;EASxD,CAAA;AAIJ;;;;wCAIwC;AACxC,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;EAMxD,CAAA;AAIJ;wEACwE;AACxE,eAAO,MAAM,SAAS;;EAAwC,CAAA;AAC9D,uEAAuE;AACvE,eAAO,MAAM,YAAY,mEAAoB,CAAA;AAC7C;;qBAEqB;AACrB,eAAO,MAAM,4BAA4B;;;EAGvC,CAAA;AACF;qCACqC;AACrC,eAAO,MAAM,YAAY;;EAA2C,CAAA;AACpE;sCACsC;AACtC,eAAO,MAAM,SAAS;;EAAwC,CAAA;AAC9D,wEAAwE;AACxE,eAAO,MAAM,mBAAmB;;;EAG9B,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAC7C,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AACnD,MAAM,MAAM,4BAA4B,GACtC,OAAO,4BAA4B,CAAC,IAAI,CAAA;AAC1C,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AACnD,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAC7C,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAC,IAAI,CAAA;AAEjE;wDACwD;AACxD,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;EACX,CAAA;AAEjD,6EAA6E;AAC7E,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;IAS1D,CAAA;AAEJ;;;uDAGuD;AACvD,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;EACpB,CAAA;AAEjD,6EAA6E;AAC7E,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;IACnB,CAAA;AAI9C;;;mCAGmC;AACnC,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,eAAe,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAA;CACjC,CAAC,CAAA;AAEF,eAAO,MAAM,gBAAgB,mBAAsB,CAAA"}
|
package/dist/toast/schema.js
CHANGED
|
@@ -56,7 +56,7 @@ export const DismissedAll = m('DismissedAll');
|
|
|
56
56
|
/** Sent when an entry's auto-dismiss timer fires. Carries a version echoed
|
|
57
57
|
* from the scheduling moment so stale timers (from hover or manual dismiss)
|
|
58
58
|
* are discarded. */
|
|
59
|
-
export const
|
|
59
|
+
export const CompletedWaitBeforeDismissal = m('CompletedWaitBeforeDismissal', {
|
|
60
60
|
entryId: S.String,
|
|
61
61
|
version: S.Number,
|
|
62
62
|
});
|
|
@@ -79,7 +79,7 @@ export const makeMessage = (payloadSchema) => __foldkitBrandViewResult((S.Union(
|
|
|
79
79
|
makeAdded(payloadSchema),
|
|
80
80
|
Dismissed,
|
|
81
81
|
DismissedAll,
|
|
82
|
-
|
|
82
|
+
CompletedWaitBeforeDismissal,
|
|
83
83
|
HoveredEntry,
|
|
84
84
|
LeftEntry,
|
|
85
85
|
GotAnimationMessage,
|
package/dist/toast/test.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as Story from 'foldkit/story';
|
|
2
2
|
/** Input for {@link drainEntry}. `entryId` selects the entry whose lifecycle
|
|
3
3
|
* to drain. `version` is the auto-dismiss timer version echoed back by
|
|
4
|
-
* `
|
|
5
|
-
* carries. */
|
|
4
|
+
* `CompletedWaitBeforeDismissal`; it defaults to `0`, the version a freshly
|
|
5
|
+
* shown entry carries. */
|
|
6
6
|
export type DrainEntryInput = Readonly<{
|
|
7
7
|
entryId: string;
|
|
8
8
|
version?: number;
|
|
@@ -17,10 +17,11 @@ export type DrainEntryInput = Readonly<{
|
|
|
17
17
|
* test must resolve in full or the story fails on leftover Commands. The
|
|
18
18
|
* steps are:
|
|
19
19
|
*
|
|
20
|
-
* - enter animation: `
|
|
20
|
+
* - enter animation: `WaitForPaint` then `CompletedWaitForPaint`
|
|
21
21
|
* - enter settle: `WaitForAnimationSettled` then `EndedAnimation`
|
|
22
|
-
* - auto-dismiss: `
|
|
23
|
-
*
|
|
22
|
+
* - auto-dismiss: `WaitBeforeDismissal` then
|
|
23
|
+
* `CompletedWaitBeforeDismissal`
|
|
24
|
+
* - exit animation: `WaitForPaint` then `CompletedWaitForPaint`
|
|
24
25
|
* - exit settle: `WaitForAnimationSettled` then `EndedAnimation`
|
|
25
26
|
*
|
|
26
27
|
* Each step resolves with the child's raw result Message. `resolveAll` replays
|
package/dist/toast/test.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/toast/test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AAWtC;;;
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/toast/test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AAWtC;;;2BAG2B;AAC3B,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAC,CAAA;AAIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,UAAU,GAAI,uBAGxB,eAAe,iKAOf,CAAA"}
|
package/dist/toast/test.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
2
|
import * as Story from 'foldkit/story';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { CompletedWaitForPaint, EndedAnimation, WaitForAnimationSettled, WaitForPaint, } from '../animation/index.js';
|
|
4
|
+
import { CompletedWaitBeforeDismissal } from './schema.js';
|
|
5
|
+
import { WaitBeforeDismissal } from './update.js';
|
|
6
6
|
const DEFAULT_VERSION = 0;
|
|
7
7
|
/** Builds a {@link Story.Command.resolveAll} step that drains a single toast
|
|
8
8
|
* entry's full animation and dismiss lifecycle. Resolving these Commands in
|
|
@@ -14,10 +14,11 @@ const DEFAULT_VERSION = 0;
|
|
|
14
14
|
* test must resolve in full or the story fails on leftover Commands. The
|
|
15
15
|
* steps are:
|
|
16
16
|
*
|
|
17
|
-
* - enter animation: `
|
|
17
|
+
* - enter animation: `WaitForPaint` then `CompletedWaitForPaint`
|
|
18
18
|
* - enter settle: `WaitForAnimationSettled` then `EndedAnimation`
|
|
19
|
-
* - auto-dismiss: `
|
|
20
|
-
*
|
|
19
|
+
* - auto-dismiss: `WaitBeforeDismissal` then
|
|
20
|
+
* `CompletedWaitBeforeDismissal`
|
|
21
|
+
* - exit animation: `WaitForPaint` then `CompletedWaitForPaint`
|
|
21
22
|
* - exit settle: `WaitForAnimationSettled` then `EndedAnimation`
|
|
22
23
|
*
|
|
23
24
|
* Each step resolves with the child's raw result Message. `resolveAll` replays
|
|
@@ -34,4 +35,4 @@ const DEFAULT_VERSION = 0;
|
|
|
34
35
|
* )
|
|
35
36
|
* ```
|
|
36
37
|
*/
|
|
37
|
-
export const drainEntry = ({ entryId, version = DEFAULT_VERSION, }) => __foldkitBrandViewResult((Story.Command.resolveAll([
|
|
38
|
+
export const drainEntry = ({ entryId, version = DEFAULT_VERSION, }) => __foldkitBrandViewResult((Story.Command.resolveAll([WaitForPaint, CompletedWaitForPaint()], [WaitForAnimationSettled, EndedAnimation()], [WaitBeforeDismissal, CompletedWaitBeforeDismissal({ entryId, version })], [WaitForPaint, CompletedWaitForPaint()], [WaitForAnimationSettled, EndedAnimation()])), "@foldkit/ui/toast/test.js#drainEntry");
|
package/dist/toast/update.d.ts
CHANGED
|
@@ -14,12 +14,12 @@ export type ShowInput<A> = Readonly<{
|
|
|
14
14
|
* version so stale timers (from hover or manual dismiss) are discarded in
|
|
15
15
|
* the update function. Static. The Command definition doesn't depend on
|
|
16
16
|
* payload. */
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const WaitBeforeDismissal: Command.CommandDefinitionWithArgs<"WaitBeforeDismissal", {
|
|
18
18
|
entryId: S.String;
|
|
19
19
|
version: S.Number;
|
|
20
20
|
duration: S.DurationFromMillis;
|
|
21
21
|
}, Effect.Effect<{
|
|
22
|
-
readonly _tag: "
|
|
22
|
+
readonly _tag: "CompletedWaitBeforeDismissal";
|
|
23
23
|
readonly entryId: string;
|
|
24
24
|
readonly version: number;
|
|
25
25
|
}, never, never>>;
|
|
@@ -78,7 +78,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
78
78
|
}>;
|
|
79
79
|
}>, import("foldkit/schema").CallableTaggedStruct<"Dismissed", {
|
|
80
80
|
entryId: S.String;
|
|
81
|
-
}>, import("foldkit/schema").CallableTaggedStruct<"DismissedAll", {}>, import("foldkit/schema").CallableTaggedStruct<"
|
|
81
|
+
}>, import("foldkit/schema").CallableTaggedStruct<"DismissedAll", {}>, import("foldkit/schema").CallableTaggedStruct<"CompletedWaitBeforeDismissal", {
|
|
82
82
|
entryId: S.String;
|
|
83
83
|
version: S.Number;
|
|
84
84
|
}>, import("foldkit/schema").CallableTaggedStruct<"HoveredEntry", {
|
|
@@ -87,7 +87,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
87
87
|
entryId: S.String;
|
|
88
88
|
}>, import("foldkit/schema").CallableTaggedStruct<"GotAnimationMessage", {
|
|
89
89
|
entryId: S.String;
|
|
90
|
-
message: S.Union<[import("foldkit/schema").CallableTaggedStruct<"Showed", {}>, import("foldkit/schema").CallableTaggedStruct<"Hid", {}>, import("foldkit/schema").CallableTaggedStruct<"
|
|
90
|
+
message: S.Union<[import("foldkit/schema").CallableTaggedStruct<"Showed", {}>, import("foldkit/schema").CallableTaggedStruct<"Hid", {}>, import("foldkit/schema").CallableTaggedStruct<"CompletedWaitForPaint", {}>, import("foldkit/schema").CallableTaggedStruct<"EndedAnimation", {}>]>;
|
|
91
91
|
}>]>;
|
|
92
92
|
readonly OutMessage: S.Union<readonly [import("foldkit/schema").CallableTaggedStruct<"DismissedToast", {
|
|
93
93
|
payload: S.Codec<A, I, never, never>;
|
|
@@ -151,7 +151,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
151
151
|
} | {
|
|
152
152
|
readonly _tag: "DismissedAll";
|
|
153
153
|
} | {
|
|
154
|
-
readonly _tag: "
|
|
154
|
+
readonly _tag: "CompletedWaitBeforeDismissal";
|
|
155
155
|
readonly entryId: string;
|
|
156
156
|
readonly version: number;
|
|
157
157
|
} | {
|
|
@@ -168,7 +168,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
168
168
|
} | {
|
|
169
169
|
readonly _tag: "Hid";
|
|
170
170
|
} | {
|
|
171
|
-
readonly _tag: "
|
|
171
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
172
172
|
} | {
|
|
173
173
|
readonly _tag: "EndedAnimation";
|
|
174
174
|
};
|
|
@@ -214,7 +214,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
214
214
|
} | {
|
|
215
215
|
readonly _tag: "DismissedAll";
|
|
216
216
|
} | {
|
|
217
|
-
readonly _tag: "
|
|
217
|
+
readonly _tag: "CompletedWaitBeforeDismissal";
|
|
218
218
|
readonly entryId: string;
|
|
219
219
|
readonly version: number;
|
|
220
220
|
} | {
|
|
@@ -231,7 +231,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
231
231
|
} | {
|
|
232
232
|
readonly _tag: "Hid";
|
|
233
233
|
} | {
|
|
234
|
-
readonly _tag: "
|
|
234
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
235
235
|
} | {
|
|
236
236
|
readonly _tag: "EndedAnimation";
|
|
237
237
|
};
|
|
@@ -299,7 +299,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
299
299
|
} | {
|
|
300
300
|
readonly _tag: "DismissedAll";
|
|
301
301
|
} | {
|
|
302
|
-
readonly _tag: "
|
|
302
|
+
readonly _tag: "CompletedWaitBeforeDismissal";
|
|
303
303
|
readonly entryId: string;
|
|
304
304
|
readonly version: number;
|
|
305
305
|
} | {
|
|
@@ -316,7 +316,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
316
316
|
} | {
|
|
317
317
|
readonly _tag: "Hid";
|
|
318
318
|
} | {
|
|
319
|
-
readonly _tag: "
|
|
319
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
320
320
|
} | {
|
|
321
321
|
readonly _tag: "EndedAnimation";
|
|
322
322
|
};
|
|
@@ -384,7 +384,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
384
384
|
} | {
|
|
385
385
|
readonly _tag: "DismissedAll";
|
|
386
386
|
} | {
|
|
387
|
-
readonly _tag: "
|
|
387
|
+
readonly _tag: "CompletedWaitBeforeDismissal";
|
|
388
388
|
readonly entryId: string;
|
|
389
389
|
readonly version: number;
|
|
390
390
|
} | {
|
|
@@ -401,7 +401,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
401
401
|
} | {
|
|
402
402
|
readonly _tag: "Hid";
|
|
403
403
|
} | {
|
|
404
|
-
readonly _tag: "
|
|
404
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
405
405
|
} | {
|
|
406
406
|
readonly _tag: "EndedAnimation";
|
|
407
407
|
};
|
|
@@ -469,7 +469,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
469
469
|
} | {
|
|
470
470
|
readonly _tag: "DismissedAll";
|
|
471
471
|
} | {
|
|
472
|
-
readonly _tag: "
|
|
472
|
+
readonly _tag: "CompletedWaitBeforeDismissal";
|
|
473
473
|
readonly entryId: string;
|
|
474
474
|
readonly version: number;
|
|
475
475
|
} | {
|
|
@@ -486,7 +486,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
486
486
|
} | {
|
|
487
487
|
readonly _tag: "Hid";
|
|
488
488
|
} | {
|
|
489
|
-
readonly _tag: "
|
|
489
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
490
490
|
} | {
|
|
491
491
|
readonly _tag: "EndedAnimation";
|
|
492
492
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/toast/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,MAAM,EAGN,MAAM,EACN,MAAM,IAAI,CAAC,EACZ,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAe1C,OAAO,EAML,KAAK,UAAU,EACf,KAAK,OAAO,EAOb,MAAM,aAAa,CAAA;AAIpB;;oDAEoD;AACpD,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,QAAQ,CAAC;IAClC,OAAO,EAAE,CAAC,CAAA;IACV,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAA;IACzB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC,CAAA;AAEF;;;eAGe;AACf,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/toast/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,MAAM,EAGN,MAAM,EACN,MAAM,IAAI,CAAC,EACZ,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAe1C,OAAO,EAML,KAAK,UAAU,EACf,KAAK,OAAO,EAOb,MAAM,aAAa,CAAA;AAIpB;;oDAEoD;AACpD,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,QAAQ,CAAC;IAClC,OAAO,EAAE,CAAC,CAAA;IACV,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAA;IACzB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC,CAAA;AAEF;;;eAGe;AACf,eAAO,MAAM,mBAAmB;;;;;;;;iBAW9B,CAAA;AAIF;;;;;;4EAM4E;AAC5E,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BA8ItC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+IG,SAAS,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAIP,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB/C,CAAA"}
|
package/dist/toast/update.js
CHANGED
|
@@ -5,19 +5,19 @@ import { evo } from 'foldkit/struct';
|
|
|
5
5
|
import { Hid as AnimationHid, Showed as AnimationShowed, init as animationInit, } from '../animation/schema.js';
|
|
6
6
|
import { defaultLeaveCommand as animationDefaultLeaveCommand, update as animationUpdate, } from '../animation/update.js';
|
|
7
7
|
import * as OptionExt from '../internal/optionExtensions.js';
|
|
8
|
-
import { DEFAULT_DURATION, Dismissed, DismissedAll,
|
|
8
|
+
import { CompletedWaitBeforeDismissal, DEFAULT_DURATION, Dismissed, DismissedAll, GotAnimationMessage, makeAdded, makeDismissedToast, makeEntry, makeMessage, makeModel, makeOutMessage, } from './schema.js';
|
|
9
9
|
/** Schedules an auto-dismiss timer for an entry. The result Message carries a
|
|
10
10
|
* version so stale timers (from hover or manual dismiss) are discarded in
|
|
11
11
|
* the update function. Static. The Command definition doesn't depend on
|
|
12
12
|
* payload. */
|
|
13
|
-
export const
|
|
13
|
+
export const WaitBeforeDismissal = Command.define('WaitBeforeDismissal', {
|
|
14
14
|
args: {
|
|
15
15
|
entryId: S.String,
|
|
16
16
|
version: S.Number,
|
|
17
17
|
duration: S.DurationFromMillis,
|
|
18
18
|
},
|
|
19
|
-
messages: [
|
|
20
|
-
execute: ({ entryId, version, duration }) => __foldkitBrandViewResult((Effect.sleep(duration).pipe(Effect.as(
|
|
19
|
+
messages: [CompletedWaitBeforeDismissal],
|
|
20
|
+
execute: ({ entryId, version, duration }) => __foldkitBrandViewResult((Effect.sleep(duration).pipe(Effect.as(CompletedWaitBeforeDismissal({ entryId, version })))), "@foldkit/ui/toast/update.js#execute"),
|
|
21
21
|
});
|
|
22
22
|
const DEFAULT_VARIANT = 'Info';
|
|
23
23
|
/** Factory that binds Toast's runtime (update fn, helpers, commands) to a
|
|
@@ -45,7 +45,7 @@ export const makeRuntime = (payloadSchema) => {
|
|
|
45
45
|
const { transitionState } = entry.animation;
|
|
46
46
|
return (__foldkitBrandViewResult((transitionState === 'LeaveStart' || transitionState === 'LeaveAnimating'), "@foldkit/ui/toast/update.js#isEntryLeaving"));
|
|
47
47
|
};
|
|
48
|
-
const scheduleDismiss = (entryId, version, duration) => __foldkitBrandViewResult((
|
|
48
|
+
const scheduleDismiss = (entryId, version, duration) => __foldkitBrandViewResult((WaitBeforeDismissal({ entryId, version, duration })), "@foldkit/ui/toast/update.js#scheduleDismiss");
|
|
49
49
|
const rescheduleDismissCommands = (entry) => {
|
|
50
50
|
if (isEntryLeaving(entry) || entry.isHovered) {
|
|
51
51
|
return __foldkitBrandViewResult(([]), "@foldkit/ui/toast/update.js#rescheduleDismissCommands");
|
|
@@ -166,7 +166,7 @@ export const makeRuntime = (payloadSchema) => {
|
|
|
166
166
|
currentOut,
|
|
167
167
|
]), "@foldkit/ui/toast/update.js#anonymous~8");
|
|
168
168
|
})), "@foldkit/ui/toast/update.js#DismissedAll"),
|
|
169
|
-
|
|
169
|
+
CompletedWaitBeforeDismissal: ({ entryId, version }) => {
|
|
170
170
|
const maybeEntry = Array.findFirst(model.entries, ({ id }) => __foldkitBrandViewResult((id === entryId), "@foldkit/ui/toast/update.js#anonymous~9"));
|
|
171
171
|
return __foldkitBrandViewResult((Option.match(maybeEntry, {
|
|
172
172
|
onNone: () => __foldkitBrandViewResult(([model, [], Option.none()]), "@foldkit/ui/toast/update.js#onNone~6"),
|
|
@@ -179,7 +179,7 @@ export const makeRuntime = (payloadSchema) => {
|
|
|
179
179
|
return __foldkitBrandViewResult((delegateToEntryAnimation(model, entryId, AnimationHid())), "@foldkit/ui/toast/update.js#onSome~4");
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
|
-
})), "@foldkit/ui/toast/update.js#
|
|
182
|
+
})), "@foldkit/ui/toast/update.js#CompletedWaitBeforeDismissal");
|
|
183
183
|
},
|
|
184
184
|
HoveredEntry: ({ entryId }) => __foldkitBrandViewResult(([
|
|
185
185
|
updateEntry(model, entryId, entry => __foldkitBrandViewResult((evo(entry, {
|