Repository navigation
feat(editorjs): add batteries-included bundle package and make core headless - #183
Merged
Merged
Conversation
Contributor
Unit Tests
Mutation Tests
|
…eadless Introduce `@editorjs/editorjs`, a batteries-included entry point that composes `@editorjs/core` with the default DOM adapter, collaboration, tools, plugins, and UI, auto-initializes in its constructor, and exposes an `isReady` promise. It honors a v2-style `config.tools` map merged over the defaults with override-by-name. To support it, `Core` becomes a headless engine: - Remove the hardcoded default tool/plugin/infra `use()` calls from the constructor; drop the corresponding dependencies. - `initialize()` now fails loudly: it throws when no rendering adapter is registered or the `defaultBlock` tool is missing, and re-throws init failures instead of swallowing them. `ShortcutsPlugin` stays in `@editorjs/core` (no longer auto-registered); its relocation is handled by a separate change. Free the `@editorjs/editorjs` package name by aliasing the published v2 dependency as `editorjs-v2` (`npm:@editorjs/editorjs@…`) across core, sdk, ui, and tools/paragraph. The playground now consumes `@editorjs/editorjs` instead of wiring `Core` and UI by hand. Specs updated via OpenSpec change `add-editorjs-bundle-package` (archived). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
gohabereg
force-pushed
the
feat/editorjs-bundle-package
branch
from
July 22, 2026 21:29
433933c to
182b01d
Compare
…gration test Core no longer depends on `@editorjs/dom-adapters`, so its dist is not built in CI when checking `@editorjs/core`. The leftover `jest.unstable_mockModule` call still resolved the specifier, failing the suite (and the Stryker dry run) with "Cannot find module '@editorjs/dom-adapters'". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Runs lint, build and unit tests for the new bundle package on pull requests and merge groups, mirroring the other package workflows. Mutation tests are disabled since the package has no Stryker config yet. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`tsc --build` only produces output for TypeScript project references, so `@editorjs/ui` — which is bundled by vite — had no `dist/ui.js` after building `@editorjs/editorjs` from a clean checkout. Jest then failed to resolve `@editorjs/ui` in the bundle test. Build dependencies first via `yarn workspaces foreach`, mirroring how the playground package builds its own dependency graph. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new batteries-included @editorjs/editorjs bundle package and refactors @editorjs/core into a truly headless engine by removing hardcoded defaults and adding fail-loud precondition checks. It also aliases the legacy v2 @editorjs/editorjs dependency as editorjs-v2 across the workspace to free the @editorjs/editorjs name, and updates the playground to consume the new bundle.
Changes:
- Add
packages/editorjs(@editorjs/editorjs) that composesCore+ DOM adapter + collaboration + default tools/plugins + UI and auto-initializes withisReady. - Make
@editorjs/coreheadless (no defaultuse()registrations) and add synchronous initialization precondition validation. - Alias v2
@editorjs/editorjsaseditorjs-v2and update imports/dependencies; switch the playground to the new bundle.
Reviewed changes
Copilot reviewed 46 out of 47 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Updates workspace lockfile for new package and editorjs-v2 aliasing. |
| packages/ui/package.json | Replaces direct v2 @editorjs/editorjs dependency with editorjs-v2 alias. |
| packages/tools/paragraph/src/index.ts | Updates v2 type imports to use editorjs-v2. |
| packages/tools/paragraph/package.json | Swaps v2 @editorjs/editorjs dependency for editorjs-v2 alias. |
| packages/sdk/src/tools/facades/BlockTuneFacade.ts | Updates v2 type imports to use editorjs-v2. |
| packages/sdk/src/tools/facades/BlockToolFacade.ts | Updates v2 type imports to use editorjs-v2. |
| packages/sdk/src/tools/facades/BaseToolFacade.ts | Updates v2 type imports to use editorjs-v2. |
| packages/sdk/src/entities/InlineTool.ts | Updates v2 type imports to use editorjs-v2. |
| packages/sdk/src/entities/EventBus/events/core/BlockAddedCoreEvent.ts | Updates v2 type imports to use editorjs-v2. |
| packages/sdk/src/entities/Config.ts | Updates EditorConfig type source to editorjs-v2. |
| packages/sdk/src/entities/BlockTune.ts | Updates v2 type imports to use editorjs-v2. |
| packages/sdk/src/entities/BlockTool.ts | Updates v2 type imports to use editorjs-v2. |
| packages/sdk/src/entities/BaseTool.ts | Updates v2 type imports to use editorjs-v2. |
| packages/sdk/src/api/BlocksAPI.ts | Updates v2 type imports to use editorjs-v2. |
| packages/sdk/package.json | Replaces v2 @editorjs/editorjs dependency with editorjs-v2 alias. |
| packages/playground/src/App.vue | Switches from manual Core+UI wiring to new EditorJS() bundle usage. |
| packages/playground/package.json | Simplifies deps by depending on @editorjs/editorjs bundle. |
| packages/editorjs/tsconfig.json | Adds TS project config for new bundle package. |
| packages/editorjs/tsconfig.eslint.json | Adds ESLint TS project config for the new package. |
| packages/editorjs/tsconfig.build.json | Adds build-specific TS project config for the new package. |
| packages/editorjs/src/mergeTools.ts | Adds override-by-name merge helper for default + user tool constructors. |
| packages/editorjs/src/mergeTools.spec.ts | Adds unit tests for tool merging semantics. |
| packages/editorjs/src/index.ts | Implements EditorJS bundle class composition + isReady. |
| packages/editorjs/src/index.spec.ts | Adds bundle tests for composition and isReady resolve/reject behavior. |
| packages/editorjs/package.json | Defines the new @editorjs/editorjs workspace package and scripts. |
| packages/editorjs/jest.config.ts | Adds Jest config for new package tests (ESM + TS). |
| packages/editorjs/eslint.config.mjs | Adds ESLint config for the new package. |
| packages/editorjs/.gitignore | Adds package-local ignores for build/test artifacts. |
| packages/core/tsconfig.json | Removes build references to defaults now moved out of core. |
| packages/core/tsconfig.build.json | Removes build references to defaults now moved out of core. |
| packages/core/src/utils/composeDataFromVersion2.ts | Updates v2 type imports to use editorjs-v2. |
| packages/core/src/tools/ToolsManager.ts | Updates v2 type imports to use editorjs-v2. |
| packages/core/src/tools/ToolsFactory.ts | Updates v2 type imports to use editorjs-v2. |
| packages/core/src/index.ts | Removes default registrations and adds precondition validation + rethrow behavior. |
| packages/core/src/components/BlockRenderer.ts | Switches v2 imports to editorjs-v2. |
| packages/core/src/components/BlockManager.ts | Switches v2 imports to editorjs-v2. |
| packages/core/src/api/BlocksAPI.integration.spec.ts | Adjusts test scaffolding/mocks in response to refactors. |
| packages/core/package.json | Drops baked-in defaults; adds editorjs-v2 alias dependency. |
| openspec/specs/editorjs-bundle/spec.md | Adds main spec for the new bundle capability. |
| openspec/specs/core/spec.md | Updates core spec to reflect headless + fail-loud initialization behavior. |
| openspec/changes/archive/2026-07-22-add-editorjs-bundle-package/tasks.md | Archives change tasks and implementation checklist. |
| openspec/changes/archive/2026-07-22-add-editorjs-bundle-package/specs/editorjs-bundle/spec.md | Archives delta spec for new bundle capability. |
| openspec/changes/archive/2026-07-22-add-editorjs-bundle-package/specs/core/spec.md | Archives delta spec for core headless behavior changes. |
| openspec/changes/archive/2026-07-22-add-editorjs-bundle-package/proposal.md | Archives the change proposal for traceability. |
| openspec/changes/archive/2026-07-22-add-editorjs-bundle-package/design.md | Archives the design decisions and trade-offs. |
| openspec/changes/archive/2026-07-22-add-editorjs-bundle-package/.openspec.yaml | Adds archived change metadata for OpenSpec workflow. |
| .github/workflows/editorjs.yml | Adds CI workflow to run package-check for @editorjs/editorjs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+178
to
+182
| } catch (error) { | ||
| console.error('Editor.js initialization failed', error); | ||
|
|
||
| throw error; | ||
| } |
Comment on lines
11
to
14
| import { TOKENS } from '../tokens.js'; | ||
| import ToolsManager from '../tools/ToolsManager.js'; | ||
| import { BlockAPI } from '@editorjs/editorjs'; | ||
| import { BlockAPI } from 'editorjs-v2'; | ||
| import { |
Comment on lines
16
to
20
| import { TOKENS } from '../tokens.js'; | ||
| import ToolsManager from '../tools/ToolsManager.js'; | ||
| import { BlockToolData } from '@editorjs/editorjs'; | ||
| import { BlockToolData } from 'editorjs-v2'; | ||
| import { CoreConfigValidated, EventBus } from '@editorjs/sdk'; | ||
|
|
Comment on lines
62
to
65
| }); | ||
|
|
||
| core | ||
| .use(EditorjsUI) | ||
| .use(BlocksUI) | ||
| .use(InlineToolbarUI) | ||
| .use(ToolbarUI) | ||
| .use(ToolboxUI) | ||
| .initialize(); | ||
| void editor.isReady; | ||
| }); |
Comment on lines
+22
to
+26
| if (userTools !== undefined) { | ||
| for (const [name, tool] of Object.entries(userTools)) { | ||
| merged.set(name, tool); | ||
| } | ||
| } |
Comment on lines
+3
to
+5
| ## Purpose | ||
| TBD - created by archiving change add-editorjs-bundle-package. Update Purpose after archive. | ||
| ## Requirements |
- Core.initialize() no longer logs to console.error before re-throwing (dead try/catch removed) - BlockRenderer/BlockManager import editorjs-v2 types with `import type` instead of pulling it in as a runtime dependency - Playground attaches a .catch() to editor.isReady instead of discarding the promise, avoiding an unhandled rejection - mergeTools() now throws when a config.tools key doesn't match the tool's static name, since Core looks up tools by name, not map key - editorjs-bundle spec: replaced TBD Purpose and documented the new fail-loud mismatch scenario Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ilyamore88
approved these changes
Jul 23, 2026
Reversean
requested changes
Aug 2, 2026
Resolve conflicts in favor of the headless-core direction: `@editorjs/core` keeps no default tool/plugin/infra registrations, dependencies, or project references, so main's `@editorjs/shortcuts-plugin` wiring in core is dropped. Register `ShortcutsPlugin` from the newly extracted `@editorjs/shortcuts-plugin` package in the `@editorjs/editorjs` bundle instead, which is where default plugins now live. The core spec's keyboard-shortcuts requirement is removed (it moved to `openspec/specs/shortcuts-plugin/spec.md` on main), and the bundle spec's default-composition scenario now lists shortcuts alongside clipboard. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ange The `@editorjs/shortcuts-plugin` extraction landed on main while this PR was open, so the archived `add-editorjs-bundle-package` change is updated in place rather than superseded: the bundle now registers `ShortcutsPlugin` from that package instead of deferring it. - delta + main `editorjs-bundle` spec: default composition lists clipboard and shortcuts - proposal/design: shortcuts is consumed from `@editorjs/shortcuts-plugin`, not left behind in core - tasks 2.3/3.2/3.3/3.4 reflect what shipped; 4.6 added to re-verify CMD+B end-to-end through the bundle Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`packages/ui/index.html` constructed `Core` with no rendering adapter and no block tool, relying on the defaults core used to register itself. Now that `initialize()` validates its preconditions, that page threw immediately. Register `DOMAdapters` and `Paragraph` explicitly. While wiring that up: `@editorjs/dom-adapters`, `@editorjs/core` and `editorjs-v2` were declared as production dependencies of `@editorjs/ui` but never imported by `packages/ui/src` — dom-adapters has been unused since the package was bootstrapped in #96. Only the demo page needs core and dom-adapters, so they move to devDependencies alongside the new `@editorjs/paragraph`; `editorjs-v2` is dropped outright. The matching stale entries are removed from the vite externals list and from both tsconfigs' project references, which were forcing needless build-order edges from ui to core and dom-adapters. The built bundle is byte-identical (85.72 kB / 67.57 kB, 28 modules), confirming the removed externals were no-ops. Demo page verified in a browser: renders all three paragraphs, no console errors. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The headless refactor made `initialize()` validate that a rendering adapter and the `defaultBlock` tool are registered, but core had no `index.spec.ts` at all, so the new contract — and the two error messages callers are meant to act on — was untested while `openspec/specs/core/spec.md` already carried its scenarios. Drives a real `Core` with real IoC containers and model, registering stub adapter/block tool/plugin through `use()`, per review feedback on PR #183: - throws naming the rendering adapter when none is registered - throws naming `defaultBlock` when it is missing, and when a differently named block tool is registered instead - resolves when adapter, default block tool and plugin are all registered - constructs registered plugins during boot No DOM environment is needed: with an empty document and stub registrations the boot sequence never reaches into the holder, so this runs under core's existing `node` test environment with no new dependencies. Core: 166/166 pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ducer Re-verified in the playground: registering `ShortcutsPlugin` in the bundle is not enough to make CMD+B work. The plugin subscribes to `ui:key-down`, but no code on this branch dispatches `KeydownUIEvent` — `Blocks.ts` handles CMD+Z/CMD+SHIFT+Z inline and returns early for every other key. The dispatch arrives with PR #184. Isolated the failure: the inline toolbar's B button applies `<b>` to the same selection, so formatting works and only the shortcut path is dead. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Conflicts resolved: - packages/core/src/index.ts: kept the headless Core from this branch (no default tool/plugin/adapter registration, fail-loud `#validatePreconditions`, no swallowing try/catch) while taking main's `PluginRegistry` wiring and its reordering of `UndoRedoManager` to after plugin/tool init. - packages/sdk/src/entities/BaseTool.ts, InlineTool.ts and packages/tools/paragraph/src/index.ts: `ToolConfig` now comes from the SDK's own definition (main) instead of the v2 package; remaining v2 type imports keep this branch's `editorjs-v2` alias, since `@editorjs/editorjs` is now the bundle. - packages/ui/package.json: union of both devDependency sets. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… headless Core Two loose ends this branch owned: `architecture` still asserted "Default adapter is DOMAdapters" — that Core's constructor calls `this.use(DOMAdapters)`. True at merge-base and still true on main, but this branch made Core headless and dropped that call, so the scenario was false here and contradicted core/spec.md's "No adapter registered fails loudly". The bundle change wrote deltas for `core` and `editorjs-bundle` and missed that the same fact was asserted in `architecture` too. Replaced with "No adapter is bound by default", and tightened the parent requirement to say Core never binds an adapter itself. Task 4.6 was blocked on nothing dispatching `KeydownUIEvent`. That producer landed with #184 (Blocks.ts:125), now merged in. Re-verified in the playground through the bundle: CMD+B bolds and toggles off, CMD+I italicizes, toolbar active states track the model. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Not this branch's debt — these are already wrong on main today, and arrived here via the merge. Fixing them while the context is fresh rather than leaving them. `tools` described Bold/Italic as declaring flat `shortcut: 'CMD+B'` / `'CMD+I'` properties. #184 moved both to `static options.plugins.shortcuts.shortcut` without updating the spec, which left it contradicting shortcuts-plugin's own "Legacy flat shortcut key is ignored" scenario. `plugin-public-api` and `tool-plugin-options` still carried the generated "TBD - created by archiving change add-plugin-public-api" placeholder. Written up as mirror images of each other — API a plugin exposes to consumers vs. config a tool addresses to a plugin — cross-linked both ways. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Reversean
approved these changes
Aug 27, 2026
gohabereg
added a commit
that referenced
this pull request
Aug 27, 2026
main landed the squashed bundle package (#183) plus work this branch predates, so the overlap had to be reconciled by hand: - ShortcutsPlugin: kept main's extraction into @editorjs/shortcuts-plugin — the bundle depends on it, registers it as a default plugin, and core no longer ships it. Added to editorjs's package.json, tsconfigs and index.ts alongside ClipboardPlugin. - ToolConfig now comes from @editorjs/sdk (#188) instead of editorjs-v2; dropped the alias import in sdk entities and paragraph while keeping this branch's ARIA changes in paragraph. - Core.initialize resolves UndoRedoManager after plugins/tools (main's ordering) and registers PluginRegistry. - packages/ui: took main's chokidar dev script and dependency reshuffle, kept this branch's @editorjs/ui-kit ^2.0.0 pin. - openspec: took main's archived bundle change and updated core/editorjs-bundle specs; this branch's add-editor-aria-semantics change is untouched. - Playwright/e2e tooling, .gitignore, eslint config and the e2e CI job are kept from this branch. yarn.lock was regenerated from main's and still has no @editorjs/ui-kit entry: 2.0.0 is not published yet, so `yarn install` fails exactly as it did on this branch before the merge. Verified with the workspace's tsc/jest directly — core (179), editorjs (8) pass; core, paragraph, shortcuts-plugin and editorjs typecheck; packages/ui's three errors are the unpublished ui-kit 2.0.0 APIs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
gohabereg
added a commit
to SAY-5/document-model
that referenced
this pull request
Oct 16, 2026
…-js#187) * feat(editorjs): add batteries-included bundle package and make core headless Introduce `@editorjs/editorjs`, a batteries-included entry point that composes `@editorjs/core` with the default DOM adapter, collaboration, tools, plugins, and UI, auto-initializes in its constructor, and exposes an `isReady` promise. It honors a v2-style `config.tools` map merged over the defaults with override-by-name. To support it, `Core` becomes a headless engine: - Remove the hardcoded default tool/plugin/infra `use()` calls from the constructor; drop the corresponding dependencies. - `initialize()` now fails loudly: it throws when no rendering adapter is registered or the `defaultBlock` tool is missing, and re-throws init failures instead of swallowing them. `ShortcutsPlugin` stays in `@editorjs/core` (no longer auto-registered); its relocation is handled by a separate change. Free the `@editorjs/editorjs` package name by aliasing the published v2 dependency as `editorjs-v2` (`npm:@editorjs/editorjs@…`) across core, sdk, ui, and tools/paragraph. The playground now consumes `@editorjs/editorjs` instead of wiring `Core` and UI by hand. Specs updated via OpenSpec change `add-editorjs-bundle-package` (archived). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(core): drop stale @editorjs/dom-adapters mock from BlocksAPI integration test Core no longer depends on `@editorjs/dom-adapters`, so its dist is not built in CI when checking `@editorjs/core`. The leftover `jest.unstable_mockModule` call still resolved the specifier, failing the suite (and the Stryker dry run) with "Cannot find module '@editorjs/dom-adapters'". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * ci: add package check workflow for @editorjs/editorjs Runs lint, build and unit tests for the new bundle package on pull requests and merge groups, mirroring the other package workflows. Mutation tests are disabled since the package has no Stryker config yet. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(editorjs): build workspace dependencies before the bundle `tsc --build` only produces output for TypeScript project references, so `@editorjs/ui` — which is bundled by vite — had no `dist/ui.js` after building `@editorjs/editorjs` from a clean checkout. Jest then failed to resolve `@editorjs/ui` in the bundle test. Build dependencies first via `yarn workspaces foreach`, mirroring how the playground package builds its own dependency graph. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(editorjs): address Copilot review comments on PR editor-js#183 - Core.initialize() no longer logs to console.error before re-throwing (dead try/catch removed) - BlockRenderer/BlockManager import editorjs-v2 types with `import type` instead of pulling it in as a runtime dependency - Playground attaches a .catch() to editor.isReady instead of discarding the promise, avoiding an unhandled rejection - mergeTools() now throws when a config.tools key doesn't match the tool's static name, since Core looks up tools by name, not map key - editorjs-bundle spec: replaced TBD Purpose and documented the new fail-loud mismatch scenario Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * test(editorjs): add Playwright e2e suite and propose ARIA semantics change Adds a Playwright e2e setup for @editorjs/editorjs (Vite-served fixture mounting the real bundle from src/, no build step) covering paragraph rendering, typing, and inline-toolbar bold. Documents a gotcha where locator.press()/selectText() desync Editor.js's native caret tracking. Writing these tests surfaced that @editorjs/ui and the paragraph tool emit no ARIA roles/names anywhere, forcing CSS-class selectors instead of getByRole/getByLabel. Proposes openspec change add-editor-aria-semantics to close that gap. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(openspec/aria): move role=textbox from holder to per-block; add webkit e2e target Replace role="textbox" on the blocks holder with role="group" to avoid nesting a textbox inside another textbox — contenteditable elements implicitly carry role="textbox" via HTML-AAM regardless of explicit role, so putting it on the holder too would be an ARIA anti-pattern. Instead, assign role="textbox" + aria-multiline="true" + aria-label to each block's own contenteditable element (starting with Paragraph). Update proposal, design decisions, specs (ui + tools), and task checklist to reflect the revised approach. Also adds webkit (Desktop Safari) as a second Playwright project alongside chromium in packages/editorjs/playwright.config.ts. * feat(ui,paragraph): expose ARIA semantics and cover them with e2e The editor emitted zero roles or accessible names, which made it unusable with a screen reader and forced the e2e suite onto CSS-class selectors. - BlocksUI: role="group" on the holder, so the block textboxes are not nested inside a textbox the holder would otherwise imply - Paragraph: role="textbox", aria-multiline, aria-label, and the configured placeholder as aria-placeholder - ToolbarUI: role="toolbar" with a roving tabindex, named plus button, aria-haspopup/aria-expanded, and focus moved to the button on open so Safari restores it there rather than to <body> - InlineToolbarUI: named toolbar, aria-activedescendant mirrored from ui-kit's highlight and made resolvable with aria-owns, plus a live region announcing the toolbar once per open - Popover item roles and names come from @editorjs/ui-kit 2.0.0, fixed upstream rather than worked around from here Covered by aria.spec.ts, axe.spec.ts and a VoiceOver suite driving a real screen reader (voiceover.spec.ts, macOS-only, excluded from test:e2e). Note: @editorjs/ui-kit 2.0.0 is not published yet, so the lockfile has no entry for it and `yarn install` fails. The local `link:` resolution the work was developed against has been removed deliberately — see tasks.md 5a.2/5a.3. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * ci: run the @editorjs/editorjs e2e suite on pull requests The ARIA semantics the UI now depends on are enforced only by Playwright — nothing in the type surface catches a dropped role or accessible name, so until now a regression could land unnoticed. Adds an `include-e2e` input to the reusable package-check workflow and an `e2e-tests` composite action that installs chromium and webkit (cached by lockfile hash) and runs `test:e2e`. Kept as its own job: it needs browsers and takes minutes, and its failures read differently from a unit test's. `voiceover.spec.ts` stays excluded — screen readers cannot run headless. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(ui): announce the inline toolbar again after it is closed with Escape Escape closes the popover inside ui-kit, without going through #hide(), so #isVisible stayed true and every later appearance was taken for a reselection while already open: the toolbar was never announced again. Listen for PopoverEvent.Closed to reset it. The listener is removed before the popover is destroyed, since destroy() emits Closed as well and a rebuild would otherwise re-announce the toolbar on every selection change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * ci(editorjs): write the Playwright html report the e2e action uploads With only the list reporter nothing was written to playwright-report/, so the upload step had nothing to upload and the traces recorded on a retry were lost with the runner. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * ci: key the Playwright browser cache by the Playwright version Hashing yarn.lock dropped the ~400MB browser cache on any unrelated dependency bump. Each Playwright release pins its own browser builds, so the installed version is all the key needs. Also bump upload-artifact to v7, in line with the other actions. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * chore(deps): bump @editorjs/dom to ^1.2.0 and dedupe it @editorjs/ui-kit 2.0.0 depends on @editorjs/dom ^1.2.0, while the workspace packages still asked for ^1.1.0. Yarn will not re-resolve an already-locked entry, so the two ranges resolved separately and node_modules ended up with two copies of @editorjs/dom - including a nested one under @editorjs/caret, which pins ^1.1.0 transitively. Two copies split module state and break any identity check across the boundary. Widen the workspace ranges to ^1.2.0 and run `yarn dedupe @editorjs/dom` so both ranges collapse onto a single 1.2.0 resolution. The lockfile also gains the @editorjs/ui-kit 2.0.0 resolution it was missing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * refactor(ui,editorjs): drop dead popover field and reuse the e2e helpers `#popoverElement` was only ever written: assigned from `getElement()`, used as the receiver for the id and the append, then nulled in the teardown. A local covers all three, and dropping the field removes a second piece of state that had to be kept in step with `#popover` for no one's benefit. `editor.spec.ts` was the only spec reimplementing the mount-and-wait sequence and the triple-click selection instead of importing `mountDocument` and `selectParagraphText`. The readiness signal it waited on lives in the fixture, so a change there would have fixed the three specs using the helpers and left this one timing out. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs(openspec): record the ui-kit publish as done and fix a stale claim 5a.3 was still written as the blocking, not-yet-done publish. @editorjs/ui-kit 2.0.0 is published, the lockfile resolves it, and the suite was re-run against the published package: build, 973 unit tests, 80 e2e on both engines, lint. The task now also records the duplicate @editorjs/dom the regeneration surfaced and the dedupe that resolved it, since @editorjs/caret still pins the old range. The verification summary listed the same publish as an outstanding blocker and its verdict turned on it; both now say otherwise. Case 18's comment credited the CSS class with removing filtered items from the accessibility tree. ui-kit sets `hidden` alongside the class and that is what does it - as the spec and aria.spec.ts both already said. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs(openspec): drop the three deferred findings from tasks.md 10.5b, 10.7b and 10.8 were records of pre-existing bugs the change deliberately did not fix, not work items. Every archived change here has zero unchecked tasks, so as encoded they would have blocked archiving and reported 69/72. The findings themselves are preserved outside the repo. What referenced them by number - the proposal, the design note, 10.1c, 10.7a and the verification summary - now describes the bug instead, so nothing points at a task that is gone. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * chore(openspec): archive add-editor-aria-semantics --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
gohabereg
added a commit
to SAY-5/document-model
that referenced
this pull request
Oct 16, 2026
* feat(editorjs): add batteries-included bundle package and make core headless Introduce `@editorjs/editorjs`, a batteries-included entry point that composes `@editorjs/core` with the default DOM adapter, collaboration, tools, plugins, and UI, auto-initializes in its constructor, and exposes an `isReady` promise. It honors a v2-style `config.tools` map merged over the defaults with override-by-name. To support it, `Core` becomes a headless engine: - Remove the hardcoded default tool/plugin/infra `use()` calls from the constructor; drop the corresponding dependencies. - `initialize()` now fails loudly: it throws when no rendering adapter is registered or the `defaultBlock` tool is missing, and re-throws init failures instead of swallowing them. `ShortcutsPlugin` stays in `@editorjs/core` (no longer auto-registered); its relocation is handled by a separate change. Free the `@editorjs/editorjs` package name by aliasing the published v2 dependency as `editorjs-v2` (`npm:@editorjs/editorjs@…`) across core, sdk, ui, and tools/paragraph. The playground now consumes `@editorjs/editorjs` instead of wiring `Core` and UI by hand. Specs updated via OpenSpec change `add-editorjs-bundle-package` (archived). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(core): drop stale @editorjs/dom-adapters mock from BlocksAPI integration test Core no longer depends on `@editorjs/dom-adapters`, so its dist is not built in CI when checking `@editorjs/core`. The leftover `jest.unstable_mockModule` call still resolved the specifier, failing the suite (and the Stryker dry run) with "Cannot find module '@editorjs/dom-adapters'". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * ci: add package check workflow for @editorjs/editorjs Runs lint, build and unit tests for the new bundle package on pull requests and merge groups, mirroring the other package workflows. Mutation tests are disabled since the package has no Stryker config yet. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(editorjs): build workspace dependencies before the bundle `tsc --build` only produces output for TypeScript project references, so `@editorjs/ui` — which is bundled by vite — had no `dist/ui.js` after building `@editorjs/editorjs` from a clean checkout. Jest then failed to resolve `@editorjs/ui` in the bundle test. Build dependencies first via `yarn workspaces foreach`, mirroring how the playground package builds its own dependency graph. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(editorjs): address Copilot review comments on PR editor-js#183 - Core.initialize() no longer logs to console.error before re-throwing (dead try/catch removed) - BlockRenderer/BlockManager import editorjs-v2 types with `import type` instead of pulling it in as a runtime dependency - Playground attaches a .catch() to editor.isReady instead of discarding the promise, avoiding an unhandled rejection - mergeTools() now throws when a config.tools key doesn't match the tool's static name, since Core looks up tools by name, not map key - editorjs-bundle spec: replaced TBD Purpose and documented the new fail-loud mismatch scenario Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * test(editorjs): add Playwright e2e suite and propose ARIA semantics change Adds a Playwright e2e setup for @editorjs/editorjs (Vite-served fixture mounting the real bundle from src/, no build step) covering paragraph rendering, typing, and inline-toolbar bold. Documents a gotcha where locator.press()/selectText() desync Editor.js's native caret tracking. Writing these tests surfaced that @editorjs/ui and the paragraph tool emit no ARIA roles/names anywhere, forcing CSS-class selectors instead of getByRole/getByLabel. Proposes openspec change add-editor-aria-semantics to close that gap. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(openspec/aria): move role=textbox from holder to per-block; add webkit e2e target Replace role="textbox" on the blocks holder with role="group" to avoid nesting a textbox inside another textbox — contenteditable elements implicitly carry role="textbox" via HTML-AAM regardless of explicit role, so putting it on the holder too would be an ARIA anti-pattern. Instead, assign role="textbox" + aria-multiline="true" + aria-label to each block's own contenteditable element (starting with Paragraph). Update proposal, design decisions, specs (ui + tools), and task checklist to reflect the revised approach. Also adds webkit (Desktop Safari) as a second Playwright project alongside chromium in packages/editorjs/playwright.config.ts. * feat(ui,paragraph): expose ARIA semantics and cover them with e2e The editor emitted zero roles or accessible names, which made it unusable with a screen reader and forced the e2e suite onto CSS-class selectors. - BlocksUI: role="group" on the holder, so the block textboxes are not nested inside a textbox the holder would otherwise imply - Paragraph: role="textbox", aria-multiline, aria-label, and the configured placeholder as aria-placeholder - ToolbarUI: role="toolbar" with a roving tabindex, named plus button, aria-haspopup/aria-expanded, and focus moved to the button on open so Safari restores it there rather than to <body> - InlineToolbarUI: named toolbar, aria-activedescendant mirrored from ui-kit's highlight and made resolvable with aria-owns, plus a live region announcing the toolbar once per open - Popover item roles and names come from @editorjs/ui-kit 2.0.0, fixed upstream rather than worked around from here Covered by aria.spec.ts, axe.spec.ts and a VoiceOver suite driving a real screen reader (voiceover.spec.ts, macOS-only, excluded from test:e2e). Note: @editorjs/ui-kit 2.0.0 is not published yet, so the lockfile has no entry for it and `yarn install` fails. The local `link:` resolution the work was developed against has been removed deliberately — see tasks.md 5a.2/5a.3. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * ci: run the @editorjs/editorjs e2e suite on pull requests The ARIA semantics the UI now depends on are enforced only by Playwright — nothing in the type surface catches a dropped role or accessible name, so until now a regression could land unnoticed. Adds an `include-e2e` input to the reusable package-check workflow and an `e2e-tests` composite action that installs chromium and webkit (cached by lockfile hash) and runs `test:e2e`. Kept as its own job: it needs browsers and takes minutes, and its failures read differently from a unit test's. `voiceover.spec.ts` stays excluded — screen readers cannot run headless. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(ui): announce the inline toolbar again after it is closed with Escape Escape closes the popover inside ui-kit, without going through #hide(), so #isVisible stayed true and every later appearance was taken for a reselection while already open: the toolbar was never announced again. Listen for PopoverEvent.Closed to reset it. The listener is removed before the popover is destroyed, since destroy() emits Closed as well and a rebuild would otherwise re-announce the toolbar on every selection change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * ci(editorjs): write the Playwright html report the e2e action uploads With only the list reporter nothing was written to playwright-report/, so the upload step had nothing to upload and the traces recorded on a retry were lost with the runner. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * ci: key the Playwright browser cache by the Playwright version Hashing yarn.lock dropped the ~400MB browser cache on any unrelated dependency bump. Each Playwright release pins its own browser builds, so the installed version is all the key needs. Also bump upload-artifact to v7, in line with the other actions. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * chore(deps): bump @editorjs/dom to ^1.2.0 and dedupe it @editorjs/ui-kit 2.0.0 depends on @editorjs/dom ^1.2.0, while the workspace packages still asked for ^1.1.0. Yarn will not re-resolve an already-locked entry, so the two ranges resolved separately and node_modules ended up with two copies of @editorjs/dom - including a nested one under @editorjs/caret, which pins ^1.1.0 transitively. Two copies split module state and break any identity check across the boundary. Widen the workspace ranges to ^1.2.0 and run `yarn dedupe @editorjs/dom` so both ranges collapse onto a single 1.2.0 resolution. The lockfile also gains the @editorjs/ui-kit 2.0.0 resolution it was missing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * refactor(ui,editorjs): drop dead popover field and reuse the e2e helpers `#popoverElement` was only ever written: assigned from `getElement()`, used as the receiver for the id and the append, then nulled in the teardown. A local covers all three, and dropping the field removes a second piece of state that had to be kept in step with `#popover` for no one's benefit. `editor.spec.ts` was the only spec reimplementing the mount-and-wait sequence and the triple-click selection instead of importing `mountDocument` and `selectParagraphText`. The readiness signal it waited on lives in the fixture, so a change there would have fixed the three specs using the helpers and left this one timing out. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * ci(editorjs): gate PRs on the VoiceOver suite when announcements can change The suite drives a real VoiceOver instance one test at a time, so it cannot sit in the path of every PR the way the headless suites do. It is wired as a job condition rather than a `paths:` filter on the workflow: GitHub leaves the checks of a path-filtered workflow Pending forever, which blocks any PR required to pass it, whereas a skipped job reports success and does not. The workflow therefore always runs and the macOS job decides for itself. `should-run-voiceover.sh` answers a narrower question than `should-run-ci.sh`: not "could this affect @editorjs/editorjs" - true of almost every change here - but "could this alter what a screen reader announces". It watches the UI and paragraph sources, the bundle, the suite itself, the lockfile (@editorjs/ui-kit owns the popover roles), and its own CI wiring. It fails open on anything it cannot determine, for the same reason its sibling does. Runs on a standard macos-15 runner, which is free on a public repository, and cancels a superseded run so a stale push does not hold one of the five macOS job slots shared across the account. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * ci(editorjs): fix the Guidepup setup invocation and drop the change gate `npx @guidepup/setup` runs the package's `guidepup` binary, which needs a subcommand - without one it prints its usage and exits 1, which is what failed the job. The correct call is `setup`, plus the `--ci` flag the README calls for in CI so the command does not wait on the manual steps a local machine needs. The change detection goes away with it. Deciding what counts as announcement- relevant turned out to be guesswork that had already missed the inline tools, and it is moot once the suite moves off the PR path onto a schedule. Runs on every PR for now, only so the job can be proven green before that move. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * ci(editorjs): install the Guidepup screen reader assets `setup` and `install` are separate commands and both are required. `setup` configures the OS; `install` puts the preferences disk image into the project. With only the first, every test failed in VoiceOver.start() with "Failed to mount Guidepup preferences" out of resolveDmgPath - the error names both commands, and only one of them had been run. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * test(editorjs): report what VoiceOver said when Case 18's baseline fails The baseline assertion guards the real one, but it fails on an *empty* match list - and the matches alone say nothing in that case. On CI it failed with "Expected: > 0, Received: 0" and no indication whether the cursor never reached the menu or VoiceOver worded the item differently than /menu item/ expects. `collectReachable` now carries the whole sweep alongside the matches so the message can distinguish the two. Retries follow playwright.config.ts, which already uses `isCI ? 2 : 0`. A real screen reader is driven by real keystrokes whose timing shifts under a loaded runner, and resetCursor's own comment records Case 18 as having been non-deterministic before. This does not hide a regression: a case that fails three times running is not a timing artefact, and the message now says what was announced each time. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * test(editorjs): enter the toolbox before sweeping it in Case 18 The sweep never reached a menu item because it started from the top of the web content. VO+Right moves between siblings rather than into them, and the block actions toolbar is the last sibling, so `next()` returned that same item for all twenty-five stops: ["hello world paragraph...", "block actions toolbar" x24]. The menu was open and correct the whole time - the page snapshot in the failure artifact shows menuitem "Text" present. Walking to the button that opens the toolbox first puts the cursor inside that container, which is where Case 4 reaches menu items from. Worth noting the baseline assertion earned its keep exactly as its comment said it would: without it, "no menu item is reachable after filtering" would have passed because no menu item was reachable before filtering either. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * test(editorjs): keep the cursor inside the toolbox while the menu is open Three CI runs agree on the constraint: once the toolbox menu is open, VoiceOver will not enter the block actions toolbar from the web content root. A forward walk from there reports "block actions toolbar" at all twenty-five stops and never descends, and the previous attempt showed even the button that opened the menu is unreachable that way - "did not reach an item matching /add block/i within 40 next steps". Case 4 reaches the items only because it never leaves the container. So neither sweep resets now. The first runs from where `act()` left the cursor. The second walks backwards to the search field, which re-anchors without going to the root and doubles as the navigation command VoiceOver needs before it will see the `fill()`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * refactor: trim the comments added while getting the VoiceOver suite green The investigation notes were useful while the cause was unknown and are noise now that it is settled. What is left is one line per non-obvious decision. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * ci(editorjs): run the VoiceOver suite on the merge queue only Eight minutes driving a real screen reader is too slow to sit in front of every PR push. The workflow still runs on pull_request for the rest of its jobs; the VoiceOver job skips there, and a skipped job reports success, so it never blocks a pull request. Inert until a merge queue is enabled on main - `merge_group` does not fire without one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs(openspec): record the ui-kit publish as done and fix a stale claim 5a.3 was still written as the blocking, not-yet-done publish. @editorjs/ui-kit 2.0.0 is published, the lockfile resolves it, and the suite was re-run against the published package: build, 973 unit tests, 80 e2e on both engines, lint. The task now also records the duplicate @editorjs/dom the regeneration surfaced and the dedupe that resolved it, since @editorjs/caret still pins the old range. The verification summary listed the same publish as an outstanding blocker and its verdict turned on it; both now say otherwise. Case 18's comment credited the CSS class with removing filtered items from the accessibility tree. ui-kit sets `hidden` alongside the class and that is what does it - as the spec and aria.spec.ts both already said. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs(openspec): drop the three deferred findings from tasks.md 10.5b, 10.7b and 10.8 were records of pre-existing bugs the change deliberately did not fix, not work items. Every archived change here has zero unchecked tasks, so as encoded they would have blocked archiving and reported 69/72. The findings themselves are preserved outside the repo. What referenced them by number - the proposal, the design note, 10.1c, 10.7a and the verification summary - now describes the bug instead, so nothing points at a task that is gone. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs(openspec): drop the unarchived add-editor-aria-semantics change Main already archives it under archive/2026-10-08-add-editor-aria-semantics; the copies are identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.
Why
Default tools, plugins, infra (DOM adapter, collaboration), and UI were hardcoded into
Core's constructor, so@editorjs/corecouldn't be consumed as a pure engine and there was no batteries-included package a v2 user could drop in.What Changes
@editorjs/editorjs(packages/editorjs): a batteries-included entry point whose default exportEditorJScomposesCore+DOMAdapters+CollaborationManager+ default tools (paragraph, bold, italic, link) + plugins (clipboard, shortcuts) + UI. It auto-initializes in the constructor and exposes anisReadypromise, and honors a v2-styleconfig.toolsmap merged over the defaults with override-by-name.Coreis now headless (BREAKING): the constructor no longer registers any default tools/plugins/infra/UI.initialize()fails loudly — it throws when no rendering adapter is registered or thedefaultBlocktool is missing, and re-throws init failures instead of swallowing them withconsole.error.ShortcutsPluginis consumed from@editorjs/shortcuts-plugin— extracted from core by feat(core): extract ShortcutsPlugin into @editorjs/shortcuts-plugin #180, which landed onmainwhile this PR was open and is merged in here. The bundle registers it as a default plugin; core neither ships nor registers it.packages/ui/index.htmlfixed: the demo page constructedCorewith no adapter and no block tool, relying on the defaults core used to register itself, so it threw under the new fail-loud validation. It now registersDOMAdaptersandParagraphexplicitly.@editorjs/ui:@editorjs/dom-adapters,@editorjs/coreandeditorjs-v2were production dependencies thatpackages/ui/srcnever imported (dom-adapters has been unused since the package was bootstrapped in chore(ui): ui package bootstrapped #96). Core and dom-adapters move to devDependencies for the demo page;editorjs-v2is dropped. Matching stale entries removed from the vite externals list and both tsconfigs' project references.@editorjs/editorjsv2 dep is aliased aseditorjs-v2(npm:@editorjs/editorjs@…) incore,sdk,tools/paragraphto free the package name. Non-behavioral; import specifiers only.@editorjs/editorjsinstead of wiringCore+ UI by hand.Merged
main(#184, #166, #185, #186, #188)mainis merged in as of3b61926. Five conflicts, three of them substantive:packages/core/src/index.ts—mainhad re-asserted the batteries-included constructor (this.use(Paragraph),ClipboardPlugin,DOMAdapters, …) and wrapsinitialize()in atry/catchthat logs. Kept this PR's headless + fail-loud version, and took frommainonly what was genuinely new: thePluginRegistrywiring, and movingUndoRedoManagerresolution to after plugin/tool init. That reorder ismain's deliberate fix — the manager relies ondefaultPreventedbeing set by plugins — and since merge-base had it before, this branch only looked like it disagreed.sdk/entities/{BaseTool,InlineTool}.ts+tools/paragraph—mainstopped importingToolConfigfrom the v2 package and now defines it inBaseTool.ts; this branch had renamed that dep toeditorjs-v2. Took both:ToolConfigfrom the SDK, remaining v2 type imports via the alias. This is whatsdkspec now requires anyway ("ToolConfigSHALL be an SDK-owned contract, not a re-exported passthrough from@editorjs/editorjs"). Confirmed noToolConfigimport resolves to the v2 package anywhere.packages/ui/package.json— union of both devDependency sets.Verification
openspec validate --all --strict: 15/15.packages/core/src/index.spec.tscovers the fail-loud contract, which previously had no tests at all — core had noindex.spec.ts. It drives a realCore(real IoC containers and model) with stub adapter/block tool/plugin registered viause(), asserting both throwing paths (missing adapter, missing/mismatcheddefaultBlock) and the succeeding path. No DOM environment needed: with an empty document and stub registrations the boot sequence never reaches the holder.packages/ui/index.htmlverified in-browser: renders all three paragraphs, no console errors. The ui build output is byte-identical after the dependency cleanup (85.72 kB / 67.57 kB, 28 modules), confirming the removed externals were no-ops.<b>.Keyboard shortcuts: now working (was blocked on #184)
CMD+B works, as of the
mainmerge. It could not work on this branch before:ShortcutsPluginsubscribes toui:key-down(KeydownUIEvent), but nothing dispatched that event —packages/ui/src/Blocks/Blocks.tshandled CMD+Z / CMD+SHIFT+Z locally and returned early for every other key. Registering the plugin was necessary but not sufficient. The producer side is theBlocksUIkeydown dispatch from #184, now merged in atBlocks.ts:125.Re-verified in the browser through the bundle, on a selection inside a paragraph:
The toolbar's active state tracking the text confirms it round-tripped through the model rather than being a contenteditable side effect —
isActiveis reading back the fragment the shortcut wrote — and exercises both the Format and Unformat branches ofgetFormattingOptions. The handler table is populated from the namespacedstatic options.plugins.shortcuts.shortcutthat Bold and Italic declare, which is also #184's shape.Task 4.6 in the archived change is closed accordingly; that change now has no open tasks.
(An earlier revision of this description claimed CMD+B was verified end-to-end, before it could possibly work. That was wrong — thanks @Reversean for pushing on it. The claim above is a fresh in-browser check made after the merge, not a restatement of the old one.)
Specs
Implemented via OpenSpec change
add-editorjs-bundle-package(archived in this PR). Because the shortcuts extraction landed mid-review, the archived change was updated in place rather than superseded: proposal, design, tasks and theeditorjs-bundledelta now reflect shortcuts being registered from its own package. Main specs updated:core(headless + fail-loud scenarios, now with a validation pointer to the new spec file) and the neweditorjs-bundlecapability.Auditing all 15 specs against the merged tree turned up further drift, fixed in two commits kept deliberately separate:
8139d2f(this branch's own gap) —architecturestill asserted "Default adapter is DOMAdapters", i.e. thatCore's constructor callsthis.use(DOMAdapters). Accurate at merge-base and still accurate onmain, but false here, and it directly contradictedcore's "No adapter registered fails loudly". The bundle change wrote deltas forcoreandeditorjs-bundleand missed that the same fact was asserted inarchitecturetoo.43b5513(pre-existing onmain, not introduced here) —toolsdescribed Bold/Italic as declaring flatshortcut: 'CMD+B'/'CMD+I'properties; feat(core): expose plugin public APIs and tool-directed plugin options #184 moved them tooptions.plugins.shortcuts.shortcutwithout updating the spec, leaving it contradictingshortcuts-plugin's own "Legacy flat shortcut key is ignored" scenario.plugin-public-apiandtool-plugin-optionsalso still carried the generatedTBD - created by archiving change add-plugin-public-apiplaceholder purposes.The second commit is unrelated to this PR's subject and is a clean standalone cherry-pick onto
mainif you'd rather it not ride along — happy to drop it.Follow-ups (not in this PR)
The same audit found four spec/code gaps that all trace to #184 and need code, not wording. Flagging rather than fixing, since they're outside this PR's scope:
core("Registry is cleared on teardown") andsdk("Destroying a plugin") both describedestroy()running on teardown.Corehas no teardown path, nothing calls plugindestroy(), andPluginRegistry.unregister()has no production caller.publicApi.Core#initializePluginguards theregistry.register()call oninstance.publicApi !== undefined, so two same-named plugins without one register silently — whilecoreandplugin-public-apistate the rejection unconditionally.api.pluginssurface doesn't exist.plugin-public-apirequires it "on the API surface available to the editor's integrator", but neitherCore(onlyuse()/initialize()) nor the bundle'sEditorJS(onlyisReady) exposes one.CollaborationManagerlogsUnknown event type DataNodeAddedEventthree times per page load — no case for that event, falls through todefault: console.error. Pre-existing at merge-base and onmain; already noted as out of scope in task 4.4.