@notectl/core 2.4.0 → 2.5.0
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 +1 -1
- package/dist/chunks/AlignmentPlugin-C26pIVcw.mjs +2 -0
- package/dist/chunks/AlignmentPlugin-C26pIVcw.mjs.map +1 -0
- package/dist/chunks/AttrRegistry-Di936wMv.mjs.map +1 -1
- package/dist/chunks/AttributedMarkCommands-DKHuhZA7.mjs.map +1 -1
- package/dist/chunks/BidiIsolationPlugin-nWd1NEF-.mjs +2 -0
- package/dist/chunks/BidiIsolationPlugin-nWd1NEF-.mjs.map +1 -0
- package/dist/chunks/BlockAlignment-BqyBQ4uV.mjs.map +1 -1
- package/dist/chunks/BlockInsertion-CXfXqUZl.mjs +2 -0
- package/dist/chunks/BlockInsertion-CXfXqUZl.mjs.map +1 -0
- package/dist/chunks/BlockTypePickerRegistry-BTET9jM-.mjs.map +1 -1
- package/dist/chunks/BlockquotePlugin-Bag42Zc0.mjs +2 -0
- package/dist/chunks/BlockquotePlugin-Bag42Zc0.mjs.map +1 -0
- package/dist/chunks/CSSValueEquivalence-DeyUKPQ7.mjs.map +1 -1
- package/dist/chunks/CaretNavigationPlugin-DUAoHygg.mjs +2 -0
- package/dist/chunks/CaretNavigationPlugin-DUAoHygg.mjs.map +1 -0
- package/dist/chunks/CodeBlockPlugin-Dk_J8NAl.mjs +2 -0
- package/dist/chunks/CodeBlockPlugin-Dk_J8NAl.mjs.map +1 -0
- package/dist/chunks/ColorGrid-DAs0--ty.mjs.map +1 -1
- package/dist/chunks/ColorPickerPopup-B6340f3p.mjs.map +1 -1
- package/dist/chunks/ColorValidation-ZBKZ_gTr.mjs.map +1 -1
- package/dist/chunks/Commands-vqbwh6Ic.mjs +2 -0
- package/dist/chunks/Commands-vqbwh6Ic.mjs.map +1 -0
- package/dist/chunks/ContentModel-dkGOh3N7.mjs +2 -0
- package/dist/chunks/ContentModel-dkGOh3N7.mjs.map +1 -0
- package/dist/chunks/CursorMarks-CqHLzGNI.mjs.map +1 -1
- package/dist/chunks/Decoration-BoFcdSXk.mjs.map +1 -1
- package/dist/chunks/DirectionDetection-a-1iksmh.mjs.map +1 -1
- package/dist/chunks/DirectionIcons-Bbawl9ei.mjs.map +1 -1
- package/dist/chunks/Document-ssR6hBzG.mjs.map +1 -1
- package/dist/chunks/DocumentParser-D4g5npEi.mjs +2 -0
- package/dist/chunks/DocumentParser-D4g5npEi.mjs.map +1 -0
- package/dist/chunks/DomUtils-Bf7JLFlx.mjs.map +1 -1
- package/dist/chunks/EditorEventBoundary-zpYRxryo.mjs.map +1 -1
- package/dist/chunks/EditorUI-DrQI95FW.mjs +2 -0
- package/dist/chunks/EditorUI-DrQI95FW.mjs.map +1 -0
- package/dist/chunks/FontPlugin-Bzlluh1_.mjs +2 -0
- package/dist/chunks/FontPlugin-Bzlluh1_.mjs.map +1 -0
- package/dist/chunks/FontSizePlugin-kv3zHG0f.mjs +2 -0
- package/dist/chunks/FontSizePlugin-kv3zHG0f.mjs.map +1 -0
- package/dist/chunks/FormulaPlugin-20vW4Gge.mjs +2 -0
- package/dist/chunks/FormulaPlugin-20vW4Gge.mjs.map +1 -0
- package/dist/chunks/GapCursorPlugin-BPyNXY4H.mjs +2 -0
- package/dist/chunks/GapCursorPlugin-BPyNXY4H.mjs.map +1 -0
- package/dist/chunks/HTMLSanitization-BRipXyhI.mjs +2 -0
- package/dist/chunks/HTMLSanitization-BRipXyhI.mjs.map +1 -0
- package/dist/chunks/HTMLUtils-DTpsjZyK.mjs.map +1 -1
- package/dist/chunks/{HardBreakPlugin-svNnJ9Xj.mjs → HardBreakPlugin-lo8Mcg9G.mjs} +2 -2
- package/dist/chunks/HardBreakPlugin-lo8Mcg9G.mjs.map +1 -0
- package/dist/chunks/HeadingPlugin-CEZF5DBM.mjs +2 -0
- package/dist/chunks/HeadingPlugin-CEZF5DBM.mjs.map +1 -0
- package/dist/chunks/HighlightPlugin-yH44UWoe.mjs +2 -0
- package/dist/chunks/HighlightPlugin-yH44UWoe.mjs.map +1 -0
- package/dist/chunks/HorizontalRulePlugin-SNNum-9V.mjs +2 -0
- package/dist/chunks/HorizontalRulePlugin-SNNum-9V.mjs.map +1 -0
- package/dist/chunks/ImagePlugin-aeqHr5zx.mjs +2 -0
- package/dist/chunks/ImagePlugin-aeqHr5zx.mjs.map +1 -0
- package/dist/chunks/InlineCodePlugin-CIks06ti.mjs +2 -0
- package/dist/chunks/InlineCodePlugin-CIks06ti.mjs.map +1 -0
- package/dist/chunks/InlineStyleMarkSpec-BhfGgfH9.mjs.map +1 -1
- package/dist/chunks/KeyboardNav-D0my3wuy.mjs.map +1 -1
- package/dist/chunks/LinkPlugin-CFw22a9X.mjs +2 -0
- package/dist/chunks/LinkPlugin-CFw22a9X.mjs.map +1 -0
- package/dist/chunks/ListPlugin-ZNEx8pvk.mjs +2 -0
- package/dist/chunks/ListPlugin-ZNEx8pvk.mjs.map +1 -0
- package/dist/chunks/LocaleLoader-DEpTFuVc.mjs +2 -0
- package/dist/chunks/LocaleLoader-DEpTFuVc.mjs.map +1 -0
- package/dist/chunks/MarkCommands-C0ps9h0z.mjs.map +1 -1
- package/dist/chunks/MarkInputRule-DNneF2gp.mjs.map +1 -1
- package/dist/chunks/{MarkdownHTMLRegistry-BunUDiza.mjs → MarkdownHTMLRegistry-Cj7N2wqs.mjs} +2 -2
- package/dist/chunks/MarkdownHTMLRegistry-Cj7N2wqs.mjs.map +1 -0
- package/dist/chunks/{MarkdownParser-CvYOvU3d.mjs → MarkdownParser-JOfPSvGv.mjs} +2 -2
- package/dist/chunks/MarkdownParser-JOfPSvGv.mjs.map +1 -0
- package/dist/chunks/{MarkdownSerializer-CdUBWWGI.mjs → MarkdownSerializer-Y6saYClE.mjs} +2 -2
- package/dist/chunks/MarkdownSerializer-Y6saYClE.mjs.map +1 -0
- package/dist/chunks/MathFont-BS8IwYh2.mjs.map +1 -1
- package/dist/chunks/NavigationQueries-CaKfccu7.mjs.map +1 -1
- package/dist/chunks/NodeResolver-F4RtpoEd.mjs.map +1 -1
- package/dist/chunks/{NodeSelectionCommands-B0Sb4ux4.mjs → NodeSelectionCommands-CAqIHW_6.mjs} +2 -2
- package/dist/chunks/NodeSelectionCommands-CAqIHW_6.mjs.map +1 -0
- package/dist/chunks/NodeSpecPatching-BrjPAbqe.mjs.map +1 -1
- package/dist/chunks/Platform-ByobkiCc.mjs.map +1 -1
- package/dist/chunks/PopupKeyboardPatterns-BcwdDxRq.mjs.map +1 -1
- package/dist/chunks/PopupManager-DpxoBl54.mjs +2 -0
- package/dist/chunks/PopupManager-DpxoBl54.mjs.map +1 -0
- package/dist/chunks/PopupPositioning-CIqgpqlW.mjs.map +1 -1
- package/dist/chunks/PrintPlugin-CYkdUy-m.mjs +2 -0
- package/dist/chunks/PrintPlugin-CYkdUy-m.mjs.map +1 -0
- package/dist/chunks/RangeIterator-sJ_c9MNr.mjs.map +1 -1
- package/dist/chunks/Schema-BSM4YLNT.mjs.map +1 -1
- package/dist/chunks/{SchemaRegistry-Cs7rxafF.mjs → SchemaRegistry-CT3T7S1i.mjs} +2 -2
- package/dist/chunks/SchemaRegistry-CT3T7S1i.mjs.map +1 -0
- package/dist/chunks/Selection-DC6AOGgF.mjs.map +1 -1
- package/dist/chunks/SelectionReplacement-Cj4FLlPz.mjs +2 -0
- package/dist/chunks/SelectionReplacement-Cj4FLlPz.mjs.map +1 -0
- package/dist/chunks/{SelectionSync-BkjCwGp-.mjs → SelectionSync-8y0nbBHZ.mjs} +2 -2
- package/dist/chunks/SelectionSync-8y0nbBHZ.mjs.map +1 -0
- package/dist/chunks/SelectionTransactions-mQ1NfMEg.mjs.map +1 -1
- package/dist/chunks/ShortcutFormatting-TwiufqeV.mjs.map +1 -1
- package/dist/chunks/SimpleMark-DPTsIl9w.mjs +2 -0
- package/dist/chunks/SimpleMark-DPTsIl9w.mjs.map +1 -0
- package/dist/chunks/SmartPastePlugin-BSMHDDQ2.mjs +2 -0
- package/dist/chunks/SmartPastePlugin-BSMHDDQ2.mjs.map +1 -0
- package/dist/chunks/StarterFonts-BDQPg-cu.mjs.map +1 -1
- package/dist/chunks/StrikethroughPlugin-CqqIF3Zk.mjs +2 -0
- package/dist/chunks/StrikethroughPlugin-CqqIF3Zk.mjs.map +1 -0
- package/dist/chunks/StyleClassNames-BsAx7k5T.mjs.map +1 -1
- package/dist/chunks/StyleRuntime-C0RSqKzG.mjs.map +1 -1
- package/dist/chunks/SuperSubPlugin-5ZFM6wdU.mjs +2 -0
- package/dist/chunks/SuperSubPlugin-5ZFM6wdU.mjs.map +1 -0
- package/dist/chunks/SyntaxTokenTypes-BUCOMtL8.mjs.map +1 -1
- package/dist/chunks/{TableDimensions-BSEOEox2.mjs → TableDimensions-B-OWjTuW.mjs} +2 -2
- package/dist/chunks/TableDimensions-B-OWjTuW.mjs.map +1 -0
- package/dist/chunks/TablePlugin-D1Wg-pjl.mjs +2 -0
- package/dist/chunks/TablePlugin-D1Wg-pjl.mjs.map +1 -0
- package/dist/chunks/TableSelectionTypes-t2cLhe16.mjs +2 -0
- package/dist/chunks/TableSelectionTypes-t2cLhe16.mjs.map +1 -0
- package/dist/chunks/TextColorPlugin-Dwp7eW7F.mjs +2 -0
- package/dist/chunks/TextColorPlugin-Dwp7eW7F.mjs.map +1 -0
- package/dist/chunks/{TextDirectionAutoPlugin-DOH5cfyy.mjs → TextDirectionAutoPlugin-CkIETM5n.mjs} +2 -2
- package/dist/chunks/TextDirectionAutoPlugin-CkIETM5n.mjs.map +1 -0
- package/dist/chunks/TextDirectionPlugin-DAcPR5Qc.mjs +2 -0
- package/dist/chunks/TextDirectionPlugin-DAcPR5Qc.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-vml-lduV.mjs +2 -0
- package/dist/chunks/TextFormattingPlugin-vml-lduV.mjs.map +1 -0
- package/dist/chunks/ThemeEngine-kIXtSRkI.mjs.map +1 -1
- package/dist/chunks/ToolbarPlugin-Cxmb0MFr.mjs +2 -0
- package/dist/chunks/ToolbarPlugin-Cxmb0MFr.mjs.map +1 -0
- package/dist/chunks/TypeBrands-Ch9856Gb.mjs.map +1 -1
- package/dist/chunks/TypedKeys-CA4bfw9O.mjs.map +1 -1
- package/dist/chunks/VideoPlugin-lZCBlIon.mjs +2 -0
- package/dist/chunks/VideoPlugin-lZCBlIon.mjs.map +1 -0
- package/dist/chunks/XmlPatterns-RN32-0ob.mjs.map +1 -1
- package/dist/chunks/XmlSupport-3Za6SIqF.mjs.map +1 -1
- package/dist/chunks/ar--Isa9OHJ.mjs.map +1 -1
- package/dist/chunks/ar--O0A9OTR.mjs.map +1 -1
- package/dist/chunks/ar-0g2bmXTn.mjs.map +1 -1
- package/dist/chunks/ar-4b8e2YSc.mjs.map +1 -1
- package/dist/chunks/ar-B03uY4xr.mjs.map +1 -1
- package/dist/chunks/ar-BAfInw85.mjs.map +1 -1
- package/dist/chunks/ar-BRX5E_Pw.mjs.map +1 -1
- package/dist/chunks/ar-BWOue6jG.mjs.map +1 -1
- package/dist/chunks/ar-Bdmunk5h.mjs.map +1 -1
- package/dist/chunks/ar-BwaoCUVN.mjs.map +1 -1
- package/dist/chunks/ar-BzqAYGER.mjs.map +1 -1
- package/dist/chunks/ar-C9lO1jsY.mjs.map +1 -1
- package/dist/chunks/ar-CMXjVzFx.mjs.map +1 -1
- package/dist/chunks/ar-CR6UdFL9.mjs.map +1 -1
- package/dist/chunks/ar-CrOb0jL2.mjs.map +1 -1
- package/dist/chunks/ar-Cy_77yRf.mjs.map +1 -1
- package/dist/chunks/ar-D1jFXqLJ.mjs.map +1 -1
- package/dist/chunks/ar-DahJwMI9.mjs.map +1 -1
- package/dist/chunks/ar-Dcl3kgtd.mjs.map +1 -1
- package/dist/chunks/ar-Dg9PdDet.mjs.map +1 -1
- package/dist/chunks/ar-Dp1oBWyG.mjs +2 -0
- package/dist/chunks/ar-Dp1oBWyG.mjs.map +1 -0
- package/dist/chunks/ar-Dx2lO0Nm.mjs.map +1 -1
- package/dist/chunks/ar-NV_puwI2.mjs.map +1 -1
- package/dist/chunks/ar-Uzo1Azdw.mjs.map +1 -1
- package/dist/chunks/ar-XmSFrtmd.mjs.map +1 -1
- package/dist/chunks/ar-eOA3UmiE.mjs.map +1 -1
- package/dist/chunks/ar-sGZ-oZqB.mjs.map +1 -1
- package/dist/chunks/color-picker-D6HrTsDM.mjs.map +1 -1
- package/dist/chunks/de-B8-w9gPi.mjs.map +1 -1
- package/dist/chunks/de-B9zSHWqY.mjs.map +1 -1
- package/dist/chunks/de-BX4y4PlH.mjs.map +1 -1
- package/dist/chunks/de-BXQBXxFJ.mjs.map +1 -1
- package/dist/chunks/de-BcPntcnr.mjs.map +1 -1
- package/dist/chunks/de-BdD3DpUB.mjs.map +1 -1
- package/dist/chunks/de-Bwxlcuee.mjs.map +1 -1
- package/dist/chunks/de-BxQIt_1Y.mjs.map +1 -1
- package/dist/chunks/de-C-Yf378-.mjs.map +1 -1
- package/dist/chunks/de-C7uehgMu.mjs.map +1 -1
- package/dist/chunks/de-C9ZhDqPi.mjs.map +1 -1
- package/dist/chunks/de-CHcv_Vmf.mjs.map +1 -1
- package/dist/chunks/de-CTzAMkXC.mjs.map +1 -1
- package/dist/chunks/de-CaeEIyzV.mjs.map +1 -1
- package/dist/chunks/de-D3J8XPCR.mjs +2 -0
- package/dist/chunks/de-D3J8XPCR.mjs.map +1 -0
- package/dist/chunks/de-DHs9i4af.mjs.map +1 -1
- package/dist/chunks/de-DJ5EkXQo.mjs.map +1 -1
- package/dist/chunks/de-DRbhnS4T.mjs.map +1 -1
- package/dist/chunks/de-DViI26lG.mjs.map +1 -1
- package/dist/chunks/de-DY3obIAF.mjs.map +1 -1
- package/dist/chunks/de-DcMhfRBu.mjs.map +1 -1
- package/dist/chunks/de-DiPz7abS.mjs.map +1 -1
- package/dist/chunks/de-Dl4QFHMa.mjs.map +1 -1
- package/dist/chunks/de-XCCpWyg0.mjs.map +1 -1
- package/dist/chunks/de-e6J6nvAD.mjs.map +1 -1
- package/dist/chunks/de-i95F9SDy.mjs.map +1 -1
- package/dist/chunks/de-uKR7koQe.mjs.map +1 -1
- package/dist/chunks/es-B0Za939C.mjs.map +1 -1
- package/dist/chunks/es-B8K3Yvf3.mjs.map +1 -1
- package/dist/chunks/es-BIXm2Coj.mjs.map +1 -1
- package/dist/chunks/es-BJHF95J_.mjs.map +1 -1
- package/dist/chunks/es-BMm9kqjC.mjs.map +1 -1
- package/dist/chunks/es-BQ9dox_E.mjs.map +1 -1
- package/dist/chunks/es-BQweZX6P.mjs.map +1 -1
- package/dist/chunks/es-Bbz885DZ.mjs +2 -0
- package/dist/chunks/es-Bbz885DZ.mjs.map +1 -0
- package/dist/chunks/es-BdpTTRuX.mjs.map +1 -1
- package/dist/chunks/es-C7uVqFYr.mjs.map +1 -1
- package/dist/chunks/es-CCQFu1t1.mjs.map +1 -1
- package/dist/chunks/es-CEAJj7aB.mjs.map +1 -1
- package/dist/chunks/es-CUKJujcb.mjs.map +1 -1
- package/dist/chunks/es-CXuMz87y.mjs.map +1 -1
- package/dist/chunks/es-CgMfhkJJ.mjs.map +1 -1
- package/dist/chunks/es-CtOtKQCP.mjs.map +1 -1
- package/dist/chunks/es-DD01rZ6N.mjs.map +1 -1
- package/dist/chunks/es-DDoqchUq.mjs.map +1 -1
- package/dist/chunks/es-DFokqQst.mjs.map +1 -1
- package/dist/chunks/es-DHxdoEzR.mjs.map +1 -1
- package/dist/chunks/es-DehVGwQ8.mjs.map +1 -1
- package/dist/chunks/es-DrJyl38L.mjs.map +1 -1
- package/dist/chunks/es-fTW0TkYV.mjs.map +1 -1
- package/dist/chunks/es-kfKiqpyD.mjs.map +1 -1
- package/dist/chunks/es-nRLq7bgP.mjs.map +1 -1
- package/dist/chunks/es-paXY7HFt.mjs.map +1 -1
- package/dist/chunks/es-xuahrvJN.mjs.map +1 -1
- package/dist/chunks/fr-0qEo3bRP.mjs.map +1 -1
- package/dist/chunks/fr-5HkMazAf.mjs.map +1 -1
- package/dist/chunks/fr-B9pBLaVx.mjs.map +1 -1
- package/dist/chunks/fr-BRXUnq3R.mjs.map +1 -1
- package/dist/chunks/fr-BSUKEtTk.mjs.map +1 -1
- package/dist/chunks/fr-BeRlON1t.mjs.map +1 -1
- package/dist/chunks/fr-Bg937iAy.mjs.map +1 -1
- package/dist/chunks/fr-BwWrFThE.mjs.map +1 -1
- package/dist/chunks/fr-C3EKRThN.mjs.map +1 -1
- package/dist/chunks/fr-CKjH6tJI.mjs.map +1 -1
- package/dist/chunks/fr-CQs0-pNX.mjs.map +1 -1
- package/dist/chunks/fr-CfhyYN-t.mjs.map +1 -1
- package/dist/chunks/fr-D0MDdoir.mjs.map +1 -1
- package/dist/chunks/fr-D5ulA3Z6.mjs.map +1 -1
- package/dist/chunks/fr-DEZ_oxzS.mjs.map +1 -1
- package/dist/chunks/fr-DciSEykY.mjs.map +1 -1
- package/dist/chunks/fr-DhWQzZy3.mjs.map +1 -1
- package/dist/chunks/fr-DiDhVhyV.mjs.map +1 -1
- package/dist/chunks/fr-DjMZ-3K5.mjs.map +1 -1
- package/dist/chunks/fr-F2ZrfVaF.mjs.map +1 -1
- package/dist/chunks/fr-GEgM1j3w.mjs +2 -0
- package/dist/chunks/fr-GEgM1j3w.mjs.map +1 -0
- package/dist/chunks/fr-KXmbys88.mjs.map +1 -1
- package/dist/chunks/fr-NVOinLyF.mjs.map +1 -1
- package/dist/chunks/fr-SbpHNrQ-.mjs.map +1 -1
- package/dist/chunks/fr-ZsRdLuys.mjs.map +1 -1
- package/dist/chunks/fr-eC0UdAPu.mjs.map +1 -1
- package/dist/chunks/fr-fshsDD66.mjs.map +1 -1
- package/dist/chunks/full-wDTdOuGt.mjs +2 -0
- package/dist/chunks/full-wDTdOuGt.mjs.map +1 -0
- package/dist/chunks/hi-4CiAKVjT.mjs.map +1 -1
- package/dist/chunks/hi-B-ZuX4aN.mjs.map +1 -1
- package/dist/chunks/hi-B2YB3Bo4.mjs.map +1 -1
- package/dist/chunks/hi-B2uhiPCN.mjs.map +1 -1
- package/dist/chunks/hi-B5cl8TWK.mjs.map +1 -1
- package/dist/chunks/hi-BNJIGWQQ.mjs.map +1 -1
- package/dist/chunks/hi-BOMkDPqC.mjs.map +1 -1
- package/dist/chunks/hi-Bl-yeeOI.mjs.map +1 -1
- package/dist/chunks/hi-BsZzSMfL.mjs.map +1 -1
- package/dist/chunks/hi-By8YwVIX.mjs.map +1 -1
- package/dist/chunks/hi-BzbMD_cP.mjs.map +1 -1
- package/dist/chunks/hi-C2jEsf8v.mjs.map +1 -1
- package/dist/chunks/hi-CKg8i4Mm.mjs +2 -0
- package/dist/chunks/hi-CKg8i4Mm.mjs.map +1 -0
- package/dist/chunks/hi-CTWubxLY.mjs.map +1 -1
- package/dist/chunks/hi-CoclKAUM.mjs.map +1 -1
- package/dist/chunks/hi-CrmakMVj.mjs.map +1 -1
- package/dist/chunks/hi-DWX6k5ZD.mjs.map +1 -1
- package/dist/chunks/hi-DY55FuDK.mjs.map +1 -1
- package/dist/chunks/hi-DrC2H81d.mjs.map +1 -1
- package/dist/chunks/hi-DsdXcOB6.mjs.map +1 -1
- package/dist/chunks/hi-Dt89SxNy.mjs.map +1 -1
- package/dist/chunks/hi-J8ErB5nB.mjs.map +1 -1
- package/dist/chunks/hi-L6pJxZam.mjs.map +1 -1
- package/dist/chunks/hi-SECtQQzq.mjs.map +1 -1
- package/dist/chunks/hi-j3TDLMYd.mjs.map +1 -1
- package/dist/chunks/hi-l6DA-aOw.mjs.map +1 -1
- package/dist/chunks/hi-uACJUw53.mjs.map +1 -1
- package/dist/chunks/minimal-FfmHwMGU.mjs +2 -0
- package/dist/chunks/minimal-FfmHwMGU.mjs.map +1 -0
- package/dist/chunks/nl-2IdjTNeJ.mjs +2 -0
- package/dist/chunks/nl-2IdjTNeJ.mjs.map +1 -0
- package/dist/chunks/nl-B1i04NvZ.mjs +2 -0
- package/dist/chunks/nl-B1i04NvZ.mjs.map +1 -0
- package/dist/chunks/nl-BEmzpzKO.mjs +2 -0
- package/dist/chunks/nl-BEmzpzKO.mjs.map +1 -0
- package/dist/chunks/nl-B_U0D3Qq.mjs +2 -0
- package/dist/chunks/nl-B_U0D3Qq.mjs.map +1 -0
- package/dist/chunks/nl-C437Xz6z.mjs +2 -0
- package/dist/chunks/nl-C437Xz6z.mjs.map +1 -0
- package/dist/chunks/nl-C5P8Fogm.mjs +2 -0
- package/dist/chunks/nl-C5P8Fogm.mjs.map +1 -0
- package/dist/chunks/nl-CST62bzx.mjs +2 -0
- package/dist/chunks/nl-CST62bzx.mjs.map +1 -0
- package/dist/chunks/nl-CWQT-W-6.mjs +2 -0
- package/dist/chunks/nl-CWQT-W-6.mjs.map +1 -0
- package/dist/chunks/nl-CdpcDkbM.mjs +2 -0
- package/dist/chunks/nl-CdpcDkbM.mjs.map +1 -0
- package/dist/chunks/nl-CgYWZnga.mjs +2 -0
- package/dist/chunks/nl-CgYWZnga.mjs.map +1 -0
- package/dist/chunks/nl-Cr--x8bX.mjs +2 -0
- package/dist/chunks/nl-Cr--x8bX.mjs.map +1 -0
- package/dist/chunks/nl-Cwl5dxFZ.mjs +2 -0
- package/dist/chunks/nl-Cwl5dxFZ.mjs.map +1 -0
- package/dist/chunks/nl-Czjd9Bw9.mjs +2 -0
- package/dist/chunks/nl-Czjd9Bw9.mjs.map +1 -0
- package/dist/chunks/nl-DUOT2ZMQ.mjs +2 -0
- package/dist/chunks/nl-DUOT2ZMQ.mjs.map +1 -0
- package/dist/chunks/nl-DYnRYvZ5.mjs +2 -0
- package/dist/chunks/nl-DYnRYvZ5.mjs.map +1 -0
- package/dist/chunks/nl-DaNJ-ffX.mjs +2 -0
- package/dist/chunks/nl-DaNJ-ffX.mjs.map +1 -0
- package/dist/chunks/nl-DeOJ64xy.mjs +2 -0
- package/dist/chunks/nl-DeOJ64xy.mjs.map +1 -0
- package/dist/chunks/nl-DwZajfpP.mjs +2 -0
- package/dist/chunks/nl-DwZajfpP.mjs.map +1 -0
- package/dist/chunks/nl-Dyjc9M7o.mjs +2 -0
- package/dist/chunks/nl-Dyjc9M7o.mjs.map +1 -0
- package/dist/chunks/nl-GBpv7W4L.mjs +2 -0
- package/dist/chunks/nl-GBpv7W4L.mjs.map +1 -0
- package/dist/chunks/nl-HFfWJOEo.mjs +2 -0
- package/dist/chunks/nl-HFfWJOEo.mjs.map +1 -0
- package/dist/chunks/nl-KqmiCeD7.mjs +2 -0
- package/dist/chunks/nl-KqmiCeD7.mjs.map +1 -0
- package/dist/chunks/nl-_QT7e2Qt.mjs +2 -0
- package/dist/chunks/nl-_QT7e2Qt.mjs.map +1 -0
- package/dist/chunks/nl-i79IajbC.mjs +2 -0
- package/dist/chunks/nl-i79IajbC.mjs.map +1 -0
- package/dist/chunks/nl-lcZvrAz6.mjs +2 -0
- package/dist/chunks/nl-lcZvrAz6.mjs.map +1 -0
- package/dist/chunks/nl-tWJ2imhe.mjs +2 -0
- package/dist/chunks/nl-tWJ2imhe.mjs.map +1 -0
- package/dist/chunks/nl-xfiNOCgg.mjs +2 -0
- package/dist/chunks/nl-xfiNOCgg.mjs.map +1 -0
- package/dist/chunks/pt-5VeuNDd2.mjs.map +1 -1
- package/dist/chunks/pt-BCXgUDiU.mjs.map +1 -1
- package/dist/chunks/pt-BDam9cDu.mjs.map +1 -1
- package/dist/chunks/pt-Bb908r0n.mjs.map +1 -1
- package/dist/chunks/pt-BkpVtod-.mjs.map +1 -1
- package/dist/chunks/pt-BlFAJZo7.mjs.map +1 -1
- package/dist/chunks/pt-Bu7Mbz67.mjs.map +1 -1
- package/dist/chunks/pt-BuZ7acHF.mjs.map +1 -1
- package/dist/chunks/pt-C8sOyw0V.mjs.map +1 -1
- package/dist/chunks/pt-CEUgbrii.mjs.map +1 -1
- package/dist/chunks/pt-CFrcl1v_.mjs.map +1 -1
- package/dist/chunks/pt-CMrFpUWS.mjs.map +1 -1
- package/dist/chunks/pt-CMx2wPPY.mjs.map +1 -1
- package/dist/chunks/pt-CR4j8gtE.mjs.map +1 -1
- package/dist/chunks/pt-Cc4zysaT.mjs.map +1 -1
- package/dist/chunks/pt-Cv6q7x5x.mjs.map +1 -1
- package/dist/chunks/pt-DFKJVh7k.mjs.map +1 -1
- package/dist/chunks/pt-DP5c76Vo.mjs +2 -0
- package/dist/chunks/pt-DP5c76Vo.mjs.map +1 -0
- package/dist/chunks/pt-DYMyMgKQ.mjs.map +1 -1
- package/dist/chunks/pt-D__tcM2T.mjs.map +1 -1
- package/dist/chunks/pt-Dg2ctkug.mjs.map +1 -1
- package/dist/chunks/pt-DgfMoLWR.mjs.map +1 -1
- package/dist/chunks/pt-OXa_IR4Q.mjs.map +1 -1
- package/dist/chunks/pt-UPF7DBlz.mjs.map +1 -1
- package/dist/chunks/pt-_qxIe7zX.mjs.map +1 -1
- package/dist/chunks/pt-paXY7HFt.mjs.map +1 -1
- package/dist/chunks/pt-zMHcNGPk.mjs.map +1 -1
- package/dist/chunks/register-DSRtHVkk.mjs +3 -0
- package/dist/chunks/register-DSRtHVkk.mjs.map +1 -0
- package/dist/chunks/ru--iYEtsT5.mjs +2 -0
- package/dist/chunks/ru--iYEtsT5.mjs.map +1 -0
- package/dist/chunks/ru-B1m8J9dl.mjs.map +1 -1
- package/dist/chunks/ru-BNPUT-3S.mjs.map +1 -1
- package/dist/chunks/ru-BotG0MFT.mjs.map +1 -1
- package/dist/chunks/ru-C-APN_dm.mjs.map +1 -1
- package/dist/chunks/ru-C9yFslEG.mjs.map +1 -1
- package/dist/chunks/ru-CkG_bpfo.mjs.map +1 -1
- package/dist/chunks/ru-Cs8KCNyq.mjs.map +1 -1
- package/dist/chunks/ru-CsP6mLxp.mjs.map +1 -1
- package/dist/chunks/ru-CvDl-yEd.mjs.map +1 -1
- package/dist/chunks/ru-CwyPz2Va.mjs.map +1 -1
- package/dist/chunks/ru-D53d-_UB.mjs.map +1 -1
- package/dist/chunks/ru-DJMpeuey.mjs.map +1 -1
- package/dist/chunks/ru-DSRv3_Rg.mjs.map +1 -1
- package/dist/chunks/ru-DV-lgEtM.mjs.map +1 -1
- package/dist/chunks/ru-DiwQV30V.mjs.map +1 -1
- package/dist/chunks/ru-DkW9XZFy.mjs.map +1 -1
- package/dist/chunks/ru-DyCTlhjg.mjs.map +1 -1
- package/dist/chunks/ru-QGX8lOTs.mjs.map +1 -1
- package/dist/chunks/ru-QcTo2yoL.mjs.map +1 -1
- package/dist/chunks/ru-Y11wuxOB.mjs.map +1 -1
- package/dist/chunks/ru-Yngw7nFP.mjs.map +1 -1
- package/dist/chunks/ru-d68SZpEe.mjs.map +1 -1
- package/dist/chunks/ru-gxbzqLL8.mjs.map +1 -1
- package/dist/chunks/ru-k7o3Qks3.mjs.map +1 -1
- package/dist/chunks/ru-l73diFXn.mjs.map +1 -1
- package/dist/chunks/ru-q8kz-237.mjs.map +1 -1
- package/dist/chunks/src-DDkRstYh.mjs +2 -0
- package/dist/chunks/src-DDkRstYh.mjs.map +1 -0
- package/dist/chunks/xml-BsV44TrJ.mjs.map +1 -1
- package/dist/chunks/zh-BFZOM3lF.mjs.map +1 -1
- package/dist/chunks/zh-BGYJXxVl.mjs.map +1 -1
- package/dist/chunks/zh-BP97XjlS.mjs.map +1 -1
- package/dist/chunks/zh-BQ73oqxc.mjs.map +1 -1
- package/dist/chunks/zh-BQqf3wJZ.mjs.map +1 -1
- package/dist/chunks/zh-Baxh6v0j.mjs.map +1 -1
- package/dist/chunks/zh-BvuAbM2S.mjs.map +1 -1
- package/dist/chunks/zh-C-wHnDo5.mjs.map +1 -1
- package/dist/chunks/zh-C7iCgCRP.mjs.map +1 -1
- package/dist/chunks/zh-CRsDvfPR.mjs.map +1 -1
- package/dist/chunks/zh-CWGAPVei.mjs.map +1 -1
- package/dist/chunks/zh-CWIzJcXi.mjs.map +1 -1
- package/dist/chunks/zh-CYV-db-K.mjs.map +1 -1
- package/dist/chunks/zh-CiIyOm6U.mjs.map +1 -1
- package/dist/chunks/zh-CnW44JEw.mjs.map +1 -1
- package/dist/chunks/zh-D1HSmSOf.mjs.map +1 -1
- package/dist/chunks/zh-DUS7JduA.mjs +2 -0
- package/dist/chunks/zh-DUS7JduA.mjs.map +1 -0
- package/dist/chunks/zh-DWN1Jqn3.mjs.map +1 -1
- package/dist/chunks/zh-DYD476c5.mjs.map +1 -1
- package/dist/chunks/zh-DdzgYD7k.mjs.map +1 -1
- package/dist/chunks/zh-DgSmvLyw.mjs.map +1 -1
- package/dist/chunks/zh-DlVfQn4z.mjs.map +1 -1
- package/dist/chunks/zh-Oj-qSUEp.mjs.map +1 -1
- package/dist/chunks/zh-YfuE_m2y.mjs.map +1 -1
- package/dist/chunks/zh-dGSDBBzb.mjs.map +1 -1
- package/dist/chunks/zh-ikm3rSTR.mjs.map +1 -1
- package/dist/chunks/zh-oZl1P_p0.mjs.map +1 -1
- package/dist/commands/BlockInsertion.d.ts +15 -19
- package/dist/commands/BlockInsertion.d.ts.map +1 -1
- package/dist/commands/Commands.d.ts +3 -0
- package/dist/commands/Commands.d.ts.map +1 -1
- package/dist/commands/CompositionCommands.d.ts +14 -8
- package/dist/commands/CompositionCommands.d.ts.map +1 -1
- package/dist/commands/CompositionFallback.d.ts +13 -0
- package/dist/commands/CompositionFallback.d.ts.map +1 -0
- package/dist/commands/CompositionRebase.d.ts +17 -10
- package/dist/commands/CompositionRebase.d.ts.map +1 -1
- package/dist/commands/PasteCommand.d.ts.map +1 -1
- package/dist/commands/SelectionDeletion.d.ts +7 -5
- package/dist/commands/SelectionDeletion.d.ts.map +1 -1
- package/dist/commands/SelectionReplacement.d.ts +42 -0
- package/dist/commands/SelectionReplacement.d.ts.map +1 -0
- package/dist/editor/BlockIdentity.d.ts +16 -0
- package/dist/editor/BlockIdentity.d.ts.map +1 -0
- package/dist/editor/ContentSerializer.d.ts +13 -11
- package/dist/editor/ContentSerializer.d.ts.map +1 -1
- package/dist/editor/NotectlEditor.d.ts +6 -5
- package/dist/editor/NotectlEditor.d.ts.map +1 -1
- package/dist/editor/locales/nl.d.ts +4 -0
- package/dist/editor/locales/nl.d.ts.map +1 -0
- package/dist/editor/styles/link.d.ts +3 -0
- package/dist/editor/styles/link.d.ts.map +1 -0
- package/dist/fonts/math.mjs +1 -1
- package/dist/fonts.mjs +1 -1
- package/dist/full.mjs +1 -1
- package/dist/html.mjs +1 -1
- package/dist/i18n/Locale.d.ts +1 -0
- package/dist/i18n/Locale.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/input/CompositionController.d.ts.map +1 -1
- package/dist/input/HTMLLineBreaks.d.ts +14 -0
- package/dist/input/HTMLLineBreaks.d.ts.map +1 -0
- package/dist/input/HTMLParser.d.ts +1 -7
- package/dist/input/HTMLParser.d.ts.map +1 -1
- package/dist/input/PasteHTMLHandler.d.ts +0 -1
- package/dist/input/PasteHTMLHandler.d.ts.map +1 -1
- package/dist/input/PasteHandler.d.ts.map +1 -1
- package/dist/input/PasteRichBlockHandler.d.ts +10 -17
- package/dist/input/PasteRichBlockHandler.d.ts.map +1 -1
- package/dist/markdown.mjs +1 -1
- package/dist/model/ContentModel.d.ts +6 -1
- package/dist/model/ContentModel.d.ts.map +1 -1
- package/dist/model/FileHandlerDispatcher.d.ts +3 -1
- package/dist/model/FileHandlerDispatcher.d.ts.map +1 -1
- package/dist/model/FileHandlerRegistry.d.ts +11 -2
- package/dist/model/FileHandlerRegistry.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/PluginContextFactory.d.ts +1 -0
- package/dist/plugins/PluginContextFactory.d.ts.map +1 -1
- package/dist/plugins/PluginManager.d.ts +5 -0
- package/dist/plugins/PluginManager.d.ts.map +1 -1
- package/dist/plugins/alignment/locales/nl.d.ts +4 -0
- package/dist/plugins/alignment/locales/nl.d.ts.map +1 -0
- package/dist/plugins/alignment.mjs +1 -1
- package/dist/plugins/bidi-isolation/locales/nl.d.ts +4 -0
- package/dist/plugins/bidi-isolation/locales/nl.d.ts.map +1 -0
- package/dist/plugins/bidi-isolation.mjs +1 -1
- package/dist/plugins/blockquote/locales/nl.d.ts +4 -0
- package/dist/plugins/blockquote/locales/nl.d.ts.map +1 -0
- package/dist/plugins/blockquote.mjs +1 -1
- package/dist/plugins/caret-navigation/locales/nl.d.ts +4 -0
- package/dist/plugins/caret-navigation/locales/nl.d.ts.map +1 -0
- package/dist/plugins/caret-navigation.mjs +1 -1
- package/dist/plugins/code-block/CodeBlockSchema.d.ts.map +1 -1
- package/dist/plugins/code-block/locales/nl.d.ts +4 -0
- package/dist/plugins/code-block/locales/nl.d.ts.map +1 -0
- package/dist/plugins/code-block.mjs +1 -1
- package/dist/plugins/editor-ui/EditorUI.d.ts +50 -0
- package/dist/plugins/editor-ui/EditorUI.d.ts.map +1 -0
- package/dist/plugins/editor-ui/EditorUIRuntime.d.ts +44 -0
- package/dist/plugins/editor-ui/EditorUIRuntime.d.ts.map +1 -0
- package/dist/plugins/editor-ui/index.d.ts +6 -0
- package/dist/plugins/editor-ui/index.d.ts.map +1 -0
- package/dist/plugins/font/locales/nl.d.ts +4 -0
- package/dist/plugins/font/locales/nl.d.ts.map +1 -0
- package/dist/plugins/font-size/locales/nl.d.ts +4 -0
- package/dist/plugins/font-size/locales/nl.d.ts.map +1 -0
- package/dist/plugins/font-size.mjs +1 -1
- package/dist/plugins/font.mjs +1 -1
- package/dist/plugins/formula/FormulaCommands.d.ts +6 -4
- package/dist/plugins/formula/FormulaCommands.d.ts.map +1 -1
- package/dist/plugins/formula/locales/nl.d.ts +4 -0
- package/dist/plugins/formula/locales/nl.d.ts.map +1 -0
- package/dist/plugins/formula.mjs +1 -1
- package/dist/plugins/gap-cursor/locales/nl.d.ts +4 -0
- package/dist/plugins/gap-cursor/locales/nl.d.ts.map +1 -0
- package/dist/plugins/gap-cursor.mjs +1 -1
- package/dist/plugins/hard-break.mjs +1 -1
- package/dist/plugins/heading/locales/nl.d.ts +4 -0
- package/dist/plugins/heading/locales/nl.d.ts.map +1 -0
- package/dist/plugins/heading.mjs +1 -1
- package/dist/plugins/highlight/locales/nl.d.ts +4 -0
- package/dist/plugins/highlight/locales/nl.d.ts.map +1 -0
- package/dist/plugins/highlight.mjs +1 -1
- package/dist/plugins/horizontal-rule/locales/nl.d.ts +4 -0
- package/dist/plugins/horizontal-rule/locales/nl.d.ts.map +1 -0
- package/dist/plugins/horizontal-rule.mjs +1 -1
- package/dist/plugins/image/ImageCommands.d.ts +15 -3
- package/dist/plugins/image/ImageCommands.d.ts.map +1 -1
- package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
- package/dist/plugins/image/locales/nl.d.ts +4 -0
- package/dist/plugins/image/locales/nl.d.ts.map +1 -0
- package/dist/plugins/image.mjs +1 -1
- package/dist/plugins/inline-code/locales/nl.d.ts +4 -0
- package/dist/plugins/inline-code/locales/nl.d.ts.map +1 -0
- package/dist/plugins/inline-code.mjs +1 -1
- package/dist/plugins/link/LinkBubble.d.ts +31 -0
- package/dist/plugins/link/LinkBubble.d.ts.map +1 -0
- package/dist/plugins/link/LinkBubbleContent.d.ts +4 -0
- package/dist/plugins/link/LinkBubbleContent.d.ts.map +1 -0
- package/dist/plugins/link/LinkInteractionController.d.ts +40 -0
- package/dist/plugins/link/LinkInteractionController.d.ts.map +1 -0
- package/dist/plugins/link/LinkLocale.d.ts +10 -1
- package/dist/plugins/link/LinkLocale.d.ts.map +1 -1
- package/dist/plugins/link/LinkNavigation.d.ts +12 -0
- package/dist/plugins/link/LinkNavigation.d.ts.map +1 -0
- package/dist/plugins/link/LinkPlugin.d.ts +4 -5
- package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
- package/dist/plugins/link/LinkRange.d.ts +12 -0
- package/dist/plugins/link/LinkRange.d.ts.map +1 -0
- package/dist/plugins/link/locales/ar.d.ts.map +1 -1
- package/dist/plugins/link/locales/de.d.ts.map +1 -1
- package/dist/plugins/link/locales/es.d.ts.map +1 -1
- package/dist/plugins/link/locales/fr.d.ts.map +1 -1
- package/dist/plugins/link/locales/hi.d.ts.map +1 -1
- package/dist/plugins/link/locales/nl.d.ts +4 -0
- package/dist/plugins/link/locales/nl.d.ts.map +1 -0
- package/dist/plugins/link/locales/pt.d.ts.map +1 -1
- package/dist/plugins/link/locales/ru.d.ts.map +1 -1
- package/dist/plugins/link/locales/zh.d.ts.map +1 -1
- package/dist/plugins/link.mjs +1 -1
- package/dist/plugins/list/locales/nl.d.ts +4 -0
- package/dist/plugins/list/locales/nl.d.ts.map +1 -0
- package/dist/plugins/list.mjs +1 -1
- package/dist/plugins/print/locales/nl.d.ts +4 -0
- package/dist/plugins/print/locales/nl.d.ts.map +1 -0
- package/dist/plugins/print.mjs +1 -1
- package/dist/plugins/shared/PopupManager.d.ts +20 -2
- package/dist/plugins/shared/PopupManager.d.ts.map +1 -1
- package/dist/plugins/shared/PopupPositioning.d.ts +2 -6
- package/dist/plugins/shared/PopupPositioning.d.ts.map +1 -1
- package/dist/plugins/shared/index.d.ts +1 -1
- package/dist/plugins/shared/index.d.ts.map +1 -1
- package/dist/plugins/shared.mjs +1 -1
- package/dist/plugins/smart-paste/SmartPastePlugin.d.ts +0 -1
- package/dist/plugins/smart-paste/SmartPastePlugin.d.ts.map +1 -1
- package/dist/plugins/smart-paste/locales/nl.d.ts +4 -0
- package/dist/plugins/smart-paste/locales/nl.d.ts.map +1 -0
- package/dist/plugins/smart-paste.mjs +1 -1
- package/dist/plugins/strikethrough/locales/nl.d.ts +4 -0
- package/dist/plugins/strikethrough/locales/nl.d.ts.map +1 -0
- package/dist/plugins/strikethrough.mjs +1 -1
- package/dist/plugins/super-sub/locales/nl.d.ts +4 -0
- package/dist/plugins/super-sub/locales/nl.d.ts.map +1 -0
- package/dist/plugins/super-sub.mjs +1 -1
- package/dist/plugins/table/TableContextMenu.d.ts.map +1 -1
- package/dist/plugins/table/TableSelection.d.ts +4 -20
- package/dist/plugins/table/TableSelection.d.ts.map +1 -1
- package/dist/plugins/table/TableSelectionTypes.d.ts +21 -0
- package/dist/plugins/table/TableSelectionTypes.d.ts.map +1 -0
- package/dist/plugins/table/locales/nl.d.ts +4 -0
- package/dist/plugins/table/locales/nl.d.ts.map +1 -0
- package/dist/plugins/table.mjs +1 -1
- package/dist/plugins/text-color/locales/nl.d.ts +4 -0
- package/dist/plugins/text-color/locales/nl.d.ts.map +1 -0
- package/dist/plugins/text-color.mjs +1 -1
- package/dist/plugins/text-direction/locales/nl.d.ts +4 -0
- package/dist/plugins/text-direction/locales/nl.d.ts.map +1 -0
- package/dist/plugins/text-direction-auto.mjs +1 -1
- package/dist/plugins/text-direction.mjs +1 -1
- package/dist/plugins/text-formatting/locales/nl.d.ts +4 -0
- package/dist/plugins/text-formatting/locales/nl.d.ts.map +1 -0
- package/dist/plugins/text-formatting.mjs +1 -1
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts +2 -2
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts +2 -1
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarPopupController.d.ts +8 -3
- package/dist/plugins/toolbar/ToolbarPopupController.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarRegistry.d.ts +4 -0
- package/dist/plugins/toolbar/ToolbarRegistry.d.ts.map +1 -1
- package/dist/plugins/toolbar/locales/nl.d.ts +4 -0
- package/dist/plugins/toolbar/locales/nl.d.ts.map +1 -0
- package/dist/plugins/toolbar.mjs +1 -1
- package/dist/plugins/video/locales/nl.d.ts +4 -0
- package/dist/plugins/video/locales/nl.d.ts.map +1 -0
- 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/register.mjs +1 -1
- package/dist/serialization/DocumentParser.d.ts +2 -2
- package/dist/serialization/DocumentParser.d.ts.map +1 -1
- package/dist/serialization/HTMLParseRules.d.ts.map +1 -1
- package/dist/serialization/HTMLSanitization.d.ts +6 -0
- package/dist/serialization/HTMLSanitization.d.ts.map +1 -1
- package/dist/serialization/PreformattedText.d.ts +3 -0
- package/dist/serialization/PreformattedText.d.ts.map +1 -0
- package/dist/state/History.d.ts.map +1 -1
- package/dist/state/RangeMapping.d.ts +10 -0
- package/dist/state/RangeMapping.d.ts.map +1 -0
- package/dist/state/StepApplication.d.ts.map +1 -1
- package/dist/state/Steps.d.ts +3 -0
- package/dist/state/Steps.d.ts.map +1 -1
- package/dist/state/StructuralPositions.d.ts +15 -0
- package/dist/state/StructuralPositions.d.ts.map +1 -0
- package/dist/state/TransactionBuilder.d.ts +6 -14
- package/dist/state/TransactionBuilder.d.ts.map +1 -1
- package/dist/test/TestUtils.d.ts.map +1 -1
- package/dist/ui.d.ts +3 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.mjs +1 -0
- package/dist/view/EditorInteraction.d.ts +23 -0
- package/dist/view/EditorInteraction.d.ts.map +1 -0
- package/dist/view/EditorView.d.ts +2 -0
- package/dist/view/EditorView.d.ts.map +1 -1
- package/dist/view/EditorViewEvents.d.ts.map +1 -1
- package/dist/view/SelectionGeometry.d.ts +29 -0
- package/dist/view/SelectionGeometry.d.ts.map +1 -0
- package/dist/view/SelectionObserver.d.ts +19 -0
- package/dist/view/SelectionObserver.d.ts.map +1 -0
- package/dist/view/SelectionSync.d.ts +7 -0
- package/dist/view/SelectionSync.d.ts.map +1 -1
- package/package.json +12 -8
- package/dist/chunks/AlignmentPlugin-Cp7HYGaH.mjs +0 -2
- package/dist/chunks/AlignmentPlugin-Cp7HYGaH.mjs.map +0 -1
- package/dist/chunks/BidiIsolationPlugin-GWukKdgJ.mjs +0 -2
- package/dist/chunks/BidiIsolationPlugin-GWukKdgJ.mjs.map +0 -1
- package/dist/chunks/BlockInsertion-CxKdCKJd.mjs +0 -2
- package/dist/chunks/BlockInsertion-CxKdCKJd.mjs.map +0 -1
- package/dist/chunks/BlockquotePlugin-CSL_7Yit.mjs +0 -2
- package/dist/chunks/BlockquotePlugin-CSL_7Yit.mjs.map +0 -1
- package/dist/chunks/CaretNavigationPlugin-BxWjR7SN.mjs +0 -2
- package/dist/chunks/CaretNavigationPlugin-BxWjR7SN.mjs.map +0 -1
- package/dist/chunks/CodeBlockPlugin-BIrkK4ER.mjs +0 -2
- package/dist/chunks/CodeBlockPlugin-BIrkK4ER.mjs.map +0 -1
- package/dist/chunks/Commands-DBBCAYBn.mjs +0 -2
- package/dist/chunks/Commands-DBBCAYBn.mjs.map +0 -1
- package/dist/chunks/ContentModel-BLC3Tez8.mjs +0 -2
- package/dist/chunks/ContentModel-BLC3Tez8.mjs.map +0 -1
- package/dist/chunks/DocumentParser-BKUrtgw1.mjs +0 -2
- package/dist/chunks/DocumentParser-BKUrtgw1.mjs.map +0 -1
- package/dist/chunks/FontPlugin-BcXNFqqO.mjs +0 -2
- package/dist/chunks/FontPlugin-BcXNFqqO.mjs.map +0 -1
- package/dist/chunks/FontSizePlugin-BQ9Aj8cT.mjs +0 -2
- package/dist/chunks/FontSizePlugin-BQ9Aj8cT.mjs.map +0 -1
- package/dist/chunks/FormulaPlugin-Bw_sO_lq.mjs +0 -2
- package/dist/chunks/FormulaPlugin-Bw_sO_lq.mjs.map +0 -1
- package/dist/chunks/GapCursorPlugin-QDGwnaRR.mjs +0 -2
- package/dist/chunks/GapCursorPlugin-QDGwnaRR.mjs.map +0 -1
- package/dist/chunks/HTMLSanitization-Ce9dVT1q.mjs +0 -2
- package/dist/chunks/HTMLSanitization-Ce9dVT1q.mjs.map +0 -1
- package/dist/chunks/HardBreakPlugin-svNnJ9Xj.mjs.map +0 -1
- package/dist/chunks/HeadingPlugin-B7EfynaH.mjs +0 -2
- package/dist/chunks/HeadingPlugin-B7EfynaH.mjs.map +0 -1
- package/dist/chunks/HighlightPlugin-LdO0INtJ.mjs +0 -2
- package/dist/chunks/HighlightPlugin-LdO0INtJ.mjs.map +0 -1
- package/dist/chunks/HorizontalRulePlugin-CQ5NT2Mo.mjs +0 -2
- package/dist/chunks/HorizontalRulePlugin-CQ5NT2Mo.mjs.map +0 -1
- package/dist/chunks/ImagePlugin-BzLvPXGo.mjs +0 -2
- package/dist/chunks/ImagePlugin-BzLvPXGo.mjs.map +0 -1
- package/dist/chunks/InlineCodePlugin-Bu9-rE4B.mjs +0 -2
- package/dist/chunks/InlineCodePlugin-Bu9-rE4B.mjs.map +0 -1
- package/dist/chunks/LinkPlugin-BuzrXo2c.mjs +0 -2
- package/dist/chunks/LinkPlugin-BuzrXo2c.mjs.map +0 -1
- package/dist/chunks/ListPlugin-DTgpvBEt.mjs +0 -2
- package/dist/chunks/ListPlugin-DTgpvBEt.mjs.map +0 -1
- package/dist/chunks/MarkdownHTMLRegistry-BunUDiza.mjs.map +0 -1
- package/dist/chunks/MarkdownParser-CvYOvU3d.mjs.map +0 -1
- package/dist/chunks/MarkdownSerializer-CdUBWWGI.mjs.map +0 -1
- package/dist/chunks/NodeSelectionCommands-B0Sb4ux4.mjs.map +0 -1
- package/dist/chunks/PluginHelpers-B3gk3VB3.mjs +0 -2
- package/dist/chunks/PluginHelpers-B3gk3VB3.mjs.map +0 -1
- package/dist/chunks/PopupManager-Jz5JrUdC.mjs +0 -2
- package/dist/chunks/PopupManager-Jz5JrUdC.mjs.map +0 -1
- package/dist/chunks/PrintPlugin-BxNlFk2c.mjs +0 -2
- package/dist/chunks/PrintPlugin-BxNlFk2c.mjs.map +0 -1
- package/dist/chunks/SchemaRegistry-Cs7rxafF.mjs.map +0 -1
- package/dist/chunks/SelectionSync-BkjCwGp-.mjs.map +0 -1
- package/dist/chunks/SimpleMark-D6vz3Nfd.mjs +0 -2
- package/dist/chunks/SimpleMark-D6vz3Nfd.mjs.map +0 -1
- package/dist/chunks/SmartPastePlugin-C3SVKkWK.mjs +0 -2
- package/dist/chunks/SmartPastePlugin-C3SVKkWK.mjs.map +0 -1
- package/dist/chunks/StrikethroughPlugin-v-VJZzUZ.mjs +0 -2
- package/dist/chunks/StrikethroughPlugin-v-VJZzUZ.mjs.map +0 -1
- package/dist/chunks/SuperSubPlugin-x1iPnZyt.mjs +0 -2
- package/dist/chunks/SuperSubPlugin-x1iPnZyt.mjs.map +0 -1
- package/dist/chunks/TableDimensions-BSEOEox2.mjs.map +0 -1
- package/dist/chunks/TablePlugin-WPwp902E.mjs +0 -2
- package/dist/chunks/TablePlugin-WPwp902E.mjs.map +0 -1
- package/dist/chunks/TextColorPlugin-Bnl9of9E.mjs +0 -2
- package/dist/chunks/TextColorPlugin-Bnl9of9E.mjs.map +0 -1
- package/dist/chunks/TextDirectionAutoPlugin-DOH5cfyy.mjs.map +0 -1
- package/dist/chunks/TextDirectionPlugin-JwlR-R-b.mjs +0 -2
- package/dist/chunks/TextDirectionPlugin-JwlR-R-b.mjs.map +0 -1
- package/dist/chunks/TextDirectionService-BcX07mw2.mjs +0 -2
- package/dist/chunks/TextDirectionService-BcX07mw2.mjs.map +0 -1
- package/dist/chunks/TextFormattingPlugin-Kc_UNoOz.mjs +0 -2
- package/dist/chunks/TextFormattingPlugin-Kc_UNoOz.mjs.map +0 -1
- package/dist/chunks/ToolbarPlugin-DmVI7MN9.mjs +0 -2
- package/dist/chunks/ToolbarPlugin-DmVI7MN9.mjs.map +0 -1
- package/dist/chunks/VideoPlugin-D3zGQ6QV.mjs +0 -2
- package/dist/chunks/VideoPlugin-D3zGQ6QV.mjs.map +0 -1
- package/dist/chunks/ar-Ctrv6cIi.mjs +0 -2
- package/dist/chunks/ar-Ctrv6cIi.mjs.map +0 -1
- package/dist/chunks/de-JhGflzS5.mjs +0 -2
- package/dist/chunks/de-JhGflzS5.mjs.map +0 -1
- package/dist/chunks/es-Bv7bDbMp.mjs +0 -2
- package/dist/chunks/es-Bv7bDbMp.mjs.map +0 -1
- package/dist/chunks/fr-DtzIu6tU.mjs +0 -2
- package/dist/chunks/fr-DtzIu6tU.mjs.map +0 -1
- package/dist/chunks/full-BiQ93ERr.mjs +0 -2
- package/dist/chunks/full-BiQ93ERr.mjs.map +0 -1
- package/dist/chunks/hi-Bu799xIO.mjs +0 -2
- package/dist/chunks/hi-Bu799xIO.mjs.map +0 -1
- package/dist/chunks/minimal-DO7LiFTa.mjs +0 -2
- package/dist/chunks/minimal-DO7LiFTa.mjs.map +0 -1
- package/dist/chunks/pt-DmN9u3NX.mjs +0 -2
- package/dist/chunks/pt-DmN9u3NX.mjs.map +0 -1
- package/dist/chunks/register-Cb1YTAN4.mjs +0 -3
- package/dist/chunks/register-Cb1YTAN4.mjs.map +0 -1
- package/dist/chunks/ru-BxySx7an.mjs +0 -2
- package/dist/chunks/ru-BxySx7an.mjs.map +0 -1
- package/dist/chunks/src-5GKFQ2mQ.mjs +0 -2
- package/dist/chunks/src-5GKFQ2mQ.mjs.map +0 -1
- package/dist/chunks/zh-DuucmOns.mjs +0 -2
- package/dist/chunks/zh-DuucmOns.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorValidation-ZBKZ_gTr.mjs","names":[],"sources":["../../src/plugins/shared/ColorValidation.ts"],"sourcesContent":["/**\n * Shared CSS validation and normalization utilities\n * for style-based mark plugins (TextColor, Highlight, Font, FontSize).\n */\n\nimport type { StyleClassNames } from '../../model/StyleClass.js';\n\nconst HEX_COLOR_PATTERN: RegExp = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;\n\n/** Returns `true` when the value is a valid `#RGB` or `#RRGGBB` hex color. */\nexport function isValidHexColor(value: string): boolean {\n\treturn HEX_COLOR_PATTERN.test(value);\n}\n\n/**\n * Reads a `styleClasses` key of a color plugin as a hex color, lowercased like\n * the palette. Throws a `TypeError` for anything else.\n */\nexport function hexColorKey(key: string): string {\n\tif (!isValidHexColor(key)) {\n\t\tthrow new TypeError(`\"${key}\" is not a hex color; use keys such as \"#e03131\".`);\n\t}\n\treturn key.toLowerCase();\n}\n\n/**\n * The colors a color plugin stores in its own spelling: its palette, then the\n * colors its `styleClasses` option maps, lowercased like the palette. Keys\n * that are not hex colors are left to the `styleClasses` validation.\n */\nexport function knownColors(\n\tpalette: readonly string[],\n\tstyleClasses: StyleClassNames<string> | undefined,\n): readonly string[] {\n\tconst classColors: readonly string[] = Object.keys(styleClasses ?? {})\n\t\t.filter(isValidHexColor)\n\t\t.map(hexColorKey);\n\treturn [...palette, ...classColors];\n}\n\n// --- CSS Color Validation (broad format support for paste / API input) ---\n\n/** Matches `rgb(r, g, b)` and `rgba(r, g, b, a)` with integer or percentage values. */\nconst RGB_PATTERN: RegExp =\n\t/^rgba?\\(\\s*(\\d{1,3}%?\\s*,\\s*){2}\\d{1,3}%?(\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$/;\n\n/** Matches `hsl(h, s%, l%)` and `hsla(h, s%, l%, a)`. */\nconst HSL_PATTERN: RegExp =\n\t/^hsla?\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}%\\s*,\\s*\\d{1,3}%(\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$/;\n\n/**\n * Complete set of CSS Level 4 named colors (including `transparent`).\n * Used as an allowlist — unknown names are rejected.\n */\nconst CSS_NAMED_COLORS: ReadonlySet<string> = new Set([\n\t'aliceblue',\n\t'antiquewhite',\n\t'aqua',\n\t'aquamarine',\n\t'azure',\n\t'beige',\n\t'bisque',\n\t'black',\n\t'blanchedalmond',\n\t'blue',\n\t'blueviolet',\n\t'brown',\n\t'burlywood',\n\t'cadetblue',\n\t'chartreuse',\n\t'chocolate',\n\t'coral',\n\t'cornflowerblue',\n\t'cornsilk',\n\t'crimson',\n\t'cyan',\n\t'darkblue',\n\t'darkcyan',\n\t'darkgoldenrod',\n\t'darkgray',\n\t'darkgreen',\n\t'darkgrey',\n\t'darkkhaki',\n\t'darkmagenta',\n\t'darkolivegreen',\n\t'darkorange',\n\t'darkorchid',\n\t'darkred',\n\t'darksalmon',\n\t'darkseagreen',\n\t'darkslateblue',\n\t'darkslategray',\n\t'darkslategrey',\n\t'darkturquoise',\n\t'darkviolet',\n\t'deeppink',\n\t'deepskyblue',\n\t'dimgray',\n\t'dimgrey',\n\t'dodgerblue',\n\t'firebrick',\n\t'floralwhite',\n\t'forestgreen',\n\t'fuchsia',\n\t'gainsboro',\n\t'ghostwhite',\n\t'gold',\n\t'goldenrod',\n\t'gray',\n\t'green',\n\t'greenyellow',\n\t'grey',\n\t'honeydew',\n\t'hotpink',\n\t'indianred',\n\t'indigo',\n\t'ivory',\n\t'khaki',\n\t'lavender',\n\t'lavenderblush',\n\t'lawngreen',\n\t'lemonchiffon',\n\t'lightblue',\n\t'lightcoral',\n\t'lightcyan',\n\t'lightgoldenrodyellow',\n\t'lightgray',\n\t'lightgreen',\n\t'lightgrey',\n\t'lightpink',\n\t'lightsalmon',\n\t'lightseagreen',\n\t'lightskyblue',\n\t'lightslategray',\n\t'lightslategrey',\n\t'lightsteelblue',\n\t'lightyellow',\n\t'lime',\n\t'limegreen',\n\t'linen',\n\t'magenta',\n\t'maroon',\n\t'mediumaquamarine',\n\t'mediumblue',\n\t'mediumorchid',\n\t'mediumpurple',\n\t'mediumseagreen',\n\t'mediumslateblue',\n\t'mediumspringgreen',\n\t'mediumturquoise',\n\t'mediumvioletred',\n\t'midnightblue',\n\t'mintcream',\n\t'mistyrose',\n\t'moccasin',\n\t'navajowhite',\n\t'navy',\n\t'oldlace',\n\t'olive',\n\t'olivedrab',\n\t'orange',\n\t'orangered',\n\t'orchid',\n\t'palegoldenrod',\n\t'palegreen',\n\t'paleturquoise',\n\t'palevioletred',\n\t'papayawhip',\n\t'peachpuff',\n\t'peru',\n\t'pink',\n\t'plum',\n\t'powderblue',\n\t'purple',\n\t'rebeccapurple',\n\t'red',\n\t'rosybrown',\n\t'royalblue',\n\t'saddlebrown',\n\t'salmon',\n\t'sandybrown',\n\t'seagreen',\n\t'seashell',\n\t'sienna',\n\t'silver',\n\t'skyblue',\n\t'slateblue',\n\t'slategray',\n\t'slategrey',\n\t'snow',\n\t'springgreen',\n\t'steelblue',\n\t'tan',\n\t'teal',\n\t'thistle',\n\t'tomato',\n\t'transparent',\n\t'turquoise',\n\t'violet',\n\t'wheat',\n\t'white',\n\t'whitesmoke',\n\t'yellow',\n\t'yellowgreen',\n]);\n\n/**\n * Returns `true` when `value` is a safe CSS color value.\n * Accepts hex (`#RGB`, `#RRGGBB`), `rgb()`, `rgba()`, `hsl()`, `hsla()`,\n * and CSS named colors. Rejects anything else — defense against CSS injection\n * via manipulated color values in `style` attributes.\n */\nexport function isValidCSSColor(value: string): boolean {\n\tif (!value) return false;\n\tconst trimmed: string = value.trim().toLowerCase();\n\tif (!trimmed) return false;\n\n\treturn (\n\t\tHEX_COLOR_PATTERN.test(trimmed) ||\n\t\tRGB_PATTERN.test(trimmed) ||\n\t\tHSL_PATTERN.test(trimmed) ||\n\t\tCSS_NAMED_COLORS.has(trimmed)\n\t);\n}\n\n/**\n * Validates, deduplicates, and normalizes a user-supplied color list.\n * Returns `fallbackPalette` when no custom colors are provided.\n *\n * @throws {Error} if any value is not a valid hex color code.\n */\nexport function resolveColors(\n\tcolors: readonly string[] | undefined,\n\tfallbackPalette: readonly string[],\n\tpluginName: string,\n): readonly string[] {\n\tif (!colors || colors.length === 0) return fallbackPalette;\n\n\tconst invalid: string[] = colors.filter((c) => !isValidHexColor(c));\n\tif (invalid.length > 0) {\n\t\tthrow new Error(\n\t\t\t`${pluginName}: invalid hex color(s): ${invalid.join(', ')}. Expected format: #RGB or #RRGGBB.`,\n\t\t);\n\t}\n\n\tconst seen: Set<string> = new Set();\n\tconst unique: string[] = [];\n\tfor (const color of colors) {\n\t\tconst normalized: string = color.toLowerCase();\n\t\tif (!seen.has(normalized)) {\n\t\t\tseen.add(normalized);\n\t\t\tunique.push(normalized);\n\t\t}\n\t}\n\treturn unique;\n}\n\n// --- Font Family Validation ---\n\n/** Characters that are never valid in a CSS font-family value. */\nconst FONT_FAMILY_FORBIDDEN: RegExp = /[{}<>;]|url\\(|expression\\(/i;\n\n/**\n * Returns `true` when `value` is a safe CSS `font-family` value.\n * Rejects values containing `{`, `}`, `;`, `<`, `>`, `url(`, or `expression(`\n * to defend against CSS injection.\n */\nexport function isValidCSSFontFamily(value: string): boolean {\n\tif (!value) return false;\n\tconst trimmed: string = value.trim();\n\tif (!trimmed) return false;\n\treturn !FONT_FAMILY_FORBIDDEN.test(trimmed);\n}\n\n// --- Font Size Validation ---\n\n/** Matches valid CSS font-size values: number with unit (px, pt, em, rem, %). */\nconst FONT_SIZE_PATTERN: RegExp = /^\\d+(\\.\\d+)?(px|pt|em|rem|%)$/i;\n\n/**\n * Returns `true` when `value` is a safe CSS `font-size` value.\n * Accepts values like `16px`, `1.5em`, `12pt`, `100%`, `0.875rem`.\n */\nexport function isValidCSSFontSize(value: string): boolean {\n\tif (!value) return false;\n\treturn FONT_SIZE_PATTERN.test(value.trim());\n}\n"],"mappings":"AAOA,
|
|
1
|
+
{"version":3,"file":"ColorValidation-ZBKZ_gTr.mjs","names":["HEX_COLOR_PATTERN","isValidHexColor","value","test","hexColorKey","key","TypeError","toLowerCase","knownColors","palette","styleClasses","Object","keys","filter","map","RGB_PATTERN","HSL_PATTERN","CSS_NAMED_COLORS","Set","isValidCSSColor","trimmed","trim","has","resolveColors","colors","fallbackPalette","pluginName","length","invalid","c","Error","join","seen","unique","color","normalized","add","push","FONT_FAMILY_FORBIDDEN","isValidCSSFontFamily","FONT_SIZE_PATTERN","isValidCSSFontSize"],"sources":["../../src/plugins/shared/ColorValidation.ts"],"sourcesContent":["/**\n * Shared CSS validation and normalization utilities\n * for style-based mark plugins (TextColor, Highlight, Font, FontSize).\n */\n\nimport type { StyleClassNames } from '../../model/StyleClass.js';\n\nconst HEX_COLOR_PATTERN: RegExp = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;\n\n/** Returns `true` when the value is a valid `#RGB` or `#RRGGBB` hex color. */\nexport function isValidHexColor(value: string): boolean {\n\treturn HEX_COLOR_PATTERN.test(value);\n}\n\n/**\n * Reads a `styleClasses` key of a color plugin as a hex color, lowercased like\n * the palette. Throws a `TypeError` for anything else.\n */\nexport function hexColorKey(key: string): string {\n\tif (!isValidHexColor(key)) {\n\t\tthrow new TypeError(`\"${key}\" is not a hex color; use keys such as \"#e03131\".`);\n\t}\n\treturn key.toLowerCase();\n}\n\n/**\n * The colors a color plugin stores in its own spelling: its palette, then the\n * colors its `styleClasses` option maps, lowercased like the palette. Keys\n * that are not hex colors are left to the `styleClasses` validation.\n */\nexport function knownColors(\n\tpalette: readonly string[],\n\tstyleClasses: StyleClassNames<string> | undefined,\n): readonly string[] {\n\tconst classColors: readonly string[] = Object.keys(styleClasses ?? {})\n\t\t.filter(isValidHexColor)\n\t\t.map(hexColorKey);\n\treturn [...palette, ...classColors];\n}\n\n// --- CSS Color Validation (broad format support for paste / API input) ---\n\n/** Matches `rgb(r, g, b)` and `rgba(r, g, b, a)` with integer or percentage values. */\nconst RGB_PATTERN: RegExp =\n\t/^rgba?\\(\\s*(\\d{1,3}%?\\s*,\\s*){2}\\d{1,3}%?(\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$/;\n\n/** Matches `hsl(h, s%, l%)` and `hsla(h, s%, l%, a)`. */\nconst HSL_PATTERN: RegExp =\n\t/^hsla?\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}%\\s*,\\s*\\d{1,3}%(\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$/;\n\n/**\n * Complete set of CSS Level 4 named colors (including `transparent`).\n * Used as an allowlist — unknown names are rejected.\n */\nconst CSS_NAMED_COLORS: ReadonlySet<string> = new Set([\n\t'aliceblue',\n\t'antiquewhite',\n\t'aqua',\n\t'aquamarine',\n\t'azure',\n\t'beige',\n\t'bisque',\n\t'black',\n\t'blanchedalmond',\n\t'blue',\n\t'blueviolet',\n\t'brown',\n\t'burlywood',\n\t'cadetblue',\n\t'chartreuse',\n\t'chocolate',\n\t'coral',\n\t'cornflowerblue',\n\t'cornsilk',\n\t'crimson',\n\t'cyan',\n\t'darkblue',\n\t'darkcyan',\n\t'darkgoldenrod',\n\t'darkgray',\n\t'darkgreen',\n\t'darkgrey',\n\t'darkkhaki',\n\t'darkmagenta',\n\t'darkolivegreen',\n\t'darkorange',\n\t'darkorchid',\n\t'darkred',\n\t'darksalmon',\n\t'darkseagreen',\n\t'darkslateblue',\n\t'darkslategray',\n\t'darkslategrey',\n\t'darkturquoise',\n\t'darkviolet',\n\t'deeppink',\n\t'deepskyblue',\n\t'dimgray',\n\t'dimgrey',\n\t'dodgerblue',\n\t'firebrick',\n\t'floralwhite',\n\t'forestgreen',\n\t'fuchsia',\n\t'gainsboro',\n\t'ghostwhite',\n\t'gold',\n\t'goldenrod',\n\t'gray',\n\t'green',\n\t'greenyellow',\n\t'grey',\n\t'honeydew',\n\t'hotpink',\n\t'indianred',\n\t'indigo',\n\t'ivory',\n\t'khaki',\n\t'lavender',\n\t'lavenderblush',\n\t'lawngreen',\n\t'lemonchiffon',\n\t'lightblue',\n\t'lightcoral',\n\t'lightcyan',\n\t'lightgoldenrodyellow',\n\t'lightgray',\n\t'lightgreen',\n\t'lightgrey',\n\t'lightpink',\n\t'lightsalmon',\n\t'lightseagreen',\n\t'lightskyblue',\n\t'lightslategray',\n\t'lightslategrey',\n\t'lightsteelblue',\n\t'lightyellow',\n\t'lime',\n\t'limegreen',\n\t'linen',\n\t'magenta',\n\t'maroon',\n\t'mediumaquamarine',\n\t'mediumblue',\n\t'mediumorchid',\n\t'mediumpurple',\n\t'mediumseagreen',\n\t'mediumslateblue',\n\t'mediumspringgreen',\n\t'mediumturquoise',\n\t'mediumvioletred',\n\t'midnightblue',\n\t'mintcream',\n\t'mistyrose',\n\t'moccasin',\n\t'navajowhite',\n\t'navy',\n\t'oldlace',\n\t'olive',\n\t'olivedrab',\n\t'orange',\n\t'orangered',\n\t'orchid',\n\t'palegoldenrod',\n\t'palegreen',\n\t'paleturquoise',\n\t'palevioletred',\n\t'papayawhip',\n\t'peachpuff',\n\t'peru',\n\t'pink',\n\t'plum',\n\t'powderblue',\n\t'purple',\n\t'rebeccapurple',\n\t'red',\n\t'rosybrown',\n\t'royalblue',\n\t'saddlebrown',\n\t'salmon',\n\t'sandybrown',\n\t'seagreen',\n\t'seashell',\n\t'sienna',\n\t'silver',\n\t'skyblue',\n\t'slateblue',\n\t'slategray',\n\t'slategrey',\n\t'snow',\n\t'springgreen',\n\t'steelblue',\n\t'tan',\n\t'teal',\n\t'thistle',\n\t'tomato',\n\t'transparent',\n\t'turquoise',\n\t'violet',\n\t'wheat',\n\t'white',\n\t'whitesmoke',\n\t'yellow',\n\t'yellowgreen',\n]);\n\n/**\n * Returns `true` when `value` is a safe CSS color value.\n * Accepts hex (`#RGB`, `#RRGGBB`), `rgb()`, `rgba()`, `hsl()`, `hsla()`,\n * and CSS named colors. Rejects anything else — defense against CSS injection\n * via manipulated color values in `style` attributes.\n */\nexport function isValidCSSColor(value: string): boolean {\n\tif (!value) return false;\n\tconst trimmed: string = value.trim().toLowerCase();\n\tif (!trimmed) return false;\n\n\treturn (\n\t\tHEX_COLOR_PATTERN.test(trimmed) ||\n\t\tRGB_PATTERN.test(trimmed) ||\n\t\tHSL_PATTERN.test(trimmed) ||\n\t\tCSS_NAMED_COLORS.has(trimmed)\n\t);\n}\n\n/**\n * Validates, deduplicates, and normalizes a user-supplied color list.\n * Returns `fallbackPalette` when no custom colors are provided.\n *\n * @throws {Error} if any value is not a valid hex color code.\n */\nexport function resolveColors(\n\tcolors: readonly string[] | undefined,\n\tfallbackPalette: readonly string[],\n\tpluginName: string,\n): readonly string[] {\n\tif (!colors || colors.length === 0) return fallbackPalette;\n\n\tconst invalid: string[] = colors.filter((c) => !isValidHexColor(c));\n\tif (invalid.length > 0) {\n\t\tthrow new Error(\n\t\t\t`${pluginName}: invalid hex color(s): ${invalid.join(', ')}. Expected format: #RGB or #RRGGBB.`,\n\t\t);\n\t}\n\n\tconst seen: Set<string> = new Set();\n\tconst unique: string[] = [];\n\tfor (const color of colors) {\n\t\tconst normalized: string = color.toLowerCase();\n\t\tif (!seen.has(normalized)) {\n\t\t\tseen.add(normalized);\n\t\t\tunique.push(normalized);\n\t\t}\n\t}\n\treturn unique;\n}\n\n// --- Font Family Validation ---\n\n/** Characters that are never valid in a CSS font-family value. */\nconst FONT_FAMILY_FORBIDDEN: RegExp = /[{}<>;]|url\\(|expression\\(/i;\n\n/**\n * Returns `true` when `value` is a safe CSS `font-family` value.\n * Rejects values containing `{`, `}`, `;`, `<`, `>`, `url(`, or `expression(`\n * to defend against CSS injection.\n */\nexport function isValidCSSFontFamily(value: string): boolean {\n\tif (!value) return false;\n\tconst trimmed: string = value.trim();\n\tif (!trimmed) return false;\n\treturn !FONT_FAMILY_FORBIDDEN.test(trimmed);\n}\n\n// --- Font Size Validation ---\n\n/** Matches valid CSS font-size values: number with unit (px, pt, em, rem, %). */\nconst FONT_SIZE_PATTERN: RegExp = /^\\d+(\\.\\d+)?(px|pt|em|rem|%)$/i;\n\n/**\n * Returns `true` when `value` is a safe CSS `font-size` value.\n * Accepts values like `16px`, `1.5em`, `12pt`, `100%`, `0.875rem`.\n */\nexport function isValidCSSFontSize(value: string): boolean {\n\tif (!value) return false;\n\treturn FONT_SIZE_PATTERN.test(value.trim());\n}\n"],"mappings":"AAOA,IAAMA,EAA4B,gCAGlC,SAAgBC,EAAgBC,GAC/B,OAAOF,EAAkBG,KAAKD,EAC/B,CAMA,SAAgBE,EAAYC,GAC3B,IAAKJ,EAAgBI,GACpB,MAAM,IAAIC,UAAU,IAAID,sDAEzB,OAAOA,EAAIE,aACZ,CAOA,SAAgBC,EACfC,EACAC,GAKA,MAAO,IAAID,KAH4BE,OAAOC,KAAKF,GAAgB,CAAC,GAClEG,OAAOZ,GACPa,IAAIV,GAEP,CAKA,IAAMW,EACL,yEAGKC,EACL,gFAMKC,iBAAwC,IAAIC,IAAI,CACrD,YACA,eACA,OACA,aACA,QACA,QACA,SACA,QACA,iBACA,OACA,aACA,QACA,YACA,YACA,aACA,YACA,QACA,iBACA,WACA,UACA,OACA,WACA,WACA,gBACA,WACA,YACA,WACA,YACA,cACA,iBACA,aACA,aACA,UACA,aACA,eACA,gBACA,gBACA,gBACA,gBACA,aACA,WACA,cACA,UACA,UACA,aACA,YACA,cACA,cACA,UACA,YACA,aACA,OACA,YACA,OACA,QACA,cACA,OACA,WACA,UACA,YACA,SACA,QACA,QACA,WACA,gBACA,YACA,eACA,YACA,aACA,YACA,uBACA,YACA,aACA,YACA,YACA,cACA,gBACA,eACA,iBACA,iBACA,iBACA,cACA,OACA,YACA,QACA,UACA,SACA,mBACA,aACA,eACA,eACA,iBACA,kBACA,oBACA,kBACA,kBACA,eACA,YACA,YACA,WACA,cACA,OACA,UACA,QACA,YACA,SACA,YACA,SACA,gBACA,YACA,gBACA,gBACA,aACA,YACA,OACA,OACA,OACA,aACA,SACA,gBACA,MACA,YACA,YACA,cACA,SACA,aACA,WACA,WACA,SACA,SACA,UACA,YACA,YACA,YACA,OACA,cACA,YACA,MACA,OACA,UACA,SACA,cACA,YACA,SACA,QACA,QACA,aACA,SACA,gBASD,SAAgBC,EAAgBjB,GAC/B,IAAKA,EAAO,OAAO,EACnB,MAAMkB,EAAkBlB,EAAMmB,OAAOd,cACrC,QAAKa,IAGJpB,EAAkBG,KAAKiB,IACvBL,EAAYZ,KAAKiB,IACjBJ,EAAYb,KAAKiB,IACjBH,EAAiBK,IAAIF,GAEvB,CAQA,SAAgBG,EACfC,EACAC,EACAC,GAEA,IAAKF,GAA4B,IAAlBA,EAAOG,OAAc,OAAOF,EAE3C,MAAMG,EAAoBJ,EAAOX,OAAQgB,IAAO5B,EAAgB4B,IAChE,GAAID,EAAQD,OAAS,EACpB,MAAM,IAAIG,MACT,GAAGJ,4BAAqCE,EAAQG,KAAK,4CAIvD,MAAMC,iBAAoB,IAAId,IACxBe,EAAmB,GACzB,IAAK,MAAMC,KAASV,EAAQ,CAC3B,MAAMW,EAAqBD,EAAM3B,cAC5ByB,EAAKV,IAAIa,KACbH,EAAKI,IAAID,GACTF,EAAOI,KAAKF,GAEd,CACA,OAAOF,CACR,CAKA,IAAMK,EAAgC,8BAOtC,SAAgBC,EAAqBrC,GACpC,IAAKA,EAAO,OAAO,EACnB,MAAMkB,EAAkBlB,EAAMmB,OAC9B,QAAKD,IACGkB,EAAsBnC,KAAKiB,EACpC,CAKA,IAAMoB,EAA4B,iCAMlC,SAAgBC,EAAmBvC,GAClC,QAAKA,GACEsC,EAAkBrC,KAAKD,EAAMmB,OACrC,Q"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A as t,B as n,D as o,E as e,N as r,g as c,h as i,k as s}from"./Document-ssR6hBzG.mjs";import{r as l}from"./NodeResolver-F4RtpoEd.mjs";import{c as f,d as u,f as d,i as a,n as k,o as b,p as m,u as h}from"./Selection-DC6AOGgF.mjs";import{r as I}from"./TypeBrands-Ch9856Gb.mjs";import{i as g,n as p,o as B,r as x}from"./NavigationQueries-CaKfccu7.mjs";import{C as N,b as S,c as v,w as O,y as j}from"./BlockInsertion-CXfXqUZl.mjs";import{t as A}from"./CursorMarks-CqHLzGNI.mjs";import{t as T}from"./ContentModel-dkGOh3N7.mjs";import{n as w,r as M,t as y}from"./NodeSelectionCommands-CAqIHW_6.mjs";function C(t,n){if("after"===n.side)return D(t,n);const o=t.getBlockOrder(),e=o.indexOf(n.blockId);if(e<=0)return null;const r=o[e-1];if(!r)return null;if(g(t,r)){const n=l(t.doc,r)??[];return t.transaction("input").setSelection(a(r,n)).build()}const c=t.getBlock(r);if(!c)return null;const i=s(c);return t.transaction("input").setSelection(k(r,i)).build()}function P(t,n){if("before"===n.side)return D(t,n);const o=t.getBlockOrder(),e=o.indexOf(n.blockId);if(e>=o.length-1)return null;const r=o[e+1];if(!r)return null;if(g(t,r)){const n=l(t.doc,r)??[];return t.transaction("input").setSelection(a(r,n)).build()}return t.transaction("input").setSelection(k(r,0)).build()}function D(t,n){const o=l(t.doc,n.blockId)??[],e=a(n.blockId,o);return y(t,e)}function _(t,n){const o=l(t.doc,n);if(!o||0===o.length)return-1;const e=o[0];return t.doc.children.findIndex(t=>t.id===e)}function E(t,n,o){const e=s(n),r=n.id===o.from.blockId?o.from.offset:0,c=n.id===o.to.blockId?o.to.offset:e;r<c&&t.deleteTextAt(n.id,r,c)}function Q(t,n,o){const r=/* @__PURE__ */new Map;let c;for(let s=o.length-1;s>=0;s--){const{parentPath:l,siblings:f,index:u}=O(t,o[s]);if(u<0)continue;const d=l.join("/"),a=r.get(d)??0;if(r.set(d,a+1),f.length-a>1){n.removeNode(l,u);continue}const k=e();n.insertNode(l,0,i(k)),n.removeNode(l,1),0===s&&(c=k)}return c}function R(t,o){return n(o)&&!g(t,o.id)}function q(t,o,r,c,f){const u=t.doc.children[c],d=t.doc.children[f];if(!u||!d)return;const a=t.getBlock(r.to.blockId);if(!a)return;const k=R(t,u),b=R(t,d),m=0===r.from.offset&&z(u)===r.from.blockId,h=r.to.offset===s(a)&&F(d)===r.to.blockId,I=!k&&(n(u)||m),g=!b&&(n(d)||h);let p;k?E(o,u,r):I||L(t,o,[u.id],u,l(t.doc,r.from.blockId)??[],r.from.blockId,r.from.offset),b?E(o,d,r):g||U(t,o,[d.id],d,l(t.doc,r.to.blockId)??[],r.to.blockId,r.to.offset);let B=0;I&&b?p=r.to.blockId:I&&(p=e(),o.insertNode([],c,i(p)),B=1);const x=[];I&&x.push(c);for(let n=c+1;n<f;n++)x.push(n);g&&x.push(f);for(let n=x.length-1;n>=0;n--)o.removeNode([],x[n]+B);return k&&b&&o.mergeBlocksAt(r.from.blockId,r.to.blockId),p}function z(t){if(n(t))return t.id;const e=o(t)[0];return e?z(e):t.id}function F(t){if(n(t))return t.id;const e=o(t),r=e[e.length-1];return r?F(r):t.id}function G(t,n){return!!t.schema.getNodeSpec?.(n.type)?.content&&T(t.schema,n.type,"paragraph")}function H(t,n,e,r,c,i){const s=o(r),l=G(t,r);for(let o=i-1;o>=c;o--){const r=s[o];r&&(l?n.removeNode(e,o):J(t,n,[...e,r.id],r))}}function J(t,r,c,l){if(n(l)){const t=s(l);return void(t>0&&r.deleteTextAt(l.id,0,t))}const f=o(l);if(!G(t,l))return void H(t,r,c,l,0,f.length);const u=1===f.length?f[0]:void 0;if(!u||!v(u)){for(let t=f.length-1;t>=0;t--)r.removeNode(c,t);r.insertNode(c,0,i(e()))}}function K(t,n){const e=n.indexOf(t.id),r=e>=0?n[e+1]:void 0;return o(t).findIndex(t=>t.id===r)}function L(t,n,e,r,c,i,l){const f=o(r),u=K(r,c);if(u<0)return;H(t,n,e,r,u+1,f.length);const d=f[u];if(d.id===i){const t=s(d);return void(l<t&&n.deleteTextAt(i,l,t))}L(t,n,[...e,d.id],d,c,i,l)}function U(t,n,e,r,c,i,s){const l=o(r),f=K(r,c);if(f<0)return;H(t,n,e,r,0,f);const u=l[f];u.id!==i?U(t,n,[...e,u.id],u,c,i,s):s>0&&n.deleteTextAt(i,0,s)}function V(t,n,o="input"){const r=t.selection;if(u(r))return M(t,r,n,o);if(h(r))return function(t,n,o,r){const{parentPath:c,siblings:s,index:l}=O(t,n.blockId),f="before"===n.side?Math.max(l,0):l>=0?l+1:s.length,u=e(),d=t.transaction(r);return d.insertNode(c,f,i(u)),d.insertText(u,0,o,[]),d.setSelection(k(u,o.length)),d.build()}(t,r,n,o);const c=t.transaction(o),s=et(t);let l;f(r)||(l=rt(t,c));const d=N(r,t.getBlockOrder()),a=l??d.blockId,b=l?0:d.offset;return c.insertText(a,b,n,s),c.setSelection(k(a,b+n.length)),c.build()}function W(t){if(u(t.selection))return y(t,t.selection);if(h(t.selection))return null;if(f(t.selection))return null;if(function(t){if(!d(t.selection))return!1;const n=ot(t);if(!n)return!1;const o=m(t.selection,t.getBlockOrder());return o.from.blockId===n.from.blockId&&o.from.offset===n.from.offset&&o.to.blockId===n.to.blockId&&o.to.offset===n.to.offset}(t))return function(t){const n=e(),o=t.transaction("input"),r=t.doc.children.length;o.insertNode([],0,i(n));for(let e=r;e>=1;e--)o.removeNode([],e);return o.setSelection(k(n,0)),o.build()}(t);const n=t.transaction("input"),o=rt(t,n),r=m(t.selection,t.getBlockOrder()),c=o??r.from.blockId,s=o?0:r.from.offset;return n.setSelection(k(c,s)),n.build()}function X(t){const n=t.selection;if(u(n))return w(t,n);if(h(n))return function(t,n){const{parentPath:o,index:r}=O(t,n.blockId);if(r<0)return null;const c="before"===n.side?r:r+1,s=e(),l=t.transaction("input");return l.insertNode(o,c,i(s)),l.setSelection(k(s,0)),l.build()}(t,n);const o=t.transaction("input");let r;f(n)||(r=rt(t,o));const c=N(n,t.getBlockOrder()),s=r??c.blockId,l=r?0:c.offset,d=e();return o.splitBlock(s,l,d),o.setSelection(k(d,0)),o.build()}function Y(t){const n=t.selection;if(!d(n))return null;const o=t.transaction("input");let e;if(f(n)||(e=rt(t,o)),e)o.insertInlineNode(e,0,c(I("hard_break"))),o.setSelection(k(e,1));else{const{blockId:e,offset:r}=N(n,t.getBlockOrder());o.insertInlineNode(e,r,c(I("hard_break"))),o.setSelection(k(e,r+1))}return o.build()}function Z(t){return tt(t,"backward")}function $(t){return tt(t,"forward")}function tt(t,n){const o=t.selection;if(!d(o))return null;const e=t.getBlockOrder(),r=e.indexOf(o.anchor.blockId),c="backward"===n?r-1:r+1;if(c<0||c>=e.length)return null;const i=e[c];if(!i)return null;if(x(t,o.anchor.blockId)||x(t,i))return null;const f=B(t,o.anchor.blockId,i);if(!f&&p(t,o.anchor.blockId))return null;if(g(t,i)){const n=l(t.doc,i)??[];return t.transaction("input").setSelection(a(i,n)).build()}if(!f)return null;if("backward"===n){const n=t.getBlock(i);if(!n)return null;const e=s(n);return t.transaction("input").mergeBlocksAt(i,o.anchor.blockId).setSelection(k(i,e)).build()}return t.transaction("input").mergeBlocksAt(o.anchor.blockId,i).setSelection(k(o.anchor.blockId,o.anchor.offset)).build()}function nt(t){const n=ot(t);return n?t.transaction("command").setSelection(b(n.from,n.to)).build():t.transaction("command").setSelection(t.selection).build()}function ot(t){const n=t.doc.children,o=n[0],e=n[n.length-1];if(!o||!e)return null;const r=j(o),c=S(e),i=t.getBlock(c);return{from:{blockId:r,offset:0},to:{blockId:c,offset:i?s(i):0}}}function et(n){if(n.storedMarks)return n.storedMarks;const o=n.selection;if(!d(o))return[];const e=n.getBlock(o.anchor.blockId);return e?f(o)?r(e,o.anchor.offset,t=>A(n.schema,t)):t(e,o.anchor.offset):[]}function rt(t,n){if(!d(t.selection))return;const o=t.getBlockOrder(),r=m(t.selection,o),c=o.indexOf(r.from.blockId),s=o.indexOf(r.to.blockId);if(c===s)return void n.deleteTextAt(r.from.blockId,r.from.offset,r.to.offset);const l=_(t,r.from.blockId),f=_(t,r.to.blockId);return l===f||l<0||f<0?function(t,n,o,r,c,s){const l=o.slice(c,s+1),f=l.findIndex(n=>!g(t,n));if(f<0)return function(t,n,o){const r=o[0];if(!r)return;const{parentPath:c,index:s}=O(t,r);if(s<0)return;const l=Q(t,n,o);if(l)return l;const f=e();return n.insertNode(c,s,i(f)),f}(t,n,l);const u=l[f],d=[];let a,k=[];for(const e of l){a&&B(t,a,e)||(k=[],d.push(k)),g(t,e)||k.push(e),a=e;const o=t.getBlock(e);o&&E(n,o,r)}Q(t,n,l.filter(n=>g(t,n)));for(const[e,...i]of d)if(e)for(const t of i)n.mergeBlocksAt(e,t);return 0===f?void 0:u}(t,n,o,r,c,s):q(t,n,r,l,f)}export{Z as a,nt as c,P as d,V as i,X as l,W as n,$ as o,Y as r,et as s,rt as t,C as u};
|
|
2
|
+
//# sourceMappingURL=Commands-vqbwh6Ic.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Commands-vqbwh6Ic.mjs","names":["getBlockMarksAtOffset","isLeafBlock","getBlockChildren","generateBlockId","getCursorMarks","createInlineNode","createEmptyParagraph","getBlockLength","findNodePath","isCollapsed","isNodeSelection","isTextSelection","createNodeSelection","createCollapsedSelection","createSelection","selectionRange","isGapCursor","inlineType","isVoidBlock","isInsideIsolating","sharesParent","isIsolatingBlock","resolveInsertPoint","findLastLeafBlockId","isEmptyParagraph","resolveSiblingContext","findFirstLeafBlockId","isMarkInclusive","canContain","insertParagraphAfterNodeSelection","insertTextAfterNodeSelection","deleteNodeSelection","deleteBackwardAtGap","state","sel","side","deleteVoidAtGap","blockOrder","getBlockOrder","blockIdx","indexOf","blockId","prevId","path","doc","transaction","setSelection","build","prevBlock","getBlock","prevLen","deleteForwardAtGap","length","nextId","nodeSel","getRootBlockIndex","rootId","children","findIndex","c","id","deleteSelectedText","builder","block","range","from","offset","to","deleteTextAt","removeVoidBlocks","ids","removedPerParent","Map","swappedInForFirst","i","parentPath","siblings","index","parentKey","join","removedBefore","get","set","removeNode","replacementId","insertNode","isTextLeaf","deleteCrossRootRange","fromRootIdx","toRootIdx","fromRoot","toRoot","toLeaf","fromIsLeaf","toIsLeaf","fromAtStart","firstLeafId","toAtEnd","lastLeafId","fromWholesale","toWholesale","landingId","trimContainerTail","trimContainerHead","shift","removeIdxs","push","k","mergeBlocksAt","first","last","hasFlowContent","container","schema","getNodeSpec","type","content","deleteCoveredChildren","containerPath","removable","child","clearBlockContent","only","boundaryChildIndex","leafPath","pos","targetChildId","leafId","leafOffset","boundaryIdx","boundaryChild","len","insertTextCommand","text","origin","selection","insertIdx","Math","max","newId","insertText","insertTextAtGap","marks","resolveActiveMarks","addDeleteSelectionSteps","resolved","insertBlockId","insertOffset","deleteSelectionCommand","docRange","documentRange","selectionCoversDocument","newBlockId","originalCount","clearDocument","cursorBlockId","cursorOffset","splitBlockCommand","insertParagraphAtGap","splitBlock","insertHardBreakCommand","insertInlineNode","mergeBlockBackward","mergeAdjacentBlock","mergeBlockForward","direction","anchor","adjacentIdx","adjacentId","sameParent","selectAll","blocks","firstBlock","lastBlock","lastLeaf","storedMarks","fromIdx","toIdx","rangeIds","slice","survivorIdx","swappedIn","replaceVoidOnlyRange","survivorId","groups","previousId","group","filter","targetId","sourceIds","sourceId","deleteLeafRange"],"sources":["../../src/commands/GapCursorCommands.ts","../../src/commands/SelectionDeletion.ts","../../src/commands/Commands.ts"],"sourcesContent":["/**\n * Commands for GapCursor: deleting void blocks adjacent to gap cursors\n * and inserting paragraphs at gap positions.\n */\n\nimport { createEmptyParagraph, generateBlockId, getBlockLength } from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport type { GapCursorSelection, NodeSelection } from '../model/Selection.js';\nimport { createCollapsedSelection, createNodeSelection } from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport { isVoidBlock } from '../state/NavigationQueries.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport { resolveSiblingContext } from './CommandHelpers.js';\nimport { deleteNodeSelection } from './NodeSelectionCommands.js';\n\n/**\n * Deletes the void block adjacent to a GapCursor when pressing Backspace.\n *\n * - `side === 'after'` → void block is behind the cursor → delete it.\n * - `side === 'before'` → void block is ahead → navigate backward (to previous block).\n * - At document start with `side === 'before'` → `null` (no-op).\n */\nexport function deleteBackwardAtGap(\n\tstate: EditorState,\n\tsel: GapCursorSelection,\n): Transaction | null {\n\tif (sel.side === 'after') {\n\t\treturn deleteVoidAtGap(state, sel);\n\t}\n\n\t// side === 'before': navigate to previous block\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst blockIdx: number = blockOrder.indexOf(sel.blockId);\n\n\tif (blockIdx <= 0) return null;\n\n\tconst prevId: BlockId | undefined = blockOrder[blockIdx - 1];\n\tif (!prevId) return null;\n\n\tif (isVoidBlock(state, prevId)) {\n\t\tconst path = findNodePath(state.doc, prevId) ?? [];\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.setSelection(createNodeSelection(prevId, path as BlockId[]))\n\t\t\t.build();\n\t}\n\n\tconst prevBlock = state.getBlock(prevId);\n\tif (!prevBlock) return null;\n\tconst prevLen: number = getBlockLength(prevBlock);\n\treturn state.transaction('input').setSelection(createCollapsedSelection(prevId, prevLen)).build();\n}\n\n/**\n * Deletes the void block adjacent to a GapCursor when pressing Delete.\n *\n * - `side === 'before'` → void block is ahead of the cursor → delete it.\n * - `side === 'after'` → void block is behind → navigate forward (to next block).\n * - At document end with `side === 'after'` → `null` (no-op).\n */\nexport function deleteForwardAtGap(\n\tstate: EditorState,\n\tsel: GapCursorSelection,\n): Transaction | null {\n\tif (sel.side === 'before') {\n\t\treturn deleteVoidAtGap(state, sel);\n\t}\n\n\t// side === 'after': navigate to next block\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst blockIdx: number = blockOrder.indexOf(sel.blockId);\n\n\tif (blockIdx >= blockOrder.length - 1) return null;\n\n\tconst nextId: BlockId | undefined = blockOrder[blockIdx + 1];\n\tif (!nextId) return null;\n\n\tif (isVoidBlock(state, nextId)) {\n\t\tconst path = findNodePath(state.doc, nextId) ?? [];\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.setSelection(createNodeSelection(nextId, path as BlockId[]))\n\t\t\t.build();\n\t}\n\n\treturn state.transaction('input').setSelection(createCollapsedSelection(nextId, 0)).build();\n}\n\n/** Deletes the void block that the GapCursor is adjacent to, delegating to deleteNodeSelection. */\nfunction deleteVoidAtGap(state: EditorState, sel: GapCursorSelection): Transaction | null {\n\tconst path = (findNodePath(state.doc, sel.blockId) ?? []) as BlockId[];\n\tconst nodeSel: NodeSelection = createNodeSelection(sel.blockId, path);\n\treturn deleteNodeSelection(state, nodeSel);\n}\n\n/** Inserts a new paragraph at a GapCursor position (before or after the void block). */\nexport function insertParagraphAtGap(\n\tstate: EditorState,\n\tsel: GapCursorSelection,\n): Transaction | null {\n\tconst { parentPath, index } = resolveSiblingContext(state, sel.blockId);\n\tif (index < 0) return null;\n\n\tconst insertIdx: number = sel.side === 'before' ? index : index + 1;\n\tconst newId = generateBlockId();\n\tconst builder = state.transaction('input');\n\tbuilder.insertNode(parentPath, insertIdx, createEmptyParagraph(newId));\n\tbuilder.setSelection(createCollapsedSelection(newId, 0));\n\treturn builder.build();\n}\n\n/** Inserts text in a new paragraph at a GapCursor position. */\nexport function insertTextAtGap(\n\tstate: EditorState,\n\tsel: GapCursorSelection,\n\ttext: string,\n\torigin: 'input' | 'paste',\n): Transaction {\n\tconst { parentPath, siblings, index } = resolveSiblingContext(state, sel.blockId);\n\tconst insertIdx: number =\n\t\tsel.side === 'before' ? Math.max(index, 0) : index >= 0 ? index + 1 : siblings.length;\n\n\tconst newId = generateBlockId();\n\tconst builder = state.transaction(origin);\n\tbuilder.insertNode(parentPath, insertIdx, createEmptyParagraph(newId));\n\tbuilder.insertText(newId, 0, text, []);\n\tbuilder.setSelection(createCollapsedSelection(newId, text.length));\n\treturn builder.build();\n}\n","/**\n * Range-deletion helpers for multi-block text selections, split out of\n * Commands.ts. Handles two cases: a selection whose blocks share one root\n * ancestor (leaf range) and a selection spanning different root ancestors\n * (cross-root range).\n *\n * A void block (image, horizontal rule) at either end of a range is wholly\n * selected — it has no partial content and cannot host the caret — so it is\n * removed outright and never merged into (#224).\n *\n * Containers keep their shape: a free-flowing container (blockquote, list\n * item, table cell) loses the children a range covers, while a fixed-shape one\n * (a table, a table row) keeps every child and only has its content cleared.\n */\n\nimport { canContain } from '../model/ContentModel.js';\nimport type { BlockNode } from '../model/Document.js';\nimport {\n\tcreateEmptyParagraph,\n\tgenerateBlockId,\n\tgetBlockChildren,\n\tgetBlockLength,\n\tisLeafBlock,\n} from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport { isVoidBlock, sharesParent } from '../state/NavigationQueries.js';\nimport type { TransactionBuilder } from '../state/Transaction.js';\nimport { isEmptyParagraph } from './BlockInsertion.js';\nimport { resolveSiblingContext } from './CommandHelpers.js';\n\n/** A normalized text-selection range (document-order from/to positions). */\nexport interface DeletionRange {\n\treadonly from: { readonly blockId: BlockId; readonly offset: number };\n\treadonly to: { readonly blockId: BlockId; readonly offset: number };\n}\n\n/** Returns the root-level ancestor index in `doc.children` for a given block. */\nexport function getRootBlockIndex(state: EditorState, blockId: BlockId): number {\n\tconst path = findNodePath(state.doc, blockId);\n\tif (!path || path.length === 0) return -1;\n\tconst rootId: string = path[0] as string;\n\treturn state.doc.children.findIndex((c) => c.id === rootId);\n}\n\n/**\n * Deletes a multi-block selection where all blocks share the same root ancestor.\n *\n * Container boundaries survive: only consecutive leaves with the same immediate\n * parent merge into their group's first text leaf. Selected void blocks are\n * removed in place before any merges. Returns the first text leaf when it is\n * not the from-block (the caret then lands at offset 0), or the landing paragraph\n * swapped in when the range is void-only; undefined when the from-block survives.\n */\nexport function deleteLeafRange(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tblockOrder: readonly BlockId[],\n\trange: DeletionRange,\n\tfromIdx: number,\n\ttoIdx: number,\n): BlockId | undefined {\n\tconst rangeIds: readonly BlockId[] = blockOrder.slice(fromIdx, toIdx + 1);\n\tconst survivorIdx: number = rangeIds.findIndex((id) => !isVoidBlock(state, id));\n\tif (survivorIdx < 0) return replaceVoidOnlyRange(state, builder, rangeIds);\n\tconst survivorId: BlockId = rangeIds[survivorIdx] as BlockId;\n\n\t// Group the original leaf order, including voids: returning to a parent\n\t// after a nested container starts a new group, even if that container's\n\t// only leaf is a selected void that will be replaced below.\n\tconst groups: BlockId[][] = [];\n\tlet previousId: BlockId | undefined;\n\tlet group: BlockId[] = [];\n\tfor (const id of rangeIds) {\n\t\tif (!previousId || !sharesParent(state, previousId, id)) {\n\t\t\tgroup = [];\n\t\t\tgroups.push(group);\n\t\t}\n\t\tif (!isVoidBlock(state, id)) group.push(id);\n\t\tpreviousId = id;\n\t\tconst block: BlockNode | undefined = state.getBlock(id);\n\t\tif (block) deleteSelectedText(builder, block, range);\n\t}\n\t// Positional removals still refer to the original sibling indexes. All voids\n\t// must be removed (last first) before merging shifts any of those indexes.\n\tremoveVoidBlocks(\n\t\tstate,\n\t\tbuilder,\n\t\trangeIds.filter((id) => isVoidBlock(state, id)),\n\t);\n\tfor (const [targetId, ...sourceIds] of groups) {\n\t\tif (!targetId) continue;\n\t\tfor (const sourceId of sourceIds) builder.mergeBlocksAt(targetId, sourceId);\n\t}\n\n\treturn survivorIdx === 0 ? undefined : survivorId;\n}\n\n/** Deletes the part of `block`'s inline content that lies inside `range`. */\nfunction deleteSelectedText(\n\tbuilder: TransactionBuilder,\n\tblock: BlockNode,\n\trange: DeletionRange,\n): void {\n\tconst length: number = getBlockLength(block);\n\tconst from: number = block.id === range.from.blockId ? range.from.offset : 0;\n\tconst to: number = block.id === range.to.blockId ? range.to.offset : length;\n\tif (from < to) builder.deleteTextAt(block.id, from, to);\n}\n\n/**\n * Removes a range made only of void blocks and returns the empty paragraph\n * that takes their place and hosts the caret.\n */\nfunction replaceVoidOnlyRange(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tids: readonly BlockId[],\n): BlockId | undefined {\n\tconst first: BlockId | undefined = ids[0];\n\tif (!first) return undefined;\n\tconst { parentPath, index } = resolveSiblingContext(state, first);\n\tif (index < 0) return undefined;\n\n\tconst swappedIn: BlockId | undefined = removeVoidBlocks(state, builder, ids);\n\tif (swappedIn) return swappedIn;\n\n\t// Earlier siblings are untouched, so the first block's slot is still `index`.\n\tconst landingId: BlockId = generateBlockId();\n\tbuilder.insertNode(parentPath, index, createEmptyParagraph(landingId));\n\treturn landingId;\n}\n\n/**\n * Removes void blocks in place, last first so positional indexes stay valid.\n * A parent about to lose its last child keeps an empty paragraph instead, so\n * containers such as table cells never end up empty. Returns the paragraph\n * swapped in for the first block, if one was needed.\n */\nfunction removeVoidBlocks(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tids: readonly BlockId[],\n): BlockId | undefined {\n\tconst removedPerParent = new Map<string, number>();\n\tlet swappedInForFirst: BlockId | undefined;\n\n\tfor (let i = ids.length - 1; i >= 0; i--) {\n\t\tconst { parentPath, siblings, index } = resolveSiblingContext(state, ids[i] as BlockId);\n\t\tif (index < 0) continue;\n\t\tconst parentKey: string = parentPath.join('/');\n\t\tconst removedBefore: number = removedPerParent.get(parentKey) ?? 0;\n\t\tremovedPerParent.set(parentKey, removedBefore + 1);\n\n\t\tif (siblings.length - removedBefore > 1) {\n\t\t\tbuilder.removeNode(parentPath, index);\n\t\t\tcontinue;\n\t\t}\n\t\t// Last remaining child (so at index 0): swap in an empty paragraph.\n\t\tconst replacementId: BlockId = generateBlockId();\n\t\tbuilder.insertNode(parentPath, 0, createEmptyParagraph(replacementId));\n\t\tbuilder.removeNode(parentPath, 1);\n\t\tif (i === 0) swappedInForFirst = replacementId;\n\t}\n\n\treturn swappedInForFirst;\n}\n\n/** A leaf block that can hold a caret: any leaf except a void one. */\nfunction isTextLeaf(state: EditorState, block: BlockNode): boolean {\n\treturn isLeafBlock(block) && !isVoidBlock(state, block.id);\n}\n\n/**\n * Deletes a selection spanning different root-level ancestors.\n *\n * The selected span is deleted while every unselected leaf survives. A\n * composite/container root (a multi-block `list_item`, a `blockquote`, a\n * `table`) whose boundary sits *inside* it is trimmed, not wiped: the from-root\n * keeps everything before `range.from`, the to-root keeps everything after\n * `range.to`. Trimming keeps the shape of fixed-shape containers (see\n * {@link hasFlowContent}): the covered cells of a table are cleared, never\n * removed, so its rows keep equal cell counts. A container is removed wholesale\n * only when the boundary lands at its very edge (offset 0 of its first leaf, or\n * the end of its last leaf), so the whole container is genuinely inside the\n * selection. Root blocks strictly between the endpoints are always removed, and\n * a void root at either end is always removed wholesale.\n *\n * Returns the block hosting the caret when the from-root was removed wholesale\n * (its cursor block went with it): the surviving to-leaf, or a landing paragraph\n * inserted in the from-root's slot. Undefined otherwise, since the from boundary\n * leaf then survives and hosts the caret.\n */\nexport function deleteCrossRootRange(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\trange: DeletionRange,\n\tfromRootIdx: number,\n\ttoRootIdx: number,\n): BlockId | undefined {\n\tconst fromRoot = state.doc.children[fromRootIdx];\n\tconst toRoot = state.doc.children[toRootIdx];\n\tif (!fromRoot || !toRoot) return undefined;\n\n\tconst toLeaf = state.getBlock(range.to.blockId);\n\tif (!toLeaf) return undefined;\n\n\tconst fromIsLeaf: boolean = isTextLeaf(state, fromRoot);\n\tconst toIsLeaf: boolean = isTextLeaf(state, toRoot);\n\n\t// A non-text root is removed wholesale (rather than trimmed) when it is void,\n\t// or when the boundary sits at its very edge and so covers the whole\n\t// container: the from-root's edge is offset 0 of its first leaf, the\n\t// to-root's is the end of its last leaf.\n\tconst fromAtStart: boolean =\n\t\trange.from.offset === 0 && firstLeafId(fromRoot) === range.from.blockId;\n\tconst toAtEnd: boolean =\n\t\trange.to.offset === getBlockLength(toLeaf) && lastLeafId(toRoot) === range.to.blockId;\n\tconst fromWholesale: boolean = !fromIsLeaf && (isLeafBlock(fromRoot) || fromAtStart);\n\tconst toWholesale: boolean = !toIsLeaf && (isLeafBlock(toRoot) || toAtEnd);\n\n\t// --- from side: keep everything before range.from within the from-root ---\n\tif (fromIsLeaf) {\n\t\tdeleteSelectedText(builder, fromRoot, range);\n\t} else if (!fromWholesale) {\n\t\ttrimContainerTail(\n\t\t\tstate,\n\t\t\tbuilder,\n\t\t\t[fromRoot.id],\n\t\t\tfromRoot,\n\t\t\tfindNodePath(state.doc, range.from.blockId) ?? [],\n\t\t\trange.from.blockId,\n\t\t\trange.from.offset,\n\t\t);\n\t}\n\n\t// --- to side: keep everything after range.to within the to-root ---\n\tif (toIsLeaf) {\n\t\tdeleteSelectedText(builder, toRoot, range);\n\t} else if (!toWholesale) {\n\t\ttrimContainerHead(\n\t\t\tstate,\n\t\t\tbuilder,\n\t\t\t[toRoot.id],\n\t\t\ttoRoot,\n\t\t\tfindNodePath(state.doc, range.to.blockId) ?? [],\n\t\t\trange.to.blockId,\n\t\t\trange.to.offset,\n\t\t);\n\t}\n\n\t// --- root-level removals: middle roots always, endpoints only when wholesale ---\n\t// A wholesale-removed from-root takes its cursor block with it. A surviving\n\t// to-leaf slides into the from-root's slot and hosts the caret at its start;\n\t// otherwise a landing paragraph is inserted there for the caret and any\n\t// follow-up insert.\n\tlet landingId: BlockId | undefined;\n\tlet shift = 0;\n\tif (fromWholesale && toIsLeaf) {\n\t\tlandingId = range.to.blockId;\n\t} else if (fromWholesale) {\n\t\tlandingId = generateBlockId();\n\t\tbuilder.insertNode([], fromRootIdx, createEmptyParagraph(landingId));\n\t\tshift = 1;\n\t}\n\n\tconst removeIdxs: number[] = [];\n\tif (fromWholesale) removeIdxs.push(fromRootIdx);\n\tfor (let i = fromRootIdx + 1; i < toRootIdx; i++) removeIdxs.push(i);\n\tif (toWholesale) removeIdxs.push(toRootIdx);\n\t// Descending so each positional removal stays valid against the evolving doc.\n\tfor (let k = removeIdxs.length - 1; k >= 0; k--) {\n\t\tbuilder.removeNode([], (removeIdxs[k] as number) + shift);\n\t}\n\n\t// Join the boundary only when both roots are leaves: their inline content\n\t// merges into one block (the \"outta\" behavior). Merging across a composite\n\t// boundary is deliberately skipped — trimming already preserved every\n\t// unselected leaf, and there is no single valid block to merge into.\n\tif (fromIsLeaf && toIsLeaf) {\n\t\tbuilder.mergeBlocksAt(range.from.blockId, range.to.blockId);\n\t}\n\n\treturn landingId;\n}\n\n/** The id of a block's first leaf descendant (itself when already a leaf). */\nfunction firstLeafId(block: BlockNode): BlockId {\n\tif (isLeafBlock(block)) return block.id;\n\tconst first: BlockNode | undefined = getBlockChildren(block)[0];\n\treturn first ? firstLeafId(first) : block.id;\n}\n\n/** The id of a block's last leaf descendant (itself when already a leaf). */\nfunction lastLeafId(block: BlockNode): BlockId {\n\tif (isLeafBlock(block)) return block.id;\n\tconst children: readonly BlockNode[] = getBlockChildren(block);\n\tconst last: BlockNode | undefined = children[children.length - 1];\n\treturn last ? lastLeafId(last) : block.id;\n}\n\n/**\n * Whether a container's children are free-flowing blocks that a deletion may\n * remove one by one. That holds when its content rule admits a paragraph\n * (blockquote, list item, table cell), since an empty paragraph can always\n * stand in for removed content. Any other container has a fixed shape (a\n * table's rows, a row's cells, which must keep equal counts), so a deletion\n * clears its covered children instead. Without a content rule the shape is\n * unknown, and keeping it is the safe choice.\n */\nfunction hasFlowContent(state: EditorState, container: BlockNode): boolean {\n\tif (!state.schema.getNodeSpec?.(container.type)?.content) return false;\n\treturn canContain(state.schema, container.type, 'paragraph');\n}\n\n/**\n * Deletes the children of `container` in `[from, to)`, last first so positional\n * removals stay valid: a flow container removes them, a fixed-shape container\n * clears them in place (see {@link hasFlowContent}).\n */\nfunction deleteCoveredChildren(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tcontainerPath: readonly BlockId[],\n\tcontainer: BlockNode,\n\tfrom: number,\n\tto: number,\n): void {\n\tconst children: readonly BlockNode[] = getBlockChildren(container);\n\tconst removable: boolean = hasFlowContent(state, container);\n\tfor (let i = to - 1; i >= from; i--) {\n\t\tconst child: BlockNode | undefined = children[i];\n\t\tif (!child) continue;\n\t\tif (removable) builder.removeNode(containerPath, i);\n\t\telse clearBlockContent(state, builder, [...containerPath, child.id], child);\n\t}\n}\n\n/**\n * Empties a fully covered block while keeping the block itself: a flow\n * container ends up holding one empty paragraph (as a cut table cell does), a\n * fixed-shape container clears each child, and a text leaf loses its text. A\n * void leaf has no text (length 0), so it stays as it is.\n */\nfunction clearBlockContent(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tpath: readonly BlockId[],\n\tblock: BlockNode,\n): void {\n\tif (isLeafBlock(block)) {\n\t\tconst length: number = getBlockLength(block);\n\t\tif (length > 0) builder.deleteTextAt(block.id, 0, length);\n\t\treturn;\n\t}\n\n\tconst children: readonly BlockNode[] = getBlockChildren(block);\n\tif (!hasFlowContent(state, block)) {\n\t\tdeleteCoveredChildren(state, builder, path, block, 0, children.length);\n\t\treturn;\n\t}\n\tconst only: BlockNode | undefined = children.length === 1 ? children[0] : undefined;\n\tif (only && isEmptyParagraph(only)) return;\n\tfor (let i = children.length - 1; i >= 0; i--) builder.removeNode(path, i);\n\tbuilder.insertNode(path, 0, createEmptyParagraph(generateBlockId()));\n}\n\n/** Index of the child of `container` on the path to the boundary leaf, or -1. */\nfunction boundaryChildIndex(container: BlockNode, leafPath: readonly string[]): number {\n\tconst pos: number = leafPath.indexOf(container.id);\n\tconst targetChildId: string | undefined = pos >= 0 ? leafPath[pos + 1] : undefined;\n\treturn getBlockChildren(container).findIndex((c) => c.id === targetChildId);\n}\n\n/**\n * Trims a container to keep only content up to `(leafId, leafOffset)`, deleting\n * every child after the boundary at each level (see {@link deleteCoveredChildren})\n * and the boundary leaf's tail text. `containerPath` is the path to (and\n * including) `container`; `leafPath` is the boundary leaf's full node path, used\n * to descend to the boundary child.\n */\nfunction trimContainerTail(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tcontainerPath: readonly BlockId[],\n\tcontainer: BlockNode,\n\tleafPath: readonly string[],\n\tleafId: BlockId,\n\tleafOffset: number,\n): void {\n\tconst children: readonly BlockNode[] = getBlockChildren(container);\n\tconst boundaryIdx: number = boundaryChildIndex(container, leafPath);\n\tif (boundaryIdx < 0) return;\n\n\tdeleteCoveredChildren(state, builder, containerPath, container, boundaryIdx + 1, children.length);\n\n\tconst boundaryChild: BlockNode = children[boundaryIdx] as BlockNode;\n\tif (boundaryChild.id === leafId) {\n\t\tconst len: number = getBlockLength(boundaryChild);\n\t\tif (leafOffset < len) builder.deleteTextAt(leafId, leafOffset, len);\n\t\treturn;\n\t}\n\ttrimContainerTail(\n\t\tstate,\n\t\tbuilder,\n\t\t[...containerPath, boundaryChild.id],\n\t\tboundaryChild,\n\t\tleafPath,\n\t\tleafId,\n\t\tleafOffset,\n\t);\n}\n\n/**\n * Trims a container to keep only content from `(leafId, leafOffset)` onward,\n * deleting every child before the boundary at each level and the boundary\n * leaf's head text. Mirrors {@link trimContainerTail}.\n */\nfunction trimContainerHead(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tcontainerPath: readonly BlockId[],\n\tcontainer: BlockNode,\n\tleafPath: readonly string[],\n\tleafId: BlockId,\n\tleafOffset: number,\n): void {\n\tconst children: readonly BlockNode[] = getBlockChildren(container);\n\tconst boundaryIdx: number = boundaryChildIndex(container, leafPath);\n\tif (boundaryIdx < 0) return;\n\n\t// The boundary keeps its identity, so the descent below still finds it.\n\tdeleteCoveredChildren(state, builder, containerPath, container, 0, boundaryIdx);\n\n\tconst boundaryChild: BlockNode = children[boundaryIdx] as BlockNode;\n\tif (boundaryChild.id === leafId) {\n\t\tif (leafOffset > 0) builder.deleteTextAt(leafId, 0, leafOffset);\n\t\treturn;\n\t}\n\ttrimContainerHead(\n\t\tstate,\n\t\tbuilder,\n\t\t[...containerPath, boundaryChild.id],\n\t\tboundaryChild,\n\t\tleafPath,\n\t\tleafId,\n\t\tleafOffset,\n\t);\n}\n","/**\n * Core editor commands and barrel re-exports from submodules.\n *\n * This module contains text insertion, block splitting, block merging,\n * selection deletion, and select-all. Mark, delete, gap-cursor, node-selection,\n * and word-boundary commands are re-exported from their respective modules.\n */\n\nimport {\n\ttype Mark,\n\tcreateEmptyParagraph,\n\tcreateInlineNode,\n\tgenerateBlockId,\n\tgetBlockLength,\n\tgetBlockMarksAtOffset,\n\tgetCursorMarks,\n} from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport {\n\tcreateCollapsedSelection,\n\tcreateNodeSelection,\n\tcreateSelection,\n\tisCollapsed,\n\tisGapCursor,\n\tisNodeSelection,\n\tisTextSelection,\n\tselectionRange,\n} from '../model/Selection.js';\nimport { type BlockId, inlineType } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport {\n\tisInsideIsolating,\n\tisIsolatingBlock,\n\tisVoidBlock,\n\tsharesParent,\n} from '../state/NavigationQueries.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport type { TransactionBuilder } from '../state/Transaction.js';\nimport { resolveInsertPoint } from './CommandHelpers.js';\nimport { isMarkInclusive } from './CursorMarks.js';\nimport { insertParagraphAtGap, insertTextAtGap } from './GapCursorCommands.js';\nimport {\n\tdeleteNodeSelection,\n\tfindFirstLeafBlockId,\n\tfindLastLeafBlockId,\n\tinsertParagraphAfterNodeSelection,\n\tinsertTextAfterNodeSelection,\n} from './NodeSelectionCommands.js';\nimport { deleteCrossRootRange, deleteLeafRange, getRootBlockIndex } from './SelectionDeletion.js';\n\n// --- Re-exports from submodules ---\n\nexport {\n\tcanCrossBlockBoundary,\n\tisInsideIsolating,\n\tisIsolatingBlock,\n\tisVoidBlock,\n\tsharesParent,\n} from '../state/NavigationQueries.js';\n\nexport type { FeatureConfig } from './MarkCommands.js';\nexport {\n\tisMarkActive,\n\ttoggleBold,\n\ttoggleItalic,\n\ttoggleMark,\n\ttoggleUnderline,\n} from './MarkCommands.js';\n\nexport {\n\tdeleteBackward,\n\tdeleteForward,\n\tdeleteSoftLineBackward,\n\tdeleteSoftLineForward,\n\tdeleteWordBackward,\n\tdeleteWordForward,\n} from './DeleteCommands.js';\n\nexport {\n\tdeleteNodeSelection,\n\tfindFirstLeafBlockId,\n\tfindLastLeafBlockId,\n\tinsertParagraphAfterNodeSelection,\n\tinsertTextAfterNodeSelection,\n\tnavigateArrowIntoVoid,\n} from './NodeSelectionCommands.js';\n\nexport {\n\tdeleteBackwardAtGap,\n\tdeleteForwardAtGap,\n\tinsertParagraphAtGap,\n\tinsertTextAtGap,\n} from './GapCursorCommands.js';\n\nexport {\n\tfindWordBoundaryBackward,\n\tfindWordBoundaryForward,\n} from './WordBoundary.js';\n\nexport {\n\tapplyAttributedMark,\n\tgetMarkAttrAtSelection,\n\tisAttributedMarkActive,\n\tremoveAttributedMark,\n} from './AttributedMarkCommands.js';\n\nexport { forEachBlockIdInRange, forEachBlockInRange } from './RangeIterator.js';\n\n// --- Text Commands ---\n\n/** Inserts text at the current selection, replacing any selected range. */\nexport function insertTextCommand(\n\tstate: EditorState,\n\ttext: string,\n\torigin: 'input' | 'paste' = 'input',\n): Transaction {\n\tconst sel = state.selection;\n\n\t// NodeSelection: insert paragraph after void block with the text\n\tif (isNodeSelection(sel)) {\n\t\treturn insertTextAfterNodeSelection(state, sel, text, origin);\n\t}\n\n\t// GapCursor: insert paragraph at the gap position with the text\n\tif (isGapCursor(sel)) {\n\t\treturn insertTextAtGap(state, sel, text, origin);\n\t}\n\n\tconst builder = state.transaction(origin);\n\tconst marks = resolveActiveMarks(state);\n\n\tlet landingId: BlockId | undefined;\n\tif (!isCollapsed(sel)) {\n\t\tlandingId = addDeleteSelectionSteps(state, builder);\n\t}\n\n\tconst resolved = resolveInsertPoint(sel, state.getBlockOrder());\n\tconst insertBlockId: BlockId = landingId ?? resolved.blockId;\n\tconst insertOffset: number = landingId ? 0 : resolved.offset;\n\n\tbuilder.insertText(insertBlockId, insertOffset, text, marks);\n\tbuilder.setSelection(createCollapsedSelection(insertBlockId, insertOffset + text.length));\n\n\treturn builder.build();\n}\n\n/** Deletes the current selection. */\nexport function deleteSelectionCommand(state: EditorState): Transaction | null {\n\tif (isNodeSelection(state.selection)) {\n\t\treturn deleteNodeSelection(state, state.selection);\n\t}\n\tif (isGapCursor(state.selection)) return null;\n\tif (isCollapsed(state.selection)) return null;\n\n\t// Deleting a selection that spans the whole document resets it to the\n\t// canonical empty state (a single empty paragraph). Without this, the range\n\t// merge keeps the first block's type and attributes, leaving e.g. an empty\n\t// centered title behind so the placeholder never returns.\n\tif (selectionCoversDocument(state)) {\n\t\treturn clearDocument(state);\n\t}\n\n\tconst builder = state.transaction('input');\n\tconst landingId: BlockId | undefined = addDeleteSelectionSteps(state, builder);\n\n\tconst range = selectionRange(state.selection, state.getBlockOrder());\n\tconst cursorBlockId: BlockId = landingId ?? range.from.blockId;\n\tconst cursorOffset: number = landingId ? 0 : range.from.offset;\n\tbuilder.setSelection(createCollapsedSelection(cursorBlockId, cursorOffset));\n\n\treturn builder.build();\n}\n\n/** Splits the current block at the cursor position (Enter key). */\nexport function splitBlockCommand(state: EditorState): Transaction | null {\n\tconst sel = state.selection;\n\n\t// NodeSelection: insert empty paragraph after the void block\n\tif (isNodeSelection(sel)) {\n\t\treturn insertParagraphAfterNodeSelection(state, sel);\n\t}\n\n\t// GapCursor: insert empty paragraph at the gap position\n\tif (isGapCursor(sel)) {\n\t\treturn insertParagraphAtGap(state, sel);\n\t}\n\n\tconst builder = state.transaction('input');\n\n\tlet landingId: BlockId | undefined;\n\tif (!isCollapsed(sel)) {\n\t\tlandingId = addDeleteSelectionSteps(state, builder);\n\t}\n\n\tconst resolved = resolveInsertPoint(sel, state.getBlockOrder());\n\tconst blockId: BlockId = landingId ?? resolved.blockId;\n\tconst offset: number = landingId ? 0 : resolved.offset;\n\tconst newBlockId = generateBlockId();\n\n\t// splitBlock operates at the same level in the tree — the StepApplication\n\t// handles this correctly because it looks up the block by ID recursively.\n\tbuilder.splitBlock(blockId, offset, newBlockId);\n\tbuilder.setSelection(createCollapsedSelection(newBlockId, 0));\n\n\treturn builder.build();\n}\n\n/** Inserts a hard line break (InlineNode) at the current cursor position. */\nexport function insertHardBreakCommand(state: EditorState): Transaction | null {\n\tconst sel = state.selection;\n\n\tif (!isTextSelection(sel)) return null;\n\n\tconst builder = state.transaction('input');\n\n\tlet cursorBlockId: BlockId | undefined;\n\tif (!isCollapsed(sel)) {\n\t\tconst landingId: BlockId | undefined = addDeleteSelectionSteps(state, builder);\n\t\tcursorBlockId = landingId;\n\t}\n\n\tif (cursorBlockId) {\n\t\t// Cross-root deletion replaced from-block; insert hard break in landing block\n\t\tbuilder.insertInlineNode(cursorBlockId, 0, createInlineNode(inlineType('hard_break')));\n\t\tbuilder.setSelection(createCollapsedSelection(cursorBlockId, 1));\n\t} else {\n\t\tconst { blockId: insertBlockId, offset: insertOffset } = resolveInsertPoint(\n\t\t\tsel,\n\t\t\tstate.getBlockOrder(),\n\t\t);\n\t\tbuilder.insertInlineNode(\n\t\t\tinsertBlockId,\n\t\t\tinsertOffset,\n\t\t\tcreateInlineNode(inlineType('hard_break')),\n\t\t);\n\t\tbuilder.setSelection(createCollapsedSelection(insertBlockId, insertOffset + 1));\n\t}\n\n\treturn builder.build();\n}\n\n/**\n * Merges the current block with the previous block, respecting\n * isolating boundaries and void blocks.\n */\nexport function mergeBlockBackward(state: EditorState): Transaction | null {\n\treturn mergeAdjacentBlock(state, 'backward');\n}\n\n/**\n * Merges the next block into the current block, respecting\n * isolating boundaries and void blocks.\n */\nexport function mergeBlockForward(state: EditorState): Transaction | null {\n\treturn mergeAdjacentBlock(state, 'forward');\n}\n\n/**\n * Shared implementation for merging adjacent blocks in either direction.\n * Validates selection, isolating boundaries, and void blocks before merging.\n */\nfunction mergeAdjacentBlock(\n\tstate: EditorState,\n\tdirection: 'backward' | 'forward',\n): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst blockOrder = state.getBlockOrder();\n\tconst blockIdx: number = blockOrder.indexOf(sel.anchor.blockId);\n\n\tconst adjacentIdx: number = direction === 'backward' ? blockIdx - 1 : blockIdx + 1;\n\tif (adjacentIdx < 0 || adjacentIdx >= blockOrder.length) return null;\n\n\tconst adjacentId: BlockId | undefined = blockOrder[adjacentIdx];\n\tif (!adjacentId) return null;\n\n\tif (isIsolatingBlock(state, sel.anchor.blockId) || isIsolatingBlock(state, adjacentId)) {\n\t\treturn null;\n\t}\n\tconst sameParent: boolean = sharesParent(state, sel.anchor.blockId, adjacentId);\n\tif (!sameParent && isInsideIsolating(state, sel.anchor.blockId)) return null;\n\n\tif (isVoidBlock(state, adjacentId)) {\n\t\tconst path = findNodePath(state.doc, adjacentId) ?? [];\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.setSelection(createNodeSelection(adjacentId, path as BlockId[]))\n\t\t\t.build();\n\t}\n\n\t// Text merges cannot cross container boundaries: their inverse split must\n\t// restore the source under the same parent as the target.\n\tif (!sameParent) return null;\n\n\tif (direction === 'backward') {\n\t\tconst prevBlock = state.getBlock(adjacentId);\n\t\tif (!prevBlock) return null;\n\t\tconst prevLen: number = getBlockLength(prevBlock);\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.mergeBlocksAt(adjacentId, sel.anchor.blockId)\n\t\t\t.setSelection(createCollapsedSelection(adjacentId, prevLen))\n\t\t\t.build();\n\t}\n\n\treturn state\n\t\t.transaction('input')\n\t\t.mergeBlocksAt(sel.anchor.blockId, adjacentId)\n\t\t.setSelection(createCollapsedSelection(sel.anchor.blockId, sel.anchor.offset))\n\t\t.build();\n}\n\n/** Selects all content in the editor, using leaf block endpoints. */\nexport function selectAll(state: EditorState): Transaction {\n\tconst docRange = documentRange(state);\n\tif (!docRange) return state.transaction('command').setSelection(state.selection).build();\n\n\treturn state\n\t\t.transaction('command')\n\t\t.setSelection(createSelection(docRange.from, docRange.to))\n\t\t.build();\n}\n\n// --- Internal Helpers ---\n\ninterface DocumentPosition {\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n}\n\n/**\n * Endpoints of a full-document selection: the start of the first leaf block to\n * the end of the last leaf block. Returns `null` for an empty document.\n */\nfunction documentRange(\n\tstate: EditorState,\n): { from: DocumentPosition; to: DocumentPosition } | null {\n\tconst blocks = state.doc.children;\n\tconst firstBlock = blocks[0];\n\tconst lastBlock = blocks[blocks.length - 1];\n\tif (!firstBlock || !lastBlock) return null;\n\n\tconst firstLeafId: BlockId = findFirstLeafBlockId(firstBlock);\n\tconst lastLeafId: BlockId = findLastLeafBlockId(lastBlock);\n\tconst lastLeaf = state.getBlock(lastLeafId);\n\tconst lastLeafLen: number = lastLeaf ? getBlockLength(lastLeaf) : 0;\n\n\treturn {\n\t\tfrom: { blockId: firstLeafId, offset: 0 },\n\t\tto: { blockId: lastLeafId, offset: lastLeafLen },\n\t};\n}\n\n/** True when the current text selection spans the entire document. */\nfunction selectionCoversDocument(state: EditorState): boolean {\n\tif (!isTextSelection(state.selection)) return false;\n\tconst docRange = documentRange(state);\n\tif (!docRange) return false;\n\n\tconst range = selectionRange(state.selection, state.getBlockOrder());\n\treturn (\n\t\trange.from.blockId === docRange.from.blockId &&\n\t\trange.from.offset === docRange.from.offset &&\n\t\trange.to.blockId === docRange.to.blockId &&\n\t\trange.to.offset === docRange.to.offset\n\t);\n}\n\n/**\n * Replaces the whole document with a single empty paragraph and places the\n * cursor inside it. The fresh paragraph is inserted before the originals are\n * removed so the document never passes through a zero-children state.\n */\nfunction clearDocument(state: EditorState): Transaction {\n\tconst newBlockId: BlockId = generateBlockId();\n\tconst builder = state.transaction('input');\n\tconst originalCount: number = state.doc.children.length;\n\n\tbuilder.insertNode([], 0, createEmptyParagraph(newBlockId));\n\t// The originals shifted to indices 1..originalCount; remove them descending\n\t// so each index stays valid as the document shrinks.\n\tfor (let i = originalCount; i >= 1; i--) {\n\t\tbuilder.removeNode([], i);\n\t}\n\tbuilder.setSelection(createCollapsedSelection(newBlockId, 0));\n\n\treturn builder.build();\n}\n\n/** The marks text typed over the current selection receives. */\nexport function resolveActiveMarks(state: EditorState): readonly Mark[] {\n\tif (state.storedMarks) return state.storedMarks;\n\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return [];\n\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return [];\n\n\t// A range replaced by typing inherits the marks at its anchor (raw content\n\t// marks); only a collapsed cursor honors right-boundary inclusivity.\n\tif (!isCollapsed(sel)) return getBlockMarksAtOffset(block, sel.anchor.offset);\n\n\treturn getCursorMarks(block, sel.anchor.offset, (type) => isMarkInclusive(state.schema, type));\n}\n\n/**\n * Adds steps to delete the current text selection.\n * Returns a replacement cursor block ID when the original from-block\n * was inside a composite root that got removed (undefined otherwise).\n */\nexport function addDeleteSelectionSteps(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n): BlockId | undefined {\n\tif (!isTextSelection(state.selection)) return undefined;\n\tconst blockOrder = state.getBlockOrder();\n\tconst range = selectionRange(state.selection, blockOrder);\n\tconst fromIdx = blockOrder.indexOf(range.from.blockId);\n\tconst toIdx = blockOrder.indexOf(range.to.blockId);\n\n\tif (fromIdx === toIdx) {\n\t\tbuilder.deleteTextAt(range.from.blockId, range.from.offset, range.to.offset);\n\t\treturn undefined;\n\t}\n\n\tconst fromRootIdx: number = getRootBlockIndex(state, range.from.blockId);\n\tconst toRootIdx: number = getRootBlockIndex(state, range.to.blockId);\n\n\tif (fromRootIdx === toRootIdx || fromRootIdx < 0 || toRootIdx < 0) {\n\t\treturn deleteLeafRange(state, builder, blockOrder, range, fromIdx, toIdx);\n\t}\n\n\treturn deleteCrossRootRange(state, builder, range, fromRootIdx, toRootIdx);\n}\n"],"mappings":"Y,2kBAuBA,SAAgBgC,EACfC,EACAC,GAEA,GAAiB,UAAbA,EAAIC,KACP,OAAOC,EAAgBH,EAAOC,GAI/B,MAAMG,EAAiCJ,EAAMK,gBACvCC,EAAmBF,EAAWG,QAAQN,EAAIO,SAEhD,GAAIF,GAAY,EAAG,OAAO,KAE1B,MAAMG,EAA8BL,EAAWE,EAAW,GAC1D,IAAKG,EAAQ,OAAO,KAEpB,GAAIxB,EAAYe,EAAOS,GAAS,CAC/B,MAAMC,EAAOnC,EAAayB,EAAMW,IAAKF,IAAW,GAChD,OAAOT,EACLY,YAAY,SACZC,aAAalC,EAAoB8B,EAAQC,IACzCI,OACH,CAEA,MAAMC,EAAYf,EAAMgB,SAASP,GACjC,IAAKM,EAAW,OAAO,KACvB,MAAME,EAAkB3C,EAAeyC,GACvC,OAAOf,EAAMY,YAAY,SAASC,aAAajC,EAAyB6B,EAAQQ,IAAUH,OAC3F,CASA,SAAgBI,EACflB,EACAC,GAEA,GAAiB,WAAbA,EAAIC,KACP,OAAOC,EAAgBH,EAAOC,GAI/B,MAAMG,EAAiCJ,EAAMK,gBACvCC,EAAmBF,EAAWG,QAAQN,EAAIO,SAEhD,GAAIF,GAAYF,EAAWe,OAAS,EAAG,OAAO,KAE9C,MAAMC,EAA8BhB,EAAWE,EAAW,GAC1D,IAAKc,EAAQ,OAAO,KAEpB,GAAInC,EAAYe,EAAOoB,GAAS,CAC/B,MAAMV,EAAOnC,EAAayB,EAAMW,IAAKS,IAAW,GAChD,OAAOpB,EACLY,YAAY,SACZC,aAAalC,EAAoByC,EAAQV,IACzCI,OACH,CAEA,OAAOd,EAAMY,YAAY,SAASC,aAAajC,EAAyBwC,EAAQ,IAAIN,OACrF,CAGA,SAASX,EAAgB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,IAERxK,EAAYe,EAAO2B,IAAK8H,EAAMhF,KAAK9C,GACxC6H,EAAa7H,EACb,MAAMG,EAA+B9B,EAAMgB,SAASW,GAChDG,GAAOF,EAAmBC,EAASC,EAAOC,EAC/C,CAGAK,EACCpC,EACA6B,EACAoH,EAASS,OAAQ/H,GAAO1C,EAAYe,EAAO2B,KAE5C,IAAK,MAAOgI,KAAaC,KAAcL,EACtC,GAAKI,EACL,IAAK,MAAME,KAAYD,EAAW/H,EAAQ8C,cAAcgF,EAAUE,GAGnE,OAAuB,IAAhBV,OAAoB,EAAYG,CACxC,CC8USQ,CAAgB9J,EAAO6B,EAASzB,EAAY2B,EAAOgH,EAASC,GAG7D1F,EAAqBtD,EAAO6B,EAASE,EAAOwB,EAAaC,EACjE,Q"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{B as t,P as n,R as e,_ as o,p as r}from"./Document-ssR6hBzG.mjs";import{a as s}from"./TypeBrands-Ch9856Gb.mjs";function c(t,n,e){const o=t.getNodeSpec?.(n);if(!o?.content)return!0;const r=(t.getNodeSpec?.(e))?.group;for(const s of o.content.allow){if(s===e)return!0;if("text"!==s&&r&&s===r)return!0}return!1}function i(t,n,e){const o=t.getNodeSpec(n);if(!o?.content)return!0;const{min:r=0,max:s=Number.POSITIVE_INFINITY}=o.content,i=e.filter(t=>"text"!==t);if(i.length<r||i.length>s)return!1;for(const f of i)if(!c(t,n,f))return!1;return!0}function f(t,n){const e=[];let o=!1;for(const r of t.children){const{node:t,hoisted:s}=u(r,n);(t!==r||s.length>0)&&(o=!0),e.push(t,...s)}return o?{children:e}:t}function u(i,f){if(t(i))return{node:i,hoisted:[]};const d=[],p=[];let a=!1;const h=t=>{c(f,i.type,t.type)?d.push(t):(p.push(t),a=!0)};for(const t of i.children){if(!e(t)){d.push(t);continue}const n=u(t,f);n.node!==t&&(a=!0),h(n.node);for(const t of n.hoisted)h(t)}if(!a)return{node:i,hoisted:[]};const l=function(t,c,i){const f=(i.getNodeSpec(t.type)?.content?.allow)?.includes("text")??!1;if(0===c.length)return f?[o("")]:[r(s("paragraph"),[o("")])];const u=1===c.length?c[0]:void 0;if(f&&u&&e(u)&&"paragraph"===u.type&&!u.attrs&&!u.htmlId){const t=n(u);return t.length>0?[...t]:[o("")]}return c}(i,d,f);return{node:r(i.type,l,i.id,i.attrs,i.htmlId),hoisted:p}}export{f as n,i as r,c as t};
|
|
2
|
+
//# sourceMappingURL=ContentModel-dkGOh3N7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentModel-dkGOh3N7.mjs","names":["isLeafBlock","getInlineChildren","isBlockNode","createTextNode","createBlockNode","nodeType","canContain","registry","parentType","childType","parentSpec","getNodeSpec","content","childGroup","group","allowed","allow","validateContent","childTypes","min","max","Number","POSITIVE_INFINITY","blockChildTypes","filter","t","length","hoistDisallowedBlocks","doc","children","changed","block","node","hoisted","repairContainer","push","kept","place","candidate","type","child","repaired","bubbled","finalChildren","leafCapable","includes","only","attrs","htmlId","inline","resolveRepairedChildren","id"],"sources":["../../src/model/ContentModel.ts"],"sourcesContent":["/**\n * Content model validation for nested document structures.\n * Validates whether a parent node type can contain given child types.\n */\n\nimport type { BlockNode, ChildNode, Document } from './Document.js';\nimport {\n\tcreateBlockNode,\n\tcreateTextNode,\n\tgetInlineChildren,\n\tisBlockNode,\n\tisLeafBlock,\n} from './Document.js';\nimport type { NodeSpec } from './NodeSpec.js';\nimport type { SchemaRegistry } from './SchemaRegistry.js';\nimport { nodeType } from './TypeBrands.js';\n\n/** Content rules can be read from either a registry or an editor state's schema. */\nexport interface ContentSchema {\n\treadonly getNodeSpec?: (type: string) => NodeSpec | undefined;\n}\n\n/**\n * Checks if a parent node type can contain a child node type,\n * using the content rules and group system from NodeSpec.\n */\nexport function canContain(\n\tregistry: ContentSchema,\n\tparentType: string,\n\tchildType: string,\n): boolean {\n\tconst parentSpec = registry.getNodeSpec?.(parentType);\n\tif (!parentSpec?.content) return true; // No content rule = anything allowed\n\n\tconst childSpec = registry.getNodeSpec?.(childType);\n\tconst childGroup = childSpec?.group;\n\n\tfor (const allowed of parentSpec.content.allow) {\n\t\tif (allowed === childType) return true;\n\t\tif (allowed === 'text') continue; // 'text' refers to TextNodes, not BlockNodes\n\t\tif (childGroup && allowed === childGroup) return true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Validates whether the given children types are valid for a parent node type.\n * Checks allow list, min/max constraints.\n */\nexport function validateContent(\n\tregistry: SchemaRegistry,\n\tparentType: string,\n\tchildTypes: readonly string[],\n): boolean {\n\tconst parentSpec = registry.getNodeSpec(parentType);\n\tif (!parentSpec?.content) return true;\n\n\tconst { min = 0, max = Number.POSITIVE_INFINITY } = parentSpec.content;\n\n\t// Check count constraints (only for block children, not text)\n\tconst blockChildTypes = childTypes.filter((t) => t !== 'text');\n\tif (blockChildTypes.length < min || blockChildTypes.length > max) return false;\n\n\t// Check each child is allowed\n\tfor (const childType of blockChildTypes) {\n\t\tif (!canContain(registry, parentType, childType)) return false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Repairs a parsed document so no container holds a block its content rule\n * forbids. A disallowed block (e.g. a `table` a Markdown/HTML importer nested\n * under a `list_item`, whose flat-with-indent model cannot hold it, #194)\n * bubbles up to the nearest ancestor that allows it, and to the document root\n * otherwise — the root imposes no content rule, so relocation is always\n * lossless. Order is preserved: a hoisted block lands immediately after the\n * subtree it escaped from. Runs only with a registry; identity is preserved when\n * nothing moves so callers can skip needless work.\n */\nexport function hoistDisallowedBlocks(doc: Document, registry: SchemaRegistry): Document {\n\tconst children: BlockNode[] = [];\n\tlet changed = false;\n\tfor (const block of doc.children) {\n\t\tconst { node, hoisted } = repairContainer(block, registry);\n\t\tif (node !== block || hoisted.length > 0) changed = true;\n\t\tchildren.push(node, ...hoisted);\n\t}\n\treturn changed ? { children } : doc;\n}\n\n/**\n * Repairs one block's subtree, returning the repaired node and any descendant\n * blocks that could not be placed within it (to be hoisted by the caller).\n */\nfunction repairContainer(\n\tblock: BlockNode,\n\tregistry: SchemaRegistry,\n): { readonly node: BlockNode; readonly hoisted: readonly BlockNode[] } {\n\tif (isLeafBlock(block)) return { node: block, hoisted: [] };\n\n\tconst kept: ChildNode[] = [];\n\tconst hoisted: BlockNode[] = [];\n\tlet changed = false;\n\n\tconst place = (candidate: BlockNode): void => {\n\t\tif (canContain(registry, block.type, candidate.type)) {\n\t\t\tkept.push(candidate);\n\t\t} else {\n\t\t\thoisted.push(candidate);\n\t\t\tchanged = true;\n\t\t}\n\t};\n\n\tfor (const child of block.children) {\n\t\tif (!isBlockNode(child)) {\n\t\t\tkept.push(child);\n\t\t\tcontinue;\n\t\t}\n\t\tconst repaired = repairContainer(child, registry);\n\t\tif (repaired.node !== child) changed = true;\n\t\tplace(repaired.node);\n\t\tfor (const bubbled of repaired.hoisted) place(bubbled);\n\t}\n\n\tif (!changed) return { node: block, hoisted: [] };\n\n\tconst finalChildren: readonly ChildNode[] = resolveRepairedChildren(block, kept, registry);\n\treturn {\n\t\tnode: createBlockNode(block.type, finalChildren, block.id, block.attrs, block.htmlId),\n\t\thoisted,\n\t};\n}\n\n/**\n * Settles a repaired container's children: an emptied container gets a valid\n * placeholder, and a hybrid (leaf-capable) container reduced to a single plain\n * paragraph collapses back to the canonical leaf shape — mirroring how the\n * importers keep a lone single-paragraph item a leaf (#194).\n */\nfunction resolveRepairedChildren(\n\tblock: BlockNode,\n\tkept: readonly ChildNode[],\n\tregistry: SchemaRegistry,\n): readonly ChildNode[] {\n\tconst allow: readonly string[] | undefined = registry.getNodeSpec(block.type)?.content?.allow;\n\tconst leafCapable: boolean = allow?.includes('text') ?? false;\n\n\tif (kept.length === 0) {\n\t\treturn leafCapable\n\t\t\t? [createTextNode('')]\n\t\t\t: [createBlockNode(nodeType('paragraph'), [createTextNode('')])];\n\t}\n\n\tconst only: ChildNode | undefined = kept.length === 1 ? kept[0] : undefined;\n\tif (\n\t\tleafCapable &&\n\t\tonly &&\n\t\tisBlockNode(only) &&\n\t\tonly.type === 'paragraph' &&\n\t\t!only.attrs &&\n\t\t!only.htmlId\n\t) {\n\t\tconst inline = getInlineChildren(only);\n\t\treturn inline.length > 0 ? [...inline] : [createTextNode('')];\n\t}\n\treturn kept;\n}\n"],"mappings":"Y,0GA0BA,SAAgBM,EACfC,EACAC,EACAC,GAEA,MAAMC,EAAaH,EAASI,cAAcH,GAC1C,IAAKE,GAAYE,QAAS,OAAO,EAGjC,MAAMC,GADYN,EAASI,cAAcF,KACXK,MAE9B,IAAK,MAAMC,KAAWL,EAAWE,QAAQI,MAAO,CAC/C,GAAID,IAAYN,EAAW,OAAO,EAClC,GAAgB,SAAZM,GACAF,GAAcE,IAAYF,EAAY,OAAO,CAClD,CAEA,OAAO,CACR,CAMA,SAAgBI,EACfV,EACAC,EACAU,GAEA,MAAMR,EAAaH,EAASI,YAAYH,GACxC,IAAKE,GAAYE,QAAS,OAAO,EAEjC,MAAMO,IAAEA,EAAM,EAAAC,IAAGA,EAAMC,OAAOC,mBAAsBZ,EAAWE,QAGzDW,EAAkBL,EAAWM,OAAQC,GAAY,SAANA,GACjD,GAAIF,EAAgBG,OAASP,GAAOI,EAAgBG,OAASN,EAAK,OAAO,EAGzE,IAAK,MAAMX,KAAac,EACvB,IAAKjB,EAAWC,EAAUC,EAAYC,GAAY,OAAO,EAG1D,OAAO,CACR,CAYA,SAAgBkB,EAAsBC,EAAerB,GACpD,MAAMsB,EAAwB,GAC9B,IAAIC,GAAU,EACd,IAAK,MAAMC,KAASH,EAAIC,SAAU,CACjC,MAAMG,KAAEA,EAAAC,QAAMA,GAAYC,EAAgBH,EAAOxB,IAC7CyB,IAASD,GAASE,EAAQP,OAAS,KAAGI,GAAU,GACpDD,EAASM,KAAKH,KAASC,EACxB,CACA,OAAOH,EAAU,CAAED,YAAaD,CACjC,CAMA,SAASM,EACRH,EACAxB,GAEA,GAAIP,EAAY+B,GAAQ,MAAO,CAAEC,KAAMD,EAAOE,QAAS,IAEvD,MAAMG,EAAoB,GACpBH,EAAuB,GAC7B,IAAIH,GAAU,EAEd,MAAMO,EAASC,IACVhC,EAAWC,EAAUwB,EAAMQ,KAAMD,EAAUC,MAC9CH,EAAKD,KAAKG,IAEVL,EAAQE,KAAKG,GACbR,GAAU,IAIZ,IAAK,MAAMU,KAAST,EAAMF,SAAU,CACnC,IAAK3B,EAAYsC,GAAQ,CACxBJ,EAAKD,KAAKK,GACV,QACD,CACA,MAAMC,EAAWP,EAAgBM,EAAOjC,GACpCkC,EAAST,OAASQ,IAAOV,GAAU,GACvCO,EAAMI,EAAST,MACf,IAAK,MAAMU,KAAWD,EAASR,QAASI,EAAMK,EAC/C,CAEA,IAAKZ,EAAS,MAAO,CAAEE,KAAMD,EAAOE,QAAS,IAE7C,MAAMU,EAaP,SACCZ,EACAK,EACA7B,GAGA,MAAMqC,GADuCrC,EAASI,YAAYoB,EAAMQ,OAAO3B,SAASI,QACpD6B,SAAS,UAAW,EAExD,GAAoB,IAAhBT,EAAKV,OACR,OAAOkB,EACJ,CAACzC,EAAe,KAChB,CAACC,EAAgBC,EAAS,aAAc,CAACF,EAAe,OAG5D,MAAM2C,EAA8C,IAAhBV,EAAKV,OAAeU,EAAK,QAAK,EAClE,GACCQ,GACAE,GACA5C,EAAY4C,IACE,cAAdA,EAAKP,OACJO,EAAKC,QACLD,EAAKE,OACL,CACD,MAAMC,EAAShD,EAAkB6C,GACjC,OAAOG,EAAOvB,OAAS,EAAI,IAAIuB,GAAU,CAAC9C,EAAe,IAC1D,CACA,OAAOiC,CACR,CAxC6Cc,CAAwBnB,EAAOK,EAAM7B,GACjF,MAAO,CACNyB,KAAM5B,EAAgB2B,EAAMQ,KAAMI,EAAeZ,EAAMoB,GAAIpB,EAAMgB,MAAOhB,EAAMiB,QAC9Ef,UAEF,Q"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CursorMarks-CqHLzGNI.mjs","names":[],"sources":["../../src/commands/CursorMarks.ts"],"sourcesContent":["/**\n * Resolves the marks active at a collapsed cursor for insertion and toolbar\n * state. Centralizes the `storedMarks ?? derived-marks` lookup that several\n * command modules previously duplicated, and makes that derivation honor\n * mark inclusivity (see {@link MarkSpec.inclusive}) so non-inclusive marks\n * such as links do not bleed onto text typed at their right boundary.\n */\n\nimport type { Mark } from '../model/Document.js';\nimport { getCursorMarks } from '../model/Document.js';\nimport type { Schema } from '../model/Schema.js';\nimport { isCollapsed, isTextSelection } from '../model/Selection.js';\nimport type { MarkTypeName } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\n\n/** A mark extends onto adjacent typing unless its spec opts out via `inclusive: false`. */\nexport function isMarkInclusive(schema: Schema, type: MarkTypeName): boolean {\n\treturn schema.getMarkSpec?.(type)?.inclusive !== false;\n}\n\n/**\n * Returns the marks a collapsed cursor carries: stored marks when present,\n * otherwise the inclusivity-aware marks derived from the surrounding content.\n * Returns an empty set for non-text or non-collapsed selections.\n */\nexport function resolveCursorMarks(state: EditorState): readonly Mark[] {\n\tif (state.storedMarks) return state.storedMarks;\n\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel) || !isCollapsed(sel)) return [];\n\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return [];\n\n\treturn getCursorMarks(block, sel.anchor.offset, (type) => isMarkInclusive(state.schema, type));\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CursorMarks-CqHLzGNI.mjs","names":["getCursorMarks","isCollapsed","isTextSelection","isMarkInclusive","schema","type","getMarkSpec","inclusive","resolveCursorMarks","state","storedMarks","sel","selection","block","getBlock","anchor","blockId","offset"],"sources":["../../src/commands/CursorMarks.ts"],"sourcesContent":["/**\n * Resolves the marks active at a collapsed cursor for insertion and toolbar\n * state. Centralizes the `storedMarks ?? derived-marks` lookup that several\n * command modules previously duplicated, and makes that derivation honor\n * mark inclusivity (see {@link MarkSpec.inclusive}) so non-inclusive marks\n * such as links do not bleed onto text typed at their right boundary.\n */\n\nimport type { Mark } from '../model/Document.js';\nimport { getCursorMarks } from '../model/Document.js';\nimport type { Schema } from '../model/Schema.js';\nimport { isCollapsed, isTextSelection } from '../model/Selection.js';\nimport type { MarkTypeName } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\n\n/** A mark extends onto adjacent typing unless its spec opts out via `inclusive: false`. */\nexport function isMarkInclusive(schema: Schema, type: MarkTypeName): boolean {\n\treturn schema.getMarkSpec?.(type)?.inclusive !== false;\n}\n\n/**\n * Returns the marks a collapsed cursor carries: stored marks when present,\n * otherwise the inclusivity-aware marks derived from the surrounding content.\n * Returns an empty set for non-text or non-collapsed selections.\n */\nexport function resolveCursorMarks(state: EditorState): readonly Mark[] {\n\tif (state.storedMarks) return state.storedMarks;\n\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel) || !isCollapsed(sel)) return [];\n\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return [];\n\n\treturn getCursorMarks(block, sel.anchor.offset, (type) => isMarkInclusive(state.schema, type));\n}\n"],"mappings":"Y,oFAgBA,SAAgBG,EAAgBC,EAAgBC,GAC/C,OAAiD,IAA1CD,EAAOE,cAAcD,IAAOE,SACpC,CAOA,SAAgBC,EAAmBC,GAClC,GAAIA,EAAMC,YAAa,OAAOD,EAAMC,YAEpC,MAAMC,EAAMF,EAAMG,UAClB,IAAKV,EAAgBS,KAASV,EAAYU,GAAM,MAAO,GAEvD,MAAME,EAAQJ,EAAMK,SAASH,EAAII,OAAOC,SACxC,OAAKH,EAEEb,EAAea,EAAOF,EAAII,OAAOE,OAASZ,GAASF,EAAgBM,EAAML,OAAQC,IAFrE,EAGpB,Q"}
|