@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,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RenderedDomContext Implementation
|
|
3
|
+
*
|
|
4
|
+
* Provides DOM-based position mapping for the LayoutPainter output.
|
|
5
|
+
* Uses the same data-pm-start/data-pm-end attribute pattern as the
|
|
6
|
+
* selection overlay in PagedEditor.
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
import { RenderedDomContext, PositionCoordinates } from './types.mjs';
|
|
11
|
+
import 'prosemirror-state';
|
|
12
|
+
import 'prosemirror-view';
|
|
13
|
+
import 'prosemirror-model';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* RenderedDomContext Implementation
|
|
17
|
+
*
|
|
18
|
+
* Provides DOM-based position mapping for the LayoutPainter output.
|
|
19
|
+
* Uses the same data-pm-start/data-pm-end attribute pattern as the
|
|
20
|
+
* selection overlay in PagedEditor.
|
|
21
|
+
* @packageDocumentation
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Implementation of RenderedDomContext.
|
|
27
|
+
*
|
|
28
|
+
* This class provides position mapping between ProseMirror document
|
|
29
|
+
* positions and pixel coordinates in the rendered DOM. It uses the
|
|
30
|
+
* data-pm-start and data-pm-end attributes that LayoutPainter adds
|
|
31
|
+
* to span elements.
|
|
32
|
+
*/
|
|
33
|
+
declare class RenderedDomContextImpl implements RenderedDomContext {
|
|
34
|
+
pagesContainer: HTMLElement;
|
|
35
|
+
zoom: number;
|
|
36
|
+
constructor(pagesContainer: HTMLElement, zoom?: number);
|
|
37
|
+
/**
|
|
38
|
+
* Get pixel coordinates for a ProseMirror position.
|
|
39
|
+
* Uses the browser's text rendering via Range API for precise positioning.
|
|
40
|
+
*/
|
|
41
|
+
getCoordinatesForPosition(pmPos: number): PositionCoordinates | null;
|
|
42
|
+
/**
|
|
43
|
+
* Find DOM elements that overlap with a ProseMirror position range.
|
|
44
|
+
*/
|
|
45
|
+
findElementsForRange(from: number, to: number): Element[];
|
|
46
|
+
/**
|
|
47
|
+
* Get bounding rectangles for a range of text.
|
|
48
|
+
* Handles line wraps by returning multiple rects.
|
|
49
|
+
*/
|
|
50
|
+
getRectsForRange(from: number, to: number): Array<{
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
}>;
|
|
56
|
+
/**
|
|
57
|
+
* Get the offset of the pages container from its parent viewport.
|
|
58
|
+
* This is needed for positioning overlays that are rendered in the
|
|
59
|
+
* viewport container rather than directly in the pages container.
|
|
60
|
+
*/
|
|
61
|
+
getContainerOffset(): {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Create a RenderedDomContext for a pages container element.
|
|
68
|
+
*
|
|
69
|
+
* @param pagesContainer - The container element holding rendered pages
|
|
70
|
+
* @param zoom - Current zoom level (default 1)
|
|
71
|
+
*/
|
|
72
|
+
declare function createRenderedDomContext(pagesContainer: HTMLElement, zoom?: number): RenderedDomContext;
|
|
73
|
+
|
|
74
|
+
export { RenderedDomContextImpl, createRenderedDomContext };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RenderedDomContext Implementation
|
|
3
|
+
*
|
|
4
|
+
* Provides DOM-based position mapping for the LayoutPainter output.
|
|
5
|
+
* Uses the same data-pm-start/data-pm-end attribute pattern as the
|
|
6
|
+
* selection overlay in PagedEditor.
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
import { RenderedDomContext, PositionCoordinates } from './types.js';
|
|
11
|
+
import 'prosemirror-state';
|
|
12
|
+
import 'prosemirror-view';
|
|
13
|
+
import 'prosemirror-model';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* RenderedDomContext Implementation
|
|
17
|
+
*
|
|
18
|
+
* Provides DOM-based position mapping for the LayoutPainter output.
|
|
19
|
+
* Uses the same data-pm-start/data-pm-end attribute pattern as the
|
|
20
|
+
* selection overlay in PagedEditor.
|
|
21
|
+
* @packageDocumentation
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Implementation of RenderedDomContext.
|
|
27
|
+
*
|
|
28
|
+
* This class provides position mapping between ProseMirror document
|
|
29
|
+
* positions and pixel coordinates in the rendered DOM. It uses the
|
|
30
|
+
* data-pm-start and data-pm-end attributes that LayoutPainter adds
|
|
31
|
+
* to span elements.
|
|
32
|
+
*/
|
|
33
|
+
declare class RenderedDomContextImpl implements RenderedDomContext {
|
|
34
|
+
pagesContainer: HTMLElement;
|
|
35
|
+
zoom: number;
|
|
36
|
+
constructor(pagesContainer: HTMLElement, zoom?: number);
|
|
37
|
+
/**
|
|
38
|
+
* Get pixel coordinates for a ProseMirror position.
|
|
39
|
+
* Uses the browser's text rendering via Range API for precise positioning.
|
|
40
|
+
*/
|
|
41
|
+
getCoordinatesForPosition(pmPos: number): PositionCoordinates | null;
|
|
42
|
+
/**
|
|
43
|
+
* Find DOM elements that overlap with a ProseMirror position range.
|
|
44
|
+
*/
|
|
45
|
+
findElementsForRange(from: number, to: number): Element[];
|
|
46
|
+
/**
|
|
47
|
+
* Get bounding rectangles for a range of text.
|
|
48
|
+
* Handles line wraps by returning multiple rects.
|
|
49
|
+
*/
|
|
50
|
+
getRectsForRange(from: number, to: number): Array<{
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
}>;
|
|
56
|
+
/**
|
|
57
|
+
* Get the offset of the pages container from its parent viewport.
|
|
58
|
+
* This is needed for positioning overlays that are rendered in the
|
|
59
|
+
* viewport container rather than directly in the pages container.
|
|
60
|
+
*/
|
|
61
|
+
getContainerOffset(): {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Create a RenderedDomContext for a pages container element.
|
|
68
|
+
*
|
|
69
|
+
* @param pagesContainer - The container element holding rendered pages
|
|
70
|
+
* @param zoom - Current zoom level (default 1)
|
|
71
|
+
*/
|
|
72
|
+
declare function createRenderedDomContext(pagesContainer: HTMLElement, zoom?: number): RenderedDomContext;
|
|
73
|
+
|
|
74
|
+
export { RenderedDomContextImpl, createRenderedDomContext };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkDC7S76ZX_js=require('../chunk-DC7S76ZX.js');var E=class{constructor(t,n=1){chunkDC7S76ZX_js.a(this,"pagesContainer");chunkDC7S76ZX_js.a(this,"zoom");this.pagesContainer=t,this.zoom=n;}getCoordinatesForPosition(t){let n=this.pagesContainer.getBoundingClientRect(),s=this.pagesContainer.querySelectorAll("span[data-pm-start][data-pm-end]");for(let a of Array.from(s)){let e=a,o=Number(e.dataset.pmStart),m=Number(e.dataset.pmEnd);if(e.classList.contains("layout-run-tab")){if(t>=o&&t<m){let c=e.getBoundingClientRect(),r=e.closest(".layout-line"),l=r?r.offsetHeight:16;return {x:(c.left-n.left)/this.zoom,y:(c.top-n.top)/this.zoom,height:l/this.zoom}}continue}if(t>=o&&t<=m&&a.firstChild?.nodeType===Node.TEXT_NODE){let c=a.firstChild,r=Math.min(t-o,c.length),l=e.ownerDocument;if(!l)continue;let h=l.createRange();h.setStart(c,r),h.setEnd(c,r);let p=h.getBoundingClientRect(),i=e.closest(".layout-line"),g=i?i.offsetHeight:16;return {x:(p.left-n.left)/this.zoom,y:(p.top-n.top)/this.zoom,height:g/this.zoom}}}let u=this.pagesContainer.querySelectorAll(".layout-empty-run");for(let a of Array.from(u)){let e=a.closest(".layout-paragraph");if(!e)continue;let o=Number(e.dataset.pmStart),m=Number(e.dataset.pmEnd);if(t>=o&&t<=m){let c=a.getBoundingClientRect(),r=a.closest(".layout-line"),l=r?r.offsetHeight:16;return {x:(c.left-n.left)/this.zoom,y:(c.top-n.top)/this.zoom,height:l/this.zoom}}}return null}findElementsForRange(t,n){let s=[],u=this.pagesContainer.querySelectorAll("span[data-pm-start][data-pm-end]");for(let a of Array.from(u)){let e=a,o=Number(e.dataset.pmStart);Number(e.dataset.pmEnd)>t&&o<n&&s.push(e);}return s}getRectsForRange(t,n){let s=this.pagesContainer.getBoundingClientRect(),u=[],a=this.pagesContainer.querySelectorAll("span[data-pm-start][data-pm-end]");for(let e of Array.from(a)){let o=e,m=Number(o.dataset.pmStart);if(Number(o.dataset.pmEnd)>t&&m<n){if(o.classList.contains("layout-run-tab")){let i=o.getBoundingClientRect();u.push({x:(i.left-s.left)/this.zoom,y:(i.top-s.top)/this.zoom,width:i.width/this.zoom,height:i.height/this.zoom});continue}if(e.firstChild?.nodeType!==Node.TEXT_NODE)continue;let r=e.firstChild,l=o.ownerDocument;if(!l)continue;let h=Math.max(0,t-m),p=Math.min(r.length,n-m);if(h<p){let i=l.createRange();i.setStart(r,h),i.setEnd(r,p);let g=i.getClientRects();for(let d of Array.from(g))u.push({x:(d.left-s.left)/this.zoom,y:(d.top-s.top)/this.zoom,width:d.width/this.zoom,height:d.height/this.zoom});}}}return u}getContainerOffset(){let t=this.pagesContainer.parentElement;if(!t)return {x:0,y:0};let n=this.pagesContainer.getBoundingClientRect(),s=t.getBoundingClientRect();return {x:(n.left-s.left)/this.zoom,y:(n.top-s.top)/this.zoom}}};function C(y,t=1){return new E(y,t)}exports.RenderedDomContextImpl=E;exports.createRenderedDomContext=C;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'../chunk-QYUPLKLP.mjs';var E=class{constructor(t,n=1){a(this,"pagesContainer");a(this,"zoom");this.pagesContainer=t,this.zoom=n;}getCoordinatesForPosition(t){let n=this.pagesContainer.getBoundingClientRect(),s=this.pagesContainer.querySelectorAll("span[data-pm-start][data-pm-end]");for(let a of Array.from(s)){let e=a,o=Number(e.dataset.pmStart),m=Number(e.dataset.pmEnd);if(e.classList.contains("layout-run-tab")){if(t>=o&&t<m){let c=e.getBoundingClientRect(),r=e.closest(".layout-line"),l=r?r.offsetHeight:16;return {x:(c.left-n.left)/this.zoom,y:(c.top-n.top)/this.zoom,height:l/this.zoom}}continue}if(t>=o&&t<=m&&a.firstChild?.nodeType===Node.TEXT_NODE){let c=a.firstChild,r=Math.min(t-o,c.length),l=e.ownerDocument;if(!l)continue;let h=l.createRange();h.setStart(c,r),h.setEnd(c,r);let p=h.getBoundingClientRect(),i=e.closest(".layout-line"),g=i?i.offsetHeight:16;return {x:(p.left-n.left)/this.zoom,y:(p.top-n.top)/this.zoom,height:g/this.zoom}}}let u=this.pagesContainer.querySelectorAll(".layout-empty-run");for(let a of Array.from(u)){let e=a.closest(".layout-paragraph");if(!e)continue;let o=Number(e.dataset.pmStart),m=Number(e.dataset.pmEnd);if(t>=o&&t<=m){let c=a.getBoundingClientRect(),r=a.closest(".layout-line"),l=r?r.offsetHeight:16;return {x:(c.left-n.left)/this.zoom,y:(c.top-n.top)/this.zoom,height:l/this.zoom}}}return null}findElementsForRange(t,n){let s=[],u=this.pagesContainer.querySelectorAll("span[data-pm-start][data-pm-end]");for(let a of Array.from(u)){let e=a,o=Number(e.dataset.pmStart);Number(e.dataset.pmEnd)>t&&o<n&&s.push(e);}return s}getRectsForRange(t,n){let s=this.pagesContainer.getBoundingClientRect(),u=[],a=this.pagesContainer.querySelectorAll("span[data-pm-start][data-pm-end]");for(let e of Array.from(a)){let o=e,m=Number(o.dataset.pmStart);if(Number(o.dataset.pmEnd)>t&&m<n){if(o.classList.contains("layout-run-tab")){let i=o.getBoundingClientRect();u.push({x:(i.left-s.left)/this.zoom,y:(i.top-s.top)/this.zoom,width:i.width/this.zoom,height:i.height/this.zoom});continue}if(e.firstChild?.nodeType!==Node.TEXT_NODE)continue;let r=e.firstChild,l=o.ownerDocument;if(!l)continue;let h=Math.max(0,t-m),p=Math.min(r.length,n-m);if(h<p){let i=l.createRange();i.setStart(r,h),i.setEnd(r,p);let g=i.getClientRects();for(let d of Array.from(g))u.push({x:(d.left-s.left)/this.zoom,y:(d.top-s.top)/this.zoom,width:d.width/this.zoom,height:d.height/this.zoom});}}}return u}getContainerOffset(){let t=this.pagesContainer.parentElement;if(!t)return {x:0,y:0};let n=this.pagesContainer.getBoundingClientRect(),s=t.getBoundingClientRect();return {x:(n.left-s.left)/this.zoom,y:(n.top-s.top)/this.zoom}}};function C(y,t=1){return new E(y,t)}export{E as RenderedDomContextImpl,C as createRenderedDomContext};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Plugin API — Framework-Agnostic
|
|
3
|
+
*
|
|
4
|
+
* Exports the core plugin interfaces and types that can be used
|
|
5
|
+
* by any framework adapter (React, Vue, etc.).
|
|
6
|
+
*
|
|
7
|
+
* @experimental Plugin API is still evolving. Breaking changes may
|
|
8
|
+
* happen in minor releases until plugin authors stabilize the contract.
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export { EditorPluginCore, PanelConfig, PluginPanelProps, PositionCoordinates, RenderedDomContext, SidebarItem, SidebarItemContext } from './types.mjs';
|
|
13
|
+
import 'prosemirror-state';
|
|
14
|
+
import 'prosemirror-view';
|
|
15
|
+
import 'prosemirror-model';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Plugin API — Framework-Agnostic
|
|
3
|
+
*
|
|
4
|
+
* Exports the core plugin interfaces and types that can be used
|
|
5
|
+
* by any framework adapter (React, Vue, etc.).
|
|
6
|
+
*
|
|
7
|
+
* @experimental Plugin API is still evolving. Breaking changes may
|
|
8
|
+
* happen in minor releases until plugin authors stabilize the contract.
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export { EditorPluginCore, PanelConfig, PluginPanelProps, PositionCoordinates, RenderedDomContext, SidebarItem, SidebarItemContext } from './types.js';
|
|
13
|
+
import 'prosemirror-state';
|
|
14
|
+
import 'prosemirror-view';
|
|
15
|
+
import 'prosemirror-model';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';
|
|
File without changes
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure layout algorithm: given a list of sidebar items + their
|
|
3
|
+
* anchor sources, return a list of resolved Y positions with
|
|
4
|
+
* collision avoidance applied. Lifted from React's
|
|
5
|
+
* components/sidebar/resolveItemPositions.ts so the Vue adapter
|
|
6
|
+
* can call it directly.
|
|
7
|
+
*
|
|
8
|
+
* The algorithm walks the items in three priority stages:
|
|
9
|
+
* 1. explicit fixedY (already in scroll-container coords)
|
|
10
|
+
* 2. anchorKey lookup in anchorPositions (layout-engine coords)
|
|
11
|
+
* 3. DOM-based anchor lookup via renderedDomContext.getRectsForRange
|
|
12
|
+
* 4. last-known cache so cards don't pop out during transient layout
|
|
13
|
+
*
|
|
14
|
+
* Then it sorts by target Y and pushes overlapping cards down by
|
|
15
|
+
* their height + MIN_CARD_GAP.
|
|
16
|
+
* @packageDocumentation
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
import { SidebarItem, RenderedDomContext } from './types.mjs';
|
|
20
|
+
import 'prosemirror-state';
|
|
21
|
+
import 'prosemirror-view';
|
|
22
|
+
import 'prosemirror-model';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Pure layout algorithm: given a list of sidebar items + their
|
|
26
|
+
* anchor sources, return a list of resolved Y positions with
|
|
27
|
+
* collision avoidance applied. Lifted from React's
|
|
28
|
+
* components/sidebar/resolveItemPositions.ts so the Vue adapter
|
|
29
|
+
* can call it directly.
|
|
30
|
+
*
|
|
31
|
+
* The algorithm walks the items in three priority stages:
|
|
32
|
+
* 1. explicit fixedY (already in scroll-container coords)
|
|
33
|
+
* 2. anchorKey lookup in anchorPositions (layout-engine coords)
|
|
34
|
+
* 3. DOM-based anchor lookup via renderedDomContext.getRectsForRange
|
|
35
|
+
* 4. last-known cache so cards don't pop out during transient layout
|
|
36
|
+
*
|
|
37
|
+
* Then it sorts by target Y and pushes overlapping cards down by
|
|
38
|
+
* their height + MIN_CARD_GAP.
|
|
39
|
+
* @packageDocumentation
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
/** Generic sidebar item with optional fixedY / estimatedHeight. */
|
|
44
|
+
interface ResolvableSidebarItem extends SidebarItem {
|
|
45
|
+
fixedY?: number;
|
|
46
|
+
estimatedHeight?: number;
|
|
47
|
+
}
|
|
48
|
+
interface ResolvedPosition<T extends ResolvableSidebarItem = ResolvableSidebarItem> {
|
|
49
|
+
item: T;
|
|
50
|
+
y: number;
|
|
51
|
+
}
|
|
52
|
+
declare function resolveItemPositions<T extends ResolvableSidebarItem>(items: T[], anchorPositions: Map<string, number>, renderedDomContext: RenderedDomContext | null, zoom: number, cardHeights: Map<string, number>, lastKnown: Map<string, number>): ResolvedPosition<T>[];
|
|
53
|
+
|
|
54
|
+
export { type ResolvableSidebarItem, type ResolvedPosition, resolveItemPositions };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure layout algorithm: given a list of sidebar items + their
|
|
3
|
+
* anchor sources, return a list of resolved Y positions with
|
|
4
|
+
* collision avoidance applied. Lifted from React's
|
|
5
|
+
* components/sidebar/resolveItemPositions.ts so the Vue adapter
|
|
6
|
+
* can call it directly.
|
|
7
|
+
*
|
|
8
|
+
* The algorithm walks the items in three priority stages:
|
|
9
|
+
* 1. explicit fixedY (already in scroll-container coords)
|
|
10
|
+
* 2. anchorKey lookup in anchorPositions (layout-engine coords)
|
|
11
|
+
* 3. DOM-based anchor lookup via renderedDomContext.getRectsForRange
|
|
12
|
+
* 4. last-known cache so cards don't pop out during transient layout
|
|
13
|
+
*
|
|
14
|
+
* Then it sorts by target Y and pushes overlapping cards down by
|
|
15
|
+
* their height + MIN_CARD_GAP.
|
|
16
|
+
* @packageDocumentation
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
import { SidebarItem, RenderedDomContext } from './types.js';
|
|
20
|
+
import 'prosemirror-state';
|
|
21
|
+
import 'prosemirror-view';
|
|
22
|
+
import 'prosemirror-model';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Pure layout algorithm: given a list of sidebar items + their
|
|
26
|
+
* anchor sources, return a list of resolved Y positions with
|
|
27
|
+
* collision avoidance applied. Lifted from React's
|
|
28
|
+
* components/sidebar/resolveItemPositions.ts so the Vue adapter
|
|
29
|
+
* can call it directly.
|
|
30
|
+
*
|
|
31
|
+
* The algorithm walks the items in three priority stages:
|
|
32
|
+
* 1. explicit fixedY (already in scroll-container coords)
|
|
33
|
+
* 2. anchorKey lookup in anchorPositions (layout-engine coords)
|
|
34
|
+
* 3. DOM-based anchor lookup via renderedDomContext.getRectsForRange
|
|
35
|
+
* 4. last-known cache so cards don't pop out during transient layout
|
|
36
|
+
*
|
|
37
|
+
* Then it sorts by target Y and pushes overlapping cards down by
|
|
38
|
+
* their height + MIN_CARD_GAP.
|
|
39
|
+
* @packageDocumentation
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
/** Generic sidebar item with optional fixedY / estimatedHeight. */
|
|
44
|
+
interface ResolvableSidebarItem extends SidebarItem {
|
|
45
|
+
fixedY?: number;
|
|
46
|
+
estimatedHeight?: number;
|
|
47
|
+
}
|
|
48
|
+
interface ResolvedPosition<T extends ResolvableSidebarItem = ResolvableSidebarItem> {
|
|
49
|
+
item: T;
|
|
50
|
+
y: number;
|
|
51
|
+
}
|
|
52
|
+
declare function resolveItemPositions<T extends ResolvableSidebarItem>(items: T[], anchorPositions: Map<string, number>, renderedDomContext: RenderedDomContext | null, zoom: number, cardHeights: Map<string, number>, lastKnown: Map<string, number>): ResolvedPosition<T>[];
|
|
53
|
+
|
|
54
|
+
export { type ResolvableSidebarItem, type ResolvedPosition, resolveItemPositions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('../chunk-AAPBAMD7.js'),require('../chunk-DC7S76ZX.js');function g(s,u,n,r,d,l){if(s.length===0)return [];let a=n?.getContainerOffset(),o=[];for(let e of s){let t;if(e.fixedY!=null&&(t=e.fixedY*r),t==null&&e.anchorKey){let i=u.get(e.anchorKey);i!=null&&(t=i*r);}if(t==null&&n){let i=n.getRectsForRange(e.anchorPos,e.anchorPos+1);i.length>0&&a&&(t=(i[0].y+a.y)*r);}if(t==null){let i=l.get(e.id);i!=null&&(t=i);}t!=null&&(o.push({item:e,targetY:t}),l.set(e.id,t));}o.sort((e,t)=>{let i=e.targetY-t.targetY;return i!==0?i:(e.item.priority??0)-(t.item.priority??0)});let m=[],f=0;for(let e of o){let t=d.get(e.item.id)??e.item.estimatedHeight??80,i=Math.max(e.targetY,f+8);m.push({item:e.item,y:i}),f=i+t;}return m}exports.resolveItemPositions=g;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import'../chunk-PRRM64JO.mjs';import'../chunk-QYUPLKLP.mjs';function g(s,u,n,r,d,l){if(s.length===0)return [];let a=n?.getContainerOffset(),o=[];for(let e of s){let t;if(e.fixedY!=null&&(t=e.fixedY*r),t==null&&e.anchorKey){let i=u.get(e.anchorKey);i!=null&&(t=i*r);}if(t==null&&n){let i=n.getRectsForRange(e.anchorPos,e.anchorPos+1);i.length>0&&a&&(t=(i[0].y+a.y)*r);}if(t==null){let i=l.get(e.id);i!=null&&(t=i);}t!=null&&(o.push({item:e,targetY:t}),l.set(e.id,t));}o.sort((e,t)=>{let i=e.targetY-t.targetY;return i!==0?i:(e.item.priority??0)-(t.item.priority??0)});let m=[],f=0;for(let e of o){let t=d.get(e.item.id)??e.item.estimatedHeight??80,i=Math.max(e.targetY,f+8);m.push({item:e.item,y:i}),f=i+t;}return m}export{g as resolveItemPositions};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework-Agnostic Plugin Interface for the DOCX Editor
|
|
3
|
+
*
|
|
4
|
+
* Core plugin types that can be used by any framework (React, Vue, etc.).
|
|
5
|
+
* Framework-specific adapters extend EditorPluginCore with their own
|
|
6
|
+
* UI rendering capabilities (e.g., ReactEditorPlugin, VueEditorPlugin).
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
import { Plugin } from 'prosemirror-state';
|
|
11
|
+
import { EditorView } from 'prosemirror-view';
|
|
12
|
+
import { Node } from 'prosemirror-model';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Framework-Agnostic Plugin Interface for the DOCX Editor
|
|
16
|
+
*
|
|
17
|
+
* Core plugin types that can be used by any framework (React, Vue, etc.).
|
|
18
|
+
* Framework-specific adapters extend EditorPluginCore with their own
|
|
19
|
+
* UI rendering capabilities (e.g., ReactEditorPlugin, VueEditorPlugin).
|
|
20
|
+
* @packageDocumentation
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Coordinates returned by position lookup in the rendered DOM.
|
|
26
|
+
*/
|
|
27
|
+
interface PositionCoordinates {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
height: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Context for accessing the rendered DOM in the paged editor.
|
|
34
|
+
*
|
|
35
|
+
* Provides DOM-based position mapping that works with the LayoutPainter
|
|
36
|
+
* output (visible pages). Use this for rendering overlays, annotations,
|
|
37
|
+
* and other visual elements positioned relative to rendered content.
|
|
38
|
+
*
|
|
39
|
+
* The rendered DOM uses data-pm-start/data-pm-end attributes on spans
|
|
40
|
+
* to map between ProseMirror positions and DOM elements.
|
|
41
|
+
*/
|
|
42
|
+
interface RenderedDomContext {
|
|
43
|
+
/** The container element holding all rendered pages. */
|
|
44
|
+
pagesContainer: HTMLElement;
|
|
45
|
+
/**
|
|
46
|
+
* Get pixel coordinates for a ProseMirror position in the rendered DOM.
|
|
47
|
+
* Returns null if the position cannot be found.
|
|
48
|
+
*/
|
|
49
|
+
getCoordinatesForPosition(pmPos: number): PositionCoordinates | null;
|
|
50
|
+
/**
|
|
51
|
+
* Find DOM elements that overlap with a ProseMirror position range.
|
|
52
|
+
*/
|
|
53
|
+
findElementsForRange(from: number, to: number): Element[];
|
|
54
|
+
/**
|
|
55
|
+
* Get bounding rectangles for a range of text, accounting for line wraps.
|
|
56
|
+
* Returns rects relative to the pages container.
|
|
57
|
+
*/
|
|
58
|
+
getRectsForRange(from: number, to: number): Array<{
|
|
59
|
+
x: number;
|
|
60
|
+
y: number;
|
|
61
|
+
width: number;
|
|
62
|
+
height: number;
|
|
63
|
+
}>;
|
|
64
|
+
/** Current zoom level (1 = 100%). */
|
|
65
|
+
zoom: number;
|
|
66
|
+
/**
|
|
67
|
+
* Offset of the pages container from its parent viewport.
|
|
68
|
+
*/
|
|
69
|
+
getContainerOffset(): {
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Props passed to plugin panel components (framework-agnostic base).
|
|
76
|
+
*/
|
|
77
|
+
interface PluginPanelProps<TState = unknown> {
|
|
78
|
+
/** Current ProseMirror editor view */
|
|
79
|
+
editorView: EditorView | null;
|
|
80
|
+
/** Current ProseMirror document */
|
|
81
|
+
doc: Node | null;
|
|
82
|
+
/** Scroll editor to a specific position */
|
|
83
|
+
scrollToPosition: (pos: number) => void;
|
|
84
|
+
/** Select a range in the editor */
|
|
85
|
+
selectRange: (from: number, to: number) => void;
|
|
86
|
+
/** Plugin-specific state (managed by the plugin) */
|
|
87
|
+
pluginState: TState;
|
|
88
|
+
/** Width of the panel in pixels */
|
|
89
|
+
panelWidth: number;
|
|
90
|
+
/**
|
|
91
|
+
* Context for the rendered DOM (LayoutPainter output).
|
|
92
|
+
* May be null if layout hasn't completed yet.
|
|
93
|
+
*/
|
|
94
|
+
renderedDomContext: RenderedDomContext | null;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Configuration for plugin panel rendering.
|
|
98
|
+
*/
|
|
99
|
+
interface PanelConfig {
|
|
100
|
+
/** Where to render the panel */
|
|
101
|
+
position: 'left' | 'right' | 'bottom';
|
|
102
|
+
/** Default width/height of the panel */
|
|
103
|
+
defaultSize: number;
|
|
104
|
+
/** Minimum size */
|
|
105
|
+
minSize?: number;
|
|
106
|
+
/** Maximum size */
|
|
107
|
+
maxSize?: number;
|
|
108
|
+
/** Whether the panel is resizable */
|
|
109
|
+
resizable?: boolean;
|
|
110
|
+
/** Whether the panel can be collapsed */
|
|
111
|
+
collapsible?: boolean;
|
|
112
|
+
/** Initial collapsed state */
|
|
113
|
+
defaultCollapsed?: boolean;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Framework-agnostic core plugin interface.
|
|
117
|
+
*
|
|
118
|
+
* Contains all non-UI plugin capabilities:
|
|
119
|
+
* - ProseMirror plugins (decorations, keymaps, etc.)
|
|
120
|
+
* - State management (initialize, onStateChange, destroy)
|
|
121
|
+
* - CSS injection
|
|
122
|
+
* - Panel configuration
|
|
123
|
+
*
|
|
124
|
+
* Framework adapters (ReactEditorPlugin, VueEditorPlugin) extend this
|
|
125
|
+
* with their own Panel component type and renderOverlay function.
|
|
126
|
+
*/
|
|
127
|
+
interface EditorPluginCore<TState = any> {
|
|
128
|
+
/** Unique plugin identifier */
|
|
129
|
+
id: string;
|
|
130
|
+
/** Display name for the plugin */
|
|
131
|
+
name: string;
|
|
132
|
+
/**
|
|
133
|
+
* ProseMirror plugins to register with the editor.
|
|
134
|
+
* These are merged with the editor's internal plugins.
|
|
135
|
+
*/
|
|
136
|
+
proseMirrorPlugins?: Plugin[];
|
|
137
|
+
/**
|
|
138
|
+
* Configuration for the panel (position, size, etc.)
|
|
139
|
+
*/
|
|
140
|
+
panelConfig?: PanelConfig;
|
|
141
|
+
/**
|
|
142
|
+
* Called when the editor state changes.
|
|
143
|
+
* Use this to update plugin-specific state based on document changes.
|
|
144
|
+
*/
|
|
145
|
+
onStateChange?: (view: EditorView) => TState | undefined;
|
|
146
|
+
/**
|
|
147
|
+
* Initialize plugin state when the plugin is first loaded.
|
|
148
|
+
*/
|
|
149
|
+
initialize?: (view: EditorView | null) => TState;
|
|
150
|
+
/**
|
|
151
|
+
* Called when the plugin is being destroyed.
|
|
152
|
+
* Use this for cleanup (subscriptions, timers, etc.)
|
|
153
|
+
*/
|
|
154
|
+
destroy?: () => void;
|
|
155
|
+
/**
|
|
156
|
+
* CSS styles to inject for this plugin.
|
|
157
|
+
* Can be a string of CSS or a URL to a stylesheet.
|
|
158
|
+
*/
|
|
159
|
+
styles?: string;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* A sidebar item anchored to a document position.
|
|
163
|
+
* Framework adapters extend this with rendering capabilities.
|
|
164
|
+
*/
|
|
165
|
+
interface SidebarItem {
|
|
166
|
+
/** Unique ID for this item (used as React key and for overlap resolution). */
|
|
167
|
+
id: string;
|
|
168
|
+
/** ProseMirror document position this item anchors to. */
|
|
169
|
+
anchorPos: number;
|
|
170
|
+
/** Optional key into the anchorPositions Map (e.g. "comment-42", "revision-7"). */
|
|
171
|
+
anchorKey?: string;
|
|
172
|
+
/** Sort priority within items at the same anchor Y. Lower = first. Default: 0. */
|
|
173
|
+
priority?: number;
|
|
174
|
+
/** Temporary items (e.g. "add comment" input) skip entrance animation. */
|
|
175
|
+
isTemporary?: boolean;
|
|
176
|
+
/** Pre-computed Y position (scroll-container coords, pre-zoom). Overrides anchor resolution. */
|
|
177
|
+
fixedY?: number;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Context provided to plugins when computing sidebar items.
|
|
181
|
+
*/
|
|
182
|
+
interface SidebarItemContext {
|
|
183
|
+
editorView: EditorView | null;
|
|
184
|
+
renderedDomContext: RenderedDomContext | null;
|
|
185
|
+
/** Pre-computed Y positions from layout engine (keys like "comment-{id}"). */
|
|
186
|
+
anchorPositions: Map<string, number>;
|
|
187
|
+
zoom: number;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export type { EditorPluginCore, PanelConfig, PluginPanelProps, PositionCoordinates, RenderedDomContext, SidebarItem, SidebarItemContext };
|