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