@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.
@@ -2965,7 +2965,7 @@ class ToolbarRenderer {
2965
2965
  * @hidden
2966
2966
  * @deprecated
2967
2967
  */
2968
- renderColorPickerDropDown(args, item, colorPicker) {
2968
+ renderColorPickerDropDown(args, item, colorPicker, defaultColor) {
2969
2969
  // eslint-disable-next-line
2970
2970
  const proxy = this;
2971
2971
  let css = CLS_RTE_ELEMENTS + ' ' + CLS_TB_BTN + ((this.parent.inlineMode) ? (' ' + CLS_INLINE_DROPDOWN) : '');
@@ -2973,8 +2973,9 @@ class ToolbarRenderer {
2973
2973
  const content = proxy.parent.createElement('span', { className: CLS_COLOR_CONTENT });
2974
2974
  const inlineEle = proxy.parent.createElement('span', { className: args.cssClass });
2975
2975
  let range;
2976
+ let initialBackgroundColor = (isNullOrUndefined(defaultColor)) ? proxy.parent.backgroundColor.default : defaultColor;
2976
2977
  inlineEle.style.borderBottomColor = (item === 'backgroundcolor') ?
2977
- proxy.parent.backgroundColor.default : proxy.parent.fontColor.default;
2978
+ initialBackgroundColor : proxy.parent.fontColor.default;
2978
2979
  content.appendChild(inlineEle);
2979
2980
  const dropDown = new DropDownButton({
2980
2981
  target: colorPicker.element.parentElement, cssClass: css,
@@ -4987,7 +4988,7 @@ class ColorPickerInput {
4987
4988
  target: (targetID)
4988
4989
  };
4989
4990
  this.backgroundColorPicker = this.toolbarRenderer.renderColorPicker(options, 'backgroundcolor');
4990
- this.backgroundColorDropDown = this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', this.backgroundColorPicker);
4991
+ this.backgroundColorDropDown = this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', this.backgroundColorPicker, this.defaultColorPicker);
4991
4992
  break;
4992
4993
  }
4993
4994
  }
@@ -5022,6 +5023,7 @@ class ColorPickerInput {
5022
5023
  if (this.backgroundColorDropDown && !this.backgroundColorDropDown.isDestroyed) {
5023
5024
  const innerEle = this.backgroundColorDropDown.element.querySelector('.e-rte-color-content');
5024
5025
  if (innerEle) {
5026
+ this.defaultColorPicker = innerEle.children[0].style.borderBottomColor;
5025
5027
  detach(innerEle);
5026
5028
  }
5027
5029
  this.backgroundColorDropDown.destroy();
@@ -10466,8 +10468,9 @@ class Lists {
10466
10468
  testCurrentList(range) {
10467
10469
  const olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
10468
10470
  if (!isNullOrUndefined(range.startContainer.textContent.slice(0, range.startOffset))) {
10471
+ const currentContent = range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim();
10469
10472
  for (let i = 0; i < olListStartRegex.length; i++) {
10470
- if (olListStartRegex[i].test(range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim())) {
10473
+ if (olListStartRegex[i].test(currentContent) && currentContent.length === 2) {
10471
10474
  return true;
10472
10475
  }
10473
10476
  }
@@ -14485,6 +14488,9 @@ class SelectionCommands {
14485
14488
  }
14486
14489
  static removeFormat(nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode) {
14487
14490
  let splitNode = null;
14491
+ let startText = range.startContainer.nodeName === '#text' ?
14492
+ range.startContainer.textContent.substring(range.startOffset, range.startContainer.textContent.length) :
14493
+ range.startContainer.textContent;
14488
14494
  if (!(range.startContainer === range.endContainer && range.startOffset === 0
14489
14495
  && range.endOffset === range.startContainer.length)) {
14490
14496
  const nodeIndex = [];
@@ -14584,11 +14590,13 @@ class SelectionCommands {
14584
14590
  for (let num = 0; num < child.length; num++) {
14585
14591
  if (child[num].nodeType !== 3 || (child[num].textContent && child[num].textContent.trim().length > 0)) {
14586
14592
  child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
14587
- if (num === 0) {
14588
- range.setStartBefore(child[num]);
14589
- }
14590
- else if (num === child.length - 1) {
14591
- range.setEndAfter(child[num]);
14593
+ if (child[num].textContent === startText) {
14594
+ if (num === 0) {
14595
+ range.setStartBefore(child[num]);
14596
+ }
14597
+ else if (num === child.length - 1) {
14598
+ range.setEndAfter(child[num]);
14599
+ }
14592
14600
  }
14593
14601
  }
14594
14602
  }
@@ -20099,7 +20107,7 @@ class Image {
20099
20107
  left: elem.offsetLeft
20100
20108
  };
20101
20109
  }
20102
- setAspectRatio(img, expectedX, expectedY) {
20110
+ setAspectRatio(img, expectedX, expectedY, e) {
20103
20111
  if (isNullOrUndefined(img.width)) {
20104
20112
  return;
20105
20113
  }
@@ -20153,7 +20161,7 @@ class Image {
20153
20161
  img.style.height = (height / width * expectedX) + 'px';
20154
20162
  }
20155
20163
  else {
20156
- img.setAttribute('width', expectedX.toString());
20164
+ img.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - img.getBoundingClientRect().left).toString() : expectedX.toString());
20157
20165
  }
20158
20166
  }
20159
20167
  else {
@@ -20193,7 +20201,7 @@ class Image {
20193
20201
  return;
20194
20202
  }
20195
20203
  this.imgEle.parentElement.style.cursor = 'pointer';
20196
- this.setAspectRatio(this.imgEle, parseInt(width, 10), parseInt(height, 10));
20204
+ this.setAspectRatio(this.imgEle, parseInt(width, 10), parseInt(height, 10), args);
20197
20205
  this.resizeImgDupPos(this.imgEle);
20198
20206
  this.imgResizePos(this.imgEle, this.imgResizeDiv);
20199
20207
  this.parent.setContentHeight('', false);