@syncfusion/ej2-richtexteditor 19.4.38 → 19.4.50
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 +42 -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 +115 -60
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +115 -60
- 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 +3 -2
- package/src/editor-manager/plugin/lists.js +4 -2
- 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/editor-manager/plugin/selection-commands.js +10 -5
- package/src/rich-text-editor/actions/color-picker.d.ts +1 -0
- package/src/rich-text-editor/actions/color-picker.js +2 -1
- package/src/rich-text-editor/actions/enter-key.js +11 -4
- package/src/rich-text-editor/actions/html-editor.js +3 -2
- package/src/rich-text-editor/base/interface.d.ts +1 -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 +24 -21
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +1 -1
- package/src/rich-text-editor/renderer/toolbar-renderer.js +3 -2
|
@@ -2968,7 +2968,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
2968
2968
|
* @hidden
|
|
2969
2969
|
* @deprecated
|
|
2970
2970
|
*/
|
|
2971
|
-
ToolbarRenderer.prototype.renderColorPickerDropDown = function (args, item, colorPicker) {
|
|
2971
|
+
ToolbarRenderer.prototype.renderColorPickerDropDown = function (args, item, colorPicker, defaultColor) {
|
|
2972
2972
|
var _this = this;
|
|
2973
2973
|
// eslint-disable-next-line
|
|
2974
2974
|
var proxy = this;
|
|
@@ -2977,8 +2977,9 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
2977
2977
|
var content = proxy.parent.createElement('span', { className: CLS_COLOR_CONTENT });
|
|
2978
2978
|
var inlineEle = proxy.parent.createElement('span', { className: args.cssClass });
|
|
2979
2979
|
var range;
|
|
2980
|
+
var initialBackgroundColor = (isNullOrUndefined(defaultColor)) ? proxy.parent.backgroundColor.default : defaultColor;
|
|
2980
2981
|
inlineEle.style.borderBottomColor = (item === 'backgroundcolor') ?
|
|
2981
|
-
|
|
2982
|
+
initialBackgroundColor : proxy.parent.fontColor.default;
|
|
2982
2983
|
content.appendChild(inlineEle);
|
|
2983
2984
|
var dropDown = new DropDownButton({
|
|
2984
2985
|
target: colorPicker.element.parentElement, cssClass: css,
|
|
@@ -5030,7 +5031,7 @@ var ColorPickerInput = /** @__PURE__ @class */ (function () {
|
|
|
5030
5031
|
target: (targetID)
|
|
5031
5032
|
};
|
|
5032
5033
|
_this.backgroundColorPicker = _this.toolbarRenderer.renderColorPicker(options, 'backgroundcolor');
|
|
5033
|
-
_this.backgroundColorDropDown = _this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', _this.backgroundColorPicker);
|
|
5034
|
+
_this.backgroundColorDropDown = _this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', _this.backgroundColorPicker, _this.defaultColorPicker);
|
|
5034
5035
|
break;
|
|
5035
5036
|
}
|
|
5036
5037
|
}
|
|
@@ -5065,6 +5066,7 @@ var ColorPickerInput = /** @__PURE__ @class */ (function () {
|
|
|
5065
5066
|
if (this.backgroundColorDropDown && !this.backgroundColorDropDown.isDestroyed) {
|
|
5066
5067
|
var innerEle = this.backgroundColorDropDown.element.querySelector('.e-rte-color-content');
|
|
5067
5068
|
if (innerEle) {
|
|
5069
|
+
this.defaultColorPicker = innerEle.children[0].style.borderBottomColor;
|
|
5068
5070
|
detach(innerEle);
|
|
5069
5071
|
}
|
|
5070
5072
|
this.backgroundColorDropDown.destroy();
|
|
@@ -10561,8 +10563,9 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
10561
10563
|
Lists.prototype.testCurrentList = function (range) {
|
|
10562
10564
|
var olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
|
|
10563
10565
|
if (!isNullOrUndefined(range.startContainer.textContent.slice(0, range.startOffset))) {
|
|
10566
|
+
var currentContent = range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim();
|
|
10564
10567
|
for (var i = 0; i < olListStartRegex.length; i++) {
|
|
10565
|
-
if (olListStartRegex[i].test(
|
|
10568
|
+
if (olListStartRegex[i].test(currentContent) && currentContent.length === 2) {
|
|
10566
10569
|
return true;
|
|
10567
10570
|
}
|
|
10568
10571
|
}
|
|
@@ -10604,7 +10607,8 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
10604
10607
|
range.startContainer.parentElement.closest('LI');
|
|
10605
10608
|
var endNode = range.endContainer.nodeName === 'LI' ? range.endContainer :
|
|
10606
10609
|
range.endContainer.parentElement.closest('LI');
|
|
10607
|
-
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) {
|
|
10608
10612
|
if (startNode.textContent.charCodeAt(0) === 65279) {
|
|
10609
10613
|
startNode.textContent = '';
|
|
10610
10614
|
}
|
|
@@ -12232,8 +12236,9 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
12232
12236
|
};
|
|
12233
12237
|
InsertHtml.getNodeCollection = function (range, nodeSelection, node) {
|
|
12234
12238
|
var nodes = [];
|
|
12235
|
-
if (range.startOffset === range.endOffset && range.startContainer === range.endContainer
|
|
12236
|
-
|
|
12239
|
+
if (range.startOffset === range.endOffset && range.startContainer === range.endContainer &&
|
|
12240
|
+
range.startContainer.nodeName != 'BR' &&
|
|
12241
|
+
(range.startContainer.nodeName === 'TD' || (range.startContainer.nodeType !== 3 &&
|
|
12237
12242
|
node.classList && node.classList.contains('pasteContent')))) {
|
|
12238
12243
|
nodes.push(range.startContainer.childNodes[range.endOffset]);
|
|
12239
12244
|
}
|
|
@@ -14603,6 +14608,9 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
14603
14608
|
};
|
|
14604
14609
|
SelectionCommands.removeFormat = function (nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode) {
|
|
14605
14610
|
var splitNode = null;
|
|
14611
|
+
var startText = range.startContainer.nodeName === '#text' ?
|
|
14612
|
+
range.startContainer.textContent.substring(range.startOffset, range.startContainer.textContent.length) :
|
|
14613
|
+
range.startContainer.textContent;
|
|
14606
14614
|
if (!(range.startContainer === range.endContainer && range.startOffset === 0
|
|
14607
14615
|
&& range.endOffset === range.startContainer.length)) {
|
|
14608
14616
|
var nodeIndex = [];
|
|
@@ -14702,11 +14710,13 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
14702
14710
|
for (var num = 0; num < child.length; num++) {
|
|
14703
14711
|
if (child[num].nodeType !== 3 || (child[num].textContent && child[num].textContent.trim().length > 0)) {
|
|
14704
14712
|
child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
|
|
14705
|
-
if (num ===
|
|
14706
|
-
|
|
14707
|
-
|
|
14708
|
-
|
|
14709
|
-
|
|
14713
|
+
if (child[num].textContent === startText) {
|
|
14714
|
+
if (num === 0) {
|
|
14715
|
+
range.setStartBefore(child[num]);
|
|
14716
|
+
}
|
|
14717
|
+
else if (num === child.length - 1) {
|
|
14718
|
+
range.setEndAfter(child[num]);
|
|
14719
|
+
}
|
|
14710
14720
|
}
|
|
14711
14721
|
}
|
|
14712
14722
|
}
|
|
@@ -15970,8 +15980,10 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
15970
15980
|
this.listContents = [];
|
|
15971
15981
|
this.getListContent(listNodes[i]);
|
|
15972
15982
|
var type = void 0;
|
|
15983
|
+
var listStyleType = void 0;
|
|
15973
15984
|
if (!isNullOrUndefined(this.listContents[0])) {
|
|
15974
15985
|
type = this.listContents[0].trim().length > 1 ? 'ol' : 'ul';
|
|
15986
|
+
listStyleType = this.getlistStyleType(this.listContents[0], type);
|
|
15975
15987
|
var tempNode = [];
|
|
15976
15988
|
for (var j = 1; j < this.listContents.length; j++) {
|
|
15977
15989
|
tempNode.push(this.listContents[j]);
|
|
@@ -15988,7 +16000,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
15988
16000
|
}
|
|
15989
16001
|
}
|
|
15990
16002
|
collection.push({ listType: type, content: tempNode, nestedLevel: level, class: currentClassName,
|
|
15991
|
-
listStyle: currentListStyle });
|
|
16003
|
+
listStyle: currentListStyle, listStyleTypeName: listStyleType });
|
|
15992
16004
|
}
|
|
15993
16005
|
}
|
|
15994
16006
|
stNode = listNodes.shift();
|
|
@@ -16012,6 +16024,45 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16012
16024
|
}
|
|
16013
16025
|
}
|
|
16014
16026
|
};
|
|
16027
|
+
MsWordPaste.prototype.getlistStyleType = function (listContent, type) {
|
|
16028
|
+
var currentListClass;
|
|
16029
|
+
if (type === 'ol') {
|
|
16030
|
+
switch (listContent.split('.')[0]) {
|
|
16031
|
+
case "A":
|
|
16032
|
+
currentListClass = "upper-alpha";
|
|
16033
|
+
break;
|
|
16034
|
+
case "a":
|
|
16035
|
+
currentListClass = "lower-alpha";
|
|
16036
|
+
break;
|
|
16037
|
+
case "I":
|
|
16038
|
+
currentListClass = "upper-roman";
|
|
16039
|
+
break;
|
|
16040
|
+
case "i":
|
|
16041
|
+
currentListClass = "lower-roman";
|
|
16042
|
+
break;
|
|
16043
|
+
case "α":
|
|
16044
|
+
currentListClass = "lower-greek";
|
|
16045
|
+
break;
|
|
16046
|
+
default:
|
|
16047
|
+
currentListClass = "decimal";
|
|
16048
|
+
break;
|
|
16049
|
+
}
|
|
16050
|
+
}
|
|
16051
|
+
else {
|
|
16052
|
+
switch (listContent.split('.')[0]) {
|
|
16053
|
+
case "o":
|
|
16054
|
+
currentListClass = "circle";
|
|
16055
|
+
break;
|
|
16056
|
+
case "§":
|
|
16057
|
+
currentListClass = "square";
|
|
16058
|
+
break;
|
|
16059
|
+
default:
|
|
16060
|
+
currentListClass = "disc";
|
|
16061
|
+
break;
|
|
16062
|
+
}
|
|
16063
|
+
}
|
|
16064
|
+
return currentListClass;
|
|
16065
|
+
};
|
|
16015
16066
|
MsWordPaste.prototype.makeConversion = function (collection) {
|
|
16016
16067
|
var root = createElement('div');
|
|
16017
16068
|
var temp;
|
|
@@ -16028,7 +16079,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16028
16079
|
prevList.appendChild(pElement);
|
|
16029
16080
|
temp.appendChild(prevList);
|
|
16030
16081
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
16031
|
-
temp.style.
|
|
16082
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
16032
16083
|
}
|
|
16033
16084
|
else if (collection[index].nestedLevel === pLevel) {
|
|
16034
16085
|
if (prevList.parentElement.tagName.toLowerCase() === collection[index].listType) {
|
|
@@ -16037,6 +16088,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16037
16088
|
}
|
|
16038
16089
|
else {
|
|
16039
16090
|
temp = createElement(collection[index].listType);
|
|
16091
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
16040
16092
|
prevList.parentElement.parentElement.appendChild(temp);
|
|
16041
16093
|
prevList = createElement('li');
|
|
16042
16094
|
prevList.appendChild(pElement);
|
|
@@ -16048,14 +16100,15 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16048
16100
|
if (!isNullOrUndefined(prevList)) {
|
|
16049
16101
|
for (var j = 0; j < collection[index].nestedLevel - pLevel; j++) {
|
|
16050
16102
|
prevList.appendChild(temp = createElement(collection[index].listType));
|
|
16051
|
-
prevList = createElement('li'
|
|
16103
|
+
prevList = createElement('li');
|
|
16104
|
+
if (j != collection[index].nestedLevel - pLevel - 1 && collection[index].nestedLevel - pLevel > 1) {
|
|
16105
|
+
prevList.style.listStyleType = "none";
|
|
16106
|
+
}
|
|
16052
16107
|
temp.appendChild(prevList);
|
|
16053
16108
|
}
|
|
16054
16109
|
prevList.appendChild(pElement);
|
|
16055
16110
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
16056
|
-
temp.style.
|
|
16057
|
-
temp.childNodes[0].style.listStyle =
|
|
16058
|
-
this.getListStyle(collection[index].listType, collection[index].nestedLevel);
|
|
16111
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
16059
16112
|
}
|
|
16060
16113
|
else {
|
|
16061
16114
|
root.appendChild(temp = createElement(collection[index].listType));
|
|
@@ -16063,7 +16116,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16063
16116
|
prevList.appendChild(pElement);
|
|
16064
16117
|
temp.appendChild(prevList);
|
|
16065
16118
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
16066
|
-
temp.style.
|
|
16119
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
16067
16120
|
}
|
|
16068
16121
|
}
|
|
16069
16122
|
else if (collection[index].nestedLevel === 1) {
|
|
@@ -16072,12 +16125,12 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16072
16125
|
}
|
|
16073
16126
|
else {
|
|
16074
16127
|
root.appendChild(temp = createElement(collection[index].listType));
|
|
16128
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
16075
16129
|
}
|
|
16076
16130
|
prevList = createElement('li');
|
|
16077
16131
|
prevList.appendChild(pElement);
|
|
16078
16132
|
temp.appendChild(prevList);
|
|
16079
16133
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
16080
|
-
temp.style.listStyle = this.getListStyle(collection[index].listType, collection[index].nestedLevel);
|
|
16081
16134
|
}
|
|
16082
16135
|
else {
|
|
16083
16136
|
elem = prevList;
|
|
@@ -16098,7 +16151,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16098
16151
|
prevList.appendChild(pElement);
|
|
16099
16152
|
temp.appendChild(prevList);
|
|
16100
16153
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
16101
|
-
temp.style.
|
|
16154
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
16102
16155
|
break;
|
|
16103
16156
|
}
|
|
16104
16157
|
}
|
|
@@ -16107,21 +16160,12 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16107
16160
|
}
|
|
16108
16161
|
prevList.setAttribute('class', collection[index].class);
|
|
16109
16162
|
var currentStyle = prevList.getAttribute('style');
|
|
16110
|
-
prevList.setAttribute('style', (!isNullOrUndefined(currentStyle) ? currentStyle : '')
|
|
16163
|
+
prevList.setAttribute('style', (!isNullOrUndefined(currentStyle) ? currentStyle : ''));
|
|
16111
16164
|
pLevel = collection[index].nestedLevel;
|
|
16112
16165
|
listCount++;
|
|
16113
16166
|
}
|
|
16114
16167
|
return root;
|
|
16115
16168
|
};
|
|
16116
|
-
MsWordPaste.prototype.getListStyle = function (listType, nestedLevel) {
|
|
16117
|
-
nestedLevel = (nestedLevel > 0) ? nestedLevel - 1 : nestedLevel;
|
|
16118
|
-
if (listType === 'ol') {
|
|
16119
|
-
return (nestedLevel < this.olData.length ? this.olData[nestedLevel] : this.olData[0]);
|
|
16120
|
-
}
|
|
16121
|
-
else {
|
|
16122
|
-
return (nestedLevel < this.ulData.length ? this.ulData[nestedLevel] : this.ulData[0]);
|
|
16123
|
-
}
|
|
16124
|
-
};
|
|
16125
16169
|
MsWordPaste.prototype.getListContent = function (elem) {
|
|
16126
16170
|
var pushContent = '';
|
|
16127
16171
|
var firstChild = elem.firstElementChild;
|
|
@@ -17381,8 +17425,9 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
17381
17425
|
if (this.rangeElement.tagName === 'OL' || this.rangeElement.tagName === 'UL') {
|
|
17382
17426
|
var liElement = this.getRangeLiNode(currentRange.startContainer);
|
|
17383
17427
|
if (liElement.previousElementSibling && liElement.previousElementSibling.childElementCount > 0) {
|
|
17384
|
-
this.oldRangeElement = liElement.previousElementSibling.lastElementChild
|
|
17385
|
-
|
|
17428
|
+
this.oldRangeElement = liElement.previousElementSibling.lastElementChild.nodeName === 'BR' ?
|
|
17429
|
+
liElement.previousElementSibling : liElement.previousElementSibling.lastElementChild;
|
|
17430
|
+
if (!isNullOrUndefined(liElement.lastElementChild) && liElement.lastElementChild.nodeName !== 'BR') {
|
|
17386
17431
|
this.rangeElement = liElement.lastElementChild;
|
|
17387
17432
|
isLiElement = true;
|
|
17388
17433
|
}
|
|
@@ -20198,7 +20243,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
20198
20243
|
left: elem.offsetLeft
|
|
20199
20244
|
};
|
|
20200
20245
|
};
|
|
20201
|
-
Image.prototype.setAspectRatio = function (img, expectedX, expectedY) {
|
|
20246
|
+
Image.prototype.setAspectRatio = function (img, expectedX, expectedY, e) {
|
|
20202
20247
|
if (isNullOrUndefined(img.width)) {
|
|
20203
20248
|
return;
|
|
20204
20249
|
}
|
|
@@ -20252,7 +20297,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
20252
20297
|
img.style.height = (height / width * expectedX) + 'px';
|
|
20253
20298
|
}
|
|
20254
20299
|
else {
|
|
20255
|
-
img.setAttribute('width', expectedX.toString());
|
|
20300
|
+
img.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - img.getBoundingClientRect().left).toString() : expectedX.toString());
|
|
20256
20301
|
}
|
|
20257
20302
|
}
|
|
20258
20303
|
else {
|
|
@@ -20293,7 +20338,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
20293
20338
|
return;
|
|
20294
20339
|
}
|
|
20295
20340
|
_this.imgEle.parentElement.style.cursor = 'pointer';
|
|
20296
|
-
_this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10));
|
|
20341
|
+
_this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10), args);
|
|
20297
20342
|
_this.resizeImgDupPos(_this.imgEle);
|
|
20298
20343
|
_this.imgResizePos(_this.imgEle, _this.imgResizeDiv);
|
|
20299
20344
|
_this.parent.setContentHeight('', false);
|
|
@@ -20338,7 +20383,8 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
20338
20383
|
};
|
|
20339
20384
|
Image.prototype.resizeImgDupPos = function (e) {
|
|
20340
20385
|
this.imgDupPos = {
|
|
20341
|
-
width: (e.style.width !== ''
|
|
20386
|
+
width: (e.style.width !== '' && (this.parent.insertImageSettings &&
|
|
20387
|
+
!this.parent.insertImageSettings.resizeByPercent)) ? this.imgEle.style.width : e.width + 'px',
|
|
20342
20388
|
height: (e.style.height !== '') ? this.imgEle.style.height : e.height + 'px'
|
|
20343
20389
|
};
|
|
20344
20390
|
};
|
|
@@ -20506,26 +20552,28 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
20506
20552
|
var src = this.deletedImg[i].src;
|
|
20507
20553
|
this.imageRemovePost(src);
|
|
20508
20554
|
}
|
|
20509
|
-
if (
|
|
20510
|
-
if (
|
|
20511
|
-
if (
|
|
20512
|
-
range.startContainer.previousElementSibling.
|
|
20513
|
-
|
|
20514
|
-
|
|
20555
|
+
if (this.parent.editorMode !== 'Markdown') {
|
|
20556
|
+
if (range.startContainer.nodeType === 3) {
|
|
20557
|
+
if (originalEvent.code === 'Backspace') {
|
|
20558
|
+
if (range.startContainer.previousElementSibling && range.startOffset === 0 &&
|
|
20559
|
+
range.startContainer.previousElementSibling.classList.contains(CLS_CAPTION) &&
|
|
20560
|
+
range.startContainer.previousElementSibling.classList.contains(CLS_CAPINLINE)) {
|
|
20561
|
+
detach(range.startContainer.previousElementSibling);
|
|
20562
|
+
}
|
|
20515
20563
|
}
|
|
20516
|
-
|
|
20517
|
-
|
|
20518
|
-
|
|
20519
|
-
|
|
20520
|
-
|
|
20521
|
-
|
|
20522
|
-
|
|
20564
|
+
else {
|
|
20565
|
+
if (range.startContainer.nextElementSibling &&
|
|
20566
|
+
range.endContainer.textContent.length === range.endOffset &&
|
|
20567
|
+
range.startContainer.nextElementSibling.classList.contains(CLS_CAPTION) &&
|
|
20568
|
+
range.startContainer.nextElementSibling.classList.contains(CLS_CAPINLINE)) {
|
|
20569
|
+
detach(range.startContainer.nextElementSibling);
|
|
20570
|
+
}
|
|
20523
20571
|
}
|
|
20524
20572
|
}
|
|
20525
|
-
|
|
20526
|
-
|
|
20527
|
-
|
|
20528
|
-
|
|
20573
|
+
else if ((range.startContainer.nodeType === 1 &&
|
|
20574
|
+
range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_CAPINLINE))) {
|
|
20575
|
+
detach(range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_CAPINLINE));
|
|
20576
|
+
}
|
|
20529
20577
|
}
|
|
20530
20578
|
break;
|
|
20531
20579
|
case 'insert-image':
|
|
@@ -24072,7 +24120,7 @@ var PasteCleanupSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
24072
24120
|
Property(null)
|
|
24073
24121
|
], PasteCleanupSettings.prototype, "deniedAttrs", void 0);
|
|
24074
24122
|
__decorate$2([
|
|
24075
|
-
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'])
|
|
24123
|
+
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'])
|
|
24076
24124
|
], PasteCleanupSettings.prototype, "allowedStyleProps", void 0);
|
|
24077
24125
|
__decorate$2([
|
|
24078
24126
|
Property(null)
|
|
@@ -24537,7 +24585,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
24537
24585
|
currentParent = _this.startNode;
|
|
24538
24586
|
}
|
|
24539
24587
|
var currentParentLastChild = currentParent.lastChild;
|
|
24540
|
-
while (!isNullOrUndefined(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text')) {
|
|
24588
|
+
while (!isNullOrUndefined(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text' || currentParentLastChild.nodeName === 'BR')) {
|
|
24541
24589
|
currentParentLastChild = currentParentLastChild.lastChild;
|
|
24542
24590
|
}
|
|
24543
24591
|
var isLastNodeLength = _this.range.startContainer === currentParentLastChild ?
|
|
@@ -24546,9 +24594,16 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
24546
24594
|
_this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
|
|
24547
24595
|
_this.range.startOffset === _this.range.endOffset &&
|
|
24548
24596
|
_this.range.startOffset === isLastNodeLength) {
|
|
24549
|
-
var
|
|
24550
|
-
|
|
24551
|
-
|
|
24597
|
+
var focusBRElem = _this.parent.createElement('br');
|
|
24598
|
+
if (currentParentLastChild.nodeName === 'BR' && currentParent.textContent.length === 0) {
|
|
24599
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, currentParentLastChild);
|
|
24600
|
+
}
|
|
24601
|
+
else {
|
|
24602
|
+
var lineBreakBRElem = _this.parent.createElement('br');
|
|
24603
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, _this.range.startContainer);
|
|
24604
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(lineBreakBRElem, _this.range.startContainer);
|
|
24605
|
+
}
|
|
24606
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), focusBRElem, 0);
|
|
24552
24607
|
}
|
|
24553
24608
|
else if (!isNullOrUndefined(currentParent) && currentParent !== _this.parent.inputElement && currentParent.nodeName !== 'BR') {
|
|
24554
24609
|
if (currentParent.textContent.trim().length === 0 || (currentParent.textContent.trim().length === 1 &&
|
|
@@ -26436,7 +26491,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
26436
26491
|
this.isRTE = false;
|
|
26437
26492
|
}
|
|
26438
26493
|
this.notify(docClick, { args: e });
|
|
26439
|
-
if (e.detail > 3) {
|
|
26494
|
+
if (Browser.info.name !== 'msie' && e.detail > 3) {
|
|
26440
26495
|
e.preventDefault();
|
|
26441
26496
|
}
|
|
26442
26497
|
};
|