@rapidmx/web-client 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +373 -88
- package/apps/admin/_layout.tsx +8 -2
- package/apps/admin/index.tsx +7 -1
- package/apps/admin/ingest-queue/index.tsx +2 -1
- package/apps/admin/mailboxes/[uid].tsx +23 -10
- package/apps/admin/quarantine/index.tsx +2 -1
- package/apps/admin/signing-certificates/index.tsx +343 -0
- package/apps/escrow/_layout.tsx +8 -2
- package/apps/shared/appearance/AppearanceForm.tsx +392 -0
- package/apps/shared/appearance/AppearanceHead.tsx +49 -0
- package/apps/shared/appearance/AppearanceProvider.tsx +470 -0
- package/apps/shared/appearance/ColorField.tsx +107 -0
- package/apps/shared/appearance/appearanceCache.ts +106 -0
- package/apps/shared/appearance/appearanceContext.ts +77 -0
- package/apps/shared/appearance/bootScript.ts +35 -0
- package/apps/shared/appearance/color.ts +169 -0
- package/apps/shared/appearance/photo.ts +88 -0
- package/apps/shared/appearance/resolvedTheme.ts +67 -0
- package/apps/shared/appearance/theme.ts +355 -0
- package/apps/shared/auth/accountUrl.ts +9 -0
- package/apps/shared/auth/adminAccess.ts +99 -0
- package/apps/shared/components/admin/layout/AdminShell.tsx +22 -10
- package/apps/shared/components/admin/mailboxes/ShareAccessCard.tsx +107 -60
- package/apps/shared/components/admin/settings/BrandingForm.tsx +24 -0
- package/apps/shared/components/admin/settings/DomainDnsSetup.tsx +2 -1
- package/apps/shared/components/admin/settings/PluginsManager.tsx +228 -25
- package/apps/shared/components/admin/setup/SetupWizard.tsx +2 -1
- package/apps/shared/components/calendar/CalendarListSidebar.tsx +4 -5
- package/apps/shared/components/calendar/layout/CalendarShell.tsx +8 -2
- package/apps/shared/components/contacts/ContactForm.tsx +11 -5
- package/apps/shared/components/contacts/ContactsSidebar.tsx +5 -3
- package/apps/shared/components/contacts/ContactsToolbar.tsx +98 -115
- package/apps/shared/components/contacts/layout/ContactsShell.tsx +25 -8
- package/apps/shared/components/escrow/layout/EscrowShell.tsx +13 -6
- package/apps/shared/components/layout/AppShell.tsx +477 -288
- package/apps/shared/components/layout/BrandingChrome.tsx +200 -13
- package/apps/shared/components/layout/KeyEnrollmentGate.tsx +398 -389
- package/apps/shared/components/layout/MailboxProvisioning.tsx +168 -164
- package/apps/shared/components/layout/RailIcon.tsx +100 -0
- package/apps/shared/components/layout/ResponsiveToolbar.tsx +315 -0
- package/apps/shared/components/layout/ThemeSwitch.tsx +84 -0
- package/apps/shared/components/layout/UserMenu.tsx +372 -185
- package/apps/shared/components/mail/ConversationList.tsx +271 -262
- package/apps/shared/components/mail/ConversationThreadPane.tsx +147 -94
- package/apps/shared/components/mail/LazyReadingPane.tsx +113 -0
- package/apps/shared/components/mail/MailSelectionBar.tsx +227 -222
- package/apps/shared/components/mail/MessageDetailPane.tsx +1537 -1387
- package/apps/shared/components/mail/OutboxBadge.tsx +44 -0
- package/apps/shared/components/mail/OutboxRowStatus.tsx +31 -0
- package/apps/shared/components/mail/compose/ComposeContext.tsx +312 -160
- package/apps/shared/components/mail/compose/ComposeToolbar.tsx +422 -418
- package/apps/shared/components/mail/compose/ComposeWindow.tsx +1644 -1736
- package/apps/shared/components/mail/compose/ComposeWindowPlaceholder.tsx +111 -0
- package/apps/shared/components/mail/compose/RichTextEditor.tsx +147 -118
- package/apps/shared/components/mail/compose/composePerf.ts +46 -0
- package/apps/shared/components/mail/compose/encryptionRequirement.ts +86 -0
- package/apps/shared/components/mail/compose/quotedBody.ts +161 -100
- package/apps/shared/components/mail/layout/MailShell.tsx +490 -472
- package/apps/shared/components/mail/reading/EncryptedBody.tsx +65 -0
- package/apps/shared/components/mail/reading/EncryptedPreview.tsx +35 -0
- package/apps/shared/components/mail/reading/MessageBody.tsx +240 -0
- package/apps/shared/components/mail/reading/MessageCard.tsx +174 -0
- package/apps/shared/components/mail/reading/bodyContent.ts +100 -0
- package/apps/shared/components/mail/reading/bodyHtml.ts +298 -0
- package/apps/shared/components/mail/reading/color.ts +245 -0
- package/apps/shared/components/mail/reading/frameControl.ts +142 -0
- package/apps/shared/components/mail/reading/frameDocument.ts +123 -0
- package/apps/shared/components/mail/reading/safeDocument.ts +24 -0
- package/apps/shared/components/mail/reading/themeAdaptation.ts +221 -0
- package/apps/shared/components/mail/reading/themeSurface.ts +90 -0
- package/apps/shared/components/mail/reading/viewOriginal.ts +38 -0
- package/apps/shared/components/mail/unreadStyle.tsx +75 -0
- package/apps/shared/components/settings/SigningCertificateCard.tsx +344 -0
- package/apps/shared/components/settings/layout/SettingsShell.tsx +253 -240
- package/apps/shared/components/sharing/PrincipalPicker.tsx +145 -0
- package/apps/shared/components/tasks/TasksSidebar.tsx +5 -3
- package/apps/shared/components/tasks/layout/TasksShell.tsx +24 -8
- package/apps/shared/keyboard/GlobalShortcuts.tsx +51 -0
- package/apps/shared/keyboard/ShortcutProvider.tsx +62 -0
- package/apps/shared/keyboard/ShortcutsDialog.tsx +84 -0
- package/apps/shared/keyboard/dispatch.ts +124 -0
- package/apps/shared/keyboard/format.ts +89 -0
- package/apps/shared/keyboard/keymap.ts +114 -0
- package/apps/shared/keyboard/match.ts +44 -0
- package/apps/shared/keyboard/parse.ts +136 -0
- package/apps/shared/keyboard/platform.ts +34 -0
- package/apps/shared/keyboard/registry.ts +65 -0
- package/apps/shared/keyboard/targets.ts +79 -0
- package/apps/shared/keyboard/useShortcut.ts +50 -0
- package/apps/shared/keyboard/useShortcutProps.ts +17 -0
- package/apps/shared/mail/folderCounts.ts +308 -0
- package/apps/shared/mail/folderTree.ts +143 -0
- package/apps/shared/mail/listSnapshots.ts +87 -0
- package/apps/shared/mail/messageReadState.ts +85 -0
- package/apps/shared/mail/newMailNotifications.ts +183 -0
- package/apps/shared/mail/outbox/UnlockBridge.tsx +23 -0
- package/apps/shared/mail/outbox/composeBridge.ts +69 -0
- package/apps/shared/mail/outbox/outboxState.ts +88 -0
- package/apps/shared/mail/outbox/pendingSends.ts +146 -0
- package/apps/shared/mail/outbox/sendDecision.ts +157 -0
- package/apps/shared/mail/outbox/sendJob.ts +427 -0
- package/apps/shared/mail/outbox/sendOutcomes.ts +146 -0
- package/apps/shared/mail/outbox/sendState.ts +35 -0
- package/apps/shared/mail/outbox/useOutboxStatus.ts +61 -0
- package/apps/shared/mail/useMailConnection.ts +203 -0
- package/apps/shared/mail/useMailLiveUpdates.ts +277 -224
- package/apps/shared/mail/useMarkMessageRead.ts +47 -0
- package/apps/shared/mail/useNewMailNotifications.ts +178 -0
- package/apps/shared/mail/useUnreadTitle.ts +42 -0
- package/apps/shared/navigation/AppRouter.tsx +300 -0
- package/apps/shared/navigation/appHrefs.ts +23 -0
- package/apps/shared/navigation/frameContext.tsx +35 -0
- package/apps/shared/navigation/idle.ts +45 -0
- package/apps/shared/navigation/routerContext.tsx +83 -0
- package/apps/shared/navigation/routes.ts +72 -0
- package/apps/shared/notifications/NotificationCenter.tsx +215 -0
- package/apps/shared/notifications/NotificationHistoryDialog.tsx +90 -0
- package/apps/shared/notifications/apiErrors.ts +98 -0
- package/apps/shared/notifications/headerOffset.ts +35 -0
- package/apps/shared/notifications/pushStatus.ts +56 -0
- package/apps/shared/notifications/store.ts +549 -0
- package/apps/shared/notifications/systemErrors.ts +63 -0
- package/apps/shared/notifications/useNotifications.ts +41 -0
- package/apps/shared/search/LocalIndexLifecycle.tsx +114 -98
- package/apps/shared/signing/enrollmentStorage.ts +33 -0
- package/apps/shared/signing/enrollmentTracker.ts +385 -0
- package/apps/shared/signing/enrollmentView.ts +251 -0
- package/apps/shared/signing/signingInfo.ts +58 -0
- package/apps/shared/signing/useNow.ts +19 -0
- package/apps/shared/signing/useSigningEnrollmentWatcher.ts +90 -0
- package/apps/shared/styles/app.css +108 -10
- package/apps/www/_layout.tsx +8 -2
- package/apps/www/_routedPage.tsx +24 -0
- package/apps/www/_routes.ts +36 -0
- package/apps/www/calendar/index.tsx +64 -33
- package/apps/www/contacts/[uid].tsx +109 -107
- package/apps/www/contacts/index.tsx +62 -42
- package/apps/www/index.tsx +2291 -1917
- package/apps/www/messages/[uid].tsx +108 -101
- package/apps/www/settings/appearance/index.tsx +21 -0
- package/apps/www/settings/auto-reply/index.tsx +7 -8
- package/apps/www/settings/encryption/index.tsx +1287 -1249
- package/apps/www/settings/filters/[uid].tsx +7 -2
- package/apps/www/settings/filters/index.tsx +102 -99
- package/apps/www/settings/filters/new/index.tsx +140 -133
- package/apps/www/settings/labels/index.tsx +204 -201
- package/apps/www/settings/privacy/index.tsx +7 -9
- package/apps/www/settings/read-receipts/index.tsx +7 -8
- package/apps/www/settings/sharing/index.tsx +256 -274
- package/apps/www/settings/signatures/[uid].tsx +172 -167
- package/apps/www/settings/signatures/index.tsx +88 -85
- package/apps/www/settings/signatures/new/index.tsx +135 -129
- package/apps/www/tasks/index.tsx +29 -18
- package/dist/apps/admin/_layout.d.ts +5 -1
- package/dist/apps/admin/_layout.js +3 -2
- package/dist/apps/admin/index.js +3 -2
- package/dist/apps/admin/ingest-queue/index.js +2 -1
- package/dist/apps/admin/mailboxes/[uid].js +9 -6
- package/dist/apps/admin/quarantine/index.js +2 -1
- package/dist/apps/admin/signing-certificates/index.d.ts +3 -0
- package/dist/apps/admin/signing-certificates/index.js +161 -0
- package/dist/apps/escrow/_layout.d.ts +5 -1
- package/dist/apps/escrow/_layout.js +3 -2
- package/dist/apps/shared/appearance/AppearanceForm.d.ts +7 -0
- package/dist/apps/shared/appearance/AppearanceForm.js +131 -0
- package/dist/apps/shared/appearance/AppearanceHead.d.ts +15 -0
- package/dist/apps/shared/appearance/AppearanceHead.js +31 -0
- package/dist/apps/shared/appearance/AppearanceProvider.d.ts +32 -0
- package/dist/apps/shared/appearance/AppearanceProvider.js +390 -0
- package/dist/apps/shared/appearance/ColorField.d.ts +22 -0
- package/dist/apps/shared/appearance/ColorField.js +40 -0
- package/dist/apps/shared/appearance/appearanceCache.d.ts +45 -0
- package/dist/apps/shared/appearance/appearanceCache.js +80 -0
- package/dist/apps/shared/appearance/appearanceContext.d.ts +45 -0
- package/dist/apps/shared/appearance/appearanceContext.js +29 -0
- package/dist/apps/shared/appearance/bootScript.d.ts +16 -0
- package/dist/apps/shared/appearance/bootScript.js +33 -0
- package/dist/apps/shared/appearance/color.d.ts +65 -0
- package/dist/apps/shared/appearance/color.js +132 -0
- package/dist/apps/shared/appearance/photo.d.ts +17 -0
- package/dist/apps/shared/appearance/photo.js +79 -0
- package/dist/apps/shared/appearance/resolvedTheme.d.ts +21 -0
- package/dist/apps/shared/appearance/resolvedTheme.js +55 -0
- package/dist/apps/shared/appearance/theme.d.ts +111 -0
- package/dist/apps/shared/appearance/theme.js +251 -0
- package/dist/apps/shared/auth/accountUrl.d.ts +2 -0
- package/dist/apps/shared/auth/accountUrl.js +8 -0
- package/dist/apps/shared/auth/adminAccess.d.ts +30 -0
- package/dist/apps/shared/auth/adminAccess.js +89 -0
- package/dist/apps/shared/components/admin/layout/AdminShell.d.ts +1 -1
- package/dist/apps/shared/components/admin/layout/AdminShell.js +16 -6
- package/dist/apps/shared/components/admin/mailboxes/ShareAccessCard.d.ts +10 -5
- package/dist/apps/shared/components/admin/mailboxes/ShareAccessCard.js +49 -34
- package/dist/apps/shared/components/admin/settings/BrandingForm.d.ts +2 -0
- package/dist/apps/shared/components/admin/settings/BrandingForm.js +7 -1
- package/dist/apps/shared/components/admin/settings/DomainDnsSetup.js +1 -1
- package/dist/apps/shared/components/admin/settings/PluginsManager.js +106 -20
- package/dist/apps/shared/components/admin/setup/SetupWizard.js +2 -1
- package/dist/apps/shared/components/calendar/CalendarListSidebar.js +8 -8
- package/dist/apps/shared/components/calendar/layout/CalendarShell.d.ts +1 -1
- package/dist/apps/shared/components/calendar/layout/CalendarShell.js +8 -4
- package/dist/apps/shared/components/contacts/ContactForm.js +1 -1
- package/dist/apps/shared/components/contacts/ContactsSidebar.js +4 -2
- package/dist/apps/shared/components/contacts/ContactsToolbar.d.ts +6 -2
- package/dist/apps/shared/components/contacts/ContactsToolbar.js +28 -10
- package/dist/apps/shared/components/contacts/layout/ContactsShell.d.ts +1 -1
- package/dist/apps/shared/components/contacts/layout/ContactsShell.js +19 -6
- package/dist/apps/shared/components/escrow/layout/EscrowShell.js +7 -4
- package/dist/apps/shared/components/layout/AppShell.d.ts +34 -4
- package/dist/apps/shared/components/layout/AppShell.js +122 -17
- package/dist/apps/shared/components/layout/BrandingChrome.d.ts +69 -10
- package/dist/apps/shared/components/layout/BrandingChrome.js +140 -12
- package/dist/apps/shared/components/layout/KeyEnrollmentGate.js +10 -9
- package/dist/apps/shared/components/layout/MailboxProvisioning.js +3 -1
- package/dist/apps/shared/components/layout/RailIcon.d.ts +21 -0
- package/dist/apps/shared/components/layout/RailIcon.js +85 -0
- package/dist/apps/shared/components/layout/ResponsiveToolbar.d.ts +55 -0
- package/dist/apps/shared/components/layout/ResponsiveToolbar.js +199 -0
- package/dist/apps/shared/components/layout/ThemeSwitch.d.ts +9 -0
- package/dist/apps/shared/components/layout/ThemeSwitch.js +54 -0
- package/dist/apps/shared/components/layout/UserMenu.d.ts +25 -3
- package/dist/apps/shared/components/layout/UserMenu.js +88 -7
- package/dist/apps/shared/components/mail/ConversationList.js +5 -11
- package/dist/apps/shared/components/mail/ConversationThreadPane.d.ts +6 -2
- package/dist/apps/shared/components/mail/ConversationThreadPane.js +87 -40
- package/dist/apps/shared/components/mail/LazyReadingPane.d.ts +9 -0
- package/dist/apps/shared/components/mail/LazyReadingPane.js +83 -0
- package/dist/apps/shared/components/mail/MailSelectionBar.d.ts +6 -4
- package/dist/apps/shared/components/mail/MailSelectionBar.js +11 -4
- package/dist/apps/shared/components/mail/MessageDetailPane.d.ts +25 -8
- package/dist/apps/shared/components/mail/MessageDetailPane.js +167 -73
- package/dist/apps/shared/components/mail/OutboxBadge.d.ts +17 -0
- package/dist/apps/shared/components/mail/OutboxBadge.js +18 -0
- package/dist/apps/shared/components/mail/OutboxRowStatus.d.ts +10 -0
- package/dist/apps/shared/components/mail/OutboxRowStatus.js +19 -0
- package/dist/apps/shared/components/mail/compose/ComposeContext.d.ts +38 -0
- package/dist/apps/shared/components/mail/compose/ComposeContext.js +97 -6
- package/dist/apps/shared/components/mail/compose/ComposeToolbar.js +4 -3
- package/dist/apps/shared/components/mail/compose/ComposeWindow.d.ts +3 -2
- package/dist/apps/shared/components/mail/compose/ComposeWindow.js +316 -339
- package/dist/apps/shared/components/mail/compose/ComposeWindowPlaceholder.d.ts +19 -0
- package/dist/apps/shared/components/mail/compose/ComposeWindowPlaceholder.js +33 -0
- package/dist/apps/shared/components/mail/compose/RichTextEditor.d.ts +9 -1
- package/dist/apps/shared/components/mail/compose/RichTextEditor.js +20 -2
- package/dist/apps/shared/components/mail/compose/composePerf.d.ts +16 -0
- package/dist/apps/shared/components/mail/compose/composePerf.js +41 -0
- package/dist/apps/shared/components/mail/compose/encryptionRequirement.d.ts +49 -0
- package/dist/apps/shared/components/mail/compose/encryptionRequirement.js +35 -0
- package/dist/apps/shared/components/mail/compose/quotedBody.d.ts +13 -0
- package/dist/apps/shared/components/mail/compose/quotedBody.js +67 -11
- package/dist/apps/shared/components/mail/layout/MailShell.d.ts +14 -4
- package/dist/apps/shared/components/mail/layout/MailShell.js +90 -104
- package/dist/apps/shared/components/mail/reading/EncryptedBody.d.ts +21 -0
- package/dist/apps/shared/components/mail/reading/EncryptedBody.js +22 -0
- package/dist/apps/shared/components/mail/reading/EncryptedPreview.d.ts +18 -0
- package/dist/apps/shared/components/mail/reading/EncryptedPreview.js +22 -0
- package/dist/apps/shared/components/mail/reading/MessageBody.d.ts +32 -0
- package/dist/apps/shared/components/mail/reading/MessageBody.js +136 -0
- package/dist/apps/shared/components/mail/reading/MessageCard.d.ts +62 -0
- package/dist/apps/shared/components/mail/reading/MessageCard.js +58 -0
- package/dist/apps/shared/components/mail/reading/bodyContent.d.ts +38 -0
- package/dist/apps/shared/components/mail/reading/bodyContent.js +84 -0
- package/dist/apps/shared/components/mail/reading/bodyHtml.d.ts +47 -0
- package/dist/apps/shared/components/mail/reading/bodyHtml.js +267 -0
- package/dist/apps/shared/components/mail/reading/color.d.ts +63 -0
- package/dist/apps/shared/components/mail/reading/color.js +201 -0
- package/dist/apps/shared/components/mail/reading/frameControl.d.ts +33 -0
- package/dist/apps/shared/components/mail/reading/frameControl.js +120 -0
- package/dist/apps/shared/components/mail/reading/frameDocument.d.ts +52 -0
- package/dist/apps/shared/components/mail/reading/frameDocument.js +98 -0
- package/dist/apps/shared/components/mail/reading/safeDocument.d.ts +3 -0
- package/dist/apps/shared/components/mail/reading/safeDocument.js +12 -0
- package/dist/apps/shared/components/mail/reading/themeAdaptation.d.ts +56 -0
- package/dist/apps/shared/components/mail/reading/themeAdaptation.js +144 -0
- package/dist/apps/shared/components/mail/reading/themeSurface.d.ts +17 -0
- package/dist/apps/shared/components/mail/reading/themeSurface.js +83 -0
- package/dist/apps/shared/components/mail/reading/viewOriginal.d.ts +9 -0
- package/dist/apps/shared/components/mail/reading/viewOriginal.js +32 -0
- package/dist/apps/shared/components/mail/unreadStyle.d.ts +45 -0
- package/dist/apps/shared/components/mail/unreadStyle.js +61 -0
- package/dist/apps/shared/components/settings/SigningCertificateCard.d.ts +32 -0
- package/dist/apps/shared/components/settings/SigningCertificateCard.js +98 -0
- package/dist/apps/shared/components/settings/layout/SettingsShell.d.ts +1 -1
- package/dist/apps/shared/components/settings/layout/SettingsShell.js +16 -5
- package/dist/apps/shared/components/sharing/PrincipalPicker.d.ts +26 -0
- package/dist/apps/shared/components/sharing/PrincipalPicker.js +77 -0
- package/dist/apps/shared/components/tasks/TasksSidebar.js +4 -2
- package/dist/apps/shared/components/tasks/layout/TasksShell.d.ts +1 -1
- package/dist/apps/shared/components/tasks/layout/TasksShell.js +18 -6
- package/dist/apps/shared/keyboard/GlobalShortcuts.d.ts +14 -0
- package/dist/apps/shared/keyboard/GlobalShortcuts.js +37 -0
- package/dist/apps/shared/keyboard/ShortcutProvider.d.ts +20 -0
- package/dist/apps/shared/keyboard/ShortcutProvider.js +52 -0
- package/dist/apps/shared/keyboard/ShortcutsDialog.d.ts +14 -0
- package/dist/apps/shared/keyboard/ShortcutsDialog.js +42 -0
- package/dist/apps/shared/keyboard/dispatch.d.ts +16 -0
- package/dist/apps/shared/keyboard/dispatch.js +109 -0
- package/dist/apps/shared/keyboard/format.d.ts +12 -0
- package/dist/apps/shared/keyboard/format.js +74 -0
- package/dist/apps/shared/keyboard/keymap.d.ts +294 -0
- package/dist/apps/shared/keyboard/keymap.js +84 -0
- package/dist/apps/shared/keyboard/match.d.ts +20 -0
- package/dist/apps/shared/keyboard/match.js +31 -0
- package/dist/apps/shared/keyboard/parse.d.ts +31 -0
- package/dist/apps/shared/keyboard/parse.js +107 -0
- package/dist/apps/shared/keyboard/platform.d.ts +15 -0
- package/dist/apps/shared/keyboard/platform.js +22 -0
- package/dist/apps/shared/keyboard/registry.d.ts +39 -0
- package/dist/apps/shared/keyboard/registry.js +33 -0
- package/dist/apps/shared/keyboard/targets.d.ts +14 -0
- package/dist/apps/shared/keyboard/targets.js +67 -0
- package/dist/apps/shared/keyboard/useShortcut.d.ts +19 -0
- package/dist/apps/shared/keyboard/useShortcut.js +35 -0
- package/dist/apps/shared/keyboard/useShortcutProps.d.ts +10 -0
- package/dist/apps/shared/keyboard/useShortcutProps.js +15 -0
- package/dist/apps/shared/mail/folderCounts.d.ts +78 -0
- package/dist/apps/shared/mail/folderCounts.js +218 -0
- package/dist/apps/shared/mail/folderTree.d.ts +55 -0
- package/dist/apps/shared/mail/folderTree.js +116 -0
- package/dist/apps/shared/mail/listSnapshots.d.ts +46 -0
- package/dist/apps/shared/mail/listSnapshots.js +43 -0
- package/dist/apps/shared/mail/messageReadState.d.ts +32 -0
- package/dist/apps/shared/mail/messageReadState.js +63 -0
- package/dist/apps/shared/mail/newMailNotifications.d.ts +62 -0
- package/dist/apps/shared/mail/newMailNotifications.js +138 -0
- package/dist/apps/shared/mail/outbox/UnlockBridge.d.ts +5 -0
- package/dist/apps/shared/mail/outbox/UnlockBridge.js +18 -0
- package/dist/apps/shared/mail/outbox/composeBridge.d.ts +34 -0
- package/dist/apps/shared/mail/outbox/composeBridge.js +32 -0
- package/dist/apps/shared/mail/outbox/outboxState.d.ts +41 -0
- package/dist/apps/shared/mail/outbox/outboxState.js +42 -0
- package/dist/apps/shared/mail/outbox/pendingSends.d.ts +39 -0
- package/dist/apps/shared/mail/outbox/pendingSends.js +109 -0
- package/dist/apps/shared/mail/outbox/sendDecision.d.ts +80 -0
- package/dist/apps/shared/mail/outbox/sendDecision.js +94 -0
- package/dist/apps/shared/mail/outbox/sendJob.d.ts +68 -0
- package/dist/apps/shared/mail/outbox/sendJob.js +319 -0
- package/dist/apps/shared/mail/outbox/sendOutcomes.d.ts +3 -0
- package/dist/apps/shared/mail/outbox/sendOutcomes.js +141 -0
- package/dist/apps/shared/mail/outbox/sendState.d.ts +25 -0
- package/dist/apps/shared/mail/outbox/sendState.js +8 -0
- package/dist/apps/shared/mail/outbox/useOutboxStatus.d.ts +11 -0
- package/dist/apps/shared/mail/outbox/useOutboxStatus.js +49 -0
- package/dist/apps/shared/mail/useMailConnection.d.ts +56 -0
- package/dist/apps/shared/mail/useMailConnection.js +138 -0
- package/dist/apps/shared/mail/useMailLiveUpdates.d.ts +29 -9
- package/dist/apps/shared/mail/useMailLiveUpdates.js +60 -32
- package/dist/apps/shared/mail/useMarkMessageRead.d.ts +12 -0
- package/dist/apps/shared/mail/useMarkMessageRead.js +44 -0
- package/dist/apps/shared/mail/useNewMailNotifications.d.ts +35 -0
- package/dist/apps/shared/mail/useNewMailNotifications.js +130 -0
- package/dist/apps/shared/mail/useUnreadTitle.d.ts +18 -0
- package/dist/apps/shared/mail/useUnreadTitle.js +31 -0
- package/dist/apps/shared/navigation/AppRouter.d.ts +52 -0
- package/dist/apps/shared/navigation/AppRouter.js +242 -0
- package/dist/apps/shared/navigation/appHrefs.d.ts +14 -0
- package/dist/apps/shared/navigation/appHrefs.js +20 -0
- package/dist/apps/shared/navigation/frameContext.d.ts +19 -0
- package/dist/apps/shared/navigation/frameContext.js +24 -0
- package/dist/apps/shared/navigation/idle.d.ts +14 -0
- package/dist/apps/shared/navigation/idle.js +43 -0
- package/dist/apps/shared/navigation/routerContext.d.ts +37 -0
- package/dist/apps/shared/navigation/routerContext.js +56 -0
- package/dist/apps/shared/navigation/routes.d.ts +32 -0
- package/dist/apps/shared/navigation/routes.js +37 -0
- package/dist/apps/shared/notifications/NotificationCenter.d.ts +19 -0
- package/dist/apps/shared/notifications/NotificationCenter.js +90 -0
- package/dist/apps/shared/notifications/NotificationHistoryDialog.d.ts +10 -0
- package/dist/apps/shared/notifications/NotificationHistoryDialog.js +36 -0
- package/dist/apps/shared/notifications/apiErrors.d.ts +19 -0
- package/dist/apps/shared/notifications/apiErrors.js +86 -0
- package/dist/apps/shared/notifications/headerOffset.d.ts +8 -0
- package/dist/apps/shared/notifications/headerOffset.js +33 -0
- package/dist/apps/shared/notifications/pushStatus.d.ts +9 -0
- package/dist/apps/shared/notifications/pushStatus.js +54 -0
- package/dist/apps/shared/notifications/store.d.ts +136 -0
- package/dist/apps/shared/notifications/store.js +416 -0
- package/dist/apps/shared/notifications/systemErrors.d.ts +9 -0
- package/dist/apps/shared/notifications/systemErrors.js +58 -0
- package/dist/apps/shared/notifications/useNotifications.d.ts +17 -0
- package/dist/apps/shared/notifications/useNotifications.js +18 -0
- package/dist/apps/shared/search/LocalIndexLifecycle.js +17 -3
- package/dist/apps/shared/signing/enrollmentStorage.d.ts +10 -0
- package/dist/apps/shared/signing/enrollmentStorage.js +33 -0
- package/dist/apps/shared/signing/enrollmentTracker.d.ts +73 -0
- package/dist/apps/shared/signing/enrollmentTracker.js +307 -0
- package/dist/apps/shared/signing/enrollmentView.d.ts +57 -0
- package/dist/apps/shared/signing/enrollmentView.js +214 -0
- package/dist/apps/shared/signing/signingInfo.d.ts +11 -0
- package/dist/apps/shared/signing/signingInfo.js +48 -0
- package/dist/apps/shared/signing/useNow.d.ts +2 -0
- package/dist/apps/shared/signing/useNow.js +18 -0
- package/dist/apps/shared/signing/useSigningEnrollmentWatcher.d.ts +16 -0
- package/dist/apps/shared/signing/useSigningEnrollmentWatcher.js +87 -0
- package/dist/apps/shared/styles/app.css +108 -10
- package/dist/apps/www/_layout.d.ts +5 -1
- package/dist/apps/www/_layout.js +3 -2
- package/dist/apps/www/_routedPage.d.ts +12 -0
- package/dist/apps/www/_routedPage.js +19 -0
- package/dist/apps/www/_routes.d.ts +11 -0
- package/dist/apps/www/_routes.js +30 -0
- package/dist/apps/www/calendar/index.d.ts +2 -2
- package/dist/apps/www/calendar/index.js +41 -11
- package/dist/apps/www/contacts/[uid].d.ts +3 -9
- package/dist/apps/www/contacts/[uid].js +11 -9
- package/dist/apps/www/contacts/index.d.ts +2 -2
- package/dist/apps/www/contacts/index.js +30 -24
- package/dist/apps/www/index.d.ts +2 -2
- package/dist/apps/www/index.js +332 -48
- package/dist/apps/www/messages/[uid].d.ts +3 -7
- package/dist/apps/www/messages/[uid].js +10 -5
- package/dist/apps/www/settings/appearance/index.d.ts +4 -0
- package/dist/apps/www/settings/appearance/index.js +13 -0
- package/dist/apps/www/settings/auto-reply/index.d.ts +2 -2
- package/dist/apps/www/settings/auto-reply/index.js +6 -7
- package/dist/apps/www/settings/encryption/index.d.ts +2 -2
- package/dist/apps/www/settings/encryption/index.js +106 -96
- package/dist/apps/www/settings/filters/[uid].d.ts +2 -2
- package/dist/apps/www/settings/filters/[uid].js +6 -2
- package/dist/apps/www/settings/filters/index.d.ts +2 -2
- package/dist/apps/www/settings/filters/index.js +3 -1
- package/dist/apps/www/settings/filters/new/index.d.ts +2 -2
- package/dist/apps/www/settings/filters/new/index.js +9 -3
- package/dist/apps/www/settings/labels/index.d.ts +2 -2
- package/dist/apps/www/settings/labels/index.js +3 -1
- package/dist/apps/www/settings/privacy/index.d.ts +2 -2
- package/dist/apps/www/settings/privacy/index.js +8 -9
- package/dist/apps/www/settings/read-receipts/index.d.ts +2 -2
- package/dist/apps/www/settings/read-receipts/index.js +6 -7
- package/dist/apps/www/settings/sharing/index.d.ts +2 -2
- package/dist/apps/www/settings/sharing/index.js +22 -34
- package/dist/apps/www/settings/signatures/[uid].d.ts +2 -2
- package/dist/apps/www/settings/signatures/[uid].js +6 -2
- package/dist/apps/www/settings/signatures/index.d.ts +2 -2
- package/dist/apps/www/settings/signatures/index.js +3 -1
- package/dist/apps/www/settings/signatures/new/index.d.ts +2 -2
- package/dist/apps/www/settings/signatures/new/index.js +9 -4
- package/dist/apps/www/tasks/index.d.ts +2 -2
- package/dist/apps/www/tasks/index.js +22 -16
- package/package.json +2 -2
- package/apps/shared/components/mail/compose/SendFailureAlert.tsx +0 -48
- package/dist/apps/shared/components/mail/compose/SendFailureAlert.d.ts +0 -14
- package/dist/apps/shared/components/mail/compose/SendFailureAlert.js +0 -11
|
@@ -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;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2026 Jean-Philippe Steinmetz
|
|
3
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
5
|
+
/** The scopes the help dialog lists, in the order it lists them. */
|
|
6
|
+
export const HELP_SCOPES = ["global", "mail", "compose", "calendar", "contacts", "tasks"];
|
|
7
|
+
export const SCOPE_LABELS = {
|
|
8
|
+
global: "Global",
|
|
9
|
+
mail: "Mail",
|
|
10
|
+
compose: "Compose",
|
|
11
|
+
calendar: "Calendar",
|
|
12
|
+
contacts: "Contacts",
|
|
13
|
+
tasks: "Tasks",
|
|
14
|
+
dialog: "Dialog",
|
|
15
|
+
};
|
|
16
|
+
function def(shortcut) {
|
|
17
|
+
return shortcut;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 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
|
|
21
|
+
* 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
|
|
22
|
+
* 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.
|
|
23
|
+
* Ctrl+Q (mark read) stays Ctrl on a Mac because Cmd+Q is the system's Quit.
|
|
24
|
+
*/
|
|
25
|
+
export const SHORTCUTS = {
|
|
26
|
+
global: {
|
|
27
|
+
account: def({ id: "go.account", keys: ["ctrl+shift+a"], label: "Go to Account", scope: "global" }),
|
|
28
|
+
settings: def({ id: "go.settings", keys: ["ctrl+shift+s"], label: "Go to Settings", scope: "global" }),
|
|
29
|
+
contacts: def({ id: "go.contacts", keys: ["ctrl+shift+b"], label: "Go to Contacts", scope: "global" }),
|
|
30
|
+
mail: def({ id: "go.mail", keys: ["ctrl+shift+m"], label: "Go to Mail", scope: "global" }),
|
|
31
|
+
calendar: def({ id: "go.calendar", keys: ["ctrl+shift+c"], label: "Go to Calendar", scope: "global" }),
|
|
32
|
+
tasks: def({ id: "go.tasks", keys: ["ctrl+shift+l"], electronKeys: ["ctrl+shift+t"], label: "Go to Tasks", scope: "global" }),
|
|
33
|
+
help: def({ id: "help", keys: ["?", "ctrl+/"], label: "Keyboard shortcuts", scope: "global" }),
|
|
34
|
+
},
|
|
35
|
+
mail: {
|
|
36
|
+
create: def({ id: "mail.new", keys: ["alt+n"], electronKeys: ["mod+n"], label: "New message", scope: "mail" }),
|
|
37
|
+
reply: def({ id: "mail.reply", keys: ["mod+r"], label: "Reply", scope: "mail" }),
|
|
38
|
+
replyAll: def({ id: "mail.replyAll", keys: ["mod+shift+r"], label: "Reply all", scope: "mail" }),
|
|
39
|
+
forward: def({ id: "mail.forward", keys: ["mod+shift+f"], label: "Forward", scope: "mail" }),
|
|
40
|
+
delete: def({ id: "mail.delete", keys: ["mod+d", "delete"], label: "Delete", scope: "mail" }),
|
|
41
|
+
archive: def({ id: "mail.archive", keys: ["e", "backspace"], label: "Archive", scope: "mail" }),
|
|
42
|
+
move: def({ id: "mail.move", keys: ["mod+shift+v"], label: "Move to folder", scope: "mail" }),
|
|
43
|
+
markRead: def({ id: "mail.markRead", keys: ["ctrl+q"], label: "Mark as read", scope: "mail" }),
|
|
44
|
+
markUnread: def({ id: "mail.markUnread", keys: ["mod+u"], label: "Mark as unread", scope: "mail" }),
|
|
45
|
+
flag: def({ id: "mail.flag", keys: ["insert"], label: "Flag or unflag", scope: "mail" }),
|
|
46
|
+
next: def({ id: "mail.next", keys: ["arrowdown", "j"], label: "Next message", scope: "mail", repeat: true }),
|
|
47
|
+
previous: def({ id: "mail.previous", keys: ["arrowup", "k"], label: "Previous message", scope: "mail", repeat: true }),
|
|
48
|
+
nextUnread: def({ id: "mail.nextUnread", keys: ["ctrl+."], label: "Next unread message", scope: "mail" }),
|
|
49
|
+
previousUnread: def({ id: "mail.previousUnread", keys: ["ctrl+,"], label: "Previous unread message", scope: "mail" }),
|
|
50
|
+
open: def({ id: "mail.open", keys: ["enter"], label: "Open the message on its own page", scope: "mail", allowOnActivatable: true }),
|
|
51
|
+
close: def({ id: "mail.close", keys: ["escape"], label: "Clear the selection", scope: "mail" }),
|
|
52
|
+
search: def({ id: "mail.search", keys: ["/", "mod+e"], label: "Search mail", scope: "mail" }),
|
|
53
|
+
},
|
|
54
|
+
compose: {
|
|
55
|
+
create: def({ id: "compose.new", keys: ["alt+n"], electronKeys: ["mod+n"], label: "New message", scope: "compose" }),
|
|
56
|
+
send: def({ id: "compose.send", keys: ["mod+enter"], label: "Send", scope: "compose" }),
|
|
57
|
+
saveDraft: def({ id: "compose.saveDraft", keys: ["mod+s"], label: "Save draft", scope: "compose" }),
|
|
58
|
+
close: def({ id: "compose.close", keys: ["escape"], label: "Close (keeps the draft)", scope: "compose" }),
|
|
59
|
+
},
|
|
60
|
+
calendar: {
|
|
61
|
+
create: def({ id: "calendar.new", keys: ["alt+n"], electronKeys: ["mod+n"], label: "New event", scope: "calendar" }),
|
|
62
|
+
today: def({ id: "calendar.today", keys: ["t"], label: "Go to today", scope: "calendar" }),
|
|
63
|
+
previous: def({ id: "calendar.previous", keys: ["arrowleft", "mod+arrowleft"], label: "Previous period", scope: "calendar", repeat: true }),
|
|
64
|
+
next: def({ id: "calendar.next", keys: ["arrowright", "mod+arrowright"], label: "Next period", scope: "calendar", repeat: true }),
|
|
65
|
+
day: def({ id: "calendar.day", keys: ["ctrl+alt+1"], label: "Day view", scope: "calendar" }),
|
|
66
|
+
workWeek: def({ id: "calendar.workWeek", keys: ["ctrl+alt+2"], label: "Work week view", scope: "calendar" }),
|
|
67
|
+
week: def({ id: "calendar.week", keys: ["ctrl+alt+3"], label: "Week view", scope: "calendar" }),
|
|
68
|
+
month: def({ id: "calendar.month", keys: ["ctrl+alt+4"], label: "Month view", scope: "calendar" }),
|
|
69
|
+
},
|
|
70
|
+
contacts: {
|
|
71
|
+
create: def({ id: "contacts.new", keys: ["alt+n"], electronKeys: ["mod+n"], label: "New contact", scope: "contacts" }),
|
|
72
|
+
search: def({ id: "contacts.search", keys: ["/", "mod+e"], label: "Search contacts", scope: "contacts" }),
|
|
73
|
+
},
|
|
74
|
+
tasks: {
|
|
75
|
+
create: def({ id: "tasks.new", keys: ["alt+n"], electronKeys: ["mod+n"], label: "New task", scope: "tasks" }),
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
/** Every shortcut of the map flattened, in listing order. */
|
|
79
|
+
export const ALL_SHORTCUTS = Object.values(SHORTCUTS).flatMap((group) => Object.values(group));
|
|
80
|
+
/** Where a shortcut sits in the listing, for ordering registrations that arrive in whatever order components mount. */
|
|
81
|
+
export function shortcutRank(shortcut) {
|
|
82
|
+
const index = ALL_SHORTCUTS.findIndex((candidate) => candidate.id === shortcut.id);
|
|
83
|
+
return index === -1 ? ALL_SHORTCUTS.length : index;
|
|
84
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ParsedSpec } from "./parse.js";
|
|
2
|
+
import type { KeyEnvironment } from "./platform.js";
|
|
3
|
+
/** The part of a `KeyboardEvent` matching reads. */
|
|
4
|
+
export interface KeyEventLike {
|
|
5
|
+
key: string;
|
|
6
|
+
code?: string;
|
|
7
|
+
ctrlKey: boolean;
|
|
8
|
+
shiftKey: boolean;
|
|
9
|
+
altKey: boolean;
|
|
10
|
+
metaKey: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Whether a key event is the shortcut `parsed`, on `env`.
|
|
14
|
+
*
|
|
15
|
+
* The key is matched on `event.key` (case-insensitively), so a shortcut means the letter on the key cap on any layout that has it -
|
|
16
|
+
* Dvorak, AZERTY - and falls back to `event.code` only when `event.key` is not a Latin character at all: macOS Option+N produces a
|
|
17
|
+
* dead key or `~`-like symbol, and a Cyrillic or Greek layout produces `ф`/`α` for the key that is A on a QWERTY board. Modifiers must
|
|
18
|
+
* match exactly (Ctrl+Shift+R is not Ctrl+R), except Shift for a printable symbol, which some layouts need to type it (`?`).
|
|
19
|
+
*/
|
|
20
|
+
export declare function matchesEvent(parsed: ParsedSpec, event: KeyEventLike, env: KeyEnvironment): boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2026 Jean-Philippe Steinmetz
|
|
3
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
5
|
+
import { isSymbolKey, resolveModifiers } from "./parse.js";
|
|
6
|
+
/** Whether `key` is what a Latin layout produces for a printable key: then `event.key` says which key it is, whatever `event.code` is. */
|
|
7
|
+
function isAsciiKey(key) {
|
|
8
|
+
return /^[\x21-\x7e]$/.test(key);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Whether a key event is the shortcut `parsed`, on `env`.
|
|
12
|
+
*
|
|
13
|
+
* The key is matched on `event.key` (case-insensitively), so a shortcut means the letter on the key cap on any layout that has it -
|
|
14
|
+
* Dvorak, AZERTY - and falls back to `event.code` only when `event.key` is not a Latin character at all: macOS Option+N produces a
|
|
15
|
+
* dead key or `~`-like symbol, and a Cyrillic or Greek layout produces `ф`/`α` for the key that is A on a QWERTY board. Modifiers must
|
|
16
|
+
* match exactly (Ctrl+Shift+R is not Ctrl+R), except Shift for a printable symbol, which some layouts need to type it (`?`).
|
|
17
|
+
*/
|
|
18
|
+
export function matchesEvent(parsed, event, env) {
|
|
19
|
+
const modifiers = resolveModifiers(parsed, env);
|
|
20
|
+
if (event.ctrlKey !== modifiers.ctrl || event.altKey !== modifiers.alt || event.metaKey !== modifiers.meta) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
if (event.shiftKey !== modifiers.shift && !(isSymbolKey(parsed.key) && !parsed.shift)) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const key = (event.key ?? "").toLowerCase();
|
|
27
|
+
if (key === parsed.key) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
return !!parsed.code && event.code === parsed.code && !isAsciiKey(key);
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { KeyEnvironment } from "./platform.js";
|
|
2
|
+
/** A shortcut such as `ctrl+shift+a`, `alt+n`, `Delete` or `?`, broken into what a key event is compared with. */
|
|
3
|
+
export interface ParsedSpec {
|
|
4
|
+
/** The spec as written. */
|
|
5
|
+
spec: string;
|
|
6
|
+
/** The key, lower-case: a letter or digit, a symbol (`?`, `/`, `.`, `,`), or a named key (`enter`, `delete`, `arrowup`, ...). */
|
|
7
|
+
key: string;
|
|
8
|
+
ctrl: boolean;
|
|
9
|
+
shift: boolean;
|
|
10
|
+
alt: boolean;
|
|
11
|
+
meta: boolean;
|
|
12
|
+
/** Ctrl on Windows and Linux, Cmd on macOS - resolved against the environment by `resolveModifiers()`. */
|
|
13
|
+
mod: boolean;
|
|
14
|
+
/** The `KeyboardEvent.code` of the key on a QWERTY keyboard, for layouts where `event.key` is not the letter (see `match.ts`). */
|
|
15
|
+
code?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Parses a shortcut spec: modifiers and one key joined by `+`, in any order and any case - `ctrl+shift+a`, `Alt+N`, `mod+enter`,
|
|
19
|
+
* `Delete`, `?`, `ctrl+/`, `ctrl++`. `mod` is Ctrl on Windows/Linux and Cmd on macOS. Throws on a spec that cannot be understood, so a
|
|
20
|
+
* typo in a key map fails at once rather than silently never matching.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseSpec(spec: string): ParsedSpec;
|
|
23
|
+
/** The modifiers a spec needs on a given platform, with `mod` turned into Cmd (macOS) or Ctrl. */
|
|
24
|
+
export declare function resolveModifiers(parsed: ParsedSpec, env: KeyEnvironment): {
|
|
25
|
+
ctrl: boolean;
|
|
26
|
+
shift: boolean;
|
|
27
|
+
alt: boolean;
|
|
28
|
+
meta: boolean;
|
|
29
|
+
};
|
|
30
|
+
/** Whether the key is a printable symbol whose shifted-ness depends on the layout (`?` is Shift+/ on a US keyboard, not on others). */
|
|
31
|
+
export declare function isSymbolKey(key: string): boolean;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
const MODIFIERS = {
|
|
2
|
+
ctrl: "ctrl",
|
|
3
|
+
control: "ctrl",
|
|
4
|
+
shift: "shift",
|
|
5
|
+
alt: "alt",
|
|
6
|
+
option: "alt",
|
|
7
|
+
opt: "alt",
|
|
8
|
+
meta: "meta",
|
|
9
|
+
cmd: "meta",
|
|
10
|
+
command: "meta",
|
|
11
|
+
mod: "mod",
|
|
12
|
+
};
|
|
13
|
+
/** Spec spellings of keys whose `event.key` is something else. */
|
|
14
|
+
const KEY_ALIASES = {
|
|
15
|
+
esc: "escape",
|
|
16
|
+
del: "delete",
|
|
17
|
+
ins: "insert",
|
|
18
|
+
return: "enter",
|
|
19
|
+
up: "arrowup",
|
|
20
|
+
down: "arrowdown",
|
|
21
|
+
left: "arrowleft",
|
|
22
|
+
right: "arrowright",
|
|
23
|
+
space: " ",
|
|
24
|
+
spacebar: " ",
|
|
25
|
+
plus: "+",
|
|
26
|
+
pgup: "pageup",
|
|
27
|
+
pgdn: "pagedown",
|
|
28
|
+
};
|
|
29
|
+
/** The named keys a spec may use besides a single character and `F1`-`F12`. */
|
|
30
|
+
const NAMED_KEYS = new Set([
|
|
31
|
+
"escape",
|
|
32
|
+
"enter",
|
|
33
|
+
"tab",
|
|
34
|
+
"backspace",
|
|
35
|
+
"delete",
|
|
36
|
+
"insert",
|
|
37
|
+
"home",
|
|
38
|
+
"end",
|
|
39
|
+
"pageup",
|
|
40
|
+
"pagedown",
|
|
41
|
+
"arrowup",
|
|
42
|
+
"arrowdown",
|
|
43
|
+
"arrowleft",
|
|
44
|
+
"arrowright",
|
|
45
|
+
]);
|
|
46
|
+
const SYMBOL_CODES = { "/": "Slash", ".": "Period", ",": "Comma" };
|
|
47
|
+
/** The `code` a key has on a QWERTY keyboard, for the keys where one is worth falling back to. */
|
|
48
|
+
function codeFor(key) {
|
|
49
|
+
if (/^[a-z]$/.test(key)) {
|
|
50
|
+
return `Key${key.toUpperCase()}`;
|
|
51
|
+
}
|
|
52
|
+
if (/^[0-9]$/.test(key)) {
|
|
53
|
+
return `Digit${key}`;
|
|
54
|
+
}
|
|
55
|
+
return SYMBOL_CODES[key];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Parses a shortcut spec: modifiers and one key joined by `+`, in any order and any case - `ctrl+shift+a`, `Alt+N`, `mod+enter`,
|
|
59
|
+
* `Delete`, `?`, `ctrl+/`, `ctrl++`. `mod` is Ctrl on Windows/Linux and Cmd on macOS. Throws on a spec that cannot be understood, so a
|
|
60
|
+
* typo in a key map fails at once rather than silently never matching.
|
|
61
|
+
*/
|
|
62
|
+
export function parseSpec(spec) {
|
|
63
|
+
// A trailing `+` is the plus key itself (`ctrl++`), which a plain split would lose.
|
|
64
|
+
const plusKey = spec.length > 1 && spec.endsWith("++");
|
|
65
|
+
const tokens = (plusKey ? spec.slice(0, -2) : spec).split("+").map((token) => token.trim());
|
|
66
|
+
if (plusKey) {
|
|
67
|
+
tokens.push("+");
|
|
68
|
+
}
|
|
69
|
+
const parsed = { spec, key: "", ctrl: false, shift: false, alt: false, meta: false, mod: false };
|
|
70
|
+
for (const token of tokens) {
|
|
71
|
+
if (token === "") {
|
|
72
|
+
throw new Error(`Invalid shortcut "${spec}": empty part.`);
|
|
73
|
+
}
|
|
74
|
+
const lower = token.toLowerCase();
|
|
75
|
+
const modifier = MODIFIERS[lower];
|
|
76
|
+
if (modifier) {
|
|
77
|
+
parsed[modifier] = true;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (parsed.key !== "") {
|
|
81
|
+
throw new Error(`Invalid shortcut "${spec}": more than one key.`);
|
|
82
|
+
}
|
|
83
|
+
const key = KEY_ALIASES[lower] ?? lower;
|
|
84
|
+
if ([...key].length > 1 && !NAMED_KEYS.has(key) && !/^f([1-9]|1[0-2])$/.test(key)) {
|
|
85
|
+
throw new Error(`Invalid shortcut "${spec}": unknown key "${token}".`);
|
|
86
|
+
}
|
|
87
|
+
parsed.key = key;
|
|
88
|
+
parsed.code = codeFor(key);
|
|
89
|
+
}
|
|
90
|
+
if (parsed.key === "") {
|
|
91
|
+
throw new Error(`Invalid shortcut "${spec}": no key.`);
|
|
92
|
+
}
|
|
93
|
+
return parsed;
|
|
94
|
+
}
|
|
95
|
+
/** The modifiers a spec needs on a given platform, with `mod` turned into Cmd (macOS) or Ctrl. */
|
|
96
|
+
export function resolveModifiers(parsed, env) {
|
|
97
|
+
return {
|
|
98
|
+
ctrl: parsed.ctrl || (parsed.mod && !env.mac),
|
|
99
|
+
shift: parsed.shift,
|
|
100
|
+
alt: parsed.alt,
|
|
101
|
+
meta: parsed.meta || (parsed.mod && env.mac),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/** Whether the key is a printable symbol whose shifted-ness depends on the layout (`?` is Shift+/ on a US keyboard, not on others). */
|
|
105
|
+
export function isSymbolKey(key) {
|
|
106
|
+
return [...key].length === 1 && !/[a-z0-9]/.test(key);
|
|
107
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** What the keyboard layer needs to know about where it runs. */
|
|
2
|
+
export interface KeyEnvironment {
|
|
3
|
+
/** macOS (and iOS/iPadOS): `mod` is Cmd there, and Option is a text-entry modifier. */
|
|
4
|
+
mac: boolean;
|
|
5
|
+
/** The desktop client (`electron-client`), which exposes `window.rapidmx` from its preload script. */
|
|
6
|
+
electron: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** What the server render and the first client render use, so the two agree; the real environment is read after mount. */
|
|
9
|
+
export declare const SERVER_ENVIRONMENT: KeyEnvironment;
|
|
10
|
+
/** Whether this is an Apple platform. Prefers `navigator.userAgentData` (Chromium), then the older `navigator.platform`. */
|
|
11
|
+
export declare function isMacPlatform(): boolean;
|
|
12
|
+
/** Whether the page is running inside the desktop client, which is what `window.rapidmx` (its preload's `contextBridge`) tells. */
|
|
13
|
+
export declare function isElectronClient(): boolean;
|
|
14
|
+
/** The environment as it is right now. Only meaningful in a browser: on the server it is `SERVER_ENVIRONMENT`. */
|
|
15
|
+
export declare function currentEnvironment(): KeyEnvironment;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2026 Jean-Philippe Steinmetz
|
|
3
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
5
|
+
/** What the server render and the first client render use, so the two agree; the real environment is read after mount. */
|
|
6
|
+
export const SERVER_ENVIRONMENT = { mac: false, electron: false };
|
|
7
|
+
/** Whether this is an Apple platform. Prefers `navigator.userAgentData` (Chromium), then the older `navigator.platform`. */
|
|
8
|
+
export function isMacPlatform() {
|
|
9
|
+
if (typeof navigator === "undefined") {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
const uaData = navigator.userAgentData;
|
|
13
|
+
return /mac|iphone|ipad|ipod/i.test(uaData?.platform || navigator.platform || "");
|
|
14
|
+
}
|
|
15
|
+
/** Whether the page is running inside the desktop client, which is what `window.rapidmx` (its preload's `contextBridge`) tells. */
|
|
16
|
+
export function isElectronClient() {
|
|
17
|
+
return typeof window !== "undefined" && window.rapidmx !== undefined;
|
|
18
|
+
}
|
|
19
|
+
/** The environment as it is right now. Only meaningful in a browser: on the server it is `SERVER_ENVIRONMENT`. */
|
|
20
|
+
export function currentEnvironment() {
|
|
21
|
+
return { mac: isMacPlatform(), electron: isElectronClient() };
|
|
22
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import type { ShortcutDef, ShortcutScope } from "./keymap.js";
|
|
3
|
+
import { ParsedSpec } from "./parse.js";
|
|
4
|
+
/**
|
|
5
|
+
* What a handler does with its key. Returning `false` says it did not handle it (nothing selected, a button that is disabled right now)
|
|
6
|
+
* - the key is then left alone, and a handler of a lower scope may take it. Anything else means it did, and the key is consumed.
|
|
7
|
+
*/
|
|
8
|
+
export type ShortcutHandler = (event: KeyboardEvent) => boolean | void;
|
|
9
|
+
/** One mounted view's claim on a shortcut. */
|
|
10
|
+
export interface Registration {
|
|
11
|
+
/** Unique per registration. */
|
|
12
|
+
id: number;
|
|
13
|
+
shortcut: ShortcutDef;
|
|
14
|
+
scope: ShortcutScope;
|
|
15
|
+
/** Called at event time; reads whatever the component holds now. */
|
|
16
|
+
run: ShortcutHandler;
|
|
17
|
+
/** Applies only to events whose target is inside this element (a compose window). */
|
|
18
|
+
container?: RefObject<Element | null>;
|
|
19
|
+
keys: ParsedSpec[];
|
|
20
|
+
electronKeys: ParsedSpec[];
|
|
21
|
+
/** Later registrations win over earlier ones in the same scope. */
|
|
22
|
+
order: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The shortcuts that are mounted right now. Components add and remove their claims as they mount and unmount, so a page switch changes
|
|
26
|
+
* what a key does with nothing to re-wire; the dispatcher (`dispatchKeyEvent()`) looks handlers up here at the time of the key press,
|
|
27
|
+
* and the help dialog lists what is here.
|
|
28
|
+
*/
|
|
29
|
+
export declare class ShortcutRegistry {
|
|
30
|
+
private registrations;
|
|
31
|
+
private counter;
|
|
32
|
+
private listeners;
|
|
33
|
+
/** Adds a claim; returns what removes it. */
|
|
34
|
+
add(claim: Omit<Registration, "id" | "order">): () => void;
|
|
35
|
+
/** The current claims, oldest first. A new array whenever they change (so it can be a `useSyncExternalStore()` snapshot). */
|
|
36
|
+
getSnapshot: () => readonly Registration[];
|
|
37
|
+
subscribe: (listener: () => void) => (() => void);
|
|
38
|
+
private publish;
|
|
39
|
+
}
|