@notectl/core 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/chunks/AlignmentPlugin-h6sx-yIf.mjs +2 -0
- package/dist/chunks/AlignmentPlugin-h6sx-yIf.mjs.map +1 -0
- package/dist/chunks/AttrRegistry-DcDVyzLm.mjs +2 -0
- package/dist/chunks/AttrRegistry-DcDVyzLm.mjs.map +1 -0
- package/dist/chunks/AttributedMarkCommands-D4W2Jgpj.mjs +2 -0
- package/dist/chunks/AttributedMarkCommands-D4W2Jgpj.mjs.map +1 -0
- package/dist/chunks/BidiIsolationPlugin-Bm3h9J15.mjs +2 -0
- package/dist/chunks/BidiIsolationPlugin-Bm3h9J15.mjs.map +1 -0
- package/dist/chunks/BlockInsertion-6rR9tIGP.mjs +2 -0
- package/dist/chunks/BlockInsertion-6rR9tIGP.mjs.map +1 -0
- package/dist/chunks/BlockTypePickerRegistry-BTET9jM-.mjs +2 -0
- package/dist/chunks/BlockTypePickerRegistry-BTET9jM-.mjs.map +1 -0
- package/dist/chunks/BlockquotePlugin-CxrCA0vY.mjs +2 -0
- package/dist/chunks/BlockquotePlugin-CxrCA0vY.mjs.map +1 -0
- package/dist/chunks/CaretNavigationPlugin-Bb7W_FMg.mjs +2 -0
- package/dist/chunks/CaretNavigationPlugin-Bb7W_FMg.mjs.map +1 -0
- package/dist/chunks/CodeBlockPlugin-Uv6EXaH1.mjs +2 -0
- package/dist/chunks/CodeBlockPlugin-Uv6EXaH1.mjs.map +1 -0
- package/dist/chunks/ColorGrid-CXRdpP_n.mjs +2 -0
- package/dist/chunks/ColorGrid-CXRdpP_n.mjs.map +1 -0
- package/dist/chunks/ColorPickerPopup-C_74bqid.mjs +2 -0
- package/dist/chunks/ColorPickerPopup-C_74bqid.mjs.map +1 -0
- package/dist/chunks/ColorValidation-DAijTjG9.mjs +2 -0
- package/dist/chunks/ColorValidation-DAijTjG9.mjs.map +1 -0
- package/dist/chunks/Commands-CyT1Li7_.mjs +2 -0
- package/dist/chunks/Commands-CyT1Li7_.mjs.map +1 -0
- package/dist/chunks/Decoration-ZeyVfwJB.mjs +2 -0
- package/dist/chunks/Decoration-ZeyVfwJB.mjs.map +1 -0
- package/dist/chunks/DirectionDetection-C7XE0nxW.mjs +2 -0
- package/dist/chunks/DirectionDetection-C7XE0nxW.mjs.map +1 -0
- package/dist/chunks/DirectionIcons-Bbawl9ei.mjs +2 -0
- package/dist/chunks/DirectionIcons-Bbawl9ei.mjs.map +1 -0
- package/dist/chunks/Document-r7vLOAGA.mjs +2 -0
- package/dist/chunks/Document-r7vLOAGA.mjs.map +1 -0
- package/dist/chunks/DocumentParser-CcTSeT1B.mjs +2 -0
- package/dist/chunks/DocumentParser-CcTSeT1B.mjs.map +1 -0
- package/dist/chunks/DomUtils-Bf7JLFlx.mjs +2 -0
- package/dist/chunks/DomUtils-Bf7JLFlx.mjs.map +1 -0
- package/dist/chunks/FontPlugin-1VYDwETg.mjs +2 -0
- package/dist/chunks/FontPlugin-1VYDwETg.mjs.map +1 -0
- package/dist/chunks/FontSizePlugin-L1uDVsKY.mjs +2 -0
- package/dist/chunks/FontSizePlugin-L1uDVsKY.mjs.map +1 -0
- package/dist/chunks/FormulaPlugin-UA-9tRpY.mjs +2 -0
- package/dist/chunks/FormulaPlugin-UA-9tRpY.mjs.map +1 -0
- package/dist/chunks/GapCursorNavigation-ycNzuQVH.mjs +2 -0
- package/dist/chunks/GapCursorNavigation-ycNzuQVH.mjs.map +1 -0
- package/dist/chunks/GapCursorPlugin-B29ieXel.mjs +2 -0
- package/dist/chunks/GapCursorPlugin-B29ieXel.mjs.map +1 -0
- package/dist/chunks/HTMLUtils-C6B4UT00.mjs +2 -0
- package/dist/chunks/HTMLUtils-C6B4UT00.mjs.map +1 -0
- package/dist/chunks/HardBreakPlugin-BkgoJkjC.mjs +2 -0
- package/dist/chunks/HardBreakPlugin-BkgoJkjC.mjs.map +1 -0
- package/dist/chunks/HeadingPlugin-SICF6Tm0.mjs +2 -0
- package/dist/chunks/HeadingPlugin-SICF6Tm0.mjs.map +1 -0
- package/dist/chunks/HighlightPlugin-B3b_qe68.mjs +2 -0
- package/dist/chunks/HighlightPlugin-B3b_qe68.mjs.map +1 -0
- package/dist/chunks/HorizontalRulePlugin-BrFlrpmb.mjs +2 -0
- package/dist/chunks/HorizontalRulePlugin-BrFlrpmb.mjs.map +1 -0
- package/dist/chunks/ImagePlugin-eRVtFFou.mjs +2 -0
- package/dist/chunks/ImagePlugin-eRVtFFou.mjs.map +1 -0
- package/dist/chunks/InlineCodePlugin-D3QulApr.mjs +2 -0
- package/dist/chunks/InlineCodePlugin-D3QulApr.mjs.map +1 -0
- package/dist/chunks/InlineStyleMarkSpec-4R6DC7ij.mjs +2 -0
- package/dist/chunks/InlineStyleMarkSpec-4R6DC7ij.mjs.map +1 -0
- package/dist/chunks/KeyboardNav-D0my3wuy.mjs +2 -0
- package/dist/chunks/KeyboardNav-D0my3wuy.mjs.map +1 -0
- package/dist/chunks/LinkPlugin-B_ysjORS.mjs +2 -0
- package/dist/chunks/LinkPlugin-B_ysjORS.mjs.map +1 -0
- package/dist/chunks/ListPlugin-C0BV8CnQ.mjs +2 -0
- package/dist/chunks/ListPlugin-C0BV8CnQ.mjs.map +1 -0
- package/dist/chunks/NavigationQueries-Bt4zZ17v.mjs +2 -0
- package/dist/chunks/NavigationQueries-Bt4zZ17v.mjs.map +1 -0
- package/dist/chunks/NodeResolver-ChgLF_IP.mjs +2 -0
- package/dist/chunks/NodeResolver-ChgLF_IP.mjs.map +1 -0
- package/dist/chunks/NodeSelectionCommands-Dj4VxLdD.mjs +2 -0
- package/dist/chunks/NodeSelectionCommands-Dj4VxLdD.mjs.map +1 -0
- package/dist/chunks/NodeSpecPatching-B_yLknTl.mjs +2 -0
- package/dist/chunks/NodeSpecPatching-B_yLknTl.mjs.map +1 -0
- package/dist/chunks/Platform-ByobkiCc.mjs +2 -0
- package/dist/chunks/Platform-ByobkiCc.mjs.map +1 -0
- package/dist/chunks/PluginHelpers-D4quRJ5a.mjs +2 -0
- package/dist/chunks/PluginHelpers-D4quRJ5a.mjs.map +1 -0
- package/dist/chunks/PopupKeyboardPatterns-tUrT9TyV.mjs +2 -0
- package/dist/chunks/PopupKeyboardPatterns-tUrT9TyV.mjs.map +1 -0
- package/dist/chunks/PopupManager-CyOfZUab.mjs +2 -0
- package/dist/chunks/PopupManager-CyOfZUab.mjs.map +1 -0
- package/dist/chunks/PopupPositioning-DtUrY9bh.mjs +2 -0
- package/dist/chunks/PopupPositioning-DtUrY9bh.mjs.map +1 -0
- package/dist/chunks/PrintPlugin-CXDFFzWB.mjs +2 -0
- package/dist/chunks/PrintPlugin-CXDFFzWB.mjs.map +1 -0
- package/dist/chunks/PrintTypes-WdtgSj74.mjs +2 -0
- package/dist/chunks/PrintTypes-WdtgSj74.mjs.map +1 -0
- package/dist/chunks/RangeIterator-o8v3msQe.mjs +2 -0
- package/dist/chunks/RangeIterator-o8v3msQe.mjs.map +1 -0
- package/dist/chunks/Selection-HYoVFpAx.mjs +2 -0
- package/dist/chunks/Selection-HYoVFpAx.mjs.map +1 -0
- package/dist/chunks/SelectionSync-BSHIw1EE.mjs +2 -0
- package/dist/chunks/SelectionSync-BSHIw1EE.mjs.map +1 -0
- package/dist/chunks/ShortcutFormatting-TwiufqeV.mjs +2 -0
- package/dist/chunks/ShortcutFormatting-TwiufqeV.mjs.map +1 -0
- package/dist/chunks/SimpleMark-Db8ir_z2.mjs +2 -0
- package/dist/chunks/SimpleMark-Db8ir_z2.mjs.map +1 -0
- package/dist/chunks/SmartPastePlugin-Db1RcNJf.mjs +2 -0
- package/dist/chunks/SmartPastePlugin-Db1RcNJf.mjs.map +1 -0
- package/dist/chunks/StrikethroughPlugin-Bsg7Ma4I.mjs +2 -0
- package/dist/chunks/StrikethroughPlugin-Bsg7Ma4I.mjs.map +1 -0
- package/dist/chunks/StyleRuntime-BAutwDZT.mjs +2 -0
- package/dist/chunks/StyleRuntime-BAutwDZT.mjs.map +1 -0
- package/dist/chunks/SuperSubPlugin-ChEga-b_.mjs +2 -0
- package/dist/chunks/SuperSubPlugin-ChEga-b_.mjs.map +1 -0
- package/dist/chunks/SyntaxTokenTypes-BUCOMtL8.mjs +2 -0
- package/dist/chunks/SyntaxTokenTypes-BUCOMtL8.mjs.map +1 -0
- package/dist/chunks/TablePlugin-CRp4qSZE.mjs +2 -0
- package/dist/chunks/TablePlugin-CRp4qSZE.mjs.map +1 -0
- package/dist/chunks/TextColorPlugin-CViEiYZk.mjs +2 -0
- package/dist/chunks/TextColorPlugin-CViEiYZk.mjs.map +1 -0
- package/dist/chunks/TextDirectionAutoPlugin-CzWJjrvG.mjs +2 -0
- package/dist/chunks/TextDirectionAutoPlugin-CzWJjrvG.mjs.map +1 -0
- package/dist/chunks/TextDirectionPlugin-CQGkaS2s.mjs +2 -0
- package/dist/chunks/TextDirectionPlugin-CQGkaS2s.mjs.map +1 -0
- package/dist/chunks/TextDirectionService-OFOU6r_s.mjs +2 -0
- package/dist/chunks/TextDirectionService-OFOU6r_s.mjs.map +1 -0
- package/dist/chunks/TextFormattingPlugin-Db5SCNOF.mjs +2 -0
- package/dist/chunks/TextFormattingPlugin-Db5SCNOF.mjs.map +1 -0
- package/dist/chunks/ToolbarPlugin-B5UUc6dY.mjs +2 -0
- package/dist/chunks/ToolbarPlugin-B5UUc6dY.mjs.map +1 -0
- package/dist/chunks/TypeBrands-Ch9856Gb.mjs +2 -0
- package/dist/chunks/TypeBrands-Ch9856Gb.mjs.map +1 -0
- package/dist/chunks/TypedKeys-CA4bfw9O.mjs +2 -0
- package/dist/chunks/TypedKeys-CA4bfw9O.mjs.map +1 -0
- package/dist/chunks/VideoPlugin-mXIDODzC.mjs +2 -0
- package/dist/chunks/VideoPlugin-mXIDODzC.mjs.map +1 -0
- package/dist/chunks/WordBoundary-DxeMBRyP.mjs +2 -0
- package/dist/chunks/WordBoundary-DxeMBRyP.mjs.map +1 -0
- package/dist/chunks/XmlDetector-D7TQpw-e.mjs +2 -0
- package/dist/chunks/XmlDetector-D7TQpw-e.mjs.map +1 -0
- package/dist/chunks/XmlPatterns-RN32-0ob.mjs +2 -0
- package/dist/chunks/XmlPatterns-RN32-0ob.mjs.map +1 -0
- package/dist/chunks/XmlSupport-BYiRwlkK.mjs +2 -0
- package/dist/chunks/XmlSupport-BYiRwlkK.mjs.map +1 -0
- package/dist/chunks/ar--Isa9OHJ.mjs +2 -0
- package/dist/chunks/ar--Isa9OHJ.mjs.map +1 -0
- package/dist/chunks/ar--O0A9OTR.mjs +2 -0
- package/dist/chunks/ar--O0A9OTR.mjs.map +1 -0
- package/dist/chunks/ar-0g2bmXTn.mjs +2 -0
- package/dist/chunks/ar-0g2bmXTn.mjs.map +1 -0
- package/dist/chunks/ar-4b8e2YSc.mjs +2 -0
- package/dist/chunks/ar-4b8e2YSc.mjs.map +1 -0
- package/dist/chunks/ar-B03uY4xr.mjs +2 -0
- package/dist/chunks/ar-B03uY4xr.mjs.map +1 -0
- package/dist/chunks/ar-BAfInw85.mjs +2 -0
- package/dist/chunks/ar-BAfInw85.mjs.map +1 -0
- package/dist/chunks/ar-BRX5E_Pw.mjs +2 -0
- package/dist/chunks/ar-BRX5E_Pw.mjs.map +1 -0
- package/dist/chunks/ar-BTShmP2E.mjs +2 -0
- package/dist/chunks/ar-BTShmP2E.mjs.map +1 -0
- package/dist/chunks/ar-BWOue6jG.mjs +2 -0
- package/dist/chunks/ar-BWOue6jG.mjs.map +1 -0
- package/dist/chunks/ar-Bdmunk5h.mjs +2 -0
- package/dist/chunks/ar-Bdmunk5h.mjs.map +1 -0
- package/dist/chunks/ar-BwaoCUVN.mjs +2 -0
- package/dist/chunks/ar-BwaoCUVN.mjs.map +1 -0
- package/dist/chunks/ar-BzqAYGER.mjs +2 -0
- package/dist/chunks/ar-BzqAYGER.mjs.map +1 -0
- package/dist/chunks/ar-C9lO1jsY.mjs +2 -0
- package/dist/chunks/ar-C9lO1jsY.mjs.map +1 -0
- package/dist/chunks/ar-CMXjVzFx.mjs +2 -0
- package/dist/chunks/ar-CMXjVzFx.mjs.map +1 -0
- package/dist/chunks/ar-CR6UdFL9.mjs +2 -0
- package/dist/chunks/ar-CR6UdFL9.mjs.map +1 -0
- package/dist/chunks/ar-CrOb0jL2.mjs +2 -0
- package/dist/chunks/ar-CrOb0jL2.mjs.map +1 -0
- package/dist/chunks/ar-Ctrv6cIi.mjs +2 -0
- package/dist/chunks/ar-Ctrv6cIi.mjs.map +1 -0
- package/dist/chunks/ar-Cy_77yRf.mjs +2 -0
- package/dist/chunks/ar-Cy_77yRf.mjs.map +1 -0
- package/dist/chunks/ar-D1jFXqLJ.mjs +2 -0
- package/dist/chunks/ar-D1jFXqLJ.mjs.map +1 -0
- package/dist/chunks/ar-DahJwMI9.mjs +2 -0
- package/dist/chunks/ar-DahJwMI9.mjs.map +1 -0
- package/dist/chunks/ar-Dcl3kgtd.mjs +2 -0
- package/dist/chunks/ar-Dcl3kgtd.mjs.map +1 -0
- package/dist/chunks/ar-Dx2lO0Nm.mjs +2 -0
- package/dist/chunks/ar-Dx2lO0Nm.mjs.map +1 -0
- package/dist/chunks/ar-NV_puwI2.mjs +2 -0
- package/dist/chunks/ar-NV_puwI2.mjs.map +1 -0
- package/dist/chunks/ar-Uzo1Azdw.mjs +2 -0
- package/dist/chunks/ar-Uzo1Azdw.mjs.map +1 -0
- package/dist/chunks/ar-XmSFrtmd.mjs +2 -0
- package/dist/chunks/ar-XmSFrtmd.mjs.map +1 -0
- package/dist/chunks/ar-jbplYWkC.mjs +2 -0
- package/dist/chunks/ar-jbplYWkC.mjs.map +1 -0
- package/dist/chunks/ar-sGZ-oZqB.mjs +2 -0
- package/dist/chunks/ar-sGZ-oZqB.mjs.map +1 -0
- package/dist/chunks/color-picker-C9B2rYw-.mjs +2 -0
- package/dist/chunks/color-picker-C9B2rYw-.mjs.map +1 -0
- package/dist/chunks/de-B8-w9gPi.mjs +2 -0
- package/dist/chunks/de-B8-w9gPi.mjs.map +1 -0
- package/dist/chunks/de-B9zSHWqY.mjs +2 -0
- package/dist/chunks/de-B9zSHWqY.mjs.map +1 -0
- package/dist/chunks/de-BX4y4PlH.mjs +2 -0
- package/dist/chunks/de-BX4y4PlH.mjs.map +1 -0
- package/dist/chunks/de-BXQBXxFJ.mjs +2 -0
- package/dist/chunks/de-BXQBXxFJ.mjs.map +1 -0
- package/dist/chunks/de-BcPntcnr.mjs +2 -0
- package/dist/chunks/de-BcPntcnr.mjs.map +1 -0
- package/dist/chunks/de-BdD3DpUB.mjs +2 -0
- package/dist/chunks/de-BdD3DpUB.mjs.map +1 -0
- package/dist/chunks/de-Bwxlcuee.mjs +2 -0
- package/dist/chunks/de-Bwxlcuee.mjs.map +1 -0
- package/dist/chunks/de-BxQIt_1Y.mjs +2 -0
- package/dist/chunks/de-BxQIt_1Y.mjs.map +1 -0
- package/dist/chunks/de-C--bRmjW.mjs +2 -0
- package/dist/chunks/de-C--bRmjW.mjs.map +1 -0
- package/dist/chunks/de-C-Yf378-.mjs +2 -0
- package/dist/chunks/de-C-Yf378-.mjs.map +1 -0
- package/dist/chunks/de-C7uehgMu.mjs +2 -0
- package/dist/chunks/de-C7uehgMu.mjs.map +1 -0
- package/dist/chunks/de-C9ZhDqPi.mjs +2 -0
- package/dist/chunks/de-C9ZhDqPi.mjs.map +1 -0
- package/dist/chunks/de-CHcv_Vmf.mjs +2 -0
- package/dist/chunks/de-CHcv_Vmf.mjs.map +1 -0
- package/dist/chunks/de-CTzAMkXC.mjs +2 -0
- package/dist/chunks/de-CTzAMkXC.mjs.map +1 -0
- package/dist/chunks/de-CaeEIyzV.mjs +2 -0
- package/dist/chunks/de-CaeEIyzV.mjs.map +1 -0
- package/dist/chunks/de-DHs9i4af.mjs +2 -0
- package/dist/chunks/de-DHs9i4af.mjs.map +1 -0
- package/dist/chunks/de-DN-e6G5A.mjs +2 -0
- package/dist/chunks/de-DN-e6G5A.mjs.map +1 -0
- package/dist/chunks/de-DViI26lG.mjs +2 -0
- package/dist/chunks/de-DViI26lG.mjs.map +1 -0
- package/dist/chunks/de-DY3obIAF.mjs +2 -0
- package/dist/chunks/de-DY3obIAF.mjs.map +1 -0
- package/dist/chunks/de-DcMhfRBu.mjs +2 -0
- package/dist/chunks/de-DcMhfRBu.mjs.map +1 -0
- package/dist/chunks/de-DiPz7abS.mjs +2 -0
- package/dist/chunks/de-DiPz7abS.mjs.map +1 -0
- package/dist/chunks/de-Dl4QFHMa.mjs +2 -0
- package/dist/chunks/de-Dl4QFHMa.mjs.map +1 -0
- package/dist/chunks/de-JhGflzS5.mjs +2 -0
- package/dist/chunks/de-JhGflzS5.mjs.map +1 -0
- package/dist/chunks/de-XCCpWyg0.mjs +2 -0
- package/dist/chunks/de-XCCpWyg0.mjs.map +1 -0
- package/dist/chunks/de-e6J6nvAD.mjs +2 -0
- package/dist/chunks/de-e6J6nvAD.mjs.map +1 -0
- package/dist/chunks/de-i95F9SDy.mjs +2 -0
- package/dist/chunks/de-i95F9SDy.mjs.map +1 -0
- package/dist/chunks/de-uKR7koQe.mjs +2 -0
- package/dist/chunks/de-uKR7koQe.mjs.map +1 -0
- package/dist/chunks/es-B0Za939C.mjs +2 -0
- package/dist/chunks/es-B0Za939C.mjs.map +1 -0
- package/dist/chunks/es-B8K3Yvf3.mjs +2 -0
- package/dist/chunks/es-B8K3Yvf3.mjs.map +1 -0
- package/dist/chunks/es-BIXm2Coj.mjs +2 -0
- package/dist/chunks/es-BIXm2Coj.mjs.map +1 -0
- package/dist/chunks/es-BJHF95J_.mjs +2 -0
- package/dist/chunks/es-BJHF95J_.mjs.map +1 -0
- package/dist/chunks/es-BMm9kqjC.mjs +2 -0
- package/dist/chunks/es-BMm9kqjC.mjs.map +1 -0
- package/dist/chunks/es-BQweZX6P.mjs +2 -0
- package/dist/chunks/es-BQweZX6P.mjs.map +1 -0
- package/dist/chunks/es-BdpTTRuX.mjs +2 -0
- package/dist/chunks/es-BdpTTRuX.mjs.map +1 -0
- package/dist/chunks/es-Bv7bDbMp.mjs +2 -0
- package/dist/chunks/es-Bv7bDbMp.mjs.map +1 -0
- package/dist/chunks/es-C7uVqFYr.mjs +2 -0
- package/dist/chunks/es-C7uVqFYr.mjs.map +1 -0
- package/dist/chunks/es-CCQFu1t1.mjs +2 -0
- package/dist/chunks/es-CCQFu1t1.mjs.map +1 -0
- package/dist/chunks/es-CM55WeEN.mjs +2 -0
- package/dist/chunks/es-CM55WeEN.mjs.map +1 -0
- package/dist/chunks/es-CUKJujcb.mjs +2 -0
- package/dist/chunks/es-CUKJujcb.mjs.map +1 -0
- package/dist/chunks/es-CXuMz87y.mjs +2 -0
- package/dist/chunks/es-CXuMz87y.mjs.map +1 -0
- package/dist/chunks/es-CgMfhkJJ.mjs +2 -0
- package/dist/chunks/es-CgMfhkJJ.mjs.map +1 -0
- package/dist/chunks/es-CtOtKQCP.mjs +2 -0
- package/dist/chunks/es-CtOtKQCP.mjs.map +1 -0
- package/dist/chunks/es-DD01rZ6N.mjs +2 -0
- package/dist/chunks/es-DD01rZ6N.mjs.map +1 -0
- package/dist/chunks/es-DDoqchUq.mjs +2 -0
- package/dist/chunks/es-DDoqchUq.mjs.map +1 -0
- package/dist/chunks/es-DFUVd7eO.mjs +2 -0
- package/dist/chunks/es-DFUVd7eO.mjs.map +1 -0
- package/dist/chunks/es-DFokqQst.mjs +2 -0
- package/dist/chunks/es-DFokqQst.mjs.map +1 -0
- package/dist/chunks/es-DHxdoEzR.mjs +2 -0
- package/dist/chunks/es-DHxdoEzR.mjs.map +1 -0
- package/dist/chunks/es-DehVGwQ8.mjs +2 -0
- package/dist/chunks/es-DehVGwQ8.mjs.map +1 -0
- package/dist/chunks/es-DrJyl38L.mjs +2 -0
- package/dist/chunks/es-DrJyl38L.mjs.map +1 -0
- package/dist/chunks/es-fTW0TkYV.mjs +2 -0
- package/dist/chunks/es-fTW0TkYV.mjs.map +1 -0
- package/dist/chunks/es-kfKiqpyD.mjs +2 -0
- package/dist/chunks/es-kfKiqpyD.mjs.map +1 -0
- package/dist/chunks/es-nRLq7bgP.mjs +2 -0
- package/dist/chunks/es-nRLq7bgP.mjs.map +1 -0
- package/dist/chunks/es-paXY7HFt.mjs +2 -0
- package/dist/chunks/es-paXY7HFt.mjs.map +1 -0
- package/dist/chunks/es-xuahrvJN.mjs +2 -0
- package/dist/chunks/es-xuahrvJN.mjs.map +1 -0
- package/dist/chunks/fonts-DQC6Uj4r.mjs +2 -0
- package/dist/chunks/fonts-DQC6Uj4r.mjs.map +1 -0
- package/dist/chunks/fr-0qEo3bRP.mjs +2 -0
- package/dist/chunks/fr-0qEo3bRP.mjs.map +1 -0
- package/dist/chunks/fr-5HkMazAf.mjs +2 -0
- package/dist/chunks/fr-5HkMazAf.mjs.map +1 -0
- package/dist/chunks/fr-B9pBLaVx.mjs +2 -0
- package/dist/chunks/fr-B9pBLaVx.mjs.map +1 -0
- package/dist/chunks/fr-BRXUnq3R.mjs +2 -0
- package/dist/chunks/fr-BRXUnq3R.mjs.map +1 -0
- package/dist/chunks/fr-BSUKEtTk.mjs +2 -0
- package/dist/chunks/fr-BSUKEtTk.mjs.map +1 -0
- package/dist/chunks/fr-BaXKyPmX.mjs +2 -0
- package/dist/chunks/fr-BaXKyPmX.mjs.map +1 -0
- package/dist/chunks/fr-BeRlON1t.mjs +2 -0
- package/dist/chunks/fr-BeRlON1t.mjs.map +1 -0
- package/dist/chunks/fr-Bg937iAy.mjs +2 -0
- package/dist/chunks/fr-Bg937iAy.mjs.map +1 -0
- package/dist/chunks/fr-BwWrFThE.mjs +2 -0
- package/dist/chunks/fr-BwWrFThE.mjs.map +1 -0
- package/dist/chunks/fr-C3EKRThN.mjs +2 -0
- package/dist/chunks/fr-C3EKRThN.mjs.map +1 -0
- package/dist/chunks/fr-CKjH6tJI.mjs +2 -0
- package/dist/chunks/fr-CKjH6tJI.mjs.map +1 -0
- package/dist/chunks/fr-CQs0-pNX.mjs +2 -0
- package/dist/chunks/fr-CQs0-pNX.mjs.map +1 -0
- package/dist/chunks/fr-C_2i5Ono.mjs +2 -0
- package/dist/chunks/fr-C_2i5Ono.mjs.map +1 -0
- package/dist/chunks/fr-CfhyYN-t.mjs +2 -0
- package/dist/chunks/fr-CfhyYN-t.mjs.map +1 -0
- package/dist/chunks/fr-D0MDdoir.mjs +2 -0
- package/dist/chunks/fr-D0MDdoir.mjs.map +1 -0
- package/dist/chunks/fr-D5ulA3Z6.mjs +2 -0
- package/dist/chunks/fr-D5ulA3Z6.mjs.map +1 -0
- package/dist/chunks/fr-DEZ_oxzS.mjs +2 -0
- package/dist/chunks/fr-DEZ_oxzS.mjs.map +1 -0
- package/dist/chunks/fr-DciSEykY.mjs +2 -0
- package/dist/chunks/fr-DciSEykY.mjs.map +1 -0
- package/dist/chunks/fr-DiDhVhyV.mjs +2 -0
- package/dist/chunks/fr-DiDhVhyV.mjs.map +1 -0
- package/dist/chunks/fr-DjMZ-3K5.mjs +2 -0
- package/dist/chunks/fr-DjMZ-3K5.mjs.map +1 -0
- package/dist/chunks/fr-DtzIu6tU.mjs +2 -0
- package/dist/chunks/fr-DtzIu6tU.mjs.map +1 -0
- package/dist/chunks/fr-F2ZrfVaF.mjs +2 -0
- package/dist/chunks/fr-F2ZrfVaF.mjs.map +1 -0
- package/dist/chunks/fr-KXmbys88.mjs +2 -0
- package/dist/chunks/fr-KXmbys88.mjs.map +1 -0
- package/dist/chunks/fr-SbpHNrQ-.mjs +2 -0
- package/dist/chunks/fr-SbpHNrQ-.mjs.map +1 -0
- package/dist/chunks/fr-ZsRdLuys.mjs +2 -0
- package/dist/chunks/fr-ZsRdLuys.mjs.map +1 -0
- package/dist/chunks/fr-eC0UdAPu.mjs +2 -0
- package/dist/chunks/fr-eC0UdAPu.mjs.map +1 -0
- package/dist/chunks/fr-fshsDD66.mjs +2 -0
- package/dist/chunks/fr-fshsDD66.mjs.map +1 -0
- package/dist/chunks/full--GEBZ2xU.mjs +2 -0
- package/dist/chunks/full--GEBZ2xU.mjs.map +1 -0
- package/dist/chunks/hi-4CiAKVjT.mjs +2 -0
- package/dist/chunks/hi-4CiAKVjT.mjs.map +1 -0
- package/dist/chunks/hi-B-ZuX4aN.mjs +2 -0
- package/dist/chunks/hi-B-ZuX4aN.mjs.map +1 -0
- package/dist/chunks/hi-B2YB3Bo4.mjs +2 -0
- package/dist/chunks/hi-B2YB3Bo4.mjs.map +1 -0
- package/dist/chunks/hi-B2uhiPCN.mjs +2 -0
- package/dist/chunks/hi-B2uhiPCN.mjs.map +1 -0
- package/dist/chunks/hi-B5cl8TWK.mjs +2 -0
- package/dist/chunks/hi-B5cl8TWK.mjs.map +1 -0
- package/dist/chunks/hi-BNJIGWQQ.mjs +2 -0
- package/dist/chunks/hi-BNJIGWQQ.mjs.map +1 -0
- package/dist/chunks/hi-BOMkDPqC.mjs +2 -0
- package/dist/chunks/hi-BOMkDPqC.mjs.map +1 -0
- package/dist/chunks/hi-Bl-yeeOI.mjs +2 -0
- package/dist/chunks/hi-Bl-yeeOI.mjs.map +1 -0
- package/dist/chunks/hi-Bu799xIO.mjs +2 -0
- package/dist/chunks/hi-Bu799xIO.mjs.map +1 -0
- package/dist/chunks/hi-By8YwVIX.mjs +2 -0
- package/dist/chunks/hi-By8YwVIX.mjs.map +1 -0
- package/dist/chunks/hi-BzbMD_cP.mjs +2 -0
- package/dist/chunks/hi-BzbMD_cP.mjs.map +1 -0
- package/dist/chunks/hi-C2jEsf8v.mjs +2 -0
- package/dist/chunks/hi-C2jEsf8v.mjs.map +1 -0
- package/dist/chunks/hi-C9fvG91d.mjs +2 -0
- package/dist/chunks/hi-C9fvG91d.mjs.map +1 -0
- package/dist/chunks/hi-CTWubxLY.mjs +2 -0
- package/dist/chunks/hi-CTWubxLY.mjs.map +1 -0
- package/dist/chunks/hi-CoclKAUM.mjs +2 -0
- package/dist/chunks/hi-CoclKAUM.mjs.map +1 -0
- package/dist/chunks/hi-CrmakMVj.mjs +2 -0
- package/dist/chunks/hi-CrmakMVj.mjs.map +1 -0
- package/dist/chunks/hi-DWX6k5ZD.mjs +2 -0
- package/dist/chunks/hi-DWX6k5ZD.mjs.map +1 -0
- package/dist/chunks/hi-DY55FuDK.mjs +2 -0
- package/dist/chunks/hi-DY55FuDK.mjs.map +1 -0
- package/dist/chunks/hi-DsdXcOB6.mjs +2 -0
- package/dist/chunks/hi-DsdXcOB6.mjs.map +1 -0
- package/dist/chunks/hi-Dt89SxNy.mjs +2 -0
- package/dist/chunks/hi-Dt89SxNy.mjs.map +1 -0
- package/dist/chunks/hi-J8ErB5nB.mjs +2 -0
- package/dist/chunks/hi-J8ErB5nB.mjs.map +1 -0
- package/dist/chunks/hi-L6pJxZam.mjs +2 -0
- package/dist/chunks/hi-L6pJxZam.mjs.map +1 -0
- package/dist/chunks/hi-SECtQQzq.mjs +2 -0
- package/dist/chunks/hi-SECtQQzq.mjs.map +1 -0
- package/dist/chunks/hi-aH9HZG23.mjs +2 -0
- package/dist/chunks/hi-aH9HZG23.mjs.map +1 -0
- package/dist/chunks/hi-j3TDLMYd.mjs +2 -0
- package/dist/chunks/hi-j3TDLMYd.mjs.map +1 -0
- package/dist/chunks/hi-l6DA-aOw.mjs +2 -0
- package/dist/chunks/hi-l6DA-aOw.mjs.map +1 -0
- package/dist/chunks/hi-uACJUw53.mjs +2 -0
- package/dist/chunks/hi-uACJUw53.mjs.map +1 -0
- package/dist/chunks/minimal-D5v-raei.mjs +2 -0
- package/dist/chunks/minimal-D5v-raei.mjs.map +1 -0
- package/dist/chunks/pt-5VeuNDd2.mjs +2 -0
- package/dist/chunks/pt-5VeuNDd2.mjs.map +1 -0
- package/dist/chunks/pt-BCXgUDiU.mjs +2 -0
- package/dist/chunks/pt-BCXgUDiU.mjs.map +1 -0
- package/dist/chunks/pt-BDam9cDu.mjs +2 -0
- package/dist/chunks/pt-BDam9cDu.mjs.map +1 -0
- package/dist/chunks/pt-Bb908r0n.mjs +2 -0
- package/dist/chunks/pt-Bb908r0n.mjs.map +1 -0
- package/dist/chunks/pt-BkpVtod-.mjs +2 -0
- package/dist/chunks/pt-BkpVtod-.mjs.map +1 -0
- package/dist/chunks/pt-BlFAJZo7.mjs +2 -0
- package/dist/chunks/pt-BlFAJZo7.mjs.map +1 -0
- package/dist/chunks/pt-Bu7Mbz67.mjs +2 -0
- package/dist/chunks/pt-Bu7Mbz67.mjs.map +1 -0
- package/dist/chunks/pt-C8sOyw0V.mjs +2 -0
- package/dist/chunks/pt-C8sOyw0V.mjs.map +1 -0
- package/dist/chunks/pt-CEUgbrii.mjs +2 -0
- package/dist/chunks/pt-CEUgbrii.mjs.map +1 -0
- package/dist/chunks/pt-CMrFpUWS.mjs +2 -0
- package/dist/chunks/pt-CMrFpUWS.mjs.map +1 -0
- package/dist/chunks/pt-CMx2wPPY.mjs +2 -0
- package/dist/chunks/pt-CMx2wPPY.mjs.map +1 -0
- package/dist/chunks/pt-CR4j8gtE.mjs +2 -0
- package/dist/chunks/pt-CR4j8gtE.mjs.map +1 -0
- package/dist/chunks/pt-Cc4zysaT.mjs +2 -0
- package/dist/chunks/pt-Cc4zysaT.mjs.map +1 -0
- package/dist/chunks/pt-Cv6q7x5x.mjs +2 -0
- package/dist/chunks/pt-Cv6q7x5x.mjs.map +1 -0
- package/dist/chunks/pt-DFKJVh7k.mjs +2 -0
- package/dist/chunks/pt-DFKJVh7k.mjs.map +1 -0
- package/dist/chunks/pt-DYMyMgKQ.mjs +2 -0
- package/dist/chunks/pt-DYMyMgKQ.mjs.map +1 -0
- package/dist/chunks/pt-D__tcM2T.mjs +2 -0
- package/dist/chunks/pt-D__tcM2T.mjs.map +1 -0
- package/dist/chunks/pt-Dg2ctkug.mjs +2 -0
- package/dist/chunks/pt-Dg2ctkug.mjs.map +1 -0
- package/dist/chunks/pt-DgfMoLWR.mjs +2 -0
- package/dist/chunks/pt-DgfMoLWR.mjs.map +1 -0
- package/dist/chunks/pt-DmN9u3NX.mjs +2 -0
- package/dist/chunks/pt-DmN9u3NX.mjs.map +1 -0
- package/dist/chunks/pt-GqLw5tN0.mjs +2 -0
- package/dist/chunks/pt-GqLw5tN0.mjs.map +1 -0
- package/dist/chunks/pt-Hy-0Xnnc.mjs +2 -0
- package/dist/chunks/pt-Hy-0Xnnc.mjs.map +1 -0
- package/dist/chunks/pt-OXa_IR4Q.mjs +2 -0
- package/dist/chunks/pt-OXa_IR4Q.mjs.map +1 -0
- package/dist/chunks/pt-UPF7DBlz.mjs +2 -0
- package/dist/chunks/pt-UPF7DBlz.mjs.map +1 -0
- package/dist/chunks/pt-_qxIe7zX.mjs +2 -0
- package/dist/chunks/pt-_qxIe7zX.mjs.map +1 -0
- package/dist/chunks/pt-paXY7HFt.mjs +2 -0
- package/dist/chunks/pt-paXY7HFt.mjs.map +1 -0
- package/dist/chunks/pt-zMHcNGPk.mjs +2 -0
- package/dist/chunks/pt-zMHcNGPk.mjs.map +1 -0
- package/dist/chunks/ru-4g_qsaLr.mjs +2 -0
- package/dist/chunks/ru-4g_qsaLr.mjs.map +1 -0
- package/dist/chunks/ru-B1m8J9dl.mjs +2 -0
- package/dist/chunks/ru-B1m8J9dl.mjs.map +1 -0
- package/dist/chunks/ru-BFpEOrVp.mjs +2 -0
- package/dist/chunks/ru-BFpEOrVp.mjs.map +1 -0
- package/dist/chunks/ru-BNPUT-3S.mjs +2 -0
- package/dist/chunks/ru-BNPUT-3S.mjs.map +1 -0
- package/dist/chunks/ru-BotG0MFT.mjs +2 -0
- package/dist/chunks/ru-BotG0MFT.mjs.map +1 -0
- package/dist/chunks/ru-BxySx7an.mjs +2 -0
- package/dist/chunks/ru-BxySx7an.mjs.map +1 -0
- package/dist/chunks/ru-C-APN_dm.mjs +2 -0
- package/dist/chunks/ru-C-APN_dm.mjs.map +1 -0
- package/dist/chunks/ru-C9yFslEG.mjs +2 -0
- package/dist/chunks/ru-C9yFslEG.mjs.map +1 -0
- package/dist/chunks/ru-CkG_bpfo.mjs +2 -0
- package/dist/chunks/ru-CkG_bpfo.mjs.map +1 -0
- package/dist/chunks/ru-Cs8KCNyq.mjs +2 -0
- package/dist/chunks/ru-Cs8KCNyq.mjs.map +1 -0
- package/dist/chunks/ru-CvDl-yEd.mjs +2 -0
- package/dist/chunks/ru-CvDl-yEd.mjs.map +1 -0
- package/dist/chunks/ru-CwyPz2Va.mjs +2 -0
- package/dist/chunks/ru-CwyPz2Va.mjs.map +1 -0
- package/dist/chunks/ru-D53d-_UB.mjs +2 -0
- package/dist/chunks/ru-D53d-_UB.mjs.map +1 -0
- package/dist/chunks/ru-DJMpeuey.mjs +2 -0
- package/dist/chunks/ru-DJMpeuey.mjs.map +1 -0
- package/dist/chunks/ru-DSRv3_Rg.mjs +2 -0
- package/dist/chunks/ru-DSRv3_Rg.mjs.map +1 -0
- package/dist/chunks/ru-DV-lgEtM.mjs +2 -0
- package/dist/chunks/ru-DV-lgEtM.mjs.map +1 -0
- package/dist/chunks/ru-DiwQV30V.mjs +2 -0
- package/dist/chunks/ru-DiwQV30V.mjs.map +1 -0
- package/dist/chunks/ru-DkW9XZFy.mjs +2 -0
- package/dist/chunks/ru-DkW9XZFy.mjs.map +1 -0
- package/dist/chunks/ru-DyCTlhjg.mjs +2 -0
- package/dist/chunks/ru-DyCTlhjg.mjs.map +1 -0
- package/dist/chunks/ru-QGX8lOTs.mjs +2 -0
- package/dist/chunks/ru-QGX8lOTs.mjs.map +1 -0
- package/dist/chunks/ru-QcTo2yoL.mjs +2 -0
- package/dist/chunks/ru-QcTo2yoL.mjs.map +1 -0
- package/dist/chunks/ru-Y11wuxOB.mjs +2 -0
- package/dist/chunks/ru-Y11wuxOB.mjs.map +1 -0
- package/dist/chunks/ru-Yngw7nFP.mjs +2 -0
- package/dist/chunks/ru-Yngw7nFP.mjs.map +1 -0
- package/dist/chunks/ru-d68SZpEe.mjs +2 -0
- package/dist/chunks/ru-d68SZpEe.mjs.map +1 -0
- package/dist/chunks/ru-k7o3Qks3.mjs +2 -0
- package/dist/chunks/ru-k7o3Qks3.mjs.map +1 -0
- package/dist/chunks/ru-l73diFXn.mjs +2 -0
- package/dist/chunks/ru-l73diFXn.mjs.map +1 -0
- package/dist/chunks/ru-q8kz-237.mjs +2 -0
- package/dist/chunks/ru-q8kz-237.mjs.map +1 -0
- package/dist/chunks/src-C5Lblp2i.mjs +2 -0
- package/dist/chunks/src-C5Lblp2i.mjs.map +1 -0
- package/dist/chunks/zh-BGYJXxVl.mjs +2 -0
- package/dist/chunks/zh-BGYJXxVl.mjs.map +1 -0
- package/dist/chunks/zh-BP97XjlS.mjs +2 -0
- package/dist/chunks/zh-BP97XjlS.mjs.map +1 -0
- package/dist/chunks/zh-BQ73oqxc.mjs +2 -0
- package/dist/chunks/zh-BQ73oqxc.mjs.map +1 -0
- package/dist/chunks/zh-BQqf3wJZ.mjs +2 -0
- package/dist/chunks/zh-BQqf3wJZ.mjs.map +1 -0
- package/dist/chunks/zh-Baxh6v0j.mjs +2 -0
- package/dist/chunks/zh-Baxh6v0j.mjs.map +1 -0
- package/dist/chunks/zh-BjoyjClN.mjs +2 -0
- package/dist/chunks/zh-BjoyjClN.mjs.map +1 -0
- package/dist/chunks/zh-BvuAbM2S.mjs +2 -0
- package/dist/chunks/zh-BvuAbM2S.mjs.map +1 -0
- package/dist/chunks/zh-C-wHnDo5.mjs +2 -0
- package/dist/chunks/zh-C-wHnDo5.mjs.map +1 -0
- package/dist/chunks/zh-C7iCgCRP.mjs +2 -0
- package/dist/chunks/zh-C7iCgCRP.mjs.map +1 -0
- package/dist/chunks/zh-CRsDvfPR.mjs +2 -0
- package/dist/chunks/zh-CRsDvfPR.mjs.map +1 -0
- package/dist/chunks/zh-CWGAPVei.mjs +2 -0
- package/dist/chunks/zh-CWGAPVei.mjs.map +1 -0
- package/dist/chunks/zh-CWIzJcXi.mjs +2 -0
- package/dist/chunks/zh-CWIzJcXi.mjs.map +1 -0
- package/dist/chunks/zh-CYV-db-K.mjs +2 -0
- package/dist/chunks/zh-CYV-db-K.mjs.map +1 -0
- package/dist/chunks/zh-CnW44JEw.mjs +2 -0
- package/dist/chunks/zh-CnW44JEw.mjs.map +1 -0
- package/dist/chunks/zh-D1HSmSOf.mjs +2 -0
- package/dist/chunks/zh-D1HSmSOf.mjs.map +1 -0
- package/dist/chunks/zh-DWN1Jqn3.mjs +2 -0
- package/dist/chunks/zh-DWN1Jqn3.mjs.map +1 -0
- package/dist/chunks/zh-DYD476c5.mjs +2 -0
- package/dist/chunks/zh-DYD476c5.mjs.map +1 -0
- package/dist/chunks/zh-DdzgYD7k.mjs +2 -0
- package/dist/chunks/zh-DdzgYD7k.mjs.map +1 -0
- package/dist/chunks/zh-DeZP08HI.mjs +2 -0
- package/dist/chunks/zh-DeZP08HI.mjs.map +1 -0
- package/dist/chunks/zh-DgSmvLyw.mjs +2 -0
- package/dist/chunks/zh-DgSmvLyw.mjs.map +1 -0
- package/dist/chunks/zh-DlVfQn4z.mjs +2 -0
- package/dist/chunks/zh-DlVfQn4z.mjs.map +1 -0
- package/dist/chunks/zh-DuucmOns.mjs +2 -0
- package/dist/chunks/zh-DuucmOns.mjs.map +1 -0
- package/dist/chunks/zh-Oj-qSUEp.mjs +2 -0
- package/dist/chunks/zh-Oj-qSUEp.mjs.map +1 -0
- package/dist/chunks/zh-YfuE_m2y.mjs +2 -0
- package/dist/chunks/zh-YfuE_m2y.mjs.map +1 -0
- package/dist/chunks/zh-dGSDBBzb.mjs +2 -0
- package/dist/chunks/zh-dGSDBBzb.mjs.map +1 -0
- package/dist/chunks/zh-ikm3rSTR.mjs +2 -0
- package/dist/chunks/zh-ikm3rSTR.mjs.map +1 -0
- package/dist/chunks/zh-oZl1P_p0.mjs +2 -0
- package/dist/chunks/zh-oZl1P_p0.mjs.map +1 -0
- package/dist/commands/BlockInsertion.d.ts +49 -2
- package/dist/commands/BlockInsertion.d.ts.map +1 -1
- package/dist/commands/NodeSelectionCommands.d.ts +10 -2
- package/dist/commands/NodeSelectionCommands.d.ts.map +1 -1
- package/dist/editor/styles/list.d.ts +1 -1
- package/dist/editor/styles/list.d.ts.map +1 -1
- package/dist/fonts.mjs +1 -1
- package/dist/full.mjs +1 -1
- package/dist/html.mjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/input/KeyDescriptor.d.ts +40 -0
- package/dist/input/KeyDescriptor.d.ts.map +1 -0
- package/dist/input/KeyboardHandler.d.ts +17 -5
- package/dist/input/KeyboardHandler.d.ts.map +1 -1
- package/dist/input/PasteHTMLHandler.d.ts.map +1 -1
- package/dist/input/PasteRichBlockHandler.d.ts +22 -3
- package/dist/input/PasteRichBlockHandler.d.ts.map +1 -1
- package/dist/model/Document.d.ts +2 -2
- package/dist/model/Document.d.ts.map +1 -1
- package/dist/notectl-core.mjs +1 -1
- package/dist/notectl-core.umd.js +1 -1
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/alignment.mjs +1 -1
- package/dist/plugins/bidi-isolation.mjs +1 -1
- package/dist/plugins/blockquote.mjs +1 -1
- package/dist/plugins/caret-navigation.mjs +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/formula/DisplayMathNodeSpec.d.ts.map +1 -1
- package/dist/plugins/formula/FormulaCommands.d.ts +14 -0
- package/dist/plugins/formula/FormulaCommands.d.ts.map +1 -1
- package/dist/plugins/formula/FormulaEditorMount.d.ts.map +1 -1
- package/dist/plugins/formula/FormulaLocale.d.ts +7 -1
- package/dist/plugins/formula/FormulaLocale.d.ts.map +1 -1
- package/dist/plugins/formula/FormulaPasteInterceptor.d.ts +12 -3
- package/dist/plugins/formula/FormulaPasteInterceptor.d.ts.map +1 -1
- package/dist/plugins/formula/FormulaSerialization.d.ts +17 -0
- package/dist/plugins/formula/FormulaSerialization.d.ts.map +1 -0
- package/dist/plugins/formula/FormulaStyles.d.ts +1 -1
- package/dist/plugins/formula/FormulaStyles.d.ts.map +1 -1
- package/dist/plugins/formula/InlineMathNodeSpec.d.ts.map +1 -1
- package/dist/plugins/formula/locales/ar.d.ts.map +1 -1
- package/dist/plugins/formula/locales/de.d.ts.map +1 -1
- package/dist/plugins/formula/locales/es.d.ts.map +1 -1
- package/dist/plugins/formula/locales/fr.d.ts.map +1 -1
- package/dist/plugins/formula/locales/hi.d.ts.map +1 -1
- package/dist/plugins/formula/locales/pt.d.ts.map +1 -1
- package/dist/plugins/formula/locales/ru.d.ts.map +1 -1
- package/dist/plugins/formula/locales/zh.d.ts.map +1 -1
- package/dist/plugins/formula/math-field/MathPalette.d.ts.map +1 -1
- package/dist/plugins/formula/math-field/MathPaletteData.d.ts +7 -1
- package/dist/plugins/formula/math-field/MathPaletteData.d.ts.map +1 -1
- package/dist/plugins/formula/mathml/MathMLDocument.d.ts +13 -0
- package/dist/plugins/formula/mathml/MathMLDocument.d.ts.map +1 -1
- package/dist/plugins/formula.mjs +1 -1
- package/dist/plugins/gap-cursor.mjs +1 -1
- package/dist/plugins/hard-break.mjs +1 -1
- package/dist/plugins/heading.mjs +1 -1
- package/dist/plugins/highlight.mjs +1 -1
- package/dist/plugins/horizontal-rule.mjs +1 -1
- package/dist/plugins/image.mjs +1 -1
- package/dist/plugins/inline-code.mjs +1 -1
- package/dist/plugins/language.mjs +1 -1
- package/dist/plugins/link.mjs +1 -1
- package/dist/plugins/list/ListCommands.d.ts +16 -3
- package/dist/plugins/list/ListCommands.d.ts.map +1 -1
- package/dist/plugins/list/ListLocale.d.ts +6 -0
- package/dist/plugins/list/ListLocale.d.ts.map +1 -1
- package/dist/plugins/list/ListMarker.d.ts +14 -0
- package/dist/plugins/list/ListMarker.d.ts.map +1 -0
- package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
- package/dist/plugins/list/locales/ar.d.ts.map +1 -1
- package/dist/plugins/list/locales/de.d.ts.map +1 -1
- package/dist/plugins/list/locales/es.d.ts.map +1 -1
- package/dist/plugins/list/locales/fr.d.ts.map +1 -1
- package/dist/plugins/list/locales/hi.d.ts.map +1 -1
- package/dist/plugins/list/locales/pt.d.ts.map +1 -1
- package/dist/plugins/list/locales/ru.d.ts.map +1 -1
- package/dist/plugins/list/locales/zh.d.ts.map +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.mjs +1 -1
- package/dist/plugins/strikethrough.mjs +1 -1
- package/dist/plugins/super-sub.mjs +1 -1
- package/dist/plugins/table/TableCommands.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/ToolbarPopupController.d.ts.map +1 -1
- package/dist/plugins/toolbar.mjs +1 -1
- package/dist/plugins/video/VideoCommands.d.ts.map +1 -1
- package/dist/plugins/video.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/InlineContentOps.d.ts +5 -3
- package/dist/state/InlineContentOps.d.ts.map +1 -1
- package/dist/state/StepInversion.d.ts.map +1 -1
- package/dist/state/StepMaps.d.ts.map +1 -1
- package/dist/state/Steps.d.ts +20 -3
- package/dist/state/Steps.d.ts.map +1 -1
- package/dist/state/TransactionBuilder.d.ts +3 -3
- 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/SelectionSync.d.ts.map +1 -1
- package/package.json +423 -415
- package/dist/chunks/AlignmentPlugin-BLzRjrUl.mjs +0 -2
- package/dist/chunks/AlignmentPlugin-BLzRjrUl.mjs.map +0 -1
- package/dist/chunks/AttrRegistry-CRnXTPha.mjs +0 -2
- package/dist/chunks/AttrRegistry-CRnXTPha.mjs.map +0 -1
- package/dist/chunks/AttributedMarkCommands-CxhdUsuE.mjs +0 -2
- package/dist/chunks/AttributedMarkCommands-CxhdUsuE.mjs.map +0 -1
- package/dist/chunks/BidiIsolationPlugin-DNPXe5ga.mjs +0 -2
- package/dist/chunks/BidiIsolationPlugin-DNPXe5ga.mjs.map +0 -1
- package/dist/chunks/BlockInsertion-C7jFEeYB.mjs +0 -2
- package/dist/chunks/BlockInsertion-C7jFEeYB.mjs.map +0 -1
- package/dist/chunks/BlockTypePickerRegistry-U4uY7-lN.mjs +0 -2
- package/dist/chunks/BlockTypePickerRegistry-U4uY7-lN.mjs.map +0 -1
- package/dist/chunks/BlockquotePlugin-YgXcV4mT.mjs +0 -2
- package/dist/chunks/BlockquotePlugin-YgXcV4mT.mjs.map +0 -1
- package/dist/chunks/CaretNavigationPlugin-P6OYaTSq.mjs +0 -2
- package/dist/chunks/CaretNavigationPlugin-P6OYaTSq.mjs.map +0 -1
- package/dist/chunks/CodeBlockPlugin-ChPv3Edf.mjs +0 -2
- package/dist/chunks/CodeBlockPlugin-ChPv3Edf.mjs.map +0 -1
- package/dist/chunks/ColorGrid-D5-teEjD.mjs +0 -2
- package/dist/chunks/ColorGrid-D5-teEjD.mjs.map +0 -1
- package/dist/chunks/ColorPickerPopup-_Gp09pdx.mjs +0 -2
- package/dist/chunks/ColorPickerPopup-_Gp09pdx.mjs.map +0 -1
- package/dist/chunks/ColorValidation-okAvytHQ.mjs +0 -2
- package/dist/chunks/ColorValidation-okAvytHQ.mjs.map +0 -1
- package/dist/chunks/CommandHelpers-NV80Ff1G.mjs +0 -2
- package/dist/chunks/CommandHelpers-NV80Ff1G.mjs.map +0 -1
- package/dist/chunks/Commands-ixGhPiRG.mjs +0 -2
- package/dist/chunks/Commands-ixGhPiRG.mjs.map +0 -1
- package/dist/chunks/Decoration-DZK7hrL1.mjs +0 -2
- package/dist/chunks/Decoration-DZK7hrL1.mjs.map +0 -1
- package/dist/chunks/DirectionDetection-7HmMUZrx.mjs +0 -2
- package/dist/chunks/DirectionDetection-7HmMUZrx.mjs.map +0 -1
- package/dist/chunks/DirectionIcons-DhRvPVoz.mjs +0 -2
- package/dist/chunks/DirectionIcons-DhRvPVoz.mjs.map +0 -1
- package/dist/chunks/Document-znhIcvM9.mjs +0 -2
- package/dist/chunks/Document-znhIcvM9.mjs.map +0 -1
- package/dist/chunks/DocumentParser-DCjOW3us.mjs +0 -2
- package/dist/chunks/DocumentParser-DCjOW3us.mjs.map +0 -1
- package/dist/chunks/DomUtils-RKbAVBQz.mjs +0 -2
- package/dist/chunks/DomUtils-RKbAVBQz.mjs.map +0 -1
- package/dist/chunks/FontPlugin-COYtG1Uo.mjs +0 -2
- package/dist/chunks/FontPlugin-COYtG1Uo.mjs.map +0 -1
- package/dist/chunks/FontSizePlugin-CLcfdTm3.mjs +0 -2
- package/dist/chunks/FontSizePlugin-CLcfdTm3.mjs.map +0 -1
- package/dist/chunks/FormulaPlugin-DphHU4Rn.mjs +0 -2
- package/dist/chunks/FormulaPlugin-DphHU4Rn.mjs.map +0 -1
- package/dist/chunks/GapCursorNavigation-Bkuu_Ek8.mjs +0 -2
- package/dist/chunks/GapCursorNavigation-Bkuu_Ek8.mjs.map +0 -1
- package/dist/chunks/GapCursorPlugin-CRDmQEi1.mjs +0 -2
- package/dist/chunks/GapCursorPlugin-CRDmQEi1.mjs.map +0 -1
- package/dist/chunks/HTMLUtils-brwcaufP.mjs +0 -2
- package/dist/chunks/HTMLUtils-brwcaufP.mjs.map +0 -1
- package/dist/chunks/HardBreakPlugin-Cr6dMQ-H.mjs +0 -2
- package/dist/chunks/HardBreakPlugin-Cr6dMQ-H.mjs.map +0 -1
- package/dist/chunks/HeadingPlugin-3NL4ARPp.mjs +0 -2
- package/dist/chunks/HeadingPlugin-3NL4ARPp.mjs.map +0 -1
- package/dist/chunks/HighlightPlugin-dHxnAuoW.mjs +0 -2
- package/dist/chunks/HighlightPlugin-dHxnAuoW.mjs.map +0 -1
- package/dist/chunks/HorizontalRulePlugin-BYPaI4TR.mjs +0 -2
- package/dist/chunks/HorizontalRulePlugin-BYPaI4TR.mjs.map +0 -1
- package/dist/chunks/ImagePlugin-kgokm-a1.mjs +0 -2
- package/dist/chunks/ImagePlugin-kgokm-a1.mjs.map +0 -1
- package/dist/chunks/InlineCodePlugin-Bl1jyDwk.mjs +0 -2
- package/dist/chunks/InlineCodePlugin-Bl1jyDwk.mjs.map +0 -1
- package/dist/chunks/InlineStyleMarkSpec-Cc-b1tlm.mjs +0 -2
- package/dist/chunks/InlineStyleMarkSpec-Cc-b1tlm.mjs.map +0 -1
- package/dist/chunks/KeyboardNav-DZXdTg-_.mjs +0 -2
- package/dist/chunks/KeyboardNav-DZXdTg-_.mjs.map +0 -1
- package/dist/chunks/LinkPlugin-Dmcfo3On.mjs +0 -2
- package/dist/chunks/LinkPlugin-Dmcfo3On.mjs.map +0 -1
- package/dist/chunks/ListPlugin-Ch-5CsFc.mjs +0 -2
- package/dist/chunks/ListPlugin-Ch-5CsFc.mjs.map +0 -1
- package/dist/chunks/NavigationQueries-3zTaNBlp.mjs +0 -2
- package/dist/chunks/NavigationQueries-3zTaNBlp.mjs.map +0 -1
- package/dist/chunks/NodeResolver-BplmzA7c.mjs +0 -2
- package/dist/chunks/NodeResolver-BplmzA7c.mjs.map +0 -1
- package/dist/chunks/NodeSelectionCommands-dUmbRoZ2.mjs +0 -2
- package/dist/chunks/NodeSelectionCommands-dUmbRoZ2.mjs.map +0 -1
- package/dist/chunks/NodeSpecPatching-DToX09gc.mjs +0 -2
- package/dist/chunks/NodeSpecPatching-DToX09gc.mjs.map +0 -1
- package/dist/chunks/Platform-wPvKFB9m.mjs +0 -2
- package/dist/chunks/Platform-wPvKFB9m.mjs.map +0 -1
- package/dist/chunks/PluginHelpers-C3aCCGfX.mjs +0 -2
- package/dist/chunks/PluginHelpers-C3aCCGfX.mjs.map +0 -1
- package/dist/chunks/PopupKeyboardPatterns-ZdAQB78m.mjs +0 -2
- package/dist/chunks/PopupKeyboardPatterns-ZdAQB78m.mjs.map +0 -1
- package/dist/chunks/PopupManager-DsT1uRWi.mjs +0 -2
- package/dist/chunks/PopupManager-DsT1uRWi.mjs.map +0 -1
- package/dist/chunks/PopupPositioning-BEnz90Oh.mjs +0 -2
- package/dist/chunks/PopupPositioning-BEnz90Oh.mjs.map +0 -1
- package/dist/chunks/PrintPlugin-Bq-Z14K1.mjs +0 -2
- package/dist/chunks/PrintPlugin-Bq-Z14K1.mjs.map +0 -1
- package/dist/chunks/PrintTypes-DA0Cc--M.mjs +0 -2
- package/dist/chunks/PrintTypes-DA0Cc--M.mjs.map +0 -1
- package/dist/chunks/RangeIterator-Cl4_k8cx.mjs +0 -2
- package/dist/chunks/RangeIterator-Cl4_k8cx.mjs.map +0 -1
- package/dist/chunks/Selection-aeiSsvhe.mjs +0 -2
- package/dist/chunks/Selection-aeiSsvhe.mjs.map +0 -1
- package/dist/chunks/SelectionSync-DCJpNFat.mjs +0 -2
- package/dist/chunks/SelectionSync-DCJpNFat.mjs.map +0 -1
- package/dist/chunks/ShortcutFormatting-DZK70CN9.mjs +0 -2
- package/dist/chunks/ShortcutFormatting-DZK70CN9.mjs.map +0 -1
- package/dist/chunks/SimpleMark-CezTJnXh.mjs +0 -2
- package/dist/chunks/SimpleMark-CezTJnXh.mjs.map +0 -1
- package/dist/chunks/SmartPastePlugin-DlApY6Vw.mjs +0 -2
- package/dist/chunks/SmartPastePlugin-DlApY6Vw.mjs.map +0 -1
- package/dist/chunks/StrikethroughPlugin-BuFDABvz.mjs +0 -2
- package/dist/chunks/StrikethroughPlugin-BuFDABvz.mjs.map +0 -1
- package/dist/chunks/StyleRuntime-Bwde5icB.mjs +0 -2
- package/dist/chunks/StyleRuntime-Bwde5icB.mjs.map +0 -1
- package/dist/chunks/SuperSubPlugin-CiLJ7i4s.mjs +0 -2
- package/dist/chunks/SuperSubPlugin-CiLJ7i4s.mjs.map +0 -1
- package/dist/chunks/SyntaxTokenTypes-C9dGwufi.mjs +0 -2
- package/dist/chunks/SyntaxTokenTypes-C9dGwufi.mjs.map +0 -1
- package/dist/chunks/TablePlugin-5ru-y-YX.mjs +0 -2
- package/dist/chunks/TablePlugin-5ru-y-YX.mjs.map +0 -1
- package/dist/chunks/TextColorPlugin-Vz-Nz8aH.mjs +0 -2
- package/dist/chunks/TextColorPlugin-Vz-Nz8aH.mjs.map +0 -1
- package/dist/chunks/TextDirectionAutoPlugin-Behl6KMe.mjs +0 -2
- package/dist/chunks/TextDirectionAutoPlugin-Behl6KMe.mjs.map +0 -1
- package/dist/chunks/TextDirectionPlugin-C3h1n-aA.mjs +0 -2
- package/dist/chunks/TextDirectionPlugin-C3h1n-aA.mjs.map +0 -1
- package/dist/chunks/TextDirectionService-DRfeQnF6.mjs +0 -2
- package/dist/chunks/TextDirectionService-DRfeQnF6.mjs.map +0 -1
- package/dist/chunks/TextFormattingPlugin-D_nRMeBn.mjs +0 -2
- package/dist/chunks/TextFormattingPlugin-D_nRMeBn.mjs.map +0 -1
- package/dist/chunks/ToolbarPlugin-CSMSgjPM.mjs +0 -2
- package/dist/chunks/ToolbarPlugin-CSMSgjPM.mjs.map +0 -1
- package/dist/chunks/TypeBrands-BZDKMjR-.mjs +0 -2
- package/dist/chunks/TypeBrands-BZDKMjR-.mjs.map +0 -1
- package/dist/chunks/TypedKeys-E3jOGByL.mjs +0 -2
- package/dist/chunks/TypedKeys-E3jOGByL.mjs.map +0 -1
- package/dist/chunks/VideoPlugin-BUCGIYXr.mjs +0 -2
- package/dist/chunks/VideoPlugin-BUCGIYXr.mjs.map +0 -1
- package/dist/chunks/WordBoundary-CYDAtEks.mjs +0 -2
- package/dist/chunks/WordBoundary-CYDAtEks.mjs.map +0 -1
- package/dist/chunks/XmlDetector-DxBGXqua.mjs +0 -2
- package/dist/chunks/XmlDetector-DxBGXqua.mjs.map +0 -1
- package/dist/chunks/XmlPatterns-BiHS8w3k.mjs +0 -2
- package/dist/chunks/XmlPatterns-BiHS8w3k.mjs.map +0 -1
- package/dist/chunks/XmlSupport-B_F65M8G.mjs +0 -2
- package/dist/chunks/XmlSupport-B_F65M8G.mjs.map +0 -1
- package/dist/chunks/ar-B38MlRRN.mjs +0 -2
- package/dist/chunks/ar-B38MlRRN.mjs.map +0 -1
- package/dist/chunks/ar-BIeE0C5A.mjs +0 -2
- package/dist/chunks/ar-BIeE0C5A.mjs.map +0 -1
- package/dist/chunks/ar-BK0rFxF_.mjs +0 -2
- package/dist/chunks/ar-BK0rFxF_.mjs.map +0 -1
- package/dist/chunks/ar-BK4O36ep.mjs +0 -2
- package/dist/chunks/ar-BK4O36ep.mjs.map +0 -1
- package/dist/chunks/ar-BNUWuZe3.mjs +0 -2
- package/dist/chunks/ar-BNUWuZe3.mjs.map +0 -1
- package/dist/chunks/ar-BSXH8acw.mjs +0 -2
- package/dist/chunks/ar-BSXH8acw.mjs.map +0 -1
- package/dist/chunks/ar-BY8yNlGe.mjs +0 -2
- package/dist/chunks/ar-BY8yNlGe.mjs.map +0 -1
- package/dist/chunks/ar-BgHkduPE.mjs +0 -2
- package/dist/chunks/ar-BgHkduPE.mjs.map +0 -1
- package/dist/chunks/ar-BnfWtLhK.mjs +0 -2
- package/dist/chunks/ar-BnfWtLhK.mjs.map +0 -1
- package/dist/chunks/ar-BwCPhCf6.mjs +0 -2
- package/dist/chunks/ar-BwCPhCf6.mjs.map +0 -1
- package/dist/chunks/ar-Bymjd9Z_.mjs +0 -2
- package/dist/chunks/ar-Bymjd9Z_.mjs.map +0 -1
- package/dist/chunks/ar-CKPpdJ7F.mjs +0 -2
- package/dist/chunks/ar-CKPpdJ7F.mjs.map +0 -1
- package/dist/chunks/ar-C_ir5Uf4.mjs +0 -2
- package/dist/chunks/ar-C_ir5Uf4.mjs.map +0 -1
- package/dist/chunks/ar-CkE6GDVA.mjs +0 -2
- package/dist/chunks/ar-CkE6GDVA.mjs.map +0 -1
- package/dist/chunks/ar-ClgA1KQM.mjs +0 -2
- package/dist/chunks/ar-ClgA1KQM.mjs.map +0 -1
- package/dist/chunks/ar-Cm1DOK74.mjs +0 -2
- package/dist/chunks/ar-Cm1DOK74.mjs.map +0 -1
- package/dist/chunks/ar-CseGhQtS.mjs +0 -2
- package/dist/chunks/ar-CseGhQtS.mjs.map +0 -1
- package/dist/chunks/ar-D0bqkviV.mjs +0 -2
- package/dist/chunks/ar-D0bqkviV.mjs.map +0 -1
- package/dist/chunks/ar-D5d185g0.mjs +0 -2
- package/dist/chunks/ar-D5d185g0.mjs.map +0 -1
- package/dist/chunks/ar-DSwUyX47.mjs +0 -2
- package/dist/chunks/ar-DSwUyX47.mjs.map +0 -1
- package/dist/chunks/ar-DfSNWZX7.mjs +0 -2
- package/dist/chunks/ar-DfSNWZX7.mjs.map +0 -1
- package/dist/chunks/ar-Dghtfs46.mjs +0 -2
- package/dist/chunks/ar-Dghtfs46.mjs.map +0 -1
- package/dist/chunks/ar-DvNKBrJd.mjs +0 -2
- package/dist/chunks/ar-DvNKBrJd.mjs.map +0 -1
- package/dist/chunks/ar-KNULRI8r.mjs +0 -2
- package/dist/chunks/ar-KNULRI8r.mjs.map +0 -1
- package/dist/chunks/ar-NtGRavHz.mjs +0 -2
- package/dist/chunks/ar-NtGRavHz.mjs.map +0 -1
- package/dist/chunks/ar-Y9KjJLX8.mjs +0 -2
- package/dist/chunks/ar-Y9KjJLX8.mjs.map +0 -1
- package/dist/chunks/ar-odM5gkvw.mjs +0 -2
- package/dist/chunks/ar-odM5gkvw.mjs.map +0 -1
- package/dist/chunks/color-picker-C89H4SVX.mjs +0 -2
- package/dist/chunks/color-picker-C89H4SVX.mjs.map +0 -1
- package/dist/chunks/de-B1TXiyll.mjs +0 -2
- package/dist/chunks/de-B1TXiyll.mjs.map +0 -1
- package/dist/chunks/de-BDRaxLyi.mjs +0 -2
- package/dist/chunks/de-BDRaxLyi.mjs.map +0 -1
- package/dist/chunks/de-BGOpZ8Ls.mjs +0 -2
- package/dist/chunks/de-BGOpZ8Ls.mjs.map +0 -1
- package/dist/chunks/de-BfZ5qXWz.mjs +0 -2
- package/dist/chunks/de-BfZ5qXWz.mjs.map +0 -1
- package/dist/chunks/de-BibufNIa.mjs +0 -2
- package/dist/chunks/de-BibufNIa.mjs.map +0 -1
- package/dist/chunks/de-BkZqCmzL.mjs +0 -2
- package/dist/chunks/de-BkZqCmzL.mjs.map +0 -1
- package/dist/chunks/de-BzRd2oyR.mjs +0 -2
- package/dist/chunks/de-BzRd2oyR.mjs.map +0 -1
- package/dist/chunks/de-C4gnHDmk.mjs +0 -2
- package/dist/chunks/de-C4gnHDmk.mjs.map +0 -1
- package/dist/chunks/de-C4iw9SEp.mjs +0 -2
- package/dist/chunks/de-C4iw9SEp.mjs.map +0 -1
- package/dist/chunks/de-CLWzcDoW.mjs +0 -2
- package/dist/chunks/de-CLWzcDoW.mjs.map +0 -1
- package/dist/chunks/de-Cbv0otYM.mjs +0 -2
- package/dist/chunks/de-Cbv0otYM.mjs.map +0 -1
- package/dist/chunks/de-Cinp7zmo.mjs +0 -2
- package/dist/chunks/de-Cinp7zmo.mjs.map +0 -1
- package/dist/chunks/de-CvnyjI_X.mjs +0 -2
- package/dist/chunks/de-CvnyjI_X.mjs.map +0 -1
- package/dist/chunks/de-DCx3Shj3.mjs +0 -2
- package/dist/chunks/de-DCx3Shj3.mjs.map +0 -1
- package/dist/chunks/de-Dav2GzjV.mjs +0 -2
- package/dist/chunks/de-Dav2GzjV.mjs.map +0 -1
- package/dist/chunks/de-Dc7GRbWc.mjs +0 -2
- package/dist/chunks/de-Dc7GRbWc.mjs.map +0 -1
- package/dist/chunks/de-DdntlpT3.mjs +0 -2
- package/dist/chunks/de-DdntlpT3.mjs.map +0 -1
- package/dist/chunks/de-DefykdF-.mjs +0 -2
- package/dist/chunks/de-DefykdF-.mjs.map +0 -1
- package/dist/chunks/de-DfQQIP8Y.mjs +0 -2
- package/dist/chunks/de-DfQQIP8Y.mjs.map +0 -1
- package/dist/chunks/de-DkcKDkbA.mjs +0 -2
- package/dist/chunks/de-DkcKDkbA.mjs.map +0 -1
- package/dist/chunks/de-DqGfLfeV.mjs +0 -2
- package/dist/chunks/de-DqGfLfeV.mjs.map +0 -1
- package/dist/chunks/de-DudqIJho.mjs +0 -2
- package/dist/chunks/de-DudqIJho.mjs.map +0 -1
- package/dist/chunks/de-LCXA2xWj.mjs +0 -2
- package/dist/chunks/de-LCXA2xWj.mjs.map +0 -1
- package/dist/chunks/de-YygmrxGp.mjs +0 -2
- package/dist/chunks/de-YygmrxGp.mjs.map +0 -1
- package/dist/chunks/de-asI3UlFG.mjs +0 -2
- package/dist/chunks/de-asI3UlFG.mjs.map +0 -1
- package/dist/chunks/de-kvMvD3AJ.mjs +0 -2
- package/dist/chunks/de-kvMvD3AJ.mjs.map +0 -1
- package/dist/chunks/de-pnfTnS03.mjs +0 -2
- package/dist/chunks/de-pnfTnS03.mjs.map +0 -1
- package/dist/chunks/es-4tbAR0If.mjs +0 -2
- package/dist/chunks/es-4tbAR0If.mjs.map +0 -1
- package/dist/chunks/es-B9z2Xwj0.mjs +0 -2
- package/dist/chunks/es-B9z2Xwj0.mjs.map +0 -1
- package/dist/chunks/es-BJxjRQSg.mjs +0 -2
- package/dist/chunks/es-BJxjRQSg.mjs.map +0 -1
- package/dist/chunks/es-BSyxBRjn.mjs +0 -2
- package/dist/chunks/es-BSyxBRjn.mjs.map +0 -1
- package/dist/chunks/es-Bcpq2xfU.mjs +0 -2
- package/dist/chunks/es-Bcpq2xfU.mjs.map +0 -1
- package/dist/chunks/es-BhUjc8mO.mjs +0 -2
- package/dist/chunks/es-BhUjc8mO.mjs.map +0 -1
- package/dist/chunks/es-Bm7hoJSI.mjs +0 -2
- package/dist/chunks/es-Bm7hoJSI.mjs.map +0 -1
- package/dist/chunks/es-C0E-lFIC.mjs +0 -2
- package/dist/chunks/es-C0E-lFIC.mjs.map +0 -1
- package/dist/chunks/es-C2wBBQ7N.mjs +0 -2
- package/dist/chunks/es-C2wBBQ7N.mjs.map +0 -1
- package/dist/chunks/es-C9vhYpfP.mjs +0 -2
- package/dist/chunks/es-C9vhYpfP.mjs.map +0 -1
- package/dist/chunks/es-Cgslt0Hp.mjs +0 -2
- package/dist/chunks/es-Cgslt0Hp.mjs.map +0 -1
- package/dist/chunks/es-CksXDFxg.mjs +0 -2
- package/dist/chunks/es-CksXDFxg.mjs.map +0 -1
- package/dist/chunks/es-CnQUZlfY.mjs +0 -2
- package/dist/chunks/es-CnQUZlfY.mjs.map +0 -1
- package/dist/chunks/es-CrRNOn2Q.mjs +0 -2
- package/dist/chunks/es-CrRNOn2Q.mjs.map +0 -1
- package/dist/chunks/es-D0427MIH.mjs +0 -2
- package/dist/chunks/es-D0427MIH.mjs.map +0 -1
- package/dist/chunks/es-D19xfXus.mjs +0 -2
- package/dist/chunks/es-D19xfXus.mjs.map +0 -1
- package/dist/chunks/es-Dk6lCcOt.mjs +0 -2
- package/dist/chunks/es-Dk6lCcOt.mjs.map +0 -1
- package/dist/chunks/es-Dls_xPCW.mjs +0 -2
- package/dist/chunks/es-Dls_xPCW.mjs.map +0 -1
- package/dist/chunks/es-DrcsyDvI.mjs +0 -2
- package/dist/chunks/es-DrcsyDvI.mjs.map +0 -1
- package/dist/chunks/es-DwKejbO9.mjs +0 -2
- package/dist/chunks/es-DwKejbO9.mjs.map +0 -1
- package/dist/chunks/es-NcrWuNe1.mjs +0 -2
- package/dist/chunks/es-NcrWuNe1.mjs.map +0 -1
- package/dist/chunks/es-RaZerssd.mjs +0 -2
- package/dist/chunks/es-RaZerssd.mjs.map +0 -1
- package/dist/chunks/es-TIjHCFNF.mjs +0 -2
- package/dist/chunks/es-TIjHCFNF.mjs.map +0 -1
- package/dist/chunks/es-eZcDkBb-.mjs +0 -2
- package/dist/chunks/es-eZcDkBb-.mjs.map +0 -1
- package/dist/chunks/es-j_-KW9-4.mjs +0 -2
- package/dist/chunks/es-j_-KW9-4.mjs.map +0 -1
- package/dist/chunks/es-kGLwn8EB.mjs +0 -2
- package/dist/chunks/es-kGLwn8EB.mjs.map +0 -1
- package/dist/chunks/es-qQRDC0Ge.mjs +0 -2
- package/dist/chunks/es-qQRDC0Ge.mjs.map +0 -1
- package/dist/chunks/fonts-ZXAIMT3b.mjs +0 -2
- package/dist/chunks/fonts-ZXAIMT3b.mjs.map +0 -1
- package/dist/chunks/fr-B27zAq0X.mjs +0 -2
- package/dist/chunks/fr-B27zAq0X.mjs.map +0 -1
- package/dist/chunks/fr-BEd3ZHO4.mjs +0 -2
- package/dist/chunks/fr-BEd3ZHO4.mjs.map +0 -1
- package/dist/chunks/fr-BHXLpdaH.mjs +0 -2
- package/dist/chunks/fr-BHXLpdaH.mjs.map +0 -1
- package/dist/chunks/fr-BKu4eU3V.mjs +0 -2
- package/dist/chunks/fr-BKu4eU3V.mjs.map +0 -1
- package/dist/chunks/fr-BUrUZ5UQ.mjs +0 -2
- package/dist/chunks/fr-BUrUZ5UQ.mjs.map +0 -1
- package/dist/chunks/fr-BlqlUQ3b.mjs +0 -2
- package/dist/chunks/fr-BlqlUQ3b.mjs.map +0 -1
- package/dist/chunks/fr-BruEqDw1.mjs +0 -2
- package/dist/chunks/fr-BruEqDw1.mjs.map +0 -1
- package/dist/chunks/fr-BwuuFBkA.mjs +0 -2
- package/dist/chunks/fr-BwuuFBkA.mjs.map +0 -1
- package/dist/chunks/fr-C2lLh5Ti.mjs +0 -2
- package/dist/chunks/fr-C2lLh5Ti.mjs.map +0 -1
- package/dist/chunks/fr-C7N2_AlK.mjs +0 -2
- package/dist/chunks/fr-C7N2_AlK.mjs.map +0 -1
- package/dist/chunks/fr-COfd6sLW.mjs +0 -2
- package/dist/chunks/fr-COfd6sLW.mjs.map +0 -1
- package/dist/chunks/fr-COx4cSxc.mjs +0 -2
- package/dist/chunks/fr-COx4cSxc.mjs.map +0 -1
- package/dist/chunks/fr-CX37XjPO.mjs +0 -2
- package/dist/chunks/fr-CX37XjPO.mjs.map +0 -1
- package/dist/chunks/fr-CYn6fMiH.mjs +0 -2
- package/dist/chunks/fr-CYn6fMiH.mjs.map +0 -1
- package/dist/chunks/fr-CbsiyDEa.mjs +0 -2
- package/dist/chunks/fr-CbsiyDEa.mjs.map +0 -1
- package/dist/chunks/fr-CcZiELJY.mjs +0 -2
- package/dist/chunks/fr-CcZiELJY.mjs.map +0 -1
- package/dist/chunks/fr-CeHzUPVT.mjs +0 -2
- package/dist/chunks/fr-CeHzUPVT.mjs.map +0 -1
- package/dist/chunks/fr-Cv73J4QZ.mjs +0 -2
- package/dist/chunks/fr-Cv73J4QZ.mjs.map +0 -1
- package/dist/chunks/fr-DDLuorz7.mjs +0 -2
- package/dist/chunks/fr-DDLuorz7.mjs.map +0 -1
- package/dist/chunks/fr-DMA4CAyo.mjs +0 -2
- package/dist/chunks/fr-DMA4CAyo.mjs.map +0 -1
- package/dist/chunks/fr-DNJuGtO1.mjs +0 -2
- package/dist/chunks/fr-DNJuGtO1.mjs.map +0 -1
- package/dist/chunks/fr-DQOE8O6_.mjs +0 -2
- package/dist/chunks/fr-DQOE8O6_.mjs.map +0 -1
- package/dist/chunks/fr-DXjOwGew.mjs +0 -2
- package/dist/chunks/fr-DXjOwGew.mjs.map +0 -1
- package/dist/chunks/fr-DilrEvE_.mjs +0 -2
- package/dist/chunks/fr-DilrEvE_.mjs.map +0 -1
- package/dist/chunks/fr-P7iY3ntE.mjs +0 -2
- package/dist/chunks/fr-P7iY3ntE.mjs.map +0 -1
- package/dist/chunks/fr-ViUNGo_J.mjs +0 -2
- package/dist/chunks/fr-ViUNGo_J.mjs.map +0 -1
- package/dist/chunks/fr-gdIyLcGC.mjs +0 -2
- package/dist/chunks/fr-gdIyLcGC.mjs.map +0 -1
- package/dist/chunks/full-h88Sb2MR.mjs +0 -2
- package/dist/chunks/full-h88Sb2MR.mjs.map +0 -1
- package/dist/chunks/hi-BC82Jxjl.mjs +0 -2
- package/dist/chunks/hi-BC82Jxjl.mjs.map +0 -1
- package/dist/chunks/hi-BCTarnem.mjs +0 -2
- package/dist/chunks/hi-BCTarnem.mjs.map +0 -1
- package/dist/chunks/hi-BMStjhJF.mjs +0 -2
- package/dist/chunks/hi-BMStjhJF.mjs.map +0 -1
- package/dist/chunks/hi-BQ2Fyx7t.mjs +0 -2
- package/dist/chunks/hi-BQ2Fyx7t.mjs.map +0 -1
- package/dist/chunks/hi-Bg4-z2Os.mjs +0 -2
- package/dist/chunks/hi-Bg4-z2Os.mjs.map +0 -1
- package/dist/chunks/hi-BgqI_gOH.mjs +0 -2
- package/dist/chunks/hi-BgqI_gOH.mjs.map +0 -1
- package/dist/chunks/hi-CEPSeUBX.mjs +0 -2
- package/dist/chunks/hi-CEPSeUBX.mjs.map +0 -1
- package/dist/chunks/hi-CRaZj5Uo.mjs +0 -2
- package/dist/chunks/hi-CRaZj5Uo.mjs.map +0 -1
- package/dist/chunks/hi-CT0uK1Me.mjs +0 -2
- package/dist/chunks/hi-CT0uK1Me.mjs.map +0 -1
- package/dist/chunks/hi-CnIpMd8L.mjs +0 -2
- package/dist/chunks/hi-CnIpMd8L.mjs.map +0 -1
- package/dist/chunks/hi-CnSv0JhL.mjs +0 -2
- package/dist/chunks/hi-CnSv0JhL.mjs.map +0 -1
- package/dist/chunks/hi-DLLBZu67.mjs +0 -2
- package/dist/chunks/hi-DLLBZu67.mjs.map +0 -1
- package/dist/chunks/hi-DMg_aiSR.mjs +0 -2
- package/dist/chunks/hi-DMg_aiSR.mjs.map +0 -1
- package/dist/chunks/hi-DWwLzOX5.mjs +0 -2
- package/dist/chunks/hi-DWwLzOX5.mjs.map +0 -1
- package/dist/chunks/hi-D_4Xi4Nv.mjs +0 -2
- package/dist/chunks/hi-D_4Xi4Nv.mjs.map +0 -1
- package/dist/chunks/hi-D_Jtykmj.mjs +0 -2
- package/dist/chunks/hi-D_Jtykmj.mjs.map +0 -1
- package/dist/chunks/hi-Da5pRz8E.mjs +0 -2
- package/dist/chunks/hi-Da5pRz8E.mjs.map +0 -1
- package/dist/chunks/hi-DqL20WmM.mjs +0 -2
- package/dist/chunks/hi-DqL20WmM.mjs.map +0 -1
- package/dist/chunks/hi-DwQopxRg.mjs +0 -2
- package/dist/chunks/hi-DwQopxRg.mjs.map +0 -1
- package/dist/chunks/hi-IuMohSSw.mjs +0 -2
- package/dist/chunks/hi-IuMohSSw.mjs.map +0 -1
- package/dist/chunks/hi-PUX7dDPm.mjs +0 -2
- package/dist/chunks/hi-PUX7dDPm.mjs.map +0 -1
- package/dist/chunks/hi-RmfZAmwT.mjs +0 -2
- package/dist/chunks/hi-RmfZAmwT.mjs.map +0 -1
- package/dist/chunks/hi-UIBrTEVu.mjs +0 -2
- package/dist/chunks/hi-UIBrTEVu.mjs.map +0 -1
- package/dist/chunks/hi-_SjWnfeh.mjs +0 -2
- package/dist/chunks/hi-_SjWnfeh.mjs.map +0 -1
- package/dist/chunks/hi-dV2GZgH_.mjs +0 -2
- package/dist/chunks/hi-dV2GZgH_.mjs.map +0 -1
- package/dist/chunks/hi-ehh5oKz3.mjs +0 -2
- package/dist/chunks/hi-ehh5oKz3.mjs.map +0 -1
- package/dist/chunks/hi-yXnRBFJK.mjs +0 -2
- package/dist/chunks/hi-yXnRBFJK.mjs.map +0 -1
- package/dist/chunks/minimal-a40NeBQ_.mjs +0 -2
- package/dist/chunks/minimal-a40NeBQ_.mjs.map +0 -1
- package/dist/chunks/pt-2a8Oto6x.mjs +0 -2
- package/dist/chunks/pt-2a8Oto6x.mjs.map +0 -1
- package/dist/chunks/pt-ALzIyTiI.mjs +0 -2
- package/dist/chunks/pt-ALzIyTiI.mjs.map +0 -1
- package/dist/chunks/pt-B2hMlTc6.mjs +0 -2
- package/dist/chunks/pt-B2hMlTc6.mjs.map +0 -1
- package/dist/chunks/pt-BCIkSb0w.mjs +0 -2
- package/dist/chunks/pt-BCIkSb0w.mjs.map +0 -1
- package/dist/chunks/pt-BFotmq5x.mjs +0 -2
- package/dist/chunks/pt-BFotmq5x.mjs.map +0 -1
- package/dist/chunks/pt-BM7OScX6.mjs +0 -2
- package/dist/chunks/pt-BM7OScX6.mjs.map +0 -1
- package/dist/chunks/pt-BM7zXWxW.mjs +0 -2
- package/dist/chunks/pt-BM7zXWxW.mjs.map +0 -1
- package/dist/chunks/pt-BchCuzFq.mjs +0 -2
- package/dist/chunks/pt-BchCuzFq.mjs.map +0 -1
- package/dist/chunks/pt-BmcHFWoR.mjs +0 -2
- package/dist/chunks/pt-BmcHFWoR.mjs.map +0 -1
- package/dist/chunks/pt-C53W99RV.mjs +0 -2
- package/dist/chunks/pt-C53W99RV.mjs.map +0 -1
- package/dist/chunks/pt-CORQy8qv.mjs +0 -2
- package/dist/chunks/pt-CORQy8qv.mjs.map +0 -1
- package/dist/chunks/pt-CUPKr943.mjs +0 -2
- package/dist/chunks/pt-CUPKr943.mjs.map +0 -1
- package/dist/chunks/pt-CYkKDsLa.mjs +0 -2
- package/dist/chunks/pt-CYkKDsLa.mjs.map +0 -1
- package/dist/chunks/pt-Cd_SXHKt.mjs +0 -2
- package/dist/chunks/pt-Cd_SXHKt.mjs.map +0 -1
- package/dist/chunks/pt-CjN3Oq-6.mjs +0 -2
- package/dist/chunks/pt-CjN3Oq-6.mjs.map +0 -1
- package/dist/chunks/pt-CrKrgktr.mjs +0 -2
- package/dist/chunks/pt-CrKrgktr.mjs.map +0 -1
- package/dist/chunks/pt-Crmbkj0e.mjs +0 -2
- package/dist/chunks/pt-Crmbkj0e.mjs.map +0 -1
- package/dist/chunks/pt-D19IWOM_.mjs +0 -2
- package/dist/chunks/pt-D19IWOM_.mjs.map +0 -1
- package/dist/chunks/pt-D6zY7l2E.mjs +0 -2
- package/dist/chunks/pt-D6zY7l2E.mjs.map +0 -1
- package/dist/chunks/pt-DA5hufLZ.mjs +0 -2
- package/dist/chunks/pt-DA5hufLZ.mjs.map +0 -1
- package/dist/chunks/pt-DEfBqu-c.mjs +0 -2
- package/dist/chunks/pt-DEfBqu-c.mjs.map +0 -1
- package/dist/chunks/pt-DG3rw6nK.mjs +0 -2
- package/dist/chunks/pt-DG3rw6nK.mjs.map +0 -1
- package/dist/chunks/pt-DRoAHNZi.mjs +0 -2
- package/dist/chunks/pt-DRoAHNZi.mjs.map +0 -1
- package/dist/chunks/pt-Eml9QiUL.mjs +0 -2
- package/dist/chunks/pt-Eml9QiUL.mjs.map +0 -1
- package/dist/chunks/pt-Haa3wVmA.mjs +0 -2
- package/dist/chunks/pt-Haa3wVmA.mjs.map +0 -1
- package/dist/chunks/pt-aj7zOxTg.mjs +0 -2
- package/dist/chunks/pt-aj7zOxTg.mjs.map +0 -1
- package/dist/chunks/pt-l6dTmkQk.mjs +0 -2
- package/dist/chunks/pt-l6dTmkQk.mjs.map +0 -1
- package/dist/chunks/ru--JPEpdcJ.mjs +0 -2
- package/dist/chunks/ru--JPEpdcJ.mjs.map +0 -1
- package/dist/chunks/ru-B76ORyqe.mjs +0 -2
- package/dist/chunks/ru-B76ORyqe.mjs.map +0 -1
- package/dist/chunks/ru-BDQ62WuE.mjs +0 -2
- package/dist/chunks/ru-BDQ62WuE.mjs.map +0 -1
- package/dist/chunks/ru-BQ6W3lwr.mjs +0 -2
- package/dist/chunks/ru-BQ6W3lwr.mjs.map +0 -1
- package/dist/chunks/ru-BQpaitci.mjs +0 -2
- package/dist/chunks/ru-BQpaitci.mjs.map +0 -1
- package/dist/chunks/ru-Bm9VwJLu.mjs +0 -2
- package/dist/chunks/ru-Bm9VwJLu.mjs.map +0 -1
- package/dist/chunks/ru-BnNdik6i.mjs +0 -2
- package/dist/chunks/ru-BnNdik6i.mjs.map +0 -1
- package/dist/chunks/ru-Bo4am8cd.mjs +0 -2
- package/dist/chunks/ru-Bo4am8cd.mjs.map +0 -1
- package/dist/chunks/ru-C1k56xWQ.mjs +0 -2
- package/dist/chunks/ru-C1k56xWQ.mjs.map +0 -1
- package/dist/chunks/ru-C4rnSQlI.mjs +0 -2
- package/dist/chunks/ru-C4rnSQlI.mjs.map +0 -1
- package/dist/chunks/ru-CKM3t1sv.mjs +0 -2
- package/dist/chunks/ru-CKM3t1sv.mjs.map +0 -1
- package/dist/chunks/ru-CO6eCsxU.mjs +0 -2
- package/dist/chunks/ru-CO6eCsxU.mjs.map +0 -1
- package/dist/chunks/ru-CTaYpQ9_.mjs +0 -2
- package/dist/chunks/ru-CTaYpQ9_.mjs.map +0 -1
- package/dist/chunks/ru-CdY8d80t.mjs +0 -2
- package/dist/chunks/ru-CdY8d80t.mjs.map +0 -1
- package/dist/chunks/ru-CsDtaWRd.mjs +0 -2
- package/dist/chunks/ru-CsDtaWRd.mjs.map +0 -1
- package/dist/chunks/ru-Cy_4nn8h.mjs +0 -2
- package/dist/chunks/ru-Cy_4nn8h.mjs.map +0 -1
- package/dist/chunks/ru-DACtjNuJ.mjs +0 -2
- package/dist/chunks/ru-DACtjNuJ.mjs.map +0 -1
- package/dist/chunks/ru-DN6yN_w9.mjs +0 -2
- package/dist/chunks/ru-DN6yN_w9.mjs.map +0 -1
- package/dist/chunks/ru-DThFtd76.mjs +0 -2
- package/dist/chunks/ru-DThFtd76.mjs.map +0 -1
- package/dist/chunks/ru-Dd_P7hP7.mjs +0 -2
- package/dist/chunks/ru-Dd_P7hP7.mjs.map +0 -1
- package/dist/chunks/ru-Dhuxwzwy.mjs +0 -2
- package/dist/chunks/ru-Dhuxwzwy.mjs.map +0 -1
- package/dist/chunks/ru-Dn6UDGIG.mjs +0 -2
- package/dist/chunks/ru-Dn6UDGIG.mjs.map +0 -1
- package/dist/chunks/ru-DojHc5wu.mjs +0 -2
- package/dist/chunks/ru-DojHc5wu.mjs.map +0 -1
- package/dist/chunks/ru-DyWzWBjV.mjs +0 -2
- package/dist/chunks/ru-DyWzWBjV.mjs.map +0 -1
- package/dist/chunks/ru-NBxCkjlP.mjs +0 -2
- package/dist/chunks/ru-NBxCkjlP.mjs.map +0 -1
- package/dist/chunks/ru-_MQaVHam.mjs +0 -2
- package/dist/chunks/ru-_MQaVHam.mjs.map +0 -1
- package/dist/chunks/ru-wv17PPrd.mjs +0 -2
- package/dist/chunks/ru-wv17PPrd.mjs.map +0 -1
- package/dist/chunks/src-ooaZ_Egu.mjs +0 -2
- package/dist/chunks/src-ooaZ_Egu.mjs.map +0 -1
- package/dist/chunks/zh-2-Y3Limy.mjs +0 -2
- package/dist/chunks/zh-2-Y3Limy.mjs.map +0 -1
- package/dist/chunks/zh-B02VPMqX.mjs +0 -2
- package/dist/chunks/zh-B02VPMqX.mjs.map +0 -1
- package/dist/chunks/zh-BYjLBWWN.mjs +0 -2
- package/dist/chunks/zh-BYjLBWWN.mjs.map +0 -1
- package/dist/chunks/zh-Bt2ZdHcS.mjs +0 -2
- package/dist/chunks/zh-Bt2ZdHcS.mjs.map +0 -1
- package/dist/chunks/zh-BuN_C4o-.mjs +0 -2
- package/dist/chunks/zh-BuN_C4o-.mjs.map +0 -1
- package/dist/chunks/zh-CA3BDj0Y.mjs +0 -2
- package/dist/chunks/zh-CA3BDj0Y.mjs.map +0 -1
- package/dist/chunks/zh-CHuGP7RS.mjs +0 -2
- package/dist/chunks/zh-CHuGP7RS.mjs.map +0 -1
- package/dist/chunks/zh-CIPsF5P8.mjs +0 -2
- package/dist/chunks/zh-CIPsF5P8.mjs.map +0 -1
- package/dist/chunks/zh-C_YS18re.mjs +0 -2
- package/dist/chunks/zh-C_YS18re.mjs.map +0 -1
- package/dist/chunks/zh-CfMPFWUg.mjs +0 -2
- package/dist/chunks/zh-CfMPFWUg.mjs.map +0 -1
- package/dist/chunks/zh-CfjCcBIB.mjs +0 -2
- package/dist/chunks/zh-CfjCcBIB.mjs.map +0 -1
- package/dist/chunks/zh-CqQph809.mjs +0 -2
- package/dist/chunks/zh-CqQph809.mjs.map +0 -1
- package/dist/chunks/zh-Cxe42GC5.mjs +0 -2
- package/dist/chunks/zh-Cxe42GC5.mjs.map +0 -1
- package/dist/chunks/zh-CyMU2cTf.mjs +0 -2
- package/dist/chunks/zh-CyMU2cTf.mjs.map +0 -1
- package/dist/chunks/zh-Cynz1sBa.mjs +0 -2
- package/dist/chunks/zh-Cynz1sBa.mjs.map +0 -1
- package/dist/chunks/zh-DRKs6Q0a.mjs +0 -2
- package/dist/chunks/zh-DRKs6Q0a.mjs.map +0 -1
- package/dist/chunks/zh-DTuIJjx6.mjs +0 -2
- package/dist/chunks/zh-DTuIJjx6.mjs.map +0 -1
- package/dist/chunks/zh-DTz9l6mp.mjs +0 -2
- package/dist/chunks/zh-DTz9l6mp.mjs.map +0 -1
- package/dist/chunks/zh-DZwjiJmn.mjs +0 -2
- package/dist/chunks/zh-DZwjiJmn.mjs.map +0 -1
- package/dist/chunks/zh-D_VJDQl4.mjs +0 -2
- package/dist/chunks/zh-D_VJDQl4.mjs.map +0 -1
- package/dist/chunks/zh-Dt20Om7Z.mjs +0 -2
- package/dist/chunks/zh-Dt20Om7Z.mjs.map +0 -1
- package/dist/chunks/zh-SgsZ9f-W.mjs +0 -2
- package/dist/chunks/zh-SgsZ9f-W.mjs.map +0 -1
- package/dist/chunks/zh-XR7Ls7m-.mjs +0 -2
- package/dist/chunks/zh-XR7Ls7m-.mjs.map +0 -1
- package/dist/chunks/zh-aXPI9lKF.mjs +0 -2
- package/dist/chunks/zh-aXPI9lKF.mjs.map +0 -1
- package/dist/chunks/zh-cLXIKkZQ.mjs +0 -2
- package/dist/chunks/zh-cLXIKkZQ.mjs.map +0 -1
- package/dist/chunks/zh-cZUtN871.mjs +0 -2
- package/dist/chunks/zh-cZUtN871.mjs.map +0 -1
- package/dist/chunks/zh-hcdnCGUp.mjs +0 -2
- package/dist/chunks/zh-hcdnCGUp.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrintPlugin-CXDFFzWB.mjs","names":[],"sources":["../../src/plugins/print/PrintLocale.ts","../../src/plugins/print/PrintContentPreparer.ts","../../src/plugins/print/PrintStyleCollector.ts","../../src/plugins/print/PrintServiceImpl.ts","../../src/plugins/print/PrintPlugin.ts"],"sourcesContent":["/** Locale interface and default English locale for the PrintPlugin. */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface PrintLocale {\n\treadonly label: string;\n\treadonly tooltip: (shortcut: string) => string;\n\treadonly printingAnnouncement: string;\n}\n\n// --- Default English Locale ---\n\nexport const PRINT_LOCALE_EN: PrintLocale = {\n\tlabel: 'Print',\n\ttooltip: (shortcut: string) => `Print (${shortcut})`,\n\tprintingAnnouncement: 'Printing',\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<PrintLocale> = import.meta.glob<{\n\tdefault: PrintLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadPrintLocale(lang: string): Promise<PrintLocale> {\n\treturn loadLocaleModule(localeModules, lang, PRINT_LOCALE_EN);\n}\n","/**\n * Prepares editor content for print output.\n * Clones the DOM, sanitizes interactive attributes, applies block filters,\n * and inserts header/footer elements.\n */\n\nimport DOMPurify from 'dompurify';\nimport { setStyleProperties } from '../../style/StyleRuntime.js';\nimport type { PrintOptions } from './PrintTypes.js';\n\n/** Deep-clones the .notectl-content element from the editor container. */\nexport function cloneContent(container: HTMLElement): HTMLElement {\n\tconst content: HTMLElement | null = container.querySelector('.notectl-content');\n\tconst source: HTMLElement = content ?? container;\n\treturn source.cloneNode(true) as HTMLElement;\n}\n\n/** Sanitizes the cloned content for print: removes interactive attributes and selection styling. */\nexport function sanitize(clone: HTMLElement): void {\n\t// Remove contenteditable from the root\n\tclone.removeAttribute('contenteditable');\n\n\t// Remove selection-related CSS classes\n\tconst selectionClasses: readonly string[] = ['notectl-node-selected', 'notectl-content--empty'];\n\tfor (const cls of selectionClasses) {\n\t\tclone.classList.remove(cls);\n\t\tfor (const el of clone.querySelectorAll(`.${cls}`)) {\n\t\t\tel.classList.remove(cls);\n\t\t}\n\t}\n\n\t// Remove data-placeholder to avoid showing placeholder in print\n\tclone.removeAttribute('data-placeholder');\n}\n\n/** Removes excluded block types and applies page-break-before to configured block types. */\nexport function applyBlockFilters(clone: HTMLElement, options: PrintOptions): void {\n\tif (options.excludeBlockTypes) {\n\t\tfor (const type of options.excludeBlockTypes) {\n\t\t\tconst elements: NodeListOf<Element> = clone.querySelectorAll(`[data-block-type=\"${type}\"]`);\n\t\t\tfor (const el of elements) {\n\t\t\t\tel.remove();\n\t\t\t}\n\t\t}\n\t}\n\n\tif (options.pageBreakBefore) {\n\t\tfor (const type of options.pageBreakBefore) {\n\t\t\tconst elements: NodeListOf<Element> = clone.querySelectorAll(`[data-block-type=\"${type}\"]`);\n\t\t\tfor (const el of elements) {\n\t\t\t\tsetStyleProperties(el as HTMLElement, {\n\t\t\t\t\tbreakBefore: 'page',\n\t\t\t\t\tpageBreakBefore: 'always',\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Tags allowed in print header/footer content. */\nconst HEADER_FOOTER_ALLOWED_TAGS: readonly string[] = [\n\t'h1',\n\t'h2',\n\t'h3',\n\t'h4',\n\t'h5',\n\t'h6',\n\t'p',\n\t'div',\n\t'span',\n\t'br',\n\t'hr',\n\t'strong',\n\t'b',\n\t'em',\n\t'i',\n\t'u',\n\t's',\n\t'sub',\n\t'sup',\n\t'small',\n\t'ul',\n\t'ol',\n\t'li',\n\t'table',\n\t'thead',\n\t'tbody',\n\t'tr',\n\t'th',\n\t'td',\n\t'img',\n];\n\n/** Attributes allowed in print header/footer content. */\nconst HEADER_FOOTER_ALLOWED_ATTRS: readonly string[] = [\n\t'style',\n\t'class',\n\t'src',\n\t'alt',\n\t'width',\n\t'height',\n\t'colspan',\n\t'rowspan',\n];\n\n/** Resolves a header/footer value to a sanitized HTML string. */\nfunction resolveContent(value: string | (() => string)): string {\n\tconst raw: string = typeof value === 'function' ? value() : value;\n\treturn DOMPurify.sanitize(raw, {\n\t\tALLOWED_TAGS: [...HEADER_FOOTER_ALLOWED_TAGS],\n\t\tALLOWED_ATTR: [...HEADER_FOOTER_ALLOWED_ATTRS],\n\t});\n}\n\n/** Inserts header and footer elements into the cloned content. */\nexport function insertHeaderFooter(clone: HTMLElement, options: PrintOptions): void {\n\tif (options.header) {\n\t\tconst headerEl: HTMLDivElement = document.createElement('div');\n\t\theaderEl.className = 'notectl-print-header';\n\t\theaderEl.innerHTML = resolveContent(options.header);\n\t\tclone.insertBefore(headerEl, clone.firstChild);\n\t}\n\n\tif (options.footer) {\n\t\tconst footerEl: HTMLDivElement = document.createElement('div');\n\t\tfooterEl.className = 'notectl-print-footer';\n\t\tfooterEl.innerHTML = resolveContent(options.footer);\n\t\tclone.appendChild(footerEl);\n\t}\n}\n\n/** Orchestrates all content preparation steps. Returns a ready-to-print DOM element. */\nexport function prepare(container: HTMLElement, options: PrintOptions): HTMLElement {\n\tconst clone: HTMLElement = cloneContent(container);\n\tsanitize(clone);\n\tapplyBlockFilters(clone, options);\n\tinsertHeaderFooter(clone, options);\n\treturn clone;\n}\n","/**\n * Collects and aggregates CSS for print output.\n * Extracts adopted stylesheets, snapshots theme tokens, and generates print-specific CSS.\n */\n\nimport { generateThemeCSS } from '../../editor/theme/ThemeEngine.js';\nimport { LIGHT_THEME } from '../../editor/theme/ThemeTokens.js';\nimport {\n\tPAPER_MARGIN_HORIZONTAL_PX,\n\tPAPER_MARGIN_TOP_PX,\n\tgetPaperCSSSize,\n} from '../../model/PaperSize.js';\nimport type { PrintOptions } from './PrintTypes.js';\n\n/** Extracts CSS text from all adopted stylesheets on a ShadowRoot. */\nexport function extractAdoptedStyles(shadowRoot: ShadowRoot): string {\n\tconst parts: string[] = [];\n\tfor (const sheet of shadowRoot.adoptedStyleSheets) {\n\t\tfor (const rule of sheet.cssRules) {\n\t\t\tparts.push(rule.cssText);\n\t\t}\n\t}\n\treturn parts.join('\\n');\n}\n\n/**\n * Generates light theme CSS custom properties for print output.\n * Uses the static LIGHT_THEME definition rather than reading computed styles,\n * ensuring print output is always readable on paper regardless of the active editor theme.\n */\nexport function generateLightThemeTokens(): string {\n\treturn generateThemeCSS(LIGHT_THEME).replace(':host {', ':root {');\n}\n\n/** Snapshots --notectl-* CSS custom properties from the host element into a :root block. */\nexport function snapshotThemeTokens(host: HTMLElement): string {\n\tconst computed: CSSStyleDeclaration = getComputedStyle(host);\n\tconst tokens: string[] = [];\n\n\tfor (let i = 0; i < computed.length; i++) {\n\t\tconst prop: string = computed[i] ?? '';\n\t\tif (prop.startsWith('--notectl-')) {\n\t\t\tconst value: string = computed.getPropertyValue(prop).trim();\n\t\t\tif (value) {\n\t\t\t\ttokens.push(` ${prop}: ${value};`);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (tokens.length === 0) return '';\n\treturn `:root {\\n${tokens.join('\\n')}\\n}`;\n}\n\n/**\n * Snapshots computed typography from the host element into a `body` rule.\n * In the editor, typography is inherited from `:host` (shadow DOM).\n * The print iframe is a regular document where `:host` doesn't match,\n * so we must apply the same font/line-height explicitly.\n */\nexport function snapshotTypography(host: HTMLElement, colorOverride?: string): string {\n\tconst computed: CSSStyleDeclaration = getComputedStyle(host);\n\tconst props: string[] = [\n\t\t'font-family',\n\t\t'font-size',\n\t\t'font-weight',\n\t\t'line-height',\n\t\t'letter-spacing',\n\t\t'word-spacing',\n\t\t'color',\n\t];\n\tconst rules: string[] = [' margin: 0;'];\n\tfor (const prop of props) {\n\t\tif (prop === 'color' && colorOverride) {\n\t\t\trules.push(` color: ${colorOverride};`);\n\t\t\tcontinue;\n\t\t}\n\t\tconst value: string = computed.getPropertyValue(prop).trim();\n\t\tif (value) {\n\t\t\trules.push(` ${prop}: ${value};`);\n\t\t}\n\t}\n\treturn `body {\\n${rules.join('\\n')}\\n}`;\n}\n\n/** Generates print-specific CSS rules based on PrintOptions. */\nexport function generatePrintCSS(options: PrintOptions): string {\n\tconst parts: string[] = [];\n\n\t// @page rule\n\tconst pageProps: string[] = [];\n\tif (options.margin) {\n\t\tpageProps.push(` margin: ${options.margin};`);\n\t} else if (options.paperSize) {\n\t\t// WYSIWYG: zero @page margin so body = full paper width;\n\t\t// document margins are applied as content padding below.\n\t\tpageProps.push(' margin: 0;');\n\t}\n\tif (options.paperSize || options.orientation) {\n\t\tconst sizeKeyword: string = options.paperSize ? getPaperCSSSize(options.paperSize) : 'A4';\n\t\tconst sizeParts: string[] = [sizeKeyword];\n\t\tif (options.orientation) {\n\t\t\tsizeParts.push(options.orientation);\n\t\t}\n\t\tpageProps.push(` size: ${sizeParts.join(' ')};`);\n\t}\n\tif (pageProps.length > 0) {\n\t\tparts.push(`@page {\\n${pageProps.join('\\n')}\\n}`);\n\t}\n\n\t// WYSIWYG: apply paper-mode document margins to print content\n\tif (options.paperSize) {\n\t\tparts.push(\n\t\t\t`.notectl-content { padding: ${PAPER_MARGIN_TOP_PX}px ${PAPER_MARGIN_HORIZONTAL_PX}px !important; }`,\n\t\t);\n\t}\n\n\t// Print media rules\n\tconst printRules: string[] = [];\n\n\t// Hide non-printable elements\n\tprintRules.push('[data-notectl-no-print] { display: none !important; }');\n\n\t// Code blocks: preserve background, force wrapping\n\tprintRules.push(\n\t\t'.notectl-code-block { white-space: pre-wrap !important; ' +\n\t\t\t'word-break: break-all !important; page-break-inside: avoid; }',\n\t);\n\n\t// Images: avoid page breaks\n\tprintRules.push('img { page-break-inside: avoid; }');\n\n\t// Tables: avoid page breaks\n\tprintRules.push('.notectl-table { break-inside: avoid; }');\n\n\t// Preserve background colors and images in print output (WYSIWYG default).\n\t// Only omitted when the consumer explicitly opts out via printBackground: false.\n\tif (options.printBackground !== false) {\n\t\tprintRules.push(\n\t\t\t'* { -webkit-print-color-adjust: exact !important; ' +\n\t\t\t\t'print-color-adjust: exact !important; }',\n\t\t);\n\t}\n\n\tparts.push(`@media print {\\n ${printRules.join('\\n ')}\\n}`);\n\n\treturn parts.join('\\n\\n');\n}\n\n/** Collects all CSS needed for print: adopted styles, theme tokens, print CSS, and custom CSS. */\nexport function collectAll(\n\tshadowRoot: ShadowRoot,\n\thost: HTMLElement,\n\toptions: PrintOptions,\n): string {\n\tconst parts: string[] = [];\n\n\tconst adopted: string = extractAdoptedStyles(shadowRoot);\n\tif (adopted) parts.push(adopted);\n\n\tconst forceLightTheme: boolean = options.forceLightTheme !== false;\n\n\tif (forceLightTheme) {\n\t\tparts.push(generateLightThemeTokens());\n\t} else {\n\t\tconst theme: string = snapshotThemeTokens(host);\n\t\tif (theme) parts.push(theme);\n\t}\n\n\t// WYSIWYG: snapshot host typography so the print iframe matches the editor.\n\t// In the editor, .notectl-content inherits font from :host (shadow DOM).\n\t// The print iframe is a regular document where :host doesn't apply.\n\tconst colorOverride: string | undefined = forceLightTheme\n\t\t? LIGHT_THEME.primitives.foreground\n\t\t: undefined;\n\tparts.push(snapshotTypography(host, colorOverride));\n\n\tconst printCSS: string = generatePrintCSS(options);\n\tif (printCSS) parts.push(printCSS);\n\n\tif (options.customCSS) {\n\t\tparts.push(options.customCSS);\n\t}\n\n\treturn parts.join('\\n\\n');\n}\n","/**\n * PrintService implementation.\n * Handles the synchronous print flow: event emission, style collection,\n * content preparation, iframe creation, and cleanup.\n */\n\nimport { setStyleText } from '../../style/StyleRuntime.js';\nimport type { PluginEventBus } from '../Plugin.js';\nimport { prepare } from './PrintContentPreparer.js';\nimport { collectAll } from './PrintStyleCollector.js';\nimport {\n\tAFTER_PRINT,\n\ttype AfterPrintEvent,\n\tBEFORE_PRINT,\n\ttype BeforePrintEvent,\n\ttype PrintOptions,\n\ttype PrintService,\n} from './PrintTypes.js';\n\n/** Escapes HTML special characters in a plain-text string. */\nfunction escapeHTML(text: string): string {\n\treturn text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');\n}\n\n/** Builds a complete HTML document string from CSS, body content, and title. */\nexport function buildHTMLDocument(\n\tcss: string,\n\tcontent: string,\n\ttitle: string,\n\tlang = 'en',\n): string {\n\tconst safeTitle: string = escapeHTML(title);\n\treturn [\n\t\t'<!DOCTYPE html>',\n\t\t`<html lang=\"${lang}\">`,\n\t\t'<head>',\n\t\t`<meta charset=\"utf-8\">`,\n\t\t`<title>${safeTitle}</title>`,\n\t\t`<style>${css}</style>`,\n\t\t'</head>',\n\t\t`<body>${content}</body>`,\n\t\t'</html>',\n\t].join('\\n');\n}\n\n/** Creates and returns the PrintService implementation. */\nexport function createPrintService(\n\tshadowRoot: ShadowRoot,\n\thost: HTMLElement,\n\tcontainer: HTMLElement,\n\teventBus: PluginEventBus,\n): PrintService {\n\tfunction mergeOptions(options?: PrintOptions): PrintOptions {\n\t\treturn options ?? {};\n\t}\n\n\tfunction executePrint(options: PrintOptions): string | null {\n\t\t// 1. Emit BEFORE_PRINT — listeners can mutate options or cancel\n\t\tconst beforeEvent: BeforePrintEvent = {\n\t\t\toptions,\n\t\t\tcancelled: false,\n\t\t};\n\t\teventBus.emit(BEFORE_PRINT, beforeEvent);\n\n\t\tif (beforeEvent.cancelled) return null;\n\n\t\tconst finalOptions: PrintOptions = beforeEvent.options;\n\n\t\t// 2. Collect styles\n\t\tconst css: string = collectAll(shadowRoot, host, finalOptions);\n\n\t\t// 3. Prepare content\n\t\tconst clone: HTMLElement = prepare(container, finalOptions);\n\t\tconst contentHTML: string = clone.outerHTML;\n\n\t\t// 4. Build HTML document\n\t\tconst title: string = finalOptions.title ?? '';\n\t\tconst lang: string =\n\t\t\thost.closest('[lang]')?.getAttribute('lang') ?? (document.documentElement.lang || 'en');\n\t\tconst html: string = buildHTMLDocument(css, contentHTML, title, lang);\n\n\t\t// 5. Emit AFTER_PRINT\n\t\tconst afterEvent: AfterPrintEvent = { html };\n\t\teventBus.emit(AFTER_PRINT, afterEvent);\n\n\t\treturn html;\n\t}\n\n\treturn {\n\t\tprint(options?: PrintOptions): void {\n\t\t\tconst resolved: PrintOptions = mergeOptions(options);\n\t\t\tconst html: string | null = executePrint(resolved);\n\t\t\tif (!html) return;\n\n\t\t\t// Create hidden iframe\n\t\t\tconst iframe: HTMLIFrameElement = document.createElement('iframe');\n\t\t\tsetStyleText(iframe, 'position:fixed;left:-9999px;width:0;height:0;border:none');\n\t\t\tdocument.body.appendChild(iframe);\n\n\t\t\tconst iframeDoc: Document | null = iframe.contentDocument;\n\t\t\tif (!iframeDoc) {\n\t\t\t\tdocument.body.removeChild(iframe);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tiframeDoc.open();\n\t\t\tiframeDoc.write(html);\n\t\t\tiframeDoc.close();\n\n\t\t\tconst cleanup = (): void => {\n\t\t\t\tiframe.remove();\n\t\t\t};\n\n\t\t\t// Defer cleanup until print dialog closes\n\t\t\tif (iframe.contentWindow) {\n\t\t\t\tiframe.contentWindow.addEventListener('afterprint', cleanup, { once: true });\n\t\t\t\tiframe.contentWindow.print();\n\t\t\t} else {\n\t\t\t\tcleanup();\n\t\t\t}\n\t\t},\n\n\t\ttoHTML(options?: PrintOptions): string {\n\t\t\tconst resolved: PrintOptions = mergeOptions(options);\n\t\t\treturn executePrint(resolved) ?? '';\n\t\t},\n\t};\n}\n","/**\n * PrintPlugin: provides print functionality for the notectl editor.\n * Registers a command, keymap, toolbar item, and exposes a PrintService.\n * Orchestrator only — delegates all logic to PrintServiceImpl, PrintStyleCollector,\n * and PrintContentPreparer.\n */\n\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { PRINT_LOCALE_EN, type PrintLocale, loadPrintLocale } from './PrintLocale.js';\nimport { createPrintService } from './PrintServiceImpl.js';\nimport type { PrintOptions, PrintPluginConfig, PrintService } from './PrintTypes.js';\nimport { PRINT_SERVICE_KEY } from './PrintTypes.js';\n\nconst PRINT_ICON: string =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">' +\n\t'<path d=\"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3' +\n\t' 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z\"/>' +\n\t'</svg>';\n\n/** No-op fallback service for environments without ShadowRoot. */\nconst NOOP_SERVICE: PrintService = {\n\tprint(): void {},\n\ttoHTML(): string {\n\t\treturn '';\n\t},\n};\n\nexport class PrintPlugin implements Plugin {\n\treadonly id = 'print';\n\treadonly name = 'Print';\n\n\tprivate readonly config: PrintPluginConfig;\n\tprivate service: PrintService | null = null;\n\tprivate locale!: PrintLocale;\n\n\tconstructor(config?: PrintPluginConfig) {\n\t\tthis.config = config ?? {};\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tPRINT_LOCALE_EN,\n\t\t\tloadPrintLocale,\n\t\t);\n\t\tconst container: HTMLElement = context.getContainer();\n\t\tconst rootNode: Node = container.getRootNode();\n\n\t\tif (rootNode instanceof ShadowRoot) {\n\t\t\tconst host: HTMLElement = rootNode.host as HTMLElement;\n\t\t\tconst eventBus = context.getEventBus();\n\t\t\tthis.service = createPrintService(rootNode, host, container, eventBus);\n\t\t} else {\n\t\t\tthis.service = NOOP_SERVICE;\n\t\t}\n\n\t\tcontext.registerService(PRINT_SERVICE_KEY, this.service);\n\n\t\tconst defaults: PrintOptions = this.config.defaults ?? {};\n\t\tconst service: PrintService = this.service;\n\n\t\tconst printLocale = this.locale;\n\t\tcontext.registerCommand('print', () => {\n\t\t\tcontext.announce(printLocale.printingAnnouncement);\n\t\t\tservice.print(defaults);\n\t\t\treturn true;\n\t\t});\n\n\t\tconst keyBinding: string = this.config.keyBinding ?? 'Mod-P';\n\t\tcontext.registerKeymap({\n\t\t\t[keyBinding]: () => {\n\t\t\t\tcontext.executeCommand('print');\n\t\t\t\treturn true;\n\t\t\t},\n\t\t});\n\n\t\tif (this.config.showToolbarItem !== false) {\n\t\t\tconst shortcut: string = formatShortcut(keyBinding);\n\t\t\tcontext.registerToolbarItem({\n\t\t\t\tid: 'print',\n\t\t\t\tgroup: 'actions',\n\t\t\t\tlabel: this.locale.label,\n\t\t\t\ttooltip: this.locale.tooltip(shortcut),\n\t\t\t\ticon: PRINT_ICON,\n\t\t\t\tcommand: 'print',\n\t\t\t});\n\t\t}\n\t}\n\n\tdestroy(): void {\n\t\tthis.service = null;\n\t}\n}\n"],"mappings":"wRAcA,IAAa,EAA+B,CAC3C,MAAO,QACP,QAAU,GAAqB,UAAU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,cAAc,SAErB,GAEF,EAEA,OAAO,GAEC,EADwB,EAAa,KACX,GAGpC,CCzEkB,CAAmB,EAAU,EAAM,EAAW,EAC9D,MACC,KAAK,QAAU,EAGhB,EAAQ,gBAAgB,EAAmB,KAAK,SAEhD,MAAM,EAAyB,KAAK,OAAO,UAAY,CAAC,EAClD,EAAwB,KAAK,QAE7B,EAAc,KAAK,OACzB,EAAQ,gBAAgB,QAAA,KACvB,EAAQ,SAAS,EAAY,sBAC7B,EAAQ,MAAM,IACP,IAGR,MAAM,EAAqB,KAAK,OAAO,YAAc,QAQrD,GAPA,EAAQ,eAAe,CAAA,CACrB,GAAA,KACA,EAAQ,eAAe,UAChB,MAI2B,IAAhC,KAAK,OAAO,gBAA2B,CAC1C,MAAM,EAAmB,EAAe,GACxC,EAAQ,oBAAoB,CAC3B,GAAI,QACJ,MAAO,UACP,MAAO,KAAK,OAAO,MACnB,QAAS,KAAK,OAAO,QAAQ,GAC7B,KAtEH,sPAuEG,QAAS,SAEX,CACD,CAEA,OAAA,GACC,KAAK,QAAU,IAChB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e,t as o}from"./TypedKeys-CA4bfw9O.mjs";import{i as t,n as r,r as n,t as c}from"./SyntaxTokenTypes-BUCOMtL8.mjs";var a={Light:"light",Dark:"dark",System:"system"},d={name:"light",primitives:{background:"#ffffff",foreground:"#1a1a1a",mutedForeground:"#666666",border:"#d0d0d0",borderFocus:"#4a90d9",primary:"#4a90d9",primaryForeground:"#1a5fa0",primaryMuted:"#d0e0f0",surfaceRaised:"#f8f8f8",surfaceOverlay:"#ffffff",hoverBackground:"#e8e8e8",activeBackground:"#d0e0f0",danger:"#dc2626",dangerMuted:"#fee2e2",success:"#1a8c1a",shadow:"rgba(0, 0, 0, 0.15)",focusRing:"rgba(74, 144, 217, 0.2)"},inlineCode:{background:"#edf0f5",foreground:"#334155"},codeBlock:{background:"#f8fafc",foreground:"#334155",headerBackground:"#f1f5f9",headerForeground:"#64748b",headerBorder:"#e2e8f0",syntax:{keyword:"#d73a49",string:"#032f62",comment:{color:"#6a737d",fontStyle:"italic"},number:"#005cc5",function:"#6f42c1",operator:"#d73a49",punctuation:"#24292e",boolean:"#005cc5",null:"#005cc5",property:"#005cc5",type:"#e36209",annotation:"#6f42c1",tag:"#22863a",attribute:"#6f42c1",constant:"#005cc5",regex:"#032f62"}},tooltip:{background:"#1a1a1a",foreground:"#ffffff"}},i={name:"dark",primitives:{background:"#1e1e2e",foreground:"#cdd6f4",mutedForeground:"#7f849c",border:"#45475a",borderFocus:"#89b4fa",primary:"#89b4fa",primaryForeground:"#89b4fa",primaryMuted:"rgba(137, 180, 250, 0.15)",surfaceRaised:"#313244",surfaceOverlay:"#313244",hoverBackground:"#45475a",activeBackground:"rgba(137, 180, 250, 0.15)",danger:"#f38ba8",dangerMuted:"rgba(243, 139, 168, 0.15)",success:"#a6e3a1",shadow:"rgba(0, 0, 0, 0.4)",focusRing:"rgba(137, 180, 250, 0.25)"},inlineCode:{background:"#313244",foreground:"#cdd6f4"},codeBlock:{background:"#313244",foreground:"#cdd6f4",headerBackground:"#45475a",headerForeground:"#bac2de",headerBorder:"#585b70",syntax:{keyword:"#cba6f7",string:"#a6e3a1",comment:{color:"#9399b2",fontStyle:"italic"},number:"#fab387",function:"#89b4fa",operator:"#89dceb",punctuation:"#bac2de",boolean:"#fab387",null:"#f38ba8",property:"#89b4fa",type:"#fab387",annotation:"#cba6f7",tag:"#a6e3a1",attribute:"#89b4fa",constant:"#f9e2af",regex:"#a6e3a1"}},tooltip:{background:"#585b70",foreground:"#cdd6f4"}};function l(e,o){return{name:o.name,primitives:{...e.primitives,...o.primitives},toolbar:o.toolbar?{...e.toolbar,...o.toolbar}:e.toolbar,inlineCode:o.inlineCode?{...e.inlineCode,...o.inlineCode}:e.inlineCode,codeBlock:o.codeBlock?{...e.codeBlock,...o.codeBlock,syntax:o.codeBlock?.syntax?e.codeBlock?.syntax?{...e.codeBlock.syntax,...o.codeBlock.syntax}:void 0:e.codeBlock?.syntax}:e.codeBlock,tooltip:o.tooltip?{...e.tooltip,...o.tooltip}:e.tooltip}}function s(e){if("object"==typeof e)return e;switch(e){case a.Light:return d;case a.Dark:return i;default:return d}}var f=[["primitives.background","--notectl-bg"],["primitives.foreground","--notectl-fg"],["primitives.mutedForeground","--notectl-fg-muted"],["primitives.border","--notectl-border"],["primitives.borderFocus","--notectl-border-focus"],["primitives.primary","--notectl-primary"],["primitives.primaryForeground","--notectl-primary-fg"],["primitives.primaryMuted","--notectl-primary-muted"],["primitives.surfaceRaised","--notectl-surface-raised"],["primitives.surfaceOverlay","--notectl-surface-overlay"],["primitives.hoverBackground","--notectl-hover-bg"],["primitives.activeBackground","--notectl-active-bg"],["primitives.danger","--notectl-danger"],["primitives.dangerMuted","--notectl-danger-muted"],["primitives.success","--notectl-success"],["primitives.shadow","--notectl-shadow"],["primitives.focusRing","--notectl-focus-ring"],["toolbar.background","--notectl-toolbar-bg"],["toolbar.borderColor","--notectl-toolbar-border"],["inlineCode.background","--notectl-code-bg"],["inlineCode.foreground","--notectl-code-color"],["codeBlock.background","--notectl-code-block-bg"],["codeBlock.foreground","--notectl-code-block-color"],["codeBlock.headerBackground","--notectl-code-block-header-bg"],["codeBlock.headerForeground","--notectl-code-block-header-color"],["codeBlock.headerBorder","--notectl-code-block-header-border"],["tooltip.background","--notectl-tooltip-bg"],["tooltip.foreground","--notectl-tooltip-fg"],...c.map(e=>[`codeBlock.syntax.${e}`,`--notectl-code-token-${e}`])],u=c.map(e=>[`--notectl-code-token-${e}`,"var(--notectl-code-block-color)"]),g=new Map([["--notectl-toolbar-bg","var(--notectl-surface-raised)"],["--notectl-toolbar-border","var(--notectl-border)"],["--notectl-code-bg","var(--notectl-surface-raised)"],["--notectl-code-color","var(--notectl-fg)"],["--notectl-code-block-bg","var(--notectl-surface-raised)"],["--notectl-code-block-color","var(--notectl-fg)"],["--notectl-code-block-header-bg","var(--notectl-surface-raised)"],["--notectl-code-block-header-color","var(--notectl-fg-muted)"],["--notectl-code-block-header-border","var(--notectl-border)"],["--notectl-tooltip-bg","var(--notectl-fg)"],["--notectl-tooltip-fg","var(--notectl-bg)"],...u]);function b(e,o){const t=o.split(".");let n=e;for(const r of t){if(null==n)return;if("object"!=typeof n)return;n=n[r]}return"string"==typeof n?n:"object"==typeof n&&null!==n&&"color"in n?r(n):void 0}function p(e){const o=[":host {"];for(const[t,r]of f){const n=b(e,t);if(void 0!==n)o.push(`\t${r}: ${n};`);else{const e=g.get(r);e&&o.push(`\t${r}: ${e};`)}}return e.codeBlock?.syntax&&function(e,o){for(const r of c){const c=e[r];if("object"!=typeof c)continue;const a=n(c);a&&o.push(`\t--notectl-code-token-${r}-font-style: ${a};`);const d=t(c);d&&o.push(`\t--notectl-code-token-${r}-font-weight: ${d};`)}}(e.codeBlock.syntax,o),o.push("}"),o.join("\n")}function m(e){const o=new CSSStyleSheet;return o.replaceSync(p(e)),o}var k=96/25.4,h={DINA4:"din-a4",DINA5:"din-a5",USLetter:"us-letter",USLegal:"us-legal"};function v(e){return Math.round(e*k)}var y=new Map([[h.DINA4,{widthMm:210,heightMm:297,widthPx:v(210),heightPx:v(297)}],[h.DINA5,{widthMm:148,heightMm:210,widthPx:v(148),heightPx:v(210)}],[h.USLetter,{widthMm:215.9,heightMm:279.4,widthPx:v(215.9),heightPx:v(279.4)}],[h.USLegal,{widthMm:215.9,heightMm:355.6,widthPx:v(215.9),heightPx:v(355.6)}]]),B=new Map([[h.DINA4,"A4"],[h.DINA5,"A5"],[h.USLetter,"letter"],[h.USLegal,"legal"]]);function w(e){const o=y.get(e);if(!o)throw new Error(`Unknown paper size: ${e}`);return o}var x=48,M=56,S=24;function $(e){return Object.values(h).includes(e)}function F(e){const o=B.get(e);if(!o)throw new Error(`Unknown paper size: ${e}`);return o}var C=new e("print"),j=new o("print:before"),A=new o("print:after");export{s as _,x as a,F as c,m as d,p as f,l as g,a as h,M as i,w as l,d as m,j as n,S as o,i as p,C as r,h as s,A as t,$ as u};
|
|
2
|
+
//# sourceMappingURL=PrintTypes-WdtgSj74.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrintTypes-WdtgSj74.mjs","names":[],"sources":["../../src/editor/theme/ThemeTokens.ts","../../src/editor/theme/ThemeEngine.ts","../../src/model/PaperSize.ts","../../src/plugins/print/PrintTypes.ts"],"sourcesContent":["/**\n * Theme token types, built-in themes, and theme creation helpers.\n */\n\nimport type { SyntaxTokenType, TokenStyleValue } from './SyntaxTokenTypes.js';\nimport { resolveTokenColor } from './SyntaxTokenTypes.js';\n\n/** Primitive color palette a theme defines. */\nexport interface ThemePrimitives {\n\treadonly background: string;\n\treadonly foreground: string;\n\treadonly mutedForeground: string;\n\treadonly border: string;\n\treadonly borderFocus: string;\n\treadonly primary: string;\n\treadonly primaryForeground: string;\n\treadonly primaryMuted: string;\n\treadonly surfaceRaised: string;\n\treadonly surfaceOverlay: string;\n\treadonly hoverBackground: string;\n\treadonly activeBackground: string;\n\treadonly danger: string;\n\treadonly dangerMuted: string;\n\treadonly success: string;\n\treadonly shadow: string;\n\treadonly focusRing: string;\n}\n\n/** Component-level toolbar overrides. */\nexport interface ThemeToolbar {\n\treadonly background: string;\n\treadonly borderColor: string;\n}\n\n/** Syntax highlighting token styles — one entry per canonical token type. */\nexport type ThemeSyntax = { readonly [K in SyntaxTokenType]: TokenStyleValue };\n\n/** Component-level code block overrides. */\nexport interface ThemeCodeBlock {\n\treadonly background: string;\n\treadonly foreground: string;\n\treadonly headerBackground: string;\n\treadonly headerForeground: string;\n\treadonly headerBorder: string;\n\treadonly syntax?: ThemeSyntax;\n}\n\n/** Component-level inline code overrides. */\nexport interface ThemeInlineCode {\n\treadonly background: string;\n\treadonly foreground: string;\n}\n\n/** Component-level tooltip overrides. */\nexport interface ThemeTooltip {\n\treadonly background: string;\n\treadonly foreground: string;\n}\n\n/** Full theme definition. */\nexport interface Theme {\n\treadonly name: string;\n\treadonly primitives: ThemePrimitives;\n\treadonly toolbar?: Partial<ThemeToolbar>;\n\treadonly inlineCode?: Partial<ThemeInlineCode>;\n\treadonly codeBlock?: Partial<ThemeCodeBlock>;\n\treadonly tooltip?: Partial<ThemeTooltip>;\n}\n\n/** Partial custom theme — deeply partial for creating overrides. */\nexport interface PartialTheme {\n\treadonly name: string;\n\treadonly primitives?: Partial<ThemePrimitives>;\n\treadonly toolbar?: Partial<ThemeToolbar>;\n\treadonly inlineCode?: Partial<ThemeInlineCode>;\n\treadonly codeBlock?: Partial<Omit<ThemeCodeBlock, 'syntax'>> & {\n\t\treadonly syntax?: Partial<ThemeSyntax>;\n\t};\n\treadonly tooltip?: Partial<ThemeTooltip>;\n}\n\n/** Built-in theme presets. */\nexport const ThemePreset = {\n\tLight: 'light',\n\tDark: 'dark',\n\tSystem: 'system',\n} as const;\nexport type ThemePreset = (typeof ThemePreset)[keyof typeof ThemePreset];\n\n/** Built-in light theme. */\nexport const LIGHT_THEME: Theme = {\n\tname: 'light',\n\tprimitives: {\n\t\tbackground: '#ffffff',\n\t\tforeground: '#1a1a1a',\n\t\tmutedForeground: '#666666',\n\t\tborder: '#d0d0d0',\n\t\tborderFocus: '#4a90d9',\n\t\tprimary: '#4a90d9',\n\t\tprimaryForeground: '#1a5fa0',\n\t\tprimaryMuted: '#d0e0f0',\n\t\tsurfaceRaised: '#f8f8f8',\n\t\tsurfaceOverlay: '#ffffff',\n\t\thoverBackground: '#e8e8e8',\n\t\tactiveBackground: '#d0e0f0',\n\t\tdanger: '#dc2626',\n\t\tdangerMuted: '#fee2e2',\n\t\tsuccess: '#1a8c1a',\n\t\tshadow: 'rgba(0, 0, 0, 0.15)',\n\t\tfocusRing: 'rgba(74, 144, 217, 0.2)',\n\t},\n\tinlineCode: {\n\t\tbackground: '#edf0f5',\n\t\tforeground: '#334155',\n\t},\n\tcodeBlock: {\n\t\tbackground: '#f8fafc',\n\t\tforeground: '#334155',\n\t\theaderBackground: '#f1f5f9',\n\t\theaderForeground: '#64748b',\n\t\theaderBorder: '#e2e8f0',\n\t\tsyntax: {\n\t\t\tkeyword: '#d73a49',\n\t\t\tstring: '#032f62',\n\t\t\tcomment: { color: '#6a737d', fontStyle: 'italic' },\n\t\t\tnumber: '#005cc5',\n\t\t\tfunction: '#6f42c1',\n\t\t\toperator: '#d73a49',\n\t\t\tpunctuation: '#24292e',\n\t\t\tboolean: '#005cc5',\n\t\t\tnull: '#005cc5',\n\t\t\tproperty: '#005cc5',\n\t\t\ttype: '#e36209',\n\t\t\tannotation: '#6f42c1',\n\t\t\ttag: '#22863a',\n\t\t\tattribute: '#6f42c1',\n\t\t\tconstant: '#005cc5',\n\t\t\tregex: '#032f62',\n\t\t},\n\t},\n\ttooltip: {\n\t\tbackground: '#1a1a1a',\n\t\tforeground: '#ffffff',\n\t},\n};\n\n/** Built-in dark theme. */\nexport const DARK_THEME: Theme = {\n\tname: 'dark',\n\tprimitives: {\n\t\tbackground: '#1e1e2e',\n\t\tforeground: '#cdd6f4',\n\t\tmutedForeground: '#7f849c',\n\t\tborder: '#45475a',\n\t\tborderFocus: '#89b4fa',\n\t\tprimary: '#89b4fa',\n\t\tprimaryForeground: '#89b4fa',\n\t\tprimaryMuted: 'rgba(137, 180, 250, 0.15)',\n\t\tsurfaceRaised: '#313244',\n\t\tsurfaceOverlay: '#313244',\n\t\thoverBackground: '#45475a',\n\t\tactiveBackground: 'rgba(137, 180, 250, 0.15)',\n\t\tdanger: '#f38ba8',\n\t\tdangerMuted: 'rgba(243, 139, 168, 0.15)',\n\t\tsuccess: '#a6e3a1',\n\t\tshadow: 'rgba(0, 0, 0, 0.4)',\n\t\tfocusRing: 'rgba(137, 180, 250, 0.25)',\n\t},\n\tinlineCode: {\n\t\tbackground: '#313244',\n\t\tforeground: '#cdd6f4',\n\t},\n\tcodeBlock: {\n\t\tbackground: '#313244',\n\t\tforeground: '#cdd6f4',\n\t\theaderBackground: '#45475a',\n\t\theaderForeground: '#bac2de',\n\t\theaderBorder: '#585b70',\n\t\tsyntax: {\n\t\t\tkeyword: '#cba6f7',\n\t\t\tstring: '#a6e3a1',\n\t\t\tcomment: { color: '#9399b2', fontStyle: 'italic' },\n\t\t\tnumber: '#fab387',\n\t\t\tfunction: '#89b4fa',\n\t\t\toperator: '#89dceb',\n\t\t\tpunctuation: '#bac2de',\n\t\t\tboolean: '#fab387',\n\t\t\tnull: '#f38ba8',\n\t\t\tproperty: '#89b4fa',\n\t\t\ttype: '#fab387',\n\t\t\tannotation: '#cba6f7',\n\t\t\ttag: '#a6e3a1',\n\t\t\tattribute: '#89b4fa',\n\t\t\tconstant: '#f9e2af',\n\t\t\tregex: '#a6e3a1',\n\t\t},\n\t},\n\ttooltip: {\n\t\tbackground: '#585b70',\n\t\tforeground: '#cdd6f4',\n\t},\n};\n\n/** Creates a custom theme by extending a base theme with partial overrides. */\nexport function createTheme(base: Theme, overrides: PartialTheme): Theme {\n\tconst mergeSyntax = (): ThemeSyntax | undefined => {\n\t\tif (!overrides.codeBlock?.syntax) return base.codeBlock?.syntax;\n\t\tif (!base.codeBlock?.syntax) return undefined;\n\t\treturn { ...base.codeBlock.syntax, ...overrides.codeBlock.syntax } as ThemeSyntax;\n\t};\n\n\treturn {\n\t\tname: overrides.name,\n\t\tprimitives: { ...base.primitives, ...overrides.primitives },\n\t\ttoolbar: overrides.toolbar ? { ...base.toolbar, ...overrides.toolbar } : base.toolbar,\n\t\tinlineCode: overrides.inlineCode\n\t\t\t? { ...base.inlineCode, ...overrides.inlineCode }\n\t\t\t: base.inlineCode,\n\t\tcodeBlock: overrides.codeBlock\n\t\t\t? {\n\t\t\t\t\t...base.codeBlock,\n\t\t\t\t\t...overrides.codeBlock,\n\t\t\t\t\tsyntax: mergeSyntax(),\n\t\t\t\t}\n\t\t\t: base.codeBlock,\n\t\ttooltip: overrides.tooltip ? { ...base.tooltip, ...overrides.tooltip } : base.tooltip,\n\t};\n}\n\n// Re-export for convenience — avoids extra imports in consumer code.\nexport { resolveTokenColor };\n\n/** Resolves a ThemePreset string or Theme object to a full Theme. */\nexport function resolveTheme(theme: ThemePreset | Theme): Theme {\n\tif (typeof theme === 'object') return theme;\n\tswitch (theme) {\n\t\tcase ThemePreset.Light:\n\t\t\treturn LIGHT_THEME;\n\t\tcase ThemePreset.Dark:\n\t\t\treturn DARK_THEME;\n\t\tcase ThemePreset.System:\n\t\t\t// System is resolved externally via matchMedia; default to light.\n\t\t\treturn LIGHT_THEME;\n\t\tdefault:\n\t\t\treturn LIGHT_THEME;\n\t}\n}\n","/**\n * Theme engine — converts a Theme object into CSS custom properties.\n */\n\nimport {\n\tSYNTAX_TOKEN_TYPES,\n\tresolveTokenColor,\n\tresolveTokenFontStyle,\n\tresolveTokenFontWeight,\n} from './SyntaxTokenTypes.js';\nimport type { TokenStyleValue } from './SyntaxTokenTypes.js';\nimport type { Theme, ThemeSyntax } from './ThemeTokens.js';\n\n// --- Static entries (non-syntax) ---\n\nconst STATIC_ENTRIES: ReadonlyArray<readonly [string, string]> = [\n\t// Primitives\n\t['primitives.background', '--notectl-bg'],\n\t['primitives.foreground', '--notectl-fg'],\n\t['primitives.mutedForeground', '--notectl-fg-muted'],\n\t['primitives.border', '--notectl-border'],\n\t['primitives.borderFocus', '--notectl-border-focus'],\n\t['primitives.primary', '--notectl-primary'],\n\t['primitives.primaryForeground', '--notectl-primary-fg'],\n\t['primitives.primaryMuted', '--notectl-primary-muted'],\n\t['primitives.surfaceRaised', '--notectl-surface-raised'],\n\t['primitives.surfaceOverlay', '--notectl-surface-overlay'],\n\t['primitives.hoverBackground', '--notectl-hover-bg'],\n\t['primitives.activeBackground', '--notectl-active-bg'],\n\t['primitives.danger', '--notectl-danger'],\n\t['primitives.dangerMuted', '--notectl-danger-muted'],\n\t['primitives.success', '--notectl-success'],\n\t['primitives.shadow', '--notectl-shadow'],\n\t['primitives.focusRing', '--notectl-focus-ring'],\n\t// Component: toolbar\n\t['toolbar.background', '--notectl-toolbar-bg'],\n\t['toolbar.borderColor', '--notectl-toolbar-border'],\n\t// Component: inlineCode\n\t['inlineCode.background', '--notectl-code-bg'],\n\t['inlineCode.foreground', '--notectl-code-color'],\n\t// Component: codeBlock (non-syntax)\n\t['codeBlock.background', '--notectl-code-block-bg'],\n\t['codeBlock.foreground', '--notectl-code-block-color'],\n\t['codeBlock.headerBackground', '--notectl-code-block-header-bg'],\n\t['codeBlock.headerForeground', '--notectl-code-block-header-color'],\n\t['codeBlock.headerBorder', '--notectl-code-block-header-border'],\n\t// Component: tooltip\n\t['tooltip.background', '--notectl-tooltip-bg'],\n\t['tooltip.foreground', '--notectl-tooltip-fg'],\n];\n\n// --- Generated syntax variable map (derived from SYNTAX_TOKEN_TYPES) ---\n\nconst SYNTAX_VARIABLE_MAP: ReadonlyArray<readonly [string, string]> = SYNTAX_TOKEN_TYPES.map(\n\t(type) => [`codeBlock.syntax.${type}`, `--notectl-code-token-${type}`] as const,\n);\n\n/** Full variable map: static entries + syntax entries. */\nconst VARIABLE_MAP: ReadonlyArray<readonly [string, string]> = [\n\t...STATIC_ENTRIES,\n\t...SYNTAX_VARIABLE_MAP,\n];\n\n// --- Static fallbacks (non-syntax) ---\n\nconst STATIC_FALLBACKS: ReadonlyArray<readonly [string, string]> = [\n\t['--notectl-toolbar-bg', 'var(--notectl-surface-raised)'],\n\t['--notectl-toolbar-border', 'var(--notectl-border)'],\n\t['--notectl-code-bg', 'var(--notectl-surface-raised)'],\n\t['--notectl-code-color', 'var(--notectl-fg)'],\n\t['--notectl-code-block-bg', 'var(--notectl-surface-raised)'],\n\t['--notectl-code-block-color', 'var(--notectl-fg)'],\n\t['--notectl-code-block-header-bg', 'var(--notectl-surface-raised)'],\n\t['--notectl-code-block-header-color', 'var(--notectl-fg-muted)'],\n\t['--notectl-code-block-header-border', 'var(--notectl-border)'],\n\t['--notectl-tooltip-bg', 'var(--notectl-fg)'],\n\t['--notectl-tooltip-fg', 'var(--notectl-bg)'],\n];\n\n// --- Generated syntax fallbacks (derived from SYNTAX_TOKEN_TYPES) ---\n\nconst SYNTAX_FALLBACKS: ReadonlyArray<readonly [string, string]> = SYNTAX_TOKEN_TYPES.map(\n\t(type) => [`--notectl-code-token-${type}`, 'var(--notectl-code-block-color)'] as const,\n);\n\n/** Fallbacks for component tokens when not explicitly set. */\nconst COMPONENT_FALLBACKS: ReadonlyMap<string, string> = new Map([\n\t...STATIC_FALLBACKS,\n\t...SYNTAX_FALLBACKS,\n]);\n\n/** Resolves a dotted path like 'primitives.background' from a Theme. */\nfunction resolvePath(theme: Theme, path: string): string | undefined {\n\tconst parts: string[] = path.split('.');\n\tlet current: unknown = theme;\n\tfor (const part of parts) {\n\t\tif (current === undefined || current === null) return undefined;\n\t\tif (typeof current !== 'object') return undefined;\n\t\tcurrent = (current as Record<string, unknown>)[part];\n\t}\n\tif (typeof current === 'string') return current;\n\tif (typeof current === 'object' && current !== null && 'color' in current) {\n\t\treturn resolveTokenColor(current as TokenStyleValue);\n\t}\n\treturn undefined;\n}\n\n/** Emits font-style/font-weight CSS vars for syntax tokens that use TokenStyle objects. */\nfunction emitTokenStyleVars(syntax: ThemeSyntax, lines: string[]): void {\n\tfor (const type of SYNTAX_TOKEN_TYPES) {\n\t\tconst value: TokenStyleValue = syntax[type];\n\t\tif (typeof value !== 'object') continue;\n\n\t\tconst fontStyle: string | undefined = resolveTokenFontStyle(value);\n\t\tif (fontStyle) {\n\t\t\tlines.push(`\\t--notectl-code-token-${type}-font-style: ${fontStyle};`);\n\t\t}\n\t\tconst fontWeight: string | undefined = resolveTokenFontWeight(value);\n\t\tif (fontWeight) {\n\t\t\tlines.push(`\\t--notectl-code-token-${type}-font-weight: ${fontWeight};`);\n\t\t}\n\t}\n}\n\n/** Generates CSS text with all theme custom properties on :host. */\nexport function generateThemeCSS(theme: Theme): string {\n\tconst lines: string[] = [':host {'];\n\n\tfor (const [path, cssVar] of VARIABLE_MAP) {\n\t\tconst value: string | undefined = resolvePath(theme, path);\n\t\tif (value !== undefined) {\n\t\t\tlines.push(`\\t${cssVar}: ${value};`);\n\t\t} else {\n\t\t\tconst fallback: string | undefined = COMPONENT_FALLBACKS.get(cssVar);\n\t\t\tif (fallback) {\n\t\t\t\tlines.push(`\\t${cssVar}: ${fallback};`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Emit font-style / font-weight vars for TokenStyle entries\n\tif (theme.codeBlock?.syntax) {\n\t\temitTokenStyleVars(theme.codeBlock.syntax, lines);\n\t}\n\n\tlines.push('}');\n\treturn lines.join('\\n');\n}\n\n/** Creates a CSSStyleSheet populated with theme CSS variables. */\nexport function createThemeStyleSheet(theme: Theme): CSSStyleSheet {\n\tconst sheet: CSSStyleSheet = new CSSStyleSheet();\n\tsheet.replaceSync(generateThemeCSS(theme));\n\treturn sheet;\n}\n","/**\n * Paper size definitions and dimension helpers.\n * Used by PaperLayoutController for WYSIWYG page layout\n * and by PrintStyleCollector for @page CSS rules.\n */\n\n/** Conversion factor: 1mm = 96/25.4 px at CSS reference pixel (96 DPI). */\nconst MM_TO_PX: number = 96 / 25.4;\n\n/** Physical dimensions of a paper size. */\nexport interface PaperDimensions {\n\treadonly widthMm: number;\n\treadonly heightMm: number;\n\treadonly widthPx: number;\n\treadonly heightPx: number;\n}\n\n/** Available paper size presets. */\nexport const PaperSize = {\n\tDINA4: 'din-a4',\n\tDINA5: 'din-a5',\n\tUSLetter: 'us-letter',\n\tUSLegal: 'us-legal',\n} as const;\nexport type PaperSize = (typeof PaperSize)[keyof typeof PaperSize];\n\n/** Rounds to nearest integer for pixel dimensions. */\nfunction mmToPx(mm: number): number {\n\treturn Math.round(mm * MM_TO_PX);\n}\n\n/** Lookup table for paper dimensions. */\nconst PAPER_DIMENSIONS: ReadonlyMap<PaperSize, PaperDimensions> = new Map<\n\tPaperSize,\n\tPaperDimensions\n>([\n\t[PaperSize.DINA4, { widthMm: 210, heightMm: 297, widthPx: mmToPx(210), heightPx: mmToPx(297) }],\n\t[PaperSize.DINA5, { widthMm: 148, heightMm: 210, widthPx: mmToPx(148), heightPx: mmToPx(210) }],\n\t[\n\t\tPaperSize.USLetter,\n\t\t{ widthMm: 215.9, heightMm: 279.4, widthPx: mmToPx(215.9), heightPx: mmToPx(279.4) },\n\t],\n\t[\n\t\tPaperSize.USLegal,\n\t\t{ widthMm: 215.9, heightMm: 355.6, widthPx: mmToPx(215.9), heightPx: mmToPx(355.6) },\n\t],\n]);\n\n/** CSS @page size keywords for each paper size. */\nconst CSS_SIZE_KEYWORDS: ReadonlyMap<PaperSize, string> = new Map<PaperSize, string>([\n\t[PaperSize.DINA4, 'A4'],\n\t[PaperSize.DINA5, 'A5'],\n\t[PaperSize.USLetter, 'letter'],\n\t[PaperSize.USLegal, 'legal'],\n]);\n\n/** Returns the physical and pixel dimensions for a paper size. */\nexport function getPaperDimensions(size: PaperSize): PaperDimensions {\n\tconst dims: PaperDimensions | undefined = PAPER_DIMENSIONS.get(size);\n\tif (!dims) {\n\t\tthrow new Error(`Unknown paper size: ${size}`);\n\t}\n\treturn dims;\n}\n\n/**\n * Document margin constants for paper mode (in px).\n * These define the content padding inside the paper surface in the editor,\n * and become @page margins in print output to ensure WYSIWYG fidelity.\n */\nexport const PAPER_MARGIN_TOP_PX: number = 48;\nexport const PAPER_MARGIN_HORIZONTAL_PX: number = 56;\nexport const PAPER_VIEWPORT_PADDING_PX: number = 24;\n\n/** Type guard: returns true if the value is a valid PaperSize string. */\nexport function isValidPaperSize(value: string): value is PaperSize {\n\treturn (Object.values(PaperSize) as string[]).includes(value);\n}\n\n/** Returns the CSS @page size keyword (e.g. 'A4', 'letter') for a paper size. */\nexport function getPaperCSSSize(size: PaperSize): string {\n\tconst keyword: string | undefined = CSS_SIZE_KEYWORDS.get(size);\n\tif (!keyword) {\n\t\tthrow new Error(`Unknown paper size: ${size}`);\n\t}\n\treturn keyword;\n}\n","/**\n * Type definitions, service keys, and event keys for the PrintPlugin.\n */\n\nimport type { PaperSize } from '../../model/PaperSize.js';\nimport type { NodeTypeName } from '../../model/TypeBrands.js';\nimport { EventKey, ServiceKey } from '../Plugin.js';\n\n// --- Print Options ---\n\nexport interface PrintOptions {\n\t/** Page title shown in the browser print header. */\n\treadonly title?: string;\n\n\t/** Additional CSS appended to the print stylesheet. */\n\treadonly customCSS?: string;\n\n\t/**\n\t * Header HTML inserted once at the top of the print document.\n\t * For repeating per-page headers, use toHTML() with server-side PDF generation.\n\t */\n\treadonly header?: string | (() => string);\n\n\t/**\n\t * Footer HTML inserted once at the bottom of the print document.\n\t * For repeating per-page footers, use toHTML() with server-side PDF generation.\n\t */\n\treadonly footer?: string | (() => string);\n\n\t/** Page margins as CSS value (e.g. '2cm'). */\n\treadonly margin?: string;\n\n\t/** Force page break before these block types. */\n\treadonly pageBreakBefore?: readonly NodeTypeName[];\n\n\t/** Exclude these block types from print output. */\n\treadonly excludeBlockTypes?: readonly NodeTypeName[];\n\n\t/**\n\t * Whether to preserve background colors and images in print output.\n\t * Defaults to `true` (WYSIWYG). Set to `false` to let the browser strip\n\t * backgrounds (e.g. to save ink).\n\t */\n\treadonly printBackground?: boolean;\n\n\t/**\n\t * Force light theme tokens in print output for readability on paper.\n\t * Defaults to `true`. Set to `false` to print with the current editor theme.\n\t */\n\treadonly forceLightTheme?: boolean;\n\n\t/** Page orientation. */\n\treadonly orientation?: 'portrait' | 'landscape';\n\n\t/** Paper size for @page CSS rule. When set, overrides the default A4 page size. */\n\treadonly paperSize?: PaperSize;\n}\n\n// --- Plugin Configuration ---\n\nexport interface PrintPluginConfig {\n\t/** Default options applied to every print() call. */\n\treadonly defaults?: PrintOptions;\n\n\t/** Keyboard shortcut (default: 'Mod-P'). */\n\treadonly keyBinding?: string;\n\n\t/** Show toolbar button (default: true). */\n\treadonly showToolbarItem?: boolean;\n\n\t/** Locale override for user-facing strings. */\n\treadonly locale?: import('./PrintLocale.js').PrintLocale;\n}\n\n// --- Service Interface ---\n\nexport interface PrintService {\n\t/** Prints the editor content with optional configuration. */\n\tprint(options?: PrintOptions): void;\n\n\t/** Generates print-ready HTML as a complete document string. */\n\ttoHTML(options?: PrintOptions): string;\n}\n\n// --- Service & Event Keys ---\n\nexport const PRINT_SERVICE_KEY: ServiceKey<PrintService> = new ServiceKey<PrintService>('print');\n\nexport const BEFORE_PRINT: EventKey<BeforePrintEvent> = new EventKey<BeforePrintEvent>(\n\t'print:before',\n);\n\nexport const AFTER_PRINT: EventKey<AfterPrintEvent> = new EventKey<AfterPrintEvent>('print:after');\n\n// --- Event Payloads ---\n\nexport interface BeforePrintEvent {\n\t/** Options can be mutated — EventBus passes by reference. */\n\toptions: PrintOptions;\n\t/** Set to true to cancel the print. */\n\tcancelled: boolean;\n}\n\nexport interface AfterPrintEvent {\n\t/** The generated HTML (read-only). */\n\treadonly html: string;\n}\n"],"mappings":"6HAkFA,IAAa,EAAc,CAC1B,MAAO,QACP,KAAM,OACN,OAAQ,UAKI,EAAqB,CACjC,KAAM,QACN,WAAY,CACX,WAAY,UACZ,WAAY,UACZ,gBAAiB,UACjB,OAAQ,UACR,YAAa,UACb,QAAS,UACT,kBAAmB,UACnB,aAAc,UACd,cAAe,UACf,eAAgB,UAChB,gBAAiB,UACjB,iBAAkB,UAClB,OAAQ,UACR,YAAa,UACb,QAAS,UACT,OAAQ,sBACR,UAAW,2BAEZ,WAAY,CACX,WAAY,UACZ,WAAY,WAEb,UAAW,CACV,WAAY,UACZ,WAAY,UACZ,iBAAkB,UAClB,iBAAkB,UAClB,aAAc,UACd,OAAQ,CACP,QAAS,UACT,OAAQ,UACR,QAAS,CAAE,MAAO,UAAW,UAAW,UACxC,OAAQ,UACR,SAAU,UACV,SAAU,UACV,YAAa,UACb,QAAS,UACT,KAAM,UACN,SAAU,UACV,KAAM,UACN,WAAY,UACZ,IAAK,UACL,UAAW,UACX,SAAU,UACV,MAAO,YAGT,QAAS,CACR,WAAY,UACZ,WAAY,YAKD,EAAoB,CAChC,KAAM,OACN,WAAY,CACX,WAAY,UACZ,WAAY,UACZ,gBAAiB,UACjB,OAAQ,UACR,YAAa,UACb,QAAS,UACT,kBAAmB,UACnB,aAAc,4BACd,cAAe,UACf,eAAgB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AgB,EAAmB,GAClC,MAAM,EAAoC,EAAiB,IAAI,GAC/D,IAAK,EACJ,MAAM,IAAI,MAAM,uBAAuB,KAExC,OAAO,CACR,CAOA,IAAa,EAA8B,GAC9B,EAAqC,GACrC,EAAoC,GAGjD,SAAgB,EAAiB,GAChC,OAAQ,OAAO,OAAO,GAAwB,SAAS,EACxD,CAGA,SAAgB,EAAgB,GAC/B,MAAM,EAA8B,EAAkB,IAAI,GAC1D,IAAK,EACJ,MAAM,IAAI,MAAM,uBAAuB,KAExC,OAAO,CACR,CCAA,IAAa,EAA8C,IAAI,EAAyB,SAE3E,EAA2C,IAAI,EAC3D,gBAGY,EAAyC,IAAI,EAA0B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as o}from"./Document-r7vLOAGA.mjs";function t(o,t,n){const c=o.getBlockOrder(),f=c.indexOf(t.from.blockId),e=c.indexOf(t.to.blockId);for(let r=f;r<=e;r++){const o=c[r];o&&n(o)}}function n(t,n,c){const f=t.getBlockOrder(),e=f.indexOf(n.from.blockId),r=f.indexOf(n.to.blockId);for(let s=e;s<=r;s++){const i=f[s];if(!i)continue;const d=t.getBlock(i);if(!d)continue;const l=s===e?n.from.offset:0,k=s===r?n.to.offset:o(d);l!==k&&c(i,l,k)}}export{n,t};
|
|
2
|
+
//# sourceMappingURL=RangeIterator-o8v3msQe.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeIterator-o8v3msQe.mjs","names":[],"sources":["../../src/commands/RangeIterator.ts"],"sourcesContent":["/**\n * Utility for iterating over blocks within a selection range.\n *\n * Extracted from Commands.ts to break circular dependencies:\n * Commands.ts re-exports from MarkCommands.ts / AttributedMarkCommands.ts,\n * which in turn import forEachBlockInRange from Commands.ts.\n */\n\nimport { getBlockLength } from '../model/Document.js';\nimport type { SelectionRange } from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\n\n/**\n * Iterates over every block ID in the given selection range, including\n * empty blocks and boundary blocks regardless of offset span.\n * Designed for block-level operations (e.g. setBlockType) where offsets are irrelevant.\n */\nexport function forEachBlockIdInRange(\n\tstate: EditorState,\n\trange: SelectionRange,\n\tcallback: (blockId: BlockId) => void,\n): void {\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst fromIdx: number = blockOrder.indexOf(range.from.blockId);\n\tconst toIdx: number = blockOrder.indexOf(range.to.blockId);\n\n\tfor (let i: number = fromIdx; i <= toIdx; i++) {\n\t\tconst blockId: BlockId | undefined = blockOrder[i];\n\t\tif (!blockId) continue;\n\t\tcallback(blockId);\n\t}\n}\n\n/**\n * Iterates over each block in the given selection range, invoking the callback\n * with the block ID, per-block start offset, and per-block end offset.\n * Blocks where `from === to` are skipped automatically.\n */\nexport function forEachBlockInRange(\n\tstate: EditorState,\n\trange: SelectionRange,\n\tcallback: (blockId: BlockId, from: number, to: number) => void,\n): void {\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst fromIdx: number = blockOrder.indexOf(range.from.blockId);\n\tconst toIdx: number = blockOrder.indexOf(range.to.blockId);\n\n\tfor (let i: number = fromIdx; i <= toIdx; i++) {\n\t\tconst blockId: BlockId | undefined = blockOrder[i];\n\t\tif (!blockId) continue;\n\t\tconst block = state.getBlock(blockId);\n\t\tif (!block) continue;\n\n\t\tconst from: number = i === fromIdx ? range.from.offset : 0;\n\t\tconst to: number = i === toIdx ? range.to.offset : getBlockLength(block);\n\n\t\tif (from === to) continue;\n\t\tcallback(blockId, from, to);\n\t}\n}\n"],"mappings":"4CAkBA,SAAgB,EACf,EACA,EACA,GAEA,MAAM,EAAiC,EAAM,gBACvC,EAAkB,EAAW,QAAQ,EAAM,KAAK,SAChD,EAAgB,EAAW,QAAQ,EAAM,GAAG,SAElD,IAAK,IAAI,EAAY,EAAS,GAAK,EAAO,IAAK,CAC9C,MAAM,EAA+B,EAAW,GAC3C,GACL,EAAS,EACV,CACD,CAOA,SAAgB,EACf,EACA,EACA,GAEA,MAAM,EAAiC,EAAM,gBACvC,EAAkB,EAAW,QAAQ,EAAM,KAAK,SAChD,EAAgB,EAAW,QAAQ,EAAM,GAAG,SAElD,IAAK,IAAI,EAAY,EAAS,GAAK,EAAO,IAAK,CAC9C,MAAM,EAA+B,EAAW,GAChD,IAAK,EAAS,SACd,MAAM,EAAQ,EAAM,SAAS,GAC7B,IAAK,EAAO,SAEZ,MAAM,EAAe,IAAM,EAAU,EAAM,KAAK,OAAS,EACnD,EAAa,IAAM,EAAQ,EAAM,GAAG,OAAS,EAAe,GAE9D,IAAS,GACb,EAAS,EAAS,EAAM,EACzB,CACD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function o(o,n){return{type:"node",nodeId:o,path:n}}function n(o,n,e){return{type:"gap",side:n,blockId:o,path:e}}function e(o){return"type"in o&&"node"===o.type}function t(o){return"type"in o&&"gap"===o.type}function a(o){return!("type"in o)}function c(o,n){return e(o)&&e(n)?o.nodeId===n.nodeId:t(o)&&t(n)?o.blockId===n.blockId&&o.side===n.side:!(!a(o)||!a(n))&&o.anchor.blockId===n.anchor.blockId&&o.anchor.offset===n.anchor.offset&&o.head.blockId===n.head.blockId&&o.head.offset===n.head.offset}function d(o,n,e){return e?{blockId:o,offset:n,path:e}:{blockId:o,offset:n}}function r(o,n){return{anchor:o,head:n}}function f(o,n){const e={blockId:o,offset:n};return{anchor:e,head:e}}function h(o){return!!a(o)&&o.anchor.blockId===o.head.blockId&&o.anchor.offset===o.head.offset}function s(o,n){return!a(o)||(o.anchor.blockId===o.head.blockId?o.anchor.offset<=o.head.offset:!n||n.indexOf(o.anchor.blockId)<=n.indexOf(o.head.blockId))}function u(o,n){return s(o,n)?{from:o.anchor,to:o.head}:{from:o.head,to:o.anchor}}export{r as a,t as c,u as d,c as f,d as i,e as l,n,h as o,o as r,s,f as t,a as u};
|
|
2
|
+
//# sourceMappingURL=Selection-HYoVFpAx.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Selection-HYoVFpAx.mjs","names":[],"sources":["../../src/model/Selection.ts"],"sourcesContent":["/**\n * Selection model for the Notectl editor.\n * A selection is defined by an anchor and head position within the document.\n */\n\nimport type { BlockId } from './TypeBrands.js';\n\nexport interface Position {\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n\t/** Path from root block to leaf block (optional, for nested structures). */\n\treadonly path?: readonly BlockId[];\n}\n\nexport interface Selection {\n\treadonly anchor: Position;\n\treadonly head: Position;\n}\n\nexport interface SelectionRange {\n\treadonly from: Position;\n\treadonly to: Position;\n}\n\n/** A selection that selects an entire node (e.g. void blocks, table selection). */\nexport interface NodeSelection {\n\treadonly type: 'node';\n\treadonly nodeId: BlockId;\n\treadonly path: readonly BlockId[];\n}\n\n/** A virtual cursor at the boundary of a void block where no native caret can exist. */\nexport interface GapCursorSelection {\n\treadonly type: 'gap';\n\treadonly side: 'before' | 'after';\n\treadonly blockId: BlockId;\n\treadonly path: readonly BlockId[];\n}\n\n/** Union type representing a text selection, node selection, or gap cursor. */\nexport type EditorSelection = Selection | NodeSelection | GapCursorSelection;\n\n/** Creates a NodeSelection for the given block. */\nexport function createNodeSelection(nodeId: BlockId, path: readonly BlockId[]): NodeSelection {\n\treturn { type: 'node', nodeId, path };\n}\n\n/** Creates a GapCursorSelection at the boundary of a void block. */\nexport function createGapCursor(\n\tblockId: BlockId,\n\tside: 'before' | 'after',\n\tpath: readonly BlockId[],\n): GapCursorSelection {\n\treturn { type: 'gap', side, blockId, path };\n}\n\n/** Type guard: returns true if the selection is a NodeSelection. */\nexport function isNodeSelection(sel: EditorSelection): sel is NodeSelection {\n\treturn 'type' in sel && sel.type === 'node';\n}\n\n/** Type guard: returns true if the selection is a GapCursorSelection. */\nexport function isGapCursor(sel: EditorSelection): sel is GapCursorSelection {\n\treturn 'type' in sel && sel.type === 'gap';\n}\n\n/** Type guard: returns true if the selection is a text Selection. */\nexport function isTextSelection(sel: EditorSelection): sel is Selection {\n\treturn !('type' in sel);\n}\n\n/** Compares two EditorSelections for equality. */\nexport function selectionsEqual(a: EditorSelection, b: EditorSelection): boolean {\n\tif (isNodeSelection(a) && isNodeSelection(b)) {\n\t\treturn a.nodeId === b.nodeId;\n\t}\n\tif (isGapCursor(a) && isGapCursor(b)) {\n\t\treturn a.blockId === b.blockId && a.side === b.side;\n\t}\n\tif (isTextSelection(a) && isTextSelection(b)) {\n\t\treturn (\n\t\t\ta.anchor.blockId === b.anchor.blockId &&\n\t\t\ta.anchor.offset === b.anchor.offset &&\n\t\t\ta.head.blockId === b.head.blockId &&\n\t\t\ta.head.offset === b.head.offset\n\t\t);\n\t}\n\treturn false;\n}\n\n/** Creates a Position, optionally with a path. */\nexport function createPosition(\n\tblockId: BlockId,\n\toffset: number,\n\tpath?: readonly BlockId[],\n): Position {\n\treturn path ? { blockId, offset, path } : { blockId, offset };\n}\n\n/** Creates a selection with distinct anchor and head. */\nexport function createSelection(anchor: Position, head: Position): Selection {\n\treturn { anchor, head };\n}\n\n/** Creates a collapsed selection (cursor) at the given position. */\nexport function createCollapsedSelection(blockId: BlockId, offset: number): Selection {\n\tconst pos: Position = { blockId, offset };\n\treturn { anchor: pos, head: pos };\n}\n\n/** Returns true if the selection is collapsed (cursor with no range). NodeSelection and GapCursor are never collapsed. */\nexport function isCollapsed(sel: EditorSelection): boolean {\n\tif (!isTextSelection(sel)) return false;\n\treturn sel.anchor.blockId === sel.head.blockId && sel.anchor.offset === sel.head.offset;\n}\n\n/**\n * Returns true if the selection direction is forward (anchor before head).\n * When anchor and head are in the same block, compares offsets.\n * Cross-block ordering uses document order (not determinable here — caller provides block order).\n * For NodeSelection, always returns true.\n */\nexport function isForward(sel: EditorSelection, blockOrder?: readonly BlockId[]): boolean {\n\tif (!isTextSelection(sel)) return true;\n\tif (sel.anchor.blockId === sel.head.blockId) {\n\t\treturn sel.anchor.offset <= sel.head.offset;\n\t}\n\tif (blockOrder) {\n\t\tconst anchorIdx = blockOrder.indexOf(sel.anchor.blockId);\n\t\tconst headIdx = blockOrder.indexOf(sel.head.blockId);\n\t\treturn anchorIdx <= headIdx;\n\t}\n\treturn true;\n}\n\n/**\n * Returns a normalized range where `from` is always before `to`.\n * Throws for NodeSelection — use isNodeSelection() guard first.\n */\nexport function selectionRange(sel: Selection, blockOrder?: readonly BlockId[]): SelectionRange {\n\tif (isForward(sel, blockOrder)) {\n\t\treturn { from: sel.anchor, to: sel.head };\n\t}\n\treturn { from: sel.head, to: sel.anchor };\n}\n"],"mappings":"AA2CA,SAAgB,EAAoB,EAAiB,GACpD,MAAO,CAAE,KAAM,OAAQ,SAAQ,OAChC,CAGA,SAAgB,EACf,EACA,EACA,GAEA,MAAO,CAAE,KAAM,MAAO,OAAM,UAAS,OACtC,CAGA,SAAgB,EAAgB,GAC/B,MAAO,SAAU,GAAoB,SAAb,EAAI,IAC7B,CAGA,SAAgB,EAAY,GAC3B,MAAO,SAAU,GAAoB,QAAb,EAAI,IAC7B,CAGA,SAAgB,EAAgB,GAC/B,QAAS,SAAU,EACpB,CAGA,SAAgB,EAAgB,EAAoB,GACnD,OAAI,EAAgB,IAAM,EAAgB,GAClC,EAAE,SAAW,EAAE,OAEnB,EAAY,IAAM,EAAY,GAC1B,EAAE,UAAY,EAAE,SAAW,EAAE,OAAS,EAAE,QAE5C,EAAgB,KAAM,EAAgB,KAExC,EAAE,OAAO,UAAY,EAAE,OAAO,SAC9B,EAAE,OAAO,SAAW,EAAE,OAAO,QAC7B,EAAE,KAAK,UAAY,EAAE,KAAK,SAC1B,EAAE,KAAK,SAAW,EAAE,KAAK,MAI5B,CAGA,SAAgB,EACf,EACA,EACA,GAEA,OAAO,EAAO,CAAE,UAAS,SAAQ,QAAS,CAAE,UAAS,SACtD,CAGA,SAAgB,EAAgB,EAAkB,GACjD,MAAO,CAAE,SAAQ,OAClB,CAGA,SAAgB,EAAyB,EAAkB,GAC1D,MAAM,EAAgB,CAAE,UAAS,UACjC,MAAO,CAAE,OAAQ,EAAK,KAAM,EAC7B,CAGA,SAAgB,EAAY,GAC3B,QAAK,EAAgB,IACd,EAAI,OAAO,UAAY,EAAI,KAAK,SAAW,EAAI,OAAO,SAAW,EAAI,KAAK,MAClF,CAQA,SAAgB,EAAU,EAAsB,GAC/C,OAAK,EAAgB,KACjB,EAAI,OAAO,UAAY,EAAI,KAAK,QAC5B,EAAI,OAAO,QAAU,EAAI,KAAK,QAElC,GACe,EAAW,QAAQ,EAAI,OAAO,UAChC,EAAW,QAAQ,EAAI,KAAK,SAI9C,CAMA,SAAgB,EAAe,EAAgB,GAC9C,OAAI,EAAU,EAAK,GACX,CAAE,KAAM,EAAI,OAAQ,GAAI,EAAI,MAE7B,CAAE,KAAM,EAAI,KAAM,GAAI,EAAI,OAClC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as t,c as e,i as n,l as o}from"./Selection-HYoVFpAx.mjs";import{t as r}from"./TypeBrands-Ch9856Gb.mjs";import{r as f,t as s}from"./DomUtils-Bf7JLFlx.mjs";function c(t){return t instanceof HTMLElement&&"false"===t.getAttribute("contenteditable")}function i(t){return t instanceof HTMLElement&&t.hasAttribute("data-widget")}function d(){return window.getSelection()}function u(t,e){const n=t.getRootNode();if(!(n instanceof ShadowRoot))return null;if(!("getComposedRanges"in e))return null;let o;try{o=e.getComposedRanges({shadowRoots:[n]})}catch{try{o=e.getComposedRanges(n)}catch{return null}}const r=o[0];if(!r)return null;const f="direction"in e&&"backward"===e.direction;return{anchorNode:f?r.endContainer:r.startContainer,anchorOffset:f?r.endOffset:r.startOffset,focusNode:f?r.startContainer:r.endContainer,focusOffset:f?r.startOffset:r.endOffset}}function a(t,e){const n=u(t,e);if(n)return n;const o=e.anchorNode;if(!o)return null;const r=e.focusNode;return r?{anchorNode:o,anchorOffset:e.anchorOffset,focusNode:r,focusOffset:e.focusOffset}:null}function l(t,n){const r=d();if(!r)return;if(e(n))return void r.removeAllRanges();if(o(n)){const e=t.querySelector(`[data-block-id="${n.nodeId}"]`);if(!e)return;const o=e.parentNode;if(!o)return;const f=m(o,e);try{r.setBaseAndExtent(o,f,o,f+1)}catch{}return}const f=h(t,n.anchor),s=h(t,n.head);if(f&&s)try{r.setBaseAndExtent(f.node,f.offset,s.node,s.offset)}catch{}}function N(e){const n=d();if(!n||0===n.rangeCount)return null;const o=a(e,n);if(!o)return null;if(!e.contains(o.anchorNode)||!e.contains(o.focusNode))return null;const r=T(e,o.anchorNode,o.anchorOffset),f=T(e,o.focusNode,o.focusOffset);return r&&f?t(r,f):null}function h(t,e){let n=null;if(e.path&&e.path.length>0){let o=t;for(const t of e.path){const e=o.querySelector(`:scope [data-block-id="${t}"]`);if(!e)break;o=e}o!==t&&o.getAttribute("data-block-id")===e.blockId&&(n=o)}if(n??=t.querySelector(`[data-block-id="${e.blockId}"]`),!n)return null;const o=p(n),r=function(t){let e=null;for(const n of Array.from(t.childNodes))if(!i(n)){if(e)return null;if("BR"!==n.nodeName)return null;e=n}return e}(o);if(r)return{node:o,offset:m(o,r)};let f=e.offset;const s=E(o);let d=s.nextNode();for(;d;){if(d.nodeType===Node.TEXT_NODE){const t=d.textContent?.length??0;if(f<=t)return{node:d,offset:f};f-=t}else if(c(d)){if(0===f){const t=d.parentNode;if(t)return{node:t,offset:m(t,d)}}f-=1}d=s.nextNode()}const u=o.lastChild;return u?u.nodeType===Node.TEXT_NODE?{node:u,offset:u.textContent?.length??0}:{node:o,offset:o.childNodes.length}:{node:o,offset:0}}function T(t,e,o){const i=f(t,e);if(!i)return null;const d=i.getAttribute("data-block-id");if(!d)return null;const u=r(d),a=s(t,i),l=p(i);if(e===i||e===l){const t=e===l?l:i;let r=0,f=0;for(const e of Array.from(t.childNodes)){if(f>=o)break;r+=g(e),f++}return n(u,r,a.length>1?a:void 0)}if(l!==i&&!l.contains(e))return n(u,0,a.length>1?a:void 0);let N=0;const h=E(l);let T=h.nextNode();for(;T;){if(T===e)return T.nodeType===Node.TEXT_NODE?n(u,N+o,a.length>1?a:void 0):n(u,N,a.length>1?a:void 0);T.nodeType===Node.TEXT_NODE?N+=T.textContent?.length??0:c(T)&&(N+=1),T=h.nextNode()}if(e.nodeType===Node.ELEMENT_NODE){const t=function(t,e){let n=0,o=0;for(const r of Array.from(t.childNodes)){if(o>=e)break;n+=g(r),o++}return n}(e,o),r=function(t,e){let n=0,o=e;for(;o&&o!==t;){const t=o.parentNode;if(!t)return null;for(const e of Array.from(t.childNodes)){if(e===o)break;n+=g(e)}o=t}return o===t?n:null}(l,e);return n(u,null===r?t:r+t,a.length>1?a:void 0)}return n(u,0,a.length>1?a:void 0)}function E(t){return document.createTreeWalker(t,NodeFilter.SHOW_ALL,{acceptNode:e=>e instanceof HTMLElement&&e.hasAttribute("data-cursor-wrapper")||i(e)||function(t,e){let n=t.parentNode;for(;n&&n!==e;){if(c(n))return!0;n=n.parentNode}return!1}(e,t)||e instanceof HTMLElement&&e.hasAttribute("data-block-id")&&e!==t?NodeFilter.FILTER_REJECT:e.nodeType===Node.TEXT_NODE||c(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP})}function m(t,e){let n=0;for(const o of Array.from(t.childNodes)){if(o===e)return n;n++}return n}function p(t){return t.querySelector("[data-content-dom]")??t}function g(t){if(t.nodeType===Node.TEXT_NODE)return t.textContent?.length??0;if(i(t))return 0;if(c(t))return 1;let e=0;for(const n of Array.from(t.childNodes))e+=g(n);return e}export{N as a,a as i,d as n,l as o,u as r,T as t};
|
|
2
|
+
//# sourceMappingURL=SelectionSync-BSHIw1EE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectionSync-BSHIw1EE.mjs","names":[],"sources":["../../src/view/SelectionSync.ts"],"sourcesContent":["/**\n * Selection synchronization between editor state and DOM.\n */\n\nimport type { EditorSelection, Position, Selection } from '../model/Selection.js';\nimport {\n\tcreatePosition,\n\tcreateSelection,\n\tisGapCursor,\n\tisNodeSelection,\n} from '../model/Selection.js';\nimport { blockId as toBlockId } from '../model/TypeBrands.js';\nimport { buildBlockPath, findBlockAncestor } from './DomUtils.js';\n\ninterface DOMPosition {\n\tnode: Node;\n\toffset: number;\n}\n\n/**\n * True when `node` is an InlineNode element — rendered `contenteditable=\"false\"`\n * and counted as width 1 in state offset space.\n */\nfunction isInlineNodeEl(node: Node | null | undefined): node is HTMLElement {\n\treturn node instanceof HTMLElement && node.getAttribute('contenteditable') === 'false';\n}\n\n/**\n * True when `node` is a view-chrome widget (`data-widget`), such as the checklist\n * checkbox marker. Widgets are rendered into the editable DOM for accessibility\n * but are not document content, so they count as zero width in offset space.\n */\nfunction isWidgetEl(node: Node | null | undefined): node is HTMLElement {\n\treturn node instanceof HTMLElement && node.hasAttribute('data-widget');\n}\n\n/**\n * Returns the lone `<br>` placeholder of an empty block, ignoring view-chrome\n * widgets. Returns null when the block holds real inline content.\n */\nfunction findPlaceholderBr(contentEl: Element): Node | null {\n\tlet br: Node | null = null;\n\tfor (const child of Array.from(contentEl.childNodes)) {\n\t\tif (isWidgetEl(child)) continue;\n\t\tif (br) return null;\n\t\tif (child.nodeName === 'BR') {\n\t\t\tbr = child;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn br;\n}\n\n/** Gets the selection object for writing (collapse, setBaseAndExtent). */\nexport function getSelection(): globalThis.Selection | null {\n\treturn window.getSelection();\n}\n\n/**\n * Endpoints returned by reading selection via getComposedRanges().\n * Used to correctly read selection inside Shadow DOM on Safari 17+,\n * Chrome 137+, and Firefox 142+.\n */\nexport interface SelectionEndpoints {\n\tanchorNode: Node;\n\tanchorOffset: number;\n\tfocusNode: Node;\n\tfocusOffset: number;\n}\n\n/**\n * Reads the selection endpoints using getComposedRanges() when inside a\n * Shadow DOM. Returns null if not in a shadow root or the API is unavailable.\n *\n * Handles two call signatures:\n * - Modern (Chrome 137+, Firefox 142+): sel.getComposedRanges({ shadowRoots: [root] })\n * - Legacy (Safari 17+): sel.getComposedRanges(root)\n *\n * StaticRange always uses document order. When `Selection.direction` is\n * `\"backward\"`, anchor/focus are swapped to reconstruct the correct\n * directional endpoints. When direction is `\"none\"` or absent the\n * forward (document-order) mapping is used.\n *\n * Note: Safari 17–18 supports getComposedRanges but not\n * Selection.direction — backward selections will be read as forward.\n */\nexport function readComposedSelection(\n\tcontainer: HTMLElement,\n\tsel: globalThis.Selection,\n): SelectionEndpoints | null {\n\tconst root = container.getRootNode();\n\tif (!(root instanceof ShadowRoot)) return null;\n\tif (!('getComposedRanges' in sel)) return null;\n\n\tlet ranges: StaticRange[];\n\ttry {\n\t\t// Modern syntax (Chrome 137+, Firefox 142+)\n\t\tranges = (\n\t\t\tsel as unknown as {\n\t\t\t\tgetComposedRanges(opts: { shadowRoots: ShadowRoot[] }): StaticRange[];\n\t\t\t}\n\t\t).getComposedRanges({ shadowRoots: [root] });\n\t} catch {\n\t\ttry {\n\t\t\t// Legacy syntax (Safari 17+)\n\t\t\tranges = (\n\t\t\t\tsel as unknown as {\n\t\t\t\t\tgetComposedRanges(...roots: ShadowRoot[]): StaticRange[];\n\t\t\t\t}\n\t\t\t).getComposedRanges(root);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tconst range = ranges[0];\n\tif (!range) return null;\n\n\tconst isBackward: boolean =\n\t\t'direction' in sel && (sel as unknown as { direction: string }).direction === 'backward';\n\n\treturn {\n\t\tanchorNode: isBackward ? range.endContainer : range.startContainer,\n\t\tanchorOffset: isBackward ? range.endOffset : range.startOffset,\n\t\tfocusNode: isBackward ? range.startContainer : range.endContainer,\n\t\tfocusOffset: isBackward ? range.startOffset : range.endOffset,\n\t};\n}\n\n/**\n * Reads the DOM selection endpoints, preferring `getComposedRanges()` when\n * the container is inside a Shadow DOM.\n *\n * Returns `null` when `anchorNode` is unavailable (no selection).\n *\n * In Shadow DOM mode the endpoints come from a `StaticRange` which uses\n * document order. `Selection.direction` is used to reconstruct anchor/focus\n * for backward selections.\n */\nexport function readDOMSelectionEndpoints(\n\tcontainer: HTMLElement,\n\tdomSel: globalThis.Selection,\n): SelectionEndpoints | null {\n\tconst composed: SelectionEndpoints | null = readComposedSelection(container, domSel);\n\tif (composed) return composed;\n\n\tconst anchorNode: Node | null = domSel.anchorNode;\n\tif (!anchorNode) return null;\n\tconst focusNode: Node | null = domSel.focusNode;\n\tif (!focusNode) return null;\n\n\treturn {\n\t\tanchorNode,\n\t\tanchorOffset: domSel.anchorOffset,\n\t\tfocusNode,\n\t\tfocusOffset: domSel.focusOffset,\n\t};\n}\n\n/** Syncs the editor state selection to the DOM. */\nexport function syncSelectionToDOM(container: HTMLElement, selection: EditorSelection): void {\n\tconst domSel = getSelection();\n\tif (!domSel) return;\n\n\t// GapCursor: clear browser selection (gap cursor has no DOM equivalent)\n\tif (isGapCursor(selection)) {\n\t\tdomSel.removeAllRanges();\n\t\treturn;\n\t}\n\n\t// NodeSelection: select the entire block element\n\tif (isNodeSelection(selection)) {\n\t\tconst blockEl = container.querySelector(`[data-block-id=\"${selection.nodeId}\"]`);\n\t\tif (!blockEl) return;\n\t\tconst parent = blockEl.parentNode;\n\t\tif (!parent) return;\n\t\tconst childIdx = childIndexOf(parent, blockEl);\n\t\ttry {\n\t\t\tdomSel.setBaseAndExtent(parent, childIdx, parent, childIdx + 1);\n\t\t} catch {\n\t\t\t// Selection may fail if DOM is not yet rendered\n\t\t}\n\t\treturn;\n\t}\n\n\tconst anchorPos = statePositionToDOM(container, selection.anchor);\n\tconst headPos = statePositionToDOM(container, selection.head);\n\n\tif (!anchorPos || !headPos) return;\n\n\ttry {\n\t\tdomSel.setBaseAndExtent(anchorPos.node, anchorPos.offset, headPos.node, headPos.offset);\n\t} catch {\n\t\t// Selection may fail if DOM is not yet rendered\n\t}\n}\n\n/** Reads the current DOM selection and converts it to a state selection. */\nexport function readSelectionFromDOM(container: HTMLElement): Selection | null {\n\tconst domSel = getSelection();\n\tif (!domSel || domSel.rangeCount === 0) return null;\n\n\tconst endpoints: SelectionEndpoints | null = readDOMSelectionEndpoints(container, domSel);\n\tif (!endpoints) return null;\n\n\tif (!container.contains(endpoints.anchorNode) || !container.contains(endpoints.focusNode)) {\n\t\treturn null;\n\t}\n\n\tconst anchor = domPositionToState(container, endpoints.anchorNode, endpoints.anchorOffset);\n\tconst head = domPositionToState(container, endpoints.focusNode, endpoints.focusOffset);\n\n\tif (!anchor || !head) return null;\n\n\treturn createSelection(anchor, head);\n}\n\n/** Converts a state position (blockId + offset) to a DOM position (node + offset). */\nfunction statePositionToDOM(container: HTMLElement, pos: Position): DOMPosition | null {\n\t// If path is available, navigate directly to the leaf block\n\tlet blockEl: Element | null = null;\n\tif (pos.path && pos.path.length > 0) {\n\t\tlet current: Element = container;\n\t\tfor (const id of pos.path) {\n\t\t\tconst found = current.querySelector(`:scope [data-block-id=\"${id}\"]`);\n\t\t\tif (!found) break;\n\t\t\tcurrent = found;\n\t\t}\n\t\tif (current !== container && current.getAttribute('data-block-id') === pos.blockId) {\n\t\t\tblockEl = current;\n\t\t}\n\t}\n\tblockEl ??= container.querySelector(`[data-block-id=\"${pos.blockId}\"]`);\n\tif (!blockEl) return null;\n\n\t// Use contentDOM if available (NodeView blocks like code_block)\n\tconst contentEl: Element = resolveContentRoot(blockEl);\n\n\t// Handle empty blocks rendered as a single <br> placeholder. View-chrome\n\t// widgets (e.g. the checklist marker) are ignored, so the caret lands after\n\t// the widget and before the <br> rather than at the very start of the block.\n\tconst placeholderBr = findPlaceholderBr(contentEl);\n\tif (placeholderBr) {\n\t\treturn { node: contentEl, offset: childIndexOf(contentEl, placeholderBr) };\n\t}\n\n\t// Walk through text nodes and inline elements to find the correct position\n\tlet remaining = pos.offset;\n\tconst walker = createInlineContentWalker(contentEl);\n\n\tlet current = walker.nextNode();\n\twhile (current) {\n\t\tif (current.nodeType === Node.TEXT_NODE) {\n\t\t\tconst len = current.textContent?.length ?? 0;\n\t\t\tif (remaining <= len) {\n\t\t\t\treturn { node: current, offset: remaining };\n\t\t\t}\n\t\t\tremaining -= len;\n\t\t} else if (isInlineNodeEl(current)) {\n\t\t\t// InlineNode element — width 1 in state offset space\n\t\t\tif (remaining === 0) {\n\t\t\t\t// Position before this inline element\n\t\t\t\tconst parent = current.parentNode;\n\t\t\t\tif (parent) {\n\t\t\t\t\tconst childIndex = childIndexOf(parent, current);\n\t\t\t\t\treturn { node: parent, offset: childIndex };\n\t\t\t\t}\n\t\t\t}\n\t\t\tremaining -= 1;\n\t\t}\n\t\tcurrent = walker.nextNode();\n\t}\n\n\t// Fallback: position at end of block\n\tconst lastChild = contentEl.lastChild;\n\tif (lastChild) {\n\t\tif (lastChild.nodeType === Node.TEXT_NODE) {\n\t\t\treturn { node: lastChild, offset: lastChild.textContent?.length ?? 0 };\n\t\t}\n\t\treturn { node: contentEl, offset: contentEl.childNodes.length };\n\t}\n\n\treturn { node: contentEl, offset: 0 };\n}\n\n/** Converts a DOM position to a state position, including nested path. */\nexport function domPositionToState(\n\tcontainer: HTMLElement,\n\tnode: Node,\n\tdomOffset: number,\n): Position | null {\n\t// Find the innermost block element\n\tconst blockEl = findBlockAncestor(container, node);\n\tif (!blockEl) return null;\n\n\tconst rawBlockId = blockEl.getAttribute('data-block-id');\n\tif (!rawBlockId) return null;\n\tconst bid = toBlockId(rawBlockId);\n\n\t// Build path by collecting all data-block-id ancestors from leaf to root\n\tconst path = buildBlockPath(container, blockEl);\n\n\t// Use contentDOM if available (NodeView blocks like code_block)\n\tconst contentEl: Element = resolveContentRoot(blockEl);\n\n\t// Handle clicks on the block or content element itself (e.g. empty paragraph with <br>)\n\tif (node === blockEl || node === contentEl) {\n\t\tconst targetEl: Element = node === contentEl ? contentEl : blockEl;\n\t\tlet childOffset = 0;\n\t\tlet childIdx = 0;\n\t\tfor (const child of Array.from(targetEl.childNodes)) {\n\t\t\tif (childIdx >= domOffset) break;\n\t\t\tchildOffset += inlineContentWidth(child);\n\t\t\tchildIdx++;\n\t\t}\n\t\treturn createPosition(bid, childOffset, path.length > 1 ? path : undefined);\n\t}\n\n\t// If node is outside the contentDOM (e.g. in NodeView header), map to offset 0\n\tif (contentEl !== blockEl && !contentEl.contains(node)) {\n\t\treturn createPosition(bid, 0, path.length > 1 ? path : undefined);\n\t}\n\n\t// Calculate offset by walking text nodes and inline elements\n\tlet offset = 0;\n\tconst walker = createInlineContentWalker(contentEl);\n\n\tlet walkerNode = walker.nextNode();\n\twhile (walkerNode) {\n\t\tif (walkerNode === node) {\n\t\t\tif (walkerNode.nodeType === Node.TEXT_NODE) {\n\t\t\t\treturn createPosition(bid, offset + domOffset, path.length > 1 ? path : undefined);\n\t\t\t}\n\t\t\t// Node is an inline element — return offset at its start\n\t\t\treturn createPosition(bid, offset, path.length > 1 ? path : undefined);\n\t\t}\n\t\tif (walkerNode.nodeType === Node.TEXT_NODE) {\n\t\t\toffset += walkerNode.textContent?.length ?? 0;\n\t\t} else if (isInlineNodeEl(walkerNode)) {\n\t\t\toffset += 1;\n\t\t}\n\t\twalkerNode = walker.nextNode();\n\t}\n\n\t// If the node is not a text node, try to find the offset from element context\n\tif (node.nodeType === Node.ELEMENT_NODE) {\n\t\tconst childOffset = inlineOffsetForChildIndex(node, domOffset);\n\t\tconst offsetBeforeNode = inlineOffsetBeforeNode(contentEl, node);\n\t\tconst totalOffset = offsetBeforeNode === null ? childOffset : offsetBeforeNode + childOffset;\n\t\treturn createPosition(bid, totalOffset, path.length > 1 ? path : undefined);\n\t}\n\n\treturn createPosition(bid, 0, path.length > 1 ? path : undefined);\n}\n\n/** Counts inline width for the first `childIndex` children of an element. */\nfunction inlineOffsetForChildIndex(node: Node, childIndex: number): number {\n\tlet childOffset = 0;\n\tlet childIdx = 0;\n\tfor (const child of Array.from(node.childNodes)) {\n\t\tif (childIdx >= childIndex) break;\n\t\tchildOffset += inlineContentWidth(child);\n\t\tchildIdx++;\n\t}\n\treturn childOffset;\n}\n\n/** Returns the inline offset from `root` to the start of `node`, or null when unrelated. */\nfunction inlineOffsetBeforeNode(root: Element, node: Node): number | null {\n\tlet offset = 0;\n\tlet current: Node | null = node;\n\n\twhile (current && current !== root) {\n\t\tconst parent: Node | null = current.parentNode;\n\t\tif (!parent) return null;\n\n\t\tfor (const sibling of Array.from(parent.childNodes) as Node[]) {\n\t\t\tif (sibling === current) break;\n\t\t\toffset += inlineContentWidth(sibling);\n\t\t}\n\n\t\tcurrent = parent;\n\t}\n\n\treturn current === root ? offset : null;\n}\n\n/** Checks if a node is inside a contentEditable=\"false\" inline element. */\nfunction isInsideInlineElement(node: Node, root: Element): boolean {\n\tlet parent: Node | null = node.parentNode;\n\twhile (parent && parent !== root) {\n\t\tif (isInlineNodeEl(parent)) {\n\t\t\treturn true;\n\t\t}\n\t\tparent = parent.parentNode;\n\t}\n\treturn false;\n}\n\n/**\n * Creates a TreeWalker that visits text nodes and contentEditable=\"false\"\n * inline elements within a block, skipping mark wrappers and nested blocks.\n */\nfunction createInlineContentWalker(blockEl: Element): TreeWalker {\n\treturn document.createTreeWalker(blockEl, NodeFilter.SHOW_ALL, {\n\t\tacceptNode: (n: Node) => {\n\t\t\t// Skip cursor wrapper (ZWS for stored marks during IME composition)\n\t\t\tif (n instanceof HTMLElement && n.hasAttribute('data-cursor-wrapper')) {\n\t\t\t\treturn NodeFilter.FILTER_REJECT;\n\t\t\t}\n\t\t\t// Skip view-chrome widgets (e.g. the checklist checkbox marker). They are\n\t\t\t// contentEditable=\"false\" but not document content, so they carry zero\n\t\t\t// width in offset space and must never become a caret position.\n\t\t\tif (isWidgetEl(n)) return NodeFilter.FILTER_REJECT;\n\t\t\t// Skip anything inside an inline element (contentEditable=\"false\")\n\t\t\tif (isInsideInlineElement(n, blockEl)) return NodeFilter.FILTER_REJECT;\n\t\t\t// Skip nested block elements and their descendants\n\t\t\tif (n instanceof HTMLElement && n.hasAttribute('data-block-id') && n !== blockEl) {\n\t\t\t\treturn NodeFilter.FILTER_REJECT;\n\t\t\t}\n\t\t\t// Accept text nodes\n\t\t\tif (n.nodeType === Node.TEXT_NODE) return NodeFilter.FILTER_ACCEPT;\n\t\t\t// Accept inline elements (contentEditable=\"false\")\n\t\t\tif (isInlineNodeEl(n)) {\n\t\t\t\treturn NodeFilter.FILTER_ACCEPT;\n\t\t\t}\n\t\t\t// Skip other elements (mark wrappers, decoration wrappers) — descend\n\t\t\treturn NodeFilter.FILTER_SKIP;\n\t\t},\n\t});\n}\n\n/** Returns the child index of a node within its parent. */\nfunction childIndexOf(parent: Node, child: Node): number {\n\tlet idx = 0;\n\tfor (const c of Array.from(parent.childNodes)) {\n\t\tif (c === child) return idx;\n\t\tidx++;\n\t}\n\treturn idx;\n}\n\n/**\n * Resolves the content root for inline content walking.\n * If the block element has a contentDOM (marked with data-content-dom),\n * returns it so the walker skips NodeView structural elements (headers, etc.).\n */\nfunction resolveContentRoot(blockEl: Element): Element {\n\tconst contentDOM: Element | null = blockEl.querySelector('[data-content-dom]');\n\treturn contentDOM ?? blockEl;\n}\n\n/** Counts the inline content width of a DOM node (text length + 1 per inline element). */\nfunction inlineContentWidth(node: Node): number {\n\tif (node.nodeType === Node.TEXT_NODE) {\n\t\treturn node.textContent?.length ?? 0;\n\t}\n\t// View-chrome widgets (e.g. the checklist marker) are not document content.\n\tif (isWidgetEl(node)) {\n\t\treturn 0;\n\t}\n\tif (isInlineNodeEl(node)) {\n\t\treturn 1;\n\t}\n\t// Mark wrapper or other element — sum children\n\tlet width = 0;\n\tfor (const child of Array.from(node.childNodes)) {\n\t\twidth += inlineContentWidth(child);\n\t}\n\treturn width;\n}\n"],"mappings":"mKAuBA,SAAS,EAAe,GACvB,OAAO,aAAgB,aAAwD,UAAzC,EAAK,aAAa,kBACzD,CAOA,SAAS,EAAW,GACnB,OAAO,aAAgB,aAAe,EAAK,aAAa,cACzD,CAqBA,SAAgB,IACf,OAAO,OAAO,cACf,CA8BA,SAAgB,EACf,EACA,GAEA,MAAM,EAAO,EAAU,cACvB,KAAM,aAAgB,YAAa,OAAO,KAC1C,KAAM,sBAAuB,GAAM,OAAO,KAE1C,IAAI,EACJ,IAEC,EACC,EAGC,kBAAkB,CAAE,YAAa,CAAC,IACrC,CAAA,MACC,IAEC,EACC,E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c,uBACpC,CACtB,CAGA,SAAS,EAAmB,GAC3B,GAAI,EAAK,WAAa,KAAK,UAC1B,OAAO,EAAK,aAAa,QAAU,EAGpC,GAAI,EAAW,GACd,OAAO,EAER,GAAI,EAAe,GAClB,OAAO,EAGR,IAAI,EAAQ,EACZ,IAAK,MAAM,KAAS,MAAM,KAAK,EAAK,YACnC,GAAS,EAAmB,GAE7B,OAAO,CACR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShortcutFormatting-TwiufqeV.mjs","names":[],"sources":["../../src/plugins/shared/ShortcutFormatting.ts"],"sourcesContent":["import { isMac } from '../../platform/Platform.js';\n\n/**\n * Formats a keymap binding string into a human-readable shortcut,\n * using platform-appropriate modifier symbols (⌘ on Mac, Ctrl on others).\n *\n * @example formatShortcut('Mod-B') → \"Ctrl+B\" or \"⌘B\"\n * @example formatShortcut('Mod-Shift-X') → \"Ctrl+Shift+X\" or \"⌘⇧X\"\n */\nexport function formatShortcut(binding: string): string {\n\tif (isMac()) {\n\t\treturn binding\n\t\t\t.replace(/Mod/g, '⌘')\n\t\t\t.replace(/Shift/g, '⇧')\n\t\t\t.replace(/Alt/g, '⌥')\n\t\t\t.replace(/-/g, '');\n\t}\n\treturn binding.replace(/Mod/g, 'Ctrl').replace(/-/g, '+');\n}\n"],"mappings":"4CASA,SAAgB,EAAe,GAC9B,OAAI,IACI,EACL,QAAQ,OAAQ,KAChB,QAAQ,SAAU,KAClB,QAAQ,OAAQ,KAChB,QAAQ,KAAM,IAEV,EAAQ,QAAQ,OAAQ,QAAQ,QAAQ,KAAM,IACtD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as o,m as r}from"./Commands-CyT1Li7_.mjs";import{i as e}from"./TypeBrands-Ch9856Gb.mjs";import{n as m}from"./PluginHelpers-D4quRJ5a.mjs";function t(t,a){const i=e(a.markSpec.type);t.registerMarkSpec(a.markSpec),t.registerCommand(a.command,()=>m(t,o(t.getState(),i))),a.keyBinding&&t.registerKeymap({[a.keyBinding]:()=>t.executeCommand(a.command)}),a.toolbar&&t.registerToolbarItem({id:a.toolbar.id,group:a.toolbar.group,icon:a.toolbar.icon,label:a.toolbar.label,tooltip:a.toolbar.tooltip,command:a.command,isActive:o=>r(o,i)})}export{t};
|
|
2
|
+
//# sourceMappingURL=SimpleMark-Db8ir_z2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleMark-Db8ir_z2.mjs","names":[],"sources":["../../src/plugins/shared/SimpleMark.ts"],"sourcesContent":["/**\n * Registers the common core of a simple toggle mark: its MarkSpec, a toggle\n * command, an optional keyboard shortcut, and an optional toolbar button.\n *\n * Plugins that need more (input rules, exclusivity middleware, config-driven\n * variants) layer those on top after calling this — it deliberately models only\n * the shared core, not every mark plugin.\n */\n\nimport { isMarkActive, toggleMark } from '../../commands/Commands.js';\nimport type { MarkSpec } from '../../model/MarkSpec.js';\nimport { markType } from '../../model/TypeBrands.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { dispatchIfPresent } from './PluginHelpers.js';\n\nexport interface SimpleMarkToolbar {\n\treadonly id: string;\n\treadonly group: string;\n\treadonly icon: string;\n\treadonly label: string;\n\treadonly tooltip: string;\n}\n\nexport interface SimpleMarkDefinition {\n\t/** The mark spec to register (defines DOM/HTML rendering and parsing). */\n\treadonly markSpec: MarkSpec;\n\t/** Toggle command name, e.g. `'toggleStrikethrough'`. */\n\treadonly command: string;\n\t/** Keyboard shortcut bound to the command; omit or `null` to skip. */\n\treadonly keyBinding?: string | null;\n\t/** Toolbar button; omit to skip. */\n\treadonly toolbar?: SimpleMarkToolbar;\n}\n\n/** Registers a simple toggle mark's spec, command, keymap, and toolbar item. */\nexport function registerSimpleMark(context: PluginContext, def: SimpleMarkDefinition): void {\n\tconst type = markType(def.markSpec.type);\n\n\tcontext.registerMarkSpec(def.markSpec);\n\n\tcontext.registerCommand(def.command, () =>\n\t\tdispatchIfPresent(context, toggleMark(context.getState(), type)),\n\t);\n\n\tif (def.keyBinding) {\n\t\tcontext.registerKeymap({ [def.keyBinding]: () => context.executeCommand(def.command) });\n\t}\n\n\tif (def.toolbar) {\n\t\tcontext.registerToolbarItem({\n\t\t\tid: def.toolbar.id,\n\t\t\tgroup: def.toolbar.group,\n\t\t\ticon: def.toolbar.icon,\n\t\t\tlabel: def.toolbar.label,\n\t\t\ttooltip: def.toolbar.tooltip,\n\t\t\tcommand: def.command,\n\t\t\tisActive: (state) => isMarkActive(state, type),\n\t\t});\n\t}\n}\n"],"mappings":"kJAmCA,SAAgB,EAAmB,EAAwB,GAC1D,MAAM,EAAO,EAAS,EAAI,SAAS,MAEnC,EAAQ,iBAAiB,EAAI,UAE7B,EAAQ,gBAAgB,EAAI,QAAA,IAC3B,EAAkB,EAAS,EAAW,EAAQ,WAAY,KAGvD,EAAI,YACP,EAAQ,eAAe,CAAA,CAAG,EAAI,YAAA,IAAmB,EAAQ,eAAe,EAAI,WAGzE,EAAI,SACP,EAAQ,oBAAoB,CAC3B,GAAI,EAAI,QAAQ,GAChB,MAAO,EAAI,QAAQ,MACnB,KAAM,EAAI,QAAQ,KAClB,MAAO,EAAI,QAAQ,MACnB,QAAS,EAAI,QAAQ,QACrB,QAAS,EAAI,QACb,SAAW,GAAU,EAAa,EAAO,IAG5C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as t,i as e,u as n}from"./Document-r7vLOAGA.mjs";import{c as o,o as s,t as c,u as r}from"./Selection-HYoVFpAx.mjs";import{t as a}from"./Commands-CyT1Li7_.mjs";import{a as i}from"./TypeBrands-Ch9856Gb.mjs";import{a as l,d,o as u,p as h,u as m}from"./BlockInsertion-6rR9tIGP.mjs";import{n as g}from"./TypedKeys-CA4bfw9O.mjs";import{a as f,s as p}from"./PluginHelpers-D4quRJ5a.mjs";import{l as x}from"./XmlDetector-D7TQpw-e.mjs";var k=/\n(?:[ \t]*\n)+/;function C(t,e){return!t.detection&&!e.detection||!(!t.detection||!e.detection)&&t.detection.language===e.detection.language}function b(t,e){const n=`${t.text}\n\n${e.text}`;if(!t.detection&&!e.detection)return{text:n,detection:null};const o=t.detection,s=e.detection;return{text:n,detection:{language:o.language,formattedText:`${o.formattedText}\n\n${s.formattedText}`,confidence:Math.max(o.confidence,s.confidence)}}}var j={detectedAsCodeBlock:t=>`Pasted as ${t} code block with syntax highlighting.`,detectedMixedContent:(t,e,n)=>{const o=[];if(t>0&&o.push(`${t} paragraph${t>1?"s":""}`),e>0){const t=n.join(", ");o.push(`${e} code block${e>1?"s":""} (${t})`)}return`Pasted as ${o.join(" and ")}.`}},B=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-BWOue6jG.mjs"),"./locales/de.ts":()=>import("./de-CTzAMkXC.mjs"),"./locales/es.ts":()=>import("./es-DDoqchUq.mjs"),"./locales/fr.ts":()=>import("./fr-eC0UdAPu.mjs"),"./locales/hi.ts":()=>import("./hi-DY55FuDK.mjs"),"./locales/pt.ts":()=>import("./pt-Bu7Mbz67.mjs"),"./locales/ru.ts":()=>import("./ru-DyCTlhjg.mjs"),"./locales/zh.ts":()=>import("./zh-D1HSmSOf.mjs")});async function y(t){return p(B,t,j)}var T=new g("smartPaste"),P=class{id="smart-paste";name="Smart Paste";dependencies=["code-block"];config;detectors=[];context=null;locale=j;constructor(t){this.config={...t}}async init(t){this.context=t,this.locale=await f(t,this.config.locale,j,y);const e=t.getService(x);if(e&&e.onRegister(t=>{t.detection&&this.detectors.push(t.detection)}),this.config.detectors)for(const n of this.config.detectors)this.detectors.push(n);t.registerPasteInterceptor(this.handlePaste,{name:"smart-paste",priority:50}),t.registerService(T,{registerDetector:t=>{this.detectors.push(t)}})}destroy(){this.context=null,this.detectors.length=0}handlePaste=(t,e,n)=>{if(this.isCursorInCodeBlock(n))return null;const o=function(t,e){const n=t.split(k).map(t=>t.trim()).filter(t=>t.length>0);if(0===n.length)return null;let o=!1;const s=n.map(t=>{const n=function(t,e){let n=null;for(const o of e){const e=o.detect(t);e&&(null===n||e.confidence>n.confidence||e.confidence===n.confidence&&e.language<n.language)&&(n=e)}return n}(t,e);return n&&(o=!0),{text:t,detection:n}});return o?function(t){if(t.length<=1)return t;const e=[t[0]];for(let n=1;n<t.length;n++){const o=t[n],s=e[e.length-1];C(s,o)?e[e.length-1]=b(s,o):e.push(o)}return e}(s):null}(t,this.detectors);return o?1===o.length&&o[0]?.detection?this.handleSingleCodeBlock(n,o[0].detection):this.handleMixedContent(n,o):null};isCursorInCodeBlock(t){const e=t.selection;return!!r(e)&&"code_block"===t.getBlock(e.anchor.blockId)?.type}handleSingleCodeBlock(t,e){const n=this.buildCodeBlockTransaction(t,e);return n&&this.context&&this.context.announce(this.locale.detectedAsCodeBlock(e.language)),n}buildCodeBlockTransaction(o,l){const d=o.selection,h=o.transaction("paste");let g;g=r(d)&&!s(d)?a(o,h)??d.anchor.blockId:m(d);const f=n(),p=e(i("code_block"),[t(l.formattedText)],f,{language:l.language,backgroundColor:""});return u(o,h,g,p,d,this.context?.getSchemaRegistry())?(h.setSelection(c(f,l.formattedText.length)),h.build()):null}handleMixedContent(t,e){const n=this.buildMultiBlockTransaction(t,e);return n&&this.context&&this.announceMixedContent(e),n}buildMultiBlockTransaction(t,e){const n=t.selection,i=t.transaction("paste");let u;u=r(n)&&!s(n)?a(t,i)??n.anchor.blockId:m(n);const g=l(t,u),f=this.context?.getSchemaRegistry(),p=g?d(t,u,g,f):h(t,u,f);if(!p)return null;const x=!g&&o(n)&&"before"===n.side?0:1;let k,C=p.anchorIndex+x,b=0;for(const o of e){const t=o.detection?this.createCodeBlockNode(o.detection):this.createParagraphNode(o.text);i.insertNode(p.parentPath,C,t),C++,k=t.id,b=o.detection?o.detection.formattedText.length:o.text.length}return(g?p.isAnchorEmpty&&p.anchorIndex>=0:p.isAnchorEmpty&&!o(n))&&i.removeNode(p.parentPath,p.anchorIndex),k&&i.setSelection(c(k,b)),i.build()}createCodeBlockNode(o){return e(i("code_block"),[t(o.formattedText)],n(),{language:o.language,backgroundColor:""})}createParagraphNode(o){return e(i("paragraph"),[t(o)],n())}announceMixedContent(t){let e=0,n=0;const o=[];for(const s of t)s.detection?(n++,o.includes(s.detection.language)||o.push(s.detection.language)):e++;this.context?.announce(this.locale.detectedMixedContent(e,n,o))}};export{y as i,T as n,j as r,P as t};
|
|
2
|
+
//# sourceMappingURL=SmartPastePlugin-Db1RcNJf.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SmartPastePlugin-Db1RcNJf.mjs","names":[],"sources":["../../src/plugins/smart-paste/ContentSplitter.ts","../../src/plugins/smart-paste/SmartPasteLocale.ts","../../src/plugins/smart-paste/SmartPasteTypes.ts","../../src/plugins/smart-paste/SmartPastePlugin.ts"],"sourcesContent":["/**\n * Splits pasted text at blank-line boundaries and classifies each segment\n * using content detectors. Adjacent segments of the same type are merged.\n */\n\nimport type { ContentDetector, DetectionResult, PasteSegment } from './SmartPasteTypes.js';\n\n/** Pattern matching one or more consecutive blank lines (may contain whitespace). */\nconst BLANK_LINE_SPLIT: RegExp = /\\n(?:[ \\t]*\\n)+/;\n\n/**\n * Splits text at blank-line boundaries and classifies each segment\n * using the provided detectors. Returns null if no code is detected\n * in any segment (the paste should fall through to default handling).\n */\nexport function splitAndClassify(\n\ttext: string,\n\tdetectors: readonly ContentDetector[],\n): readonly PasteSegment[] | null {\n\tconst rawSegments: readonly string[] = text.split(BLANK_LINE_SPLIT);\n\tconst trimmed: readonly string[] = rawSegments\n\t\t.map((s: string) => s.trim())\n\t\t.filter((s: string) => s.length > 0);\n\n\tif (trimmed.length === 0) return null;\n\n\tlet hasCode = false;\n\tconst segments: PasteSegment[] = trimmed.map((segmentText: string): PasteSegment => {\n\t\tconst detection: DetectionResult | null = detectBest(segmentText, detectors);\n\t\tif (detection) hasCode = true;\n\t\treturn { text: segmentText, detection };\n\t});\n\n\tif (!hasCode) return null;\n\n\treturn mergeAdjacentSegments(segments);\n}\n\n/**\n * Merges adjacent segments that share the same classification:\n * consecutive text segments become one paragraph, consecutive code\n * segments of the same language become one code block.\n */\nexport function mergeAdjacentSegments(segments: readonly PasteSegment[]): readonly PasteSegment[] {\n\tif (segments.length <= 1) return segments;\n\n\tconst merged: PasteSegment[] = [segments[0] as PasteSegment];\n\n\tfor (let i = 1; i < segments.length; i++) {\n\t\tconst current: PasteSegment = segments[i] as PasteSegment;\n\t\tconst previous: PasteSegment = merged[merged.length - 1] as PasteSegment;\n\n\t\tif (canMerge(previous, current)) {\n\t\t\tmerged[merged.length - 1] = merge(previous, current);\n\t\t} else {\n\t\t\tmerged.push(current);\n\t\t}\n\t}\n\n\treturn merged;\n}\n\n/**\n * Picks the highest-confidence detection result from all detectors.\n * Ties are broken deterministically by lexicographic language id so the\n * outcome does not depend on detector registration order.\n */\nfunction detectBest(text: string, detectors: readonly ContentDetector[]): DetectionResult | null {\n\tlet best: DetectionResult | null = null;\n\n\tfor (const detector of detectors) {\n\t\tconst result: DetectionResult | null = detector.detect(text);\n\t\tif (!result) continue;\n\t\tif (\n\t\t\tbest === null ||\n\t\t\tresult.confidence > best.confidence ||\n\t\t\t(result.confidence === best.confidence && result.language < best.language)\n\t\t) {\n\t\t\tbest = result;\n\t\t}\n\t}\n\n\treturn best;\n}\n\n/** Two segments can merge if both are text or both are code of the same language. */\nfunction canMerge(a: PasteSegment, b: PasteSegment): boolean {\n\tif (!a.detection && !b.detection) return true;\n\tif (a.detection && b.detection) return a.detection.language === b.detection.language;\n\treturn false;\n}\n\n/** Merges two compatible segments into one. */\nfunction merge(a: PasteSegment, b: PasteSegment): PasteSegment {\n\tconst joinedText: string = `${a.text}\\n\\n${b.text}`;\n\n\tif (!a.detection && !b.detection) {\n\t\treturn { text: joinedText, detection: null };\n\t}\n\n\tconst detA: DetectionResult = a.detection as DetectionResult;\n\tconst detB: DetectionResult = b.detection as DetectionResult;\n\n\treturn {\n\t\ttext: joinedText,\n\t\tdetection: {\n\t\t\tlanguage: detA.language,\n\t\t\tformattedText: `${detA.formattedText}\\n\\n${detB.formattedText}`,\n\t\t\tconfidence: Math.max(detA.confidence, detB.confidence),\n\t\t},\n\t};\n}\n","/** Locale interface and default English locale for the SmartPastePlugin. */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\nexport interface SmartPasteLocale {\n\treadonly detectedAsCodeBlock: (language: string) => string;\n\treadonly detectedMixedContent: (\n\t\ttextCount: number,\n\t\tcodeCount: number,\n\t\tlanguages: readonly string[],\n\t) => string;\n}\n\nexport const SMART_PASTE_LOCALE_EN: SmartPasteLocale = {\n\tdetectedAsCodeBlock: (language: string) =>\n\t\t`Pasted as ${language} code block with syntax highlighting.`,\n\tdetectedMixedContent: (textCount: number, codeCount: number, languages: readonly string[]) => {\n\t\tconst parts: string[] = [];\n\t\tif (textCount > 0) {\n\t\t\tparts.push(`${textCount} paragraph${textCount > 1 ? 's' : ''}`);\n\t\t}\n\t\tif (codeCount > 0) {\n\t\t\tconst langList: string = languages.join(', ');\n\t\t\tparts.push(`${codeCount} code block${codeCount > 1 ? 's' : ''} (${langList})`);\n\t\t}\n\t\treturn `Pasted as ${parts.join(' and ')}.`;\n\t},\n};\n\nconst localeModules: LocaleModuleMap<SmartPasteLocale> = import.meta.glob<{\n\tdefault: SmartPasteLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadSmartPasteLocale(lang: string): Promise<SmartPasteLocale> {\n\treturn loadLocaleModule(localeModules, lang, SMART_PASTE_LOCALE_EN);\n}\n","/**\n * Types for the smart paste plugin — content detection and formatting.\n */\n\nimport { ServiceKey } from '../Plugin.js';\nimport type { SmartPasteLocale } from './SmartPasteLocale.js';\n\n/** Result of detecting structured content in pasted text. */\nexport interface DetectionResult {\n\treadonly language: string;\n\treadonly formattedText: string;\n\treadonly confidence: number;\n}\n\n/** A classified segment of pasted text — either plain text or detected code. */\nexport interface PasteSegment {\n\treadonly text: string;\n\treadonly detection: DetectionResult | null;\n}\n\n/** Interface for content detectors that identify and format pasted text. */\nexport interface ContentDetector {\n\treadonly id: string;\n\tdetect(text: string): DetectionResult | null;\n}\n\n/** Configuration for the SmartPastePlugin. */\nexport interface SmartPasteConfig {\n\treadonly detectors?: readonly ContentDetector[];\n\treadonly locale?: SmartPasteLocale;\n}\n\n/** Public service for registering additional content detectors at runtime. */\nexport interface SmartPasteService {\n\tregisterDetector(detector: ContentDetector): void;\n}\n\nexport const SMART_PASTE_SERVICE_KEY = new ServiceKey<SmartPasteService>('smartPaste');\n","/**\n * SmartPastePlugin: detects structured content in clipboard text\n * and inserts it as formatted code blocks with syntax highlighting.\n * Mixed content (text + code) is split into separate blocks.\n */\n\nimport {\n\ttype InsertionContext,\n\tfindTableCellAncestor,\n\tinsertBlockAfterAnchor,\n\tresolveAnchorBlockId,\n\tresolveCellInsertionContext,\n\tresolveRootInsertionContext,\n} from '../../commands/BlockInsertion.js';\nimport { addDeleteSelectionSteps } from '../../commands/Commands.js';\nimport {\n\ttype BlockNode,\n\tcreateBlockNode,\n\tcreateTextNode,\n\tgenerateBlockId,\n} from '../../model/Document.js';\nimport {\n\tcreateCollapsedSelection,\n\tisCollapsed,\n\tisGapCursor,\n\tisTextSelection,\n} from '../../model/Selection.js';\nimport type { BlockId, NodeTypeName } from '../../model/TypeBrands.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Transaction } from '../../state/Transaction.js';\nimport type { PasteInterceptor, Plugin, PluginContext } from '../Plugin.js';\nimport { LANGUAGE_REGISTRY_SERVICE_KEY } from '../language/LanguageTypes.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { splitAndClassify } from './ContentSplitter.js';\nimport {\n\tSMART_PASTE_LOCALE_EN,\n\ttype SmartPasteLocale,\n\tloadSmartPasteLocale,\n} from './SmartPasteLocale.js';\nimport type {\n\tContentDetector,\n\tDetectionResult,\n\tPasteSegment,\n\tSmartPasteConfig,\n} from './SmartPasteTypes.js';\nimport { SMART_PASTE_SERVICE_KEY } from './SmartPasteTypes.js';\n\nexport class SmartPastePlugin implements Plugin {\n\treadonly id = 'smart-paste';\n\treadonly name = 'Smart Paste';\n\treadonly dependencies = ['code-block'] as const;\n\n\tprivate readonly config: SmartPasteConfig;\n\tprivate readonly detectors: ContentDetector[] = [];\n\tprivate context: PluginContext | null = null;\n\tprivate locale: SmartPasteLocale = SMART_PASTE_LOCALE_EN;\n\n\tconstructor(config?: Partial<SmartPasteConfig>) {\n\t\tthis.config = { ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.context = context;\n\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tSMART_PASTE_LOCALE_EN,\n\t\t\tloadSmartPasteLocale,\n\t\t);\n\n\t\t// Subscribe to language registry for detectors (replay provides built-ins)\n\t\tconst registry = context.getService(LANGUAGE_REGISTRY_SERVICE_KEY);\n\t\tif (registry) {\n\t\t\tregistry.onRegister((support) => {\n\t\t\t\tif (support.detection) {\n\t\t\t\t\tthis.detectors.push(support.detection);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// Register config-provided detectors\n\t\tif (this.config.detectors) {\n\t\t\tfor (const detector of this.config.detectors) {\n\t\t\t\tthis.detectors.push(detector);\n\t\t\t}\n\t\t}\n\n\t\t// Register paste interceptor\n\t\tcontext.registerPasteInterceptor(this.handlePaste, { name: 'smart-paste', priority: 50 });\n\n\t\t// Register service for external detector registration\n\t\tcontext.registerService(SMART_PASTE_SERVICE_KEY, {\n\t\t\tregisterDetector: (detector: ContentDetector) => {\n\t\t\t\tthis.detectors.push(detector);\n\t\t\t},\n\t\t});\n\t}\n\n\tdestroy(): void {\n\t\tthis.context = null;\n\t\tthis.detectors.length = 0;\n\t}\n\n\t// --- Paste Interceptor ---\n\n\tprivate readonly handlePaste: PasteInterceptor = (\n\t\tplainText: string,\n\t\t_html: string,\n\t\tstate: EditorState,\n\t): Transaction | null => {\n\t\tif (this.isCursorInCodeBlock(state)) return null;\n\n\t\tconst segments: readonly PasteSegment[] | null = splitAndClassify(plainText, this.detectors);\n\t\tif (!segments) return null;\n\n\t\t// Single code-only segment: use existing fast path\n\t\tif (segments.length === 1 && segments[0]?.detection) {\n\t\t\treturn this.handleSingleCodeBlock(state, segments[0].detection);\n\t\t}\n\n\t\t// Mixed content: create multiple blocks\n\t\treturn this.handleMixedContent(state, segments);\n\t};\n\n\tprivate isCursorInCodeBlock(state: EditorState): boolean {\n\t\tconst sel = state.selection;\n\t\tif (!isTextSelection(sel)) return false;\n\n\t\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\t\treturn block?.type === 'code_block';\n\t}\n\n\t// --- Single Code Block (existing behavior) ---\n\n\tprivate handleSingleCodeBlock(\n\t\tstate: EditorState,\n\t\tdetection: DetectionResult,\n\t): Transaction | null {\n\t\tconst tr: Transaction | null = this.buildCodeBlockTransaction(state, detection);\n\t\tif (tr && this.context) {\n\t\t\tthis.context.announce(this.locale.detectedAsCodeBlock(detection.language));\n\t\t}\n\t\treturn tr;\n\t}\n\n\tprivate buildCodeBlockTransaction(\n\t\tstate: EditorState,\n\t\tdetection: DetectionResult,\n\t): Transaction | null {\n\t\tconst sel = state.selection;\n\t\tconst builder = state.transaction('paste');\n\n\t\t// Delete selection if range-selected\n\t\tlet anchorBlockId: BlockId;\n\t\tif (isTextSelection(sel) && !isCollapsed(sel)) {\n\t\t\tconst landingId: BlockId | undefined = addDeleteSelectionSteps(state, builder);\n\t\t\tanchorBlockId = landingId ?? sel.anchor.blockId;\n\t\t} else {\n\t\t\tanchorBlockId = resolveAnchorBlockId(sel);\n\t\t}\n\n\t\t// Create the code block node\n\t\tconst newBlockId: BlockId = generateBlockId();\n\t\tconst codeBlock: BlockNode = createBlockNode(\n\t\t\tnodeType('code_block') as NodeTypeName,\n\t\t\t[createTextNode(detection.formattedText)],\n\t\t\tnewBlockId,\n\t\t\t{ language: detection.language, backgroundColor: '' },\n\t\t);\n\n\t\t// Insert at cursor (handles cell vs root, empty anchor removal)\n\t\tconst inserted: boolean = insertBlockAfterAnchor(\n\t\t\tstate,\n\t\t\tbuilder,\n\t\t\tanchorBlockId,\n\t\t\tcodeBlock,\n\t\t\tsel,\n\t\t\tthis.context?.getSchemaRegistry(),\n\t\t);\n\t\tif (!inserted) return null;\n\n\t\tbuilder.setSelection(createCollapsedSelection(newBlockId, detection.formattedText.length));\n\n\t\treturn builder.build();\n\t}\n\n\t// --- Mixed Content (multiple blocks) ---\n\n\tprivate handleMixedContent(\n\t\tstate: EditorState,\n\t\tsegments: readonly PasteSegment[],\n\t): Transaction | null {\n\t\tconst tr: Transaction | null = this.buildMultiBlockTransaction(state, segments);\n\t\tif (tr && this.context) {\n\t\t\tthis.announceMixedContent(segments);\n\t\t}\n\t\treturn tr;\n\t}\n\n\tprivate buildMultiBlockTransaction(\n\t\tstate: EditorState,\n\t\tsegments: readonly PasteSegment[],\n\t): Transaction | null {\n\t\tconst sel = state.selection;\n\t\tconst builder = state.transaction('paste');\n\n\t\tlet anchorBlockId: BlockId;\n\t\tif (isTextSelection(sel) && !isCollapsed(sel)) {\n\t\t\tconst landingId: BlockId | undefined = addDeleteSelectionSteps(state, builder);\n\t\t\tanchorBlockId = landingId ?? sel.anchor.blockId;\n\t\t} else {\n\t\t\tanchorBlockId = resolveAnchorBlockId(sel);\n\t\t}\n\n\t\tconst cellId: BlockId | undefined = findTableCellAncestor(state, anchorBlockId);\n\t\tconst schemaRegistry = this.context?.getSchemaRegistry();\n\n\t\tconst ctx: InsertionContext | undefined = cellId\n\t\t\t? resolveCellInsertionContext(state, anchorBlockId, cellId, schemaRegistry)\n\t\t\t: resolveRootInsertionContext(state, anchorBlockId, schemaRegistry);\n\t\tif (!ctx) return null;\n\n\t\tconst insertOffset: number = !cellId && isGapCursor(sel) && sel.side === 'before' ? 0 : 1;\n\t\tlet insertIndex: number = ctx.anchorIndex + insertOffset;\n\t\tlet lastBlockId: BlockId | undefined;\n\t\tlet lastBlockTextLen = 0;\n\n\t\tfor (const segment of segments) {\n\t\t\tconst block: BlockNode = segment.detection\n\t\t\t\t? this.createCodeBlockNode(segment.detection)\n\t\t\t\t: this.createParagraphNode(segment.text);\n\n\t\t\tbuilder.insertNode(ctx.parentPath, insertIndex, block);\n\t\t\tinsertIndex++;\n\t\t\tlastBlockId = block.id;\n\t\t\tlastBlockTextLen = segment.detection\n\t\t\t\t? segment.detection.formattedText.length\n\t\t\t\t: segment.text.length;\n\t\t}\n\n\t\tconst shouldRemoveAnchor: boolean = cellId\n\t\t\t? ctx.isAnchorEmpty && ctx.anchorIndex >= 0\n\t\t\t: ctx.isAnchorEmpty && !isGapCursor(sel);\n\n\t\tif (shouldRemoveAnchor) {\n\t\t\tbuilder.removeNode(ctx.parentPath, ctx.anchorIndex);\n\t\t}\n\n\t\tif (lastBlockId) {\n\t\t\tbuilder.setSelection(createCollapsedSelection(lastBlockId, lastBlockTextLen));\n\t\t}\n\n\t\treturn builder.build();\n\t}\n\n\tprivate createCodeBlockNode(detection: DetectionResult): BlockNode {\n\t\treturn createBlockNode(\n\t\t\tnodeType('code_block') as NodeTypeName,\n\t\t\t[createTextNode(detection.formattedText)],\n\t\t\tgenerateBlockId(),\n\t\t\t{ language: detection.language, backgroundColor: '' },\n\t\t);\n\t}\n\n\tprivate createParagraphNode(text: string): BlockNode {\n\t\treturn createBlockNode(\n\t\t\tnodeType('paragraph') as NodeTypeName,\n\t\t\t[createTextNode(text)],\n\t\t\tgenerateBlockId(),\n\t\t);\n\t}\n\n\tprivate announceMixedContent(segments: readonly PasteSegment[]): void {\n\t\tlet textCount = 0;\n\t\tlet codeCount = 0;\n\t\tconst languages: string[] = [];\n\n\t\tfor (const segment of segments) {\n\t\t\tif (segment.detection) {\n\t\t\t\tcodeCount++;\n\t\t\t\tif (!languages.includes(segment.detection.language)) {\n\t\t\t\t\tlanguages.push(segment.detection.language);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextCount++;\n\t\t\t}\n\t\t}\n\n\t\tthis.context?.announce(this.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|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as t,s}from"./PluginHelpers-D4quRJ5a.mjs";import{t as o}from"./ShortcutFormatting-TwiufqeV.mjs";import{t as r}from"./SimpleMark-Db8ir_z2.mjs";var i={label:"Strikethrough",tooltip:t=>`Strikethrough (${t})`},e=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-XmSFrtmd.mjs"),"./locales/de.ts":()=>import("./de-DViI26lG.mjs"),"./locales/es.ts":()=>import("./es-paXY7HFt.mjs"),"./locales/fr.ts":()=>import("./fr-ZsRdLuys.mjs"),"./locales/hi.ts":()=>import("./hi-CTWubxLY.mjs"),"./locales/pt.ts":()=>import("./pt-paXY7HFt.mjs"),"./locales/ru.ts":()=>import("./ru-Y11wuxOB.mjs"),"./locales/zh.ts":()=>import("./zh-C7iCgCRP.mjs")});async function a(t){return s(e,t,i)}var l={},h=class{id="strikethrough";name="Strikethrough";priority=22;config;locale;constructor(t){this.config={...l,...t}}async init(s){this.locale=await t(s,this.config.locale,i,a),r(s,{markSpec:{type:"strikethrough",rank:3,toDOM:()=>document.createElement("s"),toHTMLString:(t,s)=>`<s>${s}</s>`,parseHTML:[{tag:"s"},{tag:"strike"},{tag:"del"},{tag:"span",getAttrs:t=>!!t.style.textDecoration.includes("line-through")&&{}}],sanitize:{tags:["s"]}},command:"toggleStrikethrough",keyBinding:"Mod-Shift-X",toolbar:{id:"strikethrough",group:"format",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"/></svg>',label:this.locale.label,tooltip:this.locale.tooltip(o("Mod-Shift-X"))}})}};export{i as n,a as r,h as t};
|
|
2
|
+
//# sourceMappingURL=StrikethroughPlugin-Bsg7Ma4I.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StrikethroughPlugin-Bsg7Ma4I.mjs","names":[],"sources":["../../src/plugins/strikethrough/StrikethroughLocale.ts","../../src/plugins/strikethrough/StrikethroughPlugin.ts"],"sourcesContent":["/**\n * Locale interface and default English locale for the StrikethroughPlugin.\n */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface StrikethroughLocale {\n\treadonly label: string;\n\treadonly tooltip: (shortcut: string) => string;\n}\n\n// --- Default English Locale ---\n\nexport const STRIKETHROUGH_LOCALE_EN: StrikethroughLocale = {\n\tlabel: 'Strikethrough',\n\ttooltip: (shortcut: string) => `Strikethrough (${shortcut})`,\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<StrikethroughLocale> = import.meta.glob<{\n\tdefault: StrikethroughLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadStrikethroughLocale(lang: string): Promise<StrikethroughLocale> {\n\treturn loadLocaleModule(localeModules, lang, STRIKETHROUGH_LOCALE_EN);\n}\n","/**\n * StrikethroughPlugin: registers a strikethrough inline mark with MarkSpec,\n * toggle command, keyboard shortcut (Mod-Shift-X), and a toolbar button.\n */\n\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { registerSimpleMark } from '../shared/SimpleMark.js';\nimport {\n\tSTRIKETHROUGH_LOCALE_EN,\n\ttype StrikethroughLocale,\n\tloadStrikethroughLocale,\n} from './StrikethroughLocale.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tstrikethrough: Record<string, never>;\n\t}\n}\n\n// --- Configuration ---\n\nexport interface StrikethroughConfig {\n\treadonly locale?: StrikethroughLocale;\n}\n\nconst DEFAULT_CONFIG: StrikethroughConfig = {};\n\n// --- Plugin ---\n\nexport class StrikethroughPlugin implements Plugin {\n\treadonly id = 'strikethrough';\n\treadonly name = 'Strikethrough';\n\treadonly priority = 22;\n\n\tprivate readonly config: StrikethroughConfig;\n\tprivate locale!: StrikethroughLocale;\n\n\tconstructor(config?: Partial<StrikethroughConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tSTRIKETHROUGH_LOCALE_EN,\n\t\t\tloadStrikethroughLocale,\n\t\t);\n\t\tconst icon =\n\t\t\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z\"/></svg>';\n\n\t\tregisterSimpleMark(context, {\n\t\t\tmarkSpec: {\n\t\t\t\ttype: 'strikethrough',\n\t\t\t\trank: 3,\n\t\t\t\ttoDOM() {\n\t\t\t\t\treturn document.createElement('s');\n\t\t\t\t},\n\t\t\t\ttoHTMLString: (_mark, content) => `<s>${content}</s>`,\n\t\t\t\tparseHTML: [\n\t\t\t\t\t{ tag: 's' },\n\t\t\t\t\t{ tag: 'strike' },\n\t\t\t\t\t{ tag: 'del' },\n\t\t\t\t\t{\n\t\t\t\t\t\ttag: 'span',\n\t\t\t\t\t\tgetAttrs: (el: HTMLElement) => {\n\t\t\t\t\t\t\treturn el.style.textDecoration.includes('line-through') ? {} : false;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tsanitize: { tags: ['s'] },\n\t\t\t},\n\t\t\tcommand: 'toggleStrikethrough',\n\t\t\tkeyBinding: 'Mod-Shift-X',\n\t\t\ttoolbar: {\n\t\t\t\tid: 'strikethrough',\n\t\t\t\tgroup: 'format',\n\t\t\t\ticon,\n\t\t\t\tlabel: this.locale.label,\n\t\t\t\ttooltip: this.locale.tooltip(formatShortcut('Mod-Shift-X')),\n\t\t\t},\n\t\t});\n\t}\n}\n"],"mappings":"uJAeA,IAAa,EAA+C,CAC3D,MAAO,gBACP,QAAU,GAAqB,kBAAkB,MAK5C,iBAAsD,OAAA,OAAA,CAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,uBAI5D,eAAsB,EAAwB,GAC7C,OAAO,EAAiB,EAAe,EAAM,EAC9C,CCCA,IAAM,EAAsC,CAAC,EAIhC,EAAb,MACC,GAAc,gBACd,KAAgB,gBAChB,SAAoB,GAEpB,OACA,OAEA,WAAA,CAAY,GACX,KAAK,OAAS,IAAK,KAAmB,EACvC,CAEA,UAAM,CAAK,GACV,KAAK,aAAe,EACnB,EACA,KAAK,OAAO,OACZ,EACA,GAKD,EAAmB,EAAS,CAC3B,SAAU,CACT,KAAM,gBACN,KAAM,EACN,MAAA,IACQ,SAAS,cAAc,KAE/B,aAAA,CAAe,EAAO,IAAY,MAAM,QACxC,UAAW,CACV,CAAE,IAAK,KACP,CAAE,IAAK,UACP,CAAE,IAAK,OACP,CACC,IAAK,OACL,SAAW,KACH,EAAG,MAAM,eAAe,SAAS,iBAAkB,CAAC,IAI9D,SAAU,CAAE,KAAM,CAAC,OAEpB,QAAS,sBACT,WAAY,cACZ,QAAS,CACR,GAAI,gBACJ,MAAO,SACP,KAAA,uIACA,MAAO,KAAK,OAAO,MACnB,QAAS,KAAK,OAAO,QAAQ,EAAe,kBAG/C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e="data-notectl-style-token",t=/* @__PURE__ */new WeakMap,n=/* @__PURE__ */new WeakMap;function s(){if("undefined"==typeof CSSStyleSheet)return null;try{return new CSSStyleSheet}catch{return null}}function o(e,s){const o=n.get(e);o&&(o.destroy(),n.delete(e)),t.set(e,{nonce:s.nonce,sheet:s.sheet??null})}function i(e){const s=n.get(e);s&&(s.destroy(),n.delete(e)),t.delete(e)}function r(e,t,n){const s=f(e);s?y(s.root,s.settings).setProperty(e,t,n):d(e,t,n)}function l(e,t){r(e,t,"")}function c(e,t){const n=f(e);if(n)y(n.root,n.settings).setProperties(e,t);else for(const[s,o]of Object.entries(t))d(e,s,o??"")}function a(e,t){const n=f(e);n?y(n.root,n.settings).setStyleText(e,t):e.style.cssText=t}function h(e,t){const n=f(e);if(!n){const n=e.style.cssText;return void(e.style.cssText=n?`${n}; ${t}`:t)}y(n.root,n.settings).appendStyleText(e,t)}function u(e){const n=m(e);if(n)return t.get(n)?.nonce}function d(e,t,n){t.startsWith("--")||t.includes("-")?n?e.style.setProperty(t,n):e.style.removeProperty(t):e.style[t]=n}function f(e){const n=function(e){return m(e)}(e);if(!n)return null;const s=t.get(n);return s?{root:n,settings:s}:null}function y(e,t){const s=n.get(e);if(s)return s;const o=new p(e,t);return n.set(e,o),o}function S(e){return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot}function k(e){return"undefined"!=typeof Document&&e instanceof Document}function m(e){const t=S(e)||k(e)?e:e.getRootNode();return S(t)||k(t)?t:"undefined"!=typeof document?document:null}var p=class{declarationByElement=/* @__PURE__ */new WeakMap;tokenByDeclaration=/* @__PURE__ */new Map;declarationByToken=/* @__PURE__ */new Map;tokenRefCount=/* @__PURE__ */new Map;tokenByElement=/* @__PURE__ */new WeakMap;tokenCounter=0;root;nonce;sheet;fallbackStyleElement=null;ownsAdoptedSheet=!1;constructor(e,t){this.root=e,this.nonce=t.nonce,this.sheet=t.sheet??null}destroy(){this.clearRuntimeRules(),this.ownsAdoptedSheet&&this.sheet&&"adoptedStyleSheets"in this.root&&(this.root.adoptedStyleSheets=this.root.adoptedStyleSheets.filter(e=>e!==this.sheet)),this.fallbackStyleElement?.remove(),this.fallbackStyleElement=null,this.sheet=null,this.ownsAdoptedSheet=!1,this.tokenByDeclaration.clear(),this.declarationByToken.clear(),this.tokenRefCount.clear(),this.tokenCounter=0}setProperty(e,t,n){const s=this.getOrCreateDeclarations(e),o=R(t);n?s.set(o,n):s.delete(o),this.syncElementToken(e,s)}setProperties(e,t){const n=this.getOrCreateDeclarations(e);for(const[s,o]of Object.entries(t)){const e=R(s);o?n.set(e,o):n.delete(e)}this.syncElementToken(e,n)}setStyleText(e,t){const n=g(t);0!==n.size?(this.declarationByElement.set(e,n),this.syncElementToken(e,n)):this.clearElementStyles(e)}appendStyleText(e,t){const n=g(t);if(0===n.size)return;const s=this.getOrCreateDeclarations(e);for(const[o,i]of n)s.set(o,i);this.syncElementToken(e,s)}getStyleText(e){const t=this.declarationByElement.get(e);return t&&0!==t.size?E(t):""}getOrCreateDeclarations(e){const t=this.declarationByElement.get(e);if(t)return t;const n=/* @__PURE__ */new Map;return this.declarationByElement.set(e,n),n}syncElementToken(t,n){const s=this.tokenByElement.get(t);if(0===n.size)return void this.clearElementStyles(t);const o=E(n);let i=this.tokenByDeclaration.get(o);i||(i=`s${this.tokenCounter.toString(36)}`,this.tokenCounter+=1,this.tokenByDeclaration.set(o,i),this.declarationByToken.set(i,o),this.insertRule(i,o)),s!==i&&(this.retainToken(i),s&&this.releaseToken(s),this.tokenByElement.set(t,i)),t.setAttribute(e,i)}insertRule(e,t){const n=`${C(e)} { ${t}; }`,s=this.ensureSheet();if(s)try{s.insertRule(n,s.cssRules.length)}catch{}}ensureSheet(){if(this.sheet)return this.sheet;if("undefined"!=typeof CSSStyleSheet)try{const e=new CSSStyleSheet;if("adoptedStyleSheets"in this.root){const t=this.root.adoptedStyleSheets;return this.root.adoptedStyleSheets=[...t,e],this.sheet=e,this.ownsAdoptedSheet=!0,e}}catch{}const e=this.ensureFallbackStyleElement();return this.sheet=e.sheet??null,this.sheet}clearElementStyles(t){this.declarationByElement.delete(t);const n=this.tokenByElement.get(t);n&&(this.tokenByElement.delete(t),this.releaseToken(n)),t.removeAttribute(e)}retainToken(e){const t=this.tokenRefCount.get(e)??0;this.tokenRefCount.set(e,t+1)}releaseToken(e){const t=this.tokenRefCount.get(e);if(!t)return;if(t>1)return void this.tokenRefCount.set(e,t-1);this.tokenRefCount.delete(e);const n=this.declarationByToken.get(e);n&&(this.declarationByToken.delete(e),this.tokenByDeclaration.delete(n)),this.deleteRule(e)}deleteRule(e){const t=this.sheet;if(!t)return;const n=C(e);for(let s=t.cssRules.length-1;s>=0;s-=1){const e=t.cssRules[s];if(e&&T(e,n)){try{t.deleteRule(s)}catch{}return}}}clearRuntimeRules(){const t=this.sheet;if(t)for(let n=t.cssRules.length-1;n>=0;n-=1){const s=t.cssRules[n];if(s&&s.cssText.includes(`[${e}="`))try{t.deleteRule(n)}catch{}}}ensureFallbackStyleElement(){if(this.fallbackStyleElement)return this.fallbackStyleElement;const e=document.createElement("style");return e.setAttribute("data-notectl-runtime-styles",""),this.nonce&&e.setAttribute("nonce",this.nonce),S(this.root)?this.root.appendChild(e):(this.root.head??this.root.documentElement).appendChild(e),this.fallbackStyleElement=e,e}};function g(e){const t=/* @__PURE__ */new Map;for(const n of e.split(";")){const e=n.trim();if(!e)continue;const s=e.indexOf(":");if(s<=0)continue;const o=R(e.slice(0,s)),i=e.slice(s+1).trim();i?t.set(o,i):t.delete(o)}return t}function E(e){return Array.from(e.entries()).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${e}: ${t}`).join("; ")}function R(e){const t=e.trim();return t?t.startsWith("--")?t:t.includes("-")?t.toLowerCase():t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).toLowerCase():""}function C(t){return`[${e}="${t}"]`}function T(e,t){return"undefined"!=typeof CSSStyleRule&&e instanceof CSSStyleRule?e.selectorText===t:e.cssText.includes(t)}export{l as a,a as c,o as i,i as l,s as n,c as o,u as r,r as s,h as t};
|
|
2
|
+
//# sourceMappingURL=StyleRuntime-BAutwDZT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StyleRuntime-BAutwDZT.mjs","names":[],"sources":["../../src/style/StyleRuntime.ts"],"sourcesContent":["/**\n * Runtime style abstraction.\n *\n * Writes no inline styles and instead assigns token attributes\n * backed by dynamic CSS rules in a stylesheet.\n * Elements outside a registered root fall back to inline styles.\n */\n\nexport interface StyleRootOptions {\n\treadonly nonce?: string;\n\treadonly sheet?: CSSStyleSheet | null;\n}\n\ntype StyleRoot = ShadowRoot | Document;\n\ninterface RootConfig {\n\treadonly nonce?: string;\n\treadonly sheet: CSSStyleSheet | null;\n}\n\nconst STYLE_TOKEN_ATTR = 'data-notectl-style-token';\nconst STYLE_ELEMENT_ATTR = 'data-notectl-runtime-styles';\n\nconst rootConfigs: WeakMap<StyleRoot, RootConfig> = new WeakMap();\nconst strictEngines: WeakMap<StyleRoot, StrictStyleEngine> = new WeakMap();\n\n/** Creates a constructable stylesheet when the environment supports it. */\nexport function createRuntimeStyleSheet(): CSSStyleSheet | null {\n\tif (typeof CSSStyleSheet === 'undefined') return null;\n\ttry {\n\t\treturn new CSSStyleSheet();\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/** Registers styling mode for a root (shadow root or document). */\nexport function registerStyleRoot(root: StyleRoot, options: StyleRootOptions): void {\n\tconst previous = strictEngines.get(root);\n\tif (previous) {\n\t\tprevious.destroy();\n\t\tstrictEngines.delete(root);\n\t}\n\trootConfigs.set(root, {\n\t\tnonce: options.nonce,\n\t\tsheet: options.sheet ?? null,\n\t});\n}\n\n/** Unregisters root styling and tears down strict runtime state if present. */\nexport function unregisterStyleRoot(root: StyleRoot): void {\n\tconst engine = strictEngines.get(root);\n\tif (engine) {\n\t\tengine.destroy();\n\t\tstrictEngines.delete(root);\n\t}\n\trootConfigs.delete(root);\n}\n\n/** Sets a single style property. Empty value removes the property. */\nexport function setStyleProperty(el: HTMLElement, property: string, value: string): void {\n\tconst config = resolveConfig(el);\n\tif (!config) {\n\t\tsetInlineProperty(el, property, value);\n\t\treturn;\n\t}\n\tgetStrictEngine(config.root, config.settings).setProperty(el, property, value);\n}\n\n/** Removes a single style property. */\nexport function removeStyleProperty(el: HTMLElement, property: string): void {\n\tsetStyleProperty(el, property, '');\n}\n\n/** Sets multiple style properties in one call. */\nexport function setStyleProperties(\n\tel: HTMLElement,\n\tproperties: Readonly<Record<string, string | undefined | null>>,\n): void {\n\tconst config = resolveConfig(el);\n\tif (!config) {\n\t\tfor (const [property, value] of Object.entries(properties)) {\n\t\t\tsetInlineProperty(el, property, value ?? '');\n\t\t}\n\t\treturn;\n\t}\n\tgetStrictEngine(config.root, config.settings).setProperties(el, properties);\n}\n\n/** Replaces the element style text. */\nexport function setStyleText(el: HTMLElement, cssText: string): void {\n\tconst config = resolveConfig(el);\n\tif (!config) {\n\t\tel.style.cssText = cssText;\n\t\treturn;\n\t}\n\tgetStrictEngine(config.root, config.settings).setStyleText(el, cssText);\n}\n\n/** Merges a cssText fragment into current element styles. */\nexport function appendStyleText(el: HTMLElement, cssText: string): void {\n\tconst config = resolveConfig(el);\n\tif (!config) {\n\t\tconst current = el.style.cssText;\n\t\tel.style.cssText = current ? `${current}; ${cssText}` : cssText;\n\t\treturn;\n\t}\n\tgetStrictEngine(config.root, config.settings).appendStyleText(el, cssText);\n}\n\n/** Returns serialized styles for an element. */\nexport function getStyleText(el: HTMLElement): string {\n\tconst config = resolveConfig(el);\n\tif (!config) return el.style.cssText;\n\treturn getStrictEngine(config.root, config.settings).getStyleText(el);\n}\n\n/** Returns the configured CSP nonce for the node's style root (if any). */\nexport function getStyleNonceForNode(node: Node): string | undefined {\n\tconst root = resolveStyleRootFromNode(node);\n\tif (!root) return undefined;\n\treturn rootConfigs.get(root)?.nonce;\n}\n\nfunction setInlineProperty(el: HTMLElement, property: string, value: string): void {\n\tif (property.startsWith('--')) {\n\t\tif (value) {\n\t\t\tel.style.setProperty(property, value);\n\t\t} else {\n\t\t\tel.style.removeProperty(property);\n\t\t}\n\t\treturn;\n\t}\n\tif (property.includes('-')) {\n\t\tif (value) {\n\t\t\tel.style.setProperty(property, value);\n\t\t} else {\n\t\t\tel.style.removeProperty(property);\n\t\t}\n\t\treturn;\n\t}\n\t(el.style as CSSStyleDeclaration & Record<string, string>)[property] = value;\n}\n\nfunction resolveConfig(el: HTMLElement): { root: StyleRoot; settings: RootConfig } | null {\n\tconst root = resolveStyleRoot(el);\n\tif (!root) return null;\n\tconst settings = rootConfigs.get(root);\n\tif (!settings) return null;\n\treturn { root, settings };\n}\n\nfunction resolveStyleRoot(el: HTMLElement): StyleRoot | null {\n\treturn resolveStyleRootFromNode(el);\n}\n\nfunction getStrictEngine(root: StyleRoot, config: RootConfig): StrictStyleEngine {\n\tconst cached = strictEngines.get(root);\n\tif (cached) return cached;\n\tconst engine = new StrictStyleEngine(root, config);\n\tstrictEngines.set(root, engine);\n\treturn engine;\n}\n\nfunction isShadowRoot(value: unknown): value is ShadowRoot {\n\treturn typeof ShadowRoot !== 'undefined' && value instanceof ShadowRoot;\n}\n\nfunction isDocument(value: unknown): value is Document {\n\treturn typeof Document !== 'undefined' && value instanceof Document;\n}\n\nfunction resolveStyleRootFromNode(node: Node): StyleRoot | null {\n\tconst rootNode: Node = isShadowRoot(node) || isDocument(node) ? node : node.getRootNode();\n\tif (isShadowRoot(rootNode)) return rootNode;\n\tif (isDocument(rootNode)) return rootNode;\n\tif (typeof document !== 'undefined') return document;\n\treturn null;\n}\n\nclass StrictStyleEngine {\n\tprivate readonly declarationByElement: WeakMap<HTMLElement, Map<string, string>> = new WeakMap();\n\tprivate readonly tokenByDeclaration: Map<string, string> = new Map();\n\tprivate readonly declarationByToken: Map<string, string> = new Map();\n\tprivate readonly tokenRefCount: Map<string, number> = new Map();\n\tprivate readonly tokenByElement: WeakMap<HTMLElement, string> = new WeakMap();\n\tprivate tokenCounter = 0;\n\tprivate readonly root: StyleRoot;\n\tprivate readonly nonce?: string;\n\tprivate sheet: CSSStyleSheet | null;\n\tprivate fallbackStyleElement: HTMLStyleElement | null = null;\n\tprivate ownsAdoptedSheet = false;\n\n\tconstructor(root: StyleRoot, config: RootConfig) {\n\t\tthis.root = root;\n\t\tthis.nonce = config.nonce;\n\t\tthis.sheet = config.sheet ?? null;\n\t}\n\n\tdestroy(): void {\n\t\tthis.clearRuntimeRules();\n\t\tif (this.ownsAdoptedSheet && this.sheet && 'adoptedStyleSheets' in this.root) {\n\t\t\tthis.root.adoptedStyleSheets = this.root.adoptedStyleSheets.filter(\n\t\t\t\t(adoptedSheet: CSSStyleSheet): boolean => adoptedSheet !== this.sheet,\n\t\t\t);\n\t\t}\n\t\tthis.fallbackStyleElement?.remove();\n\t\tthis.fallbackStyleElement = null;\n\t\tthis.sheet = null;\n\t\tthis.ownsAdoptedSheet = false;\n\t\tthis.tokenByDeclaration.clear();\n\t\tthis.declarationByToken.clear();\n\t\tthis.tokenRefCount.clear();\n\t\tthis.tokenCounter = 0;\n\t}\n\n\tsetProperty(el: HTMLElement, property: string, value: string): void {\n\t\tconst declarations = this.getOrCreateDeclarations(el);\n\t\tconst name = normalizePropertyName(property);\n\t\tif (!value) {\n\t\t\tdeclarations.delete(name);\n\t\t} else {\n\t\t\tdeclarations.set(name, value);\n\t\t}\n\t\tthis.syncElementToken(el, declarations);\n\t}\n\n\tsetProperties(\n\t\tel: HTMLElement,\n\t\tproperties: Readonly<Record<string, string | undefined | null>>,\n\t): void {\n\t\tconst declarations = this.getOrCreateDeclarations(el);\n\t\tfor (const [property, value] of Object.entries(properties)) {\n\t\t\tconst name = normalizePropertyName(property);\n\t\t\tif (!value) {\n\t\t\t\tdeclarations.delete(name);\n\t\t\t} else {\n\t\t\t\tdeclarations.set(name, value);\n\t\t\t}\n\t\t}\n\t\tthis.syncElementToken(el, declarations);\n\t}\n\n\tsetStyleText(el: HTMLElement, cssText: string): void {\n\t\tconst declarations = parseStyleText(cssText);\n\t\tif (declarations.size === 0) {\n\t\t\tthis.clearElementStyles(el);\n\t\t\treturn;\n\t\t}\n\t\tthis.declarationByElement.set(el, declarations);\n\t\tthis.syncElementToken(el, declarations);\n\t}\n\n\tappendStyleText(el: HTMLElement, cssText: string): void {\n\t\tconst parsed = parseStyleText(cssText);\n\t\tif (parsed.size === 0) return;\n\t\tconst declarations = this.getOrCreateDeclarations(el);\n\t\tfor (const [property, value] of parsed) {\n\t\t\tdeclarations.set(property, value);\n\t\t}\n\t\tthis.syncElementToken(el, declarations);\n\t}\n\n\tgetStyleText(el: HTMLElement): string {\n\t\tconst declarations = this.declarationByElement.get(el);\n\t\tif (!declarations || declarations.size === 0) return '';\n\t\treturn serializeDeclarations(declarations);\n\t}\n\n\tprivate getOrCreateDeclarations(el: HTMLElement): Map<string, string> {\n\t\tconst existing = this.declarationByElement.get(el);\n\t\tif (existing) return existing;\n\t\tconst created = new Map<string, string>();\n\t\tthis.declarationByElement.set(el, created);\n\t\treturn created;\n\t}\n\n\tprivate syncElementToken(el: HTMLElement, declarations: Map<string, string>): void {\n\t\tconst previousToken = this.tokenByElement.get(el);\n\t\tif (declarations.size === 0) {\n\t\t\tthis.clearElementStyles(el);\n\t\t\treturn;\n\t\t}\n\n\t\tconst declarationText = serializeDeclarations(declarations);\n\t\tlet token = this.tokenByDeclaration.get(declarationText);\n\t\tif (!token) {\n\t\t\ttoken = `s${this.tokenCounter.toString(36)}`;\n\t\t\tthis.tokenCounter += 1;\n\t\t\tthis.tokenByDeclaration.set(declarationText, token);\n\t\t\tthis.declarationByToken.set(token, declarationText);\n\t\t\tthis.insertRule(token, declarationText);\n\t\t}\n\t\tif (previousToken !== token) {\n\t\t\tthis.retainToken(token);\n\t\t\tif (previousToken) {\n\t\t\t\tthis.releaseToken(previousToken);\n\t\t\t}\n\t\t\tthis.tokenByElement.set(el, token);\n\t\t}\n\t\tel.setAttribute(STYLE_TOKEN_ATTR, token);\n\t}\n\n\tprivate insertRule(token: string, declarationText: string): void {\n\t\tconst rule = `${buildTokenSelector(token)} { ${declarationText}; }`;\n\t\tconst sheet = this.ensureSheet();\n\t\tif (!sheet) return;\n\t\ttry {\n\t\t\tsheet.insertRule(rule, sheet.cssRules.length);\n\t\t} catch {\n\t\t\t// Ignore malformed declarations from third-party plugin attrs.\n\t\t}\n\t}\n\n\tprivate ensureSheet(): CSSStyleSheet | null {\n\t\tif (this.sheet) return this.sheet;\n\n\t\tif (typeof CSSStyleSheet !== 'undefined') {\n\t\t\ttry {\n\t\t\t\tconst sheet = new CSSStyleSheet();\n\t\t\t\tif ('adoptedStyleSheets' in this.root) {\n\t\t\t\t\tconst adopted = this.root.adoptedStyleSheets;\n\t\t\t\t\tthis.root.adoptedStyleSheets = [...adopted, sheet];\n\t\t\t\t\tthis.sheet = sheet;\n\t\t\t\t\tthis.ownsAdoptedSheet = true;\n\t\t\t\t\treturn sheet;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Fall through to style element fallback.\n\t\t\t}\n\t\t}\n\n\t\tconst style = this.ensureFallbackStyleElement();\n\t\tthis.sheet = (style.sheet as CSSStyleSheet | null) ?? null;\n\t\treturn this.sheet;\n\t}\n\n\tprivate clearElementStyles(el: HTMLElement): void {\n\t\tthis.declarationByElement.delete(el);\n\t\tconst token = this.tokenByElement.get(el);\n\t\tif (token) {\n\t\t\tthis.tokenByElement.delete(el);\n\t\t\tthis.releaseToken(token);\n\t\t}\n\t\tel.removeAttribute(STYLE_TOKEN_ATTR);\n\t}\n\n\tprivate retainToken(token: string): void {\n\t\tconst current = this.tokenRefCount.get(token) ?? 0;\n\t\tthis.tokenRefCount.set(token, current + 1);\n\t}\n\n\tprivate releaseToken(token: string): void {\n\t\tconst current = this.tokenRefCount.get(token);\n\t\tif (!current) return;\n\t\tif (current > 1) {\n\t\t\tthis.tokenRefCount.set(token, current - 1);\n\t\t\treturn;\n\t\t}\n\t\tthis.tokenRefCount.delete(token);\n\t\tconst declaration = this.declarationByToken.get(token);\n\t\tif (declaration) {\n\t\t\tthis.declarationByToken.delete(token);\n\t\t\tthis.tokenByDeclaration.delete(declaration);\n\t\t}\n\t\tthis.deleteRule(token);\n\t}\n\n\tprivate deleteRule(token: string): void {\n\t\tconst sheet = this.sheet;\n\t\tif (!sheet) return;\n\t\tconst selector = buildTokenSelector(token);\n\t\tfor (let index = sheet.cssRules.length - 1; index >= 0; index -= 1) {\n\t\t\tconst rule = sheet.cssRules[index];\n\t\t\tif (!rule || !isTokenSelectorMatch(rule, selector)) continue;\n\t\t\ttry {\n\t\t\t\tsheet.deleteRule(index);\n\t\t\t} catch {\n\t\t\t\t// Ignore parser/runtime discrepancies in unsupported environments.\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t}\n\n\tprivate clearRuntimeRules(): void {\n\t\tconst sheet = this.sheet;\n\t\tif (!sheet) return;\n\t\tfor (let index = sheet.cssRules.length - 1; index >= 0; index -= 1) {\n\t\t\tconst rule = sheet.cssRules[index];\n\t\t\tif (!rule || !rule.cssText.includes(`[${STYLE_TOKEN_ATTR}=\"`)) continue;\n\t\t\ttry {\n\t\t\t\tsheet.deleteRule(index);\n\t\t\t} catch {\n\t\t\t\t// Ignore parser/runtime discrepancies in unsupported environments.\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate ensureFallbackStyleElement(): HTMLStyleElement {\n\t\tif (this.fallbackStyleElement) return this.fallbackStyleElement;\n\t\tconst style: HTMLStyleElement = document.createElement('style');\n\t\tstyle.setAttribute(STYLE_ELEMENT_ATTR, '');\n\t\tif (this.nonce) {\n\t\t\tstyle.setAttribute('nonce', this.nonce);\n\t\t}\n\t\tif (isShadowRoot(this.root)) {\n\t\t\tthis.root.appendChild(style);\n\t\t} else {\n\t\t\tconst host = this.root.head ?? this.root.documentElement;\n\t\t\thost.appendChild(style);\n\t\t}\n\t\tthis.fallbackStyleElement = style;\n\t\treturn style;\n\t}\n}\n\nfunction parseStyleText(styleText: string): Map<string, string> {\n\tconst declarations = new Map<string, string>();\n\tfor (const rawPart of styleText.split(';')) {\n\t\tconst part = rawPart.trim();\n\t\tif (!part) continue;\n\t\tconst separator = part.indexOf(':');\n\t\tif (separator <= 0) continue;\n\t\tconst property = normalizePropertyName(part.slice(0, separator));\n\t\tconst value = part.slice(separator + 1).trim();\n\t\tif (!value) {\n\t\t\tdeclarations.delete(property);\n\t\t} else {\n\t\t\tdeclarations.set(property, value);\n\t\t}\n\t}\n\treturn declarations;\n}\n\nfunction serializeDeclarations(declarations: Map<string, string>): string {\n\tconst ordered: [string, string][] = Array.from(declarations.entries()).sort(([a], [b]) =>\n\t\ta.localeCompare(b),\n\t);\n\treturn ordered.map(([property, value]) => `${property}: ${value}`).join('; ');\n}\n\nfunction normalizePropertyName(property: string): string {\n\tconst trimmed = property.trim();\n\tif (!trimmed) return '';\n\tif (trimmed.startsWith('--')) return trimmed;\n\tif (trimmed.includes('-')) return trimmed.toLowerCase();\n\treturn trimmed.replace(/[A-Z]/g, (char: string) => `-${char.toLowerCase()}`).toLowerCase();\n}\n\nfunction buildTokenSelector(token: string): string {\n\treturn `[${STYLE_TOKEN_ATTR}=\"${token}\"]`;\n}\n\nfunction isTokenSelectorMatch(rule: CSSRule, selector: string): boolean {\n\tif (typeof CSSStyleRule !== 'undefined' && rule instanceof CSSStyleRule) {\n\t\treturn rule.selectorText === selector;\n\t}\n\treturn rule.cssText.includes(selector);\n}\n"],"mappings":"AAoBA,IAAM,EAAmB,2BAGnB,iBAA8C,IAAI,QAClD,iBAAuD,IAAI,QAGjE,SAAgB,IACf,GAA6B,oBAAlB,cAA+B,OAAO,KACjD,IACC,OAAO,IAAI,aACZ,CAAA,MACC,OAAO,IACR,CACD,CAGA,SAAgB,EAAkB,EAAiB,GAClD,MAAM,EAAW,EAAc,IAAI,GAC/B,IACH,EAAS,UACT,EAAc,OAAO,IAEtB,EAAY,IAAI,EAAM,CACrB,MAAO,EAAQ,MACf,MAAO,EAAQ,OAAS,MAE1B,CAGA,SAAgB,EAAoB,GACnC,MAAM,EAAS,EAAc,IAAI,GAC7B,IACH,EAAO,UACP,EAAc,OAAO,IAEtB,EAAY,OAAO,EACpB,CAGA,SAAgB,EAAiB,EAAiB,EAAkB,GACnE,MAAM,EAAS,EAAc,GACxB,EAIL,EAAgB,EAAO,KAAM,EAAO,UAAU,YAAY,EAAI,EAAU,GAHvE,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AS,EAAmB,GAC3B,MAAO,IAAI,MAAqB,KACjC,CAEA,SAAS,EAAqB,EAAe,GAC5C,MAA4B,oBAAjB,cAAgC,aAAgB,aACnD,EAAK,eAAiB,EAEvB,EAAK,QAAQ,SAAS,EAC9B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as s,m as t}from"./Commands-CyT1Li7_.mjs";import{i as e}from"./TypeBrands-Ch9856Gb.mjs";import{a as i,n as r,o,s as p}from"./PluginHelpers-D4quRJ5a.mjs";import{t as c}from"./ShortcutFormatting-TwiufqeV.mjs";var a={superscriptLabel:"Superscript",superscriptTooltip:s=>`Superscript (${s})`,subscriptLabel:"Subscript",subscriptTooltip:s=>`Subscript (${s})`},n=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-NV_puwI2.mjs"),"./locales/de.ts":()=>import("./de-BX4y4PlH.mjs"),"./locales/es.ts":()=>import("./es-BdpTTRuX.mjs"),"./locales/fr.ts":()=>import("./fr-CKjH6tJI.mjs"),"./locales/hi.ts":()=>import("./hi-DsdXcOB6.mjs"),"./locales/pt.ts":()=>import("./pt-OXa_IR4Q.mjs"),"./locales/ru.ts":()=>import("./ru-d68SZpEe.mjs"),"./locales/zh.ts":()=>import("./zh-BP97XjlS.mjs")});async function l(s){return p(n,s,a)}var u={superscript:!0,subscript:!0},m=[{type:"superscript",opposite:"subscript",configKey:"superscript",rank:4,tag:"sup",icon:['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">','<path d="M16 7.41L11.41 12 16 16.59 14.59 18l-6-6 6-6z"',' fill="none"/>','<path d="M9.64 7.64c.23-.5.36-1.05.36-1.64'," 0-2.21-1.79-4-4-4H2v14h4.36c2.34 0 4.24-1.9"," 4.24-4.24 0-1.6-.89-2.99-2.2-3.71zM4.5 4.5H6c.83"," 0 1.5.67 1.5 1.5S6.83 7.5 6 7.5H4.5v-3zm2 9H4.5v-3H6.5c.83",' 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z" fill="none"/>','<path d="M15.97 3.84c0-.47.19-.91.53-1.21.34-.31.8-.49'," 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02","-.96-.43-1.83-1.13-2.42C19.36.77 18.45.44 17.5.44c-.88"," 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34"," 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53"," 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54","-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96"," 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56","-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46",'-.59-.46-.94z"/>','<path d="M5.88 20h2.66l3.4-5.42L15.3 20h2.67l-4.73-7.38',' 4.37-6.62h-2.6l-3.07 4.98L8.92 6h-2.6l4.26 6.58z"/>',"</svg>"].join(""),keyBinding:"Mod-.",toHTMLString:s=>`<sup>${s}</sup>`,parseHTML:[{tag:"sup"}],sanitize:{tags:["sup"]}},{type:"subscript",opposite:"superscript",configKey:"subscript",rank:4,tag:"sub",icon:['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">','<path d="M15.97 16.84c0-.47.19-.91.53-1.21.34-.31.8-.49'," 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02","-.96-.43-1.83-1.13-2.42-.7-.58-1.61-.91-2.56-.91-.88"," 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34"," 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53"," 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54","-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96"," 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56","-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46",'-.59-.46-.94z"/>','<path d="M5.88 18h2.66l3.4-5.42L15.3 18h2.67l-4.73-7.38',' 4.37-6.62h-2.6l-3.07 4.98L8.92 4h-2.6l4.26 6.58z"/>',"</svg>"].join(""),keyBinding:"Mod-,",toHTMLString:s=>`<sub>${s}</sub>`,parseHTML:[{tag:"sub"}],sanitize:{tags:["sub"]}}],g=class{id="super-sub";name="Superscript & Subscript";priority=23;config;locale;constructor(s){this.config={...u,...s}}async init(s){this.locale=await i(s,this.config.locale,a,l);const t=m.filter(s=>this.config[s.configKey]);for(const e of t)this.registerMark(s,e);this.registerKeymaps(s,t),this.registerExclusivityMiddleware(s,t),this.registerDisabledToolbarItems(s)}registerMark(i,p){const a=o(p.type),n=this.isToolbarVisible(p.configKey);if(i.registerMarkSpec({type:p.type,rank:p.rank,toDOM:()=>document.createElement(p.tag),toHTMLString:(s,t)=>p.toHTMLString(t),parseHTML:p.parseHTML,sanitize:p.sanitize}),i.registerCommand(a,()=>r(i,s(i.getState(),e(p.type)))),n){const s="superscript"===p.type?this.locale.superscriptLabel:this.locale.subscriptLabel,r="superscript"===p.type?this.locale.superscriptTooltip(c(p.keyBinding)):this.locale.subscriptTooltip(c(p.keyBinding));i.registerToolbarItem({id:p.type,group:"format",icon:p.icon,label:s,tooltip:r,command:a,isActive:s=>t(s,e(p.type))})}}registerKeymaps(s,t){const e={};for(const i of t){const t=o(i.type);e[i.keyBinding]=()=>s.executeCommand(t)}Object.keys(e).length>0&&s.registerKeymap(e)}registerExclusivityMiddleware(s,t){t.some(s=>"superscript"===s.type)&&t.some(s=>"subscript"===s.type)&&s.registerMiddleware((s,t,i)=>{let r=!1;const o=[];for(const c of s.steps){if("addMark"!==c.type){o.push(c);continue}const s=c.mark.type,t=m.find(t=>t.type===s);if(!t){o.push(c);continue}r=!0;const i={type:"removeMark",blockId:c.blockId,from:c.from,to:c.to,mark:{type:e(t.opposite)},...c.path?{path:c.path}:{}};o.push(i,c)}let p=s.storedMarksAfter;if(p){const s=p.some(s=>"superscript"===s.type),t=p.some(s=>"subscript"===s.type);if(s&&t){const s=p.findLastIndex(s=>"superscript"===s.type)>p.findLastIndex(s=>"subscript"===s.type)?"subscript":"superscript";p=p.filter(t=>t.type!==s),r=!0}}i(r?{...s,steps:o,storedMarksAfter:p}:s)},{name:"super-sub:exclusivity"})}registerDisabledToolbarItems(s){if(this.config.toolbar)for(const t of m){const e=this.config[t.configKey],i=this.config.toolbar[t.configKey]??!0;if(!e&&i){const e="superscript"===t.type?this.locale.superscriptLabel:this.locale.subscriptLabel;s.registerToolbarItem({id:t.type,group:"format",icon:t.icon,label:e,command:o(t.type),isEnabled:()=>!1})}}}isToolbarVisible(s){return!this.config.toolbar||(this.config.toolbar[s]??!0)}};export{a as n,l as r,g as t};
|
|
2
|
+
//# sourceMappingURL=SuperSubPlugin-ChEga-b_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuperSubPlugin-ChEga-b_.mjs","names":[],"sources":["../../src/plugins/super-sub/SuperSubLocale.ts","../../src/plugins/super-sub/SuperSubPlugin.ts"],"sourcesContent":["/**\n * Locale interface and default English locale for the SuperSubPlugin.\n */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface SuperSubLocale {\n\treadonly superscriptLabel: string;\n\treadonly superscriptTooltip: (shortcut: string) => string;\n\treadonly subscriptLabel: string;\n\treadonly subscriptTooltip: (shortcut: string) => string;\n}\n\n// --- Default English Locale ---\n\nexport const SUPER_SUB_LOCALE_EN: SuperSubLocale = {\n\tsuperscriptLabel: 'Superscript',\n\tsuperscriptTooltip: (shortcut: string) => `Superscript (${shortcut})`,\n\tsubscriptLabel: 'Subscript',\n\tsubscriptTooltip: (shortcut: string) => `Subscript (${shortcut})`,\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<SuperSubLocale> = import.meta.glob<{\n\tdefault: SuperSubLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadSuperSubLocale(lang: string): Promise<SuperSubLocale> {\n\treturn loadLocaleModule(localeModules, lang, SUPER_SUB_LOCALE_EN);\n}\n","/**\n * SuperSubPlugin: registers superscript and subscript inline marks with\n * MarkSpecs, toggle commands, keyboard shortcuts, toolbar buttons, and\n * a middleware that enforces mutual exclusivity between the two marks.\n *\n * Data-driven — each mark type is defined declaratively and all\n * registrations are derived from the same definition table.\n */\n\nimport { isMarkActive, toggleMark } from '../../commands/Commands.js';\nimport type { Mark } from '../../model/Document.js';\nimport type { ParseRule } from '../../model/ParseRule.js';\nimport type { SanitizeConfig } from '../../model/SanitizeConfig.js';\nimport { markType as mkType } from '../../model/TypeBrands.js';\nimport type { RemoveMarkStep, Step } from '../../state/Transaction.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { dispatchIfPresent, resolveLocale, toCommandName } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { SUPER_SUB_LOCALE_EN, type SuperSubLocale, loadSuperSubLocale } from './SuperSubLocale.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tsuperscript: Record<string, never>;\n\t\tsubscript: Record<string, never>;\n\t}\n}\n\n// --- Configuration ---\n\n/** Controls toolbar button visibility per mark. */\nexport interface SuperSubToolbarConfig {\n\treadonly superscript?: boolean;\n\treadonly subscript?: boolean;\n}\n\n/** Controls which marks are enabled and which toolbar buttons are shown. */\nexport interface SuperSubConfig {\n\treadonly superscript: boolean;\n\treadonly subscript: boolean;\n\treadonly toolbar?: SuperSubToolbarConfig;\n\treadonly locale?: SuperSubLocale;\n}\n\nconst DEFAULT_CONFIG: SuperSubConfig = {\n\tsuperscript: true,\n\tsubscript: true,\n};\n\n// --- Mark Definitions ---\n\ninterface MarkDefinition {\n\treadonly type: 'superscript' | 'subscript';\n\treadonly opposite: 'superscript' | 'subscript';\n\treadonly configKey: keyof Omit<SuperSubConfig, 'toolbar' | 'locale'>;\n\treadonly rank: number;\n\treadonly tag: string;\n\treadonly icon: string;\n\treadonly keyBinding: string;\n\treadonly toHTMLString: (content: string) => string;\n\treadonly parseHTML: readonly ParseRule[];\n\treadonly sanitize: SanitizeConfig;\n}\n\nconst SUPERSCRIPT_ICON: string = [\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">',\n\t'<path d=\"M16 7.41L11.41 12 16 16.59 14.59 18l-6-6 6-6z\"',\n\t' fill=\"none\"/>',\n\t'<path d=\"M9.64 7.64c.23-.5.36-1.05.36-1.64',\n\t' 0-2.21-1.79-4-4-4H2v14h4.36c2.34 0 4.24-1.9',\n\t' 4.24-4.24 0-1.6-.89-2.99-2.2-3.71zM4.5 4.5H6c.83',\n\t' 0 1.5.67 1.5 1.5S6.83 7.5 6 7.5H4.5v-3zm2 9H4.5v-3H6.5c.83',\n\t' 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z\" fill=\"none\"/>',\n\t'<path d=\"M15.97 3.84c0-.47.19-.91.53-1.21.34-.31.8-.49',\n\t' 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02',\n\t'-.96-.43-1.83-1.13-2.42C19.36.77 18.45.44 17.5.44c-.88',\n\t' 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34',\n\t' 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53',\n\t' 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54',\n\t'-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96',\n\t' 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56',\n\t'-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46',\n\t'-.59-.46-.94z\"/>',\n\t'<path d=\"M5.88 20h2.66l3.4-5.42L15.3 20h2.67l-4.73-7.38',\n\t' 4.37-6.62h-2.6l-3.07 4.98L8.92 6h-2.6l4.26 6.58z\"/>',\n\t'</svg>',\n].join('');\n\nconst SUBSCRIPT_ICON: string = [\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">',\n\t'<path d=\"M15.97 16.84c0-.47.19-.91.53-1.21.34-.31.8-.49',\n\t' 1.3-.49.5 0 .95.18 1.28.48.32.3.5.7.51 1.15h1.59c-.02',\n\t'-.96-.43-1.83-1.13-2.42-.7-.58-1.61-.91-2.56-.91-.88',\n\t' 0-1.74.28-2.39.8-.67.53-1.06 1.28-1.06 2.1 0 .76.34',\n\t' 1.47.93 1.97.59.49 1.41.84 2.32 1.15.7.24 1.26.5 1.62.8.35.3.53.64.53',\n\t' 1.02 0 .48-.2.93-.55 1.24-.36.3-.84.48-1.37.48-.55 0-1.04-.2-1.39-.54',\n\t'-.34-.33-.53-.8-.53-1.32h-1.58c.01 1.02.43 1.95 1.16 2.57.72.62 1.67.96',\n\t' 2.67.96.92 0 1.81-.3 2.46-.84.67-.56 1.04-1.33 1.04-2.18 0-.81-.36-1.56',\n\t'-.99-2.08-.62-.51-1.48-.88-2.43-1.2-.67-.23-1.2-.47-1.52-.75-.32-.27-.46',\n\t'-.59-.46-.94z\"/>',\n\t'<path d=\"M5.88 18h2.66l3.4-5.42L15.3 18h2.67l-4.73-7.38',\n\t' 4.37-6.62h-2.6l-3.07 4.98L8.92 4h-2.6l4.26 6.58z\"/>',\n\t'</svg>',\n].join('');\n\nconst MARK_DEFINITIONS: readonly MarkDefinition[] = [\n\t{\n\t\ttype: 'superscript',\n\t\topposite: 'subscript',\n\t\tconfigKey: 'superscript',\n\t\trank: 4,\n\t\ttag: 'sup',\n\t\ticon: SUPERSCRIPT_ICON,\n\t\tkeyBinding: 'Mod-.',\n\t\ttoHTMLString: (content) => `<sup>${content}</sup>`,\n\t\tparseHTML: [{ tag: 'sup' }],\n\t\tsanitize: { tags: ['sup'] },\n\t},\n\t{\n\t\ttype: 'subscript',\n\t\topposite: 'superscript',\n\t\tconfigKey: 'subscript',\n\t\trank: 4,\n\t\ttag: 'sub',\n\t\ticon: SUBSCRIPT_ICON,\n\t\tkeyBinding: 'Mod-,',\n\t\ttoHTMLString: (content) => `<sub>${content}</sub>`,\n\t\tparseHTML: [{ tag: 'sub' }],\n\t\tsanitize: { tags: ['sub'] },\n\t},\n];\n\n// --- Plugin ---\n\nexport class SuperSubPlugin implements Plugin {\n\treadonly id = 'super-sub';\n\treadonly name = 'Superscript & Subscript';\n\treadonly priority = 23;\n\n\tprivate readonly config: SuperSubConfig;\n\tprivate locale!: SuperSubLocale;\n\n\tconstructor(config?: Partial<SuperSubConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tSUPER_SUB_LOCALE_EN,\n\t\t\tloadSuperSubLocale,\n\t\t);\n\n\t\tconst enabledMarks: MarkDefinition[] = MARK_DEFINITIONS.filter(\n\t\t\t(def) => this.config[def.configKey],\n\t\t);\n\n\t\tfor (const def of enabledMarks) {\n\t\t\tthis.registerMark(context, def);\n\t\t}\n\n\t\tthis.registerKeymaps(context, enabledMarks);\n\t\tthis.registerExclusivityMiddleware(context, enabledMarks);\n\t\tthis.registerDisabledToolbarItems(context);\n\t}\n\n\tprivate registerMark(context: PluginContext, def: MarkDefinition): void {\n\t\tconst commandName: string = toCommandName(def.type);\n\t\tconst toolbarVisible: boolean = this.isToolbarVisible(def.configKey);\n\n\t\tcontext.registerMarkSpec({\n\t\t\ttype: def.type,\n\t\t\trank: def.rank,\n\t\t\ttoDOM() {\n\t\t\t\treturn document.createElement(def.tag);\n\t\t\t},\n\t\t\ttoHTMLString: (_mark, content) => def.toHTMLString(content),\n\t\t\tparseHTML: def.parseHTML,\n\t\t\tsanitize: def.sanitize,\n\t\t});\n\n\t\tcontext.registerCommand(commandName, () =>\n\t\t\tdispatchIfPresent(context, toggleMark(context.getState(), mkType(def.type))),\n\t\t);\n\n\t\tif (toolbarVisible) {\n\t\t\tconst label: string =\n\t\t\t\tdef.type === 'superscript' ? this.locale.superscriptLabel : this.locale.subscriptLabel;\n\t\t\tconst tooltip: string =\n\t\t\t\tdef.type === 'superscript'\n\t\t\t\t\t? this.locale.superscriptTooltip(formatShortcut(def.keyBinding))\n\t\t\t\t\t: this.locale.subscriptTooltip(formatShortcut(def.keyBinding));\n\t\t\tcontext.registerToolbarItem({\n\t\t\t\tid: def.type,\n\t\t\t\tgroup: 'format',\n\t\t\t\ticon: def.icon,\n\t\t\t\tlabel,\n\t\t\t\ttooltip,\n\t\t\t\tcommand: commandName,\n\t\t\t\tisActive: (state) => isMarkActive(state, mkType(def.type)),\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate registerKeymaps(context: PluginContext, marks: readonly MarkDefinition[]): void {\n\t\tconst keymap: Record<string, () => boolean> = {};\n\t\tfor (const def of marks) {\n\t\t\tconst commandName: string = toCommandName(def.type);\n\t\t\tkeymap[def.keyBinding] = () => context.executeCommand(commandName);\n\t\t}\n\t\tif (Object.keys(keymap).length > 0) {\n\t\t\tcontext.registerKeymap(keymap);\n\t\t}\n\t}\n\n\t/**\n\t * Ensures superscript and subscript are mutually exclusive.\n\t * When an addMark step for one type is found, a removeMark step\n\t * for the opposite type is injected. For stored marks, the opposite\n\t * mark is filtered out.\n\t */\n\tprivate registerExclusivityMiddleware(\n\t\tcontext: PluginContext,\n\t\tenabledMarks: readonly MarkDefinition[],\n\t): void {\n\t\tconst bothEnabled: boolean =\n\t\t\tenabledMarks.some((d) => d.type === 'superscript') &&\n\t\t\tenabledMarks.some((d) => d.type === 'subscript');\n\n\t\tif (!bothEnabled) return;\n\n\t\tcontext.registerMiddleware(\n\t\t\t(tr, _state, next) => {\n\t\t\t\tlet patched = false;\n\n\t\t\t\t// Handle addMark steps: inject removeMark for the opposite type\n\t\t\t\tconst patchedSteps: Step[] = [];\n\t\t\t\tfor (const step of tr.steps) {\n\t\t\t\t\tif (step.type !== 'addMark') {\n\t\t\t\t\t\tpatchedSteps.push(step);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst markName: string = step.mark.type;\n\t\t\t\t\tconst def: MarkDefinition | undefined = MARK_DEFINITIONS.find((d) => d.type === markName);\n\t\t\t\t\tif (!def) {\n\t\t\t\t\t\tpatchedSteps.push(step);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tpatched = true;\n\t\t\t\t\tconst removeStep: RemoveMarkStep = {\n\t\t\t\t\t\ttype: 'removeMark',\n\t\t\t\t\t\tblockId: step.blockId,\n\t\t\t\t\t\tfrom: step.from,\n\t\t\t\t\t\tto: step.to,\n\t\t\t\t\t\tmark: { type: mkType(def.opposite) },\n\t\t\t\t\t\t...(step.path ? { path: step.path } : {}),\n\t\t\t\t\t};\n\t\t\t\t\tpatchedSteps.push(removeStep, step);\n\t\t\t\t}\n\n\t\t\t\t// Handle stored marks: remove the opposite mark\n\t\t\t\tlet storedMarksAfter: readonly Mark[] | null = tr.storedMarksAfter;\n\t\t\t\tif (storedMarksAfter) {\n\t\t\t\t\tconst hasSup: boolean = storedMarksAfter.some((m) => m.type === 'superscript');\n\t\t\t\t\tconst hasSub: boolean = storedMarksAfter.some((m) => m.type === 'subscript');\n\n\t\t\t\t\tif (hasSup && hasSub) {\n\t\t\t\t\t\t// Keep the one that was most recently added (last in array)\n\t\t\t\t\t\tconst lastSupIdx: number = storedMarksAfter.findLastIndex(\n\t\t\t\t\t\t\t(m) => m.type === 'superscript',\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst lastSubIdx: number = storedMarksAfter.findLastIndex(\n\t\t\t\t\t\t\t(m) => m.type === 'subscript',\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst removeType: string = lastSupIdx > lastSubIdx ? 'subscript' : 'superscript';\n\n\t\t\t\t\t\tstoredMarksAfter = storedMarksAfter.filter((m) => m.type !== removeType);\n\t\t\t\t\t\tpatched = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnext(patched ? { ...tr, steps: patchedSteps, storedMarksAfter } : tr);\n\t\t\t},\n\t\t\t{ name: 'super-sub:exclusivity' },\n\t\t);\n\t}\n\n\t/**\n\t * Registers disabled toolbar buttons for marks whose feature is disabled\n\t * but whose toolbar button is explicitly requested.\n\t */\n\tprivate registerDisabledToolbarItems(context: PluginContext): void {\n\t\tif (!this.config.toolbar) return;\n\n\t\tfor (const def of MARK_DEFINITIONS) {\n\t\t\tconst featureEnabled: boolean = this.config[def.configKey];\n\t\t\tconst toolbarVisible: boolean = this.config.toolbar[def.configKey] ?? true;\n\n\t\t\tif (!featureEnabled && toolbarVisible) {\n\t\t\t\tconst label: string =\n\t\t\t\t\tdef.type === 'superscript' ? this.locale.superscriptLabel : this.locale.subscriptLabel;\n\t\t\t\tcontext.registerToolbarItem({\n\t\t\t\t\tid: def.type,\n\t\t\t\t\tgroup: 'format',\n\t\t\t\t\ticon: def.icon,\n\t\t\t\t\tlabel,\n\t\t\t\t\tcommand: toCommandName(def.type),\n\t\t\t\t\tisEnabled: () => false,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate isToolbarVisible(configKey: keyof Omit<SuperSubConfig, 'toolbar' | 'locale'>): boolean {\n\t\tif (!this.config.toolbar) return true;\n\t\treturn this.config.toolbar[configKey] ?? true;\n\t}\n}\n"],"mappings":"wNAiB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AAI,MAC3B,UAAA,KAAiB,GAEnB,CACD,CACD,CAEA,gBAAA,CAAyB,GACxB,OAAK,KAAK,OAAO,UACV,KAAK,OAAO,QAAQ,KAAc,EAC1C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var t=["keyword","string","comment","number","function","operator","punctuation","boolean","null","property","type","annotation","tag","attribute","constant","regex"];function n(t){return"string"==typeof t?t:t.color}function o(t){return"object"==typeof t?t.fontStyle:void 0}function e(t){return"object"==typeof t?t.fontWeight:void 0}export{e as i,n,o as r,t};
|
|
2
|
+
//# sourceMappingURL=SyntaxTokenTypes-BUCOMtL8.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyntaxTokenTypes-BUCOMtL8.mjs","names":[],"sources":["../../src/editor/theme/SyntaxTokenTypes.ts"],"sourcesContent":["/**\n * Canonical syntax token type list and style resolution utilities.\n *\n * Single source of truth for all syntax highlighting token types.\n * Adding a new token type here automatically propagates to themes,\n * CSS variables, and token CSS classes.\n */\n\n/** All supported syntax token types. */\nexport const SYNTAX_TOKEN_TYPES = [\n\t'keyword',\n\t'string',\n\t'comment',\n\t'number',\n\t'function',\n\t'operator',\n\t'punctuation',\n\t'boolean',\n\t'null',\n\t'property',\n\t'type',\n\t'annotation',\n\t'tag',\n\t'attribute',\n\t'constant',\n\t'regex',\n] as const;\n\n/** A syntax token type from the canonical list. */\nexport type SyntaxTokenType = (typeof SYNTAX_TOKEN_TYPES)[number];\n\n/** Per-token style: color plus optional font weight and style. */\nexport interface TokenStyle {\n\treadonly color: string;\n\treadonly fontWeight?: 'normal' | 'bold';\n\treadonly fontStyle?: 'normal' | 'italic';\n}\n\n/** A token style value is either a plain color string or a full TokenStyle object. */\nexport type TokenStyleValue = string | TokenStyle;\n\n/** Extracts the color from a TokenStyleValue. */\nexport function resolveTokenColor(value: TokenStyleValue): string {\n\treturn typeof value === 'string' ? value : value.color;\n}\n\n/** Extracts the font-style from a TokenStyleValue, or undefined if not set. */\nexport function resolveTokenFontStyle(value: TokenStyleValue): string | undefined {\n\treturn typeof value === 'object' ? value.fontStyle : undefined;\n}\n\n/** Extracts the font-weight from a TokenStyleValue, or undefined if not set. */\nexport function resolveTokenFontWeight(value: TokenStyleValue): string | undefined {\n\treturn typeof value === 'object' ? value.fontWeight : undefined;\n}\n"],"mappings":"AASA,IAAa,EAAqB,CACjC,UACA,SACA,UACA,SACA,WACA,WACA,cACA,UACA,OACA,WACA,OACA,aACA,MACA,YACA,WACA,SAiBD,SAAgB,EAAkB,GACjC,MAAwB,iBAAV,EAAqB,EAAQ,EAAM,KAClD,CAGA,SAAgB,EAAsB,GACrC,MAAwB,iBAAV,EAAqB,EAAM,eAAY,CACtD,CAGA,SAAgB,EAAuB,GACtC,MAAwB,iBAAV,EAAqB,EAAM,gBAAa,CACvD"}
|