@wiris/mathtype-ckeditor5 7.27.0 → 7.28.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/README.md +1 -1
- package/package.json +4 -5
- package/src/integration.js +1 -1
- package/src/plugin.js +13 -3
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ This npm module uses remotely hosted services to render MathML data. In case of
|
|
|
53
53
|
|
|
54
54
|
In order to display mathematical formulas on the target page, i.e. the page where content produced by the HTML editor will be visible, the target page needs to include the [MathType script](https://docs.wiris.com/en/mathtype/mathtype_web/integrations/mathml-mode#add_a_script_to_head). For example for the default setting this would be:
|
|
55
55
|
```html
|
|
56
|
-
<script src="https://wiris.net/demo/plugins/app/WIRISplugins.js?viewer=image"></script>
|
|
56
|
+
<script src="https://www.wiris.net/demo/plugins/app/WIRISplugins.js?viewer=image"></script>
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
## Documentation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wiris/mathtype-ckeditor5",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.28.0",
|
|
4
4
|
"description": "MathType Web for CKEditor5 editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chem",
|
|
@@ -32,15 +32,14 @@
|
|
|
32
32
|
],
|
|
33
33
|
"main": "src/plugin.js",
|
|
34
34
|
"scripts": {
|
|
35
|
-
"compile": "node ../../scripts/services/compile src/plugin.js ."
|
|
36
|
-
"test": "jest"
|
|
35
|
+
"compile": "node ../../scripts/services/compile src/plugin.js ."
|
|
37
36
|
},
|
|
38
37
|
"dependencies": {
|
|
39
38
|
"@ckeditor/ckeditor5-core": ">=23.0.0",
|
|
40
39
|
"@ckeditor/ckeditor5-engine": ">=23.0.0",
|
|
41
40
|
"@ckeditor/ckeditor5-ui": ">=23.0.0",
|
|
42
41
|
"@ckeditor/ckeditor5-widget": ">=23.0.0",
|
|
43
|
-
"@wiris/mathtype-html-integration-devkit": "1.
|
|
42
|
+
"@wiris/mathtype-html-integration-devkit": "1.7.0"
|
|
44
43
|
},
|
|
45
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "70e87055b311f5558100e551aa771aea9b5b527d"
|
|
46
45
|
}
|
package/src/integration.js
CHANGED
|
@@ -43,7 +43,7 @@ export default class CKEditor5Integration extends IntegrationModel {
|
|
|
43
43
|
// eslint-disable-next-line no-prototype-builtins
|
|
44
44
|
if (languageObject.hasOwnProperty('ui')) {
|
|
45
45
|
return languageObject.ui;
|
|
46
|
-
} return
|
|
46
|
+
} return languageObject;
|
|
47
47
|
}
|
|
48
48
|
return languageObject;
|
|
49
49
|
}
|
package/src/plugin.js
CHANGED
|
@@ -18,6 +18,7 @@ import Configuration from '@wiris/mathtype-html-integration-devkit/src/configura
|
|
|
18
18
|
import Listeners from '@wiris/mathtype-html-integration-devkit/src/listeners';
|
|
19
19
|
import MathML from '@wiris/mathtype-html-integration-devkit/src/mathml';
|
|
20
20
|
import Latex from '@wiris/mathtype-html-integration-devkit/src/latex';
|
|
21
|
+
import StringManager from '@wiris/mathtype-html-integration-devkit/src/stringmanager';
|
|
21
22
|
|
|
22
23
|
// Local imports
|
|
23
24
|
import { MathTypeCommand, ChemTypeCommand } from './commands';
|
|
@@ -58,6 +59,13 @@ export default class MathType extends Plugin {
|
|
|
58
59
|
this._exposeWiris();
|
|
59
60
|
}
|
|
60
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Inherited from Plugin class: Executed when CKEditor5 is destroyed
|
|
64
|
+
*/
|
|
65
|
+
destroy() { // eslint-disable-line class-methods-use-this
|
|
66
|
+
currentInstance.removeEvents();
|
|
67
|
+
}
|
|
68
|
+
|
|
61
69
|
/**
|
|
62
70
|
* Create the MathType API Integration object
|
|
63
71
|
* @returns {CKEditor5Integration} the integration object
|
|
@@ -133,7 +141,7 @@ export default class MathType extends Plugin {
|
|
|
133
141
|
view.bind('isEnabled').to(editor.commands.get('MathType'), 'isEnabled');
|
|
134
142
|
|
|
135
143
|
view.set({
|
|
136
|
-
label: '
|
|
144
|
+
label: StringManager.get('insert_math'),
|
|
137
145
|
icon: mathIcon,
|
|
138
146
|
tooltip: true,
|
|
139
147
|
});
|
|
@@ -156,7 +164,7 @@ export default class MathType extends Plugin {
|
|
|
156
164
|
view.bind('isEnabled').to(editor.commands.get('ChemType'), 'isEnabled');
|
|
157
165
|
|
|
158
166
|
view.set({
|
|
159
|
-
label: '
|
|
167
|
+
label: StringManager.get('insert_chem'),
|
|
160
168
|
icon: chemIcon,
|
|
161
169
|
tooltip: true,
|
|
162
170
|
});
|
|
@@ -326,7 +334,9 @@ export default class MathType extends Plugin {
|
|
|
326
334
|
/* Although we use the HtmlDataProcessor to obtain the attributes,
|
|
327
335
|
we must create a new EmptyElement which is independent of the
|
|
328
336
|
DataProcessor being used by this editor instance */
|
|
329
|
-
return viewWriter.createEmptyElement('img', imgElement.getAttributes()
|
|
337
|
+
return viewWriter.createEmptyElement('img', imgElement.getAttributes(), {
|
|
338
|
+
renderUnsafeAttributes: [ 'src' ]
|
|
339
|
+
} );
|
|
330
340
|
}
|
|
331
341
|
|
|
332
342
|
// Model -> Editing view
|