forked from github/cinny
Add editor history (#1284)
* add slate editor history * reset mark on editor reset
This commit is contained in:
@@ -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 = (
|
||||
|
||||
Reference in New Issue
Block a user