@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.
@@ -6147,11 +6147,10 @@ class ToolbarRenderer {
6147
6147
  enableRtl: this.parent.enableRtl,
6148
6148
  inline: true,
6149
6149
  value: null,
6150
- cssClass: ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass + ' ' + 'e-rte-picker-init',
6150
+ cssClass: ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass,
6151
6151
  created: () => {
6152
6152
  const value = (item === 'backgroundcolor') ? proxy.parent.backgroundColor.default : proxy.parent.fontColor.default;
6153
- const cssClass = ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass;
6154
- colorPicker.setProperties({ value: value, cssClass: cssClass });
6153
+ colorPicker.setProperties({ value: value });
6155
6154
  },
6156
6155
  mode: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.mode : proxy.parent.fontColor.mode),
6157
6156
  modeSwitcher: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.modeSwitcher : proxy.parent.fontColor.modeSwitcher),
@@ -25932,6 +25931,7 @@ class LinkCommand {
25932
25931
  if (child && child.length === 1) {
25933
25932
  e.item.selection.startContainer = e.item.selection.getNodeArray(child[child.length - 1], true);
25934
25933
  e.item.selection.endContainer = e.item.selection.startContainer;
25934
+ e.item.selection.endOffset = child[child.length - 1].textContent.length;
25935
25935
  }
25936
25936
  e.item.selection = this.parent.domNode.saveMarker(e.item.selection);
25937
25937
  }
@@ -30265,7 +30265,8 @@ class MsWordPaste {
30265
30265
  imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0 &&
30266
30266
  imgElem[i].getAttribute('v:shapes').indexOf('_x0000_s') < 0 &&
30267
30267
  imgElem[i].getAttribute('v:shapes').indexOf('_x0000_i') < 0 &&
30268
- imgElem[i].getAttribute('v:shapes').indexOf('img1') < 0) {
30268
+ imgElem[i].getAttribute('v:shapes').indexOf('img1') < 0 &&
30269
+ imgElem[i].getAttribute('v:shapes').indexOf('Immagine') < 0) {
30269
30270
  imgElem[i].classList.add('e-rte-image-unsupported');
30270
30271
  }
30271
30272
  imgElem[i].removeAttribute('v:shapes');
@@ -30279,7 +30280,8 @@ class MsWordPaste {
30279
30280
  if (imgElem.length > 0) {
30280
30281
  for (let i = 0; i < imgElem.length; i++) {
30281
30282
  imgSrc.push(imgElem[i].getAttribute('src'));
30282
- imgName.push(imgElem[i].getAttribute('src').split('/')[imgElem[i].getAttribute('src').split('/').length - 1].split('.')[0]);
30283
+ const imageName = imgElem[i].getAttribute('src').split('/')[imgElem[i].getAttribute('src').split('/').length - 1].split('.')[0] + i;
30284
+ imgName.push(imageName);
30283
30285
  }
30284
30286
  const hexValue = this.hexConversion(rtfData);
30285
30287
  for (let i = 0; i < hexValue.length; i++) {
@@ -34191,8 +34193,20 @@ class PasteCleanup {
34191
34193
  this.parent.trigger(imageUploadSuccess, e, (e) => {
34192
34194
  if (!isNullOrUndefined(this.parent.insertImageSettings.path)) {
34193
34195
  const url = this.parent.insertImageSettings.path + e.file.name;
34194
- imgElem.src = url;
34195
- imgElem.setAttribute('alt', e.file.name);
34196
+ if (!this.parent.inputElement.contains(imgElem)) {
34197
+ const imgHtmlElems = this.parent.inputElement.querySelectorAll('#' + imgElem.id);
34198
+ for (let i = 0; i < imgHtmlElems.length; i++) {
34199
+ const imgHtmlElem = imgHtmlElems[i];
34200
+ if (imgHtmlElem && imgHtmlElem.style && imgHtmlElem.style.opacity === '0.5') {
34201
+ imgHtmlElem.src = url;
34202
+ imgHtmlElem.setAttribute('alt', e.file.name);
34203
+ }
34204
+ }
34205
+ }
34206
+ else {
34207
+ imgElem.src = url;
34208
+ imgElem.setAttribute('alt', e.file.name);
34209
+ }
34196
34210
  }
34197
34211
  });
34198
34212
  }
@@ -34205,7 +34219,18 @@ class PasteCleanup {
34205
34219
  }
34206
34220
  this.popupCloseTime = setTimeout(() => {
34207
34221
  popupObj.close();
34208
- imgElem.style.opacity = '1';
34222
+ if (!this.parent.inputElement.contains(imgElem)) {
34223
+ const imgHtmlElems = this.parent.inputElement.querySelectorAll('#' + imgElem.id);
34224
+ for (let i = 0; i < imgHtmlElems.length; i++) {
34225
+ const imgHtmlElem = imgHtmlElems[i];
34226
+ if (imgHtmlElem && imgHtmlElem.style && imgHtmlElem.style.opacity === '0.5') {
34227
+ imgHtmlElem.style.opacity = '1';
34228
+ }
34229
+ }
34230
+ }
34231
+ else {
34232
+ imgElem.style.opacity = '1';
34233
+ }
34209
34234
  this.toolbarEnableDisable(false);
34210
34235
  if (uploadObj && document.body.contains(uploadObj.element)) {
34211
34236
  uploadObj.destroy();
@@ -37709,7 +37734,14 @@ class EnterKeyAction {
37709
37734
  let isMediaNode = false; // To check the image audio and video node cases
37710
37735
  let isFocusedFirst = false;
37711
37736
  const parentElement = this.range.startContainer.parentElement;
37712
- const isPreWrapApplied = parentElement ? this.parent.contentModule.getDocument().defaultView.getComputedStyle(parentElement, null).getPropertyValue('white-space') === 'pre-wrap' : false;
37737
+ let isPreWrapApplied = false;
37738
+ let isTextWrapApplied = false;
37739
+ if (parentElement) {
37740
+ // eslint-disable-next-line max-len
37741
+ const computedStyle = this.parent.contentModule.getDocument().defaultView.getComputedStyle(parentElement);
37742
+ isPreWrapApplied = computedStyle.getPropertyValue('white-space') === 'pre-wrap';
37743
+ isTextWrapApplied = computedStyle.getPropertyValue('text-wrap') === 'nowrap';
37744
+ }
37713
37745
  if (this.range.startOffset !== 0 && this.range.endOffset !== 0 &&
37714
37746
  this.range.startContainer === this.range.endContainer && !(!isNullOrUndefined(nearBlockNode.childNodes[0])
37715
37747
  && (nearBlockNode.childNodes[0].nodeName === 'IMG' || nearBlockNode.querySelectorAll('img, audio, video').length > 0))) {
@@ -37719,9 +37751,9 @@ class EnterKeyAction {
37719
37751
  const isSplitTextEmpty = splitFirstText.trim().length === 0;
37720
37752
  const hasContentAfterCursor = startNodeText.slice(this.range.startOffset).trim().length !== 0;
37721
37753
  const isCursorAtStartNonPreWrap = lastCharBeforeCursor !== 160
37722
- && isSplitTextEmpty && !isPreWrapApplied;
37754
+ && isSplitTextEmpty && !isPreWrapApplied && !isTextWrapApplied;
37723
37755
  const isCursorAtStartPreWrapWithContent = lastCharBeforeCursor === 32
37724
- && isPreWrapApplied && isSplitTextEmpty && hasContentAfterCursor;
37756
+ && (isPreWrapApplied || isTextWrapApplied) && isSplitTextEmpty && hasContentAfterCursor;
37725
37757
  if (isCursorAtStartNonPreWrap || isCursorAtStartPreWrapWithContent) {
37726
37758
  isFocusedFirst = true;
37727
37759
  }