feat: migrate Header tool to the Editor.js v3 SDK#130
Open
Reversean wants to merge 4 commits into
Open
Conversation
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.
Closed
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.
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.