Bläck StudioPlugin SDK v1.0.0 · API 4
Contents

Start

Building

Beyond Bläck Studio

How it runs

Sharing

Look up

The editor

this.app.editor is about the editor the writer is in:

  • selection() gives the selected text and where it is.
  • insertText(text) types at the caret, over the selection.
  • comment(text) puts a margin comment on the selection.

The last two need project:write. In the window, active() gives the TipTap editor itself, for anything else. In a sandboxed plugin it's null.

For changes to how the editor works (new marks or nodes, input rules, keyboard shortcuts), register a TipTap extension with registerEditorExtension (window only). Marks that only show something, like a word to look at again, are better as a highlighter (addHighlighter). Bläck Studio draws those, never saves them, and they work sandboxed too.