@syncfusion/ej2-richtexteditor 20.4.40 → 20.4.43
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/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/dist/ej2-richtexteditor.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +61 -43
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +61 -43
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/editor-manager/plugin/inserthtml.js +48 -38
- package/src/editor-manager/plugin/toolbar-status.js +3 -2
- package/src/rich-text-editor/actions/html-editor.js +4 -2
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +2 -2
- package/src/rich-text-editor/base/rich-text-editor.d.ts +2 -2
- package/src/rich-text-editor/renderer/image-module.js +4 -0
- package/src/rich-text-editor/renderer/table-module.js +2 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 20.4.
|
|
3
|
+
* version : 20.4.43
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-richtexteditor@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-richtexteditor@20.4.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@20.4.42",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-6Q5JaOeGQcmOpqZLxpR9o6ogvnsJeAW3sJdpshqeRUAKt4w7yd/ly3Ny0qolUjjplp00hESAS1Kh3l6BbK98jw==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-richtexteditor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"/@syncfusion/ej2-react-richtexteditor",
|
|
27
27
|
"/@syncfusion/ej2-vue-richtexteditor"
|
|
28
28
|
],
|
|
29
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.4.
|
|
30
|
-
"_shasum": "
|
|
29
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.4.42.tgz",
|
|
30
|
+
"_shasum": "67c24a82816a8ebbedfafbb18e734dfbffc17144",
|
|
31
31
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
32
32
|
"_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
|
|
33
33
|
"author": {
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
},
|
|
39
39
|
"bundleDependencies": false,
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@syncfusion/ej2-base": "~20.4.
|
|
42
|
-
"@syncfusion/ej2-buttons": "~20.4.
|
|
43
|
-
"@syncfusion/ej2-filemanager": "~20.4.
|
|
44
|
-
"@syncfusion/ej2-inputs": "~20.4.
|
|
45
|
-
"@syncfusion/ej2-navigations": "~20.4.
|
|
46
|
-
"@syncfusion/ej2-popups": "~20.4.
|
|
47
|
-
"@syncfusion/ej2-splitbuttons": "~20.4.
|
|
41
|
+
"@syncfusion/ej2-base": "~20.4.42",
|
|
42
|
+
"@syncfusion/ej2-buttons": "~20.4.42",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~20.4.43",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~20.4.42",
|
|
45
|
+
"@syncfusion/ej2-navigations": "~20.4.43",
|
|
46
|
+
"@syncfusion/ej2-popups": "~20.4.43",
|
|
47
|
+
"@syncfusion/ej2-splitbuttons": "~20.4.42"
|
|
48
48
|
},
|
|
49
49
|
"deprecated": false,
|
|
50
50
|
"description": "Essential JS 2 RichTextEditor component",
|
|
@@ -70,6 +70,6 @@
|
|
|
70
70
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
71
71
|
},
|
|
72
72
|
"typings": "index.d.ts",
|
|
73
|
-
"version": "20.4.
|
|
73
|
+
"version": "20.4.43",
|
|
74
74
|
"sideEffects": false
|
|
75
75
|
}
|
|
@@ -247,52 +247,62 @@ var InsertHtml = /** @class */ (function () {
|
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
else {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
250
|
+
var parentElem = range.startContainer;
|
|
251
|
+
while (!isNOU(parentElem) && parentElem.nodeName !== 'PRE' && parentElem !== editNode) {
|
|
252
|
+
parentElem = parentElem.parentElement;
|
|
253
|
+
}
|
|
254
|
+
if (!isNOU(node) && !isNOU(parentElem) && parentElem.nodeName === 'PRE') {
|
|
255
|
+
range.insertNode(node);
|
|
256
|
+
lastSelectionNode = node.lastChild;
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
this.insertTempNode(range, node, nodes, nodeCutter, editNode);
|
|
260
|
+
var isFirstTextNode = true;
|
|
261
|
+
var isPreviousInlineElem = void 0;
|
|
262
|
+
var paraElm = void 0;
|
|
263
|
+
var previousParent = void 0;
|
|
264
|
+
if (!this.contentsDeleted) {
|
|
265
|
+
range.deleteContents();
|
|
262
266
|
}
|
|
263
|
-
|
|
264
|
-
(
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
var firstParaElm = createElement('p');
|
|
268
|
-
node.parentElement.insertBefore(firstParaElm, node);
|
|
267
|
+
while (node.firstChild) {
|
|
268
|
+
if (node.firstChild.nodeName === '#text' && node.firstChild.textContent.trim() === '') {
|
|
269
|
+
detach(node.firstChild);
|
|
270
|
+
continue;
|
|
269
271
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
if (!isPreviousInlineElem) {
|
|
277
|
-
paraElm = createElement('p');
|
|
278
|
-
paraElm.appendChild(node.firstChild);
|
|
279
|
-
fragment.appendChild(paraElm);
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
previousParent.appendChild(node.firstChild);
|
|
283
|
-
fragment.appendChild(previousParent);
|
|
272
|
+
if (node.firstChild.nodeName === '#text' && isFirstTextNode ||
|
|
273
|
+
(this.inlineNode.indexOf(node.firstChild.nodeName.toLocaleLowerCase()) >= 0 && isFirstTextNode)) {
|
|
274
|
+
lastSelectionNode = node.firstChild;
|
|
275
|
+
if (isNOU(node.previousElementSibling)) {
|
|
276
|
+
var firstParaElm = createElement('p');
|
|
277
|
+
node.parentElement.insertBefore(firstParaElm, node);
|
|
284
278
|
}
|
|
285
|
-
|
|
286
|
-
isPreviousInlineElem = true;
|
|
279
|
+
node.previousElementSibling.appendChild(node.firstChild);
|
|
287
280
|
}
|
|
288
281
|
else {
|
|
289
|
-
|
|
290
|
-
|
|
282
|
+
lastSelectionNode = node.firstChild;
|
|
283
|
+
if (node.firstChild.nodeName === '#text' ||
|
|
284
|
+
(this.inlineNode.indexOf(node.firstChild.nodeName.toLocaleLowerCase()) >= 0)) {
|
|
285
|
+
if (!isPreviousInlineElem) {
|
|
286
|
+
paraElm = createElement('p');
|
|
287
|
+
paraElm.appendChild(node.firstChild);
|
|
288
|
+
fragment.appendChild(paraElm);
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
previousParent.appendChild(node.firstChild);
|
|
292
|
+
fragment.appendChild(previousParent);
|
|
293
|
+
}
|
|
294
|
+
previousParent = paraElm;
|
|
295
|
+
isPreviousInlineElem = true;
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
fragment.appendChild(node.firstChild);
|
|
299
|
+
isPreviousInlineElem = false;
|
|
300
|
+
}
|
|
301
|
+
isFirstTextNode = false;
|
|
291
302
|
}
|
|
292
|
-
isFirstTextNode = false;
|
|
293
303
|
}
|
|
304
|
+
node.parentNode.replaceChild(fragment, node);
|
|
294
305
|
}
|
|
295
|
-
node.parentNode.replaceChild(fragment, node);
|
|
296
306
|
}
|
|
297
307
|
if (lastSelectionNode.nodeName === '#text') {
|
|
298
308
|
this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
@@ -29,10 +29,11 @@ var ToolbarStatus = /** @class */ (function () {
|
|
|
29
29
|
var formatCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
30
30
|
var nodeCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
31
31
|
var nodeSelection = new NodeSelection();
|
|
32
|
-
var
|
|
32
|
+
var range = nodeSelection.getRange(docElement);
|
|
33
|
+
var nodes = documentNode ? [documentNode] : range.collapsed ? nodeSelection.getNodeCollection(range) :
|
|
34
|
+
nodeSelection.getSelectionNodeCollectionBr(range);
|
|
33
35
|
var nodesLength = nodes.length;
|
|
34
36
|
var isNodeChanged = false;
|
|
35
|
-
var range = nodeSelection.getRange(docElement);
|
|
36
37
|
for (var index = 0; index < nodes.length; index++) {
|
|
37
38
|
while (nodes[index].nodeType === 3 && range.startContainer.nodeType === 3 && nodes[index].parentNode &&
|
|
38
39
|
nodes[index].parentNode.lastElementChild && nodes[index].parentNode.lastElementChild.nodeName !== 'BR' &&
|
|
@@ -109,10 +109,12 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
109
109
|
// eslint-disable-next-line
|
|
110
110
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
111
111
|
var pointer;
|
|
112
|
+
var isRootParent = false;
|
|
112
113
|
if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey) {
|
|
113
114
|
pointer = range.startOffset;
|
|
114
115
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
115
|
-
range.startContainer.nodeName === '#text' ? range.startContainer.parentElement.
|
|
116
|
+
range.startContainer.nodeName === '#text' ? range.startContainer.parentElement !== this.parent.inputElement ? range.startContainer.parentElement.classList.add('currentStartMark')
|
|
117
|
+
: isRootParent = true : range.startContainer.classList.add('currentStartMark');
|
|
116
118
|
if (range.startContainer.textContent.charCodeAt(0) === 8203) {
|
|
117
119
|
pointer = range.startOffset === 0 ? range.startOffset : range.startOffset - 1;
|
|
118
120
|
range.startContainer.textContent = range.startContainer.textContent.replace(regEx, '');
|
|
@@ -121,7 +123,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
121
123
|
var previousLength = this.parent.inputElement.innerHTML.length;
|
|
122
124
|
var currentLength = this.parent.inputElement.innerHTML.replace(regEx, '').length;
|
|
123
125
|
var focusNode = range.startContainer;
|
|
124
|
-
if (previousLength > currentLength) {
|
|
126
|
+
if (previousLength > currentLength && !isRootParent) {
|
|
125
127
|
var currentChild = this.parent.inputElement.firstChild;
|
|
126
128
|
while (!isNOU(currentChild) && currentChild.textContent.replace(regEx, '').trim().length > 0) {
|
|
127
129
|
currentChild.innerHTML = currentChild.innerHTML.replace(regEx, '');
|
|
@@ -97,8 +97,8 @@ export interface RichTextEditorModel extends ComponentModel{
|
|
|
97
97
|
* * enable - Set Boolean value to enable, the editors content is placed in an iframe and isolated from the rest of the page.
|
|
98
98
|
* * attributes - Custom style to be used inside the iframe to display content. This style is added to the iframe body.
|
|
99
99
|
* * resources - we can add both styles and scripts to the iframe.
|
|
100
|
-
* 1. styles[] - An array of CSS style files to inject inside the iframe to display content
|
|
101
|
-
* 2. scripts[] - An array of JS script files to inject inside the iframe
|
|
100
|
+
* 1. styles[] - An array of CSS style files to inject inside the iframe to display content.
|
|
101
|
+
* 2. scripts[] - An array of JS script files to inject inside the iframe.
|
|
102
102
|
*
|
|
103
103
|
* {% codeBlock src='rich-text-editor/iframe-settings/index.md' %}{% endcodeBlock %}
|
|
104
104
|
*
|
|
@@ -267,8 +267,8 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
267
267
|
* * enable - Set Boolean value to enable, the editors content is placed in an iframe and isolated from the rest of the page.
|
|
268
268
|
* * attributes - Custom style to be used inside the iframe to display content. This style is added to the iframe body.
|
|
269
269
|
* * resources - we can add both styles and scripts to the iframe.
|
|
270
|
-
* 1. styles[] - An array of CSS style files to inject inside the iframe to display content
|
|
271
|
-
* 2. scripts[] - An array of JS script files to inject inside the iframe
|
|
270
|
+
* 1. styles[] - An array of CSS style files to inject inside the iframe to display content.
|
|
271
|
+
* 2. scripts[] - An array of JS script files to inject inside the iframe.
|
|
272
272
|
*
|
|
273
273
|
* {% codeBlock src='rich-text-editor/iframe-settings/index.md' %}{% endcodeBlock %}
|
|
274
274
|
*
|
|
@@ -456,6 +456,10 @@ var Image = /** @class */ (function () {
|
|
|
456
456
|
});
|
|
457
457
|
};
|
|
458
458
|
Image.prototype.resizing = function (e) {
|
|
459
|
+
if (!this.parent) {
|
|
460
|
+
this.cancelResizeAction();
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
459
463
|
if (this.imgEle.offsetWidth >= this.parent.getInsertImgMaxWidth()) {
|
|
460
464
|
this.imgEle.style.maxHeight = this.imgEle.offsetHeight + 'px';
|
|
461
465
|
}
|
|
@@ -465,9 +465,10 @@ var Table = /** @class */ (function () {
|
|
|
465
465
|
var range_1 = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
|
|
466
466
|
this.parent.formatter.editorManager.nodeSelection.save(range_1, this.contentModule.getDocument());
|
|
467
467
|
this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
|
|
468
|
+
var pageX = (this.parent.iframeSettings.enable) ? window.pageXOffset + this.parent.element.getBoundingClientRect().left + args.clientX : args.pageX;
|
|
468
469
|
var pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
|
|
469
470
|
this.parent.element.getBoundingClientRect().top + args.clientY : args.pageY;
|
|
470
|
-
this.quickToolObj.tableQTBar.showPopup(
|
|
471
|
+
this.quickToolObj.tableQTBar.showPopup(pageX, pageY, target);
|
|
471
472
|
this.parent.formatter.editorManager.nodeSelection.restore();
|
|
472
473
|
}
|
|
473
474
|
else {
|