MDL-78251 editor_tiny: Update TinyMCE to 6.6.2
Originally I changed the compiled output of TinyMCE from es2015 to es6 to try and allow our own requirejs system to serve the content. This is a change in the TinyMCE repository (or our copy of it). Unfortunately this turned out to not be possible, but I never got around to updating the configuration to stop doing so. Whilst working on this issue, I've removed this change to module compilation, which brings us closer in line to Tiny core, and simplifies the upgrade process.
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
/**
|
||||
* TinyMCE version 6.3.2 (2023-02-22)
|
||||
* TinyMCE version 6.6.2 (2023-08-09)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
const hasProto = (v, constructor, predicate) => {
|
||||
var _a;
|
||||
if (predicate(v, constructor.prototype)) {
|
||||
return true;
|
||||
} else {
|
||||
return v.constructor?.name === constructor.name;
|
||||
return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
|
||||
}
|
||||
};
|
||||
const typeOf = x => {
|
||||
@@ -110,11 +111,10 @@
|
||||
});
|
||||
};
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
||||
|
||||
const pickFile = editor => new Promise(resolve => {
|
||||
let resolved = false;
|
||||
const fileInput = document.createElement('input');
|
||||
fileInput.type = 'file';
|
||||
fileInput.accept = 'image/*';
|
||||
@@ -123,19 +123,29 @@
|
||||
fileInput.style.top = '0';
|
||||
fileInput.style.opacity = '0.001';
|
||||
document.body.appendChild(fileInput);
|
||||
const changeHandler = e => {
|
||||
resolve(Array.prototype.slice.call(e.target.files));
|
||||
const resolveFileInput = value => {
|
||||
var _a;
|
||||
if (!resolved) {
|
||||
(_a = fileInput.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(fileInput);
|
||||
resolved = true;
|
||||
resolve(value);
|
||||
}
|
||||
};
|
||||
const changeHandler = e => {
|
||||
resolveFileInput(Array.prototype.slice.call(e.target.files));
|
||||
};
|
||||
fileInput.addEventListener('input', changeHandler);
|
||||
fileInput.addEventListener('change', changeHandler);
|
||||
const cancelHandler = e => {
|
||||
const cleanup = () => {
|
||||
resolve([]);
|
||||
fileInput.parentNode?.removeChild(fileInput);
|
||||
resolveFileInput([]);
|
||||
};
|
||||
if (global$1.os.isAndroid() && e.type !== 'remove') {
|
||||
global.setEditorTimeout(editor, cleanup, 0);
|
||||
} else {
|
||||
cleanup();
|
||||
if (!resolved) {
|
||||
if (e.type === 'focusin') {
|
||||
global.setEditorTimeout(editor, cleanup, 1000);
|
||||
} else {
|
||||
cleanup();
|
||||
}
|
||||
}
|
||||
editor.off('focusin remove', cancelHandler);
|
||||
};
|
||||
@@ -239,7 +249,7 @@
|
||||
}
|
||||
getOrDie(message) {
|
||||
if (!this.tag) {
|
||||
throw new Error(message ?? 'Called getOrDie on None');
|
||||
throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
|
||||
} else {
|
||||
return this.value;
|
||||
}
|
||||
@@ -392,8 +402,9 @@
|
||||
};
|
||||
|
||||
const addToEditor = editor => {
|
||||
const isEditable = node => editor.dom.getContentEditableParent(node) !== 'false';
|
||||
const isImage = node => node.nodeName === 'IMG' || node.nodeName === 'FIGURE' && /image/i.test(node.className);
|
||||
const isEditable = node => editor.dom.isEditable(node);
|
||||
const isInEditableContext = el => isEditable(el.parentElement);
|
||||
const isImage = node => node.nodeName === 'IMG' || node.nodeName === 'FIGURE' && /image/i.test(node.className) && isInEditableContext(node);
|
||||
const imageToolbarItems = getImageToolbarItems(editor);
|
||||
if (imageToolbarItems.length > 0) {
|
||||
editor.ui.registry.addContextToolbar('imageselection', {
|
||||
@@ -414,7 +425,7 @@
|
||||
};
|
||||
|
||||
var Plugin = () => {
|
||||
global$2.add('quickbars', editor => {
|
||||
global$1.add('quickbars', editor => {
|
||||
register(editor);
|
||||
setupButtons(editor);
|
||||
addToEditor$1(editor);
|
||||
|
||||
Reference in New Issue
Block a user