@vokril/ui-solid 0.29.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 +71 -0
- package/README.md +27 -0
- 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-7Izs_msz.js → StatusBarNotificationBell-ZTEhZFmJ.js} +4279 -4002
- 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 +9 -0
- package/dist/_internal/contract/notification.d.ts +9 -0
- 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 +547 -541
- 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 +9 -0
- package/dist/notifications/NotificationItem.d.ts +9 -0
- 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/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 +55 -52
- package/dist/notifications/nativeEngine.d.cts +4 -3
- package/dist/notifications/nativeEngine.d.ts +4 -3
- package/dist/notifications/notificationEntryList.d.cts +91 -0
- package/dist/notifications/notificationEntryList.d.ts +91 -0
- package/dist/notifications/notificationService.d.cts +23 -2
- package/dist/notifications/notificationService.d.ts +23 -2
- 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-D8Jt3PXI.js → StatusBarNotificationBell-DW2l5O9B.js} +4216 -3949
- 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 +502 -497
- 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 +55 -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 +5 -18
- 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 +8 -3
- 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/notificationEntryList.js +168 -0
- package/dist/solid/notifications/notificationService.js +20 -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-BJiORN4s.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-LJHLMT9F.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
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Show, batch, createEffect, createMemo, createSignal, on, onCleanup, onMount, } from 'solid-js';
|
|
2
|
+
import { useKitHost } from '../host/kitHost';
|
|
3
|
+
import { OverlayPortal } from '../overlay/OverlayPortal';
|
|
4
|
+
import { AnchorAlignment, AnchorPosition, layout2d, } from '../overlay/anchoredLayout';
|
|
5
|
+
import { t } from '../i18n/i18n';
|
|
6
|
+
import styles from './Input.module.css.js';
|
|
7
|
+
const TONE_WORD = {
|
|
8
|
+
error: 'Error',
|
|
9
|
+
warning: 'Warning',
|
|
10
|
+
info: 'Info',
|
|
11
|
+
};
|
|
12
|
+
export function InputMessageView(props) {
|
|
13
|
+
const { announcer } = useKitHost();
|
|
14
|
+
const [home, setHome] = createSignal();
|
|
15
|
+
const [focused, setFocused] = createSignal(false);
|
|
16
|
+
let messageEl;
|
|
17
|
+
const onFocus = () => {
|
|
18
|
+
batch(() => {
|
|
19
|
+
setHome(props.input.ownerDocument);
|
|
20
|
+
setFocused(true);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
const onBlur = () => {
|
|
24
|
+
setFocused(false);
|
|
25
|
+
};
|
|
26
|
+
props.input.addEventListener('focus', onFocus);
|
|
27
|
+
props.input.addEventListener('blur', onBlur);
|
|
28
|
+
onCleanup(() => {
|
|
29
|
+
props.input.removeEventListener('focus', onFocus);
|
|
30
|
+
props.input.removeEventListener('blur', onBlur);
|
|
31
|
+
});
|
|
32
|
+
onMount(() => {
|
|
33
|
+
const doc = props.input.ownerDocument;
|
|
34
|
+
batch(() => {
|
|
35
|
+
setHome(doc);
|
|
36
|
+
setFocused(doc.activeElement === props.input);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
const tone = createMemo(() => props.message.tone);
|
|
40
|
+
const text = createMemo(() => props.message.text);
|
|
41
|
+
createEffect(on([tone, text], ([currentTone, currentText]) => {
|
|
42
|
+
if (!focused())
|
|
43
|
+
return;
|
|
44
|
+
announcer.announce(t('{severity}: {title}', {
|
|
45
|
+
severity: t(TONE_WORD[currentTone]),
|
|
46
|
+
title: currentText,
|
|
47
|
+
}), currentTone === 'error' ? 'assertive' : 'polite');
|
|
48
|
+
}));
|
|
49
|
+
const layout = () => {
|
|
50
|
+
const view = props.input.ownerDocument.defaultView;
|
|
51
|
+
if (!messageEl || !view)
|
|
52
|
+
return;
|
|
53
|
+
const anchor = props.input.getBoundingClientRect();
|
|
54
|
+
messageEl.style.width = `${anchor.width}px`;
|
|
55
|
+
const result = layout2d({ top: 0, left: 0, width: view.innerWidth, height: view.innerHeight }, { width: anchor.width, height: messageEl.offsetHeight }, { top: anchor.top, left: anchor.left, width: anchor.width, height: anchor.height }, { anchorAlignment: AnchorAlignment.RIGHT, anchorPosition: AnchorPosition.BELOW });
|
|
56
|
+
messageEl.style.top = `${result.top}px`;
|
|
57
|
+
messageEl.style.left = `${result.left}px`;
|
|
58
|
+
};
|
|
59
|
+
createEffect(() => {
|
|
60
|
+
const view = home()?.defaultView;
|
|
61
|
+
if (!focused() || !view)
|
|
62
|
+
return;
|
|
63
|
+
text();
|
|
64
|
+
layout();
|
|
65
|
+
const relayout = () => layout();
|
|
66
|
+
view.addEventListener('resize', relayout);
|
|
67
|
+
view.addEventListener('scroll', relayout, true);
|
|
68
|
+
const Observer = view.ResizeObserver;
|
|
69
|
+
const observer = Observer ? new Observer(relayout) : undefined;
|
|
70
|
+
observer?.observe(props.input);
|
|
71
|
+
if (messageEl)
|
|
72
|
+
observer?.observe(messageEl);
|
|
73
|
+
onCleanup(() => {
|
|
74
|
+
view.removeEventListener('resize', relayout);
|
|
75
|
+
view.removeEventListener('scroll', relayout, true);
|
|
76
|
+
observer?.disconnect();
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
return (<Show when={home()} keyed>
|
|
80
|
+
{(doc) => (<OverlayPortal type="floating" idPrefix="input-message" mount={doc.body} open={focused} element={() => messageEl}>
|
|
81
|
+
<div ref={messageEl} id={props.id} class={styles.message} data-tone={tone()} hidden={!focused()}>
|
|
82
|
+
{text()}
|
|
83
|
+
</div>
|
|
84
|
+
</OverlayPortal>)}
|
|
85
|
+
</Show>);
|
|
86
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createUniqueId, onCleanup, splitProps, } from 'solid-js';
|
|
2
2
|
import { tooltipCoordinator, } from '../overlay/tooltipCoordinator';
|
|
3
|
+
import { holdNativeTitle, releaseNativeTitle } from '../overlay/nativeTitleHold';
|
|
3
4
|
import styles from './PressableSurface.module.css.js';
|
|
4
5
|
import { isKey } from '../_internal/base/keys';
|
|
5
6
|
const APPEARANCE_CLASS = {
|
|
@@ -55,10 +56,7 @@ export function PressableSurface(props) {
|
|
|
55
56
|
const tip = effectiveTooltip();
|
|
56
57
|
if (!tip || !surfaceRef)
|
|
57
58
|
return;
|
|
58
|
-
|
|
59
|
-
surfaceRef.setAttribute('data-suppressed-title', surfaceRef.getAttribute('title') ?? '');
|
|
60
|
-
surfaceRef.removeAttribute('title');
|
|
61
|
-
}
|
|
59
|
+
holdNativeTitle(surfaceRef);
|
|
62
60
|
tooltipCoordinator.showTooltip({
|
|
63
61
|
id: tooltipId,
|
|
64
62
|
target: surfaceRef,
|
|
@@ -67,18 +65,9 @@ export function PressableSurface(props) {
|
|
|
67
65
|
placement: local.tooltipPlacement,
|
|
68
66
|
});
|
|
69
67
|
};
|
|
70
|
-
const restoreNativeTitle = () => {
|
|
71
|
-
if (surfaceRef && surfaceRef.hasAttribute('data-suppressed-title')) {
|
|
72
|
-
const original = surfaceRef.getAttribute('data-suppressed-title');
|
|
73
|
-
if (original) {
|
|
74
|
-
surfaceRef.setAttribute('title', original);
|
|
75
|
-
}
|
|
76
|
-
surfaceRef.removeAttribute('data-suppressed-title');
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
68
|
const hideTooltip = () => {
|
|
80
|
-
restoreNativeTitle();
|
|
81
69
|
if (surfaceRef) {
|
|
70
|
+
releaseNativeTitle(surfaceRef);
|
|
82
71
|
tooltipCoordinator.hideTooltip(surfaceRef);
|
|
83
72
|
}
|
|
84
73
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createSignal, onCleanup } from 'solid-js';
|
|
2
2
|
import { isKey } from '../_internal/base/keys';
|
|
3
|
+
import { createResizeCarry } from './resizeCarry';
|
|
3
4
|
import styles from './ResizeHandle.module.css.js';
|
|
4
5
|
export function ResizeHandle(props) {
|
|
5
6
|
const [isDragging, setIsDragging] = createSignal(false);
|
|
@@ -15,13 +16,22 @@ export function ResizeHandle(props) {
|
|
|
15
16
|
setIsDragging(true);
|
|
16
17
|
let lastX = e.clientX;
|
|
17
18
|
let lastY = e.clientY;
|
|
19
|
+
const { min, max } = props;
|
|
20
|
+
const carry = typeof min === 'number' && typeof max === 'number' && props.value !== undefined
|
|
21
|
+
? createResizeCarry({ min, max })
|
|
22
|
+
: null;
|
|
18
23
|
const onPointerMove = (moveEvent) => {
|
|
19
24
|
const deltaX = moveEvent.clientX - lastX;
|
|
20
25
|
const deltaY = moveEvent.clientY - lastY;
|
|
21
26
|
lastX = moveEvent.clientX;
|
|
22
27
|
lastY = moveEvent.clientY;
|
|
23
28
|
const delta = orientation() === 'horizontal' ? deltaX : deltaY;
|
|
24
|
-
|
|
29
|
+
if (carry) {
|
|
30
|
+
carry.step(delta, () => props.value ?? 0, (applied) => props.onResize?.(applied));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
props.onResize?.(delta);
|
|
34
|
+
}
|
|
25
35
|
};
|
|
26
36
|
const onPointerUp = (upEvent) => {
|
|
27
37
|
try {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function createResizeCarry(bounds) {
|
|
2
|
+
let carried = 0;
|
|
3
|
+
return {
|
|
4
|
+
step(delta, read, apply) {
|
|
5
|
+
let move = delta;
|
|
6
|
+
if (carried !== 0) {
|
|
7
|
+
const next = carried + move;
|
|
8
|
+
if (Math.sign(next) === Math.sign(carried)) {
|
|
9
|
+
carried = next;
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
carried = 0;
|
|
13
|
+
move = next;
|
|
14
|
+
}
|
|
15
|
+
if (move === 0)
|
|
16
|
+
return;
|
|
17
|
+
const before = read();
|
|
18
|
+
apply(move);
|
|
19
|
+
const after = read();
|
|
20
|
+
const changed = after - before;
|
|
21
|
+
const atBound = after <= bounds.min || after >= bounds.max;
|
|
22
|
+
if (!atBound)
|
|
23
|
+
return;
|
|
24
|
+
const appliedInPointerSpace = changed === 0 ? 0 : Math.sign(changed) === Math.sign(move) ? changed : -changed;
|
|
25
|
+
const unapplied = move - appliedInPointerSpace;
|
|
26
|
+
if (unapplied !== 0 && Math.sign(unapplied) === Math.sign(move)) {
|
|
27
|
+
carried = unapplied;
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -18,6 +18,7 @@ import { FOCUS_CONTEXT_KEYS } from '../_internal/app/keybindings/contextKey/buil
|
|
|
18
18
|
import { registerNotificationCommands } from './notificationCommands';
|
|
19
19
|
import { appWindowNotificationOverlay, } from './notificationOverlayChannel';
|
|
20
20
|
import { createNotificationOverlaySync } from './notificationOverlaySync';
|
|
21
|
+
import { notificationListFocusStep } from './notificationEntryList';
|
|
21
22
|
import { modalBackgroundExemption } from '../overlay/backgroundInert';
|
|
22
23
|
import styles from './NotificationHost.module.css.js';
|
|
23
24
|
import { isKey } from '../_internal/base/keys';
|
|
@@ -110,24 +111,10 @@ export const NotificationHost = (props) => {
|
|
|
110
111
|
if (!hostEl()?.contains(eventTarget))
|
|
111
112
|
return;
|
|
112
113
|
const idx = focusIndex();
|
|
113
|
-
|
|
114
|
+
const step = notificationListFocusStep(event, idx, list.length, 'ends');
|
|
115
|
+
if (step !== null) {
|
|
114
116
|
event.preventDefault();
|
|
115
|
-
setFocusIndex(
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
if (isKey(event, 'ArrowUp') || isKey(event, 'PageUp')) {
|
|
119
|
-
event.preventDefault();
|
|
120
|
-
setFocusIndex(idx === null ? list.length - 1 : Math.max(0, idx - 1));
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
if (isKey(event, 'Home')) {
|
|
124
|
-
event.preventDefault();
|
|
125
|
-
setFocusIndex(0);
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
if (isKey(event, 'End')) {
|
|
129
|
-
event.preventDefault();
|
|
130
|
-
setFocusIndex(list.length - 1);
|
|
117
|
+
setFocusIndex(step);
|
|
131
118
|
return;
|
|
132
119
|
}
|
|
133
120
|
if (idx === null)
|
|
@@ -267,7 +254,7 @@ export const NotificationHost = (props) => {
|
|
|
267
254
|
<OverlayScrollArea rootClass={styles.scrollArea} viewportClass={styles.stack} viewportRef={setScrollEl} hideHorizontal>
|
|
268
255
|
<For each={visible()}>
|
|
269
256
|
{(item, index) => (<div class={styles.enter} data-focused={focusIndex() === index() ? 'true' : 'false'}>
|
|
270
|
-
<NotificationItem item={item} controller={controller} shell={item.isolated ? null : shell}/>
|
|
257
|
+
<NotificationItem item={item} controller={controller} shell={item.isolated ? null : shell} corner={effectivePosition()}/>
|
|
271
258
|
</div>)}
|
|
272
259
|
</For>
|
|
273
260
|
</OverlayScrollArea>
|
|
@@ -3,7 +3,7 @@ import { Dynamic } from 'solid-js/web';
|
|
|
3
3
|
import { Show, For, createEffect, createMemo, createSignal, onCleanup, useContext, } from 'solid-js';
|
|
4
4
|
import { useRelativeNow } from './relativeTimeClock';
|
|
5
5
|
import { prefersReducedMotion } from '../a11y/prefersReducedMotion';
|
|
6
|
-
import {
|
|
6
|
+
import { cardRemindKey } from './toastFilterPolicy';
|
|
7
7
|
import { HoverTooltip } from '../overlay/HoverTooltip';
|
|
8
8
|
import { Button } from '../forms/Button';
|
|
9
9
|
import { Progress } from '../feedback/Progress';
|
|
@@ -14,6 +14,8 @@ import { relativeAgeLabel } from '../_internal/platform/intl/relativeAgeLabel';
|
|
|
14
14
|
import { isProgressRunning, } from './nativeEngine';
|
|
15
15
|
import { renderNotificationMarkdown } from './markdownRender';
|
|
16
16
|
import { NOTIFICATION_SEVERITY_LABELS } from './notificationSeverityLabels';
|
|
17
|
+
import { notificationEntryMark } from './notificationEntryList';
|
|
18
|
+
import { toastCornerEdge } from './toastCorner';
|
|
17
19
|
import { getGoogleSearchUrl, } from '../_internal/platform/vendorErrors';
|
|
18
20
|
import { DesktopContextMenuContext } from '../context/DesktopContextMenuContext';
|
|
19
21
|
import { placeMenuAtTrigger } from '../overlay/context-menu/desktopMenuPlacement';
|
|
@@ -240,9 +242,7 @@ export const NotificationItem = (props) => {
|
|
|
240
242
|
const gearTrigger = event.currentTarget;
|
|
241
243
|
const source = props.item.source;
|
|
242
244
|
const dontShowKey = props.item.neverShowAgainKey;
|
|
243
|
-
const remindKey =
|
|
244
|
-
props.item.remindKey ??
|
|
245
|
-
deriveImplicitRemindKey(source ?? 'general', props.item.title);
|
|
245
|
+
const remindKey = cardRemindKey(props.item);
|
|
246
246
|
const items = [];
|
|
247
247
|
if (dontShowKey) {
|
|
248
248
|
items.push({
|
|
@@ -323,7 +323,7 @@ export const NotificationItem = (props) => {
|
|
|
323
323
|
close();
|
|
324
324
|
}
|
|
325
325
|
};
|
|
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 ?
|
|
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-edge={props.corner === undefined ? undefined : toastCornerEdge(props.corner)} data-has-actions={props.item.actions && props.item.actions.length > 0 ? 'true' : 'false'} data-has-timer={hasTimer() ? 'true' : 'false'} {...(props.inCenter ? notificationEntryMark : { 'aria-live': announcement() })} aria-atomic={props.inCenter ? undefined : 'true'} aria-label={t('{severity}: {title}', {
|
|
327
327
|
severity: t(NOTIFICATION_SEVERITY_LABELS[props.item.severity]),
|
|
328
328
|
title: props.item.title,
|
|
329
329
|
})} onMouseEnter={() => {
|
|
@@ -19,6 +19,7 @@ import { openExternalUrl } from '../_internal/app/platform/electronBridge';
|
|
|
19
19
|
import { useKitHost } from '../host/kitHost';
|
|
20
20
|
import { realmNotificationShell } from './notificationCardServices';
|
|
21
21
|
import { RunningProgressCards, useRunningProgressCards, } from './RunningProgressCards';
|
|
22
|
+
import { followNotificationListFocus, moveNotificationEntryFocus, notificationEntryMark, timelineEntryAriaLabel, } from './notificationEntryList';
|
|
22
23
|
import { notificationSettings } from '../_internal/app/settings/descriptors/notification';
|
|
23
24
|
import { useSettingsSubscription } from '../_internal/app/settings/useSettingsSubscription';
|
|
24
25
|
import { useDesktopContextMenu } from '../context/DesktopContextMenuContext';
|
|
@@ -122,6 +123,13 @@ export function NotificationPanel(props) {
|
|
|
122
123
|
}
|
|
123
124
|
return groupTimelineEntries(filteredEntries(), s.timelineGroupBy);
|
|
124
125
|
});
|
|
126
|
+
let panelEl;
|
|
127
|
+
let listEl;
|
|
128
|
+
followNotificationListFocus({
|
|
129
|
+
container: () => listEl,
|
|
130
|
+
drawn: () => [running(), displayRows(), expandedGroupKeys()],
|
|
131
|
+
fallback: () => panelEl.focus(),
|
|
132
|
+
});
|
|
125
133
|
const toggleGroupExpanded = (groupId) => {
|
|
126
134
|
toggleInSet(setExpandedGroupKeys, groupId);
|
|
127
135
|
};
|
|
@@ -575,7 +583,7 @@ export function NotificationPanel(props) {
|
|
|
575
583
|
onSelect: action.onSelect,
|
|
576
584
|
})));
|
|
577
585
|
};
|
|
578
|
-
return (<aside class={styles.rightRail} tabIndex={-1} onClick={ackUnread} onKeyDown={ackUnread}>
|
|
586
|
+
return (<aside ref={panelEl} class={styles.rightRail} tabIndex={-1} onClick={ackUnread} onKeyDown={ackUnread}>
|
|
579
587
|
<section class={styles.notificationPanel} data-tour-target="notifications-panel">
|
|
580
588
|
<Panel.Header class={styles.notificationPanelHeader} ref={(el) => (headerEl = el)}>
|
|
581
589
|
<PressableSurface type="button" class={styles.notificationPanelTitleWrap} data-tour-target="notifications-settings" onClick={openTitleMenu} ref={(el) => el.setAttribute('data-desktop-menu-depth', 'trigger')} title={t('Notification menu')} aria-haspopup="menu">
|
|
@@ -640,7 +648,9 @@ export function NotificationPanel(props) {
|
|
|
640
648
|
</Button>
|
|
641
649
|
</Show>
|
|
642
650
|
</LogFilterBar>
|
|
643
|
-
<OverlayScrollArea viewportClass={styles.notificationTimeline}
|
|
651
|
+
<OverlayScrollArea viewportClass={styles.notificationTimeline} viewportRef={(element) => {
|
|
652
|
+
listEl = element;
|
|
653
|
+
}} data-tour-target="notifications-timeline" onKeyDown={(event) => moveNotificationEntryFocus(event, event.currentTarget)}>
|
|
644
654
|
<RunningProgressCards items={running()}/>
|
|
645
655
|
<Show when={filteredEntries().length > 0} fallback={<Show when={hasActiveFilter() || running().length === 0}>
|
|
646
656
|
<p class={styles.notificationEmpty}>
|
|
@@ -687,9 +697,9 @@ export function NotificationPanel(props) {
|
|
|
687
697
|
</aside>);
|
|
688
698
|
function renderEntryRow(entry) {
|
|
689
699
|
const vendorMatch = () => vendorMatchOf(entry);
|
|
690
|
-
return (<article class={`${styles.notificationItem} ${selectMode() && selectedIds().has(entry.id)
|
|
700
|
+
return (<article {...notificationEntryMark} class={`${styles.notificationItem} ${selectMode() && selectedIds().has(entry.id)
|
|
691
701
|
? (styles.notificationItemSelected ?? '')
|
|
692
|
-
: ''}`} onContextMenu={(event) => {
|
|
702
|
+
: ''}`} tabIndex={-1} aria-label={timelineEntryAriaLabel(entry)} onContextMenu={(event) => {
|
|
693
703
|
showEntryContextMenu(event, entry);
|
|
694
704
|
}}>
|
|
695
705
|
<div class={styles.notificationItemTop}>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { For, Show, createMemo, createSignal, onCleanup, onMount, } from 'solid-js';
|
|
1
|
+
import { For, Show, createEffect, createMemo, createSignal, on, onCleanup, onMount, } from 'solid-js';
|
|
2
2
|
import { Dynamic } from 'solid-js/web';
|
|
3
3
|
import { VpInfo, VpWarning, VpError, VpPass, VpTreeClose, VpGear, } from '@vokril/icons';
|
|
4
|
-
import { VpBell, VpBellOff, VpChevronDown, VpTrash } from '@vokril/icons';
|
|
4
|
+
import { VpBell, VpBellOff, VpChevronDown, VpChevronUp, VpTrash, } from '@vokril/icons';
|
|
5
|
+
import { toastCornerEdge } from './toastCorner';
|
|
5
6
|
import { notificationSettingsUpdateFailed } from './notifications.notifications';
|
|
6
7
|
import { entryVendorMatch, } from './notificationTimeline';
|
|
7
8
|
import { notificationSettings } from '../_internal/app/settings/descriptors/notification';
|
|
@@ -15,6 +16,8 @@ import { realmNotificationShell } from './notificationCardServices';
|
|
|
15
16
|
import { RunningProgressCards, useRunningProgressCards, } from './RunningProgressCards';
|
|
16
17
|
import { useDesktopContextMenu } from '../context/DesktopContextMenuContext';
|
|
17
18
|
import { OverlayScrollArea } from '../overlay/OverlayScrollArea';
|
|
19
|
+
import { restoreFocusTo } from '../overlay/dialogFocusRestore';
|
|
20
|
+
import { focusFirstNotificationEntry, followNotificationListFocus, moveNotificationEntryFocus, notificationEntryMark, timelineEntryAriaLabel, } from './notificationEntryList';
|
|
18
21
|
import { Button } from '../forms/Button';
|
|
19
22
|
import { EmptyState } from '../feedback/EmptyState';
|
|
20
23
|
import { t } from '../i18n/i18n';
|
|
@@ -46,31 +49,81 @@ export function NotificationsCenter(props) {
|
|
|
46
49
|
const host = useKitHost();
|
|
47
50
|
const { notifications } = host;
|
|
48
51
|
const shell = realmNotificationShell(host);
|
|
52
|
+
const corner = () => props.corner ?? 'bottom-right';
|
|
49
53
|
const log = host.log.withTag('NotificationsCenter');
|
|
50
54
|
const openExternal = (url) => openExternalUrl(host.desktop, log, url);
|
|
51
55
|
const [entries, setEntries] = createSignal([]);
|
|
52
|
-
const [
|
|
56
|
+
const [dndSetting, setDndSetting] = createSignal(notificationSettings.get().doNotDisturb);
|
|
57
|
+
const [filtered, setFiltered] = createSignal(notifications.getFilter() !== 'off');
|
|
53
58
|
const desktopMenu = useDesktopContextMenu();
|
|
54
59
|
const running = useRunningProgressCards();
|
|
55
60
|
onMount(() => {
|
|
56
61
|
const unsubscribe = notifications.timeline.subscribe(setEntries);
|
|
57
|
-
|
|
62
|
+
const filterChange = notifications.onDidChangeFilter((filter) => setFiltered(filter !== 'off'));
|
|
63
|
+
onCleanup(() => {
|
|
64
|
+
unsubscribe();
|
|
65
|
+
filterChange.dispose();
|
|
66
|
+
});
|
|
58
67
|
});
|
|
59
68
|
useSettingsSubscription(notificationSettings, () => {
|
|
60
|
-
|
|
69
|
+
setDndSetting(notificationSettings.get().doNotDisturb);
|
|
61
70
|
});
|
|
71
|
+
const dnd = () => dndSetting() || filtered();
|
|
72
|
+
const silenced = createMemo(dnd);
|
|
73
|
+
createEffect(on(silenced, (isSilenced, wasSilenced) => {
|
|
74
|
+
if (wasSilenced === false && isSilenced)
|
|
75
|
+
props.onHide();
|
|
76
|
+
}));
|
|
62
77
|
const ordered = createMemo(() => [...entries()].sort((a, b) => b.createdAt - a.createdAt));
|
|
78
|
+
let centerEl;
|
|
79
|
+
const listFocus = followNotificationListFocus({
|
|
80
|
+
container: () => centerEl,
|
|
81
|
+
drawn: () => [running(), ordered()],
|
|
82
|
+
fallback: (container) => container.focus({ preventScroll: true }),
|
|
83
|
+
});
|
|
84
|
+
onMount(() => {
|
|
85
|
+
const doc = centerEl.ownerDocument;
|
|
86
|
+
const outside = doc.activeElement;
|
|
87
|
+
const returnTo = outside === doc.body ? null : outside;
|
|
88
|
+
let shown = true;
|
|
89
|
+
queueMicrotask(() => {
|
|
90
|
+
if (!shown)
|
|
91
|
+
return;
|
|
92
|
+
if (!focusFirstNotificationEntry(centerEl, { preventScroll: true })) {
|
|
93
|
+
centerEl.focus({ preventScroll: true });
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
onCleanup(() => {
|
|
97
|
+
shown = false;
|
|
98
|
+
if (listFocus.holdsFocus())
|
|
99
|
+
restoreFocusTo(returnTo);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
const entryCount = () => running().length + ordered().length;
|
|
103
|
+
createEffect(on(entryCount, (count, before) => {
|
|
104
|
+
if (before !== undefined && before > 0 && count === 0)
|
|
105
|
+
props.onHide();
|
|
106
|
+
}));
|
|
63
107
|
const severityIcon = (tone) => SEVERITY_ICON[tone];
|
|
64
|
-
const
|
|
108
|
+
const writeDoNotDisturb = (doNotDisturb) => {
|
|
65
109
|
const current = notificationSettings.get();
|
|
66
110
|
void notificationSettings
|
|
67
|
-
.update({ ...current, doNotDisturb
|
|
111
|
+
.update({ ...current, doNotDisturb })
|
|
68
112
|
.catch((error) => {
|
|
69
113
|
notifications.notify(notificationSettingsUpdateFailed, {
|
|
70
114
|
cause: error,
|
|
71
115
|
});
|
|
72
116
|
});
|
|
73
117
|
};
|
|
118
|
+
const toggleDoNotDisturb = () => {
|
|
119
|
+
if (!dnd()) {
|
|
120
|
+
writeDoNotDisturb(true);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
notifications.setFilter('off');
|
|
124
|
+
if (dndSetting())
|
|
125
|
+
writeDoNotDisturb(false);
|
|
126
|
+
};
|
|
74
127
|
const openNotificationSettings = () => host.openNotificationSettings();
|
|
75
128
|
const buildEntryActions = (entry) => {
|
|
76
129
|
const list = [
|
|
@@ -137,7 +190,10 @@ export function NotificationsCenter(props) {
|
|
|
137
190
|
},
|
|
138
191
|
]);
|
|
139
192
|
};
|
|
140
|
-
return (<section
|
|
193
|
+
return (<section ref={(element) => {
|
|
194
|
+
centerEl = element;
|
|
195
|
+
props.ref?.(element);
|
|
196
|
+
}} class={styles.center} tabIndex={-1} aria-label={t('Notifications')} data-notification-center>
|
|
141
197
|
<Panel.Header class={styles.header}>
|
|
142
198
|
<h3 class={styles.title}>
|
|
143
199
|
{t('Notifications')}
|
|
@@ -156,18 +212,20 @@ export function NotificationsCenter(props) {
|
|
|
156
212
|
<VpGear class={styles.actionIcon}/>
|
|
157
213
|
</Button>
|
|
158
214
|
<Button variant="ghost" size="sm" iconOnly onClick={props.onHide} title={t('Hide notifications')} aria-label={t('Hide notifications')}>
|
|
159
|
-
<VpChevronDown class={styles.actionIcon}/>
|
|
215
|
+
<Show when={toastCornerEdge(corner()) === 'top'} fallback={<VpChevronDown class={styles.actionIcon}/>}>
|
|
216
|
+
<VpChevronUp class={styles.actionIcon}/>
|
|
217
|
+
</Show>
|
|
160
218
|
</Button>
|
|
161
219
|
</div>
|
|
162
220
|
</Panel.Header>
|
|
163
221
|
<Show when={running().length > 0 || ordered().length > 0} fallback={<EmptyState size="sm" title={t('No new notifications')}/>}>
|
|
164
|
-
<OverlayScrollArea viewportClass={styles.list}>
|
|
165
|
-
<RunningProgressCards items={running()}/>
|
|
222
|
+
<OverlayScrollArea viewportClass={styles.list} onKeyDown={(event) => moveNotificationEntryFocus(event, event.currentTarget)}>
|
|
223
|
+
<RunningProgressCards items={running()} corner={corner()}/>
|
|
166
224
|
<For each={ordered()}>
|
|
167
225
|
{(entry) => {
|
|
168
226
|
const source = resolveNotificationSource(entry.source);
|
|
169
227
|
const actions = buildEntryActions(entry);
|
|
170
|
-
return (<article class={styles.card} onContextMenu={(event) => {
|
|
228
|
+
return (<article {...notificationEntryMark} class={styles.card} tabIndex={-1} aria-label={timelineEntryAriaLabel(entry)} onContextMenu={(event) => {
|
|
171
229
|
event.preventDefault();
|
|
172
230
|
showCardMenu(event.clientX, event.clientY, entry);
|
|
173
231
|
}}>
|
|
@@ -24,6 +24,6 @@ export function RunningProgressCards(props) {
|
|
|
24
24
|
const controller = realmCardController(host, () => notificationSettings.get());
|
|
25
25
|
const shell = realmNotificationShell(host);
|
|
26
26
|
return (<For each={props.items}>
|
|
27
|
-
{(item) => (<NotificationItem item={item} controller={controller} shell={shell} inCenter/>)}
|
|
27
|
+
{(item) => (<NotificationItem item={item} controller={controller} shell={shell} inCenter corner={props.corner}/>)}
|
|
28
28
|
</For>);
|
|
29
29
|
}
|
|
@@ -10,24 +10,29 @@ import { hiddenRunningProgress } from './nativeEngine';
|
|
|
10
10
|
import { t } from '../i18n/i18n';
|
|
11
11
|
import styles from './StatusBarNotificationBell.module.css.js';
|
|
12
12
|
export function StatusBarNotificationBell(props) {
|
|
13
|
-
const
|
|
13
|
+
const notifications = useKitHost().notifications;
|
|
14
|
+
const { timeline, stack } = notifications;
|
|
14
15
|
const [ownOpen, setOwnOpen] = createSignal(false);
|
|
15
16
|
const open = () => props.open ?? ownOpen();
|
|
16
17
|
const [unread, setUnread] = createSignal(0);
|
|
17
|
-
const [
|
|
18
|
+
const [dndSetting, setDndSetting] = createSignal(notificationSettings.get().doNotDisturb);
|
|
19
|
+
const [filtered, setFiltered] = createSignal(notifications.getFilter() !== 'off');
|
|
18
20
|
const [outOfSight, setOutOfSight] = createSignal(0);
|
|
19
21
|
let buttonRef;
|
|
20
22
|
onMount(() => {
|
|
21
23
|
const unsubscribeUnread = timeline.subscribeUnread(setUnread);
|
|
22
24
|
const unsubscribeStack = stack.subscribe((items) => setOutOfSight(hiddenRunningProgress(items).length));
|
|
25
|
+
const filterChange = notifications.onDidChangeFilter((filter) => setFiltered(filter !== 'off'));
|
|
23
26
|
onCleanup(() => {
|
|
24
27
|
unsubscribeUnread();
|
|
25
28
|
unsubscribeStack();
|
|
29
|
+
filterChange.dispose();
|
|
26
30
|
});
|
|
27
31
|
});
|
|
28
32
|
useSettingsSubscription(notificationSettings, () => {
|
|
29
|
-
|
|
33
|
+
setDndSetting(notificationSettings.get().doNotDisturb);
|
|
30
34
|
});
|
|
35
|
+
const dnd = () => dndSetting() || filtered();
|
|
31
36
|
const setOpen = (next) => {
|
|
32
37
|
if (next === open())
|
|
33
38
|
return;
|
|
@@ -20,6 +20,7 @@ function toToastOptions(definition, payload) {
|
|
|
20
20
|
...(payload.dontShowAgainKey
|
|
21
21
|
? { dontShowAgainKey: payload.dontShowAgainKey }
|
|
22
22
|
: {}),
|
|
23
|
+
...(payload.remindKey ? { remindKey: payload.remindKey } : {}),
|
|
23
24
|
...(payload.defaultRoute ? { defaultRoute: payload.defaultRoute } : {}),
|
|
24
25
|
...(payload.icon ? { icon: payload.icon } : {}),
|
|
25
26
|
...(payload.markdown !== undefined ? { markdown: payload.markdown } : {}),
|
|
@@ -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';
|