@notectl/core 2.0.2 → 2.0.4
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/README.md +258 -123
- package/dist/chunks/AlignmentPlugin-DGb1VtCU.mjs +2 -0
- package/dist/chunks/AlignmentPlugin-DGb1VtCU.mjs.map +1 -0
- package/dist/chunks/AttrRegistry-DvqbnJ6T.mjs +2 -0
- package/dist/chunks/AttrRegistry-DvqbnJ6T.mjs.map +1 -0
- package/dist/chunks/AttributedMarkCommands-BiJtiHpx.mjs +2 -0
- package/dist/chunks/AttributedMarkCommands-BiJtiHpx.mjs.map +1 -0
- package/dist/chunks/BlockInsertion-Q8B21SaG.mjs +2 -0
- package/dist/chunks/BlockInsertion-Q8B21SaG.mjs.map +1 -0
- package/dist/chunks/BlockTypePickerRegistry-5fFlS2i0.mjs +2 -0
- package/dist/chunks/BlockTypePickerRegistry-5fFlS2i0.mjs.map +1 -0
- package/dist/chunks/BlockquotePlugin-Dz8Pny1r.mjs +2 -0
- package/dist/chunks/BlockquotePlugin-Dz8Pny1r.mjs.map +1 -0
- package/dist/chunks/CaretNavigationPlugin-mQ1nxJ6m.mjs +2 -0
- package/dist/chunks/CaretNavigationPlugin-mQ1nxJ6m.mjs.map +1 -0
- package/dist/chunks/CodeBlockPlugin-oPGiMno0.mjs +2 -0
- package/dist/chunks/CodeBlockPlugin-oPGiMno0.mjs.map +1 -0
- package/dist/chunks/ColorGrid-CcF0bH26.mjs +2 -0
- package/dist/chunks/ColorGrid-CcF0bH26.mjs.map +1 -0
- package/dist/chunks/ColorPickerPopup-BZxMBDxy.mjs +2 -0
- package/dist/chunks/ColorPickerPopup-BZxMBDxy.mjs.map +1 -0
- package/dist/chunks/ColorValidation-rOrJxBBt.mjs +2 -0
- package/dist/chunks/ColorValidation-rOrJxBBt.mjs.map +1 -0
- package/dist/chunks/CommandHelpers-G6M-qXJR.mjs +2 -0
- package/dist/chunks/CommandHelpers-G6M-qXJR.mjs.map +1 -0
- package/dist/chunks/Commands-ByBjgD3-.mjs +2 -0
- package/dist/chunks/Commands-ByBjgD3-.mjs.map +1 -0
- package/dist/chunks/Decoration-D-yB-H5v.mjs +2 -0
- package/dist/chunks/Decoration-D-yB-H5v.mjs.map +1 -0
- package/dist/chunks/Document-DnPKbcPE.mjs +2 -0
- package/dist/chunks/Document-DnPKbcPE.mjs.map +1 -0
- package/dist/chunks/DocumentParser-KuBaEZN6.mjs +2 -0
- package/dist/chunks/DocumentParser-KuBaEZN6.mjs.map +1 -0
- package/dist/chunks/DocumentSerializer-DgdiJsES.mjs +2 -0
- package/dist/chunks/DocumentSerializer-DgdiJsES.mjs.map +1 -0
- package/dist/chunks/DomUtils-BkyCg-OO.mjs +2 -0
- package/dist/chunks/DomUtils-BkyCg-OO.mjs.map +1 -0
- package/dist/chunks/FontPlugin-DYntd3gN.mjs +2 -0
- package/dist/chunks/FontPlugin-DYntd3gN.mjs.map +1 -0
- package/dist/chunks/FontSizePlugin-CGlH-S6g.mjs +2 -0
- package/dist/chunks/FontSizePlugin-CGlH-S6g.mjs.map +1 -0
- package/dist/chunks/GapCursorNavigation-uytzcZ6C.mjs +2 -0
- package/dist/chunks/GapCursorNavigation-uytzcZ6C.mjs.map +1 -0
- package/dist/chunks/GapCursorPlugin-BQ2_-7i6.mjs +2 -0
- package/dist/chunks/GapCursorPlugin-BQ2_-7i6.mjs.map +1 -0
- package/dist/chunks/HTMLUtils-BLwp5G4f.mjs +2 -0
- package/dist/chunks/HTMLUtils-BLwp5G4f.mjs.map +1 -0
- package/dist/chunks/HardBreakPlugin-CCrP_Kec.mjs +2 -0
- package/dist/chunks/HardBreakPlugin-CCrP_Kec.mjs.map +1 -0
- package/dist/chunks/HeadingPlugin-BiDNuBmw.mjs +2 -0
- package/dist/chunks/HeadingPlugin-BiDNuBmw.mjs.map +1 -0
- package/dist/chunks/HighlightPlugin-CwrtRVfS.mjs +2 -0
- package/dist/chunks/HighlightPlugin-CwrtRVfS.mjs.map +1 -0
- package/dist/chunks/HorizontalRulePlugin-CKIkbVwn.mjs +2 -0
- package/dist/chunks/HorizontalRulePlugin-CKIkbVwn.mjs.map +1 -0
- package/dist/chunks/ImagePlugin-BqRAKlG1.mjs +2 -0
- package/dist/chunks/ImagePlugin-BqRAKlG1.mjs.map +1 -0
- package/dist/chunks/KeyboardNav-IMWHB6wc.mjs +2 -0
- package/dist/chunks/KeyboardNav-IMWHB6wc.mjs.map +1 -0
- package/dist/chunks/LinkPlugin-Cb2cpFe8.mjs +2 -0
- package/dist/chunks/LinkPlugin-Cb2cpFe8.mjs.map +1 -0
- package/dist/chunks/ListPlugin-CZgkinoS.mjs +2 -0
- package/dist/chunks/ListPlugin-CZgkinoS.mjs.map +1 -0
- package/dist/chunks/NavigationQueries-CgYPG6oY.mjs +2 -0
- package/dist/chunks/NavigationQueries-CgYPG6oY.mjs.map +1 -0
- package/dist/chunks/NodeResolver-BkOsZnuU.mjs +2 -0
- package/dist/chunks/NodeResolver-BkOsZnuU.mjs.map +1 -0
- package/dist/chunks/NodeSelectionCommands-U8xEdaE4.mjs +2 -0
- package/dist/chunks/NodeSelectionCommands-U8xEdaE4.mjs.map +1 -0
- package/dist/chunks/Platform-wPvKFB9m.mjs +2 -0
- package/dist/chunks/Platform-wPvKFB9m.mjs.map +1 -0
- package/dist/chunks/Plugin-C4cBw3bs.mjs +2 -0
- package/dist/chunks/Plugin-C4cBw3bs.mjs.map +1 -0
- package/dist/chunks/PluginHelpers-BZU5rE44.mjs +2 -0
- package/dist/chunks/PluginHelpers-BZU5rE44.mjs.map +1 -0
- package/dist/chunks/PopupManager-S2qQtTxR.mjs +2 -0
- package/dist/chunks/PopupManager-S2qQtTxR.mjs.map +1 -0
- package/dist/chunks/PopupPositioning-BdSCai19.mjs +2 -0
- package/dist/chunks/PopupPositioning-BdSCai19.mjs.map +1 -0
- package/dist/chunks/PrintPlugin-80SINLGF.mjs +2 -0
- package/dist/chunks/PrintPlugin-80SINLGF.mjs.map +1 -0
- package/dist/chunks/PrintTypes-CWIAfEaX.mjs +2 -0
- package/dist/chunks/PrintTypes-CWIAfEaX.mjs.map +1 -0
- package/dist/chunks/RangeIterator-DEuX1xKV.mjs +2 -0
- package/dist/chunks/RangeIterator-DEuX1xKV.mjs.map +1 -0
- package/dist/chunks/Selection-B14e7gd0.mjs +2 -0
- package/dist/chunks/Selection-B14e7gd0.mjs.map +1 -0
- package/dist/chunks/ShortcutFormatting-c0IajwWG.mjs +2 -0
- package/dist/chunks/ShortcutFormatting-c0IajwWG.mjs.map +1 -0
- package/dist/chunks/SmartPastePlugin-BvYBbHSA.mjs +2 -0
- package/dist/chunks/SmartPastePlugin-BvYBbHSA.mjs.map +1 -0
- package/dist/chunks/StrikethroughPlugin-XBOGv5Oi.mjs +2 -0
- package/dist/chunks/StrikethroughPlugin-XBOGv5Oi.mjs.map +1 -0
- package/dist/chunks/StyleRuntime-Bwde5icB.mjs +2 -0
- package/dist/chunks/StyleRuntime-Bwde5icB.mjs.map +1 -0
- package/dist/chunks/SuperSubPlugin-CVjU4W9y.mjs +2 -0
- package/dist/chunks/SuperSubPlugin-CVjU4W9y.mjs.map +1 -0
- package/dist/chunks/SyntaxTokenTypes-CY2-rJCA.mjs +2 -0
- package/dist/chunks/SyntaxTokenTypes-CY2-rJCA.mjs.map +1 -0
- package/dist/chunks/TablePlugin-BHpp6h9H.mjs +2 -0
- package/dist/chunks/TablePlugin-BHpp6h9H.mjs.map +1 -0
- package/dist/chunks/TextColorPlugin-CGbyMGTr.mjs +2 -0
- package/dist/chunks/TextColorPlugin-CGbyMGTr.mjs.map +1 -0
- package/dist/chunks/TextDirectionCorePlugin-DPU7wy6g.mjs +2 -0
- package/dist/chunks/TextDirectionCorePlugin-DPU7wy6g.mjs.map +1 -0
- package/dist/chunks/TextDirectionLocale-DxOfFixh.mjs +2 -0
- package/dist/chunks/TextDirectionLocale-DxOfFixh.mjs.map +1 -0
- package/dist/chunks/TextFormattingPlugin-CYVnhHH4.mjs +2 -0
- package/dist/chunks/TextFormattingPlugin-CYVnhHH4.mjs.map +1 -0
- package/dist/chunks/ToolbarPlugin-CWDkWXE8.mjs +2 -0
- package/dist/chunks/ToolbarPlugin-CWDkWXE8.mjs.map +1 -0
- package/dist/chunks/TypeBrands-BQR8dEYU.mjs +2 -0
- package/dist/chunks/TypeBrands-BQR8dEYU.mjs.map +1 -0
- package/dist/chunks/WordBoundary-BkxXn2JA.mjs +2 -0
- package/dist/chunks/WordBoundary-BkxXn2JA.mjs.map +1 -0
- package/dist/chunks/XmlDetector-BiWxa0RJ.mjs +2 -0
- package/dist/chunks/XmlDetector-BiWxa0RJ.mjs.map +1 -0
- package/dist/chunks/XmlPatterns-B-V-mHF4.mjs +2 -0
- package/dist/chunks/XmlPatterns-B-V-mHF4.mjs.map +1 -0
- package/dist/chunks/XmlSupport-Czr8xQB1.mjs +2 -0
- package/dist/chunks/XmlSupport-Czr8xQB1.mjs.map +1 -0
- package/dist/chunks/ar-BARk0vUs.mjs +2 -0
- package/dist/chunks/ar-BARk0vUs.mjs.map +1 -0
- package/dist/chunks/ar-BVnwjtBO.mjs +2 -0
- package/dist/chunks/ar-BVnwjtBO.mjs.map +1 -0
- package/dist/chunks/ar-BaLVMaVO.mjs +2 -0
- package/dist/chunks/ar-BaLVMaVO.mjs.map +1 -0
- package/dist/chunks/ar-BbXyJVxi.mjs +2 -0
- package/dist/chunks/ar-BbXyJVxi.mjs.map +1 -0
- package/dist/chunks/ar-Bj_U3O6Y.mjs +2 -0
- package/dist/chunks/ar-Bj_U3O6Y.mjs.map +1 -0
- package/dist/chunks/ar-CLEiZlfu.mjs +2 -0
- package/dist/chunks/ar-CLEiZlfu.mjs.map +1 -0
- package/dist/chunks/ar-CaE825oi.mjs +2 -0
- package/dist/chunks/ar-CaE825oi.mjs.map +1 -0
- package/dist/chunks/ar-CaRHAfkM.mjs +2 -0
- package/dist/chunks/ar-CaRHAfkM.mjs.map +1 -0
- package/dist/chunks/ar-Cg1wGAxo.mjs +2 -0
- package/dist/chunks/ar-Cg1wGAxo.mjs.map +1 -0
- package/dist/chunks/ar-Cp9qv7la.mjs +2 -0
- package/dist/chunks/ar-Cp9qv7la.mjs.map +1 -0
- package/dist/chunks/ar-CpZXocgF.mjs +2 -0
- package/dist/chunks/ar-CpZXocgF.mjs.map +1 -0
- package/dist/chunks/ar-CqD9pUY0.mjs +2 -0
- package/dist/chunks/ar-CqD9pUY0.mjs.map +1 -0
- package/dist/chunks/ar-D1DiKwV_.mjs +2 -0
- package/dist/chunks/ar-D1DiKwV_.mjs.map +1 -0
- package/dist/chunks/ar-D714r_62.mjs +2 -0
- package/dist/chunks/ar-D714r_62.mjs.map +1 -0
- package/dist/chunks/ar-D8hT58sd.mjs +2 -0
- package/dist/chunks/ar-D8hT58sd.mjs.map +1 -0
- package/dist/chunks/ar-DYA1zADy.mjs +2 -0
- package/dist/chunks/ar-DYA1zADy.mjs.map +1 -0
- package/dist/chunks/ar-Dc2VufjD.mjs +2 -0
- package/dist/chunks/ar-Dc2VufjD.mjs.map +1 -0
- package/dist/chunks/ar-DsmIDxDt.mjs +2 -0
- package/dist/chunks/ar-DsmIDxDt.mjs.map +1 -0
- package/dist/chunks/ar-M3QzJIS8.mjs +2 -0
- package/dist/chunks/ar-M3QzJIS8.mjs.map +1 -0
- package/dist/chunks/ar-UKi-TYFz.mjs +2 -0
- package/dist/chunks/ar-UKi-TYFz.mjs.map +1 -0
- package/dist/chunks/ar-UfrdJzT6.mjs +2 -0
- package/dist/chunks/ar-UfrdJzT6.mjs.map +1 -0
- package/dist/chunks/ar-fGsuiCw5.mjs +2 -0
- package/dist/chunks/ar-fGsuiCw5.mjs.map +1 -0
- package/dist/chunks/ar-fSElw9mJ.mjs +2 -0
- package/dist/chunks/ar-fSElw9mJ.mjs.map +1 -0
- package/dist/chunks/color-picker-iPmE48jm.mjs +2 -0
- package/dist/chunks/color-picker-iPmE48jm.mjs.map +1 -0
- package/dist/chunks/de-B4BcTYnc.mjs +2 -0
- package/dist/chunks/de-B4BcTYnc.mjs.map +1 -0
- package/dist/chunks/de-B7H06L3l.mjs +2 -0
- package/dist/chunks/de-B7H06L3l.mjs.map +1 -0
- package/dist/chunks/de-BWk2-9In.mjs +2 -0
- package/dist/chunks/de-BWk2-9In.mjs.map +1 -0
- package/dist/chunks/de-ByDTr_of.mjs +2 -0
- package/dist/chunks/de-ByDTr_of.mjs.map +1 -0
- package/dist/chunks/de-C5If_e7l.mjs +2 -0
- package/dist/chunks/de-C5If_e7l.mjs.map +1 -0
- package/dist/chunks/de-CAmM7IT5.mjs +2 -0
- package/dist/chunks/de-CAmM7IT5.mjs.map +1 -0
- package/dist/chunks/de-CF7zshOE.mjs +2 -0
- package/dist/chunks/de-CF7zshOE.mjs.map +1 -0
- package/dist/chunks/de-CXAESa_f.mjs +2 -0
- package/dist/chunks/de-CXAESa_f.mjs.map +1 -0
- package/dist/chunks/de-ChvJQZeC.mjs +2 -0
- package/dist/chunks/de-ChvJQZeC.mjs.map +1 -0
- package/dist/chunks/de-ClJaNWJr.mjs +2 -0
- package/dist/chunks/de-ClJaNWJr.mjs.map +1 -0
- package/dist/chunks/de-CpNFM0EP.mjs +2 -0
- package/dist/chunks/de-CpNFM0EP.mjs.map +1 -0
- package/dist/chunks/de-CwSQIBLx.mjs +2 -0
- package/dist/chunks/de-CwSQIBLx.mjs.map +1 -0
- package/dist/chunks/de-D3lxYgJa.mjs +2 -0
- package/dist/chunks/de-D3lxYgJa.mjs.map +1 -0
- package/dist/chunks/de-D8gRtvU4.mjs +2 -0
- package/dist/chunks/de-D8gRtvU4.mjs.map +1 -0
- package/dist/chunks/de-D_9IOrAk.mjs +2 -0
- package/dist/chunks/de-D_9IOrAk.mjs.map +1 -0
- package/dist/chunks/de-DcwZkO0v.mjs +2 -0
- package/dist/chunks/de-DcwZkO0v.mjs.map +1 -0
- package/dist/chunks/de-DeSVCxbd.mjs +2 -0
- package/dist/chunks/de-DeSVCxbd.mjs.map +1 -0
- package/dist/chunks/de-DqxnR2Y8.mjs +2 -0
- package/dist/chunks/de-DqxnR2Y8.mjs.map +1 -0
- package/dist/chunks/de-J82qPFkV.mjs +2 -0
- package/dist/chunks/de-J82qPFkV.mjs.map +1 -0
- package/dist/chunks/de-QDbUiCAO.mjs +2 -0
- package/dist/chunks/de-QDbUiCAO.mjs.map +1 -0
- package/dist/chunks/de-eAQXJdL9.mjs +2 -0
- package/dist/chunks/de-eAQXJdL9.mjs.map +1 -0
- package/dist/chunks/de-hneXQd4z.mjs +2 -0
- package/dist/chunks/de-hneXQd4z.mjs.map +1 -0
- package/dist/chunks/de-wXAi5Jyt.mjs +2 -0
- package/dist/chunks/de-wXAi5Jyt.mjs.map +1 -0
- package/dist/chunks/es-5c_5O95N.mjs +2 -0
- package/dist/chunks/es-5c_5O95N.mjs.map +1 -0
- package/dist/chunks/es-B2QB6DHA.mjs +2 -0
- package/dist/chunks/es-B2QB6DHA.mjs.map +1 -0
- package/dist/chunks/es-BEcu8DtV.mjs +2 -0
- package/dist/chunks/es-BEcu8DtV.mjs.map +1 -0
- package/dist/chunks/es-BXTkzYVW.mjs +2 -0
- package/dist/chunks/es-BXTkzYVW.mjs.map +1 -0
- package/dist/chunks/es-BemQV8dI.mjs +2 -0
- package/dist/chunks/es-BemQV8dI.mjs.map +1 -0
- package/dist/chunks/es-BfJM5zJ5.mjs +2 -0
- package/dist/chunks/es-BfJM5zJ5.mjs.map +1 -0
- package/dist/chunks/es-CnqxzYfU.mjs +2 -0
- package/dist/chunks/es-CnqxzYfU.mjs.map +1 -0
- package/dist/chunks/es-CrZtAd3-.mjs +2 -0
- package/dist/chunks/es-CrZtAd3-.mjs.map +1 -0
- package/dist/chunks/es-CsCCy0S5.mjs +2 -0
- package/dist/chunks/es-CsCCy0S5.mjs.map +1 -0
- package/dist/chunks/es-D62AfyHC.mjs +2 -0
- package/dist/chunks/es-D62AfyHC.mjs.map +1 -0
- package/dist/chunks/es-DA_zUbSs.mjs +2 -0
- package/dist/chunks/es-DA_zUbSs.mjs.map +1 -0
- package/dist/chunks/es-DFCDhXJb.mjs +2 -0
- package/dist/chunks/es-DFCDhXJb.mjs.map +1 -0
- package/dist/chunks/es-DHMIpSfB.mjs +2 -0
- package/dist/chunks/es-DHMIpSfB.mjs.map +1 -0
- package/dist/chunks/es-DIH9KVn1.mjs +2 -0
- package/dist/chunks/es-DIH9KVn1.mjs.map +1 -0
- package/dist/chunks/es-DOHIPZYT.mjs +2 -0
- package/dist/chunks/es-DOHIPZYT.mjs.map +1 -0
- package/dist/chunks/es-DPyejgTk.mjs +2 -0
- package/dist/chunks/es-DPyejgTk.mjs.map +1 -0
- package/dist/chunks/es-DUVk_Wkc.mjs +2 -0
- package/dist/chunks/es-DUVk_Wkc.mjs.map +1 -0
- package/dist/chunks/es-Di4t0cUf.mjs +2 -0
- package/dist/chunks/es-Di4t0cUf.mjs.map +1 -0
- package/dist/chunks/es-DjwvgN1j.mjs +2 -0
- package/dist/chunks/es-DjwvgN1j.mjs.map +1 -0
- package/dist/chunks/es-Nawgghri.mjs +2 -0
- package/dist/chunks/es-Nawgghri.mjs.map +1 -0
- package/dist/chunks/es-SuOzBFT7.mjs +2 -0
- package/dist/chunks/es-SuOzBFT7.mjs.map +1 -0
- package/dist/chunks/es-gB6GcNGB.mjs +2 -0
- package/dist/chunks/es-gB6GcNGB.mjs.map +1 -0
- package/dist/chunks/es-xSr9miNk.mjs +2 -0
- package/dist/chunks/es-xSr9miNk.mjs.map +1 -0
- package/dist/chunks/fonts-CG_dDwvT.mjs +2 -0
- package/dist/chunks/fonts-CG_dDwvT.mjs.map +1 -0
- package/dist/chunks/fr-B35gBW5Z.mjs +2 -0
- package/dist/chunks/fr-B35gBW5Z.mjs.map +1 -0
- package/dist/chunks/fr-BFngqWSa.mjs +2 -0
- package/dist/chunks/fr-BFngqWSa.mjs.map +1 -0
- package/dist/chunks/fr-BZRak2_s.mjs +2 -0
- package/dist/chunks/fr-BZRak2_s.mjs.map +1 -0
- package/dist/chunks/fr-Bj_GziCv.mjs +2 -0
- package/dist/chunks/fr-Bj_GziCv.mjs.map +1 -0
- package/dist/chunks/fr-BushvDBo.mjs +2 -0
- package/dist/chunks/fr-BushvDBo.mjs.map +1 -0
- package/dist/chunks/fr-Bz2JMdw5.mjs +2 -0
- package/dist/chunks/fr-Bz2JMdw5.mjs.map +1 -0
- package/dist/chunks/fr-C2y-quYa.mjs +2 -0
- package/dist/chunks/fr-C2y-quYa.mjs.map +1 -0
- package/dist/chunks/fr-C5g40qHr.mjs +2 -0
- package/dist/chunks/fr-C5g40qHr.mjs.map +1 -0
- package/dist/chunks/fr-CRPVlCtC.mjs +2 -0
- package/dist/chunks/fr-CRPVlCtC.mjs.map +1 -0
- package/dist/chunks/fr-Cf0xNw5j.mjs +2 -0
- package/dist/chunks/fr-Cf0xNw5j.mjs.map +1 -0
- package/dist/chunks/fr-Cr62KfH7.mjs +2 -0
- package/dist/chunks/fr-Cr62KfH7.mjs.map +1 -0
- package/dist/chunks/fr-D6XZTFJa.mjs +2 -0
- package/dist/chunks/fr-D6XZTFJa.mjs.map +1 -0
- package/dist/chunks/fr-D9u2mcht.mjs +2 -0
- package/dist/chunks/fr-D9u2mcht.mjs.map +1 -0
- package/dist/chunks/fr-DEWFKFrW.mjs +2 -0
- package/dist/chunks/fr-DEWFKFrW.mjs.map +1 -0
- package/dist/chunks/fr-DGBuhK3D.mjs +2 -0
- package/dist/chunks/fr-DGBuhK3D.mjs.map +1 -0
- package/dist/chunks/fr-DQBLPLlz.mjs +2 -0
- package/dist/chunks/fr-DQBLPLlz.mjs.map +1 -0
- package/dist/chunks/fr-DQM130Rf.mjs +2 -0
- package/dist/chunks/fr-DQM130Rf.mjs.map +1 -0
- package/dist/chunks/fr-Dg5SMkMo.mjs +2 -0
- package/dist/chunks/fr-Dg5SMkMo.mjs.map +1 -0
- package/dist/chunks/fr-Dv0GIx7Q.mjs +2 -0
- package/dist/chunks/fr-Dv0GIx7Q.mjs.map +1 -0
- package/dist/chunks/fr-DyGGhKFe.mjs +2 -0
- package/dist/chunks/fr-DyGGhKFe.mjs.map +1 -0
- package/dist/chunks/fr-DzQfRP8y.mjs +2 -0
- package/dist/chunks/fr-DzQfRP8y.mjs.map +1 -0
- package/dist/chunks/fr-SxdLDSEQ.mjs +2 -0
- package/dist/chunks/fr-SxdLDSEQ.mjs.map +1 -0
- package/dist/chunks/fr-VGC8qZxr.mjs +2 -0
- package/dist/chunks/fr-VGC8qZxr.mjs.map +1 -0
- package/dist/chunks/full-B-bw4M7L.mjs +2 -0
- package/dist/chunks/full-B-bw4M7L.mjs.map +1 -0
- package/dist/chunks/hi-8AQg9KKV.mjs +2 -0
- package/dist/chunks/hi-8AQg9KKV.mjs.map +1 -0
- package/dist/chunks/hi-B0EvMNl3.mjs +2 -0
- package/dist/chunks/hi-B0EvMNl3.mjs.map +1 -0
- package/dist/chunks/hi-B5sPMUNb.mjs +2 -0
- package/dist/chunks/hi-B5sPMUNb.mjs.map +1 -0
- package/dist/chunks/hi-BOfcnulc.mjs +2 -0
- package/dist/chunks/hi-BOfcnulc.mjs.map +1 -0
- package/dist/chunks/hi-BUveHWCk.mjs +2 -0
- package/dist/chunks/hi-BUveHWCk.mjs.map +1 -0
- package/dist/chunks/hi-BZ_n8-zx.mjs +2 -0
- package/dist/chunks/hi-BZ_n8-zx.mjs.map +1 -0
- package/dist/chunks/hi-BeLhPZ5d.mjs +2 -0
- package/dist/chunks/hi-BeLhPZ5d.mjs.map +1 -0
- package/dist/chunks/hi-Bg8jWcjX.mjs +2 -0
- package/dist/chunks/hi-Bg8jWcjX.mjs.map +1 -0
- package/dist/chunks/hi-BktVy4Yc.mjs +2 -0
- package/dist/chunks/hi-BktVy4Yc.mjs.map +1 -0
- package/dist/chunks/hi-Btg6DNgW.mjs +2 -0
- package/dist/chunks/hi-Btg6DNgW.mjs.map +1 -0
- package/dist/chunks/hi-C20PmckT.mjs +2 -0
- package/dist/chunks/hi-C20PmckT.mjs.map +1 -0
- package/dist/chunks/hi-C2DDsttW.mjs +2 -0
- package/dist/chunks/hi-C2DDsttW.mjs.map +1 -0
- package/dist/chunks/hi-CCDCfQV0.mjs +2 -0
- package/dist/chunks/hi-CCDCfQV0.mjs.map +1 -0
- package/dist/chunks/hi-CWX5sDy1.mjs +2 -0
- package/dist/chunks/hi-CWX5sDy1.mjs.map +1 -0
- package/dist/chunks/hi-ClSwgZfK.mjs +2 -0
- package/dist/chunks/hi-ClSwgZfK.mjs.map +1 -0
- package/dist/chunks/hi-D-apR3ri.mjs +2 -0
- package/dist/chunks/hi-D-apR3ri.mjs.map +1 -0
- package/dist/chunks/hi-D6ZQ_R6m.mjs +2 -0
- package/dist/chunks/hi-D6ZQ_R6m.mjs.map +1 -0
- package/dist/chunks/hi-D_rhcSL3.mjs +2 -0
- package/dist/chunks/hi-D_rhcSL3.mjs.map +1 -0
- package/dist/chunks/hi-DcA0CxZR.mjs +2 -0
- package/dist/chunks/hi-DcA0CxZR.mjs.map +1 -0
- package/dist/chunks/hi-Dd2GOD9r.mjs +2 -0
- package/dist/chunks/hi-Dd2GOD9r.mjs.map +1 -0
- package/dist/chunks/hi-DkEmvBok.mjs +2 -0
- package/dist/chunks/hi-DkEmvBok.mjs.map +1 -0
- package/dist/chunks/hi-nfmm9uwI.mjs +2 -0
- package/dist/chunks/hi-nfmm9uwI.mjs.map +1 -0
- package/dist/chunks/hi-wBX612X_.mjs +2 -0
- package/dist/chunks/hi-wBX612X_.mjs.map +1 -0
- package/dist/chunks/minimal-CMt909kl.mjs +2 -0
- package/dist/chunks/minimal-CMt909kl.mjs.map +1 -0
- package/dist/chunks/pt-BGQ7Sh6p.mjs +2 -0
- package/dist/chunks/pt-BGQ7Sh6p.mjs.map +1 -0
- package/dist/chunks/pt-BGQj9xok.mjs +2 -0
- package/dist/chunks/pt-BGQj9xok.mjs.map +1 -0
- package/dist/chunks/pt-BL5xNIhC.mjs +2 -0
- package/dist/chunks/pt-BL5xNIhC.mjs.map +1 -0
- package/dist/chunks/pt-BM8sUzpI.mjs +2 -0
- package/dist/chunks/pt-BM8sUzpI.mjs.map +1 -0
- package/dist/chunks/pt-BVLuZULN.mjs +2 -0
- package/dist/chunks/pt-BVLuZULN.mjs.map +1 -0
- package/dist/chunks/pt-BlGlrx3M.mjs +2 -0
- package/dist/chunks/pt-BlGlrx3M.mjs.map +1 -0
- package/dist/chunks/pt-CKaXK1FK.mjs +2 -0
- package/dist/chunks/pt-CKaXK1FK.mjs.map +1 -0
- package/dist/chunks/pt-CMpzmrVu.mjs +2 -0
- package/dist/chunks/pt-CMpzmrVu.mjs.map +1 -0
- package/dist/chunks/pt-Cw77qSTP.mjs +2 -0
- package/dist/chunks/pt-Cw77qSTP.mjs.map +1 -0
- package/dist/chunks/pt-DBNe2BiX.mjs +2 -0
- package/dist/chunks/pt-DBNe2BiX.mjs.map +1 -0
- package/dist/chunks/pt-DCfJFt-v.mjs +2 -0
- package/dist/chunks/pt-DCfJFt-v.mjs.map +1 -0
- package/dist/chunks/pt-DEs0I6eo.mjs +2 -0
- package/dist/chunks/pt-DEs0I6eo.mjs.map +1 -0
- package/dist/chunks/pt-DKONqS4g.mjs +2 -0
- package/dist/chunks/pt-DKONqS4g.mjs.map +1 -0
- package/dist/chunks/pt-DO4FbPvV.mjs +2 -0
- package/dist/chunks/pt-DO4FbPvV.mjs.map +1 -0
- package/dist/chunks/pt-DbDOQjV-.mjs +2 -0
- package/dist/chunks/pt-DbDOQjV-.mjs.map +1 -0
- package/dist/chunks/pt-DiYv0Ubf.mjs +2 -0
- package/dist/chunks/pt-DiYv0Ubf.mjs.map +1 -0
- package/dist/chunks/pt-Dk4Mr4yC.mjs +2 -0
- package/dist/chunks/pt-Dk4Mr4yC.mjs.map +1 -0
- package/dist/chunks/pt-DpLB51hL.mjs +2 -0
- package/dist/chunks/pt-DpLB51hL.mjs.map +1 -0
- package/dist/chunks/pt-Q5jXPjWo.mjs +2 -0
- package/dist/chunks/pt-Q5jXPjWo.mjs.map +1 -0
- package/dist/chunks/pt-kFy3gqNp.mjs +2 -0
- package/dist/chunks/pt-kFy3gqNp.mjs.map +1 -0
- package/dist/chunks/pt-ncNSxrVp.mjs +2 -0
- package/dist/chunks/pt-ncNSxrVp.mjs.map +1 -0
- package/dist/chunks/pt-tUVNk-7W.mjs +2 -0
- package/dist/chunks/pt-tUVNk-7W.mjs.map +1 -0
- package/dist/chunks/pt-zzij5vS0.mjs +2 -0
- package/dist/chunks/pt-zzij5vS0.mjs.map +1 -0
- package/dist/chunks/rolldown-runtime-B8Ku5yk6.mjs +1 -0
- package/dist/chunks/ru-B-XR4L6x.mjs +2 -0
- package/dist/chunks/ru-B-XR4L6x.mjs.map +1 -0
- package/dist/chunks/ru-B00ZXSqu.mjs +2 -0
- package/dist/chunks/ru-B00ZXSqu.mjs.map +1 -0
- package/dist/chunks/ru-B5wvkAtV.mjs +2 -0
- package/dist/chunks/ru-B5wvkAtV.mjs.map +1 -0
- package/dist/chunks/ru-BA5-gdMK.mjs +2 -0
- package/dist/chunks/ru-BA5-gdMK.mjs.map +1 -0
- package/dist/chunks/ru-BNTSKpWh.mjs +2 -0
- package/dist/chunks/ru-BNTSKpWh.mjs.map +1 -0
- package/dist/chunks/ru-BRy-L-TF.mjs +2 -0
- package/dist/chunks/ru-BRy-L-TF.mjs.map +1 -0
- package/dist/chunks/ru-BZrPeSDg.mjs +2 -0
- package/dist/chunks/ru-BZrPeSDg.mjs.map +1 -0
- package/dist/chunks/ru-B_8ujIHK.mjs +2 -0
- package/dist/chunks/ru-B_8ujIHK.mjs.map +1 -0
- package/dist/chunks/ru-BbgvH6r3.mjs +2 -0
- package/dist/chunks/ru-BbgvH6r3.mjs.map +1 -0
- package/dist/chunks/ru-CDm5R5CV.mjs +2 -0
- package/dist/chunks/ru-CDm5R5CV.mjs.map +1 -0
- package/dist/chunks/ru-CWLFWYwd.mjs +2 -0
- package/dist/chunks/ru-CWLFWYwd.mjs.map +1 -0
- package/dist/chunks/ru-CqsCwBQ_.mjs +2 -0
- package/dist/chunks/ru-CqsCwBQ_.mjs.map +1 -0
- package/dist/chunks/ru-CsFv_mi4.mjs +2 -0
- package/dist/chunks/ru-CsFv_mi4.mjs.map +1 -0
- package/dist/chunks/ru-Cv9Zbbn2.mjs +2 -0
- package/dist/chunks/ru-Cv9Zbbn2.mjs.map +1 -0
- package/dist/chunks/ru-CyTNK9dE.mjs +2 -0
- package/dist/chunks/ru-CyTNK9dE.mjs.map +1 -0
- package/dist/chunks/ru-DEkLlarB.mjs +2 -0
- package/dist/chunks/ru-DEkLlarB.mjs.map +1 -0
- package/dist/chunks/ru-DZge62_-.mjs +2 -0
- package/dist/chunks/ru-DZge62_-.mjs.map +1 -0
- package/dist/chunks/ru-DiVRD-Ds.mjs +2 -0
- package/dist/chunks/ru-DiVRD-Ds.mjs.map +1 -0
- package/dist/chunks/ru-DkP8YLYT.mjs +2 -0
- package/dist/chunks/ru-DkP8YLYT.mjs.map +1 -0
- package/dist/chunks/ru-OKZRZ5c-.mjs +2 -0
- package/dist/chunks/ru-OKZRZ5c-.mjs.map +1 -0
- package/dist/chunks/ru-aYY1QVJS.mjs +2 -0
- package/dist/chunks/ru-aYY1QVJS.mjs.map +1 -0
- package/dist/chunks/ru-ejPBB15H.mjs +2 -0
- package/dist/chunks/ru-ejPBB15H.mjs.map +1 -0
- package/dist/chunks/ru-tp62bXSj.mjs +2 -0
- package/dist/chunks/ru-tp62bXSj.mjs.map +1 -0
- package/dist/chunks/shared-DJ08jwra.mjs +2 -0
- package/dist/chunks/shared-DJ08jwra.mjs.map +1 -0
- package/dist/chunks/src-dxsvbiql.mjs +2 -0
- package/dist/chunks/src-dxsvbiql.mjs.map +1 -0
- package/dist/chunks/text-direction-advanced-B71gUwvk.mjs +2 -0
- package/dist/chunks/text-direction-advanced-B71gUwvk.mjs.map +1 -0
- package/dist/chunks/zh-2gEqF3OX.mjs +2 -0
- package/dist/chunks/zh-2gEqF3OX.mjs.map +1 -0
- package/dist/chunks/zh-B5J1sSsk.mjs +2 -0
- package/dist/chunks/zh-B5J1sSsk.mjs.map +1 -0
- package/dist/chunks/zh-B5LmYVQ2.mjs +2 -0
- package/dist/chunks/zh-B5LmYVQ2.mjs.map +1 -0
- package/dist/chunks/zh-BBOheLpv.mjs +2 -0
- package/dist/chunks/zh-BBOheLpv.mjs.map +1 -0
- package/dist/chunks/zh-BOy5F5Jq.mjs +2 -0
- package/dist/chunks/zh-BOy5F5Jq.mjs.map +1 -0
- package/dist/chunks/zh-BRlo0ayI.mjs +2 -0
- package/dist/chunks/zh-BRlo0ayI.mjs.map +1 -0
- package/dist/chunks/zh-BgTAzt6l.mjs +2 -0
- package/dist/chunks/zh-BgTAzt6l.mjs.map +1 -0
- package/dist/chunks/zh-BjY4TNQf.mjs +2 -0
- package/dist/chunks/zh-BjY4TNQf.mjs.map +1 -0
- package/dist/chunks/zh-BtD9NFJS.mjs +2 -0
- package/dist/chunks/zh-BtD9NFJS.mjs.map +1 -0
- package/dist/chunks/zh-BvSLqJFE.mjs +2 -0
- package/dist/chunks/zh-BvSLqJFE.mjs.map +1 -0
- package/dist/chunks/zh-C4rxe0Zk.mjs +2 -0
- package/dist/chunks/zh-C4rxe0Zk.mjs.map +1 -0
- package/dist/chunks/zh-CyX2tIRP.mjs +2 -0
- package/dist/chunks/zh-CyX2tIRP.mjs.map +1 -0
- package/dist/chunks/zh-D9QN2C7q.mjs +2 -0
- package/dist/chunks/zh-D9QN2C7q.mjs.map +1 -0
- package/dist/chunks/zh-DTnSCP1F.mjs +2 -0
- package/dist/chunks/zh-DTnSCP1F.mjs.map +1 -0
- package/dist/chunks/zh-DWlBkrGZ.mjs +2 -0
- package/dist/chunks/zh-DWlBkrGZ.mjs.map +1 -0
- package/dist/chunks/zh-DcY4Ouin.mjs +2 -0
- package/dist/chunks/zh-DcY4Ouin.mjs.map +1 -0
- package/dist/chunks/zh-DovMZIDF.mjs +2 -0
- package/dist/chunks/zh-DovMZIDF.mjs.map +1 -0
- package/dist/chunks/zh-DtzwqBHS.mjs +2 -0
- package/dist/chunks/zh-DtzwqBHS.mjs.map +1 -0
- package/dist/chunks/zh-DunJzfVR.mjs +2 -0
- package/dist/chunks/zh-DunJzfVR.mjs.map +1 -0
- package/dist/chunks/zh-Pd1HqYSs.mjs +2 -0
- package/dist/chunks/zh-Pd1HqYSs.mjs.map +1 -0
- package/dist/chunks/zh-Yvqfkdln.mjs +2 -0
- package/dist/chunks/zh-Yvqfkdln.mjs.map +1 -0
- package/dist/chunks/zh-Z9seusJc.mjs +2 -0
- package/dist/chunks/zh-Z9seusJc.mjs.map +1 -0
- package/dist/chunks/zh-fAa_AbWI.mjs +2 -0
- package/dist/chunks/zh-fAa_AbWI.mjs.map +1 -0
- package/dist/commands/CommandHelpers.d.ts +0 -2
- package/dist/commands/CommandHelpers.d.ts.map +1 -1
- package/dist/commands/Commands.d.ts +1 -1
- package/dist/commands/Commands.d.ts.map +1 -1
- package/dist/commands/GapCursorCommands.d.ts.map +1 -1
- package/dist/commands/NodeSelectionCommands.d.ts.map +1 -1
- package/dist/commands/RangeIterator.d.ts +6 -0
- package/dist/commands/RangeIterator.d.ts.map +1 -1
- package/dist/editor/EditorInitializer.d.ts.map +1 -1
- package/dist/editor/styles/code-block.d.ts +1 -1
- package/dist/editor/styles/code-block.d.ts.map +1 -1
- package/dist/editor/styles/color-picker.d.ts +1 -1
- package/dist/editor/styles/color-picker.d.ts.map +1 -1
- package/dist/editor/styles/font-size-select.d.ts +1 -1
- package/dist/editor/styles/font-size-select.d.ts.map +1 -1
- package/dist/editor/styles/image.d.ts +1 -1
- package/dist/editor/styles/image.d.ts.map +1 -1
- package/dist/editor/styles/table.d.ts +1 -1
- package/dist/editor/styles/table.d.ts.map +1 -1
- package/dist/editor/styles/toolbar.d.ts +1 -1
- package/dist/editor/styles/toolbar.d.ts.map +1 -1
- package/dist/editor/theme/SyntaxTokenTypes.d.ts +26 -0
- package/dist/editor/theme/SyntaxTokenTypes.d.ts.map +1 -0
- package/dist/editor/theme/ThemeEngine.d.ts.map +1 -1
- package/dist/editor/theme/ThemeTokens.d.ts +6 -16
- package/dist/editor/theme/ThemeTokens.d.ts.map +1 -1
- package/dist/fonts.mjs +1 -2
- package/dist/full.d.ts +1 -0
- package/dist/full.d.ts.map +1 -1
- package/dist/full.mjs +1 -2
- package/dist/html.mjs +1 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/model/Document.d.ts +2 -0
- package/dist/model/Document.d.ts.map +1 -1
- package/dist/model/KeymapRegistry.d.ts.map +1 -1
- package/dist/notectl-core.mjs +1 -2
- package/dist/notectl-core.umd.js +2 -2
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/alignment.mjs +1 -2
- package/dist/plugins/blockquote.mjs +1 -2
- package/dist/plugins/caret-navigation.mjs +1 -2
- package/dist/plugins/code-block/CodeBlockCommands.d.ts +5 -0
- package/dist/plugins/code-block/CodeBlockCommands.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockLocale.d.ts +2 -0
- package/dist/plugins/code-block/CodeBlockLocale.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockNodeView.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts +4 -0
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockTypes.d.ts +2 -1
- package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -1
- package/dist/plugins/code-block/highlighter/TokenizerTypes.d.ts +2 -4
- package/dist/plugins/code-block/highlighter/TokenizerTypes.d.ts.map +1 -1
- package/dist/plugins/code-block/highlighter/languages/index.d.ts +1 -0
- package/dist/plugins/code-block/highlighter/languages/index.d.ts.map +1 -1
- package/dist/plugins/code-block/highlighter/languages/java.d.ts +3 -0
- package/dist/plugins/code-block/highlighter/languages/java.d.ts.map +1 -0
- package/dist/plugins/code-block/highlighter/languages/xml.d.ts.map +1 -1
- package/dist/plugins/code-block/index.d.ts +1 -0
- package/dist/plugins/code-block/index.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/ar.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/de.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/es.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/fr.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/hi.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/pt.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/ru.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/zh.d.ts.map +1 -1
- package/dist/plugins/code-block.mjs +1 -2
- package/dist/plugins/font-size.mjs +1 -2
- package/dist/plugins/font.mjs +1 -2
- package/dist/plugins/gap-cursor.mjs +1 -2
- package/dist/plugins/hard-break.mjs +1 -2
- package/dist/plugins/heading.mjs +1 -2
- package/dist/plugins/highlight.mjs +1 -2
- package/dist/plugins/horizontal-rule.mjs +1 -2
- package/dist/plugins/image.mjs +1 -2
- package/dist/plugins/language/LanguageRegistry.d.ts +15 -0
- package/dist/plugins/language/LanguageRegistry.d.ts.map +1 -0
- package/dist/plugins/language/LanguageTypes.d.ts +54 -0
- package/dist/plugins/language/LanguageTypes.d.ts.map +1 -0
- package/dist/plugins/language/bundles/JavaSupport.d.ts +3 -0
- package/dist/plugins/language/bundles/JavaSupport.d.ts.map +1 -0
- package/dist/plugins/language/bundles/JsonSupport.d.ts +3 -0
- package/dist/plugins/language/bundles/JsonSupport.d.ts.map +1 -0
- package/dist/plugins/language/bundles/XmlSupport.d.ts +3 -0
- package/dist/plugins/language/bundles/XmlSupport.d.ts.map +1 -0
- package/dist/plugins/language/bundles/index.d.ts +4 -0
- package/dist/plugins/language/bundles/index.d.ts.map +1 -0
- package/dist/plugins/language/index.d.ts +4 -0
- package/dist/plugins/language/index.d.ts.map +1 -0
- package/dist/plugins/language.mjs +1 -0
- package/dist/plugins/link.mjs +1 -2
- package/dist/plugins/list/ListAttrsFactory.d.ts +5 -0
- package/dist/plugins/list/ListAttrsFactory.d.ts.map +1 -0
- package/dist/plugins/list/ListCommands.d.ts +13 -0
- package/dist/plugins/list/ListCommands.d.ts.map +1 -0
- package/dist/plugins/list/ListDefinitions.d.ts +9 -0
- package/dist/plugins/list/ListDefinitions.d.ts.map +1 -0
- package/dist/plugins/list/ListInputRules.d.ts +5 -0
- package/dist/plugins/list/ListInputRules.d.ts.map +1 -0
- package/dist/plugins/list/ListKeyboardHandlers.d.ts +4 -0
- package/dist/plugins/list/ListKeyboardHandlers.d.ts.map +1 -0
- package/dist/plugins/list/ListPlugin.d.ts +0 -22
- package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
- package/dist/plugins/list/ListToolbarItems.d.ts +6 -0
- package/dist/plugins/list/ListToolbarItems.d.ts.map +1 -0
- package/dist/plugins/list.mjs +1 -2
- package/dist/plugins/print/PrintContentPreparer.d.ts.map +1 -1
- package/dist/plugins/print.mjs +1 -2
- package/dist/plugins/shared/PopupPositioning.d.ts +20 -0
- package/dist/plugins/shared/PopupPositioning.d.ts.map +1 -1
- package/dist/plugins/shared.mjs +1 -2
- package/dist/plugins/smart-paste/ContentSplitter.d.ts +14 -0
- package/dist/plugins/smart-paste/ContentSplitter.d.ts.map +1 -0
- package/dist/plugins/smart-paste/SmartPasteLocale.d.ts +1 -0
- package/dist/plugins/smart-paste/SmartPasteLocale.d.ts.map +1 -1
- package/dist/plugins/smart-paste/SmartPastePlugin.d.ts +6 -1
- package/dist/plugins/smart-paste/SmartPastePlugin.d.ts.map +1 -1
- package/dist/plugins/smart-paste/SmartPasteTypes.d.ts +5 -0
- package/dist/plugins/smart-paste/SmartPasteTypes.d.ts.map +1 -1
- package/dist/plugins/smart-paste/detectors/JavaDetector.d.ts +7 -0
- package/dist/plugins/smart-paste/detectors/JavaDetector.d.ts.map +1 -0
- package/dist/plugins/smart-paste/index.d.ts +2 -1
- package/dist/plugins/smart-paste/index.d.ts.map +1 -1
- package/dist/plugins/smart-paste/locales/ar.d.ts.map +1 -1
- package/dist/plugins/smart-paste/locales/de.d.ts.map +1 -1
- package/dist/plugins/smart-paste/locales/es.d.ts.map +1 -1
- package/dist/plugins/smart-paste/locales/fr.d.ts.map +1 -1
- package/dist/plugins/smart-paste/locales/hi.d.ts.map +1 -1
- package/dist/plugins/smart-paste/locales/pt.d.ts.map +1 -1
- package/dist/plugins/smart-paste/locales/ru.d.ts.map +1 -1
- package/dist/plugins/smart-paste/locales/zh.d.ts.map +1 -1
- package/dist/plugins/smart-paste.mjs +1 -2
- package/dist/plugins/strikethrough.mjs +1 -2
- package/dist/plugins/super-sub.mjs +1 -2
- package/dist/plugins/table/TableCommands.d.ts.map +1 -1
- package/dist/plugins/table/TableContextMenu.d.ts.map +1 -1
- package/dist/plugins/table.mjs +1 -2
- package/dist/plugins/text-color.mjs +1 -2
- package/dist/plugins/text-direction-advanced.mjs +1 -2
- package/dist/plugins/text-direction.mjs +1 -2
- package/dist/plugins/text-formatting.mjs +1 -2
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarTooltip.d.ts.map +1 -1
- package/dist/plugins/toolbar.mjs +1 -2
- package/dist/presets/full.mjs +1 -2
- package/dist/presets/minimal.mjs +1 -2
- package/dist/presets.mjs +1 -2
- package/dist/view/CaretNavigation.d.ts +9 -2
- package/dist/view/CaretNavigation.d.ts.map +1 -1
- package/dist/view/DomPointUtils.d.ts +2 -3
- package/dist/view/DomPointUtils.d.ts.map +1 -1
- package/dist/view/EditorViewEvents.d.ts.map +1 -1
- package/dist/view/EditorViewNavigation.d.ts.map +1 -1
- package/package.json +8 -4
- package/dist/chunks/AttrRegistry-iNpjvcSG.mjs +0 -2
- package/dist/chunks/AttrRegistry-iNpjvcSG.mjs.map +0 -1
- package/dist/chunks/AttributedMarkCommands-BY1BSYWM.mjs +0 -2
- package/dist/chunks/AttributedMarkCommands-BY1BSYWM.mjs.map +0 -1
- package/dist/chunks/BlockInsertion-BJFhE0jA.mjs +0 -2
- package/dist/chunks/BlockInsertion-BJFhE0jA.mjs.map +0 -1
- package/dist/chunks/BlockTypePickerRegistry-DcSE6IXB.mjs +0 -2
- package/dist/chunks/BlockTypePickerRegistry-DcSE6IXB.mjs.map +0 -1
- package/dist/chunks/ColorGrid-CpkbKfXg.mjs +0 -2
- package/dist/chunks/ColorGrid-CpkbKfXg.mjs.map +0 -1
- package/dist/chunks/ColorPickerPopup-D6XjShhv.mjs +0 -2
- package/dist/chunks/ColorPickerPopup-D6XjShhv.mjs.map +0 -1
- package/dist/chunks/ColorValidation-DCSKq9B2.mjs +0 -2
- package/dist/chunks/ColorValidation-DCSKq9B2.mjs.map +0 -1
- package/dist/chunks/CommandHelpers-M6mPS6Ww.mjs +0 -2
- package/dist/chunks/CommandHelpers-M6mPS6Ww.mjs.map +0 -1
- package/dist/chunks/Commands-D_gMCnVa.mjs +0 -2
- package/dist/chunks/Commands-D_gMCnVa.mjs.map +0 -1
- package/dist/chunks/Decoration-D49mFXrH.mjs +0 -2
- package/dist/chunks/Decoration-D49mFXrH.mjs.map +0 -1
- package/dist/chunks/Document-3pNX7ear.mjs +0 -2
- package/dist/chunks/Document-3pNX7ear.mjs.map +0 -1
- package/dist/chunks/DocumentParser-LvzDQOd1.mjs +0 -2
- package/dist/chunks/DocumentParser-LvzDQOd1.mjs.map +0 -1
- package/dist/chunks/DomUtils-CznMAZZg.mjs +0 -2
- package/dist/chunks/DomUtils-CznMAZZg.mjs.map +0 -1
- package/dist/chunks/HTMLUtils-Cxy99Ak2.mjs +0 -2
- package/dist/chunks/HTMLUtils-Cxy99Ak2.mjs.map +0 -1
- package/dist/chunks/HeadingPlugin-BmkeUXj8.mjs +0 -2
- package/dist/chunks/HeadingPlugin-BmkeUXj8.mjs.map +0 -1
- package/dist/chunks/KeyboardNav-DsYhKKuV.mjs +0 -2
- package/dist/chunks/KeyboardNav-DsYhKKuV.mjs.map +0 -1
- package/dist/chunks/MarkCommands-CeCa4WSC.mjs +0 -2
- package/dist/chunks/MarkCommands-CeCa4WSC.mjs.map +0 -1
- package/dist/chunks/NavigationQueries-11qe4j9x.mjs +0 -2
- package/dist/chunks/NavigationQueries-11qe4j9x.mjs.map +0 -1
- package/dist/chunks/NodeResolver-z0ReCR34.mjs +0 -2
- package/dist/chunks/NodeResolver-z0ReCR34.mjs.map +0 -1
- package/dist/chunks/NodeSelectionCommands-CXrOcPtG.mjs +0 -2
- package/dist/chunks/NodeSelectionCommands-CXrOcPtG.mjs.map +0 -1
- package/dist/chunks/NotectlEditor-BJD7-FFx.mjs +0 -4
- package/dist/chunks/NotectlEditor-BJD7-FFx.mjs.map +0 -1
- package/dist/chunks/Platform-CU6itXZo.mjs +0 -2
- package/dist/chunks/Platform-CU6itXZo.mjs.map +0 -1
- package/dist/chunks/PluginHelpers-CdPR0MuT.mjs +0 -2
- package/dist/chunks/PluginHelpers-CdPR0MuT.mjs.map +0 -1
- package/dist/chunks/PopupManager-0b_Q0m7K.mjs +0 -2
- package/dist/chunks/PopupManager-0b_Q0m7K.mjs.map +0 -1
- package/dist/chunks/PopupPositioning-DtvqMSop.mjs +0 -2
- package/dist/chunks/PopupPositioning-DtvqMSop.mjs.map +0 -1
- package/dist/chunks/PrintTypes-DukwDSWS.mjs +0 -2
- package/dist/chunks/PrintTypes-DukwDSWS.mjs.map +0 -1
- package/dist/chunks/RangeIterator-XFN5FaYf.mjs +0 -2
- package/dist/chunks/RangeIterator-XFN5FaYf.mjs.map +0 -1
- package/dist/chunks/Selection-DhbizDM4.mjs +0 -2
- package/dist/chunks/Selection-DhbizDM4.mjs.map +0 -1
- package/dist/chunks/SelectionTransactions-DzIZxcuN.mjs +0 -2
- package/dist/chunks/SelectionTransactions-DzIZxcuN.mjs.map +0 -1
- package/dist/chunks/ShortcutFormatting-BLKS0Gys.mjs +0 -2
- package/dist/chunks/ShortcutFormatting-BLKS0Gys.mjs.map +0 -1
- package/dist/chunks/StyleRuntime-BmsLoEa8.mjs +0 -2
- package/dist/chunks/StyleRuntime-BmsLoEa8.mjs.map +0 -1
- package/dist/chunks/TextDirectionLocale-CKz0ZrH_.mjs +0 -2
- package/dist/chunks/TextDirectionLocale-CKz0ZrH_.mjs.map +0 -1
- package/dist/chunks/TypeBrands-Bp_Z_o5Y.mjs +0 -2
- package/dist/chunks/TypeBrands-Bp_Z_o5Y.mjs.map +0 -1
- package/dist/chunks/XmlPatterns-DxQXGjP8.mjs +0 -2
- package/dist/chunks/XmlPatterns-DxQXGjP8.mjs.map +0 -1
- package/dist/chunks/ar-B93SPJT7.mjs +0 -2
- package/dist/chunks/ar-B93SPJT7.mjs.map +0 -1
- package/dist/chunks/ar-BAmGa08u.mjs +0 -2
- package/dist/chunks/ar-BAmGa08u.mjs.map +0 -1
- package/dist/chunks/ar-BYNFEVLc.mjs +0 -2
- package/dist/chunks/ar-BYNFEVLc.mjs.map +0 -1
- package/dist/chunks/ar-Bnc7y8BP.mjs +0 -2
- package/dist/chunks/ar-Bnc7y8BP.mjs.map +0 -1
- package/dist/chunks/ar-Bp3rDZky.mjs +0 -2
- package/dist/chunks/ar-Bp3rDZky.mjs.map +0 -1
- package/dist/chunks/ar-BtOQ7lro.mjs +0 -2
- package/dist/chunks/ar-BtOQ7lro.mjs.map +0 -1
- package/dist/chunks/ar-C5JEHhw9.mjs +0 -2
- package/dist/chunks/ar-C5JEHhw9.mjs.map +0 -1
- package/dist/chunks/ar-CL3QL0tw.mjs +0 -2
- package/dist/chunks/ar-CL3QL0tw.mjs.map +0 -1
- package/dist/chunks/ar-CYtG-XlN.mjs +0 -2
- package/dist/chunks/ar-CYtG-XlN.mjs.map +0 -1
- package/dist/chunks/ar-CzVj8p__.mjs +0 -2
- package/dist/chunks/ar-CzVj8p__.mjs.map +0 -1
- package/dist/chunks/ar-D7PS3e2g.mjs +0 -2
- package/dist/chunks/ar-D7PS3e2g.mjs.map +0 -1
- package/dist/chunks/ar-D8adM2Uy.mjs +0 -2
- package/dist/chunks/ar-D8adM2Uy.mjs.map +0 -1
- package/dist/chunks/ar-D9jyShaB.mjs +0 -2
- package/dist/chunks/ar-D9jyShaB.mjs.map +0 -1
- package/dist/chunks/ar-DR6OA3ZO.mjs +0 -2
- package/dist/chunks/ar-DR6OA3ZO.mjs.map +0 -1
- package/dist/chunks/ar-Deibepjm.mjs +0 -2
- package/dist/chunks/ar-Deibepjm.mjs.map +0 -1
- package/dist/chunks/ar-Dlb5riUN.mjs +0 -2
- package/dist/chunks/ar-Dlb5riUN.mjs.map +0 -1
- package/dist/chunks/ar-DmmxE2W7.mjs +0 -2
- package/dist/chunks/ar-DmmxE2W7.mjs.map +0 -1
- package/dist/chunks/ar-Ds6Z2Gzf.mjs +0 -2
- package/dist/chunks/ar-Ds6Z2Gzf.mjs.map +0 -1
- package/dist/chunks/ar-DtIHQ8nU.mjs +0 -2
- package/dist/chunks/ar-DtIHQ8nU.mjs.map +0 -1
- package/dist/chunks/ar-J8B-on-0.mjs +0 -2
- package/dist/chunks/ar-J8B-on-0.mjs.map +0 -1
- package/dist/chunks/ar-b6VdnxAs.mjs +0 -2
- package/dist/chunks/ar-b6VdnxAs.mjs.map +0 -1
- package/dist/chunks/ar-iU02mRe5.mjs +0 -2
- package/dist/chunks/ar-iU02mRe5.mjs.map +0 -1
- package/dist/chunks/ar-mSCYQYnL.mjs +0 -2
- package/dist/chunks/ar-mSCYQYnL.mjs.map +0 -1
- package/dist/chunks/color-picker-Byjl_xr9.mjs +0 -2
- package/dist/chunks/color-picker-Byjl_xr9.mjs.map +0 -1
- package/dist/chunks/de-8aCC5jBM.mjs +0 -2
- package/dist/chunks/de-8aCC5jBM.mjs.map +0 -1
- package/dist/chunks/de-B4y4ndUw.mjs +0 -2
- package/dist/chunks/de-B4y4ndUw.mjs.map +0 -1
- package/dist/chunks/de-B5fcZ0FQ.mjs +0 -2
- package/dist/chunks/de-B5fcZ0FQ.mjs.map +0 -1
- package/dist/chunks/de-BT9VmwoJ.mjs +0 -2
- package/dist/chunks/de-BT9VmwoJ.mjs.map +0 -1
- package/dist/chunks/de-BZWSyJTG.mjs +0 -2
- package/dist/chunks/de-BZWSyJTG.mjs.map +0 -1
- package/dist/chunks/de-CFD_Wgik.mjs +0 -2
- package/dist/chunks/de-CFD_Wgik.mjs.map +0 -1
- package/dist/chunks/de-CLYtb6kD.mjs +0 -2
- package/dist/chunks/de-CLYtb6kD.mjs.map +0 -1
- package/dist/chunks/de-CP5v-98M.mjs +0 -2
- package/dist/chunks/de-CP5v-98M.mjs.map +0 -1
- package/dist/chunks/de-CYJ6uWno.mjs +0 -2
- package/dist/chunks/de-CYJ6uWno.mjs.map +0 -1
- package/dist/chunks/de-ChcKkF7A.mjs +0 -2
- package/dist/chunks/de-ChcKkF7A.mjs.map +0 -1
- package/dist/chunks/de-CicoU066.mjs +0 -2
- package/dist/chunks/de-CicoU066.mjs.map +0 -1
- package/dist/chunks/de-CjLAdBt2.mjs +0 -2
- package/dist/chunks/de-CjLAdBt2.mjs.map +0 -1
- package/dist/chunks/de-CtFvAXwF.mjs +0 -2
- package/dist/chunks/de-CtFvAXwF.mjs.map +0 -1
- package/dist/chunks/de-D1OAXtxJ.mjs +0 -2
- package/dist/chunks/de-D1OAXtxJ.mjs.map +0 -1
- package/dist/chunks/de-DBbzCQrm.mjs +0 -2
- package/dist/chunks/de-DBbzCQrm.mjs.map +0 -1
- package/dist/chunks/de-DOLwx_M7.mjs +0 -2
- package/dist/chunks/de-DOLwx_M7.mjs.map +0 -1
- package/dist/chunks/de-De2miMxo.mjs +0 -2
- package/dist/chunks/de-De2miMxo.mjs.map +0 -1
- package/dist/chunks/de-OTfhhinm.mjs +0 -2
- package/dist/chunks/de-OTfhhinm.mjs.map +0 -1
- package/dist/chunks/de-PZ9-LlBp.mjs +0 -2
- package/dist/chunks/de-PZ9-LlBp.mjs.map +0 -1
- package/dist/chunks/de-UREymH-5.mjs +0 -2
- package/dist/chunks/de-UREymH-5.mjs.map +0 -1
- package/dist/chunks/de-chYdoK9q.mjs +0 -2
- package/dist/chunks/de-chYdoK9q.mjs.map +0 -1
- package/dist/chunks/de-fXvs5vQT.mjs +0 -2
- package/dist/chunks/de-fXvs5vQT.mjs.map +0 -1
- package/dist/chunks/de-xJh5C_pk.mjs +0 -2
- package/dist/chunks/de-xJh5C_pk.mjs.map +0 -1
- package/dist/chunks/es-B9UhsaEI.mjs +0 -2
- package/dist/chunks/es-B9UhsaEI.mjs.map +0 -1
- package/dist/chunks/es-BHGwPgrP.mjs +0 -2
- package/dist/chunks/es-BHGwPgrP.mjs.map +0 -1
- package/dist/chunks/es-BTqy_aQ4.mjs +0 -2
- package/dist/chunks/es-BTqy_aQ4.mjs.map +0 -1
- package/dist/chunks/es-BbGOZGS_.mjs +0 -2
- package/dist/chunks/es-BbGOZGS_.mjs.map +0 -1
- package/dist/chunks/es-BjPsub0k.mjs +0 -2
- package/dist/chunks/es-BjPsub0k.mjs.map +0 -1
- package/dist/chunks/es-Bk0bRDFE.mjs +0 -2
- package/dist/chunks/es-Bk0bRDFE.mjs.map +0 -1
- package/dist/chunks/es-BkS6DsrM.mjs +0 -2
- package/dist/chunks/es-BkS6DsrM.mjs.map +0 -1
- package/dist/chunks/es-BzEpr4Bk.mjs +0 -2
- package/dist/chunks/es-BzEpr4Bk.mjs.map +0 -1
- package/dist/chunks/es-C2lnWyA0.mjs +0 -2
- package/dist/chunks/es-C2lnWyA0.mjs.map +0 -1
- package/dist/chunks/es-C7e35Muh.mjs +0 -2
- package/dist/chunks/es-C7e35Muh.mjs.map +0 -1
- package/dist/chunks/es-CBk43isB.mjs +0 -2
- package/dist/chunks/es-CBk43isB.mjs.map +0 -1
- package/dist/chunks/es-CE8t9fuM.mjs +0 -2
- package/dist/chunks/es-CE8t9fuM.mjs.map +0 -1
- package/dist/chunks/es-CFjzqIbS.mjs +0 -2
- package/dist/chunks/es-CFjzqIbS.mjs.map +0 -1
- package/dist/chunks/es-Ce-AEYxc.mjs +0 -2
- package/dist/chunks/es-Ce-AEYxc.mjs.map +0 -1
- package/dist/chunks/es-Co4AJr8Y.mjs +0 -2
- package/dist/chunks/es-Co4AJr8Y.mjs.map +0 -1
- package/dist/chunks/es-Cu5_OA4X.mjs +0 -2
- package/dist/chunks/es-Cu5_OA4X.mjs.map +0 -1
- package/dist/chunks/es-Cud6JXHf.mjs +0 -2
- package/dist/chunks/es-Cud6JXHf.mjs.map +0 -1
- package/dist/chunks/es-D-II7LZC.mjs +0 -2
- package/dist/chunks/es-D-II7LZC.mjs.map +0 -1
- package/dist/chunks/es-DBBSeOaD.mjs +0 -2
- package/dist/chunks/es-DBBSeOaD.mjs.map +0 -1
- package/dist/chunks/es-DCwjeUUu.mjs +0 -2
- package/dist/chunks/es-DCwjeUUu.mjs.map +0 -1
- package/dist/chunks/es-DvgH3-WZ.mjs +0 -2
- package/dist/chunks/es-DvgH3-WZ.mjs.map +0 -1
- package/dist/chunks/es-MgguVgIs.mjs +0 -2
- package/dist/chunks/es-MgguVgIs.mjs.map +0 -1
- package/dist/chunks/es-yXjjcxgb.mjs +0 -2
- package/dist/chunks/es-yXjjcxgb.mjs.map +0 -1
- package/dist/chunks/fr-B-_yKIAY.mjs +0 -2
- package/dist/chunks/fr-B-_yKIAY.mjs.map +0 -1
- package/dist/chunks/fr-BGyF2ym0.mjs +0 -2
- package/dist/chunks/fr-BGyF2ym0.mjs.map +0 -1
- package/dist/chunks/fr-BoRJ3B2-.mjs +0 -2
- package/dist/chunks/fr-BoRJ3B2-.mjs.map +0 -1
- package/dist/chunks/fr-BrKk4SPg.mjs +0 -2
- package/dist/chunks/fr-BrKk4SPg.mjs.map +0 -1
- package/dist/chunks/fr-C-y09LKg.mjs +0 -2
- package/dist/chunks/fr-C-y09LKg.mjs.map +0 -1
- package/dist/chunks/fr-C1W7jyd6.mjs +0 -2
- package/dist/chunks/fr-C1W7jyd6.mjs.map +0 -1
- package/dist/chunks/fr-C8CtmWBj.mjs +0 -2
- package/dist/chunks/fr-C8CtmWBj.mjs.map +0 -1
- package/dist/chunks/fr-C9oiPW0k.mjs +0 -2
- package/dist/chunks/fr-C9oiPW0k.mjs.map +0 -1
- package/dist/chunks/fr-CEkk4UyZ.mjs +0 -2
- package/dist/chunks/fr-CEkk4UyZ.mjs.map +0 -1
- package/dist/chunks/fr-Ccaetiwi.mjs +0 -2
- package/dist/chunks/fr-Ccaetiwi.mjs.map +0 -1
- package/dist/chunks/fr-Ccku5KzA.mjs +0 -2
- package/dist/chunks/fr-Ccku5KzA.mjs.map +0 -1
- package/dist/chunks/fr-CfUg1FxU.mjs +0 -2
- package/dist/chunks/fr-CfUg1FxU.mjs.map +0 -1
- package/dist/chunks/fr-DDkBcjmO.mjs +0 -2
- package/dist/chunks/fr-DDkBcjmO.mjs.map +0 -1
- package/dist/chunks/fr-DNwLChcm.mjs +0 -2
- package/dist/chunks/fr-DNwLChcm.mjs.map +0 -1
- package/dist/chunks/fr-DvneSjCf.mjs +0 -2
- package/dist/chunks/fr-DvneSjCf.mjs.map +0 -1
- package/dist/chunks/fr-Dx4Qqimj.mjs +0 -2
- package/dist/chunks/fr-Dx4Qqimj.mjs.map +0 -1
- package/dist/chunks/fr-RHXmueoO.mjs +0 -2
- package/dist/chunks/fr-RHXmueoO.mjs.map +0 -1
- package/dist/chunks/fr-VdiCNF4J.mjs +0 -2
- package/dist/chunks/fr-VdiCNF4J.mjs.map +0 -1
- package/dist/chunks/fr-Wiobfk5s.mjs +0 -2
- package/dist/chunks/fr-Wiobfk5s.mjs.map +0 -1
- package/dist/chunks/fr-YMiDtWuG.mjs +0 -2
- package/dist/chunks/fr-YMiDtWuG.mjs.map +0 -1
- package/dist/chunks/fr-_Oxf0k66.mjs +0 -2
- package/dist/chunks/fr-_Oxf0k66.mjs.map +0 -1
- package/dist/chunks/fr-gurfH-7T.mjs +0 -2
- package/dist/chunks/fr-gurfH-7T.mjs.map +0 -1
- package/dist/chunks/fr-zP7EjxDL.mjs +0 -2
- package/dist/chunks/fr-zP7EjxDL.mjs.map +0 -1
- package/dist/chunks/hi-B2W8pFqK.mjs +0 -2
- package/dist/chunks/hi-B2W8pFqK.mjs.map +0 -1
- package/dist/chunks/hi-B2m69ZCq.mjs +0 -2
- package/dist/chunks/hi-B2m69ZCq.mjs.map +0 -1
- package/dist/chunks/hi-BMIt3y_-.mjs +0 -2
- package/dist/chunks/hi-BMIt3y_-.mjs.map +0 -1
- package/dist/chunks/hi-BdtVhAzs.mjs +0 -2
- package/dist/chunks/hi-BdtVhAzs.mjs.map +0 -1
- package/dist/chunks/hi-BmkfaZpg.mjs +0 -2
- package/dist/chunks/hi-BmkfaZpg.mjs.map +0 -1
- package/dist/chunks/hi-C-l_R2SO.mjs +0 -2
- package/dist/chunks/hi-C-l_R2SO.mjs.map +0 -1
- package/dist/chunks/hi-C1LhM-oY.mjs +0 -2
- package/dist/chunks/hi-C1LhM-oY.mjs.map +0 -1
- package/dist/chunks/hi-CGEbGI1l.mjs +0 -2
- package/dist/chunks/hi-CGEbGI1l.mjs.map +0 -1
- package/dist/chunks/hi-CPuhj7IA.mjs +0 -2
- package/dist/chunks/hi-CPuhj7IA.mjs.map +0 -1
- package/dist/chunks/hi-CT5WERqi.mjs +0 -2
- package/dist/chunks/hi-CT5WERqi.mjs.map +0 -1
- package/dist/chunks/hi-CbLPPQ0b.mjs +0 -2
- package/dist/chunks/hi-CbLPPQ0b.mjs.map +0 -1
- package/dist/chunks/hi-ClvEtEKe.mjs +0 -2
- package/dist/chunks/hi-ClvEtEKe.mjs.map +0 -1
- package/dist/chunks/hi-CpBWHmYH.mjs +0 -2
- package/dist/chunks/hi-CpBWHmYH.mjs.map +0 -1
- package/dist/chunks/hi-DAfl8nU_.mjs +0 -2
- package/dist/chunks/hi-DAfl8nU_.mjs.map +0 -1
- package/dist/chunks/hi-DVof3w0y.mjs +0 -2
- package/dist/chunks/hi-DVof3w0y.mjs.map +0 -1
- package/dist/chunks/hi-DtlvSQkD.mjs +0 -2
- package/dist/chunks/hi-DtlvSQkD.mjs.map +0 -1
- package/dist/chunks/hi-FH3CAJuR.mjs +0 -2
- package/dist/chunks/hi-FH3CAJuR.mjs.map +0 -1
- package/dist/chunks/hi-Ga9h9a_1.mjs +0 -2
- package/dist/chunks/hi-Ga9h9a_1.mjs.map +0 -1
- package/dist/chunks/hi-Zc17M1T-.mjs +0 -2
- package/dist/chunks/hi-Zc17M1T-.mjs.map +0 -1
- package/dist/chunks/hi-g7i0bmig.mjs +0 -2
- package/dist/chunks/hi-g7i0bmig.mjs.map +0 -1
- package/dist/chunks/hi-js2P6byR.mjs +0 -2
- package/dist/chunks/hi-js2P6byR.mjs.map +0 -1
- package/dist/chunks/hi-ntUsOspQ.mjs +0 -2
- package/dist/chunks/hi-ntUsOspQ.mjs.map +0 -1
- package/dist/chunks/hi-yxAcR3w6.mjs +0 -2
- package/dist/chunks/hi-yxAcR3w6.mjs.map +0 -1
- package/dist/chunks/index-C-L4awHz.mjs +0 -2
- package/dist/chunks/index-C-L4awHz.mjs.map +0 -1
- package/dist/chunks/index-Cs9iqxhF.mjs +0 -2
- package/dist/chunks/index-Cs9iqxhF.mjs.map +0 -1
- package/dist/chunks/pt--IiroJQw.mjs +0 -2
- package/dist/chunks/pt--IiroJQw.mjs.map +0 -1
- package/dist/chunks/pt-BF72W8M5.mjs +0 -2
- package/dist/chunks/pt-BF72W8M5.mjs.map +0 -1
- package/dist/chunks/pt-BX_t4luI.mjs +0 -2
- package/dist/chunks/pt-BX_t4luI.mjs.map +0 -1
- package/dist/chunks/pt-B_XJ2s9X.mjs +0 -2
- package/dist/chunks/pt-B_XJ2s9X.mjs.map +0 -1
- package/dist/chunks/pt-C-Vp7Rxj.mjs +0 -2
- package/dist/chunks/pt-C-Vp7Rxj.mjs.map +0 -1
- package/dist/chunks/pt-CD2aCZXf.mjs +0 -2
- package/dist/chunks/pt-CD2aCZXf.mjs.map +0 -1
- package/dist/chunks/pt-CFjzqIbS.mjs +0 -2
- package/dist/chunks/pt-CFjzqIbS.mjs.map +0 -1
- package/dist/chunks/pt-CHjmBegF.mjs +0 -2
- package/dist/chunks/pt-CHjmBegF.mjs.map +0 -1
- package/dist/chunks/pt-CQRzEocL.mjs +0 -2
- package/dist/chunks/pt-CQRzEocL.mjs.map +0 -1
- package/dist/chunks/pt-Cem2WxUk.mjs +0 -2
- package/dist/chunks/pt-Cem2WxUk.mjs.map +0 -1
- package/dist/chunks/pt-D6kdF3fH.mjs +0 -2
- package/dist/chunks/pt-D6kdF3fH.mjs.map +0 -1
- package/dist/chunks/pt-DJfJVeY8.mjs +0 -2
- package/dist/chunks/pt-DJfJVeY8.mjs.map +0 -1
- package/dist/chunks/pt-DfB-IaYi.mjs +0 -2
- package/dist/chunks/pt-DfB-IaYi.mjs.map +0 -1
- package/dist/chunks/pt-DlNdH9pu.mjs +0 -2
- package/dist/chunks/pt-DlNdH9pu.mjs.map +0 -1
- package/dist/chunks/pt-DrJ0-8Yo.mjs +0 -2
- package/dist/chunks/pt-DrJ0-8Yo.mjs.map +0 -1
- package/dist/chunks/pt-DsBJpgpe.mjs +0 -2
- package/dist/chunks/pt-DsBJpgpe.mjs.map +0 -1
- package/dist/chunks/pt-DwdSYJzC.mjs +0 -2
- package/dist/chunks/pt-DwdSYJzC.mjs.map +0 -1
- package/dist/chunks/pt-Dx9UkZ3j.mjs +0 -2
- package/dist/chunks/pt-Dx9UkZ3j.mjs.map +0 -1
- package/dist/chunks/pt-K0BUlM9X.mjs +0 -2
- package/dist/chunks/pt-K0BUlM9X.mjs.map +0 -1
- package/dist/chunks/pt-TuA3_GDM.mjs +0 -2
- package/dist/chunks/pt-TuA3_GDM.mjs.map +0 -1
- package/dist/chunks/pt-cN6r-f7f.mjs +0 -2
- package/dist/chunks/pt-cN6r-f7f.mjs.map +0 -1
- package/dist/chunks/pt-uNGpVM3D.mjs +0 -2
- package/dist/chunks/pt-uNGpVM3D.mjs.map +0 -1
- package/dist/chunks/pt-v1E9u-Jx.mjs +0 -2
- package/dist/chunks/pt-v1E9u-Jx.mjs.map +0 -1
- package/dist/chunks/ru-0h51zrqE.mjs +0 -2
- package/dist/chunks/ru-0h51zrqE.mjs.map +0 -1
- package/dist/chunks/ru-4S8w6UN_.mjs +0 -2
- package/dist/chunks/ru-4S8w6UN_.mjs.map +0 -1
- package/dist/chunks/ru-B0cRw90L.mjs +0 -2
- package/dist/chunks/ru-B0cRw90L.mjs.map +0 -1
- package/dist/chunks/ru-B3O7WXNM.mjs +0 -2
- package/dist/chunks/ru-B3O7WXNM.mjs.map +0 -1
- package/dist/chunks/ru-B6zVAzvI.mjs +0 -2
- package/dist/chunks/ru-B6zVAzvI.mjs.map +0 -1
- package/dist/chunks/ru-B8teJin_.mjs +0 -2
- package/dist/chunks/ru-B8teJin_.mjs.map +0 -1
- package/dist/chunks/ru-BCriPw-8.mjs +0 -2
- package/dist/chunks/ru-BCriPw-8.mjs.map +0 -1
- package/dist/chunks/ru-BNOU16E5.mjs +0 -2
- package/dist/chunks/ru-BNOU16E5.mjs.map +0 -1
- package/dist/chunks/ru-BO6BIS5W.mjs +0 -2
- package/dist/chunks/ru-BO6BIS5W.mjs.map +0 -1
- package/dist/chunks/ru-Bdy1lLuc.mjs +0 -2
- package/dist/chunks/ru-Bdy1lLuc.mjs.map +0 -1
- package/dist/chunks/ru-BgBctNVm.mjs +0 -2
- package/dist/chunks/ru-BgBctNVm.mjs.map +0 -1
- package/dist/chunks/ru-CNLx7T3O.mjs +0 -2
- package/dist/chunks/ru-CNLx7T3O.mjs.map +0 -1
- package/dist/chunks/ru-CVSCT776.mjs +0 -2
- package/dist/chunks/ru-CVSCT776.mjs.map +0 -1
- package/dist/chunks/ru-CZvkdGnf.mjs +0 -2
- package/dist/chunks/ru-CZvkdGnf.mjs.map +0 -1
- package/dist/chunks/ru-CegMPuML.mjs +0 -2
- package/dist/chunks/ru-CegMPuML.mjs.map +0 -1
- package/dist/chunks/ru-CiLrD2Nz.mjs +0 -2
- package/dist/chunks/ru-CiLrD2Nz.mjs.map +0 -1
- package/dist/chunks/ru-ClEM6OKY.mjs +0 -2
- package/dist/chunks/ru-ClEM6OKY.mjs.map +0 -1
- package/dist/chunks/ru-CrbxCeQf.mjs +0 -2
- package/dist/chunks/ru-CrbxCeQf.mjs.map +0 -1
- package/dist/chunks/ru-D3j2x2xu.mjs +0 -2
- package/dist/chunks/ru-D3j2x2xu.mjs.map +0 -1
- package/dist/chunks/ru-DdHqb4Mh.mjs +0 -2
- package/dist/chunks/ru-DdHqb4Mh.mjs.map +0 -1
- package/dist/chunks/ru-DjgNdOdJ.mjs +0 -2
- package/dist/chunks/ru-DjgNdOdJ.mjs.map +0 -1
- package/dist/chunks/ru-Tzd5N37W.mjs +0 -2
- package/dist/chunks/ru-Tzd5N37W.mjs.map +0 -1
- package/dist/chunks/ru-XKNCzkR2.mjs +0 -2
- package/dist/chunks/ru-XKNCzkR2.mjs.map +0 -1
- package/dist/chunks/zh--oNSMazK.mjs +0 -2
- package/dist/chunks/zh--oNSMazK.mjs.map +0 -1
- package/dist/chunks/zh-BfeWdPIz.mjs +0 -2
- package/dist/chunks/zh-BfeWdPIz.mjs.map +0 -1
- package/dist/chunks/zh-BnOxGKxF.mjs +0 -2
- package/dist/chunks/zh-BnOxGKxF.mjs.map +0 -1
- package/dist/chunks/zh-BqMtE-jN.mjs +0 -2
- package/dist/chunks/zh-BqMtE-jN.mjs.map +0 -1
- package/dist/chunks/zh-C3aI7A2o.mjs +0 -2
- package/dist/chunks/zh-C3aI7A2o.mjs.map +0 -1
- package/dist/chunks/zh-C6YALJZt.mjs +0 -2
- package/dist/chunks/zh-C6YALJZt.mjs.map +0 -1
- package/dist/chunks/zh-CWdTbUOP.mjs +0 -2
- package/dist/chunks/zh-CWdTbUOP.mjs.map +0 -1
- package/dist/chunks/zh-CY01pMD4.mjs +0 -2
- package/dist/chunks/zh-CY01pMD4.mjs.map +0 -1
- package/dist/chunks/zh-Cmt7n9FY.mjs +0 -2
- package/dist/chunks/zh-Cmt7n9FY.mjs.map +0 -1
- package/dist/chunks/zh-CpP2kee3.mjs +0 -2
- package/dist/chunks/zh-CpP2kee3.mjs.map +0 -1
- package/dist/chunks/zh-Cpbg4evx.mjs +0 -2
- package/dist/chunks/zh-Cpbg4evx.mjs.map +0 -1
- package/dist/chunks/zh-Cqb55JWa.mjs +0 -2
- package/dist/chunks/zh-Cqb55JWa.mjs.map +0 -1
- package/dist/chunks/zh-DCQZ6gss.mjs +0 -2
- package/dist/chunks/zh-DCQZ6gss.mjs.map +0 -1
- package/dist/chunks/zh-DG2CNTUU.mjs +0 -2
- package/dist/chunks/zh-DG2CNTUU.mjs.map +0 -1
- package/dist/chunks/zh-DTiTJbzz.mjs +0 -2
- package/dist/chunks/zh-DTiTJbzz.mjs.map +0 -1
- package/dist/chunks/zh-Da1z6qbB.mjs +0 -2
- package/dist/chunks/zh-Da1z6qbB.mjs.map +0 -1
- package/dist/chunks/zh-Di3WqY4_.mjs +0 -2
- package/dist/chunks/zh-Di3WqY4_.mjs.map +0 -1
- package/dist/chunks/zh-DlBt06Pr.mjs +0 -2
- package/dist/chunks/zh-DlBt06Pr.mjs.map +0 -1
- package/dist/chunks/zh-Dt-wVrNr.mjs +0 -2
- package/dist/chunks/zh-Dt-wVrNr.mjs.map +0 -1
- package/dist/chunks/zh-ND6vW2M-.mjs +0 -2
- package/dist/chunks/zh-ND6vW2M-.mjs.map +0 -1
- package/dist/chunks/zh-Yd3GNsa0.mjs +0 -2
- package/dist/chunks/zh-Yd3GNsa0.mjs.map +0 -1
- package/dist/chunks/zh-lhynyH6Q.mjs +0 -2
- package/dist/chunks/zh-lhynyH6Q.mjs.map +0 -1
- package/dist/chunks/zh-v9NmlEIN.mjs +0 -2
- package/dist/chunks/zh-v9NmlEIN.mjs.map +0 -1
- package/dist/fonts.mjs.map +0 -1
- package/dist/full.mjs.map +0 -1
- package/dist/html.mjs.map +0 -1
- package/dist/notectl-core.mjs.map +0 -1
- package/dist/plugins/alignment.mjs.map +0 -1
- package/dist/plugins/blockquote.mjs.map +0 -1
- package/dist/plugins/caret-navigation.mjs.map +0 -1
- package/dist/plugins/code-block.mjs.map +0 -1
- package/dist/plugins/font-size.mjs.map +0 -1
- package/dist/plugins/font.mjs.map +0 -1
- package/dist/plugins/gap-cursor.mjs.map +0 -1
- package/dist/plugins/hard-break.mjs.map +0 -1
- package/dist/plugins/heading.mjs.map +0 -1
- package/dist/plugins/highlight.mjs.map +0 -1
- package/dist/plugins/horizontal-rule.mjs.map +0 -1
- package/dist/plugins/image.mjs.map +0 -1
- package/dist/plugins/link.mjs.map +0 -1
- package/dist/plugins/list.mjs.map +0 -1
- package/dist/plugins/print.mjs.map +0 -1
- package/dist/plugins/shared.mjs.map +0 -1
- package/dist/plugins/smart-paste.mjs.map +0 -1
- package/dist/plugins/strikethrough.mjs.map +0 -1
- package/dist/plugins/super-sub.mjs.map +0 -1
- package/dist/plugins/table.mjs.map +0 -1
- package/dist/plugins/text-color.mjs.map +0 -1
- package/dist/plugins/text-direction-advanced.mjs.map +0 -1
- package/dist/plugins/text-direction.mjs.map +0 -1
- package/dist/plugins/text-formatting.mjs.map +0 -1
- package/dist/plugins/toolbar.mjs.map +0 -1
- package/dist/presets/full.mjs.map +0 -1
- package/dist/presets/minimal.mjs.map +0 -1
- package/dist/presets.mjs.map +0 -1
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{b as e,f as t,m as n,s,e as r,d as i,a as o,c as a,i as c,g as l}from"./Commands-D_gMCnVa.mjs";import{d,a as h,f as p,s as u,i as f}from"./MarkCommands-CeCa4WSC.mjs";import{n as g,o as m,e as y,q as k,t as S,u as b,k as v,v as w,f as R,c as C,w as x,i as I,h as T,j as P,a as E,p as B,g as M,x as A,s as N,r as D}from"./Document-3pNX7ear.mjs";import{S as O,f as L}from"./HTMLUtils-Cxy99Ak2.mjs";import{b as H,n as _,m as z}from"./TypeBrands-Bp_Z_o5Y.mjs";import{f as F,r as K,a as j}from"./NodeResolver-z0ReCR34.mjs";import{b as $,c as V,h as U,g as q,e as W,d as G,i as Q,k as J,s as X,j as Y}from"./Selection-DhbizDM4.mjs";import{i as Z,b as ee,a as te,P as ne,d as se,B as re}from"./PrintTypes-DukwDSWS.mjs";import{D as ie,d as oe}from"./Decoration-D49mFXrH.mjs";import{a as ae,L as ce}from"./PluginHelpers-CdPR0MuT.mjs";import{d as le,n as de}from"./NodeSelectionCommands-CXrOcPtG.mjs";import{c as he,b as pe,d as ue,p as fe}from"./DocumentParser-LvzDQOd1.mjs";import{o as ge,n as me,M as ye,N as ke,O as Se,P as be,Q as ve,G as we,e as Re,C as Ce,p as xe,D as Ie,R as Te,K as Pe}from"./index-C-L4awHz.mjs";import Ee from"dompurify";import{r as Be,c as Me,f as Ae,s as Ne,a as De,b as Oe,v as Le,d as He}from"./BlockInsertion-BJFhE0jA.mjs";import{r as _e,e as ze,g as Fe,f as Ke,d as je,c as $e}from"./CommandHelpers-M6mPS6Ww.mjs";import{b as Ve,c as Ue,a as qe,u as We,d as Ge,r as Qe}from"./StyleRuntime-BmsLoEa8.mjs";import{g as Je}from"./Platform-CU6itXZo.mjs";import{B as Xe}from"./BlockTypePickerRegistry-DcSE6IXB.mjs";import{ToolbarRegistry as Ye,ToolbarPlugin as Ze}from"../plugins/toolbar.mjs";import{c as et,b as tt}from"./DomUtils-CznMAZZg.mjs";import{G as nt,n as st}from"./index-Cs9iqxhF.mjs";import{TextFormattingPlugin as rt}from"../plugins/text-formatting.mjs";class it{_nodeSpecs=/* @__PURE__ */new Map;_markSpecs=/* @__PURE__ */new Map;_inlineNodeSpecs=/* @__PURE__ */new Map;registerNodeSpec(e){if(this._nodeSpecs.has(e.type))throw new Error(`NodeSpec for type "${e.type}" is already registered.`);this._nodeSpecs.set(e.type,e)}getNodeSpec(e){return this._nodeSpecs.get(e)}removeNodeSpec(e){this._nodeSpecs.delete(e)}getNodeTypes(){return[...this._nodeSpecs.keys()]}registerMarkSpec(e){if(this._markSpecs.has(e.type))throw new Error(`MarkSpec for type "${e.type}" is already registered.`);this._markSpecs.set(e.type,e)}getMarkSpec(e){return this._markSpecs.get(e)}removeMarkSpec(e){this._markSpecs.delete(e)}getMarkTypes(){return[...this._markSpecs.keys()]}registerInlineNodeSpec(e){if(this._inlineNodeSpecs.has(e.type))throw new Error(`InlineNodeSpec for type "${e.type}" is already registered.`);this._inlineNodeSpecs.set(e.type,e)}getInlineNodeSpec(e){return this._inlineNodeSpecs.get(e)}removeInlineNodeSpec(e){this._inlineNodeSpecs.delete(e)}getInlineNodeTypes(){return[...this._inlineNodeSpecs.keys()]}getBlockParseRules(){return this.collectParseRules(this._nodeSpecs)}getInlineParseRules(){return this.collectParseRules(this._inlineNodeSpecs)}getMarkParseRules(){return this.collectParseRules(this._markSpecs)}getAllowedTags(){return[...this.collectSanitizeValues(
|
|
2
|
-
/* @__PURE__ */new Set(["p","br","div","span"]),e=>e.sanitize?.tags)]}getAllowedAttrs(){return[...this.collectSanitizeValues(/* @__PURE__ */new Set(["style","dir"]),e=>e.sanitize?.attrs)]}collectParseRules(e){const t=[];for(const[n,s]of e)if(s.parseHTML)for(const e of s.parseHTML)t.push({rule:e,type:n});return t.sort((e,t)=>(t.rule.priority??50)-(e.rule.priority??50))}collectSanitizeValues(e,t){const n=[this._nodeSpecs,this._inlineNodeSpecs,this._markSpecs];for(const s of n)for(const n of s.values()){const s=t(n);if(s)for(const t of s)e.add(t)}return e}clear(){this._nodeSpecs.clear(),this._markSpecs.clear(),this._inlineNodeSpecs.clear()}}function ot(e,t,n){const s=e.getNodeSpec(t);if(!s?.content)return!0;const r=e.getNodeSpec(n),i=r?.group;for(const o of s.content.allow){if(o===n)return!0;if("text"!==o&&i&&o===i)return!0}return!1}function at(e,t,n){const s=e.getNodeSpec(t);if(!s?.content)return!0;const{min:r=0,max:i=Number.POSITIVE_INFINITY}=s.content,o=n.filter(e=>"text"!==e);if(o.length<r||o.length>i)return!1;for(const a of o)if(!ot(e,t,a))return!1;return!0}function ct(e){e.registerNodeSpec({type:"paragraph",group:"block",content:{allow:["text"]},toDOM:e=>et("p",e.id),toHTML:(e,t)=>`<p>${t||"<br>"}</p>`,parseHTML:[{tag:"p"},{tag:"div",priority:10}],sanitize:{tags:["p"]}})}function lt(e,t,n){return{children:dt(e.children,t,n)}}function dt(e,t,n){return e.map(e=>{if(!g(e))return e;if(e.id===t)return n(e);const s=dt(e.children,t,n);return s===e.children?e:{...e,children:s}})}function ht(e,t,n){if(0===t.length)return e;const s=t[0];return s?{children:e.children.map(e=>g(e)&&e.id===s?1===t.length?n(e):pt(e,t,1,n):e)}:e}function pt(e,t,n,s){const r=t[n];if(!r)return e;const i=e.children.map(e=>g(e)&&e.id===r?n===t.length-1?s(e):pt(e,t,n+1,s):e);return{...e,children:i}}function ut(e,t,n){if(t(e))return n(e);let s=!1;const r=e.map(e=>{if(!g(e))return e;const r=ut(e.children,t,n);return r?(s=!0,{...e,children:r}):e});return s?r:null}function ft(e,t,n){const s=[];let r=0,i=!1;for(const o of e){if(m(o)){i||t!==r||(s.push(...n()),i=!0),s.push(o),r+=1;continue}const e=r+o.text.length;if(!i&&t>=r&&t<=e){const e=t-r,a=o.text.slice(0,e),c=o.text.slice(e);a&&s.push(y(a,o.marks)),s.push(...n()),c&&s.push(y(c,o.marks)),i=!0}else s.push(o);r=e}return i||s.push(...n()),s}function gt(e,t,n){const s=[];let r=0;for(const i of e){if(m(i)){const e=r+1;e>t&&r<n&&s.push(i),r=e;continue}const e=r+i.text.length;if(e<=t||r>=n);else{const e=Math.max(0,t-r),o=Math.min(i.text.length,n-r),a=i.text.slice(e,o);a.length>0&&s.push(y(a,i.marks))}r=e}return 0===s.length&&s.push(y("")),s}function mt(e,t,n,s,r){const i=[];let o=0;for(const a of e){if(m(a)){i.push(a),o+=1;continue}const e=o+a.text.length;if(e<=t||o>=n)i.push(a);else if(o>=t&&e<=n){const e=r?S(a.marks,s):b(a.marks,s.type);i.push(y(a.text,e))}else{const e=Math.max(0,t-o),c=Math.min(a.text.length,n-o),l=a.text.slice(0,e),d=a.text.slice(e,c),h=a.text.slice(c);if(l&&i.push(y(l,a.marks)),d){const e=r?S(a.marks,s):b(a.marks,s.type);i.push(y(d,e))}h&&i.push(y(h,a.marks))}o=e}return i}function yt(e,t){if(e.every(e=>k(e)||m(e)))return t;const n=e.filter(e=>!k(e)&&!m(e));return[...t,...n]}function kt(e,t){switch(t.type){case"insertText":return function(e,t){return St(e,t.blockId,e=>{return t.segments?(n=e,s=t.offset,r=t.segments,ft(n,s,()=>r.map(e=>y(e.text,e.marks)))):function(e,t,n,s){return ft(e,t,()=>[y(n,s)])}(e,t.offset,t.text,t.marks);var n,s,r})}(e,t);case"deleteText":return function(e,t){return St(e,t.blockId,e=>function(e,t,n){const s=[];let r=0;for(const i of e){if(m(i)){const e=r+1;(e<=t||r>=n)&&s.push(i),r=e;continue}const e=r+i.text.length;if(e<=t||r>=n)s.push(i);else{const e=Math.max(0,t-r),o=Math.min(i.text.length,n-r),a=i.text.slice(0,e)+i.text.slice(o);a.length>0&&s.push(y(a,i.marks))}r=e}return s}(e,t.from,t.to))}(e,t);case"splitBlock":return function(e,t){const n=ut(e.children,e=>e.some(e=>g(e)&&e.id===t.blockId),e=>{const n=e.findIndex(e=>g(e)&&e.id===t.blockId);if(-1===n)return e;const s=e[n],r=v(s),i=R(s),o=gt(r,0,t.offset),a=gt(r,t.offset,i),c={...s,children:w(o)},l=C(s.type,w(a),t.newBlockId,s.attrs),d=[...e];return d.splice(n,1,c,l),d});return n?{children:n}:e}(e,t);case"mergeBlocks":return function(e,t){const n=ut(e.children,e=>e.some(e=>g(e)&&e.id===t.targetBlockId)&&e.some(e=>g(e)&&e.id===t.sourceBlockId),e=>{const n=e.findIndex(e=>g(e)&&e.id===t.targetBlockId),s=e.findIndex(e=>g(e)&&e.id===t.sourceBlockId);if(-1===n||-1===s)return e;const r=e[n],i=e[s],o=v(r),a=v(i),c=w([...o,...a]),l={...r,children:c};return e.filter(e=>!g(e)||e.id!==t.sourceBlockId).map(e=>g(e)&&e.id===t.targetBlockId?l:e)});return n?{children:n}:e}(e,t);case"addMark":return function(e,t){return St(e,t.blockId,e=>mt(e,t.from,t.to,t.mark,!0))}(e,t);case"removeMark":return function(e,t){return St(e,t.blockId,e=>mt(e,t.from,t.to,t.mark,!1))}(e,t);case"setStoredMarks":return e;case"setBlockType":return function(e,t){return lt(e,t.blockId,e=>({...e,type:t.nodeType,...t.attrs?{attrs:t.attrs}:{attrs:void 0}}))}(e,t);case"insertNode":return function(e,t){if(0===t.parentPath.length){const n=[...e.children];return n.splice(t.index,0,t.node),{children:n}}return ht(e,t.parentPath,e=>{const n=[...e.children];return n.splice(t.index,0,t.node),{...e,children:n}})}(e,t);case"removeNode":return function(e,t){if(0===t.parentPath.length){const n=[...e.children];return n.splice(t.index,1),{children:n}}return ht(e,t.parentPath,e=>{const n=[...e.children];return n.splice(t.index,1),{...e,children:n}})}(e,t);case"setNodeAttr":return function(e,t){const n=t.path[t.path.length-1];return n?lt(e,n,e=>({...e,attrs:t.attrs})):e}(e,t);case"insertInlineNode":return function(e,t){return St(e,t.blockId,e=>function(e,t,n){const s=[];let r=0,i=!1;for(const o of e){if(m(o)){i||t!==r||(s.push(n),i=!0),s.push(o),r+=1;continue}const e=r+o.text.length;if(!i&&t>=r&&t<=e){const e=t-r,a=o.text.slice(0,e),c=o.text.slice(e);a&&s.push(y(a,o.marks)),s.push(n),c&&s.push(y(c,o.marks)),i=!0}else s.push(o);r=e}return i||s.push(n),s}(e,t.offset,t.node))}(e,t);case"removeInlineNode":return function(e,t){return St(e,t.blockId,e=>function(e,t){const n=[];let s=0;for(const r of e)m(r)?(s!==t&&n.push(r),s+=1):(n.push(r),s+=r.text.length);return n}(e,t.offset))}(e,t);case"setInlineNodeAttr":return function(e,t){return St(e,t.blockId,e=>function(e,t,n){const s=[];let r=0;for(const i of e)m(i)?(r===t?s.push({...i,attrs:n}):s.push(i),r+=1):(s.push(i),r+=i.text.length);return s}(e,t.offset,t.attrs),!1)}(e,t)}}function St(e,t,n,s=!0){return lt(e,t,e=>{const t=v(e),r=n(t);return{...e,children:yt(e.children,s?w(r):r)}})}function bt(e){return e.path?{path:e.path}:{}}function vt(e){switch(e.type){case"insertText":return{type:"deleteText",blockId:e.blockId,from:e.offset,to:e.offset+e.text.length,deletedText:e.text,deletedMarks:e.marks,deletedSegments:e.segments??[{text:e.text,marks:[...e.marks]}],...bt(e)};case"deleteText":return{type:"insertText",blockId:e.blockId,offset:e.from,text:e.deletedText,marks:e.deletedMarks,segments:e.deletedSegments,...bt(e)};case"splitBlock":return{type:"mergeBlocks",targetBlockId:e.blockId,sourceBlockId:e.newBlockId,targetLengthBefore:e.offset,...bt(e)};case"mergeBlocks":return{type:"splitBlock",blockId:e.targetBlockId,offset:e.targetLengthBefore,newBlockId:e.sourceBlockId,...bt(e)};case"addMark":return{type:"removeMark",blockId:e.blockId,from:e.from,to:e.to,mark:e.mark,...bt(e)};case"removeMark":return{type:"addMark",blockId:e.blockId,from:e.from,to:e.to,mark:e.mark,...bt(e)};case"setStoredMarks":return{type:"setStoredMarks",marks:e.previousMarks,previousMarks:e.marks};case"setBlockType":return{type:"setBlockType",blockId:e.blockId,nodeType:e.previousNodeType,attrs:e.previousAttrs,previousNodeType:e.nodeType,previousAttrs:e.attrs,...bt(e)};case"insertNode":return{type:"removeNode",parentPath:e.parentPath,index:e.index,removedNode:e.node};case"removeNode":return{type:"insertNode",parentPath:e.parentPath,index:e.index,node:e.removedNode};case"setNodeAttr":return{type:"setNodeAttr",path:e.path,attrs:e.previousAttrs,previousAttrs:e.attrs};case"insertInlineNode":return{type:"removeInlineNode",blockId:e.blockId,offset:e.offset,removedNode:e.node,...bt(e)};case"removeInlineNode":return{type:"insertInlineNode",blockId:e.blockId,offset:e.offset,node:e.removedNode,...bt(e)};case"setInlineNodeAttr":return{type:"setInlineNodeAttr",blockId:e.blockId,offset:e.offset,attrs:e.previousAttrs,previousAttrs:e.attrs,...bt(e)}}}function wt(e){for(const t of e.steps)if("setStoredMarks"===t.type)return t.previousMarks;return e.storedMarksAfter}function Rt(e){return{steps:e.steps.map(vt).reverse(),selectionBefore:e.selectionAfter,selectionAfter:e.selectionBefore,storedMarksAfter:wt(e),metadata:{origin:"history",timestamp:Date.now()}}}class Ct{steps=[];selection;storedMarks;selectionBefore;origin;workingDoc;_readonlyAllowed=!1;constructor(e,t,n="api",s){this.selection=e,this.selectionBefore=e,this.storedMarks=t,this.origin=n,this.workingDoc=s??null}insertText(e,t,n,s,r){const i={type:"insertText",blockId:e,offset:t,text:n,marks:s,...r?{segments:r}:{}};return this.steps.push(i),this.advanceDoc(i),this}deleteText(e,t,n,s,r,i){let o;if(i)o=i;else if(this.workingDoc){const i=F(this.workingDoc,e);o=i?x(i,t,n):[{text:s,marks:[...r]}]}else o=[{text:s,marks:[...r]}];const a={type:"deleteText",blockId:e,from:t,to:n,deletedText:s,deletedMarks:r,deletedSegments:o};return this.steps.push(a),this.advanceDoc(a),this}deleteTextAt(e,t,n){const s=this.requireDoc("deleteTextAt"),r=this.requireBlock(s,e),i=I(r).slice(t,n),o=T(r,t),a=x(r,t,n);return this.deleteText(e,t,n,i,o,a)}splitBlock(e,t,n){const s={type:"splitBlock",blockId:e,offset:t,newBlockId:n};return this.steps.push(s),this.advanceDoc(s),this}mergeBlocks(e,t,n){const s={type:"mergeBlocks",targetBlockId:e,sourceBlockId:t,targetLengthBefore:n};return this.steps.push(s),this.advanceDoc(s),this}mergeBlocksAt(e,t){const n=this.requireDoc("mergeBlocksAt"),s=this.requireBlock(n,e),r=R(s);return this.mergeBlocks(e,t,r)}addMark(e,t,n,s){const r={type:"addMark",blockId:e,from:t,to:n,mark:s};return this.steps.push(r),this.advanceDoc(r),this}removeMark(e,t,n,s){const r={type:"removeMark",blockId:e,from:t,to:n,mark:s};return this.steps.push(r),this.advanceDoc(r),this}setBlockType(e,t,n){const s=this.requireDoc("setBlockType"),r=this.requireBlock(s,e),i={type:"setBlockType",blockId:e,nodeType:t,...n?{attrs:n}:{},previousNodeType:r.type,...r.attrs?{previousAttrs:r.attrs}:{}};return this.steps.push(i),this.advanceDoc(i),this}insertNode(e,t,n){const s={type:"insertNode",parentPath:e,index:t,node:n};return this.steps.push(s),this.advanceDoc(s),this}removeNode(e,t){const n=function(e,t,n){if(0===t.length){const t=e.children[n];return t&&g(t)?t:void 0}const s=K(e,t);if(!s)return;const r=s.children[n];return r&&g(r)?r:void 0}(this.requireDoc("removeNode"),e,t);if(!n)throw new Error(`Node at index ${t} not found under parent path [${e.join(", ")}].`);const s={type:"removeNode",parentPath:e,index:t,removedNode:n};return this.steps.push(s),this.advanceDoc(s),this}setNodeAttr(e,t){const n=this.requireDoc("setNodeAttr"),s=K(n,e);if(!s)throw new Error(`Node not found at path [${e.join(", ")}].`);const r={type:"setNodeAttr",path:e,attrs:t,...s.attrs?{previousAttrs:s.attrs}:{}};return this.steps.push(r),this.advanceDoc(r),this}insertInlineNode(e,t,n){const s={type:"insertInlineNode",blockId:e,offset:t,node:n};return this.steps.push(s),this.advanceDoc(s),this}removeInlineNode(e,t){const n=this.requireDoc("removeInlineNode"),s=this.requireBlock(n,e),r=P(s,t);if(!r||"inline"!==r.kind)throw new Error(`No InlineNode at offset ${t} in block "${e}".`);const i={type:"removeInlineNode",blockId:e,offset:t,removedNode:r.node};return this.steps.push(i),this.advanceDoc(i),this}setInlineNodeAttr(e,t,n){const s=this.requireDoc("setInlineNodeAttr"),r=this.requireBlock(s,e),i=v(r);let o=0;for(const a of i){if(m(a)&&o===t){const s={type:"setInlineNodeAttr",blockId:e,offset:t,attrs:n,previousAttrs:a.attrs};return this.steps.push(s),this.advanceDoc(s),this}o+=m(a)?1:a.text.length}throw new Error(`No InlineNode at offset ${t} in block "${e}".`)}readonlyAllowed(){return this._readonlyAllowed=!0,this}setSelection(e){return this.selection=e,this}setNodeSelection(e,t){return this.selection=$(e,t),this}setStoredMarks(e,t){return this.steps.push({type:"setStoredMarks",marks:e,previousMarks:t}),this.storedMarks=e,this}build(){return{steps:[...this.steps],selectionBefore:this.selectionBefore,selectionAfter:this.selection,storedMarksAfter:this.storedMarks,metadata:{origin:this.origin,timestamp:Date.now(),...this._readonlyAllowed?{readonlyAllowed:!0}:{}}}}requireDoc(e){if(!this.workingDoc)throw new Error(`${e} requires a document. Use state.transaction() or provide doc to constructor.`);return this.workingDoc}requireBlock(e,t){const n=F(e,t);if(!n)throw new Error(`Block "${t}" not found in working document.`);return n}advanceDoc(e){this.workingDoc&&(this.workingDoc=kt(this.workingDoc,e))}}class xt{doc;selection;storedMarks;schema;_blockMap=null;_blockOrder=null;constructor(e,t,n,s){this.doc=e,this.selection=t,this.storedMarks=n,this.schema=s}static create(e){const t=e?.schema??d(),n=e?.doc??E(),s=Pt(n.children),r=e?.selection??V(s?s.id:H(""),0);return new xt(n,r,null,t)}transaction(e="api"){return new Ct(this.selection,this.storedMarks,e,this.doc)}apply(e){let t=this.doc;for(const s of e.steps)t=kt(t,s);const n=function(e,t){if(U(t))return F(e,t.nodeId)?t:Tt(e,t);if(q(t))return F(e,t.blockId)?t:Tt(e,t);const n=It(e,t.anchor),s=It(e,t.head);return n===t.anchor&&s===t.head?t:W(n,s)}(t,e.selectionAfter);return new xt(t,n,e.storedMarksAfter,this.schema)}getBlock(e){return this._blockMap??=function(e){const t=/* @__PURE__ */new Map;return function e(n){for(const s of n)g(s)&&(t.set(s.id,s),e(s.children))}(e.children),t}(this.doc),this._blockMap.get(e)}getBlockOrder(){return this._blockOrder??=function(e){const t=[];return function e(n){for(const s of n)g(s)&&(B(s)?t.push(s.id):e(s.children))}(e.children),t}(this.doc),this._blockOrder}getNodePath(e){return j(this.doc,e)}getParent(e){const t=j(this.doc,e);if(!t||t.length<=1)return;const n=t[t.length-2];return n?F(this.doc,n):void 0}toJSON(){return{doc:this.doc,selection:this.selection}}static fromJSON(e,t){return new xt(e.doc,e.selection,null,t??d())}}function It(e,t){const n=F(e,t.blockId);if(n){const e=R(n);return t.offset>e?G(t.blockId,e,t.path):t}const s=e.children[0];return s?G(s.id,0):t}function Tt(e,t){const n=Pt(e.children);return n?V(n.id,0):t}function Pt(e){for(const t of e){if(!g(t))continue;if(B(t))return t;const e=Pt(t.children);if(e)return e}return null}function Et(e){for(const t of e.steps)if("setStoredMarks"!==t.type)return!1;return!0}function Bt(e){return!!e.metadata.readonlyAllowed||Et(e)}class Mt{undoStack=[];redoStack=[];groupTimeoutMs;maxDepth;lastOrigin=null;constructor(e){this.groupTimeoutMs=e?.groupTimeoutMs??500,this.maxDepth=e?.maxDepth??100}push(e){if("history"===e.metadata.origin)return;if(!e.steps.some(e=>"setStoredMarks"!==e.type))return void(this.lastOrigin=null);const t=e.metadata.timestamp,n=this.undoStack[this.undoStack.length-1];for(n&&"input"===e.metadata.origin&&"input"===this.lastOrigin&&t-n.timestamp<this.groupTimeoutMs&&this.isSameInputType(n.transactions,e)&&n?this.undoStack[this.undoStack.length-1]={transactions:[...n.transactions,e],timestamp:t}:this.undoStack.push({transactions:[e],timestamp:t}),this.lastOrigin=e.metadata.origin,this.redoStack=[];this.undoStack.length>this.maxDepth;)this.undoStack.shift()}undo(e){const t=this.undoStack.pop();if(!t)return null;let n=e;const s=[];for(let r=t.transactions.length-1;r>=0;r--){const e=t.transactions[r];if(!e)continue;const i=Rt(e);n=n.apply(i),s.push(...i.steps)}return this.redoStack.push({transactions:t.transactions,timestamp:Date.now()}),this.lastOrigin=null,{state:n,transaction:{steps:s,selectionBefore:e.selection,selectionAfter:n.selection,storedMarksAfter:n.storedMarks,metadata:{origin:"history",timestamp:Date.now(),historyDirection:"undo"}}}}redo(e){const t=this.redoStack.pop();if(!t)return null;let n=e;const s=[];for(const r of t.transactions)n=n.apply(r),s.push(...r.steps);return this.undoStack.push({transactions:t.transactions,timestamp:Date.now()}),this.lastOrigin=null,{state:n,transaction:{steps:s,selectionBefore:e.selection,selectionAfter:n.selection,storedMarksAfter:n.storedMarks,metadata:{origin:"history",timestamp:Date.now(),historyDirection:"redo"}}}}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}clear(){this.undoStack=[],this.redoStack=[],this.lastOrigin=null}isSameInputType(e,t){const n=e[e.length-1];if(!n)return!1;const s=n.steps[0]?.type,r=t.steps[0]?.type;return s===r}}function At(t,n){const s=t.selection;if(U(s))return le(t,s);if(q(s))return null;if(!Q(s))return e(t);const r=t.getBlock(s.anchor.blockId);if(!r)return null;const i=n.range(r,s.anchor.offset);if(!i)return n.merge(t);const[o,a]=i;return t.transaction("input").deleteTextAt(r.id,o,a).setSelection(V(r.id,o)).build()}function Nt(e){return At(e,{merge:n,range:(e,t)=>t>0?[t-1,t]:null})}function Dt(e){return At(e,{merge:t,range:(e,t)=>t<R(e)?[t,t+1]:null})}class Ot{constructor(e,t){this.element=e,this.getState=t.getState,this.dispatch=t.dispatch,this.undo=t.undo,this.redo=t.redo,this.keymapRegistry=t.keymapRegistry,this.isReadOnly=t.isReadOnly??(()=>!1),this.compositionTracker=t.compositionTracker,this.getTextDirectionFn=t.getTextDirection??(()=>"ltr"),this.navigateFromGapCursorFn=t.navigateFromGapCursor,this.handleKeydown=this.onKeydown.bind(this),e.addEventListener("keydown",this.handleKeydown)}getState;dispatch;undo;redo;keymapRegistry;isReadOnly;compositionTracker;getTextDirectionFn;navigateFromGapCursorFn;handleKeydown;onKeydown(e){if(this.compositionTracker?.isComposing)return;if(this.handleNodeSelectionKeys(e))return;if(this.handleGapCursorKeys(e))return;if(this.isReadOnly()){if(this.keymapRegistry){const t=Lt(e),n=this.keymapRegistry.getKeymapsByPriority().navigation;for(let s=n.length-1;s>=0;s--){const r=n[s]?.[t];if(r?.())return void e.preventDefault()}}return void this.handleEscape(e)}if(this.keymapRegistry){const t=Lt(e),n=this.keymapRegistry.getKeymapsByPriority();for(const s of[n.context,n.navigation,n.default])for(let n=s.length-1;n>=0;n--){const r=s[n]?.[t];if(r?.())return void e.preventDefault()}}if(this.handleGapCursorArrowFallback(e))return;if(this.handleTab(e))return;if(this.handleEscape(e))return;if(!e.metaKey&&!e.ctrlKey)return;const t=e.key.toLowerCase(),n=this.getState();let r=null;return"z"!==t||e.shiftKey?"z"===t&&e.shiftKey||"y"===t&&!e.shiftKey?(e.preventDefault(),void this.redo()):("a"!==t||e.shiftKey||(e.preventDefault(),r=s(n)),void(r&&this.dispatch(r))):(e.preventDefault(),void this.undo())}handleNodeSelectionKeys(e){const t=this.getState(),n=t.selection;if(!U(n))return!1;const s=e.key;if(!("ArrowLeft"!==s&&"ArrowUp"!==s&&"ArrowRight"!==s&&"ArrowDown"!==s||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)){const r="ArrowLeft"===s?"left":"ArrowRight"===s?"right":"ArrowUp"===s?"up":"down",i=this.isSelectedBlockRtl(n.nodeId),o=de(t,r,i);return!!o&&(e.preventDefault(),this.dispatch(o),!0)}if("Backspace"===s||"Delete"===s){if(this.isReadOnly())return e.preventDefault(),!0;e.preventDefault();const s=le(t,n);return s&&this.dispatch(s),!0}if("Enter"===s){if(this.isReadOnly())return e.preventDefault(),!0;e.preventDefault();const n=r(t);return n&&this.dispatch(n),!0}if("Escape"===s){e.preventDefault();const n=de(t,"right");return n&&this.dispatch(n),!0}return!1}handleGapCursorKeys(e){const t=this.getState(),n=t.selection;if(!q(n))return!1;const s=e.key;if("ArrowLeft"===s||"ArrowRight"===s||"ArrowUp"===s||"ArrowDown"===s)return!1;if("Escape"===s||"Tab"===s)return!1;if(e.ctrlKey||e.metaKey||e.altKey)return!1;if("Enter"===s){if(this.isReadOnly())return e.preventDefault(),!0;e.preventDefault();const n=r(t);return n&&this.dispatch(n),!0}if("Backspace"===s){if(this.isReadOnly())return e.preventDefault(),!0;e.preventDefault();const s=i(t,n);return s&&this.dispatch(s),!0}if("Delete"===s){if(this.isReadOnly())return e.preventDefault(),!0;e.preventDefault();const s=o(t,n);return s&&this.dispatch(s),!0}if(1===s.length){if(this.isReadOnly())return e.preventDefault(),!0;e.preventDefault();const n=a(t,s);return this.dispatch(n),!0}return!1}handleGapCursorArrowFallback(e){const t=this.getState(),n=t.selection;if(!q(n))return!1;const s=e.key;if("ArrowLeft"!==s&&"ArrowRight"!==s&&"ArrowUp"!==s&&"ArrowDown"!==s)return!1;const r="ArrowLeft"===s?"left":"ArrowRight"===s?"right":"ArrowUp"===s?"up":"down";if(!this.navigateFromGapCursorFn)return!1;const i=this.navigateFromGapCursorFn(t,r,this.element);return!(!i||J(i.selectionAfter,n)||(e.preventDefault(),this.dispatch(i),0))}handleTab(e){if("Tab"!==e.key)return!1;if(e.metaKey||e.ctrlKey||e.altKey)return!1;if(e.preventDefault(),e.shiftKey)return!0;const t=this.getState(),n=a(t,"\t");return this.dispatch(n),!0}handleEscape(e){return"Escape"===e.key&&(this.element.blur(),!0)}isSelectedBlockRtl(e){const t=this.element.querySelector(`[data-block-id="${e}"]`);return t instanceof HTMLElement&&"rtl"===this.getTextDirectionFn(t)}destroy(){this.element.removeEventListener("keydown",this.handleKeydown)}}function Lt(e){const t=[];(e.metaKey||e.ctrlKey)&&t.push("Mod"),e.shiftKey&&t.push("Shift"),e.altKey&&t.push("Alt");let n=e.key;return" "===n?n="Space":1===n.length&&(n=n.toUpperCase()),t.push(n),t.join("-")}function Ht(e,t){if(B(e))return t.selectedLeafIds.has(e.id)?function(e,t){const n=R(e),s=e.id===t.firstBlockId?t.firstOffset:0,r=e.id===t.lastBlockId?t.lastOffset:n;if(0===s&&r===n)return e;const i=A(e,s,r),o=w(i.map(e=>"inline"===e.kind?e.node:y(e.text,e.marks)));return{...e,children:o}}(e,t):null;const n=M(e),s=[];let r=n.length!==e.children.length;for(const i of n){const e=Ht(i,t);e?(s.push(e),e!==i&&(r=!0)):r=!0}return 0===s.length?null:r?{...e,children:s}:e}class _t{constructor(e,t){this.element=e,this.getState=t.getState,this.dispatch=t.dispatch,this.schemaRegistry=t.schemaRegistry,this.syncSelection=t.syncSelection,this.isReadOnly=t.isReadOnly??(()=>!1),this.handleCopy=this.onCopy.bind(this),this.handleCut=this.onCut.bind(this),e.addEventListener("copy",this.handleCopy),e.addEventListener("cut",this.handleCut)}getState;dispatch;schemaRegistry;syncSelection;isReadOnly;handleCopy;handleCut;onCopy(e){this.syncSelection?.();const t=this.getState(),n=t.selection;if(q(n))return;if(Y(n)&&Q(n))return;e.preventDefault();const s=e.clipboardData;s&&(U(n)?this.writeNodeSelectionToClipboard(s,t):this.writeTextSelectionToClipboard(s,t))}onCut(t){if(this.isReadOnly())return;this.syncSelection?.();const n=this.getState(),s=n.selection;if(q(s))return;if(Y(s)&&Q(s))return;t.preventDefault();const r=t.clipboardData;if(r)if(U(s)){this.writeNodeSelectionToClipboard(r,n);const e=le(n,s);e&&this.dispatch(e)}else{this.writeTextSelectionToClipboard(r,n);const t=e(n);t&&this.dispatch(t)}}writeNodeSelectionToClipboard(e,t){const n=t.selection;if(!U(n))return;const s=t.getBlock(n.nodeId);if(!s)return;const r={type:s.type,...s.attrs?{attrs:{...s.attrs}}:{}};e.setData("application/x-notectl-block",JSON.stringify(r));const i=this.schemaRegistry?.getNodeSpec(s.type);i?.toHTML&&e.setData("text/html",i.toHTML(s,""));const o=s.attrs,a="string"==typeof o?.alt?o.alt:"";e.setData("text/plain",a)}writeTextSelectionToClipboard(e,t){const n=t.selection;if(U(n))return;if(q(n))return;if(Q(n))return;if(this.selectionRequiresDocumentSerializer(t))return void this.writeCompositeSelectionToClipboard(e,t);const s=t.getBlockOrder(),r=X(n,s),i=s.indexOf(r.from.blockId),o=s.indexOf(r.to.blockId),a=[],c=[],l=[];for(let h=i;h<=o;h++){const e=s[h];if(!e)continue;const n=t.getBlock(e);if(!n)continue;const d=R(n),p=h===i?r.from.offset:0,u=h===o?r.to.offset:d,f=this.extractSegmentsForRange(n,p,u),g=this.plainTextFromSegments(f);a.push(g),l.push({block:n,start:p,end:u}),c.push({type:n.type,text:g,...n.attrs?{attrs:{...n.attrs}}:{},...f.length>0?{segments:f}:{}})}const d=a.join("\n");if(e.setData("text/plain",d),this.schemaRegistry){const n=he(this.schemaRegistry),a=i!==o,d=c.some(e=>void 0!==e.type&&"paragraph"!==e.type);if(a||this.containsInlineSegments(c)||d){const t=this.serializeBlocksToClipboardHTML(l,n,c);e.setData("text/html",t)}else{const o=s[i],a=o?t.getBlock(o):void 0;if(a){const t=this.serializeBlockRangeToHTML(a,r.from.offset,r.to.offset,n);e.setData("text/html",t)}}}}selectionRequiresDocumentSerializer(e){const t=this.getTextSelection(e);if(!t||Q(t))return!1;const n=e.getBlockOrder(),s=X(t,n),r=j(e.doc,s.from.blockId),i=j(e.doc,s.to.blockId);if(!r||!i)return!1;if(r[0]===i[0]){const t=e.doc.children.find(e=>e.id===r[0]);return!(!t||B(t))}const o=e.doc.children.findIndex(e=>e.id===r[0]),a=e.doc.children.findIndex(e=>e.id===i[0]);for(let c=o;c<=a;c++){const t=e.doc.children[c];if(!t)continue;if(!B(t))return!0;const n=this.schemaRegistry?.getNodeSpec(t.type);if(n?.isVoid)return!0}return!1}getTextSelection(e){const t=e.selection;if(Y(t))return t}extractPlainTextForRange(e,t,n){return this.plainTextFromSegments(this.extractSegmentsForRange(e,t,n))}plainTextFromSegments(e){return e.map(e=>"inline"===e.kind?"":e.text).join("")}writeCompositeSelectionToClipboard(e,t){const n=this.getTextSelection(t);if(!n)return;const s=t.getBlockOrder(),r=X(n,s),i=s.indexOf(r.from.blockId),o=s.indexOf(r.to.blockId),a=[];for(let c=i;c<=o;c++){const e=s[c];if(!e)continue;const n=t.getBlock(e);if(!n)continue;const l=c===i?r.from.offset:0,d=c===o?r.to.offset:R(n);a.push(this.extractPlainTextForRange(n,l,d))}if(e.setData("text/plain",a.join("\n")),this.schemaRegistry){const s=function(e,t){const n=e.getBlockOrder(),s=X(t,n),r=n.indexOf(s.from.blockId),i=n.indexOf(s.to.blockId);if(-1===r||-1===i||r>i)return{children:[]};const o=e.getNodePath(s.from.blockId),a=e.getNodePath(s.to.blockId),c=o?.[0],l=a?.[0];if(!c||!l)return{children:[]};const d=e.doc.children.findIndex(e=>e.id===c),h=e.doc.children.findIndex(e=>e.id===l);if(-1===d||-1===h||d>h)return{children:[]};const p={firstBlockId:s.from.blockId,firstOffset:s.from.offset,lastBlockId:s.to.blockId,lastOffset:s.to.offset,selectedLeafIds:new Set(n.slice(r,i+1))},u=[];for(let f=d;f<=h;f++){const t=e.doc.children[f];if(!t)continue;const n=Ht(t,p);n&&u.push(n)}return{children:u}}(t,n);if(s.children.length>0){const t=pe(s,this.schemaRegistry);e.setData("text/html",t)}}}serializeBlockRangeToHTML(e,t,n,s){const r=v(e),i=[];let o=0;for(const a of r){const e=o+(m(a)?1:a.text.length);if(e<=t||o>=n)o=e;else{if(k(a)){const e=Math.max(0,t-o),r=Math.min(a.text.length,n-o),c=a.text.slice(e,r);c.length>0&&this.schemaRegistry&&i.push(ue(c,a.marks,this.schemaRegistry,s))}else if(m(a)){const e=this.schemaRegistry?.getInlineNodeSpec(a.inlineType);e?.toHTMLString&&i.push(e.toHTMLString(a))}o=e}}return i.join("")}extractSegmentsForRange(e,t,n){const s=v(e),r=[];let i=0;for(const o of s){const e=i+(m(o)?1:o.text.length);if(e<=t||i>=n)i=e;else{if(k(o)){const e=Math.max(0,t-i),s=Math.min(o.text.length,n-i),a=o.text.slice(e,s);if(a.length>0){const e=o.marks.map(e=>({type:e.type,...e.attrs?{attrs:{...e.attrs}}:{}}));r.push({text:a,marks:e})}}else m(o)&&r.push({kind:"inline",inlineType:o.inlineType,...Object.keys(o.attrs).length>0?{attrs:{...o.attrs}}:{}});i=e}}return r}containsInlineSegments(e){return e.some(e=>e.segments?.some(e=>"inline"===e.kind))}serializeBlocksToClipboardHTML(e,t,n){const s=[];let r,i=[];const o=()=>{i.length>0&&r&&(s.push(`<${r}>${i.join("")}</${r}>`),i=[],r=void 0)};for(const c of e){const{block:e,start:n,end:a}=c,l=this.serializeBlockRangeToHTML(e,n,a,t),d=this.schemaRegistry?.getNodeSpec(e.type);if(d?.wrapper){const t=d.wrapper(e).tag;r!==t&&(o(),r=t),d.toHTML?i.push(d.toHTML(e,l)):i.push(`<li>${l}</li>`)}else o(),d?.toHTML?s.push(d.toHTML(e,l)):s.push(`<p>${l}</p>`)}o();const a=JSON.stringify(n).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""");return s.push(`<span data-notectl-rich="${a}" hidden></span>`),s.join("")}destroy(){this.element.removeEventListener("copy",this.handleCopy),this.element.removeEventListener("cut",this.handleCut)}}class zt{_composing=!1;_activeBlockId=null;get isComposing(){return this._composing}get activeBlockId(){return this._activeBlockId}start(e){this._composing=!0,this._activeBlockId=e}end(){this._composing=!1,this._activeBlockId=null}}class Ft{constructor(e,t){this.element=e,this.getState=t.getState,this.dispatch=t.dispatch,this.syncSelection=t.syncSelection,this.inputRuleRegistry=t.inputRuleRegistry,this.isReadOnly=t.isReadOnly??(()=>!1),this.compositionTracker=t.compositionTracker??new zt,this.handleBeforeInput=this.onBeforeInput.bind(this),this.handleCompositionStart=this.onCompositionStart.bind(this),this.handleCompositionEnd=this.onCompositionEnd.bind(this),e.addEventListener("beforeinput",this.handleBeforeInput),e.addEventListener("compositionstart",this.handleCompositionStart),e.addEventListener("compositionend",this.handleCompositionEnd)}getState;dispatch;syncSelection;inputRuleRegistry;isReadOnly;compositionTracker;compositionCommitHandled=!1;handleBeforeInput;handleCompositionStart;handleCompositionEnd;onBeforeInput(e){if(this.isReadOnly())return;if(this.compositionTracker.isComposing&&"insertCompositionText"===e.inputType)return;if(!function(e){switch(e){case"insertText":case"insertReplacementText":case"insertFromComposition":case"insertParagraph":case"insertLineBreak":case"deleteContentBackward":case"deleteContentForward":case"deleteWordBackward":case"deleteWordForward":case"deleteSoftLineBackward":case"deleteSoftLineForward":case"deleteByCut":case"insertFromPaste":case"insertFromDrop":case"formatBold":case"formatItalic":case"formatUnderline":case"historyUndo":case"historyRedo":return!0;default:return!1}}(e.inputType))return;"insertText"!==e.inputType&&"insertCompositionText"!==e.inputType&&"insertFromComposition"!==e.inputType&&this.syncSelection(),e.preventDefault();const s=this.getState();let i=null;switch(e.inputType){case"insertText":case"insertReplacementText":e.data&&(i=a(s,e.data,"input"));break;case"insertFromComposition":e.data&&(this.compositionCommitHandled=!0,i=a(s,e.data,"input"));break;case"insertParagraph":i=r(s);break;case"insertLineBreak":i=c(s);break;case"deleteContentBackward":i=Nt(s);break;case"deleteContentForward":i=Dt(s);break;case"deleteWordBackward":i=function(e){return At(e,{merge:n,range:(e,t)=>t>0?[me(e,t),t]:null})}(s);break;case"deleteWordForward":i=function(e){return At(e,{merge:t,range:(e,t)=>t<R(e)?[t,ge(e,t)]:null})}(s);break;case"deleteSoftLineBackward":i=function(e){return At(e,{merge:n,range:(e,t)=>t>0?[0,t]:null})}(s);break;case"deleteSoftLineForward":i=function(e){return At(e,{merge:t,range:(e,t)=>{const n=R(e);return t<n?[t,n]:null}})}(s)}i&&(this.dispatch(i),"insertText"!==e.inputType&&"insertReplacementText"!==e.inputType||this.checkInputRules())}onCompositionStart(e){const t=this.getState();Y(t.selection)&&(this.compositionCommitHandled=!1,this.compositionTracker.start(t.selection.anchor.blockId))}onCompositionEnd(e){if(this.compositionTracker.end(),this.isReadOnly())return;if(this.compositionCommitHandled)return void(this.compositionCommitHandled=!1);const t=e.data;if(!t)return;const n=this.getState(),s=a(n,t,"input");this.dispatch(s)}checkInputRules(){if(!this.inputRuleRegistry)return;const e=this.inputRuleRegistry.getInputRules();if(0===e.length)return;const t=this.getState();if(!Y(t.selection))return;const{anchor:n}=t.selection,s=t.getBlock(n.blockId);if(!s)return;const r=I(s).slice(0,n.offset);for(const i of e){const e=i.pattern.exec(r);if(e){const n=e.index,s=n+e[0].length,r=i.handler(t,e,n,s);if(r)return void this.dispatch(r)}}}destroy(){this.element.removeEventListener("beforeinput",this.handleBeforeInput),this.element.removeEventListener("compositionstart",this.handleCompositionStart),this.element.removeEventListener("compositionend",this.handleCompositionEnd)}}function Kt(e){return e.reduce((e,t)=>e+t.text,"")}function jt(e){return e.reduce((e,t)=>e+t.text.length,0)}function $t(e,t){if(0===t.blocks.length)return e.transaction("paste").setSelection(e.selection).build();const n=t.blocks[0];return n?1===t.blocks.length&&n.type===_("paragraph")?function(e,t){const n=e.selection;if(U(n))return e.transaction("paste").setSelection(n).build();if(q(n))return function(e,t,n){const s=Vt(e,t);if(!s)return e.transaction("paste").setSelection(t).build();const r=N(),i=Kt(n),o=jt(n),a=e.transaction("paste");return a.insertNode(s.parentPath,s.insertIndex,C(_("paragraph"),[y("")],r)),i.length>0&&a.insertText(r,0,i,[],n),a.setSelection(V(r,o)),a.build()}(e,n,t);const s=e.transaction("paste");Q(n)||l(e,s);const{blockId:r,offset:i}=_e(n,e.getBlockOrder()),o=jt(t),a=Kt(t);return s.insertText(r,i,a,[],t),s.setSelection(V(r,i+o)),s.build()}(e,n.segments):1===t.blocks.length?function(e,t){const n=e.selection;if(U(n))return e.transaction("paste").setSelection(n).build();if(q(n))return Ut(e,n,[t]);const s=e.transaction("paste");Q(n)||l(e,s);const{blockId:r,offset:i}=_e(n,e.getBlockOrder()),o=jt(t.segments),a=Kt(t.segments);return s.setBlockType(r,t.type,t.attrs),s.insertText(r,i,a,[],t.segments),s.setSelection(V(r,i+o)),s.build()}(e,n):function(e,t){const n=e.selection;if(U(n))return e.transaction("paste").setSelection(n).build();if(q(n))return Ut(e,n,t.blocks);const s=e.transaction("paste");Q(n)||l(e,s);const r=e.getBlockOrder(),{blockId:i,offset:o}=_e(n,r),a=r.indexOf(i),c=t.blocks[0],d=t.blocks[t.blocks.length-1];if(!c||!d)return s.build();const h=t.blocks.slice(1,-1),p=jt(c.segments);c.segments.length>0&&p>0&&s.insertText(i,o,Kt(c.segments),[],c.segments),c.type!==_("paragraph")&&s.setBlockType(i,c.type,c.attrs);const u=o+p,f=N();s.splitBlock(i,u,f);let g=a+1;for(const l of h){const e=l.segments.map(e=>y(e.text,[...e.marks])),t=C(l.type,e.length>0?e:void 0,N(),l.attrs);s.insertNode([],g,t),g++}const m=jt(d.segments);return d.segments.length>0&&m>0&&s.insertText(f,0,Kt(d.segments),[],d.segments),d.type!==_("paragraph")&&s.setBlockType(f,d.type,d.attrs),s.setSelection(V(f,m)),s.build()}(e,t):e.transaction("paste").setSelection(e.selection).build()}function Vt(e,t){const n=j(e.doc,t.blockId);if(!n)return null;const s=ze(n),r=Fe(e,s),i=Ke(r,t.blockId);return i<0?null:{parentPath:s,insertIndex:"before"===t.side?i:i+1}}function Ut(e,t,n){const s=Vt(e,t);if(!s)return e.transaction("paste").setSelection(t).build();const r=e.transaction("paste");let i,o=s.insertIndex,a=0;for(const c of n){const e=N(),t=Kt(c.segments),n=c.segments.map(e=>y(e.text,[...e.marks])),l=C(c.type,n.length>0?n:[y("")],e,c.attrs);r.insertNode(s.parentPath,o,l),o++,i=e,a=t.length}return i&&r.setSelection(V(i,a)),r.build()}const qt=/* @__PURE__ */new Set(["P","DIV","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","LI","HR","PRE","TABLE","THEAD","TBODY","TR"]),Wt=/* @__PURE__ */new Set(["STRONG","B","EM","I","U","S","STRIKE","DEL","A","SPAN","BR","SUB","SUP","CODE"]),Gt=/^H([1-6])$/;function Qt(e){const t=e.style.fontWeight,n=Number.parseInt(t,10);return!("normal"===t||!Number.isNaN(n)&&n<700)&&{}}const Jt=/* @__PURE__ */new Map([["STRONG",{markName:"bold",getAttrs:Qt}],["B",{markName:"bold",getAttrs:Qt}],["EM",{markName:"italic"}],["I",{markName:"italic"}],["U",{markName:"underline"}],["S",{markName:"strikethrough"}],["STRIKE",{markName:"strikethrough"}],["DEL",{markName:"strikethrough"}],["A",{markName:"link",getAttrs:function(e){return{href:e.getAttribute("href")??""}}}]]);class Xt{schema;blockParseRules;markParseRules;blockTagHandlers;constructor(e){this.schema=e.schema,this.blockParseRules=e.schemaRegistry?.getBlockParseRules()??[],this.markParseRules=e.schemaRegistry?.getMarkParseRules()??[],this.blockTagHandlers=this.buildBlockTagHandlers()}parse(e){const t=this.parseContainer(e);return 0===t.length?{blocks:[{type:this.resolveBlockType(_("paragraph")),segments:[{text:"",marks:[]}]}]}:{blocks:t}}buildBlockTagHandlers(){const e=e=>this.parseBlockWithLineBreaks(e,this.resolveBlockType(_("paragraph"))),t=e=>this.parseTableAsParagraphs(e);/* @__PURE__ */
|
|
3
|
-
return new Map([["P",e],["DIV",e],["BLOCKQUOTE",e=>this.parseBlockquote(e)],["UL",e=>this.parseList(e,"bullet",0)],["OL",e=>this.parseList(e,"ordered",0)],["LI",e=>this.parseListItem(e,"bullet",0)],["HR",()=>[{type:this.resolveBlockType(_("horizontal_rule")),segments:[]}]],["PRE",e=>[{type:this.resolveBlockType(_("paragraph")),segments:this.ensureSegments(this.parsePreContent(e))}]],["TABLE",t],["THEAD",t],["TBODY",t],["TR",t]])}parseContainer(e){const t=[];let n=[];for(const s of Array.from(e.childNodes))if(s.nodeType===Node.ELEMENT_NODE){const e=s;this.isBlockElement(e)?(this.flushPendingSegments(t,n),n=[],t.push(...this.parseBlockElement(e))):e.children.length>0&&this.containsBlockDescendants(e)?(this.flushPendingSegments(t,n),n=[],t.push(...this.parseContainerWithMarks(e,this.marksFromElement(e)))):n.push(...this.parseInlineNode(s,[]))}else if(s.nodeType===Node.TEXT_NODE){const e=s.textContent??"";e&&n.push({text:e,marks:[]})}return this.flushPendingSegments(t,n),t}parseBlockElement(e){const t=Gt.exec(e.tagName);if(t)return this.parseHeading(e,Number(t[1]));const n=this.blockTagHandlers.get(e.tagName);return n?n(e):this.parseUnknownBlock(e)}parseHeading(e,t){const n=this.resolveBlockType(_("heading"));return[{type:n,...n===_("heading")?{attrs:{level:t}}:{},segments:this.ensureSegments(this.parseInlineChildren(e,[]))}]}parseUnknownBlock(e){const t=this.matchBlockRule(e);return t?[{type:t.type,...t.attrs?{attrs:t.attrs}:{},segments:this.ensureSegments(this.parseInlineChildren(e,[]))}]:[{type:this.resolveBlockType(_("paragraph")),segments:this.ensureSegments(this.parseInlineChildren(e,[]))}]}parseBlockquote(e){const t=this.resolveBlockType(_("blockquote"));return Array.from(e.childNodes).some(e=>e.nodeType===Node.ELEMENT_NODE&&this.isBlockElement(e))?this.parseContainer(e).map(e=>({type:t,segments:e.segments})):[{type:t,segments:this.ensureSegments(this.parseInlineChildren(e,[]))}]}parseList(e,t,n){const s=[];for(const r of Array.from(e.children)){const e=r;"LI"===e.tagName?s.push(...this.parseListItem(e,t,n)):"UL"===e.tagName?s.push(...this.parseList(e,"bullet",n+1)):"OL"===e.tagName&&s.push(...this.parseList(e,"ordered",n+1))}return s}parseListItem(e,t,n){const s=[],r=this.resolveBlockType(_("list_item")),i=this.hasCheckbox(e),o=i?"checklist":t,a=!!i&&this.isCheckboxChecked(e),c=[],l=[];for(const d of Array.from(e.childNodes))if(d.nodeType===Node.ELEMENT_NODE){const e=d;"UL"===e.tagName||"OL"===e.tagName?l.push(e):"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")||(this.isBlockElement(e)?c.push(...this.parseInlineChildren(e,[])):c.push(...this.parseInlineNode(d,[])))}else if(d.nodeType===Node.TEXT_NODE){const e=d.textContent??"";e&&c.push({text:e,marks:[]})}s.push({type:r,attrs:{listType:o,indent:n,..."checklist"===o?{checked:a}:{}},segments:this.ensureSegments(this.normalizeSegments(c))});for(const d of l){const e="OL"===d.tagName?"ordered":"bullet";s.push(...this.parseList(d,e,n+1))}return s}parseInlineChildren(e,t){const n=[];for(const s of Array.from(e.childNodes))n.push(...this.parseInlineNode(s,t));return this.normalizeSegments(n)}parseInlineNode(e,t){if(e.nodeType===Node.TEXT_NODE){const n=e.textContent??"";return n?[{text:n,marks:this.resolveMarks(t)}]:[]}if(e.nodeType!==Node.ELEMENT_NODE)return[];const n=e,s=n.tagName;if("BR"===s)return[{text:"\n",marks:this.resolveMarks(t)}];if(this.isBlockElement(n)&&!Wt.has(s))return this.parseInlineChildren(n,t);const r=this.mergeMarks(t,this.marksFromElement(n));return this.parseInlineChildren(n,r)}parsePreContent(e){const t=e.textContent??"";return t?[{text:t,marks:[]}]:[]}parseTableAsParagraphs(e){const t=[],n=e.querySelectorAll("td, th");for(const s of Array.from(n)){const e=this.parseInlineChildren(s,[]);e.length>0&&e.some(e=>e.text.length>0)&&t.push({type:this.resolveBlockType(_("paragraph")),segments:this.ensureSegments(e)})}return t}marksFromElement(e){return this.matchMarkRules(e)||this.fallbackMarksFromElement(e)}matchMarkRules(e){if(0===this.markParseRules.length)return null;const t=e.tagName.toLowerCase(),n=[],s=/* @__PURE__ */new Set;for(const r of this.markParseRules)if(r.rule.tag===t&&!s.has(r.type)){if(r.rule.getAttrs){const t=r.rule.getAttrs(e);if(!1===t)continue;n.push({type:z(r.type),...Object.keys(t).length>0?{attrs:t}:{}})}else n.push({type:z(r.type)});s.add(r.type)}return s.size>0?n:null}fallbackMarksFromElement(e){const t=Jt.get(e.tagName);if(!t)return[];if(t.getAttrs){const n=t.getAttrs(e);return!1===n?[]:Object.keys(n).length>0?[{type:z(t.markName),attrs:n}]:[{type:z(t.markName)}]}return[{type:z(t.markName)}]}mergeMarks(e,t){const n=[...e];for(const s of t)n.some(e=>e.type===s.type)||n.push(s);return n}resolveMarks(e){return e.filter(e=>h(this.schema,e.type))}resolveBlockType(e){return p(this.schema,e)?e:_("paragraph")}normalizeSegments(e){if(0===e.length)return[];const t=[];for(const n of e){const e=t[t.length-1];e&&D(e.marks,n.marks)?t[t.length-1]={text:e.text+n.text,marks:e.marks}:n.text.length>0&&t.push(n)}return t}ensureSegments(e){return 0===e.length?[{text:"",marks:[]}]:e}matchBlockRule(e){const t=e.tagName.toLowerCase();for(const n of this.blockParseRules)if(n.rule.tag===t){if(n.rule.getAttrs){const t=n.rule.getAttrs(e);if(!1===t)continue;return{type:_(n.type),attrs:t}}return{type:_(n.type)}}return null}isBlockElement(e){if(qt.has(e.tagName))return!0;const t=e.tagName.toLowerCase();return this.blockParseRules.some(e=>e.rule.tag===t)}hasCheckbox(e){return null!==e.querySelector('input[type="checkbox"]')}isCheckboxChecked(e){const t=e.querySelector('input[type="checkbox"]');return t?.hasAttribute("checked")??!1}containsBlockDescendants(e){for(const t of Array.from(e.children)){if(this.isBlockElement(t))return!0;if(this.containsBlockDescendants(t))return!0}return!1}parseContainerWithMarks(e,t){const n=this.parseContainer(e);return 0===t.length?n:n.map(e=>({...e,segments:this.prependMarks(e.segments,t)}))}prependMarks(e,t){return e.map(e=>({text:e.text,marks:this.mergeMarks(t,e.marks)}))}parseBlockWithLineBreaks(e,t){const n=this.parseInlineChildren(e,[]);if(!n.some(e=>e.text.includes("\n")))return[{type:t,segments:this.ensureSegments(n)}];const s=[];let r=[];for(const i of n){const e=i.text.split("\n");for(let n=0;n<e.length;n++){n>0&&(s.push({type:t,segments:this.ensureSegments(this.normalizeSegments(r))}),r=[]);const o=e[n]??"";o&&r.push({text:o,marks:i.marks})}}return s.push({type:t,segments:this.ensureSegments(this.normalizeSegments(r))}),s}flushPendingSegments(e,t){const n=this.normalizeSegments(t);0!==n.length&&(n.every(e=>""===e.text.trim())||e.push({type:this.resolveBlockType(_("paragraph")),segments:n}))}}const Yt={1:"x-small",2:"small",3:"medium",4:"large",5:"x-large",6:"xx-large",7:"xxx-large"};function Zt(e){return e.toLowerCase().includes("font-size")}function en(e,t){for(;e.firstChild;)t.appendChild(e.firstChild)}function tn(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}const nn=["script","style","iframe","object","embed","form","noscript"];class sn{constructor(e,t,n,s){this.getState=e,this.dispatch=t,this.schemaRegistry=n,this.tryRichPasteFromJson=s}handleHTMLOrTextPaste(e,t){const n=this.getState(),s=e.getData("text/html");if(s)this.handleHTML(s,n);else if(t){const e=function(e){const t=e.split(/\r?\n/).map(e=>({type:_("paragraph"),segments:[{text:e,marks:[]}]}));return{blocks:t.length>0?t:[{type:_("paragraph"),segments:[{text:"",marks:[]}]}]}}(t);this.dispatch($t(this.getState(),e))}}handleHTML(e,t){const n=Ee.sanitize(e,{FORBID_TAGS:nn,ALLOWED_URI_REGEXP:O}),s=this.extractRichData(n);if(s&&this.tryRichPasteFromJson(s))return;const r=document.createElement("template");r.innerHTML=n,function(e){const t=Array.from(e.querySelectorAll("font"));for(const n of t){const e=n.getAttribute("color"),t=n.getAttribute("face"),s=n.getAttribute("size"),r=n.getAttribute("style")??"";if(!(null!==e||null!==t||null!==s||r.length>0)){tn(n);continue}const i=document.createElement("span"),o=[];if(r&&o.push(r.endsWith(";")?r:`${r};`),e&&o.push(`color: ${e};`),t&&o.push(`font-family: ${t};`),s&&!Zt(r)){const e=Yt[s];e&&o.push(`font-size: ${e};`)}Ve(i,o.join(" ")),en(n,i),n.parentNode?.replaceChild(i,n)}}(r.content);const i=r.innerHTML,o=this.schemaRegistry?this.schemaRegistry.getAllowedTags():["strong","em","u","b","i","p","br","div","span"],c=this.schemaRegistry?this.schemaRegistry.getAllowedAttrs():[],l=Ee.sanitize(i,{ALLOWED_TAGS:o,ALLOWED_ATTR:c,ALLOWED_URI_REGEXP:O});if(this.schemaRegistry){const e=document.createElement("template");if(e.innerHTML=l,this.requiresDocumentParser(l,e.content))return void this.handleDocumentPaste(l,t);const n=u(this.schemaRegistry),s=new Xt({schema:n,schemaRegistry:this.schemaRegistry}).parse(e.content);this.dispatch($t(t,s))}else{const e=this.extractTextFromHTML(l);e&&this.dispatch(a(t,e,"paste"))}}extractRichData(e){const t=document.createElement("template");t.innerHTML=e;const n=t.content.querySelector("[data-notectl-rich]"),s=n?.getAttribute("data-notectl-rich");if(s)return this.decodeHTMLEntities(s)}decodeHTMLEntities(e){return e.replace(/"/g,'"').replace(/'/g,"'").replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}requiresDocumentParser(e,t){return!!/<table[\s>]/i.test(e)||this.containsVoidBlockElements(t)}containsVoidBlockElements(e){if(!this.schemaRegistry)return!1;const t=this.schemaRegistry.getBlockParseRules();for(const n of t){const t=this.schemaRegistry.getNodeSpec(n.type);if(!t?.isVoid)continue;const s=e.querySelectorAll(n.rule.tag);for(const e of Array.from(s)){if(!n.rule.getAttrs)return!0;if(!1!==n.rule.getAttrs(e))return!0}}return!1}handleDocumentPaste(e,t){if(!this.schemaRegistry)return;const n=fe(e,this.schemaRegistry);if(0===n.children.length)return;const s=t.selection,r=t.transaction("paste");let i;Y(s)&&!Q(s)&&(i=l(t,r));const o=i??(U(s)?s.nodeId:q(s)?s.blockId:s.anchor.blockId),a=Be(t,o,this.schemaRegistry);if(!a)return;const c=q(s)&&"before"===s.side?0:1;let d,h,p=a.anchorIndex+c;for(const l of n.children){const e=N(),t=Me(l,e);r.insertNode(a.parentPath,p,t),p++,d=je(t),h=t}if(a.isAnchorEmpty&&!q(s)&&r.removeNode(a.parentPath,a.anchorIndex),d&&h){const e=Ae(h,d),t=e?I(e).length:0;r.setSelection(V(d,t))}this.dispatch(r.build())}extractTextFromHTML(e){const t=document.createElement("template");return t.innerHTML=e,t.content.textContent??""}}class rn{constructor(e,t,n){this.getState=e,this.dispatch=t,this.schemaRegistry=n}handleBlockPaste(e){let t;try{t=JSON.parse(e)}catch{return}const n=t.type;if(!n)return;const s=this.schemaRegistry?.getNodeSpec(n);if(this.schemaRegistry&&!s)return;const r=this.getState(),i=r.selection,o=U(i)?i.nodeId:q(i)?i.blockId:i.anchor.blockId,a=N(),c=Ne(t.attrs,s?.attrs),l=C(_(n),void 0,a,c),d=De(r,o);if(d){const e=Oe(r,o,d,this.schemaRegistry);if(!e)return;const t=r.getBlock(d);if(!t)return;const n=r.transaction("paste");return n.insertNode(e.parentPath,t.children.length,l),n.setSelection($(a,[...e.parentPath,a])),void this.dispatch(n.build())}const h=Be(r,o,this.schemaRegistry);if(!h)return;const p=q(i)&&"before"===i.side?0:1,u=r.transaction("paste");u.insertNode(h.parentPath,h.anchorIndex+p,l),u.setSelection($(a,[...h.parentPath,a])),this.dispatch(u.build())}handleRichPasteFromJson(e){let t;try{t=JSON.parse(e)}catch{return!1}return!(!Array.isArray(t)||0===t.length)&&this.handleRichPaste(t)}handleRichPaste(e){if(0===e.length)return!1;if(!e.some(e=>void 0!==e.type&&"paragraph"!==e.type||e.segments?.some(e=>"inline"===e.kind))&&e.length<=1)return!1;let t=this.getState();const n=t.selection;if(Y(n)&&!Q(n)){const n=t.transaction("paste"),s=l(t,n),r=n.build();if(this.dispatch(r),t=t.apply(r),s)return this.resolveAndInsertRichBlocks(e,t,s)}const s=U(n)?n.nodeId:q(n)?n.blockId:n.anchor.blockId;return this.resolveAndInsertRichBlocks(e,t,s)}resolveAndInsertRichBlocks(e,t,n){const s=t.selection,r=De(t,n);if(r){const s=Oe(t,n,r,this.schemaRegistry);if(!s)return!1;const i=t.getBlock(r),o=s.anchorIndex>=0?s.anchorIndex+1:i?.children.length??0;return this.insertRichBlocks(e,t,s,o,!0)}const i=Be(t,n,this.schemaRegistry);if(!i)return!1;const o=q(s)&&"before"===s.side?0:1;return this.insertRichBlocks(e,t,i,i.anchorIndex+o,!q(s))}insertRichBlocks(e,t,n,s,r){const i=t.transaction("paste");let o,a=s,c=0;for(const l of e){const e=Le(l,this.schemaRegistry);if(!e)continue;const t=He(e);i.insertNode(n.parentPath,a,t),a++,o=t.id,c=(e.text??"").length}return r&&n.isAnchorEmpty&&n.anchorIndex>=0&&i.removeNode(n.parentPath,n.anchorIndex),o&&i.setSelection(V(o,c)),this.dispatch(i.build()),!0}}class on{constructor(e,t){this.element=e,this.getState=t.getState,this.dispatch=t.dispatch,this.fileHandlerRegistry=t.fileHandlerRegistry,this.isReadOnly=t.isReadOnly??(()=>!1),this.getPasteInterceptors=t.getPasteInterceptors??(()=>[]),this.richBlockHandler=new rn(t.getState,t.dispatch,t.schemaRegistry),this.htmlHandler=new sn(t.getState,t.dispatch,t.schemaRegistry,e=>this.richBlockHandler.handleRichPasteFromJson(e)),this.handlePaste=this.onPaste.bind(this),e.addEventListener("paste",this.handlePaste)}getState;dispatch;fileHandlerRegistry;isReadOnly;getPasteInterceptors;handlePaste;htmlHandler;richBlockHandler;onPaste(e){if(e.preventDefault(),this.isReadOnly())return;const t=e.clipboardData;if(!t)return;const n=t.getData("application/x-notectl-block");if(n)return void this.richBlockHandler.handleBlockPaste(n);if(this.handleFilePaste(t))return;const s=t.getData("text/plain"),r=t.getData("text/html");s&&this.tryPasteInterceptors(s,r)||this.htmlHandler.handleHTMLOrTextPaste(t,s)}tryPasteInterceptors(e,t){const n=this.getPasteInterceptors(),s=this.getState();for(const r of n){const n=r.interceptor(e,t,s);if(n)return this.dispatch(n),!0}return!1}handleFilePaste(e){if(!this.fileHandlerRegistry)return!1;const t=Array.from(e.files);if(0===t.length)for(let s=0;s<e.items.length;s++){const n=e.items[s];if(n&&"file"===n.kind){const e=n.getAsFile();e&&t.push(e)}}if(0===t.length)return!1;let n=!1;for(const s of t){const e=this.fileHandlerRegistry.matchFileHandlers(s.type);for(const t of e){const e=t(s,null);if(!0===e||e instanceof Promise){n=!0;break}}}return n}destroy(){this.element.removeEventListener("paste",this.handlePaste)}}class an{compositionTracker;inputHandler;keyboardHandler;pasteHandler;clipboardHandler;constructor(e,t){this.compositionTracker=new zt,this.inputHandler=new Ft(e,{getState:t.getState,dispatch:t.dispatch,syncSelection:t.syncSelection,inputRuleRegistry:t.inputRuleRegistry,isReadOnly:t.isReadOnly,compositionTracker:this.compositionTracker}),this.keyboardHandler=new Ot(e,{getState:t.getState,dispatch:t.dispatch,undo:t.undo,redo:t.redo,keymapRegistry:t.keymapRegistry,isReadOnly:t.isReadOnly,compositionTracker:this.compositionTracker,getTextDirection:t.getTextDirection,navigateFromGapCursor:t.navigateFromGapCursor}),this.pasteHandler=new on(e,{getState:t.getState,dispatch:t.dispatch,schemaRegistry:t.schemaRegistry,fileHandlerRegistry:t.fileHandlerRegistry,isReadOnly:t.isReadOnly,getPasteInterceptors:t.getPasteInterceptors}),this.clipboardHandler=new _t(e,{getState:t.getState,dispatch:t.dispatch,schemaRegistry:t.schemaRegistry,syncSelection:t.syncSelection,isReadOnly:t.isReadOnly})}destroy(){this.inputHandler.destroy(),this.keyboardHandler.destroy(),this.pasteHandler.destroy(),this.clipboardHandler.destroy()}}class cn{_contextKeymaps=[];_navigationKeymaps=[];_defaultKeymaps=[];registerKeymap(e,t){const n=[...this._contextKeymaps,...this._navigationKeymaps,...this._defaultKeymaps];for(const s of Object.keys(e))for(const e of n)if(s in e){console.debug(`[notectl] Keymap shortcut "${s}" is already registered and will be overridden.`);break}this.keymapArrayForPriority(t?.priority??"default").push(e)}getKeymaps(){return[...this._contextKeymaps,...this._navigationKeymaps,...this._defaultKeymaps]}getKeymapsByPriority(){return{context:[...this._contextKeymaps],navigation:[...this._navigationKeymaps],default:[...this._defaultKeymaps]}}removeKeymap(e){for(const t of[this._contextKeymaps,this._navigationKeymaps,this._defaultKeymaps]){const n=t.indexOf(e);if(-1!==n)return void t.splice(n,1)}}clear(){this._contextKeymaps.length=0,this._navigationKeymaps.length=0,this._defaultKeymaps.length=0}keymapArrayForPriority(e){switch(e){case"context":return this._contextKeymaps;case"navigation":return this._navigationKeymaps;case"default":return this._defaultKeymaps}}}class ln{_inputRules=[];registerInputRule(e){this._inputRules.push(e)}getInputRules(){return this._inputRules}removeInputRule(e){const t=this._inputRules.indexOf(e);-1!==t&&this._inputRules.splice(t,1)}clear(){this._inputRules.length=0}}class dn{_fileHandlers=[];registerFileHandler(e,t){this._fileHandlers.push({pattern:e,handler:t})}getFileHandlers(){return this._fileHandlers}matchFileHandlers(e){const t=[];for(const n of this._fileHandlers)hn(n.pattern,e)&&t.push(n.handler);return t}removeFileHandler(e){const t=this._fileHandlers.findIndex(t=>t.handler===e);-1!==t&&this._fileHandlers.splice(t,1)}clear(){this._fileHandlers.length=0}}function hn(e,t){if("*"===e||"*/*"===e)return!0;if(e===t)return!0;if(e.endsWith("/*")){const n=e.slice(0,-1);return t.startsWith(n)}return!1}class pn{_nodeViews=/* @__PURE__ */new Map;registerNodeView(e,t){if(this._nodeViews.has(e))throw new Error(`NodeView for type "${e}" is already registered.`);this._nodeViews.set(e,t)}getNodeViewFactory(e){return this._nodeViews.get(e)}removeNodeView(e){this._nodeViews.delete(e)}clear(){this._nodeViews.clear()}}function un(e,t){if(t){const n=t.getMarkSpec(e.type);if(n)return n.rank??100}switch(e.type){case"bold":return 0;case"italic":return 1;case"underline":return 2;default:return 100}}function fn(e,t,n){if(0===t.length)return e;const s=[...t].sort((e,t)=>un(e,n)-un(t,n));let r=e;for(let i=s.length-1;i>=0;i--){const e=s[i];if(!e)continue;const t=gn(e,n);t.appendChild(r),r=t}return r}function gn(e,t){if(t){const n=t.getMarkSpec(e.type);if(n)return n.toDOM(e)}switch(e.type){case"bold":return document.createElement("strong");case"italic":return document.createElement("em");case"underline":return document.createElement("u");default:return document.createElement("span")}}class mn{wrapperElement=null;container;registry;constructor(e,t){this.container=e,this.registry=t}get isActive(){return null!==this.wrapperElement}onCompositionStart(e){this.cleanup();const t=e.storedMarks;if(!t||0===t.length)return;const n=e.selection;if(!Y(n))return;if(!Q(n))return;const s=document.createElement("span");s.setAttribute("data-cursor-wrapper","");const r=document.createTextNode(""),i=fn(r,t,this.registry);s.appendChild(i);const o=ye();if(!o||0===o.rangeCount)return;let a;const c=ke(this.container,o);if(c){const e=document.createRange();try{e.setStart(c.anchorNode,c.anchorOffset),e.setEnd(c.focusNode,c.focusOffset)}catch{return}a=e}else a=o.getRangeAt(0);a.insertNode(s);try{o.collapse(r,r.length)}catch{}this.wrapperElement=s}cleanup(){this.wrapperElement&&(this.wrapperElement.remove(),this.wrapperElement=null)}}class yn{listeners=/* @__PURE__ */new Map;emit(e,t){const n=this.listeners.get(e.id);if(n)for(const r of n)try{r(t)}catch(s){console.error(`[EventBus] Listener error on "${e.id}":`,s)}}on(e,t){const n=e.id;this.listeners.has(n)||this.listeners.set(n,/* @__PURE__ */new Set);const s=this.listeners.get(n)??/* @__PURE__ */new Set;return s.add(t),()=>{s.delete(t),0===s.size&&this.listeners.delete(n)}}off(e,t){const n=this.listeners.get(e.id);n&&(n.delete(t),0===n.size&&this.listeners.delete(e.id))}clear(){this.listeners.clear()}}function kn(e,t,n,s){return{registerCommand:(s,r,i)=>{if(t.has(s)){const e=t.get(s);throw new Error(`Command "${s}" is already registered by plugin "${e?.pluginId}".`)}const o=i?.readonlyAllowed??!1;t.set(s,{name:s,handler:r,pluginId:e,readonlyAllowed:o}),n.commands.push(s)},executeCommand:s}}function Sn(e,t){return{registerService:(n,s)=>{if(e.has(n.id))throw new Error(`Service "${n.id}" is already registered by another plugin.`);e.set(n.id,s),t.services.push(n.id)},getService:t=>e.get(t.id)}}function bn(e,t,n,s,r,i){return{registerMiddleware:(n,i)=>{const o={name:i?.name??(n.name||"anonymous"),pluginId:e,middleware:n,priority:i?.priority??100};t.push(o),s.middlewares.push(o),r()},registerPasteInterceptor:(t,r)=>{const o={name:r?.name??"anonymous",pluginId:e,interceptor:t,priority:r?.priority??100};n.push(o),s.pasteInterceptors.push(o),i()}}}function vn(e,t){return{registerNodeSpec:n=>{e.registerNodeSpec(n),t.nodeSpecs.push(n.type)},registerMarkSpec:n=>{e.registerMarkSpec(n),t.markSpecs.push(n.type)},registerInlineNodeSpec:n=>{e.registerInlineNodeSpec(n),t.inlineNodeSpecs.push(n.type)}}}function wn(e,t,n){return{registerNodeView:(e,s)=>{t.nodeViewRegistry.registerNodeView(e,s),n.nodeViews.push(e)},registerKeymap:(e,s)=>{t.keymapRegistry.registerKeymap(e,s),n.keymaps.push(e)},registerInputRule:e=>{t.inputRuleRegistry.registerInputRule(e),n.inputRules.push(e)},registerToolbarItem:s=>{t.toolbarRegistry.registerToolbarItem(s,e),n.toolbarItems.push(s.id)},registerBlockTypePickerEntry:e=>{t.blockTypePickerRegistry.registerBlockTypePickerEntry(e),n.blockTypePickerEntries.push(e.id)},registerFileHandler:(e,s)=>{t.fileHandlerRegistry.registerFileHandler(e,s),n.fileHandlers.push(s)},registerStyleSheet:e=>{const s=new CSSStyleSheet;s.replaceSync(e),t.pluginStyleSheets.push(s),n.stylesheets.push(s)}}}function Rn(e){return{getSchemaRegistry:()=>e.schemaRegistry,getKeymapRegistry:()=>e.keymapRegistry,getInputRuleRegistry:()=>e.inputRuleRegistry,getFileHandlerRegistry:()=>e.fileHandlerRegistry,getNodeViewRegistry:()=>e.nodeViewRegistry,getToolbarRegistry:()=>e.toolbarRegistry,getBlockTypePickerRegistry:()=>e.blockTypePickerRegistry}}class Cn{plugins=/* @__PURE__ */new Map;commands=/* @__PURE__ */new Map;services=/* @__PURE__ */new Map;middlewares=[];pasteInterceptors=[];registrations=/* @__PURE__ */new Map;eventBus=new yn;pluginStyleSheets=[];schemaRegistry=new it;keymapRegistry=new cn;inputRuleRegistry=new ln;fileHandlerRegistry=new dn;nodeViewRegistry=new pn;toolbarRegistry=new Ye;blockTypePickerRegistry=new Xe;middlewareSorted=null;pasteInterceptorsSorted=null;initOrder=[];startedInitOrder=[];initialized=!1;initializing=!1;readOnly=!1;readonlyBypassActive=!1;registerService(e,t){if(this.services.has(e.id))throw new Error(`Service "${e.id}" is already registered.`);this.services.set(e.id,t)}register(e){if(this.initialized||this.initializing)throw new Error(`Cannot register plugin "${e.id}" after initialization.`);if(this.plugins.has(e.id))throw new Error(`Plugin "${e.id}" is already registered.`);this.plugins.set(e.id,e)}async init(e){if(!this.initialized&&!this.initializing){this.initializing=!0;try{this.initOrder=this.resolveOrder();for(const n of this.initOrder){if(e.isCancelled?.())return;const s=this.plugins.get(n);if(!s)continue;this.startedInitOrder.push(n);const r=this.createContext(n,e);try{await s.init(r)}catch(t){throw await this.rollbackStartedPlugins(),t}}if(e.isCancelled?.())return;if(e.onBeforeReady&&await e.onBeforeReady(),e.isCancelled?.())return;for(const n of this.initOrder){if(e.isCancelled?.())return;const s=this.plugins.get(n);if(s?.onReady)try{await s.onReady()}catch(t){console.error(`[PluginManager] Plugin "${n}" error in onReady:`,t)}}this.initialized=!0}finally{this.initializing=!1}}}notifyStateChange(e,t,n){for(const r of this.initOrder){const i=this.plugins.get(r);if(i?.onStateChange)try{i.onStateChange(e,t,n)}catch(s){console.error(`[PluginManager] Plugin "${r}" error in onStateChange:`,s)}}}collectDecorations(e,t){let n=ie.empty;for(const r of this.initOrder){const i=this.plugins.get(r);if(i?.decorations)try{const s=i.decorations(e,t);s.isEmpty||(n=n.merge(s))}catch(s){console.error(`[PluginManager] Plugin "${r}" error in decorations():`,s)}}return n}dispatchWithMiddleware(e,t,n){if(0===this.middlewares.length)return void n(e);const s=this.getSortedMiddleware();let r=0,i=!1;const o=e=>{if(r<s.length){const n=s[r++];if(!n)return;let i=!1;const c=e=>{i||(i=!0,o(e))};try{n.middleware(e,t,c)}catch(a){console.error(`[PluginManager] Middleware "${n.name}" error:`,a),c(e)}}else i||(i=!0,n(e))};o(e)}canExecuteCommand(e){const t=this.commands.get(e);return!(!t||this.readOnly&&!t.readonlyAllowed)}executeCommand(e){const t=this.commands.get(e);if(!t)return!1;if(this.readOnly&&!t.readonlyAllowed)return!1;const n=this.readOnly&&t.readonlyAllowed;n&&(this.readonlyBypassActive=!0);try{return t.handler()}catch(s){return console.error(`[PluginManager] Command "${e}" error:`,s),!1}finally{n&&(this.readonlyBypassActive=!1)}}isReadonlyBypassed(){return this.readonlyBypassActive}configurePlugin(e,t){const n=this.plugins.get(e);if(!n)throw new Error(`Plugin "${e}" not found.`);if(n.onConfigure)try{n.onConfigure(t)}catch(s){console.error(`[PluginManager] Plugin "${e}" error in onConfigure:`,s)}}isReadOnly(){return this.readOnly}setReadOnly(e){if(this.readOnly!==e){this.readOnly=e;for(const n of this.initOrder){const s=this.plugins.get(n);if(s?.onReadOnlyChange)try{s.onReadOnlyChange(e)}catch(t){console.error(`[PluginManager] Plugin "${n}" error in onReadOnlyChange:`,t)}}}}getPluginIds(){return[...this.plugins.keys()]}getMiddlewareChain(){return this.getSortedMiddleware().map(e=>({name:e.name,priority:e.priority,pluginId:e.pluginId}))}getPasteInterceptors(){return this.getSortedPasteInterceptors()}get(e){return this.plugins.get(e)}getService(e){return this.services.get(e.id)}onEvent(e,t){return this.eventBus.on(e,t)}getPluginStyleSheets(){return this.pluginStyleSheets}async destroy(){const e=[...this.startedInitOrder].reverse();for(const t of e)await this.destroyPlugin(t);this.plugins.clear(),this.commands.clear(),this.services.clear(),this.middlewares.length=0,this.middlewareSorted=null,this.pasteInterceptors.length=0,this.pasteInterceptorsSorted=null,this.pluginStyleSheets.length=0,this.eventBus.clear(),this.registrations.clear(),this.schemaRegistry.clear(),this.keymapRegistry.clear(),this.inputRuleRegistry.clear(),this.fileHandlerRegistry.clear(),this.nodeViewRegistry.clear(),this.toolbarRegistry.clear(),this.blockTypePickerRegistry.clear(),this.initOrder=[],this.startedInitOrder=[],this.initialized=!1,this.initializing=!1}async destroyPlugin(e){const t=this.plugins.get(e);if(t?.destroy)try{await t.destroy()}catch(n){console.error(`[PluginManager] Plugin "${e}" error in destroy:`,n)}this.cleanupRegistrations(e)}async rollbackStartedPlugins(){const e=[...this.startedInitOrder].reverse();for(const t of e)await this.destroyPlugin(t);this.startedInitOrder=[],this.initOrder=[],this.initialized=!1}cleanupRegistrations(e){const t=this.registrations.get(e);if(t){for(const e of t.commands)this.commands.delete(e);for(const e of t.services)this.services.delete(e);for(const e of t.middlewares){const t=this.middlewares.indexOf(e);-1!==t&&this.middlewares.splice(t,1)}for(const e of t.pasteInterceptors){const t=this.pasteInterceptors.indexOf(e);-1!==t&&this.pasteInterceptors.splice(t,1)}for(const e of t.unsubscribers)e();for(const e of t.nodeSpecs)this.schemaRegistry.removeNodeSpec(e);for(const e of t.markSpecs)this.schemaRegistry.removeMarkSpec(e);for(const e of t.inlineNodeSpecs)this.schemaRegistry.removeInlineNodeSpec(e);for(const e of t.nodeViews)this.nodeViewRegistry.removeNodeView(e);for(const e of t.keymaps)this.keymapRegistry.removeKeymap(e);for(const e of t.inputRules)this.inputRuleRegistry.removeInputRule(e);for(const e of t.toolbarItems)this.toolbarRegistry.removeToolbarItem(e);for(const e of t.fileHandlers)this.fileHandlerRegistry.removeFileHandler(e);for(const e of t.blockTypePickerEntries)this.blockTypePickerRegistry.removeBlockTypePickerEntry(e);for(const e of t.stylesheets){const t=this.pluginStyleSheets.indexOf(e);-1!==t&&this.pluginStyleSheets.splice(t,1)}this.middlewareSorted=null,this.pasteInterceptorsSorted=null,this.registrations.delete(e)}}getSortedMiddleware(){return this.middlewareSorted||(this.middlewareSorted=[...this.middlewares].sort((e,t)=>e.priority-t.priority)),this.middlewareSorted}getSortedPasteInterceptors(){return this.pasteInterceptorsSorted||(this.pasteInterceptorsSorted=[...this.pasteInterceptors].sort((e,t)=>e.priority-t.priority)),this.pasteInterceptorsSorted}createContext(e,t){const n={pluginId:e,getState:t.getState,dispatch:t.dispatch,getContainer:t.getContainer,getPluginContainer:t.getPluginContainer,announce:t.announce,hasAnnouncement:t.hasAnnouncement,commands:this.commands,services:this.services,middlewares:this.middlewares,pasteInterceptors:this.pasteInterceptors,pluginStyleSheets:this.pluginStyleSheets,plugins:this.plugins,eventBus:this.eventBus,schemaRegistry:this.schemaRegistry,keymapRegistry:this.keymapRegistry,inputRuleRegistry:this.inputRuleRegistry,toolbarRegistry:this.toolbarRegistry,blockTypePickerRegistry:this.blockTypePickerRegistry,fileHandlerRegistry:this.fileHandlerRegistry,nodeViewRegistry:this.nodeViewRegistry,isReadOnly:()=>this.readOnly,invalidateMiddlewareSort:()=>{this.middlewareSorted=null},invalidatePasteSort:()=>{this.pasteInterceptorsSorted=null},executeCommand:e=>this.executeCommand(e)},{context:s,registrations:r}=function(e){const t={commands:[],services:[],middlewares:[],pasteInterceptors:[],unsubscribers:[],nodeSpecs:[],markSpecs:[],inlineNodeSpecs:[],nodeViews:[],keymaps:[],inputRules:[],toolbarItems:[],fileHandlers:[],blockTypePickerEntries:[],stylesheets:[]},n=function(e,t){return{emit:(t,n)=>e.emit(t,n),on:(n,s)=>{const r=e.on(n,s);return t.unsubscribers.push(r),r},off:(t,n)=>e.off(t,n)}}(e.eventBus,t);return{context:{getState:e.getState,dispatch:e.dispatch,getContainer:e.getContainer,getPluginContainer:e.getPluginContainer,isReadOnly:e.isReadOnly,getEventBus:()=>n,...kn(e.pluginId,e.commands,t,e.executeCommand),...Sn(e.services,t),...bn(e.pluginId,e.middlewares,e.pasteInterceptors,t,e.invalidateMiddlewareSort,e.invalidatePasteSort),...vn(e.schemaRegistry,t),...wn(e.pluginId,e,t),...Rn(e),updateConfig:t=>{const n=e.plugins.get(e.pluginId);if(n?.onConfigure)try{n.onConfigure(t)}catch(s){console.error(`[PluginManager] Plugin "${e.pluginId}" error in onConfigure:`,s)}},announce:t=>{e.announce?.(t)},hasAnnouncement:()=>e.hasAnnouncement?.()??!1},registrations:t}}(n);return this.registrations.set(e,r),s}resolveOrder(){const e=[...this.plugins.keys()];for(const i of e){const e=this.plugins.get(i);if(e)for(const t of e.dependencies??[])if(!this.plugins.has(t))throw new Error(`Plugin "${i}" depends on "${t}", which is not registered.`)}const t=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map;for(const i of e)t.set(i,0),n.set(i,[]);for(const i of e){const e=this.plugins.get(i),s=e?.dependencies??[];t.set(i,s.length);for(const t of s){const e=n.get(t);e&&e.push(i)}}const s=[];for(const[i,o]of t)0===o&&s.push(i);const r=[];for(;s.length>0;){s.sort((e,t)=>(this.plugins.get(e)?.priority??100)-(this.plugins.get(t)?.priority??100));const e=s.shift();if(!e)break;r.push(e);for(const r of n.get(e)??[]){const e=(t.get(r)??0)-1;t.set(r,e),0===e&&s.push(r)}}if(r.length!==e.length){const t=e.filter(e=>!r.includes(e));throw new Error(`Circular dependency detected among plugins: ${t.join(", ")}`)}return r}}const xn={Light:"light",Dark:"dark",System:"system"},In={name:"light",primitives:{background:"#ffffff",foreground:"#1a1a1a",mutedForeground:"#666666",border:"#d0d0d0",borderFocus:"#4a90d9",primary:"#4a90d9",primaryForeground:"#1a5fa0",primaryMuted:"#d0e0f0",surfaceRaised:"#f8f8f8",surfaceOverlay:"#ffffff",hoverBackground:"#e8e8e8",activeBackground:"#d0e0f0",danger:"#dc2626",dangerMuted:"#fee2e2",success:"#1a8c1a",shadow:"rgba(0, 0, 0, 0.15)",focusRing:"rgba(74, 144, 217, 0.2)"},codeBlock:{background:"#f8fafc",foreground:"#334155",headerBackground:"#f1f5f9",headerForeground:"#64748b",headerBorder:"#e2e8f0",syntax:{keyword:"#d73a49",string:"#032f62",comment:"#6a737d",number:"#005cc5",function:"#6f42c1",operator:"#d73a49",punctuation:"#24292e",boolean:"#005cc5",null:"#005cc5",property:"#005cc5"}},tooltip:{background:"#1a1a1a",foreground:"#ffffff"}},Tn={name:"dark",primitives:{background:"#1e1e2e",foreground:"#cdd6f4",mutedForeground:"#7f849c",border:"#45475a",borderFocus:"#89b4fa",primary:"#89b4fa",primaryForeground:"#89b4fa",primaryMuted:"rgba(137, 180, 250, 0.15)",surfaceRaised:"#313244",surfaceOverlay:"#313244",hoverBackground:"#45475a",activeBackground:"rgba(137, 180, 250, 0.15)",danger:"#f38ba8",dangerMuted:"rgba(243, 139, 168, 0.15)",success:"#a6e3a1",shadow:"rgba(0, 0, 0, 0.4)",focusRing:"rgba(137, 180, 250, 0.25)"},codeBlock:{background:"#11111b",foreground:"#cdd6f4",headerBackground:"#181825",headerForeground:"#7f849c",headerBorder:"rgba(205, 214, 244, 0.08)",syntax:{keyword:"#cba6f7",string:"#a6e3a1",comment:"#6c7086",number:"#fab387",function:"#89b4fa",operator:"#89dceb",punctuation:"#bac2de",boolean:"#fab387",null:"#f38ba8",property:"#89b4fa"}},tooltip:{background:"#585b70",foreground:"#cdd6f4"}};function Pn(e,t){return{name:t.name,primitives:{...e.primitives,...t.primitives},toolbar:t.toolbar?{...e.toolbar,...t.toolbar}:e.toolbar,codeBlock:t.codeBlock?{...e.codeBlock,...t.codeBlock,syntax:t.codeBlock.syntax?{...e.codeBlock?.syntax,...t.codeBlock.syntax}:e.codeBlock?.syntax}:e.codeBlock,tooltip:t.tooltip?{...e.tooltip,...t.tooltip}:e.tooltip}}function En(e){if("object"==typeof e)return e;switch(e){case xn.Light:return In;case xn.Dark:return Tn;default:return In}}const Bn=[["primitives.background","--notectl-bg"],["primitives.foreground","--notectl-fg"],["primitives.mutedForeground","--notectl-fg-muted"],["primitives.border","--notectl-border"],["primitives.borderFocus","--notectl-border-focus"],["primitives.primary","--notectl-primary"],["primitives.primaryForeground","--notectl-primary-fg"],["primitives.primaryMuted","--notectl-primary-muted"],["primitives.surfaceRaised","--notectl-surface-raised"],["primitives.surfaceOverlay","--notectl-surface-overlay"],["primitives.hoverBackground","--notectl-hover-bg"],["primitives.activeBackground","--notectl-active-bg"],["primitives.danger","--notectl-danger"],["primitives.dangerMuted","--notectl-danger-muted"],["primitives.success","--notectl-success"],["primitives.shadow","--notectl-shadow"],["primitives.focusRing","--notectl-focus-ring"],["toolbar.background","--notectl-toolbar-bg"],["toolbar.borderColor","--notectl-toolbar-border"],["codeBlock.background","--notectl-code-block-bg"],["codeBlock.foreground","--notectl-code-block-color"],["codeBlock.headerBackground","--notectl-code-block-header-bg"],["codeBlock.headerForeground","--notectl-code-block-header-color"],["codeBlock.headerBorder","--notectl-code-block-header-border"],["codeBlock.syntax.keyword","--notectl-code-token-keyword"],["codeBlock.syntax.string","--notectl-code-token-string"],["codeBlock.syntax.comment","--notectl-code-token-comment"],["codeBlock.syntax.number","--notectl-code-token-number"],["codeBlock.syntax.function","--notectl-code-token-function"],["codeBlock.syntax.operator","--notectl-code-token-operator"],["codeBlock.syntax.punctuation","--notectl-code-token-punctuation"],["codeBlock.syntax.boolean","--notectl-code-token-boolean"],["codeBlock.syntax.null","--notectl-code-token-null"],["codeBlock.syntax.property","--notectl-code-token-property"],["tooltip.background","--notectl-tooltip-bg"],["tooltip.foreground","--notectl-tooltip-fg"]],Mn=/* @__PURE__ */new Map([["--notectl-toolbar-bg","var(--notectl-surface-raised)"],["--notectl-toolbar-border","var(--notectl-border)"],["--notectl-code-block-bg","var(--notectl-surface-raised)"],["--notectl-code-block-color","var(--notectl-fg)"],["--notectl-code-block-header-bg","var(--notectl-surface-raised)"],["--notectl-code-block-header-color","var(--notectl-fg-muted)"],["--notectl-code-block-header-border","var(--notectl-border)"],["--notectl-code-token-keyword","var(--notectl-code-block-color)"],["--notectl-code-token-string","var(--notectl-code-block-color)"],["--notectl-code-token-comment","var(--notectl-code-block-color)"],["--notectl-code-token-number","var(--notectl-code-block-color)"],["--notectl-code-token-function","var(--notectl-code-block-color)"],["--notectl-code-token-operator","var(--notectl-code-block-color)"],["--notectl-code-token-punctuation","var(--notectl-code-block-color)"],["--notectl-code-token-boolean","var(--notectl-code-block-color)"],["--notectl-code-token-null","var(--notectl-code-block-color)"],["--notectl-code-token-property","var(--notectl-code-block-color)"],["--notectl-tooltip-bg","var(--notectl-fg)"],["--notectl-tooltip-fg","var(--notectl-bg)"]]);function An(e,t){const n=t.split(".");let s=e;for(const r of n){if(null==s)return;if("object"!=typeof s)return;s=s[r]}return"string"==typeof s?s:void 0}function Nn(e){const t=[":host {"];for(const[n,s]of Bn){const r=An(e,n);if(void 0!==r)t.push(`\t${s}: ${r};`);else{const e=Mn.get(s);e&&t.push(`\t${s}: ${e};`)}}return t.push("}"),t.join("\n")}function Dn(e){const t=new CSSStyleSheet;return t.replaceSync(Nn(e)),t}const On={EN:"en",DE:"de",ES:"es",FR:"fr",ZH:"zh",RU:"ru",AR:"ar",HI:"hi",PT:"pt",BROWSER:"browser"},Ln={paragraph:"Paragraph",heading:"Heading",code_block:"Code Block",blockquote:"Block Quote",list_item:"List Item",horizontal_rule:"Horizontal Rule",image:"Image",table:"Table"};function Hn(e,t){return"heading"===e&&t?.level?`Heading ${t.level}`:Ln[e]??e}function _n(e,t){const n=t?.document??globalThis.document,s=t?.container??n.head;if(t?.id){const s=n.getElementById(t.id);if(s instanceof HTMLStyleElement)return s.textContent=e,t.nonce&&s.setAttribute("nonce",t.nonce),s}const r=n.createElement("style");return r.textContent=e,t?.id&&(r.id=t.id),t?.nonce&&r.setAttribute("nonce",t.nonce),s.appendChild(r),r}function zn(e,t){const n=(t??globalThis.document).getElementById(e);n&&n.remove()}const Fn=/* @__PURE__ */new WeakSet;function Kn(e,t){const n=t?.target??globalThis.document,s=new CSSStyleSheet;return s.replaceSync(e),Fn.add(s),t?.replace&&(n.adoptedStyleSheets=n.adoptedStyleSheets.filter(e=>!Fn.has(e))),n.adoptedStyleSheets=[...n.adoptedStyleSheets,s],s}function jn(e,t){const n=t??globalThis.document;n.adoptedStyleSheets=n.adoptedStyleSheets.filter(t=>t!==e)}function $n(e,t,n){const s=t?function(e,t){return{children:e.children.map(e=>Vn(e,t))}}(e,t):e,r=t?u(t):void 0;n(xt.create({doc:s,schema:r}))}function Vn(e,t){const n=t.getNodeSpec(e.type);if(!n?.content||!((s=n.content).allow.length>0)||s.allow.includes("text"))return e;var s;if(B(e)){const t=e.children.length>0?e.children:void 0,n=C(_("paragraph"),t);return C(e.type,[n],e.id,e.attrs)}const r=e.children.map(e=>k(e)||m(e)?e:Vn(e,t));return C(e.type,r,e.id,e.attrs)}function Un(e){if(!e)return!0;if(0===e.children.length)return!0;if(e.children.length>1)return!1;const t=e.children[0];return!t||"paragraph"===t.type&&""===I(t)}class qn{config={};getConfig(){return this.config}setConfig(e){this.config=e}mergeConfig(e){this.config={...this.config,...e}}applyAttribute(e,t,n){if("placeholder"===e){const e=t??void 0;this.config={...this.config,placeholder:e},this.applyPlaceholder(e,n.contentElement)}if("readonly"===e){const e=null!==t;this.applyReadonly(e,n.contentElement,n.pluginManager),this.config={...this.config,readonly:e}}if("theme"===e){const e=t??void 0;this.config={...this.config,theme:e},n.themeController?.apply(e??xn.Light)}"paper-size"===e&&(null===t?(n.applyPaperSize(void 0),this.config={...this.config,paperSize:void 0}):Z(t)&&(n.applyPaperSize(t),this.config={...this.config,paperSize:t})),"dir"===e&&this.applyDir("ltr"===t||"rtl"===t?t:void 0,n.contentElement,n.editorWrapper)}applyRuntimeConfig(e,t){void 0!==e.placeholder&&this.applyPlaceholder(e.placeholder,t.contentElement),void 0!==e.readonly&&this.applyReadonly(e.readonly,t.contentElement,t.pluginManager),"paperSize"in e&&t.applyPaperSize(e.paperSize),"dir"in e&&this.applyDir(e.dir,t.contentElement,t.editorWrapper),this.config={...this.config,...e}}applyTheme(e,t){this.config={...this.config,theme:e},t?.apply(e)}getTheme(){return this.config.theme??xn.Light}get isReadOnly(){return this.config.readonly??!1}getPaperSize(){return this.config.paperSize}applyPlaceholder(e,t){if(!t)return;const n=t.getAttribute("data-default-placeholder")??"";t.setAttribute("data-placeholder",e??n)}applyReadonly(e,t,n){t&&(t.contentEditable=e?"false":"true",e?t.setAttribute("aria-readonly","true"):t.removeAttribute("aria-readonly"),n?.setReadOnly(e))}applyDir(e,t,n){t&&(e?(n?.setAttribute("dir",e),t.setAttribute("dir",e)):(n?.removeAttribute("dir"),t.removeAttribute("dir")))}}class Wn{listeners=/* @__PURE__ */new Map;on(e,t){this.listeners.has(e)||this.listeners.set(e,/* @__PURE__ */new Set),this.listeners.get(e)?.add(t)}off(e,t){this.listeners.get(e)?.delete(t)}emit(e,t){const n=this.listeners.get(e);if(n)for(const s of n)s(t)}clear(){this.listeners.clear()}}class Gn{deps;handleSelectionChange;handleMousedown;handleDragover;handleDrop;handleCompositionStart;handleCompositionEnd;pendingNodeSelectionClear=!1;pendingGapCursorClear=!1;constructor(e){this.deps=e,this.handleCompositionStart=()=>{e.cursorWrapper.onCompositionStart(e.getState())},this.handleCompositionEnd=()=>{e.cursorWrapper.cleanup()},e.contentElement.addEventListener("compositionstart",this.handleCompositionStart),e.contentElement.addEventListener("compositionend",this.handleCompositionEnd),this.handleSelectionChange=this.onSelectionChange.bind(this),document.addEventListener("selectionchange",this.handleSelectionChange),this.handleMousedown=this.onMousedown.bind(this),e.contentElement.addEventListener("mousedown",this.handleMousedown),this.handleDragover=this.onDragover.bind(this),e.contentElement.addEventListener("dragover",this.handleDragover),this.handleDrop=this.onDrop.bind(this),e.contentElement.addEventListener("drop",this.handleDrop)}syncSelectionFromDOM(){if(this.deps.compositionState.isComposing)return;this.deps.cursorWrapper.isActive&&this.deps.cursorWrapper.cleanup();const e=this.deps.getState();if(U(e.selection)&&!this.pendingNodeSelectionClear)return;if(q(e.selection)&&!this.pendingGapCursorClear)return;this.pendingNodeSelectionClear=!1,this.pendingGapCursorClear=!1;const t=Se(this.deps.contentElement);if(!t)return;if(J(t,e.selection))return;const n=e.transaction("input").setSelection(t).setStoredMarks(null,e.storedMarks).build(),s=e.apply(n);this.deps.applyUpdate(s,n)}destroy(){const e=this.deps.contentElement;e.removeEventListener("compositionstart",this.handleCompositionStart),e.removeEventListener("compositionend",this.handleCompositionEnd),document.removeEventListener("selectionchange",this.handleSelectionChange),e.removeEventListener("mousedown",this.handleMousedown),e.removeEventListener("dragover",this.handleDragover),e.removeEventListener("drop",this.handleDrop)}onSelectionChange(){if(this.deps.isUpdating())return;const e=this.deps.contentElement.getRootNode(),t="activeElement"in e?e.activeElement:document.activeElement;(this.deps.contentElement.contains(t)||t===this.deps.contentElement)&&this.syncSelectionFromDOM()}onMousedown(e){if(this.deps.isUpdating())return;this.deps.onMousedown?.();const t=e.target;if(!(t instanceof HTMLElement))return;const n=t.closest("[data-block-id]");if(!(n instanceof HTMLElement&&this.deps.contentElement.contains(n)))return void((this.deps.contentElement.contains(t)||t===this.deps.contentElement)&&this.handleClickBelowContent(e));if(!n.hasAttribute("data-void")&&!n.hasAttribute("data-selectable"))return void this.markPendingSelectionClear();const s=n.querySelector("[data-content-dom]");if(s?.contains(t))return void this.markPendingSelectionClear();e.preventDefault(),this.deps.contentElement.focus();const r=H(n.getAttribute("data-block-id")??""),i=tt(this.deps.contentElement,n),o=$(r,i),a=this.deps.getState(),c=a.transaction("input").setSelection(o).setStoredMarks(null,a.storedMarks).build(),l=a.apply(c);this.deps.applyUpdate(l,c)}handleClickBelowContent(e){if(this.deps.isReadOnly())return;const t=this.deps.getState(),n=t.doc.children[t.doc.children.length-1];if(!n)return;const s=n.id,r=this.deps.contentElement.querySelector(`[data-block-id="${s}"]`);if(!r)return;const i=r.getBoundingClientRect();if(e.clientY<=i.bottom)return;const o=t.getBlock(s);if("paragraph"===o?.type&&0===R(o)){const n=t.transaction("input").setSelection(V(s,0)).build();return this.deps.dispatch(n),void e.preventDefault()}e.preventDefault(),this.deps.contentElement.focus();const a=N(),c=t.transaction("input").insertNode([],t.doc.children.length,$e(a)).setSelection(V(a,0)).build();this.deps.dispatch(c)}onDragover(e){this.deps.fileHandlerRegistry&&e.dataTransfer&&e.dataTransfer.types.includes("Files")&&e.preventDefault()}onDrop(e){if(this.deps.isReadOnly())return;if(!this.deps.fileHandlerRegistry)return;if(!e.dataTransfer)return;const t=Array.from(e.dataTransfer.files);if(0===t.length)return;const n=this.getPositionFromPoint(e.clientX,e.clientY);let s=!1;for(const r of t){const e=this.deps.fileHandlerRegistry.matchFileHandlers(r.type);for(const t of e){const e=t(r,n);if(!0===e||e instanceof Promise){s=!0;break}}}s&&e.preventDefault()}getPositionFromPoint(e,t){const n=this.deps.contentElement.getRootNode(),s=be(n,e,t);return s&&this.deps.contentElement.contains(s.node)?ve(this.deps.contentElement,s.node,s.offset):null}markPendingSelectionClear(){const e=this.deps.getState();U(e.selection)&&(this.pendingNodeSelectionClear=!0),q(e.selection)&&(this.pendingGapCursorClear=!0)}}class Qn{deps;navigationKeymap=null;goalColumn=null;preserveGoalColumn=!1;constructor(e){this.deps=e,this.registerKeymaps()}resetAfterUpdate(){this.preserveGoalColumn||(this.goalColumn=null)}clearGoalColumn(){this.goalColumn=null}destroy(){this.navigationKeymap&&this.deps.keymapRegistry&&(this.deps.keymapRegistry.removeKeymap(this.navigationKeymap),this.navigationKeymap=null)}registerKeymaps(){if(!this.deps.keymapRegistry)return;const e={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down"},t={};for(const[n,s]of Object.entries(e))t[n]=()=>this.handleArrow(s);this.navigationKeymap=t,this.deps.keymapRegistry.registerKeymap(t,{priority:"navigation"})}handleArrow(e){const t=this.deps.getState();return!U(t.selection)&&!q(t.selection)&&!!Q(t.selection)&&("left"===e||"right"===e?this.handleHorizontalArrow(e):this.handleVerticalArrow(e))}handleHorizontalArrow(e){this.goalColumn=null;const t=this.deps.getState(),n=this.resolveLogicalDirection(t,e),s=we(t,n);if(s)return this.deps.dispatch(s),this.validateSelectionAfterInlineSkip(),!0;if(!Re(this.deps.contentElement,t,e))return!1;const r=Ce(t,n);return!!r&&(this.deps.dispatch(r),!0)}resolveLogicalDirection(e,t){const n=e.selection;if(!Y(n))return t;const s=this.deps.contentElement.querySelector(`[data-block-id="${n.anchor.blockId}"]`);return s instanceof HTMLElement&&"rtl"===Je(s)?"left"===t?"right":"left":t}handleVerticalArrow(e){const t=this.deps.getState(),n=this.deps.contentElement.ownerDocument.getSelection?.()??null,s=n?xe(n):null;if(!Re(this.deps.contentElement,t,e,s))return!1;null===this.goalColumn&&s&&(this.goalColumn=s.left),this.preserveGoalColumn=!0;const r=Ie(this.deps.contentElement,t,e,this.goalColumn);return r?(this.deps.dispatch(r),this.preserveGoalColumn=!1,!0):(this.preserveGoalColumn=!1,!1)}validateSelectionAfterInlineSkip(){const e=this.deps.getState(),t=Se(this.deps.contentElement);t&&J(t,e.selection)||Te(this.deps.contentElement,e.selection)}}function Jn(e,t,n){if(!n)return;const s=[];let r=null,i=[];for(const o of t){const e=n.getNodeSpec(o.type),t=e?.wrapper?.(o);t&&r&&t.key===r.key?i.push(o.id):t?(r&&i.length>0&&s.push({spec:r,blockIds:i}),r=t,i=[o.id]):(r&&i.length>0&&s.push({spec:r,blockIds:i}),r=null,i=[])}r&&i.length>0&&s.push({spec:r,blockIds:i});for(const o of s){const t=e.querySelector(`[data-block-id="${o.blockIds[0]}"]`);if(!t)continue;const n=document.createElement(o.spec.tag);if(n.setAttribute("data-block-wrapper",o.spec.key),o.spec.className&&(n.className=o.spec.className),o.spec.attrs)for(const[e,s]of Object.entries(o.spec.attrs))n.setAttribute(e,s);t.before(n);for(const s of o.blockIds){const t=e.querySelector(`[data-block-id="${s}"]`);t&&n.appendChild(t)}}}function Xn(e){e.parentElement?.removeChild(e)}function Yn(e,t,n){const s=e.parentElement;s?s.replaceChild(t,e):n.replaceChild(t,e)}function Zn(e,t,n){if(t?.parentElement){const e=t.parentElement;return void(t.nextSibling?e.insertBefore(n,t.nextSibling):e.appendChild(n))}e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}function es(e,t){if(t){const n=t.getInlineNodeSpec(e.inlineType);if(n){const t=n.toDOM(e);return t.setAttribute("contenteditable","false"),t}}const n=document.createElement("span");return n.setAttribute("data-inline-type",e.inlineType),n.setAttribute("contenteditable","false"),n}function ts(e){let t=e.replace(/ {2}/g," ");return t.endsWith(" ")&&(t=`${t.slice(0,-1)} `),t.startsWith(" ")&&(t=` ${t.slice(1)}`),t}function ns(e){const t=e.nodeName??"span",n=document.createElement(t);if(n.setAttribute("data-decoration","true"),e.class)for(const s of e.class.split(" "))s&&n.classList.add(s);e.style&&Ve(n,e.style);for(const[s,r]of Object.entries(e))"class"!==s&&"style"!==s&&"nodeName"!==s&&void 0!==r&&n.setAttribute(s,r);return n}function ss(e,t,n){const s=n?.decorations?.findNode(t);if(s&&0!==s.length)for(const r of s){if(r.attrs.class)for(const t of r.attrs.class.split(" "))t&&e.classList.add(t);r.attrs.style&&Ue(e,r.attrs.style)}}function rs(e,t,n,s){const r=s?.decorations?.findInline(e.id),i=s?.nodeViewRegistry;if(i&&t&&n&&s?.getState&&s?.dispatch){const o=i.getNodeViewFactory(e.type);if(o){const i=o(e,s.getState,s.dispatch);n.set(e.id,i);const a=t.getNodeSpec(e.type);if(a?.isVoid&&i.dom.setAttribute("data-void","true"),a?.selectable&&i.dom.setAttribute("data-selectable","true"),i.contentDOM&&i.contentDOM!==i.dom&&i.contentDOM.setAttribute("data-content-dom","true"),B(e)&&i.contentDOM)is(i.contentDOM,e,t,r);else{const r=M(e),o=/* @__PURE__ */new Map;for(const e of r){const r=i.getContentDOM?.(e.id)??i.contentDOM;if(r){const i=rs(e,t,n,s);r.appendChild(i);let a=o.get(r);a||(a=[],o.set(r,a)),a.push(e)}}for(const[e,n]of o)Jn(e,n,t)}return i.dom.setAttribute("data-block-type",e.type),ss(i.dom,e.id,s),i.dom}}if(t){const i=t.getNodeSpec(e.type);if(i){const o=i.toDOM(e);if(i.isVoid&&o.setAttribute("data-void","true"),i.selectable&&o.setAttribute("data-selectable","true"),!i.isVoid)if(B(e))is(o,e,t,r);else{const r=M(e);for(const e of r){const r=rs(e,t,n,s);o.appendChild(r)}Jn(o,r,t)}return o.setAttribute("data-block-type",e.type),ss(o,e.id,s),o}}return function(e,t,n){const s=et("p",e.id);return s.setAttribute("data-block-type",e.type),is(s,e,t,n),s}(e,t,r)}function is(e,t,n,s){for(const o of e.querySelectorAll("[data-cursor-wrapper]"))o.remove();const r=v(t);if(1===r.length&&k(r[0])&&""===r[0].text)return void e.appendChild(document.createElement("br"));if(s&&0!==s.length)!function(e,t,n,s){let r=0;for(const i of t){if(m(i)){e.appendChild(es(i,s)),r+=1;continue}const t=r,o=r+i.text.length;if(0===i.text.length){r=o;continue}const a=/* @__PURE__ */new Set;a.add(t),a.add(o);for(const e of n){const n=Math.max(t,e.from),s=Math.min(o,e.to);n>t&&n<o&&a.add(n),s>t&&s<o&&a.add(s)}const c=[...a].sort((e,t)=>e-t);for(let r=0;r<c.length-1;r++){const o=c[r],a=c[r+1];if(void 0===o||void 0===a||o>=a)continue;const l=o-t,d=a-t,h=i.text.slice(l,d),p=[];for(const e of n)e.from<=o&&e.to>=a&&p.push(e);let u=fn(document.createTextNode(ts(h)),i.marks,s);for(const e of p){const t=ns(e.attrs);t.appendChild(u),u=t}e.appendChild(u)}r=o}}(e,r,s,n);else for(const o of r)k(o)?e.appendChild(os(o,n)):e.appendChild(es(o,n));const i=r[r.length-1];i&&m(i)&&"hard_break"===i.inlineType&&e.appendChild(document.createElement("br"))}function os(e,t){return""===e.text?document.createTextNode(""):fn(document.createTextNode(ts(e.text)),e.marks,t)}function as(e,t,n,s){const r=t?.doc.children??[],i=n.doc.children,o=s?.registry,a=s?.nodeViews,c=null!=s?.compositionBlockId;c||function(e){const t=Array.from(e.querySelectorAll(":scope > [data-block-wrapper]"));for(const n of t){for(;n.firstChild;)e.insertBefore(n.firstChild,n);n.remove()}}(e);const l=/* @__PURE__ */new Map;for(const g of function(e){const t=[];for(const n of Array.from(e.children))if(n instanceof HTMLElement)if(n.hasAttribute("data-block-id"))t.push(n);else if(n.hasAttribute("data-block-wrapper"))for(const e of Array.from(n.children))e instanceof HTMLElement&&e.hasAttribute("data-block-id")&&t.push(e);return t}(e)){const e=g.getAttribute("data-block-id");e&&l.set(H(e),g)}const d=new Set(i.map(e=>e.id));for(const[g,m]of l)if(!d.has(g)){Xn(m),l.delete(g);const e=a?.get(g);e&&(e.destroy?.(),a?.delete(g))}const h=/* @__PURE__ */new Map;for(const g of r)h.set(g.id,g);let p=null;const u=s?.selectedNodeId,f=s?.previousSelectedNodeId;for(const g of i){const t=l.get(g.id),n=h.get(g.id);if(s?.compositionBlockId===g.id&&t){p=t;continue}const r=s?.oldDecorations?.find(g.id),i=s?.decorations?.find(g.id);if(t&&n&&!cs(n,g,r,i))p=t;else if(t){const n=a?.get(g.id);if(n){if(n.update?.(g)){if(B(g)&&n.contentDOM){n.contentDOM.textContent="";const e=s?.decorations?.findInline(g.id);is(n.contentDOM,g,o,e)}p=n.dom;continue}n.destroy?.(),a?.delete(g.id)}const r=rs(g,o,a,s);Yn(t,r,e),p=r}else{const t=rs(g,o,a,s);Zn(e,p,t),p=t}if(u===g.id){const e=a?.get(g.id);if(e)e.selectNode?.();else{const e=l.get(g.id)??p;e instanceof HTMLElement&&e.classList.add("notectl-node-selected")}}else if(f===g.id){const e=a?.get(g.id);if(e)e.deselectNode?.();else{const e=l.get(g.id)??p;e instanceof HTMLElement&&e.classList.remove("notectl-node-selected")}}}if(f&&f!==u){const e=a?.get(f);e&&!d.has(f)&&e.deselectNode?.()}if(u&&!d.has(u)){const e=a?.get(u);e&&e.selectNode?.()}c||Jn(e,i,o)}function cs(e,t,n,s){if(e.type!==t.type)return!0;if(e.children.length!==t.children.length)return!0;const r=e.attrs,i=t.attrs;if(r!==i){if(!r||!i)return!0;const e=Object.keys(r),t=Object.keys(i);if(e.length!==t.length)return!0;for(const n of e)if(r[n]!==i[n])return!0}for(let c=0;c<e.children.length;c++){const n=e.children[c],s=t.children[c];if(!n||!s)return!0;if(k(n)&&k(s)){if(n.text!==s.text)return!0;if(!D(n.marks,s.marks))return!0}else if(m(n)&&m(s)){if(n.inlineType!==s.inlineType)return!0;if(!ls(n.attrs,s.attrs))return!0}else{if(k(n)||k(s)||m(n)||m(s))return!0;if(cs(n,s))return!0}}const o=n??[],a=s??[];return o!==a&&!oe(o,a)}function ls(e,t){const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}class ds{state;contentElement;history;stateChangeCallbacks=[];isUpdating=!1;schemaRegistry;nodeViewRegistry;nodeViews=/* @__PURE__ */new Map;decorations=ie.empty;getDecorations;isReadOnly;compositionState;cursorWrapper;navigation;events;constructor(e,t){this.state=t.state,this.contentElement=e,this.schemaRegistry=t.schemaRegistry,this.nodeViewRegistry=t.nodeViewRegistry,this.getDecorations=t.getDecorations,this.isReadOnly=t.isReadOnly??(()=>!1),this.compositionState=t.compositionState??{isComposing:!1,activeBlockId:null},this.history=new Mt({maxDepth:t.maxHistoryDepth??100}),t.onStateChange&&this.stateChangeCallbacks.push(t.onStateChange),this.cursorWrapper=new mn(e,this.schemaRegistry),this.navigation=new Qn({contentElement:e,getState:()=>this.state,dispatch:e=>this.dispatch(e),keymapRegistry:t.keymapRegistry}),this.events=new Gn({contentElement:e,getState:()=>this.state,dispatch:e=>this.dispatch(e),applyUpdate:(e,t)=>this.applyUpdate(e,t),isUpdating:()=>this.isUpdating,compositionState:this.compositionState,cursorWrapper:this.cursorWrapper,isReadOnly:this.isReadOnly,fileHandlerRegistry:t.fileHandlerRegistry,onMousedown:()=>this.navigation.clearGoalColumn()}),this.decorations=this.getDecorations?.(this.state)??ie.empty,as(e,null,this.state,{...this.reconcileOptions(),decorations:this.decorations}),Te(e,this.state.selection)}getState(){return this.state}applyUpdate(e,t,n){if(!this.isUpdating){this.isUpdating=!0;try{const s=this.state;this.state=e,this.cursorWrapper.isActive&&!e.storedMarks?.length&&this.cursorWrapper.cleanup(),(n?.pushHistory&&"history"!==t.metadata.origin||Et(t))&&this.history.push(t);const r=this.getDecorations?.(e,t)??ie.empty;this.reconcileAndSync(s,e,r);for(const n of this.stateChangeCallbacks)n(s,e,t);this.navigation.resetAfterUpdate()}finally{this.isUpdating=!1}}}dispatch(e){const t=this.state.apply(e);this.applyUpdate(t,e,{pushHistory:!0})}undo(){if(this.isUpdating||this.isReadOnly())return;const e=this.history.undo(this.state);e&&this.applyUpdate(e.state,e.transaction)}redo(){if(this.isUpdating||this.isReadOnly())return;const e=this.history.redo(this.state);e&&this.applyUpdate(e.state,e.transaction)}onStateChange(e){return this.stateChangeCallbacks.push(e),()=>{const t=this.stateChangeCallbacks.indexOf(e);-1!==t&&this.stateChangeCallbacks.splice(t,1)}}replaceState(e){if(!this.isUpdating){this.isUpdating=!0;try{const t=this.state;this.state=e,this.history.clear(),this.cursorWrapper.isActive&&!e.storedMarks?.length&&this.cursorWrapper.cleanup();const n={steps:[],selectionBefore:t.selection,selectionAfter:e.selection,storedMarksAfter:e.storedMarks,metadata:{origin:"api",timestamp:Date.now()}},s=this.getDecorations?.(e,n)??ie.empty;this.reconcileAndSync(t,e,s);for(const r of this.stateChangeCallbacks)r(t,e,n);this.navigation.resetAfterUpdate()}finally{this.isUpdating=!1}}}syncSelection(){this.events.syncSelectionFromDOM()}reconcileAndSync(e,t,n){const s=this.decorations;this.decorations=n,as(this.contentElement,e,t,{...this.reconcileOptions(e.selection),decorations:n,oldDecorations:s,compositionBlockId:this.compositionState.isComposing?this.compositionState.activeBlockId??void 0:void 0}),this.compositionState.isComposing||Te(this.contentElement,t.selection)}reconcileOptions(e){const t=U(this.state.selection)?this.state.selection.nodeId:void 0,n=e&&U(e)?e.nodeId:void 0;return{registry:this.schemaRegistry,nodeViewRegistry:this.nodeViewRegistry,nodeViews:this.nodeViews,getState:()=>this.state,dispatch:e=>this.dispatch(e),selectedNodeId:t,previousSelectedNodeId:n}}destroy(){this.cursorWrapper.cleanup(),this.events.destroy(),this.navigation.destroy();for(const e of this.nodeViews.values())e.destroy?.();this.nodeViews.clear()}}const hs={ariaLabel:"Rich text editor",ariaDescription:"Press Escape to exit the editor",defaultPlaceholder:"Start typing..."},ps=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-mSCYQYnL.mjs"),"./locales/de.ts":()=>import("./de-DOLwx_M7.mjs"),"./locales/es.ts":()=>import("./es-Bk0bRDFE.mjs"),"./locales/fr.ts":()=>import("./fr-C1W7jyd6.mjs"),"./locales/hi.ts":()=>import("./hi-ntUsOspQ.mjs"),"./locales/pt.ts":()=>import("./pt-cN6r-f7f.mjs"),"./locales/ru.ts":()=>import("./ru-CZvkdGnf.mjs"),"./locales/zh.ts":()=>import("./zh-lhynyH6Q.mjs")}),us=["\n:host {\n\tdisplay: block;\n\tfont-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n\tfont-size: 16px;\n\tline-height: 1.6;\n\tcolor: var(--notectl-fg);\n}\n\n.notectl-editor {\n\tdisplay: flex;\n\tflex-direction: column;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 6px;\n\toverflow: hidden;\n\tbackground: var(--notectl-bg);\n}\n\n.notectl-editor:focus-within {\n\tborder-color: var(--notectl-border-focus);\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* Content Area */\n.notectl-content {\n\tflex: 1;\n\tpadding: 12px 16px;\n\toutline: none;\n\tmin-height: var(--notectl-content-min-height, 400px);\n\tcursor: text;\n\tposition: relative;\n\twhite-space: pre-wrap;\n\tword-wrap: break-word;\n\t-webkit-user-select: text;\n\tuser-select: text;\n\t-moz-tab-size: 4;\n\ttab-size: 4;\n}\n\n.notectl-content p {\n\tmargin: 0;\n\tpadding: 2px 0;\n\tmin-height: 1.6em;\n}\n\n.notectl-content p + p {\n\tmargin-top: 0;\n}\n\n/* Horizontal Rule */\n.notectl-content hr {\n\tborder: none;\n\tborder-top: 1px solid var(--notectl-border);\n\tmargin: 8px 0;\n\tpadding: 0;\n\tcursor: default;\n\tuser-select: none;\n}\n\n/* Placeholder */\n.notectl-content.notectl-content--empty::before {\n\tcontent: attr(data-placeholder);\n\tcolor: var(--notectl-fg-muted);\n\tpointer-events: none;\n\tposition: absolute;\n\ttop: 12px;\n\tinset-inline-start: 16px;\n}\n\n/* Plugin container bottom */\n.notectl-plugin-container--bottom {\n\tborder-top: 1px solid var(--notectl-border);\n}\n\n/* Screen reader announcements */\n.notectl-sr-only {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tmargin: -1px;\n\tpadding: 0;\n\toverflow: hidden;\n\tclip: rect(0, 0, 0, 0);\n\twhite-space: nowrap;\n\tborder: 0;\n}\n\n/* Node selection */\n.notectl-node-selected {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 2px;\n}\n","\n@media (prefers-reduced-motion: reduce) {\n\t.notectl-toolbar-btn,\n\t.notectl-image__resize-handle,\n\t.notectl-image__size-indicator,\n\t.notectl-color-picker__swatch,\n\t.notectl-font-picker__item,\n\t.notectl-heading-picker__item,\n\t.notectl-font-size-picker__item,\n\t.ntbl-handle,\n\t.ntbl-handle-delete,\n\t.ntbl-insert-line,\n\t.ntbl-insert-btn,\n\t.ntbl-add-zone,\n\t.ntbl-add-icon,\n\t.ntbl-col-bar,\n\t.ntbl-row-bar,\n\t.ntbl-delete-table-btn,\n\t.notectl-code-block__copy {\n\t\ttransition: none !important;\n\t}\n}\n",`\n/* Paper viewport: scroll container with centered gray background */\n.notectl-paper-viewport {\n\tflex: 1;\n\toverflow-y: auto;\n\toverflow-x: hidden;\n\tbackground: var(--notectl-paper-viewport-bg, #e8e8e8);\n\tpadding: ${ee}px 0;\n}\n\n/* Paper surface: white page with shadow, centered */\n.notectl-paper-surface {\n\tmargin: 0 auto;\n\tbackground: var(--notectl-bg);\n\tborder-radius: 2px;\n\tbox-shadow: 0 2px 8px var(--notectl-shadow, rgba(0, 0, 0, 0.15));\n\ttransform-origin: top center;\n\ttransition: transform 0.15s ease-out;\n}\n\n/* Content overrides in paper mode: wider document margins */\n.notectl-editor[data-paper-mode] .notectl-content {\n\tflex: none;\n\tpadding: ${te}px ${ne}px;\n\tmin-height: auto;\n}\n\n/* Placeholder position override for paper mode */\n.notectl-editor[data-paper-mode] .notectl-content.notectl-content--empty::before {\n\ttop: ${te}px;\n\tinset-inline-start: ${ne}px;\n}\n\n/* Dark mode: darker viewport background */\n:host([theme="dark"]) .notectl-paper-viewport {\n\t--notectl-paper-viewport-bg: #181825;\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t.notectl-paper-surface {\n\t\ttransition: none !important;\n\t}\n}\n`].join("\n");let fs=null;class gs{themeStyleSheet=new CSSStyleSheet;systemThemeQuery=null;systemThemeHandler=null;pluginSheets=[];runtimeSheets=[];shadow;constructor(e){this.shadow=e}apply(e){if(this.cleanupSystemThemeListener(),e===xn.System){this.setupSystemThemeListener();const e=En(this.getSystemTheme());this.setThemeStyleSheet(e)}else this.setThemeStyleSheet(En(e))}setPluginStyleSheets(e){this.pluginSheets=e,this.refreshAdoptedStyleSheets()}setRuntimeStyleSheets(e){this.runtimeSheets=e,this.refreshAdoptedStyleSheets()}destroy(){this.cleanupSystemThemeListener()}setThemeStyleSheet(e){this.themeStyleSheet.replaceSync(Nn(e)),this.refreshAdoptedStyleSheets()}refreshAdoptedStyleSheets(){this.shadow.adoptedStyleSheets=[this.themeStyleSheet,(fs||(fs=new CSSStyleSheet,fs.replaceSync(us)),fs),...this.pluginSheets,...this.runtimeSheets]}setupSystemThemeListener(){this.systemThemeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.systemThemeHandler=e=>{const t=En(this.getSystemTheme());this.setThemeStyleSheet(t)},this.systemThemeQuery.addEventListener("change",this.systemThemeHandler)}cleanupSystemThemeListener(){this.systemThemeQuery&&this.systemThemeHandler&&this.systemThemeQuery.removeEventListener("change",this.systemThemeHandler),this.systemThemeQuery=null,this.systemThemeHandler=null}getSystemTheme(){return(this.systemThemeQuery??window.matchMedia("(prefers-color-scheme: dark)")).matches?xn.Dark:xn.Light}}class ms{wrapper;content;viewport=null;surface=null;viewportObserver=null;surfaceObserver=null;currentSize=null;currentPaperWidthPx=0;currentPaperHeightPx=0;currentScale=1;compensationFrameId=null;constructor(e,t){this.wrapper=e,this.content=t}apply(e){if(null===e)return void this.disable();const t=se(e);this.currentPaperWidthPx=t.widthPx,this.currentPaperHeightPx=t.heightPx,this.currentSize=e,this.viewport||this.enable(),this.updateSurfaceDimensions(),this.wrapper.setAttribute("data-paper-mode",e)}destroy(){this.disable()}getPaperSize(){return this.currentSize}enable(){this.viewport=document.createElement("div"),this.viewport.className="notectl-paper-viewport",this.surface=document.createElement("div"),this.surface.className="notectl-paper-surface",this.wrapper.removeChild(this.content),this.surface.appendChild(this.content),this.viewport.appendChild(this.surface);const e=this.wrapper.querySelector(".notectl-plugin-container--bottom");e?this.wrapper.insertBefore(this.viewport,e):this.wrapper.appendChild(this.viewport),this.viewportObserver=new ResizeObserver(e=>{for(const t of e)this.onViewportResize(t.contentRect.width)}),this.viewportObserver.observe(this.viewport),this.surfaceObserver=new ResizeObserver(e=>{for(const t of e)this.onSurfaceResize(t.contentRect.height)}),this.surfaceObserver.observe(this.surface)}disable(){if(null!==this.compensationFrameId&&(cancelAnimationFrame(this.compensationFrameId),this.compensationFrameId=null),this.viewportObserver?.disconnect(),this.viewportObserver=null,this.surfaceObserver?.disconnect(),this.surfaceObserver=null,this.viewport&&this.surface){this.surface.removeChild(this.content);const e=this.wrapper.querySelector(".notectl-plugin-container--bottom");e?this.wrapper.insertBefore(this.content,e):this.wrapper.appendChild(this.content),this.wrapper.removeChild(this.viewport)}this.viewport=null,this.surface=null,this.currentSize=null,this.currentPaperWidthPx=0,this.currentPaperHeightPx=0,this.currentScale=1,this.wrapper.removeAttribute("data-paper-mode")}updateSurfaceDimensions(){this.surface&&(qe(this.surface,"width",`${this.currentPaperWidthPx}px`),qe(this.surface,"minHeight",`${this.currentPaperHeightPx}px`))}onViewportResize(e){if(!this.surface||0===this.currentPaperWidthPx)return;const t=e-2*ee,n=Math.min(1,t/this.currentPaperWidthPx);this.currentScale=n,qe(this.surface,"transform",n<1?`scale(${n})`:""),this.scheduleHeightCompensation(n)}onSurfaceResize(e){this.surface&&this.viewport&&this.scheduleHeightCompensation(this.currentScale)}scheduleHeightCompensation(e){null!==this.compensationFrameId&&cancelAnimationFrame(this.compensationFrameId),this.compensationFrameId=requestAnimationFrame(()=>{this.compensationFrameId=null,this.updateHeightCompensation(e)})}updateHeightCompensation(e){if(!this.surface)return;if(e>=1)return void qe(this.surface,"marginBottom","");const t=this.surface.scrollHeight,n=t*e-t;qe(this.surface,"marginBottom",`${n}px`)}}function ys(e){return!Array.isArray(e)}async function ks(e){const t=e.config,n=()=>e.isCancelled?.()??!1;let s=null,r=null,i=null,o=null,a=null,c=null,l=!1;const d=()=>{c=null},h=async()=>{if(l)return;l=!0;const t=c;c=null,i?.destroy(),i=null,e.styleCoordinator.teardown(e.shadow,s),s?.destroy(),s=null,a?.destroy(),a=null,t?.destroy();const n=o;o=null,await(n?.destroy()),r?.wrapper.remove(),r=null};try{if(s=new gs(e.shadow),e.styleCoordinator.setup(e.shadow,t.styleNonce,s),s.apply(t.theme??xn.Light),n())return await h(),null;const l=await async function(e){const t=new ce(e.locale??"browser").getLocale();return"en"===t?hs:await async function(e){if("en"===e)return hs;const t=ps[`./locales/${e}.ts`];if(!t)return hs;try{return(await t()).default}catch{return hs}}(t)}(t);if(n())return await h(),null;r=function(e){const t=e.locale??hs,n=t.defaultPlaceholder,s=document.createElement("div");s.className="notectl-editor";const r=document.createElement("div");r.className="notectl-plugin-container--top",r.setAttribute("data-notectl-no-print","");const i=document.createElement("div");i.className="notectl-content",i.contentEditable=e.readonly?"false":"true",i.setAttribute("role","textbox"),i.setAttribute("aria-multiline","true"),i.setAttribute("aria-label",t.ariaLabel),e.readonly&&i.setAttribute("aria-readonly","true"),i.setAttribute("aria-description",t.ariaDescription),i.setAttribute("data-default-placeholder",n),i.setAttribute("data-placeholder",e.placeholder??n),e.dir&&(s.setAttribute("dir",e.dir),i.setAttribute("dir",e.dir));const o=document.createElement("div");o.className="notectl-plugin-container--bottom",o.setAttribute("data-notectl-no-print","");const a=document.createElement("div");return a.className="notectl-sr-only",a.setAttribute("data-notectl-no-print",""),a.setAttribute("aria-live","polite"),a.setAttribute("aria-atomic","true"),s.appendChild(r),s.appendChild(i),s.appendChild(o),s.appendChild(a),{wrapper:s,content:i,topPluginContainer:r,bottomPluginContainer:o,announcer:a}}({readonly:t.readonly,placeholder:t.placeholder,dir:t.dir??e.hostDir,locale:l}),e.shadow.appendChild(r.wrapper),t.paperSize&&(i=new ms(r.wrapper,r.content),i.apply(t.paperSize)),o=new Cn,o.registerService(ae,new ce(t.locale??"browser")),ct(o.schemaRegistry),function(e,t){if(!t)return;const n=ys(t)?t.groups:t,s=ys(t)?t.overflow:void 0,r=[];for(const o of n){const t=[];for(const n of o)t.push(n.id),e.register(n);r.push(t)}const i={groups:r,overflow:s};e.register(new Ze(i))}(o,t.toolbar);for(const e of t.plugins??[])o.register(e);for(const t of e.preInitPlugins)o.register(t);p=o,g=t.features,function(e,t){if(void 0!==e.get("text-formatting"))return;const n={bold:t?.bold??!0,italic:t?.italic??!0,underline:t?.underline??!0};e.register(new rt(n))}(p,g),function(e){void 0===e.get("caret-navigation")&&e.register(new Pe)}(p),function(e){void 0===e.get("gap-cursor")&&e.register(new nt)}(p);const m=r,y=o,k=s;m.content.addEventListener("focus",()=>e.events.emit("focus",void 0)),m.content.addEventListener("blur",()=>e.events.emit("blur",void 0));const S=t=>{c&&o&&(!e.configController.isReadOnly||Bt(t)||o.isReadonlyBypassed())&&o.dispatchWithMiddleware(t,c.getState(),e=>c?.dispatch(e))};return await y.init({isCancelled:n,getState:()=>{if(!c)throw new Error("View not initialized");return c.getState()},dispatch:S,getContainer:()=>m.content,getPluginContainer:e=>"top"===e?m.topPluginContainer:m.bottomPluginContainer,announce:e=>{m.announcer&&(m.announcer.textContent=e)},hasAnnouncement:()=>!!m.announcer?.textContent,onBeforeReady:()=>{if(n()||!o||!s)return;const r=u(y.schemaRegistry),i=xt.create({schema:r});a=new an(m.content,{getState:()=>{if(!c)throw new Error("View not initialized");return c.getState()},dispatch:S,syncSelection:()=>c?.syncSelection(),undo:()=>c?.undo(),redo:()=>c?.redo(),schemaRegistry:y.schemaRegistry,keymapRegistry:y.keymapRegistry,inputRuleRegistry:y.inputRuleRegistry,fileHandlerRegistry:y.fileHandlerRegistry,isReadOnly:()=>e.configController.isReadOnly,getPasteInterceptors:()=>y.getPasteInterceptors(),getTextDirection:Je,navigateFromGapCursor:st}),c=new ds(m.content,{state:i,schemaRegistry:y.schemaRegistry,keymapRegistry:y.keymapRegistry,fileHandlerRegistry:y.fileHandlerRegistry,nodeViewRegistry:y.nodeViewRegistry,maxHistoryDepth:t.maxHistoryDepth,getDecorations:(e,t)=>y.collectDecorations(e,t)??ie.empty,onStateChange:(t,n,s)=>{!function(e,t,n,s,r,i){const o=s.announcer;if(o&&(o.textContent=""),r.notifyStateChange(e,t,n),Ss(s.content,t.doc),i.emit("stateChange",{oldState:e,newState:t,transaction:n}),J(e.selection,t.selection)||i.emit("selectionChange",{selection:t.selection}),!o?.textContent){const s=function(e,t,n){if("undo"===n.metadata.historyDirection)return"Undo";if("redo"===n.metadata.historyDirection)return"Redo";for(const s of n.steps)if("setBlockType"===s.type)return Hn(s.nodeType,s.attrs);for(const s of t.schema.markTypes){const n=z(s),r=f(e,n),i=f(t,n);if(r!==i)return`${s} ${i?"on":"off"}`}return null}(e,t,n);s&&o&&(o.textContent=s)}}(t,n,s,m,y,e.events)},isReadOnly:()=>e.configController.isReadOnly,compositionState:a.compositionTracker}),Ss(m.content,c.getState().doc);const l=y.getPluginStyleSheets();l.length>0&&k.setPluginStyleSheets(l)}}),!n()&&c&&a&&o&&r&&s?(t.readonly&&y.setReadOnly(!0),y.onEvent(re,t=>{!t.options.paperSize&&e.configController.getPaperSize()&&(t.options={...t.options,paperSize:e.configController.getPaperSize()})}),t.autofocus&&requestAnimationFrame(()=>m.content.focus()),{view:c,inputManager:a,pluginManager:y,domElements:m,themeController:k,paperLayout:i,release:d}):(await h(),null)}catch(m){throw await h(),m}var p,g}function Ss(e,t){e.classList.toggle("notectl-content--empty",Un(t))}class bs{state="idle";readyPromiseResolve=null;readyPromiseReject=null;readyPromise;preInitPlugins=[];constructor(){this.readyPromise=this.createReadyPromise()}isInitialized(){return"initializing"===this.state||"ready"===this.state}markInitialized(){return"initializing"!==this.state&&"ready"!==this.state&&("failed"===this.state&&(this.readyPromise=this.createReadyPromise()),this.state="initializing",!0)}whenReady(){return this.readyPromise}resolveReady(){"initializing"===this.state&&(this.state="ready",this.readyPromiseResolve?.(),this.readyPromiseResolve=null,this.readyPromiseReject=null)}failReady(e){"initializing"===this.state&&(this.state="failed",this.readyPromiseReject?.(e),this.readyPromiseResolve=null,this.readyPromiseReject=null)}registerPreInitPlugin(e){if("initializing"===this.state||"ready"===this.state)throw new Error("Cannot register plugins after initialization. Register before calling init() or adding to DOM.");this.preInitPlugins.push(e)}consumePreInitPlugins(){const e=this.preInitPlugins;return this.preInitPlugins=[],e}restorePreInitPlugins(e){0!==e.length&&(this.preInitPlugins=[...e,...this.preInitPlugins])}reset(){this.state="idle",this.preInitPlugins=[],this.readyPromise=this.createReadyPromise()}createReadyPromise(){const e=new Promise((e,t)=>{this.readyPromiseResolve=e,this.readyPromiseReject=t});return e.catch(()=>{}),e}}class vs{runtimeStyleSheet=null;setup(e,t,n){We(e),this.runtimeStyleSheet=Ge(),n?.setRuntimeStyleSheets(this.runtimeStyleSheet?[this.runtimeStyleSheet]:[]),Qe(e,{nonce:t,sheet:this.runtimeStyleSheet})}teardown(e,t){e&&We(e),this.runtimeStyleSheet=null,t?.setRuntimeStyleSheets([])}}class ws extends HTMLElement{view=null;inputManager=null;pluginManager=null;domElements=null;configController=new qn;events=new Wn;lifecycle=new bs;styleCoordinator=new vs;themeController=null;paperLayout=null;pendingInitPromise=null;cancelPendingInit=null;autoInitToken=0;autoInitQueued=!1;initVersion=0;releaseInit=null;constructor(){super(),this.attachShadow({mode:"open"})}static get observedAttributes(){return["placeholder","readonly","theme","paper-size","dir"]}connectedCallback(){this.lifecycle.isInitialized()||this.scheduleAutoInit()}disconnectedCallback(){setTimeout(()=>{this.isConnected||this.destroy()},0)}attributeChangedCallback(e,t,n){this.configController.applyAttribute(e,n,this.getConfigDeps())}registerPlugin(e){this.lifecycle.registerPreInitPlugin(e)}async init(e){if(this.cancelAutoInit(),!this.lifecycle.markInitialized())return;e&&this.configController.setConfig(e);const t=this.shadowRoot;if(!t){const e=new Error("Editor shadow root not available.");throw this.lifecycle.failReady(e),e}const n=++this.initVersion;let s=!1;this.cancelPendingInit=()=>{s=!0};const r=this.lifecycle.consumePreInitPlugins(),i=ks({shadow:t,config:this.configController.getConfig(),hostDir:this.getAttribute("dir")??void 0,configController:this.configController,styleCoordinator:this.styleCoordinator,events:this.events,preInitPlugins:r,isCancelled:()=>s||n!==this.initVersion});this.pendingInitPromise=i;try{const e=await i;if(!e){if(s||n!==this.initVersion)return;throw new Error("Editor initialization completed without a result.")}if(n!==this.initVersion)return;this.view=e.view,this.inputManager=e.inputManager,this.pluginManager=e.pluginManager,this.domElements=e.domElements,this.themeController=e.themeController,this.paperLayout=e.paperLayout,this.releaseInit=e.release,this.lifecycle.resolveReady(),this.events.emit("ready",void 0)}catch(o){throw n===this.initVersion&&(this.lifecycle.restorePreInitPlugins(r),this.lifecycle.failReady(o)),o}finally{this.pendingInitPromise===i&&(this.pendingInitPromise=null,this.cancelPendingInit=null)}}get isReadOnly(){return this.configController.isReadOnly}getJSON(){if(!this.view)throw new Error("Editor not initialized");return this.view.getState().doc}setJSON(e){this.assertInitialized(),$n(e,this.pluginManager?.schemaRegistry,e=>this.replaceState(e))}async getContentHTML(e){if(!this.view)throw new Error("Editor not initialized");return async function(e,t,n){const s=e.doc,{serializeDocumentToHTML:r,serializeDocumentToCSS:i}=await import("./DocumentParser-LvzDQOd1.mjs").then(e=>e.D);if("classes"===n?.cssMode){const e=i(s,t);return n.pretty?{html:L(e.html),css:e.css,styleMap:e.styleMap}:e}const o=r(s,t);return n?.pretty?L(o):o}(this.view.getState(),this.pluginManager?.schemaRegistry,e)}async setContentHTML(e,t){return this.assertInitialized(),async function(e,t,n,s){const{parseHTMLToDocument:r}=await import("./DocumentParser-LvzDQOd1.mjs").then(e=>e.e);$n(r(e,t,s),t,n)}(e,this.pluginManager?.schemaRegistry,e=>this.replaceState(e),t)}getText(){if(!this.view)throw new Error("Editor not initialized");return this.view.getState().doc.children.map(e=>I(e)).join("\n")}isEmpty(){return!this.view||Un(this.view.getState().doc)}commands={toggleBold:()=>this.executeCommand("toggleBold"),toggleItalic:()=>this.executeCommand("toggleItalic"),toggleUnderline:()=>this.executeCommand("toggleUnderline"),undo:()=>{this.configController.isReadOnly||this.view?.undo()},redo:()=>{this.configController.isReadOnly||this.view?.redo()},selectAll:()=>{if(!this.view)return;const e=s(this.view.getState());this.dispatch(e)}};can(){const e=this.view?.getState().schema,t=this.configController.isReadOnly;return{toggleBold:()=>!t&&!!e&&h(e,"bold"),toggleItalic:()=>!t&&!!e&&h(e,"italic"),toggleUnderline:()=>!t&&!!e&&h(e,"underline"),undo:()=>!t&&(this.view?.history.canUndo()??!1),redo:()=>!t&&(this.view?.history.canRedo()??!1),selectAll:()=>this.canExecuteCommand("selectAll")}}canExecuteCommand(e){return this.pluginManager?.canExecuteCommand(e)??!1}executeCommand(e){return this.pluginManager?.executeCommand(e)??!1}configurePlugin(e,t){this.pluginManager?.configurePlugin(e,t)}getService(e){return this.pluginManager?.getService(e)}onPluginEvent(e,t){return this.pluginManager?.onEvent(e,t)??(()=>{})}getState(){if(!this.view)throw new Error("Editor not initialized");return this.view.getState()}dispatch(e){this.view&&this.pluginManager&&(!this.configController.isReadOnly||Bt(e)||this.pluginManager.isReadonlyBypassed())&&this.pluginManager.dispatchWithMiddleware(e,this.view.getState(),e=>this.view?.dispatch(e))}on(e,t){this.events.on(e,t)}off(e,t){this.events.off(e,t)}whenReady(){return this.lifecycle.whenReady()}configure(e){this.configController.applyRuntimeConfig(e,this.getConfigDeps())}setTheme(e){this.configController.applyTheme(e,this.themeController)}getTheme(){return this.configController.getTheme()}getPaperSize(){return this.configController.getPaperSize()}destroy(){this.cancelAutoInit(),this.initVersion++,this.cancelPendingInit?.(),this.cancelPendingInit=null;const e=this.pendingInitPromise?.then(()=>{},()=>{})??Promise.resolve();this.pendingInitPromise=null,this.releaseInit?.(),this.releaseInit=null,this.paperLayout?.destroy(),this.paperLayout=null,this.styleCoordinator.teardown(this.shadowRoot,this.themeController),this.themeController?.destroy(),this.themeController=null,this.inputManager?.destroy(),this.inputManager=null,this.view?.destroy();const t=this.pluginManager?.destroy()??Promise.resolve();return this.view=null,this.pluginManager=null,this.lifecycle.reset(),this.events.clear(),this.domElements?.wrapper.remove(),this.domElements=null,Promise.all([t,e]).then(()=>{})}getConfigDeps(){return{contentElement:this.domElements?.content??null,editorWrapper:this.domElements?.wrapper??null,pluginManager:this.pluginManager,themeController:this.themeController,applyPaperSize:e=>this.applyPaperSize(e)}}scheduleAutoInit(){const e=++this.autoInitToken;this.autoInitQueued=!0,queueMicrotask(()=>{this.isConnected&&this.autoInitQueued&&this.autoInitToken===e&&(this.autoInitQueued=!1,this.lifecycle.isInitialized()||this.init().catch(()=>{}))})}cancelAutoInit(){this.autoInitToken++,this.autoInitQueued=!1}applyPaperSize(e){this.domElements&&(e?(this.paperLayout||(this.paperLayout=new ms(this.domElements.wrapper,this.domElements.content)),this.paperLayout.apply(e)):this.paperLayout?.apply(null))}replaceState(e){this.view&&this.view.replaceState(e)}assertInitialized(){if(!this.view)throw new Error("Editor not initialized")}}async function Rs(e){const t=document.createElement("notectl-editor");return await t.init(e),t}"undefined"==typeof customElements||customElements.get("notectl-editor")||customElements.define("notectl-editor",ws);export{En as A,at as B,_t as C,Tn as D,xt as E,dn as F,Mt as H,an as I,cn as K,In as L,pn as N,Cn as P,it as S,xn as T,zt as a,mn as b,yn as c,ln as d,On as e,ws as f,Ct as g,Kn as h,kt as i,ot as j,Rs as k,Pn as l,Dn as m,Nt as n,Dt as o,Nn as p,Hn as q,_n as r,vt as s,Rt as t,Bt as u,Et as v,Lt as w,ct as x,jn as y,zn as z};
|
|
4
|
-
//# sourceMappingURL=NotectlEditor-BJD7-FFx.mjs.map
|