@vokril/ui-solid 0.28.0 → 0.31.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 +81 -0
- package/README.md +48 -4
- package/dist/{AttributeGrid-eND8YDby.cjs → AttributeGrid-Ch1k9v5j.cjs} +1 -1
- package/dist/{AttributeGrid-CASILa4u.js → AttributeGrid-DqFd4gBm.js} +3 -3
- package/dist/Button-4meERfnv.js +300 -0
- package/dist/Button-OyZHrl-t.cjs +1 -0
- package/dist/CommandPalette-CxYZUJtN.cjs +2 -0
- package/dist/{CommandPalette-Cj618AOz.js → CommandPalette-DwOp8y1-.js} +1467 -1466
- package/dist/{CopyButton-B5gS2ft3.cjs → CopyButton-16QNPgz6.cjs} +1 -1
- package/dist/{CopyButton-g-WSiBDZ.js → CopyButton-BVS49lMS.js} +1 -1
- package/dist/{DateRangePicker-CJD9ADgB.js → DateRangePicker-8QvydugY.js} +4 -4
- package/dist/{DateRangePicker-Frc0HVxp.cjs → DateRangePicker-DI-06xWY.cjs} +1 -1
- package/dist/{GuidedTour-B6q7lYhn.cjs → GuidedTour-DUQwdW8n.cjs} +1 -1
- package/dist/{GuidedTour-CFCvRJN4.js → GuidedTour-DXMmHn0o.js} +2 -2
- package/dist/{HostPortal-CXGUUhP8.js → HostPortal-Ba3MD9CG.js} +1 -1
- package/dist/HostPortal-CpWsArs6.cjs +1 -0
- package/dist/{IconPicker-DYqNi5ud.js → IconPicker-D1G8HK92.js} +3 -3
- package/dist/{IconPicker-CIbJb1ei.cjs → IconPicker-Q-ZDtNkd.cjs} +1 -1
- package/dist/Input-Brp5EDhg.cjs +1 -0
- package/dist/Input-CZi8KEfm.js +374 -0
- package/dist/Modal-CBi7Wd2V.cjs +1 -0
- package/dist/Modal-iyY1HUtr.js +588 -0
- package/dist/{PageSkeleton-BPbb28-H.cjs → PageSkeleton-B_-4fz1q.cjs} +1 -1
- package/dist/{PageSkeleton-CLnJO6uD.js → PageSkeleton-zNyjLPlk.js} +3 -3
- package/dist/{Popover-Cttb6NYT.js → Popover-DVi179wu.js} +4 -3
- package/dist/Popover-DXrczbt9.cjs +1 -0
- package/dist/{SearchableSelect-BvCm4enQ.js → SearchableSelect-DtHbWJhR.js} +34 -33
- package/dist/SearchableSelect-yLVqCGFo.cjs +1 -0
- package/dist/StatusBarNotificationBell-DQs5g1K6.cjs +50 -0
- package/dist/{StatusBarNotificationBell-yryWdwyX.js → StatusBarNotificationBell-ZTEhZFmJ.js} +4980 -4678
- package/dist/{Stepper-D9i1Xclm.js → Stepper-CyRgzWlR.js} +1 -1
- package/dist/{Stepper-Ci5JpLbS.cjs → Stepper-u2ZsE5oP.cjs} +1 -1
- package/dist/{Textarea-CeAGf08O.cjs → Textarea-DASNQNoi.cjs} +1 -1
- package/dist/{Textarea-B5QqqKnI.js → Textarea-szHXQahi.js} +1 -1
- package/dist/{TimeSeriesChart-DOwi2lJs.js → TimeSeriesChart-D7lIqolp.js} +1 -1
- package/dist/{TimeSeriesChart-huvheefm.cjs → TimeSeriesChart-DGzM9B--.cjs} +1 -1
- package/dist/{ToggleButton-CFM8P3JY.js → ToggleButton-B22PsCqo.js} +61 -60
- package/dist/ToggleButton-DWslrIBN.cjs +1 -0
- package/dist/_internal/contract/notification.d.cts +13 -3
- package/dist/_internal/contract/notification.d.ts +13 -3
- package/dist/_internal/contract/notificationCatalog.d.cts +2 -0
- package/dist/_internal/contract/notificationCatalog.d.ts +2 -0
- package/dist/_internal/platform/settings/settingsTypes.d.cts +0 -8
- package/dist/_internal/platform/settings/settingsTypes.d.ts +0 -8
- package/dist/anchoredLayout-CBjQ1etD.cjs +1 -0
- package/dist/anchoredLayout-E0mqCWxk.js +233 -0
- package/dist/appThemeDerivation-BylmT80v.cjs +1 -0
- package/dist/{appThemeDerivation-CKoSe4KP.js → appThemeDerivation-DBAOkGl7.js} +260 -231
- package/dist/base.css +2 -2
- package/dist/charts/index.cjs +1 -1
- package/dist/charts/index.js +1 -1
- package/dist/context/DesktopContextMenuContext.d.cts +8 -1
- package/dist/context/DesktopContextMenuContext.d.ts +8 -1
- package/dist/createDialogShellFocus-CQ0VNC2g.cjs +1 -0
- package/dist/{createDialogShellFocus-B4piXDU4.js → createDialogShellFocus-DbiQmLgb.js} +9 -9
- package/dist/createResizableSidebar-COlpGQ7H.cjs +1 -0
- package/dist/createResizableSidebar-cmCKTIg_.js +504 -0
- package/dist/desktop/index.cjs +1 -1
- package/dist/desktop/index.js +3 -3
- package/dist/dialogFocusRestore-BhxVTSiP.js +10 -0
- package/dist/dialogFocusRestore-DP5b1bDo.cjs +1 -0
- package/dist/feedback/index.cjs +1 -1
- package/dist/feedback/index.js +3 -3
- package/dist/forms/Input.d.cts +20 -0
- package/dist/forms/Input.d.ts +20 -0
- package/dist/forms/InputMessage.d.cts +19 -0
- package/dist/forms/InputMessage.d.ts +19 -0
- package/dist/forms/index.cjs +1 -1
- package/dist/forms/index.js +9 -9
- package/dist/grid/index.cjs +1 -1
- package/dist/grid/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +516 -509
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.js +2 -2
- package/dist/layout/resizeCarry.d.cts +17 -0
- package/dist/layout/resizeCarry.d.ts +17 -0
- package/dist/mainRealmDom-B215swW-.js +166 -0
- package/dist/mainRealmDom-BYGSE-fo.cjs +1 -0
- package/dist/nativeTitleHold-A9jUISgQ.js +170 -0
- package/dist/nativeTitleHold-B7Ou-W9b.cjs +1 -0
- package/dist/navigation/index.cjs +1 -1
- package/dist/navigation/index.js +1 -1
- package/dist/notifications/NotificationItem.d.cts +12 -3
- package/dist/notifications/NotificationItem.d.ts +12 -3
- package/dist/notifications/NotificationsCenter.d.cts +18 -0
- package/dist/notifications/NotificationsCenter.d.ts +18 -0
- package/dist/notifications/RunningProgressCards.d.cts +3 -0
- package/dist/notifications/RunningProgressCards.d.ts +3 -0
- package/dist/notifications/StatusBarNotificationBell.d.cts +18 -6
- package/dist/notifications/StatusBarNotificationBell.d.ts +18 -6
- package/dist/notifications/dismissableToastIds.d.cts +2 -1
- package/dist/notifications/dismissableToastIds.d.ts +2 -1
- package/dist/notifications/fireNotification.d.cts +35 -16
- package/dist/notifications/fireNotification.d.ts +35 -16
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.d.cts +1 -0
- package/dist/notifications/index.d.ts +1 -0
- package/dist/notifications/index.js +56 -52
- package/dist/notifications/nativeEngine.d.cts +54 -16
- package/dist/notifications/nativeEngine.d.ts +54 -16
- package/dist/notifications/notificationCardServices.d.cts +2 -1
- package/dist/notifications/notificationCardServices.d.ts +2 -1
- package/dist/notifications/notificationCommands.d.cts +3 -3
- package/dist/notifications/notificationCommands.d.ts +3 -3
- package/dist/notifications/notificationEntryList.d.cts +91 -0
- package/dist/notifications/notificationEntryList.d.ts +91 -0
- package/dist/notifications/notificationService.d.cts +33 -3
- package/dist/notifications/notificationService.d.ts +33 -3
- package/dist/notifications/toast.d.cts +3 -0
- package/dist/notifications/toast.d.ts +3 -0
- package/dist/notifications/toastCorner.d.cts +8 -0
- package/dist/notifications/toastCorner.d.ts +8 -0
- package/dist/notifications/toastFilterPolicy.d.cts +33 -1
- package/dist/notifications/toastFilterPolicy.d.ts +33 -1
- package/dist/overlay/Modal.d.cts +6 -0
- package/dist/overlay/Modal.d.ts +6 -0
- package/dist/overlay/backgroundInert.d.cts +6 -2
- package/dist/overlay/backgroundInert.d.ts +6 -2
- package/dist/overlay/command-palette/CommandPalette.d.cts +12 -0
- package/dist/overlay/command-palette/CommandPalette.d.ts +12 -0
- package/dist/overlay/index.cjs +1 -1
- package/dist/overlay/index.js +70 -68
- package/dist/overlay/nativeTitleHold.d.cts +24 -0
- package/dist/overlay/nativeTitleHold.d.ts +24 -0
- package/dist/ownerAnimationFrame-DzFcMSmn.js +19 -0
- package/dist/ownerAnimationFrame-T6jf6qYC.cjs +1 -0
- package/dist/server/{AttributeGrid-CMi-UtWb.js → AttributeGrid-Bpjlauuz.js} +2 -2
- package/dist/server/{AttributeGrid-B7sb3btp.cjs → AttributeGrid-DNYdKb8J.cjs} +1 -1
- package/dist/server/CommandPalette-BuVxnqBG.cjs +1 -0
- package/dist/server/{CommandPalette-CozogFlk.js → CommandPalette-Dn3NKXPM.js} +1095 -1069
- package/dist/server/{DateRangePicker-KLZzyuPJ.cjs → DateRangePicker-BFzNjaME.cjs} +1 -1
- package/dist/server/{DateRangePicker-C35q8BTw.js → DateRangePicker-CnYkTgXX.js} +3 -3
- package/dist/server/{GuidedTour-DmLbBttx.js → GuidedTour-BZardPYW.js} +1 -1
- package/dist/server/{GuidedTour-DfV0yzqh.cjs → GuidedTour-yhdZk2SU.cjs} +1 -1
- package/dist/server/{HostPortal-CXGUUhP8.js → HostPortal-C4IrAeWN.js} +1 -1
- package/dist/server/HostPortal-D5ECrJvn.cjs +1 -0
- package/dist/server/{IconPicker-B1soopAp.cjs → IconPicker-C5lAN9pX.cjs} +1 -1
- package/dist/server/{IconPicker-B4aXspLw.js → IconPicker-DDWgB7sm.js} +3 -3
- package/dist/server/Input-AdF-i0O8.js +245 -0
- package/dist/server/Input-XF9Jr0G9.cjs +1 -0
- package/dist/server/{Modal-BheFQLs1.js → Modal-C5dzgcRW.js} +102 -97
- package/dist/server/{Modal-BswxV8Pn.cjs → Modal-nAhBS1L9.cjs} +1 -1
- package/dist/server/Popover-C5avmGWz.cjs +1 -0
- package/dist/server/{Popover-Cg28aPUZ.js → Popover-H3AAYZI0.js} +57 -57
- package/dist/server/{SearchableSelect-09ECcDlB.cjs → SearchableSelect-CZrXDKfC.cjs} +1 -1
- package/dist/server/{SearchableSelect-vjhS4c-H.js → SearchableSelect-DMqed5Er.js} +1 -1
- package/dist/server/StatusBarNotificationBell-CGcMdT4h.cjs +49 -0
- package/dist/server/{StatusBarNotificationBell-DdAdsduo.js → StatusBarNotificationBell-DW2l5O9B.js} +4812 -4520
- package/dist/server/{Stepper-DxNrskdq.cjs → Stepper-CpapA_WH.cjs} +1 -1
- package/dist/server/{Stepper-n5f9r-ye.js → Stepper-gGA7JwjV.js} +1 -1
- package/dist/server/{Textarea-BQf2lL59.cjs → Textarea-Bh5LVrBn.cjs} +1 -1
- package/dist/server/{Textarea-BTH48NET.js → Textarea-DVkfGkP0.js} +1 -1
- package/dist/server/{ToggleButton-TE3Xf2yD.cjs → ToggleButton-CA9T-OsI.cjs} +1 -1
- package/dist/server/{ToggleButton-FywO2CCI.js → ToggleButton-CBNKajZa.js} +4 -4
- package/dist/server/{VpTrash-Dlq8o6Uv.js → VpTrash-CZMWCIpF.js} +84 -70
- package/dist/server/VpTrash-DiczWhwm.cjs +1 -0
- package/dist/server/appThemeDerivation-BylmT80v.cjs +1 -0
- package/dist/server/{appThemeDerivation-CKoSe4KP.js → appThemeDerivation-DBAOkGl7.js} +260 -231
- package/dist/server/{createDialogShellFocus-BiBAZOCI.cjs → createDialogShellFocus-CDaLuPg8.cjs} +1 -1
- package/dist/server/{createDialogShellFocus-BFo8awdj.js → createDialogShellFocus-LGDBOVnr.js} +6 -6
- package/dist/server/{createResizableSidebar-BImbKlLe.js → createResizableSidebar-Dvu7iEk1.js} +1 -1
- package/dist/server/{createResizableSidebar-GFgZIj-5.cjs → createResizableSidebar-v40ZOb-Q.cjs} +1 -1
- package/dist/server/desktop/index.cjs +1 -1
- package/dist/server/desktop/index.js +3 -3
- package/dist/server/dialogFocusRestore-BhxVTSiP.js +10 -0
- package/dist/server/dialogFocusRestore-DP5b1bDo.cjs +1 -0
- package/dist/server/forms/index.cjs +1 -1
- package/dist/server/forms/index.js +7 -7
- package/dist/server/grid/index.cjs +1 -1
- package/dist/server/grid/index.js +1 -1
- package/dist/server/{index-UIjsx3oJ.js → index-BEARfm54.js} +3604 -3617
- package/dist/server/index-C6rYfWCJ.cjs +1 -0
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.js +478 -472
- 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 +56 -52
- package/dist/server/overlay/index.cjs +1 -1
- package/dist/server/overlay/index.js +54 -53
- package/dist/server/tokens/index.cjs +1 -1
- package/dist/server/tokens/index.js +30 -28
- package/dist/solid/feedback/Badge.jsx +3 -14
- package/dist/solid/forms/Button.jsx +3 -14
- package/dist/solid/forms/Input.jsx +31 -5
- package/dist/solid/forms/Input.module.css.js +1 -0
- package/dist/solid/forms/InputMessage.jsx +86 -0
- package/dist/solid/forms/PressableSurface.jsx +3 -14
- package/dist/solid/layout/ResizeHandle.jsx +11 -1
- package/dist/solid/layout/resizeCarry.js +31 -0
- package/dist/solid/notifications/NotificationHost.jsx +6 -29
- package/dist/solid/notifications/NotificationItem.jsx +5 -5
- package/dist/solid/notifications/NotificationPanel.jsx +14 -4
- package/dist/solid/notifications/NotificationsCenter.jsx +70 -12
- package/dist/solid/notifications/RunningProgressCards.jsx +1 -1
- package/dist/solid/notifications/StatusBarNotificationBell.jsx +21 -19
- package/dist/solid/notifications/catalogAdapter.js +1 -0
- package/dist/solid/notifications/fireNotification.js +21 -16
- package/dist/solid/notifications/index.js +1 -0
- package/dist/solid/notifications/nativeEngine.js +51 -11
- package/dist/solid/notifications/notificationEntryList.js +168 -0
- package/dist/solid/notifications/notificationService.js +22 -4
- package/dist/solid/notifications/toast.js +54 -7
- package/dist/solid/notifications/toastCorner.js +3 -0
- package/dist/solid/notifications/toastFilterPolicy.js +12 -0
- package/dist/solid/overlay/Drawer.jsx +2 -1
- package/dist/solid/overlay/Modal.jsx +42 -4
- package/dist/solid/overlay/command-palette/CommandPalette.jsx +4 -4
- package/dist/solid/overlay/context-menu/DesktopContextMenu.jsx +8 -7
- package/dist/solid/overlay/nativeTitleHold.js +33 -0
- package/dist/solid/overlay/tooltipDirective.js +3 -11
- package/dist/solid/tokens/index.js +1 -0
- package/dist/solid/tokens/palette/paletteContract.js +27 -0
- package/dist/style.css +2 -2
- package/dist/theme.css +1 -1
- package/dist/tokens/index.cjs +1 -1
- package/dist/tokens/index.d.cts +1 -0
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.js +30 -28
- package/dist/tokens/palette/paletteContract.d.cts +17 -0
- package/dist/tokens/palette/paletteContract.d.ts +17 -0
- package/dist/tokens/tokens.css +1 -1
- package/dist/ui.css +1 -1
- package/package.json +1 -1
- package/dist/Button-Bb68ymNP.cjs +0 -1
- package/dist/Button-D-T0tyGF.js +0 -305
- package/dist/CommandPalette-5FQRgPG9.cjs +0 -2
- package/dist/HostPortal-CgJwxt-f.cjs +0 -1
- package/dist/Input-CZruORyy.cjs +0 -1
- package/dist/Input-DkPhsdfk.js +0 -227
- package/dist/Modal-CY6ePolt.cjs +0 -1
- package/dist/Modal-NzZzHSwb.js +0 -559
- package/dist/Popover-CWrR51eG.cjs +0 -1
- package/dist/SearchableSelect-CVqdVMOC.cjs +0 -1
- package/dist/StatusBarNotificationBell-CJ3HuhRu.cjs +0 -50
- package/dist/ToggleButton-BFWh1_o5.cjs +0 -1
- package/dist/anchoredLayout-Dstwa5OH.cjs +0 -1
- package/dist/anchoredLayout-FC-qv8xm.js +0 -250
- package/dist/appThemeDerivation-Be_oKljl.cjs +0 -1
- package/dist/createDialogShellFocus-CJaw9-B9.cjs +0 -1
- package/dist/createResizableSidebar-BDUlX9-G.js +0 -472
- package/dist/createResizableSidebar-BVJBU2kP.cjs +0 -1
- package/dist/dialogFocusRestore--dH59ER2.js +0 -35
- package/dist/dialogFocusRestore-CL-ExfAA.cjs +0 -1
- package/dist/mainRealmDom-C12lr9lm.js +0 -171
- package/dist/mainRealmDom-S6teqEr4.cjs +0 -1
- package/dist/server/CommandPalette-DQK6N98N.cjs +0 -1
- package/dist/server/HostPortal-CgJwxt-f.cjs +0 -1
- package/dist/server/Input-CjvD8w18.cjs +0 -1
- package/dist/server/Input-DaEN2JJd.js +0 -127
- package/dist/server/Popover-BsxIKBbl.cjs +0 -1
- package/dist/server/StatusBarNotificationBell-Z2LmIkM1.cjs +0 -49
- package/dist/server/VpTrash-D49oUUJh.cjs +0 -1
- package/dist/server/appThemeDerivation-Be_oKljl.cjs +0 -1
- package/dist/server/dialogFocusRestore--dH59ER2.js +0 -35
- package/dist/server/dialogFocusRestore-CL-ExfAA.cjs +0 -1
- package/dist/server/index-2mQPVEDR.cjs +0 -1
- package/dist/tooltipCoordinator-BzxEyKhA.js +0 -144
- package/dist/tooltipCoordinator-DslqMlsI.cjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { scrubSecrets } from '../_internal/base/scrubSecrets';
|
|
2
2
|
import { notificationSettings } from '../_internal/app/settings/descriptors/notification';
|
|
3
3
|
import { isInQuietHours } from './quietHours';
|
|
4
|
-
import { decideFilter as decideToastFilter, deriveImplicitRemindKey, } from './toastFilterPolicy';
|
|
4
|
+
import { cardRemindKey, decideFilter as decideToastFilter, deriveImplicitRemindKey, filteredPriority, } from './toastFilterPolicy';
|
|
5
5
|
import { shouldFireOsNative } from './osNativePolicy';
|
|
6
6
|
import { resolveDefaultRoute } from './defaultRoutes';
|
|
7
7
|
import { isKeyDismissed, isKeyRemindSuppressed, isSourceMuted, } from './notificationSuppressions';
|
|
@@ -9,34 +9,38 @@ import { isSpamDropHandle, } from './nativeEngine';
|
|
|
9
9
|
function inQuietHoursNow() {
|
|
10
10
|
return isInQuietHours(notificationSettings.get(), new Date());
|
|
11
11
|
}
|
|
12
|
-
function choiceGates(source, title,
|
|
12
|
+
function choiceGates(source, title, keys) {
|
|
13
|
+
const { dontShowAgainKey, remindKey } = keys;
|
|
13
14
|
return {
|
|
14
15
|
dismissed: dontShowAgainKey !== undefined && isKeyDismissed(dontShowAgainKey),
|
|
15
|
-
remindSuppressed:
|
|
16
|
-
isKeyRemindSuppressed(
|
|
17
|
-
|
|
16
|
+
remindSuppressed: remindKey !== undefined
|
|
17
|
+
? isKeyRemindSuppressed(remindKey)
|
|
18
|
+
: (dontShowAgainKey !== undefined &&
|
|
19
|
+
isKeyRemindSuppressed(dontShowAgainKey)) ||
|
|
20
|
+
isKeyRemindSuppressed(deriveImplicitRemindKey(source, title)),
|
|
18
21
|
};
|
|
19
22
|
}
|
|
20
|
-
export function decideFilter(
|
|
21
|
-
return decideToastFilter({
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
export function decideFilter(issue) {
|
|
24
|
+
return decideToastFilter({
|
|
25
|
+
priority: filteredPriority(issue.priority, issue.severity, issue.filter),
|
|
26
|
+
recordTimeline: issue.recordTimeline,
|
|
27
|
+
}, notificationSettings.get(), {
|
|
28
|
+
...choiceGates(issue.source, issue.title, issue),
|
|
29
|
+
sourceMuted: isSourceMuted(issue.source),
|
|
24
30
|
inQuietHours: inQuietHoursNow(),
|
|
25
31
|
});
|
|
26
32
|
}
|
|
27
|
-
export function turnedDownOnCard(source, title,
|
|
28
|
-
const gates = choiceGates(source, title,
|
|
33
|
+
export function turnedDownOnCard(source, title, keys) {
|
|
34
|
+
const gates = choiceGates(source, title, keys);
|
|
29
35
|
return gates.dismissed || gates.remindSuppressed;
|
|
30
36
|
}
|
|
31
37
|
export function turnedDownCard(item) {
|
|
32
38
|
const dontShowAgainKey = item.neverShowAgainKey;
|
|
33
39
|
return ((dontShowAgainKey !== undefined && isKeyDismissed(dontShowAgainKey)) ||
|
|
34
|
-
isKeyRemindSuppressed(
|
|
35
|
-
item.remindKey ??
|
|
36
|
-
deriveImplicitRemindKey(item.source ?? 'general', item.title)));
|
|
40
|
+
isKeyRemindSuppressed(cardRemindKey(item)));
|
|
37
41
|
}
|
|
38
|
-
export function silencedBySettings(source, priority) {
|
|
39
|
-
return !decideToastFilter({ priority, recordTimeline: undefined }, notificationSettings.get(), {
|
|
42
|
+
export function silencedBySettings(source, severity, priority, filter) {
|
|
43
|
+
return !decideToastFilter({ priority: filteredPriority(priority, severity, filter), recordTimeline: undefined }, notificationSettings.get(), {
|
|
40
44
|
dismissed: false,
|
|
41
45
|
remindSuppressed: false,
|
|
42
46
|
sourceMuted: isSourceMuted(source),
|
|
@@ -75,6 +79,7 @@ export function cardPresentation(options) {
|
|
|
75
79
|
...(options.dontShowAgainKey
|
|
76
80
|
? { neverShowAgainKey: options.dontShowAgainKey }
|
|
77
81
|
: {}),
|
|
82
|
+
...(options.remindKey ? { remindKey: options.remindKey } : {}),
|
|
78
83
|
...(options.icon ? { icon: options.icon } : {}),
|
|
79
84
|
...(options.announce ? { announce: options.announce } : {}),
|
|
80
85
|
...(resolvedRoute ? { defaultRoute: resolvedRoute } : {}),
|
|
@@ -27,4 +27,5 @@ export { registerFenceAliases } from '../_internal/app/markdown/inlineMarkdown';
|
|
|
27
27
|
export { NotificationItem, } from './NotificationItem';
|
|
28
28
|
export { NotificationPanel } from './NotificationPanel';
|
|
29
29
|
export { NotificationsCenter } from './NotificationsCenter';
|
|
30
|
+
export { focusFirstNotificationEntry } from './notificationEntryList';
|
|
30
31
|
export { StatusBarNotificationBell, } from './StatusBarNotificationBell';
|
|
@@ -43,10 +43,26 @@ export function isProgressRunning(item) {
|
|
|
43
43
|
export function isOnToastStack(item) {
|
|
44
44
|
return item.priority !== 'acknowledgment-required' && item.hidden !== true;
|
|
45
45
|
}
|
|
46
|
+
export function hiddenRunningProgress(items) {
|
|
47
|
+
return items
|
|
48
|
+
.flatMap((item) => item.outOfSightSince !== undefined && isProgressRunning(item)
|
|
49
|
+
? [{ item, since: item.outOfSightSince }]
|
|
50
|
+
: [])
|
|
51
|
+
.reverse()
|
|
52
|
+
.sort((a, b) => b.since - a.since)
|
|
53
|
+
.map(({ item }) => item);
|
|
54
|
+
}
|
|
55
|
+
function withSight(item, since) {
|
|
56
|
+
if (since !== undefined)
|
|
57
|
+
return { ...item, outOfSightSince: since };
|
|
58
|
+
const { outOfSightSince: _inSight, ...card } = item;
|
|
59
|
+
return card;
|
|
60
|
+
}
|
|
46
61
|
export function createNativeNotificationEngine(dependencies) {
|
|
47
62
|
const { getSettings, warn } = dependencies;
|
|
48
63
|
const isSilenced = dependencies.isSilenced ?? (() => false);
|
|
49
64
|
const isTurnedDown = dependencies.isTurnedDown ?? (() => false);
|
|
65
|
+
const centerReachable = dependencies.centerReachable ?? (() => true);
|
|
50
66
|
const now = dependencies.now ?? (() => Date.now());
|
|
51
67
|
const setTimer = dependencies.setTimeout ??
|
|
52
68
|
((callback, timeoutMs) => window.setTimeout(callback, timeoutMs));
|
|
@@ -57,20 +73,37 @@ export function createNativeNotificationEngine(dependencies) {
|
|
|
57
73
|
const listeners = new Set();
|
|
58
74
|
const timers = new Map();
|
|
59
75
|
const runs = new Map();
|
|
76
|
+
const outOfSight = new Map();
|
|
60
77
|
function snapshot() {
|
|
61
78
|
return [...items.values()].sort((a, b) => a.createdAt - b.createdAt);
|
|
62
79
|
}
|
|
63
|
-
function
|
|
64
|
-
const settings = getSettings();
|
|
65
|
-
if (!settings.pauseTimerWhileHidden)
|
|
66
|
-
return false;
|
|
80
|
+
function clippedIds() {
|
|
67
81
|
const stack = snapshot().filter(isOnToastStack);
|
|
68
|
-
const cap = Math.max(1,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
82
|
+
const cap = Math.max(1, getSettings().maxVisibleNotifications);
|
|
83
|
+
return new Set(stack.slice(0, Math.max(0, stack.length - cap)).map(({ id }) => id));
|
|
84
|
+
}
|
|
85
|
+
function isClipped(id) {
|
|
86
|
+
return getSettings().pauseTimerWhileHidden && clippedIds().has(id);
|
|
87
|
+
}
|
|
88
|
+
function recordSight() {
|
|
89
|
+
const clipped = clippedIds();
|
|
90
|
+
for (const id of outOfSight.keys()) {
|
|
91
|
+
if (!items.has(id))
|
|
92
|
+
outOfSight.delete(id);
|
|
93
|
+
}
|
|
94
|
+
let changed = false;
|
|
95
|
+
for (const [id, item] of items) {
|
|
96
|
+
if (item.hidden !== true && !clipped.has(id))
|
|
97
|
+
outOfSight.delete(id);
|
|
98
|
+
else if (!outOfSight.has(id))
|
|
99
|
+
outOfSight.set(id, now());
|
|
100
|
+
const since = outOfSight.get(id);
|
|
101
|
+
if (item.outOfSightSince === since)
|
|
102
|
+
continue;
|
|
103
|
+
items.set(id, withSight(item, since));
|
|
104
|
+
changed = true;
|
|
105
|
+
}
|
|
106
|
+
return changed;
|
|
74
107
|
}
|
|
75
108
|
function reevaluateSchedules() {
|
|
76
109
|
for (const id of items.keys()) {
|
|
@@ -83,6 +116,7 @@ export function createNativeNotificationEngine(dependencies) {
|
|
|
83
116
|
}
|
|
84
117
|
}
|
|
85
118
|
function emit() {
|
|
119
|
+
recordSight();
|
|
86
120
|
const snap = snapshot();
|
|
87
121
|
for (const l of Array.from(listeners)) {
|
|
88
122
|
try {
|
|
@@ -328,7 +362,7 @@ export function createNativeNotificationEngine(dependencies) {
|
|
|
328
362
|
closeCard(id, 'dismissed');
|
|
329
363
|
return;
|
|
330
364
|
}
|
|
331
|
-
if (cur.hidden)
|
|
365
|
+
if (cur.hidden || !centerReachable())
|
|
332
366
|
return;
|
|
333
367
|
items.set(id, sendToCenter(cur));
|
|
334
368
|
emit();
|
|
@@ -356,11 +390,16 @@ export function createNativeNotificationEngine(dependencies) {
|
|
|
356
390
|
return;
|
|
357
391
|
closeCard(id, 'suppressed');
|
|
358
392
|
}
|
|
393
|
+
function refresh() {
|
|
394
|
+
if (recordSight())
|
|
395
|
+
emit();
|
|
396
|
+
}
|
|
359
397
|
function dispose() {
|
|
360
398
|
for (const id of timers.keys())
|
|
361
399
|
cancelHide(id);
|
|
362
400
|
const ended = [...runs.keys()].map((id) => endRun(id, 'closed'));
|
|
363
401
|
items.clear();
|
|
402
|
+
outOfSight.clear();
|
|
364
403
|
listeners.clear();
|
|
365
404
|
for (const run of ended)
|
|
366
405
|
announceEnd(run);
|
|
@@ -375,6 +414,7 @@ export function createNativeNotificationEngine(dependencies) {
|
|
|
375
414
|
dismiss: dismissNotification,
|
|
376
415
|
suppress: suppressNotifications,
|
|
377
416
|
reject: rejectNotification,
|
|
417
|
+
refresh,
|
|
378
418
|
dispose,
|
|
379
419
|
};
|
|
380
420
|
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { createEffect, on, onCleanup, onMount } from 'solid-js';
|
|
2
|
+
import { namedKeyOf } from '../_internal/base/keys';
|
|
3
|
+
import { t } from '../i18n/i18n';
|
|
4
|
+
import { NOTIFICATION_SEVERITY_LABELS } from './notificationSeverityLabels';
|
|
5
|
+
import { resolveNotificationSource } from './notificationSources';
|
|
6
|
+
const ENTRY_ATTRIBUTE = 'data-notification-entry';
|
|
7
|
+
export const notificationEntryMark = { [ENTRY_ATTRIBUTE]: '' };
|
|
8
|
+
const ENTRY_SELECTOR = `[${ENTRY_ATTRIBUTE}]`;
|
|
9
|
+
function entriesUnder(root) {
|
|
10
|
+
return Array.from(root.querySelectorAll(ENTRY_SELECTOR));
|
|
11
|
+
}
|
|
12
|
+
export function focusFirstNotificationEntry(root, options) {
|
|
13
|
+
const first = entriesUnder(root)[0];
|
|
14
|
+
if (first === undefined)
|
|
15
|
+
return false;
|
|
16
|
+
first.focus(options);
|
|
17
|
+
return first.ownerDocument.activeElement === first;
|
|
18
|
+
}
|
|
19
|
+
export function notificationListFocusStep(event, current, count, paging) {
|
|
20
|
+
if (count === 0)
|
|
21
|
+
return null;
|
|
22
|
+
switch (namedKeyOf(event)) {
|
|
23
|
+
case 'ArrowDown':
|
|
24
|
+
return current === null ? 0 : Math.min(count - 1, current + 1);
|
|
25
|
+
case 'ArrowUp':
|
|
26
|
+
return current === null ? count - 1 : Math.max(0, current - 1);
|
|
27
|
+
case 'Home':
|
|
28
|
+
return 0;
|
|
29
|
+
case 'End':
|
|
30
|
+
return count - 1;
|
|
31
|
+
case 'PageUp':
|
|
32
|
+
return paging === 'ends' ? 0 : paging(current, -1);
|
|
33
|
+
case 'PageDown':
|
|
34
|
+
return paging === 'ends' ? count - 1 : paging(current, 1);
|
|
35
|
+
default:
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function lastEndingBy(page, edge) {
|
|
40
|
+
let found = 0;
|
|
41
|
+
page.extents.forEach((extent, index) => {
|
|
42
|
+
if (extent.bottom <= edge)
|
|
43
|
+
found = index;
|
|
44
|
+
});
|
|
45
|
+
return found;
|
|
46
|
+
}
|
|
47
|
+
function firstStartingFrom(page, edge) {
|
|
48
|
+
if (edge <= 0)
|
|
49
|
+
return 0;
|
|
50
|
+
const found = page.extents.findIndex((extent) => extent.top >= edge);
|
|
51
|
+
return found < 0 ? page.extents.length - 1 : found;
|
|
52
|
+
}
|
|
53
|
+
export function notificationListPageStep(page, current, direction) {
|
|
54
|
+
const final = page.extents.length - 1;
|
|
55
|
+
if (direction === 1) {
|
|
56
|
+
const last = lastEndingBy(page, page.scrollTop + page.height);
|
|
57
|
+
if (current === null || last > current)
|
|
58
|
+
return last;
|
|
59
|
+
const scrolled = Math.min(page.maxScrollTop, page.scrollTop + page.height);
|
|
60
|
+
if (scrolled <= page.scrollTop || current >= final)
|
|
61
|
+
return current;
|
|
62
|
+
return Math.min(final, Math.max(current + 1, lastEndingBy(page, scrolled + page.height)));
|
|
63
|
+
}
|
|
64
|
+
const first = firstStartingFrom(page, page.scrollTop);
|
|
65
|
+
if (current === null || first < current)
|
|
66
|
+
return first;
|
|
67
|
+
const scrolled = Math.max(0, page.scrollTop - page.height);
|
|
68
|
+
if (scrolled >= page.scrollTop || current <= 0)
|
|
69
|
+
return current;
|
|
70
|
+
return Math.max(0, Math.min(current - 1, firstStartingFrom(page, scrolled)));
|
|
71
|
+
}
|
|
72
|
+
function measureNotificationListPage(viewport, entries) {
|
|
73
|
+
const origin = viewport.getBoundingClientRect().top + viewport.clientTop - viewport.scrollTop;
|
|
74
|
+
return {
|
|
75
|
+
extents: entries.map((entry) => {
|
|
76
|
+
const rect = entry.getBoundingClientRect();
|
|
77
|
+
return { top: rect.top - origin, bottom: rect.bottom - origin };
|
|
78
|
+
}),
|
|
79
|
+
scrollTop: viewport.scrollTop,
|
|
80
|
+
height: viewport.clientHeight,
|
|
81
|
+
maxScrollTop: Math.max(0, viewport.scrollHeight - viewport.clientHeight),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function isEditable(element) {
|
|
85
|
+
const tag = element.tagName;
|
|
86
|
+
return tag === 'INPUT' || tag === 'TEXTAREA' || element.isContentEditable;
|
|
87
|
+
}
|
|
88
|
+
export function moveNotificationEntryFocus(event, viewport) {
|
|
89
|
+
if (event.defaultPrevented)
|
|
90
|
+
return;
|
|
91
|
+
const target = event.target;
|
|
92
|
+
if (target === null || typeof target.closest !== 'function')
|
|
93
|
+
return;
|
|
94
|
+
if (isEditable(target))
|
|
95
|
+
return;
|
|
96
|
+
const entry = target.closest(ENTRY_SELECTOR);
|
|
97
|
+
if (entry === null)
|
|
98
|
+
return;
|
|
99
|
+
const entries = entriesUnder(viewport);
|
|
100
|
+
const current = entries.indexOf(entry);
|
|
101
|
+
if (current < 0)
|
|
102
|
+
return;
|
|
103
|
+
const next = notificationListFocusStep(event, current, entries.length, (from, direction) => notificationListPageStep(measureNotificationListPage(viewport, entries), from, direction));
|
|
104
|
+
if (next === null)
|
|
105
|
+
return;
|
|
106
|
+
event.preventDefault();
|
|
107
|
+
event.stopPropagation();
|
|
108
|
+
const destination = entries[next];
|
|
109
|
+
if (destination === undefined)
|
|
110
|
+
return;
|
|
111
|
+
destination.focus({ preventScroll: true });
|
|
112
|
+
destination.scrollIntoView({ block: 'nearest' });
|
|
113
|
+
}
|
|
114
|
+
export function followNotificationListFocus(options) {
|
|
115
|
+
let inside = false;
|
|
116
|
+
let lastEntry = null;
|
|
117
|
+
let lastIndex = -1;
|
|
118
|
+
const remember = (container, element) => {
|
|
119
|
+
lastEntry = element.closest(ENTRY_SELECTOR);
|
|
120
|
+
lastIndex = lastEntry === null ? -1 : entriesUnder(container).indexOf(lastEntry);
|
|
121
|
+
};
|
|
122
|
+
onMount(() => {
|
|
123
|
+
const container = options.container();
|
|
124
|
+
if (container === undefined)
|
|
125
|
+
return;
|
|
126
|
+
const doc = container.ownerDocument;
|
|
127
|
+
const onFocusIn = (event) => {
|
|
128
|
+
const target = event.target;
|
|
129
|
+
inside = target !== null && typeof target.closest === 'function' && container.contains(target);
|
|
130
|
+
if (inside && target !== null)
|
|
131
|
+
remember(container, target);
|
|
132
|
+
};
|
|
133
|
+
doc.addEventListener('focusin', onFocusIn, true);
|
|
134
|
+
onCleanup(() => doc.removeEventListener('focusin', onFocusIn, true));
|
|
135
|
+
});
|
|
136
|
+
createEffect(on(options.drawn, () => {
|
|
137
|
+
const container = options.container();
|
|
138
|
+
if (container === undefined || !inside)
|
|
139
|
+
return;
|
|
140
|
+
const doc = container.ownerDocument;
|
|
141
|
+
const active = doc.activeElement;
|
|
142
|
+
if (active !== null && container.contains(active)) {
|
|
143
|
+
remember(container, active);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (active !== null && active !== doc.body)
|
|
147
|
+
return;
|
|
148
|
+
const entries = entriesUnder(container);
|
|
149
|
+
const target = lastEntry !== null && entries.includes(lastEntry)
|
|
150
|
+
? lastEntry
|
|
151
|
+
: (entries[lastIndex - 1] ?? entries[0]);
|
|
152
|
+
if (target !== undefined)
|
|
153
|
+
target.focus();
|
|
154
|
+
else
|
|
155
|
+
options.fallback(container);
|
|
156
|
+
}, { defer: true }));
|
|
157
|
+
return { holdsFocus: () => inside };
|
|
158
|
+
}
|
|
159
|
+
export function timelineEntryAriaLabel(entry) {
|
|
160
|
+
const message = t('{severity}: {title}', {
|
|
161
|
+
severity: t(NOTIFICATION_SEVERITY_LABELS[entry.tone]),
|
|
162
|
+
title: entry.message,
|
|
163
|
+
});
|
|
164
|
+
const source = t('Source: {source}', {
|
|
165
|
+
source: resolveNotificationSource(entry.source).label,
|
|
166
|
+
});
|
|
167
|
+
return `${message}, ${source}`;
|
|
168
|
+
}
|
|
@@ -16,10 +16,10 @@ import { errorActionFailed } from './notifications.notifications';
|
|
|
16
16
|
import { silencedBySettings, turnedDownCard } from './fireNotification';
|
|
17
17
|
import { nextQuietHoursStart } from './quietHours';
|
|
18
18
|
const QUIET_HOURS_RECHECK_MS = 60 * 60_000;
|
|
19
|
-
function silencedCard(item) {
|
|
19
|
+
function silencedCard(item, filter) {
|
|
20
20
|
return (!item.isolated &&
|
|
21
21
|
item.priority !== 'acknowledgment-required' &&
|
|
22
|
-
silencedBySettings(item.source ?? 'general', item.priority ?? 'default'));
|
|
22
|
+
silencedBySettings(item.source ?? 'general', item.severity, item.priority ?? 'default', filter));
|
|
23
23
|
}
|
|
24
24
|
export class NotificationService {
|
|
25
25
|
deps;
|
|
@@ -28,6 +28,9 @@ export class NotificationService {
|
|
|
28
28
|
stack;
|
|
29
29
|
timeline;
|
|
30
30
|
onDidRequestNavigation;
|
|
31
|
+
onDidChangeFilter;
|
|
32
|
+
filter = 'off';
|
|
33
|
+
filterChange = new Emitter();
|
|
31
34
|
engine;
|
|
32
35
|
analytics = new NotificationAnalytics();
|
|
33
36
|
sounds;
|
|
@@ -49,8 +52,9 @@ export class NotificationService {
|
|
|
49
52
|
getSettings: () => notificationSettings.get(),
|
|
50
53
|
recordAutoFade: (source) => this.analytics.recordAutoFade(source),
|
|
51
54
|
warn: (message, error) => log.warn(message, error),
|
|
52
|
-
isSilenced: silencedCard,
|
|
55
|
+
isSilenced: (item) => silencedCard(item, this.filter),
|
|
53
56
|
isTurnedDown: turnedDownCard,
|
|
57
|
+
centerReachable: deps.centerReachable,
|
|
54
58
|
});
|
|
55
59
|
this.stack = this.engine;
|
|
56
60
|
this.timeline = new NotificationTimeline({
|
|
@@ -82,6 +86,7 @@ export class NotificationService {
|
|
|
82
86
|
timeline: this.timeline,
|
|
83
87
|
vendorErrors: deps.vendorErrors,
|
|
84
88
|
openExternal: (url) => openExternalUrl(deps.desktop, log, url),
|
|
89
|
+
filter: () => this.filter,
|
|
85
90
|
});
|
|
86
91
|
this.delivery = createCatalogDelivery({
|
|
87
92
|
toast: this.toast,
|
|
@@ -90,11 +95,13 @@ export class NotificationService {
|
|
|
90
95
|
onActionFailed: (cause) => this.notify(errorActionFailed, { cause }),
|
|
91
96
|
});
|
|
92
97
|
this.onDidRequestNavigation = this.navigation.event;
|
|
98
|
+
this.onDidChangeFilter = this.filterChange.event;
|
|
93
99
|
this.onSettingsChanged = () => {
|
|
94
100
|
clearCompiledRuleRegexCache();
|
|
95
101
|
this.sounds.invalidate();
|
|
96
102
|
this.timeline.refreshBadge();
|
|
97
103
|
this.takeBackSilencedCards();
|
|
104
|
+
this.engine.refresh();
|
|
98
105
|
if (this.watchingQuietHours)
|
|
99
106
|
this.watchQuietHoursStart();
|
|
100
107
|
};
|
|
@@ -144,6 +151,16 @@ export class NotificationService {
|
|
|
144
151
|
requestNavigation(route) {
|
|
145
152
|
this.navigation.fire(route);
|
|
146
153
|
}
|
|
154
|
+
getFilter() {
|
|
155
|
+
return this.filter;
|
|
156
|
+
}
|
|
157
|
+
setFilter(filter) {
|
|
158
|
+
if (filter === this.filter)
|
|
159
|
+
return;
|
|
160
|
+
this.filter = filter;
|
|
161
|
+
this.takeBackSilencedCards();
|
|
162
|
+
this.filterChange.fire(filter);
|
|
163
|
+
}
|
|
147
164
|
dispose() {
|
|
148
165
|
window.removeEventListener(notificationSettings.changeEvent, this.onSettingsChanged);
|
|
149
166
|
this.stopWatchingCards();
|
|
@@ -152,9 +169,10 @@ export class NotificationService {
|
|
|
152
169
|
this.audio.dispose();
|
|
153
170
|
this.engine.dispose();
|
|
154
171
|
this.navigation.dispose();
|
|
172
|
+
this.filterChange.dispose();
|
|
155
173
|
}
|
|
156
174
|
takeBackSilencedCards() {
|
|
157
|
-
this.engine.suppress(silencedCard);
|
|
175
|
+
this.engine.suppress((item) => silencedCard(item, this.filter));
|
|
158
176
|
}
|
|
159
177
|
watchQuietHoursStart() {
|
|
160
178
|
this.stopWatchingQuietHours();
|
|
@@ -53,6 +53,12 @@ export const suppressedProgressHandle = {
|
|
|
53
53
|
state: () => 'suppressed',
|
|
54
54
|
onDidChangeState: () => ({ dispose: () => undefined }),
|
|
55
55
|
};
|
|
56
|
+
function issueKeysOf(options) {
|
|
57
|
+
return {
|
|
58
|
+
dontShowAgainKey: options.dontShowAgainKey,
|
|
59
|
+
remindKey: options.remindKey,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
56
62
|
function applyNotificationRulesFromSettings(input) {
|
|
57
63
|
return applyNotificationRules(input, notificationSettings.get().notificationRules);
|
|
58
64
|
}
|
|
@@ -70,7 +76,15 @@ export function createToast(deps) {
|
|
|
70
76
|
});
|
|
71
77
|
if (!ruled)
|
|
72
78
|
return '';
|
|
73
|
-
const decision = decideFilter(
|
|
79
|
+
const decision = decideFilter({
|
|
80
|
+
source: ruled.source,
|
|
81
|
+
title: ruled.title,
|
|
82
|
+
severity: ruled.severity,
|
|
83
|
+
priority: ruled.priority,
|
|
84
|
+
recordTimeline: options.recordTimeline,
|
|
85
|
+
filter: deps.filter(),
|
|
86
|
+
...issueKeysOf(options),
|
|
87
|
+
});
|
|
74
88
|
if (decision.recordTimeline)
|
|
75
89
|
timeline.add(ruled.title, ruled.severity, ruled.source, ruled.priority, toTimelineActions(options.action));
|
|
76
90
|
if (!settings.showSuccessToasts && ruled.priority !== 'urgent')
|
|
@@ -101,7 +115,15 @@ export function createToast(deps) {
|
|
|
101
115
|
if (!ruled)
|
|
102
116
|
return '';
|
|
103
117
|
const { source, priority } = ruled;
|
|
104
|
-
const decision = decideFilter(
|
|
118
|
+
const decision = decideFilter({
|
|
119
|
+
source,
|
|
120
|
+
title: ruled.title,
|
|
121
|
+
severity: ruled.severity,
|
|
122
|
+
priority,
|
|
123
|
+
recordTimeline: options.recordTimeline,
|
|
124
|
+
filter: deps.filter(),
|
|
125
|
+
...issueKeysOf(options),
|
|
126
|
+
});
|
|
105
127
|
if (decision.recordTimeline)
|
|
106
128
|
timeline.add(timelineText, ruled.severity, source, priority, toTimelineActions(options.action), options.vendorError);
|
|
107
129
|
const handle = fire(sinks, {
|
|
@@ -125,7 +147,15 @@ export function createToast(deps) {
|
|
|
125
147
|
const settings = notificationSettings.get();
|
|
126
148
|
const source = options.source ?? 'sql-execution';
|
|
127
149
|
const priority = options.priority ?? 'default';
|
|
128
|
-
const decision = decideFilter(
|
|
150
|
+
const decision = decideFilter({
|
|
151
|
+
source,
|
|
152
|
+
title: text,
|
|
153
|
+
severity: 'success',
|
|
154
|
+
priority,
|
|
155
|
+
recordTimeline: options.recordTimeline,
|
|
156
|
+
filter: deps.filter(),
|
|
157
|
+
...issueKeysOf(options),
|
|
158
|
+
});
|
|
129
159
|
if (decision.recordTimeline)
|
|
130
160
|
timeline.add(text, 'success', source, priority, toTimelineActions(options.action));
|
|
131
161
|
if (settings.notificationsEnabled &&
|
|
@@ -150,11 +180,20 @@ export function createToast(deps) {
|
|
|
150
180
|
const source = options.source ?? 'general';
|
|
151
181
|
const priority = options.priority ?? 'default';
|
|
152
182
|
const explicitId = options.id !== undefined ? String(options.id) : undefined;
|
|
153
|
-
const
|
|
183
|
+
const keys = issueKeysOf(options);
|
|
184
|
+
const decision = decideFilter({
|
|
185
|
+
source,
|
|
186
|
+
title: text,
|
|
187
|
+
severity: 'info',
|
|
188
|
+
priority,
|
|
189
|
+
recordTimeline: options.recordTimeline,
|
|
190
|
+
filter: deps.filter(),
|
|
191
|
+
...keys,
|
|
192
|
+
});
|
|
154
193
|
if (decision.recordTimeline)
|
|
155
194
|
timeline.add(text, 'info', source, priority);
|
|
156
195
|
if (!decision.showToast &&
|
|
157
|
-
(turnedDownOnCard(source, text,
|
|
196
|
+
(turnedDownOnCard(source, text, keys) ||
|
|
158
197
|
priority === 'acknowledgment-required')) {
|
|
159
198
|
if (explicitId !== undefined)
|
|
160
199
|
sinks.engine.reject(explicitId);
|
|
@@ -172,7 +211,7 @@ export function createToast(deps) {
|
|
|
172
211
|
priority,
|
|
173
212
|
sticky: true,
|
|
174
213
|
progress: onCancel ? { onCancel } : {},
|
|
175
|
-
remindKey: deriveImplicitRemindKey(source, text),
|
|
214
|
+
remindKey: keys.remindKey ?? keys.dontShowAgainKey ?? deriveImplicitRemindKey(source, text),
|
|
176
215
|
...(actions.length > 0 ? { actions } : {}),
|
|
177
216
|
});
|
|
178
217
|
return {
|
|
@@ -223,7 +262,15 @@ function plainVerb(deps, severity, message, options) {
|
|
|
223
262
|
});
|
|
224
263
|
if (!ruled)
|
|
225
264
|
return '';
|
|
226
|
-
const decision = decideFilter(
|
|
265
|
+
const decision = decideFilter({
|
|
266
|
+
source: ruled.source,
|
|
267
|
+
title: ruled.title,
|
|
268
|
+
severity: ruled.severity,
|
|
269
|
+
priority: ruled.priority,
|
|
270
|
+
recordTimeline: options.recordTimeline,
|
|
271
|
+
filter: deps.filter(),
|
|
272
|
+
...issueKeysOf(options),
|
|
273
|
+
});
|
|
227
274
|
if (decision.recordTimeline)
|
|
228
275
|
deps.timeline.add(ruled.title, ruled.severity, ruled.source, ruled.priority, toTimelineActions(options.action));
|
|
229
276
|
const handle = fire(deps.sinks, {
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
+
export function filteredPriority(priority, severity, filter) {
|
|
2
|
+
return filter === 'errors-only' &&
|
|
3
|
+
(priority === 'default' || priority === 'optional') &&
|
|
4
|
+
severity !== 'error'
|
|
5
|
+
? 'silent'
|
|
6
|
+
: priority;
|
|
7
|
+
}
|
|
1
8
|
export function deriveImplicitRemindKey(source, title) {
|
|
2
9
|
return `__remind:${source}:${title}`;
|
|
3
10
|
}
|
|
11
|
+
export function cardRemindKey(card) {
|
|
12
|
+
return (card.remindKey ??
|
|
13
|
+
card.neverShowAgainKey ??
|
|
14
|
+
deriveImplicitRemindKey(card.source ?? 'general', card.title));
|
|
15
|
+
}
|
|
4
16
|
export function decideFilter(input, settings, gates) {
|
|
5
17
|
const { priority } = input;
|
|
6
18
|
const allowTimeline = input.recordTimeline !== false;
|
|
@@ -10,6 +10,7 @@ import { createDialogFocusScope } from './dialogFocusScope';
|
|
|
10
10
|
import { trapTabFocusWithin } from './modalFocusContainment';
|
|
11
11
|
import { resolveDialogShellKeyIntent } from './dialogShellKeyIntent';
|
|
12
12
|
import { createOverlayCloseGuard } from './overlayCloseGuard';
|
|
13
|
+
import { modalBackgroundExemption } from './backgroundInert';
|
|
13
14
|
import styles from './Drawer.module.css.js';
|
|
14
15
|
import { isKey } from '../_internal/base/keys';
|
|
15
16
|
export function Drawer(props) {
|
|
@@ -94,7 +95,7 @@ export function Drawer(props) {
|
|
|
94
95
|
});
|
|
95
96
|
return (<Show when={openedIn()}>
|
|
96
97
|
{(doc) => (<Portal mount={props.container ?? doc().body}>
|
|
97
|
-
<div class={`${styles.backdrop} ${contained() ? (styles.contained ?? '') : ''}`} onMouseDown={handleOverlayMouseDown} onClick={handleOverlayClick} aria-hidden="true"/>
|
|
98
|
+
<div class={`${styles.backdrop} ${contained() ? (styles.contained ?? '') : ''}`} onMouseDown={handleOverlayMouseDown} onClick={handleOverlayClick} aria-hidden="true" {...modalBackgroundExemption('dialog-backdrop')}/>
|
|
98
99
|
<div ref={captureAndFocus} class={`${styles.drawer} ${placementClass()} ${sizeClass()} ${contained() ? (styles.contained ?? '') : ''} ${props.class ?? ''}`} role="dialog" aria-modal={contained() ? undefined : 'true'} aria-label={props.ariaLabel ?? props.title ?? t('Drawer')} tabIndex={-1} onKeyDown={handleKeyDown}>
|
|
99
100
|
<header class={styles.header}>
|
|
100
101
|
<Show when={props.title} fallback={<div />}>
|