@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
package/dist/core.d.ts
ADDED
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zeke-02/docx-editor-core (default entry point)
|
|
3
|
+
*
|
|
4
|
+
* Fat barrel that re-exports the parser, serializer, agent, plugin
|
|
5
|
+
* registry, and the most-used types. No React/DOM imports.
|
|
6
|
+
*
|
|
7
|
+
* **When to import from `.` vs `./headless`:** identical for Node.js
|
|
8
|
+
* use; `.` is the convenient aggregate, `./headless` is its mirror with
|
|
9
|
+
* a slightly different name suffix. Adapter authors who only need a
|
|
10
|
+
* specific slice should prefer the smaller subpaths (`./docx`, `./agent`,
|
|
11
|
+
* `./prosemirror`, `./layout-*`, `./utils`) — they tree-shake better.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { parseDocx, serializeDocx, resolveColor } from '@zeke-02/docx-editor-core';
|
|
16
|
+
* ```
|
|
17
|
+
* @packageDocumentation
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export { parseDocx } from './docx/parser.js';
|
|
21
|
+
export { s as serializeDocumentBody, a as serializeDocx, b as serializeSectionProperties } from './documentSerializer-BRaaXIHm.js';
|
|
22
|
+
export { createDocx, default as repackDocx, updateMultipleFiles } from './docx/rezip.js';
|
|
23
|
+
export { a as attemptSelectiveSave } from './selectiveSave-CWaPEv0B.js';
|
|
24
|
+
export { b as buildPatchedDocumentXml, v as validatePatchSafety } from './selectiveXmlPatch-ypkxlTD_.js';
|
|
25
|
+
export { C as CreateEmptyDocumentOptions, P as ProcessTemplateOptions, a as ProcessTemplateResult, z as ThemeMatrixCell, b as blendColors, c as colorsEqual, d as createDocumentWithText, e as createEmptyDocument, f as createRgbColor, h as createThemeColor, i as darkenColor, A as ensureHexPrefix, B as generateThemeTintShadeMatrix, j as getContrastingColor, l as getTemplateTags, D as getThemeTintShadeHex, m as isBlack, n as isWhite, o as lightenColor, p as parseColorString, r as processTemplate, t as processTemplateAsBlob, u as processTemplateDetailed, v as resolveColor, w as resolveHighlightColor, E as resolveHighlightToCss, x as resolveShadingColor, y as validateTemplate } from './colorResolver-BZ_yScf4.js';
|
|
26
|
+
export { A as AgentContextOptions, D as DocumentAgent, E as ExtendedSelectionContext, e as SelectionContextOptions, f as buildExtendedSelectionContext, g as buildSelectionContext, k as executeCommand, l as executeCommands, m as getAgentContext, n as getDocumentSummary } from './selectionContext-BPAqgNgk.js';
|
|
27
|
+
export { emuToPixels, emuToTwips, formatPx, halfPointsToPixels, pixelsToEmu, pixelsToTwips, pointsToPixels, twipsToEmu, twipsToPixels } from './utils/units.js';
|
|
28
|
+
export { 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, i as findPageBreaks, j as getLoadedFonts, k as hasPageBreakBefore, l as insertHorizontalRule, m as insertPageBreak, n as isBreakContent, o as isColumnBreak, p as isFontLoaded, q as isFontsLoading, r as isLineBreak, s as isPageBreak, t as loadFont, u as loadFontFromBuffer, v as loadFonts, w as onFontsLoaded, x as preloadCommonFonts, y as removePageBreak } from './fontLoader-CK2QLq68.js';
|
|
29
|
+
export { D as DocxInput, t as toArrayBuffer } from './docxInput-DTbCa48g.js';
|
|
30
|
+
export { f as findParagraphByParaId, a as findStartPosForParaId } from './findParagraphByParaId-Maw_8M5D.js';
|
|
31
|
+
export { V as VariableDetectionResult, a as VariableOccurrence, d as detectVariables, b as detectVariablesDetailed, c as detectVariablesInBody, e as detectVariablesInParagraph, f as documentHasVariables, g as extractVariablesFromText, h as formatVariable, i as hasTemplateVariables, j as isValidVariableName, p as parseVariable, r as removeVariables, k as replaceVariables, s as sanitizeVariableName } from './variableDetector-sBkgVh3f.js';
|
|
32
|
+
import { Document } from './types/document.js';
|
|
33
|
+
export { DocxPackage } from './types/document.js';
|
|
34
|
+
export { AIAction, AIActionRequest, AgentCommand, AgentContext, AgentResponse, ApplyStyleCommand, DeleteTextCommand, FormatTextCommand, InsertHyperlinkCommand, InsertImageCommand, InsertTableCommand, InsertTextCommand, ParagraphContext, Position, Range, ReplaceTextCommand, SelectionContext, SetVariableCommand, SuggestedAction } from './types/agentApi.js';
|
|
35
|
+
export { EditorPluginCore, PanelConfig, PluginPanelProps, PositionCoordinates, RenderedDomContext } from './plugin-api/types.js';
|
|
36
|
+
export { b as CorePlugin, M as McpSession, f as McpToolDefinition, g as McpToolHandler, h as McpToolResult } from './types-DXG7vqe9.js';
|
|
37
|
+
export { P as PluginRegistry, p as pluginRegistry, r as registerPlugins } from './registry-E5pahPKL.js';
|
|
38
|
+
export { docxtemplaterPlugin } from './core-plugins.js';
|
|
39
|
+
import { S as Subscribable } from './Subscribable-DOz6Ohoo.js';
|
|
40
|
+
import { ErrorManagerSnapshot, PluginLifecycleSnapshot, PluginLifecycleConfig } from './managers/types.js';
|
|
41
|
+
export { AutoSaveManagerOptions, AutoSaveSnapshot, AutoSaveStatus, CellCoordinates, EditorHandle, ErrorNotification, ErrorSeverity, SavedDocumentData, TableSelectionSnapshot } from './managers/types.js';
|
|
42
|
+
export { AutoSaveManager, formatLastSaveTime, formatStorageSize, getAutoSaveStatusLabel, getAutoSaveStorageSize, isAutoSaveSupported } from './managers/AutoSaveManager.js';
|
|
43
|
+
export { TABLE_DATA_ATTRIBUTES, TableSelectionManager, deleteTableFromDocument, findTableFromClick, getTableFromDocument, updateTableInDocument } from './managers/TableSelectionManager.js';
|
|
44
|
+
import { R as Run } from './content-CmqAwdFL.js';
|
|
45
|
+
export { B as BlockContent, w as BookmarkEnd, x as BookmarkStart, C as Comment, a as CommentRangeEnd, b as CommentRangeStart, D as Deletion, c as DocumentBody, E as Endnote, O as Field, V as FooterReference, F as Footnote, u as HeaderFooter, Z as HeaderReference, H as Hyperlink, I as Image, d as Insertion, L as ListLevel, M as MoveFrom, e as MoveTo, N as NumberingDefinitions, P as Paragraph, f as ParagraphContent, g as RunContent, S as SectionProperties, ap as Shape, T as Table, h as TableCell, i as TableRow, aA as TextBox, j as TextContent, k as TrackedChangeInfo, l as TrackedRunChange } from './content-CmqAwdFL.js';
|
|
46
|
+
import { EditorView } from 'prosemirror-view';
|
|
47
|
+
export { FlowBlock, FootnoteContent, Layout, Measure, Page } from './layout-engine/types.js';
|
|
48
|
+
export { P as ParagraphFormatting, T as TextFormatting } from './formatting-_OXU8gLB.js';
|
|
49
|
+
export { C as ConvertFootnoteOptions, a as ConvertHeaderFooterOptions, F as FOOTNOTE_SEPARATOR_HEIGHT, H as HeaderFooterMetrics, M as MAX_FOOTNOTE_LAYOUT_PASSES, b as MeasureBlocksFn, S as StabilizeFootnoteLayoutArgs, c as StabilizeFootnoteLayoutResult, d as buildFootnoteContentMap, e as buildFootnoteRenderItems, f as calculateFootnoteReservedHeights, g as collectFootnoteRefs, h as convertHeaderFooterToContent, i as footnoteReservedHeightsEqual, m as mapFootnotesToPages, s as stabilizeFootnoteLayout } from './headerFooterLayout-Ca4ESDHF.js';
|
|
50
|
+
export { R as Relationship, S as Style, a as StyleDefinitions, T as Theme, f as ThemeColorScheme, g as ThemeFont, h as ThemeFontScheme } from './styles-BBv7doYK.js';
|
|
51
|
+
import './colors-C3vA7HUU.js';
|
|
52
|
+
import './docx/wrapTypes.js';
|
|
53
|
+
import 'jszip';
|
|
54
|
+
import 'prosemirror-model';
|
|
55
|
+
import 'prosemirror-state';
|
|
56
|
+
import './footnotes-skVvEHvZ.js';
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* ClipboardManager
|
|
60
|
+
*
|
|
61
|
+
* Framework-agnostic class for clipboard operations in the editor.
|
|
62
|
+
* Extracted from the React `useClipboard` hook.
|
|
63
|
+
*
|
|
64
|
+
* Handles:
|
|
65
|
+
* - DOM selection traversal and run extraction
|
|
66
|
+
* - Formatting extraction from computed styles
|
|
67
|
+
* - Clipboard read/write operations
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
/** Selection data for clipboard operations */
|
|
71
|
+
interface ClipboardSelection {
|
|
72
|
+
text: string;
|
|
73
|
+
runs: Run[];
|
|
74
|
+
startParagraphIndex: number;
|
|
75
|
+
startRunIndex: number;
|
|
76
|
+
startOffset: number;
|
|
77
|
+
endParagraphIndex: number;
|
|
78
|
+
endRunIndex: number;
|
|
79
|
+
endOffset: number;
|
|
80
|
+
isMultiParagraph: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Convert a CSS color string (rgb/rgba/hex) to a 6-char uppercase hex string.
|
|
84
|
+
*
|
|
85
|
+
* NOTE: This differs from `colorResolver.rgbToHex(r, g, b)` which takes
|
|
86
|
+
* numeric components. This function parses CSS color strings.
|
|
87
|
+
*/
|
|
88
|
+
declare function cssColorToHex(color: string): string | null;
|
|
89
|
+
/** Extract formatting from an HTML element's computed styles. */
|
|
90
|
+
declare function extractFormattingFromElement(element: HTMLElement): Run['formatting'];
|
|
91
|
+
/** Get selected runs from the current DOM selection. */
|
|
92
|
+
declare function getSelectionRuns(): Run[];
|
|
93
|
+
/** Create a ClipboardSelection from the current DOM selection. */
|
|
94
|
+
declare function createSelectionFromDOM(): ClipboardSelection | null;
|
|
95
|
+
declare const rgbToHex: typeof cssColorToHex;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* ErrorManager
|
|
99
|
+
*
|
|
100
|
+
* Framework-agnostic pub/sub error notification system.
|
|
101
|
+
* Replaces React's `componentDidCatch` + context pattern for error notifications.
|
|
102
|
+
*
|
|
103
|
+
* Usage with React:
|
|
104
|
+
* ```ts
|
|
105
|
+
* const { notifications } = useSyncExternalStore(manager.subscribe, manager.getSnapshot);
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
declare class ErrorManager extends Subscribable<ErrorManagerSnapshot> {
|
|
110
|
+
private notifications;
|
|
111
|
+
private idCounter;
|
|
112
|
+
private timers;
|
|
113
|
+
constructor();
|
|
114
|
+
/** Show an error notification (persistent, not auto-dismissed). */
|
|
115
|
+
showError(message: string, details?: string): string;
|
|
116
|
+
/** Show a warning notification (auto-dismissed after 5s). */
|
|
117
|
+
showWarning(message: string, details?: string): string;
|
|
118
|
+
/** Show an info notification (auto-dismissed after 5s). */
|
|
119
|
+
showInfo(message: string, details?: string): string;
|
|
120
|
+
/** Dismiss a notification by ID. */
|
|
121
|
+
dismiss(id: string): void;
|
|
122
|
+
/** Clear all notifications and cancel pending timers. */
|
|
123
|
+
clearAll(): void;
|
|
124
|
+
/** Destroy the manager and clean up all timers. */
|
|
125
|
+
destroy(): void;
|
|
126
|
+
private addNotification;
|
|
127
|
+
private emitSnapshot;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* PluginLifecycleManager
|
|
132
|
+
*
|
|
133
|
+
* Framework-agnostic class for managing editor plugin lifecycle.
|
|
134
|
+
* Extracted from React's `PluginHost.tsx`.
|
|
135
|
+
*
|
|
136
|
+
* Handles:
|
|
137
|
+
* - Plugin initialization and state tracking
|
|
138
|
+
* - Plugin state updates via `updateStates()`
|
|
139
|
+
* - Plugin destroy/cleanup
|
|
140
|
+
*
|
|
141
|
+
* Does NOT handle (framework hosts are responsible for):
|
|
142
|
+
* - CSS injection (use the exported `injectStyles` utility)
|
|
143
|
+
* - DOM event listeners / dispatch wrapping
|
|
144
|
+
*/
|
|
145
|
+
|
|
146
|
+
/** Inject CSS styles into the document head. Returns a cleanup function. */
|
|
147
|
+
declare function injectStyles(pluginId: string, css: string): () => void;
|
|
148
|
+
declare class PluginLifecycleManager extends Subscribable<PluginLifecycleSnapshot> {
|
|
149
|
+
private plugins;
|
|
150
|
+
private pluginStates;
|
|
151
|
+
private version;
|
|
152
|
+
constructor();
|
|
153
|
+
/**
|
|
154
|
+
* Initialize plugins with an editor view.
|
|
155
|
+
* Calls `plugin.initialize(editorView)` for each plugin.
|
|
156
|
+
*
|
|
157
|
+
* Note: CSS injection and DOM event listeners are the responsibility
|
|
158
|
+
* of the framework-specific host (e.g. React PluginHost).
|
|
159
|
+
*/
|
|
160
|
+
initialize(plugins: PluginLifecycleConfig[], editorView: EditorView): void;
|
|
161
|
+
/**
|
|
162
|
+
* Update all plugin states by calling `onStateChange` on each plugin.
|
|
163
|
+
* Returns true if any plugin state changed.
|
|
164
|
+
*/
|
|
165
|
+
updateStates(editorView: EditorView): boolean;
|
|
166
|
+
/** Get plugin state by ID. */
|
|
167
|
+
getPluginState<T>(pluginId: string): T | undefined;
|
|
168
|
+
/** Set plugin state by ID. */
|
|
169
|
+
setPluginState<T>(pluginId: string, state: T): void;
|
|
170
|
+
/** Destroy all plugins and clean up. */
|
|
171
|
+
destroy(): void;
|
|
172
|
+
private destroyPlugins;
|
|
173
|
+
private emitSnapshot;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* LayoutCoordinator
|
|
178
|
+
*
|
|
179
|
+
* Framework-agnostic class coordinating the PM state → layout engine →
|
|
180
|
+
* layout painter → selection overlay pipeline.
|
|
181
|
+
*
|
|
182
|
+
* Extracted from PagedEditor.tsx. Manages:
|
|
183
|
+
* - Layout pipeline state (blocks, measures, layout)
|
|
184
|
+
* - Selection state (selectionRects, caretPosition)
|
|
185
|
+
* - Drag selection state
|
|
186
|
+
* - Column resize state
|
|
187
|
+
* - Image interaction state
|
|
188
|
+
*
|
|
189
|
+
* Usage with React:
|
|
190
|
+
* ```ts
|
|
191
|
+
* const snapshot = useSyncExternalStore(coordinator.subscribe, coordinator.getSnapshot);
|
|
192
|
+
* ```
|
|
193
|
+
*
|
|
194
|
+
* NOTE: This class defines the state shape and subscription pattern.
|
|
195
|
+
* Full integration with PagedEditor is done incrementally.
|
|
196
|
+
*/
|
|
197
|
+
|
|
198
|
+
/** Selection rectangle for rendering selection overlays */
|
|
199
|
+
interface SelectionRect {
|
|
200
|
+
x: number;
|
|
201
|
+
y: number;
|
|
202
|
+
width: number;
|
|
203
|
+
height: number;
|
|
204
|
+
pageIndex: number;
|
|
205
|
+
}
|
|
206
|
+
/** Caret position for rendering the blinking cursor */
|
|
207
|
+
interface CaretPosition {
|
|
208
|
+
x: number;
|
|
209
|
+
y: number;
|
|
210
|
+
height: number;
|
|
211
|
+
pageIndex: number;
|
|
212
|
+
}
|
|
213
|
+
/** Info about the currently selected/hovered image */
|
|
214
|
+
interface ImageSelectionInfo {
|
|
215
|
+
pmPos: number;
|
|
216
|
+
pageIndex: number;
|
|
217
|
+
rect: {
|
|
218
|
+
x: number;
|
|
219
|
+
y: number;
|
|
220
|
+
width: number;
|
|
221
|
+
height: number;
|
|
222
|
+
};
|
|
223
|
+
widthEmu: number;
|
|
224
|
+
heightEmu: number;
|
|
225
|
+
isInline: boolean;
|
|
226
|
+
}
|
|
227
|
+
/** Column resize tracking state */
|
|
228
|
+
interface ColumnResizeState {
|
|
229
|
+
isResizing: boolean;
|
|
230
|
+
startX: number;
|
|
231
|
+
columnIndex: number;
|
|
232
|
+
tablePmStart: number;
|
|
233
|
+
originalWidths: {
|
|
234
|
+
left: number;
|
|
235
|
+
right: number;
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/** The full snapshot exposed to UI frameworks */
|
|
239
|
+
interface LayoutCoordinatorSnapshot {
|
|
240
|
+
/** Computed page layout, null until first computation */
|
|
241
|
+
hasLayout: boolean;
|
|
242
|
+
/** Selection rectangles for range selection overlay */
|
|
243
|
+
selectionRects: SelectionRect[];
|
|
244
|
+
/** Caret position for cursor overlay */
|
|
245
|
+
caretPosition: CaretPosition | null;
|
|
246
|
+
/** Currently selected/hovered image */
|
|
247
|
+
selectedImageInfo: ImageSelectionInfo | null;
|
|
248
|
+
/** Whether the editor is focused */
|
|
249
|
+
isFocused: boolean;
|
|
250
|
+
/** Whether a text drag is in progress */
|
|
251
|
+
isDragging: boolean;
|
|
252
|
+
/** Whether a column resize is in progress */
|
|
253
|
+
isResizingColumn: boolean;
|
|
254
|
+
/** Whether an image interaction is in progress */
|
|
255
|
+
isImageInteracting: boolean;
|
|
256
|
+
/** Version counter — incremented on every state change */
|
|
257
|
+
version: number;
|
|
258
|
+
}
|
|
259
|
+
declare class LayoutCoordinator extends Subscribable<LayoutCoordinatorSnapshot> {
|
|
260
|
+
private _hasLayout;
|
|
261
|
+
private _selectionRects;
|
|
262
|
+
private _caretPosition;
|
|
263
|
+
private _isDragging;
|
|
264
|
+
private _dragAnchor;
|
|
265
|
+
private _columnResize;
|
|
266
|
+
private _selectedImageInfo;
|
|
267
|
+
private _isImageInteracting;
|
|
268
|
+
private _isFocused;
|
|
269
|
+
private _version;
|
|
270
|
+
constructor();
|
|
271
|
+
/** Notify that layout has been computed. */
|
|
272
|
+
setLayoutReady(hasLayout: boolean): void;
|
|
273
|
+
/** Update selection rectangles and caret position. */
|
|
274
|
+
updateSelection(selectionRects: SelectionRect[], caretPosition: CaretPosition | null): void;
|
|
275
|
+
/** Start a drag selection from the given PM anchor position. */
|
|
276
|
+
startDrag(anchor: number): void;
|
|
277
|
+
/** End drag selection. */
|
|
278
|
+
endDrag(): void;
|
|
279
|
+
/** Get the drag anchor position. */
|
|
280
|
+
getDragAnchor(): number | null;
|
|
281
|
+
/** Start resizing a table column. */
|
|
282
|
+
startColumnResize(tablePmStart: number, columnIndex: number, startX: number, originalWidths: {
|
|
283
|
+
left: number;
|
|
284
|
+
right: number;
|
|
285
|
+
}): void;
|
|
286
|
+
/** End column resize. */
|
|
287
|
+
endColumnResize(): void;
|
|
288
|
+
/** Get current column resize state. */
|
|
289
|
+
getColumnResize(): ColumnResizeState;
|
|
290
|
+
/** Set the currently selected image. */
|
|
291
|
+
setSelectedImage(imageInfo: ImageSelectionInfo | null): void;
|
|
292
|
+
/** Clear the image selection. */
|
|
293
|
+
clearSelectedImage(): void;
|
|
294
|
+
/** Set whether an image interaction (resize/move) is in progress. */
|
|
295
|
+
setImageInteracting(interacting: boolean): void;
|
|
296
|
+
/** Update focus state. */
|
|
297
|
+
setFocused(focused: boolean): void;
|
|
298
|
+
private emitSnapshot;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* EditorCoordinator
|
|
303
|
+
*
|
|
304
|
+
* Framework-agnostic class managing the document editor lifecycle:
|
|
305
|
+
* - Document parsing and loading
|
|
306
|
+
* - Font loading coordination
|
|
307
|
+
* - Zoom level management
|
|
308
|
+
* - Extension manager initialization
|
|
309
|
+
* - Agent command execution
|
|
310
|
+
*
|
|
311
|
+
* Extracted from DocxEditor.tsx.
|
|
312
|
+
*
|
|
313
|
+
* Usage with React:
|
|
314
|
+
* ```ts
|
|
315
|
+
* const snapshot = useSyncExternalStore(coordinator.subscribe, coordinator.getSnapshot);
|
|
316
|
+
* ```
|
|
317
|
+
*
|
|
318
|
+
* NOTE: This class defines the state shape and coordination logic.
|
|
319
|
+
* Full integration with DocxEditor is done incrementally.
|
|
320
|
+
*/
|
|
321
|
+
|
|
322
|
+
/** Editor loading state */
|
|
323
|
+
type EditorLoadingState = 'idle' | 'parsing' | 'loading-fonts' | 'ready' | 'error';
|
|
324
|
+
/** Configuration for EditorCoordinator */
|
|
325
|
+
interface EditorCoordinatorOptions {
|
|
326
|
+
/** Initial zoom level (default: 1.0) */
|
|
327
|
+
initialZoom?: number;
|
|
328
|
+
/** Callback when the document changes */
|
|
329
|
+
onChange?: (document: Document) => void;
|
|
330
|
+
/** Callback when an error occurs */
|
|
331
|
+
onError?: (error: Error) => void;
|
|
332
|
+
}
|
|
333
|
+
/** The full snapshot exposed to UI frameworks */
|
|
334
|
+
interface EditorCoordinatorSnapshot {
|
|
335
|
+
/** Current loading state */
|
|
336
|
+
loadingState: EditorLoadingState;
|
|
337
|
+
/** Error message if loadingState is 'error' */
|
|
338
|
+
parseError: string | null;
|
|
339
|
+
/** Whether the editor is ready for interaction */
|
|
340
|
+
isReady: boolean;
|
|
341
|
+
/** Current zoom level (1.0 = 100%) */
|
|
342
|
+
zoom: number;
|
|
343
|
+
/** Whether fonts have been loaded */
|
|
344
|
+
fontsLoaded: boolean;
|
|
345
|
+
/** Version counter */
|
|
346
|
+
version: number;
|
|
347
|
+
}
|
|
348
|
+
declare class EditorCoordinator extends Subscribable<EditorCoordinatorSnapshot> {
|
|
349
|
+
private _loadingState;
|
|
350
|
+
private _parseError;
|
|
351
|
+
private _zoom;
|
|
352
|
+
private _fontsLoaded;
|
|
353
|
+
private _document;
|
|
354
|
+
private _version;
|
|
355
|
+
private onChangeCallback?;
|
|
356
|
+
private onErrorCallback?;
|
|
357
|
+
constructor(options?: EditorCoordinatorOptions);
|
|
358
|
+
/** Signal that document parsing has started. */
|
|
359
|
+
setParsingStarted(): void;
|
|
360
|
+
/** Signal that document parsing completed successfully. */
|
|
361
|
+
setDocumentLoaded(document: Document): void;
|
|
362
|
+
/** Signal that font loading completed. */
|
|
363
|
+
setFontsLoaded(): void;
|
|
364
|
+
/** Signal that an error occurred during loading. */
|
|
365
|
+
setLoadError(error: Error): void;
|
|
366
|
+
/** Get the current document. */
|
|
367
|
+
getDocument(): Document | null;
|
|
368
|
+
/** Update the document (after edits). */
|
|
369
|
+
updateDocument(document: Document): void;
|
|
370
|
+
/** Set the zoom level (1.0 = 100%). */
|
|
371
|
+
setZoom(zoom: number): void;
|
|
372
|
+
/** Get the current zoom level. */
|
|
373
|
+
getZoom(): number;
|
|
374
|
+
private emitSnapshot;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* @zeke-02/docx-editor-core (default entry point)
|
|
379
|
+
*
|
|
380
|
+
* Fat barrel that re-exports the parser, serializer, agent, plugin
|
|
381
|
+
* registry, and the most-used types. No React/DOM imports.
|
|
382
|
+
*
|
|
383
|
+
* **When to import from `.` vs `./headless`:** identical for Node.js
|
|
384
|
+
* use; `.` is the convenient aggregate, `./headless` is its mirror with
|
|
385
|
+
* a slightly different name suffix. Adapter authors who only need a
|
|
386
|
+
* specific slice should prefer the smaller subpaths (`./docx`, `./agent`,
|
|
387
|
+
* `./prosemirror`, `./layout-*`, `./utils`) — they tree-shake better.
|
|
388
|
+
*
|
|
389
|
+
* @example
|
|
390
|
+
* ```ts
|
|
391
|
+
* import { parseDocx, serializeDocx, resolveColor } from '@zeke-02/docx-editor-core';
|
|
392
|
+
* ```
|
|
393
|
+
* @packageDocumentation
|
|
394
|
+
* @public
|
|
395
|
+
*/
|
|
396
|
+
declare const VERSION = "0.0.2";
|
|
397
|
+
|
|
398
|
+
export { type CaretPosition, type ClipboardSelection, type ColumnResizeState, Document, EditorCoordinator, type EditorCoordinatorOptions, type EditorCoordinatorSnapshot, type EditorLoadingState, ErrorManager, ErrorManagerSnapshot, type ImageSelectionInfo, LayoutCoordinator, type LayoutCoordinatorSnapshot, PluginLifecycleConfig, PluginLifecycleManager, PluginLifecycleSnapshot, Run, type SelectionRect, Subscribable, VERSION, createSelectionFromDOM, extractFormattingFromElement, getSelectionRuns, injectStyles, rgbToHex };
|
package/dist/core.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkTE2VQJZG_js=require('./chunk-TE2VQJZG.js'),chunk4G6AJ4ZM_js=require('./chunk-4G6AJ4ZM.js'),chunkY74ANBPV_js=require('./chunk-Y74ANBPV.js'),chunkCXQDYR2Y_js=require('./chunk-CXQDYR2Y.js');require('./chunk-YUZQTRI2.js');var chunk7U4I6BKJ_js=require('./chunk-7U4I6BKJ.js');require('./chunk-HKVAW3RE.js'),require('./chunk-7RDCZLTU.js'),require('./chunk-SORYYVJ7.js'),require('./chunk-LTHT4A4S.js'),require('./chunk-IMKU4O3P.js'),require('./chunk-DROCYKAR.js');var chunkKESNGXGO_js=require('./chunk-KESNGXGO.js'),chunkL2U3TTAD_js=require('./chunk-L2U3TTAD.js'),chunkRQN4C636_js=require('./chunk-RQN4C636.js'),chunkNXLJVVVE_js=require('./chunk-NXLJVVVE.js'),chunkJ4J2Y6EU_js=require('./chunk-J4J2Y6EU.js'),chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkTE2AF7FM_js=require('./chunk-TE2AF7FM.js'),chunkERNVFCGN_js=require('./chunk-ERNVFCGN.js'),chunkFRYMBAHP_js=require('./chunk-FRYMBAHP.js'),chunk4BFNWPKW_js=require('./chunk-4BFNWPKW.js'),chunkLCICADWM_js=require('./chunk-LCICADWM.js');require('./chunk-F44ZLDZS.js'),require('./chunk-44FHVKSI.js');var chunkMNOHUTKE_js=require('./chunk-MNOHUTKE.js'),chunkI6PMX4BO_js=require('./chunk-I6PMX4BO.js');require('./chunk-7AMYZMCX.js'),require('./chunk-D4RPOJC7.js'),require('./chunk-IP2VXNWG.js'),require('./chunk-JFZIXFRC.js'),require('./chunk-MZOVDLYL.js'),require('./chunk-E4JMCA5X.js'),require('./chunk-HQPWFUP5.js'),require('./chunk-DV6GWBUJ.js'),require('./chunk-SHJBS42Y.js'),require('./chunk-MCFHOMA2.js'),require('./chunk-BHBOAP6Z.js'),require('./chunk-MZ7LW5CH.js'),require('./chunk-N3Y5BUKV.js'),require('./chunk-YTDWMXNS.js'),require('./chunk-6LVPRTB6.js'),require('./chunk-TUIEV7Q7.js'),require('./chunk-7HANRHHL.js');var chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js');require('./chunk-C2BAPYGJ.js');var chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');require('./chunk-Q4CKLXWA.js');var chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');function L(i){if(!i||i==="transparent"||i==="inherit")return null;if(i.startsWith("#"))return i.slice(1).toUpperCase();let o=i.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(o){let e=parseInt(o[1]).toString(16).padStart(2,"0"),t=parseInt(o[2]).toString(16).padStart(2,"0"),n=parseInt(o[3]).toString(16).padStart(2,"0");return (e+t+n).toUpperCase()}return null}function h(i){let o=window.getComputedStyle(i),e={};(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(e.bold=true),o.fontStyle==="italic"&&(e.italic=true);let t=o.textDecoration||o.textDecorationLine;t&&t.includes("underline")&&(e.underline={style:"single"}),t&&t.includes("line-through")&&(e.strike=true);let n=parseFloat(o.fontSize);!isNaN(n)&&n>0&&(e.fontSize=Math.round(n/1.333*2));let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(e.fontFamily={ascii:r});let s=o.color;if(s&&s!=="rgb(0, 0, 0)"){let c=L(s);c&&(e.color={rgb:c});}let l=o.backgroundColor;if(l&&l!=="transparent"&&l!=="rgba(0, 0, 0, 0)"){let c=S(l);c&&(e.shading={fill:{rgb:c}});}return Object.keys(e).length>0?e:void 0}function Lt(i,o){let e=document.createRange();e.selectNodeContents(i);let t=o.compareBoundaryPoints(Range.START_TO_START,e)>=0&&o.compareBoundaryPoints(Range.START_TO_END,e)<=0,n=o.compareBoundaryPoints(Range.END_TO_START,e)>=0&&o.compareBoundaryPoints(Range.END_TO_END,e)<=0;if(t&&n)return o.toString();if(t){let r=document.createRange();return r.setStart(o.startContainer,o.startOffset),r.selectNodeContents(i),r.setEnd(e.endContainer,e.endOffset),r.toString()}else if(n){let r=document.createRange();return r.selectNodeContents(i),r.setEnd(o.endContainer,o.endOffset),r.setStart(e.startContainer,e.startOffset),r.toString()}else if(o.intersectsNode(i))return i.textContent||"";return ""}function F(i){let o=i;for(;o;){if(o.nodeType===Node.ELEMENT_NODE){let e=o;if(e.hasAttribute("data-paragraph-index"))return e}o=o.parentNode;}return null}function f(){let i=window.getSelection();if(!i||i.isCollapsed)return [];let o=[],e=i.getRangeAt(0),t=e.commonAncestorContainer,n=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;if(!n)return o;if(n.querySelectorAll(".docx-run").forEach(s=>{if(e.intersectsNode(s)){let l=Lt(s,e);if(l){let c=h(s);o.push({type:"run",formatting:c,content:[{type:"text",text:l}]});}}}),o.length===0){let s=i.toString();s&&o.push({type:"run",content:[{type:"text",text:s}]});}return o}function A(){let i=window.getSelection();if(!i||i.isCollapsed)return null;let o=f();if(o.length===0)return null;let e=i.toString(),t=i.getRangeAt(0),n=F(t.startContainer),r=F(t.endContainer),s=n?parseInt(n.getAttribute("data-paragraph-index")||"0",10):0,l=r?parseInt(r.getAttribute("data-paragraph-index")||"0",10):0;return {text:e,runs:o,startParagraphIndex:s,startRunIndex:0,startOffset:t.startOffset,endParagraphIndex:l,endRunIndex:0,endOffset:t.endOffset,isMultiParagraph:s!==l}}var S=L;var d=class extends chunkY74ANBPV_js.a{constructor(){super({notifications:[]});chunkDC7S76ZX_js.a(this,"notifications",[]);chunkDC7S76ZX_js.a(this,"idCounter",0);chunkDC7S76ZX_js.a(this,"timers",new Set);}showError(e,t){return this.addNotification(e,"error",t)}showWarning(e,t){return this.addNotification(e,"warning",t)}showInfo(e,t){return this.addNotification(e,"info",t)}dismiss(e){this.notifications=this.notifications.map(n=>n.id===e?{...n,dismissed:true}:n),this.emitSnapshot();let t=setTimeout(()=>{this.timers.delete(t),this.notifications=this.notifications.filter(n=>n.id!==e),this.emitSnapshot();},300);this.timers.add(t);}clearAll(){this.notifications=[];for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.emitSnapshot();}destroy(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.notifications=[];}addNotification(e,t,n){let r=`error-${++this.idCounter}-${Date.now()}`,s={id:r,message:e,severity:t,details:n,timestamp:Date.now()};if(this.notifications=[...this.notifications,s],this.emitSnapshot(),t!=="error"){let l=setTimeout(()=>{this.timers.delete(l),this.dismiss(r);},5e3);this.timers.add(l);}return r}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};function z(i,o){let e=`plugin-styles-${i}`,t=document.getElementById(e);t&&t.remove();let n=document.createElement("style");return n.id=e,n.textContent=o,document.head.appendChild(n),()=>{let r=document.getElementById(e);r&&r.remove();}}var u=class extends chunkY74ANBPV_js.a{constructor(){super({states:new Map,version:0});chunkDC7S76ZX_js.a(this,"plugins",[]);chunkDC7S76ZX_js.a(this,"pluginStates",new Map);chunkDC7S76ZX_js.a(this,"version",0);}initialize(e,t){this.destroyPlugins(),this.plugins=e;for(let n of e)n.initialize&&!this.pluginStates.has(n.id)&&this.pluginStates.set(n.id,n.initialize(t));this.emitSnapshot();}updateStates(e){let t=false;for(let n of this.plugins)if(n.onStateChange){let r=n.onStateChange(e);r!==void 0&&(this.pluginStates.set(n.id,r),t=true);}return t&&(this.version++,this.emitSnapshot()),t}getPluginState(e){return this.pluginStates.get(e)}setPluginState(e,t){this.pluginStates.set(e,t),this.version++,this.emitSnapshot();}destroy(){this.destroyPlugins(),this.emitSnapshot();}destroyPlugins(){for(let e of this.plugins)e.destroy&&e.destroy();this.pluginStates.clear(),this.plugins=[];}emitSnapshot(){this.setSnapshot({states:new Map(this.pluginStates),version:this.version});}};var p=class extends chunkY74ANBPV_js.a{constructor(){super({hasLayout:false,selectionRects:[],caretPosition:null,selectedImageInfo:null,isFocused:false,isDragging:false,isResizingColumn:false,isImageInteracting:false,version:0});chunkDC7S76ZX_js.a(this,"_hasLayout",false);chunkDC7S76ZX_js.a(this,"_selectionRects",[]);chunkDC7S76ZX_js.a(this,"_caretPosition",null);chunkDC7S76ZX_js.a(this,"_isDragging",false);chunkDC7S76ZX_js.a(this,"_dragAnchor",null);chunkDC7S76ZX_js.a(this,"_columnResize",{isResizing:false,startX:0,columnIndex:0,tablePmStart:0,originalWidths:{left:0,right:0}});chunkDC7S76ZX_js.a(this,"_selectedImageInfo",null);chunkDC7S76ZX_js.a(this,"_isImageInteracting",false);chunkDC7S76ZX_js.a(this,"_isFocused",false);chunkDC7S76ZX_js.a(this,"_version",0);}setLayoutReady(e){this._hasLayout=e,this.emitSnapshot();}updateSelection(e,t){this._selectionRects=e,this._caretPosition=t,this.emitSnapshot();}startDrag(e){this._isDragging=true,this._dragAnchor=e,this.emitSnapshot();}endDrag(){this._isDragging=false,this._dragAnchor=null,this.emitSnapshot();}getDragAnchor(){return this._dragAnchor}startColumnResize(e,t,n,r){this._columnResize={isResizing:true,startX:n,columnIndex:t,tablePmStart:e,originalWidths:r},this.emitSnapshot();}endColumnResize(){this._columnResize={...this._columnResize,isResizing:false},this.emitSnapshot();}getColumnResize(){return this._columnResize}setSelectedImage(e){this._selectedImageInfo=e,this.emitSnapshot();}clearSelectedImage(){this._selectedImageInfo=null,this._isImageInteracting=false,this.emitSnapshot();}setImageInteracting(e){this._isImageInteracting=e,this.emitSnapshot();}setFocused(e){this._isFocused=e,this.emitSnapshot();}emitSnapshot(){this._version++,this.setSnapshot({hasLayout:this._hasLayout,selectionRects:this._selectionRects,caretPosition:this._caretPosition,selectedImageInfo:this._selectedImageInfo,isFocused:this._isFocused,isDragging:this._isDragging,isResizingColumn:this._columnResize.isResizing,isImageInteracting:this._isImageInteracting,version:this._version});}};var g=class extends chunkY74ANBPV_js.a{constructor(e={}){let t=e.initialZoom??1;super({loadingState:"idle",parseError:null,isReady:false,zoom:t,fontsLoaded:false,version:0});chunkDC7S76ZX_js.a(this,"_loadingState","idle");chunkDC7S76ZX_js.a(this,"_parseError",null);chunkDC7S76ZX_js.a(this,"_zoom");chunkDC7S76ZX_js.a(this,"_fontsLoaded",false);chunkDC7S76ZX_js.a(this,"_document",null);chunkDC7S76ZX_js.a(this,"_version",0);chunkDC7S76ZX_js.a(this,"onChangeCallback");chunkDC7S76ZX_js.a(this,"onErrorCallback");this._zoom=t,this.onChangeCallback=e.onChange,this.onErrorCallback=e.onError;}setParsingStarted(){this._loadingState="parsing",this._parseError=null,this.emitSnapshot();}setDocumentLoaded(e){this._document=e,this._loadingState="loading-fonts",this._parseError=null,this.emitSnapshot();}setFontsLoaded(){this._fontsLoaded=true,this._loadingState="ready",this.emitSnapshot();}setLoadError(e){this._loadingState="error",this._parseError=e.message,this.onErrorCallback?.(e),this.emitSnapshot();}getDocument(){return this._document}updateDocument(e){this._document=e,this.onChangeCallback?.(e),this.emitSnapshot();}setZoom(e){this._zoom=Math.max(.25,Math.min(4,e)),this.emitSnapshot();}getZoom(){return this._zoom}emitSnapshot(){this._version++,this.setSnapshot({loadingState:this._loadingState,parseError:this._parseError,isReady:this._loadingState==="ready",zoom:this._zoom,fontsLoaded:this._fontsLoaded,version:this._version});}};var to="0.0.2";Object.defineProperty(exports,"AutoSaveManager",{enumerable:true,get:function(){return chunkTE2VQJZG_js.a}});Object.defineProperty(exports,"formatLastSaveTime",{enumerable:true,get:function(){return chunkTE2VQJZG_js.b}});Object.defineProperty(exports,"formatStorageSize",{enumerable:true,get:function(){return chunkTE2VQJZG_js.e}});Object.defineProperty(exports,"getAutoSaveStatusLabel",{enumerable:true,get:function(){return chunkTE2VQJZG_js.c}});Object.defineProperty(exports,"getAutoSaveStorageSize",{enumerable:true,get:function(){return chunkTE2VQJZG_js.d}});Object.defineProperty(exports,"isAutoSaveSupported",{enumerable:true,get:function(){return chunkTE2VQJZG_js.f}});Object.defineProperty(exports,"TABLE_DATA_ATTRIBUTES",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.a}});Object.defineProperty(exports,"TableSelectionManager",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.f}});Object.defineProperty(exports,"deleteTableFromDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.e}});Object.defineProperty(exports,"findTableFromClick",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.b}});Object.defineProperty(exports,"getTableFromDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.c}});Object.defineProperty(exports,"updateTableInDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.d}});Object.defineProperty(exports,"Subscribable",{enumerable:true,get:function(){return chunkY74ANBPV_js.a}});Object.defineProperty(exports,"convertHeaderFooterToContent",{enumerable:true,get:function(){return chunkCXQDYR2Y_js.w}});Object.defineProperty(exports,"FOOTNOTE_SEPARATOR_HEIGHT",{enumerable:true,get:function(){return chunk7U4I6BKJ_js.a}});Object.defineProperty(exports,"MAX_FOOTNOTE_LAYOUT_PASSES",{enumerable:true,get:function(){return chunk7U4I6BKJ_js.b}});Object.defineProperty(exports,"buildFootnoteContentMap",{enumerable:true,get:function(){return chunk7U4I6BKJ_js.h}});Object.defineProperty(exports,"buildFootnoteRenderItems",{enumerable:true,get:function(){return chunk7U4I6BKJ_js.k}});Object.defineProperty(exports,"calculateFootnoteReservedHeights",{enumerable:true,get:function(){return chunk7U4I6BKJ_js.i}});Object.defineProperty(exports,"collectFootnoteRefs",{enumerable:true,get:function(){return chunk7U4I6BKJ_js.d}});Object.defineProperty(exports,"footnoteReservedHeightsEqual",{enumerable:true,get:function(){return chunk7U4I6BKJ_js.c}});Object.defineProperty(exports,"mapFootnotesToPages",{enumerable:true,get:function(){return chunk7U4I6BKJ_js.e}});Object.defineProperty(exports,"stabilizeFootnoteLayout",{enumerable:true,get:function(){return chunk7U4I6BKJ_js.j}});Object.defineProperty(exports,"countPageBreaks",{enumerable:true,get:function(){return chunkKESNGXGO_js.n}});Object.defineProperty(exports,"createColumnBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.b}});Object.defineProperty(exports,"createHorizontalRule",{enumerable:true,get:function(){return chunkKESNGXGO_js.g}});Object.defineProperty(exports,"createLineBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.c}});Object.defineProperty(exports,"createPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.a}});Object.defineProperty(exports,"createPageBreakParagraph",{enumerable:true,get:function(){return chunkKESNGXGO_js.e}});Object.defineProperty(exports,"createPageBreakRun",{enumerable:true,get:function(){return chunkKESNGXGO_js.d}});Object.defineProperty(exports,"findPageBreaks",{enumerable:true,get:function(){return chunkKESNGXGO_js.o}});Object.defineProperty(exports,"hasPageBreakBefore",{enumerable:true,get:function(){return chunkKESNGXGO_js.m}});Object.defineProperty(exports,"insertHorizontalRule",{enumerable:true,get:function(){return chunkKESNGXGO_js.h}});Object.defineProperty(exports,"insertPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.f}});Object.defineProperty(exports,"isBreakContent",{enumerable:true,get:function(){return chunkKESNGXGO_js.l}});Object.defineProperty(exports,"isColumnBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.j}});Object.defineProperty(exports,"isLineBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.k}});Object.defineProperty(exports,"isPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.i}});Object.defineProperty(exports,"removePageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.p}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkL2U3TTAD_js.a}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkL2U3TTAD_js.h}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkL2U3TTAD_js.g}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkL2U3TTAD_js.d}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkL2U3TTAD_js.f}});Object.defineProperty(exports,"attemptSelectiveSave",{enumerable:true,get:function(){return chunkRQN4C636_js.c}});Object.defineProperty(exports,"buildPatchedDocumentXml",{enumerable:true,get:function(){return chunkRQN4C636_js.b}});Object.defineProperty(exports,"validatePatchSafety",{enumerable:true,get:function(){return chunkRQN4C636_js.a}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunkNXLJVVVE_js.b}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunkNXLJVVVE_js.a}});Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkJ4J2Y6EU_js.b}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.i}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.g}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.j}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.h}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkESI4BSBF_js.e}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.a}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkESI4BSBF_js.c}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkESI4BSBF_js.b}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.f}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkTE2AF7FM_js.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkTE2AF7FM_js.b}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkERNVFCGN_js.s}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkERNVFCGN_js.h}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunkERNVFCGN_js.l}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunkFRYMBAHP_js.f}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunkFRYMBAHP_js.g}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunkFRYMBAHP_js.e}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.a}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunk4BFNWPKW_js.c}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkLCICADWM_js.f}});Object.defineProperty(exports,"canRenderFont",{enumerable:true,get:function(){return chunkMNOHUTKE_js.h}});Object.defineProperty(exports,"getLoadedFonts",{enumerable:true,get:function(){return chunkMNOHUTKE_js.e}});Object.defineProperty(exports,"isFontLoaded",{enumerable:true,get:function(){return chunkMNOHUTKE_js.c}});Object.defineProperty(exports,"isFontsLoading",{enumerable:true,get:function(){return chunkMNOHUTKE_js.d}});Object.defineProperty(exports,"loadFont",{enumerable:true,get:function(){return chunkMNOHUTKE_js.a}});Object.defineProperty(exports,"loadFontFromBuffer",{enumerable:true,get:function(){return chunkMNOHUTKE_js.i}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunkMNOHUTKE_js.b}});Object.defineProperty(exports,"onFontsLoaded",{enumerable:true,get:function(){return chunkMNOHUTKE_js.f}});Object.defineProperty(exports,"preloadCommonFonts",{enumerable:true,get:function(){return chunkMNOHUTKE_js.p}});Object.defineProperty(exports,"toArrayBuffer",{enumerable:true,get:function(){return chunkMNOHUTKE_js.s}});Object.defineProperty(exports,"findParagraphByParaId",{enumerable:true,get:function(){return chunkI6PMX4BO_js.b}});Object.defineProperty(exports,"findStartPosForParaId",{enumerable:true,get:function(){return chunkI6PMX4BO_js.a}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.m}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.r}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.j}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.i}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.k}});Object.defineProperty(exports,"ensureHexPrefix",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.n}});Object.defineProperty(exports,"generateThemeTintShadeMatrix",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.q}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.g}});Object.defineProperty(exports,"getThemeTintShadeHex",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.p}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.e}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.f}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.l}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.h}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.c}});Object.defineProperty(exports,"resolveHighlightToCss",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.o}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.d}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.e}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.g}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.p}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.j}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.f}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.d}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.i}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.h}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunk4Q2IP5FW_js.c}});exports.EditorCoordinator=g;exports.ErrorManager=d;exports.LayoutCoordinator=p;exports.PluginLifecycleManager=u;exports.VERSION=to;exports.createSelectionFromDOM=A;exports.extractFormattingFromElement=h;exports.getSelectionRuns=f;exports.injectStyles=z;exports.rgbToHex=S;
|
package/dist/core.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as AutoSaveManager,b as formatLastSaveTime,e as formatStorageSize,c as getAutoSaveStatusLabel,d as getAutoSaveStorageSize,f as isAutoSaveSupported}from'./chunk-6NQSIC27.mjs';export{a as TABLE_DATA_ATTRIBUTES,f as TableSelectionManager,e as deleteTableFromDocument,b as findTableFromClick,c as getTableFromDocument,d as updateTableInDocument}from'./chunk-JHZ3HLSR.mjs';import {a}from'./chunk-D6GO7UGD.mjs';export{a as Subscribable}from'./chunk-D6GO7UGD.mjs';export{w as convertHeaderFooterToContent}from'./chunk-56D223FM.mjs';import'./chunk-UCJGOQ4J.mjs';export{a as FOOTNOTE_SEPARATOR_HEIGHT,b as MAX_FOOTNOTE_LAYOUT_PASSES,h as buildFootnoteContentMap,k as buildFootnoteRenderItems,i as calculateFootnoteReservedHeights,d as collectFootnoteRefs,c as footnoteReservedHeightsEqual,e as mapFootnotesToPages,j as stabilizeFootnoteLayout}from'./chunk-QLPQVR5W.mjs';import'./chunk-5VBNOHRE.mjs';import'./chunk-YMZ3F2FZ.mjs';import'./chunk-MP4QSEO2.mjs';import'./chunk-6Y6LON6Y.mjs';import'./chunk-FCJWLEKT.mjs';import'./chunk-7E5VBRDL.mjs';export{n as countPageBreaks,b as createColumnBreak,g as createHorizontalRule,c as createLineBreak,a as createPageBreak,e as createPageBreakParagraph,d as createPageBreakRun,o as findPageBreaks,m as hasPageBreakBefore,h as insertHorizontalRule,f as insertPageBreak,l as isBreakContent,j as isColumnBreak,k as isLineBreak,i as isPageBreak,p as removePageBreak}from'./chunk-WTFLNYAT.mjs';export{a as DocumentAgent,h as buildExtendedSelectionContext,g as buildSelectionContext,d as getAgentContext,f as getDocumentSummary}from'./chunk-AGVFAXVQ.mjs';export{c as attemptSelectiveSave,b as buildPatchedDocumentXml,a as validatePatchSafety}from'./chunk-K7GVLZS6.mjs';export{b as createDocumentWithText,a as createEmptyDocument}from'./chunk-CKKO4JWE.mjs';export{b as docxtemplaterPlugin}from'./chunk-7Z2AGPNQ.mjs';export{a as detectVariables,b as detectVariablesDetailed,c as detectVariablesInBody,d as detectVariablesInParagraph,m as documentHasVariables,e as extractVariablesFromText,i as formatVariable,f as hasTemplateVariables,g as isValidVariableName,j as parseVariable,l as removeVariables,k as replaceVariables,h as sanitizeVariableName}from'./chunk-ARHPXIBJ.mjs';export{e as getTemplateTags,a as processTemplate,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-CGJ6S3AH.mjs';export{a as executeCommand,b as executeCommands}from'./chunk-CUY2THAO.mjs';export{s as createDocx,h as repackDocx,l as updateMultipleFiles}from'./chunk-QLX4HX3I.mjs';export{f as serializeDocumentBody,g as serializeDocx,e as serializeSectionProperties}from'./chunk-JZESIPVC.mjs';export{a as PluginRegistry,b as pluginRegistry,c as registerPlugins}from'./chunk-3NRMSZX2.mjs';export{f as parseDocx}from'./chunk-CTHHUJAB.mjs';import'./chunk-RFC2SXZ6.mjs';import'./chunk-BOOHU5EW.mjs';export{h as canRenderFont,e as getLoadedFonts,c as isFontLoaded,d as isFontsLoading,a as loadFont,i as loadFontFromBuffer,b as loadFonts,f as onFontsLoaded,p as preloadCommonFonts,s as toArrayBuffer}from'./chunk-7LRR7RKE.mjs';export{b as findParagraphByParaId,a as findStartPosForParaId}from'./chunk-3SXJPJSV.mjs';import'./chunk-NDDJ67FQ.mjs';import'./chunk-LBKMYD3M.mjs';import'./chunk-NBLJPT54.mjs';import'./chunk-QPFJJPIC.mjs';import'./chunk-ILJUDEZ5.mjs';import'./chunk-6ZXL3EIP.mjs';import'./chunk-OEXVWIHW.mjs';import'./chunk-WLHNIXWC.mjs';import'./chunk-J7NADDC4.mjs';import'./chunk-2MSZXH6Q.mjs';import'./chunk-MOKKS75W.mjs';import'./chunk-OZMNIX6U.mjs';import'./chunk-AMENZY5F.mjs';import'./chunk-VHUVPHPI.mjs';import'./chunk-BGY3CB37.mjs';import'./chunk-ZX26QZJ5.mjs';import'./chunk-MJ6XZFVD.mjs';export{m as blendColors,r as colorsEqual,j as createRgbColor,i as createThemeColor,k as darkenColor,n as ensureHexPrefix,q as generateThemeTintShadeMatrix,g as getContrastingColor,p as getThemeTintShadeHex,e as isBlack,f as isWhite,l as lightenColor,h as parseColorString,a as resolveColor,c as resolveHighlightColor,o as resolveHighlightToCss,d as resolveShadingColor}from'./chunk-67LVRQIR.mjs';import'./chunk-LE67NTCN.mjs';export{e as emuToPixels,g as emuToTwips,p as formatPx,j as halfPointsToPixels,f as pixelsToEmu,d as pixelsToTwips,i as pointsToPixels,h as twipsToEmu,c as twipsToPixels}from'./chunk-VW22RZ6C.mjs';import'./chunk-VQWZHPWI.mjs';import {a as a$1}from'./chunk-QYUPLKLP.mjs';function L(i){if(!i||i==="transparent"||i==="inherit")return null;if(i.startsWith("#"))return i.slice(1).toUpperCase();let o=i.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(o){let e=parseInt(o[1]).toString(16).padStart(2,"0"),t=parseInt(o[2]).toString(16).padStart(2,"0"),n=parseInt(o[3]).toString(16).padStart(2,"0");return (e+t+n).toUpperCase()}return null}function h(i){let o=window.getComputedStyle(i),e={};(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(e.bold=true),o.fontStyle==="italic"&&(e.italic=true);let t=o.textDecoration||o.textDecorationLine;t&&t.includes("underline")&&(e.underline={style:"single"}),t&&t.includes("line-through")&&(e.strike=true);let n=parseFloat(o.fontSize);!isNaN(n)&&n>0&&(e.fontSize=Math.round(n/1.333*2));let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(e.fontFamily={ascii:r});let s=o.color;if(s&&s!=="rgb(0, 0, 0)"){let c=L(s);c&&(e.color={rgb:c});}let l=o.backgroundColor;if(l&&l!=="transparent"&&l!=="rgba(0, 0, 0, 0)"){let c=S(l);c&&(e.shading={fill:{rgb:c}});}return Object.keys(e).length>0?e:void 0}function Lt(i,o){let e=document.createRange();e.selectNodeContents(i);let t=o.compareBoundaryPoints(Range.START_TO_START,e)>=0&&o.compareBoundaryPoints(Range.START_TO_END,e)<=0,n=o.compareBoundaryPoints(Range.END_TO_START,e)>=0&&o.compareBoundaryPoints(Range.END_TO_END,e)<=0;if(t&&n)return o.toString();if(t){let r=document.createRange();return r.setStart(o.startContainer,o.startOffset),r.selectNodeContents(i),r.setEnd(e.endContainer,e.endOffset),r.toString()}else if(n){let r=document.createRange();return r.selectNodeContents(i),r.setEnd(o.endContainer,o.endOffset),r.setStart(e.startContainer,e.startOffset),r.toString()}else if(o.intersectsNode(i))return i.textContent||"";return ""}function F(i){let o=i;for(;o;){if(o.nodeType===Node.ELEMENT_NODE){let e=o;if(e.hasAttribute("data-paragraph-index"))return e}o=o.parentNode;}return null}function f(){let i=window.getSelection();if(!i||i.isCollapsed)return [];let o=[],e=i.getRangeAt(0),t=e.commonAncestorContainer,n=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;if(!n)return o;if(n.querySelectorAll(".docx-run").forEach(s=>{if(e.intersectsNode(s)){let l=Lt(s,e);if(l){let c=h(s);o.push({type:"run",formatting:c,content:[{type:"text",text:l}]});}}}),o.length===0){let s=i.toString();s&&o.push({type:"run",content:[{type:"text",text:s}]});}return o}function A(){let i=window.getSelection();if(!i||i.isCollapsed)return null;let o=f();if(o.length===0)return null;let e=i.toString(),t=i.getRangeAt(0),n=F(t.startContainer),r=F(t.endContainer),s=n?parseInt(n.getAttribute("data-paragraph-index")||"0",10):0,l=r?parseInt(r.getAttribute("data-paragraph-index")||"0",10):0;return {text:e,runs:o,startParagraphIndex:s,startRunIndex:0,startOffset:t.startOffset,endParagraphIndex:l,endRunIndex:0,endOffset:t.endOffset,isMultiParagraph:s!==l}}var S=L;var d=class extends a{constructor(){super({notifications:[]});a$1(this,"notifications",[]);a$1(this,"idCounter",0);a$1(this,"timers",new Set);}showError(e,t){return this.addNotification(e,"error",t)}showWarning(e,t){return this.addNotification(e,"warning",t)}showInfo(e,t){return this.addNotification(e,"info",t)}dismiss(e){this.notifications=this.notifications.map(n=>n.id===e?{...n,dismissed:true}:n),this.emitSnapshot();let t=setTimeout(()=>{this.timers.delete(t),this.notifications=this.notifications.filter(n=>n.id!==e),this.emitSnapshot();},300);this.timers.add(t);}clearAll(){this.notifications=[];for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.emitSnapshot();}destroy(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.notifications=[];}addNotification(e,t,n){let r=`error-${++this.idCounter}-${Date.now()}`,s={id:r,message:e,severity:t,details:n,timestamp:Date.now()};if(this.notifications=[...this.notifications,s],this.emitSnapshot(),t!=="error"){let l=setTimeout(()=>{this.timers.delete(l),this.dismiss(r);},5e3);this.timers.add(l);}return r}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};function z(i,o){let e=`plugin-styles-${i}`,t=document.getElementById(e);t&&t.remove();let n=document.createElement("style");return n.id=e,n.textContent=o,document.head.appendChild(n),()=>{let r=document.getElementById(e);r&&r.remove();}}var u=class extends a{constructor(){super({states:new Map,version:0});a$1(this,"plugins",[]);a$1(this,"pluginStates",new Map);a$1(this,"version",0);}initialize(e,t){this.destroyPlugins(),this.plugins=e;for(let n of e)n.initialize&&!this.pluginStates.has(n.id)&&this.pluginStates.set(n.id,n.initialize(t));this.emitSnapshot();}updateStates(e){let t=false;for(let n of this.plugins)if(n.onStateChange){let r=n.onStateChange(e);r!==void 0&&(this.pluginStates.set(n.id,r),t=true);}return t&&(this.version++,this.emitSnapshot()),t}getPluginState(e){return this.pluginStates.get(e)}setPluginState(e,t){this.pluginStates.set(e,t),this.version++,this.emitSnapshot();}destroy(){this.destroyPlugins(),this.emitSnapshot();}destroyPlugins(){for(let e of this.plugins)e.destroy&&e.destroy();this.pluginStates.clear(),this.plugins=[];}emitSnapshot(){this.setSnapshot({states:new Map(this.pluginStates),version:this.version});}};var p=class extends a{constructor(){super({hasLayout:false,selectionRects:[],caretPosition:null,selectedImageInfo:null,isFocused:false,isDragging:false,isResizingColumn:false,isImageInteracting:false,version:0});a$1(this,"_hasLayout",false);a$1(this,"_selectionRects",[]);a$1(this,"_caretPosition",null);a$1(this,"_isDragging",false);a$1(this,"_dragAnchor",null);a$1(this,"_columnResize",{isResizing:false,startX:0,columnIndex:0,tablePmStart:0,originalWidths:{left:0,right:0}});a$1(this,"_selectedImageInfo",null);a$1(this,"_isImageInteracting",false);a$1(this,"_isFocused",false);a$1(this,"_version",0);}setLayoutReady(e){this._hasLayout=e,this.emitSnapshot();}updateSelection(e,t){this._selectionRects=e,this._caretPosition=t,this.emitSnapshot();}startDrag(e){this._isDragging=true,this._dragAnchor=e,this.emitSnapshot();}endDrag(){this._isDragging=false,this._dragAnchor=null,this.emitSnapshot();}getDragAnchor(){return this._dragAnchor}startColumnResize(e,t,n,r){this._columnResize={isResizing:true,startX:n,columnIndex:t,tablePmStart:e,originalWidths:r},this.emitSnapshot();}endColumnResize(){this._columnResize={...this._columnResize,isResizing:false},this.emitSnapshot();}getColumnResize(){return this._columnResize}setSelectedImage(e){this._selectedImageInfo=e,this.emitSnapshot();}clearSelectedImage(){this._selectedImageInfo=null,this._isImageInteracting=false,this.emitSnapshot();}setImageInteracting(e){this._isImageInteracting=e,this.emitSnapshot();}setFocused(e){this._isFocused=e,this.emitSnapshot();}emitSnapshot(){this._version++,this.setSnapshot({hasLayout:this._hasLayout,selectionRects:this._selectionRects,caretPosition:this._caretPosition,selectedImageInfo:this._selectedImageInfo,isFocused:this._isFocused,isDragging:this._isDragging,isResizingColumn:this._columnResize.isResizing,isImageInteracting:this._isImageInteracting,version:this._version});}};var g=class extends a{constructor(e={}){let t=e.initialZoom??1;super({loadingState:"idle",parseError:null,isReady:false,zoom:t,fontsLoaded:false,version:0});a$1(this,"_loadingState","idle");a$1(this,"_parseError",null);a$1(this,"_zoom");a$1(this,"_fontsLoaded",false);a$1(this,"_document",null);a$1(this,"_version",0);a$1(this,"onChangeCallback");a$1(this,"onErrorCallback");this._zoom=t,this.onChangeCallback=e.onChange,this.onErrorCallback=e.onError;}setParsingStarted(){this._loadingState="parsing",this._parseError=null,this.emitSnapshot();}setDocumentLoaded(e){this._document=e,this._loadingState="loading-fonts",this._parseError=null,this.emitSnapshot();}setFontsLoaded(){this._fontsLoaded=true,this._loadingState="ready",this.emitSnapshot();}setLoadError(e){this._loadingState="error",this._parseError=e.message,this.onErrorCallback?.(e),this.emitSnapshot();}getDocument(){return this._document}updateDocument(e){this._document=e,this.onChangeCallback?.(e),this.emitSnapshot();}setZoom(e){this._zoom=Math.max(.25,Math.min(4,e)),this.emitSnapshot();}getZoom(){return this._zoom}emitSnapshot(){this._version++,this.setSnapshot({loadingState:this._loadingState,parseError:this._parseError,isReady:this._loadingState==="ready",zoom:this._zoom,fontsLoaded:this._fontsLoaded,version:this._version});}};var to="0.0.2";export{g as EditorCoordinator,d as ErrorManager,p as LayoutCoordinator,u as PluginLifecycleManager,to as VERSION,A as createSelectionFromDOM,h as extractFormattingFromElement,f as getSelectionRuns,z as injectStyles,S as rgbToHex};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Document } from './types/document.js';
|
|
2
|
+
import { c as DocumentBody, S as SectionProperties } from './content-CmqAwdFL.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Document Serializer - Serialize complete document.xml
|
|
6
|
+
*
|
|
7
|
+
* Converts Document objects back to valid document.xml OOXML format.
|
|
8
|
+
* Combines all content (paragraphs, tables) with section properties
|
|
9
|
+
* and proper namespace declarations.
|
|
10
|
+
*
|
|
11
|
+
* OOXML Reference:
|
|
12
|
+
* - Document root: w:document
|
|
13
|
+
* - Document body: w:body
|
|
14
|
+
* - Section properties: w:sectPr
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Serialize section properties (w:sectPr)
|
|
19
|
+
*/
|
|
20
|
+
declare function serializeSectionProperties(props: SectionProperties | undefined): string;
|
|
21
|
+
/**
|
|
22
|
+
* Serialize a DocumentBody to document.xml body content
|
|
23
|
+
*
|
|
24
|
+
* @param body - The document body to serialize
|
|
25
|
+
* @returns XML string for the body element (without body tags)
|
|
26
|
+
*/
|
|
27
|
+
declare function serializeDocumentBody(body: DocumentBody): string;
|
|
28
|
+
/**
|
|
29
|
+
* Serialize a complete Document to valid document.xml
|
|
30
|
+
*
|
|
31
|
+
* @param doc - The document to serialize
|
|
32
|
+
* @returns Complete XML string for document.xml
|
|
33
|
+
*/
|
|
34
|
+
declare function serializeDocument(doc: Document): string;
|
|
35
|
+
|
|
36
|
+
export { serializeDocument as a, serializeSectionProperties as b, serializeDocumentBody as s };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Document } from './types/document.mjs';
|
|
2
|
+
import { c as DocumentBody, S as SectionProperties } from './content-5Mrz6w_b.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Document Serializer - Serialize complete document.xml
|
|
6
|
+
*
|
|
7
|
+
* Converts Document objects back to valid document.xml OOXML format.
|
|
8
|
+
* Combines all content (paragraphs, tables) with section properties
|
|
9
|
+
* and proper namespace declarations.
|
|
10
|
+
*
|
|
11
|
+
* OOXML Reference:
|
|
12
|
+
* - Document root: w:document
|
|
13
|
+
* - Document body: w:body
|
|
14
|
+
* - Section properties: w:sectPr
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Serialize section properties (w:sectPr)
|
|
19
|
+
*/
|
|
20
|
+
declare function serializeSectionProperties(props: SectionProperties | undefined): string;
|
|
21
|
+
/**
|
|
22
|
+
* Serialize a DocumentBody to document.xml body content
|
|
23
|
+
*
|
|
24
|
+
* @param body - The document body to serialize
|
|
25
|
+
* @returns XML string for the body element (without body tags)
|
|
26
|
+
*/
|
|
27
|
+
declare function serializeDocumentBody(body: DocumentBody): string;
|
|
28
|
+
/**
|
|
29
|
+
* Serialize a complete Document to valid document.xml
|
|
30
|
+
*
|
|
31
|
+
* @param doc - The document to serialize
|
|
32
|
+
* @returns Complete XML string for document.xml
|
|
33
|
+
*/
|
|
34
|
+
declare function serializeDocument(doc: Document): string;
|
|
35
|
+
|
|
36
|
+
export { serializeDocument as a, serializeSectionProperties as b, serializeDocumentBody as s };
|