@syncfusion/ej2-richtexteditor 20.4.51 → 20.4.52

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.
@@ -16968,7 +16968,10 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
16968
16968
  this.checkVShape(elm);
16969
16969
  var imgElem = elm.querySelectorAll('img');
16970
16970
  for (var i = 0; i < imgElem.length; i++) {
16971
- if (!isNullOrUndefined(imgElem[i].getAttribute('v:shapes')) && imgElem[i].getAttribute('v:shapes').indexOf('Picture') < 0 && imgElem[i].getAttribute('v:shapes').indexOf('Image') < 0) {
16971
+ if (!isNullOrUndefined(imgElem[i].getAttribute('v:shapes')) &&
16972
+ imgElem[i].getAttribute('v:shapes').indexOf('Picture') < 0 &&
16973
+ imgElem[i].getAttribute('v:shapes').indexOf('圖片') < 0 &&
16974
+ imgElem[i].getAttribute('v:shapes').indexOf('Image') < 0) {
16972
16975
  detach(imgElem[i]);
16973
16976
  }
16974
16977
  }
@@ -18009,7 +18012,7 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
18009
18012
  formatCollection.fontname = this.isFontName(docElement, node, fontName);
18010
18013
  }
18011
18014
  if (!formatCollection.fontsize) {
18012
- formatCollection.fontsize = this.isFontSize(node, fontSize);
18015
+ formatCollection.fontsize = this.isFontSize(docElement, node, fontSize);
18013
18016
  }
18014
18017
  if (!formatCollection.backgroundcolor) {
18015
18018
  formatCollection.backgroundcolor = this.isBackgroundColor(node);
@@ -18069,8 +18072,12 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
18069
18072
  return null;
18070
18073
  }
18071
18074
  };
18072
- ToolbarStatus.isFontSize = function (node, fontSize) {
18075
+ ToolbarStatus.isFontSize = function (docElement, node, fontSize) {
18073
18076
  var size = node.style && node.style.fontSize;
18077
+ if ((size === null || size === undefined || size === '') && node.nodeType !== 3 &&
18078
+ node.parentElement.classList.contains('e-content')) {
18079
+ size = this.getComputedStyle(docElement, node, 'font-size');
18080
+ }
18074
18081
  if ((size !== null && size !== '' && size !== undefined)
18075
18082
  && (fontSize === null || fontSize === undefined || (fontSize.indexOf(size) > -1))) {
18076
18083
  return size;
@@ -27342,12 +27349,14 @@ var Table = /** @__PURE__ @class */ (function () {
27342
27349
  if ((totalwid - actualwid) > 20 && actualwid > 20) {
27343
27350
  var leftColumnWidth = totalwid - actualwid;
27344
27351
  var rightColWidth = actualwid;
27345
- if (!isNullOrUndefined(_this.curTable.rows[i].cells[_this.colIndex - 1])) {
27346
- _this.curTable.rows[i].cells[_this.colIndex - 1].style.width =
27352
+ var index = _this.curTable.rows[i].cells[i].hasAttribute('colspan') ?
27353
+ parseInt(_this.curTable.rows[i].cells[i].getAttribute('colspan'), 10) - 1 : _this.colIndex;
27354
+ if (!isNullOrUndefined(_this.curTable.rows[i].cells[index - 1])) {
27355
+ _this.curTable.rows[i].cells[index - 1].style.width =
27347
27356
  _this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
27348
27357
  }
27349
- if (!isNullOrUndefined(_this.curTable.rows[i].cells[_this.colIndex])) {
27350
- _this.curTable.rows[i].cells[_this.colIndex].style.width =
27358
+ if (!isNullOrUndefined(_this.curTable.rows[i].cells[index])) {
27359
+ _this.curTable.rows[i].cells[index].style.width =
27351
27360
  _this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
27352
27361
  }
27353
27362
  }
@@ -29005,7 +29014,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
29005
29014
  }
29006
29015
  _this.removeBRElement(currentParent);
29007
29016
  var currentParentLastChild = currentParent.lastChild;
29008
- while (!isNullOrUndefined(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text' || currentParentLastChild.nodeName === 'BR')) {
29017
+ while (!isNullOrUndefined(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text' || currentParentLastChild.nodeName === 'BR'
29018
+ || currentParentLastChild.nodeName === 'IMG')) {
29009
29019
  currentParentLastChild = currentParentLastChild.lastChild;
29010
29020
  }
29011
29021
  var isLastNodeLength = _this.range.startContainer === currentParentLastChild ?
@@ -29013,7 +29023,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
29013
29023
  if (currentParent !== _this.parent.inputElement &&
29014
29024
  _this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
29015
29025
  _this.range.startOffset === _this.range.endOffset &&
29016
- _this.range.startOffset === isLastNodeLength) {
29026
+ (_this.range.startOffset === isLastNodeLength ||
29027
+ (currentParent.textContent.trim().length === 0 && currentParent.lastChild.nodeName === 'IMG'))) {
29017
29028
  var focusBRElem = _this.parent.createElement('br');
29018
29029
  if (_this.range.startOffset === 0 && _this.range.startContainer.nodeName === 'TABLE') {
29019
29030
  _this.range.startContainer.parentElement.insertBefore(focusBRElem, _this.range.startContainer);
@@ -29022,6 +29033,11 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
29022
29033
  if (currentParentLastChild.nodeName === 'BR' && currentParent.textContent.length === 0) {
29023
29034
  _this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, currentParentLastChild);
29024
29035
  }
29036
+ else if (_this.range.startOffset === 0 && _this.range.endOffset === 0 &&
29037
+ currentParent.lastChild && currentParent.lastChild.nodeName === 'IMG') {
29038
+ currentParentLastChild.parentElement.insertBefore(focusBRElem, currentParentLastChild);
29039
+ focusBRElem = currentParentLastChild;
29040
+ }
29025
29041
  else {
29026
29042
  var lineBreakBRElem = _this.parent.createElement('br');
29027
29043
  _this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, _this.range.startContainer);
@@ -31108,7 +31124,9 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
31108
31124
  this.notify(windowResize, null);
31109
31125
  };
31110
31126
  RichTextEditor.prototype.scrollHandler = function (e) {
31111
- this.notify(scroll, { args: e });
31127
+ if (this.element) {
31128
+ this.notify(scroll, { args: e });
31129
+ }
31112
31130
  };
31113
31131
  RichTextEditor.prototype.contentScrollHandler = function (e) {
31114
31132
  this.notify(contentscroll, { args: e });