@syncfusion/ej2-richtexteditor 28.1.33 → 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.
Files changed (82) hide show
  1. package/dist/ej2-richtexteditor.min.js +1 -10
  2. package/dist/ej2-richtexteditor.umd.min.js +1 -10
  3. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-richtexteditor.es2015.js +67 -18
  5. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-richtexteditor.es5.js +67 -18
  7. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  8. package/dist/global/ej2-richtexteditor.min.js +1 -10
  9. package/dist/global/ej2-richtexteditor.min.js.map +1 -1
  10. package/dist/global/index.d.ts +0 -9
  11. package/package.json +9 -10
  12. package/src/editor-manager/plugin/inserthtml.js +15 -4
  13. package/src/editor-manager/plugin/link.js +1 -0
  14. package/src/editor-manager/plugin/ms-word-clean-up.js +4 -2
  15. package/src/rich-text-editor/actions/enter-key.js +10 -3
  16. package/src/rich-text-editor/actions/paste-clean-up.js +26 -3
  17. package/src/rich-text-editor/renderer/toolbar-renderer.js +11 -6
  18. package/styles/bds-lite.css +8 -2
  19. package/styles/bds.css +8 -2
  20. package/styles/bootstrap-dark-lite.css +8 -2
  21. package/styles/bootstrap-dark.css +8 -2
  22. package/styles/bootstrap-lite.css +8 -2
  23. package/styles/bootstrap.css +8 -2
  24. package/styles/bootstrap4-lite.css +8 -2
  25. package/styles/bootstrap4.css +8 -2
  26. package/styles/bootstrap5-dark-lite.css +8 -2
  27. package/styles/bootstrap5-dark.css +8 -2
  28. package/styles/bootstrap5-lite.css +8 -2
  29. package/styles/bootstrap5.3-lite.css +8 -2
  30. package/styles/bootstrap5.3.css +8 -2
  31. package/styles/bootstrap5.css +8 -2
  32. package/styles/fabric-dark-lite.css +8 -2
  33. package/styles/fabric-dark.css +8 -2
  34. package/styles/fabric-lite.css +8 -2
  35. package/styles/fabric.css +8 -2
  36. package/styles/fluent-dark-lite.css +8 -2
  37. package/styles/fluent-dark.css +8 -2
  38. package/styles/fluent-lite.css +8 -2
  39. package/styles/fluent.css +8 -2
  40. package/styles/fluent2-lite.css +8 -2
  41. package/styles/fluent2.css +8 -2
  42. package/styles/highcontrast-light-lite.css +8 -2
  43. package/styles/highcontrast-light.css +8 -2
  44. package/styles/highcontrast-lite.css +8 -2
  45. package/styles/highcontrast.css +8 -2
  46. package/styles/material-dark-lite.css +8 -2
  47. package/styles/material-dark.css +8 -2
  48. package/styles/material-lite.css +8 -2
  49. package/styles/material.css +8 -2
  50. package/styles/material3-dark-lite.css +8 -2
  51. package/styles/material3-dark.css +8 -2
  52. package/styles/material3-lite.css +8 -2
  53. package/styles/material3.css +8 -2
  54. package/styles/rich-text-editor/_layout.scss +6 -5
  55. package/styles/rich-text-editor/_tailwind3-definition.scss +1 -1
  56. package/styles/rich-text-editor/bds.css +8 -2
  57. package/styles/rich-text-editor/bootstrap-dark.css +8 -2
  58. package/styles/rich-text-editor/bootstrap.css +8 -2
  59. package/styles/rich-text-editor/bootstrap4.css +8 -2
  60. package/styles/rich-text-editor/bootstrap5-dark.css +8 -2
  61. package/styles/rich-text-editor/bootstrap5.3.css +8 -2
  62. package/styles/rich-text-editor/bootstrap5.css +8 -2
  63. package/styles/rich-text-editor/fabric-dark.css +8 -2
  64. package/styles/rich-text-editor/fabric.css +8 -2
  65. package/styles/rich-text-editor/fluent-dark.css +8 -2
  66. package/styles/rich-text-editor/fluent.css +8 -2
  67. package/styles/rich-text-editor/fluent2.css +8 -2
  68. package/styles/rich-text-editor/highcontrast-light.css +8 -2
  69. package/styles/rich-text-editor/highcontrast.css +8 -2
  70. package/styles/rich-text-editor/material-dark.css +8 -2
  71. package/styles/rich-text-editor/material.css +8 -2
  72. package/styles/rich-text-editor/material3-dark.css +8 -2
  73. package/styles/rich-text-editor/material3.css +8 -2
  74. package/styles/rich-text-editor/tailwind-dark.css +8 -2
  75. package/styles/rich-text-editor/tailwind.css +8 -2
  76. package/styles/rich-text-editor/tailwind3.css +13 -8
  77. package/styles/tailwind-dark-lite.css +8 -2
  78. package/styles/tailwind-dark.css +8 -2
  79. package/styles/tailwind-lite.css +8 -2
  80. package/styles/tailwind.css +8 -2
  81. package/styles/tailwind3-lite.css +13 -8
  82. package/styles/tailwind3.css +13 -8
@@ -5928,7 +5928,9 @@ class ToolbarRenderer {
5928
5928
  args.cancel = true;
5929
5929
  return;
5930
5930
  }
5931
- proxy.parent.notify(selectionRestore, {});
5931
+ if (Browser.info.name === 'safari') {
5932
+ proxy.parent.notify(selectionRestore, {});
5933
+ }
5932
5934
  const element = (args.event) ? args.event.target : null;
5933
5935
  proxy.currentElement = dropDown.element;
5934
5936
  proxy.currentDropdown = dropDown;
@@ -5956,10 +5958,14 @@ class ToolbarRenderer {
5956
5958
  args.element.tabIndex = -1;
5957
5959
  dropDown.element.removeAttribute('type');
5958
5960
  dropDown.element.onmousedown = () => {
5959
- proxy.parent.notify(selectionSave, {});
5961
+ if (Browser.info.name === 'safari') {
5962
+ proxy.parent.notify(selectionSave, {});
5963
+ }
5960
5964
  };
5961
5965
  dropDown.element.onkeydown = () => {
5962
- proxy.parent.notify(selectionSave, {});
5966
+ if (Browser.info.name === 'safari') {
5967
+ proxy.parent.notify(selectionSave, {});
5968
+ }
5963
5969
  };
5964
5970
  return dropDown;
5965
5971
  }
@@ -6141,11 +6147,10 @@ class ToolbarRenderer {
6141
6147
  enableRtl: this.parent.enableRtl,
6142
6148
  inline: true,
6143
6149
  value: null,
6144
- 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,
6145
6151
  created: () => {
6146
6152
  const value = (item === 'backgroundcolor') ? proxy.parent.backgroundColor.default : proxy.parent.fontColor.default;
6147
- const cssClass = ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass;
6148
- colorPicker.setProperties({ value: value, cssClass: cssClass });
6153
+ colorPicker.setProperties({ value: value });
6149
6154
  },
6150
6155
  mode: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.mode : proxy.parent.fontColor.mode),
6151
6156
  modeSwitcher: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.modeSwitcher : proxy.parent.fontColor.modeSwitcher),
@@ -22101,7 +22106,7 @@ class InsertHtml {
22101
22106
  static pasteInsertHTML(nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode, enterAction) {
22102
22107
  const isCursor = range.startOffset === range.endOffset &&
22103
22108
  range.startContainer === range.endContainer;
22104
- if (isCursor && range.startContainer === editNode && editNode.textContent === '') {
22109
+ if (isCursor && range.startContainer === editNode && editNode.textContent === '' && range.startOffset === 0 && range.endOffset === 0) {
22105
22110
  const currentBlockNode = this.getImmediateBlockNode(nodes[nodes.length - 1], editNode);
22106
22111
  nodeSelection.setSelectionText(docElement, currentBlockNode, currentBlockNode, 0, 0);
22107
22112
  range = nodeSelection.getRange(docElement);
@@ -22488,9 +22493,20 @@ class InsertHtml {
22488
22493
  }
22489
22494
  }
22490
22495
  if (blockNode && blockNode.nodeName === 'TD' || blockNode.nodeName === 'TH' || blockNode.nodeName === 'TR') {
22491
- const tempSpan = createElement('span', { className: 'tempSpan' });
22492
- range.insertNode(tempSpan);
22493
- tempSpan.parentNode.replaceChild(node, tempSpan);
22496
+ let parentElem = range.startContainer;
22497
+ while (!isNullOrUndefined(parentElem) && parentElem.parentElement !== blockNode) {
22498
+ parentElem = parentElem.parentElement;
22499
+ }
22500
+ range.deleteContents();
22501
+ const splitedElm = nodeCutter.GetSpliceNode(range, parentElem);
22502
+ if (splitedElm) {
22503
+ splitedElm.parentNode.replaceChild(node, splitedElm);
22504
+ }
22505
+ else {
22506
+ range.insertNode(node);
22507
+ }
22508
+ this.contentsDeleted = true;
22509
+ return;
22494
22510
  }
22495
22511
  else {
22496
22512
  const nodeSelection = new NodeSelection(editNode);
@@ -25915,6 +25931,7 @@ class LinkCommand {
25915
25931
  if (child && child.length === 1) {
25916
25932
  e.item.selection.startContainer = e.item.selection.getNodeArray(child[child.length - 1], true);
25917
25933
  e.item.selection.endContainer = e.item.selection.startContainer;
25934
+ e.item.selection.endOffset = child[child.length - 1].textContent.length;
25918
25935
  }
25919
25936
  e.item.selection = this.parent.domNode.saveMarker(e.item.selection);
25920
25937
  }
@@ -30248,7 +30265,8 @@ class MsWordPaste {
30248
30265
  imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0 &&
30249
30266
  imgElem[i].getAttribute('v:shapes').indexOf('_x0000_s') < 0 &&
30250
30267
  imgElem[i].getAttribute('v:shapes').indexOf('_x0000_i') < 0 &&
30251
- 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) {
30252
30270
  imgElem[i].classList.add('e-rte-image-unsupported');
30253
30271
  }
30254
30272
  imgElem[i].removeAttribute('v:shapes');
@@ -30262,7 +30280,8 @@ class MsWordPaste {
30262
30280
  if (imgElem.length > 0) {
30263
30281
  for (let i = 0; i < imgElem.length; i++) {
30264
30282
  imgSrc.push(imgElem[i].getAttribute('src'));
30265
- 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);
30266
30285
  }
30267
30286
  const hexValue = this.hexConversion(rtfData);
30268
30287
  for (let i = 0; i < hexValue.length; i++) {
@@ -34174,8 +34193,20 @@ class PasteCleanup {
34174
34193
  this.parent.trigger(imageUploadSuccess, e, (e) => {
34175
34194
  if (!isNullOrUndefined(this.parent.insertImageSettings.path)) {
34176
34195
  const url = this.parent.insertImageSettings.path + e.file.name;
34177
- imgElem.src = url;
34178
- 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
+ }
34179
34210
  }
34180
34211
  });
34181
34212
  }
@@ -34188,7 +34219,18 @@ class PasteCleanup {
34188
34219
  }
34189
34220
  this.popupCloseTime = setTimeout(() => {
34190
34221
  popupObj.close();
34191
- 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
+ }
34192
34234
  this.toolbarEnableDisable(false);
34193
34235
  if (uploadObj && document.body.contains(uploadObj.element)) {
34194
34236
  uploadObj.destroy();
@@ -37692,7 +37734,14 @@ class EnterKeyAction {
37692
37734
  let isMediaNode = false; // To check the image audio and video node cases
37693
37735
  let isFocusedFirst = false;
37694
37736
  const parentElement = this.range.startContainer.parentElement;
37695
- 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
+ }
37696
37745
  if (this.range.startOffset !== 0 && this.range.endOffset !== 0 &&
37697
37746
  this.range.startContainer === this.range.endContainer && !(!isNullOrUndefined(nearBlockNode.childNodes[0])
37698
37747
  && (nearBlockNode.childNodes[0].nodeName === 'IMG' || nearBlockNode.querySelectorAll('img, audio, video').length > 0))) {
@@ -37702,9 +37751,9 @@ class EnterKeyAction {
37702
37751
  const isSplitTextEmpty = splitFirstText.trim().length === 0;
37703
37752
  const hasContentAfterCursor = startNodeText.slice(this.range.startOffset).trim().length !== 0;
37704
37753
  const isCursorAtStartNonPreWrap = lastCharBeforeCursor !== 160
37705
- && isSplitTextEmpty && !isPreWrapApplied;
37754
+ && isSplitTextEmpty && !isPreWrapApplied && !isTextWrapApplied;
37706
37755
  const isCursorAtStartPreWrapWithContent = lastCharBeforeCursor === 32
37707
- && isPreWrapApplied && isSplitTextEmpty && hasContentAfterCursor;
37756
+ && (isPreWrapApplied || isTextWrapApplied) && isSplitTextEmpty && hasContentAfterCursor;
37708
37757
  if (isCursorAtStartNonPreWrap || isCursorAtStartPreWrapWithContent) {
37709
37758
  isFocusedFirst = true;
37710
37759
  }