@syncfusion/ej2-richtexteditor 20.4.50 → 20.4.52
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 +30 -0
- package/GitLeaksReport.json +1 -0
- 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 +37 -29
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +35 -27
- 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/gitleaks-ci/gitleaks +0 -0
- package/gitleaks-ci.tar.gz +0 -0
- package/package.json +10 -10
- package/src/editor-manager/plugin/inserthtml.js +2 -2
- package/src/editor-manager/plugin/ms-word-clean-up.js +4 -1
- package/src/editor-manager/plugin/toolbar-status.js +6 -2
- package/src/rich-text-editor/actions/enter-key.js +10 -3
- package/src/rich-text-editor/actions/paste-clean-up.js +1 -1
- package/src/rich-text-editor/actions/xhtml-validation.d.ts +0 -1
- package/src/rich-text-editor/actions/xhtml-validation.js +0 -11
- package/src/rich-text-editor/base/rich-text-editor.js +6 -3
- package/src/rich-text-editor/renderer/table-module.js +6 -4
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.52
|
|
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
|
|
Binary file
|
|
Binary file
|
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.51",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-KrCoVlwCvqCiQPFS/bTRaCsH8WAyiBTtWkbBRRLLxCXtjyUKz8X3XIOcSmekQFzmMGcvwXHPwqTfKUMBQs+mAQ==",
|
|
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.51.tgz",
|
|
30
|
+
"_shasum": "5a1cdfcc714424ed059b501d2c0eaa46d0b2c172",
|
|
31
31
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
32
32
|
"_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
|
|
33
33
|
"author": {
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
},
|
|
39
39
|
"bundleDependencies": false,
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@syncfusion/ej2-base": "~20.4.
|
|
41
|
+
"@syncfusion/ej2-base": "~20.4.51",
|
|
42
42
|
"@syncfusion/ej2-buttons": "~20.4.50",
|
|
43
|
-
"@syncfusion/ej2-filemanager": "~20.4.
|
|
44
|
-
"@syncfusion/ej2-inputs": "~20.4.
|
|
45
|
-
"@syncfusion/ej2-navigations": "~20.4.
|
|
46
|
-
"@syncfusion/ej2-popups": "~20.4.
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~20.4.51",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~20.4.52",
|
|
45
|
+
"@syncfusion/ej2-navigations": "~20.4.52",
|
|
46
|
+
"@syncfusion/ej2-popups": "~20.4.52",
|
|
47
47
|
"@syncfusion/ej2-splitbuttons": "~20.4.50"
|
|
48
48
|
},
|
|
49
49
|
"deprecated": false,
|
|
@@ -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.52",
|
|
74
74
|
"sideEffects": false
|
|
75
75
|
}
|
|
@@ -41,8 +41,8 @@ var InsertHtml = /** @class */ (function () {
|
|
|
41
41
|
}
|
|
42
42
|
if (range.startContainer.nodeName === 'BR' && range.startOffset === 0 && range.startOffset === range.endOffset &&
|
|
43
43
|
range.startContainer === range.endContainer) {
|
|
44
|
-
var currentIndex = Array.prototype.slice.call(range.startContainer.parentElement.
|
|
45
|
-
nodeSelection.setSelectionText(docElement, range.startContainer.parentElement, range.startContainer.parentElement, currentIndex
|
|
44
|
+
var currentIndex = Array.prototype.slice.call(range.startContainer.parentElement.childNodes).indexOf(range.startContainer);
|
|
45
|
+
nodeSelection.setSelectionText(docElement, range.startContainer.parentElement, range.startContainer.parentElement, currentIndex, currentIndex);
|
|
46
46
|
range = nodeSelection.getRange(docElement);
|
|
47
47
|
}
|
|
48
48
|
var isCursor = range.startOffset === range.endOffset && range.startOffset === 0 &&
|
|
@@ -120,7 +120,10 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
120
120
|
this.checkVShape(elm);
|
|
121
121
|
var imgElem = elm.querySelectorAll('img');
|
|
122
122
|
for (var i = 0; i < imgElem.length; i++) {
|
|
123
|
-
if (!isNOU(imgElem[i].getAttribute('v:shapes')) &&
|
|
123
|
+
if (!isNOU(imgElem[i].getAttribute('v:shapes')) &&
|
|
124
|
+
imgElem[i].getAttribute('v:shapes').indexOf('Picture') < 0 &&
|
|
125
|
+
imgElem[i].getAttribute('v:shapes').indexOf('圖片') < 0 &&
|
|
126
|
+
imgElem[i].getAttribute('v:shapes').indexOf('Image') < 0) {
|
|
124
127
|
detach(imgElem[i]);
|
|
125
128
|
}
|
|
126
129
|
}
|
|
@@ -156,7 +156,7 @@ var ToolbarStatus = /** @class */ (function () {
|
|
|
156
156
|
formatCollection.fontname = this.isFontName(docElement, node, fontName);
|
|
157
157
|
}
|
|
158
158
|
if (!formatCollection.fontsize) {
|
|
159
|
-
formatCollection.fontsize = this.isFontSize(node, fontSize);
|
|
159
|
+
formatCollection.fontsize = this.isFontSize(docElement, node, fontSize);
|
|
160
160
|
}
|
|
161
161
|
if (!formatCollection.backgroundcolor) {
|
|
162
162
|
formatCollection.backgroundcolor = this.isBackgroundColor(node);
|
|
@@ -216,8 +216,12 @@ var ToolbarStatus = /** @class */ (function () {
|
|
|
216
216
|
return null;
|
|
217
217
|
}
|
|
218
218
|
};
|
|
219
|
-
ToolbarStatus.isFontSize = function (node, fontSize) {
|
|
219
|
+
ToolbarStatus.isFontSize = function (docElement, node, fontSize) {
|
|
220
220
|
var size = node.style && node.style.fontSize;
|
|
221
|
+
if ((size === null || size === undefined || size === '') && node.nodeType !== 3 &&
|
|
222
|
+
node.parentElement.classList.contains('e-content')) {
|
|
223
|
+
size = this.getComputedStyle(docElement, node, 'font-size');
|
|
224
|
+
}
|
|
221
225
|
if ((size !== null && size !== '' && size !== undefined)
|
|
222
226
|
&& (fontSize === null || fontSize === undefined || (fontSize.indexOf(size) > -1))) {
|
|
223
227
|
return size;
|
|
@@ -47,7 +47,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
47
47
|
isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
|
|
48
48
|
}
|
|
49
49
|
if (e.args.which === 13 && e.args.code === 'Enter') {
|
|
50
|
-
if (isNOU(this.startNode.closest('LI')) && isNOU(this.endNode.closest('LI')) && isTableEnter &&
|
|
50
|
+
if (isNOU(this.startNode.closest('LI,UL,OL')) && isNOU(this.endNode.closest('LI,UL,OL')) && isTableEnter &&
|
|
51
51
|
isNOU(this.startNode.closest('PRE')) && isNOU(this.endNode.closest('PRE'))) {
|
|
52
52
|
var shiftKey_1 = e.args.shiftKey;
|
|
53
53
|
var actionBeginArgs = {
|
|
@@ -340,7 +340,8 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
340
340
|
_this.removeBRElement(currentParent);
|
|
341
341
|
var isEmptyBrInserted = false;
|
|
342
342
|
var currentParentLastChild = currentParent.lastChild;
|
|
343
|
-
while (!isNOU(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text' || currentParentLastChild.nodeName === 'BR'
|
|
343
|
+
while (!isNOU(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text' || currentParentLastChild.nodeName === 'BR'
|
|
344
|
+
|| currentParentLastChild.nodeName === 'IMG')) {
|
|
344
345
|
currentParentLastChild = currentParentLastChild.lastChild;
|
|
345
346
|
}
|
|
346
347
|
var isLastNodeLength = _this.range.startContainer === currentParentLastChild ?
|
|
@@ -348,7 +349,8 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
348
349
|
if (currentParent !== _this.parent.inputElement &&
|
|
349
350
|
_this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
|
|
350
351
|
_this.range.startOffset === _this.range.endOffset &&
|
|
351
|
-
_this.range.startOffset === isLastNodeLength
|
|
352
|
+
(_this.range.startOffset === isLastNodeLength ||
|
|
353
|
+
(currentParent.textContent.trim().length === 0 && currentParent.lastChild.nodeName === 'IMG'))) {
|
|
352
354
|
var focusBRElem = _this.parent.createElement('br');
|
|
353
355
|
if (_this.range.startOffset === 0 && _this.range.startContainer.nodeName === 'TABLE') {
|
|
354
356
|
_this.range.startContainer.parentElement.insertBefore(focusBRElem, _this.range.startContainer);
|
|
@@ -357,6 +359,11 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
357
359
|
if (currentParentLastChild.nodeName === 'BR' && currentParent.textContent.length === 0) {
|
|
358
360
|
_this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, currentParentLastChild);
|
|
359
361
|
}
|
|
362
|
+
else if (_this.range.startOffset === 0 && _this.range.endOffset === 0 &&
|
|
363
|
+
currentParent.lastChild && currentParent.lastChild.nodeName === 'IMG') {
|
|
364
|
+
currentParentLastChild.parentElement.insertBefore(focusBRElem, currentParentLastChild);
|
|
365
|
+
focusBRElem = currentParentLastChild;
|
|
366
|
+
}
|
|
360
367
|
else {
|
|
361
368
|
var lineBreakBRElem = _this.parent.createElement('br');
|
|
362
369
|
_this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, _this.range.startContainer);
|
|
@@ -552,7 +552,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
552
552
|
this.radioRender();
|
|
553
553
|
/* eslint-disable */
|
|
554
554
|
if (this.parent.element.offsetHeight < parseInt(this.dialogObj.height.split('px')[0], null)) {
|
|
555
|
-
this.parent.height
|
|
555
|
+
this.parent.setProperties({ height: parseInt(this.dialogObj.height.split('px')[0], null) + 40 });
|
|
556
556
|
/* eslint-enable */
|
|
557
557
|
isHeight = true;
|
|
558
558
|
}
|
|
@@ -25,7 +25,6 @@ var XhtmlValidation = /** @class */ (function () {
|
|
|
25
25
|
this.currentElement = this.parent.inputElement;
|
|
26
26
|
}
|
|
27
27
|
this.clean(this.currentElement);
|
|
28
|
-
this.AddRootElement();
|
|
29
28
|
this.ImageTags();
|
|
30
29
|
this.removeTags();
|
|
31
30
|
this.RemoveUnsupported();
|
|
@@ -72,16 +71,6 @@ var XhtmlValidation = /** @class */ (function () {
|
|
|
72
71
|
}
|
|
73
72
|
return currentValue;
|
|
74
73
|
};
|
|
75
|
-
XhtmlValidation.prototype.AddRootElement = function () {
|
|
76
|
-
if ((this.currentElement.childNodes.length === 1 && this.currentElement.firstChild.nodeName !== 'DIV') ||
|
|
77
|
-
this.currentElement.childNodes.length > 1) {
|
|
78
|
-
var parentEle = this.parent.createElement('div');
|
|
79
|
-
while (this.currentElement.childNodes.length > 0) {
|
|
80
|
-
parentEle.appendChild(this.currentElement.childNodes[0]);
|
|
81
|
-
}
|
|
82
|
-
this.currentElement.appendChild(parentEle);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
74
|
XhtmlValidation.prototype.clean = function (node) {
|
|
86
75
|
for (var n = 0; n < node.childNodes.length; n++) {
|
|
87
76
|
var child = node.childNodes[n];
|
|
@@ -784,6 +784,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
784
784
|
}
|
|
785
785
|
else {
|
|
786
786
|
value = this.htmlEditorModule.sanitizeHelper(value);
|
|
787
|
+
value = this.enableXhtml ? this.htmlEditorModule.xhtmlValidation.selfEncloseValidation(value) : value;
|
|
787
788
|
}
|
|
788
789
|
}
|
|
789
790
|
return value;
|
|
@@ -2003,7 +2004,9 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2003
2004
|
this.notify(events.windowResize, null);
|
|
2004
2005
|
};
|
|
2005
2006
|
RichTextEditor.prototype.scrollHandler = function (e) {
|
|
2006
|
-
this.
|
|
2007
|
+
if (this.element) {
|
|
2008
|
+
this.notify(events.scroll, { args: e });
|
|
2009
|
+
}
|
|
2007
2010
|
};
|
|
2008
2011
|
RichTextEditor.prototype.contentScrollHandler = function (e) {
|
|
2009
2012
|
this.notify(events.contentscroll, { args: e });
|
|
@@ -2064,8 +2067,8 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2064
2067
|
}
|
|
2065
2068
|
var getTextArea = this.element.querySelector('.e-rte-srctextarea');
|
|
2066
2069
|
if (this.editorMode === 'HTML') {
|
|
2067
|
-
value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>'
|
|
2068
|
-
this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
|
|
2070
|
+
value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>'
|
|
2071
|
+
|| this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
|
|
2069
2072
|
this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
|
|
2070
2073
|
if (getTextArea && getTextArea.style.display === 'block') {
|
|
2071
2074
|
value = getTextArea.value;
|
|
@@ -916,12 +916,14 @@ var Table = /** @class */ (function () {
|
|
|
916
916
|
if ((totalwid - actualwid) > 20 && actualwid > 20) {
|
|
917
917
|
var leftColumnWidth = totalwid - actualwid;
|
|
918
918
|
var rightColWidth = actualwid;
|
|
919
|
-
|
|
920
|
-
_this.curTable.rows[i].cells[
|
|
919
|
+
var index = _this.curTable.rows[i].cells[i].hasAttribute('colspan') ?
|
|
920
|
+
parseInt(_this.curTable.rows[i].cells[i].getAttribute('colspan'), 10) - 1 : _this.colIndex;
|
|
921
|
+
if (!isNOU(_this.curTable.rows[i].cells[index - 1])) {
|
|
922
|
+
_this.curTable.rows[i].cells[index - 1].style.width =
|
|
921
923
|
_this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
|
|
922
924
|
}
|
|
923
|
-
if (!isNOU(_this.curTable.rows[i].cells[
|
|
924
|
-
_this.curTable.rows[i].cells[
|
|
925
|
+
if (!isNOU(_this.curTable.rows[i].cells[index])) {
|
|
926
|
+
_this.curTable.rows[i].cells[index].style.width =
|
|
925
927
|
_this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
|
|
926
928
|
}
|
|
927
929
|
}
|