@arbidocs/blocks 0.4.127 → 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 (90) hide show
  1. package/dist/agents/index.cjs +303 -303
  2. package/dist/agents/index.js +11 -11
  3. package/dist/calls/index.cjs +1 -1
  4. package/dist/calls/index.js +1 -1
  5. package/dist/chat/index.cjs +152 -135
  6. package/dist/chat/index.d.ts +1 -0
  7. package/dist/chat/index.js +5 -4
  8. package/dist/chat/open-document.d.ts +66 -0
  9. package/dist/{chunk-DZI7WOUD.cjs → chunk-3BJLNKOB.cjs} +6 -2
  10. package/dist/chunk-3BJLNKOB.cjs.map +1 -0
  11. package/dist/{chunk-2PNNCEPH.js → chunk-54ANPPMV.js} +4 -4
  12. package/dist/{chunk-2PNNCEPH.js.map → chunk-54ANPPMV.js.map} +1 -1
  13. package/dist/{chunk-T6I6ZCBE.js → chunk-7BJRLP3U.js} +7 -4
  14. package/dist/chunk-7BJRLP3U.js.map +1 -0
  15. package/dist/{chunk-2DFDFOM7.js → chunk-7HAM7Y5U.js} +3 -3
  16. package/dist/{chunk-2DFDFOM7.js.map → chunk-7HAM7Y5U.js.map} +1 -1
  17. package/dist/{chunk-6Z72CXZR.js → chunk-CJBN5HIS.js} +6 -2
  18. package/dist/chunk-CJBN5HIS.js.map +1 -0
  19. package/dist/{chunk-PUCY3UXN.js → chunk-CXLVI3SB.js} +3 -3
  20. package/dist/{chunk-PUCY3UXN.js.map → chunk-CXLVI3SB.js.map} +1 -1
  21. package/dist/{chunk-KYDRUFWT.cjs → chunk-D4YR56FV.cjs} +5 -5
  22. package/dist/{chunk-KYDRUFWT.cjs.map → chunk-D4YR56FV.cjs.map} +1 -1
  23. package/dist/{chunk-ZLRQ5K77.cjs → chunk-FSBY2S4V.cjs} +8 -5
  24. package/dist/chunk-FSBY2S4V.cjs.map +1 -0
  25. package/dist/chunk-GYCQ3FNL.js +60 -0
  26. package/dist/chunk-GYCQ3FNL.js.map +1 -0
  27. package/dist/{chunk-6AALMYPS.cjs → chunk-HM23LXUP.cjs} +3 -3
  28. package/dist/{chunk-6AALMYPS.cjs.map → chunk-HM23LXUP.cjs.map} +1 -1
  29. package/dist/{chunk-T2CVFK2I.js → chunk-KLOSOT26.js} +11 -11
  30. package/dist/{chunk-T2CVFK2I.js.map → chunk-KLOSOT26.js.map} +1 -1
  31. package/dist/{chunk-SARREDFP.cjs → chunk-LC2KJSUS.cjs} +46 -46
  32. package/dist/{chunk-SARREDFP.cjs.map → chunk-LC2KJSUS.cjs.map} +1 -1
  33. package/dist/{chunk-XFKF3WRN.cjs → chunk-NZUQFF35.cjs} +5 -5
  34. package/dist/{chunk-XFKF3WRN.cjs.map → chunk-NZUQFF35.cjs.map} +1 -1
  35. package/dist/{chunk-5Y7JRY7Y.js → chunk-P5ST47VY.js} +3 -3
  36. package/dist/{chunk-5Y7JRY7Y.js.map → chunk-P5ST47VY.js.map} +1 -1
  37. package/dist/chunk-SWQX6CTT.cjs +65 -0
  38. package/dist/chunk-SWQX6CTT.cjs.map +1 -0
  39. package/dist/{chunk-ENDP7JER.js → chunk-VW2C2AZL.js} +3 -3
  40. package/dist/{chunk-ENDP7JER.js.map → chunk-VW2C2AZL.js.map} +1 -1
  41. package/dist/{chunk-MCPRNDOJ.cjs → chunk-W27VK32R.cjs} +79 -79
  42. package/dist/{chunk-MCPRNDOJ.cjs.map → chunk-W27VK32R.cjs.map} +1 -1
  43. package/dist/{chunk-PJJY6CYL.cjs → chunk-WV4IDVDQ.cjs} +11 -11
  44. package/dist/{chunk-PJJY6CYL.cjs.map → chunk-WV4IDVDQ.cjs.map} +1 -1
  45. package/dist/{chunk-UUXKB3WQ.js → chunk-ZCHSJUCI.js} +3 -3
  46. package/dist/{chunk-UUXKB3WQ.js.map → chunk-ZCHSJUCI.js.map} +1 -1
  47. package/dist/{chunk-NYHGG2IA.cjs → chunk-ZV3BKLFY.cjs} +3 -3
  48. package/dist/{chunk-NYHGG2IA.cjs.map → chunk-ZV3BKLFY.cjs.map} +1 -1
  49. package/dist/collaboration/index.cjs +9 -9
  50. package/dist/collaboration/index.js +1 -1
  51. package/dist/connect/docx.cjs +4 -3
  52. package/dist/connect/docx.cjs.map +1 -1
  53. package/dist/connect/docx.js +3 -2
  54. package/dist/connect/docx.js.map +1 -1
  55. package/dist/connect/index.cjs +53 -51
  56. package/dist/connect/index.cjs.map +1 -1
  57. package/dist/connect/index.js +19 -17
  58. package/dist/connect/index.js.map +1 -1
  59. package/dist/connection/mail/types.d.ts +2 -6
  60. package/dist/document-tools/index.cjs +1 -1
  61. package/dist/document-tools/index.js +1 -1
  62. package/dist/facts/index.cjs +1 -1
  63. package/dist/facts/index.js +1 -1
  64. package/dist/files/index.cjs +1 -1
  65. package/dist/files/index.js +1 -1
  66. package/dist/home/index.cjs +17 -17
  67. package/dist/home/index.js +3 -3
  68. package/dist/index.cjs +645 -628
  69. package/dist/index.cjs.map +1 -1
  70. package/dist/index.js +21 -20
  71. package/dist/index.js.map +1 -1
  72. package/dist/settings/index.cjs +11 -11
  73. package/dist/settings/index.js +3 -3
  74. package/dist/shell/index.cjs +1 -1
  75. package/dist/shell/index.js +1 -1
  76. package/dist/site/index.cjs +5 -5
  77. package/dist/site/index.js +1 -1
  78. package/dist/studio/index.cjs +7 -6
  79. package/dist/studio/index.cjs.map +1 -1
  80. package/dist/studio/index.js +6 -5
  81. package/dist/studio/index.js.map +1 -1
  82. package/dist/workflow-canvas/index.cjs +62 -62
  83. package/dist/workflow-canvas/index.js +11 -11
  84. package/node_modules/@arbidocs/coedit/package.json +1 -1
  85. package/package.json +5 -5
  86. package/src/docx/README.md +7 -3
  87. package/dist/chunk-6Z72CXZR.js.map +0 -1
  88. package/dist/chunk-DZI7WOUD.cjs.map +0 -1
  89. package/dist/chunk-T6I6ZCBE.js.map +0 -1
  90. package/dist/chunk-ZLRQ5K77.cjs.map +0 -1
@@ -33,6 +33,7 @@ export { ChatMessageContent, type ChatMessageContentProps } from './ChatMessageC
33
33
  export { CitationMark, type CitationMarkProps, type CitationLabels } from './CitationMark';
34
34
  export { ChatThreadList, ChatThreadSelect } from './ChatThreads';
35
35
  export { useChatSurface, useRegisterEmbeddedChat, type ChatSurface } from './chat-surface';
36
+ export { savedDocumentIdFor, useRegisterOpenDocument, useOpenDocumentId, takeOpenDocumentForTurn, type SavedDocumentInput, type OpenDocumentRegistration, } from './open-document';
36
37
  export { DEFAULT_CHAT_PAGE_LABELS, type ChatCitationTarget, type ChatPageCitation, type ChatPageController, type ChatPageDocument, type ChatPageLabels, type ChatPageMessage, type ChatPagePassage, type ChatPageProps, type ChatPageThread, } from './chat-page-types';
37
38
  export { AssistantDock, AssistantDockToggle, useAssistantDock, type AssistantDockProps, type AssistantDockToggleProps, } from './AssistantDock';
38
39
  export { AssistantToaster, type AssistantToasterProps } from './AssistantToaster';
@@ -1,12 +1,13 @@
1
1
  "use client";
2
- export { AssistantToaster, BranchControls, ComposerAccessories, ComposerTools, ContextActionButton, ContextCheckRow, ContextPanelContent, ContextPanelFooter, ContextPanelTabs, ContextPickerList, ContextPickerRow, ContextSearchInput, ContextSelectList, ContextSelectRow, Conversation, ConversationBody, ConversationFilter, ConversationHeader, ConversationHeaderActions, ConversationHistoryPane, ConversationLoading, ConversationMain, ConversationRoot, ConversationSearchView, ConversationSettingsButton, DEFAULT_BRANCH_CONTROLS_LABELS, DEFAULT_CONVERSATION_LAYOUT_LABELS, DEFAULT_CONVERSATION_PARTS_LABELS, DEFAULT_CONVERSATION_SEARCH_LABELS, DEFAULT_DRAFTING_DOC_CHIP_LABELS, DEFAULT_LABEL_PIN_ROW_LABELS, DEFAULT_MODEL_PRICING_TIP_LABELS, DEFAULT_PENDING_ANSWER_BAR_LABELS, DEFAULT_PINNED_DOC_CHIP_LABELS, DEFAULT_SLASH_MENU_LABELS, DEFAULT_THREAD_MAP_LABELS, DraftingDocChip, LabelPinRow, ModelAutoIcon, ModelConfigureButton, ModelDot, ModelMenuDivider, ModelMenuMessage, ModelOption, ModelOptionLabel, ModelPickerPopover, ModelPickerTrigger, ModelPricingTip, ModelTierIcon, ModelTierOption, ModelTriggerContent, NewChatButton, NewPaChatButton, PaModeBadge, PendingAnswerBar, PinnedDocChip, ProvisionalTranscriptLine, SlashMenu, ThreadMap, ThreadMapDiagram, ThreadMapError, ThreadMapLoading, TranscriptLine, flashMessage, getParticipantTints, hasMessageBody, isLongPastedText, transcriptRuns, useDismissibleCard, useLongPaste, useRecipientDraft } from '../chunk-UUXKB3WQ.js';
2
+ export { AssistantToaster, BranchControls, ComposerAccessories, ComposerTools, ContextActionButton, ContextCheckRow, ContextPanelContent, ContextPanelFooter, ContextPanelTabs, ContextPickerList, ContextPickerRow, ContextSearchInput, ContextSelectList, ContextSelectRow, Conversation, ConversationBody, ConversationFilter, ConversationHeader, ConversationHeaderActions, ConversationHistoryPane, ConversationLoading, ConversationMain, ConversationRoot, ConversationSearchView, ConversationSettingsButton, DEFAULT_BRANCH_CONTROLS_LABELS, DEFAULT_CONVERSATION_LAYOUT_LABELS, DEFAULT_CONVERSATION_PARTS_LABELS, DEFAULT_CONVERSATION_SEARCH_LABELS, DEFAULT_DRAFTING_DOC_CHIP_LABELS, DEFAULT_LABEL_PIN_ROW_LABELS, DEFAULT_MODEL_PRICING_TIP_LABELS, DEFAULT_PENDING_ANSWER_BAR_LABELS, DEFAULT_PINNED_DOC_CHIP_LABELS, DEFAULT_SLASH_MENU_LABELS, DEFAULT_THREAD_MAP_LABELS, DraftingDocChip, LabelPinRow, ModelAutoIcon, ModelConfigureButton, ModelDot, ModelMenuDivider, ModelMenuMessage, ModelOption, ModelOptionLabel, ModelPickerPopover, ModelPickerTrigger, ModelPricingTip, ModelTierIcon, ModelTierOption, ModelTriggerContent, NewChatButton, NewPaChatButton, PaModeBadge, PendingAnswerBar, PinnedDocChip, ProvisionalTranscriptLine, SlashMenu, ThreadMap, ThreadMapDiagram, ThreadMapError, ThreadMapLoading, TranscriptLine, flashMessage, getParticipantTints, hasMessageBody, isLongPastedText, transcriptRuns, useDismissibleCard, useLongPaste, useRecipientDraft } from '../chunk-ZCHSJUCI.js';
3
3
  import '../chunk-OKERRHLH.js';
4
- export { AssistantDock, AssistantDockToggle, AssistantModeToggle, ChatDocuments, ChatMessageContent, ChatPage, ChatThreadList, ChatThreadSelect, CitationMark, Composer, ComposerBranchingNotice, ComposerContainer, ComposerDock, ComposerFrame, ComposerInput, ComposerRoot, ComposerSend, ComposerToolbar, ComposerVoiceButton, ContextChip, ConversationEmpty, DEFAULT_ASSISTANT_MODE_TOGGLE_LABELS, DEFAULT_CHAT_PAGE_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_CONVERSATION_EMPTY_LABELS, DEFAULT_MESSAGE_ALERT_LABELS, DEFAULT_MESSAGE_LABELS, DEFAULT_MESSAGE_LIST_LABELS, DEFAULT_WORKFLOW_STEP_CHIP_LABELS, Message, MessageActionButton, MessageActionMenu, MessageAlert, MessageAuthor, MessageBody, MessageBubble, MessageByline, MessageContent, MessageFooter, MessageList, MessageListBanner, MessageListEmpty, MessageListRoot, MessageListRow, MessageListRows, MessageListStatus, MessageListTail, MessageNarration, MessageRoot, MessageSources, MessageSubagentBadge, ScrollToBottom, SourceChip, WorkflowStepChip, toSpeakableText, useAssistantDock, useChatSurface, useRegisterEmbeddedChat, useStreamAnnouncement } from '../chunk-PUCY3UXN.js';
4
+ export { AssistantDock, AssistantDockToggle, AssistantModeToggle, ChatDocuments, ChatMessageContent, ChatPage, ChatThreadList, ChatThreadSelect, CitationMark, Composer, ComposerBranchingNotice, ComposerContainer, ComposerDock, ComposerFrame, ComposerInput, ComposerRoot, ComposerSend, ComposerToolbar, ComposerVoiceButton, ContextChip, ConversationEmpty, DEFAULT_ASSISTANT_MODE_TOGGLE_LABELS, DEFAULT_CHAT_PAGE_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_CONVERSATION_EMPTY_LABELS, DEFAULT_MESSAGE_ALERT_LABELS, DEFAULT_MESSAGE_LABELS, DEFAULT_MESSAGE_LIST_LABELS, DEFAULT_WORKFLOW_STEP_CHIP_LABELS, Message, MessageActionButton, MessageActionMenu, MessageAlert, MessageAuthor, MessageBody, MessageBubble, MessageByline, MessageContent, MessageFooter, MessageList, MessageListBanner, MessageListEmpty, MessageListRoot, MessageListRow, MessageListRows, MessageListStatus, MessageListTail, MessageNarration, MessageRoot, MessageSources, MessageSubagentBadge, ScrollToBottom, SourceChip, WorkflowStepChip, toSpeakableText, useAssistantDock, useChatSurface, useRegisterEmbeddedChat, useStreamAnnouncement } from '../chunk-CXLVI3SB.js';
5
5
  import '../chunk-7XF5SFJ2.js';
6
- export { useMentionAutocomplete } from '../chunk-2DFDFOM7.js';
6
+ export { savedDocumentIdFor, takeOpenDocumentForTurn, useOpenDocumentId, useRegisterOpenDocument } from '../chunk-GYCQ3FNL.js';
7
+ export { useMentionAutocomplete } from '../chunk-7HAM7Y5U.js';
8
+ export { DEFAULT_MENTION_LABELS, MENTION_HREF_PREFIX, MentionChip, MentionMenu, extractMentions, filterMentionCandidates, findMentionQuery, insertMention, linkMentions, mentionFromHref, toMessageMentions, useListKeyNav } from '../chunk-AA3PT6KR.js';
7
9
  import '../chunk-AUS3KBHJ.js';
8
10
  import '../chunk-SLSBJRWW.js';
9
- export { DEFAULT_MENTION_LABELS, MENTION_HREF_PREFIX, MentionChip, MentionMenu, extractMentions, filterMentionCandidates, findMentionQuery, insertMention, linkMentions, mentionFromHref, toMessageMentions, useListKeyNav } from '../chunk-AA3PT6KR.js';
10
11
  import '../chunk-Z3AZ7Q5X.js';
11
12
  import '../chunk-NPLYHR2E.js';
12
13
  import '../chunk-7F6CBP3Z.js';
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Drafting mode: the saved document open beside the chat is what a chat turn is about.
3
+ *
4
+ * A viewer registers the document it shows (`useRegisterOpenDocument`); every assistant turn names
5
+ * it (`active_artifact_ext_id`, read with `takeOpenDocumentForTurn` as the question is sent), so the
6
+ * server binds the live document to the turn: a Word document is read on demand and edited as
7
+ * tracked changes in the open editor, and what the assistant saves becomes a child version of it.
8
+ * The request carries a reference, never the content.
9
+ *
10
+ * The open document is always the subject, also while one of its earlier versions is on screen
11
+ * read-only: a version still names its document. Sending a turn then returns the viewer to the live
12
+ * document (`showLive`), where the assistant's edits appear as they are made. (Pinning a specific
13
+ * version as a source is a separate feature: it does not go through here.)
14
+ *
15
+ * A module-level registry (not React context), like `useChatSurface`, so a viewer and a chat agree
16
+ * wherever they sit in the tree; the most recently opened document wins and closing it hands back
17
+ * to the one before.
18
+ */
19
+ /** What a viewer knows about the document it shows. */
20
+ export interface SavedDocumentInput {
21
+ /** The document (`doc-…`), never a version reference. */
22
+ documentId: string | null | undefined;
23
+ /** An unsaved draft (client-minted id, no backend record). */
24
+ isDraft: boolean;
25
+ /** Still streaming: nothing is persisted yet. */
26
+ isStreaming: boolean;
27
+ /** An image, audio or video artifact: there is no text to draft in. */
28
+ isBlobArtifact: boolean;
29
+ /** The loaded document record. */
30
+ documentData: {
31
+ external_id?: string | null;
32
+ wp_type?: string | null;
33
+ file_name?: string | null;
34
+ } | null | undefined;
35
+ }
36
+ /**
37
+ * The saved, content-backed document a chat can draft in, or null. Only a saved artifact or Word
38
+ * document counts: drafts, an artifact still streaming and blob artifacts do not.
39
+ */
40
+ export declare function savedDocumentIdFor(input: SavedDocumentInput): string | null;
41
+ export interface OpenDocumentRegistration {
42
+ /** The saved document the viewer shows (`doc-…`); null or empty registers nothing. */
43
+ documentId: string | null | undefined;
44
+ /** What is on screen: the document itself, or one of its earlier versions (`doc-…@v2`). */
45
+ shownId?: string | null;
46
+ /** Show the live document again. Called when a turn starts while an earlier version is shown. */
47
+ showLive?: () => void;
48
+ /** The workspace the document belongs to; a chat in another workspace does not draft in it. */
49
+ workspaceId?: string | null;
50
+ }
51
+ /**
52
+ * Registers the document a viewer shows as the open document while the caller is mounted and
53
+ * `documentId` is set. Pass `savedDocumentIdFor(...)`, or the id of a document known to be saved.
54
+ */
55
+ export declare function useRegisterOpenDocument(registration: OpenDocumentRegistration): void;
56
+ /** The open document's id, or null. Re-renders when another document opens or it closes. */
57
+ export declare function useOpenDocumentId(): string | null;
58
+ /**
59
+ * The document an assistant turn about to be sent drafts in, or null. Call it once per turn as the
60
+ * question is sent: when an earlier version of the document is on screen, the viewer returns to the
61
+ * live document, where the assistant's edits appear. With `workspaceId`, a document registered in
62
+ * another workspace is not named (and its viewer is left alone).
63
+ */
64
+ export declare function takeOpenDocumentForTurn(options?: {
65
+ workspaceId?: string | null;
66
+ }): string | null;
@@ -4,6 +4,7 @@
4
4
  var chunkMUMH3Z6K_cjs = require('./chunk-MUMH3Z6K.cjs');
5
5
  var chunkS24XEVPS_cjs = require('./chunk-S24XEVPS.cjs');
6
6
  var chunkV5OAXIBN_cjs = require('./chunk-V5OAXIBN.cjs');
7
+ var chunkSWQX6CTT_cjs = require('./chunk-SWQX6CTT.cjs');
7
8
  var react$1 = require('react');
8
9
  var reactQuery = require('@tanstack/react-query');
9
10
  var react = require('@arbidocs/react');
@@ -14,6 +15,9 @@ function ConnectedNativeDocxEditor({
14
15
  ...props
15
16
  }) {
16
17
  const adapter = useConnectedNativeDocxAdapter(fontBaseUrl);
18
+ const { workspaceId } = chunkMUMH3Z6K_cjs.useConnection();
19
+ const live = !props.snapshot && !props.stream && !props.draftContent && !props.compact;
20
+ chunkSWQX6CTT_cjs.useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId });
17
21
  return /* @__PURE__ */ jsxRuntime.jsx(chunkV5OAXIBN_cjs.NativeDocxEditor, { ...props, adapter });
18
22
  }
19
23
  function useConnectedNativeDocxAdapter(fontBaseUrl = "/native-docx/fonts") {
@@ -92,5 +96,5 @@ function useConnectedNativeDocxAdapter(fontBaseUrl = "/native-docx/fonts") {
92
96
 
93
97
  exports.ConnectedNativeDocxEditor = ConnectedNativeDocxEditor;
94
98
  exports.useConnectedNativeDocxAdapter = useConnectedNativeDocxAdapter;
95
- //# sourceMappingURL=chunk-DZI7WOUD.cjs.map
96
- //# sourceMappingURL=chunk-DZI7WOUD.cjs.map
99
+ //# sourceMappingURL=chunk-3BJLNKOB.cjs.map
100
+ //# sourceMappingURL=chunk-3BJLNKOB.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/connection/ConnectedNativeDocxEditor.tsx"],"names":["useConnection","useRegisterOpenDocument","jsx","NativeDocxEditor","useArbi","useQueryClient","useQuery","useMemo","loadDocxFonts","arbiQueryKeys","notify"],"mappings":";;;;;;;;;;;AAaO,SAAS,yBAAA,CAA0B;AAAA,EACxC,WAAA,GAAc,oBAAA;AAAA,EACd,GAAG;AACL,CAAA,EAAsE;AACpE,EAAA,MAAM,OAAA,GAAU,8BAA8B,WAAW,CAAA;AACzD,EAAA,MAAM,EAAE,WAAA,EAAY,GAAIA,+BAAA,EAAc;AAGtC,EAAA,MAAM,IAAA,GAAO,CAAC,KAAA,CAAM,QAAA,IAAY,CAAC,KAAA,CAAM,MAAA,IAAU,CAAC,KAAA,CAAM,YAAA,IAAgB,CAAC,KAAA,CAAM,OAAA;AAC/E,EAAAC,yCAAA,CAAwB,EAAE,UAAA,EAAY,IAAA,GAAO,MAAM,UAAA,GAAa,IAAA,EAAM,aAAa,CAAA;AACnF,EAAA,uBAAOC,cAAA,CAACC,kCAAA,EAAA,EAAkB,GAAG,KAAA,EAAO,OAAA,EAAkB,CAAA;AACxD;AAEO,SAAS,6BAAA,CAA8B,cAAc,oBAAA,EAAsB;AAChF,EAAA,MAAM,OAAOC,aAAA,EAAQ;AACrB,EAAA,MAAM,EAAE,WAAA,EAAa,MAAA,EAAQ,IAAA,EAAM,mBAAA,KAAwBJ,+BAAA,EAAc;AACzE,EAAA,MAAM,UAAUK,yBAAA,EAAe;AAC/B,EAAA,MAAM,EAAE,IAAA,EAAM,OAAA,EAAQ,GAAIC,mBAAA,CAAS;AAAA,IACjC,UAAU,CAAC,qBAAA,EAAuB,MAAA,EAAQ,IAAA,EAAM,YAAY,WAAW,CAAA;AAAA,IACvE,OAAA,E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CAAK,MAAA,CAAO,QAAQ,CAAA,CAAA,EAAI,kBAAA,CAAmB,EAAE,CAAC,CAAA,SAAA,CAAA,EAAa;AAAA,UAChF,MAAA,EAAQ,MAAA;AAAA,UACR,OAAA,EAAS,EAAE,cAAA,EAAgB,kBAAA,EAAmB;AAAA,UAC9C,IAAA,EAAM,KAAK,SAAA,CAAU;AAAA,YACnB,YAAY,OAAA,CAAQ,SAAA;AAAA,YACpB,aAAa,OAAA,CAAQ,WAAA;AAAA,YACrB,YAAY,OAAA,CAAQ,SAAA;AAAA,YACpB,eAAe,OAAA,CAAQ;AAAA,WACxB;AAAA,SACF,CAAA;AACD,QAAA,MAAM,QAAA,GAAY,MAAM,QAAA,CAAS,IAAA,EAAK;AACtC,QAAAA,YAAA,CAAO,QAAQ,oBAAoB,CAAA;AACnC,QAAA,OAAO,EAAE,WAAA,EAAa,QAAA,CAAS,YAAA,IAAgB,EAAC,EAAE;AAAA,MACpD,CAAA;AAAA,MACA,cAAA,EAAgB,OAAO,UAAA,KAAA,CAAgB,MAAM,KAAK,SAAA,CAAU,WAAA,CAAY,UAAU,CAAA,EAAG;AAAA,KACvF,CAAA;AAAA,IACA,CAAC,MAAM,MAAA,EAAQ,IAAA,EAAM,MAAM,OAAA,EAAS,mBAAA,EAAqB,WAAA,EAAa,OAAA,EAAS,WAAW;AAAA,GAC5F;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-3BJLNKOB.cjs","sourcesContent":["import { useMemo } from 'react'\nimport { useQuery, useQueryClient } from '@tanstack/react-query'\nimport { useArbi, notify, arbiQueryKeys } from '@arbidocs/react'\nimport { useConnection } from './ConnectionProvider'\nimport {\n NativeDocxEditor,\n type NativeDocxAdapter,\n type NativeDocxEditorProps,\n} from '../docx/NativeDocxEditor'\nimport { loadDocxFonts } from '../docx/fonts'\nimport { useRegisterOpenDocument } from '../chat/open-document'\n\n/** Native Word widget bound to the standard blocks connection and SDK session. */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: Omit<NativeDocxEditorProps, 'adapter'> & { fontBaseUrl?: string }) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnection()\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent && !props.compact\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n return <NativeDocxEditor {...props} adapter={adapter} />\n}\n\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, apiUrl, user, ensureWorkspaceOpen } = useConnection()\n const queries = useQueryClient()\n const { data: members } = useQuery({\n queryKey: ['native-docx-members', apiUrl, user?.externalId, workspaceId],\n enabled: arbi.isLoggedIn && !!workspaceId,\n queryFn: async () => {\n await ensureWorkspaceOpen()\n return arbi.workspaces.listUsers()\n },\n })\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n request: async (path, options) => {\n await ensureWorkspaceOpen()\n return arbi.editor.request(path, options)\n },\n open: async (id) => {\n await ensureWorkspaceOpen()\n return (\n await arbi.editor.request(`/${encodeURIComponent(id)}/session`, { method: 'POST' })\n ).json()\n },\n save: async (id, state) =>\n (\n await arbi.editor.request(`/${encodeURIComponent(id)}/save`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ state }),\n })\n ).json(),\n loadFonts: () => loadDocxFonts(fontBaseUrl),\n baseUrl: apiUrl,\n author: user?.name || 'You',\n onVersionSaved: async (id) => {\n if (!workspaceId) return\n const key = arbiQueryKeys.documents(workspaceId)\n try {\n const documents = await arbi.documents.get([id])\n if (!documents.length) throw new Error('The saved version is not available yet.')\n queries.setQueryData<Awaited<ReturnType<typeof arbi.documents.list>>>(key, (previous) => [\n ...documents,\n ...(previous || []).filter(\n (doc) => !documents.some((saved) => saved.external_id === doc.external_id)\n ),\n ])\n } catch {\n await queries.invalidateQueries({ queryKey: key })\n }\n },\n notify: (message, kind) => notify[kind](message),\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify.success('Mention delivered.')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n }),\n [arbi, apiUrl, user?.name, members, ensureWorkspaceOpen, fontBaseUrl, queries, workspaceId]\n )\n return adapter\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { UploadDropzone } from './chunk-EVUEIBNU.js';
3
2
  import { FoldSection } from './chunk-XD2M6LIG.js';
4
- import { workflowSteps, canAssign, nextAction, validateStep, assigneeName, runFieldsOf, failedUpstream, stepPhase, useElementSize, sendBackTargets, formatDate, shownValue, stepKindOf, stepLevels, waitingDocuments, stepDependencies, reviewInstructions, splitDocRef, isPersonStep, eventWaitingDocuments, waitingForDocumentsText, StepBadgeMark, StepChip, STEP_KIND_ICONS, DEFAULT_STEP_KIND_LABELS, composeStepPrompt, isRunFinished, runFields, isWorkflowScope } from './chunk-2DFDFOM7.js';
3
+ import { UploadDropzone } from './chunk-EVUEIBNU.js';
4
+ import { workflowSteps, canAssign, nextAction, validateStep, assigneeName, runFieldsOf, failedUpstream, stepPhase, useElementSize, sendBackTargets, formatDate, shownValue, stepKindOf, stepLevels, waitingDocuments, stepDependencies, reviewInstructions, splitDocRef, isPersonStep, eventWaitingDocuments, waitingForDocumentsText, StepBadgeMark, StepChip, STEP_KIND_ICONS, DEFAULT_STEP_KIND_LABELS, composeStepPrompt, isRunFinished, runFields, isWorkflowScope } from './chunk-7HAM7Y5U.js';
5
5
  import { TONE_DOT, TONE_SURFACE, TONE_SOLID_BORDER, TONE_BORDER } from './chunk-AUS3KBHJ.js';
6
6
  import { testIdOr, prefixedTestId } from './chunk-7F6CBP3Z.js';
7
7
  import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
@@ -2512,5 +2512,5 @@ function TaskActivityTimeline({
2512
2512
  }
2513
2513
 
2514
2514
  export { ActionStepBody, ApprovalEvidence, AssigneeLine, DEFAULT_SCHEMA_FORM_LABELS, DEFAULT_STEP_BAR_LABELS, DEFAULT_TASK_ACTIVITY_LABELS, DEFAULT_WORKFLOW_RUNNER_LABELS, DEFAULT_WORKFLOW_STEP_PARTS_LABELS, STEP_LABEL, STEP_LABEL_CURRENT, STEP_LABEL_MAX, SchemaForm, SendBackControl, StepBarFrame, TaskActivityTimeline, WorkflowRunner, WorkflowStepBar, activeStepId, fromPlanAssignee, fromPlanDocumentRef, fromPlanSteps, isIncompleteSignal, layoutFromPlanSteps, stepWindow, taskActivityHeadline, toPlanAssignee, toPlanDocumentRef, toPlanSteps, useWorkflowView };
2515
- //# sourceMappingURL=chunk-2PNNCEPH.js.map
2516
- //# sourceMappingURL=chunk-2PNNCEPH.js.map
2515
+ //# sourceMappingURL=chunk-54ANPPMV.js.map
2516
+ //# sourceMappingURL=chunk-54ANPPMV.js.map