@syncfusion/ej2-richtexteditor 28.1.35 → 28.1.36

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.
@@ -6158,11 +6158,10 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
6158
6158
  enableRtl: this.parent.enableRtl,
6159
6159
  inline: true,
6160
6160
  value: null,
6161
- cssClass: ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass + ' ' + 'e-rte-picker-init',
6161
+ cssClass: ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass,
6162
6162
  created: function () {
6163
6163
  var value = (item === 'backgroundcolor') ? proxy.parent.backgroundColor.default : proxy.parent.fontColor.default;
6164
- var cssClass = ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass;
6165
- colorPicker.setProperties({ value: value, cssClass: cssClass });
6164
+ colorPicker.setProperties({ value: value });
6166
6165
  },
6167
6166
  mode: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.mode : proxy.parent.fontColor.mode),
6168
6167
  modeSwitcher: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.modeSwitcher : proxy.parent.fontColor.modeSwitcher),
@@ -25550,6 +25549,7 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
25550
25549
  if (child && child.length === 1) {
25551
25550
  e.item.selection.startContainer = e.item.selection.getNodeArray(child[child.length - 1], true);
25552
25551
  e.item.selection.endContainer = e.item.selection.startContainer;
25552
+ e.item.selection.endOffset = child[child.length - 1].textContent.length;
25553
25553
  }
25554
25554
  e.item.selection = this.parent.domNode.saveMarker(e.item.selection);
25555
25555
  }
@@ -29907,7 +29907,8 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
29907
29907
  imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0 &&
29908
29908
  imgElem[i].getAttribute('v:shapes').indexOf('_x0000_s') < 0 &&
29909
29909
  imgElem[i].getAttribute('v:shapes').indexOf('_x0000_i') < 0 &&
29910
- imgElem[i].getAttribute('v:shapes').indexOf('img1') < 0) {
29910
+ imgElem[i].getAttribute('v:shapes').indexOf('img1') < 0 &&
29911
+ imgElem[i].getAttribute('v:shapes').indexOf('Immagine') < 0) {
29911
29912
  imgElem[i].classList.add('e-rte-image-unsupported');
29912
29913
  }
29913
29914
  imgElem[i].removeAttribute('v:shapes');
@@ -29921,7 +29922,8 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
29921
29922
  if (imgElem.length > 0) {
29922
29923
  for (var i = 0; i < imgElem.length; i++) {
29923
29924
  imgSrc.push(imgElem[i].getAttribute('src'));
29924
- imgName.push(imgElem[i].getAttribute('src').split('/')[imgElem[i].getAttribute('src').split('/').length - 1].split('.')[0]);
29925
+ var imageName = imgElem[i].getAttribute('src').split('/')[imgElem[i].getAttribute('src').split('/').length - 1].split('.')[0] + i;
29926
+ imgName.push(imageName);
29925
29927
  }
29926
29928
  var hexValue = this.hexConversion(rtfData);
29927
29929
  for (var i = 0; i < hexValue.length; i++) {
@@ -33868,8 +33870,20 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
33868
33870
  this.parent.trigger(imageUploadSuccess, e, function (e) {
33869
33871
  if (!isNullOrUndefined(_this.parent.insertImageSettings.path)) {
33870
33872
  var url = _this.parent.insertImageSettings.path + e.file.name;
33871
- imgElem.src = url;
33872
- imgElem.setAttribute('alt', e.file.name);
33873
+ if (!_this.parent.inputElement.contains(imgElem)) {
33874
+ var imgHtmlElems = _this.parent.inputElement.querySelectorAll('#' + imgElem.id);
33875
+ for (var i = 0; i < imgHtmlElems.length; i++) {
33876
+ var imgHtmlElem = imgHtmlElems[i];
33877
+ if (imgHtmlElem && imgHtmlElem.style && imgHtmlElem.style.opacity === '0.5') {
33878
+ imgHtmlElem.src = url;
33879
+ imgHtmlElem.setAttribute('alt', e.file.name);
33880
+ }
33881
+ }
33882
+ }
33883
+ else {
33884
+ imgElem.src = url;
33885
+ imgElem.setAttribute('alt', e.file.name);
33886
+ }
33873
33887
  }
33874
33888
  });
33875
33889
  }
@@ -33882,7 +33896,18 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
33882
33896
  }
33883
33897
  this.popupCloseTime = setTimeout(function () {
33884
33898
  popupObj.close();
33885
- imgElem.style.opacity = '1';
33899
+ if (!_this.parent.inputElement.contains(imgElem)) {
33900
+ var imgHtmlElems = _this.parent.inputElement.querySelectorAll('#' + imgElem.id);
33901
+ for (var i = 0; i < imgHtmlElems.length; i++) {
33902
+ var imgHtmlElem = imgHtmlElems[i];
33903
+ if (imgHtmlElem && imgHtmlElem.style && imgHtmlElem.style.opacity === '0.5') {
33904
+ imgHtmlElem.style.opacity = '1';
33905
+ }
33906
+ }
33907
+ }
33908
+ else {
33909
+ imgElem.style.opacity = '1';
33910
+ }
33886
33911
  _this.toolbarEnableDisable(false);
33887
33912
  if (uploadObj && document.body.contains(uploadObj.element)) {
33888
33913
  uploadObj.destroy();
@@ -37571,7 +37596,14 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
37571
37596
  var isMediaNode = false; // To check the image audio and video node cases
37572
37597
  var isFocusedFirst = false;
37573
37598
  var parentElement = _this.range.startContainer.parentElement;
37574
- var isPreWrapApplied = parentElement ? _this.parent.contentModule.getDocument().defaultView.getComputedStyle(parentElement, null).getPropertyValue('white-space') === 'pre-wrap' : false;
37599
+ var isPreWrapApplied = false;
37600
+ var isTextWrapApplied = false;
37601
+ if (parentElement) {
37602
+ // eslint-disable-next-line max-len
37603
+ var computedStyle = _this.parent.contentModule.getDocument().defaultView.getComputedStyle(parentElement);
37604
+ isPreWrapApplied = computedStyle.getPropertyValue('white-space') === 'pre-wrap';
37605
+ isTextWrapApplied = computedStyle.getPropertyValue('text-wrap') === 'nowrap';
37606
+ }
37575
37607
  if (_this.range.startOffset !== 0 && _this.range.endOffset !== 0 &&
37576
37608
  _this.range.startContainer === _this.range.endContainer && !(!isNullOrUndefined(nearBlockNode.childNodes[0])
37577
37609
  && (nearBlockNode.childNodes[0].nodeName === 'IMG' || nearBlockNode.querySelectorAll('img, audio, video').length > 0))) {
@@ -37581,9 +37613,9 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
37581
37613
  var isSplitTextEmpty = splitFirstText.trim().length === 0;
37582
37614
  var hasContentAfterCursor = startNodeText.slice(_this.range.startOffset).trim().length !== 0;
37583
37615
  var isCursorAtStartNonPreWrap = lastCharBeforeCursor !== 160
37584
- && isSplitTextEmpty && !isPreWrapApplied;
37616
+ && isSplitTextEmpty && !isPreWrapApplied && !isTextWrapApplied;
37585
37617
  var isCursorAtStartPreWrapWithContent = lastCharBeforeCursor === 32
37586
- && isPreWrapApplied && isSplitTextEmpty && hasContentAfterCursor;
37618
+ && (isPreWrapApplied || isTextWrapApplied) && isSplitTextEmpty && hasContentAfterCursor;
37587
37619
  if (isCursorAtStartNonPreWrap || isCursorAtStartPreWrapWithContent) {
37588
37620
  isFocusedFirst = true;
37589
37621
  }