refactoring

This commit is contained in:
Philipp Kühn
2021-02-10 18:05:02 +01:00
parent f70974678b
commit 55ff908423
69 changed files with 519 additions and 527 deletions

View File

@@ -9,8 +9,17 @@ export interface BlockquoteOptions {
declare module '@tiptap/core' {
interface Commands {
/**
* Set a blockquote node
*/
setBlockquote: () => Command,
/**
* Toggle a blockquote node
*/
toggleBlockquote: () => Command,
/**
* Unset a blockquote node
*/
unsetBlockquote: () => Command,
}
}
@@ -43,21 +52,12 @@ export const Blockquote = Node.create({
addCommands() {
return {
/**
* Set a blockquote node
*/
setBlockquote: () => ({ commands }) => {
return commands.wrapIn('blockquote')
},
/**
* Toggle a blockquote node
*/
toggleBlockquote: () => ({ commands }) => {
return commands.toggleWrap('blockquote')
},
/**
* Unset a blockquote node
*/
unsetBlockquote: () => ({ commands }) => {
return commands.lift('blockquote')
},