tiptap deprecated warning fix
This commit is contained in:
parent
58ec520c3e
commit
0a5e5eca95
|
@ -12,11 +12,6 @@ declare module '@tiptap/core' {
|
|||
|
||||
export default Node.create({
|
||||
name: 'article',
|
||||
defaultOptions: {
|
||||
HTMLAttributes: {
|
||||
'data-type': 'incut',
|
||||
},
|
||||
},
|
||||
group: 'block',
|
||||
content: 'block+',
|
||||
|
||||
|
@ -32,6 +27,12 @@ export default Node.create({
|
|||
return ['article', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]
|
||||
},
|
||||
|
||||
addOptions() {
|
||||
return {
|
||||
'data-type': 'incut',
|
||||
};
|
||||
},
|
||||
|
||||
addAttributes() {
|
||||
return {
|
||||
'data-float': {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Blockquote } from '@tiptap/extension-blockquote'
|
||||
import { Blockquote, BlockquoteOptions } from '@tiptap/extension-blockquote'
|
||||
|
||||
export type QuoteTypes = 'quote' | 'punchline'
|
||||
|
||||
|
@ -13,11 +13,13 @@ declare module '@tiptap/core' {
|
|||
|
||||
export const CustomBlockquote = Blockquote.extend({
|
||||
name: 'blockquote',
|
||||
defaultOptions: {
|
||||
HTMLAttributes: {},
|
||||
},
|
||||
group: 'block',
|
||||
content: 'block+',
|
||||
|
||||
addOptions(): BlockquoteOptions {
|
||||
return {} as BlockquoteOptions;
|
||||
},
|
||||
|
||||
addAttributes() {
|
||||
return {
|
||||
'data-float': {
|
||||
|
@ -33,15 +35,15 @@ export const CustomBlockquote = Blockquote.extend({
|
|||
addCommands() {
|
||||
return {
|
||||
toggleBlockquote:
|
||||
(type) =>
|
||||
({ commands }) => {
|
||||
return commands.toggleWrap(this.name, { 'data-type': type })
|
||||
},
|
||||
(type) => ({ commands }) => commands.toggleWrap(
|
||||
this.name,
|
||||
{ 'data-type': type }
|
||||
),
|
||||
setBlockQuoteFloat:
|
||||
(value) =>
|
||||
({ commands }) => {
|
||||
return commands.updateAttributes(this.name, { 'data-float': value })
|
||||
},
|
||||
(value) => ({ commands }) => commands.updateAttributes(
|
||||
this.name,
|
||||
{ 'data-float': value }
|
||||
),
|
||||
}
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue
Block a user