@eigenpal/docx-editor-core 0.0.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 (419) hide show
  1. package/LICENSE +204 -0
  2. package/README.md +54 -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 +169 -0
  8. package/dist/agent/index.d.ts +169 -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-23CP3TOP.js +1 -0
  14. package/dist/chunk-2KHWHVTA.js +1 -0
  15. package/dist/chunk-36VIYQHD.mjs +9 -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-44RUAQA2.js +1 -0
  20. package/dist/chunk-4AJYHCPB.js +2 -0
  21. package/dist/chunk-4BFNWPKW.js +1 -0
  22. package/dist/chunk-4EHBV73E.mjs +59 -0
  23. package/dist/chunk-4G6AJ4ZM.js +1 -0
  24. package/dist/chunk-4GER4JLW.js +1 -0
  25. package/dist/chunk-4Q2IP5FW.js +1 -0
  26. package/dist/chunk-5N5DBQJV.mjs +1 -0
  27. package/dist/chunk-62NPHRTF.js +1 -0
  28. package/dist/chunk-67LVRQIR.mjs +1 -0
  29. package/dist/chunk-6ILFFGGS.js +2 -0
  30. package/dist/chunk-6LOYA7G5.mjs +2 -0
  31. package/dist/chunk-6LVPRTB6.js +1 -0
  32. package/dist/chunk-6NQSIC27.mjs +1 -0
  33. package/dist/chunk-6VUYFDHY.mjs +1 -0
  34. package/dist/chunk-7E5VBRDL.mjs +1 -0
  35. package/dist/chunk-7GHQ4YCJ.mjs +1 -0
  36. package/dist/chunk-7RDCZLTU.js +1 -0
  37. package/dist/chunk-7VCMJCBY.js +2 -0
  38. package/dist/chunk-AAPBAMD7.js +1 -0
  39. package/dist/chunk-AMENZY5F.mjs +1 -0
  40. package/dist/chunk-ARHPXIBJ.mjs +1 -0
  41. package/dist/chunk-BGC7QKP5.mjs +1 -0
  42. package/dist/chunk-BGY3CB37.mjs +1 -0
  43. package/dist/chunk-BHBOAP6Z.js +3 -0
  44. package/dist/chunk-BWHUD2XC.mjs +4 -0
  45. package/dist/chunk-CCWOLPZE.js +3 -0
  46. package/dist/chunk-CGJ6S3AH.mjs +1 -0
  47. package/dist/chunk-CKKO4JWE.mjs +1 -0
  48. package/dist/chunk-CKXAHSJQ.js +10 -0
  49. package/dist/chunk-CP5OSG5Z.mjs +1 -0
  50. package/dist/chunk-CUY2THAO.mjs +1 -0
  51. package/dist/chunk-CWAP26GB.js +4 -0
  52. package/dist/chunk-D4RPOJC7.js +1 -0
  53. package/dist/chunk-D6GO7UGD.mjs +1 -0
  54. package/dist/chunk-DC7S76ZX.js +1 -0
  55. package/dist/chunk-DFZTUQ7O.js +2 -0
  56. package/dist/chunk-DROCYKAR.js +1 -0
  57. package/dist/chunk-DWFWYHM5.mjs +1 -0
  58. package/dist/chunk-DY2MJCSV.js +1 -0
  59. package/dist/chunk-ESI4BSBF.js +1 -0
  60. package/dist/chunk-FC6QL3E6.js +1 -0
  61. package/dist/chunk-FWTP7BN7.mjs +4 -0
  62. package/dist/chunk-G6Y4UZMJ.mjs +1 -0
  63. package/dist/chunk-GGPKPXON.js +1 -0
  64. package/dist/chunk-GXW7YSFL.mjs +1 -0
  65. package/dist/chunk-I6PMX4BO.js +1 -0
  66. package/dist/chunk-IBNUQL57.mjs +2 -0
  67. package/dist/chunk-ILJUDEZ5.mjs +1 -0
  68. package/dist/chunk-IP2VXNWG.js +1 -0
  69. package/dist/chunk-J7ULKGU2.mjs +10 -0
  70. package/dist/chunk-JFZIXFRC.js +1 -0
  71. package/dist/chunk-JHZ3HLSR.mjs +1 -0
  72. package/dist/chunk-JKVXID22.mjs +1 -0
  73. package/dist/chunk-JY5EFI4D.js +1 -0
  74. package/dist/chunk-KBU6QQFU.js +9 -0
  75. package/dist/chunk-KESNGXGO.js +1 -0
  76. package/dist/chunk-KQTB5Y7P.mjs +1 -0
  77. package/dist/chunk-LBKMYD3M.mjs +1 -0
  78. package/dist/chunk-LMF2ELOB.js +1 -0
  79. package/dist/chunk-LVD6HXRF.mjs +2 -0
  80. package/dist/chunk-MJ5FQX7Q.js +1 -0
  81. package/dist/chunk-MOKKS75W.mjs +3 -0
  82. package/dist/chunk-MVZOTKNL.mjs +1 -0
  83. package/dist/chunk-MZ7LW5CH.js +1 -0
  84. package/dist/chunk-MZOVDLYL.js +1 -0
  85. package/dist/chunk-N27FJQTG.js +1 -0
  86. package/dist/chunk-N3Y5BUKV.js +1 -0
  87. package/dist/chunk-NBLJPT54.mjs +1 -0
  88. package/dist/chunk-NERY274X.js +1 -0
  89. package/dist/chunk-NNQWQOC5.mjs +1 -0
  90. package/dist/chunk-NXLJVVVE.js +1 -0
  91. package/dist/chunk-O5X22KZ6.mjs +1 -0
  92. package/dist/chunk-OBMN4VSM.mjs +1 -0
  93. package/dist/chunk-OCAX2KJQ.js +4 -0
  94. package/dist/chunk-OZMNIX6U.mjs +1 -0
  95. package/dist/chunk-PRRM64JO.mjs +1 -0
  96. package/dist/chunk-Q4CKLXWA.js +1 -0
  97. package/dist/chunk-Q5QOBZWT.mjs +1 -0
  98. package/dist/chunk-QPFJJPIC.mjs +1 -0
  99. package/dist/chunk-QYUPLKLP.mjs +1 -0
  100. package/dist/chunk-RNOXNNSD.mjs +0 -0
  101. package/dist/chunk-RPIQG46O.mjs +1 -0
  102. package/dist/chunk-S7IKPRC3.js +9 -0
  103. package/dist/chunk-SUXJX72X.js +1 -0
  104. package/dist/chunk-SYJAAHUK.js +1 -0
  105. package/dist/chunk-T4CPTPRP.js +1 -0
  106. package/dist/chunk-TE2AF7FM.js +1 -0
  107. package/dist/chunk-TE2VQJZG.js +1 -0
  108. package/dist/chunk-TRJWRZZD.js +1 -0
  109. package/dist/chunk-U4UCHBZ7.js +1 -0
  110. package/dist/chunk-UDPROEUK.js +1 -0
  111. package/dist/chunk-UIROUI5I.mjs +1 -0
  112. package/dist/chunk-UOFQYE2L.mjs +1 -0
  113. package/dist/chunk-UQ6WNWXX.js +1 -0
  114. package/dist/chunk-V7BKPX67.mjs +2 -0
  115. package/dist/chunk-VKTCTMIO.mjs +2 -0
  116. package/dist/chunk-VQWZHPWI.mjs +1 -0
  117. package/dist/chunk-VW22RZ6C.mjs +1 -0
  118. package/dist/chunk-WLKRUBY4.js +1 -0
  119. package/dist/chunk-WLQEPVDR.js +1 -0
  120. package/dist/chunk-WNTT4MGC.js +59 -0
  121. package/dist/chunk-WTFLNYAT.mjs +1 -0
  122. package/dist/chunk-XXU7YQVV.js +1 -0
  123. package/dist/chunk-Y5HZAMND.mjs +9 -0
  124. package/dist/chunk-Y74ANBPV.js +1 -0
  125. package/dist/chunk-Y7JZPBBW.js +1 -0
  126. package/dist/chunk-YGHHSCPR.js +2 -0
  127. package/dist/chunk-YMZ3F2FZ.mjs +1 -0
  128. package/dist/chunk-YUKBAAB5.mjs +1 -0
  129. package/dist/chunk-ZRZ2VRQQ.mjs +1 -0
  130. package/dist/chunk-ZYESB4KC.mjs +3 -0
  131. package/dist/colorResolver-C3q7MLLD.d.mts +390 -0
  132. package/dist/colorResolver-CVsPLsw1.d.ts +390 -0
  133. package/dist/colors-C3vA7HUU.d.mts +70 -0
  134. package/dist/colors-C3vA7HUU.d.ts +70 -0
  135. package/dist/core-plugins.d.mts +64 -0
  136. package/dist/core-plugins.d.ts +64 -0
  137. package/dist/core-plugins.js +1 -0
  138. package/dist/core-plugins.mjs +1 -0
  139. package/dist/core.d.mts +399 -0
  140. package/dist/core.d.ts +399 -0
  141. package/dist/core.js +1 -0
  142. package/dist/core.mjs +1 -0
  143. package/dist/documentSerializer-C1ueey5d.d.mts +36 -0
  144. package/dist/documentSerializer-Chn7J1WG.d.ts +36 -0
  145. package/dist/docx/index.d.mts +1124 -0
  146. package/dist/docx/index.d.ts +1124 -0
  147. package/dist/docx/index.js +1 -0
  148. package/dist/docx/index.mjs +1 -0
  149. package/dist/docx/parser.d.mts +109 -0
  150. package/dist/docx/parser.d.ts +109 -0
  151. package/dist/docx/parser.js +1 -0
  152. package/dist/docx/parser.mjs +1 -0
  153. package/dist/docx/rezip.d.mts +313 -0
  154. package/dist/docx/rezip.d.ts +313 -0
  155. package/dist/docx/rezip.js +1 -0
  156. package/dist/docx/rezip.mjs +1 -0
  157. package/dist/docx/serializer/index.d.mts +126 -0
  158. package/dist/docx/serializer/index.d.ts +126 -0
  159. package/dist/docx/serializer/index.js +1 -0
  160. package/dist/docx/serializer/index.mjs +1 -0
  161. package/dist/docx/wrapTypes.d.mts +19 -0
  162. package/dist/docx/wrapTypes.d.ts +19 -0
  163. package/dist/docx/wrapTypes.js +1 -0
  164. package/dist/docx/wrapTypes.mjs +1 -0
  165. package/dist/docxInput-DTbCa48g.d.mts +21 -0
  166. package/dist/docxInput-DTbCa48g.d.ts +21 -0
  167. package/dist/executor-DZAMMQ35.js +1 -0
  168. package/dist/executor-ZCJRLT3Z.mjs +1 -0
  169. package/dist/findParagraphByParaId-Maw_8M5D.d.mts +28 -0
  170. package/dist/findParagraphByParaId-Maw_8M5D.d.ts +28 -0
  171. package/dist/fontLoader-BOt95Jtf.d.mts +223 -0
  172. package/dist/fontLoader-QPwbcX5j.d.ts +223 -0
  173. package/dist/footnotes-lCH_P3N3.d.mts +78 -0
  174. package/dist/footnotes-skVvEHvZ.d.ts +78 -0
  175. package/dist/formatting-BwpZWdGi.d.ts +410 -0
  176. package/dist/formatting-D9I-lFS4.d.mts +410 -0
  177. package/dist/headerFooterLayout-B3QVg556.d.ts +201 -0
  178. package/dist/headerFooterLayout-DkclHZ0Z.d.mts +201 -0
  179. package/dist/headless.d.mts +110 -0
  180. package/dist/headless.d.ts +110 -0
  181. package/dist/headless.js +1 -0
  182. package/dist/headless.mjs +1 -0
  183. package/dist/layout-bridge/clickToPositionDom.d.mts +56 -0
  184. package/dist/layout-bridge/clickToPositionDom.d.ts +56 -0
  185. package/dist/layout-bridge/clickToPositionDom.js +1 -0
  186. package/dist/layout-bridge/clickToPositionDom.mjs +1 -0
  187. package/dist/layout-bridge/index.d.mts +462 -0
  188. package/dist/layout-bridge/index.d.ts +462 -0
  189. package/dist/layout-bridge/index.js +1 -0
  190. package/dist/layout-bridge/index.mjs +1 -0
  191. package/dist/layout-bridge/measuring/index.d.mts +320 -0
  192. package/dist/layout-bridge/measuring/index.d.ts +320 -0
  193. package/dist/layout-bridge/measuring/index.js +1 -0
  194. package/dist/layout-bridge/measuring/index.mjs +1 -0
  195. package/dist/layout-bridge/tableInsertHover.d.mts +45 -0
  196. package/dist/layout-bridge/tableInsertHover.d.ts +45 -0
  197. package/dist/layout-bridge/tableInsertHover.js +1 -0
  198. package/dist/layout-bridge/tableInsertHover.mjs +1 -0
  199. package/dist/layout-bridge/toFlowBlocks.d.mts +122 -0
  200. package/dist/layout-bridge/toFlowBlocks.d.ts +122 -0
  201. package/dist/layout-bridge/toFlowBlocks.js +1 -0
  202. package/dist/layout-bridge/toFlowBlocks.mjs +1 -0
  203. package/dist/layout-engine/index.d.mts +322 -0
  204. package/dist/layout-engine/index.d.ts +322 -0
  205. package/dist/layout-engine/index.js +1 -0
  206. package/dist/layout-engine/index.mjs +1 -0
  207. package/dist/layout-engine/types.d.mts +903 -0
  208. package/dist/layout-engine/types.d.ts +903 -0
  209. package/dist/layout-engine/types.js +1 -0
  210. package/dist/layout-engine/types.mjs +1 -0
  211. package/dist/layout-painter/index.d.mts +23 -0
  212. package/dist/layout-painter/index.d.ts +23 -0
  213. package/dist/layout-painter/index.js +1 -0
  214. package/dist/layout-painter/index.mjs +1 -0
  215. package/dist/layout-painter/renderPage.d.mts +674 -0
  216. package/dist/layout-painter/renderPage.d.ts +674 -0
  217. package/dist/layout-painter/renderPage.js +1 -0
  218. package/dist/layout-painter/renderPage.mjs +1 -0
  219. package/dist/lists-CdiIk_c1.d.ts +142 -0
  220. package/dist/lists-JDB80qyP.d.mts +142 -0
  221. package/dist/managers/AutoSaveManager.d.mts +96 -0
  222. package/dist/managers/AutoSaveManager.d.ts +96 -0
  223. package/dist/managers/AutoSaveManager.js +1 -0
  224. package/dist/managers/AutoSaveManager.mjs +1 -0
  225. package/dist/managers/TableSelectionManager.d.mts +95 -0
  226. package/dist/managers/TableSelectionManager.d.ts +95 -0
  227. package/dist/managers/TableSelectionManager.js +1 -0
  228. package/dist/managers/TableSelectionManager.mjs +1 -0
  229. package/dist/managers/types.d.mts +122 -0
  230. package/dist/managers/types.d.ts +122 -0
  231. package/dist/managers/types.js +1 -0
  232. package/dist/managers/types.mjs +0 -0
  233. package/dist/marks-BujVxYP4.d.ts +56 -0
  234. package/dist/marks-CCPVlQzL.d.mts +56 -0
  235. package/dist/mcp-cli.mjs +137 -0
  236. package/dist/mcp.d.mts +184 -0
  237. package/dist/mcp.d.ts +184 -0
  238. package/dist/mcp.js +16 -0
  239. package/dist/mcp.mjs +16 -0
  240. package/dist/nodes-BXi1Uu3e.d.mts +257 -0
  241. package/dist/nodes-DfKj9kUA.d.ts +257 -0
  242. package/dist/plugin-api/RenderedDomContext.d.mts +74 -0
  243. package/dist/plugin-api/RenderedDomContext.d.ts +74 -0
  244. package/dist/plugin-api/RenderedDomContext.js +1 -0
  245. package/dist/plugin-api/RenderedDomContext.mjs +1 -0
  246. package/dist/plugin-api/index.d.mts +15 -0
  247. package/dist/plugin-api/index.d.ts +15 -0
  248. package/dist/plugin-api/index.js +1 -0
  249. package/dist/plugin-api/index.mjs +0 -0
  250. package/dist/plugin-api/resolveItemPositions.d.mts +54 -0
  251. package/dist/plugin-api/resolveItemPositions.d.ts +54 -0
  252. package/dist/plugin-api/resolveItemPositions.js +1 -0
  253. package/dist/plugin-api/resolveItemPositions.mjs +1 -0
  254. package/dist/plugin-api/types.d.mts +190 -0
  255. package/dist/plugin-api/types.d.ts +190 -0
  256. package/dist/plugin-api/types.js +1 -0
  257. package/dist/plugin-api/types.mjs +0 -0
  258. package/dist/processTemplate-GPFDLQMX.mjs +1 -0
  259. package/dist/processTemplate-HH2E3HBO.js +1 -0
  260. package/dist/prosemirror/commands/formatting.d.mts +100 -0
  261. package/dist/prosemirror/commands/formatting.d.ts +100 -0
  262. package/dist/prosemirror/commands/formatting.js +1 -0
  263. package/dist/prosemirror/commands/formatting.mjs +1 -0
  264. package/dist/prosemirror/commands/index.d.mts +114 -0
  265. package/dist/prosemirror/commands/index.d.ts +114 -0
  266. package/dist/prosemirror/commands/index.js +1 -0
  267. package/dist/prosemirror/commands/index.mjs +1 -0
  268. package/dist/prosemirror/commands/pageBreak.d.mts +20 -0
  269. package/dist/prosemirror/commands/pageBreak.d.ts +20 -0
  270. package/dist/prosemirror/commands/pageBreak.js +1 -0
  271. package/dist/prosemirror/commands/pageBreak.mjs +1 -0
  272. package/dist/prosemirror/commands/paragraph.d.mts +70 -0
  273. package/dist/prosemirror/commands/paragraph.d.ts +70 -0
  274. package/dist/prosemirror/commands/paragraph.js +1 -0
  275. package/dist/prosemirror/commands/paragraph.mjs +1 -0
  276. package/dist/prosemirror/conversion/fromProseDoc.d.mts +66 -0
  277. package/dist/prosemirror/conversion/fromProseDoc.d.ts +66 -0
  278. package/dist/prosemirror/conversion/fromProseDoc.js +1 -0
  279. package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -0
  280. package/dist/prosemirror/conversion/index.d.mts +78 -0
  281. package/dist/prosemirror/conversion/index.d.ts +78 -0
  282. package/dist/prosemirror/conversion/index.js +1 -0
  283. package/dist/prosemirror/conversion/index.mjs +1 -0
  284. package/dist/prosemirror/editor.css +763 -0
  285. package/dist/prosemirror/extensions/index.d.mts +79 -0
  286. package/dist/prosemirror/extensions/index.d.ts +79 -0
  287. package/dist/prosemirror/extensions/index.js +1 -0
  288. package/dist/prosemirror/extensions/index.mjs +1 -0
  289. package/dist/prosemirror/extensions/nodes/TableExtension.d.mts +30 -0
  290. package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +30 -0
  291. package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -0
  292. package/dist/prosemirror/extensions/nodes/TableExtension.mjs +1 -0
  293. package/dist/prosemirror/index.d.mts +71 -0
  294. package/dist/prosemirror/index.d.ts +71 -0
  295. package/dist/prosemirror/index.js +1 -0
  296. package/dist/prosemirror/index.mjs +1 -0
  297. package/dist/prosemirror/plugins/index.d.mts +50 -0
  298. package/dist/prosemirror/plugins/index.d.ts +50 -0
  299. package/dist/prosemirror/plugins/index.js +1 -0
  300. package/dist/prosemirror/plugins/index.mjs +1 -0
  301. package/dist/prosemirror/plugins/selectionTracker.d.mts +78 -0
  302. package/dist/prosemirror/plugins/selectionTracker.d.ts +78 -0
  303. package/dist/prosemirror/plugins/selectionTracker.js +1 -0
  304. package/dist/prosemirror/plugins/selectionTracker.mjs +1 -0
  305. package/dist/prosemirror/schema/index.d.mts +30 -0
  306. package/dist/prosemirror/schema/index.d.ts +30 -0
  307. package/dist/prosemirror/schema/index.js +1 -0
  308. package/dist/prosemirror/schema/index.mjs +1 -0
  309. package/dist/prosemirror/styles/index.d.mts +124 -0
  310. package/dist/prosemirror/styles/index.d.ts +124 -0
  311. package/dist/prosemirror/styles/index.js +1 -0
  312. package/dist/prosemirror/styles/index.mjs +1 -0
  313. package/dist/prosemirror/template/prosemirror-plugin.d.mts +66 -0
  314. package/dist/prosemirror/template/prosemirror-plugin.d.ts +66 -0
  315. package/dist/prosemirror/template/prosemirror-plugin.js +15 -0
  316. package/dist/prosemirror/template/prosemirror-plugin.mjs +15 -0
  317. package/dist/prosemirror/utils/ClickPositionResolver.d.mts +109 -0
  318. package/dist/prosemirror/utils/ClickPositionResolver.d.ts +109 -0
  319. package/dist/prosemirror/utils/ClickPositionResolver.js +1 -0
  320. package/dist/prosemirror/utils/ClickPositionResolver.mjs +1 -0
  321. package/dist/prosemirror/utils/LayoutSelectionGate.d.mts +81 -0
  322. package/dist/prosemirror/utils/LayoutSelectionGate.d.ts +81 -0
  323. package/dist/prosemirror/utils/LayoutSelectionGate.js +1 -0
  324. package/dist/prosemirror/utils/LayoutSelectionGate.mjs +1 -0
  325. package/dist/prosemirror/utils/PointerEventHandler.d.mts +94 -0
  326. package/dist/prosemirror/utils/PointerEventHandler.d.ts +94 -0
  327. package/dist/prosemirror/utils/PointerEventHandler.js +1 -0
  328. package/dist/prosemirror/utils/PointerEventHandler.mjs +1 -0
  329. package/dist/prosemirror/utils/extractTrackedChanges.d.mts +63 -0
  330. package/dist/prosemirror/utils/extractTrackedChanges.d.ts +63 -0
  331. package/dist/prosemirror/utils/extractTrackedChanges.js +1 -0
  332. package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -0
  333. package/dist/prosemirror/utils/visualLineNavigation.d.mts +45 -0
  334. package/dist/prosemirror/utils/visualLineNavigation.d.ts +45 -0
  335. package/dist/prosemirror/utils/visualLineNavigation.js +1 -0
  336. package/dist/prosemirror/utils/visualLineNavigation.mjs +1 -0
  337. package/dist/registry-Cpyybgij.d.mts +165 -0
  338. package/dist/registry-E5pahPKL.d.ts +165 -0
  339. package/dist/selectionContext-85CE0f7a.d.ts +570 -0
  340. package/dist/selectionContext-Xq3AY7pn.d.mts +570 -0
  341. package/dist/selectiveSave-CWaPEv0B.d.ts +31 -0
  342. package/dist/selectiveSave-jinP_4xa.d.mts +31 -0
  343. package/dist/selectiveXmlPatch-ypkxlTD_.d.mts +23 -0
  344. package/dist/selectiveXmlPatch-ypkxlTD_.d.ts +23 -0
  345. package/dist/styles-BBoqh07F.d.mts +233 -0
  346. package/dist/styles-jqO45PSq.d.ts +233 -0
  347. package/dist/table-P8esKWAc.d.ts +82 -0
  348. package/dist/table-_t_W8oQf.d.mts +82 -0
  349. package/dist/types/agentApi.d.mts +467 -0
  350. package/dist/types/agentApi.d.ts +467 -0
  351. package/dist/types/agentApi.js +1 -0
  352. package/dist/types/agentApi.mjs +1 -0
  353. package/dist/types/content.d.mts +1181 -0
  354. package/dist/types/content.d.ts +1181 -0
  355. package/dist/types/content.js +1 -0
  356. package/dist/types/content.mjs +0 -0
  357. package/dist/types/document.d.mts +106 -0
  358. package/dist/types/document.d.ts +106 -0
  359. package/dist/types/document.js +1 -0
  360. package/dist/types/document.mjs +0 -0
  361. package/dist/types-DXG7vqe9.d.ts +311 -0
  362. package/dist/types-RchZmPFN.d.mts +137 -0
  363. package/dist/types-RchZmPFN.d.ts +137 -0
  364. package/dist/types-dYdjUZMo.d.mts +311 -0
  365. package/dist/utils/cardStyles.d.mts +31 -0
  366. package/dist/utils/cardStyles.d.ts +31 -0
  367. package/dist/utils/cardStyles.js +1 -0
  368. package/dist/utils/cardStyles.mjs +1 -0
  369. package/dist/utils/comments.d.mts +48 -0
  370. package/dist/utils/comments.d.ts +48 -0
  371. package/dist/utils/comments.js +1 -0
  372. package/dist/utils/comments.mjs +1 -0
  373. package/dist/utils/findReplace.d.mts +114 -0
  374. package/dist/utils/findReplace.d.ts +114 -0
  375. package/dist/utils/findReplace.js +2 -0
  376. package/dist/utils/findReplace.mjs +2 -0
  377. package/dist/utils/findVerticalScrollParent.d.mts +25 -0
  378. package/dist/utils/findVerticalScrollParent.d.ts +25 -0
  379. package/dist/utils/findVerticalScrollParent.js +1 -0
  380. package/dist/utils/findVerticalScrollParent.mjs +1 -0
  381. package/dist/utils/fontOptions.d.mts +21 -0
  382. package/dist/utils/fontOptions.d.ts +21 -0
  383. package/dist/utils/fontOptions.js +1 -0
  384. package/dist/utils/fontOptions.mjs +1 -0
  385. package/dist/utils/headingCollector.d.mts +32 -0
  386. package/dist/utils/headingCollector.d.ts +32 -0
  387. package/dist/utils/headingCollector.js +1 -0
  388. package/dist/utils/headingCollector.mjs +1 -0
  389. package/dist/utils/highlightColors.d.mts +14 -0
  390. package/dist/utils/highlightColors.d.ts +14 -0
  391. package/dist/utils/highlightColors.js +1 -0
  392. package/dist/utils/highlightColors.mjs +1 -0
  393. package/dist/utils/index.d.mts +711 -0
  394. package/dist/utils/index.d.ts +711 -0
  395. package/dist/utils/index.js +82 -0
  396. package/dist/utils/index.mjs +82 -0
  397. package/dist/utils/listState.d.mts +27 -0
  398. package/dist/utils/listState.d.ts +27 -0
  399. package/dist/utils/listState.js +1 -0
  400. package/dist/utils/listState.mjs +1 -0
  401. package/dist/utils/reportIssue.d.mts +23 -0
  402. package/dist/utils/reportIssue.d.ts +23 -0
  403. package/dist/utils/reportIssue.js +2 -0
  404. package/dist/utils/reportIssue.mjs +2 -0
  405. package/dist/utils/sidebarConstants.d.mts +10 -0
  406. package/dist/utils/sidebarConstants.d.ts +10 -0
  407. package/dist/utils/sidebarConstants.js +1 -0
  408. package/dist/utils/sidebarConstants.mjs +1 -0
  409. package/dist/utils/textSelection.d.mts +92 -0
  410. package/dist/utils/textSelection.d.ts +92 -0
  411. package/dist/utils/textSelection.js +1 -0
  412. package/dist/utils/textSelection.mjs +1 -0
  413. package/dist/utils/units.d.mts +91 -0
  414. package/dist/utils/units.d.ts +91 -0
  415. package/dist/utils/units.js +1 -0
  416. package/dist/utils/units.mjs +1 -0
  417. package/dist/variableDetector-CAdt8yOr.d.mts +115 -0
  418. package/dist/variableDetector-W4XEN9YC.d.ts +115 -0
  419. package/package.json +565 -0
@@ -0,0 +1,711 @@
1
+ /**
2
+ * Editor utilities (curated public surface).
3
+ *
4
+ * The named exports below are the public API contract. Adding a helper
5
+ * to a source module does not automatically make it public — it must
6
+ * be added to this barrel to be reachable from `@eigenpal/docx-editor-core/utils`.
7
+ * @packageDocumentation
8
+ * @public
9
+ */
10
+ export { PIXELS_PER_INCH, TWIPS_PER_INCH, clamp, eighthsToPixels, emuToPixels, emuToTwips, formatPx, halfPointsToPixels, halfPointsToPoints, pixelsToEmu, pixelsToTwips, pointsToHalfPoints, pointsToPixels, roundPixels, twipsToEmu, twipsToPixels } from './units.js';
11
+ export { C as CreateEmptyDocumentOptions, P as ProcessTemplateOptions, a as ProcessTemplateResult, T as TemplateError, z as ThemeMatrixCell, b as blendColors, c as colorsEqual, d as createDocumentWithText, e as createEmptyDocument, f as createRgbColor, g as createTemplateProcessor, h as createThemeColor, i as darkenColor, A as ensureHexPrefix, B as generateThemeTintShadeMatrix, j as getContrastingColor, k as getMissingVariables, l as getTemplateTags, D as getThemeTintShadeHex, m as isBlack, n as isWhite, o as lightenColor, p as parseColorString, q as previewTemplate, r as processTemplate, s as processTemplateAdvanced, F as processTemplateAndDownload, t as processTemplateAsBlob, u as processTemplateDetailed, v as resolveColor, G as resolveColorToHex, w as resolveHighlightColor, E as resolveHighlightToCss, x as resolveShadingColor, y as validateTemplate } from '../colorResolver-CVsPLsw1.js';
12
+ import { Run, Paragraph } from '../types/content.js';
13
+ import { T as Theme } from '../styles-jqO45PSq.js';
14
+ export { D as DocxInput, t as toArrayBuffer } from '../docxInput-DTbCa48g.js';
15
+ export { F as FONT_MAPPING, I as InsertPosition, c as canRenderFont, a as countPageBreaks, b as createColumnBreak, d as createHorizontalRule, e as createLineBreak, f as createPageBreak, g as createPageBreakParagraph, h as createPageBreakRun, z as extractFontsFromDocument, i as findPageBreaks, A as getGoogleFontEquivalent, j as getLoadedFonts, k as hasPageBreakBefore, l as insertHorizontalRule, m as insertPageBreak, n as isBreakContent, o as isColumnBreak, p as isFontLoaded, r as isLineBreak, q as isLoading, s as isPageBreak, B as loadDocumentFonts, t as loadFont, u as loadFontFromBuffer, C as loadFontWithMapping, v as loadFonts, D as loadFontsWithMapping, w as onFontsLoaded, x as preloadCommonFonts, y as removePageBreak } from '../fontLoader-QPwbcX5j.js';
16
+ import { B as BorderSpec, S as ShadingProperties } from '../colors-C3vA7HUU.js';
17
+ import { P as ParagraphFormatting, T as TextFormatting } from '../formatting-BwpZWdGi.js';
18
+ export { HeadingInfo, collectHeadings } from './headingCollector.js';
19
+ export { WordSelectionResult, createDoubleClickWordSelector, createTripleClickParagraphSelector, expandSelectionToWordBoundaries, findWordAt, findWordBoundaries, getWordAt, handleClickForMultiClick, selectParagraphAtCursor, selectWordAtCursor, selectWordInTextNode } from './textSelection.js';
20
+ export { MIN_CARD_GAP, SIDEBAR_DOCUMENT_SHIFT, SIDEBAR_PAGE_GAP, SIDEBAR_WIDTH } from './sidebarConstants.js';
21
+ import '../types/document.js';
22
+ import '../lists-CdiIk_c1.js';
23
+ import '../docx/wrapTypes.js';
24
+ import 'prosemirror-model';
25
+
26
+ /**
27
+ * Clipboard utilities for copy/paste with formatting
28
+ *
29
+ * Handles:
30
+ * - Copy: puts formatted HTML and plain text on clipboard
31
+ * - Paste: reads HTML clipboard, converts to runs with formatting
32
+ * - Handles paste from Word (cleans up Word HTML)
33
+ * - Ctrl+C, Ctrl+V, Ctrl+X keyboard shortcuts
34
+ */
35
+
36
+ /**
37
+ * Clipboard content format
38
+ */
39
+ interface ClipboardContent {
40
+ /** Plain text representation */
41
+ plainText: string;
42
+ /** HTML representation */
43
+ html: string;
44
+ /** Internal format (JSON) for preserving full formatting */
45
+ internal?: string;
46
+ }
47
+ /**
48
+ * Parsed clipboard content
49
+ */
50
+ interface ParsedClipboardContent {
51
+ /** Runs parsed from clipboard */
52
+ runs: Run[];
53
+ /** Whether content came from Word */
54
+ fromWord: boolean;
55
+ /** Whether content came from our editor */
56
+ fromEditor: boolean;
57
+ /** Original plain text */
58
+ plainText: string;
59
+ }
60
+ /**
61
+ * Options for clipboard operations
62
+ */
63
+ interface ClipboardOptions {
64
+ /** Whether to include formatting in copy */
65
+ includeFormatting?: boolean;
66
+ /** Whether to clean Word-specific formatting */
67
+ cleanWordFormatting?: boolean;
68
+ /** Callback for handling errors */
69
+ onError?: (error: Error) => void;
70
+ /** Document theme — required to resolve themed text/shading colors in HTML. */
71
+ theme?: Theme | null;
72
+ }
73
+ /**
74
+ * Custom MIME type for internal clipboard format
75
+ */
76
+ declare const INTERNAL_CLIPBOARD_TYPE = "application/x-docx-editor";
77
+ /**
78
+ * Standard clipboard MIME types
79
+ */
80
+ declare const CLIPBOARD_TYPES: {
81
+ readonly HTML: "text/html";
82
+ readonly PLAIN: "text/plain";
83
+ };
84
+ /**
85
+ * Extract image files from clipboard data (if present).
86
+ */
87
+ declare function getClipboardImageFiles(clipboardData: DataTransfer | null): File[];
88
+ /**
89
+ * Copy runs to clipboard with formatting
90
+ */
91
+ declare function copyRuns(runs: Run[], options?: ClipboardOptions): Promise<boolean>;
92
+ /**
93
+ * Copy paragraphs to clipboard with formatting
94
+ */
95
+ declare function copyParagraphs(paragraphs: Paragraph[], options?: ClipboardOptions): Promise<boolean>;
96
+ /**
97
+ * Convert runs to clipboard content (HTML and plain text).
98
+ *
99
+ * @param theme - Optional document theme. Pass it so themed text color and
100
+ * shading resolve correctly in the HTML payload (matters when pasting into
101
+ * Gmail/Word/etc.). Omit for rgb-only content.
102
+ */
103
+ declare function runsToClipboardContent(runs: Run[], includeFormatting?: boolean, theme?: Theme | null): ClipboardContent;
104
+ /**
105
+ * Convert paragraphs to clipboard content.
106
+ *
107
+ * @param theme - See {@link runsToClipboardContent}.
108
+ */
109
+ declare function paragraphsToClipboardContent(paragraphs: Paragraph[], includeFormatting?: boolean, theme?: Theme | null): ClipboardContent;
110
+ /**
111
+ * Write content to clipboard
112
+ */
113
+ declare function writeToClipboard(content: ClipboardContent): Promise<boolean>;
114
+ /**
115
+ * Read content from clipboard
116
+ */
117
+ declare function readFromClipboard(options?: ClipboardOptions): Promise<ParsedClipboardContent | null>;
118
+ /**
119
+ * Handle paste event
120
+ */
121
+ declare function handlePasteEvent(event: ClipboardEvent, options?: ClipboardOptions): ParsedClipboardContent | null;
122
+ /**
123
+ * Parse HTML from clipboard
124
+ */
125
+ declare function parseClipboardHtml(html: string, plainText: string, cleanWordFormatting?: boolean): ParsedClipboardContent;
126
+ /**
127
+ * Check if HTML is from Microsoft Word
128
+ */
129
+ declare function isWordHtml(html: string): boolean;
130
+ /**
131
+ * Check if HTML is from our editor
132
+ */
133
+ declare function isEditorHtml(html: string): boolean;
134
+ /**
135
+ * Clean Microsoft Word HTML
136
+ */
137
+ declare function cleanWordHtml(html: string): string;
138
+ /**
139
+ * Convert HTML to runs
140
+ */
141
+ declare function htmlToRuns(html: string, plainTextFallback: string): Run[];
142
+ /**
143
+ * Create clipboard keyboard handlers for an editor
144
+ */
145
+ declare function createClipboardHandlers(options: {
146
+ onCopy?: () => {
147
+ runs: Run[];
148
+ } | null;
149
+ onCut?: () => {
150
+ runs: Run[];
151
+ } | null;
152
+ onPaste?: (content: ParsedClipboardContent) => void;
153
+ clipboardOptions?: ClipboardOptions;
154
+ }): {
155
+ handleCopy: (event: ClipboardEvent) => Promise<void>;
156
+ handleCut: (event: ClipboardEvent) => Promise<void>;
157
+ handlePaste: (event: ClipboardEvent) => void;
158
+ handleKeyDown: (event: KeyboardEvent) => Promise<void>;
159
+ };
160
+
161
+ /**
162
+ * Formatting to CSS Converter
163
+ *
164
+ * Converts OOXML formatting objects (TextFormatting, ParagraphFormatting)
165
+ * to React CSSProperties for rendering.
166
+ *
167
+ * Handles ALL formatting properties:
168
+ * - Font: family, size, weight, style
169
+ * - Text: color, background, decoration (underline, strike, double-strike)
170
+ * - Effects: superscript, subscript, small-caps, all-caps
171
+ * - Spacing: letter-spacing
172
+ * - Paragraph: alignment, line-height, margins, padding, borders, background
173
+ */
174
+ /** Framework-agnostic CSS properties type (compatible with React.CSSProperties) */
175
+ type CSSProperties$1 = Record<string, any>;
176
+
177
+ /**
178
+ * Convert TextFormatting to CSS properties for a run/span
179
+ *
180
+ * @param formatting - Text formatting from OOXML
181
+ * @param theme - Theme for resolving colors and fonts
182
+ * @returns React CSSProperties
183
+ */
184
+ declare function textToStyle(formatting: TextFormatting | undefined | null, theme?: Theme | null): CSSProperties$1;
185
+ /**
186
+ * Convert ParagraphFormatting to CSS properties
187
+ *
188
+ * @param formatting - Paragraph formatting from OOXML
189
+ * @param theme - Theme for resolving colors
190
+ * @returns React CSSProperties
191
+ */
192
+ declare function paragraphToStyle(formatting: ParagraphFormatting | undefined | null, theme?: Theme | null): CSSProperties$1;
193
+ /**
194
+ * Convert a BorderSpec to CSS border properties
195
+ *
196
+ * @param border - Border specification
197
+ * @param side - 'Top' | 'Bottom' | 'Left' | 'Right' | '' for all
198
+ * @param theme - Theme for color resolution
199
+ * @returns Partial CSSProperties with border styles
200
+ */
201
+ declare function borderToStyle(border: BorderSpec | undefined | null, side?: 'Top' | 'Bottom' | 'Left' | 'Right' | '', theme?: Theme | null): CSSProperties$1;
202
+ /**
203
+ * Convert ShadingProperties to background color
204
+ *
205
+ * @param shading - Shading properties
206
+ * @param theme - Theme for color resolution
207
+ * @returns CSS color string or empty string
208
+ */
209
+ declare function resolveShadingFill(shading: ShadingProperties | undefined | null, theme?: Theme | null): string;
210
+ /**
211
+ * Merge multiple CSSProperties objects
212
+ *
213
+ * Later objects override earlier ones for conflicting properties.
214
+ *
215
+ * @param styles - Array of CSSProperties objects
216
+ * @returns Merged CSSProperties
217
+ */
218
+ declare function mergeStyles(...styles: (CSSProperties$1 | undefined | null)[]): CSSProperties$1;
219
+ /**
220
+ * Get CSS for a table cell based on formatting
221
+ *
222
+ * @param formatting - Table cell formatting
223
+ * @param theme - Theme for color resolution
224
+ * @returns CSSProperties for the cell
225
+ */
226
+ declare function tableCellToStyle(formatting: {
227
+ verticalAlign?: 'top' | 'center' | 'bottom';
228
+ textDirection?: string;
229
+ shading?: ShadingProperties;
230
+ borders?: {
231
+ top?: BorderSpec;
232
+ bottom?: BorderSpec;
233
+ left?: BorderSpec;
234
+ right?: BorderSpec;
235
+ };
236
+ margins?: {
237
+ top?: {
238
+ value: number;
239
+ type: string;
240
+ };
241
+ bottom?: {
242
+ value: number;
243
+ type: string;
244
+ };
245
+ left?: {
246
+ value: number;
247
+ type: string;
248
+ };
249
+ right?: {
250
+ value: number;
251
+ type: string;
252
+ };
253
+ };
254
+ } | undefined | null, theme?: Theme | null): CSSProperties$1;
255
+ /**
256
+ * Get CSS for page/section container
257
+ *
258
+ * @param sectionProps - Section properties
259
+ * @returns CSSProperties for the page container
260
+ */
261
+ declare function sectionToStyle(sectionProps: {
262
+ pageWidth?: number;
263
+ pageHeight?: number;
264
+ marginTop?: number;
265
+ marginBottom?: number;
266
+ marginLeft?: number;
267
+ marginRight?: number;
268
+ background?: {
269
+ color?: {
270
+ rgb?: string;
271
+ themeColor?: string;
272
+ };
273
+ };
274
+ } | undefined | null, theme?: Theme | null): CSSProperties$1;
275
+
276
+ /**
277
+ * Keyboard Navigation Utilities
278
+ *
279
+ * Provides enhanced keyboard navigation for the editor:
280
+ * - Ctrl+Left/Right: Move by word
281
+ * - Home/End: Move to start/end of line
282
+ * - Ctrl+Home/End: Move to start/end of document
283
+ * - Ctrl+Shift+Left/Right: Select by word
284
+ * - Shift+Home/End: Select to start/end of line
285
+ */
286
+ /**
287
+ * Navigation direction
288
+ */
289
+ type NavigationDirection = 'left' | 'right' | 'up' | 'down';
290
+ /**
291
+ * Navigation unit
292
+ */
293
+ type NavigationUnit = 'character' | 'word' | 'line' | 'paragraph' | 'document';
294
+ /**
295
+ * Keyboard navigation action
296
+ */
297
+ interface NavigationAction {
298
+ /** Direction to navigate */
299
+ direction: NavigationDirection;
300
+ /** Unit of movement */
301
+ unit: NavigationUnit;
302
+ /** Whether to extend selection */
303
+ extend: boolean;
304
+ }
305
+ /**
306
+ * Keyboard shortcut definition
307
+ */
308
+ interface KeyboardShortcut {
309
+ key: string;
310
+ ctrlKey?: boolean;
311
+ metaKey?: boolean;
312
+ shiftKey?: boolean;
313
+ altKey?: boolean;
314
+ }
315
+ /**
316
+ * Check if a character is a word character (letter, digit, or underscore)
317
+ */
318
+ declare function isWordCharacter(char: string): boolean;
319
+ /**
320
+ * Check if a character is whitespace
321
+ */
322
+ declare function isWhitespace(char: string): boolean;
323
+ /**
324
+ * Check if a character is a punctuation character
325
+ */
326
+ declare function isPunctuation(char: string): boolean;
327
+ /**
328
+ * Find the start of the current or previous word
329
+ */
330
+ declare function findWordStart(text: string, position: number): number;
331
+ /**
332
+ * Find the end of the current or next word
333
+ */
334
+ declare function findWordEnd(text: string, position: number): number;
335
+ /**
336
+ * Find the next word start (for Ctrl+Right navigation)
337
+ */
338
+ declare function findNextWordStart(text: string, position: number): number;
339
+ /**
340
+ * Find the previous word start (for Ctrl+Left navigation)
341
+ */
342
+ declare function findPreviousWordStart(text: string, position: number): number;
343
+ /**
344
+ * Find the start of the current line in a text node
345
+ * Uses visual line detection based on bounding rectangles
346
+ */
347
+ declare function findVisualLineStart(container: Node, offset: number): {
348
+ node: Node;
349
+ offset: number;
350
+ } | null;
351
+ /**
352
+ * Find the end of the current line in a text node
353
+ * Uses visual line detection based on bounding rectangles
354
+ */
355
+ declare function findVisualLineEnd(container: Node, offset: number): {
356
+ node: Node;
357
+ offset: number;
358
+ } | null;
359
+ /**
360
+ * Get the current selection info
361
+ */
362
+ declare function getSelectionInfo(): {
363
+ node: Node;
364
+ offset: number;
365
+ anchorNode: Node | null;
366
+ anchorOffset: number;
367
+ focusNode: Node | null;
368
+ focusOffset: number;
369
+ isCollapsed: boolean;
370
+ text: string;
371
+ } | null;
372
+ /**
373
+ * Set the selection to a specific position
374
+ */
375
+ declare function setSelectionPosition(node: Node, offset: number): void;
376
+ /**
377
+ * Extend selection to a specific position
378
+ */
379
+ declare function extendSelectionTo(node: Node, offset: number): void;
380
+ /**
381
+ * Move selection by word in a text node
382
+ */
383
+ declare function moveByWord(direction: 'left' | 'right', extend?: boolean): boolean;
384
+ /**
385
+ * Move to start/end of line
386
+ */
387
+ declare function moveToLineEdge(edge: 'start' | 'end', extend?: boolean): boolean;
388
+ /**
389
+ * Parse a keyboard event into a navigation action
390
+ */
391
+ declare function parseNavigationAction(event: KeyboardEvent): NavigationAction | null;
392
+ /**
393
+ * Handle a keyboard navigation event
394
+ * Returns true if the event was handled
395
+ */
396
+ declare function handleNavigationKey(event: KeyboardEvent, options?: {
397
+ onDocumentStart?: () => void;
398
+ onDocumentEnd?: () => void;
399
+ }): boolean;
400
+ /**
401
+ * Check if an event is a navigation key event
402
+ */
403
+ declare function isNavigationKey(event: KeyboardEvent): boolean;
404
+ /**
405
+ * Expand selection to word boundaries
406
+ * Used for double-click word selection
407
+ */
408
+ declare function expandSelectionToWord(): boolean;
409
+ /**
410
+ * Get the word at the current cursor position
411
+ */
412
+ declare function getWordAtCursor(): string | null;
413
+ /**
414
+ * Check if a keyboard event matches a shortcut definition
415
+ */
416
+ declare function matchesShortcut(event: KeyboardEvent, shortcut: KeyboardShortcut): boolean;
417
+ /**
418
+ * Common navigation shortcuts
419
+ */
420
+ declare const NAVIGATION_SHORTCUTS: {
421
+ readonly wordLeft: KeyboardShortcut;
422
+ readonly wordRight: KeyboardShortcut;
423
+ readonly selectWordLeft: KeyboardShortcut;
424
+ readonly selectWordRight: KeyboardShortcut;
425
+ readonly lineStart: KeyboardShortcut;
426
+ readonly lineEnd: KeyboardShortcut;
427
+ readonly selectToLineStart: KeyboardShortcut;
428
+ readonly selectToLineEnd: KeyboardShortcut;
429
+ readonly documentStart: KeyboardShortcut;
430
+ readonly documentEnd: KeyboardShortcut;
431
+ readonly selectToDocumentStart: KeyboardShortcut;
432
+ readonly selectToDocumentEnd: KeyboardShortcut;
433
+ };
434
+ /**
435
+ * Get a human-readable description of a shortcut
436
+ */
437
+ declare function describeShortcut(shortcut: KeyboardShortcut): string;
438
+ /**
439
+ * Get all navigation shortcuts with descriptions
440
+ */
441
+ declare function getNavigationShortcutDescriptions(): Array<{
442
+ action: string;
443
+ shortcut: string;
444
+ }>;
445
+
446
+ /**
447
+ * Selection Highlight Utilities
448
+ *
449
+ * Provides visual highlighting for text selection across multiple runs.
450
+ * Browsers handle ::selection pseudo-element differently, especially when
451
+ * selection spans multiple elements with different backgrounds or styling.
452
+ *
453
+ * This module provides:
454
+ * - Custom selection highlight rendering
455
+ * - Programmatic selection range marking
456
+ * - Visual feedback for selection across runs
457
+ */
458
+ /** Framework-agnostic CSS properties type (compatible with React.CSSProperties) */
459
+ type CSSProperties = Record<string, any>;
460
+ /**
461
+ * Highlight rectangle representing a selected region
462
+ */
463
+ interface HighlightRect {
464
+ /** Left position in pixels */
465
+ left: number;
466
+ /** Top position in pixels */
467
+ top: number;
468
+ /** Width in pixels */
469
+ width: number;
470
+ /** Height in pixels */
471
+ height: number;
472
+ }
473
+ /**
474
+ * Selection highlight configuration
475
+ */
476
+ interface SelectionHighlightConfig {
477
+ /** Background color for selection */
478
+ backgroundColor: string;
479
+ /** Optional border color for selection */
480
+ borderColor?: string;
481
+ /** Optional border radius */
482
+ borderRadius?: number;
483
+ /** Z-index for overlay */
484
+ zIndex?: number;
485
+ /** Opacity for highlight */
486
+ opacity?: number;
487
+ /** Mix blend mode */
488
+ mixBlendMode?: CSSProperties['mixBlendMode'];
489
+ }
490
+ /**
491
+ * Selection range in document coordinates
492
+ */
493
+ interface SelectionRange {
494
+ /** Start position */
495
+ start: {
496
+ paragraphIndex: number;
497
+ contentIndex: number;
498
+ offset: number;
499
+ };
500
+ /** End position */
501
+ end: {
502
+ paragraphIndex: number;
503
+ contentIndex: number;
504
+ offset: number;
505
+ };
506
+ }
507
+ /**
508
+ * Default selection highlight style (matches Word/Google Docs)
509
+ */
510
+ declare const DEFAULT_SELECTION_STYLE: SelectionHighlightConfig;
511
+ /**
512
+ * High contrast selection style
513
+ */
514
+ declare const HIGH_CONTRAST_SELECTION_STYLE: SelectionHighlightConfig;
515
+ /**
516
+ * Selection highlight CSS custom properties
517
+ */
518
+ declare const SELECTION_CSS_VARS: {
519
+ readonly backgroundColor: "--docx-selection-bg";
520
+ readonly borderColor: "--docx-selection-border";
521
+ readonly textColor: "--docx-selection-text";
522
+ };
523
+ /**
524
+ * Get all selection rectangles from the current DOM selection
525
+ *
526
+ * Uses getClientRects() to get accurate rectangles even when
527
+ * selection spans multiple inline elements.
528
+ */
529
+ declare function getSelectionRects(containerElement?: HTMLElement | null): HighlightRect[];
530
+ /**
531
+ * Merge adjacent or overlapping rectangles
532
+ *
533
+ * This reduces the number of highlight elements needed and creates
534
+ * a cleaner visual appearance.
535
+ */
536
+ declare function mergeAdjacentRects(rects: HighlightRect[], tolerance?: number): HighlightRect[];
537
+ /**
538
+ * Get selection rectangles with merging applied
539
+ */
540
+ declare function getMergedSelectionRects(containerElement?: HTMLElement | null): HighlightRect[];
541
+ /**
542
+ * Generate CSS styles for a highlight rectangle
543
+ */
544
+ declare function getHighlightRectStyle(rect: HighlightRect, config?: SelectionHighlightConfig): CSSProperties;
545
+ /**
546
+ * Generate inline CSS for selection pseudo-elements
547
+ *
548
+ * This is used to inject consistent selection styling
549
+ * across all editable elements.
550
+ */
551
+ declare function generateSelectionCSS(selector: string, config?: SelectionHighlightConfig): string;
552
+ /**
553
+ * Check if there is an active text selection (not collapsed)
554
+ */
555
+ declare function hasActiveSelection(): boolean;
556
+ /**
557
+ * Get the selected text
558
+ */
559
+ declare function getSelectedText(): string;
560
+ /**
561
+ * Check if selection is within a specific element
562
+ */
563
+ declare function isSelectionWithin(element: HTMLElement): boolean;
564
+ /**
565
+ * Get the bounding rect of the current selection
566
+ */
567
+ declare function getSelectionBoundingRect(): DOMRect | null;
568
+ /**
569
+ * Create a selection highlight for a specific text range
570
+ *
571
+ * This is useful for find/replace highlighting, AI action previews, etc.
572
+ */
573
+ declare function highlightTextRange(_containerElement: HTMLElement, startNode: Node, startOffset: number, endNode: Node, endOffset: number): Range | null;
574
+ /**
575
+ * Select a text range programmatically
576
+ */
577
+ declare function selectRange(range: Range): void;
578
+ /**
579
+ * Clear the current selection
580
+ */
581
+ declare function clearSelection(): void;
582
+ /**
583
+ * Check if selection is backwards (focus before anchor)
584
+ */
585
+ declare function isSelectionBackwards(): boolean;
586
+ /**
587
+ * Normalize selection to always be forward (start before end)
588
+ */
589
+ declare function normalizeSelectionDirection(): void;
590
+ /**
591
+ * Inject selection highlight CSS into document
592
+ */
593
+ declare function injectSelectionStyles(config?: SelectionHighlightConfig): void;
594
+ /**
595
+ * Remove injected selection styles
596
+ */
597
+ declare function removeSelectionStyles(): void;
598
+ /**
599
+ * Check if selection styles are injected
600
+ */
601
+ declare function areSelectionStylesInjected(): boolean;
602
+ /**
603
+ * Create a selection change handler that updates highlight rects
604
+ */
605
+ declare function createSelectionChangeHandler(containerElement: HTMLElement | null, onRectsChange: (rects: HighlightRect[]) => void, merge?: boolean): () => void;
606
+
607
+ /**
608
+ * Shared table split algorithm — model-agnostic core logic.
609
+ *
610
+ * This module contains the pure layout computation for splitting a table cell:
611
+ * column width redistribution, neighbor span adjustment, and new-cell placement.
612
+ * Both the ProseMirror path (tableSplit.ts) and the Document-model path
613
+ * (TableToolbar.tsx) delegate to these functions.
614
+ */
615
+ /** A cell's position and span within the logical grid. */
616
+ interface CellAnchor<T> {
617
+ /** Opaque payload — the caller's cell type (PMNode, TableCell, etc.) */
618
+ data: T;
619
+ row: number;
620
+ col: number;
621
+ rowspan: number;
622
+ colspan: number;
623
+ }
624
+ /** Parameters describing the split target. */
625
+ interface SplitTarget {
626
+ row: number;
627
+ col: number;
628
+ rowspan: number;
629
+ colspan: number;
630
+ }
631
+ /** Result of `computeSplitLayout`. */
632
+ interface SplitLayoutResult<T> {
633
+ /** All anchors after the split (neighbors adjusted + new split cells). */
634
+ anchors: CellAnchor<T>[];
635
+ deltaRows: number;
636
+ deltaCols: number;
637
+ newRowCount: number;
638
+ }
639
+ declare function sumColumnWidths(widths: number[], start: number, span: number): number;
640
+ /**
641
+ * Redistribute column widths when splitting a cell's column span.
642
+ *
643
+ * @param existing Current column widths array for the whole table.
644
+ * @param startCol First column of the cell being split.
645
+ * @param currentSpan Current column span of the cell.
646
+ * @param targetSpan Desired column span after split.
647
+ * @returns New column widths array with the split applied.
648
+ */
649
+ declare function redistributeColumnWidths(existing: number[], startCol: number, currentSpan: number, targetSpan: number): number[];
650
+ /**
651
+ * Compute the new anchor layout after splitting a target cell.
652
+ *
653
+ * This is the core algorithm shared between ProseMirror and Document-model
654
+ * paths. It adjusts neighbor spans, shifts positions for inserted rows/cols,
655
+ * and creates placeholder anchors for the new split cells.
656
+ *
657
+ * @param anchors All cell anchors in the current table.
658
+ * @param target The anchor being split.
659
+ * @param rows Number of rows the target should become.
660
+ * @param cols Number of columns the target should become.
661
+ * @param totalRows Current total row count.
662
+ * @param createSplitCellData Factory to create `data` for each new split cell.
663
+ * Called with `(isOriginal, rowOffset, colOffset)` — `isOriginal` is true for
664
+ * the top-left cell that retains the original content.
665
+ */
666
+ declare function computeSplitLayout<T>(anchors: CellAnchor<T>[], target: CellAnchor<T>, rows: number, cols: number, totalRows: number, createSplitCellData: (isOriginal: boolean, rowOffset: number, colOffset: number) => T): SplitLayoutResult<T>;
667
+ /**
668
+ * Build lookup maps from an anchor list — by start position and by covered slot.
669
+ */
670
+ declare function buildAnchorMaps<T>(anchors: CellAnchor<T>[]): {
671
+ byStart: Map<string, CellAnchor<T>>;
672
+ byCoveredSlot: Map<string, CellAnchor<T>>;
673
+ };
674
+ /**
675
+ * Compute the initial dialog values for a split-cell dialog.
676
+ */
677
+ declare function computeSplitDialogDefaults(rowspan: number, colspan: number): {
678
+ minRows: number;
679
+ minCols: number;
680
+ initialRows: number;
681
+ initialCols: number;
682
+ };
683
+
684
+ /**
685
+ * Shared file-input → docx-buffer reader.
686
+ *
687
+ * React (DocxEditor.tsx `handleDocxFileChange`) and Vue
688
+ * (DocxEditor.vue `handleDocxFileChange`) had byte-equivalent
689
+ * `await file.arrayBuffer()` + `name.replace(/\.docx$/i, '')` boilerplate
690
+ * around their hidden file inputs. This helper folds the common steps
691
+ * into one place so the two adapters can never drift on filename
692
+ * normalization or on the "reset input.value so re-picking the same
693
+ * file fires `change` again" detail.
694
+ *
695
+ * Returns `null` when the user cancelled the picker (no file chosen).
696
+ */
697
+ interface ReadDocxFileResult {
698
+ /** ArrayBuffer ready to feed into `loadBuffer` / `parseDocx`. */
699
+ buffer: ArrayBuffer;
700
+ /** File name with the trailing `.docx` extension stripped. */
701
+ name: string;
702
+ }
703
+ /**
704
+ * Read the first selected file out of an `<input type="file">` change
705
+ * event, return its ArrayBuffer + a stem-form name. Always resets
706
+ * `input.value` so re-selecting the same file in the same picker fires
707
+ * the next `change` event.
708
+ */
709
+ declare function readDocxFileFromInput(event: Event): Promise<ReadDocxFileResult | null>;
710
+
711
+ export { CLIPBOARD_TYPES, type CellAnchor, type ClipboardContent, type ClipboardOptions, DEFAULT_SELECTION_STYLE, HIGH_CONTRAST_SELECTION_STYLE, type HighlightRect, INTERNAL_CLIPBOARD_TYPE, type KeyboardShortcut, NAVIGATION_SHORTCUTS, type NavigationAction, type NavigationDirection, type NavigationUnit, type ParsedClipboardContent, type ReadDocxFileResult, SELECTION_CSS_VARS, type SelectionHighlightConfig, type SelectionRange, type SplitLayoutResult, type SplitTarget, areSelectionStylesInjected, borderToStyle, buildAnchorMaps, cleanWordHtml, clearSelection, computeSplitDialogDefaults, computeSplitLayout, copyParagraphs, copyRuns, createClipboardHandlers, createSelectionChangeHandler, describeShortcut, expandSelectionToWord, extendSelectionTo, findNextWordStart, findPreviousWordStart, findVisualLineEnd, findVisualLineStart, findWordEnd, findWordStart, generateSelectionCSS, getClipboardImageFiles, getHighlightRectStyle, getMergedSelectionRects, getNavigationShortcutDescriptions, getSelectedText, getSelectionBoundingRect, getSelectionInfo, getSelectionRects, getWordAtCursor, handleNavigationKey, handlePasteEvent, hasActiveSelection, highlightTextRange, htmlToRuns, injectSelectionStyles, isEditorHtml, isNavigationKey, isPunctuation, isSelectionBackwards, isSelectionWithin, isWhitespace, isWordCharacter, isWordHtml, matchesShortcut, mergeAdjacentRects, mergeStyles, moveByWord, moveToLineEdge, normalizeSelectionDirection, paragraphToStyle, paragraphsToClipboardContent, parseClipboardHtml, parseNavigationAction, readDocxFileFromInput, readFromClipboard, redistributeColumnWidths, removeSelectionStyles, resolveShadingFill, runsToClipboardContent, sectionToStyle, selectRange, setSelectionPosition, sumColumnWidths, tableCellToStyle, textToStyle, writeToClipboard };