@syncfusion/ej2-richtexteditor 20.2.39 → 20.2.40

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.
@@ -17123,7 +17123,7 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
17123
17123
  if ((name !== null && name !== '' && name !== undefined)
17124
17124
  && (fontName === null || fontName === undefined || (fontName.filter(function (value, pos) {
17125
17125
  var pattern = new RegExp(name, 'i');
17126
- if ((value.replace(/"/g, '').replace(/ /g, '') === name.replace(/"/g, '').replace(/ /g, '')) ||
17126
+ if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
17127
17127
  (value.search(pattern) > -1)) {
17128
17128
  index = pos;
17129
17129
  }
@@ -19915,6 +19915,14 @@ var Render = /** @__PURE__ @class */ (function () {
19915
19915
  Render.prototype.destroy = function () {
19916
19916
  this.removeEventListener();
19917
19917
  };
19918
+ /**
19919
+ * Clears the Render Module.
19920
+ *
19921
+ * @returns {void}
19922
+ */
19923
+ Render.prototype.moduleDestroy = function () {
19924
+ this.parent = null;
19925
+ };
19918
19926
  Render.prototype.addEventListener = function () {
19919
19927
  if (this.parent.isDestroyed) {
19920
19928
  return;
@@ -20472,6 +20480,16 @@ var Link = /** @__PURE__ @class */ (function () {
20472
20480
  Link.prototype.destroy = function () {
20473
20481
  this.removeEventListener();
20474
20482
  };
20483
+ /**
20484
+ * Clears the Link Module.
20485
+ *
20486
+ * @returns {void}
20487
+ * @hidden
20488
+ * @deprecated
20489
+ */
20490
+ Link.prototype.moduleDestroy = function () {
20491
+ this.parent = null;
20492
+ };
20475
20493
  /**
20476
20494
  * For internal use only - Get the module name.
20477
20495
  *
@@ -20492,7 +20510,7 @@ var Image = /** @__PURE__ @class */ (function () {
20492
20510
  this.isAllowedTypes = true;
20493
20511
  this.pageX = null;
20494
20512
  this.pageY = null;
20495
- this.mousex = null;
20513
+ this.mouseX = null;
20496
20514
  this.deletedImg = [];
20497
20515
  this.parent = parent;
20498
20516
  this.rteID = parent.element.id;
@@ -20829,7 +20847,7 @@ var Image = /** @__PURE__ @class */ (function () {
20829
20847
  img.style.minWidth = this.parent.insertImageSettings.minWidth === 0 ? '20px' : formatUnit(this.parent.insertImageSettings.minWidth);
20830
20848
  if (this.parent.insertImageSettings.resizeByPercent) {
20831
20849
  if (parseInt('' + img.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
20832
- var original = img.offsetWidth + this.mousex;
20850
+ var original = img.offsetWidth + this.mouseX;
20833
20851
  var finalWidthByPerc = (original / img.offsetWidth) * (parseFloat(img.style.width).toString() == 'NaN' ? (img.offsetWidth / (parseFloat(getComputedStyle(this.parent.element).width)) * 100) : parseFloat(img.style.width));
20834
20852
  img.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
20835
20853
  }
@@ -20855,17 +20873,17 @@ var Image = /** @__PURE__ @class */ (function () {
20855
20873
  }
20856
20874
  else {
20857
20875
  if (this.parent.iframeSettings.enable) {
20858
- img.setAttribute('width', (img.width + this.mousex).toString());
20876
+ img.setAttribute('width', (img.width + this.mouseX).toString());
20859
20877
  }
20860
20878
  else {
20861
- img.setAttribute('width', (img.offsetWidth + this.mousex).toString());
20879
+ img.setAttribute('width', (img.offsetWidth + this.mouseX).toString());
20862
20880
  }
20863
20881
  }
20864
20882
  }
20865
20883
  else if (height > width) {
20866
20884
  if (this.parent.insertImageSettings.resizeByPercent) {
20867
20885
  if (parseInt('' + img.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
20868
- var original = img.offsetWidth + this.mousex;
20886
+ var original = img.offsetWidth + this.mouseX;
20869
20887
  var finalWidthByPerc = (original / img.offsetWidth) * (parseFloat(img.style.width).toString() == 'NaN' ? (img.offsetWidth / (parseFloat(getComputedStyle(this.parent.element).width)) * 100) : parseFloat(img.style.width));
20870
20888
  img.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
20871
20889
  }
@@ -20934,7 +20952,7 @@ var Image = /** @__PURE__ @class */ (function () {
20934
20952
  var mouseY = (this.resizeBtnStat.topLeft || this.resizeBtnStat.topRight) ? -(pageY - this.pageY) : (pageY - this.pageY);
20935
20953
  var width = parseInt(this.imgDupPos.width, 10) + mouseX;
20936
20954
  var height = parseInt(this.imgDupPos.height, 10) + mouseY;
20937
- this.mousex = mouseX;
20955
+ this.mouseX = mouseX;
20938
20956
  this.pageX = pageX;
20939
20957
  this.pageY = pageY;
20940
20958
  if (this.resizeBtnStat.botRight) {
@@ -22769,6 +22787,18 @@ var Image = /** @__PURE__ @class */ (function () {
22769
22787
  this.prevSelectedImgEle = undefined;
22770
22788
  this.removeEventListener();
22771
22789
  };
22790
+ /* eslint-disable */
22791
+ /**
22792
+ * Clears the ImageModule.
22793
+ *
22794
+ * @returns {void}
22795
+ * @hidden
22796
+ * @deprecated
22797
+ */
22798
+ /* eslint-enable */
22799
+ Image.prototype.moduleDestroy = function () {
22800
+ this.parent = null;
22801
+ };
22772
22802
  /**
22773
22803
  * For internal use only - Get the module name.
22774
22804
  *
@@ -23581,7 +23611,8 @@ var Table = /** @__PURE__ @class */ (function () {
23581
23611
  }
23582
23612
  var target = e.target || e.targetTouches[0].target;
23583
23613
  var closestTable = closest(target, 'table.e-rte-table');
23584
- if (!isNullOrUndefined(this.curTable) && !isNullOrUndefined(closestTable) && closestTable !== this.curTable) {
23614
+ if (!isNullOrUndefined(this.curTable) && !isNullOrUndefined(closestTable) && closestTable !== this.curTable &&
23615
+ this.parent.contentModule.getEditPanel().contains(closestTable)) {
23585
23616
  this.removeResizeElement();
23586
23617
  this.removeHelper(e);
23587
23618
  this.cancelResizeAction();
@@ -23858,7 +23889,8 @@ var Table = /** @__PURE__ @class */ (function () {
23858
23889
  var rteWidth = _this.contentModule.getEditPanel().offsetWidth - (_this.contentModule.getEditPanel().offsetWidth -
23859
23890
  _this.contentModule.getEditPanel().clientWidth) - paddingSize * 2;
23860
23891
  var widthCompare = void 0;
23861
- if (!isNullOrUndefined(_this.curTable.parentElement.closest('table'))) {
23892
+ if (!isNullOrUndefined(_this.curTable.parentElement.closest('table')) && !isNullOrUndefined(_this.curTable.closest('td')) &&
23893
+ _this.contentModule.getEditPanel().contains(_this.curTable.closest('td'))) {
23862
23894
  var currentTd = _this.curTable.closest('td');
23863
23895
  var currentTDPad = +getComputedStyle(currentTd).paddingRight.match(/\d/g).join('');
23864
23896
  // Padding of the current table with the parent element multiply with 2.
@@ -26268,8 +26300,19 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
26268
26300
  if (this.isDestroyed || !this.isRendered) {
26269
26301
  return;
26270
26302
  }
26271
- if (this.element.offsetParent === null && !isNullOrUndefined(this.toolbarModule)) {
26272
- this.toolbarModule.destroy();
26303
+ if (this.element.offsetParent === null) {
26304
+ if (!isNullOrUndefined(this.toolbarModule)) {
26305
+ this.toolbarModule.destroy();
26306
+ }
26307
+ if (!isNullOrUndefined(this.imageModule)) {
26308
+ this.imageModule.moduleDestroy();
26309
+ }
26310
+ if (!isNullOrUndefined(this.linkModule)) {
26311
+ this.linkModule.moduleDestroy();
26312
+ }
26313
+ if (!isNullOrUndefined(this.renderModule)) {
26314
+ this.renderModule.moduleDestroy();
26315
+ }
26273
26316
  return;
26274
26317
  }
26275
26318
  this.notify(destroy, {});