@wow-two-beta/fe 0.0.49 → 0.0.51

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 (195) hide show
  1. package/dist/feedback/FeedbackBus.d.ts +154 -29
  2. package/dist/feedback/FeedbackBus.js +264 -27
  3. package/dist/feedback/FeedbackBus.js.map +1 -1
  4. package/dist/feedback/index.d.ts +1 -1
  5. package/dist/feedback/index.js +3 -1
  6. package/dist/foundation/dom/enums/ElementTag.d.ts +2 -0
  7. package/dist/foundation/dom/enums/ElementTag.js +3 -1
  8. package/dist/foundation/dom/enums/ElementTag.js.map +1 -1
  9. package/dist/index.js +404 -382
  10. package/dist/index.js.map +1 -1
  11. package/dist/presentation/actions/button/Button.variants.d.ts +12 -0
  12. package/dist/presentation/actions/button/Button.variants.js +18 -2
  13. package/dist/presentation/actions/button/Button.variants.js.map +1 -1
  14. package/dist/presentation/actions/button/Button.vue.d.ts +8 -1
  15. package/dist/presentation/actions/button/Button.vue.js +106 -58
  16. package/dist/presentation/actions/button/Button.vue.js.map +1 -1
  17. package/dist/presentation/actions/refreshButton/RefreshButton.vue.js.map +1 -1
  18. package/dist/presentation/display/badge/Badge.variants.d.ts +23 -1
  19. package/dist/presentation/display/badge/Badge.variants.js +18 -3
  20. package/dist/presentation/display/badge/Badge.variants.js.map +1 -1
  21. package/dist/presentation/display/badge/Badge.vue.d.ts +3 -0
  22. package/dist/presentation/display/badge/Badge.vue.js +10 -4
  23. package/dist/presentation/display/badge/Badge.vue.js.map +1 -1
  24. package/dist/presentation/display/carousel/Carousel.variants.d.ts +65 -0
  25. package/dist/presentation/display/carousel/Carousel.variants.js +56 -0
  26. package/dist/presentation/display/carousel/Carousel.variants.js.map +1 -0
  27. package/dist/presentation/display/carousel/Carousel.vue.d.ts +7 -0
  28. package/dist/presentation/display/carousel/Carousel.vue.js +7 -2
  29. package/dist/presentation/display/carousel/Carousel.vue.js.map +1 -1
  30. package/dist/presentation/display/carousel/CarouselContext.d.ts +10 -0
  31. package/dist/presentation/display/carousel/CarouselContext.js.map +1 -1
  32. package/dist/presentation/display/carousel/CarouselNext.vue.d.ts +6 -2
  33. package/dist/presentation/display/carousel/CarouselNext.vue.js +12 -4
  34. package/dist/presentation/display/carousel/CarouselNext.vue.js.map +1 -1
  35. package/dist/presentation/display/carousel/CarouselPrev.vue.d.ts +6 -2
  36. package/dist/presentation/display/carousel/CarouselPrev.vue.js +12 -4
  37. package/dist/presentation/display/carousel/CarouselPrev.vue.js.map +1 -1
  38. package/dist/presentation/display/carousel/CarouselViewport.vue.d.ts +13 -2
  39. package/dist/presentation/display/carousel/CarouselViewport.vue.js +54 -2
  40. package/dist/presentation/display/carousel/CarouselViewport.vue.js.map +1 -1
  41. package/dist/presentation/display/carousel/index.d.ts +1 -0
  42. package/dist/presentation/display/index.d.ts +1 -0
  43. package/dist/presentation/display/index.js +120 -108
  44. package/dist/presentation/display/index.js.map +1 -1
  45. package/dist/presentation/display/mediaCard/MediaCard.vue.d.ts +41 -0
  46. package/dist/presentation/display/mediaCard/MediaCard.vue.js +108 -0
  47. package/dist/presentation/display/mediaCard/MediaCard.vue.js.map +1 -0
  48. package/dist/presentation/display/mediaCard/MediaCard2.vue.js +5 -0
  49. package/dist/presentation/display/mediaCard/MediaCard2.vue.js.map +1 -0
  50. package/dist/presentation/display/mediaCard/index.d.ts +1 -0
  51. package/dist/presentation/display/metaInlineText/MetaInlineItem.vue.d.ts +37 -0
  52. package/dist/presentation/display/metaInlineText/MetaInlineItem.vue.js +72 -0
  53. package/dist/presentation/display/metaInlineText/MetaInlineItem.vue.js.map +1 -0
  54. package/dist/presentation/display/metaInlineText/MetaInlineItem2.vue.js +7 -0
  55. package/dist/presentation/display/metaInlineText/MetaInlineItem2.vue.js.map +1 -0
  56. package/dist/presentation/display/metaInlineText/index.d.ts +1 -0
  57. package/dist/presentation/display/notificationCenterGroup/NotificationCenterButton.vue.d.ts +18 -0
  58. package/dist/presentation/display/notificationCenterGroup/NotificationCenterButton.vue.js +120 -0
  59. package/dist/presentation/display/notificationCenterGroup/NotificationCenterButton.vue.js.map +1 -0
  60. package/dist/presentation/display/notificationCenterGroup/NotificationCenterButton2.vue.js +5 -0
  61. package/dist/presentation/display/notificationCenterGroup/NotificationCenterButton2.vue.js.map +1 -0
  62. package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroup.vue.d.ts +11 -6
  63. package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroup.vue.js +255 -61
  64. package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroup.vue.js.map +1 -1
  65. package/dist/presentation/display/notificationCenterGroup/{NotificationItem.vue.d.ts → NotificationCenterGroupItem.vue.d.ts} +13 -12
  66. package/dist/presentation/display/notificationCenterGroup/{NotificationItem.vue.js → NotificationCenterGroupItem.vue.js} +81 -58
  67. package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroupItem.vue.js.map +1 -0
  68. package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroupItem2.vue.js +5 -0
  69. package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroupItem2.vue.js.map +1 -0
  70. package/dist/presentation/display/notificationCenterGroup/index.d.ts +6 -1
  71. package/dist/presentation/feedback/feedbackToastHost/FeedbackToastHost.vue.d.ts +1 -9
  72. package/dist/presentation/feedback/feedbackToastHost/FeedbackToastHost.vue.js +165 -20
  73. package/dist/presentation/feedback/feedbackToastHost/FeedbackToastHost.vue.js.map +1 -1
  74. package/dist/presentation/feedback/feedbackToastHost/RemindLaterButton.vue.d.ts +7 -0
  75. package/dist/presentation/feedback/feedbackToastHost/RemindLaterButton.vue.js +56 -0
  76. package/dist/presentation/feedback/feedbackToastHost/RemindLaterButton.vue.js.map +1 -0
  77. package/dist/presentation/feedback/feedbackToastHost/RemindLaterButton2.vue.js +5 -0
  78. package/dist/presentation/feedback/feedbackToastHost/RemindLaterButton2.vue.js.map +1 -0
  79. package/dist/presentation/feedback/index.js +9 -1
  80. package/dist/presentation/feedback/index.js.map +1 -1
  81. package/dist/presentation/feedback/toast/Toast.vue.d.ts +34 -8
  82. package/dist/presentation/feedback/toast/Toast.vue.js +290 -85
  83. package/dist/presentation/feedback/toast/Toast.vue.js.map +1 -1
  84. package/dist/presentation/feedback/toast/ToastContent.vue.d.ts +25 -0
  85. package/dist/presentation/feedback/toast/ToastContent.vue.js +78 -0
  86. package/dist/presentation/feedback/toast/ToastContent.vue.js.map +1 -0
  87. package/dist/presentation/feedback/toast/ToastContent2.vue.js +5 -0
  88. package/dist/presentation/feedback/toast/ToastContent2.vue.js.map +1 -0
  89. package/dist/presentation/feedback/toast/ToastRunningProgress.vue.d.ts +15 -0
  90. package/dist/presentation/feedback/toast/ToastRunningProgress.vue.js +88 -0
  91. package/dist/presentation/feedback/toast/ToastRunningProgress.vue.js.map +1 -0
  92. package/dist/presentation/feedback/toast/ToastRunningProgress2.vue.js +5 -0
  93. package/dist/presentation/feedback/toast/ToastRunningProgress2.vue.js.map +1 -0
  94. package/dist/presentation/feedback/toast/ToastSurface.d.ts +8 -0
  95. package/dist/presentation/feedback/toast/ToastSurface.js +10 -0
  96. package/dist/presentation/feedback/toast/ToastSurface.js.map +1 -0
  97. package/dist/presentation/feedback/toast/index.d.ts +1 -0
  98. package/dist/presentation/feedback/toastHost/ToastContent.d.ts +3 -0
  99. package/dist/presentation/feedback/toastHost/ToastEntry.d.ts +12 -0
  100. package/dist/presentation/feedback/toastHost/ToastFocusExtensions.d.ts +2 -0
  101. package/dist/presentation/feedback/toastHost/ToastFocusExtensions.js +11 -0
  102. package/dist/presentation/feedback/toastHost/ToastFocusExtensions.js.map +1 -0
  103. package/dist/presentation/feedback/toastHost/ToastGroup.d.ts +8 -0
  104. package/dist/presentation/feedback/toastHost/ToastGroupLatest.d.ts +10 -0
  105. package/dist/presentation/feedback/toastHost/ToastHost.vue.d.ts +55 -110
  106. package/dist/presentation/feedback/toastHost/ToastHost.vue.js +394 -399
  107. package/dist/presentation/feedback/toastHost/ToastHost.vue.js.map +1 -1
  108. package/dist/presentation/feedback/toastHost/ToastHost2.vue.js +4 -5
  109. package/dist/presentation/feedback/toastHost/ToastHostStore.d.ts +37 -0
  110. package/dist/presentation/feedback/toastHost/ToastHostStore.js +98 -0
  111. package/dist/presentation/feedback/toastHost/ToastHostStore.js.map +1 -0
  112. package/dist/presentation/feedback/toastHost/ToastHostStyles.d.ts +34 -0
  113. package/dist/presentation/feedback/toastHost/ToastHostStyles.js +44 -0
  114. package/dist/presentation/feedback/toastHost/ToastHostStyles.js.map +1 -0
  115. package/dist/presentation/feedback/toastHost/ToastNode.d.ts +3 -0
  116. package/dist/presentation/feedback/toastHost/ToastOptions.d.ts +72 -0
  117. package/dist/presentation/feedback/toastHost/ToastProgress.vue.d.ts +11 -0
  118. package/dist/presentation/feedback/toastHost/ToastProgress.vue.js +44 -0
  119. package/dist/presentation/feedback/toastHost/ToastProgress.vue.js.map +1 -0
  120. package/dist/presentation/feedback/toastHost/ToastProgress2.vue.js +5 -0
  121. package/dist/presentation/feedback/toastHost/ToastProgress2.vue.js.map +1 -0
  122. package/dist/presentation/feedback/toastHost/ToastPromiseOptions.d.ts +12 -0
  123. package/dist/presentation/feedback/toastHost/ToastRing.vue.d.ts +14 -0
  124. package/dist/presentation/feedback/toastHost/ToastRing.vue.js +65 -0
  125. package/dist/presentation/feedback/toastHost/ToastRing.vue.js.map +1 -0
  126. package/dist/presentation/feedback/toastHost/ToastRing2.vue.js +5 -0
  127. package/dist/presentation/feedback/toastHost/ToastRing2.vue.js.map +1 -0
  128. package/dist/presentation/feedback/toastHost/ToastSeconds.vue.d.ts +9 -0
  129. package/dist/presentation/feedback/toastHost/ToastSeconds.vue.js +56 -0
  130. package/dist/presentation/feedback/toastHost/ToastSeconds.vue.js.map +1 -0
  131. package/dist/presentation/feedback/toastHost/ToastSeconds2.vue.js +5 -0
  132. package/dist/presentation/feedback/toastHost/ToastSeconds2.vue.js.map +1 -0
  133. package/dist/presentation/feedback/toastHost/ToastSeverity.d.ts +3 -0
  134. package/dist/presentation/feedback/toastHost/UseResolvedToasts.d.ts +27 -0
  135. package/dist/presentation/feedback/toastHost/UseResolvedToasts.js +34 -0
  136. package/dist/presentation/feedback/toastHost/UseResolvedToasts.js.map +1 -0
  137. package/dist/presentation/feedback/toastHost/UseToastAnnouncer.d.ts +14 -0
  138. package/dist/presentation/feedback/toastHost/UseToastAnnouncer.js +106 -0
  139. package/dist/presentation/feedback/toastHost/UseToastAnnouncer.js.map +1 -0
  140. package/dist/presentation/feedback/toastHost/UseToastCapacity.d.ts +34 -0
  141. package/dist/presentation/feedback/toastHost/UseToastCapacity.js +128 -0
  142. package/dist/presentation/feedback/toastHost/UseToastCapacity.js.map +1 -0
  143. package/dist/presentation/feedback/toastHost/UseToastClock.d.ts +44 -0
  144. package/dist/presentation/feedback/toastHost/UseToastClock.js +134 -0
  145. package/dist/presentation/feedback/toastHost/UseToastClock.js.map +1 -0
  146. package/dist/presentation/feedback/toastHost/UseToastCountdown.d.ts +26 -0
  147. package/dist/presentation/feedback/toastHost/UseToastCountdown.js +23 -0
  148. package/dist/presentation/feedback/toastHost/UseToastCountdown.js.map +1 -0
  149. package/dist/presentation/feedback/toastHost/UseToastEntries.d.ts +4 -0
  150. package/dist/presentation/feedback/toastHost/UseToastEntries.js +17 -0
  151. package/dist/presentation/feedback/toastHost/UseToastEntries.js.map +1 -0
  152. package/dist/presentation/feedback/toastHost/UseToastExits.d.ts +11 -0
  153. package/dist/presentation/feedback/toastHost/UseToastExits.js +52 -0
  154. package/dist/presentation/feedback/toastHost/UseToastExits.js.map +1 -0
  155. package/dist/presentation/feedback/toastHost/UseToastGroupMotion.d.ts +43 -0
  156. package/dist/presentation/feedback/toastHost/UseToastGroupMotion.js +173 -0
  157. package/dist/presentation/feedback/toastHost/UseToastGroupMotion.js.map +1 -0
  158. package/dist/presentation/feedback/toastHost/UseToastHost.d.ts +10 -0
  159. package/dist/presentation/feedback/toastHost/UseToastHost.js +14 -0
  160. package/dist/presentation/feedback/toastHost/UseToastHost.js.map +1 -0
  161. package/dist/presentation/feedback/toastHost/UseToastHotkey.d.ts +20 -0
  162. package/dist/presentation/feedback/toastHost/UseToastHotkey.js +66 -0
  163. package/dist/presentation/feedback/toastHost/UseToastHotkey.js.map +1 -0
  164. package/dist/presentation/feedback/toastHost/UseToastPins.d.ts +26 -0
  165. package/dist/presentation/feedback/toastHost/UseToastPins.js +35 -0
  166. package/dist/presentation/feedback/toastHost/UseToastPins.js.map +1 -0
  167. package/dist/presentation/feedback/toastHost/UseToastStackMotion.d.ts +27 -0
  168. package/dist/presentation/feedback/toastHost/UseToastStackMotion.js +96 -0
  169. package/dist/presentation/feedback/toastHost/UseToastStackMotion.js.map +1 -0
  170. package/dist/presentation/feedback/toastHost/UseToastSwipe.d.ts +19 -0
  171. package/dist/presentation/feedback/toastHost/UseToastSwipe.js +173 -0
  172. package/dist/presentation/feedback/toastHost/UseToastSwipe.js.map +1 -0
  173. package/dist/presentation/feedback/toastHost/index.d.ts +8 -1
  174. package/dist/presentation/feedback/toastHost/index.js +7 -1
  175. package/dist/presentation/feedback/toastHost/index.js.map +1 -1
  176. package/dist/presentation/feedback/toastHost/styles.css +14 -2
  177. package/dist/presentation/layout/grid/Grid.variants.d.ts +7 -0
  178. package/dist/presentation/layout/grid/Grid.variants.js +4 -0
  179. package/dist/presentation/layout/grid/Grid.variants.js.map +1 -1
  180. package/dist/presentation/layout/grid/Grid.vue.d.ts +5 -0
  181. package/dist/presentation/layout/grid/Grid.vue.js +16 -4
  182. package/dist/presentation/layout/grid/Grid.vue.js.map +1 -1
  183. package/dist/presentation/layout/grid/index.d.ts +1 -1
  184. package/dist/presentation/layout/index.js +3 -1
  185. package/dist/presentation/nav/accountMenu/AccountMenu.vue.d.ts +1 -1
  186. package/dist/presentation/overlays/hoverCard/HoverCard.vue.d.ts +1 -1
  187. package/dist/presentation/overlays/popover/PopoverContent.vue.js +4 -4
  188. package/dist/presentation/overlays/popover/PopoverContent.vue.js.map +1 -1
  189. package/dist/presentation/overlays/tooltip/Tooltip.vue.d.ts +1 -1
  190. package/dist/presentation/overlays/tooltip/Tooltip.vue.js +8 -9
  191. package/dist/presentation/overlays/tooltip/Tooltip.vue.js.map +1 -1
  192. package/package.json +1 -1
  193. package/dist/presentation/display/notificationCenterGroup/NotificationItem.vue.js.map +0 -1
  194. package/dist/presentation/display/notificationCenterGroup/NotificationItem2.vue.js +0 -5
  195. package/dist/presentation/display/notificationCenterGroup/NotificationItem2.vue.js.map +0 -1
@@ -12,16 +12,29 @@ export declare const NoticeTone: {
12
12
  readonly Danger: "danger";
13
13
  };
14
14
  export type NoticeTone = (typeof NoticeTone)[keyof typeof NoticeTone];
15
- /**
16
- * A renderable slice of a notice. React's `ReactNode` becomes `string | VNode`
17
- * for the same reason the `ToastHost` payload did: notices travel as data through
18
- * `notify()`, not through a slot, so a caller who wants markup builds it with
19
- * `h()`. Structurally identical to `presentation/feedback`'s `ToastNode` — the
20
- * adapter's assignment is what keeps the two from drifting, and this module
21
- * cannot import that one (boundaries: `feedback` never reaches into
22
- * `presentation`).
23
- */
15
+ /** Defines how urgently a live notice needs attention. Equal priorities retain their delivery order. */
16
+ export declare const NoticePriority: {
17
+ /** Refers to a passive update whose result is already visible. */
18
+ readonly Low: "low";
19
+ /** Refers to a routine confirmation. */
20
+ readonly Normal: "normal";
21
+ /** Refers to a task outcome or progress update people are waiting on. */
22
+ readonly High: "high";
23
+ /** Refers to an immediate decision, such as an Undo with a real deadline. */
24
+ readonly Urgent: "urgent";
25
+ };
26
+ export type NoticePriority = (typeof NoticePriority)[keyof typeof NoticePriority];
27
+ /** The sort rank of each priority; a higher rank sits closer to the stack's anchor. */
28
+ export declare const NoticePriorityRank: Readonly<Record<NoticePriority, number>>;
29
+ /** Represents a renderable slice of a notice — a string or a caller-built VNode. */
24
30
  export type NoticeNode = string | VNode;
31
+ /** Represents the copy shown when a notice is read in a compact list. */
32
+ export interface NoticeCompactCopy {
33
+ /** The headline in the compact list. */
34
+ readonly title: NoticeNode;
35
+ /** The optional supporting body in the compact list. */
36
+ readonly description?: NoticeNode;
37
+ }
25
38
  /** Defines whether a notice is toast-only or remains in the explicit notification center. */
26
39
  export declare const NoticeCategory: {
27
40
  /** Refers to a transient toast; dismissal leaves no history. */
@@ -30,18 +43,63 @@ export declare const NoticeCategory: {
30
43
  readonly Retained: "retained";
31
44
  };
32
45
  export type NoticeCategory = (typeof NoticeCategory)[keyof typeof NoticeCategory];
33
- /** Defines a notice published on the bus — the headless payload a presentation adapter renders. */
46
+ /** Joins live notices with the same key behind one expandable toast. Each notice keeps its own identity. */
47
+ export interface NoticeGroup {
48
+ /** The key shared by every notice that joins the group. */
49
+ readonly key: string;
50
+ /** The summary title shown while the group holds more than one notice. */
51
+ readonly title: string;
52
+ }
53
+ /** Represents the stable identifiers and due time passed to the owning product's reminder scheduler. */
54
+ export interface NoticeReminderRequest {
55
+ /** The id of the notice to remind about. */
56
+ readonly noticeId: string;
57
+ /** The notice's `reminderKey`, which the product can resolve after a reload. */
58
+ readonly key: string;
59
+ /** The epoch milliseconds when the reminder falls due. */
60
+ readonly dueAtMs: number;
61
+ }
62
+ /** Defines reminder scheduling for a feedback scope; the product delivers due notices through its bus. */
63
+ export interface FeedbackReminderOptions {
64
+ /** The delay before a reminder falls due, in ms. Finite and positive. */
65
+ readonly delayMs: number;
66
+ /** Records one reminder; resolving hides the notice, and `signal` aborts when the notice is removed or replaced. */
67
+ readonly schedule: (request: NoticeReminderRequest, signal: AbortSignal) => Promise<void>;
68
+ }
69
+ /**
70
+ * Defines the progress of a running operation behind a notice. Omit `value` for an indeterminate operation;
71
+ * `max` defaults to 1 when a surface renders it, so the bus never normalizes either field.
72
+ */
73
+ export interface NoticeProgress {
74
+ /** How much work is done, between 0 and `max`. Omitted means indeterminate. */
75
+ readonly value?: number;
76
+ /** The value that counts as complete. A surface treats an omitted `max` as 1. */
77
+ readonly max?: number;
78
+ /** Optional text describing the current step. */
79
+ readonly label?: string;
80
+ }
81
+ /** Represents a notice published on the bus — the headless payload a presentation adapter renders. */
34
82
  export interface FeedbackNotice {
35
83
  /** The semantic tone — maps 1:1 onto the toast `severity` vocabulary. */
36
84
  readonly tone: NoticeTone;
85
+ /** Controls stack position and selects the configured default lifetime. */
86
+ readonly priority?: NoticePriority;
37
87
  /** Defaults to transient; retained notices remain in this bus's in-memory notification center. */
38
88
  readonly category?: NoticeCategory;
39
89
  /** The headline. */
40
90
  readonly title: NoticeNode;
41
91
  /** The optional supporting body. */
42
92
  readonly description?: NoticeNode;
93
+ /** Optional shorter copy for expanded groups and stack overflow. The default toast keeps its full copy. */
94
+ readonly compact?: NoticeCompactCopy;
95
+ /** Additional content revealed in the toast on demand. */
96
+ readonly details?: NoticeNode;
97
+ /** An explicit grouping key and summary title. Omit to deliver a separate toast. */
98
+ readonly group?: NoticeGroup;
43
99
  /** An optional action slot (e.g. a retry button) — passed through to the rendering surface. */
44
100
  readonly action?: NoticeNode;
101
+ /** Overrides the action in History. Set false for a toast-only action. Deadlines apply in both places. */
102
+ readonly historyAction?: NoticeNode | false;
45
103
  /**
46
104
  * Sends a one-click report of the failure behind this notice — a captured incident's `send` from
47
105
  * `/reporting`. The rendering surface shows it as a Report action beside `action`.
@@ -51,18 +109,52 @@ export interface FeedbackNotice {
51
109
  readonly id?: string;
52
110
  /** ms before the rendering surface auto-dismisses. Surface default when omitted; `Infinity` = sticky. */
53
111
  readonly durationMs?: number;
112
+ /** Absolute deadline in epoch milliseconds. It takes precedence over the display duration and cannot pause. */
113
+ readonly expiresAtMs?: number;
114
+ /** Overrides the host's pin default for this toast. */
115
+ readonly canPin?: boolean;
116
+ /** Enables Remind later when the bus has a scheduler. Use a stable key the product can resolve after reload. */
117
+ readonly reminderKey?: string;
118
+ /**
119
+ * Marks the operation behind this notice as still running; surfaces render it sticky with no countdown.
120
+ * Republish the same id without `progress` to mark completion.
121
+ */
122
+ readonly progress?: NoticeProgress;
123
+ /**
124
+ * Epoch milliseconds of the first publication. A product may supply it when restoring a notice; the bus
125
+ * otherwise stamps `Date.now()`, and republishing a retained id keeps its original time.
126
+ */
127
+ readonly publishedAtMs?: number;
54
128
  }
55
- /** Defines a notice as delivered to subscribers — identity always assigned. */
129
+ /** Represents a notice as delivered to subscribers — identity and publication time always assigned. */
56
130
  export interface PublishedNotice extends FeedbackNotice {
57
131
  readonly id: string;
132
+ readonly publishedAtMs: number;
58
133
  }
134
+ /** Represents a retained notice a product restores through `initialRetained`; its id is required. */
135
+ export type RetainedSeed = FeedbackNotice & {
136
+ readonly id: string;
137
+ };
59
138
  /** Defines a listener notified on every published notice. */
60
139
  export type NoticeListener = (notice: PublishedNotice) => void;
61
140
  /** Defines a listener receiving the complete retained snapshot, including an immediate initial snapshot. */
62
141
  export type RetainedNoticeListener = (notices: ReadonlyArray<PublishedNotice>) => void;
63
142
  /** Defines a toast dismissal listener; null closes every toast belonging to this bus. */
64
143
  export type NoticeDismissListener = (id: string | null) => void;
65
- /** Defines the context handed to `onError` when a subscriber throws. */
144
+ /** Defines a pop-up pause — an epoch deadline, `'manual'` until resumed, or `null` for active pop-ups. */
145
+ export type ToastPauseUntil = number | 'manual' | null;
146
+ /** Represents the pop-up pause and the unread retained ids of a feedback scope. */
147
+ export interface FeedbackNotificationState {
148
+ /** The pause in effect, or `null` while pop-ups are active. */
149
+ readonly pausedUntil: ToastPauseUntil;
150
+ /** Equals `unreadIds.length`. */
151
+ readonly unreadCount: number;
152
+ /** The unread retained ids, newest-first in the order of the retained list. */
153
+ readonly unreadIds: ReadonlyArray<string>;
154
+ }
155
+ /** Defines a listener receiving the notification state, including an immediate initial snapshot. */
156
+ export type NotificationStateListener = (state: FeedbackNotificationState) => void;
157
+ /** Represents the context handed to `onError` when a subscriber throws. */
66
158
  export interface FeedbackErrorContext {
67
159
  /** The listener that threw. */
68
160
  readonly listener: NoticeListener;
@@ -73,27 +165,36 @@ export interface FeedbackErrorContext {
73
165
  export type FeedbackErrorHandler = (error: unknown, context: FeedbackErrorContext) => void;
74
166
  /** Defines the options for {@link createFeedbackBus}. */
75
167
  export interface FeedbackBusOptions {
76
- /** Explicitly restores an application-validated retained snapshot without replaying toasts. No storage is read. */
77
- readonly initialRetained?: ReadonlyArray<PublishedNotice>;
168
+ /**
169
+ * Explicitly restores an application-validated retained snapshot without replaying toasts. No storage is read.
170
+ * A seed without a finite `publishedAtMs` is stamped with the creation time, and every seed starts read.
171
+ */
172
+ readonly initialRetained?: ReadonlyArray<RetainedSeed>;
173
+ /**
174
+ * Keeps only the newest N retained notices; older ones leave the history, unread state and reminders without
175
+ * closing their toasts. A positive integer or `Infinity`; defaults to 200.
176
+ */
177
+ readonly maxRetained?: number;
178
+ /** Notices at or above this priority still pop up while pop-ups are paused. Omitted pauses every notice. */
179
+ readonly pauseBypass?: NoticePriority;
78
180
  /** Receives every subscriber failure. Omitted swallows them — a broken subscriber is not worth a crash. */
79
181
  readonly onError?: FeedbackErrorHandler;
182
+ /** Registers the scheduler and delay for Remind later. */
183
+ readonly reminders?: FeedbackReminderOptions;
184
+ }
185
+ /** Defines the notices `track()` publishes while work runs and once it settles. */
186
+ export interface FeedbackTrackNotices<T> {
187
+ /** The notice published while the work runs; its `progress` marks the operation as running. */
188
+ readonly running: FeedbackNotice;
189
+ /** The notice that replaces it when the work resolves, or a function of the resolved value. */
190
+ readonly success: FeedbackNotice | ((value: T) => FeedbackNotice);
191
+ /** The notice that replaces it when the work rejects, or a function of the rejection. */
192
+ readonly failure: FeedbackNotice | ((error: unknown) => FeedbackNotice);
80
193
  }
81
194
  /**
82
- * Defines the module-scope feedback hub wiring app code to whatever surface renders notices.
83
- * Transient notices are fire-and-forget (no replay). Retained notices explicitly opt into an in-memory
84
- * snapshot rendered by `NotificationCenterGroup`. No browser storage, network or account wiring is implicit.
85
- * A transient notice published with no subscriber is dropped, so mount
86
- * the adapter (`<FeedbackToastHost/>`) before publishing. Nothing subscribes automatically — GWDNBM,
87
- * every wire is explicit:
88
- *
89
- * - **Notices in** — `notify({ tone, title })` from anywhere (composables, api client code, stores);
90
- * `feedbackQueryErrors(bus)` plugs a `/query` global error seam in.
91
- * - **Toasts out** — `<FeedbackToastHost/>` (`/presentation/feedback`) subscribes and forwards each
92
- * notice into the imperative `toastHost.toast()` API.
93
- *
94
- * Plain module state rather than a Vue plugin / `provide`: the bus is publisher-agnostic, and a
95
- * publisher is rarely inside a component's `setup()` (an interceptor, a store action). The
96
- * `bus` prop on the adapter is the isolation seam an app needs instead.
195
+ * Defines the module-scope feedback hub between app code and the surface that renders notices.
196
+ * Mount the adapter (`<FeedbackToastHost/>`) before publishing — a transient notice with no subscriber is dropped.
197
+ * Retained notices stay in memory only; no browser storage, network or account wiring is implicit.
97
198
  */
98
199
  export interface FeedbackBus {
99
200
  /** Publishes to subscribers and returns the id. Retained notices also update history without a mounted surface. */
@@ -106,8 +207,32 @@ export interface FeedbackBus {
106
207
  subscribeRetained(listener: RetainedNoticeListener): () => void;
107
208
  /** Subscribes a toast adapter to removal/reset. Listener failures are isolated. */
108
209
  subscribeDismiss(listener: NoticeDismissListener): () => void;
210
+ /** Returns the pop-up pause and unread retained ids for this scope. */
211
+ notificationState(): FeedbackNotificationState;
212
+ /** Subscribes to notification state and immediately receives a snapshot. */
213
+ subscribeNotificationState(listener: NotificationStateListener): () => void;
214
+ /** Hides this scope's visible pop-ups and suppresses new ones until resumed. Use null to resume. */
215
+ setToastPause(until: ToastPauseUntil): void;
216
+ /** Clears every unread id while leaving the retained entries available. */
217
+ markNotificationsRead(): void;
218
+ /** Marks one retained id read; a read or unknown id is a no-op. */
219
+ markRead(id: string): void;
220
+ /** Reports whether pop-ups are paused now (an elapsed timed pause is over) and the notice does not bypass it. */
221
+ suppresses(notice: FeedbackNotice): boolean;
222
+ /** Schedules an eligible notice, then hides it from the live stack. Retained history stays available. */
223
+ readonly remindLater?: (notice: PublishedNotice) => Promise<void>;
109
224
  /** Removes a retained notice and closes its toast; a transient or unknown id is a no-op. */
110
225
  remove(id: string): void;
226
+ /** Closes the live toast of any id, transient or retained. Retained history and unread state stay untouched. */
227
+ dismiss(id: string): void;
228
+ /** Removes every retained notice and closes their toasts; pause and subscriptions stay. A no-op when empty. */
229
+ clearRetained(): void;
230
+ /**
231
+ * Publishes `running` with a stable id and `progress`, then replaces it under that id with the settled notice,
232
+ * `progress` removed. Resolves with the work's value; rethrows its original error. After `dispose()` it
233
+ * returns the settlement and publishes nothing.
234
+ */
235
+ track<T>(work: Promise<T> | ((report: (progress: NoticeProgress) => void) => Promise<T>), notices: FeedbackTrackNotices<T>): Promise<T>;
111
236
  /** Clears retained notices and this bus's toasts; subscriptions remain for a new session scope. */
112
237
  reset(): void;
113
238
  /** Resets and permanently disposes subscriptions. Subsequent publication is a no-op. */
@@ -9,25 +9,72 @@ const NoticeTone = {
9
9
  /** Refers to a destructive / error notice. */
10
10
  Danger: Severity.Danger
11
11
  };
12
+ const NoticePriority = {
13
+ /** Refers to a passive update whose result is already visible. */
14
+ Low: "low",
15
+ /** Refers to a routine confirmation. */
16
+ Normal: "normal",
17
+ /** Refers to a task outcome or progress update people are waiting on. */
18
+ High: "high",
19
+ /** Refers to an immediate decision, such as an Undo with a real deadline. */
20
+ Urgent: "urgent"
21
+ };
22
+ const NoticePriorityRank = Object.freeze({
23
+ [NoticePriority.Low]: 0,
24
+ [NoticePriority.Normal]: 1,
25
+ [NoticePriority.High]: 2,
26
+ [NoticePriority.Urgent]: 3
27
+ });
12
28
  const NoticeCategory = {
13
29
  /** Refers to a transient toast; dismissal leaves no history. */
14
30
  Transient: "transient",
15
31
  /** Refers to a notice retained in this bus until removed or the scope resets. */
16
32
  Retained: "retained"
17
33
  };
34
+ const DefaultMaxRetained = 200;
35
+ function isFiniteMs(value) {
36
+ return value !== void 0 && Number.isFinite(value);
37
+ }
18
38
  function createFeedbackBus(options = {}) {
19
- const { onError } = options;
39
+ const { onError, reminders, pauseBypass } = options;
40
+ if (reminders && (!Number.isFinite(reminders.delayMs) || reminders.delayMs <= 0)) {
41
+ throw new RangeError("Reminder delay must be finite and positive.");
42
+ }
43
+ const maxRetained = options.maxRetained === void 0 ? DefaultMaxRetained : options.maxRetained;
44
+ if (maxRetained !== Infinity && !(Number.isInteger(maxRetained) && maxRetained > 0)) {
45
+ throw new RangeError("Retained limit must be a positive integer or Infinity.");
46
+ }
47
+ if (pauseBypass !== void 0 && !Object.values(NoticePriority).includes(pauseBypass)) {
48
+ throw new RangeError("Pause bypass must be a notice priority.");
49
+ }
20
50
  const listeners = /* @__PURE__ */ new Set();
21
51
  const retainedListeners = /* @__PURE__ */ new Set();
22
52
  const dismissListeners = /* @__PURE__ */ new Set();
23
- let notices = Object.freeze([
24
- ...new Map(
25
- (options.initialRetained ?? []).map((notice) => [
26
- notice.id,
27
- Object.freeze({ ...notice, category: NoticeCategory.Retained })
28
- ])
29
- ).values()
30
- ]);
53
+ const notificationListeners = /* @__PURE__ */ new Set();
54
+ const unread = /* @__PURE__ */ new Set();
55
+ const scheduling = /* @__PURE__ */ new Map();
56
+ let pausedUntil = null;
57
+ let resumeTimer;
58
+ let notificationSnapshot = Object.freeze({
59
+ pausedUntil,
60
+ unreadCount: 0,
61
+ unreadIds: Object.freeze([])
62
+ });
63
+ const seededAtMs = Date.now();
64
+ let notices = Object.freeze(
65
+ capped([
66
+ ...new Map(
67
+ (options.initialRetained ?? []).map((seed) => [
68
+ seed.id,
69
+ Object.freeze({
70
+ ...seed,
71
+ category: NoticeCategory.Retained,
72
+ publishedAtMs: isFiniteMs(seed.publishedAtMs) ? seed.publishedAtMs : seededAtMs
73
+ })
74
+ ])
75
+ ).values()
76
+ ])
77
+ );
31
78
  let idSeq = 0;
32
79
  let disposed = false;
33
80
  const nextId = () => {
@@ -37,6 +84,14 @@ function createFeedbackBus(options = {}) {
37
84
  } while (notices.some((notice) => notice.id === id));
38
85
  return id;
39
86
  };
87
+ function capped(list) {
88
+ if (list.length <= maxRetained) return list;
89
+ for (const dropped of list.slice(maxRetained)) {
90
+ unread.delete(dropped.id);
91
+ cancelReminder(dropped.id);
92
+ }
93
+ return list.slice(0, maxRetained);
94
+ }
40
95
  const deliver = (subscribers, value) => {
41
96
  for (const listener of [...subscribers]) {
42
97
  try {
@@ -46,11 +101,88 @@ function createFeedbackBus(options = {}) {
46
101
  }
47
102
  };
48
103
  const publishRetained = () => deliver(retainedListeners, notices);
104
+ function publishNotificationState() {
105
+ const unreadIds = notices.filter((notice) => unread.has(notice.id)).map((notice) => notice.id);
106
+ const previous = notificationSnapshot.unreadIds;
107
+ if (notificationSnapshot.pausedUntil === pausedUntil && previous.length === unreadIds.length && previous.every((id, index) => id === unreadIds[index])) {
108
+ return;
109
+ }
110
+ notificationSnapshot = Object.freeze({
111
+ pausedUntil,
112
+ unreadCount: unreadIds.length,
113
+ unreadIds: Object.freeze(unreadIds)
114
+ });
115
+ deliver(notificationListeners, notificationSnapshot);
116
+ }
117
+ function scheduleResume() {
118
+ clearTimeout(resumeTimer);
119
+ if (typeof pausedUntil !== "number") return;
120
+ const wait = Math.max(1, pausedUntil - Date.now());
121
+ resumeTimer = setTimeout(
122
+ () => {
123
+ if (typeof pausedUntil === "number" && pausedUntil <= Date.now()) setToastPause(null);
124
+ else scheduleResume();
125
+ },
126
+ Math.min(wait, 2147483647)
127
+ );
128
+ }
129
+ function setToastPause(until) {
130
+ if (disposed) return;
131
+ const next = until === "manual" || typeof until === "number" && Number.isFinite(new Date(until).getTime()) && until > Date.now() ? until : null;
132
+ if (next === pausedUntil) return;
133
+ const starting = pausedUntil === null && next !== null;
134
+ pausedUntil = next;
135
+ scheduleResume();
136
+ publishNotificationState();
137
+ if (starting) deliver(dismissListeners, null);
138
+ }
139
+ function notificationState() {
140
+ if (typeof pausedUntil === "number" && pausedUntil <= Date.now()) setToastPause(null);
141
+ return notificationSnapshot;
142
+ }
143
+ function suppresses(notice) {
144
+ if (notificationState().pausedUntil === null) return false;
145
+ if (pauseBypass === void 0) return true;
146
+ return NoticePriorityRank[notice.priority ?? NoticePriority.Normal] < NoticePriorityRank[pauseBypass];
147
+ }
148
+ function cancelReminder(id) {
149
+ const current = scheduling.get(id);
150
+ scheduling.delete(id);
151
+ current?.controller.abort();
152
+ }
49
153
  const reset = () => {
154
+ for (const id of scheduling.keys()) cancelReminder(id);
155
+ clearTimeout(resumeTimer);
156
+ pausedUntil = null;
157
+ unread.clear();
50
158
  notices = Object.freeze([]);
51
159
  publishRetained();
160
+ publishNotificationState();
52
161
  deliver(dismissListeners, null);
53
162
  };
163
+ const remindLater = reminders ? (notice) => {
164
+ const key = notice.reminderKey;
165
+ if (disposed || !key || Number.isFinite(notice.expiresAtMs)) {
166
+ return Promise.reject(new Error("This notice cannot be scheduled."));
167
+ }
168
+ const existing = scheduling.get(notice.id);
169
+ if (existing?.key === key) return existing.pending;
170
+ cancelReminder(notice.id);
171
+ const controller = new AbortController();
172
+ const { signal } = controller;
173
+ const request = { noticeId: notice.id, key, dueAtMs: Date.now() + reminders.delayMs };
174
+ const pending = Promise.resolve().then(() => {
175
+ signal.throwIfAborted();
176
+ return reminders.schedule(request, signal);
177
+ }).then(() => {
178
+ signal.throwIfAborted();
179
+ deliver(dismissListeners, notice.id);
180
+ }).finally(() => {
181
+ if (scheduling.get(notice.id)?.controller === controller) scheduling.delete(notice.id);
182
+ });
183
+ scheduling.set(notice.id, { key, controller, pending });
184
+ return pending;
185
+ } : void 0;
54
186
  const report = (error, listener, notice) => {
55
187
  if (!onError) return;
56
188
  try {
@@ -58,27 +190,93 @@ function createFeedbackBus(options = {}) {
58
190
  } catch {
59
191
  }
60
192
  };
61
- return {
62
- notify(notice) {
63
- const published = Object.freeze({ ...notice, id: notice.id ?? nextId() });
64
- if (disposed) return published.id;
65
- const retained = notice.category === NoticeCategory.Retained;
66
- const existing = notices.some((item) => item.id === published.id);
67
- if (retained || existing) {
68
- notices = Object.freeze(
69
- retained ? existing ? notices.map((item) => item.id === published.id ? published : item) : [published, ...notices] : notices.filter((item) => item.id !== published.id)
70
- );
71
- publishRetained();
193
+ function isNews(previous, next) {
194
+ return previous.title !== next.title || previous.description !== next.description || previous.tone !== next.tone;
195
+ }
196
+ function notify2(notice) {
197
+ const id = notice.id ?? nextId();
198
+ const existingEntry = notices.find((item) => item.id === id);
199
+ const published = Object.freeze({
200
+ ...notice,
201
+ id,
202
+ publishedAtMs: existingEntry?.publishedAtMs ?? (isFiniteMs(notice.publishedAtMs) ? notice.publishedAtMs : Date.now())
203
+ });
204
+ if (disposed) return id;
205
+ notificationState();
206
+ const pending = scheduling.get(id);
207
+ if (pending && pending.key !== published.reminderKey) cancelReminder(id);
208
+ const retained = notice.category === NoticeCategory.Retained;
209
+ if (retained || existingEntry) {
210
+ notices = Object.freeze(
211
+ capped(
212
+ retained ? existingEntry ? notices.map((item) => item.id === id ? published : item) : [published, ...notices] : notices.filter((item) => item.id !== id)
213
+ )
214
+ );
215
+ if (!retained) unread.delete(id);
216
+ else if (!existingEntry || isNews(existingEntry, published)) unread.add(id);
217
+ publishRetained();
218
+ publishNotificationState();
219
+ }
220
+ for (const listener of [...listeners]) {
221
+ try {
222
+ listener(published);
223
+ } catch (failure) {
224
+ report(failure, listener, published);
72
225
  }
73
- for (const listener of [...listeners]) {
74
- try {
75
- listener(published);
76
- } catch (failure) {
77
- report(failure, listener, published);
226
+ }
227
+ return id;
228
+ }
229
+ function settle(notice, id) {
230
+ const settled = { ...notice, id };
231
+ delete settled.progress;
232
+ notify2(settled);
233
+ }
234
+ function track(work, tracked) {
235
+ const id = tracked.running.id ?? nextId();
236
+ let finished = false;
237
+ const showProgress = (progress) => {
238
+ if (!finished) notify2({ ...tracked.running, id, progress });
239
+ };
240
+ showProgress(tracked.running.progress ?? {});
241
+ let operation;
242
+ try {
243
+ operation = Promise.resolve(typeof work === "function" ? work(showProgress) : work);
244
+ } catch (failure) {
245
+ operation = Promise.reject(failure);
246
+ }
247
+ const failureFor = (error) => typeof tracked.failure === "function" ? tracked.failure(error) : tracked.failure;
248
+ const conclude = (build, isSuccess) => {
249
+ finished = true;
250
+ if (disposed) return;
251
+ let notice;
252
+ try {
253
+ notice = build();
254
+ } catch (formatterError) {
255
+ let fallback = tracked.running;
256
+ if (isSuccess) {
257
+ try {
258
+ fallback = failureFor(formatterError);
259
+ } catch {
260
+ }
78
261
  }
262
+ settle(fallback, id);
263
+ throw formatterError;
79
264
  }
80
- return published.id;
81
- },
265
+ settle(notice, id);
266
+ };
267
+ return operation.then(
268
+ (value) => {
269
+ conclude(() => typeof tracked.success === "function" ? tracked.success(value) : tracked.success, true);
270
+ return value;
271
+ },
272
+ (failure) => {
273
+ conclude(() => failureFor(failure), false);
274
+ throw failure;
275
+ }
276
+ );
277
+ }
278
+ return {
279
+ notify: notify2,
82
280
  subscribe(listener) {
83
281
  if (disposed) return () => void 0;
84
282
  listeners.add(listener);
@@ -102,12 +300,48 @@ function createFeedbackBus(options = {}) {
102
300
  dismissListeners.delete(listener);
103
301
  };
104
302
  },
303
+ notificationState,
304
+ subscribeNotificationState(listener) {
305
+ deliver(/* @__PURE__ */ new Set([listener]), notificationState());
306
+ if (disposed) return () => void 0;
307
+ notificationListeners.add(listener);
308
+ return () => {
309
+ notificationListeners.delete(listener);
310
+ };
311
+ },
312
+ setToastPause,
313
+ markNotificationsRead() {
314
+ unread.clear();
315
+ publishNotificationState();
316
+ },
317
+ markRead(id) {
318
+ if (unread.delete(id)) publishNotificationState();
319
+ },
320
+ suppresses,
321
+ remindLater,
105
322
  remove(id) {
106
323
  if (disposed || !notices.some((notice) => notice.id === id)) return;
324
+ cancelReminder(id);
107
325
  notices = Object.freeze(notices.filter((notice) => notice.id !== id));
326
+ unread.delete(id);
108
327
  publishRetained();
328
+ publishNotificationState();
109
329
  deliver(dismissListeners, id);
110
330
  },
331
+ dismiss(id) {
332
+ if (!disposed) deliver(dismissListeners, id);
333
+ },
334
+ clearRetained() {
335
+ if (disposed || notices.length === 0) return;
336
+ const ids = notices.map((notice) => notice.id);
337
+ for (const id of ids) cancelReminder(id);
338
+ unread.clear();
339
+ notices = Object.freeze([]);
340
+ publishRetained();
341
+ publishNotificationState();
342
+ for (const id of ids) deliver(dismissListeners, id);
343
+ },
344
+ track,
111
345
  reset,
112
346
  dispose() {
113
347
  if (disposed) return;
@@ -116,6 +350,7 @@ function createFeedbackBus(options = {}) {
116
350
  listeners.clear();
117
351
  retainedListeners.clear();
118
352
  dismissListeners.clear();
353
+ notificationListeners.clear();
119
354
  }
120
355
  };
121
356
  }
@@ -125,6 +360,8 @@ function notify(notice) {
125
360
  }
126
361
  export {
127
362
  NoticeCategory,
363
+ NoticePriority,
364
+ NoticePriorityRank,
128
365
  NoticeTone,
129
366
  createFeedbackBus,
130
367
  feedbackBus,