@eigenpal/docx-editor-core 0.0.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 +204 -0
- package/README.md +54 -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 +169 -0
- package/dist/agent/index.d.ts +169 -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-23CP3TOP.js +1 -0
- package/dist/chunk-2KHWHVTA.js +1 -0
- package/dist/chunk-36VIYQHD.mjs +9 -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-44RUAQA2.js +1 -0
- package/dist/chunk-4AJYHCPB.js +2 -0
- package/dist/chunk-4BFNWPKW.js +1 -0
- package/dist/chunk-4EHBV73E.mjs +59 -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-5N5DBQJV.mjs +1 -0
- package/dist/chunk-62NPHRTF.js +1 -0
- package/dist/chunk-67LVRQIR.mjs +1 -0
- package/dist/chunk-6ILFFGGS.js +2 -0
- package/dist/chunk-6LOYA7G5.mjs +2 -0
- package/dist/chunk-6LVPRTB6.js +1 -0
- package/dist/chunk-6NQSIC27.mjs +1 -0
- package/dist/chunk-6VUYFDHY.mjs +1 -0
- package/dist/chunk-7E5VBRDL.mjs +1 -0
- package/dist/chunk-7GHQ4YCJ.mjs +1 -0
- package/dist/chunk-7RDCZLTU.js +1 -0
- package/dist/chunk-7VCMJCBY.js +2 -0
- package/dist/chunk-AAPBAMD7.js +1 -0
- package/dist/chunk-AMENZY5F.mjs +1 -0
- package/dist/chunk-ARHPXIBJ.mjs +1 -0
- package/dist/chunk-BGC7QKP5.mjs +1 -0
- package/dist/chunk-BGY3CB37.mjs +1 -0
- package/dist/chunk-BHBOAP6Z.js +3 -0
- package/dist/chunk-BWHUD2XC.mjs +4 -0
- package/dist/chunk-CCWOLPZE.js +3 -0
- package/dist/chunk-CGJ6S3AH.mjs +1 -0
- package/dist/chunk-CKKO4JWE.mjs +1 -0
- package/dist/chunk-CKXAHSJQ.js +10 -0
- package/dist/chunk-CP5OSG5Z.mjs +1 -0
- package/dist/chunk-CUY2THAO.mjs +1 -0
- package/dist/chunk-CWAP26GB.js +4 -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-DFZTUQ7O.js +2 -0
- package/dist/chunk-DROCYKAR.js +1 -0
- package/dist/chunk-DWFWYHM5.mjs +1 -0
- package/dist/chunk-DY2MJCSV.js +1 -0
- package/dist/chunk-ESI4BSBF.js +1 -0
- package/dist/chunk-FC6QL3E6.js +1 -0
- package/dist/chunk-FWTP7BN7.mjs +4 -0
- package/dist/chunk-G6Y4UZMJ.mjs +1 -0
- package/dist/chunk-GGPKPXON.js +1 -0
- package/dist/chunk-GXW7YSFL.mjs +1 -0
- package/dist/chunk-I6PMX4BO.js +1 -0
- package/dist/chunk-IBNUQL57.mjs +2 -0
- package/dist/chunk-ILJUDEZ5.mjs +1 -0
- package/dist/chunk-IP2VXNWG.js +1 -0
- package/dist/chunk-J7ULKGU2.mjs +10 -0
- package/dist/chunk-JFZIXFRC.js +1 -0
- package/dist/chunk-JHZ3HLSR.mjs +1 -0
- package/dist/chunk-JKVXID22.mjs +1 -0
- package/dist/chunk-JY5EFI4D.js +1 -0
- package/dist/chunk-KBU6QQFU.js +9 -0
- package/dist/chunk-KESNGXGO.js +1 -0
- package/dist/chunk-KQTB5Y7P.mjs +1 -0
- package/dist/chunk-LBKMYD3M.mjs +1 -0
- package/dist/chunk-LMF2ELOB.js +1 -0
- package/dist/chunk-LVD6HXRF.mjs +2 -0
- package/dist/chunk-MJ5FQX7Q.js +1 -0
- package/dist/chunk-MOKKS75W.mjs +3 -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-N27FJQTG.js +1 -0
- package/dist/chunk-N3Y5BUKV.js +1 -0
- package/dist/chunk-NBLJPT54.mjs +1 -0
- package/dist/chunk-NERY274X.js +1 -0
- package/dist/chunk-NNQWQOC5.mjs +1 -0
- package/dist/chunk-NXLJVVVE.js +1 -0
- package/dist/chunk-O5X22KZ6.mjs +1 -0
- package/dist/chunk-OBMN4VSM.mjs +1 -0
- package/dist/chunk-OCAX2KJQ.js +4 -0
- package/dist/chunk-OZMNIX6U.mjs +1 -0
- package/dist/chunk-PRRM64JO.mjs +1 -0
- package/dist/chunk-Q4CKLXWA.js +1 -0
- package/dist/chunk-Q5QOBZWT.mjs +1 -0
- package/dist/chunk-QPFJJPIC.mjs +1 -0
- package/dist/chunk-QYUPLKLP.mjs +1 -0
- package/dist/chunk-RNOXNNSD.mjs +0 -0
- package/dist/chunk-RPIQG46O.mjs +1 -0
- package/dist/chunk-S7IKPRC3.js +9 -0
- package/dist/chunk-SUXJX72X.js +1 -0
- package/dist/chunk-SYJAAHUK.js +1 -0
- package/dist/chunk-T4CPTPRP.js +1 -0
- package/dist/chunk-TE2AF7FM.js +1 -0
- package/dist/chunk-TE2VQJZG.js +1 -0
- package/dist/chunk-TRJWRZZD.js +1 -0
- package/dist/chunk-U4UCHBZ7.js +1 -0
- package/dist/chunk-UDPROEUK.js +1 -0
- package/dist/chunk-UIROUI5I.mjs +1 -0
- package/dist/chunk-UOFQYE2L.mjs +1 -0
- package/dist/chunk-UQ6WNWXX.js +1 -0
- package/dist/chunk-V7BKPX67.mjs +2 -0
- package/dist/chunk-VKTCTMIO.mjs +2 -0
- package/dist/chunk-VQWZHPWI.mjs +1 -0
- package/dist/chunk-VW22RZ6C.mjs +1 -0
- package/dist/chunk-WLKRUBY4.js +1 -0
- package/dist/chunk-WLQEPVDR.js +1 -0
- package/dist/chunk-WNTT4MGC.js +59 -0
- package/dist/chunk-WTFLNYAT.mjs +1 -0
- package/dist/chunk-XXU7YQVV.js +1 -0
- package/dist/chunk-Y5HZAMND.mjs +9 -0
- package/dist/chunk-Y74ANBPV.js +1 -0
- package/dist/chunk-Y7JZPBBW.js +1 -0
- package/dist/chunk-YGHHSCPR.js +2 -0
- package/dist/chunk-YMZ3F2FZ.mjs +1 -0
- package/dist/chunk-YUKBAAB5.mjs +1 -0
- package/dist/chunk-ZRZ2VRQQ.mjs +1 -0
- package/dist/chunk-ZYESB4KC.mjs +3 -0
- package/dist/colorResolver-C3q7MLLD.d.mts +390 -0
- package/dist/colorResolver-CVsPLsw1.d.ts +390 -0
- package/dist/colors-C3vA7HUU.d.mts +70 -0
- package/dist/colors-C3vA7HUU.d.ts +70 -0
- package/dist/core-plugins.d.mts +64 -0
- package/dist/core-plugins.d.ts +64 -0
- package/dist/core-plugins.js +1 -0
- package/dist/core-plugins.mjs +1 -0
- package/dist/core.d.mts +399 -0
- package/dist/core.d.ts +399 -0
- package/dist/core.js +1 -0
- package/dist/core.mjs +1 -0
- package/dist/documentSerializer-C1ueey5d.d.mts +36 -0
- package/dist/documentSerializer-Chn7J1WG.d.ts +36 -0
- package/dist/docx/index.d.mts +1124 -0
- package/dist/docx/index.d.ts +1124 -0
- package/dist/docx/index.js +1 -0
- package/dist/docx/index.mjs +1 -0
- package/dist/docx/parser.d.mts +109 -0
- package/dist/docx/parser.d.ts +109 -0
- package/dist/docx/parser.js +1 -0
- package/dist/docx/parser.mjs +1 -0
- package/dist/docx/rezip.d.mts +313 -0
- package/dist/docx/rezip.d.ts +313 -0
- package/dist/docx/rezip.js +1 -0
- package/dist/docx/rezip.mjs +1 -0
- package/dist/docx/serializer/index.d.mts +126 -0
- package/dist/docx/serializer/index.d.ts +126 -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-BOt95Jtf.d.mts +223 -0
- package/dist/fontLoader-QPwbcX5j.d.ts +223 -0
- package/dist/footnotes-lCH_P3N3.d.mts +78 -0
- package/dist/footnotes-skVvEHvZ.d.ts +78 -0
- package/dist/formatting-BwpZWdGi.d.ts +410 -0
- package/dist/formatting-D9I-lFS4.d.mts +410 -0
- package/dist/headerFooterLayout-B3QVg556.d.ts +201 -0
- package/dist/headerFooterLayout-DkclHZ0Z.d.mts +201 -0
- package/dist/headless.d.mts +110 -0
- package/dist/headless.d.ts +110 -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 +320 -0
- package/dist/layout-bridge/measuring/index.d.ts +320 -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 +122 -0
- package/dist/layout-bridge/toFlowBlocks.d.ts +122 -0
- package/dist/layout-bridge/toFlowBlocks.js +1 -0
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -0
- package/dist/layout-engine/index.d.mts +322 -0
- package/dist/layout-engine/index.d.ts +322 -0
- package/dist/layout-engine/index.js +1 -0
- package/dist/layout-engine/index.mjs +1 -0
- package/dist/layout-engine/types.d.mts +903 -0
- package/dist/layout-engine/types.d.ts +903 -0
- package/dist/layout-engine/types.js +1 -0
- package/dist/layout-engine/types.mjs +1 -0
- package/dist/layout-painter/index.d.mts +23 -0
- package/dist/layout-painter/index.d.ts +23 -0
- package/dist/layout-painter/index.js +1 -0
- package/dist/layout-painter/index.mjs +1 -0
- package/dist/layout-painter/renderPage.d.mts +674 -0
- package/dist/layout-painter/renderPage.d.ts +674 -0
- package/dist/layout-painter/renderPage.js +1 -0
- package/dist/layout-painter/renderPage.mjs +1 -0
- package/dist/lists-CdiIk_c1.d.ts +142 -0
- package/dist/lists-JDB80qyP.d.mts +142 -0
- package/dist/managers/AutoSaveManager.d.mts +96 -0
- package/dist/managers/AutoSaveManager.d.ts +96 -0
- package/dist/managers/AutoSaveManager.js +1 -0
- package/dist/managers/AutoSaveManager.mjs +1 -0
- package/dist/managers/TableSelectionManager.d.mts +95 -0
- package/dist/managers/TableSelectionManager.d.ts +95 -0
- package/dist/managers/TableSelectionManager.js +1 -0
- package/dist/managers/TableSelectionManager.mjs +1 -0
- package/dist/managers/types.d.mts +122 -0
- package/dist/managers/types.d.ts +122 -0
- package/dist/managers/types.js +1 -0
- package/dist/managers/types.mjs +0 -0
- package/dist/marks-BujVxYP4.d.ts +56 -0
- package/dist/marks-CCPVlQzL.d.mts +56 -0
- package/dist/mcp-cli.mjs +137 -0
- package/dist/mcp.d.mts +184 -0
- package/dist/mcp.d.ts +184 -0
- package/dist/mcp.js +16 -0
- package/dist/mcp.mjs +16 -0
- package/dist/nodes-BXi1Uu3e.d.mts +257 -0
- package/dist/nodes-DfKj9kUA.d.ts +257 -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 +114 -0
- package/dist/prosemirror/commands/index.d.ts +114 -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 +66 -0
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +66 -0
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -0
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -0
- package/dist/prosemirror/conversion/index.d.mts +78 -0
- package/dist/prosemirror/conversion/index.d.ts +78 -0
- package/dist/prosemirror/conversion/index.js +1 -0
- package/dist/prosemirror/conversion/index.mjs +1 -0
- package/dist/prosemirror/editor.css +763 -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 +71 -0
- package/dist/prosemirror/index.d.ts +71 -0
- package/dist/prosemirror/index.js +1 -0
- package/dist/prosemirror/index.mjs +1 -0
- package/dist/prosemirror/plugins/index.d.mts +50 -0
- package/dist/prosemirror/plugins/index.d.ts +50 -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 +30 -0
- package/dist/prosemirror/schema/index.d.ts +30 -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 +63 -0
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +63 -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-85CE0f7a.d.ts +570 -0
- package/dist/selectionContext-Xq3AY7pn.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-BBoqh07F.d.mts +233 -0
- package/dist/styles-jqO45PSq.d.ts +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 +1181 -0
- package/dist/types/content.d.ts +1181 -0
- package/dist/types/content.js +1 -0
- package/dist/types/content.mjs +0 -0
- package/dist/types/document.d.mts +106 -0
- package/dist/types/document.d.ts +106 -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 +48 -0
- package/dist/utils/comments.d.ts +48 -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 +711 -0
- package/dist/utils/index.d.ts +711 -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-CAdt8yOr.d.mts +115 -0
- package/dist/variableDetector-W4XEN9YC.d.ts +115 -0
- package/package.json +565 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { FlowBlock, Measure, LayoutOptions, FootnoteContent, Layout, Page, PageMargins, ImageRun } from './layout-engine/types.mjs';
|
|
2
|
+
import { Footnote, HeaderFooter } from './types/content.mjs';
|
|
3
|
+
import { a as StyleDefinitions, T as Theme } from './styles-BBoqh07F.mjs';
|
|
4
|
+
import { F as FootnoteRenderItem, H as HeaderFooterContent } from './footnotes-lCH_P3N3.mjs';
|
|
5
|
+
import { Document } from './types/document.mjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Footnote Layout Utilities
|
|
9
|
+
*
|
|
10
|
+
* Footnote/endnote rendering pipeline plus page-mapping helpers:
|
|
11
|
+
* - scanning FlowBlocks for footnote references and their PM positions
|
|
12
|
+
* - mapping references to the page that ends up containing them
|
|
13
|
+
* - converting a Footnote → FootnoteContent via the body pipeline
|
|
14
|
+
* (footnoteToProseDoc → toFlowBlocks → caller-supplied measureBlocks)
|
|
15
|
+
* - reserving per-page footnote area heights for layout
|
|
16
|
+
*
|
|
17
|
+
* Everything that's pure OOXML / FlowBlock semantics lives here so the
|
|
18
|
+
* React, Vue, and any future adapters can share the conversion logic
|
|
19
|
+
* and just supply their own measurement function (which depends on
|
|
20
|
+
* platform-specific Canvas/font metrics).
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** Separator line height + vertical padding in pixels. */
|
|
24
|
+
declare const FOOTNOTE_SEPARATOR_HEIGHT = 12;
|
|
25
|
+
/**
|
|
26
|
+
* Hard cap on the multi-pass footnote layout loop. Reserving footnote
|
|
27
|
+
* space can move a reference to another page, so adapters keep remapping
|
|
28
|
+
* until the page→height contract is stable. Dense layouts converge in
|
|
29
|
+
* 2–3 passes in practice; 6 is a safe ceiling.
|
|
30
|
+
*/
|
|
31
|
+
declare const MAX_FOOTNOTE_LAYOUT_PASSES = 6;
|
|
32
|
+
/**
|
|
33
|
+
* Compare two per-page footnote reservation maps. Used by the React +
|
|
34
|
+
* Vue adapters to detect when the multi-pass loop has converged.
|
|
35
|
+
*/
|
|
36
|
+
declare function footnoteReservedHeightsEqual(a: Map<number, number>, b: Map<number, number>): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Scan FlowBlocks for runs with footnoteRefId set.
|
|
39
|
+
* Returns a list of { footnoteId, pmPos } in document order.
|
|
40
|
+
*/
|
|
41
|
+
declare function collectFootnoteRefs(blocks: FlowBlock[]): Array<{
|
|
42
|
+
footnoteId: number;
|
|
43
|
+
pmPos: number;
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* After layout, determine which footnotes appear on which pages.
|
|
47
|
+
* Checks each page's fragments to see if any footnoteRef PM positions fall within.
|
|
48
|
+
*
|
|
49
|
+
* Returns Map<pageNumber, footnoteId[]> in document order.
|
|
50
|
+
*/
|
|
51
|
+
declare function mapFootnotesToPages(pages: Page[], footnoteRefs: Array<{
|
|
52
|
+
footnoteId: number;
|
|
53
|
+
pmPos: number;
|
|
54
|
+
}>): Map<number, number[]>;
|
|
55
|
+
/**
|
|
56
|
+
* Footnote-specific block normalization. Mirrors the spirit of
|
|
57
|
+
* `normalizeHeaderFooterMeasureBlocks`: post-process the body-pipeline
|
|
58
|
+
* output for a single footnote so it carries the correct visual prefix
|
|
59
|
+
* (its display number, rendered as a superscript) and a default 8pt font
|
|
60
|
+
* for any run that didn't specify a size.
|
|
61
|
+
*
|
|
62
|
+
* The displayNumber is prepended onto the FIRST paragraph as a fresh
|
|
63
|
+
* superscript text run — visually matches Word's footnote numbering
|
|
64
|
+
* without disturbing the authored runs.
|
|
65
|
+
*
|
|
66
|
+
* Exported for callers that want to compose their own conversion
|
|
67
|
+
* pipeline; `convertFootnoteToContent` calls it as part of its flow.
|
|
68
|
+
*/
|
|
69
|
+
declare function applyFootnotePresentation(blocks: FlowBlock[], displayNumber: number): FlowBlock[];
|
|
70
|
+
/**
|
|
71
|
+
* Adapter-supplied block measurement function. The caller (React /
|
|
72
|
+
* Vue / etc.) supplies its platform's measure routine — at minimum
|
|
73
|
+
* paragraph + table + image + textBox — so this core helper stays
|
|
74
|
+
* Canvas-free.
|
|
75
|
+
*/
|
|
76
|
+
type MeasureBlocksFn = (blocks: FlowBlock[], contentWidth: number) => Measure[];
|
|
77
|
+
/**
|
|
78
|
+
* Options for {@link convertFootnoteToContent}.
|
|
79
|
+
*/
|
|
80
|
+
type ConvertFootnoteOptions = {
|
|
81
|
+
/** The document's parsed style definitions, threaded into the body pipeline. */
|
|
82
|
+
styles?: StyleDefinitions | null;
|
|
83
|
+
/** Theme for resolving themed fills / fonts inside the footnote. */
|
|
84
|
+
theme?: Theme | null;
|
|
85
|
+
/** Measure callback supplied by the rendering adapter. */
|
|
86
|
+
measureBlocks: MeasureBlocksFn;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Convert a Footnote to renderable FootnoteContent via the body pipeline:
|
|
90
|
+
* `footnoteToProseDoc → toFlowBlocks → applyFootnotePresentation →
|
|
91
|
+
* measureBlocks`. Pre-PR (#378) this lived in a hand-rolled shadow stack
|
|
92
|
+
* that silently dropped non-paragraph content; routing through the body
|
|
93
|
+
* pipeline gives footnotes full block-kind support — paragraph + table
|
|
94
|
+
* + image + textBox + fields.
|
|
95
|
+
*/
|
|
96
|
+
declare function convertFootnoteToContent(footnote: Footnote, displayNumber: number, contentWidth: number, options: ConvertFootnoteOptions): FootnoteContent;
|
|
97
|
+
/**
|
|
98
|
+
* Build footnote content for all footnotes referenced in the document.
|
|
99
|
+
* Display numbers are assigned by first-appearance order (the same way
|
|
100
|
+
* Word renders them).
|
|
101
|
+
*/
|
|
102
|
+
declare function buildFootnoteContentMap(footnotes: Footnote[], footnoteRefs: Array<{
|
|
103
|
+
footnoteId: number;
|
|
104
|
+
}>, contentWidth: number, options: ConvertFootnoteOptions): Map<number, FootnoteContent>;
|
|
105
|
+
/**
|
|
106
|
+
* Calculate per-page footnote reserved heights.
|
|
107
|
+
* Returns Map<pageNumber, reservedHeight>.
|
|
108
|
+
*/
|
|
109
|
+
declare function calculateFootnoteReservedHeights(pageFootnoteMap: Map<number, number[]>, footnoteContentMap: Map<number, {
|
|
110
|
+
height: number;
|
|
111
|
+
}>): Map<number, number>;
|
|
112
|
+
interface StabilizeFootnoteLayoutArgs {
|
|
113
|
+
blocks: FlowBlock[];
|
|
114
|
+
measures: Measure[];
|
|
115
|
+
layoutOpts: LayoutOptions;
|
|
116
|
+
footnoteRefs: Array<{
|
|
117
|
+
footnoteId: number;
|
|
118
|
+
pmPos: number;
|
|
119
|
+
}>;
|
|
120
|
+
footnoteContentMap: Map<number, FootnoteContent>;
|
|
121
|
+
/** First-pass layout already computed by the caller without reserved heights. */
|
|
122
|
+
initialLayout: Layout;
|
|
123
|
+
}
|
|
124
|
+
interface StabilizeFootnoteLayoutResult {
|
|
125
|
+
layout: Layout;
|
|
126
|
+
pageFootnoteMap: Map<number, number[]>;
|
|
127
|
+
/** True if the loop converged before hitting MAX_FOOTNOTE_LAYOUT_PASSES. */
|
|
128
|
+
converged: boolean;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Run the multi-pass footnote layout loop. Reserving footnote space on a
|
|
132
|
+
* page can move a reference to another page, which changes the reservation,
|
|
133
|
+
* which can move references again. Iterate until the page→height contract
|
|
134
|
+
* is the same one used by the latest layout, or `MAX_FOOTNOTE_LAYOUT_PASSES`
|
|
135
|
+
* passes have run.
|
|
136
|
+
*
|
|
137
|
+
* Lives in core so the React + Vue adapters call the same loop and stay in
|
|
138
|
+
* lockstep on convergence behaviour. Writes `page.footnoteIds` onto each
|
|
139
|
+
* page in the returned layout so renderers can paint footnote areas.
|
|
140
|
+
*/
|
|
141
|
+
declare function stabilizeFootnoteLayout(args: StabilizeFootnoteLayoutArgs): StabilizeFootnoteLayoutResult;
|
|
142
|
+
/**
|
|
143
|
+
* Turn the page→footnote-id map into the per-page render payload that
|
|
144
|
+
* `renderPages` consumes via `footnotesByPage`. Skips non-`normal` notes
|
|
145
|
+
* (separators, continuation notices), reads the display number out of the
|
|
146
|
+
* content map, and pulls plain text via `getFootnoteText`.
|
|
147
|
+
*
|
|
148
|
+
* Lives in core (not in either adapter) so React + Vue both call the
|
|
149
|
+
* same helper — same rule as the rest of this module.
|
|
150
|
+
*/
|
|
151
|
+
declare function buildFootnoteRenderItems(pageFootnoteMap: Map<number, number[]>, footnoteContentMap: Map<number, FootnoteContent>, doc: Document | null): Map<number, FootnoteRenderItem[]>;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Header / Footer Layout Utilities
|
|
155
|
+
*
|
|
156
|
+
* The header/footer rendering pipeline lives here so any rendering adapter
|
|
157
|
+
* (React, Vue, etc.) can share the conversion logic and just supply its
|
|
158
|
+
* platform-specific {@link MeasureBlocksFn}. Mirrors the footnote pipeline
|
|
159
|
+
* in `footnoteLayout.ts`.
|
|
160
|
+
*
|
|
161
|
+
* Pipeline:
|
|
162
|
+
* HF.content → headerFooterToProseDoc → toFlowBlocks
|
|
163
|
+
* → measureBlocks (caller-supplied, Canvas-aware)
|
|
164
|
+
* → HeaderFooterContent (blocks, measures, height, visualTop/Bottom)
|
|
165
|
+
*
|
|
166
|
+
* The render side uses the normalized block list so paint and measurement stay
|
|
167
|
+
* in lockstep. Visual-bounds calculation still inspects the original block
|
|
168
|
+
* list because floating images can paint above/below the nominal flow box even
|
|
169
|
+
* when they do not contribute to flow height.
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
type HeaderFooterMetrics = {
|
|
173
|
+
section: 'header' | 'footer';
|
|
174
|
+
pageSize: {
|
|
175
|
+
w: number;
|
|
176
|
+
h: number;
|
|
177
|
+
};
|
|
178
|
+
margins: PageMargins;
|
|
179
|
+
};
|
|
180
|
+
declare function normalizeHeaderFooterMeasureBlocks(blocks: FlowBlock[]): FlowBlock[];
|
|
181
|
+
declare function resolveHeaderFooterVisualTop(run: ImageRun, paragraphY: number, flowHeight: number, metrics: HeaderFooterMetrics): number;
|
|
182
|
+
declare function calculateHeaderFooterVisualBounds(blocks: FlowBlock[], measures: Measure[], flowHeight: number, metrics: HeaderFooterMetrics): {
|
|
183
|
+
visualTop: number;
|
|
184
|
+
visualBottom: number;
|
|
185
|
+
};
|
|
186
|
+
type ConvertHeaderFooterOptions = {
|
|
187
|
+
styles?: StyleDefinitions | null;
|
|
188
|
+
theme?: Theme | null;
|
|
189
|
+
measureBlocks: MeasureBlocksFn;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Convert HeaderFooter (document type) to HeaderFooterContent (render type).
|
|
193
|
+
*
|
|
194
|
+
* Routes through the same pipeline as the body: HF.content →
|
|
195
|
+
* headerFooterToProseDoc → toFlowBlocks → measureBlocks. The inline editor
|
|
196
|
+
* uses the same conversion chain, so block support (paragraph, table, image,
|
|
197
|
+
* textBox, fields) and the inline editor's content stay in lockstep.
|
|
198
|
+
*/
|
|
199
|
+
declare function convertHeaderFooterToContent(headerFooter: HeaderFooter | null | undefined, contentWidth: number, metrics: HeaderFooterMetrics, options: ConvertHeaderFooterOptions): HeaderFooterContent | undefined;
|
|
200
|
+
|
|
201
|
+
export { type ConvertFootnoteOptions as C, FOOTNOTE_SEPARATOR_HEIGHT as F, type HeaderFooterMetrics as H, MAX_FOOTNOTE_LAYOUT_PASSES as M, type StabilizeFootnoteLayoutArgs as S, type ConvertHeaderFooterOptions as a, type MeasureBlocksFn as b, type StabilizeFootnoteLayoutResult as c, buildFootnoteContentMap as d, buildFootnoteRenderItems as e, calculateFootnoteReservedHeights as f, collectFootnoteRefs as g, convertHeaderFooterToContent as h, footnoteReservedHeightsEqual as i, applyFootnotePresentation as j, calculateHeaderFooterVisualBounds as k, convertFootnoteToContent as l, mapFootnotesToPages as m, normalizeHeaderFooterMeasureBlocks as n, resolveHeaderFooterVisualTop as r, stabilizeFootnoteLayout as s };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @eigenpal/docx-editor-core/headless
|
|
3
|
+
*
|
|
4
|
+
* Headless aggregate for Node.js scripts, CLI tools, and server-side
|
|
5
|
+
* processing. Same surface as the default `.` entry, named to make the
|
|
6
|
+
* "no DOM" intent explicit. Prefer the smaller subpaths (`./docx`,
|
|
7
|
+
* `./agent`, `./utils`, etc.) for new code — they tree-shake better.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { DocumentAgent, parseDocx, pluginRegistry } from '@eigenpal/docx-editor-core/headless';
|
|
12
|
+
* import { docxtemplaterPlugin } from '@eigenpal/docx-editor-core/core-plugins';
|
|
13
|
+
*
|
|
14
|
+
* // Register plugins
|
|
15
|
+
* pluginRegistry.register(docxtemplaterPlugin);
|
|
16
|
+
*
|
|
17
|
+
* // Load and manipulate document
|
|
18
|
+
* const buffer = fs.readFileSync('template.docx');
|
|
19
|
+
* const agent = await DocumentAgent.fromBuffer(buffer);
|
|
20
|
+
*
|
|
21
|
+
* // Get document info
|
|
22
|
+
* console.log('Word count:', agent.getWordCount());
|
|
23
|
+
* console.log('Variables:', agent.getVariables());
|
|
24
|
+
*
|
|
25
|
+
* // Edit document
|
|
26
|
+
* const newAgent = agent
|
|
27
|
+
* .insertText({ paragraphIndex: 0, offset: 0 }, 'Hello ')
|
|
28
|
+
* .applyStyle(0, 'Heading1');
|
|
29
|
+
*
|
|
30
|
+
* // Apply template variables
|
|
31
|
+
* const finalAgent = await newAgent.applyVariables({
|
|
32
|
+
* customer_name: 'Jane Doe',
|
|
33
|
+
* date: '2024-02-15',
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* // Export
|
|
37
|
+
* const output = await finalAgent.toBuffer();
|
|
38
|
+
* fs.writeFileSync('output.docx', Buffer.from(output));
|
|
39
|
+
* ```
|
|
40
|
+
* @packageDocumentation
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
export { A as AgentContextOptions, S as ContextSelectionOptions, D as DocumentAgent, E as ExtendedSelectionContext, F as FormattedTextSegment, a as FormattingSummary, I as InsertHyperlinkOptions, b as InsertImageOptions, c as InsertTableOptions, d as InsertTextOptions, e as SelectionContextOptions, f as buildExtendedSelectionContext, g as buildSelectionContext, h as buildSelectionContextFromContext, i as createAgent, j as createAgentFromDocument, k as executeCommand, l as executeCommands, m as getAgentContext, n as getDocumentSummary, o as getSelectionFormattingSummary } from './selectionContext-Xq3AY7pn.mjs';
|
|
44
|
+
export { countCharacters, countWords, getBlockIndexForParagraph, getBodyCharacterCount, getBodyText, getBodyWordCount, getFormattingAtPosition, getHyperlinkAtPosition, getHyperlinkText, getParagraphAtIndex, getParagraphText, getParagraphs, getRunText, getTableText, getTextAfter, getTextBefore, hasHyperlinks, hasImages, hasTables, isHeadingStyle, isPositionInHyperlink, parseHeadingLevel } from './agent/index.mjs';
|
|
45
|
+
export { parseDocx } from './docx/parser.mjs';
|
|
46
|
+
export { s as serializeDocumentBody, a as serializeDocx, b as serializeSectionProperties } from './documentSerializer-C1ueey5d.mjs';
|
|
47
|
+
export { createDocx, default as repackDocx, updateMultipleFiles } from './docx/rezip.mjs';
|
|
48
|
+
export { a as attemptSelectiveSave } from './selectiveSave-jinP_4xa.mjs';
|
|
49
|
+
export { b as buildPatchedDocumentXml, v as validatePatchSafety } from './selectiveXmlPatch-ypkxlTD_.mjs';
|
|
50
|
+
export { C as CreateEmptyDocumentOptions, P as ProcessTemplateOptions, a as ProcessTemplateResult, T as TemplateError, b as blendColors, c as colorsEqual, d as createDocumentWithText, e as createEmptyDocument, f as createRgbColor, g as createTemplateProcessor, h as createThemeColor, i as darkenColor, j as getContrastingColor, k as getMissingVariables, l as getTemplateTags, m as isBlack, n as isWhite, o as lightenColor, p as parseColorString, q as previewTemplate, r as processTemplate, s as processTemplateAdvanced, t as processTemplateAsBlob, u as processTemplateDetailed, v as resolveColor, w as resolveHighlightColor, x as resolveShadingColor, y as validateTemplate } from './colorResolver-C3q7MLLD.mjs';
|
|
51
|
+
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-CAdt8yOr.mjs';
|
|
52
|
+
export { emuToPixels, emuToTwips, formatPx, halfPointsToPixels, pixelsToEmu, pixelsToTwips, pointsToPixels, twipsToEmu, twipsToPixels } from './utils/units.mjs';
|
|
53
|
+
export { C as CommandHandler, a as CommandResult, b as CorePlugin, J as JsonSchema, L as LoadedDocument, M as McpSession, c as McpToolAnnotations, d as McpToolContent, e as McpToolContext, f as McpToolDefinition, g as McpToolHandler, h as McpToolResult, b as Plugin, P as PluginCommand, C as PluginCommandHandler, i as PluginEvent, j as PluginEventListener, k as PluginOptions, l as PluginRegistrationResult, f as ToolDefinition, g as ToolHandler, h as ToolResult, Z as ZodSchemaLike, m as isZodSchema } from './types-dYdjUZMo.mjs';
|
|
54
|
+
export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-Cpyybgij.mjs';
|
|
55
|
+
export { Document, DocxPackage } from './types/document.mjs';
|
|
56
|
+
export { AIAction, AIActionRequest, AgentCommand, AgentContext, AgentResponse, ApplyStyleCommand, ApplyVariablesCommand, DEFAULT_AI_ACTIONS, DeleteTextCommand, FormatParagraphCommand, FormatTextCommand, InsertHyperlinkCommand, InsertImageCommand, InsertTableCommand, InsertTextCommand, ParagraphContext, ParagraphOutline, Position, Range, ReplaceTextCommand, SectionInfo, SelectionContext, SetVariableCommand, StyleInfo, SuggestedAction, comparePositions, createCollapsedRange, createCommand, createRange, getActionDescription, getActionLabel, isPositionInRange } from './types/agentApi.mjs';
|
|
57
|
+
export { BlockContent, Comment, CommentRangeEnd, CommentRangeStart, Deletion, DocumentBody, Endnote, Footnote, Hyperlink, Image, Insertion, MoveFrom, MoveTo, Paragraph, ParagraphContent, Run, RunContent, SectionProperties, Table, TableCell, TableRow, TextContent, TrackedChangeInfo, TrackedRunChange } from './types/content.mjs';
|
|
58
|
+
export { L as ListLevel, N as NumberingDefinitions } from './lists-JDB80qyP.mjs';
|
|
59
|
+
export { P as ParagraphFormatting, T as TextFormatting } from './formatting-D9I-lFS4.mjs';
|
|
60
|
+
export { R as Relationship, S as Style, a as StyleDefinitions, T as Theme } from './styles-BBoqh07F.mjs';
|
|
61
|
+
import './docxInput-DTbCa48g.mjs';
|
|
62
|
+
import 'jszip';
|
|
63
|
+
import './colors-C3vA7HUU.mjs';
|
|
64
|
+
import './docx/wrapTypes.mjs';
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @eigenpal/docx-editor-core/headless
|
|
68
|
+
*
|
|
69
|
+
* Headless aggregate for Node.js scripts, CLI tools, and server-side
|
|
70
|
+
* processing. Same surface as the default `.` entry, named to make the
|
|
71
|
+
* "no DOM" intent explicit. Prefer the smaller subpaths (`./docx`,
|
|
72
|
+
* `./agent`, `./utils`, etc.) for new code — they tree-shake better.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* import { DocumentAgent, parseDocx, pluginRegistry } from '@eigenpal/docx-editor-core/headless';
|
|
77
|
+
* import { docxtemplaterPlugin } from '@eigenpal/docx-editor-core/core-plugins';
|
|
78
|
+
*
|
|
79
|
+
* // Register plugins
|
|
80
|
+
* pluginRegistry.register(docxtemplaterPlugin);
|
|
81
|
+
*
|
|
82
|
+
* // Load and manipulate document
|
|
83
|
+
* const buffer = fs.readFileSync('template.docx');
|
|
84
|
+
* const agent = await DocumentAgent.fromBuffer(buffer);
|
|
85
|
+
*
|
|
86
|
+
* // Get document info
|
|
87
|
+
* console.log('Word count:', agent.getWordCount());
|
|
88
|
+
* console.log('Variables:', agent.getVariables());
|
|
89
|
+
*
|
|
90
|
+
* // Edit document
|
|
91
|
+
* const newAgent = agent
|
|
92
|
+
* .insertText({ paragraphIndex: 0, offset: 0 }, 'Hello ')
|
|
93
|
+
* .applyStyle(0, 'Heading1');
|
|
94
|
+
*
|
|
95
|
+
* // Apply template variables
|
|
96
|
+
* const finalAgent = await newAgent.applyVariables({
|
|
97
|
+
* customer_name: 'Jane Doe',
|
|
98
|
+
* date: '2024-02-15',
|
|
99
|
+
* });
|
|
100
|
+
*
|
|
101
|
+
* // Export
|
|
102
|
+
* const output = await finalAgent.toBuffer();
|
|
103
|
+
* fs.writeFileSync('output.docx', Buffer.from(output));
|
|
104
|
+
* ```
|
|
105
|
+
* @packageDocumentation
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
108
|
+
declare const VERSION = "0.0.2";
|
|
109
|
+
|
|
110
|
+
export { VERSION };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @eigenpal/docx-editor-core/headless
|
|
3
|
+
*
|
|
4
|
+
* Headless aggregate for Node.js scripts, CLI tools, and server-side
|
|
5
|
+
* processing. Same surface as the default `.` entry, named to make the
|
|
6
|
+
* "no DOM" intent explicit. Prefer the smaller subpaths (`./docx`,
|
|
7
|
+
* `./agent`, `./utils`, etc.) for new code — they tree-shake better.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { DocumentAgent, parseDocx, pluginRegistry } from '@eigenpal/docx-editor-core/headless';
|
|
12
|
+
* import { docxtemplaterPlugin } from '@eigenpal/docx-editor-core/core-plugins';
|
|
13
|
+
*
|
|
14
|
+
* // Register plugins
|
|
15
|
+
* pluginRegistry.register(docxtemplaterPlugin);
|
|
16
|
+
*
|
|
17
|
+
* // Load and manipulate document
|
|
18
|
+
* const buffer = fs.readFileSync('template.docx');
|
|
19
|
+
* const agent = await DocumentAgent.fromBuffer(buffer);
|
|
20
|
+
*
|
|
21
|
+
* // Get document info
|
|
22
|
+
* console.log('Word count:', agent.getWordCount());
|
|
23
|
+
* console.log('Variables:', agent.getVariables());
|
|
24
|
+
*
|
|
25
|
+
* // Edit document
|
|
26
|
+
* const newAgent = agent
|
|
27
|
+
* .insertText({ paragraphIndex: 0, offset: 0 }, 'Hello ')
|
|
28
|
+
* .applyStyle(0, 'Heading1');
|
|
29
|
+
*
|
|
30
|
+
* // Apply template variables
|
|
31
|
+
* const finalAgent = await newAgent.applyVariables({
|
|
32
|
+
* customer_name: 'Jane Doe',
|
|
33
|
+
* date: '2024-02-15',
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* // Export
|
|
37
|
+
* const output = await finalAgent.toBuffer();
|
|
38
|
+
* fs.writeFileSync('output.docx', Buffer.from(output));
|
|
39
|
+
* ```
|
|
40
|
+
* @packageDocumentation
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
export { A as AgentContextOptions, S as ContextSelectionOptions, D as DocumentAgent, E as ExtendedSelectionContext, F as FormattedTextSegment, a as FormattingSummary, I as InsertHyperlinkOptions, b as InsertImageOptions, c as InsertTableOptions, d as InsertTextOptions, e as SelectionContextOptions, f as buildExtendedSelectionContext, g as buildSelectionContext, h as buildSelectionContextFromContext, i as createAgent, j as createAgentFromDocument, k as executeCommand, l as executeCommands, m as getAgentContext, n as getDocumentSummary, o as getSelectionFormattingSummary } from './selectionContext-85CE0f7a.js';
|
|
44
|
+
export { countCharacters, countWords, getBlockIndexForParagraph, getBodyCharacterCount, getBodyText, getBodyWordCount, getFormattingAtPosition, getHyperlinkAtPosition, getHyperlinkText, getParagraphAtIndex, getParagraphText, getParagraphs, getRunText, getTableText, getTextAfter, getTextBefore, hasHyperlinks, hasImages, hasTables, isHeadingStyle, isPositionInHyperlink, parseHeadingLevel } from './agent/index.js';
|
|
45
|
+
export { parseDocx } from './docx/parser.js';
|
|
46
|
+
export { s as serializeDocumentBody, a as serializeDocx, b as serializeSectionProperties } from './documentSerializer-Chn7J1WG.js';
|
|
47
|
+
export { createDocx, default as repackDocx, updateMultipleFiles } from './docx/rezip.js';
|
|
48
|
+
export { a as attemptSelectiveSave } from './selectiveSave-CWaPEv0B.js';
|
|
49
|
+
export { b as buildPatchedDocumentXml, v as validatePatchSafety } from './selectiveXmlPatch-ypkxlTD_.js';
|
|
50
|
+
export { C as CreateEmptyDocumentOptions, P as ProcessTemplateOptions, a as ProcessTemplateResult, T as TemplateError, b as blendColors, c as colorsEqual, d as createDocumentWithText, e as createEmptyDocument, f as createRgbColor, g as createTemplateProcessor, h as createThemeColor, i as darkenColor, j as getContrastingColor, k as getMissingVariables, l as getTemplateTags, m as isBlack, n as isWhite, o as lightenColor, p as parseColorString, q as previewTemplate, r as processTemplate, s as processTemplateAdvanced, t as processTemplateAsBlob, u as processTemplateDetailed, v as resolveColor, w as resolveHighlightColor, x as resolveShadingColor, y as validateTemplate } from './colorResolver-CVsPLsw1.js';
|
|
51
|
+
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-W4XEN9YC.js';
|
|
52
|
+
export { emuToPixels, emuToTwips, formatPx, halfPointsToPixels, pixelsToEmu, pixelsToTwips, pointsToPixels, twipsToEmu, twipsToPixels } from './utils/units.js';
|
|
53
|
+
export { C as CommandHandler, a as CommandResult, b as CorePlugin, J as JsonSchema, L as LoadedDocument, M as McpSession, c as McpToolAnnotations, d as McpToolContent, e as McpToolContext, f as McpToolDefinition, g as McpToolHandler, h as McpToolResult, b as Plugin, P as PluginCommand, C as PluginCommandHandler, i as PluginEvent, j as PluginEventListener, k as PluginOptions, l as PluginRegistrationResult, f as ToolDefinition, g as ToolHandler, h as ToolResult, Z as ZodSchemaLike, m as isZodSchema } from './types-DXG7vqe9.js';
|
|
54
|
+
export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-E5pahPKL.js';
|
|
55
|
+
export { Document, DocxPackage } from './types/document.js';
|
|
56
|
+
export { AIAction, AIActionRequest, AgentCommand, AgentContext, AgentResponse, ApplyStyleCommand, ApplyVariablesCommand, DEFAULT_AI_ACTIONS, DeleteTextCommand, FormatParagraphCommand, FormatTextCommand, InsertHyperlinkCommand, InsertImageCommand, InsertTableCommand, InsertTextCommand, ParagraphContext, ParagraphOutline, Position, Range, ReplaceTextCommand, SectionInfo, SelectionContext, SetVariableCommand, StyleInfo, SuggestedAction, comparePositions, createCollapsedRange, createCommand, createRange, getActionDescription, getActionLabel, isPositionInRange } from './types/agentApi.js';
|
|
57
|
+
export { BlockContent, Comment, CommentRangeEnd, CommentRangeStart, Deletion, DocumentBody, Endnote, Footnote, Hyperlink, Image, Insertion, MoveFrom, MoveTo, Paragraph, ParagraphContent, Run, RunContent, SectionProperties, Table, TableCell, TableRow, TextContent, TrackedChangeInfo, TrackedRunChange } from './types/content.js';
|
|
58
|
+
export { L as ListLevel, N as NumberingDefinitions } from './lists-CdiIk_c1.js';
|
|
59
|
+
export { P as ParagraphFormatting, T as TextFormatting } from './formatting-BwpZWdGi.js';
|
|
60
|
+
export { R as Relationship, S as Style, a as StyleDefinitions, T as Theme } from './styles-jqO45PSq.js';
|
|
61
|
+
import './docxInput-DTbCa48g.js';
|
|
62
|
+
import 'jszip';
|
|
63
|
+
import './colors-C3vA7HUU.js';
|
|
64
|
+
import './docx/wrapTypes.js';
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @eigenpal/docx-editor-core/headless
|
|
68
|
+
*
|
|
69
|
+
* Headless aggregate for Node.js scripts, CLI tools, and server-side
|
|
70
|
+
* processing. Same surface as the default `.` entry, named to make the
|
|
71
|
+
* "no DOM" intent explicit. Prefer the smaller subpaths (`./docx`,
|
|
72
|
+
* `./agent`, `./utils`, etc.) for new code — they tree-shake better.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* import { DocumentAgent, parseDocx, pluginRegistry } from '@eigenpal/docx-editor-core/headless';
|
|
77
|
+
* import { docxtemplaterPlugin } from '@eigenpal/docx-editor-core/core-plugins';
|
|
78
|
+
*
|
|
79
|
+
* // Register plugins
|
|
80
|
+
* pluginRegistry.register(docxtemplaterPlugin);
|
|
81
|
+
*
|
|
82
|
+
* // Load and manipulate document
|
|
83
|
+
* const buffer = fs.readFileSync('template.docx');
|
|
84
|
+
* const agent = await DocumentAgent.fromBuffer(buffer);
|
|
85
|
+
*
|
|
86
|
+
* // Get document info
|
|
87
|
+
* console.log('Word count:', agent.getWordCount());
|
|
88
|
+
* console.log('Variables:', agent.getVariables());
|
|
89
|
+
*
|
|
90
|
+
* // Edit document
|
|
91
|
+
* const newAgent = agent
|
|
92
|
+
* .insertText({ paragraphIndex: 0, offset: 0 }, 'Hello ')
|
|
93
|
+
* .applyStyle(0, 'Heading1');
|
|
94
|
+
*
|
|
95
|
+
* // Apply template variables
|
|
96
|
+
* const finalAgent = await newAgent.applyVariables({
|
|
97
|
+
* customer_name: 'Jane Doe',
|
|
98
|
+
* date: '2024-02-15',
|
|
99
|
+
* });
|
|
100
|
+
*
|
|
101
|
+
* // Export
|
|
102
|
+
* const output = await finalAgent.toBuffer();
|
|
103
|
+
* fs.writeFileSync('output.docx', Buffer.from(output));
|
|
104
|
+
* ```
|
|
105
|
+
* @packageDocumentation
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
108
|
+
declare const VERSION = "0.0.2";
|
|
109
|
+
|
|
110
|
+
export { VERSION };
|
package/dist/headless.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkOCAX2KJQ_js=require('./chunk-OCAX2KJQ.js'),chunkXXU7YQVV_js=require('./chunk-XXU7YQVV.js'),chunkS7IKPRC3_js=require('./chunk-S7IKPRC3.js'),chunkWLQEPVDR_js=require('./chunk-WLQEPVDR.js'),chunkNXLJVVVE_js=require('./chunk-NXLJVVVE.js'),chunkCKXAHSJQ_js=require('./chunk-CKXAHSJQ.js'),chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkTE2AF7FM_js=require('./chunk-TE2AF7FM.js'),chunkWNTT4MGC_js=require('./chunk-WNTT4MGC.js'),chunkCCWOLPZE_js=require('./chunk-CCWOLPZE.js'),chunk4BFNWPKW_js=require('./chunk-4BFNWPKW.js'),chunk6ILFFGGS_js=require('./chunk-6ILFFGGS.js');require('./chunk-CWAP26GB.js'),require('./chunk-KBU6QQFU.js'),require('./chunk-MZOVDLYL.js'),require('./chunk-YGHHSCPR.js'),require('./chunk-7VCMJCBY.js');var chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js');require('./chunk-T4CPTPRP.js'),require('./chunk-Q4CKLXWA.js');var chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');require('./chunk-DC7S76ZX.js');var je="0.0.2";Object.defineProperty(exports,"countCharacters",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.g}});Object.defineProperty(exports,"countWords",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.f}});Object.defineProperty(exports,"getBlockIndexForParagraph",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.v}});Object.defineProperty(exports,"getBodyCharacterCount",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.i}});Object.defineProperty(exports,"getBodyText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.e}});Object.defineProperty(exports,"getBodyWordCount",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.h}});Object.defineProperty(exports,"getFormattingAtPosition",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.l}});Object.defineProperty(exports,"getHyperlinkAtPosition",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.n}});Object.defineProperty(exports,"getHyperlinkText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.c}});Object.defineProperty(exports,"getParagraphAtIndex",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.u}});Object.defineProperty(exports,"getParagraphText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.a}});Object.defineProperty(exports,"getParagraphs",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.t}});Object.defineProperty(exports,"getRunText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.b}});Object.defineProperty(exports,"getTableText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.d}});Object.defineProperty(exports,"getTextAfter",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.k}});Object.defineProperty(exports,"getTextBefore",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.j}});Object.defineProperty(exports,"hasHyperlinks",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.r}});Object.defineProperty(exports,"hasImages",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.q}});Object.defineProperty(exports,"hasTables",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.s}});Object.defineProperty(exports,"isHeadingStyle",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.o}});Object.defineProperty(exports,"isPositionInHyperlink",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.m}});Object.defineProperty(exports,"parseHeadingLevel",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.p}});Object.defineProperty(exports,"DEFAULT_AI_ACTIONS",{enumerable:true,get:function(){return chunkXXU7YQVV_js.g}});Object.defineProperty(exports,"comparePositions",{enumerable:true,get:function(){return chunkXXU7YQVV_js.d}});Object.defineProperty(exports,"createCollapsedRange",{enumerable:true,get:function(){return chunkXXU7YQVV_js.a}});Object.defineProperty(exports,"createCommand",{enumerable:true,get:function(){return chunkXXU7YQVV_js.h}});Object.defineProperty(exports,"createRange",{enumerable:true,get:function(){return chunkXXU7YQVV_js.b}});Object.defineProperty(exports,"getActionDescription",{enumerable:true,get:function(){return chunkXXU7YQVV_js.f}});Object.defineProperty(exports,"getActionLabel",{enumerable:true,get:function(){return chunkXXU7YQVV_js.e}});Object.defineProperty(exports,"isPositionInRange",{enumerable:true,get:function(){return chunkXXU7YQVV_js.c}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkS7IKPRC3_js.a}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkS7IKPRC3_js.h}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkS7IKPRC3_js.g}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunkS7IKPRC3_js.e}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunkS7IKPRC3_js.b}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunkS7IKPRC3_js.c}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkS7IKPRC3_js.d}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkS7IKPRC3_js.f}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunkS7IKPRC3_js.i}});Object.defineProperty(exports,"attemptSelectiveSave",{enumerable:true,get:function(){return chunkWLQEPVDR_js.c}});Object.defineProperty(exports,"buildPatchedDocumentXml",{enumerable:true,get:function(){return chunkWLQEPVDR_js.b}});Object.defineProperty(exports,"validatePatchSafety",{enumerable:true,get:function(){return chunkWLQEPVDR_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,"isZodSchema",{enumerable:true,get:function(){return chunkCKXAHSJQ_js.a}});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,"createTemplateProcessor",{enumerable:true,get:function(){return chunkESI4BSBF_js.j}});Object.defineProperty(exports,"getMissingVariables",{enumerable:true,get:function(){return chunkESI4BSBF_js.g}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkESI4BSBF_js.e}});Object.defineProperty(exports,"previewTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.h}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.a}});Object.defineProperty(exports,"processTemplateAdvanced",{enumerable:true,get:function(){return chunkESI4BSBF_js.i}});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 chunkWNTT4MGC_js.s}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkWNTT4MGC_js.h}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunkWNTT4MGC_js.l}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunkCCWOLPZE_js.f}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunkCCWOLPZE_js.g}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunkCCWOLPZE_js.e}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunk4BFNWPKW_js.d}});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 chunk6ILFFGGS_js.f}});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,"getContrastingColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.g}});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,"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.VERSION=je;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{g as countCharacters,f as countWords,v as getBlockIndexForParagraph,i as getBodyCharacterCount,e as getBodyText,h as getBodyWordCount,l as getFormattingAtPosition,n as getHyperlinkAtPosition,c as getHyperlinkText,u as getParagraphAtIndex,a as getParagraphText,t as getParagraphs,b as getRunText,d as getTableText,k as getTextAfter,j as getTextBefore,r as hasHyperlinks,q as hasImages,s as hasTables,o as isHeadingStyle,m as isPositionInHyperlink,p as parseHeadingLevel}from'./chunk-FWTP7BN7.mjs';export{g as DEFAULT_AI_ACTIONS,d as comparePositions,a as createCollapsedRange,h as createCommand,b as createRange,f as getActionDescription,e as getActionLabel,c as isPositionInRange}from'./chunk-MVZOTKNL.mjs';export{a as DocumentAgent,h as buildExtendedSelectionContext,g as buildSelectionContext,e as buildSelectionContextFromContext,b as createAgent,c as createAgentFromDocument,d as getAgentContext,f as getDocumentSummary,i as getSelectionFormattingSummary}from'./chunk-36VIYQHD.mjs';export{c as attemptSelectiveSave,b as buildPatchedDocumentXml,a as validatePatchSafety}from'./chunk-O5X22KZ6.mjs';export{b as createDocumentWithText,a as createEmptyDocument}from'./chunk-CKKO4JWE.mjs';export{a as isZodSchema}from'./chunk-J7ULKGU2.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{j as createTemplateProcessor,g as getMissingVariables,e as getTemplateTags,h as previewTemplate,a as processTemplate,i as processTemplateAdvanced,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-4EHBV73E.mjs';export{f as serializeDocumentBody,g as serializeDocx,e as serializeSectionProperties}from'./chunk-ZYESB4KC.mjs';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-3NRMSZX2.mjs';export{f as parseDocx}from'./chunk-VKTCTMIO.mjs';import'./chunk-BWHUD2XC.mjs';import'./chunk-Y5HZAMND.mjs';import'./chunk-ILJUDEZ5.mjs';import'./chunk-IBNUQL57.mjs';import'./chunk-6LOYA7G5.mjs';export{m as blendColors,r as colorsEqual,j as createRgbColor,i as createThemeColor,k as darkenColor,g as getContrastingColor,e as isBlack,f as isWhite,l as lightenColor,h as parseColorString,a as resolveColor,c as resolveHighlightColor,d as resolveShadingColor}from'./chunk-67LVRQIR.mjs';import'./chunk-6VUYFDHY.mjs';import'./chunk-VQWZHPWI.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-QYUPLKLP.mjs';var je="0.0.2";export{je as VERSION};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM-based Click-to-Position Mapping
|
|
3
|
+
*
|
|
4
|
+
* Uses the browser's actual rendered DOM to find ProseMirror positions.
|
|
5
|
+
* This is more accurate than geometry-based calculation because it uses
|
|
6
|
+
* the browser's own text rendering with document.elementsFromPoint().
|
|
7
|
+
*
|
|
8
|
+
* DOM elements are tagged with data-pm-start and data-pm-end attributes,
|
|
9
|
+
* enabling binary search to find exact character positions.
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Find ProseMirror position from a click using DOM-based detection.
|
|
15
|
+
*
|
|
16
|
+
* @param container - The pages container element
|
|
17
|
+
* @param clientX - Client X coordinate from mouse event
|
|
18
|
+
* @param clientY - Client Y coordinate from mouse event
|
|
19
|
+
* @param zoom - Current zoom level (default 1)
|
|
20
|
+
* @returns ProseMirror position, or null if not found
|
|
21
|
+
*/
|
|
22
|
+
declare function clickToPositionDom(container: HTMLElement, clientX: number, clientY: number, zoom?: number): number | null;
|
|
23
|
+
/**
|
|
24
|
+
* Get selection rectangles for a PM range using DOM-based detection.
|
|
25
|
+
*
|
|
26
|
+
* @param container - The pages container element
|
|
27
|
+
* @param from - Start PM position
|
|
28
|
+
* @param to - End PM position
|
|
29
|
+
* @param overlayRect - Bounding rect of the selection overlay
|
|
30
|
+
* @returns Array of selection rectangles in overlay coordinates
|
|
31
|
+
*/
|
|
32
|
+
interface DomSelectionRect {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
pageIndex: number;
|
|
38
|
+
}
|
|
39
|
+
declare function getSelectionRectsFromDom(container: HTMLElement, from: number, to: number, overlayRect: DOMRect): DomSelectionRect[];
|
|
40
|
+
/**
|
|
41
|
+
* Get caret position from DOM for a PM position.
|
|
42
|
+
*
|
|
43
|
+
* @param container - The pages container element
|
|
44
|
+
* @param pmPos - ProseMirror position
|
|
45
|
+
* @param overlayRect - Bounding rect of the selection overlay
|
|
46
|
+
* @returns Caret position in overlay coordinates, or null
|
|
47
|
+
*/
|
|
48
|
+
interface DomCaretPosition {
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
51
|
+
height: number;
|
|
52
|
+
pageIndex: number;
|
|
53
|
+
}
|
|
54
|
+
declare function getCaretPositionFromDom(container: HTMLElement, pmPos: number, overlayRect: DOMRect): DomCaretPosition | null;
|
|
55
|
+
|
|
56
|
+
export { type DomCaretPosition, type DomSelectionRect, clickToPositionDom, getCaretPositionFromDom, getSelectionRectsFromDom };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM-based Click-to-Position Mapping
|
|
3
|
+
*
|
|
4
|
+
* Uses the browser's actual rendered DOM to find ProseMirror positions.
|
|
5
|
+
* This is more accurate than geometry-based calculation because it uses
|
|
6
|
+
* the browser's own text rendering with document.elementsFromPoint().
|
|
7
|
+
*
|
|
8
|
+
* DOM elements are tagged with data-pm-start and data-pm-end attributes,
|
|
9
|
+
* enabling binary search to find exact character positions.
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Find ProseMirror position from a click using DOM-based detection.
|
|
15
|
+
*
|
|
16
|
+
* @param container - The pages container element
|
|
17
|
+
* @param clientX - Client X coordinate from mouse event
|
|
18
|
+
* @param clientY - Client Y coordinate from mouse event
|
|
19
|
+
* @param zoom - Current zoom level (default 1)
|
|
20
|
+
* @returns ProseMirror position, or null if not found
|
|
21
|
+
*/
|
|
22
|
+
declare function clickToPositionDom(container: HTMLElement, clientX: number, clientY: number, zoom?: number): number | null;
|
|
23
|
+
/**
|
|
24
|
+
* Get selection rectangles for a PM range using DOM-based detection.
|
|
25
|
+
*
|
|
26
|
+
* @param container - The pages container element
|
|
27
|
+
* @param from - Start PM position
|
|
28
|
+
* @param to - End PM position
|
|
29
|
+
* @param overlayRect - Bounding rect of the selection overlay
|
|
30
|
+
* @returns Array of selection rectangles in overlay coordinates
|
|
31
|
+
*/
|
|
32
|
+
interface DomSelectionRect {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
pageIndex: number;
|
|
38
|
+
}
|
|
39
|
+
declare function getSelectionRectsFromDom(container: HTMLElement, from: number, to: number, overlayRect: DOMRect): DomSelectionRect[];
|
|
40
|
+
/**
|
|
41
|
+
* Get caret position from DOM for a PM position.
|
|
42
|
+
*
|
|
43
|
+
* @param container - The pages container element
|
|
44
|
+
* @param pmPos - ProseMirror position
|
|
45
|
+
* @param overlayRect - Bounding rect of the selection overlay
|
|
46
|
+
* @returns Caret position in overlay coordinates, or null
|
|
47
|
+
*/
|
|
48
|
+
interface DomCaretPosition {
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
51
|
+
height: number;
|
|
52
|
+
pageIndex: number;
|
|
53
|
+
}
|
|
54
|
+
declare function getCaretPositionFromDom(container: HTMLElement, pmPos: number, overlayRect: DOMRect): DomCaretPosition | null;
|
|
55
|
+
|
|
56
|
+
export { type DomCaretPosition, type DomSelectionRect, clickToPositionDom, getCaretPositionFromDom, getSelectionRectsFromDom };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk7RDCZLTU_js=require('../chunk-7RDCZLTU.js');require('../chunk-DC7S76ZX.js');Object.defineProperty(exports,"clickToPositionDom",{enumerable:true,get:function(){return chunk7RDCZLTU_js.e}});Object.defineProperty(exports,"getCaretPositionFromDom",{enumerable:true,get:function(){return chunk7RDCZLTU_js.g}});Object.defineProperty(exports,"getSelectionRectsFromDom",{enumerable:true,get:function(){return chunk7RDCZLTU_js.f}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{e as clickToPositionDom,g as getCaretPositionFromDom,f as getSelectionRectsFromDom}from'../chunk-YMZ3F2FZ.mjs';import'../chunk-QYUPLKLP.mjs';
|