@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.
@@ -16842,7 +16842,10 @@ class MsWordPaste {
16842
16842
  this.checkVShape(elm);
16843
16843
  let imgElem = elm.querySelectorAll('img');
16844
16844
  for (let i = 0; i < imgElem.length; i++) {
16845
- if (!isNullOrUndefined(imgElem[i].getAttribute('v:shapes')) && imgElem[i].getAttribute('v:shapes').indexOf('Picture') < 0 && imgElem[i].getAttribute('v:shapes').indexOf('Image') < 0) {
16845
+ if (!isNullOrUndefined(imgElem[i].getAttribute('v:shapes')) &&
16846
+ imgElem[i].getAttribute('v:shapes').indexOf('Picture') < 0 &&
16847
+ imgElem[i].getAttribute('v:shapes').indexOf('圖片') < 0 &&
16848
+ imgElem[i].getAttribute('v:shapes').indexOf('Image') < 0) {
16846
16849
  detach(imgElem[i]);
16847
16850
  }
16848
16851
  }
@@ -17862,7 +17865,7 @@ class ToolbarStatus {
17862
17865
  formatCollection.fontname = this.isFontName(docElement, node, fontName);
17863
17866
  }
17864
17867
  if (!formatCollection.fontsize) {
17865
- formatCollection.fontsize = this.isFontSize(node, fontSize);
17868
+ formatCollection.fontsize = this.isFontSize(docElement, node, fontSize);
17866
17869
  }
17867
17870
  if (!formatCollection.backgroundcolor) {
17868
17871
  formatCollection.backgroundcolor = this.isBackgroundColor(node);
@@ -17922,8 +17925,12 @@ class ToolbarStatus {
17922
17925
  return null;
17923
17926
  }
17924
17927
  }
17925
- static isFontSize(node, fontSize) {
17926
- const size = node.style && node.style.fontSize;
17928
+ static isFontSize(docElement, node, fontSize) {
17929
+ let size = node.style && node.style.fontSize;
17930
+ if ((size === null || size === undefined || size === '') && node.nodeType !== 3 &&
17931
+ node.parentElement.classList.contains('e-content')) {
17932
+ size = this.getComputedStyle(docElement, node, 'font-size');
17933
+ }
17927
17934
  if ((size !== null && size !== '' && size !== undefined)
17928
17935
  && (fontSize === null || fontSize === undefined || (fontSize.indexOf(size) > -1))) {
17929
17936
  return size;
@@ -27214,12 +27221,14 @@ class Table {
27214
27221
  if ((totalwid - actualwid) > 20 && actualwid > 20) {
27215
27222
  const leftColumnWidth = totalwid - actualwid;
27216
27223
  const rightColWidth = actualwid;
27217
- if (!isNullOrUndefined(this.curTable.rows[i].cells[this.colIndex - 1])) {
27218
- this.curTable.rows[i].cells[this.colIndex - 1].style.width =
27224
+ const index = this.curTable.rows[i].cells[i].hasAttribute('colspan') ?
27225
+ parseInt(this.curTable.rows[i].cells[i].getAttribute('colspan'), 10) - 1 : this.colIndex;
27226
+ if (!isNullOrUndefined(this.curTable.rows[i].cells[index - 1])) {
27227
+ this.curTable.rows[i].cells[index - 1].style.width =
27219
27228
  this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
27220
27229
  }
27221
- if (!isNullOrUndefined(this.curTable.rows[i].cells[this.colIndex])) {
27222
- this.curTable.rows[i].cells[this.colIndex].style.width =
27230
+ if (!isNullOrUndefined(this.curTable.rows[i].cells[index])) {
27231
+ this.curTable.rows[i].cells[index].style.width =
27223
27232
  this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
27224
27233
  }
27225
27234
  }
@@ -28742,7 +28751,8 @@ class EnterKeyAction {
28742
28751
  }
28743
28752
  this.removeBRElement(currentParent);
28744
28753
  let currentParentLastChild = currentParent.lastChild;
28745
- while (!isNullOrUndefined(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text' || currentParentLastChild.nodeName === 'BR')) {
28754
+ while (!isNullOrUndefined(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text' || currentParentLastChild.nodeName === 'BR'
28755
+ || currentParentLastChild.nodeName === 'IMG')) {
28746
28756
  currentParentLastChild = currentParentLastChild.lastChild;
28747
28757
  }
28748
28758
  const isLastNodeLength = this.range.startContainer === currentParentLastChild ?
@@ -28750,8 +28760,9 @@ class EnterKeyAction {
28750
28760
  if (currentParent !== this.parent.inputElement &&
28751
28761
  this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
28752
28762
  this.range.startOffset === this.range.endOffset &&
28753
- this.range.startOffset === isLastNodeLength) {
28754
- const focusBRElem = this.parent.createElement('br');
28763
+ (this.range.startOffset === isLastNodeLength ||
28764
+ (currentParent.textContent.trim().length === 0 && currentParent.lastChild.nodeName === 'IMG'))) {
28765
+ let focusBRElem = this.parent.createElement('br');
28755
28766
  if (this.range.startOffset === 0 && this.range.startContainer.nodeName === 'TABLE') {
28756
28767
  this.range.startContainer.parentElement.insertBefore(focusBRElem, this.range.startContainer);
28757
28768
  }
@@ -28759,6 +28770,11 @@ class EnterKeyAction {
28759
28770
  if (currentParentLastChild.nodeName === 'BR' && currentParent.textContent.length === 0) {
28760
28771
  this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, currentParentLastChild);
28761
28772
  }
28773
+ else if (this.range.startOffset === 0 && this.range.endOffset === 0 &&
28774
+ currentParent.lastChild && currentParent.lastChild.nodeName === 'IMG') {
28775
+ currentParentLastChild.parentElement.insertBefore(focusBRElem, currentParentLastChild);
28776
+ focusBRElem = currentParentLastChild;
28777
+ }
28762
28778
  else {
28763
28779
  const lineBreakBRElem = this.parent.createElement('br');
28764
28780
  this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, this.range.startContainer);
@@ -30813,7 +30829,9 @@ let RichTextEditor = class RichTextEditor extends Component {
30813
30829
  this.notify(windowResize, null);
30814
30830
  }
30815
30831
  scrollHandler(e) {
30816
- this.notify(scroll, { args: e });
30832
+ if (this.element) {
30833
+ this.notify(scroll, { args: e });
30834
+ }
30817
30835
  }
30818
30836
  contentScrollHandler(e) {
30819
30837
  this.notify(contentscroll, { args: e });