@syncfusion/ej2-richtexteditor 22.1.38 → 22.2.5

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.
@@ -3409,7 +3409,9 @@ class ToolbarRenderer {
3409
3409
  target: '#' + this.parent.getID() + '_toolbar_wrapper [title]',
3410
3410
  showTipPointer: true,
3411
3411
  openDelay: 400,
3412
- cssClass: this.parent.cssClass
3412
+ cssClass: this.parent.cssClass,
3413
+ windowCollision: true,
3414
+ position: 'BottomCenter'
3413
3415
  });
3414
3416
  this.tooltip.appendTo(args.target);
3415
3417
  }
@@ -6102,7 +6104,9 @@ class BaseQuickToolbar {
6102
6104
  this.tooltip = new Tooltip({
6103
6105
  target: '#' + this.element.id + ' [title]',
6104
6106
  openDelay: 400,
6105
- showTipPointer: true
6107
+ showTipPointer: true,
6108
+ windowCollision: true,
6109
+ position: 'BottomCenter'
6106
6110
  });
6107
6111
  this.tooltip.appendTo(this.element);
6108
6112
  }
@@ -17463,7 +17467,8 @@ class MsWordPaste {
17463
17467
  imgElem[i].getAttribute('v:shapes').indexOf('圖片') < 0 &&
17464
17468
  imgElem[i].getAttribute('v:shapes').indexOf('Grafik') < 0 &&
17465
17469
  imgElem[i].getAttribute('v:shapes').toLowerCase().indexOf('image') < 0 &&
17466
- imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0) {
17470
+ imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0 &&
17471
+ imgElem[i].getAttribute('v:shapes').indexOf('_x0000_s') < 0) {
17467
17472
  detach(imgElem[i]);
17468
17473
  }
17469
17474
  }
@@ -18138,7 +18143,11 @@ class MsWordPaste {
18138
18143
  else {
18139
18144
  //Add to support separate list which looks like same list and also to add all tags as it is inside list
18140
18145
  if (firstChild.childNodes.length > 0) {
18141
- const listOrder = firstChild.querySelector('span[style="mso-list:Ignore"]');
18146
+ let listIgnoreTag = firstChild.querySelectorAll('[style*="mso-list"]');
18147
+ for (let i = 0; i < listIgnoreTag.length; i++) {
18148
+ listIgnoreTag[i].setAttribute('style', listIgnoreTag[i].getAttribute('style').replace(/\n/g, ""));
18149
+ }
18150
+ let listOrder = firstChild.querySelector('span[style="mso-list:Ignore"]');
18142
18151
  if (!isNullOrUndefined(listOrder)) {
18143
18152
  this.listContents.push(listOrder.textContent.trim());
18144
18153
  detach(listOrder);
@@ -21425,6 +21434,7 @@ class PasteCleanup {
21425
21434
  }
21426
21435
  this.parent.trigger(afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: filesData }, (updatedArgs) => { value = updatedArgs.value; });
21427
21436
  clipBoardElem.innerHTML = value;
21437
+ clipBoardElem = this.addTableClass(clipBoardElem);
21428
21438
  this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, (returnArgs) => {
21429
21439
  extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
21430
21440
  this.parent.formatter.onSuccess(this.parent, args);
@@ -21437,6 +21447,15 @@ class PasteCleanup {
21437
21447
  }
21438
21448
  }
21439
21449
  }
21450
+ addTableClass(element) {
21451
+ const tableElement = element.querySelectorAll('table');
21452
+ for (let i = 0; i < tableElement.length; i++) {
21453
+ if (!tableElement[i].classList.contains('e-rte-table')) {
21454
+ tableElement[i].classList.add('e-rte-table');
21455
+ }
21456
+ }
21457
+ return element;
21458
+ }
21440
21459
  setImageProperties(allImg) {
21441
21460
  if (this.parent.insertImageSettings.width !== 'auto') {
21442
21461
  allImg.setAttribute('width', this.parent.insertImageSettings.width);
@@ -23126,7 +23145,11 @@ class EmojiPicker {
23126
23145
  return;
23127
23146
  }
23128
23147
  targetEle.focus();
23129
- if (!isNullOrUndefined(this.clickEvent)) {
23148
+ const startOffset = this.save.startOffset;
23149
+ const textContent = this.save.range.startContainer.textContent;
23150
+ const previousText = textContent.substring(startOffset, startOffset + 1);
23151
+ // When toolbar action is clicked then only restore the range.
23152
+ if (!isNullOrUndefined(this.clickEvent) || previousText !== ':') {
23130
23153
  this.save.restore();
23131
23154
  }
23132
23155
  if (this.popupObj) {
@@ -29637,7 +29660,13 @@ class Table {
29637
29660
  if (this.resizeBtnStat.column) {
29638
29661
  const width = parseFloat(this.columnEle.offsetWidth.toString());
29639
29662
  const cellRow = this.curTable.rows[0].cells[0].nodeName === 'TH' ? 1 : 0;
29640
- const currentTableWidth = parseFloat(this.curTable.style.width.split('%')[0]);
29663
+ let currentTableWidth;
29664
+ if (this.curTable.style.width != '') {
29665
+ currentTableWidth = parseFloat(this.curTable.style.width.split('%')[0]);
29666
+ }
29667
+ else {
29668
+ currentTableWidth = this.getCurrentTableWidth(this.curTable.offsetWidth, this.parent.inputElement.offsetWidth);
29669
+ }
29641
29670
  const currentColumnCellWidth = parseFloat(this.curTable.rows[cellRow].cells[this.colIndex >= this.curTable.rows[cellRow].cells.length ? this.curTable.rows[cellRow].cells.length - 1 : this.colIndex].style.width.split('%')[0]);
29642
29671
  if (this.currentColumnResize === 'first') {
29643
29672
  mouseX = mouseX - 0.75; //This was done for to make the gripper and the table first/last column will be close.
@@ -29792,6 +29821,11 @@ class Table {
29792
29821
  }
29793
29822
  });
29794
29823
  }
29824
+ getCurrentTableWidth(tableWidth, parentWidth) {
29825
+ let currentTableWidth = 0;
29826
+ currentTableWidth = tableWidth / parentWidth * 100;
29827
+ return currentTableWidth;
29828
+ }
29795
29829
  findFirstLastColCells(table, isFirst) {
29796
29830
  const resultColumns = [];
29797
29831
  const rows = table.querySelectorAll('tr');