app/blokkli.editAdapter.ts and blökkli picks it up
automatically. No additional registration or import is required.
Creating the Adapter File
Create the file at the pathapp/blokkli.editAdapter.ts in the root of your Nuxt project:
ctx object that gives your adapter access to editor
internals at runtime:
ctx.eventBus— emit or listen to editor lifecycle events (e.g.'editor:save','block:added')ctx.state— a reactive reference to the current editor state, including the active entity type, entity UUID, and language
Required Methods
The seven methods below form the minimum viable adapter. blökkli will not fully initialise the editor unless all seven are present and return the expected shapes.Fetches the initial block state for the entity currently being edited. blökkli calls this once
when the editor mounts. Return a raw state object — the shape is up to you because
mapState() will transform it in the next step.Transforms the raw value returned by
loadState() into the normalised format blökkli expects
internally. Use this method to flatten nested API responses, rename fields, or compute derived
values before the editor renders anything.Returns an array of block bundle definitions that are registered in your system. Each entry
declares at minimum an
id (the machine name) and a label (the human-readable display name)
shown in the editor’s block picker.Returns the field configuration for the entity being edited. Each entry describes one
<BlokkliField> — its name, label, the entity it belongs to, and the allowedBundles array
that constrains which block types an editor can place into that field.Called every time the editor places a new block. Persist the new block to your backend inside
this method. The
options argument contains the bundle, the target hostField, and the
preceedingUuid of the block it should appear after (or null for the first position).Called when a single block is dragged to a new position within the same field or into a
different field. Reorder your backend data accordingly. The
options argument provides the
block uuid, the destination hostField, and the updated preceedingUuid.The multi-selection equivalent of
moveBlock(). Called when the editor moves two or more
selected blocks at once. The options argument provides a uuids array, the destination
hostField, and the preceedingUuid for the group.Minimal Working Example
The adapter below keeps blocks in local memory and logs operations to the console. It is useful for prototyping or exploring blökkli before wiring up a real backend:The seven methods above cover only the core editing surface. blökkli supports 50+ additional
optional adapter methods that unlock features such as clipboard operations, undo/redo history,
block duplication, translation support, media library integration, and content validation.
See the Adapter Methods API reference for the complete list
and their expected signatures.

