@eigenpal/docx-editor-core 1.0.2 → 1.1.0

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 (266) hide show
  1. package/LICENSE +13 -16
  2. package/README.md +1 -1
  3. package/dist/agent/index.d.mts +4 -5
  4. package/dist/agent/index.d.ts +4 -5
  5. package/dist/agent/index.js +1 -1
  6. package/dist/agent/index.mjs +1 -1
  7. package/dist/{chunk-NLTX7XVR.js → chunk-25KY5HLN.js} +1 -1
  8. package/dist/chunk-44FHVKSI.js +1 -0
  9. package/dist/{chunk-4S5VOHQK.mjs → chunk-5CDBSK2R.mjs} +1 -1
  10. package/dist/chunk-6Y6LON6Y.mjs +1 -0
  11. package/dist/chunk-6ZXL3EIP.mjs +2 -0
  12. package/dist/chunk-73AZQWIE.js +1 -0
  13. package/dist/chunk-7HANRHHL.js +1 -0
  14. package/dist/chunk-7LRR7RKE.mjs +15 -0
  15. package/dist/{chunk-AGNZEOVL.mjs → chunk-7Z2AGPNQ.mjs} +1 -1
  16. package/dist/chunk-BGE57OES.js +1 -0
  17. package/dist/chunk-BOOHU5EW.mjs +1 -0
  18. package/dist/chunk-CA2EYL6T.mjs +1 -0
  19. package/dist/chunk-CTHHUJAB.mjs +2 -0
  20. package/dist/chunk-DLCDDB66.mjs +3 -0
  21. package/dist/chunk-DV6GWBUJ.js +2 -0
  22. package/dist/chunk-E4JMCA5X.js +2 -0
  23. package/dist/chunk-F44ZLDZS.js +4 -0
  24. package/dist/chunk-FCJWLEKT.mjs +1 -0
  25. package/dist/chunk-FDEDN2RC.mjs +0 -0
  26. package/dist/chunk-FEWCI2E5.mjs +1 -0
  27. package/dist/chunk-GFDIPDJ6.mjs +1 -0
  28. package/dist/chunk-GM4USWKO.js +2 -0
  29. package/dist/chunk-GWBVJZVT.js +3 -0
  30. package/dist/chunk-GY5BWVM7.js +1 -0
  31. package/dist/{chunk-7SGC3CXJ.js → chunk-H42RXHT4.js} +1 -1
  32. package/dist/chunk-HMBVSDCH.mjs +1 -0
  33. package/dist/chunk-HQPWFUP5.js +2 -0
  34. package/dist/chunk-HV6HE6YR.js +59 -0
  35. package/dist/chunk-IF4C25FN.mjs +1 -0
  36. package/dist/chunk-IMKU4O3P.js +1 -0
  37. package/dist/chunk-IQG3KLWY.mjs +2 -0
  38. package/dist/{chunk-AFMMYLPX.js → chunk-J4J2Y6EU.js} +2 -2
  39. package/dist/chunk-KGDXHUYC.js +1 -0
  40. package/dist/chunk-KHF4JU7D.mjs +1 -0
  41. package/dist/chunk-LCICADWM.js +2 -0
  42. package/dist/{chunk-GFQM7PKY.js → chunk-LOCW6MR2.js} +1 -1
  43. package/dist/chunk-LTHT4A4S.js +1 -0
  44. package/dist/chunk-MJ6XZFVD.mjs +1 -0
  45. package/dist/chunk-MNOHUTKE.js +15 -0
  46. package/dist/chunk-MP4QSEO2.mjs +1 -0
  47. package/dist/chunk-MZ2XCZAN.mjs +1 -0
  48. package/dist/chunk-OAWTQ3IY.js +1 -0
  49. package/dist/chunk-OEXVWIHW.mjs +2 -0
  50. package/dist/chunk-ONRBRDIC.mjs +59 -0
  51. package/dist/{chunk-6PR4XHQ3.mjs → chunk-ONWOHAFW.mjs} +1 -1
  52. package/dist/{chunk-EXOP727C.mjs → chunk-OUEKNYX5.mjs} +1 -1
  53. package/dist/chunk-OX75Q5ZG.mjs +1 -0
  54. package/dist/chunk-QEACB5VG.js +1 -0
  55. package/dist/chunk-RFC2SXZ6.mjs +4 -0
  56. package/dist/chunk-RFVFX5WK.mjs +1 -0
  57. package/dist/chunk-SORYYVJ7.js +1 -0
  58. package/dist/chunk-TUIEV7Q7.js +1 -0
  59. package/dist/chunk-U74VPTIU.js +1 -0
  60. package/dist/chunk-UOQT6A7P.js +1 -0
  61. package/dist/chunk-V5VDCQDN.mjs +1 -0
  62. package/dist/chunk-VHUVPHPI.mjs +1 -0
  63. package/dist/{chunk-XCMA7AY7.js → chunk-W7GLQ6DV.js} +1 -1
  64. package/dist/chunk-WLHNIXWC.mjs +2 -0
  65. package/dist/chunk-X6HFDXKB.js +1 -0
  66. package/dist/chunk-XPV6VILW.mjs +1 -0
  67. package/dist/chunk-Y3ZQQI4D.js +1 -0
  68. package/dist/chunk-YTDWMXNS.js +1 -0
  69. package/dist/chunk-ZUGNF5KU.js +1 -0
  70. package/dist/chunk-ZX26QZJ5.mjs +1 -0
  71. package/dist/{colorResolver-CVsPLsw1.d.ts → colorResolver-BZ_yScf4.d.ts} +1 -1
  72. package/dist/{colorResolver-C3q7MLLD.d.mts → colorResolver-C6DtsoFI.d.mts} +1 -1
  73. package/dist/content-5Mrz6w_b.d.mts +1360 -0
  74. package/dist/content-CmqAwdFL.d.ts +1360 -0
  75. package/dist/core-plugins.d.mts +3 -4
  76. package/dist/core-plugins.d.ts +3 -4
  77. package/dist/core-plugins.js +1 -1
  78. package/dist/core-plugins.mjs +1 -1
  79. package/dist/core.d.mts +10 -11
  80. package/dist/core.d.ts +10 -11
  81. package/dist/core.js +1 -1
  82. package/dist/core.mjs +1 -1
  83. package/dist/{documentSerializer-Chn7J1WG.d.ts → documentSerializer-BRaaXIHm.d.ts} +1 -1
  84. package/dist/{documentSerializer-C1ueey5d.d.mts → documentSerializer-DgO3A9av.d.mts} +1 -1
  85. package/dist/docx/index.d.mts +3 -4
  86. package/dist/docx/index.d.ts +3 -4
  87. package/dist/docx/index.js +1 -1
  88. package/dist/docx/index.mjs +1 -1
  89. package/dist/docx/parser.d.mts +3 -4
  90. package/dist/docx/parser.d.ts +3 -4
  91. package/dist/docx/parser.js +1 -1
  92. package/dist/docx/parser.mjs +1 -1
  93. package/dist/docx/rezip.d.mts +3 -4
  94. package/dist/docx/rezip.d.ts +3 -4
  95. package/dist/docx/rezip.js +1 -1
  96. package/dist/docx/rezip.mjs +1 -1
  97. package/dist/docx/serializer/index.d.mts +4 -5
  98. package/dist/docx/serializer/index.d.ts +4 -5
  99. package/dist/docx/serializer/index.js +1 -1
  100. package/dist/docx/serializer/index.mjs +1 -1
  101. package/dist/{fontLoader-BOt95Jtf.d.mts → fontLoader-8b4X-AIh.d.mts} +63 -3
  102. package/dist/{fontLoader-QPwbcX5j.d.ts → fontLoader-CK2QLq68.d.ts} +63 -3
  103. package/dist/{formatting-D9I-lFS4.d.mts → formatting-BH4hcZiq.d.mts} +1 -1
  104. package/dist/{formatting-BwpZWdGi.d.ts → formatting-_OXU8gLB.d.ts} +1 -1
  105. package/dist/{headerFooterLayout-DkclHZ0Z.d.mts → headerFooterLayout-72Vz7yp3.d.mts} +94 -3
  106. package/dist/{headerFooterLayout-B3QVg556.d.ts → headerFooterLayout-Ca4ESDHF.d.ts} +94 -3
  107. package/dist/headless.d.mts +9 -9
  108. package/dist/headless.d.ts +9 -9
  109. package/dist/headless.js +1 -1
  110. package/dist/headless.mjs +1 -1
  111. package/dist/layout-bridge/index.d.mts +7 -7
  112. package/dist/layout-bridge/index.d.ts +7 -7
  113. package/dist/layout-bridge/index.js +1 -1
  114. package/dist/layout-bridge/index.mjs +1 -1
  115. package/dist/layout-bridge/measuring/index.d.mts +43 -2
  116. package/dist/layout-bridge/measuring/index.d.ts +43 -2
  117. package/dist/layout-bridge/measuring/index.js +1 -1
  118. package/dist/layout-bridge/measuring/index.mjs +1 -1
  119. package/dist/layout-bridge/tableInsertHover.js +1 -1
  120. package/dist/layout-bridge/tableInsertHover.mjs +1 -1
  121. package/dist/layout-bridge/toFlowBlocks.d.mts +11 -3
  122. package/dist/layout-bridge/toFlowBlocks.d.ts +11 -3
  123. package/dist/layout-bridge/toFlowBlocks.js +1 -1
  124. package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
  125. package/dist/layout-engine/index.d.mts +33 -3
  126. package/dist/layout-engine/index.d.ts +33 -3
  127. package/dist/layout-engine/index.js +1 -1
  128. package/dist/layout-engine/index.mjs +1 -1
  129. package/dist/layout-engine/types.d.mts +53 -0
  130. package/dist/layout-engine/types.d.ts +53 -0
  131. package/dist/layout-painter/index.d.mts +4 -5
  132. package/dist/layout-painter/index.d.ts +4 -5
  133. package/dist/layout-painter/index.js +1 -1
  134. package/dist/layout-painter/index.mjs +1 -1
  135. package/dist/layout-painter/renderPage.d.mts +4 -5
  136. package/dist/layout-painter/renderPage.d.ts +4 -5
  137. package/dist/layout-painter/renderPage.js +1 -1
  138. package/dist/layout-painter/renderPage.mjs +1 -1
  139. package/dist/managers/AutoSaveManager.d.mts +3 -4
  140. package/dist/managers/AutoSaveManager.d.ts +3 -4
  141. package/dist/managers/TableSelectionManager.d.mts +3 -4
  142. package/dist/managers/TableSelectionManager.d.ts +3 -4
  143. package/dist/managers/types.d.mts +3 -4
  144. package/dist/managers/types.d.ts +3 -4
  145. package/dist/{marks-CCPVlQzL.d.mts → marks-BY573yZn.d.mts} +1 -1
  146. package/dist/{marks-BujVxYP4.d.ts → marks-CjC9tF5k.d.ts} +1 -1
  147. package/dist/mcp-cli.mjs +24 -23
  148. package/dist/mcp.d.mts +3 -4
  149. package/dist/mcp.d.ts +3 -4
  150. package/dist/mcp.js +3 -3
  151. package/dist/mcp.mjs +1 -1
  152. package/dist/{nodes-BXi1Uu3e.d.mts → nodes-7753Bgi_.d.mts} +66 -3
  153. package/dist/{nodes-DfKj9kUA.d.ts → nodes-CC_nwkT_.d.ts} +66 -3
  154. package/dist/prosemirror/commands/formatting.d.mts +2 -2
  155. package/dist/prosemirror/commands/formatting.d.ts +2 -2
  156. package/dist/prosemirror/commands/formatting.js +1 -1
  157. package/dist/prosemirror/commands/formatting.mjs +1 -1
  158. package/dist/prosemirror/commands/index.d.mts +82 -8
  159. package/dist/prosemirror/commands/index.d.ts +82 -8
  160. package/dist/prosemirror/commands/index.js +1 -1
  161. package/dist/prosemirror/commands/index.mjs +1 -1
  162. package/dist/prosemirror/commands/paragraph.d.mts +1 -1
  163. package/dist/prosemirror/commands/paragraph.d.ts +1 -1
  164. package/dist/prosemirror/commands/paragraph.js +1 -1
  165. package/dist/prosemirror/commands/paragraph.mjs +1 -1
  166. package/dist/prosemirror/conversion/fromProseDoc.d.mts +3 -4
  167. package/dist/prosemirror/conversion/fromProseDoc.d.ts +3 -4
  168. package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
  169. package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
  170. package/dist/prosemirror/conversion/index.d.mts +11 -4
  171. package/dist/prosemirror/conversion/index.d.ts +11 -4
  172. package/dist/prosemirror/conversion/index.js +1 -1
  173. package/dist/prosemirror/conversion/index.mjs +1 -1
  174. package/dist/prosemirror/editor.css +155 -95
  175. package/dist/prosemirror/extensions/index.d.mts +1 -1
  176. package/dist/prosemirror/extensions/index.d.ts +1 -1
  177. package/dist/prosemirror/extensions/index.js +1 -1
  178. package/dist/prosemirror/extensions/index.mjs +1 -1
  179. package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -1
  180. package/dist/prosemirror/extensions/nodes/TableExtension.mjs +1 -1
  181. package/dist/prosemirror/index.d.mts +5 -6
  182. package/dist/prosemirror/index.d.ts +5 -6
  183. package/dist/prosemirror/index.js +1 -1
  184. package/dist/prosemirror/index.mjs +1 -1
  185. package/dist/prosemirror/plugins/index.d.mts +122 -18
  186. package/dist/prosemirror/plugins/index.d.ts +122 -18
  187. package/dist/prosemirror/plugins/index.js +1 -1
  188. package/dist/prosemirror/plugins/index.mjs +1 -1
  189. package/dist/prosemirror/plugins/selectionTracker.d.mts +1 -1
  190. package/dist/prosemirror/plugins/selectionTracker.d.ts +1 -1
  191. package/dist/prosemirror/schema/index.d.mts +4 -5
  192. package/dist/prosemirror/schema/index.d.ts +4 -5
  193. package/dist/prosemirror/schema/index.js +1 -1
  194. package/dist/prosemirror/schema/index.mjs +1 -1
  195. package/dist/prosemirror/styles/index.d.mts +2 -2
  196. package/dist/prosemirror/styles/index.d.ts +2 -2
  197. package/dist/prosemirror/utils/extractTrackedChanges.d.mts +45 -23
  198. package/dist/prosemirror/utils/extractTrackedChanges.d.ts +45 -23
  199. package/dist/prosemirror/utils/extractTrackedChanges.js +1 -1
  200. package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -1
  201. package/dist/{selectionContext-85CE0f7a.d.ts → selectionContext-BPAqgNgk.d.ts} +1 -1
  202. package/dist/{selectionContext-Xq3AY7pn.d.mts → selectionContext-CoZat7QZ.d.mts} +1 -1
  203. package/dist/{styles-jqO45PSq.d.ts → styles-BBv7doYK.d.ts} +1 -1
  204. package/dist/{styles-BBoqh07F.d.mts → styles-EI2lxeEN.d.mts} +1 -1
  205. package/dist/types/agentApi.d.mts +1 -1
  206. package/dist/types/agentApi.d.ts +1 -1
  207. package/dist/types/content.d.mts +4 -1167
  208. package/dist/types/content.d.ts +4 -1167
  209. package/dist/types/document.d.mts +25 -8
  210. package/dist/types/document.d.ts +25 -8
  211. package/dist/utils/comments.d.mts +79 -6
  212. package/dist/utils/comments.d.ts +79 -6
  213. package/dist/utils/comments.js +1 -1
  214. package/dist/utils/comments.mjs +1 -1
  215. package/dist/utils/highlightColors.js +1 -1
  216. package/dist/utils/highlightColors.mjs +1 -1
  217. package/dist/utils/index.d.mts +5 -6
  218. package/dist/utils/index.d.ts +5 -6
  219. package/dist/utils/index.js +3 -3
  220. package/dist/utils/index.mjs +3 -3
  221. package/dist/{variableDetector-CAdt8yOr.d.mts → variableDetector-DF3-nxUC.d.mts} +1 -1
  222. package/dist/{variableDetector-W4XEN9YC.d.ts → variableDetector-sBkgVh3f.d.ts} +1 -1
  223. package/package.json +3 -3
  224. package/dist/chunk-2D3UPAMA.mjs +0 -1
  225. package/dist/chunk-2RCMY2GE.mjs +0 -1
  226. package/dist/chunk-3GNIP6IX.mjs +0 -4
  227. package/dist/chunk-44RUAQA2.js +0 -1
  228. package/dist/chunk-5N5DBQJV.mjs +0 -1
  229. package/dist/chunk-5TNMVXDS.mjs +0 -1
  230. package/dist/chunk-6DK4UBGM.js +0 -1
  231. package/dist/chunk-6LOYA7G5.mjs +0 -2
  232. package/dist/chunk-7VCMJCBY.js +0 -2
  233. package/dist/chunk-APFTVA4F.mjs +0 -1
  234. package/dist/chunk-BKHQA6JJ.js +0 -1
  235. package/dist/chunk-BOYVCOLZ.mjs +0 -1
  236. package/dist/chunk-BS35CXMN.js +0 -1
  237. package/dist/chunk-BTOBVF4I.mjs +0 -1
  238. package/dist/chunk-C6GSFUV2.js +0 -2
  239. package/dist/chunk-CP5OSG5Z.mjs +0 -1
  240. package/dist/chunk-CP767TWV.js +0 -1
  241. package/dist/chunk-DV6IEOP5.js +0 -4
  242. package/dist/chunk-IBNUQL57.mjs +0 -2
  243. package/dist/chunk-KBU6QQFU.js +0 -9
  244. package/dist/chunk-LDKESXXK.mjs +0 -3
  245. package/dist/chunk-LTYW3NLX.js +0 -59
  246. package/dist/chunk-NERY274X.js +0 -1
  247. package/dist/chunk-NMSU4MWP.mjs +0 -1
  248. package/dist/chunk-NNQWQOC5.mjs +0 -1
  249. package/dist/chunk-OLKDLRJ4.js +0 -1
  250. package/dist/chunk-P3AXSRLG.mjs +0 -1
  251. package/dist/chunk-P6RNOYAG.mjs +0 -2
  252. package/dist/chunk-R7RR6M4A.mjs +0 -2
  253. package/dist/chunk-RCS6UNIJ.mjs +0 -1
  254. package/dist/chunk-T5RYEG2V.js +0 -1
  255. package/dist/chunk-TRJWRZZD.js +0 -1
  256. package/dist/chunk-TYYOBPNK.js +0 -1
  257. package/dist/chunk-UCZVMHB5.mjs +0 -59
  258. package/dist/chunk-V435QKZB.js +0 -3
  259. package/dist/chunk-VQ2QGHYS.js +0 -2
  260. package/dist/chunk-WZP6ZHBR.js +0 -1
  261. package/dist/chunk-XDH55WXX.mjs +0 -1
  262. package/dist/chunk-Y5HZAMND.mjs +0 -9
  263. package/dist/chunk-YE357WVA.js +0 -1
  264. package/dist/chunk-YGHHSCPR.js +0 -2
  265. package/dist/lists-CdiIk_c1.d.ts +0 -142
  266. package/dist/lists-JDB80qyP.d.mts +0 -142
@@ -12,1170 +12,7 @@
12
12
  * @packageDocumentation
13
13
  * @public
14
14
  */
15
- import { P as ParagraphFormatting, T as TextFormatting, h as TableFormatting, k as TableRowFormatting, g as TableCellFormatting } from '../formatting-D9I-lFS4.mjs';
16
- import { WrapType } from '../docx/wrapTypes.mjs';
17
- import { B as BorderSpec, C as ColorValue, T as ThemeColorSlot } from '../colors-C3vA7HUU.mjs';
18
- import { c as NumberFormat, b as ListRendering } from '../lists-JDB80qyP.mjs';
19
-
20
- /**
21
- * Hyperlinks (`w:hyperlink`), bookmark markers (`w:bookmarkStart`/`End`),
22
- * and field types (`w:fldSimple`, complex `w:fldChar` runs).
23
- */
24
-
25
- /**
26
- * Hyperlink (`w:hyperlink`) — wraps runs in a clickable link. External
27
- * targets resolve through the relationships part (`rId` → `href`);
28
- * internal targets reference a `BookmarkStart` anchor by name.
29
- */
30
- interface Hyperlink {
31
- type: 'hyperlink';
32
- /** Relationship ID for external link */
33
- rId?: string;
34
- /** Resolved URL (from relationships) */
35
- href?: string;
36
- /** Internal bookmark anchor */
37
- anchor?: string;
38
- /** Tooltip text */
39
- tooltip?: string;
40
- /** Target frame */
41
- target?: string;
42
- /** Link history tracking */
43
- history?: boolean;
44
- /** Document location */
45
- docLocation?: string;
46
- /** Child runs */
47
- children: (Run | BookmarkStart | BookmarkEnd)[];
48
- }
49
- /**
50
- * Bookmark start marker (w:bookmarkStart)
51
- */
52
- interface BookmarkStart {
53
- type: 'bookmarkStart';
54
- /** Bookmark ID */
55
- id: number;
56
- /** Bookmark name */
57
- name: string;
58
- /** Column index for table bookmarks */
59
- colFirst?: number;
60
- colLast?: number;
61
- }
62
- /**
63
- * Bookmark end marker (w:bookmarkEnd)
64
- */
65
- interface BookmarkEnd {
66
- type: 'bookmarkEnd';
67
- /** Bookmark ID */
68
- id: number;
69
- }
70
- /**
71
- * Known field types
72
- */
73
- type FieldType = 'PAGE' | 'NUMPAGES' | 'NUMWORDS' | 'NUMCHARS' | 'DATE' | 'TIME' | 'CREATEDATE' | 'SAVEDATE' | 'PRINTDATE' | 'AUTHOR' | 'TITLE' | 'SUBJECT' | 'KEYWORDS' | 'COMMENTS' | 'FILENAME' | 'FILESIZE' | 'TEMPLATE' | 'DOCPROPERTY' | 'DOCVARIABLE' | 'REF' | 'PAGEREF' | 'NOTEREF' | 'HYPERLINK' | 'TOC' | 'TOA' | 'INDEX' | 'SEQ' | 'STYLEREF' | 'AUTONUM' | 'AUTONUMLGL' | 'AUTONUMOUT' | 'IF' | 'MERGEFIELD' | 'NEXT' | 'NEXTIF' | 'ASK' | 'SET' | 'QUOTE' | 'INCLUDETEXT' | 'INCLUDEPICTURE' | 'SYMBOL' | 'ADVANCE' | 'EDITTIME' | 'REVNUM' | 'SECTION' | 'SECTIONPAGES' | 'USERADDRESS' | 'USERNAME' | 'USERINITIALS' | 'UNKNOWN';
74
- /**
75
- * Simple field (w:fldSimple)
76
- */
77
- interface SimpleField {
78
- type: 'simpleField';
79
- /** Field instruction (e.g., "PAGE \\* MERGEFORMAT") */
80
- instruction: string;
81
- /** Parsed field type */
82
- fieldType: FieldType;
83
- /** Current display value */
84
- content: (Run | Hyperlink)[];
85
- /** Field is locked */
86
- fldLock?: boolean;
87
- /** Field is dirty */
88
- dirty?: boolean;
89
- }
90
- /**
91
- * Complex field (w:fldChar begin/separate/end with w:instrText)
92
- */
93
- interface ComplexField {
94
- type: 'complexField';
95
- /** Field instruction */
96
- instruction: string;
97
- /** Parsed field type */
98
- fieldType: FieldType;
99
- /** Field code runs */
100
- fieldCode: Run[];
101
- /** Display result runs */
102
- fieldResult: Run[];
103
- /** Field is locked */
104
- fldLock?: boolean;
105
- /** Field is dirty */
106
- dirty?: boolean;
107
- }
108
- type Field = SimpleField | ComplexField;
109
-
110
- /**
111
- * Math equations (`m:oMath`, `m:oMathPara`). OMML XML is round-tripped
112
- * verbatim to preserve fidelity Word/Pages/Docs can disagree on.
113
- */
114
- /**
115
- * Math equation content (m:oMath or m:oMathPara)
116
- */
117
- interface MathEquation {
118
- type: 'mathEquation';
119
- /** Whether this is a block (oMathPara) or inline (oMath) equation */
120
- display: 'inline' | 'block';
121
- /** Raw OMML XML for round-trip preservation */
122
- ommlXml: string;
123
- /** Plain text representation for accessibility/fallback */
124
- plainText?: string;
125
- }
126
-
127
- /**
128
- * Tracked-changes model — insertion/deletion/move wrappers, range
129
- * markers, and per-element property-change wrappers (`w:rPrChange`,
130
- * `w:pPrChange`, `w:tblPrChange`, `w:trPrChange`, `w:tcPrChange`) plus
131
- * structural changes (row/cell insert/delete/merge).
132
- */
133
-
134
- /**
135
- * Tracked change metadata (w:ins, w:del attributes)
136
- */
137
- interface TrackedChangeInfo {
138
- /** Revision ID */
139
- id: number;
140
- /** Author who made the change */
141
- author: string;
142
- /** Date of the change */
143
- date?: string;
144
- }
145
- /**
146
- * Generic tracked property-change wrapper metadata (w:*PrChange)
147
- */
148
- interface PropertyChangeInfo extends TrackedChangeInfo {
149
- /** Optional revision session ID */
150
- rsid?: string;
151
- }
152
- /**
153
- * Insertion wrapper (w:ins) — runs inserted by tracked changes
154
- */
155
- interface Insertion {
156
- type: 'insertion';
157
- /** Tracked change metadata */
158
- info: TrackedChangeInfo;
159
- /** Inserted content */
160
- content: (Run | Hyperlink)[];
161
- }
162
- /**
163
- * Deletion wrapper (w:del) — runs deleted by tracked changes
164
- */
165
- interface Deletion {
166
- type: 'deletion';
167
- /** Tracked change metadata */
168
- info: TrackedChangeInfo;
169
- /** Deleted content */
170
- content: (Run | Hyperlink)[];
171
- }
172
- /**
173
- * Move-from wrapper (w:moveFrom) — content moved away from this position
174
- */
175
- interface MoveFrom {
176
- type: 'moveFrom';
177
- /** Tracked change metadata */
178
- info: TrackedChangeInfo;
179
- /** Moved content */
180
- content: (Run | Hyperlink)[];
181
- }
182
- /**
183
- * Move-to wrapper (w:moveTo) — content moved into this position
184
- */
185
- interface MoveTo {
186
- type: 'moveTo';
187
- /** Tracked change metadata */
188
- info: TrackedChangeInfo;
189
- /** Moved content */
190
- content: (Run | Hyperlink)[];
191
- }
192
- /**
193
- * Move-from range start marker (w:moveFromRangeStart) — ECMA-376 §17.13.5.22
194
- * Pairs with moveFromRangeEnd to delimit the source of a move in the document.
195
- */
196
- interface MoveFromRangeStart {
197
- type: 'moveFromRangeStart';
198
- id: number;
199
- name: string;
200
- }
201
- /**
202
- * Move-from range end marker (w:moveFromRangeEnd)
203
- */
204
- interface MoveFromRangeEnd {
205
- type: 'moveFromRangeEnd';
206
- id: number;
207
- }
208
- /**
209
- * Move-to range start marker (w:moveToRangeStart) — ECMA-376 §17.13.5.24
210
- * Pairs with moveToRangeEnd to delimit the destination of a move.
211
- */
212
- interface MoveToRangeStart {
213
- type: 'moveToRangeStart';
214
- id: number;
215
- name: string;
216
- }
217
- /**
218
- * Move-to range end marker (w:moveToRangeEnd)
219
- */
220
- interface MoveToRangeEnd {
221
- type: 'moveToRangeEnd';
222
- id: number;
223
- }
224
- /**
225
- * Run-level tracked wrappers represented in WordprocessingML.
226
- */
227
- type TrackedRunChange = Insertion | Deletion | MoveFrom | MoveTo;
228
- /**
229
- * Run property change (w:rPrChange)
230
- */
231
- interface RunPropertyChange {
232
- type: 'runPropertyChange';
233
- /** Tracked change metadata */
234
- info: PropertyChangeInfo;
235
- /** Run properties before the tracked change */
236
- previousFormatting?: TextFormatting;
237
- /** Run properties after the tracked change (editor model convenience) */
238
- currentFormatting?: TextFormatting;
239
- }
240
- /**
241
- * Paragraph property change (w:pPrChange)
242
- */
243
- interface ParagraphPropertyChange {
244
- type: 'paragraphPropertyChange';
245
- /** Tracked change metadata */
246
- info: PropertyChangeInfo;
247
- /** Paragraph properties before the tracked change */
248
- previousFormatting?: ParagraphFormatting;
249
- /** Paragraph properties after the tracked change (editor model convenience) */
250
- currentFormatting?: ParagraphFormatting;
251
- }
252
- /**
253
- * Table property change (w:tblPrChange)
254
- */
255
- interface TablePropertyChange {
256
- type: 'tablePropertyChange';
257
- /** Tracked change metadata */
258
- info: PropertyChangeInfo;
259
- /** Table properties before the tracked change */
260
- previousFormatting?: TableFormatting;
261
- /** Table properties after the tracked change (editor model convenience) */
262
- currentFormatting?: TableFormatting;
263
- }
264
- /**
265
- * Table row property change (w:trPrChange)
266
- */
267
- interface TableRowPropertyChange {
268
- type: 'tableRowPropertyChange';
269
- /** Tracked change metadata */
270
- info: PropertyChangeInfo;
271
- /** Row properties before the tracked change */
272
- previousFormatting?: TableRowFormatting;
273
- /** Row properties after the tracked change (editor model convenience) */
274
- currentFormatting?: TableRowFormatting;
275
- }
276
- /**
277
- * Table cell property change (w:tcPrChange)
278
- */
279
- interface TableCellPropertyChange {
280
- type: 'tableCellPropertyChange';
281
- /** Tracked change metadata */
282
- info: PropertyChangeInfo;
283
- /** Cell properties before the tracked change */
284
- previousFormatting?: TableCellFormatting;
285
- /** Cell properties after the tracked change (editor model convenience) */
286
- currentFormatting?: TableCellFormatting;
287
- }
288
- /**
289
- * Table structural tracked change metadata (row/cell insert/delete/merge)
290
- */
291
- interface TableStructuralChangeInfo {
292
- type: 'tableRowInsertion' | 'tableRowDeletion' | 'tableCellInsertion' | 'tableCellDeletion' | 'tableCellMerge';
293
- /** Tracked change metadata */
294
- info: TrackedChangeInfo;
295
- }
296
-
297
- /**
298
- * Tables (`w:tbl`), rows (`w:tr`), and cells (`w:tc`).
299
- */
300
-
301
- /**
302
- * Table cell (`w:tc`). Holds nested block content (paragraphs and nested
303
- * tables), cell-level formatting (borders, shading, vertical merge),
304
- * tracked property changes, and tracked structural changes for cell
305
- * insert/delete/merge operations.
306
- */
307
- interface TableCell {
308
- type: 'tableCell';
309
- /** Cell formatting */
310
- formatting?: TableCellFormatting;
311
- /** Cell-level tracked property changes (w:tcPrChange) */
312
- propertyChanges?: TableCellPropertyChange[];
313
- /** Tracked structural changes (cell insert/delete/merge) */
314
- structuralChange?: TableStructuralChangeInfo;
315
- /** Cell content (paragraphs, tables, etc.) */
316
- content: (Paragraph | Table)[];
317
- }
318
- /**
319
- * Table row (`w:tr`) — an ordered list of `TableCell` plus row-level
320
- * formatting (height, repeated header, cantSplit) and tracked changes
321
- * for inserts/deletes.
322
- */
323
- interface TableRow {
324
- type: 'tableRow';
325
- /** Row formatting */
326
- formatting?: TableRowFormatting;
327
- /** Row-level tracked property changes (w:trPrChange) */
328
- propertyChanges?: TableRowPropertyChange[];
329
- /** Tracked structural changes (row insert/delete) */
330
- structuralChange?: TableStructuralChangeInfo;
331
- /** Cells in this row */
332
- cells: TableCell[];
333
- }
334
- /**
335
- * Table (`w:tbl`) — a block-level grid of rows × cells. Tables carry
336
- * their own formatting layer (borders, shading, alignment, indent,
337
- * floating placement) and an explicit column-width grid in twips. Tables
338
- * can nest arbitrarily through `TableCell.content`.
339
- *
340
- * See ECMA-376 §17.4.
341
- */
342
- interface Table {
343
- type: 'table';
344
- /** Table formatting */
345
- formatting?: TableFormatting;
346
- /** Table-level tracked property changes (w:tblPrChange) */
347
- propertyChanges?: TablePropertyChange[];
348
- /** Column widths in twips */
349
- columnWidths?: number[];
350
- /** Table rows */
351
- rows: TableRow[];
352
- }
353
-
354
- /**
355
- * Structured Document Tags / content controls (`w:sdt`) — inline and
356
- * block variants, plus properties (alias, tag, lock, list items,
357
- * checkbox state) for the supported SDT types.
358
- */
359
-
360
- /**
361
- * SDT type (content control type)
362
- */
363
- type SdtType = 'richText' | 'plainText' | 'date' | 'dropdown' | 'comboBox' | 'checkbox' | 'picture' | 'buildingBlockGallery' | 'group' | 'unknown';
364
- /**
365
- * SDT properties (w:sdtPr)
366
- */
367
- interface SdtProperties {
368
- /** SDT type */
369
- sdtType: SdtType;
370
- /** Alias (friendly name) */
371
- alias?: string;
372
- /** Tag (developer identifier) */
373
- tag?: string;
374
- /** Lock content editing */
375
- lock?: 'sdtLocked' | 'contentLocked' | 'sdtContentLocked' | 'unlocked';
376
- /** Placeholder text */
377
- placeholder?: string;
378
- /** Whether showing placeholder */
379
- showingPlaceholder?: boolean;
380
- /** Date format for date controls */
381
- dateFormat?: string;
382
- /** Dropdown/combobox list items */
383
- listItems?: {
384
- displayText: string;
385
- value: string;
386
- }[];
387
- /** Checkbox checked state */
388
- checked?: boolean;
389
- }
390
- /**
391
- * Inline SDT (content control within a paragraph)
392
- */
393
- interface InlineSdt {
394
- type: 'inlineSdt';
395
- /** SDT properties */
396
- properties: SdtProperties;
397
- /**
398
- * Inline content held inside the control. OOXML allows runs,
399
- * hyperlinks, simple/complex fields, nested SDTs, and math at this
400
- * level; the renderer must descend into all of them so docProps-bound
401
- * fields and similar template content survive paged rendering.
402
- */
403
- content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | MathEquation)[];
404
- }
405
- /**
406
- * Block-level SDT (content control wrapping paragraphs/tables)
407
- */
408
- interface BlockSdt {
409
- type: 'blockSdt';
410
- /** SDT properties */
411
- properties: SdtProperties;
412
- /** Block content inside the control */
413
- content: (Paragraph | Table)[];
414
- }
415
-
416
- /**
417
- * Comments (`w:comment` in `comments.xml`) and the inline range markers
418
- * (`w:commentRangeStart`/`End`) that anchor them inside paragraphs.
419
- */
420
-
421
- /**
422
- * A comment from `comments.xml` — the top-level entity for review
423
- * comments and replies. `id` matches the inline `CommentRangeStart` /
424
- * `CommentRangeEnd` markers that anchor it inside a paragraph; `parentId`
425
- * threads replies under their parent; `done` reflects Word's "Resolve"
426
- * state (`w15:done`).
427
- */
428
- interface Comment {
429
- /** Comment ID (matches commentRangeStart/End) */
430
- id: number;
431
- /** Author name */
432
- author: string;
433
- /** Author initials */
434
- initials?: string;
435
- /** Date */
436
- date?: string;
437
- /** Comment content (paragraphs) */
438
- content: Paragraph[];
439
- /** Parent comment ID (for replies) */
440
- parentId?: number;
441
- /** Whether the comment is resolved/done */
442
- done?: boolean;
443
- }
444
- /**
445
- * Comment range start marker in paragraph content
446
- */
447
- interface CommentRangeStart {
448
- type: 'commentRangeStart';
449
- id: number;
450
- }
451
- /**
452
- * Comment range end marker in paragraph content
453
- */
454
- interface CommentRangeEnd {
455
- type: 'commentRangeEnd';
456
- id: number;
457
- }
458
-
459
- /**
460
- * Page furniture — headers (`w:hdr`), footers (`w:ftr`), footnotes
461
- * (`w:footnote`), and endnotes (`w:endnote`), plus the section-level
462
- * properties (`w:footnotePr`/`w:endnotePr`) that configure note layout.
463
- */
464
-
465
- /**
466
- * Header/footer type
467
- */
468
- type HeaderFooterType = 'default' | 'first' | 'even';
469
- /**
470
- * Header or footer reference
471
- */
472
- interface HeaderReference {
473
- type: HeaderFooterType;
474
- rId: string;
475
- }
476
- interface FooterReference {
477
- type: HeaderFooterType;
478
- rId: string;
479
- }
480
- /**
481
- * Header or footer content
482
- */
483
- interface HeaderFooter {
484
- type: 'header' | 'footer';
485
- /** Header/footer type */
486
- hdrFtrType: HeaderFooterType;
487
- /** Content (paragraphs, tables, etc.) */
488
- content: (Paragraph | Table)[];
489
- }
490
- /**
491
- * Footnote position
492
- */
493
- type FootnotePosition = 'pageBottom' | 'beneathText' | 'sectEnd' | 'docEnd';
494
- /**
495
- * Endnote position
496
- */
497
- type EndnotePosition = 'sectEnd' | 'docEnd';
498
- /**
499
- * Number restart type
500
- */
501
- type NoteNumberRestart = 'continuous' | 'eachSect' | 'eachPage';
502
- /**
503
- * Footnote properties
504
- */
505
- interface FootnoteProperties {
506
- position?: FootnotePosition;
507
- numFmt?: NumberFormat;
508
- numStart?: number;
509
- numRestart?: NoteNumberRestart;
510
- }
511
- /**
512
- * Endnote properties
513
- */
514
- interface EndnoteProperties {
515
- position?: EndnotePosition;
516
- numFmt?: NumberFormat;
517
- numStart?: number;
518
- numRestart?: NoteNumberRestart;
519
- }
520
- /**
521
- * Footnote (w:footnote)
522
- */
523
- interface Footnote {
524
- type: 'footnote';
525
- /** Footnote ID */
526
- id: number;
527
- /** Special footnote type */
528
- noteType?: 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice';
529
- /**
530
- * Content. Per ECMA-376 §17.11.10 footnotes can hold the same blocks as
531
- * the body — paragraphs and tables. The parser previously only collected
532
- * <w:p> children which silently dropped any <w:tbl> inside a footnote;
533
- * widened to match HeaderFooter / TableCell shape so the body pipeline
534
- * (toProseDoc → toFlowBlocks) can render them uniformly.
535
- */
536
- content: (Paragraph | Table)[];
537
- }
538
- /**
539
- * Endnote (w:endnote)
540
- */
541
- interface Endnote {
542
- type: 'endnote';
543
- /** Endnote ID */
544
- id: number;
545
- /** Special endnote type */
546
- noteType?: 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice';
547
- /**
548
- * Content. Per ECMA-376 §17.11.4 endnotes can hold the same blocks as
549
- * the body — paragraphs and tables. See note on `Footnote.content`.
550
- */
551
- content: (Paragraph | Table)[];
552
- }
553
-
554
- /**
555
- * Section properties (`w:sectPr`) — page size and margins, columns,
556
- * header/footer references, line numbers, page borders, document grid,
557
- * paper sources — plus the section and document-body containers that
558
- * group block-level content.
559
- */
560
-
561
- /**
562
- * Page orientation
563
- */
564
- type PageOrientation = 'portrait' | 'landscape';
565
- /**
566
- * Section start type
567
- */
568
- type SectionStart = 'continuous' | 'nextPage' | 'oddPage' | 'evenPage' | 'nextColumn';
569
- /**
570
- * Vertical alignment
571
- */
572
- type VerticalAlign = 'top' | 'center' | 'both' | 'bottom';
573
- /**
574
- * Line number restart type
575
- */
576
- type LineNumberRestart = 'continuous' | 'newPage' | 'newSection';
577
- /**
578
- * Column definition
579
- */
580
- interface Column {
581
- /** Column width in twips */
582
- width?: number;
583
- /** Space after column in twips */
584
- space?: number;
585
- }
586
- /**
587
- * Section properties (`w:sectPr`) — page geometry, margins, columns,
588
- * header/footer references, and page numbering for one section of the
589
- * document. Sections are introduced by inline `sectPr` markers on the
590
- * terminating paragraph (`Paragraph.sectionProperties`) and the body's
591
- * final `sectPr`.
592
- *
593
- * All distance units are twips (1/20 of a point) on the wire. The layout
594
- * engine converts to pixels.
595
- *
596
- * See ECMA-376 §17.6.
597
- */
598
- interface SectionProperties {
599
- /** Page width in twips */
600
- pageWidth?: number;
601
- /** Page height in twips */
602
- pageHeight?: number;
603
- /** Page orientation */
604
- orientation?: PageOrientation;
605
- /** Top margin in twips */
606
- marginTop?: number;
607
- /** Bottom margin in twips */
608
- marginBottom?: number;
609
- /** Left margin in twips */
610
- marginLeft?: number;
611
- /** Right margin in twips */
612
- marginRight?: number;
613
- /** Header distance from top in twips */
614
- headerDistance?: number;
615
- /** Footer distance from bottom in twips */
616
- footerDistance?: number;
617
- /** Gutter margin in twips */
618
- gutter?: number;
619
- /** Number of columns */
620
- columnCount?: number;
621
- /** Space between columns in twips */
622
- columnSpace?: number;
623
- /** Equal width columns */
624
- equalWidth?: boolean;
625
- /** Separator line between columns */
626
- separator?: boolean;
627
- /** Individual column definitions */
628
- columns?: Column[];
629
- /** Section start type */
630
- sectionStart?: SectionStart;
631
- /** Vertical alignment of text */
632
- verticalAlign?: VerticalAlign;
633
- /** Right-to-left section */
634
- bidi?: boolean;
635
- /** Header references */
636
- headerReferences?: HeaderReference[];
637
- /** Footer references */
638
- footerReferences?: FooterReference[];
639
- /** Different first page header/footer */
640
- titlePg?: boolean;
641
- /** Different odd/even page headers/footers */
642
- evenAndOddHeaders?: boolean;
643
- /** Line numbering settings */
644
- lineNumbers?: {
645
- start?: number;
646
- countBy?: number;
647
- distance?: number;
648
- restart?: LineNumberRestart;
649
- };
650
- /** Page borders */
651
- pageBorders?: {
652
- top?: BorderSpec;
653
- bottom?: BorderSpec;
654
- left?: BorderSpec;
655
- right?: BorderSpec;
656
- /** Display setting */
657
- display?: 'allPages' | 'firstPage' | 'notFirstPage';
658
- /** Offset from */
659
- offsetFrom?: 'page' | 'text';
660
- /** Z-order */
661
- zOrder?: 'front' | 'back';
662
- };
663
- /** Page background */
664
- background?: {
665
- color?: ColorValue;
666
- themeColor?: ThemeColorSlot;
667
- themeTint?: string;
668
- themeShade?: string;
669
- };
670
- /** Footnote properties for this section */
671
- footnotePr?: FootnoteProperties;
672
- /** Endnote properties for this section */
673
- endnotePr?: EndnoteProperties;
674
- /** Document grid */
675
- docGrid?: {
676
- type?: 'default' | 'lines' | 'linesAndChars' | 'snapToChars';
677
- linePitch?: number;
678
- charSpace?: number;
679
- };
680
- /** First page paper source */
681
- paperSrcFirst?: number;
682
- /** Other pages paper source */
683
- paperSrcOther?: number;
684
- }
685
- /**
686
- * Block-level content types
687
- */
688
- type BlockContent = Paragraph | Table | BlockSdt;
689
- /**
690
- * One section of the document — a `SectionProperties` plus the block
691
- * content (`Paragraph`s and `Table`s) that lives under those properties.
692
- *
693
- * Sections are derived during parse: every paragraph carrying an inline
694
- * `sectPr` ends a section, and the body's final `sectPr` defines the
695
- * last section. Each section may carry its own headers/footers map.
696
- */
697
- interface Section {
698
- /** Section properties */
699
- properties: SectionProperties;
700
- /** Content in this section */
701
- content: BlockContent[];
702
- /** Headers for this section */
703
- headers?: Map<HeaderFooterType, HeaderFooter>;
704
- /** Footers for this section */
705
- footers?: Map<HeaderFooterType, HeaderFooter>;
706
- }
707
- /**
708
- * Document body (`w:body`) — the editable content of the document.
709
- *
710
- * Contains the ordered block content (paragraphs and tables), the section
711
- * layout chain derived from inline `sectPr` markers, the final `sectPr`,
712
- * and any document-level comments. This is what most edit operations
713
- * mutate; headers/footers/styles live elsewhere in the package.
714
- */
715
- interface DocumentBody {
716
- /** All content (paragraphs, tables) */
717
- content: BlockContent[];
718
- /** Sections (derived from sectPr in paragraphs and final sectPr) */
719
- sections?: Section[];
720
- /** Final section properties (from body's sectPr) */
721
- finalSectionProperties?: SectionProperties;
722
- /** Comments from comments.xml */
723
- comments?: Comment[];
724
- }
725
-
726
- /**
727
- * Paragraph (`w:p`) — the union of inline content that can sit inside a
728
- * paragraph (runs, hyperlinks, bookmarks, fields, SDT, comment ranges,
729
- * tracked-change wrappers, math) plus paragraph-level metadata
730
- * (formatting, list rendering, optional terminating section properties).
731
- */
732
-
733
- /**
734
- * Inline content that can appear inside a paragraph. Covers runs (text),
735
- * hyperlinks, bookmarks, fields, structured document tags, comment range
736
- * markers, tracked-change wrappers, and math equations. Every node in
737
- * this union carries a `type` discriminator so consumers can narrow at
738
- * runtime.
739
- */
740
- type ParagraphContent = Run | Hyperlink | BookmarkStart | BookmarkEnd | SimpleField | ComplexField | InlineSdt | CommentRangeStart | CommentRangeEnd | Insertion | Deletion | MoveFrom | MoveTo | MoveFromRangeStart | MoveFromRangeEnd | MoveToRangeStart | MoveToRangeEnd | MathEquation;
741
- /**
742
- * Paragraph (`w:p`) — the primary block-level container in a Word document.
743
- *
744
- * Every paragraph carries direct formatting (`formatting`), tracked
745
- * property changes (`propertyChanges`), inline content (`content`), and
746
- * optional list rendering / section break metadata. `paraId` is Word's
747
- * stable identifier (`w14:paraId`) and is what `EditorBridge` and the
748
- * agent toolkit use to address paragraphs.
749
- *
750
- * See ECMA-376 §17.3.1.
751
- */
752
- interface Paragraph {
753
- type: 'paragraph';
754
- /** Unique paragraph ID */
755
- paraId?: string;
756
- /** Text ID */
757
- textId?: string;
758
- /** Paragraph formatting */
759
- formatting?: ParagraphFormatting;
760
- /** Paragraph-level tracked property changes (w:pPrChange) */
761
- propertyChanges?: ParagraphPropertyChange[];
762
- /** Paragraph content */
763
- content: ParagraphContent[];
764
- /** Computed list rendering (if this is a list item) */
765
- listRendering?: ListRendering;
766
- /** Word's cached layout says this paragraph started on a new rendered page. */
767
- renderedPageBreakBefore?: boolean;
768
- /** Section properties (if this paragraph ends a section) */
769
- sectionProperties?: SectionProperties;
770
- }
771
-
772
- /**
773
- * DrawingML shapes (`wps:wsp`) and text boxes — preset shape types,
774
- * fill, outline, shape text body, transform.
775
- */
776
-
777
- /**
778
- * Shape types
779
- */
780
- type ShapeType = 'rect' | 'roundRect' | 'ellipse' | 'triangle' | 'rtTriangle' | 'parallelogram' | 'trapezoid' | 'pentagon' | 'hexagon' | 'heptagon' | 'octagon' | 'decagon' | 'dodecagon' | 'star4' | 'star5' | 'star6' | 'star7' | 'star8' | 'star10' | 'star12' | 'star16' | 'star24' | 'star32' | 'line' | 'straightConnector1' | 'bentConnector2' | 'bentConnector3' | 'bentConnector4' | 'bentConnector5' | 'curvedConnector2' | 'curvedConnector3' | 'curvedConnector4' | 'curvedConnector5' | 'rightArrow' | 'leftArrow' | 'upArrow' | 'downArrow' | 'leftRightArrow' | 'upDownArrow' | 'quadArrow' | 'leftRightUpArrow' | 'bentArrow' | 'uturnArrow' | 'leftUpArrow' | 'bentUpArrow' | 'curvedRightArrow' | 'curvedLeftArrow' | 'curvedUpArrow' | 'curvedDownArrow' | 'stripedRightArrow' | 'notchedRightArrow' | 'homePlate' | 'chevron' | 'rightArrowCallout' | 'downArrowCallout' | 'leftArrowCallout' | 'upArrowCallout' | 'leftRightArrowCallout' | 'quadArrowCallout' | 'circularArrow' | 'flowChartProcess' | 'flowChartAlternateProcess' | 'flowChartDecision' | 'flowChartInputOutput' | 'flowChartPredefinedProcess' | 'flowChartInternalStorage' | 'flowChartDocument' | 'flowChartMultidocument' | 'flowChartTerminator' | 'flowChartPreparation' | 'flowChartManualInput' | 'flowChartManualOperation' | 'flowChartConnector' | 'flowChartOffpageConnector' | 'flowChartPunchedCard' | 'flowChartPunchedTape' | 'flowChartSummingJunction' | 'flowChartOr' | 'flowChartCollate' | 'flowChartSort' | 'flowChartExtract' | 'flowChartMerge' | 'flowChartOnlineStorage' | 'flowChartDelay' | 'flowChartMagneticTape' | 'flowChartMagneticDisk' | 'flowChartMagneticDrum' | 'flowChartDisplay' | 'wedgeRectCallout' | 'wedgeRoundRectCallout' | 'wedgeEllipseCallout' | 'cloudCallout' | 'borderCallout1' | 'borderCallout2' | 'borderCallout3' | 'accentCallout1' | 'accentCallout2' | 'accentCallout3' | 'callout1' | 'callout2' | 'callout3' | 'accentBorderCallout1' | 'accentBorderCallout2' | 'accentBorderCallout3' | 'actionButtonBlank' | 'actionButtonHome' | 'actionButtonHelp' | 'actionButtonInformation' | 'actionButtonBackPrevious' | 'actionButtonForwardNext' | 'actionButtonBeginning' | 'actionButtonEnd' | 'actionButtonReturn' | 'actionButtonDocument' | 'actionButtonSound' | 'actionButtonMovie' | 'irregularSeal1' | 'irregularSeal2' | 'frame' | 'halfFrame' | 'corner' | 'diagStripe' | 'chord' | 'arc' | 'bracketPair' | 'bracePair' | 'leftBracket' | 'rightBracket' | 'leftBrace' | 'rightBrace' | 'can' | 'cube' | 'bevel' | 'donut' | 'noSmoking' | 'blockArc' | 'foldedCorner' | 'smileyFace' | 'heart' | 'lightningBolt' | 'sun' | 'moon' | 'cloud' | 'snip1Rect' | 'snip2SameRect' | 'snip2DiagRect' | 'snipRoundRect' | 'round1Rect' | 'round2SameRect' | 'round2DiagRect' | 'plaque' | 'teardrop' | 'mathPlus' | 'mathMinus' | 'mathMultiply' | 'mathDivide' | 'mathEqual' | 'mathNotEqual' | 'gear6' | 'gear9' | 'funnel' | 'pieWedge' | 'pie' | 'leftCircularArrow' | 'leftRightCircularArrow' | 'swooshArrow' | 'textBox';
781
- /**
782
- * Shape fill type
783
- */
784
- interface ShapeFill {
785
- type: 'none' | 'solid' | 'gradient' | 'pattern' | 'picture';
786
- /** Solid fill color */
787
- color?: ColorValue;
788
- /** Gradient stops for gradient fill */
789
- gradient?: {
790
- type: 'linear' | 'radial' | 'rectangular' | 'path';
791
- angle?: number;
792
- stops: Array<{
793
- position: number;
794
- color: ColorValue;
795
- }>;
796
- };
797
- }
798
- /**
799
- * Shape outline/stroke
800
- */
801
- interface ShapeOutline {
802
- /** Line width in EMUs */
803
- width?: number;
804
- /** Line color */
805
- color?: ColorValue;
806
- /** Line style */
807
- style?: 'solid' | 'dot' | 'dash' | 'lgDash' | 'dashDot' | 'lgDashDot' | 'lgDashDotDot' | 'sysDot' | 'sysDash' | 'sysDashDot' | 'sysDashDotDot';
808
- /** Line cap */
809
- cap?: 'flat' | 'round' | 'square';
810
- /** Line join */
811
- join?: 'bevel' | 'miter' | 'round';
812
- /** Head arrow */
813
- headEnd?: {
814
- type: 'none' | 'triangle' | 'stealth' | 'diamond' | 'oval' | 'arrow';
815
- width?: 'sm' | 'med' | 'lg';
816
- length?: 'sm' | 'med' | 'lg';
817
- };
818
- /** Tail arrow */
819
- tailEnd?: {
820
- type: 'none' | 'triangle' | 'stealth' | 'diamond' | 'oval' | 'arrow';
821
- width?: 'sm' | 'med' | 'lg';
822
- length?: 'sm' | 'med' | 'lg';
823
- };
824
- }
825
- /**
826
- * Text body inside a shape
827
- */
828
- interface ShapeTextBody {
829
- /** Text direction */
830
- vertical?: boolean;
831
- /** Rotation */
832
- rotation?: number;
833
- /** Anchor/vertical alignment */
834
- anchor?: 'top' | 'middle' | 'bottom' | 'distributed' | 'justified';
835
- /** Anchor center */
836
- anchorCenter?: boolean;
837
- /** Auto fit */
838
- autoFit?: 'none' | 'normal' | 'shape';
839
- /** Text margins */
840
- margins?: {
841
- top?: number;
842
- bottom?: number;
843
- left?: number;
844
- right?: number;
845
- };
846
- /** Paragraphs inside the shape */
847
- content: Paragraph[];
848
- }
849
- /**
850
- * Shape/drawing object (wps:wsp)
851
- */
852
- interface Shape {
853
- type: 'shape';
854
- /** Shape type preset */
855
- shapeType: ShapeType;
856
- /** Unique ID */
857
- id?: string;
858
- /** Name */
859
- name?: string;
860
- /** Size in EMUs */
861
- size: ImageSize;
862
- /** Position for floating shapes */
863
- position?: ImagePosition;
864
- /** Wrap settings */
865
- wrap?: ImageWrap;
866
- /** Fill */
867
- fill?: ShapeFill;
868
- /** Outline/stroke */
869
- outline?: ShapeOutline;
870
- /** Transform */
871
- transform?: ImageTransform;
872
- /** Text content inside the shape */
873
- textBody?: ShapeTextBody;
874
- /** Custom geometry points */
875
- customGeometry?: string;
876
- }
877
- /**
878
- * Text box (floating text container)
879
- */
880
- interface TextBox {
881
- type: 'textBox';
882
- /** Unique ID */
883
- id?: string;
884
- /** Size */
885
- size: ImageSize;
886
- /** Position */
887
- position?: ImagePosition;
888
- /** Wrap settings */
889
- wrap?: ImageWrap;
890
- /** Fill */
891
- fill?: ShapeFill;
892
- /** Outline */
893
- outline?: ShapeOutline;
894
- /** Text content */
895
- content: Paragraph[];
896
- /** Internal margins */
897
- margins?: {
898
- top?: number;
899
- bottom?: number;
900
- left?: number;
901
- right?: number;
902
- };
903
- }
904
-
905
- /**
906
- * Embedded images (`w:drawing` → `pic:pic`): size, wrap, position,
907
- * transform, padding, crop.
908
- */
909
-
910
- /**
911
- * Image size specification
912
- */
913
- interface ImageSize {
914
- /** Width in EMUs (English Metric Units) */
915
- width: number;
916
- /** Height in EMUs */
917
- height: number;
918
- }
919
- /**
920
- * Image wrap type for floating images
921
- */
922
- interface ImageWrap {
923
- type: WrapType;
924
- /** Wrap text direction */
925
- wrapText?: 'bothSides' | 'left' | 'right' | 'largest';
926
- /** Distance from text */
927
- distT?: number;
928
- distB?: number;
929
- distL?: number;
930
- distR?: number;
931
- }
932
- /**
933
- * Position for floating images
934
- */
935
- interface ImagePosition {
936
- /** Horizontal positioning */
937
- horizontal: {
938
- relativeTo: 'character' | 'column' | 'insideMargin' | 'leftMargin' | 'margin' | 'outsideMargin' | 'page' | 'rightMargin';
939
- alignment?: 'left' | 'right' | 'center' | 'inside' | 'outside';
940
- posOffset?: number;
941
- };
942
- /** Vertical positioning */
943
- vertical: {
944
- relativeTo: 'insideMargin' | 'line' | 'margin' | 'outsideMargin' | 'page' | 'paragraph' | 'topMargin' | 'bottomMargin';
945
- alignment?: 'top' | 'bottom' | 'center' | 'inside' | 'outside';
946
- posOffset?: number;
947
- };
948
- }
949
- /**
950
- * Image transformation
951
- */
952
- interface ImageTransform {
953
- /** Rotation in degrees */
954
- rotation?: number;
955
- /** Flip horizontal */
956
- flipH?: boolean;
957
- /** Flip vertical */
958
- flipV?: boolean;
959
- }
960
- /**
961
- * Image padding/margins
962
- */
963
- interface ImagePadding {
964
- top?: number;
965
- bottom?: number;
966
- left?: number;
967
- right?: number;
968
- }
969
- /**
970
- * Image crop, expressed as fractions of the source image to trim from each
971
- * edge. OOXML's `<a:srcRect l="10000" t="0" r="5000" b="0"/>` uses units of
972
- * 1/100000 (so 10000 → 0.1 → 10% trimmed from the left). We store the
973
- * normalised fraction so both the renderer and the saver can read it
974
- * directly without re-parsing units.
975
- */
976
- interface ImageCrop {
977
- left?: number;
978
- top?: number;
979
- right?: number;
980
- bottom?: number;
981
- }
982
- /**
983
- * Embedded image (`w:drawing` with an inline or anchored picture). Carries
984
- * the relationship-id pointer to the binary in `word/media/`, its
985
- * resolved data URL (`src`), display dimensions, optional crop /
986
- * transform / wrap behaviors, and anchor positioning for floating
987
- * images.
988
- *
989
- * See ECMA-376 §20.4 (DrawingML wordprocessingDrawing).
990
- */
991
- interface Image {
992
- type: 'image';
993
- /** Unique ID */
994
- id?: string;
995
- /** Relationship ID for the image data */
996
- rId: string;
997
- /** Resolved image data (base64 or blob URL) */
998
- src?: string;
999
- /** Image MIME type */
1000
- mimeType?: string;
1001
- /** Original filename */
1002
- filename?: string;
1003
- /** Alt text for accessibility */
1004
- alt?: string;
1005
- /** Title/description */
1006
- title?: string;
1007
- /** Image size */
1008
- size: ImageSize;
1009
- /** Original size before any transforms */
1010
- originalSize?: ImageSize;
1011
- /** Wrap settings */
1012
- wrap: ImageWrap;
1013
- /** Position for floating images */
1014
- position?: ImagePosition;
1015
- /** Image transformations */
1016
- transform?: ImageTransform;
1017
- /** Padding around image */
1018
- padding?: ImagePadding;
1019
- /** Source-image crop (fractional, OOXML `a:srcRect`). */
1020
- crop?: ImageCrop;
1021
- /** Opacity in [0, 1] (OOXML `a:alphaModFix amt`). Undefined = fully opaque. */
1022
- opacity?: number;
1023
- /** Whether this is a decorative image */
1024
- decorative?: boolean;
1025
- /**
1026
- * `wp:anchor layoutInCell` — when true (default), an anchored image inside
1027
- * a table cell is constrained to the cell. When false, the image escapes
1028
- * the cell into the page area. Round-tripped on save.
1029
- */
1030
- layoutInCell?: boolean;
1031
- /**
1032
- * `wp:anchor allowOverlap` — when true (default), anchored objects may
1033
- * overlap; when false, Word repositions them to avoid collisions. We
1034
- * don't currently reposition; we round-trip the flag so saving preserves
1035
- * the author's intent.
1036
- */
1037
- allowOverlap?: boolean;
1038
- /** Hyperlink URL for clickable image */
1039
- hlinkHref?: string;
1040
- /** Image outline/border */
1041
- outline?: ShapeOutline;
1042
- /** Image effects */
1043
- effects?: {
1044
- brightness?: number;
1045
- contrast?: number;
1046
- saturation?: number;
1047
- };
1048
- }
1049
-
1050
- /**
1051
- * Run content (`w:r`) and the inline pieces that live inside a run —
1052
- * text, tab, break, symbol, footnote/endnote references, field chars,
1053
- * instruction text, soft/no-break hyphens, drawings, shapes.
1054
- */
1055
-
1056
- /**
1057
- * Plain text run content (`w:t`). `preserveSpace` mirrors the
1058
- * `xml:space="preserve"` attribute and matters for runs that begin or end
1059
- * with whitespace — without it, Word collapses leading/trailing spaces.
1060
- */
1061
- interface TextContent {
1062
- type: 'text';
1063
- /** The text string */
1064
- text: string;
1065
- /** Preserve whitespace (xml:space="preserve") */
1066
- preserveSpace?: boolean;
1067
- }
1068
- /**
1069
- * Tab character
1070
- */
1071
- interface TabContent {
1072
- type: 'tab';
1073
- }
1074
- /**
1075
- * Line break
1076
- */
1077
- interface BreakContent {
1078
- type: 'break';
1079
- /** Break type */
1080
- breakType?: 'page' | 'column' | 'textWrapping';
1081
- /** Clear type for text wrapping break */
1082
- clear?: 'none' | 'left' | 'right' | 'all';
1083
- }
1084
- /**
1085
- * Symbol character (special font character)
1086
- */
1087
- interface SymbolContent {
1088
- type: 'symbol';
1089
- /** Font name */
1090
- font: string;
1091
- /** Character code */
1092
- char: string;
1093
- }
1094
- /**
1095
- * Footnote or endnote reference
1096
- */
1097
- interface NoteReferenceContent {
1098
- type: 'footnoteRef' | 'endnoteRef';
1099
- /** Note ID */
1100
- id: number;
1101
- }
1102
- /**
1103
- * Field character (begin/separate/end)
1104
- */
1105
- interface FieldCharContent {
1106
- type: 'fieldChar';
1107
- /** Field character type */
1108
- charType: 'begin' | 'separate' | 'end';
1109
- /** Field is locked */
1110
- fldLock?: boolean;
1111
- /** Field is dirty (needs update) */
1112
- dirty?: boolean;
1113
- }
1114
- /**
1115
- * Field instruction text
1116
- */
1117
- interface InstrTextContent {
1118
- type: 'instrText';
1119
- /** Field instruction */
1120
- text: string;
1121
- }
1122
- /**
1123
- * Soft hyphen
1124
- */
1125
- interface SoftHyphenContent {
1126
- type: 'softHyphen';
1127
- }
1128
- /**
1129
- * Non-breaking hyphen
1130
- */
1131
- interface NoBreakHyphenContent {
1132
- type: 'noBreakHyphen';
1133
- }
1134
- /**
1135
- * Drawing/image reference
1136
- */
1137
- interface DrawingContent {
1138
- type: 'drawing';
1139
- /** Image data */
1140
- image: Image;
1141
- }
1142
- /**
1143
- * Shape reference
1144
- */
1145
- interface ShapeContent {
1146
- type: 'shape';
1147
- /** Shape data */
1148
- shape: Shape;
1149
- }
1150
- /**
1151
- * All possible run content types
1152
- */
1153
- type RunContent = TextContent | TabContent | BreakContent | SymbolContent | NoteReferenceContent | FieldCharContent | InstrTextContent | SoftHyphenContent | NoBreakHyphenContent | DrawingContent | ShapeContent;
1154
- /**
1155
- * A run (`w:r`) — a contiguous span of inline content sharing one set of
1156
- * character properties (bold, italic, font, color, etc.). Runs are the
1157
- * atomic unit of character formatting; toggling bold on a selection that
1158
- * spans different formatting creates new runs.
1159
- *
1160
- * See ECMA-376 §17.3.2.
1161
- *
1162
- * @example
1163
- * ```ts
1164
- * const run: Run = {
1165
- * type: 'run',
1166
- * formatting: { bold: true },
1167
- * content: [{ type: 'text', text: 'Hello' }],
1168
- * };
1169
- * ```
1170
- */
1171
- interface Run {
1172
- type: 'run';
1173
- /** Text formatting properties */
1174
- formatting?: TextFormatting;
1175
- /** Run-level tracked property changes (w:rPrChange) */
1176
- propertyChanges?: RunPropertyChange[];
1177
- /** Run content (text, tabs, breaks, etc.) */
1178
- content: RunContent[];
1179
- }
1180
-
1181
- export type { BlockContent, BlockSdt, BookmarkEnd, BookmarkStart, BreakContent, Column, Comment, CommentRangeEnd, CommentRangeStart, ComplexField, Deletion, DocumentBody, DrawingContent, Endnote, EndnotePosition, EndnoteProperties, Field, FieldCharContent, FieldType, FooterReference, Footnote, FootnotePosition, FootnoteProperties, HeaderFooter, HeaderFooterType, HeaderReference, Hyperlink, Image, ImageCrop, ImagePadding, ImagePosition, ImageSize, ImageTransform, ImageWrap, InlineSdt, Insertion, InstrTextContent, LineNumberRestart, MathEquation, MoveFrom, MoveFromRangeEnd, MoveFromRangeStart, MoveTo, MoveToRangeEnd, MoveToRangeStart, NoBreakHyphenContent, NoteNumberRestart, NoteReferenceContent, PageOrientation, Paragraph, ParagraphContent, ParagraphPropertyChange, PropertyChangeInfo, Run, RunContent, RunPropertyChange, SdtProperties, SdtType, Section, SectionProperties, SectionStart, Shape, ShapeContent, ShapeFill, ShapeOutline, ShapeTextBody, ShapeType, SimpleField, SoftHyphenContent, SymbolContent, TabContent, Table, TableCell, TableCellPropertyChange, TablePropertyChange, TableRow, TableRowPropertyChange, TableStructuralChangeInfo, TextBox, TextContent, TrackedChangeInfo, TrackedRunChange, VerticalAlign };
15
+ export { B as BlockContent, v as BlockSdt, w as BookmarkEnd, x as BookmarkStart, t as BreakContent, y as Column, C as Comment, a as CommentRangeEnd, b as CommentRangeStart, z as ComplexField, D as Deletion, c as DocumentBody, G as DrawingContent, E as Endnote, J as EndnotePosition, K as EndnoteProperties, O as Field, Q as FieldCharContent, U as FieldType, V as FooterReference, F as Footnote, W as FootnotePosition, X as FootnoteProperties, u as HeaderFooter, Y as HeaderFooterType, Z as HeaderReference, H as Hyperlink, I as Image, _ as ImageCrop, $ as ImagePadding, a0 as ImagePosition, a1 as ImageSize, a2 as ImageTransform, a3 as ImageWrap, a4 as InlineSdt, d as Insertion, a5 as InstrTextContent, a7 as LineNumberRestart, a9 as MathEquation, M as MoveFrom, aa as MoveFromRangeEnd, ab as MoveFromRangeStart, e as MoveTo, ac as MoveToRangeEnd, ad as MoveToRangeStart, ae as NoBreakHyphenContent, af as NoteNumberRestart, ag as NoteReferenceContent, ai as PageOrientation, P as Paragraph, f as ParagraphContent, p as ParagraphPropertyChange, aj as PropertyChangeInfo, R as Run, g as RunContent, ak as RunPropertyChange, al as SdtProperties, am as SdtType, an as Section, S as SectionProperties, ao as SectionStart, ap as Shape, aq as ShapeContent, ar as ShapeFill, as as ShapeOutline, at as ShapeTextBody, au as ShapeType, av as SimpleField, aw as SoftHyphenContent, ax as SymbolContent, ay as TabContent, T as Table, h as TableCell, r as TableCellPropertyChange, q as TablePropertyChange, i as TableRow, s as TableRowPropertyChange, az as TableStructuralChangeInfo, aA as TextBox, j as TextContent, k as TrackedChangeInfo, l as TrackedRunChange, aB as VerticalAlign } from '../content-5Mrz6w_b.mjs';
16
+ import '../formatting-BH4hcZiq.mjs';
17
+ import '../colors-C3vA7HUU.mjs';
18
+ import '../docx/wrapTypes.mjs';