Skip to content

Commit 34844ec

Browse files
committed
feat: add undo and redo methods to editor API
1 parent 0279086 commit 34844ec

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/core/src/editor/BlockNoteEditor.ts

+14
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,20 @@ export class BlockNoteEditor<
10561056
return replaceBlocks(this, blocksToRemove, blocksToInsert);
10571057
}
10581058

1059+
/**
1060+
* Undo the last action.
1061+
*/
1062+
public undo() {
1063+
this._tiptapEditor.commands.undo();
1064+
}
1065+
1066+
/**
1067+
* Redo the last action.
1068+
*/
1069+
public redo() {
1070+
this._tiptapEditor.commands.redo();
1071+
}
1072+
10591073
/**
10601074
* Insert a piece of content at the current cursor position.
10611075
*

0 commit comments

Comments
 (0)