@notectl/core 2.0.2 → 2.0.3
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-CIkPaP2h.mjs +2 -0
- package/dist/chunks/AlignmentPlugin-CIkPaP2h.mjs.map +1 -0
- package/dist/chunks/AttrRegistry-B1iBFcKO.mjs +2 -0
- package/dist/chunks/AttrRegistry-B1iBFcKO.mjs.map +1 -0
- package/dist/chunks/AttributedMarkCommands-Cmet1IuC.mjs +2 -0
- package/dist/chunks/AttributedMarkCommands-Cmet1IuC.mjs.map +1 -0
- package/dist/chunks/BlockInsertion-DTIE2BiH.mjs +2 -0
- package/dist/chunks/BlockInsertion-DTIE2BiH.mjs.map +1 -0
- package/dist/chunks/BlockTypePickerRegistry-U4uY7-lN.mjs +2 -0
- package/dist/chunks/BlockTypePickerRegistry-U4uY7-lN.mjs.map +1 -0
- package/dist/chunks/BlockquotePlugin-DmbnFmNj.mjs +2 -0
- package/dist/chunks/BlockquotePlugin-DmbnFmNj.mjs.map +1 -0
- package/dist/chunks/CaretNavigationPlugin-4EaHvYXR.mjs +2 -0
- package/dist/chunks/CaretNavigationPlugin-4EaHvYXR.mjs.map +1 -0
- package/dist/chunks/CodeBlockPlugin-BP3XaOGj.mjs +2 -0
- package/dist/chunks/CodeBlockPlugin-BP3XaOGj.mjs.map +1 -0
- package/dist/chunks/ColorGrid-taTKtdsm.mjs +2 -0
- package/dist/chunks/ColorGrid-taTKtdsm.mjs.map +1 -0
- package/dist/chunks/ColorPickerPopup-JJQ-gMBN.mjs +2 -0
- package/dist/chunks/ColorPickerPopup-JJQ-gMBN.mjs.map +1 -0
- package/dist/chunks/ColorValidation-3viVw_tK.mjs +2 -0
- package/dist/chunks/ColorValidation-3viVw_tK.mjs.map +1 -0
- package/dist/chunks/CommandHelpers-D0LIFM4O.mjs +2 -0
- package/dist/chunks/CommandHelpers-D0LIFM4O.mjs.map +1 -0
- package/dist/chunks/Commands-DJSVqp7b.mjs +2 -0
- package/dist/chunks/Commands-DJSVqp7b.mjs.map +1 -0
- package/dist/chunks/Decoration-6dhb8k3b.mjs +2 -0
- package/dist/chunks/Decoration-6dhb8k3b.mjs.map +1 -0
- package/dist/chunks/Document-CkQLx84k.mjs +2 -0
- package/dist/chunks/Document-CkQLx84k.mjs.map +1 -0
- package/dist/chunks/DocumentParser-QJUmtPp9.mjs +2 -0
- package/dist/chunks/DocumentParser-QJUmtPp9.mjs.map +1 -0
- package/dist/chunks/DocumentSerializer-bwcxM9WV.mjs +2 -0
- package/dist/chunks/DocumentSerializer-bwcxM9WV.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-Cz4qEYGh.mjs +2 -0
- package/dist/chunks/FontPlugin-Cz4qEYGh.mjs.map +1 -0
- package/dist/chunks/FontSizePlugin-D1WtDqrH.mjs +2 -0
- package/dist/chunks/FontSizePlugin-D1WtDqrH.mjs.map +1 -0
- package/dist/chunks/GapCursorNavigation-CKKq42kA.mjs +2 -0
- package/dist/chunks/GapCursorNavigation-CKKq42kA.mjs.map +1 -0
- package/dist/chunks/GapCursorPlugin-0CyOaciK.mjs +2 -0
- package/dist/chunks/GapCursorPlugin-0CyOaciK.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-BOz-L53p.mjs +2 -0
- package/dist/chunks/HardBreakPlugin-BOz-L53p.mjs.map +1 -0
- package/dist/chunks/HeadingPlugin-C1F-5Ail.mjs +2 -0
- package/dist/chunks/HeadingPlugin-C1F-5Ail.mjs.map +1 -0
- package/dist/chunks/HighlightPlugin-LYARYuDC.mjs +2 -0
- package/dist/chunks/HighlightPlugin-LYARYuDC.mjs.map +1 -0
- package/dist/chunks/HorizontalRulePlugin-fmdbzWDQ.mjs +2 -0
- package/dist/chunks/HorizontalRulePlugin-fmdbzWDQ.mjs.map +1 -0
- package/dist/chunks/ImagePlugin-CrfnT1sD.mjs +2 -0
- package/dist/chunks/ImagePlugin-CrfnT1sD.mjs.map +1 -0
- package/dist/chunks/KeyboardNav-BZIHDPDV.mjs +2 -0
- package/dist/chunks/KeyboardNav-BZIHDPDV.mjs.map +1 -0
- package/dist/chunks/LinkPlugin-DzFJLnfQ.mjs +2 -0
- package/dist/chunks/LinkPlugin-DzFJLnfQ.mjs.map +1 -0
- package/dist/chunks/ListPlugin-C_Rcz3bV.mjs +2 -0
- package/dist/chunks/ListPlugin-C_Rcz3bV.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-CCA8UVRr.mjs +2 -0
- package/dist/chunks/NodeResolver-CCA8UVRr.mjs.map +1 -0
- package/dist/chunks/NodeSelectionCommands-CE_73CxF.mjs +2 -0
- package/dist/chunks/NodeSelectionCommands-CE_73CxF.mjs.map +1 -0
- package/dist/chunks/Platform-D9TRT4Mn.mjs +2 -0
- package/dist/chunks/Platform-D9TRT4Mn.mjs.map +1 -0
- package/dist/chunks/PluginHelpers-DLKHJWJn.mjs +2 -0
- package/dist/chunks/PluginHelpers-DLKHJWJn.mjs.map +1 -0
- package/dist/chunks/PopupManager-RWOaksC0.mjs +2 -0
- package/dist/chunks/PopupManager-RWOaksC0.mjs.map +1 -0
- package/dist/chunks/PopupPositioning-a1ADYSmx.mjs +2 -0
- package/dist/chunks/PopupPositioning-a1ADYSmx.mjs.map +1 -0
- package/dist/chunks/PrintPlugin-CwbEz3eP.mjs +2 -0
- package/dist/chunks/PrintPlugin-CwbEz3eP.mjs.map +1 -0
- package/dist/chunks/PrintTypes-B2DXeAEG.mjs +2 -0
- package/dist/chunks/PrintTypes-B2DXeAEG.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-DQPMvupx.mjs +2 -0
- package/dist/chunks/ShortcutFormatting-DQPMvupx.mjs.map +1 -0
- package/dist/chunks/SmartPastePlugin-CXqJ0CPO.mjs +2 -0
- package/dist/chunks/SmartPastePlugin-CXqJ0CPO.mjs.map +1 -0
- package/dist/chunks/StrikethroughPlugin-CRl69jm3.mjs +2 -0
- package/dist/chunks/StrikethroughPlugin-CRl69jm3.mjs.map +1 -0
- package/dist/chunks/StyleRuntime-0yPPJK9H.mjs +2 -0
- package/dist/chunks/StyleRuntime-0yPPJK9H.mjs.map +1 -0
- package/dist/chunks/SuperSubPlugin-CAnaTJVm.mjs +2 -0
- package/dist/chunks/SuperSubPlugin-CAnaTJVm.mjs.map +1 -0
- package/dist/chunks/TablePlugin-D_7bgrqm.mjs +2 -0
- package/dist/chunks/TablePlugin-D_7bgrqm.mjs.map +1 -0
- package/dist/chunks/TextColorPlugin-Dfhvl1qG.mjs +2 -0
- package/dist/chunks/TextColorPlugin-Dfhvl1qG.mjs.map +1 -0
- package/dist/chunks/TextDirectionCorePlugin-CyKw-C8X.mjs +2 -0
- package/dist/chunks/TextDirectionCorePlugin-CyKw-C8X.mjs.map +1 -0
- package/dist/chunks/TextDirectionLocale-rlU1yNly.mjs +2 -0
- package/dist/chunks/TextDirectionLocale-rlU1yNly.mjs.map +1 -0
- package/dist/chunks/TextFormattingPlugin-xtQczzCs.mjs +2 -0
- package/dist/chunks/TextFormattingPlugin-xtQczzCs.mjs.map +1 -0
- package/dist/chunks/ToolbarPlugin-BFEniyH-.mjs +2 -0
- package/dist/chunks/ToolbarPlugin-BFEniyH-.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-iZXLMFyk.mjs +2 -0
- package/dist/chunks/WordBoundary-iZXLMFyk.mjs.map +1 -0
- package/dist/chunks/XmlPatterns-Ub8I1jdE.mjs +2 -0
- package/dist/chunks/XmlPatterns-Ub8I1jdE.mjs.map +1 -0
- package/dist/chunks/ar-3-z4mZhh.mjs +2 -0
- package/dist/chunks/ar-3-z4mZhh.mjs.map +1 -0
- package/dist/chunks/ar-B-l6wR4D.mjs +2 -0
- package/dist/chunks/ar-B-l6wR4D.mjs.map +1 -0
- package/dist/chunks/ar-B3NByR5H.mjs +2 -0
- package/dist/chunks/ar-B3NByR5H.mjs.map +1 -0
- package/dist/chunks/ar-BRvm4F78.mjs +2 -0
- package/dist/chunks/ar-BRvm4F78.mjs.map +1 -0
- package/dist/chunks/ar-BUMXujtS.mjs +2 -0
- package/dist/chunks/ar-BUMXujtS.mjs.map +1 -0
- package/dist/chunks/ar-BhVHv8Lx.mjs +2 -0
- package/dist/chunks/ar-BhVHv8Lx.mjs.map +1 -0
- package/dist/chunks/ar-BhwRD9Cg.mjs +2 -0
- package/dist/chunks/ar-BhwRD9Cg.mjs.map +1 -0
- package/dist/chunks/ar-Bm8ORJ3H.mjs +2 -0
- package/dist/chunks/ar-Bm8ORJ3H.mjs.map +1 -0
- package/dist/chunks/ar-BpxuRQB2.mjs +2 -0
- package/dist/chunks/ar-BpxuRQB2.mjs.map +1 -0
- package/dist/chunks/ar-CA0-ysCj.mjs +2 -0
- package/dist/chunks/ar-CA0-ysCj.mjs.map +1 -0
- package/dist/chunks/ar-CAkFpIju.mjs +2 -0
- package/dist/chunks/ar-CAkFpIju.mjs.map +1 -0
- package/dist/chunks/ar-CU6qxyFp.mjs +2 -0
- package/dist/chunks/ar-CU6qxyFp.mjs.map +1 -0
- package/dist/chunks/ar-CXcTrZVc.mjs +2 -0
- package/dist/chunks/ar-CXcTrZVc.mjs.map +1 -0
- package/dist/chunks/ar-CeO_osWz.mjs +2 -0
- package/dist/chunks/ar-CeO_osWz.mjs.map +1 -0
- package/dist/chunks/ar-CxRSPJDE.mjs +2 -0
- package/dist/chunks/ar-CxRSPJDE.mjs.map +1 -0
- package/dist/chunks/ar-DHes6Igy.mjs +2 -0
- package/dist/chunks/ar-DHes6Igy.mjs.map +1 -0
- package/dist/chunks/ar-DN1aHdqb.mjs +2 -0
- package/dist/chunks/ar-DN1aHdqb.mjs.map +1 -0
- package/dist/chunks/ar-DNzmHN3q.mjs +2 -0
- package/dist/chunks/ar-DNzmHN3q.mjs.map +1 -0
- package/dist/chunks/ar-DVdWier2.mjs +2 -0
- package/dist/chunks/ar-DVdWier2.mjs.map +1 -0
- package/dist/chunks/ar-G_ADWoCx.mjs +2 -0
- package/dist/chunks/ar-G_ADWoCx.mjs.map +1 -0
- package/dist/chunks/ar-KAaQxKMo.mjs +2 -0
- package/dist/chunks/ar-KAaQxKMo.mjs.map +1 -0
- package/dist/chunks/ar-MHdV5PAO.mjs +2 -0
- package/dist/chunks/ar-MHdV5PAO.mjs.map +1 -0
- package/dist/chunks/ar-S2VfgLMv.mjs +2 -0
- package/dist/chunks/ar-S2VfgLMv.mjs.map +1 -0
- package/dist/chunks/color-picker-DumtHdqh.mjs +2 -0
- package/dist/chunks/color-picker-DumtHdqh.mjs.map +1 -0
- package/dist/chunks/de-0x8V-vch.mjs +2 -0
- package/dist/chunks/de-0x8V-vch.mjs.map +1 -0
- package/dist/chunks/de-B5xIP9en.mjs +2 -0
- package/dist/chunks/de-B5xIP9en.mjs.map +1 -0
- package/dist/chunks/de-BBohFIqw.mjs +2 -0
- package/dist/chunks/de-BBohFIqw.mjs.map +1 -0
- package/dist/chunks/de-BWPmC-2S.mjs +2 -0
- package/dist/chunks/de-BWPmC-2S.mjs.map +1 -0
- package/dist/chunks/de-Bo1kM9rb.mjs +2 -0
- package/dist/chunks/de-Bo1kM9rb.mjs.map +1 -0
- package/dist/chunks/de-BqzR2XMP.mjs +2 -0
- package/dist/chunks/de-BqzR2XMP.mjs.map +1 -0
- package/dist/chunks/de-CIZibvOC.mjs +2 -0
- package/dist/chunks/de-CIZibvOC.mjs.map +1 -0
- package/dist/chunks/de-CLToQn0o.mjs +2 -0
- package/dist/chunks/de-CLToQn0o.mjs.map +1 -0
- package/dist/chunks/de-CNoAAJul.mjs +2 -0
- package/dist/chunks/de-CNoAAJul.mjs.map +1 -0
- package/dist/chunks/de-CPb7rgkk.mjs +2 -0
- package/dist/chunks/de-CPb7rgkk.mjs.map +1 -0
- package/dist/chunks/de-CdmBKVDW.mjs +2 -0
- package/dist/chunks/de-CdmBKVDW.mjs.map +1 -0
- package/dist/chunks/de-DDgeyWgp.mjs +2 -0
- package/dist/chunks/de-DDgeyWgp.mjs.map +1 -0
- package/dist/chunks/de-DGXQ4OiR.mjs +2 -0
- package/dist/chunks/de-DGXQ4OiR.mjs.map +1 -0
- package/dist/chunks/de-DJbvKl4E.mjs +2 -0
- package/dist/chunks/de-DJbvKl4E.mjs.map +1 -0
- package/dist/chunks/de-DKNvYM_G.mjs +2 -0
- package/dist/chunks/de-DKNvYM_G.mjs.map +1 -0
- package/dist/chunks/de-DOHm_P4A.mjs +2 -0
- package/dist/chunks/de-DOHm_P4A.mjs.map +1 -0
- package/dist/chunks/de-DTMX75rn.mjs +2 -0
- package/dist/chunks/de-DTMX75rn.mjs.map +1 -0
- package/dist/chunks/de-DfkQds5F.mjs +2 -0
- package/dist/chunks/de-DfkQds5F.mjs.map +1 -0
- package/dist/chunks/de-TEQW-F4t.mjs +2 -0
- package/dist/chunks/de-TEQW-F4t.mjs.map +1 -0
- package/dist/chunks/de-WzdZ_NJ6.mjs +2 -0
- package/dist/chunks/de-WzdZ_NJ6.mjs.map +1 -0
- package/dist/chunks/de-_vqVfXeo.mjs +2 -0
- package/dist/chunks/de-_vqVfXeo.mjs.map +1 -0
- package/dist/chunks/de-gR6jt-sS.mjs +2 -0
- package/dist/chunks/de-gR6jt-sS.mjs.map +1 -0
- package/dist/chunks/de-qOBFRCGL.mjs +2 -0
- package/dist/chunks/de-qOBFRCGL.mjs.map +1 -0
- package/dist/chunks/es-1udUsTJd.mjs +2 -0
- package/dist/chunks/es-1udUsTJd.mjs.map +1 -0
- package/dist/chunks/es-3H7h0_G5.mjs +2 -0
- package/dist/chunks/es-3H7h0_G5.mjs.map +1 -0
- package/dist/chunks/es-4-5iRK0M.mjs +2 -0
- package/dist/chunks/es-4-5iRK0M.mjs.map +1 -0
- package/dist/chunks/es-89LD3TlT.mjs +2 -0
- package/dist/chunks/es-89LD3TlT.mjs.map +1 -0
- package/dist/chunks/es-B2KFVoHa.mjs +2 -0
- package/dist/chunks/es-B2KFVoHa.mjs.map +1 -0
- package/dist/chunks/es-BUP1scLX.mjs +2 -0
- package/dist/chunks/es-BUP1scLX.mjs.map +1 -0
- package/dist/chunks/es-Bhhj-yh0.mjs +2 -0
- package/dist/chunks/es-Bhhj-yh0.mjs.map +1 -0
- package/dist/chunks/es-Bo0NTtQH.mjs +2 -0
- package/dist/chunks/es-Bo0NTtQH.mjs.map +1 -0
- package/dist/chunks/es-Bovw7l2W.mjs +2 -0
- package/dist/chunks/es-Bovw7l2W.mjs.map +1 -0
- package/dist/chunks/es-C7xAs1yn.mjs +2 -0
- package/dist/chunks/es-C7xAs1yn.mjs.map +1 -0
- package/dist/chunks/es-CIdF7MzV.mjs +2 -0
- package/dist/chunks/es-CIdF7MzV.mjs.map +1 -0
- package/dist/chunks/es-CPit7Z6w.mjs +2 -0
- package/dist/chunks/es-CPit7Z6w.mjs.map +1 -0
- package/dist/chunks/es-CQzgvQI6.mjs +2 -0
- package/dist/chunks/es-CQzgvQI6.mjs.map +1 -0
- package/dist/chunks/es-CSteuqi5.mjs +2 -0
- package/dist/chunks/es-CSteuqi5.mjs.map +1 -0
- package/dist/chunks/es-ClJxqhu_.mjs +2 -0
- package/dist/chunks/es-ClJxqhu_.mjs.map +1 -0
- package/dist/chunks/es-CrmqYoVh.mjs +2 -0
- package/dist/chunks/es-CrmqYoVh.mjs.map +1 -0
- package/dist/chunks/es-CwRwLkfr.mjs +2 -0
- package/dist/chunks/es-CwRwLkfr.mjs.map +1 -0
- package/dist/chunks/es-D7DRGnkZ.mjs +2 -0
- package/dist/chunks/es-D7DRGnkZ.mjs.map +1 -0
- package/dist/chunks/es-DET1uMu-.mjs +2 -0
- package/dist/chunks/es-DET1uMu-.mjs.map +1 -0
- package/dist/chunks/es-Dj83hJxy.mjs +2 -0
- package/dist/chunks/es-Dj83hJxy.mjs.map +1 -0
- package/dist/chunks/es-DwYWucI6.mjs +2 -0
- package/dist/chunks/es-DwYWucI6.mjs.map +1 -0
- package/dist/chunks/es-DwrcpThR.mjs +2 -0
- package/dist/chunks/es-DwrcpThR.mjs.map +1 -0
- package/dist/chunks/es-z7xjgDdk.mjs +2 -0
- package/dist/chunks/es-z7xjgDdk.mjs.map +1 -0
- package/dist/chunks/fonts-CG5ZnGux.mjs +2 -0
- package/dist/chunks/fonts-CG5ZnGux.mjs.map +1 -0
- package/dist/chunks/fr-B73tOEzO.mjs +2 -0
- package/dist/chunks/fr-B73tOEzO.mjs.map +1 -0
- package/dist/chunks/fr-BEbsFEkX.mjs +2 -0
- package/dist/chunks/fr-BEbsFEkX.mjs.map +1 -0
- package/dist/chunks/fr-BFCaEBSV.mjs +2 -0
- package/dist/chunks/fr-BFCaEBSV.mjs.map +1 -0
- package/dist/chunks/fr-BJ69XrDO.mjs +2 -0
- package/dist/chunks/fr-BJ69XrDO.mjs.map +1 -0
- package/dist/chunks/fr-BdQ_-Iwg.mjs +2 -0
- package/dist/chunks/fr-BdQ_-Iwg.mjs.map +1 -0
- package/dist/chunks/fr-BhnuBA0i.mjs +2 -0
- package/dist/chunks/fr-BhnuBA0i.mjs.map +1 -0
- package/dist/chunks/fr-BiLmpXZ9.mjs +2 -0
- package/dist/chunks/fr-BiLmpXZ9.mjs.map +1 -0
- package/dist/chunks/fr-C1Pak7kS.mjs +2 -0
- package/dist/chunks/fr-C1Pak7kS.mjs.map +1 -0
- package/dist/chunks/fr-CFDoFELm.mjs +2 -0
- package/dist/chunks/fr-CFDoFELm.mjs.map +1 -0
- package/dist/chunks/fr-CmsH8BnY.mjs +2 -0
- package/dist/chunks/fr-CmsH8BnY.mjs.map +1 -0
- package/dist/chunks/fr-Cz2qWiuV.mjs +2 -0
- package/dist/chunks/fr-Cz2qWiuV.mjs.map +1 -0
- package/dist/chunks/fr-CzTPuD1P.mjs +2 -0
- package/dist/chunks/fr-CzTPuD1P.mjs.map +1 -0
- package/dist/chunks/fr-D1LQMsjB.mjs +2 -0
- package/dist/chunks/fr-D1LQMsjB.mjs.map +1 -0
- package/dist/chunks/fr-D84mXQrZ.mjs +2 -0
- package/dist/chunks/fr-D84mXQrZ.mjs.map +1 -0
- package/dist/chunks/fr-DX7z_ld0.mjs +2 -0
- package/dist/chunks/fr-DX7z_ld0.mjs.map +1 -0
- package/dist/chunks/fr-DXkQUerf.mjs +2 -0
- package/dist/chunks/fr-DXkQUerf.mjs.map +1 -0
- package/dist/chunks/fr-Di5gv5P8.mjs +2 -0
- package/dist/chunks/fr-Di5gv5P8.mjs.map +1 -0
- package/dist/chunks/fr-Dq5MrVWd.mjs +2 -0
- package/dist/chunks/fr-Dq5MrVWd.mjs.map +1 -0
- package/dist/chunks/fr-DtfEjLSL.mjs +2 -0
- package/dist/chunks/fr-DtfEjLSL.mjs.map +1 -0
- package/dist/chunks/fr-DvW-dpp3.mjs +2 -0
- package/dist/chunks/fr-DvW-dpp3.mjs.map +1 -0
- package/dist/chunks/fr-UJFNrn-V.mjs +2 -0
- package/dist/chunks/fr-UJFNrn-V.mjs.map +1 -0
- package/dist/chunks/fr-hK8X-sM6.mjs +2 -0
- package/dist/chunks/fr-hK8X-sM6.mjs.map +1 -0
- package/dist/chunks/fr-uuOSXj4L.mjs +2 -0
- package/dist/chunks/fr-uuOSXj4L.mjs.map +1 -0
- package/dist/chunks/full-216JgIG1.mjs +2 -0
- package/dist/chunks/full-216JgIG1.mjs.map +1 -0
- package/dist/chunks/hi-B2kXjElO.mjs +2 -0
- package/dist/chunks/hi-B2kXjElO.mjs.map +1 -0
- package/dist/chunks/hi-B2mEQ5gX.mjs +2 -0
- package/dist/chunks/hi-B2mEQ5gX.mjs.map +1 -0
- package/dist/chunks/hi-B61lTO2W.mjs +2 -0
- package/dist/chunks/hi-B61lTO2W.mjs.map +1 -0
- package/dist/chunks/hi-BD5HrbxU.mjs +2 -0
- package/dist/chunks/hi-BD5HrbxU.mjs.map +1 -0
- package/dist/chunks/hi-BHTvSWXw.mjs +2 -0
- package/dist/chunks/hi-BHTvSWXw.mjs.map +1 -0
- package/dist/chunks/hi-BYyaOBqY.mjs +2 -0
- package/dist/chunks/hi-BYyaOBqY.mjs.map +1 -0
- package/dist/chunks/hi-Bhlbz5gX.mjs +2 -0
- package/dist/chunks/hi-Bhlbz5gX.mjs.map +1 -0
- package/dist/chunks/hi-BniuSk3L.mjs +2 -0
- package/dist/chunks/hi-BniuSk3L.mjs.map +1 -0
- package/dist/chunks/hi-CBODdhOq.mjs +2 -0
- package/dist/chunks/hi-CBODdhOq.mjs.map +1 -0
- package/dist/chunks/hi-CKWQCooT.mjs +2 -0
- package/dist/chunks/hi-CKWQCooT.mjs.map +1 -0
- package/dist/chunks/hi-CkoruGVs.mjs +2 -0
- package/dist/chunks/hi-CkoruGVs.mjs.map +1 -0
- package/dist/chunks/hi-D6Ge3Lp5.mjs +2 -0
- package/dist/chunks/hi-D6Ge3Lp5.mjs.map +1 -0
- package/dist/chunks/hi-DEreeBFj.mjs +2 -0
- package/dist/chunks/hi-DEreeBFj.mjs.map +1 -0
- package/dist/chunks/hi-Dj4JW-9k.mjs +2 -0
- package/dist/chunks/hi-Dj4JW-9k.mjs.map +1 -0
- package/dist/chunks/hi-DkP4pHSX.mjs +2 -0
- package/dist/chunks/hi-DkP4pHSX.mjs.map +1 -0
- package/dist/chunks/hi-DknCX8Nx.mjs +2 -0
- package/dist/chunks/hi-DknCX8Nx.mjs.map +1 -0
- package/dist/chunks/hi-Dm1KJQQ5.mjs +2 -0
- package/dist/chunks/hi-Dm1KJQQ5.mjs.map +1 -0
- package/dist/chunks/hi-Dx-LTWg-.mjs +2 -0
- package/dist/chunks/hi-Dx-LTWg-.mjs.map +1 -0
- package/dist/chunks/hi-RDoZtwMm.mjs +2 -0
- package/dist/chunks/hi-RDoZtwMm.mjs.map +1 -0
- package/dist/chunks/hi-Tq9eDRk7.mjs +2 -0
- package/dist/chunks/hi-Tq9eDRk7.mjs.map +1 -0
- package/dist/chunks/hi-_vJ_Eo4p.mjs +2 -0
- package/dist/chunks/hi-_vJ_Eo4p.mjs.map +1 -0
- package/dist/chunks/hi-l8E-czFm.mjs +2 -0
- package/dist/chunks/hi-l8E-czFm.mjs.map +1 -0
- package/dist/chunks/hi-ydmPh3HB.mjs +2 -0
- package/dist/chunks/hi-ydmPh3HB.mjs.map +1 -0
- package/dist/chunks/minimal-D-QxXO1C.mjs +2 -0
- package/dist/chunks/minimal-D-QxXO1C.mjs.map +1 -0
- package/dist/chunks/pt-B4NUSLW8.mjs +2 -0
- package/dist/chunks/pt-B4NUSLW8.mjs.map +1 -0
- package/dist/chunks/pt-B8VKEboV.mjs +2 -0
- package/dist/chunks/pt-B8VKEboV.mjs.map +1 -0
- package/dist/chunks/pt-BMDKykEi.mjs +2 -0
- package/dist/chunks/pt-BMDKykEi.mjs.map +1 -0
- package/dist/chunks/pt-BmWE3xXF.mjs +2 -0
- package/dist/chunks/pt-BmWE3xXF.mjs.map +1 -0
- package/dist/chunks/pt-CJWKE1SW.mjs +2 -0
- package/dist/chunks/pt-CJWKE1SW.mjs.map +1 -0
- package/dist/chunks/pt-CKETXoPa.mjs +2 -0
- package/dist/chunks/pt-CKETXoPa.mjs.map +1 -0
- package/dist/chunks/pt-CKRs16QH.mjs +2 -0
- package/dist/chunks/pt-CKRs16QH.mjs.map +1 -0
- package/dist/chunks/pt-Cb-1GHq4.mjs +2 -0
- package/dist/chunks/pt-Cb-1GHq4.mjs.map +1 -0
- package/dist/chunks/pt-CgpU74p4.mjs +2 -0
- package/dist/chunks/pt-CgpU74p4.mjs.map +1 -0
- package/dist/chunks/pt-CtOdAphq.mjs +2 -0
- package/dist/chunks/pt-CtOdAphq.mjs.map +1 -0
- package/dist/chunks/pt-CzaPFMSx.mjs +2 -0
- package/dist/chunks/pt-CzaPFMSx.mjs.map +1 -0
- package/dist/chunks/pt-DGuLcW0m.mjs +2 -0
- package/dist/chunks/pt-DGuLcW0m.mjs.map +1 -0
- package/dist/chunks/pt-DHzSXzlf.mjs +2 -0
- package/dist/chunks/pt-DHzSXzlf.mjs.map +1 -0
- package/dist/chunks/pt-DWDdBfLk.mjs +2 -0
- package/dist/chunks/pt-DWDdBfLk.mjs.map +1 -0
- package/dist/chunks/pt-DZ6Liq_x.mjs +2 -0
- package/dist/chunks/pt-DZ6Liq_x.mjs.map +1 -0
- package/dist/chunks/pt-D_MD7MJu.mjs +2 -0
- package/dist/chunks/pt-D_MD7MJu.mjs.map +1 -0
- package/dist/chunks/pt-DgaY_yNG.mjs +2 -0
- package/dist/chunks/pt-DgaY_yNG.mjs.map +1 -0
- package/dist/chunks/pt-DgzgCxdH.mjs +2 -0
- package/dist/chunks/pt-DgzgCxdH.mjs.map +1 -0
- package/dist/chunks/pt-Dh7nUcAM.mjs +2 -0
- package/dist/chunks/pt-Dh7nUcAM.mjs.map +1 -0
- package/dist/chunks/pt-P914L5AX.mjs +2 -0
- package/dist/chunks/pt-P914L5AX.mjs.map +1 -0
- package/dist/chunks/pt-XT1vsWZj.mjs +2 -0
- package/dist/chunks/pt-XT1vsWZj.mjs.map +1 -0
- package/dist/chunks/pt-jJ0XXSVz.mjs +2 -0
- package/dist/chunks/pt-jJ0XXSVz.mjs.map +1 -0
- package/dist/chunks/pt-tuOLwYkM.mjs +2 -0
- package/dist/chunks/pt-tuOLwYkM.mjs.map +1 -0
- package/dist/chunks/rolldown-runtime-B8Ku5yk6.mjs +1 -0
- package/dist/chunks/ru-7m8CMM17.mjs +2 -0
- package/dist/chunks/ru-7m8CMM17.mjs.map +1 -0
- package/dist/chunks/ru-9Qh1fR-K.mjs +2 -0
- package/dist/chunks/ru-9Qh1fR-K.mjs.map +1 -0
- package/dist/chunks/ru-B5gK8OLp.mjs +2 -0
- package/dist/chunks/ru-B5gK8OLp.mjs.map +1 -0
- package/dist/chunks/ru-BRNN6ldH.mjs +2 -0
- package/dist/chunks/ru-BRNN6ldH.mjs.map +1 -0
- package/dist/chunks/ru-BiyE9o-D.mjs +2 -0
- package/dist/chunks/ru-BiyE9o-D.mjs.map +1 -0
- package/dist/chunks/ru-BpGTIPbv.mjs +2 -0
- package/dist/chunks/ru-BpGTIPbv.mjs.map +1 -0
- package/dist/chunks/ru-CAzMaI4y.mjs +2 -0
- package/dist/chunks/ru-CAzMaI4y.mjs.map +1 -0
- package/dist/chunks/ru-COo6HpcD.mjs +2 -0
- package/dist/chunks/ru-COo6HpcD.mjs.map +1 -0
- package/dist/chunks/ru-CgEOZsUs.mjs +2 -0
- package/dist/chunks/ru-CgEOZsUs.mjs.map +1 -0
- package/dist/chunks/ru-CptzezhV.mjs +2 -0
- package/dist/chunks/ru-CptzezhV.mjs.map +1 -0
- package/dist/chunks/ru-Ct0qNMLS.mjs +2 -0
- package/dist/chunks/ru-Ct0qNMLS.mjs.map +1 -0
- package/dist/chunks/ru-Ct2IrzbA.mjs +2 -0
- package/dist/chunks/ru-Ct2IrzbA.mjs.map +1 -0
- package/dist/chunks/ru-CyHnlWLN.mjs +2 -0
- package/dist/chunks/ru-CyHnlWLN.mjs.map +1 -0
- package/dist/chunks/ru-DF0vhzeC.mjs +2 -0
- package/dist/chunks/ru-DF0vhzeC.mjs.map +1 -0
- package/dist/chunks/ru-DH6rsOWL.mjs +2 -0
- package/dist/chunks/ru-DH6rsOWL.mjs.map +1 -0
- package/dist/chunks/ru-DHH8k6G8.mjs +2 -0
- package/dist/chunks/ru-DHH8k6G8.mjs.map +1 -0
- package/dist/chunks/ru-GVReqjM4.mjs +2 -0
- package/dist/chunks/ru-GVReqjM4.mjs.map +1 -0
- package/dist/chunks/ru-IzloX5CY.mjs +2 -0
- package/dist/chunks/ru-IzloX5CY.mjs.map +1 -0
- package/dist/chunks/ru-ZrzXB0f6.mjs +2 -0
- package/dist/chunks/ru-ZrzXB0f6.mjs.map +1 -0
- package/dist/chunks/ru-asRKygvE.mjs +2 -0
- package/dist/chunks/ru-asRKygvE.mjs.map +1 -0
- package/dist/chunks/ru-m19l8nRA.mjs +2 -0
- package/dist/chunks/ru-m19l8nRA.mjs.map +1 -0
- package/dist/chunks/ru-vfQ5Xaz4.mjs +2 -0
- package/dist/chunks/ru-vfQ5Xaz4.mjs.map +1 -0
- package/dist/chunks/ru-wVOlNily.mjs +2 -0
- package/dist/chunks/ru-wVOlNily.mjs.map +1 -0
- package/dist/chunks/shared-DxmfXZH7.mjs +2 -0
- package/dist/chunks/shared-DxmfXZH7.mjs.map +1 -0
- package/dist/chunks/src-DFXIsulM.mjs +2 -0
- package/dist/chunks/src-DFXIsulM.mjs.map +1 -0
- package/dist/chunks/text-direction-advanced-B5JuIs0P.mjs +2 -0
- package/dist/chunks/text-direction-advanced-B5JuIs0P.mjs.map +1 -0
- package/dist/chunks/zh-0uhsRxfq.mjs +2 -0
- package/dist/chunks/zh-0uhsRxfq.mjs.map +1 -0
- package/dist/chunks/zh-1BrLr5Wk.mjs +2 -0
- package/dist/chunks/zh-1BrLr5Wk.mjs.map +1 -0
- package/dist/chunks/zh-BNHeXa_M.mjs +2 -0
- package/dist/chunks/zh-BNHeXa_M.mjs.map +1 -0
- package/dist/chunks/zh-BOpBzSX3.mjs +2 -0
- package/dist/chunks/zh-BOpBzSX3.mjs.map +1 -0
- package/dist/chunks/zh-BV2uDDGf.mjs +2 -0
- package/dist/chunks/zh-BV2uDDGf.mjs.map +1 -0
- package/dist/chunks/zh-BkoPteNb.mjs +2 -0
- package/dist/chunks/zh-BkoPteNb.mjs.map +1 -0
- package/dist/chunks/zh-C2z0g7OC.mjs +2 -0
- package/dist/chunks/zh-C2z0g7OC.mjs.map +1 -0
- package/dist/chunks/zh-CeJw45yo.mjs +2 -0
- package/dist/chunks/zh-CeJw45yo.mjs.map +1 -0
- package/dist/chunks/zh-CwVkxL4q.mjs +2 -0
- package/dist/chunks/zh-CwVkxL4q.mjs.map +1 -0
- package/dist/chunks/zh-Cy7mujpx.mjs +2 -0
- package/dist/chunks/zh-Cy7mujpx.mjs.map +1 -0
- package/dist/chunks/zh-D-P00ENX.mjs +2 -0
- package/dist/chunks/zh-D-P00ENX.mjs.map +1 -0
- package/dist/chunks/zh-D5d-NAuv.mjs +2 -0
- package/dist/chunks/zh-D5d-NAuv.mjs.map +1 -0
- package/dist/chunks/zh-D6gTQA2W.mjs +2 -0
- package/dist/chunks/zh-D6gTQA2W.mjs.map +1 -0
- package/dist/chunks/zh-DLwq4e4-.mjs +2 -0
- package/dist/chunks/zh-DLwq4e4-.mjs.map +1 -0
- package/dist/chunks/zh-D_Yb8Eg6.mjs +2 -0
- package/dist/chunks/zh-D_Yb8Eg6.mjs.map +1 -0
- package/dist/chunks/zh-DaNHqNDY.mjs +2 -0
- package/dist/chunks/zh-DaNHqNDY.mjs.map +1 -0
- package/dist/chunks/zh-De7-Y4O5.mjs +2 -0
- package/dist/chunks/zh-De7-Y4O5.mjs.map +1 -0
- package/dist/chunks/zh-Dj7kHEcp.mjs +2 -0
- package/dist/chunks/zh-Dj7kHEcp.mjs.map +1 -0
- package/dist/chunks/zh-Dl0oVWiK.mjs +2 -0
- package/dist/chunks/zh-Dl0oVWiK.mjs.map +1 -0
- package/dist/chunks/zh-Do0plBjM.mjs +2 -0
- package/dist/chunks/zh-Do0plBjM.mjs.map +1 -0
- package/dist/chunks/zh-Q0aDk5UA.mjs +2 -0
- package/dist/chunks/zh-Q0aDk5UA.mjs.map +1 -0
- package/dist/chunks/zh-eSgs8mzc.mjs +2 -0
- package/dist/chunks/zh-eSgs8mzc.mjs.map +1 -0
- package/dist/chunks/zh-giWyGMSZ.mjs +2 -0
- package/dist/chunks/zh-giWyGMSZ.mjs.map +1 -0
- package/dist/fonts.mjs +1 -2
- package/dist/full.mjs +1 -2
- package/dist/html.mjs +1 -2
- 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.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/link.mjs +1 -2
- 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.mjs +1 -2
- 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.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.mjs +1 -2
- package/dist/presets/full.mjs +1 -2
- package/dist/presets/minimal.mjs +1 -2
- package/dist/presets.mjs +1 -2
- package/package.json +4 -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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HeadingPlugin-BmkeUXj8.mjs","sources":["../../src/plugins/heading/HeadingBlockTypePicker.ts","../../src/plugins/heading/HeadingCommands.ts","../../src/plugins/heading/HeadingKeyboardHandlers.ts","../../src/plugins/heading/HeadingLocale.ts","../../src/plugins/heading/HeadingPlugin.ts","../../src/editor/styles/heading-select.ts","../../src/plugins/heading/HeadingInputRules.ts"],"sourcesContent":["/**\n * Block type picker entries and toolbar dropdown for heading block types.\n * Registers picker entries for paragraph, title, subtitle, and all heading levels,\n * plus a combobox-style toolbar item with a custom popup.\n */\n\nimport { isTextSelection } from '../../model/Selection.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport { setStyleProperties } from '../../style/StyleRuntime.js';\nimport type { PluginContext } from '../Plugin.js';\nimport type { PopupCloseOptions } from '../shared/PopupManager.js';\nimport type { PickerEntryStyle } from './BlockTypePickerEntry.js';\nimport type { HeadingLocale } from './HeadingLocale.js';\nimport type { HeadingConfig } from './HeadingPlugin.js';\nimport type { HeadingLevel } from './HeadingPlugin.js';\n\n// --- Picker Entry Registration ---\n\n/** Registers block type picker entries for paragraph, title, subtitle, and heading levels. */\nexport function registerHeadingPickerEntries(\n\tcontext: PluginContext,\n\tconfig: HeadingConfig,\n\tlocale: HeadingLocale,\n): void {\n\tcontext.registerBlockTypePickerEntry({\n\t\tid: 'paragraph',\n\t\tlabel: locale.paragraph,\n\t\tcommand: 'setParagraph',\n\t\tpriority: 10,\n\t\tisActive: (state) => {\n\t\t\tif (!isTextSelection(state.selection)) return false;\n\t\t\tconst block = state.getBlock(state.selection.anchor.blockId);\n\t\t\treturn block?.type === 'paragraph';\n\t\t},\n\t});\n\n\tcontext.registerBlockTypePickerEntry({\n\t\tid: 'title',\n\t\tlabel: locale.title,\n\t\tcommand: 'setTitle',\n\t\tpriority: 20,\n\t\tstyle: { fontSize: '1.6em', fontWeight: '700' },\n\t\tisActive: (state) => {\n\t\t\tif (!isTextSelection(state.selection)) return false;\n\t\t\tconst block = state.getBlock(state.selection.anchor.blockId);\n\t\t\treturn block?.type === 'title';\n\t\t},\n\t});\n\n\tcontext.registerBlockTypePickerEntry({\n\t\tid: 'subtitle',\n\t\tlabel: locale.subtitle,\n\t\tcommand: 'setSubtitle',\n\t\tpriority: 30,\n\t\tstyle: { fontSize: '1.3em', fontWeight: '500' },\n\t\tisActive: (state) => {\n\t\t\tif (!isTextSelection(state.selection)) return false;\n\t\t\tconst block = state.getBlock(state.selection.anchor.blockId);\n\t\t\treturn block?.type === 'subtitle';\n\t\t},\n\t});\n\n\tfor (const level of config.levels) {\n\t\tcontext.registerBlockTypePickerEntry({\n\t\t\tid: `heading-${level}`,\n\t\t\tlabel: getHeadingLabel(locale, level),\n\t\t\tcommand: `setHeading${level}`,\n\t\t\tpriority: 100 + level,\n\t\t\tstyle: { fontSize: `${1.4 - level * 0.1}em`, fontWeight: '600' },\n\t\t\tisActive: (state) => {\n\t\t\t\tif (!isTextSelection(state.selection)) return false;\n\t\t\t\tconst block = state.getBlock(state.selection.anchor.blockId);\n\t\t\t\treturn block?.type === 'heading' && block.attrs?.level === level;\n\t\t\t},\n\t\t});\n\t}\n}\n\n// --- Toolbar Item ---\n\n/** Registers the heading toolbar dropdown with a combobox picker popup. */\nexport function registerHeadingToolbarItem(context: PluginContext, locale: HeadingLocale): void {\n\tcontext.registerToolbarItem({\n\t\tid: 'heading',\n\t\tgroup: 'block',\n\t\tlabel: locale.blockTypeLabel,\n\t\ttooltip: locale.blockTypeLabel,\n\t\tcommand: 'setParagraph',\n\t\tpopupType: 'combobox',\n\t\tgetLabel: (state: EditorState): string => getActiveLabel(state, context, locale),\n\t\trenderPopup: (container, ctx, onClose) => {\n\t\t\trenderHeadingPopup(container, ctx, locale, onClose);\n\t\t},\n\t\tisActive: (state) => {\n\t\t\tconst entries = context.getBlockTypePickerRegistry().getBlockTypePickerEntries();\n\t\t\treturn entries.some((entry) => entry.id !== 'paragraph' && entry.isActive(state));\n\t\t},\n\t});\n}\n\n// --- Popup Rendering ---\n\nfunction renderHeadingPopup(\n\tcontainer: HTMLElement,\n\tcontext: PluginContext,\n\tlocale: HeadingLocale,\n\tonClose: (options?: PopupCloseOptions) => void,\n): void {\n\tcontainer.classList.add('notectl-heading-picker');\n\n\tconst state: EditorState = context.getState();\n\tif (!isTextSelection(state.selection)) return;\n\n\tconst contentElement: HTMLElement = context.getContainer();\n\n\tconst list: HTMLDivElement = document.createElement('div');\n\tlist.className = 'notectl-heading-picker__list';\n\tlist.setAttribute('role', 'listbox');\n\tlist.setAttribute('aria-label', locale.blockTypesAria);\n\n\tconst entries = context.getBlockTypePickerRegistry().getBlockTypePickerEntries();\n\tfor (const entry of entries) {\n\t\tconst active: boolean = entry.isActive(state);\n\t\tlist.appendChild(\n\t\t\tcreatePickerItem(\n\t\t\t\tentry.label,\n\t\t\t\tactive,\n\t\t\t\t(e: MouseEvent) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\tcontext.executeCommand(entry.command);\n\t\t\t\t\tonClose({ restoreFocusTo: contentElement });\n\t\t\t\t},\n\t\t\t\tentry.style,\n\t\t\t),\n\t\t);\n\t}\n\n\tcontainer.appendChild(list);\n}\n\nfunction createPickerItem(\n\tlabel: string,\n\tisActive: boolean,\n\thandler: (e: MouseEvent) => void,\n\tstyle?: PickerEntryStyle,\n): HTMLButtonElement {\n\tconst item: HTMLButtonElement = document.createElement('button');\n\titem.type = 'button';\n\titem.className = 'notectl-heading-picker__item';\n\titem.setAttribute('role', 'option');\n\titem.setAttribute('aria-selected', String(isActive));\n\n\tif (isActive) {\n\t\titem.classList.add('notectl-heading-picker__item--active');\n\t}\n\n\tconst check: HTMLSpanElement = document.createElement('span');\n\tcheck.className = 'notectl-heading-picker__check';\n\tcheck.textContent = isActive ? '\\u2713' : '';\n\titem.appendChild(check);\n\n\tconst labelSpan: HTMLSpanElement = document.createElement('span');\n\tlabelSpan.className = 'notectl-heading-picker__label';\n\tlabelSpan.textContent = label;\n\tif (style) {\n\t\tsetStyleProperties(labelSpan, {\n\t\t\tfontSize: style.fontSize,\n\t\t\tfontWeight: style.fontWeight,\n\t\t});\n\t}\n\titem.appendChild(labelSpan);\n\n\titem.addEventListener('mousedown', handler);\n\treturn item;\n}\n\n// --- Helpers ---\n\nfunction getHeadingLabel(locale: HeadingLocale, level: HeadingLevel): string {\n\tconst key = `heading${level}` as keyof HeadingLocale;\n\treturn locale[key] as string;\n}\n\nfunction getActiveLabel(state: EditorState, context: PluginContext, locale: HeadingLocale): string {\n\tif (!isTextSelection(state.selection)) return locale.paragraph;\n\tconst entries = context.getBlockTypePickerRegistry().getBlockTypePickerEntries();\n\tfor (const entry of entries) {\n\t\tif (entry.isActive(state)) return entry.label;\n\t}\n\treturn locale.paragraph;\n}\n","/**\n * Command registration and implementations for heading block types.\n * Handles toggle between heading/title/subtitle and paragraph,\n * plus excluded-mark stripping when switching block types.\n */\n\nimport type { BlockNode, Mark } from '../../model/Document.js';\nimport { getBlockLength, getInlineChildren, isTextNode } from '../../model/Document.js';\nimport { isTextSelection } from '../../model/Selection.js';\nimport { type NodeTypeName, nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { TransactionBuilder } from '../../state/Transaction.js';\nimport type { PluginContext } from '../Plugin.js';\nimport type { HeadingConfig, HeadingLevel } from './HeadingPlugin.js';\n\n/** Registers all heading commands (setTitle, setSubtitle, setHeadingN, toggleHeading, setParagraph). */\nexport function registerHeadingCommands(context: PluginContext, config: HeadingConfig): void {\n\tcontext.registerCommand('setTitle', () => toggleSpecialBlock(context, 'title'));\n\n\tcontext.registerCommand('setSubtitle', () => toggleSpecialBlock(context, 'subtitle'));\n\n\tfor (const level of config.levels) {\n\t\tcontext.registerCommand(`setHeading${level}`, () => toggleHeading(context, level));\n\t}\n\n\tcontext.registerCommand('toggleHeading', () => toggleHeading(context, 1));\n\n\tcontext.registerCommand('setParagraph', () => setBlockType(context, nodeType('paragraph')));\n}\n\n// --- Command Implementations ---\n\n/**\n * Toggles between a special block type (title/subtitle) and paragraph.\n * If the block is already that type, resets to paragraph.\n */\nfunction toggleSpecialBlock(context: PluginContext, type: string): boolean {\n\tconst state: EditorState = context.getState();\n\tif (!isTextSelection(state.selection)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(state.selection.anchor.blockId);\n\tif (!block) return false;\n\n\tif (block.type === type) {\n\t\treturn setBlockType(context, nodeType('paragraph'));\n\t}\n\n\treturn setBlockType(context, nodeType(type) as NodeTypeName);\n}\n\n/**\n * Toggles between heading (at given level) and paragraph.\n * If the block is already a heading at the same level, resets to paragraph.\n */\nfunction toggleHeading(context: PluginContext, level: HeadingLevel): boolean {\n\tconst state: EditorState = context.getState();\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\tif (!block) return false;\n\n\tif (block.type === 'heading' && block.attrs?.level === level) {\n\t\treturn setBlockType(context, nodeType('paragraph'));\n\t}\n\n\treturn setBlockType(context, nodeType('heading'), { level });\n}\n\nfunction setBlockType(\n\tcontext: PluginContext,\n\ttype: NodeTypeName,\n\tattrs?: Record<string, string | number | boolean>,\n): boolean {\n\tconst state: EditorState = context.getState();\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\tif (!block) return false;\n\n\tconst builder: TransactionBuilder = state.transaction('command');\n\n\tconst spec = context.getSchemaRegistry().getNodeSpec(type);\n\tif (spec?.excludeMarks && spec.excludeMarks.length > 0) {\n\t\tstripExcludedMarks(builder, block, spec.excludeMarks);\n\t\tclearExcludedStoredMarks(builder, state, spec.excludeMarks);\n\t}\n\n\tconst tr = builder.setBlockType(sel.anchor.blockId, type, attrs).setSelection(sel).build();\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\n// --- Mark Stripping Helpers ---\n\n/**\n * Adds removeMark steps for each excluded mark type found\n * on the block's inline text content.\n */\nfunction stripExcludedMarks(\n\tbuilder: TransactionBuilder,\n\tblock: BlockNode,\n\texcludeMarks: readonly string[],\n): void {\n\tconst blockLength: number = getBlockLength(block);\n\tif (blockLength === 0) return;\n\n\tconst excludeSet: Set<string> = new Set(excludeMarks);\n\tconst inlineChildren = getInlineChildren(block);\n\tlet offset = 0;\n\n\tfor (const child of inlineChildren) {\n\t\tif (isTextNode(child)) {\n\t\t\tif (child.text.length > 0) {\n\t\t\t\tfor (const mark of child.marks) {\n\t\t\t\t\tif (excludeSet.has(mark.type)) {\n\t\t\t\t\t\tbuilder.removeMark(block.id, offset, offset + child.text.length, mark);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\toffset += child.text.length;\n\t\t} else {\n\t\t\toffset += 1;\n\t\t}\n\t}\n}\n\n/**\n * Clears excluded mark types from stored marks so that\n * subsequent typing does not reintroduce them.\n */\nfunction clearExcludedStoredMarks(\n\tbuilder: TransactionBuilder,\n\tstate: EditorState,\n\texcludeMarks: readonly string[],\n): void {\n\tif (!state.storedMarks) return;\n\n\tconst excludeSet: Set<string> = new Set(excludeMarks);\n\tconst filtered: readonly Mark[] = state.storedMarks.filter((m: Mark) => !excludeSet.has(m.type));\n\n\tif (filtered.length !== state.storedMarks.length) {\n\t\tbuilder.setStoredMarks(filtered.length > 0 ? filtered : null, state.storedMarks);\n\t}\n}\n","/**\n * Keyboard handlers for heading block types.\n * Handles Enter key behavior: empty heading → paragraph, cursor at end → split + paragraph.\n */\n\nimport type { BlockNode } from '../../model/Document.js';\nimport { generateBlockId, getBlockLength, getBlockText } from '../../model/Document.js';\nimport { createCollapsedSelection, isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\nimport type { HeadingConfig } from './HeadingPlugin.js';\n\n// --- Context Guard ---\n\nconst HEADING_TYPES: ReadonlySet<string> = new Set(['heading', 'title', 'subtitle']);\n\ninterface HeadingContext {\n\treadonly state: EditorState;\n\treadonly block: BlockNode;\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n}\n\n/**\n * Guards against NodeSelection, non-collapsed selections, and non-heading blocks.\n * Returns false (not handled) if the cursor is not inside a heading-type block.\n */\nfunction withHeadingContext(\n\tcontext: PluginContext,\n\thandler: (ctx: HeadingContext) => boolean,\n): boolean {\n\tconst state: EditorState = context.getState();\n\tif (!isTextSelection(state.selection)) return false;\n\n\tconst sel = state.selection;\n\tif (!isCollapsed(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\tif (!block || !HEADING_TYPES.has(block.type)) return false;\n\n\treturn handler({\n\t\tstate,\n\t\tblock,\n\t\tblockId: sel.anchor.blockId,\n\t\toffset: sel.anchor.offset,\n\t});\n}\n\n/** Registers all heading keyboard handlers (Enter, Mod-Shift-N shortcuts). */\nexport function registerHeadingKeymaps(context: PluginContext, config: HeadingConfig): void {\n\tconst keymap: Record<string, () => boolean> = {\n\t\tEnter: () => handleEnter(context),\n\t};\n\n\tfor (const level of config.levels) {\n\t\tif (level <= 6) {\n\t\t\tkeymap[`Mod-Shift-${level}`] = () => context.executeCommand(`setHeading${level}`);\n\t\t}\n\t}\n\n\tcontext.registerKeymap(keymap);\n}\n\n// --- Enter Handler ---\n\n/**\n * Handles Enter inside a heading block.\n * Empty heading → convert to paragraph.\n * Cursor at end → split and convert new block to paragraph.\n * Cursor in middle → normal split (both stay heading).\n */\nfunction handleEnter(context: PluginContext): boolean {\n\treturn withHeadingContext(context, (ctx) => {\n\t\tconst text: string = getBlockText(ctx.block);\n\n\t\tif (text === '') {\n\t\t\tconst tr = ctx.state\n\t\t\t\t.transaction('input')\n\t\t\t\t.setBlockType(ctx.blockId, nodeType('paragraph'))\n\t\t\t\t.setSelection(ctx.state.selection)\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\tconst blockLength: number = getBlockLength(ctx.block);\n\n\t\tif (ctx.offset >= blockLength) {\n\t\t\tconst newBlockId = generateBlockId();\n\t\t\tconst tr = ctx.state\n\t\t\t\t.transaction('input')\n\t\t\t\t.splitBlock(ctx.blockId, ctx.offset, newBlockId)\n\t\t\t\t.setBlockType(newBlockId, nodeType('paragraph'))\n\t\t\t\t.setSelection(createCollapsedSelection(newBlockId, 0))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t});\n}\n","/**\n * Locale interface and default English locale for the HeadingPlugin.\n */\n\n// --- Locale Interface ---\n\nexport interface HeadingLocale {\n\treadonly paragraph: string;\n\treadonly title: string;\n\treadonly subtitle: string;\n\treadonly heading1: string;\n\treadonly heading2: string;\n\treadonly heading3: string;\n\treadonly heading4: string;\n\treadonly heading5: string;\n\treadonly heading6: string;\n\treadonly blockTypeLabel: string;\n\treadonly blockTypesAria: string;\n}\n\n// --- Default English Locale ---\n\nexport const HEADING_LOCALE_EN: HeadingLocale = {\n\tparagraph: 'Paragraph',\n\ttitle: 'Title',\n\tsubtitle: 'Subtitle',\n\theading1: 'Heading 1',\n\theading2: 'Heading 2',\n\theading3: 'Heading 3',\n\theading4: 'Heading 4',\n\theading5: 'Heading 5',\n\theading6: 'Heading 6',\n\tblockTypeLabel: 'Block Type',\n\tblockTypesAria: 'Block types',\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: Record<string, () => Promise<{ default: HeadingLocale }>> = import.meta.glob<{\n\tdefault: HeadingLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadHeadingLocale(lang: string): Promise<HeadingLocale> {\n\tif (lang === 'en') return HEADING_LOCALE_EN;\n\tconst loader = localeModules[`./locales/${lang}.ts`];\n\tif (!loader) return HEADING_LOCALE_EN;\n\ttry {\n\t\tconst mod = await loader();\n\t\treturn mod.default;\n\t} catch {\n\t\treturn HEADING_LOCALE_EN;\n\t}\n}\n","/**\n * HeadingPlugin: registers Title, Subtitle, and H1–H6 heading block types\n * with NodeSpec, toggle commands, keyboard shortcuts, input rules, and a\n * combobox-style toolbar dropdown that reflects the current block type.\n *\n * This file is a thin orchestrator — command logic, input rules, keyboard\n * handlers, and picker/toolbar rendering are delegated to dedicated modules.\n */\n\nimport { HEADING_SELECT_CSS } from '../../editor/styles/heading-select.js';\nimport type { BlockAlignment } from '../../model/BlockAlignment.js';\nimport { createBlockElement } from '../../view/DomUtils.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport {\n\tregisterHeadingPickerEntries,\n\tregisterHeadingToolbarItem,\n} from './HeadingBlockTypePicker.js';\nimport { registerHeadingCommands } from './HeadingCommands.js';\nimport { registerHeadingInputRules } from './HeadingInputRules.js';\nimport { registerHeadingKeymaps } from './HeadingKeyboardHandlers.js';\nimport { HEADING_LOCALE_EN, type HeadingLocale, loadHeadingLocale } from './HeadingLocale.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface NodeAttrRegistry {\n\t\theading: { level: HeadingLevel; align?: BlockAlignment };\n\t\ttitle: { align?: BlockAlignment };\n\t\tsubtitle: { align?: BlockAlignment };\n\t}\n}\n\n// --- Configuration ---\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport interface HeadingConfig {\n\t/** Which heading levels to enable. Defaults to [1, 2, 3, 4, 5, 6]. */\n\treadonly levels: readonly HeadingLevel[];\n\treadonly locale?: HeadingLocale;\n}\n\nconst DEFAULT_CONFIG: HeadingConfig = {\n\tlevels: [1, 2, 3, 4, 5, 6],\n};\n\n// --- Heading Tag Mapping ---\n\nconst HEADING_TAGS: Record<HeadingLevel, string> = {\n\t1: 'h1',\n\t2: 'h2',\n\t3: 'h3',\n\t4: 'h4',\n\t5: 'h5',\n\t6: 'h6',\n};\n\n// --- Plugin ---\n\nexport class HeadingPlugin implements Plugin {\n\treadonly id = 'heading';\n\treadonly name = 'Heading';\n\treadonly priority = 30;\n\n\tprivate readonly config: HeadingConfig;\n\tprivate locale!: HeadingLocale;\n\n\tconstructor(config?: Partial<HeadingConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tHEADING_LOCALE_EN,\n\t\t\tloadHeadingLocale,\n\t\t);\n\t\tcontext.registerStyleSheet(HEADING_SELECT_CSS);\n\n\t\tthis.registerNodeSpecs(context);\n\t\tregisterHeadingCommands(context, this.config);\n\t\tregisterHeadingKeymaps(context, this.config);\n\t\tregisterHeadingInputRules(context, this.config);\n\t\tregisterHeadingPickerEntries(context, this.config, this.locale);\n\t\tregisterHeadingToolbarItem(context, this.locale);\n\t}\n\n\tprivate registerNodeSpecs(context: PluginContext): void {\n\t\tcontext.registerNodeSpec({\n\t\t\ttype: 'title',\n\t\t\tgroup: 'block',\n\t\t\tcontent: { allow: ['text'] },\n\t\t\texcludeMarks: ['fontSize'],\n\t\t\ttoDOM(node) {\n\t\t\t\tconst el = createBlockElement('h1', node.id);\n\t\t\t\tel.classList.add('notectl-title');\n\t\t\t\treturn el;\n\t\t\t},\n\t\t\ttoHTML(_node, content) {\n\t\t\t\treturn `<h1 class=\"notectl-title\">${content || '<br>'}</h1>`;\n\t\t\t},\n\t\t\tparseHTML: [\n\t\t\t\t{\n\t\t\t\t\ttag: 'h1',\n\t\t\t\t\tpriority: 60,\n\t\t\t\t\tgetAttrs: (el) => (el.classList.contains('notectl-title') ? {} : false),\n\t\t\t\t},\n\t\t\t],\n\t\t\tsanitize: { tags: ['h1'], attrs: ['class'] },\n\t\t});\n\n\t\tcontext.registerNodeSpec({\n\t\t\ttype: 'subtitle',\n\t\t\tgroup: 'block',\n\t\t\tcontent: { allow: ['text'] },\n\t\t\texcludeMarks: ['fontSize'],\n\t\t\ttoDOM(node) {\n\t\t\t\tconst el = createBlockElement('h2', node.id);\n\t\t\t\tel.classList.add('notectl-subtitle');\n\t\t\t\treturn el;\n\t\t\t},\n\t\t\ttoHTML(_node, content) {\n\t\t\t\treturn `<h2 class=\"notectl-subtitle\">${content || '<br>'}</h2>`;\n\t\t\t},\n\t\t\tparseHTML: [\n\t\t\t\t{\n\t\t\t\t\ttag: 'h2',\n\t\t\t\t\tpriority: 60,\n\t\t\t\t\tgetAttrs: (el) => (el.classList.contains('notectl-subtitle') ? {} : false),\n\t\t\t\t},\n\t\t\t],\n\t\t\tsanitize: { tags: ['h2'], attrs: ['class'] },\n\t\t});\n\n\t\tcontext.registerNodeSpec({\n\t\t\ttype: 'heading',\n\t\t\tgroup: 'block',\n\t\t\tcontent: { allow: ['text'] },\n\t\t\texcludeMarks: ['fontSize'],\n\t\t\tattrs: {\n\t\t\t\tlevel: { default: 1 },\n\t\t\t},\n\t\t\ttoDOM(node) {\n\t\t\t\tconst level = node.attrs?.level ?? 1;\n\t\t\t\tconst tag = HEADING_TAGS[level] ?? 'h1';\n\t\t\t\treturn createBlockElement(tag, node.id);\n\t\t\t},\n\t\t\ttoHTML(node, content) {\n\t\t\t\tconst level = (node.attrs?.level ?? 1) as HeadingLevel;\n\t\t\t\tconst tag: string = HEADING_TAGS[level] ?? 'h1';\n\t\t\t\treturn `<${tag}>${content || '<br>'}</${tag}>`;\n\t\t\t},\n\t\t\tparseHTML: [\n\t\t\t\t{ tag: 'h1', getAttrs: () => ({ level: 1 }) },\n\t\t\t\t{ tag: 'h2', getAttrs: () => ({ level: 2 }) },\n\t\t\t\t{ tag: 'h3', getAttrs: () => ({ level: 3 }) },\n\t\t\t\t{ tag: 'h4', getAttrs: () => ({ level: 4 }) },\n\t\t\t\t{ tag: 'h5', getAttrs: () => ({ level: 5 }) },\n\t\t\t\t{ tag: 'h6', getAttrs: () => ({ level: 6 }) },\n\t\t\t],\n\t\t\tsanitize: { tags: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] },\n\t\t});\n\t}\n}\n","/** Heading picker toolbar combobox + popup styles. */\nexport const HEADING_SELECT_CSS = `\n/* Heading Select — Width overrides for combobox button */\n.notectl-toolbar-btn--heading {\n\tmin-width: 100px;\n\tmax-width: 160px;\n}\n\n/* Heading Picker Popup */\n.notectl-heading-picker {\n\tmin-width: 200px;\n\tmax-height: 320px;\n\toverflow-y: auto;\n}\n\n.notectl-heading-picker__list {\n\tpadding: 4px 0;\n}\n\n.notectl-heading-picker__item {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\twidth: 100%;\n\tpadding: 7px 12px;\n\tborder: none;\n\tbackground: none;\n\tcursor: pointer;\n\tfont-size: 14px;\n\tcolor: var(--notectl-fg);\n\ttext-align: start;\n\twhite-space: nowrap;\n\tfont-family: inherit;\n\ttransition: background 0.1s;\n}\n\n@media (hover: hover) {\n\t.notectl-heading-picker__item:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t}\n}\n\n.notectl-heading-picker__item--active {\n\tbackground: var(--notectl-active-bg);\n\tcolor: var(--notectl-primary-fg);\n}\n\n@media (hover: hover) {\n\t.notectl-heading-picker__item--active:hover {\n\t\tbackground: var(--notectl-active-bg);\n\t}\n}\n\n.notectl-heading-picker__check {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 16px;\n\tflex-shrink: 0;\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-heading-picker__label {\n\tflex: 1;\n}\n`;\n","/**\n * Input rule registration for heading block types.\n * Converts `# `, `## `, etc. at the start of a paragraph into headings.\n */\n\nimport { createCollapsedSelection, isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { PluginContext } from '../Plugin.js';\nimport type { HeadingConfig } from './HeadingPlugin.js';\n\n/** Registers markdown-style input rules (e.g. `# ` → H1) for configured heading levels. */\nexport function registerHeadingInputRules(context: PluginContext, config: HeadingConfig): void {\n\tfor (const level of config.levels) {\n\t\tconst hashes: string = '#'.repeat(level);\n\t\tconst pattern: RegExp = new RegExp(`^${hashes} $`);\n\n\t\tcontext.registerInputRule({\n\t\t\tpattern,\n\t\t\thandler(state, _match, start, _end) {\n\t\t\t\tconst sel = state.selection;\n\t\t\t\tif (!isTextSelection(sel)) return null;\n\t\t\t\tif (!isCollapsed(sel)) return null;\n\n\t\t\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\t\t\tif (!block || block.type !== 'paragraph') return null;\n\n\t\t\t\treturn state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.deleteTextAt(sel.anchor.blockId, start, start + level + 1)\n\t\t\t\t\t.setBlockType(sel.anchor.blockId, nodeType('heading'), { level })\n\t\t\t\t\t.setSelection(createCollapsedSelection(sel.anchor.blockId, 0))\n\t\t\t\t\t.build();\n\t\t\t},\n\t\t});\n\t}\n}\n"],"names":["createPickerItem","label","isActive","handler","style","item","document","createElement","type","className","setAttribute","String","classList","add","check","textContent","appendChild","labelSpan","setStyleProperties","fontSize","fontWeight","addEventListener","getHeadingLabel","locale","level","toggleSpecialBlock","context","state","getState","isTextSelection","selection","block","getBlock","anchor","blockId","setBlockType","nodeType","toggleHeading","sel","attrs","builder","transaction","spec","getSchemaRegistry","getNodeSpec","excludeMarks","length","getBlockLength","excludeSet","Set","inlineChildren","getInlineChildren","offset","child","isTextNode","text","mark","marks","has","removeMark","id","stripExcludedMarks","storedMarks","filtered","filter","m","setStoredMarks","clearExcludedStoredMarks","tr","setSelection","build","dispatch","HEADING_TYPES","HEADING_LOCALE_EN","paragraph","title","subtitle","heading1","heading2","heading3","heading4","heading5","heading6","blockTypeLabel","blockTypesAria","localeModules","assign","import","async","loadHeadingLocale","lang","loader","default","DEFAULT_CONFIG","levels","HEADING_TAGS","HeadingPlugin","name","priority","config","constructor","this","init","resolveLocale","registerStyleSheet","registerNodeSpecs","registerCommand","registerHeadingCommands","keymap","Enter","isCollapsed","withHeadingContext","ctx","getBlockText","blockLength","newBlockId","generateBlockId","splitBlock","createCollapsedSelection","handleEnter","executeCommand","registerKeymap","registerHeadingKeymaps","hashes","repeat","pattern","RegExp","registerInputRule","_match","start","_end","deleteTextAt","registerHeadingInputRules","registerBlockTypePickerEntry","command","registerHeadingPickerEntries","registerToolbarItem","group","tooltip","popupType","getLabel","entries","getBlockTypePickerRegistry","getBlockTypePickerEntries","entry","getActiveLabel","renderPopup","container","onClose","contentElement","getContainer","list","active","e","preventDefault","stopPropagation","restoreFocusTo","renderHeadingPopup","some","registerHeadingToolbarItem","registerNodeSpec","content","allow","toDOM","node","el","createBlockElement","toHTML","_node","parseHTML","tag","getAttrs","contains","sanitize","tags"],"mappings":"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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function r(r,t){for(let n=0;n<r.length;n++){const e=r[n];e&&e.setAttribute("tabindex",n===t?"0":"-1")}}function t(r,t,n){const e=r.length;return 0===e?-1:(t+n+e)%e}function n(r,t,n,e,o,c=!1){switch(c?function(r){return"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r}(o):o){case"ArrowUp":return[r>1?r-1:n,t];case"ArrowDown":return[r<n?r+1:1,t];case"ArrowLeft":return[r,t>1?t-1:e];case"ArrowRight":return[r,t<e?t+1:1]}}export{r as a,t as f,n};
|
|
2
|
-
//# sourceMappingURL=KeyboardNav-DsYhKKuV.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardNav-DsYhKKuV.mjs","sources":["../../src/plugins/shared/KeyboardNav.ts"],"sourcesContent":["/**\n * Generic keyboard navigation helpers reused by toolbar and popup UIs.\n */\n\n/**\n * Applies roving tabindex: sets tabindex=\"0\" on the focused item,\n * tabindex=\"-1\" on all others.\n */\nexport function applyRovingTabindex(items: readonly HTMLElement[], focusedIndex: number): void {\n\tfor (let i = 0; i < items.length; i++) {\n\t\tconst item: HTMLElement | undefined = items[i];\n\t\tif (item) {\n\t\t\titem.setAttribute('tabindex', i === focusedIndex ? '0' : '-1');\n\t\t}\n\t}\n}\n\n/** Navigates dropdown items with arrow keys (wraps around). */\nexport function findNextDropdownItem(\n\titems: readonly HTMLElement[],\n\tcurrent: number,\n\tdirection: 1 | -1,\n): number {\n\tconst len = items.length;\n\tif (len === 0) return -1;\n\treturn (current + direction + len) % len;\n}\n\n/** Flips horizontal arrow keys for RTL contexts. */\nfunction flipHorizontalKey(\n\tkey: 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight',\n): 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' {\n\tif (key === 'ArrowLeft') return 'ArrowRight';\n\tif (key === 'ArrowRight') return 'ArrowLeft';\n\treturn key;\n}\n\n/**\n * Navigates a grid of cells with arrow keys.\n * Returns the new [row, col] position.\n * When `isRtl` is true, horizontal arrows are flipped to match visual direction.\n */\nexport function navigateGrid(\n\trow: number,\n\tcol: number,\n\tmaxRows: number,\n\tmaxCols: number,\n\tkey: 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight',\n\tisRtl = false,\n): [number, number] {\n\tconst resolved: 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' = isRtl\n\t\t? flipHorizontalKey(key)\n\t\t: key;\n\n\tswitch (resolved) {\n\t\tcase 'ArrowUp':\n\t\t\treturn [row > 1 ? row - 1 : maxRows, col];\n\t\tcase 'ArrowDown':\n\t\t\treturn [row < maxRows ? row + 1 : 1, col];\n\t\tcase 'ArrowLeft':\n\t\t\treturn [row, col > 1 ? col - 1 : maxCols];\n\t\tcase 'ArrowRight':\n\t\t\treturn [row, col < maxCols ? col + 1 : 1];\n\t}\n}\n"],"names":["applyRovingTabindex","items","focusedIndex","i","length","item","setAttribute","findNextDropdownItem","current","direction","len","navigateGrid","row","col","maxRows","maxCols","key","isRtl","flipHorizontalKey"],"mappings":"AAQO,SAASA,EAAoBC,EAA+BC,GAClE,IAAA,IAASC,EAAI,EAAGA,EAAIF,EAAMG,OAAQD,IAAK,CACtC,MAAME,EAAgCJ,EAAME,GACxCE,GACHA,EAAKC,aAAa,WAAYH,IAAMD,EAAe,IAAM,KAE3D,CACD,CAGO,SAASK,EACfN,EACAO,EACAC,GAEA,MAAMC,EAAMT,EAAMG,OAClB,OAAY,IAARM,GAAkB,GACdF,EAAUC,EAAYC,GAAOA,CACtC,CAgBO,SAASC,EACfC,EACAC,EACAC,EACAC,EACAC,EACAC,GAAQ,GAMR,OAJuEA,EArBxE,SACCD,GAEA,MAAY,cAARA,EAA4B,aACpB,eAARA,EAA6B,YAC1BA,CACR,CAgBIE,CAAkBF,GAClBA,GAGF,IAAK,UACJ,MAAO,CAACJ,EAAM,EAAIA,EAAM,EAAIE,EAASD,GACtC,IAAK,YACJ,MAAO,CAACD,EAAME,EAAUF,EAAM,EAAI,EAAGC,GACtC,IAAK,YACJ,MAAO,CAACD,EAAKC,EAAM,EAAIA,EAAM,EAAIE,GAClC,IAAK,aACJ,MAAO,CAACH,EAAKC,EAAME,EAAUF,EAAM,EAAI,GAE1C"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{m as e,h as t,f as n,k as r,q as o}from"./Document-3pNX7ear.mjs";import{j as s,i as c,s as i}from"./Selection-DhbizDM4.mjs";import{m as a}from"./TypeBrands-Bp_Z_o5Y.mjs";import{f as u}from"./RangeIterator-XFN5FaYf.mjs";function f(){return{nodeTypes:["paragraph"],markTypes:["bold","italic","underline"],getNodeSpec:()=>{}}}function l(e){return{nodeTypes:e.getNodeTypes(),markTypes:e.getMarkTypes(),getNodeSpec:t=>e.getNodeSpec(t)}}function d(e,t){return e.markTypes.includes(t)}function m(e,t){return e.nodeTypes.includes(t)}const k={bold:!0,italic:!0,underline:!0};function p(n,r,o=k){if(function(e,t){const n=e;return"bold"===n?!t.bold:"italic"===n?!t.italic:"underline"===n&&!t.underline}(r,o))return null;if(!d(n.schema,r))return null;if(!s(n.selection))return null;const a={type:r},f=n.selection;if(c(f)){const o=n.getBlock(f.anchor.blockId);if(!o)return null;const s=n.storedMarks??t(o,f.anchor.offset),c=e(s,r)?s.filter(e=>e.type!==r):[...s,a];return n.transaction("command").setStoredMarks(c,n.storedMarks).setSelection(f).build()}const l=i(f,n.getBlockOrder()),m=n.transaction("command"),p=h(n,r);return u(n,l,(e,t,n)=>{p?m.removeMark(e,t,n,a):m.addMark(e,t,n,a)}),m.setSelection(f),m.build()}function g(e,t){return p(e,a("bold"),t)}function b(e,t){return p(e,a("italic"),t)}function y(e,t){return p(e,a("underline"),t)}function T(n,r){const o=n.selection;if(!s(o))return!1;if(c(o)){if(n.storedMarks)return e(n.storedMarks,r);const s=n.getBlock(o.anchor.blockId);if(!s)return!1;const c=t(s,o.anchor.offset);return e(c,r)}return h(n,r)}function h(e,t){const r=e.selection;if(!s(r))return!1;const o=e.getBlockOrder(),c=i(r,o),a=o.indexOf(c.from.blockId),u=o.indexOf(c.to.blockId);for(let s=a;s<=u;s++){const r=o[s];if(!r)continue;const i=e.getBlock(r);if(!i)continue;const f=n(i);if(!M(i,s===a?c.from.offset:0,s===u?c.to.offset:f,t))return!1}return!0}function M(t,n,s,c){if(n===s)return!1;let i=0;for(const a of r(t))if(o(a)){const t=i+a.text.length;if(t>n&&i<s&&!e(a.marks,c))return!1;i=t}else i+=1;return!0}export{d as a,b,p as c,f as d,y as e,m as f,T as i,l as s,g as t};
|
|
2
|
-
//# sourceMappingURL=MarkCommands-CeCa4WSC.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MarkCommands-CeCa4WSC.mjs","sources":["../../src/model/Schema.ts","../../src/commands/MarkCommands.ts"],"sourcesContent":["/**\n * Schema definition for the Notectl editor.\n * Defines which node types and marks are allowed.\n */\n\nimport type { NodeSpec } from './NodeSpec.js';\nimport type { SchemaRegistry } from './SchemaRegistry.js';\n\nexport interface Schema {\n\treadonly nodeTypes: readonly string[];\n\treadonly markTypes: readonly string[];\n\t/** Looks up the full NodeSpec for a given type. Available when created via schemaFromRegistry. */\n\treadonly getNodeSpec?: (type: string) => NodeSpec | undefined;\n}\n\n/** Creates the default schema with paragraph nodes and bold/italic/underline marks. */\nexport function defaultSchema(): Schema {\n\treturn {\n\t\tnodeTypes: ['paragraph'],\n\t\tmarkTypes: ['bold', 'italic', 'underline'],\n\t\tgetNodeSpec: () => undefined,\n\t};\n}\n\n/** Derives a Schema from a SchemaRegistry's registered specs. */\nexport function schemaFromRegistry(registry: SchemaRegistry): Schema {\n\treturn {\n\t\tnodeTypes: registry.getNodeTypes(),\n\t\tmarkTypes: registry.getMarkTypes(),\n\t\tgetNodeSpec: (type: string) => registry.getNodeSpec(type),\n\t};\n}\n\n/** Checks whether the given mark type is allowed by the schema. */\nexport function isMarkAllowed(schema: Schema, markType: string): boolean {\n\treturn schema.markTypes.includes(markType);\n}\n\n/** Checks whether the given node type is allowed by the schema. */\nexport function isNodeTypeAllowed(schema: Schema, nodeType: string): boolean {\n\treturn schema.nodeTypes.includes(nodeType);\n}\n","/**\n * Mark-related commands: toggling bold/italic/underline and checking\n * whether a mark is active.\n */\n\nimport {\n\ttype BlockNode,\n\ttype Mark,\n\tgetBlockLength,\n\tgetBlockMarksAtOffset,\n\tgetInlineChildren,\n\thasMark,\n\tisTextNode,\n} from '../model/Document.js';\nimport { isMarkAllowed } from '../model/Schema.js';\nimport { isCollapsed, isTextSelection, selectionRange } from '../model/Selection.js';\nimport type { MarkTypeName } from '../model/TypeBrands.js';\nimport { markType as mkType } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport { forEachBlockInRange } from './RangeIterator.js';\n\n// --- Feature Configuration ---\n\nexport interface FeatureConfig {\n\treadonly bold: boolean;\n\treadonly italic: boolean;\n\treadonly underline: boolean;\n}\n\nconst defaultFeatures: FeatureConfig = { bold: true, italic: true, underline: true };\n\n/**\n * Toggles a mark on the current selection.\n * If collapsed, toggles stored marks. If range, applies/removes from text.\n */\nexport function toggleMark(\n\tstate: EditorState,\n\tmarkType: MarkTypeName,\n\tfeatures: FeatureConfig = defaultFeatures,\n): Transaction | null {\n\tif (isFeatureGated(markType, features)) return null;\n\tif (!isMarkAllowed(state.schema, markType)) return null;\n\tif (!isTextSelection(state.selection)) return null;\n\n\tconst mark: Mark = { type: markType };\n\tconst sel = state.selection;\n\n\tif (isCollapsed(sel)) {\n\t\t// Toggle stored marks\n\t\tconst anchorBlock = state.getBlock(sel.anchor.blockId);\n\t\tif (!anchorBlock) return null;\n\t\tconst currentMarks = state.storedMarks ?? getBlockMarksAtOffset(anchorBlock, sel.anchor.offset);\n\t\tconst hasIt = hasMark(currentMarks, markType);\n\t\tconst newMarks = hasIt\n\t\t\t? currentMarks.filter((m) => m.type !== markType)\n\t\t\t: [...currentMarks, mark];\n\n\t\treturn state\n\t\t\t.transaction('command')\n\t\t\t.setStoredMarks(newMarks, state.storedMarks)\n\t\t\t.setSelection(sel)\n\t\t\t.build();\n\t}\n\n\t// Range selection — apply/remove mark to all blocks in range\n\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst builder = state.transaction('command');\n\n\t// Determine if we should add or remove\n\tconst shouldRemove = isMarkActiveInRange(state, markType);\n\n\tforEachBlockInRange(state, range, (blockId, from, to) => {\n\t\tif (shouldRemove) {\n\t\t\tbuilder.removeMark(blockId, from, to, mark);\n\t\t} else {\n\t\t\tbuilder.addMark(blockId, from, to, mark);\n\t\t}\n\t});\n\n\tbuilder.setSelection(sel);\n\treturn builder.build();\n}\n\nexport function toggleBold(state: EditorState, features?: FeatureConfig): Transaction | null {\n\treturn toggleMark(state, mkType('bold'), features);\n}\n\nexport function toggleItalic(state: EditorState, features?: FeatureConfig): Transaction | null {\n\treturn toggleMark(state, mkType('italic'), features);\n}\n\nexport function toggleUnderline(state: EditorState, features?: FeatureConfig): Transaction | null {\n\treturn toggleMark(state, mkType('underline'), features);\n}\n\n/** Checks if a mark is active at the current selection. */\nexport function isMarkActive(state: EditorState, markType: MarkTypeName): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tif (isCollapsed(sel)) {\n\t\tif (state.storedMarks) {\n\t\t\treturn hasMark(state.storedMarks, markType);\n\t\t}\n\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\tif (!block) return false;\n\t\tconst marks = getBlockMarksAtOffset(block, sel.anchor.offset);\n\t\treturn hasMark(marks, markType);\n\t}\n\n\treturn isMarkActiveInRange(state, markType);\n}\n\n/** Checks if a mark is active across the entire selection range. */\nfunction isMarkActiveInRange(state: EditorState, markType: MarkTypeName): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\tconst blockOrder = state.getBlockOrder();\n\tconst range = selectionRange(sel, blockOrder);\n\n\tconst fromIdx = blockOrder.indexOf(range.from.blockId);\n\tconst toIdx = blockOrder.indexOf(range.to.blockId);\n\n\tfor (let i = fromIdx; i <= toIdx; i++) {\n\t\tconst blockId = blockOrder[i];\n\t\tif (!blockId) continue;\n\t\tconst block = state.getBlock(blockId);\n\t\tif (!block) continue;\n\t\tconst blockLen = getBlockLength(block);\n\t\tconst from = i === fromIdx ? range.from.offset : 0;\n\t\tconst to = i === toIdx ? range.to.offset : blockLen;\n\n\t\tif (!isMarkActiveInBlock(block, from, to, markType)) return false;\n\t}\n\n\treturn true;\n}\n\nfunction isMarkActiveInBlock(\n\tblock: BlockNode,\n\tfrom: number,\n\tto: number,\n\tmarkType: MarkTypeName,\n): boolean {\n\tif (from === to) return false;\n\tlet pos = 0;\n\tfor (const child of getInlineChildren(block)) {\n\t\tif (isTextNode(child)) {\n\t\t\tconst childEnd = pos + child.text.length;\n\t\t\tif (childEnd > from && pos < to) {\n\t\t\t\tif (!hasMark(child.marks, markType)) return false;\n\t\t\t}\n\t\t\tpos = childEnd;\n\t\t} else {\n\t\t\t// InlineNode: skip (width 1, no marks)\n\t\t\tpos += 1;\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction isFeatureGated(type: MarkTypeName, features: FeatureConfig): boolean {\n\tconst key = type as string;\n\tif (key === 'bold') return !features.bold;\n\tif (key === 'italic') return !features.italic;\n\tif (key === 'underline') return !features.underline;\n\treturn false;\n}\n"],"names":["defaultSchema","nodeTypes","markTypes","getNodeSpec","schemaFromRegistry","registry","getNodeTypes","getMarkTypes","type","isMarkAllowed","schema","markType","includes","isNodeTypeAllowed","nodeType","defaultFeatures","bold","italic","underline","toggleMark","state","features","key","isFeatureGated","isTextSelection","selection","mark","sel","isCollapsed","anchorBlock","getBlock","anchor","blockId","currentMarks","storedMarks","getBlockMarksAtOffset","offset","newMarks","hasMark","filter","m","transaction","setStoredMarks","setSelection","build","range","selectionRange","getBlockOrder","builder","shouldRemove","isMarkActiveInRange","forEachBlockInRange","from","to","removeMark","addMark","toggleBold","mkType","toggleItalic","toggleUnderline","isMarkActive","block","marks","blockOrder","fromIdx","indexOf","toIdx","i","blockLen","getBlockLength","isMarkActiveInBlock","pos","child","getInlineChildren","isTextNode","childEnd","text","length"],"mappings":"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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function t(t,e){const n=t.getBlock(e);if(!n)return!1;const o=t.schema.getNodeSpec;return!!o&&!0===o(n.type)?.isVoid}function e(t,e,n){const o=t.getNodePath(e),r=t.getNodePath(n);if(!o||!r)return!1;if(o.length!==r.length)return!1;for(let c=0;c<o.length-1;c++)if(o[c]!==r[c])return!1;return!0}function n(t,e){const n=t.schema.getNodeSpec;if(!n)return!1;const o=t.getNodePath(e);if(!o||o.length<=1)return!1;for(let r=0;r<o.length-1;r++){const e=o[r];if(!e)continue;const c=t.getBlock(e);if(!c)continue;const i=n(c.type);if(i?.isolating)return!0}return!1}function o(t,e){const n=t.schema.getNodeSpec;if(!n)return!1;const o=t.getBlock(e);return!!o&&!0===n(o.type)?.isolating}function r(t,r,c){if(o(t,r)||o(t,c))return!1;const i=n(t,r),s=n(t,c);return i===s&&(!i||!s||e(t,r,c))}export{o as a,t as b,r as c,n as i,e as s};
|
|
2
|
-
//# sourceMappingURL=NavigationQueries-11qe4j9x.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationQueries-11qe4j9x.mjs","sources":["../../src/state/NavigationQueries.ts"],"sourcesContent":["/**\n * Pure navigation query functions for block boundary and isolating checks.\n *\n * These utilities inspect the document structure and schema to answer\n * questions about block traversal — whether a block is void, isolating,\n * or whether navigation between two blocks is allowed.\n */\n\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from './EditorState.js';\n\n/** Returns true if the block with the given ID is a void block (e.g. image, HR). */\nexport function isVoidBlock(state: EditorState, bid: BlockId): boolean {\n\tconst block = state.getBlock(bid);\n\tif (!block) return false;\n\tconst getNodeSpec = state.schema.getNodeSpec;\n\tif (!getNodeSpec) return false;\n\treturn getNodeSpec(block.type)?.isVoid === true;\n}\n\n/** Checks whether two blocks share the same parent in the document tree. */\nexport function sharesParent(state: EditorState, blockIdA: BlockId, blockIdB: BlockId): boolean {\n\tconst pathA = state.getNodePath(blockIdA);\n\tconst pathB = state.getNodePath(blockIdB);\n\tif (!pathA || !pathB) return false;\n\tif (pathA.length !== pathB.length) return false;\n\t// Compare parent paths (all but last element)\n\tfor (let i = 0; i < pathA.length - 1; i++) {\n\t\tif (pathA[i] !== pathB[i]) return false;\n\t}\n\treturn true;\n}\n\n/** Checks whether a block is inside an isolating node (e.g. table_cell). */\nexport function isInsideIsolating(state: EditorState, blockId: BlockId): boolean {\n\tconst getNodeSpec = state.schema.getNodeSpec;\n\tif (!getNodeSpec) return false;\n\tconst path = state.getNodePath(blockId);\n\tif (!path || path.length <= 1) return false;\n\n\t// Check ancestors (not the block itself)\n\tfor (let i = 0; i < path.length - 1; i++) {\n\t\tconst ancestorId = path[i];\n\t\tif (!ancestorId) continue;\n\t\tconst ancestor = state.getBlock(ancestorId);\n\t\tif (!ancestor) continue;\n\t\tconst spec = getNodeSpec(ancestor.type);\n\t\tif (spec?.isolating) return true;\n\t}\n\treturn false;\n}\n\n/** Returns true if the block itself has the isolating property. */\nexport function isIsolatingBlock(state: EditorState, blockId: BlockId): boolean {\n\tconst getNodeSpec = state.schema.getNodeSpec;\n\tif (!getNodeSpec) return false;\n\tconst block = state.getBlock(blockId);\n\tif (!block) return false;\n\treturn getNodeSpec(block.type)?.isolating === true;\n}\n\n/**\n * Checks whether navigation between two blocks is allowed.\n * Prevents crossing isolating boundaries (e.g. table cells).\n */\nexport function canCrossBlockBoundary(state: EditorState, fromId: BlockId, toId: BlockId): boolean {\n\t// A block that is itself isolating cannot be crossed into via arrow keys\n\tif (isIsolatingBlock(state, fromId) || isIsolatingBlock(state, toId)) return false;\n\n\tconst fromInside: boolean = isInsideIsolating(state, fromId);\n\tconst toInside: boolean = isInsideIsolating(state, toId);\n\n\t// One inside isolating, the other not → disallow\n\tif (fromInside !== toInside) return false;\n\n\t// Both inside isolating → must share the same parent\n\tif (fromInside && toInside) return sharesParent(state, fromId, toId);\n\n\treturn true;\n}\n"],"names":["isVoidBlock","state","bid","block","getBlock","getNodeSpec","schema","type","isVoid","sharesParent","blockIdA","blockIdB","pathA","getNodePath","pathB","length","i","isInsideIsolating","blockId","path","ancestorId","ancestor","spec","isolating","isIsolatingBlock","canCrossBlockBoundary","fromId","toId","fromInside","toInside"],"mappings":"AAYO,SAASA,EAAYC,EAAoBC,GAC/C,MAAMC,EAAQF,EAAMG,SAASF,GAC7B,IAAKC,EAAO,OAAO,EACnB,MAAME,EAAcJ,EAAMK,OAAOD,YACjC,QAAKA,IACsC,IAApCA,EAAYF,EAAMI,OAAOC,MACjC,CAGO,SAASC,EAAaR,EAAoBS,EAAmBC,GACnE,MAAMC,EAAQX,EAAMY,YAAYH,GAC1BI,EAAQb,EAAMY,YAAYF,GAChC,IAAKC,IAAUE,EAAO,OAAO,EAC7B,GAAIF,EAAMG,SAAWD,EAAMC,OAAQ,OAAO,EAE1C,IAAA,IAASC,EAAI,EAAGA,EAAIJ,EAAMG,OAAS,EAAGC,IACrC,GAAIJ,EAAMI,KAAOF,EAAME,GAAI,OAAO,EAEnC,OAAO,CACR,CAGO,SAASC,EAAkBhB,EAAoBiB,GACrD,MAAMb,EAAcJ,EAAMK,OAAOD,YACjC,IAAKA,EAAa,OAAO,EACzB,MAAMc,EAAOlB,EAAMY,YAAYK,GAC/B,IAAKC,GAAQA,EAAKJ,QAAU,EAAG,OAAO,EAGtC,IAAA,IAASC,EAAI,EAAGA,EAAIG,EAAKJ,OAAS,EAAGC,IAAK,CACzC,MAAMI,EAAaD,EAAKH,GACxB,IAAKI,EAAY,SACjB,MAAMC,EAAWpB,EAAMG,SAASgB,GAChC,IAAKC,EAAU,SACf,MAAMC,EAAOjB,EAAYgB,EAASd,MAClC,GAAIe,GAAMC,UAAW,OAAO,CAC7B,CACA,OAAO,CACR,CAGO,SAASC,EAAiBvB,EAAoBiB,GACpD,MAAMb,EAAcJ,EAAMK,OAAOD,YACjC,IAAKA,EAAa,OAAO,EACzB,MAAMF,EAAQF,EAAMG,SAASc,GAC7B,QAAKf,IACyC,IAAvCE,EAAYF,EAAMI,OAAOgB,SACjC,CAMO,SAASE,EAAsBxB,EAAoByB,EAAiBC,GAE1E,GAAIH,EAAiBvB,EAAOyB,IAAWF,EAAiBvB,EAAO0B,GAAO,OAAO,EAE7E,MAAMC,EAAsBX,EAAkBhB,EAAOyB,GAC/CG,EAAoBZ,EAAkBhB,EAAO0B,GAGnD,OAAIC,IAAeC,KAGfD,IAAcC,GAAiBpB,EAAaR,EAAOyB,EAAQC,GAGhE"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n}from"./Document-3pNX7ear.mjs";function i(i,r){if(0===r.length)return;let t=i.children.find(n=>n.id===r[0]);if(t){for(let i=1;i<r.length;i++){const e=r[i];if(!e)return;const o=t?.children.find(i=>n(i)&&i.id===e);if(!o)return;t=o}return t}}function r(r,t){if(0===t.length)return;if(1===t.length){const n=r.children.findIndex(n=>n.id===t[0]);if(-1===n)return;return{parent:r,index:n}}const e=i(r,t.slice(0,-1));if(!e)return;const o=t[t.length-1];if(!o)return;const f=e.children.findIndex(i=>n(i)&&i.id===o);return-1!==f?{parent:e,index:f}:void 0}function t(n,i){for(const r of n.children){if(r.id===i)return[i];const n=e(r,i);if(n)return[r.id,...n]}}function e(i,r){for(const t of i.children){if(!n(t))continue;if(t.id===r)return[r];const i=e(t,r);if(i)return[t.id,...i]}}function o(n,i){for(const r of n.children)f(r,[r.id],i)}function f(i,r,t){t(i,r);for(const e of i.children)n(e)&&f(e,[...r,e.id],t)}function c(n,i){for(const r of n.children){if(r.id===i)return r;const n=d(r,i);if(n)return n}}function d(i,r){for(const t of i.children){if(!n(t))continue;if(t.id===r)return t;const i=d(t,r);if(i)return i}}function u(n,r){const e=t(n,r);if(!e)return;const o=i(n,e);return o?{node:o,path:e}:void 0}export{t as a,u as b,r as c,c as f,i as r,o as w};
|
|
2
|
-
//# sourceMappingURL=NodeResolver-z0ReCR34.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeResolver-z0ReCR34.mjs","sources":["../../src/model/NodeResolver.ts"],"sourcesContent":["/**\n * Utilities for resolving nodes by path within the document tree.\n * Supports both flat and recursive (nested) document structures.\n */\n\nimport type { BlockNode, Document } from './Document.js';\nimport { isBlockNode } from './Document.js';\n\n/**\n * Resolves a node in the document tree by its path (array of block IDs).\n * The path traces the lineage from the root block down to the target.\n */\nexport function resolveNodeByPath(doc: Document, path: readonly string[]): BlockNode | undefined {\n\tif (path.length === 0) return undefined;\n\n\tlet current: BlockNode | undefined = doc.children.find((b) => b.id === path[0]);\n\tif (!current) return undefined;\n\n\tfor (let i = 1; i < path.length; i++) {\n\t\tconst childId = path[i];\n\t\tif (!childId) return undefined;\n\t\tconst next: BlockNode | undefined = current?.children.find(\n\t\t\t(c): c is BlockNode => isBlockNode(c) && c.id === childId,\n\t\t);\n\t\tif (!next) return undefined;\n\t\tcurrent = next;\n\t}\n\n\treturn current;\n}\n\n/**\n * Resolves the parent of a node at the given path.\n * Returns the parent container (Document or BlockNode) and the child's index within it.\n */\nexport function resolveParentByPath(\n\tdoc: Document,\n\tpath: readonly string[],\n): { parent: Document | BlockNode; index: number } | undefined {\n\tif (path.length === 0) return undefined;\n\n\tif (path.length === 1) {\n\t\tconst index = doc.children.findIndex((b) => b.id === path[0]);\n\t\tif (index === -1) return undefined;\n\t\treturn { parent: doc, index };\n\t}\n\n\tconst parentPath = path.slice(0, -1);\n\tconst parent = resolveNodeByPath(doc, parentPath);\n\tif (!parent) return undefined;\n\n\tconst childId = path[path.length - 1];\n\tif (!childId) return undefined;\n\tconst index = parent.children.findIndex(\n\t\t(c): c is BlockNode => isBlockNode(c) && c.id === childId,\n\t);\n\tif (index === -1) return undefined;\n\n\treturn { parent, index };\n}\n\n/**\n * Finds the path (array of block IDs) to a node by its ID.\n * Performs recursive DFS through the document tree.\n */\nexport function findNodePath(doc: Document, nodeId: string): string[] | undefined {\n\tfor (const block of doc.children) {\n\t\tif (block.id === nodeId) return [nodeId];\n\n\t\tconst subPath = findNodePathInBlock(block, nodeId);\n\t\tif (subPath) return [block.id, ...subPath];\n\t}\n\treturn undefined;\n}\n\nfunction findNodePathInBlock(block: BlockNode, nodeId: string): string[] | undefined {\n\tfor (const child of block.children) {\n\t\tif (!isBlockNode(child)) continue;\n\t\tif (child.id === nodeId) return [nodeId];\n\n\t\tconst subPath = findNodePathInBlock(child, nodeId);\n\t\tif (subPath) return [child.id, ...subPath];\n\t}\n\treturn undefined;\n}\n\n/**\n * Walks all block nodes in the document tree in depth-first order.\n * Visits every BlockNode, including nested ones, with their full path.\n */\nexport function walkNodes(\n\tdoc: Document,\n\tcallback: (node: BlockNode, path: string[]) => void,\n): void {\n\tfor (const block of doc.children) {\n\t\twalkNodeRecursive(block, [block.id], callback);\n\t}\n}\n\nfunction walkNodeRecursive(\n\tnode: BlockNode,\n\tpath: string[],\n\tcallback: (node: BlockNode, path: string[]) => void,\n): void {\n\tcallback(node, path);\n\tfor (const child of node.children) {\n\t\tif (isBlockNode(child)) {\n\t\t\twalkNodeRecursive(child, [...path, child.id], callback);\n\t\t}\n\t}\n}\n\n/**\n * Finds a block node by ID anywhere in the document tree (recursive DFS).\n */\nexport function findNode(doc: Document, nodeId: string): BlockNode | undefined {\n\tfor (const block of doc.children) {\n\t\tif (block.id === nodeId) return block;\n\t\tconst found = findNodeInBlock(block, nodeId);\n\t\tif (found) return found;\n\t}\n\treturn undefined;\n}\n\nfunction findNodeInBlock(block: BlockNode, nodeId: string): BlockNode | undefined {\n\tfor (const child of block.children) {\n\t\tif (!isBlockNode(child)) continue;\n\t\tif (child.id === nodeId) return child;\n\t\tconst found = findNodeInBlock(child, nodeId);\n\t\tif (found) return found;\n\t}\n\treturn undefined;\n}\n\n/**\n * Finds a block node and returns it together with its path.\n */\nexport function findNodeWithPath(\n\tdoc: Document,\n\tnodeId: string,\n): { node: BlockNode; path: string[] } | undefined {\n\tconst path = findNodePath(doc, nodeId);\n\tif (!path) return undefined;\n\tconst node = resolveNodeByPath(doc, path);\n\tif (!node) return undefined;\n\treturn { node, path };\n}\n"],"names":["resolveNodeByPath","doc","path","length","current","children","find","b","id","i","childId","next","c","isBlockNode","resolveParentByPath","index","findIndex","parent","slice","findNodePath","nodeId","block","subPath","findNodePathInBlock","child","walkNodes","callback","walkNodeRecursive","node","findNode","found","findNodeInBlock","findNodeWithPath"],"mappings":"uCAYO,SAASA,EAAkBC,EAAeC,GAChD,GAAoB,IAAhBA,EAAKC,OAAc,OAEvB,IAAIC,EAAiCH,EAAII,SAASC,KAAMC,GAAMA,EAAEC,KAAON,EAAK,IAC5E,GAAKE,EAAL,CAEA,IAAA,IAASK,EAAI,EAAGA,EAAIP,EAAKC,OAAQM,IAAK,CACrC,MAAMC,EAAUR,EAAKO,GACrB,IAAKC,EAAS,OACd,MAAMC,EAA8BP,GAASC,SAASC,KACpDM,GAAsBC,EAAYD,IAAMA,EAAEJ,KAAOE,GAEnD,IAAKC,EAAM,OACXP,EAAUO,CACX,CAEA,OAAOP,CAZc,CAatB,CAMO,SAASU,EACfb,EACAC,GAEA,GAAoB,IAAhBA,EAAKC,OAAc,OAEvB,GAAoB,IAAhBD,EAAKC,OAAc,CACtB,MAAMY,EAAQd,EAAII,SAASW,UAAWT,GAAMA,EAAEC,KAAON,EAAK,IAC1D,QAAIa,EAAc,OAClB,MAAO,CAAEE,OAAQhB,EAAKc,MAAAA,EACvB,CAEA,MACME,EAASjB,EAAkBC,EADdC,EAAKgB,MAAM,GAAG,IAEjC,IAAKD,EAAQ,OAEb,MAAMP,EAAUR,EAAKA,EAAKC,OAAS,GACnC,IAAKO,EAAS,OACd,MAAMK,EAAQE,EAAOZ,SAASW,UAC5BJ,GAAsBC,EAAYD,IAAMA,EAAEJ,KAAOE,GAEnD,WAAIK,EAEG,CAAEE,SAAQF,cAFjB,CAGD,CAMO,SAASI,EAAalB,EAAemB,GAC3C,IAAA,MAAWC,KAASpB,EAAII,SAAU,CACjC,GAAIgB,EAAMb,KAAOY,EAAQ,MAAO,CAACA,GAEjC,MAAME,EAAUC,EAAoBF,EAAOD,GAC3C,GAAIE,EAAS,MAAO,CAACD,EAAMb,MAAOc,EACnC,CAED,CAEA,SAASC,EAAoBF,EAAkBD,GAC9C,IAAA,MAAWI,KAASH,EAAMhB,SAAU,CACnC,IAAKQ,EAAYW,GAAQ,SACzB,GAAIA,EAAMhB,KAAOY,EAAQ,MAAO,CAACA,GAEjC,MAAME,EAAUC,EAAoBC,EAAOJ,GAC3C,GAAIE,EAAS,MAAO,CAACE,EAAMhB,MAAOc,EACnC,CAED,CAMO,SAASG,EACfxB,EACAyB,GAEA,IAAA,MAAWL,KAASpB,EAAII,SACvBsB,EAAkBN,EAAO,CAACA,EAAMb,IAAKkB,EAEvC,CAEA,SAASC,EACRC,EACA1B,EACAwB,GAEAA,EAASE,EAAM1B,GACf,IAAA,MAAWsB,KAASI,EAAKvB,SACpBQ,EAAYW,IACfG,EAAkBH,EAAO,IAAItB,EAAMsB,EAAMhB,IAAKkB,EAGjD,CAKO,SAASG,EAAS5B,EAAemB,GACvC,IAAA,MAAWC,KAASpB,EAAII,SAAU,CACjC,GAAIgB,EAAMb,KAAOY,EAAQ,OAAOC,EAChC,MAAMS,EAAQC,EAAgBV,EAAOD,GACrC,GAAIU,EAAO,OAAOA,CACnB,CAED,CAEA,SAASC,EAAgBV,EAAkBD,GAC1C,IAAA,MAAWI,KAASH,EAAMhB,SAAU,CACnC,IAAKQ,EAAYW,GAAQ,SACzB,GAAIA,EAAMhB,KAAOY,EAAQ,OAAOI,EAChC,MAAMM,EAAQC,EAAgBP,EAAOJ,GACrC,GAAIU,EAAO,OAAOA,CACnB,CAED,CAKO,SAASE,EACf/B,EACAmB,GAEA,MAAMlB,EAAOiB,EAAalB,EAAKmB,GAC/B,IAAKlB,EAAM,OACX,MAAM0B,EAAO5B,EAAkBC,EAAKC,GACpC,OAAK0B,EACE,CAAEA,OAAM1B,aADf,CAED"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{s as n,n as t,f as e}from"./Document-3pNX7ear.mjs";import{a as o}from"./NodeResolver-z0ReCR34.mjs";import{c as i,h as r,g as s,i as c,a as l,b as u}from"./Selection-DhbizDM4.mjs";import{b as d}from"./NavigationQueries-11qe4j9x.mjs";import{e as a,g as f,f as b,c as m,a as p}from"./CommandHelpers-M6mPS6Ww.mjs";function g(e,r){const s=o(e.doc,r.nodeId);if(!s)return null;const c=a(s),l=f(e,c),u=b(l,r.nodeId);if(u<0)return null;const d=e.transaction("input");if(1===l.length){const t=n();return d.insertNode(c,0,m(t)),d.removeNode(c,1),d.setSelection(i(t,0)),d.build()}d.removeNode(c,u);const g=l[u-1];if(g&&t(g)){const n=p(e,g.id,"end");if(n)return d.setSelection(n),d.build()}const I=l[u+1];if(I&&t(I)){const n=p(e,I.id,"start");if(n)return d.setSelection(n),d.build()}return d.build()}function I(t,e){const r=o(t.doc,e.nodeId);if(!r)return null;const s=a(r),c=f(t,s),l=b(c,e.nodeId);if(l<0)return null;const u=n(),d=t.transaction("input");return d.insertNode(s,l+1,m(u)),d.setSelection(i(u,0)),d.build()}function S(t,e,r,s){const c=o(t.doc,e.nodeId),l=a(c),u=f(t,l),d=b(u,e.nodeId),p=n(),g=t.transaction(s),I=d>=0?d+1:u.length;return g.insertNode(l,I,m(p)),g.insertText(p,0,r,[]),g.setSelection(i(p,r.length)),g.build()}function h(n,t,a){const f=n.selection,b=n.getBlockOrder(),m=!a||"left"!==t&&"right"!==t?t:"left"===t?"right":"left";return r(f)?function(n,t,r,s){const c=s.indexOf(t.nodeId),u=o(n.doc,t.nodeId)??[];if("left"===r||"up"===r){if(c>0){const o=s[c-1];if(!o)return null;if(d(n,o))return n.transaction("input").setSelection(l(t.nodeId,"before",u)).build();const r=n.getBlock(o),a=r?e(r):0;return n.transaction("input").setSelection(i(o,a)).build()}return n.transaction("input").setSelection(l(t.nodeId,"before",u)).build()}if(c<s.length-1){const e=s[c+1];return e?d(n,e)?n.transaction("input").setSelection(l(t.nodeId,"after",u)).build():n.transaction("input").setSelection(i(e,0)).build():null}return n.transaction("input").setSelection(l(t.nodeId,"after",u)).build()}(n,f,m,b):s(f)?null:c(f)?function(n,t,i,r){const s=r.indexOf(t.anchor.blockId),c=n.getBlock(t.anchor.blockId);if(!c)return null;const l=e(c);if(("right"===i||"down"===i)&&t.anchor.offset===l&&s<r.length-1){const t=r[s+1];if(t&&d(n,t)){const e=o(n.doc,t)??[];return n.transaction("input").setSelection(u(t,e)).build()}}if(("left"===i||"up"===i)&&0===t.anchor.offset&&s>0){const t=r[s-1];if(t&&d(n,t)){const e=o(n.doc,t)??[];return n.transaction("input").setSelection(u(t,e)).build()}}return null}(n,f,m,b):null}export{I as a,g as d,S as i,h as n};
|
|
2
|
-
//# sourceMappingURL=NodeSelectionCommands-CXrOcPtG.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeSelectionCommands-CXrOcPtG.mjs","sources":["../../src/commands/NodeSelectionCommands.ts"],"sourcesContent":["/**\n * Commands for NodeSelection: deleting void blocks, inserting paragraphs\n * after void blocks, and navigating arrow keys into/out of void blocks.\n */\n\nimport { generateBlockId, getBlockLength, isBlockNode } from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport type { NodeSelection } from '../model/Selection.js';\nimport {\n\tcreateCollapsedSelection,\n\tcreateGapCursor,\n\tcreateNodeSelection,\n\tisCollapsed,\n\tisGapCursor,\n\tisNodeSelection,\n} from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport { isVoidBlock } from '../state/NavigationQueries.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport {\n\tcreateEmptyParagraph,\n\tcreateSelectionForBlockBoundary,\n\textractParentPath,\n\tfindSiblingIndex,\n\tgetSiblings,\n} from './CommandHelpers.js';\n\nexport { findFirstLeafBlockId, findLastLeafBlockId } from './CommandHelpers.js';\n\n/**\n * Deletes the selected block and places cursor on a valid adjacent position.\n * If it is the only child in its parent, replaces it with an empty paragraph.\n */\nexport function deleteNodeSelection(state: EditorState, sel: NodeSelection): Transaction | null {\n\tconst path = findNodePath(state.doc, sel.nodeId);\n\tif (!path) return null;\n\n\tconst parentPath: BlockId[] = extractParentPath(path);\n\tconst siblings = getSiblings(state, parentPath);\n\n\tconst index: number = findSiblingIndex(siblings, sel.nodeId);\n\tif (index < 0) return null;\n\n\tconst builder = state.transaction('input');\n\n\t// Keep container invariants intact when removing the only child in any parent.\n\tif (siblings.length === 1) {\n\t\tconst newId = generateBlockId();\n\t\tbuilder.insertNode(parentPath, 0, createEmptyParagraph(newId));\n\t\tbuilder.removeNode(parentPath, 1);\n\t\tbuilder.setSelection(createCollapsedSelection(newId, 0));\n\t\treturn builder.build();\n\t}\n\n\tbuilder.removeNode(parentPath, index);\n\n\t// Prefer the previous sibling, matching Backspace/Delete semantics.\n\tconst prevSibling = siblings[index - 1];\n\tif (prevSibling && isBlockNode(prevSibling)) {\n\t\tconst selection = createSelectionForBlockBoundary(state, prevSibling.id, 'end');\n\t\tif (selection) {\n\t\t\tbuilder.setSelection(selection);\n\t\t\treturn builder.build();\n\t\t}\n\t}\n\n\tconst nextSibling = siblings[index + 1];\n\tif (nextSibling && isBlockNode(nextSibling)) {\n\t\tconst selection = createSelectionForBlockBoundary(state, nextSibling.id, 'start');\n\t\tif (selection) {\n\t\t\tbuilder.setSelection(selection);\n\t\t\treturn builder.build();\n\t\t}\n\t}\n\n\treturn builder.build();\n}\n\n/** Inserts a new paragraph after a NodeSelection-targeted void block. */\nexport function insertParagraphAfterNodeSelection(\n\tstate: EditorState,\n\tsel: NodeSelection,\n): Transaction | null {\n\tconst path = findNodePath(state.doc, sel.nodeId);\n\tif (!path) return null;\n\n\tconst parentPath: BlockId[] = extractParentPath(path);\n\tconst siblings = getSiblings(state, parentPath);\n\n\tconst index: number = findSiblingIndex(siblings, sel.nodeId);\n\tif (index < 0) return null;\n\n\tconst newId = generateBlockId();\n\tconst builder = state.transaction('input');\n\tbuilder.insertNode(parentPath, index + 1, createEmptyParagraph(newId));\n\tbuilder.setSelection(createCollapsedSelection(newId, 0));\n\treturn builder.build();\n}\n\n/** Inserts text in a new paragraph after a NodeSelection-targeted void block. */\nexport function insertTextAfterNodeSelection(\n\tstate: EditorState,\n\tsel: NodeSelection,\n\ttext: string,\n\torigin: 'input' | 'paste',\n): Transaction {\n\tconst path = findNodePath(state.doc, sel.nodeId);\n\tconst parentPath: BlockId[] = extractParentPath(path);\n\tconst siblings = getSiblings(state, parentPath);\n\n\tconst index: number = findSiblingIndex(siblings, sel.nodeId);\n\n\tconst newId = generateBlockId();\n\tconst builder = state.transaction(origin);\n\n\tconst insertIdx = index >= 0 ? index + 1 : siblings.length;\n\tbuilder.insertNode(parentPath, insertIdx, createEmptyParagraph(newId));\n\tbuilder.insertText(newId, 0, text, []);\n\tbuilder.setSelection(createCollapsedSelection(newId, text.length));\n\treturn builder.build();\n}\n\n/**\n * Navigates arrow keys into/out of void blocks.\n * Returns a transaction if navigation should create a NodeSelection, or null.\n *\n * @param isRtl — When true, flips left/right to account for RTL block direction.\n */\nexport function navigateArrowIntoVoid(\n\tstate: EditorState,\n\tdirection: 'left' | 'right' | 'up' | 'down',\n\tisRtl?: boolean,\n): Transaction | null {\n\tconst sel = state.selection;\n\tconst blockOrder = state.getBlockOrder();\n\tconst effectiveDir: 'left' | 'right' | 'up' | 'down' =\n\t\tisRtl && (direction === 'left' || direction === 'right')\n\t\t\t? direction === 'left'\n\t\t\t\t? 'right'\n\t\t\t\t: 'left'\n\t\t\t: direction;\n\n\t// If currently on a NodeSelection, navigate away from it\n\tif (isNodeSelection(sel)) {\n\t\treturn navigateAwayFromNodeSelection(state, sel, effectiveDir, blockOrder);\n\t}\n\n\t// GapCursor is handled by navigateFromGapCursor in CaretNavigation\n\tif (isGapCursor(sel)) return null;\n\n\t// Text selection: check if navigating into a void block\n\tif (!isCollapsed(sel)) return null;\n\n\treturn navigateIntoVoid(state, sel, effectiveDir, blockOrder);\n}\n\n// ---------------------------------------------------------------------------\n// Internal helpers\n// ---------------------------------------------------------------------------\n\n/** Handles navigation away from a NodeSelection (arrow keys while void is selected). */\nfunction navigateAwayFromNodeSelection(\n\tstate: EditorState,\n\tsel: NodeSelection,\n\tdirection: 'left' | 'right' | 'up' | 'down',\n\tblockOrder: readonly BlockId[],\n): Transaction | null {\n\tconst nodeIdx = blockOrder.indexOf(sel.nodeId);\n\tconst nodePath = (findNodePath(state.doc, sel.nodeId) ?? []) as BlockId[];\n\n\tif (direction === 'left' || direction === 'up') {\n\t\tif (nodeIdx > 0) {\n\t\t\tconst prevId = blockOrder[nodeIdx - 1];\n\t\t\tif (!prevId) return null;\n\t\t\tif (isVoidBlock(state, prevId)) {\n\t\t\t\treturn state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.setSelection(createGapCursor(sel.nodeId, 'before', nodePath))\n\t\t\t\t\t.build();\n\t\t\t}\n\t\t\tconst prevBlock = state.getBlock(prevId);\n\t\t\tconst prevLen = prevBlock ? getBlockLength(prevBlock) : 0;\n\t\t\treturn state\n\t\t\t\t.transaction('input')\n\t\t\t\t.setSelection(createCollapsedSelection(prevId, prevLen))\n\t\t\t\t.build();\n\t\t}\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.setSelection(createGapCursor(sel.nodeId, 'before', nodePath))\n\t\t\t.build();\n\t}\n\n\t// right or down\n\tif (nodeIdx < blockOrder.length - 1) {\n\t\tconst nextId = blockOrder[nodeIdx + 1];\n\t\tif (!nextId) return null;\n\t\tif (isVoidBlock(state, nextId)) {\n\t\t\treturn state\n\t\t\t\t.transaction('input')\n\t\t\t\t.setSelection(createGapCursor(sel.nodeId, 'after', nodePath))\n\t\t\t\t.build();\n\t\t}\n\t\treturn state.transaction('input').setSelection(createCollapsedSelection(nextId, 0)).build();\n\t}\n\treturn state\n\t\t.transaction('input')\n\t\t.setSelection(createGapCursor(sel.nodeId, 'after', nodePath))\n\t\t.build();\n}\n\n/** Handles text selection navigating into an adjacent void block. */\nfunction navigateIntoVoid(\n\tstate: EditorState,\n\tsel: { readonly anchor: { readonly blockId: BlockId; readonly offset: number } },\n\tdirection: 'left' | 'right' | 'up' | 'down',\n\tblockOrder: readonly BlockId[],\n): Transaction | null {\n\tconst blockIdx = blockOrder.indexOf(sel.anchor.blockId);\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return null;\n\tconst blockLen = getBlockLength(block);\n\n\tif (direction === 'right' || direction === 'down') {\n\t\tif (sel.anchor.offset === blockLen && blockIdx < blockOrder.length - 1) {\n\t\t\tconst nextId = blockOrder[blockIdx + 1];\n\t\t\tif (nextId && isVoidBlock(state, nextId)) {\n\t\t\t\tconst path = findNodePath(state.doc, nextId) ?? [];\n\t\t\t\treturn state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.setSelection(createNodeSelection(nextId, path as BlockId[]))\n\t\t\t\t\t.build();\n\t\t\t}\n\t\t}\n\t}\n\n\tif (direction === 'left' || direction === 'up') {\n\t\tif (sel.anchor.offset === 0 && blockIdx > 0) {\n\t\t\tconst prevId = blockOrder[blockIdx - 1];\n\t\t\tif (prevId && isVoidBlock(state, prevId)) {\n\t\t\t\tconst path = findNodePath(state.doc, prevId) ?? [];\n\t\t\t\treturn state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.setSelection(createNodeSelection(prevId, path as BlockId[]))\n\t\t\t\t\t.build();\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n"],"names":["deleteNodeSelection","state","sel","path","findNodePath","doc","nodeId","parentPath","extractParentPath","siblings","getSiblings","index","findSiblingIndex","builder","transaction","length","newId","generateBlockId","insertNode","createEmptyParagraph","removeNode","setSelection","createCollapsedSelection","build","prevSibling","isBlockNode","selection","createSelectionForBlockBoundary","id","nextSibling","insertParagraphAfterNodeSelection","insertTextAfterNodeSelection","text","origin","insertIdx","insertText","navigateArrowIntoVoid","direction","isRtl","blockOrder","getBlockOrder","effectiveDir","isNodeSelection","nodeIdx","indexOf","nodePath","prevId","isVoidBlock","createGapCursor","prevBlock","getBlock","prevLen","getBlockLength","nextId","navigateAwayFromNodeSelection","isGapCursor","isCollapsed","blockIdx","anchor","blockId","block","blockLen","offset","createNodeSelection","navigateIntoVoid"],"mappings":"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"}
|
|
@@ -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
|