prosekit/pm/history
Re-exports from prosemirror-history.
Variables
Section titled “Variables”undoNoScroll
Section titled “undoNoScroll”-
const undoNoScroll:Command -
A command function that undoes the last change. Don't scroll the selection into view.
redoNoScroll
Section titled “redoNoScroll”-
const redoNoScroll:Command -
A command function that redoes the last undone change. Don't scroll the selection into view.
Functions
Section titled “Functions”closeHistory()
Section titled “closeHistory()”-
function closeHistory(tr:Transaction):Transaction -
Set a flag on the given transaction that will prevent further steps from being appended to an existing history event (so that they require a separate undo command to undo).
history()
Section titled “history()”-
function history(config?:HistoryOptions):ProseMirrorPlugin -
Returns a plugin that enables the undo history for an editor. The plugin will track undo and redo stacks, which can be used with the
undoandredocommands.You can set an
"addToHistory"metadata property offalseon a transaction to prevent it from being rolled back by undo.
undoDepth()
Section titled “undoDepth()”-
function undoDepth(state:EditorState):any -
The amount of undoable events available in a given state.
redoDepth()
Section titled “redoDepth()”-
function redoDepth(state:EditorState):any -
The amount of redoable events available in a given editor state.