@syncfusion/ej2-richtexteditor 24.1.41-569421 → 24.1.41-581025

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 (167) hide show
  1. package/CHANGELOG.md +0 -176
  2. package/dist/ej2-richtexteditor.umd.min.js +1 -1
  3. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-richtexteditor.es2015.js +7822 -9502
  5. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-richtexteditor.es5.js +5674 -7355
  7. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  8. package/package.json +12 -12
  9. package/src/common/config.d.ts +0 -7
  10. package/src/common/config.js +0 -11
  11. package/src/common/constant.d.ts +0 -6
  12. package/src/common/constant.js +0 -6
  13. package/src/common/interface.d.ts +0 -12
  14. package/src/common/types.d.ts +0 -6
  15. package/src/common/util.d.ts +0 -6
  16. package/src/common/util.js +20 -61
  17. package/src/editor-manager/base/constant.d.ts +0 -6
  18. package/src/editor-manager/base/constant.js +0 -6
  19. package/src/editor-manager/base/editor-manager.d.ts +0 -5
  20. package/src/editor-manager/base/editor-manager.js +0 -59
  21. package/src/editor-manager/base/interface.d.ts +0 -8
  22. package/src/editor-manager/plugin/dom-node.d.ts +1 -5
  23. package/src/editor-manager/plugin/dom-node.js +15 -169
  24. package/src/editor-manager/plugin/format-painter-actions.d.ts +0 -1
  25. package/src/editor-manager/plugin/format-painter-actions.js +1 -19
  26. package/src/editor-manager/plugin/formats.d.ts +0 -1
  27. package/src/editor-manager/plugin/formats.js +3 -38
  28. package/src/editor-manager/plugin/image.js +16 -12
  29. package/src/editor-manager/plugin/indents.js +1 -1
  30. package/src/editor-manager/plugin/inserthtml.d.ts +0 -1
  31. package/src/editor-manager/plugin/inserthtml.js +18 -78
  32. package/src/editor-manager/plugin/link.js +3 -8
  33. package/src/editor-manager/plugin/lists.js +70 -159
  34. package/src/editor-manager/plugin/ms-word-clean-up.d.ts +0 -3
  35. package/src/editor-manager/plugin/ms-word-clean-up.js +85 -212
  36. package/src/editor-manager/plugin/nodecutter.js +2 -5
  37. package/src/editor-manager/plugin/selection-commands.d.ts +0 -2
  38. package/src/editor-manager/plugin/selection-commands.js +4 -209
  39. package/src/editor-manager/plugin/table.d.ts +1 -4
  40. package/src/editor-manager/plugin/table.js +49 -95
  41. package/src/editor-manager/plugin/toolbar-status.d.ts +2 -2
  42. package/src/editor-manager/plugin/toolbar-status.js +10 -20
  43. package/src/editor-manager/plugin/undo.d.ts +0 -1
  44. package/src/editor-manager/plugin/undo.js +1 -21
  45. package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +3 -4
  46. package/src/rich-text-editor/actions/base-quick-toolbar.js +10 -43
  47. package/src/rich-text-editor/actions/base-toolbar.js +34 -33
  48. package/src/rich-text-editor/actions/color-picker.d.ts +0 -1
  49. package/src/rich-text-editor/actions/color-picker.js +0 -10
  50. package/src/rich-text-editor/actions/count.js +1 -1
  51. package/src/rich-text-editor/actions/dropdown-buttons.d.ts +0 -1
  52. package/src/rich-text-editor/actions/dropdown-buttons.js +4 -8
  53. package/src/rich-text-editor/actions/emoji-picker.js +4 -4
  54. package/src/rich-text-editor/actions/enter-key.js +4 -8
  55. package/src/rich-text-editor/actions/format-painter.js +1 -4
  56. package/src/rich-text-editor/actions/full-screen.js +2 -3
  57. package/src/rich-text-editor/actions/html-editor.d.ts +2 -2
  58. package/src/rich-text-editor/actions/html-editor.js +42 -123
  59. package/src/rich-text-editor/actions/keyboard.js +1 -3
  60. package/src/rich-text-editor/actions/markdown-editor.js +1 -3
  61. package/src/rich-text-editor/actions/paste-clean-up.d.ts +0 -3
  62. package/src/rich-text-editor/actions/paste-clean-up.js +14 -85
  63. package/src/rich-text-editor/actions/quick-toolbar.d.ts +0 -8
  64. package/src/rich-text-editor/actions/quick-toolbar.js +9 -37
  65. package/src/rich-text-editor/actions/resize.js +1 -2
  66. package/src/rich-text-editor/actions/toolbar-action.js +1 -1
  67. package/src/rich-text-editor/actions/toolbar.d.ts +3 -2
  68. package/src/rich-text-editor/actions/toolbar.js +87 -18
  69. package/src/rich-text-editor/base/classes.d.ts +5 -0
  70. package/src/rich-text-editor/base/classes.js +5 -0
  71. package/src/rich-text-editor/base/constant.d.ts +0 -40
  72. package/src/rich-text-editor/base/constant.js +0 -209
  73. package/src/rich-text-editor/base/interface.d.ts +3 -37
  74. package/src/rich-text-editor/base/rich-text-editor-model.d.ts +3 -3
  75. package/src/rich-text-editor/base/rich-text-editor.d.ts +4 -7
  76. package/src/rich-text-editor/base/rich-text-editor.js +132 -156
  77. package/src/rich-text-editor/base/util.js +2 -11
  78. package/src/rich-text-editor/formatter/formatter.js +4 -16
  79. package/src/rich-text-editor/models/default-locale.js +26 -30
  80. package/src/rich-text-editor/models/items.js +2 -2
  81. package/src/rich-text-editor/models/toolbar-settings-model.d.ts +1 -1
  82. package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
  83. package/src/rich-text-editor/models/toolbar-settings.js +1 -1
  84. package/src/rich-text-editor/renderer/audio-module.d.ts +0 -1
  85. package/src/rich-text-editor/renderer/audio-module.js +4 -22
  86. package/src/rich-text-editor/renderer/dialog-renderer.d.ts +0 -2
  87. package/src/rich-text-editor/renderer/dialog-renderer.js +1 -12
  88. package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -2
  89. package/src/rich-text-editor/renderer/image-module.d.ts +1 -9
  90. package/src/rich-text-editor/renderer/image-module.js +168 -203
  91. package/src/rich-text-editor/renderer/link-module.js +1 -10
  92. package/src/rich-text-editor/renderer/table-module.d.ts +1 -8
  93. package/src/rich-text-editor/renderer/table-module.js +139 -301
  94. package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +0 -3
  95. package/src/rich-text-editor/renderer/toolbar-renderer.js +9 -94
  96. package/src/rich-text-editor/renderer/video-module.d.ts +0 -3
  97. package/src/rich-text-editor/renderer/video-module.js +41 -82
  98. package/src/rich-text-editor/renderer/view-source.d.ts +0 -1
  99. package/src/rich-text-editor/renderer/view-source.js +4 -12
  100. package/src/selection/selection.js +0 -3
  101. package/styles/bootstrap-dark.css +53 -161
  102. package/styles/bootstrap.css +61 -162
  103. package/styles/bootstrap4.css +46 -146
  104. package/styles/bootstrap5-dark.css +46 -151
  105. package/styles/bootstrap5.css +46 -151
  106. package/styles/fabric-dark.css +40 -140
  107. package/styles/fabric.css +41 -141
  108. package/styles/fluent-dark.css +47 -165
  109. package/styles/fluent.css +47 -165
  110. package/styles/highcontrast-light.css +40 -140
  111. package/styles/highcontrast.css +41 -144
  112. package/styles/material-dark.css +41 -145
  113. package/styles/material.css +41 -145
  114. package/styles/material3-dark.css +50 -156
  115. package/styles/material3.css +50 -156
  116. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +13 -17
  117. package/styles/rich-text-editor/_bootstrap-definition.scss +19 -22
  118. package/styles/rich-text-editor/_bootstrap4-definition.scss +7 -11
  119. package/styles/rich-text-editor/_bootstrap5-definition.scss +3 -7
  120. package/styles/rich-text-editor/_fabric-dark-definition.scss +2 -6
  121. package/styles/rich-text-editor/_fabric-definition.scss +3 -7
  122. package/styles/rich-text-editor/_fluent-definition.scss +9 -13
  123. package/styles/rich-text-editor/_fusionnew-definition.scss +3 -7
  124. package/styles/rich-text-editor/_highcontrast-definition.scss +3 -7
  125. package/styles/rich-text-editor/_highcontrast-light-definition.scss +2 -6
  126. package/styles/rich-text-editor/_layout.scss +31 -133
  127. package/styles/rich-text-editor/_material-dark-definition.scss +2 -6
  128. package/styles/rich-text-editor/_material-definition.scss +2 -6
  129. package/styles/rich-text-editor/_material3-definition.scss +12 -16
  130. package/styles/rich-text-editor/_tailwind-definition.scss +19 -23
  131. package/styles/rich-text-editor/_theme.scss +23 -112
  132. package/styles/rich-text-editor/bootstrap-dark.css +53 -161
  133. package/styles/rich-text-editor/bootstrap.css +61 -162
  134. package/styles/rich-text-editor/bootstrap4.css +46 -146
  135. package/styles/rich-text-editor/bootstrap5-dark.css +46 -151
  136. package/styles/rich-text-editor/bootstrap5.css +46 -151
  137. package/styles/rich-text-editor/fabric-dark.css +40 -140
  138. package/styles/rich-text-editor/fabric.css +41 -141
  139. package/styles/rich-text-editor/fluent-dark.css +47 -165
  140. package/styles/rich-text-editor/fluent.css +47 -165
  141. package/styles/rich-text-editor/highcontrast-light.css +40 -140
  142. package/styles/rich-text-editor/highcontrast.css +41 -144
  143. package/styles/rich-text-editor/icons/_bootstrap-dark.scss +2 -2
  144. package/styles/rich-text-editor/icons/_bootstrap.scss +2 -2
  145. package/styles/rich-text-editor/icons/_bootstrap4.scss +2 -2
  146. package/styles/rich-text-editor/icons/_bootstrap5.scss +2 -2
  147. package/styles/rich-text-editor/icons/_fabric-dark.scss +2 -2
  148. package/styles/rich-text-editor/icons/_fabric.scss +2 -2
  149. package/styles/rich-text-editor/icons/_fluent.scss +2 -2
  150. package/styles/rich-text-editor/icons/_highcontrast-light.scss +2 -2
  151. package/styles/rich-text-editor/icons/_highcontrast.scss +2 -2
  152. package/styles/rich-text-editor/icons/_material-dark.scss +2 -2
  153. package/styles/rich-text-editor/icons/_material.scss +2 -2
  154. package/styles/rich-text-editor/icons/_material3.scss +2 -2
  155. package/styles/rich-text-editor/icons/_tailwind.scss +2 -2
  156. package/styles/rich-text-editor/material-dark.css +41 -145
  157. package/styles/rich-text-editor/material.css +41 -145
  158. package/styles/rich-text-editor/material3-dark.css +50 -156
  159. package/styles/rich-text-editor/material3.css +50 -156
  160. package/styles/rich-text-editor/tailwind-dark.css +63 -191
  161. package/styles/rich-text-editor/tailwind.css +63 -191
  162. package/styles/tailwind-dark.css +63 -191
  163. package/styles/tailwind.css +63 -191
  164. package/.eslintrc.json +0 -260
  165. package/src/global.d.ts +0 -1
  166. package/styles/rich-text-editor/_bds-definition.scss +0 -279
  167. package/styles/rich-text-editor/icons/_bds.scss +0 -348
@@ -28,7 +28,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
28
28
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
29
29
  return c > 3 && r && Object.defineProperty(target, key, r), r;
30
30
  };
31
- import { Component, EventHandler, Complex, Browser, addClass, detach } from '@syncfusion/ej2-base';
31
+ import { Component, EventHandler, Complex, Browser, addClass, select, detach } from '@syncfusion/ej2-base';
32
32
  import { Property, NotifyPropertyChanges, formatUnit, L10n, closest } from '@syncfusion/ej2-base';
33
33
  import { setStyleAttribute, Event, removeClass, print as printWindow, attributes } from '@syncfusion/ej2-base';
34
34
  import { isNullOrUndefined as isNOU, compile, append, extend, debounce } from '@syncfusion/ej2-base';
@@ -97,14 +97,6 @@ var RichTextEditor = /** @class */ (function (_super) {
97
97
  member: 'image',
98
98
  args: [this, this.serviceLocator]
99
99
  });
100
- modules.push({
101
- member: 'audio',
102
- args: [this, this.serviceLocator]
103
- });
104
- modules.push({
105
- member: 'video',
106
- args: [this, this.serviceLocator]
107
- });
108
100
  if (this.quickToolbarSettings.enable) {
109
101
  modules.push({ member: 'quickToolbar', args: [this, this.serviceLocator] });
110
102
  }
@@ -118,6 +110,14 @@ var RichTextEditor = /** @class */ (function (_super) {
118
110
  if (this.editorMode === 'HTML') {
119
111
  modules.push({ member: 'htmlEditor', args: [this, this.serviceLocator] });
120
112
  modules.push({ member: 'pasteCleanup', args: [this, this.serviceLocator] });
113
+ modules.push({
114
+ member: 'audio',
115
+ args: [this, this.serviceLocator]
116
+ });
117
+ modules.push({
118
+ member: 'video',
119
+ args: [this, this.serviceLocator]
120
+ });
121
121
  modules.push({
122
122
  member: 'formatPainter',
123
123
  args: [this]
@@ -149,7 +149,7 @@ var RichTextEditor = /** @class */ (function (_super) {
149
149
  else {
150
150
  if (this.getToolbar()) {
151
151
  removeClass(this.getToolbar().querySelectorAll('.' + classes.CLS_ACTIVE), classes.CLS_ACTIVE);
152
- removeClass([this.getToolbar().parentElement], [classes.CLS_TB_FLOAT]);
152
+ removeClass([this.getToolbar()], [classes.CLS_TB_FLOAT, classes.CLS_TB_ABS_FLOAT]);
153
153
  }
154
154
  addClass([this.element], classes.CLS_DISABLED);
155
155
  this.element.tabIndex = -1;
@@ -390,7 +390,7 @@ var RichTextEditor = /** @class */ (function (_super) {
390
390
  if (tool.command === 'InsertText') {
391
391
  currentInsertContentLength = value.length;
392
392
  }
393
- var currentLength = this.getText().trim().replace(/(\r\n|\n|\r|\t)/gm, '').replace(/\u200B/g, '').length;
393
+ var currentLength = this.getText().trim().replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length;
394
394
  var selectionLength = this.getSelection().length;
395
395
  var totalLength = (currentLength - selectionLength) + currentInsertContentLength;
396
396
  if (!(this.maxLength === -1 || totalLength <= this.maxLength)) {
@@ -551,7 +551,6 @@ var RichTextEditor = /** @class */ (function (_super) {
551
551
  * @deprecated
552
552
  */
553
553
  RichTextEditor.prototype.render = function () {
554
- this.value = (!(this.editorMode === 'Markdown') && !isNOU(this.value)) ? this.addAnchorAriaLabel(this.value) : this.value;
555
554
  if (this.value && !this.valueTemplate) {
556
555
  this.setProperties({ value: this.serializeValue(this.value) }, true);
557
556
  }
@@ -570,7 +569,7 @@ var RichTextEditor = /** @class */ (function (_super) {
570
569
  (this.toolbarSettings.items.indexOf('Undo') > -1 && this.toolbarSettings.items.indexOf('Redo') > -1)) {
571
570
  this.disableToolbarItem(['Undo', 'Redo']);
572
571
  }
573
- this.setContentHeight('Init');
572
+ this.setContentHeight();
574
573
  if (this.value !== null) {
575
574
  this.valueContainer.defaultValue = this.value;
576
575
  }
@@ -755,9 +754,9 @@ var RichTextEditor = /** @class */ (function (_super) {
755
754
  !(e.altKey || e.shiftKey || (e.altKey && e.shiftKey && e.which == 67))) {
756
755
  this.formatter.saveData();
757
756
  }
758
- var keyboardEventAction = ['insert-link', 'format-copy', 'format-paste', 'insert-image', 'insert-table', 'insert-audio', 'insert-video'];
759
- if (keyboardEventAction.indexOf(e.action) === -1 &&
760
- (!e.target || !(e.target.classList.contains('e-mention') && !isNOU(document.querySelector('#' + e.target.id + '_popup.e-popup-open')) && e.code === 'Tab')) &&
757
+ if (e.action !== 'insert-link' &&
758
+ e.action !== 'format-copy' && e.action !== 'format-paste' &&
759
+ (!e.target || !(e.target.classList.contains('e-mention') && e.code === 'Tab')) &&
761
760
  (e.action && e.action !== 'paste' && e.action !== 'space'
762
761
  || e.which === 9 || (e.code === 'Backspace' && e.which === 8))) {
763
762
  var FormatPainterEscapeAction = false;
@@ -765,26 +764,14 @@ var RichTextEditor = /** @class */ (function (_super) {
765
764
  FormatPainterEscapeAction = this.formatPainterModule.previousAction === 'escape';
766
765
  }
767
766
  if (!FormatPainterEscapeAction) {
768
- if (this.editorMode === 'HTML' && (e.action === 'increase-fontsize' || e.action === 'decrease-fontsize')) {
769
- this.notify(events.onHandleFontsizeChange, { member: 'onHandleFontsizeChange', args: e });
770
- }
771
- else {
772
- this.formatter.process(this, null, e);
773
- }
767
+ this.formatter.process(this, null, e);
774
768
  }
775
769
  switch (e.action) {
776
770
  case 'toolbar-focus':
777
771
  if (this.toolbarSettings.enable && this.getToolbarElement()) {
778
772
  var firstActiveItem = this.getToolbarElement().querySelector('.e-toolbar-item:not(.e-overlay)[title]');
779
- var quickToolbarElem = this.getRenderedQuickToolbarElem();
780
- if (quickToolbarElem) {
781
- firstActiveItem = quickToolbarElem.querySelector('.e-toolbar-item:not(.e-overlay)[title]');
782
- }
783
- if (firstActiveItem) {
784
- var firstChild = firstActiveItem.firstElementChild;
785
- firstChild.removeAttribute('tabindex');
786
- firstChild.focus();
787
- }
773
+ firstActiveItem.firstElementChild.removeAttribute('tabindex');
774
+ firstActiveItem.firstElementChild.focus();
788
775
  }
789
776
  break;
790
777
  case 'escape':
@@ -803,22 +790,11 @@ var RichTextEditor = /** @class */ (function (_super) {
803
790
  this.setPlaceHolder();
804
791
  }
805
792
  }
806
- this.notify(events.afterKeyDown, { member: 'afterKeyDown', args: e });
807
793
  this.autoResize();
808
794
  };
809
795
  RichTextEditor.prototype.keyUp = function (e) {
810
796
  if (this.editorMode === 'HTML') {
811
797
  var range = this.getRange();
812
- if (!isNOU(e) && !isNOU(e.code) && (e.code === 'Backspace' || e.code === 'Delete')) {
813
- // To prevent the reformatting the content removed browser behavior.
814
- var currentRange = this.getRange();
815
- var selection = this.iframeSettings.enable ? this.contentModule.getPanel().ownerDocument.getSelection() :
816
- this.contentModule.getDocument().getSelection();
817
- if (selection.rangeCount > 0) {
818
- selection.removeAllRanges();
819
- selection.addRange(currentRange);
820
- }
821
- }
822
798
  if (Browser.userAgent.indexOf('Firefox') !== -1 && range.startContainer.nodeName === '#text' &&
823
799
  range.startContainer.parentElement === this.inputElement && this.enterKey !== 'BR') {
824
800
  var range_1 = this.getRange();
@@ -840,7 +816,7 @@ var RichTextEditor = /** @class */ (function (_super) {
840
816
  var formatPainterCopy = e.key === 'C' && e.altKey && e.shiftKey;
841
817
  var formatPainterPaste = e.key === 'V' && e.altKey && e.shiftKey;
842
818
  if ((!formatPainterCopy && !formatPainterPaste) && ((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys) || (this.editorMode === 'Markdown'
843
- && ((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys)) || (this.autoSaveOnIdle && Browser.isDevice) && !this.inlineMode.enable) {
819
+ && ((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys)) && !this.inlineMode.enable) {
844
820
  this.formatter.onKeyHandler(this, e);
845
821
  }
846
822
  if (this.inputElement && this.inputElement.textContent.length !== 0
@@ -918,14 +894,11 @@ var RichTextEditor = /** @class */ (function (_super) {
918
894
  clientX: touch.clientX, clientY: touch.clientY }
919
895
  });
920
896
  if (this.inputElement && ((this.editorMode === 'HTML' && this.inputElement.textContent.length !== 0) ||
921
- (this.editorMode === 'Markdown' && this.inputElement.value.length !== 0)) ||
922
- (e.target && !isNOU(closest(e.target, 'table'))) ||
923
- (e.target && (e.target.nodeName === 'VIDEO' ||
924
- e.target.querySelectorAll('.' + classes.CLS_VIDEOWRAP).length > 0) ||
925
- (e.target && e.target.nodeName !== 'BR' &&
926
- (e.target.classList.contains(classes.CLS_AUDIOWRAP) ||
927
- e.target.classList.contains(classes.CLS_CLICKELEM) ||
928
- e.target.classList.contains(classes.CLS_VID_CLICK_ELEM))))) {
897
+ (this.editorMode === 'Markdown' && this.inputElement.value.length !== 0)) || (e.target && (e.target.nodeName === 'VIDEO'
898
+ || e.target.querySelectorAll('.' + classes.CLS_VIDEOWRAP).length > 0) || (e.target && e.target.nodeName !== 'BR' &&
899
+ (e.target.classList.contains(classes.CLS_AUDIOWRAP) ||
900
+ e.target.classList.contains(classes.CLS_CLICKELEM) ||
901
+ e.target.classList.contains(classes.CLS_VID_CLICK_ELEM))))) {
929
902
  this.notify(events.toolbarRefresh, { args: e });
930
903
  }
931
904
  this.triggerEditArea(e);
@@ -939,6 +912,60 @@ var RichTextEditor = /** @class */ (function (_super) {
939
912
  return;
940
913
  }
941
914
  }
915
+ if (e.detail === 3) {
916
+ var range = this.getRange();
917
+ var selection = this.formatter.editorManager.domNode.getSelection();
918
+ // To handle the triple click node selection improper range due to browser behavior.
919
+ if (selection.rangeCount > 0 && !isNOU(range.startContainer.parentElement) && (!isNOU(range.startContainer.parentElement.nextSibling) &&
920
+ (range.startContainer.parentElement.nextSibling.nodeType !== 3 ||
921
+ /\s+$/.test(range.startContainer.parentElement.nextSibling.textContent)) || range.startOffset === range.endOffset)
922
+ || range.startContainer.parentElement.tagName.toLocaleLowerCase() === 'li') {
923
+ var newRange = new Range();
924
+ var start = range.startContainer;
925
+ var end = range.endContainer;
926
+ var isInvalid = false;
927
+ var isInsideList = range.commonAncestorContainer.nodeName === 'OL' || range.commonAncestorContainer.nodeName === 'UL'
928
+ || range.commonAncestorContainer.nodeName === 'LI';
929
+ if (!isInsideList && end.nodeType === 1 && end.nodeName === 'LI') {
930
+ end = closest(end, 'ol, ul').previousElementSibling.lastElementChild;
931
+ }
932
+ else if (isInsideList && end.nodeType === 1 && range.endOffset === 0) {
933
+ if (end.previousElementSibling && end.previousElementSibling.lastElementChild) {
934
+ end = end.previousElementSibling.lastElementChild;
935
+ }
936
+ else {
937
+ end = closest(end.parentElement, 'li');
938
+ if (end && end.nodeName === 'LI') {
939
+ end = end.previousElementSibling;
940
+ }
941
+ }
942
+ }
943
+ else {
944
+ if (!closest(end, 'li') && end.previousElementSibling && end.previousElementSibling.lastChild &&
945
+ end.previousElementSibling.textContent.trim().length > 0) {
946
+ end = end.previousElementSibling.lastChild;
947
+ }
948
+ else if (closest(end, 'li') && end.previousElementSibling && end.previousElementSibling.lastChild) {
949
+ end = closest(end, 'li').parentElement.previousElementSibling.lastChild;
950
+ }
951
+ }
952
+ if (!end || end === this.inputElement) {
953
+ end = start;
954
+ isInvalid = true;
955
+ }
956
+ while (end.nodeName !== '#text' && !isInvalid) {
957
+ if (end.lastElementChild) {
958
+ end = end.lastElementChild;
959
+ }
960
+ else {
961
+ end = end.lastChild;
962
+ }
963
+ }
964
+ newRange.setStart(start, 0);
965
+ newRange.setEnd(end, end.textContent.length);
966
+ this.formatter.editorManager.nodeSelection.setRange(this.contentModule.getDocument(), newRange);
967
+ }
968
+ }
942
969
  this.notifyMouseUp(e);
943
970
  };
944
971
  /**
@@ -980,10 +1007,10 @@ var RichTextEditor = /** @class */ (function (_super) {
980
1007
  requestType: 'Paste'
981
1008
  };
982
1009
  this.trigger(events.actionBegin, evenArgs, function (pasteArgs) {
983
- var currentLength = _this.getText().replace(/(\r\n|\n|\r|\t)/gm, '').replace(/\u200B/g, '').length;
1010
+ var currentLength = _this.inputElement.textContent.length;
984
1011
  var selectionLength = _this.getSelection().length;
985
1012
  var pastedContentLength = (isNOU(e) || isNOU(e.clipboardData))
986
- ? 0 : e.clipboardData.getData('text/plain').replace(/(\r\n|\n|\r|\t)/gm, '').replace(/\u200B/g, '').length;
1013
+ ? 0 : e.clipboardData.getData('text/plain').replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length;
987
1014
  var totalLength = (currentLength - selectionLength) + pastedContentLength;
988
1015
  if (_this.editorMode === 'Markdown') {
989
1016
  var args_1 = { requestType: 'Paste', editorMode: _this.editorMode, event: e };
@@ -1001,7 +1028,6 @@ var RichTextEditor = /** @class */ (function (_super) {
1001
1028
  _this.notify(events.pasteClean, { args: e });
1002
1029
  }
1003
1030
  else {
1004
- console.warn('[WARNING] :: Module "pasteCleanup" is not available in RichTextEditor component! You either misspelled the module name or forgot to load it.');
1005
1031
  var args_2 = { requestType: 'Paste', editorMode: _this.editorMode, event: e };
1006
1032
  var value = null;
1007
1033
  var htmlValue = false;
@@ -1296,7 +1322,7 @@ var RichTextEditor = /** @class */ (function (_super) {
1296
1322
  break;
1297
1323
  case 'height':
1298
1324
  this.setHeight(newProp[prop]);
1299
- this.setContentHeight('Init');
1325
+ this.setContentHeight();
1300
1326
  this.autoResize();
1301
1327
  break;
1302
1328
  case 'readonly':
@@ -1343,11 +1369,11 @@ var RichTextEditor = /** @class */ (function (_super) {
1343
1369
  break;
1344
1370
  case 'inlineMode':
1345
1371
  this.notify(events.modelChanged, { module: 'quickToolbar', newProp: newProp, oldProp: oldProp });
1346
- this.setContentHeight('Init');
1372
+ this.setContentHeight();
1347
1373
  break;
1348
1374
  case 'toolbarSettings':
1349
1375
  this.notify(events.modelChanged, { module: 'toolbar', newProp: newProp, oldProp: oldProp });
1350
- this.setContentHeight('Init');
1376
+ this.setContentHeight();
1351
1377
  break;
1352
1378
  case 'maxLength':
1353
1379
  if (this.showCharCount) {
@@ -1424,7 +1450,7 @@ var RichTextEditor = /** @class */ (function (_super) {
1424
1450
  if (this.valueContainer) {
1425
1451
  this.valueContainer.value = (this.enableHtmlEncode) ? this.value : value;
1426
1452
  }
1427
- if (this.editorMode === 'HTML' && this.inputElement && this.inputElement.innerHTML.trim() !== value.trim()) {
1453
+ if (this.editorMode === 'HTML' && this.inputElement && this.inputElement.innerHTML.replace('&amp;', '&').trim() !== value.trim()) {
1428
1454
  this.inputElement.innerHTML = value;
1429
1455
  }
1430
1456
  else if (this.editorMode === 'Markdown' && this.inputElement
@@ -1445,6 +1471,9 @@ var RichTextEditor = /** @class */ (function (_super) {
1445
1471
  }
1446
1472
  else {
1447
1473
  this.inputElement.innerHTML = '<p><br/></p>';
1474
+ if (value === '' && this.formatter && this.inputElement) {
1475
+ this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), this.inputElement.firstElementChild, this.inputElement.firstElementChild.childElementCount);
1476
+ }
1448
1477
  }
1449
1478
  }
1450
1479
  else {
@@ -1506,7 +1535,7 @@ var RichTextEditor = /** @class */ (function (_super) {
1506
1535
  this.inputElement.setAttribute('placeholder', this.placeholder);
1507
1536
  }
1508
1537
  }
1509
- if (this.placeholder && this.iframeSettings.enable && this.inputElement) {
1538
+ if (this.placeholder && this.iframeSettings.enable) {
1510
1539
  if (this.inputElement.textContent.length === 0 && this.inputElement.childNodes.length < 2 && !isNOU(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
1511
1540
  ((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNOU(this.inputElement.firstChild.firstChild) &&
1512
1541
  this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
@@ -1693,10 +1722,10 @@ var RichTextEditor = /** @class */ (function (_super) {
1693
1722
  if (this.iframeSettings.resources) {
1694
1723
  var styleSrc = this.iframeSettings.resources.styles;
1695
1724
  var scriptSrc = this.iframeSettings.resources.scripts;
1696
- if (!isNOU(this.iframeSettings.resources.scripts) && this.iframeSettings.resources.scripts.length > 0) {
1725
+ if (this.iframeSettings.resources.scripts.length > 0) {
1697
1726
  this.InjectSheet(true, scriptSrc);
1698
1727
  }
1699
- if (!isNOU(this.iframeSettings.resources.styles) && this.iframeSettings.resources.styles.length > 0) {
1728
+ if (this.iframeSettings.resources.styles.length > 0) {
1700
1729
  this.InjectSheet(false, styleSrc);
1701
1730
  }
1702
1731
  }
@@ -1810,13 +1839,6 @@ var RichTextEditor = /** @class */ (function (_super) {
1810
1839
  var imgPadding = 12;
1811
1840
  var imgResizeBorder = 2;
1812
1841
  var editEle = this.contentModule.getEditPanel();
1813
- if (this.editorMode === "HTML" && !isNOU(this.formatter.editorManager.nodeSelection) && !isNOU(this.formatter.editorManager.nodeSelection.range)) {
1814
- var currentRange = this.formatter.editorManager.nodeSelection.range;
1815
- if (currentRange.startContainer.nodeType !== 3 && currentRange.startContainer.closest &&
1816
- !isNOU(currentRange.startContainer.closest('TD'))) {
1817
- editEle = currentRange.startContainer;
1818
- }
1819
- }
1820
1842
  var eleStyle = window.getComputedStyle(editEle);
1821
1843
  var editEleMaxWidth = editEle.offsetWidth - (imgPadding + imgResizeBorder +
1822
1844
  parseFloat(eleStyle.paddingLeft.split('px')[0]) + parseFloat(eleStyle.paddingRight.split('px')[0]) +
@@ -1853,9 +1875,12 @@ var RichTextEditor = /** @class */ (function (_super) {
1853
1875
  */
1854
1876
  RichTextEditor.prototype.setContentHeight = function (target, isExpand) {
1855
1877
  var heightValue;
1878
+ var topValue = 0;
1856
1879
  var rteHeightPercent;
1857
1880
  var heightPercent = typeof (this.height) === 'string' && this.height.indexOf('%') > -1;
1858
- var cntEle = this.contentModule.getPanel();
1881
+ var cntEle = (this.sourceCodeModule.getPanel() &&
1882
+ this.sourceCodeModule.getPanel().parentElement.style.display === 'block') ? this.sourceCodeModule.getPanel().parentElement :
1883
+ this.contentModule.getPanel();
1859
1884
  var rteHeight = this.element.offsetHeight;
1860
1885
  if (rteHeight === 0 && this.height !== 'auto' && !this.getToolbar()) {
1861
1886
  rteHeight = parseInt(this.height, 10);
@@ -1867,36 +1892,39 @@ var RichTextEditor = /** @class */ (function (_super) {
1867
1892
  var rzHandle = this.element.querySelector('.' + classes.CLS_RTE_RES_HANDLE);
1868
1893
  var rzHeight = this.enableResize ? (!isNOU(rzHandle) ? (rzHandle.offsetHeight + 8) : 0) : 0;
1869
1894
  var expandPopHeight = this.getToolbar() ? this.toolbarModule.getExpandTBarPopHeight() : 0;
1870
- if (target && target !== 'Toolbar' && expandPopHeight && this.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0) {
1871
- tbHeight = tbHeight - expandPopHeight;
1895
+ if (this.toolbarSettings.type === ToolbarType.Expand && isExpand) {
1896
+ heightValue = (this.height === 'auto' && rzHeight === 0) ? 'auto' : rteHeight - (tbHeight + expandPopHeight + rzHeight) + 'px';
1897
+ topValue = (!this.toolbarSettings.enableFloating) ? expandPopHeight : 0;
1872
1898
  }
1873
- if (this.toolbarSettings.type === ToolbarType.Expand) {
1874
- if (isExpand) {
1875
- heightValue = (this.height === 'auto' && this.element.style.height === 'auto') ? 'auto' : rteHeight - (tbHeight + expandPopHeight + rzHeight) + 'px';
1899
+ else {
1900
+ if (this.height === 'auto' && !(this.element.classList.contains('e-rte-full-screen')) && !this.isResizeInitialized) {
1901
+ heightValue = 'auto';
1876
1902
  }
1877
1903
  else {
1878
- heightValue = (this.height === 'auto' && this.element.style.height === 'auto') ? 'auto' : rteHeight - (tbHeight - expandPopHeight + rzHeight) + 'px';
1904
+ heightValue = heightPercent && rteHeightPercent ? rteHeightPercent : rteHeight - (tbHeight + rzHeight) + 'px';
1879
1905
  }
1880
1906
  }
1881
- else {
1882
- heightValue = (this.height === 'auto' && this.element.style.height === 'auto') ? 'auto' : rteHeight - tbHeight + 'px';
1883
- }
1884
- var finalHeight = heightPercent && rteHeightPercent ? rteHeightPercent : heightValue;
1885
- switch (target) {
1886
- case 'Init':
1887
- case 'Toolbar':
1888
- case 'WindowResize':
1889
- case 'Refresh':
1890
- if (this.element.querySelectorAll('.e-source-content').length > 0 && this.element.querySelector('.e-source-content').style.display === 'block') {
1891
- setStyleAttribute(this.element.querySelector('.e-source-content'), { height: finalHeight });
1907
+ if (target !== 'windowResize' || heightPercent) {
1908
+ if (this.iframeSettings.enable) {
1909
+ if (heightValue !== 'auto') {
1910
+ setStyleAttribute(cntEle, { height: heightValue, marginTop: topValue + 'px' });
1892
1911
  }
1893
- else {
1894
- setStyleAttribute(cntEle, { height: finalHeight });
1912
+ }
1913
+ else {
1914
+ if (target === 'windowResize' && heightPercent) {
1915
+ //cntEle hide the borderBottom of RichTextEditor. so removed the 2px of cntEle height.
1916
+ heightValue = parseInt(heightValue, 10) - 2 + 'px';
1895
1917
  }
1896
- break;
1897
- case 'Resize':
1898
- setStyleAttribute(cntEle, { height: finalHeight });
1899
- break;
1918
+ setStyleAttribute(cntEle, { height: heightValue, marginTop: topValue + 'px' });
1919
+ }
1920
+ }
1921
+ if (this.iframeSettings.enable && target === 'sourceCode') {
1922
+ var codeElement = select('.' + classes.CLS_RTE_CONTENT, this.element);
1923
+ setStyleAttribute(codeElement, { height: heightValue, marginTop: topValue + 'px' });
1924
+ }
1925
+ if (this.toolbarSettings.enableFloating && this.getToolbar() && !this.inlineMode.enable) {
1926
+ var tbWrapHeight = (isExpand ? (tbHeight + expandPopHeight) : tbHeight) + 'px';
1927
+ setStyleAttribute(this.getToolbar().parentElement, { height: tbWrapHeight });
1900
1928
  }
1901
1929
  if (rzHeight === 0) {
1902
1930
  this.autoResize();
@@ -2060,7 +2088,6 @@ var RichTextEditor = /** @class */ (function (_super) {
2060
2088
  addClass([this.element], [classes.CLS_FOCUS]);
2061
2089
  this.preventDefaultResize(e);
2062
2090
  this.notify(events.mouseDown, { args: e });
2063
- this.formatter.editorManager.observer.notify(events.mouseDown, { args: e });
2064
2091
  this.clickPoints = { clientX: touch.clientX, clientY: touch.clientY };
2065
2092
  };
2066
2093
  RichTextEditor.prototype.preventImgResize = function (e) {
@@ -2099,14 +2126,18 @@ var RichTextEditor = /** @class */ (function (_super) {
2099
2126
  RichTextEditor.prototype.resizeHandler = function () {
2100
2127
  var isExpand = false;
2101
2128
  if (!document.body.contains(this.element)) {
2102
- document.defaultView.removeEventListener('resize', debounce(this.onResizeHandler, 10), true);
2129
+ document.defaultView.removeEventListener('resize', this.onResizeHandler, true);
2103
2130
  return;
2104
2131
  }
2105
2132
  if (this.toolbarSettings.enable && !this.inlineMode.enable) {
2106
2133
  this.toolbarModule.refreshToolbarOverflow();
2107
2134
  isExpand = this.toolbarModule.baseToolbar.toolbarObj.element.classList.contains(classes.CLS_EXPAND_OPEN);
2108
2135
  }
2109
- this.setContentHeight('WindowResize', isExpand);
2136
+ if (this.iframeSettings.enable !== true) {
2137
+ // When resize the window,border bottom of cntEle and this.element border visible separatly.so none the cntEle borderBottom.
2138
+ this.contentModule.getPanel().style.borderBottom = 'none';
2139
+ }
2140
+ this.setContentHeight('windowResize', isExpand);
2110
2141
  this.notify(events.windowResize, null);
2111
2142
  };
2112
2143
  RichTextEditor.prototype.scrollHandler = function (e) {
@@ -2196,18 +2227,7 @@ var RichTextEditor = /** @class */ (function (_super) {
2196
2227
  };
2197
2228
  RichTextEditor.prototype.cleanupResizeElements = function (args) {
2198
2229
  var value = this.removeResizeElement(args.value);
2199
- args.callBack(value);
2200
- };
2201
- RichTextEditor.prototype.addAnchorAriaLabel = function (value) {
2202
- var valueElementWrapper = document.createElement("div");
2203
- valueElementWrapper.innerHTML = value;
2204
- var item = valueElementWrapper.querySelectorAll("a");
2205
- if (item.length > 0) {
2206
- for (var i = 0; i < item.length; i++) {
2207
- (item[i].hasAttribute("target") && item[i].getAttribute("target") === '_blank') ? item[i].setAttribute("aria-label", this.serviceLocator.getService('rteLocale').getConstant("linkAriaLabel")) : item[i];
2208
- }
2209
- }
2210
- return valueElementWrapper.innerHTML;
2230
+ return value;
2211
2231
  };
2212
2232
  RichTextEditor.prototype.removeResizeElement = function (value) {
2213
2233
  var valueElementWrapper = document.createElement("div");
@@ -2218,7 +2238,6 @@ var RichTextEditor = /** @class */ (function (_super) {
2218
2238
  detach(item[i]);
2219
2239
  }
2220
2240
  }
2221
- this.removeSelectionClassStates(valueElementWrapper);
2222
2241
  return valueElementWrapper.innerHTML;
2223
2242
  };
2224
2243
  RichTextEditor.prototype.updateStatus = function (e) {
@@ -2242,10 +2261,6 @@ var RichTextEditor = /** @class */ (function (_super) {
2242
2261
  this.isRTE = false;
2243
2262
  }
2244
2263
  this.notify(events.docClick, { args: e });
2245
- var hideQuickToolbarChecker = this.quickToolbarModule && !this.inlineMode.enable && isNOU(this.quickToolbarModule.inlineQTBar);
2246
- if ((hideQuickToolbarChecker && !isNOU(closest(target, '.' + 'e-toolbar-wrapper'))) || (hideQuickToolbarChecker && (!isNOU(closest(target, '.e-rte-table-resize')) || !isNOU(closest(target, '.e-table-box'))))) {
2247
- this.quickToolbarModule.hideQuickToolbars();
2248
- }
2249
2264
  if (Browser.info.name !== 'msie' && e.detail > 3) {
2250
2265
  e.preventDefault();
2251
2266
  }
@@ -2254,12 +2269,6 @@ var RichTextEditor = /** @class */ (function (_super) {
2254
2269
  var trg = e.relatedTarget;
2255
2270
  if (trg) {
2256
2271
  var rteElement = closest(trg, '.' + classes.CLS_RTE);
2257
- if (!rteElement && this.iframeSettings.enable) {
2258
- var iframeElement = this.element.querySelector('#' + this.getID() + '_rte-view');
2259
- if (iframeElement && iframeElement.contentWindow.document.body.contains(trg)) {
2260
- rteElement = closest(iframeElement, '.' + classes.CLS_RTE);
2261
- }
2262
- }
2263
2272
  if (rteElement && rteElement === this.element) {
2264
2273
  this.isBlur = false;
2265
2274
  if (trg === this.getToolbarElement()) {
@@ -2276,7 +2285,6 @@ var RichTextEditor = /** @class */ (function (_super) {
2276
2285
  }
2277
2286
  if (this.isBlur && isNOU(trg)) {
2278
2287
  removeClass([this.element], [classes.CLS_FOCUS]);
2279
- this.removeSelectionClassStates(this.inputElement);
2280
2288
  this.notify(events.focusChange, {});
2281
2289
  var value = this.getUpdatedValue();
2282
2290
  this.setProperties({ value: value });
@@ -2395,10 +2403,9 @@ var RichTextEditor = /** @class */ (function (_super) {
2395
2403
  this.triggerEditArea(e.originalEvent);
2396
2404
  };
2397
2405
  RichTextEditor.prototype.contextHandler = function (e) {
2398
- var closestElem = closest(e.target, 'a, table, img, video, audio');
2406
+ var closestElem = closest(e.target, 'a, table, img');
2399
2407
  if (this.inlineMode.onSelection === false || (!isNOU(closestElem) && this.inputElement.contains(closestElem)
2400
- && (closestElem.tagName === 'IMG' || closestElem.tagName === 'TABLE' || closestElem.tagName === 'A' ||
2401
- closestElem.tagName.toLowerCase() === 'video' || closestElem.tagName.toLowerCase() === 'audio'))) {
2408
+ && (closestElem.tagName === 'IMG' || closestElem.tagName === 'TABLE' || closestElem.tagName === 'A'))) {
2402
2409
  e.preventDefault();
2403
2410
  }
2404
2411
  };
@@ -2444,7 +2451,6 @@ var RichTextEditor = /** @class */ (function (_super) {
2444
2451
  this.on(events.resizeInitialized, this.updateResizeFlag, this);
2445
2452
  this.on(events.updateTbItemsStatus, this.updateStatus, this);
2446
2453
  this.on(events.cleanupResizeElements, this.cleanupResizeElements, this);
2447
- this.on(events.updateValueOnIdle, this.updateValueOnIdle, this);
2448
2454
  if (this.readonly && this.enabled) {
2449
2455
  return;
2450
2456
  }
@@ -2453,7 +2459,7 @@ var RichTextEditor = /** @class */ (function (_super) {
2453
2459
  RichTextEditor.prototype.restrict = function (e) {
2454
2460
  if (this.maxLength >= 0) {
2455
2461
  var element = this.editorMode === 'Markdown' ? this.contentModule.getText() :
2456
- (this.getText().replace(/(\r\n|\n|\r|\t)/gm, '').replace(/\u200B/g, ''));
2462
+ (e && e.currentTarget.textContent);
2457
2463
  if (!element) {
2458
2464
  return;
2459
2465
  }
@@ -2485,12 +2491,11 @@ var RichTextEditor = /** @class */ (function (_super) {
2485
2491
  }
2486
2492
  EventHandler.add(this.inputElement, 'keyup', this.keyUp, this);
2487
2493
  EventHandler.add(this.inputElement, 'paste', this.onPaste, this);
2488
- EventHandler.add(this.inputElement, 'content-changed', this.contentChanged, this);
2489
2494
  EventHandler.add(this.inputElement, Browser.touchEndEvent, debounce(this.mouseUp, 30), this);
2490
2495
  EventHandler.add(this.inputElement, Browser.touchStartEvent, this.mouseDownHandler, this);
2491
2496
  this.wireContextEvent();
2492
2497
  this.formatter.editorManager.observer.on(CONSTANT.KEY_DOWN_HANDLER, this.editorKeyDown, this);
2493
- this.element.ownerDocument.defaultView.addEventListener('resize', debounce(this.onResizeHandler, 10), true);
2498
+ this.element.ownerDocument.defaultView.addEventListener('resize', this.onResizeHandler, true);
2494
2499
  if (this.iframeSettings.enable) {
2495
2500
  EventHandler.add(this.inputElement, 'focusin', this.focusHandler, this);
2496
2501
  EventHandler.add(this.inputElement, 'focusout', this.blurHandler, this);
@@ -2533,7 +2538,6 @@ var RichTextEditor = /** @class */ (function (_super) {
2533
2538
  this.off(events.resizeInitialized, this.updateResizeFlag);
2534
2539
  this.off(events.updateTbItemsStatus, this.updateStatus);
2535
2540
  this.off(events.cleanupResizeElements, this.cleanupResizeElements);
2536
- this.off(events.updateValueOnIdle, this.updateValueOnIdle);
2537
2541
  if (this.readonly && this.enabled) {
2538
2542
  return;
2539
2543
  }
@@ -2549,14 +2553,13 @@ var RichTextEditor = /** @class */ (function (_super) {
2549
2553
  }
2550
2554
  EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
2551
2555
  EventHandler.remove(this.inputElement, 'paste', this.onPaste);
2552
- EventHandler.remove(this.inputElement, 'content-changed', this.contentChanged);
2553
2556
  EventHandler.remove(this.inputElement, Browser.touchEndEvent, debounce(this.mouseUp, 30));
2554
2557
  EventHandler.remove(this.inputElement, Browser.touchStartEvent, this.mouseDownHandler);
2555
2558
  this.unWireContextEvent();
2556
2559
  if (this.formatter) {
2557
2560
  this.formatter.editorManager.observer.off(CONSTANT.KEY_DOWN_HANDLER, this.editorKeyDown);
2558
2561
  }
2559
- this.element.ownerDocument.defaultView.removeEventListener('resize', debounce(this.onResizeHandler, 10), true);
2562
+ this.element.ownerDocument.defaultView.removeEventListener('resize', this.onResizeHandler, true);
2560
2563
  if (this.iframeSettings.enable) {
2561
2564
  EventHandler.remove(this.inputElement, 'focusin', this.focusHandler);
2562
2565
  EventHandler.remove(this.inputElement, 'focusout', this.blurHandler);
@@ -2603,33 +2606,6 @@ var RichTextEditor = /** @class */ (function (_super) {
2603
2606
  }
2604
2607
  }
2605
2608
  };
2606
- RichTextEditor.prototype.removeSelectionClassStates = function (element) {
2607
- var classNames = [classes.CLS_IMG_FOCUS, classes.CLS_TABLE_SEL, classes.CLS_VID_FOCUS, classes.CLS_AUD_FOCUS];
2608
- for (var i = 0; i < classNames.length; i++) {
2609
- var item = element.querySelectorAll('.' + classNames[i]);
2610
- removeClass(item, classNames[i]);
2611
- if (item.length === 0) {
2612
- continue;
2613
- }
2614
- for (var j = 0; j < item.length; j++) {
2615
- if (item[j].classList.length === 0) {
2616
- item[j].removeAttribute('class');
2617
- }
2618
- if (item[j].nodeName === 'IMG' && item[j].style.outline !== '') {
2619
- item[j].style.outline = '';
2620
- }
2621
- }
2622
- }
2623
- };
2624
- RichTextEditor.prototype.getRenderedQuickToolbarElem = function () {
2625
- var quickToolbars = this.quickToolbarModule.getQuickToolbarInstance();
2626
- for (var i = 0; i < quickToolbars.length; i++) {
2627
- if (quickToolbars[i] && quickToolbars[i].isRendered) {
2628
- return quickToolbars[i].element;
2629
- }
2630
- }
2631
- return null;
2632
- };
2633
2609
  __decorate([
2634
2610
  Complex({}, ToolbarSettings)
2635
2611
  ], RichTextEditor.prototype, "toolbarSettings", void 0);
@@ -230,12 +230,7 @@ export function setToolbarStatus(e, isPopToolbar, self) {
230
230
  }
231
231
  case 'bulletFormatList':
232
232
  case 'numberFormatList': {
233
- if (value !== '') {
234
- addClass([e.tbElements[j]], [classes.CLS_ACTIVE]);
235
- }
236
- else {
237
- removeClass([e.tbElements[j]], [classes.CLS_ACTIVE]);
238
- }
233
+ removeClass([e.tbElements[j]], [classes.CLS_ACTIVE]);
239
234
  }
240
235
  }
241
236
  }
@@ -470,15 +465,11 @@ export function updateTextNode(value, rteObj) {
470
465
  }
471
466
  var imageElm = resultElm.querySelectorAll('img');
472
467
  for (var i = 0; i < imageElm.length; i++) {
473
- if (imageElm[i].classList.contains('e-rte-image-unsupported')) {
474
- continue; // Should not add the class if the image is Broken.
475
- }
476
468
  if (!imageElm[i].classList.contains(classes.CLS_RTE_IMAGE)) {
477
469
  imageElm[i].classList.add(classes.CLS_RTE_IMAGE);
478
470
  }
479
471
  if (!(imageElm[i].classList.contains(classes.CLS_IMGINLINE) ||
480
- imageElm[i].classList.contains(classes.CLS_IMGBREAK)) &&
481
- !(imageElm[i].classList.contains('e-imgleft') || imageElm[i].classList.contains('e-imgright') || imageElm[i].classList.contains('e-imgcenter'))) {
472
+ imageElm[i].classList.contains(classes.CLS_IMGBREAK))) {
482
473
  imageElm[i].classList.add(classes.CLS_IMGINLINE);
483
474
  }
484
475
  }