github codex-team/editor.js v2.27.0

latest releases: v2.31.0-rc.5, v2.30.7, v2.31.0-rc.4...
18 months ago

New Features

  • Toolbar API — Added a new method for toggling the toolbox.
  • Types — Added types for block mutation events
  • onChange — Batching added to the onChange callback. Now the second argument can contain an array of CustomEvents as well as a single one. Multiple changes made in a short period of time will be batched under a single onChange call.

Improvements

  • Toolbox — Number of close() method calls optimized.
  • onChange — The onChange callback can be muted if all mutations contain nodes with the data-mutation-free attribute.
  • onChange — Pressing "Enter" at the end of a Block won't lead to redundant block-changed event triggering. Only block-added event will be dispatched.
  • onChange — The block mutation handler is now called on every block change (including background changes), instead of only when a block is focused
  • Optimization — Number of caret saving method calls optimized for Block Tunes opening/closing.
  • Bundle — Package size reduced by removing redundant files.

Refactorings

  • Popover — Refactored the Popover class for better performance and maintenance.
  • Build System — Switched from Webpack to Vite as the build system.
  • Event BusEventDispatcher types improved. Now we can pass EventsMap via generic to specify a map of event names and their payloads that can be used in a particular EventDispatcher instance.
  • Event Bus — All events in common editor Event Bus now have own type declarations.
  • Mutation Observer — Removed the block mutation observer from blocks and attached a single observer to the editor's blocks wrapper element.
  • Mutation Batching — Removed the debounce from the block mutation handler and used batching instead.
  • Dependencies — Upgraded Cypress to v12 and related libraries to the latest versions.
  • Dependencies — Upgraded TypeScript to v5.
  • CI — Ubuntu container is now used for Edge tests runner.
  • CI — Node 16 is used for GitHib Actions.

Bug Fixes

  • Fixed several bugs caused by browser extensions. Removed the search for a block's container in the DOM on saving and kept it in memory instead, updating it when the tool changes a container element.
  • The onChange callback won't trigger when block tunes are opened or closed.
  • Resolved a compiler error caused by importing the BlockToolData type.
  • Resolved a problem where the document would scroll to the beginning after moving a block above the viewport.
  • Tools APIpasteConfig getter with false value could be used to disable paste handling by Editor.js core. Could be useful if your tool has its own paste handler.

Don't miss a new editor.js release

NewReleases is sending notifications on new releases.