Skip to content
Document Authoring DA  API Docs v1.22.2
npmGitHub

ActionCapability>= v1.23.0

ActionCapability:

type ActionCapability =
| "document.read"
| "document.change"
| "history.change"
| "comments.change"
| "revisions.change"
| "objects.change"
| "editor.view.change"
| "editor.mode.change"
| "clipboard.write"
| "external.open";

The kind of change an action makes. The editor mode uses it to decide whether the action may run.

  • document.read: reads, searches or exports the document without changing it.
  • document.change: changes document content, formatting or structure, or opens a dialog whose purpose is to change the document, such as the link editor.
  • history.change: undoes or redoes changes.
  • comments.change: creates, replies to, edits, resolves or deletes comments.
  • revisions.change: accepts, rejects or creates tracked changes.
  • objects.change: changes an object’s placement, geometry or formatting.
  • editor.view.change: changes how the editor looks, or opens editor UI such as the command palette, without changing the document.
  • editor.mode.change: switches the editor mode.
  • clipboard.write: writes to the system clipboard.
  • external.open: opens an external destination, such as a hyperlink.

View mode allows document.read, editor.view.change, editor.mode.change, clipboard.write and external.open. Edit and review modes allow all capabilities; comments.change, revisions.change and objects.change are currently treated like document.change. An action can still be disabled by its isEnabled check.

Capabilities apply to actions, the commands registered with editor.setActions(), such as Bold or Export. Typing, moving the cursor and selecting text aren’t actions. Programmatic document APIs such as transaction() don’t follow the editor mode.