Skip to content

feat: migrate Header tool to the Editor.js v3 SDK#130

Open
Reversean wants to merge 4 commits into
v3from
feat/sdk-v3-migration
Open

feat: migrate Header tool to the Editor.js v3 SDK#130
Reversean wants to merge 4 commits into
v3from
feat/sdk-v3-migration

Conversation

@Reversean

@Reversean Reversean commented Jul 7, 2026

Copy link
Copy Markdown

Summary

  • Replace the legacy attachInput-based Tool API with the data-first model used by @editorjs/model/@editorjs/sdk: text and level are registered as model-backed keys, and the DOM is rendered lazily in response to adapter events instead of being built eagerly in render().
  • Add a toolbox with H1–H3 entries, conversionConfig, and canBeSplit.
  • Add unit test coverage.
  • Update README for the current API and document the workspace-only constraint below.

Supersedes #128 — that branch (heading-v3) predates the data-first refactor in document-model and calls adapter.attachInput, which no longer exists in the current SDK.

This package depends on @editorjs/model/@editorjs/sdk/@editorjs/dom-adapters via workspace:^ and is intended to be used as a git submodule inside document-model's packages/tools/header — it isn't buildable or testable standalone outside that workspace.

Note: this workspace:^ setup is a stand-in until document-model actually publishes usable (non-placeholder) versions of model/sdk/dom-adapters to npm — right now those packages are stuck at 0.0.0 and every publish run silently no-ops (Registry already knows about version 0.0.0; skipping), so real versions aren't available to depend on yet. Once that's fixed upstream, this package can move to plain semver ranges and become independently buildable/publishable again.

khaydarov and others added 3 commits April 14, 2026 20:26
Replace the legacy attachInput-based Tool API with the data-first
model used by @editorjs/model and @editorjs/sdk: register text and
level as model-backed keys and render the DOM lazily in response to
adapter events, instead of building elements eagerly in render().

Add a toolbox with H1-H3 entries, conversionConfig, and canBeSplit,
and cover the tool with unit tests.
@Reversean Reversean mentioned this pull request Jul 7, 2026
Replace the v2-era installation/config/output docs (default export,
shortcut config, plain-string text, unused levels option) with the
current named export and TextNodeSerialized-based text field.

Add a TODO note explaining this package only builds inside the
document-model workspace as a git submodule, and can't be installed
or published standalone yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants