@arbidocs/blocks 0.4.129 → 0.4.130
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 +4 -3
- package/dist/agents/index.cjs +216 -216
- package/dist/agents/index.js +5 -5
- package/dist/calendar/CalendarPrint.d.ts +25 -0
- package/dist/calendar/booking-slots.d.ts +21 -0
- package/dist/calendar/index.cjs +381 -97
- package/dist/calendar/index.cjs.map +1 -1
- package/dist/calendar/index.d.ts +4 -0
- package/dist/calendar/index.js +277 -3
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/print-layout.d.ts +16 -0
- package/dist/calendar/printCalendar.d.ts +6 -0
- package/dist/calls/composite-canvas.d.ts +52 -0
- package/dist/calls/index.cjs +376 -3
- package/dist/calls/index.cjs.map +1 -1
- package/dist/calls/index.d.ts +3 -0
- package/dist/calls/index.js +360 -5
- package/dist/calls/index.js.map +1 -1
- package/dist/calls/ringtone.d.ts +16 -0
- package/dist/calls/voice-levels.d.ts +32 -0
- package/dist/chat/ThreadVisualizer.d.ts +28 -0
- package/dist/chat/index.cjs +93 -77
- package/dist/chat/index.d.ts +2 -0
- package/dist/chat/index.js +2 -2
- package/dist/chat/open-document.d.ts +5 -1
- package/dist/chat/thread-diagram.d.ts +26 -0
- package/dist/{chunk-DQCYCEDR.js → chunk-2Q7FDZAY.js} +3 -3
- package/dist/{chunk-DQCYCEDR.js.map → chunk-2Q7FDZAY.js.map} +1 -1
- package/dist/{chunk-S7PSMMRG.js → chunk-444XKG46.js} +3 -3
- package/dist/{chunk-S7PSMMRG.js.map → chunk-444XKG46.js.map} +1 -1
- package/dist/{chunk-7423V6RM.cjs → chunk-4QIIDXLF.cjs} +8 -8
- package/dist/{chunk-7423V6RM.cjs.map → chunk-4QIIDXLF.cjs.map} +1 -1
- package/dist/{chunk-OYMWV45N.js → chunk-4RLCRFZS.js} +63 -13
- package/dist/chunk-4RLCRFZS.js.map +1 -0
- package/dist/{chunk-DZYAAL4H.cjs → chunk-4S5IDT5F.cjs} +231 -2
- package/dist/chunk-4S5IDT5F.cjs.map +1 -0
- package/dist/{chunk-CJBN5HIS.js → chunk-4UMXQPNA.js} +20 -8
- package/dist/chunk-4UMXQPNA.js.map +1 -0
- package/dist/{chunk-IBZJYCYM.js → chunk-66TA5IBN.js} +17 -25
- package/dist/chunk-66TA5IBN.js.map +1 -0
- package/dist/{chunk-OR4CO743.cjs → chunk-AAFX64WD.cjs} +3 -3
- package/dist/{chunk-OR4CO743.cjs.map → chunk-AAFX64WD.cjs.map} +1 -1
- package/dist/{chunk-MUMH3Z6K.cjs → chunk-ARDHLU73.cjs} +61 -11
- package/dist/chunk-ARDHLU73.cjs.map +1 -0
- package/dist/{chunk-TGWTLNXW.cjs → chunk-BIXHB4LV.cjs} +3 -2
- package/dist/{chunk-TGWTLNXW.cjs.map → chunk-BIXHB4LV.cjs.map} +1 -1
- package/dist/chunk-C4WSHRR6.cjs +166 -0
- package/dist/chunk-C4WSHRR6.cjs.map +1 -0
- package/dist/{chunk-ZAVEMQ37.cjs → chunk-DWZXSPMB.cjs} +3 -3
- package/dist/{chunk-ZAVEMQ37.cjs.map → chunk-DWZXSPMB.cjs.map} +1 -1
- package/dist/{chunk-5HFPRI3W.js → chunk-FUTMU4FR.js} +3 -3
- package/dist/{chunk-5HFPRI3W.js.map → chunk-FUTMU4FR.js.map} +1 -1
- package/dist/{chunk-5Y7JRY7Y.js → chunk-GDBDHOI4.js} +3 -3
- package/dist/{chunk-5Y7JRY7Y.js.map → chunk-GDBDHOI4.js.map} +1 -1
- package/dist/{chunk-TGJNPKST.js → chunk-GTCC2VAR.js} +3 -3
- package/dist/{chunk-TGJNPKST.js.map → chunk-GTCC2VAR.js.map} +1 -1
- package/dist/{chunk-3BJLNKOB.cjs → chunk-GZPTWHP5.cjs} +22 -10
- package/dist/chunk-GZPTWHP5.cjs.map +1 -0
- package/dist/{chunk-OUW6G4O2.cjs → chunk-HFGXA5CL.cjs} +4 -4
- package/dist/{chunk-OUW6G4O2.cjs.map → chunk-HFGXA5CL.cjs.map} +1 -1
- package/dist/{chunk-SWQX6CTT.cjs → chunk-JKB7WT7L.cjs} +2 -2
- package/dist/chunk-JKB7WT7L.cjs.map +1 -0
- package/dist/{chunk-S6BOINC4.cjs → chunk-OGBXV326.cjs} +7 -7
- package/dist/{chunk-S6BOINC4.cjs.map → chunk-OGBXV326.cjs.map} +1 -1
- package/dist/{chunk-DJM7DLCT.cjs → chunk-OPTBQSCV.cjs} +3 -3
- package/dist/{chunk-DJM7DLCT.cjs.map → chunk-OPTBQSCV.cjs.map} +1 -1
- package/dist/{chunk-GFYGYME3.js → chunk-OQ7RUNOC.js} +3 -3
- package/dist/{chunk-GFYGYME3.js.map → chunk-OQ7RUNOC.js.map} +1 -1
- package/dist/{chunk-NYHGG2IA.cjs → chunk-QDEODGXE.cjs} +5 -5
- package/dist/{chunk-NYHGG2IA.cjs.map → chunk-QDEODGXE.cjs.map} +1 -1
- package/dist/{chunk-6BTCDKCK.js → chunk-QYTYW74G.js} +4 -4
- package/dist/{chunk-6BTCDKCK.js.map → chunk-QYTYW74G.js.map} +1 -1
- package/dist/{chunk-A7NCSZAP.cjs → chunk-QZTNTP75.cjs} +17 -25
- package/dist/chunk-QZTNTP75.cjs.map +1 -0
- package/dist/{chunk-OB5F4577.cjs → chunk-R26BK7YL.cjs} +4 -4
- package/dist/{chunk-OB5F4577.cjs.map → chunk-R26BK7YL.cjs.map} +1 -1
- package/dist/{chunk-A2YAC22G.js → chunk-RI6DZA5X.js} +3 -3
- package/dist/{chunk-A2YAC22G.js.map → chunk-RI6DZA5X.js.map} +1 -1
- package/dist/{chunk-H2KQ6OSU.js → chunk-SZX44LCT.js} +230 -5
- package/dist/chunk-SZX44LCT.js.map +1 -0
- package/dist/{chunk-7QDX2CO4.cjs → chunk-TP6PLDNM.cjs} +4 -4
- package/dist/{chunk-7QDX2CO4.cjs.map → chunk-TP6PLDNM.cjs.map} +1 -1
- package/dist/{chunk-JLTXVW25.cjs → chunk-TT6XV6WM.cjs} +17 -17
- package/dist/{chunk-JLTXVW25.cjs.map → chunk-TT6XV6WM.cjs.map} +1 -1
- package/dist/{chunk-HSFLEVZY.js → chunk-UMIY4SQS.js} +6 -6
- package/dist/{chunk-HSFLEVZY.js.map → chunk-UMIY4SQS.js.map} +1 -1
- package/dist/{chunk-ECERC6TI.js → chunk-VHJHY7TT.js} +3 -3
- package/dist/{chunk-ECERC6TI.js.map → chunk-VHJHY7TT.js.map} +1 -1
- package/dist/{chunk-D3N67Q4D.js → chunk-W3VYZXNS.js} +3 -3
- package/dist/{chunk-D3N67Q4D.js.map → chunk-W3VYZXNS.js.map} +1 -1
- package/dist/{chunk-JK45LSIH.cjs → chunk-WXYQ66KC.cjs} +5 -5
- package/dist/{chunk-JK45LSIH.cjs.map → chunk-WXYQ66KC.cjs.map} +1 -1
- package/dist/{chunk-ZCF2JJFA.js → chunk-Y3KA6X7B.js} +3 -3
- package/dist/{chunk-ZCF2JJFA.js.map → chunk-Y3KA6X7B.js.map} +1 -1
- package/dist/{chunk-GYCQ3FNL.js → chunk-YBLIKTJK.js} +2 -2
- package/dist/chunk-YBLIKTJK.js.map +1 -0
- package/dist/chunk-YNIBUKV5.js +163 -0
- package/dist/chunk-YNIBUKV5.js.map +1 -0
- package/dist/citations/index.cjs +12 -11
- package/dist/citations/index.js +3 -2
- package/dist/collaboration/index.cjs +42 -42
- package/dist/collaboration/index.js +2 -2
- package/dist/connect/docx.cjs +7 -5
- package/dist/connect/docx.cjs.map +1 -1
- package/dist/connect/docx.js +6 -4
- package/dist/connect/docx.js.map +1 -1
- package/dist/connect/index.cjs +237 -194
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -1
- package/dist/connect/index.js +190 -147
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectedSettings.d.ts +46 -20
- package/dist/connection/ConnectionProvider.d.ts +5 -0
- package/dist/connection/mail/ConnectedMailComposer.d.ts +2 -3
- package/dist/connection/mail/ConnectedMailbox.d.ts +2 -3
- package/dist/connection/mail/MailComposerForm.d.ts +2 -3
- package/dist/connection/mail/index.d.ts +2 -2
- package/dist/connection/mail/mailbox.d.ts +1 -4
- package/dist/connection/mail/types.d.ts +0 -8
- package/dist/facts/fact-citations.d.ts +56 -0
- package/dist/facts/fact-table-column-resize.d.ts +18 -0
- package/dist/facts/index.cjs +197 -10
- package/dist/facts/index.cjs.map +1 -1
- package/dist/facts/index.d.ts +2 -0
- package/dist/facts/index.js +182 -6
- package/dist/facts/index.js.map +1 -1
- package/dist/files/index.cjs +4 -4
- package/dist/files/index.js +3 -3
- package/dist/home/index.cjs +20 -19
- package/dist/home/index.cjs.map +1 -1
- package/dist/home/index.js +5 -4
- package/dist/home/index.js.map +1 -1
- package/dist/index.cjs +485 -469
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -13
- package/dist/provider/BlocksProvider.d.ts +39 -4
- package/dist/provider/dialogs.d.ts +31 -0
- package/dist/retrieval/index.cjs +5 -4
- package/dist/retrieval/index.js +3 -2
- package/dist/settings/MoreInfo.d.ts +25 -0
- package/dist/settings/PlanCard.d.ts +1 -1
- package/dist/settings/index.cjs +106 -252
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.d.ts +1 -1
- package/dist/settings/index.js +71 -216
- package/dist/settings/index.js.map +1 -1
- package/dist/shell/index.cjs +48 -47
- package/dist/shell/index.js +4 -3
- package/dist/studio/index.cjs +15 -14
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +7 -6
- package/dist/studio/index.js.map +1 -1
- package/dist/workflow-canvas/index.cjs +14 -14
- package/dist/workflow-canvas/index.js +6 -6
- package/dist/workspaces/index.cjs +3 -3
- package/dist/workspaces/index.js +2 -2
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +9 -4
- package/dist/chunk-3BJLNKOB.cjs.map +0 -1
- package/dist/chunk-76JDDMSP.js +0 -31
- package/dist/chunk-76JDDMSP.js.map +0 -1
- package/dist/chunk-A7NCSZAP.cjs.map +0 -1
- package/dist/chunk-C54XEN5T.cjs +0 -34
- package/dist/chunk-C54XEN5T.cjs.map +0 -1
- package/dist/chunk-CJBN5HIS.js.map +0 -1
- package/dist/chunk-DZYAAL4H.cjs.map +0 -1
- package/dist/chunk-GYCQ3FNL.js.map +0 -1
- package/dist/chunk-H2KQ6OSU.js.map +0 -1
- package/dist/chunk-IBZJYCYM.js.map +0 -1
- package/dist/chunk-MUMH3Z6K.cjs.map +0 -1
- package/dist/chunk-OYMWV45N.js.map +0 -1
- package/dist/chunk-SWQX6CTT.cjs.map +0 -1
- package/dist/settings/FirmPool.d.ts +0 -82
package/dist/connect/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { FilesFilterBar, FolderFilterButton, FolderPickerRow } from '../chunk-7RJTEWYM.js';
|
|
3
|
-
import { SettingsSection, ProfileCard, AvatarPicker, IdentityVerificationCard, IdentityVerificationDialog, RequireVerified, SettingsCard, SettingsActionRow,
|
|
4
|
-
import { useWorkspaceDocs } from '../chunk-
|
|
5
|
-
export { ConnectedAssistantDock, redlineStats, textToArtifact, toRedlineMarkdown, useConnectedAiTask, useConnectedChat, useSemanticSearch, useWorkspaceDocs } from '../chunk-
|
|
6
|
-
import { ConnectedNativeDocxEditor } from '../chunk-
|
|
7
|
-
import { ConnectionProvider, useConnection } from '../chunk-
|
|
8
|
-
export { ConnectionProvider, SESSION_EXPIRED_MESSAGE, isAuthenticated, useConnection } from '../chunk-
|
|
3
|
+
import { SettingsSection, ProfileCard, AvatarPicker, IdentityVerificationCard, IdentityVerificationDialog, RequireVerified, PasswordChangeDialog, SettingsCard, SettingsActionRow, EMAIL_NOTIFICATION_KEYS, EMAIL_NOTIFICATION_CATEGORIES, NotificationCategoryList, toNotificationCategories, toActiveSessionViews, SettingsRow, ActiveSessionsDialog, LogoutDialog, toLogoutSessionViews, SettingsDangerZone, DeleteAccountDialog, toDeleteBlockerViews } from '../chunk-OQ7RUNOC.js';
|
|
4
|
+
import { useWorkspaceDocs } from '../chunk-QYTYW74G.js';
|
|
5
|
+
export { ConnectedAssistantDock, redlineStats, textToArtifact, toRedlineMarkdown, useConnectedAiTask, useConnectedChat, useSemanticSearch, useWorkspaceDocs } from '../chunk-QYTYW74G.js';
|
|
6
|
+
import { ConnectedNativeDocxEditor } from '../chunk-4UMXQPNA.js';
|
|
7
|
+
import { ConnectionProvider, useConnection } from '../chunk-4RLCRFZS.js';
|
|
8
|
+
export { ConnectionProvider, SESSION_EXPIRED_MESSAGE, isAuthenticated, useConnection } from '../chunk-4RLCRFZS.js';
|
|
9
9
|
import { SignDocumentDialog } from '../chunk-2YOVK524.js';
|
|
10
10
|
import '../chunk-GYAUJ4KT.js';
|
|
11
11
|
import '../chunk-2FL7QJKJ.js';
|
|
@@ -22,28 +22,29 @@ import '../chunk-N5YEF3LC.js';
|
|
|
22
22
|
import '../chunk-XD2M6LIG.js';
|
|
23
23
|
import { StreamedArtifactFrame } from '../chunk-LOJVUGBJ.js';
|
|
24
24
|
import '../chunk-VILAPTCB.js';
|
|
25
|
-
import { ConfirmDialog } from '../chunk-
|
|
26
|
-
import { ModalScaffold } from '../chunk-TX2ZICS7.js';
|
|
25
|
+
import { ConfirmDialog } from '../chunk-VHJHY7TT.js';
|
|
27
26
|
import { TabHeader } from '../chunk-4WWM3GQ5.js';
|
|
28
27
|
import { ChatPage } from '../chunk-PUCY3UXN.js';
|
|
29
28
|
import '../chunk-7XF5SFJ2.js';
|
|
30
|
-
import { takeOpenDocumentForTurn, useRegisterOpenDocument } from '../chunk-
|
|
29
|
+
import { takeOpenDocumentForTurn, useRegisterOpenDocument } from '../chunk-YBLIKTJK.js';
|
|
31
30
|
import { splitDocRef, stepLevels, stepDocuments, stepKindOf, initialRunInputs, workflowSteps, stepStatesFromActivity, runThreadTitle, stepFields } from '../chunk-2DFDFOM7.js';
|
|
32
31
|
import '../chunk-AUS3KBHJ.js';
|
|
33
32
|
import '../chunk-AA3PT6KR.js';
|
|
34
33
|
import '../chunk-SLSBJRWW.js';
|
|
35
34
|
import '../chunk-NPLYHR2E.js';
|
|
36
35
|
import '../chunk-7F6CBP3Z.js';
|
|
36
|
+
import { useBlocksEnvironment } from '../chunk-YNIBUKV5.js';
|
|
37
|
+
import { ModalScaffold } from '../chunk-TX2ZICS7.js';
|
|
37
38
|
import { initials } from '../chunk-OXF2IFXG.js';
|
|
38
39
|
import '../chunk-VUNV25KB.js';
|
|
39
40
|
import { lazy, useState, useMemo, Suspense, useEffect, useRef, useCallback, useLayoutEffect } from 'react';
|
|
40
41
|
import { QueryClient, QueryClientProvider, useQueryClient, useQuery } from '@tanstack/react-query';
|
|
41
|
-
import { ArbiProvider, useConversations, useRunConversation, useWorkspaceActivity, useWorkspaceUsers, useWorkspaceNotificationLevel, useFollowThread, useUploadSkillFiles, ArtifactCanvas, useArbiChat, useArbi, useDocuments, useTagKindSchema, useTags, useSetTagValues, useUpdateTagKindSchema, useInvalidateTagData, useWorkspaces, useShellWorkspaces, useProfile, useUpdateProfile, useRequestEmailChange, useConfirmEmailChange, useNameEditor, useAvatarCrop, useEmailChange, ImageCropModal, useIdentityVerification, usePasswordChange, usePasswordChangeForm, useNotificationPreferences, useSessions, useCurrentSessionId, useTerminateSession,
|
|
42
|
+
import { ArbiProvider, useConversations, useRunConversation, useWorkspaceActivity, useWorkspaceUsers, useWorkspaceNotificationLevel, useFollowThread, useUploadSkillFiles, ArtifactCanvas, useArbiChat, useArbi, useDocuments, useTagKindSchema, useTags, useSetTagValues, useUpdateTagKindSchema, useInvalidateTagData, useWorkspaces, useShellWorkspaces, useProfile, useUpdateProfile, useRequestEmailChange, useConfirmEmailChange, useNameEditor, useAvatarCrop, useEmailChange, ImageCropModal, useIdentityVerification, usePasswordChange, usePasswordChangeForm, useNotificationPreferences, useSessions, useCurrentSessionId, useTerminateSession, useSignOut, useDeleteAccount, useDeleteAccountFlow, useArbiWebSocket, useWorkNotifications, mailDraftIdFromContent, useMailClient, defaultMailAlias, useClaimNativeAlias, useMailOnline, useConnectMailAccount, useDisconnectMailAccount, useMailPolicy, useMailAccounts, useMailUnlock, useMailFolders, useMailMessages, useMailDraftCompose, useMailMessage, useMailCache, MailOfflineUnavailableError, accountPath, useAgentSession, useStartAgentSession, useCloseAgentSession, isAliasTakenError, nextAliasSuggestion, aliasTakenMessage, mailJson, ArbiWebSocketProvider, useCreateWork, useActOnStep, useConversationActivity, useConversationThreads, fileAttachment, useMailProjects, useSaveMailDraft, useSendMail, useMailDraftReplaced, AiAnswer, useMailDraftEditor } from '@arbidocs/react';
|
|
42
43
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
43
44
|
import { Button, Label, Input, Dialog, DialogContent, DialogTitle, DialogDescription, Tooltip, TooltipTrigger, TooltipContent, cn } from '@arbidocs/react/ui';
|
|
44
45
|
import { useStreamedArtifact } from '@arbidocs/react/artifacts';
|
|
45
46
|
import { ExternalLink, UserCircle, KeyRound, Radio, Mail, Settings, Plus, ArrowLeft, Loader2, X, Paperclip, Send, MessageSquare } from 'lucide-react';
|
|
46
|
-
import { useOptionalDocumentTools, fetchDocumentPdf, DocumentToolsProvider } from '@arbidocs/react/document-tools';
|
|
47
|
+
import { useIsOnline, useOptionalDocumentTools, fetchDocumentPdf, DocumentToolsProvider } from '@arbidocs/react/document-tools';
|
|
47
48
|
import { useNotify } from '@arbidocs/react/shell';
|
|
48
49
|
import { bytesToBase64 } from '@arbidocs/client';
|
|
49
50
|
import { createPortal } from 'react-dom';
|
|
@@ -1320,21 +1321,25 @@ var AVATAR_PROBLEMS = {
|
|
|
1320
1321
|
"too-large": "Image must be 5 MB or smaller",
|
|
1321
1322
|
unreadable: "Couldn't read that image \u2014 try a different file"
|
|
1322
1323
|
};
|
|
1323
|
-
function ConnectedProfileCard({
|
|
1324
|
+
function ConnectedProfileCard({
|
|
1325
|
+
title = "Profile",
|
|
1326
|
+
avatarClassName = "bg-primary text-primary-foreground",
|
|
1327
|
+
children
|
|
1328
|
+
}) {
|
|
1329
|
+
const { notify } = useBlocksEnvironment();
|
|
1324
1330
|
const { data: profile } = useProfile();
|
|
1325
1331
|
const updateProfile = useUpdateProfile();
|
|
1326
1332
|
const requestEmailChange = useRequestEmailChange();
|
|
1327
1333
|
const confirmEmailChange = useConfirmEmailChange();
|
|
1328
|
-
const { user } = useConnection();
|
|
1329
1334
|
const name = useNameEditor({
|
|
1330
1335
|
givenName: profile?.givenName,
|
|
1331
1336
|
familyName: profile?.familyName,
|
|
1332
1337
|
save: async (next) => {
|
|
1333
1338
|
try {
|
|
1334
1339
|
await updateProfile.mutateAsync(next);
|
|
1335
|
-
|
|
1340
|
+
notify("Name updated", "success");
|
|
1336
1341
|
} catch (e) {
|
|
1337
|
-
|
|
1342
|
+
notify("Failed to update name", "error");
|
|
1338
1343
|
throw e;
|
|
1339
1344
|
}
|
|
1340
1345
|
}
|
|
@@ -1343,89 +1348,96 @@ function ConnectedProfileCard({ notify: notify3, title = "Profile" }) {
|
|
|
1343
1348
|
upload: async (picture) => {
|
|
1344
1349
|
try {
|
|
1345
1350
|
await updateProfile.mutateAsync({ picture });
|
|
1346
|
-
|
|
1351
|
+
notify("Profile picture updated", "success");
|
|
1347
1352
|
} catch (e) {
|
|
1348
|
-
|
|
1353
|
+
notify("Failed to update picture", "error");
|
|
1349
1354
|
throw e;
|
|
1350
1355
|
}
|
|
1351
1356
|
},
|
|
1352
|
-
onProblem: (problem) =>
|
|
1357
|
+
onProblem: (problem) => notify(AVATAR_PROBLEMS[problem], "error")
|
|
1353
1358
|
});
|
|
1354
1359
|
const email = useEmailChange({
|
|
1355
1360
|
requestCode: async (address) => {
|
|
1356
1361
|
try {
|
|
1357
1362
|
await requestEmailChange.mutateAsync(address);
|
|
1358
|
-
|
|
1363
|
+
notify("Verification code sent to your new email", "success");
|
|
1359
1364
|
} catch (e) {
|
|
1360
|
-
|
|
1365
|
+
notify(errorText(e, "Failed to send verification code"), "error");
|
|
1361
1366
|
throw e;
|
|
1362
1367
|
}
|
|
1363
1368
|
},
|
|
1364
1369
|
confirm: async (args) => {
|
|
1365
1370
|
try {
|
|
1366
1371
|
await confirmEmailChange.mutateAsync(args);
|
|
1367
|
-
|
|
1372
|
+
notify("Email address updated", "success");
|
|
1368
1373
|
} catch (e) {
|
|
1369
|
-
|
|
1374
|
+
notify(errorText(e, "Invalid or expired verification code"), "error");
|
|
1370
1375
|
throw e;
|
|
1371
1376
|
}
|
|
1372
1377
|
}
|
|
1373
1378
|
});
|
|
1374
|
-
const display = profile?.fullName ||
|
|
1375
|
-
return /* @__PURE__ */
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
/* @__PURE__ */
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1379
|
+
const display = profile?.fullName || "Unnamed";
|
|
1380
|
+
return /* @__PURE__ */ jsxs(SettingsSection, { icon: /* @__PURE__ */ jsx(UserCircle, {}), title, children: [
|
|
1381
|
+
/* @__PURE__ */ jsx(
|
|
1382
|
+
ProfileCard,
|
|
1383
|
+
{
|
|
1384
|
+
avatar: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1385
|
+
/* @__PURE__ */ jsx(
|
|
1386
|
+
AvatarPicker,
|
|
1387
|
+
{
|
|
1388
|
+
pictureUrl: profile?.picture,
|
|
1389
|
+
initials: initials(display),
|
|
1390
|
+
fallbackClassName: avatarClassName,
|
|
1391
|
+
isUploading: avatar.isUploading,
|
|
1392
|
+
onFileChosen: avatar.onFileChosen
|
|
1393
|
+
}
|
|
1394
|
+
),
|
|
1395
|
+
/* @__PURE__ */ jsx(
|
|
1396
|
+
ImageCropModal,
|
|
1397
|
+
{
|
|
1398
|
+
open: avatar.pendingImage !== null,
|
|
1399
|
+
image: avatar.pendingImage,
|
|
1400
|
+
title: "Crop your photo",
|
|
1401
|
+
aspect: 1,
|
|
1402
|
+
cropShape: "round",
|
|
1403
|
+
output: { maxSize: 128, mimeType: "image/jpeg", quality: 0.85 },
|
|
1404
|
+
onComplete: avatar.onCropComplete,
|
|
1405
|
+
onCancel: avatar.onCropCancel
|
|
1406
|
+
}
|
|
1407
|
+
)
|
|
1408
|
+
] }),
|
|
1409
|
+
name: { ...name, display, isSaving: name.isSaving },
|
|
1410
|
+
email: profile?.email ?? "",
|
|
1411
|
+
isSso: profile?.isSso ?? false,
|
|
1412
|
+
isVerified: profile?.isIdentityVerified ?? false,
|
|
1413
|
+
onStartEmailChange: email.onStart,
|
|
1414
|
+
emailChange: email.isOpen ? email : void 0
|
|
1415
|
+
}
|
|
1416
|
+
),
|
|
1417
|
+
children
|
|
1418
|
+
] });
|
|
1411
1419
|
}
|
|
1412
1420
|
function ConnectedIdentityVerification({
|
|
1413
|
-
|
|
1414
|
-
|
|
1421
|
+
labels,
|
|
1422
|
+
onManageBilling,
|
|
1423
|
+
formatPrice
|
|
1415
1424
|
}) {
|
|
1425
|
+
const { notify } = useBlocksEnvironment();
|
|
1416
1426
|
const { data: profile } = useProfile();
|
|
1417
1427
|
const flow = useIdentityVerification({
|
|
1418
|
-
|
|
1419
|
-
|
|
1428
|
+
formatPrice,
|
|
1429
|
+
onVerifiedChange: (verified) => notify(verified ? "Identity verified" : "Verified tick removed", "success"),
|
|
1430
|
+
onNameAccepted: () => notify("Name updated to match your ID", "success")
|
|
1420
1431
|
});
|
|
1421
1432
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1422
|
-
/* @__PURE__ */ jsx(IdentityVerificationCard, { flow, labels }),
|
|
1433
|
+
/* @__PURE__ */ jsx(IdentityVerificationCard, { flow, labels, onManageBilling }),
|
|
1423
1434
|
/* @__PURE__ */ jsx(
|
|
1424
1435
|
IdentityVerificationDialog,
|
|
1425
1436
|
{
|
|
1426
1437
|
flow,
|
|
1427
1438
|
accountName: profile?.fullName ?? "",
|
|
1428
|
-
labels
|
|
1439
|
+
labels,
|
|
1440
|
+
onManageBilling
|
|
1429
1441
|
}
|
|
1430
1442
|
)
|
|
1431
1443
|
] });
|
|
@@ -1443,21 +1455,55 @@ function defaultUnmetPasswordRequirement(password) {
|
|
|
1443
1455
|
if (!/[0-9]/.test(password)) return "At least one number";
|
|
1444
1456
|
return null;
|
|
1445
1457
|
}
|
|
1446
|
-
function
|
|
1447
|
-
|
|
1458
|
+
function ConnectedPasswordChangeDialog({
|
|
1459
|
+
open,
|
|
1460
|
+
onClose,
|
|
1448
1461
|
getUnmetRequirement = defaultUnmetPasswordRequirement,
|
|
1449
|
-
|
|
1462
|
+
recoveryMode = false,
|
|
1463
|
+
onRecoveryComplete
|
|
1450
1464
|
}) {
|
|
1451
|
-
const
|
|
1465
|
+
const { notify } = useBlocksEnvironment();
|
|
1452
1466
|
const change = usePasswordChange();
|
|
1453
1467
|
const form = usePasswordChangeForm({
|
|
1468
|
+
recoveryMode,
|
|
1454
1469
|
getUnmetRequirement,
|
|
1455
1470
|
submit: async (vars) => {
|
|
1456
1471
|
await change.mutateAsync(vars);
|
|
1457
|
-
|
|
1472
|
+
notify(
|
|
1473
|
+
recoveryMode ? "Account recovered and password set successfully" : "Password changed successfully",
|
|
1474
|
+
"success"
|
|
1475
|
+
);
|
|
1458
1476
|
},
|
|
1459
|
-
onClose
|
|
1477
|
+
onClose,
|
|
1478
|
+
onRecoveryComplete
|
|
1460
1479
|
});
|
|
1480
|
+
return /* @__PURE__ */ jsx(
|
|
1481
|
+
PasswordChangeDialog,
|
|
1482
|
+
{
|
|
1483
|
+
open,
|
|
1484
|
+
onClose: form.onCancel,
|
|
1485
|
+
recoveryMode,
|
|
1486
|
+
currentPassword: form.currentPassword,
|
|
1487
|
+
onCurrentPasswordChange: form.onCurrentPasswordChange,
|
|
1488
|
+
newPassword: form.newPassword,
|
|
1489
|
+
onNewPasswordChange: form.onNewPasswordChange,
|
|
1490
|
+
confirmPassword: form.confirmPassword,
|
|
1491
|
+
onConfirmPasswordChange: form.onConfirmPasswordChange,
|
|
1492
|
+
getUnmetRequirement,
|
|
1493
|
+
error: form.error,
|
|
1494
|
+
isProcessing: form.isProcessing,
|
|
1495
|
+
isSubmitDisabled: form.isSubmitDisabled,
|
|
1496
|
+
onSubmit: form.onSubmit,
|
|
1497
|
+
isChanged: form.isChanged,
|
|
1498
|
+
onDone: form.onDone
|
|
1499
|
+
}
|
|
1500
|
+
);
|
|
1501
|
+
}
|
|
1502
|
+
function ConnectedSecuritySection({
|
|
1503
|
+
getUnmetRequirement,
|
|
1504
|
+
children
|
|
1505
|
+
}) {
|
|
1506
|
+
const [open, setOpen] = useState(false);
|
|
1461
1507
|
return /* @__PURE__ */ jsxs(SettingsSection, { icon: /* @__PURE__ */ jsx(KeyRound, {}), title: "Security", children: [
|
|
1462
1508
|
/* @__PURE__ */ jsxs(SettingsCard, { padding: "sm", children: [
|
|
1463
1509
|
/* @__PURE__ */ jsx(
|
|
@@ -1472,24 +1518,11 @@ function ConnectedSecuritySection({
|
|
|
1472
1518
|
children
|
|
1473
1519
|
] }),
|
|
1474
1520
|
/* @__PURE__ */ jsx(
|
|
1475
|
-
|
|
1521
|
+
ConnectedPasswordChangeDialog,
|
|
1476
1522
|
{
|
|
1477
1523
|
open,
|
|
1478
|
-
onClose:
|
|
1479
|
-
|
|
1480
|
-
currentPassword: form.currentPassword,
|
|
1481
|
-
onCurrentPasswordChange: form.onCurrentPasswordChange,
|
|
1482
|
-
newPassword: form.newPassword,
|
|
1483
|
-
onNewPasswordChange: form.onNewPasswordChange,
|
|
1484
|
-
confirmPassword: form.confirmPassword,
|
|
1485
|
-
onConfirmPasswordChange: form.onConfirmPasswordChange,
|
|
1486
|
-
getUnmetRequirement,
|
|
1487
|
-
error: form.error,
|
|
1488
|
-
isProcessing: form.isProcessing,
|
|
1489
|
-
isSubmitDisabled: form.isSubmitDisabled,
|
|
1490
|
-
onSubmit: form.onSubmit,
|
|
1491
|
-
isChanged: form.isChanged,
|
|
1492
|
-
onDone: form.onDone
|
|
1524
|
+
onClose: () => setOpen(false),
|
|
1525
|
+
getUnmetRequirement
|
|
1493
1526
|
}
|
|
1494
1527
|
)
|
|
1495
1528
|
] });
|
|
@@ -1516,11 +1549,8 @@ function ConnectedNotificationPreferences({
|
|
|
1516
1549
|
}
|
|
1517
1550
|
) }) });
|
|
1518
1551
|
}
|
|
1519
|
-
function ConnectedSessionsRow({
|
|
1520
|
-
notify
|
|
1521
|
-
confirm,
|
|
1522
|
-
renderSessionIcon
|
|
1523
|
-
}) {
|
|
1552
|
+
function ConnectedSessionsRow({ renderSessionIcon }) {
|
|
1553
|
+
const { notify, confirm } = useBlocksEnvironment();
|
|
1524
1554
|
const [open, setOpen] = useState(false);
|
|
1525
1555
|
const sessions = useSessions({ enabled: open });
|
|
1526
1556
|
const currentSessionId = useCurrentSessionId();
|
|
@@ -1564,14 +1594,15 @@ function ConnectedSessionsRow({
|
|
|
1564
1594
|
void (async () => {
|
|
1565
1595
|
const view = views.find((v) => v.id === id);
|
|
1566
1596
|
const label = view?.detail.split(" \xB7 ")[0];
|
|
1567
|
-
const ok = await confirm
|
|
1568
|
-
|
|
1569
|
-
|
|
1597
|
+
const ok = await confirm({
|
|
1598
|
+
title: "End session",
|
|
1599
|
+
message: `End the session on ${label}? It will be signed out immediately.`
|
|
1600
|
+
});
|
|
1570
1601
|
if (!ok) return;
|
|
1571
1602
|
try {
|
|
1572
1603
|
await terminate.mutateAsync(id);
|
|
1573
1604
|
} catch {
|
|
1574
|
-
|
|
1605
|
+
notify("Failed to end session. Please try again.", "error");
|
|
1575
1606
|
}
|
|
1576
1607
|
})();
|
|
1577
1608
|
}
|
|
@@ -1582,43 +1613,46 @@ function ConnectedSessionsRow({
|
|
|
1582
1613
|
function ConnectedLogoutDialog({
|
|
1583
1614
|
open,
|
|
1584
1615
|
onClose,
|
|
1585
|
-
|
|
1616
|
+
canLogoutAll = true,
|
|
1617
|
+
confirmSignOut,
|
|
1586
1618
|
renderSessionIcon
|
|
1587
1619
|
}) {
|
|
1588
|
-
const { logout } = useConnection();
|
|
1589
1620
|
const sessions = useSessions({ enabled: open });
|
|
1590
|
-
const
|
|
1621
|
+
const signOut = useSignOut();
|
|
1622
|
+
const isOnline = useIsOnline();
|
|
1623
|
+
const run = async (everywhere) => {
|
|
1624
|
+
onClose();
|
|
1625
|
+
if (confirmSignOut && !await confirmSignOut()) return;
|
|
1626
|
+
signOut.mutate({ everywhere, reason: "manual" });
|
|
1627
|
+
};
|
|
1591
1628
|
return /* @__PURE__ */ jsx(
|
|
1592
1629
|
LogoutDialog,
|
|
1593
1630
|
{
|
|
1594
1631
|
open,
|
|
1595
1632
|
onClose,
|
|
1596
|
-
onLogoutThis: () =>
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
},
|
|
1600
|
-
onLogoutAll: () => {
|
|
1601
|
-
onClose();
|
|
1602
|
-
void logoutAll.mutateAsync().finally(logout);
|
|
1603
|
-
},
|
|
1604
|
-
canLogoutAll: true,
|
|
1633
|
+
onLogoutThis: () => void run(false),
|
|
1634
|
+
onLogoutAll: () => void run(true),
|
|
1635
|
+
canLogoutAll,
|
|
1605
1636
|
isOnline,
|
|
1606
1637
|
sessions: toLogoutSessionViews(sessions.data ?? []),
|
|
1607
1638
|
renderSessionIcon
|
|
1608
1639
|
}
|
|
1609
1640
|
);
|
|
1610
1641
|
}
|
|
1611
|
-
function ConnectedDangerZone({
|
|
1642
|
+
function ConnectedDangerZone({ renderSubscriptionLink }) {
|
|
1643
|
+
const { notify } = useBlocksEnvironment();
|
|
1612
1644
|
const [zoneOpen, setZoneOpen] = useState(false);
|
|
1613
1645
|
const [dialogOpen, setDialogOpen] = useState(false);
|
|
1614
|
-
const {
|
|
1646
|
+
const { data: profile } = useProfile();
|
|
1647
|
+
const userEmail = profile?.email ?? "";
|
|
1615
1648
|
const remove = useDeleteAccount();
|
|
1649
|
+
const signOut = useSignOut();
|
|
1616
1650
|
const flow = useDeleteAccountFlow({
|
|
1617
|
-
userEmail
|
|
1651
|
+
userEmail,
|
|
1618
1652
|
remove: () => remove.mutateAsync(),
|
|
1619
1653
|
onClose: () => setDialogOpen(false),
|
|
1620
|
-
onDeleted:
|
|
1621
|
-
onError: () =>
|
|
1654
|
+
onDeleted: () => signOut.mutate({ reason: "account-deleted" }),
|
|
1655
|
+
onError: () => notify("Failed to delete account. Please try again.", "error")
|
|
1622
1656
|
});
|
|
1623
1657
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1624
1658
|
/* @__PURE__ */ jsx(
|
|
@@ -1633,7 +1667,7 @@ function ConnectedDangerZone({ notify: notify3, renderSubscriptionLink }) {
|
|
|
1633
1667
|
{
|
|
1634
1668
|
variant: "destructive",
|
|
1635
1669
|
size: "sm",
|
|
1636
|
-
disabled: !
|
|
1670
|
+
disabled: !userEmail,
|
|
1637
1671
|
onClick: () => setDialogOpen(true),
|
|
1638
1672
|
"data-testid": "delete-account-button",
|
|
1639
1673
|
children: "Delete Account"
|
|
@@ -1650,7 +1684,7 @@ function ConnectedDangerZone({ notify: notify3, renderSubscriptionLink }) {
|
|
|
1650
1684
|
blockers: toDeleteBlockerViews(flow.blockers, renderSubscriptionLink),
|
|
1651
1685
|
onContinue: flow.onContinue,
|
|
1652
1686
|
onBack: flow.onBack,
|
|
1653
|
-
userEmail
|
|
1687
|
+
userEmail,
|
|
1654
1688
|
confirmEmail: flow.confirmEmail,
|
|
1655
1689
|
onConfirmEmailChange: flow.onConfirmEmailChange,
|
|
1656
1690
|
isDeleting: flow.isDeleting,
|
|
@@ -1662,6 +1696,7 @@ function ConnectedDangerZone({ notify: notify3, renderSubscriptionLink }) {
|
|
|
1662
1696
|
function useConnectedDocxNotifications(onOpen) {
|
|
1663
1697
|
const arbi = useArbi();
|
|
1664
1698
|
const { status, user, apiUrl } = useConnection();
|
|
1699
|
+
const { notify } = useBlocksEnvironment();
|
|
1665
1700
|
const queries = useQueryClient();
|
|
1666
1701
|
const source = `docx-mentions:${apiUrl}:${user?.externalId || ""}`;
|
|
1667
1702
|
const queryKey = ["docx-mentions", apiUrl, user?.externalId];
|
|
@@ -1693,8 +1728,9 @@ function useConnectedDocxNotifications(onOpen) {
|
|
|
1693
1728
|
source,
|
|
1694
1729
|
onSelect: () => {
|
|
1695
1730
|
void Promise.resolve(onOpen({ documentId, commentId, workspaceId })).catch(
|
|
1696
|
-
(error) => notify
|
|
1697
|
-
error instanceof Error ? error.message : "Could not open the document."
|
|
1731
|
+
(error) => notify(
|
|
1732
|
+
error instanceof Error ? error.message : "Could not open the document.",
|
|
1733
|
+
"error"
|
|
1698
1734
|
)
|
|
1699
1735
|
);
|
|
1700
1736
|
}
|
|
@@ -1704,13 +1740,13 @@ function useConnectedDocxNotifications(onOpen) {
|
|
|
1704
1740
|
}
|
|
1705
1741
|
useNotify.getState().syncSource(source, items);
|
|
1706
1742
|
return () => useNotify.getState().syncSource(source, []);
|
|
1707
|
-
}, [data, status, user?.externalId, source, onOpen]);
|
|
1743
|
+
}, [data, status, user?.externalId, source, onOpen, notify]);
|
|
1708
1744
|
const markRead = async (ids) => {
|
|
1709
1745
|
try {
|
|
1710
1746
|
await arbi.notifications.markRead(ids);
|
|
1711
1747
|
await queries.invalidateQueries({ queryKey });
|
|
1712
1748
|
} catch {
|
|
1713
|
-
notify
|
|
1749
|
+
notify("Could not mark document mentions read.", "error");
|
|
1714
1750
|
}
|
|
1715
1751
|
};
|
|
1716
1752
|
return {
|
|
@@ -1726,6 +1762,7 @@ function useConnectedDocxNotifications(onOpen) {
|
|
|
1726
1762
|
}
|
|
1727
1763
|
function useConnectedWorkNotifications(onOpen) {
|
|
1728
1764
|
const { status, user, apiUrl } = useConnection();
|
|
1765
|
+
const { notify } = useBlocksEnvironment();
|
|
1729
1766
|
const source = `work-notifications:${apiUrl}:${user?.externalId || ""}`;
|
|
1730
1767
|
const { data = [], markRead: persistRead } = useWorkNotifications({
|
|
1731
1768
|
apiUrl,
|
|
@@ -1748,8 +1785,9 @@ function useConnectedWorkNotifications(onOpen) {
|
|
|
1748
1785
|
source,
|
|
1749
1786
|
onSelect: () => {
|
|
1750
1787
|
void Promise.resolve().then(() => onOpen(mapped.target)).catch(
|
|
1751
|
-
(error) => notify
|
|
1752
|
-
error instanceof Error ? error.message : "Could not open this notification."
|
|
1788
|
+
(error) => notify(
|
|
1789
|
+
error instanceof Error ? error.message : "Could not open this notification.",
|
|
1790
|
+
"error"
|
|
1753
1791
|
)
|
|
1754
1792
|
);
|
|
1755
1793
|
}
|
|
@@ -1757,13 +1795,13 @@ function useConnectedWorkNotifications(onOpen) {
|
|
|
1757
1795
|
}
|
|
1758
1796
|
useNotify.getState().syncSource(source, items);
|
|
1759
1797
|
return () => useNotify.getState().syncSource(source, []);
|
|
1760
|
-
}, [data, status, user?.externalId, source, onOpen]);
|
|
1798
|
+
}, [data, status, user?.externalId, source, onOpen, notify]);
|
|
1761
1799
|
const markRead = async (ids) => {
|
|
1762
1800
|
if (!ids.length) return;
|
|
1763
1801
|
try {
|
|
1764
1802
|
await persistRead(ids);
|
|
1765
1803
|
} catch {
|
|
1766
|
-
notify
|
|
1804
|
+
notify("Could not mark work notifications read.", "error");
|
|
1767
1805
|
}
|
|
1768
1806
|
};
|
|
1769
1807
|
return {
|
|
@@ -2171,16 +2209,16 @@ var NO_WORD = {
|
|
|
2171
2209
|
loadFonts: () => Promise.reject(new Error("No Word editor"))
|
|
2172
2210
|
}
|
|
2173
2211
|
};
|
|
2174
|
-
function notifySent(
|
|
2212
|
+
function notifySent(notify, result) {
|
|
2175
2213
|
const status = result && typeof result === "object" && "delivery_status" in result ? result.delivery_status : null;
|
|
2176
2214
|
if (status === "bounced")
|
|
2177
|
-
|
|
2215
|
+
notify("Email couldn't be delivered", "error", { description: "Open it in Sent to see why." });
|
|
2178
2216
|
else if (status === "partially_bounced")
|
|
2179
|
-
|
|
2217
|
+
notify("Email couldn't be delivered to every recipient", "error", {
|
|
2180
2218
|
description: "Open it in Sent to see which and why."
|
|
2181
2219
|
});
|
|
2182
|
-
else if (status === "delivered")
|
|
2183
|
-
else
|
|
2220
|
+
else if (status === "delivered") notify("Email delivered", "success");
|
|
2221
|
+
else notify("Email queued for delivery", "success");
|
|
2184
2222
|
}
|
|
2185
2223
|
function MailComposerForm({
|
|
2186
2224
|
account,
|
|
@@ -2197,13 +2235,13 @@ function MailComposerForm({
|
|
|
2197
2235
|
localDraftId: initialLocalDraftId,
|
|
2198
2236
|
offline,
|
|
2199
2237
|
documents,
|
|
2200
|
-
notify: notify3,
|
|
2201
2238
|
word,
|
|
2202
2239
|
sessionKey,
|
|
2203
2240
|
roomId,
|
|
2204
2241
|
headerSlot
|
|
2205
2242
|
}) {
|
|
2206
2243
|
const { client } = useMailClient();
|
|
2244
|
+
const { notify, confirm } = useBlocksEnvironment();
|
|
2207
2245
|
const [to, setTo] = useState(initial.to.map((r) => r.email).join("; "));
|
|
2208
2246
|
const [cc, setCc] = useState(initial.cc.map((r) => r.email).join("; "));
|
|
2209
2247
|
const [showCc, setShowCc] = useState(initial.cc.length > 0);
|
|
@@ -2338,7 +2376,7 @@ function MailComposerForm({
|
|
|
2338
2376
|
setWordPending(true);
|
|
2339
2377
|
try {
|
|
2340
2378
|
if (!secure) {
|
|
2341
|
-
notifySent(
|
|
2379
|
+
notifySent(notify, await wordBody.send({ ...value, request_id: requestId.current }));
|
|
2342
2380
|
onClose();
|
|
2343
2381
|
return;
|
|
2344
2382
|
}
|
|
@@ -2372,13 +2410,13 @@ function MailComposerForm({
|
|
|
2372
2410
|
{
|
|
2373
2411
|
onSuccess: (result) => {
|
|
2374
2412
|
if (result && typeof result === "object" && "onDevice" in result) {
|
|
2375
|
-
|
|
2413
|
+
notify("Saved to your Outbox", "info", {
|
|
2376
2414
|
description: "It will be sent automatically when you're back online."
|
|
2377
2415
|
});
|
|
2378
2416
|
onClose();
|
|
2379
2417
|
return;
|
|
2380
2418
|
}
|
|
2381
|
-
notifySent(
|
|
2419
|
+
notifySent(notify, result);
|
|
2382
2420
|
if (localDraftId) void offline?.deleteDraft(localDraftId);
|
|
2383
2421
|
onClose();
|
|
2384
2422
|
},
|
|
@@ -2425,9 +2463,14 @@ function MailComposerForm({
|
|
|
2425
2463
|
};
|
|
2426
2464
|
const close = () => {
|
|
2427
2465
|
if (busy) return;
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2466
|
+
const unsaved = !saved && (dirty || !draftId) && (text || subject || to || cc || bcc || attachments.length || bodyChanged);
|
|
2467
|
+
if (!unsaved) return onClose();
|
|
2468
|
+
void confirm({
|
|
2469
|
+
title: "Discard changes",
|
|
2470
|
+
message: "Close this message without saving your latest changes?"
|
|
2471
|
+
}).then((ok) => {
|
|
2472
|
+
if (ok) onClose();
|
|
2473
|
+
});
|
|
2431
2474
|
};
|
|
2432
2475
|
useEffect(() => {
|
|
2433
2476
|
if (closeRequestRef) closeRequestRef.current = close;
|
|
@@ -2528,8 +2571,12 @@ function MailComposerForm({
|
|
|
2528
2571
|
className: "h-7 shrink-0 text-xs",
|
|
2529
2572
|
disabled: busy,
|
|
2530
2573
|
onClick: () => {
|
|
2531
|
-
|
|
2532
|
-
|
|
2574
|
+
void confirm({
|
|
2575
|
+
title: "Load changes",
|
|
2576
|
+
message: "Discard your unsaved changes and load the changed draft?"
|
|
2577
|
+
}).then((ok) => {
|
|
2578
|
+
if (ok) onReload(replacedBy);
|
|
2579
|
+
});
|
|
2533
2580
|
},
|
|
2534
2581
|
children: "Load changes"
|
|
2535
2582
|
}
|
|
@@ -2780,9 +2827,8 @@ function MailComposerForm({
|
|
|
2780
2827
|
}
|
|
2781
2828
|
);
|
|
2782
2829
|
}
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
};
|
|
2830
|
+
|
|
2831
|
+
// src/connection/mail/mailbox.ts
|
|
2786
2832
|
function resolveMailbox(accounts, mailbox) {
|
|
2787
2833
|
if (!accounts) return void 0;
|
|
2788
2834
|
if (mailbox === "native") return accounts.find((a) => a.provider === "native");
|
|
@@ -2797,7 +2843,6 @@ function ConnectedMailComposer({
|
|
|
2797
2843
|
maxBytes: maxBytesProp,
|
|
2798
2844
|
ready: readyProp,
|
|
2799
2845
|
drafts: draftsProp,
|
|
2800
|
-
notify: notify3 = defaultMailNotify,
|
|
2801
2846
|
offline,
|
|
2802
2847
|
replyTo,
|
|
2803
2848
|
...rest
|
|
@@ -2851,7 +2896,6 @@ function ConnectedMailComposer({
|
|
|
2851
2896
|
maxBytes: maxBytesProp ?? policy.data?.max_attachment_bytes ?? DEFAULT_MAX_BYTES,
|
|
2852
2897
|
ready,
|
|
2853
2898
|
drafts: draftsProp ?? draftsList.data?.messages ?? [],
|
|
2854
|
-
notify: notify3,
|
|
2855
2899
|
offline,
|
|
2856
2900
|
onReload: setReloaded,
|
|
2857
2901
|
...rest
|
|
@@ -3043,9 +3087,9 @@ function ConnectedMailbox({
|
|
|
3043
3087
|
onViewerOpenChange,
|
|
3044
3088
|
gridState,
|
|
3045
3089
|
onGridStateChange,
|
|
3046
|
-
initialMessageId = null
|
|
3047
|
-
notify: notify3 = defaultMailNotify
|
|
3090
|
+
initialMessageId = null
|
|
3048
3091
|
}) {
|
|
3092
|
+
const { notify } = useBlocksEnvironment();
|
|
3049
3093
|
const cache = useMailCache();
|
|
3050
3094
|
const { client } = useMailClient();
|
|
3051
3095
|
const [savingToWorkspace, setSavingToWorkspace] = useState(false);
|
|
@@ -3259,7 +3303,7 @@ function ConnectedMailbox({
|
|
|
3259
3303
|
new File([await response.blob()], fileName, { type: "message/rfc822" })
|
|
3260
3304
|
);
|
|
3261
3305
|
setSavingToWorkspace(false);
|
|
3262
|
-
|
|
3306
|
+
notify(
|
|
3263
3307
|
"Email saved to workspace",
|
|
3264
3308
|
"success",
|
|
3265
3309
|
documentId && onOpenDocument ? { action: { label: "Open", onClick: () => onOpenDocument(documentId, workspaceId) } } : void 0
|
|
@@ -3528,7 +3572,6 @@ function ConnectedMailbox({
|
|
|
3528
3572
|
localDraftId: composeLocalDraftId,
|
|
3529
3573
|
offline,
|
|
3530
3574
|
documents,
|
|
3531
|
-
notify: notify3,
|
|
3532
3575
|
word,
|
|
3533
3576
|
sessionKey: `${mailboxKey}-${composeSession}`,
|
|
3534
3577
|
onChange: setCompose,
|
|
@@ -3782,6 +3825,6 @@ function ConnectedAgentChatPanel({
|
|
|
3782
3825
|
] });
|
|
3783
3826
|
}
|
|
3784
3827
|
|
|
3785
|
-
export { ArbiAppProvider, ConnectedAgentChatPanel, ConnectedDangerZone, ConnectedIdentityVerification, ConnectedLogoutDialog, ConnectedMailAccounts, ConnectedMailComposer, ConnectedMailMessage, ConnectedMailSetup, ConnectedMailbox, ConnectedNotificationPreferences, ConnectedProfileCard, ConnectedRequireVerified, ConnectedSecuritySection, ConnectedSessionsRow, ConnectedSkillUpload, ConnectedTagTable, ConnectedTaskAccessRequest, ConnectedThreadFollow, ConnectedWorkflowRunner, ConnectedWorkspaceActivity, ConnectedWorkspaceNotificationMenu, DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS, StreamedArtifact, WorkflowRunThread,
|
|
3828
|
+
export { ArbiAppProvider, ConnectedAgentChatPanel, ConnectedDangerZone, ConnectedIdentityVerification, ConnectedLogoutDialog, ConnectedMailAccounts, ConnectedMailComposer, ConnectedMailMessage, ConnectedMailSetup, ConnectedMailbox, ConnectedNotificationPreferences, ConnectedPasswordChangeDialog, ConnectedProfileCard, ConnectedRequireVerified, ConnectedSecuritySection, ConnectedSessionsRow, ConnectedSkillUpload, ConnectedTagTable, ConnectedTaskAccessRequest, ConnectedThreadFollow, ConnectedWorkflowRunner, ConnectedWorkspaceActivity, ConnectedWorkspaceNotificationMenu, DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS, StreamedArtifact, WorkflowRunThread, defaultUnmetPasswordRequirement, resolveMailbox, useConnectedDocxNotifications, useConnectedShellWorkspaces, useConnectedWorkNotifications };
|
|
3786
3829
|
//# sourceMappingURL=index.js.map
|
|
3787
3830
|
//# sourceMappingURL=index.js.map
|