@vericus/slate-kit-history
Version:
plugin that group together history of selections to the next editing event on slate for undo/redo
22 lines • 601 B
JavaScript
import hotkeys from "slate-hotkeys";
import CreateCommands from "./commands";
import CreateQueries from "./queries";
export default function History() {
var queries = CreateQueries();
var commands = CreateCommands();
function onKeyDown(e, editor, next) {
if (hotkeys.isUndo(e)) {
return editor.handleUndo();
}
if (hotkeys.isRedo(e)) {
return editor.handleRedo();
}
return next();
}
return {
commands: commands,
queries: queries,
onKeyDown: onKeyDown,
};
}
//# sourceMappingURL=index.js.map