@syncfusion/ej2-richtexteditor 20.3.59 → 20.3.60

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.
@@ -1971,8 +1971,8 @@ var videoAlignItems = [
1971
1971
  { iconCss: 'e-icons e-justify-right', command: 'Videos', subCommand: 'JustifyRight' },
1972
1972
  ];
1973
1973
  var displayLocale = [
1974
- { locale: 'imageLayoutOptionDropDownInline', value: 'Inline' },
1975
- { locale: 'imageLayoutOptionDropDownBreak', value: 'Break' }
1974
+ { locale: 'imageDisplayDropDownInline', value: 'Inline' },
1975
+ { locale: 'imageDisplayDropDownBreak', value: 'Break' }
1976
1976
  ];
1977
1977
  var audioLayoutOptionLocale = [
1978
1978
  { locale: 'audioLayoutOptionDropDownInline', value: 'Inline' },
@@ -13058,7 +13058,8 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
13058
13058
  }
13059
13059
  }
13060
13060
  else if (currentNode.nodeName === '#text' && !isNullOrUndefined(currentNode.parentElement) &&
13061
- currentNode.parentElement.nodeName === 'LI' && currentNode.parentElement.textContent.trim().length > 0) {
13061
+ (currentNode.parentElement.nodeName === 'LI' || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
13062
+ currentNode.parentElement.textContent.trim().length > 0) {
13062
13063
  splitedElm = currentNode;
13063
13064
  if (currentNode.parentElement.nodeName === 'LI' && !isNullOrUndefined(currentNode.nextSibling) &&
13064
13065
  currentNode.nextSibling.nodeName === 'BR') {
@@ -15684,6 +15685,15 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
15684
15685
  isSubSup = formatNode === null ? false : true;
15685
15686
  }
15686
15687
  }
15688
+ else if (formatNode.textContent !== nodes[index].textContent && formatNode.nodeName === 'SPAN' && formatNode.style[0] === 'font-size') {
15689
+ var currentParentElem = nodes[index].parentElement.textContent !== nodes[index].textContent ? nodes[index] : nodes[index].parentElement;
15690
+ var isSameTextContent = true;
15691
+ while (currentParentElem.textContent !== nodes[index].textContent && nodes[index].style[0] !== format && currentParentElem.nodeName === 'SPAN') {
15692
+ isSameTextContent = currentParentElem.textContent === currentParentElem.parentElement.textContent;
15693
+ currentParentElem = !isNullOrUndefined(currentParentElem.parentElement) && isSameTextContent ? currentParentElem.parentElement : currentParentElem;
15694
+ }
15695
+ formatNode = currentParentElem;
15696
+ }
15687
15697
  if (index === 0 && formatNode === null) {
15688
15698
  isFormat = true;
15689
15699
  }
@@ -15975,7 +15985,33 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
15975
15985
  liElement.style.textDecoration = 'inherit';
15976
15986
  }
15977
15987
  }
15978
- nodes[index] = this.applyStyles(nodes, index, element);
15988
+ var enterType = isNullOrUndefined(this.enterAction) ? 'P' : this.enterAction.toString();
15989
+ var currentNode = nodes[index];
15990
+ var isNestedNode = !isNullOrUndefined(currentNode) && nodes[index].nodeName === '#text' && nodes[index].parentElement.nodeName !== enterType;
15991
+ var currentParentElem = currentNode.parentElement.textContent !== currentNode.textContent ? currentNode : currentNode.parentElement;
15992
+ if (isNestedNode) {
15993
+ var isSameTextContent = true;
15994
+ isNestedNode = false;
15995
+ while (!isNullOrUndefined(currentParentElem) && isSameTextContent && currentParentElem.parentElement.nodeName !== enterType
15996
+ && (currentParentElem.nodeName === 'SPAN' && (currentParentElem.style.textDecoration === 'line-through' || 'underline')
15997
+ || currentParentElem.nodeName === 'SPAN' && (currentParentElem.style[0] === 'background-color' || 'font-family' || 'color')
15998
+ || (currentParentElem.nodeName === 'EM' || 'STRONG' || 'SUB' || 'SUP'))) {
15999
+ isSameTextContent = currentParentElem.textContent === currentParentElem.parentElement.textContent;
16000
+ currentParentElem = !isNullOrUndefined(currentParentElem.parentElement) && isSameTextContent ? currentParentElem.parentElement : currentParentElem;
16001
+ }
16002
+ if (!isNullOrUndefined(currentParentElem) && currentParentElem.childNodes.length > 0) {
16003
+ var nodeList = currentParentElem.querySelectorAll('span,strong,em,sub,sup');
16004
+ isNestedNode = nodeList.length > 0 && isSameTextContent;
16005
+ }
16006
+ }
16007
+ if (isNestedNode) {
16008
+ var nodeList = [];
16009
+ nodeList[0] = currentParentElem;
16010
+ this.applyStyles(nodeList, index, element);
16011
+ }
16012
+ else {
16013
+ nodes[index] = this.applyStyles(nodes, index, element);
16014
+ }
15979
16015
  if (format === 'fontsize') {
15980
16016
  var bg = closest(nodes[index].parentElement, 'span[style*=' + 'background-color' + ']');
15981
16017
  if (!isNullOrUndefined(bg)) {
@@ -16944,7 +16980,9 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
16944
16980
  for (var i = 0; i < allElements.length; i++) {
16945
16981
  if (allElements[i].children.length === 0 && allElements[i].innerHTML === '&nbsp;' &&
16946
16982
  (allElements[i].innerHTML === '&nbsp;' && !allElements[i].closest('li')) &&
16947
- !allElements[i].closest('td')) {
16983
+ !allElements[i].closest('td') && (allElements[i].nodeName !== 'SPAN' ||
16984
+ allElements[i].nodeName === 'SPAN' && (isNullOrUndefined(allElements[i].previousElementSibling) &&
16985
+ isNullOrUndefined(allElements[i].nextElementSibling)))) {
16948
16986
  var detachableElement = this.findDetachElem(allElements[i]);
16949
16987
  var brElement = createElement('br');
16950
16988
  if (!isNullOrUndefined(detachableElement.parentElement)) {
@@ -28601,7 +28639,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
28601
28639
  }
28602
28640
  else {
28603
28641
  if ((nearBlockNode.textContent.trim().length !== 0 ||
28604
- nearBlockNode.childNodes[0].nodeName === 'IMG')) {
28642
+ nearBlockNode.childNodes[0].nodeName === 'IMG' ||
28643
+ (nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img').length > 0))) {
28605
28644
  if ((_this.range.startOffset === _this.range.endOffset && _this.range.startOffset != 0)) {
28606
28645
  newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
28607
28646
  }