@syncfusion/ej2-richtexteditor 19.4.38 → 19.4.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.
@@ -2968,7 +2968,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
2968
2968
  * @hidden
2969
2969
  * @deprecated
2970
2970
  */
2971
- ToolbarRenderer.prototype.renderColorPickerDropDown = function (args, item, colorPicker) {
2971
+ ToolbarRenderer.prototype.renderColorPickerDropDown = function (args, item, colorPicker, defaultColor) {
2972
2972
  var _this = this;
2973
2973
  // eslint-disable-next-line
2974
2974
  var proxy = this;
@@ -2977,8 +2977,9 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
2977
2977
  var content = proxy.parent.createElement('span', { className: CLS_COLOR_CONTENT });
2978
2978
  var inlineEle = proxy.parent.createElement('span', { className: args.cssClass });
2979
2979
  var range;
2980
+ var initialBackgroundColor = (isNullOrUndefined(defaultColor)) ? proxy.parent.backgroundColor.default : defaultColor;
2980
2981
  inlineEle.style.borderBottomColor = (item === 'backgroundcolor') ?
2981
- proxy.parent.backgroundColor.default : proxy.parent.fontColor.default;
2982
+ initialBackgroundColor : proxy.parent.fontColor.default;
2982
2983
  content.appendChild(inlineEle);
2983
2984
  var dropDown = new DropDownButton({
2984
2985
  target: colorPicker.element.parentElement, cssClass: css,
@@ -5030,7 +5031,7 @@ var ColorPickerInput = /** @__PURE__ @class */ (function () {
5030
5031
  target: (targetID)
5031
5032
  };
5032
5033
  _this.backgroundColorPicker = _this.toolbarRenderer.renderColorPicker(options, 'backgroundcolor');
5033
- _this.backgroundColorDropDown = _this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', _this.backgroundColorPicker);
5034
+ _this.backgroundColorDropDown = _this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', _this.backgroundColorPicker, _this.defaultColorPicker);
5034
5035
  break;
5035
5036
  }
5036
5037
  }
@@ -5065,6 +5066,7 @@ var ColorPickerInput = /** @__PURE__ @class */ (function () {
5065
5066
  if (this.backgroundColorDropDown && !this.backgroundColorDropDown.isDestroyed) {
5066
5067
  var innerEle = this.backgroundColorDropDown.element.querySelector('.e-rte-color-content');
5067
5068
  if (innerEle) {
5069
+ this.defaultColorPicker = innerEle.children[0].style.borderBottomColor;
5068
5070
  detach(innerEle);
5069
5071
  }
5070
5072
  this.backgroundColorDropDown.destroy();
@@ -10561,8 +10563,9 @@ var Lists = /** @__PURE__ @class */ (function () {
10561
10563
  Lists.prototype.testCurrentList = function (range) {
10562
10564
  var olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
10563
10565
  if (!isNullOrUndefined(range.startContainer.textContent.slice(0, range.startOffset))) {
10566
+ var currentContent = range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim();
10564
10567
  for (var i = 0; i < olListStartRegex.length; i++) {
10565
- if (olListStartRegex[i].test(range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim())) {
10568
+ if (olListStartRegex[i].test(currentContent) && currentContent.length === 2) {
10566
10569
  return true;
10567
10570
  }
10568
10571
  }
@@ -14603,6 +14606,9 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
14603
14606
  };
14604
14607
  SelectionCommands.removeFormat = function (nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode) {
14605
14608
  var splitNode = null;
14609
+ var startText = range.startContainer.nodeName === '#text' ?
14610
+ range.startContainer.textContent.substring(range.startOffset, range.startContainer.textContent.length) :
14611
+ range.startContainer.textContent;
14606
14612
  if (!(range.startContainer === range.endContainer && range.startOffset === 0
14607
14613
  && range.endOffset === range.startContainer.length)) {
14608
14614
  var nodeIndex = [];
@@ -14702,11 +14708,13 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
14702
14708
  for (var num = 0; num < child.length; num++) {
14703
14709
  if (child[num].nodeType !== 3 || (child[num].textContent && child[num].textContent.trim().length > 0)) {
14704
14710
  child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
14705
- if (num === 0) {
14706
- range.setStartBefore(child[num]);
14707
- }
14708
- else if (num === child.length - 1) {
14709
- range.setEndAfter(child[num]);
14711
+ if (child[num].textContent === startText) {
14712
+ if (num === 0) {
14713
+ range.setStartBefore(child[num]);
14714
+ }
14715
+ else if (num === child.length - 1) {
14716
+ range.setEndAfter(child[num]);
14717
+ }
14710
14718
  }
14711
14719
  }
14712
14720
  }
@@ -20198,7 +20206,7 @@ var Image = /** @__PURE__ @class */ (function () {
20198
20206
  left: elem.offsetLeft
20199
20207
  };
20200
20208
  };
20201
- Image.prototype.setAspectRatio = function (img, expectedX, expectedY) {
20209
+ Image.prototype.setAspectRatio = function (img, expectedX, expectedY, e) {
20202
20210
  if (isNullOrUndefined(img.width)) {
20203
20211
  return;
20204
20212
  }
@@ -20252,7 +20260,7 @@ var Image = /** @__PURE__ @class */ (function () {
20252
20260
  img.style.height = (height / width * expectedX) + 'px';
20253
20261
  }
20254
20262
  else {
20255
- img.setAttribute('width', expectedX.toString());
20263
+ img.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - img.getBoundingClientRect().left).toString() : expectedX.toString());
20256
20264
  }
20257
20265
  }
20258
20266
  else {
@@ -20293,7 +20301,7 @@ var Image = /** @__PURE__ @class */ (function () {
20293
20301
  return;
20294
20302
  }
20295
20303
  _this.imgEle.parentElement.style.cursor = 'pointer';
20296
- _this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10));
20304
+ _this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10), args);
20297
20305
  _this.resizeImgDupPos(_this.imgEle);
20298
20306
  _this.imgResizePos(_this.imgEle, _this.imgResizeDiv);
20299
20307
  _this.parent.setContentHeight('', false);