@vokril/ui-solid 0.27.1 → 0.29.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 +37 -0
- package/README.md +36 -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-BRnCKU72.js → StatusBarNotificationBell-7Izs_msz.js} +4936 -4585
- package/dist/StatusBarNotificationBell-BJiORN4s.cjs +50 -0
- 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 +64 -4
- package/dist/_internal/contract/notification.d.ts +64 -4
- package/dist/_internal/contract/notificationCatalog.d.cts +7 -1
- package/dist/_internal/contract/notificationCatalog.d.ts +7 -1
- 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 +250 -246
- 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 +29 -5
- package/dist/notifications/StatusBarNotificationBell.d.ts +29 -5
- package/dist/notifications/createNotificationPreviewRuntime.d.cts +2 -2
- package/dist/notifications/createNotificationPreviewRuntime.d.ts +2 -2
- package/dist/notifications/dismissableToastIds.d.cts +5 -1
- package/dist/notifications/dismissableToastIds.d.ts +5 -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 +49 -45
- package/dist/notifications/nativeEngine.d.cts +125 -5
- package/dist/notifications/nativeEngine.d.ts +125 -5
- package/dist/notifications/notificationCardServices.d.cts +5 -1
- package/dist/notifications/notificationCardServices.d.ts +5 -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 +36 -1
- package/dist/notifications/notificationService.d.ts +36 -1
- 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-D8Jt3PXI.js} +4869 -4515
- package/dist/server/StatusBarNotificationBell-LJHLMT9F.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 +183 -179
- 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 +49 -45
- 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 -14
- 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 +42 -18
- 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 +174 -31
- 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 +48 -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 +1 -1
- 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 +1 -1
- 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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../rowSource-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../rowSource-DltiY0o3.cjs");exports.DEFAULT_TREE_CAPABILITIES=e.DEFAULT_TREE_CAPABILITIES;exports.TREE_INDENT_STEP_REM=e.TREE_INDENT_STEP_REM;exports.TreeHighlight=e.TreeHighlight;exports.TreeRow=e.TreeRow;exports.TreeSurface=e.TreeSurface;exports.assertRowIndex=e.assertRowIndex;exports.buildTreeContainerAria=e.buildTreeContainerAria;exports.buildTreeRowAria=e.buildTreeRowAria;exports.buildTreeRowStructureAria=e.buildTreeRowStructureAria;exports.createTreeController=e.createTreeController;exports.createTreeSurface=e.createTreeSurface;exports.selectAllInScope=e.selectAllInScope;exports.treeRowDomId=e.treeRowDomId;exports.treeRowsFrom=e.treeRowsFrom;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as a, T as s, a as T, b as o, c as t, d as i, e as l, f as E, g as R, h as c, i as u, s as A, t as I, j as d } from "../rowSource-
|
|
1
|
+
import { D as a, T as s, a as T, b as o, c as t, d as i, e as l, f as E, g as R, h as c, i as u, s as A, t as I, j as d } from "../rowSource-D-wcDmFU.js";
|
|
2
2
|
export {
|
|
3
3
|
a as DEFAULT_TREE_CAPABILITIES,
|
|
4
4
|
s as TREE_INDENT_STEP_REM,
|
|
@@ -47,6 +47,8 @@
|
|
|
47
47
|
"Source: {source}": "Quelle: {source}",
|
|
48
48
|
"Show notifications": "Benachrichtigungen anzeigen",
|
|
49
49
|
"Notifications (Do Not Disturb on)": "Benachrichtigungen (Nicht stören aktiv)",
|
|
50
|
+
"Notifications ({count} in progress)": "Benachrichtigungen ({count} laufend)",
|
|
51
|
+
"Notifications (Do Not Disturb on, {count} in progress)": "Benachrichtigungen (Nicht stören aktiv, {count} laufend)",
|
|
50
52
|
"No new notifications": "Keine neuen Benachrichtigungen",
|
|
51
53
|
"Hide notifications": "Benachrichtigungen ausblenden",
|
|
52
54
|
"Notification settings": "Benachrichtigungseinstellungen",
|
|
@@ -47,6 +47,8 @@
|
|
|
47
47
|
"Source: {source}": "Kaynak: {source}",
|
|
48
48
|
"Show notifications": "Bildirimleri göster",
|
|
49
49
|
"Notifications (Do Not Disturb on)": "Bildirimler (Rahatsız Etme açık)",
|
|
50
|
+
"Notifications ({count} in progress)": "Bildirimler ({count} işlem sürüyor)",
|
|
51
|
+
"Notifications (Do Not Disturb on, {count} in progress)": "Bildirimler (Rahatsız Etme açık, {count} işlem sürüyor)",
|
|
50
52
|
"No new notifications": "Yeni bildirim yok",
|
|
51
53
|
"Hide notifications": "Bildirimleri gizle",
|
|
52
54
|
"Notification settings": "Bildirim ayarları",
|
|
@@ -4,6 +4,7 @@ import { createDialogShellFocus } from '../overlay/createDialogShellFocus';
|
|
|
4
4
|
import { OverlayScrollArea } from '../overlay/OverlayScrollArea';
|
|
5
5
|
import { HostPortal } from '../_internal/app/windows/window/HostPortal';
|
|
6
6
|
import { useHostWindow } from '../_internal/app/windows/window/HostWindowContext';
|
|
7
|
+
import { isOnToastStack, isProgressRunning, } from './nativeEngine';
|
|
7
8
|
import { dismissableToastIds } from './dismissableToastIds';
|
|
8
9
|
import { notificationSettings } from '../_internal/app/settings/descriptors/notification';
|
|
9
10
|
import { useSettingsSubscription } from '../_internal/app/settings/useSettingsSubscription';
|
|
@@ -35,7 +36,6 @@ export const NotificationHost = (props) => {
|
|
|
35
36
|
const [position, setPosition] = createSignal(initial.toastPosition);
|
|
36
37
|
const effectivePosition = () => position();
|
|
37
38
|
const [width, setWidth] = createSignal(initial.notificationWidth);
|
|
38
|
-
const [maxVisible, setMaxVisible] = createSignal(initial.maxVisibleNotifications);
|
|
39
39
|
const [animationDuration, setAnimationDuration] = createSignal(initial.animationDuration);
|
|
40
40
|
const [reduceMotion, setReduceMotion] = createSignal(initial.reduceMotion);
|
|
41
41
|
const [hostEl, setHostEl] = createSignal();
|
|
@@ -44,13 +44,7 @@ export const NotificationHost = (props) => {
|
|
|
44
44
|
const controller = realmCardController(host, itemSettings);
|
|
45
45
|
const shell = realmNotificationShell(host);
|
|
46
46
|
const ackItems = () => store.items.filter((it) => it.priority === 'acknowledgment-required');
|
|
47
|
-
const visible = () =>
|
|
48
|
-
const cap = Math.max(1, maxVisible());
|
|
49
|
-
const items = store.items.filter((it) => it.priority !== 'acknowledgment-required');
|
|
50
|
-
if (items.length <= cap)
|
|
51
|
-
return items;
|
|
52
|
-
return items.slice(items.length - cap);
|
|
53
|
-
};
|
|
47
|
+
const visible = () => store.items.filter((item) => isOnToastStack(item) && item.outOfSightSince === undefined);
|
|
54
48
|
const currentAckItem = () => ackItems()[0] ?? null;
|
|
55
49
|
const isCenterOpen = () => props.centerOpen();
|
|
56
50
|
const handleSettingsChange = (detail) => {
|
|
@@ -62,9 +56,6 @@ export const NotificationHost = (props) => {
|
|
|
62
56
|
if (typeof detail.notificationWidth === 'number') {
|
|
63
57
|
setWidth(detail.notificationWidth);
|
|
64
58
|
}
|
|
65
|
-
if (typeof detail.maxVisibleNotifications === 'number') {
|
|
66
|
-
setMaxVisible(detail.maxVisibleNotifications);
|
|
67
|
-
}
|
|
68
59
|
if (detail.animationDuration === 'fast' ||
|
|
69
60
|
detail.animationDuration === 'normal' ||
|
|
70
61
|
detail.animationDuration === 'slow') {
|
|
@@ -90,15 +81,15 @@ export const NotificationHost = (props) => {
|
|
|
90
81
|
if (idx === null)
|
|
91
82
|
return;
|
|
92
83
|
const target = list[idx];
|
|
93
|
-
if (!target)
|
|
84
|
+
if (!target || isProgressRunning(target))
|
|
94
85
|
return;
|
|
95
|
-
stack.
|
|
86
|
+
stack.dismiss(target.id);
|
|
96
87
|
setFocusIndex(list.length <= 1 ? null : Math.min(idx, list.length - 2));
|
|
97
88
|
};
|
|
98
89
|
const hideToasts = () => {
|
|
99
90
|
if (visible().length === 0)
|
|
100
91
|
return;
|
|
101
|
-
dismissableToastIds(store.items).forEach((id) => stack.
|
|
92
|
+
dismissableToastIds(store.items).forEach((id) => stack.dismiss(id));
|
|
102
93
|
setFocusIndex(null);
|
|
103
94
|
};
|
|
104
95
|
const keybindings = useKeybindingsOptional();
|
|
@@ -11,6 +11,7 @@ import { VpInfo, VpWarning, VpError, VpPass, VpTreeClose, VpGear, VpTreePlug, Vp
|
|
|
11
11
|
import { t } from '../i18n/i18n';
|
|
12
12
|
import { formatDateTime } from '../_internal/platform/intl/format';
|
|
13
13
|
import { relativeAgeLabel } from '../_internal/platform/intl/relativeAgeLabel';
|
|
14
|
+
import { isProgressRunning, } from './nativeEngine';
|
|
14
15
|
import { renderNotificationMarkdown } from './markdownRender';
|
|
15
16
|
import { NOTIFICATION_SEVERITY_LABELS } from './notificationSeverityLabels';
|
|
16
17
|
import { getGoogleSearchUrl, } from '../_internal/platform/vendorErrors';
|
|
@@ -60,10 +61,11 @@ export const NotificationItem = (props) => {
|
|
|
60
61
|
if (exitTimer !== undefined)
|
|
61
62
|
clearTimeout(exitTimer);
|
|
62
63
|
});
|
|
64
|
+
const closable = createMemo(() => !isProgressRunning(props.item));
|
|
63
65
|
const close = () => {
|
|
64
66
|
if (isExiting())
|
|
65
67
|
return;
|
|
66
|
-
if (prefersReducedMotion(document)) {
|
|
68
|
+
if (!closable() || prefersReducedMotion(document)) {
|
|
67
69
|
props.controller.close(props.item.id);
|
|
68
70
|
return;
|
|
69
71
|
}
|
|
@@ -93,6 +95,23 @@ export const NotificationItem = (props) => {
|
|
|
93
95
|
});
|
|
94
96
|
const [isHovered, setIsHovered] = createSignal(false);
|
|
95
97
|
const [isFocused, setIsFocused] = createSignal(false);
|
|
98
|
+
onCleanup(() => {
|
|
99
|
+
const hovered = isHovered();
|
|
100
|
+
const focused = isFocused();
|
|
101
|
+
if (!hovered && !focused)
|
|
102
|
+
return;
|
|
103
|
+
const item = props.item;
|
|
104
|
+
if (item === undefined)
|
|
105
|
+
return;
|
|
106
|
+
const { id } = item;
|
|
107
|
+
const controller = props.controller;
|
|
108
|
+
queueMicrotask(() => {
|
|
109
|
+
if (hovered)
|
|
110
|
+
controller.setHover(id, false);
|
|
111
|
+
if (focused)
|
|
112
|
+
controller.setFocus(id, false);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
96
115
|
const [runCounter, setRunCounter] = createSignal(0);
|
|
97
116
|
const isPaused = createMemo(() => isHovered() ||
|
|
98
117
|
isFocused() ||
|
|
@@ -117,6 +136,8 @@ export const NotificationItem = (props) => {
|
|
|
117
136
|
const announcement = () => props.item.announce ??
|
|
118
137
|
(props.item.severity === 'error' ? 'assertive' : 'polite');
|
|
119
138
|
createEffect(() => {
|
|
139
|
+
if (props.inCenter)
|
|
140
|
+
return;
|
|
120
141
|
const title = props.item.title;
|
|
121
142
|
const body = props.item.body;
|
|
122
143
|
const text = body ? `${title}: ${body}` : title;
|
|
@@ -219,8 +240,9 @@ export const NotificationItem = (props) => {
|
|
|
219
240
|
const gearTrigger = event.currentTarget;
|
|
220
241
|
const source = props.item.source;
|
|
221
242
|
const dontShowKey = props.item.neverShowAgainKey;
|
|
222
|
-
const
|
|
223
|
-
|
|
243
|
+
const remindKey = dontShowKey ??
|
|
244
|
+
props.item.remindKey ??
|
|
245
|
+
deriveImplicitRemindKey(source ?? 'general', props.item.title);
|
|
224
246
|
const items = [];
|
|
225
247
|
if (dontShowKey) {
|
|
226
248
|
items.push({
|
|
@@ -301,7 +323,7 @@ export const NotificationItem = (props) => {
|
|
|
301
323
|
close();
|
|
302
324
|
}
|
|
303
325
|
};
|
|
304
|
-
return (<div class={`${styles.item} card ${isExiting() ? styles.itemExiting : ''}`} id={`notification-card-${props.item.id}`} tabIndex={-1} data-severity={props.item.severity} data-expanded={props.item.expanded} data-has-actions={props.item.actions && props.item.actions.length > 0 ? 'true' : 'false'} data-has-timer={hasTimer() ? 'true' : 'false'} {...{ 'aria-live': announcement() }} aria-atomic=
|
|
326
|
+
return (<div class={`${styles.item} card ${isExiting() ? styles.itemExiting : ''}`} id={props.inCenter ? undefined : `notification-card-${props.item.id}`} tabIndex={-1} data-severity={props.item.severity} data-expanded={props.item.expanded} data-has-actions={props.item.actions && props.item.actions.length > 0 ? 'true' : 'false'} data-has-timer={hasTimer() ? 'true' : 'false'} {...(props.inCenter ? {} : { 'aria-live': announcement() })} aria-atomic={props.inCenter ? undefined : 'true'} aria-label={t('{severity}: {title}', {
|
|
305
327
|
severity: t(NOTIFICATION_SEVERITY_LABELS[props.item.severity]),
|
|
306
328
|
title: props.item.title,
|
|
307
329
|
})} onMouseEnter={() => {
|
|
@@ -348,17 +370,20 @@ export const NotificationItem = (props) => {
|
|
|
348
370
|
<VpGear class={iconScale.iconMd}/>
|
|
349
371
|
</Button>
|
|
350
372
|
</Show>
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
373
|
+
|
|
374
|
+
<Show when={closable()}>
|
|
375
|
+
<div class={styles.closeWrapper}>
|
|
376
|
+
<Button variant="ghost" size="sm" iconOnly class={`${styles.closeButton} close-btn`} data-testid="notification-close-btn" aria-label={t('Close')} title={t('Close')} onClick={close}>
|
|
377
|
+
<VpTreeClose class={iconScale.iconMd}/>
|
|
378
|
+
</Button>
|
|
379
|
+
<Show keyed when={fuseKey()}>
|
|
380
|
+
{(key) => (<svg class={styles.closeFuse} viewBox="0 0 100 100" aria-hidden="true" data-fuse-key={key} style={{ '--fuse-duration': `${duration()}ms` }}>
|
|
381
|
+
<path class={styles.fuseTrack} d="M 50 3 H 79 A 18 18 0 0 1 97 21 V 79 A 18 18 0 0 1 79 97 H 21 A 18 18 0 0 1 3 79 V 21 A 18 18 0 0 1 21 3 Z"/>
|
|
382
|
+
<path class={styles.fusePath} pathLength="100" stroke-dasharray="100 100" stroke-dashoffset="0" d="M 50 3 H 79 A 18 18 0 0 1 97 21 V 79 A 18 18 0 0 1 79 97 H 21 A 18 18 0 0 1 3 79 V 21 A 18 18 0 0 1 21 3 Z"/>
|
|
383
|
+
</svg>)}
|
|
384
|
+
</Show>
|
|
385
|
+
</div>
|
|
386
|
+
</Show>
|
|
362
387
|
</Panel.Toolbar>
|
|
363
388
|
</div>
|
|
364
389
|
|
|
@@ -18,6 +18,7 @@ import { isSourceMuted } from './notificationSuppressions';
|
|
|
18
18
|
import { openExternalUrl } from '../_internal/app/platform/electronBridge';
|
|
19
19
|
import { useKitHost } from '../host/kitHost';
|
|
20
20
|
import { realmNotificationShell } from './notificationCardServices';
|
|
21
|
+
import { RunningProgressCards, useRunningProgressCards, } from './RunningProgressCards';
|
|
21
22
|
import { notificationSettings } from '../_internal/app/settings/descriptors/notification';
|
|
22
23
|
import { useSettingsSubscription } from '../_internal/app/settings/useSettingsSubscription';
|
|
23
24
|
import { useDesktopContextMenu } from '../context/DesktopContextMenuContext';
|
|
@@ -88,6 +89,7 @@ export function NotificationPanel(props) {
|
|
|
88
89
|
let copiedStateTimer = null;
|
|
89
90
|
let headerEl;
|
|
90
91
|
const desktopMenu = useDesktopContextMenu();
|
|
92
|
+
const running = useRunningProgressCards();
|
|
91
93
|
const compiledSearch = createMemo(() => compileNotificationSearchMatcher(searchQuery(), regexMode()));
|
|
92
94
|
const filteredEntries = createMemo(() => filterNotificationTimeline(props.notificationTimeline(), {
|
|
93
95
|
tones: toneSelection(),
|
|
@@ -639,11 +641,14 @@ export function NotificationPanel(props) {
|
|
|
639
641
|
</Show>
|
|
640
642
|
</LogFilterBar>
|
|
641
643
|
<OverlayScrollArea viewportClass={styles.notificationTimeline} data-tour-target="notifications-timeline">
|
|
642
|
-
<
|
|
643
|
-
|
|
644
|
+
<RunningProgressCards items={running()}/>
|
|
645
|
+
<Show when={filteredEntries().length > 0} fallback={<Show when={hasActiveFilter() || running().length === 0}>
|
|
646
|
+
<p class={styles.notificationEmpty}>
|
|
647
|
+
{hasActiveFilter()
|
|
644
648
|
? t('No notifications match the current filter.')
|
|
645
649
|
: t('No notifications yet.')}
|
|
646
|
-
|
|
650
|
+
</p>
|
|
651
|
+
</Show>}>
|
|
647
652
|
<Show when={pinnedEntries().length > 0}>
|
|
648
653
|
<Panel.Header class={styles.notificationItemTop}>
|
|
649
654
|
<span class={styles.notificationSourceLabel}>
|
|
@@ -12,6 +12,7 @@ import { resolveNotificationSource } from './notificationSources';
|
|
|
12
12
|
import { openExternalUrl } from '../_internal/app/platform/electronBridge';
|
|
13
13
|
import { useKitHost } from '../host/kitHost';
|
|
14
14
|
import { realmNotificationShell } from './notificationCardServices';
|
|
15
|
+
import { RunningProgressCards, useRunningProgressCards, } from './RunningProgressCards';
|
|
15
16
|
import { useDesktopContextMenu } from '../context/DesktopContextMenuContext';
|
|
16
17
|
import { OverlayScrollArea } from '../overlay/OverlayScrollArea';
|
|
17
18
|
import { Button } from '../forms/Button';
|
|
@@ -50,6 +51,7 @@ export function NotificationsCenter(props) {
|
|
|
50
51
|
const [entries, setEntries] = createSignal([]);
|
|
51
52
|
const [dnd, setDnd] = createSignal(notificationSettings.get().doNotDisturb);
|
|
52
53
|
const desktopMenu = useDesktopContextMenu();
|
|
54
|
+
const running = useRunningProgressCards();
|
|
53
55
|
onMount(() => {
|
|
54
56
|
const unsubscribe = notifications.timeline.subscribe(setEntries);
|
|
55
57
|
onCleanup(unsubscribe);
|
|
@@ -158,8 +160,9 @@ export function NotificationsCenter(props) {
|
|
|
158
160
|
</Button>
|
|
159
161
|
</div>
|
|
160
162
|
</Panel.Header>
|
|
161
|
-
<Show when={ordered().length > 0} fallback={<EmptyState size="sm" title={t('No new notifications')}/>}>
|
|
163
|
+
<Show when={running().length > 0 || ordered().length > 0} fallback={<EmptyState size="sm" title={t('No new notifications')}/>}>
|
|
162
164
|
<OverlayScrollArea viewportClass={styles.list}>
|
|
165
|
+
<RunningProgressCards items={running()}/>
|
|
163
166
|
<For each={ordered()}>
|
|
164
167
|
{(entry) => {
|
|
165
168
|
const source = resolveNotificationSource(entry.source);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { For, onCleanup, onMount } from 'solid-js';
|
|
2
|
+
import { createStore, reconcile } from 'solid-js/store';
|
|
3
|
+
import { useKitHost } from '../host/kitHost';
|
|
4
|
+
import { notificationSettings } from '../_internal/app/settings/descriptors/notification';
|
|
5
|
+
import { isProgressRunning, } from './nativeEngine';
|
|
6
|
+
import { realmCardController, realmNotificationShell, } from './notificationCardServices';
|
|
7
|
+
import { NotificationItem } from './NotificationItem';
|
|
8
|
+
const isCenterCard = (item) => isProgressRunning(item) && item.priority !== 'acknowledgment-required';
|
|
9
|
+
export function useRunningProgressCards() {
|
|
10
|
+
const { stack } = useKitHost().notifications;
|
|
11
|
+
const [store, setStore] = createStore({
|
|
12
|
+
items: [],
|
|
13
|
+
});
|
|
14
|
+
onMount(() => {
|
|
15
|
+
const unsubscribe = stack.subscribe((items) => {
|
|
16
|
+
setStore('items', reconcile(items.filter(isCenterCard), { key: 'id', merge: true }));
|
|
17
|
+
});
|
|
18
|
+
onCleanup(unsubscribe);
|
|
19
|
+
});
|
|
20
|
+
return () => store.items;
|
|
21
|
+
}
|
|
22
|
+
export function RunningProgressCards(props) {
|
|
23
|
+
const host = useKitHost();
|
|
24
|
+
const controller = realmCardController(host, () => notificationSettings.get());
|
|
25
|
+
const shell = realmNotificationShell(host);
|
|
26
|
+
return (<For each={props.items}>
|
|
27
|
+
{(item) => (<NotificationItem item={item} controller={controller} shell={shell} inCenter/>)}
|
|
28
|
+
</For>);
|
|
29
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Show, createSignal, onCleanup, onMount } from 'solid-js';
|
|
1
|
+
import { Show, createEffect, createSignal, on, onCleanup, onMount } from 'solid-js';
|
|
2
2
|
import { PressableSurface } from '../forms/PressableSurface';
|
|
3
3
|
import { VpBell, VpBellOff } from '@vokril/icons';
|
|
4
4
|
import { Popover } from '../overlay/popover/Popover';
|
|
@@ -6,40 +6,64 @@ import { NotificationsCenter } from './NotificationsCenter';
|
|
|
6
6
|
import { useKitHost } from '../host/kitHost';
|
|
7
7
|
import { notificationSettings } from '../_internal/app/settings/descriptors/notification';
|
|
8
8
|
import { useSettingsSubscription } from '../_internal/app/settings/useSettingsSubscription';
|
|
9
|
+
import { hiddenRunningProgress } from './nativeEngine';
|
|
9
10
|
import { t } from '../i18n/i18n';
|
|
10
11
|
import styles from './StatusBarNotificationBell.module.css.js';
|
|
11
|
-
export function StatusBarNotificationBell() {
|
|
12
|
-
const { timeline } = useKitHost().notifications;
|
|
13
|
-
const [
|
|
12
|
+
export function StatusBarNotificationBell(props) {
|
|
13
|
+
const { timeline, stack } = useKitHost().notifications;
|
|
14
|
+
const [ownOpen, setOwnOpen] = createSignal(false);
|
|
15
|
+
const open = () => props.open ?? ownOpen();
|
|
14
16
|
const [unread, setUnread] = createSignal(0);
|
|
15
17
|
const [dnd, setDnd] = createSignal(notificationSettings.get().doNotDisturb);
|
|
18
|
+
const [outOfSight, setOutOfSight] = createSignal(0);
|
|
16
19
|
let buttonRef;
|
|
17
20
|
onMount(() => {
|
|
18
21
|
const unsubscribeUnread = timeline.subscribeUnread(setUnread);
|
|
19
|
-
|
|
22
|
+
const unsubscribeStack = stack.subscribe((items) => setOutOfSight(hiddenRunningProgress(items).length));
|
|
23
|
+
onCleanup(() => {
|
|
24
|
+
unsubscribeUnread();
|
|
25
|
+
unsubscribeStack();
|
|
26
|
+
});
|
|
20
27
|
});
|
|
21
28
|
useSettingsSubscription(notificationSettings, () => {
|
|
22
29
|
setDnd(notificationSettings.get().doNotDisturb);
|
|
23
30
|
});
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
const setOpen = (next) => {
|
|
32
|
+
if (next === open())
|
|
33
|
+
return;
|
|
34
|
+
if (props.open === undefined)
|
|
35
|
+
setOwnOpen(next);
|
|
36
|
+
props.onOpenChange?.(next);
|
|
37
|
+
};
|
|
38
|
+
createEffect(on(open, (isOpen) => {
|
|
39
|
+
if (isOpen)
|
|
40
|
+
timeline.markSeen();
|
|
41
|
+
}));
|
|
42
|
+
onCleanup(() => setOpen(false));
|
|
43
|
+
const inProgress = () => (open() ? 0 : outOfSight());
|
|
44
|
+
const label = () => {
|
|
45
|
+
const count = inProgress();
|
|
46
|
+
if (dnd()) {
|
|
47
|
+
return count > 0
|
|
48
|
+
? t('Notifications (Do Not Disturb on, {count} in progress)', { count })
|
|
49
|
+
: t('Notifications (Do Not Disturb on)');
|
|
50
|
+
}
|
|
51
|
+
if (open())
|
|
52
|
+
return t('Hide notifications');
|
|
53
|
+
return count > 0
|
|
54
|
+
? t('Notifications ({count} in progress)', { count })
|
|
55
|
+
: t('Show notifications');
|
|
31
56
|
};
|
|
32
57
|
const badgeLabel = () => (unread() > 99 ? '99+' : String(unread()));
|
|
33
58
|
return (<>
|
|
34
|
-
<PressableSurface ref={buttonRef} type="button" class={styles.bell} data-status-bar-bell data-open={open() ? 'true' : 'false'} onClick={
|
|
35
|
-
? t('Notifications (Do Not Disturb on)')
|
|
36
|
-
: t('Show notifications')} aria-label={dnd()
|
|
37
|
-
? t('Notifications (Do Not Disturb on)')
|
|
38
|
-
: t('Show notifications')} aria-haspopup="dialog" aria-expanded={open()}>
|
|
59
|
+
<PressableSurface ref={buttonRef} type="button" class={styles.bell} data-status-bar-bell data-open={open() ? 'true' : 'false'} onClick={() => setOpen(!open())} title={label()} aria-label={label()} aria-haspopup="dialog" aria-expanded={open()}>
|
|
39
60
|
<Show when={dnd()} fallback={<VpBell class={styles.bellIcon}/>}>
|
|
40
61
|
<VpBellOff class={styles.bellIcon}/>
|
|
41
62
|
</Show>
|
|
42
|
-
|
|
63
|
+
|
|
64
|
+
<Show when={unread() > 0} fallback={<Show when={inProgress() > 0}>
|
|
65
|
+
<span class={styles.progressDot} aria-hidden="true"/>
|
|
66
|
+
</Show>}>
|
|
43
67
|
<span class={styles.badge}>{badgeLabel()}</span>
|
|
44
68
|
</Show>
|
|
45
69
|
</PressableSurface>
|
|
@@ -28,6 +28,7 @@ function toToastOptions(definition, payload) {
|
|
|
28
28
|
: {}),
|
|
29
29
|
...(payload.id !== undefined ? { id: payload.id } : {}),
|
|
30
30
|
...(payload.announce !== undefined ? { announce: payload.announce } : {}),
|
|
31
|
+
...(definition.delivery === 'in-app-only' ? { inAppOnly: true } : {}),
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
34
|
export function createCatalogDelivery(deps) {
|
|
@@ -73,7 +74,7 @@ export function createCatalogDelivery(deps) {
|
|
|
73
74
|
},
|
|
74
75
|
progress(definition, built) {
|
|
75
76
|
const payload = withButtons(built);
|
|
76
|
-
if (definition.delivery
|
|
77
|
+
if (definition.delivery === 'os-only') {
|
|
77
78
|
throw new BugIndicatingError('Progress notifications require an in-app catalog definition.');
|
|
78
79
|
}
|
|
79
80
|
return deps.toast.progress(payload.message, {
|
|
@@ -4,7 +4,7 @@ import { applyNotificationRules } from './notificationRules';
|
|
|
4
4
|
import { decideFilter, } from './toastFilterPolicy';
|
|
5
5
|
import { DEFAULT_NOTIFICATION_SETTINGS } from '../_internal/app/settings/descriptors/notification';
|
|
6
6
|
import { createNativeNotificationEngine, isNotificationSticky, resolveNotificationDuration, } from './nativeEngine';
|
|
7
|
-
import { enrichErrorToast } from './toast';
|
|
7
|
+
import { enrichErrorToast, suppressedProgressHandle } from './toast';
|
|
8
8
|
import { resolveCatalogPreviewPriority } from './catalogAdapter';
|
|
9
9
|
import { withErrorActionButtons } from './errorActionButtons';
|
|
10
10
|
function progressHandle(handle, payload) {
|
|
@@ -32,6 +32,11 @@ function progressHandle(handle, payload) {
|
|
|
32
32
|
durationMs: Infinity,
|
|
33
33
|
}),
|
|
34
34
|
dismiss: () => handle.close(),
|
|
35
|
+
updateActions: (next) => handle.update({
|
|
36
|
+
actions: previewActions(next.action ? inertAction(next.action) : undefined, next.actions?.map(inertAction), () => handle.close()),
|
|
37
|
+
}),
|
|
38
|
+
state: () => handle.state(),
|
|
39
|
+
onDidChangeState: handle.onDidChangeState,
|
|
35
40
|
};
|
|
36
41
|
}
|
|
37
42
|
const inert = () => undefined;
|
|
@@ -44,6 +49,30 @@ function inertAction(action) {
|
|
|
44
49
|
: {}),
|
|
45
50
|
};
|
|
46
51
|
}
|
|
52
|
+
function previewActions(primary, others, end) {
|
|
53
|
+
const actions = [primary, ...(others ?? [])].filter((action) => action !== undefined);
|
|
54
|
+
if (actions.length === 0)
|
|
55
|
+
return undefined;
|
|
56
|
+
return actions.map((action, index) => ({
|
|
57
|
+
label: action.label,
|
|
58
|
+
primary: index === 0,
|
|
59
|
+
keepOpen: action.expireOnAction === false,
|
|
60
|
+
onClick: () => {
|
|
61
|
+
void action.onClick();
|
|
62
|
+
if (action.expireOnAction !== false)
|
|
63
|
+
end();
|
|
64
|
+
},
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
function previewPresentation(payload, body) {
|
|
68
|
+
return {
|
|
69
|
+
...(body ? { body: scrubSecrets(body) } : {}),
|
|
70
|
+
...(payload.duration !== undefined ? { durationMs: payload.duration } : {}),
|
|
71
|
+
...(payload.icon ? { icon: payload.icon } : {}),
|
|
72
|
+
...(payload.markdown ? { markdown: true } : {}),
|
|
73
|
+
...(payload.announce ? { announce: payload.announce } : {}),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
47
76
|
function toPreviewPayload(built, errorActions) {
|
|
48
77
|
const payload = withErrorActionButtons(built, errorActions, inertAction);
|
|
49
78
|
return {
|
|
@@ -77,7 +106,7 @@ export function createNotificationPreviewRuntime(deps) {
|
|
|
77
106
|
activeItems = items;
|
|
78
107
|
});
|
|
79
108
|
const controller = {
|
|
80
|
-
close: (id) => engine.
|
|
109
|
+
close: (id) => engine.dismiss(id),
|
|
81
110
|
setFocus: (id, focused) => engine.setFocus(id, focused),
|
|
82
111
|
setHover: (id, hovered) => engine.setHover(id, hovered),
|
|
83
112
|
toggleExpanded: (id) => engine.toggleExpanded(id),
|
|
@@ -161,38 +190,21 @@ export function createNotificationPreviewRuntime(deps) {
|
|
|
161
190
|
const body = errorEnrichment?.bodyText ??
|
|
162
191
|
previewPayload.subtitle ??
|
|
163
192
|
previewPayload.description;
|
|
164
|
-
|
|
193
|
+
let shown;
|
|
194
|
+
const actions = previewActions(errorEnrichment?.primaryAction ?? previewPayload.action, previewPayload.actions, () => shown?.close());
|
|
165
195
|
const handle = engine.notify({
|
|
166
196
|
severity: ruled.severity,
|
|
167
197
|
title: scrubSecrets(ruled.title),
|
|
168
|
-
...(
|
|
198
|
+
...previewPresentation(previewPayload, body),
|
|
169
199
|
source: ruled.source,
|
|
170
200
|
priority: ruled.priority,
|
|
171
|
-
|
|
172
|
-
? { durationMs: previewPayload.duration }
|
|
173
|
-
: {}),
|
|
201
|
+
isolated: true,
|
|
174
202
|
...(previewPayload.id !== undefined
|
|
175
203
|
? { id: String(previewPayload.id) }
|
|
176
204
|
: {}),
|
|
177
|
-
...(
|
|
178
|
-
...(previewPayload.markdown ? { markdown: true } : {}),
|
|
179
|
-
...(previewPayload.announce
|
|
180
|
-
? { announce: previewPayload.announce }
|
|
181
|
-
: {}),
|
|
182
|
-
...(primaryAction || previewPayload.actions?.length
|
|
183
|
-
? {
|
|
184
|
-
actions: [primaryAction, ...(previewPayload.actions ?? [])]
|
|
185
|
-
.filter((action) => action !== undefined)
|
|
186
|
-
.map((action, index) => ({
|
|
187
|
-
label: action.label,
|
|
188
|
-
primary: index === 0,
|
|
189
|
-
onClick: () => {
|
|
190
|
-
void action.onClick();
|
|
191
|
-
},
|
|
192
|
-
})),
|
|
193
|
-
}
|
|
194
|
-
: {}),
|
|
205
|
+
...(actions ? { actions } : {}),
|
|
195
206
|
});
|
|
207
|
+
shown = handle;
|
|
196
208
|
deliveries.push(handle.id ? delivery : { ...delivery, outcome: 'spam-dropped' });
|
|
197
209
|
return handle.id;
|
|
198
210
|
},
|
|
@@ -205,7 +217,7 @@ export function createNotificationPreviewRuntime(deps) {
|
|
|
205
217
|
deliveries.push({
|
|
206
218
|
definition,
|
|
207
219
|
payload: previewPayload,
|
|
208
|
-
channel:
|
|
220
|
+
channel: definition.delivery,
|
|
209
221
|
decision,
|
|
210
222
|
outcome: decision.showToast
|
|
211
223
|
? 'shown'
|
|
@@ -213,27 +225,29 @@ export function createNotificationPreviewRuntime(deps) {
|
|
|
213
225
|
? 'timeline-only'
|
|
214
226
|
: 'suppressed',
|
|
215
227
|
});
|
|
228
|
+
const id = previewPayload.id !== undefined ? String(previewPayload.id) : undefined;
|
|
216
229
|
if (!decision.showToast) {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
fail: () => undefined,
|
|
221
|
-
dismiss: () => undefined,
|
|
222
|
-
};
|
|
230
|
+
if (id !== undefined)
|
|
231
|
+
engine.suppress((item) => item.id === id);
|
|
232
|
+
return suppressedProgressHandle;
|
|
223
233
|
}
|
|
234
|
+
let shown;
|
|
235
|
+
const actions = previewActions(previewPayload.action, previewPayload.actions, () => shown?.close());
|
|
224
236
|
const handle = engine.notify({
|
|
225
237
|
severity: definition.severity,
|
|
226
238
|
title: scrubSecrets(previewPayload.message),
|
|
239
|
+
...previewPresentation(previewPayload, previewPayload.subtitle ?? previewPayload.description),
|
|
227
240
|
source: definition.source,
|
|
228
241
|
priority: definition.priority,
|
|
242
|
+
isolated: true,
|
|
229
243
|
sticky: true,
|
|
230
244
|
progress: previewPayload.onCancel
|
|
231
245
|
? { onCancel: previewPayload.onCancel }
|
|
232
246
|
: {},
|
|
233
|
-
...(
|
|
234
|
-
|
|
235
|
-
: {}),
|
|
247
|
+
...(id !== undefined ? { id } : {}),
|
|
248
|
+
...(actions ? { actions } : {}),
|
|
236
249
|
});
|
|
250
|
+
shown = handle;
|
|
237
251
|
return progressHandle(handle, previewPayload);
|
|
238
252
|
},
|
|
239
253
|
};
|