@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.
Files changed (262) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/README.md +48 -4
  3. package/dist/{AttributeGrid-eND8YDby.cjs → AttributeGrid-Ch1k9v5j.cjs} +1 -1
  4. package/dist/{AttributeGrid-CASILa4u.js → AttributeGrid-DqFd4gBm.js} +3 -3
  5. package/dist/Button-4meERfnv.js +300 -0
  6. package/dist/Button-OyZHrl-t.cjs +1 -0
  7. package/dist/CommandPalette-CxYZUJtN.cjs +2 -0
  8. package/dist/{CommandPalette-Cj618AOz.js → CommandPalette-DwOp8y1-.js} +1467 -1466
  9. package/dist/{CopyButton-B5gS2ft3.cjs → CopyButton-16QNPgz6.cjs} +1 -1
  10. package/dist/{CopyButton-g-WSiBDZ.js → CopyButton-BVS49lMS.js} +1 -1
  11. package/dist/{DateRangePicker-CJD9ADgB.js → DateRangePicker-8QvydugY.js} +4 -4
  12. package/dist/{DateRangePicker-Frc0HVxp.cjs → DateRangePicker-DI-06xWY.cjs} +1 -1
  13. package/dist/{GuidedTour-B6q7lYhn.cjs → GuidedTour-DUQwdW8n.cjs} +1 -1
  14. package/dist/{GuidedTour-CFCvRJN4.js → GuidedTour-DXMmHn0o.js} +2 -2
  15. package/dist/{HostPortal-CXGUUhP8.js → HostPortal-Ba3MD9CG.js} +1 -1
  16. package/dist/HostPortal-CpWsArs6.cjs +1 -0
  17. package/dist/{IconPicker-DYqNi5ud.js → IconPicker-D1G8HK92.js} +3 -3
  18. package/dist/{IconPicker-CIbJb1ei.cjs → IconPicker-Q-ZDtNkd.cjs} +1 -1
  19. package/dist/Input-Brp5EDhg.cjs +1 -0
  20. package/dist/Input-CZi8KEfm.js +374 -0
  21. package/dist/Modal-CBi7Wd2V.cjs +1 -0
  22. package/dist/Modal-iyY1HUtr.js +588 -0
  23. package/dist/{PageSkeleton-BPbb28-H.cjs → PageSkeleton-B_-4fz1q.cjs} +1 -1
  24. package/dist/{PageSkeleton-CLnJO6uD.js → PageSkeleton-zNyjLPlk.js} +3 -3
  25. package/dist/{Popover-Cttb6NYT.js → Popover-DVi179wu.js} +4 -3
  26. package/dist/Popover-DXrczbt9.cjs +1 -0
  27. package/dist/{SearchableSelect-BvCm4enQ.js → SearchableSelect-DtHbWJhR.js} +34 -33
  28. package/dist/SearchableSelect-yLVqCGFo.cjs +1 -0
  29. package/dist/StatusBarNotificationBell-DQs5g1K6.cjs +50 -0
  30. package/dist/{StatusBarNotificationBell-yryWdwyX.js → StatusBarNotificationBell-ZTEhZFmJ.js} +4980 -4678
  31. package/dist/{Stepper-D9i1Xclm.js → Stepper-CyRgzWlR.js} +1 -1
  32. package/dist/{Stepper-Ci5JpLbS.cjs → Stepper-u2ZsE5oP.cjs} +1 -1
  33. package/dist/{Textarea-CeAGf08O.cjs → Textarea-DASNQNoi.cjs} +1 -1
  34. package/dist/{Textarea-B5QqqKnI.js → Textarea-szHXQahi.js} +1 -1
  35. package/dist/{TimeSeriesChart-DOwi2lJs.js → TimeSeriesChart-D7lIqolp.js} +1 -1
  36. package/dist/{TimeSeriesChart-huvheefm.cjs → TimeSeriesChart-DGzM9B--.cjs} +1 -1
  37. package/dist/{ToggleButton-CFM8P3JY.js → ToggleButton-B22PsCqo.js} +61 -60
  38. package/dist/ToggleButton-DWslrIBN.cjs +1 -0
  39. package/dist/_internal/contract/notification.d.cts +13 -3
  40. package/dist/_internal/contract/notification.d.ts +13 -3
  41. package/dist/_internal/contract/notificationCatalog.d.cts +2 -0
  42. package/dist/_internal/contract/notificationCatalog.d.ts +2 -0
  43. package/dist/_internal/platform/settings/settingsTypes.d.cts +0 -8
  44. package/dist/_internal/platform/settings/settingsTypes.d.ts +0 -8
  45. package/dist/anchoredLayout-CBjQ1etD.cjs +1 -0
  46. package/dist/anchoredLayout-E0mqCWxk.js +233 -0
  47. package/dist/appThemeDerivation-BylmT80v.cjs +1 -0
  48. package/dist/{appThemeDerivation-CKoSe4KP.js → appThemeDerivation-DBAOkGl7.js} +260 -231
  49. package/dist/base.css +2 -2
  50. package/dist/charts/index.cjs +1 -1
  51. package/dist/charts/index.js +1 -1
  52. package/dist/context/DesktopContextMenuContext.d.cts +8 -1
  53. package/dist/context/DesktopContextMenuContext.d.ts +8 -1
  54. package/dist/createDialogShellFocus-CQ0VNC2g.cjs +1 -0
  55. package/dist/{createDialogShellFocus-B4piXDU4.js → createDialogShellFocus-DbiQmLgb.js} +9 -9
  56. package/dist/createResizableSidebar-COlpGQ7H.cjs +1 -0
  57. package/dist/createResizableSidebar-cmCKTIg_.js +504 -0
  58. package/dist/desktop/index.cjs +1 -1
  59. package/dist/desktop/index.js +3 -3
  60. package/dist/dialogFocusRestore-BhxVTSiP.js +10 -0
  61. package/dist/dialogFocusRestore-DP5b1bDo.cjs +1 -0
  62. package/dist/feedback/index.cjs +1 -1
  63. package/dist/feedback/index.js +3 -3
  64. package/dist/forms/Input.d.cts +20 -0
  65. package/dist/forms/Input.d.ts +20 -0
  66. package/dist/forms/InputMessage.d.cts +19 -0
  67. package/dist/forms/InputMessage.d.ts +19 -0
  68. package/dist/forms/index.cjs +1 -1
  69. package/dist/forms/index.js +9 -9
  70. package/dist/grid/index.cjs +1 -1
  71. package/dist/grid/index.js +1 -1
  72. package/dist/index.cjs +1 -1
  73. package/dist/index.js +516 -509
  74. package/dist/layout/index.cjs +1 -1
  75. package/dist/layout/index.js +2 -2
  76. package/dist/layout/resizeCarry.d.cts +17 -0
  77. package/dist/layout/resizeCarry.d.ts +17 -0
  78. package/dist/mainRealmDom-B215swW-.js +166 -0
  79. package/dist/mainRealmDom-BYGSE-fo.cjs +1 -0
  80. package/dist/nativeTitleHold-A9jUISgQ.js +170 -0
  81. package/dist/nativeTitleHold-B7Ou-W9b.cjs +1 -0
  82. package/dist/navigation/index.cjs +1 -1
  83. package/dist/navigation/index.js +1 -1
  84. package/dist/notifications/NotificationItem.d.cts +12 -3
  85. package/dist/notifications/NotificationItem.d.ts +12 -3
  86. package/dist/notifications/NotificationsCenter.d.cts +18 -0
  87. package/dist/notifications/NotificationsCenter.d.ts +18 -0
  88. package/dist/notifications/RunningProgressCards.d.cts +3 -0
  89. package/dist/notifications/RunningProgressCards.d.ts +3 -0
  90. package/dist/notifications/StatusBarNotificationBell.d.cts +18 -6
  91. package/dist/notifications/StatusBarNotificationBell.d.ts +18 -6
  92. package/dist/notifications/dismissableToastIds.d.cts +2 -1
  93. package/dist/notifications/dismissableToastIds.d.ts +2 -1
  94. package/dist/notifications/fireNotification.d.cts +35 -16
  95. package/dist/notifications/fireNotification.d.ts +35 -16
  96. package/dist/notifications/index.cjs +1 -1
  97. package/dist/notifications/index.d.cts +1 -0
  98. package/dist/notifications/index.d.ts +1 -0
  99. package/dist/notifications/index.js +56 -52
  100. package/dist/notifications/nativeEngine.d.cts +54 -16
  101. package/dist/notifications/nativeEngine.d.ts +54 -16
  102. package/dist/notifications/notificationCardServices.d.cts +2 -1
  103. package/dist/notifications/notificationCardServices.d.ts +2 -1
  104. package/dist/notifications/notificationCommands.d.cts +3 -3
  105. package/dist/notifications/notificationCommands.d.ts +3 -3
  106. package/dist/notifications/notificationEntryList.d.cts +91 -0
  107. package/dist/notifications/notificationEntryList.d.ts +91 -0
  108. package/dist/notifications/notificationService.d.cts +33 -3
  109. package/dist/notifications/notificationService.d.ts +33 -3
  110. package/dist/notifications/toast.d.cts +3 -0
  111. package/dist/notifications/toast.d.ts +3 -0
  112. package/dist/notifications/toastCorner.d.cts +8 -0
  113. package/dist/notifications/toastCorner.d.ts +8 -0
  114. package/dist/notifications/toastFilterPolicy.d.cts +33 -1
  115. package/dist/notifications/toastFilterPolicy.d.ts +33 -1
  116. package/dist/overlay/Modal.d.cts +6 -0
  117. package/dist/overlay/Modal.d.ts +6 -0
  118. package/dist/overlay/backgroundInert.d.cts +6 -2
  119. package/dist/overlay/backgroundInert.d.ts +6 -2
  120. package/dist/overlay/command-palette/CommandPalette.d.cts +12 -0
  121. package/dist/overlay/command-palette/CommandPalette.d.ts +12 -0
  122. package/dist/overlay/index.cjs +1 -1
  123. package/dist/overlay/index.js +70 -68
  124. package/dist/overlay/nativeTitleHold.d.cts +24 -0
  125. package/dist/overlay/nativeTitleHold.d.ts +24 -0
  126. package/dist/ownerAnimationFrame-DzFcMSmn.js +19 -0
  127. package/dist/ownerAnimationFrame-T6jf6qYC.cjs +1 -0
  128. package/dist/server/{AttributeGrid-CMi-UtWb.js → AttributeGrid-Bpjlauuz.js} +2 -2
  129. package/dist/server/{AttributeGrid-B7sb3btp.cjs → AttributeGrid-DNYdKb8J.cjs} +1 -1
  130. package/dist/server/CommandPalette-BuVxnqBG.cjs +1 -0
  131. package/dist/server/{CommandPalette-CozogFlk.js → CommandPalette-Dn3NKXPM.js} +1095 -1069
  132. package/dist/server/{DateRangePicker-KLZzyuPJ.cjs → DateRangePicker-BFzNjaME.cjs} +1 -1
  133. package/dist/server/{DateRangePicker-C35q8BTw.js → DateRangePicker-CnYkTgXX.js} +3 -3
  134. package/dist/server/{GuidedTour-DmLbBttx.js → GuidedTour-BZardPYW.js} +1 -1
  135. package/dist/server/{GuidedTour-DfV0yzqh.cjs → GuidedTour-yhdZk2SU.cjs} +1 -1
  136. package/dist/server/{HostPortal-CXGUUhP8.js → HostPortal-C4IrAeWN.js} +1 -1
  137. package/dist/server/HostPortal-D5ECrJvn.cjs +1 -0
  138. package/dist/server/{IconPicker-B1soopAp.cjs → IconPicker-C5lAN9pX.cjs} +1 -1
  139. package/dist/server/{IconPicker-B4aXspLw.js → IconPicker-DDWgB7sm.js} +3 -3
  140. package/dist/server/Input-AdF-i0O8.js +245 -0
  141. package/dist/server/Input-XF9Jr0G9.cjs +1 -0
  142. package/dist/server/{Modal-BheFQLs1.js → Modal-C5dzgcRW.js} +102 -97
  143. package/dist/server/{Modal-BswxV8Pn.cjs → Modal-nAhBS1L9.cjs} +1 -1
  144. package/dist/server/Popover-C5avmGWz.cjs +1 -0
  145. package/dist/server/{Popover-Cg28aPUZ.js → Popover-H3AAYZI0.js} +57 -57
  146. package/dist/server/{SearchableSelect-09ECcDlB.cjs → SearchableSelect-CZrXDKfC.cjs} +1 -1
  147. package/dist/server/{SearchableSelect-vjhS4c-H.js → SearchableSelect-DMqed5Er.js} +1 -1
  148. package/dist/server/StatusBarNotificationBell-CGcMdT4h.cjs +49 -0
  149. package/dist/server/{StatusBarNotificationBell-DdAdsduo.js → StatusBarNotificationBell-DW2l5O9B.js} +4812 -4520
  150. package/dist/server/{Stepper-DxNrskdq.cjs → Stepper-CpapA_WH.cjs} +1 -1
  151. package/dist/server/{Stepper-n5f9r-ye.js → Stepper-gGA7JwjV.js} +1 -1
  152. package/dist/server/{Textarea-BQf2lL59.cjs → Textarea-Bh5LVrBn.cjs} +1 -1
  153. package/dist/server/{Textarea-BTH48NET.js → Textarea-DVkfGkP0.js} +1 -1
  154. package/dist/server/{ToggleButton-TE3Xf2yD.cjs → ToggleButton-CA9T-OsI.cjs} +1 -1
  155. package/dist/server/{ToggleButton-FywO2CCI.js → ToggleButton-CBNKajZa.js} +4 -4
  156. package/dist/server/{VpTrash-Dlq8o6Uv.js → VpTrash-CZMWCIpF.js} +84 -70
  157. package/dist/server/VpTrash-DiczWhwm.cjs +1 -0
  158. package/dist/server/appThemeDerivation-BylmT80v.cjs +1 -0
  159. package/dist/server/{appThemeDerivation-CKoSe4KP.js → appThemeDerivation-DBAOkGl7.js} +260 -231
  160. package/dist/server/{createDialogShellFocus-BiBAZOCI.cjs → createDialogShellFocus-CDaLuPg8.cjs} +1 -1
  161. package/dist/server/{createDialogShellFocus-BFo8awdj.js → createDialogShellFocus-LGDBOVnr.js} +6 -6
  162. package/dist/server/{createResizableSidebar-BImbKlLe.js → createResizableSidebar-Dvu7iEk1.js} +1 -1
  163. package/dist/server/{createResizableSidebar-GFgZIj-5.cjs → createResizableSidebar-v40ZOb-Q.cjs} +1 -1
  164. package/dist/server/desktop/index.cjs +1 -1
  165. package/dist/server/desktop/index.js +3 -3
  166. package/dist/server/dialogFocusRestore-BhxVTSiP.js +10 -0
  167. package/dist/server/dialogFocusRestore-DP5b1bDo.cjs +1 -0
  168. package/dist/server/forms/index.cjs +1 -1
  169. package/dist/server/forms/index.js +7 -7
  170. package/dist/server/grid/index.cjs +1 -1
  171. package/dist/server/grid/index.js +1 -1
  172. package/dist/server/{index-UIjsx3oJ.js → index-BEARfm54.js} +3604 -3617
  173. package/dist/server/index-C6rYfWCJ.cjs +1 -0
  174. package/dist/server/index.cjs +1 -1
  175. package/dist/server/index.js +478 -472
  176. package/dist/server/layout/index.cjs +1 -1
  177. package/dist/server/layout/index.js +2 -2
  178. package/dist/server/navigation/index.cjs +1 -1
  179. package/dist/server/navigation/index.js +1 -1
  180. package/dist/server/notifications/index.cjs +1 -1
  181. package/dist/server/notifications/index.js +56 -52
  182. package/dist/server/overlay/index.cjs +1 -1
  183. package/dist/server/overlay/index.js +54 -53
  184. package/dist/server/tokens/index.cjs +1 -1
  185. package/dist/server/tokens/index.js +30 -28
  186. package/dist/solid/feedback/Badge.jsx +3 -14
  187. package/dist/solid/forms/Button.jsx +3 -14
  188. package/dist/solid/forms/Input.jsx +31 -5
  189. package/dist/solid/forms/Input.module.css.js +1 -0
  190. package/dist/solid/forms/InputMessage.jsx +86 -0
  191. package/dist/solid/forms/PressableSurface.jsx +3 -14
  192. package/dist/solid/layout/ResizeHandle.jsx +11 -1
  193. package/dist/solid/layout/resizeCarry.js +31 -0
  194. package/dist/solid/notifications/NotificationHost.jsx +6 -29
  195. package/dist/solid/notifications/NotificationItem.jsx +5 -5
  196. package/dist/solid/notifications/NotificationPanel.jsx +14 -4
  197. package/dist/solid/notifications/NotificationsCenter.jsx +70 -12
  198. package/dist/solid/notifications/RunningProgressCards.jsx +1 -1
  199. package/dist/solid/notifications/StatusBarNotificationBell.jsx +21 -19
  200. package/dist/solid/notifications/catalogAdapter.js +1 -0
  201. package/dist/solid/notifications/fireNotification.js +21 -16
  202. package/dist/solid/notifications/index.js +1 -0
  203. package/dist/solid/notifications/nativeEngine.js +51 -11
  204. package/dist/solid/notifications/notificationEntryList.js +168 -0
  205. package/dist/solid/notifications/notificationService.js +22 -4
  206. package/dist/solid/notifications/toast.js +54 -7
  207. package/dist/solid/notifications/toastCorner.js +3 -0
  208. package/dist/solid/notifications/toastFilterPolicy.js +12 -0
  209. package/dist/solid/overlay/Drawer.jsx +2 -1
  210. package/dist/solid/overlay/Modal.jsx +42 -4
  211. package/dist/solid/overlay/command-palette/CommandPalette.jsx +4 -4
  212. package/dist/solid/overlay/context-menu/DesktopContextMenu.jsx +8 -7
  213. package/dist/solid/overlay/nativeTitleHold.js +33 -0
  214. package/dist/solid/overlay/tooltipDirective.js +3 -11
  215. package/dist/solid/tokens/index.js +1 -0
  216. package/dist/solid/tokens/palette/paletteContract.js +27 -0
  217. package/dist/style.css +2 -2
  218. package/dist/theme.css +1 -1
  219. package/dist/tokens/index.cjs +1 -1
  220. package/dist/tokens/index.d.cts +1 -0
  221. package/dist/tokens/index.d.ts +1 -0
  222. package/dist/tokens/index.js +30 -28
  223. package/dist/tokens/palette/paletteContract.d.cts +17 -0
  224. package/dist/tokens/palette/paletteContract.d.ts +17 -0
  225. package/dist/tokens/tokens.css +1 -1
  226. package/dist/ui.css +1 -1
  227. package/package.json +1 -1
  228. package/dist/Button-Bb68ymNP.cjs +0 -1
  229. package/dist/Button-D-T0tyGF.js +0 -305
  230. package/dist/CommandPalette-5FQRgPG9.cjs +0 -2
  231. package/dist/HostPortal-CgJwxt-f.cjs +0 -1
  232. package/dist/Input-CZruORyy.cjs +0 -1
  233. package/dist/Input-DkPhsdfk.js +0 -227
  234. package/dist/Modal-CY6ePolt.cjs +0 -1
  235. package/dist/Modal-NzZzHSwb.js +0 -559
  236. package/dist/Popover-CWrR51eG.cjs +0 -1
  237. package/dist/SearchableSelect-CVqdVMOC.cjs +0 -1
  238. package/dist/StatusBarNotificationBell-CJ3HuhRu.cjs +0 -50
  239. package/dist/ToggleButton-BFWh1_o5.cjs +0 -1
  240. package/dist/anchoredLayout-Dstwa5OH.cjs +0 -1
  241. package/dist/anchoredLayout-FC-qv8xm.js +0 -250
  242. package/dist/appThemeDerivation-Be_oKljl.cjs +0 -1
  243. package/dist/createDialogShellFocus-CJaw9-B9.cjs +0 -1
  244. package/dist/createResizableSidebar-BDUlX9-G.js +0 -472
  245. package/dist/createResizableSidebar-BVJBU2kP.cjs +0 -1
  246. package/dist/dialogFocusRestore--dH59ER2.js +0 -35
  247. package/dist/dialogFocusRestore-CL-ExfAA.cjs +0 -1
  248. package/dist/mainRealmDom-C12lr9lm.js +0 -171
  249. package/dist/mainRealmDom-S6teqEr4.cjs +0 -1
  250. package/dist/server/CommandPalette-DQK6N98N.cjs +0 -1
  251. package/dist/server/HostPortal-CgJwxt-f.cjs +0 -1
  252. package/dist/server/Input-CjvD8w18.cjs +0 -1
  253. package/dist/server/Input-DaEN2JJd.js +0 -127
  254. package/dist/server/Popover-BsxIKBbl.cjs +0 -1
  255. package/dist/server/StatusBarNotificationBell-Z2LmIkM1.cjs +0 -49
  256. package/dist/server/VpTrash-D49oUUJh.cjs +0 -1
  257. package/dist/server/appThemeDerivation-Be_oKljl.cjs +0 -1
  258. package/dist/server/dialogFocusRestore--dH59ER2.js +0 -35
  259. package/dist/server/dialogFocusRestore-CL-ExfAA.cjs +0 -1
  260. package/dist/server/index-2mQPVEDR.cjs +0 -1
  261. package/dist/tooltipCoordinator-BzxEyKhA.js +0 -144
  262. 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
- if (surfaceRef.hasAttribute('title')) {
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
- props.onResize?.(delta);
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';
@@ -36,7 +37,6 @@ export const NotificationHost = (props) => {
36
37
  const [position, setPosition] = createSignal(initial.toastPosition);
37
38
  const effectivePosition = () => position();
38
39
  const [width, setWidth] = createSignal(initial.notificationWidth);
39
- const [maxVisible, setMaxVisible] = createSignal(initial.maxVisibleNotifications);
40
40
  const [animationDuration, setAnimationDuration] = createSignal(initial.animationDuration);
41
41
  const [reduceMotion, setReduceMotion] = createSignal(initial.reduceMotion);
42
42
  const [hostEl, setHostEl] = createSignal();
@@ -45,13 +45,7 @@ export const NotificationHost = (props) => {
45
45
  const controller = realmCardController(host, itemSettings);
46
46
  const shell = realmNotificationShell(host);
47
47
  const ackItems = () => store.items.filter((it) => it.priority === 'acknowledgment-required');
48
- const visible = () => {
49
- const cap = Math.max(1, maxVisible());
50
- const items = store.items.filter(isOnToastStack);
51
- if (items.length <= cap)
52
- return items;
53
- return items.slice(items.length - cap);
54
- };
48
+ const visible = () => store.items.filter((item) => isOnToastStack(item) && item.outOfSightSince === undefined);
55
49
  const currentAckItem = () => ackItems()[0] ?? null;
56
50
  const isCenterOpen = () => props.centerOpen();
57
51
  const handleSettingsChange = (detail) => {
@@ -63,9 +57,6 @@ export const NotificationHost = (props) => {
63
57
  if (typeof detail.notificationWidth === 'number') {
64
58
  setWidth(detail.notificationWidth);
65
59
  }
66
- if (typeof detail.maxVisibleNotifications === 'number') {
67
- setMaxVisible(detail.maxVisibleNotifications);
68
- }
69
60
  if (detail.animationDuration === 'fast' ||
70
61
  detail.animationDuration === 'normal' ||
71
62
  detail.animationDuration === 'slow') {
@@ -120,24 +111,10 @@ export const NotificationHost = (props) => {
120
111
  if (!hostEl()?.contains(eventTarget))
121
112
  return;
122
113
  const idx = focusIndex();
123
- if (isKey(event, 'ArrowDown') || isKey(event, 'PageDown')) {
124
- event.preventDefault();
125
- setFocusIndex(idx === null ? 0 : Math.min(list.length - 1, idx + 1));
126
- return;
127
- }
128
- if (isKey(event, 'ArrowUp') || isKey(event, 'PageUp')) {
129
- event.preventDefault();
130
- setFocusIndex(idx === null ? list.length - 1 : Math.max(0, idx - 1));
131
- return;
132
- }
133
- if (isKey(event, 'Home')) {
134
- event.preventDefault();
135
- setFocusIndex(0);
136
- return;
137
- }
138
- if (isKey(event, 'End')) {
114
+ const step = notificationListFocusStep(event, idx, list.length, 'ends');
115
+ if (step !== null) {
139
116
  event.preventDefault();
140
- setFocusIndex(list.length - 1);
117
+ setFocusIndex(step);
141
118
  return;
142
119
  }
143
120
  if (idx === null)
@@ -277,7 +254,7 @@ export const NotificationHost = (props) => {
277
254
  <OverlayScrollArea rootClass={styles.scrollArea} viewportClass={styles.stack} viewportRef={setScrollEl} hideHorizontal>
278
255
  <For each={visible()}>
279
256
  {(item, index) => (<div class={styles.enter} data-focused={focusIndex() === index() ? 'true' : 'false'}>
280
- <NotificationItem item={item} controller={controller} shell={item.isolated ? null : shell}/>
257
+ <NotificationItem item={item} controller={controller} shell={item.isolated ? null : shell} corner={effectivePosition()}/>
281
258
  </div>)}
282
259
  </For>
283
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 { deriveImplicitRemindKey } from './toastFilterPolicy';
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 = dontShowKey ??
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 ? {} : { 'aria-live': announcement() })} aria-atomic={props.inCenter ? undefined : 'true'} aria-label={t('{severity}: {title}', {
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} data-tour-target="notifications-timeline">
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 [dnd, setDnd] = createSignal(notificationSettings.get().doNotDisturb);
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
- onCleanup(unsubscribe);
62
+ const filterChange = notifications.onDidChangeFilter((filter) => setFiltered(filter !== 'off'));
63
+ onCleanup(() => {
64
+ unsubscribe();
65
+ filterChange.dispose();
66
+ });
58
67
  });
59
68
  useSettingsSubscription(notificationSettings, () => {
60
- setDnd(notificationSettings.get().doNotDisturb);
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 toggleDoNotDisturb = () => {
108
+ const writeDoNotDisturb = (doNotDisturb) => {
65
109
  const current = notificationSettings.get();
66
110
  void notificationSettings
67
- .update({ ...current, doNotDisturb: !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 class={styles.center} data-notification-center>
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
  }
@@ -1,49 +1,51 @@
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';
5
5
  import { NotificationsCenter } from './NotificationsCenter';
6
6
  import { useKitHost } from '../host/kitHost';
7
- import { useHostWindow } from '../_internal/app/windows/window/HostWindowContext';
8
7
  import { notificationSettings } from '../_internal/app/settings/descriptors/notification';
9
8
  import { useSettingsSubscription } from '../_internal/app/settings/useSettingsSubscription';
10
- import { isOnToastStack } from './nativeEngine';
11
- import { useRunningProgressCards } from './RunningProgressCards';
9
+ import { hiddenRunningProgress } from './nativeEngine';
12
10
  import { t } from '../i18n/i18n';
13
11
  import styles from './StatusBarNotificationBell.module.css.js';
14
12
  export function StatusBarNotificationBell(props) {
15
- const host = useKitHost();
16
- const { timeline, stack } = host.notifications;
17
- const display = host.displayOwner.register(useHostWindow().window);
18
- onCleanup(display.dispose);
19
- const [open, setOpenSignal] = createSignal(false);
13
+ const notifications = useKitHost().notifications;
14
+ const { timeline, stack } = notifications;
15
+ const [ownOpen, setOwnOpen] = createSignal(false);
16
+ const open = () => props.open ?? ownOpen();
20
17
  const [unread, setUnread] = createSignal(0);
21
- const [dnd, setDnd] = createSignal(notificationSettings.get().doNotDisturb);
22
- const [stackHasToasts, setStackHasToasts] = createSignal(false);
23
- const running = useRunningProgressCards();
18
+ const [dndSetting, setDndSetting] = createSignal(notificationSettings.get().doNotDisturb);
19
+ const [filtered, setFiltered] = createSignal(notifications.getFilter() !== 'off');
20
+ const [outOfSight, setOutOfSight] = createSignal(0);
24
21
  let buttonRef;
25
22
  onMount(() => {
26
23
  const unsubscribeUnread = timeline.subscribeUnread(setUnread);
27
- const unsubscribeStack = stack.subscribe((items) => setStackHasToasts(items.some(isOnToastStack)));
24
+ const unsubscribeStack = stack.subscribe((items) => setOutOfSight(hiddenRunningProgress(items).length));
25
+ const filterChange = notifications.onDidChangeFilter((filter) => setFiltered(filter !== 'off'));
28
26
  onCleanup(() => {
29
27
  unsubscribeUnread();
30
28
  unsubscribeStack();
29
+ filterChange.dispose();
31
30
  });
32
31
  });
33
- const toastsShown = () => stackHasToasts() && display.ownsDisplay();
34
32
  useSettingsSubscription(notificationSettings, () => {
35
- setDnd(notificationSettings.get().doNotDisturb);
33
+ setDndSetting(notificationSettings.get().doNotDisturb);
36
34
  });
35
+ const dnd = () => dndSetting() || filtered();
37
36
  const setOpen = (next) => {
38
37
  if (next === open())
39
38
  return;
40
- if (next)
41
- timeline.markSeen();
42
- setOpenSignal(next);
39
+ if (props.open === undefined)
40
+ setOwnOpen(next);
43
41
  props.onOpenChange?.(next);
44
42
  };
43
+ createEffect(on(open, (isOpen) => {
44
+ if (isOpen)
45
+ timeline.markSeen();
46
+ }));
45
47
  onCleanup(() => setOpen(false));
46
- const inProgress = () => open() || toastsShown() ? 0 : running().length;
48
+ const inProgress = () => (open() ? 0 : outOfSight());
47
49
  const label = () => {
48
50
  const count = inProgress();
49
51
  if (dnd()) {
@@ -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 } : {}),