@stesura/core/history
The undo history: core’s vendored prosemirror-history, with the same API. Use it in place of prosemirror-history; its undo and redo split bulk edits into chunks, and its transactions carry the history$ meta the editor’s plugins check.
Functions & values
closeHistory
Sets a flag on the transaction that keeps further steps from being appended to an existing history event (so that they require a separate undo command to undo).
| Name | Type | Default |
|---|---|---|
tr | Transaction |
history
The undo history plugin. Set an "addToHistory" meta of false on a transaction to keep undo
from rolling it back.
| Name | Type | Default |
|---|---|---|
config | HistoryOptions |
isHistoryTransaction
Whether the history plugin made this transaction.
| Name | Type | Default |
|---|---|---|
tr | Transaction |
redo
Redoes the last undone change, if any.
| Name | Type | Default |
|---|---|---|
state | EditorState | |
dispatch | (tr: Transaction) => void | |
view | EditorView |
redoDepth
The number of redoable events.
| Name | Type | Default |
|---|---|---|
state | EditorState |
redoNoScroll
redo without scrolling the selection into view.
| Name | Type | Default |
|---|---|---|
state | EditorState | |
dispatch | (tr: Transaction) => void | |
view | EditorView |
undo
Undoes the last change, if any. A large change is undone in chunks: dispatch it through applyWithContinuation.
| Name | Type | Default |
|---|---|---|
state | EditorState | |
dispatch | (tr: Transaction) => void | |
view | EditorView |
undoDepth
The number of undoable events.
| Name | Type | Default |
|---|---|---|
state | EditorState |
undoNoScroll
undo without scrolling the selection into view.
| Name | Type | Default |
|---|---|---|
state | EditorState | |
dispatch | (tr: Transaction) => void | |
view | EditorView |