Editor lifecycle

editor:blur#

Emitted when the editable area loses focus. Payload includes a reason string (for example outer-click, tab, escape).

Type: signal.

Payload:

  • reason — string — why a history entry was recorded
  • event — native DOM or input event (user-driven actions)

Example:

app.on('editor:blur', ({ reason, event }) => {
  console.log('editor:blur', { reason, event });
});

editor:change#

Emitted when editor content changes after sync. Payload includes { format } where format is html or json.

Type: signal.

Payload:

  • format — string — content format identifier

Example:

app.on('editor:change', ({ format }) => {
  console.log('editor:change', { format });
});

editor:disabled#

Emitted when the editor is switched to disabled mode (visible but not interactive). Emitted when the editor is switched to disabled mode.

Type: signal.

Payload: none.

Example:

app.on('editor:disabled', () => {
  // react to the signal
});

editor:empty#

Emitted when the document becomes empty.

Type: signal.

Payload: none.

Example:

app.on('editor:empty', () => {
  // react to the signal
});

editor:enabled#

Emitted when disabled mode is turned off and the editor becomes interactive again. Emitted when disabled mode is turned off.

Type: signal.

Payload: none.

Example:

app.on('editor:enabled', () => {
  // react to the signal
});

editor:focus#

Emitted when the editable area receives focus.

Type: signal.

Payload: none.

Example:

app.on('editor:focus', () => {
  // react to the signal
});

editor:mousedown#

Emitted on mousedown inside the editable area. Payload: { event }.

Type: signal.

Payload:

  • event — native DOM or input event (user-driven actions)

Example:

app.on('editor:mousedown', ({ event }) => {
  console.log('editor:mousedown', { event });
});

editor:mouseup#

Emitted on mouseup inside the editable area. Payload: { event }.

Type: signal.

Payload:

  • event — native DOM or input event (user-driven actions)

Example:

app.on('editor:mouseup', ({ event }) => {
  console.log('editor:mouseup', { event });
});

editor:readonly#

Emitted when readonly mode is enabled (content is selectable but not editable). Emitted when readonly mode is enabled.

Type: signal.

Payload: none.

Example:

app.on('editor:readonly', () => {
  // react to the signal
});

editor:readwrite#

Emitted when readonly mode is disabled. Emitted when readonly mode is disabled.

Type: signal.

Payload: none.

Example:

app.on('editor:readwrite', () => {
  // react to the signal
});

editor:ready#

Emitted once when the editor DOM is mounted, blocks are registered, and the editor is ready for interaction.

Type: signal.

Payload: none.

Example:

app.on('editor:ready', () => {
  // react to the signal
});