@vokril/ui-solid 0.27.0 → 0.28.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/CHANGELOG.md +33 -0
- package/README.md +19 -1
- package/dist/{AttributeGrid-XTVaiwLe.js → AttributeGrid-CASILa4u.js} +3 -3
- package/dist/{AttributeGrid-Qzt5LYnu.cjs → AttributeGrid-eND8YDby.cjs} +1 -1
- package/dist/{Button-U95Tz8F5.cjs → Button-Bb68ymNP.cjs} +1 -1
- package/dist/{Button-qtxB2SYf.js → Button-D-T0tyGF.js} +1 -1
- package/dist/CommandPalette-5FQRgPG9.cjs +2 -0
- package/dist/CommandPalette-Cj618AOz.js +4017 -0
- package/dist/{CopyButton-CsM8UeX5.cjs → CopyButton-B5gS2ft3.cjs} +1 -1
- package/dist/{CopyButton-NfxWzVHT.js → CopyButton-g-WSiBDZ.js} +1 -1
- package/dist/{DateRangePicker-C8IVJRT2.js → DateRangePicker-CJD9ADgB.js} +3 -3
- package/dist/{DateRangePicker-BKHxyHL4.cjs → DateRangePicker-Frc0HVxp.cjs} +1 -1
- package/dist/{GuidedTour-B61cbsdy.cjs → GuidedTour-B6q7lYhn.cjs} +1 -1
- package/dist/{GuidedTour-Dj41FCdE.js → GuidedTour-CFCvRJN4.js} +3 -3
- package/dist/{IconPicker-BZCQG8SO.cjs → IconPicker-CIbJb1ei.cjs} +1 -1
- package/dist/{IconPicker-DC9E35Ou.js → IconPicker-DYqNi5ud.js} +3 -3
- package/dist/{Modal-CaurOG_K.cjs → Modal-CY6ePolt.cjs} +1 -1
- package/dist/{Modal-DJpQqqTJ.js → Modal-NzZzHSwb.js} +2 -2
- package/dist/{PageSkeleton-DICmahMs.cjs → PageSkeleton-BPbb28-H.cjs} +1 -1
- package/dist/{PageSkeleton-C0eVQO20.js → PageSkeleton-CLnJO6uD.js} +3 -3
- package/dist/{SearchableSelect-DayP1Qs6.js → SearchableSelect-BvCm4enQ.js} +2 -2
- package/dist/{SearchableSelect-ClrAX2hK.cjs → SearchableSelect-CVqdVMOC.cjs} +1 -1
- package/dist/StatusBarNotificationBell-CJ3HuhRu.cjs +50 -0
- package/dist/{StatusBarNotificationBell-BRnCKU72.js → StatusBarNotificationBell-yryWdwyX.js} +4324 -3998
- package/dist/{Stepper-DTuchuOX.cjs → Stepper-Ci5JpLbS.cjs} +1 -1
- package/dist/{Stepper-aiuAdbkl.js → Stepper-D9i1Xclm.js} +1 -1
- package/dist/{TimeSeriesChart-SHx_cp8y.js → TimeSeriesChart-DOwi2lJs.js} +1 -1
- package/dist/{TimeSeriesChart-CvU0lxar.cjs → TimeSeriesChart-huvheefm.cjs} +1 -1
- package/dist/{ToggleButton-BcHNAGPy.cjs → ToggleButton-BFWh1_o5.cjs} +1 -1
- package/dist/{ToggleButton-BhP17bvW.js → ToggleButton-CFM8P3JY.js} +4 -4
- package/dist/_internal/contract/browser/workspace.d.cts +4 -0
- package/dist/_internal/contract/browser/workspace.d.ts +4 -0
- package/dist/_internal/contract/notification.d.cts +63 -4
- package/dist/_internal/contract/notification.d.ts +63 -4
- package/dist/_internal/contract/notificationCatalog.d.cts +7 -1
- package/dist/_internal/contract/notificationCatalog.d.ts +7 -1
- package/dist/base.css +4 -7
- package/dist/charts/index.cjs +1 -1
- package/dist/charts/index.js +1 -1
- package/dist/{createDialogShellFocus-Vv3hhW-I.js → createDialogShellFocus-B4piXDU4.js} +1 -1
- package/dist/{createDialogShellFocus-CsrZ2GDZ.cjs → createDialogShellFocus-CJaw9-B9.cjs} +1 -1
- package/dist/{createResizableSidebar-DnHgvr7P.js → createResizableSidebar-BDUlX9-G.js} +3 -3
- package/dist/{createResizableSidebar-CeksJQ9Q.cjs → createResizableSidebar-BVJBU2kP.cjs} +1 -1
- package/dist/de-BqFZ0Ac8.cjs +1 -0
- package/dist/{server/de-CEltsqV5.js → de-q3NXnC0J.js} +27 -25
- package/dist/desktop/index.cjs +1 -1
- package/dist/desktop/index.js +1 -1
- package/dist/feedback/index.cjs +1 -1
- package/dist/feedback/index.js +2 -2
- package/dist/forms/index.cjs +1 -1
- package/dist/forms/index.js +7 -7
- package/dist/grid/index.cjs +1 -1
- package/dist/grid/index.js +1 -1
- package/dist/host/index.cjs +1 -1
- package/dist/host/index.js +1 -1
- package/dist/i18n/index.cjs +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/messageKeys.d.cts +1 -1
- package/dist/i18n/messageKeys.d.ts +1 -1
- package/dist/{i18n-DW9kcu0G.js → i18n-CBlUGOyu.js} +2 -2
- package/dist/{server/i18n-DZ0JlZal.cjs → i18n-D3s-a2a0.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +199 -196
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.js +2 -2
- package/dist/navigation/index.cjs +1 -1
- package/dist/navigation/index.js +1 -1
- package/dist/notifications/NotificationItem.d.cts +15 -1
- package/dist/notifications/NotificationItem.d.ts +15 -1
- package/dist/notifications/RunningProgressCards.d.cts +20 -0
- package/dist/notifications/RunningProgressCards.d.ts +20 -0
- package/dist/notifications/StatusBarNotificationBell.d.cts +17 -5
- package/dist/notifications/StatusBarNotificationBell.d.ts +17 -5
- package/dist/notifications/createNotificationPreviewRuntime.d.cts +2 -2
- package/dist/notifications/createNotificationPreviewRuntime.d.ts +2 -2
- package/dist/notifications/dismissableToastIds.d.cts +4 -1
- package/dist/notifications/dismissableToastIds.d.ts +4 -1
- package/dist/notifications/fireNotification.d.cts +33 -1
- package/dist/notifications/fireNotification.d.ts +33 -1
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.d.cts +1 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/index.js +43 -40
- package/dist/notifications/nativeEngine.d.cts +88 -5
- package/dist/notifications/nativeEngine.d.ts +88 -5
- package/dist/notifications/notificationCardServices.d.cts +4 -1
- package/dist/notifications/notificationCardServices.d.ts +4 -1
- package/dist/notifications/notificationCommands.d.cts +16 -4
- package/dist/notifications/notificationCommands.d.ts +16 -4
- package/dist/notifications/notificationOverlaySnapshot.d.cts +1 -0
- package/dist/notifications/notificationOverlaySnapshot.d.ts +1 -0
- package/dist/notifications/notificationService.d.cts +26 -0
- package/dist/notifications/notificationService.d.ts +26 -0
- package/dist/notifications/quietHours.d.cts +10 -0
- package/dist/notifications/quietHours.d.ts +10 -0
- package/dist/notifications/toast.d.cts +32 -1
- package/dist/notifications/toast.d.ts +32 -1
- package/dist/overlay/ConfirmDialog.d.cts +68 -2
- package/dist/overlay/ConfirmDialog.d.ts +68 -2
- package/dist/overlay/index.cjs +1 -1
- package/dist/overlay/index.js +4 -4
- package/dist/{rowSource-C43bEUD4.js → rowSource-D__7o4h0.js} +1 -1
- package/dist/{rowSource-Dg-jndEu.cjs → rowSource-DiwTu_r8.cjs} +1 -1
- package/dist/server/{AttributeGrid-C_CvCXpC.cjs → AttributeGrid-B7sb3btp.cjs} +1 -1
- package/dist/server/{AttributeGrid-D8QYVZDq.js → AttributeGrid-CMi-UtWb.js} +3 -3
- package/dist/server/{Button-VKl-_GaO.cjs → Button-0AXWRw9Q.cjs} +1 -1
- package/dist/server/{Button-BPNNFcHc.js → Button-3yNrnn4P.js} +1 -1
- package/dist/server/{CommandPalette-COVjWlx9.js → CommandPalette-CozogFlk.js} +980 -947
- package/dist/server/CommandPalette-DQK6N98N.cjs +1 -0
- package/dist/server/{CopyButton-HDffWzaN.js → CopyButton-B6xd9Z6j.js} +1 -1
- package/dist/server/{CopyButton-rWDnbTBF.cjs → CopyButton-D8IN6Vnd.cjs} +1 -1
- package/dist/server/{DateRangePicker-Dl3zr-PD.js → DateRangePicker-C35q8BTw.js} +2 -2
- package/dist/server/{DateRangePicker-Dq0HGz27.cjs → DateRangePicker-KLZzyuPJ.cjs} +1 -1
- package/dist/server/{GuidedTour-BoPGRyX5.cjs → GuidedTour-DfV0yzqh.cjs} +1 -1
- package/dist/server/{GuidedTour-CIlHyRcR.js → GuidedTour-DmLbBttx.js} +3 -3
- package/dist/server/{IconPicker-BDS92veL.cjs → IconPicker-B1soopAp.cjs} +1 -1
- package/dist/server/{IconPicker-CZxYKJOT.js → IconPicker-B4aXspLw.js} +4 -4
- package/dist/server/{Modal-j54-C2Md.js → Modal-BheFQLs1.js} +2 -2
- package/dist/server/{Modal-CtJFoR96.cjs → Modal-BswxV8Pn.cjs} +1 -1
- package/dist/server/{PageSkeleton-B0V43uDV.cjs → PageSkeleton-DBo7hQq-.cjs} +1 -1
- package/dist/server/{PageSkeleton-BfGfda9G.js → PageSkeleton-DoxlE_bD.js} +3 -3
- package/dist/server/{SearchableSelect-ClQzcYdL.cjs → SearchableSelect-09ECcDlB.cjs} +1 -1
- package/dist/server/{SearchableSelect-DtcMC7Xu.js → SearchableSelect-vjhS4c-H.js} +2 -2
- package/dist/server/{StatusBarNotificationBell-FFpOkyUk.js → StatusBarNotificationBell-DdAdsduo.js} +4340 -4011
- package/dist/server/StatusBarNotificationBell-Z2LmIkM1.cjs +49 -0
- package/dist/server/{Stepper-CCEItuZb.cjs → Stepper-DxNrskdq.cjs} +1 -1
- package/dist/server/{Stepper-B7wf8h9G.js → Stepper-n5f9r-ye.js} +1 -1
- package/dist/server/{TimeSeriesChart-TsaZS7YU.cjs → TimeSeriesChart-BQVXUFoj.cjs} +1 -1
- package/dist/server/{TimeSeriesChart-DjNQiCn_.js → TimeSeriesChart-PAb95s6x.js} +1 -1
- package/dist/server/{ToggleButton-CHaIvApv.js → ToggleButton-FywO2CCI.js} +3 -3
- package/dist/server/{ToggleButton-D6Tux9wG.cjs → ToggleButton-TE3Xf2yD.cjs} +1 -1
- package/dist/server/charts/index.cjs +1 -1
- package/dist/server/charts/index.js +1 -1
- package/dist/server/{createResizableSidebar-Dn9UMUf_.js → createResizableSidebar-BImbKlLe.js} +3 -3
- package/dist/server/{createResizableSidebar-B0NDaq7D.cjs → createResizableSidebar-GFgZIj-5.cjs} +1 -1
- package/dist/server/de-BqFZ0Ac8.cjs +1 -0
- package/dist/{de-CEltsqV5.js → server/de-q3NXnC0J.js} +27 -25
- package/dist/server/desktop/index.cjs +1 -1
- package/dist/server/desktop/index.js +1 -1
- package/dist/server/feedback/index.cjs +1 -1
- package/dist/server/feedback/index.js +2 -2
- package/dist/server/forms/index.cjs +1 -1
- package/dist/server/forms/index.js +6 -6
- package/dist/server/grid/index.cjs +1 -1
- package/dist/server/grid/index.js +1 -1
- package/dist/server/host/index.cjs +1 -1
- package/dist/server/host/index.js +1 -1
- package/dist/server/i18n/index.cjs +1 -1
- package/dist/server/i18n/index.js +1 -1
- package/dist/server/{i18n-DW9kcu0G.js → i18n-CBlUGOyu.js} +2 -2
- package/dist/{i18n-DZ0JlZal.cjs → server/i18n-D3s-a2a0.cjs} +1 -1
- package/dist/server/{index-BfR3Xipt.cjs → index-2mQPVEDR.cjs} +1 -1
- package/dist/server/{index-Wv18Fcu8.js → index-UIjsx3oJ.js} +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.js +143 -140
- package/dist/server/layout/index.cjs +1 -1
- package/dist/server/layout/index.js +2 -2
- package/dist/server/navigation/index.cjs +1 -1
- package/dist/server/navigation/index.js +1 -1
- package/dist/server/notifications/index.cjs +1 -1
- package/dist/server/notifications/index.js +43 -40
- package/dist/server/overlay/index.cjs +1 -1
- package/dist/server/overlay/index.js +3 -3
- package/dist/server/{rowSource-CYYdnUFl.js → rowSource-D-wcDmFU.js} +1 -1
- package/dist/server/{rowSource-DoBeEg9N.cjs → rowSource-DltiY0o3.cjs} +1 -1
- package/dist/server/{tr-CxuAFkCi.js → tr-C_dUz00P.js} +32 -30
- package/dist/server/tr-D7bwe7tl.cjs +1 -0
- package/dist/server/tree/index.cjs +1 -1
- package/dist/server/tree/index.js +1 -1
- package/dist/solid/i18n/locales/de.json +2 -0
- package/dist/solid/i18n/locales/tr.json +2 -0
- package/dist/solid/notifications/NotificationHost.jsx +5 -4
- package/dist/solid/notifications/NotificationItem.jsx +40 -15
- package/dist/solid/notifications/NotificationPanel.jsx +8 -3
- package/dist/solid/notifications/NotificationsCenter.jsx +4 -1
- package/dist/solid/notifications/RunningProgressCards.jsx +29 -0
- package/dist/solid/notifications/StatusBarNotificationBell.jsx +44 -17
- package/dist/solid/notifications/StatusBarNotificationBell.module.css.js +1 -0
- package/dist/solid/notifications/catalogAdapter.js +2 -1
- package/dist/solid/notifications/createNotificationPreviewRuntime.js +49 -35
- package/dist/solid/notifications/fireNotification.js +53 -27
- package/dist/solid/notifications/index.js +1 -1
- package/dist/solid/notifications/nativeEngine.js +129 -26
- package/dist/solid/notifications/notificationCardServices.js +1 -1
- package/dist/solid/notifications/notificationOverlaySnapshot.js +2 -0
- package/dist/solid/notifications/notificationOverlaySync.js +1 -0
- package/dist/solid/notifications/notificationService.js +46 -0
- package/dist/solid/notifications/quietHours.js +18 -0
- package/dist/solid/notifications/toast.js +30 -11
- package/dist/solid/overlay/ConfirmDialog.jsx +57 -17
- package/dist/solid/overlay/ConfirmDialog.module.css.js +1 -0
- package/dist/style.css +5 -8
- package/dist/theme.css +4 -7
- package/dist/tokens/tokens.css +4 -7
- package/dist/{tr-CxuAFkCi.js → tr-C_dUz00P.js} +32 -30
- package/dist/tr-D7bwe7tl.cjs +1 -0
- package/dist/tree/index.cjs +1 -1
- package/dist/tree/index.js +1 -1
- package/dist/ui.css +1 -1
- package/package.json +4 -6
- package/dist/CommandPalette-Bf8flX2t.cjs +0 -2
- package/dist/CommandPalette-CoIdCmZ0.js +0 -3977
- package/dist/StatusBarNotificationBell-B4v__j6s.cjs +0 -50
- package/dist/de-DRobPEJV.cjs +0 -1
- package/dist/server/CommandPalette-C_9Z8gVc.cjs +0 -1
- package/dist/server/StatusBarNotificationBell-D9oc6WVf.cjs +0 -49
- package/dist/server/de-DRobPEJV.cjs +0 -1
- package/dist/server/tr-BDbiY5YD.cjs +0 -1
- package/dist/tr-BDbiY5YD.cjs +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { NotificationAnnouncement, NotificationPriority, NotificationSeverity } from '../_internal/contract/notification.cjs';
|
|
1
|
+
import type { NotificationAnnouncement, NotificationCardState, NotificationPriority, NotificationSeverity } from '../_internal/contract/notification.cjs';
|
|
2
2
|
import type { VendorErrorRef } from '../_internal/contract/vendorErrorRef.cjs';
|
|
3
3
|
import type { NotificationSettings } from '../_internal/platform/settings/settingsTypes.cjs';
|
|
4
|
+
import { type Event } from '../_internal/base/event.cjs';
|
|
4
5
|
export type { NotificationSeverity };
|
|
5
6
|
export interface NotificationAction {
|
|
6
7
|
id?: string;
|
|
@@ -44,6 +45,12 @@ export interface NotificationInput extends NotificationInputBase {
|
|
|
44
45
|
actions?: NotificationAction[];
|
|
45
46
|
/** When set, the gear menu offers a "Don't show again" toggle keyed by this id. */
|
|
46
47
|
neverShowAgainKey?: string;
|
|
48
|
+
/**
|
|
49
|
+
* The key "remind me later" on this card silences. A verb whose card's title moves away from the text it was issued
|
|
50
|
+
* with (a progress's `update`) sets it, so the menu silences the next issue of that text — the key the issue's
|
|
51
|
+
* decision checks; unset, the card derives it from its title. A `neverShowAgainKey` still wins.
|
|
52
|
+
*/
|
|
53
|
+
remindKey?: string;
|
|
47
54
|
progress?: NotificationProgress;
|
|
48
55
|
/** Opaque route token consumed by the workspace shell when the user
|
|
49
56
|
* clicks the toast body (away from any anchor/button). The shell maps
|
|
@@ -62,22 +69,53 @@ export interface NotificationItem extends NotificationInput {
|
|
|
62
69
|
expanded: boolean;
|
|
63
70
|
hovered: boolean;
|
|
64
71
|
focused: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* The card is off the toast stack while its progress runs — the user sent it away (Escape, the native overlay's
|
|
74
|
+
* close), or a setting that silences it took it back or was on when it was issued. It lives on in
|
|
75
|
+
* the notification center, its handles still `open`, until the progress ends (the card is back on the toast stack
|
|
76
|
+
* with its outcome, newest, unless a silencing setting ends it then), an issue under its id is shown, or its program
|
|
77
|
+
* closes it. Only a running card is ever hidden ({@link isProgressRunning}), and only a mounted center draws it
|
|
78
|
+
* (`NotificationsCenter`, `NotificationPanel`): a window that mounts none has no way to the card until then.
|
|
79
|
+
*/
|
|
80
|
+
hidden?: boolean;
|
|
65
81
|
}
|
|
66
82
|
export interface NotificationHandle {
|
|
67
83
|
id: string;
|
|
68
84
|
update(patch: Partial<NotificationInput>): void;
|
|
69
85
|
setProgress(progress: NotificationProgress): void;
|
|
70
86
|
close(): void;
|
|
87
|
+
/** Where the card this handle opened, or joined under its id, is now (see `NotificationCardState`). */
|
|
88
|
+
state(): NotificationCardState;
|
|
89
|
+
/**
|
|
90
|
+
* Fires once, when that card ends — it leaves the engine, which a running progress sent off the toast stack has not
|
|
91
|
+
* (it is still `open`, in the notification center) —, with where it went.
|
|
92
|
+
*/
|
|
93
|
+
readonly onDidChangeState: Event<NotificationCardState>;
|
|
71
94
|
}
|
|
72
95
|
/**
|
|
73
|
-
* What the engine needs from its owner — the settings it times toasts by, where an auto-fade is counted
|
|
74
|
-
*
|
|
75
|
-
* drives them.
|
|
96
|
+
* What the engine needs from its owner — the settings it times toasts by, where an auto-fade is counted,
|
|
97
|
+
* where a failing listener is reported, and which cards the notification settings silence. The clock and
|
|
98
|
+
* the timers are the platform's unless a test drives them.
|
|
76
99
|
*/
|
|
77
100
|
export interface NativeNotificationEngineDependencies {
|
|
78
101
|
readonly getSettings: () => NotificationSettings;
|
|
79
102
|
readonly recordAutoFade: (source: string) => void;
|
|
80
103
|
readonly warn: (message: string, error: unknown) => void;
|
|
104
|
+
/**
|
|
105
|
+
* Whether the notification settings keep this card off the toast stack now — the owner's question, the one its
|
|
106
|
+
* take-back asks too ({@link NativeNotificationEngine.suppress}), so the two cannot disagree. A running progress
|
|
107
|
+
* issued under it lives in the notification center (`hidden`), and the write that ends its progress under it takes
|
|
108
|
+
* the card back (`suppressed`) instead of bringing it on the stack. Unset, the settings silence no card.
|
|
109
|
+
*/
|
|
110
|
+
readonly isSilenced?: (item: NotificationItem) => boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Whether the user turned this card's notification down — "don't show again", "remind me later", the owner's key
|
|
113
|
+
* stores that the card's gear menu writes. A running progress is not the user's to end, but one whose notification
|
|
114
|
+
* they turned down is: their close of it ({@link NativeNotificationEngine.dismiss}) ends it instead of sending it to
|
|
115
|
+
* the notification center, from where its outcome would come back as a toast of a notification they turned down.
|
|
116
|
+
* Unset, the user turns no card down.
|
|
117
|
+
*/
|
|
118
|
+
readonly isTurnedDown?: (item: NotificationItem) => boolean;
|
|
81
119
|
readonly now?: () => number;
|
|
82
120
|
readonly setTimeout?: (callback: () => void, timeoutMs: number) => number;
|
|
83
121
|
readonly clearTimeout?: (handle: number) => void;
|
|
@@ -88,7 +126,38 @@ export interface NativeNotificationEngine {
|
|
|
88
126
|
readonly setHover: (id: string, hovered: boolean) => void;
|
|
89
127
|
readonly setFocus: (id: string, focused: boolean) => void;
|
|
90
128
|
readonly toggleExpanded: (id: string) => void;
|
|
129
|
+
/**
|
|
130
|
+
* The program closes a card — its handle, the stack by its id, one of its actions that does not keep it (an action
|
|
131
|
+
* answers the card, it does not send it away): its handles report `closed`.
|
|
132
|
+
*/
|
|
91
133
|
readonly close: (id: string) => void;
|
|
134
|
+
/**
|
|
135
|
+
* The user sends a card away — its close button, Escape, Delete, a gear-menu choice, the native overlay's close: the
|
|
136
|
+
* card closes and its handles report `dismissed`. A card whose progress runs is not the user's to end
|
|
137
|
+
* ({@link isProgressRunning}): it only leaves the toast stack and lives on in the notification center (`hidden`), its
|
|
138
|
+
* handles still `open` — unless the user turned its notification down
|
|
139
|
+
* ({@link NativeNotificationEngineDependencies.isTurnedDown}): the gear menu's "don't show again" and "remind me
|
|
140
|
+
* later", on the stack's card or a center's copy, end it (`dismissed`), as the reference's "Don't Show Again" closes
|
|
141
|
+
* its notification (`workbench/services/notification/common/notificationService.ts:207-217`) and a chosen button
|
|
142
|
+
* expires a running progress (`notificationsViewer.ts:519-529`).
|
|
143
|
+
*/
|
|
144
|
+
readonly dismiss: (id: string) => void;
|
|
145
|
+
/**
|
|
146
|
+
* Takes back from the toast stack the cards `silenced` picks — the notification settings no longer let them on it. A
|
|
147
|
+
* card whose progress runs is not the settings' to end either: it goes to the notification center (`hidden`), its
|
|
148
|
+
* handles still `open`, as the reference removes the toasts and keeps the notifications in its center
|
|
149
|
+
* (`notificationsToasts.ts:143-153`); every other card closes and its handles report `suppressed`. A card the center
|
|
150
|
+
* already holds stays there. The stack changes once for all of them.
|
|
151
|
+
*/
|
|
152
|
+
readonly suppress: (silenced: (item: NotificationItem) => boolean) => void;
|
|
153
|
+
/**
|
|
154
|
+
* An issue under `id` got no card — the user turned it down on such a card ("don't show again", "remind me later"),
|
|
155
|
+
* or it is an acknowledgment the master switch silences, which the notification center does not hold: the card an
|
|
156
|
+
* earlier issue opened under that id ends with it and its handles report `suppressed` — a running progress too, since
|
|
157
|
+
* its program now holds the new issue's handle and nothing drives the card. An acknowledgment on the screen stays: it
|
|
158
|
+
* is answered, never taken away.
|
|
159
|
+
*/
|
|
160
|
+
readonly reject: (id: string) => void;
|
|
92
161
|
readonly dispose: () => void;
|
|
93
162
|
}
|
|
94
163
|
/**
|
|
@@ -120,10 +189,24 @@ export declare function isNotificationSticky(item: Pick<NotificationItem, 'stick
|
|
|
120
189
|
errorsAlwaysSticky: boolean;
|
|
121
190
|
warningsAlwaysSticky: boolean;
|
|
122
191
|
}): boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Whether the card's progress runs — the operation behind it ends such a card, not the user and not a setting: it has
|
|
194
|
+
* no close button, Delete leaves it, and Escape, any other close of the user's or a setting that silences it only
|
|
195
|
+
* sends it to the notification center (reference `notificationsViewer.ts:492-495`, `notificationsCommands.ts:138-141`,
|
|
196
|
+
* `notificationsToasts.ts:481-489` and `:143-153`). Only the user's turning its notification down ends it
|
|
197
|
+
* ({@link NativeNotificationEngine.dismiss}). A developer preview's progress (`isolated`: the catalog's preview toast,
|
|
198
|
+
* the preview runtime's cards) has no operation behind it and closes like any card.
|
|
199
|
+
*/
|
|
200
|
+
export declare function isProgressRunning(item: Pick<NotificationItem, 'progress' | 'isolated'>): boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Whether the card is on the toast stack: an acknowledgment takes the modal layer instead, and a hidden card lives in
|
|
203
|
+
* the notification center. The host paints these cards, and the engine clips the same ones to the visible cap.
|
|
204
|
+
*/
|
|
205
|
+
export declare function isOnToastStack(item: Pick<NotificationItem, 'priority' | 'hidden'>): boolean;
|
|
123
206
|
/**
|
|
124
207
|
* Creates an in-memory engine — the notification service's toast stack, or a preview's isolated one.
|
|
125
208
|
* There is no module engine: whoever shows toasts owns one.
|
|
126
209
|
*/
|
|
127
210
|
export declare function createNativeNotificationEngine(dependencies: NativeNotificationEngineDependencies): NativeNotificationEngine;
|
|
128
211
|
/** The toast stack as its surfaces drive it — everything of the engine but its disposal. */
|
|
129
|
-
export type NotificationStack = Pick<NativeNotificationEngine, 'subscribe' | 'setHover' | 'setFocus' | 'toggleExpanded' | 'close'>;
|
|
212
|
+
export type NotificationStack = Pick<NativeNotificationEngine, 'subscribe' | 'setHover' | 'setFocus' | 'toggleExpanded' | 'close' | 'dismiss'>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { NotificationAnnouncement, NotificationPriority, NotificationSeverity } from '../_internal/contract/notification.js';
|
|
1
|
+
import type { NotificationAnnouncement, NotificationCardState, NotificationPriority, NotificationSeverity } from '../_internal/contract/notification.js';
|
|
2
2
|
import type { VendorErrorRef } from '../_internal/contract/vendorErrorRef.js';
|
|
3
3
|
import type { NotificationSettings } from '../_internal/platform/settings/settingsTypes.js';
|
|
4
|
+
import { type Event } from '../_internal/base/event.js';
|
|
4
5
|
export type { NotificationSeverity };
|
|
5
6
|
export interface NotificationAction {
|
|
6
7
|
id?: string;
|
|
@@ -44,6 +45,12 @@ export interface NotificationInput extends NotificationInputBase {
|
|
|
44
45
|
actions?: NotificationAction[];
|
|
45
46
|
/** When set, the gear menu offers a "Don't show again" toggle keyed by this id. */
|
|
46
47
|
neverShowAgainKey?: string;
|
|
48
|
+
/**
|
|
49
|
+
* The key "remind me later" on this card silences. A verb whose card's title moves away from the text it was issued
|
|
50
|
+
* with (a progress's `update`) sets it, so the menu silences the next issue of that text — the key the issue's
|
|
51
|
+
* decision checks; unset, the card derives it from its title. A `neverShowAgainKey` still wins.
|
|
52
|
+
*/
|
|
53
|
+
remindKey?: string;
|
|
47
54
|
progress?: NotificationProgress;
|
|
48
55
|
/** Opaque route token consumed by the workspace shell when the user
|
|
49
56
|
* clicks the toast body (away from any anchor/button). The shell maps
|
|
@@ -62,22 +69,53 @@ export interface NotificationItem extends NotificationInput {
|
|
|
62
69
|
expanded: boolean;
|
|
63
70
|
hovered: boolean;
|
|
64
71
|
focused: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* The card is off the toast stack while its progress runs — the user sent it away (Escape, the native overlay's
|
|
74
|
+
* close), or a setting that silences it took it back or was on when it was issued. It lives on in
|
|
75
|
+
* the notification center, its handles still `open`, until the progress ends (the card is back on the toast stack
|
|
76
|
+
* with its outcome, newest, unless a silencing setting ends it then), an issue under its id is shown, or its program
|
|
77
|
+
* closes it. Only a running card is ever hidden ({@link isProgressRunning}), and only a mounted center draws it
|
|
78
|
+
* (`NotificationsCenter`, `NotificationPanel`): a window that mounts none has no way to the card until then.
|
|
79
|
+
*/
|
|
80
|
+
hidden?: boolean;
|
|
65
81
|
}
|
|
66
82
|
export interface NotificationHandle {
|
|
67
83
|
id: string;
|
|
68
84
|
update(patch: Partial<NotificationInput>): void;
|
|
69
85
|
setProgress(progress: NotificationProgress): void;
|
|
70
86
|
close(): void;
|
|
87
|
+
/** Where the card this handle opened, or joined under its id, is now (see `NotificationCardState`). */
|
|
88
|
+
state(): NotificationCardState;
|
|
89
|
+
/**
|
|
90
|
+
* Fires once, when that card ends — it leaves the engine, which a running progress sent off the toast stack has not
|
|
91
|
+
* (it is still `open`, in the notification center) —, with where it went.
|
|
92
|
+
*/
|
|
93
|
+
readonly onDidChangeState: Event<NotificationCardState>;
|
|
71
94
|
}
|
|
72
95
|
/**
|
|
73
|
-
* What the engine needs from its owner — the settings it times toasts by, where an auto-fade is counted
|
|
74
|
-
*
|
|
75
|
-
* drives them.
|
|
96
|
+
* What the engine needs from its owner — the settings it times toasts by, where an auto-fade is counted,
|
|
97
|
+
* where a failing listener is reported, and which cards the notification settings silence. The clock and
|
|
98
|
+
* the timers are the platform's unless a test drives them.
|
|
76
99
|
*/
|
|
77
100
|
export interface NativeNotificationEngineDependencies {
|
|
78
101
|
readonly getSettings: () => NotificationSettings;
|
|
79
102
|
readonly recordAutoFade: (source: string) => void;
|
|
80
103
|
readonly warn: (message: string, error: unknown) => void;
|
|
104
|
+
/**
|
|
105
|
+
* Whether the notification settings keep this card off the toast stack now — the owner's question, the one its
|
|
106
|
+
* take-back asks too ({@link NativeNotificationEngine.suppress}), so the two cannot disagree. A running progress
|
|
107
|
+
* issued under it lives in the notification center (`hidden`), and the write that ends its progress under it takes
|
|
108
|
+
* the card back (`suppressed`) instead of bringing it on the stack. Unset, the settings silence no card.
|
|
109
|
+
*/
|
|
110
|
+
readonly isSilenced?: (item: NotificationItem) => boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Whether the user turned this card's notification down — "don't show again", "remind me later", the owner's key
|
|
113
|
+
* stores that the card's gear menu writes. A running progress is not the user's to end, but one whose notification
|
|
114
|
+
* they turned down is: their close of it ({@link NativeNotificationEngine.dismiss}) ends it instead of sending it to
|
|
115
|
+
* the notification center, from where its outcome would come back as a toast of a notification they turned down.
|
|
116
|
+
* Unset, the user turns no card down.
|
|
117
|
+
*/
|
|
118
|
+
readonly isTurnedDown?: (item: NotificationItem) => boolean;
|
|
81
119
|
readonly now?: () => number;
|
|
82
120
|
readonly setTimeout?: (callback: () => void, timeoutMs: number) => number;
|
|
83
121
|
readonly clearTimeout?: (handle: number) => void;
|
|
@@ -88,7 +126,38 @@ export interface NativeNotificationEngine {
|
|
|
88
126
|
readonly setHover: (id: string, hovered: boolean) => void;
|
|
89
127
|
readonly setFocus: (id: string, focused: boolean) => void;
|
|
90
128
|
readonly toggleExpanded: (id: string) => void;
|
|
129
|
+
/**
|
|
130
|
+
* The program closes a card — its handle, the stack by its id, one of its actions that does not keep it (an action
|
|
131
|
+
* answers the card, it does not send it away): its handles report `closed`.
|
|
132
|
+
*/
|
|
91
133
|
readonly close: (id: string) => void;
|
|
134
|
+
/**
|
|
135
|
+
* The user sends a card away — its close button, Escape, Delete, a gear-menu choice, the native overlay's close: the
|
|
136
|
+
* card closes and its handles report `dismissed`. A card whose progress runs is not the user's to end
|
|
137
|
+
* ({@link isProgressRunning}): it only leaves the toast stack and lives on in the notification center (`hidden`), its
|
|
138
|
+
* handles still `open` — unless the user turned its notification down
|
|
139
|
+
* ({@link NativeNotificationEngineDependencies.isTurnedDown}): the gear menu's "don't show again" and "remind me
|
|
140
|
+
* later", on the stack's card or a center's copy, end it (`dismissed`), as the reference's "Don't Show Again" closes
|
|
141
|
+
* its notification (`workbench/services/notification/common/notificationService.ts:207-217`) and a chosen button
|
|
142
|
+
* expires a running progress (`notificationsViewer.ts:519-529`).
|
|
143
|
+
*/
|
|
144
|
+
readonly dismiss: (id: string) => void;
|
|
145
|
+
/**
|
|
146
|
+
* Takes back from the toast stack the cards `silenced` picks — the notification settings no longer let them on it. A
|
|
147
|
+
* card whose progress runs is not the settings' to end either: it goes to the notification center (`hidden`), its
|
|
148
|
+
* handles still `open`, as the reference removes the toasts and keeps the notifications in its center
|
|
149
|
+
* (`notificationsToasts.ts:143-153`); every other card closes and its handles report `suppressed`. A card the center
|
|
150
|
+
* already holds stays there. The stack changes once for all of them.
|
|
151
|
+
*/
|
|
152
|
+
readonly suppress: (silenced: (item: NotificationItem) => boolean) => void;
|
|
153
|
+
/**
|
|
154
|
+
* An issue under `id` got no card — the user turned it down on such a card ("don't show again", "remind me later"),
|
|
155
|
+
* or it is an acknowledgment the master switch silences, which the notification center does not hold: the card an
|
|
156
|
+
* earlier issue opened under that id ends with it and its handles report `suppressed` — a running progress too, since
|
|
157
|
+
* its program now holds the new issue's handle and nothing drives the card. An acknowledgment on the screen stays: it
|
|
158
|
+
* is answered, never taken away.
|
|
159
|
+
*/
|
|
160
|
+
readonly reject: (id: string) => void;
|
|
92
161
|
readonly dispose: () => void;
|
|
93
162
|
}
|
|
94
163
|
/**
|
|
@@ -120,10 +189,24 @@ export declare function isNotificationSticky(item: Pick<NotificationItem, 'stick
|
|
|
120
189
|
errorsAlwaysSticky: boolean;
|
|
121
190
|
warningsAlwaysSticky: boolean;
|
|
122
191
|
}): boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Whether the card's progress runs — the operation behind it ends such a card, not the user and not a setting: it has
|
|
194
|
+
* no close button, Delete leaves it, and Escape, any other close of the user's or a setting that silences it only
|
|
195
|
+
* sends it to the notification center (reference `notificationsViewer.ts:492-495`, `notificationsCommands.ts:138-141`,
|
|
196
|
+
* `notificationsToasts.ts:481-489` and `:143-153`). Only the user's turning its notification down ends it
|
|
197
|
+
* ({@link NativeNotificationEngine.dismiss}). A developer preview's progress (`isolated`: the catalog's preview toast,
|
|
198
|
+
* the preview runtime's cards) has no operation behind it and closes like any card.
|
|
199
|
+
*/
|
|
200
|
+
export declare function isProgressRunning(item: Pick<NotificationItem, 'progress' | 'isolated'>): boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Whether the card is on the toast stack: an acknowledgment takes the modal layer instead, and a hidden card lives in
|
|
203
|
+
* the notification center. The host paints these cards, and the engine clips the same ones to the visible cap.
|
|
204
|
+
*/
|
|
205
|
+
export declare function isOnToastStack(item: Pick<NotificationItem, 'priority' | 'hidden'>): boolean;
|
|
123
206
|
/**
|
|
124
207
|
* Creates an in-memory engine — the notification service's toast stack, or a preview's isolated one.
|
|
125
208
|
* There is no module engine: whoever shows toasts owns one.
|
|
126
209
|
*/
|
|
127
210
|
export declare function createNativeNotificationEngine(dependencies: NativeNotificationEngineDependencies): NativeNotificationEngine;
|
|
128
211
|
/** The toast stack as its surfaces drive it — everything of the engine but its disposal. */
|
|
129
|
-
export type NotificationStack = Pick<NativeNotificationEngine, 'subscribe' | 'setHover' | 'setFocus' | 'toggleExpanded' | 'close'>;
|
|
212
|
+
export type NotificationStack = Pick<NativeNotificationEngine, 'subscribe' | 'setHover' | 'setFocus' | 'toggleExpanded' | 'close' | 'dismiss'>;
|
|
@@ -11,7 +11,10 @@ import type { NotificationSettings } from '../_internal/platform/settings/settin
|
|
|
11
11
|
import type { NotificationItemController, NotificationItemShell } from './NotificationItem.cjs';
|
|
12
12
|
/**
|
|
13
13
|
* The card's own verbs over the realm's toast stack. `settings` is the stack's tracked copy of the
|
|
14
|
-
* notification settings, so a card's timer follows a change of the default duration at once.
|
|
14
|
+
* notification settings, so a card's timer follows a change of the default duration at once. A card closes
|
|
15
|
+
* through here only by the user's hand — its close button, a gear-menu choice, the native overlay's copy of
|
|
16
|
+
* either — so it is the stack's `dismiss`: the card's handles report the user's close, and a running progress
|
|
17
|
+
* only leaves the toast stack for the notification center, unless the gear menu's choice turned it down.
|
|
15
18
|
*/
|
|
16
19
|
export declare function realmCardController(host: KitHost, settings: Accessor<NotificationSettings>): NotificationItemController;
|
|
17
20
|
/**
|
|
@@ -11,7 +11,10 @@ import type { NotificationSettings } from '../_internal/platform/settings/settin
|
|
|
11
11
|
import type { NotificationItemController, NotificationItemShell } from './NotificationItem.js';
|
|
12
12
|
/**
|
|
13
13
|
* The card's own verbs over the realm's toast stack. `settings` is the stack's tracked copy of the
|
|
14
|
-
* notification settings, so a card's timer follows a change of the default duration at once.
|
|
14
|
+
* notification settings, so a card's timer follows a change of the default duration at once. A card closes
|
|
15
|
+
* through here only by the user's hand — its close button, a gear-menu choice, the native overlay's copy of
|
|
16
|
+
* either — so it is the stack's `dismiss`: the card's handles report the user's close, and a running progress
|
|
17
|
+
* only leaves the toast stack for the notification center, unless the gear menu's choice turned it down.
|
|
15
18
|
*/
|
|
16
19
|
export declare function realmCardController(host: KitHost, settings: Accessor<NotificationSettings>): NotificationItemController;
|
|
17
20
|
/**
|
|
@@ -8,9 +8,15 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { ICommandRegistry, IKeybindingsRegistry } from '../_internal/app/keybindings/index.cjs';
|
|
10
10
|
export declare const ACCEPT_PRIMARY_ACTION_NOTIFICATION = "notification.acceptPrimaryAction";
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Close the focused toast — `Delete` (macOS `Cmd+Backspace`) while focus is in the toast stack. A running progress
|
|
13
|
+
* stays.
|
|
14
|
+
*/
|
|
12
15
|
export declare const CLEAR_NOTIFICATION = "notification.clear";
|
|
13
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Hide the dismissable toasts — `Escape` while toasts are visible. A running progress is not closed: it goes to the
|
|
18
|
+
* notification center.
|
|
19
|
+
*/
|
|
14
20
|
export declare const HIDE_NOTIFICATION_TOASTS = "notifications.hideToasts";
|
|
15
21
|
export interface NotificationCommandRegistries {
|
|
16
22
|
readonly commands: ICommandRegistry;
|
|
@@ -18,9 +24,15 @@ export interface NotificationCommandRegistries {
|
|
|
18
24
|
}
|
|
19
25
|
export interface NotificationCommandDeps {
|
|
20
26
|
readonly acceptPrimaryAction: () => void;
|
|
21
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Close the focused toast and move focus to the next one (the host's focus index); a running progress stays where
|
|
29
|
+
* it is.
|
|
30
|
+
*/
|
|
22
31
|
readonly clearFocused: () => void;
|
|
23
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Send every dismissable toast away — a running progress to the notification center, alive; acknowledgement-required
|
|
34
|
+
* ones stay (#875).
|
|
35
|
+
*/
|
|
24
36
|
readonly hideToasts: () => void;
|
|
25
37
|
}
|
|
26
38
|
export declare function registerNotificationCommands(registries: NotificationCommandRegistries, deps: NotificationCommandDeps): () => void;
|
|
@@ -8,9 +8,15 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { ICommandRegistry, IKeybindingsRegistry } from '../_internal/app/keybindings/index.js';
|
|
10
10
|
export declare const ACCEPT_PRIMARY_ACTION_NOTIFICATION = "notification.acceptPrimaryAction";
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Close the focused toast — `Delete` (macOS `Cmd+Backspace`) while focus is in the toast stack. A running progress
|
|
13
|
+
* stays.
|
|
14
|
+
*/
|
|
12
15
|
export declare const CLEAR_NOTIFICATION = "notification.clear";
|
|
13
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Hide the dismissable toasts — `Escape` while toasts are visible. A running progress is not closed: it goes to the
|
|
18
|
+
* notification center.
|
|
19
|
+
*/
|
|
14
20
|
export declare const HIDE_NOTIFICATION_TOASTS = "notifications.hideToasts";
|
|
15
21
|
export interface NotificationCommandRegistries {
|
|
16
22
|
readonly commands: ICommandRegistry;
|
|
@@ -18,9 +24,15 @@ export interface NotificationCommandRegistries {
|
|
|
18
24
|
}
|
|
19
25
|
export interface NotificationCommandDeps {
|
|
20
26
|
readonly acceptPrimaryAction: () => void;
|
|
21
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Close the focused toast and move focus to the next one (the host's focus index); a running progress stays where
|
|
29
|
+
* it is.
|
|
30
|
+
*/
|
|
22
31
|
readonly clearFocused: () => void;
|
|
23
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Send every dismissable toast away — a running progress to the notification center, alive; acknowledgement-required
|
|
34
|
+
* ones stay (#875).
|
|
35
|
+
*/
|
|
24
36
|
readonly hideToasts: () => void;
|
|
25
37
|
}
|
|
26
38
|
export declare function registerNotificationCommands(registries: NotificationCommandRegistries, deps: NotificationCommandDeps): () => void;
|
|
@@ -44,6 +44,7 @@ export declare function overlayStateOf(input: {
|
|
|
44
44
|
readonly sequence: number;
|
|
45
45
|
readonly reduceMotion: boolean;
|
|
46
46
|
readonly animationDuration: 'fast' | 'normal' | 'slow';
|
|
47
|
+
readonly remindLaterEnabled: boolean;
|
|
47
48
|
readonly bounds: NotificationOverlayBounds | undefined;
|
|
48
49
|
readonly clipBounds: NotificationOverlayBounds | undefined;
|
|
49
50
|
readonly items: readonly NotificationOverlayItem[];
|
|
@@ -44,6 +44,7 @@ export declare function overlayStateOf(input: {
|
|
|
44
44
|
readonly sequence: number;
|
|
45
45
|
readonly reduceMotion: boolean;
|
|
46
46
|
readonly animationDuration: 'fast' | 'normal' | 'slow';
|
|
47
|
+
readonly remindLaterEnabled: boolean;
|
|
47
48
|
readonly bounds: NotificationOverlayBounds | undefined;
|
|
48
49
|
readonly clipBounds: NotificationOverlayBounds | undefined;
|
|
49
50
|
readonly items: readonly NotificationOverlayItem[];
|
|
@@ -85,6 +85,10 @@ export declare class NotificationService implements Notifications, IDisposable {
|
|
|
85
85
|
private readonly navigation;
|
|
86
86
|
private readonly log;
|
|
87
87
|
private readonly onSettingsChanged;
|
|
88
|
+
private readonly stopWatchingCards;
|
|
89
|
+
/** The start of quiet hours is watched while the stack has cards ({@link watchQuietHoursStart}). */
|
|
90
|
+
private watchingQuietHours;
|
|
91
|
+
private quietHoursTimer;
|
|
88
92
|
constructor(deps: NotificationServiceDependencies);
|
|
89
93
|
notify<TParams>(definition: NotificationDefinition<TParams, 'message' | 'query-completed'>, params: NoInfer<TParams>): string;
|
|
90
94
|
progress<TParams>(definition: NotificationDefinition<TParams, 'progress'>, params: NoInfer<TParams>): ToastProgressHandle;
|
|
@@ -96,6 +100,28 @@ export declare class NotificationService implements Notifications, IDisposable {
|
|
|
96
100
|
resetStats(): void;
|
|
97
101
|
requestNavigation(route: string): void;
|
|
98
102
|
dispose(): void;
|
|
103
|
+
/**
|
|
104
|
+
* The shown cards the notification settings now silence ({@link silencedCard}) are taken back from the toast stack
|
|
105
|
+
* — do not disturb, quiet hours, a muted source, the master switch, "urgent to the center only": the decision an
|
|
106
|
+
* issue would get now. A running progress is not the settings' to end: it goes to the notification center, its
|
|
107
|
+
* handles still `open`, as the reference removes the toast and keeps the notification in its center; the other cards
|
|
108
|
+
* close and their handles report `suppressed`, the timeline keeping their records.
|
|
109
|
+
*
|
|
110
|
+
* The reference reacts to the same moment (`notificationsToasts.ts:143-153`) under its own policy, which the kit
|
|
111
|
+
* does not share: its do not disturb (the error-only filter) hides every toast, urgent ones and errors too, and a
|
|
112
|
+
* source's filter spares that source's errors and urgent cards. The kit takes back what its issue decision
|
|
113
|
+
* (`decideFilter`) silences: do not disturb and quiet hours spare urgent cards (unless `dndBlocksUrgent` /
|
|
114
|
+
* `quietHoursBlocksUrgent`), and a muted source loses its errors too — only urgent cards pass a mute.
|
|
115
|
+
*/
|
|
116
|
+
private takeBackSilencedCards;
|
|
117
|
+
/**
|
|
118
|
+
* Quiet hours are scheduled do-not-disturb, but no settings change marks the moment they begin: a timer takes the
|
|
119
|
+
* silenced cards back then, as when do not disturb is switched on. It runs only while the stack has cards — the
|
|
120
|
+
* settings are read once a card is shown, never before the realm has hydrated them — and a long wait is read again
|
|
121
|
+
* every hour, since the clock can move under it (a time-zone or daylight-saving change, a sleep).
|
|
122
|
+
*/
|
|
123
|
+
private watchQuietHoursStart;
|
|
124
|
+
private stopWatchingQuietHours;
|
|
99
125
|
/** A desktop call the service does not wait for — its failure is logged, not thrown. */
|
|
100
126
|
private unawaited;
|
|
101
127
|
}
|
|
@@ -85,6 +85,10 @@ export declare class NotificationService implements Notifications, IDisposable {
|
|
|
85
85
|
private readonly navigation;
|
|
86
86
|
private readonly log;
|
|
87
87
|
private readonly onSettingsChanged;
|
|
88
|
+
private readonly stopWatchingCards;
|
|
89
|
+
/** The start of quiet hours is watched while the stack has cards ({@link watchQuietHoursStart}). */
|
|
90
|
+
private watchingQuietHours;
|
|
91
|
+
private quietHoursTimer;
|
|
88
92
|
constructor(deps: NotificationServiceDependencies);
|
|
89
93
|
notify<TParams>(definition: NotificationDefinition<TParams, 'message' | 'query-completed'>, params: NoInfer<TParams>): string;
|
|
90
94
|
progress<TParams>(definition: NotificationDefinition<TParams, 'progress'>, params: NoInfer<TParams>): ToastProgressHandle;
|
|
@@ -96,6 +100,28 @@ export declare class NotificationService implements Notifications, IDisposable {
|
|
|
96
100
|
resetStats(): void;
|
|
97
101
|
requestNavigation(route: string): void;
|
|
98
102
|
dispose(): void;
|
|
103
|
+
/**
|
|
104
|
+
* The shown cards the notification settings now silence ({@link silencedCard}) are taken back from the toast stack
|
|
105
|
+
* — do not disturb, quiet hours, a muted source, the master switch, "urgent to the center only": the decision an
|
|
106
|
+
* issue would get now. A running progress is not the settings' to end: it goes to the notification center, its
|
|
107
|
+
* handles still `open`, as the reference removes the toast and keeps the notification in its center; the other cards
|
|
108
|
+
* close and their handles report `suppressed`, the timeline keeping their records.
|
|
109
|
+
*
|
|
110
|
+
* The reference reacts to the same moment (`notificationsToasts.ts:143-153`) under its own policy, which the kit
|
|
111
|
+
* does not share: its do not disturb (the error-only filter) hides every toast, urgent ones and errors too, and a
|
|
112
|
+
* source's filter spares that source's errors and urgent cards. The kit takes back what its issue decision
|
|
113
|
+
* (`decideFilter`) silences: do not disturb and quiet hours spare urgent cards (unless `dndBlocksUrgent` /
|
|
114
|
+
* `quietHoursBlocksUrgent`), and a muted source loses its errors too — only urgent cards pass a mute.
|
|
115
|
+
*/
|
|
116
|
+
private takeBackSilencedCards;
|
|
117
|
+
/**
|
|
118
|
+
* Quiet hours are scheduled do-not-disturb, but no settings change marks the moment they begin: a timer takes the
|
|
119
|
+
* silenced cards back then, as when do not disturb is switched on. It runs only while the stack has cards — the
|
|
120
|
+
* settings are read once a card is shown, never before the realm has hydrated them — and a long wait is read again
|
|
121
|
+
* every hour, since the clock can move under it (a time-zone or daylight-saving change, a sleep).
|
|
122
|
+
*/
|
|
123
|
+
private watchQuietHoursStart;
|
|
124
|
+
private stopWatchingQuietHours;
|
|
99
125
|
/** A desktop call the service does not wait for — its failure is logged, not thrown. */
|
|
100
126
|
private unawaited;
|
|
101
127
|
}
|
|
@@ -28,3 +28,13 @@ export interface QuietHoursSettings {
|
|
|
28
28
|
* the function pure).
|
|
29
29
|
*/
|
|
30
30
|
export declare function isInQuietHours(settings: QuietHoursSettings, now: Date): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The first moment after `now` that quiet hours begin — when the cards they silence are taken back, as when do not
|
|
33
|
+
* disturb is switched on. They begin only at their start time or at a midnight: {@link isInQuietHours} reads a window
|
|
34
|
+
* that crosses midnight with the day of the moment, so its after-midnight part begins on its own on a day that is on
|
|
35
|
+
* when the day before is off. Each candidate is asked of {@link isInQuietHours} itself, so the two cannot disagree.
|
|
36
|
+
* `null` when quiet hours are off or never begin within the next week.
|
|
37
|
+
*
|
|
38
|
+
* @param now The moment to look from — supplied by the caller, like {@link isInQuietHours}'s.
|
|
39
|
+
*/
|
|
40
|
+
export declare function nextQuietHoursStart(settings: QuietHoursSettings, now: Date): Date | null;
|
|
@@ -28,3 +28,13 @@ export interface QuietHoursSettings {
|
|
|
28
28
|
* the function pure).
|
|
29
29
|
*/
|
|
30
30
|
export declare function isInQuietHours(settings: QuietHoursSettings, now: Date): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The first moment after `now` that quiet hours begin — when the cards they silence are taken back, as when do not
|
|
33
|
+
* disturb is switched on. They begin only at their start time or at a midnight: {@link isInQuietHours} reads a window
|
|
34
|
+
* that crosses midnight with the day of the moment, so its after-midnight part begins on its own on a day that is on
|
|
35
|
+
* when the day before is off. Each candidate is asked of {@link isInQuietHours} itself, so the two cannot disagree.
|
|
36
|
+
* `null` when quiet hours are off or never begin within the next week.
|
|
37
|
+
*
|
|
38
|
+
* @param now The moment to look from — supplied by the caller, like {@link isInQuietHours}'s.
|
|
39
|
+
*/
|
|
40
|
+
export declare function nextQuietHoursStart(settings: QuietHoursSettings, now: Date): Date | null;
|
|
@@ -27,6 +27,11 @@ export interface ErrorToastEnrichment {
|
|
|
27
27
|
* structured reference — the message text is never probed for a code.
|
|
28
28
|
*/
|
|
29
29
|
export declare function enrichErrorToast(message: unknown, options: ToastErrorOptions, vendorMatch: VendorErrorMatch | null, onOpenDocs: (url: string) => void): ErrorToastEnrichment;
|
|
30
|
+
/**
|
|
31
|
+
* The handle of a progress that got no card — the user turned it down on a card, or a preview's settings kept it off
|
|
32
|
+
* its stack: it drives nothing and stays `suppressed`.
|
|
33
|
+
*/
|
|
34
|
+
export declare const suppressedProgressHandle: ToastProgressHandle;
|
|
30
35
|
export interface Toast {
|
|
31
36
|
success(message: unknown, options?: ToastCommonOptions): string;
|
|
32
37
|
error(message: unknown, options?: ToastErrorOptions): string;
|
|
@@ -35,7 +40,33 @@ export interface Toast {
|
|
|
35
40
|
queryCompleted(message: unknown, options?: ToastCommonOptions): string;
|
|
36
41
|
/**
|
|
37
42
|
* Long-running progress toast. Returns a handle that can `update` the message in place and then
|
|
38
|
-
* resolve as `success`/`fail
|
|
43
|
+
* resolve as `success`/`fail`, or end it with `dismiss` — the program's close. Source mutes still
|
|
44
|
+
* apply unless `priority` is `urgent`.
|
|
45
|
+
*
|
|
46
|
+
* The operation ends a running progress, not the user and not a setting:
|
|
47
|
+
* - an issue a setting silences (do not disturb, quiet hours, a muted source, the master switch,
|
|
48
|
+
* "urgent to the center only", `priority: 'silent'`) opens its card in the notification center,
|
|
49
|
+
* off the toast stack, its handle live and `open` — the reference lists a silent progress in its
|
|
50
|
+
* center and shows no toast (`workbench/services/progress/browser/progressService.ts:81-91`,
|
|
51
|
+
* `notificationsToasts.ts:203-205`); such a setting turning on sends a shown card there too;
|
|
52
|
+
* - the user's close — Escape — sends the card there as well; but turning its notification down on
|
|
53
|
+
* the card — the gear menu's "don't show again", "remind me later" — ends it (`dismissed`), as the
|
|
54
|
+
* reference's "Don't Show Again" closes its notification, so its outcome does not come back;
|
|
55
|
+
* - `success` and `fail` bring a card the center held back on the toast stack, newest, unless a
|
|
56
|
+
* setting silences it then: the card ends `suppressed` and the timeline keeps the outcome's record;
|
|
57
|
+
* - an issue the user turned down on a card ("don't show again", "remind me later") gets no card,
|
|
58
|
+
* and its handle stays `suppressed`; so does an acknowledgment the master switch silences, which
|
|
59
|
+
* the center does not hold.
|
|
60
|
+
*
|
|
61
|
+
* An explicit `id` addresses the card. An issue under the id of a card updates that card in place:
|
|
62
|
+
* its age, place and focus stay — a card the center held comes back on the toast stack, newest — and
|
|
63
|
+
* an issue a setting silences keeps the card in the center, or sends it there, still driven. An issue
|
|
64
|
+
* that gets no card — turned down, or an acknowledgment the master switch silences — ends the card
|
|
65
|
+
* under its id (`suppressed`), which nothing would drive any more; an acknowledgment on the screen
|
|
66
|
+
* stays, as it is answered, never taken away. The in-place update is the kit's own, not the
|
|
67
|
+
* reference's: its model closes an equal notification and adds the new one on top, with a new age
|
|
68
|
+
* and place (`workbench/common/notifications.ts:215-232`), and never takes a progress for an equal
|
|
69
|
+
* one (`:719-722`).
|
|
39
70
|
*/
|
|
40
71
|
progress(initialMessage: unknown, options?: ToastCommonOptions & {
|
|
41
72
|
onCancel?: () => void;
|
|
@@ -27,6 +27,11 @@ export interface ErrorToastEnrichment {
|
|
|
27
27
|
* structured reference — the message text is never probed for a code.
|
|
28
28
|
*/
|
|
29
29
|
export declare function enrichErrorToast(message: unknown, options: ToastErrorOptions, vendorMatch: VendorErrorMatch | null, onOpenDocs: (url: string) => void): ErrorToastEnrichment;
|
|
30
|
+
/**
|
|
31
|
+
* The handle of a progress that got no card — the user turned it down on a card, or a preview's settings kept it off
|
|
32
|
+
* its stack: it drives nothing and stays `suppressed`.
|
|
33
|
+
*/
|
|
34
|
+
export declare const suppressedProgressHandle: ToastProgressHandle;
|
|
30
35
|
export interface Toast {
|
|
31
36
|
success(message: unknown, options?: ToastCommonOptions): string;
|
|
32
37
|
error(message: unknown, options?: ToastErrorOptions): string;
|
|
@@ -35,7 +40,33 @@ export interface Toast {
|
|
|
35
40
|
queryCompleted(message: unknown, options?: ToastCommonOptions): string;
|
|
36
41
|
/**
|
|
37
42
|
* Long-running progress toast. Returns a handle that can `update` the message in place and then
|
|
38
|
-
* resolve as `success`/`fail
|
|
43
|
+
* resolve as `success`/`fail`, or end it with `dismiss` — the program's close. Source mutes still
|
|
44
|
+
* apply unless `priority` is `urgent`.
|
|
45
|
+
*
|
|
46
|
+
* The operation ends a running progress, not the user and not a setting:
|
|
47
|
+
* - an issue a setting silences (do not disturb, quiet hours, a muted source, the master switch,
|
|
48
|
+
* "urgent to the center only", `priority: 'silent'`) opens its card in the notification center,
|
|
49
|
+
* off the toast stack, its handle live and `open` — the reference lists a silent progress in its
|
|
50
|
+
* center and shows no toast (`workbench/services/progress/browser/progressService.ts:81-91`,
|
|
51
|
+
* `notificationsToasts.ts:203-205`); such a setting turning on sends a shown card there too;
|
|
52
|
+
* - the user's close — Escape — sends the card there as well; but turning its notification down on
|
|
53
|
+
* the card — the gear menu's "don't show again", "remind me later" — ends it (`dismissed`), as the
|
|
54
|
+
* reference's "Don't Show Again" closes its notification, so its outcome does not come back;
|
|
55
|
+
* - `success` and `fail` bring a card the center held back on the toast stack, newest, unless a
|
|
56
|
+
* setting silences it then: the card ends `suppressed` and the timeline keeps the outcome's record;
|
|
57
|
+
* - an issue the user turned down on a card ("don't show again", "remind me later") gets no card,
|
|
58
|
+
* and its handle stays `suppressed`; so does an acknowledgment the master switch silences, which
|
|
59
|
+
* the center does not hold.
|
|
60
|
+
*
|
|
61
|
+
* An explicit `id` addresses the card. An issue under the id of a card updates that card in place:
|
|
62
|
+
* its age, place and focus stay — a card the center held comes back on the toast stack, newest — and
|
|
63
|
+
* an issue a setting silences keeps the card in the center, or sends it there, still driven. An issue
|
|
64
|
+
* that gets no card — turned down, or an acknowledgment the master switch silences — ends the card
|
|
65
|
+
* under its id (`suppressed`), which nothing would drive any more; an acknowledgment on the screen
|
|
66
|
+
* stays, as it is answered, never taken away. The in-place update is the kit's own, not the
|
|
67
|
+
* reference's: its model closes an equal notification and adds the new one on top, with a new age
|
|
68
|
+
* and place (`workbench/common/notifications.ts:215-232`), and never takes a progress for an equal
|
|
69
|
+
* one (`:719-722`).
|
|
39
70
|
*/
|
|
40
71
|
progress(initialMessage: unknown, options?: ToastCommonOptions & {
|
|
41
72
|
onCancel?: () => void;
|