foldkit 0.81.0 → 0.82.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/README.md +6 -4
- package/dist/calendar/calendarDate.d.ts +11 -11
- package/dist/calendar/calendarDate.d.ts.map +1 -1
- package/dist/calendar/calendarDate.js +14 -13
- package/dist/calendar/comparison.d.ts +3 -3
- package/dist/calendar/comparison.d.ts.map +1 -1
- package/dist/calendar/comparison.js +5 -5
- package/dist/calendar/info.d.ts +1 -1
- package/dist/calendar/info.d.ts.map +1 -1
- package/dist/calendar/info.js +9 -1
- package/dist/calendar/locale.d.ts +5 -5
- package/dist/calendar/locale.js +23 -2
- package/dist/command/index.d.ts +2 -2
- package/dist/command/index.d.ts.map +1 -1
- package/dist/devTools/overlay.d.ts.map +1 -1
- package/dist/devTools/overlay.js +49 -27
- package/dist/devTools/protocol.d.ts +192 -192
- package/dist/devTools/protocol.d.ts.map +1 -1
- package/dist/devTools/protocol.js +36 -12
- package/dist/devTools/serialize.d.ts.map +1 -1
- package/dist/devTools/serialize.js +4 -4
- package/dist/devTools/store.d.ts.map +1 -1
- package/dist/devTools/store.js +1 -2
- package/dist/devTools/submodelPath.d.ts +1 -1
- package/dist/devTools/summarize.d.ts +6 -6
- package/dist/devTools/summarize.d.ts.map +1 -1
- package/dist/devTools/summarize.js +6 -6
- package/dist/devTools/webSocketBridge.d.ts +1 -1
- package/dist/devTools/webSocketBridge.d.ts.map +1 -1
- package/dist/devTools/webSocketBridge.js +19 -18
- package/dist/fieldValidation/index.d.ts +11 -11
- package/dist/fieldValidation/index.d.ts.map +1 -1
- package/dist/fieldValidation/index.js +8 -7
- package/dist/file/error.d.ts +1 -1
- package/dist/file/file.d.ts +1 -1
- package/dist/file/file.js +1 -1
- package/dist/file/reader.d.ts +4 -4
- package/dist/file/reader.js +5 -5
- package/dist/file/select.js +1 -1
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +4 -3
- package/dist/html/lazy.d.ts.map +1 -1
- package/dist/html/lazy.js +6 -7
- package/dist/managedResource/index.d.ts +2 -2
- package/dist/managedResource/index.d.ts.map +1 -1
- package/dist/managedResource/index.js +2 -2
- package/dist/mount/index.d.ts +1 -1
- package/dist/mount/index.d.ts.map +1 -1
- package/dist/route/parser.d.ts +2 -2
- package/dist/route/parser.d.ts.map +1 -1
- package/dist/route/parser.js +5 -5
- package/dist/runtime/browserListeners.d.ts.map +1 -1
- package/dist/runtime/browserListeners.js +6 -7
- package/dist/runtime/deepFreeze.d.ts +1 -1
- package/dist/runtime/deepFreeze.js +2 -2
- package/dist/runtime/hmrProtocol.d.ts +22 -0
- package/dist/runtime/hmrProtocol.d.ts.map +1 -0
- package/dist/runtime/hmrProtocol.js +15 -0
- package/dist/runtime/hmrProtocolPublic.d.ts +2 -0
- package/dist/runtime/hmrProtocolPublic.d.ts.map +1 -0
- package/dist/runtime/hmrProtocolPublic.js +1 -0
- package/dist/runtime/runtime.d.ts +10 -7
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +116 -114
- package/dist/runtime/subscription.d.ts +5 -5
- package/dist/runtime/subscription.d.ts.map +1 -1
- package/dist/runtime/urlRequest.d.ts +15 -15
- package/dist/runtime/urlRequest.d.ts.map +1 -1
- package/dist/runtime/urlRequest.js +1 -1
- package/dist/schema/index.d.ts +3 -3
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +10 -4
- package/dist/task/dom.js +1 -1
- package/dist/task/elementMovement.js +1 -1
- package/dist/task/error.d.ts +2 -2
- package/dist/task/inert.d.ts.map +1 -1
- package/dist/task/inert.js +4 -7
- package/dist/task/time.d.ts +1 -1
- package/dist/task/time.js +1 -1
- package/dist/task/timing.d.ts +1 -1
- package/dist/task/timing.d.ts.map +1 -1
- package/dist/task/timing.js +2 -2
- package/dist/test/apps/bubbling.d.ts +3 -3
- package/dist/test/apps/bubbling.d.ts.map +1 -1
- package/dist/test/apps/bubbling.js +1 -1
- package/dist/test/apps/counter.d.ts +6 -6
- package/dist/test/apps/counter.d.ts.map +1 -1
- package/dist/test/apps/counter.js +7 -1
- package/dist/test/apps/disabledButton.d.ts +11 -11
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.js +1 -1
- package/dist/test/apps/fileUpload.d.ts +4 -4
- package/dist/test/apps/fileUpload.d.ts.map +1 -1
- package/dist/test/apps/fileUpload.js +1 -1
- package/dist/test/apps/formChild.d.ts +16 -16
- package/dist/test/apps/formChild.d.ts.map +1 -1
- package/dist/test/apps/formChild.js +9 -4
- package/dist/test/apps/interactions.d.ts +8 -8
- package/dist/test/apps/interactions.d.ts.map +1 -1
- package/dist/test/apps/interactions.js +8 -1
- package/dist/test/apps/keypress.d.ts +7 -7
- package/dist/test/apps/keypress.d.ts.map +1 -1
- package/dist/test/apps/keypress.js +1 -1
- package/dist/test/apps/login.d.ts +14 -14
- package/dist/test/apps/login.d.ts.map +1 -1
- package/dist/test/apps/login.js +9 -2
- package/dist/test/apps/logoutButton.d.ts +3 -3
- package/dist/test/apps/logoutButton.d.ts.map +1 -1
- package/dist/test/apps/logoutButton.js +2 -2
- package/dist/test/apps/multiRole.d.ts +2 -2
- package/dist/test/apps/multiRole.d.ts.map +1 -1
- package/dist/test/apps/multiRole.js +1 -1
- package/dist/test/apps/pointer.d.ts +6 -6
- package/dist/test/apps/pointer.d.ts.map +1 -1
- package/dist/test/apps/pointer.js +1 -1
- package/dist/test/apps/resumeUpload.d.ts +8 -8
- package/dist/test/apps/resumeUpload.d.ts.map +1 -1
- package/dist/test/apps/resumeUpload.js +12 -5
- package/dist/test/internal.js +10 -10
- package/dist/test/matchers.js +1 -1
- package/dist/test/query.d.ts.map +1 -1
- package/dist/test/query.js +13 -13
- package/dist/test/scene.d.ts.map +1 -1
- package/dist/test/scene.js +3 -3
- package/dist/test/story.js +1 -1
- package/dist/ui/animation/schema.d.ts +5 -5
- package/dist/ui/animation/schema.d.ts.map +1 -1
- package/dist/ui/animation/schema.js +9 -3
- package/dist/ui/calendar/index.d.ts +77 -77
- package/dist/ui/calendar/index.d.ts.map +1 -1
- package/dist/ui/calendar/index.js +26 -11
- package/dist/ui/checkbox/index.d.ts +2 -2
- package/dist/ui/combobox/multi.d.ts +38 -42
- package/dist/ui/combobox/multi.d.ts.map +1 -1
- package/dist/ui/combobox/multi.js +4 -1
- package/dist/ui/combobox/shared.d.ts +31 -31
- package/dist/ui/combobox/shared.d.ts.map +1 -1
- package/dist/ui/combobox/shared.js +34 -12
- package/dist/ui/combobox/single.d.ts +39 -43
- package/dist/ui/combobox/single.d.ts.map +1 -1
- package/dist/ui/combobox/single.js +7 -6
- package/dist/ui/datePicker/index.d.ts +86 -86
- package/dist/ui/datePicker/index.d.ts.map +1 -1
- package/dist/ui/datePicker/index.js +10 -3
- package/dist/ui/dialog/index.d.ts +8 -8
- package/dist/ui/dialog/index.d.ts.map +1 -1
- package/dist/ui/dialog/index.js +9 -3
- package/dist/ui/disclosure/index.d.ts +2 -2
- package/dist/ui/disclosure/index.d.ts.map +1 -1
- package/dist/ui/disclosure/index.js +1 -1
- package/dist/ui/dragAndDrop/index.d.ts +76 -76
- package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
- package/dist/ui/dragAndDrop/index.js +47 -29
- package/dist/ui/fileDrop/index.d.ts +8 -8
- package/dist/ui/fileDrop/index.d.ts.map +1 -1
- package/dist/ui/fileDrop/index.js +7 -2
- package/dist/ui/listbox/multi.d.ts +36 -40
- package/dist/ui/listbox/multi.d.ts.map +1 -1
- package/dist/ui/listbox/multi.js +4 -1
- package/dist/ui/listbox/shared.d.ts +32 -32
- package/dist/ui/listbox/shared.d.ts.map +1 -1
- package/dist/ui/listbox/shared.js +36 -11
- package/dist/ui/listbox/single.d.ts +36 -40
- package/dist/ui/listbox/single.d.ts.map +1 -1
- package/dist/ui/listbox/single.js +5 -2
- package/dist/ui/menu/index.d.ts +40 -40
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +38 -11
- package/dist/ui/popover/index.d.ts +12 -12
- package/dist/ui/popover/index.d.ts.map +1 -1
- package/dist/ui/popover/index.js +17 -2
- package/dist/ui/radioGroup/index.d.ts +6 -6
- package/dist/ui/radioGroup/index.d.ts.map +1 -1
- package/dist/ui/radioGroup/index.js +5 -5
- package/dist/ui/slider/index.d.ts +26 -26
- package/dist/ui/slider/index.d.ts.map +1 -1
- package/dist/ui/slider/index.js +30 -16
- package/dist/ui/switch/index.d.ts +2 -2
- package/dist/ui/tabs/index.d.ts +8 -8
- package/dist/ui/tabs/index.d.ts.map +1 -1
- package/dist/ui/tabs/index.js +3 -3
- package/dist/ui/toast/index.d.ts +75 -75
- package/dist/ui/toast/index.d.ts.map +1 -1
- package/dist/ui/toast/index.js +1 -1
- package/dist/ui/toast/schema.d.ts +63 -63
- package/dist/ui/toast/schema.d.ts.map +1 -1
- package/dist/ui/toast/schema.js +19 -4
- package/dist/ui/toast/update.d.ts +67 -67
- package/dist/ui/toast/update.d.ts.map +1 -1
- package/dist/ui/toast/update.js +2 -2
- package/dist/ui/tooltip/index.d.ts +15 -15
- package/dist/ui/tooltip/index.d.ts.map +1 -1
- package/dist/ui/tooltip/index.js +14 -4
- package/dist/ui/virtualList/index.d.ts +16 -16
- package/dist/ui/virtualList/index.d.ts.map +1 -1
- package/dist/ui/virtualList/index.js +46 -42
- package/dist/url/index.d.ts +8 -8
- package/dist/url/index.d.ts.map +1 -1
- package/dist/url/index.js +14 -14
- package/package.json +11 -7
package/dist/ui/toast/schema.js
CHANGED
|
@@ -7,10 +7,17 @@ import { Message as AnimationMessage, Model as AnimationModel, } from '../animat
|
|
|
7
7
|
* `data-variant` on each entry for per-variant CSS. This is the only
|
|
8
8
|
* content-adjacent field the component owns — the rest of the entry's
|
|
9
9
|
* content lives in the user-provided payload. */
|
|
10
|
-
export const Variant = S.
|
|
10
|
+
export const Variant = S.Literals(['Info', 'Success', 'Warning', 'Error']);
|
|
11
11
|
// POSITION
|
|
12
12
|
/** Where the toast viewport is anchored on the screen and how entries stack. */
|
|
13
|
-
export const Position = S.
|
|
13
|
+
export const Position = S.Literals([
|
|
14
|
+
'TopLeft',
|
|
15
|
+
'TopCenter',
|
|
16
|
+
'TopRight',
|
|
17
|
+
'BottomLeft',
|
|
18
|
+
'BottomCenter',
|
|
19
|
+
'BottomRight',
|
|
20
|
+
]);
|
|
14
21
|
// ENTRY
|
|
15
22
|
/** Schema factory for a single toast entry. `payloadSchema` is user-provided
|
|
16
23
|
* and defines the shape of per-entry content — whatever the consumer wants
|
|
@@ -22,7 +29,7 @@ export const makeEntry = (payloadSchema) => S.Struct({
|
|
|
22
29
|
id: S.String,
|
|
23
30
|
variant: Variant,
|
|
24
31
|
animation: AnimationModel,
|
|
25
|
-
maybeDuration: S.
|
|
32
|
+
maybeDuration: S.Option(S.DurationFromMillis),
|
|
26
33
|
pendingDismissVersion: S.Number,
|
|
27
34
|
isHovered: S.Boolean,
|
|
28
35
|
payload: payloadSchema,
|
|
@@ -67,5 +74,13 @@ export const GotAnimationMessage = m('GotAnimationMessage', {
|
|
|
67
74
|
* whose shape depends on the user-provided payload. */
|
|
68
75
|
export const makeAdded = (payloadSchema) => m('Added', { entry: makeEntry(payloadSchema) });
|
|
69
76
|
/** Factory for the union of all messages the toast component can produce. */
|
|
70
|
-
export const makeMessage = (payloadSchema) => S.Union(
|
|
77
|
+
export const makeMessage = (payloadSchema) => S.Union([
|
|
78
|
+
makeAdded(payloadSchema),
|
|
79
|
+
Dismissed,
|
|
80
|
+
DismissedAll,
|
|
81
|
+
ElapsedDuration,
|
|
82
|
+
HoveredEntry,
|
|
83
|
+
LeftEntry,
|
|
84
|
+
GotAnimationMessage,
|
|
85
|
+
]);
|
|
71
86
|
export const DEFAULT_DURATION = Duration.seconds(4);
|
|
@@ -7,7 +7,7 @@ import { type InitConfig, type Variant } from './schema.js';
|
|
|
7
7
|
export type ShowInput<A> = Readonly<{
|
|
8
8
|
payload: A;
|
|
9
9
|
variant?: Variant;
|
|
10
|
-
duration?: Duration.
|
|
10
|
+
duration?: Duration.Input;
|
|
11
11
|
sticky?: boolean;
|
|
12
12
|
}>;
|
|
13
13
|
/** Schedules an auto-dismiss timer for an entry. The result Message carries a
|
|
@@ -26,78 +26,78 @@ export declare const DismissAfter: Command.CommandDefinition<"DismissAfter", {
|
|
|
26
26
|
*
|
|
27
27
|
* @internal Consumers should use `Ui.Toast.make(PayloadSchema)`. This is
|
|
28
28
|
* only exported so `index.ts` can wire the view into the bound runtime. */
|
|
29
|
-
export declare const makeRuntime: <A, I>(payloadSchema: S.
|
|
29
|
+
export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
30
30
|
readonly Entry: S.Struct<{
|
|
31
|
-
id:
|
|
32
|
-
variant: S.
|
|
33
|
-
animation: S.Struct<{
|
|
34
|
-
id:
|
|
35
|
-
isShowing:
|
|
36
|
-
transitionState: S.
|
|
31
|
+
readonly id: S.String;
|
|
32
|
+
readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
33
|
+
readonly animation: S.Struct<{
|
|
34
|
+
readonly id: S.String;
|
|
35
|
+
readonly isShowing: S.Boolean;
|
|
36
|
+
readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
37
37
|
}>;
|
|
38
|
-
maybeDuration: S.
|
|
39
|
-
pendingDismissVersion:
|
|
40
|
-
isHovered:
|
|
41
|
-
payload: S.
|
|
38
|
+
readonly maybeDuration: S.Option<S.DurationFromMillis>;
|
|
39
|
+
readonly pendingDismissVersion: S.Number;
|
|
40
|
+
readonly isHovered: S.Boolean;
|
|
41
|
+
readonly payload: S.Codec<A, I, never, never>;
|
|
42
42
|
}>;
|
|
43
43
|
readonly Model: S.Struct<{
|
|
44
|
-
id:
|
|
45
|
-
defaultDuration:
|
|
46
|
-
entries: S
|
|
47
|
-
id:
|
|
48
|
-
variant: S.
|
|
49
|
-
animation: S.Struct<{
|
|
50
|
-
id:
|
|
51
|
-
isShowing:
|
|
52
|
-
transitionState: S.
|
|
44
|
+
readonly id: S.String;
|
|
45
|
+
readonly defaultDuration: S.DurationFromMillis;
|
|
46
|
+
readonly entries: S.$Array<S.Struct<{
|
|
47
|
+
readonly id: S.String;
|
|
48
|
+
readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
49
|
+
readonly animation: S.Struct<{
|
|
50
|
+
readonly id: S.String;
|
|
51
|
+
readonly isShowing: S.Boolean;
|
|
52
|
+
readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
53
53
|
}>;
|
|
54
|
-
maybeDuration: S.
|
|
55
|
-
pendingDismissVersion:
|
|
56
|
-
isHovered:
|
|
57
|
-
payload: S.
|
|
54
|
+
readonly maybeDuration: S.Option<S.DurationFromMillis>;
|
|
55
|
+
readonly pendingDismissVersion: S.Number;
|
|
56
|
+
readonly isHovered: S.Boolean;
|
|
57
|
+
readonly payload: S.Codec<A, I, never, never>;
|
|
58
58
|
}>>;
|
|
59
|
-
nextEntryKey:
|
|
59
|
+
readonly nextEntryKey: S.Number;
|
|
60
60
|
}>;
|
|
61
|
-
readonly Message: S.Union<[import("../../schema/index.js").CallableTaggedStruct<"Added", {
|
|
61
|
+
readonly Message: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"Added", {
|
|
62
62
|
entry: S.Struct<{
|
|
63
|
-
id:
|
|
64
|
-
variant: S.
|
|
65
|
-
animation: S.Struct<{
|
|
66
|
-
id:
|
|
67
|
-
isShowing:
|
|
68
|
-
transitionState: S.
|
|
63
|
+
readonly id: S.String;
|
|
64
|
+
readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
65
|
+
readonly animation: S.Struct<{
|
|
66
|
+
readonly id: S.String;
|
|
67
|
+
readonly isShowing: S.Boolean;
|
|
68
|
+
readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
69
69
|
}>;
|
|
70
|
-
maybeDuration: S.
|
|
71
|
-
pendingDismissVersion:
|
|
72
|
-
isHovered:
|
|
73
|
-
payload: S.
|
|
70
|
+
readonly maybeDuration: S.Option<S.DurationFromMillis>;
|
|
71
|
+
readonly pendingDismissVersion: S.Number;
|
|
72
|
+
readonly isHovered: S.Boolean;
|
|
73
|
+
readonly payload: S.Codec<A, I, never, never>;
|
|
74
74
|
}>;
|
|
75
75
|
}>, import("../../schema/index.js").CallableTaggedStruct<"Dismissed", {
|
|
76
|
-
entryId:
|
|
76
|
+
entryId: S.String;
|
|
77
77
|
}>, import("../../schema/index.js").CallableTaggedStruct<"DismissedAll", {}>, import("../../schema/index.js").CallableTaggedStruct<"ElapsedDuration", {
|
|
78
|
-
entryId:
|
|
79
|
-
version:
|
|
78
|
+
entryId: S.String;
|
|
79
|
+
version: S.Number;
|
|
80
80
|
}>, import("../../schema/index.js").CallableTaggedStruct<"HoveredEntry", {
|
|
81
|
-
entryId:
|
|
81
|
+
entryId: S.String;
|
|
82
82
|
}>, import("../../schema/index.js").CallableTaggedStruct<"LeftEntry", {
|
|
83
|
-
entryId:
|
|
83
|
+
entryId: S.String;
|
|
84
84
|
}>, import("../../schema/index.js").CallableTaggedStruct<"GotAnimationMessage", {
|
|
85
|
-
entryId:
|
|
85
|
+
entryId: S.String;
|
|
86
86
|
message: S.Union<[import("../../schema/index.js").CallableTaggedStruct<"Showed", {}>, import("../../schema/index.js").CallableTaggedStruct<"Hid", {}>, import("../../schema/index.js").CallableTaggedStruct<"AdvancedAnimationFrame", {}>, import("../../schema/index.js").CallableTaggedStruct<"EndedAnimation", {}>]>;
|
|
87
87
|
}>]>;
|
|
88
88
|
readonly Added: import("../../schema/index.js").CallableTaggedStruct<"Added", {
|
|
89
89
|
entry: S.Struct<{
|
|
90
|
-
id:
|
|
91
|
-
variant: S.
|
|
92
|
-
animation: S.Struct<{
|
|
93
|
-
id:
|
|
94
|
-
isShowing:
|
|
95
|
-
transitionState: S.
|
|
90
|
+
readonly id: S.String;
|
|
91
|
+
readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
92
|
+
readonly animation: S.Struct<{
|
|
93
|
+
readonly id: S.String;
|
|
94
|
+
readonly isShowing: S.Boolean;
|
|
95
|
+
readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
96
96
|
}>;
|
|
97
|
-
maybeDuration: S.
|
|
98
|
-
pendingDismissVersion:
|
|
99
|
-
isHovered:
|
|
100
|
-
payload: S.
|
|
97
|
+
readonly maybeDuration: S.Option<S.DurationFromMillis>;
|
|
98
|
+
readonly pendingDismissVersion: S.Number;
|
|
99
|
+
readonly isHovered: S.Boolean;
|
|
100
|
+
readonly payload: S.Codec<A, I, never, never>;
|
|
101
101
|
}>;
|
|
102
102
|
}>;
|
|
103
103
|
readonly init: (config: InitConfig) => {
|
|
@@ -108,8 +108,8 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Schema<A, I>) => {
|
|
|
108
108
|
readonly isShowing: boolean;
|
|
109
109
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
110
110
|
};
|
|
111
|
-
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
112
111
|
readonly maybeDuration: Option.Option<Duration.Duration>;
|
|
112
|
+
readonly variant: "Success" | "Error" | "Info" | "Warning";
|
|
113
113
|
readonly pendingDismissVersion: number;
|
|
114
114
|
readonly isHovered: boolean;
|
|
115
115
|
readonly payload: A;
|
|
@@ -126,8 +126,8 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Schema<A, I>) => {
|
|
|
126
126
|
readonly isShowing: boolean;
|
|
127
127
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
128
128
|
};
|
|
129
|
-
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
130
129
|
readonly maybeDuration: Option.Option<Duration.Duration>;
|
|
130
|
+
readonly variant: "Success" | "Error" | "Info" | "Warning";
|
|
131
131
|
readonly pendingDismissVersion: number;
|
|
132
132
|
readonly isHovered: boolean;
|
|
133
133
|
readonly payload: A;
|
|
@@ -171,8 +171,8 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Schema<A, I>) => {
|
|
|
171
171
|
readonly isShowing: boolean;
|
|
172
172
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
173
173
|
};
|
|
174
|
-
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
175
174
|
readonly maybeDuration: Option.Option<Duration.Duration>;
|
|
175
|
+
readonly variant: "Success" | "Error" | "Info" | "Warning";
|
|
176
176
|
readonly pendingDismissVersion: number;
|
|
177
177
|
readonly isHovered: boolean;
|
|
178
178
|
readonly payload: A;
|
|
@@ -185,8 +185,8 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Schema<A, I>) => {
|
|
|
185
185
|
readonly isShowing: boolean;
|
|
186
186
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
187
187
|
};
|
|
188
|
-
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
189
188
|
readonly maybeDuration: Option.Option<Duration.Duration>;
|
|
189
|
+
readonly variant: "Success" | "Error" | "Info" | "Warning";
|
|
190
190
|
readonly pendingDismissVersion: number;
|
|
191
191
|
readonly isHovered: boolean;
|
|
192
192
|
readonly payload: A;
|
|
@@ -232,8 +232,8 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Schema<A, I>) => {
|
|
|
232
232
|
readonly isShowing: boolean;
|
|
233
233
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
234
234
|
};
|
|
235
|
-
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
236
235
|
readonly maybeDuration: Option.Option<Duration.Duration>;
|
|
236
|
+
readonly variant: "Success" | "Error" | "Info" | "Warning";
|
|
237
237
|
readonly pendingDismissVersion: number;
|
|
238
238
|
readonly isHovered: boolean;
|
|
239
239
|
readonly payload: A;
|
|
@@ -248,8 +248,8 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Schema<A, I>) => {
|
|
|
248
248
|
readonly isShowing: boolean;
|
|
249
249
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
250
250
|
};
|
|
251
|
-
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
252
251
|
readonly maybeDuration: Option.Option<Duration.Duration>;
|
|
252
|
+
readonly variant: "Success" | "Error" | "Info" | "Warning";
|
|
253
253
|
readonly pendingDismissVersion: number;
|
|
254
254
|
readonly isHovered: boolean;
|
|
255
255
|
readonly payload: A;
|
|
@@ -265,8 +265,8 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Schema<A, I>) => {
|
|
|
265
265
|
readonly isShowing: boolean;
|
|
266
266
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
267
267
|
};
|
|
268
|
-
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
269
268
|
readonly maybeDuration: Option.Option<Duration.Duration>;
|
|
269
|
+
readonly variant: "Success" | "Error" | "Info" | "Warning";
|
|
270
270
|
readonly pendingDismissVersion: number;
|
|
271
271
|
readonly isHovered: boolean;
|
|
272
272
|
readonly payload: A;
|
|
@@ -312,8 +312,8 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Schema<A, I>) => {
|
|
|
312
312
|
readonly isShowing: boolean;
|
|
313
313
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
314
314
|
};
|
|
315
|
-
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
316
315
|
readonly maybeDuration: Option.Option<Duration.Duration>;
|
|
316
|
+
readonly variant: "Success" | "Error" | "Info" | "Warning";
|
|
317
317
|
readonly pendingDismissVersion: number;
|
|
318
318
|
readonly isHovered: boolean;
|
|
319
319
|
readonly payload: A;
|
|
@@ -328,8 +328,8 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Schema<A, I>) => {
|
|
|
328
328
|
readonly isShowing: boolean;
|
|
329
329
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
330
330
|
};
|
|
331
|
-
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
332
331
|
readonly maybeDuration: Option.Option<Duration.Duration>;
|
|
332
|
+
readonly variant: "Success" | "Error" | "Info" | "Warning";
|
|
333
333
|
readonly pendingDismissVersion: number;
|
|
334
334
|
readonly isHovered: boolean;
|
|
335
335
|
readonly payload: A;
|
|
@@ -345,8 +345,8 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Schema<A, I>) => {
|
|
|
345
345
|
readonly isShowing: boolean;
|
|
346
346
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
347
347
|
};
|
|
348
|
-
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
349
348
|
readonly maybeDuration: Option.Option<Duration.Duration>;
|
|
349
|
+
readonly variant: "Success" | "Error" | "Info" | "Warning";
|
|
350
350
|
readonly pendingDismissVersion: number;
|
|
351
351
|
readonly isHovered: boolean;
|
|
352
352
|
readonly payload: A;
|
|
@@ -392,8 +392,8 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Schema<A, I>) => {
|
|
|
392
392
|
readonly isShowing: boolean;
|
|
393
393
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
394
394
|
};
|
|
395
|
-
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
396
395
|
readonly maybeDuration: Option.Option<Duration.Duration>;
|
|
396
|
+
readonly variant: "Success" | "Error" | "Info" | "Warning";
|
|
397
397
|
readonly pendingDismissVersion: number;
|
|
398
398
|
readonly isHovered: boolean;
|
|
399
399
|
readonly payload: A;
|
|
@@ -408,8 +408,8 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Schema<A, I>) => {
|
|
|
408
408
|
readonly isShowing: boolean;
|
|
409
409
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
410
410
|
};
|
|
411
|
-
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
412
411
|
readonly maybeDuration: Option.Option<Duration.Duration>;
|
|
412
|
+
readonly variant: "Success" | "Error" | "Info" | "Warning";
|
|
413
413
|
readonly pendingDismissVersion: number;
|
|
414
414
|
readonly isHovered: boolean;
|
|
415
415
|
readonly payload: A;
|
|
@@ -425,8 +425,8 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Schema<A, I>) => {
|
|
|
425
425
|
readonly isShowing: boolean;
|
|
426
426
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
427
427
|
};
|
|
428
|
-
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
429
428
|
readonly maybeDuration: Option.Option<Duration.Duration>;
|
|
429
|
+
readonly variant: "Success" | "Error" | "Info" | "Warning";
|
|
430
430
|
readonly pendingDismissVersion: number;
|
|
431
431
|
readonly isHovered: boolean;
|
|
432
432
|
readonly payload: A;
|
|
@@ -472,8 +472,8 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Schema<A, I>) => {
|
|
|
472
472
|
readonly isShowing: boolean;
|
|
473
473
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
474
474
|
};
|
|
475
|
-
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
476
475
|
readonly maybeDuration: Option.Option<Duration.Duration>;
|
|
476
|
+
readonly variant: "Success" | "Error" | "Info" | "Warning";
|
|
477
477
|
readonly pendingDismissVersion: number;
|
|
478
478
|
readonly isHovered: boolean;
|
|
479
479
|
readonly payload: A;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/ui/toast/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,MAAM,EAGN,MAAM,EACN,MAAM,IAAI,CAAC,EACZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAejD,OAAO,EAML,KAAK,UAAU,EACf,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,
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/ui/toast/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,MAAM,EAGN,MAAM,EACN,MAAM,IAAI,CAAC,EACZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAejD,OAAO,EAML,KAAK,UAAU,EACf,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,YAAY;;;;EAAkD,CAAA;AAI3E;;;;;;4EAM4E;AAC5E,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BA0ItC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmIG,SAAS,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAIP,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkB/C,CAAA"}
|
package/dist/ui/toast/update.js
CHANGED
|
@@ -86,7 +86,7 @@ export const makeRuntime = (payloadSchema) => {
|
|
|
86
86
|
const entryId = `${model.id}-entry-${model.nextEntryKey}`;
|
|
87
87
|
const duration = input.duration === undefined
|
|
88
88
|
? model.defaultDuration
|
|
89
|
-
: Duration.
|
|
89
|
+
: Duration.fromInputUnsafe(input.duration);
|
|
90
90
|
const maybeDuration = OptionExt.when(!input.sticky, duration);
|
|
91
91
|
return {
|
|
92
92
|
id: entryId,
|
|
@@ -103,7 +103,7 @@ export const makeRuntime = (payloadSchema) => {
|
|
|
103
103
|
id: config.id,
|
|
104
104
|
defaultDuration: config.defaultDuration === undefined
|
|
105
105
|
? DEFAULT_DURATION
|
|
106
|
-
: Duration.
|
|
106
|
+
: Duration.fromInputUnsafe(config.defaultDuration),
|
|
107
107
|
entries: [],
|
|
108
108
|
nextEntryKey: 0,
|
|
109
109
|
});
|
|
@@ -4,14 +4,14 @@ import { type Attribute, type Html } from '../../html/index.js';
|
|
|
4
4
|
import type { AnchorConfig } from '../anchor.js';
|
|
5
5
|
/** Schema for the tooltip component's state. `isOpen` is visibility; `isHovered` tracks pointer on trigger; `isFocused` tracks tooltip-affirming focus on the trigger (focus arriving without a preceding mouse press — keyboard, touch, or pen; mouse-click-induced focus is excluded since it doesn't affirm the user wants the tooltip visible); `isDismissed` suppresses re-opening after the user dismissed the tooltip (via Escape or left-click) until they disengage (leave or blur). `showDelay` is the hover-to-show duration. `maybeLastPointerType` records the most recent pointer type that pressed the trigger, so a mouse-click-induced focus can be distinguished from other focus. */
|
|
6
6
|
export declare const Model: S.Struct<{
|
|
7
|
-
id:
|
|
8
|
-
isOpen:
|
|
9
|
-
isHovered:
|
|
10
|
-
isFocused:
|
|
11
|
-
isDismissed:
|
|
12
|
-
showDelay:
|
|
13
|
-
pendingShowVersion:
|
|
14
|
-
maybeLastPointerType: S.
|
|
7
|
+
readonly id: S.String;
|
|
8
|
+
readonly isOpen: S.Boolean;
|
|
9
|
+
readonly isHovered: S.Boolean;
|
|
10
|
+
readonly isFocused: S.Boolean;
|
|
11
|
+
readonly isDismissed: S.Boolean;
|
|
12
|
+
readonly showDelay: S.DurationFromMillis;
|
|
13
|
+
readonly pendingShowVersion: S.Number;
|
|
14
|
+
readonly maybeLastPointerType: S.Option<S.String>;
|
|
15
15
|
}>;
|
|
16
16
|
export type Model = typeof Model.Type;
|
|
17
17
|
/** Sent when the pointer enters the tooltip trigger. Starts the show-delay timer. */
|
|
@@ -26,16 +26,16 @@ export declare const BlurredTrigger: import("../../schema/index.js").CallableTag
|
|
|
26
26
|
export declare const PressedEscape: import("../../schema/index.js").CallableTaggedStruct<"PressedEscape", {}>;
|
|
27
27
|
/** Sent when a pointer presses the trigger. Records the pointer type so a following focus event from the same mouse click can be suppressed, and a left-click on an open tooltip dismisses it (the user is clicking the button for its action, not to keep the tooltip visible). */
|
|
28
28
|
export declare const PressedPointerOnTrigger: import("../../schema/index.js").CallableTaggedStruct<"PressedPointerOnTrigger", {
|
|
29
|
-
pointerType:
|
|
30
|
-
button:
|
|
29
|
+
pointerType: S.String;
|
|
30
|
+
button: S.Number;
|
|
31
31
|
}>;
|
|
32
32
|
/** Sent when the show-delay timer fires. Carries a generation number that is compared against the current pending version to discard stale timers. */
|
|
33
33
|
export declare const ElapsedShowDelay: import("../../schema/index.js").CallableTaggedStruct<"ElapsedShowDelay", {
|
|
34
|
-
version:
|
|
34
|
+
version: S.Number;
|
|
35
35
|
}>;
|
|
36
36
|
/** Signals that the show-delay has changed (e.g. in response to a user preference, input-method change, or reduced-motion setting). Does not affect the current open/closed state; the new delay applies to the next hover. Typically dispatched via the `setShowDelay` helper. */
|
|
37
37
|
export declare const ChangedShowDelay: import("../../schema/index.js").CallableTaggedStruct<"ChangedShowDelay", {
|
|
38
|
-
showDelay:
|
|
38
|
+
showDelay: S.DurationFromMillis;
|
|
39
39
|
}>;
|
|
40
40
|
/** Sent when the tooltip panel mounts and Floating UI has positioned it. Update no-ops; the side effect is the act of positioning, surfaced for DevTools observability. */
|
|
41
41
|
export declare const CompletedAnchorMount: import("../../schema/index.js").CallableTaggedStruct<"CompletedAnchorMount", {}>;
|
|
@@ -58,10 +58,10 @@ export type BlurredTrigger = typeof BlurredTrigger.Type;
|
|
|
58
58
|
export type PressedEscape = typeof PressedEscape.Type;
|
|
59
59
|
export type PressedPointerOnTrigger = typeof PressedPointerOnTrigger.Type;
|
|
60
60
|
export type Message = typeof Message.Type;
|
|
61
|
-
/** Configuration for creating a tooltip model with `init`. `showDelay` controls how long the pointer must hover before the tooltip appears (default 500ms). Accepts any `Duration.
|
|
61
|
+
/** Configuration for creating a tooltip model with `init`. `showDelay` controls how long the pointer must hover before the tooltip appears (default 500ms). Accepts any `Duration.Input` — a bare number is interpreted as milliseconds. Keyboard focus shows the tooltip immediately regardless of this value. */
|
|
62
62
|
export type InitConfig = Readonly<{
|
|
63
63
|
id: string;
|
|
64
|
-
showDelay?: Duration.
|
|
64
|
+
showDelay?: Duration.Input;
|
|
65
65
|
}>;
|
|
66
66
|
/** Creates an initial tooltip model from a config. Defaults to hidden. */
|
|
67
67
|
export declare const init: (config: InitConfig) => Model;
|
|
@@ -74,7 +74,7 @@ export declare const ShowAfterDelay: Command.CommandDefinition<"ShowAfterDelay",
|
|
|
74
74
|
/** Processes a tooltip message and returns the next model and commands. */
|
|
75
75
|
export declare const update: (model: Model, message: Message) => UpdateReturn;
|
|
76
76
|
/** Programmatically updates the tooltip's hover show-delay. Use this in response to user preference changes, input-method switches, or reduced-motion settings. The new delay applies to the next hover; any pending timer is unaffected (its stale version will discard harmlessly when it fires). */
|
|
77
|
-
export declare const setShowDelay: (model: Model, showDelay: Duration.
|
|
77
|
+
export declare const setShowDelay: (model: Model, showDelay: Duration.Input) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
78
78
|
/** Configuration for rendering a tooltip with `view`. */
|
|
79
79
|
export type ViewConfig<Message> = Readonly<{
|
|
80
80
|
model: Model;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMR,MAAM,IAAI,CAAC,EACZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAEjD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EAIV,MAAM,qBAAqB,CAAA;AAM5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAIhD,wqBAAwqB;AACxqB,eAAO,MAAM,KAAK;;;;;;;;;EAShB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,qFAAqF;AACrF,eAAO,MAAM,cAAc,4EAAsB,CAAA;AACjD,qIAAqI;AACrI,eAAO,MAAM,WAAW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AA;AAEF,8SAA8S;AAC9S,eAAO,MAAM,IAAI,GAAI,OAAO,EAAE,QAAQ,UAAU,CAAC,OAAO,CAAC,KAAG,IAsH3D,CAAA;AAED;mFACmF;AACnF,eAAO,MAAM,IAAI,GAAI,OAAO,EAC1B,cAAc,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC,KACnE,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,KACpD,IAAI,CAgBR,CAAA"}
|
package/dist/ui/tooltip/index.js
CHANGED
|
@@ -17,7 +17,7 @@ export const Model = S.Struct({
|
|
|
17
17
|
isDismissed: S.Boolean,
|
|
18
18
|
showDelay: S.DurationFromMillis,
|
|
19
19
|
pendingShowVersion: S.Number,
|
|
20
|
-
maybeLastPointerType: S.
|
|
20
|
+
maybeLastPointerType: S.Option(S.String),
|
|
21
21
|
});
|
|
22
22
|
// MESSAGE
|
|
23
23
|
/** Sent when the pointer enters the tooltip trigger. Starts the show-delay timer. */
|
|
@@ -46,7 +46,17 @@ export const ChangedShowDelay = m('ChangedShowDelay', {
|
|
|
46
46
|
/** Sent when the tooltip panel mounts and Floating UI has positioned it. Update no-ops; the side effect is the act of positioning, surfaced for DevTools observability. */
|
|
47
47
|
export const CompletedAnchorMount = m('CompletedAnchorMount');
|
|
48
48
|
/** Union of all messages the tooltip component can produce. */
|
|
49
|
-
export const Message = S.Union(
|
|
49
|
+
export const Message = S.Union([
|
|
50
|
+
EnteredTrigger,
|
|
51
|
+
LeftTrigger,
|
|
52
|
+
FocusedTrigger,
|
|
53
|
+
BlurredTrigger,
|
|
54
|
+
PressedEscape,
|
|
55
|
+
PressedPointerOnTrigger,
|
|
56
|
+
ElapsedShowDelay,
|
|
57
|
+
ChangedShowDelay,
|
|
58
|
+
CompletedAnchorMount,
|
|
59
|
+
]);
|
|
50
60
|
// INIT
|
|
51
61
|
const DEFAULT_SHOW_DELAY = Duration.millis(500);
|
|
52
62
|
const LEFT_MOUSE_BUTTON = 0;
|
|
@@ -59,7 +69,7 @@ export const init = (config) => ({
|
|
|
59
69
|
isDismissed: false,
|
|
60
70
|
showDelay: config.showDelay === undefined
|
|
61
71
|
? DEFAULT_SHOW_DELAY
|
|
62
|
-
: Duration.
|
|
72
|
+
: Duration.fromInputUnsafe(config.showDelay),
|
|
63
73
|
pendingShowVersion: 0,
|
|
64
74
|
maybeLastPointerType: Option.none(),
|
|
65
75
|
});
|
|
@@ -176,7 +186,7 @@ export const update = (model, message) => M.value(message).pipe(withUpdateReturn
|
|
|
176
186
|
CompletedAnchorMount: () => [model, []],
|
|
177
187
|
}));
|
|
178
188
|
/** Programmatically updates the tooltip's hover show-delay. Use this in response to user preference changes, input-method switches, or reduced-motion settings. The new delay applies to the next hover; any pending timer is unaffected (its stale version will discard harmlessly when it fires). */
|
|
179
|
-
export const setShowDelay = (model, showDelay) => update(model, ChangedShowDelay({ showDelay: Duration.
|
|
189
|
+
export const setShowDelay = (model, showDelay) => update(model, ChangedShowDelay({ showDelay: Duration.fromInputUnsafe(showDelay) }));
|
|
180
190
|
/** Renders a headless tooltip with an anchored non-interactive panel. Shows on hover (after delay) or focus (from keyboard, touch, or pen; mouse-click focus is excluded); hides on leave, blur, Escape, or left-click of the trigger. Uses `role="tooltip"` and links the trigger via `aria-describedby`. */
|
|
181
191
|
export const view = (config) => {
|
|
182
192
|
const { div, AriaDescribedBy, AriaDisabled, Class, DataAttribute, Id, OnBlur, OnFocus, OnKeyDownPreventDefault, OnMount, OnMouseEnter, OnMouseLeave, OnPointerDown, Role, Style, Type, keyed, } = html();
|
|
@@ -4,33 +4,33 @@ import { type Attribute, type Html, type TagName } from '../../html/index.js';
|
|
|
4
4
|
/** Schema for the virtual list's state. Tracks scroll position, container
|
|
5
5
|
* measurement, and any in-flight programmatic scroll. */
|
|
6
6
|
export declare const Model: S.Struct<{
|
|
7
|
-
id:
|
|
8
|
-
rowHeightPx:
|
|
9
|
-
scrollTop:
|
|
10
|
-
measurement: S.Union<[import("../../schema/index.js").CallableTaggedStruct<"Unmeasured", {}>, import("../../schema/index.js").CallableTaggedStruct<"Measured", {
|
|
11
|
-
containerHeight:
|
|
7
|
+
readonly id: S.String;
|
|
8
|
+
readonly rowHeightPx: S.Number;
|
|
9
|
+
readonly scrollTop: S.Number;
|
|
10
|
+
readonly measurement: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"Unmeasured", {}>, import("../../schema/index.js").CallableTaggedStruct<"Measured", {
|
|
11
|
+
containerHeight: S.Number;
|
|
12
12
|
}>]>;
|
|
13
|
-
pendingScroll: S.Union<[import("../../schema/index.js").CallableTaggedStruct<"Idle", {}>, import("../../schema/index.js").CallableTaggedStruct<"ScrollingToIndex", {
|
|
14
|
-
index:
|
|
15
|
-
version:
|
|
13
|
+
readonly pendingScroll: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"Idle", {}>, import("../../schema/index.js").CallableTaggedStruct<"ScrollingToIndex", {
|
|
14
|
+
index: S.Number;
|
|
15
|
+
version: S.Number;
|
|
16
16
|
}>]>;
|
|
17
|
-
pendingScrollVersion:
|
|
17
|
+
readonly pendingScrollVersion: S.Number;
|
|
18
18
|
}>;
|
|
19
19
|
export type Model = typeof Model.Type;
|
|
20
20
|
/** Sent when the user scrolls the container. Carries the new scroll position
|
|
21
21
|
* read from the scroll event. */
|
|
22
22
|
export declare const ScrolledContainer: import("../../schema/index.js").CallableTaggedStruct<"ScrolledContainer", {
|
|
23
|
-
scrollTop:
|
|
23
|
+
scrollTop: S.Number;
|
|
24
24
|
}>;
|
|
25
25
|
/** Sent when the container resizes. Carries the new container height read
|
|
26
26
|
* from the `ResizeObserver` entry. */
|
|
27
27
|
export declare const MeasuredContainer: import("../../schema/index.js").CallableTaggedStruct<"MeasuredContainer", {
|
|
28
|
-
containerHeight:
|
|
28
|
+
containerHeight: S.Number;
|
|
29
29
|
}>;
|
|
30
30
|
/** Sent when a `scrollToIndex` Command completes. Carries the version it was
|
|
31
31
|
* issued with so the update can ignore stale completions. */
|
|
32
32
|
export declare const CompletedApplyScroll: import("../../schema/index.js").CallableTaggedStruct<"CompletedApplyScroll", {
|
|
33
|
-
version:
|
|
33
|
+
version: S.Number;
|
|
34
34
|
}>;
|
|
35
35
|
/** Union of all messages the virtual list component can produce. */
|
|
36
36
|
export declare const Message: S.Union<[
|
|
@@ -122,8 +122,8 @@ export declare const visibleWindowVariable: <Item>(model: Model, items: Readonly
|
|
|
122
122
|
/** Schema describing the subscription dependencies for container scroll and
|
|
123
123
|
* resize tracking. */
|
|
124
124
|
export declare const SubscriptionDeps: S.Struct<{
|
|
125
|
-
containerEvents: S.Struct<{
|
|
126
|
-
id:
|
|
125
|
+
readonly containerEvents: S.Struct<{
|
|
126
|
+
readonly id: S.String;
|
|
127
127
|
}>;
|
|
128
128
|
}>;
|
|
129
129
|
/** Subscriptions that track the container's scroll position and size.
|
|
@@ -167,8 +167,8 @@ export declare const subscriptions: import("../../runtime/subscription.js").Subs
|
|
|
167
167
|
readonly _tag: "CompletedApplyScroll";
|
|
168
168
|
readonly version: number;
|
|
169
169
|
}, S.Struct<{
|
|
170
|
-
containerEvents: S.Struct<{
|
|
171
|
-
id:
|
|
170
|
+
readonly containerEvents: S.Struct<{
|
|
171
|
+
readonly id: S.String;
|
|
172
172
|
}>;
|
|
173
173
|
}>, never>;
|
|
174
174
|
/** Configuration for rendering a virtual list with `view`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/virtualList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/virtualList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,MAAM,EAEN,MAAM,IAAI,CAAC,EAGZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,wBAAw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