@rapidmx/web-client 0.8.0 → 0.10.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 (247) hide show
  1. package/README.md +192 -88
  2. package/apps/shared/auth/accountUrl.ts +9 -0
  3. package/apps/shared/auth/adminAccess.ts +99 -0
  4. package/apps/shared/components/admin/elevation.ts +61 -0
  5. package/apps/shared/components/admin/layout/AdminShell.tsx +73 -7
  6. package/apps/shared/components/admin/settings/BrandingForm.tsx +2 -1
  7. package/apps/shared/components/admin/settings/DomainDnsSetup.tsx +87 -24
  8. package/apps/shared/components/calendar/layout/CalendarShell.tsx +8 -2
  9. package/apps/shared/components/contacts/ContactsToolbar.tsx +125 -115
  10. package/apps/shared/components/contacts/layout/ContactsShell.tsx +15 -3
  11. package/apps/shared/components/layout/AppShell.tsx +411 -288
  12. package/apps/shared/components/layout/BrandingChrome.tsx +3 -2
  13. package/apps/shared/components/layout/KeyEnrollmentGate.tsx +398 -389
  14. package/apps/shared/components/layout/MailboxProvisioning.tsx +168 -126
  15. package/apps/shared/components/layout/UserMenu.tsx +303 -150
  16. package/apps/shared/components/mail/ConversationList.tsx +269 -253
  17. package/apps/shared/components/mail/ConversationThreadPane.tsx +475 -434
  18. package/apps/shared/components/mail/LazyReadingPane.tsx +115 -0
  19. package/apps/shared/components/mail/MailAddress.tsx +88 -0
  20. package/apps/shared/components/mail/MailSelectionBar.tsx +235 -222
  21. package/apps/shared/components/mail/MessageDetailPane.tsx +1458 -1383
  22. package/apps/shared/components/mail/NewMailToasts.tsx +141 -0
  23. package/apps/shared/components/mail/compose/ComposeContext.tsx +279 -160
  24. package/apps/shared/components/mail/compose/ComposeToolbar.tsx +422 -418
  25. package/apps/shared/components/mail/compose/ComposeWindow.tsx +1842 -1700
  26. package/apps/shared/components/mail/compose/ComposeWindowPlaceholder.tsx +111 -0
  27. package/apps/shared/components/mail/compose/RichTextEditor.tsx +147 -118
  28. package/apps/shared/components/mail/compose/SendFailureAlert.tsx +48 -0
  29. package/apps/shared/components/mail/compose/composePerf.ts +46 -0
  30. package/apps/shared/components/mail/compose/quotedBody.ts +161 -100
  31. package/apps/shared/components/mail/layout/MailShell.tsx +476 -445
  32. package/apps/shared/components/mail/unreadStyle.tsx +75 -0
  33. package/apps/shared/components/settings/layout/SettingsShell.tsx +252 -240
  34. package/apps/shared/components/tasks/layout/TasksShell.tsx +15 -3
  35. package/apps/shared/keyboard/GlobalShortcuts.tsx +51 -0
  36. package/apps/shared/keyboard/ShortcutProvider.tsx +62 -0
  37. package/apps/shared/keyboard/ShortcutsDialog.tsx +84 -0
  38. package/apps/shared/keyboard/dispatch.ts +124 -0
  39. package/apps/shared/keyboard/format.ts +89 -0
  40. package/apps/shared/keyboard/keymap.ts +114 -0
  41. package/apps/shared/keyboard/match.ts +44 -0
  42. package/apps/shared/keyboard/parse.ts +136 -0
  43. package/apps/shared/keyboard/platform.ts +34 -0
  44. package/apps/shared/keyboard/registry.ts +65 -0
  45. package/apps/shared/keyboard/targets.ts +79 -0
  46. package/apps/shared/keyboard/useShortcut.ts +50 -0
  47. package/apps/shared/keyboard/useShortcutProps.ts +17 -0
  48. package/apps/shared/mail/folderCounts.ts +302 -0
  49. package/apps/shared/mail/listSnapshots.ts +87 -0
  50. package/apps/shared/mail/mergeFirstPage.ts +47 -0
  51. package/apps/shared/mail/messageReadState.ts +85 -0
  52. package/apps/shared/mail/newMailNotifications.ts +183 -0
  53. package/apps/shared/mail/useMailConnection.ts +150 -0
  54. package/apps/shared/mail/useMailLiveUpdates.ts +232 -0
  55. package/apps/shared/mail/useMarkMessageRead.ts +47 -0
  56. package/apps/shared/mail/useNewMailNotifications.ts +163 -0
  57. package/apps/shared/mail/useUnreadTitle.ts +42 -0
  58. package/apps/shared/navigation/AppRouter.tsx +300 -0
  59. package/apps/shared/navigation/appHrefs.ts +23 -0
  60. package/apps/shared/navigation/frameContext.tsx +35 -0
  61. package/apps/shared/navigation/idle.ts +45 -0
  62. package/apps/shared/navigation/routerContext.tsx +83 -0
  63. package/apps/shared/navigation/routes.ts +72 -0
  64. package/apps/shared/search/LocalIndexLifecycle.tsx +114 -98
  65. package/apps/shared/styles/app.css +28 -10
  66. package/apps/www/_routedPage.tsx +24 -0
  67. package/apps/www/_routes.ts +35 -0
  68. package/apps/www/calendar/index.tsx +55 -19
  69. package/apps/www/contacts/[uid].tsx +112 -107
  70. package/apps/www/contacts/index.tsx +584 -567
  71. package/apps/www/index.tsx +2280 -1854
  72. package/apps/www/messages/[uid].tsx +106 -101
  73. package/apps/www/settings/auto-reply/index.tsx +4 -1
  74. package/apps/www/settings/encryption/index.tsx +1252 -1249
  75. package/apps/www/settings/filters/[uid].tsx +4 -1
  76. package/apps/www/settings/filters/index.tsx +102 -99
  77. package/apps/www/settings/filters/new/index.tsx +138 -133
  78. package/apps/www/settings/labels/index.tsx +204 -201
  79. package/apps/www/settings/privacy/index.tsx +4 -1
  80. package/apps/www/settings/read-receipts/index.tsx +4 -1
  81. package/apps/www/settings/sharing/index.tsx +277 -274
  82. package/apps/www/settings/signatures/[uid].tsx +170 -167
  83. package/apps/www/settings/signatures/index.tsx +88 -85
  84. package/apps/www/settings/signatures/new/index.tsx +134 -129
  85. package/apps/www/tasks/index.tsx +18 -2
  86. package/dist/apps/shared/auth/accountUrl.d.ts +2 -0
  87. package/dist/apps/shared/auth/accountUrl.js +8 -0
  88. package/dist/apps/shared/auth/adminAccess.d.ts +30 -0
  89. package/dist/apps/shared/auth/adminAccess.js +89 -0
  90. package/dist/apps/shared/components/admin/elevation.d.ts +24 -0
  91. package/dist/apps/shared/components/admin/elevation.js +56 -0
  92. package/dist/apps/shared/components/admin/layout/AdminShell.d.ts +12 -4
  93. package/dist/apps/shared/components/admin/layout/AdminShell.js +49 -6
  94. package/dist/apps/shared/components/admin/settings/BrandingForm.js +1 -1
  95. package/dist/apps/shared/components/admin/settings/DomainDnsSetup.js +31 -13
  96. package/dist/apps/shared/components/calendar/layout/CalendarShell.d.ts +1 -1
  97. package/dist/apps/shared/components/calendar/layout/CalendarShell.js +8 -4
  98. package/dist/apps/shared/components/contacts/ContactsToolbar.d.ts +3 -1
  99. package/dist/apps/shared/components/contacts/ContactsToolbar.js +7 -4
  100. package/dist/apps/shared/components/contacts/layout/ContactsShell.d.ts +1 -1
  101. package/dist/apps/shared/components/contacts/layout/ContactsShell.js +15 -5
  102. package/dist/apps/shared/components/layout/AppShell.d.ts +29 -4
  103. package/dist/apps/shared/components/layout/AppShell.js +73 -14
  104. package/dist/apps/shared/components/layout/BrandingChrome.d.ts +3 -2
  105. package/dist/apps/shared/components/layout/BrandingChrome.js +3 -2
  106. package/dist/apps/shared/components/layout/KeyEnrollmentGate.js +10 -9
  107. package/dist/apps/shared/components/layout/MailboxProvisioning.d.ts +5 -2
  108. package/dist/apps/shared/components/layout/MailboxProvisioning.js +45 -8
  109. package/dist/apps/shared/components/layout/UserMenu.d.ts +28 -9
  110. package/dist/apps/shared/components/layout/UserMenu.js +87 -14
  111. package/dist/apps/shared/components/mail/ConversationList.js +9 -13
  112. package/dist/apps/shared/components/mail/ConversationThreadPane.d.ts +4 -1
  113. package/dist/apps/shared/components/mail/ConversationThreadPane.js +53 -28
  114. package/dist/apps/shared/components/mail/LazyReadingPane.d.ts +9 -0
  115. package/dist/apps/shared/components/mail/LazyReadingPane.js +82 -0
  116. package/dist/apps/shared/components/mail/MailAddress.d.ts +27 -0
  117. package/dist/apps/shared/components/mail/MailAddress.js +39 -0
  118. package/dist/apps/shared/components/mail/MailSelectionBar.d.ts +4 -1
  119. package/dist/apps/shared/components/mail/MailSelectionBar.js +11 -3
  120. package/dist/apps/shared/components/mail/MessageDetailPane.d.ts +7 -1
  121. package/dist/apps/shared/components/mail/MessageDetailPane.js +87 -36
  122. package/dist/apps/shared/components/mail/NewMailToasts.d.ts +19 -0
  123. package/dist/apps/shared/components/mail/NewMailToasts.js +55 -0
  124. package/dist/apps/shared/components/mail/compose/ComposeContext.d.ts +30 -0
  125. package/dist/apps/shared/components/mail/compose/ComposeContext.js +71 -5
  126. package/dist/apps/shared/components/mail/compose/ComposeToolbar.js +4 -3
  127. package/dist/apps/shared/components/mail/compose/ComposeWindow.d.ts +1 -1
  128. package/dist/apps/shared/components/mail/compose/ComposeWindow.js +122 -27
  129. package/dist/apps/shared/components/mail/compose/ComposeWindowPlaceholder.d.ts +19 -0
  130. package/dist/apps/shared/components/mail/compose/ComposeWindowPlaceholder.js +33 -0
  131. package/dist/apps/shared/components/mail/compose/RichTextEditor.d.ts +9 -1
  132. package/dist/apps/shared/components/mail/compose/RichTextEditor.js +20 -2
  133. package/dist/apps/shared/components/mail/compose/SendFailureAlert.d.ts +14 -0
  134. package/dist/apps/shared/components/mail/compose/SendFailureAlert.js +11 -0
  135. package/dist/apps/shared/components/mail/compose/composePerf.d.ts +16 -0
  136. package/dist/apps/shared/components/mail/compose/composePerf.js +41 -0
  137. package/dist/apps/shared/components/mail/compose/quotedBody.d.ts +13 -0
  138. package/dist/apps/shared/components/mail/compose/quotedBody.js +67 -11
  139. package/dist/apps/shared/components/mail/layout/MailShell.d.ts +19 -4
  140. package/dist/apps/shared/components/mail/layout/MailShell.js +85 -85
  141. package/dist/apps/shared/components/mail/unreadStyle.d.ts +45 -0
  142. package/dist/apps/shared/components/mail/unreadStyle.js +61 -0
  143. package/dist/apps/shared/components/settings/layout/SettingsShell.d.ts +1 -1
  144. package/dist/apps/shared/components/settings/layout/SettingsShell.js +15 -5
  145. package/dist/apps/shared/components/tasks/layout/TasksShell.d.ts +1 -1
  146. package/dist/apps/shared/components/tasks/layout/TasksShell.js +15 -5
  147. package/dist/apps/shared/keyboard/GlobalShortcuts.d.ts +14 -0
  148. package/dist/apps/shared/keyboard/GlobalShortcuts.js +37 -0
  149. package/dist/apps/shared/keyboard/ShortcutProvider.d.ts +20 -0
  150. package/dist/apps/shared/keyboard/ShortcutProvider.js +52 -0
  151. package/dist/apps/shared/keyboard/ShortcutsDialog.d.ts +14 -0
  152. package/dist/apps/shared/keyboard/ShortcutsDialog.js +42 -0
  153. package/dist/apps/shared/keyboard/dispatch.d.ts +16 -0
  154. package/dist/apps/shared/keyboard/dispatch.js +109 -0
  155. package/dist/apps/shared/keyboard/format.d.ts +12 -0
  156. package/dist/apps/shared/keyboard/format.js +74 -0
  157. package/dist/apps/shared/keyboard/keymap.d.ts +294 -0
  158. package/dist/apps/shared/keyboard/keymap.js +84 -0
  159. package/dist/apps/shared/keyboard/match.d.ts +20 -0
  160. package/dist/apps/shared/keyboard/match.js +31 -0
  161. package/dist/apps/shared/keyboard/parse.d.ts +31 -0
  162. package/dist/apps/shared/keyboard/parse.js +107 -0
  163. package/dist/apps/shared/keyboard/platform.d.ts +15 -0
  164. package/dist/apps/shared/keyboard/platform.js +22 -0
  165. package/dist/apps/shared/keyboard/registry.d.ts +39 -0
  166. package/dist/apps/shared/keyboard/registry.js +33 -0
  167. package/dist/apps/shared/keyboard/targets.d.ts +14 -0
  168. package/dist/apps/shared/keyboard/targets.js +67 -0
  169. package/dist/apps/shared/keyboard/useShortcut.d.ts +19 -0
  170. package/dist/apps/shared/keyboard/useShortcut.js +35 -0
  171. package/dist/apps/shared/keyboard/useShortcutProps.d.ts +10 -0
  172. package/dist/apps/shared/keyboard/useShortcutProps.js +15 -0
  173. package/dist/apps/shared/mail/folderCounts.d.ts +78 -0
  174. package/dist/apps/shared/mail/folderCounts.js +212 -0
  175. package/dist/apps/shared/mail/listSnapshots.d.ts +46 -0
  176. package/dist/apps/shared/mail/listSnapshots.js +43 -0
  177. package/dist/apps/shared/mail/mergeFirstPage.d.ts +23 -0
  178. package/dist/apps/shared/mail/mergeFirstPage.js +30 -0
  179. package/dist/apps/shared/mail/messageReadState.d.ts +32 -0
  180. package/dist/apps/shared/mail/messageReadState.js +63 -0
  181. package/dist/apps/shared/mail/newMailNotifications.d.ts +62 -0
  182. package/dist/apps/shared/mail/newMailNotifications.js +138 -0
  183. package/dist/apps/shared/mail/useMailConnection.d.ts +55 -0
  184. package/dist/apps/shared/mail/useMailConnection.js +96 -0
  185. package/dist/apps/shared/mail/useMailLiveUpdates.d.ts +55 -0
  186. package/dist/apps/shared/mail/useMailLiveUpdates.js +182 -0
  187. package/dist/apps/shared/mail/useMarkMessageRead.d.ts +12 -0
  188. package/dist/apps/shared/mail/useMarkMessageRead.js +44 -0
  189. package/dist/apps/shared/mail/useNewMailNotifications.d.ts +41 -0
  190. package/dist/apps/shared/mail/useNewMailNotifications.js +110 -0
  191. package/dist/apps/shared/mail/useUnreadTitle.d.ts +18 -0
  192. package/dist/apps/shared/mail/useUnreadTitle.js +31 -0
  193. package/dist/apps/shared/navigation/AppRouter.d.ts +52 -0
  194. package/dist/apps/shared/navigation/AppRouter.js +242 -0
  195. package/dist/apps/shared/navigation/appHrefs.d.ts +14 -0
  196. package/dist/apps/shared/navigation/appHrefs.js +20 -0
  197. package/dist/apps/shared/navigation/frameContext.d.ts +19 -0
  198. package/dist/apps/shared/navigation/frameContext.js +24 -0
  199. package/dist/apps/shared/navigation/idle.d.ts +14 -0
  200. package/dist/apps/shared/navigation/idle.js +43 -0
  201. package/dist/apps/shared/navigation/routerContext.d.ts +37 -0
  202. package/dist/apps/shared/navigation/routerContext.js +56 -0
  203. package/dist/apps/shared/navigation/routes.d.ts +32 -0
  204. package/dist/apps/shared/navigation/routes.js +37 -0
  205. package/dist/apps/shared/search/LocalIndexLifecycle.js +17 -3
  206. package/dist/apps/shared/styles/app.css +28 -10
  207. package/dist/apps/www/_routedPage.d.ts +12 -0
  208. package/dist/apps/www/_routedPage.js +19 -0
  209. package/dist/apps/www/_routes.d.ts +11 -0
  210. package/dist/apps/www/_routes.js +29 -0
  211. package/dist/apps/www/calendar/index.d.ts +2 -2
  212. package/dist/apps/www/calendar/index.js +39 -8
  213. package/dist/apps/www/contacts/[uid].d.ts +3 -9
  214. package/dist/apps/www/contacts/[uid].js +6 -2
  215. package/dist/apps/www/contacts/index.d.ts +2 -2
  216. package/dist/apps/www/contacts/index.js +17 -4
  217. package/dist/apps/www/index.d.ts +2 -2
  218. package/dist/apps/www/index.js +361 -34
  219. package/dist/apps/www/messages/[uid].d.ts +3 -7
  220. package/dist/apps/www/messages/[uid].js +7 -4
  221. package/dist/apps/www/settings/auto-reply/index.d.ts +2 -2
  222. package/dist/apps/www/settings/auto-reply/index.js +3 -1
  223. package/dist/apps/www/settings/encryption/index.d.ts +2 -2
  224. package/dist/apps/www/settings/encryption/index.js +3 -1
  225. package/dist/apps/www/settings/filters/[uid].d.ts +2 -2
  226. package/dist/apps/www/settings/filters/[uid].js +3 -1
  227. package/dist/apps/www/settings/filters/index.d.ts +2 -2
  228. package/dist/apps/www/settings/filters/index.js +3 -1
  229. package/dist/apps/www/settings/filters/new/index.d.ts +2 -2
  230. package/dist/apps/www/settings/filters/new/index.js +6 -2
  231. package/dist/apps/www/settings/labels/index.d.ts +2 -2
  232. package/dist/apps/www/settings/labels/index.js +3 -1
  233. package/dist/apps/www/settings/privacy/index.d.ts +2 -2
  234. package/dist/apps/www/settings/privacy/index.js +3 -1
  235. package/dist/apps/www/settings/read-receipts/index.d.ts +2 -2
  236. package/dist/apps/www/settings/read-receipts/index.js +3 -1
  237. package/dist/apps/www/settings/sharing/index.d.ts +2 -2
  238. package/dist/apps/www/settings/sharing/index.js +3 -1
  239. package/dist/apps/www/settings/signatures/[uid].d.ts +2 -2
  240. package/dist/apps/www/settings/signatures/[uid].js +3 -1
  241. package/dist/apps/www/settings/signatures/index.d.ts +2 -2
  242. package/dist/apps/www/settings/signatures/index.js +3 -1
  243. package/dist/apps/www/settings/signatures/new/index.d.ts +2 -2
  244. package/dist/apps/www/settings/signatures/new/index.js +6 -2
  245. package/dist/apps/www/tasks/index.d.ts +2 -2
  246. package/dist/apps/www/tasks/index.js +15 -3
  247. package/package.json +2 -2
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ ///////////////////////////////////////////////////////////////////////////////
3
+ // Copyright (C) 2026 Jean-Philippe Steinmetz
4
+ // SPDX-License-Identifier: MPL-2.0
5
+ ///////////////////////////////////////////////////////////////////////////////
6
+ import { createContext, useContext, useEffect, useMemo, useState, useSyncExternalStore } from "react";
7
+ import { dispatchKeyEvent } from "./dispatch.js";
8
+ import { SERVER_ENVIRONMENT, currentEnvironment } from "./platform.js";
9
+ import { ShortcutRegistry } from "./registry.js";
10
+ const ShortcutContext = createContext(null);
11
+ /**
12
+ * The web client's one keyboard layer. Mounted once, by `AppChrome` (the frame that stays mounted as the router swaps pages), so shortcuts
13
+ * work in every view - mail, calendar, contacts, tasks, settings - and a page change only changes which handlers are registered.
14
+ *
15
+ * One `keydown` listener on `document` (bubbling, so what a widget handles itself and `preventDefault()`s is left alone) hands each key to
16
+ * `dispatchKeyEvent()`. Views claim keys with `useShortcut()`. Outside a provider - an admin page, a component rendered on its own - that
17
+ * hook does nothing.
18
+ *
19
+ * The platform (macOS, the desktop client) is read after mount, never during render, so the server render and hydration agree.
20
+ */
21
+ export function ShortcutProvider({ children }) {
22
+ const registry = useMemo(() => new ShortcutRegistry(), []);
23
+ const [env, setEnv] = useState(SERVER_ENVIRONMENT);
24
+ useEffect(() => {
25
+ setEnv(currentEnvironment());
26
+ }, []);
27
+ useEffect(() => {
28
+ function handleKeyDown(event) {
29
+ dispatchKeyEvent(registry, event, currentEnvironment(), document);
30
+ }
31
+ document.addEventListener("keydown", handleKeyDown);
32
+ return () => document.removeEventListener("keydown", handleKeyDown);
33
+ }, [registry]);
34
+ const value = useMemo(() => ({ registry, env }), [registry, env]);
35
+ return _jsx(ShortcutContext.Provider, { value: value, children: children });
36
+ }
37
+ /** The registry, or `null` outside a `ShortcutProvider`. */
38
+ export function useShortcutRegistry() {
39
+ return useContext(ShortcutContext)?.registry ?? null;
40
+ }
41
+ /** The platform as the keyboard layer sees it - `SERVER_ENVIRONMENT` until the client has mounted, and outside a provider. */
42
+ export function useKeyEnvironment() {
43
+ return useContext(ShortcutContext)?.env ?? SERVER_ENVIRONMENT;
44
+ }
45
+ const NO_REGISTRATIONS = [];
46
+ const getNoRegistrations = () => NO_REGISTRATIONS;
47
+ const NEVER = () => () => undefined;
48
+ /** Everything registered right now, updating as views mount and unmount - what the help dialog lists. Empty outside a provider. */
49
+ export function useRegisteredShortcuts() {
50
+ const registry = useShortcutRegistry();
51
+ return useSyncExternalStore(registry?.subscribe ?? NEVER, registry?.getSnapshot ?? getNoRegistrations, getNoRegistrations);
52
+ }
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ export interface ShortcutsDialogProps {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ }
6
+ /**
7
+ * The keyboard shortcuts help dialog: what can be done from the keyboard *here*. It lists what is registered right now (see
8
+ * `useRegisteredShortcuts()`), so it shows the global shortcuts and those of the view that is on screen - and the compose window's while one
9
+ * is open - in groups, with the platform's own key names (Ctrl or Cmd, Alt or Option), and in the desktop client also the keys only it has.
10
+ * A shortcut a view cannot do at the moment (no message selected) is not registered, and so not listed.
11
+ *
12
+ * Built on `Modal`: focus moves into the dialog and stays there, Escape closes it, and it has an accessible name. `?` and Ctrl+/ close it too.
13
+ */
14
+ export default function ShortcutsDialog({ open, onClose }: ShortcutsDialogProps): React.JSX.Element | null;
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ ///////////////////////////////////////////////////////////////////////////////
3
+ // Copyright (C) 2026 Jean-Philippe Steinmetz
4
+ // SPDX-License-Identifier: MPL-2.0
5
+ ///////////////////////////////////////////////////////////////////////////////
6
+ import React from "react";
7
+ import Modal from "@rapidmx/react-shared/components/overlays/Modal.js";
8
+ import { formatSpec, specsFor } from "./format.js";
9
+ import { HELP_SCOPES, SCOPE_LABELS, SHORTCUTS, shortcutRank } from "./keymap.js";
10
+ import { useKeyEnvironment, useRegisteredShortcuts } from "./ShortcutProvider.js";
11
+ import { useShortcut } from "./useShortcut.js";
12
+ function Keys({ shortcut }) {
13
+ const env = useKeyEnvironment();
14
+ return (_jsx("span", { className: "flex flex-wrap justify-end gap-x-1.5 gap-y-1 shrink-0", children: specsFor(shortcut, env).map((spec, index) => (_jsxs(React.Fragment, { children: [index > 0 && _jsx("span", { className: "text-xs text-text-muted self-center", children: "or" }), _jsx("kbd", { className: "px-1.5 py-0.5 rounded-sm border border-border bg-surface-alt text-xs font-sans font-semibold whitespace-nowrap", children: formatSpec(spec, env) })] }, spec))) }));
15
+ }
16
+ /**
17
+ * The keyboard shortcuts help dialog: what can be done from the keyboard *here*. It lists what is registered right now (see
18
+ * `useRegisteredShortcuts()`), so it shows the global shortcuts and those of the view that is on screen - and the compose window's while one
19
+ * is open - in groups, with the platform's own key names (Ctrl or Cmd, Alt or Option), and in the desktop client also the keys only it has.
20
+ * A shortcut a view cannot do at the moment (no message selected) is not registered, and so not listed.
21
+ *
22
+ * Built on `Modal`: focus moves into the dialog and stays there, Escape closes it, and it has an accessible name. `?` and Ctrl+/ close it too.
23
+ */
24
+ export default function ShortcutsDialog({ open, onClose }) {
25
+ // Mounted only while open: the body subscribes to the registry, which every view's shortcuts change as it mounts - not something the
26
+ // whole app should re-render for while the dialog is closed.
27
+ return open ? _jsx(ShortcutsDialogBody, { onClose: onClose }) : null;
28
+ }
29
+ function ShortcutsDialogBody({ onClose }) {
30
+ const registrations = useRegisteredShortcuts();
31
+ useShortcut(SHORTCUTS.global.help, onClose, { scope: "dialog" });
32
+ const groups = HELP_SCOPES.map((scope) => {
33
+ const listed = new Map();
34
+ for (const registration of registrations) {
35
+ if (registration.scope === scope) {
36
+ listed.set(registration.shortcut.id, registration.shortcut);
37
+ }
38
+ }
39
+ return { scope, shortcuts: [...listed.values()].sort((a, b) => shortcutRank(a) - shortcutRank(b)) };
40
+ }).filter((group) => group.shortcuts.length > 0);
41
+ return (_jsx(Modal, { open: true, onClose: onClose, title: "Keyboard shortcuts", children: _jsxs("div", { className: "flex flex-col gap-5", children: [groups.map(({ scope, shortcuts }) => (_jsxs("section", { "aria-labelledby": `shortcuts-${scope}`, children: [_jsx("h3", { id: `shortcuts-${scope}`, className: "text-xs font-bold uppercase tracking-wide text-text-muted mb-2", children: SCOPE_LABELS[scope] }), _jsx("ul", { className: "flex flex-col gap-1.5", children: shortcuts.map((shortcut) => (_jsxs("li", { className: "flex items-start justify-between gap-4 text-sm", children: [_jsx("span", { children: shortcut.label }), _jsx(Keys, { shortcut: shortcut })] }, shortcut.id))) })] }, scope))), _jsx("p", { className: "text-xs text-text-muted border-t border-border pt-3", children: "Some browsers keep a few keys for themselves, so a shortcut may not work everywhere." })] }) }));
42
+ }
@@ -0,0 +1,16 @@
1
+ import type { KeyEnvironment } from "./platform.js";
2
+ import type { ShortcutRegistry } from "./registry.js";
3
+ /**
4
+ * Handles one `keydown`: finds the registered shortcut it is, and runs its handler. Returns whether a handler ran - and only then is the
5
+ * event's default prevented and its propagation stopped, so a key nobody claims (or a handler that declines) behaves exactly as if this layer
6
+ * did not exist.
7
+ *
8
+ * Skipped outright: an event some other handler already `defaultPrevented` (a menu, the rich-text editor's own bindings), one from an IME
9
+ * composition, a bare modifier key, and the Copy/Cut/Paste/Select all/Undo/Redo/Find chords. A held key repeats: an action that is not
10
+ * marked `repeat` runs on the first press only, and the repeats are swallowed (so a browser doesn't reload on a held Ctrl+R) without running it.
11
+ *
12
+ * Which registration wins: the dialog scope alone while a modal is open; else, inside a compose window, `compose` then `global`; else
13
+ * whichever view is mounted, then `global`. Within a scope the most recently mounted registration goes first, and one that returns
14
+ * `false` passes the key on to the next.
15
+ */
16
+ export declare function dispatchKeyEvent(registry: ShortcutRegistry, event: KeyboardEvent, env: KeyEnvironment, doc: Document): boolean;
@@ -0,0 +1,109 @@
1
+ import { matchesEvent } from "./match.js";
2
+ import { resolveModifiers } from "./parse.js";
3
+ import { isActivatable, isInPopoverDialog, isInWidget, isModalOpen, isPopupOpenAt, isTextEntry, regionScopeOf } from "./targets.js";
4
+ /** The keys of the four view scopes: only the mounted view has registrations, so precedence among them is moot. */
5
+ const VIEW_SCOPES = ["mail", "calendar", "contacts", "tasks"];
6
+ /** Keys that move the caret or delete text, which a text field owns even with Ctrl or Alt held (word jumps, delete-word). */
7
+ const EDITING_KEYS = new Set(["arrowup", "arrowdown", "arrowleft", "arrowright", "home", "end", "pageup", "pagedown", "backspace", "delete"]);
8
+ /** The Copy / Cut / Paste / Select all / Undo / Redo / Find chords: never a shortcut, anywhere - they act on the page's selection, not on a view. */
9
+ function isReservedChord(parsed, env) {
10
+ const modifiers = resolveModifiers(parsed, env);
11
+ return (modifiers.ctrl || modifiers.meta) && !modifiers.alt && !modifiers.shift && ["a", "c", "v", "x", "z", "y", "f"].includes(parsed.key);
12
+ }
13
+ /** Paste as plain text (Ctrl+Shift+V) and Redo (Ctrl+Shift+Z): text-editing chords in a field, free everywhere else (Ctrl+Shift+V is Move to). */
14
+ function isShiftedEditingChord(parsed, env) {
15
+ const modifiers = resolveModifiers(parsed, env);
16
+ return (modifiers.ctrl || modifiers.meta) && !modifiers.alt && modifiers.shift && ["z", "v"].includes(parsed.key);
17
+ }
18
+ /**
19
+ * Whether `parsed` may fire with the event on this target.
20
+ *
21
+ * A text field (input, textarea, select, contenteditable - the rich-text editor) keeps everything that types or edits: bare keys
22
+ * (`j`, `?`, Delete), the caret keys with any modifier, and paste-as-plain-text and redo. A chord with Ctrl/Cmd/Alt works from one (that is how Ctrl+Enter sends from
23
+ * the body), except that Option on a Mac and Ctrl+Alt (AltGr) elsewhere type characters, so those don't. Escape works from a field unless a
24
+ * popup it owns is open (or it is in a popover dialog of its own). Outside a field, a bare key still isn't taken from a widget that reads keys itself (an open menu, a list box), and
25
+ * Enter/Space are left to the button or link that has the focus - unless the shortcut asked for them.
26
+ */
27
+ function allowedOnTarget(registration, parsed, target, env) {
28
+ const modifiers = resolveModifiers(parsed, env);
29
+ const command = modifiers.ctrl || modifiers.meta || modifiers.alt;
30
+ if (parsed.key === "escape" && (isPopupOpenAt(target) || isInPopoverDialog(target))) {
31
+ return false;
32
+ }
33
+ if (isTextEntry(target)) {
34
+ if (parsed.key === "escape") {
35
+ return true;
36
+ }
37
+ if (!command || EDITING_KEYS.has(parsed.key) || isShiftedEditingChord(parsed, env)) {
38
+ return false;
39
+ }
40
+ return !(modifiers.alt && !modifiers.meta && (env.mac || modifiers.ctrl));
41
+ }
42
+ if (!command) {
43
+ if (isInWidget(target)) {
44
+ return false;
45
+ }
46
+ if ((parsed.key === "enter" || parsed.key === " ") && !registration.shortcut.allowOnActivatable && isActivatable(target)) {
47
+ return false;
48
+ }
49
+ }
50
+ return true;
51
+ }
52
+ /** The scopes that may act on this event, highest precedence first. */
53
+ function activeScopes(event, doc) {
54
+ if (isModalOpen(doc)) {
55
+ return ["dialog"];
56
+ }
57
+ if (regionScopeOf(event.target) === "compose") {
58
+ return ["compose", "global"];
59
+ }
60
+ return [...VIEW_SCOPES, "global"];
61
+ }
62
+ /** Whether the registration applies to where the event happened (a compose window's shortcuts only inside it). */
63
+ function inContainer(registration, event) {
64
+ if (!registration.container) {
65
+ return true;
66
+ }
67
+ return !!registration.container.current?.contains(event.target);
68
+ }
69
+ /**
70
+ * Handles one `keydown`: finds the registered shortcut it is, and runs its handler. Returns whether a handler ran - and only then is the
71
+ * event's default prevented and its propagation stopped, so a key nobody claims (or a handler that declines) behaves exactly as if this layer
72
+ * did not exist.
73
+ *
74
+ * Skipped outright: an event some other handler already `defaultPrevented` (a menu, the rich-text editor's own bindings), one from an IME
75
+ * composition, a bare modifier key, and the Copy/Cut/Paste/Select all/Undo/Redo/Find chords. A held key repeats: an action that is not
76
+ * marked `repeat` runs on the first press only, and the repeats are swallowed (so a browser doesn't reload on a held Ctrl+R) without running it.
77
+ *
78
+ * Which registration wins: the dialog scope alone while a modal is open; else, inside a compose window, `compose` then `global`; else
79
+ * whichever view is mounted, then `global`. Within a scope the most recently mounted registration goes first, and one that returns
80
+ * `false` passes the key on to the next.
81
+ */
82
+ export function dispatchKeyEvent(registry, event, env, doc) {
83
+ if (event.defaultPrevented || event.isComposing || event.key === "Process" || ["Control", "Shift", "Alt", "Meta"].includes(event.key)) {
84
+ return false;
85
+ }
86
+ const scopes = activeScopes(event, doc);
87
+ const candidates = registry
88
+ .getSnapshot()
89
+ .filter((registration) => scopes.includes(registration.scope) && inContainer(registration, event))
90
+ .sort((a, b) => scopes.indexOf(a.scope) - scopes.indexOf(b.scope) || b.order - a.order);
91
+ for (const registration of candidates) {
92
+ const specs = env.electron ? [...registration.keys, ...registration.electronKeys] : registration.keys;
93
+ const parsed = specs.find((spec) => matchesEvent(spec, event, env));
94
+ if (!parsed || isReservedChord(parsed, env) || !allowedOnTarget(registration, parsed, event.target, env)) {
95
+ continue;
96
+ }
97
+ if (event.repeat && !registration.shortcut.repeat) {
98
+ event.preventDefault();
99
+ event.stopPropagation();
100
+ return true;
101
+ }
102
+ if (registration.run(event) !== false) {
103
+ event.preventDefault();
104
+ event.stopPropagation();
105
+ return true;
106
+ }
107
+ }
108
+ return false;
109
+ }
@@ -0,0 +1,12 @@
1
+ import type { ShortcutDef } from "./keymap.js";
2
+ import type { KeyEnvironment } from "./platform.js";
3
+ /** A spec as a person reads it: `Ctrl+Shift+R`, or `⌃⇧R`-style glyphs on a Mac (`⌘` for Cmd, `⌥` for Option). */
4
+ export declare function formatSpec(spec: string, env: KeyEnvironment): string;
5
+ /** A spec in `aria-keyshortcuts` syntax: `Control+Shift+R`, `Meta+R`. */
6
+ export declare function ariaSpec(spec: string, env: KeyEnvironment): string;
7
+ /** Every spec that triggers a shortcut here: its keys, and in the desktop client also its desktop-only ones. */
8
+ export declare function specsFor(shortcut: ShortcutDef, env: KeyEnvironment): string[];
9
+ /** The `aria-keyshortcuts` value for a control that runs a shortcut: every alternative, space separated. */
10
+ export declare function ariaKeyShortcuts(shortcut: ShortcutDef, env: KeyEnvironment): string;
11
+ /** A tooltip/name suffix such as `Reply (Ctrl+R)`: the label with the shortcut's first key. */
12
+ export declare function withHint(label: string, shortcut: ShortcutDef, env: KeyEnvironment): string;
@@ -0,0 +1,74 @@
1
+ import { parseSpec, resolveModifiers } from "./parse.js";
2
+ const KEY_NAMES = {
3
+ escape: "Esc",
4
+ enter: "Enter",
5
+ tab: "Tab",
6
+ backspace: "Backspace",
7
+ delete: "Delete",
8
+ insert: "Insert",
9
+ home: "Home",
10
+ end: "End",
11
+ pageup: "Page Up",
12
+ pagedown: "Page Down",
13
+ arrowup: "↑",
14
+ arrowdown: "↓",
15
+ arrowleft: "←",
16
+ arrowright: "→",
17
+ " ": "Space",
18
+ };
19
+ const MAC_KEY_NAMES = { ...KEY_NAMES, enter: "↩", backspace: "⌫", delete: "⌦" };
20
+ /** The key as it is printed on a key cap: `R`, `F5`, `Enter`, an arrow. */
21
+ function keyLabel(key, mac) {
22
+ return (mac ? MAC_KEY_NAMES : KEY_NAMES)[key] ?? key.toUpperCase();
23
+ }
24
+ /** A spec as a person reads it: `Ctrl+Shift+R`, or `⌃⇧R`-style glyphs on a Mac (`⌘` for Cmd, `⌥` for Option). */
25
+ export function formatSpec(spec, env) {
26
+ const parsed = parseSpec(spec);
27
+ const modifiers = resolveModifiers(parsed, env);
28
+ if (env.mac) {
29
+ return [modifiers.ctrl && "⌃", modifiers.alt && "⌥", modifiers.shift && "⇧", modifiers.meta && "⌘", keyLabel(parsed.key, true)]
30
+ .filter(Boolean)
31
+ .join("");
32
+ }
33
+ return [modifiers.ctrl && "Ctrl", modifiers.shift && "Shift", modifiers.alt && "Alt", modifiers.meta && "Meta", keyLabel(parsed.key, false)]
34
+ .filter(Boolean)
35
+ .join("+");
36
+ }
37
+ const ARIA_NAMED_KEYS = {
38
+ escape: "Escape",
39
+ enter: "Enter",
40
+ tab: "Tab",
41
+ backspace: "Backspace",
42
+ delete: "Delete",
43
+ insert: "Insert",
44
+ home: "Home",
45
+ end: "End",
46
+ pageup: "PageUp",
47
+ pagedown: "PageDown",
48
+ arrowup: "ArrowUp",
49
+ arrowdown: "ArrowDown",
50
+ arrowleft: "ArrowLeft",
51
+ arrowright: "ArrowRight",
52
+ " ": "Space",
53
+ };
54
+ /** A spec in `aria-keyshortcuts` syntax: `Control+Shift+R`, `Meta+R`. */
55
+ export function ariaSpec(spec, env) {
56
+ const parsed = parseSpec(spec);
57
+ const modifiers = resolveModifiers(parsed, env);
58
+ const key = ARIA_NAMED_KEYS[parsed.key] ?? parsed.key.toUpperCase();
59
+ return [modifiers.ctrl && "Control", modifiers.alt && "Alt", modifiers.shift && "Shift", modifiers.meta && "Meta", key].filter(Boolean).join("+");
60
+ }
61
+ /** Every spec that triggers a shortcut here: its keys, and in the desktop client also its desktop-only ones. */
62
+ export function specsFor(shortcut, env) {
63
+ return env.electron && shortcut.electronKeys ? [...shortcut.keys, ...shortcut.electronKeys] : [...shortcut.keys];
64
+ }
65
+ /** The `aria-keyshortcuts` value for a control that runs a shortcut: every alternative, space separated. */
66
+ export function ariaKeyShortcuts(shortcut, env) {
67
+ return specsFor(shortcut, env)
68
+ .map((spec) => ariaSpec(spec, env))
69
+ .join(" ");
70
+ }
71
+ /** A tooltip/name suffix such as `Reply (Ctrl+R)`: the label with the shortcut's first key. */
72
+ export function withHint(label, shortcut, env) {
73
+ return `${label} (${formatSpec(shortcut.keys[0], env)})`;
74
+ }
@@ -0,0 +1,294 @@
1
+ /**
2
+ * Where a shortcut applies. `global` works in every view; a view scope (`mail`, `calendar`, `contacts`, `tasks`) exists only while that
3
+ * view is mounted; `compose` applies while focus is inside a compose window; `dialog` is for what a modal dialog binds itself - a
4
+ * dialog on screen silences every other scope.
5
+ */
6
+ export type ShortcutScope = "global" | "mail" | "compose" | "calendar" | "contacts" | "tasks" | "dialog";
7
+ /** The scopes the help dialog lists, in the order it lists them. */
8
+ export declare const HELP_SCOPES: readonly ShortcutScope[];
9
+ export declare const SCOPE_LABELS: Record<ShortcutScope, string>;
10
+ /** One action the keyboard can trigger, and the keys that trigger it. Views register handlers for these; nothing else defines a key. */
11
+ export interface ShortcutDef {
12
+ /** Stable name, unique across the map - what the help dialog de-duplicates on. */
13
+ id: string;
14
+ /** Specs (see `parseSpec()`) that trigger it, the first being the one shown first. `mod` is Ctrl, or Cmd on macOS. */
15
+ keys: readonly string[];
16
+ /** Extra specs that apply only in the desktop client, where the browser's own reserved keys (Ctrl+N, Ctrl+T) are the app's. */
17
+ electronKeys?: readonly string[];
18
+ /** What the help dialog and a button's tooltip call it. */
19
+ label: string;
20
+ scope: ShortcutScope;
21
+ /** Fires from a focused button or link too (Enter on a message row); by default Enter/Space are left to what has the focus. */
22
+ allowOnActivatable?: boolean;
23
+ /** Keeps firing while the key is held (arrows); by default a held key runs a one-shot action once. */
24
+ repeat?: boolean;
25
+ }
26
+ /**
27
+ * The whole key map, in the order the help dialog lists it. The navigation set is literally Ctrl+Shift+<letter> on every platform (Cmd+Shift
28
+ * on macOS collides with the browsers' own - Cmd+Shift+A/B/C/L/M/S are tab search, the bookmarks bar, Inspect, the sidebar, the profile
29
+ * switcher and Save As - so it is not offered); the mail actions use `mod`, so Reply is Ctrl+R on Windows and Linux and Cmd+R on a Mac.
30
+ * Ctrl+Q (mark read) stays Ctrl on a Mac because Cmd+Q is the system's Quit.
31
+ */
32
+ export declare const SHORTCUTS: {
33
+ readonly global: {
34
+ readonly account: {
35
+ id: string;
36
+ keys: string[];
37
+ label: string;
38
+ scope: "global";
39
+ };
40
+ readonly settings: {
41
+ id: string;
42
+ keys: string[];
43
+ label: string;
44
+ scope: "global";
45
+ };
46
+ readonly contacts: {
47
+ id: string;
48
+ keys: string[];
49
+ label: string;
50
+ scope: "global";
51
+ };
52
+ readonly mail: {
53
+ id: string;
54
+ keys: string[];
55
+ label: string;
56
+ scope: "global";
57
+ };
58
+ readonly calendar: {
59
+ id: string;
60
+ keys: string[];
61
+ label: string;
62
+ scope: "global";
63
+ };
64
+ readonly tasks: {
65
+ id: string;
66
+ keys: string[];
67
+ electronKeys: string[];
68
+ label: string;
69
+ scope: "global";
70
+ };
71
+ readonly help: {
72
+ id: string;
73
+ keys: string[];
74
+ label: string;
75
+ scope: "global";
76
+ };
77
+ };
78
+ readonly mail: {
79
+ readonly create: {
80
+ id: string;
81
+ keys: string[];
82
+ electronKeys: string[];
83
+ label: string;
84
+ scope: "mail";
85
+ };
86
+ readonly reply: {
87
+ id: string;
88
+ keys: string[];
89
+ label: string;
90
+ scope: "mail";
91
+ };
92
+ readonly replyAll: {
93
+ id: string;
94
+ keys: string[];
95
+ label: string;
96
+ scope: "mail";
97
+ };
98
+ readonly forward: {
99
+ id: string;
100
+ keys: string[];
101
+ label: string;
102
+ scope: "mail";
103
+ };
104
+ readonly delete: {
105
+ id: string;
106
+ keys: string[];
107
+ label: string;
108
+ scope: "mail";
109
+ };
110
+ readonly archive: {
111
+ id: string;
112
+ keys: string[];
113
+ label: string;
114
+ scope: "mail";
115
+ };
116
+ readonly move: {
117
+ id: string;
118
+ keys: string[];
119
+ label: string;
120
+ scope: "mail";
121
+ };
122
+ readonly markRead: {
123
+ id: string;
124
+ keys: string[];
125
+ label: string;
126
+ scope: "mail";
127
+ };
128
+ readonly markUnread: {
129
+ id: string;
130
+ keys: string[];
131
+ label: string;
132
+ scope: "mail";
133
+ };
134
+ readonly flag: {
135
+ id: string;
136
+ keys: string[];
137
+ label: string;
138
+ scope: "mail";
139
+ };
140
+ readonly next: {
141
+ id: string;
142
+ keys: string[];
143
+ label: string;
144
+ scope: "mail";
145
+ repeat: true;
146
+ };
147
+ readonly previous: {
148
+ id: string;
149
+ keys: string[];
150
+ label: string;
151
+ scope: "mail";
152
+ repeat: true;
153
+ };
154
+ readonly nextUnread: {
155
+ id: string;
156
+ keys: string[];
157
+ label: string;
158
+ scope: "mail";
159
+ };
160
+ readonly previousUnread: {
161
+ id: string;
162
+ keys: string[];
163
+ label: string;
164
+ scope: "mail";
165
+ };
166
+ readonly open: {
167
+ id: string;
168
+ keys: string[];
169
+ label: string;
170
+ scope: "mail";
171
+ allowOnActivatable: true;
172
+ };
173
+ readonly close: {
174
+ id: string;
175
+ keys: string[];
176
+ label: string;
177
+ scope: "mail";
178
+ };
179
+ readonly search: {
180
+ id: string;
181
+ keys: string[];
182
+ label: string;
183
+ scope: "mail";
184
+ };
185
+ };
186
+ readonly compose: {
187
+ readonly create: {
188
+ id: string;
189
+ keys: string[];
190
+ electronKeys: string[];
191
+ label: string;
192
+ scope: "compose";
193
+ };
194
+ readonly send: {
195
+ id: string;
196
+ keys: string[];
197
+ label: string;
198
+ scope: "compose";
199
+ };
200
+ readonly saveDraft: {
201
+ id: string;
202
+ keys: string[];
203
+ label: string;
204
+ scope: "compose";
205
+ };
206
+ readonly close: {
207
+ id: string;
208
+ keys: string[];
209
+ label: string;
210
+ scope: "compose";
211
+ };
212
+ };
213
+ readonly calendar: {
214
+ readonly create: {
215
+ id: string;
216
+ keys: string[];
217
+ electronKeys: string[];
218
+ label: string;
219
+ scope: "calendar";
220
+ };
221
+ readonly today: {
222
+ id: string;
223
+ keys: string[];
224
+ label: string;
225
+ scope: "calendar";
226
+ };
227
+ readonly previous: {
228
+ id: string;
229
+ keys: string[];
230
+ label: string;
231
+ scope: "calendar";
232
+ repeat: true;
233
+ };
234
+ readonly next: {
235
+ id: string;
236
+ keys: string[];
237
+ label: string;
238
+ scope: "calendar";
239
+ repeat: true;
240
+ };
241
+ readonly day: {
242
+ id: string;
243
+ keys: string[];
244
+ label: string;
245
+ scope: "calendar";
246
+ };
247
+ readonly workWeek: {
248
+ id: string;
249
+ keys: string[];
250
+ label: string;
251
+ scope: "calendar";
252
+ };
253
+ readonly week: {
254
+ id: string;
255
+ keys: string[];
256
+ label: string;
257
+ scope: "calendar";
258
+ };
259
+ readonly month: {
260
+ id: string;
261
+ keys: string[];
262
+ label: string;
263
+ scope: "calendar";
264
+ };
265
+ };
266
+ readonly contacts: {
267
+ readonly create: {
268
+ id: string;
269
+ keys: string[];
270
+ electronKeys: string[];
271
+ label: string;
272
+ scope: "contacts";
273
+ };
274
+ readonly search: {
275
+ id: string;
276
+ keys: string[];
277
+ label: string;
278
+ scope: "contacts";
279
+ };
280
+ };
281
+ readonly tasks: {
282
+ readonly create: {
283
+ id: string;
284
+ keys: string[];
285
+ electronKeys: string[];
286
+ label: string;
287
+ scope: "tasks";
288
+ };
289
+ };
290
+ };
291
+ /** Every shortcut of the map flattened, in listing order. */
292
+ export declare const ALL_SHORTCUTS: readonly ShortcutDef[];
293
+ /** Where a shortcut sits in the listing, for ordering registrations that arrive in whatever order components mount. */
294
+ export declare function shortcutRank(shortcut: ShortcutDef): number;