hys-ui 0.5.0 → 0.6.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
  3. package/dist/components/HysDrawer/HysDrawer2.vue.js +2 -2
  4. package/dist/components/HysModal/HysModal.vue.js +2 -2
  5. package/dist/components/HysModal/HysModal2.vue.js +38 -38
  6. package/dist/components/HysSearch/HysSearch.vue.js +2 -2
  7. package/dist/components/HysSortableList/HysSortableList.vue.js +2 -2
  8. package/dist/components/HysSortableList/HysSortableList2.vue.js +498 -129
  9. package/dist/components/HysSortableList/SortableGhost/SortableGhost.vue.js +7 -0
  10. package/dist/components/HysSortableList/SortableGhost/SortableGhost2.vue.js +43 -0
  11. package/dist/components/HysSortableList/SortableGhost/useSortGhost.js +54 -0
  12. package/dist/components/HysSortableList/geometry.js +230 -0
  13. package/dist/components/HysSortableList/model.js +254 -0
  14. package/dist/components/HysSortableList/transactions.js +281 -0
  15. package/dist/components/HysSortableList/useSortDrag.js +270 -0
  16. package/dist/components/HysSortableList/useSortKeyboard.js +72 -0
  17. package/dist/components/HysSortableList/useSortWindow.js +144 -0
  18. package/dist/components/HysToast/HysToast.vue.js +3 -3
  19. package/dist/components/HysToast/HysToast2.vue.js +379 -107
  20. package/dist/components/HysToast/ToastViewport/ToastViewport.vue.js +7 -0
  21. package/dist/components/HysToast/ToastViewport/ToastViewport2.vue.js +211 -0
  22. package/dist/components/HysToast/ToastViewport/useToastStackDisclosure.js +71 -0
  23. package/dist/components/HysToast/toastPresentation.js +98 -0
  24. package/dist/components/HysToast/useToastActions.js +62 -0
  25. package/dist/components/HysToast/useToastSwipe.js +48 -0
  26. package/dist/components/HysToast/useToastTimer.js +90 -0
  27. package/dist/composables/popupReferenceBinding.js +41 -0
  28. package/dist/composables/toastEscape.js +18 -10
  29. package/dist/composables/toastQueue.js +276 -0
  30. package/dist/composables/toastQueueModel.js +86 -0
  31. package/dist/composables/toastTasks.js +58 -0
  32. package/dist/composables/useHysToast.js +117 -135
  33. package/dist/composables/usePopupSurface.js +190 -356
  34. package/dist/composables/usePopupSurfaceInteractions.js +172 -0
  35. package/dist/index.js +59 -57
  36. package/dist/style.css +1 -1
  37. package/dist/types/components/HysGantt/HysGantt.vue.d.ts +1 -1
  38. package/dist/types/components/HysModal/HysModal.vue.d.ts +1 -1
  39. package/dist/types/components/HysSortableList/HysSortableList.vue.d.ts +48 -25
  40. package/dist/types/components/HysSortableList/SortableGhost/SortableGhost.vue.d.ts +31 -0
  41. package/dist/types/components/HysSortableList/SortableGhost/useSortGhost.d.ts +23 -0
  42. package/dist/types/components/HysSortableList/geometry.d.ts +35 -0
  43. package/dist/types/components/HysSortableList/model.d.ts +61 -0
  44. package/dist/types/components/HysSortableList/sortableList.d.ts +151 -0
  45. package/dist/types/components/HysSortableList/transactions.d.ts +10 -0
  46. package/dist/types/components/HysSortableList/useSortDrag.d.ts +25 -0
  47. package/dist/types/components/HysSortableList/useSortKeyboard.d.ts +17 -0
  48. package/dist/types/components/HysSortableList/useSortWindow.d.ts +16 -0
  49. package/dist/types/components/HysToast/HysToast.vue.d.ts +44 -46
  50. package/dist/types/components/HysToast/ToastViewport/ToastViewport.vue.d.ts +25 -0
  51. package/dist/types/components/HysToast/ToastViewport/useToastStackDisclosure.d.ts +16 -0
  52. package/dist/types/components/HysToast/toastPresentation.d.ts +8 -0
  53. package/dist/types/components/HysToast/toastTypes.d.ts +212 -0
  54. package/dist/types/components/HysToast/useToastActions.d.ts +18 -0
  55. package/dist/types/components/HysToast/useToastSwipe.d.ts +11 -0
  56. package/dist/types/components/HysToast/useToastTimer.d.ts +22 -0
  57. package/dist/types/composables/popupReferenceBinding.d.ts +9 -0
  58. package/dist/types/composables/toastEscape.d.ts +1 -1
  59. package/dist/types/composables/toastQueue.d.ts +121 -0
  60. package/dist/types/composables/toastQueueModel.d.ts +116 -0
  61. package/dist/types/composables/toastTasks.d.ts +2 -0
  62. package/dist/types/composables/useHysToast.d.ts +4 -48
  63. package/dist/types/composables/usePopupSurface.d.ts +20 -20
  64. package/dist/types/composables/usePopupSurfaceInteractions.d.ts +33 -0
  65. package/dist/types/index.d.ts +3 -4
  66. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ import type { CSSProperties } from "vue";
2
+ import type { HysToastLocale, HysToastPosition, HysToastPresentation } from "./toastTypes";
3
+ export declare const toastLocale: HysToastLocale;
4
+ export declare function normalizeToastPosition(position?: HysToastPosition): "center" | "top-right" | "top-left" | "bottom-right" | "bottom-left" | "top-center" | "bottom-center" | "custom";
5
+ export declare const finite: (value: number | undefined, fallback: number) => number;
6
+ export declare const toastDuration: (options: HysToastPresentation) => number;
7
+ export declare function toastPlacement(options: HysToastPresentation): CSSProperties;
8
+ export declare function toastMotion(options: HysToastPresentation): CSSProperties;
@@ -0,0 +1,212 @@
1
+ import type { CSSProperties, VNodeChild } from "vue";
2
+ import type { HysConfig, HysTheme } from "../../config";
3
+ export type HysToastType = "success" | "error" | "warning" | "info" | "loading" | "default" | "custom";
4
+ export type HysToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | "center" | "custom" | "top" | "bottom";
5
+ export type HysToastCloseReason = "timeout" | "button" | "click" | "escape" | "keyboard" | "swipe" | "action" | "api" | "model" | "overflow" | "dispose";
6
+ export type HysToastStatus = "queued" | "visible" | "closing" | "closed";
7
+ export type HysToastAnimation = "fade" | "slide" | "scale" | "spring" | "bounce" | "rotate" | "none";
8
+ export type HysToastDirection = "top" | "bottom" | "left" | "right";
9
+ export type HysToastProgress = number | "indeterminate";
10
+ export type HysToastCoordinates = Pick<CSSProperties, "top" | "right" | "bottom" | "left" | "translate">;
11
+ export interface HysToastMotionPreset {
12
+ enterFrom: string;
13
+ leaveTo?: string;
14
+ opacity?: number;
15
+ }
16
+ export interface HysToastLocale {
17
+ close: string;
18
+ copy: string;
19
+ copied: string;
20
+ copyFailed: string;
21
+ expand: string;
22
+ collapse: string;
23
+ collapseStack: string;
24
+ pinStack: string;
25
+ remaining: (seconds: number) => string;
26
+ repeat: (count: number) => string;
27
+ more: (count: number) => string;
28
+ actionFailed: string;
29
+ progress: string;
30
+ }
31
+ export interface HysToastPresentation {
32
+ message?: string;
33
+ title?: string;
34
+ type?: HysToastType;
35
+ duration?: number;
36
+ persistent?: boolean;
37
+ closable?: boolean;
38
+ closeOnClick?: boolean;
39
+ closeOnEscape?: boolean;
40
+ keyboardDismiss?: boolean;
41
+ pauseOnHover?: boolean;
42
+ pauseOnBlur?: boolean;
43
+ swipe?: boolean;
44
+ interactive?: boolean;
45
+ position?: HysToastPosition;
46
+ offset?: number;
47
+ offsetX?: number;
48
+ offsetY?: number;
49
+ coordinates?: HysToastCoordinates;
50
+ zIndex?: number;
51
+ width?: string | number;
52
+ showIcon?: boolean;
53
+ plain?: boolean;
54
+ glass?: boolean;
55
+ theme?: HysTheme;
56
+ toastStyle?: CSSProperties;
57
+ progressStyle?: CSSProperties;
58
+ progress?: HysToastProgress;
59
+ showProgress?: boolean;
60
+ countdown?: boolean;
61
+ maxLines?: number;
62
+ copyable?: boolean;
63
+ copyText?: string;
64
+ actionLayout?: "inline" | "footer";
65
+ actions?: readonly HysToastAction[];
66
+ animation?: HysToastAnimation | HysToastMotionPreset;
67
+ direction?: HysToastDirection;
68
+ animationDuration?: number;
69
+ easing?: string | ((progress: number) => number);
70
+ live?: "polite" | "assertive" | "off";
71
+ locale?: Partial<HysToastLocale>;
72
+ beforeClose?: (context: HysToastCloseContext) => boolean | void | Promise<boolean | void>;
73
+ }
74
+ export interface HysToastProps extends HysToastPresentation {
75
+ open?: boolean;
76
+ teleport?: boolean;
77
+ appendTo?: string | HTMLElement | ShadowRoot;
78
+ repeat?: number;
79
+ paused?: boolean;
80
+ }
81
+ export interface HysToastContext {
82
+ id?: string;
83
+ message: string;
84
+ title?: string;
85
+ type: HysToastType;
86
+ }
87
+ export interface HysToastCloseContext extends HysToastContext {
88
+ reason: HysToastCloseReason;
89
+ event?: Event;
90
+ }
91
+ export interface HysToastActionContext extends HysToastContext {
92
+ close: () => Promise<boolean>;
93
+ update: (patch: HysToastPatch) => void;
94
+ copy: () => Promise<boolean>;
95
+ }
96
+ export interface HysToastAction {
97
+ id: string;
98
+ label: string;
99
+ disabled?: boolean;
100
+ closeOnSuccess?: boolean;
101
+ run?: (context: HysToastActionContext) => unknown;
102
+ success?: HysToastFeedback<unknown>;
103
+ error?: HysToastFeedback<unknown>;
104
+ }
105
+ export interface HysToastActionEvent extends HysToastContext {
106
+ action: HysToastAction;
107
+ status: "start" | "success" | "error";
108
+ result?: unknown;
109
+ }
110
+ export type HysToastRender = VNodeChild | ((context: HysToastActionContext) => VNodeChild);
111
+ export interface HysToastOptions extends HysToastPresentation {
112
+ id?: string;
113
+ content?: HysToastRender;
114
+ icon?: HysToastRender;
115
+ header?: HysToastRender;
116
+ footer?: HysToastRender;
117
+ renderActions?: HysToastRender;
118
+ priority?: number;
119
+ group?: string;
120
+ grouping?: boolean;
121
+ dedupe?: "ignore" | "merge";
122
+ dedupeKey?: string;
123
+ dedupeWindow?: number;
124
+ onShow?: (context: HysToastContext) => void;
125
+ onAfterShow?: (context: HysToastContext) => void;
126
+ onClose?: (context: HysToastCloseContext) => void;
127
+ onAfterClose?: (context: HysToastCloseContext) => void;
128
+ onClick?: (event: MouseEvent, context: HysToastContext) => void;
129
+ onAction?: (event: HysToastActionEvent) => void;
130
+ onStateChange?: (snapshot: HysToastSnapshot) => void;
131
+ }
132
+ export type HysToastPatch = string | Partial<Omit<HysToastOptions, "id">>;
133
+ export type HysToastFeedback<T> = HysToastPatch | ((value: T) => HysToastPatch);
134
+ export type HysToastFilter = {
135
+ type?: HysToastType;
136
+ group?: string;
137
+ position?: HysToastPosition;
138
+ status?: HysToastStatus;
139
+ };
140
+ export interface HysToastSnapshot extends HysToastContext {
141
+ id: string;
142
+ status: HysToastStatus;
143
+ position: HysToastPosition;
144
+ group?: string;
145
+ priority: number;
146
+ repeat: number;
147
+ }
148
+ export interface HysToastConfig extends Omit<HysToastPresentation, "message" | "title" | "theme" | "copyText"> {
149
+ maxCount?: number;
150
+ maxQueue?: number;
151
+ overflow?: "replace" | "queue";
152
+ queueOrder?: "fifo" | "lifo";
153
+ queueScope?: "global" | "position" | "type" | "group";
154
+ layout?: "vertical" | "horizontal" | "layered";
155
+ gap?: number;
156
+ collapsedCount?: number;
157
+ layerCount?: number;
158
+ layerTrigger?: "hover" | "click" | "both";
159
+ grouping?: boolean;
160
+ dedupe?: "ignore" | "merge";
161
+ dedupeWindow?: number;
162
+ appendTo?: string | HTMLElement | ShadowRoot;
163
+ }
164
+ export interface HysToastHandle {
165
+ readonly id: string;
166
+ readonly closed: Promise<void>;
167
+ close(): void;
168
+ update(value: HysToastPatch): void;
169
+ extend(milliseconds: number): void;
170
+ pause(): void;
171
+ resume(): void;
172
+ }
173
+ export interface HysToastTaskContext {
174
+ handle: HysToastHandle;
175
+ update: (value: HysToastPatch) => void;
176
+ progress: (value: HysToastProgress) => void;
177
+ }
178
+ export interface HysToastPromiseOptions<T> {
179
+ id?: string;
180
+ options?: HysToastOptions;
181
+ loading?: HysToastPatch;
182
+ success?: HysToastFeedback<T>;
183
+ error?: HysToastFeedback<unknown>;
184
+ }
185
+ export interface HysToastTask<T> {
186
+ handle: HysToastHandle;
187
+ promise: Promise<T>;
188
+ }
189
+ type TypedToast = (value: string | Omit<HysToastOptions, "type">) => HysToastHandle;
190
+ export interface HysToastApi {
191
+ show(value: string | HysToastOptions): HysToastHandle;
192
+ success: TypedToast;
193
+ info: TypedToast;
194
+ warning: TypedToast;
195
+ error: TypedToast;
196
+ loading: TypedToast;
197
+ promise<T>(task: PromiseLike<T> | ((context: HysToastTaskContext) => T | PromiseLike<T>), options?: HysToastPromiseOptions<T>): HysToastTask<T>;
198
+ close(id: string): void;
199
+ update(id: string, value: HysToastPatch): void;
200
+ find(id: string): HysToastSnapshot | undefined;
201
+ list(filter?: HysToastFilter): HysToastSnapshot[];
202
+ closeAll(filter?: HysToastFilter): void;
203
+ closeType(type: HysToastType): void;
204
+ clearQueue(): void;
205
+ configure(config: Partial<HysToastConfig>): void;
206
+ }
207
+ export interface HysToastServiceConfig extends HysToastConfig, HysConfig {
208
+ }
209
+ export interface HysToastService extends HysToastApi {
210
+ dispose(): void;
211
+ }
212
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { HysToastAction, HysToastActionContext, HysToastActionEvent, HysToastContext, HysToastFeedback, HysToastLocale, HysToastPatch } from "./toastTypes";
2
+ export declare function feedback<T>(value: HysToastFeedback<T> | undefined, result: T): Partial<Omit<import("./toastTypes").HysToastOptions, "id">> | undefined;
3
+ export declare function useToastActions(options: {
4
+ available: () => boolean;
5
+ locale: () => HysToastLocale;
6
+ context: () => HysToastContext;
7
+ close: () => Promise<boolean>;
8
+ update: (patch: HysToastPatch) => void;
9
+ copyText: () => string;
10
+ emit: (event: HysToastActionEvent) => void;
11
+ }): {
12
+ busy: import("vue").Ref<string | undefined, string | undefined>;
13
+ copyStatus: import("vue").Ref<string, string>;
14
+ copy: () => Promise<boolean>;
15
+ context: () => HysToastActionContext;
16
+ run: (action: HysToastAction) => Promise<void>;
17
+ reset: () => void;
18
+ };
@@ -0,0 +1,11 @@
1
+ import { type Ref } from "vue";
2
+ export declare function useToastSwipe(element: Ref<HTMLElement | undefined>, enabled: () => boolean, dismiss: (event: PointerEvent) => Promise<boolean>): {
3
+ shift: Ref<number, number>;
4
+ dragging: Ref<boolean, boolean>;
5
+ suppressClick: Ref<boolean, boolean>;
6
+ reset: () => void;
7
+ start: (event: PointerEvent) => void;
8
+ move: (event: PointerEvent) => void;
9
+ end: (event: PointerEvent) => Promise<void>;
10
+ leave: (event: PointerEvent) => void;
11
+ };
@@ -0,0 +1,22 @@
1
+ export type ToastClock = {
2
+ remaining: number;
3
+ total: number;
4
+ expired: boolean;
5
+ };
6
+ export declare function useToastTimer(options: {
7
+ running: () => boolean;
8
+ duration: () => number;
9
+ indicators: () => boolean;
10
+ pauseOnBlur: () => boolean;
11
+ expire: () => void;
12
+ }): {
13
+ remaining: import("vue").Ref<number, number>;
14
+ total: import("vue").Ref<number, number>;
15
+ restart: () => void;
16
+ extend: (milliseconds: number) => void;
17
+ stop: () => void;
18
+ snapshot: () => ToastClock;
19
+ restore(clock: ToastClock): void;
20
+ pause: () => void;
21
+ resume: () => void;
22
+ };
@@ -0,0 +1,9 @@
1
+ type ReferenceListeners = {
2
+ [Name in keyof HTMLElementEventMap]?: (event: HTMLElementEventMap[Name]) => void;
3
+ };
4
+ export declare function createPopupReferenceBinding(kind: "tooltip" | "popover", id: string, events: ReferenceListeners): {
5
+ attach: (node: HTMLElement | undefined, open: boolean) => void;
6
+ detach: () => void;
7
+ syncAria: (open: boolean) => void;
8
+ };
9
+ export {};
@@ -1 +1 @@
1
- export declare function registerToastEscape(close: () => void): () => void;
1
+ export declare function registerToastEscape(close: (event: KeyboardEvent) => void, element: () => HTMLElement | undefined): (() => void) | undefined;
@@ -0,0 +1,121 @@
1
+ import type { HysToastApi, HysToastCloseContext, HysToastConfig, HysToastType } from "../components/HysToast/toastTypes";
2
+ import { type ToastEntry, type ToastInstance } from "./toastQueueModel";
3
+ export declare function createToastQueue(config: HysToastConfig, host: {
4
+ mount: () => void;
5
+ empty: () => void;
6
+ }, reportError: (error: unknown) => void): {
7
+ api: HysToastApi;
8
+ records: import("vue").ShallowReactive<Map<string, ToastEntry>>;
9
+ settings: import("vue").ShallowRef<{
10
+ maxCount?: number;
11
+ maxQueue?: number;
12
+ overflow?: "replace" | "queue";
13
+ queueOrder?: "fifo" | "lifo";
14
+ queueScope?: "global" | "position" | "type" | "group";
15
+ layout?: "vertical" | "horizontal" | "layered";
16
+ gap?: number;
17
+ collapsedCount?: number;
18
+ layerCount?: number;
19
+ layerTrigger?: "hover" | "click" | "both";
20
+ grouping?: boolean;
21
+ dedupe?: "ignore" | "merge";
22
+ dedupeWindow?: number;
23
+ appendTo?: string | HTMLElement | ShadowRoot;
24
+ progress?: import("./useHysToast").HysToastProgress | undefined;
25
+ type?: HysToastType | undefined;
26
+ width?: string | number | undefined;
27
+ direction?: import("./useHysToast").HysToastDirection | undefined;
28
+ offset?: number | undefined;
29
+ duration?: number | undefined;
30
+ animation?: (import("./useHysToast").HysToastAnimation | import("./useHysToast").HysToastMotionPreset) | undefined;
31
+ closable?: boolean | undefined;
32
+ showIcon?: boolean | undefined;
33
+ beforeClose?: ((context: HysToastCloseContext) => boolean | void | Promise<boolean | void>) | undefined;
34
+ easing?: string | ((progress: number) => number) | undefined;
35
+ plain?: boolean | undefined;
36
+ locale?: Partial<import("./useHysToast").HysToastLocale> | undefined;
37
+ position?: import("./useHysToast").HysToastPosition | undefined;
38
+ animationDuration?: number | undefined;
39
+ zIndex?: number | undefined;
40
+ maxLines?: number | undefined;
41
+ actions?: readonly import("./useHysToast").HysToastAction[] | undefined;
42
+ closeOnEscape?: boolean | undefined;
43
+ live?: "polite" | "assertive" | "off" | undefined;
44
+ swipe?: boolean | undefined;
45
+ persistent?: boolean | undefined;
46
+ closeOnClick?: boolean | undefined;
47
+ keyboardDismiss?: boolean | undefined;
48
+ pauseOnHover?: boolean | undefined;
49
+ pauseOnBlur?: boolean | undefined;
50
+ interactive?: boolean | undefined;
51
+ offsetX?: number | undefined;
52
+ offsetY?: number | undefined;
53
+ coordinates?: import("./useHysToast").HysToastCoordinates | undefined;
54
+ glass?: boolean | undefined;
55
+ toastStyle?: import("vue").CSSProperties | undefined;
56
+ progressStyle?: import("vue").CSSProperties | undefined;
57
+ showProgress?: boolean | undefined;
58
+ countdown?: boolean | undefined;
59
+ copyable?: boolean | undefined;
60
+ actionLayout?: "inline" | "footer" | undefined;
61
+ }, {
62
+ maxCount?: number;
63
+ maxQueue?: number;
64
+ overflow?: "replace" | "queue";
65
+ queueOrder?: "fifo" | "lifo";
66
+ queueScope?: "global" | "position" | "type" | "group";
67
+ layout?: "vertical" | "horizontal" | "layered";
68
+ gap?: number;
69
+ collapsedCount?: number;
70
+ layerCount?: number;
71
+ layerTrigger?: "hover" | "click" | "both";
72
+ grouping?: boolean;
73
+ dedupe?: "ignore" | "merge";
74
+ dedupeWindow?: number;
75
+ appendTo?: string | HTMLElement | ShadowRoot;
76
+ progress?: import("./useHysToast").HysToastProgress | undefined;
77
+ type?: HysToastType | undefined;
78
+ width?: string | number | undefined;
79
+ direction?: import("./useHysToast").HysToastDirection | undefined;
80
+ offset?: number | undefined;
81
+ duration?: number | undefined;
82
+ animation?: (import("./useHysToast").HysToastAnimation | import("./useHysToast").HysToastMotionPreset) | undefined;
83
+ closable?: boolean | undefined;
84
+ showIcon?: boolean | undefined;
85
+ beforeClose?: ((context: HysToastCloseContext) => boolean | void | Promise<boolean | void>) | undefined;
86
+ easing?: string | ((progress: number) => number) | undefined;
87
+ plain?: boolean | undefined;
88
+ locale?: Partial<import("./useHysToast").HysToastLocale> | undefined;
89
+ position?: import("./useHysToast").HysToastPosition | undefined;
90
+ animationDuration?: number | undefined;
91
+ zIndex?: number | undefined;
92
+ maxLines?: number | undefined;
93
+ actions?: readonly import("./useHysToast").HysToastAction[] | undefined;
94
+ closeOnEscape?: boolean | undefined;
95
+ live?: "polite" | "assertive" | "off" | undefined;
96
+ swipe?: boolean | undefined;
97
+ persistent?: boolean | undefined;
98
+ closeOnClick?: boolean | undefined;
99
+ keyboardDismiss?: boolean | undefined;
100
+ pauseOnHover?: boolean | undefined;
101
+ pauseOnBlur?: boolean | undefined;
102
+ interactive?: boolean | undefined;
103
+ offsetX?: number | undefined;
104
+ offsetY?: number | undefined;
105
+ coordinates?: import("./useHysToast").HysToastCoordinates | undefined;
106
+ glass?: boolean | undefined;
107
+ toastStyle?: import("vue").CSSProperties | undefined;
108
+ progressStyle?: import("vue").CSSProperties | undefined;
109
+ showProgress?: boolean | undefined;
110
+ countdown?: boolean | undefined;
111
+ copyable?: boolean | undefined;
112
+ actionLayout?: "inline" | "footer" | undefined;
113
+ }>;
114
+ order: (a: ToastEntry, b: ToastEntry) => number;
115
+ notify: <T extends unknown[]>(callback: ((...args: T) => void) | undefined, ...args: T) => void;
116
+ begin: (entry: ToastEntry, closeContext: HysToastCloseContext) => void;
117
+ finish: (entry: ToastEntry) => void;
118
+ setInstance: (entry: ToastEntry, instance: ToastInstance | null, stack: string) => void;
119
+ suspend: (permanent?: boolean) => void;
120
+ resume: () => void;
121
+ };
@@ -0,0 +1,116 @@
1
+ import type { ToastClock } from "../components/HysToast/useToastTimer";
2
+ import type { HysToastCloseContext, HysToastCloseReason, HysToastConfig, HysToastContext, HysToastFilter, HysToastHandle, HysToastOptions, HysToastSnapshot, HysToastStatus } from "../components/HysToast/toastTypes";
3
+ export interface ToastInstance {
4
+ close(reason?: HysToastCloseReason, event?: Event, force?: boolean): Promise<boolean>;
5
+ restart(): void;
6
+ extend(milliseconds: number): void;
7
+ snapshotClock(): ToastClock;
8
+ restoreClock(clock: ToastClock): void;
9
+ }
10
+ export interface ToastEntry {
11
+ id: string;
12
+ serial: number;
13
+ options: HysToastOptions;
14
+ status: HysToastStatus;
15
+ repeat: number;
16
+ lastSeen: number;
17
+ paused: boolean;
18
+ extending: number;
19
+ clock?: ToastClock;
20
+ shown?: boolean;
21
+ entered?: boolean;
22
+ closeContext?: HysToastCloseContext;
23
+ handle: HysToastHandle;
24
+ resolve: () => void;
25
+ }
26
+ export declare const nextToastSequence: () => number;
27
+ export declare const asOptions: (value: string | HysToastOptions) => HysToastOptions;
28
+ export declare function presentation(options: HysToastOptions): {
29
+ message?: string;
30
+ title?: string;
31
+ type?: import("./useHysToast").HysToastType;
32
+ duration?: number;
33
+ persistent?: boolean;
34
+ closable?: boolean;
35
+ closeOnClick?: boolean;
36
+ closeOnEscape?: boolean;
37
+ keyboardDismiss?: boolean;
38
+ pauseOnHover?: boolean;
39
+ pauseOnBlur?: boolean;
40
+ swipe?: boolean;
41
+ interactive?: boolean;
42
+ position?: import("./useHysToast").HysToastPosition;
43
+ offset?: number;
44
+ offsetX?: number;
45
+ offsetY?: number;
46
+ coordinates?: import("./useHysToast").HysToastCoordinates;
47
+ zIndex?: number;
48
+ width?: string | number;
49
+ showIcon?: boolean;
50
+ plain?: boolean;
51
+ glass?: boolean;
52
+ theme?: import("..").HysTheme;
53
+ toastStyle?: import("vue").CSSProperties;
54
+ progressStyle?: import("vue").CSSProperties;
55
+ progress?: import("./useHysToast").HysToastProgress;
56
+ showProgress?: boolean;
57
+ countdown?: boolean;
58
+ maxLines?: number;
59
+ copyable?: boolean;
60
+ copyText?: string;
61
+ actionLayout?: "inline" | "footer";
62
+ actions?: readonly import("./useHysToast").HysToastAction[];
63
+ animation?: import("./useHysToast").HysToastAnimation | import("./useHysToast").HysToastMotionPreset;
64
+ direction?: import("./useHysToast").HysToastDirection;
65
+ animationDuration?: number;
66
+ easing?: string | ((progress: number) => number);
67
+ live?: "polite" | "assertive" | "off";
68
+ locale?: Partial<import("./useHysToast").HysToastLocale>;
69
+ beforeClose?: (context: HysToastCloseContext) => boolean | void | Promise<boolean | void>;
70
+ };
71
+ export declare function toastStackKey(options: HysToastOptions): string;
72
+ export declare function defaults(config: HysToastConfig): {
73
+ grouping?: boolean;
74
+ dedupe?: "ignore" | "merge";
75
+ dedupeWindow?: number;
76
+ progress?: import("./useHysToast").HysToastProgress | undefined;
77
+ type?: import("./useHysToast").HysToastType | undefined;
78
+ width?: string | number | undefined;
79
+ direction?: import("./useHysToast").HysToastDirection | undefined;
80
+ offset?: number | undefined;
81
+ duration?: number | undefined;
82
+ animation?: (import("./useHysToast").HysToastAnimation | import("./useHysToast").HysToastMotionPreset) | undefined;
83
+ closable?: boolean | undefined;
84
+ showIcon?: boolean | undefined;
85
+ beforeClose?: ((context: HysToastCloseContext) => boolean | void | Promise<boolean | void>) | undefined;
86
+ easing?: string | ((progress: number) => number) | undefined;
87
+ plain?: boolean | undefined;
88
+ locale?: Partial<import("./useHysToast").HysToastLocale> | undefined;
89
+ position?: import("./useHysToast").HysToastPosition | undefined;
90
+ animationDuration?: number | undefined;
91
+ zIndex?: number | undefined;
92
+ maxLines?: number | undefined;
93
+ actions?: readonly import("./useHysToast").HysToastAction[] | undefined;
94
+ closeOnEscape?: boolean | undefined;
95
+ live?: "polite" | "assertive" | "off" | undefined;
96
+ swipe?: boolean | undefined;
97
+ persistent?: boolean | undefined;
98
+ closeOnClick?: boolean | undefined;
99
+ keyboardDismiss?: boolean | undefined;
100
+ pauseOnHover?: boolean | undefined;
101
+ pauseOnBlur?: boolean | undefined;
102
+ interactive?: boolean | undefined;
103
+ offsetX?: number | undefined;
104
+ offsetY?: number | undefined;
105
+ coordinates?: import("./useHysToast").HysToastCoordinates | undefined;
106
+ glass?: boolean | undefined;
107
+ toastStyle?: import("vue").CSSProperties | undefined;
108
+ progressStyle?: import("vue").CSSProperties | undefined;
109
+ showProgress?: boolean | undefined;
110
+ countdown?: boolean | undefined;
111
+ copyable?: boolean | undefined;
112
+ actionLayout?: "inline" | "footer" | undefined;
113
+ };
114
+ export declare function context(entry: ToastEntry): HysToastContext;
115
+ export declare function snapshot(entry: ToastEntry): HysToastSnapshot;
116
+ export declare function matches(entry: ToastEntry, filter?: HysToastFilter): boolean;
@@ -0,0 +1,2 @@
1
+ import type { HysToastApi } from "../components/HysToast/toastTypes";
2
+ export declare function createToastTaskRunner(show: HysToastApi["show"], reportError: (error: unknown) => void): HysToastApi["promise"];
@@ -1,50 +1,6 @@
1
- import { type VNodeChild } from 'vue';
2
- import type { HysToastPosition, HysToastType } from '../components/HysToast/HysToast.vue';
3
- import { type HysConfig } from '../config';
4
- export interface HysToastOptions {
5
- id?: string;
6
- message?: string;
7
- content?: VNodeChild | (() => VNodeChild);
8
- type?: HysToastType;
9
- duration?: number;
10
- closable?: boolean;
11
- position?: HysToastPosition;
12
- offset?: number;
13
- zIndex?: number;
14
- showIcon?: boolean;
15
- icon?: VNodeChild | (() => VNodeChild);
16
- plain?: boolean;
17
- pauseOnHover?: boolean;
18
- closeOnEscape?: boolean;
19
- grouping?: boolean;
20
- onClose?: () => void;
21
- onAfterClose?: () => void;
22
- }
23
- export interface HysToastConfig extends Omit<HysToastOptions, 'id' | 'message' | 'content' | 'icon' | 'onClose' | 'onAfterClose'> {
24
- maxCount?: number;
25
- appendTo?: string | HTMLElement | ShadowRoot;
26
- }
27
- export interface HysToastHandle {
28
- readonly id: string;
29
- readonly closed: Promise<void>;
30
- close(): void;
31
- update(value: string | Omit<Partial<HysToastOptions>, 'id'>): void;
32
- }
33
- export interface HysToastApi {
34
- show(value: string | HysToastOptions): HysToastHandle;
35
- success(value: string | Omit<HysToastOptions, 'type'>): HysToastHandle;
36
- info(value: string | Omit<HysToastOptions, 'type'>): HysToastHandle;
37
- warning(value: string | Omit<HysToastOptions, 'type'>): HysToastHandle;
38
- error(value: string | Omit<HysToastOptions, 'type'>): HysToastHandle;
39
- loading(value: string | Omit<HysToastOptions, 'type'>): HysToastHandle;
40
- closeAll(): void;
41
- }
42
- export interface HysToastServiceConfig extends HysToastConfig, HysConfig {
43
- }
44
- export interface HysToastService extends HysToastApi {
45
- dispose(): void;
46
- }
47
- /** Call during setup. Messages inherit the owner's theme and are removed when its scope leaves. */
1
+ import type { HysToastApi, HysToastConfig, HysToastService, HysToastServiceConfig } from "../components/HysToast/toastTypes";
2
+ export type * from "../components/HysToast/toastTypes";
48
3
  export declare function useHysToast(config?: HysToastConfig): HysToastApi;
49
- /** Create a shared service for callers outside setup; dispose it when the owning application ends. */
50
4
  export declare function createHysToast(config?: HysToastServiceConfig): HysToastService;
5
+ export declare function configureHysToast(config: HysToastServiceConfig): void;
6
+ export declare const hysToast: HysToastService;
@@ -1,6 +1,26 @@
1
1
  import { type CSSProperties, type HTMLAttributes } from "vue";
2
2
  import type { HysPopupSurfaceContext, HysPopupSurfaceProps } from "./popupSurface";
3
3
  export declare function usePopupSurface(props: HysPopupSurfaceProps, kind: "tooltip" | "popover", emit: (name: string, ...args: any[]) => void): {
4
+ afterEnter: () => Promise<void>;
5
+ afterLeave: () => Promise<void>;
6
+ inactive: () => void;
7
+ request: (value: boolean, restore?: boolean) => Promise<boolean>;
8
+ show: () => Promise<boolean>;
9
+ hide: () => Promise<boolean>;
10
+ toggle: () => Promise<boolean>;
11
+ updatePosition: () => void;
12
+ focus: () => void | undefined;
13
+ pointerEnter: () => void;
14
+ pointerLeave: () => void;
15
+ panelEnter: () => void;
16
+ panelLeave: () => void;
17
+ focusIn: (event: FocusEvent) => void;
18
+ focusOut: (event: FocusEvent) => void;
19
+ panelFocusIn: () => void;
20
+ panelFocusOut: (event: FocusEvent) => void;
21
+ click: (event: MouseEvent) => void;
22
+ contextmenu: (event: MouseEvent) => void;
23
+ key: (event: KeyboardEvent) => void;
4
24
  wrapper: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
5
25
  referenceElement: import("vue").ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
6
26
  panel: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
@@ -3318,24 +3338,4 @@ export declare function usePopupSurface(props: HysPopupSurfaceProps, kind: "tool
3318
3338
  contentStyle: import("vue").ComputedRef<CSSProperties>;
3319
3339
  scope: import("vue").ComputedRef<HysPopupSurfaceContext>;
3320
3340
  wrapperAttrs: import("vue").ComputedRef<HTMLAttributes>;
3321
- pointerEnter: () => void;
3322
- pointerLeave: () => void;
3323
- panelEnter: () => void;
3324
- panelLeave: () => void;
3325
- focusIn: (event: FocusEvent) => void;
3326
- focusOut: (event: FocusEvent) => void;
3327
- panelFocusIn: () => void;
3328
- panelFocusOut: (event: FocusEvent) => void;
3329
- click: (event: MouseEvent) => void;
3330
- contextmenu: (event: MouseEvent) => void;
3331
- key: (event: KeyboardEvent) => void;
3332
- afterEnter: () => Promise<void>;
3333
- afterLeave: () => Promise<void>;
3334
- inactive: () => void;
3335
- request: (value: boolean, restore?: boolean) => Promise<boolean>;
3336
- show: () => Promise<boolean>;
3337
- hide: () => Promise<boolean>;
3338
- toggle: () => Promise<boolean>;
3339
- updatePosition: () => void;
3340
- focus: () => void | undefined;
3341
3341
  };