@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
@@ -0,0 +1,943 @@
1
+ /**
2
+ * Layout Engine Types
3
+ *
4
+ * Core types for the paginated layout engine.
5
+ * Converts document blocks + measurements into positioned fragments on pages.
6
+ * @packageDocumentation
7
+ * @public
8
+ */
9
+ import { m as RevisionInfo, n as CellMarker } from '../content-CmqAwdFL.js';
10
+ import '../formatting-_OXU8gLB.js';
11
+ import '../colors-C3vA7HUU.js';
12
+ import '../docx/wrapTypes.js';
13
+
14
+ /**
15
+ * Layout Engine Types
16
+ *
17
+ * Core types for the paginated layout engine.
18
+ * Converts document blocks + measurements into positioned fragments on pages.
19
+ * @packageDocumentation
20
+ * @public
21
+ */
22
+ /**
23
+ * Unique identifier for a block in the document.
24
+ * Format: typically `${index}-${type}` or just the block index.
25
+ */
26
+ type BlockId = string | number;
27
+ /**
28
+ * Common run formatting properties applied to text runs.
29
+ */
30
+ type RunFormatting = {
31
+ bold?: boolean;
32
+ italic?: boolean;
33
+ underline?: boolean | {
34
+ style?: string;
35
+ color?: string;
36
+ };
37
+ strike?: boolean;
38
+ color?: string;
39
+ highlight?: string;
40
+ fontFamily?: string;
41
+ fontSize?: number;
42
+ letterSpacing?: number;
43
+ superscript?: boolean;
44
+ subscript?: boolean;
45
+ /** Render glyphs as uppercase regardless of source case (OOXML w:caps). */
46
+ allCaps?: boolean;
47
+ /** Render lowercase glyphs as small uppercase (OOXML w:smallCaps). */
48
+ smallCaps?: boolean;
49
+ /**
50
+ * Vertical baseline shift in CSS pixels (positive = up). OOXML w:position is
51
+ * authored in half-points; converted to px during the bridge so the painter
52
+ * can apply it directly via vertical-align without re-doing the math.
53
+ */
54
+ positionPx?: number;
55
+ /**
56
+ * Horizontal text scale as a percentage (100 = normal, 50 = half-width,
57
+ * 200 = double-width). OOXML w:w specifies pct in raw % (e.g. 90 means 90%).
58
+ */
59
+ horizontalScale?: number;
60
+ /**
61
+ * Minimum font size in points at which kerning kicks in (OOXML w:kern, half-
62
+ * points in source). When this run's effective font size is at or above this
63
+ * threshold, the painter enables font-kerning: normal.
64
+ */
65
+ kerningMinPt?: number;
66
+ /** Engraved/imprint effect (OOXML w:imprint, §17.3.2.18). */
67
+ imprint?: boolean;
68
+ /** Embossed/raised effect (OOXML w:emboss, §17.3.2.13). */
69
+ emboss?: boolean;
70
+ /** Drop-shadow effect (OOXML w:shadow, §17.3.2.31). */
71
+ textShadow?: boolean;
72
+ /** Outlined / hollow text (OOXML w:outline, §17.3.2.23). */
73
+ textOutline?: boolean;
74
+ /**
75
+ * CJK emphasis mark (OOXML w:em, §17.3.2.12). Maps to CSS `text-emphasis`
76
+ * with a position and style; the painter handles the variant lookup.
77
+ */
78
+ emphasisMark?: 'dot' | 'comma' | 'circle' | 'underDot';
79
+ /** Hidden run (OOXML w:vanish, §17.3.2.41). Painter skips the run. */
80
+ hidden?: boolean;
81
+ /**
82
+ * Per-run right-to-left direction (OOXML w:rtl, §17.3.2.30). Independent
83
+ * from the paragraph's bidi flag — a single run may flip direction within
84
+ * an LTR paragraph.
85
+ */
86
+ rtl?: boolean;
87
+ /**
88
+ * Legacy text-effect animation (OOXML w:effect, §17.3.2.11). The painter
89
+ * surfaces it as a class hook so host CSS can opt in to animations.
90
+ */
91
+ textEffect?: 'blinkBackground' | 'lights' | 'antsBlack' | 'antsRed' | 'shimmer' | 'sparkle';
92
+ /** Hyperlink info if this run is a link */
93
+ hyperlink?: HyperlinkInfo;
94
+ /** Footnote reference ID (if this run contains a footnote reference) */
95
+ footnoteRefId?: number;
96
+ /** Endnote reference ID (if this run contains an endnote reference) */
97
+ endnoteRefId?: number;
98
+ /** Comment IDs if this run is within a comment range */
99
+ commentIds?: number[];
100
+ /** Whether this run is a tracked insertion */
101
+ isInsertion?: boolean;
102
+ /** Whether this run is a tracked deletion */
103
+ isDeletion?: boolean;
104
+ /** Author of the tracked change */
105
+ changeAuthor?: string;
106
+ /** Date of the tracked change */
107
+ changeDate?: string;
108
+ /** Revision ID of the tracked change (for sidebar matching) */
109
+ changeRevisionId?: number;
110
+ };
111
+ /**
112
+ * Hyperlink information for a run.
113
+ */
114
+ type HyperlinkInfo = {
115
+ href: string;
116
+ tooltip?: string;
117
+ /**
118
+ * Skip the painter's "Word default" blue + underline fallback when the run
119
+ * has no resolved color/underline. Set by the layout-bridge for hyperlinks
120
+ * inside TOC paragraphs, where Word renders entries in the TOCx paragraph
121
+ * color rather than the Hyperlink character style's color.
122
+ */
123
+ noDefaultStyle?: boolean;
124
+ };
125
+ /**
126
+ * A text run within a paragraph.
127
+ */
128
+ type TextRun = RunFormatting & {
129
+ kind: 'text';
130
+ text: string;
131
+ /** Hyperlink information if this run is a link. */
132
+ hyperlink?: HyperlinkInfo;
133
+ /** Absolute ProseMirror position (inclusive) of first character. */
134
+ pmStart?: number;
135
+ /** Absolute ProseMirror position (exclusive) after last character. */
136
+ pmEnd?: number;
137
+ };
138
+ /**
139
+ * A tab character run.
140
+ */
141
+ type TabRun = RunFormatting & {
142
+ kind: 'tab';
143
+ width?: number;
144
+ pmStart?: number;
145
+ pmEnd?: number;
146
+ };
147
+ /**
148
+ * Position data for floating/anchored images.
149
+ */
150
+ type ImageRunPosition = {
151
+ horizontal?: {
152
+ relativeTo?: string;
153
+ posOffset?: number;
154
+ align?: string;
155
+ };
156
+ vertical?: {
157
+ relativeTo?: string;
158
+ posOffset?: number;
159
+ align?: string;
160
+ };
161
+ };
162
+ type WrapTextDirection = 'bothSides' | 'left' | 'right' | 'largest';
163
+ /**
164
+ * An inline image run.
165
+ */
166
+ type ImageRun = {
167
+ kind: 'image';
168
+ src: string;
169
+ width: number;
170
+ height: number;
171
+ alt?: string;
172
+ /** CSS transform string (rotation, flip) */
173
+ transform?: string;
174
+ /** Position for floating/anchored images */
175
+ position?: ImageRunPosition;
176
+ /** Wrap type from DOCX (inline, square, tight, through, topAndBottom, etc.) */
177
+ wrapType?: string;
178
+ /** Display mode for CSS rendering */
179
+ displayMode?: 'inline' | 'block' | 'float';
180
+ /** CSS float direction */
181
+ cssFloat?: 'left' | 'right' | 'none';
182
+ /** Wrap distances in pixels */
183
+ distTop?: number;
184
+ distBottom?: number;
185
+ distLeft?: number;
186
+ distRight?: number;
187
+ /** wp:srcRect crop fractions in [0, 1]; emit as CSS clip-path inset. */
188
+ cropTop?: number;
189
+ cropRight?: number;
190
+ cropBottom?: number;
191
+ cropLeft?: number;
192
+ /** a:alphaModFix → CSS opacity in [0, 1]. */
193
+ opacity?: number;
194
+ pmStart?: number;
195
+ pmEnd?: number;
196
+ };
197
+ /**
198
+ * A line break run.
199
+ */
200
+ type LineBreakRun = {
201
+ kind: 'lineBreak';
202
+ pmStart?: number;
203
+ pmEnd?: number;
204
+ };
205
+ /**
206
+ * A field run (PAGE, NUMPAGES, etc.) that gets substituted at render time.
207
+ */
208
+ type FieldRun = RunFormatting & {
209
+ kind: 'field';
210
+ fieldType: 'PAGE' | 'NUMPAGES' | 'DATE' | 'TIME' | 'OTHER';
211
+ /** Fallback text if field can't be resolved */
212
+ fallback?: string;
213
+ pmStart?: number;
214
+ pmEnd?: number;
215
+ };
216
+ /**
217
+ * Union of all run types.
218
+ */
219
+ type Run = TextRun | TabRun | ImageRun | LineBreakRun | FieldRun;
220
+ /**
221
+ * Paragraph spacing configuration.
222
+ */
223
+ type ParagraphSpacing = {
224
+ before?: number;
225
+ after?: number;
226
+ line?: number;
227
+ lineUnit?: 'px' | 'multiplier';
228
+ lineRule?: 'auto' | 'exact' | 'atLeast';
229
+ };
230
+ /**
231
+ * Paragraph indentation configuration.
232
+ */
233
+ type ParagraphIndent = {
234
+ left?: number;
235
+ right?: number;
236
+ firstLine?: number;
237
+ hanging?: number;
238
+ };
239
+ /**
240
+ * Tab stop alignment types
241
+ */
242
+ type TabAlignment = 'start' | 'end' | 'center' | 'decimal' | 'bar' | 'clear';
243
+ /**
244
+ * Tab stop definition
245
+ */
246
+ type TabStop = {
247
+ /** Tab alignment mode */
248
+ val: TabAlignment;
249
+ /** Position in twips from left margin */
250
+ pos: number;
251
+ /** Optional leader character */
252
+ leader?: 'none' | 'dot' | 'hyphen' | 'underscore' | 'heavy' | 'middleDot';
253
+ };
254
+ /**
255
+ * Border specification for paragraphs.
256
+ */
257
+ type BorderStyle = {
258
+ style?: string;
259
+ width?: number;
260
+ color?: string;
261
+ space?: number;
262
+ };
263
+ /**
264
+ * Paragraph borders.
265
+ */
266
+ type ParagraphBorders = {
267
+ top?: BorderStyle;
268
+ bottom?: BorderStyle;
269
+ left?: BorderStyle;
270
+ right?: BorderStyle;
271
+ between?: BorderStyle;
272
+ bar?: BorderStyle;
273
+ };
274
+ /**
275
+ * List numbering properties for a paragraph.
276
+ */
277
+ type ListNumPr = {
278
+ numId?: number;
279
+ ilvl?: number;
280
+ };
281
+ /**
282
+ * Paragraph block attributes.
283
+ */
284
+ type ParagraphAttrs = {
285
+ alignment?: 'left' | 'center' | 'right' | 'justify';
286
+ spacing?: ParagraphSpacing;
287
+ /** See ParagraphFormatting.spacingExplicit. */
288
+ spacingExplicit?: {
289
+ before?: boolean;
290
+ after?: boolean;
291
+ };
292
+ indent?: ParagraphIndent;
293
+ keepNext?: boolean;
294
+ keepLines?: boolean;
295
+ pageBreakBefore?: boolean;
296
+ styleId?: string;
297
+ contextualSpacing?: boolean;
298
+ /** Right-to-left paragraph direction */
299
+ bidi?: boolean;
300
+ borders?: ParagraphBorders;
301
+ shading?: string;
302
+ tabs?: TabStop[];
303
+ numPr?: ListNumPr;
304
+ listMarker?: string;
305
+ listIsBullet?: boolean;
306
+ listMarkerHidden?: boolean;
307
+ listMarkerFontFamily?: string;
308
+ listMarkerFontSize?: number;
309
+ listMarkerSuffix?: 'tab' | 'space' | 'nothing';
310
+ /** Document-wide `w:defaultTabStop` in twips (§17.6.13). Default 720. */
311
+ defaultTabStopTwips?: number;
312
+ defaultFontSize?: number;
313
+ defaultFontFamily?: string;
314
+ /**
315
+ * Skip the empty-paragraph line-height fallback. Used by HF measurement
316
+ * for the canonical OOXML "trailing empty paragraph after a table" pattern
317
+ * — Word renders that paragraph as a zero-height anchor, not as a full
318
+ * line-height of phantom space. See `normalizeHeaderFooterMeasureBlocks`
319
+ * (#381).
320
+ */
321
+ suppressEmptyParagraphHeight?: boolean;
322
+ /**
323
+ * Tracked-change marker on the paragraph mark itself
324
+ * (`<w:pPr><w:rPr><w:ins/>`). The painter renders a pilcrow and margin
325
+ * change bar; the cache key includes presence so two paragraphs with
326
+ * different revisions don't share a measurement.
327
+ */
328
+ pPrIns?: RevisionInfo | null;
329
+ /** Tracked-change marker on the paragraph mark (`<w:pPr><w:rPr><w:del/>`). */
330
+ pPrDel?: RevisionInfo | null;
331
+ };
332
+ /**
333
+ * A paragraph block containing runs.
334
+ */
335
+ type ParagraphBlock = {
336
+ kind: 'paragraph';
337
+ id: BlockId;
338
+ runs: Run[];
339
+ attrs?: ParagraphAttrs;
340
+ /** ProseMirror start position for this block. */
341
+ pmStart?: number;
342
+ /** ProseMirror end position for this block. */
343
+ pmEnd?: number;
344
+ };
345
+ /**
346
+ * Cell border specification for rendering.
347
+ */
348
+ type CellBorderSpec = {
349
+ width?: number;
350
+ color?: string;
351
+ style?: string;
352
+ };
353
+ /**
354
+ * Cell borders (all four sides).
355
+ */
356
+ type CellBorders = {
357
+ top?: CellBorderSpec;
358
+ bottom?: CellBorderSpec;
359
+ left?: CellBorderSpec;
360
+ right?: CellBorderSpec;
361
+ };
362
+ /**
363
+ * A table cell with content.
364
+ */
365
+ type TableCell = {
366
+ id: BlockId;
367
+ blocks: FlowBlock[];
368
+ colSpan?: number;
369
+ rowSpan?: number;
370
+ width?: number;
371
+ /** Original DOCX cell width value, before unit conversion. */
372
+ widthValue?: number;
373
+ /** Original DOCX cell width type ('auto', 'pct', 'dxa', 'nil'). */
374
+ widthType?: string;
375
+ verticalAlign?: 'top' | 'center' | 'bottom';
376
+ background?: string;
377
+ borders?: CellBorders;
378
+ /** Per-cell padding in pixels (from w:tcMar or table-level w:tblCellMar) */
379
+ padding?: {
380
+ top: number;
381
+ right: number;
382
+ bottom: number;
383
+ left: number;
384
+ };
385
+ /**
386
+ * `w:noWrap`: when true, the cell forbids text wrapping inside it. The
387
+ * painter renders this as `white-space: nowrap` on the content container
388
+ * — content stays on one line and the cell expands horizontally.
389
+ */
390
+ noWrap?: boolean;
391
+ /** Tracked cell marker (`<w:cellIns>` / `<w:cellDel>` / `<w:cellMerge>`) — painter colors the top border. */
392
+ trackedMarker?: CellMarker;
393
+ };
394
+ /**
395
+ * A table row containing cells.
396
+ */
397
+ type TableRow = {
398
+ id: BlockId;
399
+ cells: TableCell[];
400
+ height?: number;
401
+ heightRule?: 'auto' | 'atLeast' | 'exact';
402
+ isHeader?: boolean;
403
+ /** Tracked row ins / del (`<w:trPr><w:ins/>` / `<w:del/>`). */
404
+ trackedIns?: RevisionInfo;
405
+ /** see trackedIns */ trackedDel?: RevisionInfo;
406
+ };
407
+ /**
408
+ * Floating table positioning info (pixel values).
409
+ */
410
+ type FloatingTablePosition = {
411
+ horzAnchor?: 'margin' | 'page' | 'text';
412
+ vertAnchor?: 'margin' | 'page' | 'text';
413
+ tblpX?: number;
414
+ tblpXSpec?: 'left' | 'center' | 'right' | 'inside' | 'outside';
415
+ tblpY?: number;
416
+ tblpYSpec?: 'top' | 'center' | 'bottom' | 'inside' | 'outside' | 'inline';
417
+ topFromText?: number;
418
+ bottomFromText?: number;
419
+ leftFromText?: number;
420
+ rightFromText?: number;
421
+ };
422
+ /**
423
+ * A table block containing rows.
424
+ */
425
+ type TableBlock = {
426
+ kind: 'table';
427
+ id: BlockId;
428
+ rows: TableRow[];
429
+ columnWidths?: number[];
430
+ /** Table width value (twips for dxa, 50ths of percent for pct). */
431
+ width?: number;
432
+ /** Table width type ('auto', 'pct', 'dxa', 'nil'). */
433
+ widthType?: string;
434
+ /** Table horizontal alignment */
435
+ justification?: 'left' | 'center' | 'right';
436
+ /** Table indent from left margin (in pixels, from w:tblInd) */
437
+ indent?: number;
438
+ /** Floating table properties (pixel values). */
439
+ floating?: FloatingTablePosition;
440
+ pmStart?: number;
441
+ pmEnd?: number;
442
+ };
443
+ /**
444
+ * An anchored/floating image block.
445
+ */
446
+ type ImageBlock = {
447
+ kind: 'image';
448
+ id: BlockId;
449
+ src: string;
450
+ width: number;
451
+ height: number;
452
+ alt?: string;
453
+ /** CSS transform string (rotation, flip) */
454
+ transform?: string;
455
+ anchor?: {
456
+ isAnchored?: boolean;
457
+ offsetH?: number;
458
+ offsetV?: number;
459
+ behindDoc?: boolean;
460
+ };
461
+ /** Hyperlink URL for clickable image */
462
+ hlinkHref?: string;
463
+ pmStart?: number;
464
+ pmEnd?: number;
465
+ };
466
+ /**
467
+ * Section break block defining page layout changes.
468
+ */
469
+ type SectionBreakBlock = {
470
+ kind: 'sectionBreak';
471
+ id: BlockId;
472
+ type?: 'continuous' | 'nextPage' | 'evenPage' | 'oddPage';
473
+ pageSize?: {
474
+ w: number;
475
+ h: number;
476
+ };
477
+ orientation?: 'portrait' | 'landscape';
478
+ margins?: PageMargins;
479
+ columns?: ColumnLayout;
480
+ };
481
+ /**
482
+ * Explicit page break block.
483
+ */
484
+ type PageBreakBlock = {
485
+ kind: 'pageBreak';
486
+ id: BlockId;
487
+ pmStart?: number;
488
+ pmEnd?: number;
489
+ };
490
+ /**
491
+ * Column break block.
492
+ */
493
+ type ColumnBreakBlock = {
494
+ kind: 'columnBreak';
495
+ id: BlockId;
496
+ pmStart?: number;
497
+ pmEnd?: number;
498
+ };
499
+ /** Default internal margins for text boxes (OOXML defaults in pixels) */
500
+ declare const DEFAULT_TEXTBOX_MARGINS: {
501
+ top: number;
502
+ bottom: number;
503
+ left: number;
504
+ right: number;
505
+ };
506
+ /** Default text box width in pixels when no width is specified */
507
+ declare const DEFAULT_TEXTBOX_WIDTH = 200;
508
+ /**
509
+ * Text box block — positioned container with paragraph content.
510
+ */
511
+ type TextBoxBlock = {
512
+ kind: 'textBox';
513
+ id: BlockId;
514
+ /** Width in pixels */
515
+ width: number;
516
+ /** Height in pixels (may be auto-calculated) */
517
+ height?: number;
518
+ /** Fill/background color */
519
+ fillColor?: string;
520
+ /** Border width in pixels */
521
+ outlineWidth?: number;
522
+ /** Border color */
523
+ outlineColor?: string;
524
+ /** Border style */
525
+ outlineStyle?: string;
526
+ /** Internal padding */
527
+ margins?: {
528
+ top: number;
529
+ bottom: number;
530
+ left: number;
531
+ right: number;
532
+ };
533
+ /** Paragraph blocks inside the text box */
534
+ content: ParagraphBlock[];
535
+ /** Display mode copied from the ProseMirror text box node */
536
+ displayMode?: 'inline' | 'float' | 'block';
537
+ /** CSS float direction copied from the ProseMirror text box node */
538
+ cssFloat?: 'left' | 'right' | 'none';
539
+ /** OOXML wrap type for anchored text boxes */
540
+ wrapType?: string;
541
+ /** OOXML wrapText direction */
542
+ wrapText?: WrapTextDirection;
543
+ /** Anchor target used during DOCX import/export */
544
+ anchorTarget?: 'followingBlock';
545
+ /** Position for floating/anchored text boxes */
546
+ position?: ImageRunPosition;
547
+ /** Wrap distances in pixels */
548
+ distTop?: number;
549
+ distBottom?: number;
550
+ distLeft?: number;
551
+ distRight?: number;
552
+ pmStart?: number;
553
+ pmEnd?: number;
554
+ };
555
+ /**
556
+ * Union of every block kind the layout engine knows about.
557
+ *
558
+ * Three switches over `block.kind` must stay in sync with this type:
559
+ * - `runLayoutPipeline` in `layout-engine/index.ts` (this package)
560
+ * - `measureBlock` in `packages/react/src/paged-editor/PagedEditor.tsx`
561
+ * - `measureBlock` in `packages/vue/src/composables/useDocxEditor.ts`
562
+ *
563
+ * All three end in `assertExhaustiveFlowBlock(block, '<site>')` so adding
564
+ * a new variant here without updating every site is a typecheck error.
565
+ */
566
+ type FlowBlock = ParagraphBlock | TableBlock | ImageBlock | TextBoxBlock | SectionBreakBlock | PageBreakBlock | ColumnBreakBlock;
567
+ /**
568
+ * Exhaustiveness guard for `FlowBlock`-shaped switches. Call from the
569
+ * `default` arm with the still-typed value; TypeScript will refuse to
570
+ * compile if any variant of `FlowBlock` was missed. The thrown error
571
+ * names the calling site so runtime failures (e.g. an old adapter
572
+ * compiled against a newer core) point future debuggers at the contract.
573
+ */
574
+ declare function assertExhaustiveFlowBlock(block: never, site: string): never;
575
+ /**
576
+ * A measured line within a paragraph.
577
+ */
578
+ type MeasuredLine = {
579
+ /** Starting run index (inclusive). */
580
+ fromRun: number;
581
+ /** Starting character index within fromRun. */
582
+ fromChar: number;
583
+ /** Ending run index (inclusive). */
584
+ toRun: number;
585
+ /** Ending character index within toRun (exclusive). */
586
+ toChar: number;
587
+ /** Total width of the line in pixels. */
588
+ width: number;
589
+ /** Ascent (height above baseline) in pixels. */
590
+ ascent: number;
591
+ /** Descent (height below baseline) in pixels. */
592
+ descent: number;
593
+ /** Total line height in pixels. */
594
+ lineHeight: number;
595
+ /** Left offset from floating images (pixels from content left edge). */
596
+ leftOffset?: number;
597
+ /** Right offset from floating images (pixels from content right edge). */
598
+ rightOffset?: number;
599
+ /** Optional split segments for centered floating exclusions. */
600
+ segments?: MeasuredLineSegment[];
601
+ /**
602
+ * Vertical space inserted before this line to skip past floats that leave
603
+ * no usable horizontal width at the natural line Y. Painters render this
604
+ * as marginTop on the line element; measurement adds it to totalHeight.
605
+ */
606
+ floatSkipBefore?: number;
607
+ };
608
+ type MeasuredLineSegment = {
609
+ fromRun: number;
610
+ fromChar: number;
611
+ toRun: number;
612
+ toChar: number;
613
+ width: number;
614
+ leftOffset: number;
615
+ availableWidth: number;
616
+ };
617
+ /**
618
+ * Measurement result for a paragraph block.
619
+ */
620
+ type ParagraphMeasure = {
621
+ kind: 'paragraph';
622
+ lines: MeasuredLine[];
623
+ totalHeight: number;
624
+ };
625
+ /**
626
+ * Measurement result for an image block.
627
+ */
628
+ type ImageMeasure = {
629
+ kind: 'image';
630
+ width: number;
631
+ height: number;
632
+ };
633
+ /**
634
+ * Measurement result for a table cell.
635
+ */
636
+ type TableCellMeasure = {
637
+ blocks: Measure[];
638
+ width: number;
639
+ height: number;
640
+ colSpan?: number;
641
+ rowSpan?: number;
642
+ };
643
+ /**
644
+ * Measurement result for a table row.
645
+ */
646
+ type TableRowMeasure = {
647
+ cells: TableCellMeasure[];
648
+ height: number;
649
+ };
650
+ /**
651
+ * Measurement result for a table block.
652
+ */
653
+ type TableMeasure = {
654
+ kind: 'table';
655
+ rows: TableRowMeasure[];
656
+ columnWidths: number[];
657
+ totalWidth: number;
658
+ totalHeight: number;
659
+ };
660
+ /**
661
+ * Measurement result for section break (no visual size).
662
+ */
663
+ type SectionBreakMeasure = {
664
+ kind: 'sectionBreak';
665
+ };
666
+ /**
667
+ * Measurement result for page break (no visual size).
668
+ */
669
+ type PageBreakMeasure = {
670
+ kind: 'pageBreak';
671
+ };
672
+ /**
673
+ * Measurement result for column break (no visual size).
674
+ */
675
+ type ColumnBreakMeasure = {
676
+ kind: 'columnBreak';
677
+ };
678
+ /**
679
+ * Measurement result for a text box block.
680
+ */
681
+ type TextBoxMeasure = {
682
+ kind: 'textBox';
683
+ width: number;
684
+ height: number;
685
+ /** Pre-measured inner paragraph measures (avoids re-measuring during render) */
686
+ innerMeasures: ParagraphMeasure[];
687
+ };
688
+ /**
689
+ * Union of all measurement types.
690
+ */
691
+ type Measure = ParagraphMeasure | ImageMeasure | TableMeasure | TextBoxMeasure | SectionBreakMeasure | PageBreakMeasure | ColumnBreakMeasure;
692
+ /**
693
+ * Base fragment properties common to all fragment types.
694
+ */
695
+ type FragmentBase = {
696
+ /** Block ID this fragment belongs to. */
697
+ blockId: BlockId;
698
+ /** X position on page (relative to page left). */
699
+ x: number;
700
+ /** Y position on page (relative to page top). */
701
+ y: number;
702
+ /** Width of the fragment. */
703
+ width: number;
704
+ /** ProseMirror start position (for click mapping). */
705
+ pmStart?: number;
706
+ /** ProseMirror end position (for click mapping). */
707
+ pmEnd?: number;
708
+ };
709
+ /**
710
+ * A paragraph fragment positioned on a page.
711
+ * May span only part of the paragraph's lines if split across pages.
712
+ */
713
+ type ParagraphFragment = FragmentBase & {
714
+ kind: 'paragraph';
715
+ /** First line index (inclusive) from the measure. */
716
+ fromLine: number;
717
+ /** Last line index (exclusive) from the measure. */
718
+ toLine: number;
719
+ /** Height of this fragment. */
720
+ height: number;
721
+ /** True if this continues from a previous page. */
722
+ continuesFromPrev?: boolean;
723
+ /** True if this continues onto the next page. */
724
+ continuesOnNext?: boolean;
725
+ };
726
+ /**
727
+ * A table fragment positioned on a page.
728
+ * May span only part of the table's rows if split across pages.
729
+ */
730
+ type TableFragment = FragmentBase & {
731
+ kind: 'table';
732
+ /** First row index (inclusive). */
733
+ fromRow: number;
734
+ /** Last row index (exclusive). */
735
+ toRow: number;
736
+ /** Height of this fragment. */
737
+ height: number;
738
+ /** True if this is a floating table. */
739
+ isFloating?: boolean;
740
+ /** True if this continues from a previous page. */
741
+ continuesFromPrev?: boolean;
742
+ /** True if this continues onto the next page. */
743
+ continuesOnNext?: boolean;
744
+ /** Number of header rows prepended to this continuation fragment (0 or undefined for first fragment). */
745
+ headerRowCount?: number;
746
+ };
747
+ /**
748
+ * An image fragment positioned on a page.
749
+ */
750
+ type ImageFragment = FragmentBase & {
751
+ kind: 'image';
752
+ /** Height of the image. */
753
+ height: number;
754
+ /** True if this is an anchored/floating image. */
755
+ isAnchored?: boolean;
756
+ /** Z-index for layering. */
757
+ zIndex?: number;
758
+ };
759
+ /**
760
+ * A text box fragment positioned on a page.
761
+ */
762
+ type TextBoxFragment = FragmentBase & {
763
+ kind: 'textBox';
764
+ /** Height of the text box. */
765
+ height: number;
766
+ /** True when positioned outside normal document flow. */
767
+ isFloating?: boolean;
768
+ /** Stack order hint for anchored text boxes. */
769
+ zIndex?: number;
770
+ };
771
+ /**
772
+ * Union of all fragment types.
773
+ */
774
+ type Fragment = ParagraphFragment | TableFragment | ImageFragment | TextBoxFragment;
775
+ /**
776
+ * Page margin configuration.
777
+ */
778
+ type PageMargins = {
779
+ top: number;
780
+ right: number;
781
+ bottom: number;
782
+ left: number;
783
+ /** Distance from page top to header content. */
784
+ header?: number;
785
+ /** Distance from page bottom to footer content. */
786
+ footer?: number;
787
+ };
788
+ /**
789
+ * A rendered page containing positioned fragments.
790
+ */
791
+ type Page = {
792
+ /** Page number (1-indexed). */
793
+ number: number;
794
+ /** Fragments positioned on this page. */
795
+ fragments: Fragment[];
796
+ /** Page margins. */
797
+ margins: PageMargins;
798
+ /** Page size (width, height). */
799
+ size: {
800
+ w: number;
801
+ h: number;
802
+ };
803
+ /** Page orientation. */
804
+ orientation?: 'portrait' | 'landscape';
805
+ /** Section index this page belongs to. */
806
+ sectionIndex?: number;
807
+ /** Header/footer references for this page. */
808
+ headerFooterRefs?: {
809
+ headerDefault?: string;
810
+ headerFirst?: string;
811
+ headerEven?: string;
812
+ footerDefault?: string;
813
+ footerFirst?: string;
814
+ footerEven?: string;
815
+ };
816
+ /** Footnote IDs that appear on this page (for rendering). */
817
+ footnoteIds?: number[];
818
+ /** Height reserved for the footnote area at page bottom (pixels). */
819
+ footnoteReservedHeight?: number;
820
+ /** Column layout for this page (if multi-column). */
821
+ columns?: ColumnLayout;
822
+ };
823
+ /**
824
+ * Column layout configuration.
825
+ */
826
+ type ColumnLayout = {
827
+ count: number;
828
+ gap: number;
829
+ equalWidth?: boolean;
830
+ /** Draw vertical separator line between columns (w:sep). */
831
+ separator?: boolean;
832
+ };
833
+ /**
834
+ * Header/footer layout for a specific type.
835
+ */
836
+ type HeaderFooterLayout = {
837
+ height: number;
838
+ fragments: Fragment[];
839
+ };
840
+ /**
841
+ * Final layout output ready for rendering/painting.
842
+ */
843
+ type Layout = {
844
+ /** Default page size for the document. */
845
+ pageSize: {
846
+ w: number;
847
+ h: number;
848
+ };
849
+ /** All rendered pages with positioned fragments. */
850
+ pages: Page[];
851
+ /** Column configuration (if multi-column). */
852
+ columns?: ColumnLayout;
853
+ /** Header layouts by type (default, first, even). */
854
+ headers?: Record<string, HeaderFooterLayout>;
855
+ /** Footer layouts by type (default, first, even). */
856
+ footers?: Record<string, HeaderFooterLayout>;
857
+ /** Gap between pages in pixels (for rendering). */
858
+ pageGap?: number;
859
+ };
860
+ /**
861
+ * Header/footer content heights by variant type.
862
+ */
863
+ type HeaderFooterContentHeights = Partial<Record<'default' | 'first' | 'even' | 'odd', number>>;
864
+ /**
865
+ * Pre-calculated footnote content for layout and rendering.
866
+ */
867
+ type FootnoteContent = {
868
+ /** Footnote ID. */
869
+ id: number;
870
+ /** Display number (e.g. 1, 2, 3). */
871
+ displayNumber: number;
872
+ /** FlowBlocks for rendering the footnote content. */
873
+ blocks: FlowBlock[];
874
+ /** Measurements for the blocks. */
875
+ measures: Measure[];
876
+ /** Total height in pixels. */
877
+ height: number;
878
+ };
879
+ /**
880
+ * Options for the layout engine.
881
+ */
882
+ type LayoutOptions = {
883
+ /** Initial page size. */
884
+ pageSize: {
885
+ w: number;
886
+ h: number;
887
+ };
888
+ /** Initial page margins. */
889
+ margins: PageMargins;
890
+ /** Body-level (final section) page size, used after the last explicit section break. */
891
+ finalPageSize?: {
892
+ w: number;
893
+ h: number;
894
+ };
895
+ /** Body-level (final section) margins, used after the last explicit section break. */
896
+ finalMargins?: PageMargins;
897
+ /** Column configuration. */
898
+ columns?: ColumnLayout;
899
+ /** Gap between rendered pages (for UI). */
900
+ pageGap?: number;
901
+ /** Default line height multiplier. */
902
+ defaultLineHeight?: number;
903
+ /** Header content heights by variant. */
904
+ headerContentHeights?: HeaderFooterContentHeights;
905
+ /** Footer content heights by variant. */
906
+ footerContentHeights?: HeaderFooterContentHeights;
907
+ /** Whether section has different first page header/footer. */
908
+ titlePage?: boolean;
909
+ /** Whether section has different even/odd headers/footers. */
910
+ evenAndOddHeaders?: boolean;
911
+ /** Per-page footnote reserved heights (pageNumber → height in pixels). */
912
+ footnoteReservedHeights?: Map<number, number>;
913
+ /** Section break type for the body-level (final) section (for section transition logic). */
914
+ bodyBreakType?: 'continuous' | 'nextPage' | 'evenPage' | 'oddPage';
915
+ };
916
+ /**
917
+ * Result of hit-testing a click position.
918
+ */
919
+ type HitTestResult = {
920
+ /** Page index (0-based). */
921
+ pageIndex: number;
922
+ /** Fragment that was hit, if any. */
923
+ fragment?: Fragment;
924
+ /** Local X coordinate within the fragment. */
925
+ localX?: number;
926
+ /** Local Y coordinate within the fragment. */
927
+ localY?: number;
928
+ };
929
+ /**
930
+ * Position within the document model.
931
+ */
932
+ type DocumentPosition = {
933
+ /** Block index. */
934
+ blockIndex: number;
935
+ /** Run index within the block (for paragraphs). */
936
+ runIndex?: number;
937
+ /** Character offset within the run. */
938
+ charOffset?: number;
939
+ /** ProseMirror position. */
940
+ pmPos?: number;
941
+ };
942
+
943
+ export { type BlockId, type BorderStyle, type CellBorderSpec, type CellBorders, type ColumnBreakBlock, type ColumnBreakMeasure, type ColumnLayout, DEFAULT_TEXTBOX_MARGINS, DEFAULT_TEXTBOX_WIDTH, type DocumentPosition, type FieldRun, type FloatingTablePosition, type FlowBlock, type FootnoteContent, type Fragment, type FragmentBase, type HeaderFooterContentHeights, type HeaderFooterLayout, type HitTestResult, type HyperlinkInfo, type ImageBlock, type ImageFragment, type ImageMeasure, type ImageRun, type ImageRunPosition, type Layout, type LayoutOptions, type LineBreakRun, type ListNumPr, type Measure, type MeasuredLine, type MeasuredLineSegment, type Page, type PageBreakBlock, type PageBreakMeasure, type PageMargins, type ParagraphAttrs, type ParagraphBlock, type ParagraphBorders, type ParagraphFragment, type ParagraphIndent, type ParagraphMeasure, type ParagraphSpacing, type Run, type RunFormatting, type SectionBreakBlock, type SectionBreakMeasure, type TabAlignment, type TabRun, type TabStop, type TableBlock, type TableCell, type TableCellMeasure, type TableFragment, type TableMeasure, type TableRow, type TableRowMeasure, type TextBoxBlock, type TextBoxFragment, type TextBoxMeasure, type TextRun, type WrapTextDirection, assertExhaustiveFlowBlock };