Editor.js Versions Save

A block-style editor with clean JSON output

v2.28.0

8 months ago
2 28

New features

  • Block ids now displayed in DOM via a data-id attribute. Could be useful for plugins that want to access a Block's element by id.
  • Blocks API — The blocks.convert(blockId, newType) API method was added. It allows to convert existing Block to a Block of another type.
  • Blocks API — The blocks.insertMany() API method added. It allows to insert several Blocks to the specified index.

Improvements

  • UX — The Delete keydown at the end of the Block will now work opposite a Backspace at the start. Next Block will be removed (if empty) or merged with the current one.
  • UX — The Delete keydown will work like a Backspace when several Blocks are selected.
  • UX — If we have two empty Blocks, and press Backspace at the start of the second one, the previous will be removed instead of the current.
  • Shortcuts — Tools shortcuts could be used to convert one Block to another.
  • UI — Tools shortcuts displayed in the Conversion Toolbar
  • UI — Initialization Loader has been removed.
  • Styles — Selection style won't override your custom style for ::selection outside the editor.
  • Performance — Performance optimizations: initialization speed increased, blocks.render() API method optimized. Big documents will be displayed 8x faster.
  • DX — "Editor saving" log removed
  • DX — "I'm ready" log removed
  • UI — The stub-block style is simplified.
  • UI — If some Block's tool throws an error during construction, we will show Stub block instead of skipping it during render
  • onChange — Call of blocks.clear() now will trigger onChange with "block-removed" event for all removed blocks.
  • Blocks API — The blocks.clear() now can be awaited.
  • TypesBlockMutationType and BlockMutationEvent types exported
  • Blocks APIblocks.update(id, data) now can accept partial data object — it will update only passed properties, others will remain the same.
  • onChangeblocks.update(id, data) now will trigger onChange with only block-change event.
  • Blocks APIblocks.update(id, data) will return a promise with BlockAPI object of the changed block.

v2.28.0-rc.4

8 months ago
  • Improvement - The blocks.clear() now can be awaited.
  • Improvement - The blocks.render() won't lead onChange call

v2.28.0-rc.3

8 months ago
  • Improvement - BlockMutationType and BlockMutationEvent types exported
  • Improvement - blocks.update(id, data) now can accept partial data object — it will update only passed properties, others will remain the same.
  • Improvement - blocks.update(id, data) now will trigger onChange with only block-change event.
  • Improvement - blocks.update(id, data) will return a promise with the BlockAPI object of the changed block.

v2.28.0-rc.2

9 months ago
  • Improvement - Performance optimizations: initialization speed increased, blocks.render() API method optimized. Big documents will be displayed faster.
  • New - The blocks.insertMany() API method added. It allows to insert several Blocks to specified index.
  • Improvement - Initialization Loader has been removed.
  • Improvement - Selection style won't override your custom style for ::selection outside the editor.
  • Improvement - "Editor saving" log removed
  • Improvement - "I'm ready" log removed
  • Improvement - The stub-block style simplified.
  • Improvement - If some Block's tool will throw an error during construction, we will show Stub block instead of skipping it during render
  • Improvement - Call of blocks.clear() now will trigger onChange with "block-removed" event for all removed blocks.

v2.28.0-rc.1

9 months ago
  • New - The .convert(blockId, newType) API method added
  • Improvement - Tools shortcuts could be used to convert one Block to another.
  • Improvement - Tools shortcuts displayed in the Conversion Toolbar

v2.28.0-rc.0

10 months ago
  • New - Block ids now displayed in DOM via a data-id attribute. Could be useful for plugins that want access a Block's element by id.
  • Improvement - The Delete keydown at the end of the Block will now work opposite a Backspace at the start. Next Block will be removed (if empty) or merged with the current one.
  • Improvement - The Delete keydown will work like a Backspace when several Blocks are selected.
  • Improvement - If we have two empty Blocks, and press Backspace at the start of the second one, the previous will be removed instead of current.

v2.27.2

10 months ago
  • Fix - onChange won't be called when element marked by data-mutation-free changes some attribute

v2.27.1

10 months ago
  • Fix - onChange will be called on removing the whole text in a block

v2.27.0

1 year 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.

v2.27.0-rc.5

1 year ago
  • ImprovementBreaking Change — Batching added to the onChange callback. Now the second argument can contain an array of CustomEvents as well as a single one. If several changes will be made in short period of time, they will be batched under the single onChange call
  • Improvement — Pressing "Enter" at the end of a Block won't lead to redundant block-changed event triggering. Only block-added event will be dispatched.
  • Fix — The onChange won't be triggered with Block Tunes opening and closing.
  • RefactoringEventDispatcher 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.
  • Refactoring — All events in common editor Event Bus now have own type declarations.
  • Refactoring — Now Blocks don't have own Mutation Observer. The single observer attached to the editor's blocks wrapper element. ModificationsObserver listens blocks wrapper changes, then emits an event into the common editor Event Bus. Each Block subscribes to such events and handle those who related to a particular Block.
  • Improvement — Block's mutation handler now will be called on every block change (including background changes). Previously, it have worked only if a particular Block have been focused.
  • Refactoring — Debounce have been removed from Block's mutation handler. The batching in ModificationObserver used instead.
  • Improvement — Number of caret saving method calls optimized for Block Tunes opening/closing.
  • New — Types for Block mutation events added.
  • Fix- Several bugs caused by random browser extensions. Now we are not searching for a block's container in the DOM on saving. Instead, we keep it in memory and update it when the tool changes a container element.