@arbidocs/blocks 0.4.99 → 0.4.100

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 (54) hide show
  1. package/dist/agents/index.cjs +207 -207
  2. package/dist/agents/index.js +2 -2
  3. package/dist/{chunk-C5RF47LD.js → chunk-6HZNFOHW.js} +3 -3
  4. package/dist/{chunk-C5RF47LD.js.map → chunk-6HZNFOHW.js.map} +1 -1
  5. package/dist/{chunk-4ZTIMQ7Z.js → chunk-72PQ42YI.js} +933 -64
  6. package/dist/chunk-72PQ42YI.js.map +1 -0
  7. package/dist/{chunk-44TPPPRJ.cjs → chunk-B7P73VHX.cjs} +930 -60
  8. package/dist/chunk-B7P73VHX.cjs.map +1 -0
  9. package/dist/{chunk-3ICWR3BK.js → chunk-E2QWWLK5.js} +3 -3
  10. package/dist/{chunk-3ICWR3BK.js.map → chunk-E2QWWLK5.js.map} +1 -1
  11. package/dist/{chunk-QBEUCOC7.cjs → chunk-IE55TWIG.cjs} +5 -5
  12. package/dist/{chunk-QBEUCOC7.cjs.map → chunk-IE55TWIG.cjs.map} +1 -1
  13. package/dist/{chunk-5NQIBJPP.js → chunk-NJX774HB.js} +3 -3
  14. package/dist/{chunk-5NQIBJPP.js.map → chunk-NJX774HB.js.map} +1 -1
  15. package/dist/{chunk-DDYXFALG.cjs → chunk-NW3LFDZL.cjs} +3 -3
  16. package/dist/{chunk-DDYXFALG.cjs.map → chunk-NW3LFDZL.cjs.map} +1 -1
  17. package/dist/{chunk-MABEOI4S.cjs → chunk-O24WPHLD.cjs} +5 -5
  18. package/dist/{chunk-MABEOI4S.cjs.map → chunk-O24WPHLD.cjs.map} +1 -1
  19. package/dist/connect/docx.cjs +6 -6
  20. package/dist/connect/docx.js +4 -4
  21. package/dist/connect/index.cjs +3 -3
  22. package/dist/connect/index.js +2 -2
  23. package/dist/docx/NativeDocxEditor.d.ts +6 -1
  24. package/dist/docx/index.cjs +39 -35
  25. package/dist/docx/index.d.ts +1 -0
  26. package/dist/docx/index.js +3 -3
  27. package/dist/docx/layout/GenerateImage.d.ts +50 -0
  28. package/dist/docx/layout/LayoutRibbon.d.ts +32 -0
  29. package/dist/docx/layout/LayoutTabs.d.ts +20 -0
  30. package/dist/docx/layout/PictureRibbon.d.ts +23 -0
  31. package/dist/docx/layout/TableKeys.d.ts +25 -0
  32. package/dist/docx/layout/TableRibbon.d.ts +11 -0
  33. package/dist/docx/layout/caption.d.ts +38 -0
  34. package/dist/docx/layout/presets.d.ts +40 -0
  35. package/dist/facts/index.cjs +1 -1
  36. package/dist/facts/index.js +1 -1
  37. package/dist/files/index.cjs +1 -1
  38. package/dist/files/index.js +1 -1
  39. package/dist/home/index.cjs +1 -1
  40. package/dist/home/index.js +1 -1
  41. package/dist/index.cjs +258 -258
  42. package/dist/index.js +4 -4
  43. package/dist/shell/index.cjs +1 -1
  44. package/dist/shell/index.js +1 -1
  45. package/dist/studio/index.cjs +1 -1
  46. package/dist/studio/index.js +1 -1
  47. package/dist/workflow-canvas/index.cjs +9 -9
  48. package/dist/workflow-canvas/index.js +2 -2
  49. package/package.json +5 -4
  50. package/src/docx/README.md +22 -0
  51. package/src/docx/layout/layout.css +120 -0
  52. package/src/docx/styles.css +2 -0
  53. package/dist/chunk-44TPPPRJ.cjs.map +0 -1
  54. package/dist/chunk-4ZTIMQ7Z.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  var chunkMUMH3Z6K_cjs = require('./chunk-MUMH3Z6K.cjs');
5
- var chunk44TPPPRJ_cjs = require('./chunk-44TPPPRJ.cjs');
5
+ var chunkB7P73VHX_cjs = require('./chunk-B7P73VHX.cjs');
6
6
  var react$1 = require('react');
7
7
  var reactQuery = require('@tanstack/react-query');
8
8
  var react = require('@arbidocs/react');
@@ -13,7 +13,7 @@ function ConnectedNativeDocxEditor({
13
13
  ...props
14
14
  }) {
15
15
  const adapter = useConnectedNativeDocxAdapter(fontBaseUrl);
16
- return /* @__PURE__ */ jsxRuntime.jsx(chunk44TPPPRJ_cjs.NativeDocxEditor, { ...props, adapter });
16
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkB7P73VHX_cjs.NativeDocxEditor, { ...props, adapter });
17
17
  }
18
18
  function useConnectedNativeDocxAdapter(fontBaseUrl = "/native-docx/fonts") {
19
19
  const arbi = react.useArbi();
@@ -42,7 +42,7 @@ function useConnectedNativeDocxAdapter(fontBaseUrl = "/native-docx/fonts") {
42
42
  headers: { "Content-Type": "application/json" },
43
43
  body: JSON.stringify({ state })
44
44
  })).json(),
45
- loadFonts: () => chunk44TPPPRJ_cjs.loadDocxFonts(fontBaseUrl),
45
+ loadFonts: () => chunkB7P73VHX_cjs.loadDocxFonts(fontBaseUrl),
46
46
  baseUrl: apiUrl,
47
47
  author: user?.name || "You",
48
48
  onVersionSaved: async (id) => {
@@ -91,5 +91,5 @@ function useConnectedNativeDocxAdapter(fontBaseUrl = "/native-docx/fonts") {
91
91
 
92
92
  exports.ConnectedNativeDocxEditor = ConnectedNativeDocxEditor;
93
93
  exports.useConnectedNativeDocxAdapter = useConnectedNativeDocxAdapter;
94
- //# sourceMappingURL=chunk-MABEOI4S.cjs.map
95
- //# sourceMappingURL=chunk-MABEOI4S.cjs.map
94
+ //# sourceMappingURL=chunk-O24WPHLD.cjs.map
95
+ //# sourceMappingURL=chunk-O24WPHLD.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/ConnectedNativeDocxEditor.tsx"],"names":["jsx","NativeDocxEditor","useArbi","useConnection","useQueryClient","useQuery","useMemo","loadDocxFonts","arbiQueryKeys","notify"],"mappings":";;;;;;;;;AAYO,SAAS,yBAAA,CAA0B;AAAA,EACxC,WAAA,GAAc,oBAAA;AAAA,EACd,GAAG;AACL,CAAA,EAAsE;AACpE,EAAA,MAAM,OAAA,GAAU,8BAA8B,WAAW,CAAA;AACzD,EAAA,uBAAOA,cAAA,CAACC,kCAAA,EAAA,EAAkB,GAAG,KAAA,EA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AS,WAAW;AAAA,GAC5F;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-MABEOI4S.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'\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 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
+ {"version":3,"sources":["../src/connection/ConnectedNativeDocxEditor.tsx"],"names":["jsx","NativeDocxEditor","useArbi","useConnection","useQueryClient","useQuery","useMemo","loadDocxFonts","arbiQueryKeys","notify"],"mappings":";;;;;;;;;AAYO,SAAS,yBAAA,CAA0B;AAAA,EACxC,WAAA,GAAc,oBAAA;AAAA,EACd,GAAG;AACL,CAAA,EAAsE;AACpE,EAAA,MAAM,OAAA,GAAU,8BAA8B,WAAW,CAAA;AACzD,EAAA,uBAAOA,cAAA,CAACC,kCAAA,EAAA,EAAkB,GAAG,KAAA,EAAO,OAAA,EAAkB,CAAA;AACxD;AAEO,SAAS,6BAAA,CAA8B,cAAc,oBAAA,EAAsB;AAChF,EAAA,MAAM,OAAO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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'\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 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,10 +1,10 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkMABEOI4S_cjs = require('../chunk-MABEOI4S.cjs');
4
+ var chunkO24WPHLD_cjs = require('../chunk-O24WPHLD.cjs');
5
5
  require('../chunk-MUMH3Z6K.cjs');
6
- var chunkQBEUCOC7_cjs = require('../chunk-QBEUCOC7.cjs');
7
- require('../chunk-44TPPPRJ.cjs');
6
+ var chunkIE55TWIG_cjs = require('../chunk-IE55TWIG.cjs');
7
+ require('../chunk-B7P73VHX.cjs');
8
8
  require('../chunk-AOFATOT3.cjs');
9
9
  require('../chunk-RC25WMVB.cjs');
10
10
  require('../chunk-7UTB4PHM.cjs');
@@ -16,13 +16,13 @@ function ConnectedStreamedWordArtifact({
16
16
  fontBaseUrl,
17
17
  ...props
18
18
  }) {
19
- const adapter = chunkMABEOI4S_cjs.useConnectedNativeDocxAdapter(fontBaseUrl);
20
- return /* @__PURE__ */ jsxRuntime.jsx(chunkQBEUCOC7_cjs.StreamedWordArtifact, { ...props, adapter });
19
+ const adapter = chunkO24WPHLD_cjs.useConnectedNativeDocxAdapter(fontBaseUrl);
20
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkIE55TWIG_cjs.StreamedWordArtifact, { ...props, adapter });
21
21
  }
22
22
 
23
23
  Object.defineProperty(exports, "ConnectedNativeDocxEditor", {
24
24
  enumerable: true,
25
- get: function () { return chunkMABEOI4S_cjs.ConnectedNativeDocxEditor; }
25
+ get: function () { return chunkO24WPHLD_cjs.ConnectedNativeDocxEditor; }
26
26
  });
27
27
  exports.ConnectedStreamedWordArtifact = ConnectedStreamedWordArtifact;
28
28
  //# sourceMappingURL=docx.cjs.map
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { useConnectedNativeDocxAdapter } from '../chunk-C5RF47LD.js';
3
- export { ConnectedNativeDocxEditor } from '../chunk-C5RF47LD.js';
2
+ import { useConnectedNativeDocxAdapter } from '../chunk-6HZNFOHW.js';
3
+ export { ConnectedNativeDocxEditor } from '../chunk-6HZNFOHW.js';
4
4
  import '../chunk-OYMWV45N.js';
5
- import { StreamedWordArtifact } from '../chunk-3ICWR3BK.js';
6
- import '../chunk-4ZTIMQ7Z.js';
5
+ import { StreamedWordArtifact } from '../chunk-E2QWWLK5.js';
6
+ import '../chunk-72PQ42YI.js';
7
7
  import '../chunk-D3QPYKZG.js';
8
8
  import '../chunk-AF6RDAJF.js';
9
9
  import '../chunk-AA3PT6KR.js';
@@ -3,10 +3,10 @@
3
3
 
4
4
  var chunk5YXG342J_cjs = require('../chunk-5YXG342J.cjs');
5
5
  var chunkXMBYDLZQ_cjs = require('../chunk-XMBYDLZQ.cjs');
6
- var chunkMABEOI4S_cjs = require('../chunk-MABEOI4S.cjs');
6
+ var chunkO24WPHLD_cjs = require('../chunk-O24WPHLD.cjs');
7
7
  var chunkMUMH3Z6K_cjs = require('../chunk-MUMH3Z6K.cjs');
8
8
  var chunkJH6JTI76_cjs = require('../chunk-JH6JTI76.cjs');
9
- require('../chunk-44TPPPRJ.cjs');
9
+ require('../chunk-B7P73VHX.cjs');
10
10
  var chunkO4YPVYPO_cjs = require('../chunk-O4YPVYPO.cjs');
11
11
  var chunkLENXDIMY_cjs = require('../chunk-LENXDIMY.cjs');
12
12
  var chunkAOFATOT3_cjs = require('../chunk-AOFATOT3.cjs');
@@ -663,7 +663,7 @@ function WorkflowWordDialog({
663
663
  title: title ?? labels.wordTitle,
664
664
  size: "xl",
665
665
  testId: "workflow-word-dialog",
666
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "h-[70dvh] p-0", children: /* @__PURE__ */ jsxRuntime.jsx(chunkMABEOI4S_cjs.ConnectedNativeDocxEditor, { documentId: id, title: title ?? labels.wordTitle }) })
666
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "h-[70dvh] p-0", children: /* @__PURE__ */ jsxRuntime.jsx(chunkO24WPHLD_cjs.ConnectedNativeDocxEditor, { documentId: id, title: title ?? labels.wordTitle }) })
667
667
  }
668
668
  );
669
669
  }
@@ -2,11 +2,11 @@
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-W7NZRZ54.js';
3
3
  import { useWorkspaceDocs } from '../chunk-XQDM6T6C.js';
4
4
  export { ConnectedAssistantDock, redlineStats, textToArtifact, toRedlineMarkdown, useConnectedAiTask, useConnectedChat, useSemanticSearch, useWorkspaceDocs } from '../chunk-XQDM6T6C.js';
5
- import { ConnectedNativeDocxEditor } from '../chunk-C5RF47LD.js';
5
+ import { ConnectedNativeDocxEditor } from '../chunk-6HZNFOHW.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';
9
- import '../chunk-4ZTIMQ7Z.js';
9
+ import '../chunk-72PQ42YI.js';
10
10
  import { FilesFilterBar, FolderFilterButton, FolderPickerRow } from '../chunk-7RJTEWYM.js';
11
11
  import { WorkspaceActivityList, WorkspaceNotificationMenu, ThreadFollowMenuItem, ThreadFollowButton, TagTable, tagTableDocx } from '../chunk-Z3G65XHZ.js';
12
12
  import { DOCX_MIME_TYPE } from '../chunk-D3QPYKZG.js';
@@ -3,6 +3,7 @@ import React from 'react';
3
3
  import { type FontConfiguration } from '@docx-editor.dev/react';
4
4
  import type { DocxCollaborationSession } from '@arbidocs/coedit';
5
5
  import type { DefinitionSource } from '../tags/definitions';
6
+ import { type DocxImageGeneration } from './layout/GenerateImage';
6
7
  import { type HouseTemplateHost } from './template/HouseTemplate';
7
8
  /**
8
9
  * The editor path of a document's DOCX bytes. A version reference (`doc-…@v2`, a read-only
@@ -45,6 +46,8 @@ export interface NativeDocxAdapter {
45
46
  * Defined term and Update definitions, and typing `@@` in the body opens the term type-ahead.
46
47
  */
47
48
  definitions?: () => Promise<DefinitionSource[]>;
49
+ /** The platform's image generation. Present: the Insert tab offers Generate image. */
50
+ imageGeneration?: DocxImageGeneration;
48
51
  /**
49
52
  * The workspace's house template. Present: a blank note starts from it (its styles, numbering,
50
53
  * page setup, headers and footers), Insert offers its Quick Parts, and the Design tab and the
@@ -74,8 +77,10 @@ export interface NativeDocxEditorProps {
74
77
  export declare function DocxParticipants({ session }: {
75
78
  session?: DocxCollaborationSession;
76
79
  }): React.JSX.Element;
77
- export declare function DocxRibbon({ onSave, badge, }: {
80
+ export declare function DocxRibbon({ onSave, badge, imageGeneration, }: {
78
81
  onSave: () => void;
82
+ /** Insert › Generate image, when the host can generate images. */
83
+ imageGeneration?: DocxImageGeneration;
79
84
  /** A short state label at the end of the row, such as "Co-edit mode". */
80
85
  badge?: React.ReactNode;
81
86
  }): React.JSX.Element;
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkQBEUCOC7_cjs = require('../chunk-QBEUCOC7.cjs');
5
- var chunk44TPPPRJ_cjs = require('../chunk-44TPPPRJ.cjs');
4
+ var chunkIE55TWIG_cjs = require('../chunk-IE55TWIG.cjs');
5
+ var chunkB7P73VHX_cjs = require('../chunk-B7P73VHX.cjs');
6
6
  require('../chunk-AOFATOT3.cjs');
7
7
  require('../chunk-RC25WMVB.cjs');
8
8
  require('../chunk-7UTB4PHM.cjs');
@@ -60,7 +60,7 @@ function NativeDocxComparison({
60
60
  if (!documentId)
61
61
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "native-docx-error", role: "status", children: "Comparing Word documents\u2026" });
62
62
  return /* @__PURE__ */ jsxRuntime.jsx(
63
- chunk44TPPPRJ_cjs.NativeDocxEditor,
63
+ chunkB7P73VHX_cjs.NativeDocxEditor,
64
64
  {
65
65
  adapter,
66
66
  documentId,
@@ -72,131 +72,135 @@ function NativeDocxComparison({
72
72
 
73
73
  Object.defineProperty(exports, "StreamedWordArtifact", {
74
74
  enumerable: true,
75
- get: function () { return chunkQBEUCOC7_cjs.StreamedWordArtifact; }
75
+ get: function () { return chunkIE55TWIG_cjs.StreamedWordArtifact; }
76
76
  });
77
77
  Object.defineProperty(exports, "BUILTIN_TEMPLATE_NAME", {
78
78
  enumerable: true,
79
- get: function () { return chunk44TPPPRJ_cjs.BUILTIN_TEMPLATE_NAME; }
79
+ get: function () { return chunkB7P73VHX_cjs.BUILTIN_TEMPLATE_NAME; }
80
80
  });
81
81
  Object.defineProperty(exports, "DEFAULT_DEFINED_TERMS_LABELS", {
82
82
  enumerable: true,
83
- get: function () { return chunk44TPPPRJ_cjs.DEFAULT_DEFINED_TERMS_LABELS; }
83
+ get: function () { return chunkB7P73VHX_cjs.DEFAULT_DEFINED_TERMS_LABELS; }
84
84
  });
85
85
  Object.defineProperty(exports, "DEFINED_TERM_TRIGGER", {
86
86
  enumerable: true,
87
- get: function () { return chunk44TPPPRJ_cjs.DEFINED_TERM_TRIGGER; }
87
+ get: function () { return chunkB7P73VHX_cjs.DEFINED_TERM_TRIGGER; }
88
88
  });
89
89
  Object.defineProperty(exports, "DefinedTermsProvider", {
90
90
  enumerable: true,
91
- get: function () { return chunk44TPPPRJ_cjs.DefinedTermsProvider; }
91
+ get: function () { return chunkB7P73VHX_cjs.DefinedTermsProvider; }
92
92
  });
93
93
  Object.defineProperty(exports, "DocxAuthorContext", {
94
94
  enumerable: true,
95
- get: function () { return chunk44TPPPRJ_cjs.DocxAuthorContext; }
95
+ get: function () { return chunkB7P73VHX_cjs.DocxAuthorContext; }
96
96
  });
97
97
  Object.defineProperty(exports, "DocxCommentActivity", {
98
98
  enumerable: true,
99
- get: function () { return chunk44TPPPRJ_cjs.DocxCommentActivity; }
99
+ get: function () { return chunkB7P73VHX_cjs.DocxCommentActivity; }
100
100
  });
101
101
  Object.defineProperty(exports, "DocxEditorReview", {
102
102
  enumerable: true,
103
- get: function () { return chunk44TPPPRJ_cjs.DocxEditorReview; }
103
+ get: function () { return chunkB7P73VHX_cjs.DocxEditorReview; }
104
104
  });
105
105
  Object.defineProperty(exports, "DocxMentions", {
106
106
  enumerable: true,
107
- get: function () { return chunk44TPPPRJ_cjs.DocxMentions; }
107
+ get: function () { return chunkB7P73VHX_cjs.DocxMentions; }
108
108
  });
109
109
  Object.defineProperty(exports, "DocxParticipants", {
110
110
  enumerable: true,
111
- get: function () { return chunk44TPPPRJ_cjs.DocxParticipants; }
111
+ get: function () { return chunkB7P73VHX_cjs.DocxParticipants; }
112
112
  });
113
113
  Object.defineProperty(exports, "DocxRibbon", {
114
114
  enumerable: true,
115
- get: function () { return chunk44TPPPRJ_cjs.DocxRibbon; }
115
+ get: function () { return chunkB7P73VHX_cjs.DocxRibbon; }
116
+ });
117
+ Object.defineProperty(exports, "GenerateImageButton", {
118
+ enumerable: true,
119
+ get: function () { return chunkB7P73VHX_cjs.GenerateImageButton; }
116
120
  });
117
121
  Object.defineProperty(exports, "HouseTemplateProvider", {
118
122
  enumerable: true,
119
- get: function () { return chunk44TPPPRJ_cjs.HouseTemplateProvider; }
123
+ get: function () { return chunkB7P73VHX_cjs.HouseTemplateProvider; }
120
124
  });
121
125
  Object.defineProperty(exports, "NativeDocxEditor", {
122
126
  enumerable: true,
123
- get: function () { return chunk44TPPPRJ_cjs.NativeDocxEditor; }
127
+ get: function () { return chunkB7P73VHX_cjs.NativeDocxEditor; }
124
128
  });
125
129
  Object.defineProperty(exports, "builtinHouseTemplate", {
126
130
  enumerable: true,
127
- get: function () { return chunk44TPPPRJ_cjs.builtinHouseTemplate; }
131
+ get: function () { return chunkB7P73VHX_cjs.builtinHouseTemplate; }
128
132
  });
129
133
  Object.defineProperty(exports, "contentPath", {
130
134
  enumerable: true,
131
- get: function () { return chunk44TPPPRJ_cjs.contentPath; }
135
+ get: function () { return chunkB7P73VHX_cjs.contentPath; }
132
136
  });
133
137
  Object.defineProperty(exports, "editorPort", {
134
138
  enumerable: true,
135
- get: function () { return chunk44TPPPRJ_cjs.editorPort; }
139
+ get: function () { return chunkB7P73VHX_cjs.editorPort; }
136
140
  });
137
141
  Object.defineProperty(exports, "findDefinitionsSection", {
138
142
  enumerable: true,
139
- get: function () { return chunk44TPPPRJ_cjs.findDefinitionsSection; }
143
+ get: function () { return chunkB7P73VHX_cjs.findDefinitionsSection; }
140
144
  });
141
145
  Object.defineProperty(exports, "insertDefinedTerm", {
142
146
  enumerable: true,
143
- get: function () { return chunk44TPPPRJ_cjs.insertDefinedTerm; }
147
+ get: function () { return chunkB7P73VHX_cjs.insertDefinedTerm; }
144
148
  });
145
149
  Object.defineProperty(exports, "loadDocxFonts", {
146
150
  enumerable: true,
147
- get: function () { return chunk44TPPPRJ_cjs.loadDocxFonts; }
151
+ get: function () { return chunkB7P73VHX_cjs.loadDocxFonts; }
148
152
  });
149
153
  Object.defineProperty(exports, "normalizeDocxExport", {
150
154
  enumerable: true,
151
- get: function () { return chunk44TPPPRJ_cjs.normalizeDocxExport; }
155
+ get: function () { return chunkB7P73VHX_cjs.normalizeDocxExport; }
152
156
  });
153
157
  Object.defineProperty(exports, "resolveHouseTemplate", {
154
158
  enumerable: true,
155
- get: function () { return chunk44TPPPRJ_cjs.resolveHouseTemplate; }
159
+ get: function () { return chunkB7P73VHX_cjs.resolveHouseTemplate; }
156
160
  });
157
161
  Object.defineProperty(exports, "reviewModule", {
158
162
  enumerable: true,
159
- get: function () { return chunk44TPPPRJ_cjs.reviewModule; }
163
+ get: function () { return chunkB7P73VHX_cjs.reviewModule; }
160
164
  });
161
165
  Object.defineProperty(exports, "structuralPort", {
162
166
  enumerable: true,
163
- get: function () { return chunk44TPPPRJ_cjs.structuralPort; }
167
+ get: function () { return chunkB7P73VHX_cjs.structuralPort; }
164
168
  });
165
169
  Object.defineProperty(exports, "templateFileName", {
166
170
  enumerable: true,
167
- get: function () { return chunk44TPPPRJ_cjs.templateFileName; }
171
+ get: function () { return chunkB7P73VHX_cjs.templateFileName; }
168
172
  });
169
173
  Object.defineProperty(exports, "trackedOrNoted", {
170
174
  enumerable: true,
171
- get: function () { return chunk44TPPPRJ_cjs.trackedOrNoted; }
175
+ get: function () { return chunkB7P73VHX_cjs.trackedOrNoted; }
172
176
  });
173
177
  Object.defineProperty(exports, "updateDefinitions", {
174
178
  enumerable: true,
175
- get: function () { return chunk44TPPPRJ_cjs.updateDefinitions; }
179
+ get: function () { return chunkB7P73VHX_cjs.updateDefinitions; }
176
180
  });
177
181
  Object.defineProperty(exports, "useDefinedTerms", {
178
182
  enumerable: true,
179
- get: function () { return chunk44TPPPRJ_cjs.useDefinedTerms; }
183
+ get: function () { return chunkB7P73VHX_cjs.useDefinedTerms; }
180
184
  });
181
185
  Object.defineProperty(exports, "useHouseTemplate", {
182
186
  enumerable: true,
183
- get: function () { return chunk44TPPPRJ_cjs.useHouseTemplate; }
187
+ get: function () { return chunkB7P73VHX_cjs.useHouseTemplate; }
184
188
  });
185
189
  Object.defineProperty(exports, "useReview", {
186
190
  enumerable: true,
187
- get: function () { return chunk44TPPPRJ_cjs.useReview; }
191
+ get: function () { return chunkB7P73VHX_cjs.useReview; }
188
192
  });
189
193
  Object.defineProperty(exports, "useReviewItem", {
190
194
  enumerable: true,
191
- get: function () { return chunk44TPPPRJ_cjs.useReviewItem; }
195
+ get: function () { return chunkB7P73VHX_cjs.useReviewItem; }
192
196
  });
193
197
  Object.defineProperty(exports, "useTrackedOrNoted", {
194
198
  enumerable: true,
195
- get: function () { return chunk44TPPPRJ_cjs.useTrackedOrNoted; }
199
+ get: function () { return chunkB7P73VHX_cjs.useTrackedOrNoted; }
196
200
  });
197
201
  Object.defineProperty(exports, "withDirectEditing", {
198
202
  enumerable: true,
199
- get: function () { return chunk44TPPPRJ_cjs.withDirectEditing; }
203
+ get: function () { return chunkB7P73VHX_cjs.withDirectEditing; }
200
204
  });
201
205
  Object.defineProperty(exports, "DocxEditor", {
202
206
  enumerable: true,
@@ -12,6 +12,7 @@ export { NativeDocxComparison, type NativeDocxComparisonProps } from './NativeDo
12
12
  export { DefinedTermsProvider, useDefinedTerms, DEFINED_TERM_TRIGGER, DEFAULT_DEFINED_TERMS_LABELS, type DefinedTermsProviderProps, type DefinedTermsLabels, } from './definitions/DefinedTerms';
13
13
  export { insertDefinedTerm, updateDefinitions, findDefinitionsSection, type UpdateDefinitionsResult, } from './definitions/commands';
14
14
  export { editorPort, withDirectEditing, type DefinitionsPort } from './definitions/port';
15
+ export { GenerateImageButton, type DocxImageGeneration } from './layout/GenerateImage';
15
16
  export { structuralPort, trackedOrNoted, type StructuralInsert, type StructuralOutcome, type StructuralPort, } from './structural/trackedOrNoted';
16
17
  export { DocxAuthorContext, useTrackedOrNoted } from './structural/useTrackedOrNoted';
17
18
  export { contentPath } from './NativeDocxEditor';
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- export { StreamedWordArtifact } from '../chunk-3ICWR3BK.js';
3
- import { NativeDocxEditor } from '../chunk-4ZTIMQ7Z.js';
4
- export { BUILTIN_TEMPLATE_NAME, DEFAULT_DEFINED_TERMS_LABELS, DEFINED_TERM_TRIGGER, DefinedTermsProvider, DocxAuthorContext, DocxCommentActivity, DocxEditorReview, DocxMentions, DocxParticipants, DocxRibbon, HouseTemplateProvider, NativeDocxEditor, builtinHouseTemplate, contentPath, editorPort, findDefinitionsSection, insertDefinedTerm, loadDocxFonts, normalizeDocxExport, resolveHouseTemplate, reviewModule, structuralPort, templateFileName, trackedOrNoted, updateDefinitions, useDefinedTerms, useHouseTemplate, useReview, useReviewItem, useTrackedOrNoted, withDirectEditing } from '../chunk-4ZTIMQ7Z.js';
2
+ export { StreamedWordArtifact } from '../chunk-E2QWWLK5.js';
3
+ import { NativeDocxEditor } from '../chunk-72PQ42YI.js';
4
+ export { BUILTIN_TEMPLATE_NAME, DEFAULT_DEFINED_TERMS_LABELS, DEFINED_TERM_TRIGGER, DefinedTermsProvider, DocxAuthorContext, DocxCommentActivity, DocxEditorReview, DocxMentions, DocxParticipants, DocxRibbon, GenerateImageButton, HouseTemplateProvider, NativeDocxEditor, builtinHouseTemplate, contentPath, editorPort, findDefinitionsSection, insertDefinedTerm, loadDocxFonts, normalizeDocxExport, resolveHouseTemplate, reviewModule, structuralPort, templateFileName, trackedOrNoted, updateDefinitions, useDefinedTerms, useHouseTemplate, useReview, useReviewItem, useTrackedOrNoted, withDirectEditing } from '../chunk-72PQ42YI.js';
5
5
  import '../chunk-D3QPYKZG.js';
6
6
  import '../chunk-AF6RDAJF.js';
7
7
  import '../chunk-AA3PT6KR.js';
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Insert › Generate image: a prompt goes to the host's image generation (the platform's `/image`
3
+ * command), and the picture that comes back is inserted where the caret was when Generate was
4
+ * pressed, as an ordinary inline picture whose alt text is the prompt. The engine stores the bytes
5
+ * as the document's own media part, so the picture saves with the DOCX like any inserted one.
6
+ *
7
+ * Generation takes a while. The caret is remembered by the paragraph's `w14:paraId`, which survives
8
+ * a collaboration room re-installing the document meanwhile, and the person may keep writing. The
9
+ * ribbon may even be remounted meanwhile (a new editor instance over the same room): the picture
10
+ * then goes into whichever mounted editor holds that paragraph.
11
+ */
12
+ import React from 'react';
13
+ import { useDocxEditor } from '@docx-editor.dev/react';
14
+ /** The host's image generation, as the editor uses it. */
15
+ export interface DocxImageGeneration {
16
+ /** Generate one image from `prompt` and return its bytes (PNG, JPEG, GIF or WebP). */
17
+ generate: (prompt: string, options: {
18
+ aspectRatio?: string;
19
+ signal?: AbortSignal;
20
+ }) => Promise<Uint8Array>;
21
+ /** The aspect ratios the image model accepts; none offers only the model's default. */
22
+ aspectRatios?: readonly {
23
+ value: string;
24
+ label: string;
25
+ }[];
26
+ notify?: (message: string, kind: 'success' | 'error') => void;
27
+ }
28
+ type Editor = NonNullable<ReturnType<typeof useDocxEditor>>;
29
+ interface Caret {
30
+ paraId: string | null;
31
+ paragraphId: string;
32
+ offset: number;
33
+ }
34
+ /**
35
+ * The editor to insert into: the one the request came from while it is still mounted, else the
36
+ * newest mounted editor whose document holds the remembered paragraph. Null when the document was
37
+ * closed meanwhile.
38
+ */
39
+ export declare function insertionTarget(origin: Editor, caret: Caret | null, editors?: readonly Editor[]): Editor | null;
40
+ /** Insert `bytes` at `caret` as an inline picture. Throws with a readable reason on refusal. */
41
+ export declare function insertGeneratedImage(editor: Editor, bytes: Uint8Array, prompt: string, caret: Caret | null): Promise<void>;
42
+ /**
43
+ * Make this ribbon's editor a place a running generation can land. The ribbon calls it whatever its
44
+ * tab: a remounted editor opens on Home, without the Generate image button.
45
+ */
46
+ export declare function useGenerateImageTarget(): void;
47
+ export declare function GenerateImageButton({ generation }: {
48
+ generation: DocxImageGeneration;
49
+ }): React.JSX.Element | null;
50
+ export {};
@@ -0,0 +1,32 @@
1
+ /**
2
+ * The native editor's Layout tab, laid out like Word's Page Setup group: Margins, Orientation,
3
+ * Size, Columns, Breaks, and the Page Setup dialog for anything the galleries do not offer.
4
+ *
5
+ * Everything goes through the engine's own commands: `setPageSetup` (scoped to the caret's section,
6
+ * as Word's galleries are) for the galleries, the engine's break slots for Breaks, and its packaged
7
+ * Page Setup dialog. Columns are offered but disabled: the engine lays out a document's existing
8
+ * `w:cols`, but has no command that writes them (see the README).
9
+ */
10
+ import React from 'react';
11
+ /** Why Columns is disabled, in the words the tooltip shows. */
12
+ export declare const COLUMNS_UNSUPPORTED = "Text columns are not available in this editor yet. Documents that already use columns display and save them unchanged.";
13
+ interface Choice {
14
+ id: string;
15
+ label: string;
16
+ detail?: string;
17
+ icon?: React.ReactNode;
18
+ disabled?: boolean;
19
+ title?: string;
20
+ }
21
+ /** A ribbon gallery: one column of choices, the current one marked, closing once one is picked. */
22
+ export declare function RibbonGallery({ label, choices, current, onPick, close, testId, }: {
23
+ label: string;
24
+ choices: readonly Choice[];
25
+ current?: string | null;
26
+ onPick: (id: string) => void;
27
+ close: () => void;
28
+ testId?: string;
29
+ }): React.JSX.Element;
30
+ /** Layout tab: Margins, Orientation, Size, Columns, Breaks, Page Setup. */
31
+ export declare function LayoutButtons(): React.JSX.Element;
32
+ export {};
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The ribbon tabs this folder adds: Layout always, and Word's contextual Table and Picture tabs
3
+ * while the caret is in a table or a picture is selected.
4
+ */
5
+ import React from 'react';
6
+ export declare const LAYOUT_TAB = "Layout";
7
+ export declare const TABLE_TAB = "Table";
8
+ export declare const PICTURE_TAB = "Picture";
9
+ /**
10
+ * The contextual tabs available now, and the tab to show: a contextual tab that no longer applies
11
+ * (the caret left the table, the picture was deselected) falls back to Home, as Word's does.
12
+ */
13
+ export declare function useContextualTabs(tab: string): {
14
+ tabs: string[];
15
+ shown: string;
16
+ };
17
+ /** The body of the Layout, Table or Picture tab; nothing for the other tabs. */
18
+ export declare function LayoutTabContent({ tab }: {
19
+ tab: string;
20
+ }): React.JSX.Element | null;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The native editor's contextual Picture tab — Word's Picture Format tab — offered while a picture
3
+ * is selected: Wrap Text, Size & Position, Alt Text (the engine's packaged picture chrome), rotate
4
+ * and flip, and Insert Caption.
5
+ */
6
+ import React from 'react';
7
+ import { useDocxEditor } from '@docx-editor.dev/react';
8
+ import { useTrackedOrNoted } from '../structural/useTrackedOrNoted';
9
+ import { type CaptionLabel } from './caption';
10
+ type Editor = NonNullable<ReturnType<typeof useDocxEditor>>;
11
+ /**
12
+ * Insert a caption paragraph directly after the caret's paragraph (the picture's), numbered after
13
+ * the captions with the same label that come before it. Returns the inserted number, or null when
14
+ * the editor refused.
15
+ */
16
+ export declare function insertCaption(editor: Editor, label: CaptionLabel, text: string, track: ReturnType<typeof useTrackedOrNoted>): number | null;
17
+ /** Word's Insert Caption: a label, the caption text, and Insert. */
18
+ export declare function CaptionButton({ defaultLabel }: {
19
+ defaultLabel?: CaptionLabel;
20
+ }): React.JSX.Element;
21
+ /** Picture tab: Wrap Text, Size & Position, Alt Text, rotate and flip, Insert Caption. */
22
+ export declare function PictureButtons(): React.JSX.Element;
23
+ export {};
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Word's Tab and Shift+Tab in a table: move to the next or previous cell, and Tab in the last cell
3
+ * adds a row. The engine types a tab character into the cell instead, so the keys are bound here,
4
+ * ahead of the editor's own handling, the way `WordShortcuts` binds note and style keys.
5
+ */
6
+ import { type RefObject } from 'react';
7
+ type Node = {
8
+ id?: string;
9
+ kind?: string;
10
+ localName?: string;
11
+ children?: readonly Node[];
12
+ };
13
+ /**
14
+ * The cells of the innermost table holding `paragraphId`, in reading order (each as its first
15
+ * paragraph), and which of them holds it. Null outside a table.
16
+ */
17
+ export declare function tableCells(root: Node, paragraphId: string): {
18
+ cells: string[];
19
+ index: number;
20
+ } | null;
21
+ /** Binds Tab and Shift+Tab in tables inside `scope`. Renders nothing; mount inside `DocxEditor.Root`. */
22
+ export declare function TableTabKeys({ scope }: {
23
+ scope: RefObject<HTMLElement | null>;
24
+ }): null;
25
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The native editor's contextual Table tab — Word's Table Design and Table Layout tabs in one row,
3
+ * offered while the caret is in a table.
4
+ *
5
+ * Rows, columns, deletion and cell alignment are the engine's table commands; borders and shading
6
+ * are its packaged table chrome. Merge, Split and Header Row are bound to the engine's commands
7
+ * too, so they show the engine's own reason while it refuses them and work as soon as it does not.
8
+ */
9
+ import React from 'react';
10
+ /** Table tab: insert and delete rows and columns, merge, split, header row, borders and shading. */
11
+ export declare function TableButtons(): React.JSX.Element;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Word's Insert Caption: a paragraph in the `Caption` style reading `Figure 1: text`, whose
3
+ * number is a `SEQ Figure` field so Word renumbers every caption when fields update.
4
+ *
5
+ * The engine has no caption command, but its paste lands an embedded `.docx` fragment intact —
6
+ * the `w:fldSimple` and the paragraph style, whose definition is merged into the document when
7
+ * the document has none. The number written as the field's result is the next one in reading
8
+ * order at insertion; the engine paints a SEQ field's stored result rather than recomputing it.
9
+ */
10
+ import { type Revision } from '@arbidocs/coedit/template';
11
+ export declare const CAPTION_LABELS: readonly ["Figure", "Table", "Equation"];
12
+ export type CaptionLabel = (typeof CAPTION_LABELS)[number];
13
+ type Node = {
14
+ id?: string;
15
+ localName?: string;
16
+ kind?: string;
17
+ value?: string;
18
+ attributes?: readonly {
19
+ localName: string;
20
+ value: string;
21
+ }[];
22
+ children?: readonly Node[];
23
+ };
24
+ /** The `SEQ` identifier of a field instruction (`SEQ Figure \* ARABIC` -> `Figure`). */
25
+ export declare function seqIdentifier(instruction: string): string | null;
26
+ /**
27
+ * How many `SEQ <label>` fields the tree holds — simple fields and complex `w:instrText` ones — in
28
+ * reading order up to and including the paragraph `throughId` (all of them when absent).
29
+ */
30
+ export declare function countSeqFields(root: Node, label: string, throughId?: string): number;
31
+ /** The caption paragraph: `Label N` with N a SEQ field, then `: text` when there is text. */
32
+ export declare function captionParagraphXml(label: string, number: number, text: string): string;
33
+ /**
34
+ * Clipboard HTML that pastes the caption as a whole paragraph (the editor's own fragment form),
35
+ * marked as a tracked insertion by `revision` when one is given.
36
+ */
37
+ export declare function captionFragmentHtml(label: string, number: number, text: string, revision?: Revision | null): string;
38
+ export {};