Skip to content

v49.2.0

Latest

Choose a tag to compare

@CKEditorBot CKEditorBot released this 02 Dec 06:34
· 618 commits to master since this release
v49.2.0
3dc107d

We are happy to announce the release of CKEditor 5 v49.2.0.

Release highlights

⭐ Editing Toolkit: compare against any stored version

Compare in the Editing Toolkit now accepts three kinds of base version: a snapshot from the current session (still the most precise), a snapshot from an earlier session, for example from before a page reload, and plain HTML that your application already stores, for example in its database. With plain HTML, Compare finds what changed in the editor since that version and what changed in the incoming one, then merges both. This covers cases where no snapshot exists: merging branched copies of a document, bringing back edits made in an exported Word file, or updating a document through your API while others keep editing in real-time collaboration.

Snapshots also keep stable data-id attributes for the lifetime of the editor now, so consecutive AI requests refer to the same elements. See Using an HTML string as a snapshot.

⭐ CKEditor AI: suggest all changes and arrange Quick Actions

AI Review can now turn all remaining changes into Track Changes suggestions in one click with "Suggest all" and "Suggest remaining", so a whole AI review goes through your usual approval flow. Such changes are marked "Suggested" instead of "Accepted", which is a minor breaking change if you read AIReviewCheckResultChange#status.

You can also shape the AI Quick Actions menu to your product: config.ai.quickActions.items sets the order and categories of actions, and custom actions get their own category and icon. The AI Review navigation panel and the AI Chat preview balloon can be dragged aside when they cover the content.

Table row resize and formatting in new rows and columns

With the new TableRowResize plugin, users can resize a table row by dragging the bottom edge of a cell, or set an exact height in the table cell properties. In track changes mode, all row height changes in a table appear as a single format suggestion. See Table column and row resize.

New rows and columns now keep the formatting of the row or column they were inserted next to, so users no longer restyle every added cell. With the table cell properties feature enabled, this covers borders, background color, padding, and alignment. Text formatting carries over even without this feature, also when users press Tab in the last cell, paste into a table, or split a cell.

Text emoticons turn into emoji

Emoticons such as :), <3, and XD now turn into emoji as users type, thanks to the new emoticons group of the Automatic text transformation feature (the TextTransformation plugin). It inserts emoji characters directly, so it does not need the Emoji plugin. The group is enabled by default, so if you already load TextTransformation, your users get it after the upgrade. To keep emoticons as text, add 'emoticons' to config.typing.transformations.remove. See Disabling emoticons.

Multi-root editing in Angular

The multi-root editor gives one document several editable areas that share one toolbar, configuration, and undo stack, for example a page layout with a header, a main column, and a sidebar. Angular applications can now use it with the new <ckeditor-multi-root> component in @ckeditor/ckeditor5-angular v13.1.0. See the Angular multi-root guide and the Angular v13.1.0 release notes.

Other improvements and fixes

  • Proposed changes: Proposed changes now look and behave the same in AI Chat and the Editing Toolkit. Edits inside block quotes or layout tables show as smaller, separate changes, they apply faster, and split or merged paragraphs display correctly.
  • Real-time collaboration: the editor starts faster, sessions created with initial data open reliably for every user, and users who went offline can rejoin their session in more cases. See Real-time collaboration.
  • Comments and suggestions: inline annotations now open from their markers in a read-only editor too, and no longer take the focus away from forms that create suggestions, such as table properties. The presence list marks you with "(you)".

MINOR BREAKING CHANGES ℹ️

  • ai: The AIReviewCheckResultChange#status of a change taken with the "Suggest" action in AI Review is now 'suggested' instead of 'accepted', and AIReviewCheckRun#acceptedChangesCount no longer counts it. Use the new AIReviewCheckRun#suggestedChangesCount to count such changes.

  • merge-fields: The merge field preview badge icons and the block and image placeholders can be themed with the new --ck-merge-fields-preview-badge-icon-color, --ck-merge-fields-preview-badge-warning-icon-color, --ck-merge-fields-block-placeholder-color, and --ck-merge-fields-image-placeholder-color CSS custom properties. The block placeholder follows the block outline color by default, and the merge field icon in the badge uses the primary text color (--ck-color-text-primary). The badge icons are drawn on ::after, the block placeholder on ::before, and the image placeholder as a mask on the img element, so custom CSS that replaces the content of the badge or the background-image of a placeholder no longer applies.

  • slash-command: The slash command list now shows each command on a single line, with an optional description after the title. The default commands no longer have descriptions, and some of them were renamed to match the menu bar (for example, "Insert table" is now "Table"). Their former descriptions and titles are now search aliases, so the commands can still be found by the same phrases.

    The --ck-slash-command-description-width CSS variable has been removed. Use --ck-slash-command-button-width (now 320px by default) to change the list width. The icons no longer have a background, so the --ck-slash-command-icon-background-color and --ck-slash-command-icon-border-radius CSS variables have been removed too.

Features

  • mention, source-editing, ui: Added theme tokens for the button states: --ck-button-on-border, --ck-button-active-border-color, --ck-button-focus-shadow, --ck-button-disabled-focus-shadow, and --ck-button-focus-outline with --ck-button-focus-outline-offset (the outline shows on keyboard focus only). Added --ck-list-item-button-border and --ck-list-button-on-focus-border-color for lists, and --ck-editor-editable-border-color and --ck-editor-editable-focus-shadow for the editing area. The default look does not change. Closes #19351.

  • ai: DocumentCompare#computePatch() and DocumentCompare#computeChanges() can now take the original document data (a string, or an object keyed by root name) instead of a snapshot. This makes it possible to compute document diffs where a snapshot cannot be used, for example to merge two versions of a document into the editor.

    When the data is passed directly, a three-way diff is used: the original data is compared both with the current editor content and with the processed data, and both change sets are used to evaluate the final diff. Data IDs are not used in this case, elements are paired by their content.

  • ai: DocumentCompare#computePatch() and DocumentCompare#computeChanges() can now operate on a snapshot made in a past editing session (for example, before a page reload) or even for another document. Previously, such a snapshot could not be applied.

    When such a snapshot is passed, a three-way diff is used: the snapshot content is compared both with the current editor content and with the processed data, and both change sets are used to evaluate the final diff.

  • ai: The "Complete" menu in AI Review now offers the "Suggest all" and "Suggest remaining" actions when track changes are available, so all remaining changes can be added as suggestions at once. While track changes mode is on, they take the place of the "Accept all" and "Accept remaining" actions.

  • ai: Introduced config.ai.quickActions.items to set the order of AI Quick Actions and their categories in the dropdown and the menu bar. Actions can also be moved to different categories, and new categories with their own label and icon can be added.

  • ai: Custom AI Quick Actions defined in config.ai.quickActions.extraCommands can now set the group (category) they belong to and their own icon. The icon is displayed when the action is at the top level of the AI Quick Actions list or in a toolbar.

  • ai: The AI Review navigation panel can now be dragged away from the change it points at. The panel and the AI Chat preview balloon now stay where they were dropped while the user moves between changes, until the new "Reset position" button brings them back next to the active change.

  • ai: The data-id attributes in snapshots created by DocumentCompare#makeSnapshot() are now stable for the lifetime of the editor instance.

  • engine: Introduced the normalizeLengthStyleValue() helper, which normalizes numerical style values so that equivalent notations of the same value are equal, for example 2.0em and 2em. See #20272.

  • source-editing-enhanced: The default theme of the enhanced source editing code editor reads its colors from the new --ck-source-editing-enhanced-* CSS custom properties: the background, text, cursor, gutter, active line, selection, and code completion list colors, and the syntax colors by role (for example --ck-source-editing-enhanced-syntax-keyword-text-color). The default look does not change, and the code editor can be themed together with the rest of the editor, also when CKEditor 5 is installed from CDN. The properties apply to the default theme only: the 'dark' theme and dark custom themes keep their own colors, and a light custom theme overrides them for the parts it styles.

  • table: Introduced the table row resize feature. Add the TableRowResize plugin to let users set the height of a table row by dragging the bottom edge of its cells, the same way the table column resize feature resizes columns. Closes ckeditor/ckeditor5#11637.

    Row heights are stored in pixels in the height style of <tr> elements. Heights in points, for example pasted from Microsoft Word or Google Docs, are converted to pixels. When the table cell properties feature is loaded, its "Height" field sets the height of the row instead of the cell.

  • table: Rows and columns inserted into a table now keep the formatting of the row or column the user acted on. When the table cell properties feature is enabled, new cells inherit the cell styles of the corresponding cells (borders, background color, padding, and alignment). Typing in a new empty cell continues the text formatting found at the start of the corresponding cell, as well as its paragraph alignment. This applies to inserting rows above or below, inserting columns to the left or right, pressing Tab in the last table cell, expanding a table while pasting, and splitting a cell. Text formatting is also continued in editors without the table cell properties feature. Closes #12712.

    Rows and columns inserted at the boundary of the heading or footer section now become part of the section of the row or column the user acted on. For example, a row inserted below the last heading row becomes a heading row, and a row inserted above the first footer row becomes a footer row. Rows and columns added next to a table made of heading or footer rows only, or of heading columns only, still become regular body rows and columns.

    The TableUtils#insertRows() and TableUtils#insertColumns() methods accept the new referenceRow and referenceColumn options that enable this behavior. Calls without these options work as before.

  • table: Added support for more size units to the TableScroll plugin. Previously, only the % and px units were supported. It now supports any unit specified in the width.

  • track-changes: The table row resize feature is now supported in the track changes mode. Resizing table rows, by dragging their edges or with the "Height" field in the table cell properties, creates a format suggestion for the changed row, cell, and table heights. All height changes of a table are grouped in one suggestion.

  • typing: Introduced the emoticons text transformation group. It changes text emoticons, such as :), <3, or XD, into emoji while typing. The group is enabled by default, so editors that use TextTransformation with the default configuration will also change these emoticons. To disable the group, add emoticons to the config.typing.transformations.remove option. Closes #17737.

    To insert any emoji from the toolbar or by typing : and the emoji name, use the emoji feature.

Bug fixes

  • emoji, find-and-replace, fullscreen, image, minimap, special-characters, style, widget: Several feature packages read the semantic color roles instead of the foundation color tokens. The default look does not change, except that the fullscreen sidebar header uses the UI text color (--ck-color-text) when the document outline styles are not loaded. Before, it took the text color of the page. The changed parts:

    • Borders and dividers in the special characters, image insert, emoji, and style UI follow --ck-color-border-control and --ck-color-divider.
    • The minimap background, the widget resize handle border, the style previews, and the focus ring gaps in the special characters and emoji grids follow --ck-color-surface-canvas.
    • The image upload icon follows --ck-color-text-inverse and --ck-color-feedback-success.
    • The find and replace results counter text color can be set with the new --ck-find-and-replace-form-results-counter-text-color CSS custom property.

    A theme that sets these roles to a custom value also changes these parts.

  • editor-classic, engine, utils: The sticky toolbar of the classic editor no longer covers the selection when the editor is placed in a scrollable container and the toolbar sticks to the top of that container. Before, the container was scrolled so that the selection ended up behind the toolbar. Integrations with their own sticky UI can use the new getAncestorScrollPadding option of the EditingView#scrollToTheSelection event data for the same purpose. Closes #20265.

  • emoji, mention: The emoji hint ("Keep on typing to see the emoji.") no longer shows a focus ring when the emoji suggestion list opens. The mention list no longer shows the focus ring on a disabled item that is the only item in the list.

  • ai: AI Review now marks a change taken with the "Suggest" action as "Suggested" instead of "Accepted".

  • ai: Improve styling of the "Proposed changes" component when used outside the AI chat.

  • ai: AI Chat and Editing Toolkit now correctly present split and merge changes in the proposed changes sidebar UI component.

  • ai: The eye toggle in the AI Review navigation panel now says "Expand all underlines" and "Collapse to underlines" instead of "Show changes" and "Hide changes", so it is clear that it affects all changes in the document.

  • ai: AI changes that insert a table, or another element inserted as a whole, with block quotes or other container elements inside can now be previewed and applied. Previously, such changes were reported as not supported by the editor, or the container elements ended up nested in themselves.

  • ai: Clicking a link in a change proposed by AI Chat, AI Quick Actions, or AI Review no longer opens the link.

  • clipboard: The drag and drop target line is now shown in the right place when the editor's overlay layer is placed in a positioned or scrolled container, for example, when the editor is in a scrollable shadow tree. Before, the line was moved by the container's offset and moved twice as far as the content when the container was scrolled.

  • clipboard: Content dragged out of the editor into another field, for example a plain text input, is no longer lost. Closes #20274.

  • collaboration-core: The balloon of an inline suggestion keeps the shadow of other balloons (--ck-shadow-surface-floating) while the suggestion is focused. Before, the shadow became smaller on focus. Its focus shadow also follows --ck-interactive-focus-shadow.

  • comments: Inline annotations are now displayed after clicking a comment or a suggestion marker when the editor is in read-only mode. Closes ckeditor/ckeditor5#16238.

  • comments: A comment thread whose commented content was removed uses the neutral border color (--ck-color-border-container) for its annotation type border again, instead of the comment accent. The border is visible only in a theme that sets --ck-annotation-type-border-width.

  • comments: The inline annotation no longer takes the focus away from a balloon form, for example, the table properties form, when the form creates a suggestion. Clicking the same place in a comment or a suggestion marker also reopens its inline annotation after it was closed with the Esc key.

  • core: The Czech labels of the "Wrap text" and "Break text" image and media style buttons are no longer swapped.

    Thanks to @jakubpivonka.

  • document-outline: The document outline in a multi-root editor no longer highlights a heading from the bottom of the viewport when the next root starts to scroll into view.

  • engine: The browser spell checker should no longer mark the last word of a formatted text as misspelled when typing right after it, for example after using an autoformat such as **bold** or after turning off bold or italic at the end of a word. Closes #20267.

  • engine: The editor no longer crashes when an attribute is set on a range that covers several adjacent text insertions made in the same change block. Closes #20270.

  • find-and-replace: The editor no longer crashes when a root containing search results is detached in a multi-root editor.

  • find-and-replace: The find and replace feature should no longer match the text inserted by the replace button. Previously, if the replacement text contained the search phrase (for example, when replacing "Hello" with "HelloHello"), the highlight stayed on or wrapped back to the inserted text instead of moving to the next result, and subsequent replacements kept modifying it endlessly. Starting a new search still finds such matches.

  • font: Font sizes written in a different notation than the configured options, for example 2.0em or 02PX for the 2em or 2px options, are now matched with these options. Previously, such values were not marked as active in the font size dropdown and the menu bar, and they were dropped on upcast when fontSize.supportAllValues was disabled. Closes #20272.

    With fontSize.supportAllValues enabled, all numerical font sizes in the loaded content are now normalized, including the ones not present in the configuration. For example, 13.50px is now output as 13.5px.

  • footnotes: Footnotes inserted into a root of a multi-root editor are now numbered in the order of roots, even if the roots between it and the next root containing footnotes have no footnotes. Previously, such footnotes were appended to the end of the list and received a higher number than footnotes from the later roots.

  • image: Keyboard navigation in the insert image dropdown now uses the ↑ and ↓ keys instead of Tab, like in other list-like dropdowns. If the dropdown contains a view other than a button, for example, a text field added by a custom integration, Tab is still used, so the arrow keys can move the caret in that field. Closes #20256.

    Thanks to @VladyslavLevoshko.

  • line-height: Line heights written in a different notation than the configured options, for example 2.0 or 02.50 for the 2 or 2.5 options, are now matched with these options. Previously, such values were dropped on upcast, or, when lineHeight.supportAllValues was enabled, they were not marked as active in the line height dropdown and the menu bar and were kept even when equal to lineHeight.defaultValue. See ckeditor/ckeditor5#20272.

    With lineHeight.supportAllValues enabled, all numerical line heights in the loaded content are now normalized, including the ones not present in the configuration. For example, 1.750 is now output as 1.75.

  • link: Going back from the link form or the link properties view to the link toolbar, also by submitting the form, now moves the focus back to the toolbar button that had focus before. Previously, the focus went to the editing area, so keyboard users had to focus the toolbar again. Closes #18013.

  • list: Inserting or pasting content, such as a table, an image, paragraphs, or list items, at the beginning of a list no longer changes the style, start index, or reversed order of the whole list. Closes #20264.

  • paste-from-office: Style definitions that Microsoft Excel places inside the pasted content are now kept for style processing instead of being discarded. Recent desktop Excel builds and Excel Online use this clipboard format. The style definitions are still not pasted as visible text. See #20188. Closes #20268.

  • paste-from-office-enhanced: Tables pasted from Microsoft Excel now keep their cell formatting, such as borders, background colors, bold text, and font colors and sizes. Previously, the formatting was lost when Excel placed the cell styles inside the pasted content, as recent desktop Excel builds and Excel Online do. See ckeditor/ckeditor5#20268.

  • real-time-collaboration: Users can now reconnect to a flushed editing session if nobody else changed the document while they were offline. Before, with revision history enabled, such a reconnection always ended with a read-only editor and the "Synchronization issue" warning.

  • real-time-collaboration: Fixed the editor failing to initialize when connecting to a real-time collaboration session created with the use_initial_data: true option. The second and subsequent clients could fail with the attribute-operation-attribute-exists error, for example when the initial data contained a list with formatted items, and the session could no longer be used.

  • revision-history: Fixed an error that resulted in a corrupted revision that had changes attributed to a null user which led to further problems.

    The revision was corrupted when an offline user reconnected to an editing session, for which the current revision had started in an earlier editing session and was continued (config.revisionHistory.resumeUnsavedRevision set to true (default)).

  • revision-history: The "Back to editing" button in the revision viewer now uses the styles of the other action buttons. It follows the theme customizations of action buttons and no longer turns light gray while it is pressed.

  • slash-command: The Emoji and Footnote slash commands now show translated titles instead of always displaying them in English.

  • table: Inserting several rows or columns inside the heading section of a table no longer leaves some of the new cells marked as regular data cells.

    Inserting rows into the heading section of a table whose columns are all heading columns, or columns into the heading section of a table whose rows are all heading rows, no longer expands the heading section over the whole table. It also no longer removes the footer rows of such a table.

  • table: The column resize cursor no longer disappears while dragging a column edge when the editor is in a shadow root.

  • table: The height attribute of a table cell that also has the height style, for example in a table pasted from Microsoft Excel, is no longer kept by General HTML Support. Removing the cell height in the table cell properties now makes the cell lower.

  • table: The mergeTableCells command and the directional merge commands (mergeTableCellRight, mergeTableCellLeft, mergeTableCellUp and mergeTableCellDown) are now disabled when the selection contains both header and data cells. Previously, they were reported as enabled in this case, even though such cells cannot be merged.

  • table: Content tables no longer turn into layout tables when the editor data is loaded again with config.table.tableLayout.preferredExternalTableType set to 'layout'. The content-table class on the <figure> that wraps a table now takes precedence over this setting, so content tables keep their captions, header rows and footer rows.

  • track-changes: Splitting a suggestion that was split before no longer causes an error in real-time collaboration when the other part of the original suggestion was already accepted or rejected.

  • ui: The sticky toolbar is now positioned correctly when an ancestor of the editor becomes the containing block of fixed elements, for example, because it has a CSS transform, a filter, layout containment, or a will-change declaration. Before, the toolbar was placed at the wrong offset and scrolled away with the content in such a layout. Closes #18328.

  • ui: Every aria-live announcement now stays in its region for 5 seconds before it is removed. Previously, a single timer removed the oldest announcement every 5 seconds, so an announcement could be removed right after it was added, before a screen reader read it. The editor no longer runs this timer when there is nothing to remove, so an idle editor does not wake up the browser every 5 seconds.

  • ui: Balloons, for example the link toolbar, now hide when the editor is hidden with content-visibility: hidden, as they already did for display: none. Before, they stayed on screen over the hidden editor. Closes #20276.

Other changes

  • ui, widget: The focus styles of the accessibility help dialog and of focused widgets read the semantic focus roles (--ck-interactive-focus-ring and --ck-interactive-focus-shadow) instead of the foundation focus tokens, so overriding these roles also changes them. The "Powered by" and evaluation badges placed on the editor border take the width and style of their border from --ck-interactive-focus-ring. The default look does not change.

  • ai: The Editing Toolkit now highlights a proposed change that only inserts content together with a few surrounding words, so it is easier to spot in the document. Undoing and redoing an accepted proposed change now keeps its state in line with the document.

  • ai: The focus styles of the AI form and the AI review check list read the semantic focus roles (--ck-interactive-focus-ring and --ck-interactive-focus-shadow) instead of the foundation focus tokens, so overriding these roles also changes them. Overriding the legacy --ck-focus-outer-shadow also changes their focus shadow. The default look does not change.

  • ai: The active change in AI Review and AI Chat now has a stronger fill, both in the content and on its card, so it is easier to spot.

  • ai: The default value of the config.ai.review.autoAdvanceDelay and config.ai.chat.autoAdvanceDelay configuration options and the autoAdvanceDelay option of the Editing Toolkit createController() method changed from 600 to 400 milliseconds.

  • ai: Improved how AI Chat shows and applies proposed changes.

    Changes inside nested content, such as block quotes or layout tables, are now shown as separate, smaller changes. Applying the changes is faster, and outdated changes are detected more reliably.

  • engine: The selection observer no longer runs a timer for the whole editor lifetime, so an idle editor does not wake up the browser every second. The protection against an infinite selection loop works as before.

  • merge-fields: The status in the merge field balloon (for example, "Value not available.") has a transparent background and the UI font size (14px), without the extra line height. The font size can be set with the new --ck-merge-fields-form-status-font-size CSS custom property. The vertical padding of merge fields can also be set with --ck-merge-fields-padding-block, the new name of --ck-merge-fields-paddings-vertical, which keeps working.

  • real-time-collaboration: The presence list now shows "(you)" next to the name of the local user in the avatar tooltip and in the dropdown with all connected users. In the dropdown, the local user is also separated from the other users with a divider.

  • real-time-collaboration: Improved the real-time collaboration performance by fetching the initial data with referenced users, and the latest revision in parallel, which makes the editor start faster.

  • track-changes: In the track changes mode, changing the height in the table properties or table cell properties form now creates a separate format suggestion. The height is no longer a part of the "change table properties" or "change table cell properties" suggestion, so discarding that suggestion does not change the height. Suggestions created in earlier versions work as before.

  • ui: The switch button background now reads --ck-transition-duration-surface, and the label of a selected list item reads --ck-color-interactive-primary-text, so overriding these roles also changes these components. The default look does not change.

  • utils: Balloons, tooltips, and the block toolbar button are now placed next to what they point at when the editor or its overlay container (config.ui.overlayContainer) is slotted into a position: fixed element of a shadow tree, such as a modal <dialog>, a popover, or a fixed panel of a web component, also when a display: contents element sits between the slot and that element.

Released packages

Check out the Versioning policy guide for more information.

Released packages (summary)

Minor releases (contain minor breaking changes):

Releases containing new features:

Other releases: