editor — Note blocks
Add a custom block to Emberly's note editor.
Table of content
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
- Create a plugin using the Note block template.
- Open an editable map and a note in another Emberly window.
- Connect live preview and approve
editoranduiin that window. - Insert the registered block from the note editor's toolbox.
- 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.