Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions packages/ckeditor5/dist/browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ButtonView } from 'ckeditor5';
import { ClickObserver, XmlDataProcessor, ViewUpcastWriter, HtmlDataProcessor } from 'ckeditor5';
import { Widget, viewToModelPositionOutsideModelElement, toWidget } from 'ckeditor5';

/*! @license DOMPurify 3.3.0 | (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.0/LICENSE */
/*! @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 */

const {
entries,
Expand Down Expand Up @@ -301,7 +301,7 @@ const _createHooksMap = function _createHooksMap() {
function createDOMPurify() {
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
const DOMPurify = root => createDOMPurify(root);
DOMPurify.version = '3.3.0';
DOMPurify.version = '3.3.1';
DOMPurify.removed = [];
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
// Not running in a browser, provide a factory function
Expand Down Expand Up @@ -647,6 +647,12 @@ function createDOMPurify() {
}
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
}
if (cfg.ADD_FORBID_CONTENTS) {
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
FORBID_CONTENTS = clone(FORBID_CONTENTS);
}
addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
}
/* Add #text in case KEEP_CONTENT is set to true */
if (KEEP_CONTENT) {
ALLOWED_TAGS['#text'] = true;
Expand Down Expand Up @@ -9740,6 +9746,7 @@ var warnIcon = "<svg width=\"16\" height=\"14\" viewBox=\"0 0 16 14\" fill=\"non
* Opens formula editor to editing an existing formula. Can be overwritten in order to make some
* actions from integration part before the formula is edited.
*/ openExistingFormulaEditor() {
WirisPlugin.currentInstance = this;
if (window.navigator.onLine) {
this.core.editionProperties.isNewElement = false;
this.core.openModalDialog(this.target, this.isIframe);
Expand Down Expand Up @@ -11201,6 +11208,8 @@ delete Array.prototype.__class__; // @codingStandardsIgnoreEnd
* @param {HTMLElement} element - HTMLElement target.
* @param {MouseEvent} event - event which trigger the handler.
*/ doubleClickHandler(element, event) {
// this.core.editionProperties.selection = this.editorObject.editing.view.document.selection;
// WirisPlugin.currentInstance = this;
this.core.editionProperties.dbclick = true;
if (this.editorObject.isReadOnly === false) {
if (element.nodeName.toLowerCase() === "img") {
Expand Down Expand Up @@ -11261,7 +11270,9 @@ delete Array.prototype.__class__; // @codingStandardsIgnoreEnd
// Remove selection
if (!viewSelection.isCollapsed) {
for (const range of viewSelection.getRanges()){
writer.remove(this.editorObject.editing.mapper.toModelRange(range));
const modelRange = this.editorObject.editing.mapper.toModelRange(range);
const modelSelection = this.editorObject.model.createSelection(modelRange);
this.editorObject.model.deleteContent(modelSelection);
}
}
// Set carret after the formula
Expand All @@ -11277,7 +11288,7 @@ delete Array.prototype.__class__; // @codingStandardsIgnoreEnd
if (mathml) {
this.editorObject.model.insertObject(modelElementNew, position);
}
writer.remove(modelElementOld);
this.editorObject.model.deleteContent(this.editorObject.model.createSelection(modelElementOld, 'on'));
}
// eslint-disable-next-line consistent-return
return modelElementNew;
Expand Down Expand Up @@ -11348,7 +11359,8 @@ delete Array.prototype.__class__; // @codingStandardsIgnoreEnd
range = writer.createRange(startPosition, endPosition);
}
}
writer.remove(range);
const modelSelection = this.editorObject.model.createSelection(range);
this.editorObject.model.deleteContent(modelSelection);
writer.insertText(`$$${returnObject.latex}$$`, startNode.getAttributes(), startPosition);
});
} else {
Expand Down Expand Up @@ -11469,7 +11481,7 @@ var mathIcon = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Generator: Adob

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";

var version = "8.13.4";
var version = "8.14.0";
var packageInfo = {
version: version};

Expand All @@ -11489,7 +11501,9 @@ class MathType extends Plugin {
const integration = this._addIntegration();
currentInstance = integration;
// Add the MathType and ChemType commands to the editor
this._addCommands();
this._addCommands(integration);
// Add the track changes feature integration
this._addTrackChangesIntegration(integration);
// Add the buttons for MathType and ChemType
this._addViews(integration);
// Registers the <mathml> element in the schema
Expand Down Expand Up @@ -11929,6 +11943,18 @@ class MathType extends Plugin {
Latex
};
}
_addTrackChangesIntegration(integration) {
const { editor } = this;
if (editor.plugins.has("TrackChangesEditing")) {
const trackChangesEditing = editor.plugins.get("TrackChangesEditing");
// Makes MathType and ChemType buttons available when editor is in the track changes mode
trackChangesEditing.enableCommand("MathType");
trackChangesEditing.enableCommand("ChemType");
// Adds custom label replacing the default 'mathml'.
// Handles both singular and plural forms.
trackChangesEditing.descriptionFactory.registerElementLabel("mathml", (quantity)=>(quantity > 1 ? quantity + ' ' : '') + StringManager.get(quantity > 1 ? "formulas" : "formula", integration.getLanguage()));
}
}
}

export { CKEditor5Integration, ChemTypeCommand, MathTypeCommand, MathType as default };
Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5/dist/browser/index.js.map

Large diffs are not rendered by default.

40 changes: 33 additions & 7 deletions packages/ckeditor5/dist/browser/index.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
})(this, (function (exports, ckeditor5) { 'use strict';

var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
/*! @license DOMPurify 3.3.0 | (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.0/LICENSE */
/*! @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 */

const {
entries,
Expand Down Expand Up @@ -303,7 +303,7 @@
function createDOMPurify() {
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
const DOMPurify = root => createDOMPurify(root);
DOMPurify.version = '3.3.0';
DOMPurify.version = '3.3.1';
DOMPurify.removed = [];
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
// Not running in a browser, provide a factory function
Expand Down Expand Up @@ -649,6 +649,12 @@
}
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
}
if (cfg.ADD_FORBID_CONTENTS) {
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
FORBID_CONTENTS = clone(FORBID_CONTENTS);
}
addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
}
/* Add #text in case KEEP_CONTENT is set to true */
if (KEEP_CONTENT) {
ALLOWED_TAGS['#text'] = true;
Expand Down Expand Up @@ -9742,6 +9748,7 @@
* Opens formula editor to editing an existing formula. Can be overwritten in order to make some
* actions from integration part before the formula is edited.
*/ openExistingFormulaEditor() {
WirisPlugin.currentInstance = this;
if (window.navigator.onLine) {
this.core.editionProperties.isNewElement = false;
this.core.openModalDialog(this.target, this.isIframe);
Expand Down Expand Up @@ -11203,6 +11210,8 @@
* @param {HTMLElement} element - HTMLElement target.
* @param {MouseEvent} event - event which trigger the handler.
*/ doubleClickHandler(element, event) {
// this.core.editionProperties.selection = this.editorObject.editing.view.document.selection;
// WirisPlugin.currentInstance = this;
this.core.editionProperties.dbclick = true;
if (this.editorObject.isReadOnly === false) {
if (element.nodeName.toLowerCase() === "img") {
Expand Down Expand Up @@ -11263,7 +11272,9 @@
// Remove selection
if (!viewSelection.isCollapsed) {
for (const range of viewSelection.getRanges()){
writer.remove(this.editorObject.editing.mapper.toModelRange(range));
const modelRange = this.editorObject.editing.mapper.toModelRange(range);
const modelSelection = this.editorObject.model.createSelection(modelRange);
this.editorObject.model.deleteContent(modelSelection);
}
}
// Set carret after the formula
Expand All @@ -11279,7 +11290,7 @@
if (mathml) {
this.editorObject.model.insertObject(modelElementNew, position);
}
writer.remove(modelElementOld);
this.editorObject.model.deleteContent(this.editorObject.model.createSelection(modelElementOld, 'on'));
}
// eslint-disable-next-line consistent-return
return modelElementNew;
Expand Down Expand Up @@ -11350,7 +11361,8 @@
range = writer.createRange(startPosition, endPosition);
}
}
writer.remove(range);
const modelSelection = this.editorObject.model.createSelection(range);
this.editorObject.model.deleteContent(modelSelection);
writer.insertText(`$$${returnObject.latex}$$`, startNode.getAttributes(), startPosition);
});
} else {
Expand Down Expand Up @@ -11471,7 +11483,7 @@

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";

var version = "8.13.4";
var version = "8.14.0";
var packageInfo = {
version: version};

Expand All @@ -11491,7 +11503,9 @@
const integration = this._addIntegration();
currentInstance = integration;
// Add the MathType and ChemType commands to the editor
this._addCommands();
this._addCommands(integration);
// Add the track changes feature integration
this._addTrackChangesIntegration(integration);
// Add the buttons for MathType and ChemType
this._addViews(integration);
// Registers the <mathml> element in the schema
Expand Down Expand Up @@ -11931,6 +11945,18 @@
Latex
};
}
_addTrackChangesIntegration(integration) {
const { editor } = this;
if (editor.plugins.has("TrackChangesEditing")) {
const trackChangesEditing = editor.plugins.get("TrackChangesEditing");
// Makes MathType and ChemType buttons available when editor is in the track changes mode
trackChangesEditing.enableCommand("MathType");
trackChangesEditing.enableCommand("ChemType");
// Adds custom label replacing the default 'mathml'.
// Handles both singular and plural forms.
trackChangesEditing.descriptionFactory.registerElementLabel("mathml", (quantity)=>(quantity > 1 ? quantity + ' ' : '') + StringManager.get(quantity > 1 ? "formulas" : "formula", integration.getLanguage()));
}
}
}

exports.CKEditor5Integration = CKEditor5Integration;
Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5/dist/browser/index.umd.js.map

Large diffs are not rendered by default.

29 changes: 24 additions & 5 deletions packages/ckeditor5/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/ckeditor5/dist/index.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions packages/devkit/src/integrationmodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,9 @@ export default class IntegrationModel {
* actions from integration part before the formula is edited.
*/
openExistingFormulaEditor() {
// Recover owner integration instance.
WirisPlugin.currentInstance = this;

if (window.navigator.onLine) {
this.core.editionProperties.isNewElement = false;
this.core.openModalDialog(this.target, this.isIframe);
Expand Down
Loading