@wiris/mathtype-ckeditor5 8.13.4 → 8.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +147 -71
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.umd.js +147 -71
- package/dist/browser/index.umd.js.map +1 -1
- package/dist/index.js +24 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/integration.js +10 -6
- package/src/plugin.js +24 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
})(this, (function (exports, ckeditor5) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
8
|
-
/*! @license DOMPurify 3.
|
|
8
|
+
/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
|
|
9
9
|
|
|
10
10
|
const {
|
|
11
11
|
entries,
|
|
@@ -34,12 +34,18 @@
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
if (!apply) {
|
|
37
|
-
apply = function apply(
|
|
38
|
-
|
|
37
|
+
apply = function apply(func, thisArg) {
|
|
38
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
39
|
+
args[_key - 2] = arguments[_key];
|
|
40
|
+
}
|
|
41
|
+
return func.apply(thisArg, args);
|
|
39
42
|
};
|
|
40
43
|
}
|
|
41
44
|
if (!construct) {
|
|
42
|
-
construct = function construct(Func
|
|
45
|
+
construct = function construct(Func) {
|
|
46
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
47
|
+
args[_key2 - 1] = arguments[_key2];
|
|
48
|
+
}
|
|
43
49
|
return new Func(...args);
|
|
44
50
|
};
|
|
45
51
|
}
|
|
@@ -68,8 +74,8 @@
|
|
|
68
74
|
if (thisArg instanceof RegExp) {
|
|
69
75
|
thisArg.lastIndex = 0;
|
|
70
76
|
}
|
|
71
|
-
for (var
|
|
72
|
-
args[
|
|
77
|
+
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
78
|
+
args[_key3 - 1] = arguments[_key3];
|
|
73
79
|
}
|
|
74
80
|
return apply(func, thisArg, args);
|
|
75
81
|
};
|
|
@@ -80,12 +86,12 @@
|
|
|
80
86
|
* @param func - The constructor function to be wrapped and called.
|
|
81
87
|
* @returns A new function that constructs an instance of the given constructor function with the provided arguments.
|
|
82
88
|
*/
|
|
83
|
-
function unconstruct(
|
|
89
|
+
function unconstruct(Func) {
|
|
84
90
|
return function () {
|
|
85
|
-
for (var
|
|
86
|
-
args[
|
|
91
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
92
|
+
args[_key4] = arguments[_key4];
|
|
87
93
|
}
|
|
88
|
-
return construct(
|
|
94
|
+
return construct(Func, args);
|
|
89
95
|
};
|
|
90
96
|
}
|
|
91
97
|
/**
|
|
@@ -184,8 +190,8 @@
|
|
|
184
190
|
return fallbackValue;
|
|
185
191
|
}
|
|
186
192
|
|
|
187
|
-
const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
|
188
|
-
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
|
193
|
+
const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'search', 'section', 'select', 'shadow', 'slot', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
|
194
|
+
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
|
189
195
|
const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
|
|
190
196
|
// List of SVG elements that are disallowed by default.
|
|
191
197
|
// We still need to know them so that we can do namespace
|
|
@@ -198,8 +204,8 @@
|
|
|
198
204
|
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
|
199
205
|
const text = freeze(['#text']);
|
|
200
206
|
|
|
201
|
-
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
|
|
202
|
-
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
207
|
+
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
|
|
208
|
+
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
203
209
|
const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
|
|
204
210
|
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
205
211
|
|
|
@@ -297,7 +303,7 @@
|
|
|
297
303
|
function createDOMPurify() {
|
|
298
304
|
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
299
305
|
const DOMPurify = root => createDOMPurify(root);
|
|
300
|
-
DOMPurify.version = '3.
|
|
306
|
+
DOMPurify.version = '3.3.1';
|
|
301
307
|
DOMPurify.removed = [];
|
|
302
308
|
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
303
309
|
// Not running in a browser, provide a factory function
|
|
@@ -408,6 +414,21 @@
|
|
|
408
414
|
let FORBID_TAGS = null;
|
|
409
415
|
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
|
410
416
|
let FORBID_ATTR = null;
|
|
417
|
+
/* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */
|
|
418
|
+
const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
|
|
419
|
+
tagCheck: {
|
|
420
|
+
writable: true,
|
|
421
|
+
configurable: false,
|
|
422
|
+
enumerable: true,
|
|
423
|
+
value: null
|
|
424
|
+
},
|
|
425
|
+
attributeCheck: {
|
|
426
|
+
writable: true,
|
|
427
|
+
configurable: false,
|
|
428
|
+
enumerable: true,
|
|
429
|
+
value: null
|
|
430
|
+
}
|
|
431
|
+
}));
|
|
411
432
|
/* Decide if ARIA attributes are okay */
|
|
412
433
|
let ALLOW_ARIA_ATTR = true;
|
|
413
434
|
/* Decide if custom data attributes are okay */
|
|
@@ -600,16 +621,24 @@
|
|
|
600
621
|
}
|
|
601
622
|
/* Merge configuration parameters */
|
|
602
623
|
if (cfg.ADD_TAGS) {
|
|
603
|
-
if (
|
|
604
|
-
|
|
624
|
+
if (typeof cfg.ADD_TAGS === 'function') {
|
|
625
|
+
EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
|
|
626
|
+
} else {
|
|
627
|
+
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
|
628
|
+
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
629
|
+
}
|
|
630
|
+
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
605
631
|
}
|
|
606
|
-
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
607
632
|
}
|
|
608
633
|
if (cfg.ADD_ATTR) {
|
|
609
|
-
if (
|
|
610
|
-
|
|
634
|
+
if (typeof cfg.ADD_ATTR === 'function') {
|
|
635
|
+
EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
|
|
636
|
+
} else {
|
|
637
|
+
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
|
638
|
+
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
639
|
+
}
|
|
640
|
+
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
611
641
|
}
|
|
612
|
-
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
613
642
|
}
|
|
614
643
|
if (cfg.ADD_URI_SAFE_ATTR) {
|
|
615
644
|
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
|
|
@@ -620,6 +649,12 @@
|
|
|
620
649
|
}
|
|
621
650
|
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
|
622
651
|
}
|
|
652
|
+
if (cfg.ADD_FORBID_CONTENTS) {
|
|
653
|
+
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
|
|
654
|
+
FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
|
655
|
+
}
|
|
656
|
+
addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
|
|
657
|
+
}
|
|
623
658
|
/* Add #text in case KEEP_CONTENT is set to true */
|
|
624
659
|
if (KEEP_CONTENT) {
|
|
625
660
|
ALLOWED_TAGS['#text'] = true;
|
|
@@ -917,7 +952,7 @@
|
|
|
917
952
|
return true;
|
|
918
953
|
}
|
|
919
954
|
/* Remove element if anything forbids its presence */
|
|
920
|
-
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
955
|
+
if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) {
|
|
921
956
|
/* Check if we have a custom element to handle */
|
|
922
957
|
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
|
923
958
|
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
|
@@ -989,12 +1024,12 @@
|
|
|
989
1024
|
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
990
1025
|
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
991
1026
|
We don't need to check the value; it's always URI safe. */
|
|
992
|
-
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
|
1027
|
+
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
|
993
1028
|
if (
|
|
994
1029
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
995
1030
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
996
1031
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
997
|
-
_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||
|
|
1032
|
+
_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) ||
|
|
998
1033
|
// Alternative, second condition checks if it's an `is`-attribute, AND
|
|
999
1034
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1000
1035
|
lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {
|
|
@@ -1073,7 +1108,12 @@
|
|
|
1073
1108
|
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
1074
1109
|
}
|
|
1075
1110
|
/* Work around a security issue with comments inside attributes */
|
|
1076
|
-
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
|
1111
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) {
|
|
1112
|
+
_removeAttribute(name, currentNode);
|
|
1113
|
+
continue;
|
|
1114
|
+
}
|
|
1115
|
+
/* Make sure we cannot easily use animated hrefs, even if animations are allowed */
|
|
1116
|
+
if (lcName === 'attributename' && stringMatch(value, 'href')) {
|
|
1077
1117
|
_removeAttribute(name, currentNode);
|
|
1078
1118
|
continue;
|
|
1079
1119
|
}
|
|
@@ -3457,6 +3497,13 @@
|
|
|
3457
3497
|
}
|
|
3458
3498
|
}
|
|
3459
3499
|
/**
|
|
3500
|
+
* A map from event target to event handlers so we can remove the event
|
|
3501
|
+
* listeners in removeElementEvents
|
|
3502
|
+
*
|
|
3503
|
+
* @type {Map<EventTarget, Object>}
|
|
3504
|
+
* @static
|
|
3505
|
+
*/ static elementEventsMap = new Map();
|
|
3506
|
+
/**
|
|
3460
3507
|
* Adds the a callback function, for a certain event target, to the following event types:
|
|
3461
3508
|
* - dblclick
|
|
3462
3509
|
* - mousedown
|
|
@@ -3467,24 +3514,29 @@
|
|
|
3467
3514
|
* @param {Function} mouseupHandler - function to run when on mouseup event.
|
|
3468
3515
|
* @static
|
|
3469
3516
|
*/ static addElementEvents(eventTarget, doubleClickHandler, mousedownHandler, mouseupHandler) {
|
|
3517
|
+
// Make sure not to leak event listeners if we've already added events to
|
|
3518
|
+
// this element
|
|
3519
|
+
Util.removeElementEvents(eventTarget);
|
|
3520
|
+
let entry = {};
|
|
3521
|
+
Util.elementEventsMap.set(eventTarget, entry);
|
|
3470
3522
|
if (doubleClickHandler) {
|
|
3471
|
-
|
|
3523
|
+
entry.callbackDblclick = (event)=>{
|
|
3472
3524
|
const realEvent = event || window.event;
|
|
3473
3525
|
const element = realEvent.srcElement ? realEvent.srcElement : realEvent.target;
|
|
3474
3526
|
doubleClickHandler(element, realEvent);
|
|
3475
3527
|
};
|
|
3476
|
-
Util.addEvent(eventTarget, "dblclick",
|
|
3528
|
+
Util.addEvent(eventTarget, "dblclick", entry.callbackDblclick);
|
|
3477
3529
|
}
|
|
3478
3530
|
if (mousedownHandler) {
|
|
3479
|
-
|
|
3531
|
+
entry.callbackMousedown = (event)=>{
|
|
3480
3532
|
const realEvent = event || window.event;
|
|
3481
3533
|
const element = realEvent.srcElement ? realEvent.srcElement : realEvent.target;
|
|
3482
3534
|
mousedownHandler(element, realEvent);
|
|
3483
3535
|
};
|
|
3484
|
-
Util.addEvent(eventTarget, "mousedown",
|
|
3536
|
+
Util.addEvent(eventTarget, "mousedown", entry.callbackMousedown);
|
|
3485
3537
|
}
|
|
3486
3538
|
if (mouseupHandler) {
|
|
3487
|
-
|
|
3539
|
+
entry.callbackMouseup = (event)=>{
|
|
3488
3540
|
const realEvent = event || window.event;
|
|
3489
3541
|
const element = realEvent.srcElement ? realEvent.srcElement : realEvent.target;
|
|
3490
3542
|
mouseupHandler(element, realEvent);
|
|
@@ -3493,8 +3545,8 @@
|
|
|
3493
3545
|
// while the mouse is outside the editor text field.
|
|
3494
3546
|
// This is a workaround: we trigger the event independently of where the mouse
|
|
3495
3547
|
// is when we release its button.
|
|
3496
|
-
Util.addEvent(document, "mouseup",
|
|
3497
|
-
Util.addEvent(eventTarget, "mouseup",
|
|
3548
|
+
Util.addEvent(document, "mouseup", entry.callbackMouseup);
|
|
3549
|
+
Util.addEvent(eventTarget, "mouseup", entry.callbackMouseup);
|
|
3498
3550
|
}
|
|
3499
3551
|
}
|
|
3500
3552
|
/**
|
|
@@ -3505,10 +3557,15 @@
|
|
|
3505
3557
|
* @param {EventTarget} eventTarget - event target.
|
|
3506
3558
|
* @static
|
|
3507
3559
|
*/ static removeElementEvents(eventTarget) {
|
|
3508
|
-
Util.
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3560
|
+
let entry = Util.elementEventsMap.get(eventTarget);
|
|
3561
|
+
if (!entry) {
|
|
3562
|
+
return;
|
|
3563
|
+
}
|
|
3564
|
+
Util.elementEventsMap.delete(eventTarget);
|
|
3565
|
+
Util.removeEvent(eventTarget, "dblclick", entry.callbackDblclick);
|
|
3566
|
+
Util.removeEvent(eventTarget, "mousedown", entry.callbackMousedown);
|
|
3567
|
+
Util.removeEvent(document, "mouseup", entry.callbackMouseup);
|
|
3568
|
+
Util.removeEvent(eventTarget, "mouseup", entry.callbackMouseup);
|
|
3512
3569
|
}
|
|
3513
3570
|
/**
|
|
3514
3571
|
* Adds a class name to a HTMLElement.
|
|
@@ -7232,11 +7289,11 @@
|
|
|
7232
7289
|
this.closeDiv.setAttribute("role", "button");
|
|
7233
7290
|
this.closeDiv.setAttribute("tabindex", 3);
|
|
7234
7291
|
// Apply styles and events after the creation as createElement doesn't process them correctly
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
this.closeDiv.setAttribute("style",
|
|
7238
|
-
this.closeDiv.
|
|
7239
|
-
this.closeDiv.
|
|
7292
|
+
const generalStyleClose = `background-size: 10px; background-image: url(data:image/svg+xml;base64,${window.btoa(closeIcon)})`;
|
|
7293
|
+
const hoverStyleClose = `background-size: 10px; background-image: url(data:image/svg+xml;base64,${window.btoa(closeHoverIcon)})`;
|
|
7294
|
+
this.closeDiv.setAttribute("style", generalStyleClose);
|
|
7295
|
+
this.closeDiv.addEventListener("mouseover", (e)=>e.target.style = hoverStyleClose);
|
|
7296
|
+
this.closeDiv.addEventListener("mouseout", (e)=>e.target.style = generalStyleClose);
|
|
7240
7297
|
// To identifiy the element in automated testing
|
|
7241
7298
|
this.closeDiv.setAttribute("data-testid", "mtcteditor-close-button");
|
|
7242
7299
|
attributes = {};
|
|
@@ -7246,11 +7303,11 @@
|
|
|
7246
7303
|
this.stackDiv = Util.createElement("a", attributes);
|
|
7247
7304
|
this.stackDiv.setAttribute("role", "button");
|
|
7248
7305
|
this.stackDiv.setAttribute("tabindex", 2);
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
this.stackDiv.setAttribute("style",
|
|
7252
|
-
this.stackDiv.
|
|
7253
|
-
this.stackDiv.
|
|
7306
|
+
const generalStyleStack = `background-size: 10px; background-image: url(data:image/svg+xml;base64,${window.btoa(minsIcon)})`;
|
|
7307
|
+
const hoverStyleStack = `background-size: 10px; background-image: url(data:image/svg+xml;base64,${window.btoa(minsHoverIcon)})`;
|
|
7308
|
+
this.stackDiv.setAttribute("style", generalStyleStack);
|
|
7309
|
+
this.stackDiv.addEventListener("mouseover", (e)=>e.target.style = hoverStyleStack);
|
|
7310
|
+
this.stackDiv.addEventListener("mouseout", (e)=>e.target.style = generalStyleStack);
|
|
7254
7311
|
// To identifiy the element in automated testing
|
|
7255
7312
|
this.stackDiv.setAttribute("data-testid", "mtcteditor-fullscreen-disable-button");
|
|
7256
7313
|
attributes = {};
|
|
@@ -7260,11 +7317,11 @@
|
|
|
7260
7317
|
this.maximizeDiv = Util.createElement("a", attributes);
|
|
7261
7318
|
this.maximizeDiv.setAttribute("role", "button");
|
|
7262
7319
|
this.maximizeDiv.setAttribute("tabindex", 2);
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
this.maximizeDiv.setAttribute("style",
|
|
7266
|
-
this.maximizeDiv.
|
|
7267
|
-
this.maximizeDiv.
|
|
7320
|
+
const generalStyleMaximize = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(fullsIcon)})`;
|
|
7321
|
+
const hoverStyleMaximize = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(fullsHoverIcon)})`;
|
|
7322
|
+
this.maximizeDiv.setAttribute("style", generalStyleMaximize);
|
|
7323
|
+
this.maximizeDiv.addEventListener("mouseover", (e)=>e.target.style = hoverStyleMaximize);
|
|
7324
|
+
this.maximizeDiv.addEventListener("mouseout", (e)=>e.target.style = generalStyleMaximize);
|
|
7268
7325
|
// To identifiy the element in automated testing
|
|
7269
7326
|
this.maximizeDiv.setAttribute("data-testid", "mtcteditor-fullscreen-enable-button");
|
|
7270
7327
|
attributes = {};
|
|
@@ -7274,11 +7331,11 @@
|
|
|
7274
7331
|
this.minimizeDiv = Util.createElement("a", attributes);
|
|
7275
7332
|
this.minimizeDiv.setAttribute("role", "button");
|
|
7276
7333
|
this.minimizeDiv.setAttribute("tabindex", 1);
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
this.minimizeDiv.setAttribute("style",
|
|
7280
|
-
this.minimizeDiv.
|
|
7281
|
-
this.minimizeDiv.
|
|
7334
|
+
const generalStyleMinimize = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(minIcon)})`;
|
|
7335
|
+
const hoverStyleMinimize = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(minHoverIcon)})`;
|
|
7336
|
+
this.minimizeDiv.setAttribute("style", generalStyleMinimize);
|
|
7337
|
+
this.minimizeDiv.addEventListener("mouseover", (e)=>e.target.style = hoverStyleMinimize);
|
|
7338
|
+
this.minimizeDiv.addEventListener("mouseout", (e)=>e.target.style = generalStyleMinimize);
|
|
7282
7339
|
// To identify the element in automated testing
|
|
7283
7340
|
this.minimizeDiv.setAttribute("data-testid", "mtcteditor-minimize-button");
|
|
7284
7341
|
attributes = {};
|
|
@@ -7830,8 +7887,8 @@
|
|
|
7830
7887
|
const generalStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(minIcon)})`;
|
|
7831
7888
|
const hoverStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(minHoverIcon)})`;
|
|
7832
7889
|
this.minimizeDiv.setAttribute("style", generalStyle);
|
|
7833
|
-
this.minimizeDiv.
|
|
7834
|
-
this.minimizeDiv.
|
|
7890
|
+
this.minimizeDiv.addEventListener("mouseover", (e)=>e.target.style = hoverStyle);
|
|
7891
|
+
this.minimizeDiv.addEventListener("mouseout", (e)=>e.target.style = generalStyle);
|
|
7835
7892
|
this.restoreModalProperties();
|
|
7836
7893
|
if (typeof this.resizerBR !== "undefined" && typeof this.resizerTL !== "undefined") {
|
|
7837
7894
|
this.setResizeButtonsVisibility();
|
|
@@ -7873,8 +7930,8 @@
|
|
|
7873
7930
|
const generalStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(maxIcon)})`;
|
|
7874
7931
|
const hoverStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(maxHoverIcon)})`;
|
|
7875
7932
|
this.minimizeDiv.setAttribute("style", generalStyle);
|
|
7876
|
-
this.minimizeDiv.
|
|
7877
|
-
this.minimizeDiv.
|
|
7933
|
+
this.minimizeDiv.addEventListener("mouseover", (e)=>e.target.style = hoverStyle);
|
|
7934
|
+
this.minimizeDiv.addEventListener("mouseout", (e)=>e.target.style = generalStyle);
|
|
7878
7935
|
}
|
|
7879
7936
|
}
|
|
7880
7937
|
/**
|
|
@@ -7901,8 +7958,8 @@
|
|
|
7901
7958
|
const generalStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(minIcon)})`;
|
|
7902
7959
|
const hoverStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${window.btoa(minHoverIcon)})`;
|
|
7903
7960
|
this.minimizeDiv.setAttribute("style", generalStyle);
|
|
7904
|
-
this.minimizeDiv.
|
|
7905
|
-
this.minimizeDiv.
|
|
7961
|
+
this.minimizeDiv.addEventListener("mouseover", (e)=>e.target.style = hoverStyle);
|
|
7962
|
+
this.minimizeDiv.addEventListener("mouseout", (e)=>e.target.style = generalStyle);
|
|
7906
7963
|
// Set size to 80% screen with a max size.
|
|
7907
7964
|
this.setSize(parseInt(window.innerHeight * 0.8, 10), parseInt(window.innerWidth * 0.8, 10));
|
|
7908
7965
|
if (this.container.clientHeight > 700) {
|
|
@@ -9691,6 +9748,8 @@
|
|
|
9691
9748
|
* Opens formula editor to editing an existing formula. Can be overwritten in order to make some
|
|
9692
9749
|
* actions from integration part before the formula is edited.
|
|
9693
9750
|
*/ openExistingFormulaEditor() {
|
|
9751
|
+
// Recover owner integration instance.
|
|
9752
|
+
WirisPlugin.currentInstance = this;
|
|
9694
9753
|
if (window.navigator.onLine) {
|
|
9695
9754
|
this.core.editionProperties.isNewElement = false;
|
|
9696
9755
|
this.core.openModalDialog(this.target, this.isIframe);
|
|
@@ -9767,7 +9826,8 @@
|
|
|
9767
9826
|
Util.addElementEvents(eventTarget, (element, event)=>{
|
|
9768
9827
|
this.doubleClickHandler(element, event);
|
|
9769
9828
|
// Avoid creating the double click listener more than once for each element.
|
|
9770
|
-
|
|
9829
|
+
// This also allows CKEditor4 to add their own double click listener.
|
|
9830
|
+
event.preventDefault();
|
|
9771
9831
|
}, (element, event)=>{
|
|
9772
9832
|
this.mousedownHandler(element, event);
|
|
9773
9833
|
}, (element, event)=>{
|
|
@@ -11107,11 +11167,10 @@
|
|
|
11107
11167
|
const languageObject = this.editorObject.config.get("language");
|
|
11108
11168
|
if (languageObject != null) {
|
|
11109
11169
|
if (typeof languageObject === "object") {
|
|
11110
|
-
|
|
11111
|
-
if (languageObject.hasOwnProperty("ui")) {
|
|
11170
|
+
if (Object.prototype.hasOwnProperty.call(languageObject, "ui")) {
|
|
11112
11171
|
return languageObject.ui;
|
|
11113
11172
|
}
|
|
11114
|
-
return
|
|
11173
|
+
return this.editorObject.locale.uiLanguage;
|
|
11115
11174
|
}
|
|
11116
11175
|
return languageObject;
|
|
11117
11176
|
}
|
|
@@ -11212,7 +11271,9 @@
|
|
|
11212
11271
|
// Remove selection
|
|
11213
11272
|
if (!viewSelection.isCollapsed) {
|
|
11214
11273
|
for (const range of viewSelection.getRanges()){
|
|
11215
|
-
|
|
11274
|
+
const modelRange = this.editorObject.editing.mapper.toModelRange(range);
|
|
11275
|
+
const modelSelection = this.editorObject.model.createSelection(modelRange);
|
|
11276
|
+
this.editorObject.model.deleteContent(modelSelection);
|
|
11216
11277
|
}
|
|
11217
11278
|
}
|
|
11218
11279
|
// Set carret after the formula
|
|
@@ -11228,7 +11289,7 @@
|
|
|
11228
11289
|
if (mathml) {
|
|
11229
11290
|
this.editorObject.model.insertObject(modelElementNew, position);
|
|
11230
11291
|
}
|
|
11231
|
-
|
|
11292
|
+
this.editorObject.model.deleteContent(this.editorObject.model.createSelection(modelElementOld, 'on'));
|
|
11232
11293
|
}
|
|
11233
11294
|
// eslint-disable-next-line consistent-return
|
|
11234
11295
|
return modelElementNew;
|
|
@@ -11299,7 +11360,8 @@
|
|
|
11299
11360
|
range = writer.createRange(startPosition, endPosition);
|
|
11300
11361
|
}
|
|
11301
11362
|
}
|
|
11302
|
-
|
|
11363
|
+
const modelSelection = this.editorObject.model.createSelection(range);
|
|
11364
|
+
this.editorObject.model.deleteContent(modelSelection);
|
|
11303
11365
|
writer.insertText(`$$${returnObject.latex}$$`, startNode.getAttributes(), startPosition);
|
|
11304
11366
|
});
|
|
11305
11367
|
} else {
|
|
@@ -11420,7 +11482,7 @@
|
|
|
11420
11482
|
|
|
11421
11483
|
var chemIcon = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->\n<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 40.3 49.5\" style=\"enable-background:new 0 0 40.3 49.5;\" xml:space=\"preserve\">\n<style type=\"text/css\">\n\t.st0{fill:#A4CF61;}\n</style>\n<path class=\"st0\" d=\"M39.2,12.1c0-1.9-1.1-3.6-2.7-4.4L24.5,0.9l0,0c-0.7-0.4-1.5-0.6-2.4-0.6c-0.9,0-1.7,0.2-2.4,0.6l0,0L2.3,10.8\n\tl0,0C0.9,11.7,0,13.2,0,14.9h0v19.6h0c0,1.7,0.9,3.3,2.3,4.1l0,0l17.4,9.9l0,0c0.7,0.4,1.5,0.6,2.4,0.6c0.9,0,1.7-0.2,2.4-0.6l0,0\n\tl12.2-6.9h0c1.5-0.8,2.6-2.5,2.6-4.3c0-2.7-2.2-4.9-4.9-4.9c-0.9,0-1.8,0.3-2.5,0.7l0,0l-9.7,5.6l-12.3-7V17.8l12.3-7l9.9,5.7l0,0\n\tc0.7,0.4,1.5,0.6,2.4,0.6C37,17,39.2,14.8,39.2,12.1\"/>\n</svg>\n";
|
|
11422
11484
|
|
|
11423
|
-
var version = "8.
|
|
11485
|
+
var version = "8.15.0";
|
|
11424
11486
|
var packageInfo = {
|
|
11425
11487
|
version: version};
|
|
11426
11488
|
|
|
@@ -11440,7 +11502,9 @@
|
|
|
11440
11502
|
const integration = this._addIntegration();
|
|
11441
11503
|
currentInstance = integration;
|
|
11442
11504
|
// Add the MathType and ChemType commands to the editor
|
|
11443
|
-
this._addCommands();
|
|
11505
|
+
this._addCommands(integration);
|
|
11506
|
+
// Add the track changes feature integration
|
|
11507
|
+
this._addTrackChangesIntegration(integration);
|
|
11444
11508
|
// Add the buttons for MathType and ChemType
|
|
11445
11509
|
this._addViews(integration);
|
|
11446
11510
|
// Registers the <mathml> element in the schema
|
|
@@ -11880,6 +11944,18 @@
|
|
|
11880
11944
|
Latex
|
|
11881
11945
|
};
|
|
11882
11946
|
}
|
|
11947
|
+
_addTrackChangesIntegration(integration) {
|
|
11948
|
+
const { editor } = this;
|
|
11949
|
+
if (editor.plugins.has("TrackChangesEditing")) {
|
|
11950
|
+
const trackChangesEditing = editor.plugins.get("TrackChangesEditing");
|
|
11951
|
+
// Makes MathType and ChemType buttons available when editor is in the track changes mode
|
|
11952
|
+
trackChangesEditing.enableCommand("MathType");
|
|
11953
|
+
trackChangesEditing.enableCommand("ChemType");
|
|
11954
|
+
// Adds custom label replacing the default 'mathml'.
|
|
11955
|
+
// Handles both singular and plural forms.
|
|
11956
|
+
trackChangesEditing.descriptionFactory.registerElementLabel("mathml", (quantity)=>(quantity > 1 ? quantity + ' ' : '') + StringManager.get(quantity > 1 ? "formulas" : "formula", integration.getLanguage()));
|
|
11957
|
+
}
|
|
11958
|
+
}
|
|
11883
11959
|
}
|
|
11884
11960
|
|
|
11885
11961
|
exports.CKEditor5Integration = CKEditor5Integration;
|