@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
|
@@ -2965,7 +2965,7 @@ class ToolbarRenderer {
|
|
|
2965
2965
|
* @hidden
|
|
2966
2966
|
* @deprecated
|
|
2967
2967
|
*/
|
|
2968
|
-
renderColorPickerDropDown(args, item, colorPicker) {
|
|
2968
|
+
renderColorPickerDropDown(args, item, colorPicker, defaultColor) {
|
|
2969
2969
|
// eslint-disable-next-line
|
|
2970
2970
|
const proxy = this;
|
|
2971
2971
|
let css = CLS_RTE_ELEMENTS + ' ' + CLS_TB_BTN + ((this.parent.inlineMode) ? (' ' + CLS_INLINE_DROPDOWN) : '');
|
|
@@ -2973,8 +2973,9 @@ class ToolbarRenderer {
|
|
|
2973
2973
|
const content = proxy.parent.createElement('span', { className: CLS_COLOR_CONTENT });
|
|
2974
2974
|
const inlineEle = proxy.parent.createElement('span', { className: args.cssClass });
|
|
2975
2975
|
let range;
|
|
2976
|
+
let initialBackgroundColor = (isNullOrUndefined(defaultColor)) ? proxy.parent.backgroundColor.default : defaultColor;
|
|
2976
2977
|
inlineEle.style.borderBottomColor = (item === 'backgroundcolor') ?
|
|
2977
|
-
|
|
2978
|
+
initialBackgroundColor : proxy.parent.fontColor.default;
|
|
2978
2979
|
content.appendChild(inlineEle);
|
|
2979
2980
|
const dropDown = new DropDownButton({
|
|
2980
2981
|
target: colorPicker.element.parentElement, cssClass: css,
|
|
@@ -4987,7 +4988,7 @@ class ColorPickerInput {
|
|
|
4987
4988
|
target: (targetID)
|
|
4988
4989
|
};
|
|
4989
4990
|
this.backgroundColorPicker = this.toolbarRenderer.renderColorPicker(options, 'backgroundcolor');
|
|
4990
|
-
this.backgroundColorDropDown = this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', this.backgroundColorPicker);
|
|
4991
|
+
this.backgroundColorDropDown = this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', this.backgroundColorPicker, this.defaultColorPicker);
|
|
4991
4992
|
break;
|
|
4992
4993
|
}
|
|
4993
4994
|
}
|
|
@@ -5022,6 +5023,7 @@ class ColorPickerInput {
|
|
|
5022
5023
|
if (this.backgroundColorDropDown && !this.backgroundColorDropDown.isDestroyed) {
|
|
5023
5024
|
const innerEle = this.backgroundColorDropDown.element.querySelector('.e-rte-color-content');
|
|
5024
5025
|
if (innerEle) {
|
|
5026
|
+
this.defaultColorPicker = innerEle.children[0].style.borderBottomColor;
|
|
5025
5027
|
detach(innerEle);
|
|
5026
5028
|
}
|
|
5027
5029
|
this.backgroundColorDropDown.destroy();
|
|
@@ -10466,8 +10468,9 @@ class Lists {
|
|
|
10466
10468
|
testCurrentList(range) {
|
|
10467
10469
|
const olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
|
|
10468
10470
|
if (!isNullOrUndefined(range.startContainer.textContent.slice(0, range.startOffset))) {
|
|
10471
|
+
const currentContent = range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim();
|
|
10469
10472
|
for (let i = 0; i < olListStartRegex.length; i++) {
|
|
10470
|
-
if (olListStartRegex[i].test(
|
|
10473
|
+
if (olListStartRegex[i].test(currentContent) && currentContent.length === 2) {
|
|
10471
10474
|
return true;
|
|
10472
10475
|
}
|
|
10473
10476
|
}
|
|
@@ -10509,7 +10512,8 @@ class Lists {
|
|
|
10509
10512
|
range.startContainer.parentElement.closest('LI');
|
|
10510
10513
|
const endNode = range.endContainer.nodeName === 'LI' ? range.endContainer :
|
|
10511
10514
|
range.endContainer.parentElement.closest('LI');
|
|
10512
|
-
if (!isNullOrUndefined(startNode) && !isNullOrUndefined(endNode) && startNode === endNode && startNode.tagName === 'LI' &&
|
|
10515
|
+
if (!isNullOrUndefined(startNode) && !isNullOrUndefined(endNode) && startNode === endNode && startNode.tagName === 'LI' &&
|
|
10516
|
+
startNode.textContent.trim() === '' && startNode.querySelectorAll('IMG').length === 0) {
|
|
10513
10517
|
if (startNode.textContent.charCodeAt(0) === 65279) {
|
|
10514
10518
|
startNode.textContent = '';
|
|
10515
10519
|
}
|
|
@@ -12129,8 +12133,9 @@ class InsertHtml {
|
|
|
12129
12133
|
}
|
|
12130
12134
|
static getNodeCollection(range, nodeSelection, node) {
|
|
12131
12135
|
let nodes = [];
|
|
12132
|
-
if (range.startOffset === range.endOffset && range.startContainer === range.endContainer
|
|
12133
|
-
|
|
12136
|
+
if (range.startOffset === range.endOffset && range.startContainer === range.endContainer &&
|
|
12137
|
+
range.startContainer.nodeName != 'BR' &&
|
|
12138
|
+
(range.startContainer.nodeName === 'TD' || (range.startContainer.nodeType !== 3 &&
|
|
12134
12139
|
node.classList && node.classList.contains('pasteContent')))) {
|
|
12135
12140
|
nodes.push(range.startContainer.childNodes[range.endOffset]);
|
|
12136
12141
|
}
|
|
@@ -14485,6 +14490,9 @@ class SelectionCommands {
|
|
|
14485
14490
|
}
|
|
14486
14491
|
static removeFormat(nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode) {
|
|
14487
14492
|
let splitNode = null;
|
|
14493
|
+
let startText = range.startContainer.nodeName === '#text' ?
|
|
14494
|
+
range.startContainer.textContent.substring(range.startOffset, range.startContainer.textContent.length) :
|
|
14495
|
+
range.startContainer.textContent;
|
|
14488
14496
|
if (!(range.startContainer === range.endContainer && range.startOffset === 0
|
|
14489
14497
|
&& range.endOffset === range.startContainer.length)) {
|
|
14490
14498
|
const nodeIndex = [];
|
|
@@ -14584,11 +14592,13 @@ class SelectionCommands {
|
|
|
14584
14592
|
for (let num = 0; num < child.length; num++) {
|
|
14585
14593
|
if (child[num].nodeType !== 3 || (child[num].textContent && child[num].textContent.trim().length > 0)) {
|
|
14586
14594
|
child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
|
|
14587
|
-
if (num ===
|
|
14588
|
-
|
|
14589
|
-
|
|
14590
|
-
|
|
14591
|
-
|
|
14595
|
+
if (child[num].textContent === startText) {
|
|
14596
|
+
if (num === 0) {
|
|
14597
|
+
range.setStartBefore(child[num]);
|
|
14598
|
+
}
|
|
14599
|
+
else if (num === child.length - 1) {
|
|
14600
|
+
range.setEndAfter(child[num]);
|
|
14601
|
+
}
|
|
14592
14602
|
}
|
|
14593
14603
|
}
|
|
14594
14604
|
}
|
|
@@ -15843,8 +15853,10 @@ class MsWordPaste {
|
|
|
15843
15853
|
this.listContents = [];
|
|
15844
15854
|
this.getListContent(listNodes[i]);
|
|
15845
15855
|
let type;
|
|
15856
|
+
let listStyleType;
|
|
15846
15857
|
if (!isNullOrUndefined(this.listContents[0])) {
|
|
15847
15858
|
type = this.listContents[0].trim().length > 1 ? 'ol' : 'ul';
|
|
15859
|
+
listStyleType = this.getlistStyleType(this.listContents[0], type);
|
|
15848
15860
|
const tempNode = [];
|
|
15849
15861
|
for (let j = 1; j < this.listContents.length; j++) {
|
|
15850
15862
|
tempNode.push(this.listContents[j]);
|
|
@@ -15861,7 +15873,7 @@ class MsWordPaste {
|
|
|
15861
15873
|
}
|
|
15862
15874
|
}
|
|
15863
15875
|
collection.push({ listType: type, content: tempNode, nestedLevel: level, class: currentClassName,
|
|
15864
|
-
listStyle: currentListStyle });
|
|
15876
|
+
listStyle: currentListStyle, listStyleTypeName: listStyleType });
|
|
15865
15877
|
}
|
|
15866
15878
|
}
|
|
15867
15879
|
stNode = listNodes.shift();
|
|
@@ -15885,6 +15897,45 @@ class MsWordPaste {
|
|
|
15885
15897
|
}
|
|
15886
15898
|
}
|
|
15887
15899
|
}
|
|
15900
|
+
getlistStyleType(listContent, type) {
|
|
15901
|
+
let currentListClass;
|
|
15902
|
+
if (type === 'ol') {
|
|
15903
|
+
switch (listContent.split('.')[0]) {
|
|
15904
|
+
case "A":
|
|
15905
|
+
currentListClass = "upper-alpha";
|
|
15906
|
+
break;
|
|
15907
|
+
case "a":
|
|
15908
|
+
currentListClass = "lower-alpha";
|
|
15909
|
+
break;
|
|
15910
|
+
case "I":
|
|
15911
|
+
currentListClass = "upper-roman";
|
|
15912
|
+
break;
|
|
15913
|
+
case "i":
|
|
15914
|
+
currentListClass = "lower-roman";
|
|
15915
|
+
break;
|
|
15916
|
+
case "α":
|
|
15917
|
+
currentListClass = "lower-greek";
|
|
15918
|
+
break;
|
|
15919
|
+
default:
|
|
15920
|
+
currentListClass = "decimal";
|
|
15921
|
+
break;
|
|
15922
|
+
}
|
|
15923
|
+
}
|
|
15924
|
+
else {
|
|
15925
|
+
switch (listContent.split('.')[0]) {
|
|
15926
|
+
case "o":
|
|
15927
|
+
currentListClass = "circle";
|
|
15928
|
+
break;
|
|
15929
|
+
case "§":
|
|
15930
|
+
currentListClass = "square";
|
|
15931
|
+
break;
|
|
15932
|
+
default:
|
|
15933
|
+
currentListClass = "disc";
|
|
15934
|
+
break;
|
|
15935
|
+
}
|
|
15936
|
+
}
|
|
15937
|
+
return currentListClass;
|
|
15938
|
+
}
|
|
15888
15939
|
makeConversion(collection) {
|
|
15889
15940
|
const root = createElement('div');
|
|
15890
15941
|
let temp;
|
|
@@ -15901,7 +15952,7 @@ class MsWordPaste {
|
|
|
15901
15952
|
prevList.appendChild(pElement);
|
|
15902
15953
|
temp.appendChild(prevList);
|
|
15903
15954
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
15904
|
-
temp.style.
|
|
15955
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
15905
15956
|
}
|
|
15906
15957
|
else if (collection[index].nestedLevel === pLevel) {
|
|
15907
15958
|
if (prevList.parentElement.tagName.toLowerCase() === collection[index].listType) {
|
|
@@ -15910,6 +15961,7 @@ class MsWordPaste {
|
|
|
15910
15961
|
}
|
|
15911
15962
|
else {
|
|
15912
15963
|
temp = createElement(collection[index].listType);
|
|
15964
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
15913
15965
|
prevList.parentElement.parentElement.appendChild(temp);
|
|
15914
15966
|
prevList = createElement('li');
|
|
15915
15967
|
prevList.appendChild(pElement);
|
|
@@ -15921,14 +15973,15 @@ class MsWordPaste {
|
|
|
15921
15973
|
if (!isNullOrUndefined(prevList)) {
|
|
15922
15974
|
for (let j = 0; j < collection[index].nestedLevel - pLevel; j++) {
|
|
15923
15975
|
prevList.appendChild(temp = createElement(collection[index].listType));
|
|
15924
|
-
prevList = createElement('li'
|
|
15976
|
+
prevList = createElement('li');
|
|
15977
|
+
if (j != collection[index].nestedLevel - pLevel - 1 && collection[index].nestedLevel - pLevel > 1) {
|
|
15978
|
+
prevList.style.listStyleType = "none";
|
|
15979
|
+
}
|
|
15925
15980
|
temp.appendChild(prevList);
|
|
15926
15981
|
}
|
|
15927
15982
|
prevList.appendChild(pElement);
|
|
15928
15983
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
15929
|
-
temp.style.
|
|
15930
|
-
temp.childNodes[0].style.listStyle =
|
|
15931
|
-
this.getListStyle(collection[index].listType, collection[index].nestedLevel);
|
|
15984
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
15932
15985
|
}
|
|
15933
15986
|
else {
|
|
15934
15987
|
root.appendChild(temp = createElement(collection[index].listType));
|
|
@@ -15936,7 +15989,7 @@ class MsWordPaste {
|
|
|
15936
15989
|
prevList.appendChild(pElement);
|
|
15937
15990
|
temp.appendChild(prevList);
|
|
15938
15991
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
15939
|
-
temp.style.
|
|
15992
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
15940
15993
|
}
|
|
15941
15994
|
}
|
|
15942
15995
|
else if (collection[index].nestedLevel === 1) {
|
|
@@ -15945,12 +15998,12 @@ class MsWordPaste {
|
|
|
15945
15998
|
}
|
|
15946
15999
|
else {
|
|
15947
16000
|
root.appendChild(temp = createElement(collection[index].listType));
|
|
16001
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
15948
16002
|
}
|
|
15949
16003
|
prevList = createElement('li');
|
|
15950
16004
|
prevList.appendChild(pElement);
|
|
15951
16005
|
temp.appendChild(prevList);
|
|
15952
16006
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
15953
|
-
temp.style.listStyle = this.getListStyle(collection[index].listType, collection[index].nestedLevel);
|
|
15954
16007
|
}
|
|
15955
16008
|
else {
|
|
15956
16009
|
elem = prevList;
|
|
@@ -15971,7 +16024,7 @@ class MsWordPaste {
|
|
|
15971
16024
|
prevList.appendChild(pElement);
|
|
15972
16025
|
temp.appendChild(prevList);
|
|
15973
16026
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
15974
|
-
temp.style.
|
|
16027
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
15975
16028
|
break;
|
|
15976
16029
|
}
|
|
15977
16030
|
}
|
|
@@ -15980,21 +16033,12 @@ class MsWordPaste {
|
|
|
15980
16033
|
}
|
|
15981
16034
|
prevList.setAttribute('class', collection[index].class);
|
|
15982
16035
|
const currentStyle = prevList.getAttribute('style');
|
|
15983
|
-
prevList.setAttribute('style', (!isNullOrUndefined(currentStyle) ? currentStyle : '')
|
|
16036
|
+
prevList.setAttribute('style', (!isNullOrUndefined(currentStyle) ? currentStyle : ''));
|
|
15984
16037
|
pLevel = collection[index].nestedLevel;
|
|
15985
16038
|
listCount++;
|
|
15986
16039
|
}
|
|
15987
16040
|
return root;
|
|
15988
16041
|
}
|
|
15989
|
-
getListStyle(listType, nestedLevel) {
|
|
15990
|
-
nestedLevel = (nestedLevel > 0) ? nestedLevel - 1 : nestedLevel;
|
|
15991
|
-
if (listType === 'ol') {
|
|
15992
|
-
return (nestedLevel < this.olData.length ? this.olData[nestedLevel] : this.olData[0]);
|
|
15993
|
-
}
|
|
15994
|
-
else {
|
|
15995
|
-
return (nestedLevel < this.ulData.length ? this.ulData[nestedLevel] : this.ulData[0]);
|
|
15996
|
-
}
|
|
15997
|
-
}
|
|
15998
16042
|
getListContent(elem) {
|
|
15999
16043
|
let pushContent = '';
|
|
16000
16044
|
const firstChild = elem.firstElementChild;
|
|
@@ -17302,8 +17346,9 @@ class HtmlEditor {
|
|
|
17302
17346
|
if (this.rangeElement.tagName === 'OL' || this.rangeElement.tagName === 'UL') {
|
|
17303
17347
|
const liElement = this.getRangeLiNode(currentRange.startContainer);
|
|
17304
17348
|
if (liElement.previousElementSibling && liElement.previousElementSibling.childElementCount > 0) {
|
|
17305
|
-
this.oldRangeElement = liElement.previousElementSibling.lastElementChild
|
|
17306
|
-
|
|
17349
|
+
this.oldRangeElement = liElement.previousElementSibling.lastElementChild.nodeName === 'BR' ?
|
|
17350
|
+
liElement.previousElementSibling : liElement.previousElementSibling.lastElementChild;
|
|
17351
|
+
if (!isNullOrUndefined(liElement.lastElementChild) && liElement.lastElementChild.nodeName !== 'BR') {
|
|
17307
17352
|
this.rangeElement = liElement.lastElementChild;
|
|
17308
17353
|
isLiElement = true;
|
|
17309
17354
|
}
|
|
@@ -20099,7 +20144,7 @@ class Image {
|
|
|
20099
20144
|
left: elem.offsetLeft
|
|
20100
20145
|
};
|
|
20101
20146
|
}
|
|
20102
|
-
setAspectRatio(img, expectedX, expectedY) {
|
|
20147
|
+
setAspectRatio(img, expectedX, expectedY, e) {
|
|
20103
20148
|
if (isNullOrUndefined(img.width)) {
|
|
20104
20149
|
return;
|
|
20105
20150
|
}
|
|
@@ -20153,7 +20198,7 @@ class Image {
|
|
|
20153
20198
|
img.style.height = (height / width * expectedX) + 'px';
|
|
20154
20199
|
}
|
|
20155
20200
|
else {
|
|
20156
|
-
img.setAttribute('width', expectedX.toString());
|
|
20201
|
+
img.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - img.getBoundingClientRect().left).toString() : expectedX.toString());
|
|
20157
20202
|
}
|
|
20158
20203
|
}
|
|
20159
20204
|
else {
|
|
@@ -20193,7 +20238,7 @@ class Image {
|
|
|
20193
20238
|
return;
|
|
20194
20239
|
}
|
|
20195
20240
|
this.imgEle.parentElement.style.cursor = 'pointer';
|
|
20196
|
-
this.setAspectRatio(this.imgEle, parseInt(width, 10), parseInt(height, 10));
|
|
20241
|
+
this.setAspectRatio(this.imgEle, parseInt(width, 10), parseInt(height, 10), args);
|
|
20197
20242
|
this.resizeImgDupPos(this.imgEle);
|
|
20198
20243
|
this.imgResizePos(this.imgEle, this.imgResizeDiv);
|
|
20199
20244
|
this.parent.setContentHeight('', false);
|
|
@@ -20238,7 +20283,8 @@ class Image {
|
|
|
20238
20283
|
}
|
|
20239
20284
|
resizeImgDupPos(e) {
|
|
20240
20285
|
this.imgDupPos = {
|
|
20241
|
-
width: (e.style.width !== ''
|
|
20286
|
+
width: (e.style.width !== '' && (this.parent.insertImageSettings &&
|
|
20287
|
+
!this.parent.insertImageSettings.resizeByPercent)) ? this.imgEle.style.width : e.width + 'px',
|
|
20242
20288
|
height: (e.style.height !== '') ? this.imgEle.style.height : e.height + 'px'
|
|
20243
20289
|
};
|
|
20244
20290
|
}
|
|
@@ -20406,26 +20452,28 @@ class Image {
|
|
|
20406
20452
|
const src = this.deletedImg[i].src;
|
|
20407
20453
|
this.imageRemovePost(src);
|
|
20408
20454
|
}
|
|
20409
|
-
if (
|
|
20410
|
-
if (
|
|
20411
|
-
if (
|
|
20412
|
-
range.startContainer.previousElementSibling.
|
|
20413
|
-
|
|
20414
|
-
|
|
20455
|
+
if (this.parent.editorMode !== 'Markdown') {
|
|
20456
|
+
if (range.startContainer.nodeType === 3) {
|
|
20457
|
+
if (originalEvent.code === 'Backspace') {
|
|
20458
|
+
if (range.startContainer.previousElementSibling && range.startOffset === 0 &&
|
|
20459
|
+
range.startContainer.previousElementSibling.classList.contains(CLS_CAPTION) &&
|
|
20460
|
+
range.startContainer.previousElementSibling.classList.contains(CLS_CAPINLINE)) {
|
|
20461
|
+
detach(range.startContainer.previousElementSibling);
|
|
20462
|
+
}
|
|
20415
20463
|
}
|
|
20416
|
-
|
|
20417
|
-
|
|
20418
|
-
|
|
20419
|
-
|
|
20420
|
-
|
|
20421
|
-
|
|
20422
|
-
|
|
20464
|
+
else {
|
|
20465
|
+
if (range.startContainer.nextElementSibling &&
|
|
20466
|
+
range.endContainer.textContent.length === range.endOffset &&
|
|
20467
|
+
range.startContainer.nextElementSibling.classList.contains(CLS_CAPTION) &&
|
|
20468
|
+
range.startContainer.nextElementSibling.classList.contains(CLS_CAPINLINE)) {
|
|
20469
|
+
detach(range.startContainer.nextElementSibling);
|
|
20470
|
+
}
|
|
20423
20471
|
}
|
|
20424
20472
|
}
|
|
20425
|
-
|
|
20426
|
-
|
|
20427
|
-
|
|
20428
|
-
|
|
20473
|
+
else if ((range.startContainer.nodeType === 1 &&
|
|
20474
|
+
range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_CAPINLINE))) {
|
|
20475
|
+
detach(range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_CAPINLINE));
|
|
20476
|
+
}
|
|
20429
20477
|
}
|
|
20430
20478
|
break;
|
|
20431
20479
|
case 'insert-image':
|
|
@@ -23907,7 +23955,7 @@ __decorate$2([
|
|
|
23907
23955
|
Property(null)
|
|
23908
23956
|
], PasteCleanupSettings.prototype, "deniedAttrs", void 0);
|
|
23909
23957
|
__decorate$2([
|
|
23910
|
-
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'])
|
|
23958
|
+
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'])
|
|
23911
23959
|
], PasteCleanupSettings.prototype, "allowedStyleProps", void 0);
|
|
23912
23960
|
__decorate$2([
|
|
23913
23961
|
Property(null)
|
|
@@ -24293,7 +24341,7 @@ class EnterKeyAction {
|
|
|
24293
24341
|
currentParent = this.startNode;
|
|
24294
24342
|
}
|
|
24295
24343
|
let currentParentLastChild = currentParent.lastChild;
|
|
24296
|
-
while (!isNullOrUndefined(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text')) {
|
|
24344
|
+
while (!isNullOrUndefined(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text' || currentParentLastChild.nodeName === 'BR')) {
|
|
24297
24345
|
currentParentLastChild = currentParentLastChild.lastChild;
|
|
24298
24346
|
}
|
|
24299
24347
|
const isLastNodeLength = this.range.startContainer === currentParentLastChild ?
|
|
@@ -24302,9 +24350,16 @@ class EnterKeyAction {
|
|
|
24302
24350
|
this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
|
|
24303
24351
|
this.range.startOffset === this.range.endOffset &&
|
|
24304
24352
|
this.range.startOffset === isLastNodeLength) {
|
|
24305
|
-
const
|
|
24306
|
-
|
|
24307
|
-
|
|
24353
|
+
const focusBRElem = this.parent.createElement('br');
|
|
24354
|
+
if (currentParentLastChild.nodeName === 'BR' && currentParent.textContent.length === 0) {
|
|
24355
|
+
this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, currentParentLastChild);
|
|
24356
|
+
}
|
|
24357
|
+
else {
|
|
24358
|
+
const lineBreakBRElem = this.parent.createElement('br');
|
|
24359
|
+
this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, this.range.startContainer);
|
|
24360
|
+
this.parent.formatter.editorManager.domNode.insertAfter(lineBreakBRElem, this.range.startContainer);
|
|
24361
|
+
}
|
|
24362
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), focusBRElem, 0);
|
|
24308
24363
|
}
|
|
24309
24364
|
else if (!isNullOrUndefined(currentParent) && currentParent !== this.parent.inputElement && currentParent.nodeName !== 'BR') {
|
|
24310
24365
|
if (currentParent.textContent.trim().length === 0 || (currentParent.textContent.trim().length === 1 &&
|
|
@@ -26162,7 +26217,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
26162
26217
|
this.isRTE = false;
|
|
26163
26218
|
}
|
|
26164
26219
|
this.notify(docClick, { args: e });
|
|
26165
|
-
if (e.detail > 3) {
|
|
26220
|
+
if (Browser.info.name !== 'msie' && e.detail > 3) {
|
|
26166
26221
|
e.preventDefault();
|
|
26167
26222
|
}
|
|
26168
26223
|
}
|