@syncfusion/ej2-richtexteditor 24.2.8 → 25.1.35

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 (134) hide show
  1. package/CHANGELOG.md +34 -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 +955 -495
  6. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  7. package/dist/es6/ej2-richtexteditor.es5.js +939 -484
  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 +13 -13
  13. package/src/common/config.d.ts +7 -0
  14. package/src/common/config.js +11 -0
  15. package/src/common/interface.d.ts +12 -0
  16. package/src/common/types.d.ts +6 -0
  17. package/src/editor-manager/plugin/dom-node.d.ts +5 -1
  18. package/src/editor-manager/plugin/dom-node.js +161 -12
  19. package/src/editor-manager/plugin/formats.js +1 -1
  20. package/src/editor-manager/plugin/image.js +12 -16
  21. package/src/editor-manager/plugin/inserthtml.d.ts +1 -0
  22. package/src/editor-manager/plugin/inserthtml.js +40 -1
  23. package/src/editor-manager/plugin/link.js +1 -1
  24. package/src/editor-manager/plugin/lists.js +24 -2
  25. package/src/editor-manager/plugin/ms-word-clean-up.d.ts +1 -0
  26. package/src/editor-manager/plugin/ms-word-clean-up.js +87 -58
  27. package/src/editor-manager/plugin/selection-commands.js +52 -3
  28. package/src/editor-manager/plugin/table.js +18 -3
  29. package/src/editor-manager/plugin/toolbar-status.d.ts +2 -2
  30. package/src/editor-manager/plugin/toolbar-status.js +17 -9
  31. package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +3 -3
  32. package/src/rich-text-editor/actions/base-quick-toolbar.js +44 -10
  33. package/src/rich-text-editor/actions/base-toolbar.js +24 -30
  34. package/src/rich-text-editor/actions/dropdown-buttons.js +4 -4
  35. package/src/rich-text-editor/actions/emoji-picker.js +2 -2
  36. package/src/rich-text-editor/actions/enter-key.js +4 -3
  37. package/src/rich-text-editor/actions/full-screen.js +2 -2
  38. package/src/rich-text-editor/actions/html-editor.d.ts +0 -2
  39. package/src/rich-text-editor/actions/html-editor.js +18 -31
  40. package/src/rich-text-editor/actions/markdown-editor.js +3 -1
  41. package/src/rich-text-editor/actions/paste-clean-up.d.ts +1 -0
  42. package/src/rich-text-editor/actions/paste-clean-up.js +23 -0
  43. package/src/rich-text-editor/actions/quick-toolbar.d.ts +7 -0
  44. package/src/rich-text-editor/actions/quick-toolbar.js +24 -9
  45. package/src/rich-text-editor/actions/resize.js +2 -1
  46. package/src/rich-text-editor/actions/toolbar.d.ts +0 -2
  47. package/src/rich-text-editor/actions/toolbar.js +13 -85
  48. package/src/rich-text-editor/base/classes.d.ts +0 -5
  49. package/src/rich-text-editor/base/classes.js +0 -5
  50. package/src/rich-text-editor/base/constant.d.ts +5 -0
  51. package/src/rich-text-editor/base/constant.js +5 -0
  52. package/src/rich-text-editor/base/interface.d.ts +36 -2
  53. package/src/rich-text-editor/base/rich-text-editor-model.d.ts +2 -2
  54. package/src/rich-text-editor/base/rich-text-editor.d.ts +4 -3
  55. package/src/rich-text-editor/base/rich-text-editor.js +81 -58
  56. package/src/rich-text-editor/base/util.js +8 -2
  57. package/src/rich-text-editor/models/default-locale.js +15 -12
  58. package/src/rich-text-editor/models/toolbar-settings-model.d.ts +1 -1
  59. package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
  60. package/src/rich-text-editor/models/toolbar-settings.js +1 -1
  61. package/src/rich-text-editor/renderer/iframe-content-renderer.js +2 -1
  62. package/src/rich-text-editor/renderer/image-module.d.ts +8 -1
  63. package/src/rich-text-editor/renderer/image-module.js +148 -155
  64. package/src/rich-text-editor/renderer/table-module.d.ts +2 -0
  65. package/src/rich-text-editor/renderer/table-module.js +71 -8
  66. package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +3 -0
  67. package/src/rich-text-editor/renderer/toolbar-renderer.js +61 -2
  68. package/src/rich-text-editor/renderer/video-module.js +7 -4
  69. package/src/rich-text-editor/renderer/view-source.js +7 -4
  70. package/styles/bootstrap-dark.css +57 -17
  71. package/styles/bootstrap.css +58 -18
  72. package/styles/bootstrap4.css +58 -18
  73. package/styles/bootstrap5-dark.css +64 -17
  74. package/styles/bootstrap5.css +64 -17
  75. package/styles/fabric-dark.css +57 -17
  76. package/styles/fabric.css +58 -18
  77. package/styles/fluent-dark.css +57 -17
  78. package/styles/fluent.css +57 -17
  79. package/styles/highcontrast-light.css +57 -17
  80. package/styles/highcontrast.css +58 -18
  81. package/styles/material-dark.css +57 -17
  82. package/styles/material.css +57 -17
  83. package/styles/material3-dark.css +59 -19
  84. package/styles/material3.css +59 -19
  85. package/styles/rich-text-editor/_bds-definition.scss +279 -0
  86. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +1 -0
  87. package/styles/rich-text-editor/_bootstrap-definition.scss +1 -1
  88. package/styles/rich-text-editor/_bootstrap4-definition.scss +3 -2
  89. package/styles/rich-text-editor/_bootstrap5-definition.scss +1 -0
  90. package/styles/rich-text-editor/_fabric-dark-definition.scss +1 -0
  91. package/styles/rich-text-editor/_fabric-definition.scss +2 -1
  92. package/styles/rich-text-editor/_fluent-definition.scss +1 -0
  93. package/styles/rich-text-editor/_fusionnew-definition.scss +1 -0
  94. package/styles/rich-text-editor/_highcontrast-definition.scss +2 -1
  95. package/styles/rich-text-editor/_highcontrast-light-definition.scss +1 -0
  96. package/styles/rich-text-editor/_layout.scss +47 -13
  97. package/styles/rich-text-editor/_material-dark-definition.scss +1 -0
  98. package/styles/rich-text-editor/_material-definition.scss +1 -0
  99. package/styles/rich-text-editor/_material3-definition.scss +1 -0
  100. package/styles/rich-text-editor/_tailwind-definition.scss +4 -3
  101. package/styles/rich-text-editor/_theme.scss +18 -5
  102. package/styles/rich-text-editor/bootstrap-dark.css +57 -17
  103. package/styles/rich-text-editor/bootstrap.css +58 -18
  104. package/styles/rich-text-editor/bootstrap4.css +58 -18
  105. package/styles/rich-text-editor/bootstrap5-dark.css +64 -17
  106. package/styles/rich-text-editor/bootstrap5.css +64 -17
  107. package/styles/rich-text-editor/fabric-dark.css +57 -17
  108. package/styles/rich-text-editor/fabric.css +58 -18
  109. package/styles/rich-text-editor/fluent-dark.css +57 -17
  110. package/styles/rich-text-editor/fluent.css +57 -17
  111. package/styles/rich-text-editor/highcontrast-light.css +57 -17
  112. package/styles/rich-text-editor/highcontrast.css +58 -18
  113. package/styles/rich-text-editor/icons/_bds.scss +351 -0
  114. package/styles/rich-text-editor/icons/_bootstrap-dark.scss +7 -4
  115. package/styles/rich-text-editor/icons/_bootstrap.scss +7 -4
  116. package/styles/rich-text-editor/icons/_bootstrap4.scss +7 -4
  117. package/styles/rich-text-editor/icons/_bootstrap5.scss +7 -4
  118. package/styles/rich-text-editor/icons/_fabric-dark.scss +7 -4
  119. package/styles/rich-text-editor/icons/_fabric.scss +7 -4
  120. package/styles/rich-text-editor/icons/_fluent.scss +7 -4
  121. package/styles/rich-text-editor/icons/_highcontrast-light.scss +7 -4
  122. package/styles/rich-text-editor/icons/_highcontrast.scss +7 -4
  123. package/styles/rich-text-editor/icons/_material-dark.scss +7 -4
  124. package/styles/rich-text-editor/icons/_material.scss +7 -4
  125. package/styles/rich-text-editor/icons/_material3.scss +7 -4
  126. package/styles/rich-text-editor/icons/_tailwind.scss +7 -4
  127. package/styles/rich-text-editor/material-dark.css +57 -17
  128. package/styles/rich-text-editor/material.css +57 -17
  129. package/styles/rich-text-editor/material3-dark.css +59 -19
  130. package/styles/rich-text-editor/material3.css +59 -19
  131. package/styles/rich-text-editor/tailwind-dark.css +61 -21
  132. package/styles/rich-text-editor/tailwind.css +61 -21
  133. package/styles/tailwind-dark.css +61 -21
  134. package/styles/tailwind.css +61 -21
@@ -769,6 +769,11 @@ const documentClickClosedBy = 'documentClickClosedBy';
769
769
  * @deprecated
770
770
  */
771
771
  const showColorPicker = 'showColorPicker';
772
+ /**
773
+ * @hidden
774
+ * @deprecated
775
+ */
776
+ const closeTooltip = 'closeTooltip';
772
777
  /**
773
778
  * @hidden
774
779
  * @deprecated
@@ -1019,11 +1024,6 @@ const CLS_TB_FIXED = 'e-rte-tb-fixed';
1019
1024
  * @deprecated
1020
1025
  */
1021
1026
  const CLS_TB_FLOAT = 'e-rte-tb-float';
1022
- /**
1023
- * @hidden
1024
- * @deprecated
1025
- */
1026
- const CLS_TB_ABS_FLOAT = 'e-rte-tb-abs-float';
1027
1027
  /**
1028
1028
  * @hidden
1029
1029
  * @deprecated
@@ -2694,7 +2694,7 @@ let defaultLocale = {
2694
2694
  'linkTooltipLabel': 'Title',
2695
2695
  'linkWebUrl': 'Web address',
2696
2696
  'linkTitle': 'Enter a title',
2697
- 'linkurl': 'http://example.com',
2697
+ 'linkurl': 'https://example.com',
2698
2698
  'linkOpenInNewWindow': 'Open link in new window',
2699
2699
  'linkHeader': 'Insert Link',
2700
2700
  'dialogInsert': 'Insert',
@@ -2717,9 +2717,9 @@ let defaultLocale = {
2717
2717
  'imageAlternateText': 'Alternate Text',
2718
2718
  'alternateHeader': 'Alternative Text',
2719
2719
  'browse': 'Browse',
2720
- 'imageUrl': 'http://example.com/image.png',
2721
- 'audioUrl': 'http://example.com/audio.mp3',
2722
- 'videoUrl': 'http://example.com/video.mp4',
2720
+ 'imageUrl': 'https://example.com/image.png',
2721
+ 'audioUrl': 'https://example.com/audio.mp3',
2722
+ 'videoUrl': 'https://example.com/video.mp4',
2723
2723
  'webUrl': 'Web URL',
2724
2724
  'embedUrl': 'Embed Code',
2725
2725
  'imageCaption': 'Caption',
@@ -2730,7 +2730,7 @@ let defaultLocale = {
2730
2730
  'videoHeight': 'Height',
2731
2731
  'videoWidth': 'Width',
2732
2732
  'textPlaceholder': 'Enter text',
2733
- 'inserttablebtn': 'Insert table',
2733
+ 'inserttablebtn': 'Insert Table',
2734
2734
  'tabledialogHeader': 'Insert Table',
2735
2735
  'tableWidth': 'Width',
2736
2736
  'cellpadding': 'Cell Padding',
@@ -2744,7 +2744,7 @@ let defaultLocale = {
2744
2744
  'createTable': 'Create Table',
2745
2745
  'removeTable': 'Remove Table',
2746
2746
  'tableHeader': 'Header Row',
2747
- 'tableRemove': 'Delete',
2747
+ 'tableRemove': 'Delete Table',
2748
2748
  'tableCellBackground': 'Table Cell Background',
2749
2749
  'tableEditProperties': 'Table Edit Properties',
2750
2750
  'styles': 'Styles',
@@ -2806,11 +2806,11 @@ let defaultLocale = {
2806
2806
  'fontNameTimesNewRoman': 'Times New Roman',
2807
2807
  'fontNameVerdana': 'Verdana',
2808
2808
  'numberFormatListNumber': 'Number',
2809
- 'numberFormatListLowerAlpha': 'LowerAlpha',
2810
- 'numberFormatListUpperAlpha': 'UpperAlpha',
2811
- 'numberFormatListLowerRoman': 'LowerRoman',
2812
- 'numberFormatListUpperRoman': 'UpperRoman',
2813
- 'numberFormatListLowerGreek': 'LowerGreek',
2809
+ 'numberFormatListLowerAlpha': 'Lower Alpha',
2810
+ 'numberFormatListUpperAlpha': 'Upper Alpha',
2811
+ 'numberFormatListLowerRoman': 'Lower Roman',
2812
+ 'numberFormatListUpperRoman': 'Upper Roman',
2813
+ 'numberFormatListLowerGreek': 'Lower Greek',
2814
2814
  'bulletFormatListDisc': 'Disc',
2815
2815
  'bulletFormatListCircle': 'Circle',
2816
2816
  'bulletFormatListSquare': 'Square',
@@ -2824,7 +2824,10 @@ let defaultLocale = {
2824
2824
  'emojiPickerNoResultFound': 'No results found',
2825
2825
  'emojiPickerTrySomethingElse': 'Try something else',
2826
2826
  'linkAriaLabel': 'Open in new window',
2827
- 'unsupportedImage': 'Unsupported file format'
2827
+ 'unsupportedImage': 'Unsupported file format',
2828
+ 'mergecells': 'Merge cells',
2829
+ 'verticalsplit': 'Vertical split',
2830
+ 'horizontalsplit': 'Horizontal split'
2828
2831
  };
2829
2832
  let toolsLocale = {
2830
2833
  'alignments': 'alignments',
@@ -3215,7 +3218,12 @@ function setToolbarStatus(e, isPopToolbar, self) {
3215
3218
  }
3216
3219
  case 'bulletFormatList':
3217
3220
  case 'numberFormatList': {
3218
- removeClass([e.tbElements[j]], [CLS_ACTIVE]);
3221
+ if (value !== '') {
3222
+ addClass([e.tbElements[j]], [CLS_ACTIVE]);
3223
+ }
3224
+ else {
3225
+ removeClass([e.tbElements[j]], [CLS_ACTIVE]);
3226
+ }
3219
3227
  }
3220
3228
  }
3221
3229
  }
@@ -3456,7 +3464,8 @@ function updateTextNode(value, rteObj) {
3456
3464
  imageElm[i].classList.add(CLS_RTE_IMAGE);
3457
3465
  }
3458
3466
  if (!(imageElm[i].classList.contains(CLS_IMGINLINE) ||
3459
- imageElm[i].classList.contains(CLS_IMGBREAK))) {
3467
+ imageElm[i].classList.contains(CLS_IMGBREAK)) &&
3468
+ !(imageElm[i].classList.contains('e-imgleft') || imageElm[i].classList.contains('e-imgright') || imageElm[i].classList.contains('e-imgcenter'))) {
3460
3469
  imageElm[i].classList.add(CLS_IMGINLINE);
3461
3470
  }
3462
3471
  }
@@ -3605,6 +3614,7 @@ class ToolbarRenderer {
3605
3614
  wireEvent() {
3606
3615
  this.parent.on(destroy, this.unWireEvent, this);
3607
3616
  this.parent.on(destroyTooltip, this.destroyTooltip, this);
3617
+ this.parent.on(closeTooltip, this.closeTooltip, this);
3608
3618
  }
3609
3619
  destroyTooltip() {
3610
3620
  const currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
@@ -3617,6 +3627,8 @@ class ToolbarRenderer {
3617
3627
  }
3618
3628
  unWireEvent() {
3619
3629
  this.parent.off(destroy, this.unWireEvent);
3630
+ this.parent.off(destroyTooltip, this.destroyTooltip);
3631
+ this.parent.off(closeTooltip, this.closeTooltip);
3620
3632
  }
3621
3633
  toolbarBeforeCreate(e) {
3622
3634
  if (this.mode === 'Extended') {
@@ -3735,7 +3747,7 @@ class ToolbarRenderer {
3735
3747
  windowCollision: true,
3736
3748
  position: 'BottomCenter'
3737
3749
  });
3738
- this.tooltip.appendTo(args.target);
3750
+ this.tooltip.appendTo(args.target.parentElement);
3739
3751
  }
3740
3752
  }
3741
3753
  /**
@@ -3866,6 +3878,32 @@ class ToolbarRenderer {
3866
3878
  popupElement.setAttribute('aria-owns', this.parent.getID());
3867
3879
  return dropDown;
3868
3880
  }
3881
+ mouseOutHandler() {
3882
+ if (!isNullOrUndefined(this.tooltipTargetEle)) {
3883
+ this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
3884
+ }
3885
+ else {
3886
+ const currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
3887
+ this.parent.contentModule.getDocument();
3888
+ this.tooltipTargetEle = currentDocument.querySelector('[data-title]');
3889
+ this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
3890
+ }
3891
+ this.tooltipTargetEle.removeAttribute('data-title');
3892
+ EventHandler.remove(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler);
3893
+ }
3894
+ closeTooltip(args) {
3895
+ const currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
3896
+ this.parent.contentModule.getDocument();
3897
+ this.tooltipTargetEle = closest(args.target, '[data-tooltip-id]');
3898
+ if (!isNullOrUndefined(this.tooltipTargetEle) && this.parent.showTooltip && !isNullOrUndefined(currentDocument.querySelector('.e-tooltip-wrap'))) {
3899
+ this.destroyTooltip();
3900
+ if (!this.tooltipTargetEle.closest('.e-rte-quick-popup')) {
3901
+ this.tooltipTargetEle.setAttribute('data-title', this.tooltipTargetEle.getAttribute('title'));
3902
+ this.tooltipTargetEle.removeAttribute('title');
3903
+ EventHandler.add(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler, this);
3904
+ }
3905
+ }
3906
+ }
3869
3907
  /**
3870
3908
  * renderListDropDown method
3871
3909
  *
@@ -3890,6 +3928,35 @@ class ToolbarRenderer {
3890
3928
  enableRtl: this.parent.enableRtl,
3891
3929
  select: this.dropDownSelected.bind(this),
3892
3930
  beforeOpen: (args) => {
3931
+ if (proxy.parent.editorMode !== 'Markdown') {
3932
+ const startNode = proxy.parent.getRange().startContainer.parentElement;
3933
+ const listElem = startNode.closest('LI');
3934
+ const currentLiElem = !isNullOrUndefined(listElem) ? listElem.parentElement : null;
3935
+ if (!isNullOrUndefined(currentLiElem) && (currentLiElem.nodeName === 'OL' || currentLiElem.nodeName === 'UL')) {
3936
+ if (currentLiElem.nodeName === 'UL' && args.items[0].subCommand === 'NumberFormatList') {
3937
+ addClass([args.element.childNodes[0]], 'e-active');
3938
+ }
3939
+ else if (currentLiElem.nodeName === 'OL' && args.items[0].subCommand === 'BulletFormatList') {
3940
+ addClass([args.element.childNodes[0]], 'e-active');
3941
+ }
3942
+ else {
3943
+ let currentListStyle = currentLiElem.style.listStyleType.split('-').join('').toLocaleLowerCase();
3944
+ currentListStyle = currentListStyle === 'decimal' ? 'number' : currentListStyle;
3945
+ for (let index = 0; index < args.element.childNodes.length; index++) {
3946
+ if (currentListStyle === args.element.childNodes[index].innerHTML.split(' ').join('').toLocaleLowerCase()) {
3947
+ addClass([args.element.childNodes[index]], 'e-active');
3948
+ }
3949
+ else if (currentListStyle === '') {
3950
+ addClass([args.element.childNodes[index]], 'e-active');
3951
+ }
3952
+ }
3953
+ }
3954
+ }
3955
+ else {
3956
+ addClass([args.element.childNodes[0]], 'e-active');
3957
+ }
3958
+ }
3959
+ this.closeTooltip({ target: args.event.target });
3893
3960
  if (proxy.parent.readonly || !proxy.parent.enabled) {
3894
3961
  args.cancel = true;
3895
3962
  return;
@@ -4303,23 +4370,13 @@ class BaseToolbar {
4303
4370
  case '-':
4304
4371
  return { type: 'Separator', cssClass: CLS_HR_SEPARATOR };
4305
4372
  default:
4306
- if (this.parent.showTooltip) {
4307
- return {
4308
- id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
4309
- prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
4310
- tooltipText: getTooltipText(itemStr, this.locator),
4311
- command: this.tools[itemStr.toLocaleLowerCase()].command,
4312
- subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
4313
- };
4314
- }
4315
- else {
4316
- return {
4317
- id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
4318
- prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
4319
- command: this.tools[itemStr.toLocaleLowerCase()].command,
4320
- subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
4321
- };
4322
- }
4373
+ return {
4374
+ id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
4375
+ prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
4376
+ tooltipText: getTooltipText(itemStr, this.locator),
4377
+ command: this.tools[itemStr.toLocaleLowerCase()].command,
4378
+ subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
4379
+ };
4323
4380
  }
4324
4381
  }
4325
4382
  }
@@ -4366,17 +4423,21 @@ class BaseToolbar {
4366
4423
  items.push(item);
4367
4424
  }
4368
4425
  }
4369
- for (let num = 0; num < items.length; num++) {
4370
- const tooltipText = items[num].tooltipText;
4371
- let shortCutKey;
4372
- if (windowKeys[`${tooltipText}`]) {
4373
- shortCutKey = Browser.isDevice && isIDevice() ? windowKeys[`${tooltipText}`].replace('Ctrl', 'Cmd') : windowKeys[`${tooltipText}`];
4374
- }
4375
- else {
4376
- shortCutKey = tooltipText;
4377
- }
4378
- if (shortCutKey) {
4379
- items[num].tooltipText = (tooltipText !== shortCutKey) ? tooltipText + ' (' + shortCutKey + ')' : tooltipText;
4426
+ if (this.parent.showTooltip) {
4427
+ for (let num = 0; num < items.length; num++) {
4428
+ const tooltipText = items[num].tooltipText;
4429
+ let shortCutKey;
4430
+ if (windowKeys[`${tooltipText}`]) {
4431
+ shortCutKey = window.navigator.platform.toLocaleLowerCase().includes('mac') ? windowKeys[`${tooltipText}`].replace('Ctrl', 'Cmd') : windowKeys[`${tooltipText}`];
4432
+ }
4433
+ else {
4434
+ shortCutKey = tooltipText;
4435
+ }
4436
+ if (shortCutKey) {
4437
+ if (!(items[num].command === "Images" && items[num].subCommand === "InsertLink")) {
4438
+ items[num].tooltipText = (tooltipText !== shortCutKey) ? tooltipText + ' (' + shortCutKey + ')' : tooltipText;
4439
+ }
4440
+ }
4380
4441
  }
4381
4442
  }
4382
4443
  return items;
@@ -4425,7 +4486,7 @@ class DropDownButtons {
4425
4486
  addClass([args.element], item.cssClass);
4426
4487
  }
4427
4488
  if (item.command === 'Images' || item.command === 'Videos' || item.command === 'Audios' || item.command === 'Table') {
4428
- args.element.setAttribute('title', getQuickToolbarTooltipText(item.text));
4489
+ args.element.setAttribute('title', getQuickToolbarTooltipText(item.text) !== '' ? getQuickToolbarTooltipText(item.text) : item.text);
4429
4490
  }
4430
4491
  if (item.command === 'Alignments' || item.subCommand === 'JustifyLeft'
4431
4492
  || item.subCommand === 'JustifyRight' || item.subCommand === 'JustifyCenter') {
@@ -4435,13 +4496,13 @@ class DropDownButtons {
4435
4496
  args.element.setAttribute('title', getTooltipTextDropdownItems(item.subCommand.toLocaleLowerCase(), this.locator, formatsLocale));
4436
4497
  }
4437
4498
  if (item.command === 'Font') {
4438
- args.element.setAttribute('title', getTooltipTextDropdownItems(item.value.toLocaleLowerCase(), this.locator, fontNameLocale));
4499
+ args.element.setAttribute('title', getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, fontNameLocale) !== '' ? getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, fontNameLocale) : item.text);
4439
4500
  }
4440
4501
  if (item.subCommand === 'BulletFormatList') {
4441
- args.element.setAttribute('title', getTooltipTextDropdownItems(item.value.toLocaleLowerCase(), this.locator, bulletFormatListLocale));
4502
+ args.element.setAttribute('title', getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, bulletFormatListLocale) !== '' ? getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, bulletFormatListLocale) : item.text);
4442
4503
  }
4443
4504
  if (item.subCommand === 'NumberFormatList') {
4444
- args.element.setAttribute('title', getTooltipTextDropdownItems(item.text.replace(/\s/g, '').toLocaleLowerCase(), this.locator, numberFormatListLocale));
4505
+ args.element.setAttribute('title', (getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, numberFormatListLocale)) !== '' ? getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, numberFormatListLocale) : item.text);
4445
4506
  }
4446
4507
  if (item.subCommand === 'FontSize') {
4447
4508
  args.element.setAttribute('title', getTooltipTextDropdownItems(item.value.toLocaleLowerCase(), null, null, this.parent));
@@ -5242,72 +5303,14 @@ class Toolbar$2 {
5242
5303
  }
5243
5304
  }
5244
5305
  toggleFloatClass(e) {
5245
- let topValue;
5246
- let isBody = false;
5247
- let isFloat = false;
5248
- let scrollParent;
5249
5306
  const floatOffset = this.parent.floatingToolbarOffset;
5250
- if (e && this.parent.iframeSettings.enable && this.parent.inputElement.ownerDocument === e.target) {
5251
- scrollParent = e.target.body;
5252
- }
5253
- else if (e && e.target !== document) {
5254
- scrollParent = e.target;
5307
+ if (this.parent.toolbarSettings.enableFloating) {
5308
+ addClass([this.tbElement.parentElement], [CLS_TB_FLOAT]);
5309
+ setStyleAttribute(this.tbElement.parentElement, { top: (floatOffset) + 'px' });
5255
5310
  }
5256
5311
  else {
5257
- isBody = true;
5258
- scrollParent = document.body;
5259
- }
5260
- const tbHeight = this.getToolbarHeight() + this.getExpandTBarPopHeight();
5261
- if (this.isTransformChild) {
5262
- topValue = 0;
5263
- let scrollParentRelativeTop = 0;
5264
- const trgHeight = this.parent.element.offsetHeight;
5265
- if (isBody) {
5266
- const bodyStyle = window.getComputedStyle(scrollParent);
5267
- scrollParentRelativeTop = parseFloat(bodyStyle.marginTop.split('px')[0]) + parseFloat(bodyStyle.paddingTop.split('px')[0]);
5268
- }
5269
- const targetTop = this.parent.element.getBoundingClientRect().top;
5270
- const scrollParentYOffset = (Browser.isMSPointer && isBody) ? window.pageYOffset : scrollParent.parentElement.scrollTop;
5271
- const scrollParentRect = scrollParent.getBoundingClientRect();
5272
- const scrollParentTop = (!isBody) ? scrollParentRect.top : (scrollParentRect.top + scrollParentYOffset);
5273
- const outOfRange = ((targetTop - ((!isBody) ? scrollParentTop : 0))
5274
- + trgHeight > tbHeight + floatOffset) ? false : true;
5275
- if (targetTop > (scrollParentTop + floatOffset) || targetTop < -trgHeight || ((targetTop < 0) ? outOfRange : false)) {
5276
- isFloat = false;
5277
- removeClass([this.tbElement], [CLS_TB_ABS_FLOAT]);
5278
- }
5279
- else if (targetTop < (scrollParentTop + floatOffset)) {
5280
- if (targetTop < 0) {
5281
- topValue = (-targetTop) + scrollParentTop;
5282
- }
5283
- else {
5284
- topValue = scrollParentTop - targetTop;
5285
- }
5286
- topValue = (isBody) ? topValue - scrollParentRelativeTop : topValue;
5287
- addClass([this.tbElement], [CLS_TB_ABS_FLOAT]);
5288
- isFloat = true;
5289
- }
5290
- }
5291
- else {
5292
- const parent = this.parent.element.getBoundingClientRect();
5293
- if (window.innerHeight < parent.top) {
5294
- return;
5295
- }
5296
- topValue = (e && e.target !== document) ? scrollParent.getBoundingClientRect().top : 0;
5297
- if ((parent.bottom < (floatOffset + tbHeight + topValue)) || parent.bottom < 0 || parent.top > floatOffset + topValue) {
5298
- isFloat = false;
5299
- }
5300
- else if (parent.top < floatOffset || parent.top < floatOffset + topValue) {
5301
- isFloat = true;
5302
- }
5303
- }
5304
- if (!isFloat) {
5305
- removeClass([this.tbElement], [CLS_TB_FLOAT]);
5306
- setStyleAttribute(this.tbElement, { top: 0 + 'px', width: '100%' });
5307
- }
5308
- else {
5309
- addClass([this.tbElement], [CLS_TB_FLOAT]);
5310
- setStyleAttribute(this.tbElement, { width: this.parent.element.offsetWidth + 'px', top: (floatOffset + topValue) + 'px' });
5312
+ removeClass([this.tbElement.parentElement], [CLS_TB_FLOAT]);
5313
+ setStyleAttribute(this.tbElement.parentElement, { top: '' });
5311
5314
  }
5312
5315
  }
5313
5316
  renderToolbar() {
@@ -5613,19 +5616,6 @@ class Toolbar$2 {
5613
5616
  this.toolbarActionModule.parent = null;
5614
5617
  this.dropDownModule.parent = null;
5615
5618
  }
5616
- scrollHandler(e) {
5617
- if (!this.parent.inlineMode.enable) {
5618
- if (this.parent.toolbarSettings.enableFloating && this.getDOMVisibility(this.tbElement)) {
5619
- this.toggleFloatClass(e.args);
5620
- }
5621
- }
5622
- }
5623
- getDOMVisibility(el) {
5624
- if (!el.offsetParent && el.offsetWidth === 0 && el.offsetHeight === 0) {
5625
- return false;
5626
- }
5627
- return true;
5628
- }
5629
5619
  mouseDownHandler() {
5630
5620
  if (Browser.isDevice && this.parent.inlineMode.enable && !isIDevice()) {
5631
5621
  this.showFixedTBar();
@@ -5662,11 +5652,6 @@ class Toolbar$2 {
5662
5652
  }
5663
5653
  adjustContentHeight(trg, isKeyboard) {
5664
5654
  if (trg && this.parent.toolbarSettings.type === ToolbarType.Expand && !isNullOrUndefined(trg)) {
5665
- const extendedTbar = this.tbElement.querySelector('.e-toolbar-extended');
5666
- if (!isNullOrUndefined(extendedTbar)) {
5667
- setStyleAttribute(extendedTbar, { maxHeight: '', display: 'block' });
5668
- setStyleAttribute(extendedTbar, { maxHeight: extendedTbar.offsetHeight + 'px', display: '' });
5669
- }
5670
5655
  const hasActiveClass = trg.classList.contains('e-nav-active');
5671
5656
  const isExpand = isKeyboard ? (hasActiveClass ? false : true) : (hasActiveClass ? true : false);
5672
5657
  if (isExpand) {
@@ -5675,7 +5660,7 @@ class Toolbar$2 {
5675
5660
  else {
5676
5661
  removeClass([this.tbElement], [CLS_EXPAND_OPEN]);
5677
5662
  }
5678
- this.parent.setContentHeight('toolbar', isExpand);
5663
+ this.parent.setContentHeight('Toolbar', isExpand);
5679
5664
  }
5680
5665
  else if (Browser.isDevice || this.parent.inlineMode.enable) {
5681
5666
  this.isToolbar = true;
@@ -5700,7 +5685,6 @@ class Toolbar$2 {
5700
5685
  this.dropDownModule = new DropDownButtons(this.parent, this.locator);
5701
5686
  this.toolbarActionModule = new ToolbarAction(this.parent);
5702
5687
  this.parent.on(initialEnd, this.renderToolbar, this);
5703
- this.parent.on(scroll, this.scrollHandler, this);
5704
5688
  this.parent.on(bindOnEnd, this.toolbarBindEvent, this);
5705
5689
  this.parent.on(toolbarUpdated, this.updateToolbarStatus, this);
5706
5690
  this.parent.on(modelChanged, this.onPropertyChanged, this);
@@ -5725,7 +5709,6 @@ class Toolbar$2 {
5725
5709
  return;
5726
5710
  }
5727
5711
  this.parent.off(initialEnd, this.renderToolbar);
5728
- this.parent.off(scroll, this.scrollHandler);
5729
5712
  this.parent.off(bindOnEnd, this.toolbarBindEvent);
5730
5713
  this.parent.off(toolbarUpdated, this.updateToolbarStatus);
5731
5714
  this.parent.off(modelChanged, this.onPropertyChanged);
@@ -5760,7 +5743,8 @@ class Toolbar$2 {
5760
5743
  if (!this.parent.inlineMode.enable) {
5761
5744
  this.refreshToolbarOverflow();
5762
5745
  }
5763
- this.parent.setContentHeight('', true);
5746
+ const isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
5747
+ this.parent.setContentHeight('Refresh', isExpand);
5764
5748
  }
5765
5749
  /**
5766
5750
  * Called internally if any of the property value changed.
@@ -5780,6 +5764,11 @@ class Toolbar$2 {
5780
5764
  }
5781
5765
  }
5782
5766
  }
5767
+ if (!isNullOrUndefined(e.newProp.toolbarSettings)) {
5768
+ if (!isNullOrUndefined(e.newProp.toolbarSettings.enableFloating)) {
5769
+ this.toggleFloatClass();
5770
+ }
5771
+ }
5783
5772
  if (e.module !== this.getModuleName()) {
5784
5773
  return;
5785
5774
  }
@@ -6279,7 +6268,7 @@ class BaseQuickToolbar {
6279
6268
  constructor(parent, locator) {
6280
6269
  this.parent = parent;
6281
6270
  this.locator = locator;
6282
- this.isDOMElement = false;
6271
+ this.isRendered = false;
6283
6272
  this.renderFactory = this.locator.getService('rendererFactory');
6284
6273
  this.contentRenderer = this.renderFactory.getRenderer(RenderType.Content);
6285
6274
  this.popupRenderer = this.renderFactory.getRenderer(RenderType.Popup);
@@ -6343,7 +6332,18 @@ class BaseQuickToolbar {
6343
6332
  e.target.classList.contains('e-imgbreak')) ? false : true;
6344
6333
  let target = !isNullOrUndefined(imgWrapper) ? imgWrapper : e.target;
6345
6334
  addClass([this.toolbarElement], [CLS_RM_WHITE_SPACE]);
6346
- const targetOffsetTop = (target.classList.contains("e-rte-audio")) ? target.parentElement.offsetTop : target.offsetTop;
6335
+ let targetOffsetTop;
6336
+ if (!isNullOrUndefined(closest(target, 'table'))) {
6337
+ targetOffsetTop = target.offsetTop;
6338
+ let parentTable = closest(target, 'table');
6339
+ while (!isNullOrUndefined(parentTable)) {
6340
+ targetOffsetTop += parentTable.offsetTop;
6341
+ parentTable = closest(parentTable.parentElement, 'table');
6342
+ }
6343
+ }
6344
+ else {
6345
+ targetOffsetTop = (target.classList.contains("e-rte-audio")) ? target.parentElement.offsetTop : target.offsetTop;
6346
+ }
6347
6347
  const parentOffsetTop = window.pageYOffset + e.parentData.top;
6348
6348
  if ((targetOffsetTop - e.editTop) > e.popHeight) {
6349
6349
  y = parentOffsetTop + e.tBarElementHeight + (targetOffsetTop - e.editTop) - e.popHeight - 5;
@@ -6355,11 +6355,30 @@ class BaseQuickToolbar {
6355
6355
  y = e.y;
6356
6356
  }
6357
6357
  target = isAligned ? e.target : target;
6358
- if (target.offsetWidth > e.popWidth) {
6359
- x = (target.offsetWidth / 2) - (e.popWidth / 2) + e.parentData.left + ((target.classList.contains("e-rte-audio")) ? target.parentElement.offsetLeft : target.offsetLeft);
6358
+ let targetOffsetLeft;
6359
+ let currentOffsetWidth;
6360
+ if (!isNullOrUndefined(closest(target, 'table'))) {
6361
+ targetOffsetLeft = target.offsetLeft;
6362
+ let parentTable = closest(target, 'table');
6363
+ let checkOffSetParentWidth = false;
6364
+ if (!isNullOrUndefined(closest(parentTable, 'TD'))) {
6365
+ checkOffSetParentWidth = true;
6366
+ }
6367
+ while (!isNullOrUndefined(parentTable)) {
6368
+ targetOffsetLeft += parentTable.offsetLeft;
6369
+ currentOffsetWidth = checkOffSetParentWidth ? parentTable.offsetWidth : target.offsetWidth;
6370
+ parentTable = closest(parentTable.parentElement, 'table');
6371
+ }
6372
+ }
6373
+ else {
6374
+ currentOffsetWidth = target.offsetWidth;
6375
+ targetOffsetLeft = (target.classList.contains("e-rte-audio")) ? target.parentElement.offsetLeft : target.offsetLeft;
6376
+ }
6377
+ if (currentOffsetWidth > e.popWidth) {
6378
+ x = (currentOffsetWidth / 2) - (e.popWidth / 2) + e.parentData.left + targetOffsetLeft;
6360
6379
  }
6361
6380
  else {
6362
- x = e.parentData.left + target.offsetLeft;
6381
+ x = e.parentData.left + targetOffsetLeft;
6363
6382
  }
6364
6383
  this.popupObj.position.X = ((x + e.popWidth) > e.parentData.right) ? e.parentData.right - e.popWidth : x;
6365
6384
  this.popupObj.position.Y = (y >= 0) ? y : e.y + 5;
@@ -6486,6 +6505,9 @@ class BaseQuickToolbar {
6486
6505
  this.parent.disableToolbarItem(this.parent.toolbarSettings.items);
6487
6506
  this.parent.enableToolbarItem(['Undo', 'Redo']);
6488
6507
  }
6508
+ else {
6509
+ this.parent.enableToolbarItem(this.parent.toolbarSettings.items);
6510
+ }
6489
6511
  append([this.element], document.body);
6490
6512
  if (this.parent.showTooltip) {
6491
6513
  this.tooltip = new Tooltip({
@@ -6493,7 +6515,8 @@ class BaseQuickToolbar {
6493
6515
  openDelay: 400,
6494
6516
  showTipPointer: true,
6495
6517
  windowCollision: true,
6496
- position: 'BottomCenter'
6518
+ position: 'BottomCenter',
6519
+ cssClass: this.parent.getCssClass()
6497
6520
  });
6498
6521
  this.tooltip.appendTo(this.element);
6499
6522
  }
@@ -6527,7 +6550,7 @@ class BaseQuickToolbar {
6527
6550
  parentData: parent.getBoundingClientRect(),
6528
6551
  tBarElementHeight: tBarHeight
6529
6552
  };
6530
- if ((target.tagName === 'IMG' || target.tagName === 'AUDIO' || target.tagName === 'VIDEO' || target.tagName === 'IFRAME' || (target.classList &&
6553
+ if ((closest(target, 'TABLE') || target.tagName === 'IMG' || target.tagName === 'AUDIO' || target.tagName === 'VIDEO' || target.tagName === 'IFRAME' || (target.classList &&
6531
6554
  (target.classList.contains(CLS_AUDIOWRAP) || target.classList.contains(CLS_CLICKELEM) ||
6532
6555
  target.classList.contains(CLS_VID_CLICK_ELEM)))) && (x == beforeQuickToolbarArgs.positionX || y == beforeQuickToolbarArgs.positionY)) {
6533
6556
  this.setPosition(showPopupData);
@@ -6547,7 +6570,7 @@ class BaseQuickToolbar {
6547
6570
  maxWidth: window.outerWidth + 'px'
6548
6571
  });
6549
6572
  addClass([this.element], [CLS_POP]);
6550
- this.isDOMElement = true;
6573
+ this.isRendered = true;
6551
6574
  }
6552
6575
  });
6553
6576
  }
@@ -6587,7 +6610,7 @@ class BaseQuickToolbar {
6587
6610
  this.parent.notify(destroyTooltip, { args: event });
6588
6611
  }
6589
6612
  this.removeEleFromDOM();
6590
- this.isDOMElement = false;
6613
+ this.isRendered = false;
6591
6614
  }
6592
6615
  /**
6593
6616
  * @param {string} item - specifies the string value
@@ -6610,7 +6633,7 @@ class BaseQuickToolbar {
6610
6633
  }
6611
6634
  removeEleFromDOM() {
6612
6635
  const element = this.popupObj.element;
6613
- if (this.isDOMElement) {
6636
+ if (this.isRendered) {
6614
6637
  this.dropDownButtons.destroyDropDowns();
6615
6638
  this.colorPickerObj.destroyColorPicker();
6616
6639
  removeClass([this.element], [CLS_POP]);
@@ -6933,7 +6956,7 @@ class QuickToolbar {
6933
6956
  * @deprecated
6934
6957
  */
6935
6958
  showInlineQTBar(x, y, target) {
6936
- if (isNullOrUndefined(this.parent) || this.parent.readonly || target.tagName.toLowerCase() === 'img') {
6959
+ if (isNullOrUndefined(this.parent) || this.parent.readonly || target.tagName.toLowerCase() === 'img' || this.inlineQTBar.element.querySelector('.e-rte-color-content')) {
6937
6960
  return;
6938
6961
  }
6939
6962
  this.inlineQTBar.showPopup(x, y, target);
@@ -7021,6 +7044,9 @@ class QuickToolbar {
7021
7044
  }
7022
7045
  }
7023
7046
  if (!isNullOrUndefined(this.textQTBar) && !isNullOrUndefined(this.parent.quickToolbarSettings.text) && !this.parent.inlineMode.enable) {
7047
+ if (!isNullOrUndefined(e) && !isNullOrUndefined(e.name) && e.name === 'sourceCodeMouseDown') {
7048
+ return;
7049
+ }
7024
7050
  const args = e.args.touches ?
7025
7051
  e.args.changedTouches[0] : e.args;
7026
7052
  const target = e.args.target;
@@ -7031,7 +7057,7 @@ class QuickToolbar {
7031
7057
  this.offsetY = pageYOffset(args, this.parent.element, this.parent.iframeSettings.enable);
7032
7058
  const range = this.parent.getRange();
7033
7059
  if ((range.endContainer.parentElement.tagName === range.startContainer.parentElement.tagName && (range.startContainer.parentElement.tagName === 'A' && range.endContainer.parentElement.tagName === 'A')) ||
7034
- (target.tagName === 'IMG') || (target.tagName === 'VIDEO') || (target.tagName === 'AUDIO') || (target.childNodes[0].nodeType === 1 && target.childNodes[0].classList.contains('e-rte-audio')) ||
7060
+ (target.tagName === 'IMG') || (target.tagName === 'VIDEO') || (target.tagName === 'AUDIO') || (target.childNodes[0] && target.childNodes[0].nodeType === 1 && target.childNodes[0].classList.contains('e-rte-audio')) ||
7035
7061
  (this.parent.getRange().startOffset === this.parent.getRange().endOffset)) {
7036
7062
  return;
7037
7063
  }
@@ -7039,13 +7065,16 @@ class QuickToolbar {
7039
7065
  this.textQTBar.showPopup(this.offsetX, this.offsetY, target, 'text');
7040
7066
  }
7041
7067
  }
7042
- keyDownHandler() {
7043
- if ((this.parent.inlineMode.enable && (!Browser.isDevice || isIDevice()))
7044
- && !isNullOrUndefined(select('.' + CLS_INLINE_POP, document))) {
7045
- this.hideInlineQTBar();
7046
- }
7047
- if (this.textQTBar && !hasClass(this.textQTBar.element, 'e-popup-close')) {
7048
- this.textQTBar.hidePopup();
7068
+ keyDownHandler(e) {
7069
+ const preventHide = e.args.altKey;
7070
+ if (!preventHide) {
7071
+ if ((this.parent.inlineMode.enable && (!Browser.isDevice || isIDevice()))
7072
+ && !isNullOrUndefined(select('.' + CLS_INLINE_POP, document))) {
7073
+ this.hideInlineQTBar();
7074
+ }
7075
+ if (this.textQTBar && !hasClass(this.textQTBar.element, 'e-popup-close')) {
7076
+ this.textQTBar.hidePopup();
7077
+ }
7049
7078
  }
7050
7079
  }
7051
7080
  inlineQTBarMouseDownHandler() {
@@ -7371,6 +7400,15 @@ class QuickToolbar {
7371
7400
  getModuleName() {
7372
7401
  return 'quickToolbar';
7373
7402
  }
7403
+ /**
7404
+ *
7405
+ * @returns {BaseQuickToolbar[]} - specifies the quick toolbar instance.
7406
+ * @hidden
7407
+ * @private
7408
+ */
7409
+ getQuickToolbarInstance() {
7410
+ return [this.linkQTBar, this.imageQTBar, this.audioQTBar, this.videoQTBar, this.tableQTBar, this.textQTBar, this.inlineQTBar];
7411
+ }
7374
7412
  }
7375
7413
 
7376
7414
  /**
@@ -9642,6 +9680,17 @@ const selfClosingTags = [
9642
9680
  'BR',
9643
9681
  'IMG'
9644
9682
  ];
9683
+ /**
9684
+ * Resize factor for image.
9685
+ * @hidden
9686
+ *
9687
+ */
9688
+ const imageResizeFactor = {
9689
+ topLeft: [-1, -1],
9690
+ topRight: [1, -1],
9691
+ botRight: [1, 1],
9692
+ botLeft: [-1, 1]
9693
+ };
9645
9694
 
9646
9695
  /**
9647
9696
  * `Undo` module is used to handle undo actions.
@@ -10575,7 +10624,9 @@ class MarkdownEditor {
10575
10624
  onToolbarClick(args) {
10576
10625
  const item = args.item;
10577
10626
  const textArea = this.parent.contentModule.getEditPanel();
10578
- textArea.focus();
10627
+ if (item.command !== 'Formats') {
10628
+ textArea.focus();
10629
+ }
10579
10630
  const startOffset = textArea.selectionStart;
10580
10631
  const endOffset = textArea.selectionEnd;
10581
10632
  const text = textArea.value.substring(startOffset, endOffset);
@@ -11896,11 +11947,12 @@ class DOMNode {
11896
11947
  /**
11897
11948
  * blockNodes method
11898
11949
  *
11950
+ * @param {boolean} action - Optional Boolean that specifies the action is whether performed.
11899
11951
  * @returns {Node[]} - returns the node array values
11900
11952
  * @hidden
11901
11953
  * @deprecated
11902
11954
  */
11903
- blockNodes() {
11955
+ blockNodes(action) {
11904
11956
  const collectionNodes = [];
11905
11957
  const selection = this.getSelection();
11906
11958
  if (this.isEditorArea() && selection.rangeCount) {
@@ -11914,23 +11966,46 @@ class DOMNode {
11914
11966
  collectionNodes.push(startNode);
11915
11967
  }
11916
11968
  parentNode = this.blockParentNode(startNode);
11969
+ const endParentNode = this.blockParentNode(endNode);
11917
11970
  if (parentNode && collectionNodes.indexOf(parentNode) < 0) {
11918
- if (IGNORE_BLOCK_TAGS.indexOf(parentNode.tagName.toLocaleLowerCase()) >= 0 && (startNode.tagName === 'BR' ||
11919
- startNode.nodeType === Node.TEXT_NODE ||
11920
- startNode.classList.contains(markerClassName.startSelection) ||
11921
- startNode.classList.contains(markerClassName.endSelection))) {
11922
- const tempNode = startNode.previousSibling &&
11923
- startNode.previousSibling.nodeType === Node.TEXT_NODE ?
11924
- startNode.previousSibling : startNode;
11925
- if (!startNode.nextSibling && !startNode.previousSibling && startNode.tagName === 'BR') {
11926
- collectionNodes.push(tempNode);
11971
+ if (!isNullOrUndefined(action) && action) {
11972
+ if (range.commonAncestorContainer.nodeName === 'TD' || parentNode.nodeName === 'TD' || endParentNode.nodeName === 'TD') {
11973
+ const processedNodes = this.getPreBlockNodeCollection(range);
11974
+ if (processedNodes.length > 1) {
11975
+ this.wrapWithBlockNode(processedNodes, collectionNodes);
11976
+ }
11977
+ else if (processedNodes.length > 0) {
11978
+ if (startNode !== endNode && startNode.nodeName !== 'BR') {
11979
+ collectionNodes.push(this.createTempNode(startNode));
11980
+ }
11981
+ else if (startNode === endNode && startNode.nodeName === 'SPAN' && (startNode.classList.contains(markerClassName.startSelection)
11982
+ || startNode.classList.contains(markerClassName.endSelection))) {
11983
+ collectionNodes.push(this.createTempNode(startNode));
11984
+ }
11985
+ }
11927
11986
  }
11928
11987
  else {
11929
- collectionNodes.push(this.createTempNode(tempNode));
11988
+ collectionNodes.push(parentNode);
11930
11989
  }
11931
11990
  }
11932
11991
  else {
11933
- collectionNodes.push(parentNode);
11992
+ if (IGNORE_BLOCK_TAGS.indexOf(parentNode.tagName.toLocaleLowerCase()) >= 0 && (startNode.tagName === 'BR' ||
11993
+ startNode.nodeType === Node.TEXT_NODE ||
11994
+ startNode.classList.contains(markerClassName.startSelection) ||
11995
+ startNode.classList.contains(markerClassName.endSelection))) {
11996
+ const tempNode = startNode.previousSibling &&
11997
+ startNode.previousSibling.nodeType === Node.TEXT_NODE ?
11998
+ startNode.previousSibling : startNode;
11999
+ if (!startNode.nextSibling && !startNode.previousSibling && startNode.tagName === 'BR') {
12000
+ collectionNodes.push(tempNode);
12001
+ }
12002
+ else {
12003
+ collectionNodes.push(this.createTempNode(tempNode));
12004
+ }
12005
+ }
12006
+ else {
12007
+ collectionNodes.push(parentNode);
12008
+ }
11934
12009
  }
11935
12010
  }
11936
12011
  const nodes = [];
@@ -11999,6 +12074,131 @@ class DOMNode {
11999
12074
  ignoreTableTag(element) {
12000
12075
  return !(TABLE_BLOCK_TAGS.indexOf(element.tagName.toLocaleLowerCase()) >= 0);
12001
12076
  }
12077
+ getPreBlockNodeCollection(range) {
12078
+ const startNode = this.getSelectedNode(range.startContainer, range.startOffset);
12079
+ const endNode = this.getSelectedNode(range.endContainer, range.endOffset);
12080
+ const nodes = [];
12081
+ const rootNode = startNode.closest('td, th');
12082
+ if (isNullOrUndefined(rootNode)) {
12083
+ return nodes;
12084
+ }
12085
+ const rootChildNode = Array.from(rootNode.childNodes);
12086
+ let isContinue = true;
12087
+ const processedStart = this.getClosestInlineParent(startNode, rootNode, true);
12088
+ const processedEnd = this.getClosestInlineParent(endNode, rootNode, false);
12089
+ for (let i = 0; i < rootChildNode.length; i++) {
12090
+ const child = rootChildNode[i];
12091
+ if (processedStart === processedEnd && child === processedStart) {
12092
+ nodes.push(child);
12093
+ isContinue = true;
12094
+ }
12095
+ else if (child === processedStart) {
12096
+ isContinue = false;
12097
+ }
12098
+ else if (child === processedEnd) {
12099
+ nodes.push(child); // Early Exit so Push the end node.
12100
+ isContinue = true;
12101
+ }
12102
+ if (isContinue) {
12103
+ continue;
12104
+ }
12105
+ else {
12106
+ nodes.push(child);
12107
+ }
12108
+ }
12109
+ return nodes;
12110
+ }
12111
+ getClosestInlineParent(node, rootNode, isStart) {
12112
+ // 1. If the node is a text node, return the node
12113
+ // 2. If the node is a block node return block node
12114
+ // 3. If the node is a inline node,
12115
+ // Traverse back untill the TD or TH node
12116
+ // Check if the the previous sibling , next sibling is a block node.
12117
+ // If yes return the inline node that is closest to the block node.
12118
+ if (node.nodeType === Node.TEXT_NODE) {
12119
+ return node;
12120
+ }
12121
+ if (this.isBlockNode(node)) {
12122
+ return node;
12123
+ }
12124
+ let currentNode = node;
12125
+ let rootFlag = false;
12126
+ while (currentNode) {
12127
+ const previousNode = currentNode;
12128
+ if (rootFlag) {
12129
+ if (this.isBlockNode(currentNode)) {
12130
+ return previousNode;
12131
+ }
12132
+ if (isStart && currentNode.previousSibling) {
12133
+ if (this.isBlockNode(currentNode.previousSibling) || currentNode.previousSibling.nodeName === 'BR') {
12134
+ return previousNode;
12135
+ }
12136
+ else {
12137
+ currentNode = currentNode.previousSibling;
12138
+ }
12139
+ }
12140
+ else if (!isStart && currentNode.nextSibling) {
12141
+ if (this.isBlockNode(currentNode.nextSibling) || currentNode.nextSibling.nodeName === 'BR') {
12142
+ return previousNode;
12143
+ }
12144
+ else {
12145
+ currentNode = currentNode.nextSibling;
12146
+ }
12147
+ }
12148
+ else {
12149
+ return currentNode;
12150
+ }
12151
+ }
12152
+ else {
12153
+ currentNode = currentNode.parentElement;
12154
+ if (currentNode === rootNode) {
12155
+ currentNode = previousNode;
12156
+ rootFlag = true;
12157
+ }
12158
+ }
12159
+ }
12160
+ return null;
12161
+ }
12162
+ wrapWithBlockNode(nodes, collectionNodes) {
12163
+ let wrapperElement = createElement('p');
12164
+ for (let i = 0; i < nodes.length; i++) {
12165
+ const child = nodes[i];
12166
+ if (child.nodeName === 'BR') {
12167
+ child.parentNode.insertBefore(wrapperElement, child);
12168
+ wrapperElement.appendChild(child);
12169
+ if (wrapperElement.childNodes.length > 0) {
12170
+ collectionNodes.push(wrapperElement);
12171
+ }
12172
+ wrapperElement = createElement('p');
12173
+ }
12174
+ else {
12175
+ if (!this.isBlockNode(child)) {
12176
+ if (child.nodeName === '#text' && child.textContent.trim() === '') {
12177
+ continue;
12178
+ }
12179
+ if (wrapperElement.childElementCount === 0) {
12180
+ child.parentNode.insertBefore(wrapperElement, child);
12181
+ wrapperElement.appendChild(child);
12182
+ }
12183
+ else {
12184
+ wrapperElement.appendChild(child);
12185
+ }
12186
+ }
12187
+ else {
12188
+ collectionNodes.push(child);
12189
+ }
12190
+ // Use case when the BR is next sibling but the BR is not the part of selection.
12191
+ if ((i === nodes.length - 1) && wrapperElement.nextElementSibling &&
12192
+ wrapperElement.querySelectorAll('br').length === 0 &&
12193
+ wrapperElement.nextElementSibling.nodeName === 'BR') {
12194
+ wrapperElement.appendChild(wrapperElement.nextElementSibling);
12195
+ }
12196
+ }
12197
+ }
12198
+ if (wrapperElement.childNodes.length > 0 && collectionNodes.indexOf(wrapperElement) < 0) {
12199
+ collectionNodes.push(wrapperElement);
12200
+ }
12201
+ }
12002
12202
  }
12003
12203
 
12004
12204
  /**
@@ -12110,7 +12310,8 @@ class Lists {
12110
12310
  startNode.textContent = '';
12111
12311
  }
12112
12312
  const startNodeParent = startNode.parentElement;
12113
- if (isNullOrUndefined(startNodeParent.parentElement.closest('UL')) && isNullOrUndefined(startNodeParent.parentElement.closest('OL'))) {
12313
+ const parentOfCurrentOLUL = startNodeParent.parentElement;
12314
+ if (isNullOrUndefined(parentOfCurrentOLUL.closest('UL')) && isNullOrUndefined(parentOfCurrentOLUL.closest('OL'))) {
12114
12315
  if (!isNullOrUndefined(startNode.nextElementSibling)) {
12115
12316
  const nearBlockNode = this.parent.domNode.blockParentNode(startNode);
12116
12317
  this.parent.nodeCutter.GetSpliceNode(range, nearBlockNode);
@@ -12137,6 +12338,15 @@ class Lists {
12137
12338
  detach(startNode);
12138
12339
  }
12139
12340
  }
12341
+ // To handle the nested enter key press in the list for the first LI element
12342
+ if (!isNullOrUndefined(parentOfCurrentOLUL) && (!isNullOrUndefined(parentOfCurrentOLUL.closest('UL')) || !isNullOrUndefined(parentOfCurrentOLUL.closest('OL'))) &&
12343
+ parentOfCurrentOLUL.nodeName === 'LI' && parentOfCurrentOLUL.style.listStyleType === 'none' &&
12344
+ parentOfCurrentOLUL.textContent === '' && startNode.textContent === '' && startNode === startNodeParent.firstElementChild &&
12345
+ isNullOrUndefined(startNode.nextSibling)) {
12346
+ detach(startNodeParent);
12347
+ parentOfCurrentOLUL.style.removeProperty('list-style-type');
12348
+ e.event.preventDefault();
12349
+ }
12140
12350
  }
12141
12351
  }
12142
12352
  backspaceList(e) {
@@ -12510,7 +12720,7 @@ class Lists {
12510
12720
  this.currentAction = e.subCommand;
12511
12721
  this.currentAction = e.subCommand = this.currentAction === 'NumberFormatList' ? 'OL' : this.currentAction === 'BulletFormatList' ? 'UL' : this.currentAction;
12512
12722
  this.domNode.setMarker(this.saveSelection);
12513
- let listsNodes = this.domNode.blockNodes();
12723
+ let listsNodes = this.domNode.blockNodes(true);
12514
12724
  if (e.enterAction === 'BR') {
12515
12725
  this.setSelectionBRConfig();
12516
12726
  const allSelectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument);
@@ -12624,6 +12834,17 @@ class Lists {
12624
12834
  listEle.innerHTML = '<li><br/></li>';
12625
12835
  elements[i].appendChild(listEle);
12626
12836
  }
12837
+ else if ('LI' !== elements[i].tagName && isNullOrUndefined(item) &&
12838
+ elements[i].nodeName === 'BLOCKQUOTE') {
12839
+ const elemAtt = this.domNode.attributes(elements[i]);
12840
+ const openTag = '<' + type + '>';
12841
+ const closeTag = '</' + type + '>';
12842
+ const newTag = 'li' + elemAtt;
12843
+ const replaceHTML = elements[i].innerHTML;
12844
+ const innerHTML = this.domNode.createTagString(newTag, null, replaceHTML);
12845
+ const collectionString = openTag + innerHTML + closeTag;
12846
+ elements[i].innerHTML = collectionString;
12847
+ }
12627
12848
  else if ('LI' !== elements[i].tagName && isNullOrUndefined(item)) {
12628
12849
  const elemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
12629
12850
  const openTag = '<' + type + '>';
@@ -13410,7 +13631,7 @@ class Formats {
13410
13631
  }
13411
13632
  let save = this.parent.nodeSelection.save(range, this.parent.currentDocument);
13412
13633
  this.parent.domNode.setMarker(save);
13413
- let formatsNodes = this.parent.domNode.blockNodes();
13634
+ let formatsNodes = this.parent.domNode.blockNodes(true);
13414
13635
  if (e.enterAction === 'BR') {
13415
13636
  this.setSelectionBRConfig();
13416
13637
  const allSelectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument);
@@ -13627,6 +13848,10 @@ class InsertHtml {
13627
13848
  const isCollapsed = range.collapsed;
13628
13849
  const nodes = this.getNodeCollection(range, nodeSelection, node);
13629
13850
  const closestParentNode = (node.nodeName.toLowerCase() === 'table') ? this.closestEle(nodes[0].parentNode, editNode) : nodes[0];
13851
+ if (closestParentNode && closestParentNode.nodeName === 'LI' && node.nodeName.toLowerCase() === 'table') {
13852
+ this.insertTableInList(range, node, closestParentNode, nodes[0], nodeCutter);
13853
+ return;
13854
+ }
13630
13855
  if (isExternal || (!isNullOrUndefined(node) && !isNullOrUndefined(node.classList) &&
13631
13856
  node.classList.contains('pasteContent'))) {
13632
13857
  this.pasteInsertHTML(nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode, enterAction);
@@ -13779,7 +14004,12 @@ class InsertHtml {
13779
14004
  TABLE_BLOCK_TAGS.indexOf(closestParentNode.tagName.toLocaleLowerCase()) !== -1))
13780
14005
  || (node.nodeName.toLowerCase() === 'table' && closestParentNode &&
13781
14006
  TABLE_BLOCK_TAGS.indexOf(closestParentNode.tagName.toLocaleLowerCase()) === -1))) {
13782
- preNode = nodeCutter.GetSpliceNode(range, closestParentNode);
14007
+ if (isCollapsed) {
14008
+ preNode = nodeCutter.SplitNode(range, closestParentNode, true);
14009
+ }
14010
+ else {
14011
+ preNode = nodeCutter.SplitNode(range, closestParentNode, false);
14012
+ }
13783
14013
  sibNode = isNullOrUndefined(preNode.previousSibling) ? preNode.parentNode.previousSibling : preNode.previousSibling;
13784
14014
  if (nodes.length === 1) {
13785
14015
  nodeSelection.setSelectionContents(docElement, preNode);
@@ -13866,6 +14096,9 @@ class InsertHtml {
13866
14096
  let paraElm;
13867
14097
  let previousParent;
13868
14098
  if (!this.contentsDeleted) {
14099
+ if (!isCollapsed && range.startContainer.parentElement.textContent.length === 0 && range.startContainer.nodeName === 'BR' && range.startContainer.parentElement.nodeName === 'P') {
14100
+ editNode.removeChild(range.startContainer.parentElement);
14101
+ }
13869
14102
  range.deleteContents();
13870
14103
  }
13871
14104
  while (node.firstChild) {
@@ -14114,6 +14347,9 @@ class InsertHtml {
14114
14347
  }
14115
14348
  static closestEle(element, editNode) {
14116
14349
  let el = element;
14350
+ if (closest(el, 'li')) {
14351
+ return closest(el, 'li');
14352
+ }
14117
14353
  while (el && el.nodeType === 1) {
14118
14354
  if (el.parentNode === editNode ||
14119
14355
  (!isNullOrUndefined(el.parentNode.tagName) &&
@@ -14124,6 +14360,30 @@ class InsertHtml {
14124
14360
  }
14125
14361
  return null;
14126
14362
  }
14363
+ static insertTableInList(range, insertNode, parentNode, currentNode, nodeCutter) {
14364
+ if (range.collapsed) {
14365
+ const isStart = range.startOffset === 0;
14366
+ const isEnd = range.startContainer.textContent.trimEnd().length === range.startOffset;
14367
+ if (isStart || isEnd) {
14368
+ if (isStart) {
14369
+ InsertMethods.AppendBefore(insertNode, currentNode, false);
14370
+ }
14371
+ else {
14372
+ InsertMethods.AppendBefore(insertNode, currentNode, true);
14373
+ }
14374
+ }
14375
+ else {
14376
+ const preNode = nodeCutter.SplitNode(range, parentNode, true);
14377
+ const sibNode = preNode.previousSibling;
14378
+ sibNode.appendChild(insertNode);
14379
+ }
14380
+ }
14381
+ else {
14382
+ range.deleteContents();
14383
+ parentNode.appendChild(insertNode);
14384
+ }
14385
+ insertNode.classList.add('ignore-table');
14386
+ }
14127
14387
  }
14128
14388
  /**
14129
14389
  * Insert method
@@ -14329,7 +14589,7 @@ class LinkCommand {
14329
14589
  for (let i = 0, j = 0, k = 0; i <= finalinlineNodes.length; i++) {
14330
14590
  if (i === 0) {
14331
14591
  finalinlineNodes[i].parentNode.insertBefore(anchorNodes[j], finalinlineNodes[i].nextSibling);
14332
- if (this.parent.domNode.blockNodes().length === 1) {
14592
+ if (this.parent.domNode.blockNodes().length === 1 && anchorNodes.length === 1) {
14333
14593
  this.parent.nodeSelection.setSelectionNode(this.parent.currentDocument, anchorNodes[j]);
14334
14594
  }
14335
14595
  removeNodes[k] = finalinlineNodes[i];
@@ -14786,21 +15046,18 @@ class ImageCommand {
14786
15046
  const selectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)[0];
14787
15047
  const imgElm = (e.value === 'Replace' || isReplaced) ? e.item.selectParent[0] :
14788
15048
  (Browser.isIE ? selectedNode.previousSibling : selectedNode.previousElementSibling);
14789
- imgElm.addEventListener('load', () => {
14790
- if (e.value !== 'Replace' || !isReplaced) {
14791
- e.callBack({
14792
- requestType: 'Images',
14793
- editorMode: 'HTML',
14794
- event: e.event,
14795
- range: this.parent.nodeSelection.getRange(this.parent.currentDocument),
14796
- elements: [imgElm]
14797
- });
14798
- }
14799
- });
14800
- }
14801
- if (e.value === 'Replace') {
14802
- e.item.subCommand = 'Replace';
14803
- this.callBack(e);
15049
+ let imageInstance = this;
15050
+ const onImageLoadEvent = () => {
15051
+ e.callBack({
15052
+ requestType: (e.value === 'Replace') ? (e.item.subCommand = 'Replace', "Replace") : 'Images',
15053
+ editorMode: 'HTML',
15054
+ event: e.event,
15055
+ range: imageInstance.parent.nodeSelection.getRange(imageInstance.parent.currentDocument),
15056
+ elements: [imgElm]
15057
+ });
15058
+ imgElm.removeEventListener('load', onImageLoadEvent);
15059
+ };
15060
+ imgElm.addEventListener('load', onImageLoadEvent);
14804
15061
  }
14805
15062
  }
14806
15063
  setStyle(imgElement, e, imgReplace) {
@@ -15512,7 +15769,7 @@ class TableCommand {
15512
15769
  e.item.selection.restore();
15513
15770
  InsertHtml.Insert(this.parent.currentDocument, table, this.parent.editableElement);
15514
15771
  e.item.selection.setSelectionText(this.parent.currentDocument, table.querySelector('td'), table.querySelector('td'), 0, 0);
15515
- if (table.nextElementSibling === null) {
15772
+ if (table.nextElementSibling === null && !table.classList.contains('ignore-table')) {
15516
15773
  let insertElem;
15517
15774
  if (e.enterAction === 'DIV') {
15518
15775
  insertElem = createElement('div');
@@ -15527,6 +15784,9 @@ class TableCommand {
15527
15784
  }
15528
15785
  this.insertAfter(insertElem, table);
15529
15786
  }
15787
+ if (table.classList.contains('ignore-table')) {
15788
+ table.classList.remove('ignore-table');
15789
+ }
15530
15790
  table.querySelector('td').classList.add('e-cell-select');
15531
15791
  if (e.callBack) {
15532
15792
  e.callBack({
@@ -15946,10 +16206,22 @@ class TableCommand {
15946
16206
  firstCell.setAttribute('rowspan', (minMaxIndexes.endRow - minMaxIndexes.startRow + 1).toString());
15947
16207
  }
15948
16208
  let totalWidth = 0;
16209
+ let unit;
15949
16210
  for (let j = rowSelectedCells.length - 1; j >= 0; j--) {
15950
- totalWidth = totalWidth + parseFloat(rowSelectedCells[j].style.width);
16211
+ if (!isNullOrUndefined(rowSelectedCells[j].style.width)
16212
+ && rowSelectedCells[j].style.width !== '') {
16213
+ if (!unit) {
16214
+ const match = rowSelectedCells[j].style.width.match(/^([\d.]+)([a-z%]+)$/i);
16215
+ unit = match ? match[2] : '%';
16216
+ }
16217
+ totalWidth = totalWidth + parseFloat(rowSelectedCells[j].style.width);
16218
+ }
16219
+ else {
16220
+ totalWidth = totalWidth + ((rowSelectedCells[j].offsetWidth / this.curTable.offsetWidth) * 100);
16221
+ unit = '%';
16222
+ }
15951
16223
  }
15952
- firstCell.style.width = totalWidth + '%';
16224
+ firstCell.style.width = totalWidth + unit;
15953
16225
  for (let i = 1; i <= selectedCells.length - 1; i++) {
15954
16226
  detach(selectedCells[i]);
15955
16227
  }
@@ -16957,6 +17229,30 @@ class SelectionCommands {
16957
17229
  formatNode.style.textDecoration = 'none';
16958
17230
  child = [formatNode];
16959
17231
  }
17232
+ else if (IsFormatted.inlineTags.indexOf(formatNodeTagName.toLowerCase()) !== -1 && isFontStyle && formatNodeTagName.toLocaleLowerCase() !== 'span') {
17233
+ let fontNodeStyle = formatNode.style;
17234
+ if (fontNodeStyle.color && format === 'fontcolor') {
17235
+ if (formatNode.nodeName === 'A') {
17236
+ fontNodeStyle.color = value;
17237
+ }
17238
+ else {
17239
+ fontNodeStyle.color = '';
17240
+ }
17241
+ }
17242
+ else if (fontNodeStyle.backgroundColor && format === 'backgroundcolor') {
17243
+ fontNodeStyle.backgroundColor = '';
17244
+ }
17245
+ else if (fontNodeStyle.fontSize && format === 'fontsize') {
17246
+ fontNodeStyle.fontSize = '';
17247
+ }
17248
+ else if (fontNodeStyle.fontFamily && format === 'fontname') {
17249
+ fontNodeStyle.fontFamily = '';
17250
+ }
17251
+ if (formatNode.getAttribute("style") === '') {
17252
+ formatNode.removeAttribute("style");
17253
+ }
17254
+ child = [formatNode];
17255
+ }
16960
17256
  else {
16961
17257
  child = InsertMethods.unwrap(formatNode);
16962
17258
  let liElement = nodes[index].parentElement;
@@ -17137,19 +17433,44 @@ class SelectionCommands {
17137
17433
  parentElement = parentElement.parentElement;
17138
17434
  liElement = parentElement;
17139
17435
  }
17140
- if (format === 'fontcolor') {
17436
+ if (format === 'fontcolor' || format === 'fontname') {
17141
17437
  const parentElem = nodes[index].parentElement;
17142
17438
  if (!isNullOrUndefined(parentElem) && parentElem.childNodes) {
17143
17439
  for (let i = 0; i < parentElem.childNodes.length; i++) {
17144
17440
  if (this.concatenateTextExcludingList(nodes, index) === nodes[index].textContent) {
17441
+ let liElement;
17145
17442
  if (parentElem.tagName === 'LI') {
17146
- parentElem.style.color = value;
17443
+ liElement = parentElem;
17444
+ }
17445
+ else if (parentElem.closest('li')) {
17446
+ liElement = parentElem.closest('li');
17447
+ }
17448
+ if (!isNullOrUndefined(liElement)) {
17449
+ switch (format) {
17450
+ case 'fontcolor':
17451
+ liElement.style.color = value;
17452
+ break;
17453
+ case 'fontname':
17454
+ liElement.style.fontFamily = value;
17455
+ break;
17456
+ default:
17457
+ break;
17458
+ }
17147
17459
  }
17148
17460
  }
17149
17461
  // eslint-disable-next-line
17150
17462
  const childElement = parentElem.childNodes[i];
17151
17463
  if (childElement.tagName === 'OL' || childElement.tagName === 'UL') {
17152
- childElement.style.color = 'initial';
17464
+ switch (format) {
17465
+ case 'fontcolor':
17466
+ childElement.style.color = 'initial';
17467
+ break;
17468
+ case 'fontname':
17469
+ childElement.style.fontFamily = 'initial';
17470
+ break;
17471
+ default:
17472
+ break;
17473
+ }
17153
17474
  }
17154
17475
  }
17155
17476
  }
@@ -18166,6 +18487,7 @@ class MsWordPaste {
18166
18487
  const elm = createElement('p');
18167
18488
  elm.setAttribute('id', 'MSWord-Content');
18168
18489
  elm.innerHTML = tempHTMLContent;
18490
+ this.addDoubleBr(elm);
18169
18491
  const patern = /class='?Mso|style='[^ ]*\bmso-/i;
18170
18492
  const patern2 = /class="?Mso|style="[^ ]*\bmso-/i;
18171
18493
  const patern3 = /(class="?Mso|class='?Mso|class="?Xl|class='?Xl|class=Xl|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument)/gi;
@@ -18200,6 +18522,26 @@ class MsWordPaste {
18200
18522
  e.callBack(elm.innerHTML);
18201
18523
  }
18202
18524
  }
18525
+ addDoubleBr(elm) {
18526
+ const newline = elm.querySelector('.Apple-interchange-newline');
18527
+ if (!isNullOrUndefined(newline) && Browser.userAgent.indexOf('Chrome') !== -1 && newline.parentElement.nodeName === 'P' && elm !== newline.parentElement) {
18528
+ for (let i = 0; i < elm.childNodes.length; i++) {
18529
+ // eslint-disable-next-line
18530
+ const node = elm.childNodes[i];
18531
+ if (node.nodeType === Node.COMMENT_NODE && node.nodeValue.includes('StartFragment')) {
18532
+ const newElement = document.createElement('p');
18533
+ newElement.innerHTML = '<br>';
18534
+ const cssText = newline.parentElement.style.cssText;
18535
+ const currentStyle = newElement.getAttribute('style') || '';
18536
+ const newStyle = currentStyle + cssText;
18537
+ newElement.setAttribute('style', newStyle);
18538
+ elm.insertBefore(newElement, node.nextSibling);
18539
+ detach(newline);
18540
+ break;
18541
+ }
18542
+ }
18543
+ }
18544
+ }
18203
18545
  cleanList(elm, listTag) {
18204
18546
  const replacableElem = elm.querySelectorAll(listTag + ' div');
18205
18547
  for (let j = replacableElem.length - 1; j >= 0; j--) {
@@ -18556,72 +18898,80 @@ class MsWordPaste {
18556
18898
  }
18557
18899
  styleCorrection(elm, wordPasteStyleConfig) {
18558
18900
  const styleElement = elm.querySelectorAll('style');
18901
+ let styles = [];
18559
18902
  if (styleElement.length > 0) {
18560
- const styles = styleElement[0].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);
18903
+ if (!isNullOrUndefined(styleElement[0].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi))) {
18904
+ styles = styleElement[0].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);
18905
+ }
18906
+ else if (styleElement.length > 1) {
18907
+ styles = styleElement[1].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);
18908
+ }
18561
18909
  const styleClassObject = !isNullOrUndefined(styles) ? this.findStyleObject(styles) : null;
18562
- const keys = Object.keys(styleClassObject);
18563
- let values = keys.map((key) => {
18564
- return styleClassObject[`${key}`];
18565
- });
18566
- values = this.removeUnwantedStyle(values, wordPasteStyleConfig);
18567
- this.filterStyles(elm, wordPasteStyleConfig);
18568
- let resultElem;
18569
- let fromClass = false;
18570
- for (let i = 0; i < keys.length; i++) {
18571
- if (keys[i].split('.')[0] === '') {
18572
- resultElem = elm.getElementsByClassName(keys[i].split('.')[1]);
18573
- fromClass = true;
18574
- }
18575
- else if (keys[i].split('.').length === 1 && keys[i].split('.')[0].indexOf('@') >= 0) {
18576
- continue;
18577
- }
18578
- else if (keys[i].split('.').length === 1 && keys[i].split('.')[0].indexOf('@') < 0) {
18579
- resultElem = elm.getElementsByTagName(keys[i]);
18580
- }
18581
- else {
18582
- resultElem = elm.querySelectorAll(keys[i]);
18583
- }
18584
- for (let j = 0; j < resultElem.length; j++) {
18585
- if (resultElem[j].closest('li') && keys[i] === 'p') {
18910
+ if (!isNullOrUndefined(styleClassObject)) {
18911
+ const keys = Object.keys(styleClassObject);
18912
+ let values = keys.map((key) => {
18913
+ return styleClassObject[`${key}`];
18914
+ });
18915
+ values = this.removeUnwantedStyle(values, wordPasteStyleConfig);
18916
+ this.filterStyles(elm, wordPasteStyleConfig);
18917
+ let resultElem;
18918
+ let fromClass = false;
18919
+ for (let i = 0; i < keys.length; i++) {
18920
+ if (keys[i].split('.')[0] === '') {
18921
+ resultElem = elm.getElementsByClassName(keys[i].split('.')[1]);
18922
+ fromClass = true;
18923
+ }
18924
+ else if (keys[i].split('.').length === 1 && keys[i].split('.')[0].indexOf('@') >= 0) {
18586
18925
  continue;
18587
18926
  }
18588
- const styleProperty = resultElem[j].getAttribute('style');
18589
- if (!isNullOrUndefined(styleProperty) && styleProperty.trim() !== '') {
18590
- const valueSplit = values[i].split(';');
18591
- if (!fromClass) {
18592
- for (let k = 0; k < valueSplit.length; k++) {
18593
- if (styleProperty.indexOf(valueSplit[k].split(':')[0]) >= 0) {
18594
- valueSplit.splice(k, 1);
18595
- k--;
18927
+ else if (keys[i].split('.').length === 1 && keys[i].split('.')[0].indexOf('@') < 0) {
18928
+ resultElem = elm.getElementsByTagName(keys[i]);
18929
+ }
18930
+ else {
18931
+ resultElem = elm.querySelectorAll(keys[i]);
18932
+ }
18933
+ for (let j = 0; j < resultElem.length; j++) {
18934
+ if (resultElem[j].closest('li') && keys[i] === 'p') {
18935
+ continue;
18936
+ }
18937
+ const styleProperty = resultElem[j].getAttribute('style');
18938
+ if (!isNullOrUndefined(styleProperty) && styleProperty.trim() !== '') {
18939
+ const valueSplit = values[i].split(';');
18940
+ if (!fromClass) {
18941
+ for (let k = 0; k < valueSplit.length; k++) {
18942
+ if (styleProperty.indexOf(valueSplit[k].split(':')[0]) >= 0) {
18943
+ valueSplit.splice(k, 1);
18944
+ k--;
18945
+ }
18596
18946
  }
18597
18947
  }
18948
+ const changedValue = styleProperty + valueSplit.join(';') + ';';
18949
+ resultElem[j].setAttribute('style', changedValue);
18950
+ }
18951
+ else {
18952
+ values[i] = values[i].replace(/text-indent:-(.*?)(?=;|$)/gm, '');
18953
+ resultElem[j].setAttribute('style', values[i]);
18598
18954
  }
18599
- const changedValue = styleProperty + valueSplit.join(';') + ';';
18600
- resultElem[j].setAttribute('style', changedValue);
18601
- }
18602
- else {
18603
- values[i] = values[i].replace(/text-indent:-(.*?)(?=;|$)/gm, '');
18604
- resultElem[j].setAttribute('style', values[i]);
18605
18955
  }
18606
- }
18607
- fromClass = false;
18608
- }
18609
- const listClass = ['MsoListParagraphCxSpFirst', 'MsoListParagraphCxSpMiddle', 'MsoListParagraphCxSpLast'];
18610
- for (let i = 0; i < listClass.length; i++) {
18611
- if (keys.indexOf('li.' + listClass[i]) > -1) {
18612
- const olULElems = elm.querySelectorAll('ol.' + listClass[i] + ', ul.' + listClass[i]);
18613
- for (let j = 0; j < olULElems.length; j++) {
18614
- const styleProperty = olULElems[j].getAttribute('style');
18615
- if (!isNullOrUndefined(styleProperty) && styleProperty.trim() !== '' && olULElems[j].style.marginLeft !== '') {
18616
- const valueSplit = values[keys.indexOf('li.' + listClass[i])].split(';');
18617
- for (let k = 0; k < valueSplit.length; k++) {
18618
- if ('margin-left'.indexOf(valueSplit[k].split(':')[0]) >= 0) {
18619
- if (!isNullOrUndefined(valueSplit[k].split(':')[1]) &&
18620
- valueSplit[k].split(':')[1].indexOf('in') >= 0 &&
18621
- olULElems[j].style.marginLeft.indexOf('in') >= 0) {
18622
- const classStyle = parseFloat(valueSplit[k].split(':')[1].split('in')[0]);
18623
- const inlineStyle = parseFloat(olULElems[j].style.marginLeft.split('in')[0]);
18624
- olULElems[j].style.marginLeft = (inlineStyle - classStyle) + 'in';
18956
+ fromClass = false;
18957
+ }
18958
+ const listClass = ['MsoListParagraphCxSpFirst', 'MsoListParagraphCxSpMiddle', 'MsoListParagraphCxSpLast'];
18959
+ for (let i = 0; i < listClass.length; i++) {
18960
+ if (keys.indexOf('li.' + listClass[i]) > -1) {
18961
+ const olULElems = elm.querySelectorAll('ol.' + listClass[i] + ', ul.' + listClass[i]);
18962
+ for (let j = 0; j < olULElems.length; j++) {
18963
+ const styleProperty = olULElems[j].getAttribute('style');
18964
+ if (!isNullOrUndefined(styleProperty) && styleProperty.trim() !== '' && olULElems[j].style.marginLeft !== '') {
18965
+ const valueSplit = values[keys.indexOf('li.' + listClass[i])].split(';');
18966
+ for (let k = 0; k < valueSplit.length; k++) {
18967
+ if ('margin-left'.indexOf(valueSplit[k].split(':')[0]) >= 0) {
18968
+ if (!isNullOrUndefined(valueSplit[k].split(':')[1]) &&
18969
+ valueSplit[k].split(':')[1].indexOf('in') >= 0 &&
18970
+ olULElems[j].style.marginLeft.indexOf('in') >= 0) {
18971
+ const classStyle = parseFloat(valueSplit[k].split(':')[1].split('in')[0]);
18972
+ const inlineStyle = parseFloat(olULElems[j].style.marginLeft.split('in')[0]);
18973
+ olULElems[j].style.marginLeft = (inlineStyle - classStyle) + 'in';
18974
+ }
18625
18975
  }
18626
18976
  }
18627
18977
  }
@@ -19192,7 +19542,7 @@ class ToolbarStatus {
19192
19542
  * get method
19193
19543
  *
19194
19544
  * @param {Document} docElement - specifies the document element
19195
- * @param {Node} targetNode - specifies the target node
19545
+ * @param {Node} rootNode - specifies the content editable element
19196
19546
  * @param {string[]} formatNode - specifies the format node
19197
19547
  * @param {string[]} fontSize - specifies the font size
19198
19548
  * @param {string[]} fontName - specifies the font name.
@@ -19201,7 +19551,7 @@ class ToolbarStatus {
19201
19551
  * @hidden
19202
19552
  * @deprecated
19203
19553
  */
19204
- static get(docElement, targetNode, formatNode, fontSize, fontName, documentNode) {
19554
+ static get(docElement, rootNode, formatNode, fontSize, fontName, documentNode) {
19205
19555
  let formatCollection = JSON.parse(JSON.stringify(statusCollection));
19206
19556
  const nodeCollection = JSON.parse(JSON.stringify(statusCollection));
19207
19557
  const nodeSelection = new NodeSelection();
@@ -19231,7 +19581,7 @@ class ToolbarStatus {
19231
19581
  }
19232
19582
  for (let index = 0; index < nodes.length; index++) {
19233
19583
  // eslint-disable-next-line max-len
19234
- formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], targetNode, formatNode, fontSize, fontName);
19584
+ formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], rootNode, formatNode, fontSize, fontName);
19235
19585
  if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
19236
19586
  nodeCollection.bold = formatCollection.bold;
19237
19587
  }
@@ -19306,16 +19656,24 @@ class ToolbarStatus {
19306
19656
  return node;
19307
19657
  }
19308
19658
  static getFormatParent(docElement, formatCollection, node, targetNode, formatNode, fontSize, fontName) {
19659
+ let isListUpdated = false;
19660
+ let isComplexListUpdated = false;
19309
19661
  if (targetNode.contains(node) ||
19310
19662
  (node.nodeType === 3 && targetNode.nodeType !== 3 && targetNode.contains(node.parentNode))) {
19311
19663
  do {
19312
- formatCollection = this.isFormattedNode(docElement, formatCollection, node, formatNode, fontSize, fontName);
19664
+ formatCollection = this.isFormattedNode(docElement, formatCollection, node, isListUpdated, isComplexListUpdated, formatNode, fontSize, fontName);
19665
+ if (formatCollection.orderedlist || formatCollection.unorderedlist) {
19666
+ isListUpdated = true;
19667
+ }
19668
+ if (formatCollection.bulletFormatList || formatCollection.numberFormatList) {
19669
+ isComplexListUpdated = true;
19670
+ }
19313
19671
  node = node.parentNode;
19314
19672
  } while (node && (node !== targetNode));
19315
19673
  }
19316
19674
  return formatCollection;
19317
19675
  }
19318
- static isFormattedNode(docElement, formatCollection, node, formatNode, fontSize, fontName) {
19676
+ static isFormattedNode(docElement, formatCollection, node, isListUpdated, isComplexListUpdated, formatNode, fontSize, fontName) {
19319
19677
  if (!formatCollection.bold) {
19320
19678
  formatCollection.bold = IsFormatted.isBold(node);
19321
19679
  }
@@ -19346,10 +19704,10 @@ class ToolbarStatus {
19346
19704
  if (!formatCollection.backgroundcolor) {
19347
19705
  formatCollection.backgroundcolor = this.isBackgroundColor(node);
19348
19706
  }
19349
- if (!formatCollection.orderedlist) {
19707
+ if (!formatCollection.orderedlist && !isListUpdated) {
19350
19708
  formatCollection.orderedlist = this.isOrderedList(node);
19351
19709
  }
19352
- if (!formatCollection.unorderedlist) {
19710
+ if (!formatCollection.unorderedlist && !isListUpdated) {
19353
19711
  formatCollection.unorderedlist = this.isUnorderedList(node);
19354
19712
  }
19355
19713
  if (!formatCollection.alignments) {
@@ -19364,10 +19722,10 @@ class ToolbarStatus {
19364
19722
  if (!formatCollection.createlink) {
19365
19723
  formatCollection.createlink = this.isLink(node);
19366
19724
  }
19367
- if (!formatCollection.numberFormatList) {
19725
+ if (!formatCollection.numberFormatList && !isComplexListUpdated) {
19368
19726
  formatCollection.numberFormatList = this.isNumberFormatList(node);
19369
19727
  }
19370
- if (!formatCollection.bulletFormatList) {
19728
+ if (!formatCollection.bulletFormatList && !isComplexListUpdated) {
19371
19729
  formatCollection.bulletFormatList = this.isBulletFormatList(node);
19372
19730
  }
19373
19731
  return formatCollection;
@@ -20454,12 +20812,12 @@ class EditorManager {
20454
20812
  }
20455
20813
  }
20456
20814
  getParentBlockNode(node) {
20457
- let treeWalker = this.currentDocument.createTreeWalker(this.editableElement, // root
20815
+ const treeWalker = this.currentDocument.createTreeWalker(this.editableElement, // root
20458
20816
  NodeFilter.SHOW_ELEMENT, // whatToShow
20459
20817
  {
20460
20818
  acceptNode: function (currentNode) {
20461
20819
  // Check if the node is a block element
20462
- let displayStyle = window.getComputedStyle(currentNode).display;
20820
+ const displayStyle = window.getComputedStyle(currentNode).display;
20463
20821
  if (displayStyle.indexOf('inline') < 0) {
20464
20822
  return NodeFilter.FILTER_ACCEPT;
20465
20823
  }
@@ -20469,11 +20827,11 @@ class EditorManager {
20469
20827
  }
20470
20828
  });
20471
20829
  treeWalker.currentNode = node;
20472
- let blockParent = treeWalker.parentNode();
20830
+ const blockParent = treeWalker.parentNode();
20473
20831
  return blockParent;
20474
20832
  }
20475
20833
  getLastTextNode(node) {
20476
- let treeWalker = this.currentDocument.createTreeWalker(node, NodeFilter.SHOW_TEXT, null);
20834
+ const treeWalker = this.currentDocument.createTreeWalker(node, NodeFilter.SHOW_TEXT, null);
20477
20835
  let lastTextNode = null;
20478
20836
  let currentNode = treeWalker.nextNode();
20479
20837
  while (currentNode) {
@@ -20483,8 +20841,8 @@ class EditorManager {
20483
20841
  return lastTextNode;
20484
20842
  }
20485
20843
  getFirstTextNode(node) {
20486
- let treeWalker = this.currentDocument.createTreeWalker(node, NodeFilter.SHOW_TEXT, null);
20487
- let firstTextNode = treeWalker.nextNode();
20844
+ const treeWalker = this.currentDocument.createTreeWalker(node, NodeFilter.SHOW_TEXT, null);
20845
+ const firstTextNode = treeWalker.nextNode();
20488
20846
  return firstTextNode;
20489
20847
  }
20490
20848
  }
@@ -20720,8 +21078,12 @@ const IFRAMEHEADER = `
20720
21078
  .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; }
20721
21079
  .e-rte-content .e-content img.e-resize, .e-rte-content .e-content video.e-resize { z-index: 1000; }
20722
21080
  .e-img-caption .e-img-inner { outline: 0; }
21081
+ .e-rte-img-caption.e-imgleft .e-img-inner { float: left; text-align: left; }
21082
+ .e-rte-img-caption.e-imgright .e-img-inner { float: right; text-align: right; }
21083
+ .e-rte-img-caption.e-imgleft .e-img-wrap, .e-rte-img-caption.e-imgright .e-img-wrap { display: contents; }
20723
21084
  .e-img-caption a:focus-visible { outline: none; }
20724
- .e-img-caption .e-rte-image.e-imgright, .e-img-caption .e-rte-image.e-imgleft { float: none; margin: 0;}
21085
+ .e-rte-img-caption .e-rte-image.e-imgright { margin-left: auto; margin-right: 0; }
21086
+ .e-rte-img-caption .e-rte-image.e-imgleft { margin: 0; }
20725
21087
  body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;
20726
21088
  overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}
20727
21089
  p{margin: 0 0 10px;margin-bottom: 10px;}
@@ -20769,6 +21131,7 @@ const IFRAMEHEADER = `
20769
21131
  .e-table-rhelper { background-color: #4a90e2;}
20770
21132
  .e-rtl { direction: rtl; }
20771
21133
  .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; }
21134
+ li ol, li ul { margin-block-start: 10px;}
20772
21135
  </style>
20773
21136
  </head>`;
20774
21137
  /**
@@ -20796,6 +21159,7 @@ class IframeContentRender extends ContentRender {
20796
21159
  styles: 'display:block;',
20797
21160
  attrs: { 'srcdoc': iFrameContent }
20798
21161
  });
21162
+ iframe.setAttribute("role", "none");
20799
21163
  this.setPanel(iframe);
20800
21164
  rteObj.element.appendChild(iframe);
20801
21165
  iframe.contentDocument.body.id = this.parent.getID() + '_rte-edit-view';
@@ -21414,9 +21778,9 @@ class HtmlEditor {
21414
21778
  const liElement = this.getRangeLiNode(currentRange.startContainer);
21415
21779
  if (liElement.previousElementSibling && liElement.previousElementSibling.childElementCount > 0) {
21416
21780
  this.oldRangeElement = liElement.previousElementSibling.lastElementChild.nodeName === 'BR' ?
21417
- liElement.previousElementSibling : liElement.previousElementSibling.lastElementChild;
21781
+ liElement.previousElementSibling : liElement.previousElementSibling.lastChild;
21418
21782
  if (!isNullOrUndefined(liElement.lastElementChild) && liElement.lastElementChild.nodeName !== 'BR' &&
21419
- isNullOrUndefined(liElement.lastElementChild.previousSibling)) {
21783
+ isNullOrUndefined(liElement.lastElementChild.previousSibling) && liElement.lastChild.nodeName !== "#text") {
21420
21784
  this.rangeElement = liElement.lastElementChild;
21421
21785
  isLiElement = true;
21422
21786
  }
@@ -21441,7 +21805,7 @@ class HtmlEditor {
21441
21805
  ? this.oldRangeElement.lastElementChild.lastElementChild :
21442
21806
  this.oldRangeElement.lastElementChild;
21443
21807
  }
21444
- let lastNode = this.oldRangeElement.lastChild;
21808
+ let lastNode = this.oldRangeElement.lastChild ? this.oldRangeElement.lastChild : this.oldRangeElement;
21445
21809
  while (lastNode.nodeType !== 3 && lastNode.nodeName !== '#text' &&
21446
21810
  lastNode.nodeName !== 'BR') {
21447
21811
  lastNode = lastNode.lastChild;
@@ -21449,12 +21813,17 @@ class HtmlEditor {
21449
21813
  this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),
21450
21814
  // eslint-disable-next-line
21451
21815
  lastNode, lastNode.textContent.length);
21452
- if (this.oldRangeElement.querySelectorAll('BR').length === 1) {
21816
+ if (this.oldRangeElement.nodeName !== '#text' && this.oldRangeElement.querySelectorAll('BR').length === 1) {
21453
21817
  detach(this.oldRangeElement.querySelector('BR'));
21454
21818
  }
21455
21819
  if (!isNullOrUndefined(this.rangeElement) && this.oldRangeElement !== this.rangeElement) {
21456
21820
  while (this.rangeElement.firstChild) {
21457
- this.oldRangeElement.appendChild(this.rangeElement.childNodes[0]);
21821
+ if (this.oldRangeElement.nodeName === '#text') {
21822
+ this.oldRangeElement.parentElement.appendChild(this.rangeElement.childNodes[0]);
21823
+ }
21824
+ else {
21825
+ this.oldRangeElement.appendChild(this.rangeElement.childNodes[0]);
21826
+ }
21458
21827
  }
21459
21828
  // eslint-disable-next-line
21460
21829
  !isLiElement ? detach(this.rangeElement) : detach(this.rangeElement.parentElement);
@@ -21491,7 +21860,11 @@ class HtmlEditor {
21491
21860
  (!isNullOrUndefined(this.deleteRangeElement.nextElementSibling) && this.deleteRangeElement.nextElementSibling.tagName === 'TABLE'))) {
21492
21861
  return;
21493
21862
  }
21494
- if (this.getCaretIndex(currentRange, this.deleteRangeElement) === this.deleteRangeElement.textContent.length) {
21863
+ let isImgWithEmptyBlockNode = false;
21864
+ if (this.deleteRangeElement.querySelectorAll('img').length > 0 && this.deleteRangeElement.textContent.trim() === '') {
21865
+ isImgWithEmptyBlockNode = true;
21866
+ }
21867
+ if (this.getCaretIndex(currentRange, this.deleteRangeElement) === this.deleteRangeElement.textContent.length && !isImgWithEmptyBlockNode) {
21495
21868
  if (!isNullOrUndefined(liElement)) {
21496
21869
  if (isLiElement || !isNullOrUndefined(liElement.nextElementSibling)) {
21497
21870
  this.deleteOldRangeElement = this.getRangeElement(liElement.nextElementSibling);
@@ -21683,36 +22056,14 @@ class HtmlEditor {
21683
22056
  }, e, value);
21684
22057
  }
21685
22058
  }
21686
- mouseOutHandler() {
21687
- if (!isNullOrUndefined(this.tooltipTargetEle)) {
21688
- this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
21689
- }
21690
- else {
21691
- const currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
21692
- this.parent.contentModule.getDocument();
21693
- this.tooltipTargetEle = currentDocument.querySelector('[data-title]');
21694
- this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
21695
- }
21696
- this.tooltipTargetEle.removeAttribute('data-title');
21697
- EventHandler.remove(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler);
21698
- }
21699
22059
  onToolbarClick(args) {
21700
22060
  let save;
21701
22061
  let selectNodeEle;
21702
22062
  let selectParentEle;
21703
22063
  const item = args.item;
21704
22064
  const closestElement = closest(args.originalEvent.target, '.e-rte-quick-popup');
21705
- const currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
21706
- this.parent.contentModule.getDocument();
21707
- this.tooltipTargetEle = closest(args.originalEvent.target, '[data-tooltip-id]');
21708
- if (!isNullOrUndefined(this.tooltipTargetEle) && this.parent.showTooltip && !isNullOrUndefined(currentDocument.querySelector('.e-tooltip-wrap'))) {
21709
- this.parent.notify(destroyTooltip, { args: event });
21710
- if (!this.tooltipTargetEle.closest('.e-rte-quick-popup')) {
21711
- this.tooltipTargetEle.setAttribute('data-title', this.tooltipTargetEle.getAttribute('title'));
21712
- this.tooltipTargetEle.removeAttribute('title');
21713
- EventHandler.add(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler, this);
21714
- }
21715
- }
22065
+ let target = args.originalEvent.target;
22066
+ this.parent.notify(closeTooltip, { target: target });
21716
22067
  if (item.command !== 'FormatPainter') {
21717
22068
  if (closestElement && !closestElement.classList.contains('e-rte-inline-popup') && !closestElement.classList.contains('e-rte-text-popup')) {
21718
22069
  if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
@@ -22628,6 +22979,9 @@ class PasteCleanup {
22628
22979
  this.setImageProperties(allImg[i]);
22629
22980
  }
22630
22981
  this.addTempClass(clipBoardElem);
22982
+ if (clipBoardElem.querySelectorAll('picture').length > 0) {
22983
+ this.processPictureElement(clipBoardElem);
22984
+ }
22631
22985
  if (clipBoardElem.textContent !== '' || !isNullOrUndefined(clipBoardElem.querySelector('img')) ||
22632
22986
  !isNullOrUndefined(clipBoardElem.querySelector('table'))) {
22633
22987
  const tempWrapperElem = this.parent.createElement('div');
@@ -23085,6 +23439,26 @@ class PasteCleanup {
23085
23439
  }
23086
23440
  return null;
23087
23441
  }
23442
+ processPictureElement(clipBoardElem) {
23443
+ const pictureElems = clipBoardElem.querySelectorAll('picture');
23444
+ for (let i = 0; i < pictureElems.length; i++) {
23445
+ const imgElem = pictureElems[i].querySelector('img');
23446
+ const sourceElems = pictureElems[i].querySelectorAll('source');
23447
+ if (imgElem && imgElem.getAttribute('src')) {
23448
+ const srcValue = imgElem.getAttribute('src');
23449
+ const url = new URL(srcValue);
23450
+ for (let j = 0; j < sourceElems.length; j++) {
23451
+ let srcset = sourceElems[j].getAttribute('srcset');
23452
+ if (srcset) {
23453
+ if (srcset.indexOf('http') === -1) {
23454
+ const fullPath = url.origin + srcset;
23455
+ sourceElems[j].setAttribute('srcset', fullPath);
23456
+ }
23457
+ }
23458
+ }
23459
+ }
23460
+ }
23461
+ }
23088
23462
  /**
23089
23463
  * For internal use only - Get the module name.
23090
23464
  *
@@ -23164,7 +23538,8 @@ class Resize {
23164
23538
  this.parent.element.style.width = (!this.parent.enableRtl) ? eventType.clientX - boundRect.left + 'px' : boundRect.right - eventType.clientX + 'px';
23165
23539
  }
23166
23540
  if (!this.parent.toolbarSettings.enable) {
23167
- this.parent.setContentHeight('', false);
23541
+ const isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
23542
+ this.parent.setContentHeight('Resize', isExpand);
23168
23543
  }
23169
23544
  this.parent.refreshUI();
23170
23545
  }
@@ -23515,7 +23890,7 @@ class FullScreen {
23515
23890
  this.parent.element.classList.add(CLS_FULL_SCREEN);
23516
23891
  this.toggleParentOverflow(true);
23517
23892
  const isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
23518
- this.parent.setContentHeight(null, isExpand);
23893
+ this.parent.setContentHeight('Maximize', isExpand);
23519
23894
  if (this.parent.toolbarModule) {
23520
23895
  if (!this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
23521
23896
  this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
@@ -23566,7 +23941,7 @@ class FullScreen {
23566
23941
  removeClass([elem[i]], ['e-rte-overflow']);
23567
23942
  }
23568
23943
  const isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
23569
- this.parent.setContentHeight(null, isExpand);
23944
+ this.parent.setContentHeight('Minimize', isExpand);
23570
23945
  if (this.parent.toolbarModule) {
23571
23946
  if (!this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
23572
23947
  this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
@@ -23912,10 +24287,10 @@ class EmojiPicker {
23912
24287
  }
23913
24288
  this.popDiv = this.parent.createElement('div', { className: 'e-rte-emojipicker-popup', id: this.parent.getID() + '_emojiPicker' });
23914
24289
  if (!isNullOrUndefined(this.parent.getToolbar()) && !this.parent.inlineMode.enable) {
23915
- this.parent.getToolbar().appendChild(this.popDiv);
24290
+ this.parent.getToolbar().parentElement.appendChild(this.popDiv);
23916
24291
  }
23917
24292
  else if (this.parent.inlineMode.enable) {
23918
- this.parent.inputElement.appendChild(this.popDiv);
24293
+ this.parent.element.appendChild(this.popDiv);
23919
24294
  }
23920
24295
  EventHandler.add(this.popDiv, 'keydown', this.onKeyDown, this);
23921
24296
  EventHandler.add(this.popDiv, 'keyup', this.searchFilter, this);
@@ -25341,7 +25716,6 @@ class Image$1 {
25341
25716
  this.isAllowedTypes = true;
25342
25717
  this.pageX = null;
25343
25718
  this.pageY = null;
25344
- this.mouseX = null;
25345
25719
  this.deletedImg = [];
25346
25720
  this.parent = parent;
25347
25721
  this.rteID = parent.element.id;
@@ -25499,11 +25873,6 @@ class Image$1 {
25499
25873
  }
25500
25874
  const args = { event: e, requestType: 'images' };
25501
25875
  this.parent.trigger(resizeStop, args);
25502
- /* eslint-disable */
25503
- let pageX = this.getPointX(e);
25504
- let pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
25505
- this.parent.element.getBoundingClientRect().top + e.clientY : e.pageY;
25506
- /* eslint-enable */
25507
25876
  this.parent.formatter.editorManager.observer.on(checkUndo, this.undoStack, this);
25508
25877
  this.parent.formatter.saveData();
25509
25878
  }
@@ -25533,17 +25902,15 @@ class Image$1 {
25533
25902
  if (this.quickToolObj) {
25534
25903
  this.quickToolObj.imageQTBar.hidePopup();
25535
25904
  }
25536
- if (target.classList.contains('e-rte-topLeft')) {
25537
- this.resizeBtnStat.topLeft = true;
25538
- }
25539
- if (target.classList.contains('e-rte-topRight')) {
25540
- this.resizeBtnStat.topRight = true;
25541
- }
25542
- if (target.classList.contains('e-rte-botLeft')) {
25543
- this.resizeBtnStat.botLeft = true;
25544
- }
25545
- if (target.classList.contains('e-rte-botRight')) {
25546
- this.resizeBtnStat.botRight = true;
25905
+ const handlers = ['topLeft', 'topRight', 'botLeft', 'botRight'];
25906
+ for (let i = 0; i < handlers.length; i++) {
25907
+ const handler = handlers[i];
25908
+ if (target.classList.contains('e-rte-' + handler)) {
25909
+ this.resizeBtnStat[handler] = true;
25910
+ this.currentResizeHandler = handler;
25911
+ this.aspectRatio = this.findAspectRatio(this.imgEle);
25912
+ break; // Exit the loop once a match is found
25913
+ }
25547
25914
  }
25548
25915
  if (Browser.isDevice && this.contentModule.getEditPanel().contains(this.imgResizeDiv) &&
25549
25916
  !this.imgResizeDiv.classList.contains('e-mob-span')) {
@@ -25674,89 +26041,80 @@ class Image$1 {
25674
26041
  };
25675
26042
  }
25676
26043
  }
25677
- setAspectRatio(img, expectedX, expectedY, e) {
26044
+ setAspectRatio(img, expectedX, expectedY) {
25678
26045
  if (isNullOrUndefined(img.width)) {
25679
26046
  return;
25680
26047
  }
25681
- // eslint-disable-next-line security/detect-unsafe-regex
25682
- const width = img.style.width !== '' ? img.style.width.match(/^\d+(\.\d*)?%$/g) ? parseFloat(img.style.width) :
25683
- parseInt(img.style.width, 10) : img.width;
25684
- const height = img.style.height !== '' ? parseInt(img.style.height, 10) : img.height;
25685
- if (width > height) {
25686
- img.style.minWidth = this.parent.insertImageSettings.minWidth === 0 ? '20px' : formatUnit(this.parent.insertImageSettings.minWidth);
25687
- if (this.parent.insertImageSettings.resizeByPercent) {
25688
- if (parseInt('' + img.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
25689
- const original = img.offsetWidth + this.mouseX;
25690
- const finalWidthByPerc = (original / img.offsetWidth) * (parseFloat(img.style.width).toString() === 'NaN' ? (img.offsetWidth / (parseFloat(getComputedStyle(this.parent.element).width)) * 100) : parseFloat(img.style.width));
25691
- img.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
26048
+ const width = img.width;
26049
+ const height = img.height;
26050
+ const sameHeightWidth = (width === height);
26051
+ const factor = this.parent.insertImageSettings.resizeByPercent ? '%' : 'px';
26052
+ const emptyStyleDimension = (img.style.width === '' && img.style.height === '');
26053
+ if (!sameHeightWidth && !emptyStyleDimension) {
26054
+ if (img.style.width !== '' && img.style.height !== '') {
26055
+ if (this.parent.insertImageSettings.resizeByPercent) {
26056
+ this.setImageWidth(img, expectedX, factor);
26057
+ this.removeImageHeight(img);
25692
26058
  }
25693
26059
  else {
25694
- img.style.width = this.pixToPerc((width / height * expectedY), (img.previousElementSibling || img.parentElement)) + '%';
26060
+ this.setImageWidth(img, expectedX, factor);
26061
+ this.setImageHeight(img, expectedY, factor);
25695
26062
  }
25696
- img.style.height = null;
25697
- img.removeAttribute('height');
25698
- }
25699
- else if (img.style.width === '' && img.style.height !== '') {
25700
- img.style.height = expectedY + 'px';
25701
- }
25702
- else if (img.style.width !== '' && img.style.height === '') {
25703
- const currentWidth = ((width / height * expectedY) + width / height) <
25704
- (this.parent.inputElement.getBoundingClientRect().right - 32) ?
25705
- ((width / height * expectedY) + width / height) : (this.parent.inputElement.getBoundingClientRect().right - 32);
25706
- img.style.width = currentWidth.toString() + 'px';
25707
- img.style.height = expectedY + 'px';
25708
26063
  }
25709
26064
  else if (img.style.width !== '') {
25710
- const currentWidth = (width / height * expectedY) < (this.parent.inputElement.getBoundingClientRect().right - 32) ?
25711
- (width / height * expectedY) : (this.parent.inputElement.getBoundingClientRect().right - 32);
25712
- img.style.width = currentWidth + 'px';
25713
- img.style.height = expectedY + 'px';
25714
- }
25715
- else {
25716
- if (this.parent.iframeSettings.enable) {
25717
- img.setAttribute('width', (img.width + this.mouseX).toString());
26065
+ if (this.parent.insertImageSettings.resizeByPercent) {
26066
+ this.setImageWidth(img, expectedX, factor);
26067
+ this.removeImageHeight(img);
25718
26068
  }
25719
26069
  else {
25720
- const currentWidth = img.offsetWidth === 0 ? img.width + this.mouseX + parseInt(img.style.outlineWidth.split('p')[0], 10) : img.offsetWidth + this.mouseX;
25721
- img.setAttribute('width', (currentWidth).toString());
26070
+ this.setImageWidth(img, expectedX, factor);
25722
26071
  }
25723
26072
  }
25724
- }
25725
- else if (height > width) {
25726
- if (this.parent.insertImageSettings.resizeByPercent) {
25727
- if (parseInt('' + img.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
25728
- const original = img.offsetWidth + this.mouseX;
25729
- const finalWidthByPerc = (original / img.offsetWidth) * (parseFloat(img.style.width).toString() === 'NaN' ?
25730
- (img.offsetWidth / (parseFloat(getComputedStyle(this.parent.element).width)) * 100) :
25731
- parseFloat(img.style.width));
25732
- img.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
26073
+ else if (img.style.height !== '') {
26074
+ if (this.parent.insertImageSettings.resizeByPercent) {
26075
+ this.setImageWidth(img, expectedX, factor);
26076
+ this.removeImageHeight(img);
25733
26077
  }
25734
26078
  else {
25735
- img.style.width = this.pixToPerc((expectedX / height * expectedY), (img.previousElementSibling || img.parentElement)) + '%';
26079
+ this.setImageHeight(img, expectedY, factor);
25736
26080
  }
25737
- img.style.height = null;
25738
- img.removeAttribute('height');
25739
- }
25740
- else if (img.style.width !== '') {
25741
- img.style.width = expectedX + 'px';
25742
- img.style.height = (height / width * expectedX) + 'px';
25743
- }
25744
- else {
25745
- img.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - img.getBoundingClientRect().left).toString() : expectedX.toString());
25746
26081
  }
25747
26082
  }
25748
26083
  else {
26084
+ this.setImageWidth(img, expectedX, factor);
25749
26085
  if (this.parent.insertImageSettings.resizeByPercent) {
25750
- img.style.width = this.pixToPerc(expectedX, (img.previousElementSibling || img.parentElement)) + '%';
25751
- img.style.height = null;
25752
- img.removeAttribute('height');
26086
+ this.removeImageHeight(img);
25753
26087
  }
25754
26088
  else {
25755
- img.style.width = ((expectedX >= 15) ? expectedX : 15) + 'px';
25756
- img.style.height = ((expectedX >= 15) ? expectedX : 15) + 'px';
26089
+ this.setImageHeight(img, expectedY, factor);
25757
26090
  }
25758
26091
  }
25759
26092
  }
26093
+ setImageWidth(img, value, suffix) {
26094
+ img.style.width = this.getImageDimension(value, img) + suffix;
26095
+ if (!this.parent.insertImageSettings.resizeByPercent) {
26096
+ img.setAttribute('width', value.toString());
26097
+ }
26098
+ }
26099
+ setImageHeight(img, value, suffix) {
26100
+ img.style.height = this.getImageDimension(value, img) + suffix;
26101
+ if (!this.parent.insertImageSettings.resizeByPercent) {
26102
+ img.setAttribute('height', value.toString());
26103
+ }
26104
+ }
26105
+ removeImageHeight(img) {
26106
+ img.style.height = '';
26107
+ img.removeAttribute('height');
26108
+ }
26109
+ getImageDimension(value, img) {
26110
+ if (this.parent.insertImageSettings.resizeByPercent) {
26111
+ const rootElem = img.parentElement || img.previousElementSibling;
26112
+ return this.pixToPerc(value, rootElem);
26113
+ }
26114
+ else {
26115
+ return value;
26116
+ }
26117
+ }
25760
26118
  pixToPerc(expected, parentEle) {
25761
26119
  return expected / parseFloat(getComputedStyle(parentEle).width) * 100;
25762
26120
  }
@@ -25778,7 +26136,7 @@ class Image$1 {
25778
26136
  return;
25779
26137
  }
25780
26138
  this.imgEle.parentElement.style.cursor = 'pointer';
25781
- this.setAspectRatio(this.imgEle, parseInt(width, 10), parseInt(height, 10), args);
26139
+ this.setAspectRatio(this.imgEle, parseInt(width, 10), parseInt(height, 10));
25782
26140
  this.resizeImgDupPos(this.imgEle);
25783
26141
  this.imgResizePos(this.imgEle, this.imgResizeDiv);
25784
26142
  }
@@ -25789,35 +26147,37 @@ class Image$1 {
25789
26147
  this.cancelResizeAction();
25790
26148
  return;
25791
26149
  }
25792
- if (this.imgEle.offsetWidth >= this.parent.getInsertImgMaxWidth()) {
25793
- this.imgEle.style.maxHeight = this.imgEle.offsetHeight + 'px';
25794
- }
25795
- else if (isNullOrUndefined(this.parent.insertImageSettings.maxHeight)) {
25796
- this.imgEle.style.maxHeight = '';
25797
- }
25798
- this.imgEle.style.maxWidth = (closest(this.imgEle, 'ol,ul') != null ? this.parent.getInsertImgMaxWidth() - parseInt((getComputedStyle(closest(this.imgEle, 'ol,ul')).paddingLeft), 0) : this.parent.getInsertImgMaxWidth()) + 'px';
25799
- const pageX = this.getPointX(e);
25800
- const pageY = this.getPointY(e);
25801
- const mouseX = (this.resizeBtnStat.botLeft || this.resizeBtnStat.topLeft) ? -(pageX - this.pageX) : (pageX - this.pageX);
25802
- const mouseY = (this.resizeBtnStat.botLeft || this.resizeBtnStat.topLeft) ? -(pageY - this.pageY) : (pageY - this.pageY);
25803
- const width = parseInt(this.imgDupPos.width, 10) + mouseX;
25804
- const height = parseInt(this.imgDupPos.height, 10) + mouseY;
25805
- this.mouseX = mouseX;
25806
- this.pageX = pageX;
25807
- this.pageY = pageY;
25808
- if (this.resizeBtnStat.botRight) {
25809
- this.imgDupMouseMove(width + 'px', height + 'px', e);
25810
- }
25811
- else if (this.resizeBtnStat.botLeft) {
25812
- this.imgDupMouseMove(width + 'px', height + 'px', e);
25813
- }
25814
- else if (this.resizeBtnStat.topRight) {
25815
- this.imgDupMouseMove(width + 'px', height + 'px', e);
25816
- }
25817
- else if (this.resizeBtnStat.topLeft) {
26150
+ if (this.resizeBtnStat.botRight || this.resizeBtnStat.botLeft || this.resizeBtnStat.topRight || this.resizeBtnStat.topLeft) {
26151
+ const pageX = this.getPointX(e);
26152
+ const pageY = this.getPointY(e);
26153
+ const resizeFactor = this.getResizeFactor(this.currentResizeHandler);
26154
+ const diffX = (pageX - this.pageX);
26155
+ const diffY = (pageY - this.pageY);
26156
+ const currentWidth = this.imgEle.clientWidth;
26157
+ const currentHeight = this.imgEle.clientHeight;
26158
+ let width = diffX * resizeFactor[0] + currentWidth;
26159
+ let height = diffY * resizeFactor[1] + currentHeight;
26160
+ width = (width < 16) ? 16 : width;
26161
+ height = (height < 16) ? 16 : height;
26162
+ if (Math.abs(diffX) > Math.abs(diffY)) {
26163
+ height = Math.round(width / this.aspectRatio);
26164
+ width = Math.round(height * this.aspectRatio);
26165
+ }
26166
+ else {
26167
+ width = Math.round(height * this.aspectRatio);
26168
+ height = Math.round(width / this.aspectRatio);
26169
+ }
26170
+ this.pageX = pageX;
26171
+ this.pageY = pageY;
25818
26172
  this.imgDupMouseMove(width + 'px', height + 'px', e);
25819
26173
  }
25820
26174
  }
26175
+ getResizeFactor(value) {
26176
+ return imageResizeFactor[value];
26177
+ }
26178
+ findAspectRatio(image) {
26179
+ return image.clientWidth / image.clientHeight;
26180
+ }
25821
26181
  cancelResizeAction() {
25822
26182
  EventHandler.remove(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing);
25823
26183
  EventHandler.remove(this.contentModule.getDocument(), Browser.touchEndEvent, this.resizeEnd);
@@ -25827,6 +26187,8 @@ class Image$1 {
25827
26187
  this.imgResizeDiv = null;
25828
26188
  this.pageX = null;
25829
26189
  this.pageY = null;
26190
+ this.currentResizeHandler = null;
26191
+ this.aspectRatio = null;
25830
26192
  }
25831
26193
  }
25832
26194
  resizeImgDupPos(e) {
@@ -25837,6 +26199,8 @@ class Image$1 {
25837
26199
  };
25838
26200
  }
25839
26201
  resizeBtnInit() {
26202
+ this.aspectRatio = null;
26203
+ this.currentResizeHandler = null;
25840
26204
  return this.resizeBtnStat = { botLeft: false, botRight: false, topRight: false, topLeft: false };
25841
26205
  }
25842
26206
  onToolbarAction(args) {
@@ -26336,7 +26700,7 @@ class Image$1 {
26336
26700
  this.checkBoxObj.createElement = this.parent.createElement;
26337
26701
  this.checkBoxObj.appendTo(linkTarget);
26338
26702
  let target = this.checkBoxObj.checked ? '_blank' : null;
26339
- let imageLabel = this.checkBoxObj.checked ? this.i10n.getConstant('imageLinkAriaLabel') : null;
26703
+ const imageLabel = this.checkBoxObj.checked ? this.i10n.getConstant('imageLinkAriaLabel') : null;
26340
26704
  const linkUpdate = this.i10n.getConstant('dialogUpdate');
26341
26705
  const linkargs = {
26342
26706
  args: e.args,
@@ -26344,7 +26708,6 @@ class Image$1 {
26344
26708
  selectNode: e.selectNode, selectParent: e.selectParent, link: inputLink, target: target, ariaLabel: imageLabel
26345
26709
  };
26346
26710
  this.dialogObj.setProperties({
26347
- height: 'inherit',
26348
26711
  width: '290px',
26349
26712
  header: this.parent.localeObj.getConstant('imageInsertLinkHeader'),
26350
26713
  content: linkWrap,
@@ -26396,7 +26759,7 @@ class Image$1 {
26396
26759
  alt: inputAlt
26397
26760
  };
26398
26761
  this.dialogObj.setProperties({
26399
- height: 'inherit', width: '290px', header: altHeader, content: altWrap,
26762
+ width: '290px', header: altHeader, content: altWrap,
26400
26763
  buttons: [{
26401
26764
  // eslint-disable-next-line
26402
26765
  click: (e) => {
@@ -26644,7 +27007,7 @@ class Image$1 {
26644
27007
  const dialogContent = this.imgsizeInput(e);
26645
27008
  const selectObj = { args: e.args, selfImage: this, selection: e.selection, selectNode: e.selectNode };
26646
27009
  this.dialogObj.setProperties({
26647
- height: (Browser.isDevice) ? '300px' : 'inherit', width: '290px', header: imgSizeHeader, content: dialogContent,
27010
+ width: '290px', header: imgSizeHeader, content: dialogContent,
26648
27011
  buttons: [{
26649
27012
  // eslint-disable-next-line
26650
27013
  click: (e) => {
@@ -26844,7 +27207,6 @@ class Image$1 {
26844
27207
  for (let i = 0; i < items.length; i++) {
26845
27208
  removeClass([items[i]], 'e-img-focus');
26846
27209
  removeClass([items[i]], 'e-resize');
26847
- items[i].style.maxWidth = '';
26848
27210
  }
26849
27211
  }
26850
27212
  }
@@ -26858,7 +27220,6 @@ class Image$1 {
26858
27220
  this.cancelResizeAction();
26859
27221
  }
26860
27222
  }
26861
- // eslint-disable-next-line
26862
27223
  imageUrlPopup(e) {
26863
27224
  const imgUrl = this.parent.createElement('div', { className: 'imgUrl' + this.parent.getCssClass(true) });
26864
27225
  const placeUrl = this.i10n.getConstant('imageUrl');
@@ -26937,12 +27298,18 @@ class Image$1 {
26937
27298
  const imgHeight = this.i10n.getConstant('imageHeight');
26938
27299
  const imgWidth = this.i10n.getConstant('imageWidth');
26939
27300
  const imgSizeWrap = this.parent.createElement('div', { className: 'e-img-sizewrap' + this.parent.getCssClass(true) });
26940
- const widthVal = isNullOrUndefined(this.changedWidthValue) && (selectNode.style.width.toString() === 'auto' ||
27301
+ let widthVal = isNullOrUndefined(this.changedWidthValue) && (selectNode.style.width.toString() === 'auto' ||
26941
27302
  selectNode.style.width !== '') ? selectNode.style.width : !isNullOrUndefined(this.changedWidthValue) ?
26942
27303
  this.changedWidthValue : (parseInt(selectNode.getClientRects()[0].width.toString(), 10)).toString();
26943
- const heightVal = isNullOrUndefined(this.changedHeightValue) && (selectNode.style.height.toString() === 'auto' ||
27304
+ let heightVal = isNullOrUndefined(this.changedHeightValue) && (selectNode.style.height.toString() === 'auto' ||
26944
27305
  selectNode.style.height !== '') ? selectNode.style.height : !isNullOrUndefined(this.changedHeightValue) ?
26945
27306
  this.changedHeightValue : (parseInt(selectNode.getClientRects()[0].height.toString(), 10)).toString();
27307
+ if (selectNode.style.width === '') {
27308
+ widthVal = 'auto';
27309
+ }
27310
+ if (selectNode.style.height === '') {
27311
+ heightVal = 'auto';
27312
+ }
26946
27313
  this.changedWidthValue = null;
26947
27314
  this.changedHeightValue = null;
26948
27315
  const content = '<div class="e-rte-label' + this.parent.getCssClass(true) + '"><label>' + imgWidth +
@@ -27076,7 +27443,7 @@ class Image$1 {
27076
27443
  this.parent.trigger(imageSelected, selectArgs, (selectArgs) => {
27077
27444
  if (!selectArgs.cancel) {
27078
27445
  this.checkExtension(selectArgs.filesData[0]);
27079
- altText = selectArgs.filesData[0].name;
27446
+ altText = selectArgs.filesData[0].name.replace(/\.[a-zA-Z0-9]+$/, '');
27080
27447
  if (this.parent.editorMode === 'HTML' && isNullOrUndefined(this.parent.insertImageSettings.path)) {
27081
27448
  const reader = new FileReader();
27082
27449
  // eslint-disable-next-line
@@ -28636,7 +29003,7 @@ class Video {
28636
29003
  const dialogContent = this.vidsizeInput(e);
28637
29004
  const selectObj = { args: e.args, selfVideo: this, selection: e.selection, selectNode: e.selectNode };
28638
29005
  this.dialogObj.setProperties({
28639
- height: 'inherit', width: '290px', header: vidSizeHeader, content: dialogContent,
29006
+ width: '290px', header: vidSizeHeader, content: dialogContent,
28640
29007
  buttons: [{
28641
29008
  // eslint-disable-next-line
28642
29009
  click: (e) => {
@@ -29005,7 +29372,6 @@ class Video {
29005
29372
  this.setAspectRatio(this.videoEle, parseInt(width, 10), parseInt(height, 10), args);
29006
29373
  this.resizeVidDupPos(this.videoEle);
29007
29374
  this.vidResizePos(this.videoEle, this.vidResizeDiv);
29008
- this.parent.setContentHeight('', false);
29009
29375
  }
29010
29376
  });
29011
29377
  }
@@ -29814,8 +30180,12 @@ class Video {
29814
30180
  this.parent.trigger(fileRemoving, e, (e) => {
29815
30181
  proxy.isVideoUploaded = false;
29816
30182
  this.dialogObj.getButtons(0).element.disabled = true;
29817
- //proxy.inputUrl.removeAttribute('disabled');
29818
- proxy.embedInputUrl.removeAttribute('disabled');
30183
+ if (proxy.inputUrl.getAttribute('disabled')) {
30184
+ proxy.inputUrl.removeAttribute('disabled');
30185
+ }
30186
+ if (proxy.embedInputUrl.getAttribute('disabled')) {
30187
+ proxy.embedInputUrl.removeAttribute('disabled');
30188
+ }
29819
30189
  if (proxy.uploadUrl) {
29820
30190
  proxy.uploadUrl.url = '';
29821
30191
  }
@@ -30049,7 +30419,6 @@ class ViewSource {
30049
30419
  rteContent.appendChild(this.previewElement);
30050
30420
  this.parent.element.appendChild(rteContent);
30051
30421
  rteContent.style.height = this.contentModule.getPanel().style.height;
30052
- rteContent.style.marginTop = this.contentModule.getPanel().style.marginTop;
30053
30422
  this.getPanel().value = this.getTextAreaValue();
30054
30423
  this.contentModule.getPanel().style.display = 'none';
30055
30424
  rteContent.style.display = 'block';
@@ -30070,14 +30439,17 @@ class ViewSource {
30070
30439
  removeClass([this.parent.getToolbar()], [CLS_EXPAND_OPEN]);
30071
30440
  }
30072
30441
  removeClass(tbItems, [CLS_ACTIVE]);
30073
- this.parent.setContentHeight('sourceCode', true);
30442
+ const isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
30443
+ this.parent.setContentHeight('SourceCode', isExpand);
30074
30444
  this.wireEvent(this.previewElement);
30075
30445
  this.unWireBaseKeyDown();
30076
30446
  this.previewElement.focus();
30077
30447
  this.parent.updateValue();
30078
30448
  if (!isNullOrUndefined(this.parent.placeholder) && !this.parent.iframeSettings.enable) {
30079
30449
  const placeHolderWrapper = this.parent.element.querySelector('.rte-placeholder.e-rte-placeholder');
30080
- placeHolderWrapper.style.display = 'none';
30450
+ if (placeHolderWrapper) {
30451
+ placeHolderWrapper.style.display = 'none';
30452
+ }
30081
30453
  }
30082
30454
  this.parent.trigger(actionComplete, { requestType: 'SourceCode', targetItem: 'SourceCode', args: args });
30083
30455
  this.parent.invokeChangeEvent();
@@ -30133,7 +30505,8 @@ class ViewSource {
30133
30505
  if (this.parent.getToolbar()) {
30134
30506
  removeClass([this.parent.getToolbar()], [CLS_EXPAND_OPEN]);
30135
30507
  }
30136
- this.parent.setContentHeight('preview', true);
30508
+ const isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
30509
+ this.parent.setContentHeight('Preview', isExpand);
30137
30510
  this.unWireEvent();
30138
30511
  this.wireBaseKeyDown();
30139
30512
  this.contentModule.getEditPanel().focus();
@@ -30207,6 +30580,7 @@ class Table {
30207
30580
  this.pageY = null;
30208
30581
  this.moveEle = null;
30209
30582
  this.currentColumnResize = '';
30583
+ this.resizeEndTime = 0;
30210
30584
  this.parent = parent;
30211
30585
  this.rteID = parent.element.id;
30212
30586
  this.l10n = serviceLocator.getService('rteLocale');
@@ -30364,7 +30738,15 @@ class Table {
30364
30738
  keyUp(e) {
30365
30739
  const target = e.args.target;
30366
30740
  if (e.args.key.toLocaleLowerCase() === 'escape' && target && target.classList && (this.popupObj && !closest(target, '[id=' + "'" + this.popupObj.element.id + "'" + ']')) && this.popupObj) {
30741
+ let createTableToolbarBtn = this.popupObj.relateTo;
30742
+ if (createTableToolbarBtn.nodeName !== 'BUTTON') {
30743
+ createTableToolbarBtn = createTableToolbarBtn.querySelector('span.e-create-table');
30744
+ createTableToolbarBtn = createTableToolbarBtn.parentElement;
30745
+ }
30367
30746
  this.popupObj.hide();
30747
+ if (createTableToolbarBtn) {
30748
+ createTableToolbarBtn.focus();
30749
+ }
30368
30750
  }
30369
30751
  }
30370
30752
  keyDown(e) {
@@ -30544,7 +30926,20 @@ class Table {
30544
30926
  return false;
30545
30927
  }
30546
30928
  }
30929
+ removeEmptyTextNodes(element) {
30930
+ const children = element.childNodes;
30931
+ for (let i = children.length - 1; i >= 0; i--) {
30932
+ const node = children[i];
30933
+ if (node.nodeType === Node.TEXT_NODE && node.nodeValue.trim() === '') {
30934
+ element.removeChild(node);
30935
+ }
30936
+ }
30937
+ }
30547
30938
  tabSelection(event, selection, ele) {
30939
+ let allHeadBodyTRElements = ele.closest('table').querySelectorAll('thead, tbody, tr');
30940
+ for (let i = 0; i < allHeadBodyTRElements.length; i++) {
30941
+ this.removeEmptyTextNodes(allHeadBodyTRElements[i]);
30942
+ }
30548
30943
  this.previousTableElement = ele;
30549
30944
  const insideList = this.insideList(selection.range);
30550
30945
  if ((event.keyCode === 37 || event.keyCode === 39) && selection.range.startContainer.nodeType === 3 ||
@@ -30681,10 +31076,12 @@ class Table {
30681
31076
  const startNode = this.parent.getRange().startContainer.parentElement;
30682
31077
  const endNode = this.parent.getRange().endContainer.parentElement;
30683
31078
  const isAnchorEle = this.getAnchorNode(target);
31079
+ const currentTime = new Date().getTime();
30684
31080
  if (target && target.nodeName !== 'A' && isAnchorEle.nodeName !== 'A' && target.nodeName !== 'IMG' && target.nodeName !== 'VIDEO' && !target.classList.contains(CLS_CLICKELEM) &&
30685
31081
  target.nodeName !== 'AUDIO' && startNode === endNode && (target.nodeName === 'TD' || target.nodeName === 'TH' ||
30686
31082
  target.nodeName === 'TABLE' || (closestTable && this.parent.contentModule.getEditPanel().contains(closestTable)))
30687
- && !(range.startContainer.nodeType === 3 && !range.collapsed)) {
31083
+ && !(range.startContainer.nodeType === 3 && !range.collapsed) &&
31084
+ currentTime - this.resizeEndTime > 100) {
30688
31085
  const range = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
30689
31086
  this.parent.formatter.editorManager.nodeSelection.save(range, this.contentModule.getDocument());
30690
31087
  this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
@@ -30780,7 +31177,10 @@ class Table {
30780
31177
  const tdNode = closest(target, 'td,th');
30781
31178
  target = (target.nodeName !== 'TD' && tdNode && this.parent.contentModule.getEditPanel().contains(tdNode)) ?
30782
31179
  tdNode : target;
30783
- removeClass(this.contentModule.getEditPanel().querySelectorAll('table td, table th'), CLS_TABLE_SEL);
31180
+ if (!(this.parent.quickToolbarSettings.showOnRightClick && e.args.which === 3 &&
31181
+ target.classList.contains(CLS_TABLE_SEL))) {
31182
+ removeClass(this.contentModule.getEditPanel().querySelectorAll('table td, table th'), CLS_TABLE_SEL);
31183
+ }
30784
31184
  if (target && (target.tagName === 'TD' || target.tagName === 'TH')) {
30785
31185
  addClass([target], CLS_TABLE_SEL);
30786
31186
  this.activeCell = target;
@@ -31167,6 +31567,9 @@ class Table {
31167
31567
  widthCompare = rteWidth;
31168
31568
  }
31169
31569
  if (this.resizeBtnStat.column) {
31570
+ if (this.curTable.closest('li')) {
31571
+ widthCompare = this.curTable.closest('li').offsetWidth;
31572
+ }
31170
31573
  const colGroup = this.curTable.querySelectorAll('colgroup > col');
31171
31574
  let currentTableWidth;
31172
31575
  if (this.curTable.style.width !== '' && this.curTable.style.width.includes('%')) {
@@ -31192,6 +31595,15 @@ class Table {
31192
31595
  (this.convertPixelToPercentage(tableWidth - mouseX, widthCompare) + '%');
31193
31596
  const differenceWidth = currentTableWidth - this.convertPixelToPercentage(tableWidth - mouseX, widthCompare);
31194
31597
  let preMarginLeft = 0;
31598
+ const widthType = this.curTable.style.width.indexOf('%') > -1;
31599
+ if (!widthType && this.curTable.offsetWidth > this.contentModule.getEditPanel().offsetWidth) {
31600
+ this.curTable.style.width = rteWidth + 'px';
31601
+ return;
31602
+ }
31603
+ if (widthType && parseFloat(this.curTable.style.width.split('%')[0]) > 100) {
31604
+ this.curTable.style.width = '100%';
31605
+ return;
31606
+ }
31195
31607
  if (!isNullOrUndefined(this.curTable.style.marginLeft) && this.curTable.style.marginLeft !== '') {
31196
31608
  const regex = /[-+]?\d*\.\d+|\d+/;
31197
31609
  const value = this.curTable.style.marginLeft.match(regex);
@@ -31199,7 +31611,16 @@ class Table {
31199
31611
  preMarginLeft = parseFloat(value[0]);
31200
31612
  }
31201
31613
  }
31202
- const currentMarginLeft = preMarginLeft + differenceWidth;
31614
+ let currentMarginLeft = preMarginLeft + differenceWidth;
31615
+ if (currentMarginLeft && currentMarginLeft > 100) {
31616
+ const width = parseFloat(this.curTable.style.width);
31617
+ currentMarginLeft = 100 - width;
31618
+ }
31619
+ if (currentMarginLeft && currentMarginLeft < 1) {
31620
+ this.curTable.style.marginLeft = null;
31621
+ this.curTable.style.width = '100%';
31622
+ return;
31623
+ }
31203
31624
  this.curTable.style.marginLeft = 'calc(' + (this.curTable.style.width === '100%' ? 0 : currentMarginLeft) + '%)';
31204
31625
  for (let i = 0; i < firstColumnsCell.length; i++) {
31205
31626
  const currentColumnCellWidth = this.getCurrentColWidth(firstColumnsCell[i], tableWidth);
@@ -31270,15 +31691,26 @@ class Table {
31270
31691
  maxiumWidth = Math.abs(tableBoxPosition - currentTdElement.getBoundingClientRect().width) - 5;
31271
31692
  this.curTable.style.maxWidth = maxiumWidth + 'px';
31272
31693
  }
31273
- const widthType = this.curTable.style.width.indexOf('%') > -1;
31274
- this.curTable.style.width = widthType ? this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) + '%'
31275
- : tableWidth + mouseX + 'px';
31276
31694
  this.curTable.style.height = tableHeight + mouseY + 'px';
31277
31695
  if (!isNullOrUndefined(tableReBox)) {
31278
31696
  tableReBox.classList.add('e-rbox-select');
31279
31697
  tableReBox.style.cssText = 'top: ' + (this.calcPos(this.curTable).top + tableHeight - 4) +
31280
31698
  'px; left:' + (this.calcPos(this.curTable).left + tableWidth - 4) + 'px;';
31281
31699
  }
31700
+ if (this.curTable.closest('li')) {
31701
+ widthCompare = this.curTable.closest('li').offsetWidth;
31702
+ }
31703
+ const widthType = this.curTable.style.width.indexOf('%') > -1;
31704
+ if (widthType && parseFloat(this.curTable.style.width.split('%')[0]) > 100) {
31705
+ this.curTable.style.width = '100%';
31706
+ return;
31707
+ }
31708
+ if (!widthType && this.curTable.offsetWidth > this.contentModule.getEditPanel().offsetWidth) {
31709
+ this.curTable.style.width = rteWidth + 'px';
31710
+ return;
31711
+ }
31712
+ this.curTable.style.width = widthType ? this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) + '%'
31713
+ : tableWidth + mouseX + 'px';
31282
31714
  }
31283
31715
  }
31284
31716
  });
@@ -31352,6 +31784,7 @@ class Table {
31352
31784
  const args = { event: e, requestType: 'table' };
31353
31785
  this.parent.trigger(resizeStop, args);
31354
31786
  this.parent.formatter.saveData();
31787
+ this.resizeEndTime = new Date().getTime();
31355
31788
  }
31356
31789
  resetResizeHelper(curTable) {
31357
31790
  const colHelper = this.parent.element.querySelectorAll('.e-table-rhelper.e-column-helper');
@@ -31366,6 +31799,9 @@ class Table {
31366
31799
  element.parentNode.removeChild(element);
31367
31800
  }
31368
31801
  });
31802
+ if (!curTable.style.width) {
31803
+ curTable.style.width = curTable.offsetWidth + 'px';
31804
+ }
31369
31805
  const colGroup = curTable.querySelector('colgroup');
31370
31806
  if (colGroup) {
31371
31807
  for (let i = 0; i < curTable.rows.length; i++) {
@@ -31461,7 +31897,7 @@ class Table {
31461
31897
  this.createTableButton.isStringTemplate = true;
31462
31898
  this.createTableButton.appendTo(btnEle);
31463
31899
  EventHandler.add(btnEle, 'click', this.insertTableDialog, { self: this, args: args.args, selection: args.selection });
31464
- this.parent.getToolbar().appendChild(this.dlgDiv);
31900
+ this.parent.getToolbar().parentElement.appendChild(this.dlgDiv);
31465
31901
  let target = args.args.originalEvent.target;
31466
31902
  target = target.classList.contains('e-toolbar-item') ? target.firstChild : target.parentElement;
31467
31903
  this.popupObj = new Popup(this.dlgDiv, {
@@ -32433,7 +32869,7 @@ __decorate$2([
32433
32869
  Property(null)
32434
32870
  ], PasteCleanupSettings.prototype, "deniedAttrs", void 0);
32435
32871
  __decorate$2([
32436
- Property(['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'list-style-type', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width'])
32872
+ Property(['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'list-style-type', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-transform', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width'])
32437
32873
  ], PasteCleanupSettings.prototype, "allowedStyleProps", void 0);
32438
32874
  __decorate$2([
32439
32875
  Property(null)
@@ -32642,7 +33078,8 @@ class EnterKeyAction {
32642
33078
  isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
32643
33079
  }
32644
33080
  if (e.args.which === 13 && !e.args.ctrlKey && (!Browser.isDevice ? e.args.code === 'Enter' : e.args.key === 'Enter')) {
32645
- if (isNullOrUndefined(this.startNode.closest('LI, UL, OL')) && isNullOrUndefined(this.endNode.closest('LI, UL, OL')) && isTableEnter &&
33081
+ if (isNullOrUndefined(this.startNode.closest('LI, UL, OL')) && isNullOrUndefined(this.endNode.closest('LI, UL, OL')) &&
33082
+ isNullOrUndefined(this.startNode.closest('.e-img-inner')) && isTableEnter &&
32646
33083
  isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
32647
33084
  const shiftKey = e.args.shiftKey;
32648
33085
  const actionBeginArgs = {
@@ -33076,10 +33513,10 @@ class EnterKeyAction {
33076
33513
  }
33077
33514
  const previousBlockNode = this.parent.formatter.editorManager.domNode.blockNodes()[0].previousSibling;
33078
33515
  const nextBlockNode = this.parent.formatter.editorManager.domNode.blockNodes()[0].nextSibling;
33079
- if (!isNullOrUndefined(previousBlockNode) && previousBlockNode.hasAttribute('style') && previousBlockNode.nodeName !== 'TABLE') {
33516
+ if (!isNullOrUndefined(previousBlockNode) && previousBlockNode.nodeName !== '#text' && previousBlockNode.hasAttribute('style') && previousBlockNode.nodeName !== 'TABLE') {
33080
33517
  insertElem.setAttribute('style', previousBlockNode.getAttribute('style'));
33081
33518
  }
33082
- if (isNullOrUndefined(previousBlockNode) && !isNullOrUndefined(nextBlockNode) && nextBlockNode.hasAttribute('style') && nextBlockNode.nodeName !== 'TABLE') {
33519
+ if (isNullOrUndefined(previousBlockNode) && !isNullOrUndefined(nextBlockNode) && nextBlockNode.nodeName !== '#text' && nextBlockNode.hasAttribute('style') && nextBlockNode.nodeName !== 'TABLE') {
33083
33520
  insertElem.setAttribute('style', nextBlockNode.getAttribute('style'));
33084
33521
  }
33085
33522
  return insertElem;
@@ -33130,6 +33567,14 @@ let RichTextEditor = class RichTextEditor extends Component {
33130
33567
  member: 'image',
33131
33568
  args: [this, this.serviceLocator]
33132
33569
  });
33570
+ modules.push({
33571
+ member: 'audio',
33572
+ args: [this, this.serviceLocator]
33573
+ });
33574
+ modules.push({
33575
+ member: 'video',
33576
+ args: [this, this.serviceLocator]
33577
+ });
33133
33578
  if (this.quickToolbarSettings.enable) {
33134
33579
  modules.push({ member: 'quickToolbar', args: [this, this.serviceLocator] });
33135
33580
  }
@@ -33143,14 +33588,6 @@ let RichTextEditor = class RichTextEditor extends Component {
33143
33588
  if (this.editorMode === 'HTML') {
33144
33589
  modules.push({ member: 'htmlEditor', args: [this, this.serviceLocator] });
33145
33590
  modules.push({ member: 'pasteCleanup', args: [this, this.serviceLocator] });
33146
- modules.push({
33147
- member: 'audio',
33148
- args: [this, this.serviceLocator]
33149
- });
33150
- modules.push({
33151
- member: 'video',
33152
- args: [this, this.serviceLocator]
33153
- });
33154
33591
  modules.push({
33155
33592
  member: 'formatPainter',
33156
33593
  args: [this]
@@ -33182,7 +33619,7 @@ let RichTextEditor = class RichTextEditor extends Component {
33182
33619
  else {
33183
33620
  if (this.getToolbar()) {
33184
33621
  removeClass(this.getToolbar().querySelectorAll('.' + CLS_ACTIVE), CLS_ACTIVE);
33185
- removeClass([this.getToolbar()], [CLS_TB_FLOAT, CLS_TB_ABS_FLOAT]);
33622
+ removeClass([this.getToolbar().parentElement], [CLS_TB_FLOAT]);
33186
33623
  }
33187
33624
  addClass([this.element], CLS_DISABLED);
33188
33625
  this.element.tabIndex = -1;
@@ -33603,7 +34040,7 @@ let RichTextEditor = class RichTextEditor extends Component {
33603
34040
  (this.toolbarSettings.items.indexOf('Undo') > -1 && this.toolbarSettings.items.indexOf('Redo') > -1)) {
33604
34041
  this.disableToolbarItem(['Undo', 'Redo']);
33605
34042
  }
33606
- this.setContentHeight();
34043
+ this.setContentHeight('Init');
33607
34044
  if (this.value !== null) {
33608
34045
  this.valueContainer.defaultValue = this.value;
33609
34046
  }
@@ -33807,9 +34244,16 @@ let RichTextEditor = class RichTextEditor extends Component {
33807
34244
  switch (e.action) {
33808
34245
  case 'toolbar-focus':
33809
34246
  if (this.toolbarSettings.enable && this.getToolbarElement()) {
33810
- const firstActiveItem = this.getToolbarElement().querySelector('.e-toolbar-item:not(.e-overlay)[title]');
33811
- firstActiveItem.firstElementChild.removeAttribute('tabindex');
33812
- firstActiveItem.firstElementChild.focus();
34247
+ let firstActiveItem = this.getToolbarElement().querySelector('.e-toolbar-item:not(.e-overlay)[title]');
34248
+ const quickToolbarElem = this.getRenderedQuickToolbarElem();
34249
+ if (quickToolbarElem) {
34250
+ firstActiveItem = quickToolbarElem.querySelector('.e-toolbar-item:not(.e-overlay)[title]');
34251
+ }
34252
+ if (firstActiveItem) {
34253
+ const firstChild = firstActiveItem.firstElementChild;
34254
+ firstChild.removeAttribute('tabindex');
34255
+ firstChild.focus();
34256
+ }
33813
34257
  }
33814
34258
  break;
33815
34259
  case 'escape':
@@ -34025,6 +34469,7 @@ let RichTextEditor = class RichTextEditor extends Component {
34025
34469
  this.notify(pasteClean, { args: e });
34026
34470
  }
34027
34471
  else {
34472
+ console.warn('[WARNING] :: Module "pasteCleanup" is not available in RichTextEditor component! You either misspelled the module name or forgot to load it.');
34028
34473
  const args = { requestType: 'Paste', editorMode: this.editorMode, event: e };
34029
34474
  let value = null;
34030
34475
  let htmlValue = false;
@@ -34318,7 +34763,7 @@ let RichTextEditor = class RichTextEditor extends Component {
34318
34763
  break;
34319
34764
  case 'height':
34320
34765
  this.setHeight(newProp[prop]);
34321
- this.setContentHeight();
34766
+ this.setContentHeight('Init');
34322
34767
  this.autoResize();
34323
34768
  break;
34324
34769
  case 'readonly':
@@ -34365,11 +34810,11 @@ let RichTextEditor = class RichTextEditor extends Component {
34365
34810
  break;
34366
34811
  case 'inlineMode':
34367
34812
  this.notify(modelChanged, { module: 'quickToolbar', newProp: newProp, oldProp: oldProp });
34368
- this.setContentHeight();
34813
+ this.setContentHeight('Init');
34369
34814
  break;
34370
34815
  case 'toolbarSettings':
34371
34816
  this.notify(modelChanged, { module: 'toolbar', newProp: newProp, oldProp: oldProp });
34372
- this.setContentHeight();
34817
+ this.setContentHeight('Init');
34373
34818
  break;
34374
34819
  case 'maxLength':
34375
34820
  if (this.showCharCount) {
@@ -34528,7 +34973,7 @@ let RichTextEditor = class RichTextEditor extends Component {
34528
34973
  this.inputElement.setAttribute('placeholder', this.placeholder);
34529
34974
  }
34530
34975
  }
34531
- if (this.placeholder && this.iframeSettings.enable) {
34976
+ if (this.placeholder && this.iframeSettings.enable && this.inputElement) {
34532
34977
  if (this.inputElement.textContent.length === 0 && this.inputElement.childNodes.length < 2 && !isNullOrUndefined(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
34533
34978
  ((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNullOrUndefined(this.inputElement.firstChild.firstChild) &&
34534
34979
  this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
@@ -34873,12 +35318,9 @@ let RichTextEditor = class RichTextEditor extends Component {
34873
35318
  */
34874
35319
  setContentHeight(target, isExpand) {
34875
35320
  let heightValue;
34876
- let topValue = 0;
34877
35321
  let rteHeightPercent;
34878
35322
  const heightPercent = typeof (this.height) === 'string' && this.height.indexOf('%') > -1;
34879
- const cntEle = (this.sourceCodeModule.getPanel() &&
34880
- this.sourceCodeModule.getPanel().parentElement.style.display === 'block') ? this.sourceCodeModule.getPanel().parentElement :
34881
- this.contentModule.getPanel();
35323
+ const cntEle = this.contentModule.getPanel();
34882
35324
  let rteHeight = this.element.offsetHeight;
34883
35325
  if (rteHeight === 0 && this.height !== 'auto' && !this.getToolbar()) {
34884
35326
  rteHeight = parseInt(this.height, 10);
@@ -34886,43 +35328,40 @@ let RichTextEditor = class RichTextEditor extends Component {
34886
35328
  rteHeightPercent = this.height;
34887
35329
  }
34888
35330
  }
34889
- const tbHeight = this.getToolbar() ? this.toolbarModule.getToolbarHeight() : 0;
35331
+ let tbHeight = this.getToolbar() ? this.toolbarModule.getToolbarHeight() : 0;
34890
35332
  const rzHandle = this.element.querySelector('.' + CLS_RTE_RES_HANDLE);
34891
35333
  const rzHeight = this.enableResize ? (!isNullOrUndefined(rzHandle) ? (rzHandle.offsetHeight + 8) : 0) : 0;
34892
35334
  const expandPopHeight = this.getToolbar() ? this.toolbarModule.getExpandTBarPopHeight() : 0;
34893
- if (this.toolbarSettings.type === ToolbarType.Expand && isExpand) {
34894
- heightValue = (this.height === 'auto' && rzHeight === 0) ? 'auto' : rteHeight - (tbHeight + expandPopHeight + rzHeight) + 'px';
34895
- topValue = (!this.toolbarSettings.enableFloating) ? expandPopHeight : 0;
35335
+ if (target && target !== 'Toolbar' && expandPopHeight && this.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0) {
35336
+ tbHeight = tbHeight - expandPopHeight;
34896
35337
  }
34897
- else {
34898
- if (this.height === 'auto' && !(this.element.classList.contains('e-rte-full-screen')) && !this.isResizeInitialized) {
34899
- heightValue = 'auto';
35338
+ if (this.toolbarSettings.type === ToolbarType.Expand) {
35339
+ if (isExpand) {
35340
+ heightValue = (this.height === 'auto' && this.element.style.height === 'auto') ? 'auto' : rteHeight - (tbHeight + expandPopHeight + rzHeight) + 'px';
34900
35341
  }
34901
35342
  else {
34902
- heightValue = heightPercent && rteHeightPercent ? rteHeightPercent : rteHeight - (tbHeight + rzHeight) + 'px';
35343
+ heightValue = (this.height === 'auto' && this.element.style.height === 'auto') ? 'auto' : rteHeight - (tbHeight - expandPopHeight + rzHeight) + 'px';
34903
35344
  }
34904
35345
  }
34905
- if (target !== 'windowResize' || heightPercent) {
34906
- if (this.iframeSettings.enable) {
34907
- if (heightValue !== 'auto') {
34908
- setStyleAttribute(cntEle, { height: heightValue, marginTop: topValue + 'px' });
35346
+ else {
35347
+ heightValue = (this.height === 'auto' && this.element.style.height === 'auto') ? 'auto' : rteHeight - tbHeight + 'px';
35348
+ }
35349
+ const finalHeight = heightPercent && rteHeightPercent ? rteHeightPercent : heightValue;
35350
+ switch (target) {
35351
+ case 'Init':
35352
+ case 'Toolbar':
35353
+ case 'WindowResize':
35354
+ case 'Refresh':
35355
+ if (this.element.querySelectorAll('.e-source-content').length > 0 && this.element.querySelector('.e-source-content').style.display === 'block') {
35356
+ setStyleAttribute(this.element.querySelector('.e-source-content'), { height: finalHeight });
34909
35357
  }
34910
- }
34911
- else {
34912
- if (target === 'windowResize' && heightPercent) {
34913
- //cntEle hide the borderBottom of RichTextEditor. so removed the 2px of cntEle height.
34914
- heightValue = parseInt(heightValue, 10) - 2 + 'px';
35358
+ else {
35359
+ setStyleAttribute(cntEle, { height: finalHeight });
34915
35360
  }
34916
- setStyleAttribute(cntEle, { height: heightValue, marginTop: topValue + 'px' });
34917
- }
34918
- }
34919
- if (this.iframeSettings.enable && target === 'sourceCode') {
34920
- const codeElement = select('.' + CLS_RTE_CONTENT, this.element);
34921
- setStyleAttribute(codeElement, { height: heightValue, marginTop: topValue + 'px' });
34922
- }
34923
- if (this.toolbarSettings.enableFloating && this.getToolbar() && !this.inlineMode.enable) {
34924
- const tbWrapHeight = (isExpand ? (tbHeight + expandPopHeight) : tbHeight) + 'px';
34925
- setStyleAttribute(this.getToolbar().parentElement, { height: tbWrapHeight });
35361
+ break;
35362
+ case 'Resize':
35363
+ setStyleAttribute(cntEle, { height: finalHeight });
35364
+ break;
34926
35365
  }
34927
35366
  if (rzHeight === 0) {
34928
35367
  this.autoResize();
@@ -35125,18 +35564,14 @@ let RichTextEditor = class RichTextEditor extends Component {
35125
35564
  resizeHandler() {
35126
35565
  let isExpand = false;
35127
35566
  if (!document.body.contains(this.element)) {
35128
- document.defaultView.removeEventListener('resize', this.onResizeHandler, true);
35567
+ document.defaultView.removeEventListener('resize', debounce(this.onResizeHandler, 10), true);
35129
35568
  return;
35130
35569
  }
35131
35570
  if (this.toolbarSettings.enable && !this.inlineMode.enable) {
35132
35571
  this.toolbarModule.refreshToolbarOverflow();
35133
35572
  isExpand = this.toolbarModule.baseToolbar.toolbarObj.element.classList.contains(CLS_EXPAND_OPEN);
35134
35573
  }
35135
- if (this.iframeSettings.enable !== true) {
35136
- // When resize the window,border bottom of cntEle and this.element border visible separatly.so none the cntEle borderBottom.
35137
- this.contentModule.getPanel().style.borderBottom = 'none';
35138
- }
35139
- this.setContentHeight('windowResize', isExpand);
35574
+ this.setContentHeight('WindowResize', isExpand);
35140
35575
  this.notify(windowResize, null);
35141
35576
  }
35142
35577
  scrollHandler(e) {
@@ -35272,6 +35707,10 @@ let RichTextEditor = class RichTextEditor extends Component {
35272
35707
  this.isRTE = false;
35273
35708
  }
35274
35709
  this.notify(docClick, { args: e });
35710
+ const hideQuickToolbarChecker = this.quickToolbarModule && !this.inlineMode.enable && isNullOrUndefined(this.quickToolbarModule.inlineQTBar);
35711
+ if ((hideQuickToolbarChecker && !isNullOrUndefined(closest(target, '.' + 'e-toolbar-wrapper'))) || (hideQuickToolbarChecker && (!isNullOrUndefined(closest(target, '.e-rte-table-resize')) || !isNullOrUndefined(closest(target, '.e-table-box'))))) {
35712
+ this.quickToolbarModule.hideQuickToolbars();
35713
+ }
35275
35714
  if (Browser.info.name !== 'msie' && e.detail > 3) {
35276
35715
  e.preventDefault();
35277
35716
  }
@@ -35419,9 +35858,10 @@ let RichTextEditor = class RichTextEditor extends Component {
35419
35858
  this.triggerEditArea(e.originalEvent);
35420
35859
  }
35421
35860
  contextHandler(e) {
35422
- const closestElem = closest(e.target, 'a, table, img');
35861
+ const closestElem = closest(e.target, 'a, table, img, video, audio');
35423
35862
  if (this.inlineMode.onSelection === false || (!isNullOrUndefined(closestElem) && this.inputElement.contains(closestElem)
35424
- && (closestElem.tagName === 'IMG' || closestElem.tagName === 'TABLE' || closestElem.tagName === 'A'))) {
35863
+ && (closestElem.tagName === 'IMG' || closestElem.tagName === 'TABLE' || closestElem.tagName === 'A' ||
35864
+ closestElem.tagName.toLowerCase() === 'video' || closestElem.tagName.toLowerCase() === 'audio'))) {
35425
35865
  e.preventDefault();
35426
35866
  }
35427
35867
  }
@@ -35454,10 +35894,21 @@ let RichTextEditor = class RichTextEditor extends Component {
35454
35894
  }
35455
35895
  }
35456
35896
  setAutoHeight(element) {
35457
- if (!isNullOrUndefined(element)) {
35897
+ if (!isNullOrUndefined(element) && !this.iframeSettings.enable) {
35458
35898
  element.style.height = this.inputElement.scrollHeight + 'px';
35459
35899
  element.style.overflow = 'hidden';
35460
35900
  }
35901
+ else if (!isNullOrUndefined(element) && !isNullOrUndefined(element.parentElement) && this.iframeSettings.enable) {
35902
+ const newRange = this.getRange();
35903
+ element.style.height = 'auto';
35904
+ const newHeight = element.contentDocument.body.scrollHeight + 'px';
35905
+ element.style.height = newHeight;
35906
+ element.style.overflow = 'hidden';
35907
+ // 16 px added for padding doesn't affect the editor height
35908
+ if (newRange.startContainer.nodeName !== '#text' && newRange.startContainer.nodeName !== 'BODY' && window.innerHeight < newRange.startContainer.getBoundingClientRect().top + element.getBoundingClientRect().top + 16) {
35909
+ newRange.startContainer.scrollIntoView(false);
35910
+ }
35911
+ }
35461
35912
  }
35462
35913
  wireEvents() {
35463
35914
  this.element.addEventListener('focusin', this.onFocusHandler, true);
@@ -35512,7 +35963,7 @@ let RichTextEditor = class RichTextEditor extends Component {
35512
35963
  EventHandler.add(this.inputElement, Browser.touchStartEvent, this.mouseDownHandler, this);
35513
35964
  this.wireContextEvent();
35514
35965
  this.formatter.editorManager.observer.on(KEY_DOWN_HANDLER, this.editorKeyDown, this);
35515
- this.element.ownerDocument.defaultView.addEventListener('resize', this.onResizeHandler, true);
35966
+ this.element.ownerDocument.defaultView.addEventListener('resize', debounce(this.onResizeHandler, 10), true);
35516
35967
  if (this.iframeSettings.enable) {
35517
35968
  EventHandler.add(this.inputElement, 'focusin', this.focusHandler, this);
35518
35969
  EventHandler.add(this.inputElement, 'focusout', this.blurHandler, this);
@@ -35578,7 +36029,7 @@ let RichTextEditor = class RichTextEditor extends Component {
35578
36029
  if (this.formatter) {
35579
36030
  this.formatter.editorManager.observer.off(KEY_DOWN_HANDLER, this.editorKeyDown);
35580
36031
  }
35581
- this.element.ownerDocument.defaultView.removeEventListener('resize', this.onResizeHandler, true);
36032
+ this.element.ownerDocument.defaultView.removeEventListener('resize', debounce(this.onResizeHandler, 10), true);
35582
36033
  if (this.iframeSettings.enable) {
35583
36034
  EventHandler.remove(this.inputElement, 'focusin', this.focusHandler);
35584
36035
  EventHandler.remove(this.inputElement, 'focusout', this.blurHandler);
@@ -35643,6 +36094,15 @@ let RichTextEditor = class RichTextEditor extends Component {
35643
36094
  }
35644
36095
  }
35645
36096
  }
36097
+ getRenderedQuickToolbarElem() {
36098
+ const quickToolbars = this.quickToolbarModule.getQuickToolbarInstance();
36099
+ for (let i = 0; i < quickToolbars.length; i++) {
36100
+ if (quickToolbars[i] && quickToolbars[i].isRendered) {
36101
+ return quickToolbars[i].element;
36102
+ }
36103
+ }
36104
+ return null;
36105
+ }
35646
36106
  };
35647
36107
  __decorate$1([
35648
36108
  Complex({}, ToolbarSettings$1)
@@ -35946,5 +36406,5 @@ RichTextEditor = __decorate$1([
35946
36406
  * Rich Text Editor component exported items
35947
36407
  */
35948
36408
 
35949
- export { Toolbar$2 as Toolbar, KeyboardEvents$1 as KeyboardEvents, BaseToolbar, BaseQuickToolbar, QuickToolbar, Count, ColorPickerInput, MarkdownToolbarStatus, ExecCommandCallBack, ToolbarAction, MarkdownEditor, HtmlEditor, PasteCleanup, Resize, DropDownButtons, FileManager$1 as FileManager, FullScreen, setAttributes, HtmlToolbarStatus, XhtmlValidation, FormatPainter, EmojiPicker, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, Image$1 as Image, Audio, Video, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, tableclass, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, tableModulekeyUp, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, audioToolbarAction, videoToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertAudio, insertVideo, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, audioDelete, videoDelete, imageCaption, imageSize, videoSize, sourceCode, updateSource, toolbarOpen, beforeDropDownOpen, selectionSave, selectionRestore, expandPopupClick, count, contentFocus, contentBlur, mouseDown, sourceCodeMouseDown, editAreaClick, scroll, contentscroll, colorPickerChanged, tableColorPickerChanged, focusChange, selectAll$1 as selectAll, selectRange, getSelectedHtml, renderInlineToolbar, paste, imgModule, rtlMode, createTable, docClick, tableToolbarAction, checkUndo, readOnlyMode, moduleDestroy, pasteClean, enterHandler, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, fileSelected, fileUploading, fileUploadSuccess, fileUploadFailed, fileRemoving, afterImageDelete, afterMediaDelete, drop, xhtmlValidation, beforeImageUpload, beforeFileUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, showAudioDialog, showVideoDialog, closeImageDialog, closeAudioDialog, closeVideoDialog, showTableDialog, closeTableDialog, bindCssClass, formatPainterClick, formatPainterDoubleClick, emojiPicker, destroyTooltip, hidePopup, cleanupResizeElements, afterKeyDown, updateValueOnIdle, documentClickClosedBy, showColorPicker, blockEmptyNodes, inlineEmptyNodes, supportedUnits, conversionFactors, onHandleFontsizeChange, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT, CLS_TB_ABS_FLOAT, CLS_INLINE, CLS_TB_INLINE, CLS_RTE_EXPAND_TB, CLS_FULL_SCREEN, CLS_QUICK_TB, CLS_TEXT_QUICK_TB, CLS_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_POP, CLS_TEXT_POP, CLS_INLINE_POP, CLS_INLINE_DROPDOWN, CLS_DROPDOWN_POPUP, CLS_DROPDOWN_ICONS, CLS_DROPDOWN_ITEMS, CLS_DROPDOWN_BTN, CLS_RTE_CONTENT, CLS_TB_ITEM, CLS_TB_EXTENDED, CLS_TB_WRAP, CLS_POPUP, CLS_SEPARATOR, CLS_MINIMIZE, CLS_MAXIMIZE, CLS_BACK, CLS_SHOW, CLS_HIDE, CLS_VISIBLE, CLS_FOCUS, CLS_RM_WHITE_SPACE, CLS_IMGRIGHT, CLS_IMGLEFT, CLS_IMGCENTER, CLS_IMGBREAK, CLS_AUDIOBREAK, CLS_CLICKELEM, CLS_VID_CLICK_ELEM, CLS_AUDIOWRAP, CLS_VIDEOWRAP, CLS_VIDEOBREAK, CLS_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, CLS_AUDIOINLINE, CLS_VIDEOINLINE, CLS_COUNT, CLS_WARNING, CLS_ERROR, CLS_ICONS, CLS_ACTIVE, CLS_EXPAND_OPEN, CLS_RTE_ELEMENTS, CLS_TB_BTN, CLS_HR_SEPARATOR, CLS_TB_IOS_FIX, CLS_LIST_PRIMARY_CONTENT, CLS_NUMBERFORMATLIST_TB_BTN, CLS_BULLETFORMATLIST_TB_BTN, CLS_FORMATS_TB_BTN, CLS_FONT_NAME_TB_BTN, CLS_FONT_SIZE_TB_BTN, CLS_ALIGN_TB_BTN, CLS_FONT_COLOR_TARGET, CLS_BACKGROUND_COLOR_TARGET, CLS_COLOR_CONTENT, CLS_FONT_COLOR_DROPDOWN, CLS_BACKGROUND_COLOR_DROPDOWN, CLS_COLOR_PALETTE, CLS_FONT_COLOR_PICKER, CLS_BACKGROUND_COLOR_PICKER, CLS_RTE_READONLY, CLS_TABLE_SEL, CLS_TB_DASH_BOR, CLS_TB_ALT_BOR, CLS_TB_COL_RES, CLS_TB_ROW_RES, CLS_TB_BOX_RES, CLS_RTE_HIDDEN, CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT, CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT, CLS_RTE_RES_HANDLE, CLS_RTE_RES_EAST, CLS_RTE_IMAGE, CLS_RESIZE, CLS_IMG_FOCUS, CLS_AUD_FOCUS, CLS_VID_FOCUS, CLS_RTE_DRAG_IMAGE, CLS_RTE_UPLOAD_POPUP, CLS_POPUP_OPEN, CLS_IMG_RESIZE, CLS_DROPAREA, CLS_IMG_INNER, CLS_UPLOAD_FILES, CLS_RTE_DIALOG_UPLOAD, CLS_RTE_RES_CNT, CLS_CUSTOM_TILE, CLS_NOCOLOR_ITEM, CLS_TABLE, CLS_TABLE_BORDER, CLS_RTE_TABLE_RESIZE, CLS_RTE_FIXED_TB_EXPAND, CLS_RTE_TB_ENABLED, CLS_RTE_RES_WEST, CLS_RTE_SOURCE_CODE_TXTAREA, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, getTooltipTextDropdownItems, getQuickToolbarTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, getDefaultValue, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, AUDIO, VIDEO, TABLE, LINK, INSERT_ROW, INSERT_COLUMN, DELETEROW, DELETECOLUMN, REMOVETABLE, TABLEHEADER, TABLE_VERTICAL_ALIGN, TABLE_MERGE, TABLE_VERTICAL_SPLIT, TABLE_HORIZONTAL_SPLIT, TABLE_MOVE, ALIGNMENT_TYPE, INDENT_TYPE, DEFAULT_TAG, BLOCK_TAGS, IGNORE_BLOCK_TAGS, TABLE_BLOCK_TAGS, SELECTION_TYPE, INSERTHTML_TYPE, INSERT_TEXT_TYPE, CLEAR_TYPE, SELF_CLOSING_TAGS, PASTE_SOURCE, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_VIDEO_RIGHT, CLASS_VIDEO_LEFT, CLASS_VIDEO_CENTER, CLASS_IMAGE_BREAK, CLASS_AUDIO_BREAK, CLASS_VIDEO_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, CLASS_AUDIO_INLINE, CLASS_CLICK_ELEM, CLASS_VIDEO_CLICK_ELEM, CLASS_AUDIO, CLASS_VIDEO, CLASS_AUDIO_WRAP, CLASS_VIDEO_WRAP, CLASS_EMBED_VIDEO_WRAP, CLASS_AUDIO_FOCUS, CLASS_VIDEO_FOCUS, CLASS_VIDEO_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, AudioCommand, VideoCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, FormatPainterActions, EmojiPickerAction, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, INSERT_TEXT_COMMAND, ClearFormat, MDLists, MDFormats, MarkdownSelection, UndoRedoCommands, MDSelectionFormats, MDLink, MDTable, markdownFormatTags, markdownSelectionTags, markdownListsTags, htmlKeyConfig, markdownKeyConfig, pasteCleanupGroupingTags, listConversionFilters, selfClosingTags, KEY_DOWN, ACTION, FORMAT_TYPE, KEY_DOWN_HANDLER, LIST_TYPE, KEY_UP_HANDLER, KEY_UP, MODEL_CHANGED_PLUGIN, MODEL_CHANGED, MS_WORD_CLEANUP_PLUGIN, MS_WORD_CLEANUP, ON_BEGIN, SPACE_ACTION, FORMAT_PAINTER_ACTIONS, EMOJI_PICKER_ACTIONS, MOUSE_DOWN };
36409
+ export { Toolbar$2 as Toolbar, KeyboardEvents$1 as KeyboardEvents, BaseToolbar, BaseQuickToolbar, QuickToolbar, Count, ColorPickerInput, MarkdownToolbarStatus, ExecCommandCallBack, ToolbarAction, MarkdownEditor, HtmlEditor, PasteCleanup, Resize, DropDownButtons, FileManager$1 as FileManager, FullScreen, setAttributes, HtmlToolbarStatus, XhtmlValidation, FormatPainter, EmojiPicker, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, Image$1 as Image, Audio, Video, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, tableclass, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, tableModulekeyUp, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, audioToolbarAction, videoToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertAudio, insertVideo, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, audioDelete, videoDelete, imageCaption, imageSize, videoSize, sourceCode, updateSource, toolbarOpen, beforeDropDownOpen, selectionSave, selectionRestore, expandPopupClick, count, contentFocus, contentBlur, mouseDown, sourceCodeMouseDown, editAreaClick, scroll, contentscroll, colorPickerChanged, tableColorPickerChanged, focusChange, selectAll$1 as selectAll, selectRange, getSelectedHtml, renderInlineToolbar, paste, imgModule, rtlMode, createTable, docClick, tableToolbarAction, checkUndo, readOnlyMode, moduleDestroy, pasteClean, enterHandler, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, fileSelected, fileUploading, fileUploadSuccess, fileUploadFailed, fileRemoving, afterImageDelete, afterMediaDelete, drop, xhtmlValidation, beforeImageUpload, beforeFileUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, showAudioDialog, showVideoDialog, closeImageDialog, closeAudioDialog, closeVideoDialog, showTableDialog, closeTableDialog, bindCssClass, formatPainterClick, formatPainterDoubleClick, emojiPicker, destroyTooltip, hidePopup, cleanupResizeElements, afterKeyDown, updateValueOnIdle, documentClickClosedBy, showColorPicker, closeTooltip, blockEmptyNodes, inlineEmptyNodes, supportedUnits, conversionFactors, onHandleFontsizeChange, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT, CLS_INLINE, CLS_TB_INLINE, CLS_RTE_EXPAND_TB, CLS_FULL_SCREEN, CLS_QUICK_TB, CLS_TEXT_QUICK_TB, CLS_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_POP, CLS_TEXT_POP, CLS_INLINE_POP, CLS_INLINE_DROPDOWN, CLS_DROPDOWN_POPUP, CLS_DROPDOWN_ICONS, CLS_DROPDOWN_ITEMS, CLS_DROPDOWN_BTN, CLS_RTE_CONTENT, CLS_TB_ITEM, CLS_TB_EXTENDED, CLS_TB_WRAP, CLS_POPUP, CLS_SEPARATOR, CLS_MINIMIZE, CLS_MAXIMIZE, CLS_BACK, CLS_SHOW, CLS_HIDE, CLS_VISIBLE, CLS_FOCUS, CLS_RM_WHITE_SPACE, CLS_IMGRIGHT, CLS_IMGLEFT, CLS_IMGCENTER, CLS_IMGBREAK, CLS_AUDIOBREAK, CLS_CLICKELEM, CLS_VID_CLICK_ELEM, CLS_AUDIOWRAP, CLS_VIDEOWRAP, CLS_VIDEOBREAK, CLS_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, CLS_AUDIOINLINE, CLS_VIDEOINLINE, CLS_COUNT, CLS_WARNING, CLS_ERROR, CLS_ICONS, CLS_ACTIVE, CLS_EXPAND_OPEN, CLS_RTE_ELEMENTS, CLS_TB_BTN, CLS_HR_SEPARATOR, CLS_TB_IOS_FIX, CLS_LIST_PRIMARY_CONTENT, CLS_NUMBERFORMATLIST_TB_BTN, CLS_BULLETFORMATLIST_TB_BTN, CLS_FORMATS_TB_BTN, CLS_FONT_NAME_TB_BTN, CLS_FONT_SIZE_TB_BTN, CLS_ALIGN_TB_BTN, CLS_FONT_COLOR_TARGET, CLS_BACKGROUND_COLOR_TARGET, CLS_COLOR_CONTENT, CLS_FONT_COLOR_DROPDOWN, CLS_BACKGROUND_COLOR_DROPDOWN, CLS_COLOR_PALETTE, CLS_FONT_COLOR_PICKER, CLS_BACKGROUND_COLOR_PICKER, CLS_RTE_READONLY, CLS_TABLE_SEL, CLS_TB_DASH_BOR, CLS_TB_ALT_BOR, CLS_TB_COL_RES, CLS_TB_ROW_RES, CLS_TB_BOX_RES, CLS_RTE_HIDDEN, CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT, CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT, CLS_RTE_RES_HANDLE, CLS_RTE_RES_EAST, CLS_RTE_IMAGE, CLS_RESIZE, CLS_IMG_FOCUS, CLS_AUD_FOCUS, CLS_VID_FOCUS, CLS_RTE_DRAG_IMAGE, CLS_RTE_UPLOAD_POPUP, CLS_POPUP_OPEN, CLS_IMG_RESIZE, CLS_DROPAREA, CLS_IMG_INNER, CLS_UPLOAD_FILES, CLS_RTE_DIALOG_UPLOAD, CLS_RTE_RES_CNT, CLS_CUSTOM_TILE, CLS_NOCOLOR_ITEM, CLS_TABLE, CLS_TABLE_BORDER, CLS_RTE_TABLE_RESIZE, CLS_RTE_FIXED_TB_EXPAND, CLS_RTE_TB_ENABLED, CLS_RTE_RES_WEST, CLS_RTE_SOURCE_CODE_TXTAREA, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, getTooltipTextDropdownItems, getQuickToolbarTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, getDefaultValue, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, AUDIO, VIDEO, TABLE, LINK, INSERT_ROW, INSERT_COLUMN, DELETEROW, DELETECOLUMN, REMOVETABLE, TABLEHEADER, TABLE_VERTICAL_ALIGN, TABLE_MERGE, TABLE_VERTICAL_SPLIT, TABLE_HORIZONTAL_SPLIT, TABLE_MOVE, ALIGNMENT_TYPE, INDENT_TYPE, DEFAULT_TAG, BLOCK_TAGS, IGNORE_BLOCK_TAGS, TABLE_BLOCK_TAGS, SELECTION_TYPE, INSERTHTML_TYPE, INSERT_TEXT_TYPE, CLEAR_TYPE, SELF_CLOSING_TAGS, PASTE_SOURCE, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_VIDEO_RIGHT, CLASS_VIDEO_LEFT, CLASS_VIDEO_CENTER, CLASS_IMAGE_BREAK, CLASS_AUDIO_BREAK, CLASS_VIDEO_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, CLASS_AUDIO_INLINE, CLASS_CLICK_ELEM, CLASS_VIDEO_CLICK_ELEM, CLASS_AUDIO, CLASS_VIDEO, CLASS_AUDIO_WRAP, CLASS_VIDEO_WRAP, CLASS_EMBED_VIDEO_WRAP, CLASS_AUDIO_FOCUS, CLASS_VIDEO_FOCUS, CLASS_VIDEO_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, AudioCommand, VideoCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, FormatPainterActions, EmojiPickerAction, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, INSERT_TEXT_COMMAND, ClearFormat, MDLists, MDFormats, MarkdownSelection, UndoRedoCommands, MDSelectionFormats, MDLink, MDTable, markdownFormatTags, markdownSelectionTags, markdownListsTags, htmlKeyConfig, markdownKeyConfig, pasteCleanupGroupingTags, listConversionFilters, selfClosingTags, imageResizeFactor, KEY_DOWN, ACTION, FORMAT_TYPE, KEY_DOWN_HANDLER, LIST_TYPE, KEY_UP_HANDLER, KEY_UP, MODEL_CHANGED_PLUGIN, MODEL_CHANGED, MS_WORD_CLEANUP_PLUGIN, MS_WORD_CLEANUP, ON_BEGIN, SPACE_ACTION, FORMAT_PAINTER_ACTIONS, EMOJI_PICKER_ACTIONS, MOUSE_DOWN };
35950
36410
  //# sourceMappingURL=ej2-richtexteditor.es2015.js.map