Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(files): add tiptap-text-direction extension to support RTL #6874

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/extensions/RichText.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
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 */

Check warning on line 45 in src/extensions/RichText.js

View workflow job for this annotation

GitHub Actions / NPM lint

Using exported name 'TextDirection' as identifier for default export
import TextDirection from 'tiptap-text-direction'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah... this also triggers the import/no-named-as-default eslint rule. So please move it one line up so it's in the eslint-disable block above.

Thanks!


import { Strong, Italic, Strike, Link, Underline } from './../marks/index.js'
import { translate as t } from '@nextcloud/l10n'
Expand Down Expand Up @@ -118,6 +119,9 @@
})
: null,
TrailingNode,
TextDirection.configure({
types: ['heading', 'paragraph', 'bulletList', 'listItem', 'orderedList'],
}),
]
const additionalExtensionNames = this.options.extensions.map(e => e.name)
return [
Expand Down
Loading