Skip to content
GitHub

prosekit/pm/history

Re-exported from prosemirror-history.

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

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 and redo commands.

You can set an "addToHistory" metadata property of false on a transaction to prevent it from being rolled back by undo.

redo

A command function that redoes the last undone change, if any.

function redo(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean

redoDepth

function redoDepth(state: EditorState): any

The amount of redoable events available in a given editor state.

redoNoScroll

A command function that redoes the last undone change. Don’t scroll the selection into view.

function redoNoScroll(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean

undo

A command function that undoes the last change, if any.

function undo(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean

undoDepth

function undoDepth(state: EditorState): any

The amount of undoable events available in a given state.

undoNoScroll

A command function that undoes the last change. Don’t scroll the selection into view.

function undoNoScroll(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean