@arbidocs/blocks 0.4.126 → 0.4.128

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 (64) hide show
  1. package/dist/calls/index.cjs +2 -2
  2. package/dist/calls/index.js +1 -1
  3. package/dist/chat/index.cjs +89 -72
  4. package/dist/chat/index.d.ts +1 -0
  5. package/dist/chat/index.js +2 -1
  6. package/dist/chat/open-document.d.ts +66 -0
  7. package/dist/{chunk-DZI7WOUD.cjs → chunk-3BJLNKOB.cjs} +6 -2
  8. package/dist/chunk-3BJLNKOB.cjs.map +1 -0
  9. package/dist/{chunk-IXTQYFIF.js → chunk-6HCJ3ZEU.js} +34 -6
  10. package/dist/chunk-6HCJ3ZEU.js.map +1 -0
  11. package/dist/{chunk-HQH35JWC.js → chunk-7BJRLP3U.js} +6 -3
  12. package/dist/chunk-7BJRLP3U.js.map +1 -0
  13. package/dist/{chunk-6Z72CXZR.js → chunk-CJBN5HIS.js} +6 -2
  14. package/dist/chunk-CJBN5HIS.js.map +1 -0
  15. package/dist/{chunk-JJLMCV3T.js → chunk-ECERC6TI.js} +32 -28
  16. package/dist/chunk-ECERC6TI.js.map +1 -0
  17. package/dist/{chunk-4VCKYR4D.cjs → chunk-FSBY2S4V.cjs} +6 -3
  18. package/dist/chunk-FSBY2S4V.cjs.map +1 -0
  19. package/dist/chunk-GYCQ3FNL.js +60 -0
  20. package/dist/chunk-GYCQ3FNL.js.map +1 -0
  21. package/dist/{chunk-VMZXFYHK.cjs → chunk-NZUQFF35.cjs} +2 -2
  22. package/dist/{chunk-VMZXFYHK.cjs.map → chunk-NZUQFF35.cjs.map} +1 -1
  23. package/dist/{chunk-U6MPHCEB.cjs → chunk-O6IEZDRC.cjs} +33 -5
  24. package/dist/chunk-O6IEZDRC.cjs.map +1 -0
  25. package/dist/chunk-SWQX6CTT.cjs +65 -0
  26. package/dist/chunk-SWQX6CTT.cjs.map +1 -0
  27. package/dist/{chunk-GICUGQNN.cjs → chunk-ZAVEMQ37.cjs} +31 -27
  28. package/dist/chunk-ZAVEMQ37.cjs.map +1 -0
  29. package/dist/{chunk-Y4X3RBFI.js → chunk-ZCHSJUCI.js} +2 -2
  30. package/dist/{chunk-Y4X3RBFI.js.map → chunk-ZCHSJUCI.js.map} +1 -1
  31. package/dist/collaboration/index.cjs +15 -15
  32. package/dist/collaboration/index.js +1 -1
  33. package/dist/collaboration/mail/MailMessageView.d.ts +5 -1
  34. package/dist/connect/docx.cjs +4 -3
  35. package/dist/connect/docx.cjs.map +1 -1
  36. package/dist/connect/docx.js +3 -2
  37. package/dist/connect/docx.js.map +1 -1
  38. package/dist/connect/index.cjs +93 -36
  39. package/dist/connect/index.cjs.map +1 -1
  40. package/dist/connect/index.js +66 -9
  41. package/dist/connect/index.js.map +1 -1
  42. package/dist/connection/mail/types.d.ts +2 -6
  43. package/dist/index.cjs +113 -96
  44. package/dist/index.cjs.map +1 -1
  45. package/dist/index.js +4 -3
  46. package/dist/index.js.map +1 -1
  47. package/dist/settings/ConfirmDialog.d.ts +4 -1
  48. package/dist/settings/index.cjs +3 -3
  49. package/dist/settings/index.js +1 -1
  50. package/dist/studio/index.cjs +3 -2
  51. package/dist/studio/index.cjs.map +1 -1
  52. package/dist/studio/index.js +2 -1
  53. package/dist/studio/index.js.map +1 -1
  54. package/node_modules/@arbidocs/coedit/package.json +1 -1
  55. package/package.json +5 -5
  56. package/src/docx/README.md +7 -3
  57. package/dist/chunk-4VCKYR4D.cjs.map +0 -1
  58. package/dist/chunk-6Z72CXZR.js.map +0 -1
  59. package/dist/chunk-DZI7WOUD.cjs.map +0 -1
  60. package/dist/chunk-GICUGQNN.cjs.map +0 -1
  61. package/dist/chunk-HQH35JWC.js.map +0 -1
  62. package/dist/chunk-IXTQYFIF.js.map +0 -1
  63. package/dist/chunk-JJLMCV3T.js.map +0 -1
  64. package/dist/chunk-U6MPHCEB.cjs.map +0 -1
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { SettingsSection, ProfileCard, AvatarPicker, IdentityVerificationCard, IdentityVerificationDialog, RequireVerified, SettingsCard, SettingsActionRow, PasswordChangeDialog, 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-HQH35JWC.js';
4
- export { ConnectedAssistantDock, redlineStats, textToArtifact, toRedlineMarkdown, useConnectedAiTask, useConnectedChat, useSemanticSearch, useWorkspaceDocs } from '../chunk-HQH35JWC.js';
5
- import { ConnectedNativeDocxEditor } from '../chunk-6Z72CXZR.js';
3
+ import { useWorkspaceDocs } from '../chunk-7BJRLP3U.js';
4
+ export { ConnectedAssistantDock, redlineStats, textToArtifact, toRedlineMarkdown, useConnectedAiTask, useConnectedChat, useSemanticSearch, useWorkspaceDocs } from '../chunk-7BJRLP3U.js';
5
+ import { ConnectedNativeDocxEditor } from '../chunk-CJBN5HIS.js';
6
6
  import { ConnectionProvider, useConnection } from '../chunk-OYMWV45N.js';
7
7
  export { ConnectionProvider, SESSION_EXPIRED_MESSAGE, isAuthenticated, useConnection } from '../chunk-OYMWV45N.js';
8
8
  import { SignDocumentDialog } from '../chunk-2YOVK524.js';
@@ -11,7 +11,7 @@ import '../chunk-2FL7QJKJ.js';
11
11
  import '../chunk-HFZ45FD3.js';
12
12
  import { FilesFilterBar, FolderFilterButton, FolderPickerRow } from '../chunk-7RJTEWYM.js';
13
13
  import { WorkspaceActivityList, WorkspaceNotificationMenu, ThreadFollowMenuItem, ThreadFollowButton, TagTable, tagTableDocx } from '../chunk-VW2C2AZL.js';
14
- import { PlainMailBodyEditor, draftMailCompose, replyMailCompose, emptyMailCompose, MailGrid, MailMessageView, MailDocumentPicker, parseMailRecipients } from '../chunk-IXTQYFIF.js';
14
+ import { PlainMailBodyEditor, draftMailCompose, replyMailCompose, emptyMailCompose, MailGrid, MailMessageView, MailDocumentPicker, parseMailRecipients } from '../chunk-6HCJ3ZEU.js';
15
15
  import { DOCX_MIME_TYPE } from '../chunk-QXMR5YHC.js';
16
16
  import '../chunk-AF6RDAJF.js';
17
17
  import { WorkflowStepBar, WorkflowRunner, fromPlanSteps, toPlanSteps, useWorkflowView } from '../chunk-54ANPPMV.js';
@@ -22,10 +22,12 @@ 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
26
  import { TabHeader } from '../chunk-4WWM3GQ5.js';
26
27
  import { ModalScaffold } from '../chunk-TX2ZICS7.js';
27
28
  import { ChatPage } from '../chunk-CXLVI3SB.js';
28
29
  import '../chunk-7XF5SFJ2.js';
30
+ import { takeOpenDocumentForTurn, useRegisterOpenDocument } from '../chunk-GYCQ3FNL.js';
29
31
  import { splitDocRef, stepLevels, stepDocuments, stepKindOf, initialRunInputs, workflowSteps, stepStatesFromActivity, runThreadTitle, stepFields } from '../chunk-7HAM7Y5U.js';
30
32
  import '../chunk-AA3PT6KR.js';
31
33
  import '../chunk-AUS3KBHJ.js';
@@ -2134,10 +2136,7 @@ function useWordBody({
2134
2136
  // eslint-disable-next-line react-hooks/exhaustive-deps
2135
2137
  [word.adapter, client, documentKey]
2136
2138
  );
2137
- useEffect(() => {
2138
- if (!roomId) return;
2139
- return word.onRoomOpened?.(roomId) || void 0;
2140
- }, [roomId, word]);
2139
+ useRegisterOpenDocument({ documentId: roomId });
2141
2140
  const editor = useMailDraftEditor();
2142
2141
  const state = () => stateRef.current?.() ?? null;
2143
2142
  return {
@@ -3187,6 +3186,34 @@ function ConnectedMailbox({
3187
3186
  body: JSON.stringify(body)
3188
3187
  }
3189
3188
  );
3189
+ const nativeTrash = account?.provider === "native" && folderRole === "trash";
3190
+ const [confirmDelete, setConfirmDelete] = useState(null);
3191
+ const [deleting, setDeleting] = useState(false);
3192
+ const deleteForever = async () => {
3193
+ if (!account || !isOnline || !confirmDelete) return;
3194
+ setDeleting(true);
3195
+ try {
3196
+ if (confirmDelete === "message" && selected) {
3197
+ await mailJson(
3198
+ client.fetch,
3199
+ `${accountPath(account.id)}/messages/${encodeURIComponent(selected)}`,
3200
+ { method: "DELETE" }
3201
+ );
3202
+ setSelected(null);
3203
+ } else if (confirmDelete === "trash") {
3204
+ await mailJson(client.fetch, `${accountPath(account.id)}/messages?folder=trash`, {
3205
+ method: "DELETE"
3206
+ });
3207
+ setSelected(null);
3208
+ }
3209
+ await cache.refreshAll();
3210
+ } catch (e) {
3211
+ setActionError(e instanceof Error ? e.message : "Could not delete");
3212
+ } finally {
3213
+ setDeleting(false);
3214
+ setConfirmDelete(null);
3215
+ }
3216
+ };
3190
3217
  const update = async (body) => {
3191
3218
  if (!selected || !account || !isOnline) return;
3192
3219
  try {
@@ -3360,6 +3387,17 @@ function ConnectedMailbox({
3360
3387
  children: /* @__PURE__ */ jsx(Settings, { className: "size-4" })
3361
3388
  }
3362
3389
  ),
3390
+ nativeTrash && /* @__PURE__ */ jsx(
3391
+ Button,
3392
+ {
3393
+ size: "sm",
3394
+ variant: "ghost",
3395
+ disabled: !isOnline,
3396
+ "data-testid": "mail-empty-trash-button",
3397
+ onClick: () => setConfirmDelete("trash"),
3398
+ children: "Empty Trash"
3399
+ }
3400
+ ),
3363
3401
  /* @__PURE__ */ jsxs(
3364
3402
  Button,
3365
3403
  {
@@ -3529,6 +3567,8 @@ function ConnectedMailbox({
3529
3567
  onReply: (forward, all) => void reply(forward, all),
3530
3568
  onReplyWithArbi: onReplyWithArbi && account.provider === "native" ? () => onReplyWithArbi(message, account) : void 0,
3531
3569
  onUpdate: (body) => void update(body),
3570
+ onRestore: nativeTrash ? () => void update({ action: "restore" }) : void 0,
3571
+ onDeleteForever: nativeTrash ? () => setConfirmDelete("message") : void 0,
3532
3572
  onDownloadAttachment: (a) => void downloadAttachment(a),
3533
3573
  onDownloadOriginal: () => void download(
3534
3574
  `${accountPath(account.id)}/messages/${message.id}/original`,
@@ -3580,6 +3620,19 @@ function ConnectedMailbox({
3580
3620
  settings: offline?.renderSettings?.(),
3581
3621
  onClose: () => setSettings(false)
3582
3622
  }
3623
+ ),
3624
+ /* @__PURE__ */ jsx(
3625
+ ConfirmDialog,
3626
+ {
3627
+ isOpen: confirmDelete !== null,
3628
+ onClose: () => setConfirmDelete(null),
3629
+ onConfirm: () => void deleteForever(),
3630
+ isLoading: deleting,
3631
+ title: confirmDelete === "trash" ? "Empty Trash?" : "Delete forever?",
3632
+ description: confirmDelete === "trash" ? "Every message in the Trash is deleted permanently and stops using your storage. This cannot be undone." : "This message is deleted permanently and stops using your storage. This cannot be undone.",
3633
+ confirmText: confirmDelete === "trash" ? "Empty Trash" : "Delete forever",
3634
+ testId: "mail-delete-forever-dialog"
3635
+ }
3583
3636
  )
3584
3637
  ] });
3585
3638
  }
@@ -3663,7 +3716,11 @@ function ConnectedMailMessage({
3663
3716
  ] });
3664
3717
  }
3665
3718
  function ActiveChat({ agentId, workspaceId }) {
3666
- const chat = useArbiChat({ agentId, workspaceId });
3719
+ const chat = useArbiChat({
3720
+ agentId,
3721
+ workspaceId,
3722
+ activeArtifact: () => takeOpenDocumentForTurn({ workspaceId })
3723
+ });
3667
3724
  return /* @__PURE__ */ jsx(
3668
3725
  ChatPage,
3669
3726
  {