@foldkit/ui 0.155.0 → 0.156.0-canary.13f4f703eb6a
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/anchor.d.ts +18 -18
- package/dist/anchor/anchor.d.ts.map +1 -1
- package/dist/anchor/anchor.js +16 -16
- package/dist/animation/index.d.ts +4 -4
- package/dist/animation/index.d.ts.map +1 -1
- package/dist/animation/index.js +8 -8
- 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 +6 -6
- package/dist/animation/schema.d.ts.map +1 -1
- package/dist/animation/schema.js +5 -5
- package/dist/animation/update.d.ts +4 -2
- package/dist/animation/update.d.ts.map +1 -1
- package/dist/animation/update.js +18 -9
- package/dist/calendar/index.d.ts +56 -56
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +49 -37
- package/dist/checkbox/index.js +2 -2
- package/dist/combobox/multi.d.ts +19 -19
- package/dist/combobox/multi.d.ts.map +1 -1
- package/dist/combobox/multi.js +2 -2
- package/dist/combobox/shared.d.ts +61 -61
- package/dist/combobox/shared.d.ts.map +1 -1
- package/dist/combobox/shared.js +61 -61
- package/dist/combobox/single.d.ts +19 -19
- package/dist/combobox/single.d.ts.map +1 -1
- package/dist/combobox/single.js +2 -2
- package/dist/datePicker/index.d.ts +72 -72
- package/dist/datePicker/index.d.ts.map +1 -1
- package/dist/datePicker/index.js +12 -12
- package/dist/dialog/index.d.ts +14 -14
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +22 -22
- package/dist/disclosure/index.js +2 -2
- package/dist/dragAndDrop/index.d.ts +61 -61
- package/dist/dragAndDrop/index.d.ts.map +1 -1
- package/dist/dragAndDrop/index.js +85 -85
- package/dist/fileDrop/index.d.ts +6 -6
- package/dist/fileDrop/index.d.ts.map +1 -1
- package/dist/fileDrop/index.js +6 -6
- package/dist/hoverIntent/hoverIntent.d.ts +19 -16
- package/dist/hoverIntent/hoverIntent.d.ts.map +1 -1
- package/dist/hoverIntent/hoverIntent.js +49 -46
- package/dist/hoverIntent/message.d.ts +4 -4
- package/dist/hoverIntent/message.d.ts.map +1 -1
- package/dist/hoverIntent/message.js +4 -4
- package/dist/hoverIntent/public.d.ts +1 -1
- package/dist/hoverIntent/public.d.ts.map +1 -1
- package/dist/hoverIntent/public.js +1 -1
- package/dist/keyboard.js +2 -2
- package/dist/listbox/multi.d.ts +19 -19
- package/dist/listbox/multi.d.ts.map +1 -1
- package/dist/listbox/multi.js +2 -2
- package/dist/listbox/shared.d.ts +58 -58
- package/dist/listbox/shared.d.ts.map +1 -1
- package/dist/listbox/shared.js +61 -61
- package/dist/listbox/single.d.ts +19 -19
- package/dist/listbox/single.d.ts.map +1 -1
- package/dist/listbox/single.js +2 -2
- package/dist/menu/index.d.ts +67 -67
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +69 -66
- package/dist/popover/index.d.ts +34 -34
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/popover/index.js +36 -36
- package/dist/radioGroup/index.d.ts +12 -12
- package/dist/radioGroup/index.d.ts.map +1 -1
- package/dist/radioGroup/index.js +16 -16
- package/dist/slider/index.d.ts +14 -14
- package/dist/slider/index.d.ts.map +1 -1
- package/dist/slider/index.js +31 -31
- package/dist/switch/index.js +2 -2
- package/dist/tabs/index.d.ts +14 -14
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/index.js +18 -18
- package/dist/test/apps/disabledButton.d.ts +12 -12
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.js +5 -5
- package/dist/textarea/index.d.ts +2 -2
- package/dist/textarea/index.d.ts.map +1 -1
- package/dist/toast/index.d.ts +63 -63
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +19 -19
- package/dist/toast/schema.d.ts +55 -55
- package/dist/toast/schema.d.ts.map +1 -1
- package/dist/toast/schema.js +29 -29
- package/dist/toast/test.d.ts.map +1 -1
- package/dist/toast/test.js +3 -3
- package/dist/toast/update.d.ts +61 -61
- package/dist/toast/update.d.ts.map +1 -1
- package/dist/toast/update.js +11 -11
- package/dist/tooltip/message.d.ts +3 -3
- package/dist/tooltip/message.d.ts.map +1 -1
- package/dist/tooltip/message.js +3 -3
- package/dist/tooltip/tooltip.d.ts +24 -24
- package/dist/tooltip/tooltip.d.ts.map +1 -1
- package/dist/tooltip/tooltip.js +13 -13
- package/dist/typeahead.d.ts.map +1 -1
- package/dist/typeahead.js +3 -3
- package/dist/virtualList/index.d.ts +16 -16
- package/dist/virtualList/index.d.ts.map +1 -1
- package/dist/virtualList/index.js +13 -13
- package/package.json +4 -4
package/dist/toast/schema.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Duration, Schema
|
|
1
|
+
import { Duration, Schema } from 'effect';
|
|
2
2
|
/** Semantic category of a toast. Drives the default ARIA role: `status` for
|
|
3
3
|
* `Info` / `Success`, `alert` for `Warning` / `Error`. Also surfaced as
|
|
4
4
|
* `data-variant` on each entry for per-variant CSS. This is the only
|
|
5
5
|
* content-adjacent field the component owns. The rest of the entry's
|
|
6
6
|
* content lives in the user-provided payload. */
|
|
7
|
-
export declare const Variant:
|
|
7
|
+
export declare const Variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
8
8
|
export type Variant = typeof Variant.Type;
|
|
9
9
|
/** Where the toast viewport is anchored on the screen and how entries stack. */
|
|
10
|
-
export declare const Position:
|
|
10
|
+
export declare const Position: Schema.Literals<readonly ["TopLeft", "TopCenter", "TopRight", "BottomLeft", "BottomCenter", "BottomRight"]>;
|
|
11
11
|
export type Position = typeof Position.Type;
|
|
12
12
|
/** Schema factory for a single toast entry. `payloadSchema` is user-provided
|
|
13
13
|
* and defines the shape of per-entry content, whatever the consumer wants
|
|
@@ -15,60 +15,60 @@ export type Position = typeof Position.Type;
|
|
|
15
15
|
* `variant` (for ARIA role), `animation`, `maybeDuration`,
|
|
16
16
|
* `pendingDismissVersion` (for cancellable auto-dismiss), and `isHovered`
|
|
17
17
|
* (for pause-on-hover). */
|
|
18
|
-
export declare const makeEntry: <A, I>(payloadSchema:
|
|
19
|
-
readonly id:
|
|
20
|
-
readonly variant:
|
|
21
|
-
readonly animation:
|
|
22
|
-
readonly id:
|
|
23
|
-
readonly isShowing:
|
|
24
|
-
readonly transitionState:
|
|
18
|
+
export declare const makeEntry: <A, I>(payloadSchema: Schema.Codec<A, I>) => Schema.Struct<{
|
|
19
|
+
readonly id: Schema.String;
|
|
20
|
+
readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
21
|
+
readonly animation: Schema.Struct<{
|
|
22
|
+
readonly id: Schema.String;
|
|
23
|
+
readonly isShowing: Schema.Boolean;
|
|
24
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
25
25
|
}>;
|
|
26
|
-
readonly maybeDuration:
|
|
27
|
-
readonly pendingDismissVersion:
|
|
28
|
-
readonly isHovered:
|
|
29
|
-
readonly payload:
|
|
26
|
+
readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
|
|
27
|
+
readonly pendingDismissVersion: Schema.Number;
|
|
28
|
+
readonly isHovered: Schema.Boolean;
|
|
29
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
30
30
|
}>;
|
|
31
31
|
/** Schema factory for the toast container's state. `nextEntryKey` is a
|
|
32
32
|
* monotonic counter used to generate unique entry IDs purely from Model
|
|
33
33
|
* state. Thread the updated model through successive `show()` calls.
|
|
34
34
|
* Calling `show()` twice against the same pre-update model in the same tick
|
|
35
35
|
* will produce duplicate entry IDs. */
|
|
36
|
-
export declare const makeModel: <A, I>(payloadSchema:
|
|
37
|
-
readonly id:
|
|
38
|
-
readonly defaultDuration:
|
|
39
|
-
readonly entries:
|
|
40
|
-
readonly id:
|
|
41
|
-
readonly variant:
|
|
42
|
-
readonly animation:
|
|
43
|
-
readonly id:
|
|
44
|
-
readonly isShowing:
|
|
45
|
-
readonly transitionState:
|
|
36
|
+
export declare const makeModel: <A, I>(payloadSchema: Schema.Codec<A, I>) => Schema.Struct<{
|
|
37
|
+
readonly id: Schema.String;
|
|
38
|
+
readonly defaultDuration: Schema.DurationFromMillis;
|
|
39
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
40
|
+
readonly id: Schema.String;
|
|
41
|
+
readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
42
|
+
readonly animation: Schema.Struct<{
|
|
43
|
+
readonly id: Schema.String;
|
|
44
|
+
readonly isShowing: Schema.Boolean;
|
|
45
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
46
46
|
}>;
|
|
47
|
-
readonly maybeDuration:
|
|
48
|
-
readonly pendingDismissVersion:
|
|
49
|
-
readonly isHovered:
|
|
50
|
-
readonly payload:
|
|
47
|
+
readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
|
|
48
|
+
readonly pendingDismissVersion: Schema.Number;
|
|
49
|
+
readonly isHovered: Schema.Boolean;
|
|
50
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
51
51
|
}>>;
|
|
52
|
-
readonly nextEntryKey:
|
|
52
|
+
readonly nextEntryKey: Schema.Number;
|
|
53
53
|
}>;
|
|
54
54
|
/** Payload-independent Message variants shared by every bound Toast module. */
|
|
55
55
|
export declare const Message: import("foldkit/message").MessageUnion<{
|
|
56
56
|
readonly Dismissed: {
|
|
57
|
-
entryId:
|
|
57
|
+
entryId: Schema.String;
|
|
58
58
|
};
|
|
59
59
|
readonly DismissedAll: {};
|
|
60
60
|
readonly CompletedWaitBeforeDismissal: {
|
|
61
|
-
entryId:
|
|
62
|
-
version:
|
|
61
|
+
entryId: Schema.String;
|
|
62
|
+
version: Schema.Number;
|
|
63
63
|
};
|
|
64
64
|
readonly HoveredEntry: {
|
|
65
|
-
entryId:
|
|
65
|
+
entryId: Schema.String;
|
|
66
66
|
};
|
|
67
67
|
readonly LeftEntry: {
|
|
68
|
-
entryId:
|
|
68
|
+
entryId: Schema.String;
|
|
69
69
|
};
|
|
70
70
|
readonly GotAnimationMessage: {
|
|
71
|
-
entryId:
|
|
71
|
+
entryId: Schema.String;
|
|
72
72
|
message: import("foldkit/message").MessageUnion<{
|
|
73
73
|
readonly Showed: {};
|
|
74
74
|
readonly Hid: {};
|
|
@@ -84,38 +84,38 @@ export type HoveredEntry = typeof Message.HoveredEntry.Type;
|
|
|
84
84
|
export type LeftEntry = typeof Message.LeftEntry.Type;
|
|
85
85
|
export type GotAnimationMessage = typeof Message.GotAnimationMessage.Type;
|
|
86
86
|
/** Factory for the union of all messages the toast component can produce. */
|
|
87
|
-
export declare const makeMessage: <A, I>(payloadSchema:
|
|
87
|
+
export declare const makeMessage: <A, I>(payloadSchema: Schema.Codec<A, I>) => import("foldkit/message").MessageUnion<{
|
|
88
88
|
readonly Added: {
|
|
89
|
-
entry:
|
|
90
|
-
readonly id:
|
|
91
|
-
readonly variant:
|
|
92
|
-
readonly animation:
|
|
93
|
-
readonly id:
|
|
94
|
-
readonly isShowing:
|
|
95
|
-
readonly transitionState:
|
|
89
|
+
entry: Schema.Struct<{
|
|
90
|
+
readonly id: Schema.String;
|
|
91
|
+
readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
92
|
+
readonly animation: Schema.Struct<{
|
|
93
|
+
readonly id: Schema.String;
|
|
94
|
+
readonly isShowing: Schema.Boolean;
|
|
95
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
96
96
|
}>;
|
|
97
|
-
readonly maybeDuration:
|
|
98
|
-
readonly pendingDismissVersion:
|
|
99
|
-
readonly isHovered:
|
|
100
|
-
readonly payload:
|
|
97
|
+
readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
|
|
98
|
+
readonly pendingDismissVersion: Schema.Number;
|
|
99
|
+
readonly isHovered: Schema.Boolean;
|
|
100
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
101
101
|
}>;
|
|
102
102
|
};
|
|
103
103
|
readonly Dismissed: {
|
|
104
|
-
entryId:
|
|
104
|
+
entryId: Schema.String;
|
|
105
105
|
};
|
|
106
106
|
readonly DismissedAll: {};
|
|
107
107
|
readonly CompletedWaitBeforeDismissal: {
|
|
108
|
-
entryId:
|
|
109
|
-
version:
|
|
108
|
+
entryId: Schema.String;
|
|
109
|
+
version: Schema.Number;
|
|
110
110
|
};
|
|
111
111
|
readonly HoveredEntry: {
|
|
112
|
-
entryId:
|
|
112
|
+
entryId: Schema.String;
|
|
113
113
|
};
|
|
114
114
|
readonly LeftEntry: {
|
|
115
|
-
entryId:
|
|
115
|
+
entryId: Schema.String;
|
|
116
116
|
};
|
|
117
117
|
readonly GotAnimationMessage: {
|
|
118
|
-
entryId:
|
|
118
|
+
entryId: Schema.String;
|
|
119
119
|
message: import("foldkit/message").MessageUnion<{
|
|
120
120
|
readonly Showed: {};
|
|
121
121
|
readonly Hid: {};
|
|
@@ -125,9 +125,9 @@ export declare const makeMessage: <A, I>(payloadSchema: S.Codec<A, I>) => import
|
|
|
125
125
|
};
|
|
126
126
|
}>;
|
|
127
127
|
/** Factory for the union of out-messages the toast component can produce. */
|
|
128
|
-
export declare const makeOutMessage: <A, I>(payloadSchema:
|
|
128
|
+
export declare const makeOutMessage: <A, I>(payloadSchema: Schema.Codec<A, I>) => import("foldkit/message").MessageUnion<{
|
|
129
129
|
readonly DismissedToast: {
|
|
130
|
-
payload:
|
|
130
|
+
payload: Schema.Codec<A, I, never, never>;
|
|
131
131
|
};
|
|
132
132
|
}>;
|
|
133
133
|
/** Configuration for creating a toast container model. `defaultDuration` is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/toast/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/toast/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAOzC;;;;kDAIkD;AAClD,eAAO,MAAM,OAAO,mEAA2D,CAAA;AAC/E,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,gFAAgF;AAChF,eAAO,MAAM,QAAQ,6GAOnB,CAAA;AACF,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAA;AAI3C;;;;;4BAK4B;AAC5B,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;EAS7D,CAAA;AAIJ;;;;wCAIwC;AACxC,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;EAM7D,CAAA;AAIJ,+EAA+E;AAC/E,eAAO,MAAM,OAAO;;QACL,OAAO;;;;QAGlB,OAAO;QACP,OAAO;;;QAEO,OAAO;;;QACV,OAAO;;;QAElB,OAAO;QACP,OAAO;;;;;;;EAET,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,OAAO,OAAO,CAAC,SAAS,CAAC,IAAI,CAAA;AACrD,MAAM,MAAM,YAAY,GAAG,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAA;AAC3D,MAAM,MAAM,4BAA4B,GACtC,OAAO,OAAO,CAAC,4BAA4B,CAAC,IAAI,CAAA;AAClD,MAAM,MAAM,YAAY,GAAG,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAA;AAC3D,MAAM,MAAM,SAAS,GAAG,OAAO,OAAO,CAAC,SAAS,CAAC,IAAI,CAAA;AACrD,MAAM,MAAM,mBAAmB,GAAG,OAAO,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAA;AAEzE,6EAA6E;AAC7E,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;QAEtD,KAAK;;;;;;;;;;;;;;;QACD,OAAO;;;;QAGlB,OAAO;QACP,OAAO;;;QAEO,OAAO;;;QACV,OAAO;;;QAElB,OAAO;QACP,OAAO;;;;;;;EAET,CAAA;AAEJ,6EAA6E;AAC7E,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;QAC7B,OAAO;;EAAoB,CAAA;AAIpE;;;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
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Duration, Schema
|
|
2
|
+
import { Duration, Schema } from 'effect';
|
|
3
3
|
import { defineMessageUnion } from 'foldkit/message';
|
|
4
|
-
import
|
|
4
|
+
import * as Animation from '../animation/schema.js';
|
|
5
5
|
// VARIANT
|
|
6
6
|
/** Semantic category of a toast. Drives the default ARIA role: `status` for
|
|
7
7
|
* `Info` / `Success`, `alert` for `Warning` / `Error`. Also surfaced as
|
|
8
8
|
* `data-variant` on each entry for per-variant CSS. This is the only
|
|
9
9
|
* content-adjacent field the component owns. The rest of the entry's
|
|
10
10
|
* content lives in the user-provided payload. */
|
|
11
|
-
export const Variant =
|
|
11
|
+
export const Variant = Schema.Literals(['Info', 'Success', 'Warning', 'Error']);
|
|
12
12
|
// POSITION
|
|
13
13
|
/** Where the toast viewport is anchored on the screen and how entries stack. */
|
|
14
|
-
export const Position =
|
|
14
|
+
export const Position = Schema.Literals([
|
|
15
15
|
'TopLeft',
|
|
16
16
|
'TopCenter',
|
|
17
17
|
'TopRight',
|
|
@@ -26,13 +26,13 @@ export const Position = S.Literals([
|
|
|
26
26
|
* `variant` (for ARIA role), `animation`, `maybeDuration`,
|
|
27
27
|
* `pendingDismissVersion` (for cancellable auto-dismiss), and `isHovered`
|
|
28
28
|
* (for pause-on-hover). */
|
|
29
|
-
export const makeEntry = (payloadSchema) => __foldkitBrandViewResult((
|
|
30
|
-
id:
|
|
29
|
+
export const makeEntry = (payloadSchema) => __foldkitBrandViewResult((Schema.Struct({
|
|
30
|
+
id: Schema.String,
|
|
31
31
|
variant: Variant,
|
|
32
|
-
animation:
|
|
33
|
-
maybeDuration:
|
|
34
|
-
pendingDismissVersion:
|
|
35
|
-
isHovered:
|
|
32
|
+
animation: Animation.Model,
|
|
33
|
+
maybeDuration: Schema.Option(Schema.DurationFromMillis),
|
|
34
|
+
pendingDismissVersion: Schema.Number,
|
|
35
|
+
isHovered: Schema.Boolean,
|
|
36
36
|
payload: payloadSchema,
|
|
37
37
|
})), "@foldkit/ui/toast/schema.js#makeEntry");
|
|
38
38
|
// MODEL
|
|
@@ -41,42 +41,42 @@ export const makeEntry = (payloadSchema) => __foldkitBrandViewResult((S.Struct({
|
|
|
41
41
|
* state. Thread the updated model through successive `show()` calls.
|
|
42
42
|
* Calling `show()` twice against the same pre-update model in the same tick
|
|
43
43
|
* will produce duplicate entry IDs. */
|
|
44
|
-
export const makeModel = (payloadSchema) => __foldkitBrandViewResult((
|
|
45
|
-
id:
|
|
46
|
-
defaultDuration:
|
|
47
|
-
entries:
|
|
48
|
-
nextEntryKey:
|
|
44
|
+
export const makeModel = (payloadSchema) => __foldkitBrandViewResult((Schema.Struct({
|
|
45
|
+
id: Schema.String,
|
|
46
|
+
defaultDuration: Schema.DurationFromMillis,
|
|
47
|
+
entries: Schema.Array(makeEntry(payloadSchema)),
|
|
48
|
+
nextEntryKey: Schema.Number,
|
|
49
49
|
})), "@foldkit/ui/toast/schema.js#makeModel");
|
|
50
50
|
// MESSAGE
|
|
51
51
|
/** Payload-independent Message variants shared by every bound Toast module. */
|
|
52
52
|
export const Message = defineMessageUnion({
|
|
53
|
-
Dismissed: { entryId:
|
|
53
|
+
Dismissed: { entryId: Schema.String },
|
|
54
54
|
DismissedAll: {},
|
|
55
55
|
CompletedWaitBeforeDismissal: {
|
|
56
|
-
entryId:
|
|
57
|
-
version:
|
|
56
|
+
entryId: Schema.String,
|
|
57
|
+
version: Schema.Number,
|
|
58
58
|
},
|
|
59
|
-
HoveredEntry: { entryId:
|
|
60
|
-
LeftEntry: { entryId:
|
|
59
|
+
HoveredEntry: { entryId: Schema.String },
|
|
60
|
+
LeftEntry: { entryId: Schema.String },
|
|
61
61
|
GotAnimationMessage: {
|
|
62
|
-
entryId:
|
|
63
|
-
message:
|
|
62
|
+
entryId: Schema.String,
|
|
63
|
+
message: Animation.Message,
|
|
64
64
|
},
|
|
65
65
|
});
|
|
66
66
|
/** Factory for the union of all messages the toast component can produce. */
|
|
67
67
|
export const makeMessage = (payloadSchema) => __foldkitBrandViewResult((defineMessageUnion({
|
|
68
68
|
Added: { entry: makeEntry(payloadSchema) },
|
|
69
|
-
Dismissed: { entryId:
|
|
69
|
+
Dismissed: { entryId: Schema.String },
|
|
70
70
|
DismissedAll: {},
|
|
71
71
|
CompletedWaitBeforeDismissal: {
|
|
72
|
-
entryId:
|
|
73
|
-
version:
|
|
72
|
+
entryId: Schema.String,
|
|
73
|
+
version: Schema.Number,
|
|
74
74
|
},
|
|
75
|
-
HoveredEntry: { entryId:
|
|
76
|
-
LeftEntry: { entryId:
|
|
75
|
+
HoveredEntry: { entryId: Schema.String },
|
|
76
|
+
LeftEntry: { entryId: Schema.String },
|
|
77
77
|
GotAnimationMessage: {
|
|
78
|
-
entryId:
|
|
79
|
-
message:
|
|
78
|
+
entryId: Schema.String,
|
|
79
|
+
message: Animation.Message,
|
|
80
80
|
},
|
|
81
81
|
})), "@foldkit/ui/toast/schema.js#makeMessage");
|
|
82
82
|
/** Factory for the union of out-messages the toast component can produce. */
|
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;
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/toast/test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AAMtC;;;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,0BAGpB,eAAe,iKAUf,CAAA"}
|
package/dist/toast/test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
2
|
import * as Story from 'foldkit/story';
|
|
3
|
-
import
|
|
3
|
+
import * as Animation from '../animation/index.js';
|
|
4
4
|
import { Message } from './schema.js';
|
|
5
5
|
import { WaitBeforeDismissal } from './update.js';
|
|
6
6
|
const DEFAULT_VERSION = 0;
|
|
@@ -35,7 +35,7 @@ const DEFAULT_VERSION = 0;
|
|
|
35
35
|
* )
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
export const drainEntry = ({ entryId, version = DEFAULT_VERSION, }) => __foldkitBrandViewResult((Story.Command.resolveAll([WaitForPaint,
|
|
38
|
+
export const drainEntry = ({ entryId, version = DEFAULT_VERSION, }) => __foldkitBrandViewResult((Story.Command.resolveAll([Animation.WaitForPaint, Animation.Message.CompletedWaitForPaint()], [Animation.WaitForAnimationSettled, Animation.Message.EndedAnimation()], [
|
|
39
39
|
WaitBeforeDismissal,
|
|
40
40
|
Message.CompletedWaitBeforeDismissal({ entryId, version }),
|
|
41
|
-
], [WaitForPaint,
|
|
41
|
+
], [Animation.WaitForPaint, Animation.Message.CompletedWaitForPaint()], [Animation.WaitForAnimationSettled, Animation.Message.EndedAnimation()])), "@foldkit/ui/toast/test.js#drainEntry");
|
package/dist/toast/update.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Duration, Effect, Option, Schema
|
|
1
|
+
import { Duration, Effect, Option, Schema } from 'effect';
|
|
2
2
|
import * as Command from 'foldkit/command';
|
|
3
3
|
import * as Update from 'foldkit/update';
|
|
4
4
|
import { type InitConfig, type Variant } from './schema.js';
|
|
@@ -16,9 +16,9 @@ export type ShowInput<A> = Readonly<{
|
|
|
16
16
|
* the update function. Static. The Command definition doesn't depend on
|
|
17
17
|
* payload. */
|
|
18
18
|
export declare const WaitBeforeDismissal: Command.CommandDefinitionWithArgs<"WaitBeforeDismissal", {
|
|
19
|
-
entryId:
|
|
20
|
-
version:
|
|
21
|
-
duration:
|
|
19
|
+
entryId: Schema.String;
|
|
20
|
+
version: Schema.Number;
|
|
21
|
+
duration: Schema.DurationFromMillis;
|
|
22
22
|
}, Effect.Effect<{
|
|
23
23
|
readonly _tag: "CompletedWaitBeforeDismissal";
|
|
24
24
|
readonly entryId: string;
|
|
@@ -31,70 +31,70 @@ export declare const WaitBeforeDismissal: Command.CommandDefinitionWithArgs<"Wai
|
|
|
31
31
|
*
|
|
32
32
|
* @internal Consumers should use `Toast.make(PayloadSchema)`. This is
|
|
33
33
|
* only exported so `index.ts` can wire the view into the bound runtime. */
|
|
34
|
-
export declare const makeRuntime: <A, I>(payloadSchema:
|
|
35
|
-
readonly Entry:
|
|
36
|
-
readonly id:
|
|
37
|
-
readonly variant:
|
|
38
|
-
readonly animation:
|
|
39
|
-
readonly id:
|
|
40
|
-
readonly isShowing:
|
|
41
|
-
readonly transitionState:
|
|
34
|
+
export declare const makeRuntime: <A, I>(payloadSchema: Schema.Codec<A, I>) => {
|
|
35
|
+
readonly Entry: Schema.Struct<{
|
|
36
|
+
readonly id: Schema.String;
|
|
37
|
+
readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
38
|
+
readonly animation: Schema.Struct<{
|
|
39
|
+
readonly id: Schema.String;
|
|
40
|
+
readonly isShowing: Schema.Boolean;
|
|
41
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
42
42
|
}>;
|
|
43
|
-
readonly maybeDuration:
|
|
44
|
-
readonly pendingDismissVersion:
|
|
45
|
-
readonly isHovered:
|
|
46
|
-
readonly payload:
|
|
43
|
+
readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
|
|
44
|
+
readonly pendingDismissVersion: Schema.Number;
|
|
45
|
+
readonly isHovered: Schema.Boolean;
|
|
46
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
47
47
|
}>;
|
|
48
|
-
readonly Model:
|
|
49
|
-
readonly id:
|
|
50
|
-
readonly defaultDuration:
|
|
51
|
-
readonly entries:
|
|
52
|
-
readonly id:
|
|
53
|
-
readonly variant:
|
|
54
|
-
readonly animation:
|
|
55
|
-
readonly id:
|
|
56
|
-
readonly isShowing:
|
|
57
|
-
readonly transitionState:
|
|
48
|
+
readonly Model: Schema.Struct<{
|
|
49
|
+
readonly id: Schema.String;
|
|
50
|
+
readonly defaultDuration: Schema.DurationFromMillis;
|
|
51
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
52
|
+
readonly id: Schema.String;
|
|
53
|
+
readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
54
|
+
readonly animation: Schema.Struct<{
|
|
55
|
+
readonly id: Schema.String;
|
|
56
|
+
readonly isShowing: Schema.Boolean;
|
|
57
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
58
58
|
}>;
|
|
59
|
-
readonly maybeDuration:
|
|
60
|
-
readonly pendingDismissVersion:
|
|
61
|
-
readonly isHovered:
|
|
62
|
-
readonly payload:
|
|
59
|
+
readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
|
|
60
|
+
readonly pendingDismissVersion: Schema.Number;
|
|
61
|
+
readonly isHovered: Schema.Boolean;
|
|
62
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
63
63
|
}>>;
|
|
64
|
-
readonly nextEntryKey:
|
|
64
|
+
readonly nextEntryKey: Schema.Number;
|
|
65
65
|
}>;
|
|
66
66
|
readonly Message: import("foldkit/message").MessageUnion<{
|
|
67
67
|
readonly Added: {
|
|
68
|
-
readonly entry:
|
|
69
|
-
readonly id:
|
|
70
|
-
readonly variant:
|
|
71
|
-
readonly animation:
|
|
72
|
-
readonly id:
|
|
73
|
-
readonly isShowing:
|
|
74
|
-
readonly transitionState:
|
|
68
|
+
readonly entry: Schema.Struct<{
|
|
69
|
+
readonly id: Schema.String;
|
|
70
|
+
readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
71
|
+
readonly animation: Schema.Struct<{
|
|
72
|
+
readonly id: Schema.String;
|
|
73
|
+
readonly isShowing: Schema.Boolean;
|
|
74
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
75
75
|
}>;
|
|
76
|
-
readonly maybeDuration:
|
|
77
|
-
readonly pendingDismissVersion:
|
|
78
|
-
readonly isHovered:
|
|
79
|
-
readonly payload:
|
|
76
|
+
readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
|
|
77
|
+
readonly pendingDismissVersion: Schema.Number;
|
|
78
|
+
readonly isHovered: Schema.Boolean;
|
|
79
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
80
80
|
}>;
|
|
81
81
|
};
|
|
82
82
|
readonly Dismissed: {
|
|
83
|
-
entryId:
|
|
83
|
+
entryId: Schema.String;
|
|
84
84
|
};
|
|
85
85
|
readonly DismissedAll: {};
|
|
86
86
|
readonly CompletedWaitBeforeDismissal: {
|
|
87
|
-
entryId:
|
|
88
|
-
version:
|
|
87
|
+
entryId: Schema.String;
|
|
88
|
+
version: Schema.Number;
|
|
89
89
|
};
|
|
90
90
|
readonly HoveredEntry: {
|
|
91
|
-
entryId:
|
|
91
|
+
entryId: Schema.String;
|
|
92
92
|
};
|
|
93
93
|
readonly LeftEntry: {
|
|
94
|
-
entryId:
|
|
94
|
+
entryId: Schema.String;
|
|
95
95
|
};
|
|
96
96
|
readonly GotAnimationMessage: {
|
|
97
|
-
entryId:
|
|
97
|
+
entryId: Schema.String;
|
|
98
98
|
message: import("foldkit/message").MessageUnion<{
|
|
99
99
|
readonly Showed: {};
|
|
100
100
|
readonly Hid: {};
|
|
@@ -105,26 +105,26 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
105
105
|
}>;
|
|
106
106
|
readonly OutMessage: import("foldkit/message").MessageUnion<{
|
|
107
107
|
readonly DismissedToast: {
|
|
108
|
-
readonly payload:
|
|
108
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
109
109
|
};
|
|
110
110
|
}>;
|
|
111
111
|
readonly Added: import("foldkit/schema").CallableTaggedStruct<"Added", {
|
|
112
|
-
readonly entry:
|
|
113
|
-
readonly id:
|
|
114
|
-
readonly variant:
|
|
115
|
-
readonly animation:
|
|
116
|
-
readonly id:
|
|
117
|
-
readonly isShowing:
|
|
118
|
-
readonly transitionState:
|
|
112
|
+
readonly entry: Schema.Struct<{
|
|
113
|
+
readonly id: Schema.String;
|
|
114
|
+
readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
115
|
+
readonly animation: Schema.Struct<{
|
|
116
|
+
readonly id: Schema.String;
|
|
117
|
+
readonly isShowing: Schema.Boolean;
|
|
118
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
119
119
|
}>;
|
|
120
|
-
readonly maybeDuration:
|
|
121
|
-
readonly pendingDismissVersion:
|
|
122
|
-
readonly isHovered:
|
|
123
|
-
readonly payload:
|
|
120
|
+
readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
|
|
121
|
+
readonly pendingDismissVersion: Schema.Number;
|
|
122
|
+
readonly isHovered: Schema.Boolean;
|
|
123
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
124
124
|
}>;
|
|
125
125
|
}>;
|
|
126
126
|
readonly DismissedToast: import("foldkit/schema").CallableTaggedStruct<"DismissedToast", {
|
|
127
|
-
readonly payload:
|
|
127
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
128
128
|
}>;
|
|
129
129
|
readonly init: (config: InitConfig) => {
|
|
130
130
|
readonly id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/toast/update.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/toast/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,QAAQ,EAAE,MAAM,EAAU,MAAM,EAAE,MAAM,EAAQ,MAAM,QAAQ,CAAA;AAC9E,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE1C,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAQxC,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,OAAO,EAKb,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;;;;;;;;iBAa9B,CAAA;AAIF;;;;;;4EAM4E;AAC5E,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BA2K3C,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuHG,SAAS,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAIP,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB/C,CAAA"}
|
package/dist/toast/update.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Array, Duration, Effect,
|
|
2
|
+
import { Array, Duration, Effect, Number, Option, Schema, pipe } from 'effect';
|
|
3
3
|
import * as Command from 'foldkit/command';
|
|
4
4
|
import { evo } from 'foldkit/struct';
|
|
5
5
|
import * as Update from 'foldkit/update';
|
|
6
|
-
import
|
|
6
|
+
import * as Animation from '../animation/schema.js';
|
|
7
7
|
import { defaultLeaveCommand as animationDefaultLeaveCommand, update as animationUpdate, } from '../animation/update.js';
|
|
8
8
|
import * as OptionExt from '../internal/optionExtensions.js';
|
|
9
9
|
import { DEFAULT_DURATION, Message as StaticMessage, makeEntry, makeMessage, makeModel, makeOutMessage, } from './schema.js';
|
|
@@ -13,9 +13,9 @@ import { DEFAULT_DURATION, Message as StaticMessage, makeEntry, makeMessage, mak
|
|
|
13
13
|
* payload. */
|
|
14
14
|
export const WaitBeforeDismissal = Command.define('WaitBeforeDismissal', {
|
|
15
15
|
args: {
|
|
16
|
-
entryId:
|
|
17
|
-
version:
|
|
18
|
-
duration:
|
|
16
|
+
entryId: Schema.String,
|
|
17
|
+
version: Schema.Number,
|
|
18
|
+
duration: Schema.DurationFromMillis,
|
|
19
19
|
},
|
|
20
20
|
messages: [StaticMessage.CompletedWaitBeforeDismissal],
|
|
21
21
|
execute: ({ entryId, version, duration }) => __foldkitBrandViewResult((Effect.sleep(duration).pipe(Effect.as(StaticMessage.CompletedWaitBeforeDismissal({ entryId, version })))), "@foldkit/ui/toast/update.js#execute"),
|
|
@@ -62,11 +62,11 @@ export const makeRuntime = (payloadSchema) => {
|
|
|
62
62
|
const readEntryAnimation = (entryId) => __foldkitBrandViewResult(((model) => __foldkitBrandViewResult((pipe(Array.findFirst(model.entries, ({ id }) => __foldkitBrandViewResult((id === entryId), "@foldkit/ui/toast/update.js#anonymous~4")), Option.map(({ animation }) => __foldkitBrandViewResult((animation), "@foldkit/ui/toast/update.js#anonymous~5")))), "@foldkit/ui/toast/update.js#anonymous~3")), "@foldkit/ui/toast/update.js#readEntryAnimation");
|
|
63
63
|
const writeEntryAnimation = (entryId) => __foldkitBrandViewResult(((model, nextAnimation) => __foldkitBrandViewResult((updateEntry(model, entryId, entry => __foldkitBrandViewResult((evo(entry, { animation: () => __foldkitBrandViewResult((nextAnimation), "@foldkit/ui/toast/update.js#animation") })), "@foldkit/ui/toast/update.js#anonymous~7"))), "@foldkit/ui/toast/update.js#anonymous~6")), "@foldkit/ui/toast/update.js#writeEntryAnimation");
|
|
64
64
|
const toGotAnimationMessage = (entryId) => __foldkitBrandViewResult(((message) => __foldkitBrandViewResult((MessageSchema.GotAnimationMessage({ entryId, message })), "@foldkit/ui/toast/update.js#anonymous~8")), "@foldkit/ui/toast/update.js#toGotAnimationMessage");
|
|
65
|
-
const toDismissedToastOutMessage = payload => __foldkitBrandViewResult((
|
|
65
|
+
const toDismissedToastOutMessage = payload => __foldkitBrandViewResult((Animation.OutMessage.match({
|
|
66
66
|
StartedLeaveAnimating: () => __foldkitBrandViewResult((undefined), "@foldkit/ui/toast/update.js#StartedLeaveAnimating"),
|
|
67
67
|
TransitionedOut: () => __foldkitBrandViewResult((OutMessageSchema.DismissedToast({ payload })), "@foldkit/ui/toast/update.js#TransitionedOut"),
|
|
68
|
-
}))
|
|
69
|
-
const foldEntryAnimationOutMessage = entryId => __foldkitBrandViewResult(((outMessage, { liftCommand }) => __foldkitBrandViewResult((
|
|
68
|
+
})), "@foldkit/ui/toast/update.js#toDismissedToastOutMessage");
|
|
69
|
+
const foldEntryAnimationOutMessage = entryId => __foldkitBrandViewResult(((outMessage, { liftCommand }) => __foldkitBrandViewResult((Animation.OutMessage.match(outMessage, {
|
|
70
70
|
StartedLeaveAnimating: () => __foldkitBrandViewResult((model => __foldkitBrandViewResult((Option.match(readEntryAnimation(entryId)(model), {
|
|
71
71
|
onNone: () => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/toast/update.js#onNone~2")),
|
|
72
72
|
onSome: animation => (__foldkitBrandViewResult(({
|
|
@@ -87,13 +87,13 @@ export const makeRuntime = (payloadSchema) => {
|
|
|
87
87
|
foldOutMessage: foldEntryAnimationOutMessage(entry.id),
|
|
88
88
|
})), "@foldkit/ui/toast/update.js#foldEntryAnimation");
|
|
89
89
|
const foldEntryAnimationShow = (entry) => __foldkitBrandViewResult((Update.foldChildStep({
|
|
90
|
-
update: (animation) => __foldkitBrandViewResult((animationUpdate(animation,
|
|
90
|
+
update: (animation) => __foldkitBrandViewResult((animationUpdate(animation, Animation.Message.Showed())), "@foldkit/ui/toast/update.js#update"),
|
|
91
91
|
read: readEntryAnimation(entry.id),
|
|
92
92
|
write: writeEntryAnimation(entry.id),
|
|
93
93
|
toParentMessage: toGotAnimationMessage(entry.id),
|
|
94
94
|
})), "@foldkit/ui/toast/update.js#foldEntryAnimationShow");
|
|
95
95
|
const foldEntryAnimationHide = (entry) => __foldkitBrandViewResult((Update.foldChildStep({
|
|
96
|
-
update: (animation) => __foldkitBrandViewResult((animationUpdate(animation,
|
|
96
|
+
update: (animation) => __foldkitBrandViewResult((animationUpdate(animation, Animation.Message.Hid())), "@foldkit/ui/toast/update.js#update~2"),
|
|
97
97
|
read: readEntryAnimation(entry.id),
|
|
98
98
|
write: writeEntryAnimation(entry.id),
|
|
99
99
|
toParentMessage: toGotAnimationMessage(entry.id),
|
|
@@ -111,7 +111,7 @@ export const makeRuntime = (payloadSchema) => {
|
|
|
111
111
|
return __foldkitBrandViewResult(({
|
|
112
112
|
id: entryId,
|
|
113
113
|
variant: input.variant ?? DEFAULT_VARIANT,
|
|
114
|
-
animation:
|
|
114
|
+
animation: Animation.init({ id: entryId, isShowing: false }),
|
|
115
115
|
maybeDuration,
|
|
116
116
|
pendingDismissVersion: 0,
|
|
117
117
|
isHovered: false,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
/** Union of all messages the tooltip component can produce. */
|
|
3
3
|
export declare const Message: import("foldkit/message").MessageUnion<{
|
|
4
4
|
readonly EnteredTrigger: {};
|
|
@@ -7,10 +7,10 @@ export declare const Message: import("foldkit/message").MessageUnion<{
|
|
|
7
7
|
readonly BlurredTrigger: {};
|
|
8
8
|
readonly PressedEscape: {};
|
|
9
9
|
readonly PressedPointerOnTrigger: {
|
|
10
|
-
pointerType:
|
|
10
|
+
pointerType: Schema.String;
|
|
11
11
|
};
|
|
12
12
|
readonly CompletedWaitBeforeShowing: {
|
|
13
|
-
version:
|
|
13
|
+
version: Schema.Number;
|
|
14
14
|
};
|
|
15
15
|
readonly CompletedAnchorTooltip: {};
|
|
16
16
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/tooltip/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/tooltip/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAK/B,+DAA+D;AAC/D,eAAO,MAAM,OAAO;;;;;;;QAMS,WAAW;;;QACR,OAAO;;;EAErC,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,OAAO,OAAO,CAAC,cAAc,CAAC,IAAI,CAAA;AAC/D,MAAM,MAAM,WAAW,GAAG,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAA;AACzD,MAAM,MAAM,cAAc,GAAG,OAAO,OAAO,CAAC,cAAc,CAAC,IAAI,CAAA;AAC/D,MAAM,MAAM,cAAc,GAAG,OAAO,OAAO,CAAC,cAAc,CAAC,IAAI,CAAA;AAC/D,MAAM,MAAM,aAAa,GAAG,OAAO,OAAO,CAAC,aAAa,CAAC,IAAI,CAAA;AAC7D,MAAM,MAAM,uBAAuB,GACjC,OAAO,OAAO,CAAC,uBAAuB,CAAC,IAAI,CAAA;AAE7C,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,+DAA+D;AAC/D,eAAO,MAAM,UAAU;;;EAGrB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAA;AAChD,MAAM,MAAM,MAAM,GAAG,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA;AAClD,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA"}
|
package/dist/tooltip/message.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import { defineMessageUnion } from 'foldkit/message';
|
|
3
3
|
// MESSAGE
|
|
4
4
|
/** Union of all messages the tooltip component can produce. */
|
|
@@ -8,8 +8,8 @@ export const Message = defineMessageUnion({
|
|
|
8
8
|
FocusedTrigger: {},
|
|
9
9
|
BlurredTrigger: {},
|
|
10
10
|
PressedEscape: {},
|
|
11
|
-
PressedPointerOnTrigger: { pointerType:
|
|
12
|
-
CompletedWaitBeforeShowing: { version:
|
|
11
|
+
PressedPointerOnTrigger: { pointerType: Schema.String },
|
|
12
|
+
CompletedWaitBeforeShowing: { version: Schema.Number },
|
|
13
13
|
CompletedAnchorTooltip: {},
|
|
14
14
|
});
|
|
15
15
|
// OUT MESSAGE
|