@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.
- package/LICENSE +201 -0
- package/README.md +89 -0
- package/dist/ImageExtension-BN327PNe.d.mts +38 -0
- package/dist/ImageExtension-BlI5afZD.d.ts +38 -0
- package/dist/Subscribable-DOz6Ohoo.d.mts +33 -0
- package/dist/Subscribable-DOz6Ohoo.d.ts +33 -0
- package/dist/agent/index.d.mts +168 -0
- package/dist/agent/index.d.ts +168 -0
- package/dist/agent/index.js +1 -0
- package/dist/agent/index.mjs +1 -0
- package/dist/borders-BH_GoYU3.d.mts +58 -0
- package/dist/borders-Z9hPno2u.d.ts +58 -0
- package/dist/chunk-2HFQ4QTU.js +1 -0
- package/dist/chunk-2KHWHVTA.js +1 -0
- package/dist/chunk-2MSZXH6Q.mjs +2 -0
- package/dist/chunk-3COGZG7O.mjs +1 -0
- package/dist/chunk-3NRMSZX2.mjs +1 -0
- package/dist/chunk-3SXJPJSV.mjs +1 -0
- package/dist/chunk-44FHVKSI.js +1 -0
- package/dist/chunk-4BFNWPKW.js +1 -0
- package/dist/chunk-4G6AJ4ZM.js +1 -0
- package/dist/chunk-4GER4JLW.js +1 -0
- package/dist/chunk-4Q2IP5FW.js +1 -0
- package/dist/chunk-56D223FM.mjs +1 -0
- package/dist/chunk-5VBNOHRE.mjs +1 -0
- package/dist/chunk-67LVRQIR.mjs +1 -0
- package/dist/chunk-6LVPRTB6.js +1 -0
- package/dist/chunk-6NQSIC27.mjs +1 -0
- package/dist/chunk-6Y6LON6Y.mjs +1 -0
- package/dist/chunk-6ZXL3EIP.mjs +2 -0
- package/dist/chunk-7AMYZMCX.js +1 -0
- package/dist/chunk-7E5VBRDL.mjs +1 -0
- package/dist/chunk-7HANRHHL.js +1 -0
- package/dist/chunk-7LRR7RKE.mjs +15 -0
- package/dist/chunk-7RDCZLTU.js +1 -0
- package/dist/chunk-7U4I6BKJ.js +1 -0
- package/dist/chunk-7Z2AGPNQ.mjs +10 -0
- package/dist/chunk-AAPBAMD7.js +1 -0
- package/dist/chunk-AGVFAXVQ.mjs +9 -0
- package/dist/chunk-AMENZY5F.mjs +1 -0
- package/dist/chunk-ARHPXIBJ.mjs +1 -0
- package/dist/chunk-BGY3CB37.mjs +1 -0
- package/dist/chunk-BHBOAP6Z.js +3 -0
- package/dist/chunk-BOOHU5EW.mjs +1 -0
- package/dist/chunk-C2BAPYGJ.js +1 -0
- package/dist/chunk-CGJ6S3AH.mjs +1 -0
- package/dist/chunk-CKKO4JWE.mjs +1 -0
- package/dist/chunk-CTHHUJAB.mjs +2 -0
- package/dist/chunk-CUY2THAO.mjs +1 -0
- package/dist/chunk-CXQDYR2Y.js +1 -0
- package/dist/chunk-D4RPOJC7.js +1 -0
- package/dist/chunk-D6GO7UGD.mjs +1 -0
- package/dist/chunk-DC7S76ZX.js +1 -0
- package/dist/chunk-DROCYKAR.js +1 -0
- package/dist/chunk-DV6GWBUJ.js +2 -0
- package/dist/chunk-DZYYLV2O.js +1 -0
- package/dist/chunk-E4JMCA5X.js +2 -0
- package/dist/chunk-ERNVFCGN.js +59 -0
- package/dist/chunk-ESI4BSBF.js +1 -0
- package/dist/chunk-F44ZLDZS.js +4 -0
- package/dist/chunk-FCJWLEKT.mjs +1 -0
- package/dist/chunk-FDEDN2RC.mjs +0 -0
- package/dist/chunk-FRYMBAHP.js +3 -0
- package/dist/chunk-FWTP7BN7.mjs +4 -0
- package/dist/chunk-G3YJ5RKC.mjs +1 -0
- package/dist/chunk-GGPKPXON.js +1 -0
- package/dist/chunk-HKVAW3RE.js +1 -0
- package/dist/chunk-HQPWFUP5.js +2 -0
- package/dist/chunk-I6PMX4BO.js +1 -0
- package/dist/chunk-ILJUDEZ5.mjs +1 -0
- package/dist/chunk-IMKU4O3P.js +1 -0
- package/dist/chunk-IP2VXNWG.js +1 -0
- package/dist/chunk-J4J2Y6EU.js +10 -0
- package/dist/chunk-J7NADDC4.mjs +1 -0
- package/dist/chunk-JFZIXFRC.js +1 -0
- package/dist/chunk-JHZ3HLSR.mjs +1 -0
- package/dist/chunk-JY5EFI4D.js +1 -0
- package/dist/chunk-JZESIPVC.mjs +3 -0
- package/dist/chunk-K7GVLZS6.mjs +1 -0
- package/dist/chunk-KESNGXGO.js +1 -0
- package/dist/chunk-KQTB5Y7P.mjs +1 -0
- package/dist/chunk-L2U3TTAD.js +9 -0
- package/dist/chunk-LBKMYD3M.mjs +1 -0
- package/dist/chunk-LCICADWM.js +2 -0
- package/dist/chunk-LE67NTCN.mjs +1 -0
- package/dist/chunk-LTHT4A4S.js +1 -0
- package/dist/chunk-MCFHOMA2.js +2 -0
- package/dist/chunk-MCX4GVRX.mjs +1 -0
- package/dist/chunk-MJ5FQX7Q.js +1 -0
- package/dist/chunk-MJ6XZFVD.mjs +1 -0
- package/dist/chunk-MNOHUTKE.js +15 -0
- package/dist/chunk-MOKKS75W.mjs +3 -0
- package/dist/chunk-MP4QSEO2.mjs +1 -0
- package/dist/chunk-MVZOTKNL.mjs +1 -0
- package/dist/chunk-MZ7LW5CH.js +1 -0
- package/dist/chunk-MZOVDLYL.js +1 -0
- package/dist/chunk-N3Y5BUKV.js +1 -0
- package/dist/chunk-NBLJPT54.mjs +1 -0
- package/dist/chunk-NDDJ67FQ.mjs +1 -0
- package/dist/chunk-NMUHXIF5.js +1 -0
- package/dist/chunk-NXLJVVVE.js +1 -0
- package/dist/chunk-OBMN4VSM.mjs +1 -0
- package/dist/chunk-OCAX2KJQ.js +4 -0
- package/dist/chunk-OEXVWIHW.mjs +2 -0
- package/dist/chunk-OZMNIX6U.mjs +1 -0
- package/dist/chunk-PRRM64JO.mjs +1 -0
- package/dist/chunk-PXE2OWEA.mjs +1 -0
- package/dist/chunk-Q4CKLXWA.js +1 -0
- package/dist/chunk-Q5QOBZWT.mjs +1 -0
- package/dist/chunk-QJJQ53V6.mjs +1 -0
- package/dist/chunk-QLPQVR5W.mjs +1 -0
- package/dist/chunk-QLX4HX3I.mjs +59 -0
- package/dist/chunk-QPFJJPIC.mjs +1 -0
- package/dist/chunk-QYUPLKLP.mjs +1 -0
- package/dist/chunk-RFC2SXZ6.mjs +4 -0
- package/dist/chunk-RNOXNNSD.mjs +0 -0
- package/dist/chunk-RPIQG46O.mjs +1 -0
- package/dist/chunk-RQN4C636.js +1 -0
- package/dist/chunk-SHJBS42Y.js +1 -0
- package/dist/chunk-SORYYVJ7.js +1 -0
- package/dist/chunk-SWC6T7YQ.js +1 -0
- package/dist/chunk-TE2AF7FM.js +1 -0
- package/dist/chunk-TE2VQJZG.js +1 -0
- package/dist/chunk-TUIEV7Q7.js +1 -0
- package/dist/chunk-U4UCHBZ7.js +1 -0
- package/dist/chunk-U74VPTIU.js +1 -0
- package/dist/chunk-UCJGOQ4J.mjs +1 -0
- package/dist/chunk-UQ6WNWXX.js +1 -0
- package/dist/chunk-VHUVPHPI.mjs +1 -0
- package/dist/chunk-VQWZHPWI.mjs +1 -0
- package/dist/chunk-VW22RZ6C.mjs +1 -0
- package/dist/chunk-WLHNIXWC.mjs +2 -0
- package/dist/chunk-WLKRUBY4.js +1 -0
- package/dist/chunk-WTFLNYAT.mjs +1 -0
- package/dist/chunk-XNDGWWDT.js +1 -0
- package/dist/chunk-XXU7YQVV.js +1 -0
- package/dist/chunk-Y74ANBPV.js +1 -0
- package/dist/chunk-YMZ3F2FZ.mjs +1 -0
- package/dist/chunk-YTDWMXNS.js +1 -0
- package/dist/chunk-YUZQTRI2.js +1 -0
- package/dist/chunk-ZX26QZJ5.mjs +1 -0
- package/dist/chunk-ZY7EMTZ3.mjs +1 -0
- package/dist/colorResolver-BZ_yScf4.d.ts +390 -0
- package/dist/colorResolver-C6DtsoFI.d.mts +390 -0
- package/dist/colors-C3vA7HUU.d.mts +70 -0
- package/dist/colors-C3vA7HUU.d.ts +70 -0
- package/dist/content-5Mrz6w_b.d.mts +1360 -0
- package/dist/content-CmqAwdFL.d.ts +1360 -0
- package/dist/core-plugins.d.mts +63 -0
- package/dist/core-plugins.d.ts +63 -0
- package/dist/core-plugins.js +1 -0
- package/dist/core-plugins.mjs +1 -0
- package/dist/core.d.mts +398 -0
- package/dist/core.d.ts +398 -0
- package/dist/core.js +1 -0
- package/dist/core.mjs +1 -0
- package/dist/documentSerializer-BRaaXIHm.d.ts +36 -0
- package/dist/documentSerializer-DgO3A9av.d.mts +36 -0
- package/dist/docx/index.d.mts +1123 -0
- package/dist/docx/index.d.ts +1123 -0
- package/dist/docx/index.js +1 -0
- package/dist/docx/index.mjs +1 -0
- package/dist/docx/parser.d.mts +108 -0
- package/dist/docx/parser.d.ts +108 -0
- package/dist/docx/parser.js +1 -0
- package/dist/docx/parser.mjs +1 -0
- package/dist/docx/rezip.d.mts +312 -0
- package/dist/docx/rezip.d.ts +312 -0
- package/dist/docx/rezip.js +1 -0
- package/dist/docx/rezip.mjs +1 -0
- package/dist/docx/serializer/index.d.mts +125 -0
- package/dist/docx/serializer/index.d.ts +125 -0
- package/dist/docx/serializer/index.js +1 -0
- package/dist/docx/serializer/index.mjs +1 -0
- package/dist/docx/wrapTypes.d.mts +19 -0
- package/dist/docx/wrapTypes.d.ts +19 -0
- package/dist/docx/wrapTypes.js +1 -0
- package/dist/docx/wrapTypes.mjs +1 -0
- package/dist/docxInput-DTbCa48g.d.mts +21 -0
- package/dist/docxInput-DTbCa48g.d.ts +21 -0
- package/dist/executor-DZAMMQ35.js +1 -0
- package/dist/executor-ZCJRLT3Z.mjs +1 -0
- package/dist/findParagraphByParaId-Maw_8M5D.d.mts +28 -0
- package/dist/findParagraphByParaId-Maw_8M5D.d.ts +28 -0
- package/dist/fontLoader-8b4X-AIh.d.mts +283 -0
- package/dist/fontLoader-CK2QLq68.d.ts +283 -0
- package/dist/footnotes-lCH_P3N3.d.mts +78 -0
- package/dist/footnotes-skVvEHvZ.d.ts +78 -0
- package/dist/formatting-BH4hcZiq.d.mts +410 -0
- package/dist/formatting-_OXU8gLB.d.ts +410 -0
- package/dist/headerFooterLayout-72Vz7yp3.d.mts +292 -0
- package/dist/headerFooterLayout-Ca4ESDHF.d.ts +292 -0
- package/dist/headless.d.mts +109 -0
- package/dist/headless.d.ts +109 -0
- package/dist/headless.js +1 -0
- package/dist/headless.mjs +1 -0
- package/dist/layout-bridge/clickToPositionDom.d.mts +56 -0
- package/dist/layout-bridge/clickToPositionDom.d.ts +56 -0
- package/dist/layout-bridge/clickToPositionDom.js +1 -0
- package/dist/layout-bridge/clickToPositionDom.mjs +1 -0
- package/dist/layout-bridge/index.d.mts +462 -0
- package/dist/layout-bridge/index.d.ts +462 -0
- package/dist/layout-bridge/index.js +1 -0
- package/dist/layout-bridge/index.mjs +1 -0
- package/dist/layout-bridge/measuring/index.d.mts +377 -0
- package/dist/layout-bridge/measuring/index.d.ts +377 -0
- package/dist/layout-bridge/measuring/index.js +1 -0
- package/dist/layout-bridge/measuring/index.mjs +1 -0
- package/dist/layout-bridge/tableInsertHover.d.mts +45 -0
- package/dist/layout-bridge/tableInsertHover.d.ts +45 -0
- package/dist/layout-bridge/tableInsertHover.js +1 -0
- package/dist/layout-bridge/tableInsertHover.mjs +1 -0
- package/dist/layout-bridge/toFlowBlocks.d.mts +130 -0
- package/dist/layout-bridge/toFlowBlocks.d.ts +130 -0
- package/dist/layout-bridge/toFlowBlocks.js +1 -0
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -0
- package/dist/layout-engine/index.d.mts +352 -0
- package/dist/layout-engine/index.d.ts +352 -0
- package/dist/layout-engine/index.js +1 -0
- package/dist/layout-engine/index.mjs +1 -0
- package/dist/layout-engine/types.d.mts +943 -0
- package/dist/layout-engine/types.d.ts +943 -0
- package/dist/layout-engine/types.js +1 -0
- package/dist/layout-engine/types.mjs +1 -0
- package/dist/layout-painter/index.d.mts +22 -0
- package/dist/layout-painter/index.d.ts +22 -0
- package/dist/layout-painter/index.js +1 -0
- package/dist/layout-painter/index.mjs +1 -0
- package/dist/layout-painter/renderPage.d.mts +680 -0
- package/dist/layout-painter/renderPage.d.ts +680 -0
- package/dist/layout-painter/renderPage.js +1 -0
- package/dist/layout-painter/renderPage.mjs +1 -0
- package/dist/managers/AutoSaveManager.d.mts +95 -0
- package/dist/managers/AutoSaveManager.d.ts +95 -0
- package/dist/managers/AutoSaveManager.js +1 -0
- package/dist/managers/AutoSaveManager.mjs +1 -0
- package/dist/managers/TableSelectionManager.d.mts +94 -0
- package/dist/managers/TableSelectionManager.d.ts +94 -0
- package/dist/managers/TableSelectionManager.js +1 -0
- package/dist/managers/TableSelectionManager.mjs +1 -0
- package/dist/managers/types.d.mts +121 -0
- package/dist/managers/types.d.ts +121 -0
- package/dist/managers/types.js +1 -0
- package/dist/managers/types.mjs +0 -0
- package/dist/marks-BY573yZn.d.mts +56 -0
- package/dist/marks-CjC9tF5k.d.ts +56 -0
- package/dist/mcp-cli.mjs +138 -0
- package/dist/mcp.d.mts +183 -0
- package/dist/mcp.d.ts +183 -0
- package/dist/mcp.js +16 -0
- package/dist/mcp.mjs +16 -0
- package/dist/nodes-7753Bgi_.d.mts +320 -0
- package/dist/nodes-CC_nwkT_.d.ts +320 -0
- package/dist/plugin-api/RenderedDomContext.d.mts +74 -0
- package/dist/plugin-api/RenderedDomContext.d.ts +74 -0
- package/dist/plugin-api/RenderedDomContext.js +1 -0
- package/dist/plugin-api/RenderedDomContext.mjs +1 -0
- package/dist/plugin-api/index.d.mts +15 -0
- package/dist/plugin-api/index.d.ts +15 -0
- package/dist/plugin-api/index.js +1 -0
- package/dist/plugin-api/index.mjs +0 -0
- package/dist/plugin-api/resolveItemPositions.d.mts +54 -0
- package/dist/plugin-api/resolveItemPositions.d.ts +54 -0
- package/dist/plugin-api/resolveItemPositions.js +1 -0
- package/dist/plugin-api/resolveItemPositions.mjs +1 -0
- package/dist/plugin-api/types.d.mts +190 -0
- package/dist/plugin-api/types.d.ts +190 -0
- package/dist/plugin-api/types.js +1 -0
- package/dist/plugin-api/types.mjs +0 -0
- package/dist/processTemplate-GPFDLQMX.mjs +1 -0
- package/dist/processTemplate-HH2E3HBO.js +1 -0
- package/dist/prosemirror/commands/formatting.d.mts +100 -0
- package/dist/prosemirror/commands/formatting.d.ts +100 -0
- package/dist/prosemirror/commands/formatting.js +1 -0
- package/dist/prosemirror/commands/formatting.mjs +1 -0
- package/dist/prosemirror/commands/index.d.mts +188 -0
- package/dist/prosemirror/commands/index.d.ts +188 -0
- package/dist/prosemirror/commands/index.js +1 -0
- package/dist/prosemirror/commands/index.mjs +1 -0
- package/dist/prosemirror/commands/pageBreak.d.mts +20 -0
- package/dist/prosemirror/commands/pageBreak.d.ts +20 -0
- package/dist/prosemirror/commands/pageBreak.js +1 -0
- package/dist/prosemirror/commands/pageBreak.mjs +1 -0
- package/dist/prosemirror/commands/paragraph.d.mts +70 -0
- package/dist/prosemirror/commands/paragraph.d.ts +70 -0
- package/dist/prosemirror/commands/paragraph.js +1 -0
- package/dist/prosemirror/commands/paragraph.mjs +1 -0
- package/dist/prosemirror/conversion/fromProseDoc.d.mts +65 -0
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +65 -0
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -0
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -0
- package/dist/prosemirror/conversion/index.d.mts +85 -0
- package/dist/prosemirror/conversion/index.d.ts +85 -0
- package/dist/prosemirror/conversion/index.js +1 -0
- package/dist/prosemirror/conversion/index.mjs +1 -0
- package/dist/prosemirror/editor.css +823 -0
- package/dist/prosemirror/extensions/index.d.mts +79 -0
- package/dist/prosemirror/extensions/index.d.ts +79 -0
- package/dist/prosemirror/extensions/index.js +1 -0
- package/dist/prosemirror/extensions/index.mjs +1 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.d.mts +30 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +30 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.mjs +1 -0
- package/dist/prosemirror/index.d.mts +70 -0
- package/dist/prosemirror/index.d.ts +70 -0
- package/dist/prosemirror/index.js +1 -0
- package/dist/prosemirror/index.mjs +1 -0
- package/dist/prosemirror/plugins/index.d.mts +154 -0
- package/dist/prosemirror/plugins/index.d.ts +154 -0
- package/dist/prosemirror/plugins/index.js +1 -0
- package/dist/prosemirror/plugins/index.mjs +1 -0
- package/dist/prosemirror/plugins/selectionTracker.d.mts +78 -0
- package/dist/prosemirror/plugins/selectionTracker.d.ts +78 -0
- package/dist/prosemirror/plugins/selectionTracker.js +1 -0
- package/dist/prosemirror/plugins/selectionTracker.mjs +1 -0
- package/dist/prosemirror/schema/index.d.mts +29 -0
- package/dist/prosemirror/schema/index.d.ts +29 -0
- package/dist/prosemirror/schema/index.js +1 -0
- package/dist/prosemirror/schema/index.mjs +1 -0
- package/dist/prosemirror/styles/index.d.mts +124 -0
- package/dist/prosemirror/styles/index.d.ts +124 -0
- package/dist/prosemirror/styles/index.js +1 -0
- package/dist/prosemirror/styles/index.mjs +1 -0
- package/dist/prosemirror/template/prosemirror-plugin.d.mts +66 -0
- package/dist/prosemirror/template/prosemirror-plugin.d.ts +66 -0
- package/dist/prosemirror/template/prosemirror-plugin.js +15 -0
- package/dist/prosemirror/template/prosemirror-plugin.mjs +15 -0
- package/dist/prosemirror/utils/ClickPositionResolver.d.mts +109 -0
- package/dist/prosemirror/utils/ClickPositionResolver.d.ts +109 -0
- package/dist/prosemirror/utils/ClickPositionResolver.js +1 -0
- package/dist/prosemirror/utils/ClickPositionResolver.mjs +1 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.d.mts +81 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.d.ts +81 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.js +1 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.mjs +1 -0
- package/dist/prosemirror/utils/PointerEventHandler.d.mts +94 -0
- package/dist/prosemirror/utils/PointerEventHandler.d.ts +94 -0
- package/dist/prosemirror/utils/PointerEventHandler.js +1 -0
- package/dist/prosemirror/utils/PointerEventHandler.mjs +1 -0
- package/dist/prosemirror/utils/extractTrackedChanges.d.mts +85 -0
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +85 -0
- package/dist/prosemirror/utils/extractTrackedChanges.js +1 -0
- package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -0
- package/dist/prosemirror/utils/visualLineNavigation.d.mts +45 -0
- package/dist/prosemirror/utils/visualLineNavigation.d.ts +45 -0
- package/dist/prosemirror/utils/visualLineNavigation.js +1 -0
- package/dist/prosemirror/utils/visualLineNavigation.mjs +1 -0
- package/dist/registry-Cpyybgij.d.mts +165 -0
- package/dist/registry-E5pahPKL.d.ts +165 -0
- package/dist/selectionContext-BPAqgNgk.d.ts +570 -0
- package/dist/selectionContext-CoZat7QZ.d.mts +570 -0
- package/dist/selectiveSave-CWaPEv0B.d.ts +31 -0
- package/dist/selectiveSave-jinP_4xa.d.mts +31 -0
- package/dist/selectiveXmlPatch-ypkxlTD_.d.mts +23 -0
- package/dist/selectiveXmlPatch-ypkxlTD_.d.ts +23 -0
- package/dist/styles-BBv7doYK.d.ts +233 -0
- package/dist/styles-EI2lxeEN.d.mts +233 -0
- package/dist/table-P8esKWAc.d.ts +82 -0
- package/dist/table-_t_W8oQf.d.mts +82 -0
- package/dist/types/agentApi.d.mts +467 -0
- package/dist/types/agentApi.d.ts +467 -0
- package/dist/types/agentApi.js +1 -0
- package/dist/types/agentApi.mjs +1 -0
- package/dist/types/content.d.mts +18 -0
- package/dist/types/content.d.ts +18 -0
- package/dist/types/content.js +1 -0
- package/dist/types/content.mjs +0 -0
- package/dist/types/document.d.mts +123 -0
- package/dist/types/document.d.ts +123 -0
- package/dist/types/document.js +1 -0
- package/dist/types/document.mjs +0 -0
- package/dist/types-DXG7vqe9.d.ts +311 -0
- package/dist/types-RchZmPFN.d.mts +137 -0
- package/dist/types-RchZmPFN.d.ts +137 -0
- package/dist/types-dYdjUZMo.d.mts +311 -0
- package/dist/utils/cardStyles.d.mts +31 -0
- package/dist/utils/cardStyles.d.ts +31 -0
- package/dist/utils/cardStyles.js +1 -0
- package/dist/utils/cardStyles.mjs +1 -0
- package/dist/utils/comments.d.mts +121 -0
- package/dist/utils/comments.d.ts +121 -0
- package/dist/utils/comments.js +1 -0
- package/dist/utils/comments.mjs +1 -0
- package/dist/utils/findReplace.d.mts +114 -0
- package/dist/utils/findReplace.d.ts +114 -0
- package/dist/utils/findReplace.js +2 -0
- package/dist/utils/findReplace.mjs +2 -0
- package/dist/utils/findVerticalScrollParent.d.mts +25 -0
- package/dist/utils/findVerticalScrollParent.d.ts +25 -0
- package/dist/utils/findVerticalScrollParent.js +1 -0
- package/dist/utils/findVerticalScrollParent.mjs +1 -0
- package/dist/utils/fontOptions.d.mts +21 -0
- package/dist/utils/fontOptions.d.ts +21 -0
- package/dist/utils/fontOptions.js +1 -0
- package/dist/utils/fontOptions.mjs +1 -0
- package/dist/utils/headingCollector.d.mts +32 -0
- package/dist/utils/headingCollector.d.ts +32 -0
- package/dist/utils/headingCollector.js +1 -0
- package/dist/utils/headingCollector.mjs +1 -0
- package/dist/utils/highlightColors.d.mts +14 -0
- package/dist/utils/highlightColors.d.ts +14 -0
- package/dist/utils/highlightColors.js +1 -0
- package/dist/utils/highlightColors.mjs +1 -0
- package/dist/utils/index.d.mts +710 -0
- package/dist/utils/index.d.ts +710 -0
- package/dist/utils/index.js +82 -0
- package/dist/utils/index.mjs +82 -0
- package/dist/utils/listState.d.mts +27 -0
- package/dist/utils/listState.d.ts +27 -0
- package/dist/utils/listState.js +1 -0
- package/dist/utils/listState.mjs +1 -0
- package/dist/utils/reportIssue.d.mts +23 -0
- package/dist/utils/reportIssue.d.ts +23 -0
- package/dist/utils/reportIssue.js +2 -0
- package/dist/utils/reportIssue.mjs +2 -0
- package/dist/utils/sidebarConstants.d.mts +10 -0
- package/dist/utils/sidebarConstants.d.ts +10 -0
- package/dist/utils/sidebarConstants.js +1 -0
- package/dist/utils/sidebarConstants.mjs +1 -0
- package/dist/utils/textSelection.d.mts +92 -0
- package/dist/utils/textSelection.d.ts +92 -0
- package/dist/utils/textSelection.js +1 -0
- package/dist/utils/textSelection.mjs +1 -0
- package/dist/utils/units.d.mts +91 -0
- package/dist/utils/units.d.ts +91 -0
- package/dist/utils/units.js +1 -0
- package/dist/utils/units.mjs +1 -0
- package/dist/variableDetector-DF3-nxUC.d.mts +115 -0
- package/dist/variableDetector-sBkgVh3f.d.ts +115 -0
- package/package.json +565 -0
|
@@ -0,0 +1,680 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page Renderer
|
|
3
|
+
*
|
|
4
|
+
* Renders a single page from Layout data to DOM elements.
|
|
5
|
+
* Each page contains positioned fragments within a content area.
|
|
6
|
+
*
|
|
7
|
+
* This file owns the single-page orchestrator (`renderPage`) plus page-level
|
|
8
|
+
* styling (background, borders, content area) and floating-image extraction
|
|
9
|
+
* from paragraphs. Header/footer rendering lives in ./renderPage/headerFooter.ts,
|
|
10
|
+
* footnote area rendering in ./renderPage/footnotes.ts, and the multi-page
|
|
11
|
+
* virtualization / IntersectionObserver layer in ./renderPage/virtualization.ts.
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
import { ImageRun, Page, ParagraphBlock, MeasuredLine, TabStop, Run, ParagraphFragment, ParagraphMeasure, ParagraphBorders, Fragment, TableFragment, TableBlock, TableMeasure, ImageFragment, ImageBlock, ImageMeasure, TextBoxFragment, TextBoxBlock, TextBoxMeasure, FlowBlock, Measure, Layout } from '../layout-engine/types.mjs';
|
|
16
|
+
import { I as ImageAttrs } from '../nodes-7753Bgi_.mjs';
|
|
17
|
+
import { I as ImageLayoutTarget } from '../ImageExtension-BN327PNe.mjs';
|
|
18
|
+
import { WrapType } from '../docx/wrapTypes.mjs';
|
|
19
|
+
import { F as FootnoteRenderItem, H as HeaderFooterContent } from '../footnotes-lCH_P3N3.mjs';
|
|
20
|
+
export { a as HeaderFooterLayoutInfo, r as resolveHeaderFooterFloatingTablePosition } from '../footnotes-lCH_P3N3.mjs';
|
|
21
|
+
import { B as BorderSpec } from '../colors-C3vA7HUU.mjs';
|
|
22
|
+
import { T as Theme } from '../styles-EI2lxeEN.mjs';
|
|
23
|
+
import '../content-5Mrz6w_b.mjs';
|
|
24
|
+
import '../formatting-BH4hcZiq.mjs';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Whether a floating image record reserves space in the text-wrap calculation.
|
|
28
|
+
* Records reaching this predicate have already passed `isFloatingImageRun`, so
|
|
29
|
+
* `wrapType=undefined` implies a `cssFloat`-driven float that wraps text.
|
|
30
|
+
*/
|
|
31
|
+
declare function floatingImageWrapsText(img: {
|
|
32
|
+
wrapType?: string;
|
|
33
|
+
}): boolean;
|
|
34
|
+
declare function floatingImageIsBehindDoc(img: {
|
|
35
|
+
wrapType?: string;
|
|
36
|
+
}): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Check if an image run is a floating image positioned at page/cell level.
|
|
39
|
+
*/
|
|
40
|
+
declare function isFloatingImageRun(run: ImageRun): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Check if a floating image should create text wrapping exclusion zones.
|
|
43
|
+
* wrapNone images (`behind` / `inFront`) are positioned floats but do not
|
|
44
|
+
* shrink line widths; text paints over or under them.
|
|
45
|
+
*/
|
|
46
|
+
declare function isTextWrappingFloatingImageRun(run: ImageRun): boolean;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Minimum fields the floating-image painter needs. Page-level and cell-level
|
|
50
|
+
* float records both satisfy this shape.
|
|
51
|
+
*/
|
|
52
|
+
interface FloatingImagePaintRecord {
|
|
53
|
+
src: string;
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
56
|
+
alt?: string;
|
|
57
|
+
transform?: string;
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
pmStart?: number;
|
|
61
|
+
pmEnd?: number;
|
|
62
|
+
/** wp:srcRect crop fractions in [0, 1]. */
|
|
63
|
+
cropTop?: number;
|
|
64
|
+
cropRight?: number;
|
|
65
|
+
cropBottom?: number;
|
|
66
|
+
cropLeft?: number;
|
|
67
|
+
/** a:alphaModFix -> CSS opacity. */
|
|
68
|
+
opacity?: number;
|
|
69
|
+
}
|
|
70
|
+
interface FloatingImagesLayerOptions {
|
|
71
|
+
layerClass: string;
|
|
72
|
+
itemClass: string;
|
|
73
|
+
/**
|
|
74
|
+
* `inset0` sizes the layer with `top/right/bottom/left = 0` (used at page level).
|
|
75
|
+
* `fullSize` uses `width/height = 100%` and adds `overflow: hidden` (used inside table cells).
|
|
76
|
+
*/
|
|
77
|
+
sizing: 'inset0' | 'fullSize';
|
|
78
|
+
/** `behind` skips z-index so DOM order keeps the layer below body fragments. */
|
|
79
|
+
layerMode: 'front' | 'behind';
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Render a layer of positioned floating images. Used at both page level and
|
|
83
|
+
* inside table cells; the variant differs only in class names and sizing.
|
|
84
|
+
*/
|
|
85
|
+
declare function renderFloatingImagesLayer(floatingImages: FloatingImagePaintRecord[], doc: Document, options: FloatingImagesLayerOptions): HTMLElement;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Multi-page rendering with virtualization.
|
|
89
|
+
*
|
|
90
|
+
* For documents under VIRTUALIZATION_THRESHOLD pages, all pages render
|
|
91
|
+
* eagerly. Larger documents render only pages near the viewport — off-screen
|
|
92
|
+
* pages are lightweight shells (correct dimensions, no fragment content) so
|
|
93
|
+
* scroll position is preserved. An IntersectionObserver populates and clears
|
|
94
|
+
* page content as the user scrolls. Incremental updates (re-rendering only
|
|
95
|
+
* fingerprint-changed pages) avoid blink when the document model shifts.
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
type RenderPagesUpdateKind = 'incremental' | 'full';
|
|
99
|
+
/**
|
|
100
|
+
* Render multiple pages to a container with virtualization for large documents.
|
|
101
|
+
*
|
|
102
|
+
* For documents with fewer than VIRTUALIZATION_THRESHOLD pages, all pages
|
|
103
|
+
* are rendered eagerly. For larger documents, only pages near the visible
|
|
104
|
+
* viewport are fully rendered — off-screen pages are lightweight shells
|
|
105
|
+
* with correct dimensions to preserve scroll position.
|
|
106
|
+
*
|
|
107
|
+
* An IntersectionObserver watches page elements and populates/clears
|
|
108
|
+
* content as pages scroll into and out of view.
|
|
109
|
+
*/
|
|
110
|
+
declare function renderPages(pages: Page[], container: HTMLElement, options?: RenderPageOptions & {
|
|
111
|
+
pageGap?: number;
|
|
112
|
+
footnotesByPage?: Map<number, FootnoteRenderItem[]>;
|
|
113
|
+
}): RenderPagesUpdateKind;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Page Renderer
|
|
117
|
+
*
|
|
118
|
+
* Renders a single page from Layout data to DOM elements.
|
|
119
|
+
* Each page contains positioned fragments within a content area.
|
|
120
|
+
*
|
|
121
|
+
* This file owns the single-page orchestrator (`renderPage`) plus page-level
|
|
122
|
+
* styling (background, borders, content area) and floating-image extraction
|
|
123
|
+
* from paragraphs. Header/footer rendering lives in ./renderPage/headerFooter.ts,
|
|
124
|
+
* footnote area rendering in ./renderPage/footnotes.ts, and the multi-page
|
|
125
|
+
* virtualization / IntersectionObserver layer in ./renderPage/virtualization.ts.
|
|
126
|
+
* @packageDocumentation
|
|
127
|
+
* @public
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* CSS class names for page elements
|
|
132
|
+
*/
|
|
133
|
+
declare const PAGE_CLASS_NAMES: {
|
|
134
|
+
page: string;
|
|
135
|
+
content: string;
|
|
136
|
+
header: string;
|
|
137
|
+
footer: string;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Context passed to fragment renderers
|
|
141
|
+
*/
|
|
142
|
+
interface RenderContext {
|
|
143
|
+
/** Current page number (1-indexed) */
|
|
144
|
+
pageNumber: number;
|
|
145
|
+
/** Total number of pages */
|
|
146
|
+
totalPages: number;
|
|
147
|
+
/** Which section is being rendered */
|
|
148
|
+
section: 'body' | 'header' | 'footer';
|
|
149
|
+
/** Content width in pixels (page width minus margins) - used for justify */
|
|
150
|
+
contentWidth?: number;
|
|
151
|
+
/** When true, floating images render in-flow instead of being skipped (for table cells) */
|
|
152
|
+
insideTableCell?: boolean;
|
|
153
|
+
/** Comment IDs that are resolved — skip highlight for these */
|
|
154
|
+
resolvedCommentIds?: Set<number>;
|
|
155
|
+
/**
|
|
156
|
+
* How the renderer should position its outer element. The body lays
|
|
157
|
+
* fragments at absolute (x, y) on the page (`'absolute'`, the default),
|
|
158
|
+
* while headers/footers and text boxes flow blocks vertically and let
|
|
159
|
+
* normal document flow handle placement (`'flow'`). The caller passes
|
|
160
|
+
* 'flow' instead of overwriting the renderer's inline styles after the
|
|
161
|
+
* fact (#379).
|
|
162
|
+
*/
|
|
163
|
+
positioning?: 'absolute' | 'flow';
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Options for rendering a page
|
|
167
|
+
*/
|
|
168
|
+
interface RenderPageOptions {
|
|
169
|
+
/** Document to create elements in (default: window.document) */
|
|
170
|
+
document?: Document;
|
|
171
|
+
/** Custom page class name */
|
|
172
|
+
pageClassName?: string;
|
|
173
|
+
/** Show page borders (for debugging) */
|
|
174
|
+
showBorders?: boolean;
|
|
175
|
+
/** Background color for pages */
|
|
176
|
+
backgroundColor?: string;
|
|
177
|
+
/** Drop shadow on pages */
|
|
178
|
+
showShadow?: boolean;
|
|
179
|
+
/** Header content to render (used for all pages, or pages 2+ when titlePg is set). */
|
|
180
|
+
headerContent?: HeaderFooterContent;
|
|
181
|
+
/** Footer content to render (used for all pages, or pages 2+ when titlePg is set). */
|
|
182
|
+
footerContent?: HeaderFooterContent;
|
|
183
|
+
/** Header content for the first page only (when titlePg is set). */
|
|
184
|
+
firstPageHeaderContent?: HeaderFooterContent;
|
|
185
|
+
/** Footer content for the first page only (when titlePg is set). */
|
|
186
|
+
firstPageFooterContent?: HeaderFooterContent;
|
|
187
|
+
/** Whether different first page headers/footers are enabled (w:titlePg). */
|
|
188
|
+
titlePg?: boolean;
|
|
189
|
+
/** Distance from page top to header content. */
|
|
190
|
+
headerDistance?: number;
|
|
191
|
+
/** Distance from page bottom to footer content. */
|
|
192
|
+
footerDistance?: number;
|
|
193
|
+
/** Block lookup for rendering actual content. */
|
|
194
|
+
blockLookup?: BlockLookup;
|
|
195
|
+
/** OOXML page borders from section properties. */
|
|
196
|
+
pageBorders?: {
|
|
197
|
+
top?: BorderSpec;
|
|
198
|
+
bottom?: BorderSpec;
|
|
199
|
+
left?: BorderSpec;
|
|
200
|
+
right?: BorderSpec;
|
|
201
|
+
display?: 'allPages' | 'firstPage' | 'notFirstPage';
|
|
202
|
+
offsetFrom?: 'page' | 'text';
|
|
203
|
+
zOrder?: 'front' | 'back';
|
|
204
|
+
};
|
|
205
|
+
/** Theme for resolving border colors. */
|
|
206
|
+
theme?: Theme | null;
|
|
207
|
+
/** Footnotes to render at the bottom of this page. */
|
|
208
|
+
footnoteArea?: FootnoteRenderItem[];
|
|
209
|
+
/** Comment IDs that are resolved — skip highlight for these */
|
|
210
|
+
resolvedCommentIds?: Set<number>;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Apply page styles to an element. Exported because virtualization.ts uses it
|
|
214
|
+
* to size lightweight shells before content lands in them.
|
|
215
|
+
*/
|
|
216
|
+
declare function applyPageStyles(element: HTMLElement, width: number, height: number, options: RenderPageOptions): void;
|
|
217
|
+
/**
|
|
218
|
+
* Render a single page to DOM
|
|
219
|
+
*
|
|
220
|
+
* @param page - The page to render
|
|
221
|
+
* @param context - Rendering context
|
|
222
|
+
* @param options - Rendering options
|
|
223
|
+
* @returns The page DOM element
|
|
224
|
+
*/
|
|
225
|
+
declare function renderPage(page: Page, context: RenderContext, options?: RenderPageOptions): HTMLElement;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Line-level rendering.
|
|
229
|
+
*
|
|
230
|
+
* Owns `renderLine` and its helpers: slicing the paragraph's runs to the
|
|
231
|
+
* line's character range, justify decisions, per-line floating margins,
|
|
232
|
+
* tab-width calculation through the tabCalculator (explicit stops + default
|
|
233
|
+
* intervals), inline image dedup, and field-value substitution width math.
|
|
234
|
+
*/
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Slice runs for a specific line
|
|
238
|
+
*
|
|
239
|
+
* @param block - The paragraph block
|
|
240
|
+
* @param line - The line measurement
|
|
241
|
+
* @returns Array of runs for this line
|
|
242
|
+
*/
|
|
243
|
+
declare function sliceRunsForLine(block: ParagraphBlock, line: MeasuredLine): Run[];
|
|
244
|
+
/**
|
|
245
|
+
* Options for rendering a line with justify support
|
|
246
|
+
*/
|
|
247
|
+
interface RenderLineOptions {
|
|
248
|
+
/** Available width for the line (content area width minus indentation) */
|
|
249
|
+
availableWidth: number;
|
|
250
|
+
/** Whether this is the last line of the paragraph */
|
|
251
|
+
isLastLine: boolean;
|
|
252
|
+
/** Whether this is the first line of the paragraph */
|
|
253
|
+
isFirstLine: boolean;
|
|
254
|
+
/** Whether the paragraph ends with a line break */
|
|
255
|
+
paragraphEndsWithLineBreak: boolean;
|
|
256
|
+
/** Tab stops from paragraph attributes */
|
|
257
|
+
tabStops?: TabStop[];
|
|
258
|
+
/** Render context for field substitution */
|
|
259
|
+
context?: RenderContext;
|
|
260
|
+
/** Left indent in pixels */
|
|
261
|
+
leftIndentPx?: number;
|
|
262
|
+
/** First line indent in pixels (positive) or hanging indent (negative) */
|
|
263
|
+
firstLineIndentPx?: number;
|
|
264
|
+
/** Line-specific floating image margins (calculated per-line based on Y overlap) */
|
|
265
|
+
floatingMargins?: {
|
|
266
|
+
leftMargin: number;
|
|
267
|
+
rightMargin: number;
|
|
268
|
+
};
|
|
269
|
+
/** Track inline image runs already rendered in this paragraph fragment to prevent duplicates */
|
|
270
|
+
renderedInlineImageKeys?: Set<string>;
|
|
271
|
+
/**
|
|
272
|
+
* Rightmost x where inline content may render, in content-area coords. Used
|
|
273
|
+
* by the right-tab anchor; passed in directly (rather than recomposed from
|
|
274
|
+
* `leftIndentPx + availableWidth`) because `availableWidth` excludes the
|
|
275
|
+
* hung-out region for some inputs and would drift.
|
|
276
|
+
*/
|
|
277
|
+
lineRightEdgePx?: number;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Render a single line
|
|
281
|
+
*
|
|
282
|
+
* @param block - The paragraph block
|
|
283
|
+
* @param line - The line measurement
|
|
284
|
+
* @param alignment - Text alignment
|
|
285
|
+
* @param doc - Document to create elements in
|
|
286
|
+
* @param options - Additional options for justify calculation
|
|
287
|
+
* @returns The line DOM element
|
|
288
|
+
*/
|
|
289
|
+
declare function renderLine(block: ParagraphBlock, line: MeasuredLine, alignment: 'left' | 'center' | 'right' | 'justify' | undefined, doc: Document, options?: RenderLineOptions): HTMLElement;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Paragraph Fragment Renderer
|
|
293
|
+
*
|
|
294
|
+
* Renders paragraph fragments with lines and text runs to DOM.
|
|
295
|
+
* Handles text formatting, alignment, and positioning.
|
|
296
|
+
*
|
|
297
|
+
* This file owns `renderParagraphFragment` (the orchestrator), the
|
|
298
|
+
* border-grouping helpers, and the list-marker renderer. Per-run rendering
|
|
299
|
+
* (text/tab/image/break/field) lives in ./renderParagraph/runs.ts and the
|
|
300
|
+
* line-level walker is in ./renderParagraph/line.ts. The shared class-name
|
|
301
|
+
* constants and run-type guards are in ./renderParagraph/shared.ts.
|
|
302
|
+
*/
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Options for rendering a paragraph
|
|
306
|
+
*/
|
|
307
|
+
interface RenderParagraphOptions {
|
|
308
|
+
/** Document to create elements in */
|
|
309
|
+
document?: Document;
|
|
310
|
+
/** Fragment's Y position relative to content area (for per-line margin calculation) */
|
|
311
|
+
fragmentContentY?: number;
|
|
312
|
+
/** Borders from the previous adjacent paragraph (for border grouping) */
|
|
313
|
+
prevBorders?: ParagraphBorders;
|
|
314
|
+
/** Borders from the next adjacent paragraph (for border grouping) */
|
|
315
|
+
nextBorders?: ParagraphBorders;
|
|
316
|
+
/** Inline image runs already rendered for this paragraph block */
|
|
317
|
+
renderedInlineImageKeys?: Set<string>;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Render a paragraph fragment
|
|
321
|
+
*
|
|
322
|
+
* @param fragment - The fragment to render
|
|
323
|
+
* @param block - The paragraph block
|
|
324
|
+
* @param measure - The paragraph measurement
|
|
325
|
+
* @param context - Rendering context
|
|
326
|
+
* @param options - Rendering options
|
|
327
|
+
* @returns The fragment DOM element
|
|
328
|
+
*/
|
|
329
|
+
declare function renderParagraphFragment(fragment: ParagraphFragment, block: ParagraphBlock, measure: ParagraphMeasure, context: RenderContext, options?: RenderParagraphOptions): HTMLElement;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Fragment Renderer
|
|
333
|
+
*
|
|
334
|
+
* Renders individual fragments (paragraphs, tables, images) to DOM.
|
|
335
|
+
* Each fragment is positioned within a page's content area.
|
|
336
|
+
*/
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* CSS class names for fragment elements
|
|
340
|
+
*/
|
|
341
|
+
declare const FRAGMENT_CLASS_NAMES: {
|
|
342
|
+
fragment: string;
|
|
343
|
+
paragraph: string;
|
|
344
|
+
table: string;
|
|
345
|
+
image: string;
|
|
346
|
+
line: string;
|
|
347
|
+
run: string;
|
|
348
|
+
};
|
|
349
|
+
/**
|
|
350
|
+
* Options for rendering fragments
|
|
351
|
+
*/
|
|
352
|
+
interface RenderFragmentOptions {
|
|
353
|
+
/** Document to create elements in */
|
|
354
|
+
document?: Document;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Render a fragment to DOM
|
|
358
|
+
*
|
|
359
|
+
* @param fragment - The fragment to render
|
|
360
|
+
* @param context - Rendering context
|
|
361
|
+
* @param options - Rendering options
|
|
362
|
+
* @returns The fragment DOM element
|
|
363
|
+
*/
|
|
364
|
+
declare function renderFragment(fragment: Fragment, context: RenderContext, options?: RenderFragmentOptions): HTMLElement;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Table Renderer
|
|
368
|
+
*
|
|
369
|
+
* Renders table fragments to DOM. Handles:
|
|
370
|
+
* - Multi-row tables split across pages
|
|
371
|
+
* - Cell content (paragraphs within cells)
|
|
372
|
+
* - Column widths and cell spans
|
|
373
|
+
* - Basic cell styling (borders, backgrounds)
|
|
374
|
+
*/
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* CSS class names for table elements
|
|
378
|
+
*/
|
|
379
|
+
declare const TABLE_CLASS_NAMES: {
|
|
380
|
+
table: string;
|
|
381
|
+
row: string;
|
|
382
|
+
cell: string;
|
|
383
|
+
cellContent: string;
|
|
384
|
+
resizeHandle: string;
|
|
385
|
+
rowResizeHandle: string;
|
|
386
|
+
tableEdgeHandleBottom: string;
|
|
387
|
+
tableEdgeHandleRight: string;
|
|
388
|
+
};
|
|
389
|
+
/**
|
|
390
|
+
* Options for rendering a table fragment
|
|
391
|
+
*/
|
|
392
|
+
interface RenderTableFragmentOptions {
|
|
393
|
+
document?: Document;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Render a table fragment to DOM
|
|
397
|
+
*
|
|
398
|
+
* @param fragment - The table fragment to render
|
|
399
|
+
* @param block - The full table block
|
|
400
|
+
* @param measure - The full table measure
|
|
401
|
+
* @param context - Rendering context
|
|
402
|
+
* @param options - Rendering options
|
|
403
|
+
* @returns The table DOM element
|
|
404
|
+
*/
|
|
405
|
+
declare function renderTableFragment(fragment: TableFragment, block: TableBlock, measure: TableMeasure, context: RenderContext, options?: RenderTableFragmentOptions): HTMLElement;
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Image Renderer
|
|
409
|
+
*
|
|
410
|
+
* Renders image fragments to DOM. Handles:
|
|
411
|
+
* - Inline images
|
|
412
|
+
* - Anchored/floating images with z-index layering
|
|
413
|
+
* - Basic image sizing
|
|
414
|
+
*/
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* CSS class names for image elements
|
|
418
|
+
*/
|
|
419
|
+
declare const IMAGE_CLASS_NAMES: {
|
|
420
|
+
image: string;
|
|
421
|
+
imageAnchored: string;
|
|
422
|
+
};
|
|
423
|
+
/**
|
|
424
|
+
* Options for rendering an image fragment
|
|
425
|
+
*/
|
|
426
|
+
interface RenderImageFragmentOptions {
|
|
427
|
+
document?: Document;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Render an image fragment to DOM
|
|
431
|
+
*
|
|
432
|
+
* @param fragment - The image fragment to render
|
|
433
|
+
* @param block - The full image block
|
|
434
|
+
* @param measure - The image measure
|
|
435
|
+
* @param context - Rendering context
|
|
436
|
+
* @param options - Rendering options
|
|
437
|
+
* @returns The image DOM element
|
|
438
|
+
*/
|
|
439
|
+
declare function renderImageFragment(fragment: ImageFragment, block: ImageBlock, _measure: ImageMeasure, _context: RenderContext, options?: RenderImageFragmentOptions): HTMLElement;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Text Box Renderer
|
|
443
|
+
*
|
|
444
|
+
* Renders text box fragments to DOM. Handles:
|
|
445
|
+
* - Background fill color
|
|
446
|
+
* - Border/outline
|
|
447
|
+
* - Internal padding (margins)
|
|
448
|
+
* - Paragraph content inside the box (using pre-measured data)
|
|
449
|
+
*/
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* CSS class names for text box elements
|
|
453
|
+
*/
|
|
454
|
+
declare const TEXTBOX_CLASS_NAMES: {
|
|
455
|
+
textBox: string;
|
|
456
|
+
};
|
|
457
|
+
/**
|
|
458
|
+
* Options for rendering a text box fragment
|
|
459
|
+
*/
|
|
460
|
+
interface RenderTextBoxFragmentOptions {
|
|
461
|
+
document?: Document;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Render a text box fragment to DOM
|
|
465
|
+
*/
|
|
466
|
+
declare function renderTextBoxFragment(fragment: TextBoxFragment, block: TextBoxBlock, measure: TextBoxMeasure, context: RenderContext, options?: RenderTextBoxFragmentOptions): HTMLElement;
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Image layout helpers shared between framework adapters (React, Vue, ...).
|
|
470
|
+
*
|
|
471
|
+
* Everything here is framework-agnostic: pure DOM math + pure functions over
|
|
472
|
+
* OOXML wrap-type vocabulary. The corresponding UI bindings (right-click menu,
|
|
473
|
+
* toolbar dropdown) live in each framework adapter and call into these.
|
|
474
|
+
*/
|
|
475
|
+
|
|
476
|
+
declare const LAYOUT_IMAGE_CLASSES: {
|
|
477
|
+
/** Inline image rendered inside `.layout-line`. */
|
|
478
|
+
readonly runImage: "layout-run-image";
|
|
479
|
+
/** Block (centered, topAndBottom) image. */
|
|
480
|
+
readonly blockImage: "layout-block-image";
|
|
481
|
+
/** Anchored image rendered in the page-level floating layer. */
|
|
482
|
+
readonly pageFloatingImage: "layout-page-floating-image";
|
|
483
|
+
/** Anchored image rendered inside a table cell's floating layer. */
|
|
484
|
+
readonly cellFloatingImage: "layout-cell-floating-image";
|
|
485
|
+
readonly pageContent: "layout-page-content";
|
|
486
|
+
readonly paragraph: "layout-paragraph";
|
|
487
|
+
};
|
|
488
|
+
interface ImageHitTestResult {
|
|
489
|
+
/** PM doc position of the image node, read from `data-pm-start`. */
|
|
490
|
+
pos: number;
|
|
491
|
+
/** The matched element — pass to `captureInlinePositionEmu` if it's inline. */
|
|
492
|
+
imageEl: HTMLElement;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Walk up from an event target looking for any rendered image element. Returns
|
|
496
|
+
* the PM position embedded in `data-pm-start`, or null if the target isn't on
|
|
497
|
+
* an image.
|
|
498
|
+
*/
|
|
499
|
+
declare function hitTestImage(target: EventTarget | null): ImageHitTestResult | null;
|
|
500
|
+
/**
|
|
501
|
+
* Walk up from a click target to the nearest rendered image element, returning
|
|
502
|
+
* just the element (no PM position parsing). Used by the left-click selection
|
|
503
|
+
* path in both adapters — `data-pm-start` is read separately by callers that
|
|
504
|
+
* need the position. Returns the element when the click was directly on an
|
|
505
|
+
* inline `<img.layout-run-image>` OR inside one of the container classes
|
|
506
|
+
* registered in `LAYOUT_IMAGE_CLASSES`.
|
|
507
|
+
*/
|
|
508
|
+
declare function findImageElement(target: EventTarget | null): HTMLElement | null;
|
|
509
|
+
/**
|
|
510
|
+
* Capture the rendered position of an inline image as EMUs, normalised to
|
|
511
|
+
* unzoomed coordinates. Returns horizontal offset relative to the page
|
|
512
|
+
* content area (column origin) and vertical offset relative to the
|
|
513
|
+
* containing paragraph — matches the OOXML attrs the resolver writes
|
|
514
|
+
* (`relativeFrom: 'column'` / `relativeFrom: 'paragraph'`).
|
|
515
|
+
*
|
|
516
|
+
* `zoom` defaults to 1; pass the editor's current zoom factor when the
|
|
517
|
+
* pages container has a CSS scale applied so `getBoundingClientRect` deltas
|
|
518
|
+
* are converted back to authored-pixel space before going to EMU.
|
|
519
|
+
*
|
|
520
|
+
* Returns undefined for non-inline images or detached DOM.
|
|
521
|
+
*/
|
|
522
|
+
declare function captureInlinePositionEmu(imageEl: HTMLElement, zoom?: number): {
|
|
523
|
+
horizontalEmu: number;
|
|
524
|
+
verticalEmu: number;
|
|
525
|
+
} | undefined;
|
|
526
|
+
/**
|
|
527
|
+
* Map an image's current OOXML attrs onto the menu's choice vocabulary so the
|
|
528
|
+
* menu can highlight the active option. Returns null for `topAndBottom` and
|
|
529
|
+
* any unknown wrap type — those don't have a directional menu entry.
|
|
530
|
+
*
|
|
531
|
+
* `cssFloat` accepts both `null` and `undefined` so framework adapters can
|
|
532
|
+
* use either as their "unset" sentinel without an extra normalisation step.
|
|
533
|
+
*/
|
|
534
|
+
declare function deriveLayoutChoice(wrapType: WrapType, cssFloat?: ImageAttrs['cssFloat'] | null): ImageLayoutTarget | null;
|
|
535
|
+
/**
|
|
536
|
+
* Hint to the framework's icon registry for which Material Symbol — or
|
|
537
|
+
* equivalent — to render alongside each option. Bindings own the icon
|
|
538
|
+
* component itself.
|
|
539
|
+
*/
|
|
540
|
+
type ImageLayoutIconHint = 'inline' | 'squareLeft' | 'squareRight' | 'behind' | 'inFront';
|
|
541
|
+
interface ImageLayoutOptionDef {
|
|
542
|
+
/** Choice value — what gets dispatched on click. */
|
|
543
|
+
choice: ImageLayoutTarget;
|
|
544
|
+
/** i18n key under `imageWrap.menu.*`. */
|
|
545
|
+
i18nLabelKey: string;
|
|
546
|
+
/** i18n key under `imageWrap.menuDesc.*`. */
|
|
547
|
+
i18nDescKey: string;
|
|
548
|
+
/** Hint for the framework's icon registry. */
|
|
549
|
+
iconHint: ImageLayoutIconHint;
|
|
550
|
+
}
|
|
551
|
+
/** Mirrors Word's Wrap Text menu — five directional options. */
|
|
552
|
+
declare const IMAGE_LAYOUT_OPTIONS: readonly ImageLayoutOptionDef[];
|
|
553
|
+
/**
|
|
554
|
+
* Whether a given option is enabled for an image with the given current wrap
|
|
555
|
+
* type. Every option stays clickable — picking the option that matches the
|
|
556
|
+
* current state is a no-op (the PM command early-returns), which matches
|
|
557
|
+
* Word's behavior. We don't grey out the current option, so the menu reads
|
|
558
|
+
* consistently regardless of whether the image is inline or anchored.
|
|
559
|
+
*
|
|
560
|
+
* The flag is kept around for forward-compatibility (e.g. future read-only
|
|
561
|
+
* mode), but currently always returns true.
|
|
562
|
+
*/
|
|
563
|
+
declare function isImageLayoutOptionEnabled(_option: ImageLayoutOptionDef, _currentWrapType: WrapType): boolean;
|
|
564
|
+
/**
|
|
565
|
+
* Translate the legacy toolbar wrap-type vocabulary (`wrapLeft` / `wrapRight`
|
|
566
|
+
* / `square` / `tight` / `through` / `topAndBottom` / `behind` / `inFront` /
|
|
567
|
+
* `inline`) into a `ImageLayoutTarget` so toolbar dispatch shares the same PM
|
|
568
|
+
* command path as the right-click menu.
|
|
569
|
+
*
|
|
570
|
+
* Returns `undefined` for unknown values; callers should treat that as
|
|
571
|
+
* "no-op".
|
|
572
|
+
*/
|
|
573
|
+
declare function toolbarValueToLayoutTarget(value: string): ImageLayoutTarget | undefined;
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Layout Painter
|
|
577
|
+
*
|
|
578
|
+
* Main entry point for rendering Layout data to DOM.
|
|
579
|
+
* Provides reconciliation for efficient incremental updates.
|
|
580
|
+
*
|
|
581
|
+
* @experimental Stable enough for the first-party React adapter, but the
|
|
582
|
+
* API may change in minor releases until a third-party adapter validates
|
|
583
|
+
* it. Pin a version range if you depend on this directly.
|
|
584
|
+
* @packageDocumentation
|
|
585
|
+
* @public
|
|
586
|
+
*/
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Block lookup entry for painter
|
|
590
|
+
*/
|
|
591
|
+
interface BlockLookupEntry {
|
|
592
|
+
block: FlowBlock;
|
|
593
|
+
measure: Measure;
|
|
594
|
+
version?: string;
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Block lookup map type
|
|
598
|
+
*/
|
|
599
|
+
type BlockLookup = Map<string, BlockLookupEntry>;
|
|
600
|
+
/**
|
|
601
|
+
* Painter options
|
|
602
|
+
*/
|
|
603
|
+
interface PainterOptions {
|
|
604
|
+
/** Document to create elements in */
|
|
605
|
+
document?: Document;
|
|
606
|
+
/** Gap between pages in pixels */
|
|
607
|
+
pageGap?: number;
|
|
608
|
+
/** Show page shadows */
|
|
609
|
+
showShadow?: boolean;
|
|
610
|
+
/** Background color for pages */
|
|
611
|
+
pageBackground?: string;
|
|
612
|
+
/** Container background color */
|
|
613
|
+
containerBackground?: string;
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Layout Painter class
|
|
617
|
+
*
|
|
618
|
+
* Renders Layout data to DOM with efficient reconciliation.
|
|
619
|
+
* Only updates changed pages and fragments for better performance.
|
|
620
|
+
*/
|
|
621
|
+
declare class LayoutPainter {
|
|
622
|
+
private container;
|
|
623
|
+
private blockLookup;
|
|
624
|
+
private pageStates;
|
|
625
|
+
private totalPages;
|
|
626
|
+
private options;
|
|
627
|
+
private doc;
|
|
628
|
+
resolvedCommentIds: Set<number>;
|
|
629
|
+
constructor(options?: PainterOptions);
|
|
630
|
+
/**
|
|
631
|
+
* Set the block lookup map for rendering fragments
|
|
632
|
+
*/
|
|
633
|
+
setBlockLookup(lookup: BlockLookup): void;
|
|
634
|
+
/**
|
|
635
|
+
* Mount the painter to a container element
|
|
636
|
+
*/
|
|
637
|
+
mount(container: HTMLElement): void;
|
|
638
|
+
/**
|
|
639
|
+
* Unmount the painter
|
|
640
|
+
*/
|
|
641
|
+
unmount(): void;
|
|
642
|
+
/**
|
|
643
|
+
* Apply styles to the container
|
|
644
|
+
*/
|
|
645
|
+
private applyContainerStyles;
|
|
646
|
+
/**
|
|
647
|
+
* Paint a layout to the container
|
|
648
|
+
*/
|
|
649
|
+
paint(layout: Layout): void;
|
|
650
|
+
/**
|
|
651
|
+
* Render a page using block lookup for full fragment rendering
|
|
652
|
+
*/
|
|
653
|
+
private renderPageWithLookup;
|
|
654
|
+
/**
|
|
655
|
+
* Render a fragment using block lookup for full content rendering
|
|
656
|
+
*/
|
|
657
|
+
private renderFragmentWithLookup;
|
|
658
|
+
/**
|
|
659
|
+
* Apply positioning styles to a fragment element
|
|
660
|
+
*/
|
|
661
|
+
private applyFragmentPosition;
|
|
662
|
+
/**
|
|
663
|
+
* Get the current page count
|
|
664
|
+
*/
|
|
665
|
+
getPageCount(): number;
|
|
666
|
+
/**
|
|
667
|
+
* Get a page element by index
|
|
668
|
+
*/
|
|
669
|
+
getPageElement(index: number): HTMLElement | null;
|
|
670
|
+
/**
|
|
671
|
+
* Scroll to a specific page
|
|
672
|
+
*/
|
|
673
|
+
scrollToPage(pageNumber: number): void;
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Create a new LayoutPainter instance
|
|
677
|
+
*/
|
|
678
|
+
declare function createPainter(options?: PainterOptions): LayoutPainter;
|
|
679
|
+
|
|
680
|
+
export { type BlockLookup as B, FRAGMENT_CLASS_NAMES as F, type FloatingImagePaintRecord, type FloatingImagesLayerOptions, FootnoteRenderItem, HeaderFooterContent, IMAGE_CLASS_NAMES as I, LAYOUT_IMAGE_CLASSES as L, type PainterOptions as P, PAGE_CLASS_NAMES, type RenderContext, type RenderPageOptions, type RenderPagesUpdateKind, TABLE_CLASS_NAMES as T, type BlockLookupEntry as a, applyPageStyles, IMAGE_LAYOUT_OPTIONS as b, type ImageHitTestResult as c, type ImageLayoutIconHint as d, type ImageLayoutOptionDef as e, LayoutPainter as f, floatingImageIsBehindDoc, floatingImageWrapsText, TEXTBOX_CLASS_NAMES as g, captureInlinePositionEmu as h, createPainter as i, isFloatingImageRun, isTextWrappingFloatingImageRun, deriveLayoutChoice as j, findImageElement as k, hitTestImage as l, isImageLayoutOptionEnabled as m, renderImageFragment as n, renderLine as o, renderParagraphFragment as p, renderTableFragment as q, renderFragment as r, renderFloatingImagesLayer, renderPage, renderPages, renderTextBoxFragment as s, sliceRunsForLine as t, toolbarValueToLayoutTarget as u };
|