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