From 3762d25d259f148ed4f5e06ee63524148fdde8e4 Mon Sep 17 00:00:00 2001 From: Jonas Date: Wed, 6 Dec 2023 12:43:51 +0100 Subject: [PATCH 1/3] style(RichText): Order imports alphabetically Signed-off-by: Jonas --- src/extensions/RichText.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extensions/RichText.js b/src/extensions/RichText.js index 357443d1fd6..748a845608b 100644 --- a/src/extensions/RichText.js +++ b/src/extensions/RichText.js @@ -32,24 +32,24 @@ 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 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' From 0765273754eba45d9410717ff75950a770a495e4 Mon Sep 17 00:00:00 2001 From: Jonas Date: Wed, 6 Dec 2023 12:44:40 +0100 Subject: [PATCH 2/3] feat(editor): Enable gapcursor, allows to put cursor between images Signed-off-by: Jonas --- package-lock.json | 20 ++++++++++++++++++++ package.json | 1 + src/extensions/RichText.js | 2 ++ 3 files changed, 23 insertions(+) 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/extensions/RichText.js b/src/extensions/RichText.js index 748a845608b..24bccbcb80b 100644 --- a/src/extensions/RichText.js +++ b/src/extensions/RichText.js @@ -36,6 +36,7 @@ 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 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' @@ -104,6 +105,7 @@ export default Extension.create({ Image, ImageInline, Dropcursor, + Gapcursor, KeepSyntax, FrontMatter, Mention, From 4f7bc371f9186e0e85196411a2d04ee4d4e7e5c4 Mon Sep 17 00:00:00 2001 From: Jonas Date: Wed, 6 Dec 2023 12:47:38 +0100 Subject: [PATCH 3/3] fix(MediaHandler): Remove workaround to add newline between images Fixes: #3427 Signed-off-by: Jonas --- src/components/Editor/MediaHandler.vue | 6 ------ 1 file changed, 6 deletions(-) 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()