prosekit/pm/history
Re-exports from prosemirror-history.
Variables
Section titled “Variables”redoNoScroll
Section titled “redoNoScroll”-
const redoNoScroll:
Command
-
A command function that redoes the last undone change. Don’t scroll the selection into view.
undoNoScroll
Section titled “undoNoScroll”-
const undoNoScroll:
Command
-
A command function that undoes the last 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
undo
andredo
commands.You can set an
"addToHistory"
metadata property offalse
on a transaction to prevent it from being rolled back by undo.
redoDepth()
Section titled “redoDepth()”-
function redoDepth(
state
:EditorState
):any
-
The amount of redoable events available in a given editor state.
undoDepth()
Section titled “undoDepth()”-
function undoDepth(
state
:EditorState
):any
-
The amount of undoable events available in a given state.