}
- */
-const execShellCommand = (cmd) => {
- const exec = require('child_process').exec;
- return new Promise((resolve, reject) => {
- exec(cmd, (error, stdout, stderr) => {
- if (error) {
- console.warn(`🚨 ${error}`);
- reject(error);
- }
- resolve(stdout? stdout : stderr);
- });
- });
-}
-
-module.exports = {
- execShellCommand
-};
diff --git a/core/assets/vendor/ckeditor5/build/source-editing.js b/core/assets/vendor/ckeditor5/source-editing.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/source-editing.js
rename to core/assets/vendor/ckeditor5/source-editing.js
diff --git a/core/assets/vendor/ckeditor5/build/special-characters.js b/core/assets/vendor/ckeditor5/special-characters.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/special-characters.js
rename to core/assets/vendor/ckeditor5/special-characters.js
diff --git a/core/assets/vendor/ckeditor5/build/table.js b/core/assets/vendor/ckeditor5/table.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/table.js
rename to core/assets/vendor/ckeditor5/table.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/af.js b/core/assets/vendor/ckeditor5/translations/af.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/af.js
rename to core/assets/vendor/ckeditor5/translations/af.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/ar.js b/core/assets/vendor/ckeditor5/translations/ar.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/ar.js
rename to core/assets/vendor/ckeditor5/translations/ar.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/ast.js b/core/assets/vendor/ckeditor5/translations/ast.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/ast.js
rename to core/assets/vendor/ckeditor5/translations/ast.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/az.js b/core/assets/vendor/ckeditor5/translations/az.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/az.js
rename to core/assets/vendor/ckeditor5/translations/az.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/bg.js b/core/assets/vendor/ckeditor5/translations/bg.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/bg.js
rename to core/assets/vendor/ckeditor5/translations/bg.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/ca.js b/core/assets/vendor/ckeditor5/translations/ca.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/ca.js
rename to core/assets/vendor/ckeditor5/translations/ca.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/cs.js b/core/assets/vendor/ckeditor5/translations/cs.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/cs.js
rename to core/assets/vendor/ckeditor5/translations/cs.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/da.js b/core/assets/vendor/ckeditor5/translations/da.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/da.js
rename to core/assets/vendor/ckeditor5/translations/da.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/de-ch.js b/core/assets/vendor/ckeditor5/translations/de-ch.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/de-ch.js
rename to core/assets/vendor/ckeditor5/translations/de-ch.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/de.js b/core/assets/vendor/ckeditor5/translations/de.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/de.js
rename to core/assets/vendor/ckeditor5/translations/de.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/el.js b/core/assets/vendor/ckeditor5/translations/el.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/el.js
rename to core/assets/vendor/ckeditor5/translations/el.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/en-au.js b/core/assets/vendor/ckeditor5/translations/en-au.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/en-au.js
rename to core/assets/vendor/ckeditor5/translations/en-au.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/en-gb.js b/core/assets/vendor/ckeditor5/translations/en-gb.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/en-gb.js
rename to core/assets/vendor/ckeditor5/translations/en-gb.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/eo.js b/core/assets/vendor/ckeditor5/translations/eo.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/eo.js
rename to core/assets/vendor/ckeditor5/translations/eo.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/es.js b/core/assets/vendor/ckeditor5/translations/es.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/es.js
rename to core/assets/vendor/ckeditor5/translations/es.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/et.js b/core/assets/vendor/ckeditor5/translations/et.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/et.js
rename to core/assets/vendor/ckeditor5/translations/et.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/eu.js b/core/assets/vendor/ckeditor5/translations/eu.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/eu.js
rename to core/assets/vendor/ckeditor5/translations/eu.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/fa.js b/core/assets/vendor/ckeditor5/translations/fa.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/fa.js
rename to core/assets/vendor/ckeditor5/translations/fa.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/fi.js b/core/assets/vendor/ckeditor5/translations/fi.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/fi.js
rename to core/assets/vendor/ckeditor5/translations/fi.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/fr.js b/core/assets/vendor/ckeditor5/translations/fr.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/fr.js
rename to core/assets/vendor/ckeditor5/translations/fr.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/gl.js b/core/assets/vendor/ckeditor5/translations/gl.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/gl.js
rename to core/assets/vendor/ckeditor5/translations/gl.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/gu.js b/core/assets/vendor/ckeditor5/translations/gu.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/gu.js
rename to core/assets/vendor/ckeditor5/translations/gu.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/he.js b/core/assets/vendor/ckeditor5/translations/he.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/he.js
rename to core/assets/vendor/ckeditor5/translations/he.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/hi.js b/core/assets/vendor/ckeditor5/translations/hi.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/hi.js
rename to core/assets/vendor/ckeditor5/translations/hi.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/hr.js b/core/assets/vendor/ckeditor5/translations/hr.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/hr.js
rename to core/assets/vendor/ckeditor5/translations/hr.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/hu.js b/core/assets/vendor/ckeditor5/translations/hu.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/hu.js
rename to core/assets/vendor/ckeditor5/translations/hu.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/id.js b/core/assets/vendor/ckeditor5/translations/id.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/id.js
rename to core/assets/vendor/ckeditor5/translations/id.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/it.js b/core/assets/vendor/ckeditor5/translations/it.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/it.js
rename to core/assets/vendor/ckeditor5/translations/it.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/ja.js b/core/assets/vendor/ckeditor5/translations/ja.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/ja.js
rename to core/assets/vendor/ckeditor5/translations/ja.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/kk.js b/core/assets/vendor/ckeditor5/translations/kk.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/kk.js
rename to core/assets/vendor/ckeditor5/translations/kk.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/km.js b/core/assets/vendor/ckeditor5/translations/km.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/km.js
rename to core/assets/vendor/ckeditor5/translations/km.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/kn.js b/core/assets/vendor/ckeditor5/translations/kn.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/kn.js
rename to core/assets/vendor/ckeditor5/translations/kn.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/ko.js b/core/assets/vendor/ckeditor5/translations/ko.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/ko.js
rename to core/assets/vendor/ckeditor5/translations/ko.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/ku.js b/core/assets/vendor/ckeditor5/translations/ku.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/ku.js
rename to core/assets/vendor/ckeditor5/translations/ku.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/lt.js b/core/assets/vendor/ckeditor5/translations/lt.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/lt.js
rename to core/assets/vendor/ckeditor5/translations/lt.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/lv.js b/core/assets/vendor/ckeditor5/translations/lv.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/lv.js
rename to core/assets/vendor/ckeditor5/translations/lv.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/nb.js b/core/assets/vendor/ckeditor5/translations/nb.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/nb.js
rename to core/assets/vendor/ckeditor5/translations/nb.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/ne.js b/core/assets/vendor/ckeditor5/translations/ne.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/ne.js
rename to core/assets/vendor/ckeditor5/translations/ne.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/nl.js b/core/assets/vendor/ckeditor5/translations/nl.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/nl.js
rename to core/assets/vendor/ckeditor5/translations/nl.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/no.js b/core/assets/vendor/ckeditor5/translations/no.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/no.js
rename to core/assets/vendor/ckeditor5/translations/no.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/oc.js b/core/assets/vendor/ckeditor5/translations/oc.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/oc.js
rename to core/assets/vendor/ckeditor5/translations/oc.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/pl.js b/core/assets/vendor/ckeditor5/translations/pl.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/pl.js
rename to core/assets/vendor/ckeditor5/translations/pl.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/pt-br.js b/core/assets/vendor/ckeditor5/translations/pt-br.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/pt-br.js
rename to core/assets/vendor/ckeditor5/translations/pt-br.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/pt.js b/core/assets/vendor/ckeditor5/translations/pt.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/pt.js
rename to core/assets/vendor/ckeditor5/translations/pt.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/ro.js b/core/assets/vendor/ckeditor5/translations/ro.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/ro.js
rename to core/assets/vendor/ckeditor5/translations/ro.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/ru.js b/core/assets/vendor/ckeditor5/translations/ru.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/ru.js
rename to core/assets/vendor/ckeditor5/translations/ru.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/si.js b/core/assets/vendor/ckeditor5/translations/si.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/si.js
rename to core/assets/vendor/ckeditor5/translations/si.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/sk.js b/core/assets/vendor/ckeditor5/translations/sk.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/sk.js
rename to core/assets/vendor/ckeditor5/translations/sk.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/sl.js b/core/assets/vendor/ckeditor5/translations/sl.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/sl.js
rename to core/assets/vendor/ckeditor5/translations/sl.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/sq.js b/core/assets/vendor/ckeditor5/translations/sq.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/sq.js
rename to core/assets/vendor/ckeditor5/translations/sq.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/sr-latn.js b/core/assets/vendor/ckeditor5/translations/sr-latn.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/sr-latn.js
rename to core/assets/vendor/ckeditor5/translations/sr-latn.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/sr.js b/core/assets/vendor/ckeditor5/translations/sr.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/sr.js
rename to core/assets/vendor/ckeditor5/translations/sr.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/sv.js b/core/assets/vendor/ckeditor5/translations/sv.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/sv.js
rename to core/assets/vendor/ckeditor5/translations/sv.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/th.js b/core/assets/vendor/ckeditor5/translations/th.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/th.js
rename to core/assets/vendor/ckeditor5/translations/th.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/tk.js b/core/assets/vendor/ckeditor5/translations/tk.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/tk.js
rename to core/assets/vendor/ckeditor5/translations/tk.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/tr.js b/core/assets/vendor/ckeditor5/translations/tr.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/tr.js
rename to core/assets/vendor/ckeditor5/translations/tr.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/tt.js b/core/assets/vendor/ckeditor5/translations/tt.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/tt.js
rename to core/assets/vendor/ckeditor5/translations/tt.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/ug.js b/core/assets/vendor/ckeditor5/translations/ug.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/ug.js
rename to core/assets/vendor/ckeditor5/translations/ug.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/uk.js b/core/assets/vendor/ckeditor5/translations/uk.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/uk.js
rename to core/assets/vendor/ckeditor5/translations/uk.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/vi.js b/core/assets/vendor/ckeditor5/translations/vi.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/vi.js
rename to core/assets/vendor/ckeditor5/translations/vi.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/zh-cn.js b/core/assets/vendor/ckeditor5/translations/zh-cn.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/zh-cn.js
rename to core/assets/vendor/ckeditor5/translations/zh-cn.js
diff --git a/core/assets/vendor/ckeditor5/build/translations/zh.js b/core/assets/vendor/ckeditor5/translations/zh.js
similarity index 100%
rename from core/assets/vendor/ckeditor5/build/translations/zh.js
rename to core/assets/vendor/ckeditor5/translations/zh.js
diff --git a/core/core.libraries.yml b/core/core.libraries.yml
index f887c7cea3..826fa73e4d 100644
--- a/core/core.libraries.yml
+++ b/core/core.libraries.yml
@@ -23,196 +23,230 @@ ckeditor:
assets/vendor/ckeditor/ckeditor.js: { preprocess: false, minified: true }
ckeditor5:
- remote: &ckeditor5Remote https://github.com/ckeditor/ckeditor5
- version: &ckeditor5Version "31.0.0"
- license: &ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
name: GNU-GPL-2.0-or-later
url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/ckeditor5-dll.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/ckeditor5-dll.js: { preprocess: false, minified: true }
ckeditor5.editorClassic:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/editor-classic.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/editor-classic.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
ckeditor5.editorDecoupled:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/editor-decoupled.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/editor-decoupled.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
- core/ckeditor5.htmlSupport
ckeditor5.internal:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/drupal/drupalHtmlEngine.js: { preprocess: false, minified: true }
- assets/vendor/ckeditor5/build/essentials.js: { preprocess: false, minified: true }
- assets/vendor/ckeditor5/build/heading.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/essentials.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/heading.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
ckeditor5.basic:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/basic-styles.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/basic-styles.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
ckeditor5.specialCharacters:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/special-characters.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/special-characters.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
ckeditor5.blockquote:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/block-quote.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/block-quote.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
ckeditor5.image:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/image.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/image.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
ckeditor5.link:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/link.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/link.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
ckeditor5.list:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/list.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/list.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
ckeditor5.horizontalLine:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/horizontal-line.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/horizontal-line.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
ckeditor5.htmlSupport:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/html-support.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/html-support.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
ckeditor5.alignment:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/alignment.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/alignment.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
ckeditor5.removeFormat:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/remove-format.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/remove-format.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
ckeditor5.pasteFromOffice:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/paste-from-office.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/paste-from-office.js: { preprocess: false, minified: true }
dependencies:
- ckeditor5/ckeditor5
ckeditor5.indent:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/indent.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/indent.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
ckeditor5.sourceEditing:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/source-editing.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/source-editing.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
ckeditor5.table:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/table.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/table.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
ckeditor5.language:
- remote: *ckeditor5Remote
- version: *ckeditor5Version
- license: *ckeditor5License
- js:
- assets/vendor/ckeditor5/build/language.js: { preprocess: false, minified: true }
- dependencies:
- - core/ckeditor5
-
-drupal.ckeditor5.image:
- js:
- assets/vendor/ckeditor5/build/drupal/drupalImage.js: { preprocess: false, minified: true }
- dependencies:
- - core/ckeditor5.image
-
-drupal.ckeditor5.emphasis:
- version: VERSION
- js:
- assets/vendor/ckeditor5/build/drupal/drupalEmphasis.js: { preprocess: false, minified: true }
- dependencies:
- - core/ckeditor5.basic
-
-drupal.ckeditor5.media:
+ remote: https://github.com/ckeditor/ckeditor5
+ version: "31.0.0"
+ license:
+ name: GNU-GPL-2.0-or-later
+ url: https://github.com/ckeditor/ckeditor5/blob/v31.0.0/LICENSE.md
+ gpl-compatible: true
js:
- assets/vendor/ckeditor5/build/drupal/drupalMedia.js: { preprocess: false, minified: true }
+ assets/vendor/ckeditor5/language.js: { preprocess: false, minified: true }
dependencies:
- core/ckeditor5
diff --git a/core/modules/ckeditor5/ckeditor5.ckeditor5.yml b/core/modules/ckeditor5/ckeditor5.ckeditor5.yml
index 0389ad5913..474322d1c6 100644
--- a/core/modules/ckeditor5/ckeditor5.ckeditor5.yml
+++ b/core/modules/ckeditor5/ckeditor5.ckeditor5.yml
@@ -9,7 +9,7 @@ ckeditor5_essentials:
- essentials.Essentials
drupal:
label: Essentials
- library: core/ckeditor5.internal
+ library: ckeditor5/drupal.ckeditor5.internal
admin_library: ckeditor5/admin.internal
toolbar_items:
undo:
@@ -133,7 +133,7 @@ ckeditor5_emphasis:
- drupalEmphasis.DrupalEmphasis
drupal:
label: Emphasis
- library: core/drupal.ckeditor5.emphasis
+ library: ckeditor5/drupal.ckeditor5.emphasis
admin_library: ckeditor5/admin.basic
toolbar_items:
italic:
@@ -387,7 +387,7 @@ ckeditor5_image:
toolbar: [imageTextAlternative]
drupal:
label: Image
- library: core/drupal.ckeditor5.image
+ library: ckeditor5/drupal.ckeditor5.image
elements:
-
conditions:
diff --git a/core/modules/ckeditor5/ckeditor5.libraries.yml b/core/modules/ckeditor5/ckeditor5.libraries.yml
index 742d64e3e5..a4f082c2c5 100644
--- a/core/modules/ckeditor5/ckeditor5.libraries.yml
+++ b/core/modules/ckeditor5/ckeditor5.libraries.yml
@@ -7,6 +7,12 @@ ckeditor5.language:
dependencies:
- core/ckeditor5.language
+drupal.ckeditor5.internal:
+ js:
+ js/build/drupalHtmlEngine.js: { preprocess: false, minified: true }
+ dependencies:
+ - core/ckeditor5.internal
+
drupal.ckeditor5:
js:
js/ckeditor5.js: {}
@@ -29,12 +35,26 @@ drupal.ckeditor5.quickedit-temporary-work-around:
theme:
css/quickedit-override.css: {}
+drupal.ckeditor5.image:
+ js:
+ js/build/drupalImage.js: { preprocess: false, minified: true }
+ dependencies:
+ - core/ckeditor5.image
+
+drupal.ckeditor5.emphasis:
+ version: VERSION
+ js:
+ js/build/drupalEmphasis.js: { preprocess: false, minified: true }
+ dependencies:
+ - core/ckeditor5.basic
+
drupal.ckeditor5.media:
js:
js/media_embed_ckeditor5.theme.js: {}
+ js/build/drupalMedia.js: { preprocess: false, minified: true }
dependencies:
+ - core/ckeditor5
- core/drupal
- - core/drupal.ckeditor5.media
ie11.user.warnings:
js:
diff --git a/core/modules/ckeditor5/ckeditor5.module b/core/modules/ckeditor5/ckeditor5.module
index 5ae100a3e0..b6ccf9711c 100644
--- a/core/modules/ckeditor5/ckeditor5.module
+++ b/core/modules/ckeditor5/ckeditor5.module
@@ -347,7 +347,7 @@ function ckeditor5_library_info_alter(&$libraries, $extension) {
// Generate libraries for each of the CKEditor 5 translation files so that
// the correct translation file can be attached depending on the current
// language.
- $files = scandir('core/assets/vendor/ckeditor5/build/translations');
+ $files = scandir('core/assets/vendor/ckeditor5/translations');
foreach ($files as $file) {
if ($file[0] !== '.' && preg_match('/\.js$/', $file)) {
$langcode = basename($file, '.js');
@@ -356,7 +356,7 @@ function ckeditor5_library_info_alter(&$libraries, $extension) {
'version' => $libraries['ckeditor5']['version'],
'license' => $libraries['ckeditor5']['license'],
'js' => [
- 'assets/vendor/ckeditor5/build/translations/' . $file => ['preprocess' => FALSE, 'minified' => TRUE],
+ 'assets/vendor/ckeditor5/translations/' . $file => ['preprocess' => FALSE, 'minified' => TRUE],
],
];
}
diff --git a/core/modules/ckeditor5/js/build/drupalEmphasis.js b/core/modules/ckeditor5/js/build/drupalEmphasis.js
new file mode 100644
index 0000000000..7aa31a0b7f
--- /dev/null
+++ b/core/modules/ckeditor5/js/build/drupalEmphasis.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.CKEditor5=t():(e.CKEditor5=e.CKEditor5||{},e.CKEditor5.drupalEmphasis=t())}(self,(function(){return function(){var e={"ckeditor5/src/core.js":function(e,t,r){e.exports=r("dll-reference CKEditor5.dll")("./src/core.js")},"dll-reference CKEditor5.dll":function(e){"use strict";e.exports=CKEditor5.dll}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.d=function(e,t){for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};return function(){"use strict";r.d(o,{default:function(){return s}});var e=r("ckeditor5/src/core.js");class t extends e.Plugin{static get pluginName(){return"DrupalEmphasisEditing"}init(){this.editor.conversion.for("downcast").attributeToElement({model:"italic",view:"em",converterPriority:"high"})}}var i=t;class n extends e.Plugin{static get requires(){return[i]}static get pluginName(){return"DrupalEmphasis"}}var s={DrupalEmphasis:n}}(),o=o.default}()}));
\ No newline at end of file
diff --git a/core/modules/ckeditor5/js/build/drupalHtmlEngine.js b/core/modules/ckeditor5/js/build/drupalHtmlEngine.js
new file mode 100644
index 0000000000..448883cc96
--- /dev/null
+++ b/core/modules/ckeditor5/js/build/drupalHtmlEngine.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.CKEditor5=t():(e.CKEditor5=e.CKEditor5||{},e.CKEditor5.drupalHtmlEngine=t())}(self,(function(){return function(){var e={"ckeditor5/src/core.js":function(e,t,n){e.exports=n("dll-reference CKEditor5.dll")("./src/core.js")},"dll-reference CKEditor5.dll":function(e){"use strict";e.exports=CKEditor5.dll}},t={};function n(r){var p=t[r];if(void 0!==p)return p.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return o}});var e=n("ckeditor5/src/core.js");class t{constructor(){this.chunks=[],this.selfClosingTags=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]}build(){return this.chunks.join("")}appendNode(e){e.nodeType===Node.TEXT_NODE?this._appendText(e):e.nodeType===Node.ELEMENT_NODE?this._appendElement(e):e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&this._appendChildren(e)}_appendElement(e){const t=e.nodeName.toLowerCase();this._append("<"),this._append(t),this._appendAttributes(e),this._append(">"),this.selfClosingTags.includes(t)||(this._appendChildren(e),this._append(""),this._append(t),this._append(">"))}_appendChildren(e){Object.keys(e.childNodes).forEach((t=>{this.appendNode(e.childNodes[t])}))}_appendAttributes(e){Object.keys(e.attributes).forEach((t=>{this._append(" "),this._append(e.attributes[t].name),this._append('="'),this._append(this.constructor._escapeAttribute(e.attributes[t].value)),this._append('"')}))}_appendText(e){const t=document.implementation.createHTMLDocument("").createElement("p");t.textContent=e.textContent,this._append(t.innerHTML)}_append(e){this.chunks.push(e)}static _escapeAttribute(e){return e.replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(//g,">").replace(/\r\n/g,"
").replace(/[\r\n]/g,"
")}}class p{getHtml(e){const n=new t;return n.appendNode(e),n.build()}}class i extends e.Plugin{init(){this.editor.data.processor.htmlWriter=new p}static get pluginName(){return"DrupalHtmlEngine"}}var o={DrupalHtmlEngine:i}}(),r=r.default}()}));
\ No newline at end of file
diff --git a/core/modules/ckeditor5/js/build/drupalImage.js b/core/modules/ckeditor5/js/build/drupalImage.js
new file mode 100644
index 0000000000..44d330d5c9
--- /dev/null
+++ b/core/modules/ckeditor5/js/build/drupalImage.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.CKEditor5=e():(t.CKEditor5=t.CKEditor5||{},t.CKEditor5.drupalImage=e())}(self,(function(){return function(){var t={"ckeditor5/src/core.js":function(t,e,i){t.exports=i("dll-reference CKEditor5.dll")("./src/core.js")},"ckeditor5/src/upload.js":function(t,e,i){t.exports=i("dll-reference CKEditor5.dll")("./src/upload.js")},"ckeditor5/src/utils.js":function(t,e,i){t.exports=i("dll-reference CKEditor5.dll")("./src/utils.js")},"dll-reference CKEditor5.dll":function(t){"use strict";t.exports=CKEditor5.dll}},e={};function i(r){var n=e[r];if(void 0!==n)return n.exports;var a=e[r]={exports:{}};return t[r](a,a.exports,i),a.exports}i.d=function(t,e){for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};return function(){"use strict";i.d(r,{default:function(){return p}});var t=i("ckeditor5/src/core.js");function e(t){return t.createEmptyElement("img")}function n(){function t(t,e,i){if(!i.consumable.consume(e.item,t.name))return;const r=i.mapper.toViewElement(e.item),n=i.writer,a=n.createContainerElement("a",{href:e.attributeNewValue});n.insert(n.createPositionBefore(r),a),n.move(n.createRangeOn(r),n.createPositionAt(a,0)),i.consumable.consume(e.item,"attribute:htmlLinkAttributes:imageBlock")&&function(t,e,i){if(e.attributes)for(const[r,n]of Object.entries(e.attributes))t.setAttribute(r,n,i);e.styles&&t.setStyle(e.styles,i),e.classes&&t.addClass(e.classes,i)}(i.writer,e.item.getAttribute("htmlLinkAttributes"),a)}return e=>{e.on("attribute:linkHref:imageBlock",t,{priority:"high"})}}class a extends t.Plugin{static get pluginName(){return"DrupalImageEditing"}init(){const{editor:t}=this,{conversion:i}=t,{schema:r}=t.model;r.isRegistered("imageInline")&&r.extend("imageInline",{allowAttributes:["dataEntityUuid","dataEntityType","width","height"]}),r.isRegistered("imageBlock")&&r.extend("imageBlock",{allowAttributes:["dataEntityUuid","dataEntityType","width","height"]}),i.for("upcast").add(function(t){function e(e,i,r){const{viewItem:n}=i,{writer:a,consumable:o,safeInsert:s,updateConversionResult:u,schema:l}=r,d=[];let c;if(o.test(n,{name:!0,attributes:"src"})){if(c=l.checkChild(i.modelCursor,"imageInline")?a.createElement("imageInline",{src:n.getAttribute("src")}):a.createElement("imageBlock",{src:n.getAttribute("src")}),t.plugins.has("ImageStyleEditing")&&o.test(n,{name:!0,attributes:"data-align"})){const t={left:"alignBlockLeft",center:"alignCenter",right:"alignBlockRight"},e={left:"alignLeft",right:"alignRight"},i=n.getAttribute("data-align"),r=c.is("element","imageBlock")?t[i]:e[i];a.setAttribute("imageStyle",r,c),d.push("data-align")}if(c.is("element","imageBlock")&&o.test(n,{name:!0,attributes:"data-caption"})){const e=a.createElement("caption"),i=t.data.processor.toView(n.getAttribute("data-caption")),o=a.createDocumentFragment();r.consumable.constructor.createFrom(i,r.consumable),r.convertChildren(i,o);for(const t of Array.from(o.getChildren()))a.append(t,e);a.append(e,c),d.push("data-caption")}o.test(n,{name:!0,attributes:"data-entity-uuid"})&&(a.setAttribute("dataEntityUuid",n.getAttribute("data-entity-uuid"),c),d.push("data-entity-uuid")),o.test(n,{name:!0,attributes:"data-entity-type"})&&(a.setAttribute("dataEntityType",n.getAttribute("data-entity-type"),c),d.push("data-entity-type")),s(c,i.modelCursor)&&(o.consume(n,{name:!0,attributes:d}),u(c,i))}}return t=>{t.on("element:img",e,{priority:"high"})}}(t)).attributeToAttribute({view:{name:"img",key:"width"},model:{key:"width",value:t=>`${t.getAttribute("width")}px`}}).attributeToAttribute({view:{name:"img",key:"height"},model:{key:"height",value:t=>`${t.getAttribute("height")}px`}}),i.for("downcast").add(function(){function t(t,e,i){const{item:r}=e,{consumable:n,writer:a}=i;if(!n.consume(r,t.name))return;const o=i.mapper.toViewElement(r),s=Array.from(o.getChildren()).find((t=>"img"===t.name));a.setAttribute("data-entity-uuid",e.attributeNewValue,s||o)}return e=>{e.on("attribute:dataEntityUuid",t)}}()).add(function(){function t(t,e,i){const{item:r}=e,{consumable:n,writer:a}=i;if(!n.consume(r,t.name))return;const o=i.mapper.toViewElement(r),s=Array.from(o.getChildren()).find((t=>"img"===t.name));a.setAttribute("data-entity-type",e.attributeNewValue,s||o)}return e=>{e.on("attribute:dataEntityType",t)}}()),i.for("dataDowncast").add(function(t){return e=>{e.on("insert:caption",((e,i,r)=>{const{consumable:n,writer:a,mapper:o}=r;if(!n.consume(i.item,"insert"))return;const s=t.model.createRangeIn(i.item),u=a.createDocumentFragment();o.bindElements(i.item,u);for(const{item:e}of Array.from(s)){const i={item:e,range:t.model.createRangeOn(e)},n=`insert:${e.name||"$text"}`;t.data.downcastDispatcher.fire(n,i,r);for(const n of e.getAttributeKeys())Object.assign(i,{attributeKey:n,attributeOldValue:null,attributeNewValue:i.item.getAttribute(n)}),t.data.downcastDispatcher.fire(`attribute:${n}`,i,r)}for(const t of a.createRangeIn(u).getItems())o.unbindViewElement(t);o.unbindViewElement(u);const l=t.data.processor.toData(u);if(l){const t=o.toViewElement(i.item.parent);a.setAttribute("data-caption",l,t)}}),{priority:"high"})}}(t)).elementToElement({model:"imageBlock",view:(t,{writer:i})=>e(i),converterPriority:"high"}).elementToElement({model:"imageInline",view:(t,{writer:i})=>e(i),converterPriority:"high"}).add(function(){function t(t,e,i){const{item:r}=e,{consumable:n,writer:a}=i,o={alignLeft:"left",alignRight:"right",alignCenter:"center",alignBlockRight:"right",alignBlockLeft:"left"};if(!o[e.attributeNewValue]||!n.consume(r,t.name))return;const s=i.mapper.toViewElement(r),u=Array.from(s.getChildren()).find((t=>"img"===t.name));a.setAttribute("data-align",o[e.attributeNewValue],u||s)}return e=>{e.on("attribute:imageStyle",t,{priority:"high"})}}()).add(function(){function t(t,e,i){const{item:r}=e,{consumable:n,writer:a}=i;if(!n.consume(r,t.name))return;const o=i.mapper.toViewElement(r),s=Array.from(o.getChildren()).find((t=>"img"===t.name));a.setAttribute("width",e.attributeNewValue.replace("px",""),s||o)}return e=>{e.on("attribute:width:imageInline",t,{priority:"high"}),e.on("attribute:width:imageBlock",t,{priority:"high"})}}()).add(function(){function t(t,e,i){const{item:r}=e,{consumable:n,writer:a}=i;if(!n.consume(r,t.name))return;const o=i.mapper.toViewElement(r),s=Array.from(o.getChildren()).find((t=>"img"===t.name));a.setAttribute("height",e.attributeNewValue.replace("px",""),s||o)}return e=>{e.on("attribute:height:imageInline",t,{priority:"high"}),e.on("attribute:height:imageBlock",t,{priority:"high"})}}()).add(n())}}class o extends t.Plugin{static get requires(){return[a]}static get pluginName(){return"DrupalImage"}}var s=o;class u extends t.Plugin{init(){const{editor:t}=this;t.plugins.get("ImageUploadEditing").on("uploadComplete",((e,{data:i,imageElement:r})=>{t.model.change((t=>{t.setAttribute("dataEntityUuid",i.dataEntityUuid,r),t.setAttribute("dataEntityType",i.dataEntityType,r)}))}))}static get pluginName(){return"DrupalImageUploadEditing"}}var l=i("ckeditor5/src/upload.js"),d=i("ckeditor5/src/utils.js");class c{constructor(t,e){this.loader=t,this.options=e}upload(){return this.loader.file.then((t=>new Promise(((e,i)=>{this._initRequest(),this._initListeners(e,i,t),this._sendRequest(t)}))))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){this.xhr=new XMLHttpRequest,this.xhr.open("POST",this.options.uploadUrl,!0),this.xhr.responseType="json"}_initListeners(t,e,i){const r=this.xhr,n=this.loader,a=`Couldn't upload file: ${i.name}.`;r.addEventListener("error",(()=>e(a))),r.addEventListener("abort",(()=>e())),r.addEventListener("load",(()=>{const i=r.response;if(!i||i.error)return e(i&&i.error&&i.error.message?i.error.message:a);t({urls:{default:i.url},dataEntityUuid:i.uuid?i.uuid:"",dataEntityType:i.entity_type?i.entity_type:""})})),r.upload&&r.upload.addEventListener("progress",(t=>{t.lengthComputable&&(n.uploadTotal=t.total,n.uploaded=t.loaded)}))}_sendRequest(t){const e=this.options.headers||{},i=this.options.withCredentials||!1;Object.keys(e).forEach((t=>{this.xhr.setRequestHeader(t,e[t])})),this.xhr.withCredentials=i;const r=new FormData;r.append("upload",t),this.xhr.send(r)}}class m extends t.Plugin{static get requires(){return[l.FileRepository]}static get pluginName(){return"DrupalFileRepository"}init(){const t=this.editor.config.get("drupalImageUpload");t&&(t.uploadUrl?this.editor.plugins.get(l.FileRepository).createUploadAdapter=e=>new c(e,t):(0,d.logWarning)("simple-upload-adapter-missing-uploadurl"))}}class g extends t.Plugin{static get requires(){return[m,u]}static get pluginName(){return"DrupalImageUpload"}}var p={DrupalImage:s,DrupalImageUpload:g}}(),r=r.default}()}));
\ No newline at end of file
diff --git a/core/modules/ckeditor5/js/build/drupalMedia.js b/core/modules/ckeditor5/js/build/drupalMedia.js
new file mode 100644
index 0000000000..ee2cc68094
--- /dev/null
+++ b/core/modules/ckeditor5/js/build/drupalMedia.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.CKEditor5=t():(e.CKEditor5=e.CKEditor5||{},e.CKEditor5.drupalMedia=t())}(self,(function(){return function(){var e={"ckeditor5/src/core.js":function(e,t,i){e.exports=i("dll-reference CKEditor5.dll")("./src/core.js")},"ckeditor5/src/ui.js":function(e,t,i){e.exports=i("dll-reference CKEditor5.dll")("./src/ui.js")},"ckeditor5/src/utils.js":function(e,t,i){e.exports=i("dll-reference CKEditor5.dll")("./src/utils.js")},"ckeditor5/src/widget.js":function(e,t,i){e.exports=i("dll-reference CKEditor5.dll")("./src/widget.js")},"dll-reference CKEditor5.dll":function(e){"use strict";e.exports=CKEditor5.dll}},t={};function i(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,i),a.exports}i.d=function(e,t){for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";i.d(r,{default:function(){return y}});var e=i("ckeditor5/src/core.js"),t=i("ckeditor5/src/widget.js");class n extends e.Command{execute(e){const t=this.editor.plugins.get("DrupalMediaEditing"),i=Object.entries(t.attrs).reduce(((e,[t,i])=>(e[i]=t,e)),{}),r=Object.keys(e).reduce(((t,r)=>(i[r]&&(t[i[r]]=e[r]),t)),{});this.editor.model.change((e=>{this.editor.model.insertContent(function(e,t){return e.createElement("drupalMedia",t)}(e,r))}))}refresh(){const e=this.editor.model,t=e.document.selection,i=e.schema.findAllowedParent(t.getFirstPosition(),"drupalMedia");this.isEnabled=null!==i}}class a extends e.Plugin{static get requires(){return[t.Widget]}init(){this.attrs={drupalMediaAlt:"alt",drupalMediaAlign:"data-align",drupalMediaCaption:"data-caption",drupalMediaEntityType:"data-entity-type",drupalMediaEntityUuid:"data-entity-uuid",drupalMediaViewMode:"data-view-mode"};const e=this.editor.config.get("drupalMedia");if(!e)return;const{previewURL:t,themeError:i}=e;this.previewURL=t,this.labelError=this.editor.t("Preview failed"),this.themeError=i||`\n ${this.editor.t("An error occurred while trying to preview the media. Please save your work and reload this page.")}
\n `,this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertDrupalMedia",new n(this.editor))}async _fetchPreview(e,t){const i=await fetch(`${e}?${new URLSearchParams(t)}`,{headers:{"X-Drupal-MediaPreview-CSRF-Token":this.editor.config.get("drupalMedia").previewCsrfToken}});if(i.ok){return{label:i.headers.get("drupal-media-label"),preview:await i.text()}}return{label:this.labelError,preview:this.themeError}}_defineSchema(){this.editor.model.schema.register("drupalMedia",{allowWhere:"$block",isObject:!0,isContent:!0,allowAttributes:Object.keys(this.attrs)})}_defineConverters(){const e=this.editor.conversion;e.for("upcast").elementToElement({view:{name:"drupal-media"},model:"drupalMedia"}),e.for("dataDowncast").elementToElement({model:"drupalMedia",view:{name:"drupal-media"}}),e.for("editingDowncast").elementToElement({model:"drupalMedia",view:(e,{writer:i})=>{const r=i.createContainerElement("div",{class:"drupal-media"}),n=i.createRawElement("div",{"data-drupal-media-preview":"loading"},(t=>{this.previewURL?this._fetchPreview(this.previewURL,{text:this._renderElement(e),uuid:e.getAttribute("drupalMediaEntityUuid")}).then((({label:e,preview:i})=>{t.innerHTML=i,t.setAttribute("aria-label",e),t.setAttribute("data-drupal-media-preview","ready")})):(t.innerHTML=this.themeError,t.setAttribute("aria-label","drupal-media"),t.setAttribute("data-drupal-media-preview","unavailable"))}));return i.insert(i.createPositionAt(r,0),n),i.setCustomProperty("drupalMedia",!0,r),(0,t.toWidget)(r,i,{label:"media widget"})}}),Object.keys(this.attrs).forEach((t=>{e.attributeToAttribute({model:{key:t,name:"drupalMedia"},view:{name:"drupal-media",key:this.attrs[t]}})}))}_renderElement(e){const t=e.getAttributes();let i="{this.attrs[e[0]]&&"drupalMediaCaption"!==e[0]&&(i+=` ${this.attrs[e[0]]}="${e[1]}"`)})),i+=">",i}static get pluginName(){return"DrupalMediaEditing"}}var s=i("ckeditor5/src/ui.js");class o extends e.Plugin{init(){const e=this.editor,t=this.editor.config.get("drupalMedia");if(!t)return;const{libraryURL:i,openDialog:r,dialogSettings:n={}}=t;i&&"function"==typeof r&&e.ui.componentFactory.add("drupalMedia",(t=>{const a=e.commands.get("insertDrupalMedia"),o=new s.ButtonView(t);return o.set({label:e.t("Insert Drupal Media"),icon:'\n',tooltip:!0}),o.bind("isOn","isEnabled").to(a,"value","isEnabled"),this.listenTo(o,"execute",(()=>{r(i,(({attributes:t})=>{e.execute("insertDrupalMedia",t)}),n)})),o}))}}function l(e){return!!e&&e.is("element","drupalMedia")}function d(e){const i=e.getSelectedElement();return i&&function(e){return(0,t.isWidget)(e)&&!!e.getCustomProperty("drupalMedia")}(i)?i:null}class u extends e.Plugin{static get requires(){return[t.WidgetToolbarRepository]}static get pluginName(){return"DrupalMediaToolbar"}afterInit(){const e=this.editor,{t:i}=e;e.plugins.get(t.WidgetToolbarRepository).register("drupalMedia",{ariaLabel:i("Drupal Media toolbar"),items:e.config.get("drupalMedia.toolbar")||[],getRelatedElement:e=>d(e)})}}class c extends e.Command{refresh(){const e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=!1,l(e)&&this._isMediaImage(e).then((e=>{this.isEnabled=e})),l(e)&&e.hasAttribute("drupalMediaAlt")?this.value=e.getAttribute("drupalMediaAlt"):this.value=!1}execute(e){const{model:t}=this.editor,i=t.document.selection.getSelectedElement();e.newValue=e.newValue.trim(),t.change((t=>{e.newValue.length>0?t.setAttribute("drupalMediaAlt",e.newValue,i):t.removeAttribute("drupalMediaAlt",i)}))}async _isMediaImage(e){const t=this.editor.config.get("drupalMedia");if(!t)return null;const{isMediaUrl:i}=t,r=new URLSearchParams({uuid:e.getAttribute("drupalMediaEntityUuid")}),n=await fetch(`${i}&${r}`);return n.ok?JSON.parse(await n.text()):null}}class m extends e.Plugin{static get pluginName(){return"MediaImageTextAlternativeEditing"}init(){this.editor.commands.add("mediaImageTextAlternative",new c(this.editor))}}function h(e){const t=e.editing.view,i=s.BalloonPanelView.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]}}var p=i("ckeditor5/src/utils.js");class f extends s.View{constructor(t){super(t);const i=this.locale.t;this.focusTracker=new p.FocusTracker,this.keystrokes=new p.KeystrokeHandler,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(i("Save"),e.icons.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(i("Cancel"),e.icons.cancel,"ck-button-cancel","cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),(0,s.injectCssTransitionDisabler)(this)}render(){super.render(),this.keystrokes.listenTo(this.element),(0,s.submitHandler)({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)}))}_createButton(e,t,i,r){const n=new s.ButtonView(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n.extendTemplate({attributes:{class:i}}),r&&n.delegate("execute").to(this,r),n}_createLabeledInputView(){const e=this.locale.t,t=new s.LabeledFieldView(this.locale,s.createLabeledInputText);return t.label=e("Override text alternative"),t}}class g extends e.Plugin{static get requires(){return[s.ContextualBalloon]}static get pluginName(){return"MediaImageTextAlternativeUi"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const t=this.editor,i=t.t;t.ui.componentFactory.add("mediaImageTextAlternative",(r=>{const n=t.commands.get("mediaImageTextAlternative"),a=new s.ButtonView(r);return a.set({label:i("Override media image text alternative"),icon:e.icons.lowVision,tooltip:!0}),a.bind("isVisible").to(n,"isEnabled"),this.listenTo(a,"execute",(()=>{this._showForm()})),a}))}_createForm(){const e=this.editor,t=e.editing.view.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new f(e.locale),this._form.render(),this.listenTo(this._form,"submit",(()=>{e.execute("mediaImageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),this._form.keystrokes.set("Esc",((e,t)=>{this._hideForm(!0),t()})),this.listenTo(e.ui,"update",(()=>{d(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");if(d(e.editing.view.document.selection)){const i=h(e);t.updatePosition(i)}}(e):this._hideForm(!0)})),(0,s.clickOutsideHandler)({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const e=this.editor,t=e.commands.get("mediaImageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:h(e)}),i.fieldView.element.value=t.value||"",i.fieldView.value=i.fieldView.element.value,this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class b extends e.Plugin{static get requires(){return[m,g]}static get pluginName(){return"MediaImageTextAlternative"}}function w(e,t,i){if(t.attributes)for(const[r,n]of Object.entries(t.attributes))e.setAttribute(r,n,i);t.styles&&e.setStyle(t.styles,i),t.classes&&e.addClass(t.classes,i)}function v(e){return t=>{t.on("element:drupal-media",((t,i,r)=>{const n=i.viewItem.parent;n.is("element","a")&&function(t,n){const a=e._consumeAllowedAttributes(t,r);a&&r.writer.setAttribute(n,a,i.modelRange)}(n,"htmlLinkAttributes")}),{priority:"low"})}}class M extends e.Plugin{init(){const{editor:e}=this;if(!e.plugins.has("GeneralHtmlSupport"))return;const{schema:t}=e.model,{conversion:i}=e,r=e.plugins.get("DataFilter");t.extend("drupalMedia",{allowAttributes:["htmlLinkAttributes"]}),i.for("upcast").add(v(r)),i.for("editingDowncast").add((e=>e.on("attribute:linkHref:drupalMedia",((e,t,i)=>{if(!i.consumable.consume(t.item,"attribute:htmlLinkAttributes:drupalMedia"))return;const r=i.mapper.toViewElement(t.item),n=function(e,t,i){const r=e.createRangeOn(t);for(const{item:e}of r.getWalker())if(e.is("element",i))return e}(i.writer,r,"a");w(i.writer,t.item.getAttribute("htmlLinkAttributes"),n)}),{priority:"low"}))),i.for("dataDowncast").add((e=>e.on("attribute:linkHref:drupalMedia",((e,t,i)=>{if(!i.consumable.consume(t.item,"attribute:htmlLinkAttributes:drupalMedia"))return;const r=i.mapper.toViewElement(t.item).parent;w(i.writer,t.item.getAttribute("htmlLinkAttributes"),r)}),{priority:"low"})))}static get pluginName(){return"DrupalMediaGeneralHtmlSupport"}}class k extends e.Plugin{static get requires(){return[a,M,o,u,b]}}function _(){return e=>{e.on("element:a",((e,t,i)=>{const r=t.viewItem,n=(a=r,Array.from(a.getChildren()).find((e=>"drupal-media"===e.name)));var a;if(!n)return;if(!i.consumable.consume(r,{attributes:["href"]}))return;const s=r.getAttribute("href");if(!s)return;const o=i.convertItem(n,t.modelCursor);t.modelRange=o.modelRange,t.modelCursor=o.modelCursor;const l=t.modelCursor.nodeBefore;l&&l.is("element","drupalMedia")&&i.writer.setAttribute("linkHref",s,l)}),{priority:"high"})}}class A extends e.Plugin{static get requires(){return["LinkEditing","DrupalMediaEditing"]}static get pluginName(){return"DrupalLinkMediaEditing"}init(){const{editor:e}=this;e.model.schema.extend("drupalMedia",{allowAttributes:["linkHref"]}),e.conversion.for("upcast").add(_()),e.conversion.for("editingDowncast").add((e=>{e.on("attribute:linkHref:drupalMedia",((e,t,i)=>{const{writer:r}=i;if(!i.consumable.consume(t.item,e.name))return;const n=i.mapper.toViewElement(t.item),a=Array.from(n.getChildren()).find((e=>"a"===e.name));if(a)t.attributeNewValue?r.setAttribute("href",t.attributeNewValue,a):(r.move(r.createRangeIn(a),r.createPositionAt(n,0)),r.remove(a));else{const e=Array.from(n.getChildren()).find((e=>e.getAttribute("data-drupal-media-preview"))),i=r.createContainerElement("a",{href:t.attributeNewValue});r.insert(r.createPositionAt(n,0),i),r.move(r.createRangeOn(e),r.createPositionAt(i,0))}}),{priority:"high"})})),e.conversion.for("dataDowncast").add((e=>{e.on("attribute:linkHref:drupalMedia",((e,t,i)=>{const{writer:r}=i;if(!i.consumable.consume(t.item,e.name))return;const n=i.mapper.toViewElement(t.item),a=r.createContainerElement("a",{href:t.attributeNewValue});r.insert(r.createPositionBefore(n),a),r.move(r.createRangeOn(n),r.createPositionAt(a,0))}),{priority:"high"})}))}}class x extends e.Plugin{static get requires(){return["LinkEditing","LinkUI","DrupalMediaEditing"]}static get pluginName(){return"DrupalLinkMediaUi"}init(){const{editor:e}=this,t=e.editing.view.document;this.listenTo(t,"click",((t,i)=>{this._isSelectedLinkedMedia(e.model.document.selection)&&(i.preventDefault(),t.stop())}),{priority:"high"}),this._createToolbarLinkMediaButton()}_createToolbarLinkMediaButton(){const{editor:e}=this,{t:t}=e;e.ui.componentFactory.add("drupalLinkMedia",(i=>{const r=new s.ButtonView(i),n=e.plugins.get("LinkUI"),a=e.commands.get("link");return r.set({isEnabled:!0,label:t("Link media"),icon:'\n',keystroke:"Ctrl+K",tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(a,"isEnabled"),r.bind("isOn").to(a,"value",(e=>!!e)),this.listenTo(r,"execute",(()=>{this._isSelectedLinkedMedia(e.model.document.selection)?n._addActionsView():n._showUI(!0)})),r}))}_isSelectedLinkedMedia(e){const t=e.getSelectedElement();return!!t&&t.is("element","drupalMedia")&&t.hasAttribute("linkHref")}}class E extends e.Plugin{static get requires(){return[A,x]}static get pluginName(){return"DrupalLinkMedia"}}var y={DrupalMedia:k,MediaImageTextAlternative:b,MediaImageTextAlternativeEditing:m,MediaImageTextAlternativeUi:g,DrupalLinkMedia:E}}(),r=r.default}()}));
\ No newline at end of file
diff --git a/core/modules/ckeditor5/js/ckeditor5.admin.es6.js b/core/modules/ckeditor5/js/ckeditor5.admin.es6.js
index 5d0bb41fa5..f40f4b0e96 100644
--- a/core/modules/ckeditor5/js/ckeditor5.admin.es6.js
+++ b/core/modules/ckeditor5/js/ckeditor5.admin.es6.js
@@ -3,7 +3,7 @@
* Provides admin UI for the CKEditor 5.
*/
-(function (Drupal, drupalSettings, $, JSON, once, Sortable) {
+((Drupal, drupalSettings, $, JSON, once, Sortable) => {
const toolbarHelp = [
{
message: Drupal.t(
@@ -31,16 +31,75 @@
},
];
+ /**
+ * Allows attaching listeners to a value.
+ *
+ * @type {Observable}
+ */
+ const Observable = class {
+ /**
+ * Creates new Observable with a value.
+ *
+ * @param {*} value
+ * The value to be observed.
+ */
+ constructor(value) {
+ this._listeners = [];
+ this._value = value;
+ }
+
+ /**
+ * Notifies subscribers about new value.
+ */
+ notify() {
+ this._listeners.forEach((listener) => listener(this._value));
+ }
+
+ /**
+ * Subscribes to be notified for changes.
+ *
+ * @param {Function} listener
+ * The function to be called when a new value is set.
+ */
+ subscribe(listener) {
+ this._listeners.push(listener);
+ }
+
+ /**
+ * The value of the observable.
+ *
+ * @return {*}
+ * The current value.
+ */
+ get value() {
+ return this._value;
+ }
+
+ /**
+ * Sets the value of the observable and notifies subscribers.
+ *
+ * @param {*} val
+ * The new value of the observable.
+ */
+ set value(val) {
+ if (val !== this._value) {
+ this._value = val;
+ this.notify();
+ }
+ }
+ };
+
/**
* Gets selected buttons.
*
* @param {Array} selected
* The selected buttons retrieved from state.
- * @param dividers
+ * @param {Array} dividers
* The available dividers.
- * @param available
+ * @param {Array} available
* The available buttons.
- * @returns {Array}
+ * @return {Array}
+ * An array containing selected buttons.
*/
const getSelectedButtons = (selected, dividers, available) => {
return selected.map((id) => ({
@@ -305,7 +364,7 @@
if (supportedKeys.includes(event.key)) {
if (event.currentTarget.dataset.divider.toLowerCase() === 'true') {
switch (event.key) {
- case 'ArrowDown':
+ case 'ArrowDown': {
const announceChange = (name) => {
Drupal.announce(
Drupal.t(
@@ -327,6 +386,7 @@
)
.focus();
break;
+ }
}
} else if (
selectedButtons.value.includes(event.currentTarget.dataset.id)
@@ -337,7 +397,7 @@
return child === element;
});
switch (event.key) {
- case 'ArrowLeft':
+ case 'ArrowLeft': {
const leftOffset = dir === 'ltr' ? -1 : 1;
moveWithinSelectedButtons(
selectedButtons,
@@ -353,7 +413,8 @@
)
[index + leftOffset].focus();
break;
- case 'ArrowRight':
+ }
+ case 'ArrowRight': {
const rightOffset = dir === 'ltr' ? 1 : -1;
moveWithinSelectedButtons(
selectedButtons,
@@ -369,7 +430,8 @@
)
[index + rightOffset].focus();
break;
- case 'ArrowUp':
+ }
+ case 'ArrowUp': {
const announceChange = (name) => {
Drupal.announce(
Drupal.t(
@@ -401,6 +463,7 @@
.focus();
}
break;
+ }
}
} else if (
toolbarAvailableButtons
@@ -408,7 +471,7 @@
.includes(event.currentTarget.dataset.id)
) {
switch (event.key) {
- case 'ArrowDown':
+ case 'ArrowDown': {
const announceChange = (name) => {
Drupal.announce(
Drupal.t(
@@ -430,6 +493,7 @@
)
.focus();
break;
+ }
}
}
}
@@ -485,18 +549,18 @@
}),
);
+ const mapSelection = (selection) => {
+ return selection.map((id) => {
+ return [...dividers, ...available].find((button) => {
+ return button.id === id;
+ }).name;
+ });
+ };
// Whenever the state is changed, update the textarea with the changes.
// This will also trigger re-render of the admin UI to reinitialize the
// Sortable state.
selected.subscribe((selection) => {
- updateSelectedButtons(
- selection.map((id) => {
- return [...dividers, ...available].find((button) => {
- return button.id === id;
- }).name;
- }),
- selectedTextarea,
- );
+ updateSelectedButtons(mapSelection(selection), selectedTextarea);
render(container, selected, available, dividers);
});
@@ -722,7 +786,7 @@
updateUiStateStorage({ focusSelector });
});
- textarea.addEventListener('focus', (e) => {
+ textarea.addEventListener('focus', () => {
// The selector that should receive focus is stored in the parent
// form element. Move focus to that selector.
const focusSelector = getUiStateStorage('focusSelector');
@@ -759,9 +823,11 @@
* Theme function for CKEditor 5 selected buttons.
*
* @param {Object} options
+ * An object containing options.
* @param {Array} options.buttons
* An array of selected buttons.
- * @returns {string}
+ * @return {string}
+ * The selected buttons markup.
*
* @internal
*/
@@ -781,9 +847,11 @@
* Theme function for CKEditor 5 divider buttons.
*
* @param {Object} options
+ * An object containing options.
* @param {Array} options.buttons
* An array of divider buttons.
- * @returns {string}
+ * @return {string}
+ * The CKEditor 5 divider buttons markup.
*
* @internal
*/
@@ -803,9 +871,11 @@
* Theme function for CKEditor 5 available buttons.
*
* @param {Object} options
+ * An object containing options.
* @param {Array} options.buttons
* An array of available buttons.
- * @returns {string}
+ * @return {string}
+ * The CKEditor 5 available buttons markup.
*
* @internal
*/
@@ -825,14 +895,17 @@
* Theme function for CKEditor 5 buttons.
*
* @param {Object} options
+ * An object containing options.
* @param {Object} options.button
+ * An object containing button options.
* @param {String} options.button.label
* Button label.
* @param {String} options.button.id
* Button id.
* @param {String} options.listType
* The type of the list.
- * @returns {string}
+ * @return {string}
+ * The CKEditor 5 buttons markup.
*
* @internal
*/
@@ -857,6 +930,7 @@
* Theme function for CKEditor 5 admin UI.
*
* @param {Object} options
+ * An object containing options.
* @param {String} options.availableButtons
* Markup for available buttons.
* @param {String} options.dividerButtons
@@ -865,7 +939,8 @@
* Markup for active toolbar.
* @param {Array} options.helpMessage
* An array of help messages.
- * @returns {string}
+ * @return {string}
+ * The CKEditor 5 admin UI markup.
*
* @internal
*/
@@ -908,7 +983,7 @@
// Overrides the default filterStatus to provided functionality needs
// specific to CKEditor 5.
- Drupal.behaviors.filterStatus.attach = function (context, settings) {
+ Drupal.behaviors.filterStatus.attach = (context, settings) => {
const filterStatusCheckboxes = document.querySelectorAll(
'#filters-status-wrapper input.form-checkbox',
);
@@ -947,60 +1022,4 @@
});
},
};
-
- /**
- * Allows attaching listeners to a value.
- *
- * @type {Observable}
- */
- const Observable = class {
- /**
- * Creates new Observable with a value.
- *
- * @param {*} value
- */
- constructor(value) {
- this._listeners = [];
- this._value = value;
- }
-
- /**
- * Notifies subscribers about new value.
- */
- notify() {
- this._listeners.forEach((listener) => listener(this._value));
- }
-
- /**
- * Subscribes to be notified for changes.
- *
- * @param {Function} listener
- * The function to be called when a new value is set.
- */
- subscribe(listener) {
- this._listeners.push(listener);
- }
-
- /**
- * The value of the observable.
- *
- * @returns {*}
- */
- get value() {
- return this._value;
- }
-
- /**
- * Sets the value of the observable and notifies subscribers.
- *
- * @param {*} val
- * The new value of the observable.
- */
- set value(val) {
- if (val !== this._value) {
- this._value = val;
- this.notify();
- }
- }
- };
})(Drupal, drupalSettings, jQuery, JSON, once, Sortable);
diff --git a/core/modules/ckeditor5/js/ckeditor5.admin.js b/core/modules/ckeditor5/js/ckeditor5.admin.js
index e9b70244f9..1d031035f3 100644
--- a/core/modules/ckeditor5/js/ckeditor5.admin.js
+++ b/core/modules/ckeditor5/js/ckeditor5.admin.js
@@ -5,12 +5,6 @@
* @preserve
**/
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
-function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -37,6 +31,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
+
+function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
+
(function (Drupal, drupalSettings, $, JSON, once, Sortable) {
var toolbarHelp = [{
message: Drupal.t("The toolbar buttons that don't fit the user's browser window width will be grouped in a dropdown. If multiple toolbar rows are preferred, those can be configured by adding an explicit wrapping breakpoint wherever you want to start a new row.", null, {
@@ -52,6 +52,44 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
condition: true
}];
+ var Observable = function () {
+ function Observable(value) {
+ _classCallCheck(this, Observable);
+
+ this._listeners = [];
+ this._value = value;
+ }
+
+ _createClass(Observable, [{
+ key: "notify",
+ value: function notify() {
+ var _this = this;
+
+ this._listeners.forEach(function (listener) {
+ return listener(_this._value);
+ });
+ }
+ }, {
+ key: "subscribe",
+ value: function subscribe(listener) {
+ this._listeners.push(listener);
+ }
+ }, {
+ key: "value",
+ get: function get() {
+ return this._value;
+ },
+ set: function set(val) {
+ if (val !== this._value) {
+ this._value = val;
+ this.notify();
+ }
+ }
+ }]);
+
+ return Observable;
+ }();
+
var getSelectedButtons = function getSelectedButtons(selected, dividers, available) {
return selected.map(function (id) {
return _objectSpread({}, [].concat(_toConsumableArray(dividers), _toConsumableArray(available)).find(function (button) {
@@ -209,15 +247,17 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
if (event.currentTarget.dataset.divider.toLowerCase() === 'true') {
switch (event.key) {
case 'ArrowDown':
- var announceChange = function announceChange(name) {
- Drupal.announce(Drupal.t('Button @name has been copied to the active toolbar.', {
- '@name': name
- }));
- };
-
- copyToActiveButtons(selectedButtons, event.currentTarget, announceChange);
- root.querySelector('[data-button-list="ckeditor5-toolbar-active-buttons"] li:last-child').focus();
- break;
+ {
+ var announceChange = function announceChange(name) {
+ Drupal.announce(Drupal.t('Button @name has been copied to the active toolbar.', {
+ '@name': name
+ }));
+ };
+
+ copyToActiveButtons(selectedButtons, event.currentTarget, announceChange);
+ root.querySelector('[data-button-list="ckeditor5-toolbar-active-buttons"] li:last-child').focus();
+ break;
+ }
}
} else if (selectedButtons.value.includes(event.currentTarget.dataset.id)) {
var index = Array.from(element.parentElement.children).findIndex(function (child) {
@@ -226,46 +266,54 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
switch (event.key) {
case 'ArrowLeft':
- var leftOffset = dir === 'ltr' ? -1 : 1;
- moveWithinSelectedButtons(selectedButtons, event.currentTarget, leftOffset);
- root.querySelectorAll('[data-button-list="ckeditor5-toolbar-active-buttons"] li')[index + leftOffset].focus();
- break;
+ {
+ var leftOffset = dir === 'ltr' ? -1 : 1;
+ moveWithinSelectedButtons(selectedButtons, event.currentTarget, leftOffset);
+ root.querySelectorAll('[data-button-list="ckeditor5-toolbar-active-buttons"] li')[index + leftOffset].focus();
+ break;
+ }
case 'ArrowRight':
- var rightOffset = dir === 'ltr' ? 1 : -1;
- moveWithinSelectedButtons(selectedButtons, event.currentTarget, rightOffset);
- root.querySelectorAll('[data-button-list="ckeditor5-toolbar-active-buttons"] li')[index + rightOffset].focus();
- break;
+ {
+ var rightOffset = dir === 'ltr' ? 1 : -1;
+ moveWithinSelectedButtons(selectedButtons, event.currentTarget, rightOffset);
+ root.querySelectorAll('[data-button-list="ckeditor5-toolbar-active-buttons"] li')[index + rightOffset].focus();
+ break;
+ }
case 'ArrowUp':
- var _announceChange = function _announceChange(name) {
- Drupal.announce(Drupal.t('Button @name has been removed from the active toolbar.', {
- '@name': name
- }));
- };
-
- removeFromSelectedButtons(selectedButtons, event.currentTarget, _announceChange);
-
- if (!dividerButtons.find(function (dividerButton) {
- return event.currentTarget.dataset.id === dividerButton.id;
- })) {
- root.querySelector("[data-button-list=\"ckeditor5-toolbar-available-buttons\"] [data-id=\"".concat(event.currentTarget.dataset.id, "\"]")).focus();
- }
+ {
+ var _announceChange = function _announceChange(name) {
+ Drupal.announce(Drupal.t('Button @name has been removed from the active toolbar.', {
+ '@name': name
+ }));
+ };
- break;
+ removeFromSelectedButtons(selectedButtons, event.currentTarget, _announceChange);
+
+ if (!dividerButtons.find(function (dividerButton) {
+ return event.currentTarget.dataset.id === dividerButton.id;
+ })) {
+ root.querySelector("[data-button-list=\"ckeditor5-toolbar-available-buttons\"] [data-id=\"".concat(event.currentTarget.dataset.id, "\"]")).focus();
+ }
+
+ break;
+ }
}
} else if (toolbarAvailableButtons.toArray().includes(event.currentTarget.dataset.id)) {
switch (event.key) {
case 'ArrowDown':
- var _announceChange2 = function _announceChange2(name) {
- Drupal.announce(Drupal.t('Button @name has been moved to the active toolbar.', {
- '@name': name
- }));
- };
-
- addToSelectedButtons(selectedButtons, event.currentTarget, _announceChange2);
- root.querySelector('[data-button-list="ckeditor5-toolbar-active-buttons"] li:last-child').focus();
- break;
+ {
+ var _announceChange2 = function _announceChange2(name) {
+ Drupal.announce(Drupal.t('Button @name has been moved to the active toolbar.', {
+ '@name': name
+ }));
+ };
+
+ addToSelectedButtons(selectedButtons, event.currentTarget, _announceChange2);
+ root.querySelector('[data-button-list="ckeditor5-toolbar-active-buttons"] li:last-child').focus();
+ break;
+ }
}
}
}
@@ -301,12 +349,17 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
return button.name === name;
}).id;
}));
- selected.subscribe(function (selection) {
- updateSelectedButtons(selection.map(function (id) {
+
+ var mapSelection = function mapSelection(selection) {
+ return selection.map(function (id) {
return [].concat(dividers, _toConsumableArray(available)).find(function (button) {
return button.id === id;
}).name;
- }), selectedTextarea);
+ });
+ };
+
+ selected.subscribe(function (selection) {
+ updateSelectedButtons(mapSelection(selection), selectedTextarea);
render(container, selected, available, dividers);
});
[context.querySelector('#ckeditor5-toolbar-buttons-available'), context.querySelector('[class*="editor-settings-toolbar-items"]')].filter(function (el) {
@@ -426,7 +479,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
focusSelector: focusSelector
});
});
- textarea.addEventListener('focus', function (e) {
+ textarea.addEventListener('focus', function () {
var focusSelector = getUiStateStorage('focusSelector');
if (focusSelector) {
@@ -528,42 +581,4 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
});
}
};
-
- var Observable = function () {
- function Observable(value) {
- _classCallCheck(this, Observable);
-
- this._listeners = [];
- this._value = value;
- }
-
- _createClass(Observable, [{
- key: "notify",
- value: function notify() {
- var _this = this;
-
- this._listeners.forEach(function (listener) {
- return listener(_this._value);
- });
- }
- }, {
- key: "subscribe",
- value: function subscribe(listener) {
- this._listeners.push(listener);
- }
- }, {
- key: "value",
- get: function get() {
- return this._value;
- },
- set: function set(val) {
- if (val !== this._value) {
- this._value = val;
- this.notify();
- }
- }
- }]);
-
- return Observable;
- }();
})(Drupal, drupalSettings, jQuery, JSON, once, Sortable);
\ No newline at end of file
diff --git a/core/modules/ckeditor5/js/ckeditor5.es6.js b/core/modules/ckeditor5/js/ckeditor5.es6.js
index 651d1bc54a..5f97a7b079 100644
--- a/core/modules/ckeditor5/js/ckeditor5.es6.js
+++ b/core/modules/ckeditor5/js/ckeditor5.es6.js
@@ -3,7 +3,7 @@
* CKEditor 5 implementation of {@link Drupal.editors} API.
*/
/* global CKEditor5 */
-(function (Drupal, debounce, CKEditor5, $) {
+((Drupal, debounce, CKEditor5, $) => {
/**
* The CKEDITOR instances.
*
@@ -52,10 +52,12 @@
* Converts a string representing regexp to a RegExp object.
*
* @param {Object} config
+ * An object containing configuration.
* @param {string} config.pattern
* The regexp pattern that is used to create the RegExp object.
*
- * @returns {RegExp}
+ * @return {RegExp}
+ * Regexp object built from the string regexp.
*/
function buildRegexp(config) {
const { pattern } = config.regexp;
@@ -66,12 +68,22 @@
return new RegExp(main, options);
}
+ /**
+ * Casts configuration items to correct types.
+ *
+ * @param {Object} config
+ * The config object.
+ * @return {Object}
+ * The config object with items transformed to correct type.
+ */
function processConfig(config) {
/**
- * Processes an array in config.
+ * Processes an array in config recursively.
*
- * @param {*} config
- * @returns {*}
+ * @param {Array} config
+ * An array that should be processed recursively.
+ * @return {Array}
+ * An array that has been processed recursively.
*/
function processArray(config) {
return config.map((item) => {
@@ -105,7 +117,8 @@
/**
* Set an id to a data-attribute for registering this element instance.
*
- * @param element
+ * @param {Element} element
+ * An element that should receive unique ID.
*
* @return {string}
* The id to use for this element.
@@ -121,6 +134,7 @@
* Return a unique selector for the element.
*
* @param {HTMLElement} element
+ * An element which unique ID should be retrieved.
*
* @return {string}
* The id to use for this element.
@@ -145,6 +159,7 @@
return CKEditor5[build][name];
}
+ // eslint-disable-next-line no-console
console.warn(`Failed to load ${build} - ${name}`);
return null;
});
@@ -191,6 +206,7 @@
existingCss += `${prefix} ${cssText}`;
});
} catch (e) {
+ // eslint-disable-next-line no-console
console.warn(
`Stylesheet ${sheet.href} not included in CKEditor reset due to the browser's CORS policy.`,
);
@@ -335,6 +351,7 @@
}
})
.catch((error) => {
+ // eslint-disable-next-line no-console
console.error(error);
});
},
@@ -374,10 +391,11 @@
// This pulls the necessary values from the QuickEdit Backbone Model
// before it is destroyed, so they can be used by
// `editor.destroy().then()` to perform the expected revert.
- Drupal.quickedit.editors.editor.prototype.revert = function () {
- textElement = this.$textElement[0];
- originalValue = this.model.get('originalValue');
- };
+ Drupal.quickedit.editors.editor.prototype.revert =
+ function revertQuickeditChanges() {
+ textElement = this.$textElement[0];
+ originalValue = this.model.get('originalValue');
+ };
}
editor
@@ -399,6 +417,7 @@
}
})
.catch((error) => {
+ // eslint-disable-next-line no-console
console.error(error);
});
}
@@ -425,12 +444,10 @@
* The text format used in the editor.
* @param {string} [mainToolbarId]
* The id attribute for the main editor toolbar, if any.
- * @param {string} [floatedToolbarId]
- * The id attribute for the floated editor toolbar, if any.
*
* @see Drupal.quickedit.editors.editor
*/
- attachInlineEditor(element, format, mainToolbarId, floatedToolbarId) {
+ attachInlineEditor(element, format, mainToolbarId) {
const { editorDecoupled } = CKEditor5;
const {
toolbar,
@@ -463,6 +480,7 @@
});
})
.catch((error) => {
+ // eslint-disable-next-line no-console
console.error(error);
});
},
@@ -517,10 +535,13 @@
};
// Respond to new dialogs that are opened by CKEditor, closing the AJAX loader.
- $(window).on('dialog:beforecreate', (e, dialog, $element, settings) => {
- $('.ckeditor5-dialog-loading').animate({ top: '-40px' }, function () {
- $(this).remove();
- });
+ $(window).on('dialog:beforecreate', () => {
+ $('.ckeditor5-dialog-loading').animate(
+ { top: '-40px' },
+ function removeDialogLoading() {
+ $(this).remove();
+ },
+ );
});
// Respond to dialogs that are saved, sending data back to CKEditor.
@@ -531,7 +552,7 @@
});
// Respond to dialogs that are closed, removing the current save handler.
- $(window).on('dialog:afterclose', (e, dialog, $element) => {
+ $(window).on('dialog:afterclose', () => {
if (Drupal.ckeditor5.saveCallback) {
Drupal.ckeditor5.saveCallback = null;
}
diff --git a/core/modules/ckeditor5/js/ckeditor5.filter.admin.es6.js b/core/modules/ckeditor5/js/ckeditor5.filter.admin.es6.js
index 13785dc527..0e837f7f83 100644
--- a/core/modules/ckeditor5/js/ckeditor5.filter.admin.es6.js
+++ b/core/modules/ckeditor5/js/ckeditor5.filter.admin.es6.js
@@ -3,7 +3,7 @@
* Provides Text Editor UI improvements specific to CKEditor 5.
*/
-(function (Drupal, once) {
+((Drupal, once) => {
Drupal.behaviors.allowedTagsListener = {
attach: function attach(context) {
once(
@@ -123,7 +123,9 @@
* specific CKEditor 5-related events from triggering that AJAX response
* unless certain criteria are met.
*/
- Drupal.Ajax.prototype.eventResponse = function (...args) {
+ Drupal.Ajax.prototype.eventResponse = function ckeditor5AjaxEventResponse(
+ ...args
+ ) {
// There are AJAX callbacks that should only be triggered if the editor
//