ReadonlychangesThe document changes made by this transaction.
ReadonlyeffectsThe effects added to the transaction.
ReadonlyscrollWhether the selection should be scrolled into view after this transaction is dispatched.
ReadonlyselectionThe selection set by this transaction, or undefined if it doesn't explicitly set a selection.
ReadonlystartThe state from which the transaction starts.
StaticaddAnnotation indicating whether a transaction should be added to the undo history or not.
StaticremoteAnnotation indicating (when present and true) that a transaction represents a change made by some other actor, not the user. This is used, for example, to tag other people's changes in collaborative editing.
StatictimeAnnotation used to store transaction timestamps. Automatically
added to every transaction, holding Date.now().
StaticuserAnnotation used to associate a transaction with a user interface event. Holds a string identifying the event, using a dot-separated format to support attaching more specific information. The events used by the core libraries are:
"input" when content is entered
"input.type" for typed input
"input.type.compose" for composition"input.paste" for pasted input"input.drop" when adding content with drag-and-drop"input.complete" when autocompleting"delete" when the user deletes content
"delete.selection" when deleting the selection"delete.forward" when deleting forward from the selection"delete.backward" when deleting backward from the selection"delete.cut" when cutting to the clipboard"move" when content is moved
"move.drop" when content is moved within the editor through drag-and-drop"select" when explicitly changing the selection
"select.pointer" when selecting with a mouse or other pointing device"undo" and "redo" for history actionsUse isUserEvent to check
whether the annotation matches a given event.
Indicates whether the transaction changed the document.
The new document produced by the transaction. Contrary to
.state.doc, accessing this won't
force the entire new state to be computed right away, so it is
recommended that transaction
filters use this getter
when they need to look at the new document.
The new selection produced by the transaction. If
this.selection is undefined,
this will map the start state's
current selection through the changes made by the transaction.
Indicates whether this transaction reconfigures the state (through a configuration compartment or with a top-level configuration effect.
The new state created by the transaction. Computed on demand (but retained for subsequent access), so it is recommended not to access it in transaction filters when possible.
Get the value of the given annotation type, if any.
Returns true if the transaction has a user
event annotation that is equal to
or more specific than event. For example, if the transaction
has "select.pointer" as user event, "select" and
"select.pointer" will match it.
Changes to the editor state are grouped into transactions. Typically, a user action creates a single transaction, which may contain any number of document changes, may change the selection, or have other effects. Create a transaction by calling
EditorState.update, or immediately dispatch one by callingEditorView.dispatch.