Inline tool render() → MenuConfig
render() { /* returns an HTMLElement button */ }render() { return { icon, name, onActivate, isActive }; }Every rename the codemod performs, the CSS map, and tool-by-tool compatibility.
Preview first, then apply.
npx -p @bloklabs/core migrate-from-editorjs ./src --dry-runnpx -p @bloklabs/core migrate-from-editorjs ./srcEvery rename the codemod performs, before and after.
import EditorJS from '@editorjs/editorjs';import { Blok } from '@bloklabs/core';import Header from '@editorjs/header';import { Header } from '@bloklabs/core/tools';import type { EditorConfig } from '@editorjs/editorjs';import type { BlokConfig } from '@bloklabs/core';.ce-block[data-blok-element]<div id="editorjs"></div><div id="blok"></div>data-iddata-blok-idBlok replaces Editor.js class names with data attributes. Map any custom styles with this reference.
.codex-editor[data-blok-editor].ce-block[data-blok-element].ce-block--selected[data-blok-selected="true"].ce-toolbar[data-blok-toolbar].ce-inline-toolbar[data-blok-testid="inline-toolbar"].ce-toolbar__settings-btn[data-blok-settings-toggler].ce-popover[data-blok-popover]data-placeholderdata-blok-placeholderBlock tools port unchanged. Inline tools return a MenuConfig — or wrap the old class and skip the rewrite.
render() { /* returns an HTMLElement button */ }render() { return { icon, name, onActivate, isActive }; }Wrap an existing EditorJS inline tool class instead of rewriting it. The shim maps the legacy API onto MenuConfig and keeps the tool's title, shortcut, sanitize config and icon. Without it, Blok skips a legacy HTMLElement render() and the tool silently vanishes.
marker: wrapLegacyInlineTool(MarkerTool)Blok reads the same keys — render, save, validate, renderSettings, merge, onPaste, and the toolbox/conversionConfig statics. Optionally add setReadOnly(state) for cheaper read-only toggling.
When migration drops a field with no Blok equivalent, it logs a console.warn naming the block and field — the loss is never silent. Check this table before migrating if you depend on any of them.
quotealignment (caption is auto-migrated into a following paragraph)imagewithBackgroundlinkToolmeta.site_namelist itemmeta (dropped silently — no console.warn)Compatibility depends on the tools your content uses, not on your Editor.js version.
These tools load your saved data as-is.
paragraphheadercodeembedmarkerinlineCodeaudioConverted at runtime, by the codemod, or both.
listchecklisttoggleListcalloutimagesimple-imagelinkTooldelimiterquotetablerawwarningattachesBlok ships no equivalent — register your own tool or keep the Editor.js one.
personalitybuttonUnknown block types render as stubs and log a "Tool «name» is not found" warning. Their data is preserved — register the tool later and the block comes back.