@zeke-02/docx-editor-core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +89 -0
- package/dist/ImageExtension-BN327PNe.d.mts +38 -0
- package/dist/ImageExtension-BlI5afZD.d.ts +38 -0
- package/dist/Subscribable-DOz6Ohoo.d.mts +33 -0
- package/dist/Subscribable-DOz6Ohoo.d.ts +33 -0
- package/dist/agent/index.d.mts +168 -0
- package/dist/agent/index.d.ts +168 -0
- package/dist/agent/index.js +1 -0
- package/dist/agent/index.mjs +1 -0
- package/dist/borders-BH_GoYU3.d.mts +58 -0
- package/dist/borders-Z9hPno2u.d.ts +58 -0
- package/dist/chunk-2HFQ4QTU.js +1 -0
- package/dist/chunk-2KHWHVTA.js +1 -0
- package/dist/chunk-2MSZXH6Q.mjs +2 -0
- package/dist/chunk-3COGZG7O.mjs +1 -0
- package/dist/chunk-3NRMSZX2.mjs +1 -0
- package/dist/chunk-3SXJPJSV.mjs +1 -0
- package/dist/chunk-44FHVKSI.js +1 -0
- package/dist/chunk-4BFNWPKW.js +1 -0
- package/dist/chunk-4G6AJ4ZM.js +1 -0
- package/dist/chunk-4GER4JLW.js +1 -0
- package/dist/chunk-4Q2IP5FW.js +1 -0
- package/dist/chunk-56D223FM.mjs +1 -0
- package/dist/chunk-5VBNOHRE.mjs +1 -0
- package/dist/chunk-67LVRQIR.mjs +1 -0
- package/dist/chunk-6LVPRTB6.js +1 -0
- package/dist/chunk-6NQSIC27.mjs +1 -0
- package/dist/chunk-6Y6LON6Y.mjs +1 -0
- package/dist/chunk-6ZXL3EIP.mjs +2 -0
- package/dist/chunk-7AMYZMCX.js +1 -0
- package/dist/chunk-7E5VBRDL.mjs +1 -0
- package/dist/chunk-7HANRHHL.js +1 -0
- package/dist/chunk-7LRR7RKE.mjs +15 -0
- package/dist/chunk-7RDCZLTU.js +1 -0
- package/dist/chunk-7U4I6BKJ.js +1 -0
- package/dist/chunk-7Z2AGPNQ.mjs +10 -0
- package/dist/chunk-AAPBAMD7.js +1 -0
- package/dist/chunk-AGVFAXVQ.mjs +9 -0
- package/dist/chunk-AMENZY5F.mjs +1 -0
- package/dist/chunk-ARHPXIBJ.mjs +1 -0
- package/dist/chunk-BGY3CB37.mjs +1 -0
- package/dist/chunk-BHBOAP6Z.js +3 -0
- package/dist/chunk-BOOHU5EW.mjs +1 -0
- package/dist/chunk-C2BAPYGJ.js +1 -0
- package/dist/chunk-CGJ6S3AH.mjs +1 -0
- package/dist/chunk-CKKO4JWE.mjs +1 -0
- package/dist/chunk-CTHHUJAB.mjs +2 -0
- package/dist/chunk-CUY2THAO.mjs +1 -0
- package/dist/chunk-CXQDYR2Y.js +1 -0
- package/dist/chunk-D4RPOJC7.js +1 -0
- package/dist/chunk-D6GO7UGD.mjs +1 -0
- package/dist/chunk-DC7S76ZX.js +1 -0
- package/dist/chunk-DROCYKAR.js +1 -0
- package/dist/chunk-DV6GWBUJ.js +2 -0
- package/dist/chunk-DZYYLV2O.js +1 -0
- package/dist/chunk-E4JMCA5X.js +2 -0
- package/dist/chunk-ERNVFCGN.js +59 -0
- package/dist/chunk-ESI4BSBF.js +1 -0
- package/dist/chunk-F44ZLDZS.js +4 -0
- package/dist/chunk-FCJWLEKT.mjs +1 -0
- package/dist/chunk-FDEDN2RC.mjs +0 -0
- package/dist/chunk-FRYMBAHP.js +3 -0
- package/dist/chunk-FWTP7BN7.mjs +4 -0
- package/dist/chunk-G3YJ5RKC.mjs +1 -0
- package/dist/chunk-GGPKPXON.js +1 -0
- package/dist/chunk-HKVAW3RE.js +1 -0
- package/dist/chunk-HQPWFUP5.js +2 -0
- package/dist/chunk-I6PMX4BO.js +1 -0
- package/dist/chunk-ILJUDEZ5.mjs +1 -0
- package/dist/chunk-IMKU4O3P.js +1 -0
- package/dist/chunk-IP2VXNWG.js +1 -0
- package/dist/chunk-J4J2Y6EU.js +10 -0
- package/dist/chunk-J7NADDC4.mjs +1 -0
- package/dist/chunk-JFZIXFRC.js +1 -0
- package/dist/chunk-JHZ3HLSR.mjs +1 -0
- package/dist/chunk-JY5EFI4D.js +1 -0
- package/dist/chunk-JZESIPVC.mjs +3 -0
- package/dist/chunk-K7GVLZS6.mjs +1 -0
- package/dist/chunk-KESNGXGO.js +1 -0
- package/dist/chunk-KQTB5Y7P.mjs +1 -0
- package/dist/chunk-L2U3TTAD.js +9 -0
- package/dist/chunk-LBKMYD3M.mjs +1 -0
- package/dist/chunk-LCICADWM.js +2 -0
- package/dist/chunk-LE67NTCN.mjs +1 -0
- package/dist/chunk-LTHT4A4S.js +1 -0
- package/dist/chunk-MCFHOMA2.js +2 -0
- package/dist/chunk-MCX4GVRX.mjs +1 -0
- package/dist/chunk-MJ5FQX7Q.js +1 -0
- package/dist/chunk-MJ6XZFVD.mjs +1 -0
- package/dist/chunk-MNOHUTKE.js +15 -0
- package/dist/chunk-MOKKS75W.mjs +3 -0
- package/dist/chunk-MP4QSEO2.mjs +1 -0
- package/dist/chunk-MVZOTKNL.mjs +1 -0
- package/dist/chunk-MZ7LW5CH.js +1 -0
- package/dist/chunk-MZOVDLYL.js +1 -0
- package/dist/chunk-N3Y5BUKV.js +1 -0
- package/dist/chunk-NBLJPT54.mjs +1 -0
- package/dist/chunk-NDDJ67FQ.mjs +1 -0
- package/dist/chunk-NMUHXIF5.js +1 -0
- package/dist/chunk-NXLJVVVE.js +1 -0
- package/dist/chunk-OBMN4VSM.mjs +1 -0
- package/dist/chunk-OCAX2KJQ.js +4 -0
- package/dist/chunk-OEXVWIHW.mjs +2 -0
- package/dist/chunk-OZMNIX6U.mjs +1 -0
- package/dist/chunk-PRRM64JO.mjs +1 -0
- package/dist/chunk-PXE2OWEA.mjs +1 -0
- package/dist/chunk-Q4CKLXWA.js +1 -0
- package/dist/chunk-Q5QOBZWT.mjs +1 -0
- package/dist/chunk-QJJQ53V6.mjs +1 -0
- package/dist/chunk-QLPQVR5W.mjs +1 -0
- package/dist/chunk-QLX4HX3I.mjs +59 -0
- package/dist/chunk-QPFJJPIC.mjs +1 -0
- package/dist/chunk-QYUPLKLP.mjs +1 -0
- package/dist/chunk-RFC2SXZ6.mjs +4 -0
- package/dist/chunk-RNOXNNSD.mjs +0 -0
- package/dist/chunk-RPIQG46O.mjs +1 -0
- package/dist/chunk-RQN4C636.js +1 -0
- package/dist/chunk-SHJBS42Y.js +1 -0
- package/dist/chunk-SORYYVJ7.js +1 -0
- package/dist/chunk-SWC6T7YQ.js +1 -0
- package/dist/chunk-TE2AF7FM.js +1 -0
- package/dist/chunk-TE2VQJZG.js +1 -0
- package/dist/chunk-TUIEV7Q7.js +1 -0
- package/dist/chunk-U4UCHBZ7.js +1 -0
- package/dist/chunk-U74VPTIU.js +1 -0
- package/dist/chunk-UCJGOQ4J.mjs +1 -0
- package/dist/chunk-UQ6WNWXX.js +1 -0
- package/dist/chunk-VHUVPHPI.mjs +1 -0
- package/dist/chunk-VQWZHPWI.mjs +1 -0
- package/dist/chunk-VW22RZ6C.mjs +1 -0
- package/dist/chunk-WLHNIXWC.mjs +2 -0
- package/dist/chunk-WLKRUBY4.js +1 -0
- package/dist/chunk-WTFLNYAT.mjs +1 -0
- package/dist/chunk-XNDGWWDT.js +1 -0
- package/dist/chunk-XXU7YQVV.js +1 -0
- package/dist/chunk-Y74ANBPV.js +1 -0
- package/dist/chunk-YMZ3F2FZ.mjs +1 -0
- package/dist/chunk-YTDWMXNS.js +1 -0
- package/dist/chunk-YUZQTRI2.js +1 -0
- package/dist/chunk-ZX26QZJ5.mjs +1 -0
- package/dist/chunk-ZY7EMTZ3.mjs +1 -0
- package/dist/colorResolver-BZ_yScf4.d.ts +390 -0
- package/dist/colorResolver-C6DtsoFI.d.mts +390 -0
- package/dist/colors-C3vA7HUU.d.mts +70 -0
- package/dist/colors-C3vA7HUU.d.ts +70 -0
- package/dist/content-5Mrz6w_b.d.mts +1360 -0
- package/dist/content-CmqAwdFL.d.ts +1360 -0
- package/dist/core-plugins.d.mts +63 -0
- package/dist/core-plugins.d.ts +63 -0
- package/dist/core-plugins.js +1 -0
- package/dist/core-plugins.mjs +1 -0
- package/dist/core.d.mts +398 -0
- package/dist/core.d.ts +398 -0
- package/dist/core.js +1 -0
- package/dist/core.mjs +1 -0
- package/dist/documentSerializer-BRaaXIHm.d.ts +36 -0
- package/dist/documentSerializer-DgO3A9av.d.mts +36 -0
- package/dist/docx/index.d.mts +1123 -0
- package/dist/docx/index.d.ts +1123 -0
- package/dist/docx/index.js +1 -0
- package/dist/docx/index.mjs +1 -0
- package/dist/docx/parser.d.mts +108 -0
- package/dist/docx/parser.d.ts +108 -0
- package/dist/docx/parser.js +1 -0
- package/dist/docx/parser.mjs +1 -0
- package/dist/docx/rezip.d.mts +312 -0
- package/dist/docx/rezip.d.ts +312 -0
- package/dist/docx/rezip.js +1 -0
- package/dist/docx/rezip.mjs +1 -0
- package/dist/docx/serializer/index.d.mts +125 -0
- package/dist/docx/serializer/index.d.ts +125 -0
- package/dist/docx/serializer/index.js +1 -0
- package/dist/docx/serializer/index.mjs +1 -0
- package/dist/docx/wrapTypes.d.mts +19 -0
- package/dist/docx/wrapTypes.d.ts +19 -0
- package/dist/docx/wrapTypes.js +1 -0
- package/dist/docx/wrapTypes.mjs +1 -0
- package/dist/docxInput-DTbCa48g.d.mts +21 -0
- package/dist/docxInput-DTbCa48g.d.ts +21 -0
- package/dist/executor-DZAMMQ35.js +1 -0
- package/dist/executor-ZCJRLT3Z.mjs +1 -0
- package/dist/findParagraphByParaId-Maw_8M5D.d.mts +28 -0
- package/dist/findParagraphByParaId-Maw_8M5D.d.ts +28 -0
- package/dist/fontLoader-8b4X-AIh.d.mts +283 -0
- package/dist/fontLoader-CK2QLq68.d.ts +283 -0
- package/dist/footnotes-lCH_P3N3.d.mts +78 -0
- package/dist/footnotes-skVvEHvZ.d.ts +78 -0
- package/dist/formatting-BH4hcZiq.d.mts +410 -0
- package/dist/formatting-_OXU8gLB.d.ts +410 -0
- package/dist/headerFooterLayout-72Vz7yp3.d.mts +292 -0
- package/dist/headerFooterLayout-Ca4ESDHF.d.ts +292 -0
- package/dist/headless.d.mts +109 -0
- package/dist/headless.d.ts +109 -0
- package/dist/headless.js +1 -0
- package/dist/headless.mjs +1 -0
- package/dist/layout-bridge/clickToPositionDom.d.mts +56 -0
- package/dist/layout-bridge/clickToPositionDom.d.ts +56 -0
- package/dist/layout-bridge/clickToPositionDom.js +1 -0
- package/dist/layout-bridge/clickToPositionDom.mjs +1 -0
- package/dist/layout-bridge/index.d.mts +462 -0
- package/dist/layout-bridge/index.d.ts +462 -0
- package/dist/layout-bridge/index.js +1 -0
- package/dist/layout-bridge/index.mjs +1 -0
- package/dist/layout-bridge/measuring/index.d.mts +377 -0
- package/dist/layout-bridge/measuring/index.d.ts +377 -0
- package/dist/layout-bridge/measuring/index.js +1 -0
- package/dist/layout-bridge/measuring/index.mjs +1 -0
- package/dist/layout-bridge/tableInsertHover.d.mts +45 -0
- package/dist/layout-bridge/tableInsertHover.d.ts +45 -0
- package/dist/layout-bridge/tableInsertHover.js +1 -0
- package/dist/layout-bridge/tableInsertHover.mjs +1 -0
- package/dist/layout-bridge/toFlowBlocks.d.mts +130 -0
- package/dist/layout-bridge/toFlowBlocks.d.ts +130 -0
- package/dist/layout-bridge/toFlowBlocks.js +1 -0
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -0
- package/dist/layout-engine/index.d.mts +352 -0
- package/dist/layout-engine/index.d.ts +352 -0
- package/dist/layout-engine/index.js +1 -0
- package/dist/layout-engine/index.mjs +1 -0
- package/dist/layout-engine/types.d.mts +943 -0
- package/dist/layout-engine/types.d.ts +943 -0
- package/dist/layout-engine/types.js +1 -0
- package/dist/layout-engine/types.mjs +1 -0
- package/dist/layout-painter/index.d.mts +22 -0
- package/dist/layout-painter/index.d.ts +22 -0
- package/dist/layout-painter/index.js +1 -0
- package/dist/layout-painter/index.mjs +1 -0
- package/dist/layout-painter/renderPage.d.mts +680 -0
- package/dist/layout-painter/renderPage.d.ts +680 -0
- package/dist/layout-painter/renderPage.js +1 -0
- package/dist/layout-painter/renderPage.mjs +1 -0
- package/dist/managers/AutoSaveManager.d.mts +95 -0
- package/dist/managers/AutoSaveManager.d.ts +95 -0
- package/dist/managers/AutoSaveManager.js +1 -0
- package/dist/managers/AutoSaveManager.mjs +1 -0
- package/dist/managers/TableSelectionManager.d.mts +94 -0
- package/dist/managers/TableSelectionManager.d.ts +94 -0
- package/dist/managers/TableSelectionManager.js +1 -0
- package/dist/managers/TableSelectionManager.mjs +1 -0
- package/dist/managers/types.d.mts +121 -0
- package/dist/managers/types.d.ts +121 -0
- package/dist/managers/types.js +1 -0
- package/dist/managers/types.mjs +0 -0
- package/dist/marks-BY573yZn.d.mts +56 -0
- package/dist/marks-CjC9tF5k.d.ts +56 -0
- package/dist/mcp-cli.mjs +138 -0
- package/dist/mcp.d.mts +183 -0
- package/dist/mcp.d.ts +183 -0
- package/dist/mcp.js +16 -0
- package/dist/mcp.mjs +16 -0
- package/dist/nodes-7753Bgi_.d.mts +320 -0
- package/dist/nodes-CC_nwkT_.d.ts +320 -0
- package/dist/plugin-api/RenderedDomContext.d.mts +74 -0
- package/dist/plugin-api/RenderedDomContext.d.ts +74 -0
- package/dist/plugin-api/RenderedDomContext.js +1 -0
- package/dist/plugin-api/RenderedDomContext.mjs +1 -0
- package/dist/plugin-api/index.d.mts +15 -0
- package/dist/plugin-api/index.d.ts +15 -0
- package/dist/plugin-api/index.js +1 -0
- package/dist/plugin-api/index.mjs +0 -0
- package/dist/plugin-api/resolveItemPositions.d.mts +54 -0
- package/dist/plugin-api/resolveItemPositions.d.ts +54 -0
- package/dist/plugin-api/resolveItemPositions.js +1 -0
- package/dist/plugin-api/resolveItemPositions.mjs +1 -0
- package/dist/plugin-api/types.d.mts +190 -0
- package/dist/plugin-api/types.d.ts +190 -0
- package/dist/plugin-api/types.js +1 -0
- package/dist/plugin-api/types.mjs +0 -0
- package/dist/processTemplate-GPFDLQMX.mjs +1 -0
- package/dist/processTemplate-HH2E3HBO.js +1 -0
- package/dist/prosemirror/commands/formatting.d.mts +100 -0
- package/dist/prosemirror/commands/formatting.d.ts +100 -0
- package/dist/prosemirror/commands/formatting.js +1 -0
- package/dist/prosemirror/commands/formatting.mjs +1 -0
- package/dist/prosemirror/commands/index.d.mts +188 -0
- package/dist/prosemirror/commands/index.d.ts +188 -0
- package/dist/prosemirror/commands/index.js +1 -0
- package/dist/prosemirror/commands/index.mjs +1 -0
- package/dist/prosemirror/commands/pageBreak.d.mts +20 -0
- package/dist/prosemirror/commands/pageBreak.d.ts +20 -0
- package/dist/prosemirror/commands/pageBreak.js +1 -0
- package/dist/prosemirror/commands/pageBreak.mjs +1 -0
- package/dist/prosemirror/commands/paragraph.d.mts +70 -0
- package/dist/prosemirror/commands/paragraph.d.ts +70 -0
- package/dist/prosemirror/commands/paragraph.js +1 -0
- package/dist/prosemirror/commands/paragraph.mjs +1 -0
- package/dist/prosemirror/conversion/fromProseDoc.d.mts +65 -0
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +65 -0
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -0
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -0
- package/dist/prosemirror/conversion/index.d.mts +85 -0
- package/dist/prosemirror/conversion/index.d.ts +85 -0
- package/dist/prosemirror/conversion/index.js +1 -0
- package/dist/prosemirror/conversion/index.mjs +1 -0
- package/dist/prosemirror/editor.css +823 -0
- package/dist/prosemirror/extensions/index.d.mts +79 -0
- package/dist/prosemirror/extensions/index.d.ts +79 -0
- package/dist/prosemirror/extensions/index.js +1 -0
- package/dist/prosemirror/extensions/index.mjs +1 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.d.mts +30 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +30 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.mjs +1 -0
- package/dist/prosemirror/index.d.mts +70 -0
- package/dist/prosemirror/index.d.ts +70 -0
- package/dist/prosemirror/index.js +1 -0
- package/dist/prosemirror/index.mjs +1 -0
- package/dist/prosemirror/plugins/index.d.mts +154 -0
- package/dist/prosemirror/plugins/index.d.ts +154 -0
- package/dist/prosemirror/plugins/index.js +1 -0
- package/dist/prosemirror/plugins/index.mjs +1 -0
- package/dist/prosemirror/plugins/selectionTracker.d.mts +78 -0
- package/dist/prosemirror/plugins/selectionTracker.d.ts +78 -0
- package/dist/prosemirror/plugins/selectionTracker.js +1 -0
- package/dist/prosemirror/plugins/selectionTracker.mjs +1 -0
- package/dist/prosemirror/schema/index.d.mts +29 -0
- package/dist/prosemirror/schema/index.d.ts +29 -0
- package/dist/prosemirror/schema/index.js +1 -0
- package/dist/prosemirror/schema/index.mjs +1 -0
- package/dist/prosemirror/styles/index.d.mts +124 -0
- package/dist/prosemirror/styles/index.d.ts +124 -0
- package/dist/prosemirror/styles/index.js +1 -0
- package/dist/prosemirror/styles/index.mjs +1 -0
- package/dist/prosemirror/template/prosemirror-plugin.d.mts +66 -0
- package/dist/prosemirror/template/prosemirror-plugin.d.ts +66 -0
- package/dist/prosemirror/template/prosemirror-plugin.js +15 -0
- package/dist/prosemirror/template/prosemirror-plugin.mjs +15 -0
- package/dist/prosemirror/utils/ClickPositionResolver.d.mts +109 -0
- package/dist/prosemirror/utils/ClickPositionResolver.d.ts +109 -0
- package/dist/prosemirror/utils/ClickPositionResolver.js +1 -0
- package/dist/prosemirror/utils/ClickPositionResolver.mjs +1 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.d.mts +81 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.d.ts +81 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.js +1 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.mjs +1 -0
- package/dist/prosemirror/utils/PointerEventHandler.d.mts +94 -0
- package/dist/prosemirror/utils/PointerEventHandler.d.ts +94 -0
- package/dist/prosemirror/utils/PointerEventHandler.js +1 -0
- package/dist/prosemirror/utils/PointerEventHandler.mjs +1 -0
- package/dist/prosemirror/utils/extractTrackedChanges.d.mts +85 -0
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +85 -0
- package/dist/prosemirror/utils/extractTrackedChanges.js +1 -0
- package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -0
- package/dist/prosemirror/utils/visualLineNavigation.d.mts +45 -0
- package/dist/prosemirror/utils/visualLineNavigation.d.ts +45 -0
- package/dist/prosemirror/utils/visualLineNavigation.js +1 -0
- package/dist/prosemirror/utils/visualLineNavigation.mjs +1 -0
- package/dist/registry-Cpyybgij.d.mts +165 -0
- package/dist/registry-E5pahPKL.d.ts +165 -0
- package/dist/selectionContext-BPAqgNgk.d.ts +570 -0
- package/dist/selectionContext-CoZat7QZ.d.mts +570 -0
- package/dist/selectiveSave-CWaPEv0B.d.ts +31 -0
- package/dist/selectiveSave-jinP_4xa.d.mts +31 -0
- package/dist/selectiveXmlPatch-ypkxlTD_.d.mts +23 -0
- package/dist/selectiveXmlPatch-ypkxlTD_.d.ts +23 -0
- package/dist/styles-BBv7doYK.d.ts +233 -0
- package/dist/styles-EI2lxeEN.d.mts +233 -0
- package/dist/table-P8esKWAc.d.ts +82 -0
- package/dist/table-_t_W8oQf.d.mts +82 -0
- package/dist/types/agentApi.d.mts +467 -0
- package/dist/types/agentApi.d.ts +467 -0
- package/dist/types/agentApi.js +1 -0
- package/dist/types/agentApi.mjs +1 -0
- package/dist/types/content.d.mts +18 -0
- package/dist/types/content.d.ts +18 -0
- package/dist/types/content.js +1 -0
- package/dist/types/content.mjs +0 -0
- package/dist/types/document.d.mts +123 -0
- package/dist/types/document.d.ts +123 -0
- package/dist/types/document.js +1 -0
- package/dist/types/document.mjs +0 -0
- package/dist/types-DXG7vqe9.d.ts +311 -0
- package/dist/types-RchZmPFN.d.mts +137 -0
- package/dist/types-RchZmPFN.d.ts +137 -0
- package/dist/types-dYdjUZMo.d.mts +311 -0
- package/dist/utils/cardStyles.d.mts +31 -0
- package/dist/utils/cardStyles.d.ts +31 -0
- package/dist/utils/cardStyles.js +1 -0
- package/dist/utils/cardStyles.mjs +1 -0
- package/dist/utils/comments.d.mts +121 -0
- package/dist/utils/comments.d.ts +121 -0
- package/dist/utils/comments.js +1 -0
- package/dist/utils/comments.mjs +1 -0
- package/dist/utils/findReplace.d.mts +114 -0
- package/dist/utils/findReplace.d.ts +114 -0
- package/dist/utils/findReplace.js +2 -0
- package/dist/utils/findReplace.mjs +2 -0
- package/dist/utils/findVerticalScrollParent.d.mts +25 -0
- package/dist/utils/findVerticalScrollParent.d.ts +25 -0
- package/dist/utils/findVerticalScrollParent.js +1 -0
- package/dist/utils/findVerticalScrollParent.mjs +1 -0
- package/dist/utils/fontOptions.d.mts +21 -0
- package/dist/utils/fontOptions.d.ts +21 -0
- package/dist/utils/fontOptions.js +1 -0
- package/dist/utils/fontOptions.mjs +1 -0
- package/dist/utils/headingCollector.d.mts +32 -0
- package/dist/utils/headingCollector.d.ts +32 -0
- package/dist/utils/headingCollector.js +1 -0
- package/dist/utils/headingCollector.mjs +1 -0
- package/dist/utils/highlightColors.d.mts +14 -0
- package/dist/utils/highlightColors.d.ts +14 -0
- package/dist/utils/highlightColors.js +1 -0
- package/dist/utils/highlightColors.mjs +1 -0
- package/dist/utils/index.d.mts +710 -0
- package/dist/utils/index.d.ts +710 -0
- package/dist/utils/index.js +82 -0
- package/dist/utils/index.mjs +82 -0
- package/dist/utils/listState.d.mts +27 -0
- package/dist/utils/listState.d.ts +27 -0
- package/dist/utils/listState.js +1 -0
- package/dist/utils/listState.mjs +1 -0
- package/dist/utils/reportIssue.d.mts +23 -0
- package/dist/utils/reportIssue.d.ts +23 -0
- package/dist/utils/reportIssue.js +2 -0
- package/dist/utils/reportIssue.mjs +2 -0
- package/dist/utils/sidebarConstants.d.mts +10 -0
- package/dist/utils/sidebarConstants.d.ts +10 -0
- package/dist/utils/sidebarConstants.js +1 -0
- package/dist/utils/sidebarConstants.mjs +1 -0
- package/dist/utils/textSelection.d.mts +92 -0
- package/dist/utils/textSelection.d.ts +92 -0
- package/dist/utils/textSelection.js +1 -0
- package/dist/utils/textSelection.mjs +1 -0
- package/dist/utils/units.d.mts +91 -0
- package/dist/utils/units.d.ts +91 -0
- package/dist/utils/units.js +1 -0
- package/dist/utils/units.mjs +1 -0
- package/dist/variableDetector-DF3-nxUC.d.mts +115 -0
- package/dist/variableDetector-sBkgVh3f.d.ts +115 -0
- package/package.json +565 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comprehensive TypeScript types for full DOCX document representation
|
|
3
|
+
*
|
|
4
|
+
* This barrel file re-exports all types from the split modules.
|
|
5
|
+
* Existing imports from './types/document' continue to work unchanged.
|
|
6
|
+
*
|
|
7
|
+
* Module structure:
|
|
8
|
+
* - colors.ts — Color primitives, borders, shading
|
|
9
|
+
* - formatting.ts — Text, paragraph, and table formatting properties
|
|
10
|
+
* - lists.ts — Numbering and list definitions
|
|
11
|
+
* - content.ts — Content model (runs, images, shapes, tables, paragraphs, sections)
|
|
12
|
+
* - styles.ts — Styles, theme, fonts, relationships, media
|
|
13
|
+
* @packageDocumentation
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export { B as BorderSpec, C as ColorValue, S as ShadingProperties, T as ThemeColorSlot } from '../colors-C3vA7HUU.js';
|
|
17
|
+
export { C as CellMargins, g as ConditionalFormatStyle, E as EmphasisMark, F as FloatingTableProperties, L as LineSpacingRule, d as ParagraphAlignment, P as ParagraphFormatting, h as TabLeader, e as TabStop, i as TabStopAlignment, j as TableBorders, c as TableCellFormatting, a as TableFormatting, f as TableLook, k as TableMeasurement, b as TableRowFormatting, l as TableWidthType, m as TextEffect, T as TextFormatting, U as UnderlineStyle } from '../formatting-_OXU8gLB.js';
|
|
18
|
+
import { c as DocumentBody, N as NumberingDefinitions, F as Footnote, E as Endnote, u as HeaderFooter } from '../content-CmqAwdFL.js';
|
|
19
|
+
export { A as AbstractNumbering, B as BlockContent, v as BlockSdt, w as BookmarkEnd, x as BookmarkStart, t as BreakContent, y as Column, C as Comment, a as CommentRangeEnd, b as CommentRangeStart, z as ComplexField, D as Deletion, G as DrawingContent, J as EndnotePosition, K as EndnoteProperties, O as Field, Q as FieldCharContent, U as FieldType, V as FooterReference, W as FootnotePosition, X as FootnoteProperties, Y as HeaderFooterType, Z as HeaderReference, H as Hyperlink, I as Image, _ as ImageCrop, $ as ImagePadding, a0 as ImagePosition, a1 as ImageSize, a2 as ImageTransform, a3 as ImageWrap, a4 as InlineSdt, d as Insertion, a5 as InstrTextContent, a6 as LevelSuffix, a7 as LineNumberRestart, L as ListLevel, a8 as ListRendering, a9 as MathEquation, M as MoveFrom, aa as MoveFromRangeEnd, ab as MoveFromRangeStart, e as MoveTo, ac as MoveToRangeEnd, ad as MoveToRangeStart, ae as NoBreakHyphenContent, af as NoteNumberRestart, ag as NoteReferenceContent, o as NumberFormat, ah as NumberingInstance, ai as PageOrientation, P as Paragraph, f as ParagraphContent, p as ParagraphPropertyChange, aj as PropertyChangeInfo, R as Run, g as RunContent, ak as RunPropertyChange, al as SdtProperties, am as SdtType, an as Section, S as SectionProperties, ao as SectionStart, ap as Shape, aq as ShapeContent, ar as ShapeFill, as as ShapeOutline, at as ShapeTextBody, au as ShapeType, av as SimpleField, aw as SoftHyphenContent, ax as SymbolContent, ay as TabContent, T as Table, h as TableCell, r as TableCellPropertyChange, q as TablePropertyChange, i as TableRow, s as TableRowPropertyChange, az as TableStructuralChangeInfo, aA as TextBox, j as TextContent, k as TrackedChangeInfo, l as TrackedRunChange, aB as VerticalAlign } from '../content-CmqAwdFL.js';
|
|
20
|
+
import { a as StyleDefinitions, T as Theme, F as FontTable, b as RelationshipMap, M as MediaFile } from '../styles-BBv7doYK.js';
|
|
21
|
+
export { D as DocDefaults, c as FontInfo, R as Relationship, d as RelationshipType, S as Style, e as StyleType, f as ThemeColorScheme, g as ThemeFont, h as ThemeFontScheme } from '../styles-BBv7doYK.js';
|
|
22
|
+
import '../docx/wrapTypes.js';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* settings.xml parser
|
|
26
|
+
*
|
|
27
|
+
* Extracts document-wide settings the layout pipeline needs at render time.
|
|
28
|
+
* We only read what's currently consumed; most of settings.xml (compatibility
|
|
29
|
+
* flags, view state, autoformat) is irrelevant to layout.
|
|
30
|
+
*/
|
|
31
|
+
/** Document-wide settings parsed from `word/settings.xml`. */
|
|
32
|
+
interface DocumentSettings {
|
|
33
|
+
/**
|
|
34
|
+
* `w:defaultTabStop` (§17.6.13) — interval in twips between default tab
|
|
35
|
+
* stops applied when a paragraph has no custom `w:tabs`. Word's default
|
|
36
|
+
* if unspecified is 720 twips (0.5 inch).
|
|
37
|
+
*/
|
|
38
|
+
defaultTabStop: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Comprehensive TypeScript types for full DOCX document representation
|
|
43
|
+
*
|
|
44
|
+
* This barrel file re-exports all types from the split modules.
|
|
45
|
+
* Existing imports from './types/document' continue to work unchanged.
|
|
46
|
+
*
|
|
47
|
+
* Module structure:
|
|
48
|
+
* - colors.ts — Color primitives, borders, shading
|
|
49
|
+
* - formatting.ts — Text, paragraph, and table formatting properties
|
|
50
|
+
* - lists.ts — Numbering and list definitions
|
|
51
|
+
* - content.ts — Content model (runs, images, shapes, tables, paragraphs, sections)
|
|
52
|
+
* - styles.ts — Styles, theme, fonts, relationships, media
|
|
53
|
+
* @packageDocumentation
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Complete DOCX package structure
|
|
59
|
+
*/
|
|
60
|
+
interface DocxPackage {
|
|
61
|
+
/** Document body */
|
|
62
|
+
document: DocumentBody;
|
|
63
|
+
/** Style definitions */
|
|
64
|
+
styles?: StyleDefinitions;
|
|
65
|
+
/** Theme */
|
|
66
|
+
theme?: Theme;
|
|
67
|
+
/** Numbering definitions */
|
|
68
|
+
numbering?: NumberingDefinitions;
|
|
69
|
+
/** Document-wide settings from `word/settings.xml` */
|
|
70
|
+
settings?: DocumentSettings;
|
|
71
|
+
/** Font table */
|
|
72
|
+
fontTable?: FontTable;
|
|
73
|
+
/** Footnotes */
|
|
74
|
+
footnotes?: Footnote[];
|
|
75
|
+
/** Endnotes */
|
|
76
|
+
endnotes?: Endnote[];
|
|
77
|
+
/** Headers by relationship ID */
|
|
78
|
+
headers?: Map<string, HeaderFooter>;
|
|
79
|
+
/** Footers by relationship ID */
|
|
80
|
+
footers?: Map<string, HeaderFooter>;
|
|
81
|
+
/** Document relationships */
|
|
82
|
+
relationships?: RelationshipMap;
|
|
83
|
+
/** Media files */
|
|
84
|
+
media?: Map<string, MediaFile>;
|
|
85
|
+
/** Document properties */
|
|
86
|
+
properties?: {
|
|
87
|
+
title?: string;
|
|
88
|
+
subject?: string;
|
|
89
|
+
creator?: string;
|
|
90
|
+
keywords?: string;
|
|
91
|
+
description?: string;
|
|
92
|
+
lastModifiedBy?: string;
|
|
93
|
+
revision?: number;
|
|
94
|
+
created?: Date;
|
|
95
|
+
modified?: Date;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Top-level parsed DOCX document — the result of `parseDocx(buffer)`.
|
|
100
|
+
*
|
|
101
|
+
* Wraps the unzipped DOCX package (`document.xml`, `styles.xml`, etc.),
|
|
102
|
+
* the original buffer for round-trip saves, and any template variables /
|
|
103
|
+
* parse warnings detected during ingestion.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* import { parseDocx } from '@zeke-02/docx-editor-core/headless';
|
|
108
|
+
* const doc = await parseDocx(buffer);
|
|
109
|
+
* console.log(doc.package.document.content.length);
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
interface Document {
|
|
113
|
+
/** Parsed DOCX package — body, styles, numbering, theme, media, headers/footers. */
|
|
114
|
+
package: DocxPackage;
|
|
115
|
+
/** Original DOCX buffer. Kept for round-trip saves that preserve untouched parts. */
|
|
116
|
+
originalBuffer?: ArrayBuffer;
|
|
117
|
+
/** Detected docxtemplater variables (e.g. `{name}`, `{address}`). Populated when the document is recognized as a template. */
|
|
118
|
+
templateVariables?: string[];
|
|
119
|
+
/** Non-fatal parser diagnostics — malformed parts, unsupported features, fallbacks. */
|
|
120
|
+
warnings?: string[];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export { type Document, DocumentBody, type DocumentSettings, type DocxPackage, Endnote, FontTable, Footnote, HeaderFooter, MediaFile, NumberingDefinitions, RelationshipMap, StyleDefinitions, Theme };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';
|
|
File without changes
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { Document } from './types/document.js';
|
|
2
|
+
import { Position, Range, AgentCommand } from './types/agentApi.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Core Plugin System Types
|
|
6
|
+
*
|
|
7
|
+
* Defines the interfaces for headless plugins that work in Node.js
|
|
8
|
+
* without React/DOM dependencies. These plugins extend DocumentAgent
|
|
9
|
+
* with additional commands and expose MCP tools for AI integration.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Core plugin interface - headless, works in Node.js
|
|
14
|
+
*
|
|
15
|
+
* Plugins can:
|
|
16
|
+
* - Register command handlers that DocumentAgent dispatches to
|
|
17
|
+
* - Declare MCP tools that the MCP server exposes to AI clients
|
|
18
|
+
* - Have optional initialization logic
|
|
19
|
+
* - Declare dependencies on other plugins
|
|
20
|
+
*/
|
|
21
|
+
interface CorePlugin {
|
|
22
|
+
/** Unique plugin identifier */
|
|
23
|
+
id: string;
|
|
24
|
+
/** Human-readable plugin name */
|
|
25
|
+
name: string;
|
|
26
|
+
/** Plugin version (semver) */
|
|
27
|
+
version?: string;
|
|
28
|
+
/** Plugin description */
|
|
29
|
+
description?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Command handlers this plugin provides.
|
|
32
|
+
* DocumentAgent dispatches commands to these handlers.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* commandHandlers: {
|
|
37
|
+
* 'insertTemplateVariable': (doc, cmd) => {
|
|
38
|
+
* // Transform document
|
|
39
|
+
* return modifiedDoc;
|
|
40
|
+
* },
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
commandHandlers?: Record<string, CommandHandler>;
|
|
45
|
+
/**
|
|
46
|
+
* MCP tools this plugin exposes.
|
|
47
|
+
* MCP server collects these from all plugins.
|
|
48
|
+
*/
|
|
49
|
+
mcpTools?: McpToolDefinition[];
|
|
50
|
+
/**
|
|
51
|
+
* Optional setup when plugin is registered.
|
|
52
|
+
* Called once during plugin registration.
|
|
53
|
+
*/
|
|
54
|
+
initialize?: () => void | Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Optional cleanup when plugin is unregistered.
|
|
57
|
+
*/
|
|
58
|
+
destroy?: () => void | Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Dependencies on other plugins (by ID).
|
|
61
|
+
* The registry ensures dependencies are loaded first.
|
|
62
|
+
*/
|
|
63
|
+
dependencies?: string[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Command handler function type
|
|
67
|
+
*
|
|
68
|
+
* Receives a document and a command, returns a modified document.
|
|
69
|
+
* Must be pure/immutable - always return a new document.
|
|
70
|
+
*/
|
|
71
|
+
type CommandHandler = (doc: Document, command: PluginCommand) => Document;
|
|
72
|
+
/**
|
|
73
|
+
* Extended command type for plugins
|
|
74
|
+
*
|
|
75
|
+
* Plugins can define custom command types beyond the built-in AgentCommand types.
|
|
76
|
+
*/
|
|
77
|
+
interface PluginCommand {
|
|
78
|
+
/** Command type identifier */
|
|
79
|
+
type: string;
|
|
80
|
+
/** Unique command ID (for undo tracking) */
|
|
81
|
+
id?: string;
|
|
82
|
+
/** Position for positional commands */
|
|
83
|
+
position?: Position;
|
|
84
|
+
/** Range for range-based commands */
|
|
85
|
+
range?: Range;
|
|
86
|
+
/** Additional command-specific data */
|
|
87
|
+
[key: string]: unknown;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Result of command execution
|
|
91
|
+
*/
|
|
92
|
+
interface CommandResult {
|
|
93
|
+
/** The modified document */
|
|
94
|
+
document: Document;
|
|
95
|
+
/** Whether the command succeeded */
|
|
96
|
+
success: boolean;
|
|
97
|
+
/** Error message if failed */
|
|
98
|
+
error?: string;
|
|
99
|
+
/** Metadata about the operation */
|
|
100
|
+
metadata?: Record<string, unknown>;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* MCP tool definition
|
|
104
|
+
*
|
|
105
|
+
* Describes a tool that can be called by AI clients through the MCP server.
|
|
106
|
+
*/
|
|
107
|
+
interface McpToolDefinition {
|
|
108
|
+
/** Tool name (used in MCP protocol) */
|
|
109
|
+
name: string;
|
|
110
|
+
/** Human-readable description for AI */
|
|
111
|
+
description: string;
|
|
112
|
+
/**
|
|
113
|
+
* JSON Schema for tool input validation.
|
|
114
|
+
* Can be a Zod schema or plain JSON Schema object.
|
|
115
|
+
*/
|
|
116
|
+
inputSchema: JsonSchema | ZodSchemaLike;
|
|
117
|
+
/**
|
|
118
|
+
* Handler function for the tool.
|
|
119
|
+
* Receives validated input and returns a result.
|
|
120
|
+
*/
|
|
121
|
+
handler: McpToolHandler;
|
|
122
|
+
/**
|
|
123
|
+
* Optional annotations for the tool
|
|
124
|
+
*/
|
|
125
|
+
annotations?: McpToolAnnotations;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* MCP tool handler function
|
|
129
|
+
*/
|
|
130
|
+
type McpToolHandler = (input: unknown, context: McpToolContext) => Promise<McpToolResult> | McpToolResult;
|
|
131
|
+
/**
|
|
132
|
+
* Context passed to MCP tool handlers
|
|
133
|
+
*/
|
|
134
|
+
interface McpToolContext {
|
|
135
|
+
/** Current document (if loaded) */
|
|
136
|
+
document?: Document;
|
|
137
|
+
/** Document buffer (if loaded) */
|
|
138
|
+
documentBuffer?: ArrayBuffer;
|
|
139
|
+
/** Session state */
|
|
140
|
+
session: McpSession;
|
|
141
|
+
/** Logger for debugging */
|
|
142
|
+
log: (message: string, data?: unknown) => void;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* MCP session state
|
|
146
|
+
*
|
|
147
|
+
* Maintains state across tool calls within a session.
|
|
148
|
+
*/
|
|
149
|
+
interface McpSession {
|
|
150
|
+
/** Session ID */
|
|
151
|
+
id: string;
|
|
152
|
+
/** Loaded documents by ID */
|
|
153
|
+
documents: Map<string, LoadedDocument>;
|
|
154
|
+
/** Custom session data */
|
|
155
|
+
data: Map<string, unknown>;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* A loaded document in the session
|
|
159
|
+
*/
|
|
160
|
+
interface LoadedDocument {
|
|
161
|
+
/** Document ID */
|
|
162
|
+
id: string;
|
|
163
|
+
/** Parsed document */
|
|
164
|
+
document: Document;
|
|
165
|
+
/** Original buffer (for repacking) */
|
|
166
|
+
buffer?: ArrayBuffer;
|
|
167
|
+
/** Source filename or path */
|
|
168
|
+
source?: string;
|
|
169
|
+
/** Last modified timestamp */
|
|
170
|
+
lastModified: number;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* MCP tool result
|
|
174
|
+
*/
|
|
175
|
+
interface McpToolResult {
|
|
176
|
+
/** Result content */
|
|
177
|
+
content: McpToolContent[];
|
|
178
|
+
/** Whether this is an error result */
|
|
179
|
+
isError?: boolean;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* MCP tool content types
|
|
183
|
+
*/
|
|
184
|
+
type McpToolContent = {
|
|
185
|
+
type: 'text';
|
|
186
|
+
text: string;
|
|
187
|
+
} | {
|
|
188
|
+
type: 'image';
|
|
189
|
+
data: string;
|
|
190
|
+
mimeType: string;
|
|
191
|
+
} | {
|
|
192
|
+
type: 'resource';
|
|
193
|
+
uri: string;
|
|
194
|
+
mimeType?: string;
|
|
195
|
+
text?: string;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* MCP tool annotations
|
|
199
|
+
*/
|
|
200
|
+
interface McpToolAnnotations {
|
|
201
|
+
/** Tool category for organization */
|
|
202
|
+
category?: string;
|
|
203
|
+
/** Whether this tool modifies the document */
|
|
204
|
+
readOnly?: boolean;
|
|
205
|
+
/** Estimated cost/complexity */
|
|
206
|
+
complexity?: 'low' | 'medium' | 'high';
|
|
207
|
+
/** Example usage */
|
|
208
|
+
examples?: McpToolExample[];
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* MCP tool example
|
|
212
|
+
*/
|
|
213
|
+
interface McpToolExample {
|
|
214
|
+
/** Example description */
|
|
215
|
+
description: string;
|
|
216
|
+
/** Example input */
|
|
217
|
+
input: unknown;
|
|
218
|
+
/** Expected output description */
|
|
219
|
+
output?: string;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* JSON Schema definition (subset)
|
|
223
|
+
*/
|
|
224
|
+
interface JsonSchema {
|
|
225
|
+
type?: string | string[];
|
|
226
|
+
properties?: Record<string, JsonSchema>;
|
|
227
|
+
items?: JsonSchema;
|
|
228
|
+
required?: string[];
|
|
229
|
+
description?: string;
|
|
230
|
+
enum?: unknown[];
|
|
231
|
+
default?: unknown;
|
|
232
|
+
minimum?: number;
|
|
233
|
+
maximum?: number;
|
|
234
|
+
minLength?: number;
|
|
235
|
+
maxLength?: number;
|
|
236
|
+
pattern?: string;
|
|
237
|
+
format?: string;
|
|
238
|
+
additionalProperties?: boolean | JsonSchema;
|
|
239
|
+
anyOf?: JsonSchema[];
|
|
240
|
+
oneOf?: JsonSchema[];
|
|
241
|
+
allOf?: JsonSchema[];
|
|
242
|
+
$ref?: string;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Zod-like schema interface for compatibility
|
|
246
|
+
*/
|
|
247
|
+
interface ZodSchemaLike {
|
|
248
|
+
_def?: unknown;
|
|
249
|
+
parse?: (data: unknown) => unknown;
|
|
250
|
+
safeParse?: (data: unknown) => {
|
|
251
|
+
success: boolean;
|
|
252
|
+
data?: unknown;
|
|
253
|
+
error?: unknown;
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Check if a schema is Zod-like
|
|
258
|
+
*/
|
|
259
|
+
declare function isZodSchema(schema: unknown): schema is ZodSchemaLike;
|
|
260
|
+
/**
|
|
261
|
+
* Plugin lifecycle events
|
|
262
|
+
*/
|
|
263
|
+
type PluginEvent = {
|
|
264
|
+
type: 'registered';
|
|
265
|
+
plugin: CorePlugin;
|
|
266
|
+
} | {
|
|
267
|
+
type: 'unregistered';
|
|
268
|
+
pluginId: string;
|
|
269
|
+
} | {
|
|
270
|
+
type: 'error';
|
|
271
|
+
pluginId: string;
|
|
272
|
+
error: Error;
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* Plugin event listener
|
|
276
|
+
*/
|
|
277
|
+
type PluginEventListener = (event: PluginEvent) => void;
|
|
278
|
+
/**
|
|
279
|
+
* Extract command type from a union
|
|
280
|
+
*/
|
|
281
|
+
type ExtractCommand<T extends AgentCommand, Type extends string> = T extends {
|
|
282
|
+
type: Type;
|
|
283
|
+
} ? T : never;
|
|
284
|
+
/**
|
|
285
|
+
* Create a typed command handler
|
|
286
|
+
*/
|
|
287
|
+
type TypedCommandHandler<T extends PluginCommand> = (doc: Document, command: T) => Document;
|
|
288
|
+
/**
|
|
289
|
+
* Plugin configuration options
|
|
290
|
+
*/
|
|
291
|
+
interface PluginOptions {
|
|
292
|
+
/** Enable debug logging */
|
|
293
|
+
debug?: boolean;
|
|
294
|
+
/** Custom configuration */
|
|
295
|
+
config?: Record<string, unknown>;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Result of plugin registration
|
|
299
|
+
*/
|
|
300
|
+
interface PluginRegistrationResult {
|
|
301
|
+
/** Whether registration succeeded */
|
|
302
|
+
success: boolean;
|
|
303
|
+
/** Registered plugin (if successful) */
|
|
304
|
+
plugin?: CorePlugin;
|
|
305
|
+
/** Error message (if failed) */
|
|
306
|
+
error?: string;
|
|
307
|
+
/** Warning messages */
|
|
308
|
+
warnings?: string[];
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export { type CommandHandler as C, type ExtractCommand as E, type JsonSchema as J, type LoadedDocument as L, type McpSession as M, type PluginCommand as P, type TypedCommandHandler as T, type ZodSchemaLike as Z, type CommandResult as a, type CorePlugin as b, type McpToolAnnotations as c, type McpToolContent as d, type McpToolContext as e, type McpToolDefinition as f, type McpToolHandler as g, type McpToolResult as h, type PluginEvent as i, type PluginEventListener as j, type PluginOptions as k, type PluginRegistrationResult as l, isZodSchema as m, type McpToolExample as n };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { Schema, NodeSpec, MarkSpec } from 'prosemirror-model';
|
|
2
|
+
import { Plugin, Command } from 'prosemirror-state';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Extension Manager
|
|
6
|
+
*
|
|
7
|
+
* Two-phase initialization:
|
|
8
|
+
* 1. buildSchema() — collects NodeSpecs/MarkSpecs from extensions → new Schema
|
|
9
|
+
* 2. initializeRuntime() — calls onSchemaReady() on each extension, collects plugins/commands/keymaps
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
declare class ExtensionManager {
|
|
13
|
+
private extensions;
|
|
14
|
+
private schema;
|
|
15
|
+
private plugins;
|
|
16
|
+
private commands;
|
|
17
|
+
constructor(extensions: AnyExtension[]);
|
|
18
|
+
/**
|
|
19
|
+
* Phase 1: Build schema from node/mark extensions
|
|
20
|
+
*/
|
|
21
|
+
buildSchema(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Phase 2: Initialize runtime (plugins, commands, keymaps)
|
|
24
|
+
* Must be called after buildSchema()
|
|
25
|
+
*/
|
|
26
|
+
initializeRuntime(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Get the built schema
|
|
29
|
+
*/
|
|
30
|
+
getSchema(): Schema;
|
|
31
|
+
/**
|
|
32
|
+
* Get all plugins (raw + keymap merged)
|
|
33
|
+
*/
|
|
34
|
+
getPlugins(): Plugin[];
|
|
35
|
+
/**
|
|
36
|
+
* Get the flat command registry
|
|
37
|
+
*/
|
|
38
|
+
getCommands(): CommandMap;
|
|
39
|
+
/**
|
|
40
|
+
* Get a specific command by name
|
|
41
|
+
*/
|
|
42
|
+
getCommand(name: string): ((...args: any[]) => Command) | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Lifecycle: destroy
|
|
45
|
+
*/
|
|
46
|
+
destroy(): void;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Extension System Type Definitions
|
|
51
|
+
*
|
|
52
|
+
* Tiptap-style extension architecture for ProseMirror.
|
|
53
|
+
* Three extension types:
|
|
54
|
+
* - Extension: plugins, commands, keymaps (no schema)
|
|
55
|
+
* - NodeExtension: adds a node spec to the schema
|
|
56
|
+
* - MarkExtension: adds a mark spec to the schema
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
type ExtensionPriority = number;
|
|
60
|
+
declare const Priority: {
|
|
61
|
+
readonly Highest: 0;
|
|
62
|
+
readonly High: 50;
|
|
63
|
+
readonly Default: 100;
|
|
64
|
+
readonly Low: 150;
|
|
65
|
+
readonly Lowest: 200;
|
|
66
|
+
};
|
|
67
|
+
interface ExtensionContext {
|
|
68
|
+
schema: Schema;
|
|
69
|
+
/**
|
|
70
|
+
* The manager that owns this extension. Use this in runtime callbacks
|
|
71
|
+
* (e.g. `handleKeyDown`) that need to dispatch commands, instead of
|
|
72
|
+
* reaching back to the `singletonManager` export — the latter forms a
|
|
73
|
+
* circular import that breaks when the package is consumed as a built
|
|
74
|
+
* bundle.
|
|
75
|
+
*/
|
|
76
|
+
manager: ExtensionManager;
|
|
77
|
+
}
|
|
78
|
+
type CommandMap = Record<string, (...args: any[]) => Command>;
|
|
79
|
+
type KeyboardShortcutMap = Record<string, Command>;
|
|
80
|
+
interface ExtensionRuntime {
|
|
81
|
+
commands?: CommandMap;
|
|
82
|
+
keyboardShortcuts?: KeyboardShortcutMap;
|
|
83
|
+
plugins?: Plugin[];
|
|
84
|
+
}
|
|
85
|
+
interface ExtensionConfig {
|
|
86
|
+
name: string;
|
|
87
|
+
priority: ExtensionPriority;
|
|
88
|
+
options: Record<string, unknown>;
|
|
89
|
+
}
|
|
90
|
+
interface NodeExtensionConfig extends ExtensionConfig {
|
|
91
|
+
schemaNodeName: string;
|
|
92
|
+
nodeSpec: NodeSpec;
|
|
93
|
+
}
|
|
94
|
+
interface MarkExtensionConfig extends ExtensionConfig {
|
|
95
|
+
schemaMarkName: string;
|
|
96
|
+
markSpec: MarkSpec;
|
|
97
|
+
}
|
|
98
|
+
interface Extension {
|
|
99
|
+
type: 'extension';
|
|
100
|
+
config: ExtensionConfig;
|
|
101
|
+
onSchemaReady(ctx: ExtensionContext): ExtensionRuntime;
|
|
102
|
+
}
|
|
103
|
+
interface NodeExtension {
|
|
104
|
+
type: 'node';
|
|
105
|
+
config: NodeExtensionConfig;
|
|
106
|
+
onSchemaReady(ctx: ExtensionContext): ExtensionRuntime;
|
|
107
|
+
}
|
|
108
|
+
interface MarkExtension {
|
|
109
|
+
type: 'mark';
|
|
110
|
+
config: MarkExtensionConfig;
|
|
111
|
+
onSchemaReady(ctx: ExtensionContext): ExtensionRuntime;
|
|
112
|
+
}
|
|
113
|
+
type AnyExtension = Extension | NodeExtension | MarkExtension;
|
|
114
|
+
interface ExtensionDefinition<TOptions = Record<string, unknown>> {
|
|
115
|
+
name: string;
|
|
116
|
+
priority?: ExtensionPriority;
|
|
117
|
+
defaultOptions?: TOptions;
|
|
118
|
+
onSchemaReady(ctx: ExtensionContext, options: TOptions): ExtensionRuntime;
|
|
119
|
+
}
|
|
120
|
+
interface NodeExtensionDefinition<TOptions = Record<string, unknown>> {
|
|
121
|
+
name: string;
|
|
122
|
+
priority?: ExtensionPriority;
|
|
123
|
+
defaultOptions?: TOptions;
|
|
124
|
+
schemaNodeName: string;
|
|
125
|
+
nodeSpec: NodeSpec | ((options: TOptions) => NodeSpec);
|
|
126
|
+
onSchemaReady?(ctx: ExtensionContext, options: TOptions): ExtensionRuntime;
|
|
127
|
+
}
|
|
128
|
+
interface MarkExtensionDefinition<TOptions = Record<string, unknown>> {
|
|
129
|
+
name: string;
|
|
130
|
+
priority?: ExtensionPriority;
|
|
131
|
+
defaultOptions?: TOptions;
|
|
132
|
+
schemaMarkName: string;
|
|
133
|
+
markSpec: MarkSpec | ((options: TOptions) => MarkSpec);
|
|
134
|
+
onSchemaReady?(ctx: ExtensionContext, options: TOptions): ExtensionRuntime;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export { type AnyExtension as A, type CommandMap as C, type Extension as E, type KeyboardShortcutMap as K, type MarkExtensionDefinition as M, type NodeExtension as N, Priority as P, ExtensionManager as a, type ExtensionDefinition as b, type MarkExtension as c, type NodeExtensionDefinition as d, type ExtensionConfig as e, type ExtensionContext as f, type ExtensionPriority as g, type ExtensionRuntime as h, type MarkExtensionConfig as i, type NodeExtensionConfig as j };
|