@syncfusion/ej2-richtexteditor 20.1.50 → 20.1.51
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 +14 -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 +17 -11
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +19 -13
- 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 +6 -6
- package/src/editor-manager/plugin/insert-text.js +1 -1
- package/src/editor-manager/plugin/nodecutter.js +1 -1
- package/src/editor-manager/plugin/selection-commands.js +8 -2
- package/src/editor-manager/plugin/table.js +2 -2
- package/src/rich-text-editor/base/rich-text-editor.js +6 -2
- package/src/rich-text-editor/renderer/image-module.js +1 -5
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.51
|
|
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.50",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-gkz4PlU7B1CB+wMuzLpWYTa/n3NaAlzqGYfk2gxHEx+26SxT8sIbVVqGHSjvT9wKHU4TSczQhqTCg3+aiS8RHA==",
|
|
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.50.tgz",
|
|
30
|
+
"_shasum": "17718651142faa753d87d51a230d39c2a8e02db5",
|
|
31
31
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
32
32
|
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
|
|
33
33
|
"author": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@syncfusion/ej2-buttons": "~20.1.50",
|
|
43
43
|
"@syncfusion/ej2-filemanager": "~20.1.47",
|
|
44
44
|
"@syncfusion/ej2-inputs": "~20.1.48",
|
|
45
|
-
"@syncfusion/ej2-navigations": "~20.1.
|
|
45
|
+
"@syncfusion/ej2-navigations": "~20.1.51",
|
|
46
46
|
"@syncfusion/ej2-popups": "~20.1.47",
|
|
47
47
|
"@syncfusion/ej2-splitbuttons": "~20.1.47"
|
|
48
48
|
},
|
|
@@ -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.51",
|
|
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,
|
|
@@ -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);
|
|
@@ -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
|
}
|
|
@@ -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) {
|