@notectl/core 2.2.6 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AlignmentPlugin-DeD4C4EP.mjs → AlignmentPlugin--xAFlRqE.mjs} +2 -2
- package/dist/chunks/{AlignmentPlugin-DeD4C4EP.mjs.map → AlignmentPlugin--xAFlRqE.mjs.map} +1 -1
- package/dist/chunks/{AttrRegistry-DcDVyzLm.mjs → AttrRegistry-B3zB02z9.mjs} +2 -2
- package/dist/chunks/AttrRegistry-B3zB02z9.mjs.map +1 -0
- package/dist/chunks/{AttributedMarkCommands-D4W2Jgpj.mjs → AttributedMarkCommands-bagbH8Qt.mjs} +2 -2
- package/dist/chunks/{AttributedMarkCommands-D4W2Jgpj.mjs.map → AttributedMarkCommands-bagbH8Qt.mjs.map} +1 -1
- package/dist/chunks/{BidiIsolationPlugin-BddRbDCN.mjs → BidiIsolationPlugin-DBXyXpgm.mjs} +2 -2
- package/dist/chunks/{BidiIsolationPlugin-BddRbDCN.mjs.map → BidiIsolationPlugin-DBXyXpgm.mjs.map} +1 -1
- package/dist/chunks/BlockInsertion-CJusvrDL.mjs +2 -0
- package/dist/chunks/BlockInsertion-CJusvrDL.mjs.map +1 -0
- package/dist/chunks/BlockquotePlugin-Bz2glHwX.mjs +2 -0
- package/dist/chunks/{BlockquotePlugin-4V7KV_Sb.mjs.map → BlockquotePlugin-Bz2glHwX.mjs.map} +1 -1
- package/dist/chunks/{CaretNavigationPlugin-C6XBwp0N.mjs → CaretNavigationPlugin-CNsT0eb4.mjs} +2 -2
- package/dist/chunks/{CaretNavigationPlugin-C6XBwp0N.mjs.map → CaretNavigationPlugin-CNsT0eb4.mjs.map} +1 -1
- package/dist/chunks/CodeBlockPlugin-C1hrdbSZ.mjs +2 -0
- package/dist/chunks/CodeBlockPlugin-C1hrdbSZ.mjs.map +1 -0
- package/dist/chunks/{ColorGrid-DPNiXxpD.mjs → ColorGrid-C9RQoEWF.mjs} +2 -2
- package/dist/chunks/{ColorGrid-DPNiXxpD.mjs.map → ColorGrid-C9RQoEWF.mjs.map} +1 -1
- package/dist/chunks/ColorPickerPopup-DiA68Pzz.mjs +2 -0
- package/dist/chunks/{ColorPickerPopup-lcf3jS6G.mjs.map → ColorPickerPopup-DiA68Pzz.mjs.map} +1 -1
- package/dist/chunks/Commands-1dFFldi7.mjs +2 -0
- package/dist/chunks/Commands-1dFFldi7.mjs.map +1 -0
- package/dist/chunks/ContentModel-NpAj7vGW.mjs +2 -0
- package/dist/chunks/ContentModel-NpAj7vGW.mjs.map +1 -0
- package/dist/chunks/Decoration-BpoEOANl.mjs +2 -0
- package/dist/chunks/Decoration-BpoEOANl.mjs.map +1 -0
- package/dist/chunks/{DirectionDetection-C7XE0nxW.mjs → DirectionDetection-CDVSEWQ6.mjs} +2 -2
- package/dist/chunks/{DirectionDetection-C7XE0nxW.mjs.map → DirectionDetection-CDVSEWQ6.mjs.map} +1 -1
- package/dist/chunks/Document-827l3P80.mjs +2 -0
- package/dist/chunks/Document-827l3P80.mjs.map +1 -0
- package/dist/chunks/DocumentParser-D2tr3ZKn.mjs +2 -0
- package/dist/chunks/DocumentParser-D2tr3ZKn.mjs.map +1 -0
- package/dist/chunks/EditorEventBoundary-zpYRxryo.mjs +2 -0
- package/dist/chunks/EditorEventBoundary-zpYRxryo.mjs.map +1 -0
- package/dist/chunks/{FontPlugin-DQMj65Bc.mjs → FontPlugin-By-TGrQo.mjs} +2 -2
- package/dist/chunks/{FontPlugin-DQMj65Bc.mjs.map → FontPlugin-By-TGrQo.mjs.map} +1 -1
- package/dist/chunks/{FontSizePlugin-9StCjEfN.mjs → FontSizePlugin-Dln-tYXV.mjs} +2 -2
- package/dist/chunks/FontSizePlugin-Dln-tYXV.mjs.map +1 -0
- package/dist/chunks/FormulaPlugin-By1befrR.mjs +2 -0
- package/dist/chunks/FormulaPlugin-By1befrR.mjs.map +1 -0
- package/dist/chunks/GapCursorNavigation-BuXngVu-.mjs +2 -0
- package/dist/chunks/{GapCursorNavigation-ycNzuQVH.mjs.map → GapCursorNavigation-BuXngVu-.mjs.map} +1 -1
- package/dist/chunks/{GapCursorPlugin-Zvxjnr82.mjs → GapCursorPlugin-DAxVzXRs.mjs} +2 -2
- package/dist/chunks/{GapCursorPlugin-Zvxjnr82.mjs.map → GapCursorPlugin-DAxVzXRs.mjs.map} +1 -1
- package/dist/chunks/HTMLUtils-Bhg3_P8B.mjs +2 -0
- package/dist/chunks/HTMLUtils-Bhg3_P8B.mjs.map +1 -0
- package/dist/chunks/{HardBreakPlugin-9DOyCyyM.mjs → HardBreakPlugin-DlbSlrdq.mjs} +2 -2
- package/dist/chunks/{HardBreakPlugin-9DOyCyyM.mjs.map → HardBreakPlugin-DlbSlrdq.mjs.map} +1 -1
- package/dist/chunks/HeadingPlugin-uMAjPOk5.mjs +2 -0
- package/dist/chunks/{HeadingPlugin-BuGoM9Rz.mjs.map → HeadingPlugin-uMAjPOk5.mjs.map} +1 -1
- package/dist/chunks/{HighlightPlugin-C6pHifVz.mjs → HighlightPlugin-Bj7FPkIQ.mjs} +2 -2
- package/dist/chunks/{HighlightPlugin-C6pHifVz.mjs.map → HighlightPlugin-Bj7FPkIQ.mjs.map} +1 -1
- package/dist/chunks/HorizontalRulePlugin-DUVmTQpX.mjs +2 -0
- package/dist/chunks/HorizontalRulePlugin-DUVmTQpX.mjs.map +1 -0
- package/dist/chunks/ImagePlugin-FToCOjd5.mjs +2 -0
- package/dist/chunks/{ImagePlugin-KpkuE2LH.mjs.map → ImagePlugin-FToCOjd5.mjs.map} +1 -1
- package/dist/chunks/{InlineCodePlugin-DMr4O7c7.mjs → InlineCodePlugin-pISIoGQE.mjs} +2 -2
- package/dist/chunks/InlineCodePlugin-pISIoGQE.mjs.map +1 -0
- package/dist/chunks/InlineStyleMarkSpec-CjSRj4f_.mjs +2 -0
- package/dist/chunks/{InlineStyleMarkSpec-C6LJT7kp.mjs.map → InlineStyleMarkSpec-CjSRj4f_.mjs.map} +1 -1
- package/dist/chunks/LinkPlugin-Ct5Z180S.mjs +2 -0
- package/dist/chunks/LinkPlugin-Ct5Z180S.mjs.map +1 -0
- package/dist/chunks/ListPlugin-DAY5ezNs.mjs +2 -0
- package/dist/chunks/ListPlugin-DAY5ezNs.mjs.map +1 -0
- package/dist/chunks/MarkInputRule-Bdi8KPus.mjs +2 -0
- package/dist/chunks/MarkInputRule-Bdi8KPus.mjs.map +1 -0
- package/dist/chunks/MarkdownHTMLRegistry-CKEx7LkR.mjs +2 -0
- package/dist/chunks/MarkdownHTMLRegistry-CKEx7LkR.mjs.map +1 -0
- package/dist/chunks/MarkdownParser-CWt3M6jR.mjs +2 -0
- package/dist/chunks/MarkdownParser-CWt3M6jR.mjs.map +1 -0
- package/dist/chunks/MarkdownSerializer-J-i28out.mjs +2 -0
- package/dist/chunks/MarkdownSerializer-J-i28out.mjs.map +1 -0
- package/dist/chunks/{NodeResolver-ChgLF_IP.mjs → NodeResolver-Dleih-8R.mjs} +2 -2
- package/dist/chunks/{NodeResolver-ChgLF_IP.mjs.map → NodeResolver-Dleih-8R.mjs.map} +1 -1
- package/dist/chunks/NodeSelectionCommands-1PjwUDTJ.mjs +2 -0
- package/dist/chunks/{NodeSelectionCommands-Dj4VxLdD.mjs.map → NodeSelectionCommands-1PjwUDTJ.mjs.map} +1 -1
- package/dist/chunks/PluginHelpers-Dx_0hfDe.mjs +2 -0
- package/dist/chunks/{PluginHelpers-KDuTlmXm.mjs.map → PluginHelpers-Dx_0hfDe.mjs.map} +1 -1
- package/dist/chunks/{PopupManager-DUtaK3WX.mjs → PopupManager-CT-fMZJn.mjs} +2 -2
- package/dist/chunks/{PopupManager-DUtaK3WX.mjs.map → PopupManager-CT-fMZJn.mjs.map} +1 -1
- package/dist/chunks/PopupPositioning-BFh6Ed1D.mjs +2 -0
- package/dist/chunks/{PopupPositioning-BB97-__N.mjs.map → PopupPositioning-BFh6Ed1D.mjs.map} +1 -1
- package/dist/chunks/PrintPlugin-7zz9mhhU.mjs +2 -0
- package/dist/chunks/PrintPlugin-7zz9mhhU.mjs.map +1 -0
- package/dist/chunks/{RangeIterator-o8v3msQe.mjs → RangeIterator-DP7Ud3Gp.mjs} +2 -2
- package/dist/chunks/{RangeIterator-o8v3msQe.mjs.map → RangeIterator-DP7Ud3Gp.mjs.map} +1 -1
- package/dist/chunks/SchemaRegistry-CkBN-1yW.mjs +2 -0
- package/dist/chunks/SchemaRegistry-CkBN-1yW.mjs.map +1 -0
- package/dist/chunks/{SimpleMark-CaQtFAau.mjs → SimpleMark-7CQcA4RK.mjs} +2 -2
- package/dist/chunks/{SimpleMark-CaQtFAau.mjs.map → SimpleMark-7CQcA4RK.mjs.map} +1 -1
- package/dist/chunks/{SmartPastePlugin-Bi_wpTCV.mjs → SmartPastePlugin-CYa_nD9v.mjs} +2 -2
- package/dist/chunks/{SmartPastePlugin-Bi_wpTCV.mjs.map → SmartPastePlugin-CYa_nD9v.mjs.map} +1 -1
- package/dist/chunks/StrikethroughPlugin-C2oWvGc3.mjs +2 -0
- package/dist/chunks/StrikethroughPlugin-C2oWvGc3.mjs.map +1 -0
- package/dist/chunks/StyleRuntime-DW6omotc.mjs +2 -0
- package/dist/chunks/StyleRuntime-DW6omotc.mjs.map +1 -0
- package/dist/chunks/{SuperSubPlugin-DVP7VnIz.mjs → SuperSubPlugin-D1xaKrSu.mjs} +2 -2
- package/dist/chunks/{SuperSubPlugin-DVP7VnIz.mjs.map → SuperSubPlugin-D1xaKrSu.mjs.map} +1 -1
- package/dist/chunks/TableDimensions-BBhjHNjQ.mjs +2 -0
- package/dist/chunks/TableDimensions-BBhjHNjQ.mjs.map +1 -0
- package/dist/chunks/TablePlugin-PJe3zwr-.mjs +2 -0
- package/dist/chunks/TablePlugin-PJe3zwr-.mjs.map +1 -0
- package/dist/chunks/TextColorPlugin-CTd9tfeG.mjs +2 -0
- package/dist/chunks/{TextColorPlugin-CEfZQ6Md.mjs.map → TextColorPlugin-CTd9tfeG.mjs.map} +1 -1
- package/dist/chunks/TextDirectionAutoPlugin-CPnKVVuI.mjs +2 -0
- package/dist/chunks/{TextDirectionAutoPlugin-CzWJjrvG.mjs.map → TextDirectionAutoPlugin-CPnKVVuI.mjs.map} +1 -1
- package/dist/chunks/{TextDirectionPlugin-DHB88HKf.mjs → TextDirectionPlugin-Bns_03vL.mjs} +2 -2
- package/dist/chunks/{TextDirectionPlugin-DHB88HKf.mjs.map → TextDirectionPlugin-Bns_03vL.mjs.map} +1 -1
- package/dist/chunks/TextDirectionService-BcX07mw2.mjs +2 -0
- package/dist/chunks/{TextDirectionService-OFOU6r_s.mjs.map → TextDirectionService-BcX07mw2.mjs.map} +1 -1
- package/dist/chunks/TextFormattingPlugin-DBVlePqj.mjs +2 -0
- package/dist/chunks/TextFormattingPlugin-DBVlePqj.mjs.map +1 -0
- package/dist/chunks/{ToolbarPlugin-DVGrFf8v.mjs → ToolbarPlugin-DtfGTO_V.mjs} +2 -2
- package/dist/chunks/{ToolbarPlugin-DVGrFf8v.mjs.map → ToolbarPlugin-DtfGTO_V.mjs.map} +1 -1
- package/dist/chunks/VideoPlugin-BrR8g6Rz.mjs +2 -0
- package/dist/chunks/VideoPlugin-BrR8g6Rz.mjs.map +1 -0
- package/dist/chunks/WordBoundary-CFpIJDNP.mjs +2 -0
- package/dist/chunks/{WordBoundary-DxeMBRyP.mjs.map → WordBoundary-CFpIJDNP.mjs.map} +1 -1
- package/dist/chunks/ar-Dg9PdDet.mjs +2 -0
- package/dist/chunks/ar-Dg9PdDet.mjs.map +1 -0
- package/dist/chunks/ar-eOA3UmiE.mjs +2 -0
- package/dist/chunks/{ar-BTShmP2E.mjs.map → ar-eOA3UmiE.mjs.map} +1 -1
- package/dist/chunks/de-DJ5EkXQo.mjs +2 -0
- package/dist/chunks/de-DJ5EkXQo.mjs.map +1 -0
- package/dist/chunks/{de-C--bRmjW.mjs → de-DRbhnS4T.mjs} +2 -2
- package/dist/chunks/{de-C--bRmjW.mjs.map → de-DRbhnS4T.mjs.map} +1 -1
- package/dist/chunks/{es-DFUVd7eO.mjs → es-BQ9dox_E.mjs} +2 -2
- package/dist/chunks/{es-DFUVd7eO.mjs.map → es-BQ9dox_E.mjs.map} +1 -1
- package/dist/chunks/es-CEAJj7aB.mjs +2 -0
- package/dist/chunks/es-CEAJj7aB.mjs.map +1 -0
- package/dist/chunks/fr-DhWQzZy3.mjs +2 -0
- package/dist/chunks/fr-DhWQzZy3.mjs.map +1 -0
- package/dist/chunks/{fr-BaXKyPmX.mjs → fr-NVOinLyF.mjs} +2 -2
- package/dist/chunks/{fr-BaXKyPmX.mjs.map → fr-NVOinLyF.mjs.map} +1 -1
- package/dist/chunks/full-DSWM4cKQ.mjs +2 -0
- package/dist/chunks/{full-BBl7mvwH.mjs.map → full-DSWM4cKQ.mjs.map} +1 -1
- package/dist/chunks/hi-BsZzSMfL.mjs +2 -0
- package/dist/chunks/hi-BsZzSMfL.mjs.map +1 -0
- package/dist/chunks/{hi-aH9HZG23.mjs → hi-DrC2H81d.mjs} +2 -2
- package/dist/chunks/{hi-aH9HZG23.mjs.map → hi-DrC2H81d.mjs.map} +1 -1
- package/dist/chunks/minimal-CFkkPXef.mjs +2 -0
- package/dist/chunks/{minimal-CtnR4dqp.mjs.map → minimal-CFkkPXef.mjs.map} +1 -1
- package/dist/chunks/pt-BuZ7acHF.mjs +2 -0
- package/dist/chunks/pt-BuZ7acHF.mjs.map +1 -0
- package/dist/chunks/{pt-Hy-0Xnnc.mjs → pt-CFrcl1v_.mjs} +2 -2
- package/dist/chunks/{pt-Hy-0Xnnc.mjs.map → pt-CFrcl1v_.mjs.map} +1 -1
- package/dist/chunks/rolldown-runtime-H_PjY6_i.mjs +1 -0
- package/dist/chunks/ru-CsP6mLxp.mjs +2 -0
- package/dist/chunks/ru-CsP6mLxp.mjs.map +1 -0
- package/dist/chunks/{ru-BFpEOrVp.mjs → ru-gxbzqLL8.mjs} +2 -2
- package/dist/chunks/{ru-BFpEOrVp.mjs.map → ru-gxbzqLL8.mjs.map} +1 -1
- package/dist/chunks/src-DiAOfuOT.mjs +2 -0
- package/dist/chunks/src-DiAOfuOT.mjs.map +1 -0
- package/dist/chunks/zh-BFZOM3lF.mjs +2 -0
- package/dist/chunks/{zh-BjoyjClN.mjs.map → zh-BFZOM3lF.mjs.map} +1 -1
- package/dist/chunks/zh-CiIyOm6U.mjs +2 -0
- package/dist/chunks/zh-CiIyOm6U.mjs.map +1 -0
- package/dist/commands/BlockInsertion.d.ts +5 -3
- package/dist/commands/BlockInsertion.d.ts.map +1 -1
- package/dist/commands/SelectionDeletion.d.ts +13 -2
- package/dist/commands/SelectionDeletion.d.ts.map +1 -1
- package/dist/editor/ContentSerializer.d.ts +21 -0
- package/dist/editor/ContentSerializer.d.ts.map +1 -1
- package/dist/editor/EditorConfig.d.ts +17 -0
- package/dist/editor/EditorConfig.d.ts.map +1 -1
- package/dist/editor/EditorConfigController.d.ts +10 -0
- package/dist/editor/EditorConfigController.d.ts.map +1 -1
- package/dist/editor/EditorInitializer.d.ts +4 -0
- package/dist/editor/EditorInitializer.d.ts.map +1 -1
- package/dist/editor/EditorLocale.d.ts +2 -0
- package/dist/editor/EditorLocale.d.ts.map +1 -1
- package/dist/editor/MarkdownMode.d.ts +46 -0
- package/dist/editor/MarkdownMode.d.ts.map +1 -0
- package/dist/editor/NotectlEditor.d.ts +24 -0
- package/dist/editor/NotectlEditor.d.ts.map +1 -1
- package/dist/editor/locales/ar.d.ts.map +1 -1
- package/dist/editor/locales/de.d.ts.map +1 -1
- package/dist/editor/locales/es.d.ts.map +1 -1
- package/dist/editor/locales/fr.d.ts.map +1 -1
- package/dist/editor/locales/hi.d.ts.map +1 -1
- package/dist/editor/locales/pt.d.ts.map +1 -1
- package/dist/editor/locales/ru.d.ts.map +1 -1
- package/dist/editor/locales/zh.d.ts.map +1 -1
- package/dist/editor/styles/list.d.ts +1 -1
- package/dist/editor/styles/list.d.ts.map +1 -1
- package/dist/editor/styles/table.d.ts +1 -1
- package/dist/editor/styles/table.d.ts.map +1 -1
- package/dist/full.mjs +1 -1
- package/dist/html.d.ts +1 -0
- package/dist/html.d.ts.map +1 -1
- package/dist/html.mjs +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/input/ClipboardHandler.d.ts +2 -0
- package/dist/input/ClipboardHandler.d.ts.map +1 -1
- package/dist/input/InputHandler.d.ts +7 -0
- package/dist/input/InputHandler.d.ts.map +1 -1
- package/dist/input/InputManager.d.ts +10 -0
- package/dist/input/InputManager.d.ts.map +1 -1
- package/dist/input/KeyboardHandler.d.ts.map +1 -1
- package/dist/input/MarkdownPasteDetector.d.ts +26 -0
- package/dist/input/MarkdownPasteDetector.d.ts.map +1 -0
- package/dist/input/PasteHTMLHandler.d.ts +18 -1
- package/dist/input/PasteHTMLHandler.d.ts.map +1 -1
- package/dist/input/PasteHandler.d.ts +30 -0
- package/dist/input/PasteHandler.d.ts.map +1 -1
- package/dist/input/PasteRichBlockHandler.d.ts.map +1 -1
- package/dist/input/SelectionDocument.d.ts +2 -1
- package/dist/input/SelectionDocument.d.ts.map +1 -1
- package/dist/markdown.d.ts +17 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.mjs +1 -0
- package/dist/model/AttrRegistry.d.ts +2 -2
- package/dist/model/AttrRegistry.d.ts.map +1 -1
- package/dist/model/ContentModel.d.ts +12 -0
- package/dist/model/ContentModel.d.ts.map +1 -1
- package/dist/model/Document.d.ts +28 -3
- package/dist/model/Document.d.ts.map +1 -1
- package/dist/model/HTMLUtils.d.ts +15 -0
- package/dist/model/HTMLUtils.d.ts.map +1 -1
- package/dist/model/InlineNodeSpec.d.ts +7 -1
- package/dist/model/InlineNodeSpec.d.ts.map +1 -1
- package/dist/model/InputRule.d.ts +11 -0
- package/dist/model/InputRule.d.ts.map +1 -1
- package/dist/model/MarkSpec.d.ts +7 -1
- package/dist/model/MarkSpec.d.ts.map +1 -1
- package/dist/model/MarkdownSyntaxRegistry.d.ts +51 -0
- package/dist/model/MarkdownSyntaxRegistry.d.ts.map +1 -0
- package/dist/model/NodeSpec.d.ts +47 -1
- package/dist/model/NodeSpec.d.ts.map +1 -1
- package/dist/model/RichBlockData.d.ts +2 -0
- package/dist/model/RichBlockData.d.ts.map +1 -1
- package/dist/model/SchemaRegistry.d.ts.map +1 -1
- package/dist/model/TableDimensions.d.ts +11 -0
- package/dist/model/TableDimensions.d.ts.map +1 -0
- package/dist/notectl-core.mjs +1 -1
- package/dist/notectl-core.umd.js +1 -1
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/platform/EditorEventBoundary.d.ts +12 -0
- package/dist/platform/EditorEventBoundary.d.ts.map +1 -0
- package/dist/plugins/Plugin.d.ts +7 -0
- package/dist/plugins/Plugin.d.ts.map +1 -1
- package/dist/plugins/PluginContextFactory.d.ts +2 -0
- package/dist/plugins/PluginContextFactory.d.ts.map +1 -1
- package/dist/plugins/PluginManager.d.ts +2 -0
- package/dist/plugins/PluginManager.d.ts.map +1 -1
- package/dist/plugins/alignment.mjs +1 -1
- package/dist/plugins/bidi-isolation.mjs +1 -1
- package/dist/plugins/blockquote/BlockquotePlugin.d.ts +2 -0
- package/dist/plugins/blockquote/BlockquotePlugin.d.ts.map +1 -1
- package/dist/plugins/blockquote.mjs +1 -1
- package/dist/plugins/caret-navigation.mjs +1 -1
- package/dist/plugins/code-block/CodeBlockTypes.d.ts +2 -0
- package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -1
- package/dist/plugins/code-block.mjs +1 -1
- package/dist/plugins/font-size/FontSizeOperations.d.ts.map +1 -1
- package/dist/plugins/font-size.mjs +1 -1
- package/dist/plugins/font.mjs +1 -1
- package/dist/plugins/formula/DisplayMathNodeSpec.d.ts.map +1 -1
- package/dist/plugins/formula/FormulaInputRules.d.ts.map +1 -1
- package/dist/plugins/formula/FormulaMarkdownSyntax.d.ts +4 -0
- package/dist/plugins/formula/FormulaMarkdownSyntax.d.ts.map +1 -0
- package/dist/plugins/formula/FormulaPlugin.d.ts.map +1 -1
- package/dist/plugins/formula/FormulaTypes.d.ts +2 -0
- package/dist/plugins/formula/FormulaTypes.d.ts.map +1 -1
- package/dist/plugins/formula/InlineMathNodeSpec.d.ts.map +1 -1
- package/dist/plugins/formula.mjs +1 -1
- package/dist/plugins/gap-cursor.mjs +1 -1
- package/dist/plugins/hard-break.mjs +1 -1
- package/dist/plugins/heading/HeadingPlugin.d.ts +2 -0
- package/dist/plugins/heading/HeadingPlugin.d.ts.map +1 -1
- package/dist/plugins/heading.mjs +1 -1
- package/dist/plugins/highlight.mjs +1 -1
- package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts +2 -0
- package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts.map +1 -1
- package/dist/plugins/horizontal-rule.mjs +1 -1
- package/dist/plugins/image/ImagePlugin.d.ts +14 -0
- package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
- package/dist/plugins/image.mjs +1 -1
- package/dist/plugins/inline-code/InlineCodePlugin.d.ts.map +1 -1
- package/dist/plugins/inline-code.mjs +1 -1
- package/dist/plugins/link/LinkPlugin.d.ts +14 -0
- package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
- package/dist/plugins/link.mjs +1 -1
- package/dist/plugins/list/ListCommands.d.ts +5 -1
- package/dist/plugins/list/ListCommands.d.ts.map +1 -1
- package/dist/plugins/list/ListInputRules.d.ts.map +1 -1
- package/dist/plugins/list/ListItemContext.d.ts +27 -0
- package/dist/plugins/list/ListItemContext.d.ts.map +1 -0
- package/dist/plugins/list/ListKeyboardHandlers.d.ts.map +1 -1
- package/dist/plugins/list/ListPlugin.d.ts +2 -0
- package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
- package/dist/plugins/list/ListToolbarItems.d.ts.map +1 -1
- package/dist/plugins/list.mjs +1 -1
- package/dist/plugins/print/PrintContentPreparer.d.ts.map +1 -1
- package/dist/plugins/print/PrintDestinationBridge.d.ts +23 -0
- package/dist/plugins/print/PrintDestinationBridge.d.ts.map +1 -0
- package/dist/plugins/print/PrintHostStyles.d.ts.map +1 -1
- package/dist/plugins/print/PrintServiceImpl.d.ts +5 -1
- package/dist/plugins/print/PrintServiceImpl.d.ts.map +1 -1
- package/dist/plugins/print/PrintStyleCollector.d.ts.map +1 -1
- package/dist/plugins/print.mjs +1 -1
- package/dist/plugins/shared/MarkInputRule.d.ts +9 -0
- package/dist/plugins/shared/MarkInputRule.d.ts.map +1 -0
- package/dist/plugins/shared/PopupPositioning.d.ts +2 -0
- package/dist/plugins/shared/PopupPositioning.d.ts.map +1 -1
- package/dist/plugins/shared/index.d.ts +1 -0
- package/dist/plugins/shared/index.d.ts.map +1 -1
- package/dist/plugins/shared.mjs +1 -1
- package/dist/plugins/smart-paste.mjs +1 -1
- package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts +2 -0
- package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts.map +1 -1
- package/dist/plugins/strikethrough.mjs +1 -1
- package/dist/plugins/super-sub.mjs +1 -1
- package/dist/plugins/table/TableClipboard.d.ts +8 -0
- package/dist/plugins/table/TableClipboard.d.ts.map +1 -0
- package/dist/plugins/table/TableCommands.d.ts.map +1 -1
- package/dist/plugins/table/TableContextMenu.d.ts +11 -1
- package/dist/plugins/table/TableContextMenu.d.ts.map +1 -1
- package/dist/plugins/table/TableControls.d.ts +6 -1
- package/dist/plugins/table/TableControls.d.ts.map +1 -1
- package/dist/plugins/table/TableControlsDOM.d.ts +11 -2
- package/dist/plugins/table/TableControlsDOM.d.ts.map +1 -1
- package/dist/plugins/table/TableControlsLayout.d.ts +12 -3
- package/dist/plugins/table/TableControlsLayout.d.ts.map +1 -1
- package/dist/plugins/table/TableGrid.d.ts +57 -0
- package/dist/plugins/table/TableGrid.d.ts.map +1 -0
- package/dist/plugins/table/TableHelpers.d.ts +4 -0
- package/dist/plugins/table/TableHelpers.d.ts.map +1 -1
- package/dist/plugins/table/TableLocale.d.ts +30 -0
- package/dist/plugins/table/TableLocale.d.ts.map +1 -1
- package/dist/plugins/table/TableNavigation.d.ts +5 -1
- package/dist/plugins/table/TableNavigation.d.ts.map +1 -1
- package/dist/plugins/table/TableNodeViews.d.ts +13 -1
- package/dist/plugins/table/TableNodeViews.d.ts.map +1 -1
- package/dist/plugins/table/TablePlugin.d.ts +21 -1
- package/dist/plugins/table/TablePlugin.d.ts.map +1 -1
- package/dist/plugins/table/TableSelection.d.ts.map +1 -1
- package/dist/plugins/table/TableSizeEditor.d.ts +11 -0
- package/dist/plugins/table/TableSizeEditor.d.ts.map +1 -0
- package/dist/plugins/table/TableSizing.d.ts +70 -0
- package/dist/plugins/table/TableSizing.d.ts.map +1 -0
- package/dist/plugins/table/index.d.ts +3 -1
- package/dist/plugins/table/index.d.ts.map +1 -1
- package/dist/plugins/table/locales/ar.d.ts.map +1 -1
- package/dist/plugins/table/locales/de.d.ts.map +1 -1
- package/dist/plugins/table/locales/es.d.ts.map +1 -1
- package/dist/plugins/table/locales/fr.d.ts.map +1 -1
- package/dist/plugins/table/locales/hi.d.ts.map +1 -1
- package/dist/plugins/table/locales/pt.d.ts.map +1 -1
- package/dist/plugins/table/locales/ru.d.ts.map +1 -1
- package/dist/plugins/table/locales/zh.d.ts.map +1 -1
- package/dist/plugins/table.mjs +1 -1
- package/dist/plugins/text-color.mjs +1 -1
- package/dist/plugins/text-direction-auto.mjs +1 -1
- package/dist/plugins/text-direction.mjs +1 -1
- package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts +9 -0
- package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts.map +1 -1
- package/dist/plugins/text-formatting.mjs +1 -1
- package/dist/plugins/toolbar.mjs +1 -1
- package/dist/plugins/video/VideoCommands.d.ts.map +1 -1
- package/dist/plugins/video.mjs +1 -1
- package/dist/presets/full.mjs +1 -1
- package/dist/presets/minimal.mjs +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/serialization/DocumentParser.d.ts.map +1 -1
- package/dist/serialization/DocumentSerializer.d.ts +2 -0
- package/dist/serialization/DocumentSerializer.d.ts.map +1 -1
- package/dist/serialization/HTMLSanitization.d.ts +15 -0
- package/dist/serialization/HTMLSanitization.d.ts.map +1 -0
- package/dist/serialization/MarkSerializer.d.ts +12 -0
- package/dist/serialization/MarkSerializer.d.ts.map +1 -1
- package/dist/serialization/MarkdownParser.d.ts +6 -0
- package/dist/serialization/MarkdownParser.d.ts.map +1 -0
- package/dist/serialization/MarkdownSerializer.d.ts +12 -0
- package/dist/serialization/MarkdownSerializer.d.ts.map +1 -0
- package/dist/serialization/MarkdownTypes.d.ts +59 -0
- package/dist/serialization/MarkdownTypes.d.ts.map +1 -0
- package/dist/serialization/TableDimensions.d.ts +37 -0
- package/dist/serialization/TableDimensions.d.ts.map +1 -0
- package/dist/serialization/markdown/BlockSerializers.d.ts +7 -0
- package/dist/serialization/markdown/BlockSerializers.d.ts.map +1 -0
- package/dist/serialization/markdown/BlockTokenizer.d.ts +54 -0
- package/dist/serialization/markdown/BlockTokenizer.d.ts.map +1 -0
- package/dist/serialization/markdown/GfmAutolink.d.ts +20 -0
- package/dist/serialization/markdown/GfmAutolink.d.ts.map +1 -0
- package/dist/serialization/markdown/GfmTableParser.d.ts +26 -0
- package/dist/serialization/markdown/GfmTableParser.d.ts.map +1 -0
- package/dist/serialization/markdown/InlineAst.d.ts +34 -0
- package/dist/serialization/markdown/InlineAst.d.ts.map +1 -0
- package/dist/serialization/markdown/InlineSerializers.d.ts +5 -0
- package/dist/serialization/markdown/InlineSerializers.d.ts.map +1 -0
- package/dist/serialization/markdown/InlineTokenizer.d.ts +5 -0
- package/dist/serialization/markdown/InlineTokenizer.d.ts.map +1 -0
- package/dist/serialization/markdown/LinkReferenceExtractor.d.ts +37 -0
- package/dist/serialization/markdown/LinkReferenceExtractor.d.ts.map +1 -0
- package/dist/serialization/markdown/MarkdownContext.d.ts +32 -0
- package/dist/serialization/markdown/MarkdownContext.d.ts.map +1 -0
- package/dist/serialization/markdown/MarkdownEntities.d.ts +33 -0
- package/dist/serialization/markdown/MarkdownEntities.d.ts.map +1 -0
- package/dist/serialization/markdown/MarkdownEscape.d.ts +33 -0
- package/dist/serialization/markdown/MarkdownEscape.d.ts.map +1 -0
- package/dist/serialization/markdown/MarkdownHTMLRegistry.d.ts +4 -0
- package/dist/serialization/markdown/MarkdownHTMLRegistry.d.ts.map +1 -0
- package/dist/serialization/markdown/MarkdownParseContext.d.ts +23 -0
- package/dist/serialization/markdown/MarkdownParseContext.d.ts.map +1 -0
- package/dist/state/Mapping.d.ts +33 -10
- package/dist/state/Mapping.d.ts.map +1 -1
- package/dist/state/StepApplication.d.ts +3 -1
- package/dist/state/StepApplication.d.ts.map +1 -1
- package/dist/state/StepHandlers.d.ts.map +1 -1
- package/dist/state/StepInversion.d.ts +2 -1
- package/dist/state/StepInversion.d.ts.map +1 -1
- package/dist/state/StepMapping.d.ts +3 -2
- package/dist/state/StepMapping.d.ts.map +1 -1
- package/dist/state/StepMaps.d.ts +3 -2
- package/dist/state/StepMaps.d.ts.map +1 -1
- package/dist/state/Steps.d.ts +34 -2
- package/dist/state/Steps.d.ts.map +1 -1
- package/dist/state/TransactionBuilder.d.ts +7 -1
- package/dist/state/TransactionBuilder.d.ts.map +1 -1
- package/dist/test/MarkdownConformanceUtils.d.ts +12 -0
- package/dist/test/MarkdownConformanceUtils.d.ts.map +1 -0
- package/dist/view/BlockRendering.d.ts +5 -0
- package/dist/view/BlockRendering.d.ts.map +1 -1
- package/dist/view/DecorationRendering.d.ts +6 -0
- package/dist/view/DecorationRendering.d.ts.map +1 -1
- package/dist/view/EditorViewEvents.d.ts.map +1 -1
- package/dist/view/Reconciler.d.ts.map +1 -1
- package/package.json +14 -1
- package/dist/chunks/AttrRegistry-DcDVyzLm.mjs.map +0 -1
- package/dist/chunks/BlockInsertion-6rR9tIGP.mjs +0 -2
- package/dist/chunks/BlockInsertion-6rR9tIGP.mjs.map +0 -1
- package/dist/chunks/BlockquotePlugin-4V7KV_Sb.mjs +0 -2
- package/dist/chunks/CodeBlockPlugin-3V2K3RBe.mjs +0 -2
- package/dist/chunks/CodeBlockPlugin-3V2K3RBe.mjs.map +0 -1
- package/dist/chunks/ColorPickerPopup-lcf3jS6G.mjs +0 -2
- package/dist/chunks/Commands-BIIpx_Zd.mjs +0 -2
- package/dist/chunks/Commands-BIIpx_Zd.mjs.map +0 -1
- package/dist/chunks/Decoration-ZeyVfwJB.mjs +0 -2
- package/dist/chunks/Decoration-ZeyVfwJB.mjs.map +0 -1
- package/dist/chunks/Document-r7vLOAGA.mjs +0 -2
- package/dist/chunks/Document-r7vLOAGA.mjs.map +0 -1
- package/dist/chunks/DocumentParser-CcTSeT1B.mjs +0 -2
- package/dist/chunks/DocumentParser-CcTSeT1B.mjs.map +0 -1
- package/dist/chunks/FontSizePlugin-9StCjEfN.mjs.map +0 -1
- package/dist/chunks/FormulaPlugin-CV5VUxkb.mjs +0 -2
- package/dist/chunks/FormulaPlugin-CV5VUxkb.mjs.map +0 -1
- package/dist/chunks/GapCursorNavigation-ycNzuQVH.mjs +0 -2
- package/dist/chunks/HTMLUtils-C6B4UT00.mjs +0 -2
- package/dist/chunks/HTMLUtils-C6B4UT00.mjs.map +0 -1
- package/dist/chunks/HeadingPlugin-BuGoM9Rz.mjs +0 -2
- package/dist/chunks/HorizontalRulePlugin-0FjHPZuA.mjs +0 -2
- package/dist/chunks/HorizontalRulePlugin-0FjHPZuA.mjs.map +0 -1
- package/dist/chunks/ImagePlugin-KpkuE2LH.mjs +0 -2
- package/dist/chunks/InlineCodePlugin-DMr4O7c7.mjs.map +0 -1
- package/dist/chunks/InlineStyleMarkSpec-C6LJT7kp.mjs +0 -2
- package/dist/chunks/LinkPlugin-DvZ3MPgL.mjs +0 -2
- package/dist/chunks/LinkPlugin-DvZ3MPgL.mjs.map +0 -1
- package/dist/chunks/ListPlugin-2yl6KiTK.mjs +0 -2
- package/dist/chunks/ListPlugin-2yl6KiTK.mjs.map +0 -1
- package/dist/chunks/NodeSelectionCommands-Dj4VxLdD.mjs +0 -2
- package/dist/chunks/PluginHelpers-KDuTlmXm.mjs +0 -2
- package/dist/chunks/PopupPositioning-BB97-__N.mjs +0 -2
- package/dist/chunks/PrintPlugin-DyIZDY3Q.mjs +0 -2
- package/dist/chunks/PrintPlugin-DyIZDY3Q.mjs.map +0 -1
- package/dist/chunks/StrikethroughPlugin-BLKDRWtf.mjs +0 -2
- package/dist/chunks/StrikethroughPlugin-BLKDRWtf.mjs.map +0 -1
- package/dist/chunks/StyleRuntime-BFKu52mS.mjs +0 -2
- package/dist/chunks/StyleRuntime-BFKu52mS.mjs.map +0 -1
- package/dist/chunks/TablePlugin-BTH9VRZq.mjs +0 -2
- package/dist/chunks/TablePlugin-BTH9VRZq.mjs.map +0 -1
- package/dist/chunks/TextColorPlugin-CEfZQ6Md.mjs +0 -2
- package/dist/chunks/TextDirectionAutoPlugin-CzWJjrvG.mjs +0 -2
- package/dist/chunks/TextDirectionService-OFOU6r_s.mjs +0 -2
- package/dist/chunks/TextFormattingPlugin-Cubp3e7f.mjs +0 -2
- package/dist/chunks/TextFormattingPlugin-Cubp3e7f.mjs.map +0 -1
- package/dist/chunks/VideoPlugin-B3uf1Dwp.mjs +0 -2
- package/dist/chunks/VideoPlugin-B3uf1Dwp.mjs.map +0 -1
- package/dist/chunks/WordBoundary-DxeMBRyP.mjs +0 -2
- package/dist/chunks/ar-BTShmP2E.mjs +0 -2
- package/dist/chunks/ar-jbplYWkC.mjs +0 -2
- package/dist/chunks/ar-jbplYWkC.mjs.map +0 -1
- package/dist/chunks/de-DN-e6G5A.mjs +0 -2
- package/dist/chunks/de-DN-e6G5A.mjs.map +0 -1
- package/dist/chunks/es-CM55WeEN.mjs +0 -2
- package/dist/chunks/es-CM55WeEN.mjs.map +0 -1
- package/dist/chunks/fr-C_2i5Ono.mjs +0 -2
- package/dist/chunks/fr-C_2i5Ono.mjs.map +0 -1
- package/dist/chunks/full-BBl7mvwH.mjs +0 -2
- package/dist/chunks/hi-C9fvG91d.mjs +0 -2
- package/dist/chunks/hi-C9fvG91d.mjs.map +0 -1
- package/dist/chunks/minimal-CtnR4dqp.mjs +0 -2
- package/dist/chunks/pt-GqLw5tN0.mjs +0 -2
- package/dist/chunks/pt-GqLw5tN0.mjs.map +0 -1
- package/dist/chunks/ru-4g_qsaLr.mjs +0 -2
- package/dist/chunks/ru-4g_qsaLr.mjs.map +0 -1
- package/dist/chunks/src-C89Cw7ni.mjs +0 -2
- package/dist/chunks/src-C89Cw7ni.mjs.map +0 -1
- package/dist/chunks/zh-BjoyjClN.mjs +0 -2
- package/dist/chunks/zh-DeZP08HI.mjs +0 -2
- package/dist/chunks/zh-DeZP08HI.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../src/state/Steps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../src/state/Steps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,UAAU,EACV,SAAS,EACT,cAAc,EACd,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEpE,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IAC9C,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CACnC;AAED,MAAM,WA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AAwB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAInE;AAED,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAK1D;AAED,gFAAgF;AAChF,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,YAAY,GAChB,oBAAoB,GAAG,IAAI,CAwB7B;AAOD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAEhE"}
|
|
@@ -33,7 +33,7 @@ export declare class TransactionBuilder {
|
|
|
33
33
|
* identity should prefer {@link mergeBlocksAt}, which derives both from the
|
|
34
34
|
* working document.
|
|
35
35
|
*/
|
|
36
|
-
mergeBlocks(targetBlockId: BlockId, sourceBlockId: BlockId, targetLengthBefore: number, sourceType?: NodeTypeName, sourceAttrs?: BlockAttrs): this;
|
|
36
|
+
mergeBlocks(targetBlockId: BlockId, sourceBlockId: BlockId, targetLengthBefore: number, sourceType?: NodeTypeName, sourceAttrs?: BlockAttrs, sourceHTMLId?: string): this;
|
|
37
37
|
/**
|
|
38
38
|
* Merges two blocks, auto-deriving targetLengthBefore and the source
|
|
39
39
|
* block's identity (type + attrs) from the working document. Requires a
|
|
@@ -68,6 +68,12 @@ export declare class TransactionBuilder {
|
|
|
68
68
|
insertNode(parentPath: readonly BlockId[], index: number, node: BlockNode): this;
|
|
69
69
|
/** Removes a node at the given index from the parent at the given path. */
|
|
70
70
|
removeNode(parentPath: readonly BlockId[], index: number): this;
|
|
71
|
+
/**
|
|
72
|
+
* Moves an existing block subtree without changing its identity. Source and
|
|
73
|
+
* destination coordinates are resolved against the current working document;
|
|
74
|
+
* `toIndex` is an insertion slot before the source is removed.
|
|
75
|
+
*/
|
|
76
|
+
moveNode(fromParentPath: readonly BlockId[], fromIndex: number, toParentPath: readonly BlockId[], toIndex: number): this;
|
|
71
77
|
/** Sets attributes on a node at the given path. */
|
|
72
78
|
setNodeAttr(path: readonly BlockId[], attrs: BlockAttrs): this;
|
|
73
79
|
/** Inserts an InlineNode at the given offset within a block. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionBuilder.d.ts","sourceRoot":"","sources":["../../src/state/TransactionBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,UAAU,EACV,SAAS,EACT,cAAc,EACd,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,MAAM,sBAAsB,CAAC;AAY9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"TransactionBuilder.d.ts","sourceRoot":"","sources":["../../src/state/TransactionBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,UAAU,EACV,SAAS,EACT,cAAc,EACd,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,MAAM,sBAAsB,CAAC;AAY9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAKpE,OAAO,KAAK,EAgBX,iBAAiB,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,4CAA4C;AAC5C,qBAAa,kBAAkB;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiB;IAC1C,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,WAAW,CAAyB;IAC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AO,CAAC,CAAC,GACxD,IAAI;IAuBP,0DAA0D;IAC1D,eAAe,IAAI,IAAI;IAKvB,kDAAkD;IAClD,YAAY,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI;IAK9C,oDAAoD;IACpD,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI;IAKjE,iDAAiD;IACjD,cAAc,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,IAAI,EAAE,aAAa,EAAE,SAAS,IAAI,EAAE,GAAG,IAAI,GAAG,IAAI;IAM1F,oCAAoC;IACpC,KAAK,IAAI,WAAW;IAgBpB,+DAA+D;IAC/D,OAAO,CAAC,UAAU;IASlB,4DAA4D;IAC5D,OAAO,CAAC,YAAY;IAQpB;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IAKnB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,UAAU;CAOlB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Document } from '../model/Document.js';
|
|
2
|
+
/** Renders a parsed Document to the normalized structural comparison string. */
|
|
3
|
+
export declare function documentStructure(doc: Document): string;
|
|
4
|
+
/** Result of converting expected spec HTML: a structure, or why it cannot be one. */
|
|
5
|
+
export type SpecHtmlResult = {
|
|
6
|
+
readonly structure: string;
|
|
7
|
+
} | {
|
|
8
|
+
readonly unsupported: string;
|
|
9
|
+
};
|
|
10
|
+
/** Converts a spec example's expected HTML into the structural string. */
|
|
11
|
+
export declare function specHtmlToStructure(html: string): SpecHtmlResult;
|
|
12
|
+
//# sourceMappingURL=MarkdownConformanceUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownConformanceUtils.d.ts","sourceRoot":"","sources":["../../src/test/MarkdownConformanceUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAa,QAAQ,EAAwB,MAAM,sBAAsB,CAAC;AAKtF,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,CAEvD;AAkED,qFAAqF;AACrF,MAAM,MAAM,cAAc,GAAG;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAe/F,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAahE"}
|
|
@@ -5,6 +5,11 @@ import { NodeView } from './NodeView.js';
|
|
|
5
5
|
import { ReconcileOptions } from './Reconciler.js';
|
|
6
6
|
/** Renders a block node to a DOM element, using registry specs or NodeViews. */
|
|
7
7
|
export declare function renderBlock(block: BlockNode, registry?: SchemaRegistry, nodeViews?: Map<string, NodeView>, options?: ReconcileOptions): HTMLElement;
|
|
8
|
+
/**
|
|
9
|
+
* Synchronizes the semantic HTML ID owned by a block without disturbing an
|
|
10
|
+
* unrelated ID a third-party NodeView may put on a freshly created element.
|
|
11
|
+
*/
|
|
12
|
+
export declare function syncBlockHTMLId(el: HTMLElement, block: BlockNode, previousBlock?: BlockNode): void;
|
|
8
13
|
/** Renders block content (inline children) into a container element. */
|
|
9
14
|
export declare function renderBlockContent(container: HTMLElement, block: BlockNode, registry?: SchemaRegistry, inlineDecos?: readonly InlineDecoration[]): void;
|
|
10
15
|
//# sourceMappingURL=BlockRendering.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockRendering.d.ts","sourceRoot":"","sources":["../../src/view/BlockRendering.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"BlockRendering.d.ts","sourceRoot":"","sources":["../../src/view/BlockRendering.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,sBAAsB,CAAC;AAShE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAMjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,gFAAgF;AAChF,wBAAgB,WAAW,CAC1B,KAAK,EAAE,SAAS,EAChB,QAAQ,CAAC,EAAE,cAAc,EACzB,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EACjC,OAAO,CAAC,EAAE,gBAAgB,GACxB,WAAW,CA+Fb;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC9B,EAAE,EAAE,WAAW,EACf,KAAK,EAAE,SAAS,EAChB,aAAa,CAAC,EAAE,SAAS,GACvB,IAAI,CAWN;AAED,wEAAwE;AACxE,wBAAgB,kBAAkB,CACjC,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,SAAS,EAChB,QAAQ,CAAC,EAAE,cAAc,EACzB,WAAW,CAAC,EAAE,SAAS,gBAAgB,EAAE,GACvC,IAAI,CAyCN"}
|
|
@@ -14,4 +14,10 @@ import { ReconcileOptions } from './Reconciler.js';
|
|
|
14
14
|
export declare function renderDecoratedContent(container: HTMLElement, inlineChildren: readonly (TextNode | InlineNode)[], inlineDecos: readonly InlineDecoration[], registry?: SchemaRegistry): void;
|
|
15
15
|
/** Applies node decorations (CSS classes/styles) to a block element. */
|
|
16
16
|
export declare function applyNodeDecorations(el: HTMLElement, bid: BlockId, options?: ReconcileOptions): void;
|
|
17
|
+
/**
|
|
18
|
+
* Synchronizes class-based node decorations without replacing a NodeView.
|
|
19
|
+
* Decoration-owned classes are removed when their decoration disappears,
|
|
20
|
+
* while classes that existed before decoration application are preserved.
|
|
21
|
+
*/
|
|
22
|
+
export declare function syncNodeDecorationClasses(el: HTMLElement, bid: BlockId, options?: ReconcileOptions): void;
|
|
17
23
|
//# sourceMappingURL=DecorationRendering.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecorationRendering.d.ts","sourceRoot":"","sources":["../../src/view/DecorationRendering.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAmB,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAItD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"DecorationRendering.d.ts","sourceRoot":"","sources":["../../src/view/DecorationRendering.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAmB,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAItD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAUxD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACrC,SAAS,EAAE,WAAW,EACtB,cAAc,EAAE,SAAS,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE,EAClD,WAAW,EAAE,SAAS,gBAAgB,EAAE,EACxC,QAAQ,CAAC,EAAE,cAAc,GACvB,IAAI,CAqEN;AA4BD,wEAAwE;AACxE,wBAAgB,oBAAoB,CACnC,EAAE,EAAE,WAAW,EACf,GAAG,EAAE,OAAO,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACxB,IAAI,CAUN;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACxC,EAAE,EAAE,WAAW,EACf,GAAG,EAAE,OAAO,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACxB,IAAI,CAyBN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorViewEvents.d.ts","sourceRoot":"","sources":["../../src/view/EditorViewEvents.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"EditorViewEvents.d.ts","sourceRoot":"","sources":["../../src/view/EditorViewEvents.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAe3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKxD,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,WAAW,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,WAAW,EAAE,CACrB,QAAQ,EAAE,WAAW,EACrB,EAAE,EAAE,WAAW,EACf,iBAAiB,CAAC,EAAE,OAAO,KACvB,IAAI,CAAC;IACV,QAAQ,CAAC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C,EAAE,gBAAgB,GACxB,IAAI,CAkJN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@notectl/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "A modern and accessible rich text editor shipped as a single Web Component. Immutable state, transaction-based architecture, and a plugin system that powers every feature.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
"types": "./dist/html.d.ts",
|
|
23
23
|
"import": "./dist/html.mjs"
|
|
24
24
|
},
|
|
25
|
+
"./markdown": {
|
|
26
|
+
"types": "./dist/markdown.d.ts",
|
|
27
|
+
"import": "./dist/markdown.mjs"
|
|
28
|
+
},
|
|
25
29
|
"./presets": {
|
|
26
30
|
"types": "./dist/presets.d.ts",
|
|
27
31
|
"import": "./dist/presets.mjs"
|
|
@@ -198,6 +202,7 @@
|
|
|
198
202
|
"name": "Core (main entry)",
|
|
199
203
|
"path": "dist/notectl-core.mjs",
|
|
200
204
|
"limit": "76 KB",
|
|
205
|
+
"ignore": ["dompurify", "./MarkdownSerializer-*", "./MarkdownParser-*"],
|
|
201
206
|
"gzip": true
|
|
202
207
|
},
|
|
203
208
|
{
|
|
@@ -216,6 +221,14 @@
|
|
|
216
221
|
"name": "HTML (serializer/parser)",
|
|
217
222
|
"path": "dist/html.mjs",
|
|
218
223
|
"limit": "15 KB",
|
|
224
|
+
"ignore": ["dompurify"],
|
|
225
|
+
"gzip": true
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"name": "Markdown (serializer/parser)",
|
|
229
|
+
"path": "dist/markdown.mjs",
|
|
230
|
+
"limit": "18 KB",
|
|
231
|
+
"ignore": ["dompurify"],
|
|
219
232
|
"gzip": true
|
|
220
233
|
},
|
|
221
234
|
{
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AttrRegistry-DcDVyzLm.mjs","names":[],"sources":["../../src/model/AttrRegistry.ts"],"sourcesContent":["/**\n * Module-augmentable attribute registries for type-safe node/mark attributes.\n *\n * Plugins extend these interfaces via `declare module`:\n * @example\n * declare module '../../model/AttrRegistry.js' {\n * interface NodeAttrRegistry {\n * heading: { level: HeadingLevel; align?: BlockAlignment };\n * }\n * }\n */\n\nimport type { BlockAlignment } from './BlockAlignment.js';\nimport type { BlockNode, InlineNode, Mark } from './Document.js';\nimport { isInlineNode } from './Document.js';\n\n/** Plugins augment this interface to register typed node attributes. */\nexport interface NodeAttrRegistry {\n\tparagraph: { align?: BlockAlignment };\n}\n\n/** Plugins augment this interface to register typed mark attributes. */\nexport interface MarkAttrRegistry {\n\tbold: Record<string, never>;\n\titalic: Record<string, never>;\n\tunderline: Record<string, never>;\n}\n\n/** Resolves typed attributes for known node types, falls back for unknown. */\nexport type NodeAttrsFor<T extends string> = T extends keyof NodeAttrRegistry\n\t? NodeAttrRegistry[T]\n\t: Record<string, string | number | boolean>;\n\n/** Resolves typed attributes for known mark types, falls back for unknown. */\nexport type MarkAttrsFor<T extends string> = T extends keyof MarkAttrRegistry\n\t? MarkAttrRegistry[T]\n\t: Record<string, string | number | boolean>;\n\n/** Narrows a BlockNode to a typed variant with known attributes. */\nexport function isNodeOfType<T extends keyof NodeAttrRegistry>(\n\tnode: BlockNode,\n\ttype: T,\n): node is BlockNode & { readonly type: T; readonly attrs: NodeAttrRegistry[T] } {\n\treturn (node.type as string) === type;\n}\n\n/** Narrows a Mark to a typed variant with known attributes. */\nexport function isMarkOfType<T extends keyof MarkAttrRegistry>(\n\tmark: Mark,\n\ttype: T,\n): mark is Mark & { readonly type: T; readonly attrs: MarkAttrRegistry[T] } {\n\treturn (mark.type as string) === type;\n}\n\n// --- InlineNode Attribute Registry ---\n\n/** Plugins augment this interface to register typed inline node attributes. */\n// biome-ignore lint/suspicious/noEmptyInterface: module augmentation requires interface\nexport interface InlineNodeAttrRegistry {}\n\n/** Resolves typed attributes for known inline node types, falls back for unknown. */\nexport type InlineNodeAttrsFor<T extends string> = T extends keyof InlineNodeAttrRegistry\n\t? InlineNodeAttrRegistry[T]\n\t: Record<string, string | number | boolean>;\n\n/** Narrows an InlineNode to a typed variant with known attributes. */\nexport function isInlineNodeOfType<T extends keyof InlineNodeAttrRegistry>(\n\tnode: InlineNode,\n\tinlineNodeType: T,\n): node is InlineNode & {\n\treadonly inlineType: T;\n\treadonly attrs: InlineNodeAttrRegistry[T];\n} {\n\treturn isInlineNode(node) && (node.inlineType as string) === inlineNodeType;\n}\n"],"mappings":"4CAuCA,SAAgB,EACf,EACA,GAEA,OAAQ,EAAK,OAAoB,CAClC,CAGA,SAAgB,EACf,EACA,GAEA,OAAQ,EAAK,OAAoB,CAClC,CAcA,SAAgB,EACf,EACA,GAKA,OAAO,EAAa,IAAU,EAAK,aAA0B,CAC9D"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{A as n,S as t,h as e,i as r,j as o,p as s,s as c,u as i,w as f,x as u}from"./Document-r7vLOAGA.mjs";import{c as a,d,l,o as p,r as h,t as m}from"./Selection-HYoVFpAx.mjs";import{a as g,r as y}from"./TypeBrands-Ch9856Gb.mjs";import{r as I}from"./NodeResolver-ChgLF_IP.mjs";import{i as x}from"./NavigationQueries-Bt4zZ17v.mjs";function k(n,t,e){const r=n.getNodeSpec(t);if(!r?.content)return!0;const o=n.getNodeSpec(e)?.group;for(const s of r.content.allow){if(s===e)return!0;if("text"!==s&&o&&s===o)return!0}return!1}function N(n,t,e){const r=n.getNodeSpec(t);if(!r?.content)return!0;const{min:o=0,max:s=Number.POSITIVE_INFINITY}=r.content,c=e.filter(n=>"text"!==n);if(c.length<o||c.length>s)return!1;for(const i of c)if(!k(n,t,i))return!1;return!0}function b(n,t){if(0===t.length)return n.doc.children;const e=n.getBlock(t[t.length-1]);return e?e.children:[]}function v(n,t){if(p(n))return{blockId:n.anchor.blockId,offset:n.anchor.offset};const e=d(n,t);return{blockId:e.from.blockId,offset:e.from.offset}}function P(n){return n&&n.length>1?n.slice(0,-1):[]}function S(n,e){return n.findIndex(n=>t(n)&&n.id===e)}function B(n,t){const e=P(I(n.doc,t)),r=b(n,e);return{parentPath:e,siblings:r,index:S(r,t)}}function T(n){if(f(n))return n.id;for(const e of n.children)if(t(e))return T(e);return n.id}function j(n){if(f(n))return n.id;for(let e=n.children.length-1;e>=0;e--){const r=n.children[e];if(r&&t(r))return j(r)}return n.id}function E(n,t,e){const r=n.getBlock(t);if(!r)return null;if(x(n,t)){const e=n.getNodePath(t);return e?h(t,e):null}const o="start"===e?T(r):j(r),c=n.getBlock(o);return c?m(o,"start"===e?0:s(c)):null}function A(n,e,r){const o=n.doc.children,s="start"===e?o.map((n,t)=>t):o.map((n,t)=>o.length-1-t);for(const c of s){const s=o[c];if(!s||!t(s))continue;if(void 0!==r&&s.id===r)continue;const i=E(n,s.id,e);if(i)return i}return null}function _(n,t,e){const r=P(I(n.doc,t)),o=S(b(n,r),t);if(!(o<0))return{parentPath:r,anchorIndex:o,isAnchorEmpty:J(n,t,e)}}function w(n,e,r,o){const s=I(n.doc,r);if(!s)return;const c=n.getBlock(r);return c?{parentPath:s,anchorIndex:c.children.findIndex(n=>t(n)&&n.id===e),isAnchorEmpty:J(n,e,o)}:void 0}function D(n,t){if("table_cell"===n.getBlock(t)?.type)return t;const e=I(n.doc,t);if(e)for(const r of e)if("table_cell"===n.getBlock(r)?.type)return r}function O(n){return l(n)?n.nodeId:a(n)?n.blockId:n.anchor.blockId}function V(n,t,e,r,o,s){const c=D(n,e);if(c){const o=w(n,e,c,s);if(!o)return!1;const i=o.anchorIndex+1;t.insertNode(o.parentPath,i,r),o.isAnchorEmpty&&o.anchorIndex>=0&&t.removeNode(o.parentPath,o.anchorIndex)}else{const c=_(n,e,s);if(!c)return!1;const i=a(o)&&"before"===o.side?0:1;t.insertNode(c.parentPath,c.anchorIndex+i,r),c.isAnchorEmpty&&!a(o)&&t.removeNode(c.parentPath,c.anchorIndex)}return!0}function C(n,t){const e=I(n.doc,t),r=e&&e.length>0?e[0]:t;return n.doc.children.findIndex(n=>n.id===r)}function F(n,t,e){return!t||e.every(e=>k(n,t,e.type))}function Q(n,t){const e=C(n,t);if(-1!==e)return{parentPath:[],anchorIndex:e,isAnchorEmpty:!1}}function R(n){return"paragraph"===n.type&&0===s(n)}function Y(n,t,e,r){return q(n,t,e,[r])}function q(n,t,e,o){if(0===o.length)return;const s=C(n,e);if(-1===s)return;const c=n.doc.children[s],i=n.doc.children[s+1];let f=s+1;for(const r of o)t.insertNode([],f,r),f++;const u=c&&x(n,c.id)&&i&&R(i)?i:void 0;let a;return u?a=u:(a=r(g("paragraph")),t.insertNode([],f,a)),c&&R(c)&&t.removeNode([],s),a}function z(n,e){const o=n.children.map(n=>t(n)?z(n,i()):n);return r(n.type,o,e,n.attrs)}function G(n,e){if(n.id===e)return n;for(const r of n.children){if(!t(r))continue;const n=G(r,e);if(n)return n}}function H(n,t){if(!t)return;const e={};let r=!1;for(const o of Object.keys(t)){const s=t[o],c=n?.[o];"string"==typeof c||"number"==typeof c||"boolean"==typeof c?e[o]=c:void 0!==s.default&&(e[o]=s.default),o in e&&(r=!0)}return r?e:void 0}function J(n,t,r){const o=n.getBlock(t);return!!o&&!(r?.getNodeSpec(o.type))?.isVoid&&""===e(o)}function K(n,t){if(!n.type)return;if(!t)return n;const e=t.getNodeSpec(n.type);if(!e)return;const r=H(n.attrs,e.attrs),o=n.segments?function(n,t){const e=[];for(const r of n){if("inline"===r.kind){const n=t.getInlineNodeSpec(r.inlineType);if(!n)continue;const o=H(r.attrs,n.attrs);e.push({kind:"inline",inlineType:r.inlineType,...o?{attrs:o}:{}});continue}e.push(r)}return e}(n.segments,t):void 0;return{...n,...r?{attrs:r}:{},...o?{segments:o}:n.segments?{segments:[]}:{}}}function L(t){const e=i(),o=function(t){const e=W(t);return 0===e.length?void 0:n(e)}(t),s=t.attrs?t.attrs:void 0;return r(g(t.type),o,e,s)}function M(n,t){const e=[];for(const r of n){const n=K(r,t);n&&e.push(U(n))}return{blocks:e}}function U(n){const t=n.attrs?n.attrs:void 0;return{type:g(n.type),...t?{attrs:t}:{},segments:W(n)}}function W(n){if(n.segments&&n.segments.length>0)return function(n){const t=[];for(const e of n){if("inline"===e.kind){t.push(u(c(y(e.inlineType),e.attrs)));continue}if(0===e.text.length)continue;const n=e.marks.map(n=>({type:n.type,...n.attrs?{attrs:n.attrs}:{}}));t.push(o(e.text,n))}return t}(n.segments);const t=n.text??"";return t?[o(t)]:[]}export{b as C,N as D,k as E,S,B as T,E as _,D as a,T as b,q as c,w as d,Q as f,K as g,H as h,G as i,R as l,M as m,z as n,V as o,_ as p,L as r,Y as s,F as t,O as u,A as v,v as w,j as x,P as y};
|
|
2
|
-
//# sourceMappingURL=BlockInsertion-6rR9tIGP.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BlockInsertion-6rR9tIGP.mjs","names":[],"sources":["../../src/model/ContentModel.ts","../../src/commands/CommandHelpers.ts","../../src/commands/BlockInsertion.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 { SchemaRegistry } from './SchemaRegistry.js';\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: SchemaRegistry,\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 * Shared helpers used across multiple command modules.\n *\n * - {@link getSiblings} — resolves a parent path to its child list\n * - {@link resolveInsertPoint} — normalizes a text selection to a single insert position\n */\n\nimport type { BlockNode, ChildNode, Document } from '../model/Document.js';\nimport { getBlockLength, isBlockNode, isLeafBlock } from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport {\n\tcreateCollapsedSelection,\n\tcreateNodeSelection,\n\tisCollapsed,\n\tselectionRange,\n} from '../model/Selection.js';\nimport type { EditorSelection, Selection } from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport { isVoidBlock } from '../state/NavigationQueries.js';\n\n/** The resolved insert position within a single block. */\nexport interface InsertPoint {\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n}\n\n/** Resolves the children of a parent path: doc root or a nested block. */\nexport function getSiblings(\n\tstate: EditorState,\n\tparentPath: readonly BlockId[],\n): readonly ChildNode[] {\n\tif (parentPath.length === 0) return state.doc.children;\n\tconst parent: BlockNode | undefined = state.getBlock(\n\t\tparentPath[parentPath.length - 1] as BlockId,\n\t);\n\treturn parent ? parent.children : [];\n}\n\n/**\n * Normalizes a text selection to a single insert point.\n *\n * - Collapsed selection → anchor position.\n * - Range selection → normalized `from` position (document-order start).\n */\nexport function resolveInsertPoint(sel: Selection, blockOrder: readonly BlockId[]): InsertPoint {\n\tif (isCollapsed(sel)) {\n\t\treturn { blockId: sel.anchor.blockId, offset: sel.anchor.offset };\n\t}\n\tconst range = selectionRange(sel, blockOrder);\n\treturn { blockId: range.from.blockId, offset: range.from.offset };\n}\n\n/** Extracts the parent path from a full node path (all elements except the last). */\nexport function extractParentPath(path: readonly string[] | undefined): BlockId[] {\n\treturn path && path.length > 1 ? (path.slice(0, -1) as BlockId[]) : [];\n}\n\n/** Finds the index of a block by ID within a sibling list. */\nexport function findSiblingIndex(siblings: readonly ChildNode[], targetId: BlockId): number {\n\treturn siblings.findIndex((c) => isBlockNode(c) && c.id === targetId);\n}\n\n/** A block's parent path, its sibling list, and its index within that list. */\nexport interface SiblingContext {\n\treadonly parentPath: BlockId[];\n\treadonly siblings: readonly ChildNode[];\n\treadonly index: number;\n}\n\n/**\n * Resolves a node's parent path, sibling list, and index among its siblings.\n * `index` is `-1` when the node is not found; callers that require the node to\n * exist should guard on `index < 0`.\n */\nexport function resolveSiblingContext(state: EditorState, nodeId: BlockId): SiblingContext {\n\tconst parentPath: BlockId[] = extractParentPath(findNodePath(state.doc, nodeId));\n\tconst siblings: readonly ChildNode[] = getSiblings(state, parentPath);\n\tconst index: number = findSiblingIndex(siblings, nodeId);\n\treturn { parentPath, siblings, index };\n}\n\n/** Finds the first leaf block ID in a subtree. */\nexport function findFirstLeafBlockId(node: BlockNode): BlockId {\n\tif (isLeafBlock(node)) return node.id;\n\n\tfor (const child of node.children) {\n\t\tif (!isBlockNode(child)) continue;\n\t\treturn findFirstLeafBlockId(child);\n\t}\n\n\treturn node.id;\n}\n\n/** Finds the last leaf block ID in a subtree. */\nexport function findLastLeafBlockId(node: BlockNode): BlockId {\n\tif (isLeafBlock(node)) return node.id;\n\n\tfor (let i = node.children.length - 1; i >= 0; i--) {\n\t\tconst child = node.children[i];\n\t\tif (child && isBlockNode(child)) {\n\t\t\treturn findLastLeafBlockId(child);\n\t\t}\n\t}\n\n\treturn node.id;\n}\n\n/**\n * Resolves a valid editor selection at the start or end of a block subtree.\n * Void blocks become NodeSelections; text-capable blocks resolve to leaf cursors.\n */\nexport function createSelectionForBlockBoundary(\n\tstate: EditorState,\n\tblockId: BlockId,\n\tboundary: 'start' | 'end',\n): EditorSelection | null {\n\tconst block = state.getBlock(blockId);\n\tif (!block) return null;\n\n\tif (isVoidBlock(state, blockId)) {\n\t\tconst path = state.getNodePath(blockId);\n\t\treturn path ? createNodeSelection(blockId, path) : null;\n\t}\n\n\tconst leafId: BlockId =\n\t\tboundary === 'start' ? findFirstLeafBlockId(block) : findLastLeafBlockId(block);\n\tconst leaf = state.getBlock(leafId);\n\tif (!leaf) return null;\n\n\tconst offset = boundary === 'start' ? 0 : getBlockLength(leaf);\n\treturn createCollapsedSelection(leafId, offset);\n}\n\n/**\n * Resolves a valid editor selection anywhere in the document, starting from\n * the first (or last) top-level block and deferring per-block resolution to\n * {@link createSelectionForBlockBoundary}. Useful as a last-resort fallback\n * after deletions when neighbouring siblings cannot provide a selection.\n *\n * @param state The editor state to query.\n * @param boundary `'start'` walks document order; `'end'` walks reverse.\n * @param excludeBlockId Optional block id to skip (e.g. the block about to\n * be removed by the caller's transaction).\n * @returns A valid selection, or `null` if no selectable block exists.\n */\nexport function createSelectionForDocumentBoundary(\n\tstate: EditorState,\n\tboundary: 'start' | 'end',\n\texcludeBlockId?: BlockId,\n): EditorSelection | null {\n\tconst children: readonly ChildNode[] = state.doc.children;\n\tconst indices: readonly number[] =\n\t\tboundary === 'start'\n\t\t\t? children.map((_, i) => i)\n\t\t\t: children.map((_, i) => children.length - 1 - i);\n\n\tfor (const i of indices) {\n\t\tconst child = children[i];\n\t\tif (!child || !isBlockNode(child)) continue;\n\t\tif (excludeBlockId !== undefined && child.id === excludeBlockId) continue;\n\n\t\tconst sel = createSelectionForBlockBoundary(state, child.id, boundary);\n\t\tif (sel) return sel;\n\t}\n\n\treturn null;\n}\n\n/** Returns the root-level block IDs in document order. */\nexport function getRootBlockIds(doc: Document): readonly BlockId[] {\n\treturn doc.children.map((child) => child.id);\n}\n","/**\n * Block insertion utilities for paste/clipboard operations and block-object\n * commands (table, image, horizontal rule, display formula).\n *\n * Provides context resolution (parent path, anchor index, empty detection)\n * for inserting blocks into the document tree — both at root level and\n * inside table cells — plus the shared primitive that drops a block-level\n * object onto its own line. Also contains pure helpers for block cloning,\n * recursive lookup, and attribute sanitization against a NodeSpec.\n */\n\nimport { canContain } from '../model/ContentModel.js';\nimport type { ContentSlice, SliceBlock } from '../model/ContentSlice.js';\nimport {\n\ttype BlockAttrs,\n\ttype BlockNode,\n\ttype ChildNode,\n\ttype ContentSegment,\n\ttype InlineNode,\n\ttype Mark,\n\ttype TextNode,\n\tcreateBlockNode,\n\tcreateInlineNode,\n\tgenerateBlockId,\n\tgetBlockLength,\n\tgetBlockText,\n\tinlineSegment,\n\tisBlockNode,\n\tsegmentsToInlineChildren,\n\ttextSegment,\n} from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport type { AttrSpec } from '../model/NodeSpec.js';\nimport type { RichBlockData, RichSegment } from '../model/RichBlockData.js';\nimport type { SchemaRegistry } from '../model/SchemaRegistry.js';\nimport type { EditorSelection } from '../model/Selection.js';\nimport { isGapCursor, isNodeSelection } from '../model/Selection.js';\nimport type { BlockId, NodeTypeName } from '../model/TypeBrands.js';\nimport { inlineType, nodeType } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport { isVoidBlock } from '../state/NavigationQueries.js';\nimport type { TransactionBuilder } from '../state/Transaction.js';\nimport { extractParentPath, findSiblingIndex, getSiblings } from './CommandHelpers.js';\n\n/**\n * Resolved insertion target within the document tree.\n * Contains everything needed to insert blocks at a specific anchor position.\n */\nexport interface InsertionContext {\n\treadonly parentPath: readonly BlockId[];\n\treadonly anchorIndex: number;\n\treadonly isAnchorEmpty: boolean;\n}\n\n/**\n * Resolves an insertion context for root-level (or nested-parent-level) insertion.\n * Computes the parent path, anchor index among siblings, and whether the anchor is empty.\n */\nexport function resolveRootInsertionContext(\n\tstate: EditorState,\n\tanchorBlockId: BlockId,\n\tschemaRegistry?: SchemaRegistry,\n): InsertionContext | undefined {\n\tconst path: readonly string[] | undefined = findNodePath(state.doc, anchorBlockId);\n\tconst parentPath: BlockId[] = extractParentPath(path);\n\n\tconst siblings: readonly ChildNode[] = getSiblings(state, parentPath);\n\tconst anchorIndex: number = findSiblingIndex(siblings, anchorBlockId);\n\tif (anchorIndex < 0) return undefined;\n\n\tconst isAnchorEmpty: boolean = isBlockEmpty(state, anchorBlockId, schemaRegistry);\n\treturn { parentPath, anchorIndex, isAnchorEmpty };\n}\n\n/**\n * Resolves an insertion context within a table cell.\n * The parent path points to the cell itself; siblings are the cell's children.\n */\nexport function resolveCellInsertionContext(\n\tstate: EditorState,\n\tanchorBlockId: BlockId,\n\tcellId: BlockId,\n\tschemaRegistry?: SchemaRegistry,\n): InsertionContext | undefined {\n\tconst cellPath: BlockId[] | undefined = findNodePath(state.doc, cellId) as BlockId[] | undefined;\n\tif (!cellPath) return undefined;\n\n\tconst cell: BlockNode | undefined = state.getBlock(cellId);\n\tif (!cell) return undefined;\n\n\tconst anchorIndex: number = cell.children.findIndex(\n\t\t(c) => isBlockNode(c) && c.id === anchorBlockId,\n\t);\n\n\tconst isAnchorEmpty: boolean = isBlockEmpty(state, anchorBlockId, schemaRegistry);\n\treturn { parentPath: cellPath, anchorIndex, isAnchorEmpty };\n}\n\n/**\n * Finds a table_cell ancestor for the given block.\n * Walks the node path upward, returning the first table_cell BlockId found.\n */\nexport function findTableCellAncestor(state: EditorState, blockId: BlockId): BlockId | undefined {\n\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\tif (block?.type === 'table_cell') return blockId;\n\n\tconst path: BlockId[] | undefined = findNodePath(state.doc, blockId) as BlockId[] | undefined;\n\tif (!path) return undefined;\n\n\tfor (const id of path) {\n\t\tconst node: BlockNode | undefined = state.getBlock(id as BlockId);\n\t\tif (node?.type === 'table_cell') return id as BlockId;\n\t}\n\treturn undefined;\n}\n\n/**\n * Resolves the anchor block ID from the current editor selection.\n * Handles text selection, node selection, and gap cursor uniformly.\n */\nexport function resolveAnchorBlockId(selection: EditorSelection): BlockId {\n\tif (isNodeSelection(selection)) return selection.nodeId;\n\tif (isGapCursor(selection)) return selection.blockId;\n\treturn selection.anchor.blockId;\n}\n\n/**\n * Inserts a block node after the anchor position, resolving cell vs root context.\n * Removes the anchor block if it is empty (matching standard paste behavior).\n * Returns true on success, false if context resolution fails.\n */\nexport function insertBlockAfterAnchor(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tanchorBlockId: BlockId,\n\tblock: BlockNode,\n\tselection: EditorSelection,\n\tschemaRegistry?: SchemaRegistry,\n): boolean {\n\tconst cellId: BlockId | undefined = findTableCellAncestor(state, anchorBlockId);\n\n\tif (cellId) {\n\t\tconst ctx: InsertionContext | undefined = resolveCellInsertionContext(\n\t\t\tstate,\n\t\t\tanchorBlockId,\n\t\t\tcellId,\n\t\t\tschemaRegistry,\n\t\t);\n\t\tif (!ctx) return false;\n\n\t\tconst insertIndex: number = ctx.anchorIndex + 1;\n\t\tbuilder.insertNode(ctx.parentPath, insertIndex, block);\n\n\t\tif (ctx.isAnchorEmpty && ctx.anchorIndex >= 0) {\n\t\t\tbuilder.removeNode(ctx.parentPath, ctx.anchorIndex);\n\t\t}\n\t} else {\n\t\tconst ctx: InsertionContext | undefined = resolveRootInsertionContext(\n\t\t\tstate,\n\t\t\tanchorBlockId,\n\t\t\tschemaRegistry,\n\t\t);\n\t\tif (!ctx) return false;\n\n\t\tconst insertOffset: number = isGapCursor(selection) && selection.side === 'before' ? 0 : 1;\n\t\tbuilder.insertNode(ctx.parentPath, ctx.anchorIndex + insertOffset, block);\n\n\t\tif (ctx.isAnchorEmpty && !isGapCursor(selection)) {\n\t\t\tbuilder.removeNode(ctx.parentPath, ctx.anchorIndex);\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Document-root index of the top-level block that contains `blockId` — the block\n * itself when it already lives at the document root. Returns -1 when the block is\n * not part of the document. Block-level objects always live at the root, so an\n * insertion triggered from inside a container (e.g. a table cell) escapes to the\n * top level via this lookup.\n */\nexport function topLevelBlockIndex(state: EditorState, blockId: BlockId): number {\n\tconst path: readonly string[] | undefined = findNodePath(state.doc, blockId);\n\tconst topId: BlockId = path && path.length > 0 ? (path[0] as BlockId) : blockId;\n\treturn state.doc.children.findIndex((b) => b.id === topId);\n}\n\n/**\n * True when a container of `containerType` may hold every block in `blocks`,\n * per its {@link import('../model/NodeSpec.js').NodeSpec} content rule. An\n * undefined `containerType` denotes the document root, which imposes no\n * restriction. Used to keep paste from creating schema-invalid nesting, such as\n * a `table` dropped into a `table_cell` (#166).\n */\nexport function canContainerHoldBlocks(\n\tregistry: SchemaRegistry,\n\tcontainerType: string | undefined,\n\tblocks: readonly BlockNode[],\n): boolean {\n\tif (!containerType) return true;\n\treturn blocks.every((block) => canContain(registry, containerType, block.type));\n}\n\n/**\n * Insertion context that escapes to the document root: blocks are placed after\n * the top-level ancestor of `anchorBlockId` (e.g. the outer table when the caret\n * sits inside a cell). The anchor is never treated as empty, so the originating\n * container keeps its own content. Returns undefined when the anchor is not part\n * of the document.\n */\nexport function resolveRootEscapeContext(\n\tstate: EditorState,\n\tanchorBlockId: BlockId,\n): InsertionContext | undefined {\n\tconst topIndex: number = topLevelBlockIndex(state, anchorBlockId);\n\tif (topIndex === -1) return undefined;\n\treturn { parentPath: [], anchorIndex: topIndex, isAnchorEmpty: false };\n}\n\n/**\n * True when the block is a blank-line paragraph. Inline-aware: a paragraph that\n * holds only an atomic inline node (e.g. an inline formula) has width > 0 and is\n * therefore never treated as blank, so it is never silently removed.\n */\nexport function isEmptyParagraph(block: BlockNode): boolean {\n\treturn block.type === 'paragraph' && getBlockLength(block) === 0;\n}\n\n/**\n * Places a block-level object on its own line at the document root: the object\n * followed by a trailing empty paragraph, so a void/atomic object always has an\n * editable line after it. The object is inserted after the top-level ancestor of\n * the current selection; when that ancestor is a blank-line paragraph it is\n * consumed, so the object is never preceded by a stray empty paragraph (#152).\n *\n * Only an empty *paragraph* is consumed — an empty heading or list item is\n * deliberate structure — and the emptiness test is inline-aware (see\n * {@link isEmptyParagraph}). This is intentionally stricter than\n * {@link insertBlockAfterAnchor}, which the paste pipeline uses with a text-only\n * emptiness notion.\n *\n * A void anchor (image, display formula) already owns a trailing empty paragraph\n * as its escape line. In that case the object is placed before that paragraph and\n * the paragraph is reused as the object's trailing line, so a second blank line\n * never stacks up (#158).\n *\n * Selection is the caller's concern, since objects differ (a cursor inside a new\n * table vs. a node selection on an image or display formula). Returns the\n * trailing paragraph after the object, or undefined when the selection has no\n * resolvable anchor.\n */\nexport function insertBlockObjectOnOwnLine(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tanchorBlockId: BlockId,\n\tobject: BlockNode,\n): BlockNode | undefined {\n\treturn insertBlockObjectsOnOwnLines(state, builder, anchorBlockId, [object]);\n}\n\n/**\n * Places a sequence of block-level objects on their own lines at the document\n * root, sharing a single trailing empty paragraph. Generalizes\n * {@link insertBlockObjectOnOwnLine} for inserting several objects at once (e.g.\n * pasting two or more standalone formulas, #159); for a single object the two\n * behave identically. The anchor-consumption (#152) and void-anchor trailing\n * reuse (#158) rules apply once, around the whole run.\n *\n * Returns the trailing paragraph after the last object, or undefined when the\n * anchor or object list is empty.\n */\nexport function insertBlockObjectsOnOwnLines(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tanchorBlockId: BlockId,\n\tobjects: readonly BlockNode[],\n): BlockNode | undefined {\n\tif (objects.length === 0) return undefined;\n\n\tconst topIndex: number = topLevelBlockIndex(state, anchorBlockId);\n\tif (topIndex === -1) return undefined;\n\n\tconst anchor: BlockNode | undefined = state.doc.children[topIndex];\n\tconst following: BlockNode | undefined = state.doc.children[topIndex + 1];\n\n\tlet insertAt: number = topIndex + 1;\n\tfor (const object of objects) {\n\t\tbuilder.insertNode([], insertAt, object);\n\t\tinsertAt++;\n\t}\n\n\t// A void anchor already owns a trailing empty paragraph as its escape line;\n\t// reuse it so a second blank line never stacks up (#158). Otherwise add one.\n\tconst reusableTrailing: BlockNode | undefined =\n\t\tanchor && isVoidBlock(state, anchor.id) && following && isEmptyParagraph(following)\n\t\t\t? following\n\t\t\t: undefined;\n\tlet trailing: BlockNode;\n\tif (reusableTrailing) {\n\t\ttrailing = reusableTrailing;\n\t} else {\n\t\ttrailing = createBlockNode(nodeType('paragraph'));\n\t\tbuilder.insertNode([], insertAt, trailing);\n\t}\n\n\t// Drop a blank-line paragraph anchor so the objects are not preceded by a\n\t// stray empty paragraph (#152).\n\tif (anchor && isEmptyParagraph(anchor)) {\n\t\tbuilder.removeNode([], topIndex);\n\t}\n\n\treturn trailing;\n}\n\n/** Recursively clones a block tree, assigning new IDs to all block nodes. */\nexport function cloneBlockWithNewIds(block: BlockNode, newId: BlockId): BlockNode {\n\tconst children = block.children.map((child) => {\n\t\tif (isBlockNode(child)) {\n\t\t\treturn cloneBlockWithNewIds(child, generateBlockId());\n\t\t}\n\t\treturn child;\n\t});\n\treturn createBlockNode(block.type, children, newId, block.attrs);\n}\n\n/** Recursively searches a block tree for a block with the given ID (DFS). */\nexport function findBlockRecursive(block: BlockNode, blockId: BlockId): BlockNode | undefined {\n\tif (block.id === blockId) return block;\n\tfor (const child of block.children) {\n\t\tif (!isBlockNode(child)) continue;\n\t\tconst found: BlockNode | undefined = findBlockRecursive(child, blockId);\n\t\tif (found) return found;\n\t}\n\treturn undefined;\n}\n\n/**\n * Validates incoming attributes against the declared AttrSpec.\n * Only keys declared in the spec are kept; non-primitive values fall back to defaults.\n */\nexport function sanitizeAttrs(\n\tincoming: Record<string, unknown> | undefined,\n\tspecAttrs: Readonly<Record<string, AttrSpec>> | undefined,\n): Record<string, string | number | boolean> | undefined {\n\tif (!specAttrs) return undefined;\n\n\tconst result: Record<string, string | number | boolean> = {};\n\tlet hasKeys = false;\n\n\tfor (const key of Object.keys(specAttrs)) {\n\t\tconst spec: AttrSpec = specAttrs[key] as AttrSpec;\n\t\tconst raw: unknown = incoming?.[key];\n\n\t\tif (typeof raw === 'string' || typeof raw === 'number' || typeof raw === 'boolean') {\n\t\t\tresult[key] = raw;\n\t\t} else if (spec.default !== undefined) {\n\t\t\tresult[key] = spec.default;\n\t\t}\n\t\tif (key in result) hasKeys = true;\n\t}\n\n\treturn hasKeys ? result : undefined;\n}\n\n/** Checks whether a block is empty (has no text and is not a void block). */\nfunction isBlockEmpty(\n\tstate: EditorState,\n\tblockId: BlockId,\n\tschemaRegistry?: SchemaRegistry,\n): boolean {\n\tconst block: BlockNode | undefined = state.getBlock(blockId);\n\tif (!block) return false;\n\n\tconst spec = schemaRegistry?.getNodeSpec(block.type);\n\treturn !spec?.isVoid && getBlockText(block) === '';\n}\n\n// --- Rich block creation ---\n\n/**\n * Validates a rich block against the schema registry.\n * Returns undefined for blocks with unknown types; sanitizes attributes\n * against the declared spec.\n */\nexport function validateRichBlockData(\n\traw: RichBlockData,\n\tschemaRegistry?: SchemaRegistry,\n): RichBlockData | undefined {\n\tif (!raw.type) return undefined;\n\tif (!schemaRegistry) return raw;\n\n\tconst spec = schemaRegistry.getNodeSpec(raw.type);\n\tif (!spec) return undefined;\n\n\tconst attrs: Record<string, string | number | boolean> | undefined = sanitizeAttrs(\n\t\traw.attrs,\n\t\tspec.attrs,\n\t);\n\tconst segments: RichSegment[] | undefined = raw.segments\n\t\t? sanitizeRichSegments(raw.segments, schemaRegistry)\n\t\t: undefined;\n\treturn {\n\t\t...raw,\n\t\t...(attrs ? { attrs } : {}),\n\t\t...(segments ? { segments } : raw.segments ? { segments: [] } : {}),\n\t};\n}\n\n/**\n * Creates a BlockNode from validated rich block data.\n * Converts segments or plain text into inline children.\n */\nexport function createBlockFromRichData(blockData: RichBlockData): BlockNode {\n\tconst newId: BlockId = generateBlockId();\n\tconst children: readonly (TextNode | InlineNode)[] | undefined =\n\t\tcreateChildrenFromRichBlock(blockData);\n\tconst attrs: BlockAttrs | undefined = blockData.attrs\n\t\t? (blockData.attrs as BlockAttrs)\n\t\t: undefined;\n\n\treturn createBlockNode(nodeType(blockData.type) as NodeTypeName, children, newId, attrs);\n}\n\n/**\n * Creates inline children from rich block data.\n * Uses mark-preserving segments when available, falls back to plain text.\n * Returns undefined for content-free blocks (e.g. void blocks).\n */\nfunction createChildrenFromRichBlock(\n\tblockData: RichBlockData,\n): readonly (TextNode | InlineNode)[] | undefined {\n\tconst segments: readonly ContentSegment[] = richBlockToContentSegments(blockData);\n\tif (segments.length === 0) return undefined;\n\treturn segmentsToInlineChildren(segments);\n}\n\n/**\n * Converts rich block data into a paste {@link ContentSlice}. Blocks that fail\n * schema validation (unknown type or filtered attributes) are dropped, so the\n * resulting slice can be fed straight into the canonical paste strategy\n * ({@link import('./PasteCommand.js').pasteSlice}).\n */\nexport function richBlocksToSlice(\n\tblocks: readonly RichBlockData[],\n\tschemaRegistry?: SchemaRegistry,\n): ContentSlice {\n\tconst sliceBlocks: SliceBlock[] = [];\n\tfor (const raw of blocks) {\n\t\tconst blockData: RichBlockData | undefined = validateRichBlockData(raw, schemaRegistry);\n\t\tif (!blockData) continue;\n\t\tsliceBlocks.push(richBlockToSliceBlock(blockData));\n\t}\n\treturn { blocks: sliceBlocks };\n}\n\n/** Converts a single validated rich block into a {@link SliceBlock}. */\nfunction richBlockToSliceBlock(blockData: RichBlockData): SliceBlock {\n\tconst attrs: BlockAttrs | undefined = blockData.attrs\n\t\t? (blockData.attrs as BlockAttrs)\n\t\t: undefined;\n\treturn {\n\t\ttype: nodeType(blockData.type) as NodeTypeName,\n\t\t...(attrs ? { attrs } : {}),\n\t\tsegments: richBlockToContentSegments(blockData),\n\t};\n}\n\n/** Builds content segments from a rich block, falling back to plain text. */\nfunction richBlockToContentSegments(blockData: RichBlockData): readonly ContentSegment[] {\n\tif (blockData.segments && blockData.segments.length > 0) {\n\t\treturn richSegmentsToContentSegments(blockData.segments);\n\t}\n\tconst text: string = blockData.text ?? '';\n\treturn text ? [textSegment(text)] : [];\n}\n\n/** Converts rich segments into content segments (marked text and inline nodes). */\nfunction richSegmentsToContentSegments(\n\tsegments: readonly RichSegment[],\n): readonly ContentSegment[] {\n\tconst result: ContentSegment[] = [];\n\tfor (const seg of segments) {\n\t\tif (seg.kind === 'inline') {\n\t\t\tresult.push(\n\t\t\t\tinlineSegment(\n\t\t\t\t\tcreateInlineNode(\n\t\t\t\t\t\tinlineType(seg.inlineType),\n\t\t\t\t\t\tseg.attrs as Readonly<Record<string, string | number | boolean>> | undefined,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\t\tif (seg.text.length === 0) continue;\n\t\tconst marks: readonly Mark[] = seg.marks.map((m) => ({\n\t\t\ttype: m.type as Mark['type'],\n\t\t\t...(m.attrs ? { attrs: m.attrs as Mark['attrs'] } : {}),\n\t\t}));\n\t\tresult.push(textSegment(seg.text, marks));\n\t}\n\treturn result;\n}\n\nfunction sanitizeRichSegments(\n\tsegments: readonly RichSegment[],\n\tschemaRegistry: SchemaRegistry,\n): RichSegment[] {\n\tconst sanitized: RichSegment[] = [];\n\tfor (const segment of segments) {\n\t\tif (segment.kind === 'inline') {\n\t\t\tconst spec = schemaRegistry.getInlineNodeSpec(segment.inlineType);\n\t\t\tif (!spec) continue;\n\t\t\tconst attrs = sanitizeAttrs(segment.attrs, spec.attrs);\n\t\t\tsanitized.push({\n\t\t\t\tkind: 'inline',\n\t\t\t\tinlineType: segment.inlineType,\n\t\t\t\t...(attrs ? { attrs } : {}),\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tsanitized.push(segment);\n\t}\n\treturn sanitized;\n}\n"],"mappings":"2UAWA,SAAgB,EACf,EACA,EACA,GAEA,MAAM,EAAa,EAAS,YAAY,GACxC,IAAK,GAAY,QAAS,OAAO,EAGjC,MAAM,EADY,EAAS,YAAY,IACT,MAE9B,IAAK,MAAM,KAAW,EAAW,QAAQ,MAAO,CAC/C,GAAI,IAAY,EAAW,OAAO,EAClC,GAAgB,SAAZ,GACA,GAAc,IAAY,EAAY,OAAO,CAClD,CA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ACjC,CAnBE,CAA4B,GACvB,EAAgC,EAAU,MAC5C,EAAU,WACX,EAEH,OAAO,EAAgB,EAAS,EAAU,MAAuB,EAAU,EAAO,EACnF,CAqBA,SAAgB,EACf,EACA,GAEA,MAAM,EAA4B,GAClC,IAAK,MAAM,KAAO,EAAQ,CACzB,MAAM,EAAuC,EAAsB,EAAK,GACnE,GACL,EAAY,KAAK,EAAsB,GACxC,CACA,MAAO,CAAE,OAAQ,EAClB,CAGA,SAAS,EAAsB,GAC9B,MAAM,EAAgC,EAAU,MAC5C,EAAU,WACX,EACH,MAAO,CACN,KAAM,EAAS,EAAU,SACrB,EAAQ,CAAE,SAAU,CAAC,EACzB,SAAU,EAA2B,GAEvC,CAGA,SAAS,EAA2B,GACnC,GAAI,EAAU,UAAY,EAAU,SAAS,OAAS,EACrD,OAOF,SACC,GAEA,MAAM,EAA2B,GACjC,IAAK,MAAM,KAAO,EAAU,CAC3B,GAAiB,WAAb,EAAI,KAAmB,CAC1B,EAAO,KACN,EACC,EACC,EAAW,EAAI,YACf,EAAI,SAIP,QACD,CACA,GAAwB,IAApB,EAAI,KAAK,OAAc,SAC3B,MAAM,EAAyB,EAAI,MAAM,IAAK,IAAA,CAC7C,KAAM,EAAE,QACJ,EAAE,MAAQ,CAAE,MAAO,EAAE,OAA2B,CAAC,KAEtD,EAAO,KAAK,EAAY,EAAI,KAAM,GACnC,CACA,OAAO,CACR,CA/BS,CAA8B,EAAU,UAEhD,MAAM,EAAe,EAAU,MAAQ,GACvC,OAAO,EAAO,CAAC,EAAY,IAAS,EACrC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as t,i as e,o,p as n,u as r}from"./Document-r7vLOAGA.mjs";import{d as i,o as c,t as s,u as l}from"./Selection-HYoVFpAx.mjs";import{a}from"./TypeBrands-Ch9856Gb.mjs";import{n as u}from"./DomUtils-Bf7JLFlx.mjs";import{a as d,c as h,t as m}from"./NodeResolver-ChgLF_IP.mjs";import{c as p,o as g}from"./PluginHelpers-KDuTlmXm.mjs";import{t as f}from"./ShortcutFormatting-TwiufqeV.mjs";function b(t,e){const o=t.getNodePath(e)?.[0];return o?t.doc.children.findIndex(t=>t.id===o):-1}function q(t,o,n,c){const s=i(n,t.getBlockOrder()),l=b(t,s.from.blockId),a=b(t,s.to.blockId);if(l<0||a<0)return null;const u=Math.min(l,a),d=Math.max(l,a),h=t.doc.children.slice(u,d+1),m=c??(()=>!0),p=[];let g=[],f=!1;const q=()=>{0!==g.length&&(p.push(e(o,g,r())),f=!0,g=[])};for(const e of h)m(e)?g.push(e):(q(),p.push(e));if(q(),!f)return null;const k=t.transaction("command");for(let e=d;e>=u;e--)k.removeNode([],e);return p.forEach((t,e)=>{k.insertNode([],u+e,t)}),k.setSelection(n),k.build()}function k(e,o){const n=e.getState();if(!l(n.selection))return!1;const r=n.selection;if(!c(r))return!1;const i=r.anchor.blockId,s=n.getParent(i);if(!s||"blockquote"!==s.type)return!1;const a=n.getBlock(i);if(!a)return!1;const u=n.getNodePath(s.id);if(!u)return!1;const d=h(n.doc,u);if(!d)return!1;const m=t(s),p=m.findIndex(t=>t.id===i);return!(p<0)&&o({state:n,quotePath:u,quoteParentPath:u.slice(0,-1),quoteIndex:d.index,child:a,childIndex:p,childCount:m.length,offset:r.anchor.offset})}var I={label:"Blockquote",tooltip:t=>`Blockquote (${t})`},x=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-sGZ-oZqB.mjs"),"./locales/de.ts":()=>import("./de-uKR7koQe.mjs"),"./locales/es.ts":()=>import("./es-DrJyl38L.mjs"),"./locales/fr.ts":()=>import("./fr-BRXUnq3R.mjs"),"./locales/hi.ts":()=>import("./hi-SECtQQzq.mjs"),"./locales/pt.ts":()=>import("./pt-Cv6q7x5x.mjs"),"./locales/ru.ts":()=>import("./ru-DSRv3_Rg.mjs"),"./locales/zh.ts":()=>import("./zh-DYD476c5.mjs")});async function v(t){return p(x,t,I)}var N={},P=class{id="blockquote";name="Blockquote";priority=35;config;locale;constructor(t){this.config={...N,...t}}async init(t){this.locale=await g(t,this.config.locale,I,v),t.registerStyleSheet("\n.notectl-content blockquote {\n\tmargin: 0;\n\tpadding: 2px 0;\n\tpadding-inline-start: 16px;\n\tborder-inline-start: 3px solid var(--notectl-blockquote-border, var(--notectl-border));\n\tbackground: var(--notectl-blockquote-bg, transparent);\n\tcolor: var(--notectl-blockquote-fg, inherit);\n\tmin-height: 1.6em;\n}\n"),this.registerNodeSpec(t),this.registerCommands(t),this.registerKeymap(t),this.registerInputRule(t),this.registerToolbarItem(t)}registerNodeSpec(t){t.registerNodeSpec({type:"blockquote",group:"block",content:{allow:["paragraph","heading","list_item","blockquote","horizontal_rule","code_block"],min:1},toDOM(t){const e=u("blockquote",t.id);return e.setAttribute("part","blockquote"),e},toHTML:(t,e)=>`<blockquote>${e||"<br>"}</blockquote>`,parseHTML:[{tag:"blockquote"}],sanitize:{tags:["blockquote"]}})}registerCommands(t){t.registerCommand("toggleBlockquote",()=>this.toggleBlockquote(t)),t.registerCommand("setBlockquote",()=>this.wrapInBlockquote(t))}registerKeymap(t){t.registerKeymap({"Mod-Shift->":()=>t.executeCommand("toggleBlockquote")}),function(t){t.registerKeymap({Enter:()=>function(t){return k(t,e=>{if("list_item"===e.child.type)return!1;if(e.childIndex!==e.childCount-1||n(e.child)>0)return!1;const r=o(),i=e.state.transaction("input");return 1===e.childCount?(i.removeNode(e.quoteParentPath,e.quoteIndex),i.insertNode(e.quoteParentPath,e.quoteIndex,r)):(i.removeNode(e.quotePath,e.childIndex),i.insertNode(e.quoteParentPath,e.quoteIndex+1,r)),i.setSelection(s(r.id,0)),t.dispatch(i.build()),!0})}(t),Backspace:()=>function(t){return k(t,e=>{if(0!==e.offset||0!==e.childIndex)return!1;if("list_item"===e.child.type)return!1;const o=e.state.transaction("input");return 1===e.childCount?(o.removeNode(e.quoteParentPath,e.quoteIndex),o.insertNode(e.quoteParentPath,e.quoteIndex,e.child)):(o.removeNode(e.quotePath,0),o.insertNode(e.quoteParentPath,e.quoteIndex,e.child)),o.setSelection(s(e.child.id,0)),t.dispatch(o.build()),!0})}(t)},{priority:"context"})}(t)}registerInputRule(t){t.registerInputRule({pattern:/^> $/,handler(t,o,n,i){const s=t.selection;if(!l(s))return null;if(!c(s))return null;const u=t.getBlock(s.anchor.blockId);if(!u||"paragraph"!==u.type)return null;const d=t.doc.children.findIndex(t=>t.id===u.id);if(d<0)return null;const h=e(a("blockquote"),[u],r());return t.transaction("input").removeNode([],d).insertNode([],d,h).deleteTextAt(s.anchor.blockId,n,n+2).setSelection(s).build()}})}registerToolbarItem(t){t.registerToolbarItem({id:"blockquote",group:"block",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"/></svg>',label:this.locale.label,tooltip:this.locale.tooltip(f("Mod-Shift->")),command:"toggleBlockquote",isActive:t=>!!l(t.selection)&&d(t.doc,t.selection.anchor.blockId,"blockquote")})}toggleBlockquote(e){const o=e.getState(),n=o.selection;if(!l(n))return!1;const r=d(o.doc,n.anchor.blockId,"blockquote")?function(e,o,n){const r=m(e.doc,n.anchor.blockId,o);if(!r||1!==r.path.length)return null;const i=e.doc.children.findIndex(t=>t.id===r.node.id);if(i<0)return null;const c=t(r.node),s=e.transaction("command");return s.removeNode([],i),c.forEach((t,e)=>{s.insertNode([],i+e,t)}),s.setSelection(n),s.build()}(o,a("blockquote"),n):q(o,a("blockquote"),n,this.isQuoteChild(e));return!!r&&(e.dispatch(r),!0)}wrapInBlockquote(t){const e=t.getState(),o=e.selection;if(!l(o))return!1;const n=q(e,a("blockquote"),o,this.isQuoteChild(t));return!!n&&(t.dispatch(n),!0)}isQuoteChild(t){const e=t.getSchemaRegistry(),o=new Set(e.getNodeSpec(a("blockquote"))?.content?.allow??[]);return t=>{if(o.has(t.type))return!0;const n=e.getNodeSpec(t.type)?.group;return void 0!==n&&o.has(n)}}};export{I as n,v as r,P as t};
|
|
2
|
-
//# sourceMappingURL=BlockquotePlugin-4V7KV_Sb.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{S as t,T as e,h as n,o,p as r,u as c,v as s}from"./Document-r7vLOAGA.mjs";import{a as i,d as a,i as l,o as d,s as u,t as g,u as p}from"./Selection-HYoVFpAx.mjs";import{t as f}from"./Commands-BIIpx_Zd.mjs";import{a as h}from"./TypeBrands-Ch9856Gb.mjs";import{n as k}from"./DomUtils-Bf7JLFlx.mjs";import{r as b}from"./HTMLUtils-C6B4UT00.mjs";import{r as m}from"./NodeResolver-ChgLF_IP.mjs";import{C as v,S as x,_ as C,v as y,y as S}from"./BlockInsertion-6rR9tIGP.mjs";import{i as w,r as _,t as I}from"./Decoration-ZeyVfwJB.mjs";import{c as B}from"./StyleRuntime-BFKu52mS.mjs";import{n as A}from"./TypedKeys-CA4bfw9O.mjs";import{t as T}from"./SyntaxTokenTypes-BUCOMtL8.mjs";import{c as L,o as M}from"./PluginHelpers-KDuTlmXm.mjs";import{t as P}from"./ShortcutFormatting-TwiufqeV.mjs";import{t as O}from"./PopupManager-DUtaK3WX.mjs";import{c as N,l as j}from"./XmlDetector-D7TQpw-e.mjs";import{a as E,r as z,s as $,t as D}from"./XmlSupport-BYiRwlkK.mjs";import{n as q}from"./PopupKeyboardPatterns-tUrT9TyV.mjs";var H=`\n/* Code Block — uses theme custom properties */\n.notectl-code-block {\n\tposition: relative;\n\tmargin: 8px 0;\n\tborder-radius: 6px;\n\tbackground: var(--notectl-code-block-bg);\n\tcolor: var(--notectl-code-block-color);\n\tfont-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, Consolas, monospace;\n\tfont-size: 14px;\n\tline-height: 1.5;\n\toverflow: hidden;\n}\n\n.notectl-code-block__header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 6px 12px;\n\tbackground: var(--notectl-code-block-header-bg);\n\tborder-bottom: 1px solid var(--notectl-code-block-header-border);\n\tfont-size: 12px;\n\tcolor: var(--notectl-code-block-header-color);\n\tuser-select: none;\n}\n\n.notectl-code-block__language-btn {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 4px;\n\tborder: none;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: var(--notectl-code-block-header-color);\n\tcursor: pointer;\n\tpadding: 2px 6px;\n\tfont-size: inherit;\n\tfont-family: inherit;\n\ttransition: background 0.15s;\n}\n\n.notectl-code-block__language-btn:hover {\n\tbackground: rgba(128, 128, 128, 0.15);\n}\n\n.notectl-code-block__language-btn:focus-visible {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 1px;\n}\n\n.notectl-code-block__language {\n\tfont-weight: 500;\n\tletter-spacing: 0.02em;\n}\n\n.notectl-code-block__chevron {\n\tdisplay: inline-flex;\n\talign-items: center;\n\topacity: 0.6;\n}\n\n.notectl-code-block__actions {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 2px;\n}\n\n.notectl-code-block__copy,\n.notectl-code-block__delete {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 24px;\n\theight: 24px;\n\tborder: none;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: var(--notectl-code-block-header-color);\n\tcursor: pointer;\n\tpadding: 0;\n\ttransition: background 0.15s, color 0.15s;\n}\n\n.notectl-code-block__copy:hover,\n.notectl-code-block__delete:hover {\n\tbackground: rgba(128, 128, 128, 0.15);\n\tcolor: var(--notectl-code-block-color);\n}\n\n.notectl-code-block__copy svg,\n.notectl-code-block__delete svg {\n\tfill: currentColor;\n}\n\n.notectl-code-block__content {\n\tdisplay: block;\n\tpadding: 12px 16px;\n\twhite-space: pre-wrap;\n\tword-wrap: break-word;\n\ttab-size: 4;\n\t-moz-tab-size: 4;\n\toutline: none;\n\tmin-height: 1.5em;\n}\n\n.notectl-code-block--selected {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 2px;\n}\n\n.notectl-code-block__esc-hint {\n\tdisplay: none;\n\tposition: absolute;\n\tbottom: 4px;\n\tinset-inline-end: 8px;\n\tfont-size: 11px;\n\tcolor: var(--notectl-code-block-header-color);\n\topacity: 0.5;\n\tpointer-events: none;\n\tuser-select: none;\n\tfont-family: system-ui, sans-serif;\n}\n\n.notectl-code-block--focused .notectl-code-block__esc-hint {\n\tdisplay: block;\n}\n\n/* Language picker popup */\n.notectl-language-picker {\n\tmin-width: 120px;\n\tmax-height: 200px;\n\toverflow-y: auto;\n\tpadding: 4px;\n\tbackground: var(--notectl-surface-raised, #fff);\n\tborder: 1px solid var(--notectl-border, #e0e0e0);\n\tborder-radius: 6px;\n\tbox-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);\n}\n\n.notectl-language-picker__option {\n\tpadding: 6px 10px;\n\tborder-radius: 4px;\n\tcursor: pointer;\n\tfont-size: 13px;\n\tcolor: var(--notectl-fg, #333);\n\twhite-space: nowrap;\n}\n\n.notectl-language-picker__option:hover {\n\tbackground: rgba(128, 128, 128, 0.1);\n}\n\n.notectl-language-picker__option:focus {\n\toutline: none;\n\tbackground: rgba(128, 128, 128, 0.15);\n}\n\n.notectl-language-picker__option[aria-selected="true"] {\n\tfont-weight: 600;\n\tcolor: var(--notectl-primary, #2563eb);\n}\n\n/* Syntax highlighting token classes — generated from canonical token type list */\n${T.map(t=>`.notectl-token--${t} {\n\tcolor: var(--notectl-code-token-${t});\n\tfont-style: var(--notectl-code-token-${t}-font-style, inherit);\n\tfont-weight: var(--notectl-code-token-${t}-font-weight, inherit);\n}`).join("\n")}\n`,R=[{open:"(",close:")",kind:"bracket"},{open:"[",close:"]",kind:"bracket"},{open:"{",close:"}",kind:"bracket"},{open:'"',close:'"',kind:"quote"},{open:"'",close:"'",kind:"quote"},{open:"`",close:"`",kind:"quote"}],V=new Map(R.map(t=>[t.open,t])),F=new Map(R.filter(t=>"bracket"===t.kind).map(t=>[t.close,t]));var K=new Set(["{","[","("]),W={"}":"{","]":"[",")":"("};function U(t,e){const n=t.lastIndexOf("\n",e-1)+1,o=t.indexOf("\n",e);return{start:n,end:-1===o?t.length:o}}function X(t,e){const{start:n,end:o}=U(t,e);let r=n;for(;r<o;){const e=t[r];if(" "!==e&&"\t"!==e)break;r++}return t.slice(n,r)}function J(t,e){return t?" ".repeat(e):"\t"}function Q(t,e,n){if(0===t.length)return{removed:"",rest:t};if(!e&&"\t"===t[0])return{removed:"\t",rest:t.slice(1)};let o=0;for(;o<n&&" "===t[o];)o++;return{removed:t.slice(0,o),rest:t.slice(o)}}var Z=class{buckets=/* @__PURE__ */new Map;push(t,e){const n=this.buckets.get(t.blockId)??[];n.push({pos:t,char:e}),this.buckets.set(t.blockId,n)}take(t,e){const n=this.buckets.get(t);if(n)for(let o=n.length-1;o>=0;o--){const r=n[o];if(r&&r.pos.offset===e)return n.splice(o,1),0===n.length&&this.buckets.delete(t),r}}peek(t,e){const n=this.buckets.get(t);if(n)for(let o=n.length-1;o>=0;o--){const t=n[o];if(t&&t.pos.offset===e)return t}}clearBlock(t){this.buckets.delete(t)}clear(){this.buckets.clear()}sizeForBlock(t){return this.buckets.get(t)?.length??0}get size(){let t=0;for(const e of this.buckets.values())t+=e.length;return t}migrate(t){if(t.isEmpty)return;const e=/* @__PURE__ */new Map;for(const n of this.buckets.values())for(const o of n){const n=t.mapResult(o.pos,1);if(n.deleted)continue;const r={pos:n.pos,char:o.char},c=n.pos.blockId,s=e.get(c)??[];s.push(r),e.set(c,s)}this.buckets.clear();for(const[n,o]of e)this.buckets.set(n,o)}static makePos(t,e){return l(t,e)}},G=class{resolvedIndent;resolvedPairing;getTokenAt;getCompositionState;pairs=new Z;pendingPairOps=[];constructor(t){this.resolvedIndent=t.resolvedIndent,this.resolvedPairing=t.resolvedPairing,this.getTokenAt=t.getTokenAt,this.getCompositionState=t.getCompositionState}get pairStack(){return this.pairs}clear(){this.pairs.clear(),this.pendingPairOps.length=0}syncOnStateChange(t,e){this.pairs.size>0&&!e.mapping.isEmpty&&this.pairs.migrate(e.mapping);for(const n of this.pendingPairOps)"push"===n.kind?this.pairs.push(l(n.blockId,n.offset),n.char):this.pairs.take(n.blockId,n.offset);this.pendingPairOps.length=0;for(const n of e.steps){if("setBlockType"!==n.type)continue;const e=t.getBlock(n.blockId);e&&"code_block"===e.type||this.pairs.clearBlock(n.blockId)}}handleTextInput=(t,e)=>{this.pendingPairOps.length=0;const o=this.getCompositionState();if(!o)return null;if(o.isComposing)return null;if(!p(e.selection))return null;if(1!==t.length)return null;const r=e.selection,c=e.getBlock(r.anchor.blockId);if(!c||"code_block"!==c.type)return null;const s=this.tryDedentOnCloseBracket(e,c,t);if(s)return s;const i=function(t){const{state:e,char:o,config:r}=t;if(!p(e.selection))return{kind:"passthrough"};const c=e.selection,s=V.get(o);if(s&&!d(c)&&function(t,e){switch(e.surround){case"never":return!1;case"brackets":return"bracket"===t.kind;case"quotes":return"quote"===t.kind;case"languageDefined":return!0}}(s,r)){const e=function(t,e,n){const{state:o}=n,r=a(e,o.getBlockOrder());return r.from.blockId!==r.to.blockId||r.from.blockId!==n.blockId?null:{kind:"wrap",open:t.open,close:t.close}}(s,c,t);if(e)return e}return d(c)?r.overtype&&function(t,e){if(!function(t){const e=V.get(t);return"quote"===e?.kind?e:F.get(t)}(e))return!1;const o=t.state.selection;if(!p(o))return!1;const r=n(t.block),c=o.anchor.offset;if(r[c]!==e)return!1;const s=t.pairStack.peek(t.blockId,c);return Boolean(s&&s.char===e)}(t,o)?{kind:"overtype"}:s&&function(t,e){const o="quote"===t.kind?e.config.quotes:e.config.brackets;if("never"===o)return!1;const r=e.state.selection;if(!p(r))return!0;const c=n(e.block),s=r.anchor.offset;if("quote"===t.kind&&"'"===t.open&&function(t,e){if(e<=0)return!1;const n=t[e-1];return!!n&&/[A-Za-z0-9_]/.test(n)}(c,s))return!1;if("always"===o)return!0;if("beforeWhitespace"===o)return function(t,e){if(e>=t.length)return!0;const n=t[e];return!n||!!/\s/.test(n)||!!F.has(n)}(c,s);if("quote"===t.kind){const t=e.getTokenAt(e.blockId,s);return!t||"string"!==t.type&&"comment"!==t.type}return!0}(s,t)?{kind:"pair",close:s.close}:{kind:"passthrough"}:{kind:"passthrough"}}({state:e,block:c,blockId:r.anchor.blockId,char:t,config:this.resolvedPairing,pairStack:this.pairs,getTokenAt:this.getTokenAt});switch(i.kind){case"pair":return this.buildAutoPairTransaction(e,r.anchor.blockId,i.close,t);case"overtype":return this.buildOvertypeTransaction(e,r.anchor.blockId);case"wrap":return this.buildWrapTransaction(e,r.anchor.blockId,i.open,i.close);case"passthrough":return null}};tryDedentOnCloseBracket(t,e,o){if("brackets"!==this.resolvedIndent.mode)return null;if("}"!==o&&"]"!==o&&")"!==o)return null;const r=t.selection;if(!p(r)||!d(r))return null;const c=n(e),s=r.anchor.offset;if(!function(t,e){const{start:n}=U(t,e);for(let o=n;o<e;o++){const e=t[o];if(" "!==e&&"\t"!==e)return!1}return!0}(c,s))return null;const{start:i}=U(c,s);if(i===s)return null;const a=r.anchor.blockId,l=this.findTrackedCloseAfter(c,s,o,a);if(null!==l)return t.transaction("input").deleteTextAt(a,i,l).setSelection(g(a,i+1)).build();const u=Q(c.slice(i,s),this.resolvedIndent.useSpaces,this.resolvedIndent.spaceCount);if(0===u.removed.length)return null;const f=s-u.removed.length;return t.transaction("input").deleteTextAt(a,f,s).insertText(a,f,o,[]).setSelection(g(a,f+1)).build()}findTrackedCloseAfter(t,e,n,o){for(let r=e;r<t.length;r++){const e=t[r];if(" "!==e&&"\t"!==e&&"\n"!==e){if(e===n){const t=this.pairs.peek(o,r);if(t&&t.char===n)return r}return null}}return null}buildAutoPairTransaction(t,e,n,o){const r=t.selection;if(!p(r))throw new Error("buildAutoPairTransaction requires a text selection");const c=r.anchor.offset,s=`${o}${n}`,i=t.transaction("input").insertText(e,c,s,[]).setSelection(g(e,c+1)).build();return this.pendingPairOps.push({kind:"push",blockId:e,offset:c+1,char:n}),i}buildOvertypeTransaction(t,e){const n=t.selection;if(!p(n))throw new Error("buildOvertypeTransaction requires a text selection");const o=n.anchor.offset;return this.pendingPairOps.push({kind:"take",blockId:e,offset:o}),t.transaction("input").setSelection(g(e,o+1)).build()}buildWrapTransaction(t,e,n,o){const r=t.selection;if(!p(r))throw new Error("buildWrapTransaction requires a text selection");const c=function(t,e){const n=a(t,e);return{fromOffset:n.from.offset,toOffset:n.to.offset}}(r,t.getBlockOrder()),s=a(r,t.getBlockOrder()).from===r.anchor,i=c.fromOffset+1,l=c.toOffset+1,d=s?i:l,u=s?l:i;return t.transaction("input").insertText(e,c.toOffset,o,[]).insertText(e,c.fromOffset,n,[]).setSelection({anchor:{blockId:e,offset:d},head:{blockId:e,offset:u}}).build()}};function Y(t,e){const n=t.getState();if(!p(n.selection))return!1;const o=n.selection,r=n.getBlock(o.anchor.blockId);return!(!r||"code_block"!==r.type)&&e({state:n,sel:o,block:r,blockId:o.anchor.blockId,offset:o.anchor.offset})}function tt(t,e,o,r){const s={Enter:()=>function(t,e){return Y(t,({state:o,block:r,blockId:s,offset:i})=>{if(!d(o.selection))return!1;const a=n(r);if(a.endsWith("\n")&&i===a.length)return function(t,e,n){const o=t.getState(),r=n.length-1,s=c(),i=o.transaction("input").deleteTextAt(e,r,n.length).splitBlock(e,r,s).setBlockType(s,h("paragraph")).setSelection(g(s,0)).build();return t.dispatch(i),!0}(t,s,a);const l=J(e.indent.useSpaces,e.indent.spaceCount);if("brackets"===e.indent.mode&&function(t,e){return function(t,e){if(e<=0||e>=t.length)return!1;const n=t[e-1],o=t[e];return!(!n||!o)&&W[o]===n}(t,e)}(a,i)){const e=X(a,i),n=`\n${e}${l}\n${e}`,r=i+1+e.length+l.length,c=o.transaction("input").insertText(s,i,n,[]).setSelection(g(s,r)).build();return t.dispatch(c),!0}const u=`\n${function(t,e,n,o){if("none"===n)return"";const r=X(t,e);return"keep"===n?r:function(t,e){const n=function(t,e){const{start:n}=U(t,e);for(let o=e-1;o>=n;o--){const e=t[o];if(e&&" "!==e&&"\t"!==e)return e}return""}(t,e);return K.has(n)}(t,e)?r+o:r}(a,i,e.indent.mode,l)}`,p=o.transaction("input").insertText(s,i,u,[]).setSelection(g(s,i+u.length)).build();return t.dispatch(p),!0})}(t,r),Backspace:()=>function(t,e){return Y(t,({state:o,block:r,blockId:c,offset:s})=>{if(!d(o.selection))return!1;if(e.pairing.deletePair&&s>0){const i=n(r),a=i[s-1],l=i[s];if(a&&l&&function(t,e){switch(t){case"(":return")"===e;case"[":return"]"===e;case"{":return"}"===e;case'"':case"'":case"`":return e===t;default:return!1}}(a,l)){const n=e.pairStack.peek(c,s);if(n&&n.char===l){const e=o.transaction("input").deleteTextAt(c,s-1,s+1).setSelection(g(c,s-1)).build();return t.dispatch(e),!0}}}if(0!==s)return!1;const i=o.transaction("input").setBlockType(c,h("paragraph")).setSelection(o.selection).build();return t.dispatch(i),!0})}(t,r),Tab:()=>function(t,e){return Y(t,({state:o,sel:r,block:c,blockId:s,offset:l})=>{const p=J(e.indent.useSpaces,e.indent.spaceCount);if(d(r)){const e=o.transaction("input").insertText(s,l,p,[]).setSelection(g(s,l+p.length)).build();return t.dispatch(e),!0}if(r.anchor.blockId!==s||r.head.blockId!==s)return!1;const f=n(c),h=a(r,o.getBlockOrder()),k=h.from.offset,b=h.to.offset;if(!f.slice(k,b).includes("\n")){const e=o.transaction("input").deleteTextAt(s,k,b).insertText(s,k,p,[]).setSelection(g(s,k+p.length)).build();return t.dispatch(e),!0}const m=function(t,e,n,o){const r=t.lastIndexOf("\n",e-1)+1,c=[];let s=0,i=r;for(;i<n;){c.push({offset:i,text:o}),s++;const e=t.indexOf("\n",i);if(-1===e||e>=n)break;i=e+1}return{inserts:c,totalInserted:s*o.length,lineCount:s,lineStart:r}}(f,k,b,p),v=o.transaction("input");for(let t=m.inserts.length-1;t>=0;t--){const e=m.inserts[t];e&&v.insertText(s,e.offset,e.text,[])}const x=u(r,o.getBlockOrder()),C=m.lineStart,y=b+m.totalInserted,S=x?C:y,w=x?y:C;return v.setSelection(i({blockId:s,offset:S},{blockId:s,offset:w})),t.dispatch(v.build()),m.lineCount>=2&&t.announce(e.locale().indentedNLines(m.lineCount)),!0})}(t,r),"Shift-Tab":()=>function(t,e){return Y(t,({state:o,sel:r,block:c,blockId:s,offset:l})=>{const g=n(c);if(d(r))return et(t,o,s,l,g,e);if(r.anchor.blockId!==s||r.head.blockId!==s)return!1;const p=a(r,o.getBlockOrder()),f=p.from.offset,h=p.to.offset;if(!g.slice(f,h).includes("\n"))return et(t,o,s,l,g,e);const k=function(t,e,n,o,r){const c=t.lastIndexOf("\n",e-1)+1,s=[];let i=0,a=0,l=c;for(;l<n;){a++;const e=Q(t.slice(l),o,r);e.removed.length>0&&(s.push({from:l,to:l+e.removed.length}),i+=e.removed.length);const c=t.indexOf("\n",l);if(-1===c||c>=n)break;l=c+1}return{deletes:s,totalRemoved:i,lineCount:a,lineStart:c}}(g,f,h,e.indent.useSpaces,e.indent.spaceCount);if(0===k.totalRemoved)return!0;const b=o.transaction("input");for(let t=k.deletes.length-1;t>=0;t--){const e=k.deletes[t];e&&b.deleteTextAt(s,e.from,e.to)}const m=u(r,o.getBlockOrder()),v=k.lineStart,x=h-k.totalRemoved,C=m?v:Math.max(v,x),y=m?Math.max(v,x):v;return b.setSelection(i({blockId:s,offset:C},{blockId:s,offset:y})),t.dispatch(b.build()),k.lineCount>=2&&t.announce(e.locale().dedentedNLines(k.lineCount)),!0})}(t,r),Escape:()=>nt(t),ArrowDown:()=>function(t){return Y(t,({state:e,block:o,blockId:r,offset:c})=>!!d(e.selection)&&-1===n(o).indexOf("\n",c)&&(rt(t,e,r),!0))}(t),ArrowUp:()=>function(t){return Y(t,({state:e,block:o,blockId:r,offset:c})=>{if(!d(e.selection))return!1;const s=n(o).indexOf("\n");return!(-1!==s&&c>s)&&ct(t,e,r)})}(t),ArrowRight:()=>function(t){return Y(t,({state:e,block:o,blockId:r,offset:c})=>!!d(e.selection)&&c===n(o).length&&(rt(t,e,r),!0))}(t),ArrowLeft:()=>function(t){return Y(t,({state:e,blockId:n,offset:o})=>!!d(e.selection)&&0===o&&ct(t,e,n))}(t)},{insertAfter:l,toggle:p}=o;l&&(s[l]=()=>function(t){return Y(t,({blockId:e})=>(ot(t,e),!0))}(t)),p&&(s[p]=()=>t.executeCommand("toggleCodeBlock")),t.registerKeymap(s,{priority:"context"})}function et(t,e,n,o,r,c){const{start:s}=U(r,o),i=Q(r.slice(s),c.indent.useSpaces,c.indent.spaceCount);if(0===i.removed.length)return!0;const a=e.transaction("input").deleteTextAt(n,s,s+i.removed.length).setSelection(g(n,Math.max(s,o-i.removed.length))).build();return t.dispatch(a),!0}function nt(t){return Y(t,({state:e,blockId:n})=>(rt(t,e,n),!0))}function ot(t,e){const n=t.getState(),o=n.getBlock(e);if(!o)return;const s=r(o),i=c(),a=n.transaction("command").splitBlock(e,s,i).setBlockType(i,h("paragraph")).setSelection(g(i,0)).build();t.dispatch(a)}function rt(t,e,n){const o=e.getBlockOrder(),r=o.indexOf(n);if(r<o.length-1){const n=o[r+1],c=e.transaction("command").setSelection(g(n,0)).build();return void t.dispatch(c)}ot(t,n)}function ct(t,e,n){const o=e.getBlockOrder(),c=o.indexOf(n);if(c<=0)return!1;const s=o[c-1],i=e.getBlock(s),a=i?r(i):0,l=e.transaction("command").setSelection(g(s,a)).build();return t.dispatch(l),!0}function st(t,n){const o=t.getState(),c=o.selection;if(!p(c))return!1;const i=o.getBlock(c.anchor.blockId);if(!i||"code_block"===i.type)return!1;const a={language:n.defaultLanguage??"",backgroundColor:""},l=o.transaction("command");return function(t,n){if(0===r(n))return;const o=s(n);let c=0;for(const r of o)if(e(r)){if(r.text.length>0)for(const e of r.marks)t.removeMark(n.id,c,c+r.text.length,e);c+=r.text.length}else c+=1}(l,i),l.setBlockType(c.anchor.blockId,h("code_block"),a).setSelection(g(c.anchor.blockId,0)),t.dispatch(l.build()),!0}function it(e,n){const r=m(e.doc,n);if(!r)return null;const s=S(r),i=v(e,s),a=x(i,n);if(a<0)return null;const l=e.transaction("command");if(1===i.length){const t=c();return l.insertNode(s,0,o(t)),l.removeNode(s,1),l.setSelection(g(t,0)),l.build()}l.removeNode(s,a);const d=function(e,n,r,s){const i=r[s-1];if(i&&t(i)){const t=C(e,i.id,"end");if(t)return t}const a=r[s+1];if(a&&t(a)){const t=C(e,a.id,"start");if(t)return t}const l=r[s],d=y(e,"start",l&&t(l)?l.id:void 0);if(d)return d;const u=c();return n.insertNode([],0,o(u)),g(u,0)}(e,l,i,a);return l.setSelection(d),l.build()}var at=class{bundles=/* @__PURE__ */new Map;listeners=[];register(t){this.bundles.set(t.id,t);for(const e of this.listeners)e(t)}onRegister(t){this.listeners.push(t);for(const e of this.bundles.values())t(e)}get(t){return this.bundles.get(t)}getAll(){return[...this.bundles.values()]}},lt={insertAfter:"Mod-Enter",toggle:"Mod-Shift-M"},dt={defaultLanguage:"",useSpaces:!1,spaceCount:2,showCopyButton:!0},ut=new A("codeBlock"),gt=new A("syntaxHighlighter"),pt=class{languageMap=/* @__PURE__ */new Map;constructor(t){if(t)for(const e of t)this.registerLanguageInternal(e)}registerLanguage(t){this.registerLanguageInternal(t)}tokenize(t,e){const n=this.languageMap.get(e.toLowerCase());if(!n)return[];const o=[];for(const r of N(t,n))o.push({from:r.from,to:r.to,type:r.type});return o}getSupportedLanguages(){const t=/* @__PURE__ */new Set;for(const e of this.languageMap.values()){t.add(e.name);for(const n of e.aliases)t.add(n)}return[...t]}registerLanguageInternal(t){this.languageMap.set(t.name.toLowerCase(),t);for(const e of t.aliases)this.languageMap.set(e.toLowerCase(),t)}},ft={label:"Code Block",tooltip:t=>t?`Code Block (${t})`:"Code Block",enteredCodeBlock:"Entered code block. Press Escape to exit.",leftCodeBlock:"Left code block.",copyCodeAria:"Copy code",escToExit:"Esc to exit",codeBlockAriaLabel:t=>`${t} code block. Press Escape to exit.`,copiedToClipboard:"Copied to clipboard",copyFailed:"Failed to copy code",deleteCodeBlockAria:"Delete code block",deletedCodeBlock:"Code block deleted",selectLanguageAria:"Select language",languageChanged:t=>`Language changed to ${t}`,plainText:"plain",indentedNLines:t=>1===t?"1 line indented":`${t} lines indented`,dedentedNLines:t=>1===t?"1 line dedented":`${t} lines dedented`},ht=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar--Isa9OHJ.mjs"),"./locales/de.ts":()=>import("./de-Dl4QFHMa.mjs"),"./locales/es.ts":()=>import("./es-DD01rZ6N.mjs"),"./locales/fr.ts":()=>import("./fr-CfhyYN-t.mjs"),"./locales/hi.ts":()=>import("./hi-B2YB3Bo4.mjs"),"./locales/pt.ts":()=>import("./pt-DYMyMgKQ.mjs"),"./locales/ru.ts":()=>import("./ru-l73diFXn.mjs"),"./locales/zh.ts":()=>import("./zh-Baxh6v0j.mjs")});async function kt(t){return L(ht,t,ft)}var bt='[role="option"]';function mt(t,e,n,o){const r=document.createElement("div");r.className="notectl-language-picker__option",r.setAttribute("role","option"),r.setAttribute("data-language",n),r.setAttribute("aria-selected",String(o)),r.setAttribute("tabindex",o?"0":"-1"),r.textContent=e,t.appendChild(r)}function vt(t,e,n,o){const r=t.getState(),c=r.getBlock(e);if(!c||"code_block"!==c.type)return;const s=r.getNodePath(e);if(!s)return;const i={...c.attrs,[n]:o},a=r.transaction("command").setNodeAttr(s,i).build();t.dispatch(a)}var xt=class{entries=/* @__PURE__ */new Map;getTokens(t,e,n,o){const r=this.entries.get(t);if(r&&r.text===e&&r.language===n)return r.tokens;const c=o?.tokenize(e,n)??[];return this.entries.set(t,{text:e,language:n,tokens:c}),c}findTokenAt(t,e){const n=this.entries.get(t);if(!n)return;const o=n.tokens;let r=0,c=o.length-1;for(;r<=c;){const t=r+c>>>1,n=o[t];if(!n)return;if(e<n.from)c=t-1;else{if(!(e>=n.to))return n;r=t+1}}}retain(t){for(const e of this.entries.keys())t.has(e)||this.entries.delete(e)}clear(){this.entries.clear()}},Ct=class{id="code-block";name="Code Block";priority=36;config;resolvedIndent;resolvedPairing;resolvedKeymap;context=null;locale;highlighter=null;tokenCache=new xt;autoPair;constructor(t){this.config={...dt,...t},this.resolvedIndent=function(t){const e=t.indent?.useSpaces??t.useSpaces??false,n=t.indent?.spaceCount??t.spaceCount??2,o=Math.max(1,Math.min(16,Math.trunc(n)));return{mode:t.indent?.mode??"brackets",useSpaces:e,spaceCount:o}}(this.config),this.resolvedPairing=function(t){const e=t.pairing;return{brackets:e?.brackets??"languageDefined",quotes:e?.quotes??"languageDefined",overtype:e?.overtype??true,deletePair:e?.deletePair??true,surround:e?.surround??"languageDefined"}}(this.config),this.resolvedKeymap={...lt,...t?.keymap},this.autoPair=new G({resolvedIndent:this.resolvedIndent,resolvedPairing:this.resolvedPairing,getTokenAt:(t,e)=>this.tokenCache.findTokenAt(t,e),getCompositionState:()=>this.context?.getCompositionState()??null})}async init(t){this.locale=await M(t,this.config.locale,ft,kt),t.registerStyleSheet(H),this.context=t,this.highlighter=function(t,e,n){const o=e.highlighter??new pt,r=new at;return r.onRegister(t=>{t.highlighting&&o.registerLanguage&&(o.registerLanguage(t.highlighting),n.clear())}),t.registerService(j,r),r.register($),r.register(E),r.register(z),r.register(D),t.registerService(gt,{registerLanguage:t=>{o.registerLanguage?.(t),n.clear()},getSupportedLanguages:()=>o.getSupportedLanguages(),tokenize:(t,e)=>o.tokenize(t,e),getTokenAt:(t,e)=>n.findTokenAt(t,e)}),o}(t,this.config,this.tokenCache),function(t){t.registerNodeSpec({type:"code_block",group:"block",content:{allow:["text"]},selectable:!0,attrs:{language:{default:""},backgroundColor:{default:""}},toDOM(t){const e=k("pre",t.id);e.className="notectl-code-block",e.setAttribute("dir","ltr"),e.setAttribute("part","code-block");const n=document.createElement("code");return n.className="notectl-code-block__content",n.setAttribute("part","code-block-content"),e.appendChild(n),e},toHTML(t,e,n){const o=b(t.attrs?.language??""),r=b(t.attrs?.backgroundColor??""),c=o?` class="language-${o}"`:"";return`<pre dir="ltr"${r?n?.styleAttr(`background-color: ${r}`)??` style="background-color: ${r}"`:""}><code${c}>${e||""}</code></pre>`},parseHTML:[{tag:"pre",getAttrs(t){const e=t.querySelector("code"),n=e?.className.match(/language-(\S+)/)?.[1]??"";return{language:(e?.getAttribute("data-language")??"")||n}}}],sanitize:{tags:["pre","code"],attrs:["data-language","class","style"]}})}(t),this.registerNodeView(t),function(t,e){t.registerCommand("toggleCodeBlock",()=>function(t,e){const n=t.getState();if(!p(n.selection))return!1;const o=n.getBlock(n.selection.anchor.blockId);if(!o)return!1;if("code_block"===o.type){const e=n.transaction("command").setBlockType(n.selection.anchor.blockId,h("paragraph")).setSelection(n.selection).build();return t.dispatch(e),!0}return st(t,e)}(t,e)),t.registerCommand("insertCodeBlock",()=>st(t,e)),t.registerCommand("setCodeBlockLanguage",()=>!1),t.registerCommand("setCodeBlockBackground",()=>!1),t.registerCommand("exitCodeBlock",()=>nt(t)),t.registerCommand("deleteCodeBlock",()=>function(t){const e=t.getState();if(!p(e.selection))return!1;const n=e.getBlock(e.selection.anchor.blockId);if(!n||"code_block"!==n.type)return!1;const o=it(e,n.id);return!!o&&(t.dispatch(o),!0)}(t))}(t,this.config),tt(t,this.config,this.resolvedKeymap,{indent:this.resolvedIndent,pairing:this.resolvedPairing,pairStack:this.autoPair.pairStack,locale:()=>this.locale}),function(t){t.registerInputRule({pattern:/^```(\w*) $/,handler:(t,e,n,o)=>{const r=t.selection;if(!p(r))return null;if(!d(r))return null;const c=t.getBlock(r.anchor.blockId);if(!c||"paragraph"!==c.type)return null;const s={language:e[1]??"",backgroundColor:""};return t.transaction("input").deleteTextAt(r.anchor.blockId,n,n+e[0].length).setBlockType(r.anchor.blockId,h("code_block"),s).setSelection(g(r.anchor.blockId,0)).build()}})}(t),function(t,e,n){t.registerToolbarItem({id:"code_block",group:"block",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14z"/><path d="M11 14.17L8.83 12 11 9.83 9.59 8.41 6 12l3.59 3.59L11 14.17zm3.41 1.42L18 12l-3.59-3.59L13 9.83 15.17 12 13 14.17l1.41 1.42z"/></svg>',label:e.label,tooltip:e.tooltip(n?P(n):void 0),command:"toggleCodeBlock",isActive:t=>!!p(t.selection)&&"code_block"===t.getBlock(t.selection.anchor.blockId)?.type})}(t,this.locale,this.resolvedKeymap.toggle),function(t){t.registerMiddleware((t,e,n)=>{if(!t.steps.some(t=>"addMark"===t.type&&"code_block"===e.getBlock(t.blockId)?.type))return void n(t);const o=t.steps.filter(t=>"addMark"!==t.type||"code_block"!==e.getBlock(t.blockId)?.type);n({...t,steps:o})},{name:"code-block:mark-guard",priority:50})}(t),function(t,e,n){t.registerService(ut,{setLanguage(e,n){vt(t,e,"language",n)},getLanguage(t){const e=n();if(!e)return"";const o=e.getState().getBlock(t);return o&&"code_block"===o.type?o.attrs?.language??"":""},setBackground(e,n){vt(t,e,"backgroundColor",n)},getBackground(t){const e=n();if(!e)return"";const o=e.getState().getBlock(t);return o&&"code_block"===o.type?o.attrs?.backgroundColor??"":""},isCodeBlock(t){const e=n();return!!e&&"code_block"===e.getState().getBlock(t)?.type},getSupportedLanguages(){const t=e();return t?t.getSupportedLanguages():[]}})}(t,()=>this.highlighter,()=>this.context),function(t){t.registerPasteInterceptor((t,e,n)=>{if(!t)return null;if(!p(n.selection))return null;const o=n.getBlock(n.selection.anchor.blockId);if(!o||"code_block"!==o.type)return null;const r=n.transaction("paste");let c=n.selection.anchor.blockId,s=n.selection.anchor.offset;if(!d(n.selection)){const t=f(n,r);t&&(c=t,s=0)}return r.insertText(c,s,t,[]),r.setSelection(g(c,s+t.length)),r.build()},{name:"code-block:paste",priority:10})}(t),t.registerTextInputInterceptor(this.autoPair.handleTextInput,{name:"code-block:auto-pair",priority:10}),function(t){const e=t.getSchemaRegistry(),n=e.getNodeSpec("table_cell");if(!n?.content)return;const o=n.content.allow??[];o.includes("code_block")||(e.removeNodeSpec("table_cell"),e.registerNodeSpec({...n,content:{...n.content,allow:[...o,"code_block"]}}))}(t)}destroy(){this.context=null,this.highlighter=null,this.tokenCache.clear(),this.autoPair.clear()}onStateChange(t,e,n){if(this.autoPair.syncOnStateChange(e,n),!this.context)return;const o=p(t.selection)?t.selection.anchor.blockId:null,r=p(e.selection)?e.selection.anchor.blockId:null,c=o?t.getBlock(o):void 0,s=r?e.getBlock(r):void 0,i="code_block"===c?.type,a="code_block"===s?.type;!i&&a?this.context.announce(this.locale.enteredCodeBlock):i&&!a&&this.context.announce(this.locale.leftCodeBlock)}decorations(t){return function(t,e){const o=[],r=function(t){if(!p(t.selection))return null;const e=t.selection.anchor.blockId;return"code_block"===t.getBlock(e)?.type?e:null}(t);if(r&&o.push(w(r,{class:"notectl-code-block--focused"})),e.highlighter){const r=/* @__PURE__ */new Set;for(const c of t.getBlockOrder()){const s=t.getBlock(c);if(!s||"code_block"!==s.type)continue;const i=s.attrs?.language??"";if(!i)continue;const a=n(s);if(!a)continue;r.add(c);const l=e.tokenCache.getTokens(c,a,i,e.highlighter);for(const t of l)o.push(_(c,t.from,t.to,{class:`notectl-token--${t.type}`}))}e.tokenCache.retain(r)}return 0===o.length?I.empty:I.create(o)}(t,{highlighter:this.highlighter,tokenCache:this.tokenCache})}registerNodeView(t){const e=new O(t.getContainer()),o=this.highlighter,r={popupManager:e,getSupportedLanguages:()=>o?.getSupportedLanguages()??[]};t.registerNodeView("code_block",function(t,e=ft,o){return(r,c,s)=>{const i=document.createElement("pre");i.className="notectl-code-block",i.setAttribute("data-block-id",r.id),i.setAttribute("dir","ltr"),i.setAttribute("role","group"),i.setAttribute("aria-roledescription","code block"),i.setAttribute("part","code-block");const a=document.createElement("div");a.className="notectl-code-block__header",a.setAttribute("contenteditable","false"),a.setAttribute("part","code-block-header");const l=document.createElement("button");l.className="notectl-code-block__language-btn",l.type="button",l.setAttribute("aria-haspopup","listbox"),l.setAttribute("aria-expanded","false"),l.setAttribute("aria-label",e.selectLanguageAria);let d=null;!1!==t.showCopyButton&&(d=document.createElement("button"),d.className="notectl-code-block__copy",d.setAttribute("aria-label",e.copyCodeAria),d.setAttribute("data-notectl-no-print",""),d.type="button",d.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14"><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>');const u=document.createElement("button");u.className="notectl-code-block__delete",u.setAttribute("aria-label",e.deleteCodeBlockAria),u.title=e.deleteCodeBlockAria,u.setAttribute("data-notectl-no-print",""),u.type="button",u.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>';const g=document.createElement("span");g.className="notectl-sr-only",g.setAttribute("aria-live","assertive"),g.setAttribute("aria-atomic","true");const p=document.createElement("div");p.className="notectl-code-block__actions",d&&p.appendChild(d),p.appendChild(u),a.appendChild(l),a.appendChild(p),a.appendChild(g);const f=document.createElement("code");f.className="notectl-code-block__content",f.setAttribute("part","code-block-content");const h=document.createElement("div");h.className="notectl-code-block__esc-hint",h.setAttribute("contenteditable","false"),h.setAttribute("aria-hidden","true"),h.setAttribute("data-notectl-no-print",""),h.textContent=e.escToExit,i.appendChild(a),i.appendChild(f),i.appendChild(h),t.background&&B(i,"--notectl-code-block-bg",t.background),t.headerBackground&&B(i,"--notectl-code-block-header-bg",t.headerBackground),t.textColor&&B(i,"--notectl-code-block-color",t.textColor),t.headerColor&&B(i,"--notectl-code-block-header-color",t.headerColor);let k=r.id;function b(t){const n=t.attrs?.language??"",r=n||e.plainText;l.innerHTML="";const c=document.createElement("span");if(c.className="notectl-code-block__language",c.textContent=r,l.appendChild(c),o){const t=document.createElement("span");t.className="notectl-code-block__chevron",t.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="10" height="10"><path d="M4 6l4 4 4-4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',l.appendChild(t)}i.setAttribute("aria-label",e.codeBlockAriaLabel(r)),n?f.setAttribute("data-language",n):f.removeAttribute("data-language"),B(i,"backgroundColor",(t.attrs?.backgroundColor??"")||"")}function m(t){g.textContent=t,setTimeout(()=>{g.textContent=""},1e3)}return b(r),d&&d.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const o=c().getBlock(k);o&&function(t){const e=globalThis.navigator?.clipboard;return e&&"function"==typeof e.writeText?e.writeText(t):Promise.reject(/* @__PURE__ */new Error("Clipboard API unavailable"))}(n(o)).then(()=>m(e.copiedToClipboard),()=>m(e.copyFailed))}),u.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const n=it(c(),k);n&&(g.textContent=e.deletedCodeBlock,s(n))}),o&&l.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const n=c().getBlock(k);if(!n)return;const r=n.attrs?.language??"";!function(t){const{anchor:e,languages:n,currentLanguage:o,onSelect:r,popupManager:c,locale:s}=t;c.open({anchor:e,ariaRole:"listbox",ariaLabel:s.selectLanguageAria,className:"notectl-language-picker",position:"below-start",restoreFocusTo:e,content(t,e){const c=o.toLowerCase();mt(t,s.plainText,"",""===c);const i=[...n].sort((t,e)=>t.localeCompare(e));for(const n of i)mt(t,n,n,c===n.toLowerCase());q({container:t,itemSelector:bt,onSelect(t){r(t.getAttribute("data-language")??""),e()},onClose(){e()}}),t.addEventListener("click",t=>{const n=t.target.closest(bt);n&&(r(n.getAttribute("data-language")??""),e())})},onClose(){e.setAttribute("aria-expanded","false")}}),e.setAttribute("aria-expanded","true")}({anchor:l,languages:o.getSupportedLanguages(),currentLanguage:r,locale:e,popupManager:o.popupManager,onSelect(t){if(t===r)return;const n=c(),o=n.getBlock(k);if(!o)return;const i=n.getNodePath(k);if(!i)return;const a={...o.attrs,language:t};s(n.transaction("command").setNodeAttr(i,a).build());const l=t||e.plainText;m(e.languageChanged(l))}})}),{dom:i,contentDOM:f,update:t=>"code_block"===t.type&&(k=t.id,i.setAttribute("data-block-id",t.id),b(t),!0),selectNode(){i.classList.add("notectl-code-block--selected")},deselectNode(){i.classList.remove("notectl-code-block--selected")},destroy(){}}}}(this.config,this.locale,r))}};export{ut as a,pt as i,ft as n,gt as o,kt as r,Ct as t};
|
|
2
|
-
//# sourceMappingURL=CodeBlockPlugin-3V2K3RBe.mjs.map
|