editor — Note blocks

Add a custom block to Emberly's note editor.

Table of content
  1. Main methods
  2. Core flow
  3. Persistence and limits

Capabilities: editor and ui · Available in: live preview in an editable map with an open note.

Main methods

API Purpose
this.editor.registerBlockType(BlockClass) Register a custom note-block type
PluginAPI.EditorBlock Base class for the block
static toolbox Set the block's toolbox title
render(dom, data) Build the block's interface using the virtual DOM
renderSettings(dom, data) Build optional block settings
this.data Read and update the block's own JSON data
this.save() Save that data through Emberly's note pipeline

Core flow

  1. Create a plugin using the Note block template.
  2. Open an editable map and a note in another Emberly window.
  3. Connect live preview and approve editor and ui in that window.
  4. Insert the registered block from the note editor's toolbox.
  5. Edit the block and save its data. Save plugin source to update the running block's interface.

Persistence and limits

Saved block content remains when the plugin stops. Keep a readable fallback string in this.data so the content is useful without the plugin running.

Reloading a note does not automatically execute plugin code. Start and approve the plugin again to reconnect its existing blocks. A live source update rerenders blocks while preserving their saved note data.

This API saves the plugin's own block data. It does not provide unrestricted access to rewrite other note content. Block interfaces use the same restricted virtual DOM as the ui API.