@syncfusion/ej2-richtexteditor 21.2.8 → 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) {
@@ -19549,9 +19568,10 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
19549
19568
  range.startContainer.nodeName === '#text' ? range.startContainer.parentElement !== this.parent.inputElement ? range.startContainer.parentElement.classList.add('currentStartMark')
19550
19569
  : isRootParent = true : range.startContainer.classList.add('currentStartMark');
19551
19570
  if (range.startContainer.textContent.charCodeAt(0) === 8203) {
19552
- pointer = range.startOffset === 0 ? range.startOffset :
19553
- range.startContainer.textContent.replace(regEx, '').trim().length !== 0 ? range.startOffset - 1 : 0;
19571
+ var previousLength_1 = range.startContainer.textContent.length;
19572
+ var previousRange = range.startOffset;
19554
19573
  range.startContainer.textContent = range.startContainer.textContent.replace(regEx, '');
19574
+ pointer = previousRange === 0 ? previousRange : previousRange - (previousLength_1 - range.startContainer.textContent.length);
19555
19575
  this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), range.startContainer, pointer);
19556
19576
  }
19557
19577
  var previousLength = this.parent.inputElement.innerHTML.length;
@@ -19571,7 +19591,10 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
19571
19591
  i--;
19572
19592
  }
19573
19593
  if (focusNode.textContent.replace(regEx, '') === currentChildNode[i].textContent) {
19574
- pointer = focusNode.textContent.length > 1 ? focusNode.textContent.length - 1 : focusNode.textContent.length;
19594
+ pointer = focusNode.textContent.length > 1 ?
19595
+ (focusNode.textContent === currentChildNode[i].textContent ? pointer :
19596
+ pointer - (focusNode.textContent.length - focusNode.textContent.replace(regEx, '').length)) :
19597
+ focusNode.textContent.length;
19575
19598
  focusNode = currentChildNode[i];
19576
19599
  }
19577
19600
  }
@@ -19762,9 +19785,14 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
19762
19785
  ? this.oldRangeElement.lastElementChild.lastElementChild :
19763
19786
  this.oldRangeElement.lastElementChild;
19764
19787
  }
19788
+ var lastNode = this.oldRangeElement.lastChild;
19789
+ while (lastNode.nodeType !== 3 && lastNode.nodeName !== '#text' &&
19790
+ lastNode.nodeName !== 'BR') {
19791
+ lastNode = lastNode.lastChild;
19792
+ }
19765
19793
  this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),
19766
19794
  // eslint-disable-next-line
19767
- this.oldRangeElement, this.oldRangeElement.childNodes.length);
19795
+ lastNode, lastNode.textContent.length);
19768
19796
  if (this.oldRangeElement.querySelectorAll('BR').length === 1) {
19769
19797
  detach(this.oldRangeElement.querySelector('BR'));
19770
19798
  }