@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,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=text-direction-advanced.mjs.map
|
|
1
|
+
import{a,i as s,n as t,o as e,t as i}from"../chunks/TextDirectionLocale-rlU1yNly.mjs";import{n,t as o}from"../chunks/text-direction-advanced-B5JuIs0P.mjs";export{o as DIRECTION_ICONS,i as TEXT_DIRECTION_LOCALE_EN,n as TextDirectionAdvancedPlugin,s as detectTextDirection,a as findSiblingDirection,e as getBlockDir,t as loadTextDirectionLocale};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=text-direction.mjs.map
|
|
1
|
+
import{a as s,i,n as o,o as t,t as a}from"../chunks/TextDirectionLocale-rlU1yNly.mjs";import{n as e,t as n}from"../chunks/TextDirectionCorePlugin-CyKw-C8X.mjs";export{n as DIRECTION_ICONS,a as TEXT_DIRECTION_LOCALE_EN,e as TextDirectionPlugin,i as detectTextDirection,s as findSiblingDirection,t as getBlockDir,o as loadTextDirectionLocale};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=text-formatting.mjs.map
|
|
1
|
+
import{n as t,r,t as s}from"../chunks/TextFormattingPlugin-xtQczzCs.mjs";export{t as TEXT_FORMATTING_LOCALE_EN,s as TextFormattingPlugin,r as loadTextFormattingLocale};
|
package/dist/plugins/toolbar.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{b as t}from"../chunks/Platform-CU6itXZo.mjs";import{S as e,r as o}from"../chunks/PluginHelpers-CdPR0MuT.mjs";import{f as n,n as r,a as i}from"../chunks/KeyboardNav-DsYhKKuV.mjs";import{P as l,a as s}from"../chunks/PopupManager-0b_Q0m7K.mjs";import{s as a,a as c}from"../chunks/StyleRuntime-BmsLoEa8.mjs";import{a as d}from"../chunks/PopupPositioning-DtvqMSop.mjs";class p{_toolbarItems=/* @__PURE__ */new Map;_toolbarItemPluginMap=/* @__PURE__ */new Map;registerToolbarItem(t,e){if(this._toolbarItems.has(t.id))throw new Error(`ToolbarItem with id "${t.id}" is already registered.`);if(this._toolbarItems.set(t.id,t),e){const o=this._toolbarItemPluginMap.get(e)??[];o.push(t.id),this._toolbarItemPluginMap.set(e,o)}}getToolbarItemsByPlugin(t){const e=this._toolbarItemPluginMap.get(t)??[],o=[];for(const n of e){const t=this._toolbarItems.get(n);t&&o.push(t)}return o}getToolbarItem(t){return this._toolbarItems.get(t)}getToolbarItems(){return[...this._toolbarItems.values()]}removeToolbarItem(t){this._toolbarItems.delete(t);for(const[e,o]of this._toolbarItemPluginMap){const n=o.indexOf(t);if(-1!==n){o.splice(n,1),0===o.length&&this._toolbarItemPluginMap.delete(e);break}}}clear(){this._toolbarItems.clear(),this._toolbarItemPluginMap.clear()}}function u(t){for(let e=0;e<t.length;e++)if(!t[e]?.disabled)return e;return-1}const h={formattingOptionsAria:"Formatting options",moreToolsAria:"More tools",gridPickerLabel:(t,e)=>`${t} x ${e}`},b=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("../chunks/ar-D7PS3e2g.mjs"),"./locales/de.ts":()=>import("../chunks/de-BZWSyJTG.mjs"),"./locales/es.ts":()=>import("../chunks/es-Co4AJr8Y.mjs"),"./locales/fr.ts":()=>import("../chunks/fr-CEkk4UyZ.mjs"),"./locales/hi.ts":()=>import("../chunks/hi-CPuhj7IA.mjs"),"./locales/pt.ts":()=>import("../chunks/pt-CQRzEocL.mjs"),"./locales/ru.ts":()=>import("../chunks/ru-ClEM6OKY.mjs"),"./locales/zh.ts":()=>import("../chunks/zh-DCQZ6gss.mjs")});async function m(t){if("en"===t)return h;const e=b[`./locales/${t}.ts`];if(!e)return h;try{return(await e()).default}catch{return h}}const f={BurgerMenu:"burger-menu",Flow:"flow",None:"none"},v="notectl-toolbar-btn--overflow-hidden",g="notectl-toolbar-separator--overflow-hidden";class w{toolbar;context;onOverflowChange;onItemActivated;getActiveElement;ariaLabel;popupManager;entries=[];overflowButton=null;overflowDropdown=null;overflowHandle=null;overflowEntries=[];resizeObserver=null;closeHandler=null;closeHandlerTimer=null;closeHandlerAttached=!1;constructor(t){this.toolbar=t.toolbar,this.ariaLabel=t.ariaLabel,this.context=t.context,this.onOverflowChange=t.onOverflowChange,this.onItemActivated=t.onItemActivated,this.getActiveElement=t.getActiveElement,this.popupManager=t.popupManager??null,this.resizeObserver=new ResizeObserver(()=>this.recalculate()),this.resizeObserver.observe(this.toolbar)}update(t){this.entries=t.map(t=>({element:t.element,item:t.item})),this.recalculate()}recalculate(){if(0===this.entries.length)return;this.closeDropdown(),this.resetVisibility(),this.ensureOverflowButton(),this.setOverflowButtonVisible(!1);const t=this.measureAvailableWidth(),e=Array.from(this.toolbar.children),o=this.measureChildWidths(e),n=t-34-2;let r=0,i=!1;const l=[];for(const s of e){if(s===this.overflowButton)continue;if(s.classList.contains("notectl-toolbar-separator")){if(i){s.classList.add(g);continue}const t=(o.get(s)??0)+2;r+t>n?(i=!0,s.classList.add(g)):r+=t;continue}const t=this.entries.find(t=>t.element===s);if(!t)continue;if(i){t.element.classList.add(v),l.push(t);continue}const e=(o.get(s)??0)+2;r+e>n?(i=!0,t.element.classList.add(v),l.push(t)):r+=e}this.overflowEntries=l,this.hideTrailingSeparators(),this.setOverflowButtonVisible(l.length>0),this.notifyChange()}updateItemStates(t){if(!this.overflowDropdown)return;const e=Array.from(this.overflowDropdown.querySelectorAll(".notectl-dropdown__item"));for(const o of e){const e=o.getAttribute("data-toolbar-item"),n=this.overflowEntries.find(t=>t.item.id===e);if(!n)continue;const r=n.item.isActive?.(t)??!1,i=n.item.isEnabled?.(t)??!0;if(o.classList.toggle("notectl-dropdown__item--active",r),o.disabled=!i,"combobox"===n.item.popupType){const e=o.querySelector(".notectl-dropdown__item-label");e&&(e.textContent=n.item.getLabel(t))}if(n.item.getIcon){const e=n.item.getIcon(t),r=o.querySelector(".notectl-dropdown__item-icon");r&&r.innerHTML!==e&&(r.innerHTML=e)}}}destroy(){this.resizeObserver?.disconnect(),this.resizeObserver=null,this.closeDropdown(),this.overflowButton?.remove(),this.overflowButton=null,this.entries=[],this.overflowEntries=[]}measureChildWidths(t){const e=/* @__PURE__ */new Map;for(const o of t)o!==this.overflowButton&&e.set(o,o.offsetWidth);return e}measureAvailableWidth(){const t=getComputedStyle(this.toolbar),e=Number.parseFloat(t.paddingLeft)||0,o=Number.parseFloat(t.paddingRight)||0;return this.toolbar.clientWidth-e-o}resetVisibility(){for(const e of this.entries)e.element.classList.remove(v);const t=Array.from(this.toolbar.querySelectorAll(".notectl-toolbar-separator"));for(const e of t)e.classList.remove(g)}setOverflowButtonVisible(t){this.overflowButton&&(this.overflowButton.classList.toggle("notectl-toolbar-overflow-btn--hidden",!t),t||this.overflowButton.removeAttribute("tabindex"))}ensureOverflowButton(){if(this.overflowButton)return;const t=document.createElement("button");t.type="button",t.className="notectl-toolbar-overflow-btn",t.setAttribute("aria-label",this.ariaLabel),t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false"),t.innerHTML='<svg viewBox="0 0 16 16" width="16" height="16"><circle cx="3" cy="8" r="1.5" fill="currentColor"/><circle cx="8" cy="8" r="1.5" fill="currentColor"/><circle cx="13" cy="8" r="1.5" fill="currentColor"/></svg>',t.addEventListener("mousedown",t=>{t.preventDefault(),this.toggleDropdown()}),this.toolbar.appendChild(t),this.overflowButton=t}toggleDropdown(){this.overflowDropdown?this.closeDropdown():this.openDropdown()}openDropdown(){if(!this.overflowButton||0===this.overflowEntries.length)return;const t=document.createElement("div");t.className="notectl-toolbar-popup notectl-dropdown",t.setAttribute("role","menu"),this.renderDropdownItems(t,this.context.getState()),this.popupManager?(this.overflowHandle=this.popupManager.open({anchor:this.overflowButton,className:"notectl-toolbar-popup notectl-dropdown",ariaRole:"menu",position:"below-end",referenceNode:this.overflowButton,restoreFocusTo:this.overflowButton,onClose:()=>{this.overflowHandle=null,this.overflowDropdown=null,this.overflowButton&&this.overflowButton.setAttribute("aria-expanded","false")},content:t=>{this.renderDropdownItems(t,this.context.getState()),this.overflowDropdown=t,t.addEventListener("keydown",t=>this.handleDropdownKeydown(t))}}),this.overflowButton.setAttribute("aria-expanded","true")):(this.positionDropdown(t),d(t,this.overflowButton),this.overflowDropdown=t,this.overflowButton.setAttribute("aria-expanded","true"),requestAnimationFrame(()=>{const e=t.querySelector('[role="menuitem"]');e?.focus()}),t.addEventListener("keydown",t=>this.handleDropdownKeydown(t)),this.registerCloseHandler())}renderDropdownItems(t,e){let o=null;for(const n of this.overflowEntries){if(null!==o&&n.item.group!==o){const e=document.createElement("div");e.className="notectl-dropdown__separator",e.setAttribute("role","separator"),t.appendChild(e)}o=n.item.group;const r=document.createElement("button");r.type="button",r.className="notectl-dropdown__item",r.setAttribute("role","menuitem"),r.setAttribute("tabindex","-1"),r.setAttribute("data-toolbar-item",n.item.id);const i=document.createElement("span");i.className="notectl-dropdown__item-icon","combobox"!==n.item.popupType&&(i.innerHTML=n.item.icon),r.appendChild(i);const l=document.createElement("span");l.className="notectl-dropdown__item-label",l.textContent="combobox"===n.item.popupType?n.item.getLabel(e):n.item.tooltip??n.item.label,r.appendChild(l),r.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),this.activateOverflowItem(n)}),t.appendChild(r)}}positionDropdown(e){if(!this.overflowButton)return;const o=this.overflowButton.getBoundingClientRect();if(t(this.toolbar))a(e,{position:"fixed",top:`${o.bottom+2}px`,left:`${o.left}px`,right:"auto",zIndex:"10000"});else{const t=window.innerWidth-o.right;a(e,{position:"fixed",top:`${o.bottom+2}px`,right:`${t}px`,left:"auto",zIndex:"10000"})}}registerCloseHandler(){this.closeHandler=t=>{const e=t.composedPath();this.overflowDropdown&&!e.includes(this.overflowDropdown)&&this.overflowButton&&!e.includes(this.overflowButton)&&this.closeDropdown()},this.closeHandlerTimer=setTimeout(()=>{this.closeHandlerTimer=null,this.closeHandler&&this.overflowDropdown&&(document.addEventListener("mousedown",this.closeHandler),this.closeHandlerAttached=!0)},0)}closeDropdown(){if(this.overflowHandle){const t=this.overflowHandle;return this.overflowHandle=null,this.overflowDropdown=null,t.close(),void(this.overflowButton&&this.overflowButton.setAttribute("aria-expanded","false"))}this.overflowDropdown&&(this.overflowDropdown.remove(),this.overflowDropdown=null),this.overflowButton&&this.overflowButton.setAttribute("aria-expanded","false"),this.closeHandler&&(null!==this.closeHandlerTimer&&(clearTimeout(this.closeHandlerTimer),this.closeHandlerTimer=null),this.closeHandlerAttached&&(document.removeEventListener("mousedown",this.closeHandler),this.closeHandlerAttached=!1),this.closeHandler=null)}activateOverflowItem(t){this.closeDropdown(),t.item.popupType&&this.overflowButton?this.onItemActivated(this.overflowButton,t.item):this.context.executeCommand(t.item.command)}handleDropdownKeydown(t){if(!this.overflowDropdown)return;if("Escape"===t.key||"Tab"===t.key)return t.preventDefault(),t.stopPropagation(),this.closeDropdown(),void this.overflowButton?.focus();const e=Array.from(this.overflowDropdown.querySelectorAll('[role="menuitem"]')),o=e.indexOf(this.getActiveElement());switch(t.key){case"ArrowDown":{t.preventDefault();const r=n(e,o,1);e[r]?.focus();break}case"ArrowUp":{t.preventDefault();const r=n(e,o,-1);e[r]?.focus();break}case"Enter":case" ":{t.preventDefault();const n=e[o];if(!n)break;const r=n.getAttribute("data-toolbar-item"),i=this.overflowEntries.find(t=>t.item.id===r);i&&this.activateOverflowItem(i);break}}}hideTrailingSeparators(){const t=Array.from(this.toolbar.children);for(let e=t.length-1;e>=0;e--){const o=t[e];if(o&&o!==this.overflowButton)if(o.classList.contains("notectl-toolbar-separator"))o.classList.contains(g)||o.classList.add(g);else if(!o.classList.contains(v))break}}notifyChange(){const t=this.entries.filter(t=>!t.element.classList.contains(v)).map(t=>t.element);this.onOverflowChange(t,this.overflowEntries.length>0?this.overflowButton:null)}}function x(t,e,o){const n=t.querySelectorAll(".notectl-grid-picker__cell");for(const r of n){const t=Number(r.getAttribute("data-row")),n=Number(r.getAttribute("data-col"));r.classList.toggle("notectl-grid-picker__cell--highlighted",t<=e&&n<=o)}}function y(){const t=document.createElement("span");return t.className="notectl-toolbar-separator",t.setAttribute("role","separator"),t}class E{activePopup=null;activePopupButton=null;activeHandle=null;getActiveElement;locale;popupManager=null;constructor(t,e=h){this.getActiveElement=t,this.locale=e}setPopupManager(t){this.popupManager=t}isOpen(){return null!==this.activePopup}toggle(t,e,o){this.activePopup?this.close():this.openViaManager(t,e,o)}close(){if(this.activeHandle){const t=this.activeHandle;return this.activeHandle=null,this.clearButtonState(),void t.close()}this.clearButtonState(),this.activePopup&&(this.activePopup.remove(),this.activePopup=null)}closeAndRestoreFocus(){const t=this.activePopupButton;this.close(),t?.focus()}destroy(){this.close()}openViaManager(t,e,o){this.popupManager&&(this.activePopupButton=t,t.classList.add("notectl-toolbar-btn--popup-open"),t.setAttribute("aria-expanded","true"),this.activeHandle=this.popupManager.open({anchor:t,className:"notectl-toolbar-popup",referenceNode:t,restoreFocusTo:t,position:"below-start",onClose:()=>{this.activeHandle=null,this.clearButtonState(),this.activePopup=null},content:(t,n)=>{this.activePopup=t,this.renderPopupContent(t,e,o,n),t.addEventListener("keydown",t=>this.handlePopupKeydown(t))}}))}renderPopupContent(t,e,o,n){const r=()=>{n({restoreFocusTo:null}),o.getContainer().focus()};switch(e.popupType){case"gridPicker":!function(t,e,o,n=h){t.className+=" notectl-grid-picker";const r=document.createElement("div");r.className="notectl-grid-picker__grid",r.setAttribute("role","grid"),a(r,{display:"grid",gridTemplateColumns:`repeat(${e.maxCols}, 1fr)`,gap:"2px",padding:"8px"});const i=document.createElement("div");i.className="notectl-grid-picker__label",i.textContent=n.gridPickerLabel(1,1),a(i,{textAlign:"center",padding:"4px",fontSize:"12px"}),i.setAttribute("aria-live","polite");for(let l=1;l<=e.maxRows;l++)for(let t=1;t<=e.maxCols;t++){const s=document.createElement("div");s.className="notectl-grid-picker__cell",s.setAttribute("role","gridcell"),s.setAttribute("tabindex","-1"),s.setAttribute("aria-label",n.gridPickerLabel(l,t)),a(s,{width:"20px",height:"20px",border:"1px solid #ccc",cursor:"pointer"}),s.setAttribute("data-row",String(l)),s.setAttribute("data-col",String(t)),s.addEventListener("mouseenter",()=>{x(r,l,t),i.textContent=n.gridPickerLabel(l,t)}),s.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),s.addEventListener("click",()=>{e.onSelect(l,t),o()}),r.appendChild(s)}t.appendChild(r),t.appendChild(i)}(t,e.popupConfig,r,this.locale);break;case"dropdown":!function(t,e,n,r){t.classList.add("notectl-dropdown"),t.setAttribute("role","menu");for(const i of e.items){const e=document.createElement("button");if(e.type="button",e.className="notectl-dropdown__item",e.setAttribute("role","menuitem"),e.setAttribute("tabindex","-1"),i.icon){const t=document.createElement("span");t.className="notectl-dropdown__item-icon",t.innerHTML=i.icon,e.appendChild(t)}const n=document.createElement("span");n.className="notectl-dropdown__item-label",n.textContent=i.label,e.appendChild(n),e.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),e.addEventListener("click",()=>{var t;t=i.command,o.executeCommand(t),r()}),t.appendChild(e)}}(t,e.popupConfig,0,r);break;case"custom":case"combobox":e.renderPopup(t,o,n)}}clearButtonState(){this.activePopupButton&&(this.activePopupButton.classList.remove("notectl-toolbar-btn--popup-open"),this.activePopupButton.setAttribute("aria-expanded","false"),this.activePopupButton=null)}handlePopupKeydown(t){if(!this.activePopup)return;if("Escape"===t.key)return t.preventDefault(),t.stopPropagation(),void this.closeAndRestoreFocus();if("Tab"===t.key)return t.preventDefault(),void this.closeAndRestoreFocus();const e=this.activePopup.querySelectorAll('[role="menuitem"]');e.length>0?this.handleDropdownKeydown(t,e):null!==this.activePopup.querySelector(".notectl-grid-picker__cell")?this.handleGridKeydown(t):this.handleCustomPopupKeydown(t)}handleDropdownKeydown(t,e){const o=Array.from(e),r=o.indexOf(this.getActiveElement());switch(t.key){case"ArrowDown":{t.preventDefault();const e=n(o,r,1);o[e]?.focus();break}case"ArrowUp":{t.preventDefault();const e=n(o,r,-1);o[e]?.focus();break}case"Enter":case" ":{t.preventDefault();const e=o[r];e&&e.click();break}}}handleGridKeydown(e){const o=this.getActiveElement(),n=Number(o?.getAttribute("data-row")??1),i=Number(o?.getAttribute("data-col")??1),l=this.activePopup?.querySelector(".notectl-grid-picker__grid")??null;if(!l)return;const s=l.querySelector(".notectl-grid-picker__cell:last-child"),a=Number(s?.getAttribute("data-col")??1),c=Number(s?.getAttribute("data-row")??1);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)){e.preventDefault();const[o,s]=r(n,i,c,a,e.key,!!this.activePopup&&t(this.activePopup)),d=l.querySelector(`.notectl-grid-picker__cell[data-row="${o}"][data-col="${s}"]`);d?.focus(),x(l,o,s);const p=this.activePopup?.querySelector(".notectl-grid-picker__label")??null;p&&(p.textContent=this.locale.gridPickerLabel(o,s))}"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),o?.click())}handleCustomPopupKeydown(t){if(!this.activePopup)return;const e=Array.from(this.activePopup.querySelectorAll("button"));if(0===e.length)return;const o=this.getActiveElement(),r=e.indexOf(o);switch(t.key){case"ArrowDown":{t.preventDefault();const o=n(e,r,1);e[o]?.focus();break}case"ArrowUp":{t.preventDefault();const o=n(e,r,-1);e[o]?.focus();break}case"Enter":case" ":t.preventDefault(),o&&o.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0}))}}}class A{element;timer=null;target=null;isPopupActive;static TOOLTIP_ID="notectl-toolbar-tooltip";constructor(t){this.isPopupActive=t,this.element=document.createElement("div"),this.element.className="notectl-toolbar-tooltip",this.element.id=A.TOOLTIP_ID,this.element.setAttribute("role","tooltip"),c(this.element,"display","none")}show(t){if(this.hide(),this.isPopupActive()||t.disabled)return;const e=t.getAttribute("data-tooltip");e&&(this.target=t,this.timer=setTimeout(()=>{if(this.isPopupActive())return;this.element.textContent=e,c(this.element,"display","");const o=t.getRootNode();o instanceof ShadowRoot&&!this.element.parentNode?o.appendChild(this.element):o instanceof ShadowRoot||this.element.parentNode||document.body.appendChild(this.element),t.setAttribute("aria-describedby",A.TOOLTIP_ID);const n=t.getBoundingClientRect();a(this.element,{position:"fixed",top:`${n.bottom+6}px`,left:`${n.left+n.width/2}px`,transform:"translateX(-50%)"})},500))}hide(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.target&&(this.target.removeAttribute("aria-describedby"),this.target=null),c(this.element,"display","none")}destroy(){this.hide(),this.element.remove()}}const k=new e("toolbar");class _{id="toolbar";name="Toolbar";priority=10;context=null;toolbarElement=null;buttons=[];hiddenItems=/* @__PURE__ */new Set;layoutConfig;overflowBehavior;focusedIndex=0;tooltip=null;popupController=null;popupManager=null;overflowController=null;visibleElements=[];locale;constructor(t){this.layoutConfig=t??null,this.overflowBehavior=t?.overflow??f.BurgerMenu}async init(t){this.locale=await o(t,void 0,h,m),t.registerStyleSheet('\n/* Toolbar */\n.notectl-plugin-container--top {\n\tdisplay: flex;\n\talign-items: center;\n\tflex-wrap: nowrap;\n\tborder-bottom: 1px solid var(--notectl-border);\n\tbackground: var(--notectl-toolbar-bg, var(--notectl-surface-raised));\n\tmin-height: 40px;\n}\n\n.notectl-toolbar {\n\tdisplay: flex;\n\talign-items: center;\n\tflex-wrap: nowrap;\n\toverflow: hidden;\n\tflex: 1;\n\tmin-width: 0;\n\tgap: 2px;\n\tpadding: 4px 8px;\n}\n\n.notectl-toolbar[hidden] {\n\tdisplay: none;\n}\n\n.notectl-toolbar-btn {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 32px;\n\theight: 32px;\n\tborder: 1px solid transparent;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcursor: pointer;\n\tcolor: var(--notectl-fg);\n\tfont-size: 14px;\n\tline-height: 1;\n\tpadding: 0;\n\tflex-shrink: 0;\n\ttransition: background 0.1s, border-color 0.1s;\n}\n\n@media (hover: hover) {\n\t.notectl-toolbar-btn:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t\tborder-color: var(--notectl-border);\n\t}\n}\n\n.notectl-toolbar-btn--active {\n\tbackground: var(--notectl-active-bg);\n\tborder-color: var(--notectl-primary-muted);\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-toolbar-btn:focus-visible {\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n\toutline: none;\n}\n\n.notectl-toolbar-btn:disabled {\n\topacity: 0.4;\n\tcursor: not-allowed;\n}\n\n@media (hover: hover) {\n\t.notectl-toolbar-btn:disabled:hover {\n\t\tbackground: transparent;\n\t\tborder-color: transparent;\n\t}\n}\n\n.notectl-toolbar-btn__icon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpointer-events: none;\n}\n\n.notectl-toolbar-btn__icon svg {\n\tdisplay: block;\n\twidth: 18px;\n\theight: 18px;\n\tfill: currentColor;\n}\n\n/* Tooltip (rendered as fixed-position element in shadow root) */\n.notectl-toolbar-tooltip {\n\tposition: fixed;\n\tpadding: 4px 8px;\n\tborder-radius: 4px;\n\tbackground: var(--notectl-tooltip-bg);\n\tcolor: var(--notectl-tooltip-fg);\n\tfont-size: 11px;\n\tfont-weight: 500;\n\twhite-space: nowrap;\n\tpointer-events: none;\n\tz-index: 10001;\n\tline-height: 1.4;\n\tletter-spacing: 0.01em;\n\tfont-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif;\n}\n\n.notectl-toolbar-separator {\n\tdisplay: inline-block;\n\twidth: 1px;\n\theight: 20px;\n\tbackground: var(--notectl-border);\n\tmargin: 0 4px;\n\tvertical-align: middle;\n}\n\n/* Toolbar Popups */\n.notectl-toolbar-popup {\n\tbackground: var(--notectl-surface-overlay);\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 6px;\n\tbox-shadow: 0 4px 12px var(--notectl-shadow);\n\toverflow: hidden;\n}\n\n/* Grid Picker */\n.notectl-grid-picker__cell:focus-visible {\n\toutline: 2px solid var(--notectl-focus-ring);\n\toutline-offset: -1px;\n}\n\n.notectl-grid-picker__cell--highlighted {\n\tbackground: var(--notectl-primary-muted);\n\tborder-color: var(--notectl-primary);\n}\n\n/* Dropdown */\n.notectl-dropdown {\n\tmin-width: 160px;\n\tpadding: 4px 0;\n}\n\n.notectl-dropdown__item {\n\tdisplay: flex;\n\talign-items: center;\n\twidth: 100%;\n\tpadding: 8px 12px;\n\ttext-align: start;\n\tborder: none;\n\tbackground: none;\n\tcursor: pointer;\n\tfont-size: 14px;\n\tcolor: var(--notectl-fg);\n\tline-height: 1.4;\n\tfont-family: inherit;\n\twhite-space: nowrap;\n}\n\n@media (hover: hover) {\n\t.notectl-dropdown__item:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t}\n}\n\n.notectl-dropdown__item:focus-visible {\n\tbackground: var(--notectl-hover-bg);\n\toutline: none;\n}\n\n.notectl-dropdown__item-icon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 28px;\n\tfont-weight: 600;\n\tcolor: var(--notectl-fg-muted);\n\tflex-shrink: 0;\n}\n\n.notectl-dropdown__item-label {\n\tflex: 1;\n}\n\n/* Overflow behavior: flow mode — toolbar wraps to additional rows */\n.notectl-toolbar[data-overflow="flow"] {\n\tflex-wrap: wrap;\n\toverflow: visible;\n}\n\n/* Overflow behavior: none — toolbar clips without any responsive behavior */\n.notectl-toolbar[data-overflow="none"] {\n\tflex-wrap: nowrap;\n\toverflow: hidden;\n}\n\n/* Overflow: hidden items (burger-menu mode) */\n.notectl-toolbar-btn--overflow-hidden,\n.notectl-toolbar-separator--overflow-hidden {\n\tdisplay: none;\n}\n\n/* Overflow "more" button */\n.notectl-toolbar-overflow-btn {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 32px;\n\theight: 32px;\n\tborder: 1px solid transparent;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcursor: pointer;\n\tcolor: var(--notectl-fg);\n\tfont-size: 16px;\n\tline-height: 1;\n\tpadding: 0;\n\tflex-shrink: 0;\n\tmargin-inline-start: auto;\n\ttransition: background 0.1s, border-color 0.1s;\n}\n\n@media (hover: hover) {\n\t.notectl-toolbar-overflow-btn:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t\tborder-color: var(--notectl-border);\n\t}\n}\n\n.notectl-toolbar-overflow-btn--hidden {\n\tdisplay: none;\n}\n\n.notectl-toolbar-overflow-btn:focus-visible {\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n\toutline: none;\n}\n\n/* Dropdown item states shared by all dropdown menus (including overflow) */\n.notectl-dropdown__item:disabled {\n\topacity: 0.4;\n\tcursor: not-allowed;\n}\n\n@media (hover: hover) {\n\t.notectl-dropdown__item:disabled:hover {\n\t\tbackground: none;\n\t}\n}\n\n.notectl-dropdown__item--active {\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-dropdown__item-icon svg {\n\tdisplay: block;\n\twidth: 16px;\n\theight: 16px;\n\tfill: currentColor;\n}\n\n.notectl-dropdown__separator {\n\theight: 1px;\n\tbackground: var(--notectl-border);\n\tmargin: 4px 0;\n}\n\n/* Combobox-style toolbar buttons (shared base for font, fontSize, heading, etc.) */\n.notectl-toolbar-btn[role="combobox"] {\n\twidth: auto;\n\tpadding: 0 8px;\n\tgap: 4px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-bg);\n}\n\n@media (hover: hover) {\n\t.notectl-toolbar-btn[role="combobox"]:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t\tborder-color: var(--notectl-fg-muted);\n\t}\n}\n\n.notectl-toolbar-btn[role="combobox"].notectl-toolbar-btn--active {\n\tbackground: var(--notectl-bg);\n\tborder-color: var(--notectl-primary-muted);\n}\n\n.notectl-toolbar-combobox__label {\n\tflex: 1;\n\tfont-size: 13px;\n\tfont-weight: 500;\n\tcolor: var(--notectl-fg);\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\ttext-align: start;\n\tline-height: 30px;\n}\n\n.notectl-toolbar-combobox__arrow {\n\tflex-shrink: 0;\n\tfont-size: 11px;\n\tcolor: var(--notectl-fg-muted);\n\tline-height: 30px;\n}\n\n/* Link Popup */\n.notectl-link-popup {\n\tpadding: 8px;\n\tmin-width: 200px;\n}\n\n.notectl-link-popup__input {\n\twidth: 100%;\n\tpadding: 4px;\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tfont-size: 13px;\n\tcolor: var(--notectl-fg);\n\tbackground: var(--notectl-bg);\n}\n\n.notectl-link-popup__input:focus-visible {\n\toutline: 2px solid var(--notectl-focus-ring);\n\toutline-offset: -1px;\n}\n\n.notectl-link-popup__button {\n\twidth: 100%;\n\tpadding: 6px 12px;\n\tcursor: pointer;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-bg);\n\tcolor: var(--notectl-fg);\n\tfont-size: 13px;\n}\n\n.notectl-link-popup__button--apply {\n\tmargin-top: 4px;\n}\n\n@media (hover: hover) {\n\t.notectl-link-popup__button:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t}\n}\n\n.notectl-link-popup__button:focus-visible {\n\toutline: 2px solid var(--notectl-focus-ring);\n\toutline-offset: -1px;\n}\n'),this.context=t,this.popupManager=new l(t.getContainer()),t.registerService(s,this.popupManager),this.popupController=new E(()=>this.getActiveElement(),this.locale),this.popupController.setPopupManager(this.popupManager),this.tooltip=new A(()=>this.popupController?.isOpen()??!1),t.registerService(k,{refresh:()=>this.updateButtonStates(t.getState()),closePopup:()=>this.popupController?.close()}),this.createToolbarElement()}getOverflowBehavior(){return this.overflowBehavior}setOverflowBehavior(t){t!==this.overflowBehavior&&(this.overflowBehavior=t,this.applyOverflowBehavior(),this.renderItems())}onReady(){this.renderItems()}destroy(){this.overflowController?.destroy(),this.overflowController=null,this.popupController?.destroy(),this.popupController=null,this.popupManager?.destroy(),this.popupManager=null,this.tooltip?.destroy(),this.tooltip=null,this.toolbarElement&&(this.toolbarElement.remove(),this.toolbarElement=null),this.buttons=[],this.visibleElements=[],this.context=null}onStateChange(t,e,o){this.updateButtonStates(e)}onReadOnlyChange(t){this.toolbarElement&&(this.toolbarElement.hidden=t)}onConfigure(t){for(const[e,o]of Object.entries(t))!1===o?this.hiddenItems.add(e):this.hiddenItems.delete(e);this.renderItems()}createToolbarElement(){if(!this.context)return;this.toolbarElement&&this.toolbarElement.remove(),this.buttons=[];const t=this.context.getPluginContainer("top");this.toolbarElement=document.createElement("div"),this.toolbarElement.setAttribute("role","toolbar"),this.toolbarElement.setAttribute("aria-label",this.locale.formattingOptionsAria),this.toolbarElement.setAttribute("data-notectl-no-print",""),this.toolbarElement.className="notectl-toolbar",this.toolbarElement.addEventListener("keydown",t=>this.handleToolbarKeydown(t)),this.applyOverflowBehavior(),t.appendChild(this.toolbarElement)}applyOverflowBehavior(){this.toolbarElement&&this.context&&(this.overflowController?.destroy(),this.overflowController=null,this.toolbarElement.setAttribute("data-overflow",this.overflowBehavior),this.overflowBehavior===f.BurgerMenu?this.overflowController=new w({toolbar:this.toolbarElement,ariaLabel:this.locale.moreToolsAria,context:this.context,popupManager:this.popupManager??void 0,onOverflowChange:(t,e)=>{this.visibleElements=e?[...t,e]:[...t],this.initRovingTabindex()},onItemActivated:(t,e)=>{this.activateButton(t,e)},getActiveElement:()=>this.getActiveElement()}):this.visibleElements=[])}renderItems(){if(this.context&&this.toolbarElement){for(const t of this.buttons)t.element.remove();this.buttons=[];for(const t of this.toolbarElement.querySelectorAll(".notectl-toolbar-separator"))t.remove();this.layoutConfig?this.renderItemsByLayout():this.renderItemsByGroup(),this.buttons.length>0&&!this.toolbarElement.parentElement&&this.context.getPluginContainer("top").appendChild(this.toolbarElement),this.overflowController?.update(this.buttons),this.initRovingTabindex(),this.updateButtonStates(this.context.getState())}}getTabElements(){return this.visibleElements.length>0?this.visibleElements:this.buttons.map(t=>t.element)}initRovingTabindex(){const t=this.getTabElements(),e=u(t);this.focusedIndex=e>=0?e:0,i(t,this.focusedIndex)}setRovingFocus(t){const e=this.getTabElements();t<0||t>=e.length||(this.focusedIndex=t,i(e,t),e[t]?.focus())}getActiveElement(){const t=this.toolbarElement?.getRootNode();return t instanceof ShadowRoot?t.activeElement:document.activeElement}syncFocusedIndex(){const t=this.getActiveElement(),e=this.getTabElements().findIndex(e=>e===t);e>=0&&(this.focusedIndex=e)}handleToolbarKeydown(e){const o=this.getTabElements();var n;if(0!==o.length)switch(this.syncFocusedIndex(),e.key){case"ArrowRight":case"ArrowLeft":{e.preventDefault();const r=(n=!!this.toolbarElement&&t(this.toolbarElement),"ArrowRight"===e.key?n?-1:1:n?1:-1),i=function(t,e,o){const n=t.length;if(0===n)return-1;let r=e;for(let i=0;i<n;i++)if(r=(r+o+n)%n,!t[r]?.disabled)return r;return e}(o,this.focusedIndex,r);this.setRovingFocus(i);break}case"Home":{e.preventDefault();const t=u(o);t>=0&&this.setRovingFocus(t);break}case"End":{e.preventDefault();const t=function(t){for(let e=t.length-1;e>=0;e--)if(!t[e]?.disabled)return e;return-1}(o);t>=0&&this.setRovingFocus(t);break}case"Enter":case" ":{e.preventDefault();const t=o[this.focusedIndex],n=this.buttons.find(e=>e.element===t);n&&this.activateButton(n.element,n.item);break}}}activateButton(t,e){this.tooltip?.hide(),e.popupType&&this.context?this.popupController?.toggle(t,e,this.context):this.context?.executeCommand(e.command)}renderItemsByLayout(){if(!this.context||!this.toolbarElement||!this.layoutConfig)return;const t=this.context.getToolbarRegistry();let e=!0;for(const o of this.layoutConfig.groups){const n=[];for(const e of o){const o=t.getToolbarItemsByPlugin(e).filter(t=>!this.hiddenItems.has(t.id));n.push(...o)}if(0!==n.length){e||this.toolbarElement.appendChild(y()),e=!1;for(const t of n){const e=this.createButton(t);this.toolbarElement.appendChild(e.element),this.buttons.push(e)}}}0===this.buttons.length&&this.toolbarElement.remove()}renderItemsByGroup(){if(!this.context||!this.toolbarElement)return;const t=this.context.getToolbarRegistry().getToolbarItems().filter(t=>!this.hiddenItems.has(t.id));if(0===t.length)return void this.toolbarElement.remove();const e=/* @__PURE__ */new Map;for(const n of t){const t=e.get(n.group)??[];t.push(n),e.set(n.group,t)}let o=!0;for(const[,n]of e){o||this.toolbarElement.appendChild(y()),o=!1;for(const t of n){const e=this.createButton(t);this.toolbarElement.appendChild(e.element),this.buttons.push(e)}}}createButton(t){const e=document.createElement("button");e.type="button",e.className=`notectl-toolbar-btn notectl-toolbar-btn--${t.id}`,e.setAttribute("aria-pressed","false"),e.setAttribute("aria-label",t.label),e.setAttribute("data-toolbar-item",t.id),e.setAttribute("data-tooltip",t.tooltip??t.label);let o=null;if("combobox"===t.popupType){e.setAttribute("role","combobox"),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-expanded","false");const n=document.createElement("span");n.className="notectl-toolbar-combobox__label";const r=this.context?.getState();r&&(n.textContent=t.getLabel(r)),e.appendChild(n),o=n;const i=document.createElement("span");i.className="notectl-toolbar-combobox__arrow",i.setAttribute("aria-hidden","true"),i.textContent="▾",e.appendChild(i)}else{t.popupType&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false"));const o=document.createElement("span");o.className="notectl-toolbar-btn__icon",o.innerHTML=t.icon,e.appendChild(o)}return e.addEventListener("mousedown",o=>{o.preventDefault(),this.activateButton(e,t)}),e.addEventListener("mouseenter",()=>this.tooltip?.show(e)),e.addEventListener("mouseleave",()=>this.tooltip?.hide()),e.addEventListener("focus",()=>this.tooltip?.show(e)),e.addEventListener("blur",()=>this.tooltip?.hide()),{element:e,item:t,comboLabelEl:o}}updateButtonStates(t){for(const e of this.buttons){const o=e.item.isActive?.(t)??!1,n=e.item.isEnabled?.(t)??!0;if(e.element.setAttribute("aria-pressed",String(o)),e.element.classList.toggle("notectl-toolbar-btn--active",o),e.element.disabled=!n,n?e.element.removeAttribute("aria-disabled"):e.element.setAttribute("aria-disabled","true"),e.comboLabelEl&&"combobox"===e.item.popupType&&(e.comboLabelEl.textContent=e.item.getLabel(t)),e.item.getIcon){const o=e.item.getIcon(t),n=e.element.querySelector(".notectl-toolbar-btn__icon");n&&n.innerHTML!==o&&(n.innerHTML=o)}}this.overflowController?.updateItemStates(t)}}export{h as TOOLBAR_LOCALE_EN,f as ToolbarOverflowBehavior,_ as ToolbarPlugin,p as ToolbarRegistry,k as ToolbarServiceKey,m as loadToolbarLocale};
|
|
2
|
-
//# sourceMappingURL=toolbar.mjs.map
|
|
1
|
+
import{a,i as s,n as o,o as r,r as i,t as m}from"../chunks/ToolbarPlugin-BFEniyH-.mjs";export{s as TOOLBAR_LOCALE_EN,i as ToolbarOverflowBehavior,m as ToolbarPlugin,r as ToolbarRegistry,o as ToolbarServiceKey,a as loadToolbarLocale};
|
package/dist/presets/full.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=full.mjs.map
|
|
1
|
+
import{t as m}from"../chunks/full-216JgIG1.mjs";export{m as createFullPreset};
|
package/dist/presets/minimal.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=minimal.mjs.map
|
|
1
|
+
import{t as m}from"../chunks/minimal-D-QxXO1C.mjs";export{m as createMinimalPreset};
|
package/dist/presets.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=presets.mjs.map
|
|
1
|
+
import{t as m}from"./chunks/minimal-D-QxXO1C.mjs";import{t as s}from"./chunks/full-216JgIG1.mjs";export{s as createFullPreset,m as createMinimalPreset};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@notectl/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "A modern and accessible rich text editor shipped as a single Web Component. Immutable state, transaction-based architecture, and a plugin system that powers every feature.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -367,11 +367,11 @@
|
|
|
367
367
|
"devDependencies": {
|
|
368
368
|
"@size-limit/preset-small-lib": "^12.0.0",
|
|
369
369
|
"happy-dom": "^20.7.0",
|
|
370
|
-
"rollup-plugin-visualizer": "^
|
|
370
|
+
"rollup-plugin-visualizer": "^7.0.1",
|
|
371
371
|
"size-limit": "^12.0.0",
|
|
372
372
|
"terser": "^5.46.0",
|
|
373
|
-
"vite": "^
|
|
373
|
+
"vite": "^8.0.0",
|
|
374
374
|
"vite-plugin-dts": "^4.5.4",
|
|
375
|
-
"vitest": "^4.0
|
|
375
|
+
"vitest": "^4.1.0"
|
|
376
376
|
}
|
|
377
377
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AttrRegistry-iNpjvcSG.mjs","sources":["../../src/model/AttrRegistry.ts"],"sourcesContent":["/**\n * Module-augmentable attribute registries for type-safe node/mark attributes.\n *\n * Plugins extend these interfaces via `declare module`:\n * @example\n * declare module '../../model/AttrRegistry.js' {\n * interface NodeAttrRegistry {\n * heading: { level: HeadingLevel; align?: BlockAlignment };\n * }\n * }\n */\n\nimport type { BlockAlignment } from './BlockAlignment.js';\nimport type { BlockNode, InlineNode, Mark } from './Document.js';\nimport { isInlineNode } from './Document.js';\n\n/** Plugins augment this interface to register typed node attributes. */\nexport interface NodeAttrRegistry {\n\tparagraph: { align?: BlockAlignment };\n}\n\n/** Plugins augment this interface to register typed mark attributes. */\nexport interface MarkAttrRegistry {\n\tbold: Record<string, never>;\n\titalic: Record<string, never>;\n\tunderline: Record<string, never>;\n}\n\n/** Resolves typed attributes for known node types, falls back for unknown. */\nexport type NodeAttrsFor<T extends string> = T extends keyof NodeAttrRegistry\n\t? NodeAttrRegistry[T]\n\t: Record<string, string | number | boolean>;\n\n/** Resolves typed attributes for known mark types, falls back for unknown. */\nexport type MarkAttrsFor<T extends string> = T extends keyof MarkAttrRegistry\n\t? MarkAttrRegistry[T]\n\t: Record<string, string | number | boolean>;\n\n/** Narrows a BlockNode to a typed variant with known attributes. */\nexport function isNodeOfType<T extends keyof NodeAttrRegistry>(\n\tnode: BlockNode,\n\ttype: T,\n): node is BlockNode & { readonly type: T; readonly attrs: NodeAttrRegistry[T] } {\n\treturn (node.type as string) === type;\n}\n\n/** Narrows a Mark to a typed variant with known attributes. */\nexport function isMarkOfType<T extends keyof MarkAttrRegistry>(\n\tmark: Mark,\n\ttype: T,\n): mark is Mark & { readonly type: T; readonly attrs: MarkAttrRegistry[T] } {\n\treturn (mark.type as string) === type;\n}\n\n// --- InlineNode Attribute Registry ---\n\n/** Plugins augment this interface to register typed inline node attributes. */\n// biome-ignore lint/suspicious/noEmptyInterface: module augmentation requires interface\nexport interface InlineNodeAttrRegistry {}\n\n/** Resolves typed attributes for known inline node types, falls back for unknown. */\nexport type InlineNodeAttrsFor<T extends string> = T extends keyof InlineNodeAttrRegistry\n\t? InlineNodeAttrRegistry[T]\n\t: Record<string, string | number | boolean>;\n\n/** Narrows an InlineNode to a typed variant with known attributes. */\nexport function isInlineNodeOfType<T extends keyof InlineNodeAttrRegistry>(\n\tnode: InlineNode,\n\tinlineNodeType: T,\n): node is InlineNode & {\n\treadonly inlineType: T;\n\treadonly attrs: InlineNodeAttrRegistry[T];\n} {\n\treturn isInlineNode(node) && (node.inlineType as string) === inlineNodeType;\n}\n"],"names":["isNodeOfType","node","type","isMarkOfType","mark","isInlineNodeOfType","inlineNodeType","isInlineNode","inlineType"],"mappings":"4CAuCO,SAASA,EACfC,EACAC,GAEA,OAAQD,EAAKC,OAAoBA,CAClC,CAGO,SAASC,EACfC,EACAF,GAEA,OAAQE,EAAKF,OAAoBA,CAClC,CAcO,SAASG,EACfJ,EACAK,GAKA,OAAOC,EAAaN,IAAUA,EAAKO,aAA0BF,CAC9D"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./AttrRegistry-iNpjvcSG.mjs";import{h as n,m as o,k as r,q as e}from"./Document-3pNX7ear.mjs";import{j as s,i as c,s as a}from"./Selection-DhbizDM4.mjs";import{m as i}from"./TypeBrands-Bp_Z_o5Y.mjs";import{f as l}from"./RangeIterator-XFN5FaYf.mjs";function f(t,o){const r=t.selection;if(!s(r))return null;const e=i(o.type);if(c(r)){const s=t.getBlock(r.anchor.blockId);if(!s)return null;const c=[...(t.storedMarks??n(s,r.anchor.offset)).filter(t=>t.type!==e),o];return t.transaction("command").setStoredMarks(c,t.storedMarks).setSelection(r).build()}const f=a(r,t.getBlockOrder()),u=t.transaction("command");return l(t,f,(n,r,s)=>{const c=t.getBlock(n);if(c){const t=k(c,e,r,s);t&&u.removeMark(n,r,s,t)}u.addMark(n,r,s,o)}),u.setSelection(r),u.build()}function u(t,r){const e=t.selection;if(!s(e))return null;if(c(e)){const s=t.getBlock(e.anchor.blockId);if(!s)return null;const c=t.storedMarks??n(s,e.anchor.offset);if(!o(c,r))return null;const a=c.filter(t=>t.type!==r);return t.transaction("command").setStoredMarks(a,t.storedMarks).setSelection(e).build()}const i=a(e,t.getBlockOrder()),f=t.transaction("command");return l(t,i,(n,o,e)=>{const s=t.getBlock(n),c=s?k(s,r,o,e):void 0;f.removeMark(n,o,e,c??{type:r})}),f.setSelection(e),f.build()}function m(o,r,e){const a=o.selection;if(!s(a))return null;if(c(a)&&o.storedMarks){const n=o.storedMarks.find(t=>t.type===r);return n&&t(n,r)?e(n):null}const i=o.getBlock(a.anchor.blockId);if(!i)return null;const l=n(i,a.anchor.offset).find(t=>t.type===r);return l&&t(l,r)?e(l):null}function d(t,n){return null!==m(t,n,()=>!0)}function k(t,n,o,s){const c=r(t);let a=0;for(const r of c){if(!e(r)){a+=1;continue}const t=a+r.text.length;if(t>o&&a<s){const t=r.marks.find(t=>t.type===n);if(t)return t}a=t}}export{f as a,m as g,d as i,u as r};
|
|
2
|
-
//# sourceMappingURL=AttributedMarkCommands-BY1BSYWM.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AttributedMarkCommands-BY1BSYWM.mjs","sources":["../../src/commands/AttributedMarkCommands.ts"],"sourcesContent":["/**\n * Generic helpers for attributed marks (marks with key/value attrs).\n *\n * Unlike boolean marks (`bold`, `italic`) that toggle on/off, attributed\n * marks (`font`, `fontSize`, `textColor`, `highlight`) carry data and use\n * **replace** semantics: applying a new value removes the old one first.\n *\n * These helpers extract the duplicated collapsed-vs-range branching that\n * was previously copy-pasted across ColorMarkOperations, FontSizeOperations,\n * and FontPlugin.\n */\n\nimport { isMarkOfType } from '../model/AttrRegistry.js';\nimport type { MarkAttrRegistry } from '../model/AttrRegistry.js';\nimport type { BlockNode, Mark, TextNode } from '../model/Document.js';\nimport {\n\tgetBlockMarksAtOffset,\n\tgetInlineChildren,\n\thasMark,\n\tisTextNode,\n} from '../model/Document.js';\nimport type { InlineNode } from '../model/Document.js';\nimport { isCollapsed, isTextSelection, selectionRange } from '../model/Selection.js';\nimport { markType } from '../model/TypeBrands.js';\nimport type { MarkTypeName } 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/**\n * Applies an attributed mark to the current selection.\n *\n * - **Collapsed cursor**: replaces stored marks (filters out old mark of the\n * same type, appends the new one).\n * - **Range selection**: removes then re-adds the mark in every block span.\n *\n * Returns the built `Transaction`, or `null` when the selection is\n * unsupported (node-selection / gap-cursor) or the anchor block is missing.\n */\nexport function applyAttributedMark(state: EditorState, mark: Mark): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst typeName: MarkTypeName = markType(mark.type as string);\n\n\tif (isCollapsed(sel)) {\n\t\tconst anchorBlock = state.getBlock(sel.anchor.blockId);\n\t\tif (!anchorBlock) return null;\n\t\tconst currentMarks: readonly Mark[] =\n\t\t\tstate.storedMarks ?? getBlockMarksAtOffset(anchorBlock, sel.anchor.offset);\n\t\tconst withoutMark: readonly Mark[] = currentMarks.filter((m) => m.type !== typeName);\n\t\tconst newMarks: readonly Mark[] = [...withoutMark, 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\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst builder = state.transaction('command');\n\n\tforEachBlockInRange(state, range, (blockId, from, to) => {\n\t\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\t\tif (block) {\n\t\t\tconst existing: Mark | undefined = findMarkInRange(block, typeName, from, to);\n\t\t\tif (existing) {\n\t\t\t\tbuilder.removeMark(blockId, from, to, existing);\n\t\t\t}\n\t\t}\n\t\tbuilder.addMark(blockId, from, to, mark);\n\t});\n\n\tbuilder.setSelection(sel);\n\treturn builder.build();\n}\n\n/**\n * Removes an attributed mark from the current selection.\n *\n * - **Collapsed cursor**: filters the mark out of stored marks.\n * Returns `null` when the mark was not present.\n * - **Range selection**: removes the mark across all block spans.\n *\n * Returns the built `Transaction`, or `null` when the selection is\n * unsupported or the mark is absent at a collapsed cursor.\n */\nexport function removeAttributedMark(\n\tstate: EditorState,\n\tmarkTypeName: MarkTypeName,\n): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tif (isCollapsed(sel)) {\n\t\tconst anchorBlock = state.getBlock(sel.anchor.blockId);\n\t\tif (!anchorBlock) return null;\n\t\tconst currentMarks: readonly Mark[] =\n\t\t\tstate.storedMarks ?? getBlockMarksAtOffset(anchorBlock, sel.anchor.offset);\n\t\tif (!hasMark(currentMarks, markTypeName)) return null;\n\n\t\tconst newMarks: readonly Mark[] = currentMarks.filter((m) => m.type !== markTypeName);\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\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst builder = state.transaction('command');\n\n\tforEachBlockInRange(state, range, (blockId, from, to) => {\n\t\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\t\tconst existing: Mark | undefined = block\n\t\t\t? findMarkInRange(block, markTypeName, from, to)\n\t\t\t: undefined;\n\t\tbuilder.removeMark(blockId, from, to, existing ?? { type: markTypeName });\n\t});\n\n\tbuilder.setSelection(sel);\n\treturn builder.build();\n}\n\n/**\n * Extracts a typed attribute value from the mark at the current selection.\n *\n * Looks at stored marks (collapsed w/ stored), block marks at cursor offset\n * (collapsed w/o stored), or anchor-block marks (range).\n *\n * @param extractFn — Narrows the found mark and returns the desired value,\n * or `null` when the mark's attrs don't match expectations.\n */\nexport function getMarkAttrAtSelection<K extends keyof MarkAttrRegistry, V>(\n\tstate: EditorState,\n\tmarkTypeName: K,\n\textractFn: (mark: Mark & { readonly type: K; readonly attrs: MarkAttrRegistry[K] }) => V | null,\n): V | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tif (isCollapsed(sel) && state.storedMarks) {\n\t\tconst found = state.storedMarks.find((m) => (m.type as string) === markTypeName);\n\t\treturn found && isMarkOfType(found, markTypeName) ? extractFn(found) : null;\n\t}\n\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return null;\n\tconst marks: readonly Mark[] = getBlockMarksAtOffset(block, sel.anchor.offset);\n\tconst found = marks.find((m) => (m.type as string) === markTypeName);\n\treturn found && isMarkOfType(found, markTypeName) ? extractFn(found) : null;\n}\n\n/**\n * Returns `true` when the given attributed mark type is present at the\n * current selection (collapsed or range).\n */\nexport function isAttributedMarkActive<K extends keyof MarkAttrRegistry>(\n\tstate: EditorState,\n\tmarkTypeName: K,\n): boolean {\n\treturn getMarkAttrAtSelection(state, markTypeName, () => true as const) !== null;\n}\n\n/**\n * Finds the first mark of the given type within an offset range of a block.\n *\n * Returns the full mark (including attrs) so callers can pass it to\n * `removeMark` for correct undo inversion, or `undefined` when absent.\n */\nfunction findMarkInRange(\n\tblock: BlockNode,\n\ttypeName: MarkTypeName,\n\tfrom: number,\n\tto: number,\n): Mark | undefined {\n\tconst children: readonly (TextNode | InlineNode)[] = getInlineChildren(block);\n\tlet pos = 0;\n\n\tfor (const child of children) {\n\t\tif (!isTextNode(child)) {\n\t\t\tpos += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tconst nodeEnd: number = pos + child.text.length;\n\t\tif (nodeEnd > from && pos < to) {\n\t\t\tconst found: Mark | undefined = child.marks.find((m) => m.type === typeName);\n\t\t\tif (found) return found;\n\t\t}\n\t\tpos = nodeEnd;\n\t}\n\treturn undefined;\n}\n"],"names":["applyAttributedMark","state","mark","sel","selection","isTextSelection","typeName","markType","type","isCollapsed","anchorBlock","getBlock","anchor","blockId","newMarks","storedMarks","getBlockMarksAtOffset","offset","filter","m","transaction","setStoredMarks","setSelection","build","range","selectionRange","getBlockOrder","builder","forEachBlockInRange","from","to","block","existing","findMarkInRange","removeMark","addMark","removeAttributedMark","markTypeName","currentMarks","hasMark","getMarkAttrAtSelection","extractFn","found","find","isMarkOfType","isAttributedMarkActive","children","getInlineChildren","pos","child","isTextNode","nodeEnd","text","length","marks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/B,MAAMY,EAA0BO,EAAMK,MAAMX,KAAMxB,GAAMA,EAAEX,OAASF,GACnE,GAAIoC,EAAO,OAAOA,CACnB,CACAM,EAAMG,CACP,CAED"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as t,s as n,c as e,i as o,e as r,d as s}from"./Document-3pNX7ear.mjs";import{a as i}from"./NodeResolver-z0ReCR34.mjs";import{h as c,g as a}from"./Selection-DhbizDM4.mjs";import{n as f,i as u}from"./TypeBrands-Bp_Z_o5Y.mjs";import{e as d,g as p,f as m}from"./CommandHelpers-M6mPS6Ww.mjs";function l(t,n,e){const o=i(t.doc,n),r=d(o),s=p(t,r),c=m(s,n);if(!(c<0))return{parentPath:r,anchorIndex:c,isAnchorEmpty:b(t,n,e)}}function h(n,e,o,r){const s=i(n.doc,o);if(!s)return;const c=n.getBlock(o);return c?{parentPath:s,anchorIndex:c.children.findIndex(n=>t(n)&&n.id===e),isAnchorEmpty:b(n,e,r)}:void 0}function y(t,n){const e=t.getBlock(n);if("table_cell"===e?.type)return n;const o=i(t.doc,n);if(o)for(const r of o){const n=t.getBlock(r);if("table_cell"===n?.type)return r}}function g(t){return c(t)?t.nodeId:a(t)?t.blockId:t.anchor.blockId}function x(t,n,e,o,r,s){const i=y(t,e);if(i){const r=h(t,e,i,s);if(!r)return!1;const c=r.anchorIndex+1;n.insertNode(r.parentPath,c,o),r.isAnchorEmpty&&r.anchorIndex>=0&&n.removeNode(r.parentPath,r.anchorIndex)}else{const i=l(t,e,s);if(!i)return!1;const c=a(r)&&"before"===r.side?0:1;n.insertNode(i.parentPath,i.anchorIndex+c,o),i.isAnchorEmpty&&!a(r)&&n.removeNode(i.parentPath,i.anchorIndex)}return!0}function I(o,r){const s=o.children.map(e=>t(e)?I(e,n()):e);return e(o.type,s,r,o.attrs)}function k(n,e){if(n.id===e)return n;for(const o of n.children){if(!t(o))continue;const n=k(o,e);if(n)return n}}function v(t,n){if(!n)return;const e={};let o=!1;for(const r of Object.keys(n)){const s=n[r],i=t?.[r];"string"==typeof i||"number"==typeof i||"boolean"==typeof i?e[r]=i:void 0!==s.default&&(e[r]=s.default),r in e&&(o=!0)}return o?e:void 0}function b(t,n,e){const r=t.getBlock(n);if(!r)return!1;const s=e?.getNodeSpec(r.type);return!s?.isVoid&&""===o(r)}function N(t,n){if(!t.type)return;if(!n)return t;const e=n.getNodeSpec(t.type);if(!e)return;const o=v(t.attrs,e.attrs),r=t.segments?function(t,n){const e=[];for(const o of t){if("inline"===o.kind){const t=n.getInlineNodeSpec(o.inlineType);if(!t)continue;const r=v(o.attrs,t.attrs);e.push({kind:"inline",inlineType:o.inlineType,...r?{attrs:r}:{}});continue}e.push(o)}return e}(t.segments,n):void 0;return{...t,...o?{attrs:o}:{},...r?{segments:r}:t.segments?{segments:[]}:{}}}function j(t){const o=n(),i=function(t,n){return t.segments&&t.segments.length>0?function(t){const n=[];for(const e of t){if("inline"===e.kind){n.push(s(u(e.inlineType),e.attrs));continue}if(0===e.text.length)continue;const t=e.marks.map(t=>({type:t.type,...t.attrs?{attrs:t.attrs}:{}}));n.push(r(e.text,t))}return n}(t.segments):n?[r(n)]:void 0}(t,t.text??""),c=t.attrs?t.attrs:void 0;return e(f(t.type),i,o,c)}export{y as a,h as b,I as c,j as d,g as e,k as f,x as i,l as r,v as s,N as v};
|
|
2
|
-
//# sourceMappingURL=BlockInsertion-BJFhE0jA.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BlockInsertion-BJFhE0jA.mjs","sources":["../../src/commands/BlockInsertion.ts"],"sourcesContent":["/**\n * Block insertion utilities for paste and clipboard operations.\n *\n * Provides context resolution (parent path, anchor index, empty detection)\n * for inserting blocks into the document tree — both at root level and\n * inside table cells. Also contains pure helpers for block cloning,\n * recursive lookup, and attribute sanitization against a NodeSpec.\n */\n\nimport {\n\ttype BlockAttrs,\n\ttype BlockNode,\n\ttype ChildNode,\n\ttype InlineNode,\n\ttype Mark,\n\ttype TextNode,\n\tcreateBlockNode,\n\tcreateInlineNode,\n\tcreateTextNode,\n\tgenerateBlockId,\n\tgetBlockText,\n\tisBlockNode,\n} from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport type { AttrSpec } from '../model/NodeSpec.js';\nimport type { RichBlockData, RichSegment } from '../model/RichBlockData.js';\nimport type { SchemaRegistry } from '../model/SchemaRegistry.js';\nimport type { EditorSelection } from '../model/Selection.js';\nimport { isGapCursor, isNodeSelection } from '../model/Selection.js';\nimport type { BlockId, NodeTypeName } from '../model/TypeBrands.js';\nimport { inlineType, nodeType } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport type { TransactionBuilder } from '../state/Transaction.js';\nimport { extractParentPath, findSiblingIndex, getSiblings } from './CommandHelpers.js';\n\n/**\n * Resolved insertion target within the document tree.\n * Contains everything needed to insert blocks at a specific anchor position.\n */\nexport interface InsertionContext {\n\treadonly parentPath: readonly BlockId[];\n\treadonly anchorIndex: number;\n\treadonly isAnchorEmpty: boolean;\n}\n\n/**\n * Resolves an insertion context for root-level (or nested-parent-level) insertion.\n * Computes the parent path, anchor index among siblings, and whether the anchor is empty.\n */\nexport function resolveRootInsertionContext(\n\tstate: EditorState,\n\tanchorBlockId: BlockId,\n\tschemaRegistry?: SchemaRegistry,\n): InsertionContext | undefined {\n\tconst path: readonly string[] | undefined = findNodePath(state.doc, anchorBlockId);\n\tconst parentPath: BlockId[] = extractParentPath(path);\n\n\tconst siblings: readonly ChildNode[] = getSiblings(state, parentPath);\n\tconst anchorIndex: number = findSiblingIndex(siblings, anchorBlockId);\n\tif (anchorIndex < 0) return undefined;\n\n\tconst isAnchorEmpty: boolean = isBlockEmpty(state, anchorBlockId, schemaRegistry);\n\treturn { parentPath, anchorIndex, isAnchorEmpty };\n}\n\n/**\n * Resolves an insertion context within a table cell.\n * The parent path points to the cell itself; siblings are the cell's children.\n */\nexport function resolveCellInsertionContext(\n\tstate: EditorState,\n\tanchorBlockId: BlockId,\n\tcellId: BlockId,\n\tschemaRegistry?: SchemaRegistry,\n): InsertionContext | undefined {\n\tconst cellPath: BlockId[] | undefined = findNodePath(state.doc, cellId) as BlockId[] | undefined;\n\tif (!cellPath) return undefined;\n\n\tconst cell: BlockNode | undefined = state.getBlock(cellId);\n\tif (!cell) return undefined;\n\n\tconst anchorIndex: number = cell.children.findIndex(\n\t\t(c) => isBlockNode(c) && c.id === anchorBlockId,\n\t);\n\n\tconst isAnchorEmpty: boolean = isBlockEmpty(state, anchorBlockId, schemaRegistry);\n\treturn { parentPath: cellPath, anchorIndex, isAnchorEmpty };\n}\n\n/**\n * Finds a table_cell ancestor for the given block.\n * Walks the node path upward, returning the first table_cell BlockId found.\n */\nexport function findTableCellAncestor(state: EditorState, blockId: BlockId): BlockId | undefined {\n\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\tif (block?.type === 'table_cell') return blockId;\n\n\tconst path: BlockId[] | undefined = findNodePath(state.doc, blockId) as BlockId[] | undefined;\n\tif (!path) return undefined;\n\n\tfor (const id of path) {\n\t\tconst node: BlockNode | undefined = state.getBlock(id as BlockId);\n\t\tif (node?.type === 'table_cell') return id as BlockId;\n\t}\n\treturn undefined;\n}\n\n/**\n * Resolves the anchor block ID from the current editor selection.\n * Handles text selection, node selection, and gap cursor uniformly.\n */\nexport function resolveAnchorBlockId(selection: EditorSelection): BlockId {\n\tif (isNodeSelection(selection)) return selection.nodeId;\n\tif (isGapCursor(selection)) return selection.blockId;\n\treturn selection.anchor.blockId;\n}\n\n/**\n * Inserts a block node after the anchor position, resolving cell vs root context.\n * Removes the anchor block if it is empty (matching standard paste behavior).\n * Returns true on success, false if context resolution fails.\n */\nexport function insertBlockAfterAnchor(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tanchorBlockId: BlockId,\n\tblock: BlockNode,\n\tselection: EditorSelection,\n\tschemaRegistry?: SchemaRegistry,\n): boolean {\n\tconst cellId: BlockId | undefined = findTableCellAncestor(state, anchorBlockId);\n\n\tif (cellId) {\n\t\tconst ctx: InsertionContext | undefined = resolveCellInsertionContext(\n\t\t\tstate,\n\t\t\tanchorBlockId,\n\t\t\tcellId,\n\t\t\tschemaRegistry,\n\t\t);\n\t\tif (!ctx) return false;\n\n\t\tconst insertIndex: number = ctx.anchorIndex + 1;\n\t\tbuilder.insertNode(ctx.parentPath, insertIndex, block);\n\n\t\tif (ctx.isAnchorEmpty && ctx.anchorIndex >= 0) {\n\t\t\tbuilder.removeNode(ctx.parentPath, ctx.anchorIndex);\n\t\t}\n\t} else {\n\t\tconst ctx: InsertionContext | undefined = resolveRootInsertionContext(\n\t\t\tstate,\n\t\t\tanchorBlockId,\n\t\t\tschemaRegistry,\n\t\t);\n\t\tif (!ctx) return false;\n\n\t\tconst insertOffset: number = isGapCursor(selection) && selection.side === 'before' ? 0 : 1;\n\t\tbuilder.insertNode(ctx.parentPath, ctx.anchorIndex + insertOffset, block);\n\n\t\tif (ctx.isAnchorEmpty && !isGapCursor(selection)) {\n\t\t\tbuilder.removeNode(ctx.parentPath, ctx.anchorIndex);\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/** Recursively clones a block tree, assigning new IDs to all block nodes. */\nexport function cloneBlockWithNewIds(block: BlockNode, newId: BlockId): BlockNode {\n\tconst children = block.children.map((child) => {\n\t\tif (isBlockNode(child)) {\n\t\t\treturn cloneBlockWithNewIds(child, generateBlockId());\n\t\t}\n\t\treturn child;\n\t});\n\treturn createBlockNode(block.type, children, newId, block.attrs);\n}\n\n/** Recursively searches a block tree for a block with the given ID (DFS). */\nexport function findBlockRecursive(block: BlockNode, blockId: BlockId): BlockNode | undefined {\n\tif (block.id === blockId) return block;\n\tfor (const child of block.children) {\n\t\tif (!isBlockNode(child)) continue;\n\t\tconst found: BlockNode | undefined = findBlockRecursive(child, blockId);\n\t\tif (found) return found;\n\t}\n\treturn undefined;\n}\n\n/**\n * Validates incoming attributes against the declared AttrSpec.\n * Only keys declared in the spec are kept; non-primitive values fall back to defaults.\n */\nexport function sanitizeAttrs(\n\tincoming: Record<string, unknown> | undefined,\n\tspecAttrs: Readonly<Record<string, AttrSpec>> | undefined,\n): Record<string, string | number | boolean> | undefined {\n\tif (!specAttrs) return undefined;\n\n\tconst result: Record<string, string | number | boolean> = {};\n\tlet hasKeys = false;\n\n\tfor (const key of Object.keys(specAttrs)) {\n\t\tconst spec: AttrSpec = specAttrs[key] as AttrSpec;\n\t\tconst raw: unknown = incoming?.[key];\n\n\t\tif (typeof raw === 'string' || typeof raw === 'number' || typeof raw === 'boolean') {\n\t\t\tresult[key] = raw;\n\t\t} else if (spec.default !== undefined) {\n\t\t\tresult[key] = spec.default;\n\t\t}\n\t\tif (key in result) hasKeys = true;\n\t}\n\n\treturn hasKeys ? result : undefined;\n}\n\n/** Checks whether a block is empty (has no text and is not a void block). */\nfunction isBlockEmpty(\n\tstate: EditorState,\n\tblockId: BlockId,\n\tschemaRegistry?: SchemaRegistry,\n): boolean {\n\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\tif (!block) return false;\n\n\tconst spec = schemaRegistry?.getNodeSpec(block.type);\n\treturn !spec?.isVoid && getBlockText(block) === '';\n}\n\n// --- Rich block creation ---\n\n/**\n * Validates a rich block against the schema registry.\n * Returns undefined for blocks with unknown types; sanitizes attributes\n * against the declared spec.\n */\nexport function validateRichBlockData(\n\traw: RichBlockData,\n\tschemaRegistry?: SchemaRegistry,\n): RichBlockData | undefined {\n\tif (!raw.type) return undefined;\n\tif (!schemaRegistry) return raw;\n\n\tconst spec = schemaRegistry.getNodeSpec(raw.type);\n\tif (!spec) return undefined;\n\n\tconst attrs: Record<string, string | number | boolean> | undefined = sanitizeAttrs(\n\t\traw.attrs,\n\t\tspec.attrs,\n\t);\n\tconst segments: RichSegment[] | undefined = raw.segments\n\t\t? sanitizeRichSegments(raw.segments, schemaRegistry)\n\t\t: undefined;\n\treturn {\n\t\t...raw,\n\t\t...(attrs ? { attrs } : {}),\n\t\t...(segments ? { segments } : raw.segments ? { segments: [] } : {}),\n\t};\n}\n\n/**\n * Creates a BlockNode from validated rich block data.\n * Converts segments or plain text into inline children.\n */\nexport function createBlockFromRichData(blockData: RichBlockData): BlockNode {\n\tconst newId: BlockId = generateBlockId();\n\tconst text: string = blockData.text ?? '';\n\tconst children: readonly (TextNode | InlineNode)[] | undefined = createChildrenFromRichBlock(\n\t\tblockData,\n\t\ttext,\n\t);\n\tconst attrs: BlockAttrs | undefined = blockData.attrs\n\t\t? (blockData.attrs as BlockAttrs)\n\t\t: undefined;\n\n\treturn createBlockNode(nodeType(blockData.type) as NodeTypeName, children, newId, attrs);\n}\n\n/**\n * Creates inline children from rich block data.\n * Uses mark-preserving segments when available, falls back to plain text.\n */\nfunction createChildrenFromRichBlock(\n\tblockData: RichBlockData,\n\ttext: string,\n): readonly (TextNode | InlineNode)[] | undefined {\n\tif (blockData.segments && blockData.segments.length > 0) {\n\t\treturn createChildrenFromSegments(blockData.segments);\n\t}\n\treturn text ? [createTextNode(text)] : undefined;\n}\n\n/** Converts rich segments into TextNode children with marks. */\nfunction createChildrenFromSegments(\n\tsegments: readonly RichSegment[],\n): readonly (TextNode | InlineNode)[] {\n\tconst children: (TextNode | InlineNode)[] = [];\n\tfor (const seg of segments) {\n\t\tif (seg.kind === 'inline') {\n\t\t\tchildren.push(\n\t\t\t\tcreateInlineNode(\n\t\t\t\t\tinlineType(seg.inlineType),\n\t\t\t\t\tseg.attrs as Readonly<Record<string, string | number | boolean>> | undefined,\n\t\t\t\t),\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\t\tif (seg.text.length === 0) continue;\n\t\tconst marks: readonly Mark[] = seg.marks.map((m) => ({\n\t\t\ttype: m.type as Mark['type'],\n\t\t\t...(m.attrs ? { attrs: m.attrs as Mark['attrs'] } : {}),\n\t\t}));\n\t\tchildren.push(createTextNode(seg.text, marks));\n\t}\n\treturn children;\n}\n\nfunction sanitizeRichSegments(\n\tsegments: readonly RichSegment[],\n\tschemaRegistry: SchemaRegistry,\n): RichSegment[] {\n\tconst sanitized: RichSegment[] = [];\n\tfor (const segment of segments) {\n\t\tif (segment.kind === 'inline') {\n\t\t\tconst spec = schemaRegistry.getInlineNodeSpec(segment.inlineType);\n\t\t\tif (!spec) continue;\n\t\t\tconst attrs = sanitizeAttrs(segment.attrs, spec.attrs);\n\t\t\tsanitized.push({\n\t\t\t\tkind: 'inline',\n\t\t\t\tinlineType: segment.inlineType,\n\t\t\t\t...(attrs ? { attrs } : {}),\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tsanitized.push(segment);\n\t}\n\treturn sanitized;\n}\n"],"names":["resolveRootInsertionContext","state","anchorBlockId","schemaRegistry","path","findNodePath","doc","parentPath","extractParentPath","siblings","getSiblings","anchorIndex","findSiblingIndex","isAnchorEmpty","isBlockEmpty","resolveCellInsertionContext","cellId","cellPath","cell","getBlock","children","findIndex","c","isBlockNode","id","findTableCellAncestor","blockId","block","type","node","resolveAnchorBlockId","selection","isNodeSelection","nodeId","isGapCursor","anchor","insertBlockAfterAnchor","builder","ctx","insertIndex","insertNode","removeNode","insertOffset","side","cloneBlockWithNewIds","newId","map","child","generateBlockId","createBlockNode","attrs","findBlockRecursive","found","sanitizeAttrs","incoming","specAttrs","result","hasKeys","key","Object","keys","spec","raw","default","getNodeSpec","isVoid","getBlockText","validateRichBlockData","segments","sanitized","segment","kind","getInlineNodeSpec","inlineType","push","sanitizeRichSegments","createBlockFromRichData","blockData","text","length","seg","createInlineNode","marks","m","createTextNode","createChildrenFromSegments","createChildrenFromRichBlock","nodeType"],"mappings":"wSAiDO,SAASA,EACfC,EACAC,EACAC,GAEA,MAAMC,EAAsCC,EAAaJ,EAAMK,IAAKJ,GAC9DK,EAAwBC,EAAkBJ,GAE1CK,EAAiCC,EAAYT,EAAOM,GACpDI,EAAsBC,EAAiBH,EAAUP,GACvD,KAAIS,EAAc,GAGlB,MAAO,CAAEJ,aAAYI,cAAaE,cADHC,EAAab,EAAOC,EAAeC,GAEnE,CAMO,SAASY,EACfd,EACAC,EACAc,EACAb,GA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SAAS,CACxC,CAvBkEQ,CAChET,EAFoBA,EAAUC,MAAQ,IAKjC5B,EAAgC2B,EAAU3B,MAC5C2B,EAAU3B,WACX,EAEH,OAAOD,EAAgBsC,EAASV,EAAUjD,MAAuBR,EAAUyB,EAAOK,EACnF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
class e{_entries=/* @__PURE__ */new Map;registerBlockTypePickerEntry(e){if(this._entries.has(e.id))throw new Error(`BlockTypePickerEntry with id "${e.id}" is already registered.`);this._entries.set(e.id,e)}getBlockTypePickerEntries(){return[...this._entries.values()].sort((e,r)=>e.priority-r.priority)}removeBlockTypePickerEntry(e){this._entries.delete(e)}clear(){this._entries.clear()}}export{e as B};
|
|
2
|
-
//# sourceMappingURL=BlockTypePickerRegistry-DcSE6IXB.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BlockTypePickerRegistry-DcSE6IXB.mjs","sources":["../../src/plugins/heading/BlockTypePickerRegistry.ts"],"sourcesContent":["/**\n * BlockTypePickerRegistry: manages plugin-registered block type picker entries\n * displayed in the heading/block type dropdown, sorted by priority.\n */\n\nimport type { BlockTypePickerEntry } from './BlockTypePickerEntry.js';\n\nexport class BlockTypePickerRegistry {\n\tprivate readonly _entries = new Map<string, BlockTypePickerEntry>();\n\n\tregisterBlockTypePickerEntry(entry: BlockTypePickerEntry): void {\n\t\tif (this._entries.has(entry.id)) {\n\t\t\tthrow new Error(`BlockTypePickerEntry with id \"${entry.id}\" is already registered.`);\n\t\t}\n\t\tthis._entries.set(entry.id, entry);\n\t}\n\n\tgetBlockTypePickerEntries(): readonly BlockTypePickerEntry[] {\n\t\treturn [...this._entries.values()].sort((a, b) => a.priority - b.priority);\n\t}\n\n\tremoveBlockTypePickerEntry(id: string): void {\n\t\tthis._entries.delete(id);\n\t}\n\n\tclear(): void {\n\t\tthis._entries.clear();\n\t}\n}\n"],"names":["BlockTypePickerRegistry","_entries","Map","registerBlockTypePickerEntry","entry","this","has","id","Error","set","getBlockTypePickerEntries","values","sort","a","b","priority","removeBlockTypePickerEntry","delete","clear"],"mappings":"AAOO,MAAMA,EACKC,4BAAeC,IAEhC,4BAAAC,CAA6BC,GAC5B,GAAIC,KAAKJ,SAASK,IAAIF,EAAMG,IAC3B,MAAM,IAAIC,MAAM,iCAAiCJ,EAAMG,8BAExDF,KAAKJ,SAASQ,IAAIL,EAAMG,GAAIH,EAC7B,CAEA,yBAAAM,GACC,MAAO,IAAIL,KAAKJ,SAASU,UAAUC,KAAK,CAACC,EAAGC,IAAMD,EAAEE,SAAWD,EAAEC,SAClE,CAEA,0BAAAC,CAA2BT,GAC1BF,KAAKJ,SAASgB,OAAOV,EACtB,CAEA,KAAAW,GACCb,KAAKJ,SAASiB,OACf"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as e}from"./Platform-CU6itXZo.mjs";import{a,s as r}from"./StyleRuntime-BmsLoEa8.mjs";import{a as t,n as f}from"./KeyboardNav-DsYhKKuV.mjs";const o=/* @__PURE__ */new Map([["#000000","Black"],["#434343","Dark Gray 4"],["#666666","Dark Gray 3"],["#999999","Dark Gray 2"],["#b7b7b7","Dark Gray 1"],["#cccccc","Light Gray 3"],["#d9d9d9","Light Gray 2"],["#efefef","Light Gray 1"],["#f3f3f3","Near White"],["#ffffff","White"],["#980000","Dark Red Berry"],["#ff0000","Red"],["#ff9900","Orange"],["#ffff00","Yellow"],["#00ff00","Green"],["#00ffff","Cyan"],["#4a86e8","Cornflower Blue"],["#0000ff","Blue"],["#9900ff","Purple"],["#ff00ff","Magenta"],["#e6b8af","Light Red Berry 3"],["#f4cccc","Light Red 3"],["#fce5cd","Light Orange 3"],["#fff2cc","Light Yellow 3"],["#d9ead3","Light Green 3"],["#d0e0e3","Light Cyan 3"],["#c9daf8","Light Cornflower Blue 3"],["#cfe2f3","Light Blue 3"],["#d9d2e9","Light Purple 3"],["#ead1dc","Light Magenta 3"],["#dd7e6b","Light Red Berry 2"],["#ea9999","Light Red 2"],["#f9cb9c","Light Orange 2"],["#ffe599","Light Yellow 2"],["#b6d7a8","Light Green 2"],["#a2c4c9","Light Cyan 2"],["#a4c2f4","Light Cornflower Blue 2"],["#9fc5e8","Light Blue 2"],["#b4a7d6","Light Purple 2"],["#d5a6bd","Light Magenta 2"],["#cc4125","Light Red Berry 1"],["#e06666","Light Red 1"],["#f6b26b","Light Orange 1"],["#ffd966","Light Yellow 1"],["#93c47d","Light Green 1"],["#76a5af","Light Cyan 1"],["#6d9eeb","Light Cornflower Blue 1"],["#6fa8dc","Light Blue 1"],["#8e7cc3","Light Purple 1"],["#c27ba0","Light Magenta 1"],["#a61c00","Dark Red Berry 1"],["#cc0000","Dark Red 1"],["#e69138","Dark Orange 1"],["#f1c232","Dark Yellow 1"],["#6aa84f","Dark Green 1"],["#45818e","Dark Cyan 1"],["#3c78d8","Dark Cornflower Blue 1"],["#3d85c6","Dark Blue 1"],["#674ea7","Dark Purple 1"],["#a64d79","Dark Magenta 1"],["#85200c","Dark Red Berry 2"],["#990000","Dark Red 2"],["#b45f06","Dark Orange 2"],["#bf9000","Dark Yellow 2"],["#38761d","Dark Green 2"],["#134f5c","Dark Cyan 2"],["#1155cc","Dark Cornflower Blue 2"],["#0b5394","Dark Blue 2"],["#351c75","Dark Purple 2"],["#741b47","Dark Magenta 2"],["#fff176","Bright Yellow"],["#aed581","Light Green"],["#4dd0e1","Bright Cyan"],["#64b5f6","Sky Blue"],["#ce93d8","Lavender"],["#f48fb1","Pink"],["#ffab91","Peach"],["#ff8a65","Coral"],["#e6ee9c","Lime"],["#80cbc4","Teal"],["#fff9c4","Pale Yellow"],["#dcedc8","Pale Green"],["#e0f7fa","Pale Cyan"],["#e3f2fd","Pale Blue"],["#f3e5f5","Pale Purple"],["#fce4ec","Pale Pink"],["#fff3e0","Pale Orange"],["#fbe9e7","Pale Red"],["#f9fbe7","Pale Lime"],["#e0f2f1","Pale Teal"],["#fff59d","Soft Yellow"],["#c5e1a5","Soft Green"],["#80deea","Soft Cyan"],["#90caf9","Soft Blue"],["#e1bee7","Soft Purple"],["#f8bbd0","Soft Pink"],["#ffcc80","Soft Orange"],["#a5d6a7","Mint"],["#ffee58","Vivid Yellow"],["#9ccc65","Vivid Green"],["#26c6da","Vivid Cyan"],["#42a5f5","Vivid Blue"],["#ab47bc","Vivid Purple"],["#ec407a","Vivid Pink"],["#ffa726","Vivid Orange"],["#ff7043","Red Orange"],["#d4e157","Vivid Lime"],["#66bb6a","Emerald"],["#fafafa","Almost White"],["#f5f5f5","Lightest Gray"],["#eeeeee","Very Light Gray"],["#e0e0e0","Silver"],["#bdbdbd","Medium Gray"],["#e8eaf6","Lavender Gray"],["#efebe9","Warm Gray"],["#eceff1","Cool Gray"]]);function n(e){return o.get(e.toLowerCase())||function(e){const a=l(e),r=Number.parseInt(a.slice(1,3),16)/255,t=Number.parseInt(a.slice(3,5),16)/255,f=Number.parseInt(a.slice(5,7),16)/255,o=Math.max(r,t,f),n=Math.min(r,t,f),i=(o+n)/2,c=o-n;if(c<.05)return i<.15?"Black":i<.35?"Dark Gray":i<.65?"Gray":i<.85?"Light Gray":"Near White";let s=0;s=o===r?60*((t-f)/c+(t<f?6:0)):o===t?60*((f-r)/c+2):60*((r-t)/c+4);let g="Red";for(const[l,u]of d)if(s<l){g=u;break}return i<.25?`Very Dark ${g}`:i<.4?`Dark ${g}`:i>.8?`Very Light ${g}`:i>.65?`Light ${g}`:g}(e)}function i(e){const a=function(e){const a=l(e);return.2126*c(Number.parseInt(a.slice(1,3),16)/255)+.7152*c(Number.parseInt(a.slice(3,5),16)/255)+.0722*c(Number.parseInt(a.slice(5,7),16)/255)}(e);return a>.3}function l(e){const a=e.toLowerCase();return 4===a.length?`#${a[1]}${a[1]}${a[2]}${a[2]}${a[3]}${a[3]}`:a}function c(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}const d=[[15,"Red"],[45,"Orange"],[65,"Yellow"],[150,"Green"],[190,"Cyan"],[250,"Blue"],[290,"Purple"],[330,"Pink"],[361,"Red"]],s=/* @__PURE__ */new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function g(o,l){const c=l.columns,d=l.colors.length,g=Math.ceil(d/c),u=document.createElement("div");u.className="notectl-color-picker__grid",u.setAttribute("role","grid"),u.setAttribute("aria-label",l.ariaLabel);const h=[];let b=0;for(let e=0;e<g;e++){const t=document.createElement("div");t.setAttribute("role","row");for(let f=0;f<c;f++){const o=e*c+f;if(o>=d)break;const s=l.colors[o],g=n(s),u=!!l.activeColor&&l.activeColor.toLowerCase()===s.toLowerCase(),L=document.createElement("button");L.type="button",L.className="notectl-color-picker__swatch",L.setAttribute("role","gridcell");const k=l.swatchLabel?l.swatchLabel(g):`${l.ariaLabelPrefix} ${g}`;L.setAttribute("aria-label",k),L.setAttribute("aria-selected",String(u)),L.dataset.index=String(o),a(L,"backgroundColor",s),L.title=l.titleAsName?g:s,i(s)&&r(L,{border:"1px solid #d0d0d0"}),u&&(L.classList.add("notectl-color-picker__swatch--active"),b=o),L.addEventListener("mousedown",e=>{e.preventDefault(),e.stopPropagation(),l.onSelect(s)}),h.push(L),t.appendChild(L)}u.appendChild(t)}t(h,b),u.addEventListener("keydown",a=>{if("Escape"===a.key)return a.preventDefault(),a.stopPropagation(),void l.onClose();if("Enter"===a.key||" "===a.key){a.preventDefault(),a.stopPropagation();const e=a.target.dataset.index;if(void 0!==e){const a=l.colors[Number(e)];a&&l.onSelect(a)}return}if(s.has(a.key)){a.preventDefault(),a.stopPropagation();const r=Math.floor(b/c)+1,n=b%c+1,i=e(o),[l,s]=f(r,n,g,c,a.key,i);let u=(l-1)*c+(s-1);return u>=d&&(u=d-1),b=u,t(h,b),void h[b]?.focus()}if("Home"===a.key||"End"===a.key){a.preventDefault(),a.stopPropagation();const e=Math.floor(b/c)*c,r=Math.min(e+c-1,d-1);b="Home"===a.key?e:r,t(h,b),h[b]?.focus()}}),o.appendChild(u)}export{n as g,i,g as r};
|
|
2
|
-
//# sourceMappingURL=ColorGrid-CpkbKfXg.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorGrid-CpkbKfXg.mjs","sources":["../../src/plugins/shared/ColorNames.ts","../../src/plugins/shared/ColorGrid.ts"],"sourcesContent":["/**\n * Human-readable color name lookup for accessibility.\n *\n * Provides descriptive names for color swatches so screen readers\n * announce \"Red\" instead of \"#ff0000\". Covers all default palette\n * colors with a fallback algorithm for custom hex values.\n */\n\n// ---------------------------------------------------------------------------\n// Static name map — covers every default palette color\n// ---------------------------------------------------------------------------\n\nconst COLOR_NAME_MAP: ReadonlyMap<string, string> = new Map([\n\t// ── TextColor palette (70 colors) ──────────────────────────────────────\n\n\t// Row 1 — Grays\n\t['#000000', 'Black'],\n\t['#434343', 'Dark Gray 4'],\n\t['#666666', 'Dark Gray 3'],\n\t['#999999', 'Dark Gray 2'],\n\t['#b7b7b7', 'Dark Gray 1'],\n\t['#cccccc', 'Light Gray 3'],\n\t['#d9d9d9', 'Light Gray 2'],\n\t['#efefef', 'Light Gray 1'],\n\t['#f3f3f3', 'Near White'],\n\t['#ffffff', 'White'],\n\n\t// Row 2 — Vivid\n\t['#980000', 'Dark Red Berry'],\n\t['#ff0000', 'Red'],\n\t['#ff9900', 'Orange'],\n\t['#ffff00', 'Yellow'],\n\t['#00ff00', 'Green'],\n\t['#00ffff', 'Cyan'],\n\t['#4a86e8', 'Cornflower Blue'],\n\t['#0000ff', 'Blue'],\n\t['#9900ff', 'Purple'],\n\t['#ff00ff', 'Magenta'],\n\n\t// Row 3 — Light 3 (lightest tint)\n\t['#e6b8af', 'Light Red Berry 3'],\n\t['#f4cccc', 'Light Red 3'],\n\t['#fce5cd', 'Light Orange 3'],\n\t['#fff2cc', 'Light Yellow 3'],\n\t['#d9ead3', 'Light Green 3'],\n\t['#d0e0e3', 'Light Cyan 3'],\n\t['#c9daf8', 'Light Cornflower Blue 3'],\n\t['#cfe2f3', 'Light Blue 3'],\n\t['#d9d2e9', 'Light Purple 3'],\n\t['#ead1dc', 'Light Magenta 3'],\n\n\t// Row 4 — Light 2\n\t['#dd7e6b', 'Light Red Berry 2'],\n\t['#ea9999', 'Light Red 2'],\n\t['#f9cb9c', 'Light Orange 2'],\n\t['#ffe599', 'Light Yellow 2'],\n\t['#b6d7a8', 'Light Green 2'],\n\t['#a2c4c9', 'Light Cyan 2'],\n\t['#a4c2f4', 'Light Cornflower Blue 2'],\n\t['#9fc5e8', 'Light Blue 2'],\n\t['#b4a7d6', 'Light Purple 2'],\n\t['#d5a6bd', 'Light Magenta 2'],\n\n\t// Row 5 — Light 1\n\t['#cc4125', 'Light Red Berry 1'],\n\t['#e06666', 'Light Red 1'],\n\t['#f6b26b', 'Light Orange 1'],\n\t['#ffd966', 'Light Yellow 1'],\n\t['#93c47d', 'Light Green 1'],\n\t['#76a5af', 'Light Cyan 1'],\n\t['#6d9eeb', 'Light Cornflower Blue 1'],\n\t['#6fa8dc', 'Light Blue 1'],\n\t['#8e7cc3', 'Light Purple 1'],\n\t['#c27ba0', 'Light Magenta 1'],\n\n\t// Row 6 — Dark 1\n\t['#a61c00', 'Dark Red Berry 1'],\n\t['#cc0000', 'Dark Red 1'],\n\t['#e69138', 'Dark Orange 1'],\n\t['#f1c232', 'Dark Yellow 1'],\n\t['#6aa84f', 'Dark Green 1'],\n\t['#45818e', 'Dark Cyan 1'],\n\t['#3c78d8', 'Dark Cornflower Blue 1'],\n\t['#3d85c6', 'Dark Blue 1'],\n\t['#674ea7', 'Dark Purple 1'],\n\t['#a64d79', 'Dark Magenta 1'],\n\n\t// Row 7 — Dark 2\n\t['#85200c', 'Dark Red Berry 2'],\n\t['#990000', 'Dark Red 2'],\n\t['#b45f06', 'Dark Orange 2'],\n\t['#bf9000', 'Dark Yellow 2'],\n\t['#38761d', 'Dark Green 2'],\n\t['#134f5c', 'Dark Cyan 2'],\n\t['#1155cc', 'Dark Cornflower Blue 2'],\n\t['#0b5394', 'Dark Blue 2'],\n\t['#351c75', 'Dark Purple 2'],\n\t['#741b47', 'Dark Magenta 2'],\n\n\t// ── Highlight palette (50 colors, minus duplicates) ────────────────────\n\n\t// Row 1 — Classic highlighter (bright, vivid)\n\t['#fff176', 'Bright Yellow'],\n\t['#aed581', 'Light Green'],\n\t['#4dd0e1', 'Bright Cyan'],\n\t['#64b5f6', 'Sky Blue'],\n\t['#ce93d8', 'Lavender'],\n\t['#f48fb1', 'Pink'],\n\t['#ffab91', 'Peach'],\n\t['#ff8a65', 'Coral'],\n\t['#e6ee9c', 'Lime'],\n\t['#80cbc4', 'Teal'],\n\n\t// Row 2 — Light pastels\n\t['#fff9c4', 'Pale Yellow'],\n\t['#dcedc8', 'Pale Green'],\n\t['#e0f7fa', 'Pale Cyan'],\n\t['#e3f2fd', 'Pale Blue'],\n\t['#f3e5f5', 'Pale Purple'],\n\t['#fce4ec', 'Pale Pink'],\n\t['#fff3e0', 'Pale Orange'],\n\t['#fbe9e7', 'Pale Red'],\n\t['#f9fbe7', 'Pale Lime'],\n\t['#e0f2f1', 'Pale Teal'],\n\n\t// Row 3 — Medium pastels\n\t['#fff59d', 'Soft Yellow'],\n\t['#c5e1a5', 'Soft Green'],\n\t['#80deea', 'Soft Cyan'],\n\t['#90caf9', 'Soft Blue'],\n\t['#e1bee7', 'Soft Purple'],\n\t['#f8bbd0', 'Soft Pink'],\n\t['#ffcc80', 'Soft Orange'],\n\t// #ffab91 duplicate → Peach (already mapped)\n\t// #e6ee9c duplicate → Lime (already mapped)\n\t['#a5d6a7', 'Mint'],\n\n\t// Row 4 — Bold pastels\n\t['#ffee58', 'Vivid Yellow'],\n\t['#9ccc65', 'Vivid Green'],\n\t['#26c6da', 'Vivid Cyan'],\n\t['#42a5f5', 'Vivid Blue'],\n\t['#ab47bc', 'Vivid Purple'],\n\t['#ec407a', 'Vivid Pink'],\n\t['#ffa726', 'Vivid Orange'],\n\t['#ff7043', 'Red Orange'],\n\t['#d4e157', 'Vivid Lime'],\n\t['#66bb6a', 'Emerald'],\n\n\t// Row 5 — Grays and neutral highlights\n\t// #ffffff duplicate → White (already mapped)\n\t['#fafafa', 'Almost White'],\n\t['#f5f5f5', 'Lightest Gray'],\n\t['#eeeeee', 'Very Light Gray'],\n\t['#e0e0e0', 'Silver'],\n\t['#bdbdbd', 'Medium Gray'],\n\t['#e8eaf6', 'Lavender Gray'],\n\t['#efebe9', 'Warm Gray'],\n\t['#eceff1', 'Cool Gray'],\n\t// #fafafa duplicate → Almost White (already mapped)\n]);\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\n/**\n * Returns a human-readable name for a hex color.\n *\n * Checks the static map first, then falls back to a computed\n * description based on hue, saturation, and lightness.\n */\nexport function getColorName(hex: string): string {\n\tconst name: string | undefined = COLOR_NAME_MAP.get(hex.toLowerCase());\n\tif (name) return name;\n\treturn describeColor(hex);\n}\n\n/**\n * Determines whether a color is light enough to need a visible\n * border when rendered on a white background (WCAG 1.4.11).\n *\n * Uses a contrast-ratio threshold of 3:1 against white.\n */\nexport function isLightColor(hex: string): boolean {\n\tconst luminance: number = relativeLuminance(hex);\n\t// Contrast ratio against white: (1.05) / (L + 0.05) < 3\n\t// ⟹ L > 1.05/3 − 0.05 = 0.3\n\tconst LIGHT_THRESHOLD = 0.3;\n\treturn luminance > LIGHT_THRESHOLD;\n}\n\n// ---------------------------------------------------------------------------\n// Internal helpers\n// ---------------------------------------------------------------------------\n\n/** Expands `#RGB` to `#RRGGBB` and lowercases. */\nfunction normalizeHex(hex: string): string {\n\tconst h: string = hex.toLowerCase();\n\tif (h.length === 4) {\n\t\treturn `#${h[1]}${h[1]}${h[2]}${h[2]}${h[3]}${h[3]}`;\n\t}\n\treturn h;\n}\n\n/** Applies sRGB linearization to a single channel value (0–1). */\nfunction linearize(channel: number): number {\n\treturn channel <= 0.03928 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4;\n}\n\n/** Computes WCAG relative luminance from a hex color. */\nfunction relativeLuminance(hex: string): number {\n\tconst normalized: string = normalizeHex(hex);\n\tconst r: number = linearize(Number.parseInt(normalized.slice(1, 3), 16) / 255);\n\tconst g: number = linearize(Number.parseInt(normalized.slice(3, 5), 16) / 255);\n\tconst b: number = linearize(Number.parseInt(normalized.slice(5, 7), 16) / 255);\n\treturn 0.2126 * r + 0.7152 * g + 0.0722 * b;\n}\n\n/** Hue boundary table: upper bound (degrees) → name. */\nconst HUE_NAMES: readonly (readonly [number, string])[] = [\n\t[15, 'Red'],\n\t[45, 'Orange'],\n\t[65, 'Yellow'],\n\t[150, 'Green'],\n\t[190, 'Cyan'],\n\t[250, 'Blue'],\n\t[290, 'Purple'],\n\t[330, 'Pink'],\n\t[361, 'Red'],\n];\n\n/**\n * Generates a descriptive name from a hex color using HSL analysis.\n * Produces names like \"Dark Blue\", \"Light Green\", or \"Gray\".\n */\nfunction describeColor(hex: string): string {\n\tconst normalized: string = normalizeHex(hex);\n\tconst rRaw: number = Number.parseInt(normalized.slice(1, 3), 16) / 255;\n\tconst gRaw: number = Number.parseInt(normalized.slice(3, 5), 16) / 255;\n\tconst bRaw: number = Number.parseInt(normalized.slice(5, 7), 16) / 255;\n\n\tconst max: number = Math.max(rRaw, gRaw, bRaw);\n\tconst min: number = Math.min(rRaw, gRaw, bRaw);\n\tconst lightness: number = (max + min) / 2;\n\tconst delta: number = max - min;\n\n\t// Achromatic\n\tif (delta < 0.05) {\n\t\tif (lightness < 0.15) return 'Black';\n\t\tif (lightness < 0.35) return 'Dark Gray';\n\t\tif (lightness < 0.65) return 'Gray';\n\t\tif (lightness < 0.85) return 'Light Gray';\n\t\treturn 'Near White';\n\t}\n\n\t// Compute hue in degrees\n\tlet hue = 0;\n\tif (max === rRaw) {\n\t\thue = ((gRaw - bRaw) / delta + (gRaw < bRaw ? 6 : 0)) * 60;\n\t} else if (max === gRaw) {\n\t\thue = ((bRaw - rRaw) / delta + 2) * 60;\n\t} else {\n\t\thue = ((rRaw - gRaw) / delta + 4) * 60;\n\t}\n\n\t// Look up hue name\n\tlet hueName = 'Red';\n\tfor (const [threshold, name] of HUE_NAMES) {\n\t\tif (hue < threshold) {\n\t\t\thueName = name;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Lightness modifier\n\tif (lightness < 0.25) return `Very Dark ${hueName}`;\n\tif (lightness < 0.4) return `Dark ${hueName}`;\n\tif (lightness > 0.8) return `Very Light ${hueName}`;\n\tif (lightness > 0.65) return `Light ${hueName}`;\n\treturn hueName;\n}\n","/**\n * Shared color grid rendering with WAI-ARIA grid pattern and keyboard\n * navigation. Used by ColorPickerPopup (text-color, highlight) and\n * TableBorderColor.\n */\n\nimport { isRtlContext } from '../../platform/Platform.js';\nimport { setStyleProperties, setStyleProperty } from '../../style/StyleRuntime.js';\nimport { getColorName, isLightColor } from './ColorNames.js';\nimport { applyRovingTabindex, navigateGrid } from './KeyboardNav.js';\n\n// --- Types ---\n\nexport interface ColorGridConfig {\n\treadonly colors: readonly string[];\n\treadonly columns: number;\n\treadonly ariaLabel: string;\n\treadonly ariaLabelPrefix: string;\n\treadonly activeColor: string | null;\n\treadonly onSelect: (color: string) => void;\n\treadonly onClose: () => void;\n\t/** Optional custom label formatter for swatch aria-labels. Defaults to `${prefix} ${colorName}`. */\n\treadonly swatchLabel?: (colorName: string) => string;\n\t/** When true, swatch title shows human-readable color name instead of hex. */\n\treadonly titleAsName?: boolean;\n}\n\n// --- Constants ---\n\nconst GRID_NAV_KEYS: ReadonlySet<string> = new Set([\n\t'ArrowUp',\n\t'ArrowDown',\n\t'ArrowLeft',\n\t'ArrowRight',\n]);\nconst LIGHT_COLOR_BORDER = '1px solid #d0d0d0';\n\n// --- Rendering ---\n\n/**\n * Renders an accessible color grid into the given container.\n * Creates a `role=\"grid\"` with rows of `role=\"gridcell\"` swatch buttons.\n * Provides arrow key, Home/End, Enter/Space, and Escape keyboard navigation.\n */\nexport function renderColorGrid(container: HTMLElement, config: ColorGridConfig): void {\n\tconst columns: number = config.columns;\n\tconst totalSwatches: number = config.colors.length;\n\tconst totalRows: number = Math.ceil(totalSwatches / columns);\n\n\tconst grid: HTMLDivElement = document.createElement('div');\n\tgrid.className = 'notectl-color-picker__grid';\n\tgrid.setAttribute('role', 'grid');\n\tgrid.setAttribute('aria-label', config.ariaLabel);\n\n\tconst swatches: HTMLButtonElement[] = [];\n\tlet focusedIndex = 0;\n\n\tfor (let rowIdx = 0; rowIdx < totalRows; rowIdx++) {\n\t\tconst row: HTMLDivElement = document.createElement('div');\n\t\trow.setAttribute('role', 'row');\n\n\t\tfor (let colIdx = 0; colIdx < columns; colIdx++) {\n\t\t\tconst swatchIdx: number = rowIdx * columns + colIdx;\n\t\t\tif (swatchIdx >= totalSwatches) break;\n\n\t\t\tconst color: string = config.colors[swatchIdx] as string;\n\t\t\tconst colorName: string = getColorName(color);\n\t\t\tconst isActive: boolean =\n\t\t\t\t!!config.activeColor && config.activeColor.toLowerCase() === color.toLowerCase();\n\n\t\t\tconst swatch: HTMLButtonElement = document.createElement('button');\n\t\t\tswatch.type = 'button';\n\t\t\tswatch.className = 'notectl-color-picker__swatch';\n\t\t\tswatch.setAttribute('role', 'gridcell');\n\t\t\tconst label: string = config.swatchLabel\n\t\t\t\t? config.swatchLabel(colorName)\n\t\t\t\t: `${config.ariaLabelPrefix} ${colorName}`;\n\t\t\tswatch.setAttribute('aria-label', label);\n\t\t\tswatch.setAttribute('aria-selected', String(isActive));\n\t\t\tswatch.dataset.index = String(swatchIdx);\n\t\t\tsetStyleProperty(swatch, 'backgroundColor', color);\n\t\t\tswatch.title = config.titleAsName ? colorName : color;\n\n\t\t\tif (isLightColor(color)) {\n\t\t\t\tsetStyleProperties(swatch, {\n\t\t\t\t\tborder: LIGHT_COLOR_BORDER,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (isActive) {\n\t\t\t\tswatch.classList.add('notectl-color-picker__swatch--active');\n\t\t\t\tfocusedIndex = swatchIdx;\n\t\t\t}\n\n\t\t\tswatch.addEventListener('mousedown', (e: MouseEvent) => {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t\tconfig.onSelect(color);\n\t\t\t});\n\n\t\t\tswatches.push(swatch);\n\t\t\trow.appendChild(swatch);\n\t\t}\n\n\t\tgrid.appendChild(row);\n\t}\n\n\tapplyRovingTabindex(swatches as readonly HTMLButtonElement[], focusedIndex);\n\n\tgrid.addEventListener('keydown', (e: KeyboardEvent) => {\n\t\tif (e.key === 'Escape') {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tconfig.onClose();\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tconst target = e.target as HTMLElement;\n\t\t\tconst idx: string | undefined = target.dataset.index;\n\t\t\tif (idx !== undefined) {\n\t\t\t\tconst color: string | undefined = config.colors[Number(idx)];\n\t\t\t\tif (color) {\n\t\t\t\t\tconfig.onSelect(color);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (GRID_NAV_KEYS.has(e.key)) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tconst currentRow: number = Math.floor(focusedIndex / columns) + 1;\n\t\t\tconst currentCol: number = (focusedIndex % columns) + 1;\n\n\t\t\tconst rtl: boolean = isRtlContext(container);\n\t\t\tconst [newRow, newCol] = navigateGrid(\n\t\t\t\tcurrentRow,\n\t\t\t\tcurrentCol,\n\t\t\t\ttotalRows,\n\t\t\t\tcolumns,\n\t\t\t\te.key as 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight',\n\t\t\t\trtl,\n\t\t\t);\n\n\t\t\tlet newIdx: number = (newRow - 1) * columns + (newCol - 1);\n\t\t\tif (newIdx >= totalSwatches) {\n\t\t\t\tnewIdx = totalSwatches - 1;\n\t\t\t}\n\n\t\t\tfocusedIndex = newIdx;\n\t\t\tapplyRovingTabindex(swatches as readonly HTMLButtonElement[], focusedIndex);\n\t\t\tswatches[focusedIndex]?.focus();\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.key === 'Home' || e.key === 'End') {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tconst currentRow: number = Math.floor(focusedIndex / columns);\n\t\t\tconst rowStart: number = currentRow * columns;\n\t\t\tconst rowEnd: number = Math.min(rowStart + columns - 1, totalSwatches - 1);\n\n\t\t\tfocusedIndex = e.key === 'Home' ? rowStart : rowEnd;\n\t\t\tapplyRovingTabindex(swatches as readonly HTMLButtonElement[], focusedIndex);\n\t\t\tswatches[focusedIndex]?.focus();\n\t\t}\n\t});\n\n\tcontainer.appendChild(grid);\n}\n"],"names":["COLOR_NAME_MAP","Map","getColorName","hex","get","toLowerCase","normalized","normalizeHex","rRaw","Number","parseInt","slice","gRaw","bRaw","max","Math","min","lightness","delta","hue","hueName","threshold","name","HUE_NAMES","describeColor","isLightColor","luminance","linearize","relativeLuminance","h","length","channel","GRID_NAV_KEYS","Set","renderColorGrid","container","config","columns","totalSwatches","colors","totalRows","ceil","grid","document","createElement","className","setAttribute","ariaLabel","swatches","focusedIndex","rowIdx","row","colIdx","swatchIdx","color","colorName","isActive","activeColor","swatch","type","label","swatchLabel","ariaLabelPrefix","String","dataset","index","setStyleProperty","title","titleAsName","setStyleProperties","border","classList","add","addEventListener","e","preventDefault","stopPropagation","onSelect","push","appendChild","applyRovingTabindex","key","onClose","idx","target","has","currentRow","floor","currentCol","rtl","isRtlContext","newRow","newCol","navigateGrid","newIdx","focus","rowStart","rowEnd"],"mappings":"oJAYA,MAAMA,qBAAkDC,IAAI,CAI3D,CAAC,UAAW,SACZ,CAAC,UAAW,eACZ,CAAC,UAAW,eACZ,CAAC,UAAW,eACZ,CAAC,UAAW,eACZ,CAAC,UAAW,gBACZ,CAAC,UAAW,gBACZ,CAAC,UAAW,gBACZ,CAAC,UAAW,cACZ,CAAC,UAAW,SAGZ,CAAC,UAAW,kBACZ,CAAC,UAAW,OACZ,CAAC,UAAW,UACZ,CAAC,UAAW,UACZ,CAAC,UAAW,SACZ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
|
|
1
|
-
import{r as e}from"./ColorGrid-CpkbKfXg.mjs";import{a as o,g as t,r}from"./AttributedMarkCommands-BY1BSYWM.mjs";import{m as a}from"./TypeBrands-Bp_Z_o5Y.mjs";import{i as n}from"./ColorValidation-DCSKq9B2.mjs";function s(e,o){return t(e,o,e=>e.attrs.color??null)}function l(e,o){return null!==s(e,o)}function i(e,t,r,s){if(!n(s))return!1;const l={type:a(r),attrs:{color:s}},i=o(t,l);return!!i&&(e.dispatch(i),!0)}function c(e,o,t){const n=r(o,a(t));return!!n&&(e.dispatch(n),!0)}function m(o,t,r){o.classList.add("notectl-color-picker");const a=s(t.getState(),r.markType),n=r.columns||10,l=t.getContainer(),c=document.createElement("button");c.type="button",c.className="notectl-color-picker__default",c.textContent=r.resetLabel,c.addEventListener("mousedown",e=>{e.preventDefault(),e.stopPropagation(),t.executeCommand(r.resetCommand),r.onClose({restoreFocusTo:l})}),c.addEventListener("keydown",e=>{"Escape"===e.key&&(e.preventDefault(),r.onClose())}),o.appendChild(c),e(o,{colors:r.colors,columns:n,ariaLabel:`${r.ariaLabelPrefix} color picker`,ariaLabelPrefix:r.ariaLabelPrefix,activeColor:a,onSelect:e=>{i(t,t.getState(),r.markType,e),r.onClose({restoreFocusTo:l})},onClose:r.onClose})}export{i as a,m as b,s as g,l as i,c as r};
|
|
2
|
-
//# sourceMappingURL=ColorPickerPopup-D6XjShhv.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerPopup-D6XjShhv.mjs","sources":["../../src/plugins/shared/ColorMarkOperations.ts","../../src/plugins/shared/ColorPickerPopup.ts"],"sourcesContent":["/**\n * Shared color mark operations for color-based mark plugins.\n * All functions are parameterized by mark type name so they work\n * identically for TextColor, Highlight, or any future color mark.\n *\n * Delegates to the generic AttributedMarkCommands helpers for the\n * collapsed-vs-range branching logic.\n */\n\nimport {\n\tapplyAttributedMark,\n\tgetMarkAttrAtSelection,\n\tremoveAttributedMark,\n} from '../../commands/AttributedMarkCommands.js';\nimport type { MarkAttrRegistry } from '../../model/AttrRegistry.js';\nimport { markType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { isValidCSSColor } from './ColorValidation.js';\n\n/** Color mark type names that have `{ color: string }` attrs. */\nexport type ColorMarkType = {\n\t[K in keyof MarkAttrRegistry]: MarkAttrRegistry[K] extends { color: string } ? K : never;\n}[keyof MarkAttrRegistry];\n\n/**\n * Returns the active color value for the given mark type at the current\n * selection, or `null` if the mark is not present.\n */\nexport function getActiveColor(state: EditorState, markTypeName: ColorMarkType): string | null {\n\treturn getMarkAttrAtSelection(state, markTypeName, (m) => m.attrs.color ?? null);\n}\n\n/** Returns `true` when the given color mark is active at the current selection. */\nexport function isColorMarkActive(state: EditorState, markTypeName: ColorMarkType): boolean {\n\treturn getActiveColor(state, markTypeName) !== null;\n}\n\n/**\n * Applies the given color to the selection. For collapsed selections,\n * sets stored marks. For range selections, removes then re-adds the mark.\n */\nexport function applyColorMark(\n\tcontext: PluginContext,\n\tstate: EditorState,\n\tmarkTypeName: ColorMarkType,\n\tcolor: string,\n): boolean {\n\tif (!isValidCSSColor(color)) return false;\n\n\tconst mark = { type: markType(markTypeName), attrs: { color } };\n\tconst tr = applyAttributedMark(state, mark);\n\tif (!tr) return false;\n\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\n/**\n * Removes the given color mark from the selection.\n * Returns `false` when the mark was not present.\n */\nexport function removeColorMark(\n\tcontext: PluginContext,\n\tstate: EditorState,\n\tmarkTypeName: ColorMarkType,\n): boolean {\n\tconst tr = removeAttributedMark(state, markType(markTypeName));\n\tif (!tr) return false;\n\n\tcontext.dispatch(tr);\n\treturn true;\n}\n","/**\n * Shared color picker popup rendering with WAI-ARIA grid keyboard navigation.\n * Used by TextColorPlugin and HighlightPlugin.\n * Delegates grid rendering to the shared ColorGrid module.\n */\n\nimport type { PluginContext } from '../Plugin.js';\nimport { renderColorGrid } from './ColorGrid.js';\nimport type { ColorMarkType } from './ColorMarkOperations.js';\nimport { applyColorMark, getActiveColor } from './ColorMarkOperations.js';\nimport type { PopupCloseOptions } from './PopupManager.js';\n\n/** Configuration for `renderColorPickerPopup`. */\nexport interface ColorPickerConfig {\n\treadonly markType: ColorMarkType;\n\treadonly colors: readonly string[];\n\treadonly columns: number;\n\treadonly resetLabel: string;\n\treadonly resetCommand: string;\n\treadonly ariaLabelPrefix: string;\n\treadonly onClose: (options?: PopupCloseOptions) => void;\n}\n\nconst COLUMNS = 10;\n\n/**\n * Renders an accessible color picker popup into `container`.\n *\n * Features:\n * - WAI-ARIA `role=\"grid\"` with row/gridcell structure\n * - Arrow key navigation (wraps around, clamps on partial last row)\n * - Enter/Space selects color and closes popup\n * - Escape closes popup\n * - Roving tabindex on swatches\n */\nexport function renderColorPickerPopup(\n\tcontainer: HTMLElement,\n\tcontext: PluginContext,\n\tconfig: ColorPickerConfig,\n): void {\n\tcontainer.classList.add('notectl-color-picker');\n\n\tconst state = context.getState();\n\tconst activeColor: string | null = getActiveColor(state, config.markType);\n\tconst columns: number = config.columns || COLUMNS;\n\tconst contentElement: HTMLElement = context.getContainer();\n\n\t// --- Reset button ---\n\tconst resetBtn: HTMLButtonElement = document.createElement('button');\n\tresetBtn.type = 'button';\n\tresetBtn.className = 'notectl-color-picker__default';\n\tresetBtn.textContent = config.resetLabel;\n\tresetBtn.addEventListener('mousedown', (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tcontext.executeCommand(config.resetCommand);\n\t\tconfig.onClose({ restoreFocusTo: contentElement });\n\t});\n\tresetBtn.addEventListener('keydown', (e: KeyboardEvent) => {\n\t\tif (e.key === 'Escape') {\n\t\t\te.preventDefault();\n\t\t\tconfig.onClose();\n\t\t}\n\t});\n\tcontainer.appendChild(resetBtn);\n\n\t// --- Color grid (delegated to shared ColorGrid) ---\n\trenderColorGrid(container, {\n\t\tcolors: config.colors,\n\t\tcolumns,\n\t\tariaLabel: `${config.ariaLabelPrefix} color picker`,\n\t\tariaLabelPrefix: config.ariaLabelPrefix,\n\t\tactiveColor,\n\t\tonSelect: (color: string) => {\n\t\t\tapplyColorMark(context, context.getState(), config.markType, color);\n\t\t\tconfig.onClose({ restoreFocusTo: contentElement });\n\t\t},\n\t\tonClose: config.onClose,\n\t});\n}\n"],"names":["getActiveColor","state","markTypeName","getMarkAttrAtSelection","m","attrs","color","isColorMarkActive","applyColorMark","context","isValidCSSColor","mark","type","markType","tr","applyAttributedMark","dispatch","removeColorMark","removeAttributedMark","renderColorPickerPopup","container","config","classList","add","activeColor","getState","columns","contentElement","getContainer","resetBtn","document","createElement","className","textContent","resetLabel","addEventListener","e","preventDefault","stopPropagation","executeCommand","resetCommand","onClose","restoreFocusTo","key","appendChild","renderColorGrid","colors","ariaLabel","ariaLabelPrefix","onSelect"],"mappings":"iNA6BO,SAASA,EAAeC,EAAoBC,GAClD,OAAOC,EAAuBF,EAAOC,EAAeE,GAAMA,EAAEC,MAAMC,OAAS,KAC5E,CAGO,SAASC,EAAkBN,EAAoBC,GACrD,OAA+C,OAAxCF,EAAeC,EAAOC,EAC9B,CAMO,SAASM,EACfC,EACAR,EACAC,EACAI,GAEA,IAAKI,EAAgBJ,GAAQ,OAAO,EAEpC,MAAMK,EAAO,CAAEC,KAAMC,EAASX,GAAeG,MAAO,CAAEC,UAChDQ,EAAKC,EAAoBd,EAAOU,GACtC,QAAKG,IAELL,EAAQO,SAASF,IACV,EACR,CAMO,SAASG,EACfR,EACAR,EACAC,GAEA,MAAMY,EAAKI,EAAqBjB,EAAOY,EAASX,IAChD,QAAKY,IAELL,EAAQO,SAASF,IACV,EACR,CCrCO,SAASK,EACfC,EACAX,EACAY,GAEAD,EAAUE,UAAUC,IAAI,wBAExB,MACMC,EAA6BxB,EADrBS,EAAQgB,WACmCJ,EAAOR,UAC1Da,EAAkBL,EAAOK,SArBhB,GAsBTC,EAA8BlB,EAAQmB,eAGtCC,EAA8BC,SAASC,cAAc,UAC3DF,EAASjB,KAAO,SAChBiB,EAASG,UAAY,gCACrBH,EAASI,YAAcZ,EAAOa,WAC9BL,EAASM,iBAAiB,YAAcC,IACvCA,EAAEC,iBACFD,EAAEE,kBACF7B,EAAQ8B,eAAelB,EAAOmB,cAC9BnB,EAAOoB,QAAQ,CAAEC,eAAgBf,MAElCE,EAASM,iBAAiB,UAAYC,IACvB,WAAVA,EAAEO,MACLP,EAAEC,iBACFhB,EAAOoB,aAGTrB,EAAUwB,YAAYf,GAGtBgB,EAAgBzB,EAAW,CAC1B0B,OAAQzB,EAAOyB,OACfpB,UACAqB,UAAW,GAAG1B,EAAO2B,+BACrBA,gBAAiB3B,EAAO2B,gBACxBxB,cACAyB,SAAW3C,IACVE,EAAeC,EAASA,EAAQgB,WAAYJ,EAAOR,SAAUP,GAC7De,EAAOoB,QAAQ,CAAEC,eAAgBf,KAElCc,QAASpB,EAAOoB,SAElB"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;function r(r){return e.test(r)}const a=/^rgba?\(\s*(\d{1,3}%?\s*,\s*){2}\d{1,3}%?(\s*,\s*(0|1|0?\.\d+))?\s*\)$/,l=/^hsla?\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%(\s*,\s*(0|1|0?\.\d+))?\s*\)$/,t=/* @__PURE__ */new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","transparent","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]);function n(r){if(!r)return!1;const n=r.trim().toLowerCase();return!!n&&(e.test(n)||a.test(n)||l.test(n)||t.has(n))}function i(e,a,l){if(!e||0===e.length)return a;const t=e.filter(e=>!r(e));if(t.length>0)throw new Error(`${l}: invalid hex color(s): ${t.join(", ")}. Expected format: #RGB or #RRGGBB.`);const n=/* @__PURE__ */new Set,i=[];for(const r of e){const e=r.toLowerCase();n.has(e)||(n.add(e),i.push(e))}return i}const o=/[{}<>;]|url\(|expression\(/i;function s(e){if(!e)return!1;const r=e.trim();return!!r&&!o.test(r)}const d=/^\d+(\.\d+)?(px|pt|em|rem|%)$/i;function u(e){return!!e&&d.test(e.trim())}export{s as a,u as b,r as c,n as i,i as r};
|
|
2
|
-
//# sourceMappingURL=ColorValidation-DCSKq9B2.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorValidation-DCSKq9B2.mjs","sources":["../../src/plugins/shared/ColorValidation.ts"],"sourcesContent":["/**\n * Shared CSS validation and normalization utilities\n * for style-based mark plugins (TextColor, Highlight, Font, FontSize).\n */\n\nconst HEX_COLOR_PATTERN: RegExp = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;\n\n/** Returns `true` when the value is a valid `#RGB` or `#RRGGBB` hex color. */\nexport function isValidHexColor(value: string): boolean {\n\treturn HEX_COLOR_PATTERN.test(value);\n}\n\n// --- CSS Color Validation (broad format support for paste / API input) ---\n\n/** Matches `rgb(r, g, b)` and `rgba(r, g, b, a)` with integer or percentage values. */\nconst RGB_PATTERN: RegExp =\n\t/^rgba?\\(\\s*(\\d{1,3}%?\\s*,\\s*){2}\\d{1,3}%?(\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$/;\n\n/** Matches `hsl(h, s%, l%)` and `hsla(h, s%, l%, a)`. */\nconst HSL_PATTERN: RegExp =\n\t/^hsla?\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}%\\s*,\\s*\\d{1,3}%(\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$/;\n\n/**\n * Complete set of CSS Level 4 named colors (including `transparent`).\n * Used as an allowlist — unknown names are rejected.\n */\nconst CSS_NAMED_COLORS: ReadonlySet<string> = new Set([\n\t'aliceblue',\n\t'antiquewhite',\n\t'aqua',\n\t'aquamarine',\n\t'azure',\n\t'beige',\n\t'bisque',\n\t'black',\n\t'blanchedalmond',\n\t'blue',\n\t'blueviolet',\n\t'brown',\n\t'burlywood',\n\t'cadetblue',\n\t'chartreuse',\n\t'chocolate',\n\t'coral',\n\t'cornflowerblue',\n\t'cornsilk',\n\t'crimson',\n\t'cyan',\n\t'darkblue',\n\t'darkcyan',\n\t'darkgoldenrod',\n\t'darkgray',\n\t'darkgreen',\n\t'darkgrey',\n\t'darkkhaki',\n\t'darkmagenta',\n\t'darkolivegreen',\n\t'darkorange',\n\t'darkorchid',\n\t'darkred',\n\t'darksalmon',\n\t'darkseagreen',\n\t'darkslateblue',\n\t'darkslategray',\n\t'darkslategrey',\n\t'darkturquoise',\n\t'darkviolet',\n\t'deeppink',\n\t'deepskyblue',\n\t'dimgray',\n\t'dimgrey',\n\t'dodgerblue',\n\t'firebrick',\n\t'floralwhite',\n\t'forestgreen',\n\t'fuchsia',\n\t'gainsboro',\n\t'ghostwhite',\n\t'gold',\n\t'goldenrod',\n\t'gray',\n\t'green',\n\t'greenyellow',\n\t'grey',\n\t'honeydew',\n\t'hotpink',\n\t'indianred',\n\t'indigo',\n\t'ivory',\n\t'khaki',\n\t'lavender',\n\t'lavenderblush',\n\t'lawngreen',\n\t'lemonchiffon',\n\t'lightblue',\n\t'lightcoral',\n\t'lightcyan',\n\t'lightgoldenrodyellow',\n\t'lightgray',\n\t'lightgreen',\n\t'lightgrey',\n\t'lightpink',\n\t'lightsalmon',\n\t'lightseagreen',\n\t'lightskyblue',\n\t'lightslategray',\n\t'lightslategrey',\n\t'lightsteelblue',\n\t'lightyellow',\n\t'lime',\n\t'limegreen',\n\t'linen',\n\t'magenta',\n\t'maroon',\n\t'mediumaquamarine',\n\t'mediumblue',\n\t'mediumorchid',\n\t'mediumpurple',\n\t'mediumseagreen',\n\t'mediumslateblue',\n\t'mediumspringgreen',\n\t'mediumturquoise',\n\t'mediumvioletred',\n\t'midnightblue',\n\t'mintcream',\n\t'mistyrose',\n\t'moccasin',\n\t'navajowhite',\n\t'navy',\n\t'oldlace',\n\t'olive',\n\t'olivedrab',\n\t'orange',\n\t'orangered',\n\t'orchid',\n\t'palegoldenrod',\n\t'palegreen',\n\t'paleturquoise',\n\t'palevioletred',\n\t'papayawhip',\n\t'peachpuff',\n\t'peru',\n\t'pink',\n\t'plum',\n\t'powderblue',\n\t'purple',\n\t'rebeccapurple',\n\t'red',\n\t'rosybrown',\n\t'royalblue',\n\t'saddlebrown',\n\t'salmon',\n\t'sandybrown',\n\t'seagreen',\n\t'seashell',\n\t'sienna',\n\t'silver',\n\t'skyblue',\n\t'slateblue',\n\t'slategray',\n\t'slategrey',\n\t'snow',\n\t'springgreen',\n\t'steelblue',\n\t'tan',\n\t'teal',\n\t'thistle',\n\t'tomato',\n\t'transparent',\n\t'turquoise',\n\t'violet',\n\t'wheat',\n\t'white',\n\t'whitesmoke',\n\t'yellow',\n\t'yellowgreen',\n]);\n\n/**\n * Returns `true` when `value` is a safe CSS color value.\n * Accepts hex (`#RGB`, `#RRGGBB`), `rgb()`, `rgba()`, `hsl()`, `hsla()`,\n * and CSS named colors. Rejects anything else — defense against CSS injection\n * via manipulated color values in `style` attributes.\n */\nexport function isValidCSSColor(value: string): boolean {\n\tif (!value) return false;\n\tconst trimmed: string = value.trim().toLowerCase();\n\tif (!trimmed) return false;\n\n\treturn (\n\t\tHEX_COLOR_PATTERN.test(trimmed) ||\n\t\tRGB_PATTERN.test(trimmed) ||\n\t\tHSL_PATTERN.test(trimmed) ||\n\t\tCSS_NAMED_COLORS.has(trimmed)\n\t);\n}\n\n/**\n * Validates, deduplicates, and normalizes a user-supplied color list.\n * Returns `fallbackPalette` when no custom colors are provided.\n *\n * @throws {Error} if any value is not a valid hex color code.\n */\nexport function resolveColors(\n\tcolors: readonly string[] | undefined,\n\tfallbackPalette: readonly string[],\n\tpluginName: string,\n): readonly string[] {\n\tif (!colors || colors.length === 0) return fallbackPalette;\n\n\tconst invalid: string[] = colors.filter((c) => !isValidHexColor(c));\n\tif (invalid.length > 0) {\n\t\tthrow new Error(\n\t\t\t`${pluginName}: invalid hex color(s): ${invalid.join(', ')}. Expected format: #RGB or #RRGGBB.`,\n\t\t);\n\t}\n\n\tconst seen: Set<string> = new Set();\n\tconst unique: string[] = [];\n\tfor (const color of colors) {\n\t\tconst normalized: string = color.toLowerCase();\n\t\tif (!seen.has(normalized)) {\n\t\t\tseen.add(normalized);\n\t\t\tunique.push(normalized);\n\t\t}\n\t}\n\treturn unique;\n}\n\n// --- Font Family Validation ---\n\n/** Characters that are never valid in a CSS font-family value. */\nconst FONT_FAMILY_FORBIDDEN: RegExp = /[{}<>;]|url\\(|expression\\(/i;\n\n/**\n * Returns `true` when `value` is a safe CSS `font-family` value.\n * Rejects values containing `{`, `}`, `;`, `<`, `>`, `url(`, or `expression(`\n * to defend against CSS injection.\n */\nexport function isValidCSSFontFamily(value: string): boolean {\n\tif (!value) return false;\n\tconst trimmed: string = value.trim();\n\tif (!trimmed) return false;\n\treturn !FONT_FAMILY_FORBIDDEN.test(trimmed);\n}\n\n// --- Font Size Validation ---\n\n/** Matches valid CSS font-size values: number with unit (px, pt, em, rem, %). */\nconst FONT_SIZE_PATTERN: RegExp = /^\\d+(\\.\\d+)?(px|pt|em|rem|%)$/i;\n\n/**\n * Returns `true` when `value` is a safe CSS `font-size` value.\n * Accepts values like `16px`, `1.5em`, `12pt`, `100%`, `0.875rem`.\n */\nexport function isValidCSSFontSize(value: string): boolean {\n\tif (!value) return false;\n\treturn FONT_SIZE_PATTERN.test(value.trim());\n}\n"],"names":["HEX_COLOR_PATTERN","isValidHexColor","value","test","RGB_PATTERN","HSL_PATTERN","CSS_NAMED_COLORS","Set","isValidCSSColor","trimmed","trim","toLowerCase","has","resolveColors","colors","fallbackPalette","pluginName","length","invalid","filter","c","Error","join","seen","unique","color","normalized","add","push","FONT_FAMILY_FORBIDDEN","isValidCSSFontFamily","FONT_SIZE_PATTERN","isValidCSSFontSize"],"mappings":"AAKA,MAAMA,EAA4B,gCAG3B,SAASC,EAAgBC,GAC/B,OAAOF,EAAkBG,KAAKD,EAC/B,CAKA,MAAME,EACL,yEAGKC,EACL,gFAMKC,qBAA4CC,IAAI,CACrD,YACA,eACA,OACA,aACA,QACA,QACA,SACA,QACA,iBACA,OACA,aACA,QACA,YACA,YACA,aACA,YACA,QACA,iBACA,WACA,UACA,OACA,WACA,WACA,gBACA,WACA,YACA,WACA,YACA,cACA,iBACA,aACA,aACA,UACA,aACA,eACA,gBACA,gBACA,gBACA,gBACA,aACA,WACA,cACA,UACA,UACA,aACA,YACA,cACA,cACA,UACA,YACA,aACA,OACA,YACA,OACA,QACA,cACA,OACA,WACA,UACA,YACA,SACA,QACA,QACA,WACA,gBACA,YACA,eACA,YACA,aACA,YACA,uBACA,YACA,aACA,YACA,YACA,cACA,gBACA,eACA,iBACA,iBACA,iBACA,cACA,OACA,YACA,QACA,UACA,SACA,mBACA,aACA,eACA,eACA,iBACA,kBACA,oBACA,kBACA,kBACA,eACA,YACA,YACA,WACA,cACA,OACA,UACA,QACA,YACA,SACA,YACA,SACA,gBACA,YACA,gBACA,gBACA,aACA,YACA,OACA,OACA,OACA,aACA,SACA,gBACA,MACA,YACA,YACA,cACA,SACA,aACA,WACA,WACA,SACA,SACA,UACA,YACA,YACA,YACA,OACA,cACA,YACA,MACA,OACA,UACA,SACA,cACA,YACA,SACA,QACA,QACA,aACA,SACA,gBASM,SAASC,EAAgBN,GAC/B,IAAKA,EAAO,OAAO,EACnB,MAAMO,EAAkBP,EAAMQ,OAAOC,cACrC,QAAKF,IAGJT,EAAkBG,KAAKM,IACvBL,EAAYD,KAAKM,IACjBJ,EAAYF,KAAKM,IACjBH,EAAiBM,IAAIH,GAEvB,CAQO,SAASI,EACfC,EACAC,EACAC,GAEA,IAAKF,GAA4B,IAAlBA,EAAOG,OAAc,OAAOF,EAE3C,MAAMG,EAAoBJ,EAAOK,OAAQC,IAAOnB,EAAgBmB,IAChE,GAAIF,EAAQD,OAAS,EACpB,MAAM,IAAII,MACT,GAAGL,4BAAqCE,EAAQI,KAAK,4CAIvD,MAAMC,qBAAwBhB,IACxBiB,EAAmB,GACzB,IAAA,MAAWC,KAASX,EAAQ,CAC3B,MAAMY,EAAqBD,EAAMd,cAC5BY,EAAKX,IAAIc,KACbH,EAAKI,IAAID,GACTF,EAAOI,KAAKF,GAEd,CACA,OAAOF,CACR,CAKA,MAAMK,EAAgC,8BAO/B,SAASC,EAAqB5B,GACpC,IAAKA,EAAO,OAAO,EACnB,MAAMO,EAAkBP,EAAMQ,OAC9B,QAAKD,IACGoB,EAAsB1B,KAAKM,EACpC,CAKA,MAAMsB,EAA4B,iCAM3B,SAASC,EAAmB9B,GAClC,QAAKA,GACE6B,EAAkB5B,KAAKD,EAAMQ,OACrC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n,c as r,e as t,f as o,p as e}from"./Document-3pNX7ear.mjs";import{b as s,c as i,i as c,s as f}from"./Selection-DhbizDM4.mjs";import{n as a}from"./TypeBrands-Bp_Z_o5Y.mjs";import{b as u}from"./NavigationQueries-11qe4j9x.mjs";function l(n,r){if(0===r.length)return n.doc.children;const t=n.getBlock(r[r.length-1]);return t?t.children:[]}function d(n){return r(a("paragraph"),[t("")],n)}function m(n,r){if(c(n))return{blockId:n.anchor.blockId,offset:n.anchor.offset};const t=f(n,r);return{blockId:t.from.blockId,offset:t.from.offset}}function h(n){return n&&n.length>1?n.slice(0,-1):[]}function g(r,t){return r.findIndex(r=>n(r)&&r.id===t)}function p(r){if(e(r))return r.id;for(const t of r.children)if(n(t))return p(t);return r.id}function b(r){if(e(r))return r.id;for(let t=r.children.length-1;t>=0;t--){const o=r.children[t];if(o&&n(o))return b(o)}return r.id}function k(n,r,t){const e=n.getBlock(r);if(!e)return null;if(u(n,r)){const t=n.getNodePath(r);return t?s(r,t):null}const c="start"===t?p(e):b(e),f=n.getBlock(c);if(!f)return null;const a="start"===t?0:o(f);return i(c,a)}export{k as a,p as b,d as c,b as d,h as e,g as f,l as g,m as r};
|
|
2
|
-
//# sourceMappingURL=CommandHelpers-M6mPS6Ww.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommandHelpers-M6mPS6Ww.mjs","sources":["../../src/commands/CommandHelpers.ts"],"sourcesContent":["/**\n * Shared helpers used across multiple command modules.\n *\n * - {@link getSiblings} — resolves a parent path to its child list\n * - {@link createEmptyParagraph} — builds an empty paragraph BlockNode\n * - {@link resolveInsertPoint} — normalizes a text selection to a single insert position\n */\n\nimport type { BlockNode, ChildNode, Document } from '../model/Document.js';\nimport {\n\tcreateBlockNode,\n\tcreateTextNode,\n\tgetBlockLength,\n\tisBlockNode,\n\tisLeafBlock,\n} from '../model/Document.js';\nimport {\n\tcreateCollapsedSelection,\n\tcreateNodeSelection,\n\tisCollapsed,\n\tselectionRange,\n} from '../model/Selection.js';\nimport type { EditorSelection, Selection } 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 { isVoidBlock } from '../state/NavigationQueries.js';\n\n/** The resolved insert position within a single block. */\nexport interface InsertPoint {\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n}\n\n/** Resolves the children of a parent path: doc root or a nested block. */\nexport function getSiblings(\n\tstate: EditorState,\n\tparentPath: readonly BlockId[],\n): readonly ChildNode[] {\n\tif (parentPath.length === 0) return state.doc.children;\n\tconst parent: BlockNode | undefined = state.getBlock(\n\t\tparentPath[parentPath.length - 1] as BlockId,\n\t);\n\treturn parent ? parent.children : [];\n}\n\n/** Creates an empty paragraph block node with the given ID. */\nexport function createEmptyParagraph(id: BlockId): BlockNode {\n\treturn createBlockNode(nodeType('paragraph'), [createTextNode('')], id);\n}\n\n/**\n * Normalizes a text selection to a single insert point.\n *\n * - Collapsed selection → anchor position.\n * - Range selection → normalized `from` position (document-order start).\n */\nexport function resolveInsertPoint(sel: Selection, blockOrder: readonly BlockId[]): InsertPoint {\n\tif (isCollapsed(sel)) {\n\t\treturn { blockId: sel.anchor.blockId, offset: sel.anchor.offset };\n\t}\n\tconst range = selectionRange(sel, blockOrder);\n\treturn { blockId: range.from.blockId, offset: range.from.offset };\n}\n\n/** Extracts the parent path from a full node path (all elements except the last). */\nexport function extractParentPath(path: readonly string[] | undefined): BlockId[] {\n\treturn path && path.length > 1 ? (path.slice(0, -1) as BlockId[]) : [];\n}\n\n/** Finds the index of a block by ID within a sibling list. */\nexport function findSiblingIndex(siblings: readonly ChildNode[], targetId: BlockId): number {\n\treturn siblings.findIndex((c) => isBlockNode(c) && c.id === targetId);\n}\n\n/** Finds the first leaf block ID in a subtree. */\nexport function findFirstLeafBlockId(node: BlockNode): BlockId {\n\tif (isLeafBlock(node)) return node.id;\n\n\tfor (const child of node.children) {\n\t\tif (!isBlockNode(child)) continue;\n\t\treturn findFirstLeafBlockId(child);\n\t}\n\n\treturn node.id;\n}\n\n/** Finds the last leaf block ID in a subtree. */\nexport function findLastLeafBlockId(node: BlockNode): BlockId {\n\tif (isLeafBlock(node)) return node.id;\n\n\tfor (let i = node.children.length - 1; i >= 0; i--) {\n\t\tconst child = node.children[i];\n\t\tif (child && isBlockNode(child)) {\n\t\t\treturn findLastLeafBlockId(child);\n\t\t}\n\t}\n\n\treturn node.id;\n}\n\n/**\n * Resolves a valid editor selection at the start or end of a block subtree.\n * Void blocks become NodeSelections; text-capable blocks resolve to leaf cursors.\n */\nexport function createSelectionForBlockBoundary(\n\tstate: EditorState,\n\tblockId: BlockId,\n\tboundary: 'start' | 'end',\n): EditorSelection | null {\n\tconst block = state.getBlock(blockId);\n\tif (!block) return null;\n\n\tif (isVoidBlock(state, blockId)) {\n\t\tconst path = state.getNodePath(blockId);\n\t\treturn path ? createNodeSelection(blockId, path) : null;\n\t}\n\n\tconst leafId: BlockId =\n\t\tboundary === 'start' ? findFirstLeafBlockId(block) : findLastLeafBlockId(block);\n\tconst leaf = state.getBlock(leafId);\n\tif (!leaf) return null;\n\n\tconst offset = boundary === 'start' ? 0 : getBlockLength(leaf);\n\treturn createCollapsedSelection(leafId, offset);\n}\n\n/** Returns the root-level block IDs in document order. */\nexport function getRootBlockIds(doc: Document): readonly BlockId[] {\n\treturn doc.children.map((child) => child.id);\n}\n"],"names":["getSiblings","state","parentPath","length","doc","children","parent","getBlock","createEmptyParagraph","id","createBlockNode","nodeType","createTextNode","resolveInsertPoint","sel","blockOrder","isCollapsed","blockId","anchor","offset","range","selectionRange","from","extractParentPath","path","slice","findSiblingIndex","siblings","targetId","findIndex","c","isBlockNode","findFirstLeafBlockId","node","isLeafBlock","child","findLastLeafBlockId","i","createSelectionForBlockBoundary","boundary","block","isVoidBlock","getNodePath","createNodeSelection","leafId","le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AAO,OAAO,KAEnB,GAAIC,EAAYxC,EAAOgB,GAAU,CAChC,MAAMO,EAAOvB,EAAMyC,YAAYzB,GAC/B,OAAOO,EAAOmB,EAAoB1B,EAASO,GAAQ,IACpD,CAEA,MAAMoB,EACQ,UAAbL,EAAuBP,EAAqBQ,GAASJ,EAAoBI,GACpEK,EAAO5C,EAAMM,SAASqC,GAC5B,IAAKC,EAAM,OAAO,KAElB,MAAM1B,EAAsB,UAAboB,EAAuB,EAAIO,EAAeD,GACzD,OAAOE,EAAyBH,EAAQzB,EACzC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{f as t,s as e,d as o,h as n,p as r}from"./Document-3pNX7ear.mjs";import{a as c}from"./NodeResolver-z0ReCR34.mjs";import{b as s,c as i,h as l,g as f,i as d,s as u,j as a,e as k}from"./Selection-DhbizDM4.mjs";import{i as b}from"./TypeBrands-Bp_Z_o5Y.mjs";import{b as m,a as I,s as g,i as h}from"./NavigationQueries-11qe4j9x.mjs";import{e as p,g as B,f as S,c as x,r as O,b as A,d as j}from"./CommandHelpers-M6mPS6Ww.mjs";import{d as N,i as T,a as v}from"./NodeSelectionCommands-CXrOcPtG.mjs";function w(e,o){if("after"===o.side)return C(e,o);const n=e.getBlockOrder(),r=n.indexOf(o.blockId);if(r<=0)return null;const l=n[r-1];if(!l)return null;if(m(e,l)){const t=c(e.doc,l)??[];return e.transaction("input").setSelection(s(l,t)).build()}const f=e.getBlock(l);if(!f)return null;const d=t(f);return e.transaction("input").setSelection(i(l,d)).build()}function M(t,e){if("before"===e.side)return C(t,e);const o=t.getBlockOrder(),n=o.indexOf(e.blockId);if(n>=o.length-1)return null;const r=o[n+1];if(!r)return null;if(m(t,r)){const e=c(t.doc,r)??[];return t.transaction("input").setSelection(s(r,e)).build()}return t.transaction("input").setSelection(i(r,0)).build()}function C(t,e){const o=c(t.doc,e.blockId)??[],n=s(e.blockId,o);return N(t,n)}function _(t,o,r="input"){const s=t.selection;if(l(s))return T(t,s,o,r);if(f(s))return function(t,o,n,r){const s=c(t.doc,o.blockId),l=p(s),f=B(t,l),d=S(f,o.blockId),u="before"===o.side?Math.max(d,0):d>=0?d+1:f.length,a=e(),k=t.transaction(r);return k.insertNode(l,u,x(a)),k.insertText(a,0,n,[]),k.setSelection(i(a,n.length)),k.build()}(t,s,o,r);const u=t.transaction(r),k=function(t){if(t.storedMarks)return t.storedMarks;if(!a(t.selection))return[];const e=t.getBlock(t.selection.anchor.blockId);return e?n(e,t.selection.anchor.offset):[]}(t);let b;d(s)||(b=E(t,u));const m=O(s,t.getBlockOrder()),I=b??m.blockId,g=b?0:m.offset;return u.insertText(I,g,o,k),u.setSelection(i(I,g+o.length)),u.build()}function y(t){if(l(t.selection))return N(t,t.selection);if(f(t.selection))return null;if(d(t.selection))return null;const e=t.transaction("input"),o=E(t,e),n=u(t.selection,t.getBlockOrder()),r=o??n.from.blockId,c=o?0:n.from.offset;return e.setSelection(i(r,c)),e.build()}function D(t){const o=t.selection;if(l(o))return v(t,o);if(f(o))return function(t,o){const n=c(t.doc,o.blockId);if(!n)return null;const r=p(n),s=B(t,r),l=S(s,o.blockId);if(l<0)return null;const f="before"===o.side?l:l+1,d=e(),u=t.transaction("input");return u.insertNode(r,f,x(d)),u.setSelection(i(d,0)),u.build()}(t,o);const n=t.transaction("input");let r;d(o)||(r=E(t,n));const s=O(o,t.getBlockOrder()),u=r??s.blockId,a=r?0:s.offset,k=e();return n.splitBlock(u,a,k),n.setSelection(i(k,0)),n.build()}function H(t){const e=t.selection;if(!a(e))return null;const n=t.transaction("input");let r;if(d(e)||(r=E(t,n)),r)n.insertInlineNode(r,0,o(b("hard_break"))),n.setSelection(i(r,1));else{const{blockId:r,offset:c}=O(e,t.getBlockOrder());n.insertInlineNode(r,c,o(b("hard_break"))),n.setSelection(i(r,c+1))}return n.build()}function Q(t){return q(t,"backward")}function R(t){return q(t,"forward")}function q(e,o){const n=e.selection;if(!a(n))return null;const r=e.getBlockOrder(),l=r.indexOf(n.anchor.blockId),f="backward"===o?l-1:l+1;if(f<0||f>=r.length)return null;const d=r[f];if(!d)return null;if(I(e,n.anchor.blockId)||I(e,d))return null;if(!g(e,n.anchor.blockId,d)&&h(e,n.anchor.blockId))return null;if(m(e,d)){const t=c(e.doc,d)??[];return e.transaction("input").setSelection(s(d,t)).build()}if("backward"===o){const o=e.getBlock(d);if(!o)return null;const r=t(o);return e.transaction("input").mergeBlocksAt(d,n.anchor.blockId).setSelection(i(d,r)).build()}return e.transaction("input").mergeBlocksAt(n.anchor.blockId,d).setSelection(i(n.anchor.blockId,n.anchor.offset)).build()}function z(e){const o=e.doc.children,n=o[0],r=o[o.length-1];if(!n||!r)return e.transaction("command").setSelection(e.selection).build();const c=A(n),s=j(r),i=e.getBlock(s),l=i?t(i):0;return e.transaction("command").setSelection(k({blockId:c,offset:0},{blockId:s,offset:l})).build()}function E(o,n){if(!a(o.selection))return;const c=o.getBlockOrder(),s=u(o.selection,c),i=c.indexOf(s.from.blockId),l=c.indexOf(s.to.blockId);if(i===l)return void n.deleteTextAt(s.from.blockId,s.from.offset,s.to.offset);const f=F(o,s.from.blockId),d=F(o,s.to.blockId);if(!(f===d||f<0||d<0))return function(o,n,c,s,i){const l=o.doc.children[s],f=o.doc.children[i];if(!l||!f)return;const d=r(l),u=r(f);let a,k=0;if(d||(a=e(),n.insertNode([],s,x(a)),k=1),d){const e=o.getBlock(c.from.blockId);if(e){const o=t(e);c.from.offset<o&&n.deleteTextAt(c.from.blockId,c.from.offset,o)}}u&&c.to.offset>0&&n.deleteTextAt(c.to.blockId,0,c.to.offset);const b=d?s+1:s+k;for(let t=u?i-1+k:i+k;t>=b;t--)n.removeNode([],t);return d&&u&&n.mergeBlocksAt(c.from.blockId,c.to.blockId),a}(o,n,s,f,d);!function(e,o,n,r,c,s){const i=e.getBlock(r.from.blockId);if(!i)return;const l=t(i);r.from.offset<l&&o.deleteTextAt(r.from.blockId,r.from.offset,l),r.to.offset>0&&o.deleteTextAt(r.to.blockId,0,r.to.offset);for(let f=c+1;f<s;f++){const c=n[f];if(!c)continue;const s=e.getBlock(c);if(!s)continue;const i=t(s);i>0&&o.deleteTextAt(c,0,i),o.mergeBlocksAt(r.from.blockId,c)}o.mergeBlocksAt(r.from.blockId,r.to.blockId)}(o,n,c,s,i,l)}function F(t,e){const o=c(t.doc,e);if(!o||0===o.length)return-1;const n=o[0];return t.doc.children.findIndex(t=>t.id===n)}export{M as a,y as b,_ as c,w as d,D as e,R as f,E as g,H as i,Q as m,z as s};
|
|
2
|
-
//# sourceMappingURL=Commands-D_gMCnVa.mjs.map
|