Register a transform that can rewrite transactions before they apply.
Start a chained command sequence: editor.chain().focus().setHeading(2).run().
Forget every undo and redo group.
Run a command against the current state; dispatches when it applies.
Toolbar-facing snapshot.
Reference-stable while its contents are unchanged, not merely between
transactions, so typing a character returns the very same object, and a
toolbar subscribed through useSyncExternalStore, a signal or a store
does not re-render on every keystroke. It changes identity when something
a toolbar would actually draw differently changes: a mark, the block
type, whether undo is available.
Subscribers are still notified per transaction; what this decides is whether they have anything new to look at.
The undo and redo stacks as a history panel lists them.
Listen to applied transactions with their before/after states.
Replace the whole document: loading a saved file, switching documents,
restoring a draft. That is not an edit of the current text, so by default
the change stays out of the undo history and the history is cleared;
pass addToHistory: true to make the replacement undoable instead.
Toggle read-only mode on the attached view.
Turn the browser's spell checking of the editing surface on or off.
Subscribe to state changes (the contract external stores expect).
The headless editor: owns the state, dispatches transactions, records history and exposes commands. A DOM view attaches to it when an element is supplied.