@notectl/core 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/AlignmentPlugin-CjmLXGsv.mjs +2 -0
- package/dist/chunks/AlignmentPlugin-CjmLXGsv.mjs.map +1 -0
- package/dist/chunks/AttrRegistry-cXq6uQK2.mjs +2 -0
- package/dist/chunks/AttrRegistry-cXq6uQK2.mjs.map +1 -0
- package/dist/chunks/AttributedMarkCommands-Ctt_1xRD.mjs +2 -0
- package/dist/chunks/AttributedMarkCommands-Ctt_1xRD.mjs.map +1 -0
- package/dist/chunks/BidiIsolationPlugin-q3zoofgZ.mjs +2 -0
- package/dist/chunks/BidiIsolationPlugin-q3zoofgZ.mjs.map +1 -0
- package/dist/chunks/BlockInsertion-4QmiYRMo.mjs +2 -0
- package/dist/chunks/BlockInsertion-4QmiYRMo.mjs.map +1 -0
- package/dist/chunks/BlockTypePickerRegistry-DgI_LlNO.mjs +2 -0
- package/dist/chunks/BlockTypePickerRegistry-DgI_LlNO.mjs.map +1 -0
- package/dist/chunks/BlockquotePlugin-BTsDYB3K.mjs +2 -0
- package/dist/chunks/BlockquotePlugin-BTsDYB3K.mjs.map +1 -0
- package/dist/chunks/CaretNavigationPlugin-BFBov4H7.mjs +2 -0
- package/dist/chunks/CaretNavigationPlugin-BFBov4H7.mjs.map +1 -0
- package/dist/chunks/CodeBlockPlugin-o0Aoq9Nu.mjs +2 -0
- package/dist/chunks/CodeBlockPlugin-o0Aoq9Nu.mjs.map +1 -0
- package/dist/chunks/ColorGrid-U5NtjqyV.mjs +2 -0
- package/dist/chunks/ColorGrid-U5NtjqyV.mjs.map +1 -0
- package/dist/chunks/ColorPickerPopup-BYSMUZZx.mjs +2 -0
- package/dist/chunks/ColorPickerPopup-BYSMUZZx.mjs.map +1 -0
- package/dist/chunks/ColorValidation-3viVw_tK.mjs +2 -0
- package/dist/chunks/ColorValidation-3viVw_tK.mjs.map +1 -0
- package/dist/chunks/CommandHelpers-BqHfwW7i.mjs +2 -0
- package/dist/chunks/CommandHelpers-BqHfwW7i.mjs.map +1 -0
- package/dist/chunks/Commands-BC_EPIEx.mjs +2 -0
- package/dist/chunks/Commands-BC_EPIEx.mjs.map +1 -0
- package/dist/chunks/Decoration-BeTkTHRO.mjs +2 -0
- package/dist/chunks/Decoration-BeTkTHRO.mjs.map +1 -0
- package/dist/chunks/DirectionDetection-kAewerPz.mjs +2 -0
- package/dist/chunks/DirectionDetection-kAewerPz.mjs.map +1 -0
- package/dist/chunks/DirectionIcons-BQHHAEYU.mjs +2 -0
- package/dist/chunks/DirectionIcons-BQHHAEYU.mjs.map +1 -0
- package/dist/chunks/Document-DJmYYuBx.mjs +2 -0
- package/dist/chunks/Document-DJmYYuBx.mjs.map +1 -0
- package/dist/chunks/DocumentParser-D2hn-48i.mjs +2 -0
- package/dist/chunks/DocumentParser-D2hn-48i.mjs.map +1 -0
- package/dist/chunks/FontPlugin-TmUrcVn1.mjs +2 -0
- package/dist/chunks/FontPlugin-TmUrcVn1.mjs.map +1 -0
- package/dist/chunks/FontSizePlugin-Bwui7gLI.mjs +2 -0
- package/dist/chunks/FontSizePlugin-Bwui7gLI.mjs.map +1 -0
- package/dist/chunks/GapCursorNavigation-BEO5L2-O.mjs +2 -0
- package/dist/chunks/GapCursorNavigation-BEO5L2-O.mjs.map +1 -0
- package/dist/chunks/GapCursorPlugin-BiZQyVrJ.mjs +2 -0
- package/dist/chunks/GapCursorPlugin-BiZQyVrJ.mjs.map +1 -0
- package/dist/chunks/HardBreakPlugin-Dj4pkSk-.mjs +2 -0
- package/dist/chunks/HardBreakPlugin-Dj4pkSk-.mjs.map +1 -0
- package/dist/chunks/HeadingPlugin-D8xIRk25.mjs +2 -0
- package/dist/chunks/HeadingPlugin-D8xIRk25.mjs.map +1 -0
- package/dist/chunks/HighlightPlugin-CNX7lup0.mjs +2 -0
- package/dist/chunks/HighlightPlugin-CNX7lup0.mjs.map +1 -0
- package/dist/chunks/HorizontalRulePlugin-D-ZjKGDv.mjs +2 -0
- package/dist/chunks/HorizontalRulePlugin-D-ZjKGDv.mjs.map +1 -0
- package/dist/chunks/ImagePlugin-DwL8i3pO.mjs +2 -0
- package/dist/chunks/ImagePlugin-DwL8i3pO.mjs.map +1 -0
- package/dist/chunks/InlineCodePlugin-BpXNuKAa.mjs +2 -0
- package/dist/chunks/InlineCodePlugin-BpXNuKAa.mjs.map +1 -0
- package/dist/chunks/KeyboardNav-BZIHDPDV.mjs +2 -0
- package/dist/chunks/KeyboardNav-BZIHDPDV.mjs.map +1 -0
- package/dist/chunks/LinkPlugin-BK15pc0u.mjs +2 -0
- package/dist/chunks/LinkPlugin-BK15pc0u.mjs.map +1 -0
- package/dist/chunks/ListPlugin-B5ihlVNx.mjs +2 -0
- package/dist/chunks/ListPlugin-B5ihlVNx.mjs.map +1 -0
- package/dist/chunks/NavigationQueries-DhptdQBe.mjs +2 -0
- package/dist/chunks/NavigationQueries-DhptdQBe.mjs.map +1 -0
- package/dist/chunks/NodeSelectionCommands-DenSYOfB.mjs +2 -0
- package/dist/chunks/NodeSelectionCommands-DenSYOfB.mjs.map +1 -0
- package/dist/chunks/PluginHelpers-BZphovwz.mjs +2 -0
- package/dist/chunks/PluginHelpers-BZphovwz.mjs.map +1 -0
- package/dist/chunks/PopupKeyboardPatterns-CgUM5kPf.mjs +2 -0
- package/dist/chunks/PopupKeyboardPatterns-CgUM5kPf.mjs.map +1 -0
- package/dist/chunks/PopupManager-B5SHhDsx.mjs +2 -0
- package/dist/chunks/PopupManager-B5SHhDsx.mjs.map +1 -0
- package/dist/chunks/PopupPositioning-BfahfPOm.mjs +2 -0
- package/dist/chunks/PopupPositioning-BfahfPOm.mjs.map +1 -0
- package/dist/chunks/PrintPlugin-CckjtZ9B.mjs +2 -0
- package/dist/chunks/PrintPlugin-CckjtZ9B.mjs.map +1 -0
- package/dist/chunks/PrintTypes-Ci3XW_s8.mjs +2 -0
- package/dist/chunks/PrintTypes-Ci3XW_s8.mjs.map +1 -0
- package/dist/chunks/RangeIterator-ZooGMxGy.mjs +2 -0
- package/dist/chunks/RangeIterator-ZooGMxGy.mjs.map +1 -0
- package/dist/chunks/ShortcutFormatting-DQPMvupx.mjs +2 -0
- package/dist/chunks/ShortcutFormatting-DQPMvupx.mjs.map +1 -0
- package/dist/chunks/SmartPastePlugin-B_zi9WT9.mjs +2 -0
- package/dist/chunks/SmartPastePlugin-B_zi9WT9.mjs.map +1 -0
- package/dist/chunks/StrikethroughPlugin-2XDKYefG.mjs +2 -0
- package/dist/chunks/StrikethroughPlugin-2XDKYefG.mjs.map +1 -0
- package/dist/chunks/SuperSubPlugin-6gdrjKZv.mjs +2 -0
- package/dist/chunks/SuperSubPlugin-6gdrjKZv.mjs.map +1 -0
- package/dist/chunks/SyntaxTokenTypes-DZwhanGO.mjs +2 -0
- package/dist/chunks/SyntaxTokenTypes-DZwhanGO.mjs.map +1 -0
- package/dist/chunks/TablePlugin-DW78Y4pB.mjs +2 -0
- package/dist/chunks/TablePlugin-DW78Y4pB.mjs.map +1 -0
- package/dist/chunks/TextColorPlugin-CgHro45N.mjs +2 -0
- package/dist/chunks/TextColorPlugin-CgHro45N.mjs.map +1 -0
- package/dist/chunks/TextDirectionAutoPlugin-C88ZeXJo.mjs +2 -0
- package/dist/chunks/TextDirectionAutoPlugin-C88ZeXJo.mjs.map +1 -0
- package/dist/chunks/TextDirectionPlugin-BTTqrWbL.mjs +2 -0
- package/dist/chunks/TextDirectionPlugin-BTTqrWbL.mjs.map +1 -0
- package/dist/chunks/TextDirectionService-DzuOMFm8.mjs +2 -0
- package/dist/chunks/TextDirectionService-DzuOMFm8.mjs.map +1 -0
- package/dist/chunks/TextFormattingPlugin-BD4Qlpls.mjs +2 -0
- package/dist/chunks/TextFormattingPlugin-BD4Qlpls.mjs.map +1 -0
- package/dist/chunks/ToolbarPlugin-D5_-gWmH.mjs +2 -0
- package/dist/chunks/ToolbarPlugin-D5_-gWmH.mjs.map +1 -0
- package/dist/chunks/WordBoundary-Cz2bSRAU.mjs +2 -0
- package/dist/chunks/WordBoundary-Cz2bSRAU.mjs.map +1 -0
- package/dist/chunks/XmlDetector-DM-Vv-XW.mjs +2 -0
- package/dist/chunks/XmlDetector-DM-Vv-XW.mjs.map +1 -0
- package/dist/chunks/XmlPatterns-B-V-mHF4.mjs +2 -0
- package/dist/chunks/XmlPatterns-B-V-mHF4.mjs.map +1 -0
- package/dist/chunks/XmlSupport-Dr1S1HN9.mjs +2 -0
- package/dist/chunks/XmlSupport-Dr1S1HN9.mjs.map +1 -0
- package/dist/chunks/ar-4r3DgNTY.mjs +2 -0
- package/dist/chunks/ar-4r3DgNTY.mjs.map +1 -0
- package/dist/chunks/ar-7EtzKNIe.mjs +2 -0
- package/dist/chunks/ar-7EtzKNIe.mjs.map +1 -0
- package/dist/chunks/ar-B2pDI_LT.mjs +2 -0
- package/dist/chunks/ar-B2pDI_LT.mjs.map +1 -0
- package/dist/chunks/ar-BV6-zQd7.mjs +2 -0
- package/dist/chunks/ar-BV6-zQd7.mjs.map +1 -0
- package/dist/chunks/ar-BaCL4Bzy.mjs +2 -0
- package/dist/chunks/ar-BaCL4Bzy.mjs.map +1 -0
- package/dist/chunks/ar-BdGHrLSw.mjs +2 -0
- package/dist/chunks/ar-BdGHrLSw.mjs.map +1 -0
- package/dist/chunks/ar-BwYDKOvO.mjs +2 -0
- package/dist/chunks/ar-BwYDKOvO.mjs.map +1 -0
- package/dist/chunks/ar-C5eLSf71.mjs +2 -0
- package/dist/chunks/ar-C5eLSf71.mjs.map +1 -0
- package/dist/chunks/ar-CEUn6f7s.mjs +2 -0
- package/dist/chunks/ar-CEUn6f7s.mjs.map +1 -0
- package/dist/chunks/ar-CGYb1t6O.mjs +2 -0
- package/dist/chunks/ar-CGYb1t6O.mjs.map +1 -0
- package/dist/chunks/ar-CjK36QZ9.mjs +2 -0
- package/dist/chunks/ar-CjK36QZ9.mjs.map +1 -0
- package/dist/chunks/ar-D9jfC3WF.mjs +2 -0
- package/dist/chunks/ar-D9jfC3WF.mjs.map +1 -0
- package/dist/chunks/ar-DFeA_UxF.mjs +2 -0
- package/dist/chunks/ar-DFeA_UxF.mjs.map +1 -0
- package/dist/chunks/ar-DMuawOHV.mjs +2 -0
- package/dist/chunks/ar-DMuawOHV.mjs.map +1 -0
- package/dist/chunks/ar-DV30sa3s.mjs +2 -0
- package/dist/chunks/ar-DV30sa3s.mjs.map +1 -0
- package/dist/chunks/ar-DWwG54pa.mjs +2 -0
- package/dist/chunks/ar-DWwG54pa.mjs.map +1 -0
- package/dist/chunks/ar-DcJbUbml.mjs +2 -0
- package/dist/chunks/ar-DcJbUbml.mjs.map +1 -0
- package/dist/chunks/ar-DelI54_I.mjs +2 -0
- package/dist/chunks/ar-DelI54_I.mjs.map +1 -0
- package/dist/chunks/ar-DmqFnvxC.mjs +2 -0
- package/dist/chunks/ar-DmqFnvxC.mjs.map +1 -0
- package/dist/chunks/ar-DpEHjBUk.mjs +2 -0
- package/dist/chunks/ar-DpEHjBUk.mjs.map +1 -0
- package/dist/chunks/ar-EnfTpUuB.mjs +2 -0
- package/dist/chunks/ar-EnfTpUuB.mjs.map +1 -0
- package/dist/chunks/ar-ZHVy9O4c.mjs +2 -0
- package/dist/chunks/ar-ZHVy9O4c.mjs.map +1 -0
- package/dist/chunks/ar-_7aFyBGi.mjs +2 -0
- package/dist/chunks/ar-_7aFyBGi.mjs.map +1 -0
- package/dist/chunks/ar-l75rG_xT.mjs +2 -0
- package/dist/chunks/ar-l75rG_xT.mjs.map +1 -0
- package/dist/chunks/ar-qU1PohHA.mjs +2 -0
- package/dist/chunks/ar-qU1PohHA.mjs.map +1 -0
- package/dist/chunks/color-picker-BTex2Cfu.mjs +2 -0
- package/dist/chunks/color-picker-BTex2Cfu.mjs.map +1 -0
- package/dist/chunks/de-BDfimoiQ.mjs +2 -0
- package/dist/chunks/de-BDfimoiQ.mjs.map +1 -0
- package/dist/chunks/de-BSkOdXQZ.mjs +2 -0
- package/dist/chunks/de-BSkOdXQZ.mjs.map +1 -0
- package/dist/chunks/de-BooQr0-C.mjs +2 -0
- package/dist/chunks/de-BooQr0-C.mjs.map +1 -0
- package/dist/chunks/de-ByvLzlOc.mjs +2 -0
- package/dist/chunks/de-ByvLzlOc.mjs.map +1 -0
- package/dist/chunks/de-C03n6uR5.mjs +2 -0
- package/dist/chunks/de-C03n6uR5.mjs.map +1 -0
- package/dist/chunks/de-C0TfkuUd.mjs +2 -0
- package/dist/chunks/de-C0TfkuUd.mjs.map +1 -0
- package/dist/chunks/de-C0khkRSC.mjs +2 -0
- package/dist/chunks/de-C0khkRSC.mjs.map +1 -0
- package/dist/chunks/de-C4IW4BVo.mjs +2 -0
- package/dist/chunks/de-C4IW4BVo.mjs.map +1 -0
- package/dist/chunks/de-CDSG9CMy.mjs +2 -0
- package/dist/chunks/de-CDSG9CMy.mjs.map +1 -0
- package/dist/chunks/de-CkIwUE6R.mjs +2 -0
- package/dist/chunks/de-CkIwUE6R.mjs.map +1 -0
- package/dist/chunks/de-CmJ9oOiP.mjs +2 -0
- package/dist/chunks/de-CmJ9oOiP.mjs.map +1 -0
- package/dist/chunks/de-CrjOjB4F.mjs +2 -0
- package/dist/chunks/de-CrjOjB4F.mjs.map +1 -0
- package/dist/chunks/de-D5_uflBY.mjs +2 -0
- package/dist/chunks/de-D5_uflBY.mjs.map +1 -0
- package/dist/chunks/de-DH5zRyrS.mjs +2 -0
- package/dist/chunks/de-DH5zRyrS.mjs.map +1 -0
- package/dist/chunks/de-DJqgaz5N.mjs +2 -0
- package/dist/chunks/de-DJqgaz5N.mjs.map +1 -0
- package/dist/chunks/de-DMiAi5QJ.mjs +2 -0
- package/dist/chunks/de-DMiAi5QJ.mjs.map +1 -0
- package/dist/chunks/de-DT6VbHNl.mjs +2 -0
- package/dist/chunks/de-DT6VbHNl.mjs.map +1 -0
- package/dist/chunks/de-DbqObFs9.mjs +2 -0
- package/dist/chunks/de-DbqObFs9.mjs.map +1 -0
- package/dist/chunks/de-Dl0svzeh.mjs +2 -0
- package/dist/chunks/de-Dl0svzeh.mjs.map +1 -0
- package/dist/chunks/de-DzMY3LLH.mjs +2 -0
- package/dist/chunks/de-DzMY3LLH.mjs.map +1 -0
- package/dist/chunks/de-JGuzWRyC.mjs +2 -0
- package/dist/chunks/de-JGuzWRyC.mjs.map +1 -0
- package/dist/chunks/de-MOHX9tl7.mjs +2 -0
- package/dist/chunks/de-MOHX9tl7.mjs.map +1 -0
- package/dist/chunks/de-mtjvG1Li.mjs +2 -0
- package/dist/chunks/de-mtjvG1Li.mjs.map +1 -0
- package/dist/chunks/de-oNyi0r7G.mjs +2 -0
- package/dist/chunks/de-oNyi0r7G.mjs.map +1 -0
- package/dist/chunks/de-y5fJdnH9.mjs +2 -0
- package/dist/chunks/de-y5fJdnH9.mjs.map +1 -0
- package/dist/chunks/es-B-V14ELw.mjs +2 -0
- package/dist/chunks/es-B-V14ELw.mjs.map +1 -0
- package/dist/chunks/es-Bf6WRo_H.mjs +2 -0
- package/dist/chunks/es-Bf6WRo_H.mjs.map +1 -0
- package/dist/chunks/es-Bw9vJu_M.mjs +2 -0
- package/dist/chunks/es-Bw9vJu_M.mjs.map +1 -0
- package/dist/chunks/es-CCdE3xXm.mjs +2 -0
- package/dist/chunks/es-CCdE3xXm.mjs.map +1 -0
- package/dist/chunks/es-CDoZMS8v.mjs +2 -0
- package/dist/chunks/es-CDoZMS8v.mjs.map +1 -0
- package/dist/chunks/es-CO1hBMDj.mjs +2 -0
- package/dist/chunks/es-CO1hBMDj.mjs.map +1 -0
- package/dist/chunks/es-CU2TUgK3.mjs +2 -0
- package/dist/chunks/es-CU2TUgK3.mjs.map +1 -0
- package/dist/chunks/es-CXeJJ2r1.mjs +2 -0
- package/dist/chunks/es-CXeJJ2r1.mjs.map +1 -0
- package/dist/chunks/es-Cc337sYN.mjs +2 -0
- package/dist/chunks/es-Cc337sYN.mjs.map +1 -0
- package/dist/chunks/es-Ck88JtiM.mjs +2 -0
- package/dist/chunks/es-Ck88JtiM.mjs.map +1 -0
- package/dist/chunks/es-CmOFsz0P.mjs +2 -0
- package/dist/chunks/es-CmOFsz0P.mjs.map +1 -0
- package/dist/chunks/es-CpcUYxtO.mjs +2 -0
- package/dist/chunks/es-CpcUYxtO.mjs.map +1 -0
- package/dist/chunks/es-Cqp8LgVd.mjs +2 -0
- package/dist/chunks/es-Cqp8LgVd.mjs.map +1 -0
- package/dist/chunks/es-CsK826Q8.mjs +2 -0
- package/dist/chunks/es-CsK826Q8.mjs.map +1 -0
- package/dist/chunks/es-D7wyE736.mjs +2 -0
- package/dist/chunks/es-D7wyE736.mjs.map +1 -0
- package/dist/chunks/es-DGCoEaRB.mjs +2 -0
- package/dist/chunks/es-DGCoEaRB.mjs.map +1 -0
- package/dist/chunks/es-DPsoXXVT.mjs +2 -0
- package/dist/chunks/es-DPsoXXVT.mjs.map +1 -0
- package/dist/chunks/es-Df2ocRb2.mjs +2 -0
- package/dist/chunks/es-Df2ocRb2.mjs.map +1 -0
- package/dist/chunks/es-DgVSWMPU.mjs +2 -0
- package/dist/chunks/es-DgVSWMPU.mjs.map +1 -0
- package/dist/chunks/es-Dltvy1GA.mjs +2 -0
- package/dist/chunks/es-Dltvy1GA.mjs.map +1 -0
- package/dist/chunks/es-DtElbzrQ.mjs +2 -0
- package/dist/chunks/es-DtElbzrQ.mjs.map +1 -0
- package/dist/chunks/es-ERjP_b2h.mjs +2 -0
- package/dist/chunks/es-ERjP_b2h.mjs.map +1 -0
- package/dist/chunks/es-SN8M8vXY.mjs +2 -0
- package/dist/chunks/es-SN8M8vXY.mjs.map +1 -0
- package/dist/chunks/es-domW6tKg.mjs +2 -0
- package/dist/chunks/es-domW6tKg.mjs.map +1 -0
- package/dist/chunks/es-luS_ivBE.mjs +2 -0
- package/dist/chunks/es-luS_ivBE.mjs.map +1 -0
- package/dist/chunks/fonts-DVgoAAns.mjs +2 -0
- package/dist/chunks/fonts-DVgoAAns.mjs.map +1 -0
- package/dist/chunks/fr-BPa6RyuB.mjs +2 -0
- package/dist/chunks/fr-BPa6RyuB.mjs.map +1 -0
- package/dist/chunks/fr-BYK62vy-.mjs +2 -0
- package/dist/chunks/fr-BYK62vy-.mjs.map +1 -0
- package/dist/chunks/fr-BZH71A1g.mjs +2 -0
- package/dist/chunks/fr-BZH71A1g.mjs.map +1 -0
- package/dist/chunks/fr-BomQM4Qz.mjs +2 -0
- package/dist/chunks/fr-BomQM4Qz.mjs.map +1 -0
- package/dist/chunks/fr-BujOdWeE.mjs +2 -0
- package/dist/chunks/fr-BujOdWeE.mjs.map +1 -0
- package/dist/chunks/fr-C6BCt-Fk.mjs +2 -0
- package/dist/chunks/fr-C6BCt-Fk.mjs.map +1 -0
- package/dist/chunks/fr-C8NXcJOp.mjs +2 -0
- package/dist/chunks/fr-C8NXcJOp.mjs.map +1 -0
- package/dist/chunks/fr-C8aNnvoW.mjs +2 -0
- package/dist/chunks/fr-C8aNnvoW.mjs.map +1 -0
- package/dist/chunks/fr-C8jqjdbQ.mjs +2 -0
- package/dist/chunks/fr-C8jqjdbQ.mjs.map +1 -0
- package/dist/chunks/fr-Cg97syqs.mjs +2 -0
- package/dist/chunks/fr-Cg97syqs.mjs.map +1 -0
- package/dist/chunks/fr-CiT36QA9.mjs +2 -0
- package/dist/chunks/fr-CiT36QA9.mjs.map +1 -0
- package/dist/chunks/fr-D3Ho_0MV.mjs +2 -0
- package/dist/chunks/fr-D3Ho_0MV.mjs.map +1 -0
- package/dist/chunks/fr-DA37dDuJ.mjs +2 -0
- package/dist/chunks/fr-DA37dDuJ.mjs.map +1 -0
- package/dist/chunks/fr-DK9dc8bZ.mjs +2 -0
- package/dist/chunks/fr-DK9dc8bZ.mjs.map +1 -0
- package/dist/chunks/fr-DNA_bC6X.mjs +2 -0
- package/dist/chunks/fr-DNA_bC6X.mjs.map +1 -0
- package/dist/chunks/fr-DPXU2MTy.mjs +2 -0
- package/dist/chunks/fr-DPXU2MTy.mjs.map +1 -0
- package/dist/chunks/fr-DZCsB6H7.mjs +2 -0
- package/dist/chunks/fr-DZCsB6H7.mjs.map +1 -0
- package/dist/chunks/fr-Dd8f28BD.mjs +2 -0
- package/dist/chunks/fr-Dd8f28BD.mjs.map +1 -0
- package/dist/chunks/fr-DmCLgc4F.mjs +2 -0
- package/dist/chunks/fr-DmCLgc4F.mjs.map +1 -0
- package/dist/chunks/fr-DtEXB4RG.mjs +2 -0
- package/dist/chunks/fr-DtEXB4RG.mjs.map +1 -0
- package/dist/chunks/fr-FvGvPlqS.mjs +2 -0
- package/dist/chunks/fr-FvGvPlqS.mjs.map +1 -0
- package/dist/chunks/fr-V3LUcmFE.mjs +2 -0
- package/dist/chunks/fr-V3LUcmFE.mjs.map +1 -0
- package/dist/chunks/fr-eiqXGNgf.mjs +2 -0
- package/dist/chunks/fr-eiqXGNgf.mjs.map +1 -0
- package/dist/chunks/fr-fEWGSNI2.mjs +2 -0
- package/dist/chunks/fr-fEWGSNI2.mjs.map +1 -0
- package/dist/chunks/fr-w23c3SBW.mjs +2 -0
- package/dist/chunks/fr-w23c3SBW.mjs.map +1 -0
- package/dist/chunks/full-yocxIDB8.mjs +2 -0
- package/dist/chunks/full-yocxIDB8.mjs.map +1 -0
- package/dist/chunks/hi-4Xqp7mZC.mjs +2 -0
- package/dist/chunks/hi-4Xqp7mZC.mjs.map +1 -0
- package/dist/chunks/hi-8Eu7f89Y.mjs +2 -0
- package/dist/chunks/hi-8Eu7f89Y.mjs.map +1 -0
- package/dist/chunks/hi-BA9PP8mL.mjs +2 -0
- package/dist/chunks/hi-BA9PP8mL.mjs.map +1 -0
- package/dist/chunks/hi-BLCjECcV.mjs +2 -0
- package/dist/chunks/hi-BLCjECcV.mjs.map +1 -0
- package/dist/chunks/hi-BX9P0764.mjs +2 -0
- package/dist/chunks/hi-BX9P0764.mjs.map +1 -0
- package/dist/chunks/hi-BakCaBYh.mjs +2 -0
- package/dist/chunks/hi-BakCaBYh.mjs.map +1 -0
- package/dist/chunks/hi-BoITZeVd.mjs +2 -0
- package/dist/chunks/hi-BoITZeVd.mjs.map +1 -0
- package/dist/chunks/hi-C3BvlTfV.mjs +2 -0
- package/dist/chunks/hi-C3BvlTfV.mjs.map +1 -0
- package/dist/chunks/hi-C5HGb5IH.mjs +2 -0
- package/dist/chunks/hi-C5HGb5IH.mjs.map +1 -0
- package/dist/chunks/hi-CIpo_sTL.mjs +2 -0
- package/dist/chunks/hi-CIpo_sTL.mjs.map +1 -0
- package/dist/chunks/hi-CWRofsw7.mjs +2 -0
- package/dist/chunks/hi-CWRofsw7.mjs.map +1 -0
- package/dist/chunks/hi-C_eipolR.mjs +2 -0
- package/dist/chunks/hi-C_eipolR.mjs.map +1 -0
- package/dist/chunks/hi-ClaAWR5y.mjs +2 -0
- package/dist/chunks/hi-ClaAWR5y.mjs.map +1 -0
- package/dist/chunks/hi-Cn2ywhVT.mjs +2 -0
- package/dist/chunks/hi-Cn2ywhVT.mjs.map +1 -0
- package/dist/chunks/hi-CrsqMuKk.mjs +2 -0
- package/dist/chunks/hi-CrsqMuKk.mjs.map +1 -0
- package/dist/chunks/hi-D-iC4Hvv.mjs +2 -0
- package/dist/chunks/hi-D-iC4Hvv.mjs.map +1 -0
- package/dist/chunks/hi-DEN9a54c.mjs +2 -0
- package/dist/chunks/hi-DEN9a54c.mjs.map +1 -0
- package/dist/chunks/hi-DK9HmINW.mjs +2 -0
- package/dist/chunks/hi-DK9HmINW.mjs.map +1 -0
- package/dist/chunks/hi-DOnHDEqt.mjs +2 -0
- package/dist/chunks/hi-DOnHDEqt.mjs.map +1 -0
- package/dist/chunks/hi-DY0SGobQ.mjs +2 -0
- package/dist/chunks/hi-DY0SGobQ.mjs.map +1 -0
- package/dist/chunks/hi-FSXMWIXU.mjs +2 -0
- package/dist/chunks/hi-FSXMWIXU.mjs.map +1 -0
- package/dist/chunks/hi-JroSY-2k.mjs +2 -0
- package/dist/chunks/hi-JroSY-2k.mjs.map +1 -0
- package/dist/chunks/hi-WDIZzgAJ.mjs +2 -0
- package/dist/chunks/hi-WDIZzgAJ.mjs.map +1 -0
- package/dist/chunks/hi-fLLnVGix.mjs +2 -0
- package/dist/chunks/hi-fLLnVGix.mjs.map +1 -0
- package/dist/chunks/hi-f_MCrd2N.mjs +2 -0
- package/dist/chunks/hi-f_MCrd2N.mjs.map +1 -0
- package/dist/chunks/minimal-BL3kgYy-.mjs +2 -0
- package/dist/chunks/minimal-BL3kgYy-.mjs.map +1 -0
- package/dist/chunks/pt-206lqjCP.mjs +2 -0
- package/dist/chunks/pt-206lqjCP.mjs.map +1 -0
- package/dist/chunks/pt-B5wz6m3c.mjs +2 -0
- package/dist/chunks/pt-B5wz6m3c.mjs.map +1 -0
- package/dist/chunks/pt-B6KMxxw4.mjs +2 -0
- package/dist/chunks/pt-B6KMxxw4.mjs.map +1 -0
- package/dist/chunks/pt-BCg3YzEh.mjs +2 -0
- package/dist/chunks/pt-BCg3YzEh.mjs.map +1 -0
- package/dist/chunks/pt-BFr-zfd2.mjs +2 -0
- package/dist/chunks/pt-BFr-zfd2.mjs.map +1 -0
- package/dist/chunks/pt-BG1fIcHV.mjs +2 -0
- package/dist/chunks/pt-BG1fIcHV.mjs.map +1 -0
- package/dist/chunks/pt-Bhytb-k2.mjs +2 -0
- package/dist/chunks/pt-Bhytb-k2.mjs.map +1 -0
- package/dist/chunks/pt-Bjb6_1gI.mjs +2 -0
- package/dist/chunks/pt-Bjb6_1gI.mjs.map +1 -0
- package/dist/chunks/pt-BzQagqFt.mjs +2 -0
- package/dist/chunks/pt-BzQagqFt.mjs.map +1 -0
- package/dist/chunks/pt-C2rlfcQ4.mjs +2 -0
- package/dist/chunks/pt-C2rlfcQ4.mjs.map +1 -0
- package/dist/chunks/pt-C4xLSFYA.mjs +2 -0
- package/dist/chunks/pt-C4xLSFYA.mjs.map +1 -0
- package/dist/chunks/pt-CBxnU7dE.mjs +2 -0
- package/dist/chunks/pt-CBxnU7dE.mjs.map +1 -0
- package/dist/chunks/pt-CMXLiIJ3.mjs +2 -0
- package/dist/chunks/pt-CMXLiIJ3.mjs.map +1 -0
- package/dist/chunks/pt-Cn2yMIyR.mjs +2 -0
- package/dist/chunks/pt-Cn2yMIyR.mjs.map +1 -0
- package/dist/chunks/pt-DAh8UqJa.mjs +2 -0
- package/dist/chunks/pt-DAh8UqJa.mjs.map +1 -0
- package/dist/chunks/pt-DLe58Npz.mjs +2 -0
- package/dist/chunks/pt-DLe58Npz.mjs.map +1 -0
- package/dist/chunks/pt-D_DXzKyU.mjs +2 -0
- package/dist/chunks/pt-D_DXzKyU.mjs.map +1 -0
- package/dist/chunks/pt-DhC7TYvg.mjs +2 -0
- package/dist/chunks/pt-DhC7TYvg.mjs.map +1 -0
- package/dist/chunks/pt-Dl18NLl1.mjs +2 -0
- package/dist/chunks/pt-Dl18NLl1.mjs.map +1 -0
- package/dist/chunks/pt-Dz2YeCP4.mjs +2 -0
- package/dist/chunks/pt-Dz2YeCP4.mjs.map +1 -0
- package/dist/chunks/pt-GfM-nxvv.mjs +2 -0
- package/dist/chunks/pt-GfM-nxvv.mjs.map +1 -0
- package/dist/chunks/pt-PjsDW8WW.mjs +2 -0
- package/dist/chunks/pt-PjsDW8WW.mjs.map +1 -0
- package/dist/chunks/pt-X-M5uPLn.mjs +2 -0
- package/dist/chunks/pt-X-M5uPLn.mjs.map +1 -0
- package/dist/chunks/pt-appBsYpC.mjs +2 -0
- package/dist/chunks/pt-appBsYpC.mjs.map +1 -0
- package/dist/chunks/pt-i9ZFEE69.mjs +2 -0
- package/dist/chunks/pt-i9ZFEE69.mjs.map +1 -0
- package/dist/chunks/ru-B8HSQCj5.mjs +2 -0
- package/dist/chunks/ru-B8HSQCj5.mjs.map +1 -0
- package/dist/chunks/ru-BAOr7UOh.mjs +2 -0
- package/dist/chunks/ru-BAOr7UOh.mjs.map +1 -0
- package/dist/chunks/ru-BIV3iuR9.mjs +2 -0
- package/dist/chunks/ru-BIV3iuR9.mjs.map +1 -0
- package/dist/chunks/ru-BMJRGir6.mjs +2 -0
- package/dist/chunks/ru-BMJRGir6.mjs.map +1 -0
- package/dist/chunks/ru-BO59Tir1.mjs +2 -0
- package/dist/chunks/ru-BO59Tir1.mjs.map +1 -0
- package/dist/chunks/ru-BRnZSWPo.mjs +2 -0
- package/dist/chunks/ru-BRnZSWPo.mjs.map +1 -0
- package/dist/chunks/ru-Bf546sX_.mjs +2 -0
- package/dist/chunks/ru-Bf546sX_.mjs.map +1 -0
- package/dist/chunks/ru-Bfjq7sha.mjs +2 -0
- package/dist/chunks/ru-Bfjq7sha.mjs.map +1 -0
- package/dist/chunks/ru-Bm8utWf9.mjs +2 -0
- package/dist/chunks/ru-Bm8utWf9.mjs.map +1 -0
- package/dist/chunks/ru-BmneOLgh.mjs +2 -0
- package/dist/chunks/ru-BmneOLgh.mjs.map +1 -0
- package/dist/chunks/ru-Byrj1o3C.mjs +2 -0
- package/dist/chunks/ru-Byrj1o3C.mjs.map +1 -0
- package/dist/chunks/ru-C8ftQh9b.mjs +2 -0
- package/dist/chunks/ru-C8ftQh9b.mjs.map +1 -0
- package/dist/chunks/ru-CNjcfDD9.mjs +2 -0
- package/dist/chunks/ru-CNjcfDD9.mjs.map +1 -0
- package/dist/chunks/ru-Ccya5aSC.mjs +2 -0
- package/dist/chunks/ru-Ccya5aSC.mjs.map +1 -0
- package/dist/chunks/ru-Cd-mH9wa.mjs +2 -0
- package/dist/chunks/ru-Cd-mH9wa.mjs.map +1 -0
- package/dist/chunks/ru-CeZe9jTZ.mjs +2 -0
- package/dist/chunks/ru-CeZe9jTZ.mjs.map +1 -0
- package/dist/chunks/ru-Cl03u8Q0.mjs +2 -0
- package/dist/chunks/ru-Cl03u8Q0.mjs.map +1 -0
- package/dist/chunks/ru-CoCIIElm.mjs +2 -0
- package/dist/chunks/ru-CoCIIElm.mjs.map +1 -0
- package/dist/chunks/ru-CzUyZZmy.mjs +2 -0
- package/dist/chunks/ru-CzUyZZmy.mjs.map +1 -0
- package/dist/chunks/ru-D3fRdonc.mjs +2 -0
- package/dist/chunks/ru-D3fRdonc.mjs.map +1 -0
- package/dist/chunks/ru-Ddy9ONaX.mjs +2 -0
- package/dist/chunks/ru-Ddy9ONaX.mjs.map +1 -0
- package/dist/chunks/ru-Dgcyz845.mjs +2 -0
- package/dist/chunks/ru-Dgcyz845.mjs.map +1 -0
- package/dist/chunks/ru-DnIXvlfL.mjs +2 -0
- package/dist/chunks/ru-DnIXvlfL.mjs.map +1 -0
- package/dist/chunks/ru-DyBnSwCM.mjs +2 -0
- package/dist/chunks/ru-DyBnSwCM.mjs.map +1 -0
- package/dist/chunks/ru-i27SgAts.mjs +2 -0
- package/dist/chunks/ru-i27SgAts.mjs.map +1 -0
- package/dist/chunks/src-DfK2_MVH.mjs +2 -0
- package/dist/chunks/src-DfK2_MVH.mjs.map +1 -0
- package/dist/chunks/zh-6QoY3dY_.mjs +2 -0
- package/dist/chunks/zh-6QoY3dY_.mjs.map +1 -0
- package/dist/chunks/zh-9WLieF9N.mjs +2 -0
- package/dist/chunks/zh-9WLieF9N.mjs.map +1 -0
- package/dist/chunks/zh-B0VaFyeQ.mjs +2 -0
- package/dist/chunks/zh-B0VaFyeQ.mjs.map +1 -0
- package/dist/chunks/zh-B4pfqHD3.mjs +2 -0
- package/dist/chunks/zh-B4pfqHD3.mjs.map +1 -0
- package/dist/chunks/zh-BpaN1Nmc.mjs +2 -0
- package/dist/chunks/zh-BpaN1Nmc.mjs.map +1 -0
- package/dist/chunks/zh-BqCL2eZf.mjs +2 -0
- package/dist/chunks/zh-BqCL2eZf.mjs.map +1 -0
- package/dist/chunks/zh-Bvgb-e4z.mjs +2 -0
- package/dist/chunks/zh-Bvgb-e4z.mjs.map +1 -0
- package/dist/chunks/zh-C2by0u64.mjs +2 -0
- package/dist/chunks/zh-C2by0u64.mjs.map +1 -0
- package/dist/chunks/zh-C4Ia0Zrx.mjs +2 -0
- package/dist/chunks/zh-C4Ia0Zrx.mjs.map +1 -0
- package/dist/chunks/zh-CBHCLph7.mjs +2 -0
- package/dist/chunks/zh-CBHCLph7.mjs.map +1 -0
- package/dist/chunks/zh-CBJQlvWb.mjs +2 -0
- package/dist/chunks/zh-CBJQlvWb.mjs.map +1 -0
- package/dist/chunks/zh-CBNSrvly.mjs +2 -0
- package/dist/chunks/zh-CBNSrvly.mjs.map +1 -0
- package/dist/chunks/zh-CKEh4EwR.mjs +2 -0
- package/dist/chunks/zh-CKEh4EwR.mjs.map +1 -0
- package/dist/chunks/zh-CN8KiZ9v.mjs +2 -0
- package/dist/chunks/zh-CN8KiZ9v.mjs.map +1 -0
- package/dist/chunks/zh-CRJMQ4dT.mjs +2 -0
- package/dist/chunks/zh-CRJMQ4dT.mjs.map +1 -0
- package/dist/chunks/zh-CSg0qxe0.mjs +2 -0
- package/dist/chunks/zh-CSg0qxe0.mjs.map +1 -0
- package/dist/chunks/zh-CX7Bx0ia.mjs +2 -0
- package/dist/chunks/zh-CX7Bx0ia.mjs.map +1 -0
- package/dist/chunks/zh-CvlL1G9n.mjs +2 -0
- package/dist/chunks/zh-CvlL1G9n.mjs.map +1 -0
- package/dist/chunks/zh-DBKn0pzM.mjs +2 -0
- package/dist/chunks/zh-DBKn0pzM.mjs.map +1 -0
- package/dist/chunks/zh-DLOng8d-.mjs +2 -0
- package/dist/chunks/zh-DLOng8d-.mjs.map +1 -0
- package/dist/chunks/zh-DLVkXfcI.mjs +2 -0
- package/dist/chunks/zh-DLVkXfcI.mjs.map +1 -0
- package/dist/chunks/zh-DuaKGwyq.mjs +2 -0
- package/dist/chunks/zh-DuaKGwyq.mjs.map +1 -0
- package/dist/chunks/zh-KUnAhArn.mjs +2 -0
- package/dist/chunks/zh-KUnAhArn.mjs.map +1 -0
- package/dist/chunks/zh-wVp_7rfC.mjs +2 -0
- package/dist/chunks/zh-wVp_7rfC.mjs.map +1 -0
- package/dist/chunks/zh-z2wm3EA5.mjs +2 -0
- package/dist/chunks/zh-z2wm3EA5.mjs.map +1 -0
- package/dist/decorations/Decoration.d.ts +6 -0
- package/dist/decorations/Decoration.d.ts.map +1 -1
- package/dist/decorations/PositionMapping.d.ts +13 -3
- package/dist/decorations/PositionMapping.d.ts.map +1 -1
- package/dist/editor/EditorConfig.d.ts +14 -2
- package/dist/editor/EditorConfig.d.ts.map +1 -1
- package/dist/editor/EditorDOM.d.ts.map +1 -1
- package/dist/editor/EditorInitializer.d.ts.map +1 -1
- package/dist/editor/NotectlEditor.d.ts +2 -2
- package/dist/editor/PluginBootstrapper.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/table.d.ts +1 -1
- package/dist/editor/styles/table.d.ts.map +1 -1
- package/dist/editor/styles/toolbar.d.ts +1 -1
- package/dist/editor/styles/toolbar.d.ts.map +1 -1
- package/dist/fonts.mjs +1 -1
- package/dist/full.mjs +1 -1
- package/dist/html.mjs +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/input/InputHandler.d.ts +9 -0
- package/dist/input/InputHandler.d.ts.map +1 -1
- package/dist/input/InputManager.d.ts +2 -0
- package/dist/input/InputManager.d.ts.map +1 -1
- package/dist/model/NodeResolver.d.ts +7 -0
- package/dist/model/NodeResolver.d.ts.map +1 -1
- package/dist/model/TextInputInterceptor.d.ts +21 -0
- package/dist/model/TextInputInterceptor.d.ts.map +1 -0
- 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/MiddlewareChain.d.ts +11 -0
- package/dist/plugins/MiddlewareChain.d.ts.map +1 -1
- package/dist/plugins/Plugin.d.ts +7 -0
- package/dist/plugins/Plugin.d.ts.map +1 -1
- package/dist/plugins/PluginContextFactory.d.ts +6 -0
- package/dist/plugins/PluginContextFactory.d.ts.map +1 -1
- package/dist/plugins/PluginManager.d.ts +5 -0
- package/dist/plugins/PluginManager.d.ts.map +1 -1
- package/dist/plugins/RegistrationTracker.d.ts.map +1 -1
- package/dist/plugins/alignment.mjs +1 -1
- package/dist/plugins/bidi-isolation.mjs +1 -1
- package/dist/plugins/blockquote/BlockquotePlugin.d.ts.map +1 -1
- package/dist/plugins/blockquote/BlockquoteStyles.d.ts +1 -1
- package/dist/plugins/blockquote/BlockquoteStyles.d.ts.map +1 -1
- package/dist/plugins/blockquote.mjs +1 -1
- package/dist/plugins/caret-navigation.mjs +1 -1
- package/dist/plugins/code-block/BracketPairing.d.ts +49 -0
- package/dist/plugins/code-block/BracketPairing.d.ts.map +1 -0
- package/dist/plugins/code-block/CodeBlockKeyboardHandlers.d.ts +11 -2
- package/dist/plugins/code-block/CodeBlockKeyboardHandlers.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockLocale.d.ts +4 -0
- package/dist/plugins/code-block/CodeBlockLocale.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockNodeView.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts +25 -1
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockTypes.d.ts +66 -0
- package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -1
- package/dist/plugins/code-block/IndentHelpers.d.ts +71 -0
- package/dist/plugins/code-block/IndentHelpers.d.ts.map +1 -0
- package/dist/plugins/code-block/PairStack.d.ts +37 -0
- package/dist/plugins/code-block/PairStack.d.ts.map +1 -0
- package/dist/plugins/code-block/highlighter/RegexTokenizer.d.ts.map +1 -1
- package/dist/plugins/code-block/highlighter/TokenIteration.d.ts +18 -0
- package/dist/plugins/code-block/highlighter/TokenIteration.d.ts.map +1 -0
- package/dist/plugins/code-block/highlighter/languages/index.d.ts +1 -0
- package/dist/plugins/code-block/highlighter/languages/index.d.ts.map +1 -1
- package/dist/plugins/code-block/highlighter/languages/java.d.ts.map +1 -1
- package/dist/plugins/code-block/highlighter/languages/typescript.d.ts +3 -0
- package/dist/plugins/code-block/highlighter/languages/typescript.d.ts.map +1 -0
- package/dist/plugins/code-block/index.d.ts +1 -0
- package/dist/plugins/code-block/index.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/ar.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/de.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/es.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/fr.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/hi.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/pt.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/ru.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/zh.d.ts.map +1 -1
- package/dist/plugins/code-block.mjs +1 -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/ImagePlugin.d.ts.map +1 -1
- package/dist/plugins/image/ImagePopup.d.ts.map +1 -1
- package/dist/plugins/image/ImagePopupStyles.d.ts +3 -0
- package/dist/plugins/image/ImagePopupStyles.d.ts.map +1 -0
- package/dist/plugins/image.mjs +1 -1
- package/dist/plugins/inline-code.mjs +1 -1
- package/dist/plugins/language/bundles/JavaSupport.d.ts.map +1 -1
- package/dist/plugins/language/bundles/TypeScriptSupport.d.ts +3 -0
- package/dist/plugins/language/bundles/TypeScriptSupport.d.ts.map +1 -0
- package/dist/plugins/language/bundles/index.d.ts +1 -0
- package/dist/plugins/language/bundles/index.d.ts.map +1 -1
- package/dist/plugins/language/index.d.ts +1 -1
- package/dist/plugins/language/index.d.ts.map +1 -1
- 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.mjs +1 -1
- package/dist/plugins/shared.mjs +1 -1
- package/dist/plugins/smart-paste/detectors/DetectionScorer.d.ts +17 -0
- package/dist/plugins/smart-paste/detectors/DetectionScorer.d.ts.map +1 -0
- package/dist/plugins/smart-paste/detectors/LexerDetector.d.ts +36 -0
- package/dist/plugins/smart-paste/detectors/LexerDetector.d.ts.map +1 -0
- package/dist/plugins/smart-paste/detectors/TokenStats.d.ts +44 -0
- package/dist/plugins/smart-paste/detectors/TokenStats.d.ts.map +1 -0
- package/dist/plugins/smart-paste/index.d.ts +3 -1
- package/dist/plugins/smart-paste/index.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/TablePlugin.d.ts.map +1 -1
- package/dist/plugins/table.mjs +1 -1
- package/dist/plugins/text-color.mjs +1 -1
- package/dist/plugins/text-direction-auto.mjs +1 -1
- package/dist/plugins/text-direction.mjs +1 -1
- package/dist/plugins/text-formatting.mjs +1 -1
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts +14 -1
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts +13 -1
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarRenderers.d.ts.map +1 -1
- package/dist/plugins/toolbar/index.d.ts +1 -1
- package/dist/plugins/toolbar/index.d.ts.map +1 -1
- package/dist/plugins/toolbar.mjs +1 -1
- package/dist/presets/full.mjs +1 -1
- package/dist/presets/minimal.mjs +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/state/History.d.ts +20 -0
- package/dist/state/History.d.ts.map +1 -1
- package/dist/state/InlineContentOps.d.ts +30 -0
- package/dist/state/InlineContentOps.d.ts.map +1 -1
- package/dist/state/Mapping.d.ts +261 -0
- package/dist/state/Mapping.d.ts.map +1 -0
- package/dist/state/SelectionMapping.d.ts +25 -0
- package/dist/state/SelectionMapping.d.ts.map +1 -0
- package/dist/state/StepApplication.d.ts +20 -3
- package/dist/state/StepApplication.d.ts.map +1 -1
- package/dist/state/StepHandlers.d.ts +68 -0
- package/dist/state/StepHandlers.d.ts.map +1 -0
- package/dist/state/StepInversion.d.ts +22 -5
- package/dist/state/StepInversion.d.ts.map +1 -1
- package/dist/state/StepMapping.d.ts +18 -0
- package/dist/state/StepMapping.d.ts.map +1 -0
- package/dist/state/StepMaps.d.ts +25 -0
- package/dist/state/StepMaps.d.ts.map +1 -0
- package/dist/state/Steps.d.ts +38 -0
- package/dist/state/Steps.d.ts.map +1 -1
- package/dist/state/Transaction.d.ts +25 -1
- package/dist/state/Transaction.d.ts.map +1 -1
- package/dist/state/TransactionBuilder.d.ts +51 -7
- package/dist/state/TransactionBuilder.d.ts.map +1 -1
- package/dist/test/TestUtils.d.ts +2 -0
- package/dist/test/TestUtils.d.ts.map +1 -1
- package/dist/view/EditorView.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/AlignmentPlugin-bqK6ze-E.mjs +0 -2
- package/dist/chunks/AlignmentPlugin-bqK6ze-E.mjs.map +0 -1
- package/dist/chunks/AttrRegistry-nDKtHK87.mjs +0 -2
- package/dist/chunks/AttrRegistry-nDKtHK87.mjs.map +0 -1
- package/dist/chunks/AttributedMarkCommands-35jTbVRg.mjs +0 -2
- package/dist/chunks/AttributedMarkCommands-35jTbVRg.mjs.map +0 -1
- package/dist/chunks/BidiIsolationPlugin-SIKxfWXp.mjs +0 -2
- package/dist/chunks/BidiIsolationPlugin-SIKxfWXp.mjs.map +0 -1
- package/dist/chunks/BlockInsertion-DsnHLcvM.mjs +0 -2
- package/dist/chunks/BlockInsertion-DsnHLcvM.mjs.map +0 -1
- package/dist/chunks/BlockTypePickerRegistry-C_jLddOz.mjs +0 -2
- package/dist/chunks/BlockTypePickerRegistry-C_jLddOz.mjs.map +0 -1
- package/dist/chunks/BlockquotePlugin-BEaZSoVT.mjs +0 -2
- package/dist/chunks/BlockquotePlugin-BEaZSoVT.mjs.map +0 -1
- package/dist/chunks/CaretNavigationPlugin-DHl61oc6.mjs +0 -2
- package/dist/chunks/CaretNavigationPlugin-DHl61oc6.mjs.map +0 -1
- package/dist/chunks/CodeBlockPlugin-DglqiSNK.mjs +0 -2
- package/dist/chunks/CodeBlockPlugin-DglqiSNK.mjs.map +0 -1
- package/dist/chunks/ColorGrid-Czm0p2E9.mjs +0 -2
- package/dist/chunks/ColorGrid-Czm0p2E9.mjs.map +0 -1
- package/dist/chunks/ColorPickerPopup-CL-W380M.mjs +0 -2
- package/dist/chunks/ColorPickerPopup-CL-W380M.mjs.map +0 -1
- package/dist/chunks/ColorValidation-CiGxVsqd.mjs +0 -2
- package/dist/chunks/ColorValidation-CiGxVsqd.mjs.map +0 -1
- package/dist/chunks/CommandHelpers-DTlQcGv5.mjs +0 -2
- package/dist/chunks/CommandHelpers-DTlQcGv5.mjs.map +0 -1
- package/dist/chunks/Commands-BuYF23lf.mjs +0 -2
- package/dist/chunks/Commands-BuYF23lf.mjs.map +0 -1
- package/dist/chunks/Decoration-oeHDjWWq.mjs +0 -2
- package/dist/chunks/Decoration-oeHDjWWq.mjs.map +0 -1
- package/dist/chunks/DirectionDetection-Hun6-7ER.mjs +0 -2
- package/dist/chunks/DirectionDetection-Hun6-7ER.mjs.map +0 -1
- package/dist/chunks/DirectionIcons-CfaDcQ9a.mjs +0 -2
- package/dist/chunks/DirectionIcons-CfaDcQ9a.mjs.map +0 -1
- package/dist/chunks/Document-_qdGR4vh.mjs +0 -2
- package/dist/chunks/Document-_qdGR4vh.mjs.map +0 -1
- package/dist/chunks/DocumentParser-CyATBOz-.mjs +0 -2
- package/dist/chunks/DocumentParser-CyATBOz-.mjs.map +0 -1
- package/dist/chunks/FontPlugin-B-Sxa0UW.mjs +0 -2
- package/dist/chunks/FontPlugin-B-Sxa0UW.mjs.map +0 -1
- package/dist/chunks/FontSizePlugin-C1zlyXL2.mjs +0 -2
- package/dist/chunks/FontSizePlugin-C1zlyXL2.mjs.map +0 -1
- package/dist/chunks/GapCursorNavigation-BaXDnjFf.mjs +0 -2
- package/dist/chunks/GapCursorNavigation-BaXDnjFf.mjs.map +0 -1
- package/dist/chunks/GapCursorPlugin-nldun8cE.mjs +0 -2
- package/dist/chunks/GapCursorPlugin-nldun8cE.mjs.map +0 -1
- package/dist/chunks/HardBreakPlugin-DZRdsE15.mjs +0 -2
- package/dist/chunks/HardBreakPlugin-DZRdsE15.mjs.map +0 -1
- package/dist/chunks/HeadingPlugin-EPAmsEGt.mjs +0 -2
- package/dist/chunks/HeadingPlugin-EPAmsEGt.mjs.map +0 -1
- package/dist/chunks/HighlightPlugin-RN3l6pVJ.mjs +0 -2
- package/dist/chunks/HighlightPlugin-RN3l6pVJ.mjs.map +0 -1
- package/dist/chunks/HorizontalRulePlugin-BJPXzTtJ.mjs +0 -2
- package/dist/chunks/HorizontalRulePlugin-BJPXzTtJ.mjs.map +0 -1
- package/dist/chunks/ImagePlugin-CCEevNfJ.mjs +0 -2
- package/dist/chunks/ImagePlugin-CCEevNfJ.mjs.map +0 -1
- package/dist/chunks/InlineCodePlugin-B7IOgUSI.mjs +0 -2
- package/dist/chunks/InlineCodePlugin-B7IOgUSI.mjs.map +0 -1
- package/dist/chunks/KeyboardNav-CsdlWnNl.mjs +0 -2
- package/dist/chunks/KeyboardNav-CsdlWnNl.mjs.map +0 -1
- package/dist/chunks/LinkPlugin-Bhwg24lH.mjs +0 -2
- package/dist/chunks/LinkPlugin-Bhwg24lH.mjs.map +0 -1
- package/dist/chunks/ListPlugin-BkG6UO4x.mjs +0 -2
- package/dist/chunks/ListPlugin-BkG6UO4x.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-DVPpO5nC.mjs +0 -2
- package/dist/chunks/NodeResolver-DVPpO5nC.mjs.map +0 -1
- package/dist/chunks/NodeSelectionCommands-Ddxu5Qck.mjs +0 -2
- package/dist/chunks/NodeSelectionCommands-Ddxu5Qck.mjs.map +0 -1
- package/dist/chunks/PluginHelpers-D-MvWR98.mjs +0 -2
- package/dist/chunks/PluginHelpers-D-MvWR98.mjs.map +0 -1
- package/dist/chunks/PopupKeyboardPatterns-DQdL7RHx.mjs +0 -2
- package/dist/chunks/PopupKeyboardPatterns-DQdL7RHx.mjs.map +0 -1
- package/dist/chunks/PopupManager-CxPzNm-P.mjs +0 -2
- package/dist/chunks/PopupManager-CxPzNm-P.mjs.map +0 -1
- package/dist/chunks/PopupPositioning-DRNwWB0U.mjs +0 -2
- package/dist/chunks/PopupPositioning-DRNwWB0U.mjs.map +0 -1
- package/dist/chunks/PrintPlugin-DOk5IZRO.mjs +0 -2
- package/dist/chunks/PrintPlugin-DOk5IZRO.mjs.map +0 -1
- package/dist/chunks/PrintTypes-Drk6kLcl.mjs +0 -2
- package/dist/chunks/PrintTypes-Drk6kLcl.mjs.map +0 -1
- package/dist/chunks/RangeIterator-DytL1lUT.mjs +0 -2
- package/dist/chunks/RangeIterator-DytL1lUT.mjs.map +0 -1
- package/dist/chunks/ShortcutFormatting-DE6B8iGs.mjs +0 -2
- package/dist/chunks/ShortcutFormatting-DE6B8iGs.mjs.map +0 -1
- package/dist/chunks/SmartPastePlugin-DqKx94sH.mjs +0 -2
- package/dist/chunks/SmartPastePlugin-DqKx94sH.mjs.map +0 -1
- package/dist/chunks/StrikethroughPlugin-vYNzfxdy.mjs +0 -2
- package/dist/chunks/StrikethroughPlugin-vYNzfxdy.mjs.map +0 -1
- package/dist/chunks/SuperSubPlugin-BNsoXWHS.mjs +0 -2
- package/dist/chunks/SuperSubPlugin-BNsoXWHS.mjs.map +0 -1
- package/dist/chunks/SyntaxTokenTypes-CVUAMov0.mjs +0 -2
- package/dist/chunks/SyntaxTokenTypes-CVUAMov0.mjs.map +0 -1
- package/dist/chunks/TablePlugin-R-hmydrM.mjs +0 -2
- package/dist/chunks/TablePlugin-R-hmydrM.mjs.map +0 -1
- package/dist/chunks/TextColorPlugin-DQ-CB9cr.mjs +0 -2
- package/dist/chunks/TextColorPlugin-DQ-CB9cr.mjs.map +0 -1
- package/dist/chunks/TextDirectionAutoPlugin-kZ1tcu0d.mjs +0 -2
- package/dist/chunks/TextDirectionAutoPlugin-kZ1tcu0d.mjs.map +0 -1
- package/dist/chunks/TextDirectionPlugin-Bk3CkbYh.mjs +0 -2
- package/dist/chunks/TextDirectionPlugin-Bk3CkbYh.mjs.map +0 -1
- package/dist/chunks/TextDirectionService-DY4M8EwU.mjs +0 -2
- package/dist/chunks/TextDirectionService-DY4M8EwU.mjs.map +0 -1
- package/dist/chunks/TextFormattingPlugin-D13eP6nF.mjs +0 -2
- package/dist/chunks/TextFormattingPlugin-D13eP6nF.mjs.map +0 -1
- package/dist/chunks/ToolbarPlugin-DeH8n5d2.mjs +0 -2
- package/dist/chunks/ToolbarPlugin-DeH8n5d2.mjs.map +0 -1
- package/dist/chunks/WordBoundary-BE2u997Q.mjs +0 -2
- package/dist/chunks/WordBoundary-BE2u997Q.mjs.map +0 -1
- package/dist/chunks/XmlDetector-BtYxzBDa.mjs +0 -2
- package/dist/chunks/XmlDetector-BtYxzBDa.mjs.map +0 -1
- package/dist/chunks/XmlPatterns-DuP8GWVt.mjs +0 -2
- package/dist/chunks/XmlPatterns-DuP8GWVt.mjs.map +0 -1
- package/dist/chunks/XmlSupport-D54BdAJZ.mjs +0 -2
- package/dist/chunks/XmlSupport-D54BdAJZ.mjs.map +0 -1
- package/dist/chunks/ar-2Fkz_6nI.mjs +0 -2
- package/dist/chunks/ar-2Fkz_6nI.mjs.map +0 -1
- package/dist/chunks/ar-4ZPC8daa.mjs +0 -2
- package/dist/chunks/ar-4ZPC8daa.mjs.map +0 -1
- package/dist/chunks/ar-6I20_Djq.mjs +0 -2
- package/dist/chunks/ar-6I20_Djq.mjs.map +0 -1
- package/dist/chunks/ar-B7-Dm70S.mjs +0 -2
- package/dist/chunks/ar-B7-Dm70S.mjs.map +0 -1
- package/dist/chunks/ar-BRe0t96G.mjs +0 -2
- package/dist/chunks/ar-BRe0t96G.mjs.map +0 -1
- package/dist/chunks/ar-BnNyrtdi.mjs +0 -2
- package/dist/chunks/ar-BnNyrtdi.mjs.map +0 -1
- package/dist/chunks/ar-BsMfhWs5.mjs +0 -2
- package/dist/chunks/ar-BsMfhWs5.mjs.map +0 -1
- package/dist/chunks/ar-Bvja-bjE.mjs +0 -2
- package/dist/chunks/ar-Bvja-bjE.mjs.map +0 -1
- package/dist/chunks/ar-BxVbBvSa.mjs +0 -2
- package/dist/chunks/ar-BxVbBvSa.mjs.map +0 -1
- package/dist/chunks/ar-C5dW-co3.mjs +0 -2
- package/dist/chunks/ar-C5dW-co3.mjs.map +0 -1
- package/dist/chunks/ar-CARMr30L.mjs +0 -2
- package/dist/chunks/ar-CARMr30L.mjs.map +0 -1
- package/dist/chunks/ar-CB-pehGw.mjs +0 -2
- package/dist/chunks/ar-CB-pehGw.mjs.map +0 -1
- package/dist/chunks/ar-CEYgAxTM.mjs +0 -2
- package/dist/chunks/ar-CEYgAxTM.mjs.map +0 -1
- package/dist/chunks/ar-CO60qpZJ.mjs +0 -2
- package/dist/chunks/ar-CO60qpZJ.mjs.map +0 -1
- package/dist/chunks/ar-CtI_snUM.mjs +0 -2
- package/dist/chunks/ar-CtI_snUM.mjs.map +0 -1
- package/dist/chunks/ar-Cv1RQvhK.mjs +0 -2
- package/dist/chunks/ar-Cv1RQvhK.mjs.map +0 -1
- package/dist/chunks/ar-D5jV20Tu.mjs +0 -2
- package/dist/chunks/ar-D5jV20Tu.mjs.map +0 -1
- package/dist/chunks/ar-DJN9fQ7Z.mjs +0 -2
- package/dist/chunks/ar-DJN9fQ7Z.mjs.map +0 -1
- package/dist/chunks/ar-DPTsUnwA.mjs +0 -2
- package/dist/chunks/ar-DPTsUnwA.mjs.map +0 -1
- package/dist/chunks/ar-DZJIBD1Q.mjs +0 -2
- package/dist/chunks/ar-DZJIBD1Q.mjs.map +0 -1
- package/dist/chunks/ar-DkkbwV93.mjs +0 -2
- package/dist/chunks/ar-DkkbwV93.mjs.map +0 -1
- package/dist/chunks/ar-DmeMor8Y.mjs +0 -2
- package/dist/chunks/ar-DmeMor8Y.mjs.map +0 -1
- package/dist/chunks/ar-LnE7jPai.mjs +0 -2
- package/dist/chunks/ar-LnE7jPai.mjs.map +0 -1
- package/dist/chunks/ar-P3wW0fmA.mjs +0 -2
- package/dist/chunks/ar-P3wW0fmA.mjs.map +0 -1
- package/dist/chunks/ar-uum0DCfv.mjs +0 -2
- package/dist/chunks/ar-uum0DCfv.mjs.map +0 -1
- package/dist/chunks/color-picker-DlXhHBZ6.mjs +0 -2
- package/dist/chunks/color-picker-DlXhHBZ6.mjs.map +0 -1
- package/dist/chunks/de-8SHQu0rr.mjs +0 -2
- package/dist/chunks/de-8SHQu0rr.mjs.map +0 -1
- package/dist/chunks/de-B8a71A0X.mjs +0 -2
- package/dist/chunks/de-B8a71A0X.mjs.map +0 -1
- package/dist/chunks/de-B9weXoA1.mjs +0 -2
- package/dist/chunks/de-B9weXoA1.mjs.map +0 -1
- package/dist/chunks/de-BKm53tVU.mjs +0 -2
- package/dist/chunks/de-BKm53tVU.mjs.map +0 -1
- package/dist/chunks/de-BLWrnMfX.mjs +0 -2
- package/dist/chunks/de-BLWrnMfX.mjs.map +0 -1
- package/dist/chunks/de-BOujs1pF.mjs +0 -2
- package/dist/chunks/de-BOujs1pF.mjs.map +0 -1
- package/dist/chunks/de-B_1XleAG.mjs +0 -2
- package/dist/chunks/de-B_1XleAG.mjs.map +0 -1
- package/dist/chunks/de-BpmjrOMc.mjs +0 -2
- package/dist/chunks/de-BpmjrOMc.mjs.map +0 -1
- package/dist/chunks/de-C8OHD1fm.mjs +0 -2
- package/dist/chunks/de-C8OHD1fm.mjs.map +0 -1
- package/dist/chunks/de-CAVCXBBR.mjs +0 -2
- package/dist/chunks/de-CAVCXBBR.mjs.map +0 -1
- package/dist/chunks/de-CkMnuozT.mjs +0 -2
- package/dist/chunks/de-CkMnuozT.mjs.map +0 -1
- package/dist/chunks/de-CtDnvnnm.mjs +0 -2
- package/dist/chunks/de-CtDnvnnm.mjs.map +0 -1
- package/dist/chunks/de-Cz26vtXW.mjs +0 -2
- package/dist/chunks/de-Cz26vtXW.mjs.map +0 -1
- package/dist/chunks/de-D0BPSP3j.mjs +0 -2
- package/dist/chunks/de-D0BPSP3j.mjs.map +0 -1
- package/dist/chunks/de-D74v0paw.mjs +0 -2
- package/dist/chunks/de-D74v0paw.mjs.map +0 -1
- package/dist/chunks/de-DKj55F9g.mjs +0 -2
- package/dist/chunks/de-DKj55F9g.mjs.map +0 -1
- package/dist/chunks/de-DYuRb98l.mjs +0 -2
- package/dist/chunks/de-DYuRb98l.mjs.map +0 -1
- package/dist/chunks/de-DaK0-sdo.mjs +0 -2
- package/dist/chunks/de-DaK0-sdo.mjs.map +0 -1
- package/dist/chunks/de-Dia08Wsq.mjs +0 -2
- package/dist/chunks/de-Dia08Wsq.mjs.map +0 -1
- package/dist/chunks/de-Dp_uj2Z3.mjs +0 -2
- package/dist/chunks/de-Dp_uj2Z3.mjs.map +0 -1
- package/dist/chunks/de-DwX1CDNO.mjs +0 -2
- package/dist/chunks/de-DwX1CDNO.mjs.map +0 -1
- package/dist/chunks/de-DyF2mRfw.mjs +0 -2
- package/dist/chunks/de-DyF2mRfw.mjs.map +0 -1
- package/dist/chunks/de-X3BLBlF8.mjs +0 -2
- package/dist/chunks/de-X3BLBlF8.mjs.map +0 -1
- package/dist/chunks/de-dPC3Qk7N.mjs +0 -2
- package/dist/chunks/de-dPC3Qk7N.mjs.map +0 -1
- package/dist/chunks/de-pLGt5S7j.mjs +0 -2
- package/dist/chunks/de-pLGt5S7j.mjs.map +0 -1
- package/dist/chunks/es--xozZF4T.mjs +0 -2
- package/dist/chunks/es--xozZF4T.mjs.map +0 -1
- package/dist/chunks/es-2BjtTusm.mjs +0 -2
- package/dist/chunks/es-2BjtTusm.mjs.map +0 -1
- package/dist/chunks/es-B2rEK7_f.mjs +0 -2
- package/dist/chunks/es-B2rEK7_f.mjs.map +0 -1
- package/dist/chunks/es-B9esmUm1.mjs +0 -2
- package/dist/chunks/es-B9esmUm1.mjs.map +0 -1
- package/dist/chunks/es-BJxkHalP.mjs +0 -2
- package/dist/chunks/es-BJxkHalP.mjs.map +0 -1
- package/dist/chunks/es-BMKsnh3y.mjs +0 -2
- package/dist/chunks/es-BMKsnh3y.mjs.map +0 -1
- package/dist/chunks/es-BXFflrrU.mjs +0 -2
- package/dist/chunks/es-BXFflrrU.mjs.map +0 -1
- package/dist/chunks/es-BbX_lEEN.mjs +0 -2
- package/dist/chunks/es-BbX_lEEN.mjs.map +0 -1
- package/dist/chunks/es-BlHe_tc0.mjs +0 -2
- package/dist/chunks/es-BlHe_tc0.mjs.map +0 -1
- package/dist/chunks/es-Bu6nnEeT.mjs +0 -2
- package/dist/chunks/es-Bu6nnEeT.mjs.map +0 -1
- package/dist/chunks/es-Bx0CbUoY.mjs +0 -2
- package/dist/chunks/es-Bx0CbUoY.mjs.map +0 -1
- package/dist/chunks/es-CE9Tbsb7.mjs +0 -2
- package/dist/chunks/es-CE9Tbsb7.mjs.map +0 -1
- package/dist/chunks/es-COSomns3.mjs +0 -2
- package/dist/chunks/es-COSomns3.mjs.map +0 -1
- package/dist/chunks/es-C_7qthHu.mjs +0 -2
- package/dist/chunks/es-C_7qthHu.mjs.map +0 -1
- package/dist/chunks/es-CirfP3x1.mjs +0 -2
- package/dist/chunks/es-CirfP3x1.mjs.map +0 -1
- package/dist/chunks/es-CpF8eiPr.mjs +0 -2
- package/dist/chunks/es-CpF8eiPr.mjs.map +0 -1
- package/dist/chunks/es-D787y0ui.mjs +0 -2
- package/dist/chunks/es-D787y0ui.mjs.map +0 -1
- package/dist/chunks/es-D8iB5vwQ.mjs +0 -2
- package/dist/chunks/es-D8iB5vwQ.mjs.map +0 -1
- package/dist/chunks/es-DBb78XWu.mjs +0 -2
- package/dist/chunks/es-DBb78XWu.mjs.map +0 -1
- package/dist/chunks/es-DC6mYTD3.mjs +0 -2
- package/dist/chunks/es-DC6mYTD3.mjs.map +0 -1
- package/dist/chunks/es-Dh--mRZs.mjs +0 -2
- package/dist/chunks/es-Dh--mRZs.mjs.map +0 -1
- package/dist/chunks/es-DvPsYqFj.mjs +0 -2
- package/dist/chunks/es-DvPsYqFj.mjs.map +0 -1
- package/dist/chunks/es-DxXimuUa.mjs +0 -2
- package/dist/chunks/es-DxXimuUa.mjs.map +0 -1
- package/dist/chunks/es-mWJptxq3.mjs +0 -2
- package/dist/chunks/es-mWJptxq3.mjs.map +0 -1
- package/dist/chunks/es-qYV--o6U.mjs +0 -2
- package/dist/chunks/es-qYV--o6U.mjs.map +0 -1
- package/dist/chunks/fonts-CxtWyeNB.mjs +0 -2
- package/dist/chunks/fonts-CxtWyeNB.mjs.map +0 -1
- package/dist/chunks/fr--F426oao.mjs +0 -2
- package/dist/chunks/fr--F426oao.mjs.map +0 -1
- package/dist/chunks/fr-B0BPbbNB.mjs +0 -2
- package/dist/chunks/fr-B0BPbbNB.mjs.map +0 -1
- package/dist/chunks/fr-B4UQy0j-.mjs +0 -2
- package/dist/chunks/fr-B4UQy0j-.mjs.map +0 -1
- package/dist/chunks/fr-B4XLxkci.mjs +0 -2
- package/dist/chunks/fr-B4XLxkci.mjs.map +0 -1
- package/dist/chunks/fr-BC1Rfp9S.mjs +0 -2
- package/dist/chunks/fr-BC1Rfp9S.mjs.map +0 -1
- package/dist/chunks/fr-BRGGu0E2.mjs +0 -2
- package/dist/chunks/fr-BRGGu0E2.mjs.map +0 -1
- package/dist/chunks/fr-BoSz1pa9.mjs +0 -2
- package/dist/chunks/fr-BoSz1pa9.mjs.map +0 -1
- package/dist/chunks/fr-Bom3RFIN.mjs +0 -2
- package/dist/chunks/fr-Bom3RFIN.mjs.map +0 -1
- package/dist/chunks/fr-BtnwMUII.mjs +0 -2
- package/dist/chunks/fr-BtnwMUII.mjs.map +0 -1
- package/dist/chunks/fr-C6pglM3H.mjs +0 -2
- package/dist/chunks/fr-C6pglM3H.mjs.map +0 -1
- package/dist/chunks/fr-CDBpS6xE.mjs +0 -2
- package/dist/chunks/fr-CDBpS6xE.mjs.map +0 -1
- package/dist/chunks/fr-CN0ihkUg.mjs +0 -2
- package/dist/chunks/fr-CN0ihkUg.mjs.map +0 -1
- package/dist/chunks/fr-CNNBBeLM.mjs +0 -2
- package/dist/chunks/fr-CNNBBeLM.mjs.map +0 -1
- package/dist/chunks/fr-CVOY2y07.mjs +0 -2
- package/dist/chunks/fr-CVOY2y07.mjs.map +0 -1
- package/dist/chunks/fr-CZAbL_o0.mjs +0 -2
- package/dist/chunks/fr-CZAbL_o0.mjs.map +0 -1
- package/dist/chunks/fr-DJkPmQG_.mjs +0 -2
- package/dist/chunks/fr-DJkPmQG_.mjs.map +0 -1
- package/dist/chunks/fr-DkWdFDsR.mjs +0 -2
- package/dist/chunks/fr-DkWdFDsR.mjs.map +0 -1
- package/dist/chunks/fr-DnQHoPVo.mjs +0 -2
- package/dist/chunks/fr-DnQHoPVo.mjs.map +0 -1
- package/dist/chunks/fr-DsdueaiG.mjs +0 -2
- package/dist/chunks/fr-DsdueaiG.mjs.map +0 -1
- package/dist/chunks/fr-DxNdsa11.mjs +0 -2
- package/dist/chunks/fr-DxNdsa11.mjs.map +0 -1
- package/dist/chunks/fr-IO4_LYvE.mjs +0 -2
- package/dist/chunks/fr-IO4_LYvE.mjs.map +0 -1
- package/dist/chunks/fr-ZKDCEpww.mjs +0 -2
- package/dist/chunks/fr-ZKDCEpww.mjs.map +0 -1
- package/dist/chunks/fr-coufP_et.mjs +0 -2
- package/dist/chunks/fr-coufP_et.mjs.map +0 -1
- package/dist/chunks/fr-lYSOgOK7.mjs +0 -2
- package/dist/chunks/fr-lYSOgOK7.mjs.map +0 -1
- package/dist/chunks/fr-wobtRjcF.mjs +0 -2
- package/dist/chunks/fr-wobtRjcF.mjs.map +0 -1
- package/dist/chunks/full-5hGvv-bG.mjs +0 -2
- package/dist/chunks/full-5hGvv-bG.mjs.map +0 -1
- package/dist/chunks/hi-B0o90MFd.mjs +0 -2
- package/dist/chunks/hi-B0o90MFd.mjs.map +0 -1
- package/dist/chunks/hi-BFko34WG.mjs +0 -2
- package/dist/chunks/hi-BFko34WG.mjs.map +0 -1
- package/dist/chunks/hi-BVxSgaNT.mjs +0 -2
- package/dist/chunks/hi-BVxSgaNT.mjs.map +0 -1
- package/dist/chunks/hi-BirBQ5Ef.mjs +0 -2
- package/dist/chunks/hi-BirBQ5Ef.mjs.map +0 -1
- package/dist/chunks/hi-BnsbcSIX.mjs +0 -2
- package/dist/chunks/hi-BnsbcSIX.mjs.map +0 -1
- package/dist/chunks/hi-BoFuxLtG.mjs +0 -2
- package/dist/chunks/hi-BoFuxLtG.mjs.map +0 -1
- package/dist/chunks/hi-BptyTwAv.mjs +0 -2
- package/dist/chunks/hi-BptyTwAv.mjs.map +0 -1
- package/dist/chunks/hi-BulaYhi_.mjs +0 -2
- package/dist/chunks/hi-BulaYhi_.mjs.map +0 -1
- package/dist/chunks/hi-BzflHG6Y.mjs +0 -2
- package/dist/chunks/hi-BzflHG6Y.mjs.map +0 -1
- package/dist/chunks/hi-C7Hb-gQ_.mjs +0 -2
- package/dist/chunks/hi-C7Hb-gQ_.mjs.map +0 -1
- package/dist/chunks/hi-C_lY7kA9.mjs +0 -2
- package/dist/chunks/hi-C_lY7kA9.mjs.map +0 -1
- package/dist/chunks/hi-CkylXoIm.mjs +0 -2
- package/dist/chunks/hi-CkylXoIm.mjs.map +0 -1
- package/dist/chunks/hi-DGJTbrQi.mjs +0 -2
- package/dist/chunks/hi-DGJTbrQi.mjs.map +0 -1
- package/dist/chunks/hi-DGJgX0fG.mjs +0 -2
- package/dist/chunks/hi-DGJgX0fG.mjs.map +0 -1
- package/dist/chunks/hi-DKDYpjdr.mjs +0 -2
- package/dist/chunks/hi-DKDYpjdr.mjs.map +0 -1
- package/dist/chunks/hi-DfAX8S-T.mjs +0 -2
- package/dist/chunks/hi-DfAX8S-T.mjs.map +0 -1
- package/dist/chunks/hi-Dhq91ipt.mjs +0 -2
- package/dist/chunks/hi-Dhq91ipt.mjs.map +0 -1
- package/dist/chunks/hi-Dup389dM.mjs +0 -2
- package/dist/chunks/hi-Dup389dM.mjs.map +0 -1
- package/dist/chunks/hi-DzRFsYYN.mjs +0 -2
- package/dist/chunks/hi-DzRFsYYN.mjs.map +0 -1
- package/dist/chunks/hi-ObZRwITd.mjs +0 -2
- package/dist/chunks/hi-ObZRwITd.mjs.map +0 -1
- package/dist/chunks/hi-VvUzjfH_.mjs +0 -2
- package/dist/chunks/hi-VvUzjfH_.mjs.map +0 -1
- package/dist/chunks/hi-jWQDQkOX.mjs +0 -2
- package/dist/chunks/hi-jWQDQkOX.mjs.map +0 -1
- package/dist/chunks/hi-l3hIrp8J.mjs +0 -2
- package/dist/chunks/hi-l3hIrp8J.mjs.map +0 -1
- package/dist/chunks/hi-o8Gsu5Ly.mjs +0 -2
- package/dist/chunks/hi-o8Gsu5Ly.mjs.map +0 -1
- package/dist/chunks/hi-sxC2nk3h.mjs +0 -2
- package/dist/chunks/hi-sxC2nk3h.mjs.map +0 -1
- package/dist/chunks/minimal-pBhi4EJI.mjs +0 -2
- package/dist/chunks/minimal-pBhi4EJI.mjs.map +0 -1
- package/dist/chunks/pt--57Ug7ig.mjs +0 -2
- package/dist/chunks/pt--57Ug7ig.mjs.map +0 -1
- package/dist/chunks/pt-4j8Km9Db.mjs +0 -2
- package/dist/chunks/pt-4j8Km9Db.mjs.map +0 -1
- package/dist/chunks/pt-BTGFKCns.mjs +0 -2
- package/dist/chunks/pt-BTGFKCns.mjs.map +0 -1
- package/dist/chunks/pt-BU8Qfuoz.mjs +0 -2
- package/dist/chunks/pt-BU8Qfuoz.mjs.map +0 -1
- package/dist/chunks/pt-BYAOJxIB.mjs +0 -2
- package/dist/chunks/pt-BYAOJxIB.mjs.map +0 -1
- package/dist/chunks/pt-BjNWQm9A.mjs +0 -2
- package/dist/chunks/pt-BjNWQm9A.mjs.map +0 -1
- package/dist/chunks/pt-Bvnb_NpT.mjs +0 -2
- package/dist/chunks/pt-Bvnb_NpT.mjs.map +0 -1
- package/dist/chunks/pt-C2pkn7vo.mjs +0 -2
- package/dist/chunks/pt-C2pkn7vo.mjs.map +0 -1
- package/dist/chunks/pt-C8MhLnWx.mjs +0 -2
- package/dist/chunks/pt-C8MhLnWx.mjs.map +0 -1
- package/dist/chunks/pt-CJfYLSTe.mjs +0 -2
- package/dist/chunks/pt-CJfYLSTe.mjs.map +0 -1
- package/dist/chunks/pt-CdwVIYOK.mjs +0 -2
- package/dist/chunks/pt-CdwVIYOK.mjs.map +0 -1
- package/dist/chunks/pt-CwrVo90O.mjs +0 -2
- package/dist/chunks/pt-CwrVo90O.mjs.map +0 -1
- package/dist/chunks/pt-DD26CKCA.mjs +0 -2
- package/dist/chunks/pt-DD26CKCA.mjs.map +0 -1
- package/dist/chunks/pt-DLbf6uoo.mjs +0 -2
- package/dist/chunks/pt-DLbf6uoo.mjs.map +0 -1
- package/dist/chunks/pt-DNyNHwKh.mjs +0 -2
- package/dist/chunks/pt-DNyNHwKh.mjs.map +0 -1
- package/dist/chunks/pt-DVfMAcXb.mjs +0 -2
- package/dist/chunks/pt-DVfMAcXb.mjs.map +0 -1
- package/dist/chunks/pt-DWSFad3n.mjs +0 -2
- package/dist/chunks/pt-DWSFad3n.mjs.map +0 -1
- package/dist/chunks/pt-DZXY4i4G.mjs +0 -2
- package/dist/chunks/pt-DZXY4i4G.mjs.map +0 -1
- package/dist/chunks/pt-DfUpRhK1.mjs +0 -2
- package/dist/chunks/pt-DfUpRhK1.mjs.map +0 -1
- package/dist/chunks/pt-DlvNEDeW.mjs +0 -2
- package/dist/chunks/pt-DlvNEDeW.mjs.map +0 -1
- package/dist/chunks/pt-DzFyGwB4.mjs +0 -2
- package/dist/chunks/pt-DzFyGwB4.mjs.map +0 -1
- package/dist/chunks/pt-HhQcARW6.mjs +0 -2
- package/dist/chunks/pt-HhQcARW6.mjs.map +0 -1
- package/dist/chunks/pt-SjvTF40s.mjs +0 -2
- package/dist/chunks/pt-SjvTF40s.mjs.map +0 -1
- package/dist/chunks/pt-ihNE0VQJ.mjs +0 -2
- package/dist/chunks/pt-ihNE0VQJ.mjs.map +0 -1
- package/dist/chunks/pt-zfCjhIgy.mjs +0 -2
- package/dist/chunks/pt-zfCjhIgy.mjs.map +0 -1
- package/dist/chunks/ru-0AHodbWv.mjs +0 -2
- package/dist/chunks/ru-0AHodbWv.mjs.map +0 -1
- package/dist/chunks/ru-2MDGmLw0.mjs +0 -2
- package/dist/chunks/ru-2MDGmLw0.mjs.map +0 -1
- package/dist/chunks/ru-3VfYKfTm.mjs +0 -2
- package/dist/chunks/ru-3VfYKfTm.mjs.map +0 -1
- package/dist/chunks/ru-B-gRJ6nQ.mjs +0 -2
- package/dist/chunks/ru-B-gRJ6nQ.mjs.map +0 -1
- package/dist/chunks/ru-B6ITUB-Y.mjs +0 -2
- package/dist/chunks/ru-B6ITUB-Y.mjs.map +0 -1
- package/dist/chunks/ru-BKDWkabk.mjs +0 -2
- package/dist/chunks/ru-BKDWkabk.mjs.map +0 -1
- package/dist/chunks/ru-BMxJsSe3.mjs +0 -2
- package/dist/chunks/ru-BMxJsSe3.mjs.map +0 -1
- package/dist/chunks/ru-Bep1iHQL.mjs +0 -2
- package/dist/chunks/ru-Bep1iHQL.mjs.map +0 -1
- package/dist/chunks/ru-Blj0nqoL.mjs +0 -2
- package/dist/chunks/ru-Blj0nqoL.mjs.map +0 -1
- package/dist/chunks/ru-BqnHkmii.mjs +0 -2
- package/dist/chunks/ru-BqnHkmii.mjs.map +0 -1
- package/dist/chunks/ru-C-4AaPUK.mjs +0 -2
- package/dist/chunks/ru-C-4AaPUK.mjs.map +0 -1
- package/dist/chunks/ru-C9Nv7JJI.mjs +0 -2
- package/dist/chunks/ru-C9Nv7JJI.mjs.map +0 -1
- package/dist/chunks/ru-CJFtr1Ks.mjs +0 -2
- package/dist/chunks/ru-CJFtr1Ks.mjs.map +0 -1
- package/dist/chunks/ru-CN63yWk_.mjs +0 -2
- package/dist/chunks/ru-CN63yWk_.mjs.map +0 -1
- package/dist/chunks/ru-CcFX97-2.mjs +0 -2
- package/dist/chunks/ru-CcFX97-2.mjs.map +0 -1
- package/dist/chunks/ru-D8PhWFSp.mjs +0 -2
- package/dist/chunks/ru-D8PhWFSp.mjs.map +0 -1
- package/dist/chunks/ru-DYAncidS.mjs +0 -2
- package/dist/chunks/ru-DYAncidS.mjs.map +0 -1
- package/dist/chunks/ru-D_zXo-FA.mjs +0 -2
- package/dist/chunks/ru-D_zXo-FA.mjs.map +0 -1
- package/dist/chunks/ru-DhSPV6m0.mjs +0 -2
- package/dist/chunks/ru-DhSPV6m0.mjs.map +0 -1
- package/dist/chunks/ru-LNbpjKCw.mjs +0 -2
- package/dist/chunks/ru-LNbpjKCw.mjs.map +0 -1
- package/dist/chunks/ru-LXi1ONW4.mjs +0 -2
- package/dist/chunks/ru-LXi1ONW4.mjs.map +0 -1
- package/dist/chunks/ru-db7wsWkx.mjs +0 -2
- package/dist/chunks/ru-db7wsWkx.mjs.map +0 -1
- package/dist/chunks/ru-nZ4BjiD0.mjs +0 -2
- package/dist/chunks/ru-nZ4BjiD0.mjs.map +0 -1
- package/dist/chunks/ru-v9zumXd2.mjs +0 -2
- package/dist/chunks/ru-v9zumXd2.mjs.map +0 -1
- package/dist/chunks/ru-wK2ytv3A.mjs +0 -2
- package/dist/chunks/ru-wK2ytv3A.mjs.map +0 -1
- package/dist/chunks/src-CNK6vpUU.mjs +0 -2
- package/dist/chunks/src-CNK6vpUU.mjs.map +0 -1
- package/dist/chunks/zh-9AcCSFm0.mjs +0 -2
- package/dist/chunks/zh-9AcCSFm0.mjs.map +0 -1
- package/dist/chunks/zh-B3bJCfdB.mjs +0 -2
- package/dist/chunks/zh-B3bJCfdB.mjs.map +0 -1
- package/dist/chunks/zh-B46Dt1h7.mjs +0 -2
- package/dist/chunks/zh-B46Dt1h7.mjs.map +0 -1
- package/dist/chunks/zh-BRy2B6Og.mjs +0 -2
- package/dist/chunks/zh-BRy2B6Og.mjs.map +0 -1
- package/dist/chunks/zh-BfYi8wB2.mjs +0 -2
- package/dist/chunks/zh-BfYi8wB2.mjs.map +0 -1
- package/dist/chunks/zh-C0I3L6NA.mjs +0 -2
- package/dist/chunks/zh-C0I3L6NA.mjs.map +0 -1
- package/dist/chunks/zh-C33e4gfg.mjs +0 -2
- package/dist/chunks/zh-C33e4gfg.mjs.map +0 -1
- package/dist/chunks/zh-C9sNwnC1.mjs +0 -2
- package/dist/chunks/zh-C9sNwnC1.mjs.map +0 -1
- package/dist/chunks/zh-CACr0qSo.mjs +0 -2
- package/dist/chunks/zh-CACr0qSo.mjs.map +0 -1
- package/dist/chunks/zh-CU0hd8zq.mjs +0 -2
- package/dist/chunks/zh-CU0hd8zq.mjs.map +0 -1
- package/dist/chunks/zh-CX2zUoWR.mjs +0 -2
- package/dist/chunks/zh-CX2zUoWR.mjs.map +0 -1
- package/dist/chunks/zh-CblZ-34H.mjs +0 -2
- package/dist/chunks/zh-CblZ-34H.mjs.map +0 -1
- package/dist/chunks/zh-CicpU0g8.mjs +0 -2
- package/dist/chunks/zh-CicpU0g8.mjs.map +0 -1
- package/dist/chunks/zh-Cr3KdEZV.mjs +0 -2
- package/dist/chunks/zh-Cr3KdEZV.mjs.map +0 -1
- package/dist/chunks/zh-D24dsCiw.mjs +0 -2
- package/dist/chunks/zh-D24dsCiw.mjs.map +0 -1
- package/dist/chunks/zh-DQtLxQ3s.mjs +0 -2
- package/dist/chunks/zh-DQtLxQ3s.mjs.map +0 -1
- package/dist/chunks/zh-DR1OF5vm.mjs +0 -2
- package/dist/chunks/zh-DR1OF5vm.mjs.map +0 -1
- package/dist/chunks/zh-DS82x1KL.mjs +0 -2
- package/dist/chunks/zh-DS82x1KL.mjs.map +0 -1
- package/dist/chunks/zh-DdJA-AEY.mjs +0 -2
- package/dist/chunks/zh-DdJA-AEY.mjs.map +0 -1
- package/dist/chunks/zh-DpVlDZ9n.mjs +0 -2
- package/dist/chunks/zh-DpVlDZ9n.mjs.map +0 -1
- package/dist/chunks/zh-OWVKcbVR.mjs +0 -2
- package/dist/chunks/zh-OWVKcbVR.mjs.map +0 -1
- package/dist/chunks/zh-d19V68ib.mjs +0 -2
- package/dist/chunks/zh-d19V68ib.mjs.map +0 -1
- package/dist/chunks/zh-fSMt1FnB.mjs +0 -2
- package/dist/chunks/zh-fSMt1FnB.mjs.map +0 -1
- package/dist/chunks/zh-mLlk9Wki.mjs +0 -2
- package/dist/chunks/zh-mLlk9Wki.mjs.map +0 -1
- package/dist/chunks/zh-nnMt8E6m.mjs +0 -2
- package/dist/chunks/zh-nnMt8E6m.mjs.map +0 -1
- package/dist/plugins/smart-paste/detectors/JavaDetector.d.ts +0 -7
- package/dist/plugins/smart-paste/detectors/JavaDetector.d.ts.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{l as t,r as e,y as n}from"./Document-_qdGR4vh.mjs";import{c as i,l as r,r as o}from"./Selection-aeiSsvhe.mjs";import{a}from"./TypeBrands-BZDKMjR-.mjs";import{n as s}from"./DomUtils-RKbAVBQz.mjs";import{r as l}from"./HTMLUtils-brwcaufP.mjs";import{t as c}from"./NodeSelectionCommands-Ddxu5Qck.mjs";import{t as d}from"./Platform-D9TRT4Mn.mjs";import{c as g,o as m,r as u,s as p}from"./StyleRuntime-D3d1XFFe.mjs";import{n as h}from"./TypedKeys-CU7aToqY.mjs";import{i as f,o as b}from"./PluginHelpers-D-MvWR98.mjs";import{t as v}from"./ShortcutFormatting-DE6B8iGs.mjs";function x(s,l){const c=s.getState(),d=c.selection,g={src:l.src,alt:l.alt??"",align:l.align??"center",...void 0!==l.width?{width:l.width}:{},...void 0!==l.height?{height:l.height}:{}};if(i(d))return!1;const m=r(d)?d.nodeId:d.anchor.blockId,u=function(t,e){if("table_cell"===t.getBlock(e)?.type)return e;const n=t.getNodePath(e);if(n)for(const i of n)if("table_cell"===t.getBlock(i)?.type)return i}(c,m);return u?function(i,r,s,l){const c=i.getNodePath(s);if(!c)return!1;const d=e(a("image"),[],void 0,l),g=i.getBlock(s);if(!g)return!1;const m=i.transaction("command"),u=t(g);for(let t=u.length-1;t>=0;t--){const e=g.children.findIndex(e=>n(e)&&e.id===u[t]?.id);-1!==e&&m.removeNode(c,e)}return m.insertNode(c,0,d),m.setSelection(o(d.id,[...c,d.id])),r.dispatch(m.build()),!0}(c,s,u,g):function(t,n,i,r){const s=t.doc.children.findIndex(t=>t.id===i);if(-1===s)return!1;const l=e(a("image"),[],void 0,r),c=e(a("paragraph")),d=t.transaction("command").insertNode([],s+1,l).insertNode([],s+2,c).setSelection(o(l.id,[])).build();return n.dispatch(d),!0}(c,s,m,g)}function w(t,e,n){const i=t.getState(),o=i.selection;if(!r(o))return!1;const a=i.getBlock(o.nodeId);if(!a||"image"!==a.type)return!1;const s=a.attrs?.width,l=a.attrs?.height;if(void 0===s||void 0===l)return!1;const c=l>0?s/l:1,d=Math.max(50,Math.min(n,s+e)),g=Math.round(d/c);return(d!==s||g!==l)&&function(t,e){const n=t.getState(),i=n.selection;if(!r(i))return!1;const o=n.getBlock(i.nodeId);if(!o||"image"!==o.type)return!1;const a=n.getNodePath(i.nodeId);if(!a)return!1;const s={...o.attrs??{},...e},l=n.transaction("command").setNodeAttr(a,s).build();return t.dispatch(l),!0}(t,{width:d,height:g})}var z={insertImage:"Insert Image",insertImageTooltip:"Insert Image",uploadFromComputer:"Upload from computer",uploadAria:"Upload image from computer",separator:"or",urlPlaceholder:"https://...",urlAria:"Image URL",insertButton:"Insert",insertAria:"Insert image",imageAria:(t,e,n)=>{const i=[t||"Image"];return void 0!==e&&void 0!==n&&i.push(`${e} by ${n} pixels`),i.join(", ")},resetToNaturalSize:"Image reset to natural size.",uploadFailed:"Upload failed.",uploading:"Uploading...",resizeHandleLabel:t=>`Resize ${t}`,imageSelected:"Image selected.",altTextPrefix:"Alt text: ",imageSizeAnnounce:(t,e)=>`Size: ${t} by ${e} pixels.`,resizeHint:(t,e)=>`${t} / ${e} to resize.`,imageResized:(t,e)=>`Image resized to ${t} by ${e} pixels.`,keyboardResizeHint:(t,e)=>`${t} / ${e} to resize`},y=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-CO60qpZJ.mjs"),"./locales/de.ts":()=>import("./de-BpmjrOMc.mjs"),"./locales/es.ts":()=>import("./es-BbX_lEEN.mjs"),"./locales/fr.ts":()=>import("./fr-CZAbL_o0.mjs"),"./locales/hi.ts":()=>import("./hi-Dup389dM.mjs"),"./locales/pt.ts":()=>import("./pt-C8MhLnWx.mjs"),"./locales/ru.ts":()=>import("./ru-v9zumXd2.mjs"),"./locales/zh.ts":()=>import("./zh-B46Dt1h7.mjs")});async function _(t){return b(y,t,z)}var S={start:"notectl-image--start",center:"notectl-image--center",end:"notectl-image--end"},I={nw:"nwse-resize",ne:"nesw-resize",sw:"nesw-resize",se:"nwse-resize"},k={nw:-1,ne:1,sw:-1,se:1},L={nw:"top-left",ne:"top-right",sw:"bottom-left",se:"bottom-right"},C={nw:"top-right",ne:"top-left",sw:"bottom-right",se:"bottom-left"},A={nw:"nesw-resize",ne:"nwse-resize",sw:"nwse-resize",se:"nesw-resize"};function N(t,e,n=z){const i=(e?C:L)[t];return n.resizeHandleLabel(i)}var j=null;function E(){j&&(j.remove(),j=null)}function $(t,e,n,i=z){return(r,o,a)=>{const s=document.createElement("figure");s.className="notectl-image",s.setAttribute("data-block-id",r.id),s.setAttribute("data-void","true"),s.setAttribute("data-selectable","true");const l=document.createElement("div");l.className="notectl-image__container";const c=document.createElement("img");c.className="notectl-image__img",c.draggable=!1;const g=document.createElement("div");g.className="notectl-image__overlay",l.appendChild(c),l.appendChild(g),s.appendChild(l);let h=r.id,f=null;function b(t){const n=t.attrs?.src??"",r=t.attrs?.alt??"",o=t.attrs?.width,a=t.attrs?.height,l=t.attrs?.align??"center";c.src!==n&&(c.src=n),c.alt=r,p(c,"width",void 0!==o?`${o}px`:""),p(c,"height",void 0!==a?`${a}px`:"");for(const e of Object.values(S))s.classList.remove(e);const d=S[l];d&&s.classList.add(d);const m=e.get(t.id)??"idle",u="uploading"===m;g.classList.toggle("notectl-image__overlay--uploading",u),g.classList.toggle("notectl-image__overlay--error","error"===m),g.textContent=u?i.uploading:"error"===m?i.uploadFailed:"",u?s.setAttribute("aria-busy","true"):s.removeAttribute("aria-busy"),function(t){const e=t.attrs?.alt??"",n=t.attrs?.width,r=t.attrs?.height;s.setAttribute("aria-label",i.imageAria(e,n,r))}(t)}b(r);let x=!1;function w(e,n,i,r){let l=0,g=0,p=1,h=k[n];const f=e=>{const n=e.clientX-l,i=(o=g+n*h,Math.max(50,Math.min(t.maxWidth,o)));var o;const a=Math.round(i/p);m(c,{width:`${i}px`,height:`${a}px`}),r.textContent=`${Math.round(i)} × ${a}`},b=t=>{document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",b),s.classList.remove("notectl-image--resizing"),r.classList.remove("notectl-image__size-indicator--visible"),E();const e=Math.round(c.getBoundingClientRect().width);!function(t,e,n){const i=o(),r=i.getBlock(t);if(!r)return;const s=r.attrs?.width,l=r.attrs?.height;if(s===e&&l===n)return;const c=i.getNodePath(t);if(!c)return;const d={...r.attrs??{},width:e,height:n};a(i.transaction("command").setNodeAttr(c,d).build())}(i,e,Math.round(e/p)),t.target?.releasePointerCapture?.(t.pointerId)};e.addEventListener("pointerdown",t=>{t.preventDefault(),t.stopPropagation();const e="rtl"===d(s);h=function(t,e){const n=k[t];return e?-n:n}(n,e),l=t.clientX,g=c.getBoundingClientRect().width;const i=c.getBoundingClientRect().height;p=i>0?g/i:1,s.classList.add("notectl-image--resizing"),r.textContent=`${Math.round(g)} × ${Math.round(i)}`,r.classList.add("notectl-image__size-indicator--visible"),function(t,e){E(),j=document.createElement("style");const n=e?u(e):void 0;n&&j.setAttribute("nonce",n),j.textContent=`*{cursor:${t}!important;user-select:none!important}`,document.head.appendChild(j)}(e?A[n]:I[n],s),t.target.setPointerCapture(t.pointerId),document.addEventListener("pointermove",f),document.addEventListener("pointerup",b)})}function z(){E(),f&&(f.remove(),f=null)}return c.addEventListener("load",()=>{if(x)return;const e=o(),n=e.getBlock(h);if(!n||"image"!==n.type)return;const i=void 0!==n.attrs?.width,r=void 0!==n.attrs?.height;if(i&&r)return void(x=!0);const s=c.naturalWidth,l=c.naturalHeight;if(0===s||0===l)return;const d=Math.min(s,t.maxWidth),g=s>0?l/s:1,m=Math.round(d*g),u=e.getNodePath(h);if(!u)return;const p={...n.attrs??{},width:d,height:m};a(e.transaction("command").setNodeAttr(u,p).build()),x=!0}),{dom:s,contentDOM:null,update:t=>"image"===t.type&&(h=t.id,s.setAttribute("data-block-id",t.id),b(t),!0),selectNode(){s.classList.add("notectl-image--selected"),function(e){if(!t.resizable||f)return;f=document.createElement("div"),f.className="notectl-image__resize-overlay",f.setAttribute("data-notectl-no-print","");const r=document.createElement("div");r.className="notectl-image__size-indicator",f.appendChild(r);const o="rtl"===d(s);for(const t of["nw","ne","sw","se"]){const n=document.createElement("div");n.className=`notectl-image__resize-handle notectl-image__resize-handle--${t}`,n.setAttribute("role","separator"),n.setAttribute("aria-label",N(t,o,i)),w(n,t,e,r),f.appendChild(n)}if(n){const t=function(t,e){const n=t.shrinkWidth??null,i=t.growWidth??null;return n&&i?e.keyboardResizeHint(v(n),v(i)):""}(n,i);if(t){const e=document.createElement("div");e.className="notectl-image__keyboard-hint",e.setAttribute("aria-hidden","true"),e.textContent=t,f.appendChild(e)}}l.appendChild(f)}(h)},deselectNode(){s.classList.remove("notectl-image--selected"),z()},destroy(){z()}}}}var R=new h("image:upload"),M={growWidth:"Mod-Shift-ArrowRight",shrinkWidth:"Mod-Shift-ArrowLeft",growWidthLarge:"Mod-Shift-Alt-ArrowRight",shrinkWidthLarge:"Mod-Shift-Alt-ArrowLeft",resetSize:"Mod-Shift-0"},T={maxWidth:800,maxFileSize:10485760,acceptedTypes:["image/png","image/jpeg","image/gif","image/webp","image/svg+xml"],resizable:!0,resizeStep:10,resizeStepLarge:50},U=class{id="image";name="Image";priority=45;config;resolvedKeymap;uploadStates=/* @__PURE__ */new Map;blobUrls=/* @__PURE__ */new Set;context=null;locale;constructor(t){this.config={...T,...t},this.resolvedKeymap={...M,...t?.keymap}}async init(t){this.locale=await f(t,this.config.locale,z,_),t.registerStyleSheet('\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'),this.context=t,this.registerNodeSpec(t),this.registerNodeView(t),function(t){t.registerCommand("insertImage",()=>x(t,{src:""})),t.registerCommand("removeImage",()=>function(t){const e=t.getState(),n=e.selection;if(!r(n))return!1;const i=e.getBlock(n.nodeId);if(!i||"image"!==i.type)return!1;const a=e.getNodePath(n.nodeId);if(!a||0===a.length)return!1;const s=c(e,o(n.nodeId,a));return!!s&&(t.dispatch(s),!0)}(t))}(t),this.registerResizeCommands(t),this.registerResizeKeymaps(t),this.registerFileHandler(t),this.registerToolbarItem(t)}destroy(){for(const t of this.blobUrls)URL.revokeObjectURL(t);this.blobUrls.clear(),this.uploadStates.clear(),this.context=null}onStateChange(t,e,n){if(!this.context)return;for(const o of this.uploadStates.keys())e.getBlock(o)||this.uploadStates.delete(o);const i=this.isImageSelected(t),r=this.isImageSelected(e);!i&&r&&this.announceImageSelection(e)}registerNodeSpec(t){const e=this.locale;t.registerNodeSpec({type:"image",group:"block",isVoid:!0,selectable:!0,attrs:{src:{default:""},alt:{default:""},align:{default:"center"}},toDOM(t){const n=s("figure",t.id);n.className="notectl-image",n.setAttribute("data-void","true"),n.setAttribute("data-selectable","true");const i=document.createElement("div");i.className="notectl-image__container";const r=t.attrs?.alt??"",o=t.attrs?.width,a=t.attrs?.height,l=document.createElement("img");l.className="notectl-image__img",l.src=t.attrs?.src??"",l.alt=r,l.draggable=!1,void 0!==o&&p(l,"width",`${o}px`),void 0!==a&&p(l,"height",`${a}px`);const c={start:"notectl-image--start",center:"notectl-image--center",end:"notectl-image--end"}[t.attrs?.align??"center"];return c&&n.classList.add(c),n.setAttribute("aria-label",e.imageAria(r,o,a)),i.appendChild(l),n.appendChild(i),n},toHTML(t){const e=l(t.attrs?.src??""),n=l(t.attrs?.alt??""),i=t.attrs?.width,r=t.attrs?.height;return`<figure><img src="${e}" alt="${n}"${(void 0!==i?` width="${i}"`:"")+(void 0!==r?` height="${r}"`:"")}></figure>`},parseHTML:[{tag:"figure",getAttrs(t){const e=t.querySelector("img");if(!e)return!1;const n={src:e.getAttribute("src")??"",alt:e.getAttribute("alt")??"",align:"center"},i=e.getAttribute("width"),r=e.getAttribute("height");i&&(n.width=Number.parseInt(i,10)),r&&(n.height=Number.parseInt(r,10));const o=t.style?.textAlign??"";return"start"===o||"end"===o||"center"===o?n.align=o:"left"===o?n.align="start":"right"===o?n.align="end":t.classList.contains("notectl-align-start")||t.classList.contains("notectl-align-left")||t.classList.contains("notectl-image--start")||t.classList.contains("notectl-image--left")?n.align="start":t.classList.contains("notectl-align-end")||t.classList.contains("notectl-align-right")||t.classList.contains("notectl-image--end")||t.classList.contains("notectl-image--right")?n.align="end":t.classList.contains("notectl-align-center")&&(n.align="center"),n}},{tag:"img",getAttrs(t){const e={src:t.getAttribute("src")??"",alt:t.getAttribute("alt")??"",align:"center"},n=t.getAttribute("width"),i=t.getAttribute("height");return n&&(e.width=Number.parseInt(n,10)),i&&(e.height=Number.parseInt(i,10)),e}}],sanitize:{tags:["figure","img"],attrs:["src","alt","width","height","class","style"]}})}registerNodeView(t){t.registerNodeView("image",$(this.config,this.uploadStates,this.resolvedKeymap,this.locale))}registerResizeCommands(t){const e=this.config.resizeStep??10,n=this.config.resizeStepLarge??50,i=this.config.maxWidth;t.registerCommand("resizeImageGrow",()=>{const n=w(t,e,i);return n&&this.announceCurrentSize(t),n}),t.registerCommand("resizeImageShrink",()=>{const n=w(t,-e,i);return n&&this.announceCurrentSize(t),n}),t.registerCommand("resizeImageGrowLarge",()=>{const e=w(t,n,i);return e&&this.announceCurrentSize(t),e}),t.registerCommand("resizeImageShrinkLarge",()=>{const e=w(t,-n,i);return e&&this.announceCurrentSize(t),e}),t.registerCommand("resetImageSize",()=>{const e=function(t){const e=t.getState(),n=e.selection;if(!r(n))return!1;const i=e.getBlock(n.nodeId);if(!i||"image"!==i.type)return!1;const o=e.getNodePath(n.nodeId);if(!o)return!1;const a={...i.attrs??{}},s=Object.fromEntries(Object.entries(a).filter(([t])=>"width"!==t&&"height"!==t)),l=e.transaction("command").setNodeAttr(o,s).build();return t.dispatch(l),!0}(t);return e&&t.announce(this.locale.resetToNaturalSize),e})}registerResizeKeymaps(t){const e={};for(const[n,i]of Object.entries({growWidth:"resizeImageGrow",shrinkWidth:"resizeImageShrink",growWidthLarge:"resizeImageGrowLarge",shrinkWidthLarge:"resizeImageShrinkLarge",resetSize:"resetImageSize"})){const r=this.resolvedKeymap[n]??null;r&&(e[r]=()=>t.executeCommand(i))}Object.keys(e).length>0&&t.registerKeymap(e)}registerFileHandler(t){t.registerFileHandler("image/*",async(e,n)=>!!this.isAcceptedType(e.type)&&(this.handleFileInsert(t,e),!0))}handleFileInsert(t,e){if(e.size>this.config.maxFileSize)return;const n=URL.createObjectURL(e);if(this.blobUrls.add(n),!x(t,{src:n}))return URL.revokeObjectURL(n),void this.blobUrls.delete(n);const i=t.getState().selection;if(!r(i))return;const o=i.nodeId;this.uploadStates.set(o,"uploading"),t.getService(R)?this.uploadFile(t,e,o,n):this.uploadStates.set(o,"complete")}async uploadFile(t,e,n,i){const r=t.getService(R);if(r)try{const o=await r.upload(e);this.uploadStates.set(n,"complete");const a=t.getState(),s=a.getBlock(n);if(!s)return;const l=a.getNodePath(n);if(!l)return;const c={...s.attrs??{},src:o.url,...void 0!==o.width?{width:o.width}:{},...void 0!==o.height?{height:o.height}:{}},d=a.transaction("command").setNodeAttr(l,c).build();t.dispatch(d),URL.revokeObjectURL(i),this.blobUrls.delete(i)}catch{this.uploadStates.set(n,"error"),t.announce(this.locale.uploadFailed)}}registerToolbarItem(t){t.registerToolbarItem({id:"image",group:"insert",icon:'<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>',label:this.locale.insertImage,tooltip:this.locale.insertImageTooltip,command:"insertImage",popupType:"custom",renderPopup:(t,e,n)=>{!function(t,e,n){p(t,"padding","8px"),p(t,"minWidth","240px"),function(t,e,n){const i=document.createElement("input");i.type="file",i.accept=n.acceptedTypes.join(","),g(i,"position:absolute;width:0;height:0;overflow:hidden;opacity:0;");const r=document.createElement("button");r.type="button",r.textContent=n.locale.uploadFromComputer,r.setAttribute("aria-label",n.locale.uploadAria),g(r,"display:block;width:100%;padding:8px 12px;cursor:pointer;text-align:center;box-sizing:border-box;border:1px solid var(--notectl-border);border-radius:4px;background:var(--notectl-surface-raised);color:var(--notectl-fg);"),r.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),i.click()}),i.addEventListener("change",()=>{const t=i.files?.[0];t&&(n.onFileInsert(e,t),n.onClose(),e.getContainer().focus())}),t.appendChild(i),t.appendChild(r)}(t,e,n),function(t,e){const n=document.createElement("div");g(n,"display:flex;align-items:center;margin:8px 0;color:var(--notectl-fg-muted);font-size:12px;");const i=document.createElement("span");g(i,"flex:1;height:1px;background:var(--notectl-border);");const r=document.createElement("span");r.textContent=e.separator,g(r,"padding:0 8px;");const o=document.createElement("span");g(o,"flex:1;height:1px;background:var(--notectl-border);"),n.appendChild(i),n.appendChild(r),n.appendChild(o),t.appendChild(n)}(t,n.locale),function(t,e,n){const i=document.createElement("input");i.type="url",i.placeholder=n.locale.urlPlaceholder,i.setAttribute("aria-label",n.locale.urlAria),g(i,"width:100%;padding:6px 8px;box-sizing:border-box;border:1px solid var(--notectl-border);border-radius:4px;background:var(--notectl-surface-overlay);color:var(--notectl-fg);");const r=document.createElement("button");r.type="button",r.textContent=n.locale.insertButton,r.setAttribute("aria-label",n.locale.insertAria),g(r,"width:100%;padding:8px 12px;margin-top:4px;cursor:pointer;border:1px solid var(--notectl-border);border-radius:4px;background:var(--notectl-surface-raised);color:var(--notectl-fg);");const o=()=>{const t=i.value.trim();t&&(x(e,{src:t}),n.onClose(),e.getContainer().focus())};r.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),o()}),i.addEventListener("keydown",t=>{"Enter"===t.key&&(t.preventDefault(),o())}),t.appendChild(i),t.appendChild(r),requestAnimationFrame(()=>i.focus())}(t,e,n)}(t,e,{acceptedTypes:this.config.acceptedTypes,locale:this.locale,onFileInsert:(t,e)=>this.handleFileInsert(t,e),onClose:n})}})}isAcceptedType(t){return this.config.acceptedTypes.some(e=>e===t||e.endsWith("/*")&&t.startsWith(e.slice(0,-1)))}isImageSelected(t){const e=t.selection;return!!r(e)&&"image"===t.getBlock(e.nodeId)?.type}announceImageSelection(t){if(!this.context)return;const e=t.selection;if(!r(e))return;const n=t.getBlock(e.nodeId);if(!n||"image"!==n.type)return;const i=n.attrs?.alt??"",o=n.attrs?.width,a=n.attrs?.height,s=[this.locale.imageSelected];i&&s.push(`${this.locale.altTextPrefix}${i}.`),void 0!==o&&void 0!==a&&s.push(this.locale.imageSizeAnnounce(o,a));const l=this.resolvedKeymap.shrinkWidth??null,c=this.resolvedKeymap.growWidth??null;l&&c&&s.push(this.locale.resizeHint(v(l),v(c))),this.context.announce(s.join(" "))}announceCurrentSize(t){const e=t.getState(),n=e.selection;if(!r(n))return;const i=e.getBlock(n.nodeId);if(!i||"image"!==i.type)return;const o=i.attrs?.width,a=i.attrs?.height;void 0!==o&&void 0!==a&&t.announce(this.locale.imageResized(o,a))}};export{_ as a,z as i,M as n,R as r,U as t};
|
|
2
|
-
//# sourceMappingURL=ImagePlugin-CCEevNfJ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImagePlugin-CCEevNfJ.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\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\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: LocaleModuleMap<ImageLocale> = import.meta.glob<{\n\tdefault: ImageLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadImageLocale(lang: string): Promise<ImageLocale> {\n\treturn loadLocaleModule(localeModules, lang, IMAGE_LOCALE_EN);\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":"4jBCoBA,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,IA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AgB,WACrC,IAAV,QAAkC,IAAX,GAC1B,EAAM,KAAK,KAAK,OAAO,kBAAkB,EAAO,IAGjD,MAAM,EAA2B,KAAK,eAAe,aAAe,KAC9D,EAAyB,KAAK,eAAe,WAAa,KAC5D,GAAa,GAChB,EAAM,KAAK,KAAK,OAAO,WAAW,EAAe,GAAY,EAAe,KAG7E,KAAK,QAAQ,SAAS,EAAM,KAAK,MAGlC,mBAAA,CAA4B,GAC3B,MAAM,EAAQ,EAAQ,WAChB,EAAM,EAAM,UAClB,IAAK,EAAgB,GAAM,OAE3B,MAAM,EAA+B,EAAM,SAAS,EAAI,QACxD,IAAK,GAAwB,UAAf,EAAM,KAAkB,OAEtC,MAAM,EAA4B,EAAM,OAAO,MACzC,EAA6B,EAAM,OAAO,YAClC,IAAV,QAAkC,IAAX,GAC1B,EAAQ,SAAS,KAAK,OAAO,aAAa,EAAO"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{u as t}from"./Document-_qdGR4vh.mjs";import{o as e,t as o,u as r}from"./Selection-aeiSsvhe.mjs";import{_ as s,m as i}from"./Commands-BuYF23lf.mjs";import{i as n}from"./TypeBrands-BZDKMjR-.mjs";import{i as a,o as c}from"./PluginHelpers-D-MvWR98.mjs";import{t as l}from"./ShortcutFormatting-DE6B8iGs.mjs";var m={label:"Inline Code",tooltip:t=>`Inline Code (${t})`},d=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-Bvja-bjE.mjs"),"./locales/de.ts":()=>import("./de-DKj55F9g.mjs"),"./locales/es.ts":()=>import("./es-BMKsnh3y.mjs"),"./locales/fr.ts":()=>import("./fr-CNNBBeLM.mjs"),"./locales/hi.ts":()=>import("./hi-DzRFsYYN.mjs"),"./locales/pt.ts":()=>import("./pt-DVfMAcXb.mjs"),"./locales/ru.ts":()=>import("./ru-C-4AaPUK.mjs"),"./locales/zh.ts":()=>import("./zh-d19V68ib.mjs")});async function p(t){return c(d,t,m)}var g={toolbar:!0,keymap:"Mod-E",inputRule:!0},u=new Set(["bold","italic","underline","strikethrough","highlight","font","fontSize","superscript","subscript"]),f=class{id="inline-code";name="Inline Code";priority=22;config;locale;constructor(t){this.config={...g,...t}}async init(t){this.locale=await a(t,this.config.locale,m,p),t.registerStyleSheet("\n.notectl-content code {\n\tfont-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;\n\tfont-size: 0.9em;\n\tpadding: 0.15em 0.35em;\n\tborder-radius: 4px;\n\tbackground-color: var(--notectl-code-bg);\n\tcolor: var(--notectl-code-color);\n\tword-break: break-word;\n}\n@media (forced-colors: active) {\n\t.notectl-content code {\n\t\tborder: 1px solid LinkText;\n\t}\n}\n"),this.registerMarkSpec(t),this.registerCommand(t),null!==this.config.keymap&&this.registerKeymap(t),!1!==this.config.inputRule&&this.registerInputRule(t),!1!==this.config.toolbar&&this.registerToolbarItem(t),this.registerExclusivityMiddleware(t)}registerMarkSpec(t){t.registerMarkSpec({type:"code",rank:3,toDOM:()=>document.createElement("code"),toHTMLString:(t,e)=>`<code>${e}</code>`,parseHTML:[{tag:"code",getAttrs:t=>"PRE"!==t.parentElement?.tagName&&{}},{tag:"span",getAttrs:t=>{const e=t.style.fontFamily.replace(/['"]/g,"").trim();return!!/^monospace$/i.test(e)&&{}}}],sanitize:{tags:["code"]}})}registerCommand(t){t.registerCommand("toggleInlineCode",()=>{const e=s(t.getState(),n("code"));return!!e&&(t.dispatch(e),!0)})}registerKeymap(t){const e=this.config.keymap??"Mod-E";t.registerKeymap({[e]:()=>t.executeCommand("toggleInlineCode")})}registerInputRule(t){t.registerInputRule({pattern:/(?:^|[^`])(`([^`]+)`)$/,handler(t,s,i,a){const c=t.selection;if(!r(c))return null;if(!e(c))return null;const l=t.getBlock(c.anchor.blockId);if(!l||"code_block"===l.type)return null;const m=s[2],d=s[1];if(!m||!d)return null;const p=a-d.length;return t.transaction("input").deleteTextAt(c.anchor.blockId,p,a).insertText(c.anchor.blockId,p,m,[{type:n("code")}]).setSelection(o(c.anchor.blockId,p+m.length)).build()}})}registerToolbarItem(t){t.registerToolbarItem({id:"inline_code",group:"format",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0L19.2 12l-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"/></svg>',label:this.locale.label,tooltip:this.locale.tooltip(l(this.config.keymap??"Mod-E")),command:"toggleInlineCode",isActive:t=>i(t,n("code"))})}registerExclusivityMiddleware(e){e.registerMiddleware((e,o,r)=>{let s=!1;const i=[];for(const c of e.steps){if("addMark"!==c.type){i.push(c);continue}const e=c.mark.type;if("code"===e){const e=o.getBlock(c.blockId);if(e){const o=t(e,c.from,c.to),r=/* @__PURE__ */new Set;for(const t of o)if("text"===t.kind)for(const e of t.marks)u.has(e.type)&&r.add(e.type);for(const t of r)s=!0,i.push({type:"removeMark",blockId:c.blockId,from:c.from,to:c.to,mark:{type:n(t)},...c.path?{path:c.path}:{}})}i.push(c);continue}if(u.has(e)){const e=o.getBlock(c.blockId);if(e&&t(e,c.from,c.to).some(t=>"text"===t.kind&&t.marks.some(t=>"code"===t.type))){s=!0;continue}}i.push(c)}let a=e.storedMarksAfter;if(a){const t=a.some(t=>"code"===t.type),e=a.some(t=>u.has(t.type));t&&e&&(a=a.filter(t=>!u.has(t.type)),s=!0)}r(s?{...e,steps:i,storedMarksAfter:a}:e)},{name:"inline-code:mark-exclusivity",priority:50})}};export{m as n,p as r,f as t};
|
|
2
|
-
//# sourceMappingURL=InlineCodePlugin-B7IOgUSI.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InlineCodePlugin-B7IOgUSI.mjs","names":[],"sources":["../../src/plugins/inline-code/InlineCodeLocale.ts","../../src/plugins/inline-code/InlineCodePlugin.ts"],"sourcesContent":["/**\n * Locale interface and default English locale for the InlineCodePlugin.\n */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface InlineCodeLocale {\n\treadonly label: string;\n\treadonly tooltip: (shortcut: string) => string;\n}\n\n// --- Default English Locale ---\n\nexport const INLINE_CODE_LOCALE_EN: InlineCodeLocale = {\n\tlabel: 'Inline Code',\n\ttooltip: (shortcut: string) => `Inline Code (${shortcut})`,\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<InlineCodeLocale> = import.meta.glob<{\n\tdefault: InlineCodeLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadInlineCodeLocale(lang: string): Promise<InlineCodeLocale> {\n\treturn loadLocaleModule(localeModules, lang, INLINE_CODE_LOCALE_EN);\n}\n","/**\n * InlineCodePlugin: registers an inline code mark with MarkSpec,\n * toggle command, keyboard shortcut (Mod-E), backtick InputRule,\n * toolbar button, and mark exclusivity middleware.\n */\n\nimport { isMarkActive, toggleMark } from '../../commands/Commands.js';\nimport type { BlockNode, Mark } from '../../model/Document.js';\nimport { getBlockContentSegmentsInRange } from '../../model/Document.js';\nimport { createCollapsedSelection, isCollapsed, isTextSelection } from '../../model/Selection.js';\nimport { markType } from '../../model/TypeBrands.js';\nimport type { Step } from '../../state/Steps.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport {\n\tINLINE_CODE_LOCALE_EN,\n\ttype InlineCodeLocale,\n\tloadInlineCodeLocale,\n} from './InlineCodeLocale.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tcode: Record<string, never>;\n\t}\n}\n\n// --- Configuration ---\n\nexport interface InlineCodeConfig {\n\t/** Show toolbar button. Default: true */\n\treadonly toolbar?: boolean;\n\t/** Override keyboard shortcut. Set to null to disable. Default: 'Mod-E' */\n\treadonly keymap?: string | null;\n\t/** Enable backtick InputRule. Default: true */\n\treadonly inputRule?: boolean;\n\t/** Override locale strings */\n\treadonly locale?: InlineCodeLocale;\n}\n\nconst DEFAULT_CONFIG: InlineCodeConfig = {\n\ttoolbar: true,\n\tkeymap: 'Mod-E',\n\tinputRule: true,\n};\n\n// --- CSS ---\n\nconst INLINE_CODE_CSS = `\n.notectl-content code {\n\tfont-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;\n\tfont-size: 0.9em;\n\tpadding: 0.15em 0.35em;\n\tborder-radius: 4px;\n\tbackground-color: var(--notectl-code-bg);\n\tcolor: var(--notectl-code-color);\n\tword-break: break-word;\n}\n@media (forced-colors: active) {\n\t.notectl-content code {\n\t\tborder: 1px solid LinkText;\n\t}\n}\n`;\n\n// --- Mark Exclusivity ---\n\nconst EXCLUDED_WITH_CODE: ReadonlySet<string> = new Set([\n\t'bold',\n\t'italic',\n\t'underline',\n\t'strikethrough',\n\t'highlight',\n\t'font',\n\t'fontSize',\n\t'superscript',\n\t'subscript',\n]);\n\n// --- Plugin ---\n\nexport class InlineCodePlugin implements Plugin {\n\treadonly id = 'inline-code';\n\treadonly name = 'Inline Code';\n\treadonly priority = 22;\n\n\tprivate readonly config: InlineCodeConfig;\n\tprivate locale!: InlineCodeLocale;\n\n\tconstructor(config?: Partial<InlineCodeConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tINLINE_CODE_LOCALE_EN,\n\t\t\tloadInlineCodeLocale,\n\t\t);\n\t\tcontext.registerStyleSheet(INLINE_CODE_CSS);\n\t\tthis.registerMarkSpec(context);\n\t\tthis.registerCommand(context);\n\n\t\tif (this.config.keymap !== null) {\n\t\t\tthis.registerKeymap(context);\n\t\t}\n\t\tif (this.config.inputRule !== false) {\n\t\t\tthis.registerInputRule(context);\n\t\t}\n\t\tif (this.config.toolbar !== false) {\n\t\t\tthis.registerToolbarItem(context);\n\t\t}\n\t\tthis.registerExclusivityMiddleware(context);\n\t}\n\n\tprivate registerMarkSpec(context: PluginContext): void {\n\t\tcontext.registerMarkSpec({\n\t\t\ttype: 'code',\n\t\t\trank: 3,\n\t\t\ttoDOM() {\n\t\t\t\treturn document.createElement('code');\n\t\t\t},\n\t\t\ttoHTMLString: (_mark, content) => `<code>${content}</code>`,\n\t\t\tparseHTML: [\n\t\t\t\t{\n\t\t\t\t\ttag: 'code',\n\t\t\t\t\tgetAttrs: (el: HTMLElement) => {\n\t\t\t\t\t\tif (el.parentElement?.tagName === 'PRE') return false;\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttag: 'span',\n\t\t\t\t\tgetAttrs: (el: HTMLElement) => {\n\t\t\t\t\t\tconst fontFamily: string = el.style.fontFamily.replace(/['\"]/g, '').trim();\n\t\t\t\t\t\tif (/^monospace$/i.test(fontFamily)) return {};\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tsanitize: { tags: ['code'] },\n\t\t});\n\t}\n\n\tprivate registerCommand(context: PluginContext): void {\n\t\tcontext.registerCommand('toggleInlineCode', () => {\n\t\t\tconst tr = toggleMark(context.getState(), markType('code'));\n\t\t\tif (tr) {\n\t\t\t\tcontext.dispatch(tr);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t}\n\n\tprivate registerKeymap(context: PluginContext): void {\n\t\tconst key: string = this.config.keymap ?? 'Mod-E';\n\t\tcontext.registerKeymap({\n\t\t\t[key]: () => context.executeCommand('toggleInlineCode'),\n\t\t});\n\t}\n\n\tprivate registerInputRule(context: PluginContext): void {\n\t\tconst pattern: RegExp = /(?:^|[^`])(`([^`]+)`)$/;\n\n\t\tcontext.registerInputRule({\n\t\t\tpattern,\n\t\t\thandler(state, match, _start, end) {\n\t\t\t\tconst sel = state.selection;\n\t\t\t\tif (!isTextSelection(sel)) return null;\n\t\t\t\tif (!isCollapsed(sel)) return null;\n\n\t\t\t\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\t\t\t\tif (!block || block.type === 'code_block') return null;\n\n\t\t\t\tconst innerText: string | undefined = match[2];\n\t\t\t\tconst backtickExpr: string | undefined = match[1];\n\t\t\t\tif (!innerText || !backtickExpr) return null;\n\n\t\t\t\tconst backtickExprStart: number = end - backtickExpr.length;\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, backtickExprStart, end)\n\t\t\t\t\t.insertText(sel.anchor.blockId, backtickExprStart, innerText, [\n\t\t\t\t\t\t{ type: markType('code') },\n\t\t\t\t\t])\n\t\t\t\t\t.setSelection(\n\t\t\t\t\t\tcreateCollapsedSelection(sel.anchor.blockId, backtickExprStart + innerText.length),\n\t\t\t\t\t)\n\t\t\t\t\t.build();\n\t\t\t},\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=\"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0L19.2 12l-4.6-4.6L16 6l6 6-6 6-1.4-1.4z\"/></svg>';\n\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'inline_code',\n\t\t\tgroup: 'format',\n\t\t\ticon,\n\t\t\tlabel: this.locale.label,\n\t\t\ttooltip: this.locale.tooltip(formatShortcut(this.config.keymap ?? 'Mod-E')),\n\t\t\tcommand: 'toggleInlineCode',\n\t\t\tisActive: (state) => isMarkActive(state, markType('code')),\n\t\t});\n\t}\n\n\t/**\n\t * Prevents formatting marks from coexisting with the code mark.\n\t * Bold, italic, underline, etc. are stripped when code is applied,\n\t * and code is blocked on text that already has formatting marks.\n\t * The link mark is allowed to coexist.\n\t */\n\tprivate registerExclusivityMiddleware(context: PluginContext): void {\n\t\tcontext.registerMiddleware(\n\t\t\t(tr, state, next) => {\n\t\t\t\tlet patched = false;\n\t\t\t\tconst patchedSteps: Step[] = [];\n\n\t\t\t\tfor (const step of tr.steps) {\n\t\t\t\t\tif (step.type !== 'addMark') {\n\t\t\t\t\t\tpatchedSteps.push(step);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst stepMarkType: string = step.mark.type;\n\n\t\t\t\t\tif (stepMarkType === 'code') {\n\t\t\t\t\t\t// Adding code mark: inject removeMark steps for excluded marks\n\t\t\t\t\t\tconst block: BlockNode | undefined = state.getBlock(step.blockId);\n\t\t\t\t\t\tif (block) {\n\t\t\t\t\t\t\tconst segments = getBlockContentSegmentsInRange(block, step.from, step.to);\n\t\t\t\t\t\t\tconst marksToRemove: Set<string> = new Set();\n\t\t\t\t\t\t\tfor (const seg of segments) {\n\t\t\t\t\t\t\t\tif (seg.kind !== 'text') continue;\n\t\t\t\t\t\t\t\tfor (const m of seg.marks) {\n\t\t\t\t\t\t\t\t\tif (EXCLUDED_WITH_CODE.has(m.type)) {\n\t\t\t\t\t\t\t\t\t\tmarksToRemove.add(m.type);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (const mt of marksToRemove) {\n\t\t\t\t\t\t\t\tpatched = true;\n\t\t\t\t\t\t\t\tpatchedSteps.push({\n\t\t\t\t\t\t\t\t\ttype: 'removeMark',\n\t\t\t\t\t\t\t\t\tblockId: step.blockId,\n\t\t\t\t\t\t\t\t\tfrom: step.from,\n\t\t\t\t\t\t\t\t\tto: step.to,\n\t\t\t\t\t\t\t\t\tmark: { type: markType(mt) },\n\t\t\t\t\t\t\t\t\t...(step.path ? { path: step.path } : {}),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpatchedSteps.push(step);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (EXCLUDED_WITH_CODE.has(stepMarkType)) {\n\t\t\t\t\t\t// Adding a formatting mark: block if target range has code mark\n\t\t\t\t\t\tconst block: BlockNode | undefined = state.getBlock(step.blockId);\n\t\t\t\t\t\tif (block) {\n\t\t\t\t\t\t\tconst segments = getBlockContentSegmentsInRange(block, step.from, step.to);\n\t\t\t\t\t\t\tconst hasCode: boolean = segments.some(\n\t\t\t\t\t\t\t\t(seg) => seg.kind === 'text' && seg.marks.some((m) => m.type === 'code'),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (hasCode) {\n\t\t\t\t\t\t\t\tpatched = true;\n\t\t\t\t\t\t\t\tcontinue; // skip this step\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tpatchedSteps.push(step);\n\t\t\t\t}\n\n\t\t\t\t// Handle stored marks\n\t\t\t\tlet storedMarksAfter: readonly Mark[] | null = tr.storedMarksAfter;\n\t\t\t\tif (storedMarksAfter) {\n\t\t\t\t\tconst hasCode: boolean = storedMarksAfter.some((m) => m.type === 'code');\n\t\t\t\t\tconst hasExcluded: boolean = storedMarksAfter.some((m) => EXCLUDED_WITH_CODE.has(m.type));\n\n\t\t\t\t\tif (hasCode && hasExcluded) {\n\t\t\t\t\t\t// Keep code, strip formatting marks\n\t\t\t\t\t\tstoredMarksAfter = storedMarksAfter.filter((m) => !EXCLUDED_WITH_CODE.has(m.type));\n\t\t\t\t\t\tpatched = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnext(patched ? { ...tr, steps: patchedSteps, storedMarksAfter } : tr);\n\t\t\t},\n\t\t\t{ name: 'inline-code:mark-exclusivity', priority: 50 },\n\t\t);\n\t}\n}\n"],"mappings":"sTAeA,IAAa,EAA0C,CACtD,MAAO,cACP,QAAU,GAAqB,gBAAgB,MAK1C,iBAAmD,OAAA,OAAA,CAAA,kBAAA,I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AM,EAAW,EAA+B,EAAO,EAAK,KAAM,EAAK,IACjE,iBAA6B,IAAI,IACvC,IAAK,MAAM,KAAO,EACjB,GAAiB,SAAb,EAAI,KACR,IAAK,MAAM,KAAK,EAAI,MACf,EAAmB,IAAI,EAAE,OAC5B,EAAc,IAAI,EAAE,MAIvB,IAAK,MAAM,KAAM,EAChB,GAAU,EACV,EAAa,KAAK,CACjB,KAAM,aACN,QAAS,EAAK,QACd,KAAM,EAAK,KACX,GAAI,EAAK,GACT,KAAM,CAAE,KAAM,EAAS,OACnB,EAAK,KAAO,CAAE,KAAM,EAAK,MAAS,CAAA,IAIzC,EAAa,KAAK,GAClB,SAGD,GAAI,EAAmB,IAAI,GAAe,CAEzC,MAAM,EAA+B,EAAM,SAAS,EAAK,SACzD,GAAI,GACc,EAA+B,EAAO,EAAK,KAAM,EAAK,IACrC,KAChC,GAAqB,SAAb,EAAI,MAAmB,EAAI,MAAM,KAAM,GAAiB,SAAX,EAAE,OAE5C,CACZ,GAAU,EACV,UAKH,EAAa,KAAK,GAInB,IAAI,EAA2C,EAAG,iBAClD,GAAI,EAAkB,CACrB,MAAM,EAAmB,EAAiB,KAAM,GAAiB,SAAX,EAAE,MAClD,EAAuB,EAAiB,KAAM,GAAM,EAAmB,IAAI,EAAE,OAE/E,GAAW,IAEd,EAAmB,EAAiB,OAAQ,IAAO,EAAmB,IAAI,EAAE,OAC5E,GAAU,GAIZ,EAAK,EAAU,IAAK,EAAI,MAAO,EAAc,oBAAqB,IAEnE,CAAE,KAAM,+BAAgC,SAAU"}
|
|
@@ -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-CsdlWnNl.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardNav-CsdlWnNl.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-_qdGR4vh.mjs";import{o as e,u as r}from"./Selection-aeiSsvhe.mjs";import{i as n}from"./TypeBrands-BZDKMjR-.mjs";import{a as i,r as o}from"./HTMLUtils-brwcaufP.mjs";import{i as s,r as a,t as l}from"./AttributedMarkCommands-35jTbVRg.mjs";import{i as c,o as p}from"./PluginHelpers-D-MvWR98.mjs";import{t as m}from"./ShortcutFormatting-DE6B8iGs.mjs";var d={label:"Link",tooltip:t=>`Insert Link (${t})`,removeLink:"Remove Link",removeLinkAria:"Remove link",urlPlaceholder:"https://...",urlAria:"Link URL",apply:"Apply",applyAria:"Apply link",invalidUrl:"Only http(s), mailto, tel, fragments, and relative paths are allowed."},u=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-6I20_Djq.mjs"),"./locales/de.ts":()=>import("./de-Cz26vtXW.mjs"),"./locales/es.ts":()=>import("./es-BlHe_tc0.mjs"),"./locales/fr.ts":()=>import("./fr-DnQHoPVo.mjs"),"./locales/hi.ts":()=>import("./hi-sxC2nk3h.mjs"),"./locales/pt.ts":()=>import("./pt-DLbf6uoo.mjs"),"./locales/ru.ts":()=>import("./ru-BMxJsSe3.mjs"),"./locales/zh.ts":()=>import("./zh-C0I3L6NA.mjs")});async function h(t){return p(u,t,d)}var k={openInNewTab:!0},g=class{id="link";name="Link";priority=25;config;locale;constructor(t){this.config={...k,...t}}async init(t){this.locale=await c(t,this.config.locale,d,h),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=i(String(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(i(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:i(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(m("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 a(t,"link")}toggleLink(t,e){return!!this.isLinkActive(e)&&this.removeLink(t,e)}addLink(t,i,o){const s=i.selection;if(!r(s))return!1;if(e(s))return!1;const a=l(i,{type:n("link"),attrs:{href:o}});return!!a&&(t.dispatch(a),!0)}removeLink(i,o){const a=o.selection;if(!r(a))return!1;if(e(a)){const e=o.getBlock(a.anchor.blockId);if(!e)return!1;const r=[];let s=0;for(const i of e.children){if(!("text"in i))continue;const e=s+i.text.length;r.push({pos:s,end:e,hasLink:t(i.marks,n("link"))}),s=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 d=r[p],u=r[m];if(!d||!u)return!1;const h=d.pos,k=u.end,g=o.transaction("command");return g.removeMark(a.anchor.blockId,h,k,{type:n("link")}),g.setSelection(a),i.dispatch(g.build()),!0}const l=s(o,n("link"));return!!l&&(i.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 s=document.createElement("div");s.className="notectl-link-popup__error",s.setAttribute("role","alert"),s.hidden=!0;const a=()=>{const t=n.value.trim();if(""===t)return;const o=i(t);if(""===o)return s.textContent=this.locale.invalidUrl,s.hidden=!1,n.setAttribute("aria-invalid","true"),void n.focus();s.hidden=!0,n.removeAttribute("aria-invalid"),this.addLink(e,e.getState(),o),r(),e.getContainer().focus()};o.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),a()}),n.addEventListener("keydown",t=>{"Enter"===t.key&&(t.preventDefault(),a())}),n.addEventListener("input",()=>{s.hidden||(s.hidden=!0,n.removeAttribute("aria-invalid"))}),t.appendChild(n),t.appendChild(o),t.appendChild(s),requestAnimationFrame(()=>n.focus())}}};export{d as n,h as r,g as t};
|
|
2
|
-
//# sourceMappingURL=LinkPlugin-Bhwg24lH.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LinkPlugin-Bhwg24lH.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\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\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\treadonly invalidUrl: 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\tinvalidUrl: 'Only http(s), mailto, tel, fragments, and relative paths are allowed.',\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<LinkLocale> = import.meta.glob<{\n\tdefault: LinkLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadLinkLocale(lang: string): Promise<LinkLocale> {\n\treturn loadLocaleModule(localeModules, lang, LINK_LOCALE_EN);\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, sanitizeHref } 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: string = sanitizeHref(String(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 safeHref: string = sanitizeHref(String(mark.attrs?.href ?? ''));\n\t\t\t\tconst href: string = escapeHTML(safeHref);\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\t// Returning an empty href (instead of `false`) keeps the link mark\n\t\t\t\t\t\t// applied so the parser does not fall back to the core HTMLParser's\n\t\t\t\t\t\t// raw-href default; the empty value renders as a no-op anchor.\n\t\t\t\t\t\tconst href: string = sanitizeHref(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 errorMsg = document.createElement('div');\n\t\t\terrorMsg.className = 'notectl-link-popup__error';\n\t\t\terrorMsg.setAttribute('role', 'alert');\n\t\t\terrorMsg.hidden = true;\n\n\t\t\tconst applyLink = (): void => {\n\t\t\t\tconst raw: string = input.value.trim();\n\t\t\t\tif (raw === '') return;\n\t\t\t\tconst sanitized: string = sanitizeHref(raw);\n\t\t\t\tif (sanitized === '') {\n\t\t\t\t\terrorMsg.textContent = this.locale.invalidUrl;\n\t\t\t\t\terrorMsg.hidden = false;\n\t\t\t\t\tinput.setAttribute('aria-invalid', 'true');\n\t\t\t\t\tinput.focus();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\terrorMsg.hidden = true;\n\t\t\t\tinput.removeAttribute('aria-invalid');\n\t\t\t\tthis.addLink(context, context.getState(), sanitized);\n\t\t\t\tonClose();\n\t\t\t\tcontext.getContainer().focus();\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\tinput.addEventListener('input', () => {\n\t\t\t\tif (!errorMsg.hidden) {\n\t\t\t\t\terrorMsg.hidden = true;\n\t\t\t\t\tinput.removeAttribute('aria-invalid');\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tcontainer.appendChild(input);\n\t\t\tcontainer.appendChild(applyBtn);\n\t\t\tcontainer.appendChild(errorMsg);\n\n\t\t\t// Auto-focus input\n\t\t\trequestAnimationFrame(() => input.focus());\n\t\t}\n\t}\n}\n"],"mappings":"wXAsBA,IAAa,EAA6B,CACzC,MAAO,OACP,QAAU,GAAqB,gBAAgB,KAC/C,WAAY,cACZ,eAAgB,cAChB,eAAgB,cAChB,QAAS,WACT,MAAO,QACP,UAAW,aACX,WAAY,yEAKP,iBAA6C,OAAA,OAAA,CAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,uBAInD,eAAsB,EAAe,GACpC,OAAO,EAAiB,EAAe,EAAM,GCJ9C,IAAM,EAA6B,CAClC,cAAc,GAKF,EAAb,MACC,GAAc,OACd,KAAgB,OAChB,SAAoB,GAEpB,OACA,OAEA,WAAA,CAAY,GACX,KAAK,OAAS,IAAK,KAAmB,GAGvC,UAAM,CAAK,GACV,KAAK,aAAe,EAAc,EAAS,KAAK,OAAO,OAAQ,EAAgB,GAC/E,KAAK,iBAAiB,GACtB,KAAK,iBAAiB,GACtB,KAAK,eAAe,GACpB,KAAK,oBAAoB,GAG1B,gBAAA,CAAyB,GACxB,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,iBACF,OAIF,EAAM,iBAAiB,QAAA,KACjB,EAAS,SACb,EAAS,QAAS,EAClB,EAAM,gBAAgB,mBAIxB,EAAU,YAAY,GACtB,EAAU,YAAY,GACtB,EAAU,YAAY,GAGtB,sBAAA,IAA4B,EAAM"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as t,m as e}from"./Document-_qdGR4vh.mjs";import{d as n,o as i,t as s,u as c}from"./Selection-aeiSsvhe.mjs";import{a as o,t as r}from"./TypeBrands-BZDKMjR-.mjs";import{r as l}from"./AttrRegistry-nDKtHK87.mjs";import{n as a}from"./DomUtils-RKbAVBQz.mjs";import{t as d}from"./RangeIterator-DytL1lUT.mjs";import{s as u}from"./StyleRuntime-D3d1XFFe.mjs";import{i as p,o as m}from"./PluginHelpers-D-MvWR98.mjs";function h(t,e,n){return"checklist"===t?{listType:t,indent:e,checked:n??!1}:{listType:t,indent:e}}function k(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=b(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"),h(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=h(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 f(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"),h(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=h(a.attrs.listType,u,a.attrs.checked),m=s.transaction("command").setBlockType(r.anchor.blockId,o("list_item"),p).setSelection(r).build();return t.dispatch(m),!0}function g(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=h(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 b(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 y=[{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 v(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 x={bulletList:"Bullet List",numberedList:"Numbered List",checklist:"Checklist"},T=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-DJN9fQ7Z.mjs"),"./locales/de.ts":()=>import("./de-pLGt5S7j.mjs"),"./locales/es.ts":()=>import("./es-D787y0ui.mjs"),"./locales/fr.ts":()=>import("./fr-BRGGu0E2.mjs"),"./locales/hi.ts":()=>import("./hi-BnsbcSIX.mjs"),"./locales/pt.ts":()=>import("./pt-C2pkn7vo.mjs"),"./locales/ru.ts":()=>import("./ru-B-gRJ6nQ.mjs"),"./locales/zh.ts":()=>import("./zh-DQtLxQ3s.mjs")});async function I(t){return m(T,t,x)}function B(t,e){return{bullet:e.bulletList,ordered:e.numberedList,checklist:e.checklist}[t]}function S(t,e){if(!c(t.selection))return!1;if(t.selection.anchor.blockId!==t.selection.head.blockId)return b(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},w=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,x,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\t-webkit-user-select: none;\n\tuser-select: none;\n\tpointer-events: none;\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\tpointer-events: auto;\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}`,()=>k(t,i.type));t.registerCommand("indentListItem",()=>f(t,1,e.maxIndent)),t.registerCommand("outdentListItem",()=>f(t,-1,e.maxIndent)),e.types.includes("checklist")&&t.registerCommand("toggleChecklistItem",()=>g(t,e.interactiveCheckboxes),{readonlyAllowed:!0}),t.registerKeymap({Tab:()=>f(t,1,e.maxIndent),"Shift-Tab":()=>f(t,-1,e.maxIndent)})}(n,this.config,r),function(n){n.registerKeymap({Enter:()=>function(n){return v(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=h(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 v(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,m=h(n.type,0,u.includes("[x]"));return t.transaction("input").deleteTextAt(a.anchor.blockId,r,r+p).setBlockType(a.anchor.blockId,o("list_item"),m).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:B(i.type,n),command:`toggleList:${i.type}`,isActive:t=>S(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;return"checklist"===n?`<li role="checkbox" aria-checked="${String(i)}"><input type="checkbox" disabled${i?" checked":""}>${e||"<br>"}</li>`:`<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&&g(t,this.config.interactiveCheckboxes,r(c))},t.getContainer().addEventListener("mousedown",this.checkboxClickHandler))}getEnabledTypes(){return y.filter(t=>this.config.types.includes(t.type))}};export{x as n,I as r,w as t};
|
|
2
|
-
//# sourceMappingURL=ListPlugin-BkG6UO4x.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListPlugin-BkG6UO4x.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\t-webkit-user-select: none;\n\tuser-select: none;\n\tpointer-events: none;\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\tpointer-events: auto;\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\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\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: LocaleModuleMap<ListLocale> = import.meta.glob<{\n\tdefault: ListLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadListLocale(lang: string): Promise<ListLocale> {\n\treturn loadLocaleModule(localeModules, lang, LIST_LOCALE_EN);\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":"+ZCSA,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,EAAsB,EAAO,EAAQ,IACpC,MAAM,EAAQ,EAAM,SAAS,GAC7B,GAAK,EAEL,GAAI,EACH,EAAQ,aAAa,EAAK,EAAS,kBAC7B,CACN,MAAM,EAAyB,EAAa,EAAO,aAAe,EAAM,MAAM,OAAS,EACjF,EACL,EAAa,EAAO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,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-_qdGR4vh.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-DVPpO5nC.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeResolver-DVPpO5nC.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 undef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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-_qdGR4vh.mjs";import{c as i,l as r,n as s,o as c,r as l,t as u}from"./Selection-aeiSsvhe.mjs";import{n as d}from"./NodeResolver-DVPpO5nC.mjs";import{i as a}from"./NavigationQueries-CgYPG6oY.mjs";import{o as f,r as m,s as p,t as b}from"./CommandHelpers-DTlQcGv5.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 null}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-Ddxu5Qck.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeSelectionCommands-Ddxu5Qck.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 null;\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,EAAQ,WAAW,EAAY,GAG/B,MAAM,EAAc,EAAS,EAAQ,GACrC,GAAI,GAAe,EAAY,GAAc,CAC5C,MAAM,EAAY,EAAgC,EAAO,EAAY,GAAI,OACzE,GAAI,EAEH,OADA,EAAQ,aAAa,GACd,EAAQ,QAIjB,MAAM,EAAc,EAAS,EAAQ,GACrC,GAAI,GAAe,EAAY,GAAc,CAC5C,MAAM,EAAY,EAAgC,EAAO,EAAY,GAAI,SACzE,GAAI,EAEH,OADA,EAAQ,aAAa,GACd,EAA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