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

Start

Building

Beyond Bläck Studio

How it runs

Sharing

Look up

The editor

this.app.editor works with the editor the writer is in:

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

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

To change how the editor works (new marks or nodes, input rules, keyboard shortcuts), register a TipTap extension with registerEditorExtension (window only). If a mark only shows something, like a word to look at again, a highlighter (addHighlighter) is a better fit. Bläck Studio draws highlights and never saves them, and they work in sandboxed plugins too.