feat: migrate Header tool to the Editor.js v3 SDK - #130
Open
Reversean wants to merge 1 commit into
Open
Conversation
The legacy Tool API (eager DOM construction in render(), attachInput wiring inputs directly) no longer exists in the current SDK. Text and level are now registered as model-backed keys, and the DOM is built lazily in response to adapter events. Depends on model/sdk/dom-adapters via workspace:^ and only builds inside a document-model workspace as a git submodule, not standalone. levels restricts which heading levels the toolbox and normalizeLevel accept, derived via the SDK's config-factory options mechanism.
Closed
gohabereg
reviewed
Jul 8, 2026
| this.#adapter.setInput('text', undefined); | ||
| this.#headingEl?.remove(); | ||
| this.#headingEl = undefined; | ||
| } else if (event instanceof ValueNodeChangedEvent) { |
neSpecc
reviewed
Jul 9, 2026
Reversean
added a commit
to editor-js/document-model
that referenced
this pull request
Jul 29, 2026
…)-derived toolbox ToolConfig becomes an SDK-owned contract instead of a permissive `any`-defaulted re-export from @editorjs/editorjs. A tool's prepare() can now return PreparedToolOptions to compute static options (currently `toolbox`) from its resolved config, captured per facade instance so it never mutates the shared static `options` across multiple Core instances. ToolsManager also warns at dev-time when a resolved config key is never read, catching drift like editor-js/header#130's unused `HeaderConfig.levels`. BREAKING CHANGE: ToolConfig is exported from @editorjs/sdk, not re-exported from @editorjs/editorjs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Reversean
force-pushed
the
feat/sdk-v3-migration
branch
2 times, most recently
from
August 26, 2026 15:17
1619d92 to
4bb45b8
Compare
neSpecc
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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 inrender().conversionConfig, andcanBeSplit.Supersedes #128 — that branch (
heading-v3) predates the data-first refactor indocument-modeland callsadapter.attachInput, which no longer exists in the current SDK.This package depends on
@editorjs/model/@editorjs/sdk/@editorjs/dom-adaptersviaworkspace:^and is intended to be used as a git submodule insidedocument-model'spackages/tools/header— it isn't buildable or testable standalone outside that workspace.Note: this
workspace:^setup is a stand-in untildocument-modelactually publishes usable (non-placeholder) versions ofmodel/sdk/dom-adaptersto npm — right now those packages are stuck at0.0.0and 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.