@rapidmx/web-client 0.4.0 → 0.6.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 +88 -0
- package/apps/admin/audit-log/index.tsx +35 -8
- package/apps/admin/data-requests/index.tsx +480 -485
- package/apps/admin/distribution-lists/[uid].tsx +19 -1
- package/apps/admin/escrow-scopes/[uid].tsx +348 -237
- package/apps/admin/escrow-scopes/new/index.tsx +8 -2
- package/apps/admin/index.tsx +19 -1
- package/apps/admin/ingest-queue/index.tsx +44 -5
- package/apps/admin/mailboxes/[uid].tsx +211 -184
- package/apps/admin/quarantine/index.tsx +46 -14
- package/apps/admin/transport-rules/[uid].tsx +30 -1
- package/apps/admin/transport-rules/_transportRuleConfig.tsx +38 -2
- package/apps/admin/transport-rules/index.tsx +24 -6
- package/apps/admin/transport-rules/new/index.tsx +30 -1
- package/apps/escrow/_layout.tsx +2 -3
- package/apps/escrow/audit-log/index.tsx +196 -168
- package/apps/escrow/matters/[uid].tsx +621 -521
- package/apps/shared/components/admin/escrowScopes/EscrowScopeKeyAndHoldersFields.tsx +22 -1
- package/apps/shared/components/admin/layout/AdminShell.tsx +28 -9
- package/apps/shared/components/admin/mailboxes/EscrowScopeCard.tsx +152 -0
- package/apps/shared/components/admin/mailboxes/ResourceSettingsCard.tsx +3 -3
- package/apps/shared/components/admin/mailboxes/ShareAccessCard.tsx +55 -11
- package/apps/shared/components/admin/settings/BrandingForm.tsx +15 -4
- package/apps/shared/components/admin/settings/DomainDnsSetup.tsx +18 -7
- package/apps/shared/components/admin/settings/EncryptionPolicyForm.tsx +10 -2
- package/apps/shared/components/admin/settings/MailboxCreateForm.tsx +6 -0
- package/apps/shared/components/admin/settings/MailboxPolicyForm.tsx +45 -12
- package/apps/shared/components/admin/settings/PluginsManager.tsx +1235 -595
- package/apps/shared/components/admin/settings/RetentionPolicyForm.tsx +174 -98
- package/apps/shared/components/admin/setup/EscrowSetupStep.tsx +49 -13
- package/apps/shared/components/admin/setup/SetupWizard.tsx +150 -34
- package/apps/shared/components/admin/signOut.ts +79 -0
- package/apps/shared/components/admin/usePagedList.tsx +129 -0
- package/apps/shared/components/calendar/EventModal.tsx +717 -549
- package/apps/shared/components/calendar/MonthView.tsx +173 -139
- package/apps/shared/components/calendar/RecurrenceEditor.tsx +222 -180
- package/apps/shared/components/calendar/SplitDayView.tsx +143 -137
- package/apps/shared/components/calendar/TimeGridView.tsx +244 -198
- package/apps/shared/components/calendar/allDay.ts +124 -0
- package/apps/shared/components/calendar/layout/CalendarShell.tsx +194 -192
- package/apps/shared/components/contacts/ContactDetailPane.tsx +100 -21
- package/apps/shared/components/contacts/ContactForm.tsx +377 -348
- package/apps/shared/components/contacts/ContactsSidebar.tsx +6 -2
- package/apps/shared/components/contacts/KeyChangeReview.tsx +192 -0
- package/apps/shared/components/contacts/contactKeys.ts +78 -0
- package/apps/shared/components/contacts/layout/ContactsShell.tsx +199 -197
- package/apps/shared/components/escrow/layout/EscrowShell.tsx +148 -134
- package/apps/shared/components/layout/AppShell.tsx +123 -33
- package/apps/shared/components/layout/BrandingChrome.tsx +48 -10
- package/apps/shared/components/layout/KeyEnrollmentGate.tsx +389 -298
- package/apps/shared/components/layout/MailboxProvisioning.tsx +19 -3
- package/apps/shared/components/layout/RecoveryCodeUnlock.tsx +350 -0
- package/apps/shared/components/layout/UnlockPromptProvider.tsx +257 -128
- package/apps/shared/components/mail/ConversationThreadPane.tsx +216 -181
- package/apps/shared/components/mail/MessageDetailPane.tsx +1318 -630
- package/apps/shared/components/mail/compose/ComposeContext.tsx +20 -15
- package/apps/shared/components/mail/compose/ComposeWindow.tsx +854 -132
- package/apps/shared/components/mail/compose/composeFlushRegistry.ts +60 -0
- package/apps/shared/components/mail/layout/MailShell.tsx +420 -408
- package/apps/shared/components/mail/pinnedSigners.ts +124 -0
- package/apps/shared/components/mail/verificationSeals.ts +125 -0
- package/apps/shared/components/mail/writableMailboxes.ts +101 -0
- package/apps/shared/components/rules/RuleBuilder.tsx +311 -276
- package/apps/shared/components/settings/layout/SettingsShell.tsx +23 -9
- package/apps/shared/components/tasks/layout/TasksShell.tsx +201 -199
- package/apps/shared/mail/listAllPages.ts +39 -0
- package/apps/shared/plugins/pluginNav.ts +73 -0
- package/apps/shared/search/LocalIndexLifecycle.tsx +64 -55
- package/apps/shared/search/localIndexBuilder.ts +481 -179
- package/apps/shared/search/localIndexRpcClient.ts +231 -29
- package/apps/shared/search/localIndexSchema.ts +15 -6
- package/apps/shared/search/localIndexStorage.ts +98 -0
- package/apps/shared/search/localIndexVFS.ts +32 -1
- package/apps/shared/search/localIndexWorker.ts +648 -186
- package/apps/www/calendar/index.tsx +438 -417
- package/apps/www/contacts/[uid].tsx +21 -2
- package/apps/www/contacts/index.tsx +116 -12
- package/apps/www/index.tsx +1314 -1041
- package/apps/www/messages/[uid].tsx +18 -6
- package/apps/www/settings/auto-reply/index.tsx +134 -129
- package/apps/www/settings/encryption/index.tsx +739 -216
- package/apps/www/settings/filters/[uid].tsx +171 -155
- package/apps/www/settings/filters/new/index.tsx +8 -1
- package/apps/www/settings/focused-inbox/index.tsx +150 -148
- package/apps/www/settings/privacy/index.tsx +494 -436
- package/apps/www/settings/read-receipts/index.tsx +148 -125
- package/apps/www/settings/sharing/index.tsx +17 -14
- package/apps/www/tasks/index.tsx +638 -579
- package/dist/apps/admin/_404.d.ts +2 -0
- package/dist/apps/admin/_500.d.ts +2 -0
- package/dist/apps/admin/_layout.d.ts +8 -0
- package/dist/apps/admin/audit-log/index.d.ts +11 -0
- package/dist/apps/admin/audit-log/index.js +38 -8
- package/dist/apps/admin/branding/index.d.ts +3 -0
- package/dist/apps/admin/data-requests/index.d.ts +3 -0
- package/dist/apps/admin/data-requests/index.js +52 -72
- package/dist/apps/admin/distribution-lists/[uid].d.ts +7 -0
- package/dist/apps/admin/distribution-lists/[uid].js +1 -1
- package/dist/apps/admin/distribution-lists/index.d.ts +3 -0
- package/dist/apps/admin/distribution-lists/new/index.d.ts +3 -0
- package/dist/apps/admin/domains/[uid].d.ts +7 -0
- package/dist/apps/admin/domains/index.d.ts +3 -0
- package/dist/apps/admin/domains/new/index.d.ts +3 -0
- package/dist/apps/admin/encryption-policy/index.d.ts +3 -0
- package/dist/apps/admin/escrow-scopes/[uid].d.ts +21 -0
- package/dist/apps/admin/escrow-scopes/[uid].js +91 -12
- package/dist/apps/admin/escrow-scopes/index.d.ts +3 -0
- package/dist/apps/admin/escrow-scopes/new/index.d.ts +3 -0
- package/dist/apps/admin/escrow-scopes/new/index.js +8 -3
- package/dist/apps/admin/index.d.ts +3 -0
- package/dist/apps/admin/index.js +4 -1
- package/dist/apps/admin/ingest-queue/index.d.ts +4 -0
- package/dist/apps/admin/ingest-queue/index.js +24 -6
- package/dist/apps/admin/mailbox-policy/index.d.ts +3 -0
- package/dist/apps/admin/mailboxes/[uid].d.ts +7 -0
- package/dist/apps/admin/mailboxes/[uid].js +20 -4
- package/dist/apps/admin/mailboxes/new/index.d.ts +3 -0
- package/dist/apps/admin/plugins/index.d.ts +3 -0
- package/dist/apps/admin/quarantine/index.d.ts +6 -0
- package/dist/apps/admin/quarantine/index.js +20 -11
- package/dist/apps/admin/retention-policy/index.d.ts +3 -0
- package/dist/apps/admin/setup/index.d.ts +3 -0
- package/dist/apps/admin/transport-rules/[uid].d.ts +7 -0
- package/dist/apps/admin/transport-rules/[uid].js +18 -2
- package/dist/apps/admin/transport-rules/_transportRuleConfig.d.ts +21 -0
- package/dist/apps/admin/transport-rules/_transportRuleConfig.js +19 -0
- package/dist/apps/admin/transport-rules/index.d.ts +3 -0
- package/dist/apps/admin/transport-rules/index.js +22 -6
- package/dist/apps/admin/transport-rules/new/index.d.ts +3 -0
- package/dist/apps/admin/transport-rules/new/index.js +18 -2
- package/dist/apps/escrow/_layout.d.ts +10 -0
- package/dist/apps/escrow/_layout.js +3 -3
- package/dist/apps/escrow/audit-log/index.d.ts +9 -0
- package/dist/apps/escrow/audit-log/index.js +26 -1
- package/dist/apps/escrow/index.d.ts +3 -0
- package/dist/apps/escrow/matters/[uid].d.ts +7 -0
- package/dist/apps/escrow/matters/[uid].js +77 -42
- package/dist/apps/escrow/matters/new/index.d.ts +3 -0
- package/dist/apps/shared/components/admin/distributionLists/MemberListCard.d.ts +17 -0
- package/dist/apps/shared/components/admin/escrowScopes/EscrowScopeKeyAndHoldersFields.d.ts +32 -0
- package/dist/apps/shared/components/admin/escrowScopes/EscrowScopeKeyAndHoldersFields.js +11 -2
- package/dist/apps/shared/components/admin/layout/AdminShell.d.ts +32 -0
- package/dist/apps/shared/components/admin/layout/AdminShell.js +15 -6
- package/dist/apps/shared/components/admin/mailboxes/EscrowScopeCard.d.ts +12 -0
- package/dist/apps/shared/components/admin/mailboxes/EscrowScopeCard.js +72 -0
- package/dist/apps/shared/components/admin/mailboxes/MailboxTable.d.ts +6 -0
- package/dist/apps/shared/components/admin/mailboxes/ResourceSettingsCard.d.ts +19 -0
- package/dist/apps/shared/components/admin/mailboxes/ResourceSettingsCard.js +3 -3
- package/dist/apps/shared/components/admin/mailboxes/ShareAccessCard.d.ts +12 -0
- package/dist/apps/shared/components/admin/mailboxes/ShareAccessCard.js +22 -4
- package/dist/apps/shared/components/admin/settings/BrandingForm.d.ts +9 -0
- package/dist/apps/shared/components/admin/settings/BrandingForm.js +15 -4
- package/dist/apps/shared/components/admin/settings/DomainDnsSetup.d.ts +12 -0
- package/dist/apps/shared/components/admin/settings/DomainDnsSetup.js +13 -7
- package/dist/apps/shared/components/admin/settings/EncryptionPolicyForm.d.ts +12 -0
- package/dist/apps/shared/components/admin/settings/EncryptionPolicyForm.js +7 -2
- package/dist/apps/shared/components/admin/settings/LoadedSettingsForm.d.ts +9 -0
- package/dist/apps/shared/components/admin/settings/MailboxCreateForm.d.ts +19 -0
- package/dist/apps/shared/components/admin/settings/MailboxCreateForm.js +6 -0
- package/dist/apps/shared/components/admin/settings/MailboxPolicyForm.d.ts +10 -0
- package/dist/apps/shared/components/admin/settings/MailboxPolicyForm.js +34 -12
- package/dist/apps/shared/components/admin/settings/PluginsManager.d.ts +4 -0
- package/dist/apps/shared/components/admin/settings/PluginsManager.js +390 -78
- package/dist/apps/shared/components/admin/settings/RetentionPolicyForm.d.ts +9 -0
- package/dist/apps/shared/components/admin/settings/RetentionPolicyForm.js +40 -11
- package/dist/apps/shared/components/admin/setup/EscrowSetupStep.d.ts +14 -0
- package/dist/apps/shared/components/admin/setup/EscrowSetupStep.js +29 -13
- package/dist/apps/shared/components/admin/setup/SetupWizard.d.ts +36 -0
- package/dist/apps/shared/components/admin/setup/SetupWizard.js +87 -21
- package/dist/apps/shared/components/admin/signOut.d.ts +23 -0
- package/dist/apps/shared/components/admin/signOut.js +75 -0
- package/dist/apps/shared/components/admin/usePagedList.d.ts +39 -0
- package/dist/apps/shared/components/admin/usePagedList.js +99 -0
- package/dist/apps/shared/components/calendar/CalendarListSidebar.d.ts +26 -0
- package/dist/apps/shared/components/calendar/EventModal.d.ts +46 -0
- package/dist/apps/shared/components/calendar/EventModal.js +142 -21
- package/dist/apps/shared/components/calendar/MonthView.d.ts +15 -0
- package/dist/apps/shared/components/calendar/MonthView.js +12 -5
- package/dist/apps/shared/components/calendar/RecurrenceEditor.d.ts +20 -0
- package/dist/apps/shared/components/calendar/RecurrenceEditor.js +40 -5
- package/dist/apps/shared/components/calendar/ResourcePicker.d.ts +19 -0
- package/dist/apps/shared/components/calendar/SplitDayView.d.ts +28 -0
- package/dist/apps/shared/components/calendar/SplitDayView.js +10 -4
- package/dist/apps/shared/components/calendar/TimeGridView.d.ts +17 -0
- package/dist/apps/shared/components/calendar/TimeGridView.js +23 -7
- package/dist/apps/shared/components/calendar/allDay.d.ts +51 -0
- package/dist/apps/shared/components/calendar/allDay.js +111 -0
- package/dist/apps/shared/components/calendar/layout/CalendarShell.d.ts +40 -0
- package/dist/apps/shared/components/calendar/layout/CalendarShell.js +3 -3
- package/dist/apps/shared/components/contacts/ContactDetailPane.d.ts +23 -0
- package/dist/apps/shared/components/contacts/ContactDetailPane.js +43 -5
- package/dist/apps/shared/components/contacts/ContactForm.d.ts +20 -0
- package/dist/apps/shared/components/contacts/ContactForm.js +32 -10
- package/dist/apps/shared/components/contacts/ContactsSidebar.d.ts +40 -0
- package/dist/apps/shared/components/contacts/ContactsSidebar.js +2 -2
- package/dist/apps/shared/components/contacts/ContactsToolbar.d.ts +25 -0
- package/dist/apps/shared/components/contacts/KeyChangeReview.d.ts +40 -0
- package/dist/apps/shared/components/contacts/KeyChangeReview.js +63 -0
- package/dist/apps/shared/components/contacts/contactKeys.d.ts +29 -0
- package/dist/apps/shared/components/contacts/contactKeys.js +64 -0
- package/dist/apps/shared/components/contacts/layout/ContactsShell.d.ts +21 -0
- package/dist/apps/shared/components/contacts/layout/ContactsShell.js +2 -2
- package/dist/apps/shared/components/escrow/layout/EscrowShell.d.ts +25 -0
- package/dist/apps/shared/components/escrow/layout/EscrowShell.js +24 -5
- package/dist/apps/shared/components/forms/StringListField.d.ts +22 -0
- package/dist/apps/shared/components/layout/AppShell.d.ts +49 -0
- package/dist/apps/shared/components/layout/AppShell.js +97 -26
- package/dist/apps/shared/components/layout/BrandingChrome.d.ts +18 -0
- package/dist/apps/shared/components/layout/BrandingChrome.js +45 -10
- package/dist/apps/shared/components/layout/KeyEnrollmentGate.d.ts +51 -0
- package/dist/apps/shared/components/layout/KeyEnrollmentGate.js +49 -12
- package/dist/apps/shared/components/layout/MailboxProvisioning.d.ts +13 -0
- package/dist/apps/shared/components/layout/MailboxProvisioning.js +10 -2
- package/dist/apps/shared/components/layout/RecoveryCodeUnlock.d.ts +66 -0
- package/dist/apps/shared/components/layout/RecoveryCodeUnlock.js +174 -0
- package/dist/apps/shared/components/layout/UnlockPromptProvider.d.ts +45 -0
- package/dist/apps/shared/components/layout/UnlockPromptProvider.js +73 -14
- package/dist/apps/shared/components/layout/UserMenu.d.ts +23 -0
- package/dist/apps/shared/components/mail/ConversationList.d.ts +11 -0
- package/dist/apps/shared/components/mail/ConversationThreadPane.d.ts +23 -0
- package/dist/apps/shared/components/mail/ConversationThreadPane.js +50 -12
- package/dist/apps/shared/components/mail/MessageDetailPane.d.ts +93 -0
- package/dist/apps/shared/components/mail/MessageDetailPane.js +441 -36
- package/dist/apps/shared/components/mail/compose/ComposeContext.d.ts +58 -0
- package/dist/apps/shared/components/mail/compose/ComposeContext.js +9 -6
- package/dist/apps/shared/components/mail/compose/ComposeToolbar.d.ts +15 -0
- package/dist/apps/shared/components/mail/compose/ComposeWindow.d.ts +37 -0
- package/dist/apps/shared/components/mail/compose/ComposeWindow.js +699 -128
- package/dist/apps/shared/components/mail/compose/EmojiPicker.d.ts +14 -0
- package/dist/apps/shared/components/mail/compose/GifPicker.d.ts +13 -0
- package/dist/apps/shared/components/mail/compose/RichTextEditor.d.ts +34 -0
- package/dist/apps/shared/components/mail/compose/ScheduleSendPicker.d.ts +16 -0
- package/dist/apps/shared/components/mail/compose/composeFlushRegistry.d.ts +27 -0
- package/dist/apps/shared/components/mail/compose/composeFlushRegistry.js +50 -0
- package/dist/apps/shared/components/mail/layout/MailShell.d.ts +57 -0
- package/dist/apps/shared/components/mail/layout/MailShell.js +13 -4
- package/dist/apps/shared/components/mail/pinnedSigners.d.ts +33 -0
- package/dist/apps/shared/components/mail/pinnedSigners.js +98 -0
- package/dist/apps/shared/components/mail/verificationSeals.d.ts +22 -0
- package/dist/apps/shared/components/mail/verificationSeals.js +112 -0
- package/dist/apps/shared/components/mail/writableMailboxes.d.ts +15 -0
- package/dist/apps/shared/components/mail/writableMailboxes.js +87 -0
- package/dist/apps/shared/components/rules/RuleBuilder.d.ts +70 -0
- package/dist/apps/shared/components/rules/RuleBuilder.js +34 -6
- package/dist/apps/shared/components/settings/layout/SettingsShell.d.ts +41 -0
- package/dist/apps/shared/components/settings/layout/SettingsShell.js +19 -9
- package/dist/apps/shared/components/tasks/TasksSidebar.d.ts +41 -0
- package/dist/apps/shared/components/tasks/TasksToolbar.d.ts +14 -0
- package/dist/apps/shared/components/tasks/layout/TasksShell.d.ts +24 -0
- package/dist/apps/shared/components/tasks/layout/TasksShell.js +2 -2
- package/dist/apps/shared/mail/findWellKnownFolderUid.d.ts +5 -0
- package/dist/apps/shared/mail/listAllPages.d.ts +17 -0
- package/dist/apps/shared/mail/listAllPages.js +25 -0
- package/dist/apps/shared/plugins/pluginNav.d.ts +39 -0
- package/dist/apps/shared/plugins/pluginNav.js +33 -0
- package/dist/apps/shared/search/LocalIndexLifecycle.d.ts +13 -0
- package/dist/apps/shared/search/LocalIndexLifecycle.js +58 -54
- package/dist/apps/shared/search/localIndexBlockCipher.d.ts +36 -0
- package/dist/apps/shared/search/localIndexBuilder.d.ts +85 -0
- package/dist/apps/shared/search/localIndexBuilder.js +292 -37
- package/dist/apps/shared/search/localIndexKey.d.ts +4 -0
- package/dist/apps/shared/search/localIndexRpcClient.d.ts +71 -0
- package/dist/apps/shared/search/localIndexRpcClient.js +191 -26
- package/dist/apps/shared/search/localIndexSchema.d.ts +111 -0
- package/dist/apps/shared/search/localIndexSchema.js +12 -6
- package/dist/apps/shared/search/localIndexSizePreference.d.ts +27 -0
- package/dist/apps/shared/search/localIndexStorage.d.ts +28 -0
- package/dist/apps/shared/search/localIndexStorage.js +86 -0
- package/dist/apps/shared/search/localIndexVFS.d.ts +101 -0
- package/dist/apps/shared/search/localIndexVFS.js +68 -40
- package/dist/apps/shared/search/localIndexWorker.d.ts +145 -0
- package/dist/apps/shared/search/localIndexWorker.js +519 -173
- package/dist/apps/shared/search/searchTier2.d.ts +30 -0
- package/dist/apps/www/_404.d.ts +2 -0
- package/dist/apps/www/_500.d.ts +2 -0
- package/dist/apps/www/_layout.d.ts +14 -0
- package/dist/apps/www/calendar/index.d.ts +3 -0
- package/dist/apps/www/calendar/index.js +28 -10
- package/dist/apps/www/contacts/[uid].d.ts +13 -0
- package/dist/apps/www/contacts/[uid].js +13 -2
- package/dist/apps/www/contacts/index.d.ts +3 -0
- package/dist/apps/www/contacts/index.js +80 -10
- package/dist/apps/www/index.d.ts +3 -0
- package/dist/apps/www/index.js +339 -108
- package/dist/apps/www/messages/[uid].d.ts +11 -0
- package/dist/apps/www/messages/[uid].js +18 -6
- package/dist/apps/www/settings/auto-reply/index.d.ts +4 -0
- package/dist/apps/www/settings/auto-reply/index.js +9 -4
- package/dist/apps/www/settings/encryption/index.d.ts +7 -0
- package/dist/apps/www/settings/encryption/index.js +514 -97
- package/dist/apps/www/settings/filters/[uid].d.ts +8 -0
- package/dist/apps/www/settings/filters/[uid].js +22 -7
- package/dist/apps/www/settings/filters/_mailFilterRuleConfig.d.ts +11 -0
- package/dist/apps/www/settings/filters/index.d.ts +4 -0
- package/dist/apps/www/settings/filters/new/index.d.ts +4 -0
- package/dist/apps/www/settings/filters/new/index.js +8 -2
- package/dist/apps/www/settings/focused-inbox/index.d.ts +4 -0
- package/dist/apps/www/settings/focused-inbox/index.js +3 -1
- package/dist/apps/www/settings/labels/index.d.ts +4 -0
- package/dist/apps/www/settings/privacy/index.d.ts +4 -0
- package/dist/apps/www/settings/privacy/index.js +57 -22
- package/dist/apps/www/settings/read-receipts/index.d.ts +4 -0
- package/dist/apps/www/settings/read-receipts/index.js +10 -3
- package/dist/apps/www/settings/sharing/index.d.ts +4 -0
- package/dist/apps/www/settings/sharing/index.js +7 -11
- package/dist/apps/www/settings/signatures/[uid].d.ts +8 -0
- package/dist/apps/www/settings/signatures/index.d.ts +4 -0
- package/dist/apps/www/settings/signatures/new/index.d.ts +4 -0
- package/dist/apps/www/settings/signatures/signatureDefaults.d.ts +10 -0
- package/dist/apps/www/tasks/index.d.ts +3 -0
- package/dist/apps/www/tasks/index.js +50 -10
- package/package.json +3 -3
- package/apps/shared/components/booking/AvailabilityEditor.tsx +0 -118
- package/apps/www/settings/booking-types/[uid].tsx +0 -300
- package/apps/www/settings/booking-types/index.tsx +0 -98
- package/apps/www/settings/booking-types/new/index.tsx +0 -212
- package/dist/apps/shared/components/booking/AvailabilityEditor.js +0 -45
- package/dist/apps/www/settings/booking-types/[uid].js +0 -129
- package/dist/apps/www/settings/booking-types/index.js +0 -29
- package/dist/apps/www/settings/booking-types/new/index.js +0 -86
|
@@ -1,128 +1,257 @@
|
|
|
1
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
-
// Copyright (C) 2026 Jean-Philippe Steinmetz
|
|
3
|
-
// SPDX-License-Identifier: MPL-2.0
|
|
4
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
5
|
-
import React, { createContext, useCallback, useContext, useState } from "react";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2026 Jean-Philippe Steinmetz
|
|
3
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
5
|
+
import React, { createContext, useCallback, useContext, useRef, useState } from "react";
|
|
6
|
+
import {
|
|
7
|
+
getUnlockedKeys,
|
|
8
|
+
unlockWithPassword,
|
|
9
|
+
UnlockedKeys,
|
|
10
|
+
UnlockResult,
|
|
11
|
+
UnopenableEncryptionKeyError,
|
|
12
|
+
} from "@rapidmx/react-shared/crypto/keySession.js";
|
|
13
|
+
import type { PublicKey } from "@rapidmx/react-shared/crypto/keyvaultApi.js";
|
|
14
|
+
import Modal from "@rapidmx/react-shared/components/overlays/Modal.js";
|
|
15
|
+
import Alert from "@rapidmx/react-shared/components/feedback/Alert.js";
|
|
16
|
+
import Button from "@rapidmx/react-shared/components/buttons/Button.js";
|
|
17
|
+
import FormField from "@rapidmx/react-shared/components/forms/FormField.js";
|
|
18
|
+
import {
|
|
19
|
+
RECOVERY_CODE_ERROR,
|
|
20
|
+
RecoveryFollowUp,
|
|
21
|
+
RecoveryFollowUpModal,
|
|
22
|
+
UnlockModeToggle,
|
|
23
|
+
startRecoveryUnlock,
|
|
24
|
+
} from "./RecoveryCodeUnlock.js";
|
|
25
|
+
|
|
26
|
+
/** Shown instead of "Incorrect password" when the password was right but the mailbox's encryption key itself
|
|
27
|
+
* won't open (`UnopenableEncryptionKeyError`) - retrying can't fix that, so it must not read as a typo. */
|
|
28
|
+
export const UNOPENABLE_ENCRYPTION_KEY_MESSAGE =
|
|
29
|
+
"Your password is correct, but one of your keys couldn't be opened, so encrypted mail can't be read or sent from this mailbox. Trying again won't help - contact support.";
|
|
30
|
+
|
|
31
|
+
/** `UNOPENABLE_ENCRYPTION_KEY_MESSAGE`'s counterpart for a recovery-code unlock. */
|
|
32
|
+
export const UNOPENABLE_ENCRYPTION_KEY_RECOVERY_MESSAGE =
|
|
33
|
+
"Your recovery code is correct, but one of your keys couldn't be opened, so encrypted mail can't be read or sent from this mailbox. Trying again won't help - contact support.";
|
|
34
|
+
|
|
35
|
+
/** The error text for a failed `unlockWithPassword()` (or, with `method` `"recovery"`, `unlockWithRecoveryCode()`). */
|
|
36
|
+
export function unlockErrorMessage(err: unknown, method: "password" | "recovery" = "password"): string {
|
|
37
|
+
// Deliberately generic otherwise - see `unlockWithPassword()`'s own doc comment: a wrong password and a
|
|
38
|
+
// missing password wrap fail the same way, and telling them apart would help someone guessing passwords.
|
|
39
|
+
if (method === "recovery") {
|
|
40
|
+
return err instanceof UnopenableEncryptionKeyError ? UNOPENABLE_ENCRYPTION_KEY_RECOVERY_MESSAGE : RECOVERY_CODE_ERROR;
|
|
41
|
+
}
|
|
42
|
+
return err instanceof UnopenableEncryptionKeyError ? UNOPENABLE_ENCRYPTION_KEY_MESSAGE : "Incorrect password.";
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A non-blocking notice after an unlock that succeeded without some signing keys (`UnlockResult.unopenableKeys`):
|
|
47
|
+
* mail can still be read, but not signed with those keys on this device.
|
|
48
|
+
*/
|
|
49
|
+
export function UnopenableKeysNotice({ fingerprints, onDismiss }: { fingerprints: string[]; onDismiss: () => void }) {
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
role="status"
|
|
53
|
+
className="fixed bottom-4 right-4 z-50 max-w-sm bg-surface border border-border rounded-md p-3 text-sm shadow-lg flex flex-col gap-2"
|
|
54
|
+
>
|
|
55
|
+
<p>
|
|
56
|
+
Unlocked, but {fingerprints.length === 1 ? "one of your signing keys" : `${fingerprints.length} of your signing keys`}{" "}
|
|
57
|
+
couldn’t be opened, so mail can’t be signed with {fingerprints.length === 1 ? "it" : "them"}. Contact
|
|
58
|
+
support.
|
|
59
|
+
</p>
|
|
60
|
+
<p className="font-mono text-xs break-all text-text-muted">{fingerprints.join(", ")}</p>
|
|
61
|
+
<div>
|
|
62
|
+
<Button type="button" variant="secondary" className="!w-auto" onClick={onDismiss}>
|
|
63
|
+
Dismiss
|
|
64
|
+
</Button>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface PendingUnlock {
|
|
71
|
+
mailboxUid: string;
|
|
72
|
+
mailboxKeys: PublicKey[];
|
|
73
|
+
/** Every caller waiting on this one dialog - a second request for the same mailbox while it's open joins
|
|
74
|
+
* it rather than replacing it, so no earlier caller's promise is ever left unsettled. */
|
|
75
|
+
waiters: { resolve: (keys: UnlockedKeys) => void; reject: (err: Error) => void }[];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
interface UnlockPromptContextValue {
|
|
79
|
+
/**
|
|
80
|
+
* Resolves immediately with this mailbox's already-unlocked keys if it has any this session -
|
|
81
|
+
* showing no UI at all. Otherwise shows an unlock dialog on top of whatever the user is currently
|
|
82
|
+
* doing and resolves once they enter the correct password, or rejects if they dismiss it.
|
|
83
|
+
*/
|
|
84
|
+
requestUnlock(mailboxUid: string, mailboxKeys: PublicKey[]): Promise<UnlockedKeys>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const UnlockPromptContext = createContext<UnlockPromptContextValue | null>(null);
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The on-demand counterpart to `KeyEnrollmentGate`'s blocking, first-sign-in-only provisioning flow.
|
|
91
|
+
* Per `specs/end-to-end_encryption.md`, unlocking is only actually *required* to (1) sign or encrypt an
|
|
92
|
+
* outgoing message, (2) read an already-encrypted message, or (3) change encryption settings that touch
|
|
93
|
+
* the master key - not merely to have a mailbox with an existing vault resolve. Mounted once in
|
|
94
|
+
* `AppShell.tsx` (shared by every top-level app shell: Mail, Calendar, Contacts, Tasks, Settings), so
|
|
95
|
+
* any of those three call sites (`ComposeWindow`'s sign/encrypt toggles, `MessageDetailPane`'s encrypted-
|
|
96
|
+
* message view, `Settings > Encryption`) can request an unlock right where it's needed via
|
|
97
|
+
* `useUnlockPrompt()`, instead of the whole app being blocked behind an unlock screen the moment a
|
|
98
|
+
* mailbox happens to resolve - see `KeyEnrollmentGate`'s `blocking` prop, which `MailShell` now sets to
|
|
99
|
+
* `false` for exactly this reason.
|
|
100
|
+
*/
|
|
101
|
+
export function UnlockPromptProvider({ children }: { children: React.ReactNode }) {
|
|
102
|
+
const [pending, setPendingState] = useState<PendingUnlock | null>(null);
|
|
103
|
+
// Mirrors `pending` synchronously, so two requests issued in the same tick see each other.
|
|
104
|
+
const pendingRef = useRef<PendingUnlock | null>(null);
|
|
105
|
+
const [password, setPassword] = useState("");
|
|
106
|
+
const [error, setError] = useState<string | null>(null);
|
|
107
|
+
const [unlocking, setUnlocking] = useState(false);
|
|
108
|
+
const [unopenableKeys, setUnopenableKeys] = useState<string[] | null>(null);
|
|
109
|
+
const [mode, setMode] = useState<"password" | "recovery">("password");
|
|
110
|
+
const [code, setCode] = useState("");
|
|
111
|
+
// The steps after a recovery-code unlock (new password, using up the code). Shown only once the waiters are
|
|
112
|
+
// already settled - see `RecoveryCodeUnlock.tsx`.
|
|
113
|
+
const [followUp, setFollowUp] = useState<RecoveryFollowUp | null>(null);
|
|
114
|
+
|
|
115
|
+
function setPending(next: PendingUnlock | null) {
|
|
116
|
+
pendingRef.current = next;
|
|
117
|
+
setPendingState(next);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const requestUnlock = useCallback((mailboxUid: string, mailboxKeys: PublicKey[]): Promise<UnlockedKeys> => {
|
|
121
|
+
const existing = getUnlockedKeys(mailboxUid);
|
|
122
|
+
if (existing) {
|
|
123
|
+
return Promise.resolve(existing);
|
|
124
|
+
}
|
|
125
|
+
return new Promise<UnlockedKeys>((resolve, reject) => {
|
|
126
|
+
const current = pendingRef.current;
|
|
127
|
+
if (current?.mailboxUid === mailboxUid) {
|
|
128
|
+
current.waiters.push({ resolve, reject });
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
// A different mailbox's dialog is replacing this one - settle its callers rather than leaving
|
|
132
|
+
// their promises hanging forever.
|
|
133
|
+
current?.waiters.forEach((waiter) => waiter.reject(new Error("Unlock superseded by another request.")));
|
|
134
|
+
setPassword("");
|
|
135
|
+
setCode("");
|
|
136
|
+
setMode("password");
|
|
137
|
+
setError(null);
|
|
138
|
+
setPending({ mailboxUid, mailboxKeys, waiters: [{ resolve, reject }] });
|
|
139
|
+
});
|
|
140
|
+
}, []);
|
|
141
|
+
|
|
142
|
+
function handleCancel() {
|
|
143
|
+
pendingRef.current?.waiters.forEach((waiter) => waiter.reject(new Error("Unlock cancelled.")));
|
|
144
|
+
setPending(null);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
async function handleSubmit(e: React.FormEvent) {
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
// Only reachable via the form below, which never renders while `pending` is null.
|
|
150
|
+
const request = pending!;
|
|
151
|
+
setError(null);
|
|
152
|
+
setUnlocking(true);
|
|
153
|
+
try {
|
|
154
|
+
const result: UnlockResult | RecoveryFollowUp = await (mode === "recovery"
|
|
155
|
+
? startRecoveryUnlock(request.mailboxUid, request.mailboxKeys, code)
|
|
156
|
+
: unlockWithPassword(request.mailboxUid, request.mailboxKeys, password));
|
|
157
|
+
const recovery = mode === "recovery" ? (result as RecoveryFollowUp) : null;
|
|
158
|
+
// Always reachable: the unlock just populated keySession.ts's session store for
|
|
159
|
+
// this exact mailboxUid, or threw before we get here.
|
|
160
|
+
const unlocked = getUnlockedKeys(request.mailboxUid)!;
|
|
161
|
+
request.waiters.forEach((waiter) => waiter.resolve(unlocked));
|
|
162
|
+
if (pendingRef.current === request) {
|
|
163
|
+
setPending(null);
|
|
164
|
+
}
|
|
165
|
+
if (result.unopenableKeys.length > 0) {
|
|
166
|
+
setUnopenableKeys(result.unopenableKeys);
|
|
167
|
+
}
|
|
168
|
+
setCode("");
|
|
169
|
+
setFollowUp(recovery);
|
|
170
|
+
} catch (err) {
|
|
171
|
+
setError(unlockErrorMessage(err, mode));
|
|
172
|
+
} finally {
|
|
173
|
+
setUnlocking(false);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function handleModeChange(next: "password" | "recovery") {
|
|
178
|
+
setMode(next);
|
|
179
|
+
setError(null);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
<UnlockPromptContext.Provider value={{ requestUnlock }}>
|
|
184
|
+
{children}
|
|
185
|
+
{unopenableKeys && <UnopenableKeysNotice fingerprints={unopenableKeys} onDismiss={() => setUnopenableKeys(null)} />}
|
|
186
|
+
{followUp && (
|
|
187
|
+
// Hidden (progress kept) while another unlock dialog is open on top of it.
|
|
188
|
+
<RecoveryFollowUpModal
|
|
189
|
+
key={`${followUp.mailboxUid}:${followUp.recoveryMethodId}`}
|
|
190
|
+
followUp={followUp}
|
|
191
|
+
open={!pending}
|
|
192
|
+
onDone={() => setFollowUp(null)}
|
|
193
|
+
/>
|
|
194
|
+
)}
|
|
195
|
+
<Modal open={!!pending} onClose={handleCancel} title="Unlock your mailbox">
|
|
196
|
+
<p className="text-sm text-text-muted mb-5">
|
|
197
|
+
{mode === "password"
|
|
198
|
+
? "Enter your encryption password to continue."
|
|
199
|
+
: "Enter one of your recovery codes to continue. Each code works once."}
|
|
200
|
+
</p>
|
|
201
|
+
{error && <Alert>{error}</Alert>}
|
|
202
|
+
<form onSubmit={handleSubmit}>
|
|
203
|
+
{mode === "password" ? (
|
|
204
|
+
<FormField label="Encryption password" htmlFor="unlock-prompt-password">
|
|
205
|
+
<input
|
|
206
|
+
id="unlock-prompt-password"
|
|
207
|
+
type="password"
|
|
208
|
+
className="w-full text-sm border border-border rounded-sm py-1.5 px-2 bg-surface"
|
|
209
|
+
value={password}
|
|
210
|
+
onChange={(e) => setPassword(e.target.value)}
|
|
211
|
+
disabled={unlocking}
|
|
212
|
+
autoComplete="current-password"
|
|
213
|
+
autoFocus
|
|
214
|
+
/>
|
|
215
|
+
</FormField>
|
|
216
|
+
) : (
|
|
217
|
+
<FormField label="Recovery code" htmlFor="unlock-prompt-recovery-code">
|
|
218
|
+
<input
|
|
219
|
+
id="unlock-prompt-recovery-code"
|
|
220
|
+
type="text"
|
|
221
|
+
className="w-full text-sm font-mono border border-border rounded-sm py-1.5 px-2 bg-surface"
|
|
222
|
+
value={code}
|
|
223
|
+
onChange={(e) => setCode(e.target.value)}
|
|
224
|
+
disabled={unlocking}
|
|
225
|
+
autoComplete="off"
|
|
226
|
+
autoCapitalize="characters"
|
|
227
|
+
spellCheck={false}
|
|
228
|
+
autoFocus
|
|
229
|
+
/>
|
|
230
|
+
</FormField>
|
|
231
|
+
)}
|
|
232
|
+
<div className="flex gap-2">
|
|
233
|
+
<Button type="submit" loading={unlocking} disabled={unlocking}>
|
|
234
|
+
Unlock
|
|
235
|
+
</Button>
|
|
236
|
+
<Button type="button" variant="secondary" onClick={handleCancel} disabled={unlocking}>
|
|
237
|
+
Cancel
|
|
238
|
+
</Button>
|
|
239
|
+
</div>
|
|
240
|
+
</form>
|
|
241
|
+
<div className="mt-3">
|
|
242
|
+
<UnlockModeToggle mode={mode} disabled={unlocking} onChange={handleModeChange} />
|
|
243
|
+
</div>
|
|
244
|
+
</Modal>
|
|
245
|
+
</UnlockPromptContext.Provider>
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/** Throws outside an `<UnlockPromptProvider>` - every app shell mounts one (see `AppShell.tsx`), so
|
|
250
|
+
* reaching this from any real page is a wiring bug, not a runtime condition to degrade gracefully from. */
|
|
251
|
+
export function useUnlockPrompt(): UnlockPromptContextValue {
|
|
252
|
+
const ctx = useContext(UnlockPromptContext);
|
|
253
|
+
if (!ctx) {
|
|
254
|
+
throw new Error("useUnlockPrompt() must be used within an UnlockPromptProvider (see AppShell.tsx).");
|
|
255
|
+
}
|
|
256
|
+
return ctx;
|
|
257
|
+
}
|