@zeke-02/docx-editor-core 0.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 (431) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +89 -0
  3. package/dist/ImageExtension-BN327PNe.d.mts +38 -0
  4. package/dist/ImageExtension-BlI5afZD.d.ts +38 -0
  5. package/dist/Subscribable-DOz6Ohoo.d.mts +33 -0
  6. package/dist/Subscribable-DOz6Ohoo.d.ts +33 -0
  7. package/dist/agent/index.d.mts +168 -0
  8. package/dist/agent/index.d.ts +168 -0
  9. package/dist/agent/index.js +1 -0
  10. package/dist/agent/index.mjs +1 -0
  11. package/dist/borders-BH_GoYU3.d.mts +58 -0
  12. package/dist/borders-Z9hPno2u.d.ts +58 -0
  13. package/dist/chunk-2HFQ4QTU.js +1 -0
  14. package/dist/chunk-2KHWHVTA.js +1 -0
  15. package/dist/chunk-2MSZXH6Q.mjs +2 -0
  16. package/dist/chunk-3COGZG7O.mjs +1 -0
  17. package/dist/chunk-3NRMSZX2.mjs +1 -0
  18. package/dist/chunk-3SXJPJSV.mjs +1 -0
  19. package/dist/chunk-44FHVKSI.js +1 -0
  20. package/dist/chunk-4BFNWPKW.js +1 -0
  21. package/dist/chunk-4G6AJ4ZM.js +1 -0
  22. package/dist/chunk-4GER4JLW.js +1 -0
  23. package/dist/chunk-4Q2IP5FW.js +1 -0
  24. package/dist/chunk-56D223FM.mjs +1 -0
  25. package/dist/chunk-5VBNOHRE.mjs +1 -0
  26. package/dist/chunk-67LVRQIR.mjs +1 -0
  27. package/dist/chunk-6LVPRTB6.js +1 -0
  28. package/dist/chunk-6NQSIC27.mjs +1 -0
  29. package/dist/chunk-6Y6LON6Y.mjs +1 -0
  30. package/dist/chunk-6ZXL3EIP.mjs +2 -0
  31. package/dist/chunk-7AMYZMCX.js +1 -0
  32. package/dist/chunk-7E5VBRDL.mjs +1 -0
  33. package/dist/chunk-7HANRHHL.js +1 -0
  34. package/dist/chunk-7LRR7RKE.mjs +15 -0
  35. package/dist/chunk-7RDCZLTU.js +1 -0
  36. package/dist/chunk-7U4I6BKJ.js +1 -0
  37. package/dist/chunk-7Z2AGPNQ.mjs +10 -0
  38. package/dist/chunk-AAPBAMD7.js +1 -0
  39. package/dist/chunk-AGVFAXVQ.mjs +9 -0
  40. package/dist/chunk-AMENZY5F.mjs +1 -0
  41. package/dist/chunk-ARHPXIBJ.mjs +1 -0
  42. package/dist/chunk-BGY3CB37.mjs +1 -0
  43. package/dist/chunk-BHBOAP6Z.js +3 -0
  44. package/dist/chunk-BOOHU5EW.mjs +1 -0
  45. package/dist/chunk-C2BAPYGJ.js +1 -0
  46. package/dist/chunk-CGJ6S3AH.mjs +1 -0
  47. package/dist/chunk-CKKO4JWE.mjs +1 -0
  48. package/dist/chunk-CTHHUJAB.mjs +2 -0
  49. package/dist/chunk-CUY2THAO.mjs +1 -0
  50. package/dist/chunk-CXQDYR2Y.js +1 -0
  51. package/dist/chunk-D4RPOJC7.js +1 -0
  52. package/dist/chunk-D6GO7UGD.mjs +1 -0
  53. package/dist/chunk-DC7S76ZX.js +1 -0
  54. package/dist/chunk-DROCYKAR.js +1 -0
  55. package/dist/chunk-DV6GWBUJ.js +2 -0
  56. package/dist/chunk-DZYYLV2O.js +1 -0
  57. package/dist/chunk-E4JMCA5X.js +2 -0
  58. package/dist/chunk-ERNVFCGN.js +59 -0
  59. package/dist/chunk-ESI4BSBF.js +1 -0
  60. package/dist/chunk-F44ZLDZS.js +4 -0
  61. package/dist/chunk-FCJWLEKT.mjs +1 -0
  62. package/dist/chunk-FDEDN2RC.mjs +0 -0
  63. package/dist/chunk-FRYMBAHP.js +3 -0
  64. package/dist/chunk-FWTP7BN7.mjs +4 -0
  65. package/dist/chunk-G3YJ5RKC.mjs +1 -0
  66. package/dist/chunk-GGPKPXON.js +1 -0
  67. package/dist/chunk-HKVAW3RE.js +1 -0
  68. package/dist/chunk-HQPWFUP5.js +2 -0
  69. package/dist/chunk-I6PMX4BO.js +1 -0
  70. package/dist/chunk-ILJUDEZ5.mjs +1 -0
  71. package/dist/chunk-IMKU4O3P.js +1 -0
  72. package/dist/chunk-IP2VXNWG.js +1 -0
  73. package/dist/chunk-J4J2Y6EU.js +10 -0
  74. package/dist/chunk-J7NADDC4.mjs +1 -0
  75. package/dist/chunk-JFZIXFRC.js +1 -0
  76. package/dist/chunk-JHZ3HLSR.mjs +1 -0
  77. package/dist/chunk-JY5EFI4D.js +1 -0
  78. package/dist/chunk-JZESIPVC.mjs +3 -0
  79. package/dist/chunk-K7GVLZS6.mjs +1 -0
  80. package/dist/chunk-KESNGXGO.js +1 -0
  81. package/dist/chunk-KQTB5Y7P.mjs +1 -0
  82. package/dist/chunk-L2U3TTAD.js +9 -0
  83. package/dist/chunk-LBKMYD3M.mjs +1 -0
  84. package/dist/chunk-LCICADWM.js +2 -0
  85. package/dist/chunk-LE67NTCN.mjs +1 -0
  86. package/dist/chunk-LTHT4A4S.js +1 -0
  87. package/dist/chunk-MCFHOMA2.js +2 -0
  88. package/dist/chunk-MCX4GVRX.mjs +1 -0
  89. package/dist/chunk-MJ5FQX7Q.js +1 -0
  90. package/dist/chunk-MJ6XZFVD.mjs +1 -0
  91. package/dist/chunk-MNOHUTKE.js +15 -0
  92. package/dist/chunk-MOKKS75W.mjs +3 -0
  93. package/dist/chunk-MP4QSEO2.mjs +1 -0
  94. package/dist/chunk-MVZOTKNL.mjs +1 -0
  95. package/dist/chunk-MZ7LW5CH.js +1 -0
  96. package/dist/chunk-MZOVDLYL.js +1 -0
  97. package/dist/chunk-N3Y5BUKV.js +1 -0
  98. package/dist/chunk-NBLJPT54.mjs +1 -0
  99. package/dist/chunk-NDDJ67FQ.mjs +1 -0
  100. package/dist/chunk-NMUHXIF5.js +1 -0
  101. package/dist/chunk-NXLJVVVE.js +1 -0
  102. package/dist/chunk-OBMN4VSM.mjs +1 -0
  103. package/dist/chunk-OCAX2KJQ.js +4 -0
  104. package/dist/chunk-OEXVWIHW.mjs +2 -0
  105. package/dist/chunk-OZMNIX6U.mjs +1 -0
  106. package/dist/chunk-PRRM64JO.mjs +1 -0
  107. package/dist/chunk-PXE2OWEA.mjs +1 -0
  108. package/dist/chunk-Q4CKLXWA.js +1 -0
  109. package/dist/chunk-Q5QOBZWT.mjs +1 -0
  110. package/dist/chunk-QJJQ53V6.mjs +1 -0
  111. package/dist/chunk-QLPQVR5W.mjs +1 -0
  112. package/dist/chunk-QLX4HX3I.mjs +59 -0
  113. package/dist/chunk-QPFJJPIC.mjs +1 -0
  114. package/dist/chunk-QYUPLKLP.mjs +1 -0
  115. package/dist/chunk-RFC2SXZ6.mjs +4 -0
  116. package/dist/chunk-RNOXNNSD.mjs +0 -0
  117. package/dist/chunk-RPIQG46O.mjs +1 -0
  118. package/dist/chunk-RQN4C636.js +1 -0
  119. package/dist/chunk-SHJBS42Y.js +1 -0
  120. package/dist/chunk-SORYYVJ7.js +1 -0
  121. package/dist/chunk-SWC6T7YQ.js +1 -0
  122. package/dist/chunk-TE2AF7FM.js +1 -0
  123. package/dist/chunk-TE2VQJZG.js +1 -0
  124. package/dist/chunk-TUIEV7Q7.js +1 -0
  125. package/dist/chunk-U4UCHBZ7.js +1 -0
  126. package/dist/chunk-U74VPTIU.js +1 -0
  127. package/dist/chunk-UCJGOQ4J.mjs +1 -0
  128. package/dist/chunk-UQ6WNWXX.js +1 -0
  129. package/dist/chunk-VHUVPHPI.mjs +1 -0
  130. package/dist/chunk-VQWZHPWI.mjs +1 -0
  131. package/dist/chunk-VW22RZ6C.mjs +1 -0
  132. package/dist/chunk-WLHNIXWC.mjs +2 -0
  133. package/dist/chunk-WLKRUBY4.js +1 -0
  134. package/dist/chunk-WTFLNYAT.mjs +1 -0
  135. package/dist/chunk-XNDGWWDT.js +1 -0
  136. package/dist/chunk-XXU7YQVV.js +1 -0
  137. package/dist/chunk-Y74ANBPV.js +1 -0
  138. package/dist/chunk-YMZ3F2FZ.mjs +1 -0
  139. package/dist/chunk-YTDWMXNS.js +1 -0
  140. package/dist/chunk-YUZQTRI2.js +1 -0
  141. package/dist/chunk-ZX26QZJ5.mjs +1 -0
  142. package/dist/chunk-ZY7EMTZ3.mjs +1 -0
  143. package/dist/colorResolver-BZ_yScf4.d.ts +390 -0
  144. package/dist/colorResolver-C6DtsoFI.d.mts +390 -0
  145. package/dist/colors-C3vA7HUU.d.mts +70 -0
  146. package/dist/colors-C3vA7HUU.d.ts +70 -0
  147. package/dist/content-5Mrz6w_b.d.mts +1360 -0
  148. package/dist/content-CmqAwdFL.d.ts +1360 -0
  149. package/dist/core-plugins.d.mts +63 -0
  150. package/dist/core-plugins.d.ts +63 -0
  151. package/dist/core-plugins.js +1 -0
  152. package/dist/core-plugins.mjs +1 -0
  153. package/dist/core.d.mts +398 -0
  154. package/dist/core.d.ts +398 -0
  155. package/dist/core.js +1 -0
  156. package/dist/core.mjs +1 -0
  157. package/dist/documentSerializer-BRaaXIHm.d.ts +36 -0
  158. package/dist/documentSerializer-DgO3A9av.d.mts +36 -0
  159. package/dist/docx/index.d.mts +1123 -0
  160. package/dist/docx/index.d.ts +1123 -0
  161. package/dist/docx/index.js +1 -0
  162. package/dist/docx/index.mjs +1 -0
  163. package/dist/docx/parser.d.mts +108 -0
  164. package/dist/docx/parser.d.ts +108 -0
  165. package/dist/docx/parser.js +1 -0
  166. package/dist/docx/parser.mjs +1 -0
  167. package/dist/docx/rezip.d.mts +312 -0
  168. package/dist/docx/rezip.d.ts +312 -0
  169. package/dist/docx/rezip.js +1 -0
  170. package/dist/docx/rezip.mjs +1 -0
  171. package/dist/docx/serializer/index.d.mts +125 -0
  172. package/dist/docx/serializer/index.d.ts +125 -0
  173. package/dist/docx/serializer/index.js +1 -0
  174. package/dist/docx/serializer/index.mjs +1 -0
  175. package/dist/docx/wrapTypes.d.mts +19 -0
  176. package/dist/docx/wrapTypes.d.ts +19 -0
  177. package/dist/docx/wrapTypes.js +1 -0
  178. package/dist/docx/wrapTypes.mjs +1 -0
  179. package/dist/docxInput-DTbCa48g.d.mts +21 -0
  180. package/dist/docxInput-DTbCa48g.d.ts +21 -0
  181. package/dist/executor-DZAMMQ35.js +1 -0
  182. package/dist/executor-ZCJRLT3Z.mjs +1 -0
  183. package/dist/findParagraphByParaId-Maw_8M5D.d.mts +28 -0
  184. package/dist/findParagraphByParaId-Maw_8M5D.d.ts +28 -0
  185. package/dist/fontLoader-8b4X-AIh.d.mts +283 -0
  186. package/dist/fontLoader-CK2QLq68.d.ts +283 -0
  187. package/dist/footnotes-lCH_P3N3.d.mts +78 -0
  188. package/dist/footnotes-skVvEHvZ.d.ts +78 -0
  189. package/dist/formatting-BH4hcZiq.d.mts +410 -0
  190. package/dist/formatting-_OXU8gLB.d.ts +410 -0
  191. package/dist/headerFooterLayout-72Vz7yp3.d.mts +292 -0
  192. package/dist/headerFooterLayout-Ca4ESDHF.d.ts +292 -0
  193. package/dist/headless.d.mts +109 -0
  194. package/dist/headless.d.ts +109 -0
  195. package/dist/headless.js +1 -0
  196. package/dist/headless.mjs +1 -0
  197. package/dist/layout-bridge/clickToPositionDom.d.mts +56 -0
  198. package/dist/layout-bridge/clickToPositionDom.d.ts +56 -0
  199. package/dist/layout-bridge/clickToPositionDom.js +1 -0
  200. package/dist/layout-bridge/clickToPositionDom.mjs +1 -0
  201. package/dist/layout-bridge/index.d.mts +462 -0
  202. package/dist/layout-bridge/index.d.ts +462 -0
  203. package/dist/layout-bridge/index.js +1 -0
  204. package/dist/layout-bridge/index.mjs +1 -0
  205. package/dist/layout-bridge/measuring/index.d.mts +377 -0
  206. package/dist/layout-bridge/measuring/index.d.ts +377 -0
  207. package/dist/layout-bridge/measuring/index.js +1 -0
  208. package/dist/layout-bridge/measuring/index.mjs +1 -0
  209. package/dist/layout-bridge/tableInsertHover.d.mts +45 -0
  210. package/dist/layout-bridge/tableInsertHover.d.ts +45 -0
  211. package/dist/layout-bridge/tableInsertHover.js +1 -0
  212. package/dist/layout-bridge/tableInsertHover.mjs +1 -0
  213. package/dist/layout-bridge/toFlowBlocks.d.mts +130 -0
  214. package/dist/layout-bridge/toFlowBlocks.d.ts +130 -0
  215. package/dist/layout-bridge/toFlowBlocks.js +1 -0
  216. package/dist/layout-bridge/toFlowBlocks.mjs +1 -0
  217. package/dist/layout-engine/index.d.mts +352 -0
  218. package/dist/layout-engine/index.d.ts +352 -0
  219. package/dist/layout-engine/index.js +1 -0
  220. package/dist/layout-engine/index.mjs +1 -0
  221. package/dist/layout-engine/types.d.mts +943 -0
  222. package/dist/layout-engine/types.d.ts +943 -0
  223. package/dist/layout-engine/types.js +1 -0
  224. package/dist/layout-engine/types.mjs +1 -0
  225. package/dist/layout-painter/index.d.mts +22 -0
  226. package/dist/layout-painter/index.d.ts +22 -0
  227. package/dist/layout-painter/index.js +1 -0
  228. package/dist/layout-painter/index.mjs +1 -0
  229. package/dist/layout-painter/renderPage.d.mts +680 -0
  230. package/dist/layout-painter/renderPage.d.ts +680 -0
  231. package/dist/layout-painter/renderPage.js +1 -0
  232. package/dist/layout-painter/renderPage.mjs +1 -0
  233. package/dist/managers/AutoSaveManager.d.mts +95 -0
  234. package/dist/managers/AutoSaveManager.d.ts +95 -0
  235. package/dist/managers/AutoSaveManager.js +1 -0
  236. package/dist/managers/AutoSaveManager.mjs +1 -0
  237. package/dist/managers/TableSelectionManager.d.mts +94 -0
  238. package/dist/managers/TableSelectionManager.d.ts +94 -0
  239. package/dist/managers/TableSelectionManager.js +1 -0
  240. package/dist/managers/TableSelectionManager.mjs +1 -0
  241. package/dist/managers/types.d.mts +121 -0
  242. package/dist/managers/types.d.ts +121 -0
  243. package/dist/managers/types.js +1 -0
  244. package/dist/managers/types.mjs +0 -0
  245. package/dist/marks-BY573yZn.d.mts +56 -0
  246. package/dist/marks-CjC9tF5k.d.ts +56 -0
  247. package/dist/mcp-cli.mjs +138 -0
  248. package/dist/mcp.d.mts +183 -0
  249. package/dist/mcp.d.ts +183 -0
  250. package/dist/mcp.js +16 -0
  251. package/dist/mcp.mjs +16 -0
  252. package/dist/nodes-7753Bgi_.d.mts +320 -0
  253. package/dist/nodes-CC_nwkT_.d.ts +320 -0
  254. package/dist/plugin-api/RenderedDomContext.d.mts +74 -0
  255. package/dist/plugin-api/RenderedDomContext.d.ts +74 -0
  256. package/dist/plugin-api/RenderedDomContext.js +1 -0
  257. package/dist/plugin-api/RenderedDomContext.mjs +1 -0
  258. package/dist/plugin-api/index.d.mts +15 -0
  259. package/dist/plugin-api/index.d.ts +15 -0
  260. package/dist/plugin-api/index.js +1 -0
  261. package/dist/plugin-api/index.mjs +0 -0
  262. package/dist/plugin-api/resolveItemPositions.d.mts +54 -0
  263. package/dist/plugin-api/resolveItemPositions.d.ts +54 -0
  264. package/dist/plugin-api/resolveItemPositions.js +1 -0
  265. package/dist/plugin-api/resolveItemPositions.mjs +1 -0
  266. package/dist/plugin-api/types.d.mts +190 -0
  267. package/dist/plugin-api/types.d.ts +190 -0
  268. package/dist/plugin-api/types.js +1 -0
  269. package/dist/plugin-api/types.mjs +0 -0
  270. package/dist/processTemplate-GPFDLQMX.mjs +1 -0
  271. package/dist/processTemplate-HH2E3HBO.js +1 -0
  272. package/dist/prosemirror/commands/formatting.d.mts +100 -0
  273. package/dist/prosemirror/commands/formatting.d.ts +100 -0
  274. package/dist/prosemirror/commands/formatting.js +1 -0
  275. package/dist/prosemirror/commands/formatting.mjs +1 -0
  276. package/dist/prosemirror/commands/index.d.mts +188 -0
  277. package/dist/prosemirror/commands/index.d.ts +188 -0
  278. package/dist/prosemirror/commands/index.js +1 -0
  279. package/dist/prosemirror/commands/index.mjs +1 -0
  280. package/dist/prosemirror/commands/pageBreak.d.mts +20 -0
  281. package/dist/prosemirror/commands/pageBreak.d.ts +20 -0
  282. package/dist/prosemirror/commands/pageBreak.js +1 -0
  283. package/dist/prosemirror/commands/pageBreak.mjs +1 -0
  284. package/dist/prosemirror/commands/paragraph.d.mts +70 -0
  285. package/dist/prosemirror/commands/paragraph.d.ts +70 -0
  286. package/dist/prosemirror/commands/paragraph.js +1 -0
  287. package/dist/prosemirror/commands/paragraph.mjs +1 -0
  288. package/dist/prosemirror/conversion/fromProseDoc.d.mts +65 -0
  289. package/dist/prosemirror/conversion/fromProseDoc.d.ts +65 -0
  290. package/dist/prosemirror/conversion/fromProseDoc.js +1 -0
  291. package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -0
  292. package/dist/prosemirror/conversion/index.d.mts +85 -0
  293. package/dist/prosemirror/conversion/index.d.ts +85 -0
  294. package/dist/prosemirror/conversion/index.js +1 -0
  295. package/dist/prosemirror/conversion/index.mjs +1 -0
  296. package/dist/prosemirror/editor.css +823 -0
  297. package/dist/prosemirror/extensions/index.d.mts +79 -0
  298. package/dist/prosemirror/extensions/index.d.ts +79 -0
  299. package/dist/prosemirror/extensions/index.js +1 -0
  300. package/dist/prosemirror/extensions/index.mjs +1 -0
  301. package/dist/prosemirror/extensions/nodes/TableExtension.d.mts +30 -0
  302. package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +30 -0
  303. package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -0
  304. package/dist/prosemirror/extensions/nodes/TableExtension.mjs +1 -0
  305. package/dist/prosemirror/index.d.mts +70 -0
  306. package/dist/prosemirror/index.d.ts +70 -0
  307. package/dist/prosemirror/index.js +1 -0
  308. package/dist/prosemirror/index.mjs +1 -0
  309. package/dist/prosemirror/plugins/index.d.mts +154 -0
  310. package/dist/prosemirror/plugins/index.d.ts +154 -0
  311. package/dist/prosemirror/plugins/index.js +1 -0
  312. package/dist/prosemirror/plugins/index.mjs +1 -0
  313. package/dist/prosemirror/plugins/selectionTracker.d.mts +78 -0
  314. package/dist/prosemirror/plugins/selectionTracker.d.ts +78 -0
  315. package/dist/prosemirror/plugins/selectionTracker.js +1 -0
  316. package/dist/prosemirror/plugins/selectionTracker.mjs +1 -0
  317. package/dist/prosemirror/schema/index.d.mts +29 -0
  318. package/dist/prosemirror/schema/index.d.ts +29 -0
  319. package/dist/prosemirror/schema/index.js +1 -0
  320. package/dist/prosemirror/schema/index.mjs +1 -0
  321. package/dist/prosemirror/styles/index.d.mts +124 -0
  322. package/dist/prosemirror/styles/index.d.ts +124 -0
  323. package/dist/prosemirror/styles/index.js +1 -0
  324. package/dist/prosemirror/styles/index.mjs +1 -0
  325. package/dist/prosemirror/template/prosemirror-plugin.d.mts +66 -0
  326. package/dist/prosemirror/template/prosemirror-plugin.d.ts +66 -0
  327. package/dist/prosemirror/template/prosemirror-plugin.js +15 -0
  328. package/dist/prosemirror/template/prosemirror-plugin.mjs +15 -0
  329. package/dist/prosemirror/utils/ClickPositionResolver.d.mts +109 -0
  330. package/dist/prosemirror/utils/ClickPositionResolver.d.ts +109 -0
  331. package/dist/prosemirror/utils/ClickPositionResolver.js +1 -0
  332. package/dist/prosemirror/utils/ClickPositionResolver.mjs +1 -0
  333. package/dist/prosemirror/utils/LayoutSelectionGate.d.mts +81 -0
  334. package/dist/prosemirror/utils/LayoutSelectionGate.d.ts +81 -0
  335. package/dist/prosemirror/utils/LayoutSelectionGate.js +1 -0
  336. package/dist/prosemirror/utils/LayoutSelectionGate.mjs +1 -0
  337. package/dist/prosemirror/utils/PointerEventHandler.d.mts +94 -0
  338. package/dist/prosemirror/utils/PointerEventHandler.d.ts +94 -0
  339. package/dist/prosemirror/utils/PointerEventHandler.js +1 -0
  340. package/dist/prosemirror/utils/PointerEventHandler.mjs +1 -0
  341. package/dist/prosemirror/utils/extractTrackedChanges.d.mts +85 -0
  342. package/dist/prosemirror/utils/extractTrackedChanges.d.ts +85 -0
  343. package/dist/prosemirror/utils/extractTrackedChanges.js +1 -0
  344. package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -0
  345. package/dist/prosemirror/utils/visualLineNavigation.d.mts +45 -0
  346. package/dist/prosemirror/utils/visualLineNavigation.d.ts +45 -0
  347. package/dist/prosemirror/utils/visualLineNavigation.js +1 -0
  348. package/dist/prosemirror/utils/visualLineNavigation.mjs +1 -0
  349. package/dist/registry-Cpyybgij.d.mts +165 -0
  350. package/dist/registry-E5pahPKL.d.ts +165 -0
  351. package/dist/selectionContext-BPAqgNgk.d.ts +570 -0
  352. package/dist/selectionContext-CoZat7QZ.d.mts +570 -0
  353. package/dist/selectiveSave-CWaPEv0B.d.ts +31 -0
  354. package/dist/selectiveSave-jinP_4xa.d.mts +31 -0
  355. package/dist/selectiveXmlPatch-ypkxlTD_.d.mts +23 -0
  356. package/dist/selectiveXmlPatch-ypkxlTD_.d.ts +23 -0
  357. package/dist/styles-BBv7doYK.d.ts +233 -0
  358. package/dist/styles-EI2lxeEN.d.mts +233 -0
  359. package/dist/table-P8esKWAc.d.ts +82 -0
  360. package/dist/table-_t_W8oQf.d.mts +82 -0
  361. package/dist/types/agentApi.d.mts +467 -0
  362. package/dist/types/agentApi.d.ts +467 -0
  363. package/dist/types/agentApi.js +1 -0
  364. package/dist/types/agentApi.mjs +1 -0
  365. package/dist/types/content.d.mts +18 -0
  366. package/dist/types/content.d.ts +18 -0
  367. package/dist/types/content.js +1 -0
  368. package/dist/types/content.mjs +0 -0
  369. package/dist/types/document.d.mts +123 -0
  370. package/dist/types/document.d.ts +123 -0
  371. package/dist/types/document.js +1 -0
  372. package/dist/types/document.mjs +0 -0
  373. package/dist/types-DXG7vqe9.d.ts +311 -0
  374. package/dist/types-RchZmPFN.d.mts +137 -0
  375. package/dist/types-RchZmPFN.d.ts +137 -0
  376. package/dist/types-dYdjUZMo.d.mts +311 -0
  377. package/dist/utils/cardStyles.d.mts +31 -0
  378. package/dist/utils/cardStyles.d.ts +31 -0
  379. package/dist/utils/cardStyles.js +1 -0
  380. package/dist/utils/cardStyles.mjs +1 -0
  381. package/dist/utils/comments.d.mts +121 -0
  382. package/dist/utils/comments.d.ts +121 -0
  383. package/dist/utils/comments.js +1 -0
  384. package/dist/utils/comments.mjs +1 -0
  385. package/dist/utils/findReplace.d.mts +114 -0
  386. package/dist/utils/findReplace.d.ts +114 -0
  387. package/dist/utils/findReplace.js +2 -0
  388. package/dist/utils/findReplace.mjs +2 -0
  389. package/dist/utils/findVerticalScrollParent.d.mts +25 -0
  390. package/dist/utils/findVerticalScrollParent.d.ts +25 -0
  391. package/dist/utils/findVerticalScrollParent.js +1 -0
  392. package/dist/utils/findVerticalScrollParent.mjs +1 -0
  393. package/dist/utils/fontOptions.d.mts +21 -0
  394. package/dist/utils/fontOptions.d.ts +21 -0
  395. package/dist/utils/fontOptions.js +1 -0
  396. package/dist/utils/fontOptions.mjs +1 -0
  397. package/dist/utils/headingCollector.d.mts +32 -0
  398. package/dist/utils/headingCollector.d.ts +32 -0
  399. package/dist/utils/headingCollector.js +1 -0
  400. package/dist/utils/headingCollector.mjs +1 -0
  401. package/dist/utils/highlightColors.d.mts +14 -0
  402. package/dist/utils/highlightColors.d.ts +14 -0
  403. package/dist/utils/highlightColors.js +1 -0
  404. package/dist/utils/highlightColors.mjs +1 -0
  405. package/dist/utils/index.d.mts +710 -0
  406. package/dist/utils/index.d.ts +710 -0
  407. package/dist/utils/index.js +82 -0
  408. package/dist/utils/index.mjs +82 -0
  409. package/dist/utils/listState.d.mts +27 -0
  410. package/dist/utils/listState.d.ts +27 -0
  411. package/dist/utils/listState.js +1 -0
  412. package/dist/utils/listState.mjs +1 -0
  413. package/dist/utils/reportIssue.d.mts +23 -0
  414. package/dist/utils/reportIssue.d.ts +23 -0
  415. package/dist/utils/reportIssue.js +2 -0
  416. package/dist/utils/reportIssue.mjs +2 -0
  417. package/dist/utils/sidebarConstants.d.mts +10 -0
  418. package/dist/utils/sidebarConstants.d.ts +10 -0
  419. package/dist/utils/sidebarConstants.js +1 -0
  420. package/dist/utils/sidebarConstants.mjs +1 -0
  421. package/dist/utils/textSelection.d.mts +92 -0
  422. package/dist/utils/textSelection.d.ts +92 -0
  423. package/dist/utils/textSelection.js +1 -0
  424. package/dist/utils/textSelection.mjs +1 -0
  425. package/dist/utils/units.d.mts +91 -0
  426. package/dist/utils/units.d.ts +91 -0
  427. package/dist/utils/units.js +1 -0
  428. package/dist/utils/units.mjs +1 -0
  429. package/dist/variableDetector-DF3-nxUC.d.mts +115 -0
  430. package/dist/variableDetector-sBkgVh3f.d.ts +115 -0
  431. package/package.json +565 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 EigenPal Inc.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,89 @@
1
+ <p align="center">
2
+ <a href="https://www.docx-editor.dev/">
3
+ <img src="https://raw.githubusercontent.com/eigenpal/docx-editor/main/.github/assets/header.png" alt="DOCX Editor — .docx in, .docx out. Open source, agent ready, client-side." width="500" />
4
+ </a>
5
+ </p>
6
+
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/@eigenpal/docx-editor-core"><img src="https://img.shields.io/npm/v/@eigenpal/docx-editor-core.svg?style=flat-square&color=3B5BDB" alt="npm version" /></a>
9
+ <a href="https://www.npmjs.com/package/@eigenpal/docx-editor-core"><img src="https://img.shields.io/npm/dm/@eigenpal/docx-editor-core.svg?style=flat-square&color=3B5BDB" alt="npm downloads" /></a>
10
+ <a href="https://github.com/eigenpal/docx-editor/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache_2.0-blue.svg?style=flat-square&color=3B5BDB" alt="license" /></a>
11
+ <a href="https://docx-editor.dev/editor"><img src="https://img.shields.io/badge/Live_Demo-3B5BDB?style=flat-square&logo=vercel&logoColor=white" alt="Demo" /></a>
12
+ <a href="https://www.docx-editor.dev/docs"><img src="https://img.shields.io/badge/Docs-3B5BDB?style=flat-square&logo=readthedocs&logoColor=white" alt="Documentation" /></a>
13
+ </p>
14
+
15
+ # @eigenpal/docx-editor-core
16
+
17
+ Framework-agnostic core for the [docx-editor](https://docx-editor.dev). Parses DOCX, builds the document model, runs ProseMirror, and renders Word-fidelity pages. Powers the React and Vue adapters and anything else you build on top.
18
+
19
+ ## Quick Start
20
+
21
+ Most users want the [React](https://www.npmjs.com/package/@eigenpal/docx-editor-react) or [Vue](https://www.npmjs.com/package/@eigenpal/docx-editor-vue) adapter. Reach for core directly when building a custom adapter, running headless on the server, or driving DOCX parsing/serialization without a UI.
22
+
23
+ ```bash
24
+ npm install @eigenpal/docx-editor-core
25
+ ```
26
+
27
+ ```ts
28
+ import { readFile } from 'node:fs/promises';
29
+ import { parseDocx } from '@eigenpal/docx-editor-core/docx';
30
+
31
+ const buffer = await readFile('contract.docx');
32
+ const document = await parseDocx(buffer);
33
+ console.log(document.paragraphs.length);
34
+ ```
35
+
36
+ Each subpath tree-shakes independently. Pick the smallest entry point that gives you what you need.
37
+
38
+ ## Packages
39
+
40
+ | Package | Description |
41
+ | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
42
+ | [`@eigenpal/docx-editor-react`](https://www.npmjs.com/package/@eigenpal/docx-editor-react) | <img src="https://cdn.simpleicons.org/react/61DAFB" width="20" align="middle" /> &nbsp; React adapter. Toolbar, paged editor, plugins. |
43
+ | [`@eigenpal/docx-editor-vue`](https://www.npmjs.com/package/@eigenpal/docx-editor-vue) | <img src="https://cdn.simpleicons.org/vuedotjs/4FC08D" width="20" align="middle" /> &nbsp; Vue 3 adapter. Toolbar, paged editor, plugins. |
44
+ | [`@eigenpal/docx-editor-core`](https://www.npmjs.com/package/@eigenpal/docx-editor-core) | Framework-agnostic core: OOXML parser, serializer, layout engine, ProseMirror schema. Depend on this if you fork the React or Vue adapter. |
45
+ | [`@eigenpal/docx-editor-i18n`](https://www.npmjs.com/package/@eigenpal/docx-editor-i18n) | Shared locale strings and types consumed by both adapters. |
46
+ | [`@eigenpal/docx-editor-agents`](https://www.npmjs.com/package/@eigenpal/docx-editor-agents) | Agent SDK and chat UI: framework-agnostic bridge, MCP server, AI SDK adapters, plus React UI. |
47
+
48
+ > **Forking the adapter?** Keep your fork thin. Depend on `@eigenpal/docx-editor-core` directly so parser, serializer, and rendering fixes land in your build automatically, without backporting each upstream change by hand.
49
+
50
+ ## Subpath map
51
+
52
+ | Building... | Import from | What you get |
53
+ | --------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
54
+ | A new framework adapter | `./docx`, `./prosemirror/conversion`, `./prosemirror/extensions` | `parseDocx`, `toProseDoc` / `fromProseDoc`, `createStarterKit`, `ExtensionManager` |
55
+ | Custom layout / rendering | `./layout-engine`, `./layout-bridge`, `./layout-painter` | `layoutDocument`, `mouseToPosition`, `renderPage`, `LayoutPainter` |
56
+ | Editor commands and plugins | `./prosemirror/commands`, `./prosemirror/plugins` | Formatting, tables, suggestion mode, selection tracker |
57
+ | Saving back to `.docx` | `./docx` | `repackDocx`, `attemptSelectiveSave` |
58
+ | Headless agents (no UI) | `./agent` | `DocumentAgent`, `executeCommand`, `AgentCommand` types |
59
+ | An MCP server | `./mcp` | Model Context Protocol server scaffolding |
60
+ | Just unit/color/clipboard helpers | `./utils` | `twipsToPixels`, `resolveColor`, font loading, clipboard, selection helpers |
61
+ | Just a type | `./types/document`, `./types/content`, `./types/agentApi` | `Document`, `Paragraph`, `Comment`, `AgentCommand`, ... |
62
+ | Default editor stylesheet | `./prosemirror/editor.css` | Import once at the top of your app |
63
+
64
+ ## Stability
65
+
66
+ `./layout-engine`, `./layout-painter`, `./layout-bridge`, and `./plugin-api` are **`@experimental`** — used by the first-party adapters but the API may change in minor releases until a third-party adapter validates it. Pin a version range. Everything else follows SemVer.
67
+
68
+ ## Peer dependencies
69
+
70
+ ProseMirror packages are declared as `peerDependencies` so consumer bundles don't ship duplicates:
71
+
72
+ ```bash
73
+ npm i prosemirror-commands prosemirror-dropcursor prosemirror-history \
74
+ prosemirror-keymap prosemirror-model prosemirror-state \
75
+ prosemirror-tables prosemirror-transform prosemirror-view
76
+ ```
77
+
78
+ ## Architecture
79
+
80
+ Dual-rendering: a hidden ProseMirror instance owns editing state (selection, undo/redo, commands) while `layout-painter` produces the visible pages. Full breakdown: **[docx-editor.dev/docs/architecture](https://www.docx-editor.dev/docs/architecture)**.
81
+
82
+ ## Contributing
83
+
84
+ Contributions welcome. See [CONTRIBUTING.md](https://github.com/eigenpal/docx-editor/blob/main/CONTRIBUTING.md) for setup, tests, and the one-time CLA signature.
85
+
86
+ ## Commercial Support
87
+
88
+ > [!TIP]
89
+ > Questions or custom features? Email **[docx-editor@eigenpal.com](mailto:docx-editor@eigenpal.com)**.
@@ -0,0 +1,38 @@
1
+ import { WrapType } from './docx/wrapTypes.mjs';
2
+
3
+ /**
4
+ * Anchored wrap-type targets — the OOXML wrap types except `inline`.
5
+ */
6
+ type AnchorWrapType = Exclude<WrapType, 'inline'>;
7
+ /**
8
+ * User-facing layout choices that mirror Word's Wrap Text menu. These are
9
+ * directional shortcuts that fold (`wrapType`, `cssFloat`) into a single
10
+ * picker option:
11
+ *
12
+ * - `squareLeft` — image floats left, text wraps on the right
13
+ * - `squareRight` — image floats right, text wraps on the left
14
+ * - `inline` — image flows in the line as a glyph
15
+ * - the other targets are 1:1 with their OOXML wrap types
16
+ *
17
+ * `setImageWrapType` accepts both raw OOXML targets (square / tight / through
18
+ * / topAndBottom / behind / inFront / inline) and the directional convenience
19
+ * targets.
20
+ */
21
+ type ImageLayoutTarget = AnchorWrapType | 'squareLeft' | 'squareRight' | 'inline';
22
+ /**
23
+ * Optional context for `setImageWrapType` transitions:
24
+ *
25
+ * - `initialPositionEmu`: when promoting an inline image to an anchor, the
26
+ * caller passes the inline image's current rendered position relative to
27
+ * the column origin in EMUs. The command stores this as the anchor's
28
+ * `wp:positionH` / `wp:positionV` so Word renders the new float exactly
29
+ * where the inline image used to sit (Word's own behavior).
30
+ */
31
+ interface SetImageWrapTypeOptions {
32
+ initialPositionEmu?: {
33
+ horizontalEmu: number;
34
+ verticalEmu: number;
35
+ };
36
+ }
37
+
38
+ export type { AnchorWrapType as A, ImageLayoutTarget as I, SetImageWrapTypeOptions as S };
@@ -0,0 +1,38 @@
1
+ import { WrapType } from './docx/wrapTypes.js';
2
+
3
+ /**
4
+ * Anchored wrap-type targets — the OOXML wrap types except `inline`.
5
+ */
6
+ type AnchorWrapType = Exclude<WrapType, 'inline'>;
7
+ /**
8
+ * User-facing layout choices that mirror Word's Wrap Text menu. These are
9
+ * directional shortcuts that fold (`wrapType`, `cssFloat`) into a single
10
+ * picker option:
11
+ *
12
+ * - `squareLeft` — image floats left, text wraps on the right
13
+ * - `squareRight` — image floats right, text wraps on the left
14
+ * - `inline` — image flows in the line as a glyph
15
+ * - the other targets are 1:1 with their OOXML wrap types
16
+ *
17
+ * `setImageWrapType` accepts both raw OOXML targets (square / tight / through
18
+ * / topAndBottom / behind / inFront / inline) and the directional convenience
19
+ * targets.
20
+ */
21
+ type ImageLayoutTarget = AnchorWrapType | 'squareLeft' | 'squareRight' | 'inline';
22
+ /**
23
+ * Optional context for `setImageWrapType` transitions:
24
+ *
25
+ * - `initialPositionEmu`: when promoting an inline image to an anchor, the
26
+ * caller passes the inline image's current rendered position relative to
27
+ * the column origin in EMUs. The command stores this as the anchor's
28
+ * `wp:positionH` / `wp:positionV` so Word renders the new float exactly
29
+ * where the inline image used to sit (Word's own behavior).
30
+ */
31
+ interface SetImageWrapTypeOptions {
32
+ initialPositionEmu?: {
33
+ horizontalEmu: number;
34
+ verticalEmu: number;
35
+ };
36
+ }
37
+
38
+ export type { AnchorWrapType as A, ImageLayoutTarget as I, SetImageWrapTypeOptions as S };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Subscribable Base Class
3
+ *
4
+ * Framework-agnostic base for manager classes that need to notify
5
+ * UI frameworks of state changes.
6
+ *
7
+ * Compatible with:
8
+ * - React: useSyncExternalStore(manager.subscribe, manager.getSnapshot)
9
+ * - Vue: watchEffect(() => { manager.subscribe(triggerRef) })
10
+ */
11
+ declare abstract class Subscribable<TSnapshot> {
12
+ private listeners;
13
+ private snapshot;
14
+ constructor(initialSnapshot: TSnapshot);
15
+ /**
16
+ * Subscribe to state changes. Returns an unsubscribe function.
17
+ * Bound method — safe to pass as `useSyncExternalStore(manager.subscribe, ...)`.
18
+ */
19
+ subscribe: (listener: () => void) => (() => void);
20
+ /**
21
+ * Get the current snapshot. Returns a stable reference unless state has changed.
22
+ * Bound method — safe to pass as `useSyncExternalStore(..., manager.getSnapshot)`.
23
+ */
24
+ getSnapshot: () => TSnapshot;
25
+ /**
26
+ * Update the snapshot and notify all subscribers.
27
+ * Subclasses should call this whenever their state changes.
28
+ */
29
+ protected setSnapshot(snapshot: TSnapshot): void;
30
+ private notify;
31
+ }
32
+
33
+ export { Subscribable as S };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Subscribable Base Class
3
+ *
4
+ * Framework-agnostic base for manager classes that need to notify
5
+ * UI frameworks of state changes.
6
+ *
7
+ * Compatible with:
8
+ * - React: useSyncExternalStore(manager.subscribe, manager.getSnapshot)
9
+ * - Vue: watchEffect(() => { manager.subscribe(triggerRef) })
10
+ */
11
+ declare abstract class Subscribable<TSnapshot> {
12
+ private listeners;
13
+ private snapshot;
14
+ constructor(initialSnapshot: TSnapshot);
15
+ /**
16
+ * Subscribe to state changes. Returns an unsubscribe function.
17
+ * Bound method — safe to pass as `useSyncExternalStore(manager.subscribe, ...)`.
18
+ */
19
+ subscribe: (listener: () => void) => (() => void);
20
+ /**
21
+ * Get the current snapshot. Returns a stable reference unless state has changed.
22
+ * Bound method — safe to pass as `useSyncExternalStore(..., manager.getSnapshot)`.
23
+ */
24
+ getSnapshot: () => TSnapshot;
25
+ /**
26
+ * Update the snapshot and notify all subscribers.
27
+ * Subclasses should call this whenever their state changes.
28
+ */
29
+ protected setSnapshot(snapshot: TSnapshot): void;
30
+ private notify;
31
+ }
32
+
33
+ export { Subscribable as S };
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Document Agent
3
+ *
4
+ * Headless, framework-agnostic API for inspecting and editing the
5
+ * Document model. Used by `@zeke-02/docx-editor-agents` and any
6
+ * adapter that wants agent capabilities without UI.
7
+ * @packageDocumentation
8
+ * @public
9
+ */
10
+ export { A as AgentContextOptions, S as ContextSelectionOptions, D as DocumentAgent, E as ExtendedSelectionContext, F as FormattedTextSegment, a as FormattingSummary, I as InsertHyperlinkOptions, b as InsertImageOptions, c as InsertTableOptions, d as InsertTextOptions, e as SelectionContextOptions, f as buildExtendedSelectionContext, g as buildSelectionContext, h as buildSelectionContextFromContext, i as createAgent, j as createAgentFromDocument, k as executeCommand, l as executeCommands, m as getAgentContext, n as getDocumentSummary, o as getSelectionFormattingSummary } from '../selectionContext-CoZat7QZ.mjs';
11
+ import { T as TextFormatting } from '../formatting-BH4hcZiq.mjs';
12
+ import { c as DocumentBody, P as Paragraph, H as Hyperlink, R as Run, T as Table } from '../content-5Mrz6w_b.mjs';
13
+ import { Position } from '../types/agentApi.mjs';
14
+ export { AIAction, AIActionRequest, AgentCommand, AgentContext, AgentResponse, SelectionContext as AgentSelectionContext, ApplyStyleCommand, ApplyVariablesCommand, DEFAULT_AI_ACTIONS, DeleteTextCommand, FormatParagraphCommand, FormatTextCommand, InsertHyperlinkCommand, InsertImageCommand, InsertParagraphBreakCommand, InsertTableCommand, InsertTextCommand, MergeParagraphsCommand, ParagraphContext, ParagraphOutline, Range, RemoveHyperlinkCommand, ReplaceTextCommand, SectionInfo, SetVariableCommand, SplitParagraphCommand, StyleInfo, SuggestedAction, comparePositions, createCollapsedRange, createCommand, createRange, getActionDescription, getActionLabel, isPositionInRange } from '../types/agentApi.mjs';
15
+ import '../types/document.mjs';
16
+ import '../colors-C3vA7HUU.mjs';
17
+ import '../styles-EI2lxeEN.mjs';
18
+ import '../docx/wrapTypes.mjs';
19
+ import '../selectiveSave-jinP_4xa.mjs';
20
+ import '../docxInput-DTbCa48g.mjs';
21
+
22
+ /**
23
+ * Shared Text Utilities for Agent Module
24
+ *
25
+ * Common text extraction and manipulation utilities used by
26
+ * context.ts, selectionContext.ts, and other agent-related code.
27
+ *
28
+ * Consolidates duplicated helper functions into a single location.
29
+ */
30
+
31
+ /**
32
+ * Get plain text from a paragraph
33
+ */
34
+ declare function getParagraphText(paragraph: Paragraph): string;
35
+ /**
36
+ * Get plain text from a run
37
+ */
38
+ declare function getRunText(run: Run): string;
39
+ /**
40
+ * Get plain text from a hyperlink
41
+ */
42
+ declare function getHyperlinkText(hyperlink: Hyperlink): string;
43
+ /**
44
+ * Get plain text from a table
45
+ */
46
+ declare function getTableText(table: Table): string;
47
+ /**
48
+ * Get plain text from document body
49
+ */
50
+ declare function getBodyText(body: DocumentBody): string;
51
+ /**
52
+ * Count words in text
53
+ */
54
+ declare function countWords(text: string): number;
55
+ /**
56
+ * Count characters in text
57
+ */
58
+ declare function countCharacters(text: string, includeSpaces?: boolean): number;
59
+ /**
60
+ * Get word count from document body
61
+ */
62
+ declare function getBodyWordCount(body: DocumentBody): number;
63
+ /**
64
+ * Get character count from document body
65
+ */
66
+ declare function getBodyCharacterCount(body: DocumentBody): number;
67
+ /**
68
+ * Get text before a position
69
+ *
70
+ * @param paragraphs - Array of paragraphs
71
+ * @param position - Position to get text before
72
+ * @param maxChars - Maximum characters to return
73
+ * @returns Text before the position
74
+ */
75
+ declare function getTextBefore(paragraphs: Paragraph[], position: Position, maxChars: number): string;
76
+ /**
77
+ * Get text after a position
78
+ *
79
+ * @param paragraphs - Array of paragraphs
80
+ * @param position - Position to get text after
81
+ * @param maxChars - Maximum characters to return
82
+ * @returns Text after the position
83
+ */
84
+ declare function getTextAfter(paragraphs: Paragraph[], position: Position, maxChars: number): string;
85
+ /**
86
+ * Get formatting at a specific position in a paragraph
87
+ *
88
+ * @param paragraph - The paragraph to check
89
+ * @param offset - Character offset in the paragraph
90
+ * @returns Formatting at that position
91
+ */
92
+ declare function getFormattingAtPosition(paragraph: Paragraph, offset: number): Partial<TextFormatting>;
93
+ /**
94
+ * Check if position is within a hyperlink
95
+ *
96
+ * @param paragraph - The paragraph to check
97
+ * @param offset - Character offset in the paragraph
98
+ * @returns True if position is in a hyperlink
99
+ */
100
+ declare function isPositionInHyperlink(paragraph: Paragraph, offset: number): boolean;
101
+ /**
102
+ * Get hyperlink at position
103
+ *
104
+ * @param paragraph - The paragraph to check
105
+ * @param offset - Character offset in the paragraph
106
+ * @returns The hyperlink at that position, or undefined
107
+ */
108
+ declare function getHyperlinkAtPosition(paragraph: Paragraph, offset: number): Hyperlink | undefined;
109
+ /**
110
+ * Check if style ID represents a heading
111
+ *
112
+ * @param styleId - Style ID to check
113
+ * @returns True if it's a heading style
114
+ */
115
+ declare function isHeadingStyle(styleId?: string): boolean;
116
+ /**
117
+ * Parse heading level from style ID
118
+ *
119
+ * @param styleId - Style ID to parse
120
+ * @returns Heading level (1-9) or undefined
121
+ */
122
+ declare function parseHeadingLevel(styleId?: string): number | undefined;
123
+ /**
124
+ * Check if document body has images
125
+ *
126
+ * @param body - Document body to check
127
+ * @returns True if contains images
128
+ */
129
+ declare function hasImages(body: DocumentBody): boolean;
130
+ /**
131
+ * Check if document body has hyperlinks
132
+ *
133
+ * @param body - Document body to check
134
+ * @returns True if contains hyperlinks
135
+ */
136
+ declare function hasHyperlinks(body: DocumentBody): boolean;
137
+ /**
138
+ * Check if document body has tables
139
+ *
140
+ * @param body - Document body to check
141
+ * @returns True if contains tables
142
+ */
143
+ declare function hasTables(body: DocumentBody): boolean;
144
+ /**
145
+ * Get all paragraphs from document body
146
+ *
147
+ * @param body - Document body
148
+ * @returns Array of paragraphs
149
+ */
150
+ declare function getParagraphs(body: DocumentBody): Paragraph[];
151
+ /**
152
+ * Get paragraph at index from document body
153
+ *
154
+ * @param body - Document body
155
+ * @param index - Paragraph index (0-indexed)
156
+ * @returns Paragraph or undefined
157
+ */
158
+ declare function getParagraphAtIndex(body: DocumentBody, index: number): Paragraph | undefined;
159
+ /**
160
+ * Get block index for a paragraph index
161
+ *
162
+ * @param body - Document body
163
+ * @param paragraphIndex - Paragraph index
164
+ * @returns Block index or -1 if not found
165
+ */
166
+ declare function getBlockIndexForParagraph(body: DocumentBody, paragraphIndex: number): number;
167
+
168
+ export { Position, countCharacters, countWords, getBlockIndexForParagraph, getBodyCharacterCount, getBodyText, getBodyWordCount, getFormattingAtPosition, getHyperlinkAtPosition, getHyperlinkText, getParagraphAtIndex, getParagraphText, getParagraphs, getRunText, getTableText, getTextAfter, getTextBefore, hasHyperlinks, hasImages, hasTables, isHeadingStyle, isPositionInHyperlink, parseHeadingLevel };