@syncfusion/ej2-richtexteditor 24.2.4 → 24.2.7

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 (89) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/ej2-richtexteditor.min.js +2 -2
  3. package/dist/ej2-richtexteditor.umd.min.js +2 -2
  4. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-richtexteditor.es2015.js +400 -150
  6. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  7. package/dist/es6/ej2-richtexteditor.es5.js +393 -149
  8. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  9. package/dist/global/ej2-richtexteditor.min.js +2 -2
  10. package/dist/global/ej2-richtexteditor.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +11 -11
  13. package/src/common/util.js +4 -1
  14. package/src/editor-manager/plugin/formats.d.ts +1 -0
  15. package/src/editor-manager/plugin/formats.js +37 -2
  16. package/src/editor-manager/plugin/inserthtml.js +15 -2
  17. package/src/editor-manager/plugin/lists.js +14 -1
  18. package/src/editor-manager/plugin/ms-word-clean-up.js +87 -18
  19. package/src/editor-manager/plugin/nodecutter.js +1 -1
  20. package/src/editor-manager/plugin/selection-commands.d.ts +1 -0
  21. package/src/editor-manager/plugin/selection-commands.js +56 -1
  22. package/src/editor-manager/plugin/table.js +1 -1
  23. package/src/rich-text-editor/actions/base-quick-toolbar.js +2 -2
  24. package/src/rich-text-editor/actions/enter-key.js +2 -2
  25. package/src/rich-text-editor/actions/html-editor.js +25 -12
  26. package/src/rich-text-editor/actions/paste-clean-up.d.ts +1 -0
  27. package/src/rich-text-editor/actions/paste-clean-up.js +26 -5
  28. package/src/rich-text-editor/actions/toolbar-action.js +1 -1
  29. package/src/rich-text-editor/actions/toolbar.js +1 -1
  30. package/src/rich-text-editor/base/interface.d.ts +0 -8
  31. package/src/rich-text-editor/base/rich-text-editor-model.d.ts +1 -1
  32. package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -1
  33. package/src/rich-text-editor/base/rich-text-editor.js +12 -2
  34. package/src/rich-text-editor/base/util.js +3 -0
  35. package/src/rich-text-editor/models/default-locale.js +2 -1
  36. package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
  37. package/src/rich-text-editor/renderer/image-module.js +3 -3
  38. package/src/rich-text-editor/renderer/table-module.d.ts +1 -0
  39. package/src/rich-text-editor/renderer/table-module.js +106 -98
  40. package/styles/bootstrap-dark.css +25 -9
  41. package/styles/bootstrap.css +25 -9
  42. package/styles/bootstrap4.css +30 -14
  43. package/styles/bootstrap5-dark.css +25 -9
  44. package/styles/bootstrap5.css +25 -9
  45. package/styles/fabric-dark.css +25 -9
  46. package/styles/fabric.css +25 -9
  47. package/styles/fluent-dark.css +27 -11
  48. package/styles/fluent.css +27 -11
  49. package/styles/highcontrast-light.css +25 -9
  50. package/styles/highcontrast.css +25 -9
  51. package/styles/material-dark.css +25 -9
  52. package/styles/material.css +25 -9
  53. package/styles/material3-dark.css +26 -10
  54. package/styles/material3.css +26 -10
  55. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +4 -2
  56. package/styles/rich-text-editor/_bootstrap-definition.scss +4 -2
  57. package/styles/rich-text-editor/_bootstrap4-definition.scss +8 -6
  58. package/styles/rich-text-editor/_bootstrap5-definition.scss +4 -2
  59. package/styles/rich-text-editor/_fabric-dark-definition.scss +4 -2
  60. package/styles/rich-text-editor/_fabric-definition.scss +4 -2
  61. package/styles/rich-text-editor/_fluent-definition.scss +5 -3
  62. package/styles/rich-text-editor/_fusionnew-definition.scss +4 -2
  63. package/styles/rich-text-editor/_highcontrast-definition.scss +4 -2
  64. package/styles/rich-text-editor/_highcontrast-light-definition.scss +4 -2
  65. package/styles/rich-text-editor/_layout.scss +35 -6
  66. package/styles/rich-text-editor/_material-dark-definition.scss +4 -2
  67. package/styles/rich-text-editor/_material-definition.scss +4 -2
  68. package/styles/rich-text-editor/_material3-definition.scss +5 -3
  69. package/styles/rich-text-editor/_tailwind-definition.scss +21 -19
  70. package/styles/rich-text-editor/_theme.scss +18 -3
  71. package/styles/rich-text-editor/bootstrap-dark.css +25 -9
  72. package/styles/rich-text-editor/bootstrap.css +25 -9
  73. package/styles/rich-text-editor/bootstrap4.css +30 -14
  74. package/styles/rich-text-editor/bootstrap5-dark.css +25 -9
  75. package/styles/rich-text-editor/bootstrap5.css +25 -9
  76. package/styles/rich-text-editor/fabric-dark.css +25 -9
  77. package/styles/rich-text-editor/fabric.css +25 -9
  78. package/styles/rich-text-editor/fluent-dark.css +27 -11
  79. package/styles/rich-text-editor/fluent.css +27 -11
  80. package/styles/rich-text-editor/highcontrast-light.css +25 -9
  81. package/styles/rich-text-editor/highcontrast.css +25 -9
  82. package/styles/rich-text-editor/material-dark.css +25 -9
  83. package/styles/rich-text-editor/material.css +25 -9
  84. package/styles/rich-text-editor/material3-dark.css +26 -10
  85. package/styles/rich-text-editor/material3.css +26 -10
  86. package/styles/rich-text-editor/tailwind-dark.css +68 -32
  87. package/styles/rich-text-editor/tailwind.css +68 -32
  88. package/styles/tailwind-dark.css +68 -32
  89. package/styles/tailwind.css +68 -32
@@ -2812,6 +2812,7 @@ var defaultLocale = {
2812
2812
  'emojiPickerNoResultFound': 'No results found',
2813
2813
  'emojiPickerTrySomethingElse': 'Try something else',
2814
2814
  'linkAriaLabel': 'Open in new window',
2815
+ 'unsupportedImage': 'Unsupported file format'
2815
2816
  };
2816
2817
  var toolsLocale = {
2817
2818
  'alignments': 'alignments',
@@ -2907,7 +2908,7 @@ var toolsLocale = {
2907
2908
  'emojiPickerTypeToFind': 'Type to find',
2908
2909
  'emojiPickerNoResultFound': 'No results found',
2909
2910
  'emojiPickerTrySomethingElse': 'Try something else',
2910
- 'ImageLinkAriaLabel': 'Open in new window',
2911
+ 'imageLinkAriaLabel': 'Open in new window',
2911
2912
  };
2912
2913
  var fontNameLocale = [
2913
2914
  { locale: 'fontNameSegoeUI', value: 'Segoe UI' },
@@ -3438,6 +3439,9 @@ function updateTextNode(value, rteObj) {
3438
3439
  }
3439
3440
  var imageElm = resultElm.querySelectorAll('img');
3440
3441
  for (var i = 0; i < imageElm.length; i++) {
3442
+ if (imageElm[i].classList.contains('e-rte-image-unsupported')) {
3443
+ continue; // Should not add the class if the image is Broken.
3444
+ }
3441
3445
  if (!imageElm[i].classList.contains(CLS_RTE_IMAGE)) {
3442
3446
  imageElm[i].classList.add(CLS_RTE_IMAGE);
3443
3447
  }
@@ -5074,7 +5078,7 @@ var ToolbarAction = /** @__PURE__ @class */ (function () {
5074
5078
  if (args.item.command === 'Lists') {
5075
5079
  if (args.originalEvent.target.classList.contains('e-caret') &&
5076
5080
  (args.originalEvent.target.parentElement.classList.contains('e-rte-bulletformatlist-dropdown') || args.originalEvent.target.parentElement.classList.contains('e-rte-numberformatlist-dropdown'))) {
5077
- args.item.command = args.item.subCommand = null;
5081
+ return;
5078
5082
  }
5079
5083
  }
5080
5084
  this.parent.notify(htmlToolbarClick, args);
@@ -5685,7 +5689,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
5685
5689
  else if (Browser.isDevice || this.parent.inlineMode.enable) {
5686
5690
  this.isToolbar = true;
5687
5691
  }
5688
- if (isNullOrUndefined(trg) && this.parent.toolbarSettings.type === ToolbarType.Expand) {
5692
+ if (isNullOrUndefined(trg) && this.parent.toolbarSettings.type === ToolbarType.Expand && this.parent.toolbarModule.getExpandTBarPopHeight() === 0) {
5689
5693
  removeClass([this.tbElement], [CLS_EXPAND_OPEN]);
5690
5694
  }
5691
5695
  };
@@ -6364,7 +6368,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
6364
6368
  e.target.classList.contains('e-imgbreak')) ? false : true;
6365
6369
  var target = !isNullOrUndefined(imgWrapper) ? imgWrapper : e.target;
6366
6370
  addClass([this.toolbarElement], [CLS_RM_WHITE_SPACE]);
6367
- var targetOffsetTop = target.offsetTop;
6371
+ var targetOffsetTop = (target.classList.contains("e-rte-audio")) ? target.parentElement.offsetTop : target.offsetTop;
6368
6372
  var parentOffsetTop = window.pageYOffset + e.parentData.top;
6369
6373
  if ((targetOffsetTop - e.editTop) > e.popHeight) {
6370
6374
  y = parentOffsetTop + e.tBarElementHeight + (targetOffsetTop - e.editTop) - e.popHeight - 5;
@@ -6377,7 +6381,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
6377
6381
  }
6378
6382
  target = isAligned ? e.target : target;
6379
6383
  if (target.offsetWidth > e.popWidth) {
6380
- x = (target.offsetWidth / 2) - (e.popWidth / 2) + e.parentData.left + target.offsetLeft;
6384
+ x = (target.offsetWidth / 2) - (e.popWidth / 2) + e.parentData.left + ((target.classList.contains("e-rte-audio")) ? target.parentElement.offsetLeft : target.offsetLeft);
6381
6385
  }
6382
6386
  else {
6383
6387
  x = e.parentData.left + target.offsetLeft;
@@ -7833,7 +7837,7 @@ function updateTextNode$1(value, enterAction) {
7833
7837
  tableElm[i].classList.add('e-rte-paste-table');
7834
7838
  if (tableElm[i].classList.contains('e-rte-paste-word-table')) {
7835
7839
  tableElm[i].classList.remove('e-rte-paste-word-table');
7836
- continue; // Sking the removal of the border if the source is from word.
7840
+ continue; // Skiping the removal of the border if the source is from word.
7837
7841
  }
7838
7842
  else if (tableElm[i].classList.contains('e-rte-paste-excel-table')) {
7839
7843
  tableElm[i].classList.remove('e-rte-paste-excel-table');
@@ -7867,6 +7871,9 @@ function updateTextNode$1(value, enterAction) {
7867
7871
  }
7868
7872
  var imageElm = resultElm.querySelectorAll('img');
7869
7873
  for (var i = 0; i < imageElm.length; i++) {
7874
+ if (imageElm[i].classList.contains('e-rte-image-unsupported')) {
7875
+ continue; // Should not add the class if the image is Broken.
7876
+ }
7870
7877
  if (!imageElm[i].classList.contains('e-rte-image')) {
7871
7878
  imageElm[i].classList.add('e-rte-image');
7872
7879
  }
@@ -12733,6 +12740,9 @@ var Lists = /** @__PURE__ @class */ (function () {
12733
12740
  isNullOrUndefined(item) && nodes[i].parentNode.style.listStyleType !== '') {
12734
12741
  isRevert = false;
12735
12742
  }
12743
+ if (nodes[i].parentNode.tagName === tagName && nodes[i].parentNode.style.listStyleType !== '') {
12744
+ isRevert = true;
12745
+ }
12736
12746
  }
12737
12747
  return isRevert;
12738
12748
  };
@@ -12873,8 +12883,18 @@ var Lists = /** @__PURE__ @class */ (function () {
12873
12883
  if (DEFAULT_TAG && 0 === element.querySelectorAll(BLOCK_TAGS.join(', ')).length) {
12874
12884
  var wrapperclass = isNullOrUndefined(className) ? ' class="e-rte-wrap-inner"' :
12875
12885
  ' class="' + className + ' e-rte-wrap-inner"';
12886
+ var parentElement = parentNode;
12887
+ if (!isNullOrUndefined(parentElement.style.listStyleType)) {
12888
+ parentNode.style.removeProperty("list-style-type");
12889
+ }
12890
+ if (!isNullOrUndefined(parentElement.style.listStyleImage)) {
12891
+ parentNode.style.removeProperty("list-style-image");
12892
+ }
12893
+ if (parentElement.style.length === 0) {
12894
+ parentNode.removeAttribute("style");
12895
+ }
12876
12896
  var wrapper = '<' + DEFAULT_TAG + wrapperclass +
12877
- this.domNode.attributes(parentNode) + '></' + DEFAULT_TAG + '>';
12897
+ this.domNode.attributes(parentElement) + '></' + DEFAULT_TAG + '>';
12878
12898
  if (e.enterAction !== 'BR') {
12879
12899
  this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapper));
12880
12900
  }
@@ -13134,7 +13154,7 @@ var NodeCutter = /** @__PURE__ @class */ (function () {
13134
13154
  else if (len > -1) {
13135
13155
  this.spliceEmptyNode(fragment.childNodes[0], isStart);
13136
13156
  }
13137
- else if (fragment.nodeType !== 3 && fragment.nodeType !== 11 && fragment.nodeName !== 'IMG' && !(fragment.classList.contains('e-video-wrap')) && !(fragment.classList.contains('e-audio-wrap'))) {
13157
+ else if (fragment.nodeType !== 3 && fragment.nodeType !== 11 && fragment.nodeName !== 'IMG' && !(fragment.querySelectorAll('img').length > 0) && !(fragment.classList.contains('e-video-wrap')) && !(fragment.classList.contains('e-audio-wrap'))) {
13138
13158
  fragment.parentNode.removeChild(fragment);
13139
13159
  }
13140
13160
  return fragment;
@@ -13268,6 +13288,14 @@ var Formats = /** @__PURE__ @class */ (function () {
13268
13288
  }
13269
13289
  }
13270
13290
  };
13291
+ Formats.prototype.getBlockParent = function (node, endNode) {
13292
+ var currentParent;
13293
+ while (node != endNode) {
13294
+ currentParent = node;
13295
+ node = node.parentElement;
13296
+ }
13297
+ return currentParent;
13298
+ };
13271
13299
  Formats.prototype.onKeyDown = function (e) {
13272
13300
  if (e.event.which === 13) {
13273
13301
  var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
@@ -13277,6 +13305,8 @@ var Formats = /** @__PURE__ @class */ (function () {
13277
13305
  ? range.endContainer : range.endContainer.parentElement;
13278
13306
  var preElem = closest(startCon, 'pre');
13279
13307
  var endPreElem = closest(endCon, 'pre');
13308
+ var blockquoteEle = closest(startCon, 'blockquote');
13309
+ var endBlockquoteEle = closest(endCon, 'blockquote');
13280
13310
  var liParent = !isNullOrUndefined(preElem) && !isNullOrUndefined(preElem.parentElement) && preElem.parentElement.tagName === 'LI';
13281
13311
  if (liParent) {
13282
13312
  return;
@@ -13288,6 +13318,17 @@ var Formats = /** @__PURE__ @class */ (function () {
13288
13318
  range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
13289
13319
  this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, endCon, 0);
13290
13320
  }
13321
+ if (e.event.which === 13 && ((!isNullOrUndefined(blockquoteEle) && !isNullOrUndefined(endBlockquoteEle)) || (!isNullOrUndefined(blockquoteEle) && isNullOrUndefined(endBlockquoteEle)))) {
13322
+ var startParent = this.getBlockParent(range.startContainer, blockquoteEle);
13323
+ if ((startParent.textContent.charCodeAt(0) === 8203 &&
13324
+ startParent.textContent.length === 1) || startParent.textContent.length === 0) {
13325
+ if (isNullOrUndefined(startParent.nextSibling) && ((startParent.previousSibling.textContent.charCodeAt(0) === 8203 &&
13326
+ startParent.previousSibling.textContent.length === 1) || startParent.previousSibling.textContent.length === 0)) {
13327
+ e.event.preventDefault();
13328
+ this.paraFocus(startParent.parentElement); //Revert from blockquotes while pressing enter key
13329
+ }
13330
+ }
13331
+ }
13291
13332
  if (e.event.which === 13 && !isNullOrUndefined(preElem) && !isNullOrUndefined(endPreElem)) {
13292
13333
  e.event.preventDefault();
13293
13334
  this.deleteContent(range);
@@ -13511,7 +13552,7 @@ var Formats = /** @__PURE__ @class */ (function () {
13511
13552
  replaceHTML = parentNode.innerHTML;
13512
13553
  }
13513
13554
  if ((e.subCommand.toLowerCase() === parentNode.tagName.toLowerCase() &&
13514
- (e.subCommand.toLowerCase() !== 'pre' ||
13555
+ (e.subCommand.toLowerCase() !== 'pre' && e.subCommand.toLowerCase() !== 'blockquote' ||
13515
13556
  (!isNullOrUndefined(e.exeValue) && e.exeValue.name === 'dropDownSelect'))) ||
13516
13557
  isNullOrUndefined(parentNode.parentNode) ||
13517
13558
  (parentNode.tagName === 'TABLE' && e.subCommand.toLowerCase() === 'pre')) {
@@ -13520,7 +13561,21 @@ var Formats = /** @__PURE__ @class */ (function () {
13520
13561
  this.cleanFormats(parentNode, e.subCommand);
13521
13562
  var replaceNode = (e.subCommand.toLowerCase() === 'pre' && parentNode.tagName.toLowerCase() === 'pre') ?
13522
13563
  'p' : e.subCommand;
13523
- var replaceTag = this.parent.domNode.createTagString(replaceNode, parentNode, replaceHTML.replace(/>\s+</g, '><'));
13564
+ var isToggleBlockquoteList = e.subCommand.toLowerCase() === parentNode.tagName.toLowerCase() &&
13565
+ e.subCommand.toLowerCase() === 'blockquote' && this.parent.domNode.isList(parentNode.firstElementChild);
13566
+ var isToggleBlockquote = e.subCommand.toLowerCase() === parentNode.tagName.toLowerCase()
13567
+ && e.subCommand.toLowerCase() === 'blockquote';
13568
+ var replaceTag = void 0;
13569
+ if (isToggleBlockquoteList) {
13570
+ replaceTag = replaceHTML.replace(/>\s+</g, '><');
13571
+ }
13572
+ else if (isToggleBlockquote) {
13573
+ var tagWrap = (e.enterAction == 'BR' || e.enterAction == 'P') ? 'P' : e.enterAction;
13574
+ replaceTag = this.parent.domNode.createTagString(tagWrap, parentNode, replaceHTML.replace(/>\s+</g, '><'));
13575
+ }
13576
+ else {
13577
+ replaceTag = this.parent.domNode.createTagString(replaceNode, parentNode, replaceHTML.replace(/>\s+</g, '><'));
13578
+ }
13524
13579
  if (parentNode.tagName === 'LI') {
13525
13580
  parentNode.innerHTML = '';
13526
13581
  parentNode.insertAdjacentHTML('beforeend', replaceTag);
@@ -13832,12 +13887,17 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
13832
13887
  preNode.parentNode.replaceChild(fragment, preNode);
13833
13888
  }
13834
13889
  else {
13890
+ var startContainerParent = range.startContainer.parentNode;
13891
+ // Get the index of the start container among its siblings
13892
+ var startIndex = Array.prototype.indexOf.call(startContainerParent.childNodes, range.startContainer);
13835
13893
  range.deleteContents();
13894
+ range.setStart(startContainerParent, startIndex);
13895
+ range.setEnd(startContainerParent, startIndex);
13836
13896
  if (!isNullOrUndefined(lasNode)) {
13837
13897
  detach(lasNode);
13838
13898
  }
13839
13899
  // eslint-disable-next-line
13840
- !isNullOrUndefined(sibNode) ? sibNode.parentNode.appendChild(fragment) : editNode.appendChild(fragment);
13900
+ !isNullOrUndefined(sibNode) ? (sibNode.parentNode === editNode ? sibNode.appendChild(fragment) : sibNode.parentNode.appendChild(fragment)) : range.insertNode(fragment);
13841
13901
  }
13842
13902
  }
13843
13903
  else {
@@ -14062,7 +14122,15 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
14062
14122
  };
14063
14123
  InsertHtml.imageFocus = function (node, nodeSelection, docElement) {
14064
14124
  var focusNode = document.createTextNode(' ');
14065
- node.parentNode.insertBefore(focusNode, node.nextSibling);
14125
+ if (node.parentNode && node.parentNode.nodeName === 'A') {
14126
+ var anchorTag = node.parentNode;
14127
+ var parentNode = anchorTag.parentNode;
14128
+ parentNode.insertBefore(focusNode, anchorTag.nextSibling);
14129
+ parentNode.insertBefore(node, focusNode);
14130
+ }
14131
+ else {
14132
+ node.parentNode.insertBefore(focusNode, node.nextSibling);
14133
+ }
14066
14134
  nodeSelection.setSelectionText(docElement, node.nextSibling, node.nextSibling, 0, 0);
14067
14135
  };
14068
14136
  // eslint-disable-next-line
@@ -15999,7 +16067,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
15999
16067
  var eleArray = elements;
16000
16068
  //eslint-disable-next-line
16001
16069
  if (min < (max = Math.min(max, eleArray[0].length - 1))) {
16002
- for (colIndex === min; colIndex <= max; colIndex++) {
16070
+ for (colIndex = min; colIndex <= max; colIndex++) {
16003
16071
  // eslint-disable-next-line
16004
16072
  if (!(min < colIndex && eleArray[0][colIndex] === eleArray[0][colIndex - 1]) && 1 < (index =
16005
16073
  Math.min(parseInt(eleArray[0][colIndex].getAttribute('colspan'), 10) || 1, max - min + 1)) &&
@@ -16686,6 +16754,29 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
16686
16754
  var nodeCutter = new NodeCutter();
16687
16755
  var isFormatted = new IsFormatted();
16688
16756
  var range = domSelection.getRange(docElement);
16757
+ var currentAnchorNode = range.startContainer.parentElement;
16758
+ if (range.collapsed && !isNullOrUndefined(currentAnchorNode) &&
16759
+ currentAnchorNode.tagName === 'A' &&
16760
+ (range.startOffset === currentAnchorNode.textContent.length || range.startOffset === 0)) {
16761
+ var emptyTextNode = document.createTextNode('');
16762
+ if (range.startOffset === 0) {
16763
+ currentAnchorNode.parentNode.insertBefore(emptyTextNode, currentAnchorNode);
16764
+ }
16765
+ else {
16766
+ if (!isNullOrUndefined(currentAnchorNode.nextSibling)) {
16767
+ currentAnchorNode.parentElement.insertBefore(emptyTextNode, currentAnchorNode.nextSibling);
16768
+ }
16769
+ else {
16770
+ currentAnchorNode.parentNode.appendChild(emptyTextNode);
16771
+ }
16772
+ }
16773
+ // Set the range to the empty text node
16774
+ var newRange = docElement.createRange();
16775
+ range.setStart(emptyTextNode, 0);
16776
+ range.setEnd(emptyTextNode, 0);
16777
+ range.collapse(true);
16778
+ domSelection.setRange(docElement, newRange);
16779
+ }
16689
16780
  if (Browser.userAgent.indexOf('Firefox') !== -1 && range.startContainer === range.endContainer && !isNullOrUndefined(endNode) && range.startContainer === endNode) {
16690
16781
  var startChildNodes = range.startContainer.childNodes;
16691
16782
  var startNode = ((startChildNodes[(range.startOffset > 0) ? (range.startOffset - 1) :
@@ -17061,7 +17152,10 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
17061
17152
  }
17062
17153
  var num = index;
17063
17154
  var liChildContent = '';
17064
- while (num >= 0 && !isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' && liElement.textContent.replace('/\u200B/g', '').trim().includes(nodes[num].textContent.trim())) {
17155
+ /* eslint-disable security/detect-object-injection */
17156
+ while (num >= 0 && !isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' && liElement.contains(nodes[num]) &&
17157
+ liElement.textContent.replace('/\u200B/g', '').trim().includes(nodes[num].textContent.trim())) {
17158
+ /* eslint-enable security/detect-object-injection */
17065
17159
  liChildContent = ' ' + nodes[num].textContent.trim() + liChildContent;
17066
17160
  num--;
17067
17161
  }
@@ -17133,6 +17227,23 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
17133
17227
  parentElement = parentElement.parentElement;
17134
17228
  liElement = parentElement;
17135
17229
  }
17230
+ if (format === 'fontcolor') {
17231
+ var parentElem = nodes[index].parentElement;
17232
+ if (!isNullOrUndefined(parentElem) && parentElem.childNodes) {
17233
+ for (var i = 0; i < parentElem.childNodes.length; i++) {
17234
+ if (this.concatenateTextExcludingList(nodes, index) === nodes[index].textContent) {
17235
+ if (parentElem.tagName === 'LI') {
17236
+ parentElem.style.color = value;
17237
+ }
17238
+ }
17239
+ // eslint-disable-next-line
17240
+ var childElement = parentElem.childNodes[i];
17241
+ if (childElement.tagName === 'OL' || childElement.tagName === 'UL') {
17242
+ childElement.style.color = 'initial';
17243
+ }
17244
+ }
17245
+ }
17246
+ }
17136
17247
  if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' &&
17137
17248
  liElement.textContent.trim() === nodes[index].textContent.trim()) {
17138
17249
  if (format === 'fontsize') {
@@ -17432,6 +17543,18 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
17432
17543
  }
17433
17544
  }
17434
17545
  };
17546
+ SelectionCommands.concatenateTextExcludingList = function (nodes, index) {
17547
+ var result = '';
17548
+ var parentNode = nodes[index].parentElement;
17549
+ for (var i = 0; i < parentNode.childNodes.length; i++) {
17550
+ // eslint-disable-next-line
17551
+ var childNode = parentNode.childNodes[i];
17552
+ if ((childNode.nodeType === 3) || (childNode.nodeType === 1 && (childNode.tagName !== 'OL' && childNode.tagName !== 'UL'))) {
17553
+ result += childNode.textContent;
17554
+ }
17555
+ }
17556
+ return result;
17557
+ };
17435
17558
  SelectionCommands.enterAction = 'P';
17436
17559
  return SelectionCommands;
17437
17560
  }());
@@ -18149,7 +18272,6 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18149
18272
  if (patern.test(tempHTMLContent) || patern2.test(tempHTMLContent) || patern3.test(tempHTMLContent) ||
18150
18273
  pattern4.test(tempHTMLContent)) {
18151
18274
  var source = this.findSource(elm);
18152
- this.imageConversion(elm, rtfData);
18153
18275
  tempHTMLContent = tempHTMLContent.replace(/<img[^>]+>/i, '');
18154
18276
  this.addListClass(elm);
18155
18277
  listNodes = this.cleanUp(elm, listNodes);
@@ -18157,6 +18279,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18157
18279
  listNodes[0].parentElement.tagName !== 'OL') {
18158
18280
  this.listConverter(listNodes);
18159
18281
  }
18282
+ this.imageConversion(elm, rtfData);
18160
18283
  this.cleanList(elm, 'UL');
18161
18284
  this.cleanList(elm, 'OL');
18162
18285
  this.styleCorrection(elm, wordPasteStyleConfig);
@@ -18165,11 +18288,11 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18165
18288
  this.removeEmptyElements(elm);
18166
18289
  this.removeEmptyAnchorTag(elm);
18167
18290
  this.breakLineAddition(elm);
18291
+ this.processMargin(elm);
18168
18292
  this.removeClassName(elm);
18169
18293
  if (pattern4.test(tempHTMLContent)) {
18170
18294
  this.addTableBorderClass(elm);
18171
18295
  }
18172
- this.processMargin(elm);
18173
18296
  e.callBack(elm.innerHTML, this.cropImageDimensions, source);
18174
18297
  }
18175
18298
  else {
@@ -18240,8 +18363,9 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18240
18363
  imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0 &&
18241
18364
  imgElem[i].getAttribute('v:shapes').indexOf('_x0000_s') < 0 &&
18242
18365
  imgElem[i].getAttribute('v:shapes').indexOf('_x0000_i') < 0) {
18243
- detach(imgElem[i]);
18366
+ imgElem[i].classList.add('e-rte-image-unsupported');
18244
18367
  }
18368
+ imgElem[i].removeAttribute('v:shapes');
18245
18369
  }
18246
18370
  imgElem = elm.querySelectorAll('img');
18247
18371
  var imgSrc = [];
@@ -18271,6 +18395,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18271
18395
  });
18272
18396
  }
18273
18397
  }
18398
+ imgElem = elm.querySelectorAll('img:not(.e-rte-image-unsupported');
18274
18399
  for (var i = 0; i < imgElem.length; i++) {
18275
18400
  if (imgSrc[i].match(linkRegex)) {
18276
18401
  imgElem[i].setAttribute('src', imgSrc[i]);
@@ -18281,7 +18406,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18281
18406
  }
18282
18407
  else {
18283
18408
  imgElem[i].removeAttribute('src');
18284
- imgElem[i].setAttribute('alt', 'Unsupported file format');
18409
+ imgElem[i].classList.add('e-rte-image-unsupported');
18285
18410
  }
18286
18411
  if (!isNullOrUndefined(base64Src[i]) && base64Src[i].isCroppedImage) {
18287
18412
  imgElem[i].classList.add('e-img-cropped');
@@ -18289,6 +18414,10 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18289
18414
  }
18290
18415
  imgElem[i].setAttribute('id', 'msWordImg-' + imgName[i]);
18291
18416
  }
18417
+ imgElem = elm.querySelectorAll('.e-rte-image-unsupported');
18418
+ for (var i = 0; i < imgElem.length; i++) {
18419
+ imgElem[i].removeAttribute('src');
18420
+ }
18292
18421
  }
18293
18422
  };
18294
18423
  MsWordPaste.prototype.checkVShape = function (elm) {
@@ -18362,6 +18491,9 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18362
18491
  var result = [];
18363
18492
  if (!isNullOrUndefined(fullImg)) {
18364
18493
  for (var i = 0; i < fullImg.length; i++) {
18494
+ if (fullImg[i].indexOf('fIsBullet') !== -1 && fullImg[i].indexOf('wzName') === -1) {
18495
+ continue;
18496
+ }
18365
18497
  var isCroppedImage = false;
18366
18498
  var goalWidth = 0;
18367
18499
  var goalHeight = 0;
@@ -18376,7 +18508,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18376
18508
  else if (fullImg[i].indexOf('\\jpegblip') !== -1) {
18377
18509
  imgType = 'image/jpeg';
18378
18510
  }
18379
- else if (fullImg[i].indexOf('\\picprop') !== -1) {
18511
+ else if (fullImg[i].indexOf('\\emfblip') !== -1) {
18380
18512
  imgType = null;
18381
18513
  }
18382
18514
  else {
@@ -18416,7 +18548,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18416
18548
  return parseInt(result, 10);
18417
18549
  };
18418
18550
  MsWordPaste.prototype.removeClassName = function (elm) {
18419
- var elmWithClass = elm.querySelectorAll('*[class]:not(.e-img-cropped)');
18551
+ var elmWithClass = elm.querySelectorAll('*[class]:not(.e-img-cropped):not(.e-rte-image-unsupported)');
18420
18552
  for (var i = 0; i < elmWithClass.length; i++) {
18421
18553
  elmWithClass[i].removeAttribute('class');
18422
18554
  }
@@ -18689,6 +18821,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18689
18821
  MsWordPaste.prototype.listConverter = function (listNodes) {
18690
18822
  var level;
18691
18823
  var data = [];
18824
+ var listFormatOverride;
18692
18825
  var collection = [];
18693
18826
  var content = '';
18694
18827
  var stNode;
@@ -18710,6 +18843,17 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18710
18843
  else {
18711
18844
  level = 1;
18712
18845
  }
18846
+ if (content && content.indexOf('mso-list:') !== -1) {
18847
+ var msoListValue = void 0;
18848
+ if (content.match(/mso-list:[^;]+;?/)) {
18849
+ var changedContent = content.replace('\n', '').split(' ').join('');
18850
+ msoListValue = changedContent.match(/mso-list:[^;]+;?/)[0].split(':l');
18851
+ listFormatOverride = isNullOrUndefined(msoListValue) ? null : parseInt(msoListValue[1].split('level')[0], 10);
18852
+ }
18853
+ else {
18854
+ listFormatOverride = null;
18855
+ }
18856
+ }
18713
18857
  this.listContents = [];
18714
18858
  this.getListContent(listNodes[i]);
18715
18859
  var type = void 0;
@@ -18745,9 +18889,9 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18745
18889
  startAttr = this.lowerGreekNumber.indexOf(this.listContents[0].split('.')[0]) + 1;
18746
18890
  }
18747
18891
  }
18748
- if (listNodes[i].style.marginLeft !== '') {
18749
- styleMarginLeft = listNodes[i].style.marginLeft;
18750
- }
18892
+ }
18893
+ if (listNodes[i].style.marginLeft !== '') {
18894
+ styleMarginLeft = listNodes[i].style.marginLeft;
18751
18895
  }
18752
18896
  var tempNode = [];
18753
18897
  for (var j = 1; j < this.listContents.length; j++) {
@@ -18763,7 +18907,8 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18763
18907
  currentListStyle = listNodes[i].getAttribute('style');
18764
18908
  }
18765
18909
  collection.push({
18766
- listType: type, content: tempNode, nestedLevel: level, class: currentClassName,
18910
+ listType: type, content: tempNode, nestedLevel: level,
18911
+ listFormatOverride: listFormatOverride, class: currentClassName,
18767
18912
  listStyle: currentListStyle, listStyleTypeName: listStyleType, start: startAttr, styleMarginLeft: styleMarginLeft
18768
18913
  });
18769
18914
  }
@@ -18836,6 +18981,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18836
18981
  var prevList;
18837
18982
  var listCount = 0;
18838
18983
  var elem;
18984
+ var lfo = collection[0].listFormatOverride;
18839
18985
  for (var index = 0; index < collection.length; index++) {
18840
18986
  var listClass = ['MsoListParagraphCxSpFirst', 'MsoListParagraphCxSpMiddle', 'MsoListParagraphCxSpLast'];
18841
18987
  var isNormalList = false;
@@ -18852,16 +18998,24 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18852
18998
  }
18853
18999
  var pElement = createElement('p', { className: 'MsoNormal' });
18854
19000
  pElement.innerHTML = collection[index].content.join(' ');
18855
- if ((collection[index].nestedLevel === 1) && listCount === 0 && collection[index].content) {
19001
+ if ((collection[index].nestedLevel === 1) &&
19002
+ (listCount === 0 || lfo !== collection[index].listFormatOverride) &&
19003
+ collection[index].content) {
18856
19004
  root.appendChild(temp = createElement(collection[index].listType, { className: collection[index].class }));
18857
19005
  prevList = createElement('li');
18858
19006
  prevList.appendChild(pElement);
18859
19007
  temp.appendChild(prevList);
18860
19008
  temp.setAttribute('level', collection[index].nestedLevel.toString());
18861
- temp.style.marginLeft = collection[index].styleMarginLeft;
19009
+ if (collection[index].class !== 'msolistparagraph') {
19010
+ temp.style.marginLeft = collection[index].styleMarginLeft;
19011
+ }
19012
+ else {
19013
+ addClass([temp], 'marginLeftIgnore');
19014
+ }
18862
19015
  temp.style.listStyleType = collection[index].listStyleTypeName;
18863
19016
  }
18864
- else if (collection[index].nestedLevel === pLevel) {
19017
+ else if (collection[index].nestedLevel === pLevel &&
19018
+ lfo === collection[index].listFormatOverride) {
18865
19019
  if (!isNullOrUndefined(prevList) && !isNullOrUndefined(prevList.parentElement)
18866
19020
  && prevList.parentElement.tagName.toLowerCase() === collection[index].listType) {
18867
19021
  prevList.parentElement.appendChild(prevList = createElement('li'));
@@ -18924,6 +19078,12 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18924
19078
  prevList.appendChild(pElement);
18925
19079
  temp.appendChild(prevList);
18926
19080
  temp.setAttribute('level', collection[index].nestedLevel.toString());
19081
+ if (collection[index].class !== 'msolistparagraph') {
19082
+ temp.style.marginLeft = collection[index].styleMarginLeft;
19083
+ }
19084
+ else {
19085
+ addClass([temp], 'marginLeftIgnore');
19086
+ }
18927
19087
  temp.style.listStyleType = collection[index].listStyleTypeName;
18928
19088
  }
18929
19089
  }
@@ -18947,14 +19107,34 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18947
19107
  elem = elem.parentElement;
18948
19108
  if (elem.attributes.getNamedItem('level')) {
18949
19109
  // eslint-disable-next-line
18950
- if (parseInt(elem.attributes.getNamedItem('level').textContent, null) === collection[index].nestedLevel) {
19110
+ if (parseInt(elem.attributes.getNamedItem('level').textContent, null) === collection[index].nestedLevel &&
19111
+ lfo === collection[index].listFormatOverride) {
18951
19112
  prevList = createElement('li');
18952
19113
  prevList.appendChild(pElement);
18953
19114
  elem.appendChild(prevList);
18954
19115
  break;
18955
19116
  // eslint-disable-next-line
18956
19117
  }
18957
- else if (collection[index].nestedLevel > parseInt(elem.attributes.getNamedItem('level').textContent, null)) {
19118
+ else if (parseInt(elem.attributes.getNamedItem('level').textContent, null) === collection[index].nestedLevel &&
19119
+ lfo !== collection[index].listFormatOverride) {
19120
+ temp = createElement(collection[index].listType);
19121
+ prevList = createElement('li');
19122
+ temp.appendChild(prevList);
19123
+ if (collection[index].nestedLevel > 1) {
19124
+ for (var k = 0; k < collection[index].nestedLevel - 1; k++) {
19125
+ prevList.appendChild(temp = createElement(collection[index].listType));
19126
+ prevList = createElement('li');
19127
+ temp.appendChild(prevList);
19128
+ temp.style.listStyleType = 'none';
19129
+ }
19130
+ }
19131
+ prevList.appendChild(pElement);
19132
+ elem.appendChild(temp);
19133
+ temp.setAttribute('level', collection[index].nestedLevel.toString());
19134
+ temp.style.listStyleType = collection[index].listStyleTypeName;
19135
+ break;
19136
+ }
19137
+ else if (collection[index].nestedLevel > parseInt(elem.attributes.getNamedItem('level').textContent, 10)) {
18958
19138
  elem.appendChild(temp = createElement(collection[index].listType));
18959
19139
  prevList = createElement('li');
18960
19140
  prevList.appendChild(pElement);
@@ -18970,8 +19150,9 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
18970
19150
  prevList.setAttribute('class', collection[index].class);
18971
19151
  prevList.setAttribute('style', (!isNullOrUndefined(collection[index].listStyle) ? collection[index].listStyle : ''));
18972
19152
  pLevel = collection[index].nestedLevel;
19153
+ lfo = collection[index].listFormatOverride;
18973
19154
  listCount++;
18974
- if (!isNullOrUndefined(collection[index].start)) {
19155
+ if (!isNullOrUndefined(collection[index].start && collection[index].start !== 1 && collection[index].listType === 'ol')) {
18975
19156
  temp.setAttribute('start', collection[index].start.toString());
18976
19157
  }
18977
19158
  }
@@ -19008,7 +19189,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
19008
19189
  var liChildren = element.querySelectorAll('li');
19009
19190
  if (liChildren.length > 0) {
19010
19191
  for (var i = 0; i < liChildren.length; i++) {
19011
- if (!isNullOrUndefined((liChildren[i]).style.marginLeft)) {
19192
+ if (!isNullOrUndefined((liChildren[i]).style.marginLeft) && !liChildren[i].parentElement.classList.contains('marginLeftIgnore')) {
19012
19193
  (liChildren[i]).style.marginLeft = '';
19013
19194
  }
19014
19195
  }
@@ -19022,6 +19203,17 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
19022
19203
  }
19023
19204
  }
19024
19205
  }
19206
+ var ignoredNode = element.querySelectorAll('.marginLeftIgnore li');
19207
+ if (ignoredNode.length > 0) {
19208
+ for (var i = 0; i < ignoredNode.length; i++) {
19209
+ if (!isNullOrUndefined((ignoredNode[i]).style.marginLeft) && (ignoredNode[i]).style.marginLeft !== '') {
19210
+ var marginLeft = (ignoredNode[i]).style.marginLeft;
19211
+ var marginLeftValue = parseFloat(marginLeft.split('in')[0]);
19212
+ var result = marginLeftValue - 0.5;
19213
+ (ignoredNode[i]).style.marginLeft = result.toString() + 'in';
19214
+ }
19215
+ }
19216
+ }
19025
19217
  };
19026
19218
  MsWordPaste.prototype.removeEmptyAnchorTag = function (element) {
19027
19219
  var removableElement = element.querySelectorAll('a:not([href])');
@@ -20594,7 +20786,7 @@ var __extends$3 = (undefined && undefined.__extends) || (function () {
20594
20786
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
20595
20787
  };
20596
20788
  })();
20597
- var IFRAMEHEADER = "\n<!DOCTYPE html> \n <html>\n <head>\n <meta charset='utf-8' /> \n <style>\n @charset \"UTF-8\";\n body {\n font-family: \"Roboto\", sans-serif;\n font-size: 14px;\n }\n html, body{height: 100%;margin: 0;}\n body.e-cursor{cursor:default}\n span.e-selected-node\t{background-color: #939393;color: white;}\n span.e-selected-node.e-highlight {background-color: #1d9dd8;}\n body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}\n .e-rte-image, .e-rte-audio, .e-rte-video {border: 0;cursor: pointer;display:\n block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imginline, .e-rte-audio.e-audio-inline, .e-rte-video.e-video-inline {display: inline-block;float: none;max-width: calc(100% - (2 * 5px));padding: 1px;vertical-align: bottom;}\n .e-rte-image.e-imgcenter, .e-rte-video.e-video-center {cursor: pointer;display: block;float: none;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imgright, .e-rte-video.e-video-right { float: right; margin: 0 auto;margin-left: 5px;text-align: right;}\n .e-rte-image.e-imgleft, .e-rte-video.e-video-left {float: left;margin: 0 auto;margin-right: 5px;text-align: left;}\n .e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}\n .e-img-caption.e-caption-inline {display: inline-block;float: none;\n margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));\n position: relativetext-align: center;vertical-align: bottom;}\n .e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;\n margin: auto;opacity: .9;text-align: center;width: 100%;}\n .e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}\n .e-imgleft, .e-video-left {float: left;margin: 0 5px 0 0;text-align: left;}\n .e-imgright, .e-video-right {float: right;margin: 0 0 0 5px;text-align: right;}\n .e-imgcenter, .e-video-center {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}\n .e-imginline , .e-audio-inline, .e-video-inline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;\n max-width: calc(100% - (2 * 5px));vertical-align: bottom;}\n .e-imgbreak, .e-audio-break, .e-video-break {border: 0;cursor: pointer;\n display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-img-focus:not(.e-resize), .e-audio-focus:not(.e-resize), .e-video-focus:not(.e-resize) {border: solid 2px #4a90e2;}\n img.e-img-focus::selection, audio.e-audio-focus::selection, .e-video-focus::selection { background: transparent;color: transparent;}\n span.e-rte-imageboxmark, span.e-rte-videoboxmark { width: 10px; height: 10px; position: absolute; display: block;\n background: #4a90e2; border: 1px solid #fff; z-index: 1000;}\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-mob-rte span.e-rte-imageboxmark, .e-mob-rte span.e-rte-videoboxmark { background: #fff; border: 1px solid #4a90e2;\n border-radius: 15px; height: 20px; width: 20px; }\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-rte-content .e-content img.e-resize, .e-rte-content .e-content video.e-resize { z-index: 1000; }\n .e-img-caption .e-img-inner { outline: 0; }\n .e-img-caption a:focus-visible { outline: none; }\n .e-img-caption .e-rte-image.e-imgright, .e-img-caption .e-rte-image.e-imgleft { float: none; margin: 0;}\n body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;\n overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}\n p{margin: 0 0 10px;margin-bottom: 10px;}\n li{margin-bottom: 10px;}\n h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}\n h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}\n h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}\n h4{font-size: 16px;font-weight: 400;line-height: 1.5;margin: 0;}\n h5{font-size: 00.8em;font-weight: 400;margin: 0;}\n h6{font-size: 00.65em;font-weight: 400;margin: 0;}\n blockquote{margin: 10px 0;margin-left: 0;padding-left: 5px;border-left: solid 2px #5c5c5c;}\n pre{background-color: inherit;border: 0;border-radius: 0;color: #333;\n font-size: inherit;line-height: inherit;margin: 0 0 10px;overflow: visible;padding: 0;\n white-space: pre-wrap;word-break: inherit;word-wrap: break-word;}\n strong, b{font-weight: 700;}\n a{text-decoration: none;user-select: auto;}\n a:hover{text-decoration: underline;};\n p:last-child, pre:last-child, blockquote:last-child{margin-bottom: 0;}\n h3+h4, h4+h5, h5+h6{margin-top: 00.6em;}\n ul:last-child{margin-bottom: 0;}\n table { border-collapse: collapse; empty-cells: show;}\n table td,table th {border: 1px solid #BDBDBD; height: 20px; padding: 2px 5px; vertical-align: middle;}\n table.e-alternate-border tbody tr:nth-child(2n) {background-color: #F5F5F5;}\n table th {background-color: #E0E0E0;}\n table.e-dashed-border td,table.e-dashed-border th { border: 1px dashed #BDBDBD} \n table .e-cell-select {border: 1px double #4a90e2;}\n span.e-table-box { cursor: nwse-resize; display: block; height: 10px; position: absolute; width: 10px; }\n span.e-table-box.e-rmob {height: 14px;width: 14px;}\n .e-row-resize, .e-column-resize { background-color: transparent; background-repeat: repeat;\n bottom: 0;cursor: col-resize;height: 1px;overflow: visible;position: absolute;width: 1px; }\n .e-row-resize { cursor: row-resize; height: 1px;}\n .e-table-rhelper { cursor: col-resize; opacity: .87;position: absolute;}\n .e-table-rhelper.e-column-helper { width: 1px; }\n .e-table-rhelper.e-row-helper {height: 1px;}\n .e-reicon::before { border-bottom: 6px solid transparent; border-right: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block; height: 0;\n position: absolute; right: 4px; top: 4px; width: 20px; }\n .e-reicon::after { border-bottom: 6px solid transparent; border-left: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block;\n height: 0; left: 4px; position: absolute; top: 4px; width: 20px; z-index: 3; }\n .e-row-helper.e-reicon::after { top: 10px; transform: rotate(90deg); }\n .e-row-helper.e-reicon::before { left: 4px; top: -20px; transform: rotate(90deg); }\n span.e-table-box { background-color: #ffffff; border: 1px solid #BDBDBD; }\n span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }\n .e-table-rhelper { background-color: #4a90e2;}\n .e-rtl { direction: rtl; }\n .e-rte-placeholder::before { content: attr(placeholder); opacity: 0.54; overflow: hidden; padding-top: 16px; position: absolute; text-align: start; top: 0; z-index: 1; }\n </style>\n </head>";
20789
+ var IFRAMEHEADER = "\n<!DOCTYPE html> \n <html>\n <head>\n <meta charset='utf-8' /> \n <style>\n @charset \"UTF-8\";\n body {\n font-family: \"Roboto\", sans-serif;\n font-size: 14px;\n }\n html, body{height: 100%;margin: 0;}\n body.e-cursor{cursor:default}\n span.e-selected-node\t{background-color: #939393;color: white;}\n span.e-selected-node.e-highlight {background-color: #1d9dd8;}\n body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}\n .e-rte-image, .e-rte-video {border: 0;cursor: pointer;display:\n block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-audio {border: 0;cursor: pointer;display:\n block;float: none;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imginline, .e-rte-audio.e-audio-inline, .e-rte-video.e-video-inline {display: inline-block;float: none;max-width: calc(100% - (2 * 5px));padding: 1px;vertical-align: bottom;}\n .e-rte-image.e-imgcenter, .e-rte-video.e-video-center {cursor: pointer;display: block;float: none;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imgright, .e-rte-video.e-video-right { float: right; margin: 0 auto;margin-left: 5px;text-align: right;}\n .e-rte-image.e-imgleft, .e-rte-video.e-video-left {float: left;margin: 0 auto;margin-right: 5px;text-align: left;}\n .e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}\n .e-img-caption.e-caption-inline {display: inline-block;float: none;\n margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));\n position: relativetext-align: center;vertical-align: bottom;}\n .e-rte-img-caption.e-imgcenter {display: contents; margin-left: auto; margin-right: auto;}\n .e-rte-img-caption.e-imgright {display: contents; margin-left: auto; margin-right: 0;}\n .e-rte-img-caption.e-imgleft {display: contents;margin-left: 0;margin-right: auto;}\n .e-img-caption.e-rte-img-caption.e-imgbreak {display: contents;}\n .e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;\n margin: auto;opacity: .9;text-align: center;width: 100%;}\n .e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}\n .e-imgleft, .e-video-left {float: left;margin: 0 5px 0 0;text-align: left;}\n .e-imgright, .e-video-right {float: right;margin: 0 0 0 5px;text-align: right;}\n .e-imgcenter, .e-video-center {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}\n .e-imginline , .e-audio-inline, .e-video-inline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;\n max-width: calc(100% - (2 * 5px));vertical-align: bottom;}\n .e-imgbreak, .e-audio-break, .e-video-break {border: 0;cursor: pointer;\n display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-img-focus:not(.e-resize), .e-audio-focus:not(.e-resize), .e-video-focus:not(.e-resize) {border: solid 2px #4a90e2;}\n img.e-img-focus::selection, audio.e-audio-focus::selection, .e-video-focus::selection { background: transparent;color: transparent;}\n span.e-rte-imageboxmark, span.e-rte-videoboxmark { width: 10px; height: 10px; position: absolute; display: block;\n background: #4a90e2; border: 1px solid #fff; z-index: 1000;}\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-mob-rte span.e-rte-imageboxmark, .e-mob-rte span.e-rte-videoboxmark { background: #fff; border: 1px solid #4a90e2;\n border-radius: 15px; height: 20px; width: 20px; }\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-rte-content .e-content img.e-resize, .e-rte-content .e-content video.e-resize { z-index: 1000; }\n .e-img-caption .e-img-inner { outline: 0; }\n .e-img-caption a:focus-visible { outline: none; }\n .e-img-caption .e-rte-image.e-imgright, .e-img-caption .e-rte-image.e-imgleft { float: none; margin: 0;}\n body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;\n overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}\n p{margin: 0 0 10px;margin-bottom: 10px;}\n li{margin-bottom: 10px;}\n h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}\n h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}\n h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}\n h4{font-size: 16px;font-weight: 400;line-height: 1.5;margin: 0;}\n h5{font-size: 00.8em;font-weight: 400;margin: 0;}\n h6{font-size: 00.65em;font-weight: 400;margin: 0;}\n blockquote{margin: 10px 0;margin-left: 0;padding-left: 5px;border-left: solid 2px #5c5c5c;}\n pre{background-color: inherit;border: 0;border-radius: 0;color: #333;\n font-size: inherit;line-height: inherit;margin: 0 0 10px;overflow: visible;padding: 0;\n white-space: pre-wrap;word-break: inherit;word-wrap: break-word;}\n strong, b{font-weight: 700;}\n a{text-decoration: none;user-select: auto;}\n a:hover{text-decoration: underline;};\n p:last-child, pre:last-child, blockquote:last-child{margin-bottom: 0;}\n h3+h4, h4+h5, h5+h6{margin-top: 00.6em;}\n ul:last-child{margin-bottom: 0;}\n table { border-collapse: collapse; empty-cells: show;}\n table td,table th {border: 1px solid #BDBDBD; height: 20px; padding: 2px 5px; vertical-align: middle;}\n table.e-alternate-border tbody tr:nth-child(2n) {background-color: #F5F5F5;}\n table th {background-color: #E0E0E0;}\n table.e-dashed-border td,table.e-dashed-border th { border: 1px dashed #BDBDBD} \n table .e-cell-select {border: 1px double #4a90e2;}\n span.e-table-box { cursor: nwse-resize; display: block; height: 10px; position: absolute; width: 10px; }\n span.e-table-box.e-rmob {height: 14px;width: 14px;}\n .e-row-resize, .e-column-resize { background-color: transparent; background-repeat: repeat;\n bottom: 0;cursor: col-resize;height: 1px;overflow: visible;position: absolute;width: 1px; }\n .e-row-resize { cursor: row-resize; height: 1px;}\n .e-table-rhelper { cursor: col-resize; opacity: .87;position: absolute;}\n .e-table-rhelper.e-column-helper { width: 1px; }\n .e-table-rhelper.e-row-helper {height: 1px;}\n .e-reicon::before { border-bottom: 6px solid transparent; border-right: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block; height: 0;\n position: absolute; right: 4px; top: 4px; width: 20px; }\n .e-reicon::after { border-bottom: 6px solid transparent; border-left: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block;\n height: 0; left: 4px; position: absolute; top: 4px; width: 20px; z-index: 3; }\n .e-row-helper.e-reicon::after { top: 10px; transform: rotate(90deg); }\n .e-row-helper.e-reicon::before { left: 4px; top: -20px; transform: rotate(90deg); }\n span.e-table-box { background-color: #ffffff; border: 1px solid #BDBDBD; }\n span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }\n .e-table-rhelper { background-color: #4a90e2;}\n .e-rtl { direction: rtl; }\n .e-rte-placeholder::before { content: attr(placeholder); opacity: 0.54; overflow: hidden; padding-top: 16px; position: absolute; text-align: start; top: 0; z-index: 1; }\n </style>\n </head>";
20598
20790
  /**
20599
20791
  * Content module is used to render Rich Text Editor content
20600
20792
  *
@@ -21018,9 +21210,12 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
21018
21210
  var range = this.parent.getRange();
21019
21211
  // eslint-disable-next-line
21020
21212
  var regEx = new RegExp(String.fromCharCode(8203), 'g');
21213
+ var isEmptyNode = range.startContainer === range.endContainer && range.startOffset === range.endOffset &&
21214
+ range.startOffset === 1 && range.startContainer.textContent.length === 1 && range.startContainer.textContent.charCodeAt(0) == 8203 &&
21215
+ range.startContainer.textContent.replace(regEx, '').length === 0;
21021
21216
  var pointer;
21022
21217
  var isRootParent = false;
21023
- if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey) {
21218
+ if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey && !isEmptyNode) {
21024
21219
  pointer = range.startOffset;
21025
21220
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
21026
21221
  range.startContainer.nodeName === '#text' ? range.startContainer.parentElement !== this.parent.inputElement ? range.startContainer.parentElement.classList.add('currentStartMark')
@@ -21143,8 +21338,13 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
21143
21338
  else {
21144
21339
  this.parent.notify(enterHandler, { args: e.args });
21145
21340
  var newRange = this.parent.getRange();
21146
- if (!isNullOrUndefined(newRange.startContainer) && newRange.startContainer === this.parent.inputElement.lastChild && newRange.startContainer.nodeName !== '#text' && this.parent.height !== 'auto') {
21147
- newRange.startContainer.scrollIntoView({ block: "end", inline: "nearest" });
21341
+ if (!isNullOrUndefined(newRange.startContainer) && this.parent.height !== 'auto' && newRange.startContainer.nodeName !== '#text'
21342
+ && !this.parent.iframeSettings.enable && newRange.startContainer.getBoundingClientRect().bottom > this.parent.element.getBoundingClientRect().bottom) {
21343
+ this.parent.element.querySelector('.e-rte-content').scrollTop += newRange.startContainer.getBoundingClientRect().bottom - this.parent.element.getBoundingClientRect().bottom;
21344
+ }
21345
+ else if (!isNullOrUndefined(newRange.startContainer) && this.parent.height === 'auto' && newRange.startContainer.nodeName !== '#text'
21346
+ && !this.parent.iframeSettings.enable && window.innerHeight < newRange.startContainer.getBoundingClientRect().top) {
21347
+ newRange.startContainer.scrollIntoView({ block: 'end', inline: 'nearest' });
21148
21348
  }
21149
21349
  }
21150
21350
  }
@@ -21226,11 +21426,13 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
21226
21426
  currentRange.startContainer.previousSibling.nodeName === 'SPAN') {
21227
21427
  isPreviousNotContentEditable = currentRange.startContainer.previousSibling.contentEditable === 'false' ? false : true;
21228
21428
  }
21429
+ var checkNode = currentRange.startContainer.nodeName === '#text' ? currentRange.startContainer.parentElement : currentRange.startContainer;
21430
+ var isSelectedPositionNotStart = closest(currentRange.startContainer.nodeName === '#text' ? currentRange.startContainer.parentElement : currentRange.startContainer, 'li') ?
21431
+ checkNode.nodeName !== 'li' && isNullOrUndefined(checkNode.previousSibling) : true;
21229
21432
  if (e.args.code === 'Backspace' && e.args.keyCode === 8 && currentRange.startOffset === 0 &&
21230
21433
  currentRange.endOffset === 0 && this.parent.getSelection().length === 0 && currentRange.startContainer.textContent.length > 0 &&
21231
21434
  currentRange.startContainer.parentElement.tagName !== 'TD' && currentRange.startContainer.parentElement.tagName !== 'TH' &&
21232
- isPreviousNotContentEditable) {
21233
- var checkNode = currentRange.startContainer.nodeName === '#text' ? currentRange.startContainer.parentElement : currentRange.startContainer;
21435
+ isPreviousNotContentEditable && isSelectedPositionNotStart) {
21234
21436
  if ((!this.parent.formatter.editorManager.domNode.isBlockNode(checkNode) &&
21235
21437
  !isNullOrUndefined(checkNode.previousSibling) && checkNode.previousSibling.nodeName === 'BR') ||
21236
21438
  (!isNullOrUndefined(currentRange.startContainer.previousSibling) && currentRange.startContainer.previousSibling.nodeName === 'BR')) {
@@ -21242,7 +21444,8 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
21242
21444
  if (liElement.previousElementSibling && liElement.previousElementSibling.childElementCount > 0) {
21243
21445
  this.oldRangeElement = liElement.previousElementSibling.lastElementChild.nodeName === 'BR' ?
21244
21446
  liElement.previousElementSibling : liElement.previousElementSibling.lastElementChild;
21245
- if (!isNullOrUndefined(liElement.lastElementChild) && liElement.lastElementChild.nodeName !== 'BR') {
21447
+ if (!isNullOrUndefined(liElement.lastElementChild) && liElement.lastElementChild.nodeName !== 'BR' &&
21448
+ isNullOrUndefined(liElement.lastElementChild.previousSibling)) {
21246
21449
  this.rangeElement = liElement.lastElementChild;
21247
21450
  isLiElement = true;
21248
21451
  }
@@ -21534,9 +21737,11 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
21534
21737
  this.tooltipTargetEle = closest(args.originalEvent.target, '[data-tooltip-id]');
21535
21738
  if (!isNullOrUndefined(this.tooltipTargetEle) && this.parent.showTooltip && !isNullOrUndefined(currentDocument.querySelector('.e-tooltip-wrap'))) {
21536
21739
  this.parent.notify(destroyTooltip, { args: event });
21537
- this.tooltipTargetEle.setAttribute('data-title', this.tooltipTargetEle.getAttribute('title'));
21538
- this.tooltipTargetEle.removeAttribute('title');
21539
- EventHandler.add(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler, this);
21740
+ if (!this.tooltipTargetEle.closest('.e-rte-quick-popup')) {
21741
+ this.tooltipTargetEle.setAttribute('data-title', this.tooltipTargetEle.getAttribute('title'));
21742
+ this.tooltipTargetEle.removeAttribute('title');
21743
+ EventHandler.add(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler, this);
21744
+ }
21540
21745
  }
21541
21746
  if (item.command !== 'FormatPainter') {
21542
21747
  if (closestElement && !closestElement.classList.contains('e-rte-inline-popup') && !closestElement.classList.contains('e-rte-text-popup')) {
@@ -21830,6 +22035,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
21830
22035
  this.parent.on(pasteClean, this.pasteClean, this);
21831
22036
  this.parent.on(bindCssClass, this.setCssClass, this);
21832
22037
  this.parent.on(destroy, this.destroy, this);
22038
+ this.parent.on(docClick, this.docClick, this);
21833
22039
  };
21834
22040
  PasteCleanup.prototype.destroy = function () {
21835
22041
  this.removeEventListener();
@@ -21841,6 +22047,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
21841
22047
  this.parent.off(pasteClean, this.pasteClean);
21842
22048
  this.parent.off(bindCssClass, this.setCssClass);
21843
22049
  this.parent.off(destroy, this.destroy);
22050
+ this.parent.off(docClick, this.docClick);
21844
22051
  };
21845
22052
  PasteCleanup.prototype.pasteClean = function (e) {
21846
22053
  var _this = this;
@@ -21910,6 +22117,12 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
21910
22117
  this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
21911
22118
  var tempDivElem = this.parent.createElement('div');
21912
22119
  tempDivElem.innerHTML = value;
22120
+ var unsupportedImg = tempDivElem.querySelectorAll('.e-rte-image-unsupported');
22121
+ for (var index = 0; index < unsupportedImg.length; index++) {
22122
+ unsupportedImg[index].setAttribute('alt', this.i10n.getConstant('unsupportedImage'));
22123
+ unsupportedImg[index].classList.remove('e-rte-image-unsupported');
22124
+ }
22125
+ value = tempDivElem.innerHTML;
21913
22126
  var isValueNotEmpty = tempDivElem.textContent !== '' || !isNullOrUndefined(tempDivElem.querySelector('img')) ||
21914
22127
  !isNullOrUndefined(tempDivElem.querySelector('table'));
21915
22128
  this.parent.notify(cleanupResizeElements, {
@@ -22192,7 +22405,9 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
22192
22405
  });
22193
22406
  popupObj.close();
22194
22407
  imgElem.style.opacity = '1';
22195
- uploadObj.destroy();
22408
+ if (!uploadObj.isDestroyed) {
22409
+ uploadObj.destroy();
22410
+ }
22196
22411
  this.toolbarEnableDisable(false);
22197
22412
  };
22198
22413
  PasteCleanup.prototype.refreshPopup = function (imageElement, popupObj) {
@@ -22343,7 +22558,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
22343
22558
  width: '300px',
22344
22559
  height: '265px',
22345
22560
  cssClass: CLS_RTE_DIALOG_MIN_HEIGHT,
22346
- isModal: true,
22561
+ isModal: Browser.isDevice,
22347
22562
  visible: false
22348
22563
  };
22349
22564
  this.dialogObj = this.dialogRenderObj.render(dialogModel);
@@ -22397,13 +22612,22 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
22397
22612
  this.updateCss(this.keepRadioButton, e);
22398
22613
  };
22399
22614
  PasteCleanup.prototype.destroyDialog = function (rteDialogWrapper) {
22400
- var rteDialogContainer = this.parent.element.querySelector('.e-dlg-container');
22615
+ var rteDialogContainer = this.parent.element.querySelector('.e-rte-dialog-minheight');
22401
22616
  detach(rteDialogContainer);
22402
22617
  var rteDialogWrapperChildLength = rteDialogWrapper.children.length;
22403
22618
  for (var i = 0; i < rteDialogWrapperChildLength; i++) {
22404
22619
  detach(rteDialogWrapper.children[0]);
22405
22620
  }
22406
22621
  };
22622
+ PasteCleanup.prototype.docClick = function (e) {
22623
+ var target = e.args.target;
22624
+ if (target && target.classList && ((this.dialogObj && !closest(target, '[id=' + "'" + this.dialogObj.element.id + "'" + ']')))
22625
+ && (!target.classList.contains('e-toolbar-item'))) {
22626
+ if (this.dialogObj) {
22627
+ this.dialogObj.hide();
22628
+ }
22629
+ }
22630
+ };
22407
22631
  PasteCleanup.prototype.cleanAppleClass = function (elem) {
22408
22632
  var appleClassElem = elem.querySelectorAll('br.Apple-interchange-newline');
22409
22633
  for (var i = 0; i < appleClassElem.length; i++) {
@@ -22477,7 +22701,8 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
22477
22701
  this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
22478
22702
  extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
22479
22703
  _this.parent.formatter.onSuccess(_this.parent, args);
22480
- if (!isNullOrUndefined(returnArgs.elements) && !isNullOrUndefined(returnArgs.imgElem)) {
22704
+ if (!isNullOrUndefined(returnArgs.elements) && !isNullOrUndefined(returnArgs.imgElem) &&
22705
+ returnArgs.imgElem.length > 0) {
22481
22706
  var pasteContent = returnArgs.elements;
22482
22707
  var imageContent = returnArgs.imgElem;
22483
22708
  var lastElementChild = _this.findLastElement(pasteContent[pasteContent.length - 1]);
@@ -22546,6 +22771,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
22546
22771
  }
22547
22772
  };
22548
22773
  PasteCleanup.prototype.addTableClass = function (element, source) {
22774
+ source = isNullOrUndefined(source) ? '' : source;
22549
22775
  var tableElement = element.querySelectorAll('table');
22550
22776
  for (var i = 0; i < tableElement.length; i++) {
22551
22777
  if (!tableElement[i].classList.contains('e-rte-table') && (source === 'html' || source === '')) {
@@ -26170,7 +26396,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
26170
26396
  this.checkBoxObj.createElement = this.parent.createElement;
26171
26397
  this.checkBoxObj.appendTo(linkTarget);
26172
26398
  var target_1 = this.checkBoxObj.checked ? '_blank' : null;
26173
- var imageLabel = this.checkBoxObj.checked ? this.i10n.getConstant('ImageLinkAriaLabel') : null;
26399
+ var imageLabel = this.checkBoxObj.checked ? this.i10n.getConstant('imageLinkAriaLabel') : null;
26174
26400
  var linkUpdate = this.i10n.getConstant('dialogUpdate');
26175
26401
  var linkargs_1 = {
26176
26402
  args: e.args,
@@ -26290,14 +26516,14 @@ var Image$1 = /** @__PURE__ @class */ (function () {
26290
26516
  }
26291
26517
  if (e.selectNode[0].parentElement.nodeName === 'A') {
26292
26518
  proxy.parent.formatter.process(proxy.parent, e.args, e.args, {
26293
- url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('ImageLinkAriaLabel') : null, selectNode: e.selectNode,
26519
+ url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('imageLinkAriaLabel') : null, selectNode: e.selectNode,
26294
26520
  subCommand: e.args.item.subCommand
26295
26521
  });
26296
26522
  proxy.dialogObj.hide({ returnValue: true });
26297
26523
  return;
26298
26524
  }
26299
26525
  proxy.parent.formatter.process(proxy.parent, e.args, e.args, {
26300
- url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('ImageLinkAriaLabel') : null, selectNode: e.selectNode,
26526
+ url: url, target: proxy.checkBoxObj.checked ? '_blank' : null, ariaLabel: proxy.checkBoxObj.checked ? this.i10n.getConstant('imageLinkAriaLabel') : null, selectNode: e.selectNode,
26301
26527
  subCommand: e.args.item.subCommand, selection: e.selection
26302
26528
  });
26303
26529
  var captionEle = closest(e.selectNode[0], '.e-img-caption');
@@ -30690,11 +30916,11 @@ var Table = /** @__PURE__ @class */ (function () {
30690
30916
  colReEle.classList.add(CLS_RTE_TABLE_RESIZE, CLS_TB_COL_RES);
30691
30917
  if (columns.length === i) {
30692
30918
  colReEle.style.cssText = 'height: ' + height + 'px; width: 4px; top: ' + pos.top +
30693
- 'px; left:' + (pos.left + this.calcPos(columns[i - 1]).left + columns[i - 1].offsetWidth) + 'px;';
30919
+ 'px; left:' + (pos.left + this.calcPos(columns[i - 1]).left + columns[i - 1].offsetWidth - 2) + 'px;';
30694
30920
  }
30695
30921
  else {
30696
30922
  colReEle.style.cssText = 'height: ' + height + 'px; width: 4px; top: ' + pos.top +
30697
- 'px; left:' + (pos.left + this.calcPos(columns[i]).left) + 'px;';
30923
+ 'px; left:' + (pos.left + this.calcPos(columns[i]).left - 2) + 'px;';
30698
30924
  }
30699
30925
  this.contentModule.getEditPanel().appendChild(colReEle);
30700
30926
  }
@@ -30726,7 +30952,7 @@ var Table = /** @__PURE__ @class */ (function () {
30726
30952
  };
30727
30953
  Table.prototype.removeResizeElement = function () {
30728
30954
  var item = this.parent.contentModule.getEditPanel().
30729
- querySelectorAll('.e-column-resize, .e-row-resize, .e-table-box, .e-table-rhelper');
30955
+ querySelectorAll('.e-column-resize, .e-row-resize, .e-table-box');
30730
30956
  if (item.length > 0) {
30731
30957
  for (var i = 0; i < item.length; i++) {
30732
30958
  detach(item[i]);
@@ -30820,6 +31046,44 @@ var Table = /** @__PURE__ @class */ (function () {
30820
31046
  }
30821
31047
  else {
30822
31048
  this.currentColumnResize = 'middle';
31049
+ var cellColl = this.curTable.rows[0].cells;
31050
+ var cellCount = 0;
31051
+ for (var cell = 0; cell < cellColl.length; cell++) {
31052
+ cellCount = cellCount + cellColl[cell].colSpan;
31053
+ }
31054
+ var sizes = new Array(cellCount);
31055
+ var colGroupEle = createElement('colgroup');
31056
+ var rowSpanCells = new Map();
31057
+ for (var i = 0; i < this.curTable.rows.length; i++) {
31058
+ var currentColIndex = 0;
31059
+ for (var k = 0; k < this.curTable.rows[i].cells.length; k++) {
31060
+ for (var l = 1; l < this.curTable.rows[i].cells[k].rowSpan; l++) {
31061
+ var key = "" + (i + l) + currentColIndex;
31062
+ rowSpanCells.set(key, this.curTable.rows[i].cells[k]);
31063
+ }
31064
+ var cellIndex = this.getCellIndex(rowSpanCells, i, k);
31065
+ if (cellIndex > currentColIndex) {
31066
+ currentColIndex = cellIndex;
31067
+ }
31068
+ var width = this.curTable.rows[i].cells[k].offsetWidth;
31069
+ if (!sizes[currentColIndex] || width < sizes[currentColIndex]) {
31070
+ sizes[currentColIndex] = width;
31071
+ }
31072
+ currentColIndex += 1 + this.curTable.rows[i].cells[k].colSpan - 1;
31073
+ }
31074
+ }
31075
+ for (var size = 0; size < sizes.length; size++) {
31076
+ var cell = createElement('col');
31077
+ cell.appendChild(createElement('br'));
31078
+ cell.style.width = this.convertPixelToPercentage(sizes[size], parseInt(getComputedStyle(this.curTable).width, 10)) + '%';
31079
+ colGroupEle.appendChild(cell);
31080
+ }
31081
+ this.curTable.insertBefore(colGroupEle, this.curTable.firstChild);
31082
+ for (var i = 0; i < this.curTable.rows.length; i++) {
31083
+ for (var k = 0; k < this.curTable.rows[i].cells.length; k++) {
31084
+ this.curTable.rows[i].cells[k].style.width = '';
31085
+ }
31086
+ }
30823
31087
  }
30824
31088
  this.columnEle = this.curTable.rows[this.calMaxCol(this.curTable)].cells[parseInt(target.getAttribute('data-col'), 10)];
30825
31089
  }
@@ -30852,6 +31116,16 @@ var Table = /** @__PURE__ @class */ (function () {
30852
31116
  EventHandler.add(this.contentModule.getDocument(), Browser.touchEndEvent, this.resizeEnd, this);
30853
31117
  }
30854
31118
  };
31119
+ Table.prototype.getCellIndex = function (rowSpanCells, rowIndex, colIndex) {
31120
+ var cellKey = "" + rowIndex + colIndex;
31121
+ var spannedCell = rowSpanCells.get(cellKey);
31122
+ if (spannedCell) {
31123
+ return this.getCellIndex(rowSpanCells, rowIndex, colIndex + spannedCell.colSpan);
31124
+ }
31125
+ else {
31126
+ return colIndex;
31127
+ }
31128
+ };
30855
31129
  Table.prototype.removeHelper = function (e) {
30856
31130
  var cls = e.target.classList;
30857
31131
  if (!(cls.contains('e-reicon')) && this.helper) {
@@ -30880,12 +31154,12 @@ var Table = /** @__PURE__ @class */ (function () {
30880
31154
  this.helper.classList.add('e-column-helper');
30881
31155
  this.helper.style.cssText = 'height: ' + getComputedStyle(this.curTable).height + '; top: ' +
30882
31156
  pos.top + 'px; left:' + ((pos.left + this.calcPos(this.columnEle).left) +
30883
- (this.currentColumnResize === 'last' ? this.columnEle.offsetWidth + 2 : 0) - 1) + 'px;';
31157
+ (this.currentColumnResize === 'last' ? this.columnEle.offsetWidth : 0) - 1) + 'px;';
30884
31158
  }
30885
31159
  else {
30886
31160
  this.helper.classList.add('e-row-helper');
30887
31161
  this.helper.style.cssText = 'width: ' + getComputedStyle(this.curTable).width + '; top: ' +
30888
- (this.calcPos(this.rowEle).top + pos.top + this.rowEle.offsetHeight) +
31162
+ (this.calcPos(this.rowEle).top + pos.top + this.rowEle.offsetHeight - 1) +
30889
31163
  'px; left:' + (this.calcPos(this.rowEle).left + pos.left) + 'px;';
30890
31164
  }
30891
31165
  };
@@ -30893,11 +31167,12 @@ var Table = /** @__PURE__ @class */ (function () {
30893
31167
  var pos = this.calcPos(this.curTable);
30894
31168
  if (this.resizeBtnStat.column) {
30895
31169
  var left = (pos.left + this.calcPos(this.columnEle).left) +
30896
- (this.currentColumnResize === 'last' ? this.columnEle.offsetWidth + 2 : 0) - 1;
31170
+ (this.currentColumnResize === 'last' ? this.columnEle.offsetWidth : 0) - 1;
30897
31171
  this.helper.style.left = left + 'px';
31172
+ this.helper.style.height = this.curTable.offsetHeight + 'px';
30898
31173
  }
30899
31174
  else {
30900
- var top_1 = this.calcPos(this.rowEle).top + pos.top + this.rowEle.offsetHeight;
31175
+ var top_1 = this.calcPos(this.rowEle).top + pos.top + this.rowEle.offsetHeight - 1;
30901
31176
  this.helper.style.top = top_1 + 'px';
30902
31177
  }
30903
31178
  };
@@ -30923,10 +31198,6 @@ var Table = /** @__PURE__ @class */ (function () {
30923
31198
  var maxiumWidth;
30924
31199
  var currentTdElement = this.curTable.closest('td');
30925
31200
  var args = { event: e, requestType: 'table' };
30926
- var isRowCellsMerged = false;
30927
- var isColCellsMerged = false;
30928
- var mergedCellIndex;
30929
- var mergedElement;
30930
31201
  this.parent.trigger(onResize, args, function (resizingArgs) {
30931
31202
  if (resizingArgs.cancel) {
30932
31203
  _this.cancelResizeAction();
@@ -30951,7 +31222,7 @@ var Table = /** @__PURE__ @class */ (function () {
30951
31222
  widthCompare = rteWidth;
30952
31223
  }
30953
31224
  if (_this.resizeBtnStat.column) {
30954
- var width = parseFloat(_this.columnEle.offsetWidth.toString());
31225
+ var colGroup = _this.curTable.querySelectorAll('colgroup > col');
30955
31226
  var cellRow = _this.curTable.rows[0].cells[0].nodeName === 'TH' ? 1 : 0;
30956
31227
  var currentTableWidth = void 0;
30957
31228
  if (_this.curTable.style.width !== '' && _this.curTable.style.width.includes('%')) {
@@ -31004,98 +31275,36 @@ var Table = /** @__PURE__ @class */ (function () {
31004
31275
  }
31005
31276
  }
31006
31277
  else {
31007
- var cellColl = _this.curTable.rows[_this.calMaxCol(_this.curTable)].cells;
31008
- var actualwid = width - mouseX;
31009
- var totalwid = parseFloat(_this.columnEle.offsetWidth.toString()) +
31010
- parseFloat(cellColl[_this.colIndex - 1].offsetWidth.toString());
31011
- for (var i = 0; i < _this.curTable.rows.length; i++) {
31012
- var currentRow = _this.curTable.rows[i];
31013
- if ((totalwid - actualwid) > 20 && actualwid > 20) {
31014
- var leftColumnWidth = totalwid - actualwid;
31015
- var rightColWidth = actualwid;
31016
- var index = void 0;
31017
- var isMergedEleResize = false;
31018
- var leftTableCell = void 0;
31019
- var rightTableCell = void 0;
31020
- isColCellsMerged = false;
31021
- isRowCellsMerged = false;
31022
- /* eslint-disable */
31023
- for (var j = 0; j < currentRow.cells.length; j++) {
31024
- if (currentRow.cells[j].hasAttribute('rowspan') && j <= _this.colIndex) {
31025
- isRowCellsMerged = true;
31026
- mergedCellIndex = i;
31027
- mergedElement = currentRow.cells[j];
31028
- }
31029
- else if (currentRow.cells[j].hasAttribute('colspan') && j <= currentRow.cells.length) {
31030
- isColCellsMerged = true;
31031
- mergedCellIndex = i;
31032
- mergedElement = currentRow.cells[j];
31033
- }
31034
- }
31035
- if (!isNullOrUndefined(currentRow.cells[i]) && currentRow.cells[i].hasAttribute('colspan')) {
31036
- index = parseInt(currentRow.cells[i].getAttribute('colspan'), 10) - 1;
31037
- }
31038
- else {
31039
- index = _this.colIndex;
31040
- }
31041
- if (isRowCellsMerged || isColCellsMerged) {
31042
- var currentResizeRow = void 0;
31043
- if (currentRow.cells.length < cellColl.length) {
31044
- index = currentRow.cells.length === _this.colIndex || currentRow === _this.curTable.rows[_this.curTable.rows.length - 1] ?
31045
- _this.colIndex - 1 : _this.colIndex;
31046
- currentResizeRow = _this.curTable.rows[!isNullOrUndefined(mergedCellIndex) ?
31047
- mergedCellIndex : _this.colIndex - 1];
31048
- if (currentResizeRow && currentResizeRow !== currentRow && (currentResizeRow.cells[_this.colIndex - 1] === mergedElement ||
31049
- currentResizeRow.cells[currentResizeRow.cells.length - 1] === mergedElement)) {
31050
- isMergedEleResize = true;
31051
- }
31052
- else {
31053
- isMergedEleResize = false;
31054
- }
31055
- }
31056
- else {
31057
- index = _this.colIndex;
31058
- }
31059
- leftTableCell = !isMergedEleResize ? currentRow.cells[index - 1] : (currentResizeRow &&
31060
- currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement) ?
31061
- currentResizeRow.cells[_this.colIndex - 1] : currentRow.cells[currentRow.cells.length - 1];
31062
- rightTableCell = !isMergedEleResize ? currentRow.cells[index] : rightTableCell && rightTableCell.hasAttribute('rowspan') ?
31063
- currentResizeRow.cells[_this.colIndex] : currentResizeRow && currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement ?
31064
- currentRow.cells[index - 1] : currentResizeRow.cells[currentResizeRow.cells.length - 1];
31065
- }
31066
- if (!isNullOrUndefined(currentRow.cells[index - 1]) && !isRowCellsMerged && !isColCellsMerged) {
31067
- currentRow.cells[index - 1].style.width =
31068
- _this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
31069
- }
31070
- else {
31071
- if (leftTableCell) {
31072
- leftTableCell.style.width =
31073
- _this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
31074
- }
31075
- }
31076
- if (!isNullOrUndefined(currentRow.cells[index]) && !isRowCellsMerged && !isColCellsMerged) {
31077
- currentRow.cells[index].style.width =
31078
- _this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
31079
- }
31080
- else {
31081
- if (rightTableCell) {
31082
- rightTableCell.style.width =
31083
- _this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
31084
- }
31085
- }
31086
- /* eslint-enable */
31087
- }
31278
+ var actualwid = colGroup[_this.colIndex].offsetWidth - mouseX;
31279
+ // eslint-disable-next-line
31280
+ var totalwid = colGroup[_this.colIndex].offsetWidth + colGroup[_this.colIndex - 1].offsetWidth;
31281
+ if ((totalwid - actualwid) > 20 && actualwid > 20) {
31282
+ var leftColumnWidth = totalwid - actualwid;
31283
+ var rightColWidth = actualwid;
31284
+ colGroup[_this.colIndex - 1].style.width = _this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
31285
+ colGroup[_this.colIndex].style.width = _this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
31088
31286
  }
31089
31287
  }
31090
31288
  _this.updateHelper();
31091
31289
  }
31092
31290
  else if (_this.resizeBtnStat.row) {
31093
31291
  _this.parent.preventDefaultResize(e);
31094
- var height = parseFloat(_this.rowEle.clientHeight.toString()) + mouseY;
31095
- if (height > 20) {
31096
- _this.rowEle.style.height = height + 'px';
31292
+ var tableTrElementPixel = [];
31293
+ var currentTableTrElement = _this.curTable.querySelectorAll('tr');
31294
+ for (var i = 0; i < currentTableTrElement.length; i++) {
31295
+ if (_this.rowEle !== currentTableTrElement[i]) {
31296
+ tableTrElementPixel[i] = (parseFloat(currentTableTrElement[i].clientHeight.toString()));
31297
+ }
31298
+ }
31299
+ _this.curTable.style.height = (parseFloat(_this.curTable.clientHeight.toString()) + mouseY) + 'px';
31300
+ for (var i = 0; i < currentTableTrElement.length; i++) {
31301
+ if (_this.rowEle === currentTableTrElement[i]) {
31302
+ currentTableTrElement[i].style.height = (parseFloat(currentTableTrElement[i].clientHeight.toString()) + mouseY) + 'px';
31303
+ }
31304
+ else {
31305
+ currentTableTrElement[i].style.height = tableTrElementPixel[i] + 'px';
31306
+ }
31097
31307
  }
31098
- _this.curTable.style.height = '';
31099
31308
  if (!isNullOrUndefined(tableReBox)) {
31100
31309
  tableReBox.style.cssText = 'top: ' + (_this.calcPos(_this.curTable).top + tableHeight - 4) +
31101
31310
  'px; left:' + (_this.calcPos(_this.curTable).left + tableWidth - 4) + 'px;';
@@ -31158,9 +31367,34 @@ var Table = /** @__PURE__ @class */ (function () {
31158
31367
  detach(this.helper);
31159
31368
  this.helper = null;
31160
31369
  }
31370
+ var colHelper = this.parent.element.querySelectorAll('.e-table-rhelper.e-column-helper');
31371
+ Array.from(colHelper).forEach(function (element) {
31372
+ if (element.parentNode) {
31373
+ element.parentNode.removeChild(element);
31374
+ }
31375
+ });
31376
+ for (var i = 0; i < this.curTable.rows.length; i++) {
31377
+ for (var k = 0; k < this.curTable.rows[i].cells.length; k++) {
31378
+ var width = this.convertPixelToPercentage(this.curTable.rows[i].cells[k].offsetWidth, parseInt(getComputedStyle(this.curTable).width, 10)) + '%';
31379
+ this.curTable.rows[i].cells[k].style.width = width;
31380
+ }
31381
+ }
31382
+ var colGroup = this.curTable.querySelector('colgroup');
31383
+ if (colGroup) {
31384
+ this.curTable.removeChild(colGroup);
31385
+ }
31161
31386
  this.pageX = null;
31162
31387
  this.pageY = null;
31163
31388
  this.moveEle = null;
31389
+ var currentTableTrElement = this.curTable.querySelectorAll("tr");
31390
+ var tableTrPercentage = [];
31391
+ for (var i = 0; i < currentTableTrElement.length; i++) {
31392
+ var percentage = (parseFloat(currentTableTrElement[i].clientHeight.toString()) / parseFloat(this.curTable.clientHeight.toString())) * 100;
31393
+ tableTrPercentage[i] = percentage;
31394
+ }
31395
+ for (var i = 0; i < currentTableTrElement.length; i++) {
31396
+ currentTableTrElement[i].style.height = tableTrPercentage[i] + '%';
31397
+ }
31164
31398
  var args = { event: e, requestType: 'table' };
31165
31399
  this.parent.trigger(resizeStop, args);
31166
31400
  this.parent.formatter.saveData();
@@ -32999,10 +33233,10 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
32999
33233
  }
33000
33234
  var previousBlockNode = this.parent.formatter.editorManager.domNode.blockNodes()[0].previousSibling;
33001
33235
  var nextBlockNode = this.parent.formatter.editorManager.domNode.blockNodes()[0].nextSibling;
33002
- if (!isNullOrUndefined(previousBlockNode) && previousBlockNode.hasAttribute('style')) {
33236
+ if (!isNullOrUndefined(previousBlockNode) && previousBlockNode.hasAttribute('style') && previousBlockNode.nodeName !== 'TABLE') {
33003
33237
  insertElem.setAttribute('style', previousBlockNode.getAttribute('style'));
33004
33238
  }
33005
- if (isNullOrUndefined(previousBlockNode) && !isNullOrUndefined(nextBlockNode) && nextBlockNode.hasAttribute('style')) {
33239
+ if (isNullOrUndefined(previousBlockNode) && !isNullOrUndefined(nextBlockNode) && nextBlockNode.hasAttribute('style') && nextBlockNode.nodeName !== 'TABLE') {
33006
33240
  insertElem.setAttribute('style', nextBlockNode.getAttribute('style'));
33007
33241
  }
33008
33242
  return insertElem;
@@ -33785,6 +34019,16 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
33785
34019
  RichTextEditor.prototype.keyUp = function (e) {
33786
34020
  if (this.editorMode === 'HTML') {
33787
34021
  var range = this.getRange();
34022
+ if (!isNullOrUndefined(e) && !isNullOrUndefined(e.code) && (e.code === 'Backspace' || e.code === 'Delete')) {
34023
+ // To prevent the reformatting the content removed browser behavior.
34024
+ var currentRange = this.getRange();
34025
+ var selection = this.iframeSettings.enable ? this.contentModule.getPanel().ownerDocument.getSelection() :
34026
+ this.contentModule.getDocument().getSelection();
34027
+ if (selection.rangeCount > 0) {
34028
+ selection.removeAllRanges();
34029
+ selection.addRange(currentRange);
34030
+ }
34031
+ }
33788
34032
  if (Browser.userAgent.indexOf('Firefox') !== -1 && range.startContainer.nodeName === '#text' &&
33789
34033
  range.startContainer.parentElement === this.inputElement && this.enterKey !== 'BR') {
33790
34034
  var range_1 = this.getRange();
@@ -34655,10 +34899,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
34655
34899
  if (this.iframeSettings.resources) {
34656
34900
  var styleSrc = this.iframeSettings.resources.styles;
34657
34901
  var scriptSrc = this.iframeSettings.resources.scripts;
34658
- if (this.iframeSettings.resources.scripts.length > 0) {
34902
+ if (!isNullOrUndefined(this.iframeSettings.resources.scripts) && this.iframeSettings.resources.scripts.length > 0) {
34659
34903
  this.InjectSheet(true, scriptSrc);
34660
34904
  }
34661
- if (this.iframeSettings.resources.styles.length > 0) {
34905
+ if (!isNullOrUndefined(this.iframeSettings.resources.styles) && this.iframeSettings.resources.styles.length > 0) {
34662
34906
  this.InjectSheet(false, styleSrc);
34663
34907
  }
34664
34908
  }