diff --git a/package-lock.json b/package-lock.json index 379fa12db5b..f06bd335f3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,6 +36,7 @@ "@tiptap/extension-collaboration-cursor": "^2.1.13", "@tiptap/extension-document": "^2.1.13", "@tiptap/extension-dropcursor": "^2.1.13", + "@tiptap/extension-gapcursor": "^2.1.13", "@tiptap/extension-hard-break": "^2.1.13", "@tiptap/extension-heading": "^2.1.13", "@tiptap/extension-history": "^2.1.13", @@ -4797,6 +4798,19 @@ "@tiptap/pm": "^2.0.0" } }, + "node_modules/@tiptap/extension-gapcursor": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-2.1.13.tgz", + "integrity": "sha512-Cl5apsoTcyPPCgE3ThufxQxZ1wyqqh+9uxUN9VF9AbeTkid6oPZvKXwaILf6AFnkSy+SuKrb9kZD2iaezxpzXw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^2.0.0", + "@tiptap/pm": "^2.0.0" + } + }, "node_modules/@tiptap/extension-hard-break": { "version": "2.1.13", "resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-2.1.13.tgz", @@ -28905,6 +28919,12 @@ "tippy.js": "^6.3.7" } }, + "@tiptap/extension-gapcursor": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-2.1.13.tgz", + "integrity": "sha512-Cl5apsoTcyPPCgE3ThufxQxZ1wyqqh+9uxUN9VF9AbeTkid6oPZvKXwaILf6AFnkSy+SuKrb9kZD2iaezxpzXw==", + "requires": {} + }, "@tiptap/extension-hard-break": { "version": "2.1.13", "resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-2.1.13.tgz", diff --git a/package.json b/package.json index 1faa6ca013f..ccfc02ca72e 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "@tiptap/extension-collaboration-cursor": "^2.1.13", "@tiptap/extension-document": "^2.1.13", "@tiptap/extension-dropcursor": "^2.1.13", + "@tiptap/extension-gapcursor": "^2.1.13", "@tiptap/extension-hard-break": "^2.1.13", "@tiptap/extension-heading": "^2.1.13", "@tiptap/extension-history": "^2.1.13", diff --git a/src/components/Editor/MediaHandler.vue b/src/components/Editor/MediaHandler.vue index f97c2652c4c..e84ee5abffa 100644 --- a/src/components/Editor/MediaHandler.vue +++ b/src/components/Editor/MediaHandler.vue @@ -203,14 +203,8 @@ export default { // subsequent editor inserts (see tiptap#3355). So unselect the image by placing // the cursor at the end of the selection. this.$editor.commands.focus(selection.to) - } else { - // Place the cursor after the inserted image node - this.$editor.commands.focus(selection.to + 2) } - // Insert a newline to allow placing the cursor in between subsequent images - this.$editor.chain().insertContent('
').focus().run() - // Scroll image into view this.$editor.commands.scrollIntoView() diff --git a/src/extensions/RichText.js b/src/extensions/RichText.js index 357443d1fd6..24bccbcb80b 100644 --- a/src/extensions/RichText.js +++ b/src/extensions/RichText.js @@ -32,24 +32,25 @@ import Code from '@tiptap/extension-code' import CodeBlock from './../nodes/CodeBlock.js' import Document from '@tiptap/extension-document' import Dropcursor from '@tiptap/extension-dropcursor' +import EditableTable from './../nodes/EditableTable.js' import Emoji from './Emoji.js' import EmojiSuggestion from './../components/Suggestion/Emoji/suggestions.js' import FrontMatter from './../nodes/FrontMatter.js' -import Paragraph from './../nodes/Paragraph.js' +import Gapcursor from '@tiptap/extension-gapcursor' import HardBreak from './../nodes/HardBreak.js' import Heading from '../nodes/Heading/index.js' import HorizontalRule from '@tiptap/extension-horizontal-rule' import Image from './../nodes/Image.js' import ImageInline from './../nodes/ImageInline.js' import KeepSyntax from './KeepSyntax.js' +import LinkPicker from './../extensions/LinkPicker.js' import ListItem from '@tiptap/extension-list-item' import Markdown from './../extensions/Markdown.js' import Mention from './../extensions/Mention.js' -import LinkPicker from './../extensions/LinkPicker.js' import OrderedList from '@tiptap/extension-ordered-list' +import Paragraph from './../nodes/Paragraph.js' import Placeholder from '@tiptap/extension-placeholder' import Table from './../nodes/Table.js' -import EditableTable from './../nodes/EditableTable.js' import TaskItem from './../nodes/TaskItem.js' import TaskList from './../nodes/TaskList.js' import Text from '@tiptap/extension-text' @@ -104,6 +105,7 @@ export default Extension.create({ Image, ImageInline, Dropcursor, + Gapcursor, KeepSyntax, FrontMatter, Mention,