@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,28 @@
|
|
|
1
|
+
import { Node } from 'prosemirror-model';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ProseMirror position immediately before the first textblock whose `paraId`
|
|
5
|
+
* attribute equals `paraId` (Word `w14:paraId` / OOXML paragraph id).
|
|
6
|
+
*
|
|
7
|
+
* Match is strict string equality on `node.attrs.paraId`.
|
|
8
|
+
*/
|
|
9
|
+
declare function findStartPosForParaId(doc: Node, paraId: string): number | null;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* ProseMirror position range for the paragraph (or any textblock) whose
|
|
13
|
+
* `paraId` attribute equals `paraId`. Returns the inclusive `from` and
|
|
14
|
+
* exclusive `to` positions, plus the node, so callers can both target
|
|
15
|
+
* the paragraph (e.g. addMark over its text range) and inspect it.
|
|
16
|
+
*
|
|
17
|
+
* `from` is the position immediately before the textblock; `to` is
|
|
18
|
+
* `from + node.nodeSize`. The text content lives at `[from + 1, to - 1]`.
|
|
19
|
+
*
|
|
20
|
+
* Returns null if no textblock with that paraId exists.
|
|
21
|
+
*/
|
|
22
|
+
declare function findParagraphByParaId(doc: Node, paraId: string): {
|
|
23
|
+
node: Node;
|
|
24
|
+
from: number;
|
|
25
|
+
to: number;
|
|
26
|
+
} | null;
|
|
27
|
+
|
|
28
|
+
export { findStartPosForParaId as a, findParagraphByParaId as f };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Node } from 'prosemirror-model';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ProseMirror position immediately before the first textblock whose `paraId`
|
|
5
|
+
* attribute equals `paraId` (Word `w14:paraId` / OOXML paragraph id).
|
|
6
|
+
*
|
|
7
|
+
* Match is strict string equality on `node.attrs.paraId`.
|
|
8
|
+
*/
|
|
9
|
+
declare function findStartPosForParaId(doc: Node, paraId: string): number | null;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* ProseMirror position range for the paragraph (or any textblock) whose
|
|
13
|
+
* `paraId` attribute equals `paraId`. Returns the inclusive `from` and
|
|
14
|
+
* exclusive `to` positions, plus the node, so callers can both target
|
|
15
|
+
* the paragraph (e.g. addMark over its text range) and inspect it.
|
|
16
|
+
*
|
|
17
|
+
* `from` is the position immediately before the textblock; `to` is
|
|
18
|
+
* `from + node.nodeSize`. The text content lives at `[from + 1, to - 1]`.
|
|
19
|
+
*
|
|
20
|
+
* Returns null if no textblock with that paraId exists.
|
|
21
|
+
*/
|
|
22
|
+
declare function findParagraphByParaId(doc: Node, paraId: string): {
|
|
23
|
+
node: Node;
|
|
24
|
+
from: number;
|
|
25
|
+
to: number;
|
|
26
|
+
} | null;
|
|
27
|
+
|
|
28
|
+
export { findStartPosForParaId as a, findParagraphByParaId as f };
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { Document } from './types/document.mjs';
|
|
2
|
+
import { t as BreakContent, P as Paragraph, R as Run, g as RunContent } from './content-5Mrz6w_b.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Insert Operations Utility
|
|
6
|
+
*
|
|
7
|
+
* Utility functions for inserting content into the document.
|
|
8
|
+
* Provides functions for inserting page breaks, horizontal rules, and other elements.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Insert position in the document
|
|
13
|
+
*/
|
|
14
|
+
interface InsertPosition {
|
|
15
|
+
/** Paragraph index in the document body */
|
|
16
|
+
paragraphIndex: number;
|
|
17
|
+
/** Run index within the paragraph (optional) */
|
|
18
|
+
runIndex?: number;
|
|
19
|
+
/** Character offset within the run (optional) */
|
|
20
|
+
offset?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create a page break content element
|
|
24
|
+
*/
|
|
25
|
+
declare function createPageBreak(): BreakContent;
|
|
26
|
+
/**
|
|
27
|
+
* Create a column break content element
|
|
28
|
+
*/
|
|
29
|
+
declare function createColumnBreak(): BreakContent;
|
|
30
|
+
/**
|
|
31
|
+
* Create a text wrapping break (line break)
|
|
32
|
+
*/
|
|
33
|
+
declare function createLineBreak(clear?: 'none' | 'left' | 'right' | 'all'): BreakContent;
|
|
34
|
+
/**
|
|
35
|
+
* Create a run containing a page break
|
|
36
|
+
*/
|
|
37
|
+
declare function createPageBreakRun(): Run;
|
|
38
|
+
/**
|
|
39
|
+
* Create an empty paragraph with a page break before it
|
|
40
|
+
*/
|
|
41
|
+
declare function createPageBreakParagraph(): Paragraph;
|
|
42
|
+
/**
|
|
43
|
+
* Insert a page break at a position in the document
|
|
44
|
+
* This inserts a new paragraph with pageBreakBefore: true
|
|
45
|
+
*/
|
|
46
|
+
declare function insertPageBreak(doc: Document, position: InsertPosition): Document;
|
|
47
|
+
/**
|
|
48
|
+
* Create a horizontal rule paragraph
|
|
49
|
+
* Uses a paragraph with bottom border to simulate horizontal rule
|
|
50
|
+
*/
|
|
51
|
+
declare function createHorizontalRule(): Paragraph;
|
|
52
|
+
/**
|
|
53
|
+
* Insert a horizontal rule at a position in the document
|
|
54
|
+
*/
|
|
55
|
+
declare function insertHorizontalRule(doc: Document, position: InsertPosition): Document;
|
|
56
|
+
/**
|
|
57
|
+
* Check if content is a page break
|
|
58
|
+
*/
|
|
59
|
+
declare function isPageBreak(content: RunContent): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Check if content is a column break
|
|
62
|
+
*/
|
|
63
|
+
declare function isColumnBreak(content: RunContent): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Check if content is a line break
|
|
66
|
+
*/
|
|
67
|
+
declare function isLineBreak(content: RunContent): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Check if content is any type of break
|
|
70
|
+
*/
|
|
71
|
+
declare function isBreakContent(content: RunContent): content is BreakContent;
|
|
72
|
+
/**
|
|
73
|
+
* Check if a paragraph has pageBreakBefore
|
|
74
|
+
*/
|
|
75
|
+
declare function hasPageBreakBefore(paragraph: Paragraph): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Count page breaks in a document
|
|
78
|
+
*/
|
|
79
|
+
declare function countPageBreaks(doc: Document): number;
|
|
80
|
+
/**
|
|
81
|
+
* Find all page break positions in a document
|
|
82
|
+
*/
|
|
83
|
+
declare function findPageBreaks(doc: Document): InsertPosition[];
|
|
84
|
+
/**
|
|
85
|
+
* Remove a page break at a specific position
|
|
86
|
+
*/
|
|
87
|
+
declare function removePageBreak(doc: Document, position: InsertPosition): Document;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Google Fonts Loader
|
|
91
|
+
*
|
|
92
|
+
* Dynamically loads fonts from Google Fonts API with:
|
|
93
|
+
* - Loading state tracking
|
|
94
|
+
* - Duplicate prevention
|
|
95
|
+
* - Callback notifications
|
|
96
|
+
* - Font availability detection
|
|
97
|
+
*/
|
|
98
|
+
/**
|
|
99
|
+
* Load a font from Google Fonts
|
|
100
|
+
*
|
|
101
|
+
* @param fontFamily - The font family name to load
|
|
102
|
+
* @param options - Optional configuration
|
|
103
|
+
* @returns Promise resolving to true if font loaded successfully, false otherwise
|
|
104
|
+
*/
|
|
105
|
+
declare function loadFont(fontFamily: string, options?: {
|
|
106
|
+
weights?: number[];
|
|
107
|
+
styles?: ('normal' | 'italic')[];
|
|
108
|
+
}): Promise<boolean>;
|
|
109
|
+
/**
|
|
110
|
+
* Load multiple fonts from Google Fonts
|
|
111
|
+
*
|
|
112
|
+
* @param families - Array of font family names to load
|
|
113
|
+
* @param options - Optional configuration
|
|
114
|
+
* @returns Promise resolving when all fonts are loaded (or failed)
|
|
115
|
+
*/
|
|
116
|
+
declare function loadFonts(families: string[], options?: {
|
|
117
|
+
weights?: number[];
|
|
118
|
+
styles?: ('normal' | 'italic')[];
|
|
119
|
+
}): Promise<void>;
|
|
120
|
+
/**
|
|
121
|
+
* Check if a font is loaded
|
|
122
|
+
*
|
|
123
|
+
* @param fontFamily - The font family name to check
|
|
124
|
+
* @returns true if the font is loaded, false otherwise
|
|
125
|
+
*/
|
|
126
|
+
declare function isFontLoaded(fontFamily: string): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Check if any fonts are currently loading
|
|
129
|
+
*
|
|
130
|
+
* @returns true if any fonts are loading, false otherwise
|
|
131
|
+
*/
|
|
132
|
+
declare function isLoading(): boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Get list of all loaded fonts
|
|
135
|
+
*
|
|
136
|
+
* @returns Array of loaded font family names
|
|
137
|
+
*/
|
|
138
|
+
declare function getLoadedFonts(): string[];
|
|
139
|
+
/**
|
|
140
|
+
* Register a callback to be notified when fonts are loaded
|
|
141
|
+
*
|
|
142
|
+
* @param callback - Function to call when fonts are loaded
|
|
143
|
+
* @returns Cleanup function to remove the callback
|
|
144
|
+
*/
|
|
145
|
+
declare function onFontsLoaded(callback: (fonts: string[]) => void): () => void;
|
|
146
|
+
/**
|
|
147
|
+
* Register a callback to be notified when a font fails to load.
|
|
148
|
+
*
|
|
149
|
+
* Adapters subscribe and forward to their `onError` prop. Returns the unsub.
|
|
150
|
+
*
|
|
151
|
+
* @public
|
|
152
|
+
*/
|
|
153
|
+
declare function onFontError(callback: (error: Error) => void): () => void;
|
|
154
|
+
/**
|
|
155
|
+
* Check if a font is available on the system using canvas measurement
|
|
156
|
+
*
|
|
157
|
+
* This uses the technique of comparing text width with the target font
|
|
158
|
+
* vs a known fallback font. If they differ, the font is available.
|
|
159
|
+
*
|
|
160
|
+
* @param fontFamily - The font family name to check
|
|
161
|
+
* @param fallbackFont - Fallback font to compare against
|
|
162
|
+
* @returns true if font is available, false otherwise
|
|
163
|
+
*/
|
|
164
|
+
declare function canRenderFont(fontFamily: string, fallbackFont?: string): boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Load a font from a raw buffer (e.g., embedded in DOCX)
|
|
167
|
+
*
|
|
168
|
+
* @param fontFamily - The font family name
|
|
169
|
+
* @param buffer - Font file buffer (TTF, OTF, WOFF, WOFF2)
|
|
170
|
+
* @param options - Font options
|
|
171
|
+
* @returns Promise resolving when font is loaded
|
|
172
|
+
*/
|
|
173
|
+
declare function loadFontFromBuffer(fontFamily: string, buffer: ArrayBuffer, options?: {
|
|
174
|
+
weight?: number | string;
|
|
175
|
+
}): Promise<boolean>;
|
|
176
|
+
/**
|
|
177
|
+
* Load a font face from a URL (woff2, woff, ttf, otf).
|
|
178
|
+
*
|
|
179
|
+
* Injects an `@font-face` rule pointing at the URL. Multiple weights of the
|
|
180
|
+
* same family can be registered independently.
|
|
181
|
+
*
|
|
182
|
+
* @param fontFamily - CSS font-family name to expose
|
|
183
|
+
* @param src - URL to the font file
|
|
184
|
+
* @param options - Optional weight
|
|
185
|
+
* @returns Promise resolving to true if the face became available
|
|
186
|
+
*
|
|
187
|
+
* @public
|
|
188
|
+
*/
|
|
189
|
+
declare function loadFontFromUrl(fontFamily: string, src: string, options?: {
|
|
190
|
+
weight?: number | string;
|
|
191
|
+
}): Promise<boolean>;
|
|
192
|
+
/**
|
|
193
|
+
* Declarative description of a single font face to register with the editor.
|
|
194
|
+
*
|
|
195
|
+
* Each entry injects one `@font-face` rule pointing at a URL. Multiple
|
|
196
|
+
* entries can share `family` to register distinct weights as separate faces.
|
|
197
|
+
*
|
|
198
|
+
* For Google Fonts, call `loadFont(family)` directly — the `fonts` prop is
|
|
199
|
+
* for fonts the consumer hosts themselves. For raw bytes already in memory
|
|
200
|
+
* (DOCX-embedded fonts, user uploads), call `loadFontFromBuffer(family, buf)`.
|
|
201
|
+
*
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
interface FontDefinition {
|
|
205
|
+
/**
|
|
206
|
+
* CSS `font-family` name to expose. Match the family name your documents
|
|
207
|
+
* reference; the browser uses this to look up glyphs when text is rendered.
|
|
208
|
+
*/
|
|
209
|
+
family: string;
|
|
210
|
+
/**
|
|
211
|
+
* URL to the font file (woff2, woff, ttf, or otf). The loader injects an
|
|
212
|
+
* `@font-face` rule and lets the browser fetch on demand.
|
|
213
|
+
*/
|
|
214
|
+
src: string;
|
|
215
|
+
/**
|
|
216
|
+
* CSS `font-weight` for this face. Defaults to `'normal'` (≈400). Pass a
|
|
217
|
+
* number (`400`, `700`) or a CSS keyword (`'bold'`). Required when one
|
|
218
|
+
* `family` registers multiple weights as separate entries.
|
|
219
|
+
*/
|
|
220
|
+
weight?: number | string;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Register a list of custom font faces. Used by the `fonts` prop on
|
|
224
|
+
* `<DocxEditor>` (React + Vue). Idempotent — safe to call on every render.
|
|
225
|
+
*
|
|
226
|
+
* @public
|
|
227
|
+
*/
|
|
228
|
+
declare function loadFontDefinitions(defs: ReadonlyArray<FontDefinition> | undefined): Promise<void>;
|
|
229
|
+
/**
|
|
230
|
+
* Mapping from common Office/system fonts to Google Fonts equivalents
|
|
231
|
+
*
|
|
232
|
+
* Google Fonts doesn't have exact matches for many Microsoft fonts,
|
|
233
|
+
* but these are close alternatives that work well for document rendering.
|
|
234
|
+
*/
|
|
235
|
+
declare const FONT_MAPPING: Record<string, string>;
|
|
236
|
+
/**
|
|
237
|
+
* Get the Google Fonts equivalent for a font name
|
|
238
|
+
*
|
|
239
|
+
* @param fontName - The original font name from the document
|
|
240
|
+
* @returns The Google Fonts equivalent, or the original name if no mapping exists
|
|
241
|
+
*/
|
|
242
|
+
declare function getGoogleFontEquivalent(fontName: string): string;
|
|
243
|
+
/**
|
|
244
|
+
* Load a font, automatically mapping to Google Fonts equivalent if needed.
|
|
245
|
+
* If the font needs mapping, also creates a CSS alias so the original font
|
|
246
|
+
* name works in stylesheets.
|
|
247
|
+
*
|
|
248
|
+
* @param fontFamily - The font family name (may be an Office font)
|
|
249
|
+
* @returns Promise resolving to true if font loaded
|
|
250
|
+
*/
|
|
251
|
+
declare function loadFontWithMapping(fontFamily: string): Promise<boolean>;
|
|
252
|
+
/**
|
|
253
|
+
* Load multiple fonts with automatic mapping to Google Fonts equivalents
|
|
254
|
+
*
|
|
255
|
+
* @param families - Array of font family names
|
|
256
|
+
* @returns Promise resolving when all fonts are loaded
|
|
257
|
+
*/
|
|
258
|
+
declare function loadFontsWithMapping(families: string[]): Promise<void>;
|
|
259
|
+
/**
|
|
260
|
+
* Preload a list of common document fonts
|
|
261
|
+
*
|
|
262
|
+
* This preloads fonts commonly used in DOCX documents that have
|
|
263
|
+
* Google Fonts equivalents.
|
|
264
|
+
*/
|
|
265
|
+
declare function preloadCommonFonts(): Promise<void>;
|
|
266
|
+
/**
|
|
267
|
+
* Extract all font families used in a document
|
|
268
|
+
*
|
|
269
|
+
* Uses loose typing to handle any document-like structure.
|
|
270
|
+
*
|
|
271
|
+
* @param document - The parsed document
|
|
272
|
+
* @returns Set of unique font family names
|
|
273
|
+
*/
|
|
274
|
+
declare function extractFontsFromDocument(document: unknown): Set<string>;
|
|
275
|
+
/**
|
|
276
|
+
* Extract fonts from a document and load them from Google Fonts
|
|
277
|
+
*
|
|
278
|
+
* @param document - The parsed document
|
|
279
|
+
* @returns Promise resolving when fonts are loaded
|
|
280
|
+
*/
|
|
281
|
+
declare function loadDocumentFonts(document: unknown): Promise<void>;
|
|
282
|
+
|
|
283
|
+
export { extractFontsFromDocument as A, getGoogleFontEquivalent as B, loadDocumentFonts as C, loadFontDefinitions as D, loadFontFromUrl as E, FONT_MAPPING as F, loadFontWithMapping as G, loadFontsWithMapping as H, type InsertPosition as I, onFontError as J, countPageBreaks as a, createColumnBreak as b, canRenderFont as c, createHorizontalRule as d, createLineBreak as e, createPageBreak as f, createPageBreakParagraph as g, createPageBreakRun as h, findPageBreaks as i, getLoadedFonts as j, hasPageBreakBefore as k, insertHorizontalRule as l, insertPageBreak as m, isBreakContent as n, isColumnBreak as o, isFontLoaded as p, isLoading as q, isLineBreak as r, isPageBreak as s, loadFont as t, loadFontFromBuffer as u, loadFonts as v, onFontsLoaded as w, preloadCommonFonts as x, removePageBreak as y, type FontDefinition as z };
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { Document } from './types/document.js';
|
|
2
|
+
import { t as BreakContent, P as Paragraph, R as Run, g as RunContent } from './content-CmqAwdFL.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Insert Operations Utility
|
|
6
|
+
*
|
|
7
|
+
* Utility functions for inserting content into the document.
|
|
8
|
+
* Provides functions for inserting page breaks, horizontal rules, and other elements.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Insert position in the document
|
|
13
|
+
*/
|
|
14
|
+
interface InsertPosition {
|
|
15
|
+
/** Paragraph index in the document body */
|
|
16
|
+
paragraphIndex: number;
|
|
17
|
+
/** Run index within the paragraph (optional) */
|
|
18
|
+
runIndex?: number;
|
|
19
|
+
/** Character offset within the run (optional) */
|
|
20
|
+
offset?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create a page break content element
|
|
24
|
+
*/
|
|
25
|
+
declare function createPageBreak(): BreakContent;
|
|
26
|
+
/**
|
|
27
|
+
* Create a column break content element
|
|
28
|
+
*/
|
|
29
|
+
declare function createColumnBreak(): BreakContent;
|
|
30
|
+
/**
|
|
31
|
+
* Create a text wrapping break (line break)
|
|
32
|
+
*/
|
|
33
|
+
declare function createLineBreak(clear?: 'none' | 'left' | 'right' | 'all'): BreakContent;
|
|
34
|
+
/**
|
|
35
|
+
* Create a run containing a page break
|
|
36
|
+
*/
|
|
37
|
+
declare function createPageBreakRun(): Run;
|
|
38
|
+
/**
|
|
39
|
+
* Create an empty paragraph with a page break before it
|
|
40
|
+
*/
|
|
41
|
+
declare function createPageBreakParagraph(): Paragraph;
|
|
42
|
+
/**
|
|
43
|
+
* Insert a page break at a position in the document
|
|
44
|
+
* This inserts a new paragraph with pageBreakBefore: true
|
|
45
|
+
*/
|
|
46
|
+
declare function insertPageBreak(doc: Document, position: InsertPosition): Document;
|
|
47
|
+
/**
|
|
48
|
+
* Create a horizontal rule paragraph
|
|
49
|
+
* Uses a paragraph with bottom border to simulate horizontal rule
|
|
50
|
+
*/
|
|
51
|
+
declare function createHorizontalRule(): Paragraph;
|
|
52
|
+
/**
|
|
53
|
+
* Insert a horizontal rule at a position in the document
|
|
54
|
+
*/
|
|
55
|
+
declare function insertHorizontalRule(doc: Document, position: InsertPosition): Document;
|
|
56
|
+
/**
|
|
57
|
+
* Check if content is a page break
|
|
58
|
+
*/
|
|
59
|
+
declare function isPageBreak(content: RunContent): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Check if content is a column break
|
|
62
|
+
*/
|
|
63
|
+
declare function isColumnBreak(content: RunContent): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Check if content is a line break
|
|
66
|
+
*/
|
|
67
|
+
declare function isLineBreak(content: RunContent): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Check if content is any type of break
|
|
70
|
+
*/
|
|
71
|
+
declare function isBreakContent(content: RunContent): content is BreakContent;
|
|
72
|
+
/**
|
|
73
|
+
* Check if a paragraph has pageBreakBefore
|
|
74
|
+
*/
|
|
75
|
+
declare function hasPageBreakBefore(paragraph: Paragraph): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Count page breaks in a document
|
|
78
|
+
*/
|
|
79
|
+
declare function countPageBreaks(doc: Document): number;
|
|
80
|
+
/**
|
|
81
|
+
* Find all page break positions in a document
|
|
82
|
+
*/
|
|
83
|
+
declare function findPageBreaks(doc: Document): InsertPosition[];
|
|
84
|
+
/**
|
|
85
|
+
* Remove a page break at a specific position
|
|
86
|
+
*/
|
|
87
|
+
declare function removePageBreak(doc: Document, position: InsertPosition): Document;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Google Fonts Loader
|
|
91
|
+
*
|
|
92
|
+
* Dynamically loads fonts from Google Fonts API with:
|
|
93
|
+
* - Loading state tracking
|
|
94
|
+
* - Duplicate prevention
|
|
95
|
+
* - Callback notifications
|
|
96
|
+
* - Font availability detection
|
|
97
|
+
*/
|
|
98
|
+
/**
|
|
99
|
+
* Load a font from Google Fonts
|
|
100
|
+
*
|
|
101
|
+
* @param fontFamily - The font family name to load
|
|
102
|
+
* @param options - Optional configuration
|
|
103
|
+
* @returns Promise resolving to true if font loaded successfully, false otherwise
|
|
104
|
+
*/
|
|
105
|
+
declare function loadFont(fontFamily: string, options?: {
|
|
106
|
+
weights?: number[];
|
|
107
|
+
styles?: ('normal' | 'italic')[];
|
|
108
|
+
}): Promise<boolean>;
|
|
109
|
+
/**
|
|
110
|
+
* Load multiple fonts from Google Fonts
|
|
111
|
+
*
|
|
112
|
+
* @param families - Array of font family names to load
|
|
113
|
+
* @param options - Optional configuration
|
|
114
|
+
* @returns Promise resolving when all fonts are loaded (or failed)
|
|
115
|
+
*/
|
|
116
|
+
declare function loadFonts(families: string[], options?: {
|
|
117
|
+
weights?: number[];
|
|
118
|
+
styles?: ('normal' | 'italic')[];
|
|
119
|
+
}): Promise<void>;
|
|
120
|
+
/**
|
|
121
|
+
* Check if a font is loaded
|
|
122
|
+
*
|
|
123
|
+
* @param fontFamily - The font family name to check
|
|
124
|
+
* @returns true if the font is loaded, false otherwise
|
|
125
|
+
*/
|
|
126
|
+
declare function isFontLoaded(fontFamily: string): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Check if any fonts are currently loading
|
|
129
|
+
*
|
|
130
|
+
* @returns true if any fonts are loading, false otherwise
|
|
131
|
+
*/
|
|
132
|
+
declare function isLoading(): boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Get list of all loaded fonts
|
|
135
|
+
*
|
|
136
|
+
* @returns Array of loaded font family names
|
|
137
|
+
*/
|
|
138
|
+
declare function getLoadedFonts(): string[];
|
|
139
|
+
/**
|
|
140
|
+
* Register a callback to be notified when fonts are loaded
|
|
141
|
+
*
|
|
142
|
+
* @param callback - Function to call when fonts are loaded
|
|
143
|
+
* @returns Cleanup function to remove the callback
|
|
144
|
+
*/
|
|
145
|
+
declare function onFontsLoaded(callback: (fonts: string[]) => void): () => void;
|
|
146
|
+
/**
|
|
147
|
+
* Register a callback to be notified when a font fails to load.
|
|
148
|
+
*
|
|
149
|
+
* Adapters subscribe and forward to their `onError` prop. Returns the unsub.
|
|
150
|
+
*
|
|
151
|
+
* @public
|
|
152
|
+
*/
|
|
153
|
+
declare function onFontError(callback: (error: Error) => void): () => void;
|
|
154
|
+
/**
|
|
155
|
+
* Check if a font is available on the system using canvas measurement
|
|
156
|
+
*
|
|
157
|
+
* This uses the technique of comparing text width with the target font
|
|
158
|
+
* vs a known fallback font. If they differ, the font is available.
|
|
159
|
+
*
|
|
160
|
+
* @param fontFamily - The font family name to check
|
|
161
|
+
* @param fallbackFont - Fallback font to compare against
|
|
162
|
+
* @returns true if font is available, false otherwise
|
|
163
|
+
*/
|
|
164
|
+
declare function canRenderFont(fontFamily: string, fallbackFont?: string): boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Load a font from a raw buffer (e.g., embedded in DOCX)
|
|
167
|
+
*
|
|
168
|
+
* @param fontFamily - The font family name
|
|
169
|
+
* @param buffer - Font file buffer (TTF, OTF, WOFF, WOFF2)
|
|
170
|
+
* @param options - Font options
|
|
171
|
+
* @returns Promise resolving when font is loaded
|
|
172
|
+
*/
|
|
173
|
+
declare function loadFontFromBuffer(fontFamily: string, buffer: ArrayBuffer, options?: {
|
|
174
|
+
weight?: number | string;
|
|
175
|
+
}): Promise<boolean>;
|
|
176
|
+
/**
|
|
177
|
+
* Load a font face from a URL (woff2, woff, ttf, otf).
|
|
178
|
+
*
|
|
179
|
+
* Injects an `@font-face` rule pointing at the URL. Multiple weights of the
|
|
180
|
+
* same family can be registered independently.
|
|
181
|
+
*
|
|
182
|
+
* @param fontFamily - CSS font-family name to expose
|
|
183
|
+
* @param src - URL to the font file
|
|
184
|
+
* @param options - Optional weight
|
|
185
|
+
* @returns Promise resolving to true if the face became available
|
|
186
|
+
*
|
|
187
|
+
* @public
|
|
188
|
+
*/
|
|
189
|
+
declare function loadFontFromUrl(fontFamily: string, src: string, options?: {
|
|
190
|
+
weight?: number | string;
|
|
191
|
+
}): Promise<boolean>;
|
|
192
|
+
/**
|
|
193
|
+
* Declarative description of a single font face to register with the editor.
|
|
194
|
+
*
|
|
195
|
+
* Each entry injects one `@font-face` rule pointing at a URL. Multiple
|
|
196
|
+
* entries can share `family` to register distinct weights as separate faces.
|
|
197
|
+
*
|
|
198
|
+
* For Google Fonts, call `loadFont(family)` directly — the `fonts` prop is
|
|
199
|
+
* for fonts the consumer hosts themselves. For raw bytes already in memory
|
|
200
|
+
* (DOCX-embedded fonts, user uploads), call `loadFontFromBuffer(family, buf)`.
|
|
201
|
+
*
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
interface FontDefinition {
|
|
205
|
+
/**
|
|
206
|
+
* CSS `font-family` name to expose. Match the family name your documents
|
|
207
|
+
* reference; the browser uses this to look up glyphs when text is rendered.
|
|
208
|
+
*/
|
|
209
|
+
family: string;
|
|
210
|
+
/**
|
|
211
|
+
* URL to the font file (woff2, woff, ttf, or otf). The loader injects an
|
|
212
|
+
* `@font-face` rule and lets the browser fetch on demand.
|
|
213
|
+
*/
|
|
214
|
+
src: string;
|
|
215
|
+
/**
|
|
216
|
+
* CSS `font-weight` for this face. Defaults to `'normal'` (≈400). Pass a
|
|
217
|
+
* number (`400`, `700`) or a CSS keyword (`'bold'`). Required when one
|
|
218
|
+
* `family` registers multiple weights as separate entries.
|
|
219
|
+
*/
|
|
220
|
+
weight?: number | string;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Register a list of custom font faces. Used by the `fonts` prop on
|
|
224
|
+
* `<DocxEditor>` (React + Vue). Idempotent — safe to call on every render.
|
|
225
|
+
*
|
|
226
|
+
* @public
|
|
227
|
+
*/
|
|
228
|
+
declare function loadFontDefinitions(defs: ReadonlyArray<FontDefinition> | undefined): Promise<void>;
|
|
229
|
+
/**
|
|
230
|
+
* Mapping from common Office/system fonts to Google Fonts equivalents
|
|
231
|
+
*
|
|
232
|
+
* Google Fonts doesn't have exact matches for many Microsoft fonts,
|
|
233
|
+
* but these are close alternatives that work well for document rendering.
|
|
234
|
+
*/
|
|
235
|
+
declare const FONT_MAPPING: Record<string, string>;
|
|
236
|
+
/**
|
|
237
|
+
* Get the Google Fonts equivalent for a font name
|
|
238
|
+
*
|
|
239
|
+
* @param fontName - The original font name from the document
|
|
240
|
+
* @returns The Google Fonts equivalent, or the original name if no mapping exists
|
|
241
|
+
*/
|
|
242
|
+
declare function getGoogleFontEquivalent(fontName: string): string;
|
|
243
|
+
/**
|
|
244
|
+
* Load a font, automatically mapping to Google Fonts equivalent if needed.
|
|
245
|
+
* If the font needs mapping, also creates a CSS alias so the original font
|
|
246
|
+
* name works in stylesheets.
|
|
247
|
+
*
|
|
248
|
+
* @param fontFamily - The font family name (may be an Office font)
|
|
249
|
+
* @returns Promise resolving to true if font loaded
|
|
250
|
+
*/
|
|
251
|
+
declare function loadFontWithMapping(fontFamily: string): Promise<boolean>;
|
|
252
|
+
/**
|
|
253
|
+
* Load multiple fonts with automatic mapping to Google Fonts equivalents
|
|
254
|
+
*
|
|
255
|
+
* @param families - Array of font family names
|
|
256
|
+
* @returns Promise resolving when all fonts are loaded
|
|
257
|
+
*/
|
|
258
|
+
declare function loadFontsWithMapping(families: string[]): Promise<void>;
|
|
259
|
+
/**
|
|
260
|
+
* Preload a list of common document fonts
|
|
261
|
+
*
|
|
262
|
+
* This preloads fonts commonly used in DOCX documents that have
|
|
263
|
+
* Google Fonts equivalents.
|
|
264
|
+
*/
|
|
265
|
+
declare function preloadCommonFonts(): Promise<void>;
|
|
266
|
+
/**
|
|
267
|
+
* Extract all font families used in a document
|
|
268
|
+
*
|
|
269
|
+
* Uses loose typing to handle any document-like structure.
|
|
270
|
+
*
|
|
271
|
+
* @param document - The parsed document
|
|
272
|
+
* @returns Set of unique font family names
|
|
273
|
+
*/
|
|
274
|
+
declare function extractFontsFromDocument(document: unknown): Set<string>;
|
|
275
|
+
/**
|
|
276
|
+
* Extract fonts from a document and load them from Google Fonts
|
|
277
|
+
*
|
|
278
|
+
* @param document - The parsed document
|
|
279
|
+
* @returns Promise resolving when fonts are loaded
|
|
280
|
+
*/
|
|
281
|
+
declare function loadDocumentFonts(document: unknown): Promise<void>;
|
|
282
|
+
|
|
283
|
+
export { extractFontsFromDocument as A, getGoogleFontEquivalent as B, loadDocumentFonts as C, loadFontDefinitions as D, loadFontFromUrl as E, FONT_MAPPING as F, loadFontWithMapping as G, loadFontsWithMapping as H, type InsertPosition as I, onFontError as J, countPageBreaks as a, createColumnBreak as b, canRenderFont as c, createHorizontalRule as d, createLineBreak as e, createPageBreak as f, createPageBreakParagraph as g, createPageBreakRun as h, findPageBreaks as i, getLoadedFonts as j, hasPageBreakBefore as k, insertHorizontalRule as l, insertPageBreak as m, isBreakContent as n, isColumnBreak as o, isFontLoaded as p, isLoading as q, isLineBreak as r, isPageBreak as s, loadFont as t, loadFontFromBuffer as u, loadFonts as v, onFontsLoaded as w, preloadCommonFonts as x, removePageBreak as y, type FontDefinition as z };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { FlowBlock, Measure, TableBlock, FootnoteContent } from './layout-engine/types.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Header / footer rendering for renderPage.
|
|
5
|
+
*
|
|
6
|
+
* Owns `renderHeaderFooterContent` — the mini-flow that lays paragraphs and
|
|
7
|
+
* tables inside a header/footer container (separate from the body flow) —
|
|
8
|
+
* plus the floating-image and floating-table positioning helpers used by
|
|
9
|
+
* that flow. Coordinates returned by `resolveHeaderFooterFloatingTablePosition`
|
|
10
|
+
* are relative to the HF container's flow origin (`layout.flowTop`/`flowLeft`)
|
|
11
|
+
* so callers can drop them into `style.top`/`style.left`.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Header/footer content for rendering
|
|
16
|
+
*/
|
|
17
|
+
interface HeaderFooterContent {
|
|
18
|
+
/** Flow blocks for the header/footer content. */
|
|
19
|
+
blocks: FlowBlock[];
|
|
20
|
+
/** Measurements for the blocks. */
|
|
21
|
+
measures: Measure[];
|
|
22
|
+
/** Total height of the content. */
|
|
23
|
+
height: number;
|
|
24
|
+
/** Top-most visual extent relative to the nominal flow origin. */
|
|
25
|
+
visualTop?: number;
|
|
26
|
+
/** Bottom-most visual extent relative to the nominal flow origin. */
|
|
27
|
+
visualBottom?: number;
|
|
28
|
+
}
|
|
29
|
+
interface HeaderFooterLayoutInfo {
|
|
30
|
+
flowTop: number;
|
|
31
|
+
flowLeft: number;
|
|
32
|
+
contentWidth: number;
|
|
33
|
+
pageWidth: number;
|
|
34
|
+
pageHeight: number;
|
|
35
|
+
margins: {
|
|
36
|
+
top: number;
|
|
37
|
+
right: number;
|
|
38
|
+
bottom: number;
|
|
39
|
+
left: number;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Resolve the (left, top) position for a floating table inside a header/
|
|
44
|
+
* footer container, per ECMA-376 §17.4.57. The table's `floating.tblpX/tblpY`
|
|
45
|
+
* are already in pixels (parser converted from twips); `horzAnchor`/
|
|
46
|
+
* `vertAnchor` decide whether the offset is relative to the page, the
|
|
47
|
+
* margins, or the surrounding text/column. Coordinates returned are
|
|
48
|
+
* relative to the HF container's flow origin (`layout.flowTop` /
|
|
49
|
+
* `layout.flowLeft`) so the caller can drop them straight into
|
|
50
|
+
* `style.top` / `style.left`.
|
|
51
|
+
*/
|
|
52
|
+
declare function resolveHeaderFooterFloatingTablePosition(floating: NonNullable<TableBlock['floating']>, layout: HeaderFooterLayoutInfo): {
|
|
53
|
+
left: number;
|
|
54
|
+
top: number;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Footnote area rendering.
|
|
59
|
+
*
|
|
60
|
+
* Footnotes get a separator line plus per-item rendering at the bottom of
|
|
61
|
+
* each page. Two paths: measured content (full body pipeline through
|
|
62
|
+
* paragraph/table/image/textBox fragments) for WYSIWYG fidelity, or a plain
|
|
63
|
+
* text fallback when no measurement is available.
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A single footnote item ready for rendering at page bottom.
|
|
68
|
+
*/
|
|
69
|
+
interface FootnoteRenderItem {
|
|
70
|
+
/** Display number (e.g. "1", "2") */
|
|
71
|
+
displayNumber: string;
|
|
72
|
+
/** Plain text content */
|
|
73
|
+
text: string;
|
|
74
|
+
/** Measured body-pipeline content used for WYSIWYG painting. */
|
|
75
|
+
content?: FootnoteContent;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { type FootnoteRenderItem as F, type HeaderFooterContent as H, type HeaderFooterLayoutInfo as a, resolveHeaderFooterFloatingTablePosition as r };
|