@notectl/core 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -10
- package/dist/chunks/{AttrRegistry-B2AGfTE0.mjs → AttrRegistry-iNpjvcSG.mjs} +2 -2
- package/dist/chunks/{AttrRegistry-B2AGfTE0.mjs.map → AttrRegistry-iNpjvcSG.mjs.map} +1 -1
- package/dist/chunks/AttributedMarkCommands-BY1BSYWM.mjs +2 -0
- package/dist/chunks/AttributedMarkCommands-BY1BSYWM.mjs.map +1 -0
- package/dist/chunks/BlockInsertion-BJFhE0jA.mjs +2 -0
- package/dist/chunks/BlockInsertion-BJFhE0jA.mjs.map +1 -0
- package/dist/chunks/{ColorPickerPopup-DRzFvt7o.mjs → ColorPickerPopup-D6XjShhv.mjs} +2 -2
- package/dist/chunks/ColorPickerPopup-D6XjShhv.mjs.map +1 -0
- package/dist/chunks/CommandHelpers-M6mPS6Ww.mjs +2 -0
- package/dist/chunks/CommandHelpers-M6mPS6Ww.mjs.map +1 -0
- package/dist/chunks/Commands-D_gMCnVa.mjs +2 -0
- package/dist/chunks/Commands-D_gMCnVa.mjs.map +1 -0
- package/dist/chunks/Document-3pNX7ear.mjs +2 -0
- package/dist/chunks/Document-3pNX7ear.mjs.map +1 -0
- package/dist/chunks/DocumentParser-LvzDQOd1.mjs +2 -0
- package/dist/chunks/DocumentParser-LvzDQOd1.mjs.map +1 -0
- package/dist/chunks/DomUtils-CznMAZZg.mjs +2 -0
- package/dist/chunks/DomUtils-CznMAZZg.mjs.map +1 -0
- package/dist/chunks/HTMLUtils-Cxy99Ak2.mjs +2 -0
- package/dist/chunks/HTMLUtils-Cxy99Ak2.mjs.map +1 -0
- package/dist/chunks/HeadingPlugin-BmkeUXj8.mjs +2 -0
- package/dist/chunks/HeadingPlugin-BmkeUXj8.mjs.map +1 -0
- package/dist/chunks/MarkCommands-CeCa4WSC.mjs +2 -0
- package/dist/chunks/MarkCommands-CeCa4WSC.mjs.map +1 -0
- package/dist/chunks/NavigationQueries-11qe4j9x.mjs +2 -0
- package/dist/chunks/NavigationQueries-11qe4j9x.mjs.map +1 -0
- package/dist/chunks/NodeResolver-z0ReCR34.mjs +2 -0
- package/dist/chunks/NodeResolver-z0ReCR34.mjs.map +1 -0
- package/dist/chunks/NodeSelectionCommands-CXrOcPtG.mjs +2 -0
- package/dist/chunks/NodeSelectionCommands-CXrOcPtG.mjs.map +1 -0
- package/dist/chunks/NotectlEditor-BJD7-FFx.mjs +4 -0
- package/dist/chunks/NotectlEditor-BJD7-FFx.mjs.map +1 -0
- package/dist/chunks/PluginHelpers-CdPR0MuT.mjs +2 -0
- package/dist/chunks/PluginHelpers-CdPR0MuT.mjs.map +1 -0
- package/dist/chunks/PopupManager-0b_Q0m7K.mjs +2 -0
- package/dist/chunks/PopupManager-0b_Q0m7K.mjs.map +1 -0
- package/dist/chunks/PrintTypes-DukwDSWS.mjs +2 -0
- package/dist/chunks/{PrintTypes-ehbL7ipA.mjs.map → PrintTypes-DukwDSWS.mjs.map} +1 -1
- package/dist/chunks/{RangeIterator-CNI6smOg.mjs → RangeIterator-XFN5FaYf.mjs} +2 -2
- package/dist/chunks/{RangeIterator-CNI6smOg.mjs.map → RangeIterator-XFN5FaYf.mjs.map} +1 -1
- package/dist/chunks/{Selection-6-W6Flxc.mjs → Selection-DhbizDM4.mjs} +2 -2
- package/dist/chunks/{Selection-6-W6Flxc.mjs.map → Selection-DhbizDM4.mjs.map} +1 -1
- package/dist/chunks/SelectionTransactions-DzIZxcuN.mjs +2 -0
- package/dist/chunks/{SelectionTransactions-q71GEzgE.mjs.map → SelectionTransactions-DzIZxcuN.mjs.map} +1 -1
- package/dist/chunks/{TextDirectionLocale-DB_aqrMg.mjs → TextDirectionLocale-CKz0ZrH_.mjs} +2 -2
- package/dist/chunks/{TextDirectionLocale-DB_aqrMg.mjs.map → TextDirectionLocale-CKz0ZrH_.mjs.map} +1 -1
- package/dist/chunks/XmlPatterns-DxQXGjP8.mjs +2 -0
- package/dist/chunks/XmlPatterns-DxQXGjP8.mjs.map +1 -0
- package/dist/chunks/ar-b6VdnxAs.mjs +2 -0
- package/dist/chunks/ar-b6VdnxAs.mjs.map +1 -0
- package/dist/chunks/de-fXvs5vQT.mjs +2 -0
- package/dist/chunks/de-fXvs5vQT.mjs.map +1 -0
- package/dist/chunks/es-BTqy_aQ4.mjs +2 -0
- package/dist/chunks/es-BTqy_aQ4.mjs.map +1 -0
- package/dist/chunks/fr-VdiCNF4J.mjs +2 -0
- package/dist/chunks/fr-VdiCNF4J.mjs.map +1 -0
- package/dist/chunks/hi-BdtVhAzs.mjs +2 -0
- package/dist/chunks/hi-BdtVhAzs.mjs.map +1 -0
- package/dist/chunks/index-C-L4awHz.mjs +2 -0
- package/dist/chunks/index-C-L4awHz.mjs.map +1 -0
- package/dist/chunks/index-Cs9iqxhF.mjs +2 -0
- package/dist/chunks/index-Cs9iqxhF.mjs.map +1 -0
- package/dist/chunks/pt-K0BUlM9X.mjs +2 -0
- package/dist/chunks/pt-K0BUlM9X.mjs.map +1 -0
- package/dist/chunks/ru-Tzd5N37W.mjs +2 -0
- package/dist/chunks/ru-Tzd5N37W.mjs.map +1 -0
- package/dist/chunks/zh-Di3WqY4_.mjs +2 -0
- package/dist/chunks/zh-Di3WqY4_.mjs.map +1 -0
- package/dist/{input → commands}/BlockInsertion.d.ts +14 -1
- package/dist/commands/BlockInsertion.d.ts.map +1 -0
- package/dist/commands/CommandHelpers.d.ts +17 -2
- package/dist/commands/CommandHelpers.d.ts.map +1 -1
- package/dist/commands/Commands.d.ts.map +1 -1
- package/dist/commands/GapCursorCommands.d.ts.map +1 -1
- package/dist/commands/NodeSelectionCommands.d.ts +3 -8
- package/dist/commands/NodeSelectionCommands.d.ts.map +1 -1
- package/dist/commands/PasteCommand.d.ts.map +1 -1
- package/dist/editor/ContentSerializer.d.ts.map +1 -1
- package/dist/editor/EditorConfig.d.ts +50 -0
- package/dist/editor/EditorConfig.d.ts.map +1 -0
- package/dist/editor/EditorConfigController.d.ts +1 -1
- package/dist/editor/EditorConfigController.d.ts.map +1 -1
- package/dist/editor/EditorDOM.d.ts.map +1 -1
- package/dist/editor/EditorInitializer.d.ts +37 -0
- package/dist/editor/EditorInitializer.d.ts.map +1 -0
- package/dist/editor/EditorLifecycleCoordinator.d.ts +6 -1
- package/dist/editor/EditorLifecycleCoordinator.d.ts.map +1 -1
- package/dist/editor/EditorThemeController.d.ts.map +1 -1
- package/dist/editor/NotectlEditor.d.ts +13 -51
- package/dist/editor/NotectlEditor.d.ts.map +1 -1
- package/dist/editor/PluginBootstrapper.d.ts +1 -1
- package/dist/editor/PluginBootstrapper.d.ts.map +1 -1
- package/dist/editor/styles/code-block.d.ts +1 -1
- package/dist/editor/styles/code-block.d.ts.map +1 -1
- package/dist/editor/theme/ThemeEngine.d.ts.map +1 -1
- package/dist/editor/theme/ThemeTokens.d.ts +17 -1
- package/dist/editor/theme/ThemeTokens.d.ts.map +1 -1
- package/dist/full.d.ts +1 -0
- package/dist/full.d.ts.map +1 -1
- package/dist/full.mjs +1 -1
- package/dist/html.mjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/input/ClipboardHandler.d.ts +5 -0
- package/dist/input/ClipboardHandler.d.ts.map +1 -1
- package/dist/input/HTMLParser.d.ts +9 -5
- package/dist/input/HTMLParser.d.ts.map +1 -1
- package/dist/input/InputHandler.d.ts +1 -0
- package/dist/input/InputHandler.d.ts.map +1 -1
- package/dist/input/InputManager.d.ts +2 -0
- package/dist/input/InputManager.d.ts.map +1 -1
- package/dist/input/InternalClipboard.d.ts +2 -22
- package/dist/input/InternalClipboard.d.ts.map +1 -1
- package/dist/input/PasteHTMLHandler.d.ts +25 -0
- package/dist/input/PasteHTMLHandler.d.ts.map +1 -0
- package/dist/input/PasteHandler.d.ts +7 -25
- package/dist/input/PasteHandler.d.ts.map +1 -1
- package/dist/input/PasteRichBlockHandler.d.ts +23 -0
- package/dist/input/PasteRichBlockHandler.d.ts.map +1 -0
- package/dist/input/SelectionDocument.d.ts +10 -0
- package/dist/input/SelectionDocument.d.ts.map +1 -0
- package/dist/model/Document.d.ts.map +1 -1
- package/dist/model/HTMLUtils.d.ts +2 -0
- package/dist/model/HTMLUtils.d.ts.map +1 -1
- package/dist/model/PasteInterceptor.d.ts +21 -0
- package/dist/model/PasteInterceptor.d.ts.map +1 -0
- package/dist/model/RichBlockData.d.ts +34 -0
- package/dist/model/RichBlockData.d.ts.map +1 -0
- package/dist/model/SchemaRegistry.d.ts +2 -0
- package/dist/model/SchemaRegistry.d.ts.map +1 -1
- package/dist/notectl-core.mjs +1 -1
- package/dist/notectl-core.umd.js +1 -1
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/Plugin.d.ts +3 -0
- package/dist/plugins/Plugin.d.ts.map +1 -1
- package/dist/plugins/PluginContextFactory.d.ts +73 -0
- package/dist/plugins/PluginContextFactory.d.ts.map +1 -0
- package/dist/plugins/PluginManager.d.ts +12 -0
- package/dist/plugins/PluginManager.d.ts.map +1 -1
- package/dist/plugins/alignment/AlignmentPlugin.d.ts.map +1 -1
- package/dist/plugins/alignment.mjs +1 -1
- package/dist/plugins/alignment.mjs.map +1 -1
- package/dist/plugins/blockquote/BlockquoteKeyboardHandlers.d.ts.map +1 -1
- package/dist/plugins/blockquote/BlockquotePlugin.d.ts.map +1 -1
- package/dist/plugins/blockquote.mjs +1 -1
- package/dist/plugins/blockquote.mjs.map +1 -1
- package/dist/plugins/caret-navigation/CaretNavigationPlugin.d.ts.map +1 -1
- package/dist/plugins/caret-navigation.mjs +1 -1
- package/dist/plugins/code-block/CodeBlockKeyboardHandlers.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts +5 -0
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockTypes.d.ts +7 -0
- package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -1
- package/dist/plugins/code-block/highlighter/RegexTokenizer.d.ts +14 -0
- package/dist/plugins/code-block/highlighter/RegexTokenizer.d.ts.map +1 -0
- package/dist/plugins/code-block/highlighter/TokenizerTypes.d.ts +15 -0
- package/dist/plugins/code-block/highlighter/TokenizerTypes.d.ts.map +1 -0
- package/dist/plugins/code-block/highlighter/languages/index.d.ts +3 -0
- package/dist/plugins/code-block/highlighter/languages/index.d.ts.map +1 -0
- package/dist/plugins/code-block/highlighter/languages/json.d.ts +3 -0
- package/dist/plugins/code-block/highlighter/languages/json.d.ts.map +1 -0
- package/dist/plugins/code-block/highlighter/languages/xml.d.ts +3 -0
- package/dist/plugins/code-block/highlighter/languages/xml.d.ts.map +1 -0
- package/dist/plugins/code-block/index.d.ts +5 -1
- package/dist/plugins/code-block/index.d.ts.map +1 -1
- package/dist/plugins/code-block.mjs +1 -1
- package/dist/plugins/code-block.mjs.map +1 -1
- package/dist/plugins/font/FontPlugin.d.ts.map +1 -1
- package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -1
- package/dist/plugins/font-size.mjs +1 -1
- package/dist/plugins/font-size.mjs.map +1 -1
- package/dist/plugins/font.mjs +1 -1
- package/dist/plugins/font.mjs.map +1 -1
- package/dist/plugins/gap-cursor/GapCursorPlugin.d.ts.map +1 -1
- package/dist/plugins/gap-cursor.mjs +1 -1
- package/dist/plugins/hard-break.mjs +1 -1
- package/dist/plugins/heading/HeadingInputRules.d.ts.map +1 -1
- package/dist/plugins/heading/HeadingKeyboardHandlers.d.ts.map +1 -1
- package/dist/plugins/heading/HeadingPlugin.d.ts.map +1 -1
- package/dist/plugins/heading.mjs +1 -1
- package/dist/plugins/highlight/HighlightPlugin.d.ts.map +1 -1
- package/dist/plugins/highlight.mjs +1 -1
- package/dist/plugins/highlight.mjs.map +1 -1
- package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts.map +1 -1
- package/dist/plugins/horizontal-rule.mjs +1 -1
- package/dist/plugins/horizontal-rule.mjs.map +1 -1
- package/dist/plugins/image/ImageCommands.d.ts.map +1 -1
- package/dist/plugins/image/ImagePlugin.d.ts +0 -1
- package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
- package/dist/plugins/image/ImagePopup.d.ts +11 -0
- package/dist/plugins/image/ImagePopup.d.ts.map +1 -0
- package/dist/plugins/image.mjs +1 -1
- package/dist/plugins/image.mjs.map +1 -1
- package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
- package/dist/plugins/link.mjs +1 -1
- package/dist/plugins/link.mjs.map +1 -1
- package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
- package/dist/plugins/list.mjs +1 -1
- package/dist/plugins/list.mjs.map +1 -1
- package/dist/plugins/print/PrintPlugin.d.ts.map +1 -1
- package/dist/plugins/print.mjs +1 -1
- package/dist/plugins/print.mjs.map +1 -1
- package/dist/plugins/shared/ColorMarkOperations.d.ts +1 -2
- package/dist/plugins/shared/ColorMarkOperations.d.ts.map +1 -1
- package/dist/plugins/shared/ColorPickerPopup.d.ts +1 -8
- package/dist/plugins/shared/ColorPickerPopup.d.ts.map +1 -1
- package/dist/plugins/shared/PluginHelpers.d.ts +8 -0
- package/dist/plugins/shared/PluginHelpers.d.ts.map +1 -1
- package/dist/plugins/shared/PopupManager.d.ts.map +1 -1
- package/dist/plugins/shared/XmlPatterns.d.ts +10 -0
- package/dist/plugins/shared/XmlPatterns.d.ts.map +1 -0
- 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/shared.mjs.map +1 -1
- package/dist/plugins/smart-paste/SmartPasteLocale.d.ts +7 -0
- package/dist/plugins/smart-paste/SmartPasteLocale.d.ts.map +1 -0
- package/dist/plugins/smart-paste/SmartPastePlugin.d.ts +19 -0
- package/dist/plugins/smart-paste/SmartPastePlugin.d.ts.map +1 -0
- package/dist/plugins/smart-paste/SmartPasteTypes.d.ts +24 -0
- package/dist/plugins/smart-paste/SmartPasteTypes.d.ts.map +1 -0
- package/dist/plugins/smart-paste/detectors/JsonDetector.d.ts +6 -0
- package/dist/plugins/smart-paste/detectors/JsonDetector.d.ts.map +1 -0
- package/dist/plugins/smart-paste/detectors/XmlDetector.d.ts +26 -0
- package/dist/plugins/smart-paste/detectors/XmlDetector.d.ts.map +1 -0
- package/dist/plugins/smart-paste/index.d.ts +7 -0
- package/dist/plugins/smart-paste/index.d.ts.map +1 -0
- package/dist/plugins/smart-paste/locales/ar.d.ts +4 -0
- package/dist/plugins/smart-paste/locales/ar.d.ts.map +1 -0
- package/dist/plugins/smart-paste/locales/de.d.ts +4 -0
- package/dist/plugins/smart-paste/locales/de.d.ts.map +1 -0
- package/dist/plugins/smart-paste/locales/es.d.ts +4 -0
- package/dist/plugins/smart-paste/locales/es.d.ts.map +1 -0
- package/dist/plugins/smart-paste/locales/fr.d.ts +4 -0
- package/dist/plugins/smart-paste/locales/fr.d.ts.map +1 -0
- package/dist/plugins/smart-paste/locales/hi.d.ts +4 -0
- package/dist/plugins/smart-paste/locales/hi.d.ts.map +1 -0
- package/dist/plugins/smart-paste/locales/pt.d.ts +4 -0
- package/dist/plugins/smart-paste/locales/pt.d.ts.map +1 -0
- package/dist/plugins/smart-paste/locales/ru.d.ts +4 -0
- package/dist/plugins/smart-paste/locales/ru.d.ts.map +1 -0
- package/dist/plugins/smart-paste/locales/zh.d.ts +4 -0
- package/dist/plugins/smart-paste/locales/zh.d.ts.map +1 -0
- package/dist/plugins/smart-paste.mjs +2 -0
- package/dist/plugins/smart-paste.mjs.map +1 -0
- package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts.map +1 -1
- package/dist/plugins/strikethrough.mjs +1 -1
- package/dist/plugins/strikethrough.mjs.map +1 -1
- package/dist/plugins/super-sub/SuperSubPlugin.d.ts.map +1 -1
- package/dist/plugins/super-sub.mjs +1 -1
- package/dist/plugins/super-sub.mjs.map +1 -1
- package/dist/plugins/table/TableCommands.d.ts +1 -0
- package/dist/plugins/table/TableCommands.d.ts.map +1 -1
- package/dist/plugins/table/TableContextMenu.d.ts.map +1 -1
- package/dist/plugins/table/TableNavigation.d.ts.map +1 -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/index.d.ts +1 -0
- package/dist/plugins/table/index.d.ts.map +1 -1
- package/dist/plugins/table.mjs +1 -1
- package/dist/plugins/table.mjs.map +1 -1
- package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -1
- package/dist/plugins/text-color.mjs +1 -1
- package/dist/plugins/text-color.mjs.map +1 -1
- package/dist/plugins/text-direction/TextDirectionCorePlugin.d.ts.map +1 -1
- package/dist/plugins/text-direction/TextDirectionPlugin.d.ts.map +1 -1
- package/dist/plugins/text-direction-advanced.mjs +1 -1
- package/dist/plugins/text-direction-advanced.mjs.map +1 -1
- package/dist/plugins/text-direction.mjs +1 -1
- package/dist/plugins/text-direction.mjs.map +1 -1
- package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts.map +1 -1
- package/dist/plugins/text-formatting.mjs +1 -1
- package/dist/plugins/text-formatting.mjs.map +1 -1
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts +2 -0
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts.map +1 -1
- package/dist/plugins/toolbar.mjs +1 -1
- package/dist/plugins/toolbar.mjs.map +1 -1
- package/dist/presets/FullPreset.d.ts.map +1 -1
- package/dist/presets/PresetTypes.d.ts +2 -0
- package/dist/presets/PresetTypes.d.ts.map +1 -1
- package/dist/presets/full.mjs +1 -1
- package/dist/presets/full.mjs.map +1 -1
- package/dist/serialization/DocumentSerializer.d.ts.map +1 -1
- package/dist/state/InlineContentOps.d.ts.map +1 -1
- package/dist/state/StepInversion.d.ts +7 -0
- package/dist/state/StepInversion.d.ts.map +1 -0
- package/dist/state/Steps.d.ts +108 -0
- package/dist/state/Steps.d.ts.map +1 -0
- package/dist/state/Transaction.d.ts +5 -174
- package/dist/state/Transaction.d.ts.map +1 -1
- package/dist/state/TransactionBuilder.d.ts +69 -0
- package/dist/state/TransactionBuilder.d.ts.map +1 -0
- package/dist/test/TestUtils.d.ts.map +1 -1
- package/dist/view/CaretNavigation.d.ts.map +1 -1
- package/dist/view/DomUtils.d.ts +10 -1
- package/dist/view/DomUtils.d.ts.map +1 -1
- package/dist/view/EditorView.d.ts +10 -60
- package/dist/view/EditorView.d.ts.map +1 -1
- package/dist/view/EditorViewEvents.d.ts +54 -0
- package/dist/view/EditorViewEvents.d.ts.map +1 -0
- package/dist/view/EditorViewNavigation.d.ts +47 -0
- package/dist/view/EditorViewNavigation.d.ts.map +1 -0
- package/dist/view/SelectionSync.d.ts.map +1 -1
- package/dist/view/ViewMovementCommands.d.ts.map +1 -1
- package/package.json +12 -2
- package/dist/chunks/AttributedMarkCommands-BB7lzFct.mjs +0 -2
- package/dist/chunks/AttributedMarkCommands-BB7lzFct.mjs.map +0 -1
- package/dist/chunks/ColorPickerPopup-DRzFvt7o.mjs.map +0 -1
- package/dist/chunks/Commands-P9wS8qtN.mjs +0 -2
- package/dist/chunks/Commands-P9wS8qtN.mjs.map +0 -1
- package/dist/chunks/Document-BFYAonMF.mjs +0 -2
- package/dist/chunks/Document-BFYAonMF.mjs.map +0 -1
- package/dist/chunks/DocumentParser-DFcvVMGY.mjs +0 -2
- package/dist/chunks/DocumentParser-DFcvVMGY.mjs.map +0 -1
- package/dist/chunks/DomUtils-Cdz1eDKM.mjs +0 -2
- package/dist/chunks/DomUtils-Cdz1eDKM.mjs.map +0 -1
- package/dist/chunks/HTMLUtils-CCvQ5f83.mjs +0 -2
- package/dist/chunks/HTMLUtils-CCvQ5f83.mjs.map +0 -1
- package/dist/chunks/HeadingPlugin-DYy3IoT_.mjs +0 -2
- package/dist/chunks/HeadingPlugin-DYy3IoT_.mjs.map +0 -1
- package/dist/chunks/LocaleService-B6Z-wyAF.mjs +0 -2
- package/dist/chunks/LocaleService-B6Z-wyAF.mjs.map +0 -1
- package/dist/chunks/MarkCommands-B_erV7zz.mjs +0 -2
- package/dist/chunks/MarkCommands-B_erV7zz.mjs.map +0 -1
- package/dist/chunks/NavigationQueries-ogQuObz7.mjs +0 -2
- package/dist/chunks/NavigationQueries-ogQuObz7.mjs.map +0 -1
- package/dist/chunks/NotectlEditor-4NFnXLyD.mjs +0 -2
- package/dist/chunks/NotectlEditor-4NFnXLyD.mjs.map +0 -1
- package/dist/chunks/Plugin-OzM8Oxm_.mjs +0 -2
- package/dist/chunks/Plugin-OzM8Oxm_.mjs.map +0 -1
- package/dist/chunks/PluginHelpers-DjZt0pQi.mjs +0 -2
- package/dist/chunks/PluginHelpers-DjZt0pQi.mjs.map +0 -1
- package/dist/chunks/PopupManager-BM8IT6M7.mjs +0 -2
- package/dist/chunks/PopupManager-BM8IT6M7.mjs.map +0 -1
- package/dist/chunks/PrintTypes-ehbL7ipA.mjs +0 -2
- package/dist/chunks/SelectionTransactions-q71GEzgE.mjs +0 -2
- package/dist/chunks/index-C8xtb3SM.mjs +0 -2
- package/dist/chunks/index-C8xtb3SM.mjs.map +0 -1
- package/dist/chunks/index-DAoSt12h.mjs +0 -2
- package/dist/chunks/index-DAoSt12h.mjs.map +0 -1
- package/dist/input/BlockInsertion.d.ts.map +0 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { BlockAttrs, BlockNode, InlineNode, Mark, TextSegment } from '../model/Document.js';
|
|
2
|
+
import { BlockId, NodeTypeName } from '../model/TypeBrands.js';
|
|
3
|
+
export interface InsertTextStep {
|
|
4
|
+
readonly type: 'insertText';
|
|
5
|
+
readonly blockId: BlockId;
|
|
6
|
+
readonly offset: number;
|
|
7
|
+
readonly text: string;
|
|
8
|
+
readonly marks: readonly Mark[];
|
|
9
|
+
readonly segments?: readonly TextSegment[];
|
|
10
|
+
readonly path?: readonly BlockId[];
|
|
11
|
+
}
|
|
12
|
+
export interface DeleteTextStep {
|
|
13
|
+
readonly type: 'deleteText';
|
|
14
|
+
readonly blockId: BlockId;
|
|
15
|
+
readonly from: number;
|
|
16
|
+
readonly to: number;
|
|
17
|
+
readonly deletedText: string;
|
|
18
|
+
readonly deletedMarks: readonly Mark[];
|
|
19
|
+
readonly deletedSegments: readonly TextSegment[];
|
|
20
|
+
readonly path?: readonly BlockId[];
|
|
21
|
+
}
|
|
22
|
+
export interface SplitBlockStep {
|
|
23
|
+
readonly type: 'splitBlock';
|
|
24
|
+
readonly blockId: BlockId;
|
|
25
|
+
readonly offset: number;
|
|
26
|
+
readonly newBlockId: BlockId;
|
|
27
|
+
readonly path?: readonly BlockId[];
|
|
28
|
+
}
|
|
29
|
+
export interface MergeBlocksStep {
|
|
30
|
+
readonly type: 'mergeBlocks';
|
|
31
|
+
readonly targetBlockId: BlockId;
|
|
32
|
+
readonly sourceBlockId: BlockId;
|
|
33
|
+
readonly targetLengthBefore: number;
|
|
34
|
+
readonly path?: readonly BlockId[];
|
|
35
|
+
}
|
|
36
|
+
export interface AddMarkStep {
|
|
37
|
+
readonly type: 'addMark';
|
|
38
|
+
readonly blockId: BlockId;
|
|
39
|
+
readonly from: number;
|
|
40
|
+
readonly to: number;
|
|
41
|
+
readonly mark: Mark;
|
|
42
|
+
readonly path?: readonly BlockId[];
|
|
43
|
+
}
|
|
44
|
+
export interface RemoveMarkStep {
|
|
45
|
+
readonly type: 'removeMark';
|
|
46
|
+
readonly blockId: BlockId;
|
|
47
|
+
readonly from: number;
|
|
48
|
+
readonly to: number;
|
|
49
|
+
readonly mark: Mark;
|
|
50
|
+
readonly path?: readonly BlockId[];
|
|
51
|
+
}
|
|
52
|
+
export interface SetStoredMarksStep {
|
|
53
|
+
readonly type: 'setStoredMarks';
|
|
54
|
+
readonly marks: readonly Mark[] | null;
|
|
55
|
+
readonly previousMarks: readonly Mark[] | null;
|
|
56
|
+
}
|
|
57
|
+
export interface SetBlockTypeStep {
|
|
58
|
+
readonly type: 'setBlockType';
|
|
59
|
+
readonly blockId: BlockId;
|
|
60
|
+
readonly nodeType: NodeTypeName;
|
|
61
|
+
readonly attrs?: BlockAttrs;
|
|
62
|
+
readonly previousNodeType: NodeTypeName;
|
|
63
|
+
readonly previousAttrs?: BlockAttrs;
|
|
64
|
+
readonly path?: readonly BlockId[];
|
|
65
|
+
}
|
|
66
|
+
export interface InsertNodeStep {
|
|
67
|
+
readonly type: 'insertNode';
|
|
68
|
+
readonly parentPath: readonly BlockId[];
|
|
69
|
+
readonly index: number;
|
|
70
|
+
readonly node: BlockNode;
|
|
71
|
+
}
|
|
72
|
+
export interface RemoveNodeStep {
|
|
73
|
+
readonly type: 'removeNode';
|
|
74
|
+
readonly parentPath: readonly BlockId[];
|
|
75
|
+
readonly index: number;
|
|
76
|
+
readonly removedNode: BlockNode;
|
|
77
|
+
}
|
|
78
|
+
export interface SetNodeAttrStep {
|
|
79
|
+
readonly type: 'setNodeAttr';
|
|
80
|
+
readonly path: readonly BlockId[];
|
|
81
|
+
readonly attrs: BlockAttrs | undefined;
|
|
82
|
+
readonly previousAttrs?: BlockAttrs;
|
|
83
|
+
}
|
|
84
|
+
export interface InsertInlineNodeStep {
|
|
85
|
+
readonly type: 'insertInlineNode';
|
|
86
|
+
readonly blockId: BlockId;
|
|
87
|
+
readonly offset: number;
|
|
88
|
+
readonly node: InlineNode;
|
|
89
|
+
readonly path?: readonly BlockId[];
|
|
90
|
+
}
|
|
91
|
+
export interface RemoveInlineNodeStep {
|
|
92
|
+
readonly type: 'removeInlineNode';
|
|
93
|
+
readonly blockId: BlockId;
|
|
94
|
+
readonly offset: number;
|
|
95
|
+
readonly removedNode: InlineNode;
|
|
96
|
+
readonly path?: readonly BlockId[];
|
|
97
|
+
}
|
|
98
|
+
export interface SetInlineNodeAttrStep {
|
|
99
|
+
readonly type: 'setInlineNodeAttr';
|
|
100
|
+
readonly blockId: BlockId;
|
|
101
|
+
readonly offset: number;
|
|
102
|
+
readonly attrs: Readonly<Record<string, string | number | boolean>>;
|
|
103
|
+
readonly previousAttrs: Readonly<Record<string, string | number | boolean>>;
|
|
104
|
+
readonly path?: readonly BlockId[];
|
|
105
|
+
}
|
|
106
|
+
export type Step = InsertTextStep | DeleteTextStep | SplitBlockStep | MergeBlocksStep | AddMarkStep | RemoveMarkStep | SetStoredMarksStep | SetBlockTypeStep | InsertNodeStep | RemoveNodeStep | SetNodeAttrStep | InsertInlineNodeStep | RemoveInlineNodeStep | SetInlineNodeAttrStep;
|
|
107
|
+
export type TransactionOrigin = 'input' | 'paste' | 'command' | 'history' | 'api';
|
|
108
|
+
//# sourceMappingURL=Steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../src/state/Steps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACjG,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,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAC3C,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CA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d,cAAc,GACd,cAAc,GACd,eAAe,GACf,WAAW,GACX,cAAc,GACd,kBAAkB,GAClB,gBAAgB,GAChB,cAAc,GACd,cAAc,GACd,eAAe,GACf,oBAAoB,GACpB,oBAAoB,GACpB,qBAAqB,CAAC;AAEzB,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,KAAK,CAAC"}
|
|
@@ -1,111 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mark } from '../model/Document.js';
|
|
2
2
|
import { EditorSelection } from '../model/Selection.js';
|
|
3
|
-
import {
|
|
4
|
-
export interface InsertTextStep {
|
|
5
|
-
readonly type: 'insertText';
|
|
6
|
-
readonly blockId: BlockId;
|
|
7
|
-
readonly offset: number;
|
|
8
|
-
readonly text: string;
|
|
9
|
-
readonly marks: readonly Mark[];
|
|
10
|
-
readonly segments?: readonly TextSegment[];
|
|
11
|
-
readonly path?: readonly BlockId[];
|
|
12
|
-
}
|
|
13
|
-
export interface DeleteTextStep {
|
|
14
|
-
readonly type: 'deleteText';
|
|
15
|
-
readonly blockId: BlockId;
|
|
16
|
-
readonly from: number;
|
|
17
|
-
readonly to: number;
|
|
18
|
-
readonly deletedText: string;
|
|
19
|
-
readonly deletedMarks: readonly Mark[];
|
|
20
|
-
readonly deletedSegments: readonly TextSegment[];
|
|
21
|
-
readonly path?: readonly BlockId[];
|
|
22
|
-
}
|
|
23
|
-
export interface SplitBlockStep {
|
|
24
|
-
readonly type: 'splitBlock';
|
|
25
|
-
readonly blockId: BlockId;
|
|
26
|
-
readonly offset: number;
|
|
27
|
-
readonly newBlockId: BlockId;
|
|
28
|
-
readonly path?: readonly BlockId[];
|
|
29
|
-
}
|
|
30
|
-
export interface MergeBlocksStep {
|
|
31
|
-
readonly type: 'mergeBlocks';
|
|
32
|
-
readonly targetBlockId: BlockId;
|
|
33
|
-
readonly sourceBlockId: BlockId;
|
|
34
|
-
readonly targetLengthBefore: number;
|
|
35
|
-
readonly path?: readonly BlockId[];
|
|
36
|
-
}
|
|
37
|
-
export interface AddMarkStep {
|
|
38
|
-
readonly type: 'addMark';
|
|
39
|
-
readonly blockId: BlockId;
|
|
40
|
-
readonly from: number;
|
|
41
|
-
readonly to: number;
|
|
42
|
-
readonly mark: Mark;
|
|
43
|
-
readonly path?: readonly BlockId[];
|
|
44
|
-
}
|
|
45
|
-
export interface RemoveMarkStep {
|
|
46
|
-
readonly type: 'removeMark';
|
|
47
|
-
readonly blockId: BlockId;
|
|
48
|
-
readonly from: number;
|
|
49
|
-
readonly to: number;
|
|
50
|
-
readonly mark: Mark;
|
|
51
|
-
readonly path?: readonly BlockId[];
|
|
52
|
-
}
|
|
53
|
-
export interface SetStoredMarksStep {
|
|
54
|
-
readonly type: 'setStoredMarks';
|
|
55
|
-
readonly marks: readonly Mark[] | null;
|
|
56
|
-
readonly previousMarks: readonly Mark[] | null;
|
|
57
|
-
}
|
|
58
|
-
export interface SetBlockTypeStep {
|
|
59
|
-
readonly type: 'setBlockType';
|
|
60
|
-
readonly blockId: BlockId;
|
|
61
|
-
readonly nodeType: NodeTypeName;
|
|
62
|
-
readonly attrs?: BlockAttrs;
|
|
63
|
-
readonly previousNodeType: NodeTypeName;
|
|
64
|
-
readonly previousAttrs?: BlockAttrs;
|
|
65
|
-
readonly path?: readonly BlockId[];
|
|
66
|
-
}
|
|
67
|
-
export interface InsertNodeStep {
|
|
68
|
-
readonly type: 'insertNode';
|
|
69
|
-
readonly parentPath: readonly BlockId[];
|
|
70
|
-
readonly index: number;
|
|
71
|
-
readonly node: BlockNode;
|
|
72
|
-
}
|
|
73
|
-
export interface RemoveNodeStep {
|
|
74
|
-
readonly type: 'removeNode';
|
|
75
|
-
readonly parentPath: readonly BlockId[];
|
|
76
|
-
readonly index: number;
|
|
77
|
-
readonly removedNode: BlockNode;
|
|
78
|
-
}
|
|
79
|
-
export interface SetNodeAttrStep {
|
|
80
|
-
readonly type: 'setNodeAttr';
|
|
81
|
-
readonly path: readonly BlockId[];
|
|
82
|
-
readonly attrs: BlockAttrs | undefined;
|
|
83
|
-
readonly previousAttrs?: BlockAttrs;
|
|
84
|
-
}
|
|
85
|
-
export interface InsertInlineNodeStep {
|
|
86
|
-
readonly type: 'insertInlineNode';
|
|
87
|
-
readonly blockId: BlockId;
|
|
88
|
-
readonly offset: number;
|
|
89
|
-
readonly node: InlineNode;
|
|
90
|
-
readonly path?: readonly BlockId[];
|
|
91
|
-
}
|
|
92
|
-
export interface RemoveInlineNodeStep {
|
|
93
|
-
readonly type: 'removeInlineNode';
|
|
94
|
-
readonly blockId: BlockId;
|
|
95
|
-
readonly offset: number;
|
|
96
|
-
readonly removedNode: InlineNode;
|
|
97
|
-
readonly path?: readonly BlockId[];
|
|
98
|
-
}
|
|
99
|
-
export interface SetInlineNodeAttrStep {
|
|
100
|
-
readonly type: 'setInlineNodeAttr';
|
|
101
|
-
readonly blockId: BlockId;
|
|
102
|
-
readonly offset: number;
|
|
103
|
-
readonly attrs: Readonly<Record<string, string | number | boolean>>;
|
|
104
|
-
readonly previousAttrs: Readonly<Record<string, string | number | boolean>>;
|
|
105
|
-
readonly path?: readonly BlockId[];
|
|
106
|
-
}
|
|
107
|
-
export type Step = InsertTextStep | DeleteTextStep | SplitBlockStep | MergeBlocksStep | AddMarkStep | RemoveMarkStep | SetStoredMarksStep | SetBlockTypeStep | InsertNodeStep | RemoveNodeStep | SetNodeAttrStep | InsertInlineNodeStep | RemoveInlineNodeStep | SetInlineNodeAttrStep;
|
|
108
|
-
export type TransactionOrigin = 'input' | 'paste' | 'command' | 'history' | 'api';
|
|
3
|
+
import { Step, TransactionOrigin } from './Steps.js';
|
|
109
4
|
export interface TransactionMetadata {
|
|
110
5
|
readonly origin: TransactionOrigin;
|
|
111
6
|
readonly timestamp: number;
|
|
@@ -119,71 +14,7 @@ export interface Transaction {
|
|
|
119
14
|
readonly storedMarksAfter: readonly Mark[] | null;
|
|
120
15
|
readonly metadata: TransactionMetadata;
|
|
121
16
|
}
|
|
122
|
-
|
|
123
|
-
export
|
|
124
|
-
|
|
125
|
-
export declare function invertTransaction(tr: Transaction): Transaction;
|
|
126
|
-
/** Fluent API for building transactions. */
|
|
127
|
-
export declare class TransactionBuilder {
|
|
128
|
-
private readonly steps;
|
|
129
|
-
private selection;
|
|
130
|
-
private storedMarks;
|
|
131
|
-
private readonly selectionBefore;
|
|
132
|
-
private readonly origin;
|
|
133
|
-
private workingDoc;
|
|
134
|
-
private _readonlyAllowed;
|
|
135
|
-
constructor(currentSelection: EditorSelection, currentStoredMarks: readonly Mark[] | null, origin?: TransactionOrigin, doc?: Document);
|
|
136
|
-
/** Adds an insert-text step. Updates workingDoc if available. */
|
|
137
|
-
insertText(blockId: BlockId, offset: number, text: string, marks: readonly Mark[], segments?: readonly TextSegment[]): this;
|
|
138
|
-
/** Adds a delete-text step with explicit data. Updates workingDoc if available. */
|
|
139
|
-
deleteText(blockId: BlockId, from: number, to: number, deletedText: string, deletedMarks: readonly Mark[], deletedSegments?: readonly TextSegment[]): this;
|
|
140
|
-
/**
|
|
141
|
-
* Deletes text at the given range, auto-deriving deletedText, deletedMarks, and deletedSegments
|
|
142
|
-
* from the working document. Requires a document to be provided at construction.
|
|
143
|
-
*/
|
|
144
|
-
deleteTextAt(blockId: BlockId, from: number, to: number): this;
|
|
145
|
-
/** Adds a split-block step. Updates workingDoc if available. */
|
|
146
|
-
splitBlock(blockId: BlockId, offset: number, newBlockId: BlockId): this;
|
|
147
|
-
/** Adds a merge-blocks step with explicit targetLengthBefore. Updates workingDoc if available. */
|
|
148
|
-
mergeBlocks(targetBlockId: BlockId, sourceBlockId: BlockId, targetLengthBefore: number): this;
|
|
149
|
-
/**
|
|
150
|
-
* Merges two blocks, auto-deriving targetLengthBefore from the working document.
|
|
151
|
-
* Requires a document to be provided at construction.
|
|
152
|
-
*/
|
|
153
|
-
mergeBlocksAt(targetBlockId: BlockId, sourceBlockId: BlockId): this;
|
|
154
|
-
/** Adds an add-mark step. Updates workingDoc if available. */
|
|
155
|
-
addMark(blockId: BlockId, from: number, to: number, mark: Mark): this;
|
|
156
|
-
/** Adds a remove-mark step. Updates workingDoc if available. */
|
|
157
|
-
removeMark(blockId: BlockId, from: number, to: number, mark: Mark): this;
|
|
158
|
-
/** Adds a set-block-type step, changing a block's node type and optionally its attrs. */
|
|
159
|
-
setBlockType(blockId: BlockId, nodeType: NodeTypeName, attrs?: BlockAttrs): this;
|
|
160
|
-
/** Inserts a node as a child of the parent at the given path and index. */
|
|
161
|
-
insertNode(parentPath: readonly BlockId[], index: number, node: BlockNode): this;
|
|
162
|
-
/** Removes a node at the given index from the parent at the given path. */
|
|
163
|
-
removeNode(parentPath: readonly BlockId[], index: number): this;
|
|
164
|
-
/** Sets attributes on a node at the given path. */
|
|
165
|
-
setNodeAttr(path: readonly BlockId[], attrs: BlockAttrs): this;
|
|
166
|
-
/** Inserts an InlineNode at the given offset within a block. */
|
|
167
|
-
insertInlineNode(blockId: BlockId, offset: number, node: InlineNode): this;
|
|
168
|
-
/** Removes an InlineNode at the given offset, deriving removedNode from workingDoc. */
|
|
169
|
-
removeInlineNode(blockId: BlockId, offset: number): this;
|
|
170
|
-
/** Sets attributes on an InlineNode at the given offset. */
|
|
171
|
-
setInlineNodeAttr(blockId: BlockId, offset: number, attrs: Readonly<Record<string, string | number | boolean>>): this;
|
|
172
|
-
/** Marks this transaction as allowed in readonly mode. */
|
|
173
|
-
readonlyAllowed(): this;
|
|
174
|
-
/** Sets the selection for the resulting state. */
|
|
175
|
-
setSelection(selection: EditorSelection): this;
|
|
176
|
-
/** Sets a NodeSelection for the resulting state. */
|
|
177
|
-
setNodeSelection(nodeId: BlockId, path: readonly BlockId[]): this;
|
|
178
|
-
/** Sets stored marks for the resulting state. */
|
|
179
|
-
setStoredMarks(marks: readonly Mark[] | null, previousMarks: readonly Mark[] | null): this;
|
|
180
|
-
/** Builds the final transaction. */
|
|
181
|
-
build(): Transaction;
|
|
182
|
-
/** Advances the working document by applying a step. */
|
|
183
|
-
private advanceDoc;
|
|
184
|
-
}
|
|
185
|
-
/** Helper to create a TransactionBuilder with input origin. */
|
|
186
|
-
export declare function inputTransaction(selection: EditorSelection, storedMarks: readonly Mark[] | null): TransactionBuilder;
|
|
187
|
-
/** Helper to create a TransactionBuilder with command origin. */
|
|
188
|
-
export declare function commandTransaction(selection: EditorSelection, storedMarks: readonly Mark[] | null): TransactionBuilder;
|
|
17
|
+
export * from './Steps.js';
|
|
18
|
+
export { invertStep, invertTransaction } from './StepInversion.js';
|
|
19
|
+
export { TransactionBuilder } from './TransactionBuilder.js';
|
|
189
20
|
//# sourceMappingURL=Transaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../../src/state/Transaction.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../../src/state/Transaction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI1D,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,cAAc,EAAE,eAAe,CAAC;IACzC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,IAAI,EAAE,GAAG,IAAI,CAAC;IAClD,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;CACvC;AAID,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { BlockAttrs, BlockNode, Document, InlineNode, Mark, TextSegment } from '../model/Document.js';
|
|
2
|
+
import { EditorSelection } from '../model/Selection.js';
|
|
3
|
+
import { BlockId, NodeTypeName } from '../model/TypeBrands.js';
|
|
4
|
+
import { TransactionOrigin } from './Steps.js';
|
|
5
|
+
import { Transaction } from './Transaction.js';
|
|
6
|
+
/** Fluent API for building transactions. */
|
|
7
|
+
export declare class TransactionBuilder {
|
|
8
|
+
private readonly steps;
|
|
9
|
+
private selection;
|
|
10
|
+
private storedMarks;
|
|
11
|
+
private readonly selectionBefore;
|
|
12
|
+
private readonly origin;
|
|
13
|
+
private workingDoc;
|
|
14
|
+
private _readonlyAllowed;
|
|
15
|
+
constructor(currentSelection: EditorSelection, currentStoredMarks: readonly Mark[] | null, origin?: TransactionOrigin, doc?: Document);
|
|
16
|
+
/** Adds an insert-text step. Updates workingDoc if available. */
|
|
17
|
+
insertText(blockId: BlockId, offset: number, text: string, marks: readonly Mark[], segments?: readonly TextSegment[]): this;
|
|
18
|
+
/** Adds a delete-text step with explicit data. Updates workingDoc if available. */
|
|
19
|
+
deleteText(blockId: BlockId, from: number, to: number, deletedText: string, deletedMarks: readonly Mark[], deletedSegments?: readonly TextSegment[]): this;
|
|
20
|
+
/**
|
|
21
|
+
* Deletes text at the given range, auto-deriving deletedText, deletedMarks, and deletedSegments
|
|
22
|
+
* from the working document. Requires a document to be provided at construction.
|
|
23
|
+
*/
|
|
24
|
+
deleteTextAt(blockId: BlockId, from: number, to: number): this;
|
|
25
|
+
/** Adds a split-block step. Updates workingDoc if available. */
|
|
26
|
+
splitBlock(blockId: BlockId, offset: number, newBlockId: BlockId): this;
|
|
27
|
+
/** Adds a merge-blocks step with explicit targetLengthBefore. Updates workingDoc if available. */
|
|
28
|
+
mergeBlocks(targetBlockId: BlockId, sourceBlockId: BlockId, targetLengthBefore: number): this;
|
|
29
|
+
/**
|
|
30
|
+
* Merges two blocks, auto-deriving targetLengthBefore from the working document.
|
|
31
|
+
* Requires a document to be provided at construction.
|
|
32
|
+
*/
|
|
33
|
+
mergeBlocksAt(targetBlockId: BlockId, sourceBlockId: BlockId): this;
|
|
34
|
+
/** Adds an add-mark step. Updates workingDoc if available. */
|
|
35
|
+
addMark(blockId: BlockId, from: number, to: number, mark: Mark): this;
|
|
36
|
+
/** Adds a remove-mark step. Updates workingDoc if available. */
|
|
37
|
+
removeMark(blockId: BlockId, from: number, to: number, mark: Mark): this;
|
|
38
|
+
/** Adds a set-block-type step, changing a block's node type and optionally its attrs. */
|
|
39
|
+
setBlockType(blockId: BlockId, nodeType: NodeTypeName, attrs?: BlockAttrs): this;
|
|
40
|
+
/** Inserts a node as a child of the parent at the given path and index. */
|
|
41
|
+
insertNode(parentPath: readonly BlockId[], index: number, node: BlockNode): this;
|
|
42
|
+
/** Removes a node at the given index from the parent at the given path. */
|
|
43
|
+
removeNode(parentPath: readonly BlockId[], index: number): this;
|
|
44
|
+
/** Sets attributes on a node at the given path. */
|
|
45
|
+
setNodeAttr(path: readonly BlockId[], attrs: BlockAttrs): this;
|
|
46
|
+
/** Inserts an InlineNode at the given offset within a block. */
|
|
47
|
+
insertInlineNode(blockId: BlockId, offset: number, node: InlineNode): this;
|
|
48
|
+
/** Removes an InlineNode at the given offset, deriving removedNode from workingDoc. */
|
|
49
|
+
removeInlineNode(blockId: BlockId, offset: number): this;
|
|
50
|
+
/** Sets attributes on an InlineNode at the given offset. */
|
|
51
|
+
setInlineNodeAttr(blockId: BlockId, offset: number, attrs: Readonly<Record<string, string | number | boolean>>): this;
|
|
52
|
+
/** Marks this transaction as allowed in readonly mode. */
|
|
53
|
+
readonlyAllowed(): this;
|
|
54
|
+
/** Sets the selection for the resulting state. */
|
|
55
|
+
setSelection(selection: EditorSelection): this;
|
|
56
|
+
/** Sets a NodeSelection for the resulting state. */
|
|
57
|
+
setNodeSelection(nodeId: BlockId, path: readonly BlockId[]): this;
|
|
58
|
+
/** Sets stored marks for the resulting state. */
|
|
59
|
+
setStoredMarks(marks: readonly Mark[] | null, previousMarks: readonly Mark[] | null): this;
|
|
60
|
+
/** Builds the final transaction. */
|
|
61
|
+
build(): Transaction;
|
|
62
|
+
/** Returns the working document or throws if not available. */
|
|
63
|
+
private requireDoc;
|
|
64
|
+
/** Finds a block in the document or throws if not found. */
|
|
65
|
+
private requireBlock;
|
|
66
|
+
/** Advances the working document by applying a step. */
|
|
67
|
+
private advanceDoc;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=TransactionBuilder.d.ts.map
|
|
@@ -0,0 +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,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,WAAW,EACX,MAAM,sBAAsB,CAAC;AAY9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,KAAK,EAeX,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,SAAS,CAAkB;IACnC,OAAO,CAAC,WAAW,CAAyB;IAC5C,OAAO,CAAC,QA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;;;;;GAgBG;AACH,wBAAsB,aAAa,CAClC,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,EAClC,KAAK,CAAC,EAAE,WAAW,EACnB,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CA8C9B;AAMD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAChC,SAAS,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAC3C,wBAAwB,CAQ1B;AAMD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAkCnF;AAMD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAI9F;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC3B,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,CAAC,CAAC,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,GAC7C,WAAW,CAMb;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAQxF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaretNavigation.d.ts","sourceRoot":"","sources":["../../src/view/CaretNavigation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"CaretNavigation.d.ts","sourceRoot":"","sources":["../../src/view/CaretNavigation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAWjE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;AAQ9D;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC7B,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,cAAc,EACzB,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,GACxB,OAAO,CAiCT;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,cAAc,GACvB,WAAW,GAAG,IAAI,CAcpB;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC7C,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,IAAI,GAAG,MAAM,EACxB,UAAU,EAAE,MAAM,GAAG,IAAI,GACvB,WAAW,GAAG,IAAI,CAoBpB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,GAAG,WAAW,GAAG,IAAI,CAgBhG;AAyBD,wEAAwE;AACxE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,UAAU,CAAC,SAAS,GAAG,OAAO,GAAG,IAAI,CAMtF"}
|
package/dist/view/DomUtils.d.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { BlockId } from '../model/TypeBrands.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Creates an HTMLElement with the required `data-block-id` attribute.
|
|
4
|
+
*
|
|
5
|
+
* Intentionally used by plugins in `NodeSpec.toDOM()` callbacks —
|
|
6
|
+
* this is an accepted targeted import per ARCHITECTURE.md.
|
|
7
|
+
*/
|
|
3
8
|
export declare function createBlockElement(tag: string, blockId: BlockId): HTMLElement;
|
|
9
|
+
/** Builds the block path from a leaf element up to the container. */
|
|
10
|
+
export declare function buildBlockPath(container: HTMLElement, leafBlockEl: HTMLElement): BlockId[];
|
|
11
|
+
/** Finds the nearest ancestor element with a `data-block-id` attribute. */
|
|
12
|
+
export declare function findBlockAncestor(container: HTMLElement, node: Node): HTMLElement | null;
|
|
4
13
|
//# sourceMappingURL=DomUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DomUtils.d.ts","sourceRoot":"","sources":["../../src/view/DomUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"DomUtils.d.ts","sourceRoot":"","sources":["../../src/view/DomUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGtD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,WAAW,CAI7E;AAED,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,EAAE,CAU1F;AAED,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,GAAG,WAAW,GAAG,IAAI,CASxF"}
|
|
@@ -25,37 +25,27 @@ export declare class EditorView {
|
|
|
25
25
|
private readonly contentElement;
|
|
26
26
|
readonly history: HistoryManager;
|
|
27
27
|
private readonly stateChangeCallbacks;
|
|
28
|
-
private readonly handleSelectionChange;
|
|
29
|
-
private readonly handleMousedown;
|
|
30
|
-
private readonly handleDragover;
|
|
31
|
-
private readonly handleDrop;
|
|
32
|
-
private readonly handleCompositionStartForWrapper;
|
|
33
|
-
private readonly handleCompositionEndForWrapper;
|
|
34
28
|
private isUpdating;
|
|
35
|
-
private pendingNodeSelectionClear;
|
|
36
|
-
private pendingGapCursorClear;
|
|
37
29
|
private readonly schemaRegistry?;
|
|
38
|
-
private readonly keymapRegistry?;
|
|
39
|
-
private readonly fileHandlerRegistry?;
|
|
40
30
|
private readonly nodeViewRegistry?;
|
|
41
31
|
private readonly nodeViews;
|
|
42
32
|
private decorations;
|
|
43
33
|
private readonly getDecorations?;
|
|
44
34
|
private readonly isReadOnly;
|
|
45
|
-
private navigationKeymap;
|
|
46
35
|
private readonly compositionState;
|
|
47
36
|
private readonly cursorWrapper;
|
|
48
|
-
private
|
|
49
|
-
private
|
|
37
|
+
private readonly navigation;
|
|
38
|
+
private readonly events;
|
|
50
39
|
constructor(contentElement: HTMLElement, options: EditorViewOptions);
|
|
51
40
|
/** Returns the current editor state. */
|
|
52
41
|
getState(): EditorState;
|
|
53
42
|
/**
|
|
54
|
-
* Central update cycle: sets state, collects decorations, reconciles
|
|
55
|
-
* syncs selection, and notifies listeners.
|
|
43
|
+
* Central update cycle: sets state, collects decorations, reconciles
|
|
44
|
+
* DOM, syncs selection, and notifies listeners.
|
|
45
|
+
* Guarded against re-entrancy.
|
|
56
46
|
*/
|
|
57
47
|
private applyUpdate;
|
|
58
|
-
/** Dispatches a transaction, updates state, reconciles DOM
|
|
48
|
+
/** Dispatches a transaction, updates state, reconciles DOM. */
|
|
59
49
|
dispatch(tr: Transaction): void;
|
|
60
50
|
/** Performs undo. */
|
|
61
51
|
undo(): void;
|
|
@@ -65,51 +55,11 @@ export declare class EditorView {
|
|
|
65
55
|
onStateChange(callback: StateChangeCallback): () => void;
|
|
66
56
|
/** Replaces the editor state without destroying handlers or history. */
|
|
67
57
|
replaceState(newState: EditorState): void;
|
|
68
|
-
/** Syncs the DOM selection
|
|
69
|
-
private syncSelectionFromDOM;
|
|
70
|
-
/** Handles mousedown on selectable/void blocks to create NodeSelection. */
|
|
71
|
-
private onMousedown;
|
|
72
|
-
/**
|
|
73
|
-
* When the user clicks in empty space below all rendered blocks,
|
|
74
|
-
* appends a new paragraph after the last block and focuses it.
|
|
75
|
-
*/
|
|
76
|
-
private handleClickBelowContent;
|
|
77
|
-
/** Builds an array of block IDs from root to leaf. */
|
|
78
|
-
private buildBlockPath;
|
|
79
|
-
/** Allows file drop by preventing default on dragover when files are present. */
|
|
80
|
-
private onDragover;
|
|
81
|
-
/** Handles file drop by delegating to registered file handlers. */
|
|
82
|
-
private onDrop;
|
|
83
|
-
/** Converts screen coordinates to an editor Position. */
|
|
84
|
-
private getPositionFromPoint;
|
|
85
|
-
/** Handles DOM selection changes (clicks, arrow keys). */
|
|
86
|
-
private onSelectionChange;
|
|
87
|
-
private reconcileOptions;
|
|
88
|
-
/** Registers arrow-key keymaps with navigation priority for cross-block movement. */
|
|
89
|
-
private registerNavigationKeymaps;
|
|
90
|
-
/** Handles a navigation arrow key: cross-block movement if at textblock boundary. */
|
|
91
|
-
private handleNavigationArrow;
|
|
92
|
-
/** Handles horizontal arrow navigation: InlineNode skip + cross-block. */
|
|
93
|
-
private handleHorizontalArrow;
|
|
94
|
-
/**
|
|
95
|
-
* Maps visual horizontal arrow intent (left/right key) to logical movement
|
|
96
|
-
* direction in offset space for the current block direction.
|
|
97
|
-
*/
|
|
98
|
-
private resolveLogicalHorizontalDirection;
|
|
99
|
-
/** Handles vertical arrow navigation with goalColumn preservation. */
|
|
100
|
-
private handleVerticalArrow;
|
|
101
|
-
/**
|
|
102
|
-
* Validates the DOM cursor position after an InlineNode skip.
|
|
103
|
-
*
|
|
104
|
-
* Chrome can place the cursor inside a `contenteditable="false"` element
|
|
105
|
-
* (phantom position), and Firefox may lose the cursor entirely next to such
|
|
106
|
-
* elements. This read-back roundtrip detects drift between the model
|
|
107
|
-
* selection and the actual DOM selection. If they diverge, we force
|
|
108
|
-
* `syncSelectionToDOM()` a second time to correct the position.
|
|
109
|
-
*/
|
|
110
|
-
private validateSelectionAfterInlineSkip;
|
|
111
|
-
/** Syncs the DOM selection into editor state. Exposed for external callers. */
|
|
58
|
+
/** Syncs the DOM selection into editor state. */
|
|
112
59
|
syncSelection(): void;
|
|
60
|
+
/** Reconciles DOM and syncs selection, updating decoration state. */
|
|
61
|
+
private reconcileAndSync;
|
|
62
|
+
private reconcileOptions;
|
|
113
63
|
/** Cleans up all event listeners and handlers. */
|
|
114
64
|
destroy(): void;
|
|
115
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorView.d.ts","sourceRoot":"","sources":["../../src/view/EditorView.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"EditorView.d.ts","sourceRoot":"","sources":["../../src/view/EditorView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAK3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,MAAM,MAAM,mBAAmB,GAAG,CACjC,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,WAAW,EACrB,EAAE,EAAE,WAAW,KACX,IAAI,CAAC;AAEV,MAAM,WAAW,iBAAiB;IACjC,KAAK,EAAE,WAAW,CAAC;IACnB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,cAAc,CAAC,EAAE,cA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K/B,qBAAqB;IACrB,IAAI,IAAI,IAAI;IAOZ,qBAAqB;IACrB,IAAI,IAAI,IAAI;IAOZ,yCAAyC;IACzC,aAAa,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM,IAAI;IAQxD,wEAAwE;IACxE,YAAY,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI;IAkCzC,iDAAiD;IACjD,aAAa,IAAI,IAAI;IAIrB,qEAAqE;IACrE,OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,gBAAgB;IAmBxB,kDAAkD;IAClD,OAAO,IAAI,IAAI;CASf"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { CompositionState } from '../model/CompositionState.js';
|
|
2
|
+
import { FileHandlerRegistry } from '../model/FileHandlerRegistry.js';
|
|
3
|
+
import { EditorState } from '../state/EditorState.js';
|
|
4
|
+
import { Transaction } from '../state/Transaction.js';
|
|
5
|
+
import { CursorWrapper } from './CursorWrapper.js';
|
|
6
|
+
export interface EventCoordinatorDeps {
|
|
7
|
+
readonly contentElement: HTMLElement;
|
|
8
|
+
readonly getState: () => EditorState;
|
|
9
|
+
readonly dispatch: (tr: Transaction) => void;
|
|
10
|
+
readonly applyUpdate: (newState: EditorState, tr: Transaction) => void;
|
|
11
|
+
readonly isUpdating: () => boolean;
|
|
12
|
+
readonly compositionState: CompositionState;
|
|
13
|
+
readonly cursorWrapper: CursorWrapper;
|
|
14
|
+
readonly isReadOnly: () => boolean;
|
|
15
|
+
readonly fileHandlerRegistry?: FileHandlerRegistry;
|
|
16
|
+
readonly onMousedown?: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare class EditorViewEvents {
|
|
19
|
+
private readonly deps;
|
|
20
|
+
private readonly handleSelectionChange;
|
|
21
|
+
private readonly handleMousedown;
|
|
22
|
+
private readonly handleDragover;
|
|
23
|
+
private readonly handleDrop;
|
|
24
|
+
private readonly handleCompositionStart;
|
|
25
|
+
private readonly handleCompositionEnd;
|
|
26
|
+
private pendingNodeSelectionClear;
|
|
27
|
+
private pendingGapCursorClear;
|
|
28
|
+
constructor(deps: EventCoordinatorDeps);
|
|
29
|
+
/** Syncs the DOM selection into editor state. */
|
|
30
|
+
syncSelectionFromDOM(): void;
|
|
31
|
+
/** Removes all event listeners. */
|
|
32
|
+
destroy(): void;
|
|
33
|
+
/** Handles DOM selection changes (clicks, arrow keys). */
|
|
34
|
+
private onSelectionChange;
|
|
35
|
+
/** Handles mousedown on selectable/void blocks. */
|
|
36
|
+
private onMousedown;
|
|
37
|
+
/**
|
|
38
|
+
* When the user clicks below all rendered blocks, appends a
|
|
39
|
+
* new paragraph after the last block and focuses it.
|
|
40
|
+
*/
|
|
41
|
+
private handleClickBelowContent;
|
|
42
|
+
/** Allows file drop by preventing default on dragover. */
|
|
43
|
+
private onDragover;
|
|
44
|
+
/** Handles file drop via registered file handlers. */
|
|
45
|
+
private onDrop;
|
|
46
|
+
/** Converts screen coordinates to an editor Position. */
|
|
47
|
+
private getPositionFromPoint;
|
|
48
|
+
/**
|
|
49
|
+
* Marks pending clear flags when clicking non-selectable blocks
|
|
50
|
+
* while NodeSelection or GapCursor is active.
|
|
51
|
+
*/
|
|
52
|
+
private markPendingSelectionClear;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=EditorViewEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorViewEvents.d.ts","sourceRoot":"","sources":["../../src/view/EditorViewEvents.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAW3E,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,CA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