@notectl/core 2.1.0 → 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/TextDirectionAutoMiddleware.d.ts.map +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-DS_gpI8N.mjs +0 -2
- package/dist/chunks/TextDirectionAutoPlugin-DS_gpI8N.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-BMvrL5dE.mjs +0 -2
- package/dist/chunks/full-BMvrL5dE.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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{S as t,a as e,c as n,d as o,g as r,m as c,y as s}from"./Document-DJmYYuBx.mjs";import{a as i,d as a,i as l,o as d,s as u,t as g,u as p}from"./Selection-aeiSsvhe.mjs";import{t as h}from"./Commands-BC_EPIEx.mjs";import{a as f}from"./TypeBrands-BZDKMjR-.mjs";import{n as k}from"./DomUtils-RKbAVBQz.mjs";import{r as b}from"./HTMLUtils-brwcaufP.mjs";import{s as m}from"./NavigationQueries-DhptdQBe.mjs";import{i as x,r as v,t as y}from"./Decoration-BeTkTHRO.mjs";import{n as C,o as S,r as B,s as w,t as I}from"./CommandHelpers-BqHfwW7i.mjs";import{s as _}from"./StyleRuntime-D3d1XFFe.mjs";import{n as T}from"./TypedKeys-CU7aToqY.mjs";import{t as A}from"./SyntaxTokenTypes-DZwhanGO.mjs";import{i as L,o as M}from"./PluginHelpers-BZphovwz.mjs";import{t as O}from"./ShortcutFormatting-DQPMvupx.mjs";import{t as N}from"./PopupManager-B5SHhDsx.mjs";import{c as P,l as j}from"./XmlDetector-DM-Vv-XW.mjs";import{a as E,r as z,s as $,t as H}from"./XmlSupport-Dr1S1HN9.mjs";import{n as R}from"./PopupKeyboardPatterns-CgUM5kPf.mjs";var q=`\n/* Code Block — uses theme custom properties */\n.notectl-code-block {\n\tposition: relative;\n\tmargin: 8px 0;\n\tborder-radius: 6px;\n\tbackground: var(--notectl-code-block-bg);\n\tcolor: var(--notectl-code-block-color);\n\tfont-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, Consolas, monospace;\n\tfont-size: 14px;\n\tline-height: 1.5;\n\toverflow: hidden;\n}\n\n.notectl-code-block__header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 6px 12px;\n\tbackground: var(--notectl-code-block-header-bg);\n\tborder-bottom: 1px solid var(--notectl-code-block-header-border);\n\tfont-size: 12px;\n\tcolor: var(--notectl-code-block-header-color);\n\tuser-select: none;\n}\n\n.notectl-code-block__language-btn {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 4px;\n\tborder: none;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: var(--notectl-code-block-header-color);\n\tcursor: pointer;\n\tpadding: 2px 6px;\n\tfont-size: inherit;\n\tfont-family: inherit;\n\ttransition: background 0.15s;\n}\n\n.notectl-code-block__language-btn:hover {\n\tbackground: rgba(128, 128, 128, 0.15);\n}\n\n.notectl-code-block__language-btn:focus-visible {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 1px;\n}\n\n.notectl-code-block__language {\n\tfont-weight: 500;\n\tletter-spacing: 0.02em;\n}\n\n.notectl-code-block__chevron {\n\tdisplay: inline-flex;\n\talign-items: center;\n\topacity: 0.6;\n}\n\n.notectl-code-block__actions {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 2px;\n}\n\n.notectl-code-block__copy,\n.notectl-code-block__delete {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 24px;\n\theight: 24px;\n\tborder: none;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: var(--notectl-code-block-header-color);\n\tcursor: pointer;\n\tpadding: 0;\n\ttransition: background 0.15s, color 0.15s;\n}\n\n.notectl-code-block__copy:hover,\n.notectl-code-block__delete:hover {\n\tbackground: rgba(128, 128, 128, 0.15);\n\tcolor: var(--notectl-code-block-color);\n}\n\n.notectl-code-block__copy svg,\n.notectl-code-block__delete svg {\n\tfill: currentColor;\n}\n\n.notectl-code-block__content {\n\tdisplay: block;\n\tpadding: 12px 16px;\n\twhite-space: pre-wrap;\n\tword-wrap: break-word;\n\ttab-size: 4;\n\t-moz-tab-size: 4;\n\toutline: none;\n\tmin-height: 1.5em;\n}\n\n.notectl-code-block--selected {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 2px;\n}\n\n.notectl-code-block__esc-hint {\n\tdisplay: none;\n\tposition: absolute;\n\tbottom: 4px;\n\tinset-inline-end: 8px;\n\tfont-size: 11px;\n\tcolor: var(--notectl-code-block-header-color);\n\topacity: 0.5;\n\tpointer-events: none;\n\tuser-select: none;\n\tfont-family: system-ui, sans-serif;\n}\n\n.notectl-code-block--focused .notectl-code-block__esc-hint {\n\tdisplay: block;\n}\n\n/* Language picker popup */\n.notectl-language-picker {\n\tmin-width: 120px;\n\tmax-height: 200px;\n\toverflow-y: auto;\n\tpadding: 4px;\n\tbackground: var(--notectl-surface-raised, #fff);\n\tborder: 1px solid var(--notectl-border, #e0e0e0);\n\tborder-radius: 6px;\n\tbox-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);\n}\n\n.notectl-language-picker__option {\n\tpadding: 6px 10px;\n\tborder-radius: 4px;\n\tcursor: pointer;\n\tfont-size: 13px;\n\tcolor: var(--notectl-fg, #333);\n\twhite-space: nowrap;\n}\n\n.notectl-language-picker__option:hover {\n\tbackground: rgba(128, 128, 128, 0.1);\n}\n\n.notectl-language-picker__option:focus {\n\toutline: none;\n\tbackground: rgba(128, 128, 128, 0.15);\n}\n\n.notectl-language-picker__option[aria-selected="true"] {\n\tfont-weight: 600;\n\tcolor: var(--notectl-primary, #2563eb);\n}\n\n/* Syntax highlighting token classes — generated from canonical token type list */\n${A.map(t=>`.notectl-token--${t} {\n\tcolor: var(--notectl-code-token-${t});\n\tfont-style: var(--notectl-code-token-${t}-font-style, inherit);\n\tfont-weight: var(--notectl-code-token-${t}-font-weight, inherit);\n}`).join("\n")}\n`,D=class{bundles=/* @__PURE__ */new Map;listeners=[];register(t){this.bundles.set(t.id,t);for(const e of this.listeners)e(t)}onRegister(t){this.listeners.push(t);for(const e of this.bundles.values())t(e)}get(t){return this.bundles.get(t)}getAll(){return[...this.bundles.values()]}},V=[{open:"(",close:")",kind:"bracket"},{open:"[",close:"]",kind:"bracket"},{open:"{",close:"}",kind:"bracket"},{open:'"',close:'"',kind:"quote"},{open:"'",close:"'",kind:"quote"},{open:"`",close:"`",kind:"quote"}],F=new Map(V.map(t=>[t.open,t])),K=new Map(V.filter(t=>"bracket"===t.kind).map(t=>[t.close,t]));var W=new Set(["{","[","("]),U={"}":"{","]":"[",")":"("};function J(t,e){const n=t.lastIndexOf("\n",e-1)+1,o=t.indexOf("\n",e);return{start:n,end:-1===o?t.length:o}}function Q(t,e){const{start:n,end:o}=J(t,e);let r=n;for(;r<o;){const e=t[r];if(" "!==e&&"\t"!==e)break;r++}return t.slice(n,r)}function X(t,e){return t?" ".repeat(e):"\t"}function G(t,e,n){if(0===t.length)return{removed:"",rest:t};if(!e&&"\t"===t[0])return{removed:"\t",rest:t.slice(1)};let o=0;for(;o<n&&" "===t[o];)o++;return{removed:t.slice(0,o),rest:t.slice(o)}}function Z(t,e){const n=t.getState();if(!p(n.selection))return!1;const o=n.selection,r=n.getBlock(o.anchor.blockId);return!(!r||"code_block"!==r.type)&&e({state:n,sel:o,block:r,blockId:o.anchor.blockId,offset:o.anchor.offset})}function Y(t,e,r,s){const l={Enter:()=>function(t,e){return Z(t,({state:o,block:r,blockId:s,offset:i})=>{if(!d(o.selection))return!1;const a=c(r);if(a.endsWith("\n")&&i===a.length)return function(t,e,o){const r=t.getState(),c=o.length-1,s=n(),i=r.transaction("input").deleteTextAt(e,c,o.length).splitBlock(e,c,s).setBlockType(s,f("paragraph")).setSelection(g(s,0)).build();return t.dispatch(i),!0}(t,s,a);const l=X(e.indent.useSpaces,e.indent.spaceCount);if("brackets"===e.indent.mode&&function(t,e){return function(t,e){if(e<=0||e>=t.length)return!1;const n=t[e-1],o=t[e];return!(!n||!o)&&U[o]===n}(t,e)}(a,i)){const e=Q(a,i),n=`\n${e}${l}\n${e}`,r=i+1+e.length+l.length,c=o.transaction("input").insertText(s,i,n,[]).setSelection(g(s,r)).build();return t.dispatch(c),!0}const u=`\n${function(t,e,n,o){if("none"===n)return"";const r=Q(t,e);return"keep"===n?r:function(t,e){const n=function(t,e){const{start:n}=J(t,e);for(let o=e-1;o>=n;o--){const e=t[o];if(e&&" "!==e&&"\t"!==e)return e}return""}(t,e);return W.has(n)}(t,e)?r+o:r}(a,i,e.indent.mode,l)}`,p=o.transaction("input").insertText(s,i,u,[]).setSelection(g(s,i+u.length)).build();return t.dispatch(p),!0})}(t,s),Backspace:()=>function(t,e){return Z(t,({state:n,block:o,blockId:r,offset:s})=>{if(!d(n.selection))return!1;if(e.pairing.deletePair&&s>0){const i=c(o),a=i[s-1],l=i[s];if(a&&l&&function(t,e){switch(t){case"(":return")"===e;case"[":return"]"===e;case"{":return"}"===e;case'"':case"'":case"`":return e===t;default:return!1}}(a,l)){const o=e.pairStack.peek(r,s);if(o&&o.char===l){const e=n.transaction("input").deleteTextAt(r,s-1,s+1).setSelection(g(r,s-1)).build();return t.dispatch(e),!0}}}if(0!==s)return!1;const i=n.transaction("input").setBlockType(r,f("paragraph")).setSelection(n.selection).build();return t.dispatch(i),!0})}(t,s),Tab:()=>function(t,e){return Z(t,({state:n,sel:o,block:r,blockId:s,offset:l})=>{const p=X(e.indent.useSpaces,e.indent.spaceCount);if(d(o)){const e=n.transaction("input").insertText(s,l,p,[]).setSelection(g(s,l+p.length)).build();return t.dispatch(e),!0}if(o.anchor.blockId!==s||o.head.blockId!==s)return!1;const h=c(r),f=a(o,n.getBlockOrder()),k=f.from.offset,b=f.to.offset;if(!h.slice(k,b).includes("\n")){const e=n.transaction("input").deleteTextAt(s,k,b).insertText(s,k,p,[]).setSelection(g(s,k+p.length)).build();return t.dispatch(e),!0}const m=function(t,e,n,o){const r=t.lastIndexOf("\n",e-1)+1,c=[];let s=0,i=r;for(;i<n;){c.push({offset:i,text:o}),s++;const e=t.indexOf("\n",i);if(-1===e||e>=n)break;i=e+1}return{inserts:c,totalInserted:s*o.length,lineCount:s,lineStart:r}}(h,k,b,p),x=n.transaction("input");for(let t=m.inserts.length-1;t>=0;t--){const e=m.inserts[t];e&&x.insertText(s,e.offset,e.text,[])}const v=u(o,n.getBlockOrder()),y=m.lineStart,C=b+m.totalInserted,S=v?y:C,B=v?C:y;return x.setSelection(i({blockId:s,offset:S},{blockId:s,offset:B})),t.dispatch(x.build()),m.lineCount>=2&&t.announce(e.locale().indentedNLines(m.lineCount)),!0})}(t,s),"Shift-Tab":()=>function(t,e){return Z(t,({state:n,sel:o,block:r,blockId:s,offset:l})=>{const g=c(r);if(d(o))return tt(t,n,s,l,g,e);if(o.anchor.blockId!==s||o.head.blockId!==s)return!1;const p=a(o,n.getBlockOrder()),h=p.from.offset,f=p.to.offset;if(!g.slice(h,f).includes("\n"))return tt(t,n,s,l,g,e);const k=function(t,e,n,o,r){const c=t.lastIndexOf("\n",e-1)+1,s=[];let i=0,a=0,l=c;for(;l<n;){a++;const e=G(t.slice(l),o,r);e.removed.length>0&&(s.push({from:l,to:l+e.removed.length}),i+=e.removed.length);const c=t.indexOf("\n",l);if(-1===c||c>=n)break;l=c+1}return{deletes:s,totalRemoved:i,lineCount:a,lineStart:c}}(g,h,f,e.indent.useSpaces,e.indent.spaceCount);if(0===k.totalRemoved)return!0;const b=n.transaction("input");for(let t=k.deletes.length-1;t>=0;t--){const e=k.deletes[t];e&&b.deleteTextAt(s,e.from,e.to)}const m=u(o,n.getBlockOrder()),x=k.lineStart,v=f-k.totalRemoved,y=m?x:Math.max(x,v),C=m?Math.max(x,v):x;return b.setSelection(i({blockId:s,offset:y},{blockId:s,offset:C})),t.dispatch(b.build()),k.lineCount>=2&&t.announce(e.locale().dedentedNLines(k.lineCount)),!0})}(t,s),Escape:()=>et(t),ArrowDown:()=>function(t){return Z(t,({state:e,block:n,blockId:o,offset:r})=>{if(!d(e.selection))return!1;if(-1!==c(n).indexOf("\n",r))return!1;const s=e.getBlockOrder(),i=s.indexOf(o);if(i<s.length-1){const n=s[i+1],o=e.transaction("command").setSelection(g(n,0)).build();t.dispatch(o)}else nt(t,o);return!0})}(t),ArrowUp:()=>function(t){return Z(t,({state:e,block:n,blockId:r,offset:s})=>{if(!d(e.selection))return!1;const i=c(n).indexOf("\n");if(-1!==i&&s>i)return!1;const a=e.getBlockOrder(),l=a.indexOf(r);if(l>0){const n=a[l-1],r=e.getBlock(n),c=r?o(r):0,s=e.transaction("command").setSelection(g(n,c)).build();return t.dispatch(s),!0}return!1})}(t),ArrowRight:()=>function(t){return Z(t,({state:e,block:n,blockId:o,offset:r})=>{if(!d(e.selection))return!1;if(r!==c(n).length)return!1;const s=e.getBlockOrder(),i=s.indexOf(o);if(i<s.length-1){const n=s[i+1],o=e.transaction("command").setSelection(g(n,0)).build();t.dispatch(o)}else nt(t,o);return!0})}(t),ArrowLeft:()=>function(t){return Z(t,({state:e,blockId:n,offset:r})=>{if(!d(e.selection))return!1;if(0!==r)return!1;const c=e.getBlockOrder(),s=c.indexOf(n);if(s>0){const n=c[s-1],r=e.getBlock(n),i=r?o(r):0,a=e.transaction("command").setSelection(g(n,i)).build();return t.dispatch(a),!0}return!1})}(t)},{insertAfter:p,toggle:h}=r;p&&(l[p]=()=>function(t){return Z(t,({blockId:e})=>(nt(t,e),!0))}(t)),h&&(l[h]=()=>t.executeCommand("toggleCodeBlock")),t.registerKeymap(l,{priority:"context"})}function tt(t,e,n,o,r,c){const{start:s}=J(r,o),i=G(r.slice(s),c.indent.useSpaces,c.indent.spaceCount);if(0===i.removed.length)return!0;const a=e.transaction("input").deleteTextAt(n,s,s+i.removed.length).setSelection(g(n,Math.max(s,o-i.removed.length))).build();return t.dispatch(a),!0}function et(t){return Z(t,({state:e,blockId:n})=>{const o=e.getBlockOrder(),r=o.indexOf(n);if(r<o.length-1){const n=o[r+1],c=e.transaction("command").setSelection(g(n,0)).build();t.dispatch(c)}else nt(t,n);return!0})}function nt(t,e){const r=t.getState(),c=r.getBlock(e);if(!c)return;const s=o(c),i=n(),a=r.transaction("command").splitBlock(e,s,i).setBlockType(i,f("paragraph")).setSelection(g(i,0)).build();t.dispatch(a)}function ot(e,n){const c=e.getState(),s=c.selection;if(!p(s))return!1;const i=c.getBlock(s.anchor.blockId);if(!i||"code_block"===i.type)return!1;const a={language:n.defaultLanguage??"",backgroundColor:""},l=c.transaction("command");return function(e,n){if(0===o(n))return;const c=r(n);let s=0;for(const o of c)if(t(o)){if(o.text.length>0)for(const t of o.marks)e.removeMark(n.id,s,s+o.text.length,t);s+=o.text.length}else s+=1}(l,i),l.setBlockType(s.anchor.blockId,f("code_block"),a).setSelection(g(s.anchor.blockId,0)),e.dispatch(l.build()),!0}function rt(t,o){const r=m(t.doc,o);if(!r)return null;const c=B(r),i=w(t,c),a=S(i,o);if(a<0)return null;const l=t.transaction("command");if(1===i.length){const t=n();return l.insertNode(c,0,e(t)),l.removeNode(c,1),l.setSelection(g(t,0)),l.build()}l.removeNode(c,a);const d=function(t,o,r,c){const i=r[c-1];if(i&&s(i)){const e=I(t,i.id,"end");if(e)return e}const a=r[c+1];if(a&&s(a)){const e=I(t,a.id,"start");if(e)return e}const l=r[c],d=C(t,"start",l&&s(l)?l.id:void 0);if(d)return d;const u=n();return o.insertNode([],0,e(u)),g(u,0)}(t,l,i,a);return l.setSelection(d),l.build()}var ct={label:"Code Block",tooltip:t=>t?`Code Block (${t})`:"Code Block",enteredCodeBlock:"Entered code block. Press Escape to exit.",leftCodeBlock:"Left code block.",copyCodeAria:"Copy code",escToExit:"Esc to exit",codeBlockAriaLabel:t=>`${t} code block. Press Escape to exit.`,copiedToClipboard:"Copied to clipboard",copyFailed:"Failed to copy code",deleteCodeBlockAria:"Delete code block",deletedCodeBlock:"Code block deleted",selectLanguageAria:"Select language",languageChanged:t=>`Language changed to ${t}`,plainText:"plain",indentedNLines:t=>1===t?"1 line indented":`${t} lines indented`,dedentedNLines:t=>1===t?"1 line dedented":`${t} lines dedented`},st=/* @__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-BaCL4Bzy.mjs"),"./locales/de.ts":()=>import("./de-C03n6uR5.mjs"),"./locales/es.ts":()=>import("./es-domW6tKg.mjs"),"./locales/fr.ts":()=>import("./fr-C8aNnvoW.mjs"),"./locales/hi.ts":()=>import("./hi-DEN9a54c.mjs"),"./locales/pt.ts":()=>import("./pt-Dl18NLl1.mjs"),"./locales/ru.ts":()=>import("./ru-DyBnSwCM.mjs"),"./locales/zh.ts":()=>import("./zh-CN8KiZ9v.mjs")});async function it(t){return M(st,t,ct)}var at='[role="option"]';function lt(t,e,n,o){const r=document.createElement("div");r.className="notectl-language-picker__option",r.setAttribute("role","option"),r.setAttribute("data-language",n),r.setAttribute("aria-selected",String(o)),r.setAttribute("tabindex",o?"0":"-1"),r.textContent=e,t.appendChild(r)}var dt={insertAfter:"Mod-Enter",toggle:"Mod-Shift-M"},ut={defaultLanguage:"",useSpaces:!1,spaceCount:2,showCopyButton:!0},gt=new T("codeBlock"),pt=new T("syntaxHighlighter");function ht(t,e,n,o){const r=t.getState(),c=r.getBlock(e);if(!c||"code_block"!==c.type)return;const s=r.getNodePath(e);if(!s)return;const i={...c.attrs,[n]:o},a=r.transaction("command").setNodeAttr(s,i).build();t.dispatch(a)}var ft=class{buckets=/* @__PURE__ */new Map;push(t,e){const n=this.buckets.get(t.blockId)??[];n.push({pos:t,char:e}),this.buckets.set(t.blockId,n)}take(t,e){const n=this.buckets.get(t);if(n)for(let o=n.length-1;o>=0;o--){const r=n[o];if(r&&r.pos.offset===e)return n.splice(o,1),0===n.length&&this.buckets.delete(t),r}}peek(t,e){const n=this.buckets.get(t);if(n)for(let o=n.length-1;o>=0;o--){const t=n[o];if(t&&t.pos.offset===e)return t}}clearBlock(t){this.buckets.delete(t)}clear(){this.buckets.clear()}sizeForBlock(t){return this.buckets.get(t)?.length??0}get size(){let t=0;for(const e of this.buckets.values())t+=e.length;return t}migrate(t){if(t.isEmpty)return;const e=/* @__PURE__ */new Map;for(const n of this.buckets.values())for(const o of n){const n=t.mapResult(o.pos,1);if(n.deleted)continue;const r={pos:n.pos,char:o.char},c=n.pos.blockId,s=e.get(c)??[];s.push(r),e.set(c,s)}this.buckets.clear();for(const[n,o]of e)this.buckets.set(n,o)}static makePos(t,e){return l(t,e)}},kt=class{languageMap=/* @__PURE__ */new Map;constructor(t){if(t)for(const e of t)this.registerLanguageInternal(e)}registerLanguage(t){this.registerLanguageInternal(t)}tokenize(t,e){const n=this.languageMap.get(e.toLowerCase());if(!n)return[];const o=[];for(const r of P(t,n))o.push({from:r.from,to:r.to,type:r.type});return o}getSupportedLanguages(){const t=/* @__PURE__ */new Set;for(const e of this.languageMap.values()){t.add(e.name);for(const n of e.aliases)t.add(n)}return[...t]}registerLanguageInternal(t){this.languageMap.set(t.name.toLowerCase(),t);for(const e of t.aliases)this.languageMap.set(e.toLowerCase(),t)}},bt=class{id="code-block";name="Code Block";priority=36;config;resolvedIndent;resolvedPairing;resolvedKeymap;context=null;locale;highlighter=null;languageRegistry=new D;tokenCache=/* @__PURE__ */new Map;pairStack=new ft;pendingPairOps=[];constructor(t){this.config={...ut,...t},this.resolvedIndent=function(t){const e=t.indent?.useSpaces??t.useSpaces??false,n=t.indent?.spaceCount??t.spaceCount??2,o=Math.max(1,Math.min(16,Math.trunc(n)));return{mode:t.indent?.mode??"brackets",useSpaces:e,spaceCount:o}}(this.config),this.resolvedPairing=function(t){const e=t.pairing;return{brackets:e?.brackets??"languageDefined",quotes:e?.quotes??"languageDefined",overtype:e?.overtype??true,deletePair:e?.deletePair??true,surround:e?.surround??"languageDefined"}}(this.config),this.resolvedKeymap={...dt,...t?.keymap}}async init(t){this.locale=await L(t,this.config.locale,ct,it),t.registerStyleSheet(q),this.context=t,this.initHighlighter(),this.registerLanguageRegistry(t),this.registerNodeSpec(t),this.registerNodeView(t),function(t,e){t.registerCommand("toggleCodeBlock",()=>function(t,e){const n=t.getState();if(!p(n.selection))return!1;const o=n.getBlock(n.selection.anchor.blockId);if(!o)return!1;if("code_block"===o.type){const e=n.transaction("command").setBlockType(n.selection.anchor.blockId,f("paragraph")).setSelection(n.selection).build();return t.dispatch(e),!0}return ot(t,e)}(t,e)),t.registerCommand("insertCodeBlock",()=>ot(t,e)),t.registerCommand("setCodeBlockLanguage",()=>!1),t.registerCommand("setCodeBlockBackground",()=>!1),t.registerCommand("exitCodeBlock",()=>et(t)),t.registerCommand("deleteCodeBlock",()=>function(t){const e=t.getState();if(!p(e.selection))return!1;const n=e.getBlock(e.selection.anchor.blockId);if(!n||"code_block"!==n.type)return!1;const o=rt(e,n.id);return!!o&&(t.dispatch(o),!0)}(t))}(t,this.config),Y(t,this.config,this.resolvedKeymap,{indent:this.resolvedIndent,pairing:this.resolvedPairing,pairStack:this.pairStack,locale:()=>this.locale}),this.registerInputRule(t),this.registerToolbarItem(t),this.registerMiddleware(t),function(t,e,n){t.registerService(gt,{setLanguage(e,n){ht(t,e,"language",n)},getLanguage(t){const e=n();if(!e)return"";const o=e.getState().getBlock(t);return o&&"code_block"===o.type?o.attrs?.language??"":""},setBackground(e,n){ht(t,e,"backgroundColor",n)},getBackground(t){const e=n();if(!e)return"";const o=e.getState().getBlock(t);return o&&"code_block"===o.type?o.attrs?.backgroundColor??"":""},isCodeBlock(t){const e=n();return!!e&&"code_block"===e.getState().getBlock(t)?.type},getSupportedLanguages(){const t=e();return t?t.getSupportedLanguages():[]}})}(t,()=>this.highlighter,()=>this.context),this.registerSyntaxHighlighterService(t),this.registerPasteInterceptor(t),this.registerTextInputInterceptor(t),this.patchTableCellContent(t)}destroy(){this.context=null,this.highlighter=null,this.tokenCache.clear(),this.pairStack.clear()}onStateChange(t,e,n){if(this.migratePairStack(e,n),!this.context)return;const o=p(t.selection)?t.selection.anchor.blockId:null,r=p(e.selection)?e.selection.anchor.blockId:null,c=o?t.getBlock(o):void 0,s=r?e.getBlock(r):void 0,i="code_block"===c?.type,a="code_block"===s?.type;!i&&a?this.context.announce(this.locale.enteredCodeBlock):i&&!a&&this.context.announce(this.locale.leftCodeBlock)}migratePairStack(t,e){this.pairStack.size>0&&!e.mapping.isEmpty&&this.pairStack.migrate(e.mapping);for(const n of this.pendingPairOps)"push"===n.kind?this.pairStack.push(l(n.blockId,n.offset),n.char):this.pairStack.take(n.blockId,n.offset);this.pendingPairOps.length=0;for(const n of e.steps){if("setBlockType"!==n.type)continue;const e=t.getBlock(n.blockId);e&&"code_block"===e.type||this.pairStack.clearBlock(n.blockId)}}decorations(t){const e=[],n=this.getFocusedCodeBlockId(t);if(n&&e.push(x(n,{class:"notectl-code-block--focused"})),this.highlighter){const n=/* @__PURE__ */new Set;for(const o of t.getBlockOrder()){const r=t.getBlock(o);if(!r||"code_block"!==r.type)continue;const s=r.attrs?.language??"";if(!s)continue;const i=c(r);if(!i)continue;n.add(o);const a=this.getCachedTokens(o,i,s);for(const t of a)e.push(v(o,t.from,t.to,{class:`notectl-token--${t.type}`}))}for(const t of this.tokenCache.keys())n.has(t)||this.tokenCache.delete(t)}return 0===e.length?y.empty:y.create(e)}registerNodeSpec(t){t.registerNodeSpec({type:"code_block",group:"block",content:{allow:["text"]},selectable:!0,attrs:{language:{default:""},backgroundColor:{default:""}},toDOM(t){const e=k("pre",t.id);e.className="notectl-code-block",e.setAttribute("dir","ltr"),e.setAttribute("part","code-block");const n=document.createElement("code");return n.className="notectl-code-block__content",n.setAttribute("part","code-block-content"),e.appendChild(n),e},toHTML(t,e,n){const o=b(t.attrs?.language??""),r=b(t.attrs?.backgroundColor??""),c=o?` class="language-${o}"`:"";return`<pre dir="ltr"${r?n?.styleAttr(`background-color: ${r}`)??` style="background-color: ${r}"`:""}><code${c}>${e||""}</code></pre>`},parseHTML:[{tag:"pre",getAttrs(t){const e=t.querySelector("code"),n=e?.className.match(/language-(\S+)/)?.[1]??"";return{language:(e?.getAttribute("data-language")??"")||n}}}],sanitize:{tags:["pre","code"],attrs:["data-language","class","style"]}})}registerNodeView(t){const e=new N(t.getContainer()),n=this.highlighter,o={popupManager:e,getSupportedLanguages:()=>n?.getSupportedLanguages()??[]};t.registerNodeView("code_block",function(t,e=ct,n){return(o,r,s)=>{const i=document.createElement("pre");i.className="notectl-code-block",i.setAttribute("data-block-id",o.id),i.setAttribute("dir","ltr"),i.setAttribute("role","group"),i.setAttribute("aria-roledescription","code block"),i.setAttribute("part","code-block");const a=document.createElement("div");a.className="notectl-code-block__header",a.setAttribute("contenteditable","false"),a.setAttribute("part","code-block-header");const l=document.createElement("button");l.className="notectl-code-block__language-btn",l.type="button",l.setAttribute("aria-haspopup","listbox"),l.setAttribute("aria-expanded","false"),l.setAttribute("aria-label",e.selectLanguageAria);let d=null;!1!==t.showCopyButton&&(d=document.createElement("button"),d.className="notectl-code-block__copy",d.setAttribute("aria-label",e.copyCodeAria),d.setAttribute("data-notectl-no-print",""),d.type="button",d.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14"><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>');const u=document.createElement("button");u.className="notectl-code-block__delete",u.setAttribute("aria-label",e.deleteCodeBlockAria),u.title=e.deleteCodeBlockAria,u.setAttribute("data-notectl-no-print",""),u.type="button",u.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>';const g=document.createElement("span");g.className="notectl-sr-only",g.setAttribute("aria-live","assertive"),g.setAttribute("aria-atomic","true");const p=document.createElement("div");p.className="notectl-code-block__actions",d&&p.appendChild(d),p.appendChild(u),a.appendChild(l),a.appendChild(p),a.appendChild(g);const h=document.createElement("code");h.className="notectl-code-block__content",h.setAttribute("part","code-block-content");const f=document.createElement("div");f.className="notectl-code-block__esc-hint",f.setAttribute("contenteditable","false"),f.setAttribute("aria-hidden","true"),f.setAttribute("data-notectl-no-print",""),f.textContent=e.escToExit,i.appendChild(a),i.appendChild(h),i.appendChild(f),t.background&&_(i,"--notectl-code-block-bg",t.background),t.headerBackground&&_(i,"--notectl-code-block-header-bg",t.headerBackground),t.textColor&&_(i,"--notectl-code-block-color",t.textColor),t.headerColor&&_(i,"--notectl-code-block-header-color",t.headerColor);let k=o.id;function b(t){const o=t.attrs?.language??"",r=o||e.plainText;l.innerHTML="";const c=document.createElement("span");if(c.className="notectl-code-block__language",c.textContent=r,l.appendChild(c),n){const t=document.createElement("span");t.className="notectl-code-block__chevron",t.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="10" height="10"><path d="M4 6l4 4 4-4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',l.appendChild(t)}i.setAttribute("aria-label",e.codeBlockAriaLabel(r)),o?h.setAttribute("data-language",o):h.removeAttribute("data-language"),_(i,"backgroundColor",(t.attrs?.backgroundColor??"")||"")}function m(t){g.textContent=t,setTimeout(()=>{g.textContent=""},1e3)}return b(o),d&&d.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const n=r().getBlock(k);n&&function(t){const e=globalThis.navigator?.clipboard;return e&&"function"==typeof e.writeText?e.writeText(t):Promise.reject(/* @__PURE__ */new Error("Clipboard API unavailable"))}(c(n)).then(()=>m(e.copiedToClipboard),()=>m(e.copyFailed))}),u.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const n=rt(r(),k);n&&(g.textContent=e.deletedCodeBlock,s(n))}),n&&l.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const o=r().getBlock(k);if(!o)return;const c=o.attrs?.language??"";!function(t){const{anchor:e,languages:n,currentLanguage:o,onSelect:r,popupManager:c,locale:s}=t;c.open({anchor:e,ariaRole:"listbox",ariaLabel:s.selectLanguageAria,className:"notectl-language-picker",position:"below-start",restoreFocusTo:e,content(t,e){const c=o.toLowerCase();lt(t,s.plainText,"",""===c);const i=[...n].sort((t,e)=>t.localeCompare(e));for(const n of i)lt(t,n,n,c===n.toLowerCase());R({container:t,itemSelector:at,onSelect(t){r(t.getAttribute("data-language")??""),e()},onClose(){e()}}),t.addEventListener("click",t=>{const n=t.target.closest(at);n&&(r(n.getAttribute("data-language")??""),e())})},onClose(){e.setAttribute("aria-expanded","false")}}),e.setAttribute("aria-expanded","true")}({anchor:l,languages:n.getSupportedLanguages(),currentLanguage:c,locale:e,popupManager:n.popupManager,onSelect(t){if(t===c)return;const n=r(),o=n.getBlock(k);if(!o)return;const i=n.getNodePath(k);if(!i)return;const a={...o.attrs,language:t};s(n.transaction("command").setNodeAttr(i,a).build());const l=t||e.plainText;g.textContent=e.languageChanged(l),setTimeout(()=>{g.textContent=""},1e3)}})}),{dom:i,contentDOM:h,update:t=>"code_block"===t.type&&(k=t.id,i.setAttribute("data-block-id",t.id),b(t),!0),selectNode(){i.classList.add("notectl-code-block--selected")},deselectNode(){i.classList.remove("notectl-code-block--selected")},destroy(){}}}}(this.config,this.locale,o))}registerInputRule(t){t.registerInputRule({pattern:/^```(\w*) $/,handler:(t,e,n,o)=>{const r=t.selection;if(!p(r))return null;if(!d(r))return null;const c=t.getBlock(r.anchor.blockId);if(!c||"paragraph"!==c.type)return null;const s={language:e[1]??"",backgroundColor:""};return t.transaction("input").deleteTextAt(r.anchor.blockId,n,n+e[0].length).setBlockType(r.anchor.blockId,f("code_block"),s).setSelection(g(r.anchor.blockId,0)).build()}})}registerToolbarItem(t){t.registerToolbarItem({id:"code_block",group:"block",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14z"/><path d="M11 14.17L8.83 12 11 9.83 9.59 8.41 6 12l3.59 3.59L11 14.17zm3.41 1.42L18 12l-3.59-3.59L13 9.83 15.17 12 13 14.17l1.41 1.42z"/></svg>',label:this.locale.label,tooltip:this.locale.tooltip(this.resolvedKeymap.toggle?O(this.resolvedKeymap.toggle):void 0),command:"toggleCodeBlock",isActive:t=>!!p(t.selection)&&"code_block"===t.getBlock(t.selection.anchor.blockId)?.type})}registerMiddleware(t){t.registerMiddleware((t,e,n)=>{if(!t.steps.some(t=>"addMark"===t.type&&"code_block"===e.getBlock(t.blockId)?.type))return void n(t);const o=t.steps.filter(t=>"addMark"!==t.type||"code_block"!==e.getBlock(t.blockId)?.type);n({...t,steps:o})},{name:"code-block:mark-guard",priority:50})}registerPasteInterceptor(t){t.registerPasteInterceptor(this.handleCodeBlockPaste,{name:"code-block:paste",priority:10})}registerTextInputInterceptor(t){t.registerTextInputInterceptor(this.handleCodeBlockTextInput,{name:"code-block:auto-pair",priority:10})}handleCodeBlockTextInput=(t,e)=>{if(this.pendingPairOps.length=0,!this.context)return null;if(this.context.getCompositionState().isComposing)return null;if(!p(e.selection))return null;if(1!==t.length)return null;const n=e.selection,o=e.getBlock(n.anchor.blockId);if(!o||"code_block"!==o.type)return null;const r=this.tryDedentOnCloseBracket(e,o,t);if(r)return r;const s=function(t){const{state:e,char:n,config:o}=t;if(!p(e.selection))return{kind:"passthrough"};const r=e.selection,s=F.get(n);if(s&&!d(r)&&function(t,e){switch(e.surround){case"never":return!1;case"brackets":return"bracket"===t.kind;case"quotes":return"quote"===t.kind;case"languageDefined":return!0}}(s,o)){const e=function(t,e,n){const{state:o}=n,r=a(e,o.getBlockOrder());return r.from.blockId!==r.to.blockId||r.from.blockId!==n.blockId?null:{kind:"wrap",open:t.open,close:t.close}}(s,r,t);if(e)return e}return d(r)?o.overtype&&function(t,e){if(!function(t){const e=F.get(t);return"quote"===e?.kind?e:K.get(t)}(e))return!1;const n=t.state.selection;if(!p(n))return!1;const o=c(t.block),r=n.anchor.offset;if(o[r]!==e)return!1;const s=t.pairStack.peek(t.blockId,r);return Boolean(s&&s.char===e)}(t,n)?{kind:"overtype"}:s&&function(t,e){const n="quote"===t.kind?e.config.quotes:e.config.brackets;if("never"===n)return!1;const o=e.state.selection;if(!p(o))return!0;const r=c(e.block),s=o.anchor.offset;if("quote"===t.kind&&"'"===t.open&&function(t,e){if(e<=0)return!1;const n=t[e-1];return!!n&&/[A-Za-z0-9_]/.test(n)}(r,s))return!1;if("always"===n)return!0;if("beforeWhitespace"===n)return function(t,e){if(e>=t.length)return!0;const n=t[e];return!n||!!/\s/.test(n)||!!K.has(n)}(r,s);if("quote"===t.kind){const t=e.getTokenAt(e.blockId,s);return!t||"string"!==t.type&&"comment"!==t.type}return!0}(s,t)?{kind:"pair",close:s.close}:{kind:"passthrough"}:{kind:"passthrough"}}({state:e,block:o,blockId:n.anchor.blockId,char:t,config:this.resolvedPairing,pairStack:this.pairStack,getTokenAt:this.tokenLookup});switch(s.kind){case"pair":return this.buildAutoPairTransaction(e,n.anchor.blockId,s.close,t);case"overtype":return this.buildOvertypeTransaction(e,n.anchor.blockId);case"wrap":return this.buildWrapTransaction(e,n.anchor.blockId,s.open,s.close);case"passthrough":return null}};tokenLookup=(t,e)=>this.findTokenAt(t,e);tryDedentOnCloseBracket(t,e,n){if("brackets"!==this.resolvedIndent.mode)return null;if("}"!==n&&"]"!==n&&")"!==n)return null;const o=t.selection;if(!p(o)||!d(o))return null;const r=c(e),s=o.anchor.offset;if(!function(t,e){const{start:n}=J(t,e);for(let o=n;o<e;o++){const e=t[o];if(" "!==e&&"\t"!==e)return!1}return!0}(r,s))return null;const{start:i}=J(r,s);if(i===s)return null;const a=o.anchor.blockId,l=this.findTrackedCloseAfter(r,s,n,a);if(null!==l)return t.transaction("input").deleteTextAt(a,i,l).setSelection(g(a,i+1)).build();const u=G(r.slice(i,s),this.resolvedIndent.useSpaces,this.resolvedIndent.spaceCount);if(0===u.removed.length)return null;const h=s-u.removed.length;return t.transaction("input").deleteTextAt(a,h,s).insertText(a,h,n,[]).setSelection(g(a,h+1)).build()}findTrackedCloseAfter(t,e,n,o){for(let r=e;r<t.length;r++){const e=t[r];if(" "!==e&&"\t"!==e&&"\n"!==e){if(e===n){const t=this.pairStack.peek(o,r);if(t&&t.char===n)return r}return null}}return null}buildAutoPairTransaction(t,e,n,o){const r=t.selection;if(!p(r))throw new Error("buildAutoPairTransaction requires a text selection");const c=r.anchor.offset,s=`${o}${n}`,i=t.transaction("input").insertText(e,c,s,[]).setSelection(g(e,c+1)).build();return this.pendingPairOps.push({kind:"push",blockId:e,offset:c+1,char:n}),i}buildOvertypeTransaction(t,e){const n=t.selection;if(!p(n))throw new Error("buildOvertypeTransaction requires a text selection");const o=n.anchor.offset;return this.pendingPairOps.push({kind:"take",blockId:e,offset:o}),t.transaction("input").setSelection(g(e,o+1)).build()}buildWrapTransaction(t,e,n,o){const r=t.selection;if(!p(r))throw new Error("buildWrapTransaction requires a text selection");const c=function(t,e){const n=a(t,e);return{fromOffset:n.from.offset,toOffset:n.to.offset}}(r,t.getBlockOrder()),s=a(r,t.getBlockOrder()).from===r.anchor,i=c.fromOffset+1,l=c.toOffset+1,d=s?i:l,u=s?l:i;return t.transaction("input").insertText(e,c.toOffset,o,[]).insertText(e,c.fromOffset,n,[]).setSelection({anchor:{blockId:e,offset:d},head:{blockId:e,offset:u}}).build()}handleCodeBlockPaste=(t,e,n)=>{if(!t)return null;if(!p(n.selection))return null;const o=n.getBlock(n.selection.anchor.blockId);if(!o||"code_block"!==o.type)return null;const r=n.transaction("paste");let c=n.selection.anchor.blockId,s=n.selection.anchor.offset;if(!d(n.selection)){const t=h(n,r);t&&(c=t,s=0)}return r.insertText(c,s,t,[]),r.setSelection(g(c,s+t.length)),r.build()};patchTableCellContent(t){const e=t.getSchemaRegistry(),n=e.getNodeSpec("table_cell");if(!n?.content)return;const o=n.content.allow??[];o.includes("code_block")||(e.removeNodeSpec("table_cell"),e.registerNodeSpec({...n,content:{...n.content,allow:[...o,"code_block"]}}))}initHighlighter(){this.config.highlighter?this.highlighter=this.config.highlighter:this.highlighter=new kt}registerLanguageRegistry(t){const e=this.highlighter,n=this.tokenCache;this.languageRegistry.onRegister(t=>{t.highlighting&&e?.registerLanguage&&(e.registerLanguage(t.highlighting),n.clear())}),t.registerService(j,this.languageRegistry),this.languageRegistry.register($),this.languageRegistry.register(E),this.languageRegistry.register(z),this.languageRegistry.register(H)}registerSyntaxHighlighterService(t){const e=this.highlighter;e&&t.registerService(pt,{registerLanguage:t=>{e.registerLanguage?.(t),this.tokenCache.clear()},getSupportedLanguages:()=>e.getSupportedLanguages(),tokenize:(t,n)=>e.tokenize(t,n),getTokenAt:(t,e)=>this.findTokenAt(t,e)})}findTokenAt(t,e){const n=this.tokenCache.get(t);if(!n)return;const o=n.tokens;let r=0,c=o.length-1;for(;r<=c;){const t=r+c>>>1,n=o[t];if(!n)return;if(e<n.from)c=t-1;else{if(!(e>=n.to))return n;r=t+1}}}getCachedTokens(t,e,n){const o=this.tokenCache.get(t);if(o&&o.text===e&&o.language===n)return o.tokens;const r=this.highlighter?.tokenize(e,n)??[];return this.tokenCache.set(t,{text:e,language:n,tokens:r}),r}getFocusedCodeBlockId(t){if(!p(t.selection))return null;const e=t.selection.anchor.blockId;return"code_block"===t.getBlock(e)?.type?e:null}};export{ct as a,pt as i,kt as n,it as o,gt as r,bt as t};
|
|
2
|
+
//# sourceMappingURL=CodeBlockPlugin-o0Aoq9Nu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockPlugin-o0Aoq9Nu.mjs","names":[],"sources":["../../src/editor/styles/code-block.ts","../../src/plugins/language/LanguageRegistry.ts","../../src/plugins/code-block/BracketPairing.ts","../../src/plugins/code-block/IndentHelpers.ts","../../src/plugins/code-block/CodeBlockKeyboardHandlers.ts","../../src/plugins/code-block/CodeBlockCommands.ts","../../src/plugins/code-block/CodeBlockLocale.ts","../../src/plugins/code-block/LanguagePicker.ts","../../src/plugins/code-block/CodeBlockNodeView.ts","../../src/plugins/code-block/CodeBlockTypes.ts","../../src/plugins/code-block/CodeBlockService.ts","../../src/plugins/code-block/PairStack.ts","../../src/plugins/code-block/highlighter/RegexTokenizer.ts","../../src/plugins/code-block/CodeBlockPlugin.ts"],"sourcesContent":["import { SYNTAX_TOKEN_TYPES } from '../theme/SyntaxTokenTypes.js';\n\n/** Generates per-token CSS rules from the canonical token type list. */\nfunction generateTokenCSS(): string {\n\treturn SYNTAX_TOKEN_TYPES.map(\n\t\t(type) =>\n\t\t\t`.notectl-token--${type} {\\n\\tcolor: var(--notectl-code-token-${type});\\n\\tfont-style: var(--notectl-code-token-${type}-font-style, inherit);\\n\\tfont-weight: var(--notectl-code-token-${type}-font-weight, inherit);\\n}`,\n\t).join('\\n');\n}\n\n/** Code block styles — syntax highlighting container, header, copy button. */\nexport const CODE_BLOCK_CSS = `\n/* Code Block — uses theme custom properties */\n.notectl-code-block {\n\tposition: relative;\n\tmargin: 8px 0;\n\tborder-radius: 6px;\n\tbackground: var(--notectl-code-block-bg);\n\tcolor: var(--notectl-code-block-color);\n\tfont-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, Consolas, monospace;\n\tfont-size: 14px;\n\tline-height: 1.5;\n\toverflow: hidden;\n}\n\n.notectl-code-block__header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 6px 12px;\n\tbackground: var(--notectl-code-block-header-bg);\n\tborder-bottom: 1px solid var(--notectl-code-block-header-border);\n\tfont-size: 12px;\n\tcolor: var(--notectl-code-block-header-color);\n\tuser-select: none;\n}\n\n.notectl-code-block__language-btn {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 4px;\n\tborder: none;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: var(--notectl-code-block-header-color);\n\tcursor: pointer;\n\tpadding: 2px 6px;\n\tfont-size: inherit;\n\tfont-family: inherit;\n\ttransition: background 0.15s;\n}\n\n.notectl-code-block__language-btn:hover {\n\tbackground: rgba(128, 128, 128, 0.15);\n}\n\n.notectl-code-block__language-btn:focus-visible {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 1px;\n}\n\n.notectl-code-block__language {\n\tfont-weight: 500;\n\tletter-spacing: 0.02em;\n}\n\n.notectl-code-block__chevron {\n\tdisplay: inline-flex;\n\talign-items: center;\n\topacity: 0.6;\n}\n\n.notectl-code-block__actions {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 2px;\n}\n\n.notectl-code-block__copy,\n.notectl-code-block__delete {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 24px;\n\theight: 24px;\n\tborder: none;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: var(--notectl-code-block-header-color);\n\tcursor: pointer;\n\tpadding: 0;\n\ttransition: background 0.15s, color 0.15s;\n}\n\n.notectl-code-block__copy:hover,\n.notectl-code-block__delete:hover {\n\tbackground: rgba(128, 128, 128, 0.15);\n\tcolor: var(--notectl-code-block-color);\n}\n\n.notectl-code-block__copy svg,\n.notectl-code-block__delete svg {\n\tfill: currentColor;\n}\n\n.notectl-code-block__content {\n\tdisplay: block;\n\tpadding: 12px 16px;\n\twhite-space: pre-wrap;\n\tword-wrap: break-word;\n\ttab-size: 4;\n\t-moz-tab-size: 4;\n\toutline: none;\n\tmin-height: 1.5em;\n}\n\n.notectl-code-block--selected {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 2px;\n}\n\n.notectl-code-block__esc-hint {\n\tdisplay: none;\n\tposition: absolute;\n\tbottom: 4px;\n\tinset-inline-end: 8px;\n\tfont-size: 11px;\n\tcolor: var(--notectl-code-block-header-color);\n\topacity: 0.5;\n\tpointer-events: none;\n\tuser-select: none;\n\tfont-family: system-ui, sans-serif;\n}\n\n.notectl-code-block--focused .notectl-code-block__esc-hint {\n\tdisplay: block;\n}\n\n/* Language picker popup */\n.notectl-language-picker {\n\tmin-width: 120px;\n\tmax-height: 200px;\n\toverflow-y: auto;\n\tpadding: 4px;\n\tbackground: var(--notectl-surface-raised, #fff);\n\tborder: 1px solid var(--notectl-border, #e0e0e0);\n\tborder-radius: 6px;\n\tbox-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);\n}\n\n.notectl-language-picker__option {\n\tpadding: 6px 10px;\n\tborder-radius: 4px;\n\tcursor: pointer;\n\tfont-size: 13px;\n\tcolor: var(--notectl-fg, #333);\n\twhite-space: nowrap;\n}\n\n.notectl-language-picker__option:hover {\n\tbackground: rgba(128, 128, 128, 0.1);\n}\n\n.notectl-language-picker__option:focus {\n\toutline: none;\n\tbackground: rgba(128, 128, 128, 0.15);\n}\n\n.notectl-language-picker__option[aria-selected=\"true\"] {\n\tfont-weight: 600;\n\tcolor: var(--notectl-primary, #2563eb);\n}\n\n/* Syntax highlighting token classes — generated from canonical token type list */\n${generateTokenCSS()}\n`;\n","/**\n * Internal registry that stores LanguageSupport bundles and notifies\n * subscribers with replay semantics for late subscribers.\n */\n\nimport type {\n\tLanguageRegistryListener,\n\tLanguageRegistryService,\n\tLanguageSupport,\n} from './LanguageTypes.js';\n\nexport class LanguageRegistry implements LanguageRegistryService {\n\tprivate readonly bundles = new Map<string, LanguageSupport>();\n\tprivate readonly listeners: LanguageRegistryListener[] = [];\n\n\tregister(support: LanguageSupport): void {\n\t\tthis.bundles.set(support.id, support);\n\t\tfor (const listener of this.listeners) {\n\t\t\tlistener(support);\n\t\t}\n\t}\n\n\t/**\n\t * Subscribes to language registrations.\n\t * The listener is immediately called for all already-registered bundles\n\t * (replay semantics), then called for each future registration.\n\t */\n\tonRegister(listener: LanguageRegistryListener): void {\n\t\tthis.listeners.push(listener);\n\t\tfor (const support of this.bundles.values()) {\n\t\t\tlistener(support);\n\t\t}\n\t}\n\n\tget(id: string): LanguageSupport | undefined {\n\t\treturn this.bundles.get(id);\n\t}\n\n\tgetAll(): readonly LanguageSupport[] {\n\t\treturn [...this.bundles.values()];\n\t}\n}\n","/**\n * BracketPairing: resolves the action that should be taken when the user\n * types a printable character that could trigger auto-pairing, overtype,\n * surround, or quote suppression inside a code block.\n *\n * The resolver is a pure function — it consumes the current state, the\n * incoming char, a token lookup and the auto-pair stack, and returns a\n * typed action that the keyboard / interceptor layer applies. No DOM, no\n * dispatch.\n */\n\nimport type { BlockNode } from '../../model/Document.js';\nimport { getBlockText } from '../../model/Document.js';\nimport {\n\ttype Selection,\n\tisCollapsed,\n\tisTextSelection,\n\tselectionRange,\n} from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { ResolvedPairingConfig, SyntaxToken } from './CodeBlockTypes.js';\nimport type { PairStack } from './PairStack.js';\n\n// --- Pair definitions ---\n\nexport interface PairDefinition {\n\treadonly open: string;\n\treadonly close: string;\n\treadonly kind: 'bracket' | 'quote';\n}\n\nexport const PAIR_DEFINITIONS: readonly PairDefinition[] = [\n\t{ open: '(', close: ')', kind: 'bracket' },\n\t{ open: '[', close: ']', kind: 'bracket' },\n\t{ open: '{', close: '}', kind: 'bracket' },\n\t{ open: '\"', close: '\"', kind: 'quote' },\n\t{ open: \"'\", close: \"'\", kind: 'quote' },\n\t{ open: '`', close: '`', kind: 'quote' },\n];\n\nconst OPEN_TO_PAIR: ReadonlyMap<string, PairDefinition> = new Map(\n\tPAIR_DEFINITIONS.map((d) => [d.open, d]),\n);\nconst CLOSE_TO_PAIR: ReadonlyMap<string, PairDefinition> = new Map(\n\t// For brackets close !== open, for quotes close === open\n\tPAIR_DEFINITIONS.filter((d) => d.kind === 'bracket').map((d) => [d.close, d]),\n);\n\n// --- Action variants ---\n\nexport type PairAction =\n\t| { readonly kind: 'pair'; readonly close: string }\n\t| { readonly kind: 'overtype' }\n\t| { readonly kind: 'wrap'; readonly open: string; readonly close: string }\n\t| { readonly kind: 'passthrough' };\n\n// --- Lookups injected by the caller ---\n\nexport type TokenLookup = (blockId: BlockId, offset: number) => SyntaxToken | undefined;\n\n// --- Resolver ---\n\nexport interface ResolvePairContext {\n\treadonly state: EditorState;\n\treadonly block: BlockNode;\n\treadonly blockId: BlockId;\n\treadonly char: string;\n\treadonly config: ResolvedPairingConfig;\n\treadonly pairStack: PairStack;\n\treadonly getTokenAt: TokenLookup;\n}\n\n/**\n * Decides what to do when the user types `char` inside a code block.\n * Returns a `PairAction` describing the next step.\n */\nexport function resolvePairAction(ctx: ResolvePairContext): PairAction {\n\tconst { state, char, config } = ctx;\n\tif (!isTextSelection(state.selection)) return { kind: 'passthrough' };\n\n\tconst sel = state.selection;\n\tconst definition: PairDefinition | undefined = OPEN_TO_PAIR.get(char);\n\n\t// Wrap takes precedence over suppression when there is a range selection.\n\tif (definition && !isCollapsed(sel) && surroundEnabled(definition, config)) {\n\t\tconst wrap = tryWrapAction(definition, sel, ctx);\n\t\tif (wrap) return wrap;\n\t}\n\n\tif (!isCollapsed(sel)) return { kind: 'passthrough' };\n\n\t// Overtype: user typed a close char that matches the next char and was\n\t// auto-inserted by us.\n\tif (config.overtype && shouldOvertype(ctx, char)) {\n\t\treturn { kind: 'overtype' };\n\t}\n\n\tif (!definition) return { kind: 'passthrough' };\n\n\t// Suppression checks for collapsed-cursor auto-pair.\n\tif (!pairingAllowed(definition, ctx)) return { kind: 'passthrough' };\n\n\treturn { kind: 'pair', close: definition.close };\n}\n\nfunction tryWrapAction(\n\tdef: PairDefinition,\n\tsel: Selection,\n\tctx: ResolvePairContext,\n): PairAction | null {\n\tconst { state } = ctx;\n\tconst order = state.getBlockOrder();\n\tconst range = selectionRange(sel, order);\n\tif (range.from.blockId !== range.to.blockId) return null;\n\tif (range.from.blockId !== ctx.blockId) return null;\n\treturn { kind: 'wrap', open: def.open, close: def.close };\n}\n\nfunction shouldOvertype(ctx: ResolvePairContext, char: string): boolean {\n\tconst closeDef: PairDefinition | undefined = closeDefinitionFor(char);\n\tif (!closeDef) return false;\n\n\tconst sel = ctx.state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tconst text: string = getBlockText(ctx.block);\n\tconst offset: number = sel.anchor.offset;\n\tif (text[offset] !== char) return false;\n\n\t// Only overtype if this exact close char was recorded by an auto-pair.\n\tconst entry = ctx.pairStack.peek(ctx.blockId, offset);\n\treturn Boolean(entry && entry.char === char);\n}\n\n/**\n * Returns the pair definition where `char` is a close char. Quotes are\n * symmetric, so `OPEN_TO_PAIR` is checked first for them.\n */\nfunction closeDefinitionFor(char: string): PairDefinition | undefined {\n\tconst symmetric = OPEN_TO_PAIR.get(char);\n\tif (symmetric?.kind === 'quote') return symmetric;\n\treturn CLOSE_TO_PAIR.get(char);\n}\n\nfunction surroundEnabled(def: PairDefinition, config: ResolvedPairingConfig): boolean {\n\tswitch (config.surround) {\n\t\tcase 'never':\n\t\t\treturn false;\n\t\tcase 'brackets':\n\t\t\treturn def.kind === 'bracket';\n\t\tcase 'quotes':\n\t\t\treturn def.kind === 'quote';\n\t\tcase 'languageDefined':\n\t\t\treturn true;\n\t}\n}\n\nfunction pairingAllowed(def: PairDefinition, ctx: ResolvePairContext): boolean {\n\tconst mode: 'always' | 'languageDefined' | 'beforeWhitespace' | 'never' =\n\t\tdef.kind === 'quote' ? ctx.config.quotes : ctx.config.brackets;\n\tif (mode === 'never') return false;\n\n\tconst sel = ctx.state.selection;\n\tif (!isTextSelection(sel)) return true;\n\tconst text: string = getBlockText(ctx.block);\n\tconst offset: number = sel.anchor.offset;\n\n\tif (def.kind === 'quote' && def.open === \"'\" && isApostropheContext(text, offset)) {\n\t\treturn false;\n\t}\n\n\tif (mode === 'always') return true;\n\tif (mode === 'beforeWhitespace') {\n\t\treturn isFollowingCharCompatibleForPair(text, offset);\n\t}\n\t// languageDefined\n\tif (def.kind === 'quote') {\n\t\tconst token = ctx.getTokenAt(ctx.blockId, offset);\n\t\tif (!token) {\n\t\t\t// Cache miss: fall back to always-allow (safe default).\n\t\t\treturn true;\n\t\t}\n\t\tif (token.type === 'string' || token.type === 'comment') return false;\n\t\treturn true;\n\t}\n\t// Brackets always pair under languageDefined\n\treturn true;\n}\n\n/**\n * VS-Code-style apostrophe suppression: `'` directly after a word char\n * `[A-Za-z0-9_]` is *not* paired (so `don't`, `it's` work).\n */\nfunction isApostropheContext(text: string, offset: number): boolean {\n\tif (offset <= 0) return false;\n\tconst prev = text[offset - 1];\n\tif (!prev) return false;\n\treturn /[A-Za-z0-9_]/.test(prev);\n}\n\nfunction isFollowingCharCompatibleForPair(text: string, offset: number): boolean {\n\tif (offset >= text.length) return true;\n\tconst next = text[offset];\n\tif (!next) return true;\n\tif (/\\s/.test(next)) return true;\n\tif (CLOSE_TO_PAIR.has(next)) return true;\n\treturn false;\n}\n\n/**\n * Wrap-selection helper: given the open/close chars and a selection, returns\n * the offsets where the chars should be inserted in document order.\n */\nexport interface WrapPlan {\n\treadonly fromOffset: number;\n\treadonly toOffset: number;\n}\n\nexport function wrapSelectionPlan(sel: Selection, blockOrder: readonly BlockId[]): WrapPlan {\n\tconst range = selectionRange(sel, blockOrder);\n\treturn { fromOffset: range.from.offset, toOffset: range.to.offset };\n}\n","/**\n * Pure helpers for indent and bracket analysis inside code blocks.\n *\n * All helpers operate on the raw block text plus an offset; no editor state,\n * no transactions. This keeps them trivially testable and reusable from\n * keyboard handlers and the text-input interceptor alike.\n */\n\nexport interface ResolvedIndent {\n\t/** Active indent unit ('\\t' or N spaces). */\n\treadonly unit: string;\n\t/** Whether spaces are used (mirrors config). */\n\treadonly useSpaces: boolean;\n\t/** Effective indent width in characters. */\n\treadonly width: number;\n}\n\nconst OPEN_BRACKETS = new Set(['{', '[', '(']);\nconst CLOSE_BRACKETS_TO_OPEN: Readonly<Record<string, string>> = {\n\t'}': '{',\n\t']': '[',\n\t')': '(',\n};\n\n/** Returns the inclusive line range `[start, end)` covering `offset`. */\nexport function getLineRange(text: string, offset: number): { start: number; end: number } {\n\tconst start: number = text.lastIndexOf('\\n', offset - 1) + 1;\n\tconst nlIndex: number = text.indexOf('\\n', offset);\n\tconst end: number = nlIndex === -1 ? text.length : nlIndex;\n\treturn { start, end };\n}\n\n/** Returns the leading whitespace (tabs/spaces only) of the line covering `offset`. */\nexport function getCurrentLineIndent(text: string, offset: number): string {\n\tconst { start, end } = getLineRange(text, offset);\n\tlet i: number = start;\n\twhile (i < end) {\n\t\tconst ch = text[i];\n\t\tif (ch !== ' ' && ch !== '\\t') break;\n\t\ti++;\n\t}\n\treturn text.slice(start, i);\n}\n\n/**\n * Returns the last non-whitespace character of `text` in the range\n * `[lineStart, cursorOffset)`, or `''` if the entire prefix is whitespace.\n * The cursor itself is excluded.\n */\nexport function lastNonWhitespaceCharBeforeCursor(text: string, cursorOffset: number): string {\n\tconst { start } = getLineRange(text, cursorOffset);\n\tfor (let i = cursorOffset - 1; i >= start; i--) {\n\t\tconst ch = text[i];\n\t\tif (ch && ch !== ' ' && ch !== '\\t') return ch;\n\t}\n\treturn '';\n}\n\n/** True if the prefix `[lineStart, cursorOffset)` contains only whitespace. */\nexport function isWhitespaceOnlyBeforeOffset(text: string, cursorOffset: number): boolean {\n\tconst { start } = getLineRange(text, cursorOffset);\n\tfor (let i = start; i < cursorOffset; i++) {\n\t\tconst ch = text[i];\n\t\tif (ch !== ' ' && ch !== '\\t') return false;\n\t}\n\treturn true;\n}\n\n/**\n * True if the prefix up to `cursorOffset` ends with an open bracket\n * (`{`, `[`, `(`) — ignoring trailing whitespace.\n */\nexport function endsWithOpenBracket(text: string, cursorOffset: number): boolean {\n\tconst last: string = lastNonWhitespaceCharBeforeCursor(text, cursorOffset);\n\treturn OPEN_BRACKETS.has(last);\n}\n\n/**\n * True if the user just typed Enter between a matching open/close pair\n * (e.g. `{|}`, `[|]`, `(|)`). Checks the next char at cursor against the\n * char before the cursor; only matches direct pairs without intervening\n * whitespace.\n */\nexport function isBetweenBracketPair(text: string, cursorOffset: number): boolean {\n\tif (cursorOffset <= 0 || cursorOffset >= text.length) return false;\n\tconst before = text[cursorOffset - 1];\n\tconst after = text[cursorOffset];\n\tif (!before || !after) return false;\n\tconst expectedOpen: string | undefined = CLOSE_BRACKETS_TO_OPEN[after];\n\treturn expectedOpen === before;\n}\n\n/**\n * Returns the unit string for the resolved indent config.\n * `'\\t'` for tabs, `' '.repeat(spaceCount)` for spaces.\n */\nexport function resolveIndentUnit(useSpaces: boolean, spaceCount: number): string {\n\treturn useSpaces ? ' '.repeat(spaceCount) : '\\t';\n}\n\n/**\n * Removes exactly one indent unit from the start of `line`. If `line`\n * does not start with a full unit, removes whatever leading whitespace\n * exists up to the unit length (so a partially-indented line still loses\n * its leading whitespace). Returns `{ removed, rest }`.\n */\nexport function dedentOnce(\n\tline: string,\n\tuseSpaces: boolean,\n\tspaceCount: number,\n): { removed: string; rest: string } {\n\tif (line.length === 0) return { removed: '', rest: line };\n\tif (!useSpaces) {\n\t\tif (line[0] === '\\t') return { removed: '\\t', rest: line.slice(1) };\n\t\t// fall through: try removing up to `spaceCount` leading spaces\n\t}\n\tlet i = 0;\n\twhile (i < spaceCount && line[i] === ' ') i++;\n\treturn { removed: line.slice(0, i), rest: line.slice(i) };\n}\n\n/**\n * Returns the indentation that should be inserted *after* the newline when\n * the user presses Enter on the line covering `cursorOffset`. Combines the\n * line's existing leading whitespace with an extra indent step if the\n * prefix ends with an open bracket and `mode === 'brackets'`.\n */\nexport function nextIndentLevel(\n\ttext: string,\n\tcursorOffset: number,\n\tmode: 'none' | 'keep' | 'brackets',\n\tunit: string,\n): string {\n\tif (mode === 'none') return '';\n\tconst base: string = getCurrentLineIndent(text, cursorOffset);\n\tif (mode === 'keep') return base;\n\tif (endsWithOpenBracket(text, cursorOffset)) return base + unit;\n\treturn base;\n}\n\n/**\n * True if the prefix triggers the 3-line block-pattern: `{|}` (or `[|]`,\n * `(|)`) where cursor is exactly between an open/close pair. Used by the\n * Enter handler to expand the cursor onto its own indented line.\n */\nexport function shouldOpenIndentBlock(text: string, cursorOffset: number): boolean {\n\treturn isBetweenBracketPair(text, cursorOffset);\n}\n","/**\n * Keyboard handlers for code-block navigation and editing.\n * Handles Enter (with auto-indent + block-pattern), Backspace (with pair-delete),\n * Tab, Shift-Tab (with multi-line range handling), Escape, Arrow keys, and\n * configurable shortcuts (Mod+Enter, toggle).\n */\n\nimport type { BlockNode } from '../../model/Document.js';\nimport { generateBlockId, getBlockLength, getBlockText } from '../../model/Document.js';\nimport {\n\ttype Selection,\n\tcreateCollapsedSelection,\n\tcreateSelection,\n\tisCollapsed,\n\tisForward,\n\tisTextSelection,\n\tselectionRange,\n} 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 { Transaction } from '../../state/Transaction.js';\nimport type { PluginContext } from '../Plugin.js';\nimport type { CodeBlockLocale } from './CodeBlockLocale.js';\nimport type {\n\tCodeBlockConfig,\n\tCodeBlockKeymap,\n\tResolvedIndentConfig,\n\tResolvedPairingConfig,\n} from './CodeBlockTypes.js';\nimport {\n\tdedentOnce,\n\tgetCurrentLineIndent,\n\tgetLineRange,\n\tnextIndentLevel,\n\tresolveIndentUnit,\n\tshouldOpenIndentBlock,\n} from './IndentHelpers.js';\nimport type { PairStack } from './PairStack.js';\n\n// --- Context Guard ---\n\ninterface CodeBlockContext {\n\treadonly state: EditorState;\n\treadonly sel: Selection;\n\treadonly block: BlockNode;\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n}\n\nfunction withCodeBlockContext(\n\tcontext: PluginContext,\n\thandler: (ctx: CodeBlockContext) => boolean,\n): boolean {\n\tconst state: EditorState = context.getState();\n\tif (!isTextSelection(state.selection)) return false;\n\n\tconst sel: Selection = state.selection;\n\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\tif (!block || block.type !== 'code_block') return false;\n\n\treturn handler({\n\t\tstate,\n\t\tsel,\n\t\tblock,\n\t\tblockId: sel.anchor.blockId,\n\t\toffset: sel.anchor.offset,\n\t});\n}\n\n/** Dependencies for the keyboard handlers. */\nexport interface CodeBlockKeyboardDeps {\n\treadonly indent: ResolvedIndentConfig;\n\treadonly pairing: ResolvedPairingConfig;\n\treadonly pairStack: PairStack;\n\treadonly locale: () => CodeBlockLocale;\n}\n\n/** Registers all code-block keyboard handlers. */\nexport function registerCodeBlockKeymaps(\n\tcontext: PluginContext,\n\tconfig: CodeBlockConfig,\n\tresolvedKeymap: Readonly<Record<keyof CodeBlockKeymap, string | null>>,\n\tdeps: CodeBlockKeyboardDeps,\n): void {\n\tconst keymap: Record<string, () => boolean> = {\n\t\tEnter: () => handleEnter(context, deps),\n\t\tBackspace: () => handleBackspace(context, deps),\n\t\tTab: () => handleTab(context, deps),\n\t\t'Shift-Tab': () => handleShiftTab(context, deps),\n\t\tEscape: () => handleEscape(context),\n\t\tArrowDown: () => handleArrowDown(context),\n\t\tArrowUp: () => handleArrowUp(context),\n\t\tArrowRight: () => handleArrowRight(context),\n\t\tArrowLeft: () => handleArrowLeft(context),\n\t};\n\n\tconst { insertAfter, toggle } = resolvedKeymap;\n\n\tif (insertAfter) {\n\t\tkeymap[insertAfter] = () => handleModEnter(context);\n\t}\n\tif (toggle) {\n\t\tkeymap[toggle] = () => context.executeCommand('toggleCodeBlock');\n\t}\n\n\tcontext.registerKeymap(keymap, { priority: 'context' });\n\n\t// `config` is kept in the signature for future language-defined indent rules.\n\tvoid config;\n}\n\n// --- Handler Functions ---\n\nfunction handleBackspace(context: PluginContext, deps: CodeBlockKeyboardDeps): boolean {\n\treturn withCodeBlockContext(context, ({ state, block, blockId, offset }) => {\n\t\tif (!isCollapsed(state.selection)) return false;\n\n\t\t// Pair-delete: backspace between an auto-paired empty pair removes both chars.\n\t\tif (deps.pairing.deletePair && offset > 0) {\n\t\t\tconst text: string = getBlockText(block);\n\t\t\tconst before = text[offset - 1];\n\t\t\tconst after = text[offset];\n\t\t\tif (before && after && isMatchingPair(before, after)) {\n\t\t\t\tconst entry = deps.pairStack.peek(blockId, offset);\n\t\t\t\tif (entry && entry.char === after) {\n\t\t\t\t\tconst tr: Transaction = state\n\t\t\t\t\t\t.transaction('input')\n\t\t\t\t\t\t.deleteTextAt(blockId, offset - 1, offset + 1)\n\t\t\t\t\t\t.setSelection(createCollapsedSelection(blockId, offset - 1))\n\t\t\t\t\t\t.build();\n\t\t\t\t\tcontext.dispatch(tr);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (offset !== 0) return false;\n\n\t\tconst tr: Transaction = state\n\t\t\t.transaction('input')\n\t\t\t.setBlockType(blockId, nodeType('paragraph'))\n\t\t\t.setSelection(state.selection)\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t});\n}\n\nfunction handleEnter(context: PluginContext, deps: CodeBlockKeyboardDeps): boolean {\n\treturn withCodeBlockContext(context, ({ state, block, blockId, offset }) => {\n\t\tif (!isCollapsed(state.selection)) return false;\n\n\t\tconst text: string = getBlockText(block);\n\t\tif (text.endsWith('\\n') && offset === text.length) {\n\t\t\treturn exitOnDoubleEnter(context, blockId, text);\n\t\t}\n\n\t\tconst unit: string = resolveIndentUnit(deps.indent.useSpaces, deps.indent.spaceCount);\n\n\t\t// Block-pattern: cursor between matching open/close → 3-line layout.\n\t\tif (deps.indent.mode === 'brackets' && shouldOpenIndentBlock(text, offset)) {\n\t\t\tconst baseIndent: string = getCurrentLineIndent(text, offset);\n\t\t\tconst insert = `\\n${baseIndent}${unit}\\n${baseIndent}`;\n\t\t\tconst cursorOffset: number = offset + 1 + baseIndent.length + unit.length;\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('input')\n\t\t\t\t.insertText(blockId, offset, insert, [])\n\t\t\t\t.setSelection(createCollapsedSelection(blockId, cursorOffset))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\tconst indent: string = nextIndentLevel(text, offset, deps.indent.mode, unit);\n\t\tconst insert = `\\n${indent}`;\n\t\tconst tr: Transaction = state\n\t\t\t.transaction('input')\n\t\t\t.insertText(blockId, offset, insert, [])\n\t\t\t.setSelection(createCollapsedSelection(blockId, offset + insert.length))\n\t\t\t.build();\n\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t});\n}\n\nfunction handleTab(context: PluginContext, deps: CodeBlockKeyboardDeps): boolean {\n\treturn withCodeBlockContext(context, ({ state, sel, block, blockId, offset }) => {\n\t\tconst unit: string = resolveIndentUnit(deps.indent.useSpaces, deps.indent.spaceCount);\n\n\t\tif (isCollapsed(sel)) {\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('input')\n\t\t\t\t.insertText(blockId, offset, unit, [])\n\t\t\t\t.setSelection(createCollapsedSelection(blockId, offset + unit.length))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\t// Range selection — must be within this code block.\n\t\tif (sel.anchor.blockId !== blockId || sel.head.blockId !== blockId) return false;\n\n\t\tconst text: string = getBlockText(block);\n\t\tconst range = selectionRange(sel, state.getBlockOrder());\n\t\tconst fromOffset: number = range.from.offset;\n\t\tconst toOffset: number = range.to.offset;\n\t\tconst spansLine: boolean = text.slice(fromOffset, toOffset).includes('\\n');\n\n\t\tif (!spansLine) {\n\t\t\t// VS Code-style: replace selection with one indent unit.\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('input')\n\t\t\t\t.deleteTextAt(blockId, fromOffset, toOffset)\n\t\t\t\t.insertText(blockId, fromOffset, unit, [])\n\t\t\t\t.setSelection(createCollapsedSelection(blockId, fromOffset + unit.length))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\t// Multi-line indent.\n\t\tconst result = indentLineRange(text, fromOffset, toOffset, unit);\n\t\tconst builder = state.transaction('input');\n\t\t// Apply in reverse so earlier offsets remain valid after each insert.\n\t\tfor (let i = result.inserts.length - 1; i >= 0; i--) {\n\t\t\tconst insert = result.inserts[i];\n\t\t\tif (!insert) continue;\n\t\t\tbuilder.insertText(blockId, insert.offset, insert.text, []);\n\t\t}\n\t\tconst wasForward: boolean = isForward(sel, state.getBlockOrder());\n\t\tconst newFrom: number = result.lineStart;\n\t\tconst newTo: number = toOffset + result.totalInserted;\n\t\tconst anchorOff: number = wasForward ? newFrom : newTo;\n\t\tconst headOff: number = wasForward ? newTo : newFrom;\n\t\tbuilder.setSelection(\n\t\t\tcreateSelection({ blockId, offset: anchorOff }, { blockId, offset: headOff }),\n\t\t);\n\t\tcontext.dispatch(builder.build());\n\n\t\tif (result.lineCount >= 2) {\n\t\t\tcontext.announce(deps.locale().indentedNLines(result.lineCount));\n\t\t}\n\t\treturn true;\n\t});\n}\n\nfunction handleShiftTab(context: PluginContext, deps: CodeBlockKeyboardDeps): boolean {\n\treturn withCodeBlockContext(context, ({ state, sel, block, blockId, offset }) => {\n\t\tconst text: string = getBlockText(block);\n\n\t\tif (isCollapsed(sel)) {\n\t\t\treturn dedentSingleLine(context, state, blockId, offset, text, deps);\n\t\t}\n\n\t\tif (sel.anchor.blockId !== blockId || sel.head.blockId !== blockId) return false;\n\n\t\tconst range = selectionRange(sel, state.getBlockOrder());\n\t\tconst fromOffset: number = range.from.offset;\n\t\tconst toOffset: number = range.to.offset;\n\t\tconst spansLine: boolean = text.slice(fromOffset, toOffset).includes('\\n');\n\n\t\tif (!spansLine) {\n\t\t\treturn dedentSingleLine(context, state, blockId, offset, text, deps);\n\t\t}\n\n\t\tconst result = dedentLineRange(\n\t\t\ttext,\n\t\t\tfromOffset,\n\t\t\ttoOffset,\n\t\t\tdeps.indent.useSpaces,\n\t\t\tdeps.indent.spaceCount,\n\t\t);\n\t\tif (result.totalRemoved === 0) {\n\t\t\t// Nothing to remove — consume the event so the browser does not move focus.\n\t\t\treturn true;\n\t\t}\n\n\t\tconst builder = state.transaction('input');\n\t\tfor (let i = result.deletes.length - 1; i >= 0; i--) {\n\t\t\tconst del = result.deletes[i];\n\t\t\tif (!del) continue;\n\t\t\tbuilder.deleteTextAt(blockId, del.from, del.to);\n\t\t}\n\t\tconst wasForward: boolean = isForward(sel, state.getBlockOrder());\n\t\tconst newFrom: number = result.lineStart;\n\t\tconst newTo: number = toOffset - result.totalRemoved;\n\t\tconst anchorOff: number = wasForward ? newFrom : Math.max(newFrom, newTo);\n\t\tconst headOff: number = wasForward ? Math.max(newFrom, newTo) : newFrom;\n\t\tbuilder.setSelection(\n\t\t\tcreateSelection({ blockId, offset: anchorOff }, { blockId, offset: headOff }),\n\t\t);\n\t\tcontext.dispatch(builder.build());\n\n\t\tif (result.lineCount >= 2) {\n\t\t\tcontext.announce(deps.locale().dedentedNLines(result.lineCount));\n\t\t}\n\t\treturn true;\n\t});\n}\n\nfunction dedentSingleLine(\n\tcontext: PluginContext,\n\tstate: EditorState,\n\tblockId: BlockId,\n\toffset: number,\n\ttext: string,\n\tdeps: CodeBlockKeyboardDeps,\n): boolean {\n\tconst { start } = getLineRange(text, offset);\n\tconst lineText: string = text.slice(start);\n\tconst removed = dedentOnce(lineText, deps.indent.useSpaces, deps.indent.spaceCount);\n\tif (removed.removed.length === 0) return true;\n\n\tconst tr: Transaction = state\n\t\t.transaction('input')\n\t\t.deleteTextAt(blockId, start, start + removed.removed.length)\n\t\t.setSelection(\n\t\t\tcreateCollapsedSelection(blockId, Math.max(start, offset - removed.removed.length)),\n\t\t)\n\t\t.build();\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\n/**\n * Exits the code block to the next block or creates a new paragraph.\n * Exported for use by the `exitCodeBlock` command.\n */\nexport function handleEscape(context: PluginContext): boolean {\n\treturn withCodeBlockContext(context, ({ state, blockId }) => {\n\t\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\t\tconst idx: number = blockOrder.indexOf(blockId);\n\n\t\tif (idx < blockOrder.length - 1) {\n\t\t\tconst nextId: BlockId = blockOrder[idx + 1] as BlockId;\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('command')\n\t\t\t\t.setSelection(createCollapsedSelection(nextId, 0))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t} else {\n\t\t\tinsertParagraphAfter(context, blockId);\n\t\t}\n\n\t\treturn true;\n\t});\n}\n\nfunction handleArrowDown(context: PluginContext): boolean {\n\treturn withCodeBlockContext(context, ({ state, block, blockId, offset }) => {\n\t\tif (!isCollapsed(state.selection)) return false;\n\n\t\tconst text: string = getBlockText(block);\n\t\tconst nextNewline: number = text.indexOf('\\n', offset);\n\t\tif (nextNewline !== -1) return false;\n\n\t\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\t\tconst idx: number = blockOrder.indexOf(blockId);\n\n\t\tif (idx < blockOrder.length - 1) {\n\t\t\tconst nextId: BlockId = blockOrder[idx + 1] as BlockId;\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('command')\n\t\t\t\t.setSelection(createCollapsedSelection(nextId, 0))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t} else {\n\t\t\tinsertParagraphAfter(context, blockId);\n\t\t}\n\n\t\treturn true;\n\t});\n}\n\nfunction handleArrowUp(context: PluginContext): boolean {\n\treturn withCodeBlockContext(context, ({ state, block, blockId, offset }) => {\n\t\tif (!isCollapsed(state.selection)) return false;\n\n\t\tconst text: string = getBlockText(block);\n\t\tconst firstNewline: number = text.indexOf('\\n');\n\t\tif (firstNewline !== -1 && offset > firstNewline) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\t\tconst idx: number = blockOrder.indexOf(blockId);\n\n\t\tif (idx > 0) {\n\t\t\tconst prevId: BlockId = blockOrder[idx - 1] as BlockId;\n\t\t\tconst prevBlock: BlockNode | undefined = state.getBlock(prevId);\n\t\t\tconst prevLen: number = prevBlock ? getBlockLength(prevBlock) : 0;\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('command')\n\t\t\t\t.setSelection(createCollapsedSelection(prevId, prevLen))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t});\n}\n\nfunction handleArrowRight(context: PluginContext): boolean {\n\treturn withCodeBlockContext(context, ({ state, block, blockId, offset }) => {\n\t\tif (!isCollapsed(state.selection)) return false;\n\n\t\tconst text: string = getBlockText(block);\n\t\tif (offset !== text.length) return false;\n\n\t\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\t\tconst idx: number = blockOrder.indexOf(blockId);\n\n\t\tif (idx < blockOrder.length - 1) {\n\t\t\tconst nextId: BlockId = blockOrder[idx + 1] as BlockId;\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('command')\n\t\t\t\t.setSelection(createCollapsedSelection(nextId, 0))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t} else {\n\t\t\tinsertParagraphAfter(context, blockId);\n\t\t}\n\n\t\treturn true;\n\t});\n}\n\nfunction handleArrowLeft(context: PluginContext): boolean {\n\treturn withCodeBlockContext(context, ({ state, blockId, offset }) => {\n\t\tif (!isCollapsed(state.selection)) return false;\n\t\tif (offset !== 0) return false;\n\n\t\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\t\tconst idx: number = blockOrder.indexOf(blockId);\n\n\t\tif (idx > 0) {\n\t\t\tconst prevId: BlockId = blockOrder[idx - 1] as BlockId;\n\t\t\tconst prevBlock: BlockNode | undefined = state.getBlock(prevId);\n\t\t\tconst prevLen: number = prevBlock ? getBlockLength(prevBlock) : 0;\n\t\t\tconst tr: Transaction = state\n\t\t\t\t.transaction('command')\n\t\t\t\t.setSelection(createCollapsedSelection(prevId, prevLen))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t});\n}\n\nfunction handleModEnter(context: PluginContext): boolean {\n\treturn withCodeBlockContext(context, ({ blockId }) => {\n\t\tinsertParagraphAfter(context, blockId);\n\t\treturn true;\n\t});\n}\n\n// --- Multi-line indent helpers ---\n\ninterface IndentRangeResult {\n\treadonly inserts: readonly { offset: number; text: string }[];\n\treadonly totalInserted: number;\n\treadonly lineCount: number;\n\treadonly lineStart: number;\n}\n\nfunction indentLineRange(text: string, from: number, to: number, unit: string): IndentRangeResult {\n\tconst lineStart: number = text.lastIndexOf('\\n', from - 1) + 1;\n\tconst inserts: { offset: number; text: string }[] = [];\n\tlet lineCount = 0;\n\n\tlet pos: number = lineStart;\n\twhile (pos < to) {\n\t\tinserts.push({ offset: pos, text: unit });\n\t\tlineCount++;\n\t\tconst nl: number = text.indexOf('\\n', pos);\n\t\tif (nl === -1 || nl >= to) break;\n\t\tpos = nl + 1;\n\t}\n\n\treturn {\n\t\tinserts,\n\t\ttotalInserted: lineCount * unit.length,\n\t\tlineCount,\n\t\tlineStart,\n\t};\n}\n\ninterface DedentRangeResult {\n\treadonly deletes: readonly { from: number; to: number }[];\n\treadonly totalRemoved: number;\n\treadonly lineCount: number;\n\treadonly lineStart: number;\n}\n\nfunction dedentLineRange(\n\ttext: string,\n\tfrom: number,\n\tto: number,\n\tuseSpaces: boolean,\n\tspaceCount: number,\n): DedentRangeResult {\n\tconst lineStart: number = text.lastIndexOf('\\n', from - 1) + 1;\n\tconst deletes: { from: number; to: number }[] = [];\n\tlet totalRemoved = 0;\n\tlet lineCount = 0;\n\n\tlet pos: number = lineStart;\n\twhile (pos < to) {\n\t\tlineCount++;\n\t\tconst lineSlice: string = text.slice(pos);\n\t\tconst result = dedentOnce(lineSlice, useSpaces, spaceCount);\n\t\tif (result.removed.length > 0) {\n\t\t\tdeletes.push({ from: pos, to: pos + result.removed.length });\n\t\t\ttotalRemoved += result.removed.length;\n\t\t}\n\t\tconst nl: number = text.indexOf('\\n', pos);\n\t\tif (nl === -1 || nl >= to) break;\n\t\tpos = nl + 1;\n\t}\n\n\treturn {\n\t\tdeletes,\n\t\ttotalRemoved,\n\t\tlineCount,\n\t\tlineStart,\n\t};\n}\n\n// --- Other helpers ---\n\nfunction isMatchingPair(open: string, close: string): boolean {\n\tswitch (open) {\n\t\tcase '(':\n\t\t\treturn close === ')';\n\t\tcase '[':\n\t\t\treturn close === ']';\n\t\tcase '{':\n\t\t\treturn close === '}';\n\t\tcase '\"':\n\t\tcase \"'\":\n\t\tcase '`':\n\t\t\treturn close === open;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nfunction insertParagraphAfter(context: PluginContext, bid: BlockId): void {\n\tconst state: EditorState = context.getState();\n\tconst block: BlockNode | undefined = state.getBlock(bid);\n\tif (!block) return;\n\n\tconst blockLength: number = getBlockLength(block);\n\tconst newId: BlockId = generateBlockId();\n\n\tconst tr: Transaction = state\n\t\t.transaction('command')\n\t\t.splitBlock(bid, blockLength, newId)\n\t\t.setBlockType(newId, nodeType('paragraph'))\n\t\t.setSelection(createCollapsedSelection(newId, 0))\n\t\t.build();\n\n\tcontext.dispatch(tr);\n}\n\nfunction exitOnDoubleEnter(context: PluginContext, bid: BlockId, text: string): boolean {\n\tconst state: EditorState = context.getState();\n\tconst trimmedLen: number = text.length - 1;\n\tconst newId: BlockId = generateBlockId();\n\n\tconst tr: Transaction = state\n\t\t.transaction('input')\n\t\t.deleteTextAt(bid, trimmedLen, text.length)\n\t\t.splitBlock(bid, trimmedLen, newId)\n\t\t.setBlockType(newId, nodeType('paragraph'))\n\t\t.setSelection(createCollapsedSelection(newId, 0))\n\t\t.build();\n\n\tcontext.dispatch(tr);\n\treturn true;\n}\n","/**\n * Command registration and implementations for code blocks.\n * Handles toggle, insert, exit, and mark stripping.\n */\n\nimport {\n\tcreateSelectionForBlockBoundary,\n\tcreateSelectionForDocumentBoundary,\n\textractParentPath,\n\tfindSiblingIndex,\n\tgetSiblings,\n} from '../../commands/CommandHelpers.js';\nimport type { BlockNode, ChildNode } from '../../model/Document.js';\nimport {\n\tcreateEmptyParagraph,\n\tgenerateBlockId,\n\tgetBlockLength,\n\tgetInlineChildren,\n\tisBlockNode,\n\tisTextNode,\n} from '../../model/Document.js';\nimport { findNodePath } from '../../model/NodeResolver.js';\nimport type { EditorSelection } from '../../model/Selection.js';\nimport { createCollapsedSelection, 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 { Transaction, TransactionBuilder } from '../../state/Transaction.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { handleEscape } from './CodeBlockKeyboardHandlers.js';\nimport type { CodeBlockConfig } from './CodeBlockTypes.js';\n\n/** Registers all code-block commands. */\nexport function registerCodeBlockCommands(context: PluginContext, config: CodeBlockConfig): void {\n\tcontext.registerCommand('toggleCodeBlock', () => toggleCodeBlock(context, config));\n\n\tcontext.registerCommand('insertCodeBlock', () => insertCodeBlock(context, config));\n\n\tcontext.registerCommand('setCodeBlockLanguage', () => false);\n\n\tcontext.registerCommand('setCodeBlockBackground', () => false);\n\n\tcontext.registerCommand('exitCodeBlock', () => handleEscape(context));\n\n\tcontext.registerCommand('deleteCodeBlock', () => deleteCodeBlock(context));\n}\n\n// --- Command Implementations ---\n\nfunction toggleCodeBlock(context: PluginContext, config: CodeBlockConfig): boolean {\n\tconst state = context.getState();\n\tif (!isTextSelection(state.selection)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(state.selection.anchor.blockId);\n\tif (!block) return false;\n\n\tif (block.type === 'code_block') {\n\t\tconst tr: Transaction = state\n\t\t\t.transaction('command')\n\t\t\t.setBlockType(state.selection.anchor.blockId, nodeType('paragraph'))\n\t\t\t.setSelection(state.selection)\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\treturn insertCodeBlock(context, config);\n}\n\nfunction insertCodeBlock(context: PluginContext, config: CodeBlockConfig): boolean {\n\tconst state = context.getState();\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\tif (!block || block.type === 'code_block') return false;\n\n\tconst attrs: Record<string, string | number | boolean> = {\n\t\tlanguage: config.defaultLanguage ?? '',\n\t\tbackgroundColor: '',\n\t};\n\n\tconst builder: TransactionBuilder = state.transaction('command');\n\tstripAllMarks(builder, block);\n\tbuilder\n\t\t.setBlockType(sel.anchor.blockId, nodeType('code_block'), attrs)\n\t\t.setSelection(createCollapsedSelection(sel.anchor.blockId, 0));\n\n\tcontext.dispatch(builder.build());\n\treturn true;\n}\n\n/** Deletes the code block at the current cursor position. */\nfunction deleteCodeBlock(context: PluginContext): boolean {\n\tconst state = context.getState();\n\tif (!isTextSelection(state.selection)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(state.selection.anchor.blockId);\n\tif (!block || block.type !== 'code_block') return false;\n\n\tconst tr: Transaction | null = createDeleteCodeBlockTransaction(state, block.id);\n\tif (!tr) return false;\n\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\n/** Builds a transaction that removes a code block and repositions the cursor. */\nexport function createDeleteCodeBlockTransaction(\n\tstate: EditorState,\n\tblockId: BlockId,\n): Transaction | null {\n\tconst path: string[] | undefined = findNodePath(state.doc, blockId);\n\tif (!path) return null;\n\n\tconst parentPath: BlockId[] = extractParentPath(path);\n\tconst siblings = getSiblings(state, parentPath);\n\tconst index: number = findSiblingIndex(siblings, blockId);\n\tif (index < 0) return null;\n\n\tconst builder = state.transaction('command');\n\n\tif (siblings.length === 1) {\n\t\tconst newId: BlockId = 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\tconst selection: EditorSelection = resolvePostDeleteSelection(state, builder, siblings, index);\n\tbuilder.setSelection(selection);\n\treturn builder.build();\n}\n\n/**\n * Determines the cursor position after a code block has been removed.\n *\n * Fallback chain — the first successful step wins, guaranteeing the caller\n * always receives a valid selection:\n * 1. End of the previous block sibling.\n * 2. Start of the next block sibling.\n * 3. Start of any other selectable block in the document.\n * 4. A freshly inserted empty paragraph at the document root.\n */\nfunction resolvePostDeleteSelection(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tsiblings: readonly ChildNode[],\n\tremovedIndex: number,\n): EditorSelection {\n\tconst prevSibling = siblings[removedIndex - 1];\n\tif (prevSibling && isBlockNode(prevSibling)) {\n\t\tconst sel = createSelectionForBlockBoundary(state, prevSibling.id, 'end');\n\t\tif (sel) return sel;\n\t}\n\n\tconst nextSibling = siblings[removedIndex + 1];\n\tif (nextSibling && isBlockNode(nextSibling)) {\n\t\tconst sel = createSelectionForBlockBoundary(state, nextSibling.id, 'start');\n\t\tif (sel) return sel;\n\t}\n\n\tconst removed = siblings[removedIndex];\n\tconst excludeId: BlockId | undefined = removed && isBlockNode(removed) ? removed.id : undefined;\n\tconst docSel = createSelectionForDocumentBoundary(state, 'start', excludeId);\n\tif (docSel) return docSel;\n\n\tconst newId: BlockId = generateBlockId();\n\tbuilder.insertNode([], 0, createEmptyParagraph(newId));\n\treturn createCollapsedSelection(newId, 0);\n}\n\n/**\n * Strips all marks from a block's inline content.\n * Used when converting to code_block so no formatting carries over.\n */\nfunction stripAllMarks(builder: TransactionBuilder, block: BlockNode): void {\n\tconst blockLength: number = getBlockLength(block);\n\tif (blockLength === 0) return;\n\n\tconst inlineChildren = getInlineChildren(block);\n\tlet offset = 0;\n\n\tfor (const child of inlineChildren) {\n\t\tif (isTextNode(child)) {\n\t\t\tif (child.text.length > 0) {\n\t\t\t\tfor (const mark of child.marks) {\n\t\t\t\t\tbuilder.removeMark(block.id, offset, offset + child.text.length, mark);\n\t\t\t\t}\n\t\t\t}\n\t\t\toffset += child.text.length;\n\t\t} else {\n\t\t\toffset += 1;\n\t\t}\n\t}\n}\n","/** Locale interface and default English locale for the CodeBlockPlugin. */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface CodeBlockLocale {\n\treadonly label: string;\n\treadonly tooltip: (shortcut?: string) => string;\n\treadonly enteredCodeBlock: string;\n\treadonly leftCodeBlock: string;\n\treadonly copyCodeAria: string;\n\treadonly escToExit: string;\n\treadonly codeBlockAriaLabel: (lang: string) => string;\n\treadonly copiedToClipboard: string;\n\treadonly copyFailed: string;\n\treadonly deleteCodeBlockAria: string;\n\treadonly deletedCodeBlock: string;\n\treadonly selectLanguageAria: string;\n\treadonly languageChanged: (lang: string) => string;\n\treadonly plainText: string;\n\t/** Screen-reader announcement after multi-line Tab indent. */\n\treadonly indentedNLines: (n: number) => string;\n\t/** Screen-reader announcement after multi-line Shift-Tab dedent. */\n\treadonly dedentedNLines: (n: number) => string;\n}\n\n// --- Default English Locale ---\n\nexport const CODE_BLOCK_LOCALE_EN: CodeBlockLocale = {\n\tlabel: 'Code Block',\n\ttooltip: (shortcut?: string) => (shortcut ? `Code Block (${shortcut})` : 'Code Block'),\n\tenteredCodeBlock: 'Entered code block. Press Escape to exit.',\n\tleftCodeBlock: 'Left code block.',\n\tcopyCodeAria: 'Copy code',\n\tescToExit: 'Esc to exit',\n\tcodeBlockAriaLabel: (lang: string) => `${lang} code block. Press Escape to exit.`,\n\tcopiedToClipboard: 'Copied to clipboard',\n\tcopyFailed: 'Failed to copy code',\n\tdeleteCodeBlockAria: 'Delete code block',\n\tdeletedCodeBlock: 'Code block deleted',\n\tselectLanguageAria: 'Select language',\n\tlanguageChanged: (lang: string) => `Language changed to ${lang}`,\n\tplainText: 'plain',\n\tindentedNLines: (n: number) => (n === 1 ? '1 line indented' : `${n} lines indented`),\n\tdedentedNLines: (n: number) => (n === 1 ? '1 line dedented' : `${n} lines dedented`),\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<CodeBlockLocale> = import.meta.glob<{\n\tdefault: CodeBlockLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadCodeBlockLocale(lang: string): Promise<CodeBlockLocale> {\n\treturn loadLocaleModule(localeModules, lang, CODE_BLOCK_LOCALE_EN);\n}\n","/**\n * Language picker popup for code blocks.\n * Opens a listbox dropdown anchored to the language button,\n * allowing users to select a syntax highlighting language.\n */\n\nimport { attachListboxKeyboard } from '../shared/PopupKeyboardPatterns.js';\nimport type { PopupServiceAPI } from '../shared/PopupManager.js';\nimport type { CodeBlockLocale } from './CodeBlockLocale.js';\n\n/** Configuration for opening the language picker popup. */\nexport interface LanguagePickerConfig {\n\treadonly anchor: HTMLElement;\n\treadonly languages: readonly string[];\n\treadonly currentLanguage: string;\n\treadonly onSelect: (language: string) => void;\n\treadonly popupManager: PopupServiceAPI;\n\treadonly locale: CodeBlockLocale;\n}\n\nconst OPTION_SELECTOR = '[role=\"option\"]';\n\n/** Opens a language picker popup anchored to the given element. */\nexport function openLanguagePicker(config: LanguagePickerConfig): void {\n\tconst { anchor, languages, currentLanguage, onSelect, popupManager, locale } = config;\n\n\tpopupManager.open({\n\t\tanchor,\n\t\tariaRole: 'listbox',\n\t\tariaLabel: locale.selectLanguageAria,\n\t\tclassName: 'notectl-language-picker',\n\t\tposition: 'below-start',\n\t\trestoreFocusTo: anchor,\n\t\tcontent(container, close) {\n\t\t\tconst normalizedCurrent: string = currentLanguage.toLowerCase();\n\n\t\t\t// \"plain\" option is always first\n\t\t\tappendOption(container, locale.plainText, '', normalizedCurrent === '');\n\n\t\t\t// Language options sorted alphabetically\n\t\t\tconst sorted: readonly string[] = [...languages].sort((a, b) => a.localeCompare(b));\n\t\t\tfor (const lang of sorted) {\n\t\t\t\tappendOption(container, lang, lang, normalizedCurrent === lang.toLowerCase());\n\t\t\t}\n\n\t\t\tattachListboxKeyboard({\n\t\t\t\tcontainer,\n\t\t\t\titemSelector: OPTION_SELECTOR,\n\t\t\t\tonSelect(item) {\n\t\t\t\t\tconst value: string = item.getAttribute('data-language') ?? '';\n\t\t\t\t\tonSelect(value);\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t\tonClose() {\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tcontainer.addEventListener('click', (e: Event) => {\n\t\t\t\tconst target: HTMLElement | null = (e.target as HTMLElement).closest(OPTION_SELECTOR);\n\t\t\t\tif (!target) return;\n\t\t\t\tconst value: string = target.getAttribute('data-language') ?? '';\n\t\t\t\tonSelect(value);\n\t\t\t\tclose();\n\t\t\t});\n\t\t},\n\t\tonClose() {\n\t\t\tanchor.setAttribute('aria-expanded', 'false');\n\t\t},\n\t});\n\n\tanchor.setAttribute('aria-expanded', 'true');\n}\n\nfunction appendOption(\n\tcontainer: HTMLElement,\n\tlabel: string,\n\tvalue: string,\n\tselected: boolean,\n): void {\n\tconst option: HTMLDivElement = document.createElement('div');\n\toption.className = 'notectl-language-picker__option';\n\toption.setAttribute('role', 'option');\n\toption.setAttribute('data-language', value);\n\toption.setAttribute('aria-selected', String(selected));\n\toption.setAttribute('tabindex', selected ? '0' : '-1');\n\toption.textContent = label;\n\tcontainer.appendChild(option);\n}\n","/**\n * NodeView factory for code blocks.\n * Renders <pre> with a non-editable header (language label + action buttons)\n * and a <code> content area where the Reconciler renders text.\n */\n\nimport type { BlockAttrs, BlockNode } from '../../model/Document.js';\nimport { getBlockText } from '../../model/Document.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 type { NodeView, NodeViewFactory } from '../../view/NodeView.js';\nimport type { PopupServiceAPI } from '../shared/PopupManager.js';\nimport { createDeleteCodeBlockTransaction } from './CodeBlockCommands.js';\nimport { CODE_BLOCK_LOCALE_EN, type CodeBlockLocale } from './CodeBlockLocale.js';\nimport type { CodeBlockConfig } from './CodeBlockTypes.js';\nimport { openLanguagePicker } from './LanguagePicker.js';\n\n/** Dependencies for the language picker in the code block header. */\nexport interface LanguagePickerDeps {\n\treadonly popupManager: PopupServiceAPI;\n\treadonly getSupportedLanguages: () => readonly string[];\n}\n\nconst COPY_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"14\" height=\"14\"><path d=\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\"/></svg>';\n\nconst DELETE_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"14\" height=\"14\"><path d=\"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z\"/></svg>';\n\nconst CHEVRON_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"10\" height=\"10\"><path d=\"M4 6l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>';\n\n/**\n * Copies text to the clipboard, rejecting when the Clipboard API is unavailable\n * (e.g. insecure context, missing permissions) or when the write itself fails.\n * Callers must handle rejection to give the user accurate feedback.\n */\nexport function copyTextToClipboard(text: string): Promise<void> {\n\tconst clipboard: Clipboard | undefined = globalThis.navigator?.clipboard;\n\tif (!clipboard || typeof clipboard.writeText !== 'function') {\n\t\treturn Promise.reject(new Error('Clipboard API unavailable'));\n\t}\n\treturn clipboard.writeText(text);\n}\n\n/** Creates a NodeViewFactory for code_block nodes. */\nexport function createCodeBlockNodeViewFactory(\n\tconfig: CodeBlockConfig,\n\tlocale: CodeBlockLocale = CODE_BLOCK_LOCALE_EN,\n\tpickerDeps?: LanguagePickerDeps,\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 pre: HTMLElement = document.createElement('pre');\n\t\tpre.className = 'notectl-code-block';\n\t\tpre.setAttribute('data-block-id', node.id);\n\t\tpre.setAttribute('dir', 'ltr');\n\t\tpre.setAttribute('role', 'group');\n\t\tpre.setAttribute('aria-roledescription', 'code block');\n\t\tpre.setAttribute('part', 'code-block');\n\n\t\t// Header (non-editable)\n\t\tconst header: HTMLDivElement = document.createElement('div');\n\t\theader.className = 'notectl-code-block__header';\n\t\theader.setAttribute('contenteditable', 'false');\n\t\theader.setAttribute('part', 'code-block-header');\n\n\t\tconst langBtn: HTMLButtonElement = document.createElement('button');\n\t\tlangBtn.className = 'notectl-code-block__language-btn';\n\t\tlangBtn.type = 'button';\n\t\tlangBtn.setAttribute('aria-haspopup', 'listbox');\n\t\tlangBtn.setAttribute('aria-expanded', 'false');\n\t\tlangBtn.setAttribute('aria-label', locale.selectLanguageAria);\n\n\t\tconst showCopy: boolean = config.showCopyButton !== false;\n\t\tlet copyBtn: HTMLButtonElement | null = null;\n\n\t\tif (showCopy) {\n\t\t\tcopyBtn = document.createElement('button');\n\t\t\tcopyBtn.className = 'notectl-code-block__copy';\n\t\t\tcopyBtn.setAttribute('aria-label', locale.copyCodeAria);\n\t\t\tcopyBtn.setAttribute('data-notectl-no-print', '');\n\t\t\tcopyBtn.type = 'button';\n\t\t\tcopyBtn.innerHTML = COPY_ICON;\n\t\t}\n\n\t\t// Delete button\n\t\tconst deleteBtn: HTMLButtonElement = document.createElement('button');\n\t\tdeleteBtn.className = 'notectl-code-block__delete';\n\t\tdeleteBtn.setAttribute('aria-label', locale.deleteCodeBlockAria);\n\t\tdeleteBtn.title = locale.deleteCodeBlockAria;\n\t\tdeleteBtn.setAttribute('data-notectl-no-print', '');\n\t\tdeleteBtn.type = 'button';\n\t\tdeleteBtn.innerHTML = DELETE_ICON;\n\n\t\t// Screen reader live region for action feedback\n\t\tconst announcer: HTMLSpanElement = document.createElement('span');\n\t\tannouncer.className = 'notectl-sr-only';\n\t\tannouncer.setAttribute('aria-live', 'assertive');\n\t\tannouncer.setAttribute('aria-atomic', 'true');\n\n\t\t// Actions wrapper groups buttons on the right side\n\t\tconst actions: HTMLDivElement = document.createElement('div');\n\t\tactions.className = 'notectl-code-block__actions';\n\t\tif (copyBtn) {\n\t\t\tactions.appendChild(copyBtn);\n\t\t}\n\t\tactions.appendChild(deleteBtn);\n\n\t\theader.appendChild(langBtn);\n\t\theader.appendChild(actions);\n\t\theader.appendChild(announcer);\n\n\t\t// Content area (Reconciler target)\n\t\tconst code: HTMLElement = document.createElement('code');\n\t\tcode.className = 'notectl-code-block__content';\n\t\tcode.setAttribute('part', 'code-block-content');\n\n\t\t// Escape hint (visible only when focused, CSS-driven)\n\t\tconst escHint: HTMLDivElement = document.createElement('div');\n\t\tescHint.className = 'notectl-code-block__esc-hint';\n\t\tescHint.setAttribute('contenteditable', 'false');\n\t\tescHint.setAttribute('aria-hidden', 'true');\n\t\tescHint.setAttribute('data-notectl-no-print', '');\n\t\tescHint.textContent = locale.escToExit;\n\n\t\tpre.appendChild(header);\n\t\tpre.appendChild(code);\n\t\tpre.appendChild(escHint);\n\n\t\t// Apply config-level color overrides as CSS custom properties\n\t\tif (config.background) {\n\t\t\tsetStyleProperty(pre, '--notectl-code-block-bg', config.background);\n\t\t}\n\t\tif (config.headerBackground) {\n\t\t\tsetStyleProperty(pre, '--notectl-code-block-header-bg', config.headerBackground);\n\t\t}\n\t\tif (config.textColor) {\n\t\t\tsetStyleProperty(pre, '--notectl-code-block-color', config.textColor);\n\t\t}\n\t\tif (config.headerColor) {\n\t\t\tsetStyleProperty(pre, '--notectl-code-block-header-color', config.headerColor);\n\t\t}\n\n\t\tlet currentNodeId: BlockId = node.id;\n\n\t\t// --- Attribute Application ---\n\n\t\tfunction applyAttrs(n: BlockNode): void {\n\t\t\tconst lang: string = (n.attrs?.language as string) ?? '';\n\t\t\tconst langName: string = lang || locale.plainText;\n\t\t\tlangBtn.innerHTML = '';\n\t\t\tconst labelSpan: HTMLSpanElement = document.createElement('span');\n\t\t\tlabelSpan.className = 'notectl-code-block__language';\n\t\t\tlabelSpan.textContent = langName;\n\t\t\tlangBtn.appendChild(labelSpan);\n\t\t\tif (pickerDeps) {\n\t\t\t\tconst chevron: HTMLSpanElement = document.createElement('span');\n\t\t\t\tchevron.className = 'notectl-code-block__chevron';\n\t\t\t\tchevron.innerHTML = CHEVRON_ICON;\n\t\t\t\tlangBtn.appendChild(chevron);\n\t\t\t}\n\t\t\tpre.setAttribute('aria-label', locale.codeBlockAriaLabel(langName));\n\n\t\t\tif (lang) {\n\t\t\t\tcode.setAttribute('data-language', lang);\n\t\t\t} else {\n\t\t\t\tcode.removeAttribute('data-language');\n\t\t\t}\n\n\t\t\tconst bg: string = (n.attrs?.backgroundColor as string) ?? '';\n\t\t\tsetStyleProperty(pre, 'backgroundColor', bg || '');\n\t\t}\n\n\t\tapplyAttrs(node);\n\n\t\t// --- Copy Button Handler ---\n\n\t\tfunction announce(message: string): void {\n\t\t\tannouncer.textContent = message;\n\t\t\tsetTimeout(() => {\n\t\t\t\tannouncer.textContent = '';\n\t\t\t}, 1000);\n\t\t}\n\n\t\tif (copyBtn) {\n\t\t\tcopyBtn.addEventListener('click', (e: MouseEvent) => {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\n\t\t\t\tconst state: EditorState = getState();\n\t\t\t\tconst block: BlockNode | undefined = state.getBlock(currentNodeId);\n\t\t\t\tif (!block) return;\n\n\t\t\t\tconst text: string = getBlockText(block);\n\t\t\t\tcopyTextToClipboard(text).then(\n\t\t\t\t\t() => announce(locale.copiedToClipboard),\n\t\t\t\t\t() => announce(locale.copyFailed),\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\t// --- Delete Button Handler ---\n\n\t\tdeleteBtn.addEventListener('click', (e: MouseEvent) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\n\t\t\tconst state: EditorState = getState();\n\t\t\tconst tr: Transaction | null = createDeleteCodeBlockTransaction(state, currentNodeId);\n\t\t\tif (!tr) return;\n\n\t\t\tannouncer.textContent = locale.deletedCodeBlock;\n\t\t\tdispatch(tr);\n\t\t});\n\n\t\t// --- Language Picker Handler ---\n\n\t\tif (pickerDeps) {\n\t\t\tlangBtn.addEventListener('click', (e: MouseEvent) => {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\n\t\t\t\tconst state: EditorState = getState();\n\t\t\t\tconst block: BlockNode | undefined = state.getBlock(currentNodeId);\n\t\t\t\tif (!block) return;\n\n\t\t\t\tconst currentLang: string = (block.attrs?.language as string) ?? '';\n\t\t\t\topenLanguagePicker({\n\t\t\t\t\tanchor: langBtn,\n\t\t\t\t\tlanguages: pickerDeps.getSupportedLanguages(),\n\t\t\t\t\tcurrentLanguage: currentLang,\n\t\t\t\t\tlocale,\n\t\t\t\t\tpopupManager: pickerDeps.popupManager,\n\t\t\t\t\tonSelect(language: string) {\n\t\t\t\t\t\tif (language === currentLang) return;\n\n\t\t\t\t\t\tconst latest: EditorState = getState();\n\t\t\t\t\t\tconst latestBlock: BlockNode | undefined = latest.getBlock(currentNodeId);\n\t\t\t\t\t\tif (!latestBlock) return;\n\n\t\t\t\t\t\tconst path: BlockId[] | undefined = latest.getNodePath(currentNodeId);\n\t\t\t\t\t\tif (!path) return;\n\n\t\t\t\t\t\tconst newAttrs: BlockAttrs = { ...latestBlock.attrs, language };\n\t\t\t\t\t\tconst tr: Transaction = latest\n\t\t\t\t\t\t\t.transaction('command')\n\t\t\t\t\t\t\t.setNodeAttr(path, newAttrs)\n\t\t\t\t\t\t\t.build();\n\t\t\t\t\t\tdispatch(tr);\n\n\t\t\t\t\t\tconst langName: string = language || locale.plainText;\n\t\t\t\t\t\tannouncer.textContent = locale.languageChanged(langName);\n\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\tannouncer.textContent = '';\n\t\t\t\t\t\t}, 1000);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t// --- NodeView Interface ---\n\n\t\treturn {\n\t\t\tdom: pre,\n\t\t\tcontentDOM: code,\n\n\t\t\tupdate(updatedNode: BlockNode): boolean {\n\t\t\t\tif (updatedNode.type !== 'code_block') return false;\n\t\t\t\tcurrentNodeId = updatedNode.id;\n\t\t\t\tpre.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\tpre.classList.add('notectl-code-block--selected');\n\t\t\t},\n\n\t\t\tdeselectNode(): void {\n\t\t\t\tpre.classList.remove('notectl-code-block--selected');\n\t\t\t},\n\n\t\t\tdestroy(): void {\n\t\t\t\t// No cleanup needed\n\t\t\t},\n\t\t};\n\t};\n}\n","/**\n * Types, interfaces, and constants for the code-block plugin.\n */\n\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport { ServiceKey } from '../Plugin.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface NodeAttrRegistry {\n\t\tcode_block: {\n\t\t\tlanguage: string;\n\t\t\tbackgroundColor: string;\n\t\t};\n\t}\n}\n\n// --- Syntax Highlighting Types ---\n\nimport type { SyntaxTokenType } from '../../editor/theme/SyntaxTokenTypes.js';\n\nexport interface SyntaxToken {\n\treadonly from: number;\n\treadonly to: number;\n\treadonly type: SyntaxTokenType | (string & {});\n}\n\nexport interface SyntaxHighlighter {\n\ttokenize(code: string, language: string): readonly SyntaxToken[];\n\tgetSupportedLanguages(): readonly string[];\n\tregisterLanguage?(def: import('./highlighter/TokenizerTypes.js').LanguageDefinition): void;\n}\n\n// --- Configuration ---\n\n/**\n * Configurable keyboard bindings for CodeBlockPlugin actions.\n * Omit a slot to use the default; set to `null` to disable the binding.\n *\n * Key descriptor format: `'Mod-Enter'`, `'Mod-Shift-M'`, etc.\n * `Mod` resolves to Cmd on macOS, Ctrl on Windows/Linux.\n */\nexport interface CodeBlockKeymap {\n\t/**\n\t * Insert a new paragraph below the code block and move the cursor there.\n\t * @default 'Mod-Enter'\n\t */\n\treadonly insertAfter?: string | null;\n\n\t/**\n\t * Toggle the current block between code block and paragraph.\n\t * @default 'Mod-Shift-M'\n\t */\n\treadonly toggle?: string | null;\n}\n\nexport const DEFAULT_KEYMAP: Readonly<Record<keyof CodeBlockKeymap, string>> = {\n\tinsertAfter: 'Mod-Enter',\n\ttoggle: 'Mod-Shift-M',\n};\n\n/** Auto-indent configuration block. All fields optional. */\nexport interface CodeBlockIndentConfig {\n\t/** Indent mode: `none` disables Enter-driven indent, `keep` only inherits the\n\t * previous line's indent, `brackets` additionally adds an extra step after\n\t * `{`, `[`, `(` and dedents on close chars. Default `'brackets'`. */\n\treadonly mode?: 'none' | 'keep' | 'brackets';\n\t/** Use spaces instead of a literal tab character. Default `false`. */\n\treadonly useSpaces?: boolean;\n\t/** Spaces per indent unit (clamped to [1, 16]). Default `2`. */\n\treadonly spaceCount?: number;\n}\n\n/** Auto-pair configuration block. All fields optional. */\nexport interface CodeBlockPairingConfig {\n\t/** Auto-pair behavior for brackets. Default `'languageDefined'`. */\n\treadonly brackets?: 'always' | 'languageDefined' | 'beforeWhitespace' | 'never';\n\t/** Auto-pair behavior for quotes. Default `'languageDefined'`. */\n\treadonly quotes?: 'always' | 'languageDefined' | 'beforeWhitespace' | 'never';\n\t/** Skip-over for auto-inserted close chars. Default `true`. */\n\treadonly overtype?: boolean;\n\t/** Backspace removes leftover empty auto-pair. Default `true`. */\n\treadonly deletePair?: boolean;\n\t/** Wrap-selection scope. Default `'languageDefined'` (= brackets + quotes). */\n\treadonly surround?: 'languageDefined' | 'quotes' | 'brackets' | 'never';\n}\n\n/**\n * Fully-resolved indent config seen by the keyboard handlers.\n * Differs from `CodeBlockIndentConfig` only in that all fields are required\n * after the constructor merge + clamp.\n */\nexport interface ResolvedIndentConfig {\n\treadonly mode: 'none' | 'keep' | 'brackets';\n\treadonly useSpaces: boolean;\n\treadonly spaceCount: number;\n}\n\n/** Fully-resolved pairing config — all fields required. */\nexport interface ResolvedPairingConfig {\n\treadonly brackets: 'always' | 'languageDefined' | 'beforeWhitespace' | 'never';\n\treadonly quotes: 'always' | 'languageDefined' | 'beforeWhitespace' | 'never';\n\treadonly overtype: boolean;\n\treadonly deletePair: boolean;\n\treadonly surround: 'languageDefined' | 'quotes' | 'brackets' | 'never';\n}\n\nexport interface CodeBlockConfig {\n\treadonly highlighter?: SyntaxHighlighter;\n\treadonly defaultLanguage?: string;\n\t/**\n\t * @deprecated Use `indent.useSpaces` instead. Read as a fallback when\n\t * `indent.useSpaces` is unset.\n\t */\n\treadonly useSpaces?: boolean;\n\t/**\n\t * @deprecated Use `indent.spaceCount` instead. Read as a fallback when\n\t * `indent.spaceCount` is unset.\n\t */\n\treadonly spaceCount?: number;\n\treadonly showCopyButton?: boolean;\n\t/** Default body background color (overrides --notectl-code-block-bg). */\n\treadonly background?: string;\n\t/** Default header background color (overrides --notectl-code-block-header-bg). */\n\treadonly headerBackground?: string;\n\t/** Default text color (overrides --notectl-code-block-color). */\n\treadonly textColor?: string;\n\t/** Default header/label text color (overrides --notectl-code-block-header-color). */\n\treadonly headerColor?: string;\n\t/** Customize keyboard bindings for code block actions. */\n\treadonly keymap?: CodeBlockKeymap;\n\t/** Locale override for user-facing strings. */\n\treadonly locale?: import('./CodeBlockLocale.js').CodeBlockLocale;\n\t/** Auto-indent settings. */\n\treadonly indent?: CodeBlockIndentConfig;\n\t/** Bracket-pairing settings. */\n\treadonly pairing?: CodeBlockPairingConfig;\n}\n\nexport const DEFAULT_CONFIG: CodeBlockConfig = {\n\tdefaultLanguage: '',\n\tuseSpaces: false,\n\tspaceCount: 2,\n\tshowCopyButton: true,\n};\n\n/** Default values applied during config merge (see CodeBlockPlugin.constructor). */\nexport const DEFAULT_INDENT: ResolvedIndentConfig = {\n\tmode: 'brackets',\n\tuseSpaces: false,\n\tspaceCount: 2,\n};\n\nexport const DEFAULT_PAIRING: ResolvedPairingConfig = {\n\tbrackets: 'languageDefined',\n\tquotes: 'languageDefined',\n\tovertype: true,\n\tdeletePair: true,\n\tsurround: 'languageDefined',\n};\n\nexport const MIN_SPACE_COUNT = 1;\nexport const MAX_SPACE_COUNT = 16;\n\n// --- Service Types ---\n\nexport interface CodeBlockService {\n\tsetLanguage(blockId: BlockId, language: string): void;\n\tgetLanguage(blockId: BlockId): string;\n\tsetBackground(blockId: BlockId, color: string): void;\n\tgetBackground(blockId: BlockId): string;\n\tisCodeBlock(blockId: BlockId): boolean;\n\tgetSupportedLanguages(): readonly string[];\n}\n\nexport const CODE_BLOCK_SERVICE_KEY = new ServiceKey<CodeBlockService>('codeBlock');\n\n// --- Syntax Highlighter Service ---\n\nexport interface SyntaxHighlighterService {\n\tregisterLanguage(def: import('./highlighter/TokenizerTypes.js').LanguageDefinition): void;\n\tgetSupportedLanguages(): readonly string[];\n\ttokenize(code: string, language: string): readonly SyntaxToken[];\n\t/**\n\t * Returns the cached token whose range covers `offset` in `blockId`, or\n\t * `undefined` if no token is registered at that position (e.g. cache miss,\n\t * whitespace between tokens, or block not yet tokenized). Uses binary\n\t * search over the per-block token cache; never triggers a fresh tokenize.\n\t */\n\tgetTokenAt(blockId: BlockId, offset: number): SyntaxToken | undefined;\n}\n\nexport const SYNTAX_HIGHLIGHTER_SERVICE_KEY = new ServiceKey<SyntaxHighlighterService>(\n\t'syntaxHighlighter',\n);\n\n// --- SVG Icon ---\n\nexport const CODE_BLOCK_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14z\"/><path d=\"M11 14.17L8.83 12 11 9.83 9.59 8.41 6 12l3.59 3.59L11 14.17zm3.41 1.42L18 12l-3.59-3.59L13 9.83 15.17 12 13 14.17l1.41 1.42z\"/></svg>';\n","/**\n * Service API for code blocks.\n * Provides language/background getters and setters.\n */\n\nimport type { BlockAttrs, BlockNode } from '../../model/Document.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { Transaction } from '../../state/Transaction.js';\nimport type { PluginContext } from '../Plugin.js';\nimport type { SyntaxHighlighter } from './CodeBlockTypes.js';\nimport { CODE_BLOCK_SERVICE_KEY } from './CodeBlockTypes.js';\n\n/** Registers the CodeBlockService on the given context. */\nexport function registerCodeBlockService(\n\tcontext: PluginContext,\n\tgetHighlighter: () => SyntaxHighlighter | null,\n\tgetContext: () => PluginContext | null,\n): void {\n\tcontext.registerService(CODE_BLOCK_SERVICE_KEY, {\n\t\tsetLanguage(bid: BlockId, language: string): void {\n\t\t\tsetAttr(context, bid, 'language', language);\n\t\t},\n\n\t\tgetLanguage(bid: BlockId): string {\n\t\t\tconst ctx: PluginContext | null = getContext();\n\t\t\tif (!ctx) return '';\n\t\t\tconst block: BlockNode | undefined = ctx.getState().getBlock(bid);\n\t\t\tif (!block || block.type !== 'code_block') return '';\n\t\t\treturn (block.attrs?.language as string) ?? '';\n\t\t},\n\n\t\tsetBackground(bid: BlockId, color: string): void {\n\t\t\tsetAttr(context, bid, 'backgroundColor', color);\n\t\t},\n\n\t\tgetBackground(bid: BlockId): string {\n\t\t\tconst ctx: PluginContext | null = getContext();\n\t\t\tif (!ctx) return '';\n\t\t\tconst block: BlockNode | undefined = ctx.getState().getBlock(bid);\n\t\t\tif (!block || block.type !== 'code_block') return '';\n\t\t\treturn (block.attrs?.backgroundColor as string) ?? '';\n\t\t},\n\n\t\tisCodeBlock(bid: BlockId): boolean {\n\t\t\tconst ctx: PluginContext | null = getContext();\n\t\t\tif (!ctx) return false;\n\t\t\tconst block: BlockNode | undefined = ctx.getState().getBlock(bid);\n\t\t\treturn block?.type === 'code_block';\n\t\t},\n\n\t\tgetSupportedLanguages(): readonly string[] {\n\t\t\tconst highlighter: SyntaxHighlighter | null = getHighlighter();\n\t\t\tif (!highlighter) return [];\n\t\t\treturn highlighter.getSupportedLanguages();\n\t\t},\n\t});\n}\n\n// --- Helper ---\n\nfunction setAttr(context: PluginContext, bid: BlockId, key: string, value: string): void {\n\tconst state = context.getState();\n\tconst block: BlockNode | undefined = state.getBlock(bid);\n\tif (!block || block.type !== 'code_block') return;\n\n\tconst path: BlockId[] | undefined = state.getNodePath(bid);\n\tif (!path) return;\n\n\tconst newAttrs: BlockAttrs = { ...block.attrs, [key]: value };\n\tconst tr: Transaction = state.transaction('command').setNodeAttr(path, newAttrs).build();\n\n\tcontext.dispatch(tr);\n}\n","/**\n * Auto-pair tracking stack: records the position of each auto-inserted\n * close character so that overtype (Bracket-Skip) and pair-delete only\n * fire on chars *we* produced — never on chars the user typed themselves.\n *\n * Positions are migrated through `Transaction.mapping` after every state\n * change. The single non-trivial choice is the association bias for\n * `mapResult`: we use `+1` (\"sticky right\") so an insert *at* the close\n * char's position lands left of the close char, matching the user\n * intuition \"I'm typing before this auto-paired `)`\".\n */\n\nimport type { Position } from '../../model/Selection.js';\nimport { createPosition } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { Mapping } from '../../state/Mapping.js';\n\nexport interface PairEntry {\n\treadonly pos: Position;\n\treadonly char: string;\n}\n\n/** Per-block stack of auto-pair entries. */\nexport class PairStack {\n\tprivate readonly buckets = new Map<BlockId, PairEntry[]>();\n\n\t/** Records a new auto-inserted close char at `pos`. */\n\tpush(pos: Position, char: string): void {\n\t\tconst bucket: PairEntry[] = this.buckets.get(pos.blockId) ?? [];\n\t\tbucket.push({ pos, char });\n\t\tthis.buckets.set(pos.blockId, bucket);\n\t}\n\n\t/**\n\t * Finds (and removes) an entry whose position matches `blockId`/`offset`\n\t * exactly. Returns the entry or `undefined` if no match.\n\t */\n\ttake(blockId: BlockId, offset: number): PairEntry | undefined {\n\t\tconst bucket: PairEntry[] | undefined = this.buckets.get(blockId);\n\t\tif (!bucket) return undefined;\n\t\tfor (let i = bucket.length - 1; i >= 0; i--) {\n\t\t\tconst entry: PairEntry | undefined = bucket[i];\n\t\t\tif (entry && entry.pos.offset === offset) {\n\t\t\t\tbucket.splice(i, 1);\n\t\t\t\tif (bucket.length === 0) this.buckets.delete(blockId);\n\t\t\t\treturn entry;\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/** Returns (without removing) an entry whose position matches. */\n\tpeek(blockId: BlockId, offset: number): PairEntry | undefined {\n\t\tconst bucket: PairEntry[] | undefined = this.buckets.get(blockId);\n\t\tif (!bucket) return undefined;\n\t\tfor (let i = bucket.length - 1; i >= 0; i--) {\n\t\t\tconst entry: PairEntry | undefined = bucket[i];\n\t\t\tif (entry && entry.pos.offset === offset) return entry;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/** Clears all entries for the given block (used on code_block → paragraph). */\n\tclearBlock(blockId: BlockId): void {\n\t\tthis.buckets.delete(blockId);\n\t}\n\n\t/** Drops every recorded entry — used on plugin destroy/HMR. */\n\tclear(): void {\n\t\tthis.buckets.clear();\n\t}\n\n\t/** Number of recorded entries for a block; primarily for diagnostics/tests. */\n\tsizeForBlock(blockId: BlockId): number {\n\t\treturn this.buckets.get(blockId)?.length ?? 0;\n\t}\n\n\t/** Aggregate size across all blocks. */\n\tget size(): number {\n\t\tlet total = 0;\n\t\tfor (const bucket of this.buckets.values()) total += bucket.length;\n\t\treturn total;\n\t}\n\n\t/**\n\t * Migrates every recorded position through `mapping`. Entries that fall\n\t * inside removed content (or whose host block has vanished) are dropped.\n\t * Entries that change block (e.g. via split) get re-bucketed.\n\t */\n\tmigrate(mapping: Mapping): void {\n\t\tif (mapping.isEmpty) return;\n\t\tconst next = new Map<BlockId, PairEntry[]>();\n\t\tfor (const bucket of this.buckets.values()) {\n\t\t\tfor (const entry of bucket) {\n\t\t\t\tconst result = mapping.mapResult(entry.pos, +1);\n\t\t\t\tif (result.deleted) continue;\n\t\t\t\tconst migrated: PairEntry = { pos: result.pos, char: entry.char };\n\t\t\t\tconst bid: BlockId = result.pos.blockId;\n\t\t\t\tconst target: PairEntry[] = next.get(bid) ?? [];\n\t\t\t\ttarget.push(migrated);\n\t\t\t\tnext.set(bid, target);\n\t\t\t}\n\t\t}\n\t\tthis.buckets.clear();\n\t\tfor (const [bid, entries] of next) this.buckets.set(bid, entries);\n\t}\n\n\t/** Builds a position with the same shape as auto-pair entries. */\n\tstatic makePos(blockId: BlockId, offset: number): Position {\n\t\treturn createPosition(blockId, offset);\n\t}\n}\n","/**\n * Regex-based syntax tokenizer.\n * Implements the SyntaxHighlighter interface using linear regex scanning\n * with sticky (`y`-flagged) regexes to avoid O(n) substring allocations per position.\n */\n\nimport type { SyntaxHighlighter, SyntaxToken } from '../CodeBlockTypes.js';\nimport { iterateTokens } from './TokenIteration.js';\nimport type { LanguageDefinition } from './TokenizerTypes.js';\n\nexport class RegexTokenizer implements SyntaxHighlighter {\n\tprivate readonly languageMap = new Map<string, LanguageDefinition>();\n\n\tconstructor(languages?: readonly LanguageDefinition[]) {\n\t\tif (languages) {\n\t\t\tfor (const lang of languages) {\n\t\t\t\tthis.registerLanguageInternal(lang);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Registers a language definition. Overwrites existing definitions for the same name/aliases. */\n\tregisterLanguage(def: LanguageDefinition): void {\n\t\tthis.registerLanguageInternal(def);\n\t}\n\n\t/** Tokenizes code using the specified language. Returns empty array for unknown languages. */\n\ttokenize(code: string, language: string): readonly SyntaxToken[] {\n\t\tconst lang: LanguageDefinition | undefined = this.languageMap.get(language.toLowerCase());\n\t\tif (!lang) return [];\n\n\t\tconst tokens: SyntaxToken[] = [];\n\t\tfor (const token of iterateTokens(code, lang)) {\n\t\t\ttokens.push({ from: token.from, to: token.to, type: token.type });\n\t\t}\n\t\treturn tokens;\n\t}\n\n\t/** Returns all registered language names and aliases. */\n\tgetSupportedLanguages(): readonly string[] {\n\t\tconst names = new Set<string>();\n\t\tfor (const lang of this.languageMap.values()) {\n\t\t\tnames.add(lang.name);\n\t\t\tfor (const alias of lang.aliases) {\n\t\t\t\tnames.add(alias);\n\t\t\t}\n\t\t}\n\t\treturn [...names];\n\t}\n\n\tprivate registerLanguageInternal(def: LanguageDefinition): void {\n\t\tthis.languageMap.set(def.name.toLowerCase(), def);\n\t\tfor (const alias of def.aliases) {\n\t\t\tthis.languageMap.set(alias.toLowerCase(), def);\n\t\t}\n\t}\n}\n","/**\n * CodeBlockPlugin: orchestrates code block registration by delegating to\n * focused modules for keyboard handling, commands, and service API.\n *\n * Inline responsibilities: NodeSpec, NodeView, InputRule, Toolbar,\n * Middleware, Decorations, and lifecycle hooks (focus tracking).\n */\n\nimport { addDeleteSelectionSteps } from '../../commands/Commands.js';\nimport type { Decoration, DecorationSet } from '../../decorations/Decoration.js';\nimport {\n\tinline as inlineDecoration,\n\tnode as nodeDecoration,\n} from '../../decorations/Decoration.js';\nimport { DecorationSet as DecorationSetClass } from '../../decorations/Decoration.js';\nimport { CODE_BLOCK_CSS } from '../../editor/styles/code-block.js';\nimport type { BlockNode } from '../../model/Document.js';\nimport { getBlockText } from '../../model/Document.js';\nimport { escapeHTML } from '../../model/HTMLUtils.js';\nimport type { HTMLExportContext } from '../../model/NodeSpec.js';\nimport {\n\tcreateCollapsedSelection,\n\tcreatePosition,\n\tisCollapsed,\n\tisTextSelection,\n\tselectionRange,\n} 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 { Transaction } from '../../state/Transaction.js';\nimport { createBlockElement } from '../../view/DomUtils.js';\nimport type { PasteInterceptor, Plugin, PluginContext, TextInputInterceptor } from '../Plugin.js';\nimport { LanguageRegistry } from '../language/LanguageRegistry.js';\nimport { LANGUAGE_REGISTRY_SERVICE_KEY } from '../language/LanguageTypes.js';\nimport {\n\tJAVA_SUPPORT,\n\tJSON_SUPPORT,\n\tTYPESCRIPT_SUPPORT,\n\tXML_SUPPORT,\n} from '../language/bundles/index.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { PopupManager } from '../shared/PopupManager.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport {\n\ttype PairAction,\n\ttype TokenLookup,\n\tresolvePairAction,\n\twrapSelectionPlan,\n} from './BracketPairing.js';\nimport { registerCodeBlockCommands } from './CodeBlockCommands.js';\nimport { registerCodeBlockKeymaps } from './CodeBlockKeyboardHandlers.js';\nimport {\n\tCODE_BLOCK_LOCALE_EN,\n\ttype CodeBlockLocale,\n\tloadCodeBlockLocale,\n} from './CodeBlockLocale.js';\nimport { type LanguagePickerDeps, createCodeBlockNodeViewFactory } from './CodeBlockNodeView.js';\nimport { registerCodeBlockService } from './CodeBlockService.js';\nimport type {\n\tCodeBlockConfig,\n\tCodeBlockKeymap,\n\tResolvedIndentConfig,\n\tResolvedPairingConfig,\n\tSyntaxHighlighter,\n\tSyntaxToken,\n} from './CodeBlockTypes.js';\nimport {\n\tCODE_BLOCK_ICON,\n\tDEFAULT_CONFIG,\n\tDEFAULT_INDENT,\n\tDEFAULT_KEYMAP,\n\tDEFAULT_PAIRING,\n\tMAX_SPACE_COUNT,\n\tMIN_SPACE_COUNT,\n\tSYNTAX_HIGHLIGHTER_SERVICE_KEY,\n} from './CodeBlockTypes.js';\nimport { dedentOnce, getLineRange, isWhitespaceOnlyBeforeOffset } from './IndentHelpers.js';\nimport { PairStack } from './PairStack.js';\nimport { RegexTokenizer } from './highlighter/RegexTokenizer.js';\n\nexport class CodeBlockPlugin implements Plugin {\n\treadonly id = 'code-block';\n\treadonly name = 'Code Block';\n\treadonly priority = 36;\n\n\tprivate readonly config: CodeBlockConfig;\n\tprivate readonly resolvedIndent: ResolvedIndentConfig;\n\tprivate readonly resolvedPairing: ResolvedPairingConfig;\n\tprivate readonly resolvedKeymap: Readonly<Record<keyof CodeBlockKeymap, string | null>>;\n\tprivate context: PluginContext | null = null;\n\tprivate locale!: CodeBlockLocale;\n\tprivate highlighter: SyntaxHighlighter | null = null;\n\tprivate readonly languageRegistry = new LanguageRegistry();\n\tprivate readonly tokenCache = new Map<\n\t\tBlockId,\n\t\t{\n\t\t\treadonly text: string;\n\t\t\treadonly language: string;\n\t\t\treadonly tokens: readonly SyntaxToken[];\n\t\t}\n\t>();\n\tprivate readonly pairStack = new PairStack();\n\tprivate readonly pendingPairOps: Array<\n\t\t| {\n\t\t\t\treadonly kind: 'push';\n\t\t\t\treadonly blockId: BlockId;\n\t\t\t\treadonly offset: number;\n\t\t\t\treadonly char: string;\n\t\t }\n\t\t| { readonly kind: 'take'; readonly blockId: BlockId; readonly offset: number }\n\t> = [];\n\n\tconstructor(config?: Partial<CodeBlockConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t\tthis.resolvedIndent = resolveIndentConfig(this.config);\n\t\tthis.resolvedPairing = resolvePairingConfig(this.config);\n\t\tthis.resolvedKeymap = {\n\t\t\t...DEFAULT_KEYMAP,\n\t\t\t...config?.keymap,\n\t\t};\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\tCODE_BLOCK_LOCALE_EN,\n\t\t\tloadCodeBlockLocale,\n\t\t);\n\t\tcontext.registerStyleSheet(CODE_BLOCK_CSS);\n\t\tthis.context = context;\n\n\t\tthis.initHighlighter();\n\t\tthis.registerLanguageRegistry(context);\n\t\tthis.registerNodeSpec(context);\n\t\tthis.registerNodeView(context);\n\t\tregisterCodeBlockCommands(context, this.config);\n\t\tregisterCodeBlockKeymaps(context, this.config, this.resolvedKeymap, {\n\t\t\tindent: this.resolvedIndent,\n\t\t\tpairing: this.resolvedPairing,\n\t\t\tpairStack: this.pairStack,\n\t\t\tlocale: () => this.locale,\n\t\t});\n\t\tthis.registerInputRule(context);\n\t\tthis.registerToolbarItem(context);\n\t\tthis.registerMiddleware(context);\n\t\tregisterCodeBlockService(\n\t\t\tcontext,\n\t\t\t() => this.highlighter,\n\t\t\t() => this.context,\n\t\t);\n\t\tthis.registerSyntaxHighlighterService(context);\n\t\tthis.registerPasteInterceptor(context);\n\t\tthis.registerTextInputInterceptor(context);\n\t\tthis.patchTableCellContent(context);\n\t}\n\n\tdestroy(): void {\n\t\tthis.context = null;\n\t\tthis.highlighter = null;\n\t\tthis.tokenCache.clear();\n\t\tthis.pairStack.clear();\n\t}\n\n\tonStateChange(oldState: EditorState, newState: EditorState, tr: Transaction): void {\n\t\tthis.migratePairStack(newState, tr);\n\n\t\tif (!this.context) return;\n\n\t\tconst oldBlockId: BlockId | null = !isTextSelection(oldState.selection)\n\t\t\t? null\n\t\t\t: oldState.selection.anchor.blockId;\n\t\tconst newBlockId: BlockId | null = !isTextSelection(newState.selection)\n\t\t\t? null\n\t\t\t: newState.selection.anchor.blockId;\n\n\t\tconst oldBlock: BlockNode | undefined = oldBlockId ? oldState.getBlock(oldBlockId) : undefined;\n\t\tconst newBlock: BlockNode | undefined = newBlockId ? newState.getBlock(newBlockId) : undefined;\n\n\t\tconst wasInCode: boolean = oldBlock?.type === 'code_block';\n\t\tconst nowInCode: boolean = newBlock?.type === 'code_block';\n\n\t\tif (!wasInCode && nowInCode) {\n\t\t\tthis.context.announce(this.locale.enteredCodeBlock);\n\t\t} else if (wasInCode && !nowInCode) {\n\t\t\tthis.context.announce(this.locale.leftCodeBlock);\n\t\t}\n\t}\n\n\tprivate migratePairStack(state: EditorState, tr: Transaction): void {\n\t\tif (this.pairStack.size > 0 && !tr.mapping.isEmpty) {\n\t\t\tthis.pairStack.migrate(tr.mapping);\n\t\t}\n\n\t\t// Apply any pending push/take operations recorded by the interceptor.\n\t\t// Positions in `pendingPairOps` are already expressed in *post-transaction*\n\t\t// space, so they must be applied AFTER the migration above (otherwise the\n\t\t// migration would shift them again).\n\t\tfor (const op of this.pendingPairOps) {\n\t\t\tif (op.kind === 'push') {\n\t\t\t\tthis.pairStack.push(createPosition(op.blockId, op.offset), op.char);\n\t\t\t} else {\n\t\t\t\tthis.pairStack.take(op.blockId, op.offset);\n\t\t\t}\n\t\t}\n\t\tthis.pendingPairOps.length = 0;\n\n\t\t// Clear entries whose host block is no longer a code block.\n\t\tfor (const step of tr.steps) {\n\t\t\tif (step.type !== 'setBlockType') continue;\n\t\t\tconst block: BlockNode | undefined = state.getBlock(step.blockId);\n\t\t\tif (!block || block.type !== 'code_block') {\n\t\t\t\tthis.pairStack.clearBlock(step.blockId);\n\t\t\t}\n\t\t}\n\t}\n\n\tdecorations(state: EditorState): DecorationSet {\n\t\tconst decorations: Decoration[] = [];\n\n\t\tconst focusedBlockId: BlockId | null = this.getFocusedCodeBlockId(state);\n\t\tif (focusedBlockId) {\n\t\t\tdecorations.push(nodeDecoration(focusedBlockId, { class: 'notectl-code-block--focused' }));\n\t\t}\n\n\t\tif (this.highlighter) {\n\t\t\tconst activeBlockIds = new Set<BlockId>();\n\t\t\tfor (const bid of state.getBlockOrder()) {\n\t\t\t\tconst block: BlockNode | undefined = state.getBlock(bid);\n\t\t\t\tif (!block || block.type !== 'code_block') continue;\n\n\t\t\t\tconst lang: string = (block.attrs?.language as string) ?? '';\n\t\t\t\tif (!lang) continue;\n\n\t\t\t\tconst text: string = getBlockText(block);\n\t\t\t\tif (!text) continue;\n\n\t\t\t\tactiveBlockIds.add(bid);\n\t\t\t\tconst tokens: readonly SyntaxToken[] = this.getCachedTokens(bid, text, lang);\n\t\t\t\tfor (const token of tokens) {\n\t\t\t\t\tdecorations.push(\n\t\t\t\t\t\tinlineDecoration(bid, token.from, token.to, {\n\t\t\t\t\t\t\tclass: `notectl-token--${token.type}`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Purge stale cache entries\n\t\t\tfor (const cachedId of this.tokenCache.keys()) {\n\t\t\t\tif (!activeBlockIds.has(cachedId)) {\n\t\t\t\t\tthis.tokenCache.delete(cachedId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (decorations.length === 0) return DecorationSetClass.empty;\n\t\treturn DecorationSetClass.create(decorations);\n\t}\n\n\t// --- NodeSpec ---\n\n\tprivate registerNodeSpec(context: PluginContext): void {\n\t\tcontext.registerNodeSpec({\n\t\t\ttype: 'code_block',\n\t\t\tgroup: 'block',\n\t\t\tcontent: { allow: ['text'] },\n\t\t\tselectable: true,\n\t\t\tattrs: {\n\t\t\t\tlanguage: { default: '' },\n\t\t\t\tbackgroundColor: { default: '' },\n\t\t\t},\n\t\t\ttoDOM(node) {\n\t\t\t\tconst pre: HTMLElement = createBlockElement('pre', node.id);\n\t\t\t\tpre.className = 'notectl-code-block';\n\t\t\t\tpre.setAttribute('dir', 'ltr');\n\t\t\t\tpre.setAttribute('part', 'code-block');\n\t\t\t\tconst code: HTMLElement = document.createElement('code');\n\t\t\t\tcode.className = 'notectl-code-block__content';\n\t\t\t\tcode.setAttribute('part', 'code-block-content');\n\t\t\t\tpre.appendChild(code);\n\t\t\t\treturn pre;\n\t\t\t},\n\t\t\ttoHTML(node, content, ctx?: HTMLExportContext) {\n\t\t\t\tconst lang: string = escapeHTML((node.attrs?.language as string) ?? '');\n\t\t\t\tconst bg: string = escapeHTML((node.attrs?.backgroundColor as string) ?? '');\n\t\t\t\tconst langClass: string = lang ? ` class=\"language-${lang}\"` : '';\n\t\t\t\tconst bgAttr: string = bg\n\t\t\t\t\t? (ctx?.styleAttr(`background-color: ${bg}`) ?? ` style=\"background-color: ${bg}\"`)\n\t\t\t\t\t: '';\n\t\t\t\treturn `<pre dir=\"ltr\"${bgAttr}><code${langClass}>${content || ''}</code></pre>`;\n\t\t\t},\n\t\t\tparseHTML: [\n\t\t\t\t{\n\t\t\t\t\ttag: 'pre',\n\t\t\t\t\tgetAttrs(el: HTMLElement) {\n\t\t\t\t\t\tconst code: HTMLElement | null = el.querySelector('code');\n\t\t\t\t\t\tconst langClass: string = code?.className.match(/language-(\\S+)/)?.[1] ?? '';\n\t\t\t\t\t\tconst dataLang: string = code?.getAttribute('data-language') ?? '';\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tlanguage: dataLang || langClass,\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tsanitize: {\n\t\t\t\ttags: ['pre', 'code'],\n\t\t\t\tattrs: ['data-language', 'class', 'style'],\n\t\t\t},\n\t\t});\n\t}\n\n\t// --- NodeView ---\n\n\tprivate registerNodeView(context: PluginContext): void {\n\t\tconst popupManager: PopupManager = new PopupManager(context.getContainer());\n\t\tconst highlighter = this.highlighter;\n\t\tconst pickerDeps: LanguagePickerDeps = {\n\t\t\tpopupManager,\n\t\t\tgetSupportedLanguages: () => highlighter?.getSupportedLanguages() ?? [],\n\t\t};\n\n\t\tcontext.registerNodeView(\n\t\t\t'code_block',\n\t\t\tcreateCodeBlockNodeViewFactory(this.config, this.locale, pickerDeps),\n\t\t);\n\t}\n\n\t// --- Input Rule ---\n\n\tprivate registerInputRule(context: PluginContext): void {\n\t\tcontext.registerInputRule({\n\t\t\tpattern: /^```(\\w*) $/,\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 !== 'paragraph') return null;\n\n\t\t\t\tconst language: string = match[1] ?? '';\n\t\t\t\tconst attrs: Record<string, string | number | boolean> = {\n\t\t\t\t\tlanguage,\n\t\t\t\t\tbackgroundColor: '',\n\t\t\t\t};\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 + match[0].length)\n\t\t\t\t\t.setBlockType(sel.anchor.blockId, nodeType('code_block'), 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\t// --- Toolbar ---\n\n\tprivate registerToolbarItem(context: PluginContext): void {\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'code_block',\n\t\t\tgroup: 'block',\n\t\t\ticon: CODE_BLOCK_ICON,\n\t\t\tlabel: this.locale.label,\n\t\t\ttooltip: this.locale.tooltip(\n\t\t\t\tthis.resolvedKeymap.toggle ? formatShortcut(this.resolvedKeymap.toggle) : undefined,\n\t\t\t),\n\t\t\tcommand: 'toggleCodeBlock',\n\t\t\tisActive: (state) => {\n\t\t\t\tif (!isTextSelection(state.selection)) return false;\n\t\t\t\tconst block: BlockNode | undefined = state.getBlock(state.selection.anchor.blockId);\n\t\t\t\treturn block?.type === 'code_block';\n\t\t\t},\n\t\t});\n\t}\n\n\t// --- Middleware (Mark Prevention) ---\n\n\tprivate registerMiddleware(context: PluginContext): void {\n\t\tcontext.registerMiddleware(\n\t\t\t(tr, state, next) => {\n\t\t\t\tconst hasMarkInCodeBlock: boolean = tr.steps.some((step) => {\n\t\t\t\t\tif (step.type !== 'addMark') return false;\n\t\t\t\t\tconst block: BlockNode | undefined = state.getBlock(step.blockId);\n\t\t\t\t\treturn block?.type === 'code_block';\n\t\t\t\t});\n\n\t\t\t\tif (!hasMarkInCodeBlock) {\n\t\t\t\t\tnext(tr);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst filtered = tr.steps.filter((step) => {\n\t\t\t\t\tif (step.type !== 'addMark') return true;\n\t\t\t\t\tconst block: BlockNode | undefined = state.getBlock(step.blockId);\n\t\t\t\t\treturn block?.type !== 'code_block';\n\t\t\t\t});\n\n\t\t\t\tnext({ ...tr, steps: filtered });\n\t\t\t},\n\t\t\t{ name: 'code-block:mark-guard', priority: 50 },\n\t\t);\n\t}\n\n\t// --- Paste Interceptor ---\n\n\tprivate registerPasteInterceptor(context: PluginContext): void {\n\t\tcontext.registerPasteInterceptor(this.handleCodeBlockPaste, {\n\t\t\tname: 'code-block:paste',\n\t\t\tpriority: 10,\n\t\t});\n\t}\n\n\tprivate registerTextInputInterceptor(context: PluginContext): void {\n\t\tcontext.registerTextInputInterceptor(this.handleCodeBlockTextInput, {\n\t\t\tname: 'code-block:auto-pair',\n\t\t\tpriority: 10,\n\t\t});\n\t}\n\n\tprivate readonly handleCodeBlockTextInput: TextInputInterceptor = (\n\t\ttext: string,\n\t\tstate: EditorState,\n\t): Transaction | null => {\n\t\t// Drop any pending pair ops left over from a previously suppressed\n\t\t// transaction. `onStateChange` only fires when a tr reaches `state.apply`;\n\t\t// if middleware blocked the last tr, its queued ops would otherwise leak\n\t\t// into the next successful cycle with stale offsets.\n\t\tthis.pendingPairOps.length = 0;\n\n\t\tif (!this.context) return null;\n\t\tif (this.context.getCompositionState().isComposing) return null;\n\t\tif (!isTextSelection(state.selection)) return null;\n\t\t// Only single-char inputs trigger pair logic.\n\t\tif (text.length !== 1) return null;\n\n\t\tconst sel = state.selection;\n\t\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\t\tif (!block || block.type !== 'code_block') return null;\n\n\t\t// Dedent-on-close-bracket: typing `}`, `]`, `)` on a whitespace-only line\n\t\t// reduces leading indent by one step before inserting the char.\n\t\tconst dedentTr: Transaction | null = this.tryDedentOnCloseBracket(state, block, text);\n\t\tif (dedentTr) return dedentTr;\n\n\t\tconst action: PairAction = resolvePairAction({\n\t\t\tstate,\n\t\t\tblock,\n\t\t\tblockId: sel.anchor.blockId,\n\t\t\tchar: text,\n\t\t\tconfig: this.resolvedPairing,\n\t\t\tpairStack: this.pairStack,\n\t\t\tgetTokenAt: this.tokenLookup,\n\t\t});\n\n\t\tswitch (action.kind) {\n\t\t\tcase 'pair':\n\t\t\t\treturn this.buildAutoPairTransaction(state, sel.anchor.blockId, action.close, text);\n\t\t\tcase 'overtype':\n\t\t\t\treturn this.buildOvertypeTransaction(state, sel.anchor.blockId);\n\t\t\tcase 'wrap':\n\t\t\t\treturn this.buildWrapTransaction(state, sel.anchor.blockId, action.open, action.close);\n\t\t\tcase 'passthrough':\n\t\t\t\treturn null;\n\t\t}\n\t};\n\n\tprivate readonly tokenLookup: TokenLookup = (blockId, offset) =>\n\t\tthis.findTokenAt(blockId, offset);\n\n\tprivate tryDedentOnCloseBracket(\n\t\tstate: EditorState,\n\t\tblock: BlockNode,\n\t\tchar: string,\n\t): Transaction | null {\n\t\tif (this.resolvedIndent.mode !== 'brackets') return null;\n\t\tif (char !== '}' && char !== ']' && char !== ')') return null;\n\n\t\tconst sel = state.selection;\n\t\tif (!isTextSelection(sel) || !isCollapsed(sel)) return null;\n\n\t\tconst text: string = getBlockText(block);\n\t\tconst offset: number = sel.anchor.offset;\n\t\tif (!isWhitespaceOnlyBeforeOffset(text, offset)) return null;\n\n\t\tconst { start } = getLineRange(text, offset);\n\t\tif (start === offset) return null; // no leading indent on this line\n\n\t\tconst blockId: BlockId = sel.anchor.blockId;\n\n\t\t// Combined dedent + overtype: when the next non-whitespace char ahead of\n\t\t// the cursor (across any newlines) is a tracked auto-paired close of the\n\t\t// same kind, collapse the gap so the user's typed close consumes the\n\t\t// auto-paired one instead of producing a duplicate.\n\t\tconst trackedClosePos: number | null = this.findTrackedCloseAfter(text, offset, char, blockId);\n\t\tif (trackedClosePos !== null) {\n\t\t\treturn state\n\t\t\t\t.transaction('input')\n\t\t\t\t.deleteTextAt(blockId, start, trackedClosePos)\n\t\t\t\t.setSelection(createCollapsedSelection(blockId, start + 1))\n\t\t\t\t.build();\n\t\t}\n\n\t\tconst lineSlice: string = text.slice(start, offset);\n\t\tconst result = dedentOnce(\n\t\t\tlineSlice,\n\t\t\tthis.resolvedIndent.useSpaces,\n\t\t\tthis.resolvedIndent.spaceCount,\n\t\t);\n\t\tif (result.removed.length === 0) return null;\n\n\t\tconst newOffset: number = offset - result.removed.length;\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.deleteTextAt(blockId, newOffset, offset)\n\t\t\t.insertText(blockId, newOffset, char, [])\n\t\t\t.setSelection(createCollapsedSelection(blockId, newOffset + 1))\n\t\t\t.build();\n\t}\n\n\t/**\n\t * Scans forward from `offset` through whitespace and newlines for a tracked\n\t * auto-paired close char matching `char`. Returns its position or `null` if\n\t * any other char (or end-of-text) is encountered first.\n\t */\n\tprivate findTrackedCloseAfter(\n\t\ttext: string,\n\t\toffset: number,\n\t\tchar: string,\n\t\tblockId: BlockId,\n\t): number | null {\n\t\tfor (let i = offset; i < text.length; i++) {\n\t\t\tconst ch: string | undefined = text[i];\n\t\t\tif (ch === ' ' || ch === '\\t' || ch === '\\n') continue;\n\t\t\tif (ch === char) {\n\t\t\t\tconst entry = this.pairStack.peek(blockId, i);\n\t\t\t\tif (entry && entry.char === char) return i;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate buildAutoPairTransaction(\n\t\tstate: EditorState,\n\t\tblockId: BlockId,\n\t\tcloseChar: string,\n\t\topenChar: string,\n\t): Transaction {\n\t\tconst sel = state.selection;\n\t\tif (!isTextSelection(sel)) {\n\t\t\tthrow new Error('buildAutoPairTransaction requires a text selection');\n\t\t}\n\t\tconst offset: number = sel.anchor.offset;\n\t\tconst inserted = `${openChar}${closeChar}`;\n\t\tconst tr: Transaction = state\n\t\t\t.transaction('input')\n\t\t\t.insertText(blockId, offset, inserted, [])\n\t\t\t.setSelection(createCollapsedSelection(blockId, offset + 1))\n\t\t\t.build();\n\t\t// Record the auto-inserted close char so overtype/pair-delete can target it.\n\t\t// The position is expressed in post-transaction space; the actual push\n\t\t// happens in `onStateChange` after the mapping migration runs.\n\t\tthis.pendingPairOps.push({\n\t\t\tkind: 'push',\n\t\t\tblockId,\n\t\t\toffset: offset + 1,\n\t\t\tchar: closeChar,\n\t\t});\n\t\treturn tr;\n\t}\n\n\tprivate buildOvertypeTransaction(state: EditorState, blockId: BlockId): Transaction {\n\t\tconst sel = state.selection;\n\t\tif (!isTextSelection(sel)) {\n\t\t\tthrow new Error('buildOvertypeTransaction requires a text selection');\n\t\t}\n\t\tconst offset: number = sel.anchor.offset;\n\t\t// Schedule the take so it survives the migration phase (the entry's\n\t\t// position is in pre-transaction space, so migration will preserve it).\n\t\tthis.pendingPairOps.push({ kind: 'take', blockId, offset });\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.setSelection(createCollapsedSelection(blockId, offset + 1))\n\t\t\t.build();\n\t}\n\n\tprivate buildWrapTransaction(\n\t\tstate: EditorState,\n\t\tblockId: BlockId,\n\t\topenChar: string,\n\t\tcloseChar: string,\n\t): Transaction {\n\t\tconst sel = state.selection;\n\t\tif (!isTextSelection(sel)) {\n\t\t\tthrow new Error('buildWrapTransaction requires a text selection');\n\t\t}\n\t\tconst plan = wrapSelectionPlan(sel, state.getBlockOrder());\n\t\tconst range = selectionRange(sel, state.getBlockOrder());\n\t\tconst wasForward: boolean = range.from === sel.anchor;\n\t\tconst newFrom: number = plan.fromOffset + 1;\n\t\tconst newTo: number = plan.toOffset + 1;\n\t\tconst anchorOff: number = wasForward ? newFrom : newTo;\n\t\tconst headOff: number = wasForward ? newTo : newFrom;\n\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.insertText(blockId, plan.toOffset, closeChar, [])\n\t\t\t.insertText(blockId, plan.fromOffset, openChar, [])\n\t\t\t.setSelection({\n\t\t\t\tanchor: { blockId, offset: anchorOff },\n\t\t\t\thead: { blockId, offset: headOff },\n\t\t\t})\n\t\t\t.build();\n\t}\n\n\tprivate readonly handleCodeBlockPaste: PasteInterceptor = (\n\t\tplainText: string,\n\t\t_html: string,\n\t\tstate: EditorState,\n\t): Transaction | null => {\n\t\tif (!plainText) return null;\n\t\tif (!isTextSelection(state.selection)) return null;\n\n\t\tconst block: BlockNode | undefined = state.getBlock(state.selection.anchor.blockId);\n\t\tif (!block || block.type !== 'code_block') return null;\n\n\t\tconst builder = state.transaction('paste');\n\n\t\tlet insertBlockId: BlockId = state.selection.anchor.blockId;\n\t\tlet insertOffset: number = state.selection.anchor.offset;\n\n\t\tif (!isCollapsed(state.selection)) {\n\t\t\tconst landingId: BlockId | undefined = addDeleteSelectionSteps(state, builder);\n\t\t\tif (landingId) {\n\t\t\t\tinsertBlockId = landingId;\n\t\t\t\tinsertOffset = 0;\n\t\t\t}\n\t\t}\n\n\t\tbuilder.insertText(insertBlockId, insertOffset, plainText, []);\n\t\tbuilder.setSelection(createCollapsedSelection(insertBlockId, insertOffset + plainText.length));\n\n\t\treturn builder.build();\n\t};\n\n\t// --- Table Cell Patching ---\n\n\tprivate patchTableCellContent(context: PluginContext): void {\n\t\tconst registry = context.getSchemaRegistry();\n\t\tconst cellSpec = registry.getNodeSpec('table_cell');\n\t\tif (!cellSpec?.content) return;\n\n\t\tconst currentAllow: readonly string[] = cellSpec.content.allow ?? [];\n\t\tif (currentAllow.includes('code_block')) return;\n\n\t\tregistry.removeNodeSpec('table_cell');\n\t\tregistry.registerNodeSpec({\n\t\t\t...cellSpec,\n\t\t\tcontent: {\n\t\t\t\t...cellSpec.content,\n\t\t\t\tallow: [...currentAllow, 'code_block'],\n\t\t\t},\n\t\t});\n\t}\n\n\t// --- Highlighter Setup ---\n\n\tprivate initHighlighter(): void {\n\t\tif (this.config.highlighter) {\n\t\t\tthis.highlighter = this.config.highlighter;\n\t\t} else {\n\t\t\tthis.highlighter = new RegexTokenizer();\n\t\t}\n\t}\n\n\tprivate registerLanguageRegistry(context: PluginContext): void {\n\t\tconst highlighter: SyntaxHighlighter | null = this.highlighter;\n\t\tconst cache: Map<\n\t\t\tBlockId,\n\t\t\t{ readonly text: string; readonly language: string; readonly tokens: readonly SyntaxToken[] }\n\t\t> = this.tokenCache;\n\n\t\tthis.languageRegistry.onRegister((support) => {\n\t\t\tif (support.highlighting && highlighter?.registerLanguage) {\n\t\t\t\thighlighter.registerLanguage(support.highlighting);\n\t\t\t\tcache.clear();\n\t\t\t}\n\t\t});\n\n\t\tcontext.registerService(LANGUAGE_REGISTRY_SERVICE_KEY, this.languageRegistry);\n\n\t\tthis.languageRegistry.register(JAVA_SUPPORT);\n\t\tthis.languageRegistry.register(JSON_SUPPORT);\n\t\tthis.languageRegistry.register(TYPESCRIPT_SUPPORT);\n\t\tthis.languageRegistry.register(XML_SUPPORT);\n\t}\n\n\tprivate registerSyntaxHighlighterService(context: PluginContext): void {\n\t\tconst tokenizer = this.highlighter;\n\t\tif (!tokenizer) return;\n\n\t\tcontext.registerService(SYNTAX_HIGHLIGHTER_SERVICE_KEY, {\n\t\t\tregisterLanguage: (def) => {\n\t\t\t\ttokenizer.registerLanguage?.(def);\n\t\t\t\tthis.tokenCache.clear();\n\t\t\t},\n\t\t\tgetSupportedLanguages: () => tokenizer.getSupportedLanguages(),\n\t\t\ttokenize: (code, language) => tokenizer.tokenize(code, language),\n\t\t\tgetTokenAt: (blockId, offset) => this.findTokenAt(blockId, offset),\n\t\t});\n\t}\n\n\t/**\n\t * Binary-search the cached token list for the token whose range covers\n\t * `offset`. Returns `undefined` on cache miss or if the offset lies in a\n\t * gap between tokens.\n\t */\n\tprivate findTokenAt(blockId: BlockId, offset: number): SyntaxToken | undefined {\n\t\tconst cached = this.tokenCache.get(blockId);\n\t\tif (!cached) return undefined;\n\t\tconst tokens = cached.tokens;\n\t\tlet low = 0;\n\t\tlet high = tokens.length - 1;\n\t\twhile (low <= high) {\n\t\t\tconst mid: number = (low + high) >>> 1;\n\t\t\tconst token: SyntaxToken | undefined = tokens[mid];\n\t\t\tif (!token) return undefined;\n\t\t\tif (offset < token.from) {\n\t\t\t\thigh = mid - 1;\n\t\t\t} else if (offset >= token.to) {\n\t\t\t\tlow = mid + 1;\n\t\t\t} else {\n\t\t\t\treturn token;\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate getCachedTokens(\n\t\tblockId: BlockId,\n\t\ttext: string,\n\t\tlanguage: string,\n\t): readonly SyntaxToken[] {\n\t\tconst cached = this.tokenCache.get(blockId);\n\t\tif (cached && cached.text === text && cached.language === language) {\n\t\t\treturn cached.tokens;\n\t\t}\n\t\tconst tokens: readonly SyntaxToken[] = this.highlighter?.tokenize(text, language) ?? [];\n\t\tthis.tokenCache.set(blockId, { text, language, tokens });\n\t\treturn tokens;\n\t}\n\n\t// --- Helpers ---\n\n\tprivate getFocusedCodeBlockId(state: EditorState): BlockId | null {\n\t\tif (!isTextSelection(state.selection)) return null;\n\t\tconst blockId: BlockId = state.selection.anchor.blockId;\n\t\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\t\tif (block?.type === 'code_block') return blockId;\n\t\treturn null;\n\t}\n}\n\n/**\n * Merges `indent.*` overrides with deprecated top-level `useSpaces`/`spaceCount`\n * fallbacks, and clamps `spaceCount` once into [MIN_SPACE_COUNT, MAX_SPACE_COUNT].\n */\nfunction resolveIndentConfig(config: CodeBlockConfig): ResolvedIndentConfig {\n\tconst useSpaces: boolean =\n\t\tconfig.indent?.useSpaces ?? config.useSpaces ?? DEFAULT_INDENT.useSpaces;\n\tconst rawSpaceCount: number =\n\t\tconfig.indent?.spaceCount ?? config.spaceCount ?? DEFAULT_INDENT.spaceCount;\n\tconst spaceCount: number = Math.max(\n\t\tMIN_SPACE_COUNT,\n\t\tMath.min(MAX_SPACE_COUNT, Math.trunc(rawSpaceCount)),\n\t);\n\tconst mode: 'none' | 'keep' | 'brackets' = config.indent?.mode ?? DEFAULT_INDENT.mode;\n\treturn { mode, useSpaces, spaceCount };\n}\n\nfunction resolvePairingConfig(config: CodeBlockConfig): ResolvedPairingConfig {\n\tconst p = config.pairing;\n\treturn {\n\t\tbrackets: p?.brackets ?? DEFAULT_PAIRING.brackets,\n\t\tquotes: p?.quotes ?? DEFAULT_PAIRING.quotes,\n\t\tovertype: p?.overtype ?? DEFAULT_PAIRING.overtype,\n\t\tdeletePair: p?.deletePair ?? DEFAULT_PAIRING.deletePair,\n\t\tsurround: p?.surround ?? DEFAULT_PAIRING.surround,\n\t};\n}\n"],"mappings":"ggCAWA,IAAa,EAAiB,4tHAPtB,EAAmB,IACxB,GACA,mBAA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AM,IAAa,EAAU,SAAS,EAAM,GACvD,WAAA,CAAa,EAAS,IAAW,KAAK,YAAY,EAAS,KAS7D,WAAA,CAAoB,EAAkB,GACrC,MAAM,EAAS,KAAK,WAAW,IAAI,GACnC,IAAK,EAAQ,OACb,MAAM,EAAS,EAAO,OACtB,IAAI,EAAM,EACN,EAAO,EAAO,OAAS,EAC3B,KAAO,GAAO,GAAM,CACnB,MAAM,EAAe,EAAM,IAAU,EAC/B,EAAiC,EAAO,GAC9C,IAAK,EAAO,OACZ,GAAI,EAAS,EAAM,KAClB,EAAO,EAAM,YACH,GAAU,EAAM,IAG1B,OAAO,EAFP,EAAM,EAAM,CAEL,GAMV,eAAA,CACC,EACA,EACA,GAEA,MAAM,EAAS,KAAK,WAAW,IAAI,GACnC,GAAI,GAAU,EAAO,OAAS,GAAQ,EAAO,WAAa,EACzD,OAAO,EAAO,OAEf,MAAM,EAAiC,KAAK,aAAa,SAAS,EAAM,IAAa,GAErF,OADA,KAAK,WAAW,IAAI,EAAS,CAAE,OAAM,WAAU,WACxC,EAKR,qBAAA,CAA8B,GAC7B,IAAK,EAAgB,EAAM,WAAY,OAAO,KAC9C,MAAM,EAAmB,EAAM,UAAU,OAAO,QAEhD,MAAoB,eADiB,EAAM,SAAS,IACzC,KAA8B,EAClC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./Platform-D9TRT4Mn.mjs";import{o as a,s as r}from"./StyleRuntime-D3d1XFFe.mjs";import{r as t,t as f}from"./KeyboardNav-BZIHDPDV.mjs";var o=new Map([["#000000","Black"],["#434343","Dark Gray 4"],["#666666","Dark Gray 3"],["#999999","Dark Gray 2"],["#b7b7b7","Dark Gray 1"],["#cccccc","Light Gray 3"],["#d9d9d9","Light Gray 2"],["#efefef","Light Gray 1"],["#f3f3f3","Near White"],["#ffffff","White"],["#980000","Dark Red Berry"],["#ff0000","Red"],["#ff9900","Orange"],["#ffff00","Yellow"],["#00ff00","Green"],["#00ffff","Cyan"],["#4a86e8","Cornflower Blue"],["#0000ff","Blue"],["#9900ff","Purple"],["#ff00ff","Magenta"],["#e6b8af","Light Red Berry 3"],["#f4cccc","Light Red 3"],["#fce5cd","Light Orange 3"],["#fff2cc","Light Yellow 3"],["#d9ead3","Light Green 3"],["#d0e0e3","Light Cyan 3"],["#c9daf8","Light Cornflower Blue 3"],["#cfe2f3","Light Blue 3"],["#d9d2e9","Light Purple 3"],["#ead1dc","Light Magenta 3"],["#dd7e6b","Light Red Berry 2"],["#ea9999","Light Red 2"],["#f9cb9c","Light Orange 2"],["#ffe599","Light Yellow 2"],["#b6d7a8","Light Green 2"],["#a2c4c9","Light Cyan 2"],["#a4c2f4","Light Cornflower Blue 2"],["#9fc5e8","Light Blue 2"],["#b4a7d6","Light Purple 2"],["#d5a6bd","Light Magenta 2"],["#cc4125","Light Red Berry 1"],["#e06666","Light Red 1"],["#f6b26b","Light Orange 1"],["#ffd966","Light Yellow 1"],["#93c47d","Light Green 1"],["#76a5af","Light Cyan 1"],["#6d9eeb","Light Cornflower Blue 1"],["#6fa8dc","Light Blue 1"],["#8e7cc3","Light Purple 1"],["#c27ba0","Light Magenta 1"],["#a61c00","Dark Red Berry 1"],["#cc0000","Dark Red 1"],["#e69138","Dark Orange 1"],["#f1c232","Dark Yellow 1"],["#6aa84f","Dark Green 1"],["#45818e","Dark Cyan 1"],["#3c78d8","Dark Cornflower Blue 1"],["#3d85c6","Dark Blue 1"],["#674ea7","Dark Purple 1"],["#a64d79","Dark Magenta 1"],["#85200c","Dark Red Berry 2"],["#990000","Dark Red 2"],["#b45f06","Dark Orange 2"],["#bf9000","Dark Yellow 2"],["#38761d","Dark Green 2"],["#134f5c","Dark Cyan 2"],["#1155cc","Dark Cornflower Blue 2"],["#0b5394","Dark Blue 2"],["#351c75","Dark Purple 2"],["#741b47","Dark Magenta 2"],["#fff176","Bright Yellow"],["#aed581","Light Green"],["#4dd0e1","Bright Cyan"],["#64b5f6","Sky Blue"],["#ce93d8","Lavender"],["#f48fb1","Pink"],["#ffab91","Peach"],["#ff8a65","Coral"],["#e6ee9c","Lime"],["#80cbc4","Teal"],["#fff9c4","Pale Yellow"],["#dcedc8","Pale Green"],["#e0f7fa","Pale Cyan"],["#e3f2fd","Pale Blue"],["#f3e5f5","Pale Purple"],["#fce4ec","Pale Pink"],["#fff3e0","Pale Orange"],["#fbe9e7","Pale Red"],["#f9fbe7","Pale Lime"],["#e0f2f1","Pale Teal"],["#fff59d","Soft Yellow"],["#c5e1a5","Soft Green"],["#80deea","Soft Cyan"],["#90caf9","Soft Blue"],["#e1bee7","Soft Purple"],["#f8bbd0","Soft Pink"],["#ffcc80","Soft Orange"],["#a5d6a7","Mint"],["#ffee58","Vivid Yellow"],["#9ccc65","Vivid Green"],["#26c6da","Vivid Cyan"],["#42a5f5","Vivid Blue"],["#ab47bc","Vivid Purple"],["#ec407a","Vivid Pink"],["#ffa726","Vivid Orange"],["#ff7043","Red Orange"],["#d4e157","Vivid Lime"],["#66bb6a","Emerald"],["#fafafa","Almost White"],["#f5f5f5","Lightest Gray"],["#eeeeee","Very Light Gray"],["#e0e0e0","Silver"],["#bdbdbd","Medium Gray"],["#e8eaf6","Lavender Gray"],["#efebe9","Warm Gray"],["#eceff1","Cool Gray"]]);function n(e){return o.get(e.toLowerCase())||function(e){const a=l(e),r=Number.parseInt(a.slice(1,3),16)/255,t=Number.parseInt(a.slice(3,5),16)/255,f=Number.parseInt(a.slice(5,7),16)/255,o=Math.max(r,t,f),n=Math.min(r,t,f),i=(o+n)/2,c=o-n;if(c<.05)return i<.15?"Black":i<.35?"Dark Gray":i<.65?"Gray":i<.85?"Light Gray":"Near White";let s=0;s=o===r?60*((t-f)/c+(t<f?6:0)):o===t?60*((f-r)/c+2):60*((r-t)/c+4);let u="Red";for(const[l,g]of d)if(s<l){u=g;break}return i<.25?`Very Dark ${u}`:i<.4?`Dark ${u}`:i>.8?`Very Light ${u}`:i>.65?`Light ${u}`:u}(e)}function i(e){return function(e){const a=l(e);return.2126*c(Number.parseInt(a.slice(1,3),16)/255)+.7152*c(Number.parseInt(a.slice(3,5),16)/255)+.0722*c(Number.parseInt(a.slice(5,7),16)/255)}(e)>.3}function l(e){const a=e.toLowerCase();return 4===a.length?`#${a[1]}${a[1]}${a[2]}${a[2]}${a[3]}${a[3]}`:a}function c(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}var d=[[15,"Red"],[45,"Orange"],[65,"Yellow"],[150,"Green"],[190,"Cyan"],[250,"Blue"],[290,"Purple"],[330,"Pink"],[361,"Red"]],s=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function u(o,l){const c=l.columns,d=l.colors.length,u=Math.ceil(d/c),g=document.createElement("div");g.className="notectl-color-picker__grid",g.setAttribute("role","grid"),g.setAttribute("aria-label",l.ariaLabel);const h=[];let b=0;for(let e=0;e<u;e++){const t=document.createElement("div");t.setAttribute("role","row");for(let f=0;f<c;f++){const o=e*c+f;if(o>=d)break;const s=l.colors[o],u=n(s),g=!!l.activeColor&&l.activeColor.toLowerCase()===s.toLowerCase(),L=document.createElement("button");L.type="button",L.className="notectl-color-picker__swatch",L.setAttribute("role","gridcell");const k=l.swatchLabel?l.swatchLabel(u):`${l.ariaLabelPrefix} ${u}`;L.setAttribute("aria-label",k),L.setAttribute("aria-selected",String(g)),L.dataset.index=String(o),r(L,"backgroundColor",s),L.title=l.titleAsName?u:s,i(s)&&a(L,{border:"1px solid #d0d0d0"}),g&&(L.classList.add("notectl-color-picker__swatch--active"),b=o),L.addEventListener("mousedown",e=>{e.preventDefault(),e.stopPropagation(),l.onSelect(s)}),h.push(L),t.appendChild(L)}g.appendChild(t)}f(h,b),g.addEventListener("keydown",a=>{if("Escape"===a.key)return a.preventDefault(),a.stopPropagation(),void l.onClose();if("Enter"===a.key||" "===a.key){a.preventDefault(),a.stopPropagation();const e=a.target.dataset.index;if(void 0!==e){const a=l.colors[Number(e)];a&&l.onSelect(a)}return}if(s.has(a.key)){a.preventDefault(),a.stopPropagation();const r=Math.floor(b/c)+1,n=b%c+1,i=e(o),[l,s]=t(r,n,u,c,a.key,i);let g=(l-1)*c+(s-1);return g>=d&&(g=d-1),b=g,f(h,b),void h[b]?.focus()}if("Home"===a.key||"End"===a.key){a.preventDefault(),a.stopPropagation();const e=Math.floor(b/c)*c,r=Math.min(e+c-1,d-1);b="Home"===a.key?e:r,f(h,b),h[b]?.focus()}}),o.appendChild(g)}export{n,i as r,u as t};
|
|
2
|
+
//# sourceMappingURL=ColorGrid-U5NtjqyV.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorGrid-U5NtjqyV.mjs","names":[],"sources":["../../src/plugins/shared/ColorNames.ts","../../src/plugins/shared/ColorGrid.ts"],"sourcesContent":["/**\n * Human-readable color name lookup for accessibility.\n *\n * Provides descriptive names for color swatches so screen readers\n * announce \"Red\" instead of \"#ff0000\". Covers all default palette\n * colors with a fallback algorithm for custom hex values.\n */\n\n// ---------------------------------------------------------------------------\n// Static name map — covers every default palette color\n// ---------------------------------------------------------------------------\n\nconst COLOR_NAME_MAP: ReadonlyMap<string, string> = new Map([\n\t// ── TextColor palette (70 colors) ──────────────────────────────────────\n\n\t// Row 1 — Grays\n\t['#000000', 'Black'],\n\t['#434343', 'Dark Gray 4'],\n\t['#666666', 'Dark Gray 3'],\n\t['#999999', 'Dark Gray 2'],\n\t['#b7b7b7', 'Dark Gray 1'],\n\t['#cccccc', 'Light Gray 3'],\n\t['#d9d9d9', 'Light Gray 2'],\n\t['#efefef', 'Light Gray 1'],\n\t['#f3f3f3', 'Near White'],\n\t['#ffffff', 'White'],\n\n\t// Row 2 — Vivid\n\t['#980000', 'Dark Red Berry'],\n\t['#ff0000', 'Red'],\n\t['#ff9900', 'Orange'],\n\t['#ffff00', 'Yellow'],\n\t['#00ff00', 'Green'],\n\t['#00ffff', 'Cyan'],\n\t['#4a86e8', 'Cornflower Blue'],\n\t['#0000ff', 'Blue'],\n\t['#9900ff', 'Purple'],\n\t['#ff00ff', 'Magenta'],\n\n\t// Row 3 — Light 3 (lightest tint)\n\t['#e6b8af', 'Light Red Berry 3'],\n\t['#f4cccc', 'Light Red 3'],\n\t['#fce5cd', 'Light Orange 3'],\n\t['#fff2cc', 'Light Yellow 3'],\n\t['#d9ead3', 'Light Green 3'],\n\t['#d0e0e3', 'Light Cyan 3'],\n\t['#c9daf8', 'Light Cornflower Blue 3'],\n\t['#cfe2f3', 'Light Blue 3'],\n\t['#d9d2e9', 'Light Purple 3'],\n\t['#ead1dc', 'Light Magenta 3'],\n\n\t// Row 4 — Light 2\n\t['#dd7e6b', 'Light Red Berry 2'],\n\t['#ea9999', 'Light Red 2'],\n\t['#f9cb9c', 'Light Orange 2'],\n\t['#ffe599', 'Light Yellow 2'],\n\t['#b6d7a8', 'Light Green 2'],\n\t['#a2c4c9', 'Light Cyan 2'],\n\t['#a4c2f4', 'Light Cornflower Blue 2'],\n\t['#9fc5e8', 'Light Blue 2'],\n\t['#b4a7d6', 'Light Purple 2'],\n\t['#d5a6bd', 'Light Magenta 2'],\n\n\t// Row 5 — Light 1\n\t['#cc4125', 'Light Red Berry 1'],\n\t['#e06666', 'Light Red 1'],\n\t['#f6b26b', 'Light Orange 1'],\n\t['#ffd966', 'Light Yellow 1'],\n\t['#93c47d', 'Light Green 1'],\n\t['#76a5af', 'Light Cyan 1'],\n\t['#6d9eeb', 'Light Cornflower Blue 1'],\n\t['#6fa8dc', 'Light Blue 1'],\n\t['#8e7cc3', 'Light Purple 1'],\n\t['#c27ba0', 'Light Magenta 1'],\n\n\t// Row 6 — Dark 1\n\t['#a61c00', 'Dark Red Berry 1'],\n\t['#cc0000', 'Dark Red 1'],\n\t['#e69138', 'Dark Orange 1'],\n\t['#f1c232', 'Dark Yellow 1'],\n\t['#6aa84f', 'Dark Green 1'],\n\t['#45818e', 'Dark Cyan 1'],\n\t['#3c78d8', 'Dark Cornflower Blue 1'],\n\t['#3d85c6', 'Dark Blue 1'],\n\t['#674ea7', 'Dark Purple 1'],\n\t['#a64d79', 'Dark Magenta 1'],\n\n\t// Row 7 — Dark 2\n\t['#85200c', 'Dark Red Berry 2'],\n\t['#990000', 'Dark Red 2'],\n\t['#b45f06', 'Dark Orange 2'],\n\t['#bf9000', 'Dark Yellow 2'],\n\t['#38761d', 'Dark Green 2'],\n\t['#134f5c', 'Dark Cyan 2'],\n\t['#1155cc', 'Dark Cornflower Blue 2'],\n\t['#0b5394', 'Dark Blue 2'],\n\t['#351c75', 'Dark Purple 2'],\n\t['#741b47', 'Dark Magenta 2'],\n\n\t// ── Highlight palette (50 colors, minus duplicates) ────────────────────\n\n\t// Row 1 — Classic highlighter (bright, vivid)\n\t['#fff176', 'Bright Yellow'],\n\t['#aed581', 'Light Green'],\n\t['#4dd0e1', 'Bright Cyan'],\n\t['#64b5f6', 'Sky Blue'],\n\t['#ce93d8', 'Lavender'],\n\t['#f48fb1', 'Pink'],\n\t['#ffab91', 'Peach'],\n\t['#ff8a65', 'Coral'],\n\t['#e6ee9c', 'Lime'],\n\t['#80cbc4', 'Teal'],\n\n\t// Row 2 — Light pastels\n\t['#fff9c4', 'Pale Yellow'],\n\t['#dcedc8', 'Pale Green'],\n\t['#e0f7fa', 'Pale Cyan'],\n\t['#e3f2fd', 'Pale Blue'],\n\t['#f3e5f5', 'Pale Purple'],\n\t['#fce4ec', 'Pale Pink'],\n\t['#fff3e0', 'Pale Orange'],\n\t['#fbe9e7', 'Pale Red'],\n\t['#f9fbe7', 'Pale Lime'],\n\t['#e0f2f1', 'Pale Teal'],\n\n\t// Row 3 — Medium pastels\n\t['#fff59d', 'Soft Yellow'],\n\t['#c5e1a5', 'Soft Green'],\n\t['#80deea', 'Soft Cyan'],\n\t['#90caf9', 'Soft Blue'],\n\t['#e1bee7', 'Soft Purple'],\n\t['#f8bbd0', 'Soft Pink'],\n\t['#ffcc80', 'Soft Orange'],\n\t// #ffab91 duplicate → Peach (already mapped)\n\t// #e6ee9c duplicate → Lime (already mapped)\n\t['#a5d6a7', 'Mint'],\n\n\t// Row 4 — Bold pastels\n\t['#ffee58', 'Vivid Yellow'],\n\t['#9ccc65', 'Vivid Green'],\n\t['#26c6da', 'Vivid Cyan'],\n\t['#42a5f5', 'Vivid Blue'],\n\t['#ab47bc', 'Vivid Purple'],\n\t['#ec407a', 'Vivid Pink'],\n\t['#ffa726', 'Vivid Orange'],\n\t['#ff7043', 'Red Orange'],\n\t['#d4e157', 'Vivid Lime'],\n\t['#66bb6a', 'Emerald'],\n\n\t// Row 5 — Grays and neutral highlights\n\t// #ffffff duplicate → White (already mapped)\n\t['#fafafa', 'Almost White'],\n\t['#f5f5f5', 'Lightest Gray'],\n\t['#eeeeee', 'Very Light Gray'],\n\t['#e0e0e0', 'Silver'],\n\t['#bdbdbd', 'Medium Gray'],\n\t['#e8eaf6', 'Lavender Gray'],\n\t['#efebe9', 'Warm Gray'],\n\t['#eceff1', 'Cool Gray'],\n\t// #fafafa duplicate → Almost White (already mapped)\n]);\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\n/**\n * Returns a human-readable name for a hex color.\n *\n * Checks the static map first, then falls back to a computed\n * description based on hue, saturation, and lightness.\n */\nexport function getColorName(hex: string): string {\n\tconst name: string | undefined = COLOR_NAME_MAP.get(hex.toLowerCase());\n\tif (name) return name;\n\treturn describeColor(hex);\n}\n\n/**\n * Determines whether a color is light enough to need a visible\n * border when rendered on a white background (WCAG 1.4.11).\n *\n * Uses a contrast-ratio threshold of 3:1 against white.\n */\nexport function isLightColor(hex: string): boolean {\n\tconst luminance: number = relativeLuminance(hex);\n\t// Contrast ratio against white: (1.05) / (L + 0.05) < 3\n\t// ⟹ L > 1.05/3 − 0.05 = 0.3\n\tconst LIGHT_THRESHOLD = 0.3;\n\treturn luminance > LIGHT_THRESHOLD;\n}\n\n// ---------------------------------------------------------------------------\n// Internal helpers\n// ---------------------------------------------------------------------------\n\n/** Expands `#RGB` to `#RRGGBB` and lowercases. */\nfunction normalizeHex(hex: string): string {\n\tconst h: string = hex.toLowerCase();\n\tif (h.length === 4) {\n\t\treturn `#${h[1]}${h[1]}${h[2]}${h[2]}${h[3]}${h[3]}`;\n\t}\n\treturn h;\n}\n\n/** Applies sRGB linearization to a single channel value (0–1). */\nfunction linearize(channel: number): number {\n\treturn channel <= 0.03928 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4;\n}\n\n/** Computes WCAG relative luminance from a hex color. */\nfunction relativeLuminance(hex: string): number {\n\tconst normalized: string = normalizeHex(hex);\n\tconst r: number = linearize(Number.parseInt(normalized.slice(1, 3), 16) / 255);\n\tconst g: number = linearize(Number.parseInt(normalized.slice(3, 5), 16) / 255);\n\tconst b: number = linearize(Number.parseInt(normalized.slice(5, 7), 16) / 255);\n\treturn 0.2126 * r + 0.7152 * g + 0.0722 * b;\n}\n\n/** Hue boundary table: upper bound (degrees) → name. */\nconst HUE_NAMES: readonly (readonly [number, string])[] = [\n\t[15, 'Red'],\n\t[45, 'Orange'],\n\t[65, 'Yellow'],\n\t[150, 'Green'],\n\t[190, 'Cyan'],\n\t[250, 'Blue'],\n\t[290, 'Purple'],\n\t[330, 'Pink'],\n\t[361, 'Red'],\n];\n\n/**\n * Generates a descriptive name from a hex color using HSL analysis.\n * Produces names like \"Dark Blue\", \"Light Green\", or \"Gray\".\n */\nfunction describeColor(hex: string): string {\n\tconst normalized: string = normalizeHex(hex);\n\tconst rRaw: number = Number.parseInt(normalized.slice(1, 3), 16) / 255;\n\tconst gRaw: number = Number.parseInt(normalized.slice(3, 5), 16) / 255;\n\tconst bRaw: number = Number.parseInt(normalized.slice(5, 7), 16) / 255;\n\n\tconst max: number = Math.max(rRaw, gRaw, bRaw);\n\tconst min: number = Math.min(rRaw, gRaw, bRaw);\n\tconst lightness: number = (max + min) / 2;\n\tconst delta: number = max - min;\n\n\t// Achromatic\n\tif (delta < 0.05) {\n\t\tif (lightness < 0.15) return 'Black';\n\t\tif (lightness < 0.35) return 'Dark Gray';\n\t\tif (lightness < 0.65) return 'Gray';\n\t\tif (lightness < 0.85) return 'Light Gray';\n\t\treturn 'Near White';\n\t}\n\n\t// Compute hue in degrees\n\tlet hue = 0;\n\tif (max === rRaw) {\n\t\thue = ((gRaw - bRaw) / delta + (gRaw < bRaw ? 6 : 0)) * 60;\n\t} else if (max === gRaw) {\n\t\thue = ((bRaw - rRaw) / delta + 2) * 60;\n\t} else {\n\t\thue = ((rRaw - gRaw) / delta + 4) * 60;\n\t}\n\n\t// Look up hue name\n\tlet hueName = 'Red';\n\tfor (const [threshold, name] of HUE_NAMES) {\n\t\tif (hue < threshold) {\n\t\t\thueName = name;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Lightness modifier\n\tif (lightness < 0.25) return `Very Dark ${hueName}`;\n\tif (lightness < 0.4) return `Dark ${hueName}`;\n\tif (lightness > 0.8) return `Very Light ${hueName}`;\n\tif (lightness > 0.65) return `Light ${hueName}`;\n\treturn hueName;\n}\n","/**\n * Shared color grid rendering with WAI-ARIA grid pattern and keyboard\n * navigation. Used by ColorPickerPopup (text-color, highlight) and\n * TableBorderColor.\n */\n\nimport { isRtlContext } from '../../platform/Platform.js';\nimport { setStyleProperties, setStyleProperty } from '../../style/StyleRuntime.js';\nimport { getColorName, isLightColor } from './ColorNames.js';\nimport { applyRovingTabindex, navigateGrid } from './KeyboardNav.js';\n\n// --- Types ---\n\nexport interface ColorGridConfig {\n\treadonly colors: readonly string[];\n\treadonly columns: number;\n\treadonly ariaLabel: string;\n\treadonly ariaLabelPrefix: string;\n\treadonly activeColor: string | null;\n\treadonly onSelect: (color: string) => void;\n\treadonly onClose: () => void;\n\t/** Optional custom label formatter for swatch aria-labels. Defaults to `${prefix} ${colorName}`. */\n\treadonly swatchLabel?: (colorName: string) => string;\n\t/** When true, swatch title shows human-readable color name instead of hex. */\n\treadonly titleAsName?: boolean;\n}\n\n// --- Constants ---\n\nconst GRID_NAV_KEYS: ReadonlySet<string> = new Set([\n\t'ArrowUp',\n\t'ArrowDown',\n\t'ArrowLeft',\n\t'ArrowRight',\n]);\nconst LIGHT_COLOR_BORDER = '1px solid #d0d0d0';\n\n// --- Rendering ---\n\n/**\n * Renders an accessible color grid into the given container.\n * Creates a `role=\"grid\"` with rows of `role=\"gridcell\"` swatch buttons.\n * Provides arrow key, Home/End, Enter/Space, and Escape keyboard navigation.\n */\nexport function renderColorGrid(container: HTMLElement, config: ColorGridConfig): void {\n\tconst columns: number = config.columns;\n\tconst totalSwatches: number = config.colors.length;\n\tconst totalRows: number = Math.ceil(totalSwatches / columns);\n\n\tconst grid: HTMLDivElement = document.createElement('div');\n\tgrid.className = 'notectl-color-picker__grid';\n\tgrid.setAttribute('role', 'grid');\n\tgrid.setAttribute('aria-label', config.ariaLabel);\n\n\tconst swatches: HTMLButtonElement[] = [];\n\tlet focusedIndex = 0;\n\n\tfor (let rowIdx = 0; rowIdx < totalRows; rowIdx++) {\n\t\tconst row: HTMLDivElement = document.createElement('div');\n\t\trow.setAttribute('role', 'row');\n\n\t\tfor (let colIdx = 0; colIdx < columns; colIdx++) {\n\t\t\tconst swatchIdx: number = rowIdx * columns + colIdx;\n\t\t\tif (swatchIdx >= totalSwatches) break;\n\n\t\t\tconst color: string = config.colors[swatchIdx] as string;\n\t\t\tconst colorName: string = getColorName(color);\n\t\t\tconst isActive: boolean =\n\t\t\t\t!!config.activeColor && config.activeColor.toLowerCase() === color.toLowerCase();\n\n\t\t\tconst swatch: HTMLButtonElement = document.createElement('button');\n\t\t\tswatch.type = 'button';\n\t\t\tswatch.className = 'notectl-color-picker__swatch';\n\t\t\tswatch.setAttribute('role', 'gridcell');\n\t\t\tconst label: string = config.swatchLabel\n\t\t\t\t? config.swatchLabel(colorName)\n\t\t\t\t: `${config.ariaLabelPrefix} ${colorName}`;\n\t\t\tswatch.setAttribute('aria-label', label);\n\t\t\tswatch.setAttribute('aria-selected', String(isActive));\n\t\t\tswatch.dataset.index = String(swatchIdx);\n\t\t\tsetStyleProperty(swatch, 'backgroundColor', color);\n\t\t\tswatch.title = config.titleAsName ? colorName : color;\n\n\t\t\tif (isLightColor(color)) {\n\t\t\t\tsetStyleProperties(swatch, {\n\t\t\t\t\tborder: LIGHT_COLOR_BORDER,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (isActive) {\n\t\t\t\tswatch.classList.add('notectl-color-picker__swatch--active');\n\t\t\t\tfocusedIndex = swatchIdx;\n\t\t\t}\n\n\t\t\tswatch.addEventListener('mousedown', (e: MouseEvent) => {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t\tconfig.onSelect(color);\n\t\t\t});\n\n\t\t\tswatches.push(swatch);\n\t\t\trow.appendChild(swatch);\n\t\t}\n\n\t\tgrid.appendChild(row);\n\t}\n\n\tapplyRovingTabindex(swatches as readonly HTMLButtonElement[], focusedIndex);\n\n\tgrid.addEventListener('keydown', (e: KeyboardEvent) => {\n\t\tif (e.key === 'Escape') {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tconfig.onClose();\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tconst target = e.target as HTMLElement;\n\t\t\tconst idx: string | undefined = target.dataset.index;\n\t\t\tif (idx !== undefined) {\n\t\t\t\tconst color: string | undefined = config.colors[Number(idx)];\n\t\t\t\tif (color) {\n\t\t\t\t\tconfig.onSelect(color);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (GRID_NAV_KEYS.has(e.key)) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tconst currentRow: number = Math.floor(focusedIndex / columns) + 1;\n\t\t\tconst currentCol: number = (focusedIndex % columns) + 1;\n\n\t\t\tconst rtl: boolean = isRtlContext(container);\n\t\t\tconst [newRow, newCol] = navigateGrid(\n\t\t\t\tcurrentRow,\n\t\t\t\tcurrentCol,\n\t\t\t\ttotalRows,\n\t\t\t\tcolumns,\n\t\t\t\te.key as 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight',\n\t\t\t\trtl,\n\t\t\t);\n\n\t\t\tlet newIdx: number = (newRow - 1) * columns + (newCol - 1);\n\t\t\tif (newIdx >= totalSwatches) {\n\t\t\t\tnewIdx = totalSwatches - 1;\n\t\t\t}\n\n\t\t\tfocusedIndex = newIdx;\n\t\t\tapplyRovingTabindex(swatches as readonly HTMLButtonElement[], focusedIndex);\n\t\t\tswatches[focusedIndex]?.focus();\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.key === 'Home' || e.key === 'End') {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tconst currentRow: number = Math.floor(focusedIndex / columns);\n\t\t\tconst rowStart: number = currentRow * columns;\n\t\t\tconst rowEnd: number = Math.min(rowStart + columns - 1, totalSwatches - 1);\n\n\t\t\tfocusedIndex = e.key === 'Home' ? rowStart : rowEnd;\n\t\t\tapplyRovingTabindex(swatches as readonly HTMLButtonElement[], focusedIndex);\n\t\t\tswatches[focusedIndex]?.focus();\n\t\t}\n\t});\n\n\tcontainer.appendChild(grid);\n}\n"],"mappings":"yJAYA,IAAM,EAA8C,IAAI,IAAI,CAI3D,CAAC,UAAW,SACZ,CAAC,UAAW,eACZ,CAAC,UAAW,eACZ,CAAC,UAAW,eACZ,CAAC,UAAW,eACZ,CAAC,UAAW,gBACZ,CAAC,UAAW,gBACZ,CAAC,UAAW,gBACZ,CAAC,UAAW,cACZ,CAAC,UAAW,SAGZ,CAAC,UAAW,kBACZ,CAAC,UAAW,OACZ,CAAC,UAAW,UACZ,CAAC,UAAW,UACZ,CAAC,UAAW,SACZ,CAAC,UAAW,QACZ,CAAC,UAAW,mBACZ,CAAC,UAAW,QACZ,CAAC,UAAW,UACZ,CAAC,UAAW,WAGZ,CAAC,UAAW,qBACZ,CAAC,UAAW,eACZ,CAAC,UAAW,kBACZ,CAAC,UAAW,kBACZ,CAAC,UAAW,iBACZ,CAAC,UAAW,gBACZ,CAAC,UAAW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S,GAQxD,OAPI,GAAU,IACb,EAAS,EAAgB,GAG1B,EAAe,EACf,EAAoB,EAA0C,QAC9D,EAAS,IAAe,QAIzB,GAAc,SAAV,EAAE,KAA4B,QAAV,EAAE,IAAe,CACxC,EAAE,iBACF,EAAE,kBAEF,MAAM,EADqB,KAAK,MAAM,EAAe,GACf,EAChC,EAAiB,KAAK,IAAI,EAAW,EAAU,EAAG,EAAgB,GAExE,EAAyB,SAAV,EAAE,IAAiB,EAAW,EAC7C,EAAoB,EAA0C,GAC9D,EAAS,IAAe,WAI1B,EAAU,YAAY"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./TypeBrands-BZDKMjR-.mjs";import{i as t,n as o,t as r}from"./AttributedMarkCommands-Ctt_1xRD.mjs";import{t as a}from"./ColorValidation-3viVw_tK.mjs";import{t as n}from"./ColorGrid-U5NtjqyV.mjs";function s(e,t){return o(e,t,e=>e.attrs.color??null)}function l(e,t){return null!==s(e,t)}function i(t,o,n,s){if(!a(s))return!1;const l=r(o,{type:e(n),attrs:{color:s}});return!!l&&(t.dispatch(l),!0)}function c(o,r,a){const n=t(r,e(a));return!!n&&(o.dispatch(n),!0)}function m(e,t,o){e.classList.add("notectl-color-picker");const r=s(t.getState(),o.markType),a=o.columns||10,l=t.getContainer(),c=document.createElement("button");c.type="button",c.className="notectl-color-picker__default",c.textContent=o.resetLabel,c.addEventListener("mousedown",e=>{e.preventDefault(),e.stopPropagation(),t.executeCommand(o.resetCommand),o.onClose({restoreFocusTo:l})}),c.addEventListener("keydown",e=>{"Escape"===e.key&&(e.preventDefault(),o.onClose())}),e.appendChild(c),n(e,{colors:o.colors,columns:a,ariaLabel:`${o.ariaLabelPrefix} color picker`,ariaLabelPrefix:o.ariaLabelPrefix,activeColor:r,onSelect:e=>{i(t,t.getState(),o.markType,e),o.onClose({restoreFocusTo:l})},onClose:o.onClose})}export{c as a,l as i,i as n,s as r,m as t};
|
|
2
|
+
//# sourceMappingURL=ColorPickerPopup-BYSMUZZx.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPickerPopup-BYSMUZZx.mjs","names":[],"sources":["../../src/plugins/shared/ColorMarkOperations.ts","../../src/plugins/shared/ColorPickerPopup.ts"],"sourcesContent":["/**\n * Shared color mark operations for color-based mark plugins.\n * All functions are parameterized by mark type name so they work\n * identically for TextColor, Highlight, or any future color mark.\n *\n * Delegates to the generic AttributedMarkCommands helpers for the\n * collapsed-vs-range branching logic.\n */\n\nimport {\n\tapplyAttributedMark,\n\tgetMarkAttrAtSelection,\n\tremoveAttributedMark,\n} from '../../commands/AttributedMarkCommands.js';\nimport type { MarkAttrRegistry } from '../../model/AttrRegistry.js';\nimport { markType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { isValidCSSColor } from './ColorValidation.js';\n\n/** Color mark type names that have `{ color: string }` attrs. */\nexport type ColorMarkType = {\n\t[K in keyof MarkAttrRegistry]: MarkAttrRegistry[K] extends { color: string } ? K : never;\n}[keyof MarkAttrRegistry];\n\n/**\n * Returns the active color value for the given mark type at the current\n * selection, or `null` if the mark is not present.\n */\nexport function getActiveColor(state: EditorState, markTypeName: ColorMarkType): string | null {\n\treturn getMarkAttrAtSelection(state, markTypeName, (m) => m.attrs.color ?? null);\n}\n\n/** Returns `true` when the given color mark is active at the current selection. */\nexport function isColorMarkActive(state: EditorState, markTypeName: ColorMarkType): boolean {\n\treturn getActiveColor(state, markTypeName) !== null;\n}\n\n/**\n * Applies the given color to the selection. For collapsed selections,\n * sets stored marks. For range selections, removes then re-adds the mark.\n */\nexport function applyColorMark(\n\tcontext: PluginContext,\n\tstate: EditorState,\n\tmarkTypeName: ColorMarkType,\n\tcolor: string,\n): boolean {\n\tif (!isValidCSSColor(color)) return false;\n\n\tconst mark = { type: markType(markTypeName), attrs: { color } };\n\tconst tr = applyAttributedMark(state, mark);\n\tif (!tr) return false;\n\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\n/**\n * Removes the given color mark from the selection.\n * Returns `false` when the mark was not present.\n */\nexport function removeColorMark(\n\tcontext: PluginContext,\n\tstate: EditorState,\n\tmarkTypeName: ColorMarkType,\n): boolean {\n\tconst tr = removeAttributedMark(state, markType(markTypeName));\n\tif (!tr) return false;\n\n\tcontext.dispatch(tr);\n\treturn true;\n}\n","/**\n * Shared color picker popup rendering with WAI-ARIA grid keyboard navigation.\n * Used by TextColorPlugin and HighlightPlugin.\n * Delegates grid rendering to the shared ColorGrid module.\n */\n\nimport type { PluginContext } from '../Plugin.js';\nimport { renderColorGrid } from './ColorGrid.js';\nimport type { ColorMarkType } from './ColorMarkOperations.js';\nimport { applyColorMark, getActiveColor } from './ColorMarkOperations.js';\nimport type { PopupCloseOptions } from './PopupManager.js';\n\n/** Configuration for `renderColorPickerPopup`. */\nexport interface ColorPickerConfig {\n\treadonly markType: ColorMarkType;\n\treadonly colors: readonly string[];\n\treadonly columns: number;\n\treadonly resetLabel: string;\n\treadonly resetCommand: string;\n\treadonly ariaLabelPrefix: string;\n\treadonly onClose: (options?: PopupCloseOptions) => void;\n}\n\nconst COLUMNS = 10;\n\n/**\n * Renders an accessible color picker popup into `container`.\n *\n * Features:\n * - WAI-ARIA `role=\"grid\"` with row/gridcell structure\n * - Arrow key navigation (wraps around, clamps on partial last row)\n * - Enter/Space selects color and closes popup\n * - Escape closes popup\n * - Roving tabindex on swatches\n */\nexport function renderColorPickerPopup(\n\tcontainer: HTMLElement,\n\tcontext: PluginContext,\n\tconfig: ColorPickerConfig,\n): void {\n\tcontainer.classList.add('notectl-color-picker');\n\n\tconst state = context.getState();\n\tconst activeColor: string | null = getActiveColor(state, config.markType);\n\tconst columns: number = config.columns || COLUMNS;\n\tconst contentElement: HTMLElement = context.getContainer();\n\n\t// --- Reset button ---\n\tconst resetBtn: HTMLButtonElement = document.createElement('button');\n\tresetBtn.type = 'button';\n\tresetBtn.className = 'notectl-color-picker__default';\n\tresetBtn.textContent = config.resetLabel;\n\tresetBtn.addEventListener('mousedown', (e: MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tcontext.executeCommand(config.resetCommand);\n\t\tconfig.onClose({ restoreFocusTo: contentElement });\n\t});\n\tresetBtn.addEventListener('keydown', (e: KeyboardEvent) => {\n\t\tif (e.key === 'Escape') {\n\t\t\te.preventDefault();\n\t\t\tconfig.onClose();\n\t\t}\n\t});\n\tcontainer.appendChild(resetBtn);\n\n\t// --- Color grid (delegated to shared ColorGrid) ---\n\trenderColorGrid(container, {\n\t\tcolors: config.colors,\n\t\tcolumns,\n\t\tariaLabel: `${config.ariaLabelPrefix} color picker`,\n\t\tariaLabelPrefix: config.ariaLabelPrefix,\n\t\tactiveColor,\n\t\tonSelect: (color: string) => {\n\t\t\tapplyColorMark(context, context.getState(), config.markType, color);\n\t\t\tconfig.onClose({ restoreFocusTo: contentElement });\n\t\t},\n\t\tonClose: config.onClose,\n\t});\n}\n"],"mappings":"sNA6BA,SAAgB,EAAe,EAAoB,GAClD,OAAO,EAAuB,EAAO,EAAe,GAAM,EAAE,MAAM,OAAS,MAI5E,SAAgB,EAAkB,EAAoB,GACrD,OAA+C,OAAxC,EAAe,EAAO,GAO9B,SAAgB,EACf,EACA,EACA,EACA,GAEA,IAAK,EAAgB,GAAQ,OAAO,EAGpC,MAAM,EAAK,EAAoB,EADlB,CAAE,KAAM,EAAS,GAAe,MAAO,CAAE,WAEtD,QAAK,IAEL,EAAQ,SAAS,IACV,GAOR,SAAgB,EACf,EACA,EACA,GAEA,MAAM,EAAK,EAAqB,EAAO,EAAS,IAChD,QAAK,IAEL,EAAQ,SAAS,IACV,GCpCR,SAAgB,EACf,EACA,EACA,GAEA,EAAU,UAAU,IAAI,wBAGxB,MAAM,EAA6B,EADrB,EAAQ,WACmC,EAAO,UAC1D,EAAkB,EAAO,SArBhB,GAsBT,EAA8B,EAAQ,eAGtC,EAA8B,SAAS,cAAc,UAC3D,EAAS,KAAO,SAChB,EAAS,UAAY,gCACrB,EAAS,YAAc,EAAO,WAC9B,EAAS,iBAAiB,YAAc,IACvC,EAAE,iBACF,EAAE,kBACF,EAAQ,eAAe,EAAO,cAC9B,EAAO,QAAQ,CAAE,eAAgB,MAElC,EAAS,iBAAiB,UAAY,IACvB,WAAV,EAAE,MACL,EAAE,iBACF,EAAO,aAGT,EAAU,YAAY,GAGtB,EAAgB,EAAW,CAC1B,OAAQ,EAAO,OACf,UACA,UAAW,GAAG,EAAO,+BACrB,gBAAiB,EAAO,gBACxB,cACA,SAAW,IACV,EAAe,EAAS,EAAQ,WAAY,EAAO,SAAU,GAC7D,EAAO,QAAQ,CAAE,eAAgB,KAElC,QAAS,EAAO"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;function r(r){return e.test(r)}var a=/^rgba?\(\s*(\d{1,3}%?\s*,\s*){2}\d{1,3}%?(\s*,\s*(0|1|0?\.\d+))?\s*\)$/,l=/^hsla?\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%(\s*,\s*(0|1|0?\.\d+))?\s*\)$/,t=new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","transparent","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]);function n(r){if(!r)return!1;const n=r.trim().toLowerCase();return!!n&&(e.test(n)||a.test(n)||l.test(n)||t.has(n))}function i(e,a,l){if(!e||0===e.length)return a;const t=e.filter(e=>!r(e));if(t.length>0)throw new Error(`${l}: invalid hex color(s): ${t.join(", ")}. Expected format: #RGB or #RRGGBB.`);const n=/* @__PURE__ */new Set,i=[];for(const r of e){const e=r.toLowerCase();n.has(e)||(n.add(e),i.push(e))}return i}var o=/[{}<>;]|url\(|expression\(/i;function s(e){if(!e)return!1;const r=e.trim();return!!r&&!o.test(r)}var d=/^\d+(\.\d+)?(px|pt|em|rem|%)$/i;function u(e){return!!e&&d.test(e.trim())}export{i as a,r as i,s as n,u as r,n as t};
|
|
2
|
+
//# sourceMappingURL=ColorValidation-3viVw_tK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorValidation-3viVw_tK.mjs","names":[],"sources":["../../src/plugins/shared/ColorValidation.ts"],"sourcesContent":["/**\n * Shared CSS validation and normalization utilities\n * for style-based mark plugins (TextColor, Highlight, Font, FontSize).\n */\n\nconst HEX_COLOR_PATTERN: RegExp = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;\n\n/** Returns `true` when the value is a valid `#RGB` or `#RRGGBB` hex color. */\nexport function isValidHexColor(value: string): boolean {\n\treturn HEX_COLOR_PATTERN.test(value);\n}\n\n// --- CSS Color Validation (broad format support for paste / API input) ---\n\n/** Matches `rgb(r, g, b)` and `rgba(r, g, b, a)` with integer or percentage values. */\nconst RGB_PATTERN: RegExp =\n\t/^rgba?\\(\\s*(\\d{1,3}%?\\s*,\\s*){2}\\d{1,3}%?(\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$/;\n\n/** Matches `hsl(h, s%, l%)` and `hsla(h, s%, l%, a)`. */\nconst HSL_PATTERN: RegExp =\n\t/^hsla?\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}%\\s*,\\s*\\d{1,3}%(\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$/;\n\n/**\n * Complete set of CSS Level 4 named colors (including `transparent`).\n * Used as an allowlist — unknown names are rejected.\n */\nconst CSS_NAMED_COLORS: ReadonlySet<string> = new Set([\n\t'aliceblue',\n\t'antiquewhite',\n\t'aqua',\n\t'aquamarine',\n\t'azure',\n\t'beige',\n\t'bisque',\n\t'black',\n\t'blanchedalmond',\n\t'blue',\n\t'blueviolet',\n\t'brown',\n\t'burlywood',\n\t'cadetblue',\n\t'chartreuse',\n\t'chocolate',\n\t'coral',\n\t'cornflowerblue',\n\t'cornsilk',\n\t'crimson',\n\t'cyan',\n\t'darkblue',\n\t'darkcyan',\n\t'darkgoldenrod',\n\t'darkgray',\n\t'darkgreen',\n\t'darkgrey',\n\t'darkkhaki',\n\t'darkmagenta',\n\t'darkolivegreen',\n\t'darkorange',\n\t'darkorchid',\n\t'darkred',\n\t'darksalmon',\n\t'darkseagreen',\n\t'darkslateblue',\n\t'darkslategray',\n\t'darkslategrey',\n\t'darkturquoise',\n\t'darkviolet',\n\t'deeppink',\n\t'deepskyblue',\n\t'dimgray',\n\t'dimgrey',\n\t'dodgerblue',\n\t'firebrick',\n\t'floralwhite',\n\t'forestgreen',\n\t'fuchsia',\n\t'gainsboro',\n\t'ghostwhite',\n\t'gold',\n\t'goldenrod',\n\t'gray',\n\t'green',\n\t'greenyellow',\n\t'grey',\n\t'honeydew',\n\t'hotpink',\n\t'indianred',\n\t'indigo',\n\t'ivory',\n\t'khaki',\n\t'lavender',\n\t'lavenderblush',\n\t'lawngreen',\n\t'lemonchiffon',\n\t'lightblue',\n\t'lightcoral',\n\t'lightcyan',\n\t'lightgoldenrodyellow',\n\t'lightgray',\n\t'lightgreen',\n\t'lightgrey',\n\t'lightpink',\n\t'lightsalmon',\n\t'lightseagreen',\n\t'lightskyblue',\n\t'lightslategray',\n\t'lightslategrey',\n\t'lightsteelblue',\n\t'lightyellow',\n\t'lime',\n\t'limegreen',\n\t'linen',\n\t'magenta',\n\t'maroon',\n\t'mediumaquamarine',\n\t'mediumblue',\n\t'mediumorchid',\n\t'mediumpurple',\n\t'mediumseagreen',\n\t'mediumslateblue',\n\t'mediumspringgreen',\n\t'mediumturquoise',\n\t'mediumvioletred',\n\t'midnightblue',\n\t'mintcream',\n\t'mistyrose',\n\t'moccasin',\n\t'navajowhite',\n\t'navy',\n\t'oldlace',\n\t'olive',\n\t'olivedrab',\n\t'orange',\n\t'orangered',\n\t'orchid',\n\t'palegoldenrod',\n\t'palegreen',\n\t'paleturquoise',\n\t'palevioletred',\n\t'papayawhip',\n\t'peachpuff',\n\t'peru',\n\t'pink',\n\t'plum',\n\t'powderblue',\n\t'purple',\n\t'rebeccapurple',\n\t'red',\n\t'rosybrown',\n\t'royalblue',\n\t'saddlebrown',\n\t'salmon',\n\t'sandybrown',\n\t'seagreen',\n\t'seashell',\n\t'sienna',\n\t'silver',\n\t'skyblue',\n\t'slateblue',\n\t'slategray',\n\t'slategrey',\n\t'snow',\n\t'springgreen',\n\t'steelblue',\n\t'tan',\n\t'teal',\n\t'thistle',\n\t'tomato',\n\t'transparent',\n\t'turquoise',\n\t'violet',\n\t'wheat',\n\t'white',\n\t'whitesmoke',\n\t'yellow',\n\t'yellowgreen',\n]);\n\n/**\n * Returns `true` when `value` is a safe CSS color value.\n * Accepts hex (`#RGB`, `#RRGGBB`), `rgb()`, `rgba()`, `hsl()`, `hsla()`,\n * and CSS named colors. Rejects anything else — defense against CSS injection\n * via manipulated color values in `style` attributes.\n */\nexport function isValidCSSColor(value: string): boolean {\n\tif (!value) return false;\n\tconst trimmed: string = value.trim().toLowerCase();\n\tif (!trimmed) return false;\n\n\treturn (\n\t\tHEX_COLOR_PATTERN.test(trimmed) ||\n\t\tRGB_PATTERN.test(trimmed) ||\n\t\tHSL_PATTERN.test(trimmed) ||\n\t\tCSS_NAMED_COLORS.has(trimmed)\n\t);\n}\n\n/**\n * Validates, deduplicates, and normalizes a user-supplied color list.\n * Returns `fallbackPalette` when no custom colors are provided.\n *\n * @throws {Error} if any value is not a valid hex color code.\n */\nexport function resolveColors(\n\tcolors: readonly string[] | undefined,\n\tfallbackPalette: readonly string[],\n\tpluginName: string,\n): readonly string[] {\n\tif (!colors || colors.length === 0) return fallbackPalette;\n\n\tconst invalid: string[] = colors.filter((c) => !isValidHexColor(c));\n\tif (invalid.length > 0) {\n\t\tthrow new Error(\n\t\t\t`${pluginName}: invalid hex color(s): ${invalid.join(', ')}. Expected format: #RGB or #RRGGBB.`,\n\t\t);\n\t}\n\n\tconst seen: Set<string> = new Set();\n\tconst unique: string[] = [];\n\tfor (const color of colors) {\n\t\tconst normalized: string = color.toLowerCase();\n\t\tif (!seen.has(normalized)) {\n\t\t\tseen.add(normalized);\n\t\t\tunique.push(normalized);\n\t\t}\n\t}\n\treturn unique;\n}\n\n// --- Font Family Validation ---\n\n/** Characters that are never valid in a CSS font-family value. */\nconst FONT_FAMILY_FORBIDDEN: RegExp = /[{}<>;]|url\\(|expression\\(/i;\n\n/**\n * Returns `true` when `value` is a safe CSS `font-family` value.\n * Rejects values containing `{`, `}`, `;`, `<`, `>`, `url(`, or `expression(`\n * to defend against CSS injection.\n */\nexport function isValidCSSFontFamily(value: string): boolean {\n\tif (!value) return false;\n\tconst trimmed: string = value.trim();\n\tif (!trimmed) return false;\n\treturn !FONT_FAMILY_FORBIDDEN.test(trimmed);\n}\n\n// --- Font Size Validation ---\n\n/** Matches valid CSS font-size values: number with unit (px, pt, em, rem, %). */\nconst FONT_SIZE_PATTERN: RegExp = /^\\d+(\\.\\d+)?(px|pt|em|rem|%)$/i;\n\n/**\n * Returns `true` when `value` is a safe CSS `font-size` value.\n * Accepts values like `16px`, `1.5em`, `12pt`, `100%`, `0.875rem`.\n */\nexport function isValidCSSFontSize(value: string): boolean {\n\tif (!value) return false;\n\treturn FONT_SIZE_PATTERN.test(value.trim());\n}\n"],"mappings":"AAKA,IAAM,EAA4B,gCAGlC,SAAgB,EAAgB,GAC/B,OAAO,EAAkB,KAAK,GAM/B,IAAM,EACL,yEAGK,EACL,gFAMK,EAAwC,IAAI,IAAI,CACrD,YACA,eACA,OACA,aACA,QACA,QACA,SACA,QACA,iBACA,OACA,aACA,QACA,YACA,YACA,aACA,YACA,QACA,iBACA,WACA,UACA,OACA,WACA,WACA,gBACA,WACA,YACA,WACA,YACA,cACA,iBACA,aACA,aACA,UACA,aACA,eACA,gBACA,gBACA,gBACA,gBACA,aACA,WACA,cACA,UACA,UACA,aACA,YACA,cACA,cACA,UACA,YACA,aACA,OACA,YACA,OACA,QACA,cACA,OACA,WACA,UACA,YACA,SACA,QACA,QACA,WACA,gBACA,YACA,eACA,YACA,aACA,YACA,uBACA,YACA,aACA,YACA,YACA,cACA,gBACA,eACA,iBACA,iBACA,iBACA,cACA,OACA,YACA,QACA,UACA,SACA,mBACA,aACA,eACA,eACA,iBACA,kBACA,oBACA,kBACA,kBACA,eACA,YACA,YACA,WACA,cACA,OACA,UACA,QACA,YACA,SACA,YACA,SACA,gBACA,YACA,gBACA,gBACA,aACA,YACA,OACA,OACA,OACA,aACA,SACA,gBACA,MACA,YACA,YACA,cACA,SACA,aACA,WACA,WACA,SACA,SACA,UACA,YACA,YACA,YACA,OACA,cACA,YACA,MACA,OACA,UACA,SACA,cACA,YACA,SACA,QACA,QACA,aACA,SACA,gBASD,SAAgB,EAAgB,GAC/B,IAAK,EAAO,OAAO,EACnB,MAAM,EAAkB,EAAM,OAAO,cACrC,QAAK,IAGJ,EAAkB,KAAK,IACvB,EAAY,KAAK,IACjB,EAAY,KAAK,IACjB,EAAiB,IAAI,IAUvB,SAAgB,EACf,EACA,EACA,GAEA,IAAK,GAA4B,IAAlB,EAAO,OAAc,OAAO,EAE3C,MAAM,EAAoB,EAAO,OAAQ,IAAO,EAAgB,IAChE,GAAI,EAAQ,OAAS,EACpB,MAAM,IAAI,MACT,GAAG,4BAAqC,EAAQ,KAAK,4CAIvD,MAAM,iBAAoB,IAAI,IACxB,EAAmB,GACzB,IAAK,MAAM,KAAS,EAAQ,CAC3B,MAAM,EAAqB,EAAM,cAC5B,EAAK,IAAI,KACb,EAAK,IAAI,GACT,EAAO,KAAK,IAGd,OAAO,EAMR,IAAM,EAAgC,8BAOtC,SAAgB,EAAqB,GACpC,IAAK,EAAO,OAAO,EACnB,MAAM,EAAkB,EAAM,OAC9B,QAAK,IACG,EAAsB,KAAK,GAMpC,IAAM,EAA4B,iCAMlC,SAAgB,EAAmB,GAClC,QAAK,GACE,EAAkB,KAAK,EAAM"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as n,x as t,y as r}from"./Document-DJmYYuBx.mjs";import{d as o,o as e,r as i,t as c}from"./Selection-aeiSsvhe.mjs";import{i as s}from"./NavigationQueries-DhptdQBe.mjs";function f(n,t){if(0===t.length)return n.doc.children;const r=n.getBlock(t[t.length-1]);return r?r.children:[]}function u(n,t){if(e(n))return{blockId:n.anchor.blockId,offset:n.anchor.offset};const r=o(n,t);return{blockId:r.from.blockId,offset:r.from.offset}}function l(n){return n&&n.length>1?n.slice(0,-1):[]}function a(n,t){return n.findIndex(n=>r(n)&&n.id===t)}function d(n){if(t(n))return n.id;for(const t of n.children)if(r(t))return d(t);return n.id}function h(n){if(t(n))return n.id;for(let t=n.children.length-1;t>=0;t--){const o=n.children[t];if(o&&r(o))return h(o)}return n.id}function m(t,r,o){const e=t.getBlock(r);if(!e)return null;if(s(t,r)){const n=t.getNodePath(r);return n?i(r,n):null}const f="start"===o?d(e):h(e),u=t.getBlock(f);return u?c(f,"start"===o?0:n(u)):null}function g(n,t,o){const e=n.doc.children,i="start"===t?e.map((n,t)=>t):e.map((n,t)=>e.length-1-t);for(const c of i){const i=e[c];if(!i||!r(i))continue;if(void 0!==o&&i.id===o)continue;const s=m(n,i.id,t);if(s)return s}return null}export{h as a,u as c,d as i,g as n,a as o,l as r,f as s,m as t};
|
|
2
|
+
//# sourceMappingURL=CommandHelpers-BqHfwW7i.mjs.map
|