@notectl/core 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/AlignmentPlugin-CjmLXGsv.mjs +2 -0
- package/dist/chunks/AlignmentPlugin-CjmLXGsv.mjs.map +1 -0
- package/dist/chunks/AttrRegistry-cXq6uQK2.mjs +2 -0
- package/dist/chunks/AttrRegistry-cXq6uQK2.mjs.map +1 -0
- package/dist/chunks/AttributedMarkCommands-Ctt_1xRD.mjs +2 -0
- package/dist/chunks/AttributedMarkCommands-Ctt_1xRD.mjs.map +1 -0
- package/dist/chunks/BidiIsolationPlugin-q3zoofgZ.mjs +2 -0
- package/dist/chunks/BidiIsolationPlugin-q3zoofgZ.mjs.map +1 -0
- package/dist/chunks/BlockInsertion-4QmiYRMo.mjs +2 -0
- package/dist/chunks/BlockInsertion-4QmiYRMo.mjs.map +1 -0
- package/dist/chunks/BlockTypePickerRegistry-DgI_LlNO.mjs +2 -0
- package/dist/chunks/BlockTypePickerRegistry-DgI_LlNO.mjs.map +1 -0
- package/dist/chunks/BlockquotePlugin-BTsDYB3K.mjs +2 -0
- package/dist/chunks/BlockquotePlugin-BTsDYB3K.mjs.map +1 -0
- package/dist/chunks/CaretNavigationPlugin-BFBov4H7.mjs +2 -0
- package/dist/chunks/CaretNavigationPlugin-BFBov4H7.mjs.map +1 -0
- package/dist/chunks/CodeBlockPlugin-o0Aoq9Nu.mjs +2 -0
- package/dist/chunks/CodeBlockPlugin-o0Aoq9Nu.mjs.map +1 -0
- package/dist/chunks/ColorGrid-U5NtjqyV.mjs +2 -0
- package/dist/chunks/ColorGrid-U5NtjqyV.mjs.map +1 -0
- package/dist/chunks/ColorPickerPopup-BYSMUZZx.mjs +2 -0
- package/dist/chunks/ColorPickerPopup-BYSMUZZx.mjs.map +1 -0
- package/dist/chunks/ColorValidation-3viVw_tK.mjs +2 -0
- package/dist/chunks/ColorValidation-3viVw_tK.mjs.map +1 -0
- package/dist/chunks/CommandHelpers-BqHfwW7i.mjs +2 -0
- package/dist/chunks/CommandHelpers-BqHfwW7i.mjs.map +1 -0
- package/dist/chunks/Commands-BC_EPIEx.mjs +2 -0
- package/dist/chunks/Commands-BC_EPIEx.mjs.map +1 -0
- package/dist/chunks/Decoration-BeTkTHRO.mjs +2 -0
- package/dist/chunks/Decoration-BeTkTHRO.mjs.map +1 -0
- package/dist/chunks/DirectionDetection-kAewerPz.mjs +2 -0
- package/dist/chunks/DirectionDetection-kAewerPz.mjs.map +1 -0
- package/dist/chunks/DirectionIcons-BQHHAEYU.mjs +2 -0
- package/dist/chunks/DirectionIcons-BQHHAEYU.mjs.map +1 -0
- package/dist/chunks/Document-DJmYYuBx.mjs +2 -0
- package/dist/chunks/Document-DJmYYuBx.mjs.map +1 -0
- package/dist/chunks/DocumentParser-D2hn-48i.mjs +2 -0
- package/dist/chunks/DocumentParser-D2hn-48i.mjs.map +1 -0
- package/dist/chunks/FontPlugin-TmUrcVn1.mjs +2 -0
- package/dist/chunks/FontPlugin-TmUrcVn1.mjs.map +1 -0
- package/dist/chunks/FontSizePlugin-Bwui7gLI.mjs +2 -0
- package/dist/chunks/FontSizePlugin-Bwui7gLI.mjs.map +1 -0
- package/dist/chunks/GapCursorNavigation-BEO5L2-O.mjs +2 -0
- package/dist/chunks/GapCursorNavigation-BEO5L2-O.mjs.map +1 -0
- package/dist/chunks/GapCursorPlugin-BiZQyVrJ.mjs +2 -0
- package/dist/chunks/GapCursorPlugin-BiZQyVrJ.mjs.map +1 -0
- package/dist/chunks/HardBreakPlugin-Dj4pkSk-.mjs +2 -0
- package/dist/chunks/HardBreakPlugin-Dj4pkSk-.mjs.map +1 -0
- package/dist/chunks/HeadingPlugin-D8xIRk25.mjs +2 -0
- package/dist/chunks/HeadingPlugin-D8xIRk25.mjs.map +1 -0
- package/dist/chunks/HighlightPlugin-CNX7lup0.mjs +2 -0
- package/dist/chunks/HighlightPlugin-CNX7lup0.mjs.map +1 -0
- package/dist/chunks/HorizontalRulePlugin-D-ZjKGDv.mjs +2 -0
- package/dist/chunks/HorizontalRulePlugin-D-ZjKGDv.mjs.map +1 -0
- package/dist/chunks/ImagePlugin-DwL8i3pO.mjs +2 -0
- package/dist/chunks/ImagePlugin-DwL8i3pO.mjs.map +1 -0
- package/dist/chunks/InlineCodePlugin-BpXNuKAa.mjs +2 -0
- package/dist/chunks/InlineCodePlugin-BpXNuKAa.mjs.map +1 -0
- package/dist/chunks/KeyboardNav-BZIHDPDV.mjs +2 -0
- package/dist/chunks/KeyboardNav-BZIHDPDV.mjs.map +1 -0
- package/dist/chunks/LinkPlugin-BK15pc0u.mjs +2 -0
- package/dist/chunks/LinkPlugin-BK15pc0u.mjs.map +1 -0
- package/dist/chunks/ListPlugin-B5ihlVNx.mjs +2 -0
- package/dist/chunks/ListPlugin-B5ihlVNx.mjs.map +1 -0
- package/dist/chunks/NavigationQueries-DhptdQBe.mjs +2 -0
- package/dist/chunks/NavigationQueries-DhptdQBe.mjs.map +1 -0
- package/dist/chunks/NodeSelectionCommands-DenSYOfB.mjs +2 -0
- package/dist/chunks/NodeSelectionCommands-DenSYOfB.mjs.map +1 -0
- package/dist/chunks/PluginHelpers-BZphovwz.mjs +2 -0
- package/dist/chunks/PluginHelpers-BZphovwz.mjs.map +1 -0
- package/dist/chunks/PopupKeyboardPatterns-CgUM5kPf.mjs +2 -0
- package/dist/chunks/PopupKeyboardPatterns-CgUM5kPf.mjs.map +1 -0
- package/dist/chunks/PopupManager-B5SHhDsx.mjs +2 -0
- package/dist/chunks/PopupManager-B5SHhDsx.mjs.map +1 -0
- package/dist/chunks/PopupPositioning-BfahfPOm.mjs +2 -0
- package/dist/chunks/PopupPositioning-BfahfPOm.mjs.map +1 -0
- package/dist/chunks/PrintPlugin-CckjtZ9B.mjs +2 -0
- package/dist/chunks/PrintPlugin-CckjtZ9B.mjs.map +1 -0
- package/dist/chunks/PrintTypes-Ci3XW_s8.mjs +2 -0
- package/dist/chunks/PrintTypes-Ci3XW_s8.mjs.map +1 -0
- package/dist/chunks/RangeIterator-ZooGMxGy.mjs +2 -0
- package/dist/chunks/RangeIterator-ZooGMxGy.mjs.map +1 -0
- package/dist/chunks/ShortcutFormatting-DQPMvupx.mjs +2 -0
- package/dist/chunks/ShortcutFormatting-DQPMvupx.mjs.map +1 -0
- package/dist/chunks/SmartPastePlugin-B_zi9WT9.mjs +2 -0
- package/dist/chunks/SmartPastePlugin-B_zi9WT9.mjs.map +1 -0
- package/dist/chunks/StrikethroughPlugin-2XDKYefG.mjs +2 -0
- package/dist/chunks/StrikethroughPlugin-2XDKYefG.mjs.map +1 -0
- package/dist/chunks/SuperSubPlugin-6gdrjKZv.mjs +2 -0
- package/dist/chunks/SuperSubPlugin-6gdrjKZv.mjs.map +1 -0
- package/dist/chunks/SyntaxTokenTypes-DZwhanGO.mjs +2 -0
- package/dist/chunks/SyntaxTokenTypes-DZwhanGO.mjs.map +1 -0
- package/dist/chunks/TablePlugin-DW78Y4pB.mjs +2 -0
- package/dist/chunks/TablePlugin-DW78Y4pB.mjs.map +1 -0
- package/dist/chunks/TextColorPlugin-CgHro45N.mjs +2 -0
- package/dist/chunks/TextColorPlugin-CgHro45N.mjs.map +1 -0
- package/dist/chunks/TextDirectionAutoPlugin-C88ZeXJo.mjs +2 -0
- package/dist/chunks/TextDirectionAutoPlugin-C88ZeXJo.mjs.map +1 -0
- package/dist/chunks/TextDirectionPlugin-BTTqrWbL.mjs +2 -0
- package/dist/chunks/TextDirectionPlugin-BTTqrWbL.mjs.map +1 -0
- package/dist/chunks/TextDirectionService-DzuOMFm8.mjs +2 -0
- package/dist/chunks/TextDirectionService-DzuOMFm8.mjs.map +1 -0
- package/dist/chunks/TextFormattingPlugin-BD4Qlpls.mjs +2 -0
- package/dist/chunks/TextFormattingPlugin-BD4Qlpls.mjs.map +1 -0
- package/dist/chunks/ToolbarPlugin-D5_-gWmH.mjs +2 -0
- package/dist/chunks/ToolbarPlugin-D5_-gWmH.mjs.map +1 -0
- package/dist/chunks/WordBoundary-Cz2bSRAU.mjs +2 -0
- package/dist/chunks/WordBoundary-Cz2bSRAU.mjs.map +1 -0
- package/dist/chunks/XmlDetector-DM-Vv-XW.mjs +2 -0
- package/dist/chunks/XmlDetector-DM-Vv-XW.mjs.map +1 -0
- package/dist/chunks/XmlPatterns-B-V-mHF4.mjs +2 -0
- package/dist/chunks/XmlPatterns-B-V-mHF4.mjs.map +1 -0
- package/dist/chunks/XmlSupport-Dr1S1HN9.mjs +2 -0
- package/dist/chunks/XmlSupport-Dr1S1HN9.mjs.map +1 -0
- package/dist/chunks/ar-4r3DgNTY.mjs +2 -0
- package/dist/chunks/ar-4r3DgNTY.mjs.map +1 -0
- package/dist/chunks/ar-7EtzKNIe.mjs +2 -0
- package/dist/chunks/ar-7EtzKNIe.mjs.map +1 -0
- package/dist/chunks/ar-B2pDI_LT.mjs +2 -0
- package/dist/chunks/ar-B2pDI_LT.mjs.map +1 -0
- package/dist/chunks/ar-BV6-zQd7.mjs +2 -0
- package/dist/chunks/ar-BV6-zQd7.mjs.map +1 -0
- package/dist/chunks/ar-BaCL4Bzy.mjs +2 -0
- package/dist/chunks/ar-BaCL4Bzy.mjs.map +1 -0
- package/dist/chunks/ar-BdGHrLSw.mjs +2 -0
- package/dist/chunks/ar-BdGHrLSw.mjs.map +1 -0
- package/dist/chunks/ar-BwYDKOvO.mjs +2 -0
- package/dist/chunks/ar-BwYDKOvO.mjs.map +1 -0
- package/dist/chunks/ar-C5eLSf71.mjs +2 -0
- package/dist/chunks/ar-C5eLSf71.mjs.map +1 -0
- package/dist/chunks/ar-CEUn6f7s.mjs +2 -0
- package/dist/chunks/ar-CEUn6f7s.mjs.map +1 -0
- package/dist/chunks/ar-CGYb1t6O.mjs +2 -0
- package/dist/chunks/ar-CGYb1t6O.mjs.map +1 -0
- package/dist/chunks/ar-CjK36QZ9.mjs +2 -0
- package/dist/chunks/ar-CjK36QZ9.mjs.map +1 -0
- package/dist/chunks/ar-D9jfC3WF.mjs +2 -0
- package/dist/chunks/ar-D9jfC3WF.mjs.map +1 -0
- package/dist/chunks/ar-DFeA_UxF.mjs +2 -0
- package/dist/chunks/ar-DFeA_UxF.mjs.map +1 -0
- package/dist/chunks/ar-DMuawOHV.mjs +2 -0
- package/dist/chunks/ar-DMuawOHV.mjs.map +1 -0
- package/dist/chunks/ar-DV30sa3s.mjs +2 -0
- package/dist/chunks/ar-DV30sa3s.mjs.map +1 -0
- package/dist/chunks/ar-DWwG54pa.mjs +2 -0
- package/dist/chunks/ar-DWwG54pa.mjs.map +1 -0
- package/dist/chunks/ar-DcJbUbml.mjs +2 -0
- package/dist/chunks/ar-DcJbUbml.mjs.map +1 -0
- package/dist/chunks/ar-DelI54_I.mjs +2 -0
- package/dist/chunks/ar-DelI54_I.mjs.map +1 -0
- package/dist/chunks/ar-DmqFnvxC.mjs +2 -0
- package/dist/chunks/ar-DmqFnvxC.mjs.map +1 -0
- package/dist/chunks/ar-DpEHjBUk.mjs +2 -0
- package/dist/chunks/ar-DpEHjBUk.mjs.map +1 -0
- package/dist/chunks/ar-EnfTpUuB.mjs +2 -0
- package/dist/chunks/ar-EnfTpUuB.mjs.map +1 -0
- package/dist/chunks/ar-ZHVy9O4c.mjs +2 -0
- package/dist/chunks/ar-ZHVy9O4c.mjs.map +1 -0
- package/dist/chunks/ar-_7aFyBGi.mjs +2 -0
- package/dist/chunks/ar-_7aFyBGi.mjs.map +1 -0
- package/dist/chunks/ar-l75rG_xT.mjs +2 -0
- package/dist/chunks/ar-l75rG_xT.mjs.map +1 -0
- package/dist/chunks/ar-qU1PohHA.mjs +2 -0
- package/dist/chunks/ar-qU1PohHA.mjs.map +1 -0
- package/dist/chunks/color-picker-BTex2Cfu.mjs +2 -0
- package/dist/chunks/color-picker-BTex2Cfu.mjs.map +1 -0
- package/dist/chunks/de-BDfimoiQ.mjs +2 -0
- package/dist/chunks/de-BDfimoiQ.mjs.map +1 -0
- package/dist/chunks/de-BSkOdXQZ.mjs +2 -0
- package/dist/chunks/de-BSkOdXQZ.mjs.map +1 -0
- package/dist/chunks/de-BooQr0-C.mjs +2 -0
- package/dist/chunks/de-BooQr0-C.mjs.map +1 -0
- package/dist/chunks/de-ByvLzlOc.mjs +2 -0
- package/dist/chunks/de-ByvLzlOc.mjs.map +1 -0
- package/dist/chunks/de-C03n6uR5.mjs +2 -0
- package/dist/chunks/de-C03n6uR5.mjs.map +1 -0
- package/dist/chunks/de-C0TfkuUd.mjs +2 -0
- package/dist/chunks/de-C0TfkuUd.mjs.map +1 -0
- package/dist/chunks/de-C0khkRSC.mjs +2 -0
- package/dist/chunks/de-C0khkRSC.mjs.map +1 -0
- package/dist/chunks/de-C4IW4BVo.mjs +2 -0
- package/dist/chunks/de-C4IW4BVo.mjs.map +1 -0
- package/dist/chunks/de-CDSG9CMy.mjs +2 -0
- package/dist/chunks/de-CDSG9CMy.mjs.map +1 -0
- package/dist/chunks/de-CkIwUE6R.mjs +2 -0
- package/dist/chunks/de-CkIwUE6R.mjs.map +1 -0
- package/dist/chunks/de-CmJ9oOiP.mjs +2 -0
- package/dist/chunks/de-CmJ9oOiP.mjs.map +1 -0
- package/dist/chunks/de-CrjOjB4F.mjs +2 -0
- package/dist/chunks/de-CrjOjB4F.mjs.map +1 -0
- package/dist/chunks/de-D5_uflBY.mjs +2 -0
- package/dist/chunks/de-D5_uflBY.mjs.map +1 -0
- package/dist/chunks/de-DH5zRyrS.mjs +2 -0
- package/dist/chunks/de-DH5zRyrS.mjs.map +1 -0
- package/dist/chunks/de-DJqgaz5N.mjs +2 -0
- package/dist/chunks/de-DJqgaz5N.mjs.map +1 -0
- package/dist/chunks/de-DMiAi5QJ.mjs +2 -0
- package/dist/chunks/de-DMiAi5QJ.mjs.map +1 -0
- package/dist/chunks/de-DT6VbHNl.mjs +2 -0
- package/dist/chunks/de-DT6VbHNl.mjs.map +1 -0
- package/dist/chunks/de-DbqObFs9.mjs +2 -0
- package/dist/chunks/de-DbqObFs9.mjs.map +1 -0
- package/dist/chunks/de-Dl0svzeh.mjs +2 -0
- package/dist/chunks/de-Dl0svzeh.mjs.map +1 -0
- package/dist/chunks/de-DzMY3LLH.mjs +2 -0
- package/dist/chunks/de-DzMY3LLH.mjs.map +1 -0
- package/dist/chunks/de-JGuzWRyC.mjs +2 -0
- package/dist/chunks/de-JGuzWRyC.mjs.map +1 -0
- package/dist/chunks/de-MOHX9tl7.mjs +2 -0
- package/dist/chunks/de-MOHX9tl7.mjs.map +1 -0
- package/dist/chunks/de-mtjvG1Li.mjs +2 -0
- package/dist/chunks/de-mtjvG1Li.mjs.map +1 -0
- package/dist/chunks/de-oNyi0r7G.mjs +2 -0
- package/dist/chunks/de-oNyi0r7G.mjs.map +1 -0
- package/dist/chunks/de-y5fJdnH9.mjs +2 -0
- package/dist/chunks/de-y5fJdnH9.mjs.map +1 -0
- package/dist/chunks/es-B-V14ELw.mjs +2 -0
- package/dist/chunks/es-B-V14ELw.mjs.map +1 -0
- package/dist/chunks/es-Bf6WRo_H.mjs +2 -0
- package/dist/chunks/es-Bf6WRo_H.mjs.map +1 -0
- package/dist/chunks/es-Bw9vJu_M.mjs +2 -0
- package/dist/chunks/es-Bw9vJu_M.mjs.map +1 -0
- package/dist/chunks/es-CCdE3xXm.mjs +2 -0
- package/dist/chunks/es-CCdE3xXm.mjs.map +1 -0
- package/dist/chunks/es-CDoZMS8v.mjs +2 -0
- package/dist/chunks/es-CDoZMS8v.mjs.map +1 -0
- package/dist/chunks/es-CO1hBMDj.mjs +2 -0
- package/dist/chunks/es-CO1hBMDj.mjs.map +1 -0
- package/dist/chunks/es-CU2TUgK3.mjs +2 -0
- package/dist/chunks/es-CU2TUgK3.mjs.map +1 -0
- package/dist/chunks/es-CXeJJ2r1.mjs +2 -0
- package/dist/chunks/es-CXeJJ2r1.mjs.map +1 -0
- package/dist/chunks/es-Cc337sYN.mjs +2 -0
- package/dist/chunks/es-Cc337sYN.mjs.map +1 -0
- package/dist/chunks/es-Ck88JtiM.mjs +2 -0
- package/dist/chunks/es-Ck88JtiM.mjs.map +1 -0
- package/dist/chunks/es-CmOFsz0P.mjs +2 -0
- package/dist/chunks/es-CmOFsz0P.mjs.map +1 -0
- package/dist/chunks/es-CpcUYxtO.mjs +2 -0
- package/dist/chunks/es-CpcUYxtO.mjs.map +1 -0
- package/dist/chunks/es-Cqp8LgVd.mjs +2 -0
- package/dist/chunks/es-Cqp8LgVd.mjs.map +1 -0
- package/dist/chunks/es-CsK826Q8.mjs +2 -0
- package/dist/chunks/es-CsK826Q8.mjs.map +1 -0
- package/dist/chunks/es-D7wyE736.mjs +2 -0
- package/dist/chunks/es-D7wyE736.mjs.map +1 -0
- package/dist/chunks/es-DGCoEaRB.mjs +2 -0
- package/dist/chunks/es-DGCoEaRB.mjs.map +1 -0
- package/dist/chunks/es-DPsoXXVT.mjs +2 -0
- package/dist/chunks/es-DPsoXXVT.mjs.map +1 -0
- package/dist/chunks/es-Df2ocRb2.mjs +2 -0
- package/dist/chunks/es-Df2ocRb2.mjs.map +1 -0
- package/dist/chunks/es-DgVSWMPU.mjs +2 -0
- package/dist/chunks/es-DgVSWMPU.mjs.map +1 -0
- package/dist/chunks/es-Dltvy1GA.mjs +2 -0
- package/dist/chunks/es-Dltvy1GA.mjs.map +1 -0
- package/dist/chunks/es-DtElbzrQ.mjs +2 -0
- package/dist/chunks/es-DtElbzrQ.mjs.map +1 -0
- package/dist/chunks/es-ERjP_b2h.mjs +2 -0
- package/dist/chunks/es-ERjP_b2h.mjs.map +1 -0
- package/dist/chunks/es-SN8M8vXY.mjs +2 -0
- package/dist/chunks/es-SN8M8vXY.mjs.map +1 -0
- package/dist/chunks/es-domW6tKg.mjs +2 -0
- package/dist/chunks/es-domW6tKg.mjs.map +1 -0
- package/dist/chunks/es-luS_ivBE.mjs +2 -0
- package/dist/chunks/es-luS_ivBE.mjs.map +1 -0
- package/dist/chunks/fonts-DVgoAAns.mjs +2 -0
- package/dist/chunks/fonts-DVgoAAns.mjs.map +1 -0
- package/dist/chunks/fr-BPa6RyuB.mjs +2 -0
- package/dist/chunks/fr-BPa6RyuB.mjs.map +1 -0
- package/dist/chunks/fr-BYK62vy-.mjs +2 -0
- package/dist/chunks/fr-BYK62vy-.mjs.map +1 -0
- package/dist/chunks/fr-BZH71A1g.mjs +2 -0
- package/dist/chunks/fr-BZH71A1g.mjs.map +1 -0
- package/dist/chunks/fr-BomQM4Qz.mjs +2 -0
- package/dist/chunks/fr-BomQM4Qz.mjs.map +1 -0
- package/dist/chunks/fr-BujOdWeE.mjs +2 -0
- package/dist/chunks/fr-BujOdWeE.mjs.map +1 -0
- package/dist/chunks/fr-C6BCt-Fk.mjs +2 -0
- package/dist/chunks/fr-C6BCt-Fk.mjs.map +1 -0
- package/dist/chunks/fr-C8NXcJOp.mjs +2 -0
- package/dist/chunks/fr-C8NXcJOp.mjs.map +1 -0
- package/dist/chunks/fr-C8aNnvoW.mjs +2 -0
- package/dist/chunks/fr-C8aNnvoW.mjs.map +1 -0
- package/dist/chunks/fr-C8jqjdbQ.mjs +2 -0
- package/dist/chunks/fr-C8jqjdbQ.mjs.map +1 -0
- package/dist/chunks/fr-Cg97syqs.mjs +2 -0
- package/dist/chunks/fr-Cg97syqs.mjs.map +1 -0
- package/dist/chunks/fr-CiT36QA9.mjs +2 -0
- package/dist/chunks/fr-CiT36QA9.mjs.map +1 -0
- package/dist/chunks/fr-D3Ho_0MV.mjs +2 -0
- package/dist/chunks/fr-D3Ho_0MV.mjs.map +1 -0
- package/dist/chunks/fr-DA37dDuJ.mjs +2 -0
- package/dist/chunks/fr-DA37dDuJ.mjs.map +1 -0
- package/dist/chunks/fr-DK9dc8bZ.mjs +2 -0
- package/dist/chunks/fr-DK9dc8bZ.mjs.map +1 -0
- package/dist/chunks/fr-DNA_bC6X.mjs +2 -0
- package/dist/chunks/fr-DNA_bC6X.mjs.map +1 -0
- package/dist/chunks/fr-DPXU2MTy.mjs +2 -0
- package/dist/chunks/fr-DPXU2MTy.mjs.map +1 -0
- package/dist/chunks/fr-DZCsB6H7.mjs +2 -0
- package/dist/chunks/fr-DZCsB6H7.mjs.map +1 -0
- package/dist/chunks/fr-Dd8f28BD.mjs +2 -0
- package/dist/chunks/fr-Dd8f28BD.mjs.map +1 -0
- package/dist/chunks/fr-DmCLgc4F.mjs +2 -0
- package/dist/chunks/fr-DmCLgc4F.mjs.map +1 -0
- package/dist/chunks/fr-DtEXB4RG.mjs +2 -0
- package/dist/chunks/fr-DtEXB4RG.mjs.map +1 -0
- package/dist/chunks/fr-FvGvPlqS.mjs +2 -0
- package/dist/chunks/fr-FvGvPlqS.mjs.map +1 -0
- package/dist/chunks/fr-V3LUcmFE.mjs +2 -0
- package/dist/chunks/fr-V3LUcmFE.mjs.map +1 -0
- package/dist/chunks/fr-eiqXGNgf.mjs +2 -0
- package/dist/chunks/fr-eiqXGNgf.mjs.map +1 -0
- package/dist/chunks/fr-fEWGSNI2.mjs +2 -0
- package/dist/chunks/fr-fEWGSNI2.mjs.map +1 -0
- package/dist/chunks/fr-w23c3SBW.mjs +2 -0
- package/dist/chunks/fr-w23c3SBW.mjs.map +1 -0
- package/dist/chunks/full-yocxIDB8.mjs +2 -0
- package/dist/chunks/full-yocxIDB8.mjs.map +1 -0
- package/dist/chunks/hi-4Xqp7mZC.mjs +2 -0
- package/dist/chunks/hi-4Xqp7mZC.mjs.map +1 -0
- package/dist/chunks/hi-8Eu7f89Y.mjs +2 -0
- package/dist/chunks/hi-8Eu7f89Y.mjs.map +1 -0
- package/dist/chunks/hi-BA9PP8mL.mjs +2 -0
- package/dist/chunks/hi-BA9PP8mL.mjs.map +1 -0
- package/dist/chunks/hi-BLCjECcV.mjs +2 -0
- package/dist/chunks/hi-BLCjECcV.mjs.map +1 -0
- package/dist/chunks/hi-BX9P0764.mjs +2 -0
- package/dist/chunks/hi-BX9P0764.mjs.map +1 -0
- package/dist/chunks/hi-BakCaBYh.mjs +2 -0
- package/dist/chunks/hi-BakCaBYh.mjs.map +1 -0
- package/dist/chunks/hi-BoITZeVd.mjs +2 -0
- package/dist/chunks/hi-BoITZeVd.mjs.map +1 -0
- package/dist/chunks/hi-C3BvlTfV.mjs +2 -0
- package/dist/chunks/hi-C3BvlTfV.mjs.map +1 -0
- package/dist/chunks/hi-C5HGb5IH.mjs +2 -0
- package/dist/chunks/hi-C5HGb5IH.mjs.map +1 -0
- package/dist/chunks/hi-CIpo_sTL.mjs +2 -0
- package/dist/chunks/hi-CIpo_sTL.mjs.map +1 -0
- package/dist/chunks/hi-CWRofsw7.mjs +2 -0
- package/dist/chunks/hi-CWRofsw7.mjs.map +1 -0
- package/dist/chunks/hi-C_eipolR.mjs +2 -0
- package/dist/chunks/hi-C_eipolR.mjs.map +1 -0
- package/dist/chunks/hi-ClaAWR5y.mjs +2 -0
- package/dist/chunks/hi-ClaAWR5y.mjs.map +1 -0
- package/dist/chunks/hi-Cn2ywhVT.mjs +2 -0
- package/dist/chunks/hi-Cn2ywhVT.mjs.map +1 -0
- package/dist/chunks/hi-CrsqMuKk.mjs +2 -0
- package/dist/chunks/hi-CrsqMuKk.mjs.map +1 -0
- package/dist/chunks/hi-D-iC4Hvv.mjs +2 -0
- package/dist/chunks/hi-D-iC4Hvv.mjs.map +1 -0
- package/dist/chunks/hi-DEN9a54c.mjs +2 -0
- package/dist/chunks/hi-DEN9a54c.mjs.map +1 -0
- package/dist/chunks/hi-DK9HmINW.mjs +2 -0
- package/dist/chunks/hi-DK9HmINW.mjs.map +1 -0
- package/dist/chunks/hi-DOnHDEqt.mjs +2 -0
- package/dist/chunks/hi-DOnHDEqt.mjs.map +1 -0
- package/dist/chunks/hi-DY0SGobQ.mjs +2 -0
- package/dist/chunks/hi-DY0SGobQ.mjs.map +1 -0
- package/dist/chunks/hi-FSXMWIXU.mjs +2 -0
- package/dist/chunks/hi-FSXMWIXU.mjs.map +1 -0
- package/dist/chunks/hi-JroSY-2k.mjs +2 -0
- package/dist/chunks/hi-JroSY-2k.mjs.map +1 -0
- package/dist/chunks/hi-WDIZzgAJ.mjs +2 -0
- package/dist/chunks/hi-WDIZzgAJ.mjs.map +1 -0
- package/dist/chunks/hi-fLLnVGix.mjs +2 -0
- package/dist/chunks/hi-fLLnVGix.mjs.map +1 -0
- package/dist/chunks/hi-f_MCrd2N.mjs +2 -0
- package/dist/chunks/hi-f_MCrd2N.mjs.map +1 -0
- package/dist/chunks/minimal-BL3kgYy-.mjs +2 -0
- package/dist/chunks/minimal-BL3kgYy-.mjs.map +1 -0
- package/dist/chunks/pt-206lqjCP.mjs +2 -0
- package/dist/chunks/pt-206lqjCP.mjs.map +1 -0
- package/dist/chunks/pt-B5wz6m3c.mjs +2 -0
- package/dist/chunks/pt-B5wz6m3c.mjs.map +1 -0
- package/dist/chunks/pt-B6KMxxw4.mjs +2 -0
- package/dist/chunks/pt-B6KMxxw4.mjs.map +1 -0
- package/dist/chunks/pt-BCg3YzEh.mjs +2 -0
- package/dist/chunks/pt-BCg3YzEh.mjs.map +1 -0
- package/dist/chunks/pt-BFr-zfd2.mjs +2 -0
- package/dist/chunks/pt-BFr-zfd2.mjs.map +1 -0
- package/dist/chunks/pt-BG1fIcHV.mjs +2 -0
- package/dist/chunks/pt-BG1fIcHV.mjs.map +1 -0
- package/dist/chunks/pt-Bhytb-k2.mjs +2 -0
- package/dist/chunks/pt-Bhytb-k2.mjs.map +1 -0
- package/dist/chunks/pt-Bjb6_1gI.mjs +2 -0
- package/dist/chunks/pt-Bjb6_1gI.mjs.map +1 -0
- package/dist/chunks/pt-BzQagqFt.mjs +2 -0
- package/dist/chunks/pt-BzQagqFt.mjs.map +1 -0
- package/dist/chunks/pt-C2rlfcQ4.mjs +2 -0
- package/dist/chunks/pt-C2rlfcQ4.mjs.map +1 -0
- package/dist/chunks/pt-C4xLSFYA.mjs +2 -0
- package/dist/chunks/pt-C4xLSFYA.mjs.map +1 -0
- package/dist/chunks/pt-CBxnU7dE.mjs +2 -0
- package/dist/chunks/pt-CBxnU7dE.mjs.map +1 -0
- package/dist/chunks/pt-CMXLiIJ3.mjs +2 -0
- package/dist/chunks/pt-CMXLiIJ3.mjs.map +1 -0
- package/dist/chunks/pt-Cn2yMIyR.mjs +2 -0
- package/dist/chunks/pt-Cn2yMIyR.mjs.map +1 -0
- package/dist/chunks/pt-DAh8UqJa.mjs +2 -0
- package/dist/chunks/pt-DAh8UqJa.mjs.map +1 -0
- package/dist/chunks/pt-DLe58Npz.mjs +2 -0
- package/dist/chunks/pt-DLe58Npz.mjs.map +1 -0
- package/dist/chunks/pt-D_DXzKyU.mjs +2 -0
- package/dist/chunks/pt-D_DXzKyU.mjs.map +1 -0
- package/dist/chunks/pt-DhC7TYvg.mjs +2 -0
- package/dist/chunks/pt-DhC7TYvg.mjs.map +1 -0
- package/dist/chunks/pt-Dl18NLl1.mjs +2 -0
- package/dist/chunks/pt-Dl18NLl1.mjs.map +1 -0
- package/dist/chunks/pt-Dz2YeCP4.mjs +2 -0
- package/dist/chunks/pt-Dz2YeCP4.mjs.map +1 -0
- package/dist/chunks/pt-GfM-nxvv.mjs +2 -0
- package/dist/chunks/pt-GfM-nxvv.mjs.map +1 -0
- package/dist/chunks/pt-PjsDW8WW.mjs +2 -0
- package/dist/chunks/pt-PjsDW8WW.mjs.map +1 -0
- package/dist/chunks/pt-X-M5uPLn.mjs +2 -0
- package/dist/chunks/pt-X-M5uPLn.mjs.map +1 -0
- package/dist/chunks/pt-appBsYpC.mjs +2 -0
- package/dist/chunks/pt-appBsYpC.mjs.map +1 -0
- package/dist/chunks/pt-i9ZFEE69.mjs +2 -0
- package/dist/chunks/pt-i9ZFEE69.mjs.map +1 -0
- package/dist/chunks/ru-B8HSQCj5.mjs +2 -0
- package/dist/chunks/ru-B8HSQCj5.mjs.map +1 -0
- package/dist/chunks/ru-BAOr7UOh.mjs +2 -0
- package/dist/chunks/ru-BAOr7UOh.mjs.map +1 -0
- package/dist/chunks/ru-BIV3iuR9.mjs +2 -0
- package/dist/chunks/ru-BIV3iuR9.mjs.map +1 -0
- package/dist/chunks/ru-BMJRGir6.mjs +2 -0
- package/dist/chunks/ru-BMJRGir6.mjs.map +1 -0
- package/dist/chunks/ru-BO59Tir1.mjs +2 -0
- package/dist/chunks/ru-BO59Tir1.mjs.map +1 -0
- package/dist/chunks/ru-BRnZSWPo.mjs +2 -0
- package/dist/chunks/ru-BRnZSWPo.mjs.map +1 -0
- package/dist/chunks/ru-Bf546sX_.mjs +2 -0
- package/dist/chunks/ru-Bf546sX_.mjs.map +1 -0
- package/dist/chunks/ru-Bfjq7sha.mjs +2 -0
- package/dist/chunks/ru-Bfjq7sha.mjs.map +1 -0
- package/dist/chunks/ru-Bm8utWf9.mjs +2 -0
- package/dist/chunks/ru-Bm8utWf9.mjs.map +1 -0
- package/dist/chunks/ru-BmneOLgh.mjs +2 -0
- package/dist/chunks/ru-BmneOLgh.mjs.map +1 -0
- package/dist/chunks/ru-Byrj1o3C.mjs +2 -0
- package/dist/chunks/ru-Byrj1o3C.mjs.map +1 -0
- package/dist/chunks/ru-C8ftQh9b.mjs +2 -0
- package/dist/chunks/ru-C8ftQh9b.mjs.map +1 -0
- package/dist/chunks/ru-CNjcfDD9.mjs +2 -0
- package/dist/chunks/ru-CNjcfDD9.mjs.map +1 -0
- package/dist/chunks/ru-Ccya5aSC.mjs +2 -0
- package/dist/chunks/ru-Ccya5aSC.mjs.map +1 -0
- package/dist/chunks/ru-Cd-mH9wa.mjs +2 -0
- package/dist/chunks/ru-Cd-mH9wa.mjs.map +1 -0
- package/dist/chunks/ru-CeZe9jTZ.mjs +2 -0
- package/dist/chunks/ru-CeZe9jTZ.mjs.map +1 -0
- package/dist/chunks/ru-Cl03u8Q0.mjs +2 -0
- package/dist/chunks/ru-Cl03u8Q0.mjs.map +1 -0
- package/dist/chunks/ru-CoCIIElm.mjs +2 -0
- package/dist/chunks/ru-CoCIIElm.mjs.map +1 -0
- package/dist/chunks/ru-CzUyZZmy.mjs +2 -0
- package/dist/chunks/ru-CzUyZZmy.mjs.map +1 -0
- package/dist/chunks/ru-D3fRdonc.mjs +2 -0
- package/dist/chunks/ru-D3fRdonc.mjs.map +1 -0
- package/dist/chunks/ru-Ddy9ONaX.mjs +2 -0
- package/dist/chunks/ru-Ddy9ONaX.mjs.map +1 -0
- package/dist/chunks/ru-Dgcyz845.mjs +2 -0
- package/dist/chunks/ru-Dgcyz845.mjs.map +1 -0
- package/dist/chunks/ru-DnIXvlfL.mjs +2 -0
- package/dist/chunks/ru-DnIXvlfL.mjs.map +1 -0
- package/dist/chunks/ru-DyBnSwCM.mjs +2 -0
- package/dist/chunks/ru-DyBnSwCM.mjs.map +1 -0
- package/dist/chunks/ru-i27SgAts.mjs +2 -0
- package/dist/chunks/ru-i27SgAts.mjs.map +1 -0
- package/dist/chunks/src-DfK2_MVH.mjs +2 -0
- package/dist/chunks/src-DfK2_MVH.mjs.map +1 -0
- package/dist/chunks/zh-6QoY3dY_.mjs +2 -0
- package/dist/chunks/zh-6QoY3dY_.mjs.map +1 -0
- package/dist/chunks/zh-9WLieF9N.mjs +2 -0
- package/dist/chunks/zh-9WLieF9N.mjs.map +1 -0
- package/dist/chunks/zh-B0VaFyeQ.mjs +2 -0
- package/dist/chunks/zh-B0VaFyeQ.mjs.map +1 -0
- package/dist/chunks/zh-B4pfqHD3.mjs +2 -0
- package/dist/chunks/zh-B4pfqHD3.mjs.map +1 -0
- package/dist/chunks/zh-BpaN1Nmc.mjs +2 -0
- package/dist/chunks/zh-BpaN1Nmc.mjs.map +1 -0
- package/dist/chunks/zh-BqCL2eZf.mjs +2 -0
- package/dist/chunks/zh-BqCL2eZf.mjs.map +1 -0
- package/dist/chunks/zh-Bvgb-e4z.mjs +2 -0
- package/dist/chunks/zh-Bvgb-e4z.mjs.map +1 -0
- package/dist/chunks/zh-C2by0u64.mjs +2 -0
- package/dist/chunks/zh-C2by0u64.mjs.map +1 -0
- package/dist/chunks/zh-C4Ia0Zrx.mjs +2 -0
- package/dist/chunks/zh-C4Ia0Zrx.mjs.map +1 -0
- package/dist/chunks/zh-CBHCLph7.mjs +2 -0
- package/dist/chunks/zh-CBHCLph7.mjs.map +1 -0
- package/dist/chunks/zh-CBJQlvWb.mjs +2 -0
- package/dist/chunks/zh-CBJQlvWb.mjs.map +1 -0
- package/dist/chunks/zh-CBNSrvly.mjs +2 -0
- package/dist/chunks/zh-CBNSrvly.mjs.map +1 -0
- package/dist/chunks/zh-CKEh4EwR.mjs +2 -0
- package/dist/chunks/zh-CKEh4EwR.mjs.map +1 -0
- package/dist/chunks/zh-CN8KiZ9v.mjs +2 -0
- package/dist/chunks/zh-CN8KiZ9v.mjs.map +1 -0
- package/dist/chunks/zh-CRJMQ4dT.mjs +2 -0
- package/dist/chunks/zh-CRJMQ4dT.mjs.map +1 -0
- package/dist/chunks/zh-CSg0qxe0.mjs +2 -0
- package/dist/chunks/zh-CSg0qxe0.mjs.map +1 -0
- package/dist/chunks/zh-CX7Bx0ia.mjs +2 -0
- package/dist/chunks/zh-CX7Bx0ia.mjs.map +1 -0
- package/dist/chunks/zh-CvlL1G9n.mjs +2 -0
- package/dist/chunks/zh-CvlL1G9n.mjs.map +1 -0
- package/dist/chunks/zh-DBKn0pzM.mjs +2 -0
- package/dist/chunks/zh-DBKn0pzM.mjs.map +1 -0
- package/dist/chunks/zh-DLOng8d-.mjs +2 -0
- package/dist/chunks/zh-DLOng8d-.mjs.map +1 -0
- package/dist/chunks/zh-DLVkXfcI.mjs +2 -0
- package/dist/chunks/zh-DLVkXfcI.mjs.map +1 -0
- package/dist/chunks/zh-DuaKGwyq.mjs +2 -0
- package/dist/chunks/zh-DuaKGwyq.mjs.map +1 -0
- package/dist/chunks/zh-KUnAhArn.mjs +2 -0
- package/dist/chunks/zh-KUnAhArn.mjs.map +1 -0
- package/dist/chunks/zh-wVp_7rfC.mjs +2 -0
- package/dist/chunks/zh-wVp_7rfC.mjs.map +1 -0
- package/dist/chunks/zh-z2wm3EA5.mjs +2 -0
- package/dist/chunks/zh-z2wm3EA5.mjs.map +1 -0
- package/dist/decorations/Decoration.d.ts +6 -0
- package/dist/decorations/Decoration.d.ts.map +1 -1
- package/dist/decorations/PositionMapping.d.ts +13 -3
- package/dist/decorations/PositionMapping.d.ts.map +1 -1
- package/dist/editor/EditorConfig.d.ts +14 -2
- package/dist/editor/EditorConfig.d.ts.map +1 -1
- package/dist/editor/EditorDOM.d.ts.map +1 -1
- package/dist/editor/EditorInitializer.d.ts.map +1 -1
- package/dist/editor/NotectlEditor.d.ts +2 -2
- package/dist/editor/PluginBootstrapper.d.ts.map +1 -1
- package/dist/editor/styles/base.d.ts +1 -1
- package/dist/editor/styles/base.d.ts.map +1 -1
- package/dist/editor/styles/table.d.ts +1 -1
- package/dist/editor/styles/table.d.ts.map +1 -1
- package/dist/editor/styles/toolbar.d.ts +1 -1
- package/dist/editor/styles/toolbar.d.ts.map +1 -1
- package/dist/fonts.mjs +1 -1
- package/dist/full.mjs +1 -1
- package/dist/html.mjs +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/input/InputHandler.d.ts +9 -0
- package/dist/input/InputHandler.d.ts.map +1 -1
- package/dist/input/InputManager.d.ts +2 -0
- package/dist/input/InputManager.d.ts.map +1 -1
- package/dist/model/NodeResolver.d.ts +7 -0
- package/dist/model/NodeResolver.d.ts.map +1 -1
- package/dist/model/TextInputInterceptor.d.ts +21 -0
- package/dist/model/TextInputInterceptor.d.ts.map +1 -0
- package/dist/notectl-core.mjs +1 -1
- package/dist/notectl-core.umd.js +1 -1
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/MiddlewareChain.d.ts +11 -0
- package/dist/plugins/MiddlewareChain.d.ts.map +1 -1
- package/dist/plugins/Plugin.d.ts +7 -0
- package/dist/plugins/Plugin.d.ts.map +1 -1
- package/dist/plugins/PluginContextFactory.d.ts +6 -0
- package/dist/plugins/PluginContextFactory.d.ts.map +1 -1
- package/dist/plugins/PluginManager.d.ts +5 -0
- package/dist/plugins/PluginManager.d.ts.map +1 -1
- package/dist/plugins/RegistrationTracker.d.ts.map +1 -1
- package/dist/plugins/alignment.mjs +1 -1
- package/dist/plugins/bidi-isolation.mjs +1 -1
- package/dist/plugins/blockquote/BlockquotePlugin.d.ts.map +1 -1
- package/dist/plugins/blockquote/BlockquoteStyles.d.ts +1 -1
- package/dist/plugins/blockquote/BlockquoteStyles.d.ts.map +1 -1
- package/dist/plugins/blockquote.mjs +1 -1
- package/dist/plugins/caret-navigation.mjs +1 -1
- package/dist/plugins/code-block/BracketPairing.d.ts +49 -0
- package/dist/plugins/code-block/BracketPairing.d.ts.map +1 -0
- package/dist/plugins/code-block/CodeBlockKeyboardHandlers.d.ts +11 -2
- package/dist/plugins/code-block/CodeBlockKeyboardHandlers.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockLocale.d.ts +4 -0
- package/dist/plugins/code-block/CodeBlockLocale.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockNodeView.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts +25 -1
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockTypes.d.ts +66 -0
- package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -1
- package/dist/plugins/code-block/IndentHelpers.d.ts +71 -0
- package/dist/plugins/code-block/IndentHelpers.d.ts.map +1 -0
- package/dist/plugins/code-block/PairStack.d.ts +37 -0
- package/dist/plugins/code-block/PairStack.d.ts.map +1 -0
- package/dist/plugins/code-block/highlighter/RegexTokenizer.d.ts.map +1 -1
- package/dist/plugins/code-block/highlighter/TokenIteration.d.ts +18 -0
- package/dist/plugins/code-block/highlighter/TokenIteration.d.ts.map +1 -0
- package/dist/plugins/code-block/highlighter/languages/index.d.ts +1 -0
- package/dist/plugins/code-block/highlighter/languages/index.d.ts.map +1 -1
- package/dist/plugins/code-block/highlighter/languages/java.d.ts.map +1 -1
- package/dist/plugins/code-block/highlighter/languages/typescript.d.ts +3 -0
- package/dist/plugins/code-block/highlighter/languages/typescript.d.ts.map +1 -0
- package/dist/plugins/code-block/index.d.ts +1 -0
- package/dist/plugins/code-block/index.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/ar.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/de.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/es.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/fr.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/hi.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/pt.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/ru.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/zh.d.ts.map +1 -1
- package/dist/plugins/code-block.mjs +1 -1
- package/dist/plugins/font-size.mjs +1 -1
- package/dist/plugins/font.mjs +1 -1
- package/dist/plugins/gap-cursor.mjs +1 -1
- package/dist/plugins/hard-break.mjs +1 -1
- package/dist/plugins/heading.mjs +1 -1
- package/dist/plugins/highlight.mjs +1 -1
- package/dist/plugins/horizontal-rule.mjs +1 -1
- package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
- package/dist/plugins/image/ImagePopup.d.ts.map +1 -1
- package/dist/plugins/image/ImagePopupStyles.d.ts +3 -0
- package/dist/plugins/image/ImagePopupStyles.d.ts.map +1 -0
- package/dist/plugins/image.mjs +1 -1
- package/dist/plugins/inline-code.mjs +1 -1
- package/dist/plugins/language/bundles/JavaSupport.d.ts.map +1 -1
- package/dist/plugins/language/bundles/TypeScriptSupport.d.ts +3 -0
- package/dist/plugins/language/bundles/TypeScriptSupport.d.ts.map +1 -0
- package/dist/plugins/language/bundles/index.d.ts +1 -0
- package/dist/plugins/language/bundles/index.d.ts.map +1 -1
- package/dist/plugins/language/index.d.ts +1 -1
- package/dist/plugins/language/index.d.ts.map +1 -1
- package/dist/plugins/language.mjs +1 -1
- package/dist/plugins/link.mjs +1 -1
- package/dist/plugins/list.mjs +1 -1
- package/dist/plugins/print.mjs +1 -1
- package/dist/plugins/shared.mjs +1 -1
- package/dist/plugins/smart-paste/detectors/DetectionScorer.d.ts +17 -0
- package/dist/plugins/smart-paste/detectors/DetectionScorer.d.ts.map +1 -0
- package/dist/plugins/smart-paste/detectors/LexerDetector.d.ts +36 -0
- package/dist/plugins/smart-paste/detectors/LexerDetector.d.ts.map +1 -0
- package/dist/plugins/smart-paste/detectors/TokenStats.d.ts +44 -0
- package/dist/plugins/smart-paste/detectors/TokenStats.d.ts.map +1 -0
- package/dist/plugins/smart-paste/index.d.ts +3 -1
- package/dist/plugins/smart-paste/index.d.ts.map +1 -1
- package/dist/plugins/smart-paste.mjs +1 -1
- package/dist/plugins/strikethrough.mjs +1 -1
- package/dist/plugins/super-sub.mjs +1 -1
- package/dist/plugins/table/TablePlugin.d.ts.map +1 -1
- package/dist/plugins/table.mjs +1 -1
- package/dist/plugins/text-color.mjs +1 -1
- package/dist/plugins/text-direction-auto.mjs +1 -1
- package/dist/plugins/text-direction.mjs +1 -1
- package/dist/plugins/text-formatting.mjs +1 -1
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts +14 -1
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts +13 -1
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarRenderers.d.ts.map +1 -1
- package/dist/plugins/toolbar/index.d.ts +1 -1
- package/dist/plugins/toolbar/index.d.ts.map +1 -1
- package/dist/plugins/toolbar.mjs +1 -1
- package/dist/presets/full.mjs +1 -1
- package/dist/presets/minimal.mjs +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/state/History.d.ts +20 -0
- package/dist/state/History.d.ts.map +1 -1
- package/dist/state/InlineContentOps.d.ts +30 -0
- package/dist/state/InlineContentOps.d.ts.map +1 -1
- package/dist/state/Mapping.d.ts +261 -0
- package/dist/state/Mapping.d.ts.map +1 -0
- package/dist/state/SelectionMapping.d.ts +25 -0
- package/dist/state/SelectionMapping.d.ts.map +1 -0
- package/dist/state/StepApplication.d.ts +20 -3
- package/dist/state/StepApplication.d.ts.map +1 -1
- package/dist/state/StepHandlers.d.ts +68 -0
- package/dist/state/StepHandlers.d.ts.map +1 -0
- package/dist/state/StepInversion.d.ts +22 -5
- package/dist/state/StepInversion.d.ts.map +1 -1
- package/dist/state/StepMapping.d.ts +18 -0
- package/dist/state/StepMapping.d.ts.map +1 -0
- package/dist/state/StepMaps.d.ts +25 -0
- package/dist/state/StepMaps.d.ts.map +1 -0
- package/dist/state/Steps.d.ts +38 -0
- package/dist/state/Steps.d.ts.map +1 -1
- package/dist/state/Transaction.d.ts +25 -1
- package/dist/state/Transaction.d.ts.map +1 -1
- package/dist/state/TransactionBuilder.d.ts +51 -7
- package/dist/state/TransactionBuilder.d.ts.map +1 -1
- package/dist/test/TestUtils.d.ts +2 -0
- package/dist/test/TestUtils.d.ts.map +1 -1
- package/dist/view/EditorView.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/AlignmentPlugin-bqK6ze-E.mjs +0 -2
- package/dist/chunks/AlignmentPlugin-bqK6ze-E.mjs.map +0 -1
- package/dist/chunks/AttrRegistry-nDKtHK87.mjs +0 -2
- package/dist/chunks/AttrRegistry-nDKtHK87.mjs.map +0 -1
- package/dist/chunks/AttributedMarkCommands-35jTbVRg.mjs +0 -2
- package/dist/chunks/AttributedMarkCommands-35jTbVRg.mjs.map +0 -1
- package/dist/chunks/BidiIsolationPlugin-SIKxfWXp.mjs +0 -2
- package/dist/chunks/BidiIsolationPlugin-SIKxfWXp.mjs.map +0 -1
- package/dist/chunks/BlockInsertion-DsnHLcvM.mjs +0 -2
- package/dist/chunks/BlockInsertion-DsnHLcvM.mjs.map +0 -1
- package/dist/chunks/BlockTypePickerRegistry-C_jLddOz.mjs +0 -2
- package/dist/chunks/BlockTypePickerRegistry-C_jLddOz.mjs.map +0 -1
- package/dist/chunks/BlockquotePlugin-BEaZSoVT.mjs +0 -2
- package/dist/chunks/BlockquotePlugin-BEaZSoVT.mjs.map +0 -1
- package/dist/chunks/CaretNavigationPlugin-DHl61oc6.mjs +0 -2
- package/dist/chunks/CaretNavigationPlugin-DHl61oc6.mjs.map +0 -1
- package/dist/chunks/CodeBlockPlugin-DglqiSNK.mjs +0 -2
- package/dist/chunks/CodeBlockPlugin-DglqiSNK.mjs.map +0 -1
- package/dist/chunks/ColorGrid-Czm0p2E9.mjs +0 -2
- package/dist/chunks/ColorGrid-Czm0p2E9.mjs.map +0 -1
- package/dist/chunks/ColorPickerPopup-CL-W380M.mjs +0 -2
- package/dist/chunks/ColorPickerPopup-CL-W380M.mjs.map +0 -1
- package/dist/chunks/ColorValidation-CiGxVsqd.mjs +0 -2
- package/dist/chunks/ColorValidation-CiGxVsqd.mjs.map +0 -1
- package/dist/chunks/CommandHelpers-DTlQcGv5.mjs +0 -2
- package/dist/chunks/CommandHelpers-DTlQcGv5.mjs.map +0 -1
- package/dist/chunks/Commands-BuYF23lf.mjs +0 -2
- package/dist/chunks/Commands-BuYF23lf.mjs.map +0 -1
- package/dist/chunks/Decoration-oeHDjWWq.mjs +0 -2
- package/dist/chunks/Decoration-oeHDjWWq.mjs.map +0 -1
- package/dist/chunks/DirectionDetection-Hun6-7ER.mjs +0 -2
- package/dist/chunks/DirectionDetection-Hun6-7ER.mjs.map +0 -1
- package/dist/chunks/DirectionIcons-CfaDcQ9a.mjs +0 -2
- package/dist/chunks/DirectionIcons-CfaDcQ9a.mjs.map +0 -1
- package/dist/chunks/Document-_qdGR4vh.mjs +0 -2
- package/dist/chunks/Document-_qdGR4vh.mjs.map +0 -1
- package/dist/chunks/DocumentParser-CyATBOz-.mjs +0 -2
- package/dist/chunks/DocumentParser-CyATBOz-.mjs.map +0 -1
- package/dist/chunks/FontPlugin-B-Sxa0UW.mjs +0 -2
- package/dist/chunks/FontPlugin-B-Sxa0UW.mjs.map +0 -1
- package/dist/chunks/FontSizePlugin-C1zlyXL2.mjs +0 -2
- package/dist/chunks/FontSizePlugin-C1zlyXL2.mjs.map +0 -1
- package/dist/chunks/GapCursorNavigation-BaXDnjFf.mjs +0 -2
- package/dist/chunks/GapCursorNavigation-BaXDnjFf.mjs.map +0 -1
- package/dist/chunks/GapCursorPlugin-nldun8cE.mjs +0 -2
- package/dist/chunks/GapCursorPlugin-nldun8cE.mjs.map +0 -1
- package/dist/chunks/HardBreakPlugin-DZRdsE15.mjs +0 -2
- package/dist/chunks/HardBreakPlugin-DZRdsE15.mjs.map +0 -1
- package/dist/chunks/HeadingPlugin-EPAmsEGt.mjs +0 -2
- package/dist/chunks/HeadingPlugin-EPAmsEGt.mjs.map +0 -1
- package/dist/chunks/HighlightPlugin-RN3l6pVJ.mjs +0 -2
- package/dist/chunks/HighlightPlugin-RN3l6pVJ.mjs.map +0 -1
- package/dist/chunks/HorizontalRulePlugin-BJPXzTtJ.mjs +0 -2
- package/dist/chunks/HorizontalRulePlugin-BJPXzTtJ.mjs.map +0 -1
- package/dist/chunks/ImagePlugin-CCEevNfJ.mjs +0 -2
- package/dist/chunks/ImagePlugin-CCEevNfJ.mjs.map +0 -1
- package/dist/chunks/InlineCodePlugin-B7IOgUSI.mjs +0 -2
- package/dist/chunks/InlineCodePlugin-B7IOgUSI.mjs.map +0 -1
- package/dist/chunks/KeyboardNav-CsdlWnNl.mjs +0 -2
- package/dist/chunks/KeyboardNav-CsdlWnNl.mjs.map +0 -1
- package/dist/chunks/LinkPlugin-Bhwg24lH.mjs +0 -2
- package/dist/chunks/LinkPlugin-Bhwg24lH.mjs.map +0 -1
- package/dist/chunks/ListPlugin-BkG6UO4x.mjs +0 -2
- package/dist/chunks/ListPlugin-BkG6UO4x.mjs.map +0 -1
- package/dist/chunks/NavigationQueries-CgYPG6oY.mjs +0 -2
- package/dist/chunks/NavigationQueries-CgYPG6oY.mjs.map +0 -1
- package/dist/chunks/NodeResolver-DVPpO5nC.mjs +0 -2
- package/dist/chunks/NodeResolver-DVPpO5nC.mjs.map +0 -1
- package/dist/chunks/NodeSelectionCommands-Ddxu5Qck.mjs +0 -2
- package/dist/chunks/NodeSelectionCommands-Ddxu5Qck.mjs.map +0 -1
- package/dist/chunks/PluginHelpers-D-MvWR98.mjs +0 -2
- package/dist/chunks/PluginHelpers-D-MvWR98.mjs.map +0 -1
- package/dist/chunks/PopupKeyboardPatterns-DQdL7RHx.mjs +0 -2
- package/dist/chunks/PopupKeyboardPatterns-DQdL7RHx.mjs.map +0 -1
- package/dist/chunks/PopupManager-CxPzNm-P.mjs +0 -2
- package/dist/chunks/PopupManager-CxPzNm-P.mjs.map +0 -1
- package/dist/chunks/PopupPositioning-DRNwWB0U.mjs +0 -2
- package/dist/chunks/PopupPositioning-DRNwWB0U.mjs.map +0 -1
- package/dist/chunks/PrintPlugin-DOk5IZRO.mjs +0 -2
- package/dist/chunks/PrintPlugin-DOk5IZRO.mjs.map +0 -1
- package/dist/chunks/PrintTypes-Drk6kLcl.mjs +0 -2
- package/dist/chunks/PrintTypes-Drk6kLcl.mjs.map +0 -1
- package/dist/chunks/RangeIterator-DytL1lUT.mjs +0 -2
- package/dist/chunks/RangeIterator-DytL1lUT.mjs.map +0 -1
- package/dist/chunks/ShortcutFormatting-DE6B8iGs.mjs +0 -2
- package/dist/chunks/ShortcutFormatting-DE6B8iGs.mjs.map +0 -1
- package/dist/chunks/SmartPastePlugin-DqKx94sH.mjs +0 -2
- package/dist/chunks/SmartPastePlugin-DqKx94sH.mjs.map +0 -1
- package/dist/chunks/StrikethroughPlugin-vYNzfxdy.mjs +0 -2
- package/dist/chunks/StrikethroughPlugin-vYNzfxdy.mjs.map +0 -1
- package/dist/chunks/SuperSubPlugin-BNsoXWHS.mjs +0 -2
- package/dist/chunks/SuperSubPlugin-BNsoXWHS.mjs.map +0 -1
- package/dist/chunks/SyntaxTokenTypes-CVUAMov0.mjs +0 -2
- package/dist/chunks/SyntaxTokenTypes-CVUAMov0.mjs.map +0 -1
- package/dist/chunks/TablePlugin-R-hmydrM.mjs +0 -2
- package/dist/chunks/TablePlugin-R-hmydrM.mjs.map +0 -1
- package/dist/chunks/TextColorPlugin-DQ-CB9cr.mjs +0 -2
- package/dist/chunks/TextColorPlugin-DQ-CB9cr.mjs.map +0 -1
- package/dist/chunks/TextDirectionAutoPlugin-kZ1tcu0d.mjs +0 -2
- package/dist/chunks/TextDirectionAutoPlugin-kZ1tcu0d.mjs.map +0 -1
- package/dist/chunks/TextDirectionPlugin-Bk3CkbYh.mjs +0 -2
- package/dist/chunks/TextDirectionPlugin-Bk3CkbYh.mjs.map +0 -1
- package/dist/chunks/TextDirectionService-DY4M8EwU.mjs +0 -2
- package/dist/chunks/TextDirectionService-DY4M8EwU.mjs.map +0 -1
- package/dist/chunks/TextFormattingPlugin-D13eP6nF.mjs +0 -2
- package/dist/chunks/TextFormattingPlugin-D13eP6nF.mjs.map +0 -1
- package/dist/chunks/ToolbarPlugin-DeH8n5d2.mjs +0 -2
- package/dist/chunks/ToolbarPlugin-DeH8n5d2.mjs.map +0 -1
- package/dist/chunks/WordBoundary-BE2u997Q.mjs +0 -2
- package/dist/chunks/WordBoundary-BE2u997Q.mjs.map +0 -1
- package/dist/chunks/XmlDetector-BtYxzBDa.mjs +0 -2
- package/dist/chunks/XmlDetector-BtYxzBDa.mjs.map +0 -1
- package/dist/chunks/XmlPatterns-DuP8GWVt.mjs +0 -2
- package/dist/chunks/XmlPatterns-DuP8GWVt.mjs.map +0 -1
- package/dist/chunks/XmlSupport-D54BdAJZ.mjs +0 -2
- package/dist/chunks/XmlSupport-D54BdAJZ.mjs.map +0 -1
- package/dist/chunks/ar-2Fkz_6nI.mjs +0 -2
- package/dist/chunks/ar-2Fkz_6nI.mjs.map +0 -1
- package/dist/chunks/ar-4ZPC8daa.mjs +0 -2
- package/dist/chunks/ar-4ZPC8daa.mjs.map +0 -1
- package/dist/chunks/ar-6I20_Djq.mjs +0 -2
- package/dist/chunks/ar-6I20_Djq.mjs.map +0 -1
- package/dist/chunks/ar-B7-Dm70S.mjs +0 -2
- package/dist/chunks/ar-B7-Dm70S.mjs.map +0 -1
- package/dist/chunks/ar-BRe0t96G.mjs +0 -2
- package/dist/chunks/ar-BRe0t96G.mjs.map +0 -1
- package/dist/chunks/ar-BnNyrtdi.mjs +0 -2
- package/dist/chunks/ar-BnNyrtdi.mjs.map +0 -1
- package/dist/chunks/ar-BsMfhWs5.mjs +0 -2
- package/dist/chunks/ar-BsMfhWs5.mjs.map +0 -1
- package/dist/chunks/ar-Bvja-bjE.mjs +0 -2
- package/dist/chunks/ar-Bvja-bjE.mjs.map +0 -1
- package/dist/chunks/ar-BxVbBvSa.mjs +0 -2
- package/dist/chunks/ar-BxVbBvSa.mjs.map +0 -1
- package/dist/chunks/ar-C5dW-co3.mjs +0 -2
- package/dist/chunks/ar-C5dW-co3.mjs.map +0 -1
- package/dist/chunks/ar-CARMr30L.mjs +0 -2
- package/dist/chunks/ar-CARMr30L.mjs.map +0 -1
- package/dist/chunks/ar-CB-pehGw.mjs +0 -2
- package/dist/chunks/ar-CB-pehGw.mjs.map +0 -1
- package/dist/chunks/ar-CEYgAxTM.mjs +0 -2
- package/dist/chunks/ar-CEYgAxTM.mjs.map +0 -1
- package/dist/chunks/ar-CO60qpZJ.mjs +0 -2
- package/dist/chunks/ar-CO60qpZJ.mjs.map +0 -1
- package/dist/chunks/ar-CtI_snUM.mjs +0 -2
- package/dist/chunks/ar-CtI_snUM.mjs.map +0 -1
- package/dist/chunks/ar-Cv1RQvhK.mjs +0 -2
- package/dist/chunks/ar-Cv1RQvhK.mjs.map +0 -1
- package/dist/chunks/ar-D5jV20Tu.mjs +0 -2
- package/dist/chunks/ar-D5jV20Tu.mjs.map +0 -1
- package/dist/chunks/ar-DJN9fQ7Z.mjs +0 -2
- package/dist/chunks/ar-DJN9fQ7Z.mjs.map +0 -1
- package/dist/chunks/ar-DPTsUnwA.mjs +0 -2
- package/dist/chunks/ar-DPTsUnwA.mjs.map +0 -1
- package/dist/chunks/ar-DZJIBD1Q.mjs +0 -2
- package/dist/chunks/ar-DZJIBD1Q.mjs.map +0 -1
- package/dist/chunks/ar-DkkbwV93.mjs +0 -2
- package/dist/chunks/ar-DkkbwV93.mjs.map +0 -1
- package/dist/chunks/ar-DmeMor8Y.mjs +0 -2
- package/dist/chunks/ar-DmeMor8Y.mjs.map +0 -1
- package/dist/chunks/ar-LnE7jPai.mjs +0 -2
- package/dist/chunks/ar-LnE7jPai.mjs.map +0 -1
- package/dist/chunks/ar-P3wW0fmA.mjs +0 -2
- package/dist/chunks/ar-P3wW0fmA.mjs.map +0 -1
- package/dist/chunks/ar-uum0DCfv.mjs +0 -2
- package/dist/chunks/ar-uum0DCfv.mjs.map +0 -1
- package/dist/chunks/color-picker-DlXhHBZ6.mjs +0 -2
- package/dist/chunks/color-picker-DlXhHBZ6.mjs.map +0 -1
- package/dist/chunks/de-8SHQu0rr.mjs +0 -2
- package/dist/chunks/de-8SHQu0rr.mjs.map +0 -1
- package/dist/chunks/de-B8a71A0X.mjs +0 -2
- package/dist/chunks/de-B8a71A0X.mjs.map +0 -1
- package/dist/chunks/de-B9weXoA1.mjs +0 -2
- package/dist/chunks/de-B9weXoA1.mjs.map +0 -1
- package/dist/chunks/de-BKm53tVU.mjs +0 -2
- package/dist/chunks/de-BKm53tVU.mjs.map +0 -1
- package/dist/chunks/de-BLWrnMfX.mjs +0 -2
- package/dist/chunks/de-BLWrnMfX.mjs.map +0 -1
- package/dist/chunks/de-BOujs1pF.mjs +0 -2
- package/dist/chunks/de-BOujs1pF.mjs.map +0 -1
- package/dist/chunks/de-B_1XleAG.mjs +0 -2
- package/dist/chunks/de-B_1XleAG.mjs.map +0 -1
- package/dist/chunks/de-BpmjrOMc.mjs +0 -2
- package/dist/chunks/de-BpmjrOMc.mjs.map +0 -1
- package/dist/chunks/de-C8OHD1fm.mjs +0 -2
- package/dist/chunks/de-C8OHD1fm.mjs.map +0 -1
- package/dist/chunks/de-CAVCXBBR.mjs +0 -2
- package/dist/chunks/de-CAVCXBBR.mjs.map +0 -1
- package/dist/chunks/de-CkMnuozT.mjs +0 -2
- package/dist/chunks/de-CkMnuozT.mjs.map +0 -1
- package/dist/chunks/de-CtDnvnnm.mjs +0 -2
- package/dist/chunks/de-CtDnvnnm.mjs.map +0 -1
- package/dist/chunks/de-Cz26vtXW.mjs +0 -2
- package/dist/chunks/de-Cz26vtXW.mjs.map +0 -1
- package/dist/chunks/de-D0BPSP3j.mjs +0 -2
- package/dist/chunks/de-D0BPSP3j.mjs.map +0 -1
- package/dist/chunks/de-D74v0paw.mjs +0 -2
- package/dist/chunks/de-D74v0paw.mjs.map +0 -1
- package/dist/chunks/de-DKj55F9g.mjs +0 -2
- package/dist/chunks/de-DKj55F9g.mjs.map +0 -1
- package/dist/chunks/de-DYuRb98l.mjs +0 -2
- package/dist/chunks/de-DYuRb98l.mjs.map +0 -1
- package/dist/chunks/de-DaK0-sdo.mjs +0 -2
- package/dist/chunks/de-DaK0-sdo.mjs.map +0 -1
- package/dist/chunks/de-Dia08Wsq.mjs +0 -2
- package/dist/chunks/de-Dia08Wsq.mjs.map +0 -1
- package/dist/chunks/de-Dp_uj2Z3.mjs +0 -2
- package/dist/chunks/de-Dp_uj2Z3.mjs.map +0 -1
- package/dist/chunks/de-DwX1CDNO.mjs +0 -2
- package/dist/chunks/de-DwX1CDNO.mjs.map +0 -1
- package/dist/chunks/de-DyF2mRfw.mjs +0 -2
- package/dist/chunks/de-DyF2mRfw.mjs.map +0 -1
- package/dist/chunks/de-X3BLBlF8.mjs +0 -2
- package/dist/chunks/de-X3BLBlF8.mjs.map +0 -1
- package/dist/chunks/de-dPC3Qk7N.mjs +0 -2
- package/dist/chunks/de-dPC3Qk7N.mjs.map +0 -1
- package/dist/chunks/de-pLGt5S7j.mjs +0 -2
- package/dist/chunks/de-pLGt5S7j.mjs.map +0 -1
- package/dist/chunks/es--xozZF4T.mjs +0 -2
- package/dist/chunks/es--xozZF4T.mjs.map +0 -1
- package/dist/chunks/es-2BjtTusm.mjs +0 -2
- package/dist/chunks/es-2BjtTusm.mjs.map +0 -1
- package/dist/chunks/es-B2rEK7_f.mjs +0 -2
- package/dist/chunks/es-B2rEK7_f.mjs.map +0 -1
- package/dist/chunks/es-B9esmUm1.mjs +0 -2
- package/dist/chunks/es-B9esmUm1.mjs.map +0 -1
- package/dist/chunks/es-BJxkHalP.mjs +0 -2
- package/dist/chunks/es-BJxkHalP.mjs.map +0 -1
- package/dist/chunks/es-BMKsnh3y.mjs +0 -2
- package/dist/chunks/es-BMKsnh3y.mjs.map +0 -1
- package/dist/chunks/es-BXFflrrU.mjs +0 -2
- package/dist/chunks/es-BXFflrrU.mjs.map +0 -1
- package/dist/chunks/es-BbX_lEEN.mjs +0 -2
- package/dist/chunks/es-BbX_lEEN.mjs.map +0 -1
- package/dist/chunks/es-BlHe_tc0.mjs +0 -2
- package/dist/chunks/es-BlHe_tc0.mjs.map +0 -1
- package/dist/chunks/es-Bu6nnEeT.mjs +0 -2
- package/dist/chunks/es-Bu6nnEeT.mjs.map +0 -1
- package/dist/chunks/es-Bx0CbUoY.mjs +0 -2
- package/dist/chunks/es-Bx0CbUoY.mjs.map +0 -1
- package/dist/chunks/es-CE9Tbsb7.mjs +0 -2
- package/dist/chunks/es-CE9Tbsb7.mjs.map +0 -1
- package/dist/chunks/es-COSomns3.mjs +0 -2
- package/dist/chunks/es-COSomns3.mjs.map +0 -1
- package/dist/chunks/es-C_7qthHu.mjs +0 -2
- package/dist/chunks/es-C_7qthHu.mjs.map +0 -1
- package/dist/chunks/es-CirfP3x1.mjs +0 -2
- package/dist/chunks/es-CirfP3x1.mjs.map +0 -1
- package/dist/chunks/es-CpF8eiPr.mjs +0 -2
- package/dist/chunks/es-CpF8eiPr.mjs.map +0 -1
- package/dist/chunks/es-D787y0ui.mjs +0 -2
- package/dist/chunks/es-D787y0ui.mjs.map +0 -1
- package/dist/chunks/es-D8iB5vwQ.mjs +0 -2
- package/dist/chunks/es-D8iB5vwQ.mjs.map +0 -1
- package/dist/chunks/es-DBb78XWu.mjs +0 -2
- package/dist/chunks/es-DBb78XWu.mjs.map +0 -1
- package/dist/chunks/es-DC6mYTD3.mjs +0 -2
- package/dist/chunks/es-DC6mYTD3.mjs.map +0 -1
- package/dist/chunks/es-Dh--mRZs.mjs +0 -2
- package/dist/chunks/es-Dh--mRZs.mjs.map +0 -1
- package/dist/chunks/es-DvPsYqFj.mjs +0 -2
- package/dist/chunks/es-DvPsYqFj.mjs.map +0 -1
- package/dist/chunks/es-DxXimuUa.mjs +0 -2
- package/dist/chunks/es-DxXimuUa.mjs.map +0 -1
- package/dist/chunks/es-mWJptxq3.mjs +0 -2
- package/dist/chunks/es-mWJptxq3.mjs.map +0 -1
- package/dist/chunks/es-qYV--o6U.mjs +0 -2
- package/dist/chunks/es-qYV--o6U.mjs.map +0 -1
- package/dist/chunks/fonts-CxtWyeNB.mjs +0 -2
- package/dist/chunks/fonts-CxtWyeNB.mjs.map +0 -1
- package/dist/chunks/fr--F426oao.mjs +0 -2
- package/dist/chunks/fr--F426oao.mjs.map +0 -1
- package/dist/chunks/fr-B0BPbbNB.mjs +0 -2
- package/dist/chunks/fr-B0BPbbNB.mjs.map +0 -1
- package/dist/chunks/fr-B4UQy0j-.mjs +0 -2
- package/dist/chunks/fr-B4UQy0j-.mjs.map +0 -1
- package/dist/chunks/fr-B4XLxkci.mjs +0 -2
- package/dist/chunks/fr-B4XLxkci.mjs.map +0 -1
- package/dist/chunks/fr-BC1Rfp9S.mjs +0 -2
- package/dist/chunks/fr-BC1Rfp9S.mjs.map +0 -1
- package/dist/chunks/fr-BRGGu0E2.mjs +0 -2
- package/dist/chunks/fr-BRGGu0E2.mjs.map +0 -1
- package/dist/chunks/fr-BoSz1pa9.mjs +0 -2
- package/dist/chunks/fr-BoSz1pa9.mjs.map +0 -1
- package/dist/chunks/fr-Bom3RFIN.mjs +0 -2
- package/dist/chunks/fr-Bom3RFIN.mjs.map +0 -1
- package/dist/chunks/fr-BtnwMUII.mjs +0 -2
- package/dist/chunks/fr-BtnwMUII.mjs.map +0 -1
- package/dist/chunks/fr-C6pglM3H.mjs +0 -2
- package/dist/chunks/fr-C6pglM3H.mjs.map +0 -1
- package/dist/chunks/fr-CDBpS6xE.mjs +0 -2
- package/dist/chunks/fr-CDBpS6xE.mjs.map +0 -1
- package/dist/chunks/fr-CN0ihkUg.mjs +0 -2
- package/dist/chunks/fr-CN0ihkUg.mjs.map +0 -1
- package/dist/chunks/fr-CNNBBeLM.mjs +0 -2
- package/dist/chunks/fr-CNNBBeLM.mjs.map +0 -1
- package/dist/chunks/fr-CVOY2y07.mjs +0 -2
- package/dist/chunks/fr-CVOY2y07.mjs.map +0 -1
- package/dist/chunks/fr-CZAbL_o0.mjs +0 -2
- package/dist/chunks/fr-CZAbL_o0.mjs.map +0 -1
- package/dist/chunks/fr-DJkPmQG_.mjs +0 -2
- package/dist/chunks/fr-DJkPmQG_.mjs.map +0 -1
- package/dist/chunks/fr-DkWdFDsR.mjs +0 -2
- package/dist/chunks/fr-DkWdFDsR.mjs.map +0 -1
- package/dist/chunks/fr-DnQHoPVo.mjs +0 -2
- package/dist/chunks/fr-DnQHoPVo.mjs.map +0 -1
- package/dist/chunks/fr-DsdueaiG.mjs +0 -2
- package/dist/chunks/fr-DsdueaiG.mjs.map +0 -1
- package/dist/chunks/fr-DxNdsa11.mjs +0 -2
- package/dist/chunks/fr-DxNdsa11.mjs.map +0 -1
- package/dist/chunks/fr-IO4_LYvE.mjs +0 -2
- package/dist/chunks/fr-IO4_LYvE.mjs.map +0 -1
- package/dist/chunks/fr-ZKDCEpww.mjs +0 -2
- package/dist/chunks/fr-ZKDCEpww.mjs.map +0 -1
- package/dist/chunks/fr-coufP_et.mjs +0 -2
- package/dist/chunks/fr-coufP_et.mjs.map +0 -1
- package/dist/chunks/fr-lYSOgOK7.mjs +0 -2
- package/dist/chunks/fr-lYSOgOK7.mjs.map +0 -1
- package/dist/chunks/fr-wobtRjcF.mjs +0 -2
- package/dist/chunks/fr-wobtRjcF.mjs.map +0 -1
- package/dist/chunks/full-5hGvv-bG.mjs +0 -2
- package/dist/chunks/full-5hGvv-bG.mjs.map +0 -1
- package/dist/chunks/hi-B0o90MFd.mjs +0 -2
- package/dist/chunks/hi-B0o90MFd.mjs.map +0 -1
- package/dist/chunks/hi-BFko34WG.mjs +0 -2
- package/dist/chunks/hi-BFko34WG.mjs.map +0 -1
- package/dist/chunks/hi-BVxSgaNT.mjs +0 -2
- package/dist/chunks/hi-BVxSgaNT.mjs.map +0 -1
- package/dist/chunks/hi-BirBQ5Ef.mjs +0 -2
- package/dist/chunks/hi-BirBQ5Ef.mjs.map +0 -1
- package/dist/chunks/hi-BnsbcSIX.mjs +0 -2
- package/dist/chunks/hi-BnsbcSIX.mjs.map +0 -1
- package/dist/chunks/hi-BoFuxLtG.mjs +0 -2
- package/dist/chunks/hi-BoFuxLtG.mjs.map +0 -1
- package/dist/chunks/hi-BptyTwAv.mjs +0 -2
- package/dist/chunks/hi-BptyTwAv.mjs.map +0 -1
- package/dist/chunks/hi-BulaYhi_.mjs +0 -2
- package/dist/chunks/hi-BulaYhi_.mjs.map +0 -1
- package/dist/chunks/hi-BzflHG6Y.mjs +0 -2
- package/dist/chunks/hi-BzflHG6Y.mjs.map +0 -1
- package/dist/chunks/hi-C7Hb-gQ_.mjs +0 -2
- package/dist/chunks/hi-C7Hb-gQ_.mjs.map +0 -1
- package/dist/chunks/hi-C_lY7kA9.mjs +0 -2
- package/dist/chunks/hi-C_lY7kA9.mjs.map +0 -1
- package/dist/chunks/hi-CkylXoIm.mjs +0 -2
- package/dist/chunks/hi-CkylXoIm.mjs.map +0 -1
- package/dist/chunks/hi-DGJTbrQi.mjs +0 -2
- package/dist/chunks/hi-DGJTbrQi.mjs.map +0 -1
- package/dist/chunks/hi-DGJgX0fG.mjs +0 -2
- package/dist/chunks/hi-DGJgX0fG.mjs.map +0 -1
- package/dist/chunks/hi-DKDYpjdr.mjs +0 -2
- package/dist/chunks/hi-DKDYpjdr.mjs.map +0 -1
- package/dist/chunks/hi-DfAX8S-T.mjs +0 -2
- package/dist/chunks/hi-DfAX8S-T.mjs.map +0 -1
- package/dist/chunks/hi-Dhq91ipt.mjs +0 -2
- package/dist/chunks/hi-Dhq91ipt.mjs.map +0 -1
- package/dist/chunks/hi-Dup389dM.mjs +0 -2
- package/dist/chunks/hi-Dup389dM.mjs.map +0 -1
- package/dist/chunks/hi-DzRFsYYN.mjs +0 -2
- package/dist/chunks/hi-DzRFsYYN.mjs.map +0 -1
- package/dist/chunks/hi-ObZRwITd.mjs +0 -2
- package/dist/chunks/hi-ObZRwITd.mjs.map +0 -1
- package/dist/chunks/hi-VvUzjfH_.mjs +0 -2
- package/dist/chunks/hi-VvUzjfH_.mjs.map +0 -1
- package/dist/chunks/hi-jWQDQkOX.mjs +0 -2
- package/dist/chunks/hi-jWQDQkOX.mjs.map +0 -1
- package/dist/chunks/hi-l3hIrp8J.mjs +0 -2
- package/dist/chunks/hi-l3hIrp8J.mjs.map +0 -1
- package/dist/chunks/hi-o8Gsu5Ly.mjs +0 -2
- package/dist/chunks/hi-o8Gsu5Ly.mjs.map +0 -1
- package/dist/chunks/hi-sxC2nk3h.mjs +0 -2
- package/dist/chunks/hi-sxC2nk3h.mjs.map +0 -1
- package/dist/chunks/minimal-pBhi4EJI.mjs +0 -2
- package/dist/chunks/minimal-pBhi4EJI.mjs.map +0 -1
- package/dist/chunks/pt--57Ug7ig.mjs +0 -2
- package/dist/chunks/pt--57Ug7ig.mjs.map +0 -1
- package/dist/chunks/pt-4j8Km9Db.mjs +0 -2
- package/dist/chunks/pt-4j8Km9Db.mjs.map +0 -1
- package/dist/chunks/pt-BTGFKCns.mjs +0 -2
- package/dist/chunks/pt-BTGFKCns.mjs.map +0 -1
- package/dist/chunks/pt-BU8Qfuoz.mjs +0 -2
- package/dist/chunks/pt-BU8Qfuoz.mjs.map +0 -1
- package/dist/chunks/pt-BYAOJxIB.mjs +0 -2
- package/dist/chunks/pt-BYAOJxIB.mjs.map +0 -1
- package/dist/chunks/pt-BjNWQm9A.mjs +0 -2
- package/dist/chunks/pt-BjNWQm9A.mjs.map +0 -1
- package/dist/chunks/pt-Bvnb_NpT.mjs +0 -2
- package/dist/chunks/pt-Bvnb_NpT.mjs.map +0 -1
- package/dist/chunks/pt-C2pkn7vo.mjs +0 -2
- package/dist/chunks/pt-C2pkn7vo.mjs.map +0 -1
- package/dist/chunks/pt-C8MhLnWx.mjs +0 -2
- package/dist/chunks/pt-C8MhLnWx.mjs.map +0 -1
- package/dist/chunks/pt-CJfYLSTe.mjs +0 -2
- package/dist/chunks/pt-CJfYLSTe.mjs.map +0 -1
- package/dist/chunks/pt-CdwVIYOK.mjs +0 -2
- package/dist/chunks/pt-CdwVIYOK.mjs.map +0 -1
- package/dist/chunks/pt-CwrVo90O.mjs +0 -2
- package/dist/chunks/pt-CwrVo90O.mjs.map +0 -1
- package/dist/chunks/pt-DD26CKCA.mjs +0 -2
- package/dist/chunks/pt-DD26CKCA.mjs.map +0 -1
- package/dist/chunks/pt-DLbf6uoo.mjs +0 -2
- package/dist/chunks/pt-DLbf6uoo.mjs.map +0 -1
- package/dist/chunks/pt-DNyNHwKh.mjs +0 -2
- package/dist/chunks/pt-DNyNHwKh.mjs.map +0 -1
- package/dist/chunks/pt-DVfMAcXb.mjs +0 -2
- package/dist/chunks/pt-DVfMAcXb.mjs.map +0 -1
- package/dist/chunks/pt-DWSFad3n.mjs +0 -2
- package/dist/chunks/pt-DWSFad3n.mjs.map +0 -1
- package/dist/chunks/pt-DZXY4i4G.mjs +0 -2
- package/dist/chunks/pt-DZXY4i4G.mjs.map +0 -1
- package/dist/chunks/pt-DfUpRhK1.mjs +0 -2
- package/dist/chunks/pt-DfUpRhK1.mjs.map +0 -1
- package/dist/chunks/pt-DlvNEDeW.mjs +0 -2
- package/dist/chunks/pt-DlvNEDeW.mjs.map +0 -1
- package/dist/chunks/pt-DzFyGwB4.mjs +0 -2
- package/dist/chunks/pt-DzFyGwB4.mjs.map +0 -1
- package/dist/chunks/pt-HhQcARW6.mjs +0 -2
- package/dist/chunks/pt-HhQcARW6.mjs.map +0 -1
- package/dist/chunks/pt-SjvTF40s.mjs +0 -2
- package/dist/chunks/pt-SjvTF40s.mjs.map +0 -1
- package/dist/chunks/pt-ihNE0VQJ.mjs +0 -2
- package/dist/chunks/pt-ihNE0VQJ.mjs.map +0 -1
- package/dist/chunks/pt-zfCjhIgy.mjs +0 -2
- package/dist/chunks/pt-zfCjhIgy.mjs.map +0 -1
- package/dist/chunks/ru-0AHodbWv.mjs +0 -2
- package/dist/chunks/ru-0AHodbWv.mjs.map +0 -1
- package/dist/chunks/ru-2MDGmLw0.mjs +0 -2
- package/dist/chunks/ru-2MDGmLw0.mjs.map +0 -1
- package/dist/chunks/ru-3VfYKfTm.mjs +0 -2
- package/dist/chunks/ru-3VfYKfTm.mjs.map +0 -1
- package/dist/chunks/ru-B-gRJ6nQ.mjs +0 -2
- package/dist/chunks/ru-B-gRJ6nQ.mjs.map +0 -1
- package/dist/chunks/ru-B6ITUB-Y.mjs +0 -2
- package/dist/chunks/ru-B6ITUB-Y.mjs.map +0 -1
- package/dist/chunks/ru-BKDWkabk.mjs +0 -2
- package/dist/chunks/ru-BKDWkabk.mjs.map +0 -1
- package/dist/chunks/ru-BMxJsSe3.mjs +0 -2
- package/dist/chunks/ru-BMxJsSe3.mjs.map +0 -1
- package/dist/chunks/ru-Bep1iHQL.mjs +0 -2
- package/dist/chunks/ru-Bep1iHQL.mjs.map +0 -1
- package/dist/chunks/ru-Blj0nqoL.mjs +0 -2
- package/dist/chunks/ru-Blj0nqoL.mjs.map +0 -1
- package/dist/chunks/ru-BqnHkmii.mjs +0 -2
- package/dist/chunks/ru-BqnHkmii.mjs.map +0 -1
- package/dist/chunks/ru-C-4AaPUK.mjs +0 -2
- package/dist/chunks/ru-C-4AaPUK.mjs.map +0 -1
- package/dist/chunks/ru-C9Nv7JJI.mjs +0 -2
- package/dist/chunks/ru-C9Nv7JJI.mjs.map +0 -1
- package/dist/chunks/ru-CJFtr1Ks.mjs +0 -2
- package/dist/chunks/ru-CJFtr1Ks.mjs.map +0 -1
- package/dist/chunks/ru-CN63yWk_.mjs +0 -2
- package/dist/chunks/ru-CN63yWk_.mjs.map +0 -1
- package/dist/chunks/ru-CcFX97-2.mjs +0 -2
- package/dist/chunks/ru-CcFX97-2.mjs.map +0 -1
- package/dist/chunks/ru-D8PhWFSp.mjs +0 -2
- package/dist/chunks/ru-D8PhWFSp.mjs.map +0 -1
- package/dist/chunks/ru-DYAncidS.mjs +0 -2
- package/dist/chunks/ru-DYAncidS.mjs.map +0 -1
- package/dist/chunks/ru-D_zXo-FA.mjs +0 -2
- package/dist/chunks/ru-D_zXo-FA.mjs.map +0 -1
- package/dist/chunks/ru-DhSPV6m0.mjs +0 -2
- package/dist/chunks/ru-DhSPV6m0.mjs.map +0 -1
- package/dist/chunks/ru-LNbpjKCw.mjs +0 -2
- package/dist/chunks/ru-LNbpjKCw.mjs.map +0 -1
- package/dist/chunks/ru-LXi1ONW4.mjs +0 -2
- package/dist/chunks/ru-LXi1ONW4.mjs.map +0 -1
- package/dist/chunks/ru-db7wsWkx.mjs +0 -2
- package/dist/chunks/ru-db7wsWkx.mjs.map +0 -1
- package/dist/chunks/ru-nZ4BjiD0.mjs +0 -2
- package/dist/chunks/ru-nZ4BjiD0.mjs.map +0 -1
- package/dist/chunks/ru-v9zumXd2.mjs +0 -2
- package/dist/chunks/ru-v9zumXd2.mjs.map +0 -1
- package/dist/chunks/ru-wK2ytv3A.mjs +0 -2
- package/dist/chunks/ru-wK2ytv3A.mjs.map +0 -1
- package/dist/chunks/src-CNK6vpUU.mjs +0 -2
- package/dist/chunks/src-CNK6vpUU.mjs.map +0 -1
- package/dist/chunks/zh-9AcCSFm0.mjs +0 -2
- package/dist/chunks/zh-9AcCSFm0.mjs.map +0 -1
- package/dist/chunks/zh-B3bJCfdB.mjs +0 -2
- package/dist/chunks/zh-B3bJCfdB.mjs.map +0 -1
- package/dist/chunks/zh-B46Dt1h7.mjs +0 -2
- package/dist/chunks/zh-B46Dt1h7.mjs.map +0 -1
- package/dist/chunks/zh-BRy2B6Og.mjs +0 -2
- package/dist/chunks/zh-BRy2B6Og.mjs.map +0 -1
- package/dist/chunks/zh-BfYi8wB2.mjs +0 -2
- package/dist/chunks/zh-BfYi8wB2.mjs.map +0 -1
- package/dist/chunks/zh-C0I3L6NA.mjs +0 -2
- package/dist/chunks/zh-C0I3L6NA.mjs.map +0 -1
- package/dist/chunks/zh-C33e4gfg.mjs +0 -2
- package/dist/chunks/zh-C33e4gfg.mjs.map +0 -1
- package/dist/chunks/zh-C9sNwnC1.mjs +0 -2
- package/dist/chunks/zh-C9sNwnC1.mjs.map +0 -1
- package/dist/chunks/zh-CACr0qSo.mjs +0 -2
- package/dist/chunks/zh-CACr0qSo.mjs.map +0 -1
- package/dist/chunks/zh-CU0hd8zq.mjs +0 -2
- package/dist/chunks/zh-CU0hd8zq.mjs.map +0 -1
- package/dist/chunks/zh-CX2zUoWR.mjs +0 -2
- package/dist/chunks/zh-CX2zUoWR.mjs.map +0 -1
- package/dist/chunks/zh-CblZ-34H.mjs +0 -2
- package/dist/chunks/zh-CblZ-34H.mjs.map +0 -1
- package/dist/chunks/zh-CicpU0g8.mjs +0 -2
- package/dist/chunks/zh-CicpU0g8.mjs.map +0 -1
- package/dist/chunks/zh-Cr3KdEZV.mjs +0 -2
- package/dist/chunks/zh-Cr3KdEZV.mjs.map +0 -1
- package/dist/chunks/zh-D24dsCiw.mjs +0 -2
- package/dist/chunks/zh-D24dsCiw.mjs.map +0 -1
- package/dist/chunks/zh-DQtLxQ3s.mjs +0 -2
- package/dist/chunks/zh-DQtLxQ3s.mjs.map +0 -1
- package/dist/chunks/zh-DR1OF5vm.mjs +0 -2
- package/dist/chunks/zh-DR1OF5vm.mjs.map +0 -1
- package/dist/chunks/zh-DS82x1KL.mjs +0 -2
- package/dist/chunks/zh-DS82x1KL.mjs.map +0 -1
- package/dist/chunks/zh-DdJA-AEY.mjs +0 -2
- package/dist/chunks/zh-DdJA-AEY.mjs.map +0 -1
- package/dist/chunks/zh-DpVlDZ9n.mjs +0 -2
- package/dist/chunks/zh-DpVlDZ9n.mjs.map +0 -1
- package/dist/chunks/zh-OWVKcbVR.mjs +0 -2
- package/dist/chunks/zh-OWVKcbVR.mjs.map +0 -1
- package/dist/chunks/zh-d19V68ib.mjs +0 -2
- package/dist/chunks/zh-d19V68ib.mjs.map +0 -1
- package/dist/chunks/zh-fSMt1FnB.mjs +0 -2
- package/dist/chunks/zh-fSMt1FnB.mjs.map +0 -1
- package/dist/chunks/zh-mLlk9Wki.mjs +0 -2
- package/dist/chunks/zh-mLlk9Wki.mjs.map +0 -1
- package/dist/chunks/zh-nnMt8E6m.mjs +0 -2
- package/dist/chunks/zh-nnMt8E6m.mjs.map +0 -1
- package/dist/plugins/smart-paste/detectors/JavaDetector.d.ts +0 -7
- package/dist/plugins/smart-paste/detectors/JavaDetector.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorGrid-Czm0p2E9.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,QAC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AAK,MAAM,EAAe,GAAW,EAC1D,EAAsB,EAAe,EAAW,EAEhD,EAAe,EAAa,IAC3B,EAAQ,GAAU,EACxB,EACA,EACA,EACA,EACA,EAAE,IACF,GAGD,IAAI,GAAkB,EAAS,GAAK,GAAW,EAAS,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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./TypeBrands-BZDKMjR-.mjs";import{i as t,n as o,t as r}from"./AttributedMarkCommands-35jTbVRg.mjs";import{t as a}from"./ColorValidation-CiGxVsqd.mjs";import{t as n}from"./ColorGrid-Czm0p2E9.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-CL-W380M.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerPopup-CL-W380M.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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
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-CiGxVsqd.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorValidation-CiGxVsqd.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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as n,x as t,y as r}from"./Document-_qdGR4vh.mjs";import{d as o,o as e,r as i,t as c}from"./Selection-aeiSsvhe.mjs";import{i as s}from"./NavigationQueries-CgYPG6oY.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-DTlQcGv5.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommandHelpers-DTlQcGv5.mjs","names":[],"sources":["../../src/commands/CommandHelpers.ts"],"sourcesContent":["/**\n * Shared helpers used across multiple command modules.\n *\n * - {@link getSiblings} — resolves a parent path to its child list\n * - {@link resolveInsertPoint} — normalizes a text selection to a single insert position\n */\n\nimport type { BlockNode, ChildNode, Document } from '../model/Document.js';\nimport { getBlockLength, isBlockNode, isLeafBlock } from '../model/Document.js';\nimport {\n\tcreateCollapsedSelection,\n\tcreateNodeSelection,\n\tisCollapsed,\n\tselectionRange,\n} from '../model/Selection.js';\nimport type { EditorSelection, Selection } from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport { isVoidBlock } from '../state/NavigationQueries.js';\n\n/** The resolved insert position within a single block. */\nexport interface InsertPoint {\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n}\n\n/** Resolves the children of a parent path: doc root or a nested block. */\nexport function getSiblings(\n\tstate: EditorState,\n\tparentPath: readonly BlockId[],\n): readonly ChildNode[] {\n\tif (parentPath.length === 0) return state.doc.children;\n\tconst parent: BlockNode | undefined = state.getBlock(\n\t\tparentPath[parentPath.length - 1] as BlockId,\n\t);\n\treturn parent ? parent.children : [];\n}\n\n/**\n * Normalizes a text selection to a single insert point.\n *\n * - Collapsed selection → anchor position.\n * - Range selection → normalized `from` position (document-order start).\n */\nexport function resolveInsertPoint(sel: Selection, blockOrder: readonly BlockId[]): InsertPoint {\n\tif (isCollapsed(sel)) {\n\t\treturn { blockId: sel.anchor.blockId, offset: sel.anchor.offset };\n\t}\n\tconst range = selectionRange(sel, blockOrder);\n\treturn { blockId: range.from.blockId, offset: range.from.offset };\n}\n\n/** Extracts the parent path from a full node path (all elements except the last). */\nexport function extractParentPath(path: readonly string[] | undefined): BlockId[] {\n\treturn path && path.length > 1 ? (path.slice(0, -1) as BlockId[]) : [];\n}\n\n/** Finds the index of a block by ID within a sibling list. */\nexport function findSiblingIndex(siblings: readonly ChildNode[], targetId: BlockId): number {\n\treturn siblings.findIndex((c) => isBlockNode(c) && c.id === targetId);\n}\n\n/** Finds the first leaf block ID in a subtree. */\nexport function findFirstLeafBlockId(node: BlockNode): BlockId {\n\tif (isLeafBlock(node)) return node.id;\n\n\tfor (const child of node.children) {\n\t\tif (!isBlockNode(child)) continue;\n\t\treturn findFirstLeafBlockId(child);\n\t}\n\n\treturn node.id;\n}\n\n/** Finds the last leaf block ID in a subtree. */\nexport function findLastLeafBlockId(node: BlockNode): BlockId {\n\tif (isLeafBlock(node)) return node.id;\n\n\tfor (let i = node.children.length - 1; i >= 0; i--) {\n\t\tconst child = node.children[i];\n\t\tif (child && isBlockNode(child)) {\n\t\t\treturn findLastLeafBlockId(child);\n\t\t}\n\t}\n\n\treturn node.id;\n}\n\n/**\n * Resolves a valid editor selection at the start or end of a block subtree.\n * Void blocks become NodeSelections; text-capable blocks resolve to leaf cursors.\n */\nexport function createSelectionForBlockBoundary(\n\tstate: EditorState,\n\tblockId: BlockId,\n\tboundary: 'start' | 'end',\n): EditorSelection | null {\n\tconst block = state.getBlock(blockId);\n\tif (!block) return null;\n\n\tif (isVoidBlock(state, blockId)) {\n\t\tconst path = state.getNodePath(blockId);\n\t\treturn path ? createNodeSelection(blockId, path) : null;\n\t}\n\n\tconst leafId: BlockId =\n\t\tboundary === 'start' ? findFirstLeafBlockId(block) : findLastLeafBlockId(block);\n\tconst leaf = state.getBlock(leafId);\n\tif (!leaf) return null;\n\n\tconst offset = boundary === 'start' ? 0 : getBlockLength(leaf);\n\treturn createCollapsedSelection(leafId, offset);\n}\n\n/**\n * Resolves a valid editor selection anywhere in the document, starting from\n * the first (or last) top-level block and deferring per-block resolution to\n * {@link createSelectionForBlockBoundary}. Useful as a last-resort fallback\n * after deletions when neighbouring siblings cannot provide a selection.\n *\n * @param state The editor state to query.\n * @param boundary `'start'` walks document order; `'end'` walks reverse.\n * @param excludeBlockId Optional block id to skip (e.g. the block about to\n * be removed by the caller's transaction).\n * @returns A valid selection, or `null` if no selectable block exists.\n */\nexport function createSelectionForDocumentBoundary(\n\tstate: EditorState,\n\tboundary: 'start' | 'end',\n\texcludeBlockId?: BlockId,\n): EditorSelection | null {\n\tconst children: readonly ChildNode[] = state.doc.children;\n\tconst indices: readonly number[] =\n\t\tboundary === 'start'\n\t\t\t? children.map((_, i) => i)\n\t\t\t: children.map((_, i) => children.length - 1 - i);\n\n\tfor (const i of indices) {\n\t\tconst child = children[i];\n\t\tif (!child || !isBlockNode(child)) continue;\n\t\tif (excludeBlockId !== undefined && child.id === excludeBlockId) continue;\n\n\t\tconst sel = createSelectionForBlockBoundary(state, child.id, boundary);\n\t\tif (sel) return sel;\n\t}\n\n\treturn null;\n}\n\n/** Returns the root-level block IDs in document order. */\nexport function getRootBlockIds(doc: Document): readonly BlockId[] {\n\treturn doc.children.map((child) => child.id);\n}\n"],"mappings":"iLA2BA,SAAgB,EACf,EACA,GAEA,GAA0B,IAAtB,EAAW,OAAc,OAAO,EAAM,IAAI,SAC9C,MAAM,EA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AG,IAAM,GACvB,EAAS,IAAA,CAAK,EAAG,IAAM,EAAS,OAAS,EAAI,GAEjD,IAAK,MAAM,KAAK,EAAS,CACxB,MAAM,EAAQ,EAAS,GACvB,IAAK,IAAU,EAAY,GAAQ,SACnC,QAAuB,IAAnB,GAAgC,EAAM,KAAO,EAAgB,SAEjE,MAAM,EAAM,EAAgC,EAAO,EAAM,GAAI,GAC7D,GAAI,EAAK,OAAO,EAGjB,OAAO"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{S as t,a as n,c as e,d as o,f as r,g as c,h as s,m as i,n as l,o as u,v as f,x as a}from"./Document-_qdGR4vh.mjs";import{i as d,n as k,r as m,t as b}from"./WordBoundary-BE2u997Q.mjs";import{a as g,c as I,d as p,l as h,o as B,r as S,t as x,u as T}from"./Selection-aeiSsvhe.mjs";import{i as O,r as y}from"./TypeBrands-BZDKMjR-.mjs";import{n as N}from"./NodeResolver-DVPpO5nC.mjs";import{a as A,i as M,n as j,r as v}from"./NavigationQueries-CgYPG6oY.mjs";import{a as w,c as C,i as _,o as R,r as D,s as H}from"./CommandHelpers-DTlQcGv5.mjs";import{n as Q,r as W,t as q}from"./NodeSelectionCommands-Ddxu5Qck.mjs";import{n as z}from"./RangeIterator-DytL1lUT.mjs";function E(){return{nodeTypes:["paragraph"],markTypes:["bold","italic","underline"],getNodeSpec:()=>{}}}function F(t){return{nodeTypes:t.getNodeTypes(),markTypes:t.getMarkTypes(),getNodeSpec:n=>t.getNodeSpec(n)}}function G(t,n){return t.markTypes.includes(n)}function J(t,n){return t.nodeTypes.includes(n)}function K(t,n){if("after"===n.side)return P(t,n);const e=t.getBlockOrder(),r=e.indexOf(n.blockId);if(r<=0)return null;const c=e[r-1];if(!c)return null;if(M(t,c)){const n=N(t.doc,c)??[];return t.transaction("input").setSelection(S(c,n)).build()}const s=t.getBlock(c);if(!s)return null;const i=o(s);return t.transaction("input").setSelection(x(c,i)).build()}function L(t,n){if("before"===n.side)return P(t,n);const e=t.getBlockOrder(),o=e.indexOf(n.blockId);if(o>=e.length-1)return null;const r=e[o+1];if(!r)return null;if(M(t,r)){const n=N(t.doc,r)??[];return t.transaction("input").setSelection(S(r,n)).build()}return t.transaction("input").setSelection(x(r,0)).build()}function P(t,n){const e=N(t.doc,n.blockId)??[];return q(t,S(n.blockId,e))}var U={bold:!0,italic:!0,underline:!0};function V(t,n,e=U){if(function(t,n){const e=t;return"bold"===e?!n.bold:"italic"===e?!n.italic:"underline"===e&&!n.underline}(n,e))return null;if(!G(t.schema,n))return null;if(!T(t.selection))return null;const o={type:n},c=t.selection;if(B(c)){const e=t.getBlock(c.anchor.blockId);if(!e)return null;const s=t.storedMarks??r(e,c.anchor.offset),i=f(s,n)?s.filter(t=>t.type!==n):[...s,o];return t.transaction("command").setStoredMarks(i,t.storedMarks).setSelection(c).build()}const s=p(c,t.getBlockOrder()),i=t.transaction("command"),l=tt(t,n);return z(t,s,(t,n,e)=>{l?i.removeMark(t,n,e,o):i.addMark(t,n,e,o)}),i.setSelection(c),i.build()}function X(t,n){return V(t,O("bold"),n)}function Y(t,n){return V(t,O("italic"),n)}function Z(t,n){return V(t,O("underline"),n)}function $(t,n){const e=t.selection;if(!T(e))return!1;if(B(e)){if(t.storedMarks)return f(t.storedMarks,n);const o=t.getBlock(e.anchor.blockId);return!!o&&f(r(o,e.anchor.offset),n)}return tt(t,n)}function tt(t,n){const e=t.selection;if(!T(e))return!1;const r=t.getBlockOrder(),c=p(e,r),s=r.indexOf(c.from.blockId),i=r.indexOf(c.to.blockId);for(let l=s;l<=i;l++){const e=r[l];if(!e)continue;const u=t.getBlock(e);if(!u)continue;const f=o(u);if(!nt(u,l===s?c.from.offset:0,l===i?c.to.offset:f,n))return!1}return!0}function nt(n,e,o,r){if(e===o)return!1;let s=0;for(const i of c(n))if(t(i)){const t=s+i.text.length;if(t>e&&s<o&&!f(i.marks,r))return!1;s=t}else s+=1;return!0}function et(t,n){const e=t.selection;if(h(e))return q(t,e);if(I(e))return null;if(!B(e))return ft(t);const o=t.getBlock(e.anchor.blockId);if(!o)return null;const r=n.range(o,e.anchor.offset);if(!r)return n.merge(t);const[c,s]=r;return t.transaction("input").deleteTextAt(o.id,c,s).setSelection(x(o.id,c)).build()}function ot(t){return et(t,{merge:kt,range:(t,n)=>n<=0?null:"inline"===s(t,n-1)?.kind?[n-1,n]:[n-(d(i(t),l(t,n))||1),n]})}function rt(t){return et(t,{merge:mt,range:(t,n)=>n>=o(t)?null:"inline"===s(t,n)?.kind?[n,n+1]:[n,n+(m(i(t),l(t,n))||1)]})}function ct(t){return et(t,{merge:kt,range:(t,n)=>n>0?[b(t,n),n]:null})}function st(t){return et(t,{merge:mt,range:(t,n)=>n<o(t)?[n,k(t,n)]:null})}function it(t){return et(t,{merge:kt,range:(t,n)=>n>0?[0,n]:null})}function lt(t){return et(t,{merge:mt,range:(t,n)=>{const e=o(t);return n<e?[n,e]:null}})}function ut(t,o,c="input"){const s=t.selection;if(h(s))return W(t,s,o,c);if(I(s))return function(t,o,r,c){const s=D(N(t.doc,o.blockId)),i=H(t,s),l=R(i,o.blockId),u="before"===o.side?Math.max(l,0):l>=0?l+1:i.length,f=e(),a=t.transaction(c);return a.insertNode(s,u,n(f)),a.insertText(f,0,r,[]),a.setSelection(x(f,r.length)),a.build()}(t,s,o,c);const i=t.transaction(c),l=function(t){if(t.storedMarks)return t.storedMarks;if(!T(t.selection))return[];const n=t.getBlock(t.selection.anchor.blockId);return n?r(n,t.selection.anchor.offset):[]}(t);let u;B(s)||(u=It(t,i));const f=C(s,t.getBlockOrder()),a=u??f.blockId,d=u?0:f.offset;return i.insertText(a,d,o,l),i.setSelection(x(a,d+o.length)),i.build()}function ft(t){if(h(t.selection))return q(t,t.selection);if(I(t.selection))return null;if(B(t.selection))return null;const n=t.transaction("input"),e=It(t,n),o=p(t.selection,t.getBlockOrder()),r=e??o.from.blockId,c=e?0:o.from.offset;return n.setSelection(x(r,c)),n.build()}function at(t){const o=t.selection;if(h(o))return Q(t,o);if(I(o))return function(t,o){const r=N(t.doc,o.blockId);if(!r)return null;const c=D(r),s=R(H(t,c),o.blockId);if(s<0)return null;const i="before"===o.side?s:s+1,l=e(),u=t.transaction("input");return u.insertNode(c,i,n(l)),u.setSelection(x(l,0)),u.build()}(t,o);const r=t.transaction("input");let c;B(o)||(c=It(t,r));const s=C(o,t.getBlockOrder()),i=c??s.blockId,l=c?0:s.offset,u=e();return r.splitBlock(i,l,u),r.setSelection(x(u,0)),r.build()}function dt(t){const n=t.selection;if(!T(n))return null;const e=t.transaction("input");let o;if(B(n)||(o=It(t,e)),o)e.insertInlineNode(o,0,u(y("hard_break"))),e.setSelection(x(o,1));else{const{blockId:o,offset:r}=C(n,t.getBlockOrder());e.insertInlineNode(o,r,u(y("hard_break"))),e.setSelection(x(o,r+1))}return e.build()}function kt(t){return bt(t,"backward")}function mt(t){return bt(t,"forward")}function bt(t,n){const e=t.selection;if(!T(e))return null;const r=t.getBlockOrder(),c=r.indexOf(e.anchor.blockId),s="backward"===n?c-1:c+1;if(s<0||s>=r.length)return null;const i=r[s];if(!i)return null;if(v(t,e.anchor.blockId)||v(t,i))return null;if(!A(t,e.anchor.blockId,i)&&j(t,e.anchor.blockId))return null;if(M(t,i)){const n=N(t.doc,i)??[];return t.transaction("input").setSelection(S(i,n)).build()}if("backward"===n){const n=t.getBlock(i);if(!n)return null;const r=o(n);return t.transaction("input").mergeBlocksAt(i,e.anchor.blockId).setSelection(x(i,r)).build()}return t.transaction("input").mergeBlocksAt(e.anchor.blockId,i).setSelection(x(e.anchor.blockId,e.anchor.offset)).build()}function gt(t){const n=t.doc.children,e=n[0],r=n[n.length-1];if(!e||!r)return t.transaction("command").setSelection(t.selection).build();const c=_(e),s=w(r),i=t.getBlock(s),l=i?o(i):0;return t.transaction("command").setSelection(g({blockId:c,offset:0},{blockId:s,offset:l})).build()}function It(t,r){if(!T(t.selection))return;const c=t.getBlockOrder(),s=p(t.selection,c),i=c.indexOf(s.from.blockId),l=c.indexOf(s.to.blockId);if(i===l)return void r.deleteTextAt(s.from.blockId,s.from.offset,s.to.offset);const u=pt(t,s.from.blockId),f=pt(t,s.to.blockId);if(!(u===f||u<0||f<0))return function(t,r,c,s,i){const l=t.doc.children[s],u=t.doc.children[i];if(!l||!u)return;const f=a(l),d=a(u);let k,m=0;if(f||(k=e(),r.insertNode([],s,n(k)),m=1),f){const n=t.getBlock(c.from.blockId);if(n){const t=o(n);c.from.offset<t&&r.deleteTextAt(c.from.blockId,c.from.offset,t)}}d&&c.to.offset>0&&r.deleteTextAt(c.to.blockId,0,c.to.offset);const b=f?s+1:s+m;for(let n=d?i-1+m:i+m;n>=b;n--)r.removeNode([],n);return f&&d&&r.mergeBlocksAt(c.from.blockId,c.to.blockId),k}(t,r,s,u,f);!function(t,n,e,r,c,s){const i=t.getBlock(r.from.blockId);if(!i)return;const l=o(i);r.from.offset<l&&n.deleteTextAt(r.from.blockId,r.from.offset,l),r.to.offset>0&&n.deleteTextAt(r.to.blockId,0,r.to.offset);for(let u=c+1;u<s;u++){const c=e[u];if(!c)continue;const s=t.getBlock(c);if(!s)continue;const i=o(s);i>0&&n.deleteTextAt(c,0,i),n.mergeBlocksAt(r.from.blockId,c)}n.mergeBlocksAt(r.from.blockId,r.to.blockId)}(t,r,c,s,i,l)}function pt(t,n){const e=N(t.doc,n);if(!e||0===e.length)return-1;const o=e[0];return t.doc.children.findIndex(t=>t.id===o)}export{J as C,G as S,V as _,kt as a,L as b,ot as c,lt as d,ct as f,Y as g,X as h,ut as i,rt as l,$ as m,ft as n,gt as o,st as p,dt as r,at as s,It as t,it as u,Z as v,F as w,E as x,K as y};
|
|
2
|
-
//# sourceMappingURL=Commands-BuYF23lf.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Commands-BuYF23lf.mjs","names":[],"sources":["../../src/model/Schema.ts","../../src/commands/GapCursorCommands.ts","../../src/commands/MarkCommands.ts","../../src/commands/DeleteCommands.ts","../../src/commands/Commands.ts"],"sourcesContent":["/**\n * Schema definition for the Notectl editor.\n * Defines which node types and marks are allowed.\n */\n\nimport type { NodeSpec } from './NodeSpec.js';\nimport type { SchemaRegistry } from './SchemaRegistry.js';\n\nexport interface Schema {\n\treadonly nodeTypes: readonly string[];\n\treadonly markTypes: readonly string[];\n\t/** Looks up the full NodeSpec for a given type. Available when created via schemaFromRegistry. */\n\treadonly getNodeSpec?: (type: string) => NodeSpec | undefined;\n}\n\n/** Creates the default schema with paragraph nodes and bold/italic/underline marks. */\nexport function defaultSchema(): Schema {\n\treturn {\n\t\tnodeTypes: ['paragraph'],\n\t\tmarkTypes: ['bold', 'italic', 'underline'],\n\t\tgetNodeSpec: () => undefined,\n\t};\n}\n\n/** Derives a Schema from a SchemaRegistry's registered specs. */\nexport function schemaFromRegistry(registry: SchemaRegistry): Schema {\n\treturn {\n\t\tnodeTypes: registry.getNodeTypes(),\n\t\tmarkTypes: registry.getMarkTypes(),\n\t\tgetNodeSpec: (type: string) => registry.getNodeSpec(type),\n\t};\n}\n\n/** Checks whether the given mark type is allowed by the schema. */\nexport function isMarkAllowed(schema: Schema, markType: string): boolean {\n\treturn schema.markTypes.includes(markType);\n}\n\n/** Checks whether the given node type is allowed by the schema. */\nexport function isNodeTypeAllowed(schema: Schema, nodeType: string): boolean {\n\treturn schema.nodeTypes.includes(nodeType);\n}\n","/**\n * Commands for GapCursor: deleting void blocks adjacent to gap cursors\n * and inserting paragraphs at gap positions.\n */\n\nimport { createEmptyParagraph, generateBlockId, getBlockLength } from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport type { GapCursorSelection, NodeSelection } from '../model/Selection.js';\nimport { createCollapsedSelection, createNodeSelection } from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport { isVoidBlock } from '../state/NavigationQueries.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport { extractParentPath, findSiblingIndex, getSiblings } from './CommandHelpers.js';\nimport { deleteNodeSelection } from './NodeSelectionCommands.js';\n\n/**\n * Deletes the void block adjacent to a GapCursor when pressing Backspace.\n *\n * - `side === 'after'` → void block is behind the cursor → delete it.\n * - `side === 'before'` → void block is ahead → navigate backward (to previous block).\n * - At document start with `side === 'before'` → `null` (no-op).\n */\nexport function deleteBackwardAtGap(\n\tstate: EditorState,\n\tsel: GapCursorSelection,\n): Transaction | null {\n\tif (sel.side === 'after') {\n\t\treturn deleteVoidAtGap(state, sel);\n\t}\n\n\t// side === 'before': navigate to previous block\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst blockIdx: number = blockOrder.indexOf(sel.blockId);\n\n\tif (blockIdx <= 0) return null;\n\n\tconst prevId: BlockId | undefined = blockOrder[blockIdx - 1];\n\tif (!prevId) return null;\n\n\tif (isVoidBlock(state, prevId)) {\n\t\tconst path = findNodePath(state.doc, prevId) ?? [];\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.setSelection(createNodeSelection(prevId, path as BlockId[]))\n\t\t\t.build();\n\t}\n\n\tconst prevBlock = state.getBlock(prevId);\n\tif (!prevBlock) return null;\n\tconst prevLen: number = getBlockLength(prevBlock);\n\treturn state.transaction('input').setSelection(createCollapsedSelection(prevId, prevLen)).build();\n}\n\n/**\n * Deletes the void block adjacent to a GapCursor when pressing Delete.\n *\n * - `side === 'before'` → void block is ahead of the cursor → delete it.\n * - `side === 'after'` → void block is behind → navigate forward (to next block).\n * - At document end with `side === 'after'` → `null` (no-op).\n */\nexport function deleteForwardAtGap(\n\tstate: EditorState,\n\tsel: GapCursorSelection,\n): Transaction | null {\n\tif (sel.side === 'before') {\n\t\treturn deleteVoidAtGap(state, sel);\n\t}\n\n\t// side === 'after': navigate to next block\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst blockIdx: number = blockOrder.indexOf(sel.blockId);\n\n\tif (blockIdx >= blockOrder.length - 1) return null;\n\n\tconst nextId: BlockId | undefined = blockOrder[blockIdx + 1];\n\tif (!nextId) return null;\n\n\tif (isVoidBlock(state, nextId)) {\n\t\tconst path = findNodePath(state.doc, nextId) ?? [];\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.setSelection(createNodeSelection(nextId, path as BlockId[]))\n\t\t\t.build();\n\t}\n\n\treturn state.transaction('input').setSelection(createCollapsedSelection(nextId, 0)).build();\n}\n\n/** Deletes the void block that the GapCursor is adjacent to, delegating to deleteNodeSelection. */\nfunction deleteVoidAtGap(state: EditorState, sel: GapCursorSelection): Transaction | null {\n\tconst path = (findNodePath(state.doc, sel.blockId) ?? []) as BlockId[];\n\tconst nodeSel: NodeSelection = createNodeSelection(sel.blockId, path);\n\treturn deleteNodeSelection(state, nodeSel);\n}\n\n/** Inserts a new paragraph at a GapCursor position (before or after the void block). */\nexport function insertParagraphAtGap(\n\tstate: EditorState,\n\tsel: GapCursorSelection,\n): Transaction | null {\n\tconst path = findNodePath(state.doc, sel.blockId);\n\tif (!path) return null;\n\n\tconst parentPath: BlockId[] = extractParentPath(path);\n\tconst siblings = getSiblings(state, parentPath);\n\n\tconst index: number = findSiblingIndex(siblings, sel.blockId);\n\tif (index < 0) return null;\n\n\tconst insertIdx: number = sel.side === 'before' ? index : index + 1;\n\tconst newId = generateBlockId();\n\tconst builder = state.transaction('input');\n\tbuilder.insertNode(parentPath, insertIdx, createEmptyParagraph(newId));\n\tbuilder.setSelection(createCollapsedSelection(newId, 0));\n\treturn builder.build();\n}\n\n/** Inserts text in a new paragraph at a GapCursor position. */\nexport function insertTextAtGap(\n\tstate: EditorState,\n\tsel: GapCursorSelection,\n\ttext: string,\n\torigin: 'input' | 'paste',\n): Transaction {\n\tconst path = findNodePath(state.doc, sel.blockId);\n\tconst parentPath: BlockId[] = extractParentPath(path);\n\tconst siblings = getSiblings(state, parentPath);\n\n\tconst index: number = findSiblingIndex(siblings, sel.blockId);\n\tconst insertIdx: number =\n\t\tsel.side === 'before' ? Math.max(index, 0) : index >= 0 ? index + 1 : siblings.length;\n\n\tconst newId = generateBlockId();\n\tconst builder = state.transaction(origin);\n\tbuilder.insertNode(parentPath, insertIdx, createEmptyParagraph(newId));\n\tbuilder.insertText(newId, 0, text, []);\n\tbuilder.setSelection(createCollapsedSelection(newId, text.length));\n\treturn builder.build();\n}\n","/**\n * Mark-related commands: toggling bold/italic/underline and checking\n * whether a mark is active.\n */\n\nimport {\n\ttype BlockNode,\n\ttype Mark,\n\tgetBlockLength,\n\tgetBlockMarksAtOffset,\n\tgetInlineChildren,\n\thasMark,\n\tisTextNode,\n} from '../model/Document.js';\nimport { isMarkAllowed } from '../model/Schema.js';\nimport { isCollapsed, isTextSelection, selectionRange } from '../model/Selection.js';\nimport type { MarkTypeName } from '../model/TypeBrands.js';\nimport { markType as mkType } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport { forEachBlockInRange } from './RangeIterator.js';\n\n// --- Feature Configuration ---\n\nexport interface FeatureConfig {\n\treadonly bold: boolean;\n\treadonly italic: boolean;\n\treadonly underline: boolean;\n}\n\nconst defaultFeatures: FeatureConfig = { bold: true, italic: true, underline: true };\n\n/**\n * Toggles a mark on the current selection.\n * If collapsed, toggles stored marks. If range, applies/removes from text.\n */\nexport function toggleMark(\n\tstate: EditorState,\n\tmarkType: MarkTypeName,\n\tfeatures: FeatureConfig = defaultFeatures,\n): Transaction | null {\n\tif (isFeatureGated(markType, features)) return null;\n\tif (!isMarkAllowed(state.schema, markType)) return null;\n\tif (!isTextSelection(state.selection)) return null;\n\n\tconst mark: Mark = { type: markType };\n\tconst sel = state.selection;\n\n\tif (isCollapsed(sel)) {\n\t\t// Toggle stored marks\n\t\tconst anchorBlock = state.getBlock(sel.anchor.blockId);\n\t\tif (!anchorBlock) return null;\n\t\tconst currentMarks = state.storedMarks ?? getBlockMarksAtOffset(anchorBlock, sel.anchor.offset);\n\t\tconst hasIt = hasMark(currentMarks, markType);\n\t\tconst newMarks = hasIt\n\t\t\t? currentMarks.filter((m) => m.type !== markType)\n\t\t\t: [...currentMarks, mark];\n\n\t\treturn state\n\t\t\t.transaction('command')\n\t\t\t.setStoredMarks(newMarks, state.storedMarks)\n\t\t\t.setSelection(sel)\n\t\t\t.build();\n\t}\n\n\t// Range selection — apply/remove mark to all blocks in range\n\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst builder = state.transaction('command');\n\n\t// Determine if we should add or remove\n\tconst shouldRemove = isMarkActiveInRange(state, markType);\n\n\tforEachBlockInRange(state, range, (blockId, from, to) => {\n\t\tif (shouldRemove) {\n\t\t\tbuilder.removeMark(blockId, from, to, mark);\n\t\t} else {\n\t\t\tbuilder.addMark(blockId, from, to, mark);\n\t\t}\n\t});\n\n\tbuilder.setSelection(sel);\n\treturn builder.build();\n}\n\nexport function toggleBold(state: EditorState, features?: FeatureConfig): Transaction | null {\n\treturn toggleMark(state, mkType('bold'), features);\n}\n\nexport function toggleItalic(state: EditorState, features?: FeatureConfig): Transaction | null {\n\treturn toggleMark(state, mkType('italic'), features);\n}\n\nexport function toggleUnderline(state: EditorState, features?: FeatureConfig): Transaction | null {\n\treturn toggleMark(state, mkType('underline'), features);\n}\n\n/** Checks if a mark is active at the current selection. */\nexport function isMarkActive(state: EditorState, markType: MarkTypeName): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tif (isCollapsed(sel)) {\n\t\tif (state.storedMarks) {\n\t\t\treturn hasMark(state.storedMarks, markType);\n\t\t}\n\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\tif (!block) return false;\n\t\tconst marks = getBlockMarksAtOffset(block, sel.anchor.offset);\n\t\treturn hasMark(marks, markType);\n\t}\n\n\treturn isMarkActiveInRange(state, markType);\n}\n\n/** Checks if a mark is active across the entire selection range. */\nfunction isMarkActiveInRange(state: EditorState, markType: MarkTypeName): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\tconst blockOrder = state.getBlockOrder();\n\tconst range = selectionRange(sel, blockOrder);\n\n\tconst fromIdx = blockOrder.indexOf(range.from.blockId);\n\tconst toIdx = blockOrder.indexOf(range.to.blockId);\n\n\tfor (let i = fromIdx; i <= toIdx; i++) {\n\t\tconst blockId = blockOrder[i];\n\t\tif (!blockId) continue;\n\t\tconst block = state.getBlock(blockId);\n\t\tif (!block) continue;\n\t\tconst blockLen = getBlockLength(block);\n\t\tconst from = i === fromIdx ? range.from.offset : 0;\n\t\tconst to = i === toIdx ? range.to.offset : blockLen;\n\n\t\tif (!isMarkActiveInBlock(block, from, to, markType)) return false;\n\t}\n\n\treturn true;\n}\n\nfunction isMarkActiveInBlock(\n\tblock: BlockNode,\n\tfrom: number,\n\tto: number,\n\tmarkType: MarkTypeName,\n): boolean {\n\tif (from === to) return false;\n\tlet pos = 0;\n\tfor (const child of getInlineChildren(block)) {\n\t\tif (isTextNode(child)) {\n\t\t\tconst childEnd = pos + child.text.length;\n\t\t\tif (childEnd > from && pos < to) {\n\t\t\t\tif (!hasMark(child.marks, markType)) return false;\n\t\t\t}\n\t\t\tpos = childEnd;\n\t\t} else {\n\t\t\t// InlineNode: skip (width 1, no marks)\n\t\t\tpos += 1;\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction isFeatureGated(type: MarkTypeName, features: FeatureConfig): boolean {\n\tconst key = type as string;\n\tif (key === 'bold') return !features.bold;\n\tif (key === 'italic') return !features.italic;\n\tif (key === 'underline') return !features.underline;\n\treturn false;\n}\n","/**\n * Delete commands: character, word, and soft-line deletion in both directions.\n */\n\nimport {\n\ttype BlockNode,\n\tblockOffsetToTextOffset,\n\tgetBlockLength,\n\tgetBlockText,\n\tgetContentAtOffset,\n} from '../model/Document.js';\nimport { nextGraphemeSize, prevGraphemeSize } from '../model/GraphemeUtils.js';\nimport {\n\tcreateCollapsedSelection,\n\tisCollapsed,\n\tisGapCursor,\n\tisNodeSelection,\n} from '../model/Selection.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport { deleteSelectionCommand, mergeBlockBackward, mergeBlockForward } from './Commands.js';\nimport { deleteNodeSelection } from './NodeSelectionCommands.js';\nimport { findWordBoundaryBackward, findWordBoundaryForward } from './WordBoundary.js';\n\ninterface DeleteConfig {\n\treadonly merge: (state: EditorState) => Transaction | null;\n\treadonly range: (block: BlockNode, offset: number) => readonly [number, number] | null;\n}\n\nfunction deleteInDirection(state: EditorState, config: DeleteConfig): Transaction | null {\n\tconst sel = state.selection;\n\n\tif (isNodeSelection(sel)) return deleteNodeSelection(state, sel);\n\tif (isGapCursor(sel)) return null;\n\tif (!isCollapsed(sel)) return deleteSelectionCommand(state);\n\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return null;\n\n\tconst range = config.range(block, sel.anchor.offset);\n\tif (!range) return config.merge(state);\n\n\tconst [from, to] = range;\n\treturn state\n\t\t.transaction('input')\n\t\t.deleteTextAt(block.id, from, to)\n\t\t.setSelection(createCollapsedSelection(block.id, from))\n\t\t.build();\n}\n\n/** Handles backspace key. */\nexport function deleteBackward(state: EditorState): Transaction | null {\n\treturn deleteInDirection(state, {\n\t\tmerge: mergeBlockBackward,\n\t\trange: (block, offset) => {\n\t\t\tif (offset <= 0) return null;\n\t\t\tconst content = getContentAtOffset(block, offset - 1);\n\t\t\tif (content?.kind === 'inline') return [offset - 1, offset];\n\t\t\tconst text: string = getBlockText(block);\n\t\t\tconst textOffset: number = blockOffsetToTextOffset(block, offset);\n\t\t\tconst step: number = prevGraphemeSize(text, textOffset) || 1;\n\t\t\treturn [offset - step, offset];\n\t\t},\n\t});\n}\n\n/** Handles delete key. */\nexport function deleteForward(state: EditorState): Transaction | null {\n\treturn deleteInDirection(state, {\n\t\tmerge: mergeBlockForward,\n\t\trange: (block, offset) => {\n\t\t\tconst len: number = getBlockLength(block);\n\t\t\tif (offset >= len) return null;\n\t\t\tconst content = getContentAtOffset(block, offset);\n\t\t\tif (content?.kind === 'inline') return [offset, offset + 1];\n\t\t\tconst text: string = getBlockText(block);\n\t\t\tconst textOffset: number = blockOffsetToTextOffset(block, offset);\n\t\t\tconst step: number = nextGraphemeSize(text, textOffset) || 1;\n\t\t\treturn [offset, offset + step];\n\t\t},\n\t});\n}\n\n/** Handles Ctrl+Backspace: delete word backward. */\nexport function deleteWordBackward(state: EditorState): Transaction | null {\n\treturn deleteInDirection(state, {\n\t\tmerge: mergeBlockBackward,\n\t\trange: (block, offset) =>\n\t\t\toffset > 0 ? [findWordBoundaryBackward(block, offset), offset] : null,\n\t});\n}\n\n/** Handles Ctrl+Delete: delete word forward. */\nexport function deleteWordForward(state: EditorState): Transaction | null {\n\treturn deleteInDirection(state, {\n\t\tmerge: mergeBlockForward,\n\t\trange: (block, offset) => {\n\t\t\tconst len = getBlockLength(block);\n\t\t\treturn offset < len ? [offset, findWordBoundaryForward(block, offset)] : null;\n\t\t},\n\t});\n}\n\n/** Handles Cmd+Backspace: delete to start of line/block. */\nexport function deleteSoftLineBackward(state: EditorState): Transaction | null {\n\treturn deleteInDirection(state, {\n\t\tmerge: mergeBlockBackward,\n\t\trange: (_block, offset) => (offset > 0 ? [0, offset] : null),\n\t});\n}\n\n/** Handles Cmd+Delete: delete to end of line/block. */\nexport function deleteSoftLineForward(state: EditorState): Transaction | null {\n\treturn deleteInDirection(state, {\n\t\tmerge: mergeBlockForward,\n\t\trange: (block, offset) => {\n\t\t\tconst len = getBlockLength(block);\n\t\t\treturn offset < len ? [offset, len] : null;\n\t\t},\n\t});\n}\n","/**\n * Core editor commands and barrel re-exports from submodules.\n *\n * This module contains text insertion, block splitting, block merging,\n * selection deletion, and select-all. Mark, delete, gap-cursor, node-selection,\n * and word-boundary commands are re-exported from their respective modules.\n */\n\nimport {\n\ttype Mark,\n\tcreateEmptyParagraph,\n\tcreateInlineNode,\n\tgenerateBlockId,\n\tgetBlockLength,\n\tgetBlockMarksAtOffset,\n\tisLeafBlock,\n} from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport {\n\tcreateCollapsedSelection,\n\tcreateNodeSelection,\n\tcreateSelection,\n\tisCollapsed,\n\tisGapCursor,\n\tisNodeSelection,\n\tisTextSelection,\n\tselectionRange,\n} from '../model/Selection.js';\nimport { type BlockId, inlineType } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport {\n\tisInsideIsolating,\n\tisIsolatingBlock,\n\tisVoidBlock,\n\tsharesParent,\n} from '../state/NavigationQueries.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport type { TransactionBuilder } from '../state/Transaction.js';\nimport { resolveInsertPoint } from './CommandHelpers.js';\nimport { insertParagraphAtGap, insertTextAtGap } from './GapCursorCommands.js';\nimport {\n\tdeleteNodeSelection,\n\tfindFirstLeafBlockId,\n\tfindLastLeafBlockId,\n\tinsertParagraphAfterNodeSelection,\n\tinsertTextAfterNodeSelection,\n} from './NodeSelectionCommands.js';\n\n// --- Re-exports from submodules ---\n\nexport {\n\tcanCrossBlockBoundary,\n\tisInsideIsolating,\n\tisIsolatingBlock,\n\tisVoidBlock,\n\tsharesParent,\n} from '../state/NavigationQueries.js';\n\nexport type { FeatureConfig } from './MarkCommands.js';\nexport {\n\tisMarkActive,\n\ttoggleBold,\n\ttoggleItalic,\n\ttoggleMark,\n\ttoggleUnderline,\n} from './MarkCommands.js';\n\nexport {\n\tdeleteBackward,\n\tdeleteForward,\n\tdeleteSoftLineBackward,\n\tdeleteSoftLineForward,\n\tdeleteWordBackward,\n\tdeleteWordForward,\n} from './DeleteCommands.js';\n\nexport {\n\tdeleteNodeSelection,\n\tfindFirstLeafBlockId,\n\tfindLastLeafBlockId,\n\tinsertParagraphAfterNodeSelection,\n\tinsertTextAfterNodeSelection,\n\tnavigateArrowIntoVoid,\n} from './NodeSelectionCommands.js';\n\nexport {\n\tdeleteBackwardAtGap,\n\tdeleteForwardAtGap,\n\tinsertParagraphAtGap,\n\tinsertTextAtGap,\n} from './GapCursorCommands.js';\n\nexport {\n\tfindWordBoundaryBackward,\n\tfindWordBoundaryForward,\n} from './WordBoundary.js';\n\nexport {\n\tapplyAttributedMark,\n\tgetMarkAttrAtSelection,\n\tisAttributedMarkActive,\n\tremoveAttributedMark,\n} from './AttributedMarkCommands.js';\n\nexport { forEachBlockIdInRange, forEachBlockInRange } from './RangeIterator.js';\n\n// --- Text Commands ---\n\n/** Inserts text at the current selection, replacing any selected range. */\nexport function insertTextCommand(\n\tstate: EditorState,\n\ttext: string,\n\torigin: 'input' | 'paste' = 'input',\n): Transaction {\n\tconst sel = state.selection;\n\n\t// NodeSelection: insert paragraph after void block with the text\n\tif (isNodeSelection(sel)) {\n\t\treturn insertTextAfterNodeSelection(state, sel, text, origin);\n\t}\n\n\t// GapCursor: insert paragraph at the gap position with the text\n\tif (isGapCursor(sel)) {\n\t\treturn insertTextAtGap(state, sel, text, origin);\n\t}\n\n\tconst builder = state.transaction(origin);\n\tconst marks = resolveActiveMarks(state);\n\n\tlet landingId: BlockId | undefined;\n\tif (!isCollapsed(sel)) {\n\t\tlandingId = addDeleteSelectionSteps(state, builder);\n\t}\n\n\tconst resolved = resolveInsertPoint(sel, state.getBlockOrder());\n\tconst insertBlockId: BlockId = landingId ?? resolved.blockId;\n\tconst insertOffset: number = landingId ? 0 : resolved.offset;\n\n\tbuilder.insertText(insertBlockId, insertOffset, text, marks);\n\tbuilder.setSelection(createCollapsedSelection(insertBlockId, insertOffset + text.length));\n\n\treturn builder.build();\n}\n\n/** Deletes the current selection. */\nexport function deleteSelectionCommand(state: EditorState): Transaction | null {\n\tif (isNodeSelection(state.selection)) {\n\t\treturn deleteNodeSelection(state, state.selection);\n\t}\n\tif (isGapCursor(state.selection)) return null;\n\tif (isCollapsed(state.selection)) return null;\n\n\tconst builder = state.transaction('input');\n\tconst landingId: BlockId | undefined = addDeleteSelectionSteps(state, builder);\n\n\tconst range = selectionRange(state.selection, state.getBlockOrder());\n\tconst cursorBlockId: BlockId = landingId ?? range.from.blockId;\n\tconst cursorOffset: number = landingId ? 0 : range.from.offset;\n\tbuilder.setSelection(createCollapsedSelection(cursorBlockId, cursorOffset));\n\n\treturn builder.build();\n}\n\n/** Splits the current block at the cursor position (Enter key). */\nexport function splitBlockCommand(state: EditorState): Transaction | null {\n\tconst sel = state.selection;\n\n\t// NodeSelection: insert empty paragraph after the void block\n\tif (isNodeSelection(sel)) {\n\t\treturn insertParagraphAfterNodeSelection(state, sel);\n\t}\n\n\t// GapCursor: insert empty paragraph at the gap position\n\tif (isGapCursor(sel)) {\n\t\treturn insertParagraphAtGap(state, sel);\n\t}\n\n\tconst builder = state.transaction('input');\n\n\tlet landingId: BlockId | undefined;\n\tif (!isCollapsed(sel)) {\n\t\tlandingId = addDeleteSelectionSteps(state, builder);\n\t}\n\n\tconst resolved = resolveInsertPoint(sel, state.getBlockOrder());\n\tconst blockId: BlockId = landingId ?? resolved.blockId;\n\tconst offset: number = landingId ? 0 : resolved.offset;\n\tconst newBlockId = generateBlockId();\n\n\t// splitBlock operates at the same level in the tree — the StepApplication\n\t// handles this correctly because it looks up the block by ID recursively.\n\tbuilder.splitBlock(blockId, offset, newBlockId);\n\tbuilder.setSelection(createCollapsedSelection(newBlockId, 0));\n\n\treturn builder.build();\n}\n\n/** Inserts a hard line break (InlineNode) at the current cursor position. */\nexport function insertHardBreakCommand(state: EditorState): Transaction | null {\n\tconst sel = state.selection;\n\n\tif (!isTextSelection(sel)) return null;\n\n\tconst builder = state.transaction('input');\n\n\tlet cursorBlockId: BlockId | undefined;\n\tif (!isCollapsed(sel)) {\n\t\tconst landingId: BlockId | undefined = addDeleteSelectionSteps(state, builder);\n\t\tcursorBlockId = landingId;\n\t}\n\n\tif (cursorBlockId) {\n\t\t// Cross-root deletion replaced from-block; insert hard break in landing block\n\t\tbuilder.insertInlineNode(cursorBlockId, 0, createInlineNode(inlineType('hard_break')));\n\t\tbuilder.setSelection(createCollapsedSelection(cursorBlockId, 1));\n\t} else {\n\t\tconst { blockId: insertBlockId, offset: insertOffset } = resolveInsertPoint(\n\t\t\tsel,\n\t\t\tstate.getBlockOrder(),\n\t\t);\n\t\tbuilder.insertInlineNode(\n\t\t\tinsertBlockId,\n\t\t\tinsertOffset,\n\t\t\tcreateInlineNode(inlineType('hard_break')),\n\t\t);\n\t\tbuilder.setSelection(createCollapsedSelection(insertBlockId, insertOffset + 1));\n\t}\n\n\treturn builder.build();\n}\n\n/**\n * Merges the current block with the previous block, respecting\n * isolating boundaries and void blocks.\n */\nexport function mergeBlockBackward(state: EditorState): Transaction | null {\n\treturn mergeAdjacentBlock(state, 'backward');\n}\n\n/**\n * Merges the next block into the current block, respecting\n * isolating boundaries and void blocks.\n */\nexport function mergeBlockForward(state: EditorState): Transaction | null {\n\treturn mergeAdjacentBlock(state, 'forward');\n}\n\n/**\n * Shared implementation for merging adjacent blocks in either direction.\n * Validates selection, isolating boundaries, and void blocks before merging.\n */\nfunction mergeAdjacentBlock(\n\tstate: EditorState,\n\tdirection: 'backward' | 'forward',\n): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst blockOrder = state.getBlockOrder();\n\tconst blockIdx: number = blockOrder.indexOf(sel.anchor.blockId);\n\n\tconst adjacentIdx: number = direction === 'backward' ? blockIdx - 1 : blockIdx + 1;\n\tif (adjacentIdx < 0 || adjacentIdx >= blockOrder.length) return null;\n\n\tconst adjacentId: BlockId | undefined = blockOrder[adjacentIdx];\n\tif (!adjacentId) return null;\n\n\tif (isIsolatingBlock(state, sel.anchor.blockId) || isIsolatingBlock(state, adjacentId)) {\n\t\treturn null;\n\t}\n\tif (!sharesParent(state, sel.anchor.blockId, adjacentId)) {\n\t\tif (isInsideIsolating(state, sel.anchor.blockId)) return null;\n\t}\n\n\tif (isVoidBlock(state, adjacentId)) {\n\t\tconst path = findNodePath(state.doc, adjacentId) ?? [];\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.setSelection(createNodeSelection(adjacentId, path as BlockId[]))\n\t\t\t.build();\n\t}\n\n\tif (direction === 'backward') {\n\t\tconst prevBlock = state.getBlock(adjacentId);\n\t\tif (!prevBlock) return null;\n\t\tconst prevLen: number = getBlockLength(prevBlock);\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.mergeBlocksAt(adjacentId, sel.anchor.blockId)\n\t\t\t.setSelection(createCollapsedSelection(adjacentId, prevLen))\n\t\t\t.build();\n\t}\n\n\treturn state\n\t\t.transaction('input')\n\t\t.mergeBlocksAt(sel.anchor.blockId, adjacentId)\n\t\t.setSelection(createCollapsedSelection(sel.anchor.blockId, sel.anchor.offset))\n\t\t.build();\n}\n\n/** Selects all content in the editor, using leaf block endpoints. */\nexport function selectAll(state: EditorState): Transaction {\n\tconst blocks = state.doc.children;\n\tconst firstBlock = blocks[0];\n\tconst lastBlock = blocks[blocks.length - 1];\n\tif (!firstBlock || !lastBlock)\n\t\treturn state.transaction('command').setSelection(state.selection).build();\n\n\tconst firstLeafId: BlockId = findFirstLeafBlockId(firstBlock);\n\tconst lastLeafId: BlockId = findLastLeafBlockId(lastBlock);\n\tconst lastLeaf = state.getBlock(lastLeafId);\n\tconst lastLeafLen: number = lastLeaf ? getBlockLength(lastLeaf) : 0;\n\n\treturn state\n\t\t.transaction('command')\n\t\t.setSelection(\n\t\t\tcreateSelection(\n\t\t\t\t{ blockId: firstLeafId, offset: 0 },\n\t\t\t\t{ blockId: lastLeafId, offset: lastLeafLen },\n\t\t\t),\n\t\t)\n\t\t.build();\n}\n\n// --- Internal Helpers ---\n\nfunction resolveActiveMarks(state: EditorState): readonly Mark[] {\n\tif (state.storedMarks) return state.storedMarks;\n\tif (!isTextSelection(state.selection)) return [];\n\n\tconst block = state.getBlock(state.selection.anchor.blockId);\n\tif (!block) return [];\n\n\treturn getBlockMarksAtOffset(block, state.selection.anchor.offset);\n}\n\n/**\n * Adds steps to delete the current text selection.\n * Returns a replacement cursor block ID when the original from-block\n * was inside a composite root that got removed (undefined otherwise).\n */\nexport function addDeleteSelectionSteps(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n): BlockId | undefined {\n\tif (!isTextSelection(state.selection)) return undefined;\n\tconst blockOrder = state.getBlockOrder();\n\tconst range = selectionRange(state.selection, blockOrder);\n\tconst fromIdx = blockOrder.indexOf(range.from.blockId);\n\tconst toIdx = blockOrder.indexOf(range.to.blockId);\n\n\tif (fromIdx === toIdx) {\n\t\tbuilder.deleteTextAt(range.from.blockId, range.from.offset, range.to.offset);\n\t\treturn undefined;\n\t}\n\n\tconst fromRootIdx: number = getRootBlockIndex(state, range.from.blockId);\n\tconst toRootIdx: number = getRootBlockIndex(state, range.to.blockId);\n\n\tif (fromRootIdx === toRootIdx || fromRootIdx < 0 || toRootIdx < 0) {\n\t\tdeleteLeafRange(state, builder, blockOrder, range, fromIdx, toIdx);\n\t\treturn undefined;\n\t}\n\n\treturn deleteCrossRootRange(state, builder, range, fromRootIdx, toRootIdx);\n}\n\n/** Returns the root-level ancestor index in doc.children for a given block. */\nfunction getRootBlockIndex(state: EditorState, blockId: BlockId): number {\n\tconst path = findNodePath(state.doc, blockId);\n\tif (!path || path.length === 0) return -1;\n\tconst rootId: string = path[0] as string;\n\treturn state.doc.children.findIndex((c) => c.id === rootId);\n}\n\n/** Deletes a multi-block selection where all blocks share the same root ancestor. */\nfunction deleteLeafRange(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tblockOrder: readonly BlockId[],\n\trange: {\n\t\treadonly from: { readonly blockId: BlockId; readonly offset: number };\n\t\treadonly to: { readonly blockId: BlockId; readonly offset: number };\n\t},\n\tfromIdx: number,\n\ttoIdx: number,\n): void {\n\tconst firstBlock = state.getBlock(range.from.blockId);\n\tif (!firstBlock) return;\n\tconst firstLen = getBlockLength(firstBlock);\n\n\tif (range.from.offset < firstLen) {\n\t\tbuilder.deleteTextAt(range.from.blockId, range.from.offset, firstLen);\n\t}\n\n\tif (range.to.offset > 0) {\n\t\tbuilder.deleteTextAt(range.to.blockId, 0, range.to.offset);\n\t}\n\n\tfor (let i = fromIdx + 1; i < toIdx; i++) {\n\t\tconst midBlockId = blockOrder[i];\n\t\tif (!midBlockId) continue;\n\t\tconst midBlock = state.getBlock(midBlockId);\n\t\tif (!midBlock) continue;\n\t\tconst midLen = getBlockLength(midBlock);\n\t\tif (midLen > 0) {\n\t\t\tbuilder.deleteTextAt(midBlockId, 0, midLen);\n\t\t}\n\t\tbuilder.mergeBlocksAt(range.from.blockId, midBlockId);\n\t}\n\n\tbuilder.mergeBlocksAt(range.from.blockId, range.to.blockId);\n}\n\n/**\n * Deletes a selection spanning different root-level ancestors.\n * Removes intermediate and composite root blocks, merges leaf roots.\n * Returns a replacement cursor block ID if from was inside a removed composite.\n */\nfunction deleteCrossRootRange(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\trange: {\n\t\treadonly from: { readonly blockId: BlockId; readonly offset: number };\n\t\treadonly to: { readonly blockId: BlockId; readonly offset: number };\n\t},\n\tfromRootIdx: number,\n\ttoRootIdx: number,\n): BlockId | undefined {\n\tconst fromRoot = state.doc.children[fromRootIdx];\n\tconst toRoot = state.doc.children[toRootIdx];\n\tif (!fromRoot || !toRoot) return undefined;\n\n\tconst fromIsLeaf: boolean = isLeafBlock(fromRoot);\n\tconst toIsLeaf: boolean = isLeafBlock(toRoot);\n\n\t// When from is inside a composite root, insert a landing paragraph\n\t// so callers can reference a surviving block for cursor/insert.\n\tlet landingId: BlockId | undefined;\n\tlet indexShift = 0;\n\n\tif (!fromIsLeaf) {\n\t\tlandingId = generateBlockId();\n\t\tbuilder.insertNode([], fromRootIdx, createEmptyParagraph(landingId));\n\t\tindexShift = 1;\n\t}\n\n\t// Delete text in from-leaf (only for leaf roots; composite roots are removed entirely)\n\tif (fromIsLeaf) {\n\t\tconst fromBlock = state.getBlock(range.from.blockId);\n\t\tif (fromBlock) {\n\t\t\tconst fromLen: number = getBlockLength(fromBlock);\n\t\t\tif (range.from.offset < fromLen) {\n\t\t\t\tbuilder.deleteTextAt(range.from.blockId, range.from.offset, fromLen);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Delete text in to-leaf (only for leaf roots)\n\tif (toIsLeaf && range.to.offset > 0) {\n\t\tbuilder.deleteTextAt(range.to.blockId, 0, range.to.offset);\n\t}\n\n\t// Remove root-level blocks in descending index order.\n\t// Keep from-root if it's a leaf; remove if composite (shifted by indexShift).\n\t// Keep to-root if it's a leaf (will merge into from); remove if composite.\n\tconst removeEnd: number = toIsLeaf ? toRootIdx - 1 + indexShift : toRootIdx + indexShift;\n\tconst removeStart: number = fromIsLeaf ? fromRootIdx + 1 : fromRootIdx + indexShift;\n\n\tfor (let i = removeEnd; i >= removeStart; i--) {\n\t\tbuilder.removeNode([], i);\n\t}\n\n\t// Merge to-root into from if both are leaf roots\n\tif (fromIsLeaf && toIsLeaf) {\n\t\tbuilder.mergeBlocksAt(range.from.blockId, range.to.blockId);\n\t}\n\n\treturn landingId;\n}\n"],"mappings":"wpBAgBA,SAAgB,IACf,MAAO,CACN,UAAW,CAAC,aACZ,UAAW,CAAC,OAAQ,SAAU,aAC9B,YAAA,QAKF,SAAgB,EAAmB,GAClC,MAAO,CACN,UAAW,EAAS,eACpB,UAAW,EAAS,eACpB,YAAc,GAAiB,EAAS,YAAY,IAKtD,SAAgB,EAAc,EAAgB,GAC7C,OAAO,EAAO,UAAU,SAAS,GAIlC,SAAgB,EAAkB,EAAgB,GACjD,OAAO,EAAO,UAAU,SAAS,GCjBlC,SAAgB,EACf,EACA,GAEA,GAAiB,UAAb,EAAI,KACP,OAAO,EAAgB,EAAO,GAI/B,MAAM,EAAiC,EAAM,gBACvC,EAAmB,EAAW,QAAQ,EAAI,SAEhD,GAAI,GAAY,EAAG,OAAO,KAE1B,MAAM,EAA8B,EAAW,EAAW,GAC1D,IAAK,EAAQ,OAAO,KAEpB,GAAI,EAAY,EAAO,GAAS,CAC/B,MAAM,EAAO,EAAa,EAAM,IAAK,IAAW,GAChD,OAAO,EACL,YAAY,SACZ,aAAa,EAAoB,EAAQ,IACzC,QAGH,MAAM,EAAY,EAAM,SAAS,GACjC,IAAK,EAAW,OAAO,KACvB,MAAM,EAAkB,EAAe,GACvC,OAAO,EAA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GACZ,EAAQ,aAAa,EAAY,EAAG,GAErC,EAAQ,cAAc,EAAM,KAAK,QAAS,GAG3C,EAAQ,cAAc,EAAM,KAAK,QAAS,EAAM,GAAG,SAnDlD,CAAgB,EAAO,EAAS,EAAY,EAAO,EAAS,GAQ9D,SAAS,GAAkB,EAAoB,GAC9C,MAAM,EAAO,EAAa,EAAM,IAAK,GACrC,IAAK,GAAwB,IAAhB,EAAK,OAAc,OAAO,EACvC,MAAM,EAAiB,EAAK,GAC5B,OAAO,EAAM,IAAI,SAAS,UAAW,GAAM,EAAE,KAAO"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function t(t,r){switch(t.type){case"inline":return function(t,r){switch(r.type){case"insertText":return function(t,e){if(t.blockId!==e.blockId)return t;const o=e.text.length,r=t.from>e.offset?t.from+o:t.from,n=t.to>=e.offset?t.to+o:t.to;return r===t.from&&n===t.to?t:{...t,from:r,to:n}}(t,r);case"deleteText":return function(t,e){if(t.blockId!==e.blockId)return t;const r=e.to-e.from,n=o(t.from,e.from,e.to,r),s=o(t.to,e.from,e.to,r);return n>=s?null:n===t.from&&s===t.to?t:{...t,from:n,to:s}}(t,r);case"splitBlock":return function(t,e){return t.blockId!==e.blockId||t.to<=e.offset?t:t.from>=e.offset?{...t,blockId:e.newBlockId,from:t.from-e.offset,to:t.to-e.offset}:[{...t,to:e.offset},{...t,blockId:e.newBlockId,from:0,to:t.to-e.offset}]}(t,r);case"mergeBlocks":return function(t,e){return t.blockId!==e.sourceBlockId?t:{...t,blockId:e.targetBlockId,from:t.from+e.targetLengthBefore,to:t.to+e.targetLengthBefore}}(t,r);case"removeNode":return e(t,r);default:return t}}(t,r);case"widget":return function(t,o){switch(o.type){case"insertText":return function(t,e){if(t.blockId!==e.blockId)return t;const o=e.text.length;return t.offset>e.offset||t.offset===e.offset&&t.side>=1?{...t,offset:t.offset+o}:t}(t,o);case"deleteText":return function(t,e){if(t.blockId!==e.blockId)return t;if(t.offset>e.from&&t.offset<e.to)return null;const o=e.to-e.from;return t.offset>=e.to?{...t,offset:t.offset-o}:t}(t,o);case"splitBlock":return function(t,e){return t.blockId!==e.blockId||t.offset<e.offset?t:t.offset>e.offset?{...t,blockId:e.newBlockId,offset:t.offset-e.offset}:t.side>=1?{...t,blockId:e.newBlockId,offset:0}:t}(t,o);case"mergeBlocks":return function(t,e){return t.blockId!==e.sourceBlockId?t:{...t,blockId:e.targetBlockId,offset:t.offset+e.targetLengthBefore}}(t,o);case"removeNode":return e(t,o);default:return t}}(t,r);case"node":return function(t,o){switch(o.type){case"mergeBlocks":return function(t,e){return t.blockId===e.sourceBlockId?null:t}(t,o);case"removeNode":return e(t,o);default:return t}}(t,r)}}function e(t,e){return t.blockId===e.removedNode.id?null:t}function o(t,e,o,r){return t<=e?t:t>=o?t-r:e}function r(t,e,o,r){return{type:"inline",blockId:t,from:e,to:o,attrs:r}}function n(t,e){return{type:"node",blockId:t,attrs:e}}function s(t,e,o,r){return{type:"widget",blockId:t,offset:e,toDOM:o,side:r?.side??-1,key:r?.key}}var f=class e{static empty=new e(/* @__PURE__ */new Map);constructor(t){this.byBlock=t}static create(t){if(0===t.length)return e.empty;const o=/* @__PURE__ */new Map;for(const e of t){const t=o.get(e.blockId);t?t.push(e):o.set(e.blockId,[e])}return new e(o)}find(t){return this.byBlock.get(t)??[]}findInline(t){const e=this.byBlock.get(t);return e?e.filter(t=>"inline"===t.type):[]}findNode(t){const e=this.byBlock.get(t);return e?e.filter(t=>"node"===t.type):[]}findWidget(t){const e=this.byBlock.get(t);return e?e.filter(t=>"widget"===t.type):[]}add(t){if(0===t.length)return this;if(this.isEmpty)return e.create(t);const o=/* @__PURE__ */new Map;for(const[e,r]of this.byBlock)o.set(e,[...r]);for(const e of t){const t=o.get(e.blockId);t?t.push(e):o.set(e.blockId,[e])}return new e(o)}remove(t){const o=/* @__PURE__ */new Map;let r=!1;for(const[e,n]of this.byBlock){const s=n.filter(e=>!t(e));s.length!==n.length&&(r=!0),s.length>0&&o.set(e,s)}return r?0===o.size?e.empty:new e(o):this}merge(t){if(t.isEmpty)return this;if(this.isEmpty)return t;const o=/* @__PURE__ */new Map;for(const[e,r]of this.byBlock)o.set(e,[...r]);for(const[e,r]of t.byBlock){const t=o.get(e);t?t.push(...r):o.set(e,[...r])}return new e(o)}equals(t){if(this===t)return!0;if(this.byBlock.size!==t.byBlock.size)return!1;for(const[e,o]of this.byBlock){const r=t.byBlock.get(e);if(!r)return!1;if(!c(o,r))return!1}return!0}get isEmpty(){return 0===this.byBlock.size}map(o){if(this.isEmpty||0===o.steps.length)return this;let r=[];for(const t of this.byBlock.values())for(const e of t)r.push(e);for(const e of o.steps){const o=[];for(const n of r){const r=t(n,e);if(null!==r)if(Array.isArray(r))for(const t of r)o.push(t);else o.push(r)}r=o}return 0===r.length?e.empty:e.create(r)}};function c(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++){const r=t[o],n=e[o];if(!r||!n||!i(r,n))return!1}return!0}function i(t,e){if(t.type!==e.type)return!1;if(t.blockId!==e.blockId)return!1;switch(t.type){case"inline":{const o=e;return t.from===o.from&&t.to===o.to&&u(t.attrs,o.attrs)}case"node":{const o=e;return u(t.attrs,o.attrs)}case"widget":{const o=e;return t.offset===o.offset&&t.side===o.side&&t.key===o.key&&t.toDOM===o.toDOM}}}function u(t,e){if(t===e)return!0;const o=Object.keys(t),r=Object.keys(e);if(o.length!==r.length)return!1;for(const n of o)if(t[n]!==e[n])return!1;return!0}export{s as a,n as i,c as n,r,f as t};
|
|
2
|
-
//# sourceMappingURL=Decoration-oeHDjWWq.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Decoration-oeHDjWWq.mjs","names":[],"sources":["../../src/decorations/PositionMapping.ts","../../src/decorations/Decoration.ts"],"sourcesContent":["/**\n * Pure functions for mapping decorations through transaction steps.\n * Handles position adjustments when the document changes — insertions,\n * deletions, splits, merges, and structural node removal.\n */\n\nimport type {\n\tDeleteTextStep,\n\tInsertTextStep,\n\tMergeBlocksStep,\n\tRemoveNodeStep,\n\tSplitBlockStep,\n\tStep,\n} from '../state/Transaction.js';\nimport type {\n\tDecoration,\n\tInlineDecoration,\n\tNodeDecoration,\n\tWidgetDecoration,\n} from './Decoration.js';\n\n/**\n * Maps a single decoration through a step.\n * Returns the mapped decoration, an array (when a split produces two),\n * or null if the decoration was deleted by the step.\n */\nexport function mapDecorationThroughStep(\n\tdeco: Decoration,\n\tstep: Step,\n): Decoration | readonly Decoration[] | null {\n\tswitch (deco.type) {\n\t\tcase 'inline':\n\t\t\treturn mapInline(deco, step);\n\t\tcase 'widget':\n\t\t\treturn mapWidget(deco, step);\n\t\tcase 'node':\n\t\t\treturn mapNode(deco, step);\n\t}\n}\n\nfunction mapInline(\n\tdeco: InlineDecoration,\n\tstep: Step,\n): InlineDecoration | readonly InlineDecoration[] | null {\n\tswitch (step.type) {\n\t\tcase 'insertText':\n\t\t\treturn mapInlineInsert(deco, step);\n\t\tcase 'deleteText':\n\t\t\treturn mapInlineDelete(deco, step);\n\t\tcase 'splitBlock':\n\t\t\treturn mapInlineSplit(deco, step);\n\t\tcase 'mergeBlocks':\n\t\t\treturn mapInlineMerge(deco, step);\n\t\tcase 'removeNode':\n\t\t\treturn removeIfBlockDeleted(deco, step);\n\t\tdefault:\n\t\t\treturn deco;\n\t}\n}\n\nfunction mapWidget(deco: WidgetDecoration, step: Step): WidgetDecoration | null {\n\tswitch (step.type) {\n\t\tcase 'insertText':\n\t\t\treturn mapWidgetInsert(deco, step);\n\t\tcase 'deleteText':\n\t\t\treturn mapWidgetDelete(deco, step);\n\t\tcase 'splitBlock':\n\t\t\treturn mapWidgetSplit(deco, step);\n\t\tcase 'mergeBlocks':\n\t\t\treturn mapWidgetMerge(deco, step);\n\t\tcase 'removeNode':\n\t\t\treturn removeIfBlockDeleted(deco, step);\n\t\tdefault:\n\t\t\treturn deco;\n\t}\n}\n\nfunction mapNode(deco: NodeDecoration, step: Step): NodeDecoration | null {\n\tswitch (step.type) {\n\t\tcase 'mergeBlocks':\n\t\t\treturn mapNodeMerge(deco, step);\n\t\tcase 'removeNode':\n\t\t\treturn removeIfBlockDeleted(deco, step);\n\t\tdefault:\n\t\t\treturn deco;\n\t}\n}\n\n// --- InsertText ---\n\nfunction mapInlineInsert(deco: InlineDecoration, step: InsertTextStep): InlineDecoration {\n\tif (deco.blockId !== step.blockId) return deco;\n\n\tconst len: number = step.text.length;\n\t// from: assoc=-1 (stays at boundary — only shifts if insertion is strictly before)\n\tconst newFrom: number = deco.from > step.offset ? deco.from + len : deco.from;\n\t// to: assoc=1 (moves past insertion — shifts if insertion is at or before)\n\tconst newTo: number = deco.to >= step.offset ? deco.to + len : deco.to;\n\n\tif (newFrom === deco.from && newTo === deco.to) return deco;\n\treturn { ...deco, from: newFrom, to: newTo };\n}\n\nfunction mapWidgetInsert(deco: WidgetDecoration, step: InsertTextStep): WidgetDecoration {\n\tif (deco.blockId !== step.blockId) return deco;\n\n\tconst len: number = step.text.length;\n\t// At boundary: side=-1 means \"before insertion\" (assoc=-1, stays), side=1 means \"after\" (moves)\n\tif (deco.offset > step.offset) {\n\t\treturn { ...deco, offset: deco.offset + len };\n\t}\n\tif (deco.offset === step.offset && deco.side >= 1) {\n\t\treturn { ...deco, offset: deco.offset + len };\n\t}\n\treturn deco;\n}\n\n// --- DeleteText ---\n\nfunction mapInlineDelete(deco: InlineDecoration, step: DeleteTextStep): InlineDecoration | null {\n\tif (deco.blockId !== step.blockId) return deco;\n\n\tconst delLen: number = step.to - step.from;\n\tconst newFrom: number = clampAndShift(deco.from, step.from, step.to, delLen);\n\tconst newTo: number = clampAndShift(deco.to, step.from, step.to, delLen);\n\n\tif (newFrom >= newTo) return null;\n\tif (newFrom === deco.from && newTo === deco.to) return deco;\n\treturn { ...deco, from: newFrom, to: newTo };\n}\n\nfunction mapWidgetDelete(deco: WidgetDecoration, step: DeleteTextStep): WidgetDecoration | null {\n\tif (deco.blockId !== step.blockId) return deco;\n\n\t// Widget strictly inside deleted range → deleted\n\tif (deco.offset > step.from && deco.offset < step.to) return null;\n\n\tconst delLen: number = step.to - step.from;\n\tif (deco.offset >= step.to) {\n\t\treturn { ...deco, offset: deco.offset - delLen };\n\t}\n\treturn deco;\n}\n\n// --- SplitBlock ---\n\nfunction mapInlineSplit(\n\tdeco: InlineDecoration,\n\tstep: SplitBlockStep,\n): InlineDecoration | readonly InlineDecoration[] {\n\tif (deco.blockId !== step.blockId) return deco;\n\n\t// Entirely before split point → unchanged\n\tif (deco.to <= step.offset) return deco;\n\n\t// Entirely after split point → move to new block, adjust offsets\n\tif (deco.from >= step.offset) {\n\t\treturn {\n\t\t\t...deco,\n\t\t\tblockId: step.newBlockId,\n\t\t\tfrom: deco.from - step.offset,\n\t\t\tto: deco.to - step.offset,\n\t\t};\n\t}\n\n\t// Spanning the split point → split into two decorations\n\tconst left: InlineDecoration = { ...deco, to: step.offset };\n\tconst right: InlineDecoration = {\n\t\t...deco,\n\t\tblockId: step.newBlockId,\n\t\tfrom: 0,\n\t\tto: deco.to - step.offset,\n\t};\n\treturn [left, right];\n}\n\nfunction mapWidgetSplit(deco: WidgetDecoration, step: SplitBlockStep): WidgetDecoration {\n\tif (deco.blockId !== step.blockId) return deco;\n\n\t// Before split → stays\n\tif (deco.offset < step.offset) return deco;\n\n\t// After split → new block\n\tif (deco.offset > step.offset) {\n\t\treturn {\n\t\t\t...deco,\n\t\t\tblockId: step.newBlockId,\n\t\t\toffset: deco.offset - step.offset,\n\t\t};\n\t}\n\n\t// At boundary: side determines which block\n\tif (deco.side >= 1) {\n\t\treturn {\n\t\t\t...deco,\n\t\t\tblockId: step.newBlockId,\n\t\t\toffset: 0,\n\t\t};\n\t}\n\treturn deco;\n}\n\n// --- MergeBlocks ---\n\nfunction mapInlineMerge(deco: InlineDecoration, step: MergeBlocksStep): InlineDecoration {\n\tif (deco.blockId !== step.sourceBlockId) return deco;\n\n\treturn {\n\t\t...deco,\n\t\tblockId: step.targetBlockId,\n\t\tfrom: deco.from + step.targetLengthBefore,\n\t\tto: deco.to + step.targetLengthBefore,\n\t};\n}\n\nfunction mapWidgetMerge(deco: WidgetDecoration, step: MergeBlocksStep): WidgetDecoration {\n\tif (deco.blockId !== step.sourceBlockId) return deco;\n\n\treturn {\n\t\t...deco,\n\t\tblockId: step.targetBlockId,\n\t\toffset: deco.offset + step.targetLengthBefore,\n\t};\n}\n\nfunction mapNodeMerge(deco: NodeDecoration, step: MergeBlocksStep): NodeDecoration | null {\n\t// Source block disappears → delete its node decoration\n\tif (deco.blockId === step.sourceBlockId) return null;\n\treturn deco;\n}\n\n// --- RemoveNode ---\n\nfunction removeIfBlockDeleted<T extends Decoration>(deco: T, step: RemoveNodeStep): T | null {\n\tif (deco.blockId === step.removedNode.id) return null;\n\treturn deco;\n}\n\n// --- Helpers ---\n\nfunction clampAndShift(pos: number, delFrom: number, delTo: number, delLen: number): number {\n\tif (pos <= delFrom) return pos;\n\tif (pos >= delTo) return pos - delLen;\n\treturn delFrom;\n}\n","/**\n * Decoration types and DecorationSet for transient, view-only annotations.\n * Decorations are NOT part of the document model and do NOT affect undo/redo.\n */\n\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport { mapDecorationThroughStep } from './PositionMapping.js';\n\n// --- Decoration Attrs ---\n\nexport interface DecorationAttrs {\n\treadonly class?: string;\n\treadonly style?: string;\n\treadonly nodeName?: string;\n\treadonly [key: string]: string | undefined;\n}\n\n// --- Decoration Types ---\n\nexport interface InlineDecoration {\n\treadonly type: 'inline';\n\treadonly blockId: BlockId;\n\treadonly from: number;\n\treadonly to: number;\n\treadonly attrs: DecorationAttrs;\n}\n\nexport interface NodeDecoration {\n\treadonly type: 'node';\n\treadonly blockId: BlockId;\n\treadonly attrs: DecorationAttrs;\n}\n\nexport interface WidgetDecoration {\n\treadonly type: 'widget';\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n\treadonly toDOM: () => HTMLElement;\n\treadonly side: -1 | 1;\n\treadonly key?: string;\n}\n\nexport type Decoration = InlineDecoration | NodeDecoration | WidgetDecoration;\n\n// --- Factory Functions ---\n\n/** Creates an inline decoration for a text range within a block. */\nexport function inline(\n\tblockId: BlockId,\n\tfrom: number,\n\tto: number,\n\tattrs: DecorationAttrs,\n): InlineDecoration {\n\treturn { type: 'inline', blockId, from, to, attrs };\n}\n\n/** Creates a node decoration that applies to a whole block element. */\nexport function node(blockId: BlockId, attrs: DecorationAttrs): NodeDecoration {\n\treturn { type: 'node', blockId, attrs };\n}\n\n/** Creates a widget decoration that inserts a DOM element at a position. */\nexport function widget(\n\tblockId: BlockId,\n\toffset: number,\n\ttoDOM: () => HTMLElement,\n\toptions?: { readonly side?: -1 | 1; readonly key?: string },\n): WidgetDecoration {\n\treturn {\n\t\ttype: 'widget',\n\t\tblockId,\n\t\toffset,\n\t\ttoDOM,\n\t\tside: options?.side ?? -1,\n\t\tkey: options?.key,\n\t};\n}\n\n// --- DecorationSet ---\n\n/**\n * Immutable set of decorations indexed by block ID.\n * Provides efficient lookup and merging of decoration collections.\n */\nexport class DecorationSet {\n\tstatic readonly empty: DecorationSet = new DecorationSet(new Map());\n\n\tprivate constructor(private readonly byBlock: ReadonlyMap<BlockId, readonly Decoration[]>) {}\n\n\t/** Creates a DecorationSet from a flat array of decorations. */\n\tstatic create(decorations: readonly Decoration[]): DecorationSet {\n\t\tif (decorations.length === 0) return DecorationSet.empty;\n\n\t\tconst map = new Map<BlockId, Decoration[]>();\n\t\tfor (const deco of decorations) {\n\t\t\tconst existing = map.get(deco.blockId);\n\t\t\tif (existing) {\n\t\t\t\texisting.push(deco);\n\t\t\t} else {\n\t\t\t\tmap.set(deco.blockId, [deco]);\n\t\t\t}\n\t\t}\n\t\treturn new DecorationSet(map);\n\t}\n\n\t/** Returns all decorations for a given block. */\n\tfind(blockId: BlockId): readonly Decoration[] {\n\t\treturn this.byBlock.get(blockId) ?? [];\n\t}\n\n\t/** Returns only inline decorations for a given block. */\n\tfindInline(blockId: BlockId): readonly InlineDecoration[] {\n\t\tconst decos = this.byBlock.get(blockId);\n\t\tif (!decos) return [];\n\t\treturn decos.filter((d): d is InlineDecoration => d.type === 'inline');\n\t}\n\n\t/** Returns only node decorations for a given block. */\n\tfindNode(blockId: BlockId): readonly NodeDecoration[] {\n\t\tconst decos = this.byBlock.get(blockId);\n\t\tif (!decos) return [];\n\t\treturn decos.filter((d): d is NodeDecoration => d.type === 'node');\n\t}\n\n\t/** Returns only widget decorations for a given block. */\n\tfindWidget(blockId: BlockId): readonly WidgetDecoration[] {\n\t\tconst decos = this.byBlock.get(blockId);\n\t\tif (!decos) return [];\n\t\treturn decos.filter((d): d is WidgetDecoration => d.type === 'widget');\n\t}\n\n\t/** Returns a new DecorationSet with the given decorations added. */\n\tadd(decorations: readonly Decoration[]): DecorationSet {\n\t\tif (decorations.length === 0) return this;\n\t\tif (this.isEmpty) return DecorationSet.create(decorations);\n\n\t\tconst map = new Map<BlockId, Decoration[]>();\n\t\tfor (const [bid, decos] of this.byBlock) {\n\t\t\tmap.set(bid, [...decos]);\n\t\t}\n\t\tfor (const deco of decorations) {\n\t\t\tconst existing = map.get(deco.blockId);\n\t\t\tif (existing) {\n\t\t\t\texisting.push(deco);\n\t\t\t} else {\n\t\t\t\tmap.set(deco.blockId, [deco]);\n\t\t\t}\n\t\t}\n\t\treturn new DecorationSet(map);\n\t}\n\n\t/** Returns a new DecorationSet with decorations matching the predicate removed. */\n\tremove(predicate: (d: Decoration) => boolean): DecorationSet {\n\t\tconst map = new Map<BlockId, Decoration[]>();\n\t\tlet changed = false;\n\n\t\tfor (const [bid, decos] of this.byBlock) {\n\t\t\tconst filtered = decos.filter((d) => !predicate(d));\n\t\t\tif (filtered.length !== decos.length) changed = true;\n\t\t\tif (filtered.length > 0) {\n\t\t\t\tmap.set(bid, filtered);\n\t\t\t}\n\t\t}\n\n\t\tif (!changed) return this;\n\t\tif (map.size === 0) return DecorationSet.empty;\n\t\treturn new DecorationSet(map);\n\t}\n\n\t/** Returns a new DecorationSet merging this set with another. */\n\tmerge(other: DecorationSet): DecorationSet {\n\t\tif (other.isEmpty) return this;\n\t\tif (this.isEmpty) return other;\n\n\t\tconst map = new Map<BlockId, Decoration[]>();\n\t\tfor (const [bid, decos] of this.byBlock) {\n\t\t\tmap.set(bid, [...decos]);\n\t\t}\n\t\tfor (const [bid, decos] of other.byBlock) {\n\t\t\tconst existing = map.get(bid);\n\t\t\tif (existing) {\n\t\t\t\texisting.push(...decos);\n\t\t\t} else {\n\t\t\t\tmap.set(bid, [...decos]);\n\t\t\t}\n\t\t}\n\t\treturn new DecorationSet(map);\n\t}\n\n\t/** Checks equality — reference first, then structural comparison. */\n\tequals(other: DecorationSet): boolean {\n\t\tif (this === other) return true;\n\t\tif (this.byBlock.size !== other.byBlock.size) return false;\n\n\t\tfor (const [bid, decos] of this.byBlock) {\n\t\t\tconst otherDecos = other.byBlock.get(bid);\n\t\t\tif (!otherDecos) return false;\n\t\t\tif (!decorationArraysEqual(decos, otherDecos)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/** True if the set contains no decorations. */\n\tget isEmpty(): boolean {\n\t\treturn this.byBlock.size === 0;\n\t}\n\n\t/**\n\t * Maps decorations through document changes described by a transaction.\n\t * Decorations that become invalid (e.g. fully deleted range) are removed.\n\t * Decorations that span a split point are split into two.\n\t */\n\tmap(tr: Transaction): DecorationSet {\n\t\tif (this.isEmpty || tr.steps.length === 0) return this;\n\n\t\tlet mapped: Decoration[] = [];\n\t\tfor (const decos of this.byBlock.values()) {\n\t\t\tfor (const d of decos) {\n\t\t\t\tmapped.push(d);\n\t\t\t}\n\t\t}\n\n\t\tfor (const step of tr.steps) {\n\t\t\tconst next: Decoration[] = [];\n\t\t\tfor (const deco of mapped) {\n\t\t\t\tconst result = mapDecorationThroughStep(deco, step);\n\t\t\t\tif (result === null) continue;\n\t\t\t\tif (Array.isArray(result)) {\n\t\t\t\t\tfor (const r of result) {\n\t\t\t\t\t\tnext.push(r);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tnext.push(result as Decoration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tmapped = next;\n\t\t}\n\n\t\tif (mapped.length === 0) return DecorationSet.empty;\n\t\treturn DecorationSet.create(mapped);\n\t}\n}\n\n// --- Helpers ---\n\n/** Compares two decoration arrays for structural equality. */\nexport function decorationArraysEqual(a: readonly Decoration[], b: readonly Decoration[]): boolean {\n\tif (a === b) return true;\n\tif (a.length !== b.length) return false;\n\n\tfor (let i = 0; i < a.length; i++) {\n\t\tconst ai = a[i];\n\t\tconst bi = b[i];\n\t\tif (!ai || !bi || !decorationsEqual(ai, bi)) return false;\n\t}\n\treturn true;\n}\n\n/** Compares two individual decorations for structural equality. */\nfunction decorationsEqual(a: Decoration, b: Decoration): boolean {\n\tif (a.type !== b.type) return false;\n\tif (a.blockId !== b.blockId) return false;\n\n\tswitch (a.type) {\n\t\tcase 'inline': {\n\t\t\tconst bi = b as InlineDecoration;\n\t\t\treturn a.from === bi.from && a.to === bi.to && attrsEqual(a.attrs, bi.attrs);\n\t\t}\n\t\tcase 'node': {\n\t\t\tconst bn = b as NodeDecoration;\n\t\t\treturn attrsEqual(a.attrs, bn.attrs);\n\t\t}\n\t\tcase 'widget': {\n\t\t\tconst bw = b as WidgetDecoration;\n\t\t\treturn (\n\t\t\t\ta.offset === bw.offset && a.side === bw.side && a.key === bw.key && a.toDOM === bw.toDOM\n\t\t\t);\n\t\t}\n\t}\n}\n\n/** Compares two DecorationAttrs objects. */\nfunction attrsEqual(a: DecorationAttrs, b: DecorationAttrs): boolean {\n\tif (a === b) return true;\n\tconst aKeys = Object.keys(a);\n\tconst bKeys = Object.keys(b);\n\tif (aKeys.length !== bKeys.length) return false;\n\tfor (const key of aKeys) {\n\t\tif (a[key] !== b[key]) return false;\n\t}\n\treturn true;\n}\n"],"mappings":"AA0BA,SAAgB,EACf,EACA,GAEA,OAAQ,EAAK,MACZ,IAAK,SACJ,OAQH,SACC,EACA,GAEA,OAA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,SAAU,CACd,MAAM,EAAK,EACX,OACC,EAAE,SAAW,EAAG,QAAU,EAAE,OAAS,EAAG,MAAQ,EAAE,MAAQ,EAAG,KAAO,EAAE,QAAU,EAAG,QAOvF,SAAS,EAAW,EAAoB,GACvC,GAAI,IAAM,EAAG,OAAO,EACpB,MAAM,EAAQ,OAAO,KAAK,GACpB,EAAQ,OAAO,KAAK,GAC1B,GAAI,EAAM,SAAW,EAAM,OAAQ,OAAO,EAC1C,IAAK,MAAM,KAAO,EACjB,GAAI,EAAE,KAAS,EAAE,GAAM,OAAO,EAE/B,OAAO"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{y as r}from"./Document-_qdGR4vh.mjs";var t=/[\p{Script=Hebrew}\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}\p{Script=Nko}\p{Script=Samaritan}\p{Script=Adlam}\p{Script=Hanifi_Rohingya}\p{Script=Mende_Kikakui}\p{Script=Yezidi}\p{Script=Old_South_Arabian}\p{Script=Old_North_Arabian}\p{Script=Avestan}\p{Script=Imperial_Aramaic}\p{Script=Phoenician}\p{Script=Lydian}\u200F\u061C]/u,i=/[\p{Script=Latin}\p{Script=Greek}\p{Script=Cyrillic}\p{Script=Armenian}\p{Script=Devanagari}\p{Script=Bengali}\p{Script=Gurmukhi}\p{Script=Gujarati}\p{Script=Oriya}\p{Script=Tamil}\p{Script=Telugu}\p{Script=Kannada}\p{Script=Malayalam}\p{Script=Sinhala}\p{Script=Thai}\p{Script=Lao}\p{Script=Tibetan}\p{Script=Myanmar}\p{Script=Georgian}\p{Script=Hangul}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}\p{Script=Ethiopic}\p{Script=Cherokee}\p{Script=Khmer}\u200E]/u;function p(r){const p=r.search(t),a=r.search(i);return-1===p&&-1===a?null:-1===p?"ltr":-1===a||p<a?"rtl":"ltr"}function a(r){const t=r.attrs?.dir;return"ltr"===t||"rtl"===t?t:"auto"}function c(t,i,p){const a=function(t,i){if(0===i.length)return t.doc.children;const p=i[i.length-1];if(!p)return[];const a=t.getBlock(p);return a?a.children.filter(r):[]}(t,i);for(let r=p-1;r>=0;r--){const t=a[r]?.attrs?.dir;if("ltr"===t||"rtl"===t)return t}for(let r=p;r<a.length;r++){const t=a[r]?.attrs?.dir;if("ltr"===t||"rtl"===t)return t}}export{c as n,a as r,p as t};
|
|
2
|
-
//# sourceMappingURL=DirectionDetection-Hun6-7ER.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DirectionDetection-Hun6-7ER.mjs","names":[],"sources":["../../src/plugins/text-direction/DirectionDetection.ts"],"sourcesContent":["/**\n * Direction detection utilities for the TextDirectionPlugin.\n * Detects text direction based on the first strong directional character\n * and finds sibling block direction for inheritance.\n */\n\nimport { type BlockNode, isBlockNode } from '../../model/Document.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { TextDirection } from './TextDirectionPlugin.js';\n\n// --- RTL Detection ---\n\n/**\n * Regex matching strong RTL characters using Unicode Script property escapes.\n * Auto-maintained by the Unicode standard — no manual code-point ranges needed.\n * Covers all RTL scripts: Hebrew, Arabic, Syriac, Thaana, N'Ko, Samaritan,\n * Mandaic, Adlam, Hanifi Rohingya, Mende Kikakui, Yezidi, and historic scripts.\n * Includes U+200F (RLM) and U+061C (ALM) as strong directional markers.\n */\nconst RTL_CHAR_RE: RegExp =\n\t/[\\p{Script=Hebrew}\\p{Script=Arabic}\\p{Script=Syriac}\\p{Script=Thaana}\\p{Script=Mandaic}\\p{Script=Nko}\\p{Script=Samaritan}\\p{Script=Adlam}\\p{Script=Hanifi_Rohingya}\\p{Script=Mende_Kikakui}\\p{Script=Yezidi}\\p{Script=Old_South_Arabian}\\p{Script=Old_North_Arabian}\\p{Script=Avestan}\\p{Script=Imperial_Aramaic}\\p{Script=Phoenician}\\p{Script=Lydian}\\u200F\\u061C]/u;\n\n/**\n * Regex matching strong LTR characters using Unicode Script property escapes.\n * Covers all major LTR scripts: Latin, Greek, Cyrillic, Armenian, Indic scripts,\n * Southeast Asian scripts, East Asian scripts, Georgian, Ethiopic, and more.\n * Includes U+200E (LRM) as a strong directional marker.\n */\nconst LTR_CHAR_RE: RegExp =\n\t/[\\p{Script=Latin}\\p{Script=Greek}\\p{Script=Cyrillic}\\p{Script=Armenian}\\p{Script=Devanagari}\\p{Script=Bengali}\\p{Script=Gurmukhi}\\p{Script=Gujarati}\\p{Script=Oriya}\\p{Script=Tamil}\\p{Script=Telugu}\\p{Script=Kannada}\\p{Script=Malayalam}\\p{Script=Sinhala}\\p{Script=Thai}\\p{Script=Lao}\\p{Script=Tibetan}\\p{Script=Myanmar}\\p{Script=Georgian}\\p{Script=Hangul}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Han}\\p{Script=Ethiopic}\\p{Script=Cherokee}\\p{Script=Khmer}\\u200E]/u;\n\n/**\n * Detects the dominant text direction based on the first strong directional character.\n * Returns `null` if no strong character is found (all neutral/numeric/whitespace).\n */\nexport function detectTextDirection(text: string): TextDirection | null {\n\tconst rtlIdx: number = text.search(RTL_CHAR_RE);\n\tconst ltrIdx: number = text.search(LTR_CHAR_RE);\n\n\tif (rtlIdx === -1 && ltrIdx === -1) return null;\n\tif (rtlIdx === -1) return 'ltr';\n\tif (ltrIdx === -1) return 'rtl';\n\treturn rtlIdx < ltrIdx ? 'rtl' : 'ltr';\n}\n\n// --- Block Direction Accessor ---\n\n/** Returns the current `dir` attribute of a block, defaulting to `'auto'`. */\nexport function getBlockDir(block: BlockNode): TextDirection {\n\tconst dir: unknown = block.attrs?.dir;\n\tif (dir === 'ltr' || dir === 'rtl') return dir;\n\treturn 'auto';\n}\n\n// --- Sibling Direction Lookup ---\n\n/**\n * Finds the `dir` attribute of the nearest sibling with an explicit direction\n * (not `'auto'`) before the insert position, walking backwards.\n */\nexport function findSiblingDirection(\n\tstate: EditorState,\n\tparentPath: readonly BlockId[],\n\tindex: number,\n): TextDirection | undefined {\n\tconst siblings: readonly BlockNode[] = getSiblings(state, parentPath);\n\n\t// Walk backward first (preceding siblings take priority)\n\tfor (let i: number = index - 1; i >= 0; i--) {\n\t\tconst dir: unknown = siblings[i]?.attrs?.dir;\n\t\tif (dir === 'ltr' || dir === 'rtl') return dir;\n\t}\n\n\t// Walk forward when no backward sibling has explicit direction\n\tfor (let i: number = index; i < siblings.length; i++) {\n\t\tconst dir: unknown = siblings[i]?.attrs?.dir;\n\t\tif (dir === 'ltr' || dir === 'rtl') return dir;\n\t}\n\n\treturn undefined;\n}\n\n/** Returns the sibling list for the given parent path. */\nfunction getSiblings(state: EditorState, parentPath: readonly BlockId[]): readonly BlockNode[] {\n\tif (parentPath.length === 0) {\n\t\treturn state.doc.children;\n\t}\n\n\tconst parentId: BlockId | undefined = parentPath[parentPath.length - 1];\n\tif (!parentId) return [];\n\tconst parent: BlockNode | undefined = state.getBlock(parentId);\n\tif (!parent) return [];\n\n\treturn parent.children.filter(isBlockNode);\n}\n"],"mappings":"4CAoBA,IAAM,EACL,wWAQK,EACL,udAMD,SAAgB,EAAoB,GACnC,MAAM,EAAiB,EAAK,OAAO,GAC7B,EAAiB,EAAK,OAAO,GAEnC,OAAe,IAAX,IAA4B,IAAX,EAAsB,MAC5B,IAAX,EAAsB,OACX,IAAX,GACG,EAAS,EADU,MACO,MAMlC,SAAgB,EAAY,GAC3B,MAAM,EAAe,EAAM,OAAO,IAClC,MAAY,QAAR,GAAyB,QAAR,EAAsB,EACpC,OASR,SAAgB,EACf,EACA,EACA,GAEA,MAAM,EAkBP,SAAqB,EAAoB,GACxC,GAA0B,IAAtB,EAAW,OACd,OAAO,EAAM,IAAI,SAGlB,MAAM,EAAgC,EAAW,EAAW,OAAS,GACrE,IAAK,EAAU,MAAO,GACtB,MAAM,EAAgC,EAAM,SAAS,GACrD,OAAK,EAEE,EAAO,SAAS,OAAO,GAFV,GA1BmB,CAAY,EAAO,GAG1D,IAAK,IAAI,EAAY,EAAQ,EAAG,GAAK,EAAG,IAAK,CAC5C,MAAM,EAAe,EAAS,IAAI,OAAO,IACzC,GAAY,QAAR,GAAyB,QAAR,EAAe,OAAO,EAI5C,IAAK,IAAI,EAAY,EAAO,EAAI,EAAS,OAAQ,IAAK,CACrD,MAAM,EAAe,EAAS,IAAI,OAAO,IACzC,GAAY,QAAR,GAAyB,QAAR,EAAe,OAAO"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var v={ltr:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 10v5h2V4h2v11h2V4h2V2H9C6.79 2 5 3.79 5 6s1.79 4 4 4zm12 8l-4-4v3H5v2h12v3l4-4z"/></svg>',rtl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 10v5h2V4h2v11h2V4h2V2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4zM8 14l-4 4 4 4v-3h12v-2H8v-3z"/></svg>',auto:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 10v5h2V4h2v11h2V4h2V2H9C6.79 2 5 3.79 5 6s1.79 4 4 4zm3 8l-4-4v3H3v2h5v3l4-4zm7 0v-3l4 4-4 4v-3h-5v-2h5z"/></svg>'};export{v as t};
|
|
2
|
-
//# sourceMappingURL=DirectionIcons-CfaDcQ9a.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DirectionIcons-CfaDcQ9a.mjs","names":[],"sources":["../../src/plugins/text-direction/DirectionIcons.ts"],"sourcesContent":["/**\n * Direction icon SVGs shared between `TextDirectionPlugin` (block-level\n * dropdown) and `BidiIsolationPlugin` (inline dropdown items).\n */\n\nimport type { TextDirection } from './TextDirectionService.js';\n\nexport const DIRECTION_ICONS: Readonly<Record<TextDirection, string>> = {\n\tltr: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M9 10v5h2V4h2v11h2V4h2V2H9C6.79 2 5 3.79 5 6s1.79 4 4 4zm12 8l-4-4v3H5v2h12v3l4-4z\"/></svg>',\n\trtl: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M10 10v5h2V4h2v11h2V4h2V2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4zM8 14l-4 4 4 4v-3h12v-2H8v-3z\"/></svg>',\n\tauto: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M9 10v5h2V4h2v11h2V4h2V2H9C6.79 2 5 3.79 5 6s1.79 4 4 4zm3 8l-4-4v3H3v2h5v3l4-4zm7 0v-3l4 4-4 4v-3h-5v-2h5z\"/></svg>',\n};\n"],"mappings":"AAOA,IAAa,EAA2D,CACvE,IAAK,mKACL,IAAK,wKACL,KAAM"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function t(t,n,r){const o=[];return e(t,n,r,{onText(t,n){o.push({text:t,marks:n})}}),o}function n(t,n,r){const o=[];return e(t,n,r,{onText(t,n){o.push({kind:"text",text:t,marks:n})},onInline(t){o.push({kind:"inline",node:t})}}),o}function e(t,n,e,r){const i=f(t);let s=0;for(const u of i){const t=s+(o(u)?1:u.text.length);if(t<=n||s>=e)s=t;else{if(o(u))r.onInline?.(u);else{const t=Math.max(0,n-s),o=Math.min(u.text.length,e-s),i=u.text.slice(t,o);i.length>0&&r.onText(i,u.marks)}s=t}}}function r(t){return"object"==typeof t&&null!==t&&"text"===t.type&&"string"==typeof t.text}function o(t){return"object"==typeof t&&null!==t&&"inline"===t.type&&"string"==typeof t.inlineType}function i(t){return"object"==typeof t&&null!==t&&"string"==typeof t.id&&"string"==typeof t.type&&"text"!==t.type&&"inline"!==t.type&&Array.isArray(t.children)}function s(t){return t.children.every(t=>r(t)||o(t))}function u(t){return t.children.filter(t=>r(t))}function f(t){return t.children.filter(t=>r(t)||o(t))}function c(t){return t.children.filter(t=>i(t))}function l(){return`block-${crypto.randomUUID()}`}function a(t){return{children:t??[h("paragraph")]}}function h(t,n,e,r){return{id:e??l(),type:t,...r?{attrs:r}:{},children:n??[g("")]}}function g(t,n){return{type:"text",text:t,marks:n??[]}}function p(t,n){return{type:"inline",inlineType:t,attrs:n??{}}}function x(t){return h("paragraph",[g("")],t)}function y(t){const n=f(t);let e="";for(const o of n)r(o)&&(e+=o.text);return e}function m(t){const n=f(t);let e=0;for(const r of n)e+=o(r)?1:r.text.length;return e}function k(t,n){const e=f(t);let i=0;for(const r of e){if(o(r)){if(n===i)return[];i+=1;continue}const t=i+r.text.length;if(n>=i&&n<t)return r.marks;if(n===i&&0===r.text.length)return r.marks;i=t}for(let o=e.length-1;o>=0;o--){const t=e[o];if(t&&r(t))return t.marks}return[]}function d(t,n){return t.length===n.length&&t.every(t=>n.some(n=>function(t,n){if(t.type!==n.type)return!1;const e=t.attrs,r=n.attrs;if(!e&&!r)return!0;if(!e||!r)return!1;const o=Object.keys(e),i=Object.keys(r);return o.length===i.length&&o.every(t=>e[t]===r[t])}(t,n)))}function b(t,n){return t.some(t=>t.type===n)}function T(t,n){return b(t,n.type)?t:[...t,n]}function j(t,n){return t.filter(t=>t.type!==n)}function v(t){if(0===t.length)return[g("")];if(t.every(t=>r(t)))return function(t){if(0===t.length)return[g("")];const n=[];for(const e of t){const t=n[n.length-1];t&&d(t.marks,e.marks)?n[n.length-1]=g(t.text+e.text,t.marks):(e.text.length>0||0===n.length)&&n.push(e)}return 0===n.length?[g("")]:n}(t);const n=[];for(const i of t){if(o(i)){n.push(i);continue}const t=n[n.length-1];t&&r(t)&&d(t.marks,i.marks)?n[n.length-1]=g(t.text+i.text,t.marks):(i.text.length>0||0===n.length)&&n.push(i)}const e=n.filter((t,e)=>{if(o(t))return!0;if(t.text.length>0)return!0;if(1===n.length)return!0;const r=n[e-1],i=n[e+1];return!(r&&o(r)||i&&o(i))});return 0===e.length?[g("")]:e.some(t=>r(t))?e:[g(""),...e]}function I(t,n){const e=f(t);let r=0,i=0;for(const s of e)if(o(s)){if(r>=n)return i;r+=1}else{if(r+s.text.length>=n)return i+(n-r);r+=s.text.length,i+=s.text.length}return i}function A(t,n){const e=f(t);for(const{child:r,from:i}of function*(t){let n=0;for(const e of t){const t=o(e)?1:e.text.length;yield{child:e,from:n,to:n+t},n+=t}}(e)){if(o(r)){if(n===i)return{kind:"inline",node:r};continue}const t=n-i;if(t>=0&&t<r.text.length)return{kind:"text",char:r.text[t]??"",marks:r.marks}}return null}export{d as C,r as S,j as T,u as _,x as a,o as b,l as c,m as d,k as f,f as g,A as h,a as i,c as l,y as m,I as n,p as o,t as p,h as r,g as s,T as t,n as u,b as v,v as w,s as x,i as y};
|
|
2
|
-
//# sourceMappingURL=Document-_qdGR4vh.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Document-_qdGR4vh.mjs","names":[],"sources":["../../src/model/Document.ts"],"sourcesContent":["/**\n * Core document model types for the Notectl editor.\n * All types are deeply readonly — mutations create new instances.\n */\n\nimport type { BlockId, InlineTypeName, MarkTypeName, NodeTypeName } from './TypeBrands.js';\n\n// --- Mark Types ---\n\nexport interface Mark {\n\treadonly type: MarkTypeName;\n\treadonly attrs?: Readonly<Record<string, string | number | boolean>>;\n}\n\nexport interface BoldMark extends Mark {\n\treadonly type: MarkTypeName & 'bold';\n}\n\nexport interface ItalicMark extends Mark {\n\treadonly type: MarkTypeName & 'italic';\n}\n\nexport interface UnderlineMark extends Mark {\n\treadonly type: MarkTypeName & 'underline';\n}\n\n// --- Node Types ---\n\nexport interface BlockAttrs {\n\treadonly [key: string]: string | number | boolean;\n}\n\nexport interface TextNode {\n\treadonly type: 'text';\n\treadonly text: string;\n\treadonly marks: readonly Mark[];\n}\n\n/** Atomic inline element (width 1 in offset space). */\nexport interface InlineNode {\n\treadonly type: 'inline';\n\treadonly inlineType: InlineTypeName;\n\treadonly attrs: Readonly<Record<string, string | number | boolean>>;\n}\n\n/** A child of a BlockNode: text, inline element, or nested block. */\nexport type ChildNode = TextNode | InlineNode | BlockNode;\n\nexport interface BlockNode {\n\treadonly id: BlockId;\n\treadonly type: NodeTypeName;\n\treadonly attrs?: BlockAttrs;\n\treadonly children: readonly ChildNode[];\n}\n\nexport interface Document {\n\treadonly children: readonly BlockNode[];\n}\n\n// --- Text Segment (for mark-preserving undo) ---\n\nexport interface TextSegment {\n\treadonly text: string;\n\treadonly marks: readonly Mark[];\n}\n\n/** A content segment: either text (with marks) or an inline node. */\nexport type ContentSegment =\n\t| { readonly kind: 'text'; readonly text: string; readonly marks: readonly Mark[] }\n\t| { readonly kind: 'inline'; readonly node: InlineNode };\n\n/** Extracts TextNode segments within a block for the given offset range. */\nexport function getBlockSegmentsInRange(\n\tblock: BlockNode,\n\tfrom: number,\n\tto: number,\n): readonly TextSegment[] {\n\tconst segments: TextSegment[] = [];\n\twalkBlockRange(block, from, to, {\n\t\tonText(text: string, marks: readonly Mark[]): void {\n\t\t\tsegments.push({ text, marks });\n\t\t},\n\t});\n\treturn segments;\n}\n\n/** Returns content segments (text and inline) for a block range. */\nexport function getBlockContentSegmentsInRange(\n\tblock: BlockNode,\n\tfrom: number,\n\tto: number,\n): readonly ContentSegment[] {\n\tconst segments: ContentSegment[] = [];\n\twalkBlockRange(block, from, to, {\n\t\tonText(text: string, marks: readonly Mark[]): void {\n\t\t\tsegments.push({ kind: 'text', text, marks });\n\t\t},\n\t\tonInline(node: InlineNode): void {\n\t\t\tsegments.push({ kind: 'inline', node });\n\t\t},\n\t});\n\treturn segments;\n}\n\ninterface BlockRangeVisitor {\n\treadonly onText: (text: string, marks: readonly Mark[]) => void;\n\treadonly onInline?: (node: InlineNode) => void;\n}\n\n/** Walks inline children within [from, to) and calls visitor callbacks for each relevant child. */\nfunction walkBlockRange(\n\tblock: BlockNode,\n\tfrom: number,\n\tto: number,\n\tvisitor: BlockRangeVisitor,\n): void {\n\tconst inlineChildren: readonly (TextNode | InlineNode)[] = getInlineChildren(block);\n\tlet pos = 0;\n\n\tfor (const child of inlineChildren) {\n\t\tconst childWidth: number = isInlineNode(child) ? 1 : child.text.length;\n\t\tconst childEnd: number = pos + childWidth;\n\n\t\tif (childEnd <= from || pos >= to) {\n\t\t\tpos = childEnd;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (isInlineNode(child)) {\n\t\t\tvisitor.onInline?.(child);\n\t\t} else {\n\t\t\tconst sliceFrom: number = Math.max(0, from - pos);\n\t\t\tconst sliceTo: number = Math.min(child.text.length, to - pos);\n\t\t\tconst text: string = child.text.slice(sliceFrom, sliceTo);\n\t\t\tif (text.length > 0) {\n\t\t\t\tvisitor.onText(text, child.marks);\n\t\t\t}\n\t\t}\n\n\t\tpos = childEnd;\n\t}\n}\n\n// --- Type Guards ---\n\n/** Checks whether a value is a {@link TextNode}. */\nexport function isTextNode(node: unknown): node is TextNode {\n\treturn (\n\t\ttypeof node === 'object' &&\n\t\tnode !== null &&\n\t\t(node as TextNode).type === 'text' &&\n\t\ttypeof (node as TextNode).text === 'string'\n\t);\n}\n\n/** Checks whether a value is an {@link InlineNode}. */\nexport function isInlineNode(node: unknown): node is InlineNode {\n\treturn (\n\t\ttypeof node === 'object' &&\n\t\tnode !== null &&\n\t\t(node as InlineNode).type === 'inline' &&\n\t\ttypeof (node as InlineNode).inlineType === 'string'\n\t);\n}\n\n/** Checks whether a value is a {@link BlockNode}. */\nexport function isBlockNode(node: unknown): node is BlockNode {\n\treturn (\n\t\ttypeof node === 'object' &&\n\t\tnode !== null &&\n\t\ttypeof (node as BlockNode).id === 'string' &&\n\t\ttypeof (node as BlockNode).type === 'string' &&\n\t\t(node as BlockNode).type !== ('text' as string) &&\n\t\t(node as BlockNode).type !== ('inline' as string) &&\n\t\tArray.isArray((node as BlockNode).children)\n\t);\n}\n\n// --- Child Node Helpers ---\n\n/** Returns true if a block has only inline content (TextNodes and InlineNodes). */\nexport function isLeafBlock(node: BlockNode): boolean {\n\treturn node.children.every((c) => isTextNode(c) || isInlineNode(c));\n}\n\n/** Returns only the TextNode children of a block. */\nexport function getTextChildren(node: BlockNode): readonly TextNode[] {\n\treturn node.children.filter((c): c is TextNode => isTextNode(c));\n}\n\n/** Returns the inline content children (TextNode | InlineNode) of a block. */\nexport function getInlineChildren(node: BlockNode): readonly (TextNode | InlineNode)[] {\n\treturn node.children.filter((c): c is TextNode | InlineNode => isTextNode(c) || isInlineNode(c));\n}\n\n/** Returns only the BlockNode children of a block. */\nexport function getBlockChildren(node: BlockNode): readonly BlockNode[] {\n\treturn node.children.filter((c): c is BlockNode => isBlockNode(c));\n}\n\n// --- Factory Functions ---\n\n/** Generates a unique block ID using crypto.randomUUID(). */\nexport function generateBlockId(): BlockId {\n\treturn `block-${crypto.randomUUID()}` as BlockId;\n}\n\n/** Creates a new empty {@link Document} with a single empty paragraph. */\nexport function createDocument(children?: readonly BlockNode[]): Document {\n\treturn {\n\t\tchildren: children ?? [createBlockNode('paragraph' as NodeTypeName)],\n\t};\n}\n\n/** Creates a new {@link BlockNode}. */\nexport function createBlockNode(\n\ttype: NodeTypeName,\n\tchildren?: readonly ChildNode[],\n\tid?: BlockId,\n\tattrs?: BlockAttrs,\n): BlockNode {\n\treturn {\n\t\tid: id ?? generateBlockId(),\n\t\ttype,\n\t\t...(attrs ? { attrs } : {}),\n\t\tchildren: children ?? [createTextNode('')],\n\t};\n}\n\n/** Creates a new {@link TextNode}. */\nexport function createTextNode(text: string, marks?: readonly Mark[]): TextNode {\n\treturn {\n\t\ttype: 'text',\n\t\ttext,\n\t\tmarks: marks ?? [],\n\t};\n}\n\n/** Creates a new {@link InlineNode}. */\nexport function createInlineNode(\n\tinlineType: InlineTypeName,\n\tattrs?: Readonly<Record<string, string | number | boolean>>,\n): InlineNode {\n\treturn {\n\t\ttype: 'inline',\n\t\tinlineType,\n\t\tattrs: attrs ?? {},\n\t};\n}\n\n/** Creates an empty paragraph block node with the given ID. */\nexport function createEmptyParagraph(id?: BlockId): BlockNode {\n\treturn createBlockNode('paragraph' as NodeTypeName, [createTextNode('')], id);\n}\n\n// --- Utility Functions ---\n\n/** Extracts plain text from a block (InlineNodes are skipped). */\nexport function getBlockText(block: BlockNode): string {\n\tconst inlineChildren: readonly (TextNode | InlineNode)[] = getInlineChildren(block);\n\tlet text = '';\n\tfor (const child of inlineChildren) {\n\t\tif (isTextNode(child)) {\n\t\t\ttext += child.text;\n\t\t}\n\t}\n\treturn text;\n}\n\n/** Returns the length of a block's inline content (InlineNodes count as 1). */\nexport function getBlockLength(block: BlockNode): number {\n\tconst inlineChildren: readonly (TextNode | InlineNode)[] = getInlineChildren(block);\n\tlet len = 0;\n\tfor (const child of inlineChildren) {\n\t\tlen += isInlineNode(child) ? 1 : child.text.length;\n\t}\n\treturn len;\n}\n\n/** Returns the marks active at the given offset (empty for InlineNode offsets). */\nexport function getBlockMarksAtOffset(block: BlockNode, offset: number): readonly Mark[] {\n\tconst inlineChildren: readonly (TextNode | InlineNode)[] = getInlineChildren(block);\n\tlet pos = 0;\n\n\tfor (const child of inlineChildren) {\n\t\tif (isInlineNode(child)) {\n\t\t\tif (offset === pos) return [];\n\t\t\tpos += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tconst end: number = pos + child.text.length;\n\t\tif (offset >= pos && offset < end) {\n\t\t\treturn child.marks;\n\t\t}\n\t\tif (offset === pos && child.text.length === 0) {\n\t\t\treturn child.marks;\n\t\t}\n\t\tpos = end;\n\t}\n\n\t// Fall back to last text child's marks\n\tfor (let i: number = inlineChildren.length - 1; i >= 0; i--) {\n\t\tconst child: TextNode | InlineNode | undefined = inlineChildren[i];\n\t\tif (child && isTextNode(child)) {\n\t\t\treturn child.marks;\n\t\t}\n\t}\n\treturn [];\n}\n\n/** Checks whether two marks are equal by type and attrs. */\nexport function marksEqual(a: Mark, b: Mark): boolean {\n\tif (a.type !== b.type) return false;\n\tconst aAttrs = a.attrs;\n\tconst bAttrs = b.attrs;\n\tif (!aAttrs && !bAttrs) return true;\n\tif (!aAttrs || !bAttrs) return false;\n\tconst aKeys = Object.keys(aAttrs);\n\tconst bKeys = Object.keys(bAttrs);\n\tif (aKeys.length !== bKeys.length) return false;\n\treturn aKeys.every((key) => aAttrs[key] === bAttrs[key]);\n}\n\n/** Checks whether two mark arrays contain the same marks (order-independent). */\nexport function markSetsEqual(a: readonly Mark[], b: readonly Mark[]): boolean {\n\tif (a.length !== b.length) return false;\n\treturn a.every((markA) => b.some((markB) => marksEqual(markA, markB)));\n}\n\n/** Returns true if the mark set contains a mark of the given type. */\nexport function hasMark(marks: readonly Mark[], markType: MarkTypeName): boolean {\n\treturn marks.some((m) => m.type === markType);\n}\n\n/** Adds a mark to a mark set (no duplicates). */\nexport function addMarkToSet(marks: readonly Mark[], mark: Mark): readonly Mark[] {\n\tif (hasMark(marks, mark.type)) return marks;\n\treturn [...marks, mark];\n}\n\n/** Removes a mark type from a mark set. */\nexport function removeMarkFromSet(marks: readonly Mark[], markType: MarkTypeName): readonly Mark[] {\n\treturn marks.filter((m) => m.type !== markType);\n}\n\n/**\n * Normalizes text nodes within a block: merges adjacent nodes with identical marks,\n * removes empty text nodes (keeping at least one).\n */\nexport function normalizeTextNodes(nodes: readonly TextNode[]): readonly TextNode[] {\n\tif (nodes.length === 0) return [createTextNode('')];\n\n\tconst result: TextNode[] = [];\n\tfor (const node of nodes) {\n\t\tconst prev: TextNode | undefined = result[result.length - 1];\n\t\tif (prev && markSetsEqual(prev.marks, node.marks)) {\n\t\t\tresult[result.length - 1] = createTextNode(prev.text + node.text, prev.marks);\n\t\t} else if (node.text.length > 0 || result.length === 0) {\n\t\t\tresult.push(node);\n\t\t}\n\t}\n\n\treturn result.length === 0 ? [createTextNode('')] : result;\n}\n\n/**\n * Normalizes mixed inline content: merges adjacent TextNodes with same marks,\n * removes empty TextNodes adjacent to InlineNodes, preserves InlineNodes as-is.\n * Guarantees at least one TextNode exists if all text is empty.\n */\nexport function normalizeInlineContent(\n\tnodes: readonly (TextNode | InlineNode)[],\n): readonly (TextNode | InlineNode)[] {\n\tif (nodes.length === 0) return [createTextNode('')];\n\n\t// Fast path: no InlineNodes, delegate to normalizeTextNodes\n\tif (nodes.every((n): n is TextNode => isTextNode(n))) {\n\t\treturn normalizeTextNodes(nodes);\n\t}\n\n\tconst result: (TextNode | InlineNode)[] = [];\n\n\tfor (const node of nodes) {\n\t\tif (isInlineNode(node)) {\n\t\t\tresult.push(node);\n\t\t\tcontinue;\n\t\t}\n\t\t// TextNode: try to merge with previous TextNode\n\t\tconst prev: TextNode | InlineNode | undefined = result[result.length - 1];\n\t\tif (prev && isTextNode(prev) && markSetsEqual(prev.marks, node.marks)) {\n\t\t\tresult[result.length - 1] = createTextNode(prev.text + node.text, prev.marks);\n\t\t} else if (node.text.length > 0 || result.length === 0) {\n\t\t\tresult.push(node);\n\t\t}\n\t}\n\n\t// Remove empty TextNodes that are adjacent to InlineNodes\n\tconst cleaned: (TextNode | InlineNode)[] = result.filter((node, i) => {\n\t\tif (isInlineNode(node)) return true;\n\t\tif (node.text.length > 0) return true;\n\t\t// Keep if it's the only node\n\t\tif (result.length === 1) return true;\n\t\t// Remove empty TextNode if adjacent to InlineNode\n\t\tconst prev: TextNode | InlineNode | undefined = result[i - 1];\n\t\tconst next: TextNode | InlineNode | undefined = result[i + 1];\n\t\tif ((prev && isInlineNode(prev)) || (next && isInlineNode(next))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\n\t// Ensure at least one TextNode exists\n\tif (cleaned.length === 0) return [createTextNode('')];\n\tif (!cleaned.some((n) => isTextNode(n))) {\n\t\treturn [createTextNode(''), ...cleaned];\n\t}\n\n\treturn cleaned;\n}\n\n/** Yields each inline child with its offset range. InlineNodes have width 1. */\nexport function* walkInlineContent(children: readonly (TextNode | InlineNode)[]): Generator<{\n\treadonly child: TextNode | InlineNode;\n\treadonly from: number;\n\treadonly to: number;\n}> {\n\tlet pos = 0;\n\tfor (const child of children) {\n\t\tconst width: number = isInlineNode(child) ? 1 : child.text.length;\n\t\tyield { child, from: pos, to: pos + width };\n\t\tpos += width;\n\t}\n}\n\n/**\n * Converts a block-space offset to a text-space offset.\n *\n * Block-space counts InlineNodes as width 1, but `getBlockText()` skips them.\n * This function maps a block offset to the equivalent position in the\n * text-only string returned by `getBlockText()`.\n */\nexport function blockOffsetToTextOffset(block: BlockNode, blockOffset: number): number {\n\tconst inlineChildren: readonly (TextNode | InlineNode)[] = getInlineChildren(block);\n\tlet blockPos = 0;\n\tlet textPos = 0;\n\n\tfor (const child of inlineChildren) {\n\t\tif (isInlineNode(child)) {\n\t\t\tif (blockPos >= blockOffset) return textPos;\n\t\t\tblockPos += 1;\n\t\t} else {\n\t\t\tif (blockPos + child.text.length >= blockOffset) {\n\t\t\t\treturn textPos + (blockOffset - blockPos);\n\t\t\t}\n\t\t\tblockPos += child.text.length;\n\t\t\ttextPos += child.text.length;\n\t\t}\n\t}\n\n\treturn textPos;\n}\n\n/** Returns the content at a specific offset: text char, inline node, or null. */\nexport function getContentAtOffset(\n\tblock: BlockNode,\n\toffset: number,\n):\n\t| { readonly kind: 'text'; readonly char: string; readonly marks: readonly Mark[] }\n\t| { readonly kind: 'inline'; readonly node: InlineNode }\n\t| null {\n\tconst inlineChildren: readonly (TextNode | InlineNode)[] = getInlineChildren(block);\n\n\tfor (const { child, from } of walkInlineContent(inlineChildren)) {\n\t\tif (isInlineNode(child)) {\n\t\t\tif (offset === from) return { kind: 'inline', node: child };\n\t\t\tcontinue;\n\t\t}\n\t\tconst localOffset: number = offset - from;\n\t\tif (localOffset >= 0 && localOffset < child.text.length) {\n\t\t\treturn {\n\t\t\t\tkind: 'text',\n\t\t\t\tchar: child.text[localOffset] ?? '',\n\t\t\t\tmarks: child.marks,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn null;\n}\n"],"mappings":"AAwEA,SAAgB,EACf,EACA,EACA,GAEA,MAAM,EAA0B,GAMhC,OALA,EAAe,EAAO,EAAM,EAAI,CAC/B,MAAA,CAAO,EAAc,GACpB,EAAS,KAAK,CAAE,OAAM,aAGjB,EAIR,SAAgB,EACf,EACA,EACA,GAEA,MAAM,EAA6B,GAS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,KAAM,GACpD,SAED,MAAM,EAAsB,EAAS,EACrC,GAAI,GAAe,GAAK,EAAc,EAAM,KAAK,OAChD,MAAO,CACN,KAAM,OACN,KAAM,EAAM,KAAK,IAAgB,GACjC,MAAO,EAAM,OAKhB,OAAO"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{C as t,S as e,b as s,g as n,i as r,l as o,o as i,r as c,s as l,x as a}from"./Document-_qdGR4vh.mjs";import{a as u,i as f,r as p,t as d}from"./TypeBrands-BZDKMjR-.mjs";import{r as g}from"./AttrRegistry-nDKtHK87.mjs";import{n as h,r as y,t as m}from"./HTMLUtils-brwcaufP.mjs";import A from"dompurify";var b=/^[A-Za-z0-9_-]{1,64}$/;function L(t){return b.test(t)}function T(t,e){const s=t.getAttribute("data-block-id");if(s&&L(s)&&!e.has(s))return e.add(s),d(s)}function M(t){let e=2166136261;for(let s=0;s<t.length;s++)e^=t.charCodeAt(s),e=Math.imul(e,16777619);return(e>>>0).toString(36).padStart(6,"0")}var k=class{classMap=/* @__PURE__ */new Map;usedHashes=/* @__PURE__ */new Set;getClassName(t){const e=function(t){return t.split(";").map(t=>t.trim()).filter(t=>t.length>0).sort().join("; ")}(t),s=this.classMap.get(e);if(s)return s;let n=M(e),r=0;for(;this.usedHashes.has(n);)r++,n=M(e+String(r));const o=`notectl-s-${n}`;return this.usedHashes.add(n),this.classMap.set(e,o),o}getAlignmentClassName(t){const e=`text-align: ${t}`,s=this.classMap.get(e);if(s)return s;const n=`notectl-align-${t}`;return this.classMap.set(e,n),n}toCSS(){if(0===this.classMap.size)return"";const t=[];for(const[e,s]of this.classMap)t.push(`.${s} { ${e}; }`);return t.join("\n")}toStyleMap(){const t=/* @__PURE__ */new Map;for(const[e,s]of this.classMap)t.set(s,e);return t}};function S(t){const e=t.getMarkTypes(),s=/* @__PURE__ */new Map;for(const n of e){const e=t.getMarkSpec(n);e&&s.set(n,e.rank??99)}return s}function $(t,e,s,n,r){if(""===t)return"";let o=y(t);if(0===e.length)return o;const i=n??S(s),c=[...e].sort((t,e)=>(i.get(t.type)??99)-(i.get(e.type)??99)),l=[],a=[];for(const u of c){const t=s.getMarkSpec(u.type);if(t?.toHTMLStyle){const e=t.toHTMLStyle(u);e&&l.push(e)}else a.push(u)}if(l.length>0){const t=l.join("; "),e=r?r.styleAttr(t):` style="${t}"`;e&&(o=`<span${e}>${o}</span>`)}for(const u of a){const t=s.getMarkSpec(u.type);t?.toHTMLString&&(o=t.toHTMLString(u,o,r))}return o}function x(t,e,s,n,r,o){if(""===t)return"";let i=y(t);if(0===e.length)return i;const c=r??S(s),l=[...e].sort((t,e)=>(c.get(t.type)??99)-(c.get(e.type)??99)),a=[],u=[];for(const f of l){const t=s.getMarkSpec(f.type);if(t?.toHTMLStyle){const e=t.toHTMLStyle(f);e&&a.push(e)}else u.push(f)}if(a.length>0){const t=a.join("; ");i=`<span class="${n.getClassName(t)}">${i}</span>`}for(const f of u){const t=s.getMarkSpec(f.type);t?.toHTMLString&&(i=t.toHTMLString(f,i,o))}return i}var N=new Set(["start","center","end","justify"]),E={left:"start",right:"end"},w=new Set(["ltr","rtl"]);function v(t){return{styleAttr:e=>e?` class="${t.getClassName(e)}"`:""}}function C(t,e,s){const n=function(t){let e=t.indexOf("<");for(;e>=0;){const s=t[e+1];if(s&&/[A-Za-z]/.test(s)){let s;for(let n=e+2;n<t.length;n++){const r=t[n]??"";if(s)r===s&&(s=void 0);else if('"'!==r&&"'"!==r){if(">"===r)return{start:e,end:n}}else s=r}return}e=t.indexOf("<",e+1)}}(t);if(!n)return t;const r=t.slice(n.start,n.end+1),o=new RegExp(`\\s${e}\\s*=\\s*("([^"]*)"|'([^']*)')`),i=r.match(o);if(i){const c=i[2]??i[3]??"";if("style"===e&&/(?:^|;)\s*text-align\s*:/i.test(c))return t;const l=` ${e}="${c}${"style"===e?"; ":" "}${s}"`,a=r.replace(o,l);return`${t.slice(0,n.start)}${a}${t.slice(n.end+1)}`}const c=r.endsWith("/>")?`${r.slice(0,-2)} ${e}="${s}"/>`:`${r.slice(0,-1)} ${e}="${s}">`;return`${t.slice(0,n.start)}${c}${t.slice(n.end+1)}`}function _(t,e){const s={registry:e,exportCtx:{styleAttr:t=>t?` style="${t}"`:""}},n=j(t.children,s),r=e?e.getAllowedTags():["p","br","div","span"],o=e?e.getAllowedAttrs():["style","dir"];return o.includes("data-block-id")||o.push("data-block-id"),A.sanitize(n,{ALLOWED_TAGS:r,ALLOWED_ATTR:o,ALLOWED_URI_REGEXP:m})}function O(t,e){const s=new k,n={registry:e,collector:s,exportCtx:v(s)},r=j(t.children,n),o=e?e.getAllowedTags():["p","br","div","span"],i=e?e.getAllowedAttrs():["style","class","dir"];i.includes("class")||i.push("class"),i.includes("data-block-id")||i.push("data-block-id");const c=i.filter(t=>"style"!==t);return{html:A.sanitize(r,{ALLOWED_TAGS:o,ALLOWED_ATTR:c,ALLOWED_URI_REGEXP:m}),css:s.toCSS(),styleMap:s.toStyleMap()}}function j(t,e){const s=[];let n=0;for(;n<t.length;){const r=t[n];if(r)if(g(r,"list_item")){const r=[];for(;n<t.length;){const e=t[n];if(!e||!g(e,"list_item"))break;r.push(e),n++}s.push(H(r,e))}else s.push(D(r,e)),n++;else n++}return s.join("")}function H(t,e){const s=[],n=[];for(let r=0;r<t.length;r++){const o=t[r];if(!o)continue;const i=o.attrs?.listType??"bullet",c=o.attrs?.indent??0,l="ordered"===i?"ol":"ul";for(;n.length>0;){const t=n[n.length-1];if(!t)break;if(t.indent>c)s.push(`</${t.tag}></li>`),n.pop();else{if(t.indent!==c||t.tag===l)break;s.push(`</${t.tag}></li>`),n.pop()}}if(0===n.length)s.push(`<${l}>`),n.push({tag:l,indent:c});else{const t=n[n.length-1];t&&c>t.indent&&(s.push(`<${l}>`),n.push({tag:l,indent:c}))}const a=D(o,e),u=t[r+1],f=u?u.attrs?.indent??0:void 0;void 0!==f&&f>c?s.push(R(a)):s.push(a)}for(;n.length>0;){const t=n.pop();if(!t)break;s.push(`</${t.tag}>`),n.length>0&&s.push("</li>")}return s.join("")}function R(t){return t.endsWith("</li>")?t.slice(0,-5):t}function D(r,i){const c=a(r)?function(r,o){const i=function(n){if(n.length<=1)return n;const r=[];for(const o of n){if(s(o)){r.push(o);continue}const n=r[r.length-1];n&&e(n)&&t(n.marks,o.marks)?r[r.length-1]={type:"text",text:n.text+o.text,marks:n.marks}:r.push(o)}return r}(n(r)),c=[],l=o.registry?S(o.registry):void 0;for(const t of i)if(s(t)){const e=o.registry?.getInlineNodeSpec(t.inlineType);e?.toHTMLString&&c.push(e.toHTMLString(t))}else o.registry&&o.collector?c.push(x(t.text,t.marks,o.registry,o.collector,l,o.exportCtx)):o.registry?c.push($(t.text,t.marks,o.registry,l,o.exportCtx)):""!==t.text&&c.push(y(t.text));return c.join("")}(r,i):j(o(r),i),l=i.registry?.getNodeSpec(r.type);let u;if(u=l?.toHTML?l.toHTML(r,c,i.exportCtx):`<p>${c||"<br>"}</p>`,L(r.id)){const t=u.indexOf(">");u.slice(0,t+1).includes(" data-block-id=")||(u=C(u,"data-block-id",h(r.id)))}const f=r.attrs?.align,p=f?E[f]??f:void 0;if(p&&"start"!==p&&N.has(p)){const t=h(p);if(i.collector){const t=i.collector.getAlignmentClassName(p);u=C(u,"class",h(t))}else u=C(u,"style",`text-align: ${t}`)}const d=r.attrs?.dir;if(d&&w.has(d)){const t=u.indexOf(">");u.slice(0,t+1).includes(" dir=")||(u=C(u,"dir",h(d)))}return u}function W(t,e,s){const n=e?e.getAllowedTags():["p","br","div","span"],o=e?e.getAllowedAttrs():["style","dir"];o.includes("data-block-id")||o.push("data-block-id"),s?.styleMap&&!o.includes("class")&&o.push("class");const i=document.createElement("template");i.innerHTML=A.sanitize(t,{ALLOWED_TAGS:n,ALLOWED_ATTR:o,ALLOWED_URI_REGEXP:m});const c=i.content;s?.styleMap&&function(t,e){const s=t.querySelectorAll("[class]");for(const n of Array.from(s)){const t=n,s=Array.from(t.classList),r=[];for(const n of s){const s=e.get(n);if(s){const e=t.getAttribute("style")??"",o=e&&!e.endsWith(";")?"; ":"";t.setAttribute("style",e+o+s),r.push(n)}}for(const e of r)t.classList.remove(e)}}(c,s.styleMap);const l=e?.getBlockParseRules()??[],a=[],u=/* @__PURE__ */new Set;for(const r of Array.from(c.childNodes))I(r,a,l,u,e);return 0===a.length?r():r(a)}function I(t,e,s,n,r){if(t.nodeType===Node.ELEMENT_NODE){const o=t,i=o.tagName.toLowerCase();if("ul"===i||"ol"===i){const t="ol"===i?"ordered":"bullet",s=o.getAttribute("dir");return void P(o,t,0,e,n,r,s&&w.has(s)?s:void 0)}if("table"===i)return void function(t,e,s,n){const r=[],o=function(t){const e=[];for(const s of Array.from(t.children)){const t=s.tagName.toLowerCase();if("tr"===t)e.push(s);else if("thead"===t||"tbody"===t||"tfoot"===t)for(const n of Array.from(s.children))"tr"===n.tagName.toLowerCase()&&e.push(n)}return e}(t);for(const i of o){const t=[];for(const e of Array.from(i.children)){const r=e.tagName.toLowerCase();if("td"!==r&&"th"!==r)continue;const o=e,i=X(o,s,n),l={};G(o,l);const a=c(u("table_cell"),i,T(o,s),Object.keys(l).length>0?l:void 0);t.push(a)}t.length>0&&r.push(c(u("table_row"),t,T(i,s)))}if(r.length>0){const n={};!function(t,e){const s=t.getAttribute("style")??"",n=z.exec(s);n?.[1]&&(e.borderColor="transparent"===n[1]?"none":n[1])}(t,n),e.push(c(u("table"),r,T(t,s),Object.keys(n).length>0?n:void 0))}}(o,e,n,r);const a=function(t,e){const s=t.tagName.toLowerCase();for(const n of e)if(n.rule.tag===s){if(n.rule.getAttrs){const e=n.rule.getAttrs(t);if(!1===e)continue;return{type:n.type,attrs:e}}return{type:n.type}}return null}(o,s);if(a){const t=r?.getNodeSpec(a.type),s=t?.isVoid?[l("")]:U(o,r),i={...a.attrs};return t?.attrs?.align&&F(o,i),t?.attrs?.dir&&q(o,i),void e.push(c(u(a.type),s,T(o,n),Object.keys(i).length>0?i:void 0))}const f=U(o,r),p={};F(o,p),q(o,p),e.push(c(u("paragraph"),f,T(o,n),Object.keys(p).length>0?p:void 0))}else t.nodeType===Node.TEXT_NODE&&t.textContent?.trim()&&e.push(c(u("paragraph"),[l(t.textContent.trim())]))}function P(t,e,s,n,r,o,i){for(const l of Array.from(t.children)){const t=l.tagName.toLowerCase();if("li"===t){const t=l,a=t.querySelector(':scope > input[type="checkbox"]'),f=null!==a,p=a?.hasAttribute("checked")??!1,d=f?"checklist":e,g=U(t,o,!0),h={listType:d,indent:s,checked:p},y=t.getAttribute("dir"),m=y&&w.has(y)?y:i;m&&(h.dir=m),n.push(c(u("list_item"),g,T(t,r),h));for(const e of Array.from(t.children)){const t=e.tagName.toLowerCase();if("ul"===t||"ol"===t){const i="ol"===t?"ordered":"bullet",c=e.getAttribute("dir");P(e,i,s+1,n,r,o,c&&w.has(c)?c:m)}}}else if("ul"===t||"ol"===t){const e="ol"===t?"ordered":"bullet",c=l.getAttribute("dir");P(l,e,s+1,n,r,o,c&&w.has(c)?c:i)}}}var z=/--ntbl-bc:\s*(#[0-9a-fA-F]{3,8}|transparent)/;function G(t,e){const s=t.getAttribute("colspan");if(s){const t=Number.parseInt(s,10);t>1&&(e.colspan=t)}const n=t.getAttribute("rowspan");if(n){const t=Number.parseInt(n,10);t>1&&(e.rowspan=t)}}function X(t,e,s){const n=s?.getBlockParseRules()??[],r=[];for(const o of Array.from(t.childNodes))I(o,r,n,e,s);if(0===r.length){const e=U(t,s);r.push(c(u("paragraph"),e))}return r}function U(t,e,n){const r=[];return B(t,[],r,e?.getMarkParseRules()??[],e?.getInlineParseRules()??[],n),1===r.length&&s(r[0])&&"hard_break"===r[0].inlineType?[l("")]:r.length>0?r:[l("")]}function B(t,e,s,n,r,o){if(t.nodeType===Node.TEXT_NODE){const n=t.textContent??"";return void(n&&s.push(l(n,[...e])))}if(t.nodeType!==Node.ELEMENT_NODE)return;const c=t,a=c.tagName.toLowerCase();if(o&&("ul"===a||"ol"===a))return;if(o&&"input"===a&&"checkbox"===c.getAttribute("type"))return;for(const l of r)if(l.rule.tag===a){if(l.rule.getAttrs){const t=l.rule.getAttrs(c);if(!1===t)continue;return void s.push(i(p(l.type),t))}return void s.push(i(p(l.type)))}const u=[...e],d=/* @__PURE__ */new Set;for(const i of n)if(i.rule.tag===a&&!d.has(i.type))if(i.rule.getAttrs){const t=i.rule.getAttrs(c);if(!1===t)continue;u.some(t=>t.type===i.type)||(u.push({type:f(i.type),...Object.keys(t).length>0?{attrs:t}:{}}),d.add(i.type))}else u.some(t=>t.type===i.type)||(u.push({type:f(i.type)}),d.add(i.type));for(const i of Array.from(c.childNodes))B(i,u,s,n,r,o)}function q(t,e){const s=t.getAttribute("dir");if(s&&w.has(s))return void(e.dir=s);const n=t.style?.direction??"";n&&w.has(n)&&(e.dir=n)}var Z={left:"start",right:"end"};function F(t,e){let s=t.style?.textAlign??"";const n=Z[s];if(n&&(s=n),s&&N.has(s))e.align=s;else for(const r of Array.from(t.classList)){let t=r.match(/^notectl-align-(\w+)$/)?.[1];const s=Z[t??""];if(s&&(t=s),t&&N.has(t))return void(e.align=t)}}export{_ as a,O as i,N as n,S as o,w as r,$ as s,W as t};
|
|
2
|
-
//# sourceMappingURL=DocumentParser-CyATBOz-.mjs.map
|