@arbidocs/blocks 0.4.131 → 0.4.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/README.md +4 -3
  2. package/dist/agents/index.cjs +216 -216
  3. package/dist/agents/index.js +5 -5
  4. package/dist/calls/index.cjs +3 -3
  5. package/dist/calls/index.js +2 -2
  6. package/dist/chat/index.cjs +5 -5
  7. package/dist/chat/index.js +1 -1
  8. package/dist/chat/open-document.d.ts +5 -1
  9. package/dist/{chunk-DQCYCEDR.js → chunk-2Q7FDZAY.js} +3 -3
  10. package/dist/{chunk-DQCYCEDR.js.map → chunk-2Q7FDZAY.js.map} +1 -1
  11. package/dist/{chunk-P5ST47VY.js → chunk-3FFRYZKV.js} +3 -3
  12. package/dist/{chunk-P5ST47VY.js.map → chunk-3FFRYZKV.js.map} +1 -1
  13. package/dist/{chunk-S7PSMMRG.js → chunk-444XKG46.js} +3 -3
  14. package/dist/{chunk-S7PSMMRG.js.map → chunk-444XKG46.js.map} +1 -1
  15. package/dist/{chunk-ZV3BKLFY.cjs → chunk-44R3CCZT.cjs} +5 -5
  16. package/dist/{chunk-ZV3BKLFY.cjs.map → chunk-44R3CCZT.cjs.map} +1 -1
  17. package/dist/{chunk-7D4W3SAH.js → chunk-4RLCRFZS.js} +15 -12
  18. package/dist/chunk-4RLCRFZS.js.map +1 -0
  19. package/dist/{chunk-P5HOXWYL.js → chunk-4UMXQPNA.js} +20 -8
  20. package/dist/chunk-4UMXQPNA.js.map +1 -0
  21. package/dist/{chunk-OR4CO743.cjs → chunk-AAFX64WD.cjs} +3 -3
  22. package/dist/{chunk-OR4CO743.cjs.map → chunk-AAFX64WD.cjs.map} +1 -1
  23. package/dist/{chunk-LRD7BHAT.cjs → chunk-ARDHLU73.cjs} +13 -10
  24. package/dist/chunk-ARDHLU73.cjs.map +1 -0
  25. package/dist/{chunk-KLOSOT26.js → chunk-BMNNT27D.js} +6 -6
  26. package/dist/{chunk-KLOSOT26.js.map → chunk-BMNNT27D.js.map} +1 -1
  27. package/dist/chunk-C4WSHRR6.cjs +166 -0
  28. package/dist/chunk-C4WSHRR6.cjs.map +1 -0
  29. package/dist/{chunk-ZAVEMQ37.cjs → chunk-DWZXSPMB.cjs} +3 -3
  30. package/dist/{chunk-ZAVEMQ37.cjs.map → chunk-DWZXSPMB.cjs.map} +1 -1
  31. package/dist/{chunk-5HFPRI3W.js → chunk-FUTMU4FR.js} +3 -3
  32. package/dist/{chunk-5HFPRI3W.js.map → chunk-FUTMU4FR.js.map} +1 -1
  33. package/dist/{chunk-CDZVC32G.cjs → chunk-GZPTWHP5.cjs} +22 -10
  34. package/dist/chunk-GZPTWHP5.cjs.map +1 -0
  35. package/dist/{chunk-OUW6G4O2.cjs → chunk-HFGXA5CL.cjs} +4 -4
  36. package/dist/{chunk-OUW6G4O2.cjs.map → chunk-HFGXA5CL.cjs.map} +1 -1
  37. package/dist/{chunk-7KH4M3KY.cjs → chunk-HW2J4JMV.cjs} +8 -8
  38. package/dist/{chunk-7KH4M3KY.cjs.map → chunk-HW2J4JMV.cjs.map} +1 -1
  39. package/dist/{chunk-SWQX6CTT.cjs → chunk-JKB7WT7L.cjs} +2 -2
  40. package/dist/chunk-JKB7WT7L.cjs.map +1 -0
  41. package/dist/{chunk-S6BOINC4.cjs → chunk-OGBXV326.cjs} +7 -7
  42. package/dist/{chunk-S6BOINC4.cjs.map → chunk-OGBXV326.cjs.map} +1 -1
  43. package/dist/{chunk-DJM7DLCT.cjs → chunk-OPTBQSCV.cjs} +3 -3
  44. package/dist/{chunk-DJM7DLCT.cjs.map → chunk-OPTBQSCV.cjs.map} +1 -1
  45. package/dist/{chunk-GFYGYME3.js → chunk-OQ7RUNOC.js} +3 -3
  46. package/dist/{chunk-GFYGYME3.js.map → chunk-OQ7RUNOC.js.map} +1 -1
  47. package/dist/{chunk-W27VK32R.cjs → chunk-QUDCNT63.cjs} +17 -17
  48. package/dist/{chunk-W27VK32R.cjs.map → chunk-QUDCNT63.cjs.map} +1 -1
  49. package/dist/{chunk-OB5F4577.cjs → chunk-R26BK7YL.cjs} +4 -4
  50. package/dist/{chunk-OB5F4577.cjs.map → chunk-R26BK7YL.cjs.map} +1 -1
  51. package/dist/{chunk-A2YAC22G.js → chunk-RI6DZA5X.js} +3 -3
  52. package/dist/{chunk-A2YAC22G.js.map → chunk-RI6DZA5X.js.map} +1 -1
  53. package/dist/{chunk-7QDX2CO4.cjs → chunk-TP6PLDNM.cjs} +4 -4
  54. package/dist/{chunk-7QDX2CO4.cjs.map → chunk-TP6PLDNM.cjs.map} +1 -1
  55. package/dist/{chunk-ECERC6TI.js → chunk-VHJHY7TT.js} +3 -3
  56. package/dist/{chunk-ECERC6TI.js.map → chunk-VHJHY7TT.js.map} +1 -1
  57. package/dist/{chunk-D3N67Q4D.js → chunk-W3VYZXNS.js} +3 -3
  58. package/dist/{chunk-D3N67Q4D.js.map → chunk-W3VYZXNS.js.map} +1 -1
  59. package/dist/{chunk-JK45LSIH.cjs → chunk-WXYQ66KC.cjs} +5 -5
  60. package/dist/{chunk-JK45LSIH.cjs.map → chunk-WXYQ66KC.cjs.map} +1 -1
  61. package/dist/{chunk-ZCF2JJFA.js → chunk-Y3KA6X7B.js} +3 -3
  62. package/dist/{chunk-ZCF2JJFA.js.map → chunk-Y3KA6X7B.js.map} +1 -1
  63. package/dist/{chunk-GYCQ3FNL.js → chunk-YBLIKTJK.js} +2 -2
  64. package/dist/chunk-YBLIKTJK.js.map +1 -0
  65. package/dist/{chunk-DI35D756.js → chunk-YIF6SVSO.js} +4 -4
  66. package/dist/{chunk-DI35D756.js.map → chunk-YIF6SVSO.js.map} +1 -1
  67. package/dist/chunk-YNIBUKV5.js +163 -0
  68. package/dist/chunk-YNIBUKV5.js.map +1 -0
  69. package/dist/citations/index.cjs +12 -11
  70. package/dist/citations/index.js +3 -2
  71. package/dist/collaboration/index.cjs +42 -42
  72. package/dist/collaboration/index.js +2 -2
  73. package/dist/connect/docx.cjs +7 -5
  74. package/dist/connect/docx.cjs.map +1 -1
  75. package/dist/connect/docx.js +6 -4
  76. package/dist/connect/docx.js.map +1 -1
  77. package/dist/connect/index.cjs +129 -123
  78. package/dist/connect/index.cjs.map +1 -1
  79. package/dist/connect/index.d.ts +1 -1
  80. package/dist/connect/index.js +77 -70
  81. package/dist/connect/index.js.map +1 -1
  82. package/dist/connection/ConnectedSettings.d.ts +8 -17
  83. package/dist/connection/ConnectionProvider.d.ts +5 -0
  84. package/dist/connection/mail/ConnectedMailComposer.d.ts +2 -3
  85. package/dist/connection/mail/ConnectedMailbox.d.ts +2 -3
  86. package/dist/connection/mail/MailComposerForm.d.ts +2 -3
  87. package/dist/connection/mail/index.d.ts +2 -2
  88. package/dist/connection/mail/mailbox.d.ts +1 -4
  89. package/dist/connection/mail/types.d.ts +0 -8
  90. package/dist/facts/index.cjs +4 -3
  91. package/dist/facts/index.cjs.map +1 -1
  92. package/dist/facts/index.js +3 -2
  93. package/dist/facts/index.js.map +1 -1
  94. package/dist/files/index.cjs +4 -4
  95. package/dist/files/index.js +3 -3
  96. package/dist/home/index.cjs +20 -19
  97. package/dist/home/index.cjs.map +1 -1
  98. package/dist/home/index.js +5 -4
  99. package/dist/home/index.js.map +1 -1
  100. package/dist/index.cjs +330 -330
  101. package/dist/index.d.ts +2 -1
  102. package/dist/index.js +11 -11
  103. package/dist/provider/BlocksProvider.d.ts +39 -4
  104. package/dist/provider/dialogs.d.ts +31 -0
  105. package/dist/retrieval/index.cjs +5 -4
  106. package/dist/retrieval/index.js +3 -2
  107. package/dist/settings/index.cjs +38 -38
  108. package/dist/settings/index.js +4 -4
  109. package/dist/shell/index.cjs +48 -47
  110. package/dist/shell/index.js +4 -3
  111. package/dist/studio/index.cjs +15 -14
  112. package/dist/studio/index.cjs.map +1 -1
  113. package/dist/studio/index.js +7 -6
  114. package/dist/studio/index.js.map +1 -1
  115. package/dist/workflow-canvas/index.cjs +14 -14
  116. package/dist/workflow-canvas/index.js +6 -6
  117. package/dist/workspaces/index.cjs +3 -3
  118. package/dist/workspaces/index.js +2 -2
  119. package/node_modules/@arbidocs/coedit/package.json +1 -1
  120. package/package.json +4 -4
  121. package/dist/chunk-76JDDMSP.js +0 -31
  122. package/dist/chunk-76JDDMSP.js.map +0 -1
  123. package/dist/chunk-7D4W3SAH.js.map +0 -1
  124. package/dist/chunk-C54XEN5T.cjs +0 -34
  125. package/dist/chunk-C54XEN5T.cjs.map +0 -1
  126. package/dist/chunk-CDZVC32G.cjs.map +0 -1
  127. package/dist/chunk-GYCQ3FNL.js.map +0 -1
  128. package/dist/chunk-LRD7BHAT.cjs.map +0 -1
  129. package/dist/chunk-P5HOXWYL.js.map +0 -1
  130. package/dist/chunk-SWQX6CTT.cjs.map +0 -1
@@ -15,7 +15,7 @@ export { ConnectedWorkflowRunner, DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS, type
15
15
  export { WorkflowRunThread, type WorkflowRunThreadProps } from '../connection/WorkflowRunThread';
16
16
  export { ConnectedTagTable, type ConnectedTagTableProps } from '../connection/ConnectedTagTable';
17
17
  export { useConnectedShellWorkspaces, type UseConnectedShellWorkspacesOptions, } from '../connection/useConnectedShellWorkspaces';
18
- export { ConnectedProfileCard, ConnectedSecuritySection, ConnectedPasswordChangeDialog, ConnectedNotificationPreferences, ConnectedSessionsRow, ConnectedLogoutDialog, ConnectedDangerZone, ConnectedIdentityVerification, ConnectedRequireVerified, defaultUnmetPasswordRequirement, type SettingsNotify, type ConnectedProfileCardProps, type ConnectedSecuritySectionProps, type ConnectedPasswordChangeDialogProps, type ConnectedNotificationPreferencesProps, type ConnectedSessionsRowProps, type ConnectedLogoutDialogProps, type ConnectedDangerZoneProps, type ConnectedIdentityVerificationProps, type ConnectedRequireVerifiedProps, } from '../connection/ConnectedSettings';
18
+ export { ConnectedProfileCard, ConnectedSecuritySection, ConnectedPasswordChangeDialog, ConnectedNotificationPreferences, ConnectedSessionsRow, ConnectedLogoutDialog, ConnectedDangerZone, ConnectedIdentityVerification, ConnectedRequireVerified, defaultUnmetPasswordRequirement, type ConnectedProfileCardProps, type ConnectedSecuritySectionProps, type ConnectedPasswordChangeDialogProps, type ConnectedNotificationPreferencesProps, type ConnectedSessionsRowProps, type ConnectedLogoutDialogProps, type ConnectedDangerZoneProps, type ConnectedIdentityVerificationProps, type ConnectedRequireVerifiedProps, } from '../connection/ConnectedSettings';
19
19
  export { useConnectedDocxNotifications } from '../connection/useConnectedDocxNotifications';
20
20
  export { useConnectedWorkNotifications, type WorkNotificationTarget, } from '../connection/useConnectedWorkNotifications';
21
21
  export * from '../connection/mail';
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- 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-GFYGYME3.js';
3
- import { useWorkspaceDocs } from '../chunk-DI35D756.js';
4
- export { ConnectedAssistantDock, redlineStats, textToArtifact, toRedlineMarkdown, useConnectedAiTask, useConnectedChat, useSemanticSearch, useWorkspaceDocs } from '../chunk-DI35D756.js';
5
- import { ConnectedNativeDocxEditor } from '../chunk-P5HOXWYL.js';
6
- import { ConnectionProvider, useConnection } from '../chunk-7D4W3SAH.js';
7
- export { ConnectionProvider, SESSION_EXPIRED_MESSAGE, isAuthenticated, useConnection } from '../chunk-7D4W3SAH.js';
2
+ 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';
3
+ import { useWorkspaceDocs } from '../chunk-YIF6SVSO.js';
4
+ export { ConnectedAssistantDock, redlineStats, textToArtifact, toRedlineMarkdown, useConnectedAiTask, useConnectedChat, useSemanticSearch, useWorkspaceDocs } from '../chunk-YIF6SVSO.js';
5
+ import { ConnectedNativeDocxEditor } from '../chunk-4UMXQPNA.js';
6
+ import { ConnectionProvider, useConnection } from '../chunk-4RLCRFZS.js';
7
+ export { ConnectionProvider, SESSION_EXPIRED_MESSAGE, isAuthenticated, useConnection } from '../chunk-4RLCRFZS.js';
8
8
  import { SignDocumentDialog } from '../chunk-2YOVK524.js';
9
9
  import '../chunk-GYAUJ4KT.js';
10
10
  import '../chunk-2FL7QJKJ.js';
@@ -22,23 +22,24 @@ import { FilterInput } from '../chunk-YU2KUMGE.js';
22
22
  import '../chunk-N5YEF3LC.js';
23
23
  import { StreamedArtifactFrame } from '../chunk-LOJVUGBJ.js';
24
24
  import '../chunk-VILAPTCB.js';
25
- import { ConfirmDialog } from '../chunk-ECERC6TI.js';
25
+ import { ConfirmDialog } from '../chunk-VHJHY7TT.js';
26
26
  import { TabHeader } from '../chunk-4WWM3GQ5.js';
27
- import { ModalScaffold } from '../chunk-TX2ZICS7.js';
28
27
  import { ChatPage } from '../chunk-CXLVI3SB.js';
29
28
  import '../chunk-7XF5SFJ2.js';
30
- import { takeOpenDocumentForTurn, useRegisterOpenDocument } from '../chunk-GYCQ3FNL.js';
29
+ import { takeOpenDocumentForTurn, useRegisterOpenDocument } from '../chunk-YBLIKTJK.js';
31
30
  import { splitDocRef, stepLevels, stepDocuments, stepKindOf, initialRunInputs, workflowSteps, stepStatesFromActivity, runThreadTitle, stepFields } from '../chunk-7HAM7Y5U.js';
32
31
  import '../chunk-AA3PT6KR.js';
33
32
  import '../chunk-AUS3KBHJ.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, useSignOut, useDeleteAccount, useDeleteAccountFlow, useArbiWebSocket, notify, 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
+ 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';
@@ -1321,11 +1322,11 @@ var AVATAR_PROBLEMS = {
1321
1322
  unreadable: "Couldn't read that image \u2014 try a different file"
1322
1323
  };
1323
1324
  function ConnectedProfileCard({
1324
- notify: notify3,
1325
1325
  title = "Profile",
1326
1326
  avatarClassName = "bg-primary text-primary-foreground",
1327
1327
  children
1328
1328
  }) {
1329
+ const { notify } = useBlocksEnvironment();
1329
1330
  const { data: profile } = useProfile();
1330
1331
  const updateProfile = useUpdateProfile();
1331
1332
  const requestEmailChange = useRequestEmailChange();
@@ -1336,9 +1337,9 @@ function ConnectedProfileCard({
1336
1337
  save: async (next) => {
1337
1338
  try {
1338
1339
  await updateProfile.mutateAsync(next);
1339
- notify3?.("Name updated", "success");
1340
+ notify("Name updated", "success");
1340
1341
  } catch (e) {
1341
- notify3?.("Failed to update name", "error");
1342
+ notify("Failed to update name", "error");
1342
1343
  throw e;
1343
1344
  }
1344
1345
  }
@@ -1347,30 +1348,30 @@ function ConnectedProfileCard({
1347
1348
  upload: async (picture) => {
1348
1349
  try {
1349
1350
  await updateProfile.mutateAsync({ picture });
1350
- notify3?.("Profile picture updated", "success");
1351
+ notify("Profile picture updated", "success");
1351
1352
  } catch (e) {
1352
- notify3?.("Failed to update picture", "error");
1353
+ notify("Failed to update picture", "error");
1353
1354
  throw e;
1354
1355
  }
1355
1356
  },
1356
- onProblem: (problem) => notify3?.(AVATAR_PROBLEMS[problem], "error")
1357
+ onProblem: (problem) => notify(AVATAR_PROBLEMS[problem], "error")
1357
1358
  });
1358
1359
  const email = useEmailChange({
1359
1360
  requestCode: async (address) => {
1360
1361
  try {
1361
1362
  await requestEmailChange.mutateAsync(address);
1362
- notify3?.("Verification code sent to your new email", "success");
1363
+ notify("Verification code sent to your new email", "success");
1363
1364
  } catch (e) {
1364
- notify3?.(errorText(e, "Failed to send verification code"), "error");
1365
+ notify(errorText(e, "Failed to send verification code"), "error");
1365
1366
  throw e;
1366
1367
  }
1367
1368
  },
1368
1369
  confirm: async (args) => {
1369
1370
  try {
1370
1371
  await confirmEmailChange.mutateAsync(args);
1371
- notify3?.("Email address updated", "success");
1372
+ notify("Email address updated", "success");
1372
1373
  } catch (e) {
1373
- notify3?.(errorText(e, "Invalid or expired verification code"), "error");
1374
+ notify(errorText(e, "Invalid or expired verification code"), "error");
1374
1375
  throw e;
1375
1376
  }
1376
1377
  }
@@ -1417,16 +1418,16 @@ function ConnectedProfileCard({
1417
1418
  ] });
1418
1419
  }
1419
1420
  function ConnectedIdentityVerification({
1420
- notify: notify3,
1421
1421
  labels,
1422
1422
  onManageBilling,
1423
1423
  formatPrice
1424
1424
  }) {
1425
+ const { notify } = useBlocksEnvironment();
1425
1426
  const { data: profile } = useProfile();
1426
1427
  const flow = useIdentityVerification({
1427
1428
  formatPrice,
1428
- onVerifiedChange: (verified) => notify3?.(verified ? "Identity verified" : "Verified tick removed", "success"),
1429
- onNameAccepted: () => notify3?.("Name updated to match your ID", "success")
1429
+ onVerifiedChange: (verified) => notify(verified ? "Identity verified" : "Verified tick removed", "success"),
1430
+ onNameAccepted: () => notify("Name updated to match your ID", "success")
1430
1431
  });
1431
1432
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1432
1433
  /* @__PURE__ */ jsx(IdentityVerificationCard, { flow, labels, onManageBilling }),
@@ -1457,18 +1458,18 @@ function defaultUnmetPasswordRequirement(password) {
1457
1458
  function ConnectedPasswordChangeDialog({
1458
1459
  open,
1459
1460
  onClose,
1460
- notify: notify3,
1461
1461
  getUnmetRequirement = defaultUnmetPasswordRequirement,
1462
1462
  recoveryMode = false,
1463
1463
  onRecoveryComplete
1464
1464
  }) {
1465
+ const { notify } = useBlocksEnvironment();
1465
1466
  const change = usePasswordChange();
1466
1467
  const form = usePasswordChangeForm({
1467
1468
  recoveryMode,
1468
1469
  getUnmetRequirement,
1469
1470
  submit: async (vars) => {
1470
1471
  await change.mutateAsync(vars);
1471
- notify3?.(
1472
+ notify(
1472
1473
  recoveryMode ? "Account recovered and password set successfully" : "Password changed successfully",
1473
1474
  "success"
1474
1475
  );
@@ -1499,7 +1500,6 @@ function ConnectedPasswordChangeDialog({
1499
1500
  );
1500
1501
  }
1501
1502
  function ConnectedSecuritySection({
1502
- notify: notify3,
1503
1503
  getUnmetRequirement,
1504
1504
  children
1505
1505
  }) {
@@ -1522,7 +1522,6 @@ function ConnectedSecuritySection({
1522
1522
  {
1523
1523
  open,
1524
1524
  onClose: () => setOpen(false),
1525
- notify: notify3,
1526
1525
  getUnmetRequirement
1527
1526
  }
1528
1527
  )
@@ -1550,11 +1549,8 @@ function ConnectedNotificationPreferences({
1550
1549
  }
1551
1550
  ) }) });
1552
1551
  }
1553
- function ConnectedSessionsRow({
1554
- notify: notify3,
1555
- confirm,
1556
- renderSessionIcon
1557
- }) {
1552
+ function ConnectedSessionsRow({ renderSessionIcon }) {
1553
+ const { notify, confirm } = useBlocksEnvironment();
1558
1554
  const [open, setOpen] = useState(false);
1559
1555
  const sessions = useSessions({ enabled: open });
1560
1556
  const currentSessionId = useCurrentSessionId();
@@ -1598,14 +1594,15 @@ function ConnectedSessionsRow({
1598
1594
  void (async () => {
1599
1595
  const view = views.find((v) => v.id === id);
1600
1596
  const label = view?.detail.split(" \xB7 ")[0];
1601
- const ok = await confirm?.(
1602
- `End the session on ${label}? It will be signed out immediately.`
1603
- ) ?? true;
1597
+ const ok = await confirm({
1598
+ title: "End session",
1599
+ message: `End the session on ${label}? It will be signed out immediately.`
1600
+ });
1604
1601
  if (!ok) return;
1605
1602
  try {
1606
1603
  await terminate.mutateAsync(id);
1607
1604
  } catch {
1608
- notify3?.("Failed to end session. Please try again.", "error");
1605
+ notify("Failed to end session. Please try again.", "error");
1609
1606
  }
1610
1607
  })();
1611
1608
  }
@@ -1642,7 +1639,8 @@ function ConnectedLogoutDialog({
1642
1639
  }
1643
1640
  );
1644
1641
  }
1645
- function ConnectedDangerZone({ notify: notify3, renderSubscriptionLink }) {
1642
+ function ConnectedDangerZone({ renderSubscriptionLink }) {
1643
+ const { notify } = useBlocksEnvironment();
1646
1644
  const [zoneOpen, setZoneOpen] = useState(false);
1647
1645
  const [dialogOpen, setDialogOpen] = useState(false);
1648
1646
  const { data: profile } = useProfile();
@@ -1654,7 +1652,7 @@ function ConnectedDangerZone({ notify: notify3, renderSubscriptionLink }) {
1654
1652
  remove: () => remove.mutateAsync(),
1655
1653
  onClose: () => setDialogOpen(false),
1656
1654
  onDeleted: () => signOut.mutate({ reason: "account-deleted" }),
1657
- onError: () => notify3?.("Failed to delete account. Please try again.", "error")
1655
+ onError: () => notify("Failed to delete account. Please try again.", "error")
1658
1656
  });
1659
1657
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1660
1658
  /* @__PURE__ */ jsx(
@@ -1698,6 +1696,7 @@ function ConnectedDangerZone({ notify: notify3, renderSubscriptionLink }) {
1698
1696
  function useConnectedDocxNotifications(onOpen) {
1699
1697
  const arbi = useArbi();
1700
1698
  const { status, user, apiUrl } = useConnection();
1699
+ const { notify } = useBlocksEnvironment();
1701
1700
  const queries = useQueryClient();
1702
1701
  const source = `docx-mentions:${apiUrl}:${user?.externalId || ""}`;
1703
1702
  const queryKey = ["docx-mentions", apiUrl, user?.externalId];
@@ -1729,8 +1728,9 @@ function useConnectedDocxNotifications(onOpen) {
1729
1728
  source,
1730
1729
  onSelect: () => {
1731
1730
  void Promise.resolve(onOpen({ documentId, commentId, workspaceId })).catch(
1732
- (error) => notify.error(
1733
- 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"
1734
1734
  )
1735
1735
  );
1736
1736
  }
@@ -1740,13 +1740,13 @@ function useConnectedDocxNotifications(onOpen) {
1740
1740
  }
1741
1741
  useNotify.getState().syncSource(source, items);
1742
1742
  return () => useNotify.getState().syncSource(source, []);
1743
- }, [data, status, user?.externalId, source, onOpen]);
1743
+ }, [data, status, user?.externalId, source, onOpen, notify]);
1744
1744
  const markRead = async (ids) => {
1745
1745
  try {
1746
1746
  await arbi.notifications.markRead(ids);
1747
1747
  await queries.invalidateQueries({ queryKey });
1748
1748
  } catch {
1749
- notify.error("Could not mark document mentions read.");
1749
+ notify("Could not mark document mentions read.", "error");
1750
1750
  }
1751
1751
  };
1752
1752
  return {
@@ -1762,6 +1762,7 @@ function useConnectedDocxNotifications(onOpen) {
1762
1762
  }
1763
1763
  function useConnectedWorkNotifications(onOpen) {
1764
1764
  const { status, user, apiUrl } = useConnection();
1765
+ const { notify } = useBlocksEnvironment();
1765
1766
  const source = `work-notifications:${apiUrl}:${user?.externalId || ""}`;
1766
1767
  const { data = [], markRead: persistRead } = useWorkNotifications({
1767
1768
  apiUrl,
@@ -1784,8 +1785,9 @@ function useConnectedWorkNotifications(onOpen) {
1784
1785
  source,
1785
1786
  onSelect: () => {
1786
1787
  void Promise.resolve().then(() => onOpen(mapped.target)).catch(
1787
- (error) => notify.error(
1788
- 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"
1789
1791
  )
1790
1792
  );
1791
1793
  }
@@ -1793,13 +1795,13 @@ function useConnectedWorkNotifications(onOpen) {
1793
1795
  }
1794
1796
  useNotify.getState().syncSource(source, items);
1795
1797
  return () => useNotify.getState().syncSource(source, []);
1796
- }, [data, status, user?.externalId, source, onOpen]);
1798
+ }, [data, status, user?.externalId, source, onOpen, notify]);
1797
1799
  const markRead = async (ids) => {
1798
1800
  if (!ids.length) return;
1799
1801
  try {
1800
1802
  await persistRead(ids);
1801
1803
  } catch {
1802
- notify.error("Could not mark work notifications read.");
1804
+ notify("Could not mark work notifications read.", "error");
1803
1805
  }
1804
1806
  };
1805
1807
  return {
@@ -2207,16 +2209,16 @@ var NO_WORD = {
2207
2209
  loadFonts: () => Promise.reject(new Error("No Word editor"))
2208
2210
  }
2209
2211
  };
2210
- function notifySent(notify3, result) {
2212
+ function notifySent(notify, result) {
2211
2213
  const status = result && typeof result === "object" && "delivery_status" in result ? result.delivery_status : null;
2212
2214
  if (status === "bounced")
2213
- notify3("Email couldn't be delivered", "error", { description: "Open it in Sent to see why." });
2215
+ notify("Email couldn't be delivered", "error", { description: "Open it in Sent to see why." });
2214
2216
  else if (status === "partially_bounced")
2215
- notify3("Email couldn't be delivered to every recipient", "error", {
2217
+ notify("Email couldn't be delivered to every recipient", "error", {
2216
2218
  description: "Open it in Sent to see which and why."
2217
2219
  });
2218
- else if (status === "delivered") notify3("Email delivered", "success");
2219
- else notify3("Email queued for delivery", "success");
2220
+ else if (status === "delivered") notify("Email delivered", "success");
2221
+ else notify("Email queued for delivery", "success");
2220
2222
  }
2221
2223
  function MailComposerForm({
2222
2224
  account,
@@ -2233,13 +2235,13 @@ function MailComposerForm({
2233
2235
  localDraftId: initialLocalDraftId,
2234
2236
  offline,
2235
2237
  documents,
2236
- notify: notify3,
2237
2238
  word,
2238
2239
  sessionKey,
2239
2240
  roomId,
2240
2241
  headerSlot
2241
2242
  }) {
2242
2243
  const { client } = useMailClient();
2244
+ const { notify, confirm } = useBlocksEnvironment();
2243
2245
  const [to, setTo] = useState(initial.to.map((r) => r.email).join("; "));
2244
2246
  const [cc, setCc] = useState(initial.cc.map((r) => r.email).join("; "));
2245
2247
  const [showCc, setShowCc] = useState(initial.cc.length > 0);
@@ -2374,7 +2376,7 @@ function MailComposerForm({
2374
2376
  setWordPending(true);
2375
2377
  try {
2376
2378
  if (!secure) {
2377
- notifySent(notify3, await wordBody.send({ ...value, request_id: requestId.current }));
2379
+ notifySent(notify, await wordBody.send({ ...value, request_id: requestId.current }));
2378
2380
  onClose();
2379
2381
  return;
2380
2382
  }
@@ -2408,13 +2410,13 @@ function MailComposerForm({
2408
2410
  {
2409
2411
  onSuccess: (result) => {
2410
2412
  if (result && typeof result === "object" && "onDevice" in result) {
2411
- notify3("Saved to your Outbox", "info", {
2413
+ notify("Saved to your Outbox", "info", {
2412
2414
  description: "It will be sent automatically when you're back online."
2413
2415
  });
2414
2416
  onClose();
2415
2417
  return;
2416
2418
  }
2417
- notifySent(notify3, result);
2419
+ notifySent(notify, result);
2418
2420
  if (localDraftId) void offline?.deleteDraft(localDraftId);
2419
2421
  onClose();
2420
2422
  },
@@ -2461,9 +2463,14 @@ function MailComposerForm({
2461
2463
  };
2462
2464
  const close = () => {
2463
2465
  if (busy) return;
2464
- if (!saved && (dirty || !draftId) && (text || subject || to || cc || bcc || attachments.length || bodyChanged) && !window.confirm("Close this message without saving your latest changes?"))
2465
- return;
2466
- onClose();
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
+ });
2467
2474
  };
2468
2475
  useEffect(() => {
2469
2476
  if (closeRequestRef) closeRequestRef.current = close;
@@ -2564,8 +2571,12 @@ function MailComposerForm({
2564
2571
  className: "h-7 shrink-0 text-xs",
2565
2572
  disabled: busy,
2566
2573
  onClick: () => {
2567
- if (window.confirm("Discard your unsaved changes and load the changed draft?"))
2568
- onReload(replacedBy);
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
+ });
2569
2580
  },
2570
2581
  children: "Load changes"
2571
2582
  }
@@ -2816,9 +2827,8 @@ function MailComposerForm({
2816
2827
  }
2817
2828
  );
2818
2829
  }
2819
- var defaultMailNotify = (message, variant, options) => {
2820
- notify[variant](message, options);
2821
- };
2830
+
2831
+ // src/connection/mail/mailbox.ts
2822
2832
  function resolveMailbox(accounts, mailbox) {
2823
2833
  if (!accounts) return void 0;
2824
2834
  if (mailbox === "native") return accounts.find((a) => a.provider === "native");
@@ -2833,7 +2843,6 @@ function ConnectedMailComposer({
2833
2843
  maxBytes: maxBytesProp,
2834
2844
  ready: readyProp,
2835
2845
  drafts: draftsProp,
2836
- notify: notify3 = defaultMailNotify,
2837
2846
  offline,
2838
2847
  replyTo,
2839
2848
  ...rest
@@ -2887,7 +2896,6 @@ function ConnectedMailComposer({
2887
2896
  maxBytes: maxBytesProp ?? policy.data?.max_attachment_bytes ?? DEFAULT_MAX_BYTES,
2888
2897
  ready,
2889
2898
  drafts: draftsProp ?? draftsList.data?.messages ?? [],
2890
- notify: notify3,
2891
2899
  offline,
2892
2900
  onReload: setReloaded,
2893
2901
  ...rest
@@ -3079,9 +3087,9 @@ function ConnectedMailbox({
3079
3087
  onViewerOpenChange,
3080
3088
  gridState,
3081
3089
  onGridStateChange,
3082
- initialMessageId = null,
3083
- notify: notify3 = defaultMailNotify
3090
+ initialMessageId = null
3084
3091
  }) {
3092
+ const { notify } = useBlocksEnvironment();
3085
3093
  const cache = useMailCache();
3086
3094
  const { client } = useMailClient();
3087
3095
  const [savingToWorkspace, setSavingToWorkspace] = useState(false);
@@ -3295,7 +3303,7 @@ function ConnectedMailbox({
3295
3303
  new File([await response.blob()], fileName, { type: "message/rfc822" })
3296
3304
  );
3297
3305
  setSavingToWorkspace(false);
3298
- notify3(
3306
+ notify(
3299
3307
  "Email saved to workspace",
3300
3308
  "success",
3301
3309
  documentId && onOpenDocument ? { action: { label: "Open", onClick: () => onOpenDocument(documentId, workspaceId) } } : void 0
@@ -3564,7 +3572,6 @@ function ConnectedMailbox({
3564
3572
  localDraftId: composeLocalDraftId,
3565
3573
  offline,
3566
3574
  documents,
3567
- notify: notify3,
3568
3575
  word,
3569
3576
  sessionKey: `${mailboxKey}-${composeSession}`,
3570
3577
  onChange: setCompose,
@@ -3818,6 +3825,6 @@ function ConnectedAgentChatPanel({
3818
3825
  ] });
3819
3826
  }
3820
3827
 
3821
- 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, defaultMailNotify, defaultUnmetPasswordRequirement, resolveMailbox, useConnectedDocxNotifications, useConnectedShellWorkspaces, useConnectedWorkNotifications };
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 };
3822
3829
  //# sourceMappingURL=index.js.map
3823
3830
  //# sourceMappingURL=index.js.map