@vokril/ui-solid 0.2.1 → 0.4.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 (208) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/{AttributeGrid-iOgTCpF7.js → AttributeGrid-BUyv-hUX.js} +3 -3
  3. package/dist/{AttributeGrid-DgORu6BF.cjs → AttributeGrid-Tk8KJx8e.cjs} +1 -1
  4. package/dist/{Button-CCm03bSE.js → Button-BZWXPn8y.js} +1 -1
  5. package/dist/{Button-DntBQ4fM.cjs → Button-X8QR6llv.cjs} +1 -1
  6. package/dist/{CommandPalette-D5BzLE0U.js → CommandPalette-BTjINvuw.js} +5 -5
  7. package/dist/{CommandPalette-4w3pEbna.cjs → CommandPalette-CSaQCEyY.cjs} +1 -1
  8. package/dist/{CopyButton-BxwyIJxL.cjs → CopyButton-3cX5MHAf.cjs} +1 -1
  9. package/dist/{CopyButton-ClqxiGPb.js → CopyButton-D3dIRRnn.js} +1 -1
  10. package/dist/{DateRangePicker-dLlHJR71.cjs → DateRangePicker-CHrwr34H.cjs} +1 -1
  11. package/dist/{DateRangePicker-Qho0OzUE.js → DateRangePicker-jnZfDhQA.js} +3 -3
  12. package/dist/{GuidedTour-YUs4zuez.js → GuidedTour-Be7OITLu.js} +2991 -2974
  13. package/dist/GuidedTour-CTHXtWoK.cjs +21 -0
  14. package/dist/{IconPicker-CO5TWhFx.js → IconPicker-BxofGXCS.js} +3 -3
  15. package/dist/{IconPicker-BreG8jKY.cjs → IconPicker-C_gAGvo0.cjs} +1 -1
  16. package/dist/{Modal-BqajyLjD.cjs → Modal-BSSY6C3D.cjs} +1 -1
  17. package/dist/{Modal-DdbgnOMR.js → Modal-BmtEt5Yo.js} +2 -2
  18. package/dist/{PageSkeleton-DfLEHkrh.js → PageSkeleton-CyTXvZYm.js} +4 -4
  19. package/dist/{PageSkeleton-VbWHl878.cjs → PageSkeleton-DzKYTuNy.cjs} +1 -1
  20. package/dist/{SearchableSelect-D6yjIQO1.cjs → SearchableSelect-9pgcO5JS.cjs} +1 -1
  21. package/dist/{SearchableSelect-CBpLrNvW.js → SearchableSelect-ByCRBEZI.js} +2 -2
  22. package/dist/{StatusBarNotificationBell-DQ94Snzi.cjs → StatusBarNotificationBell-jmfcQw6Y.cjs} +1 -1
  23. package/dist/{StatusBarNotificationBell-BWZj0Pc2.js → StatusBarNotificationBell-k_Ol9XDW.js} +7 -7
  24. package/dist/Stepper-C3dnwwiV.cjs +1 -0
  25. package/dist/{Stepper-CrXi8mfh.js → Stepper-CrTxBpDL.js} +137 -137
  26. package/dist/{TimeSeriesChart-BzzqarqB.cjs → TimeSeriesChart-CS4jQflv.cjs} +1 -1
  27. package/dist/{TimeSeriesChart-D18yHUrf.js → TimeSeriesChart-DBrDzBGE.js} +1 -1
  28. package/dist/{ToggleButton-l1cEdv9w.cjs → ToggleButton-CFvMUndy.cjs} +1 -1
  29. package/dist/{ToggleButton-BiEKoA4q.js → ToggleButton-DBWFnm_R.js} +4 -4
  30. package/dist/_internal/app/keybindings/context/useFocusClaim.d.cts +27 -0
  31. package/dist/_internal/app/keybindings/context/useFocusClaim.d.ts +27 -0
  32. package/dist/_internal/app/keybindings/context/useListCommands.d.cts +15 -0
  33. package/dist/_internal/app/keybindings/context/useListCommands.d.ts +15 -0
  34. package/dist/_internal/app/keybindings/contextKey/builtins.d.cts +48 -2
  35. package/dist/_internal/app/keybindings/contextKey/builtins.d.ts +48 -2
  36. package/dist/_internal/app/keybindings/index.d.cts +4 -0
  37. package/dist/_internal/app/keybindings/index.d.ts +4 -0
  38. package/dist/_internal/app/keybindings/panelCommandsRegistry.d.cts +30 -0
  39. package/dist/_internal/app/keybindings/panelCommandsRegistry.d.ts +30 -0
  40. package/dist/builtins-DM7FDxEt.cjs +1 -0
  41. package/dist/builtins-XOM9gfIx.js +74 -0
  42. package/dist/{catalogNotify-B6x3enJ5.cjs → catalogNotify-C9RzbC6x.cjs} +1 -1
  43. package/dist/{catalogNotify-CcaMBipB.js → catalogNotify-CIhFuJ1b.js} +1 -1
  44. package/dist/charts/index.cjs +1 -1
  45. package/dist/charts/index.js +1 -1
  46. package/dist/{createResizableSidebar-_yb33Qli.cjs → createResizableSidebar-DVATOkMf.cjs} +1 -1
  47. package/dist/{createResizableSidebar-onQNGhy_.js → createResizableSidebar-uf_OJsjO.js} +3 -3
  48. package/dist/{de-Cim4IGZg.js → de-CEltsqV5.js} +1 -0
  49. package/dist/{server/de-B5MOZZDV.cjs → de-DRobPEJV.cjs} +1 -1
  50. package/dist/descriptor-B1MaujhY.js +1106 -0
  51. package/dist/descriptor-lw1fA9mi.cjs +1 -0
  52. package/dist/desktop/index.cjs +1 -1
  53. package/dist/desktop/index.js +28 -28
  54. package/dist/feedback/index.cjs +1 -1
  55. package/dist/feedback/index.js +2 -2
  56. package/dist/{format-C46MmwwW.js → format-Dd946oS-.js} +1 -1
  57. package/dist/{format-Cy7RJpYG.cjs → format-aHRZi12I.cjs} +1 -1
  58. package/dist/forms/index.cjs +1 -1
  59. package/dist/forms/index.js +7 -7
  60. package/dist/grid/index.cjs +1 -1
  61. package/dist/grid/index.js +1 -1
  62. package/dist/host/index.cjs +1 -1
  63. package/dist/host/index.d.cts +3 -0
  64. package/dist/host/index.d.ts +3 -0
  65. package/dist/host/index.js +67 -61
  66. package/dist/i18n/index.cjs +1 -1
  67. package/dist/i18n/index.js +1 -1
  68. package/dist/i18n/messageKeys.d.cts +1 -1
  69. package/dist/i18n/messageKeys.d.ts +1 -1
  70. package/dist/{i18n-DZZyw7Iu.cjs → i18n-B9ccWgcR.cjs} +1 -1
  71. package/dist/{server/i18n-B_XRSWWN.js → i18n-CYq-dVvv.js} +2 -2
  72. package/dist/index.cjs +1 -1
  73. package/dist/index.js +492 -481
  74. package/dist/layout/index.cjs +1 -1
  75. package/dist/layout/index.js +2 -2
  76. package/dist/navigation/index.cjs +1 -1
  77. package/dist/navigation/index.js +1 -1
  78. package/dist/notifications/index.cjs +1 -1
  79. package/dist/notifications/index.d.cts +1 -0
  80. package/dist/notifications/index.d.ts +1 -0
  81. package/dist/notifications/index.js +57 -53
  82. package/dist/notifications/notificationCommands.d.cts +14 -5
  83. package/dist/notifications/notificationCommands.d.ts +14 -5
  84. package/dist/overlay/index.cjs +1 -1
  85. package/dist/overlay/index.js +5 -5
  86. package/dist/server/{AttributeGrid-Cz49ZLQJ.cjs → AttributeGrid-CSidAjfz.cjs} +1 -1
  87. package/dist/server/{AttributeGrid-Bq6AC927.js → AttributeGrid-D6b2qQS9.js} +3 -3
  88. package/dist/server/{Button-CHjpZWyZ.js → Button-BhqhjFpY.js} +1 -1
  89. package/dist/server/{Button-C9c6mzTA.cjs → Button-CFOM8pOv.cjs} +1 -1
  90. package/dist/server/{CommandPalette-C69NFoDY.js → CommandPalette-D8O7Ct6B.js} +4 -4
  91. package/dist/server/{CommandPalette-C-Y0biXL.cjs → CommandPalette-DnTx84xR.cjs} +1 -1
  92. package/dist/server/{CopyButton-C3AnCUW9.cjs → CopyButton-C2jzn9tR.cjs} +1 -1
  93. package/dist/server/{CopyButton-DOeXnVFC.js → CopyButton-CChDa2p3.js} +1 -1
  94. package/dist/server/{DateRangePicker-tEwswamx.js → DateRangePicker-BK2Ul2uy.js} +2 -2
  95. package/dist/server/{DateRangePicker-BZIjmD5b.cjs → DateRangePicker-s-I_rNUK.cjs} +1 -1
  96. package/dist/server/GuidedTour-BW95cjPT.cjs +20 -0
  97. package/dist/server/{GuidedTour-C38isG70.js → GuidedTour-DW5y5xkJ.js} +2304 -2288
  98. package/dist/server/{IconPicker-tGQ6T_7R.js → IconPicker-BCUZcq-i.js} +3 -3
  99. package/dist/server/{IconPicker-DpsgVG2H.cjs → IconPicker-Bw8tZjCl.cjs} +1 -1
  100. package/dist/server/{Modal-C4E01jt8.js → Modal-CM54uXRu.js} +2 -2
  101. package/dist/server/{Modal-w2CtUJ-g.cjs → Modal-R86Fb2mX.cjs} +1 -1
  102. package/dist/server/{PageSkeleton-BIoewFZz.js → PageSkeleton-Bpgep9QW.js} +4 -4
  103. package/dist/server/{PageSkeleton-t1PiXgcp.cjs → PageSkeleton-KwYRrZua.cjs} +1 -1
  104. package/dist/server/{SearchableSelect-CTDUjMFB.js → SearchableSelect-Cog_rb31.js} +2 -2
  105. package/dist/server/{SearchableSelect-T6iS1AYR.cjs → SearchableSelect-fofn1Bjg.cjs} +1 -1
  106. package/dist/server/{StatusBarNotificationBell-DL_OCMv7.cjs → StatusBarNotificationBell-BolKvDik.cjs} +1 -1
  107. package/dist/server/{StatusBarNotificationBell-Bm2ZiM-t.js → StatusBarNotificationBell-BqPU9Shw.js} +6 -6
  108. package/dist/server/{Stepper-Il_NS3YQ.js → Stepper-BdOBuNco.js} +1 -1
  109. package/dist/server/{Stepper-CZ695tkt.cjs → Stepper-DqwKOszc.cjs} +1 -1
  110. package/dist/server/{TimeSeriesChart-CWxwWo-G.js → TimeSeriesChart-C1LbL_xp.js} +1 -1
  111. package/dist/server/{TimeSeriesChart-Cjpjciv2.cjs → TimeSeriesChart-DtldQrxS.cjs} +1 -1
  112. package/dist/server/{ToggleButton-D7Qu7T2P.js → ToggleButton-B0YuAGY4.js} +3 -3
  113. package/dist/server/{ToggleButton-CXwvg-Hr.cjs → ToggleButton-CbX1kbpI.cjs} +1 -1
  114. package/dist/server/builtins-DM7FDxEt.cjs +1 -0
  115. package/dist/server/builtins-XOM9gfIx.js +74 -0
  116. package/dist/server/{catalogNotify-CTZ3DSTN.cjs → catalogNotify-BPPTINme.cjs} +1 -1
  117. package/dist/server/{catalogNotify-Dnyfrb-0.js → catalogNotify-mUcKuUmZ.js} +1 -1
  118. package/dist/server/charts/index.cjs +1 -1
  119. package/dist/server/charts/index.js +1 -1
  120. package/dist/server/{createResizableSidebar-CBSfZVJk.js → createResizableSidebar-BfTFOM7v.js} +3 -3
  121. package/dist/server/{createResizableSidebar-rfcmiXuS.cjs → createResizableSidebar-D28fY_SX.cjs} +1 -1
  122. package/dist/server/{de-Cim4IGZg.js → de-CEltsqV5.js} +1 -0
  123. package/dist/{de-B5MOZZDV.cjs → server/de-DRobPEJV.cjs} +1 -1
  124. package/dist/server/descriptor-DWkJAggS.js +992 -0
  125. package/dist/server/descriptor-IJq9wdXK.cjs +1 -0
  126. package/dist/server/desktop/index.cjs +1 -1
  127. package/dist/server/desktop/index.js +2 -2
  128. package/dist/server/feedback/index.cjs +1 -1
  129. package/dist/server/feedback/index.js +2 -2
  130. package/dist/server/forms/index.cjs +1 -1
  131. package/dist/server/forms/index.js +6 -6
  132. package/dist/server/grid/index.cjs +1 -1
  133. package/dist/server/grid/index.js +1 -1
  134. package/dist/server/host/index.cjs +1 -1
  135. package/dist/server/host/index.js +71 -65
  136. package/dist/server/i18n/index.cjs +1 -1
  137. package/dist/server/i18n/index.js +1 -1
  138. package/dist/server/{i18n-DZZyw7Iu.cjs → i18n-B9ccWgcR.cjs} +1 -1
  139. package/dist/{i18n-B_XRSWWN.js → server/i18n-CYq-dVvv.js} +2 -2
  140. package/dist/server/index.cjs +1 -1
  141. package/dist/server/index.js +822 -811
  142. package/dist/server/layout/index.cjs +1 -1
  143. package/dist/server/layout/index.js +2 -2
  144. package/dist/server/navigation/index.cjs +1 -1
  145. package/dist/server/navigation/index.js +1 -1
  146. package/dist/server/notifications/index.cjs +1 -1
  147. package/dist/server/notifications/index.js +57 -53
  148. package/dist/server/overlay/index.cjs +1 -1
  149. package/dist/server/overlay/index.js +4 -4
  150. package/dist/server/{settingsSearchContributor-CDqRlqt7.cjs → settingsSearchContributor-DZj7Wc8l.cjs} +1 -1
  151. package/dist/server/{settingsSearchContributor-Dn-HFipc.js → settingsSearchContributor-DeMn-njw.js} +2 -2
  152. package/dist/{tr-MCRQ-3Mn.cjs → server/tr-BDbiY5YD.cjs} +1 -1
  153. package/dist/{tr-DlpnmKv6.js → server/tr-CxuAFkCi.js} +1 -0
  154. package/dist/server/tree/index.cjs +1 -1
  155. package/dist/server/tree/index.js +9 -8
  156. package/dist/server/useListCommands-Bf7aOTXZ.js +61 -0
  157. package/dist/server/useListCommands-ucngC3t4.cjs +1 -0
  158. package/dist/server/visibleBrowserRegistry-BTfWUlI1.cjs +1 -0
  159. package/dist/server/visibleBrowserRegistry-Dw2Y4y_I.js +89 -0
  160. package/dist/{settingsSearchContributor-BGImAgsw.js → settingsSearchContributor-C-UJc7Xc.js} +2 -2
  161. package/dist/{settingsSearchContributor-Ci6vEEQ1.cjs → settingsSearchContributor-Du0SDpJt.cjs} +1 -1
  162. package/dist/solid/_internal/app/keybindings/context/useFocusClaim.js +32 -0
  163. package/dist/solid/_internal/app/keybindings/context/useListCommands.js +22 -0
  164. package/dist/solid/_internal/app/keybindings/contextKey/builtins.js +10 -0
  165. package/dist/solid/_internal/app/keybindings/panelCommandsRegistry.js +25 -0
  166. package/dist/solid/desktop/menu/MenuBar.jsx +2 -1
  167. package/dist/solid/host/index.js +3 -0
  168. package/dist/solid/i18n/locales/de.json +1 -0
  169. package/dist/solid/i18n/locales/tr.json +1 -0
  170. package/dist/solid/navigation/Tabs.jsx +5 -0
  171. package/dist/solid/notifications/NotificationHost.jsx +36 -10
  172. package/dist/solid/notifications/index.js +1 -0
  173. package/dist/solid/notifications/notificationCommands.js +55 -17
  174. package/dist/solid/tree/TreeSurface.jsx +17 -0
  175. package/dist/solid/tree/createTreeController.js +7 -6
  176. package/dist/solid/tree/index.js +1 -0
  177. package/dist/solid/tree/selectAllInScope.js +47 -0
  178. package/dist/solid/tree/treeKeymap.js +0 -5
  179. package/dist/style.css +1 -1
  180. package/dist/{server/tr-MCRQ-3Mn.cjs → tr-BDbiY5YD.cjs} +1 -1
  181. package/dist/{server/tr-DlpnmKv6.js → tr-CxuAFkCi.js} +1 -0
  182. package/dist/tree/createTreeController.d.cts +5 -0
  183. package/dist/tree/createTreeController.d.ts +5 -0
  184. package/dist/tree/index.cjs +1 -1
  185. package/dist/tree/index.d.cts +1 -0
  186. package/dist/tree/index.d.ts +1 -0
  187. package/dist/tree/index.js +9 -8
  188. package/dist/tree/selectAllInScope.d.cts +5 -0
  189. package/dist/tree/selectAllInScope.d.ts +5 -0
  190. package/dist/tree/treeKeymap.d.cts +2 -4
  191. package/dist/tree/treeKeymap.d.ts +2 -4
  192. package/dist/ui.css +1 -1
  193. package/dist/useListCommands-Bf7aOTXZ.js +61 -0
  194. package/dist/useListCommands-ucngC3t4.cjs +1 -0
  195. package/dist/visibleBrowserRegistry-BTfWUlI1.cjs +1 -0
  196. package/dist/visibleBrowserRegistry-Dw2Y4y_I.js +89 -0
  197. package/package.json +1 -1
  198. package/dist/GuidedTour-CYgy48bt.cjs +0 -21
  199. package/dist/Stepper-B_nRDFxN.cjs +0 -1
  200. package/dist/descriptor-NxSXaBdy.cjs +0 -1
  201. package/dist/descriptor-zKWZdo3E.js +0 -1059
  202. package/dist/server/GuidedTour-TAGGtEp2.cjs +0 -20
  203. package/dist/server/descriptor-B6FQLHie.cjs +0 -1
  204. package/dist/server/descriptor-DNWBt66Z.js +0 -951
  205. package/dist/server/visibleBrowserRegistry-CZFCFSo_.cjs +0 -1
  206. package/dist/server/visibleBrowserRegistry-DOZlLrpo.js +0 -113
  207. package/dist/visibleBrowserRegistry-CZFCFSo_.cjs +0 -1
  208. package/dist/visibleBrowserRegistry-DOZlLrpo.js +0 -113
@@ -0,0 +1,89 @@
1
+ import { createContext as f, useContext as g, createSignal as l } from "solid-js";
2
+ import { B } from "./bugIndicatingError-h3J5qkL6.js";
3
+ const p = f();
4
+ function T() {
5
+ const e = g(p);
6
+ if (!e)
7
+ throw new B("useWorkspaceTabs: missing provider");
8
+ return e;
9
+ }
10
+ const [V, v] = l(void 0);
11
+ let a = null;
12
+ function h(e) {
13
+ a = e;
14
+ }
15
+ function A(e) {
16
+ v(e), a == null || a(e);
17
+ }
18
+ const d = f();
19
+ function y() {
20
+ return g(d);
21
+ }
22
+ const c = /* @__PURE__ */ new WeakMap();
23
+ function w(e) {
24
+ let t = c.get(e);
25
+ if (!t) {
26
+ const [r, s] = l([]);
27
+ t = {
28
+ entries: /* @__PURE__ */ new Map(),
29
+ activeBrowsers: r,
30
+ setActiveBrowsers: s
31
+ }, c.set(e, t);
32
+ }
33
+ return t;
34
+ }
35
+ function k(e, t, r, s, i, u = 0) {
36
+ if (!e) return;
37
+ const n = w(e);
38
+ if (s && r.width > 0 && r.height > 0) {
39
+ const o = n.entries.get(t);
40
+ if (o && o.generation > u)
41
+ return;
42
+ n.entries.set(t, {
43
+ tabId: t,
44
+ bounds: { ...r },
45
+ lease: i,
46
+ generation: u
47
+ });
48
+ } else {
49
+ const o = n.entries.get(t);
50
+ if (o && (!i || o.lease === i)) {
51
+ if (o.generation > u)
52
+ return;
53
+ n.entries.delete(t);
54
+ }
55
+ }
56
+ n.setActiveBrowsers(Array.from(n.entries.values()));
57
+ }
58
+ function S(e, t, r) {
59
+ if (!e) return;
60
+ const s = c.get(e);
61
+ if (!s) return;
62
+ const i = s.entries.get(t);
63
+ i && (!r || i.lease === r) && (s.entries.delete(t), s.setActiveBrowsers(Array.from(s.entries.values())));
64
+ }
65
+ function x(e) {
66
+ return e ? w(e).activeBrowsers() : [];
67
+ }
68
+ function b(e) {
69
+ return x(e).length > 0;
70
+ }
71
+ function M(e) {
72
+ if (e) {
73
+ const t = c.get(e);
74
+ t && (t.entries.clear(), t.setActiveBrowsers([]));
75
+ }
76
+ }
77
+ export {
78
+ d as T,
79
+ p as W,
80
+ y as a,
81
+ T as b,
82
+ M as c,
83
+ x as g,
84
+ b as h,
85
+ A as o,
86
+ k as r,
87
+ h as s,
88
+ S as u
89
+ };
@@ -1,7 +1,7 @@
1
1
  import { createSignal as T, useContext as F, onCleanup as Q, createRenderEffect as P } from "solid-js";
2
- import { t as f, l as q } from "./i18n-B_XRSWWN.js";
2
+ import { t as f, l as q } from "./i18n-CYq-dVvv.js";
3
3
  import { F as K } from "./notificationSuppressions-CBIJ4bC4.js";
4
- import { W as M } from "./visibleBrowserRegistry-DOZlLrpo.js";
4
+ import { W as M } from "./visibleBrowserRegistry-Dw2Y4y_I.js";
5
5
  const J = "SCHEMA", [U, Y] = T(null);
6
6
  function ce(c) {
7
7
  Y(() => c);
@@ -1 +1 @@
1
- "use strict";const S=require("solid-js"),m=require("./i18n-DZZyw7Iu.cjs"),H=require("./notificationSuppressions-DFbFpayS.cjs"),P=require("./visibleBrowserRegistry-CZFCFSo_.cjs"),Q="SCHEMA",[F,J]=S.createSignal(null);function K(c){J(()=>c)}const M=2,U=200,W=40;function N(c,u){const e=c.toLowerCase(),a=u.toLowerCase();return e===a?9:e.startsWith(a)?7:e.includes(a)?5:0}function Y(c){const[u,e]=S.createSignal([]),[a,r]=S.createSignal(!1),[d,i]=S.createSignal(null),o=S.useContext(P.WorkspaceTabsContext),h=()=>F(),B=()=>{if(!(o!=null&&o.activeWorkspaceTabId)||!o.workspaceTabs)return null;const n=o.activeWorkspaceTabId();return o.workspaceTabs().find(b=>b.id===n)??null},k=()=>{var n,b,C;return((b=(n=h())==null?void 0:n.getWorkspaceId)==null?void 0:b.call(n))??((C=B())==null?void 0:C.workspaceId)??null},R=()=>{var n;return!!((n=h())!=null&&n.getWorkspaceId||o!=null&&o.workspaceTabs)},L=()=>{var n;return!!((n=h())!=null&&n.hasActiveWorkspace())&&(!R()||!!k())},_=()=>{var n;return((n=h())==null?void 0:n.getSelectedSchema())??""};let j=0,y;const $=()=>{y!==void 0&&(clearTimeout(y),y=void 0)};return S.onCleanup(()=>{$(),j+=1}),S.createRenderEffect(()=>{const n=c.enabled(),b=c.query().trim();$();const C=++j;if(!n||!L()){e([]),r(!1),i(null);return}const t=h(),l=(t==null?void 0:t.getSelectedSchema())??"",v=k(),E=(t==null?void 0:t.getSchemas())??[],I=l?[l]:E,T=()=>k()===v&&h()===t&&!!(t!=null&&t.hasActiveWorkspace())&&(t==null?void 0:t.getSelectedSchema())===l,O=()=>C===j&&T()&&c.enabled();if(b.length<M){if(i(null),r(!1),l&&t){const p=t.getCachedObjectsForSchema(l);if(p&&p.length>0){const g=p.slice(0,10).map(f=>({id:`db:${l}:${f.objectType}:${f.objectName}`,kind:"database-object",title:f.objectName,description:`${f.objectType} · ${l}`,detail:l,category:m.t("Database"),objectType:f.objectType,schema:l,enabled:!0,score:1,run:()=>{T()&&t.openObject(l,f)}}));e(g);return}}e([]);return}if(e([]),I.length===0){r(!1),i(null);return}r(!0),i(null),y=setTimeout(async()=>{if(O())try{let p=[];if(v&&(t!=null&&t.searchObjects))p=[...await t.searchObjects(v,b,{limit:W,schemas:I})];else if(t&&l){let s=t.getCachedObjectsForSchema(l);if(s||(s=await t.loadObjectsForSchema(l)),s){const x=b.toLowerCase();p=s.filter(w=>w.objectName.toLowerCase().includes(x)).slice(0,W).map(w=>({owner:l,objectType:w.objectType,objectName:w.objectName,status:w.status}))}}if(!O())return;const g=b.toLowerCase(),f=E.filter(s=>s.toLowerCase().includes(g)).slice(0,3).map(s=>({id:`db:schema:${s}`,kind:"database-object",title:s,description:`${m.t("Schema")} · ${s}`,detail:m.t("Schema"),category:m.t("Database"),objectType:Q,schema:s,enabled:!0,score:N(s,b)+1,run:()=>{T()&&(t==null||t.navigateToSchema(s))}})),q=p.filter(s=>I.includes(s.owner)).map(s=>({id:`db:${s.owner}:${s.objectType}:${s.objectName}`,kind:"database-object",title:s.objectName,description:`${s.objectType} · ${s.owner}`,detail:s.owner,category:m.t("Database"),objectType:s.objectType,schema:s.owner,enabled:!0,score:N(s.objectName,b),run:()=>{T()&&(t==null||t.openObject(s.owner,s))},rawDbObject:s}));e([...f,...q]),r(!1)}catch(p){if(!O())return;const g=H.errorText(p,m.t("Failed to search database objects"));i(g),r(!1)}},U)}),{items:u,loading:a,error:d,hasWorkspaceContext:L,activeSchema:_}}let A=null;function z(c){A=c}function G(c,u){const e=u.toLowerCase();return(c.labels??[]).some(a=>m.labelText(a).toLowerCase().includes(e))}function V(c,u,e){const a=u.toLowerCase(),r=c.label.toLowerCase();if(r===a)return 8;if(r.startsWith(a))return 7;if(r.includes(a))return 6;const d=a.split(/\s+/).filter(Boolean);return d.length>1&&d.every(h=>r.includes(h))?5:c.categoryId.toLowerCase().includes(a)?4:(c.keywords??[]).some(h=>h.toLowerCase().includes(a))?3:(e.matches??G)(c,u)?2:0}function D(c,u,e){var r,d;const a=((r=e.breadcrumb)==null?void 0:r.call(e,c.categoryId))??"";return{id:`setting:${c.id}`,kind:"setting",title:((d=e.title)==null?void 0:d.call(e,c))??c.label,description:a||m.t("Settings"),category:m.t("Settings"),enabled:!0,score:u,run:()=>{e.open(c)},rawSetting:c}}function X(c,u=20){const e=A;if(!e)return[];const a=c.trim(),r=e.items();if(!a)return(e.popular?e.popular(r):r).slice(0,u).map(o=>D(o,1,e));const d=[];for(const i of r){const o=V(i,a,e);o>0&&d.push({item:i,score:o})}return d.sort((i,o)=>o.score-i.score),d.slice(0,u).map(({item:i,score:o})=>D(i,o,e))}exports.createDatabaseObjectSearch=Y;exports.searchSettings=X;exports.setDatabaseObjectSearchProvider=K;exports.setSettingsSearchSource=z;
1
+ "use strict";const S=require("solid-js"),m=require("./i18n-B9ccWgcR.cjs"),H=require("./notificationSuppressions-DFbFpayS.cjs"),P=require("./visibleBrowserRegistry-BTfWUlI1.cjs"),Q="SCHEMA",[F,J]=S.createSignal(null);function K(c){J(()=>c)}const M=2,U=200,W=40;function N(c,u){const e=c.toLowerCase(),a=u.toLowerCase();return e===a?9:e.startsWith(a)?7:e.includes(a)?5:0}function Y(c){const[u,e]=S.createSignal([]),[a,r]=S.createSignal(!1),[d,i]=S.createSignal(null),o=S.useContext(P.WorkspaceTabsContext),h=()=>F(),B=()=>{if(!(o!=null&&o.activeWorkspaceTabId)||!o.workspaceTabs)return null;const n=o.activeWorkspaceTabId();return o.workspaceTabs().find(b=>b.id===n)??null},k=()=>{var n,b,C;return((b=(n=h())==null?void 0:n.getWorkspaceId)==null?void 0:b.call(n))??((C=B())==null?void 0:C.workspaceId)??null},R=()=>{var n;return!!((n=h())!=null&&n.getWorkspaceId||o!=null&&o.workspaceTabs)},L=()=>{var n;return!!((n=h())!=null&&n.hasActiveWorkspace())&&(!R()||!!k())},_=()=>{var n;return((n=h())==null?void 0:n.getSelectedSchema())??""};let j=0,y;const $=()=>{y!==void 0&&(clearTimeout(y),y=void 0)};return S.onCleanup(()=>{$(),j+=1}),S.createRenderEffect(()=>{const n=c.enabled(),b=c.query().trim();$();const C=++j;if(!n||!L()){e([]),r(!1),i(null);return}const t=h(),l=(t==null?void 0:t.getSelectedSchema())??"",v=k(),E=(t==null?void 0:t.getSchemas())??[],I=l?[l]:E,T=()=>k()===v&&h()===t&&!!(t!=null&&t.hasActiveWorkspace())&&(t==null?void 0:t.getSelectedSchema())===l,O=()=>C===j&&T()&&c.enabled();if(b.length<M){if(i(null),r(!1),l&&t){const p=t.getCachedObjectsForSchema(l);if(p&&p.length>0){const g=p.slice(0,10).map(f=>({id:`db:${l}:${f.objectType}:${f.objectName}`,kind:"database-object",title:f.objectName,description:`${f.objectType} · ${l}`,detail:l,category:m.t("Database"),objectType:f.objectType,schema:l,enabled:!0,score:1,run:()=>{T()&&t.openObject(l,f)}}));e(g);return}}e([]);return}if(e([]),I.length===0){r(!1),i(null);return}r(!0),i(null),y=setTimeout(async()=>{if(O())try{let p=[];if(v&&(t!=null&&t.searchObjects))p=[...await t.searchObjects(v,b,{limit:W,schemas:I})];else if(t&&l){let s=t.getCachedObjectsForSchema(l);if(s||(s=await t.loadObjectsForSchema(l)),s){const x=b.toLowerCase();p=s.filter(w=>w.objectName.toLowerCase().includes(x)).slice(0,W).map(w=>({owner:l,objectType:w.objectType,objectName:w.objectName,status:w.status}))}}if(!O())return;const g=b.toLowerCase(),f=E.filter(s=>s.toLowerCase().includes(g)).slice(0,3).map(s=>({id:`db:schema:${s}`,kind:"database-object",title:s,description:`${m.t("Schema")} · ${s}`,detail:m.t("Schema"),category:m.t("Database"),objectType:Q,schema:s,enabled:!0,score:N(s,b)+1,run:()=>{T()&&(t==null||t.navigateToSchema(s))}})),q=p.filter(s=>I.includes(s.owner)).map(s=>({id:`db:${s.owner}:${s.objectType}:${s.objectName}`,kind:"database-object",title:s.objectName,description:`${s.objectType} · ${s.owner}`,detail:s.owner,category:m.t("Database"),objectType:s.objectType,schema:s.owner,enabled:!0,score:N(s.objectName,b),run:()=>{T()&&(t==null||t.openObject(s.owner,s))},rawDbObject:s}));e([...f,...q]),r(!1)}catch(p){if(!O())return;const g=H.errorText(p,m.t("Failed to search database objects"));i(g),r(!1)}},U)}),{items:u,loading:a,error:d,hasWorkspaceContext:L,activeSchema:_}}let A=null;function z(c){A=c}function G(c,u){const e=u.toLowerCase();return(c.labels??[]).some(a=>m.labelText(a).toLowerCase().includes(e))}function V(c,u,e){const a=u.toLowerCase(),r=c.label.toLowerCase();if(r===a)return 8;if(r.startsWith(a))return 7;if(r.includes(a))return 6;const d=a.split(/\s+/).filter(Boolean);return d.length>1&&d.every(h=>r.includes(h))?5:c.categoryId.toLowerCase().includes(a)?4:(c.keywords??[]).some(h=>h.toLowerCase().includes(a))?3:(e.matches??G)(c,u)?2:0}function D(c,u,e){var r,d;const a=((r=e.breadcrumb)==null?void 0:r.call(e,c.categoryId))??"";return{id:`setting:${c.id}`,kind:"setting",title:((d=e.title)==null?void 0:d.call(e,c))??c.label,description:a||m.t("Settings"),category:m.t("Settings"),enabled:!0,score:u,run:()=>{e.open(c)},rawSetting:c}}function X(c,u=20){const e=A;if(!e)return[];const a=c.trim(),r=e.items();if(!a)return(e.popular?e.popular(r):r).slice(0,u).map(o=>D(o,1,e));const d=[];for(const i of r){const o=V(i,a,e);o>0&&d.push({item:i,score:o})}return d.sort((i,o)=>o.score-i.score),d.slice(0,u).map(({item:i,score:o})=>D(i,o,e))}exports.createDatabaseObjectSearch=Y;exports.searchSettings=X;exports.setDatabaseObjectSearchProvider=K;exports.setSettingsSearchSource=z;
@@ -0,0 +1,32 @@
1
+ import { onCleanup } from 'solid-js';
2
+ import { useKeybindingsOptional } from './keybindingsContext';
3
+ import { createFocusContextKey } from './createFocusContextKey';
4
+ const lastFocusedClaims = new WeakMap();
5
+ export function useFocusClaim(options) {
6
+ const keybindings = useKeybindingsOptional();
7
+ if (!keybindings)
8
+ return undefined;
9
+ const { registry } = options;
10
+ const claim = {
11
+ ...options.verbs,
12
+ isActive: () => lastFocusedClaims.get(registry) === claim,
13
+ };
14
+ const release = registry.set(claim);
15
+ onCleanup(() => {
16
+ release();
17
+ if (lastFocusedClaims.get(registry) === claim) {
18
+ lastFocusedClaims.delete(registry);
19
+ }
20
+ });
21
+ createFocusContextKey({
22
+ contextKeys: keybindings.contextKeys,
23
+ key: options.key,
24
+ containerRef: options.container,
25
+ ...(options.countsAsFocus ? { countsAsFocus: options.countsAsFocus } : {}),
26
+ onFocusIn: () => {
27
+ lastFocusedClaims.set(registry, claim);
28
+ options.onFocusIn?.();
29
+ },
30
+ });
31
+ return claim;
32
+ }
@@ -0,0 +1,22 @@
1
+ import { FOCUS_CONTEXT_KEYS } from '../contextKey/builtins';
2
+ import { listHandlers, } from '../panelCommandsRegistry';
3
+ import { createFocusContextKey } from './createFocusContextKey';
4
+ import { useKeybindingsOptional } from './keybindingsContext';
5
+ import { useFocusClaim } from './useFocusClaim';
6
+ export function useListCommands(options) {
7
+ const keybindings = useKeybindingsOptional();
8
+ if (!keybindings)
9
+ return;
10
+ useFocusClaim({
11
+ key: FOCUS_CONTEXT_KEYS.listFocus,
12
+ registry: listHandlers,
13
+ container: options.container,
14
+ verbs: options.verbs,
15
+ });
16
+ createFocusContextKey({
17
+ contextKeys: keybindings.contextKeys,
18
+ key: FOCUS_CONTEXT_KEYS.listSupportsMultiselect,
19
+ containerRef: options.container,
20
+ countsAsFocus: () => options.supportsMultiselect(),
21
+ });
22
+ }
@@ -23,6 +23,7 @@ export const FOCUS_CONTEXT_KEYS = {
23
23
  sqlEditorFocus: 'sqlEditorFocus',
24
24
  sqlBindPromptFocus: 'sqlBindPromptFocus',
25
25
  dashboardFocus: 'dashboardFocus',
26
+ dashboardCategoryFocus: 'dashboardCategoryFocus',
26
27
  rssFeederFocus: 'rssFeederFocus',
27
28
  rssItemSelected: 'rssItemSelected',
28
29
  explorerFocus: 'explorerFocus',
@@ -33,7 +34,11 @@ export const FOCUS_CONTEXT_KEYS = {
33
34
  gridFetching: 'gridFetching',
34
35
  terminalFocus: 'terminalFocus',
35
36
  sshTerminalFocus: 'sshTerminalFocus',
37
+ sshTerminalWorkspaceFocus: 'sshTerminalWorkspaceFocus',
38
+ terminalFindFocused: 'terminalFindFocused',
39
+ sshTerminalFindFocused: 'sshTerminalFindFocused',
36
40
  terminalAltBufferActive: 'terminalAltBufferActive',
41
+ terminalAccessibleBufferFocus: 'terminalAccessibleBufferFocus',
37
42
  terminalMultiPane: 'terminalMultiPane',
38
43
  terminalShellType: 'terminalShellType',
39
44
  schemaBrowserFocus: 'schemaBrowserFocus',
@@ -52,6 +57,11 @@ export const FOCUS_CONTEXT_KEYS = {
52
57
  sqlSnippetsFocus: 'sqlSnippetsFocus',
53
58
  objectCommentFocus: 'objectCommentFocus',
54
59
  cellEditorFocus: 'cellEditorFocus',
60
+ cellValueFieldFocus: 'cellValueFieldFocus',
61
+ jsonTreeFocus: 'jsonTreeFocus',
62
+ jsonTreeFilterFocus: 'jsonTreeFilterFocus',
63
+ listFocus: 'listFocus',
64
+ listSupportsMultiselect: 'listSupportsMultiselect',
55
65
  scmCommitInputFocus: 'scmCommitInputFocus',
56
66
  terminalCommandPaletteFocus: 'terminalCommandPaletteFocus',
57
67
  terminalCommandPaletteEntryActive: 'terminalCommandPaletteEntryActive',
@@ -0,0 +1,25 @@
1
+ export function createPanelCommandRegistry() {
2
+ const stack = [];
3
+ const set = (handlers) => {
4
+ stack.push(handlers);
5
+ return () => {
6
+ const idx = stack.lastIndexOf(handlers);
7
+ if (idx !== -1)
8
+ stack.splice(idx, 1);
9
+ };
10
+ };
11
+ const find = (predicate) => {
12
+ for (let i = stack.length - 1; i >= 0; i -= 1) {
13
+ const handlers = stack[i];
14
+ if (handlers !== undefined && predicate(handlers))
15
+ return handlers;
16
+ }
17
+ return null;
18
+ };
19
+ return {
20
+ set,
21
+ current: () => (stack.length > 0 ? (stack[stack.length - 1] ?? null) : null),
22
+ find,
23
+ };
24
+ }
25
+ export const listHandlers = createPanelCommandRegistry();
@@ -79,7 +79,8 @@ export function MenuBar(props) {
79
79
  closeAll();
80
80
  };
81
81
  const handleWindowKeyDown = (event) => {
82
- if (event.altKey &&
82
+ if (!event.defaultPrevented &&
83
+ event.altKey &&
83
84
  !event.ctrlKey &&
84
85
  !event.metaKey &&
85
86
  !event.shiftKey &&
@@ -16,6 +16,9 @@ export { setOpenSettingsHandler } from '../_internal/app/settings/ui/shell/openS
16
16
  export { provideLayoutPreferences, } from '../_internal/platform/settings/preferencesCache';
17
17
  export { provideNotificationSecretStore, } from '../_internal/app/settings/secrets/notificationSecrets';
18
18
  export { KeybindingsProvider, useKeybindings, useKeybindingsOptional, } from '../_internal/app/keybindings/context/keybindingsContext';
19
+ export { useFocusClaim } from '../_internal/app/keybindings/context/useFocusClaim';
20
+ export { useListCommands } from '../_internal/app/keybindings/context/useListCommands';
21
+ export { createPanelCommandRegistry, listHandlers, } from '../_internal/app/keybindings/panelCommandsRegistry';
19
22
  export { WorkspaceTabsContext, useWorkspaceTabs, } from '../_internal/app/contexts/WorkspaceTabsContext';
20
23
  export { ToolWindowContext, useToolWindowLayout, } from '../_internal/app/contexts/toolWindow/ToolWindowContext';
21
24
  export * from '../_internal/app/windows/window/HostWindowContext';
@@ -352,6 +352,7 @@
352
352
  "No data is lost; the cache fills again as sessions run.": "Es gehen keine Daten verloren; der Cache füllt sich wieder, während Sitzungen laufen.",
353
353
  "created_at": "created_at",
354
354
  "Accept Notification Primary Action": "Primäraktion der Benachrichtigung annehmen",
355
+ "Clear Notification": "Benachrichtigung löschen",
355
356
  "Accepted formats: {accept}": "Akzeptierte Formate: {accept}",
356
357
  "Add tag (press Enter or comma)...": "Tag hinzufügen (Eingabe oder Komma drücken)...",
357
358
  "Breadcrumbs": "Breadcrumbs",
@@ -366,6 +366,7 @@
366
366
  "No data is lost; the cache fills again as sessions run.": "Veri kaybolmaz; oturumlar çalıştıkça önbellek yeniden dolar.",
367
367
  "created_at": "created_at",
368
368
  "Accept Notification Primary Action": "Bildirimin Birincil Eylemini Kabul Et",
369
+ "Clear Notification": "Bildirimi Temizle",
369
370
  "Accepted formats: {accept}": "Kabul edilen biçimler: {accept}",
370
371
  "Add tag (press Enter or comma)...": "Etiket ekle (Enter'a ya da virgüle basın)...",
371
372
  "Breadcrumbs": "Yol izleri",
@@ -95,6 +95,11 @@ export function Tabs(props) {
95
95
  }
96
96
  }} onKeyDown={(e) => {
97
97
  if ((isKey(e, 'Delete') || isKey(e, 'Backspace')) &&
98
+ !e.defaultPrevented &&
99
+ !e.ctrlKey &&
100
+ !e.metaKey &&
101
+ !e.altKey &&
102
+ !e.shiftKey &&
98
103
  isTabClosable()) {
99
104
  e.preventDefault();
100
105
  props.onClose?.(tab.value);
@@ -94,17 +94,39 @@ export const NotificationHost = (props) => {
94
94
  if (!primary.keepOpen)
95
95
  closeNotification(target.id);
96
96
  };
97
+ const clearFocused = () => {
98
+ const list = visible();
99
+ const idx = focusIndex();
100
+ if (idx === null)
101
+ return;
102
+ const target = list[idx];
103
+ if (!target)
104
+ return;
105
+ closeNotification(target.id);
106
+ setFocusIndex(list.length <= 1 ? null : Math.min(idx, list.length - 2));
107
+ };
108
+ const hideToasts = () => {
109
+ if (visible().length === 0)
110
+ return;
111
+ dismissableToastIds(store.items).forEach((id) => closeNotification(id));
112
+ setFocusIndex(null);
113
+ };
114
+ const keybindings = useKeybindingsOptional();
115
+ const ownsCommandKeys = keybindings === null;
116
+ const isMacPlatform = /Mac OS X|Macintosh/i.test(hostWindow.navigator?.userAgent ?? '');
97
117
  const handleKeydown = (event) => {
98
118
  const list = visible();
99
119
  if (list.length === 0)
100
120
  return;
101
- if (isKey(event, 'Escape')) {
121
+ if (ownsCommandKeys && !event.defaultPrevented && isKey(event, 'Escape')) {
102
122
  event.preventDefault();
103
- dismissableToastIds(store.items).forEach((id) => closeNotification(id));
104
- setFocusIndex(null);
123
+ hideToasts();
105
124
  return;
106
125
  }
107
- if (!hostEl()?.contains(event.target))
126
+ const eventTarget = event.target;
127
+ if (!eventTarget || typeof eventTarget.nodeType !== 'number')
128
+ return;
129
+ if (!hostEl()?.contains(eventTarget))
108
130
  return;
109
131
  const idx = focusIndex();
110
132
  if (isKey(event, 'ArrowDown') || isKey(event, 'PageDown')) {
@@ -142,11 +164,12 @@ export const NotificationHost = (props) => {
142
164
  toggleNotificationExpanded(target.id);
143
165
  return;
144
166
  }
145
- if (isKey(event, 'Delete') ||
146
- (isKey(event, 'Backspace') && event.metaKey)) {
167
+ if (ownsCommandKeys &&
168
+ !event.defaultPrevented &&
169
+ (isKey(event, 'Delete') ||
170
+ (isMacPlatform && isKey(event, 'Backspace') && event.metaKey))) {
147
171
  event.preventDefault();
148
- closeNotification(target.id);
149
- setFocusIndex(list.length <= 1 ? null : Math.min(idx, list.length - 2));
172
+ clearFocused();
150
173
  return;
151
174
  }
152
175
  if (event.key === ' ' || isKey(event, 'Enter')) {
@@ -155,7 +178,6 @@ export const NotificationHost = (props) => {
155
178
  }
156
179
  };
157
180
  useSettingsSubscription(notificationSettings, handleSettingsChange);
158
- const keybindings = useKeybindingsOptional();
159
181
  if (keybindings) {
160
182
  createFocusContextKey({
161
183
  contextKeys: keybindings.contextKeys,
@@ -165,7 +187,11 @@ export const NotificationHost = (props) => {
165
187
  createRenderEffect(() => {
166
188
  keybindings.contextKeys.setContext(FOCUS_CONTEXT_KEYS.notificationToastsVisible, display.ownsDisplay() && !isCenterOpen() && visible().length > 0);
167
189
  });
168
- onCleanup(registerNotificationCommands(keybindings, { acceptPrimaryAction }));
190
+ onCleanup(registerNotificationCommands(keybindings, {
191
+ acceptPrimaryAction,
192
+ clearFocused,
193
+ hideToasts,
194
+ }));
169
195
  }
170
196
  onMount(() => {
171
197
  const root = hostWindow.document.documentElement;
@@ -27,6 +27,7 @@ export { notificationSettings, } from '../_internal/app/settings/descriptors/not
27
27
  export * from './notificationDisplayOwner';
28
28
  export * from './createNotificationPreviewRuntime';
29
29
  export { NotificationHost } from './NotificationHost';
30
+ export { ACCEPT_PRIMARY_ACTION_NOTIFICATION, CLEAR_NOTIFICATION, HIDE_NOTIFICATION_TOASTS, registerNotificationCommands, } from './notificationCommands';
30
31
  export { NO_NOTIFICATION_OVERLAY, appWindowNotificationOverlay, } from './notificationOverlayChannel';
31
32
  export { NotificationItem } from './NotificationItem';
32
33
  export { NotificationPanel } from './NotificationPanel';
@@ -1,25 +1,63 @@
1
1
  import { ACCESSIBILITY_MODE_ENABLED_KEY, FOCUS_CONTEXT_KEYS, } from '../_internal/app/keybindings/contextKey/builtins';
2
2
  const WORKBENCH_CONTRIB_WEIGHT = 200;
3
3
  export const ACCEPT_PRIMARY_ACTION_NOTIFICATION = 'notification.acceptPrimaryAction';
4
+ export const CLEAR_NOTIFICATION = 'notification.clear';
5
+ export const HIDE_NOTIFICATION_TOASTS = 'notifications.hideToasts';
4
6
  const ACCEPT_PRIMARY_ACTION_WHEN = `${ACCESSIBILITY_MODE_ENABLED_KEY} && (${FOCUS_CONTEXT_KEYS.notificationFocus} || ${FOCUS_CONTEXT_KEYS.notificationToastsVisible})`;
7
+ const TOASTS_VISIBLE = FOCUS_CONTEXT_KEYS.notificationToastsVisible;
8
+ const TOASTS_VISIBLE_AND_FOCUSED = `${FOCUS_CONTEXT_KEYS.notificationToastsVisible} && ${FOCUS_CONTEXT_KEYS.notificationFocus}`;
5
9
  export function registerNotificationCommands(registries, deps) {
6
- const disposeCommand = registries.commands.register({
7
- id: ACCEPT_PRIMARY_ACTION_NOTIFICATION,
8
- handler: () => deps.acceptPrimaryAction(),
9
- metadata: {
10
- label: 'Accept Notification Primary Action',
11
- category: 'Notifications',
12
- },
13
- });
14
- const disposeBinding = registries.bindings.register({
15
- command: ACCEPT_PRIMARY_ACTION_NOTIFICATION,
16
- key: 'CmdOrCtrl+Shift+A',
17
- when: ACCEPT_PRIMARY_ACTION_WHEN,
18
- weight: WORKBENCH_CONTRIB_WEIGHT + 1,
19
- source: 'core',
20
- });
10
+ const disposers = [
11
+ registries.commands.register({
12
+ id: ACCEPT_PRIMARY_ACTION_NOTIFICATION,
13
+ handler: () => deps.acceptPrimaryAction(),
14
+ metadata: {
15
+ label: 'Accept Notification Primary Action',
16
+ category: 'Notifications',
17
+ },
18
+ }),
19
+ registries.bindings.register({
20
+ command: ACCEPT_PRIMARY_ACTION_NOTIFICATION,
21
+ key: 'CmdOrCtrl+Shift+A',
22
+ when: ACCEPT_PRIMARY_ACTION_WHEN,
23
+ weight: WORKBENCH_CONTRIB_WEIGHT + 1,
24
+ source: 'core',
25
+ }),
26
+ registries.commands.register({
27
+ id: CLEAR_NOTIFICATION,
28
+ handler: () => deps.clearFocused(),
29
+ metadata: { label: 'Clear Notification', category: 'Notifications' },
30
+ }),
31
+ registries.bindings.register({
32
+ command: CLEAR_NOTIFICATION,
33
+ key: 'Delete',
34
+ mac: 'Cmd+Backspace',
35
+ when: FOCUS_CONTEXT_KEYS.notificationFocus,
36
+ weight: WORKBENCH_CONTRIB_WEIGHT,
37
+ source: 'core',
38
+ }),
39
+ registries.commands.register({
40
+ id: HIDE_NOTIFICATION_TOASTS,
41
+ handler: () => deps.hideToasts(),
42
+ metadata: { label: 'Hide notifications', category: 'Notifications' },
43
+ }),
44
+ registries.bindings.register({
45
+ command: HIDE_NOTIFICATION_TOASTS,
46
+ key: 'Escape',
47
+ when: TOASTS_VISIBLE,
48
+ weight: WORKBENCH_CONTRIB_WEIGHT - 50,
49
+ source: 'core',
50
+ }),
51
+ registries.bindings.register({
52
+ command: HIDE_NOTIFICATION_TOASTS,
53
+ key: 'Escape',
54
+ when: TOASTS_VISIBLE_AND_FOCUSED,
55
+ weight: WORKBENCH_CONTRIB_WEIGHT + 100,
56
+ source: 'core',
57
+ }),
58
+ ];
21
59
  return () => {
22
- disposeBinding();
23
- disposeCommand();
60
+ for (const dispose of disposers.reverse())
61
+ dispose();
24
62
  };
25
63
  }
@@ -6,6 +6,8 @@ import { buildTreeContainerAria, buildTreeRowAria } from './treeAria';
6
6
  import { t } from '../i18n/i18n';
7
7
  import { TreeRow } from './TreeRow';
8
8
  import { TreeStickyHeader } from './TreeStickyHeader';
9
+ import { useListCommands } from '../_internal/app/keybindings/context/useListCommands';
10
+ import { useKeybindingsOptional } from '../_internal/app/keybindings/context/keybindingsContext';
9
11
  import styles from './TreeSurface.module.css.js';
10
12
  const FOCUS_MODE = 'roving-tabindex';
11
13
  export function TreeSurface(props) {
@@ -25,6 +27,16 @@ export function TreeSurface(props) {
25
27
  return -1;
26
28
  return row.depth - 1;
27
29
  });
30
+ useListCommands({
31
+ container: () => containerEl,
32
+ supportsMultiselect: () => capabilities().canMultiSelect,
33
+ verbs: { selectAll: () => controller().selectAll() },
34
+ });
35
+ const ownsSelectAllChord = useKeybindingsOptional() === null;
36
+ const isSelectAllChord = (event) => (event.key === 'a' || event.key === 'A') &&
37
+ (event.ctrlKey || event.metaKey) &&
38
+ !event.altKey &&
39
+ !event.shiftKey;
28
40
  const containerAria = createMemo(() => buildTreeContainerAria({
29
41
  treeId: descriptor().id,
30
42
  label: descriptor().ariaLabel,
@@ -72,6 +84,11 @@ export function TreeSurface(props) {
72
84
  <div ref={containerEl} {...containerAria()} class={styles.treeContainer} style={{ height: `${props.surface.scroller.totalHeight()}px` }} onKeyDown={(event) => {
73
85
  if (isTextEntry(event.target))
74
86
  return;
87
+ if (ownsSelectAllChord && isSelectAllChord(event) && capabilities().canMultiSelect) {
88
+ event.preventDefault();
89
+ controller().selectAll();
90
+ return;
91
+ }
75
92
  controller().handleKeyDown(event);
76
93
  }} onFocus={(event) => {
77
94
  if (event.target === event.currentTarget &&
@@ -1,6 +1,7 @@
1
1
  import { createMemo, createSignal, onCleanup } from 'solid-js';
2
2
  import { DEFAULT_TREE_CAPABILITIES, } from './types';
3
3
  import { findParentIndex, findTypeAheadIndex, resolveTreeIntent, } from './treeKeymap';
4
+ import { selectAllInScope } from './selectAllInScope';
4
5
  import { isKey } from '../_internal/base/keys';
5
6
  export const TYPE_AHEAD_RESET_MS = 1000;
6
7
  export function createTreeController(options) {
@@ -174,6 +175,11 @@ export function createTreeController(options) {
174
175
  selectable,
175
176
  };
176
177
  };
178
+ const selectAll = () => {
179
+ if (!caps().canMultiSelect)
180
+ return;
181
+ setSelectedKeys(new Set(selectAllInScope(options.rows(), cursorIndex(), selectedKeys())));
182
+ };
177
183
  const openMenuAt = (index, point) => {
178
184
  const row = options.rows()[index];
179
185
  if (row)
@@ -260,12 +266,6 @@ export function createTreeController(options) {
260
266
  });
261
267
  return;
262
268
  }
263
- case 'selectAll':
264
- event.preventDefault();
265
- setSelectedKeys(new Set(rows
266
- .filter((row) => row.selectable !== false)
267
- .map((row) => row.key)));
268
- return;
269
269
  case 'typeAhead': {
270
270
  const now = options.now?.() ?? Date.now();
271
271
  const stale = now - lastTypeAheadAt > TYPE_AHEAD_RESET_MS;
@@ -305,6 +305,7 @@ export function createTreeController(options) {
305
305
  selectIndex,
306
306
  clearSelection,
307
307
  selectChildren,
308
+ selectAll,
308
309
  childKindsHomogeneous,
309
310
  handleKeyDown,
310
311
  openMenuAt,
@@ -5,3 +5,4 @@ export * from './descriptor';
5
5
  export { DEFAULT_TREE_CAPABILITIES, } from './types';
6
6
  export * from './treeAria';
7
7
  export { createTreeController } from './createTreeController';
8
+ export { selectAllInScope } from './selectAllInScope';
@@ -0,0 +1,47 @@
1
+ import { findChildRange, findParentIndex } from './treeKeymap';
2
+ export function selectAllInScope(rows, cursor, selection) {
3
+ const indexByKey = new Map(rows.map((row, index) => [row.key, index]));
4
+ const selected = [...selection].filter((key) => indexByKey.has(key));
5
+ const start = startIndex(rows, cursor, selected, indexByKey);
6
+ const kind = lockKind(rows, start);
7
+ const pickable = (row) => row.selectable !== false && (kind === undefined || row.kind === kind);
8
+ const selectedSet = new Set(selected);
9
+ let scope = start < 0 ? -1 : findParentIndex(rows, start);
10
+ for (;;) {
11
+ const picked = descendantsOf(rows, scope)
12
+ .filter(pickable)
13
+ .map((row) => row.key);
14
+ if (scope < 0)
15
+ return picked;
16
+ const covered = picked.length === selectedSet.size &&
17
+ picked.every((key) => selectedSet.has(key));
18
+ if (picked.length > 0 && !covered)
19
+ return picked;
20
+ const scopeRow = rows[scope];
21
+ if (picked.length > 0 && pickable(scopeRow))
22
+ return [scopeRow.key, ...picked];
23
+ scope = findParentIndex(rows, scope);
24
+ }
25
+ }
26
+ function startIndex(rows, cursor, selected, indexByKey) {
27
+ const cursorKey = rows[cursor]?.key;
28
+ if (cursorKey !== undefined && !selected.includes(cursorKey))
29
+ return cursor;
30
+ const first = selected[0];
31
+ return first === undefined ? -1 : (indexByKey.get(first) ?? -1);
32
+ }
33
+ function lockKind(rows, start) {
34
+ const own = rows[start];
35
+ if (own && own.selectable !== false)
36
+ return own.kind;
37
+ const isSelectable = (row) => row.selectable !== false;
38
+ const next = rows.slice(Math.max(start, 0)).find(isSelectable) ??
39
+ rows.find(isSelectable);
40
+ return next?.kind;
41
+ }
42
+ function descendantsOf(rows, scope) {
43
+ if (scope < 0)
44
+ return rows;
45
+ const range = findChildRange(rows, scope);
46
+ return range ? rows.slice(range.start, range.end + 1) : [];
47
+ }
@@ -64,11 +64,6 @@ export function resolveTreeIntent(event, ctx) {
64
64
  return null;
65
65
  return { type: 'toggle' };
66
66
  }
67
- if ((event.key === 'a' || event.key === 'A') &&
68
- (event.ctrlKey || event.metaKey) &&
69
- capabilities.canMultiSelect) {
70
- return { type: 'selectAll' };
71
- }
72
67
  if (capabilities.canTypeAhead && isTypeAheadChar(event)) {
73
68
  return { type: 'typeAhead', char: event.key };
74
69
  }