@eigenpal/docx-editor-core 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +204 -0
- package/README.md +54 -0
- package/dist/ImageExtension-BN327PNe.d.mts +38 -0
- package/dist/ImageExtension-BlI5afZD.d.ts +38 -0
- package/dist/Subscribable-DOz6Ohoo.d.mts +33 -0
- package/dist/Subscribable-DOz6Ohoo.d.ts +33 -0
- package/dist/agent/index.d.mts +169 -0
- package/dist/agent/index.d.ts +169 -0
- package/dist/agent/index.js +1 -0
- package/dist/agent/index.mjs +1 -0
- package/dist/borders-BH_GoYU3.d.mts +58 -0
- package/dist/borders-Z9hPno2u.d.ts +58 -0
- package/dist/chunk-23CP3TOP.js +1 -0
- package/dist/chunk-2KHWHVTA.js +1 -0
- package/dist/chunk-36VIYQHD.mjs +9 -0
- package/dist/chunk-3COGZG7O.mjs +1 -0
- package/dist/chunk-3NRMSZX2.mjs +1 -0
- package/dist/chunk-3SXJPJSV.mjs +1 -0
- package/dist/chunk-44RUAQA2.js +1 -0
- package/dist/chunk-4AJYHCPB.js +2 -0
- package/dist/chunk-4BFNWPKW.js +1 -0
- package/dist/chunk-4EHBV73E.mjs +59 -0
- package/dist/chunk-4G6AJ4ZM.js +1 -0
- package/dist/chunk-4GER4JLW.js +1 -0
- package/dist/chunk-4Q2IP5FW.js +1 -0
- package/dist/chunk-5N5DBQJV.mjs +1 -0
- package/dist/chunk-62NPHRTF.js +1 -0
- package/dist/chunk-67LVRQIR.mjs +1 -0
- package/dist/chunk-6ILFFGGS.js +2 -0
- package/dist/chunk-6LOYA7G5.mjs +2 -0
- package/dist/chunk-6LVPRTB6.js +1 -0
- package/dist/chunk-6NQSIC27.mjs +1 -0
- package/dist/chunk-6VUYFDHY.mjs +1 -0
- package/dist/chunk-7E5VBRDL.mjs +1 -0
- package/dist/chunk-7GHQ4YCJ.mjs +1 -0
- package/dist/chunk-7RDCZLTU.js +1 -0
- package/dist/chunk-7VCMJCBY.js +2 -0
- package/dist/chunk-AAPBAMD7.js +1 -0
- package/dist/chunk-AMENZY5F.mjs +1 -0
- package/dist/chunk-ARHPXIBJ.mjs +1 -0
- package/dist/chunk-BGC7QKP5.mjs +1 -0
- package/dist/chunk-BGY3CB37.mjs +1 -0
- package/dist/chunk-BHBOAP6Z.js +3 -0
- package/dist/chunk-BWHUD2XC.mjs +4 -0
- package/dist/chunk-CCWOLPZE.js +3 -0
- package/dist/chunk-CGJ6S3AH.mjs +1 -0
- package/dist/chunk-CKKO4JWE.mjs +1 -0
- package/dist/chunk-CKXAHSJQ.js +10 -0
- package/dist/chunk-CP5OSG5Z.mjs +1 -0
- package/dist/chunk-CUY2THAO.mjs +1 -0
- package/dist/chunk-CWAP26GB.js +4 -0
- package/dist/chunk-D4RPOJC7.js +1 -0
- package/dist/chunk-D6GO7UGD.mjs +1 -0
- package/dist/chunk-DC7S76ZX.js +1 -0
- package/dist/chunk-DFZTUQ7O.js +2 -0
- package/dist/chunk-DROCYKAR.js +1 -0
- package/dist/chunk-DWFWYHM5.mjs +1 -0
- package/dist/chunk-DY2MJCSV.js +1 -0
- package/dist/chunk-ESI4BSBF.js +1 -0
- package/dist/chunk-FC6QL3E6.js +1 -0
- package/dist/chunk-FWTP7BN7.mjs +4 -0
- package/dist/chunk-G6Y4UZMJ.mjs +1 -0
- package/dist/chunk-GGPKPXON.js +1 -0
- package/dist/chunk-GXW7YSFL.mjs +1 -0
- package/dist/chunk-I6PMX4BO.js +1 -0
- package/dist/chunk-IBNUQL57.mjs +2 -0
- package/dist/chunk-ILJUDEZ5.mjs +1 -0
- package/dist/chunk-IP2VXNWG.js +1 -0
- package/dist/chunk-J7ULKGU2.mjs +10 -0
- package/dist/chunk-JFZIXFRC.js +1 -0
- package/dist/chunk-JHZ3HLSR.mjs +1 -0
- package/dist/chunk-JKVXID22.mjs +1 -0
- package/dist/chunk-JY5EFI4D.js +1 -0
- package/dist/chunk-KBU6QQFU.js +9 -0
- package/dist/chunk-KESNGXGO.js +1 -0
- package/dist/chunk-KQTB5Y7P.mjs +1 -0
- package/dist/chunk-LBKMYD3M.mjs +1 -0
- package/dist/chunk-LMF2ELOB.js +1 -0
- package/dist/chunk-LVD6HXRF.mjs +2 -0
- package/dist/chunk-MJ5FQX7Q.js +1 -0
- package/dist/chunk-MOKKS75W.mjs +3 -0
- package/dist/chunk-MVZOTKNL.mjs +1 -0
- package/dist/chunk-MZ7LW5CH.js +1 -0
- package/dist/chunk-MZOVDLYL.js +1 -0
- package/dist/chunk-N27FJQTG.js +1 -0
- package/dist/chunk-N3Y5BUKV.js +1 -0
- package/dist/chunk-NBLJPT54.mjs +1 -0
- package/dist/chunk-NERY274X.js +1 -0
- package/dist/chunk-NNQWQOC5.mjs +1 -0
- package/dist/chunk-NXLJVVVE.js +1 -0
- package/dist/chunk-O5X22KZ6.mjs +1 -0
- package/dist/chunk-OBMN4VSM.mjs +1 -0
- package/dist/chunk-OCAX2KJQ.js +4 -0
- package/dist/chunk-OZMNIX6U.mjs +1 -0
- package/dist/chunk-PRRM64JO.mjs +1 -0
- package/dist/chunk-Q4CKLXWA.js +1 -0
- package/dist/chunk-Q5QOBZWT.mjs +1 -0
- package/dist/chunk-QPFJJPIC.mjs +1 -0
- package/dist/chunk-QYUPLKLP.mjs +1 -0
- package/dist/chunk-RNOXNNSD.mjs +0 -0
- package/dist/chunk-RPIQG46O.mjs +1 -0
- package/dist/chunk-S7IKPRC3.js +9 -0
- package/dist/chunk-SUXJX72X.js +1 -0
- package/dist/chunk-SYJAAHUK.js +1 -0
- package/dist/chunk-T4CPTPRP.js +1 -0
- package/dist/chunk-TE2AF7FM.js +1 -0
- package/dist/chunk-TE2VQJZG.js +1 -0
- package/dist/chunk-TRJWRZZD.js +1 -0
- package/dist/chunk-U4UCHBZ7.js +1 -0
- package/dist/chunk-UDPROEUK.js +1 -0
- package/dist/chunk-UIROUI5I.mjs +1 -0
- package/dist/chunk-UOFQYE2L.mjs +1 -0
- package/dist/chunk-UQ6WNWXX.js +1 -0
- package/dist/chunk-V7BKPX67.mjs +2 -0
- package/dist/chunk-VKTCTMIO.mjs +2 -0
- package/dist/chunk-VQWZHPWI.mjs +1 -0
- package/dist/chunk-VW22RZ6C.mjs +1 -0
- package/dist/chunk-WLKRUBY4.js +1 -0
- package/dist/chunk-WLQEPVDR.js +1 -0
- package/dist/chunk-WNTT4MGC.js +59 -0
- package/dist/chunk-WTFLNYAT.mjs +1 -0
- package/dist/chunk-XXU7YQVV.js +1 -0
- package/dist/chunk-Y5HZAMND.mjs +9 -0
- package/dist/chunk-Y74ANBPV.js +1 -0
- package/dist/chunk-Y7JZPBBW.js +1 -0
- package/dist/chunk-YGHHSCPR.js +2 -0
- package/dist/chunk-YMZ3F2FZ.mjs +1 -0
- package/dist/chunk-YUKBAAB5.mjs +1 -0
- package/dist/chunk-ZRZ2VRQQ.mjs +1 -0
- package/dist/chunk-ZYESB4KC.mjs +3 -0
- package/dist/colorResolver-C3q7MLLD.d.mts +390 -0
- package/dist/colorResolver-CVsPLsw1.d.ts +390 -0
- package/dist/colors-C3vA7HUU.d.mts +70 -0
- package/dist/colors-C3vA7HUU.d.ts +70 -0
- package/dist/core-plugins.d.mts +64 -0
- package/dist/core-plugins.d.ts +64 -0
- package/dist/core-plugins.js +1 -0
- package/dist/core-plugins.mjs +1 -0
- package/dist/core.d.mts +399 -0
- package/dist/core.d.ts +399 -0
- package/dist/core.js +1 -0
- package/dist/core.mjs +1 -0
- package/dist/documentSerializer-C1ueey5d.d.mts +36 -0
- package/dist/documentSerializer-Chn7J1WG.d.ts +36 -0
- package/dist/docx/index.d.mts +1124 -0
- package/dist/docx/index.d.ts +1124 -0
- package/dist/docx/index.js +1 -0
- package/dist/docx/index.mjs +1 -0
- package/dist/docx/parser.d.mts +109 -0
- package/dist/docx/parser.d.ts +109 -0
- package/dist/docx/parser.js +1 -0
- package/dist/docx/parser.mjs +1 -0
- package/dist/docx/rezip.d.mts +313 -0
- package/dist/docx/rezip.d.ts +313 -0
- package/dist/docx/rezip.js +1 -0
- package/dist/docx/rezip.mjs +1 -0
- package/dist/docx/serializer/index.d.mts +126 -0
- package/dist/docx/serializer/index.d.ts +126 -0
- package/dist/docx/serializer/index.js +1 -0
- package/dist/docx/serializer/index.mjs +1 -0
- package/dist/docx/wrapTypes.d.mts +19 -0
- package/dist/docx/wrapTypes.d.ts +19 -0
- package/dist/docx/wrapTypes.js +1 -0
- package/dist/docx/wrapTypes.mjs +1 -0
- package/dist/docxInput-DTbCa48g.d.mts +21 -0
- package/dist/docxInput-DTbCa48g.d.ts +21 -0
- package/dist/executor-DZAMMQ35.js +1 -0
- package/dist/executor-ZCJRLT3Z.mjs +1 -0
- package/dist/findParagraphByParaId-Maw_8M5D.d.mts +28 -0
- package/dist/findParagraphByParaId-Maw_8M5D.d.ts +28 -0
- package/dist/fontLoader-BOt95Jtf.d.mts +223 -0
- package/dist/fontLoader-QPwbcX5j.d.ts +223 -0
- package/dist/footnotes-lCH_P3N3.d.mts +78 -0
- package/dist/footnotes-skVvEHvZ.d.ts +78 -0
- package/dist/formatting-BwpZWdGi.d.ts +410 -0
- package/dist/formatting-D9I-lFS4.d.mts +410 -0
- package/dist/headerFooterLayout-B3QVg556.d.ts +201 -0
- package/dist/headerFooterLayout-DkclHZ0Z.d.mts +201 -0
- package/dist/headless.d.mts +110 -0
- package/dist/headless.d.ts +110 -0
- package/dist/headless.js +1 -0
- package/dist/headless.mjs +1 -0
- package/dist/layout-bridge/clickToPositionDom.d.mts +56 -0
- package/dist/layout-bridge/clickToPositionDom.d.ts +56 -0
- package/dist/layout-bridge/clickToPositionDom.js +1 -0
- package/dist/layout-bridge/clickToPositionDom.mjs +1 -0
- package/dist/layout-bridge/index.d.mts +462 -0
- package/dist/layout-bridge/index.d.ts +462 -0
- package/dist/layout-bridge/index.js +1 -0
- package/dist/layout-bridge/index.mjs +1 -0
- package/dist/layout-bridge/measuring/index.d.mts +320 -0
- package/dist/layout-bridge/measuring/index.d.ts +320 -0
- package/dist/layout-bridge/measuring/index.js +1 -0
- package/dist/layout-bridge/measuring/index.mjs +1 -0
- package/dist/layout-bridge/tableInsertHover.d.mts +45 -0
- package/dist/layout-bridge/tableInsertHover.d.ts +45 -0
- package/dist/layout-bridge/tableInsertHover.js +1 -0
- package/dist/layout-bridge/tableInsertHover.mjs +1 -0
- package/dist/layout-bridge/toFlowBlocks.d.mts +122 -0
- package/dist/layout-bridge/toFlowBlocks.d.ts +122 -0
- package/dist/layout-bridge/toFlowBlocks.js +1 -0
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -0
- package/dist/layout-engine/index.d.mts +322 -0
- package/dist/layout-engine/index.d.ts +322 -0
- package/dist/layout-engine/index.js +1 -0
- package/dist/layout-engine/index.mjs +1 -0
- package/dist/layout-engine/types.d.mts +903 -0
- package/dist/layout-engine/types.d.ts +903 -0
- package/dist/layout-engine/types.js +1 -0
- package/dist/layout-engine/types.mjs +1 -0
- package/dist/layout-painter/index.d.mts +23 -0
- package/dist/layout-painter/index.d.ts +23 -0
- package/dist/layout-painter/index.js +1 -0
- package/dist/layout-painter/index.mjs +1 -0
- package/dist/layout-painter/renderPage.d.mts +674 -0
- package/dist/layout-painter/renderPage.d.ts +674 -0
- package/dist/layout-painter/renderPage.js +1 -0
- package/dist/layout-painter/renderPage.mjs +1 -0
- package/dist/lists-CdiIk_c1.d.ts +142 -0
- package/dist/lists-JDB80qyP.d.mts +142 -0
- package/dist/managers/AutoSaveManager.d.mts +96 -0
- package/dist/managers/AutoSaveManager.d.ts +96 -0
- package/dist/managers/AutoSaveManager.js +1 -0
- package/dist/managers/AutoSaveManager.mjs +1 -0
- package/dist/managers/TableSelectionManager.d.mts +95 -0
- package/dist/managers/TableSelectionManager.d.ts +95 -0
- package/dist/managers/TableSelectionManager.js +1 -0
- package/dist/managers/TableSelectionManager.mjs +1 -0
- package/dist/managers/types.d.mts +122 -0
- package/dist/managers/types.d.ts +122 -0
- package/dist/managers/types.js +1 -0
- package/dist/managers/types.mjs +0 -0
- package/dist/marks-BujVxYP4.d.ts +56 -0
- package/dist/marks-CCPVlQzL.d.mts +56 -0
- package/dist/mcp-cli.mjs +137 -0
- package/dist/mcp.d.mts +184 -0
- package/dist/mcp.d.ts +184 -0
- package/dist/mcp.js +16 -0
- package/dist/mcp.mjs +16 -0
- package/dist/nodes-BXi1Uu3e.d.mts +257 -0
- package/dist/nodes-DfKj9kUA.d.ts +257 -0
- package/dist/plugin-api/RenderedDomContext.d.mts +74 -0
- package/dist/plugin-api/RenderedDomContext.d.ts +74 -0
- package/dist/plugin-api/RenderedDomContext.js +1 -0
- package/dist/plugin-api/RenderedDomContext.mjs +1 -0
- package/dist/plugin-api/index.d.mts +15 -0
- package/dist/plugin-api/index.d.ts +15 -0
- package/dist/plugin-api/index.js +1 -0
- package/dist/plugin-api/index.mjs +0 -0
- package/dist/plugin-api/resolveItemPositions.d.mts +54 -0
- package/dist/plugin-api/resolveItemPositions.d.ts +54 -0
- package/dist/plugin-api/resolveItemPositions.js +1 -0
- package/dist/plugin-api/resolveItemPositions.mjs +1 -0
- package/dist/plugin-api/types.d.mts +190 -0
- package/dist/plugin-api/types.d.ts +190 -0
- package/dist/plugin-api/types.js +1 -0
- package/dist/plugin-api/types.mjs +0 -0
- package/dist/processTemplate-GPFDLQMX.mjs +1 -0
- package/dist/processTemplate-HH2E3HBO.js +1 -0
- package/dist/prosemirror/commands/formatting.d.mts +100 -0
- package/dist/prosemirror/commands/formatting.d.ts +100 -0
- package/dist/prosemirror/commands/formatting.js +1 -0
- package/dist/prosemirror/commands/formatting.mjs +1 -0
- package/dist/prosemirror/commands/index.d.mts +114 -0
- package/dist/prosemirror/commands/index.d.ts +114 -0
- package/dist/prosemirror/commands/index.js +1 -0
- package/dist/prosemirror/commands/index.mjs +1 -0
- package/dist/prosemirror/commands/pageBreak.d.mts +20 -0
- package/dist/prosemirror/commands/pageBreak.d.ts +20 -0
- package/dist/prosemirror/commands/pageBreak.js +1 -0
- package/dist/prosemirror/commands/pageBreak.mjs +1 -0
- package/dist/prosemirror/commands/paragraph.d.mts +70 -0
- package/dist/prosemirror/commands/paragraph.d.ts +70 -0
- package/dist/prosemirror/commands/paragraph.js +1 -0
- package/dist/prosemirror/commands/paragraph.mjs +1 -0
- package/dist/prosemirror/conversion/fromProseDoc.d.mts +66 -0
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +66 -0
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -0
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -0
- package/dist/prosemirror/conversion/index.d.mts +78 -0
- package/dist/prosemirror/conversion/index.d.ts +78 -0
- package/dist/prosemirror/conversion/index.js +1 -0
- package/dist/prosemirror/conversion/index.mjs +1 -0
- package/dist/prosemirror/editor.css +763 -0
- package/dist/prosemirror/extensions/index.d.mts +79 -0
- package/dist/prosemirror/extensions/index.d.ts +79 -0
- package/dist/prosemirror/extensions/index.js +1 -0
- package/dist/prosemirror/extensions/index.mjs +1 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.d.mts +30 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +30 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.mjs +1 -0
- package/dist/prosemirror/index.d.mts +71 -0
- package/dist/prosemirror/index.d.ts +71 -0
- package/dist/prosemirror/index.js +1 -0
- package/dist/prosemirror/index.mjs +1 -0
- package/dist/prosemirror/plugins/index.d.mts +50 -0
- package/dist/prosemirror/plugins/index.d.ts +50 -0
- package/dist/prosemirror/plugins/index.js +1 -0
- package/dist/prosemirror/plugins/index.mjs +1 -0
- package/dist/prosemirror/plugins/selectionTracker.d.mts +78 -0
- package/dist/prosemirror/plugins/selectionTracker.d.ts +78 -0
- package/dist/prosemirror/plugins/selectionTracker.js +1 -0
- package/dist/prosemirror/plugins/selectionTracker.mjs +1 -0
- package/dist/prosemirror/schema/index.d.mts +30 -0
- package/dist/prosemirror/schema/index.d.ts +30 -0
- package/dist/prosemirror/schema/index.js +1 -0
- package/dist/prosemirror/schema/index.mjs +1 -0
- package/dist/prosemirror/styles/index.d.mts +124 -0
- package/dist/prosemirror/styles/index.d.ts +124 -0
- package/dist/prosemirror/styles/index.js +1 -0
- package/dist/prosemirror/styles/index.mjs +1 -0
- package/dist/prosemirror/template/prosemirror-plugin.d.mts +66 -0
- package/dist/prosemirror/template/prosemirror-plugin.d.ts +66 -0
- package/dist/prosemirror/template/prosemirror-plugin.js +15 -0
- package/dist/prosemirror/template/prosemirror-plugin.mjs +15 -0
- package/dist/prosemirror/utils/ClickPositionResolver.d.mts +109 -0
- package/dist/prosemirror/utils/ClickPositionResolver.d.ts +109 -0
- package/dist/prosemirror/utils/ClickPositionResolver.js +1 -0
- package/dist/prosemirror/utils/ClickPositionResolver.mjs +1 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.d.mts +81 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.d.ts +81 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.js +1 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.mjs +1 -0
- package/dist/prosemirror/utils/PointerEventHandler.d.mts +94 -0
- package/dist/prosemirror/utils/PointerEventHandler.d.ts +94 -0
- package/dist/prosemirror/utils/PointerEventHandler.js +1 -0
- package/dist/prosemirror/utils/PointerEventHandler.mjs +1 -0
- package/dist/prosemirror/utils/extractTrackedChanges.d.mts +63 -0
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +63 -0
- package/dist/prosemirror/utils/extractTrackedChanges.js +1 -0
- package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -0
- package/dist/prosemirror/utils/visualLineNavigation.d.mts +45 -0
- package/dist/prosemirror/utils/visualLineNavigation.d.ts +45 -0
- package/dist/prosemirror/utils/visualLineNavigation.js +1 -0
- package/dist/prosemirror/utils/visualLineNavigation.mjs +1 -0
- package/dist/registry-Cpyybgij.d.mts +165 -0
- package/dist/registry-E5pahPKL.d.ts +165 -0
- package/dist/selectionContext-85CE0f7a.d.ts +570 -0
- package/dist/selectionContext-Xq3AY7pn.d.mts +570 -0
- package/dist/selectiveSave-CWaPEv0B.d.ts +31 -0
- package/dist/selectiveSave-jinP_4xa.d.mts +31 -0
- package/dist/selectiveXmlPatch-ypkxlTD_.d.mts +23 -0
- package/dist/selectiveXmlPatch-ypkxlTD_.d.ts +23 -0
- package/dist/styles-BBoqh07F.d.mts +233 -0
- package/dist/styles-jqO45PSq.d.ts +233 -0
- package/dist/table-P8esKWAc.d.ts +82 -0
- package/dist/table-_t_W8oQf.d.mts +82 -0
- package/dist/types/agentApi.d.mts +467 -0
- package/dist/types/agentApi.d.ts +467 -0
- package/dist/types/agentApi.js +1 -0
- package/dist/types/agentApi.mjs +1 -0
- package/dist/types/content.d.mts +1181 -0
- package/dist/types/content.d.ts +1181 -0
- package/dist/types/content.js +1 -0
- package/dist/types/content.mjs +0 -0
- package/dist/types/document.d.mts +106 -0
- package/dist/types/document.d.ts +106 -0
- package/dist/types/document.js +1 -0
- package/dist/types/document.mjs +0 -0
- package/dist/types-DXG7vqe9.d.ts +311 -0
- package/dist/types-RchZmPFN.d.mts +137 -0
- package/dist/types-RchZmPFN.d.ts +137 -0
- package/dist/types-dYdjUZMo.d.mts +311 -0
- package/dist/utils/cardStyles.d.mts +31 -0
- package/dist/utils/cardStyles.d.ts +31 -0
- package/dist/utils/cardStyles.js +1 -0
- package/dist/utils/cardStyles.mjs +1 -0
- package/dist/utils/comments.d.mts +48 -0
- package/dist/utils/comments.d.ts +48 -0
- package/dist/utils/comments.js +1 -0
- package/dist/utils/comments.mjs +1 -0
- package/dist/utils/findReplace.d.mts +114 -0
- package/dist/utils/findReplace.d.ts +114 -0
- package/dist/utils/findReplace.js +2 -0
- package/dist/utils/findReplace.mjs +2 -0
- package/dist/utils/findVerticalScrollParent.d.mts +25 -0
- package/dist/utils/findVerticalScrollParent.d.ts +25 -0
- package/dist/utils/findVerticalScrollParent.js +1 -0
- package/dist/utils/findVerticalScrollParent.mjs +1 -0
- package/dist/utils/fontOptions.d.mts +21 -0
- package/dist/utils/fontOptions.d.ts +21 -0
- package/dist/utils/fontOptions.js +1 -0
- package/dist/utils/fontOptions.mjs +1 -0
- package/dist/utils/headingCollector.d.mts +32 -0
- package/dist/utils/headingCollector.d.ts +32 -0
- package/dist/utils/headingCollector.js +1 -0
- package/dist/utils/headingCollector.mjs +1 -0
- package/dist/utils/highlightColors.d.mts +14 -0
- package/dist/utils/highlightColors.d.ts +14 -0
- package/dist/utils/highlightColors.js +1 -0
- package/dist/utils/highlightColors.mjs +1 -0
- package/dist/utils/index.d.mts +711 -0
- package/dist/utils/index.d.ts +711 -0
- package/dist/utils/index.js +82 -0
- package/dist/utils/index.mjs +82 -0
- package/dist/utils/listState.d.mts +27 -0
- package/dist/utils/listState.d.ts +27 -0
- package/dist/utils/listState.js +1 -0
- package/dist/utils/listState.mjs +1 -0
- package/dist/utils/reportIssue.d.mts +23 -0
- package/dist/utils/reportIssue.d.ts +23 -0
- package/dist/utils/reportIssue.js +2 -0
- package/dist/utils/reportIssue.mjs +2 -0
- package/dist/utils/sidebarConstants.d.mts +10 -0
- package/dist/utils/sidebarConstants.d.ts +10 -0
- package/dist/utils/sidebarConstants.js +1 -0
- package/dist/utils/sidebarConstants.mjs +1 -0
- package/dist/utils/textSelection.d.mts +92 -0
- package/dist/utils/textSelection.d.ts +92 -0
- package/dist/utils/textSelection.js +1 -0
- package/dist/utils/textSelection.mjs +1 -0
- package/dist/utils/units.d.mts +91 -0
- package/dist/utils/units.d.ts +91 -0
- package/dist/utils/units.js +1 -0
- package/dist/utils/units.mjs +1 -0
- package/dist/variableDetector-CAdt8yOr.d.mts +115 -0
- package/dist/variableDetector-W4XEN9YC.d.ts +115 -0
- package/package.json +565 -0
|
@@ -0,0 +1,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 };
|
|
@@ -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.js';
|
|
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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkWLKRUBY4_js=require('../../chunk-WLKRUBY4.js'),chunkDC7S76ZX_js=require('../../chunk-DC7S76ZX.js');var s,p,a,C,u,d,S,L,v,b,E,g,P,n,I,N,w,T,U,Y,_,f,k=class k{constructor(e){chunkDC7S76ZX_js.c(this,n);chunkDC7S76ZX_js.c(this,s);chunkDC7S76ZX_js.c(this,p);chunkDC7S76ZX_js.c(this,a,null);chunkDC7S76ZX_js.c(this,C);chunkDC7S76ZX_js.c(this,u,false);chunkDC7S76ZX_js.c(this,d,null);chunkDC7S76ZX_js.c(this,S,0);chunkDC7S76ZX_js.c(this,L,null);chunkDC7S76ZX_js.c(this,v,0);chunkDC7S76ZX_js.c(this,b);chunkDC7S76ZX_js.c(this,E);chunkDC7S76ZX_js.c(this,g);chunkDC7S76ZX_js.c(this,P);chunkDC7S76ZX_js.d(this,s,e.editor),chunkDC7S76ZX_js.d(this,p,e.positionResolver),chunkDC7S76ZX_js.d(this,C,e.onInput),chunkDC7S76ZX_js.d(this,b,chunkDC7S76ZX_js.e(this,n,N).bind(this)),chunkDC7S76ZX_js.d(this,E,chunkDC7S76ZX_js.e(this,n,w).bind(this)),chunkDC7S76ZX_js.d(this,g,chunkDC7S76ZX_js.e(this,n,T).bind(this)),chunkDC7S76ZX_js.d(this,P,chunkDC7S76ZX_js.e(this,n,U).bind(this));}attach(e){chunkDC7S76ZX_js.d(this,a,e),e.addEventListener("pointerdown",chunkDC7S76ZX_js.b(this,b)),e.addEventListener("pointermove",chunkDC7S76ZX_js.b(this,E)),e.addEventListener("pointerup",chunkDC7S76ZX_js.b(this,g)),e.addEventListener("pointerleave",chunkDC7S76ZX_js.b(this,P));}detach(){chunkDC7S76ZX_js.b(this,a)&&(chunkDC7S76ZX_js.b(this,a).removeEventListener("pointerdown",chunkDC7S76ZX_js.b(this,b)),chunkDC7S76ZX_js.b(this,a).removeEventListener("pointermove",chunkDC7S76ZX_js.b(this,E)),chunkDC7S76ZX_js.b(this,a).removeEventListener("pointerup",chunkDC7S76ZX_js.b(this,g)),chunkDC7S76ZX_js.b(this,a).removeEventListener("pointerleave",chunkDC7S76ZX_js.b(this,P)),chunkDC7S76ZX_js.d(this,a,null));}setPositionResolver(e){chunkDC7S76ZX_js.d(this,p,e);}isDragging(){return chunkDC7S76ZX_js.b(this,u)}getDragAnchor(){return chunkDC7S76ZX_js.b(this,d)}cancelDrag(){chunkDC7S76ZX_js.d(this,u,false),chunkDC7S76ZX_js.d(this,d,null);}};s=new WeakMap,p=new WeakMap,a=new WeakMap,C=new WeakMap,u=new WeakMap,d=new WeakMap,S=new WeakMap,L=new WeakMap,v=new WeakMap,b=new WeakMap,E=new WeakMap,g=new WeakMap,P=new WeakMap,n=new WeakSet,I=function(e,i){return chunkDC7S76ZX_js.b(this,p).getPositionAtPoint(e,i)?.pmPosition??null},N=function(e){if(e.button!==0)return;chunkDC7S76ZX_js.b(this,s).focus();let i=chunkDC7S76ZX_js.e(this,n,I).call(this,e.clientX,e.clientY);if(i===null)return;let h=Date.now();if(h-chunkDC7S76ZX_js.b(this,S)<k.MULTI_CLICK_DELAY&&chunkDC7S76ZX_js.b(this,L)===i?chunkDC7S76ZX_js.f(this,v)._++:chunkDC7S76ZX_js.d(this,v,1),chunkDC7S76ZX_js.d(this,S,h),chunkDC7S76ZX_js.d(this,L,i),chunkDC7S76ZX_js.b(this,v)===1){if(e.shiftKey){let m=chunkDC7S76ZX_js.b(this,s).getSelection();m?chunkDC7S76ZX_js.b(this,s).setSelectionRange(m.from,i):chunkDC7S76ZX_js.b(this,s).setSelection(i);}else chunkDC7S76ZX_js.b(this,s).setSelection(i);chunkDC7S76ZX_js.d(this,u,true),chunkDC7S76ZX_js.d(this,d,i),chunkDC7S76ZX_js.e(this,n,f).call(this,{type:"click",position:i}),chunkDC7S76ZX_js.e(this,n,f).call(this,{type:"dragStart",position:i});}else chunkDC7S76ZX_js.b(this,v)===2?(chunkDC7S76ZX_js.e(this,n,Y).call(this,i),chunkDC7S76ZX_js.e(this,n,f).call(this,{type:"doubleClick",position:i})):chunkDC7S76ZX_js.b(this,v)>=3&&(chunkDC7S76ZX_js.e(this,n,_).call(this,i),chunkDC7S76ZX_js.e(this,n,f).call(this,{type:"tripleClick",position:i}),chunkDC7S76ZX_js.d(this,v,0));},w=function(e){if(!chunkDC7S76ZX_js.b(this,u)||chunkDC7S76ZX_js.b(this,d)===null)return;let i=chunkDC7S76ZX_js.e(this,n,I).call(this,e.clientX,e.clientY);if(i===null)return;let h=Math.min(chunkDC7S76ZX_js.b(this,d),i),c=Math.max(chunkDC7S76ZX_js.b(this,d),i);chunkDC7S76ZX_js.b(this,s).setSelectionRange(h,c),chunkDC7S76ZX_js.e(this,n,f).call(this,{type:"drag",from:h,to:c});},T=function(e){if(chunkDC7S76ZX_js.b(this,u)){let i=chunkDC7S76ZX_js.b(this,s).getSelection();chunkDC7S76ZX_js.e(this,n,f).call(this,{type:"dragEnd",from:i?.from,to:i?.to});}chunkDC7S76ZX_js.d(this,u,false);},U=function(e){},Y=function(e){let i=chunkDC7S76ZX_js.b(this,p).getElementAtPosition(e);if(!i){chunkDC7S76ZX_js.b(this,s).setSelection(e);return}let h=i.textContent||"",c=Number(i.dataset.pmStart)||0,m=e-c,[H,K]=chunkWLKRUBY4_js.c(h,m),R=c+H,y=c+K;R<y?chunkDC7S76ZX_js.b(this,s).setSelectionRange(R,y):chunkDC7S76ZX_js.b(this,s).setSelection(e);},_=function(e){let i=chunkDC7S76ZX_js.b(this,p).getElementAtPosition(e);if(!i){chunkDC7S76ZX_js.b(this,s).setSelection(e);return}let h=i.closest(".layout-paragraph");if(!h){chunkDC7S76ZX_js.b(this,s).setSelection(e);return}let c=Number(h.dataset.pmStart),m=Number(h.dataset.pmEnd);!isNaN(c)&&!isNaN(m)&&c<m?chunkDC7S76ZX_js.b(this,s).setSelectionRange(c,m):chunkDC7S76ZX_js.b(this,s).setSelection(e);},f=function(e){var i;(i=chunkDC7S76ZX_js.b(this,C))==null||i.call(this,e);},chunkDC7S76ZX_js.a(k,"MULTI_CLICK_DELAY",500);var A=k;exports.PointerEventHandler=A;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c as c$1}from'../../chunk-OBMN4VSM.mjs';import {a as a$1,c,d as d$1,e,b as b$1,f as f$1}from'../../chunk-QYUPLKLP.mjs';var s,p,a,C,u,d,S,L,v,b,E,g,P,n,I,N,w,T,U,Y,_,f,k=class k{constructor(e$1){c(this,n);c(this,s);c(this,p);c(this,a,null);c(this,C);c(this,u,false);c(this,d,null);c(this,S,0);c(this,L,null);c(this,v,0);c(this,b);c(this,E);c(this,g);c(this,P);d$1(this,s,e$1.editor),d$1(this,p,e$1.positionResolver),d$1(this,C,e$1.onInput),d$1(this,b,e(this,n,N).bind(this)),d$1(this,E,e(this,n,w).bind(this)),d$1(this,g,e(this,n,T).bind(this)),d$1(this,P,e(this,n,U).bind(this));}attach(e){d$1(this,a,e),e.addEventListener("pointerdown",b$1(this,b)),e.addEventListener("pointermove",b$1(this,E)),e.addEventListener("pointerup",b$1(this,g)),e.addEventListener("pointerleave",b$1(this,P));}detach(){b$1(this,a)&&(b$1(this,a).removeEventListener("pointerdown",b$1(this,b)),b$1(this,a).removeEventListener("pointermove",b$1(this,E)),b$1(this,a).removeEventListener("pointerup",b$1(this,g)),b$1(this,a).removeEventListener("pointerleave",b$1(this,P)),d$1(this,a,null));}setPositionResolver(e){d$1(this,p,e);}isDragging(){return b$1(this,u)}getDragAnchor(){return b$1(this,d)}cancelDrag(){d$1(this,u,false),d$1(this,d,null);}};s=new WeakMap,p=new WeakMap,a=new WeakMap,C=new WeakMap,u=new WeakMap,d=new WeakMap,S=new WeakMap,L=new WeakMap,v=new WeakMap,b=new WeakMap,E=new WeakMap,g=new WeakMap,P=new WeakMap,n=new WeakSet,I=function(e,i){return b$1(this,p).getPositionAtPoint(e,i)?.pmPosition??null},N=function(e$1){if(e$1.button!==0)return;b$1(this,s).focus();let i=e(this,n,I).call(this,e$1.clientX,e$1.clientY);if(i===null)return;let h=Date.now();if(h-b$1(this,S)<k.MULTI_CLICK_DELAY&&b$1(this,L)===i?f$1(this,v)._++:d$1(this,v,1),d$1(this,S,h),d$1(this,L,i),b$1(this,v)===1){if(e$1.shiftKey){let m=b$1(this,s).getSelection();m?b$1(this,s).setSelectionRange(m.from,i):b$1(this,s).setSelection(i);}else b$1(this,s).setSelection(i);d$1(this,u,true),d$1(this,d,i),e(this,n,f).call(this,{type:"click",position:i}),e(this,n,f).call(this,{type:"dragStart",position:i});}else b$1(this,v)===2?(e(this,n,Y).call(this,i),e(this,n,f).call(this,{type:"doubleClick",position:i})):b$1(this,v)>=3&&(e(this,n,_).call(this,i),e(this,n,f).call(this,{type:"tripleClick",position:i}),d$1(this,v,0));},w=function(e$1){if(!b$1(this,u)||b$1(this,d)===null)return;let i=e(this,n,I).call(this,e$1.clientX,e$1.clientY);if(i===null)return;let h=Math.min(b$1(this,d),i),c=Math.max(b$1(this,d),i);b$1(this,s).setSelectionRange(h,c),e(this,n,f).call(this,{type:"drag",from:h,to:c});},T=function(e$1){if(b$1(this,u)){let i=b$1(this,s).getSelection();e(this,n,f).call(this,{type:"dragEnd",from:i?.from,to:i?.to});}d$1(this,u,false);},U=function(e){},Y=function(e){let i=b$1(this,p).getElementAtPosition(e);if(!i){b$1(this,s).setSelection(e);return}let h=i.textContent||"",c=Number(i.dataset.pmStart)||0,m=e-c,[H,K]=c$1(h,m),R=c+H,y=c+K;R<y?b$1(this,s).setSelectionRange(R,y):b$1(this,s).setSelection(e);},_=function(e){let i=b$1(this,p).getElementAtPosition(e);if(!i){b$1(this,s).setSelection(e);return}let h=i.closest(".layout-paragraph");if(!h){b$1(this,s).setSelection(e);return}let c=Number(h.dataset.pmStart),m=Number(h.dataset.pmEnd);!isNaN(c)&&!isNaN(m)&&c<m?b$1(this,s).setSelectionRange(c,m):b$1(this,s).setSelection(e);},f=function(e){var i;(i=b$1(this,C))==null||i.call(this,e);},a$1(k,"MULTI_CLICK_DELAY",500);var A=k;export{A as PointerEventHandler};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Walk the PM doc once and derive (a) the tracked-change list and (b) a
|
|
3
|
+
* comment→revision overlap map for threading. Adjacent entries from the
|
|
4
|
+
* same revision are merged; deletion+insertion pairs from the same
|
|
5
|
+
* author/date become a single `replacement` entry (matches Word's UX
|
|
6
|
+
* for replace ops).
|
|
7
|
+
*
|
|
8
|
+
* Pure function — no React, no Vue, no side effects. Single O(N) walk
|
|
9
|
+
* over text nodes. Lifted from packages/react/src/hooks/useTrackedChanges.ts
|
|
10
|
+
* so both adapters can call it directly.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* Tagged `@internal` post-1.0 cut. Both adapters re-export this through
|
|
14
|
+
* their own composables (`useTrackedChanges`); consumers should prefer
|
|
15
|
+
* those. The subpath stays in `package.json` `exports` for back-compat;
|
|
16
|
+
* expect it to move behind a public surface in a future major.
|
|
17
|
+
*
|
|
18
|
+
* @packageDocumentation
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
import { EditorState } from 'prosemirror-state';
|
|
22
|
+
import { TrackedChangeEntry } from '../../utils/comments.mjs';
|
|
23
|
+
import '../../types/content.mjs';
|
|
24
|
+
import '../../formatting-D9I-lFS4.mjs';
|
|
25
|
+
import '../../colors-C3vA7HUU.mjs';
|
|
26
|
+
import '../../docx/wrapTypes.mjs';
|
|
27
|
+
import '../../lists-JDB80qyP.mjs';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Walk the PM doc once and derive (a) the tracked-change list and (b) a
|
|
31
|
+
* comment→revision overlap map for threading. Adjacent entries from the
|
|
32
|
+
* same revision are merged; deletion+insertion pairs from the same
|
|
33
|
+
* author/date become a single `replacement` entry (matches Word's UX
|
|
34
|
+
* for replace ops).
|
|
35
|
+
*
|
|
36
|
+
* Pure function — no React, no Vue, no side effects. Single O(N) walk
|
|
37
|
+
* over text nodes. Lifted from packages/react/src/hooks/useTrackedChanges.ts
|
|
38
|
+
* so both adapters can call it directly.
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* Tagged `@internal` post-1.0 cut. Both adapters re-export this through
|
|
42
|
+
* their own composables (`useTrackedChanges`); consumers should prefer
|
|
43
|
+
* those. The subpath stays in `package.json` `exports` for back-compat;
|
|
44
|
+
* expect it to move behind a public surface in a future major.
|
|
45
|
+
*
|
|
46
|
+
* @packageDocumentation
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
interface TrackedChangesResult {
|
|
52
|
+
/** Tracked-change entries, sorted by document position, with adjacent same-revision entries merged. */
|
|
53
|
+
entries: TrackedChangeEntry[];
|
|
54
|
+
/**
|
|
55
|
+
* Map of `commentId -> revisionId` for comments whose range overlaps a tracked-change mark.
|
|
56
|
+
* Consumers (DocxEditor's threading effect) use this to thread comments under their tracked change.
|
|
57
|
+
*/
|
|
58
|
+
commentToRevision: Map<number, number>;
|
|
59
|
+
}
|
|
60
|
+
/** @internal */
|
|
61
|
+
declare function extractTrackedChanges(state: EditorState | null): TrackedChangesResult;
|
|
62
|
+
|
|
63
|
+
export { type TrackedChangesResult, extractTrackedChanges };
|