@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,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template ProseMirror Plugin
|
|
3
|
+
*
|
|
4
|
+
* Simple plugin that finds template tags using regex and creates decorations.
|
|
5
|
+
* No separate parsing layer - everything happens here.
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
import * as prosemirror_state from 'prosemirror-state';
|
|
10
|
+
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
11
|
+
import { DecorationSet, EditorView } from 'prosemirror-view';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Template tag types
|
|
15
|
+
*/
|
|
16
|
+
type TagType = 'variable' | 'sectionStart' | 'sectionEnd' | 'invertedStart' | 'raw';
|
|
17
|
+
/**
|
|
18
|
+
* A found template tag
|
|
19
|
+
*/
|
|
20
|
+
interface TemplateTag {
|
|
21
|
+
id: string;
|
|
22
|
+
type: TagType;
|
|
23
|
+
name: string;
|
|
24
|
+
rawTag: string;
|
|
25
|
+
from: number;
|
|
26
|
+
to: number;
|
|
27
|
+
/** For sections: nested variable names */
|
|
28
|
+
nestedVars?: string[];
|
|
29
|
+
/** True if this variable is inside a section (shown in section's nested vars) */
|
|
30
|
+
insideSection?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Plugin state
|
|
34
|
+
*/
|
|
35
|
+
interface TemplatePluginState {
|
|
36
|
+
tags: TemplateTag[];
|
|
37
|
+
decorations: DecorationSet;
|
|
38
|
+
hoveredId?: string;
|
|
39
|
+
selectedId?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Plugin key
|
|
43
|
+
*/
|
|
44
|
+
declare const templatePluginKey: PluginKey<TemplatePluginState>;
|
|
45
|
+
/**
|
|
46
|
+
* Create the template plugin
|
|
47
|
+
*/
|
|
48
|
+
declare function createTemplatePlugin(): Plugin<TemplatePluginState>;
|
|
49
|
+
/**
|
|
50
|
+
* Get tags from editor state
|
|
51
|
+
*/
|
|
52
|
+
declare function getTemplateTags(state: prosemirror_state.EditorState): TemplateTag[];
|
|
53
|
+
/**
|
|
54
|
+
* Set hovered tag
|
|
55
|
+
*/
|
|
56
|
+
declare function setHoveredElement(view: EditorView, id: string | undefined): void;
|
|
57
|
+
/**
|
|
58
|
+
* Set selected tag
|
|
59
|
+
*/
|
|
60
|
+
declare function setSelectedElement(view: EditorView, id: string | undefined): void;
|
|
61
|
+
/**
|
|
62
|
+
* CSS styles for template decorations
|
|
63
|
+
*/
|
|
64
|
+
declare const TEMPLATE_DECORATION_STYLES = "\n.docx-template-tag {\n cursor: pointer;\n transition: background-color 0.1s;\n}\n\n.docx-template-tag:hover,\n.docx-template-tag.hovered {\n filter: brightness(0.95);\n}\n\n.docx-template-tag.selected {\n box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);\n}\n";
|
|
65
|
+
|
|
66
|
+
export { TEMPLATE_DECORATION_STYLES, type TagType, type TemplateTag, createTemplatePlugin, getTemplateTags, setHoveredElement, setSelectedElement, templatePluginKey };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template ProseMirror Plugin
|
|
3
|
+
*
|
|
4
|
+
* Simple plugin that finds template tags using regex and creates decorations.
|
|
5
|
+
* No separate parsing layer - everything happens here.
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
import * as prosemirror_state from 'prosemirror-state';
|
|
10
|
+
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
11
|
+
import { DecorationSet, EditorView } from 'prosemirror-view';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Template tag types
|
|
15
|
+
*/
|
|
16
|
+
type TagType = 'variable' | 'sectionStart' | 'sectionEnd' | 'invertedStart' | 'raw';
|
|
17
|
+
/**
|
|
18
|
+
* A found template tag
|
|
19
|
+
*/
|
|
20
|
+
interface TemplateTag {
|
|
21
|
+
id: string;
|
|
22
|
+
type: TagType;
|
|
23
|
+
name: string;
|
|
24
|
+
rawTag: string;
|
|
25
|
+
from: number;
|
|
26
|
+
to: number;
|
|
27
|
+
/** For sections: nested variable names */
|
|
28
|
+
nestedVars?: string[];
|
|
29
|
+
/** True if this variable is inside a section (shown in section's nested vars) */
|
|
30
|
+
insideSection?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Plugin state
|
|
34
|
+
*/
|
|
35
|
+
interface TemplatePluginState {
|
|
36
|
+
tags: TemplateTag[];
|
|
37
|
+
decorations: DecorationSet;
|
|
38
|
+
hoveredId?: string;
|
|
39
|
+
selectedId?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Plugin key
|
|
43
|
+
*/
|
|
44
|
+
declare const templatePluginKey: PluginKey<TemplatePluginState>;
|
|
45
|
+
/**
|
|
46
|
+
* Create the template plugin
|
|
47
|
+
*/
|
|
48
|
+
declare function createTemplatePlugin(): Plugin<TemplatePluginState>;
|
|
49
|
+
/**
|
|
50
|
+
* Get tags from editor state
|
|
51
|
+
*/
|
|
52
|
+
declare function getTemplateTags(state: prosemirror_state.EditorState): TemplateTag[];
|
|
53
|
+
/**
|
|
54
|
+
* Set hovered tag
|
|
55
|
+
*/
|
|
56
|
+
declare function setHoveredElement(view: EditorView, id: string | undefined): void;
|
|
57
|
+
/**
|
|
58
|
+
* Set selected tag
|
|
59
|
+
*/
|
|
60
|
+
declare function setSelectedElement(view: EditorView, id: string | undefined): void;
|
|
61
|
+
/**
|
|
62
|
+
* CSS styles for template decorations
|
|
63
|
+
*/
|
|
64
|
+
declare const TEMPLATE_DECORATION_STYLES = "\n.docx-template-tag {\n cursor: pointer;\n transition: background-color 0.1s;\n}\n\n.docx-template-tag:hover,\n.docx-template-tag.hovered {\n filter: brightness(0.95);\n}\n\n.docx-template-tag.selected {\n box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);\n}\n";
|
|
65
|
+
|
|
66
|
+
export { TEMPLATE_DECORATION_STYLES, type TagType, type TemplateTag, createTemplatePlugin, getTemplateTags, setHoveredElement, setSelectedElement, templatePluginKey };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';require('../../chunk-DC7S76ZX.js');var prosemirrorState=require('prosemirror-state'),prosemirrorView=require('prosemirror-view');var S=/\{([#/^@]?)([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}/g,a=new prosemirrorState.PluginKey("template");function v(e,t,n){return `${e}:${t}:${n}`}function x(e){let t=[];e.descendants((d,s)=>(d.isText&&d.text&&t.push({text:d.text,pos:s}),true));let n="",o=[];for(let d of t){for(let s=0;s<d.text.length;s++)o.push(d.pos+s);n+=d.text;}let i=[],r=[],l=new Map,g;for(S.lastIndex=0;(g=S.exec(n))!==null;){let[d,s,p]=g,I=o[g.index],b=o[g.index+d.length-1]+1,c;s==="#"?c="sectionStart":s==="/"?c="sectionEnd":s==="^"?c="invertedStart":s==="@"?c="raw":c="variable";let T=`${c}:${p}`,h=l.get(T)??0;l.set(T,h+1);let f={id:v(c,p,h),type:c,name:p,rawTag:d,from:I,to:b};if(c==="sectionStart"||c==="invertedStart")f.nestedVars=[],r.push(f);else if(c==="sectionEnd"){for(let u=r.length-1;u>=0;u--)if(r[u].name===p){r.splice(u,1);break}}else c==="variable"&&r.length>0&&(r[r.length-1].nestedVars?.push(p),f.insideSection=true);i.push(f);}return i}function A(e){switch(e){case "sectionStart":case "sectionEnd":return "#3b82f6";case "invertedStart":return "#8b5cf6";case "raw":return "#ef4444";default:return "#f59e0b"}}function m(e,t,n,o){let i=[];for(let r of t){let l=r.id===n,g=r.id===o,d=A(r.type),s=["docx-template-tag"];l&&s.push("hovered"),g&&s.push("selected"),i.push(prosemirrorView.Decoration.inline(r.from,r.to,{class:s.join(" "),"data-tag-id":r.id,style:`background-color: ${d}22; border-radius: 2px;`},{noOverlay:true}));}return prosemirrorView.DecorationSet.create(e,i)}function V(e,t){if(e.length!==t.length)return false;for(let n=0;n<e.length;n++)if(e[n].id!==t[n].id)return false;return true}function w(){return new prosemirrorState.Plugin({key:a,state:{init(e,t){let n=x(t.doc);return {tags:n,decorations:m(t.doc,n)}},apply(e,t,n,o){if(e.docChanged){let r=x(o.doc),l=V(t.tags,r);return {tags:r,decorations:l?t.decorations.map(e.mapping,e.doc):m(o.doc,r,t.hoveredId,t.selectedId),hoveredId:t.hoveredId,selectedId:t.selectedId}}let i=e.getMeta(a);if(i){let r=i.hoveredId??t.hoveredId,l=i.selectedId??t.selectedId;return {...t,hoveredId:r,selectedId:l,decorations:m(o.doc,t.tags,r,l)}}return {...t,decorations:t.decorations.map(e.mapping,e.doc)}}},props:{decorations(e){return a.getState(e)?.decorations??prosemirrorView.DecorationSet.empty},handleClick(e,t){let o=(a.getState(e.state)?.tags??[]).find(r=>t>=r.from&&t<=r.to);return o?(e.dispatch(e.state.tr.setMeta(a,{selectedId:o.id})),true):(a.getState(e.state)?.selectedId&&e.dispatch(e.state.tr.setMeta(a,{selectedId:void 0})),false)},handleDOMEvents:{mouseover(e,t){let o=t.target.closest?.("[data-tag-id]")?.getAttribute("data-tag-id")||void 0,i=a.getState(e.state)?.hoveredId;return o!==i&&e.dispatch(e.state.tr.setMeta(a,{hoveredId:o})),false},mouseout(e,t){return t.relatedTarget?.closest?.("[data-tag-id]")||a.getState(e.state)?.hoveredId&&e.dispatch(e.state.tr.setMeta(a,{hoveredId:void 0})),false}}}})}function D(e){return a.getState(e)?.tags??[]}function $(e,t){e.dispatch(e.state.tr.setMeta(a,{hoveredId:t}));}function H(e,t){e.dispatch(e.state.tr.setMeta(a,{selectedId:t}));}var N=`
|
|
2
|
+
.docx-template-tag {
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
transition: background-color 0.1s;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.docx-template-tag:hover,
|
|
8
|
+
.docx-template-tag.hovered {
|
|
9
|
+
filter: brightness(0.95);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.docx-template-tag.selected {
|
|
13
|
+
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
|
|
14
|
+
}
|
|
15
|
+
`;exports.TEMPLATE_DECORATION_STYLES=N;exports.createTemplatePlugin=w;exports.getTemplateTags=D;exports.setHoveredElement=$;exports.setSelectedElement=H;exports.templatePluginKey=a;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import'../../chunk-QYUPLKLP.mjs';import {PluginKey,Plugin}from'prosemirror-state';import {DecorationSet,Decoration}from'prosemirror-view';var S=/\{([#/^@]?)([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}/g,a=new PluginKey("template");function v(e,t,n){return `${e}:${t}:${n}`}function x(e){let t=[];e.descendants((d,s)=>(d.isText&&d.text&&t.push({text:d.text,pos:s}),true));let n="",o=[];for(let d of t){for(let s=0;s<d.text.length;s++)o.push(d.pos+s);n+=d.text;}let i=[],r=[],l=new Map,g;for(S.lastIndex=0;(g=S.exec(n))!==null;){let[d,s,p]=g,I=o[g.index],b=o[g.index+d.length-1]+1,c;s==="#"?c="sectionStart":s==="/"?c="sectionEnd":s==="^"?c="invertedStart":s==="@"?c="raw":c="variable";let T=`${c}:${p}`,h=l.get(T)??0;l.set(T,h+1);let f={id:v(c,p,h),type:c,name:p,rawTag:d,from:I,to:b};if(c==="sectionStart"||c==="invertedStart")f.nestedVars=[],r.push(f);else if(c==="sectionEnd"){for(let u=r.length-1;u>=0;u--)if(r[u].name===p){r.splice(u,1);break}}else c==="variable"&&r.length>0&&(r[r.length-1].nestedVars?.push(p),f.insideSection=true);i.push(f);}return i}function A(e){switch(e){case "sectionStart":case "sectionEnd":return "#3b82f6";case "invertedStart":return "#8b5cf6";case "raw":return "#ef4444";default:return "#f59e0b"}}function m(e,t,n,o){let i=[];for(let r of t){let l=r.id===n,g=r.id===o,d=A(r.type),s=["docx-template-tag"];l&&s.push("hovered"),g&&s.push("selected"),i.push(Decoration.inline(r.from,r.to,{class:s.join(" "),"data-tag-id":r.id,style:`background-color: ${d}22; border-radius: 2px;`},{noOverlay:true}));}return DecorationSet.create(e,i)}function V(e,t){if(e.length!==t.length)return false;for(let n=0;n<e.length;n++)if(e[n].id!==t[n].id)return false;return true}function w(){return new Plugin({key:a,state:{init(e,t){let n=x(t.doc);return {tags:n,decorations:m(t.doc,n)}},apply(e,t,n,o){if(e.docChanged){let r=x(o.doc),l=V(t.tags,r);return {tags:r,decorations:l?t.decorations.map(e.mapping,e.doc):m(o.doc,r,t.hoveredId,t.selectedId),hoveredId:t.hoveredId,selectedId:t.selectedId}}let i=e.getMeta(a);if(i){let r=i.hoveredId??t.hoveredId,l=i.selectedId??t.selectedId;return {...t,hoveredId:r,selectedId:l,decorations:m(o.doc,t.tags,r,l)}}return {...t,decorations:t.decorations.map(e.mapping,e.doc)}}},props:{decorations(e){return a.getState(e)?.decorations??DecorationSet.empty},handleClick(e,t){let o=(a.getState(e.state)?.tags??[]).find(r=>t>=r.from&&t<=r.to);return o?(e.dispatch(e.state.tr.setMeta(a,{selectedId:o.id})),true):(a.getState(e.state)?.selectedId&&e.dispatch(e.state.tr.setMeta(a,{selectedId:void 0})),false)},handleDOMEvents:{mouseover(e,t){let o=t.target.closest?.("[data-tag-id]")?.getAttribute("data-tag-id")||void 0,i=a.getState(e.state)?.hoveredId;return o!==i&&e.dispatch(e.state.tr.setMeta(a,{hoveredId:o})),false},mouseout(e,t){return t.relatedTarget?.closest?.("[data-tag-id]")||a.getState(e.state)?.hoveredId&&e.dispatch(e.state.tr.setMeta(a,{hoveredId:void 0})),false}}}})}function D(e){return a.getState(e)?.tags??[]}function $(e,t){e.dispatch(e.state.tr.setMeta(a,{hoveredId:t}));}function H(e,t){e.dispatch(e.state.tr.setMeta(a,{selectedId:t}));}var N=`
|
|
2
|
+
.docx-template-tag {
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
transition: background-color 0.1s;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.docx-template-tag:hover,
|
|
8
|
+
.docx-template-tag.hovered {
|
|
9
|
+
filter: brightness(0.95);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.docx-template-tag.selected {
|
|
13
|
+
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
|
|
14
|
+
}
|
|
15
|
+
`;export{N as TEMPLATE_DECORATION_STYLES,w as createTemplatePlugin,D as getTemplateTags,$ as setHoveredElement,H as setSelectedElement,a as templatePluginKey};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Click Position Resolver
|
|
3
|
+
*
|
|
4
|
+
* Provides fast, indexed lookups for click-to-position mapping.
|
|
5
|
+
* Caches page, fragment, and run positions for O(log n) lookups
|
|
6
|
+
* instead of O(n) DOM traversal.
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Cached page information for fast Y-coordinate lookup.
|
|
12
|
+
*/
|
|
13
|
+
interface PageInfo {
|
|
14
|
+
element: HTMLElement;
|
|
15
|
+
index: number;
|
|
16
|
+
top: number;
|
|
17
|
+
bottom: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Cached fragment information.
|
|
21
|
+
*/
|
|
22
|
+
interface FragmentInfo {
|
|
23
|
+
element: HTMLElement;
|
|
24
|
+
blockId: string;
|
|
25
|
+
top: number;
|
|
26
|
+
bottom: number;
|
|
27
|
+
left: number;
|
|
28
|
+
right: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Cached run (text span) information.
|
|
32
|
+
*/
|
|
33
|
+
interface RunInfo {
|
|
34
|
+
element: HTMLElement;
|
|
35
|
+
pmStart: number;
|
|
36
|
+
pmEnd: number;
|
|
37
|
+
left: number;
|
|
38
|
+
right: number;
|
|
39
|
+
isTab: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Result of a position lookup.
|
|
43
|
+
*/
|
|
44
|
+
interface PositionLookupResult {
|
|
45
|
+
pageIndex: number;
|
|
46
|
+
pmPosition: number;
|
|
47
|
+
element: HTMLElement;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* ClickPositionResolver provides fast click-to-position mapping
|
|
51
|
+
* by caching DOM element positions and using binary search.
|
|
52
|
+
*/
|
|
53
|
+
declare class ClickPositionResolver {
|
|
54
|
+
#private;
|
|
55
|
+
/**
|
|
56
|
+
* Rebuild the entire index from the container.
|
|
57
|
+
* Call this after layout changes.
|
|
58
|
+
*/
|
|
59
|
+
rebuild(container: HTMLElement): void;
|
|
60
|
+
/**
|
|
61
|
+
* Mark the index as dirty (needs rebuild).
|
|
62
|
+
*/
|
|
63
|
+
invalidate(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Check if index needs rebuilding.
|
|
66
|
+
*/
|
|
67
|
+
isDirty(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Get the page at a Y coordinate using binary search.
|
|
70
|
+
*/
|
|
71
|
+
getPageAtY(clientY: number): PageInfo | null;
|
|
72
|
+
/**
|
|
73
|
+
* Get the fragment at a point within a page.
|
|
74
|
+
*/
|
|
75
|
+
getFragmentAtPoint(pageIndex: number, _clientX: number, clientY: number): FragmentInfo | null;
|
|
76
|
+
/**
|
|
77
|
+
* Get the run at an X coordinate within a fragment.
|
|
78
|
+
*/
|
|
79
|
+
getRunAtX(blockId: string, clientX: number): RunInfo | null;
|
|
80
|
+
/**
|
|
81
|
+
* Get the exact PM position within a run using binary search.
|
|
82
|
+
*/
|
|
83
|
+
getPositionInRun(run: RunInfo, clientX: number): number;
|
|
84
|
+
/**
|
|
85
|
+
* Get PM position from client coordinates.
|
|
86
|
+
* Main entry point for click-to-position mapping.
|
|
87
|
+
*/
|
|
88
|
+
getPositionAtPoint(clientX: number, clientY: number): PositionLookupResult | null;
|
|
89
|
+
/**
|
|
90
|
+
* Get the element containing a PM position.
|
|
91
|
+
* Useful for caret positioning.
|
|
92
|
+
*/
|
|
93
|
+
getElementAtPosition(pmPos: number): HTMLElement | null;
|
|
94
|
+
/**
|
|
95
|
+
* Get all pages info (for debugging).
|
|
96
|
+
*/
|
|
97
|
+
getPages(): ReadonlyArray<PageInfo>;
|
|
98
|
+
/**
|
|
99
|
+
* Get debug info.
|
|
100
|
+
*/
|
|
101
|
+
getDebugInfo(): {
|
|
102
|
+
pageCount: number;
|
|
103
|
+
fragmentCount: number;
|
|
104
|
+
runCount: number;
|
|
105
|
+
dirty: boolean;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { ClickPositionResolver, type PositionLookupResult };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Click Position Resolver
|
|
3
|
+
*
|
|
4
|
+
* Provides fast, indexed lookups for click-to-position mapping.
|
|
5
|
+
* Caches page, fragment, and run positions for O(log n) lookups
|
|
6
|
+
* instead of O(n) DOM traversal.
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Cached page information for fast Y-coordinate lookup.
|
|
12
|
+
*/
|
|
13
|
+
interface PageInfo {
|
|
14
|
+
element: HTMLElement;
|
|
15
|
+
index: number;
|
|
16
|
+
top: number;
|
|
17
|
+
bottom: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Cached fragment information.
|
|
21
|
+
*/
|
|
22
|
+
interface FragmentInfo {
|
|
23
|
+
element: HTMLElement;
|
|
24
|
+
blockId: string;
|
|
25
|
+
top: number;
|
|
26
|
+
bottom: number;
|
|
27
|
+
left: number;
|
|
28
|
+
right: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Cached run (text span) information.
|
|
32
|
+
*/
|
|
33
|
+
interface RunInfo {
|
|
34
|
+
element: HTMLElement;
|
|
35
|
+
pmStart: number;
|
|
36
|
+
pmEnd: number;
|
|
37
|
+
left: number;
|
|
38
|
+
right: number;
|
|
39
|
+
isTab: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Result of a position lookup.
|
|
43
|
+
*/
|
|
44
|
+
interface PositionLookupResult {
|
|
45
|
+
pageIndex: number;
|
|
46
|
+
pmPosition: number;
|
|
47
|
+
element: HTMLElement;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* ClickPositionResolver provides fast click-to-position mapping
|
|
51
|
+
* by caching DOM element positions and using binary search.
|
|
52
|
+
*/
|
|
53
|
+
declare class ClickPositionResolver {
|
|
54
|
+
#private;
|
|
55
|
+
/**
|
|
56
|
+
* Rebuild the entire index from the container.
|
|
57
|
+
* Call this after layout changes.
|
|
58
|
+
*/
|
|
59
|
+
rebuild(container: HTMLElement): void;
|
|
60
|
+
/**
|
|
61
|
+
* Mark the index as dirty (needs rebuild).
|
|
62
|
+
*/
|
|
63
|
+
invalidate(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Check if index needs rebuilding.
|
|
66
|
+
*/
|
|
67
|
+
isDirty(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Get the page at a Y coordinate using binary search.
|
|
70
|
+
*/
|
|
71
|
+
getPageAtY(clientY: number): PageInfo | null;
|
|
72
|
+
/**
|
|
73
|
+
* Get the fragment at a point within a page.
|
|
74
|
+
*/
|
|
75
|
+
getFragmentAtPoint(pageIndex: number, _clientX: number, clientY: number): FragmentInfo | null;
|
|
76
|
+
/**
|
|
77
|
+
* Get the run at an X coordinate within a fragment.
|
|
78
|
+
*/
|
|
79
|
+
getRunAtX(blockId: string, clientX: number): RunInfo | null;
|
|
80
|
+
/**
|
|
81
|
+
* Get the exact PM position within a run using binary search.
|
|
82
|
+
*/
|
|
83
|
+
getPositionInRun(run: RunInfo, clientX: number): number;
|
|
84
|
+
/**
|
|
85
|
+
* Get PM position from client coordinates.
|
|
86
|
+
* Main entry point for click-to-position mapping.
|
|
87
|
+
*/
|
|
88
|
+
getPositionAtPoint(clientX: number, clientY: number): PositionLookupResult | null;
|
|
89
|
+
/**
|
|
90
|
+
* Get the element containing a PM position.
|
|
91
|
+
* Useful for caret positioning.
|
|
92
|
+
*/
|
|
93
|
+
getElementAtPosition(pmPos: number): HTMLElement | null;
|
|
94
|
+
/**
|
|
95
|
+
* Get all pages info (for debugging).
|
|
96
|
+
*/
|
|
97
|
+
getPages(): ReadonlyArray<PageInfo>;
|
|
98
|
+
/**
|
|
99
|
+
* Get debug info.
|
|
100
|
+
*/
|
|
101
|
+
getDebugInfo(): {
|
|
102
|
+
pageCount: number;
|
|
103
|
+
fragmentCount: number;
|
|
104
|
+
runCount: number;
|
|
105
|
+
dirty: boolean;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { ClickPositionResolver, type PositionLookupResult };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkDC7S76ZX_js=require('../../chunk-DC7S76ZX.js');var a,p,f,c,g,b,T,x,M=class{constructor(){chunkDC7S76ZX_js.c(this,b);chunkDC7S76ZX_js.c(this,a,[]);chunkDC7S76ZX_js.c(this,p,new Map);chunkDC7S76ZX_js.c(this,f,new Map);chunkDC7S76ZX_js.c(this,c,null);chunkDC7S76ZX_js.c(this,g,true);}rebuild(e){chunkDC7S76ZX_js.d(this,c,e),chunkDC7S76ZX_js.d(this,a,[]),chunkDC7S76ZX_js.b(this,p).clear(),chunkDC7S76ZX_js.b(this,f).clear();let o=e.querySelectorAll(".layout-page");for(let t=0;t<o.length;t++){let r=o[t],s=r.getBoundingClientRect();chunkDC7S76ZX_js.b(this,a).push({element:r,index:t,top:s.top,bottom:s.bottom}),chunkDC7S76ZX_js.e(this,b,T).call(this,r,t);}chunkDC7S76ZX_js.b(this,a).sort((t,r)=>t.top-r.top),chunkDC7S76ZX_js.d(this,g,false);}invalidate(){chunkDC7S76ZX_js.d(this,g,true);}isDirty(){return chunkDC7S76ZX_js.b(this,g)}getPageAtY(e){if(chunkDC7S76ZX_js.b(this,a).length===0)return null;let o=0,t=chunkDC7S76ZX_js.b(this,a).length-1;for(;o<=t;){let r=Math.floor((o+t)/2),s=chunkDC7S76ZX_js.b(this,a)[r];if(e<s.top)t=r-1;else if(e>s.bottom)o=r+1;else return s}return o>=chunkDC7S76ZX_js.b(this,a).length?chunkDC7S76ZX_js.b(this,a)[chunkDC7S76ZX_js.b(this,a).length-1]:t<0?chunkDC7S76ZX_js.b(this,a)[0]:null}getFragmentAtPoint(e,o,t){let r=chunkDC7S76ZX_js.b(this,p).get(e);if(!r||r.length===0)return null;for(let i of r)if(t>=i.top&&t<=i.bottom)return i;let s=null,n=1/0;for(let i of r){let u=t<i.top?i.top-t:t-i.bottom;u<n&&(n=u,s=i);}return s}getRunAtX(e,o){let t=chunkDC7S76ZX_js.b(this,f).get(e);if(!t||t.length===0)return null;for(let n of t)if(o>=n.left&&o<=n.right)return n;let r=null,s=1/0;for(let n of t){let i=o<n.left?n.left-o:o-n.right;i<s&&(s=i,r=n);}return r}getPositionInRun(e,o){if(e.isTab){let m=(e.left+e.right)/2;return o<m?e.pmStart:e.pmEnd}let t=e.element.firstChild;if(!t||t.nodeType!==Node.TEXT_NODE)return e.pmStart;let r=t,s=r.length;if(s===0)return e.pmStart;let n=e.element.ownerDocument;if(!n)return e.pmStart;let i=0,u=s;for(;i<u;){let m=Math.floor((i+u)/2),E=n.createRange();E.setStart(r,m),E.setEnd(r,m);let R=E.getBoundingClientRect();o<R.left?u=m:i=m+1;}let I=Math.max(0,Math.min(i,e.pmEnd-e.pmStart));return e.pmStart+I}getPositionAtPoint(e,o){chunkDC7S76ZX_js.b(this,g)&&chunkDC7S76ZX_js.b(this,c)&&this.rebuild(chunkDC7S76ZX_js.b(this,c));let t=this.getPageAtY(o);if(!t)return null;let r=this.getFragmentAtPoint(t.index,e,o);if(!r)return null;let s=this.getRunAtX(r.blockId,e);if(!s){let i=Number(r.element.dataset.pmStart);return {pageIndex:t.index,pmPosition:i||0,element:r.element}}let n=this.getPositionInRun(s,e);return {pageIndex:t.index,pmPosition:n,element:s.element}}getElementAtPosition(e){for(let o of chunkDC7S76ZX_js.b(this,f).values())for(let t of o)if(t.isTab){if(e>=t.pmStart&&e<t.pmEnd)return t.element}else if(e>=t.pmStart&&e<=t.pmEnd)return t.element;return null}getPages(){return chunkDC7S76ZX_js.b(this,a)}getDebugInfo(){let e=0,o=0;for(let t of chunkDC7S76ZX_js.b(this,p).values())e+=t.length;for(let t of chunkDC7S76ZX_js.b(this,f).values())o+=t.length;return {pageCount:chunkDC7S76ZX_js.b(this,a).length,fragmentCount:e,runCount:o,dirty:chunkDC7S76ZX_js.b(this,g)}}};a=new WeakMap,p=new WeakMap,f=new WeakMap,c=new WeakMap,g=new WeakMap,b=new WeakSet,T=function(e,o){let t=[],r=e.querySelectorAll(".layout-paragraph, .layout-table, .layout-image");for(let s of Array.from(r)){let n=s,i=n.dataset.blockId||"",u=n.getBoundingClientRect();t.push({element:n,blockId:i,top:u.top,bottom:u.bottom,left:u.left,right:u.right}),chunkDC7S76ZX_js.e(this,b,x).call(this,n,i);}t.sort((s,n)=>s.top-n.top),chunkDC7S76ZX_js.b(this,p).set(o,t);},x=function(e,o){let t=[],r=e.querySelectorAll("span[data-pm-start][data-pm-end]");for(let s of Array.from(r)){let n=s,i=Number(n.dataset.pmStart),u=Number(n.dataset.pmEnd),I=n.getBoundingClientRect(),m=n.classList.contains("layout-run-tab");t.push({element:n,pmStart:i,pmEnd:u,left:I.left,right:I.right,isTab:m});}t.sort((s,n)=>s.left-n.left),chunkDC7S76ZX_js.b(this,f).set(o,t);};exports.ClickPositionResolver=M;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c as c$1,d,b as b$1,e}from'../../chunk-QYUPLKLP.mjs';var a,p,f,c,g,b,T,x,M=class{constructor(){c$1(this,b);c$1(this,a,[]);c$1(this,p,new Map);c$1(this,f,new Map);c$1(this,c,null);c$1(this,g,true);}rebuild(e$1){d(this,c,e$1),d(this,a,[]),b$1(this,p).clear(),b$1(this,f).clear();let o=e$1.querySelectorAll(".layout-page");for(let t=0;t<o.length;t++){let r=o[t],s=r.getBoundingClientRect();b$1(this,a).push({element:r,index:t,top:s.top,bottom:s.bottom}),e(this,b,T).call(this,r,t);}b$1(this,a).sort((t,r)=>t.top-r.top),d(this,g,false);}invalidate(){d(this,g,true);}isDirty(){return b$1(this,g)}getPageAtY(e){if(b$1(this,a).length===0)return null;let o=0,t=b$1(this,a).length-1;for(;o<=t;){let r=Math.floor((o+t)/2),s=b$1(this,a)[r];if(e<s.top)t=r-1;else if(e>s.bottom)o=r+1;else return s}return o>=b$1(this,a).length?b$1(this,a)[b$1(this,a).length-1]:t<0?b$1(this,a)[0]:null}getFragmentAtPoint(e,o,t){let r=b$1(this,p).get(e);if(!r||r.length===0)return null;for(let i of r)if(t>=i.top&&t<=i.bottom)return i;let s=null,n=1/0;for(let i of r){let u=t<i.top?i.top-t:t-i.bottom;u<n&&(n=u,s=i);}return s}getRunAtX(e,o){let t=b$1(this,f).get(e);if(!t||t.length===0)return null;for(let n of t)if(o>=n.left&&o<=n.right)return n;let r=null,s=1/0;for(let n of t){let i=o<n.left?n.left-o:o-n.right;i<s&&(s=i,r=n);}return r}getPositionInRun(e,o){if(e.isTab){let m=(e.left+e.right)/2;return o<m?e.pmStart:e.pmEnd}let t=e.element.firstChild;if(!t||t.nodeType!==Node.TEXT_NODE)return e.pmStart;let r=t,s=r.length;if(s===0)return e.pmStart;let n=e.element.ownerDocument;if(!n)return e.pmStart;let i=0,u=s;for(;i<u;){let m=Math.floor((i+u)/2),E=n.createRange();E.setStart(r,m),E.setEnd(r,m);let R=E.getBoundingClientRect();o<R.left?u=m:i=m+1;}let I=Math.max(0,Math.min(i,e.pmEnd-e.pmStart));return e.pmStart+I}getPositionAtPoint(e,o){b$1(this,g)&&b$1(this,c)&&this.rebuild(b$1(this,c));let t=this.getPageAtY(o);if(!t)return null;let r=this.getFragmentAtPoint(t.index,e,o);if(!r)return null;let s=this.getRunAtX(r.blockId,e);if(!s){let i=Number(r.element.dataset.pmStart);return {pageIndex:t.index,pmPosition:i||0,element:r.element}}let n=this.getPositionInRun(s,e);return {pageIndex:t.index,pmPosition:n,element:s.element}}getElementAtPosition(e){for(let o of b$1(this,f).values())for(let t of o)if(t.isTab){if(e>=t.pmStart&&e<t.pmEnd)return t.element}else if(e>=t.pmStart&&e<=t.pmEnd)return t.element;return null}getPages(){return b$1(this,a)}getDebugInfo(){let e=0,o=0;for(let t of b$1(this,p).values())e+=t.length;for(let t of b$1(this,f).values())o+=t.length;return {pageCount:b$1(this,a).length,fragmentCount:e,runCount:o,dirty:b$1(this,g)}}};a=new WeakMap,p=new WeakMap,f=new WeakMap,c=new WeakMap,g=new WeakMap,b=new WeakSet,T=function(e$1,o){let t=[],r=e$1.querySelectorAll(".layout-paragraph, .layout-table, .layout-image");for(let s of Array.from(r)){let n=s,i=n.dataset.blockId||"",u=n.getBoundingClientRect();t.push({element:n,blockId:i,top:u.top,bottom:u.bottom,left:u.left,right:u.right}),e(this,b,x).call(this,n,i);}t.sort((s,n)=>s.top-n.top),b$1(this,p).set(o,t);},x=function(e,o){let t=[],r=e.querySelectorAll("span[data-pm-start][data-pm-end]");for(let s of Array.from(r)){let n=s,i=Number(n.dataset.pmStart),u=Number(n.dataset.pmEnd),I=n.getBoundingClientRect(),m=n.classList.contains("layout-run-tab");t.push({element:n,pmStart:i,pmEnd:u,left:I.left,right:I.right,isTab:m});}t.sort((s,n)=>s.left-n.left),b$1(this,f).set(o,t);};export{M as ClickPositionResolver};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout Selection Gate
|
|
3
|
+
*
|
|
4
|
+
* Guards selection rendering until layout is up-to-date.
|
|
5
|
+
* Uses sequenced versioning to prevent stale cursor positions.
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
type RenderCallback = () => void;
|
|
10
|
+
/**
|
|
11
|
+
* LayoutSelectionGate coordinates the timing between document edits and
|
|
12
|
+
* layout reflow so that selection overlays are only painted against
|
|
13
|
+
* current DOM geometry.
|
|
14
|
+
*
|
|
15
|
+
* Workflow:
|
|
16
|
+
* 1. Document changes → setStateSeq(++seq)
|
|
17
|
+
* 2. Layout starts → onLayoutStart()
|
|
18
|
+
* 3. Layout completes → onLayoutComplete(seq)
|
|
19
|
+
* 4. Selection update requested → requestRender()
|
|
20
|
+
* 5. If safe → callback is called
|
|
21
|
+
*/
|
|
22
|
+
declare class LayoutSelectionGate {
|
|
23
|
+
#private;
|
|
24
|
+
/**
|
|
25
|
+
* Set the document state sequence (call when document changes).
|
|
26
|
+
* This should be called on every ProseMirror transaction that changes the doc.
|
|
27
|
+
*/
|
|
28
|
+
setStateSeq(seq: number): void;
|
|
29
|
+
/**
|
|
30
|
+
* Increment document state sequence (convenience method).
|
|
31
|
+
* Returns the new sequence value.
|
|
32
|
+
*/
|
|
33
|
+
incrementStateSeq(): number;
|
|
34
|
+
/**
|
|
35
|
+
* Get current document state sequence.
|
|
36
|
+
*/
|
|
37
|
+
getStateSeq(): number;
|
|
38
|
+
/**
|
|
39
|
+
* Get current layout render sequence.
|
|
40
|
+
*/
|
|
41
|
+
getRenderSeq(): number;
|
|
42
|
+
/**
|
|
43
|
+
* Called when layout computation starts.
|
|
44
|
+
*/
|
|
45
|
+
onLayoutStart(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Called when layout computation and DOM painting completes.
|
|
48
|
+
* @param seq - The document state sequence that was just painted
|
|
49
|
+
*/
|
|
50
|
+
onLayoutComplete(seq: number): void;
|
|
51
|
+
/**
|
|
52
|
+
* Check if it's safe to render selection.
|
|
53
|
+
* Safe when: layout is not updating AND render sequence >= state sequence
|
|
54
|
+
*/
|
|
55
|
+
isSafeToRender(): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Request a selection render. Will be executed when safe.
|
|
58
|
+
* If already safe, executes immediately.
|
|
59
|
+
*/
|
|
60
|
+
requestRender(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Register a callback to be called on render events.
|
|
63
|
+
*/
|
|
64
|
+
onRender(callback: RenderCallback): () => void;
|
|
65
|
+
/**
|
|
66
|
+
* Reset the gate state (useful for testing or document reload).
|
|
67
|
+
*/
|
|
68
|
+
reset(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Get debug info about current state.
|
|
71
|
+
*/
|
|
72
|
+
getDebugInfo(): {
|
|
73
|
+
stateSeq: number;
|
|
74
|
+
renderSeq: number;
|
|
75
|
+
layoutUpdating: boolean;
|
|
76
|
+
hasPendingRender: boolean;
|
|
77
|
+
isSafe: boolean;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { LayoutSelectionGate };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout Selection Gate
|
|
3
|
+
*
|
|
4
|
+
* Guards selection rendering until layout is up-to-date.
|
|
5
|
+
* Uses sequenced versioning to prevent stale cursor positions.
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
type RenderCallback = () => void;
|
|
10
|
+
/**
|
|
11
|
+
* LayoutSelectionGate coordinates the timing between document edits and
|
|
12
|
+
* layout reflow so that selection overlays are only painted against
|
|
13
|
+
* current DOM geometry.
|
|
14
|
+
*
|
|
15
|
+
* Workflow:
|
|
16
|
+
* 1. Document changes → setStateSeq(++seq)
|
|
17
|
+
* 2. Layout starts → onLayoutStart()
|
|
18
|
+
* 3. Layout completes → onLayoutComplete(seq)
|
|
19
|
+
* 4. Selection update requested → requestRender()
|
|
20
|
+
* 5. If safe → callback is called
|
|
21
|
+
*/
|
|
22
|
+
declare class LayoutSelectionGate {
|
|
23
|
+
#private;
|
|
24
|
+
/**
|
|
25
|
+
* Set the document state sequence (call when document changes).
|
|
26
|
+
* This should be called on every ProseMirror transaction that changes the doc.
|
|
27
|
+
*/
|
|
28
|
+
setStateSeq(seq: number): void;
|
|
29
|
+
/**
|
|
30
|
+
* Increment document state sequence (convenience method).
|
|
31
|
+
* Returns the new sequence value.
|
|
32
|
+
*/
|
|
33
|
+
incrementStateSeq(): number;
|
|
34
|
+
/**
|
|
35
|
+
* Get current document state sequence.
|
|
36
|
+
*/
|
|
37
|
+
getStateSeq(): number;
|
|
38
|
+
/**
|
|
39
|
+
* Get current layout render sequence.
|
|
40
|
+
*/
|
|
41
|
+
getRenderSeq(): number;
|
|
42
|
+
/**
|
|
43
|
+
* Called when layout computation starts.
|
|
44
|
+
*/
|
|
45
|
+
onLayoutStart(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Called when layout computation and DOM painting completes.
|
|
48
|
+
* @param seq - The document state sequence that was just painted
|
|
49
|
+
*/
|
|
50
|
+
onLayoutComplete(seq: number): void;
|
|
51
|
+
/**
|
|
52
|
+
* Check if it's safe to render selection.
|
|
53
|
+
* Safe when: layout is not updating AND render sequence >= state sequence
|
|
54
|
+
*/
|
|
55
|
+
isSafeToRender(): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Request a selection render. Will be executed when safe.
|
|
58
|
+
* If already safe, executes immediately.
|
|
59
|
+
*/
|
|
60
|
+
requestRender(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Register a callback to be called on render events.
|
|
63
|
+
*/
|
|
64
|
+
onRender(callback: RenderCallback): () => void;
|
|
65
|
+
/**
|
|
66
|
+
* Reset the gate state (useful for testing or document reload).
|
|
67
|
+
*/
|
|
68
|
+
reset(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Get debug info about current state.
|
|
71
|
+
*/
|
|
72
|
+
getDebugInfo(): {
|
|
73
|
+
stateSeq: number;
|
|
74
|
+
renderSeq: number;
|
|
75
|
+
layoutUpdating: boolean;
|
|
76
|
+
hasPendingRender: boolean;
|
|
77
|
+
isSafe: boolean;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { LayoutSelectionGate };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk4GER4JLW_js=require('../../chunk-4GER4JLW.js');require('../../chunk-DC7S76ZX.js');Object.defineProperty(exports,"LayoutSelectionGate",{enumerable:true,get:function(){return chunk4GER4JLW_js.a}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as LayoutSelectionGate}from'../../chunk-Q5QOBZWT.mjs';import'../../chunk-QYUPLKLP.mjs';
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pointer Event Handler
|
|
3
|
+
*
|
|
4
|
+
* Centralized input handling for all pointer events.
|
|
5
|
+
* Provides single source of truth for click, drag, and focus management.
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
import { ClickPositionResolver } from './ClickPositionResolver.mjs';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Pointer Event Handler
|
|
13
|
+
*
|
|
14
|
+
* Centralized input handling for all pointer events.
|
|
15
|
+
* Provides single source of truth for click, drag, and focus management.
|
|
16
|
+
* @packageDocumentation
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Interface for the editor that the handler controls.
|
|
22
|
+
*/
|
|
23
|
+
interface EditorInterface {
|
|
24
|
+
/** Set selection to a position (collapsed) */
|
|
25
|
+
setSelection(pos: number): void;
|
|
26
|
+
/** Set selection range */
|
|
27
|
+
setSelectionRange(from: number, to: number): void;
|
|
28
|
+
/** Get current selection */
|
|
29
|
+
getSelection(): {
|
|
30
|
+
from: number;
|
|
31
|
+
to: number;
|
|
32
|
+
} | null;
|
|
33
|
+
/** Focus the editor */
|
|
34
|
+
focus(): void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Callback for input events.
|
|
38
|
+
*/
|
|
39
|
+
type InputEventCallback = (event: {
|
|
40
|
+
type: 'click' | 'doubleClick' | 'tripleClick' | 'dragStart' | 'drag' | 'dragEnd';
|
|
41
|
+
position?: number;
|
|
42
|
+
from?: number;
|
|
43
|
+
to?: number;
|
|
44
|
+
}) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Options for PointerEventHandler.
|
|
47
|
+
*/
|
|
48
|
+
interface PointerEventHandlerOptions {
|
|
49
|
+
/** The editor to control */
|
|
50
|
+
editor: EditorInterface;
|
|
51
|
+
/** Position resolver for click mapping */
|
|
52
|
+
positionResolver: ClickPositionResolver;
|
|
53
|
+
/** Callback for input events */
|
|
54
|
+
onInput?: InputEventCallback;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* PointerEventHandler handles all pointer input for the paged editor.
|
|
58
|
+
* It provides:
|
|
59
|
+
* - Single/double/triple click detection
|
|
60
|
+
* - Drag selection with anchor tracking
|
|
61
|
+
* - Coordinate normalization for zoom
|
|
62
|
+
* - Focus management
|
|
63
|
+
*/
|
|
64
|
+
declare class PointerEventHandler {
|
|
65
|
+
#private;
|
|
66
|
+
static readonly MULTI_CLICK_DELAY = 500;
|
|
67
|
+
constructor(options: PointerEventHandlerOptions);
|
|
68
|
+
/**
|
|
69
|
+
* Attach event listeners to a container element.
|
|
70
|
+
*/
|
|
71
|
+
attach(container: HTMLElement): void;
|
|
72
|
+
/**
|
|
73
|
+
* Detach event listeners from the container.
|
|
74
|
+
*/
|
|
75
|
+
detach(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Update the position resolver reference.
|
|
78
|
+
*/
|
|
79
|
+
setPositionResolver(positionResolver: ClickPositionResolver): void;
|
|
80
|
+
/**
|
|
81
|
+
* Get current drag state.
|
|
82
|
+
*/
|
|
83
|
+
isDragging(): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Get drag anchor position.
|
|
86
|
+
*/
|
|
87
|
+
getDragAnchor(): number | null;
|
|
88
|
+
/**
|
|
89
|
+
* Cancel any ongoing drag.
|
|
90
|
+
*/
|
|
91
|
+
cancelDrag(): void;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export { type EditorInterface, type InputEventCallback, PointerEventHandler, type PointerEventHandlerOptions };
|