@zeke-02/docx-editor 0.5.2 → 0.5.4

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 (223) hide show
  1. package/LICENSE +204 -0
  2. package/dist/FindReplaceDialog-7SQOVQWH.js +1 -0
  3. package/dist/FindReplaceDialog-RK3A7MSK.mjs +1 -0
  4. package/dist/{FootnotePropertiesDialog-XQ7NIFIU.js → FootnotePropertiesDialog-2Q2SHVMR.js} +1 -1
  5. package/dist/{FootnotePropertiesDialog-TNVJJCY6.mjs → FootnotePropertiesDialog-ZKQXW3YO.mjs} +1 -1
  6. package/dist/{HyperlinkDialog-FR4IZZ7E.mjs → HyperlinkDialog-QV3CVFQU.mjs} +1 -1
  7. package/dist/HyperlinkDialog-XVAF7FVN.js +1 -0
  8. package/dist/{ImagePositionDialog-JSZSIKF5.mjs → ImagePositionDialog-EGRH3HPP.mjs} +1 -1
  9. package/dist/{ImagePositionDialog-2YXRAGZS.js → ImagePositionDialog-HIVHUTBT.js} +1 -1
  10. package/dist/ImagePropertiesDialog-67WLFIIZ.mjs +1 -0
  11. package/dist/ImagePropertiesDialog-HSM3JJ22.js +1 -0
  12. package/dist/KeyboardShortcutsDialog-B0UFuR4w.d.ts +395 -0
  13. package/dist/KeyboardShortcutsDialog-t6JKL4Aj.d.mts +395 -0
  14. package/dist/PageSetupDialog-642IAVG2.js +1 -0
  15. package/dist/PageSetupDialog-ERUQDHAY.mjs +1 -0
  16. package/dist/PluginHost-HS31VIuo.d.mts +16 -0
  17. package/dist/PluginHost-zILZO7zX.d.ts +16 -0
  18. package/dist/{SplitCellDialog-NP3JJYHD.mjs → SplitCellDialog-GFWCFCTD.mjs} +1 -1
  19. package/dist/{SplitCellDialog-JIAC3RYV.js → SplitCellDialog-M7WF7ANE.js} +1 -1
  20. package/dist/{TablePropertiesDialog-TIK4AA5M.mjs → TablePropertiesDialog-TZ7VCL6V.mjs} +1 -1
  21. package/dist/{TablePropertiesDialog-T7D4HSVP.js → TablePropertiesDialog-ZKU2FTUX.js} +1 -1
  22. package/dist/agentApi-B2Y7kexW.d.ts +486 -0
  23. package/dist/agentApi-BzUJ_kao.d.mts +486 -0
  24. package/dist/chunk-2XXILKEQ.js +1 -0
  25. package/dist/chunk-35DG3R42.js +2 -0
  26. package/dist/chunk-5UX5CD4C.js +1 -0
  27. package/dist/chunk-7QQSDIWK.mjs +2 -0
  28. package/dist/chunk-AW5TISUL.js +3 -0
  29. package/dist/chunk-B45ECEGY.js +18 -0
  30. package/dist/chunk-B7CCL7SL.mjs +2 -0
  31. package/dist/chunk-BRMTZRLJ.js +2 -0
  32. package/dist/chunk-D47GTKGU.js +2 -0
  33. package/dist/chunk-F5SERL7X.mjs +2 -0
  34. package/dist/chunk-FWPVBFKQ.mjs +1 -0
  35. package/dist/chunk-GGQK26JO.js +2 -0
  36. package/dist/chunk-GM2S2WMT.mjs +1 -0
  37. package/dist/chunk-HXDMASAR.js +1 -0
  38. package/dist/chunk-ILYKDR3C.js +1 -0
  39. package/dist/chunk-JFRDFK7V.mjs +260 -0
  40. package/dist/chunk-JPF5R2ZM.mjs +1 -0
  41. package/dist/chunk-KOXCF3CL.mjs +1 -0
  42. package/dist/chunk-KRLNX56Y.mjs +2 -0
  43. package/dist/chunk-LWOHVYKW.mjs +1 -0
  44. package/dist/chunk-MDTA25AN.mjs +60 -0
  45. package/dist/chunk-MKNSJOCN.js +70 -0
  46. package/dist/chunk-NIBCC7WQ.js +1 -0
  47. package/dist/chunk-NLFXR2VH.js +2 -0
  48. package/dist/chunk-NOLMVQNN.mjs +40 -0
  49. package/dist/chunk-ONIYA2FU.mjs +2 -0
  50. package/dist/chunk-RCIZ7OM3.mjs +70 -0
  51. package/dist/chunk-SGTUE33R.js +260 -0
  52. package/dist/{chunk-EHFEG3TX.js → chunk-SNZ57XBI.js} +1 -1
  53. package/dist/chunk-SOTWG3KJ.mjs +1 -0
  54. package/dist/chunk-TYPGB4KF.js +1 -0
  55. package/dist/chunk-U7ZW2DOO.mjs +2 -0
  56. package/dist/chunk-WO3FIV4B.js +40 -0
  57. package/dist/{chunk-PKEOQIQO.mjs → chunk-WPI3YRFO.mjs} +1 -1
  58. package/dist/chunk-XGJ2EORY.mjs +1 -0
  59. package/dist/chunk-XQZTWWRF.mjs +18 -0
  60. package/dist/chunk-Y3SEHWZ2.js +1 -0
  61. package/dist/chunk-YBEVHQCT.js +60 -0
  62. package/dist/chunk-ZVAFVHWR.mjs +3 -0
  63. package/dist/chunk-ZXPCJWVY.js +2 -0
  64. package/dist/{agentApi-DLt94vXk.d.mts → content-REFGFfEH.d.mts} +8 -755
  65. package/dist/{agentApi-DLt94vXk.d.ts → content-REFGFfEH.d.ts} +8 -755
  66. package/dist/dialogs.d.mts +25 -0
  67. package/dist/dialogs.d.ts +25 -0
  68. package/dist/dialogs.js +1 -0
  69. package/dist/dialogs.mjs +1 -0
  70. package/dist/document-Cu2vq_wS.d.mts +294 -0
  71. package/dist/document-CxOagoLQ.d.ts +294 -0
  72. package/dist/executor-WBHID2RK.mjs +1 -0
  73. package/dist/executor-Y5VUOAHY.js +1 -0
  74. package/dist/findReplace-Bue0JaXh.d.ts +138 -0
  75. package/dist/findReplace-shXbOjFQ.d.mts +138 -0
  76. package/dist/fork.d.mts +535 -0
  77. package/dist/fork.d.ts +535 -0
  78. package/dist/fork.js +1 -0
  79. package/dist/fork.mjs +1 -0
  80. package/dist/hooks.d.mts +598 -0
  81. package/dist/hooks.d.ts +598 -0
  82. package/dist/hooks.js +1 -0
  83. package/dist/hooks.mjs +1 -0
  84. package/dist/index-B5A-J9GC.d.ts +1119 -0
  85. package/dist/index-bw-PaozF.d.mts +1119 -0
  86. package/dist/index.d.mts +12 -591
  87. package/dist/index.d.ts +12 -591
  88. package/dist/index.js +1 -120
  89. package/dist/index.mjs +1 -120
  90. package/dist/layout-bridge-5GYGYKM5.mjs +1 -0
  91. package/dist/layout-bridge-QQDA7ELH.js +1 -0
  92. package/dist/plugin-api.d.mts +165 -0
  93. package/dist/plugin-api.d.ts +165 -0
  94. package/dist/plugin-api.js +1 -0
  95. package/dist/plugin-api.mjs +1 -0
  96. package/dist/processTemplate-BTBTR7AM.js +1 -0
  97. package/dist/{processTemplate-W2C5PXZB.mjs → processTemplate-MBX2KDLE.mjs} +1 -1
  98. package/dist/styles.css +1 -1
  99. package/dist/styles.d.mts +18 -0
  100. package/dist/styles.d.ts +18 -0
  101. package/dist/styles.js +1 -0
  102. package/dist/styles.mjs +1 -0
  103. package/dist/types-BF48VxkC.d.mts +18 -0
  104. package/dist/types-BF48VxkC.d.ts +18 -0
  105. package/dist/types-BnIs4sE7.d.mts +281 -0
  106. package/dist/types-BnIs4sE7.d.ts +281 -0
  107. package/dist/types-CW6HFAX6.d.ts +39 -0
  108. package/dist/types-DIsDCwTG.d.mts +39 -0
  109. package/dist/ui.d.mts +111 -552
  110. package/dist/ui.d.ts +111 -552
  111. package/dist/ui.js +111 -1
  112. package/dist/ui.mjs +111 -1
  113. package/dist/useFindReplace-DKy-s3gS.d.ts +261 -0
  114. package/dist/useFindReplace-vuoKpDKE.d.mts +261 -0
  115. package/package.json +47 -49
  116. package/dist/ClipboardManager-CVKX0v9q.d.ts +0 -464
  117. package/dist/ClipboardManager-V3aaMnWE.d.mts +0 -464
  118. package/dist/DocumentAgent-BWflKHpH.d.mts +0 -442
  119. package/dist/DocumentAgent-DsdXtetF.d.ts +0 -442
  120. package/dist/FindReplaceDialog-L3YF5HIS.mjs +0 -1
  121. package/dist/FindReplaceDialog-SEBWC5P7.js +0 -1
  122. package/dist/HyperlinkDialog-WEK6JSAC.js +0 -1
  123. package/dist/ImagePropertiesDialog-527MFLQO.mjs +0 -1
  124. package/dist/ImagePropertiesDialog-HG4K3IE7.js +0 -1
  125. package/dist/PageSetupDialog-GALVJMUB.js +0 -1
  126. package/dist/PageSetupDialog-TGQIAMI7.mjs +0 -1
  127. package/dist/TableToolbar-DUgmob2I.d.ts +0 -1273
  128. package/dist/TableToolbar-YL74HNS1.d.mts +0 -1273
  129. package/dist/chunk-23SXXIZS.js +0 -111
  130. package/dist/chunk-3F52AP2Q.js +0 -1
  131. package/dist/chunk-42O5GXM5.mjs +0 -82
  132. package/dist/chunk-54ULJEHM.mjs +0 -1
  133. package/dist/chunk-5XK326FI.mjs +0 -1
  134. package/dist/chunk-6WPRCJ5A.mjs +0 -1
  135. package/dist/chunk-76IYR7C7.mjs +0 -1
  136. package/dist/chunk-AGRIVA4G.js +0 -1
  137. package/dist/chunk-BTCQ2QI3.mjs +0 -3
  138. package/dist/chunk-BUEMG4NW.js +0 -1
  139. package/dist/chunk-BXRC4U3X.mjs +0 -2
  140. package/dist/chunk-CPAYKE6X.mjs +0 -1
  141. package/dist/chunk-DACWLFKI.mjs +0 -1
  142. package/dist/chunk-EPBFWE36.js +0 -2
  143. package/dist/chunk-FXES3YDB.js +0 -82
  144. package/dist/chunk-HI66BSGS.mjs +0 -9
  145. package/dist/chunk-INTPVEO6.mjs +0 -9
  146. package/dist/chunk-IOAGVW6Q.mjs +0 -2
  147. package/dist/chunk-JCEWC5QL.mjs +0 -4
  148. package/dist/chunk-JTIUFACT.js +0 -1
  149. package/dist/chunk-LUF7PWIC.js +0 -10
  150. package/dist/chunk-MGEN6GOE.mjs +0 -2
  151. package/dist/chunk-MOE2ZGUE.js +0 -18
  152. package/dist/chunk-MWLHJWB6.js +0 -9
  153. package/dist/chunk-OFYVDN3U.mjs +0 -2
  154. package/dist/chunk-P4VSHBGZ.js +0 -2
  155. package/dist/chunk-P5FQHIES.mjs +0 -1
  156. package/dist/chunk-PBC7XAYZ.js +0 -3
  157. package/dist/chunk-PEMB6SZT.js +0 -2
  158. package/dist/chunk-PQMSZTBB.js +0 -9
  159. package/dist/chunk-Q7UDQXAF.js +0 -1
  160. package/dist/chunk-QGTAIC5E.js +0 -1
  161. package/dist/chunk-QVPR2W5S.js +0 -1
  162. package/dist/chunk-R3QMYPL5.mjs +0 -59
  163. package/dist/chunk-RBUTXXQJ.mjs +0 -18
  164. package/dist/chunk-RRWYZ2TS.mjs +0 -111
  165. package/dist/chunk-S3STEPVO.js +0 -182
  166. package/dist/chunk-SFUM35DH.js +0 -2
  167. package/dist/chunk-SNLC6EK2.js +0 -1
  168. package/dist/chunk-TMTLIGLZ.js +0 -59
  169. package/dist/chunk-TSE2PWFX.mjs +0 -10
  170. package/dist/chunk-UKESXQS5.mjs +0 -182
  171. package/dist/chunk-UWYD42WV.js +0 -4
  172. package/dist/chunk-UXVACQCY.mjs +0 -1
  173. package/dist/chunk-W4EIKDM6.mjs +0 -2
  174. package/dist/chunk-W53SI3XW.mjs +0 -1
  175. package/dist/chunk-WNS2RBQD.js +0 -2
  176. package/dist/chunk-Z3KMSHUP.js +0 -1
  177. package/dist/core-plugins-reexport.d.mts +0 -31
  178. package/dist/core-plugins-reexport.d.ts +0 -31
  179. package/dist/core-plugins-reexport.js +0 -1
  180. package/dist/core-plugins-reexport.mjs +0 -1
  181. package/dist/core-reexport.d.mts +0 -340
  182. package/dist/core-reexport.d.ts +0 -340
  183. package/dist/core-reexport.js +0 -1
  184. package/dist/core-reexport.mjs +0 -1
  185. package/dist/documentSerializer-DtS_-oGA.d.mts +0 -664
  186. package/dist/documentSerializer-Wj1p2ASa.d.ts +0 -664
  187. package/dist/executor-C3VXF7QA.mjs +0 -1
  188. package/dist/executor-GDBV3AGV.js +0 -1
  189. package/dist/headless-reexport.d.mts +0 -197
  190. package/dist/headless-reexport.d.ts +0 -197
  191. package/dist/headless-reexport.js +0 -1
  192. package/dist/headless-reexport.mjs +0 -1
  193. package/dist/insertOperations-BTH1Asas.d.mts +0 -176
  194. package/dist/insertOperations-CbUnXAXH.d.ts +0 -176
  195. package/dist/layout-bridge-EA4DJ227.js +0 -1
  196. package/dist/layout-bridge-XDPSO6GO.mjs +0 -1
  197. package/dist/mcp-reexport.d.mts +0 -156
  198. package/dist/mcp-reexport.d.ts +0 -156
  199. package/dist/mcp-reexport.js +0 -16
  200. package/dist/mcp-reexport.mjs +0 -16
  201. package/dist/processTemplate-MJ2PCSO5.js +0 -1
  202. package/dist/react-B0W16SV6.d.ts +0 -1330
  203. package/dist/react-D0Pn1nww.d.mts +0 -1330
  204. package/dist/react.d.mts +0 -10
  205. package/dist/react.d.ts +0 -10
  206. package/dist/react.js +0 -1
  207. package/dist/react.mjs +0 -1
  208. package/dist/registry-CH9V-IX0.d.ts +0 -165
  209. package/dist/registry-CWBKYlNW.d.mts +0 -165
  210. package/dist/types-UDsUq8D3.d.mts +0 -310
  211. package/dist/types-jbivc9Lj.d.ts +0 -310
  212. package/dist/variableDetector-CdQ7ZTzA.d.mts +0 -204
  213. package/dist/variableDetector-DsRV3A9z.d.ts +0 -204
  214. package/i18n/de.json +0 -792
  215. package/i18n/en.json +0 -792
  216. package/i18n/he.json +0 -792
  217. package/i18n/pl.json +0 -792
  218. package/i18n/pt-BR.json +0 -792
  219. package/i18n/tr.json +0 -792
  220. package/i18n/zh-CN.json +0 -792
  221. /package/dist/{chunk-YC5KZSYD.js → chunk-ESZ6JRTW.js} +0 -0
  222. /package/dist/{chunk-LVGJKS7Y.mjs → chunk-TZMMD6RR.mjs} +0 -0
  223. /package/dist/{react.css → fork.css} +0 -0
@@ -774,7 +774,6 @@ interface ComplexField {
774
774
  /** Field is dirty */
775
775
  dirty?: boolean;
776
776
  }
777
- type Field = SimpleField | ComplexField;
778
777
  /**
779
778
  * Image size specification
780
779
  */
@@ -1008,33 +1007,6 @@ interface Shape {
1008
1007
  /** Custom geometry points */
1009
1008
  customGeometry?: string;
1010
1009
  }
1011
- /**
1012
- * Text box (floating text container)
1013
- */
1014
- interface TextBox {
1015
- type: 'textBox';
1016
- /** Unique ID */
1017
- id?: string;
1018
- /** Size */
1019
- size: ImageSize;
1020
- /** Position */
1021
- position?: ImagePosition;
1022
- /** Wrap settings */
1023
- wrap?: ImageWrap;
1024
- /** Fill */
1025
- fill?: ShapeFill;
1026
- /** Outline */
1027
- outline?: ShapeOutline;
1028
- /** Text content */
1029
- content: Paragraph[];
1030
- /** Internal margins */
1031
- margins?: {
1032
- top?: number;
1033
- bottom?: number;
1034
- left?: number;
1035
- right?: number;
1036
- };
1037
- }
1038
1010
  /**
1039
1011
  * Table cell
1040
1012
  */
@@ -1212,10 +1184,6 @@ interface MoveToRangeEnd {
1212
1184
  type: 'moveToRangeEnd';
1213
1185
  id: number;
1214
1186
  }
1215
- /**
1216
- * Run-level tracked wrappers represented in WordprocessingML.
1217
- */
1218
- type TrackedRunChange = Insertion | Deletion | MoveFrom | MoveTo;
1219
1187
  /**
1220
1188
  * Run property change (w:rPrChange)
1221
1189
  */
@@ -1321,8 +1289,13 @@ interface InlineSdt {
1321
1289
  type: 'inlineSdt';
1322
1290
  /** SDT properties */
1323
1291
  properties: SdtProperties;
1324
- /** Content runs inside the control */
1325
- content: (Run | Hyperlink)[];
1292
+ /**
1293
+ * Inline content held inside the control. OOXML allows runs,
1294
+ * hyperlinks, simple/complex fields, nested SDTs, and math at this
1295
+ * level; the renderer must descend into all of them so docProps-bound
1296
+ * fields and similar template content survive paged rendering.
1297
+ */
1298
+ content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | MathEquation)[];
1326
1299
  }
1327
1300
  /**
1328
1301
  * Block-level SDT (content control wrapping paragraphs/tables)
@@ -1594,724 +1567,4 @@ interface DocumentBody {
1594
1567
  comments?: Comment[];
1595
1568
  }
1596
1569
 
1597
- /**
1598
- * Styles, Theme, Font Table, Relationships & Media Types
1599
- *
1600
- * Types for document-level definitions that don't form the content tree.
1601
- */
1602
-
1603
- /**
1604
- * Style type
1605
- */
1606
- type StyleType = 'paragraph' | 'character' | 'numbering' | 'table';
1607
- /**
1608
- * Style definition
1609
- */
1610
- interface Style {
1611
- /** Style ID */
1612
- styleId: string;
1613
- /** Style type */
1614
- type: StyleType;
1615
- /** Display name */
1616
- name?: string;
1617
- /** Based on style ID */
1618
- basedOn?: string;
1619
- /** Next style after Enter (for paragraph styles) */
1620
- next?: string;
1621
- /** Linked style (paragraph/character pair) */
1622
- link?: string;
1623
- /** UI sort priority */
1624
- uiPriority?: number;
1625
- /** Hidden from UI */
1626
- hidden?: boolean;
1627
- /** Semi-hidden from UI */
1628
- semiHidden?: boolean;
1629
- /** Unhide when used */
1630
- unhideWhenUsed?: boolean;
1631
- /** Quick format in gallery */
1632
- qFormat?: boolean;
1633
- /** Is default style */
1634
- default?: boolean;
1635
- /** Personal style (custom) */
1636
- personal?: boolean;
1637
- /** Paragraph properties (for paragraph/table styles) */
1638
- pPr?: ParagraphFormatting;
1639
- /** Run properties */
1640
- rPr?: TextFormatting;
1641
- /** Table properties (for table styles) */
1642
- tblPr?: TableFormatting;
1643
- /** Table row properties */
1644
- trPr?: TableRowFormatting;
1645
- /** Table cell properties */
1646
- tcPr?: TableCellFormatting;
1647
- /** Conditional table style parts */
1648
- tblStylePr?: Array<{
1649
- type: 'band1Horz' | 'band1Vert' | 'band2Horz' | 'band2Vert' | 'firstCol' | 'firstRow' | 'lastCol' | 'lastRow' | 'neCell' | 'nwCell' | 'seCell' | 'swCell';
1650
- pPr?: ParagraphFormatting;
1651
- rPr?: TextFormatting;
1652
- tblPr?: TableFormatting;
1653
- trPr?: TableRowFormatting;
1654
- tcPr?: TableCellFormatting;
1655
- }>;
1656
- }
1657
- /**
1658
- * Document defaults (w:docDefaults)
1659
- */
1660
- interface DocDefaults {
1661
- /** Default run properties */
1662
- rPr?: TextFormatting;
1663
- /** Default paragraph properties */
1664
- pPr?: ParagraphFormatting;
1665
- }
1666
- /**
1667
- * Style definitions from styles.xml
1668
- */
1669
- interface StyleDefinitions {
1670
- /** Document defaults */
1671
- docDefaults?: DocDefaults;
1672
- /** Latent styles */
1673
- latentStyles?: {
1674
- defLockedState?: boolean;
1675
- defUIPriority?: number;
1676
- defSemiHidden?: boolean;
1677
- defUnhideWhenUsed?: boolean;
1678
- defQFormat?: boolean;
1679
- count?: number;
1680
- };
1681
- /** Style definitions */
1682
- styles: Style[];
1683
- }
1684
- /**
1685
- * Theme color scheme (a:clrScheme)
1686
- */
1687
- interface ThemeColorScheme {
1688
- /** Dark 1 color (usually black) */
1689
- dk1?: string;
1690
- /** Light 1 color (usually white) */
1691
- lt1?: string;
1692
- /** Dark 2 color */
1693
- dk2?: string;
1694
- /** Light 2 color */
1695
- lt2?: string;
1696
- /** Accent colors 1-6 */
1697
- accent1?: string;
1698
- accent2?: string;
1699
- accent3?: string;
1700
- accent4?: string;
1701
- accent5?: string;
1702
- accent6?: string;
1703
- /** Hyperlink color */
1704
- hlink?: string;
1705
- /** Followed hyperlink color */
1706
- folHlink?: string;
1707
- }
1708
- /**
1709
- * Theme font (with script variants)
1710
- */
1711
- interface ThemeFont {
1712
- /** Latin font */
1713
- latin?: string;
1714
- /** East Asian font */
1715
- ea?: string;
1716
- /** Complex script font */
1717
- cs?: string;
1718
- /** Script-specific fonts */
1719
- fonts?: Record<string, string>;
1720
- }
1721
- /**
1722
- * Theme font scheme (a:fontScheme)
1723
- */
1724
- interface ThemeFontScheme {
1725
- /** Major font (headings) */
1726
- majorFont?: ThemeFont;
1727
- /** Minor font (body text) */
1728
- minorFont?: ThemeFont;
1729
- }
1730
- /**
1731
- * Theme (from theme1.xml)
1732
- */
1733
- interface Theme {
1734
- /** Theme name */
1735
- name?: string;
1736
- /** Color scheme */
1737
- colorScheme?: ThemeColorScheme;
1738
- /** Font scheme */
1739
- fontScheme?: ThemeFontScheme;
1740
- /** Format scheme (fills, lines, effects) - simplified */
1741
- formatScheme?: {
1742
- name?: string;
1743
- };
1744
- }
1745
- /**
1746
- * Font info from fontTable.xml
1747
- */
1748
- interface FontInfo {
1749
- /** Font name */
1750
- name: string;
1751
- /** Alternate names */
1752
- altName?: string;
1753
- /** Panose-1 classification */
1754
- panose1?: string;
1755
- /** Character set */
1756
- charset?: string;
1757
- /** Font family type */
1758
- family?: 'decorative' | 'modern' | 'roman' | 'script' | 'swiss' | 'auto';
1759
- /** Pitch (fixed or variable) */
1760
- pitch?: 'default' | 'fixed' | 'variable';
1761
- /** Signature */
1762
- sig?: {
1763
- usb0?: string;
1764
- usb1?: string;
1765
- usb2?: string;
1766
- usb3?: string;
1767
- csb0?: string;
1768
- csb1?: string;
1769
- };
1770
- /** Embedded font data reference */
1771
- embedRegular?: string;
1772
- embedBold?: string;
1773
- embedItalic?: string;
1774
- embedBoldItalic?: string;
1775
- }
1776
- /**
1777
- * Font table from fontTable.xml
1778
- */
1779
- interface FontTable {
1780
- fonts: FontInfo[];
1781
- }
1782
- /**
1783
- * Relationship type
1784
- */
1785
- type RelationshipType = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/header' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData' | string;
1786
- /**
1787
- * Relationship entry
1788
- */
1789
- interface Relationship {
1790
- /** Relationship ID (e.g., "rId1") */
1791
- id: string;
1792
- /** Relationship type URI */
1793
- type: RelationshipType;
1794
- /** Target path or URL */
1795
- target: string;
1796
- /** Target mode */
1797
- targetMode?: 'External' | 'Internal';
1798
- }
1799
- /**
1800
- * Relationship map (keyed by rId)
1801
- */
1802
- type RelationshipMap = Map<string, Relationship>;
1803
- /**
1804
- * Media file from word/media/
1805
- */
1806
- interface MediaFile {
1807
- /** File path in ZIP */
1808
- path: string;
1809
- /** Original filename */
1810
- filename?: string;
1811
- /** MIME type */
1812
- mimeType: string;
1813
- /** Binary data */
1814
- data: ArrayBuffer;
1815
- /** Base64 encoded data for rendering */
1816
- base64?: string;
1817
- /** Data URL for direct use in src attributes */
1818
- dataUrl?: string;
1819
- }
1820
-
1821
- /**
1822
- * Comprehensive TypeScript types for full DOCX document representation
1823
- *
1824
- * This barrel file re-exports all types from the split modules.
1825
- * Existing imports from './types/document' continue to work unchanged.
1826
- *
1827
- * Module structure:
1828
- * - colors.ts — Color primitives, borders, shading
1829
- * - formatting.ts — Text, paragraph, and table formatting properties
1830
- * - lists.ts — Numbering and list definitions
1831
- * - content.ts — Content model (runs, images, shapes, tables, paragraphs, sections)
1832
- * - styles.ts — Styles, theme, fonts, relationships, media
1833
- */
1834
-
1835
- /**
1836
- * Complete DOCX package structure
1837
- */
1838
- interface DocxPackage {
1839
- /** Document body */
1840
- document: DocumentBody;
1841
- /** Style definitions */
1842
- styles?: StyleDefinitions;
1843
- /** Theme */
1844
- theme?: Theme;
1845
- /** Numbering definitions */
1846
- numbering?: NumberingDefinitions;
1847
- /** Font table */
1848
- fontTable?: FontTable;
1849
- /** Footnotes */
1850
- footnotes?: Footnote[];
1851
- /** Endnotes */
1852
- endnotes?: Endnote[];
1853
- /** Headers by relationship ID */
1854
- headers?: Map<string, HeaderFooter>;
1855
- /** Footers by relationship ID */
1856
- footers?: Map<string, HeaderFooter>;
1857
- /** Document relationships */
1858
- relationships?: RelationshipMap;
1859
- /** Media files */
1860
- media?: Map<string, MediaFile>;
1861
- /** Document properties */
1862
- properties?: {
1863
- title?: string;
1864
- subject?: string;
1865
- creator?: string;
1866
- keywords?: string;
1867
- description?: string;
1868
- lastModifiedBy?: string;
1869
- revision?: number;
1870
- created?: Date;
1871
- modified?: Date;
1872
- };
1873
- }
1874
- /**
1875
- * Complete parsed DOCX document
1876
- */
1877
- interface Document {
1878
- /** DOCX package with all parsed content */
1879
- package: DocxPackage;
1880
- /** Original ArrayBuffer for round-trip */
1881
- originalBuffer?: ArrayBuffer;
1882
- /** Detected template variables ({{...}}) */
1883
- templateVariables?: string[];
1884
- /** Parsing warnings/errors */
1885
- warnings?: string[];
1886
- }
1887
-
1888
- /**
1889
- * Agent API Types
1890
- *
1891
- * TypeScript interfaces for the agent API:
1892
- * - Position and Range types
1893
- * - Command types for document manipulation
1894
- * - Context types for AI agents
1895
- */
1896
-
1897
- /**
1898
- * Position within a document
1899
- */
1900
- interface Position {
1901
- /** Index of the paragraph (0-indexed) */
1902
- paragraphIndex: number;
1903
- /** Offset within the paragraph in characters */
1904
- offset: number;
1905
- /** Optional: Content index within paragraph (run, hyperlink, etc.) */
1906
- contentIndex?: number;
1907
- /** Optional: Section index */
1908
- sectionIndex?: number;
1909
- }
1910
- /**
1911
- * Range within a document
1912
- */
1913
- interface Range {
1914
- /** Start position */
1915
- start: Position;
1916
- /** End position */
1917
- end: Position;
1918
- /** Whether the range is collapsed (cursor position) */
1919
- collapsed?: boolean;
1920
- }
1921
- /**
1922
- * Create a collapsed range (cursor) at a position
1923
- */
1924
- declare function createCollapsedRange(position: Position): Range;
1925
- /**
1926
- * Create a range from two positions
1927
- */
1928
- declare function createRange(start: Position, end: Position): Range;
1929
- /**
1930
- * Check if a position is within a range
1931
- */
1932
- declare function isPositionInRange(position: Position, range: Range): boolean;
1933
- /**
1934
- * Compare two positions
1935
- * Returns: -1 if a < b, 0 if equal, 1 if a > b
1936
- */
1937
- declare function comparePositions(a: Position, b: Position): -1 | 0 | 1;
1938
- /**
1939
- * Base command interface
1940
- */
1941
- interface BaseCommand {
1942
- /** Command type */
1943
- type: string;
1944
- /** Unique command ID (for undo tracking) */
1945
- id?: string;
1946
- }
1947
- /**
1948
- * Insert text at a position
1949
- */
1950
- interface InsertTextCommand extends BaseCommand {
1951
- type: 'insertText';
1952
- /** Position to insert at */
1953
- position: Position;
1954
- /** Text to insert */
1955
- text: string;
1956
- /** Optional formatting for the inserted text */
1957
- formatting?: TextFormatting;
1958
- }
1959
- /**
1960
- * Replace text in a range
1961
- */
1962
- interface ReplaceTextCommand extends BaseCommand {
1963
- type: 'replaceText';
1964
- /** Range to replace */
1965
- range: Range;
1966
- /** Replacement text */
1967
- text: string;
1968
- /** Optional formatting for the new text */
1969
- formatting?: TextFormatting;
1970
- }
1971
- /**
1972
- * Delete text in a range
1973
- */
1974
- interface DeleteTextCommand extends BaseCommand {
1975
- type: 'deleteText';
1976
- /** Range to delete */
1977
- range: Range;
1978
- }
1979
- /**
1980
- * Apply formatting to a range
1981
- */
1982
- interface FormatTextCommand extends BaseCommand {
1983
- type: 'formatText';
1984
- /** Range to format */
1985
- range: Range;
1986
- /** Formatting to apply */
1987
- formatting: Partial<TextFormatting>;
1988
- }
1989
- /**
1990
- * Apply paragraph formatting
1991
- */
1992
- interface FormatParagraphCommand extends BaseCommand {
1993
- type: 'formatParagraph';
1994
- /** Paragraph index */
1995
- paragraphIndex: number;
1996
- /** Formatting to apply */
1997
- formatting: Partial<ParagraphFormatting>;
1998
- }
1999
- /**
2000
- * Apply a named style to a paragraph
2001
- */
2002
- interface ApplyStyleCommand extends BaseCommand {
2003
- type: 'applyStyle';
2004
- /** Paragraph index */
2005
- paragraphIndex: number;
2006
- /** Style ID to apply */
2007
- styleId: string;
2008
- }
2009
- /**
2010
- * Insert a table at a position
2011
- */
2012
- interface InsertTableCommand extends BaseCommand {
2013
- type: 'insertTable';
2014
- /** Position to insert at */
2015
- position: Position;
2016
- /** Number of rows */
2017
- rows: number;
2018
- /** Number of columns */
2019
- columns: number;
2020
- /** Optional table data */
2021
- data?: string[][];
2022
- /** Optional header row */
2023
- hasHeader?: boolean;
2024
- }
2025
- /**
2026
- * Insert an image at a position
2027
- */
2028
- interface InsertImageCommand extends BaseCommand {
2029
- type: 'insertImage';
2030
- /** Position to insert at */
2031
- position: Position;
2032
- /** Image source (base64 or URL) */
2033
- src: string;
2034
- /** Image width in pixels */
2035
- width?: number;
2036
- /** Image height in pixels */
2037
- height?: number;
2038
- /** Alt text */
2039
- alt?: string;
2040
- }
2041
- /**
2042
- * Insert a hyperlink at a range
2043
- */
2044
- interface InsertHyperlinkCommand extends BaseCommand {
2045
- type: 'insertHyperlink';
2046
- /** Range to make into a hyperlink */
2047
- range: Range;
2048
- /** URL of the hyperlink */
2049
- url: string;
2050
- /** Display text (replaces range text if provided) */
2051
- displayText?: string;
2052
- /** Tooltip */
2053
- tooltip?: string;
2054
- }
2055
- /**
2056
- * Remove a hyperlink but keep the text
2057
- */
2058
- interface RemoveHyperlinkCommand extends BaseCommand {
2059
- type: 'removeHyperlink';
2060
- /** Range containing the hyperlink */
2061
- range: Range;
2062
- }
2063
- /**
2064
- * Insert a paragraph break
2065
- */
2066
- interface InsertParagraphBreakCommand extends BaseCommand {
2067
- type: 'insertParagraphBreak';
2068
- /** Position to break at */
2069
- position: Position;
2070
- }
2071
- /**
2072
- * Merge paragraphs
2073
- */
2074
- interface MergeParagraphsCommand extends BaseCommand {
2075
- type: 'mergeParagraphs';
2076
- /** First paragraph index */
2077
- paragraphIndex: number;
2078
- /** Number of paragraphs to merge with */
2079
- count: number;
2080
- }
2081
- /**
2082
- * Split a paragraph
2083
- */
2084
- interface SplitParagraphCommand extends BaseCommand {
2085
- type: 'splitParagraph';
2086
- /** Position to split at */
2087
- position: Position;
2088
- }
2089
- /**
2090
- * Set template variable value
2091
- */
2092
- interface SetVariableCommand extends BaseCommand {
2093
- type: 'setVariable';
2094
- /** Variable name */
2095
- name: string;
2096
- /** Variable value */
2097
- value: string;
2098
- }
2099
- /**
2100
- * Apply all template variables
2101
- */
2102
- interface ApplyVariablesCommand extends BaseCommand {
2103
- type: 'applyVariables';
2104
- /** Variable values */
2105
- values: Record<string, string>;
2106
- }
2107
- /**
2108
- * Union of all command types
2109
- */
2110
- type AgentCommand = InsertTextCommand | ReplaceTextCommand | DeleteTextCommand | FormatTextCommand | FormatParagraphCommand | ApplyStyleCommand | InsertTableCommand | InsertImageCommand | InsertHyperlinkCommand | RemoveHyperlinkCommand | InsertParagraphBreakCommand | MergeParagraphsCommand | SplitParagraphCommand | SetVariableCommand | ApplyVariablesCommand;
2111
- /**
2112
- * Document context for AI agents
2113
- */
2114
- interface AgentContext {
2115
- /** Total paragraph count */
2116
- paragraphCount: number;
2117
- /** Total word count (approximate) */
2118
- wordCount: number;
2119
- /** Total character count */
2120
- characterCount: number;
2121
- /** Detected template variables */
2122
- variables: string[];
2123
- /** Variable count */
2124
- variableCount: number;
2125
- /** Available styles */
2126
- availableStyles: StyleInfo[];
2127
- /** Content outline (first N chars per paragraph) */
2128
- outline: ParagraphOutline[];
2129
- /** Document sections info */
2130
- sections: SectionInfo[];
2131
- /** Has tables */
2132
- hasTables: boolean;
2133
- /** Has images */
2134
- hasImages: boolean;
2135
- /** Has hyperlinks */
2136
- hasHyperlinks: boolean;
2137
- /** Document language */
2138
- language?: string;
2139
- }
2140
- /**
2141
- * Style information for context
2142
- */
2143
- interface StyleInfo {
2144
- /** Style ID */
2145
- id: string;
2146
- /** Display name */
2147
- name: string;
2148
- /** Style type */
2149
- type: 'paragraph' | 'character' | 'table';
2150
- /** Is built-in style */
2151
- builtIn?: boolean;
2152
- }
2153
- /**
2154
- * Paragraph outline for context
2155
- */
2156
- interface ParagraphOutline {
2157
- /** Paragraph index */
2158
- index: number;
2159
- /** First N characters */
2160
- preview: string;
2161
- /** Paragraph style */
2162
- style?: string;
2163
- /** Is heading */
2164
- isHeading?: boolean;
2165
- /** Heading level (1-9) */
2166
- headingLevel?: number;
2167
- /** Is list item */
2168
- isListItem?: boolean;
2169
- /** Is empty paragraph */
2170
- isEmpty?: boolean;
2171
- }
2172
- /**
2173
- * Section information
2174
- */
2175
- interface SectionInfo {
2176
- /** Section index */
2177
- index: number;
2178
- /** Number of paragraphs */
2179
- paragraphCount: number;
2180
- /** Page size */
2181
- pageSize?: {
2182
- width: number;
2183
- height: number;
2184
- };
2185
- /** Is landscape */
2186
- isLandscape?: boolean;
2187
- /** Has header */
2188
- hasHeader?: boolean;
2189
- /** Has footer */
2190
- hasFooter?: boolean;
2191
- }
2192
- /**
2193
- * Context about the current selection
2194
- */
2195
- interface SelectionContext {
2196
- /** Selected text */
2197
- selectedText: string;
2198
- /** Selection range */
2199
- range: Range;
2200
- /** Current formatting of selection */
2201
- formatting: Partial<TextFormatting>;
2202
- /** Current paragraph formatting */
2203
- paragraphFormatting: Partial<ParagraphFormatting>;
2204
- /** Text before selection (context) */
2205
- textBefore: string;
2206
- /** Text after selection (context) */
2207
- textAfter: string;
2208
- /** Paragraph containing selection */
2209
- paragraph: ParagraphContext;
2210
- /** Is selection within a table */
2211
- inTable?: boolean;
2212
- /** Is selection within a hyperlink */
2213
- inHyperlink?: boolean;
2214
- /** Suggested actions based on selection */
2215
- suggestedActions?: SuggestedAction[];
2216
- }
2217
- /**
2218
- * Paragraph context for selection
2219
- */
2220
- interface ParagraphContext {
2221
- /** Paragraph index */
2222
- index: number;
2223
- /** Full paragraph text */
2224
- fullText: string;
2225
- /** Paragraph style */
2226
- style?: string;
2227
- /** Word count */
2228
- wordCount: number;
2229
- }
2230
- /**
2231
- * Suggested action for context menu
2232
- */
2233
- interface SuggestedAction {
2234
- /** Action ID */
2235
- id: string;
2236
- /** Display label */
2237
- label: string;
2238
- /** Description */
2239
- description?: string;
2240
- /** Icon name */
2241
- icon?: string;
2242
- /** Priority (higher = more prominent) */
2243
- priority?: number;
2244
- }
2245
- /**
2246
- * Response from an agent action
2247
- */
2248
- interface AgentResponse {
2249
- /** Success status */
2250
- success: boolean;
2251
- /** New text to insert (for rewrite/expand/etc.) */
2252
- newText?: string;
2253
- /** New formatted content */
2254
- newContent?: AgentContent[];
2255
- /** Commands to execute */
2256
- commands?: AgentCommand[];
2257
- /** Error message if failed */
2258
- error?: string;
2259
- /** Warning messages */
2260
- warnings?: string[];
2261
- /** Metadata about the response */
2262
- metadata?: Record<string, unknown>;
2263
- }
2264
- /**
2265
- * Content block in agent response
2266
- */
2267
- interface AgentContent {
2268
- /** Content type */
2269
- type: 'text' | 'paragraph' | 'table' | 'image';
2270
- /** Text content */
2271
- text?: string;
2272
- /** Formatting */
2273
- formatting?: Partial<TextFormatting>;
2274
- /** Paragraph formatting */
2275
- paragraphFormatting?: Partial<ParagraphFormatting>;
2276
- /** Table data (for table type) */
2277
- tableData?: string[][];
2278
- /** Image src (for image type) */
2279
- imageSrc?: string;
2280
- }
2281
- /**
2282
- * AI action types for context menu
2283
- */
2284
- type AIAction = 'askAI' | 'rewrite' | 'expand' | 'summarize' | 'translate' | 'explain' | 'fixGrammar' | 'makeFormal' | 'makeCasual' | 'custom';
2285
- /**
2286
- * AI action request
2287
- */
2288
- interface AIActionRequest {
2289
- /** Action type */
2290
- action: AIAction;
2291
- /** Selection context */
2292
- context: SelectionContext;
2293
- /** Custom prompt (for 'custom' action) */
2294
- customPrompt?: string;
2295
- /** Target language (for 'translate' action) */
2296
- targetLanguage?: string;
2297
- /** Additional options */
2298
- options?: Record<string, unknown>;
2299
- }
2300
- /**
2301
- * Get action label
2302
- */
2303
- declare function getActionLabel(action: AIAction): string;
2304
- /**
2305
- * Get action description
2306
- */
2307
- declare function getActionDescription(action: AIAction): string;
2308
- /**
2309
- * Default AI actions for context menu
2310
- */
2311
- declare const DEFAULT_AI_ACTIONS: AIAction[];
2312
- /**
2313
- * Create a command with generated ID
2314
- */
2315
- declare function createCommand<T extends AgentCommand>(command: Omit<T, 'id'>): T;
2316
-
2317
- export { type SuggestedAction as $, type AgentCommand as A, type BreakContent as B, type Comment as C, type Document as D, type Endnote as E, type Footnote as F, type ParagraphContent as G, type Hyperlink as H, type Image as I, type ParagraphContext as J, type ParagraphFormatting as K, type ListLevel as L, type MoveFrom as M, type NumberingDefinitions as N, type ParagraphOutline as O, type Position as P, type Relationship as Q, type Range as R, type ReplaceTextCommand as S, type TextFormatting as T, type SectionInfo as U, type SectionProperties as V, type SelectionContext as W, type SetVariableCommand as X, type Style as Y, type StyleDefinitions as Z, type StyleInfo as _, type Paragraph as a, type TableCell as a0, type TableRow as a1, type TextContent as a2, type Theme as a3, type TrackedChangeInfo as a4, type TrackedRunChange as a5, comparePositions as a6, createCollapsedRange as a7, createCommand as a8, createRange as a9, getActionDescription as aa, getActionLabel as ab, isPositionInRange as ac, type BookmarkEnd as ad, type BookmarkStart as ae, type Field as af, type FooterReference as ag, type HeaderFooter as ah, type HeaderReference as ai, type Shape as aj, type TextBox as ak, type ThemeColorScheme as al, type ThemeFont as am, type ThemeFontScheme as an, type ColorValue as ao, type ThemeColorSlot as ap, type BorderSpec as aq, type LineSpacingRule as ar, type NumberFormat as as, type ParagraphAlignment as at, type Section as au, type TableBorders as av, type TableCellFormatting as aw, type StyleType as ax, type TabStop as ay, type Run as b, type RunContent as c, type DocumentBody as d, type Table as e, type AIAction as f, type AIActionRequest as g, type AgentContext as h, type AgentResponse as i, type ApplyStyleCommand as j, type ApplyVariablesCommand as k, type BlockContent as l, type CommentRangeEnd as m, type CommentRangeStart as n, DEFAULT_AI_ACTIONS as o, type DeleteTextCommand as p, type Deletion as q, type DocxPackage as r, type FormatParagraphCommand as s, type FormatTextCommand as t, type InsertHyperlinkCommand as u, type InsertImageCommand as v, type InsertTableCommand as w, type InsertTextCommand as x, type Insertion as y, type MoveTo as z };
1570
+ export type { BorderSpec as B, Comment as C, DocumentBody as D, Endnote as E, Footnote as F, HeaderFooter as H, LineSpacingRule as L, NumberFormat as N, ParagraphFormatting as P, Run as R, SectionProperties as S, TextFormatting as T, ParagraphAlignment as a, TableBorders as b, TableCellFormatting as c, ColorValue as d, TabStop as e, Table as f, TableCell as g, TableFormatting as h, TableRowFormatting as i, NumberingDefinitions as j };