@syncfusion/ej2-richtexteditor 20.1.50 → 20.1.55
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 +38 -0
- 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 +26 -17
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +28 -19
- 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/insert-text.js +1 -1
- package/src/editor-manager/plugin/inserthtml.js +2 -1
- package/src/editor-manager/plugin/nodecutter.js +2 -2
- package/src/editor-manager/plugin/selection-commands.js +8 -2
- package/src/editor-manager/plugin/table.js +2 -2
- package/src/rich-text-editor/actions/enter-key.js +3 -2
- package/src/rich-text-editor/actions/toolbar.js +1 -1
- package/src/rich-text-editor/base/rich-text-editor.js +6 -2
- package/src/rich-text-editor/renderer/image-module.js +1 -5
- 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.1.
|
|
3
|
+
* version : 20.1.55
|
|
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.1.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@20.1.52",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-nOAMnG7anB1iGGM7QEUNtVJWJZsgXvSJgbgRJSAsy/vcqq1wlR5zJCUTEfffxQLTwKOvU+N0dGrIx7egVFSmWg==",
|
|
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": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.1.
|
|
30
|
-
"_shasum": "
|
|
29
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.1.52.tgz",
|
|
30
|
+
"_shasum": "7c14ec83053987edf6e41f7968ad52aab5812e9f",
|
|
31
31
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
32
32
|
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
|
|
33
33
|
"author": {
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
},
|
|
39
39
|
"bundleDependencies": false,
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@syncfusion/ej2-base": "~20.1.
|
|
42
|
-
"@syncfusion/ej2-buttons": "~20.1.
|
|
43
|
-
"@syncfusion/ej2-filemanager": "~20.1.
|
|
44
|
-
"@syncfusion/ej2-inputs": "~20.1.
|
|
45
|
-
"@syncfusion/ej2-navigations": "~20.1.
|
|
46
|
-
"@syncfusion/ej2-popups": "~20.1.
|
|
47
|
-
"@syncfusion/ej2-splitbuttons": "~20.1.
|
|
41
|
+
"@syncfusion/ej2-base": "~20.1.55",
|
|
42
|
+
"@syncfusion/ej2-buttons": "~20.1.55",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~20.1.55",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~20.1.55",
|
|
45
|
+
"@syncfusion/ej2-navigations": "~20.1.55",
|
|
46
|
+
"@syncfusion/ej2-popups": "~20.1.55",
|
|
47
|
+
"@syncfusion/ej2-splitbuttons": "~20.1.55"
|
|
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.1.
|
|
73
|
+
"version": "20.1.55",
|
|
74
74
|
"sideEffects": false
|
|
75
75
|
}
|
|
@@ -23,7 +23,7 @@ var InsertTextExec = /** @class */ (function () {
|
|
|
23
23
|
};
|
|
24
24
|
InsertTextExec.prototype.insertText = function (e) {
|
|
25
25
|
var node = document.createTextNode(e.value);
|
|
26
|
-
InsertHtml.Insert(this.parent.currentDocument, node);
|
|
26
|
+
InsertHtml.Insert(this.parent.currentDocument, node, this.parent.editableElement);
|
|
27
27
|
if (e.callBack) {
|
|
28
28
|
e.callBack({
|
|
29
29
|
requestType: e.subCommand,
|
|
@@ -377,7 +377,8 @@ var InsertHtml = /** @class */ (function () {
|
|
|
377
377
|
tempSpan.parentNode.replaceChild(node, tempSpan);
|
|
378
378
|
}
|
|
379
379
|
else {
|
|
380
|
-
var
|
|
380
|
+
var nodeSelection = new NodeSelection();
|
|
381
|
+
var currentNode = this.getNodeCollection(range, nodeSelection, node)[this.getNodeCollection(range, nodeSelection, node).length - 1];
|
|
381
382
|
var splitedElm = void 0;
|
|
382
383
|
if ((currentNode.nodeName === 'BR' || currentNode.nodeName === 'HR') && !isNOU(currentNode.parentElement) &&
|
|
383
384
|
currentNode.parentElement.textContent.trim().length === 0) {
|
|
@@ -71,7 +71,7 @@ var NodeCutter = /** @class */ (function () {
|
|
|
71
71
|
fragment = this.spliceEmptyNode(fragment, true);
|
|
72
72
|
if (fragment && fragment.childNodes.length > 0) {
|
|
73
73
|
var isEmpty = (fragment.childNodes.length === 1 && fragment.childNodes[0].nodeName !== 'IMG'
|
|
74
|
-
&& this.isImgElm(fragment) && fragment.textContent
|
|
74
|
+
&& this.isImgElm(fragment) && fragment.textContent === '') ? true : false;
|
|
75
75
|
if (!isEmpty) {
|
|
76
76
|
if (node) {
|
|
77
77
|
InsertMethods.AppendBefore(fragment, node, true);
|
|
@@ -122,7 +122,7 @@ var NodeCutter = /** @class */ (function () {
|
|
|
122
122
|
else if (len > -1) {
|
|
123
123
|
this.spliceEmptyNode(fragment.childNodes[0], isStart);
|
|
124
124
|
}
|
|
125
|
-
else if (fragment.nodeType !== 3 && fragment.nodeType !== 11) {
|
|
125
|
+
else if (fragment.nodeType !== 3 && fragment.nodeType !== 11 && fragment.nodeName !== 'IMG') {
|
|
126
126
|
fragment.parentNode.removeChild(fragment);
|
|
127
127
|
}
|
|
128
128
|
return fragment;
|
|
@@ -46,12 +46,18 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
46
46
|
var preventRestore = false;
|
|
47
47
|
var isFontStyle = (['fontcolor', 'fontname', 'fontsize', 'backgroundcolor'].indexOf(format) > -1);
|
|
48
48
|
if (range.collapsed) {
|
|
49
|
+
var currentFormatNode = isFormatted.getFormattedNode(range.startContainer, format, endNode);
|
|
50
|
+
var currentSelector = !isNOU(currentFormatNode) ?
|
|
51
|
+
(currentFormatNode.getAttribute('style') === null ? currentFormatNode.nodeName :
|
|
52
|
+
currentFormatNode.nodeName + "[style='" + currentFormatNode.getAttribute('style') + "']") : null;
|
|
49
53
|
if (nodes.length > 0) {
|
|
50
54
|
isCollapsed = true;
|
|
51
55
|
range = nodeCutter.GetCursorRange(docElement, range, nodes[0]);
|
|
52
56
|
}
|
|
53
|
-
else if (range.startContainer.nodeType === 3 && range.startContainer.parentElement.childElementCount > 0 &&
|
|
54
|
-
range.startOffset > 0 && range.startContainer.parentElement.firstElementChild.tagName.toLowerCase() !== 'br')
|
|
57
|
+
else if (range.startContainer.nodeType === 3 && ((range.startContainer.parentElement.childElementCount > 0 &&
|
|
58
|
+
range.startOffset > 0 && range.startContainer.parentElement.firstElementChild.tagName.toLowerCase() !== 'br') ||
|
|
59
|
+
!isNOU(currentFormatNode) && currentFormatNode === (range.startContainer.parentElement.closest(currentSelector)) &&
|
|
60
|
+
((range.startContainer.parentElement.closest(currentSelector)).textContent.replace(new RegExp(String.fromCharCode(8203), 'g'), '').trim().length != 0))) {
|
|
55
61
|
isCollapsed = true;
|
|
56
62
|
range = nodeCutter.GetCursorRange(docElement, range, range.startContainer);
|
|
57
63
|
nodes.push(range.startContainer);
|
|
@@ -109,11 +109,11 @@ var TableCommand = /** @class */ (function () {
|
|
|
109
109
|
for (var i = 0; i < emptyUl.length; i++) {
|
|
110
110
|
detach(emptyUl[i]);
|
|
111
111
|
}
|
|
112
|
-
var emptyLiChild = this.parent.editableElement.querySelectorAll('li *:empty');
|
|
112
|
+
var emptyLiChild = this.parent.editableElement.querySelectorAll('li *:empty:not(img)');
|
|
113
113
|
for (var i = 0; i < emptyLiChild.length; i++) {
|
|
114
114
|
detach(emptyLiChild[i]);
|
|
115
115
|
if (emptyLiChild.length === i + 1) {
|
|
116
|
-
emptyLiChild = this.parent.editableElement.querySelectorAll('li *:empty');
|
|
116
|
+
emptyLiChild = this.parent.editableElement.querySelectorAll('li *:empty:not(img)');
|
|
117
117
|
i = -1;
|
|
118
118
|
}
|
|
119
119
|
}
|
|
@@ -292,8 +292,9 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
292
292
|
};
|
|
293
293
|
EnterKeyAction.prototype.removeBRElement = function (currentElement) {
|
|
294
294
|
if (Browser.userAgent.indexOf('Firefox') != -1 &&
|
|
295
|
-
this.range.endOffset === currentElement.textContent.length &&
|
|
296
|
-
currentElement.
|
|
295
|
+
this.range.endOffset === currentElement.textContent.length && (currentElement.textContent.length !== 0 ||
|
|
296
|
+
currentElement.querySelectorAll('BR').length > 1) &&
|
|
297
|
+
!isNOU(currentElement.lastChild) && currentElement.lastChild.nodeName === 'BR') {
|
|
297
298
|
detach(currentElement.lastChild);
|
|
298
299
|
}
|
|
299
300
|
};
|
|
@@ -195,7 +195,7 @@ var Toolbar = /** @class */ (function () {
|
|
|
195
195
|
if ((parent_1.bottom < (floatOffset + tbHeight + topValue)) || parent_1.bottom < 0 || parent_1.top > floatOffset + topValue) {
|
|
196
196
|
isFloat = false;
|
|
197
197
|
}
|
|
198
|
-
else if (parent_1.top < floatOffset) {
|
|
198
|
+
else if (parent_1.top < floatOffset || parent_1.top < floatOffset + topValue) {
|
|
199
199
|
isFloat = true;
|
|
200
200
|
}
|
|
201
201
|
}
|
|
@@ -728,6 +728,10 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
728
728
|
? 0 : e.clipboardData.getData('text/plain').length;
|
|
729
729
|
var totalLength = (currentLength - selectionLength) + pastedContentLength;
|
|
730
730
|
if (_this.editorMode === 'Markdown') {
|
|
731
|
+
var args_1 = { requestType: 'Paste', editorMode: _this.editorMode, event: e };
|
|
732
|
+
setTimeout(function () {
|
|
733
|
+
_this.formatter.onSuccess(_this, args_1);
|
|
734
|
+
}, 0);
|
|
731
735
|
if (!(_this.maxLength === -1 || totalLength <= _this.maxLength)) {
|
|
732
736
|
e.preventDefault();
|
|
733
737
|
}
|
|
@@ -739,7 +743,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
739
743
|
_this.notify(events.pasteClean, { args: e });
|
|
740
744
|
}
|
|
741
745
|
else {
|
|
742
|
-
var
|
|
746
|
+
var args_2 = { requestType: 'Paste', editorMode: _this.editorMode, event: e };
|
|
743
747
|
var value = null;
|
|
744
748
|
var htmlValue = false;
|
|
745
749
|
if (e && !isNOU(e.clipboardData)) {
|
|
@@ -757,7 +761,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
757
761
|
});
|
|
758
762
|
}
|
|
759
763
|
setTimeout(function () {
|
|
760
|
-
_this.formatter.onSuccess(_this,
|
|
764
|
+
_this.formatter.onSuccess(_this, args_2);
|
|
761
765
|
}, 0);
|
|
762
766
|
}
|
|
763
767
|
}
|
|
@@ -377,14 +377,10 @@ var Image = /** @class */ (function () {
|
|
|
377
377
|
img.style.height = null;
|
|
378
378
|
img.removeAttribute('height');
|
|
379
379
|
}
|
|
380
|
-
else
|
|
380
|
+
else {
|
|
381
381
|
img.style.width = expectedX + 'px';
|
|
382
382
|
img.style.height = expectedX + 'px';
|
|
383
383
|
}
|
|
384
|
-
else {
|
|
385
|
-
img.setAttribute('width', expectedX.toString());
|
|
386
|
-
img.setAttribute('height', expectedX.toString());
|
|
387
|
-
}
|
|
388
384
|
}
|
|
389
385
|
};
|
|
390
386
|
Image.prototype.pixToPerc = function (expected, parentEle) {
|
|
@@ -766,7 +766,8 @@ var Table = /** @class */ (function () {
|
|
|
766
766
|
var tableWidth = parseInt(getComputedStyle(_this.curTable).width, 10);
|
|
767
767
|
var tableHeight = parseInt(getComputedStyle(_this.curTable).height, 10);
|
|
768
768
|
var paddingSize = +getComputedStyle(_this.contentModule.getEditPanel()).paddingRight.match(/\d/g).join('');
|
|
769
|
-
var rteWidth = _this.contentModule.getEditPanel().offsetWidth -
|
|
769
|
+
var rteWidth = _this.contentModule.getEditPanel().offsetWidth - (_this.contentModule.getEditPanel().offsetWidth -
|
|
770
|
+
_this.contentModule.getEditPanel().clientWidth) - paddingSize * 2;
|
|
770
771
|
if (_this.resizeBtnStat.column) {
|
|
771
772
|
var cellColl = _this.curTable.rows[_this.calMaxCol(_this.curTable)].cells;
|
|
772
773
|
var width = parseFloat(_this.columnEle.offsetWidth.toString());
|