Add editor history (#1284)

* add slate editor history

* reset mark on editor reset
This commit is contained in:
Ajay Bura 2023-06-16 11:11:03 +10:00 committed by GitHub
parent bc5e7445d9
commit 41f67cabc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 6 deletions

View file

@ -124,6 +124,15 @@ export const resetEditor = (editor: Editor) => {
});
toggleBlock(editor, BlockType.Paragraph);
removeAllMark(editor);
};
export const resetEditorHistory = (editor: Editor) => {
// eslint-disable-next-line no-param-reassign
editor.history = {
undos: [],
redos: [],
};
};
export const createMentionElement = (