diff --git a/package-lock.json b/package-lock.json index 576dee6d027..d4a3a6bad26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -78,6 +78,7 @@ "proxy-polyfill": "^0.3.2", "slug": "^10.0.0", "tippy.js": "^6.3.7", + "tiptap-text-direction": "^0.3.1", "uuid": "^11.0.5", "vue": "^2.7.16", "vue-click-outside": "^1.1.0", @@ -23199,6 +23200,15 @@ "@popperjs/core": "^2.9.0" } }, + "node_modules/tiptap-text-direction": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/tiptap-text-direction/-/tiptap-text-direction-0.3.1.tgz", + "integrity": "sha512-h3WerSUqesMDVzKcMAinMz0FaBqUiNd0KoiU/LahJaeV+jT1jkw9EQ7ixCwM+pvcIJTHfmzry/4gA5P5p0Al1A==", + "peerDependencies": { + "@tiptap/core": "^2.0.0", + "@tiptap/pm": "^2.0.0" + } + }, "node_modules/tmp": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", @@ -41507,6 +41517,12 @@ "@popperjs/core": "^2.9.0" } }, + "tiptap-text-direction": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/tiptap-text-direction/-/tiptap-text-direction-0.3.1.tgz", + "integrity": "sha512-h3WerSUqesMDVzKcMAinMz0FaBqUiNd0KoiU/LahJaeV+jT1jkw9EQ7ixCwM+pvcIJTHfmzry/4gA5P5p0Al1A==", + "requires": {} + }, "tmp": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", diff --git a/package.json b/package.json index 58e5483f8a1..61c8f9c555b 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "@tiptap/extension-collaboration-cursor": "^2.9.1", "@tiptap/extension-document": "^2.9.1", "@tiptap/extension-dropcursor": "^2.9.1", + "tiptap-text-direction": "^0.3.1", "@tiptap/extension-gapcursor": "^2.9.1", "@tiptap/extension-hard-break": "^2.9.1", "@tiptap/extension-heading": "^2.9.1", diff --git a/src/extensions/RichText.js b/src/extensions/RichText.js index cf71f42c71b..4e57feeff66 100644 --- a/src/extensions/RichText.js +++ b/src/extensions/RichText.js @@ -43,6 +43,7 @@ import TaskList from './../nodes/TaskList.js' import Text from '@tiptap/extension-text' import TrailingNode from './../nodes/TrailingNode.js' /* eslint-enable import/no-named-as-default */ +import TextDirection from 'tiptap-text-direction' import { Strong, Italic, Strike, Link, Underline } from './../marks/index.js' import { translate as t } from '@nextcloud/l10n' @@ -118,6 +119,9 @@ export default Extension.create({ }) : null, TrailingNode, + TextDirection.configure({ + types: ['heading', 'paragraph', 'bulletList', 'listItem', 'orderedList'], + }), ] const additionalExtensionNames = this.options.extensions.map(e => e.name) return [