Skip to content
Snippets Groups Projects
Verified Commit 4befb2b4 authored by Dave Long's avatar Dave Long
Browse files

Issue #3380637 by lauriii, Wim Leers: Update CKEditor 5 to 39.0.1

(cherry picked from commit 5cc339ea)
parent 45f2847c
No related branches found
No related tags found
19 merge requests!11628Update file MediaLibraryWidget.php,!7564Revert "Issue #3364773 by roshnichordiya, Chris Matthews, thakurnishant_06,...,!5752Issue #3275828 by joachim, quietone, bradjones1, Berdir: document the reason...,!5627Issue #3261805: Field not saved when change of 0 on string start,!5427Issue #3338518: send credentials in ajax if configured in CORS settings.,!5395Issue #3387916 by fjgarlin, Spokje: Each GitLab job exposes user email,!5217Issue #3386607 by alexpott: Improve spell checking in commit-code-check.sh,!5064Issue #3379522 by finnsky, Gauravvvv, kostyashupenko, smustgrave, Chi: Revert...,!5040SDC ComponentElement: Transform slots scalar values to #plain_text instead of throwing an exception,!4958Issue #3392147: Whitelist IP for a Ban module.,!4894Issue #3280279: Add API to allow sites to opt in to upload SVG images in CKEditor 5,!4857Issue #3336994: StringFormatter always displays links to entity even if the user in context does not have access,!4856Issue #3336994: StringFormatter always displays links to entity even if the user in context does not have access,!4788Issue #3272985: RSS Feed header reverts to text/html when cached,!4716Issue #3362929: Improve 400 responses for broken/invalid image style routes,!3679Issue #115801: Allow password on registration without disabling e-mail verification,!3106Issue #3017548: "Filtered HTML" text format does not support manual teaser break (<!--break-->),!925Issue #2339235: Remove taxonomy hard dependency on node module,!872Draft: Issue #3221319: Race condition when creating menu links and editing content deletes menu links
......@@ -19,10 +19,10 @@ internal.backbone:
ckeditor5:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
# This file is not aggregated to force the creation of a new aggregate file
......@@ -36,10 +36,10 @@ ckeditor5:
ckeditor5.editorClassic:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/editor-classic/editor-classic.js: { minified: true }
......@@ -48,10 +48,10 @@ ckeditor5.editorClassic:
ckeditor5.editorDecoupled:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/editor-decoupled/editor-decoupled.js: { minified: true }
......@@ -74,10 +74,10 @@ ckeditor5.essentials:
ckeditor5.heading:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/heading/heading.js: { minified: true }
......@@ -87,10 +87,10 @@ ckeditor5.heading:
ckeditor5.basic:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/basic-styles/basic-styles.js: { minified: true }
......@@ -100,10 +100,10 @@ ckeditor5.basic:
ckeditor5.specialCharacters:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/special-characters/special-characters.js: { minified: true }
......@@ -113,10 +113,10 @@ ckeditor5.specialCharacters:
ckeditor5.blockquote:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/block-quote/block-quote.js: { minified: true }
......@@ -126,10 +126,10 @@ ckeditor5.blockquote:
ckeditor5.image:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/image/image.js: { minified: true }
......@@ -139,10 +139,10 @@ ckeditor5.image:
ckeditor5.link:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/link/link.js: { minified: true }
......@@ -152,10 +152,10 @@ ckeditor5.link:
ckeditor5.list:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/list/list.js: { minified: true }
......@@ -165,10 +165,10 @@ ckeditor5.list:
ckeditor5.horizontalLine:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/horizontal-line/horizontal-line.js: { minified: true }
......@@ -178,10 +178,10 @@ ckeditor5.horizontalLine:
ckeditor5.htmlSupport:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/html-support/html-support.js: { minified: true }
......@@ -191,10 +191,10 @@ ckeditor5.htmlSupport:
ckeditor5.alignment:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/alignment/alignment.js: { minified: true }
......@@ -204,10 +204,10 @@ ckeditor5.alignment:
ckeditor5.removeFormat:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/remove-format/remove-format.js: { minified: true }
......@@ -217,10 +217,10 @@ ckeditor5.removeFormat:
ckeditor5.pasteFromOffice:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/paste-from-office/paste-from-office.js: { minified: true }
......@@ -229,10 +229,10 @@ ckeditor5.pasteFromOffice:
ckeditor5.indent:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/indent/indent.js: { minified: true }
......@@ -242,10 +242,10 @@ ckeditor5.indent:
ckeditor5.sourceEditing:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/source-editing/source-editing.js: { minified: true }
......@@ -255,10 +255,10 @@ ckeditor5.sourceEditing:
ckeditor5.table:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/table/table.js: { minified: true }
......@@ -268,10 +268,10 @@ ckeditor5.table:
ckeditor5.language:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/language/language.js: { minified: true }
......@@ -281,10 +281,10 @@ ckeditor5.language:
ckeditor5.codeBlock:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/code-block/code-block.js: { minified: true }
......@@ -294,10 +294,10 @@ ckeditor5.codeBlock:
ckeditor5.style:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/style/style.js: { minified: true }
......@@ -316,10 +316,10 @@ ckeditor5.translations:
ckeditor5.autoformat:
remote: https://github.com/ckeditor/ckeditor5
version: "39.0.0"
version: "39.0.1"
license:
name: GNU-GPL-2.0-or-later
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.0/LICENSE.md
url: https://raw.githubusercontent.com/ckeditor/ckeditor5/v39.0.1/LICENSE.md
gpl-compatible: true
js:
assets/vendor/ckeditor5/autoformat/autoformat.js: { minified: true }
......
This diff is collapsed.
/* eslint-disable import/no-extraneous-dependencies */
// cSpell:words downcasted linkimageediting emptyelement downcastdispatcher
// cSpell:words datafilter downcasted linkimageediting emptyelement downcastdispatcher
import { Plugin } from 'ckeditor5/src/core';
import { setViewAttributes } from '@ckeditor/ckeditor5-html-support/src/utils';
......@@ -538,6 +538,61 @@ function viewImageToModelImage(editor) {
};
}
/**
* General HTML Support integration for attributes on links wrapping images.
*
* This plugin needs to integrate with GHS manually because upstream image link
* plugin GHS integration assumes that the `<a>` element is inside the
* `<imageBlock>` which is not true in the case of Drupal.
*
* @param {module:html-support/datafilter~DataFilter} dataFilter
* The General HTML support data filter.
*
* @return {function}
* Callback that binds an event to its parameter.
*/
function upcastImageBlockLinkGhsAttributes(dataFilter) {
/**
* Callback for the element:img upcast event.
*
* @type {converterHandler}
*/
function converter(event, data, conversionApi) {
if (!data.modelRange) {
return;
}
const viewImageElement = data.viewItem;
const viewContainerElement = viewImageElement.parent;
if (!viewContainerElement.is('element', 'a')) {
return;
}
if (!data.modelRange.getContainedElement().is('element', 'imageBlock')) {
return;
}
const viewAttributes = dataFilter.processViewAttributes(
viewContainerElement,
conversionApi,
);
if (viewAttributes) {
conversionApi.writer.setAttribute(
'htmlLinkAttributes',
viewAttributes,
data.modelRange,
);
}
}
return (dispatcher) => {
dispatcher.on('element:img', converter, {
priority: 'high',
});
};
}
/**
* Modified alternative implementation of linkimageediting.js' downcastImageLink.
*
......@@ -598,8 +653,10 @@ function downcastBlockImageLink() {
}
/**
* Add handling of 'dataEntityUuid', 'dataEntityType', 'isDecorative', 'width',
* 'height' attributes on image elements.
* Drupal Image plugin.
*
* This plugin extends the CKEditor 5 image plugin with custom attributes, and
* removes a wrapping `<figure>` from `<img>` elements in the data downcast.
*
* @private
*/
......@@ -685,6 +742,13 @@ export default class DrupalImageEditing extends Plugin {
},
});
if (editor.plugins.has('DataFilter')) {
const dataFilter = editor.plugins.get('DataFilter');
conversion
.for('upcast')
.add(upcastImageBlockLinkGhsAttributes(dataFilter));
}
conversion
.for('downcast')
.add(modelEntityUuidToDataAttribute())
......
......@@ -32,32 +32,32 @@
"watch:ckeditor5-dev": "yarn watch:ckeditor5 --mode=development"
},
"devDependencies": {
"@ckeditor/ckeditor5-alignment": "~39.0.0",
"@ckeditor/ckeditor5-autoformat": "~39.0.0",
"@ckeditor/ckeditor5-basic-styles": "~39.0.0",
"@ckeditor/ckeditor5-block-quote": "~39.0.0",
"@ckeditor/ckeditor5-code-block": "~39.0.0",
"@ckeditor/ckeditor5-editor-classic": "~39.0.0",
"@ckeditor/ckeditor5-editor-decoupled": "~39.0.0",
"@ckeditor/ckeditor5-essentials": "~39.0.0",
"@ckeditor/ckeditor5-heading": "~39.0.0",
"@ckeditor/ckeditor5-horizontal-line": "~39.0.0",
"@ckeditor/ckeditor5-html-support": "~39.0.0",
"@ckeditor/ckeditor5-image": "~39.0.0",
"@ckeditor/ckeditor5-indent": "~39.0.0",
"@ckeditor/ckeditor5-language": "~39.0.0",
"@ckeditor/ckeditor5-link": "~39.0.0",
"@ckeditor/ckeditor5-list": "~39.0.0",
"@ckeditor/ckeditor5-paste-from-office": "~39.0.0",
"@ckeditor/ckeditor5-remove-format": "~39.0.0",
"@ckeditor/ckeditor5-source-editing": "~39.0.0",
"@ckeditor/ckeditor5-special-characters": "~39.0.0",
"@ckeditor/ckeditor5-style": "~39.0.0",
"@ckeditor/ckeditor5-table": "~39.0.0",
"@ckeditor/ckeditor5-alignment": "~39.0.1",
"@ckeditor/ckeditor5-autoformat": "~39.0.1",
"@ckeditor/ckeditor5-basic-styles": "~39.0.1",
"@ckeditor/ckeditor5-block-quote": "~39.0.1",
"@ckeditor/ckeditor5-code-block": "~39.0.1",
"@ckeditor/ckeditor5-editor-classic": "~39.0.1",
"@ckeditor/ckeditor5-editor-decoupled": "~39.0.1",
"@ckeditor/ckeditor5-essentials": "~39.0.1",
"@ckeditor/ckeditor5-heading": "~39.0.1",
"@ckeditor/ckeditor5-horizontal-line": "~39.0.1",
"@ckeditor/ckeditor5-html-support": "~39.0.1",
"@ckeditor/ckeditor5-image": "~39.0.1",
"@ckeditor/ckeditor5-indent": "~39.0.1",
"@ckeditor/ckeditor5-language": "~39.0.1",
"@ckeditor/ckeditor5-link": "~39.0.1",
"@ckeditor/ckeditor5-list": "~39.0.1",
"@ckeditor/ckeditor5-paste-from-office": "~39.0.1",
"@ckeditor/ckeditor5-remove-format": "~39.0.1",
"@ckeditor/ckeditor5-source-editing": "~39.0.1",
"@ckeditor/ckeditor5-special-characters": "~39.0.1",
"@ckeditor/ckeditor5-style": "~39.0.1",
"@ckeditor/ckeditor5-table": "~39.0.1",
"@drupal/once": "1.0.x",
"backbone": "1.4.x",
"chokidar": "^3.3.1",
"ckeditor5": "~39.0.0",
"ckeditor5": "~39.0.1",
"cspell": "^6.31.1",
"dotenv-safe": "^8.2.0",
"eslint": "^8.44.0",
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment