v2.26.0

codex-team/editor.jsv2.26.0Nov 29, 2022by github-actions[bot]

AI Summary

Introduces a vertical Block Tunes layout, a new Menu Config API for configuring tunes via JSON, and new CodeX Icons. Fixes several XSS vulnerabilities.

Key Highlights

  • Block Tunes now have a vertical layout.
  • New Menu Config API for Block Tunes.
  • New CodeX Icon pack.
  • blocks.insert() now supports an optional `id` parameter.
  • XSS vulnerability fixes in paste handling.

New Features

  • Vertical Block Tunes UI.
  • Menu Config API for Block Tunes.
  • Menu Config API for Tools (`renderSettings()`).
  • CodeX Icon pack.
  • pasteConfig sanitizing configuration.
  • Deprecated CSS classes for Block Settings.

Full Release Notes

<img width="813" alt="image" src="https://user-images.githubusercontent.com/3684889/204612345-699f6a7f-e24c-42e9-811e-4b4f0ebc8483.png">

- `New` — *UI* — Block Tunes became vertical just like the Toolbox 🤩
- `New` — *Block Tunes API* — Now the `render()` method of a Block Tune can return the [Menu Config](https://editorjs.io/tunes-menu-api) with just icon, label, and callback instead of custom HTML. This improvement is key to the new straightforward way of configuring the tune's appearance in the Block Tunes menu. 
- `New` — *Tools API* — As well as `render()` in `Tunes API`, Tool's `renderSettings()` now also supports new configuration format.
- `New` — *UI* — Meet the new icons from [CodeX Icons](https://github.com/codex-team/icons) pack šŸ› šŸ’
- `New` — *BlocksAPI* — the `blocks.insert()` method now also have the optional `id` param. If passed, this id will be used instead of the generated one.
- `Deprecated` — *Styles API* — CSS classes `.cdx-settings-button` and `.cdx-settings-button--active` are not recommended to use. Consider configuring your block settings with a new JSON API instead.
- `Improvement` — *Tools API* — `pasteConfig().tags` now support sanitizing configuration. It allows you to leave some explicitly specified attributes for pasted content.
- `Improvement` — *CodeStyle* — [CodeX ESLint Config](https://github.com/codex-team/eslint-config) has bee updated. All ESLint/Spelling issues resolved
- `Improvement` — *ToolsAPI* — The `icon` property of the `toolbox` getter became optional.
- `Fix` — The wrong element is not highlighted anymore when the popover opened.
- `Fix` — When Tunes Menu open keydown events can not be handled inside plugins.
- `Fix` — If a Tool specifies some tags to substitute on paste, all attributes of that tags will be removed before passing them to the tool. Possible XSS vulnerability fixed.
- `Fix` — Pasting from Microsoft Word to Chrome (Mac OS) fixed. Now if there are no image-tools connected, the regular text content will be pasted.
- `Fix` — Workaround for the HTMLJanitor bug with Tables (https://github.com/guardian/html-janitor/issues/3) added
- `Fix` — Toolbox shortcuts appearance and execution fixed [#2112](https://github.com/codex-team/editor.js/issues/2112)
- `Fix` — Inline Tools click handling on mobile devices improved


šŸ’Œ Read about the new Menu Config feature for defining Block Tunes menu appearance:
https://codex.so/editorjs-menu-config