@notectl/core 2.0.5 → 2.0.7
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/dist/chunks/AlignmentPlugin-CD11uRY3.mjs +2 -0
- package/dist/chunks/AlignmentPlugin-CD11uRY3.mjs.map +1 -0
- package/dist/chunks/AttrRegistry-nDKtHK87.mjs +2 -0
- package/dist/chunks/AttrRegistry-nDKtHK87.mjs.map +1 -0
- package/dist/chunks/AttributedMarkCommands-D_PYkbBt.mjs +2 -0
- package/dist/chunks/AttributedMarkCommands-D_PYkbBt.mjs.map +1 -0
- package/dist/chunks/BlockInsertion-DaG_4D31.mjs +2 -0
- package/dist/chunks/BlockInsertion-DaG_4D31.mjs.map +1 -0
- package/dist/chunks/BlockTypePickerRegistry-C_jLddOz.mjs +2 -0
- package/dist/chunks/BlockTypePickerRegistry-C_jLddOz.mjs.map +1 -0
- package/dist/chunks/BlockquotePlugin-DpMA33pk.mjs +2 -0
- package/dist/chunks/BlockquotePlugin-DpMA33pk.mjs.map +1 -0
- package/dist/chunks/CaretNavigationPlugin-BxU2lMwX.mjs +2 -0
- package/dist/chunks/CaretNavigationPlugin-BxU2lMwX.mjs.map +1 -0
- package/dist/chunks/CodeBlockPlugin-CSb6Fxce.mjs +2 -0
- package/dist/chunks/CodeBlockPlugin-CSb6Fxce.mjs.map +1 -0
- package/dist/chunks/ColorGrid-BNDaG3b2.mjs +2 -0
- package/dist/chunks/ColorGrid-BNDaG3b2.mjs.map +1 -0
- package/dist/chunks/ColorPickerPopup-BwU_WZHh.mjs +2 -0
- package/dist/chunks/ColorPickerPopup-BwU_WZHh.mjs.map +1 -0
- package/dist/chunks/ColorValidation-CiGxVsqd.mjs +2 -0
- package/dist/chunks/ColorValidation-CiGxVsqd.mjs.map +1 -0
- package/dist/chunks/CommandHelpers-BoRO1KfE.mjs +2 -0
- package/dist/chunks/CommandHelpers-BoRO1KfE.mjs.map +1 -0
- package/dist/chunks/Commands-C7zBYmhA.mjs +2 -0
- package/dist/chunks/Commands-C7zBYmhA.mjs.map +1 -0
- package/dist/chunks/Decoration-oeHDjWWq.mjs +2 -0
- package/dist/chunks/Decoration-oeHDjWWq.mjs.map +1 -0
- package/dist/chunks/Document-_qdGR4vh.mjs +2 -0
- package/dist/chunks/Document-_qdGR4vh.mjs.map +1 -0
- package/dist/chunks/DocumentParser-Cq_bFYAS.mjs +2 -0
- package/dist/chunks/DocumentParser-Cq_bFYAS.mjs.map +1 -0
- package/dist/chunks/DomUtils-RKbAVBQz.mjs +2 -0
- package/dist/chunks/DomUtils-RKbAVBQz.mjs.map +1 -0
- package/dist/chunks/FontPlugin-CUVcS-40.mjs +2 -0
- package/dist/chunks/FontPlugin-CUVcS-40.mjs.map +1 -0
- package/dist/chunks/FontSizePlugin-a8YyFsjf.mjs +2 -0
- package/dist/chunks/FontSizePlugin-a8YyFsjf.mjs.map +1 -0
- package/dist/chunks/GapCursorNavigation-PhJeqELx.mjs +2 -0
- package/dist/chunks/GapCursorNavigation-PhJeqELx.mjs.map +1 -0
- package/dist/chunks/GapCursorPlugin-9V0Ne0Sw.mjs +2 -0
- package/dist/chunks/GapCursorPlugin-9V0Ne0Sw.mjs.map +1 -0
- package/dist/chunks/HTMLUtils-B8xj8Z1x.mjs +2 -0
- package/dist/chunks/HTMLUtils-B8xj8Z1x.mjs.map +1 -0
- package/dist/chunks/HardBreakPlugin-BzAU3DoJ.mjs +2 -0
- package/dist/chunks/HardBreakPlugin-BzAU3DoJ.mjs.map +1 -0
- package/dist/chunks/HeadingPlugin-1BVn57NF.mjs +2 -0
- package/dist/chunks/HeadingPlugin-1BVn57NF.mjs.map +1 -0
- package/dist/chunks/HighlightPlugin-7S6Y_IFY.mjs +2 -0
- package/dist/chunks/HighlightPlugin-7S6Y_IFY.mjs.map +1 -0
- package/dist/chunks/HorizontalRulePlugin-bZ4nat7E.mjs +2 -0
- package/dist/chunks/HorizontalRulePlugin-bZ4nat7E.mjs.map +1 -0
- package/dist/chunks/ImagePlugin-wz0SBhFQ.mjs +2 -0
- package/dist/chunks/ImagePlugin-wz0SBhFQ.mjs.map +1 -0
- package/dist/chunks/InlineCodePlugin-DW5_oiac.mjs +2 -0
- package/dist/chunks/InlineCodePlugin-DW5_oiac.mjs.map +1 -0
- package/dist/chunks/KeyboardNav-CsdlWnNl.mjs +2 -0
- package/dist/chunks/KeyboardNav-CsdlWnNl.mjs.map +1 -0
- package/dist/chunks/LinkPlugin-pWzPs-dS.mjs +2 -0
- package/dist/chunks/LinkPlugin-pWzPs-dS.mjs.map +1 -0
- package/dist/chunks/ListPlugin-Datp4nPR.mjs +2 -0
- package/dist/chunks/ListPlugin-Datp4nPR.mjs.map +1 -0
- package/dist/chunks/NavigationQueries-_xQtPALX.mjs +2 -0
- package/dist/chunks/NavigationQueries-_xQtPALX.mjs.map +1 -0
- package/dist/chunks/NodeResolver-DVPpO5nC.mjs +2 -0
- package/dist/chunks/NodeResolver-DVPpO5nC.mjs.map +1 -0
- package/dist/chunks/NodeSelectionCommands-BFHLrE5I.mjs +2 -0
- package/dist/chunks/NodeSelectionCommands-BFHLrE5I.mjs.map +1 -0
- package/dist/chunks/Platform-D9TRT4Mn.mjs +2 -0
- package/dist/chunks/Platform-D9TRT4Mn.mjs.map +1 -0
- package/dist/chunks/Plugin-BUNGKupW.mjs +2 -0
- package/dist/chunks/Plugin-BUNGKupW.mjs.map +1 -0
- package/dist/chunks/PluginHelpers-Db50-BRE.mjs +2 -0
- package/dist/chunks/PluginHelpers-Db50-BRE.mjs.map +1 -0
- package/dist/chunks/PopupManager-DaTySyZl.mjs +2 -0
- package/dist/chunks/PopupManager-DaTySyZl.mjs.map +1 -0
- package/dist/chunks/PopupPositioning-DRNwWB0U.mjs +2 -0
- package/dist/chunks/PopupPositioning-DRNwWB0U.mjs.map +1 -0
- package/dist/chunks/PrintPlugin-Dv8_E40e.mjs +2 -0
- package/dist/chunks/PrintPlugin-Dv8_E40e.mjs.map +1 -0
- package/dist/chunks/PrintTypes-DTV3-mSe.mjs +2 -0
- package/dist/chunks/PrintTypes-DTV3-mSe.mjs.map +1 -0
- package/dist/chunks/RangeIterator-CVUeIB4P.mjs +2 -0
- package/dist/chunks/RangeIterator-CVUeIB4P.mjs.map +1 -0
- package/dist/chunks/Selection-aeiSsvhe.mjs +2 -0
- package/dist/chunks/Selection-aeiSsvhe.mjs.map +1 -0
- package/dist/chunks/ShortcutFormatting-DE6B8iGs.mjs +2 -0
- package/dist/chunks/ShortcutFormatting-DE6B8iGs.mjs.map +1 -0
- package/dist/chunks/SmartPastePlugin-PCLFN5yA.mjs +2 -0
- package/dist/chunks/SmartPastePlugin-PCLFN5yA.mjs.map +1 -0
- package/dist/chunks/StrikethroughPlugin-J5eDn_sY.mjs +2 -0
- package/dist/chunks/StrikethroughPlugin-J5eDn_sY.mjs.map +1 -0
- package/dist/chunks/StyleRuntime-D3d1XFFe.mjs +2 -0
- package/dist/chunks/StyleRuntime-D3d1XFFe.mjs.map +1 -0
- package/dist/chunks/SuperSubPlugin-uSLscUwN.mjs +2 -0
- package/dist/chunks/SuperSubPlugin-uSLscUwN.mjs.map +1 -0
- package/dist/chunks/SyntaxTokenTypes-CVUAMov0.mjs +2 -0
- package/dist/chunks/SyntaxTokenTypes-CVUAMov0.mjs.map +1 -0
- package/dist/chunks/TablePlugin-DJHHWTD2.mjs +2 -0
- package/dist/chunks/TablePlugin-DJHHWTD2.mjs.map +1 -0
- package/dist/chunks/TextColorPlugin-CawTv5pV.mjs +2 -0
- package/dist/chunks/TextColorPlugin-CawTv5pV.mjs.map +1 -0
- package/dist/chunks/TextDirectionCorePlugin-CXCxX532.mjs +2 -0
- package/dist/chunks/TextDirectionCorePlugin-CXCxX532.mjs.map +1 -0
- package/dist/chunks/TextDirectionLocale-Kh3r4XQS.mjs +2 -0
- package/dist/chunks/TextDirectionLocale-Kh3r4XQS.mjs.map +1 -0
- package/dist/chunks/TextFormattingPlugin-DKgwX4Gy.mjs +2 -0
- package/dist/chunks/TextFormattingPlugin-DKgwX4Gy.mjs.map +1 -0
- package/dist/chunks/ToolbarPlugin-BipA0zez.mjs +2 -0
- package/dist/chunks/ToolbarPlugin-BipA0zez.mjs.map +1 -0
- package/dist/chunks/TypeBrands-BZDKMjR-.mjs +2 -0
- package/dist/chunks/TypeBrands-BZDKMjR-.mjs.map +1 -0
- package/dist/chunks/WordBoundary-DI0G6Wk2.mjs +2 -0
- package/dist/chunks/WordBoundary-DI0G6Wk2.mjs.map +1 -0
- package/dist/chunks/XmlDetector-DlRdJOIX.mjs +2 -0
- package/dist/chunks/XmlDetector-DlRdJOIX.mjs.map +1 -0
- package/dist/chunks/XmlPatterns-Dwmn4nrg.mjs +2 -0
- package/dist/chunks/XmlPatterns-Dwmn4nrg.mjs.map +1 -0
- package/dist/chunks/XmlSupport-UA-iNWTl.mjs +2 -0
- package/dist/chunks/XmlSupport-UA-iNWTl.mjs.map +1 -0
- package/dist/chunks/ar-13q9ejck.mjs +2 -0
- package/dist/chunks/ar-13q9ejck.mjs.map +1 -0
- package/dist/chunks/ar-7XO2HmsM.mjs +2 -0
- package/dist/chunks/ar-7XO2HmsM.mjs.map +1 -0
- package/dist/chunks/ar-B-n_gMXb.mjs +2 -0
- package/dist/chunks/ar-B-n_gMXb.mjs.map +1 -0
- package/dist/chunks/ar-BXeE6tKj.mjs +2 -0
- package/dist/chunks/ar-BXeE6tKj.mjs.map +1 -0
- package/dist/chunks/ar-Bs3sx3Oz.mjs +2 -0
- package/dist/chunks/ar-Bs3sx3Oz.mjs.map +1 -0
- package/dist/chunks/ar-ByNQ-o3t.mjs +2 -0
- package/dist/chunks/ar-ByNQ-o3t.mjs.map +1 -0
- package/dist/chunks/ar-C9AnO0uV.mjs +2 -0
- package/dist/chunks/ar-C9AnO0uV.mjs.map +1 -0
- package/dist/chunks/ar-CL-NsFoh.mjs +2 -0
- package/dist/chunks/ar-CL-NsFoh.mjs.map +1 -0
- package/dist/chunks/ar-COx4cFpT.mjs +2 -0
- package/dist/chunks/ar-COx4cFpT.mjs.map +1 -0
- package/dist/chunks/ar-CYZYoqcc.mjs +2 -0
- package/dist/chunks/ar-CYZYoqcc.mjs.map +1 -0
- package/dist/chunks/ar-ChOxTdPI.mjs +2 -0
- package/dist/chunks/ar-ChOxTdPI.mjs.map +1 -0
- package/dist/chunks/ar-Cj6amEs9.mjs +2 -0
- package/dist/chunks/ar-Cj6amEs9.mjs.map +1 -0
- package/dist/chunks/ar-CsH2S6Vd.mjs +2 -0
- package/dist/chunks/ar-CsH2S6Vd.mjs.map +1 -0
- package/dist/chunks/ar-D2y_YvMP.mjs +2 -0
- package/dist/chunks/ar-D2y_YvMP.mjs.map +1 -0
- package/dist/chunks/ar-D57VZrg2.mjs +2 -0
- package/dist/chunks/ar-D57VZrg2.mjs.map +1 -0
- package/dist/chunks/ar-DH06YQkP.mjs +2 -0
- package/dist/chunks/ar-DH06YQkP.mjs.map +1 -0
- package/dist/chunks/ar-DJ6K9HnU.mjs +2 -0
- package/dist/chunks/ar-DJ6K9HnU.mjs.map +1 -0
- package/dist/chunks/ar-DLxmSv7R.mjs +2 -0
- package/dist/chunks/ar-DLxmSv7R.mjs.map +1 -0
- package/dist/chunks/ar-DMNNIim-.mjs +2 -0
- package/dist/chunks/ar-DMNNIim-.mjs.map +1 -0
- package/dist/chunks/ar-DW0Inc7r.mjs +2 -0
- package/dist/chunks/ar-DW0Inc7r.mjs.map +1 -0
- package/dist/chunks/ar-SwJ-tyIu.mjs +2 -0
- package/dist/chunks/ar-SwJ-tyIu.mjs.map +1 -0
- package/dist/chunks/ar-Vfk7XFaz.mjs +2 -0
- package/dist/chunks/ar-Vfk7XFaz.mjs.map +1 -0
- package/dist/chunks/ar-izXCtb2I.mjs +2 -0
- package/dist/chunks/ar-izXCtb2I.mjs.map +1 -0
- package/dist/chunks/ar-jsznaXQ0.mjs +2 -0
- package/dist/chunks/ar-jsznaXQ0.mjs.map +1 -0
- package/dist/chunks/color-picker-D4Vi72Z_.mjs +2 -0
- package/dist/chunks/color-picker-D4Vi72Z_.mjs.map +1 -0
- package/dist/chunks/de-3PJCshB7.mjs +2 -0
- package/dist/chunks/de-3PJCshB7.mjs.map +1 -0
- package/dist/chunks/de-B92lssMU.mjs +2 -0
- package/dist/chunks/de-B92lssMU.mjs.map +1 -0
- package/dist/chunks/de-BJ8Lo9rY.mjs +2 -0
- package/dist/chunks/de-BJ8Lo9rY.mjs.map +1 -0
- package/dist/chunks/de-BjNoeX05.mjs +2 -0
- package/dist/chunks/de-BjNoeX05.mjs.map +1 -0
- package/dist/chunks/de-Bktm7FKk.mjs +2 -0
- package/dist/chunks/de-Bktm7FKk.mjs.map +1 -0
- package/dist/chunks/de-BnhP65y3.mjs +2 -0
- package/dist/chunks/de-BnhP65y3.mjs.map +1 -0
- package/dist/chunks/de-BqHw2LVH.mjs +2 -0
- package/dist/chunks/de-BqHw2LVH.mjs.map +1 -0
- package/dist/chunks/de-BzjqF_j0.mjs +2 -0
- package/dist/chunks/de-BzjqF_j0.mjs.map +1 -0
- package/dist/chunks/de-CWsXH4_J.mjs +2 -0
- package/dist/chunks/de-CWsXH4_J.mjs.map +1 -0
- package/dist/chunks/de-CWwHCIzX.mjs +2 -0
- package/dist/chunks/de-CWwHCIzX.mjs.map +1 -0
- package/dist/chunks/de-ChHR-g0q.mjs +2 -0
- package/dist/chunks/de-ChHR-g0q.mjs.map +1 -0
- package/dist/chunks/de-CqJFzINs.mjs +2 -0
- package/dist/chunks/de-CqJFzINs.mjs.map +1 -0
- package/dist/chunks/de-DAPQek-i.mjs +2 -0
- package/dist/chunks/de-DAPQek-i.mjs.map +1 -0
- package/dist/chunks/de-DPzOP2Ge.mjs +2 -0
- package/dist/chunks/de-DPzOP2Ge.mjs.map +1 -0
- package/dist/chunks/de-DhenqH4M.mjs +2 -0
- package/dist/chunks/de-DhenqH4M.mjs.map +1 -0
- package/dist/chunks/de-Ds6tfD71.mjs +2 -0
- package/dist/chunks/de-Ds6tfD71.mjs.map +1 -0
- package/dist/chunks/de-DxyfCVlM.mjs +2 -0
- package/dist/chunks/de-DxyfCVlM.mjs.map +1 -0
- package/dist/chunks/de-RSzW4zsb.mjs +2 -0
- package/dist/chunks/de-RSzW4zsb.mjs.map +1 -0
- package/dist/chunks/de-YiJZ87p6.mjs +2 -0
- package/dist/chunks/de-YiJZ87p6.mjs.map +1 -0
- package/dist/chunks/de-e7G64WBM.mjs +2 -0
- package/dist/chunks/de-e7G64WBM.mjs.map +1 -0
- package/dist/chunks/de-oeen0lTL.mjs +2 -0
- package/dist/chunks/de-oeen0lTL.mjs.map +1 -0
- package/dist/chunks/de-p1zboXJW.mjs +2 -0
- package/dist/chunks/de-p1zboXJW.mjs.map +1 -0
- package/dist/chunks/de-q2xHBWVU.mjs +2 -0
- package/dist/chunks/de-q2xHBWVU.mjs.map +1 -0
- package/dist/chunks/de-zjzkzZs9.mjs +2 -0
- package/dist/chunks/de-zjzkzZs9.mjs.map +1 -0
- package/dist/chunks/es-2U-tuiWo.mjs +2 -0
- package/dist/chunks/es-2U-tuiWo.mjs.map +1 -0
- package/dist/chunks/es-8kEYE5eN.mjs +2 -0
- package/dist/chunks/es-8kEYE5eN.mjs.map +1 -0
- package/dist/chunks/es-B2B0W46I.mjs +2 -0
- package/dist/chunks/es-B2B0W46I.mjs.map +1 -0
- package/dist/chunks/es-B8Ne6vhS.mjs +2 -0
- package/dist/chunks/es-B8Ne6vhS.mjs.map +1 -0
- package/dist/chunks/es-BBaS8xrI.mjs +2 -0
- package/dist/chunks/es-BBaS8xrI.mjs.map +1 -0
- package/dist/chunks/es-BJibD3UW.mjs +2 -0
- package/dist/chunks/es-BJibD3UW.mjs.map +1 -0
- package/dist/chunks/es-BL7KuLOg.mjs +2 -0
- package/dist/chunks/es-BL7KuLOg.mjs.map +1 -0
- package/dist/chunks/es-BUIOf37N.mjs +2 -0
- package/dist/chunks/es-BUIOf37N.mjs.map +1 -0
- package/dist/chunks/es-BcEc0JEI.mjs +2 -0
- package/dist/chunks/es-BcEc0JEI.mjs.map +1 -0
- package/dist/chunks/es-BjomAlG3.mjs +2 -0
- package/dist/chunks/es-BjomAlG3.mjs.map +1 -0
- package/dist/chunks/es-BpgE28ol.mjs +2 -0
- package/dist/chunks/es-BpgE28ol.mjs.map +1 -0
- package/dist/chunks/es-Bq_XkuDG.mjs +2 -0
- package/dist/chunks/es-Bq_XkuDG.mjs.map +1 -0
- package/dist/chunks/es-BtTQw2t5.mjs +2 -0
- package/dist/chunks/es-BtTQw2t5.mjs.map +1 -0
- package/dist/chunks/es-Bwy7v223.mjs +2 -0
- package/dist/chunks/es-Bwy7v223.mjs.map +1 -0
- package/dist/chunks/es-C0Jm_n57.mjs +2 -0
- package/dist/chunks/es-C0Jm_n57.mjs.map +1 -0
- package/dist/chunks/es-C49UmQIT.mjs +2 -0
- package/dist/chunks/es-C49UmQIT.mjs.map +1 -0
- package/dist/chunks/es-CCAT_-nb.mjs +2 -0
- package/dist/chunks/es-CCAT_-nb.mjs.map +1 -0
- package/dist/chunks/es-CGGqdLIQ.mjs +2 -0
- package/dist/chunks/es-CGGqdLIQ.mjs.map +1 -0
- package/dist/chunks/es-CYKm6CQM.mjs +2 -0
- package/dist/chunks/es-CYKm6CQM.mjs.map +1 -0
- package/dist/chunks/es-C_L1Wdfi.mjs +2 -0
- package/dist/chunks/es-C_L1Wdfi.mjs.map +1 -0
- package/dist/chunks/es-DEo4yDI6.mjs +2 -0
- package/dist/chunks/es-DEo4yDI6.mjs.map +1 -0
- package/dist/chunks/es-D_6MYvFK.mjs +2 -0
- package/dist/chunks/es-D_6MYvFK.mjs.map +1 -0
- package/dist/chunks/es-DcYIJR0T.mjs +2 -0
- package/dist/chunks/es-DcYIJR0T.mjs.map +1 -0
- package/dist/chunks/es-y2SZmX3P.mjs +2 -0
- package/dist/chunks/es-y2SZmX3P.mjs.map +1 -0
- package/dist/chunks/fonts-B3hiRKxQ.mjs +2 -0
- package/dist/chunks/fonts-B3hiRKxQ.mjs.map +1 -0
- package/dist/chunks/fr-Ame1k629.mjs +2 -0
- package/dist/chunks/fr-Ame1k629.mjs.map +1 -0
- package/dist/chunks/fr-BCN045Ph.mjs +2 -0
- package/dist/chunks/fr-BCN045Ph.mjs.map +1 -0
- package/dist/chunks/fr-BQaiAAa6.mjs +2 -0
- package/dist/chunks/fr-BQaiAAa6.mjs.map +1 -0
- package/dist/chunks/fr-BR61Uevp.mjs +2 -0
- package/dist/chunks/fr-BR61Uevp.mjs.map +1 -0
- package/dist/chunks/fr-Bb-xVkAd.mjs +2 -0
- package/dist/chunks/fr-Bb-xVkAd.mjs.map +1 -0
- package/dist/chunks/fr-BhM3Ykql.mjs +2 -0
- package/dist/chunks/fr-BhM3Ykql.mjs.map +1 -0
- package/dist/chunks/fr-BqQRlsfW.mjs +2 -0
- package/dist/chunks/fr-BqQRlsfW.mjs.map +1 -0
- package/dist/chunks/fr-C81THS0v.mjs +2 -0
- package/dist/chunks/fr-C81THS0v.mjs.map +1 -0
- package/dist/chunks/fr-CXzpB6GU.mjs +2 -0
- package/dist/chunks/fr-CXzpB6GU.mjs.map +1 -0
- package/dist/chunks/fr-CjLyVnG3.mjs +2 -0
- package/dist/chunks/fr-CjLyVnG3.mjs.map +1 -0
- package/dist/chunks/fr-D66EEW9-.mjs +2 -0
- package/dist/chunks/fr-D66EEW9-.mjs.map +1 -0
- package/dist/chunks/fr-DHDNGQpl.mjs +2 -0
- package/dist/chunks/fr-DHDNGQpl.mjs.map +1 -0
- package/dist/chunks/fr-DOcFqSiX.mjs +2 -0
- package/dist/chunks/fr-DOcFqSiX.mjs.map +1 -0
- package/dist/chunks/fr-DPPHZ6H7.mjs +2 -0
- package/dist/chunks/fr-DPPHZ6H7.mjs.map +1 -0
- package/dist/chunks/fr-DVteHTTh.mjs +2 -0
- package/dist/chunks/fr-DVteHTTh.mjs.map +1 -0
- package/dist/chunks/fr-Dkeg9Am0.mjs +2 -0
- package/dist/chunks/fr-Dkeg9Am0.mjs.map +1 -0
- package/dist/chunks/fr-DnP_hh5Q.mjs +2 -0
- package/dist/chunks/fr-DnP_hh5Q.mjs.map +1 -0
- package/dist/chunks/fr-GSoPohxY.mjs +2 -0
- package/dist/chunks/fr-GSoPohxY.mjs.map +1 -0
- package/dist/chunks/fr-aDJE54Is.mjs +2 -0
- package/dist/chunks/fr-aDJE54Is.mjs.map +1 -0
- package/dist/chunks/fr-hStmLXCS.mjs +2 -0
- package/dist/chunks/fr-hStmLXCS.mjs.map +1 -0
- package/dist/chunks/fr-hUF51sR5.mjs +2 -0
- package/dist/chunks/fr-hUF51sR5.mjs.map +1 -0
- package/dist/chunks/fr-tK6rWhoz.mjs +2 -0
- package/dist/chunks/fr-tK6rWhoz.mjs.map +1 -0
- package/dist/chunks/fr-wqbTMwkj.mjs +2 -0
- package/dist/chunks/fr-wqbTMwkj.mjs.map +1 -0
- package/dist/chunks/fr-zO4UIZj_.mjs +2 -0
- package/dist/chunks/fr-zO4UIZj_.mjs.map +1 -0
- package/dist/chunks/full-DCZ8MMpe.mjs +2 -0
- package/dist/chunks/full-DCZ8MMpe.mjs.map +1 -0
- package/dist/chunks/hi-B7zs2lw-.mjs +2 -0
- package/dist/chunks/hi-B7zs2lw-.mjs.map +1 -0
- package/dist/chunks/hi-BE4pkSYX.mjs +2 -0
- package/dist/chunks/hi-BE4pkSYX.mjs.map +1 -0
- package/dist/chunks/hi-BEBdteKo.mjs +2 -0
- package/dist/chunks/hi-BEBdteKo.mjs.map +1 -0
- package/dist/chunks/hi-BFBRjxgB.mjs +2 -0
- package/dist/chunks/hi-BFBRjxgB.mjs.map +1 -0
- package/dist/chunks/hi-BGMkRr1l.mjs +2 -0
- package/dist/chunks/hi-BGMkRr1l.mjs.map +1 -0
- package/dist/chunks/hi-BKJbF0k9.mjs +2 -0
- package/dist/chunks/hi-BKJbF0k9.mjs.map +1 -0
- package/dist/chunks/hi-Bj-wENIe.mjs +2 -0
- package/dist/chunks/hi-Bj-wENIe.mjs.map +1 -0
- package/dist/chunks/hi-Bo_sc83d.mjs +2 -0
- package/dist/chunks/hi-Bo_sc83d.mjs.map +1 -0
- package/dist/chunks/hi-BqdojmVi.mjs +2 -0
- package/dist/chunks/hi-BqdojmVi.mjs.map +1 -0
- package/dist/chunks/hi-C2HFcJ8H.mjs +2 -0
- package/dist/chunks/hi-C2HFcJ8H.mjs.map +1 -0
- package/dist/chunks/hi-C9hGhR9D.mjs +2 -0
- package/dist/chunks/hi-C9hGhR9D.mjs.map +1 -0
- package/dist/chunks/hi-CRsCP_UU.mjs +2 -0
- package/dist/chunks/hi-CRsCP_UU.mjs.map +1 -0
- package/dist/chunks/hi-CSatC6e_.mjs +2 -0
- package/dist/chunks/hi-CSatC6e_.mjs.map +1 -0
- package/dist/chunks/hi-CTb2tu17.mjs +2 -0
- package/dist/chunks/hi-CTb2tu17.mjs.map +1 -0
- package/dist/chunks/hi-Cik-gmhU.mjs +2 -0
- package/dist/chunks/hi-Cik-gmhU.mjs.map +1 -0
- package/dist/chunks/hi-Co2ThMh7.mjs +2 -0
- package/dist/chunks/hi-Co2ThMh7.mjs.map +1 -0
- package/dist/chunks/hi-CrATuZJr.mjs +2 -0
- package/dist/chunks/hi-CrATuZJr.mjs.map +1 -0
- package/dist/chunks/hi-D-r5tA_n.mjs +2 -0
- package/dist/chunks/hi-D-r5tA_n.mjs.map +1 -0
- package/dist/chunks/hi-D0RKvhDO.mjs +2 -0
- package/dist/chunks/hi-D0RKvhDO.mjs.map +1 -0
- package/dist/chunks/hi-DOSbCXy_.mjs +2 -0
- package/dist/chunks/hi-DOSbCXy_.mjs.map +1 -0
- package/dist/chunks/hi-DTUY7wlZ.mjs +2 -0
- package/dist/chunks/hi-DTUY7wlZ.mjs.map +1 -0
- package/dist/chunks/hi-FhcxnL2S.mjs +2 -0
- package/dist/chunks/hi-FhcxnL2S.mjs.map +1 -0
- package/dist/chunks/hi-K71sKi2-.mjs +2 -0
- package/dist/chunks/hi-K71sKi2-.mjs.map +1 -0
- package/dist/chunks/hi-xjChf5ZY.mjs +2 -0
- package/dist/chunks/hi-xjChf5ZY.mjs.map +1 -0
- package/dist/chunks/minimal-DmYfqOxb.mjs +2 -0
- package/dist/chunks/minimal-DmYfqOxb.mjs.map +1 -0
- package/dist/chunks/pt-6uTV9TBd.mjs +2 -0
- package/dist/chunks/pt-6uTV9TBd.mjs.map +1 -0
- package/dist/chunks/pt-7ZYOqmC4.mjs +2 -0
- package/dist/chunks/pt-7ZYOqmC4.mjs.map +1 -0
- package/dist/chunks/pt-B65Mk0F_.mjs +2 -0
- package/dist/chunks/pt-B65Mk0F_.mjs.map +1 -0
- package/dist/chunks/pt-B9c20zi-.mjs +2 -0
- package/dist/chunks/pt-B9c20zi-.mjs.map +1 -0
- package/dist/chunks/pt-BRQRHBoW.mjs +2 -0
- package/dist/chunks/pt-BRQRHBoW.mjs.map +1 -0
- package/dist/chunks/pt-BYsPmDNG.mjs +2 -0
- package/dist/chunks/pt-BYsPmDNG.mjs.map +1 -0
- package/dist/chunks/pt-BattAVOq.mjs +2 -0
- package/dist/chunks/pt-BattAVOq.mjs.map +1 -0
- package/dist/chunks/pt-Bau_d96t.mjs +2 -0
- package/dist/chunks/pt-Bau_d96t.mjs.map +1 -0
- package/dist/chunks/pt-Bb3sODVO.mjs +2 -0
- package/dist/chunks/pt-Bb3sODVO.mjs.map +1 -0
- package/dist/chunks/pt-BieXcDHi.mjs +2 -0
- package/dist/chunks/pt-BieXcDHi.mjs.map +1 -0
- package/dist/chunks/pt-BzJZ6tis.mjs +2 -0
- package/dist/chunks/pt-BzJZ6tis.mjs.map +1 -0
- package/dist/chunks/pt-CDBahjbg.mjs +2 -0
- package/dist/chunks/pt-CDBahjbg.mjs.map +1 -0
- package/dist/chunks/pt-CQIn2xA5.mjs +2 -0
- package/dist/chunks/pt-CQIn2xA5.mjs.map +1 -0
- package/dist/chunks/pt-Cx3gdB5p.mjs +2 -0
- package/dist/chunks/pt-Cx3gdB5p.mjs.map +1 -0
- package/dist/chunks/pt-D7n_VUMD.mjs +2 -0
- package/dist/chunks/pt-D7n_VUMD.mjs.map +1 -0
- package/dist/chunks/pt-DEg_u7oB.mjs +2 -0
- package/dist/chunks/pt-DEg_u7oB.mjs.map +1 -0
- package/dist/chunks/pt-DchozfDf.mjs +2 -0
- package/dist/chunks/pt-DchozfDf.mjs.map +1 -0
- package/dist/chunks/pt-DnHYzWZI.mjs +2 -0
- package/dist/chunks/pt-DnHYzWZI.mjs.map +1 -0
- package/dist/chunks/pt-Dne18ay-.mjs +2 -0
- package/dist/chunks/pt-Dne18ay-.mjs.map +1 -0
- package/dist/chunks/pt-DxTZELCn.mjs +2 -0
- package/dist/chunks/pt-DxTZELCn.mjs.map +1 -0
- package/dist/chunks/pt-FnLj_fwL.mjs +2 -0
- package/dist/chunks/pt-FnLj_fwL.mjs.map +1 -0
- package/dist/chunks/pt-QZcGM_AW.mjs +2 -0
- package/dist/chunks/pt-QZcGM_AW.mjs.map +1 -0
- package/dist/chunks/pt-X4oj0zCg.mjs +2 -0
- package/dist/chunks/pt-X4oj0zCg.mjs.map +1 -0
- package/dist/chunks/pt-hgZhGt5D.mjs +2 -0
- package/dist/chunks/pt-hgZhGt5D.mjs.map +1 -0
- package/dist/chunks/ru-333jycve.mjs +2 -0
- package/dist/chunks/ru-333jycve.mjs.map +1 -0
- package/dist/chunks/ru-B278yBd4.mjs +2 -0
- package/dist/chunks/ru-B278yBd4.mjs.map +1 -0
- package/dist/chunks/ru-B2dlVf3F.mjs +2 -0
- package/dist/chunks/ru-B2dlVf3F.mjs.map +1 -0
- package/dist/chunks/ru-BHZdR6yk.mjs +2 -0
- package/dist/chunks/ru-BHZdR6yk.mjs.map +1 -0
- package/dist/chunks/ru-BhXqR_wI.mjs +2 -0
- package/dist/chunks/ru-BhXqR_wI.mjs.map +1 -0
- package/dist/chunks/ru-BkhY_-Tu.mjs +2 -0
- package/dist/chunks/ru-BkhY_-Tu.mjs.map +1 -0
- package/dist/chunks/ru-BqJmK6DG.mjs +2 -0
- package/dist/chunks/ru-BqJmK6DG.mjs.map +1 -0
- package/dist/chunks/ru-BscEW-yr.mjs +2 -0
- package/dist/chunks/ru-BscEW-yr.mjs.map +1 -0
- package/dist/chunks/ru-C91kg2w_.mjs +2 -0
- package/dist/chunks/ru-C91kg2w_.mjs.map +1 -0
- package/dist/chunks/ru-CQoFJYQk.mjs +2 -0
- package/dist/chunks/ru-CQoFJYQk.mjs.map +1 -0
- package/dist/chunks/ru-CYMaDdFA.mjs +2 -0
- package/dist/chunks/ru-CYMaDdFA.mjs.map +1 -0
- package/dist/chunks/ru-ClE-ByL-.mjs +2 -0
- package/dist/chunks/ru-ClE-ByL-.mjs.map +1 -0
- package/dist/chunks/ru-CmLLEJJV.mjs +2 -0
- package/dist/chunks/ru-CmLLEJJV.mjs.map +1 -0
- package/dist/chunks/ru-CmlYwIPH.mjs +2 -0
- package/dist/chunks/ru-CmlYwIPH.mjs.map +1 -0
- package/dist/chunks/ru-D74ItjLR.mjs +2 -0
- package/dist/chunks/ru-D74ItjLR.mjs.map +1 -0
- package/dist/chunks/ru-DR7ji_U_.mjs +2 -0
- package/dist/chunks/ru-DR7ji_U_.mjs.map +1 -0
- package/dist/chunks/ru-DZ0titlK.mjs +2 -0
- package/dist/chunks/ru-DZ0titlK.mjs.map +1 -0
- package/dist/chunks/ru-DftPghQ8.mjs +2 -0
- package/dist/chunks/ru-DftPghQ8.mjs.map +1 -0
- package/dist/chunks/ru-L3ML505C.mjs +2 -0
- package/dist/chunks/ru-L3ML505C.mjs.map +1 -0
- package/dist/chunks/ru-U-UhwubV.mjs +2 -0
- package/dist/chunks/ru-U-UhwubV.mjs.map +1 -0
- package/dist/chunks/ru-VAZhjO4q.mjs +2 -0
- package/dist/chunks/ru-VAZhjO4q.mjs.map +1 -0
- package/dist/chunks/ru-afocv3DK.mjs +2 -0
- package/dist/chunks/ru-afocv3DK.mjs.map +1 -0
- package/dist/chunks/ru-gUXymxbh.mjs +2 -0
- package/dist/chunks/ru-gUXymxbh.mjs.map +1 -0
- package/dist/chunks/ru-qL1ebv4O.mjs +2 -0
- package/dist/chunks/ru-qL1ebv4O.mjs.map +1 -0
- package/dist/chunks/shared-BLU27F7-.mjs +2 -0
- package/dist/chunks/shared-BLU27F7-.mjs.map +1 -0
- package/dist/chunks/src-CgbuJfYr.mjs +2 -0
- package/dist/chunks/src-CgbuJfYr.mjs.map +1 -0
- package/dist/chunks/text-direction-advanced-CkFu0K_I.mjs +2 -0
- package/dist/chunks/text-direction-advanced-CkFu0K_I.mjs.map +1 -0
- package/dist/chunks/zh-B3geJFGW.mjs +2 -0
- package/dist/chunks/zh-B3geJFGW.mjs.map +1 -0
- package/dist/chunks/zh-B4p7M6XB.mjs +2 -0
- package/dist/chunks/zh-B4p7M6XB.mjs.map +1 -0
- package/dist/chunks/zh-BkwaMj9a.mjs +2 -0
- package/dist/chunks/zh-BkwaMj9a.mjs.map +1 -0
- package/dist/chunks/zh-BogAT6ZW.mjs +2 -0
- package/dist/chunks/zh-BogAT6ZW.mjs.map +1 -0
- package/dist/chunks/zh-BvMEmsyF.mjs +2 -0
- package/dist/chunks/zh-BvMEmsyF.mjs.map +1 -0
- package/dist/chunks/zh-BzLh1p5b.mjs +2 -0
- package/dist/chunks/zh-BzLh1p5b.mjs.map +1 -0
- package/dist/chunks/zh-CBMpL9ha.mjs +2 -0
- package/dist/chunks/zh-CBMpL9ha.mjs.map +1 -0
- package/dist/chunks/zh-CIFsVnFl.mjs +2 -0
- package/dist/chunks/zh-CIFsVnFl.mjs.map +1 -0
- package/dist/chunks/zh-CP6_YzAc.mjs +2 -0
- package/dist/chunks/zh-CP6_YzAc.mjs.map +1 -0
- package/dist/chunks/zh-CT4V3EmW.mjs +2 -0
- package/dist/chunks/zh-CT4V3EmW.mjs.map +1 -0
- package/dist/chunks/zh-CZCIluI_.mjs +2 -0
- package/dist/chunks/zh-CZCIluI_.mjs.map +1 -0
- package/dist/chunks/zh-CcMLjYrk.mjs +2 -0
- package/dist/chunks/zh-CcMLjYrk.mjs.map +1 -0
- package/dist/chunks/zh-CfCQsLZa.mjs +2 -0
- package/dist/chunks/zh-CfCQsLZa.mjs.map +1 -0
- package/dist/chunks/zh-CsyBlhtm.mjs +2 -0
- package/dist/chunks/zh-CsyBlhtm.mjs.map +1 -0
- package/dist/chunks/zh-DSfxjb4Y.mjs +2 -0
- package/dist/chunks/zh-DSfxjb4Y.mjs.map +1 -0
- package/dist/chunks/zh-Dj5jzeIJ.mjs +2 -0
- package/dist/chunks/zh-Dj5jzeIJ.mjs.map +1 -0
- package/dist/chunks/zh-DjY-jmYn.mjs +2 -0
- package/dist/chunks/zh-DjY-jmYn.mjs.map +1 -0
- package/dist/chunks/zh-Dt7zL1Bl.mjs +2 -0
- package/dist/chunks/zh-Dt7zL1Bl.mjs.map +1 -0
- package/dist/chunks/zh-TXVgSc3H.mjs +2 -0
- package/dist/chunks/zh-TXVgSc3H.mjs.map +1 -0
- package/dist/chunks/zh-bkCXy34A.mjs +2 -0
- package/dist/chunks/zh-bkCXy34A.mjs.map +1 -0
- package/dist/chunks/zh-cRqBrQM8.mjs +2 -0
- package/dist/chunks/zh-cRqBrQM8.mjs.map +1 -0
- package/dist/chunks/zh-cUJdRfxu.mjs +2 -0
- package/dist/chunks/zh-cUJdRfxu.mjs.map +1 -0
- package/dist/chunks/zh-qo4_i9Vd.mjs +2 -0
- package/dist/chunks/zh-qo4_i9Vd.mjs.map +1 -0
- package/dist/chunks/zh-tpUU3oJa.mjs +2 -0
- package/dist/chunks/zh-tpUU3oJa.mjs.map +1 -0
- package/dist/editor/ContentSerializer.d.ts +2 -2
- package/dist/editor/ContentSerializer.d.ts.map +1 -1
- package/dist/editor/styles/base.d.ts +1 -1
- package/dist/editor/styles/base.d.ts.map +1 -1
- package/dist/editor/styles/list.d.ts +1 -1
- package/dist/editor/styles/list.d.ts.map +1 -1
- package/dist/editor/theme/ThemeEngine.d.ts.map +1 -1
- package/dist/editor/theme/ThemeTokens.d.ts +7 -0
- package/dist/editor/theme/ThemeTokens.d.ts.map +1 -1
- package/dist/fonts.mjs +1 -1
- package/dist/full.d.ts +1 -0
- package/dist/full.d.ts.map +1 -1
- package/dist/full.mjs +1 -1
- package/dist/html.mjs +1 -1
- package/dist/notectl-core.mjs +1 -1
- package/dist/notectl-core.umd.js +1 -1
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/CommandRegistry.d.ts +19 -0
- package/dist/plugins/CommandRegistry.d.ts.map +1 -0
- package/dist/plugins/MiddlewareChain.d.ts +39 -0
- package/dist/plugins/MiddlewareChain.d.ts.map +1 -0
- package/dist/plugins/PluginLifecycle.d.ts +56 -0
- package/dist/plugins/PluginLifecycle.d.ts.map +1 -0
- package/dist/plugins/PluginManager.d.ts +9 -63
- package/dist/plugins/PluginManager.d.ts.map +1 -1
- package/dist/plugins/RegistrationTracker.d.ts +38 -0
- package/dist/plugins/RegistrationTracker.d.ts.map +1 -0
- package/dist/plugins/ServiceRegistry.d.ts +14 -0
- package/dist/plugins/ServiceRegistry.d.ts.map +1 -0
- package/dist/plugins/alignment.mjs +1 -1
- package/dist/plugins/blockquote.mjs +1 -1
- package/dist/plugins/caret-navigation.mjs +1 -1
- package/dist/plugins/code-block/CodeBlockTypes.d.ts +1 -1
- package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -1
- package/dist/plugins/code-block.mjs +1 -1
- package/dist/plugins/font/FontPlugin.d.ts.map +1 -1
- package/dist/plugins/font-size.mjs +1 -1
- package/dist/plugins/font.mjs +1 -1
- package/dist/plugins/gap-cursor.mjs +1 -1
- package/dist/plugins/hard-break.mjs +1 -1
- package/dist/plugins/heading.mjs +1 -1
- package/dist/plugins/highlight.mjs +1 -1
- package/dist/plugins/horizontal-rule.mjs +1 -1
- package/dist/plugins/image.mjs +1 -1
- package/dist/plugins/inline-code/InlineCodeLocale.d.ts +10 -0
- package/dist/plugins/inline-code/InlineCodeLocale.d.ts.map +1 -0
- package/dist/plugins/inline-code/InlineCodePlugin.d.ts +39 -0
- package/dist/plugins/inline-code/InlineCodePlugin.d.ts.map +1 -0
- package/dist/plugins/inline-code/index.d.ts +4 -0
- package/dist/plugins/inline-code/index.d.ts.map +1 -0
- package/dist/plugins/inline-code/locales/ar.d.ts +4 -0
- package/dist/plugins/inline-code/locales/ar.d.ts.map +1 -0
- package/dist/plugins/inline-code/locales/de.d.ts +4 -0
- package/dist/plugins/inline-code/locales/de.d.ts.map +1 -0
- package/dist/plugins/inline-code/locales/es.d.ts +4 -0
- package/dist/plugins/inline-code/locales/es.d.ts.map +1 -0
- package/dist/plugins/inline-code/locales/fr.d.ts +4 -0
- package/dist/plugins/inline-code/locales/fr.d.ts.map +1 -0
- package/dist/plugins/inline-code/locales/hi.d.ts +4 -0
- package/dist/plugins/inline-code/locales/hi.d.ts.map +1 -0
- package/dist/plugins/inline-code/locales/pt.d.ts +4 -0
- package/dist/plugins/inline-code/locales/pt.d.ts.map +1 -0
- package/dist/plugins/inline-code/locales/ru.d.ts +4 -0
- package/dist/plugins/inline-code/locales/ru.d.ts.map +1 -0
- package/dist/plugins/inline-code/locales/zh.d.ts +4 -0
- package/dist/plugins/inline-code/locales/zh.d.ts.map +1 -0
- package/dist/plugins/inline-code.mjs +1 -0
- package/dist/plugins/language.mjs +1 -1
- package/dist/plugins/link.mjs +1 -1
- package/dist/plugins/list.mjs +1 -1
- package/dist/plugins/print/PrintStyleCollector.d.ts +7 -1
- package/dist/plugins/print/PrintStyleCollector.d.ts.map +1 -1
- package/dist/plugins/print/PrintTypes.d.ts +5 -0
- package/dist/plugins/print/PrintTypes.d.ts.map +1 -1
- package/dist/plugins/print.mjs +1 -1
- package/dist/plugins/shared.mjs +1 -1
- package/dist/plugins/smart-paste/detectors/JavaDetector.d.ts.map +1 -1
- package/dist/plugins/smart-paste.mjs +1 -1
- package/dist/plugins/strikethrough.mjs +1 -1
- package/dist/plugins/super-sub.mjs +1 -1
- package/dist/plugins/table.mjs +1 -1
- package/dist/plugins/text-color.mjs +1 -1
- package/dist/plugins/text-direction-advanced.mjs +1 -1
- package/dist/plugins/text-direction.mjs +1 -1
- package/dist/plugins/text-formatting.mjs +1 -1
- package/dist/plugins/toolbar.mjs +1 -1
- package/dist/presets/FullPreset.d.ts +1 -1
- package/dist/presets/FullPreset.d.ts.map +1 -1
- package/dist/presets/PresetTypes.d.ts +2 -0
- package/dist/presets/PresetTypes.d.ts.map +1 -1
- package/dist/presets/full.mjs +1 -1
- package/dist/presets/minimal.mjs +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/serialization/DocumentParser.d.ts.map +1 -1
- package/dist/view/BlockWrapperManagement.d.ts +6 -4
- package/dist/view/BlockWrapperManagement.d.ts.map +1 -1
- package/dist/view/CaretNavigation.d.ts +5 -4
- package/dist/view/CaretNavigation.d.ts.map +1 -1
- package/dist/view/EditorView.d.ts +9 -1
- package/dist/view/EditorView.d.ts.map +1 -1
- package/dist/view/EditorViewEvents.d.ts +1 -1
- package/dist/view/EditorViewEvents.d.ts.map +1 -1
- package/dist/view/Reconciler.d.ts.map +1 -1
- package/package.json +18 -8
- package/dist/chunks/AlignmentPlugin-DGb1VtCU.mjs +0 -2
- package/dist/chunks/AlignmentPlugin-DGb1VtCU.mjs.map +0 -1
- package/dist/chunks/AttrRegistry-DvqbnJ6T.mjs +0 -2
- package/dist/chunks/AttrRegistry-DvqbnJ6T.mjs.map +0 -1
- package/dist/chunks/AttributedMarkCommands-BiJtiHpx.mjs +0 -2
- package/dist/chunks/AttributedMarkCommands-BiJtiHpx.mjs.map +0 -1
- package/dist/chunks/BlockInsertion-Q8B21SaG.mjs +0 -2
- package/dist/chunks/BlockInsertion-Q8B21SaG.mjs.map +0 -1
- package/dist/chunks/BlockTypePickerRegistry-5fFlS2i0.mjs +0 -2
- package/dist/chunks/BlockTypePickerRegistry-5fFlS2i0.mjs.map +0 -1
- package/dist/chunks/BlockquotePlugin-Dz8Pny1r.mjs +0 -2
- package/dist/chunks/BlockquotePlugin-Dz8Pny1r.mjs.map +0 -1
- package/dist/chunks/CaretNavigationPlugin-mQ1nxJ6m.mjs +0 -2
- package/dist/chunks/CaretNavigationPlugin-mQ1nxJ6m.mjs.map +0 -1
- package/dist/chunks/CodeBlockPlugin-oPGiMno0.mjs +0 -2
- package/dist/chunks/CodeBlockPlugin-oPGiMno0.mjs.map +0 -1
- package/dist/chunks/ColorGrid-CcF0bH26.mjs +0 -2
- package/dist/chunks/ColorGrid-CcF0bH26.mjs.map +0 -1
- package/dist/chunks/ColorPickerPopup-BZxMBDxy.mjs +0 -2
- package/dist/chunks/ColorPickerPopup-BZxMBDxy.mjs.map +0 -1
- package/dist/chunks/ColorValidation-rOrJxBBt.mjs +0 -2
- package/dist/chunks/ColorValidation-rOrJxBBt.mjs.map +0 -1
- package/dist/chunks/CommandHelpers-G6M-qXJR.mjs +0 -2
- package/dist/chunks/CommandHelpers-G6M-qXJR.mjs.map +0 -1
- package/dist/chunks/Commands-ByBjgD3-.mjs +0 -2
- package/dist/chunks/Commands-ByBjgD3-.mjs.map +0 -1
- package/dist/chunks/Decoration-D-yB-H5v.mjs +0 -2
- package/dist/chunks/Decoration-D-yB-H5v.mjs.map +0 -1
- package/dist/chunks/Document-DnPKbcPE.mjs +0 -2
- package/dist/chunks/Document-DnPKbcPE.mjs.map +0 -1
- package/dist/chunks/DocumentParser-KuBaEZN6.mjs +0 -2
- package/dist/chunks/DocumentParser-KuBaEZN6.mjs.map +0 -1
- package/dist/chunks/DocumentSerializer-DgdiJsES.mjs +0 -2
- package/dist/chunks/DocumentSerializer-DgdiJsES.mjs.map +0 -1
- package/dist/chunks/DomUtils-BkyCg-OO.mjs +0 -2
- package/dist/chunks/DomUtils-BkyCg-OO.mjs.map +0 -1
- package/dist/chunks/FontPlugin-DYntd3gN.mjs +0 -2
- package/dist/chunks/FontPlugin-DYntd3gN.mjs.map +0 -1
- package/dist/chunks/FontSizePlugin-CGlH-S6g.mjs +0 -2
- package/dist/chunks/FontSizePlugin-CGlH-S6g.mjs.map +0 -1
- package/dist/chunks/GapCursorNavigation-uytzcZ6C.mjs +0 -2
- package/dist/chunks/GapCursorNavigation-uytzcZ6C.mjs.map +0 -1
- package/dist/chunks/GapCursorPlugin-BQ2_-7i6.mjs +0 -2
- package/dist/chunks/GapCursorPlugin-BQ2_-7i6.mjs.map +0 -1
- package/dist/chunks/HTMLUtils-BLwp5G4f.mjs +0 -2
- package/dist/chunks/HTMLUtils-BLwp5G4f.mjs.map +0 -1
- package/dist/chunks/HardBreakPlugin-CCrP_Kec.mjs +0 -2
- package/dist/chunks/HardBreakPlugin-CCrP_Kec.mjs.map +0 -1
- package/dist/chunks/HeadingPlugin-BiDNuBmw.mjs +0 -2
- package/dist/chunks/HeadingPlugin-BiDNuBmw.mjs.map +0 -1
- package/dist/chunks/HighlightPlugin-CwrtRVfS.mjs +0 -2
- package/dist/chunks/HighlightPlugin-CwrtRVfS.mjs.map +0 -1
- package/dist/chunks/HorizontalRulePlugin-CKIkbVwn.mjs +0 -2
- package/dist/chunks/HorizontalRulePlugin-CKIkbVwn.mjs.map +0 -1
- package/dist/chunks/ImagePlugin-BqRAKlG1.mjs +0 -2
- package/dist/chunks/ImagePlugin-BqRAKlG1.mjs.map +0 -1
- package/dist/chunks/KeyboardNav-IMWHB6wc.mjs +0 -2
- package/dist/chunks/KeyboardNav-IMWHB6wc.mjs.map +0 -1
- package/dist/chunks/LinkPlugin-Cb2cpFe8.mjs +0 -2
- package/dist/chunks/LinkPlugin-Cb2cpFe8.mjs.map +0 -1
- package/dist/chunks/ListPlugin-CZgkinoS.mjs +0 -2
- package/dist/chunks/ListPlugin-CZgkinoS.mjs.map +0 -1
- package/dist/chunks/NavigationQueries-CgYPG6oY.mjs +0 -2
- package/dist/chunks/NavigationQueries-CgYPG6oY.mjs.map +0 -1
- package/dist/chunks/NodeResolver-BkOsZnuU.mjs +0 -2
- package/dist/chunks/NodeResolver-BkOsZnuU.mjs.map +0 -1
- package/dist/chunks/NodeSelectionCommands-U8xEdaE4.mjs +0 -2
- package/dist/chunks/NodeSelectionCommands-U8xEdaE4.mjs.map +0 -1
- package/dist/chunks/Platform-wPvKFB9m.mjs +0 -2
- package/dist/chunks/Platform-wPvKFB9m.mjs.map +0 -1
- package/dist/chunks/Plugin-C4cBw3bs.mjs +0 -2
- package/dist/chunks/Plugin-C4cBw3bs.mjs.map +0 -1
- package/dist/chunks/PluginHelpers-BZU5rE44.mjs +0 -2
- package/dist/chunks/PluginHelpers-BZU5rE44.mjs.map +0 -1
- package/dist/chunks/PopupManager-S2qQtTxR.mjs +0 -2
- package/dist/chunks/PopupManager-S2qQtTxR.mjs.map +0 -1
- package/dist/chunks/PopupPositioning-BdSCai19.mjs +0 -2
- package/dist/chunks/PopupPositioning-BdSCai19.mjs.map +0 -1
- package/dist/chunks/PrintPlugin-80SINLGF.mjs +0 -2
- package/dist/chunks/PrintPlugin-80SINLGF.mjs.map +0 -1
- package/dist/chunks/PrintTypes-CWIAfEaX.mjs +0 -2
- package/dist/chunks/PrintTypes-CWIAfEaX.mjs.map +0 -1
- package/dist/chunks/RangeIterator-DEuX1xKV.mjs +0 -2
- package/dist/chunks/RangeIterator-DEuX1xKV.mjs.map +0 -1
- package/dist/chunks/Selection-B14e7gd0.mjs +0 -2
- package/dist/chunks/Selection-B14e7gd0.mjs.map +0 -1
- package/dist/chunks/ShortcutFormatting-c0IajwWG.mjs +0 -2
- package/dist/chunks/ShortcutFormatting-c0IajwWG.mjs.map +0 -1
- package/dist/chunks/SmartPastePlugin-BvYBbHSA.mjs +0 -2
- package/dist/chunks/SmartPastePlugin-BvYBbHSA.mjs.map +0 -1
- package/dist/chunks/StrikethroughPlugin-XBOGv5Oi.mjs +0 -2
- package/dist/chunks/StrikethroughPlugin-XBOGv5Oi.mjs.map +0 -1
- package/dist/chunks/StyleRuntime-Bwde5icB.mjs +0 -2
- package/dist/chunks/StyleRuntime-Bwde5icB.mjs.map +0 -1
- package/dist/chunks/SuperSubPlugin-CVjU4W9y.mjs +0 -2
- package/dist/chunks/SuperSubPlugin-CVjU4W9y.mjs.map +0 -1
- package/dist/chunks/SyntaxTokenTypes-CY2-rJCA.mjs +0 -2
- package/dist/chunks/SyntaxTokenTypes-CY2-rJCA.mjs.map +0 -1
- package/dist/chunks/TablePlugin-BHpp6h9H.mjs +0 -2
- package/dist/chunks/TablePlugin-BHpp6h9H.mjs.map +0 -1
- package/dist/chunks/TextColorPlugin-CGbyMGTr.mjs +0 -2
- package/dist/chunks/TextColorPlugin-CGbyMGTr.mjs.map +0 -1
- package/dist/chunks/TextDirectionCorePlugin-DPU7wy6g.mjs +0 -2
- package/dist/chunks/TextDirectionCorePlugin-DPU7wy6g.mjs.map +0 -1
- package/dist/chunks/TextDirectionLocale-DxOfFixh.mjs +0 -2
- package/dist/chunks/TextDirectionLocale-DxOfFixh.mjs.map +0 -1
- package/dist/chunks/TextFormattingPlugin-CYVnhHH4.mjs +0 -2
- package/dist/chunks/TextFormattingPlugin-CYVnhHH4.mjs.map +0 -1
- package/dist/chunks/ToolbarPlugin-CWDkWXE8.mjs +0 -2
- package/dist/chunks/ToolbarPlugin-CWDkWXE8.mjs.map +0 -1
- package/dist/chunks/TypeBrands-BQR8dEYU.mjs +0 -2
- package/dist/chunks/TypeBrands-BQR8dEYU.mjs.map +0 -1
- package/dist/chunks/WordBoundary-BkxXn2JA.mjs +0 -2
- package/dist/chunks/WordBoundary-BkxXn2JA.mjs.map +0 -1
- package/dist/chunks/XmlDetector-BiWxa0RJ.mjs +0 -2
- package/dist/chunks/XmlDetector-BiWxa0RJ.mjs.map +0 -1
- package/dist/chunks/XmlPatterns-B-V-mHF4.mjs +0 -2
- package/dist/chunks/XmlPatterns-B-V-mHF4.mjs.map +0 -1
- package/dist/chunks/XmlSupport-Czr8xQB1.mjs +0 -2
- package/dist/chunks/XmlSupport-Czr8xQB1.mjs.map +0 -1
- package/dist/chunks/ar-BARk0vUs.mjs +0 -2
- package/dist/chunks/ar-BARk0vUs.mjs.map +0 -1
- package/dist/chunks/ar-BVnwjtBO.mjs +0 -2
- package/dist/chunks/ar-BVnwjtBO.mjs.map +0 -1
- package/dist/chunks/ar-BaLVMaVO.mjs +0 -2
- package/dist/chunks/ar-BaLVMaVO.mjs.map +0 -1
- package/dist/chunks/ar-BbXyJVxi.mjs +0 -2
- package/dist/chunks/ar-BbXyJVxi.mjs.map +0 -1
- package/dist/chunks/ar-Bj_U3O6Y.mjs +0 -2
- package/dist/chunks/ar-Bj_U3O6Y.mjs.map +0 -1
- package/dist/chunks/ar-CLEiZlfu.mjs +0 -2
- package/dist/chunks/ar-CLEiZlfu.mjs.map +0 -1
- package/dist/chunks/ar-CaE825oi.mjs +0 -2
- package/dist/chunks/ar-CaE825oi.mjs.map +0 -1
- package/dist/chunks/ar-CaRHAfkM.mjs +0 -2
- package/dist/chunks/ar-CaRHAfkM.mjs.map +0 -1
- package/dist/chunks/ar-Cg1wGAxo.mjs +0 -2
- package/dist/chunks/ar-Cg1wGAxo.mjs.map +0 -1
- package/dist/chunks/ar-Cp9qv7la.mjs +0 -2
- package/dist/chunks/ar-Cp9qv7la.mjs.map +0 -1
- package/dist/chunks/ar-CpZXocgF.mjs +0 -2
- package/dist/chunks/ar-CpZXocgF.mjs.map +0 -1
- package/dist/chunks/ar-CqD9pUY0.mjs +0 -2
- package/dist/chunks/ar-CqD9pUY0.mjs.map +0 -1
- package/dist/chunks/ar-D1DiKwV_.mjs +0 -2
- package/dist/chunks/ar-D1DiKwV_.mjs.map +0 -1
- package/dist/chunks/ar-D714r_62.mjs +0 -2
- package/dist/chunks/ar-D714r_62.mjs.map +0 -1
- package/dist/chunks/ar-D8hT58sd.mjs +0 -2
- package/dist/chunks/ar-D8hT58sd.mjs.map +0 -1
- package/dist/chunks/ar-DYA1zADy.mjs +0 -2
- package/dist/chunks/ar-DYA1zADy.mjs.map +0 -1
- package/dist/chunks/ar-Dc2VufjD.mjs +0 -2
- package/dist/chunks/ar-Dc2VufjD.mjs.map +0 -1
- package/dist/chunks/ar-DsmIDxDt.mjs +0 -2
- package/dist/chunks/ar-DsmIDxDt.mjs.map +0 -1
- package/dist/chunks/ar-M3QzJIS8.mjs +0 -2
- package/dist/chunks/ar-M3QzJIS8.mjs.map +0 -1
- package/dist/chunks/ar-UKi-TYFz.mjs +0 -2
- package/dist/chunks/ar-UKi-TYFz.mjs.map +0 -1
- package/dist/chunks/ar-UfrdJzT6.mjs +0 -2
- package/dist/chunks/ar-UfrdJzT6.mjs.map +0 -1
- package/dist/chunks/ar-fGsuiCw5.mjs +0 -2
- package/dist/chunks/ar-fGsuiCw5.mjs.map +0 -1
- package/dist/chunks/ar-fSElw9mJ.mjs +0 -2
- package/dist/chunks/ar-fSElw9mJ.mjs.map +0 -1
- package/dist/chunks/color-picker-iPmE48jm.mjs +0 -2
- package/dist/chunks/color-picker-iPmE48jm.mjs.map +0 -1
- package/dist/chunks/de-B4BcTYnc.mjs +0 -2
- package/dist/chunks/de-B4BcTYnc.mjs.map +0 -1
- package/dist/chunks/de-B7H06L3l.mjs +0 -2
- package/dist/chunks/de-B7H06L3l.mjs.map +0 -1
- package/dist/chunks/de-BWk2-9In.mjs +0 -2
- package/dist/chunks/de-BWk2-9In.mjs.map +0 -1
- package/dist/chunks/de-ByDTr_of.mjs +0 -2
- package/dist/chunks/de-ByDTr_of.mjs.map +0 -1
- package/dist/chunks/de-C5If_e7l.mjs +0 -2
- package/dist/chunks/de-C5If_e7l.mjs.map +0 -1
- package/dist/chunks/de-CAmM7IT5.mjs +0 -2
- package/dist/chunks/de-CAmM7IT5.mjs.map +0 -1
- package/dist/chunks/de-CF7zshOE.mjs +0 -2
- package/dist/chunks/de-CF7zshOE.mjs.map +0 -1
- package/dist/chunks/de-CXAESa_f.mjs +0 -2
- package/dist/chunks/de-CXAESa_f.mjs.map +0 -1
- package/dist/chunks/de-ChvJQZeC.mjs +0 -2
- package/dist/chunks/de-ChvJQZeC.mjs.map +0 -1
- package/dist/chunks/de-ClJaNWJr.mjs +0 -2
- package/dist/chunks/de-ClJaNWJr.mjs.map +0 -1
- package/dist/chunks/de-CpNFM0EP.mjs +0 -2
- package/dist/chunks/de-CpNFM0EP.mjs.map +0 -1
- package/dist/chunks/de-CwSQIBLx.mjs +0 -2
- package/dist/chunks/de-CwSQIBLx.mjs.map +0 -1
- package/dist/chunks/de-D3lxYgJa.mjs +0 -2
- package/dist/chunks/de-D3lxYgJa.mjs.map +0 -1
- package/dist/chunks/de-D8gRtvU4.mjs +0 -2
- package/dist/chunks/de-D8gRtvU4.mjs.map +0 -1
- package/dist/chunks/de-D_9IOrAk.mjs +0 -2
- package/dist/chunks/de-D_9IOrAk.mjs.map +0 -1
- package/dist/chunks/de-DcwZkO0v.mjs +0 -2
- package/dist/chunks/de-DcwZkO0v.mjs.map +0 -1
- package/dist/chunks/de-DeSVCxbd.mjs +0 -2
- package/dist/chunks/de-DeSVCxbd.mjs.map +0 -1
- package/dist/chunks/de-DqxnR2Y8.mjs +0 -2
- package/dist/chunks/de-DqxnR2Y8.mjs.map +0 -1
- package/dist/chunks/de-J82qPFkV.mjs +0 -2
- package/dist/chunks/de-J82qPFkV.mjs.map +0 -1
- package/dist/chunks/de-QDbUiCAO.mjs +0 -2
- package/dist/chunks/de-QDbUiCAO.mjs.map +0 -1
- package/dist/chunks/de-eAQXJdL9.mjs +0 -2
- package/dist/chunks/de-eAQXJdL9.mjs.map +0 -1
- package/dist/chunks/de-hneXQd4z.mjs +0 -2
- package/dist/chunks/de-hneXQd4z.mjs.map +0 -1
- package/dist/chunks/de-wXAi5Jyt.mjs +0 -2
- package/dist/chunks/de-wXAi5Jyt.mjs.map +0 -1
- package/dist/chunks/es-5c_5O95N.mjs +0 -2
- package/dist/chunks/es-5c_5O95N.mjs.map +0 -1
- package/dist/chunks/es-B2QB6DHA.mjs +0 -2
- package/dist/chunks/es-B2QB6DHA.mjs.map +0 -1
- package/dist/chunks/es-BEcu8DtV.mjs +0 -2
- package/dist/chunks/es-BEcu8DtV.mjs.map +0 -1
- package/dist/chunks/es-BXTkzYVW.mjs +0 -2
- package/dist/chunks/es-BXTkzYVW.mjs.map +0 -1
- package/dist/chunks/es-BemQV8dI.mjs +0 -2
- package/dist/chunks/es-BemQV8dI.mjs.map +0 -1
- package/dist/chunks/es-BfJM5zJ5.mjs +0 -2
- package/dist/chunks/es-BfJM5zJ5.mjs.map +0 -1
- package/dist/chunks/es-CnqxzYfU.mjs +0 -2
- package/dist/chunks/es-CnqxzYfU.mjs.map +0 -1
- package/dist/chunks/es-CrZtAd3-.mjs +0 -2
- package/dist/chunks/es-CrZtAd3-.mjs.map +0 -1
- package/dist/chunks/es-CsCCy0S5.mjs +0 -2
- package/dist/chunks/es-CsCCy0S5.mjs.map +0 -1
- package/dist/chunks/es-D62AfyHC.mjs +0 -2
- package/dist/chunks/es-D62AfyHC.mjs.map +0 -1
- package/dist/chunks/es-DA_zUbSs.mjs +0 -2
- package/dist/chunks/es-DA_zUbSs.mjs.map +0 -1
- package/dist/chunks/es-DFCDhXJb.mjs +0 -2
- package/dist/chunks/es-DFCDhXJb.mjs.map +0 -1
- package/dist/chunks/es-DHMIpSfB.mjs +0 -2
- package/dist/chunks/es-DHMIpSfB.mjs.map +0 -1
- package/dist/chunks/es-DIH9KVn1.mjs +0 -2
- package/dist/chunks/es-DIH9KVn1.mjs.map +0 -1
- package/dist/chunks/es-DOHIPZYT.mjs +0 -2
- package/dist/chunks/es-DOHIPZYT.mjs.map +0 -1
- package/dist/chunks/es-DPyejgTk.mjs +0 -2
- package/dist/chunks/es-DPyejgTk.mjs.map +0 -1
- package/dist/chunks/es-DUVk_Wkc.mjs +0 -2
- package/dist/chunks/es-DUVk_Wkc.mjs.map +0 -1
- package/dist/chunks/es-Di4t0cUf.mjs +0 -2
- package/dist/chunks/es-Di4t0cUf.mjs.map +0 -1
- package/dist/chunks/es-DjwvgN1j.mjs +0 -2
- package/dist/chunks/es-DjwvgN1j.mjs.map +0 -1
- package/dist/chunks/es-Nawgghri.mjs +0 -2
- package/dist/chunks/es-Nawgghri.mjs.map +0 -1
- package/dist/chunks/es-SuOzBFT7.mjs +0 -2
- package/dist/chunks/es-SuOzBFT7.mjs.map +0 -1
- package/dist/chunks/es-gB6GcNGB.mjs +0 -2
- package/dist/chunks/es-gB6GcNGB.mjs.map +0 -1
- package/dist/chunks/es-xSr9miNk.mjs +0 -2
- package/dist/chunks/es-xSr9miNk.mjs.map +0 -1
- package/dist/chunks/fonts-CG_dDwvT.mjs +0 -2
- package/dist/chunks/fonts-CG_dDwvT.mjs.map +0 -1
- package/dist/chunks/fr-B35gBW5Z.mjs +0 -2
- package/dist/chunks/fr-B35gBW5Z.mjs.map +0 -1
- package/dist/chunks/fr-BFngqWSa.mjs +0 -2
- package/dist/chunks/fr-BFngqWSa.mjs.map +0 -1
- package/dist/chunks/fr-BZRak2_s.mjs +0 -2
- package/dist/chunks/fr-BZRak2_s.mjs.map +0 -1
- package/dist/chunks/fr-Bj_GziCv.mjs +0 -2
- package/dist/chunks/fr-Bj_GziCv.mjs.map +0 -1
- package/dist/chunks/fr-BushvDBo.mjs +0 -2
- package/dist/chunks/fr-BushvDBo.mjs.map +0 -1
- package/dist/chunks/fr-Bz2JMdw5.mjs +0 -2
- package/dist/chunks/fr-Bz2JMdw5.mjs.map +0 -1
- package/dist/chunks/fr-C2y-quYa.mjs +0 -2
- package/dist/chunks/fr-C2y-quYa.mjs.map +0 -1
- package/dist/chunks/fr-C5g40qHr.mjs +0 -2
- package/dist/chunks/fr-C5g40qHr.mjs.map +0 -1
- package/dist/chunks/fr-CRPVlCtC.mjs +0 -2
- package/dist/chunks/fr-CRPVlCtC.mjs.map +0 -1
- package/dist/chunks/fr-Cf0xNw5j.mjs +0 -2
- package/dist/chunks/fr-Cf0xNw5j.mjs.map +0 -1
- package/dist/chunks/fr-Cr62KfH7.mjs +0 -2
- package/dist/chunks/fr-Cr62KfH7.mjs.map +0 -1
- package/dist/chunks/fr-D6XZTFJa.mjs +0 -2
- package/dist/chunks/fr-D6XZTFJa.mjs.map +0 -1
- package/dist/chunks/fr-D9u2mcht.mjs +0 -2
- package/dist/chunks/fr-D9u2mcht.mjs.map +0 -1
- package/dist/chunks/fr-DEWFKFrW.mjs +0 -2
- package/dist/chunks/fr-DEWFKFrW.mjs.map +0 -1
- package/dist/chunks/fr-DGBuhK3D.mjs +0 -2
- package/dist/chunks/fr-DGBuhK3D.mjs.map +0 -1
- package/dist/chunks/fr-DQBLPLlz.mjs +0 -2
- package/dist/chunks/fr-DQBLPLlz.mjs.map +0 -1
- package/dist/chunks/fr-DQM130Rf.mjs +0 -2
- package/dist/chunks/fr-DQM130Rf.mjs.map +0 -1
- package/dist/chunks/fr-Dg5SMkMo.mjs +0 -2
- package/dist/chunks/fr-Dg5SMkMo.mjs.map +0 -1
- package/dist/chunks/fr-Dv0GIx7Q.mjs +0 -2
- package/dist/chunks/fr-Dv0GIx7Q.mjs.map +0 -1
- package/dist/chunks/fr-DyGGhKFe.mjs +0 -2
- package/dist/chunks/fr-DyGGhKFe.mjs.map +0 -1
- package/dist/chunks/fr-DzQfRP8y.mjs +0 -2
- package/dist/chunks/fr-DzQfRP8y.mjs.map +0 -1
- package/dist/chunks/fr-SxdLDSEQ.mjs +0 -2
- package/dist/chunks/fr-SxdLDSEQ.mjs.map +0 -1
- package/dist/chunks/fr-VGC8qZxr.mjs +0 -2
- package/dist/chunks/fr-VGC8qZxr.mjs.map +0 -1
- package/dist/chunks/full-B-bw4M7L.mjs +0 -2
- package/dist/chunks/full-B-bw4M7L.mjs.map +0 -1
- package/dist/chunks/hi-8AQg9KKV.mjs +0 -2
- package/dist/chunks/hi-8AQg9KKV.mjs.map +0 -1
- package/dist/chunks/hi-B0EvMNl3.mjs +0 -2
- package/dist/chunks/hi-B0EvMNl3.mjs.map +0 -1
- package/dist/chunks/hi-B5sPMUNb.mjs +0 -2
- package/dist/chunks/hi-B5sPMUNb.mjs.map +0 -1
- package/dist/chunks/hi-BOfcnulc.mjs +0 -2
- package/dist/chunks/hi-BOfcnulc.mjs.map +0 -1
- package/dist/chunks/hi-BUveHWCk.mjs +0 -2
- package/dist/chunks/hi-BUveHWCk.mjs.map +0 -1
- package/dist/chunks/hi-BZ_n8-zx.mjs +0 -2
- package/dist/chunks/hi-BZ_n8-zx.mjs.map +0 -1
- package/dist/chunks/hi-BeLhPZ5d.mjs +0 -2
- package/dist/chunks/hi-BeLhPZ5d.mjs.map +0 -1
- package/dist/chunks/hi-Bg8jWcjX.mjs +0 -2
- package/dist/chunks/hi-Bg8jWcjX.mjs.map +0 -1
- package/dist/chunks/hi-BktVy4Yc.mjs +0 -2
- package/dist/chunks/hi-BktVy4Yc.mjs.map +0 -1
- package/dist/chunks/hi-Btg6DNgW.mjs +0 -2
- package/dist/chunks/hi-Btg6DNgW.mjs.map +0 -1
- package/dist/chunks/hi-C20PmckT.mjs +0 -2
- package/dist/chunks/hi-C20PmckT.mjs.map +0 -1
- package/dist/chunks/hi-C2DDsttW.mjs +0 -2
- package/dist/chunks/hi-C2DDsttW.mjs.map +0 -1
- package/dist/chunks/hi-CCDCfQV0.mjs +0 -2
- package/dist/chunks/hi-CCDCfQV0.mjs.map +0 -1
- package/dist/chunks/hi-CWX5sDy1.mjs +0 -2
- package/dist/chunks/hi-CWX5sDy1.mjs.map +0 -1
- package/dist/chunks/hi-ClSwgZfK.mjs +0 -2
- package/dist/chunks/hi-ClSwgZfK.mjs.map +0 -1
- package/dist/chunks/hi-D-apR3ri.mjs +0 -2
- package/dist/chunks/hi-D-apR3ri.mjs.map +0 -1
- package/dist/chunks/hi-D6ZQ_R6m.mjs +0 -2
- package/dist/chunks/hi-D6ZQ_R6m.mjs.map +0 -1
- package/dist/chunks/hi-D_rhcSL3.mjs +0 -2
- package/dist/chunks/hi-D_rhcSL3.mjs.map +0 -1
- package/dist/chunks/hi-DcA0CxZR.mjs +0 -2
- package/dist/chunks/hi-DcA0CxZR.mjs.map +0 -1
- package/dist/chunks/hi-Dd2GOD9r.mjs +0 -2
- package/dist/chunks/hi-Dd2GOD9r.mjs.map +0 -1
- package/dist/chunks/hi-DkEmvBok.mjs +0 -2
- package/dist/chunks/hi-DkEmvBok.mjs.map +0 -1
- package/dist/chunks/hi-nfmm9uwI.mjs +0 -2
- package/dist/chunks/hi-nfmm9uwI.mjs.map +0 -1
- package/dist/chunks/hi-wBX612X_.mjs +0 -2
- package/dist/chunks/hi-wBX612X_.mjs.map +0 -1
- package/dist/chunks/minimal-CMt909kl.mjs +0 -2
- package/dist/chunks/minimal-CMt909kl.mjs.map +0 -1
- package/dist/chunks/pt-BGQ7Sh6p.mjs +0 -2
- package/dist/chunks/pt-BGQ7Sh6p.mjs.map +0 -1
- package/dist/chunks/pt-BGQj9xok.mjs +0 -2
- package/dist/chunks/pt-BGQj9xok.mjs.map +0 -1
- package/dist/chunks/pt-BL5xNIhC.mjs +0 -2
- package/dist/chunks/pt-BL5xNIhC.mjs.map +0 -1
- package/dist/chunks/pt-BM8sUzpI.mjs +0 -2
- package/dist/chunks/pt-BM8sUzpI.mjs.map +0 -1
- package/dist/chunks/pt-BVLuZULN.mjs +0 -2
- package/dist/chunks/pt-BVLuZULN.mjs.map +0 -1
- package/dist/chunks/pt-BlGlrx3M.mjs +0 -2
- package/dist/chunks/pt-BlGlrx3M.mjs.map +0 -1
- package/dist/chunks/pt-CKaXK1FK.mjs +0 -2
- package/dist/chunks/pt-CKaXK1FK.mjs.map +0 -1
- package/dist/chunks/pt-CMpzmrVu.mjs +0 -2
- package/dist/chunks/pt-CMpzmrVu.mjs.map +0 -1
- package/dist/chunks/pt-Cw77qSTP.mjs +0 -2
- package/dist/chunks/pt-Cw77qSTP.mjs.map +0 -1
- package/dist/chunks/pt-DBNe2BiX.mjs +0 -2
- package/dist/chunks/pt-DBNe2BiX.mjs.map +0 -1
- package/dist/chunks/pt-DCfJFt-v.mjs +0 -2
- package/dist/chunks/pt-DCfJFt-v.mjs.map +0 -1
- package/dist/chunks/pt-DEs0I6eo.mjs +0 -2
- package/dist/chunks/pt-DEs0I6eo.mjs.map +0 -1
- package/dist/chunks/pt-DKONqS4g.mjs +0 -2
- package/dist/chunks/pt-DKONqS4g.mjs.map +0 -1
- package/dist/chunks/pt-DO4FbPvV.mjs +0 -2
- package/dist/chunks/pt-DO4FbPvV.mjs.map +0 -1
- package/dist/chunks/pt-DbDOQjV-.mjs +0 -2
- package/dist/chunks/pt-DbDOQjV-.mjs.map +0 -1
- package/dist/chunks/pt-DiYv0Ubf.mjs +0 -2
- package/dist/chunks/pt-DiYv0Ubf.mjs.map +0 -1
- package/dist/chunks/pt-Dk4Mr4yC.mjs +0 -2
- package/dist/chunks/pt-Dk4Mr4yC.mjs.map +0 -1
- package/dist/chunks/pt-DpLB51hL.mjs +0 -2
- package/dist/chunks/pt-DpLB51hL.mjs.map +0 -1
- package/dist/chunks/pt-Q5jXPjWo.mjs +0 -2
- package/dist/chunks/pt-Q5jXPjWo.mjs.map +0 -1
- package/dist/chunks/pt-kFy3gqNp.mjs +0 -2
- package/dist/chunks/pt-kFy3gqNp.mjs.map +0 -1
- package/dist/chunks/pt-ncNSxrVp.mjs +0 -2
- package/dist/chunks/pt-ncNSxrVp.mjs.map +0 -1
- package/dist/chunks/pt-tUVNk-7W.mjs +0 -2
- package/dist/chunks/pt-tUVNk-7W.mjs.map +0 -1
- package/dist/chunks/pt-zzij5vS0.mjs +0 -2
- package/dist/chunks/pt-zzij5vS0.mjs.map +0 -1
- package/dist/chunks/rolldown-runtime-B8Ku5yk6.mjs +0 -1
- package/dist/chunks/ru-B-XR4L6x.mjs +0 -2
- package/dist/chunks/ru-B-XR4L6x.mjs.map +0 -1
- package/dist/chunks/ru-B00ZXSqu.mjs +0 -2
- package/dist/chunks/ru-B00ZXSqu.mjs.map +0 -1
- package/dist/chunks/ru-B5wvkAtV.mjs +0 -2
- package/dist/chunks/ru-B5wvkAtV.mjs.map +0 -1
- package/dist/chunks/ru-BA5-gdMK.mjs +0 -2
- package/dist/chunks/ru-BA5-gdMK.mjs.map +0 -1
- package/dist/chunks/ru-BNTSKpWh.mjs +0 -2
- package/dist/chunks/ru-BNTSKpWh.mjs.map +0 -1
- package/dist/chunks/ru-BRy-L-TF.mjs +0 -2
- package/dist/chunks/ru-BRy-L-TF.mjs.map +0 -1
- package/dist/chunks/ru-BZrPeSDg.mjs +0 -2
- package/dist/chunks/ru-BZrPeSDg.mjs.map +0 -1
- package/dist/chunks/ru-B_8ujIHK.mjs +0 -2
- package/dist/chunks/ru-B_8ujIHK.mjs.map +0 -1
- package/dist/chunks/ru-BbgvH6r3.mjs +0 -2
- package/dist/chunks/ru-BbgvH6r3.mjs.map +0 -1
- package/dist/chunks/ru-CDm5R5CV.mjs +0 -2
- package/dist/chunks/ru-CDm5R5CV.mjs.map +0 -1
- package/dist/chunks/ru-CWLFWYwd.mjs +0 -2
- package/dist/chunks/ru-CWLFWYwd.mjs.map +0 -1
- package/dist/chunks/ru-CqsCwBQ_.mjs +0 -2
- package/dist/chunks/ru-CqsCwBQ_.mjs.map +0 -1
- package/dist/chunks/ru-CsFv_mi4.mjs +0 -2
- package/dist/chunks/ru-CsFv_mi4.mjs.map +0 -1
- package/dist/chunks/ru-Cv9Zbbn2.mjs +0 -2
- package/dist/chunks/ru-Cv9Zbbn2.mjs.map +0 -1
- package/dist/chunks/ru-CyTNK9dE.mjs +0 -2
- package/dist/chunks/ru-CyTNK9dE.mjs.map +0 -1
- package/dist/chunks/ru-DEkLlarB.mjs +0 -2
- package/dist/chunks/ru-DEkLlarB.mjs.map +0 -1
- package/dist/chunks/ru-DZge62_-.mjs +0 -2
- package/dist/chunks/ru-DZge62_-.mjs.map +0 -1
- package/dist/chunks/ru-DiVRD-Ds.mjs +0 -2
- package/dist/chunks/ru-DiVRD-Ds.mjs.map +0 -1
- package/dist/chunks/ru-DkP8YLYT.mjs +0 -2
- package/dist/chunks/ru-DkP8YLYT.mjs.map +0 -1
- package/dist/chunks/ru-OKZRZ5c-.mjs +0 -2
- package/dist/chunks/ru-OKZRZ5c-.mjs.map +0 -1
- package/dist/chunks/ru-aYY1QVJS.mjs +0 -2
- package/dist/chunks/ru-aYY1QVJS.mjs.map +0 -1
- package/dist/chunks/ru-ejPBB15H.mjs +0 -2
- package/dist/chunks/ru-ejPBB15H.mjs.map +0 -1
- package/dist/chunks/ru-tp62bXSj.mjs +0 -2
- package/dist/chunks/ru-tp62bXSj.mjs.map +0 -1
- package/dist/chunks/shared-DJ08jwra.mjs +0 -2
- package/dist/chunks/shared-DJ08jwra.mjs.map +0 -1
- package/dist/chunks/src-DOyzNZ94.mjs +0 -2
- package/dist/chunks/src-DOyzNZ94.mjs.map +0 -1
- package/dist/chunks/text-direction-advanced-B71gUwvk.mjs +0 -2
- package/dist/chunks/text-direction-advanced-B71gUwvk.mjs.map +0 -1
- package/dist/chunks/zh-2gEqF3OX.mjs +0 -2
- package/dist/chunks/zh-2gEqF3OX.mjs.map +0 -1
- package/dist/chunks/zh-B5J1sSsk.mjs +0 -2
- package/dist/chunks/zh-B5J1sSsk.mjs.map +0 -1
- package/dist/chunks/zh-B5LmYVQ2.mjs +0 -2
- package/dist/chunks/zh-B5LmYVQ2.mjs.map +0 -1
- package/dist/chunks/zh-BBOheLpv.mjs +0 -2
- package/dist/chunks/zh-BBOheLpv.mjs.map +0 -1
- package/dist/chunks/zh-BOy5F5Jq.mjs +0 -2
- package/dist/chunks/zh-BOy5F5Jq.mjs.map +0 -1
- package/dist/chunks/zh-BRlo0ayI.mjs +0 -2
- package/dist/chunks/zh-BRlo0ayI.mjs.map +0 -1
- package/dist/chunks/zh-BgTAzt6l.mjs +0 -2
- package/dist/chunks/zh-BgTAzt6l.mjs.map +0 -1
- package/dist/chunks/zh-BjY4TNQf.mjs +0 -2
- package/dist/chunks/zh-BjY4TNQf.mjs.map +0 -1
- package/dist/chunks/zh-BtD9NFJS.mjs +0 -2
- package/dist/chunks/zh-BtD9NFJS.mjs.map +0 -1
- package/dist/chunks/zh-BvSLqJFE.mjs +0 -2
- package/dist/chunks/zh-BvSLqJFE.mjs.map +0 -1
- package/dist/chunks/zh-C4rxe0Zk.mjs +0 -2
- package/dist/chunks/zh-C4rxe0Zk.mjs.map +0 -1
- package/dist/chunks/zh-CyX2tIRP.mjs +0 -2
- package/dist/chunks/zh-CyX2tIRP.mjs.map +0 -1
- package/dist/chunks/zh-D9QN2C7q.mjs +0 -2
- package/dist/chunks/zh-D9QN2C7q.mjs.map +0 -1
- package/dist/chunks/zh-DTnSCP1F.mjs +0 -2
- package/dist/chunks/zh-DTnSCP1F.mjs.map +0 -1
- package/dist/chunks/zh-DWlBkrGZ.mjs +0 -2
- package/dist/chunks/zh-DWlBkrGZ.mjs.map +0 -1
- package/dist/chunks/zh-DcY4Ouin.mjs +0 -2
- package/dist/chunks/zh-DcY4Ouin.mjs.map +0 -1
- package/dist/chunks/zh-DovMZIDF.mjs +0 -2
- package/dist/chunks/zh-DovMZIDF.mjs.map +0 -1
- package/dist/chunks/zh-DtzwqBHS.mjs +0 -2
- package/dist/chunks/zh-DtzwqBHS.mjs.map +0 -1
- package/dist/chunks/zh-DunJzfVR.mjs +0 -2
- package/dist/chunks/zh-DunJzfVR.mjs.map +0 -1
- package/dist/chunks/zh-Pd1HqYSs.mjs +0 -2
- package/dist/chunks/zh-Pd1HqYSs.mjs.map +0 -1
- package/dist/chunks/zh-Yvqfkdln.mjs +0 -2
- package/dist/chunks/zh-Yvqfkdln.mjs.map +0 -1
- package/dist/chunks/zh-Z9seusJc.mjs +0 -2
- package/dist/chunks/zh-Z9seusJc.mjs.map +0 -1
- package/dist/chunks/zh-fAa_AbWI.mjs +0 -2
- package/dist/chunks/zh-fAa_AbWI.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImagePlugin-BqRAKlG1.mjs","names":[],"sources":["../../src/editor/styles/image.ts","../../src/plugins/image/ImageCommands.ts","../../src/plugins/image/ImageLocale.ts","../../src/plugins/image/ImageNodeView.ts","../../src/plugins/image/ImagePopup.ts","../../src/plugins/image/ImageUpload.ts","../../src/plugins/image/ImagePlugin.ts"],"sourcesContent":["/** Image styles — display, alignment, resize handles, upload overlay. */\nexport const IMAGE_CSS = `\n/* Image */\n.notectl-image {\n\tmargin: 8px 0;\n\tuser-select: none;\n\tline-height: 0;\n}\n\n.notectl-image--center {\n\ttext-align: center;\n}\n\n.notectl-image--start {\n\ttext-align: start;\n}\n\n.notectl-image--end {\n\ttext-align: end;\n}\n\n.notectl-image__container {\n\tdisplay: inline-block;\n\tposition: relative;\n\tline-height: 0;\n}\n\n.notectl-image__img {\n\tdisplay: block;\n\tmax-width: 100%;\n\tborder-radius: 4px;\n}\n\n.notectl-image--selected .notectl-image__container {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 2px;\n\tborder-radius: 6px;\n}\n\n/* Alignment toolbar (appears on image selection) */\n.notectl-image__align-toolbar {\n\tdisplay: flex;\n\tgap: 2px;\n\tposition: absolute;\n\ttop: -36px;\n\tleft: 50%;\n\ttransform: translateX(-50%);\n\tbackground: var(--notectl-surface-overlay);\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 6px;\n\tpadding: 2px;\n\tbox-shadow: 0 2px 8px var(--notectl-shadow);\n\tz-index: 10;\n}\n\n.notectl-image__align-btn {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 28px;\n\theight: 28px;\n\tborder: none;\n\tbackground: transparent;\n\tborder-radius: 4px;\n\tcursor: pointer;\n\tcolor: var(--notectl-fg);\n}\n\n.notectl-image__align-btn:hover {\n\tbackground: var(--notectl-hover-bg);\n}\n\n.notectl-image__align-btn--active {\n\tbackground: var(--notectl-active-bg);\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-image__align-btn svg {\n\twidth: 16px;\n\theight: 16px;\n\tfill: currentColor;\n}\n\n/* Upload overlay */\n.notectl-image__overlay {\n\tposition: absolute;\n\tinset: 0;\n\tdisplay: none;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground: rgba(255, 255, 255, 0.8);\n\tborder-radius: 4px;\n\tfont-size: 13px;\n\tcolor: var(--notectl-fg-muted);\n}\n\n.notectl-image__overlay--uploading {\n\tdisplay: flex;\n}\n\n.notectl-image__overlay--error {\n\tdisplay: flex;\n\tbackground: var(--notectl-danger-muted);\n\tcolor: var(--notectl-danger);\n}\n\n/* Resize overlay + handles */\n.notectl-image__resize-overlay {\n\tposition: absolute;\n\tinset: 0;\n\tpointer-events: none;\n}\n\n.notectl-image__resize-handle {\n\tposition: absolute;\n\twidth: 10px;\n\theight: 10px;\n\tbackground: var(--notectl-surface-raised);\n\tborder: 2px solid var(--notectl-primary);\n\tborder-radius: 50%;\n\tpointer-events: all;\n\tz-index: 2;\n\ttransition: transform 0.1s, background 0.1s;\n}\n\n.notectl-image__resize-handle:hover {\n\tbackground: var(--notectl-primary);\n\ttransform: scale(1.3);\n}\n\n.notectl-image--resizing .notectl-image__resize-handle {\n\tbackground: var(--notectl-primary);\n}\n\n.notectl-image__resize-handle--nw {\n\ttop: -5px;\n\tinset-inline-start: -5px;\n\tcursor: nwse-resize;\n}\n\n.notectl-image__resize-handle--ne {\n\ttop: -5px;\n\tinset-inline-end: -5px;\n\tcursor: nesw-resize;\n}\n\n.notectl-image__resize-handle--sw {\n\tbottom: -5px;\n\tinset-inline-start: -5px;\n\tcursor: nesw-resize;\n}\n\n.notectl-image__resize-handle--se {\n\tbottom: -5px;\n\tinset-inline-end: -5px;\n\tcursor: nwse-resize;\n}\n\n/* RTL cursor overrides — flip diagonal cursors when in RTL context */\n[dir=\"rtl\"] .notectl-image__resize-handle--nw {\n\tcursor: nesw-resize;\n}\n\n[dir=\"rtl\"] .notectl-image__resize-handle--ne {\n\tcursor: nwse-resize;\n}\n\n[dir=\"rtl\"] .notectl-image__resize-handle--sw {\n\tcursor: nwse-resize;\n}\n\n[dir=\"rtl\"] .notectl-image__resize-handle--se {\n\tcursor: nesw-resize;\n}\n\n/* Size indicator tooltip */\n.notectl-image__size-indicator {\n\tposition: absolute;\n\tbottom: -28px;\n\tleft: 50%;\n\ttransform: translateX(-50%);\n\tpadding: 2px 8px;\n\tbackground: var(--notectl-tooltip-bg);\n\tcolor: var(--notectl-tooltip-fg);\n\tfont-size: 11px;\n\tfont-weight: 500;\n\tborder-radius: 4px;\n\twhite-space: nowrap;\n\tpointer-events: none;\n\topacity: 0;\n\ttransition: opacity 0.15s;\n\tz-index: 3;\n}\n\n.notectl-image__size-indicator--visible {\n\topacity: 1;\n}\n\n/* Keyboard resize hint (shown on selection, hidden during drag) */\n.notectl-image__keyboard-hint {\n\tdisplay: none;\n\tposition: absolute;\n\tbottom: -28px;\n\tleft: 50%;\n\ttransform: translateX(-50%);\n\tpadding: 2px 8px;\n\tfont-size: 11px;\n\tcolor: var(--notectl-fg-muted);\n\twhite-space: nowrap;\n\tpointer-events: none;\n\tz-index: 3;\n}\n\n.notectl-image--selected .notectl-image__keyboard-hint {\n\tdisplay: block;\n}\n\n.notectl-image--resizing .notectl-image__keyboard-hint {\n\tdisplay: none;\n}\n\n/* Resizing feedback */\n.notectl-image--resizing .notectl-image__img {\n\topacity: 0.85;\n}\n`;\n","/**\n * Image plugin commands: insert, remove, and attribute updates.\n * Supports both root-level and nested contexts (e.g. images inside table cells).\n */\n\nimport { deleteNodeSelection } from '../../commands/NodeSelectionCommands.js';\nimport type { BlockAttrs, BlockNode } from '../../model/Document.js';\nimport { createBlockNode, getBlockChildren, isBlockNode } from '../../model/Document.js';\nimport { createNodeSelection, isGapCursor, isNodeSelection } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\nimport type { ImageAttrs } from './ImageUpload.js';\n\n/**\n * Inserts an image block. When the cursor is inside a table cell,\n * the image is inserted as a child of the cell. Otherwise it is\n * inserted after the current block at document root.\n */\nexport function insertImage(\n\tcontext: PluginContext,\n\tattrs: Partial<ImageAttrs> & { readonly src: string },\n): boolean {\n\tconst state = context.getState();\n\tconst sel = state.selection;\n\n\tconst imageAttrs: BlockAttrs = {\n\t\tsrc: attrs.src,\n\t\talt: attrs.alt ?? '',\n\t\talign: attrs.align ?? 'center',\n\t\t...(attrs.width !== undefined ? { width: attrs.width } : {}),\n\t\t...(attrs.height !== undefined ? { height: attrs.height } : {}),\n\t};\n\n\tif (isGapCursor(sel)) return false;\n\n\tconst anchorBlockId: BlockId = isNodeSelection(sel) ? sel.nodeId : sel.anchor.blockId;\n\n\t// Check if we're inside a table cell\n\tconst cellId: BlockId | undefined = findTableCellAncestor(state, anchorBlockId);\n\tif (cellId) {\n\t\treturn insertImageIntoCell(state, context, cellId, imageAttrs);\n\t}\n\n\treturn insertImageAtRoot(state, context, anchorBlockId, imageAttrs);\n}\n\n/** Finds a table_cell ancestor for the given block (or the block itself). */\nfunction findTableCellAncestor(state: EditorState, bid: BlockId): BlockId | undefined {\n\tconst block: BlockNode | undefined = state.getBlock(bid);\n\tif (block?.type === 'table_cell') return bid;\n\n\tconst path: BlockId[] | undefined = state.getNodePath(bid);\n\tif (!path) return undefined;\n\n\tfor (const id of path) {\n\t\tconst node: BlockNode | undefined = state.getBlock(id);\n\t\tif (node?.type === 'table_cell') return id;\n\t}\n\treturn undefined;\n}\n\n/** Inserts an image at document root after the anchor block. */\nfunction insertImageAtRoot(\n\tstate: EditorState,\n\tcontext: PluginContext,\n\tanchorBlockId: BlockId,\n\timageAttrs: BlockAttrs,\n): boolean {\n\tconst blockIndex: number = state.doc.children.findIndex((b) => b.id === anchorBlockId);\n\tif (blockIndex === -1) return false;\n\n\tconst imageBlock: BlockNode = createBlockNode(nodeType('image'), [], undefined, imageAttrs);\n\tconst newParagraph: BlockNode = createBlockNode(nodeType('paragraph'));\n\n\tconst tr = state\n\t\t.transaction('command')\n\t\t.insertNode([], blockIndex + 1, imageBlock)\n\t\t.insertNode([], blockIndex + 2, newParagraph)\n\t\t.setSelection(createNodeSelection(imageBlock.id, []))\n\t\t.build();\n\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\n/** Inserts an image as a child of a table cell. */\nfunction insertImageIntoCell(\n\tstate: EditorState,\n\tcontext: PluginContext,\n\tcellId: BlockId,\n\timageAttrs: BlockAttrs,\n): boolean {\n\tconst cellPath: BlockId[] | undefined = state.getNodePath(cellId);\n\tif (!cellPath) return false;\n\n\tconst imageBlock: BlockNode = createBlockNode(nodeType('image'), [], undefined, imageAttrs);\n\n\t// Remove existing block children first (if any)\n\tconst cell: BlockNode | undefined = state.getBlock(cellId);\n\tif (!cell) return false;\n\n\tconst builder = state.transaction('command');\n\tconst blockChildren: readonly BlockNode[] = getBlockChildren(cell);\n\tfor (let i = blockChildren.length - 1; i >= 0; i--) {\n\t\t// Find the raw index in children array\n\t\tconst rawIndex: number = cell.children.findIndex(\n\t\t\t(c) => isBlockNode(c) && c.id === blockChildren[i]?.id,\n\t\t);\n\t\tif (rawIndex !== -1) {\n\t\t\tbuilder.removeNode(cellPath, rawIndex);\n\t\t}\n\t}\n\n\t// Insert image at index 0 (before any text nodes)\n\tbuilder.insertNode(cellPath, 0, imageBlock);\n\tbuilder.setSelection(createNodeSelection(imageBlock.id, [...cellPath, imageBlock.id]));\n\n\tcontext.dispatch(builder.build());\n\treturn true;\n}\n\n/** Removes the currently selected image block (works for nested images too). */\nexport function removeImage(context: PluginContext): boolean {\n\tconst state = context.getState();\n\tconst sel = state.selection;\n\tif (!isNodeSelection(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.nodeId);\n\tif (!block || block.type !== 'image') return false;\n\n\tconst nodePath: BlockId[] | undefined = state.getNodePath(sel.nodeId);\n\tif (!nodePath || nodePath.length === 0) return false;\n\n\tconst tr = deleteNodeSelection(state, createNodeSelection(sel.nodeId, nodePath));\n\tif (!tr) return false;\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\n/** Updates attributes on the currently selected image block. */\nexport function setImageAttr(context: PluginContext, attrs: Partial<ImageAttrs>): boolean {\n\tconst state = context.getState();\n\tconst sel = state.selection;\n\tif (!isNodeSelection(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.nodeId);\n\tif (!block || block.type !== 'image') return false;\n\n\tconst path: BlockId[] | undefined = state.getNodePath(sel.nodeId);\n\tif (!path) return false;\n\n\tconst merged: BlockAttrs = { ...(block.attrs ?? {}), ...attrs };\n\tconst tr = state.transaction('command').setNodeAttr(path, merged).build();\n\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\n/** Minimum image width in pixels (shared with NodeView). */\nexport const MIN_IMAGE_WIDTH = 50;\n\n/**\n * Resizes the currently selected image by a pixel delta, preserving aspect ratio.\n * Returns false if no image is selected or the image has no width/height attributes.\n */\nexport function resizeImageByDelta(\n\tcontext: PluginContext,\n\tdelta: number,\n\tmaxWidth: number,\n): boolean {\n\tconst state = context.getState();\n\tconst sel = state.selection;\n\tif (!isNodeSelection(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.nodeId);\n\tif (!block || block.type !== 'image') return false;\n\n\tconst currentWidth: number | undefined = block.attrs?.width as number | undefined;\n\tconst currentHeight: number | undefined = block.attrs?.height as number | undefined;\n\tif (currentWidth === undefined || currentHeight === undefined) return false;\n\n\tconst aspectRatio: number = currentHeight > 0 ? currentWidth / currentHeight : 1;\n\tconst clampedWidth: number = Math.max(MIN_IMAGE_WIDTH, Math.min(maxWidth, currentWidth + delta));\n\tconst newHeight: number = Math.round(clampedWidth / aspectRatio);\n\n\tif (clampedWidth === currentWidth && newHeight === currentHeight) return false;\n\n\treturn setImageAttr(context, { width: clampedWidth, height: newHeight });\n}\n\n/** Resets the currently selected image to its natural size by removing width/height. */\nexport function resetImageSize(context: PluginContext): boolean {\n\tconst state = context.getState();\n\tconst sel = state.selection;\n\tif (!isNodeSelection(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.nodeId);\n\tif (!block || block.type !== 'image') return false;\n\n\tconst path: BlockId[] | undefined = state.getNodePath(sel.nodeId);\n\tif (!path) return false;\n\n\tconst attrs: BlockAttrs = { ...(block.attrs ?? {}) };\n\tconst cleaned: BlockAttrs = Object.fromEntries(\n\t\tObject.entries(attrs).filter(([k]) => k !== 'width' && k !== 'height'),\n\t);\n\n\tconst tr = state.transaction('command').setNodeAttr(path, cleaned).build();\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\n/** Registers all image commands on the plugin context. */\nexport function registerImageCommands(context: PluginContext): void {\n\tcontext.registerCommand('insertImage', () => {\n\t\treturn insertImage(context, { src: '' });\n\t});\n\n\tcontext.registerCommand('removeImage', () => {\n\t\treturn removeImage(context);\n\t});\n}\n","/** Locale interface and default English locale for the ImagePlugin. */\n\n// --- Locale Interface ---\n\nexport interface ImageLocale {\n\treadonly insertImage: string;\n\treadonly insertImageTooltip: string;\n\treadonly uploadFromComputer: string;\n\treadonly uploadAria: string;\n\treadonly separator: string;\n\treadonly urlPlaceholder: string;\n\treadonly urlAria: string;\n\treadonly insertButton: string;\n\treadonly insertAria: string;\n\treadonly imageAria: (alt: string, width?: number, height?: number) => string;\n\treadonly resetToNaturalSize: string;\n\treadonly uploadFailed: string;\n\treadonly uploading: string;\n\treadonly resizeHandleLabel: (position: string) => string;\n\treadonly imageSelected: string;\n\treadonly altTextPrefix: string;\n\treadonly imageSizeAnnounce: (w: number, h: number) => string;\n\treadonly resizeHint: (shrink: string, grow: string) => string;\n\treadonly imageResized: (w: number, h: number) => string;\n\treadonly keyboardResizeHint: (shrink: string, grow: string) => string;\n}\n\n// --- Default English Locale ---\n\nexport const IMAGE_LOCALE_EN: ImageLocale = {\n\tinsertImage: 'Insert Image',\n\tinsertImageTooltip: 'Insert Image',\n\tuploadFromComputer: 'Upload from computer',\n\tuploadAria: 'Upload image from computer',\n\tseparator: 'or',\n\turlPlaceholder: 'https://...',\n\turlAria: 'Image URL',\n\tinsertButton: 'Insert',\n\tinsertAria: 'Insert image',\n\timageAria: (alt: string, width?: number, height?: number) => {\n\t\tconst parts: string[] = [alt || 'Image'];\n\t\tif (width !== undefined && height !== undefined) {\n\t\t\tparts.push(`${width} by ${height} pixels`);\n\t\t}\n\t\treturn parts.join(', ');\n\t},\n\tresetToNaturalSize: 'Image reset to natural size.',\n\tuploadFailed: 'Upload failed.',\n\tuploading: 'Uploading...',\n\tresizeHandleLabel: (position: string) => `Resize ${position}`,\n\timageSelected: 'Image selected.',\n\taltTextPrefix: 'Alt text: ',\n\timageSizeAnnounce: (w: number, h: number) => `Size: ${w} by ${h} pixels.`,\n\tresizeHint: (shrink: string, grow: string) => `${shrink} / ${grow} to resize.`,\n\timageResized: (w: number, h: number) => `Image resized to ${w} by ${h} pixels.`,\n\tkeyboardResizeHint: (shrink: string, grow: string) => `${shrink} / ${grow} to resize`,\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: Record<string, () => Promise<{ default: ImageLocale }>> = import.meta.glob<{\n\tdefault: ImageLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadImageLocale(lang: string): Promise<ImageLocale> {\n\tif (lang === 'en') return IMAGE_LOCALE_EN;\n\tconst loader = localeModules[`./locales/${lang}.ts`];\n\tif (!loader) return IMAGE_LOCALE_EN;\n\ttry {\n\t\tconst mod = await loader();\n\t\treturn mod.default;\n\t} catch {\n\t\treturn IMAGE_LOCALE_EN;\n\t}\n}\n","/**\n * NodeView factory for image blocks.\n * Renders <figure> with <img>, handles selection state, upload overlay,\n * resize with 4 corner handles + live size indicator, and a keyboard-hint\n * showing resize shortcuts when the image is selected.\n */\n\nimport type { BlockAttrs, BlockNode } from '../../model/Document.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport { getTextDirection } from '../../platform/Platform.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Transaction } from '../../state/Transaction.js';\nimport {\n\tgetStyleNonceForNode,\n\tsetStyleProperties,\n\tsetStyleProperty,\n} from '../../style/StyleRuntime.js';\nimport type { NodeView, NodeViewFactory } from '../../view/NodeView.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { IMAGE_LOCALE_EN, type ImageLocale } from './ImageLocale.js';\nimport type { ImageKeymap, ImagePluginConfig, UploadState } from './ImageUpload.js';\n\nconst ALIGNMENT_CLASSES: Record<string, string> = {\n\tstart: 'notectl-image--start',\n\tcenter: 'notectl-image--center',\n\tend: 'notectl-image--end',\n};\n\nconst MIN_IMAGE_WIDTH = 50;\n\ntype HandlePosition = 'nw' | 'ne' | 'sw' | 'se';\n\nconst HANDLE_CURSORS: Readonly<Record<HandlePosition, string>> = {\n\tnw: 'nwse-resize',\n\tne: 'nesw-resize',\n\tsw: 'nesw-resize',\n\tse: 'nwse-resize',\n};\n\n/** +1 means dragging right increases width; -1 means dragging left does. */\nconst HANDLE_X_SIGN: Readonly<Record<HandlePosition, 1 | -1>> = {\n\tnw: -1,\n\tne: 1,\n\tsw: -1,\n\tse: 1,\n};\n\nconst HANDLE_POSITIONS_LTR: Readonly<Record<HandlePosition, string>> = {\n\tnw: 'top-left',\n\tne: 'top-right',\n\tsw: 'bottom-left',\n\tse: 'bottom-right',\n};\n\nconst HANDLE_POSITIONS_RTL: Readonly<Record<HandlePosition, string>> = {\n\tnw: 'top-right',\n\tne: 'top-left',\n\tsw: 'bottom-right',\n\tse: 'bottom-left',\n};\n\nconst RTL_CURSOR_MAP: Readonly<Record<HandlePosition, string>> = {\n\tnw: 'nesw-resize',\n\tne: 'nwse-resize',\n\tsw: 'nwse-resize',\n\tse: 'nesw-resize',\n};\n\n/** Returns the direction-aware ARIA label for a resize handle. */\nexport function getHandleLabel(\n\tposition: HandlePosition,\n\tisRtl: boolean,\n\tlocale: ImageLocale = IMAGE_LOCALE_EN,\n): string {\n\tconst positionName: string = (isRtl ? HANDLE_POSITIONS_RTL : HANDLE_POSITIONS_LTR)[position];\n\treturn locale.resizeHandleLabel(positionName);\n}\n\n/** Returns the X-sign for resize drag, flipped in RTL. */\nexport function getResizeXSign(position: HandlePosition, isRtl: boolean): 1 | -1 {\n\tconst sign: 1 | -1 = HANDLE_X_SIGN[position];\n\treturn isRtl ? (-sign as 1 | -1) : sign;\n}\n\n// --- Global cursor override during resize ---\n\nlet activeCursorStyle: HTMLStyleElement | null = null;\n\nfunction setGlobalResizeCursor(cursor: string, referenceNode?: Node): void {\n\tclearGlobalResizeCursor();\n\tactiveCursorStyle = document.createElement('style');\n\tconst nonce = referenceNode ? getStyleNonceForNode(referenceNode) : undefined;\n\tif (nonce) {\n\t\tactiveCursorStyle.setAttribute('nonce', nonce);\n\t}\n\tactiveCursorStyle.textContent = `*{cursor:${cursor}!important;user-select:none!important}`;\n\tdocument.head.appendChild(activeCursorStyle);\n}\n\nfunction clearGlobalResizeCursor(): void {\n\tif (activeCursorStyle) {\n\t\tactiveCursorStyle.remove();\n\t\tactiveCursorStyle = null;\n\t}\n}\n\n/** Builds the keyboard-hint text from the resolved keymap. */\nfunction buildKeyboardHintText(\n\tresolvedKeymap: Readonly<Record<keyof ImageKeymap, string | null>>,\n\tlocale: ImageLocale,\n): string {\n\tconst shrink: string | null = resolvedKeymap.shrinkWidth ?? null;\n\tconst grow: string | null = resolvedKeymap.growWidth ?? null;\n\tif (!shrink || !grow) return '';\n\treturn locale.keyboardResizeHint(formatShortcut(shrink), formatShortcut(grow));\n}\n\n/** Creates a NodeViewFactory for image blocks. */\nexport function createImageNodeViewFactory(\n\tconfig: ImagePluginConfig,\n\tuploadStates: Map<BlockId, UploadState>,\n\tresolvedKeymap?: Readonly<Record<keyof ImageKeymap, string | null>>,\n\tlocale: ImageLocale = IMAGE_LOCALE_EN,\n): NodeViewFactory {\n\treturn (\n\t\tnode: BlockNode,\n\t\tgetState: () => EditorState,\n\t\tdispatch: (tr: Transaction) => void,\n\t): NodeView => {\n\t\t// --- DOM Construction ---\n\t\tconst figure: HTMLElement = document.createElement('figure');\n\t\tfigure.className = 'notectl-image';\n\t\tfigure.setAttribute('data-block-id', node.id);\n\t\tfigure.setAttribute('data-void', 'true');\n\t\tfigure.setAttribute('data-selectable', 'true');\n\n\t\tconst container: HTMLDivElement = document.createElement('div');\n\t\tcontainer.className = 'notectl-image__container';\n\n\t\tconst img: HTMLImageElement = document.createElement('img');\n\t\timg.className = 'notectl-image__img';\n\t\timg.draggable = false;\n\n\t\tconst overlay: HTMLDivElement = document.createElement('div');\n\t\toverlay.className = 'notectl-image__overlay';\n\n\t\tcontainer.appendChild(img);\n\t\tcontainer.appendChild(overlay);\n\t\tfigure.appendChild(container);\n\n\t\tlet currentNodeId: BlockId = node.id;\n\t\tlet resizeOverlay: HTMLDivElement | null = null;\n\n\t\t// --- ARIA Label ---\n\n\t\tfunction updateAriaLabel(n: BlockNode): void {\n\t\t\tconst alt: string = (n.attrs?.alt as string | undefined) ?? '';\n\t\t\tconst width: number | undefined = n.attrs?.width as number | undefined;\n\t\t\tconst height: number | undefined = n.attrs?.height as number | undefined;\n\t\t\tfigure.setAttribute('aria-label', locale.imageAria(alt, width, height));\n\t\t}\n\n\t\t// --- Attribute Application ---\n\n\t\tfunction applyAttrs(n: BlockNode): void {\n\t\t\tconst src: string = (n.attrs?.src as string | undefined) ?? '';\n\t\t\tconst alt: string = (n.attrs?.alt as string | undefined) ?? '';\n\t\t\tconst width: number | undefined = n.attrs?.width as number | undefined;\n\t\t\tconst height: number | undefined = n.attrs?.height as number | undefined;\n\t\t\tconst align: string = (n.attrs?.align as string | undefined) ?? 'center';\n\n\t\t\t// Only update src when it changes to avoid re-triggering load events\n\t\t\tif (img.src !== src) img.src = src;\n\t\t\timg.alt = alt;\n\n\t\t\tif (width !== undefined) {\n\t\t\t\tsetStyleProperty(img, 'width', `${width}px`);\n\t\t\t} else {\n\t\t\t\tsetStyleProperty(img, 'width', '');\n\t\t\t}\n\t\t\tif (height !== undefined) {\n\t\t\t\tsetStyleProperty(img, 'height', `${height}px`);\n\t\t\t} else {\n\t\t\t\tsetStyleProperty(img, 'height', '');\n\t\t\t}\n\n\t\t\tfor (const cls of Object.values(ALIGNMENT_CLASSES)) {\n\t\t\t\tfigure.classList.remove(cls);\n\t\t\t}\n\t\t\tconst alignClass: string | undefined = ALIGNMENT_CLASSES[align];\n\t\t\tif (alignClass) {\n\t\t\t\tfigure.classList.add(alignClass);\n\t\t\t}\n\n\t\t\tconst uploadState: UploadState = uploadStates.get(n.id) ?? 'idle';\n\t\t\tconst isUploading: boolean = uploadState === 'uploading';\n\t\t\toverlay.classList.toggle('notectl-image__overlay--uploading', isUploading);\n\t\t\toverlay.classList.toggle('notectl-image__overlay--error', uploadState === 'error');\n\n\t\t\tif (isUploading) {\n\t\t\t\toverlay.textContent = locale.uploading;\n\t\t\t} else if (uploadState === 'error') {\n\t\t\t\toverlay.textContent = locale.uploadFailed;\n\t\t\t} else {\n\t\t\t\toverlay.textContent = '';\n\t\t\t}\n\n\t\t\tif (isUploading) {\n\t\t\t\tfigure.setAttribute('aria-busy', 'true');\n\t\t\t} else {\n\t\t\t\tfigure.removeAttribute('aria-busy');\n\t\t\t}\n\n\t\t\tupdateAriaLabel(n);\n\t\t}\n\n\t\tapplyAttrs(node);\n\n\t\t// --- Commit natural dimensions on first load ---\n\n\t\tlet dimensionsCommitted = false;\n\n\t\timg.addEventListener('load', () => {\n\t\t\tif (dimensionsCommitted) return;\n\n\t\t\tconst state: EditorState = getState();\n\t\t\tconst block: BlockNode | undefined = state.getBlock(currentNodeId);\n\t\t\tif (!block || block.type !== 'image') return;\n\n\t\t\tconst hasWidth: boolean = block.attrs?.width !== undefined;\n\t\t\tconst hasHeight: boolean = block.attrs?.height !== undefined;\n\t\t\tif (hasWidth && hasHeight) {\n\t\t\t\tdimensionsCommitted = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst naturalW: number = img.naturalWidth;\n\t\t\tconst naturalH: number = img.naturalHeight;\n\t\t\tif (naturalW === 0 || naturalH === 0) return;\n\n\t\t\tconst clampedW: number = Math.min(naturalW, config.maxWidth);\n\t\t\tconst ratio: number = naturalW > 0 ? naturalH / naturalW : 1;\n\t\t\tconst clampedH: number = Math.round(clampedW * ratio);\n\n\t\t\tconst path: BlockId[] | undefined = state.getNodePath(currentNodeId);\n\t\t\tif (!path) return;\n\n\t\t\tconst merged: BlockAttrs = {\n\t\t\t\t...(block.attrs ?? {}),\n\t\t\t\twidth: clampedW,\n\t\t\t\theight: clampedH,\n\t\t\t};\n\n\t\t\tconst tr: Transaction = state.transaction('command').setNodeAttr(path, merged).build();\n\t\t\tdispatch(tr);\n\t\t\tdimensionsCommitted = true;\n\t\t});\n\n\t\t// --- Resize Logic ---\n\n\t\tfunction clampWidth(width: number): number {\n\t\t\treturn Math.max(MIN_IMAGE_WIDTH, Math.min(config.maxWidth, width));\n\t\t}\n\n\t\tfunction commitResize(nodeId: BlockId, width: number, height: number): void {\n\t\t\tconst state: EditorState = getState();\n\t\t\tconst block: BlockNode | undefined = state.getBlock(nodeId);\n\t\t\tif (!block) return;\n\n\t\t\tconst prevWidth: number | undefined = block.attrs?.width as number | undefined;\n\t\t\tconst prevHeight: number | undefined = block.attrs?.height as number | undefined;\n\t\t\tif (prevWidth === width && prevHeight === height) return;\n\n\t\t\tconst path: BlockId[] | undefined = state.getNodePath(nodeId);\n\t\t\tif (!path) return;\n\n\t\t\tconst merged: BlockAttrs = {\n\t\t\t\t...(block.attrs ?? {}),\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t};\n\n\t\t\tconst tr: Transaction = state.transaction('command').setNodeAttr(path, merged).build();\n\t\t\tdispatch(tr);\n\t\t}\n\n\t\tfunction attachHandleListeners(\n\t\t\thandle: HTMLDivElement,\n\t\t\tposition: HandlePosition,\n\t\t\tnodeId: BlockId,\n\t\t\tsizeIndicator: HTMLDivElement,\n\t\t): void {\n\t\t\tlet startX = 0;\n\t\t\tlet startWidth = 0;\n\t\t\tlet aspectRatio = 1;\n\t\t\tlet xSign: 1 | -1 = HANDLE_X_SIGN[position];\n\n\t\t\tconst onPointerMove = (e: PointerEvent): void => {\n\t\t\t\tconst deltaX: number = e.clientX - startX;\n\t\t\t\tconst newWidth: number = clampWidth(startWidth + deltaX * xSign);\n\t\t\t\tconst newHeight: number = Math.round(newWidth / aspectRatio);\n\n\t\t\t\tsetStyleProperties(img, {\n\t\t\t\t\twidth: `${newWidth}px`,\n\t\t\t\t\theight: `${newHeight}px`,\n\t\t\t\t});\n\n\t\t\t\tsizeIndicator.textContent = `${Math.round(newWidth)} \\u00D7 ${newHeight}`;\n\t\t\t};\n\n\t\t\tconst onPointerUp = (e: PointerEvent): void => {\n\t\t\t\tdocument.removeEventListener('pointermove', onPointerMove);\n\t\t\t\tdocument.removeEventListener('pointerup', onPointerUp);\n\n\t\t\t\tfigure.classList.remove('notectl-image--resizing');\n\t\t\t\tsizeIndicator.classList.remove('notectl-image__size-indicator--visible');\n\t\t\t\tclearGlobalResizeCursor();\n\n\t\t\t\tconst finalWidth: number = Math.round(img.getBoundingClientRect().width);\n\t\t\t\tconst finalHeight: number = Math.round(finalWidth / aspectRatio);\n\n\t\t\t\tcommitResize(nodeId, finalWidth, finalHeight);\n\n\t\t\t\t(e.target as HTMLElement | null)?.releasePointerCapture?.(e.pointerId);\n\t\t\t};\n\n\t\t\thandle.addEventListener('pointerdown', (e: PointerEvent) => {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\n\t\t\t\tconst isRtl: boolean = getTextDirection(figure) === 'rtl';\n\t\t\t\txSign = getResizeXSign(position, isRtl);\n\n\t\t\t\tstartX = e.clientX;\n\t\t\t\tstartWidth = img.getBoundingClientRect().width;\n\t\t\t\tconst imgHeight: number = img.getBoundingClientRect().height;\n\t\t\t\taspectRatio = imgHeight > 0 ? startWidth / imgHeight : 1;\n\n\t\t\t\tfigure.classList.add('notectl-image--resizing');\n\t\t\t\tsizeIndicator.textContent = `${Math.round(startWidth)} \\u00D7 ${Math.round(imgHeight)}`;\n\t\t\t\tsizeIndicator.classList.add('notectl-image__size-indicator--visible');\n\t\t\t\tconst cursor: string = isRtl ? RTL_CURSOR_MAP[position] : HANDLE_CURSORS[position];\n\t\t\t\tsetGlobalResizeCursor(cursor, figure);\n\n\t\t\t\t(e.target as HTMLElement).setPointerCapture(e.pointerId);\n\t\t\t\tdocument.addEventListener('pointermove', onPointerMove);\n\t\t\t\tdocument.addEventListener('pointerup', onPointerUp);\n\t\t\t});\n\t\t}\n\n\t\tfunction createResizeOverlay(nodeId: BlockId): void {\n\t\t\tif (!config.resizable || resizeOverlay) return;\n\n\t\t\tresizeOverlay = document.createElement('div');\n\t\t\tresizeOverlay.className = 'notectl-image__resize-overlay';\n\t\t\tresizeOverlay.setAttribute('data-notectl-no-print', '');\n\n\t\t\tconst sizeIndicator: HTMLDivElement = document.createElement('div');\n\t\t\tsizeIndicator.className = 'notectl-image__size-indicator';\n\t\t\tresizeOverlay.appendChild(sizeIndicator);\n\n\t\t\tconst isRtl: boolean = getTextDirection(figure) === 'rtl';\n\t\t\tconst positions: readonly HandlePosition[] = ['nw', 'ne', 'sw', 'se'];\n\t\t\tfor (const pos of positions) {\n\t\t\t\tconst handle: HTMLDivElement = document.createElement('div');\n\t\t\t\thandle.className = `notectl-image__resize-handle notectl-image__resize-handle--${pos}`;\n\t\t\t\thandle.setAttribute('role', 'separator');\n\t\t\t\thandle.setAttribute('aria-label', getHandleLabel(pos, isRtl, locale));\n\t\t\t\tattachHandleListeners(handle, pos, nodeId, sizeIndicator);\n\t\t\t\tresizeOverlay.appendChild(handle);\n\t\t\t}\n\n\t\t\t// Keyboard hint (hidden from screenreaders, visual only)\n\t\t\tif (resolvedKeymap) {\n\t\t\t\tconst hintText: string = buildKeyboardHintText(resolvedKeymap, locale);\n\t\t\t\tif (hintText) {\n\t\t\t\t\tconst hint: HTMLDivElement = document.createElement('div');\n\t\t\t\t\thint.className = 'notectl-image__keyboard-hint';\n\t\t\t\t\thint.setAttribute('aria-hidden', 'true');\n\t\t\t\t\thint.textContent = hintText;\n\t\t\t\t\tresizeOverlay.appendChild(hint);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcontainer.appendChild(resizeOverlay);\n\t\t}\n\n\t\tfunction removeResizeOverlay(): void {\n\t\t\tclearGlobalResizeCursor();\n\t\t\tif (resizeOverlay) {\n\t\t\t\tresizeOverlay.remove();\n\t\t\t\tresizeOverlay = null;\n\t\t\t}\n\t\t}\n\n\t\t// --- NodeView Interface ---\n\n\t\treturn {\n\t\t\tdom: figure,\n\t\t\tcontentDOM: null,\n\n\t\t\tupdate(updatedNode: BlockNode): boolean {\n\t\t\t\tif (updatedNode.type !== 'image') return false;\n\t\t\t\tcurrentNodeId = updatedNode.id;\n\t\t\t\tfigure.setAttribute('data-block-id', updatedNode.id);\n\t\t\t\tapplyAttrs(updatedNode);\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\tselectNode(): void {\n\t\t\t\tfigure.classList.add('notectl-image--selected');\n\t\t\t\tcreateResizeOverlay(currentNodeId);\n\t\t\t},\n\n\t\t\tdeselectNode(): void {\n\t\t\t\tfigure.classList.remove('notectl-image--selected');\n\t\t\t\tremoveResizeOverlay();\n\t\t\t},\n\n\t\t\tdestroy(): void {\n\t\t\t\tremoveResizeOverlay();\n\t\t\t\t// Do NOT revoke blob URLs here — the URL may still be referenced\n\t\t\t\t// by the clipboard (cut/paste) or undo history. Blob URLs are\n\t\t\t\t// automatically released when the document is unloaded.\n\t\t\t},\n\t\t};\n\t};\n}\n","/**\n * Renders the image insert popup with file upload and URL input,\n * following the same pattern as FontSizePopup.\n */\n\nimport { setStyleProperty, setStyleText } from '../../style/StyleRuntime.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { insertImage } from './ImageCommands.js';\nimport type { ImageLocale } from './ImageLocale.js';\n\n// --- Config ---\n\nexport interface ImagePopupConfig {\n\treadonly acceptedTypes: readonly string[];\n\treadonly locale: ImageLocale;\n\treadonly onFileInsert: (context: PluginContext, file: File) => void;\n\treadonly onClose: () => void;\n}\n\n// --- Public Entry Point ---\n\n/** Builds the image insert popup DOM inside the given container. */\nexport function renderImagePopup(\n\tcontainer: HTMLElement,\n\tcontext: PluginContext,\n\tconfig: ImagePopupConfig,\n): void {\n\tsetStyleProperty(container, 'padding', '8px');\n\tsetStyleProperty(container, 'minWidth', '240px');\n\n\tappendFileUploadSection(container, context, config);\n\tappendSeparator(container, config.locale);\n\tappendUrlSection(container, context, config);\n}\n\n// --- File Upload Section ---\n\nfunction appendFileUploadSection(\n\tcontainer: HTMLElement,\n\tcontext: PluginContext,\n\tconfig: ImagePopupConfig,\n): void {\n\tconst fileInput: HTMLInputElement = document.createElement('input');\n\tfileInput.type = 'file';\n\tfileInput.accept = config.acceptedTypes.join(',');\n\tsetStyleText(fileInput, 'position:absolute;width:0;height:0;overflow:hidden;opacity:0;');\n\n\tconst uploadBtn: HTMLButtonElement = document.createElement('button');\n\tuploadBtn.type = 'button';\n\tuploadBtn.textContent = config.locale.uploadFromComputer;\n\tuploadBtn.setAttribute('aria-label', config.locale.uploadAria);\n\tsetStyleText(\n\t\tuploadBtn,\n\t\t'display:block;width:100%;padding:8px 12px;cursor:pointer;' +\n\t\t\t'text-align:center;box-sizing:border-box;' +\n\t\t\t'border:1px solid var(--notectl-border);border-radius:4px;' +\n\t\t\t'background:var(--notectl-surface-raised);color:var(--notectl-fg);',\n\t);\n\n\tuploadBtn.addEventListener('mousedown', (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tfileInput.click();\n\t});\n\n\tfileInput.addEventListener('change', () => {\n\t\tconst file: File | undefined = fileInput.files?.[0];\n\t\tif (file) {\n\t\t\tconfig.onFileInsert(context, file);\n\t\t\tconfig.onClose();\n\t\t\tcontext.getContainer().focus();\n\t\t}\n\t});\n\n\tcontainer.appendChild(fileInput);\n\tcontainer.appendChild(uploadBtn);\n}\n\n// --- Separator ---\n\nfunction appendSeparator(container: HTMLElement, locale: ImageLocale): void {\n\tconst separator: HTMLDivElement = document.createElement('div');\n\tsetStyleText(\n\t\tseparator,\n\t\t'display:flex;align-items:center;margin:8px 0;' +\n\t\t\t'color:var(--notectl-fg-muted);font-size:12px;',\n\t);\n\n\tconst line1: HTMLSpanElement = document.createElement('span');\n\tsetStyleText(line1, 'flex:1;height:1px;background:var(--notectl-border);');\n\n\tconst orText: HTMLSpanElement = document.createElement('span');\n\torText.textContent = locale.separator;\n\tsetStyleText(orText, 'padding:0 8px;');\n\n\tconst line2: HTMLSpanElement = document.createElement('span');\n\tsetStyleText(line2, 'flex:1;height:1px;background:var(--notectl-border);');\n\n\tseparator.appendChild(line1);\n\tseparator.appendChild(orText);\n\tseparator.appendChild(line2);\n\tcontainer.appendChild(separator);\n}\n\n// --- URL Input Section ---\n\nfunction appendUrlSection(\n\tcontainer: HTMLElement,\n\tcontext: PluginContext,\n\tconfig: ImagePopupConfig,\n): void {\n\tconst urlInput: HTMLInputElement = document.createElement('input');\n\turlInput.type = 'url';\n\turlInput.placeholder = config.locale.urlPlaceholder;\n\turlInput.setAttribute('aria-label', config.locale.urlAria);\n\tsetStyleText(\n\t\turlInput,\n\t\t'width:100%;padding:6px 8px;box-sizing:border-box;' +\n\t\t\t'border:1px solid var(--notectl-border);border-radius:4px;' +\n\t\t\t'background:var(--notectl-surface-overlay);color:var(--notectl-fg);',\n\t);\n\n\tconst insertBtn: HTMLButtonElement = document.createElement('button');\n\tinsertBtn.type = 'button';\n\tinsertBtn.textContent = config.locale.insertButton;\n\tinsertBtn.setAttribute('aria-label', config.locale.insertAria);\n\tsetStyleText(\n\t\tinsertBtn,\n\t\t'width:100%;padding:8px 12px;margin-top:4px;cursor:pointer;' +\n\t\t\t'border:1px solid var(--notectl-border);border-radius:4px;' +\n\t\t\t'background:var(--notectl-surface-raised);color:var(--notectl-fg);',\n\t);\n\n\tconst applyUrl = (): void => {\n\t\tconst src: string = urlInput.value.trim();\n\t\tif (src) {\n\t\t\tinsertImage(context, { src });\n\t\t\tconfig.onClose();\n\t\t\tcontext.getContainer().focus();\n\t\t}\n\t};\n\n\tinsertBtn.addEventListener('mousedown', (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tapplyUrl();\n\t});\n\n\turlInput.addEventListener('keydown', (e: KeyboardEvent) => {\n\t\tif (e.key === 'Enter') {\n\t\t\te.preventDefault();\n\t\t\tapplyUrl();\n\t\t}\n\t});\n\n\tcontainer.appendChild(urlInput);\n\tcontainer.appendChild(insertBtn);\n\n\trequestAnimationFrame(() => urlInput.focus());\n}\n","/**\n * Image plugin types, configuration, and service key.\n */\n\nimport { ServiceKey } from '../Plugin.js';\nimport type { ImageLocale } from './ImageLocale.js';\n\n// --- Image Attributes ---\n\nexport interface ImageAttrs {\n\treadonly src: string;\n\treadonly alt: string;\n\treadonly width?: number;\n\treadonly height?: number;\n\treadonly align: 'start' | 'center' | 'end';\n}\n\n// --- Upload Types ---\n\nexport interface ImageUploadResult {\n\treadonly url: string;\n\treadonly width?: number;\n\treadonly height?: number;\n}\n\nexport interface ImageUploadService {\n\tupload(file: File): Promise<ImageUploadResult>;\n}\n\nexport const IMAGE_UPLOAD_SERVICE = new ServiceKey<ImageUploadService>('image:upload');\n\nexport type UploadState = 'idle' | 'uploading' | 'complete' | 'error';\n\n// --- Keyboard Bindings ---\n\n/**\n * Configurable keyboard bindings for image resize actions.\n * Omit a slot to use the default; set to `null` to disable the binding.\n *\n * Key descriptor format: `'Mod-Shift-ArrowRight'`, etc.\n * `Mod` resolves to Cmd on macOS, Ctrl on Windows/Linux.\n */\nexport interface ImageKeymap {\n\treadonly growWidth?: string | null;\n\treadonly shrinkWidth?: string | null;\n\treadonly growWidthLarge?: string | null;\n\treadonly shrinkWidthLarge?: string | null;\n\treadonly resetSize?: string | null;\n}\n\nexport const DEFAULT_IMAGE_KEYMAP: Readonly<Record<keyof ImageKeymap, string>> = {\n\tgrowWidth: 'Mod-Shift-ArrowRight',\n\tshrinkWidth: 'Mod-Shift-ArrowLeft',\n\tgrowWidthLarge: 'Mod-Shift-Alt-ArrowRight',\n\tshrinkWidthLarge: 'Mod-Shift-Alt-ArrowLeft',\n\tresetSize: 'Mod-Shift-0',\n};\n\n// --- Configuration ---\n\nexport interface ImagePluginConfig {\n\treadonly maxWidth: number;\n\treadonly maxFileSize: number;\n\treadonly acceptedTypes: readonly string[];\n\treadonly resizable: boolean;\n\t/** Pixels to grow/shrink per small resize step. @default 10 */\n\treadonly resizeStep?: number;\n\t/** Pixels to grow/shrink per large resize step. @default 50 */\n\treadonly resizeStepLarge?: number;\n\t/** Customize keyboard bindings for image resize actions. */\n\treadonly keymap?: ImageKeymap;\n\t/** Locale override for user-facing strings. */\n\treadonly locale?: ImageLocale;\n}\n\nexport const DEFAULT_IMAGE_CONFIG: ImagePluginConfig = {\n\tmaxWidth: 800,\n\tmaxFileSize: 10 * 1024 * 1024,\n\tacceptedTypes: ['image/png', 'image/jpeg', 'image/gif', 'image/webp', 'image/svg+xml'],\n\tresizable: true,\n\tresizeStep: 10,\n\tresizeStepLarge: 50,\n};\n","/**\n * ImagePlugin: registers an image void block type with NodeSpec,\n * NodeView, commands, file handler, toolbar button, and accessible\n * keyboard resize with screenreader announcements.\n */\n\nimport { IMAGE_CSS } from '../../editor/styles/image.js';\nimport type { BlockAttrs, BlockNode } from '../../model/Document.js';\nimport { escapeHTML } from '../../model/HTMLUtils.js';\nimport { isNodeSelection } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Transaction } from '../../state/Transaction.js';\nimport { setStyleProperty } from '../../style/StyleRuntime.js';\nimport { createBlockElement } from '../../view/DomUtils.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport {\n\tinsertImage,\n\tregisterImageCommands,\n\tresetImageSize,\n\tresizeImageByDelta,\n} from './ImageCommands.js';\nimport { IMAGE_LOCALE_EN, type ImageLocale, loadImageLocale } from './ImageLocale.js';\nimport { createImageNodeViewFactory } from './ImageNodeView.js';\nimport { renderImagePopup } from './ImagePopup.js';\nimport {\n\tDEFAULT_IMAGE_CONFIG,\n\tDEFAULT_IMAGE_KEYMAP,\n\tIMAGE_UPLOAD_SERVICE,\n\ttype ImageKeymap,\n\ttype ImagePluginConfig,\n\ttype UploadState,\n} from './ImageUpload.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface NodeAttrRegistry {\n\t\timage: {\n\t\t\tsrc: string;\n\t\t\talt: string;\n\t\t\twidth?: number;\n\t\t\theight?: number;\n\t\t\talign: 'start' | 'center' | 'end';\n\t\t};\n\t}\n}\n\n// --- Plugin ---\n\nexport class ImagePlugin implements Plugin {\n\treadonly id = 'image';\n\treadonly name = 'Image';\n\treadonly priority = 45;\n\n\tprivate readonly config: ImagePluginConfig;\n\tprivate readonly resolvedKeymap: Readonly<Record<keyof ImageKeymap, string | null>>;\n\tprivate readonly uploadStates = new Map<BlockId, UploadState>();\n\tprivate readonly blobUrls = new Set<string>();\n\tprivate context: PluginContext | null = null;\n\tprivate locale!: ImageLocale;\n\n\tconstructor(config?: Partial<ImagePluginConfig>) {\n\t\tthis.config = { ...DEFAULT_IMAGE_CONFIG, ...config };\n\t\tthis.resolvedKeymap = { ...DEFAULT_IMAGE_KEYMAP, ...config?.keymap };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tIMAGE_LOCALE_EN,\n\t\t\tloadImageLocale,\n\t\t);\n\t\tcontext.registerStyleSheet(IMAGE_CSS);\n\t\tthis.context = context;\n\t\tthis.registerNodeSpec(context);\n\t\tthis.registerNodeView(context);\n\t\tregisterImageCommands(context);\n\t\tthis.registerResizeCommands(context);\n\t\tthis.registerResizeKeymaps(context);\n\t\tthis.registerFileHandler(context);\n\t\tthis.registerToolbarItem(context);\n\t}\n\n\tdestroy(): void {\n\t\tfor (const url of this.blobUrls) {\n\t\t\tURL.revokeObjectURL(url);\n\t\t}\n\t\tthis.blobUrls.clear();\n\t\tthis.uploadStates.clear();\n\t\tthis.context = null;\n\t}\n\n\tonStateChange(oldState: EditorState, newState: EditorState, _tr: Transaction): void {\n\t\tif (!this.context) return;\n\n\t\t// Clean up upload states for removed blocks (searches full tree)\n\t\tfor (const id of this.uploadStates.keys()) {\n\t\t\tif (!newState.getBlock(id)) {\n\t\t\t\tthis.uploadStates.delete(id);\n\t\t\t}\n\t\t}\n\n\t\t// Announce image selection for screenreaders\n\t\tconst oldIsImage: boolean = this.isImageSelected(oldState);\n\t\tconst nowIsImage: boolean = this.isImageSelected(newState);\n\n\t\tif (!oldIsImage && nowIsImage) {\n\t\t\tthis.announceImageSelection(newState);\n\t\t}\n\t}\n\n\tprivate registerNodeSpec(context: PluginContext): void {\n\t\tconst locale = this.locale;\n\t\tcontext.registerNodeSpec({\n\t\t\ttype: 'image',\n\t\t\tgroup: 'block',\n\t\t\tisVoid: true,\n\t\t\tselectable: true,\n\t\t\tattrs: {\n\t\t\t\tsrc: { default: '' },\n\t\t\t\talt: { default: '' },\n\t\t\t\talign: { default: 'center' },\n\t\t\t},\n\t\t\ttoDOM(node) {\n\t\t\t\tconst figure = createBlockElement('figure', node.id);\n\t\t\t\tfigure.className = 'notectl-image';\n\t\t\t\tfigure.setAttribute('data-void', 'true');\n\t\t\t\tfigure.setAttribute('data-selectable', 'true');\n\n\t\t\t\tconst imgContainer: HTMLDivElement = document.createElement('div');\n\t\t\t\timgContainer.className = 'notectl-image__container';\n\n\t\t\t\tconst alt: string = (node.attrs?.alt as string | undefined) ?? '';\n\t\t\t\tconst width: number | undefined = node.attrs?.width as number | undefined;\n\t\t\t\tconst height: number | undefined = node.attrs?.height as number | undefined;\n\n\t\t\t\tconst img: HTMLImageElement = document.createElement('img');\n\t\t\t\timg.className = 'notectl-image__img';\n\t\t\t\timg.src = (node.attrs?.src as string | undefined) ?? '';\n\t\t\t\timg.alt = alt;\n\t\t\t\timg.draggable = false;\n\n\t\t\t\tif (width !== undefined) setStyleProperty(img, 'width', `${width}px`);\n\t\t\t\tif (height !== undefined) setStyleProperty(img, 'height', `${height}px`);\n\n\t\t\t\tconst align: string = (node.attrs?.align as string | undefined) ?? 'center';\n\t\t\t\tconst alignClass: string | undefined = {\n\t\t\t\t\tstart: 'notectl-image--start',\n\t\t\t\t\tcenter: 'notectl-image--center',\n\t\t\t\t\tend: 'notectl-image--end',\n\t\t\t\t}[align];\n\t\t\t\tif (alignClass) figure.classList.add(alignClass);\n\n\t\t\t\tfigure.setAttribute('aria-label', locale.imageAria(alt, width, height));\n\n\t\t\t\timgContainer.appendChild(img);\n\t\t\t\tfigure.appendChild(imgContainer);\n\t\t\t\treturn figure;\n\t\t\t},\n\t\t\ttoHTML(node) {\n\t\t\t\tconst src: string = escapeHTML((node.attrs?.src as string | undefined) ?? '');\n\t\t\t\tconst alt: string = escapeHTML((node.attrs?.alt as string | undefined) ?? '');\n\t\t\t\tconst width: number | undefined = node.attrs?.width as number | undefined;\n\t\t\t\tconst height: number | undefined = node.attrs?.height as number | undefined;\n\n\t\t\t\tconst sizeAttrs: string =\n\t\t\t\t\t(width !== undefined ? ` width=\"${width}\"` : '') +\n\t\t\t\t\t(height !== undefined ? ` height=\"${height}\"` : '');\n\n\t\t\t\t// Alignment is handled by the serializer's alignment injection,\n\t\t\t\t// which works in both inline-style and CSS-class modes.\n\t\t\t\treturn `<figure><img src=\"${src}\" alt=\"${alt}\"${sizeAttrs}></figure>`;\n\t\t\t},\n\t\t\tparseHTML: [\n\t\t\t\t{\n\t\t\t\t\ttag: 'figure',\n\t\t\t\t\tgetAttrs(el) {\n\t\t\t\t\t\tconst img: HTMLImageElement | null = el.querySelector('img');\n\t\t\t\t\t\tif (!img) return false;\n\t\t\t\t\t\tconst attrs: Record<string, string | number | boolean> = {\n\t\t\t\t\t\t\tsrc: img.getAttribute('src') ?? '',\n\t\t\t\t\t\t\talt: img.getAttribute('alt') ?? '',\n\t\t\t\t\t\t\talign: 'center',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst width: string | null = img.getAttribute('width');\n\t\t\t\t\t\tconst height: string | null = img.getAttribute('height');\n\t\t\t\t\t\tif (width) attrs.width = Number.parseInt(width, 10);\n\t\t\t\t\t\tif (height) attrs.height = Number.parseInt(height, 10);\n\n\t\t\t\t\t\t// Check inline style first, then class names (new + legacy)\n\t\t\t\t\t\tconst textAlign: string = el.style?.textAlign ?? '';\n\t\t\t\t\t\tif (textAlign === 'start' || textAlign === 'end' || textAlign === 'center') {\n\t\t\t\t\t\t\tattrs.align = textAlign;\n\t\t\t\t\t\t} else if (textAlign === 'left') {\n\t\t\t\t\t\t\tattrs.align = 'start';\n\t\t\t\t\t\t} else if (textAlign === 'right') {\n\t\t\t\t\t\t\tattrs.align = 'end';\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tel.classList.contains('notectl-align-start') ||\n\t\t\t\t\t\t\tel.classList.contains('notectl-align-left') ||\n\t\t\t\t\t\t\tel.classList.contains('notectl-image--start') ||\n\t\t\t\t\t\t\tel.classList.contains('notectl-image--left')\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tattrs.align = 'start';\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tel.classList.contains('notectl-align-end') ||\n\t\t\t\t\t\t\tel.classList.contains('notectl-align-right') ||\n\t\t\t\t\t\t\tel.classList.contains('notectl-image--end') ||\n\t\t\t\t\t\t\tel.classList.contains('notectl-image--right')\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tattrs.align = 'end';\n\t\t\t\t\t\t} else if (el.classList.contains('notectl-align-center')) {\n\t\t\t\t\t\t\tattrs.align = 'center';\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn attrs;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttag: 'img',\n\t\t\t\t\tgetAttrs(el) {\n\t\t\t\t\t\tconst attrs: Record<string, string | number | boolean> = {\n\t\t\t\t\t\t\tsrc: el.getAttribute('src') ?? '',\n\t\t\t\t\t\t\talt: el.getAttribute('alt') ?? '',\n\t\t\t\t\t\t\talign: 'center',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst width: string | null = el.getAttribute('width');\n\t\t\t\t\t\tconst height: string | null = el.getAttribute('height');\n\t\t\t\t\t\tif (width) attrs.width = Number.parseInt(width, 10);\n\t\t\t\t\t\tif (height) attrs.height = Number.parseInt(height, 10);\n\t\t\t\t\t\treturn attrs;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tsanitize: {\n\t\t\t\ttags: ['figure', 'img'],\n\t\t\t\tattrs: ['src', 'alt', 'width', 'height', 'class', 'style'],\n\t\t\t},\n\t\t});\n\t}\n\n\tprivate registerNodeView(context: PluginContext): void {\n\t\tcontext.registerNodeView(\n\t\t\t'image',\n\t\t\tcreateImageNodeViewFactory(this.config, this.uploadStates, this.resolvedKeymap, this.locale),\n\t\t);\n\t}\n\n\tprivate registerResizeCommands(context: PluginContext): void {\n\t\tconst step: number = this.config.resizeStep ?? 10;\n\t\tconst stepLarge: number = this.config.resizeStepLarge ?? 50;\n\t\tconst maxWidth: number = this.config.maxWidth;\n\n\t\tcontext.registerCommand('resizeImageGrow', () => {\n\t\t\tconst result: boolean = resizeImageByDelta(context, step, maxWidth);\n\t\t\tif (result) this.announceCurrentSize(context);\n\t\t\treturn result;\n\t\t});\n\n\t\tcontext.registerCommand('resizeImageShrink', () => {\n\t\t\tconst result: boolean = resizeImageByDelta(context, -step, maxWidth);\n\t\t\tif (result) this.announceCurrentSize(context);\n\t\t\treturn result;\n\t\t});\n\n\t\tcontext.registerCommand('resizeImageGrowLarge', () => {\n\t\t\tconst result: boolean = resizeImageByDelta(context, stepLarge, maxWidth);\n\t\t\tif (result) this.announceCurrentSize(context);\n\t\t\treturn result;\n\t\t});\n\n\t\tcontext.registerCommand('resizeImageShrinkLarge', () => {\n\t\t\tconst result: boolean = resizeImageByDelta(context, -stepLarge, maxWidth);\n\t\t\tif (result) this.announceCurrentSize(context);\n\t\t\treturn result;\n\t\t});\n\n\t\tcontext.registerCommand('resetImageSize', () => {\n\t\t\tconst result: boolean = resetImageSize(context);\n\t\t\tif (result) context.announce(this.locale.resetToNaturalSize);\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tprivate registerResizeKeymaps(context: PluginContext): void {\n\t\tconst bindings: Record<string, () => boolean> = {};\n\t\tconst commands: Record<keyof ImageKeymap, string> = {\n\t\t\tgrowWidth: 'resizeImageGrow',\n\t\t\tshrinkWidth: 'resizeImageShrink',\n\t\t\tgrowWidthLarge: 'resizeImageGrowLarge',\n\t\t\tshrinkWidthLarge: 'resizeImageShrinkLarge',\n\t\t\tresetSize: 'resetImageSize',\n\t\t};\n\n\t\tfor (const [slot, commandName] of Object.entries(commands)) {\n\t\t\tconst binding: string | null = this.resolvedKeymap[slot as keyof ImageKeymap] ?? null;\n\t\t\tif (binding) {\n\t\t\t\tbindings[binding] = () => context.executeCommand(commandName);\n\t\t\t}\n\t\t}\n\n\t\tif (Object.keys(bindings).length > 0) {\n\t\t\tcontext.registerKeymap(bindings);\n\t\t}\n\t}\n\n\tprivate registerFileHandler(context: PluginContext): void {\n\t\tcontext.registerFileHandler('image/*', async (file, _position) => {\n\t\t\tif (!this.isAcceptedType(file.type)) return false;\n\t\t\tthis.handleFileInsert(context, file);\n\t\t\treturn true;\n\t\t});\n\t}\n\n\tprivate handleFileInsert(context: PluginContext, file: File): void {\n\t\tif (file.size > this.config.maxFileSize) return;\n\n\t\tconst blobUrl: string = URL.createObjectURL(file);\n\t\tthis.blobUrls.add(blobUrl);\n\n\t\tconst inserted: boolean = insertImage(context, { src: blobUrl });\n\t\tif (!inserted) {\n\t\t\tURL.revokeObjectURL(blobUrl);\n\t\t\tthis.blobUrls.delete(blobUrl);\n\t\t\treturn;\n\t\t}\n\n\t\t// Find the newly inserted image block\n\t\tconst state: EditorState = context.getState();\n\t\tconst sel = state.selection;\n\t\tif (!isNodeSelection(sel)) return;\n\t\tconst imageBlockId: BlockId = sel.nodeId;\n\n\t\tthis.uploadStates.set(imageBlockId, 'uploading');\n\n\t\t// Upload if service is registered\n\t\tconst uploadService = context.getService(IMAGE_UPLOAD_SERVICE);\n\t\tif (uploadService) {\n\t\t\tthis.uploadFile(context, file, imageBlockId, blobUrl);\n\t\t} else {\n\t\t\tthis.uploadStates.set(imageBlockId, 'complete');\n\t\t}\n\t}\n\n\tprivate async uploadFile(\n\t\tcontext: PluginContext,\n\t\tfile: File,\n\t\timageBlockId: BlockId,\n\t\tblobUrl: string,\n\t): Promise<void> {\n\t\tconst uploadService = context.getService(IMAGE_UPLOAD_SERVICE);\n\t\tif (!uploadService) return;\n\n\t\ttry {\n\t\t\tconst result = await uploadService.upload(file);\n\t\t\tthis.uploadStates.set(imageBlockId, 'complete');\n\n\t\t\t// Replace blob URL with uploaded URL\n\t\t\tconst state: EditorState = context.getState();\n\t\t\tconst block: BlockNode | undefined = state.getBlock(imageBlockId);\n\t\t\tif (!block) return;\n\n\t\t\tconst path: BlockId[] | undefined = state.getNodePath(imageBlockId);\n\t\t\tif (!path) return;\n\n\t\t\tconst merged: BlockAttrs = {\n\t\t\t\t...(block.attrs ?? {}),\n\t\t\t\tsrc: result.url,\n\t\t\t\t...(result.width !== undefined ? { width: result.width } : {}),\n\t\t\t\t...(result.height !== undefined ? { height: result.height } : {}),\n\t\t\t};\n\n\t\t\tconst tr: Transaction = state.transaction('command').setNodeAttr(path, merged).build();\n\t\t\tcontext.dispatch(tr);\n\n\t\t\t// Clean up blob URL\n\t\t\tURL.revokeObjectURL(blobUrl);\n\t\t\tthis.blobUrls.delete(blobUrl);\n\t\t} catch {\n\t\t\tthis.uploadStates.set(imageBlockId, 'error');\n\t\t\tcontext.announce(this.locale.uploadFailed);\n\t\t}\n\t}\n\n\tprivate registerToolbarItem(context: PluginContext): void {\n\t\tconst icon =\n\t\t\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z\"/></svg>';\n\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'image',\n\t\t\tgroup: 'insert',\n\t\t\ticon,\n\t\t\tlabel: this.locale.insertImage,\n\t\t\ttooltip: this.locale.insertImageTooltip,\n\t\t\tcommand: 'insertImage',\n\t\t\tpopupType: 'custom',\n\t\t\trenderPopup: (container, ctx, onClose) => {\n\t\t\t\trenderImagePopup(container, ctx, {\n\t\t\t\t\tacceptedTypes: this.config.acceptedTypes,\n\t\t\t\t\tlocale: this.locale,\n\t\t\t\t\tonFileInsert: (c, file) => this.handleFileInsert(c, file),\n\t\t\t\t\tonClose,\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t}\n\n\tprivate isAcceptedType(mimeType: string): boolean {\n\t\treturn this.config.acceptedTypes.some(\n\t\t\t(accepted) =>\n\t\t\t\taccepted === mimeType ||\n\t\t\t\t(accepted.endsWith('/*') && mimeType.startsWith(accepted.slice(0, -1))),\n\t\t);\n\t}\n\n\tprivate isImageSelected(state: EditorState): boolean {\n\t\tconst sel = state.selection;\n\t\tif (!isNodeSelection(sel)) return false;\n\t\tconst block: BlockNode | undefined = state.getBlock(sel.nodeId);\n\t\treturn block?.type === 'image';\n\t}\n\n\tprivate announceImageSelection(state: EditorState): void {\n\t\tif (!this.context) return;\n\t\tconst sel = state.selection;\n\t\tif (!isNodeSelection(sel)) return;\n\n\t\tconst block: BlockNode | undefined = state.getBlock(sel.nodeId);\n\t\tif (!block || block.type !== 'image') return;\n\n\t\tconst alt: string = (block.attrs?.alt as string | undefined) ?? '';\n\t\tconst width: number | undefined = block.attrs?.width as number | undefined;\n\t\tconst height: number | undefined = block.attrs?.height as number | undefined;\n\n\t\tconst parts: string[] = [this.locale.imageSelected];\n\t\tif (alt) parts.push(`${this.locale.altTextPrefix}${alt}.`);\n\t\tif (width !== undefined && height !== undefined) {\n\t\t\tparts.push(this.locale.imageSizeAnnounce(width, height));\n\t\t}\n\n\t\tconst shrinkKey: string | null = this.resolvedKeymap.shrinkWidth ?? null;\n\t\tconst growKey: string | null = this.resolvedKeymap.growWidth ?? null;\n\t\tif (shrinkKey && growKey) {\n\t\t\tparts.push(this.locale.resizeHint(formatShortcut(shrinkKey), formatShortcut(growKey)));\n\t\t}\n\n\t\tthis.context.announce(parts.join(' '));\n\t}\n\n\tprivate announceCurrentSize(context: PluginContext): void {\n\t\tconst state = context.getState();\n\t\tconst sel = state.selection;\n\t\tif (!isNodeSelection(sel)) return;\n\n\t\tconst block: BlockNode | undefined = state.getBlock(sel.nodeId);\n\t\tif (!block || block.type !== 'image') return;\n\n\t\tconst width: number | undefined = block.attrs?.width as number | undefined;\n\t\tconst height: number | undefined = block.attrs?.height as number | undefined;\n\t\tif (width !== undefined && height !== undefined) {\n\t\t\tcontext.announce(this.locale.imageResized(width, height));\n\t\t}\n\t}\n}\n"],"mappings":"kjBCoBA,SAAgB,EACf,EACA,GAEA,MAAM,EAAQ,EAAQ,WAChB,EAAM,EAAM,UAEZ,EAAyB,CAC9B,IAAK,EAAM,IACX,IAAK,EAAM,KAAO,GAClB,MAAO,EAAM,OAAS,iBACF,IAAhB,EAAM,MAAsB,CAAE,MAAO,EAAM,OAAU,CAAA,UACpC,IAAjB,EAAM,OAAuB,CAAE,OAAQ,EAAM,QAAW,CAAA,GAG7D,GAAI,EAAY,GAAM,OAAO,EAE7B,MAAM,EAAyB,EAAgB,GAAO,EAAI,OAAS,EAAI,OAAO,QAGxE,EASP,SAA+B,EAAoB,GAElD,GAAoB,eADiB,EAAM,SAAS,IACzC,KAAuB,OAAO,EAEzC,MAAM,EAA8B,EAAM,YAAY,GACtD,GAAK,EAEL,IAAK,MAAM,KAAM,EAEhB,GAAmB,eADiB,EAAM,SAAS,IACzC,KAAuB,OAAO,EAlBL,CAAsB,EAAO,GACjE,OAAI,EA+CL,SACC,EACA,EACA,EACA,GAEA,MAAM,EAAkC,EAAM,YAAY,GAC1D,IAAK,EAAU,OAAO,EAEtB,MAAM,EAAwB,EAAgB,EAAS,SAAU,QAAI,EAAW,GAG1E,EAA8B,EAAM,SAAS,GACnD,IAAK,EAAM,OAAO,EAElB,MAAM,EAAU,EAAM,YAAY,WAC5B,EAAsC,EAAiB,GAC7D,IAAK,IAAI,EAAI,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,EAAO"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function r(r,t){for(let n=0;n<r.length;n++){const e=r[n];e&&e.setAttribute("tabindex",n===t?"0":"-1")}}function t(r,t,n){const e=r.length;return 0===e?-1:(t+n+e)%e}function n(r,t,n,e,o,c=!1){switch(c?function(r){return"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r}(o):o){case"ArrowUp":return[r>1?r-1:n,t];case"ArrowDown":return[r<n?r+1:1,t];case"ArrowLeft":return[r,t>1?t-1:e];case"ArrowRight":return[r,t<e?t+1:1]}}export{t as n,n as r,r as t};
|
|
2
|
-
//# sourceMappingURL=KeyboardNav-IMWHB6wc.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardNav-IMWHB6wc.mjs","names":[],"sources":["../../src/plugins/shared/KeyboardNav.ts"],"sourcesContent":["/**\n * Generic keyboard navigation helpers reused by toolbar and popup UIs.\n */\n\n/**\n * Applies roving tabindex: sets tabindex=\"0\" on the focused item,\n * tabindex=\"-1\" on all others.\n */\nexport function applyRovingTabindex(items: readonly HTMLElement[], focusedIndex: number): void {\n\tfor (let i = 0; i < items.length; i++) {\n\t\tconst item: HTMLElement | undefined = items[i];\n\t\tif (item) {\n\t\t\titem.setAttribute('tabindex', i === focusedIndex ? '0' : '-1');\n\t\t}\n\t}\n}\n\n/** Navigates dropdown items with arrow keys (wraps around). */\nexport function findNextDropdownItem(\n\titems: readonly HTMLElement[],\n\tcurrent: number,\n\tdirection: 1 | -1,\n): number {\n\tconst len = items.length;\n\tif (len === 0) return -1;\n\treturn (current + direction + len) % len;\n}\n\n/** Flips horizontal arrow keys for RTL contexts. */\nfunction flipHorizontalKey(\n\tkey: 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight',\n): 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' {\n\tif (key === 'ArrowLeft') return 'ArrowRight';\n\tif (key === 'ArrowRight') return 'ArrowLeft';\n\treturn key;\n}\n\n/**\n * Navigates a grid of cells with arrow keys.\n * Returns the new [row, col] position.\n * When `isRtl` is true, horizontal arrows are flipped to match visual direction.\n */\nexport function navigateGrid(\n\trow: number,\n\tcol: number,\n\tmaxRows: number,\n\tmaxCols: number,\n\tkey: 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight',\n\tisRtl = false,\n): [number, number] {\n\tconst resolved: 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' = isRtl\n\t\t? flipHorizontalKey(key)\n\t\t: key;\n\n\tswitch (resolved) {\n\t\tcase 'ArrowUp':\n\t\t\treturn [row > 1 ? row - 1 : maxRows, col];\n\t\tcase 'ArrowDown':\n\t\t\treturn [row < maxRows ? row + 1 : 1, col];\n\t\tcase 'ArrowLeft':\n\t\t\treturn [row, col > 1 ? col - 1 : maxCols];\n\t\tcase 'ArrowRight':\n\t\t\treturn [row, col < maxCols ? col + 1 : 1];\n\t}\n}\n"],"mappings":"AAQA,SAAgB,EAAoB,EAA+B,GAClE,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAQ,IAAK,CACtC,MAAM,EAAgC,EAAM,GACxC,GACH,EAAK,aAAa,WAAY,IAAM,EAAe,IAAM,OAM5D,SAAgB,EACf,EACA,EACA,GAEA,MAAM,EAAM,EAAM,OAClB,OAAY,IAAR,GAAkB,GACd,EAAU,EAAY,GAAO,EAiBtC,SAAgB,EACf,EACA,EACA,EACA,EACA,EACA,GAAQ,GAMR,OAJuE,EArBxE,SACC,GAEA,MAAY,cAAR,EAA4B,aACpB,eAAR,EAA6B,YAC1B,EAiBJ,CAAkB,GAClB,GAGF,IAAK,UACJ,MAAO,CAAC,EAAM,EAAI,EAAM,EAAI,EAAS,GACtC,IAAK,YACJ,MAAO,CAAC,EAAM,EAAU,EAAM,EAAI,EAAG,GACtC,IAAK,YACJ,MAAO,CAAC,EAAK,EAAM,EAAI,EAAM,EAAI,GAClC,IAAK,aACJ,MAAO,CAAC,EAAK,EAAM,EAAU,EAAM,EAAI"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{v as t}from"./Document-DnPKbcPE.mjs";import{o as e,u as r}from"./Selection-B14e7gd0.mjs";import{i as n}from"./TypeBrands-BQR8dEYU.mjs";import{r as o}from"./HTMLUtils-BLwp5G4f.mjs";import{i,r as s,t as a}from"./AttributedMarkCommands-BiJtiHpx.mjs";import{i as l}from"./PluginHelpers-BZU5rE44.mjs";import{t as c}from"./ShortcutFormatting-c0IajwWG.mjs";var p={label:"Link",tooltip:t=>`Insert Link (${t})`,removeLink:"Remove Link",removeLinkAria:"Remove link",urlPlaceholder:"https://...",urlAria:"Link URL",apply:"Apply",applyAria:"Apply link"},m=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-DsmIDxDt.mjs"),"./locales/de.ts":()=>import("./de-BWk2-9In.mjs"),"./locales/es.ts":()=>import("./es-DHMIpSfB.mjs"),"./locales/fr.ts":()=>import("./fr-Bz2JMdw5.mjs"),"./locales/hi.ts":()=>import("./hi-BUveHWCk.mjs"),"./locales/pt.ts":()=>import("./pt-DpLB51hL.mjs"),"./locales/ru.ts":()=>import("./ru-Cv9Zbbn2.mjs"),"./locales/zh.ts":()=>import("./zh-Pd1HqYSs.mjs")});async function u(t){if("en"===t)return p;const e=m[`./locales/${t}.ts`];if(!e)return p;try{return(await e()).default}catch{return p}}var h={openInNewTab:!0},d=class{id="link";name="Link";priority=25;config;locale;constructor(t){this.config={...h,...t}}async init(t){this.locale=await l(t,this.config.locale,p,u),this.registerMarkSpec(t),this.registerCommands(t),this.registerKeymap(t),this.registerToolbarItem(t)}registerMarkSpec(t){const e=this.config.openInNewTab;t.registerMarkSpec({type:"link",rank:10,attrs:{href:{default:""}},toDOM(t){const r=document.createElement("a"),n=t.attrs?.href??"";return r.setAttribute("href",n),e&&(r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer")),r},toHTMLString:(t,r)=>{const n=o(String(t.attrs?.href??""));return e?`<a href="${n}" target="_blank" rel="noopener noreferrer">${r}</a>`:`<a href="${n}">${r}</a>`},parseHTML:[{tag:"a",getAttrs:t=>({href:t.getAttribute("href")??""})}],sanitize:{tags:["a"],attrs:["href","target","rel"]}})}registerCommands(t){t.registerCommand("toggleLink",()=>{const e=t.getState();return this.toggleLink(t,e)}),t.registerCommand("setLink",()=>!1),t.registerCommand("removeLink",()=>{const e=t.getState();return this.removeLink(t,e)})}registerKeymap(t){t.registerKeymap({"Mod-K":()=>t.executeCommand("toggleLink")})}registerToolbarItem(t){t.registerToolbarItem({id:"link",group:"insert",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>',label:this.locale.label,tooltip:this.locale.tooltip(c("Mod-K")),command:"toggleLink",popupType:"custom",renderPopup:(t,e,r)=>{this.renderLinkPopup(t,e,r)},isActive:t=>this.isLinkActive(t),isEnabled:t=>!e(t.selection)})}isLinkActive(t){return s(t,"link")}toggleLink(t,e){return!!this.isLinkActive(e)&&this.removeLink(t,e)}addLink(t,o,i){const s=o.selection;if(!r(s))return!1;if(e(s))return!1;const l=a(o,{type:n("link"),attrs:{href:i}});return!!l&&(t.dispatch(l),!0)}removeLink(o,s){const a=s.selection;if(!r(a))return!1;if(e(a)){const e=s.getBlock(a.anchor.blockId);if(!e)return!1;const r=[];let i=0;for(const o of e.children){if(!("text"in o))continue;const e=i+o.text.length;r.push({pos:i,end:e,hasLink:t(o.marks,n("link"))}),i=e}const l=r.findIndex(t=>a.anchor.offset>=t.pos&&a.anchor.offset<=t.end),c=l>=0?r[l]:void 0;if(-1===l||!c?.hasLink)return!1;let p=l;for(;p>0&&r[p-1]?.hasLink;)p--;let m=l;for(;m<r.length-1&&r[m+1]?.hasLink;)m++;const u=r[p],h=r[m];if(!u||!h)return!1;const d=u.pos,k=h.end,g=s.transaction("command");return g.removeMark(a.anchor.blockId,d,k,{type:n("link")}),g.setSelection(a),o.dispatch(g.build()),!0}const l=i(s,n("link"));return!!l&&(o.dispatch(l),!0)}renderLinkPopup(t,e,r){t.classList.add("notectl-link-popup");const n=e.getState();if(this.isLinkActive(n)){const n=document.createElement("button");n.type="button",n.className="notectl-link-popup__button",n.textContent=this.locale.removeLink,n.setAttribute("aria-label",this.locale.removeLinkAria),n.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),e.executeCommand("removeLink"),r(),e.getContainer().focus()}),t.appendChild(n)}else{const n=document.createElement("input");n.type="url",n.className="notectl-link-popup__input",n.placeholder=this.locale.urlPlaceholder,n.setAttribute("aria-label",this.locale.urlAria);const o=document.createElement("button");o.type="button",o.className="notectl-link-popup__button notectl-link-popup__button--apply",o.textContent=this.locale.apply,o.setAttribute("aria-label",this.locale.applyAria);const i=()=>{const t=n.value.trim();t&&(this.addLink(e,e.getState(),t),r(),e.getContainer().focus())};o.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),i()}),n.addEventListener("keydown",t=>{"Enter"===t.key&&(t.preventDefault(),i())}),t.appendChild(n),t.appendChild(o),requestAnimationFrame(()=>n.focus())}}};export{p as n,u as r,d as t};
|
|
2
|
-
//# sourceMappingURL=LinkPlugin-Cb2cpFe8.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LinkPlugin-Cb2cpFe8.mjs","names":[],"sources":["../../src/plugins/link/LinkLocale.ts","../../src/plugins/link/LinkPlugin.ts"],"sourcesContent":["/**\n * Locale interface and default English locale for the LinkPlugin.\n */\n\n// --- Locale Interface ---\n\nexport interface LinkLocale {\n\treadonly label: string;\n\treadonly tooltip: (shortcut: string) => string;\n\treadonly removeLink: string;\n\treadonly removeLinkAria: string;\n\treadonly urlPlaceholder: string;\n\treadonly urlAria: string;\n\treadonly apply: string;\n\treadonly applyAria: string;\n}\n\n// --- Default English Locale ---\n\nexport const LINK_LOCALE_EN: LinkLocale = {\n\tlabel: 'Link',\n\ttooltip: (shortcut: string) => `Insert Link (${shortcut})`,\n\tremoveLink: 'Remove Link',\n\tremoveLinkAria: 'Remove link',\n\turlPlaceholder: 'https://...',\n\turlAria: 'Link URL',\n\tapply: 'Apply',\n\tapplyAria: 'Apply link',\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: Record<string, () => Promise<{ default: LinkLocale }>> = import.meta.glob<{\n\tdefault: LinkLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadLinkLocale(lang: string): Promise<LinkLocale> {\n\tif (lang === 'en') return LINK_LOCALE_EN;\n\tconst loader = localeModules[`./locales/${lang}.ts`];\n\tif (!loader) return LINK_LOCALE_EN;\n\ttry {\n\t\tconst mod = await loader();\n\t\treturn mod.default;\n\t} catch {\n\t\treturn LINK_LOCALE_EN;\n\t}\n}\n","/**\n * LinkPlugin: registers a link mark type with href attribute,\n * toggle command, keyboard shortcut (Mod-K), and toolbar button\n * with a URL input popup.\n */\n\nimport {\n\tapplyAttributedMark,\n\tisAttributedMarkActive,\n\tremoveAttributedMark,\n} from '../../commands/AttributedMarkCommands.js';\nimport { hasMark } from '../../model/Document.js';\nimport { escapeHTML } from '../../model/HTMLUtils.js';\nimport { isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport { markType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { LINK_LOCALE_EN, type LinkLocale, loadLinkLocale } from './LinkLocale.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tlink: { href: string };\n\t}\n}\n\n// --- Configuration ---\n\nexport interface LinkConfig {\n\t/** Whether to add rel=\"noopener noreferrer\" and target=\"_blank\" by default. */\n\treadonly openInNewTab: boolean;\n\treadonly locale?: LinkLocale;\n}\n\nconst DEFAULT_CONFIG: LinkConfig = {\n\topenInNewTab: true,\n};\n\n// --- Plugin ---\n\nexport class LinkPlugin implements Plugin {\n\treadonly id = 'link';\n\treadonly name = 'Link';\n\treadonly priority = 25;\n\n\tprivate readonly config: LinkConfig;\n\tprivate locale!: LinkLocale;\n\n\tconstructor(config?: Partial<LinkConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(context, this.config.locale, LINK_LOCALE_EN, loadLinkLocale);\n\t\tthis.registerMarkSpec(context);\n\t\tthis.registerCommands(context);\n\t\tthis.registerKeymap(context);\n\t\tthis.registerToolbarItem(context);\n\t}\n\n\tprivate registerMarkSpec(context: PluginContext): void {\n\t\tconst openInNewTab = this.config.openInNewTab;\n\n\t\tcontext.registerMarkSpec({\n\t\t\ttype: 'link',\n\t\t\trank: 10,\n\t\t\tattrs: {\n\t\t\t\thref: { default: '' },\n\t\t\t},\n\t\t\ttoDOM(mark) {\n\t\t\t\tconst a = document.createElement('a');\n\t\t\t\tconst href = mark.attrs?.href ?? '';\n\t\t\t\ta.setAttribute('href', href);\n\t\t\t\tif (openInNewTab) {\n\t\t\t\t\ta.setAttribute('target', '_blank');\n\t\t\t\t\ta.setAttribute('rel', 'noopener noreferrer');\n\t\t\t\t}\n\t\t\t\treturn a;\n\t\t\t},\n\t\t\ttoHTMLString: (mark, content) => {\n\t\t\t\tconst href: string = escapeHTML(String(mark.attrs?.href ?? ''));\n\t\t\t\tif (openInNewTab) {\n\t\t\t\t\treturn `<a href=\"${href}\" target=\"_blank\" rel=\"noopener noreferrer\">${content}</a>`;\n\t\t\t\t}\n\t\t\t\treturn `<a href=\"${href}\">${content}</a>`;\n\t\t\t},\n\t\t\tparseHTML: [\n\t\t\t\t{\n\t\t\t\t\ttag: 'a',\n\t\t\t\t\tgetAttrs: (el) => {\n\t\t\t\t\t\tconst href: string = el.getAttribute('href') ?? '';\n\t\t\t\t\t\treturn { href };\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tsanitize: { tags: ['a'], attrs: ['href', 'target', 'rel'] },\n\t\t});\n\t}\n\n\tprivate registerCommands(context: PluginContext): void {\n\t\tcontext.registerCommand('toggleLink', () => {\n\t\t\tconst state = context.getState();\n\t\t\treturn this.toggleLink(context, state);\n\t\t});\n\n\t\tcontext.registerCommand('setLink', () => {\n\t\t\t// setLink is called by the popup after URL input\n\t\t\t// The actual URL is set via the popup's custom render\n\t\t\treturn false;\n\t\t});\n\n\t\tcontext.registerCommand('removeLink', () => {\n\t\t\tconst state = context.getState();\n\t\t\treturn this.removeLink(context, state);\n\t\t});\n\t}\n\n\tprivate registerKeymap(context: PluginContext): void {\n\t\tcontext.registerKeymap({\n\t\t\t'Mod-K': () => context.executeCommand('toggleLink'),\n\t\t});\n\t}\n\n\tprivate registerToolbarItem(context: PluginContext): void {\n\t\tconst icon =\n\t\t\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z\"/></svg>';\n\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'link',\n\t\t\tgroup: 'insert',\n\t\t\ticon,\n\t\t\tlabel: this.locale.label,\n\t\t\ttooltip: this.locale.tooltip(formatShortcut('Mod-K')),\n\t\t\tcommand: 'toggleLink',\n\t\t\tpopupType: 'custom',\n\t\t\trenderPopup: (container, ctx, onClose) => {\n\t\t\t\tthis.renderLinkPopup(container, ctx, onClose);\n\t\t\t},\n\t\t\tisActive: (state) => this.isLinkActive(state),\n\t\t\tisEnabled: (state) => !isCollapsed(state.selection),\n\t\t});\n\t}\n\n\tprivate isLinkActive(state: EditorState): boolean {\n\t\treturn isAttributedMarkActive(state, 'link');\n\t}\n\n\tprivate toggleLink(context: PluginContext, state: EditorState): boolean {\n\t\tif (this.isLinkActive(state)) {\n\t\t\treturn this.removeLink(context, state);\n\t\t}\n\t\t// Adding links requires the toolbar popup for URL input\n\t\treturn false;\n\t}\n\n\tprivate addLink(context: PluginContext, state: EditorState, href: string): boolean {\n\t\tconst sel = state.selection;\n\t\tif (!isTextSelection(sel)) return false;\n\t\tif (isCollapsed(sel)) return false;\n\n\t\tconst mark = { type: markType('link'), attrs: { href } };\n\t\tconst tr = applyAttributedMark(state, mark);\n\t\tif (!tr) return false;\n\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\tprivate removeLink(context: PluginContext, state: EditorState): boolean {\n\t\tconst sel = state.selection;\n\t\tif (!isTextSelection(sel)) return false;\n\n\t\tif (isCollapsed(sel)) {\n\t\t\t// Remove link from entire link span around cursor (plugin-specific extent scan)\n\t\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\t\tif (!block) return false;\n\n\t\t\tconst textChildren: { pos: number; end: number; hasLink: boolean }[] = [];\n\t\t\tlet pos = 0;\n\t\t\tfor (const child of block.children) {\n\t\t\t\tif (!('text' in child)) continue;\n\t\t\t\tconst end = pos + child.text.length;\n\t\t\t\ttextChildren.push({ pos, end, hasLink: hasMark(child.marks, markType('link')) });\n\t\t\t\tpos = end;\n\t\t\t}\n\n\t\t\tconst cursorIdx = textChildren.findIndex(\n\t\t\t\t(c) => sel.anchor.offset >= c.pos && sel.anchor.offset <= c.end,\n\t\t\t);\n\t\t\tconst cursorEntry = cursorIdx >= 0 ? textChildren[cursorIdx] : undefined;\n\t\t\tif (cursorIdx === -1 || !cursorEntry?.hasLink) return false;\n\n\t\t\tlet startIdx = cursorIdx;\n\t\t\twhile (startIdx > 0 && textChildren[startIdx - 1]?.hasLink) {\n\t\t\t\tstartIdx--;\n\t\t\t}\n\n\t\t\tlet endIdx = cursorIdx;\n\t\t\twhile (endIdx < textChildren.length - 1 && textChildren[endIdx + 1]?.hasLink) {\n\t\t\t\tendIdx++;\n\t\t\t}\n\n\t\t\tconst startEntry = textChildren[startIdx];\n\t\t\tconst endEntry = textChildren[endIdx];\n\t\t\tif (!startEntry || !endEntry) return false;\n\n\t\t\tconst linkStart = startEntry.pos;\n\t\t\tconst linkEnd = endEntry.end;\n\n\t\t\tconst builder = state.transaction('command');\n\t\t\tbuilder.removeMark(sel.anchor.blockId, linkStart, linkEnd, { type: markType('link') });\n\t\t\tbuilder.setSelection(sel);\n\t\t\tcontext.dispatch(builder.build());\n\t\t\treturn true;\n\t\t}\n\n\t\t// Range selection: delegate to shared helper\n\t\tconst tr = removeAttributedMark(state, markType('link'));\n\t\tif (!tr) return false;\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\tprivate renderLinkPopup(\n\t\tcontainer: HTMLElement,\n\t\tcontext: PluginContext,\n\t\tonClose: () => void,\n\t): void {\n\t\tcontainer.classList.add('notectl-link-popup');\n\n\t\tconst state = context.getState();\n\t\tconst isActive = this.isLinkActive(state);\n\n\t\tif (isActive) {\n\t\t\t// Show remove link button\n\t\t\tconst removeBtn = document.createElement('button');\n\t\t\tremoveBtn.type = 'button';\n\t\t\tremoveBtn.className = 'notectl-link-popup__button';\n\t\t\tremoveBtn.textContent = this.locale.removeLink;\n\t\t\tremoveBtn.setAttribute('aria-label', this.locale.removeLinkAria);\n\t\t\tremoveBtn.addEventListener('mousedown', (e) => {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t\tcontext.executeCommand('removeLink');\n\t\t\t\tonClose();\n\t\t\t\tcontext.getContainer().focus();\n\t\t\t});\n\t\t\tcontainer.appendChild(removeBtn);\n\t\t} else {\n\t\t\t// Show URL input\n\t\t\tconst input = document.createElement('input');\n\t\t\tinput.type = 'url';\n\t\t\tinput.className = 'notectl-link-popup__input';\n\t\t\tinput.placeholder = this.locale.urlPlaceholder;\n\t\t\tinput.setAttribute('aria-label', this.locale.urlAria);\n\n\t\t\tconst applyBtn = document.createElement('button');\n\t\t\tapplyBtn.type = 'button';\n\t\t\tapplyBtn.className = 'notectl-link-popup__button notectl-link-popup__button--apply';\n\t\t\tapplyBtn.textContent = this.locale.apply;\n\t\t\tapplyBtn.setAttribute('aria-label', this.locale.applyAria);\n\n\t\t\tconst applyLink = (): void => {\n\t\t\t\tconst href = input.value.trim();\n\t\t\t\tif (href) {\n\t\t\t\t\tthis.addLink(context, context.getState(), href);\n\t\t\t\t\tonClose();\n\t\t\t\t\tcontext.getContainer().focus();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tapplyBtn.addEventListener('mousedown', (e) => {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t\tapplyLink();\n\t\t\t});\n\n\t\t\tinput.addEventListener('keydown', (e) => {\n\t\t\t\tif (e.key === 'Enter') {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tapplyLink();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tcontainer.appendChild(input);\n\t\t\tcontainer.appendChild(applyBtn);\n\n\t\t\t// Auto-focus input\n\t\t\trequestAnimationFrame(() => input.focus());\n\t\t}\n\t}\n}\n"],"mappings":"qWAmBA,IAAa,EAA6B,CACzC,MAAO,OACP,QAAU,GAAqB,gBAAgB,KAC/C,WAAY,cACZ,eAAgB,cAChB,eAAgB,cAChB,QAAS,WACT,MAAO,QACP,UAAW,cAKN,iBAAwE,OAAA,OAAA,CAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBA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AAK,OAAO,MACnC,EAAS,aAAa,aAAc,KAAK,OAAO,WAEhD,MAAM,EAAA,KACL,MAAM,EAAO,EAAM,MAAM,OACrB,IACH,KAAK,QAAQ,EAAS,EAAQ,WAAY,GAC1C,IACA,EAAQ,eAAe,UAIzB,EAAS,iBAAiB,YAAc,IACvC,EAAE,iBACF,EAAE,kBACF,MAGD,EAAM,iBAAiB,UAAY,IACpB,UAAV,EAAE,MACL,EAAE,iBACF,OAIF,EAAU,YAAY,GACtB,EAAU,YAAY,GAGtB,sBAAA,IAA4B,EAAM"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as t,m as e}from"./Document-DnPKbcPE.mjs";import{d as n,o as i,t as s,u as c}from"./Selection-B14e7gd0.mjs";import{a as o,t as r}from"./TypeBrands-BQR8dEYU.mjs";import{r as l}from"./AttrRegistry-DvqbnJ6T.mjs";import{n as a}from"./DomUtils-BkyCg-OO.mjs";import{t as d}from"./RangeIterator-DEuX1xKV.mjs";import{s as u}from"./StyleRuntime-Bwde5icB.mjs";import{i as p}from"./PluginHelpers-BZU5rE44.mjs";function m(t,e,n){return"checklist"===t?{listType:t,indent:e,checked:n??!1}:{listType:t,indent:e}}function h(t,e){const i=t.getState(),s=i.selection;return!!c(s)&&(s.anchor.blockId!==s.head.blockId?function(t,e,i){const s=e.selection;if(!c(s))return!1;const r=n(s,e.getBlockOrder()),a=g(e,r,i),u=e.transaction("command");return d(e,r,t=>{const n=e.getBlock(t);if(n)if(a)u.setBlockType(t,o("paragraph"));else{const e=l(n,"list_item")?n.attrs.indent:0,s=l(n,"list_item")&&"checklist"===n.attrs.listType&&n.attrs.checked;u.setBlockType(t,o("list_item"),m(i,e,s))}}),u.setSelection(s),t.dispatch(u.build()),!0}(t,i,e):function(t,e,n){const i=e.selection;if(!c(i))return!1;const s=e.getBlock(i.anchor.blockId);if(!s)return!1;if("list_item"===s.type&&s.attrs?.listType===n){const n=e.transaction("command").setBlockType(i.anchor.blockId,o("paragraph")).setSelection(i).build();return t.dispatch(n),!0}const r=m(n,l(s,"list_item")?s.attrs.indent:0),a=e.transaction("command").setBlockType(i.anchor.blockId,o("list_item"),r).setSelection(i).build();return t.dispatch(a),!0}(t,i,e))}function k(t,e,i){const s=t.getState();if(!c(s.selection))return!1;if(s.selection.anchor.blockId!==s.selection.head.blockId)return function(t,e,i,s){const r=e.selection;if(!c(r))return!1;const a=n(r,e.getBlockOrder()),u=e.transaction("command");let p=!1;return d(e,a,t=>{const n=e.getBlock(t);if(!n||!l(n,"list_item"))return;const c=n.attrs.indent+i;c<0||c>s||(u.setBlockType(t,o("list_item"),m(n.attrs.listType,c,n.attrs.checked)),p=!0)}),!!p&&(u.setSelection(r),t.dispatch(u.build()),!0)}(t,s,e,i);const r=s.selection,a=s.getBlock(r.anchor.blockId);if(!a||!l(a,"list_item"))return!1;const u=a.attrs.indent+e;if(u<0||u>i)return!1;const p=m(a.attrs.listType,u,a.attrs.checked),h=s.transaction("command").setBlockType(r.anchor.blockId,o("list_item"),p).setSelection(r).build();return t.dispatch(h),!0}function f(t,e,n){if(t.isReadOnly()&&!e)return!1;const i=t.getState(),s=n??(c(i.selection)?i.selection.anchor.blockId:null);if(!s)return!1;const r=i.getBlock(s);if(!r||!l(r,"list_item")||"checklist"!==r.attrs.listType)return!1;const a=m(r.attrs.listType,r.attrs.indent,!r.attrs.checked),d=i.transaction("command").setBlockType(s,o("list_item"),a).setSelection(i.selection).build();return t.dispatch(d),!0}function g(t,e,n){let i=!0;return d(t,e,e=>{const s=t.getBlock(e);s&&"list_item"===s.type&&s.attrs?.listType===n||(i=!1)}),i}var b=[{type:"bullet",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z"/></svg>',inputPattern:/^[-*] $/,inputPrefix:"- "},{type:"ordered",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z"/></svg>',inputPattern:/^\d+\. $/,inputPrefix:"1. "},{type:"checklist",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 7h-9v2h9V7zm0 8h-9v2h9v-2zM5.54 11L2 7.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41L5.54 11zm0 8L2 15.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41L5.54 19z"/></svg>',inputPattern:/^\[[ x]] $/,inputPrefix:"[ ] "}];function y(t,e){const n=t.getState();if(!c(n.selection))return!1;const s=n.selection;if(!i(s))return!1;const o=n.getBlock(s.anchor.blockId);return!(!o||"list_item"!==o.type)&&e({state:n,block:o,blockId:s.anchor.blockId,offset:s.anchor.offset})}var v={bulletList:"Bullet List",numberedList:"Numbered List",checklist:"Checklist"},x=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-Cp9qv7la.mjs"),"./locales/de.ts":()=>import("./de-CF7zshOE.mjs"),"./locales/es.ts":()=>import("./es-5c_5O95N.mjs"),"./locales/fr.ts":()=>import("./fr-BushvDBo.mjs"),"./locales/hi.ts":()=>import("./hi-Btg6DNgW.mjs"),"./locales/pt.ts":()=>import("./pt-BM8sUzpI.mjs"),"./locales/ru.ts":()=>import("./ru-DkP8YLYT.mjs"),"./locales/zh.ts":()=>import("./zh-BBOheLpv.mjs")});async function I(t){if("en"===t)return v;const e=x[`./locales/${t}.ts`];if(!e)return v;try{return(await e()).default}catch{return v}}function T(t,e){return{bullet:e.bulletList,ordered:e.numberedList,checklist:e.checklist}[t]}function B(t,e){if(!c(t.selection))return!1;if(t.selection.anchor.blockId!==t.selection.head.blockId)return g(t,n(t.selection,t.getBlockOrder()),e);const i=t.getBlock(t.selection.anchor.blockId);return"list_item"===i?.type&&i.attrs?.listType===e}var L={types:["bullet","ordered","checklist"],maxIndent:4},S=class{id="list";name="List";priority=35;config;locale;context=null;checkboxClickHandler=null;constructor(t){this.config={...L,...t}}async init(n){this.context=n,this.locale=await p(n,this.config.locale,v,I);const r=this.getEnabledTypes();n.registerStyleSheet("\n/* List Wrappers — suppress native markers, we use ::before pseudo-elements */\n.notectl-list {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n/* Ordered List — each <ol> wrapper resets the counter */\n.notectl-list--ordered {\n\tcounter-reset: notectl-ordered;\n}\n\n/* List Items */\n.notectl-list-item {\n\tmargin: 0;\n\tpadding: 2px 0;\n\tpadding-inline-start: 24px;\n\tmin-height: 1.6em;\n\tposition: relative;\n}\n\n.notectl-list-item::before {\n\tposition: absolute;\n\tinset-inline-start: 0;\n\tdisplay: inline-block;\n\twidth: 24px;\n\ttext-align: center;\n}\n\n/* Bullet List */\n.notectl-list-item--bullet::before {\n\tcontent: '\\2022';\n\tcolor: var(--notectl-fg);\n}\n\n/* Ordered List — counter increment per item */\n.notectl-list-item--ordered {\n\tcounter-increment: notectl-ordered;\n}\n\n.notectl-list-item--ordered::before {\n\tcontent: counter(notectl-ordered) '.';\n\tcolor: var(--notectl-fg);\n\tfont-size: 14px;\n}\n\n/* Checklist */\n.notectl-list-item--checklist::before {\n\tcontent: '\\2610';\n\tfont-size: 16px;\n\tcolor: var(--notectl-fg-muted);\n\tcursor: pointer;\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"]::before {\n\tcontent: '\\2611';\n\tcolor: var(--notectl-success);\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"] {\n\tcolor: var(--notectl-fg-muted);\n\ttext-decoration: line-through;\n}\n"),this.registerNodeSpec(n),function(t,e,n){for(const i of n)t.registerCommand(`toggleList:${i.type}`,()=>h(t,i.type));t.registerCommand("indentListItem",()=>k(t,1,e.maxIndent)),t.registerCommand("outdentListItem",()=>k(t,-1,e.maxIndent)),e.types.includes("checklist")&&t.registerCommand("toggleChecklistItem",()=>f(t,e.interactiveCheckboxes),{readonlyAllowed:!0}),t.registerKeymap({Tab:()=>k(t,1,e.maxIndent),"Shift-Tab":()=>k(t,-1,e.maxIndent)})}(n,this.config,r),function(n){n.registerKeymap({Enter:()=>function(n){return y(n,i=>{if(""===e(i.block)){const t=i.state.transaction("input").setBlockType(i.blockId,o("paragraph")).setSelection(i.state.selection).build();return n.dispatch(t),!0}const c=t(),r=m(l(i.block,"list_item")?i.block.attrs.listType:"bullet",l(i.block,"list_item")?i.block.attrs.indent:0),a=i.state.transaction("input").splitBlock(i.blockId,i.offset,c).setBlockType(c,o("list_item"),r).setSelection(s(c,0)).build();return n.dispatch(a),!0})}(n),Backspace:()=>function(t){return y(t,e=>{if(0!==e.offset)return!1;const n=e.state.transaction("input").setBlockType(e.blockId,o("paragraph")).setSelection(e.state.selection).build();return t.dispatch(n),!0})}(n)})}(n),function(t,e){for(const n of e)t.registerInputRule({pattern:n.inputPattern,handler:(t,e,r,l)=>{const a=t.selection;if(!c(a))return null;if(!i(a))return null;const d=t.getBlock(a.anchor.blockId);if(!d||"paragraph"!==d.type)return null;const u=e[0]??"",p=u.length,h=m(n.type,0,u.includes("[x]"));return t.transaction("input").deleteTextAt(a.anchor.blockId,r,r+p).setBlockType(a.anchor.blockId,o("list_item"),h).setSelection(s(a.anchor.blockId,0)).build()}})}(n,r),function(t,e,n){for(const i of e)t.registerToolbarItem({id:`list-${i.type}`,group:"block",icon:i.icon,label:T(i.type,n),command:`toggleList:${i.type}`,isActive:t=>B(t,i.type)})}(n,r,this.locale),this.registerCheckboxClickHandler(n)}destroy(){this.checkboxClickHandler&&this.context&&this.context.getContainer().removeEventListener("mousedown",this.checkboxClickHandler),this.checkboxClickHandler=null,this.context=null}registerNodeSpec(t){t.registerNodeSpec({type:"list_item",group:"block",content:{allow:["text"]},attrs:{listType:{default:"bullet"},indent:{default:0},checked:{default:!1}},toDOM(t){const e=t.attrs?.listType??"bullet",n=t.attrs?.indent??0,i=t.attrs?.checked??!1,s=a("li",t.id);return s.setAttribute("role","listitem"),s.setAttribute("data-list-type",e),s.setAttribute("data-indent",String(n)),s.className=`notectl-list-item notectl-list-item--${e}`,n>0&&u(s,"marginLeft",24*n+"px"),"checklist"===e&&(s.setAttribute("data-checked",String(i)),s.setAttribute("aria-checked",String(i))),s.setAttribute("aria-level",String(n+1)),s},wrapper(t){const e=t.attrs?.listType??"bullet";return{tag:"ordered"===e?"ol":"ul",key:`list-${e}`,className:`notectl-list notectl-list--${e}`,attrs:{role:"list"}}},toHTML(t,e){const n=t.attrs?.listType??"bullet",i=t.attrs?.checked??!1;if("checklist"===n){const t=i?" checked":"";return`<li role="checkbox" aria-checked="${String(i)}"><input type="checkbox" disabled${t}>${e||"<br>"}</li>`}return`<li>${e||"<br>"}</li>`},parseHTML:[{tag:"li"}],sanitize:{tags:["ul","ol","li","input"],attrs:["type","disabled","checked","role","aria-checked"]}})}registerCheckboxClickHandler(t){this.config.types.includes("checklist")&&(this.checkboxClickHandler=e=>{if(t.isReadOnly()&&!this.config.interactiveCheckboxes)return;const n=e.target;if(!(n instanceof HTMLElement))return;const i=n.closest(".notectl-list-item--checklist");if(!i)return;const s=i.getBoundingClientRect();if(("rtl"===getComputedStyle(i).direction?s.right-e.clientX:e.clientX-s.left)>=24)return;e.preventDefault();const c=i.getAttribute("data-block-id");c&&f(t,this.config.interactiveCheckboxes,r(c))},t.getContainer().addEventListener("mousedown",this.checkboxClickHandler))}getEnabledTypes(){return b.filter(t=>this.config.types.includes(t.type))}};export{v as n,I as r,S as t};
|
|
2
|
-
//# sourceMappingURL=ListPlugin-CZgkinoS.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListPlugin-CZgkinoS.mjs","names":[],"sources":["../../src/editor/styles/list.ts","../../src/plugins/list/ListAttrsFactory.ts","../../src/plugins/list/ListCommands.ts","../../src/plugins/list/ListDefinitions.ts","../../src/plugins/list/ListInputRules.ts","../../src/plugins/list/ListKeyboardHandlers.ts","../../src/plugins/list/ListLocale.ts","../../src/plugins/list/ListToolbarItems.ts","../../src/plugins/list/ListPlugin.ts"],"sourcesContent":["/** Width of the list marker / checkbox area in pixels. */\nexport const LIST_MARKER_WIDTH = 24;\n\n/** List styles — bullet, ordered, checklist items. */\nexport const LIST_CSS = `\n/* List Wrappers — suppress native markers, we use ::before pseudo-elements */\n.notectl-list {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n/* Ordered List — each <ol> wrapper resets the counter */\n.notectl-list--ordered {\n\tcounter-reset: notectl-ordered;\n}\n\n/* List Items */\n.notectl-list-item {\n\tmargin: 0;\n\tpadding: 2px 0;\n\tpadding-inline-start: ${LIST_MARKER_WIDTH}px;\n\tmin-height: 1.6em;\n\tposition: relative;\n}\n\n.notectl-list-item::before {\n\tposition: absolute;\n\tinset-inline-start: 0;\n\tdisplay: inline-block;\n\twidth: ${LIST_MARKER_WIDTH}px;\n\ttext-align: center;\n}\n\n/* Bullet List */\n.notectl-list-item--bullet::before {\n\tcontent: '\\\\2022';\n\tcolor: var(--notectl-fg);\n}\n\n/* Ordered List — counter increment per item */\n.notectl-list-item--ordered {\n\tcounter-increment: notectl-ordered;\n}\n\n.notectl-list-item--ordered::before {\n\tcontent: counter(notectl-ordered) '.';\n\tcolor: var(--notectl-fg);\n\tfont-size: 14px;\n}\n\n/* Checklist */\n.notectl-list-item--checklist::before {\n\tcontent: '\\\\2610';\n\tfont-size: 16px;\n\tcolor: var(--notectl-fg-muted);\n\tcursor: pointer;\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"]::before {\n\tcontent: '\\\\2611';\n\tcolor: var(--notectl-success);\n}\n\n.notectl-list-item--checklist[data-checked=\"true\"] {\n\tcolor: var(--notectl-fg-muted);\n\ttext-decoration: line-through;\n}\n`;\n","/**\n * Factory for building list item block attributes.\n * Centralizes attribute construction to avoid repetitive inline object literals.\n */\n\nimport type { BlockAttrs } from '../../model/Document.js';\nimport type { ListType } from './ListPlugin.js';\n\n/** Builds a `BlockAttrs` object for a list_item block. */\nexport function buildListItemAttrs(\n\tlistType: ListType,\n\tindent: number,\n\tchecked?: boolean,\n): BlockAttrs {\n\tif (listType === 'checklist') {\n\t\treturn { listType, indent, checked: checked ?? false };\n\t}\n\treturn { listType, indent };\n}\n","/**\n * Command registration and implementations for list block types.\n * Handles toggle between list types and paragraph, indent/outdent,\n * and checklist toggle.\n */\n\nimport { forEachBlockIdInRange } from '../../commands/RangeIterator.js';\nimport { isNodeOfType } from '../../model/AttrRegistry.js';\nimport { isTextSelection, selectionRange } from '../../model/Selection.js';\nimport { type BlockId, nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { buildListItemAttrs } from './ListAttrsFactory.js';\nimport type { ListTypeDefinition } from './ListDefinitions.js';\nimport type { ListConfig, ListType } from './ListPlugin.js';\n\n/** Registers all list commands (toggleList:*, indent, outdent, toggleChecklistItem). */\nexport function registerListCommands(\n\tcontext: PluginContext,\n\tconfig: ListConfig,\n\tenabledTypes: readonly ListTypeDefinition[],\n): void {\n\tfor (const def of enabledTypes) {\n\t\tcontext.registerCommand(`toggleList:${def.type}`, () => {\n\t\t\treturn toggleList(context, def.type);\n\t\t});\n\t}\n\n\tcontext.registerCommand('indentListItem', () => changeIndent(context, 1, config.maxIndent));\n\n\tcontext.registerCommand('outdentListItem', () => changeIndent(context, -1, config.maxIndent));\n\n\tif (config.types.includes('checklist')) {\n\t\tcontext.registerCommand(\n\t\t\t'toggleChecklistItem',\n\t\t\t() => toggleChecked(context, config.interactiveCheckboxes),\n\t\t\t{ readonlyAllowed: true },\n\t\t);\n\t}\n\n\tcontext.registerKeymap({\n\t\tTab: () => changeIndent(context, 1, config.maxIndent),\n\t\t'Shift-Tab': () => changeIndent(context, -1, config.maxIndent),\n\t});\n}\n\n// --- Command Implementations ---\n\nfunction toggleList(context: PluginContext, listType: ListType): boolean {\n\tconst state: EditorState = context.getState();\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tif (sel.anchor.blockId !== sel.head.blockId) {\n\t\treturn toggleListRange(context, state, listType);\n\t}\n\treturn toggleListSingleBlock(context, state, listType);\n}\n\nfunction toggleListSingleBlock(\n\tcontext: PluginContext,\n\tstate: EditorState,\n\tlistType: ListType,\n): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return false;\n\n\tif (block.type === 'list_item' && block.attrs?.listType === listType) {\n\t\tconst tr = state\n\t\t\t.transaction('command')\n\t\t\t.setBlockType(sel.anchor.blockId, nodeType('paragraph'))\n\t\t\t.setSelection(sel)\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\tconst existingIndent: number = isNodeOfType(block, 'list_item') ? block.attrs.indent : 0;\n\tconst attrs = buildListItemAttrs(listType, existingIndent);\n\n\tconst tr = state\n\t\t.transaction('command')\n\t\t.setBlockType(sel.anchor.blockId, nodeType('list_item'), attrs)\n\t\t.setSelection(sel)\n\t\t.build();\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\nfunction toggleListRange(context: PluginContext, state: EditorState, listType: ListType): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst toggleOff: boolean = allBlocksMatchListType(state, range, listType);\n\tconst builder = state.transaction('command');\n\n\tforEachBlockIdInRange(state, range, (bid: BlockId) => {\n\t\tconst block = state.getBlock(bid);\n\t\tif (!block) return;\n\n\t\tif (toggleOff) {\n\t\t\tbuilder.setBlockType(bid, nodeType('paragraph'));\n\t\t} else {\n\t\t\tconst existingIndent: number = isNodeOfType(block, 'list_item') ? block.attrs.indent : 0;\n\t\t\tconst existingChecked: boolean =\n\t\t\t\tisNodeOfType(block, 'list_item') &&\n\t\t\t\tblock.attrs.listType === 'checklist' &&\n\t\t\t\tblock.attrs.checked;\n\t\t\tbuilder.setBlockType(\n\t\t\t\tbid,\n\t\t\t\tnodeType('list_item'),\n\t\t\t\tbuildListItemAttrs(listType, existingIndent, existingChecked),\n\t\t\t);\n\t\t}\n\t});\n\n\tbuilder.setSelection(sel);\n\tcontext.dispatch(builder.build());\n\treturn true;\n}\n\n// --- Indent / Outdent ---\n\nfunction changeIndent(context: PluginContext, delta: 1 | -1, maxIndent: number): boolean {\n\tconst state: EditorState = context.getState();\n\tif (!isTextSelection(state.selection)) return false;\n\n\tif (state.selection.anchor.blockId !== state.selection.head.blockId) {\n\t\treturn changeIndentRange(context, state, delta, maxIndent);\n\t}\n\n\tconst sel = state.selection;\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block || !isNodeOfType(block, 'list_item')) return false;\n\n\tconst newIndent: number = block.attrs.indent + delta;\n\tif (newIndent < 0 || newIndent > maxIndent) return false;\n\n\tconst attrs = buildListItemAttrs(block.attrs.listType, newIndent, block.attrs.checked);\n\tconst tr = state\n\t\t.transaction('command')\n\t\t.setBlockType(sel.anchor.blockId, nodeType('list_item'), attrs)\n\t\t.setSelection(sel)\n\t\t.build();\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\nfunction changeIndentRange(\n\tcontext: PluginContext,\n\tstate: EditorState,\n\tdelta: 1 | -1,\n\tmaxIndent: number,\n): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst builder = state.transaction('command');\n\tlet changed = false;\n\n\tforEachBlockIdInRange(state, range, (bid: BlockId) => {\n\t\tconst block = state.getBlock(bid);\n\t\tif (!block || !isNodeOfType(block, 'list_item')) return;\n\n\t\tconst newIndent: number = block.attrs.indent + delta;\n\t\tif (newIndent < 0 || newIndent > maxIndent) return;\n\n\t\tbuilder.setBlockType(\n\t\t\tbid,\n\t\t\tnodeType('list_item'),\n\t\t\tbuildListItemAttrs(block.attrs.listType, newIndent, block.attrs.checked),\n\t\t);\n\t\tchanged = true;\n\t});\n\n\tif (!changed) return false;\n\n\tbuilder.setSelection(sel);\n\tcontext.dispatch(builder.build());\n\treturn true;\n}\n\n// --- Checklist Toggle ---\n\n/** Toggles the checked state of a checklist item. Exported for use in checkbox click handler. */\nexport function toggleChecked(\n\tcontext: PluginContext,\n\tinteractiveCheckboxes?: boolean,\n\ttargetId?: BlockId,\n): boolean {\n\tif (context.isReadOnly() && !interactiveCheckboxes) return false;\n\n\tconst state: EditorState = context.getState();\n\tconst bid: BlockId | null =\n\t\ttargetId ?? (!isTextSelection(state.selection) ? null : state.selection.anchor.blockId);\n\tif (!bid) return false;\n\n\tconst block = state.getBlock(bid);\n\tif (!block || !isNodeOfType(block, 'list_item') || block.attrs.listType !== 'checklist') {\n\t\treturn false;\n\t}\n\n\tconst attrs = buildListItemAttrs(block.attrs.listType, block.attrs.indent, !block.attrs.checked);\n\n\tconst tr = state\n\t\t.transaction('command')\n\t\t.setBlockType(bid, nodeType('list_item'), attrs)\n\t\t.setSelection(state.selection)\n\t\t.build();\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\n// --- Helpers ---\n\n/** Checks whether all blocks in a range are list items of the given type. Exported for toolbar. */\nexport function allBlocksMatchListType(\n\tstate: EditorState,\n\trange: ReturnType<typeof selectionRange>,\n\tlistType: ListType,\n): boolean {\n\tlet allMatch = true;\n\tforEachBlockIdInRange(state, range, (bid: BlockId) => {\n\t\tconst block = state.getBlock(bid);\n\t\tif (!block || block.type !== 'list_item' || block.attrs?.listType !== listType) {\n\t\t\tallMatch = false;\n\t\t}\n\t});\n\treturn allMatch;\n}\n","/**\n * List type metadata: icons, patterns, and type definitions.\n * Pure data constants shared across list plugin modules.\n */\n\nimport type { ListType } from './ListPlugin.js';\n\n// --- List Type Metadata ---\n\nexport interface ListTypeDefinition {\n\treadonly type: ListType;\n\treadonly icon: string;\n\treadonly inputPattern: RegExp;\n\treadonly inputPrefix: string;\n}\n\nconst BULLET_LIST_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z\"/></svg>';\nconst NUMBERED_LIST_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z\"/></svg>';\nconst CHECKLIST_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M22 7h-9v2h9V7zm0 8h-9v2h9v-2zM5.54 11L2 7.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41L5.54 11zm0 8L2 15.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41L5.54 19z\"/></svg>';\n\nexport const LIST_TYPE_DEFINITIONS: readonly ListTypeDefinition[] = [\n\t{\n\t\ttype: 'bullet',\n\t\ticon: BULLET_LIST_ICON,\n\t\tinputPattern: /^[-*] $/,\n\t\tinputPrefix: '- ',\n\t},\n\t{\n\t\ttype: 'ordered',\n\t\ticon: NUMBERED_LIST_ICON,\n\t\tinputPattern: /^\\d+\\. $/,\n\t\tinputPrefix: '1. ',\n\t},\n\t{\n\t\ttype: 'checklist',\n\t\ticon: CHECKLIST_ICON,\n\t\tinputPattern: /^\\[[ x]] $/,\n\t\tinputPrefix: '[ ] ',\n\t},\n];\n","/**\n * Input rule registration for list block types.\n * Converts `- `, `* `, `1. `, `[ ] `, `[x] ` at the start of a paragraph into list items.\n */\n\nimport { createCollapsedSelection, isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { buildListItemAttrs } from './ListAttrsFactory.js';\nimport type { ListTypeDefinition } from './ListDefinitions.js';\n\n/** Registers markdown-style input rules for configured list types. */\nexport function registerListInputRules(\n\tcontext: PluginContext,\n\tenabledTypes: readonly ListTypeDefinition[],\n): void {\n\tfor (const def of enabledTypes) {\n\t\tcontext.registerInputRule({\n\t\t\tpattern: def.inputPattern,\n\t\t\thandler: (state, match, start, _end) => {\n\t\t\t\tconst sel = state.selection;\n\t\t\t\tif (!isTextSelection(sel)) return null;\n\t\t\t\tif (!isCollapsed(sel)) return null;\n\n\t\t\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\t\t\tif (!block || block.type !== 'paragraph') return null;\n\n\t\t\t\tconst matchStr = match[0] ?? '';\n\t\t\t\tconst matchLen = matchStr.length;\n\t\t\t\tconst attrs = buildListItemAttrs(def.type, 0, matchStr.includes('[x]'));\n\n\t\t\t\treturn state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.deleteTextAt(sel.anchor.blockId, start, start + matchLen)\n\t\t\t\t\t.setBlockType(sel.anchor.blockId, nodeType('list_item'), attrs)\n\t\t\t\t\t.setSelection(createCollapsedSelection(sel.anchor.blockId, 0))\n\t\t\t\t\t.build();\n\t\t\t},\n\t\t});\n\t}\n}\n","/**\n * Keyboard handlers for list block types.\n * Handles Enter (split/exit list) and Backspace (convert to paragraph).\n */\n\nimport { isNodeOfType } from '../../model/AttrRegistry.js';\nimport type { BlockNode } from '../../model/Document.js';\nimport { generateBlockId, getBlockText } from '../../model/Document.js';\nimport { createCollapsedSelection, isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { buildListItemAttrs } from './ListAttrsFactory.js';\n\n// --- Context Guard ---\n\ninterface ListContext {\n\treadonly state: EditorState;\n\treadonly block: BlockNode;\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n}\n\n/**\n * Guards against NodeSelection, non-collapsed selections, and non-list blocks.\n * Returns false (not handled) if the cursor is not inside a list_item block.\n */\nfunction withListContext(context: PluginContext, handler: (ctx: ListContext) => boolean): boolean {\n\tconst state: EditorState = context.getState();\n\tif (!isTextSelection(state.selection)) return false;\n\n\tconst sel = state.selection;\n\tif (!isCollapsed(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\tif (!block || block.type !== 'list_item') return false;\n\n\treturn handler({\n\t\tstate,\n\t\tblock,\n\t\tblockId: sel.anchor.blockId,\n\t\toffset: sel.anchor.offset,\n\t});\n}\n\n/** Registers Enter and Backspace keymaps for list items. */\nexport function registerListKeymaps(context: PluginContext): void {\n\tcontext.registerKeymap({\n\t\tEnter: () => handleEnter(context),\n\t\tBackspace: () => handleBackspace(context),\n\t});\n}\n\n// --- Enter Handler ---\n\n/**\n * Handles Enter inside a list item.\n * Empty item → exit list (convert to paragraph).\n * Non-empty item → split and create a new list item with the same type.\n */\nfunction handleEnter(context: PluginContext): boolean {\n\treturn withListContext(context, (ctx) => {\n\t\tconst text: string = getBlockText(ctx.block);\n\n\t\tif (text === '') {\n\t\t\tconst tr = ctx.state\n\t\t\t\t.transaction('input')\n\t\t\t\t.setBlockType(ctx.blockId, nodeType('paragraph'))\n\t\t\t\t.setSelection(ctx.state.selection)\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\tconst newBlockId = generateBlockId();\n\t\tconst listType = isNodeOfType(ctx.block, 'list_item') ? ctx.block.attrs.listType : 'bullet';\n\t\tconst indent: number = isNodeOfType(ctx.block, 'list_item') ? ctx.block.attrs.indent : 0;\n\t\tconst attrs = buildListItemAttrs(listType, indent);\n\n\t\tconst tr = ctx.state\n\t\t\t.transaction('input')\n\t\t\t.splitBlock(ctx.blockId, ctx.offset, newBlockId)\n\t\t\t.setBlockType(newBlockId, nodeType('list_item'), attrs)\n\t\t\t.setSelection(createCollapsedSelection(newBlockId, 0))\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t});\n}\n\n// --- Backspace Handler ---\n\n/**\n * Handles Backspace at the start of a list item.\n * Converts the list item back to a paragraph, preserving text.\n */\nfunction handleBackspace(context: PluginContext): boolean {\n\treturn withListContext(context, (ctx) => {\n\t\tif (ctx.offset !== 0) return false;\n\n\t\tconst tr = ctx.state\n\t\t\t.transaction('input')\n\t\t\t.setBlockType(ctx.blockId, nodeType('paragraph'))\n\t\t\t.setSelection(ctx.state.selection)\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t});\n}\n","/**\n * Locale interface and default English locale for the ListPlugin.\n */\n\n// --- Locale Interface ---\n\nexport interface ListLocale {\n\treadonly bulletList: string;\n\treadonly numberedList: string;\n\treadonly checklist: string;\n}\n\n// --- Default English Locale ---\n\nexport const LIST_LOCALE_EN: ListLocale = {\n\tbulletList: 'Bullet List',\n\tnumberedList: 'Numbered List',\n\tchecklist: 'Checklist',\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: Record<string, () => Promise<{ default: ListLocale }>> = import.meta.glob<{\n\tdefault: ListLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadListLocale(lang: string): Promise<ListLocale> {\n\tif (lang === 'en') return LIST_LOCALE_EN;\n\tconst loader = localeModules[`./locales/${lang}.ts`];\n\tif (!loader) return LIST_LOCALE_EN;\n\ttry {\n\t\tconst mod = await loader();\n\t\treturn mod.default;\n\t} catch {\n\t\treturn LIST_LOCALE_EN;\n\t}\n}\n","/**\n * Toolbar item registration for list block types.\n * Registers bullet, ordered, and checklist toolbar buttons with active-state detection.\n */\n\nimport { isTextSelection, selectionRange } from '../../model/Selection.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { allBlocksMatchListType } from './ListCommands.js';\nimport type { ListTypeDefinition } from './ListDefinitions.js';\nimport type { ListLocale } from './ListLocale.js';\nimport type { ListType } from './ListPlugin.js';\n\n/** Registers toolbar items for each enabled list type. */\nexport function registerListToolbarItems(\n\tcontext: PluginContext,\n\tenabledTypes: readonly ListTypeDefinition[],\n\tlocale: ListLocale,\n): void {\n\tfor (const def of enabledTypes) {\n\t\tcontext.registerToolbarItem({\n\t\t\tid: `list-${def.type}`,\n\t\t\tgroup: 'block',\n\t\t\ticon: def.icon,\n\t\t\tlabel: getListLabel(def.type, locale),\n\t\t\tcommand: `toggleList:${def.type}`,\n\t\t\tisActive: (state) => isListActive(state, def.type),\n\t\t});\n\t}\n}\n\n// --- Helpers ---\n\nfunction getListLabel(type: ListType, locale: ListLocale): string {\n\tconst labels: Record<ListType, string> = {\n\t\tbullet: locale.bulletList,\n\t\tordered: locale.numberedList,\n\t\tchecklist: locale.checklist,\n\t};\n\treturn labels[type];\n}\n\nfunction isListActive(state: EditorState, listType: ListType): boolean {\n\tif (!isTextSelection(state.selection)) return false;\n\n\tif (state.selection.anchor.blockId !== state.selection.head.blockId) {\n\t\tconst range = selectionRange(state.selection, state.getBlockOrder());\n\t\treturn allBlocksMatchListType(state, range, listType);\n\t}\n\n\tconst block = state.getBlock(state.selection.anchor.blockId);\n\treturn block?.type === 'list_item' && block.attrs?.listType === listType;\n}\n","/**\n * ListPlugin: registers ordered, unordered, and checklist block types\n * with NodeSpecs, toggle commands, indent/outdent (Tab/Shift-Tab),\n * input rules, and toolbar buttons.\n *\n * This file is a thin orchestrator — command logic, input rules, keyboard\n * handlers, and toolbar rendering are delegated to dedicated modules.\n *\n * List items are modeled as flat blocks with a `listType` and `indent` attribute,\n * allowing simple nesting representation without deep tree structures.\n */\n\nimport { LIST_CSS, LIST_MARKER_WIDTH } from '../../editor/styles/list.js';\nimport { blockId } from '../../model/TypeBrands.js';\nimport { setStyleProperty } from '../../style/StyleRuntime.js';\nimport { createBlockElement } from '../../view/DomUtils.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { registerListCommands, toggleChecked } from './ListCommands.js';\nimport { LIST_TYPE_DEFINITIONS, type ListTypeDefinition } from './ListDefinitions.js';\nimport { registerListInputRules } from './ListInputRules.js';\nimport { registerListKeymaps } from './ListKeyboardHandlers.js';\nimport { LIST_LOCALE_EN, type ListLocale, loadListLocale } from './ListLocale.js';\nimport { registerListToolbarItems } from './ListToolbarItems.js';\n\n// --- Attribute Registry Augmentation ---\n\nexport type ListType = 'bullet' | 'ordered' | 'checklist';\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface NodeAttrRegistry {\n\t\tlist_item: { listType: ListType; indent: number; checked: boolean };\n\t}\n}\n\n// --- Configuration ---\n\nexport interface ListConfig {\n\t/** Which list types to enable. Defaults to all. */\n\treadonly types: readonly ListType[];\n\t/** Maximum indent depth. Defaults to 4. */\n\treadonly maxIndent: number;\n\t/**\n\t * When true, checklist checkboxes remain interactive even in read-only mode.\n\t * Defaults to false (checkboxes are fully read-only).\n\t */\n\treadonly interactiveCheckboxes?: boolean;\n\treadonly locale?: ListLocale;\n}\n\nconst DEFAULT_CONFIG: ListConfig = {\n\ttypes: ['bullet', 'ordered', 'checklist'],\n\tmaxIndent: 4,\n};\n\n// --- Plugin ---\n\nexport class ListPlugin implements Plugin {\n\treadonly id = 'list';\n\treadonly name = 'List';\n\treadonly priority = 35;\n\n\tprivate readonly config: ListConfig;\n\tprivate locale!: ListLocale;\n\tprivate context: PluginContext | null = null;\n\tprivate checkboxClickHandler: ((e: MouseEvent) => void) | null = null;\n\n\tconstructor(config?: Partial<ListConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.context = context;\n\t\tthis.locale = await resolveLocale(context, this.config.locale, LIST_LOCALE_EN, loadListLocale);\n\t\tconst enabledTypes = this.getEnabledTypes();\n\n\t\tcontext.registerStyleSheet(LIST_CSS);\n\t\tthis.registerNodeSpec(context);\n\t\tregisterListCommands(context, this.config, enabledTypes);\n\t\tregisterListKeymaps(context);\n\t\tregisterListInputRules(context, enabledTypes);\n\t\tregisterListToolbarItems(context, enabledTypes, this.locale);\n\t\tthis.registerCheckboxClickHandler(context);\n\t}\n\n\tdestroy(): void {\n\t\tif (this.checkboxClickHandler && this.context) {\n\t\t\tconst container: HTMLElement = this.context.getContainer();\n\t\t\tcontainer.removeEventListener('mousedown', this.checkboxClickHandler);\n\t\t}\n\t\tthis.checkboxClickHandler = null;\n\t\tthis.context = null;\n\t}\n\n\tprivate registerNodeSpec(context: PluginContext): void {\n\t\tcontext.registerNodeSpec({\n\t\t\ttype: 'list_item',\n\t\t\tgroup: 'block',\n\t\t\tcontent: { allow: ['text'] },\n\t\t\tattrs: {\n\t\t\t\tlistType: { default: 'bullet' },\n\t\t\t\tindent: { default: 0 },\n\t\t\t\tchecked: { default: false },\n\t\t\t},\n\t\t\ttoDOM(node) {\n\t\t\t\tconst listType = node.attrs?.listType ?? 'bullet';\n\t\t\t\tconst indent = node.attrs?.indent ?? 0;\n\t\t\t\tconst checked = node.attrs?.checked ?? false;\n\n\t\t\t\tconst li = createBlockElement('li', node.id);\n\t\t\t\tli.setAttribute('role', 'listitem');\n\t\t\t\tli.setAttribute('data-list-type', listType);\n\t\t\t\tli.setAttribute('data-indent', String(indent));\n\t\t\t\tli.className = `notectl-list-item notectl-list-item--${listType}`;\n\n\t\t\t\tif (indent > 0) {\n\t\t\t\t\tsetStyleProperty(li, 'marginLeft', `${indent * LIST_MARKER_WIDTH}px`);\n\t\t\t\t}\n\n\t\t\t\tif (listType === 'checklist') {\n\t\t\t\t\tli.setAttribute('data-checked', String(checked));\n\t\t\t\t\tli.setAttribute('aria-checked', String(checked));\n\t\t\t\t}\n\t\t\t\tli.setAttribute('aria-level', String(indent + 1));\n\n\t\t\t\treturn li;\n\t\t\t},\n\t\t\twrapper(node) {\n\t\t\t\tconst listType = node.attrs?.listType ?? 'bullet';\n\t\t\t\tconst tag = listType === 'ordered' ? 'ol' : 'ul';\n\t\t\t\treturn {\n\t\t\t\t\ttag,\n\t\t\t\t\tkey: `list-${listType}`,\n\t\t\t\t\tclassName: `notectl-list notectl-list--${listType}`,\n\t\t\t\t\tattrs: { role: 'list' },\n\t\t\t\t};\n\t\t\t},\n\t\t\ttoHTML(node, content) {\n\t\t\t\tconst listType: string = (node.attrs?.listType as string) ?? 'bullet';\n\t\t\t\tconst checked: boolean = (node.attrs?.checked as boolean) ?? false;\n\n\t\t\t\tif (listType === 'checklist') {\n\t\t\t\t\tconst checkedAttr: string = checked ? ' checked' : '';\n\t\t\t\t\tconst ariaChecked: string = String(checked);\n\t\t\t\t\treturn (\n\t\t\t\t\t\t`<li role=\"checkbox\" aria-checked=\"${ariaChecked}\">` +\n\t\t\t\t\t\t`<input type=\"checkbox\" disabled${checkedAttr}>` +\n\t\t\t\t\t\t`${content || '<br>'}</li>`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn `<li>${content || '<br>'}</li>`;\n\t\t\t},\n\t\t\tparseHTML: [{ tag: 'li' }],\n\t\t\tsanitize: {\n\t\t\t\ttags: ['ul', 'ol', 'li', 'input'],\n\t\t\t\tattrs: ['type', 'disabled', 'checked', 'role', 'aria-checked'],\n\t\t\t},\n\t\t});\n\t}\n\n\tprivate registerCheckboxClickHandler(context: PluginContext): void {\n\t\tif (!this.config.types.includes('checklist')) return;\n\n\t\tthis.checkboxClickHandler = (e: MouseEvent) => {\n\t\t\tif (context.isReadOnly() && !this.config.interactiveCheckboxes) return;\n\n\t\t\tconst target: EventTarget | null = e.target;\n\t\t\tif (!(target instanceof HTMLElement)) return;\n\n\t\t\tconst li: HTMLElement | null = target.closest('.notectl-list-item--checklist');\n\t\t\tif (!li) return;\n\n\t\t\tconst rect: DOMRect = li.getBoundingClientRect();\n\t\t\tconst isRtl: boolean = getComputedStyle(li).direction === 'rtl';\n\t\t\tconst markerDistance: number = isRtl ? rect.right - e.clientX : e.clientX - rect.left;\n\t\t\tif (markerDistance >= LIST_MARKER_WIDTH) return;\n\n\t\t\te.preventDefault();\n\n\t\t\tconst bid: string | null = li.getAttribute('data-block-id');\n\t\t\tif (!bid) return;\n\n\t\t\ttoggleChecked(context, this.config.interactiveCheckboxes, blockId(bid));\n\t\t};\n\n\t\tconst container: HTMLElement = context.getContainer();\n\t\tcontainer.addEventListener('mousedown', this.checkboxClickHandler);\n\t}\n\n\tprivate getEnabledTypes(): readonly ListTypeDefinition[] {\n\t\treturn LIST_TYPE_DEFINITIONS.filter((def) => this.config.types.includes(def.type));\n\t}\n}\n"],"mappings":"wZCSA,SAAgB,EACf,EACA,EACA,GAEA,MAAiB,cAAb,EACI,CAAE,WAAU,SAAQ,QAAS,IAAW,GAEzC,CAAE,WAAU,UC+BpB,SAAS,EAAW,EAAwB,GAC3C,MAAM,EAAqB,EAAQ,WAC7B,EAAM,EAAM,UAClB,QAAK,EAAgB,KAEjB,EAAI,OAAO,UAAY,EAAI,KAAK,QAsCrC,SAAyB,EAAwB,EAAoB,GACpE,MAAM,EAAM,EAAM,UAClB,IAAK,EAAgB,GAAM,OAAO,EAElC,MAAM,EAAQ,EAAe,EAAK,EAAM,iBAClC,EAAqB,EAAuB,EAAO,EAAO,GAC1D,EAAU,EAAM,YAAY,WAwBlC,OAtBA,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AF2B,OAAO,sCAGA,KAC/B,GAAW,cAIhB,MAAO,OAAO,GAAW,eAE1B,UAAW,CAAC,CAAE,IAAK,OACnB,SAAU,CACT,KAAM,CAAC,KAAM,KAAM,KAAM,SACzB,MAAO,CAAC,OAAQ,WAAY,UAAW,OAAQ,mBAKlD,4BAAA,CAAqC,GAC/B,KAAK,OAAO,MAAM,SAAS,eAEhC,KAAK,qBAAwB,IAC5B,GAAI,EAAQ,eAAiB,KAAK,OAAO,sBAAuB,OAEhE,MAAM,EAA6B,EAAE,OACrC,KAAM,aAAkB,aAAc,OAEtC,MAAM,EAAyB,EAAO,QAAQ,iCAC9C,IAAK,EAAI,OAET,MAAM,EAAgB,EAAG,wBAGzB,IAF0D,QAAnC,iBAAiB,GAAI,UACL,EAAK,MAAQ,EAAE,QAAU,EAAE,QAAU,EAAK,OAAA,GACxC,OAEzC,EAAE,iBAEF,MAAM,EAAqB,EAAG,aAAa,iBACtC,GAEL,EAAc,EAAS,KAAK,OAAO,sBAAuB,EAAQ,KAGpC,EAAQ,eAC7B,iBAAiB,YAAa,KAAK,uBAG9C,eAAA,GACC,OAAO,EAAsB,OAAQ,GAAQ,KAAK,OAAO,MAAM,SAAS,EAAI"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function t(t,e){const n=t.getBlock(e);if(!n)return!1;const r=t.schema.getNodeSpec;return!!r&&!0===r(n.type)?.isVoid}function e(t,e,n){const r=t.getNodePath(e),o=t.getNodePath(n);if(!r||!o)return!1;if(r.length!==o.length)return!1;for(let c=0;c<r.length-1;c++)if(r[c]!==o[c])return!1;return!0}function n(t,e){const n=t.schema.getNodeSpec;if(!n)return!1;const r=t.getNodePath(e);if(!r||r.length<=1)return!1;for(let o=0;o<r.length-1;o++){const e=r[o];if(!e)continue;const c=t.getBlock(e);if(c&&n(c.type)?.isolating)return!0}return!1}function r(t,e){const n=t.schema.getNodeSpec;if(!n)return!1;const r=t.getBlock(e);return!!r&&!0===n(r.type)?.isolating}function o(t,o,c){if(r(t,o)||r(t,c))return!1;const i=n(t,o),s=n(t,c);return i===s&&(!i||!s||e(t,o,c))}export{e as a,t as i,n,r,o as t};
|
|
2
|
-
//# sourceMappingURL=NavigationQueries-CgYPG6oY.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationQueries-CgYPG6oY.mjs","names":[],"sources":["../../src/state/NavigationQueries.ts"],"sourcesContent":["/**\n * Pure navigation query functions for block boundary and isolating checks.\n *\n * These utilities inspect the document structure and schema to answer\n * questions about block traversal — whether a block is void, isolating,\n * or whether navigation between two blocks is allowed.\n */\n\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from './EditorState.js';\n\n/** Returns true if the block with the given ID is a void block (e.g. image, HR). */\nexport function isVoidBlock(state: EditorState, bid: BlockId): boolean {\n\tconst block = state.getBlock(bid);\n\tif (!block) return false;\n\tconst getNodeSpec = state.schema.getNodeSpec;\n\tif (!getNodeSpec) return false;\n\treturn getNodeSpec(block.type)?.isVoid === true;\n}\n\n/** Checks whether two blocks share the same parent in the document tree. */\nexport function sharesParent(state: EditorState, blockIdA: BlockId, blockIdB: BlockId): boolean {\n\tconst pathA = state.getNodePath(blockIdA);\n\tconst pathB = state.getNodePath(blockIdB);\n\tif (!pathA || !pathB) return false;\n\tif (pathA.length !== pathB.length) return false;\n\t// Compare parent paths (all but last element)\n\tfor (let i = 0; i < pathA.length - 1; i++) {\n\t\tif (pathA[i] !== pathB[i]) return false;\n\t}\n\treturn true;\n}\n\n/** Checks whether a block is inside an isolating node (e.g. table_cell). */\nexport function isInsideIsolating(state: EditorState, blockId: BlockId): boolean {\n\tconst getNodeSpec = state.schema.getNodeSpec;\n\tif (!getNodeSpec) return false;\n\tconst path = state.getNodePath(blockId);\n\tif (!path || path.length <= 1) return false;\n\n\t// Check ancestors (not the block itself)\n\tfor (let i = 0; i < path.length - 1; i++) {\n\t\tconst ancestorId = path[i];\n\t\tif (!ancestorId) continue;\n\t\tconst ancestor = state.getBlock(ancestorId);\n\t\tif (!ancestor) continue;\n\t\tconst spec = getNodeSpec(ancestor.type);\n\t\tif (spec?.isolating) return true;\n\t}\n\treturn false;\n}\n\n/** Returns true if the block itself has the isolating property. */\nexport function isIsolatingBlock(state: EditorState, blockId: BlockId): boolean {\n\tconst getNodeSpec = state.schema.getNodeSpec;\n\tif (!getNodeSpec) return false;\n\tconst block = state.getBlock(blockId);\n\tif (!block) return false;\n\treturn getNodeSpec(block.type)?.isolating === true;\n}\n\n/**\n * Checks whether navigation between two blocks is allowed.\n * Prevents crossing isolating boundaries (e.g. table cells).\n */\nexport function canCrossBlockBoundary(state: EditorState, fromId: BlockId, toId: BlockId): boolean {\n\t// A block that is itself isolating cannot be crossed into via arrow keys\n\tif (isIsolatingBlock(state, fromId) || isIsolatingBlock(state, toId)) return false;\n\n\tconst fromInside: boolean = isInsideIsolating(state, fromId);\n\tconst toInside: boolean = isInsideIsolating(state, toId);\n\n\t// One inside isolating, the other not → disallow\n\tif (fromInside !== toInside) return false;\n\n\t// Both inside isolating → must share the same parent\n\tif (fromInside && toInside) return sharesParent(state, fromId, toId);\n\n\treturn true;\n}\n"],"mappings":"AAYA,SAAgB,EAAY,EAAoB,GAC/C,MAAM,EAAQ,EAAM,SAAS,GAC7B,IAAK,EAAO,OAAO,EACnB,MAAM,EAAc,EAAM,OAAO,YACjC,QAAK,IACsC,IAApC,EAAY,EAAM,OAAO,OAIjC,SAAgB,EAAa,EAAoB,EAAmB,GACnE,MAAM,EAAQ,EAAM,YAAY,GAC1B,EAAQ,EAAM,YAAY,GAChC,IAAK,IAAU,EAAO,OAAO,EAC7B,GAAI,EAAM,SAAW,EAAM,OAAQ,OAAO,EAE1C,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAS,EAAG,IACrC,GAAI,EAAM,KAAO,EAAM,GAAI,OAAO,EAEnC,OAAO,EAIR,SAAgB,EAAkB,EAAoB,GACrD,MAAM,EAAc,EAAM,OAAO,YACjC,IAAK,EAAa,OAAO,EACzB,MAAM,EAAO,EAAM,YAAY,GAC/B,IAAK,GAAQ,EAAK,QAAU,EAAG,OAAO,EAGtC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAK,OAAS,EAAG,IAAK,CACzC,MAAM,EAAa,EAAK,GACxB,IAAK,EAAY,SACjB,MAAM,EAAW,EAAM,SAAS,GAChC,GAAK,GACQ,EAAY,EAAS,OACxB,UAAW,OAAO,EAE7B,OAAO,EAIR,SAAgB,EAAiB,EAAoB,GACpD,MAAM,EAAc,EAAM,OAAO,YACjC,IAAK,EAAa,OAAO,EACzB,MAAM,EAAQ,EAAM,SAAS,GAC7B,QAAK,IACyC,IAAvC,EAAY,EAAM,OAAO,UAOjC,SAAgB,EAAsB,EAAoB,EAAiB,GAE1E,GAAI,EAAiB,EAAO,IAAW,EAAiB,EAAO,GAAO,OAAO,EAE7E,MAAM,EAAsB,EAAkB,EAAO,GAC/C,EAAoB,EAAkB,EAAO,GAGnD,OAAI,IAAe,KAGf,IAAc,GAAiB,EAAa,EAAO,EAAQ"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{y as n}from"./Document-DnPKbcPE.mjs";function i(i,r){if(0===r.length)return;let t=i.children.find(n=>n.id===r[0]);if(t){for(let i=1;i<r.length;i++){const o=r[i];if(!o)return;const e=t?.children.find(i=>n(i)&&i.id===o);if(!e)return;t=e}return t}}function r(r,t){if(0===t.length)return;if(1===t.length){const n=r.children.findIndex(n=>n.id===t[0]);if(-1===n)return;return{parent:r,index:n}}const o=i(r,t.slice(0,-1));if(!o)return;const e=t[t.length-1];if(!e)return;const f=o.children.findIndex(i=>n(i)&&i.id===e);return-1!==f?{parent:o,index:f}:void 0}function t(n,i){for(const r of n.children){if(r.id===i)return[i];const n=o(r,i);if(n)return[r.id,...n]}}function o(i,r){for(const t of i.children){if(!n(t))continue;if(t.id===r)return[r];const i=o(t,r);if(i)return[t.id,...i]}}function e(n,i){for(const r of n.children)f(r,[r.id],i)}function f(i,r,t){t(i,r);for(const o of i.children)n(o)&&f(o,[...r,o.id],t)}function c(n,i){for(const r of n.children){if(r.id===i)return r;const n=d(r,i);if(n)return n}}function d(i,r){for(const t of i.children){if(!n(t))continue;if(t.id===r)return t;const i=d(t,r);if(i)return i}}function u(n,r){const o=t(n,r);if(!o)return;const e=i(n,o);return e?{node:e,path:o}:void 0}export{r as a,i,t as n,e as o,u as r,c as t};
|
|
2
|
-
//# sourceMappingURL=NodeResolver-BkOsZnuU.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeResolver-BkOsZnuU.mjs","names":[],"sources":["../../src/model/NodeResolver.ts"],"sourcesContent":["/**\n * Utilities for resolving nodes by path within the document tree.\n * Supports both flat and recursive (nested) document structures.\n */\n\nimport type { BlockNode, Document } from './Document.js';\nimport { isBlockNode } from './Document.js';\n\n/**\n * Resolves a node in the document tree by its path (array of block IDs).\n * The path traces the lineage from the root block down to the target.\n */\nexport function resolveNodeByPath(doc: Document, path: readonly string[]): BlockNode | undefined {\n\tif (path.length === 0) return undefined;\n\n\tlet current: BlockNode | undefined = doc.children.find((b) => b.id === path[0]);\n\tif (!current) return undefined;\n\n\tfor (let i = 1; i < path.length; i++) {\n\t\tconst childId = path[i];\n\t\tif (!childId) return undefined;\n\t\tconst next: BlockNode | undefined = current?.children.find(\n\t\t\t(c): c is BlockNode => isBlockNode(c) && c.id === childId,\n\t\t);\n\t\tif (!next) return undefined;\n\t\tcurrent = next;\n\t}\n\n\treturn current;\n}\n\n/**\n * Resolves the parent of a node at the given path.\n * Returns the parent container (Document or BlockNode) and the child's index within it.\n */\nexport function resolveParentByPath(\n\tdoc: Document,\n\tpath: readonly string[],\n): { parent: Document | BlockNode; index: number } | undefined {\n\tif (path.length === 0) return undefined;\n\n\tif (path.length === 1) {\n\t\tconst index = doc.children.findIndex((b) => b.id === path[0]);\n\t\tif (index === -1) return undefined;\n\t\treturn { parent: doc, index };\n\t}\n\n\tconst parentPath = path.slice(0, -1);\n\tconst parent = resolveNodeByPath(doc, parentPath);\n\tif (!parent) return undefined;\n\n\tconst childId = path[path.length - 1];\n\tif (!childId) return undefined;\n\tconst index = parent.children.findIndex(\n\t\t(c): c is BlockNode => isBlockNode(c) && c.id === childId,\n\t);\n\tif (index === -1) return undefined;\n\n\treturn { parent, index };\n}\n\n/**\n * Finds the path (array of block IDs) to a node by its ID.\n * Performs recursive DFS through the document tree.\n */\nexport function findNodePath(doc: Document, nodeId: string): string[] | undefined {\n\tfor (const block of doc.children) {\n\t\tif (block.id === nodeId) return [nodeId];\n\n\t\tconst subPath = findNodePathInBlock(block, nodeId);\n\t\tif (subPath) return [block.id, ...subPath];\n\t}\n\treturn undefined;\n}\n\nfunction findNodePathInBlock(block: BlockNode, nodeId: string): string[] | undefined {\n\tfor (const child of block.children) {\n\t\tif (!isBlockNode(child)) continue;\n\t\tif (child.id === nodeId) return [nodeId];\n\n\t\tconst subPath = findNodePathInBlock(child, nodeId);\n\t\tif (subPath) return [child.id, ...subPath];\n\t}\n\treturn undefined;\n}\n\n/**\n * Walks all block nodes in the document tree in depth-first order.\n * Visits every BlockNode, including nested ones, with their full path.\n */\nexport function walkNodes(\n\tdoc: Document,\n\tcallback: (node: BlockNode, path: string[]) => void,\n): void {\n\tfor (const block of doc.children) {\n\t\twalkNodeRecursive(block, [block.id], callback);\n\t}\n}\n\nfunction walkNodeRecursive(\n\tnode: BlockNode,\n\tpath: string[],\n\tcallback: (node: BlockNode, path: string[]) => void,\n): void {\n\tcallback(node, path);\n\tfor (const child of node.children) {\n\t\tif (isBlockNode(child)) {\n\t\t\twalkNodeRecursive(child, [...path, child.id], callback);\n\t\t}\n\t}\n}\n\n/**\n * Finds a block node by ID anywhere in the document tree (recursive DFS).\n */\nexport function findNode(doc: Document, nodeId: string): BlockNode | undefined {\n\tfor (const block of doc.children) {\n\t\tif (block.id === nodeId) return block;\n\t\tconst found = findNodeInBlock(block, nodeId);\n\t\tif (found) return found;\n\t}\n\treturn undefined;\n}\n\nfunction findNodeInBlock(block: BlockNode, nodeId: string): BlockNode | undefined {\n\tfor (const child of block.children) {\n\t\tif (!isBlockNode(child)) continue;\n\t\tif (child.id === nodeId) return child;\n\t\tconst found = findNodeInBlock(child, nodeId);\n\t\tif (found) return found;\n\t}\n\treturn undefined;\n}\n\n/**\n * Finds a block node and returns it together with its path.\n */\nexport function findNodeWithPath(\n\tdoc: Document,\n\tnodeId: string,\n): { node: BlockNode; path: string[] } | undefined {\n\tconst path = findNodePath(doc, nodeId);\n\tif (!path) return undefined;\n\tconst node = resolveNodeByPath(doc, path);\n\tif (!node) return undefined;\n\treturn { node, path };\n}\n"],"mappings":"4CAYA,SAAgB,EAAkB,EAAe,GAChD,GAAoB,IAAhB,EAAK,OAAc,OAEvB,IAAI,EAAiC,EAAI,SAAS,KAAM,GAAM,EAAE,KAAO,EAAK,IAC5E,GAAK,EAAL,CAEA,IAAK,IAAI,EAAI,EAAG,EAAI,EAAK,OAAQ,IAAK,CACrC,MAAM,EAAU,EAAK,GACrB,IAAK,EAAS,OACd,MAAM,EAA8B,GAAS,SAAS,KACpD,GAAsB,EAAY,IAAM,EAAE,KAAO,GAEnD,IAAK,EAAM,OACX,EAAU,EAGX,OAAO,CAZc,EAmBtB,SAAgB,EACf,EACA,GAEA,GAAoB,IAAhB,EAAK,OAAc,OAEvB,GAAoB,IAAhB,EAAK,OAAc,CACtB,MAAM,EAAQ,EAAI,SAAS,UAAW,GAAM,EAAE,KAAO,EAAK,IAC1D,IAAc,IAAV,EAAc,OAClB,MAAO,CAAE,OAAQ,EAAK,SAIvB,MAAM,EAAS,EAAkB,EADd,EAAK,MAAM,GAAG,IAEjC,IAAK,EAAQ,OAEb,MAAM,EAAU,EAAK,EAAK,OAAS,GACnC,IAAK,EAAS,OACd,MAAM,EAAQ,EAAO,SAAS,UAC5B,GAAsB,EAAY,IAAM,EAAE,KAAO,GAEnD,OAAc,IAAV,EAEG,CAAE,SAAQ,cAFjB,EASD,SAAgB,EAAa,EAAe,GAC3C,IAAK,MAAM,KAAS,EAAI,SAAU,CACjC,GAAI,EAAM,KAAO,EAAQ,MAAO,CAAC,GAEjC,MAAM,EAAU,EAAoB,EAAO,GAC3C,GAAI,EAAS,MAAO,CAAC,EAAM,MAAO,IAKpC,SAAS,EAAoB,EAAkB,GAC9C,IAAK,MAAM,KAAS,EAAM,SAAU,CACnC,IAAK,EAAY,GAAQ,SACzB,GAAI,EAAM,KAAO,EAAQ,MAAO,CAAC,GAEjC,MAAM,EAAU,EAAoB,EAAO,GAC3C,GAAI,EAAS,MAAO,CAAC,EAAM,MAAO,IASpC,SAAgB,EACf,EACA,GAEA,IAAK,MAAM,KAAS,EAAI,SACvB,EAAkB,EAAO,CAAC,EAAM,IAAK,GAIvC,SAAS,EACR,EACA,EACA,GAEA,EAAS,EAAM,GACf,IAAK,MAAM,KAAS,EAAK,SACpB,EAAY,IACf,EAAkB,EAAO,IAAI,EAAM,EAAM,IAAK,GAQjD,SAAgB,EAAS,EAAe,GACvC,IAAK,MAAM,KAAS,EAAI,SAAU,CACjC,GAAI,EAAM,KAAO,EAAQ,OAAO,EAChC,MAAM,EAAQ,EAAgB,EAAO,GACrC,GAAI,EAAO,OAAO,GAKpB,SAAS,EAAgB,EAAkB,GAC1C,IAAK,MAAM,KAAS,EAAM,SAAU,CACnC,IAAK,EAAY,GAAQ,SACzB,GAAI,EAAM,KAAO,EAAQ,OAAO,EAChC,MAAM,EAAQ,EAAgB,EAAO,GACrC,GAAI,EAAO,OAAO,GAQpB,SAAgB,EACf,EACA,GAEA,MAAM,EAAO,EAAa,EAAK,GAC/B,IAAK,EAAM,OACX,MAAM,EAAO,EAAkB,EAAK,GACpC,OAAK,EACE,CAAE,OAAM,aADf"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as n,c as t,d as e,y as o}from"./Document-DnPKbcPE.mjs";import{c as i,l as r,n as s,o as c,r as l,t as u}from"./Selection-B14e7gd0.mjs";import{n as d}from"./NodeResolver-BkOsZnuU.mjs";import{i as a}from"./NavigationQueries-CgYPG6oY.mjs";import{a as f,n as m,o as p,t as b}from"./CommandHelpers-G6M-qXJR.mjs";function I(e,i){const r=d(e.doc,i.nodeId);if(!r)return null;const s=m(r),c=p(e,s),l=f(c,i.nodeId);if(l<0)return null;const a=e.transaction("input");if(1===c.length){const e=t();return a.insertNode(s,0,n(e)),a.removeNode(s,1),a.setSelection(u(e,0)),a.build()}a.removeNode(s,l);const I=c[l-1];if(I&&o(I)){const n=b(e,I.id,"end");if(n)return a.setSelection(n),a.build()}const S=c[l+1];if(S&&o(S)){const n=b(e,S.id,"start");if(n)return a.setSelection(n),a.build()}return a.build()}function S(e,o){const i=d(e.doc,o.nodeId);if(!i)return null;const r=m(i),s=f(p(e,r),o.nodeId);if(s<0)return null;const c=t(),l=e.transaction("input");return l.insertNode(r,s+1,n(c)),l.setSelection(u(c,0)),l.build()}function g(e,o,i,r){const s=m(d(e.doc,o.nodeId)),c=p(e,s),l=f(c,o.nodeId),a=t(),b=e.transaction(r),I=l>=0?l+1:c.length;return b.insertNode(s,I,n(a)),b.insertText(a,0,i,[]),b.setSelection(u(a,i.length)),b.build()}function h(n,t,o){const f=n.selection,m=n.getBlockOrder(),p=!o||"left"!==t&&"right"!==t?t:"left"===t?"right":"left";return r(f)?function(n,t,o,i){const r=i.indexOf(t.nodeId),c=d(n.doc,t.nodeId)??[];if("left"===o||"up"===o){if(r>0){const o=i[r-1];if(!o)return null;if(a(n,o))return n.transaction("input").setSelection(s(t.nodeId,"before",c)).build();const l=n.getBlock(o),d=l?e(l):0;return n.transaction("input").setSelection(u(o,d)).build()}return n.transaction("input").setSelection(s(t.nodeId,"before",c)).build()}if(r<i.length-1){const e=i[r+1];return e?a(n,e)?n.transaction("input").setSelection(s(t.nodeId,"after",c)).build():n.transaction("input").setSelection(u(e,0)).build():null}return n.transaction("input").setSelection(s(t.nodeId,"after",c)).build()}(n,f,p,m):i(f)?null:c(f)?function(n,t,o,i){const r=i.indexOf(t.anchor.blockId),s=n.getBlock(t.anchor.blockId);if(!s)return null;const c=e(s);if(("right"===o||"down"===o)&&t.anchor.offset===c&&r<i.length-1){const t=i[r+1];if(t&&a(n,t)){const e=d(n.doc,t)??[];return n.transaction("input").setSelection(l(t,e)).build()}}if(("left"===o||"up"===o)&&0===t.anchor.offset&&r>0){const t=i[r-1];if(t&&a(n,t)){const e=d(n.doc,t)??[];return n.transaction("input").setSelection(l(t,e)).build()}}return null}(n,f,p,m):null}export{h as i,S as n,g as r,I as t};
|
|
2
|
-
//# sourceMappingURL=NodeSelectionCommands-U8xEdaE4.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeSelectionCommands-U8xEdaE4.mjs","names":[],"sources":["../../src/commands/NodeSelectionCommands.ts"],"sourcesContent":["/**\n * Commands for NodeSelection: deleting void blocks, inserting paragraphs\n * after void blocks, and navigating arrow keys into/out of void blocks.\n */\n\nimport {\n\tcreateEmptyParagraph,\n\tgenerateBlockId,\n\tgetBlockLength,\n\tisBlockNode,\n} from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport type { NodeSelection } from '../model/Selection.js';\nimport {\n\tcreateCollapsedSelection,\n\tcreateGapCursor,\n\tcreateNodeSelection,\n\tisCollapsed,\n\tisGapCursor,\n\tisNodeSelection,\n} from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport { isVoidBlock } from '../state/NavigationQueries.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport {\n\tcreateSelectionForBlockBoundary,\n\textractParentPath,\n\tfindSiblingIndex,\n\tgetSiblings,\n} from './CommandHelpers.js';\n\nexport { findFirstLeafBlockId, findLastLeafBlockId } from './CommandHelpers.js';\n\n/**\n * Deletes the selected block and places cursor on a valid adjacent position.\n * If it is the only child in its parent, replaces it with an empty paragraph.\n */\nexport function deleteNodeSelection(state: EditorState, sel: NodeSelection): Transaction | null {\n\tconst path = findNodePath(state.doc, sel.nodeId);\n\tif (!path) return null;\n\n\tconst parentPath: BlockId[] = extractParentPath(path);\n\tconst siblings = getSiblings(state, parentPath);\n\n\tconst index: number = findSiblingIndex(siblings, sel.nodeId);\n\tif (index < 0) return null;\n\n\tconst builder = state.transaction('input');\n\n\t// Keep container invariants intact when removing the only child in any parent.\n\tif (siblings.length === 1) {\n\t\tconst newId = generateBlockId();\n\t\tbuilder.insertNode(parentPath, 0, createEmptyParagraph(newId));\n\t\tbuilder.removeNode(parentPath, 1);\n\t\tbuilder.setSelection(createCollapsedSelection(newId, 0));\n\t\treturn builder.build();\n\t}\n\n\tbuilder.removeNode(parentPath, index);\n\n\t// Prefer the previous sibling, matching Backspace/Delete semantics.\n\tconst prevSibling = siblings[index - 1];\n\tif (prevSibling && isBlockNode(prevSibling)) {\n\t\tconst selection = createSelectionForBlockBoundary(state, prevSibling.id, 'end');\n\t\tif (selection) {\n\t\t\tbuilder.setSelection(selection);\n\t\t\treturn builder.build();\n\t\t}\n\t}\n\n\tconst nextSibling = siblings[index + 1];\n\tif (nextSibling && isBlockNode(nextSibling)) {\n\t\tconst selection = createSelectionForBlockBoundary(state, nextSibling.id, 'start');\n\t\tif (selection) {\n\t\t\tbuilder.setSelection(selection);\n\t\t\treturn builder.build();\n\t\t}\n\t}\n\n\treturn builder.build();\n}\n\n/** Inserts a new paragraph after a NodeSelection-targeted void block. */\nexport function insertParagraphAfterNodeSelection(\n\tstate: EditorState,\n\tsel: NodeSelection,\n): Transaction | null {\n\tconst path = findNodePath(state.doc, sel.nodeId);\n\tif (!path) return null;\n\n\tconst parentPath: BlockId[] = extractParentPath(path);\n\tconst siblings = getSiblings(state, parentPath);\n\n\tconst index: number = findSiblingIndex(siblings, sel.nodeId);\n\tif (index < 0) return null;\n\n\tconst newId = generateBlockId();\n\tconst builder = state.transaction('input');\n\tbuilder.insertNode(parentPath, index + 1, createEmptyParagraph(newId));\n\tbuilder.setSelection(createCollapsedSelection(newId, 0));\n\treturn builder.build();\n}\n\n/** Inserts text in a new paragraph after a NodeSelection-targeted void block. */\nexport function insertTextAfterNodeSelection(\n\tstate: EditorState,\n\tsel: NodeSelection,\n\ttext: string,\n\torigin: 'input' | 'paste',\n): Transaction {\n\tconst path = findNodePath(state.doc, sel.nodeId);\n\tconst parentPath: BlockId[] = extractParentPath(path);\n\tconst siblings = getSiblings(state, parentPath);\n\n\tconst index: number = findSiblingIndex(siblings, sel.nodeId);\n\n\tconst newId = generateBlockId();\n\tconst builder = state.transaction(origin);\n\n\tconst insertIdx = index >= 0 ? index + 1 : siblings.length;\n\tbuilder.insertNode(parentPath, insertIdx, createEmptyParagraph(newId));\n\tbuilder.insertText(newId, 0, text, []);\n\tbuilder.setSelection(createCollapsedSelection(newId, text.length));\n\treturn builder.build();\n}\n\n/**\n * Navigates arrow keys into/out of void blocks.\n * Returns a transaction if navigation should create a NodeSelection, or null.\n *\n * @param isRtl — When true, flips left/right to account for RTL block direction.\n */\nexport function navigateArrowIntoVoid(\n\tstate: EditorState,\n\tdirection: 'left' | 'right' | 'up' | 'down',\n\tisRtl?: boolean,\n): Transaction | null {\n\tconst sel = state.selection;\n\tconst blockOrder = state.getBlockOrder();\n\tconst effectiveDir: 'left' | 'right' | 'up' | 'down' =\n\t\tisRtl && (direction === 'left' || direction === 'right')\n\t\t\t? direction === 'left'\n\t\t\t\t? 'right'\n\t\t\t\t: 'left'\n\t\t\t: direction;\n\n\t// If currently on a NodeSelection, navigate away from it\n\tif (isNodeSelection(sel)) {\n\t\treturn navigateAwayFromNodeSelection(state, sel, effectiveDir, blockOrder);\n\t}\n\n\t// GapCursor is handled by navigateFromGapCursor in CaretNavigation\n\tif (isGapCursor(sel)) return null;\n\n\t// Text selection: check if navigating into a void block\n\tif (!isCollapsed(sel)) return null;\n\n\treturn navigateIntoVoid(state, sel, effectiveDir, blockOrder);\n}\n\n// ---------------------------------------------------------------------------\n// Internal helpers\n// ---------------------------------------------------------------------------\n\n/** Handles navigation away from a NodeSelection (arrow keys while void is selected). */\nfunction navigateAwayFromNodeSelection(\n\tstate: EditorState,\n\tsel: NodeSelection,\n\tdirection: 'left' | 'right' | 'up' | 'down',\n\tblockOrder: readonly BlockId[],\n): Transaction | null {\n\tconst nodeIdx = blockOrder.indexOf(sel.nodeId);\n\tconst nodePath = (findNodePath(state.doc, sel.nodeId) ?? []) as BlockId[];\n\n\tif (direction === 'left' || direction === 'up') {\n\t\tif (nodeIdx > 0) {\n\t\t\tconst prevId = blockOrder[nodeIdx - 1];\n\t\t\tif (!prevId) return null;\n\t\t\tif (isVoidBlock(state, prevId)) {\n\t\t\t\treturn state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.setSelection(createGapCursor(sel.nodeId, 'before', nodePath))\n\t\t\t\t\t.build();\n\t\t\t}\n\t\t\tconst prevBlock = state.getBlock(prevId);\n\t\t\tconst prevLen = prevBlock ? getBlockLength(prevBlock) : 0;\n\t\t\treturn state\n\t\t\t\t.transaction('input')\n\t\t\t\t.setSelection(createCollapsedSelection(prevId, prevLen))\n\t\t\t\t.build();\n\t\t}\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.setSelection(createGapCursor(sel.nodeId, 'before', nodePath))\n\t\t\t.build();\n\t}\n\n\t// right or down\n\tif (nodeIdx < blockOrder.length - 1) {\n\t\tconst nextId = blockOrder[nodeIdx + 1];\n\t\tif (!nextId) return null;\n\t\tif (isVoidBlock(state, nextId)) {\n\t\t\treturn state\n\t\t\t\t.transaction('input')\n\t\t\t\t.setSelection(createGapCursor(sel.nodeId, 'after', nodePath))\n\t\t\t\t.build();\n\t\t}\n\t\treturn state.transaction('input').setSelection(createCollapsedSelection(nextId, 0)).build();\n\t}\n\treturn state\n\t\t.transaction('input')\n\t\t.setSelection(createGapCursor(sel.nodeId, 'after', nodePath))\n\t\t.build();\n}\n\n/** Handles text selection navigating into an adjacent void block. */\nfunction navigateIntoVoid(\n\tstate: EditorState,\n\tsel: { readonly anchor: { readonly blockId: BlockId; readonly offset: number } },\n\tdirection: 'left' | 'right' | 'up' | 'down',\n\tblockOrder: readonly BlockId[],\n): Transaction | null {\n\tconst blockIdx = blockOrder.indexOf(sel.anchor.blockId);\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return null;\n\tconst blockLen = getBlockLength(block);\n\n\tif (direction === 'right' || direction === 'down') {\n\t\tif (sel.anchor.offset === blockLen && blockIdx < blockOrder.length - 1) {\n\t\t\tconst nextId = blockOrder[blockIdx + 1];\n\t\t\tif (nextId && isVoidBlock(state, nextId)) {\n\t\t\t\tconst path = findNodePath(state.doc, nextId) ?? [];\n\t\t\t\treturn state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.setSelection(createNodeSelection(nextId, path as BlockId[]))\n\t\t\t\t\t.build();\n\t\t\t}\n\t\t}\n\t}\n\n\tif (direction === 'left' || direction === 'up') {\n\t\tif (sel.anchor.offset === 0 && blockIdx > 0) {\n\t\t\tconst prevId = blockOrder[blockIdx - 1];\n\t\t\tif (prevId && isVoidBlock(state, prevId)) {\n\t\t\t\tconst path = findNodePath(state.doc, prevId) ?? [];\n\t\t\t\treturn state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.setSelection(createNodeSelection(prevId, path as BlockId[]))\n\t\t\t\t\t.build();\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n"],"mappings":"6TAsCA,SAAgB,EAAoB,EAAoB,GACvD,MAAM,EAAO,EAAa,EAAM,IAAK,EAAI,QACzC,IAAK,EAAM,OAAO,KAElB,MAAM,EAAwB,EAAkB,GAC1C,EAAW,EAAY,EAAO,GAE9B,EAAgB,EAAiB,EAAU,EAAI,QACrD,GAAI,EAAQ,EAAG,OAAO,KAEtB,MAAM,EAAU,EAAM,YAAY,SAGlC,GAAwB,IAApB,EAAS,OAAc,CAC1B,MAAM,EAAQ,IAId,OAHA,EAAQ,WAAW,EAAY,EAAG,EAAqB,IACvD,EAAQ,WAAW,EAAY,GAC/B,EAAQ,aAAa,EAAyB,EAAO,IAC9C,EAAQ,QAGhB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AKL,IAAkB,SAAd,GAAsC,OAAd,IACD,IAAtB,EAAI,OAAO,QAAgB,EAAW,EAAG,CAC5C,MAAM,EAAS,EAAW,EAAW,GACrC,GAAI,GAAU,EAAY,EAAO,GAAS,CACzC,MAAM,EAAO,EAAa,EAAM,IAAK,IAAW,GAChD,OAAO,EACL,YAAY,SACZ,aAAa,EAAoB,EAAQ,IACzC,SAKL,OAAO,KAhGA,CAAiB,EAAO,EAAK,EAAc,GAFpB"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var t,n,r;function e(){if(void 0!==t)return t;if("undefined"==typeof navigator)return t=!1,!1;if("userAgentData"in navigator){const n=navigator.userAgentData;if(n.platform)return t=/macOS/i.test(n.platform)}return t=/Mac|iP(hone|[oa]d)/.test(navigator.platform)}function a(){return void 0!==n?n:"undefined"==typeof navigator?(n=!1,!1):n=/Firefox\//.test(navigator.userAgent)}function i(){return void 0!==r?r:"undefined"==typeof navigator?(r=!1,!1):r=/AppleWebKit\//.test(navigator.userAgent)&&!/Chrome\//.test(navigator.userAgent)}function o(t){return"rtl"===getComputedStyle(t).direction?"rtl":"ltr"}function u(t){return"rtl"===o(t)}export{i as a,u as i,a as n,e as r,o as t};
|
|
2
|
-
//# sourceMappingURL=Platform-wPvKFB9m.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Platform-wPvKFB9m.mjs","names":[],"sources":["../../src/platform/Platform.ts"],"sourcesContent":["/**\n * Platform and browser detection utilities.\n *\n * Determines the current platform (macOS/iOS) and browser engine, which\n * affects keyboard shortcut bindings and browser-specific workarounds.\n * Also provides BiDi text direction detection.\n *\n * All detection results are cached after first evaluation for performance.\n */\n\ninterface NavigatorUAData {\n\treadonly platform?: string;\n}\n\nlet cachedIsMac: boolean | undefined;\nlet cachedIsFirefox: boolean | undefined;\nlet cachedIsWebKit: boolean | undefined;\n\n/** Returns `true` when running on macOS or iOS. */\nexport function isMac(): boolean {\n\tif (cachedIsMac !== undefined) return cachedIsMac;\n\tif (typeof navigator === 'undefined') {\n\t\tcachedIsMac = false;\n\t\treturn false;\n\t}\n\tif ('userAgentData' in navigator) {\n\t\tconst uaData: NavigatorUAData = navigator.userAgentData as NavigatorUAData;\n\t\tif (uaData.platform) {\n\t\t\tcachedIsMac = /macOS/i.test(uaData.platform);\n\t\t\treturn cachedIsMac;\n\t\t}\n\t}\n\tcachedIsMac = /Mac|iP(hone|[oa]d)/.test(navigator.platform);\n\treturn cachedIsMac;\n}\n\n/**\n * Returns `true` when running on Firefox (Gecko engine).\n * Only use for genuine browser workarounds, not feature detection.\n */\nexport function isFirefox(): boolean {\n\tif (cachedIsFirefox !== undefined) return cachedIsFirefox;\n\tif (typeof navigator === 'undefined') {\n\t\tcachedIsFirefox = false;\n\t\treturn false;\n\t}\n\tcachedIsFirefox = /Firefox\\//.test(navigator.userAgent);\n\treturn cachedIsFirefox;\n}\n\n/**\n * Returns `true` when running on WebKit (Safari engine).\n * Only use for genuine browser workarounds, not feature detection.\n */\nexport function isWebKit(): boolean {\n\tif (cachedIsWebKit !== undefined) return cachedIsWebKit;\n\tif (typeof navigator === 'undefined') {\n\t\tcachedIsWebKit = false;\n\t\treturn false;\n\t}\n\tcachedIsWebKit =\n\t\t/AppleWebKit\\//.test(navigator.userAgent) && !/Chrome\\//.test(navigator.userAgent);\n\treturn cachedIsWebKit;\n}\n\n/** Returns the computed text direction of the given element. */\nexport function getTextDirection(element: HTMLElement): 'ltr' | 'rtl' {\n\tconst dir: string = getComputedStyle(element).direction;\n\treturn dir === 'rtl' ? 'rtl' : 'ltr';\n}\n\n/** Returns `true` when the element is in an RTL context (computed direction is RTL). */\nexport function isRtlContext(element: HTMLElement): boolean {\n\treturn getTextDirection(element) === 'rtl';\n}\n\n/**\n * Resets cached detection results.\n * Only intended for use in tests.\n */\nexport function resetPlatformCache(): void {\n\tcachedIsMac = undefined;\n\tcachedIsFirefox = undefined;\n\tcachedIsWebKit = undefined;\n}\n"],"mappings":"AAcA,IAAI,EACA,EACA,EAGJ,SAAgB,IACf,QAAoB,IAAhB,EAA2B,OAAO,EACtC,GAAyB,oBAAd,UAEV,OADA,GAAc,GACP,EAER,GAAI,kBAAmB,UAAW,CACjC,MAAM,EAA0B,UAAU,cAC1C,GAAI,EAAO,SAEV,OADA,EAAc,SAAS,KAAK,EAAO,UAKrC,OADA,EAAc,qBAAqB,KAAK,UAAU,UAQnD,SAAgB,IACf,YAAwB,IAApB,EAAsC,EACjB,oBAAd,WACV,GAAkB,GACX,GAER,EAAkB,YAAY,KAAK,UAAU,WAQ9C,SAAgB,IACf,YAAuB,IAAnB,EAAqC,EAChB,oBAAd,WACV,GAAiB,GACV,GAER,EACC,gBAAgB,KAAK,UAAU,aAAe,WAAW,KAAK,UAAU,WAK1E,SAAgB,EAAiB,GAEhC,MAAe,QADK,iBAAiB,GAAS,UACvB,MAAQ,MAIhC,SAAgB,EAAa,GAC5B,MAAqC,QAA9B,EAAiB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin-C4cBw3bs.mjs","names":[],"sources":["../../src/plugins/Plugin.ts"],"sourcesContent":["/**\n * Plugin system types for the Notectl editor.\n */\n\nimport type { DecorationSet } from '../decorations/Decoration.js';\nimport type { FileHandler } from '../model/FileHandlerRegistry.js';\nimport type { FileHandlerRegistry } from '../model/FileHandlerRegistry.js';\nimport type { InlineNodeSpec } from '../model/InlineNodeSpec.js';\nimport type { InputRule } from '../model/InputRule.js';\nimport type { InputRuleRegistry } from '../model/InputRuleRegistry.js';\nimport type { Keymap, KeymapOptions } from '../model/Keymap.js';\nimport type { KeymapRegistry } from '../model/KeymapRegistry.js';\nimport type { MarkSpec } from '../model/MarkSpec.js';\nimport type { NodeSpec } from '../model/NodeSpec.js';\nimport type { SchemaRegistry } from '../model/SchemaRegistry.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport type { NodeViewFactory } from '../view/NodeView.js';\nimport type { NodeViewRegistry } from '../view/NodeViewRegistry.js';\nimport type { BlockTypePickerEntry } from './heading/BlockTypePickerEntry.js';\nimport type { BlockTypePickerRegistry } from './heading/BlockTypePickerRegistry.js';\nimport type { ToolbarItem } from './toolbar/ToolbarItem.js';\nimport type { ToolbarRegistry } from './toolbar/ToolbarRegistry.js';\n\n// --- Type-Safe Keys ---\n\n/** Type-safe event key for compile-time payload checking. */\nexport class EventKey<T> {\n\tdeclare readonly _type: T;\n\tconstructor(public readonly id: string) {}\n}\n\n/** Type-safe service key for compile-time type checking. */\nexport class ServiceKey<T> {\n\tdeclare readonly _type: T;\n\tconstructor(public readonly id: string) {}\n}\n\n// --- Command System ---\n\nexport type CommandHandler = () => boolean;\n\nexport interface CommandOptions {\n\t/** When true, the command may execute even if the editor is in read-only mode. */\n\treadonly readonlyAllowed?: boolean;\n}\n\nexport interface CommandEntry {\n\treadonly name: string;\n\treadonly handler: CommandHandler;\n\treadonly pluginId: string;\n\treadonly readonlyAllowed: boolean;\n}\n\n// --- Event System ---\n\nexport type PluginEventCallback<T = unknown> = (payload: T) => void;\n\nexport interface PluginEventBus {\n\temit<T>(key: EventKey<T>, payload: T): void;\n\ton<T>(key: EventKey<T>, callback: PluginEventCallback<T>): () => void;\n\toff<T>(key: EventKey<T>, callback: PluginEventCallback<T>): void;\n}\n\n// --- Configuration ---\n\nexport type PluginConfig = Record<string, unknown>;\n\n// --- Middleware ---\n\nexport type MiddlewareNext = (tr: Transaction) => void;\nexport type TransactionMiddleware = (\n\ttr: Transaction,\n\tstate: EditorState,\n\tnext: MiddlewareNext,\n) => void;\n\nexport interface MiddlewareOptions {\n\t/** Human-readable name for debugging and introspection. */\n\treadonly name?: string;\n\t/** Execution priority (lower values run first). Defaults to 100. */\n\treadonly priority?: number;\n}\n\n// --- Paste Interceptors (re-exported from model for backward compatibility) ---\n\nimport type { PasteInterceptor, PasteInterceptorOptions } from '../model/PasteInterceptor.js';\nexport type { PasteInterceptor, PasteInterceptorOptions } from '../model/PasteInterceptor.js';\n\n// --- Plugin Context ---\n\nexport interface PluginContext {\n\tgetState(): EditorState;\n\tdispatch(transaction: Transaction): void;\n\tgetContainer(): HTMLElement;\n\tgetPluginContainer(position: 'top' | 'bottom'): HTMLElement;\n\tregisterCommand(name: string, handler: CommandHandler, options?: CommandOptions): void;\n\texecuteCommand(name: string): boolean;\n\tgetEventBus(): PluginEventBus;\n\tregisterMiddleware(middleware: TransactionMiddleware, options?: MiddlewareOptions): void;\n\tregisterService<T>(key: ServiceKey<T>, service: T): void;\n\tgetService<T>(key: ServiceKey<T>): T | undefined;\n\tupdateConfig(config: PluginConfig): void;\n\n\t// --- Schema Extension ---\n\tregisterNodeSpec<T extends string>(spec: NodeSpec<T>): void;\n\tregisterMarkSpec<T extends string>(spec: MarkSpec<T>): void;\n\tregisterNodeView(type: string, factory: NodeViewFactory): void;\n\tregisterKeymap(keymap: Keymap, options?: KeymapOptions): void;\n\tregisterInputRule(rule: InputRule): void;\n\tregisterToolbarItem(item: ToolbarItem): void;\n\tregisterInlineNodeSpec<T extends string>(spec: InlineNodeSpec<T>): void;\n\tregisterFileHandler(pattern: string, handler: FileHandler): void;\n\tregisterBlockTypePickerEntry(entry: BlockTypePickerEntry): void;\n\tregisterPasteInterceptor(interceptor: PasteInterceptor, options?: PasteInterceptorOptions): void;\n\tgetSchemaRegistry(): SchemaRegistry;\n\tgetKeymapRegistry(): KeymapRegistry;\n\tgetInputRuleRegistry(): InputRuleRegistry;\n\tgetFileHandlerRegistry(): FileHandlerRegistry;\n\tgetNodeViewRegistry(): NodeViewRegistry;\n\tgetToolbarRegistry(): ToolbarRegistry;\n\tgetBlockTypePickerRegistry(): BlockTypePickerRegistry;\n\n\t/** Registers a CSS string to be added to the editor's adopted stylesheets. */\n\tregisterStyleSheet(css: string): void;\n\n\t/** Returns whether the editor is currently in read-only mode. */\n\tisReadOnly(): boolean;\n\n\t/** Pushes a screen reader announcement via the editor's aria-live region. */\n\tannounce(text: string): void;\n\n\t/** Returns whether the announcer live region currently has content. */\n\thasAnnouncement(): boolean;\n}\n\n// --- Plugin Interface ---\n\nexport interface Plugin<TConfig extends Record<string, unknown> = Record<string, unknown>> {\n\treadonly id: string;\n\treadonly name: string;\n\treadonly priority?: number;\n\treadonly dependencies?: readonly string[];\n\n\tinit(context: PluginContext): void | Promise<void>;\n\tdestroy?(): void | Promise<void>;\n\tonStateChange?(oldState: EditorState, newState: EditorState, tr: Transaction): void;\n\tonConfigure?(config: TConfig): void;\n\t/** Called after ALL plugins have been initialized. */\n\tonReady?(): void | Promise<void>;\n\t/** Called when the editor's read-only mode changes. */\n\tonReadOnlyChange?(readonly: boolean): void;\n\t/**\n\t * Returns decorations for the given state.\n\t * Called after state.apply() but BEFORE reconciliation.\n\t * Plugins should cache and only recompute when needed.\n\t */\n\tdecorations?(state: EditorState, tr?: Transaction): DecorationSet;\n}\n"],"mappings":"AA2BA,IAAa,EAAb,MAEC,WAAA,CAAY,GAAgB,KAAA,GAAA,IAIhB,EAAb,MAEC,WAAA,CAAY,GAAgB,KAAA,GAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{l as e,u as o}from"./Selection-B14e7gd0.mjs";import{n}from"./Plugin-C4cBw3bs.mjs";var t=class{resolvedLocale;constructor(e){this.resolvedLocale="browser"===e?"undefined"!=typeof navigator?navigator.language.split("-")[0]??"en":"en":e}getLocale(){return this.resolvedLocale}},r=new n("locale");function s(e){return e.charAt(0).toUpperCase()+e.slice(1)}function a(e){return`toggle${s(e)}`}async function c(e,o,n,t){if(o)return o;const s=e.getService(r)?.getLocale()??"en";return"en"===s?n:t(s)}function l(n){const t=n.selection;return e(t)?n.getBlock(t.nodeId):o(t)?n.getBlock(t.anchor.blockId):void 0}function i(n){const t=n.selection;return e(t)?t.nodeId:o(t)?t.anchor.blockId:void 0}export{a,c as i,l as n,t as o,i as r,r as s,s as t};
|
|
2
|
-
//# sourceMappingURL=PluginHelpers-BZU5rE44.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginHelpers-BZU5rE44.mjs","names":[],"sources":["../../src/i18n/LocaleService.ts","../../src/plugins/shared/PluginHelpers.ts"],"sourcesContent":["/**\n * Global locale service that resolves the active language.\n * Registered as a system-level service before plugin init.\n */\n\nimport { ServiceKey } from '../plugins/Plugin.js';\n\nexport class LocaleService {\n\tprivate readonly resolvedLocale: string;\n\n\tconstructor(locale: string) {\n\t\tthis.resolvedLocale =\n\t\t\tlocale === 'browser'\n\t\t\t\t? typeof navigator !== 'undefined'\n\t\t\t\t\t? (navigator.language.split('-')[0] ?? 'en')\n\t\t\t\t\t: 'en'\n\t\t\t\t: locale;\n\t}\n\n\tgetLocale(): string {\n\t\treturn this.resolvedLocale;\n\t}\n}\n\nexport const LocaleServiceKey = new ServiceKey<LocaleService>('locale');\n","/**\n * Shared helper utilities for plugins.\n * Common operations extracted to avoid code duplication across plugins.\n */\n\nimport { LocaleServiceKey } from '../../i18n/LocaleService.js';\nimport type { BlockNode } from '../../model/Document.js';\nimport { isNodeSelection, isTextSelection } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\n\n/** Capitalizes the first character of a string. */\nexport function capitalize(s: string): string {\n\treturn s.charAt(0).toUpperCase() + s.slice(1);\n}\n\n/** Converts a mark type to its toggle command name (e.g. 'bold' → 'toggleBold'). */\nexport function toCommandName(markType: string): string {\n\treturn `toggle${capitalize(markType)}`;\n}\n\n/**\n * Resolves the locale for a plugin, using config override, default, or dynamic loader.\n * Plugins provide their config locale, a default English locale, and a loader for other languages.\n */\nexport async function resolveLocale<T>(\n\tcontext: PluginContext,\n\tconfigLocale: T | undefined,\n\tdefaultLocale: T,\n\tloader: (lang: string) => Promise<T>,\n): Promise<T> {\n\tif (configLocale) return configLocale;\n\tconst service = context.getService(LocaleServiceKey);\n\tconst lang: string = service?.getLocale() ?? 'en';\n\treturn lang === 'en' ? defaultLocale : loader(lang);\n}\n\n/** Returns the block under the cursor, handling both TextSelection and NodeSelection. */\nexport function getSelectedBlock(state: EditorState): BlockNode | undefined {\n\tconst sel = state.selection;\n\tif (isNodeSelection(sel)) return state.getBlock(sel.nodeId);\n\tif (isTextSelection(sel)) return state.getBlock(sel.anchor.blockId);\n\treturn undefined;\n}\n\n/** Returns the block ID under the cursor, handling both TextSelection and NodeSelection. */\nexport function getSelectedBlockId(state: EditorState): BlockId | undefined {\n\tconst sel = state.selection;\n\tif (isNodeSelection(sel)) return sel.nodeId;\n\tif (isTextSelection(sel)) return sel.anchor.blockId;\n\treturn undefined;\n}\n"],"mappings":"yFAOA,IAAa,EAAb,MACC,eAEA,WAAA,CAAY,GACX,KAAK,eACO,YAAX,EACwB,oBAAd,UACL,UAAU,SAAS,MAAM,KAAK,IAAM,KACrC,KACD,EAGL,SAAA,GACC,OAAO,KAAK,iBAID,EAAmB,IAAI,EAA0B,UCX9D,SAAgB,EAAW,GAC1B,OAAO,EAAE,OAAO,GAAG,cAAgB,EAAE,MAAM,GAI5C,SAAgB,EAAc,GAC7B,MAAO,SAAS,EAAW,KAO5B,eAAsB,EACrB,EACA,EACA,EACA,GAEA,GAAI,EAAc,OAAO,EAEzB,MAAM,EADU,EAAQ,WAAW,IACL,aAAe,KAC7C,MAAgB,OAAT,EAAgB,EAAgB,EAAO,GAI/C,SAAgB,EAAiB,GAChC,MAAM,EAAM,EAAM,UAClB,OAAI,EAAgB,GAAa,EAAM,SAAS,EAAI,QAChD,EAAgB,GAAa,EAAM,SAAS,EAAI,OAAO,cAA3D,EAKD,SAAgB,EAAmB,GAClC,MAAM,EAAM,EAAM,UAClB,OAAI,EAAgB,GAAa,EAAI,OACjC,EAAgB,GAAa,EAAI,OAAO,aAA5C"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./Platform-wPvKFB9m.mjs";import{n as t}from"./Plugin-C4cBw3bs.mjs";import{r as s,t as n}from"./PopupPositioning-BdSCai19.mjs";var o=new t("popup"),r=class{stack=[];referenceNode;constructor(e){this.referenceNode=e}open(e){const t=document.createElement("div");t.className=e.className?`notectl-popup ${e.className}`:"notectl-popup",e.ariaRole&&t.setAttribute("role",e.ariaRole),e.ariaLabel&&t.setAttribute("aria-label",e.ariaLabel);const o=e.parent?this.findEntryByHandle(e.parent):null;let r;const i={close:e=>this.closeEntry(r,e),getElement:()=>t},c=s=>{const n=s.composedPath();if(!n.includes(t)){for(const e of this.stack)if(n.includes(e.element))return;e.anchor instanceof HTMLElement&&n.includes(e.anchor)||this.closeEntry(r)}};r={element:t,config:e,clickOutsideHandler:c,parent:o,listenerRegistrationTimer:null,documentListenerAttached:!1},this.stack.push(r);try{e.content(t,e=>this.closeEntry(r,e))}catch(l){throw this.removeEntry(r),l}return this.stack.includes(r)?(n(t,e.referenceNode??this.referenceNode),s(t,e.anchor instanceof HTMLElement?e.anchor.getBoundingClientRect():e.anchor,{position:e.position??"below-start",isRtl:this.isRtlContext()}),r.listenerRegistrationTimer=setTimeout(()=>{r.listenerRegistrationTimer=null,this.stack.includes(r)&&(document.addEventListener("mousedown",c),r.documentListenerAttached=!0)},0),this.focusFirstItem(t),i):i}close(){const e=this.stack[this.stack.length-1];e&&this.closeEntry(e)}closeAll(){for(;this.stack.length>0;){const e=this.stack[this.stack.length-1];e&&this.closeEntry(e)}}isOpen(){return this.stack.length>0}destroy(){this.closeAll()}closeEntry(e,t){const s=this.stack.indexOf(e);if(-1!==s){for(;this.stack.length>s+1;){const e=this.stack[this.stack.length-1];e&&this.removeEntry(e)}this.removeEntry(e),void 0!==t&&"restoreFocusTo"in t?t.restoreFocusTo?.focus():e.config.restoreFocusTo&&e.config.restoreFocusTo.focus(),e.config.onClose?.()}}removeEntry(e){const t=this.stack.indexOf(e);-1!==t&&(this.stack.splice(t,1),null!==e.listenerRegistrationTimer&&(clearTimeout(e.listenerRegistrationTimer),e.listenerRegistrationTimer=null),e.element.remove(),e.documentListenerAttached&&(document.removeEventListener("mousedown",e.clickOutsideHandler),e.documentListenerAttached=!1))}findEntryByHandle(e){const t=e.getElement();return this.stack.find(e=>e.element===t)??null}isRtlContext(){return this.referenceNode instanceof HTMLElement&&e(this.referenceNode)}focusFirstItem(e){requestAnimationFrame(()=>{(e.querySelector('[role="menuitem"]')??e.querySelector('[role="option"]')??e.querySelector('[role="gridcell"]')??e.querySelector("input")??e.querySelector("button"))?.focus()})}};export{o as n,r as t};
|
|
2
|
-
//# sourceMappingURL=PopupManager-S2qQtTxR.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PopupManager-S2qQtTxR.mjs","names":[],"sources":["../../src/plugins/shared/PopupManager.ts"],"sourcesContent":["/**\n * Central popup lifecycle manager. Handles creation, positioning,\n * click-outside closing, Escape key, focus restoration, and popup stacking\n * for submenus/nested popups.\n */\n\nimport { isRtlContext } from '../../platform/Platform.js';\nimport { ServiceKey } from '../Plugin.js';\nimport { type PopupPosition, appendToRoot, positionPopup } from './PopupPositioning.js';\n\n// --- Types ---\n\n/** Options for overriding focus restoration when closing a popup. */\nexport interface PopupCloseOptions {\n\t/**\n\t * Override the default focus target on close.\n\t * - `HTMLElement` → focus that element instead of `config.restoreFocusTo`\n\t * - `null` → skip focus restoration entirely\n\t * - `undefined` / omitted → use default `config.restoreFocusTo`\n\t */\n\treadonly restoreFocusTo?: HTMLElement | null;\n}\n\nexport interface PopupConfig {\n\treadonly anchor: HTMLElement | DOMRect;\n\treadonly content: (container: HTMLElement, close: (options?: PopupCloseOptions) => void) => void;\n\treadonly className?: string;\n\treadonly ariaRole?: 'menu' | 'listbox' | 'grid' | 'dialog';\n\treadonly ariaLabel?: string;\n\treadonly restoreFocusTo?: HTMLElement;\n\treadonly onClose?: () => void;\n\treadonly position?: PopupPosition;\n\treadonly parent?: PopupHandle;\n\treadonly referenceNode?: Node;\n}\n\nexport interface PopupHandle {\n\tclose(options?: PopupCloseOptions): void;\n\tgetElement(): HTMLElement;\n}\n\nexport interface PopupServiceAPI {\n\topen(config: PopupConfig): PopupHandle;\n\tclose(): void;\n\tcloseAll(): void;\n\tisOpen(): boolean;\n}\n\nexport const PopupServiceKey = new ServiceKey<PopupServiceAPI>('popup');\n\n// --- Internal Entry ---\n\ninterface PopupEntry {\n\treadonly element: HTMLElement;\n\treadonly config: PopupConfig;\n\treadonly clickOutsideHandler: (e: MouseEvent) => void;\n\treadonly parent: PopupEntry | null;\n\tlistenerRegistrationTimer: ReturnType<typeof setTimeout> | null;\n\tdocumentListenerAttached: boolean;\n}\n\n// --- Manager ---\n\nexport class PopupManager implements PopupServiceAPI {\n\tprivate readonly stack: PopupEntry[] = [];\n\tprivate readonly referenceNode: Node;\n\n\tconstructor(referenceNode: Node) {\n\t\tthis.referenceNode = referenceNode;\n\t}\n\n\t/** Opens a popup with the given configuration. Returns a handle for closing it. */\n\topen(config: PopupConfig): PopupHandle {\n\t\tconst popup: HTMLDivElement = document.createElement('div');\n\t\tpopup.className = config.className ? `notectl-popup ${config.className}` : 'notectl-popup';\n\n\t\tif (config.ariaRole) {\n\t\t\tpopup.setAttribute('role', config.ariaRole);\n\t\t}\n\t\tif (config.ariaLabel) {\n\t\t\tpopup.setAttribute('aria-label', config.ariaLabel);\n\t\t}\n\n\t\tconst parentEntry: PopupEntry | null = config.parent\n\t\t\t? this.findEntryByHandle(config.parent)\n\t\t\t: null;\n\n\t\tlet entry!: PopupEntry;\n\t\tconst handle: PopupHandle = {\n\t\t\tclose: (options?: PopupCloseOptions) => this.closeEntry(entry, options),\n\t\t\tgetElement: () => popup,\n\t\t};\n\n\t\tconst clickOutsideHandler = (e: MouseEvent): void => {\n\t\t\tconst path: EventTarget[] = e.composedPath();\n\t\t\tif (path.includes(popup)) return;\n\n\t\t\t// Don't close if click is inside any ancestor popup in the stack\n\t\t\tfor (const stackEntry of this.stack) {\n\t\t\t\tif (path.includes(stackEntry.element)) return;\n\t\t\t}\n\n\t\t\t// Don't close if click is on the anchor element\n\t\t\tif (config.anchor instanceof HTMLElement && path.includes(config.anchor)) return;\n\n\t\t\tthis.closeEntry(entry);\n\t\t};\n\n\t\tentry = {\n\t\t\telement: popup,\n\t\t\tconfig,\n\t\t\tclickOutsideHandler,\n\t\t\tparent: parentEntry,\n\t\t\tlistenerRegistrationTimer: null,\n\t\t\tdocumentListenerAttached: false,\n\t\t};\n\n\t\tthis.stack.push(entry);\n\n\t\ttry {\n\t\t\tconfig.content(popup, (options?: PopupCloseOptions) => this.closeEntry(entry, options));\n\t\t} catch (error) {\n\t\t\tthis.removeEntry(entry);\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!this.stack.includes(entry)) {\n\t\t\treturn handle;\n\t\t}\n\n\t\tconst refNode: Node = config.referenceNode ?? this.referenceNode;\n\t\tappendToRoot(popup, refNode);\n\n\t\tconst anchorRect: DOMRect =\n\t\t\tconfig.anchor instanceof HTMLElement ? config.anchor.getBoundingClientRect() : config.anchor;\n\t\tpositionPopup(popup, anchorRect, {\n\t\t\tposition: config.position ?? 'below-start',\n\t\t\tisRtl: this.isRtlContext(),\n\t\t});\n\n\t\tentry.listenerRegistrationTimer = setTimeout(() => {\n\t\t\tentry.listenerRegistrationTimer = null;\n\t\t\tif (!this.stack.includes(entry)) return;\n\t\t\tdocument.addEventListener('mousedown', clickOutsideHandler);\n\t\t\tentry.documentListenerAttached = true;\n\t\t}, 0);\n\n\t\tthis.focusFirstItem(popup);\n\n\t\treturn handle;\n\t}\n\n\t/** Closes the topmost popup in the stack. */\n\tclose(): void {\n\t\tconst top: PopupEntry | undefined = this.stack[this.stack.length - 1];\n\t\tif (top) {\n\t\t\tthis.closeEntry(top);\n\t\t}\n\t}\n\n\t/** Closes all open popups. */\n\tcloseAll(): void {\n\t\twhile (this.stack.length > 0) {\n\t\t\tconst top: PopupEntry | undefined = this.stack[this.stack.length - 1];\n\t\t\tif (top) {\n\t\t\t\tthis.closeEntry(top);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Returns true if any popup is currently open. */\n\tisOpen(): boolean {\n\t\treturn this.stack.length > 0;\n\t}\n\n\t/** Cleans up all popups and event listeners. */\n\tdestroy(): void {\n\t\tthis.closeAll();\n\t}\n\n\t// --- Internal ---\n\n\tprivate closeEntry(entry: PopupEntry, options?: PopupCloseOptions): void {\n\t\tconst index: number = this.stack.indexOf(entry);\n\t\tif (index === -1) return;\n\n\t\t// Close all child popups first (anything above this entry in the stack)\n\t\twhile (this.stack.length > index + 1) {\n\t\t\tconst child: PopupEntry | undefined = this.stack[this.stack.length - 1];\n\t\t\tif (child) {\n\t\t\t\tthis.removeEntry(child);\n\t\t\t}\n\t\t}\n\n\t\tthis.removeEntry(entry);\n\n\t\tif (options !== undefined && 'restoreFocusTo' in options) {\n\t\t\toptions.restoreFocusTo?.focus();\n\t\t} else if (entry.config.restoreFocusTo) {\n\t\t\tentry.config.restoreFocusTo.focus();\n\t\t}\n\t\tentry.config.onClose?.();\n\t}\n\n\tprivate removeEntry(entry: PopupEntry): void {\n\t\tconst index: number = this.stack.indexOf(entry);\n\t\tif (index === -1) return;\n\n\t\tthis.stack.splice(index, 1);\n\t\tif (entry.listenerRegistrationTimer !== null) {\n\t\t\tclearTimeout(entry.listenerRegistrationTimer);\n\t\t\tentry.listenerRegistrationTimer = null;\n\t\t}\n\t\tentry.element.remove();\n\t\tif (entry.documentListenerAttached) {\n\t\t\tdocument.removeEventListener('mousedown', entry.clickOutsideHandler);\n\t\t\tentry.documentListenerAttached = false;\n\t\t}\n\t}\n\n\tprivate findEntryByHandle(handle: PopupHandle): PopupEntry | null {\n\t\tconst element: HTMLElement = handle.getElement();\n\t\treturn this.stack.find((e) => e.element === element) ?? null;\n\t}\n\n\t/** Detects whether the editor context is RTL from the computed style. */\n\tprivate isRtlContext(): boolean {\n\t\tif (this.referenceNode instanceof HTMLElement) {\n\t\t\treturn isRtlContext(this.referenceNode);\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate focusFirstItem(popup: HTMLElement): void {\n\t\trequestAnimationFrame(() => {\n\t\t\tconst firstFocusable: HTMLElement | null =\n\t\t\t\tpopup.querySelector('[role=\"menuitem\"]') ??\n\t\t\t\tpopup.querySelector('[role=\"option\"]') ??\n\t\t\t\tpopup.querySelector('[role=\"gridcell\"]') ??\n\t\t\t\tpopup.querySelector('input') ??\n\t\t\t\tpopup.querySelector('button');\n\t\t\tfirstFocusable?.focus();\n\t\t});\n\t}\n}\n"],"mappings":"iJAgDA,IAAa,EAAkB,IAAI,EAA4B,SAelD,EAAb,MACC,MAAuC,GACvC,cAEA,WAAA,CAAY,GACX,KAAK,cAAgB,EAItB,IAAA,CAAK,GACJ,MAAM,EAAwB,SAAS,cAAc,OACrD,EAAM,UAAY,EAAO,UAAY,iBAAiB,EAAO,YAAc,gBAEvE,EAAO,UACV,EAAM,aAAa,OAAQ,EAAO,UAE/B,EAAO,WACV,EAAM,aAAa,aAAc,EAAO,WAGzC,MAAM,EAAiC,EAAO,OAC3C,KAAK,kBAAkB,EAAO,QAC9B,KAEH,IAAI,EACJ,MAAM,EAAsB,CAC3B,MAAQ,GAAgC,KAAK,WAAW,EAAO,GAC/D,WAAA,IAAkB,GAGb,EAAuB,IAC5B,MAAM,EAAsB,EAAE,eAC9B,IAAI,EAAK,SAAS,GAAlB,CAGA,IAAK,MAAM,KAAc,KAAK,MAC7B,GAAI,EAAK,SAAS,EAAW,SAAU,OAIpC,EAAO,kBAAkB,aAAe,EAAK,SAAS,EAAO,SAEjE,KAAK,WAAW,EAVU,GAa3B,EAAQ,CACP,QAAS,EACT,SACA,sBACA,OAAQ,EACR,0BAA2B,KAC3B,0BAA0B,GAG3B,KAAK,MAAM,KAAK,GAEhB,IACC,EAAO,QAAQ,EAAQ,GAAgC,KAAK,WAAW,EAAO,UACtE,GAER,MADA,KAAK,YAAY,GACX,EAGP,OAAK,KAAK,MAAM,SAAS,IAKzB,EAAa,EADS,EAAO,eAAiB,KAAK,eAKnD,EAAc,EADb,EAAO,kBAAkB,YAAc,EAAO,OAAO,wBAA0B,EAAO,OACtD,CAChC,SAAU,EAAO,UAAY,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MAEE,EAAM,cAAc,sBACpB,EAAM,cAAc,oBACpB,EAAM,cAAc,sBACpB,EAAM,cAAc,UACpB,EAAM,cAAc,YACL"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o as t}from"./StyleRuntime-Bwde5icB.mjs";function e(t){const e=t.style.top,o=t.style.left,i=t.style.right;t.style.top="0px",t.style.left="0px",t.style.right="auto";const l=t.getBoundingClientRect(),n=l.left,s=l.top;t.style.left="auto",t.style.right="0px";const p=t.getBoundingClientRect(),r=window.innerWidth-p.right;return t.style.top=e,t.style.left=o,t.style.right=i,{x:n,y:s,rightX:r}}function o(o,i,l){const n=l.offset??2,s=window.innerWidth,p=window.innerHeight;t(o,{position:"fixed",zIndex:"10000"});const r=e(o),f=o.offsetWidth,h=o.offsetHeight,g={};switch(l.position){case"below-start":{let t=i.bottom+n;if(l.isRtl){let e=s-i.right;e+f>s-4&&(e=s-f-4),t+h>p-4&&(t=i.top-h-n),e<4&&(e=4),t<4&&(t=4),g.top=t-r.y+"px",g.right=e-r.rightX+"px",g.left="auto"}else{let e=i.left;e+f>s-4&&(e=s-f-4),t+h>p-4&&(t=i.top-h-n),e<4&&(e=4),t<4&&(t=4),g.top=t-r.y+"px",g.left=e-r.x+"px",g.right="auto"}break}case"below-end":{let t=i.bottom+n;if(l.isRtl){let e=i.left;e+f>s-4&&(e=s-f-4),t+h>p-4&&(t=i.top-h-n),e<4&&(e=4),t<4&&(t=4),g.top=t-r.y+"px",g.left=e-r.x+"px",g.right="auto"}else{let e=s-i.right;e+f>s-4&&(e=s-f-4),t+h>p-4&&(t=i.top-h-n),e<4&&(e=4),t<4&&(t=4),g.top=t-r.y+"px",g.right=e-r.rightX+"px",g.left="auto"}break}case"right":{let t=i.top;if(l.isRtl){let e=i.left-f-n;e<4&&(e=i.right+n),t+h>p-4&&(t=p-h-4),e<4&&(e=4),t<4&&(t=4),g.top=t-r.y+"px",g.left=e-r.x+"px",g.right="auto"}else{let e=i.right+n;e+f>s-4&&(e=i.left-f-n),t+h>p-4&&(t=p-h-4),e<4&&(e=4),t<4&&(t=4),g.top=t-r.y+"px",g.left=e-r.x+"px",g.right="auto"}break}}t(o,g)}function i(t,e){const o=e.getRootNode();o instanceof ShadowRoot?o.appendChild(t):document.body.appendChild(t)}export{e as n,o as r,i as t};
|
|
2
|
-
//# sourceMappingURL=PopupPositioning-BdSCai19.mjs.map
|