@syncfusion/ej2-richtexteditor 21.2.9 → 21.2.10

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.
@@ -5891,7 +5891,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
5891
5891
  */
5892
5892
  BaseQuickToolbar.prototype.showPopup = function (x, y, target) {
5893
5893
  var _this = this;
5894
- var eventArgs = { popup: this.popupObj, cancel: false, targetElement: target };
5894
+ var eventArgs = { popup: this.popupObj, cancel: false, targetElement: target, positionX: x, positionY: y };
5895
5895
  this.parent.trigger(beforeQuickToolbarOpen, eventArgs, function (beforeQuickToolbarArgs) {
5896
5896
  if (!beforeQuickToolbarArgs.cancel) {
5897
5897
  var editPanelTop = void 0;
@@ -5931,8 +5931,8 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
5931
5931
  });
5932
5932
  _this.tooltip.appendTo(_this.element);
5933
5933
  }
5934
- _this.popupObj.position.X = x + 20;
5935
- _this.popupObj.position.Y = y + 20;
5934
+ _this.popupObj.position.X = beforeQuickToolbarArgs.positionX + 20;
5935
+ _this.popupObj.position.Y = beforeQuickToolbarArgs.positionY + 20;
5936
5936
  _this.popupObj.dataBind();
5937
5937
  _this.popupObj.element.classList.add('e-popup-open');
5938
5938
  _this.dropDownButtons.renderDropDowns({
@@ -17269,7 +17269,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
17269
17269
  imgElem[i].getAttribute('v:shapes').indexOf('Picture') < 0 &&
17270
17270
  imgElem[i].getAttribute('v:shapes').indexOf('圖片') < 0 &&
17271
17271
  imgElem[i].getAttribute('v:shapes').indexOf('Grafik') < 0 &&
17272
- imgElem[i].getAttribute('v:shapes').indexOf('Image') < 0 &&
17272
+ imgElem[i].getAttribute('v:shapes').toLowerCase().indexOf('image') < 0 &&
17273
17273
  imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0) {
17274
17274
  detach(imgElem[i]);
17275
17275
  }
@@ -17852,12 +17852,31 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
17852
17852
  temp.style.listStyleType = collection[index].listStyleTypeName;
17853
17853
  }
17854
17854
  else {
17855
- root.appendChild(temp = createElement(collection[index].listType));
17856
- prevList = createElement('li');
17857
- prevList.appendChild(pElement);
17858
- temp.appendChild(prevList);
17859
- temp.setAttribute('level', collection[index].nestedLevel.toString());
17860
- temp.style.listStyleType = collection[index].listStyleTypeName;
17855
+ if (collection[index].nestedLevel > pLevel && isNormalList) {
17856
+ var initialNode = void 0;
17857
+ initialNode = createElement(collection[index].listType);
17858
+ prevList = createElement('li');
17859
+ initialNode.appendChild(prevList);
17860
+ initialNode.style.listStyleType = 'none';
17861
+ for (var j = 0; j < collection[index].nestedLevel - 1; j++) {
17862
+ prevList.appendChild(temp = createElement(collection[index].listType));
17863
+ prevList = createElement('li');
17864
+ temp.appendChild(prevList);
17865
+ temp.style.listStyleType = 'none';
17866
+ }
17867
+ prevList.appendChild(pElement);
17868
+ root.appendChild(initialNode);
17869
+ temp.setAttribute('level', collection[index].nestedLevel.toString());
17870
+ temp.style.listStyleType = collection[index].listStyleTypeName;
17871
+ }
17872
+ else {
17873
+ root.appendChild(temp = createElement(collection[index].listType));
17874
+ prevList = createElement('li');
17875
+ prevList.appendChild(pElement);
17876
+ temp.appendChild(prevList);
17877
+ temp.setAttribute('level', collection[index].nestedLevel.toString());
17878
+ temp.style.listStyleType = collection[index].listStyleTypeName;
17879
+ }
17861
17880
  }
17862
17881
  }
17863
17882
  else if (collection[index].nestedLevel === 1) {
@@ -19766,9 +19785,14 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
19766
19785
  ? this.oldRangeElement.lastElementChild.lastElementChild :
19767
19786
  this.oldRangeElement.lastElementChild;
19768
19787
  }
19788
+ var lastNode = this.oldRangeElement.lastChild;
19789
+ while (lastNode.nodeType !== 3 && lastNode.nodeName !== '#text' &&
19790
+ lastNode.nodeName !== 'BR') {
19791
+ lastNode = lastNode.lastChild;
19792
+ }
19769
19793
  this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),
19770
19794
  // eslint-disable-next-line
19771
- this.oldRangeElement, this.oldRangeElement.childNodes.length);
19795
+ lastNode, lastNode.textContent.length);
19772
19796
  if (this.oldRangeElement.querySelectorAll('BR').length === 1) {
19773
19797
  detach(this.oldRangeElement.querySelector('BR'));
19774
19798
  }