From 71575dd6ec341fbc99956c7fc327901cca8294ba Mon Sep 17 00:00:00 2001 From: rhenck <richard.henck@iqb.hu-berlin.de> Date: Wed, 12 Jan 2022 21:00:14 +0100 Subject: [PATCH] [editor] Fix minor issues in TextEditor extensions - Give proper name - Fix variable names - Fix deprecated methods --- .../src/app/text-editor/extensions/bullet-list.ts | 2 ++ .../editor/src/app/text-editor/extensions/font-size.ts | 2 ++ .../src/app/text-editor/extensions/hanging-indent.ts | 6 ++++-- .../editor/src/app/text-editor/extensions/indent.ts | 10 ++++++---- .../text-editor/extensions/orderedList-extension.ts | 2 ++ .../app/text-editor/extensions/paragraph-extension.ts | 2 +- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/projects/editor/src/app/text-editor/extensions/bullet-list.ts b/projects/editor/src/app/text-editor/extensions/bullet-list.ts index 59c8679e2..54cd0538c 100644 --- a/projects/editor/src/app/text-editor/extensions/bullet-list.ts +++ b/projects/editor/src/app/text-editor/extensions/bullet-list.ts @@ -11,6 +11,8 @@ declare module '@tiptap/core' { } export const BulletListExtension = BulletList.extend({ + name: 'BulletListExtension', + addAttributes() { return { listStyle: { diff --git a/projects/editor/src/app/text-editor/extensions/font-size.ts b/projects/editor/src/app/text-editor/extensions/font-size.ts index 6a65bfcce..098ced8b2 100644 --- a/projects/editor/src/app/text-editor/extensions/font-size.ts +++ b/projects/editor/src/app/text-editor/extensions/font-size.ts @@ -10,6 +10,8 @@ declare module '@tiptap/core' { } export const FontSizeExtension = TextStyle.extend({ + name: 'FontSizeExtension', + addAttributes() { return { fontSize: { diff --git a/projects/editor/src/app/text-editor/extensions/hanging-indent.ts b/projects/editor/src/app/text-editor/extensions/hanging-indent.ts index 428922d58..7442817b5 100644 --- a/projects/editor/src/app/text-editor/extensions/hanging-indent.ts +++ b/projects/editor/src/app/text-editor/extensions/hanging-indent.ts @@ -13,8 +13,10 @@ declare module '@tiptap/core' { export const HangingIndent = Extension.create({ name: 'hangingIndent', - defaultOptions: { - types: ['paragraph'] + addOptions() { + return { + types: ['paragraph'] + }; }, addGlobalAttributes() { diff --git a/projects/editor/src/app/text-editor/extensions/indent.ts b/projects/editor/src/app/text-editor/extensions/indent.ts index 6d2e19676..7db3b07db 100644 --- a/projects/editor/src/app/text-editor/extensions/indent.ts +++ b/projects/editor/src/app/text-editor/extensions/indent.ts @@ -19,10 +19,12 @@ declare module '@tiptap/core' { export const Indent = Extension.create<IndentOptions>({ name: 'indent', - defaultOptions: { - types: ['listItem', 'paragraph'], - minLevel: 0, - maxLevel: 8 + addOptions() { + return { + types: ['listItem', 'paragraph'], + minLevel: 0, + maxLevel: 8 + }; }, addGlobalAttributes() { diff --git a/projects/editor/src/app/text-editor/extensions/orderedList-extension.ts b/projects/editor/src/app/text-editor/extensions/orderedList-extension.ts index b3785201e..a410c265d 100644 --- a/projects/editor/src/app/text-editor/extensions/orderedList-extension.ts +++ b/projects/editor/src/app/text-editor/extensions/orderedList-extension.ts @@ -11,6 +11,8 @@ declare module '@tiptap/core' { } export const OrderedListExtension = OrderedList.extend({ + name: 'OrderedListExtension', + addAttributes() { return { listStyle: { diff --git a/projects/editor/src/app/text-editor/extensions/paragraph-extension.ts b/projects/editor/src/app/text-editor/extensions/paragraph-extension.ts index a3c0f4b3e..ca9a25786 100644 --- a/projects/editor/src/app/text-editor/extensions/paragraph-extension.ts +++ b/projects/editor/src/app/text-editor/extensions/paragraph-extension.ts @@ -10,7 +10,7 @@ declare module '@tiptap/core' { } } -export const paragraphExtension = Paragraph.extend({ +export const ParagraphExtension = Paragraph.extend({ addAttributes() { return { margin: { -- GitLab