@syncfusion/ej2-richtexteditor 19.4.40 → 19.4.47
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 +18 -0
- package/README.md +1 -1
- 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 +66 -27
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +66 -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/package.json +12 -12
- package/src/editor-manager/plugin/lists.js +2 -1
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +1 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +53 -19
- package/src/rich-text-editor/actions/enter-key.js +5 -3
- package/src/rich-text-editor/actions/html-editor.js +2 -1
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +1 -1
- package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -1
- package/src/rich-text-editor/base/rich-text-editor.js +1 -1
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.js +1 -1
- package/src/rich-text-editor/renderer/image-module.js +2 -1
|
@@ -10607,7 +10607,8 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
10607
10607
|
range.startContainer.parentElement.closest('LI');
|
|
10608
10608
|
var endNode = range.endContainer.nodeName === 'LI' ? range.endContainer :
|
|
10609
10609
|
range.endContainer.parentElement.closest('LI');
|
|
10610
|
-
if (!isNullOrUndefined(startNode) && !isNullOrUndefined(endNode) && startNode === endNode && startNode.tagName === 'LI' &&
|
|
10610
|
+
if (!isNullOrUndefined(startNode) && !isNullOrUndefined(endNode) && startNode === endNode && startNode.tagName === 'LI' &&
|
|
10611
|
+
startNode.textContent.trim() === '' && startNode.querySelectorAll('IMG').length === 0) {
|
|
10611
10612
|
if (startNode.textContent.charCodeAt(0) === 65279) {
|
|
10612
10613
|
startNode.textContent = '';
|
|
10613
10614
|
}
|
|
@@ -15978,8 +15979,10 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
15978
15979
|
this.listContents = [];
|
|
15979
15980
|
this.getListContent(listNodes[i]);
|
|
15980
15981
|
var type = void 0;
|
|
15982
|
+
var listStyleType = void 0;
|
|
15981
15983
|
if (!isNullOrUndefined(this.listContents[0])) {
|
|
15982
15984
|
type = this.listContents[0].trim().length > 1 ? 'ol' : 'ul';
|
|
15985
|
+
listStyleType = this.getlistStyleType(this.listContents[0], type);
|
|
15983
15986
|
var tempNode = [];
|
|
15984
15987
|
for (var j = 1; j < this.listContents.length; j++) {
|
|
15985
15988
|
tempNode.push(this.listContents[j]);
|
|
@@ -15996,7 +15999,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
15996
15999
|
}
|
|
15997
16000
|
}
|
|
15998
16001
|
collection.push({ listType: type, content: tempNode, nestedLevel: level, class: currentClassName,
|
|
15999
|
-
listStyle: currentListStyle });
|
|
16002
|
+
listStyle: currentListStyle, listStyleTypeName: listStyleType });
|
|
16000
16003
|
}
|
|
16001
16004
|
}
|
|
16002
16005
|
stNode = listNodes.shift();
|
|
@@ -16020,6 +16023,45 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16020
16023
|
}
|
|
16021
16024
|
}
|
|
16022
16025
|
};
|
|
16026
|
+
MsWordPaste.prototype.getlistStyleType = function (listContent, type) {
|
|
16027
|
+
var currentListClass;
|
|
16028
|
+
if (type === 'ol') {
|
|
16029
|
+
switch (listContent.split('.')[0]) {
|
|
16030
|
+
case "A":
|
|
16031
|
+
currentListClass = "upper-alpha";
|
|
16032
|
+
break;
|
|
16033
|
+
case "a":
|
|
16034
|
+
currentListClass = "lower-alpha";
|
|
16035
|
+
break;
|
|
16036
|
+
case "I":
|
|
16037
|
+
currentListClass = "upper-roman";
|
|
16038
|
+
break;
|
|
16039
|
+
case "i":
|
|
16040
|
+
currentListClass = "lower-roman";
|
|
16041
|
+
break;
|
|
16042
|
+
case "α":
|
|
16043
|
+
currentListClass = "lower-greek";
|
|
16044
|
+
break;
|
|
16045
|
+
default:
|
|
16046
|
+
currentListClass = "decimal";
|
|
16047
|
+
break;
|
|
16048
|
+
}
|
|
16049
|
+
}
|
|
16050
|
+
else {
|
|
16051
|
+
switch (listContent.split('.')[0]) {
|
|
16052
|
+
case "o":
|
|
16053
|
+
currentListClass = "circle";
|
|
16054
|
+
break;
|
|
16055
|
+
case "§":
|
|
16056
|
+
currentListClass = "square";
|
|
16057
|
+
break;
|
|
16058
|
+
default:
|
|
16059
|
+
currentListClass = "disc";
|
|
16060
|
+
break;
|
|
16061
|
+
}
|
|
16062
|
+
}
|
|
16063
|
+
return currentListClass;
|
|
16064
|
+
};
|
|
16023
16065
|
MsWordPaste.prototype.makeConversion = function (collection) {
|
|
16024
16066
|
var root = createElement('div');
|
|
16025
16067
|
var temp;
|
|
@@ -16036,7 +16078,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16036
16078
|
prevList.appendChild(pElement);
|
|
16037
16079
|
temp.appendChild(prevList);
|
|
16038
16080
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
16039
|
-
temp.style.
|
|
16081
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
16040
16082
|
}
|
|
16041
16083
|
else if (collection[index].nestedLevel === pLevel) {
|
|
16042
16084
|
if (prevList.parentElement.tagName.toLowerCase() === collection[index].listType) {
|
|
@@ -16045,6 +16087,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16045
16087
|
}
|
|
16046
16088
|
else {
|
|
16047
16089
|
temp = createElement(collection[index].listType);
|
|
16090
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
16048
16091
|
prevList.parentElement.parentElement.appendChild(temp);
|
|
16049
16092
|
prevList = createElement('li');
|
|
16050
16093
|
prevList.appendChild(pElement);
|
|
@@ -16056,14 +16099,15 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16056
16099
|
if (!isNullOrUndefined(prevList)) {
|
|
16057
16100
|
for (var j = 0; j < collection[index].nestedLevel - pLevel; j++) {
|
|
16058
16101
|
prevList.appendChild(temp = createElement(collection[index].listType));
|
|
16059
|
-
prevList = createElement('li'
|
|
16102
|
+
prevList = createElement('li');
|
|
16103
|
+
if (j != collection[index].nestedLevel - pLevel - 1 && collection[index].nestedLevel - pLevel > 1) {
|
|
16104
|
+
prevList.style.listStyleType = "none";
|
|
16105
|
+
}
|
|
16060
16106
|
temp.appendChild(prevList);
|
|
16061
16107
|
}
|
|
16062
16108
|
prevList.appendChild(pElement);
|
|
16063
16109
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
16064
|
-
temp.style.
|
|
16065
|
-
temp.childNodes[0].style.listStyle =
|
|
16066
|
-
this.getListStyle(collection[index].listType, collection[index].nestedLevel);
|
|
16110
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
16067
16111
|
}
|
|
16068
16112
|
else {
|
|
16069
16113
|
root.appendChild(temp = createElement(collection[index].listType));
|
|
@@ -16071,7 +16115,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16071
16115
|
prevList.appendChild(pElement);
|
|
16072
16116
|
temp.appendChild(prevList);
|
|
16073
16117
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
16074
|
-
temp.style.
|
|
16118
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
16075
16119
|
}
|
|
16076
16120
|
}
|
|
16077
16121
|
else if (collection[index].nestedLevel === 1) {
|
|
@@ -16080,12 +16124,12 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16080
16124
|
}
|
|
16081
16125
|
else {
|
|
16082
16126
|
root.appendChild(temp = createElement(collection[index].listType));
|
|
16127
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
16083
16128
|
}
|
|
16084
16129
|
prevList = createElement('li');
|
|
16085
16130
|
prevList.appendChild(pElement);
|
|
16086
16131
|
temp.appendChild(prevList);
|
|
16087
16132
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
16088
|
-
temp.style.listStyle = this.getListStyle(collection[index].listType, collection[index].nestedLevel);
|
|
16089
16133
|
}
|
|
16090
16134
|
else {
|
|
16091
16135
|
elem = prevList;
|
|
@@ -16106,7 +16150,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16106
16150
|
prevList.appendChild(pElement);
|
|
16107
16151
|
temp.appendChild(prevList);
|
|
16108
16152
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
16109
|
-
temp.style.
|
|
16153
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
16110
16154
|
break;
|
|
16111
16155
|
}
|
|
16112
16156
|
}
|
|
@@ -16115,21 +16159,12 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16115
16159
|
}
|
|
16116
16160
|
prevList.setAttribute('class', collection[index].class);
|
|
16117
16161
|
var currentStyle = prevList.getAttribute('style');
|
|
16118
|
-
prevList.setAttribute('style', (!isNullOrUndefined(currentStyle) ? currentStyle : '')
|
|
16162
|
+
prevList.setAttribute('style', (!isNullOrUndefined(currentStyle) ? currentStyle : ''));
|
|
16119
16163
|
pLevel = collection[index].nestedLevel;
|
|
16120
16164
|
listCount++;
|
|
16121
16165
|
}
|
|
16122
16166
|
return root;
|
|
16123
16167
|
};
|
|
16124
|
-
MsWordPaste.prototype.getListStyle = function (listType, nestedLevel) {
|
|
16125
|
-
nestedLevel = (nestedLevel > 0) ? nestedLevel - 1 : nestedLevel;
|
|
16126
|
-
if (listType === 'ol') {
|
|
16127
|
-
return (nestedLevel < this.olData.length ? this.olData[nestedLevel] : this.olData[0]);
|
|
16128
|
-
}
|
|
16129
|
-
else {
|
|
16130
|
-
return (nestedLevel < this.ulData.length ? this.ulData[nestedLevel] : this.ulData[0]);
|
|
16131
|
-
}
|
|
16132
|
-
};
|
|
16133
16168
|
MsWordPaste.prototype.getListContent = function (elem) {
|
|
16134
16169
|
var pushContent = '';
|
|
16135
16170
|
var firstChild = elem.firstElementChild;
|
|
@@ -17389,7 +17424,8 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
17389
17424
|
if (this.rangeElement.tagName === 'OL' || this.rangeElement.tagName === 'UL') {
|
|
17390
17425
|
var liElement = this.getRangeLiNode(currentRange.startContainer);
|
|
17391
17426
|
if (liElement.previousElementSibling && liElement.previousElementSibling.childElementCount > 0) {
|
|
17392
|
-
this.oldRangeElement = liElement.previousElementSibling.lastElementChild
|
|
17427
|
+
this.oldRangeElement = liElement.previousElementSibling.lastElementChild.nodeName === 'BR' ?
|
|
17428
|
+
liElement.previousElementSibling : liElement.previousElementSibling.lastElementChild;
|
|
17393
17429
|
if (!isNullOrUndefined(liElement.lastElementChild)) {
|
|
17394
17430
|
this.rangeElement = liElement.lastElementChild;
|
|
17395
17431
|
isLiElement = true;
|
|
@@ -20346,7 +20382,8 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
20346
20382
|
};
|
|
20347
20383
|
Image.prototype.resizeImgDupPos = function (e) {
|
|
20348
20384
|
this.imgDupPos = {
|
|
20349
|
-
width: (e.style.width !== ''
|
|
20385
|
+
width: (e.style.width !== '' && (this.parent.insertImageSettings &&
|
|
20386
|
+
!this.parent.insertImageSettings.resizeByPercent)) ? this.imgEle.style.width : e.width + 'px',
|
|
20350
20387
|
height: (e.style.height !== '') ? this.imgEle.style.height : e.height + 'px'
|
|
20351
20388
|
};
|
|
20352
20389
|
};
|
|
@@ -24080,7 +24117,7 @@ var PasteCleanupSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
24080
24117
|
Property(null)
|
|
24081
24118
|
], PasteCleanupSettings.prototype, "deniedAttrs", void 0);
|
|
24082
24119
|
__decorate$2([
|
|
24083
|
-
Property(['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width'])
|
|
24120
|
+
Property(['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'list-style-type', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width'])
|
|
24084
24121
|
], PasteCleanupSettings.prototype, "allowedStyleProps", void 0);
|
|
24085
24122
|
__decorate$2([
|
|
24086
24123
|
Property(null)
|
|
@@ -24554,9 +24591,11 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
24554
24591
|
_this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
|
|
24555
24592
|
_this.range.startOffset === _this.range.endOffset &&
|
|
24556
24593
|
_this.range.startOffset === isLastNodeLength) {
|
|
24557
|
-
var
|
|
24558
|
-
_this.parent.
|
|
24559
|
-
_this.parent.formatter.editorManager.
|
|
24594
|
+
var focusBRElem = _this.parent.createElement('br');
|
|
24595
|
+
var lineBreakBRElem = _this.parent.createElement('br');
|
|
24596
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, _this.range.startContainer);
|
|
24597
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(lineBreakBRElem, _this.range.startContainer);
|
|
24598
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), focusBRElem, 0);
|
|
24560
24599
|
}
|
|
24561
24600
|
else if (!isNullOrUndefined(currentParent) && currentParent !== _this.parent.inputElement && currentParent.nodeName !== 'BR') {
|
|
24562
24601
|
if (currentParent.textContent.trim().length === 0 || (currentParent.textContent.trim().length === 1 &&
|
|
@@ -26444,7 +26483,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
26444
26483
|
this.isRTE = false;
|
|
26445
26484
|
}
|
|
26446
26485
|
this.notify(docClick, { args: e });
|
|
26447
|
-
if (e.detail > 3) {
|
|
26486
|
+
if (Browser.info.name !== 'msie' && e.detail > 3) {
|
|
26448
26487
|
e.preventDefault();
|
|
26449
26488
|
}
|
|
26450
26489
|
};
|