@syncfusion/ej2-richtexteditor 20.4.53 → 21.1.37

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 (133) hide show
  1. package/CHANGELOG.md +16 -2
  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 +1479 -576
  6. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  7. package/dist/es6/ej2-richtexteditor.es5.js +1516 -605
  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.js +3 -1
  14. package/src/common/constant.d.ts +6 -0
  15. package/src/common/constant.js +6 -0
  16. package/src/common/util.d.ts +1 -0
  17. package/src/common/util.js +1 -0
  18. package/src/editor-manager/base/editor-manager.d.ts +2 -0
  19. package/src/editor-manager/base/editor-manager.js +5 -0
  20. package/src/editor-manager/base/enum.d.ts +14 -0
  21. package/src/editor-manager/base/interface.d.ts +34 -0
  22. package/src/editor-manager/plugin/clearformat.js +13 -4
  23. package/src/editor-manager/plugin/format-painter-actions.d.ts +63 -0
  24. package/src/editor-manager/plugin/format-painter-actions.js +474 -0
  25. package/src/editor-manager/plugin/image.js +0 -1
  26. package/src/editor-manager/plugin/inserthtml.js +4 -2
  27. package/src/editor-manager/plugin/isformatted.js +1 -0
  28. package/src/editor-manager/plugin/link.js +0 -1
  29. package/src/editor-manager/plugin/lists.js +1 -1
  30. package/src/editor-manager/plugin/ms-word-clean-up.js +4 -4
  31. package/src/editor-manager/plugin/selection-commands.d.ts +4 -1
  32. package/src/editor-manager/plugin/selection-commands.js +70 -9
  33. package/src/editor-manager/plugin/video.js +2 -0
  34. package/src/editor-manager/plugin.d.ts +1 -0
  35. package/src/editor-manager/plugin.js +1 -0
  36. package/src/global.js +1 -1
  37. package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +1 -0
  38. package/src/rich-text-editor/actions/base-quick-toolbar.js +21 -1
  39. package/src/rich-text-editor/actions/base-toolbar.js +33 -10
  40. package/src/rich-text-editor/actions/enter-key.js +5 -10
  41. package/src/rich-text-editor/actions/format-painter.d.ts +24 -0
  42. package/src/rich-text-editor/actions/format-painter.js +142 -0
  43. package/src/rich-text-editor/actions/full-screen.js +0 -1
  44. package/src/rich-text-editor/actions/html-editor.d.ts +1 -0
  45. package/src/rich-text-editor/actions/html-editor.js +117 -97
  46. package/src/rich-text-editor/actions/toolbar.js +5 -0
  47. package/src/rich-text-editor/actions.d.ts +1 -0
  48. package/src/rich-text-editor/actions.js +1 -0
  49. package/src/rich-text-editor/base/constant.d.ts +10 -0
  50. package/src/rich-text-editor/base/constant.js +10 -0
  51. package/src/rich-text-editor/base/enum.d.ts +4 -0
  52. package/src/rich-text-editor/base/interface.d.ts +30 -3
  53. package/src/rich-text-editor/base/interface.js +12 -0
  54. package/src/rich-text-editor/base/rich-text-editor-model.d.ts +30 -4
  55. package/src/rich-text-editor/base/rich-text-editor.d.ts +35 -5
  56. package/src/rich-text-editor/base/rich-text-editor.js +40 -9
  57. package/src/rich-text-editor/base/util.js +2 -0
  58. package/src/rich-text-editor/formatter/formatter.js +22 -13
  59. package/src/rich-text-editor/formatter/html-formatter.d.ts +5 -3
  60. package/src/rich-text-editor/formatter/html-formatter.js +7 -5
  61. package/src/rich-text-editor/models/default-locale.js +4 -2
  62. package/src/rich-text-editor/models/items.d.ts +3 -0
  63. package/src/rich-text-editor/models/items.js +32 -0
  64. package/src/rich-text-editor/models/toolbar-settings-model.d.ts +29 -1
  65. package/src/rich-text-editor/models/toolbar-settings.d.ts +24 -1
  66. package/src/rich-text-editor/models/toolbar-settings.js +20 -0
  67. package/src/rich-text-editor/renderer/audio-module.js +6 -3
  68. package/src/rich-text-editor/renderer/image-module.js +11 -6
  69. package/src/rich-text-editor/renderer/link-module.js +2 -1
  70. package/src/rich-text-editor/renderer/table-module.js +18 -6
  71. package/src/rich-text-editor/renderer/toolbar-renderer.js +10 -1
  72. package/src/rich-text-editor/renderer/video-module.js +8 -5
  73. package/src/rich-text-editor/renderer/view-source.js +1 -1
  74. package/styles/bootstrap-dark.css +31 -1
  75. package/styles/bootstrap.css +31 -1
  76. package/styles/bootstrap4.css +31 -1
  77. package/styles/bootstrap5-dark.css +32 -2
  78. package/styles/bootstrap5.css +32 -2
  79. package/styles/fabric-dark.css +31 -1
  80. package/styles/fabric.css +31 -1
  81. package/styles/fluent-dark.css +34 -4
  82. package/styles/fluent.css +34 -4
  83. package/styles/highcontrast-light.css +31 -1
  84. package/styles/highcontrast.css +31 -1
  85. package/styles/material-dark.css +31 -1
  86. package/styles/material.css +31 -1
  87. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +25 -1
  88. package/styles/rich-text-editor/_bootstrap-definition.scss +25 -1
  89. package/styles/rich-text-editor/_bootstrap4-definition.scss +25 -1
  90. package/styles/rich-text-editor/_bootstrap5-definition.scss +28 -5
  91. package/styles/rich-text-editor/_fabric-dark-definition.scss +25 -1
  92. package/styles/rich-text-editor/_fabric-definition.scss +25 -1
  93. package/styles/rich-text-editor/_fluent-definition.scss +30 -7
  94. package/styles/rich-text-editor/_fusionnew-definition.scss +26 -3
  95. package/styles/rich-text-editor/_highcontrast-definition.scss +25 -1
  96. package/styles/rich-text-editor/_highcontrast-light-definition.scss +25 -1
  97. package/styles/rich-text-editor/_layout.scss +47 -15
  98. package/styles/rich-text-editor/_material-dark-definition.scss +26 -1
  99. package/styles/rich-text-editor/_material-definition.scss +25 -1
  100. package/styles/rich-text-editor/_tailwind-definition.scss +28 -5
  101. package/styles/rich-text-editor/_theme.scss +54 -6
  102. package/styles/rich-text-editor/bootstrap-dark.css +31 -1
  103. package/styles/rich-text-editor/bootstrap.css +31 -1
  104. package/styles/rich-text-editor/bootstrap4.css +31 -1
  105. package/styles/rich-text-editor/bootstrap5-dark.css +32 -2
  106. package/styles/rich-text-editor/bootstrap5.css +32 -2
  107. package/styles/rich-text-editor/fabric-dark.css +31 -1
  108. package/styles/rich-text-editor/fabric.css +31 -1
  109. package/styles/rich-text-editor/fluent-dark.css +34 -4
  110. package/styles/rich-text-editor/fluent.css +34 -4
  111. package/styles/rich-text-editor/highcontrast-light.css +31 -1
  112. package/styles/rich-text-editor/highcontrast.css +31 -1
  113. package/styles/rich-text-editor/icons/_bootstrap-dark.scss +8 -0
  114. package/styles/rich-text-editor/icons/_bootstrap.scss +8 -0
  115. package/styles/rich-text-editor/icons/_bootstrap4.scss +8 -0
  116. package/styles/rich-text-editor/icons/_bootstrap5.scss +8 -0
  117. package/styles/rich-text-editor/icons/_fabric-dark.scss +8 -0
  118. package/styles/rich-text-editor/icons/_fabric.scss +8 -0
  119. package/styles/rich-text-editor/icons/_fluent.scss +8 -0
  120. package/styles/rich-text-editor/icons/_fusionnew.scss +8 -0
  121. package/styles/rich-text-editor/icons/_highcontrast-light.scss +8 -0
  122. package/styles/rich-text-editor/icons/_highcontrast.scss +8 -0
  123. package/styles/rich-text-editor/icons/_material-dark.scss +8 -0
  124. package/styles/rich-text-editor/icons/_material.scss +8 -0
  125. package/styles/rich-text-editor/icons/_material3.scss +8 -0
  126. package/styles/rich-text-editor/icons/_tailwind.scss +8 -0
  127. package/styles/rich-text-editor/material-dark.css +31 -1
  128. package/styles/rich-text-editor/material.css +31 -1
  129. package/styles/rich-text-editor/tailwind-dark.css +31 -1
  130. package/styles/rich-text-editor/tailwind.css +31 -1
  131. package/styles/tailwind-dark.css +31 -1
  132. package/styles/tailwind.css +31 -1
  133. package/styles/rich-text-editor/_material3-definition.scss +0 -196
@@ -1,7 +1,7 @@
1
1
  import { Ajax, Base, Browser, ChildProperty, Complex, Component, Event, EventHandler, KeyboardEvents, L10n, NotifyPropertyChanges, Observer, Property, SanitizeHtmlHelper, Touch, addClass, append, attributes, closest, compile, createElement, debounce, detach, extend, formatUnit, getEnumValue, getInstance, getUniqueID, isNullOrUndefined, prepend, print, removeClass, select, selectAll, setStyleAttribute } from '@syncfusion/ej2-base';
2
2
  import { Toolbar } from '@syncfusion/ej2-navigations';
3
3
  import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
4
- import { Dialog, Popup, getScrollableParent, isCollide } from '@syncfusion/ej2-popups';
4
+ import { Dialog, Popup, Tooltip, getScrollableParent, isCollide } from '@syncfusion/ej2-popups';
5
5
  import { ColorPicker, NumericTextBox, TextBox, Uploader } from '@syncfusion/ej2-inputs';
6
6
  import { Button, CheckBox, RadioButton } from '@syncfusion/ej2-buttons';
7
7
  import { AjaxSettings, ContextMenu, ContextMenuSettings, DetailsView, DetailsViewSettings, FileManager, NavigationPane, NavigationPaneSettings, SearchSettings, Toolbar as Toolbar$1, ToolbarSettings, UploadSettings } from '@syncfusion/ej2-filemanager';
@@ -719,6 +719,16 @@ var closeTableDialog = 'closeTableDialog';
719
719
  * @deprecated
720
720
  */
721
721
  var bindCssClass = 'closeTableDialog';
722
+ /**
723
+ * @hidden
724
+ * @deprecated
725
+ */
726
+ var formatPainterClick = 'formatPainterClick';
727
+ /**
728
+ * @hidden
729
+ * @deprecated
730
+ */
731
+ var formatPainterDoubleClick = 'formatPainterDoubleClick';
722
732
  /**
723
733
  * @hidden
724
734
  * @deprecated
@@ -1946,6 +1956,13 @@ var tools = {
1946
1956
  'tooltip': 'Styles',
1947
1957
  'command': 'Table',
1948
1958
  'subCommand': 'Styles'
1959
+ },
1960
+ 'formatpainter': {
1961
+ 'id': 'FormatPainter',
1962
+ 'icon': 'e-rte-format-painter',
1963
+ 'tooltip': 'Format Painter',
1964
+ 'command': 'FormatPainter',
1965
+ 'subCommand': 'FormatPainter'
1949
1966
  }
1950
1967
  };
1951
1968
  var alignmentLocale = [
@@ -2135,6 +2152,31 @@ function updateDropDownLocale(self) {
2135
2152
  TableStyleItems[i].text = getLocale(self, tableStyleLocale, TableStyleItems[i]);
2136
2153
  });
2137
2154
  }
2155
+ var windowKeys = {
2156
+ 'Insert Link': 'Ctrl + K',
2157
+ 'Insert Image': 'Ctrl + Shift + I',
2158
+ 'Create Table': 'Ctrl + Shift + E',
2159
+ 'Undo': 'Ctrl + Z',
2160
+ 'Redo': 'Ctrl + Y',
2161
+ 'Copy': 'Ctrl + C',
2162
+ 'Cut': 'Ctrl + X',
2163
+ 'Paste': 'Ctrl + V',
2164
+ 'Bold': 'Ctrl + B',
2165
+ 'Italic': 'Ctrl + I',
2166
+ 'Underline': 'Ctrl + U',
2167
+ 'Strikethrough': 'Ctrl + Shift + S',
2168
+ 'Upper Case': 'Ctrl + Shift + U',
2169
+ 'Lower Case': 'Ctrl + Shift + L',
2170
+ 'Superscript': 'Ctrl + Shift + =',
2171
+ 'Subscript': 'Ctrl + =',
2172
+ 'Source Code': 'Ctrl + Shift + H',
2173
+ 'Maximize': 'Ctrl + Shift + F',
2174
+ 'Minimize': 'Esc',
2175
+ 'Clear Format': 'Ctrl + Shift + R',
2176
+ 'Numbered List': 'Ctrl + Shift + O',
2177
+ 'Bulleted List': 'Ctrl + Alt + O',
2178
+ 'Format Painter': 'Ctrl + Shift + C, Ctrl + Shift + V'
2179
+ };
2138
2180
 
2139
2181
  /* eslint-disable */
2140
2182
  /**
@@ -2328,7 +2370,8 @@ var defaultLocale = {
2328
2370
  'bulletFormatListCircle': 'Circle',
2329
2371
  'bulletFormatListSquare': 'Square',
2330
2372
  'numberFormatListNone': 'None',
2331
- 'bulletFormatListNone': 'None'
2373
+ 'bulletFormatListNone': 'None',
2374
+ 'formatPainter': 'Format Painter'
2332
2375
  };
2333
2376
  var toolsLocale = {
2334
2377
  'alignments': 'alignments',
@@ -2415,7 +2458,8 @@ var toolsLocale = {
2415
2458
  'alignbottom': 'AlignBottom',
2416
2459
  'insertrowbefore': 'insertRowBefore',
2417
2460
  'insertrowafter': 'insertRowAfter',
2418
- 'deleterow': 'deleteRow'
2461
+ 'deleterow': 'deleteRow',
2462
+ 'formatpainter': 'formatPainter'
2419
2463
  };
2420
2464
  var fontNameLocale = [
2421
2465
  { locale: 'fontNameSegoeUI', value: 'Segoe UI' },
@@ -2959,6 +3003,8 @@ function decode(value) {
2959
3003
  function sanitizeHelper(value, parent) {
2960
3004
  if (parent.enableHtmlSanitizer) {
2961
3005
  var item = SanitizeHtmlHelper.beforeSanitize();
3006
+ if (item.selectors.tags[2] && item.selectors.tags[2].indexOf('iframe') > -1)
3007
+ item.selectors.tags[2] = 'iframe:not(.e-rte-embed-url)';
2962
3008
  var beforeEvent = {
2963
3009
  cancel: false,
2964
3010
  helper: null
@@ -3139,6 +3185,14 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
3139
3185
  args.rteToolbarObj.toolbarObj.isStringTemplate = true;
3140
3186
  args.rteToolbarObj.toolbarObj.createElement = this.parent.createElement;
3141
3187
  args.rteToolbarObj.toolbarObj.appendTo(args.target);
3188
+ if (this.parent.showTooltip) {
3189
+ var tooltip = new Tooltip({
3190
+ target: '#' + this.parent.getID() + '_toolbar_wrapper [title]',
3191
+ showTipPointer: true,
3192
+ cssClass: this.parent.cssClass
3193
+ });
3194
+ tooltip.appendTo(args.target);
3195
+ }
3142
3196
  };
3143
3197
  /**
3144
3198
  * renderDropDownButton method
@@ -3245,6 +3299,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
3245
3299
  dropDown.createElement = proxy.parent.createElement;
3246
3300
  dropDown.appendTo(args.element);
3247
3301
  args.element.tabIndex = -1;
3302
+ args.element.setAttribute('role', 'button');
3248
3303
  var popupElement = document.getElementById(dropDown.element.id + '-popup');
3249
3304
  popupElement.setAttribute('aria-owns', this.parent.getID());
3250
3305
  if (args.element.childElementCount === 1) {
@@ -3693,13 +3748,23 @@ var BaseToolbar = /** @__PURE__ @class */ (function () {
3693
3748
  case '-':
3694
3749
  return { type: 'Separator', cssClass: CLS_HR_SEPARATOR };
3695
3750
  default:
3696
- return {
3697
- id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
3698
- prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
3699
- tooltipText: getTooltipText(itemStr, this.locator),
3700
- command: this.tools[itemStr.toLocaleLowerCase()].command,
3701
- subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
3702
- };
3751
+ if (this.parent.showTooltip) {
3752
+ return {
3753
+ id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
3754
+ prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
3755
+ tooltipText: getTooltipText(itemStr, this.locator),
3756
+ command: this.tools[itemStr.toLocaleLowerCase()].command,
3757
+ subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
3758
+ };
3759
+ }
3760
+ else {
3761
+ return {
3762
+ id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
3763
+ prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
3764
+ command: this.tools[itemStr.toLocaleLowerCase()].command,
3765
+ subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
3766
+ };
3767
+ }
3703
3768
  }
3704
3769
  }
3705
3770
  };
@@ -3747,6 +3812,19 @@ var BaseToolbar = /** @__PURE__ @class */ (function () {
3747
3812
  var item = tbItems_1[_i];
3748
3813
  _loop_1(item);
3749
3814
  }
3815
+ for (var num = 0; num < items.length; num++) {
3816
+ var tooltipText = items[num].tooltipText;
3817
+ var shortCutKey = void 0;
3818
+ if (windowKeys["" + tooltipText]) {
3819
+ shortCutKey = Browser.isDevice && isIDevice() ? windowKeys["" + tooltipText].replace('Ctrl', 'Cmd') : windowKeys["" + tooltipText];
3820
+ }
3821
+ else {
3822
+ shortCutKey = tooltipText;
3823
+ }
3824
+ if (shortCutKey) {
3825
+ items[num].tooltipText = (tooltipText !== shortCutKey) ? tooltipText + ' (' + shortCutKey + ')' : tooltipText;
3826
+ }
3827
+ }
3750
3828
  return items;
3751
3829
  };
3752
3830
  BaseToolbar.prototype.getToolbarOptions = function (args) {
@@ -4768,6 +4846,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
4768
4846
  args.baseToolbar.toolbarObj.items[index].tooltipText = item.tooltip;
4769
4847
  args.baseToolbar.toolbarObj.items[index].subCommand = item.subCommand;
4770
4848
  args.baseToolbar.toolbarObj.dataBind();
4849
+ args.baseToolbar.toolbarObj.refreshOverflow();
4771
4850
  }
4772
4851
  else {
4773
4852
  this.addTBarItem(args, 0);
@@ -4908,7 +4987,11 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
4908
4987
  * @deprecated
4909
4988
  */
4910
4989
  Toolbar$$1.prototype.refreshToolbarOverflow = function () {
4990
+ this.parent.element.classList.remove(CLS_RTL);
4911
4991
  this.baseToolbar.toolbarObj.refreshOverflow();
4992
+ if (this.parent.enableRtl) {
4993
+ this.parent.element.classList.add(CLS_RTL);
4994
+ }
4912
4995
  };
4913
4996
  Toolbar$$1.prototype.isToolbarDestroyed = function () {
4914
4997
  return this.baseToolbar.toolbarObj && !this.baseToolbar.toolbarObj.isDestroyed;
@@ -5693,6 +5776,8 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
5693
5776
  var x;
5694
5777
  var y;
5695
5778
  var imgWrapper = closest(e.target, '.e-img-caption');
5779
+ var isAligned = (e.target.classList.contains('e-imginline') ||
5780
+ e.target.classList.contains('e-imgbreak')) ? false : true;
5696
5781
  var target = !isNullOrUndefined(imgWrapper) ? imgWrapper : e.target;
5697
5782
  addClass([this.toolbarElement], [CLS_RM_WHITE_SPACE]);
5698
5783
  var targetOffsetTop = target.offsetTop;
@@ -5706,6 +5791,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
5706
5791
  else {
5707
5792
  y = e.y;
5708
5793
  }
5794
+ target = isAligned ? e.target : target;
5709
5795
  if (target.offsetWidth > e.popWidth) {
5710
5796
  x = (target.offsetWidth / 2) - (e.popWidth / 2) + e.parentData.left + target.offsetLeft;
5711
5797
  }
@@ -5837,6 +5923,13 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
5837
5923
  _this.parent.enableToolbarItem(['Undo', 'Redo']);
5838
5924
  }
5839
5925
  append([_this.element], document.body);
5926
+ if (_this.parent.showTooltip) {
5927
+ _this.tooltip = new Tooltip({
5928
+ target: '#' + _this.element.id + ' [title]',
5929
+ showTipPointer: true
5930
+ });
5931
+ _this.tooltip.appendTo(_this.element);
5932
+ }
5840
5933
  _this.popupObj.position.X = x + 20;
5841
5934
  _this.popupObj.position.Y = y + 20;
5842
5935
  _this.popupObj.dataBind();
@@ -5903,6 +5996,16 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
5903
5996
  if (Browser.isDevice && !isIDevice()) {
5904
5997
  removeClass([this.parent.getToolbar()], [CLS_HIDE]);
5905
5998
  }
5999
+ if (!isNullOrUndefined(document.querySelector('.e-tooltip-wrap'))) {
6000
+ if (!isNullOrUndefined(document.querySelector('#' + this.element.id + ' [data-tooltip-id]'))) {
6001
+ var tooltipTargetEle = document.querySelector('#' + this.element.id + ' [data-tooltip-id]');
6002
+ var dataContent = tooltipTargetEle.getAttribute('data-content');
6003
+ tooltipTargetEle.removeAttribute('data-content');
6004
+ tooltipTargetEle.setAttribute('title', dataContent);
6005
+ tooltipTargetEle.removeAttribute('data-tooltip-id');
6006
+ }
6007
+ this.tooltip.destroy();
6008
+ }
5906
6009
  if (!isNullOrUndefined(this.parent.getToolbar()) && !this.parent.inlineMode.enable) {
5907
6010
  if (isNullOrUndefined(viewSourcePanel) || viewSourcePanel.style.display === 'none') {
5908
6011
  this.parent.enableToolbarItem(this.parent.toolbarSettings.items);
@@ -7015,6 +7118,7 @@ function setEditFrameFocus(editableElement, selector) {
7015
7118
  }
7016
7119
  /**
7017
7120
  * @param {string} value - specifies the string value
7121
+ * @param {string} enterAction - specifies the enter key action API
7018
7122
  * @returns {void}
7019
7123
  * @hidden
7020
7124
  */
@@ -7388,6 +7492,12 @@ var ON_BEGIN = 'onBegin';
7388
7492
  * @hidden
7389
7493
  */
7390
7494
  var SPACE_ACTION = 'actionBegin';
7495
+ /**
7496
+ * Format painter event constant
7497
+ *
7498
+ * @hidden
7499
+ */
7500
+ var FORMAT_PAINTER_ACTIONS = 'format_painter_actions';
7391
7501
 
7392
7502
  /**
7393
7503
  * Formatter
@@ -7414,8 +7524,14 @@ var Formatter = /** @__PURE__ @class */ (function () {
7414
7524
  var selection = self.contentModule.getDocument().getSelection();
7415
7525
  var range = (selection.rangeCount > 0) ? selection.getRangeAt(selection.rangeCount - 1) : null;
7416
7526
  var saveSelection;
7527
+ var isKeyboardVideoInsert = (!isNullOrUndefined(value) && !isNullOrUndefined(value.cssClass) &&
7528
+ value.cssClass !== 'e-video-inline');
7417
7529
  if (self.editorMode === 'HTML') {
7418
- saveSelection = this.editorManager.nodeSelection.save(range, self.contentModule.getDocument());
7530
+ if (!isNullOrUndefined(args) && !isKeyboardVideoInsert) {
7531
+ if (isNullOrUndefined(args.name) || (!isNullOrUndefined(args.name) && args.name !== 'showDialog')) {
7532
+ saveSelection = this.editorManager.nodeSelection.save(range, self.contentModule.getDocument());
7533
+ }
7534
+ }
7419
7535
  }
7420
7536
  if (!isNullOrUndefined(args)
7421
7537
  && args.item.command
@@ -7491,18 +7607,21 @@ var Formatter = /** @__PURE__ @class */ (function () {
7491
7607
  && args.item.command !== 'Font')
7492
7608
  || ((args.item.subCommand === 'FontName' || args.item.subCommand === 'FontSize') && args.name === 'dropDownSelect')
7493
7609
  || ((args.item.subCommand === 'BackgroundColor' || args.item.subCommand === 'FontColor')
7494
- && args.name === 'colorPickerChanged'))) {
7610
+ && args.name === 'colorPickerChanged') || args.item.subCommand === 'FormatPainter')) {
7495
7611
  extend(args, args, { requestType: args.item.subCommand, cancel: false, itemCollection: value, selectType: args.name }, true);
7496
7612
  self.trigger(actionBegin, args, function (actionBeginArgs) {
7497
7613
  if (!actionBeginArgs.cancel) {
7614
+ var formatPainterCopyAction = !isNullOrUndefined(actionBeginArgs.name) && actionBeginArgs.name === 'format-copy';
7498
7615
  if (_this.getUndoRedoStack().length === 0 && actionBeginArgs.item.command !== 'Links'
7499
- && actionBeginArgs.item.command !== 'Images') {
7616
+ && actionBeginArgs.item.command !== 'Images' && !formatPainterCopyAction) {
7500
7617
  _this.saveData();
7501
7618
  }
7502
7619
  self.isBlur = false;
7503
7620
  self.contentModule.getEditPanel().focus();
7504
- if (self.editorMode === 'HTML') {
7505
- saveSelection.restore();
7621
+ if (self.editorMode === 'HTML' && !isKeyboardVideoInsert) {
7622
+ if (isNullOrUndefined(args.selectType) || (!isNullOrUndefined(args.selectType) && args.selectType !== 'showDialog')) {
7623
+ saveSelection.restore();
7624
+ }
7506
7625
  }
7507
7626
  var command = actionBeginArgs.item.subCommand.toLocaleLowerCase();
7508
7627
  if (command === 'paste' || command === 'cut' || command === 'copy') {
@@ -8776,7 +8895,9 @@ var htmlKeyConfig = {
8776
8895
  'space': '32',
8777
8896
  'enter': '13',
8778
8897
  'tab': 'tab',
8779
- 'delete': '46'
8898
+ 'delete': '46',
8899
+ 'format-copy': 'ctrl+shift+c',
8900
+ 'format-paste': 'ctrl+shift+v'
8780
8901
  };
8781
8902
  /**
8782
8903
  * Default markdown key config for adapter
@@ -11330,7 +11451,7 @@ var Lists = /** @__PURE__ @class */ (function () {
11330
11451
  this.parent.domNode.insertAfter(insertTag, startNodeParent);
11331
11452
  e.event.preventDefault();
11332
11453
  this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, insertTag, 0);
11333
- if (startNodeParent.textContent === '') {
11454
+ if (startNodeParent.textContent === '' && (startNodeParent.querySelectorAll('audio,video').length === 0)) {
11334
11455
  detach(startNodeParent);
11335
11456
  }
11336
11457
  else {
@@ -12947,7 +13068,9 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
12947
13068
  }
12948
13069
  else {
12949
13070
  range.deleteContents();
12950
- detach(lasNode);
13071
+ if (!isNullOrUndefined(lasNode)) {
13072
+ detach(lasNode);
13073
+ }
12951
13074
  // eslint-disable-next-line
12952
13075
  !isNullOrUndefined(sibNode) ? sibNode.parentNode.appendChild(fragment) : editNode.appendChild(fragment);
12953
13076
  }
@@ -13133,7 +13256,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
13133
13256
  detach(currentNode.nextSibling);
13134
13257
  }
13135
13258
  }
13136
- else if ((currentNode.nodeName === '#text' || currentNode.nodeName === "BR") && !isNullOrUndefined(currentNode.parentElement) &&
13259
+ else if ((currentNode.nodeName === '#text' || currentNode.nodeName === 'BR') && !isNullOrUndefined(currentNode.parentElement) &&
13137
13260
  (currentNode.parentElement.nodeName === 'LI' || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
13138
13261
  currentNode.parentElement.textContent.trim().length > 0) {
13139
13262
  splitedElm = currentNode;
@@ -13484,7 +13607,6 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
13484
13607
  return arr.join(' ') + ' ';
13485
13608
  };
13486
13609
  LinkCommand.prototype.openLink = function (e) {
13487
- // eslint-disable-next-line security/detect-non-literal-fs-filename
13488
13610
  document.defaultView.open(e.item.url, e.item.target);
13489
13611
  this.callBack(e);
13490
13612
  };
@@ -13952,7 +14074,6 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
13952
14074
  this.callBack(e);
13953
14075
  };
13954
14076
  ImageCommand.prototype.openImageLink = function (e) {
13955
- // eslint-disable-next-line security/detect-non-literal-fs-filename
13956
14077
  document.defaultView.open(e.item.url, e.item.target);
13957
14078
  this.callBack(e);
13958
14079
  };
@@ -14426,6 +14547,8 @@ var VideoCommand = /** @__PURE__ @class */ (function () {
14426
14547
  : (Browser.isIE ? selectedNode : !e.item.isEmbedUrl ? selectedNode.lastElementChild : selectedNode.querySelector('iframe'));
14427
14548
  videoElm_1.addEventListener(videoElm_1.tagName !== 'IFRAME' ? 'loadeddata' : 'load', function () {
14428
14549
  if (e.value !== 'VideoReplace' || !isReplaced) {
14550
+ if (e.item.isEmbedUrl && videoElm_1)
14551
+ videoElm_1.classList.add('e-rte-embed-url');
14429
14552
  e.callBack({
14430
14553
  requestType: 'Videos',
14431
14554
  editorMode: 'HTML',
@@ -15664,6 +15787,7 @@ var IsFormatted = /** @__PURE__ @class */ (function () {
15664
15787
  'code',
15665
15788
  'dfn',
15666
15789
  'em',
15790
+ 'font',
15667
15791
  'i',
15668
15792
  'kbd',
15669
15793
  'label',
@@ -15697,15 +15821,16 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
15697
15821
  * @param {string} enterAction - specifies the enter key action
15698
15822
  * @param {string} value - specifies the string value
15699
15823
  * @param {string} selector - specifies the string
15824
+ * @param {FormatPainterValue} painterValues specifies the element created and last child
15700
15825
  * @returns {void}
15701
15826
  * @hidden
15702
15827
  * @deprecated
15703
15828
  */
15704
- SelectionCommands.applyFormat = function (docElement, format, endNode, enterAction, value, selector) {
15829
+ SelectionCommands.applyFormat = function (docElement, format, endNode, enterAction, value, selector, painterValues) {
15705
15830
  this.enterAction = enterAction;
15706
15831
  var validFormats = ['bold', 'italic', 'underline', 'strikethrough', 'superscript',
15707
15832
  'subscript', 'uppercase', 'lowercase', 'fontcolor', 'fontname', 'fontsize', 'backgroundcolor'];
15708
- if (validFormats.indexOf(format) > -1) {
15833
+ if (validFormats.indexOf(format) > -1 || value === 'formatPainter') {
15709
15834
  if (format === 'backgroundcolor' && value === '') {
15710
15835
  value = 'transparent';
15711
15836
  }
@@ -15781,8 +15906,10 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
15781
15906
  if (formatNode !== null && (!isFormat || isFontStyle)) {
15782
15907
  nodes[index] = this.removeFormat(nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode);
15783
15908
  }
15784
- else if (range.startContainer.parentElement !== endNode || (range.commonAncestorContainer === endNode || nodes.length === 1)) {
15785
- nodes[index] = this.insertFormat(docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domNode, endNode);
15909
+ else if (range.startContainer.parentElement !== endNode ||
15910
+ (range.commonAncestorContainer !== endNode && range.startContainer.parentElement === endNode)
15911
+ || (range.commonAncestorContainer === endNode || nodes.length === 1)) {
15912
+ nodes[index] = this.insertFormat(docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, painterValues, domNode, endNode);
15786
15913
  }
15787
15914
  domSelection = this.applySelection(nodes, domSelection, nodeCutter, index, isCollapsed);
15788
15915
  }
@@ -16078,7 +16205,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
16078
16205
  }
16079
16206
  return nodes[index];
16080
16207
  };
16081
- SelectionCommands.insertFormat = function (docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domNode, endNode) {
16208
+ SelectionCommands.insertFormat = function (docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, painterValues, domNode, endNode) {
16082
16209
  var rootElementNode;
16083
16210
  if (!isCursor) {
16084
16211
  if ((formatNode === null && isFormat) || isFontStyle) {
@@ -16105,11 +16232,11 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
16105
16232
  }
16106
16233
  else if (!(isFontStyle === true && value === '')) {
16107
16234
  var element = this.GetFormatNode(format, value);
16108
- if (format === 'fontsize' || format === 'fontcolor' || format === 'fontname' || format === 'backgroundcolor') {
16235
+ if (value === 'formatPainter' || format === 'fontsize' || format === 'fontcolor' || format === 'fontname' || format === 'backgroundcolor') {
16109
16236
  if (format !== 'fontname' && format !== 'backgroundcolor') {
16110
16237
  var liElement = nodes[index].parentElement;
16111
16238
  var parentElement = nodes[index].parentElement;
16112
- while (!isNullOrUndefined(parentElement) && parentElement.tagName.toLowerCase() !== 'li' && parentElement !== endNode) {
16239
+ while (!isNullOrUndefined(parentElement) && parentElement.tagName.toLowerCase() !== 'li') {
16113
16240
  parentElement = parentElement.parentElement;
16114
16241
  liElement = parentElement;
16115
16242
  }
@@ -16124,7 +16251,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
16124
16251
  }
16125
16252
  }
16126
16253
  }
16127
- if (rootElementNode && rootElementNode.nodeType !== 3) {
16254
+ if (rootElementNode && rootElementNode.nodeType !== 3 && rootElementNode.nodeName !== 'A') {
16128
16255
  var save = new NodeSelection();
16129
16256
  save.save(range, docElement);
16130
16257
  domNode.setMarker(save);
@@ -16144,7 +16271,12 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
16144
16271
  domNode.saveMarker(save, null);
16145
16272
  }
16146
16273
  else {
16147
- nodes[index] = this.applyStyles(nodes, index, element);
16274
+ if (value === 'formatPainter') {
16275
+ return this.insertFormatPainterElem(nodes, index, range, nodeCutter, painterValues, domNode);
16276
+ }
16277
+ else {
16278
+ nodes[index] = this.applyStyles(nodes, index, element);
16279
+ }
16148
16280
  }
16149
16281
  if (format === 'fontsize') {
16150
16282
  var bg = closest(nodes[index].parentElement, 'span[style*=' + 'background-color' + ']');
@@ -16275,6 +16407,59 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
16275
16407
  ele.setAttribute('style', styles);
16276
16408
  }
16277
16409
  };
16410
+ // Below function is used to insert the element created by the format painter plugin.
16411
+ SelectionCommands.insertFormatPainterElem = function (nodes, index, range, nodeCutter, painterValues, domNode) {
16412
+ var parent = nodes[index].parentElement;
16413
+ if (!domNode.isBlockNode(parent)) {
16414
+ // The below code is used to remove the already present inline style from the text node.
16415
+ while (parent.textContent.trim() === parent.parentElement.textContent.trim() && !domNode.isBlockNode(parent.parentElement)) {
16416
+ parent = parent.parentElement;
16417
+ }
16418
+ if (parent.textContent.trim() !== nodes[index].textContent.trim()) {
16419
+ nodeCutter.SplitNode(range, parent, true);
16420
+ var childELemList = nodes[index].parentElement.childNodes;
16421
+ for (var i = 0; i < childELemList.length; i++) {
16422
+ if (childELemList[i].textContent.trim() === nodes[i].textContent.trim()) {
16423
+ parent.parentNode.insertBefore(childELemList[i], parent);
16424
+ break;
16425
+ }
16426
+ }
16427
+ var blockChildNodes = parent.parentElement.childNodes;
16428
+ for (var k = 0; k < blockChildNodes.length; k++) {
16429
+ if (blockChildNodes[k].textContent.trim() === '' || blockChildNodes[k].textContent.length === 0) {
16430
+ detach(blockChildNodes[k]);
16431
+ }
16432
+ }
16433
+ }
16434
+ else {
16435
+ InsertMethods.unwrap(parent);
16436
+ }
16437
+ }
16438
+ var elem = painterValues.element;
16439
+ if (!isNullOrUndefined(elem)) {
16440
+ // Step 1: Cloning the element that is created by format painter.
16441
+ // Step 2: Finding the last child of the nested elememt using the paintervalues.lastchild nodename
16442
+ // Step 3: Assigning the nodes[index] text content to the last child element.
16443
+ // Step 4: Wrapping the cloned element with the nodes[index]
16444
+ var clonedElement = elem.cloneNode(true);
16445
+ var elemList = clonedElement.querySelectorAll(painterValues.lastChild.nodeName);
16446
+ var lastElement = void 0;
16447
+ if (elemList.length > 0) {
16448
+ lastElement = elemList[elemList.length - 1];
16449
+ }
16450
+ else {
16451
+ if (!isNullOrUndefined(clonedElement) && clonedElement.nodeName === painterValues.lastChild.nodeName) {
16452
+ lastElement = clonedElement;
16453
+ }
16454
+ }
16455
+ lastElement.textContent = nodes[index].textContent;
16456
+ var lastChild = lastElement.childNodes[0];
16457
+ nodes[index] = InsertMethods.Wrap(nodes[index], clonedElement);
16458
+ nodes[index].textContent = '';
16459
+ nodes[index] = lastChild;
16460
+ }
16461
+ return nodes[index];
16462
+ };
16278
16463
  SelectionCommands.enterAction = 'P';
16279
16464
  return SelectionCommands;
16280
16465
  }());
@@ -16401,12 +16586,18 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
16401
16586
  var nodeSelection = new NodeSelection();
16402
16587
  var nodeCutter = new NodeCutter();
16403
16588
  var range = nodeSelection.getRange(docElement);
16404
- var isCollapsed = range.collapsed;
16405
- var nodes = nodeSelection.getInsertNodeCollection(range);
16589
+ var nodes = range.collapsed ? nodeSelection.getSelectionNodeCollection(range) :
16590
+ nodeSelection.getSelectionNodeCollectionBr(range);
16406
16591
  var save = nodeSelection.save(range, docElement);
16592
+ var cursorRange = false;
16593
+ if (range.collapsed) {
16594
+ cursorRange = true;
16595
+ range = nodeCutter.GetCursorRange(docElement, range, nodes[0]);
16596
+ }
16597
+ var isCollapsed = range.collapsed;
16407
16598
  if (!isCollapsed) {
16408
16599
  var preNode = void 0;
16409
- if (nodes[0].nodeName === 'BR' && closest(nodes[0], 'table')) {
16600
+ if (nodes.length > 0 && nodes[0].nodeName === 'BR' && closest(nodes[0], 'table')) {
16410
16601
  preNode = nodeCutter.GetSpliceNode(range, closest(nodes[0], 'table'));
16411
16602
  }
16412
16603
  else {
@@ -16416,7 +16607,7 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
16416
16607
  nodeSelection.setSelectionContents(docElement, preNode);
16417
16608
  range = nodeSelection.getRange(docElement);
16418
16609
  }
16419
- else {
16610
+ else if (nodes.length > 1) {
16420
16611
  var i = 1;
16421
16612
  var lastText = nodes[nodes.length - i];
16422
16613
  while (nodes.length <= i && nodes[nodes.length - i].nodeName === 'BR') {
@@ -16441,6 +16632,9 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
16441
16632
  }
16442
16633
  this.reSelection(docElement, save, exactNodes);
16443
16634
  }
16635
+ if (cursorRange) {
16636
+ nodeSelection.setCursorPoint(docElement, range.endContainer, range.endOffset);
16637
+ }
16444
16638
  };
16445
16639
  ClearFormat.reSelection = function (docElement, save, exactNodes) {
16446
16640
  var selectionNodes = save.getInsertNodes(exactNodes);
@@ -16950,7 +17144,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
16950
17144
  if (pattern4.test(tempHTMLContent)) {
16951
17145
  this.addTableBorderClass(elm);
16952
17146
  }
16953
- // Removing the margin for list items
17147
+ // Removing the margin for list items
16954
17148
  var liChildren = elm.querySelectorAll('li');
16955
17149
  if (liChildren.length > 0) {
16956
17150
  for (var i = 0; i < liChildren.length; i++) {
@@ -17397,12 +17591,12 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
17397
17591
  listStyleType = this.getlistStyleType(this.listContents[0], type);
17398
17592
  if (type === 'ol' && (i === 0 || listNodes[i - 1] === null)) {
17399
17593
  var startString = this.listContents[0].split('.')[0];
17400
- var listTypes = ['A', 'a', 'I', 'i', 'α', '1', '1-']; // Add '1-' for rare list type.
17594
+ var listTypes = ['A', 'a', 'I', 'i', 'α', '1', '1-']; // Add '1-' for rare list type.
17401
17595
  if (listTypes.indexOf(startString) === -1) {
17402
17596
  if (listStyleType === 'decimal') {
17403
17597
  // Bug in getlistStyleType() list style stype is returned as decimal for nested list with start attribute
17404
- if (!isNaN(parseInt(startString))) {
17405
- startAttr = parseInt(startString);
17598
+ if (!isNaN(parseInt(startString, 10))) {
17599
+ startAttr = parseInt(startString, 10);
17406
17600
  }
17407
17601
  }
17408
17602
  else if (listStyleType === 'upper-alpha') {
@@ -17683,372 +17877,132 @@ var InsertTextExec = /** @__PURE__ @class */ (function () {
17683
17877
  }());
17684
17878
 
17685
17879
  /**
17686
- * EditorManager internal component
17880
+ * Update Toolbar Status
17687
17881
  *
17688
17882
  * @hidden
17689
17883
  * @deprecated
17690
17884
  */
17691
- var EditorManager = /** @__PURE__ @class */ (function () {
17885
+ var statusCollection = getDefaultHtmlTbStatus();
17886
+ var ToolbarStatus = /** @__PURE__ @class */ (function () {
17887
+ function ToolbarStatus() {
17888
+ }
17692
17889
  /**
17693
- * Constructor for creating the component
17890
+ * get method
17694
17891
  *
17892
+ * @param {Document} docElement - specifies the document element
17893
+ * @param {Node} targetNode - specifies the target node
17894
+ * @param {string[]} formatNode - specifies the format node
17895
+ * @param {string[]} fontSize - specifies the font size
17896
+ * @param {string[]} fontName - specifies the font name.
17897
+ * @param {Node} documentNode - specifies the document node.
17898
+ * @returns {IToolbarStatus} - returns the toolbar status
17695
17899
  * @hidden
17696
17900
  * @deprecated
17697
- * @param {ICommandModel} options - specifies the command Model
17698
17901
  */
17699
- function EditorManager(options) {
17700
- this.currentDocument = options.document;
17701
- this.editableElement = options.editableElement;
17702
- this.nodeSelection = new NodeSelection();
17703
- this.nodeCutter = new NodeCutter();
17704
- this.domNode = new DOMNode(this.editableElement, this.currentDocument);
17705
- this.observer = new Observer(this);
17706
- this.listObj = new Lists(this);
17707
- this.formatObj = new Formats(this);
17708
- this.alignmentObj = new Alignments(this);
17709
- this.indentsObj = new Indents(this);
17710
- this.linkObj = new LinkCommand(this);
17711
- this.imgObj = new ImageCommand(this);
17712
- this.audioObj = new AudioCommand(this);
17713
- this.videoObj = new VideoCommand(this);
17714
- this.selectionObj = new SelectionBasedExec(this);
17715
- this.inserthtmlObj = new InsertHtmlExec(this);
17716
- this.insertTextObj = new InsertTextExec(this);
17717
- this.clearObj = new ClearFormatExec(this);
17718
- this.tableObj = new TableCommand(this);
17719
- this.undoRedoManager = new UndoRedoManager(this, options.options);
17720
- this.msWordPaste = new MsWordPaste(this);
17721
- this.wireEvents();
17722
- }
17723
- EditorManager.prototype.wireEvents = function () {
17724
- this.observer.on(KEY_DOWN, this.editorKeyDown, this);
17725
- this.observer.on(KEY_UP, this.editorKeyUp, this);
17726
- this.observer.on(KEY_UP, this.editorKeyUp, this);
17727
- this.observer.on(MODEL_CHANGED, this.onPropertyChanged, this);
17728
- this.observer.on(MS_WORD_CLEANUP, this.onWordPaste, this);
17729
- this.observer.on(ON_BEGIN, this.onBegin, this);
17730
- };
17731
- EditorManager.prototype.onWordPaste = function (e) {
17732
- this.observer.notify(MS_WORD_CLEANUP_PLUGIN, e);
17733
- };
17734
- EditorManager.prototype.onPropertyChanged = function (props) {
17735
- this.observer.notify(MODEL_CHANGED_PLUGIN, props);
17736
- };
17737
- EditorManager.prototype.editorKeyDown = function (e) {
17738
- this.observer.notify(KEY_DOWN_HANDLER, e);
17902
+ ToolbarStatus.get = function (docElement, targetNode, formatNode, fontSize, fontName, documentNode) {
17903
+ var formatCollection = JSON.parse(JSON.stringify(statusCollection));
17904
+ var nodeCollection = JSON.parse(JSON.stringify(statusCollection));
17905
+ var nodeSelection = new NodeSelection();
17906
+ var range = nodeSelection.getRange(docElement);
17907
+ var nodes = documentNode ? [documentNode] : range.collapsed ? nodeSelection.getNodeCollection(range) :
17908
+ nodeSelection.getSelectionNodeCollectionBr(range);
17909
+ var nodesLength = nodes.length;
17910
+ var isNodeChanged = false;
17911
+ for (var index = 0; index < nodes.length; index++) {
17912
+ while (nodes[index].nodeType === 3 && range.startContainer.nodeType === 3 && nodes[index].parentNode &&
17913
+ nodes[index].parentNode.lastElementChild && nodes[index].parentNode.lastElementChild.nodeName !== 'BR' &&
17914
+ (this.getImmediateBlockNode(nodes[index].parentNode)).textContent.replace(/\u200B/g, '').length === 0 &&
17915
+ range.startContainer.textContent.replace(/\u200B/g, '').length === 0 &&
17916
+ nodeSelection.get(docElement).toString().replace(/\u200B/g, '').length === 0) {
17917
+ nodes[index] = nodes[index].parentNode.lastElementChild.firstChild;
17918
+ isNodeChanged = true;
17919
+ }
17920
+ if (isNodeChanged && nodes[index]) {
17921
+ nodeSelection.setCursorPoint(docElement, nodes[index], nodes[index].textContent.length);
17922
+ isNodeChanged = false;
17923
+ }
17924
+ if ((nodes[index].nodeName !== 'BR' && nodes[index].nodeType !== 3) ||
17925
+ (nodesLength > 1 && nodes[index].nodeType === 3 && nodes[index].textContent.trim() === '')) {
17926
+ nodes.splice(index, 1);
17927
+ index--;
17928
+ }
17929
+ }
17930
+ for (var index = 0; index < nodes.length; index++) {
17931
+ // eslint-disable-next-line max-len
17932
+ formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], targetNode, formatNode, fontSize, fontName);
17933
+ if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
17934
+ nodeCollection.bold = formatCollection.bold;
17935
+ }
17936
+ if ((index === 0 && formatCollection.insertcode) || !formatCollection.insertcode) {
17937
+ nodeCollection.insertcode = formatCollection.insertcode;
17938
+ }
17939
+ if ((index === 0 && formatCollection.italic) || !formatCollection.italic) {
17940
+ nodeCollection.italic = formatCollection.italic;
17941
+ }
17942
+ if ((index === 0 && formatCollection.underline) || !formatCollection.underline) {
17943
+ nodeCollection.underline = formatCollection.underline;
17944
+ }
17945
+ if ((index === 0 && formatCollection.strikethrough) || !formatCollection.strikethrough) {
17946
+ nodeCollection.strikethrough = formatCollection.strikethrough;
17947
+ }
17948
+ if ((index === 0 && formatCollection.superscript) || !formatCollection.superscript) {
17949
+ nodeCollection.superscript = formatCollection.superscript;
17950
+ }
17951
+ if ((index === 0 && formatCollection.subscript) || !formatCollection.subscript) {
17952
+ nodeCollection.subscript = formatCollection.subscript;
17953
+ }
17954
+ if ((index === 0 && formatCollection.fontcolor) || !formatCollection.fontcolor) {
17955
+ nodeCollection.fontcolor = formatCollection.fontcolor;
17956
+ }
17957
+ if ((index === 0 && formatCollection.fontname) || !formatCollection.fontname) {
17958
+ nodeCollection.fontname = formatCollection.fontname;
17959
+ }
17960
+ if ((index === 0 && formatCollection.fontsize) || !formatCollection.fontsize) {
17961
+ nodeCollection.fontsize = formatCollection.fontsize;
17962
+ }
17963
+ if ((index === 0 && formatCollection.backgroundcolor) || !formatCollection.backgroundcolor) {
17964
+ nodeCollection.backgroundcolor = formatCollection.backgroundcolor;
17965
+ }
17966
+ if ((index === 0 && formatCollection.orderedlist) || !formatCollection.orderedlist) {
17967
+ nodeCollection.orderedlist = formatCollection.orderedlist;
17968
+ }
17969
+ if ((index === 0 && formatCollection.unorderedlist) || !formatCollection.unorderedlist) {
17970
+ nodeCollection.unorderedlist = formatCollection.unorderedlist;
17971
+ }
17972
+ if ((index === 0 && formatCollection.alignments) || !formatCollection.alignments) {
17973
+ nodeCollection.alignments = formatCollection.alignments;
17974
+ }
17975
+ if ((index === 0 && formatCollection.formats) || !formatCollection.formats) {
17976
+ nodeCollection.formats = formatCollection.formats;
17977
+ }
17978
+ if ((index === 0 && formatCollection.createlink) || !formatCollection.createlink) {
17979
+ nodeCollection.createlink = formatCollection.createlink;
17980
+ }
17981
+ if ((index === 0 && formatCollection.numberFormatList) || !formatCollection.numberFormatList) {
17982
+ nodeCollection.numberFormatList = formatCollection.numberFormatList;
17983
+ }
17984
+ if ((index === 0 && formatCollection.bulletFormatList) || !formatCollection.bulletFormatList) {
17985
+ nodeCollection.bulletFormatList = formatCollection.bulletFormatList;
17986
+ }
17987
+ formatCollection = JSON.parse(JSON.stringify(statusCollection));
17988
+ }
17989
+ return nodeCollection;
17739
17990
  };
17740
- EditorManager.prototype.editorKeyUp = function (e) {
17741
- this.observer.notify(KEY_UP_HANDLER, e);
17991
+ ToolbarStatus.getImmediateBlockNode = function (node) {
17992
+ do {
17993
+ node = node.parentNode;
17994
+ } while (node && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) < 0);
17995
+ return node;
17742
17996
  };
17743
- EditorManager.prototype.onBegin = function (e) {
17744
- this.observer.notify(SPACE_ACTION, e);
17745
- };
17746
- /* eslint-disable */
17747
- /**
17748
- * execCommand
17749
- *
17750
- * @param {ExecCommand} command - specifies the execution command
17751
- * @param {T} value - specifes the value.
17752
- * @param {Event} event - specifies the call back event
17753
- * @param {Function} callBack - specifies the function
17754
- * @param {string} text - specifies the string value
17755
- * @param {T} exeValue - specifies the values to be executed
17756
- * @param {string} selector - specifies the selector values
17757
- * @returns {void}
17758
- * @hidden
17759
- * @deprecated
17760
- */
17761
- /* eslint-enable */
17762
- EditorManager.prototype.execCommand = function (command, value, event, callBack, text, exeValue, selector, enterAction) {
17763
- switch (command.toLowerCase()) {
17764
- case 'lists':
17765
- this.observer.notify(LIST_TYPE, { subCommand: value, event: event, callBack: callBack,
17766
- selector: selector, item: exeValue, enterAction: enterAction });
17767
- break;
17768
- case 'formats':
17769
- this.observer.notify(FORMAT_TYPE, { subCommand: value, event: event, callBack: callBack,
17770
- selector: selector, exeValue: exeValue, enterAction: enterAction
17771
- });
17772
- break;
17773
- case 'alignments':
17774
- this.observer.notify(ALIGNMENT_TYPE, {
17775
- subCommand: value, event: event, callBack: callBack,
17776
- selector: selector,
17777
- value: exeValue
17778
- });
17779
- break;
17780
- case 'indents':
17781
- this.observer.notify(INDENT_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector });
17782
- break;
17783
- case 'links':
17784
- this.observer.notify(LINK, { command: command, value: value, item: exeValue, event: event, callBack: callBack });
17785
- break;
17786
- case 'files':
17787
- this.observer.notify(IMAGE, {
17788
- command: command, value: 'Image', item: exeValue, event: event, callBack: callBack, selector: selector
17789
- });
17790
- break;
17791
- case 'images':
17792
- this.observer.notify(IMAGE, {
17793
- command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
17794
- });
17795
- break;
17796
- case 'audios':
17797
- this.observer.notify(AUDIO, {
17798
- command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
17799
- });
17800
- break;
17801
- case 'videos':
17802
- this.observer.notify(VIDEO, {
17803
- command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
17804
- });
17805
- break;
17806
- case 'table':
17807
- switch (value.toString().toLocaleLowerCase()) {
17808
- case 'createtable':
17809
- this.observer.notify(TABLE, { item: exeValue, event: event, callBack: callBack, enterAction: enterAction });
17810
- break;
17811
- case 'insertrowbefore':
17812
- case 'insertrowafter':
17813
- this.observer.notify(INSERT_ROW, { item: exeValue, event: event, callBack: callBack });
17814
- break;
17815
- case 'insertcolumnleft':
17816
- case 'insertcolumnright':
17817
- this.observer.notify(INSERT_COLUMN, { item: exeValue, event: event, callBack: callBack });
17818
- break;
17819
- case 'deleterow':
17820
- this.observer.notify(DELETEROW, { item: exeValue, event: event, callBack: callBack });
17821
- break;
17822
- case 'deletecolumn':
17823
- this.observer.notify(DELETECOLUMN, { item: exeValue, event: event, callBack: callBack });
17824
- break;
17825
- case 'tableremove':
17826
- this.observer.notify(REMOVETABLE, { item: exeValue, event: event, callBack: callBack });
17827
- break;
17828
- case 'tableheader':
17829
- this.observer.notify(TABLEHEADER, { item: exeValue, event: event, callBack: callBack });
17830
- break;
17831
- case 'aligntop':
17832
- case 'alignmiddle':
17833
- case 'alignbottom':
17834
- this.observer.notify(TABLE_VERTICAL_ALIGN, { item: exeValue, event: event, callBack: callBack });
17835
- break;
17836
- case 'merge':
17837
- this.observer.notify(TABLE_MERGE, { item: exeValue, event: event, callBack: callBack });
17838
- break;
17839
- case 'horizontalsplit':
17840
- this.observer.notify(TABLE_HORIZONTAL_SPLIT, { item: exeValue, event: event, callBack: callBack });
17841
- break;
17842
- case 'verticalsplit':
17843
- this.observer.notify(TABLE_VERTICAL_SPLIT, { item: exeValue, event: event, callBack: callBack });
17844
- break;
17845
- }
17846
- break;
17847
- case 'font':
17848
- case 'style':
17849
- case 'effects':
17850
- case 'casing':
17851
- this.observer.notify(SELECTION_TYPE, { subCommand: value, event: event, callBack: callBack, value: text, selector: selector, enterAction: enterAction });
17852
- break;
17853
- case 'inserthtml':
17854
- this.observer.notify(INSERTHTML_TYPE, { subCommand: value, callBack: callBack, value: text, enterAction: enterAction });
17855
- break;
17856
- case 'inserttext':
17857
- this.observer.notify(INSERT_TEXT_TYPE, { subCommand: value, callBack: callBack, value: text });
17858
- break;
17859
- case 'clear':
17860
- this.observer.notify(CLEAR_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector, enterAction: enterAction });
17861
- break;
17862
- case 'actions':
17863
- this.observer.notify(ACTION, { subCommand: value, event: event, callBack: callBack, selector: selector });
17864
- break;
17865
- }
17866
- };
17867
- return EditorManager;
17868
- }());
17869
-
17870
- var __extends$2 = (undefined && undefined.__extends) || (function () {
17871
- var extendStatics = function (d, b) {
17872
- extendStatics = Object.setPrototypeOf ||
17873
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
17874
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
17875
- return extendStatics(d, b);
17876
- };
17877
- return function (d, b) {
17878
- extendStatics(d, b);
17879
- function __() { this.constructor = d; }
17880
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
17881
- };
17882
- })();
17883
- /**
17884
- * HTML adapter
17885
- *
17886
- * @hidden
17887
- * @deprecated
17888
- */
17889
- var HTMLFormatter = /** @__PURE__ @class */ (function (_super) {
17890
- __extends$2(HTMLFormatter, _super);
17891
- function HTMLFormatter(options) {
17892
- var _this = _super.call(this) || this;
17893
- _this.initialize();
17894
- extend(_this, _this, options, true);
17895
- if (_this.currentDocument && _this.element) {
17896
- _this.updateFormatter(_this.element, _this.currentDocument, options.options);
17897
- }
17898
- return _this;
17899
- }
17900
- HTMLFormatter.prototype.initialize = function () {
17901
- this.keyConfig = htmlKeyConfig;
17902
- };
17903
- /**
17904
- * Update the formatter of RichTextEditor
17905
- *
17906
- * @param {Element} editElement - specifies the edit element.
17907
- * @param {Document} doc - specifies the doucment
17908
- * @param {number} options - specifies the options
17909
- * @returns {void}
17910
- * @hidden
17911
- * @deprecated
17912
- */
17913
- HTMLFormatter.prototype.updateFormatter = function (editElement, doc, options) {
17914
- if (editElement && doc) {
17915
- this.editorManager = new EditorManager({
17916
- document: doc,
17917
- editableElement: editElement,
17918
- options: options
17919
- });
17920
- }
17921
- };
17922
- return HTMLFormatter;
17923
- }(Formatter));
17924
-
17925
- /**
17926
- * Update Toolbar Status
17927
- *
17928
- * @hidden
17929
- * @deprecated
17930
- */
17931
- var statusCollection = getDefaultHtmlTbStatus();
17932
- var ToolbarStatus = /** @__PURE__ @class */ (function () {
17933
- function ToolbarStatus() {
17934
- }
17935
- /**
17936
- * get method
17937
- *
17938
- * @param {Document} docElement - specifies the document element
17939
- * @param {Node} targetNode - specifies the target node
17940
- * @param {string[]} formatNode - specifies the format node
17941
- * @param {string[]} fontSize - specifies the font size
17942
- * @param {string[]} fontName - specifies the font name.
17943
- * @param {Node} documentNode - specifies the document node.
17944
- * @returns {IToolbarStatus} - returns the toolbar status
17945
- * @hidden
17946
- * @deprecated
17947
- */
17948
- ToolbarStatus.get = function (docElement, targetNode, formatNode, fontSize, fontName, documentNode) {
17949
- var formatCollection = JSON.parse(JSON.stringify(statusCollection));
17950
- var nodeCollection = JSON.parse(JSON.stringify(statusCollection));
17951
- var nodeSelection = new NodeSelection();
17952
- var range = nodeSelection.getRange(docElement);
17953
- var nodes = documentNode ? [documentNode] : range.collapsed ? nodeSelection.getNodeCollection(range) :
17954
- nodeSelection.getSelectionNodeCollectionBr(range);
17955
- var nodesLength = nodes.length;
17956
- var isNodeChanged = false;
17957
- for (var index = 0; index < nodes.length; index++) {
17958
- while (nodes[index].nodeType === 3 && range.startContainer.nodeType === 3 && nodes[index].parentNode &&
17959
- nodes[index].parentNode.lastElementChild && nodes[index].parentNode.lastElementChild.nodeName !== 'BR' &&
17960
- (this.getImmediateBlockNode(nodes[index].parentNode)).textContent.replace(/\u200B/g, '').length === 0 &&
17961
- range.startContainer.textContent.replace(/\u200B/g, '').length === 0 &&
17962
- nodeSelection.get(docElement).toString().replace(/\u200B/g, '').length === 0) {
17963
- nodes[index] = nodes[index].parentNode.lastElementChild.firstChild;
17964
- isNodeChanged = true;
17965
- }
17966
- if (isNodeChanged && nodes[index]) {
17967
- nodeSelection.setCursorPoint(docElement, nodes[index], nodes[index].textContent.length);
17968
- isNodeChanged = false;
17969
- }
17970
- if ((nodes[index].nodeName !== 'BR' && nodes[index].nodeType !== 3) ||
17971
- (nodesLength > 1 && nodes[index].nodeType === 3 && nodes[index].textContent.trim() === '')) {
17972
- nodes.splice(index, 1);
17973
- index--;
17974
- }
17975
- }
17976
- for (var index = 0; index < nodes.length; index++) {
17977
- // eslint-disable-next-line max-len
17978
- formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], targetNode, formatNode, fontSize, fontName);
17979
- if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
17980
- nodeCollection.bold = formatCollection.bold;
17981
- }
17982
- if ((index === 0 && formatCollection.insertcode) || !formatCollection.insertcode) {
17983
- nodeCollection.insertcode = formatCollection.insertcode;
17984
- }
17985
- if ((index === 0 && formatCollection.italic) || !formatCollection.italic) {
17986
- nodeCollection.italic = formatCollection.italic;
17987
- }
17988
- if ((index === 0 && formatCollection.underline) || !formatCollection.underline) {
17989
- nodeCollection.underline = formatCollection.underline;
17990
- }
17991
- if ((index === 0 && formatCollection.strikethrough) || !formatCollection.strikethrough) {
17992
- nodeCollection.strikethrough = formatCollection.strikethrough;
17993
- }
17994
- if ((index === 0 && formatCollection.superscript) || !formatCollection.superscript) {
17995
- nodeCollection.superscript = formatCollection.superscript;
17996
- }
17997
- if ((index === 0 && formatCollection.subscript) || !formatCollection.subscript) {
17998
- nodeCollection.subscript = formatCollection.subscript;
17999
- }
18000
- if ((index === 0 && formatCollection.fontcolor) || !formatCollection.fontcolor) {
18001
- nodeCollection.fontcolor = formatCollection.fontcolor;
18002
- }
18003
- if ((index === 0 && formatCollection.fontname) || !formatCollection.fontname) {
18004
- nodeCollection.fontname = formatCollection.fontname;
18005
- }
18006
- if ((index === 0 && formatCollection.fontsize) || !formatCollection.fontsize) {
18007
- nodeCollection.fontsize = formatCollection.fontsize;
18008
- }
18009
- if ((index === 0 && formatCollection.backgroundcolor) || !formatCollection.backgroundcolor) {
18010
- nodeCollection.backgroundcolor = formatCollection.backgroundcolor;
18011
- }
18012
- if ((index === 0 && formatCollection.orderedlist) || !formatCollection.orderedlist) {
18013
- nodeCollection.orderedlist = formatCollection.orderedlist;
18014
- }
18015
- if ((index === 0 && formatCollection.unorderedlist) || !formatCollection.unorderedlist) {
18016
- nodeCollection.unorderedlist = formatCollection.unorderedlist;
18017
- }
18018
- if ((index === 0 && formatCollection.alignments) || !formatCollection.alignments) {
18019
- nodeCollection.alignments = formatCollection.alignments;
18020
- }
18021
- if ((index === 0 && formatCollection.formats) || !formatCollection.formats) {
18022
- nodeCollection.formats = formatCollection.formats;
18023
- }
18024
- if ((index === 0 && formatCollection.createlink) || !formatCollection.createlink) {
18025
- nodeCollection.createlink = formatCollection.createlink;
18026
- }
18027
- if ((index === 0 && formatCollection.numberFormatList) || !formatCollection.numberFormatList) {
18028
- nodeCollection.numberFormatList = formatCollection.numberFormatList;
18029
- }
18030
- if ((index === 0 && formatCollection.bulletFormatList) || !formatCollection.bulletFormatList) {
18031
- nodeCollection.bulletFormatList = formatCollection.bulletFormatList;
18032
- }
18033
- formatCollection = JSON.parse(JSON.stringify(statusCollection));
18034
- }
18035
- return nodeCollection;
18036
- };
18037
- ToolbarStatus.getImmediateBlockNode = function (node) {
18038
- do {
18039
- node = node.parentNode;
18040
- } while (node && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) < 0);
18041
- return node;
18042
- };
18043
- ToolbarStatus.getFormatParent = function (docElement, formatCollection, node, targetNode, formatNode, fontSize, fontName) {
18044
- if (targetNode.contains(node) ||
18045
- (node.nodeType === 3 && targetNode.nodeType !== 3 && targetNode.contains(node.parentNode))) {
18046
- do {
18047
- formatCollection = this.isFormattedNode(docElement, formatCollection, node, formatNode, fontSize, fontName);
18048
- node = node.parentNode;
18049
- } while (node && (node !== targetNode));
18050
- }
18051
- return formatCollection;
17997
+ ToolbarStatus.getFormatParent = function (docElement, formatCollection, node, targetNode, formatNode, fontSize, fontName) {
17998
+ if (targetNode.contains(node) ||
17999
+ (node.nodeType === 3 && targetNode.nodeType !== 3 && targetNode.contains(node.parentNode))) {
18000
+ do {
18001
+ formatCollection = this.isFormattedNode(docElement, formatCollection, node, formatNode, fontSize, fontName);
18002
+ node = node.parentNode;
18003
+ } while (node && (node !== targetNode));
18004
+ }
18005
+ return formatCollection;
18052
18006
  };
18053
18007
  ToolbarStatus.isFormattedNode = function (docElement, formatCollection, node, formatNode, fontSize, fontName) {
18054
18008
  if (!formatCollection.bold) {
@@ -18180,93 +18134,814 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
18180
18134
  return false;
18181
18135
  }
18182
18136
  };
18183
- ToolbarStatus.isUnorderedList = function (node) {
18184
- if (node.nodeName.toLocaleLowerCase() === 'ul') {
18185
- return true;
18137
+ ToolbarStatus.isUnorderedList = function (node) {
18138
+ if (node.nodeName.toLocaleLowerCase() === 'ul') {
18139
+ return true;
18140
+ }
18141
+ else {
18142
+ return false;
18143
+ }
18144
+ };
18145
+ ToolbarStatus.isAlignment = function (node) {
18146
+ var align = node.style && node.style.textAlign;
18147
+ if (align === 'left') {
18148
+ return 'justifyleft';
18149
+ }
18150
+ else if (align === 'center') {
18151
+ return 'justifycenter';
18152
+ }
18153
+ else if (align === 'right') {
18154
+ return 'justifyright';
18155
+ }
18156
+ else if (align === 'justify') {
18157
+ return 'justifyfull';
18158
+ }
18159
+ else {
18160
+ return null;
18161
+ }
18162
+ };
18163
+ ToolbarStatus.isFormats = function (node, formatNode) {
18164
+ if (((formatNode === undefined || formatNode === null)
18165
+ && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) > -1)
18166
+ || (formatNode !== null && formatNode !== undefined
18167
+ && formatNode.indexOf(node.nodeName.toLocaleLowerCase()) > -1)) {
18168
+ return node.nodeName.toLocaleLowerCase();
18169
+ }
18170
+ else {
18171
+ return null;
18172
+ }
18173
+ };
18174
+ ToolbarStatus.getComputedStyle = function (docElement, node, prop) {
18175
+ return docElement.defaultView.getComputedStyle(node, null).getPropertyValue(prop);
18176
+ };
18177
+ ToolbarStatus.isNumberFormatList = function (node) {
18178
+ var list = node.style && node.style.listStyleType;
18179
+ if (list === 'lower-alpha') {
18180
+ return 'Lower Alpha';
18181
+ }
18182
+ else if (list === 'number') {
18183
+ return 'Number';
18184
+ }
18185
+ else if (list === 'upper-alpha') {
18186
+ return 'Upper Alpha';
18187
+ }
18188
+ else if (list === 'lower-roman') {
18189
+ return 'Lower Roman';
18190
+ }
18191
+ else if (list === 'upper-roman') {
18192
+ return 'Upper Roman';
18193
+ }
18194
+ else if (list === 'lower-greek') {
18195
+ return 'Lower Greek';
18196
+ }
18197
+ else if (list === 'none') {
18198
+ return 'None';
18199
+ }
18200
+ else {
18201
+ return null;
18202
+ }
18203
+ };
18204
+ ToolbarStatus.isBulletFormatList = function (node) {
18205
+ var list = node.style && node.style.listStyleType;
18206
+ if (list === 'circle') {
18207
+ return 'Circle';
18208
+ }
18209
+ else if (list === 'square') {
18210
+ return 'Square';
18211
+ }
18212
+ else if (list === 'none') {
18213
+ return 'None';
18214
+ }
18215
+ else if (list === 'disc') {
18216
+ return 'Disc';
18217
+ }
18218
+ else {
18219
+ return null;
18220
+ }
18221
+ };
18222
+ return ToolbarStatus;
18223
+ }());
18224
+
18225
+ /**
18226
+ * Base export
18227
+ */
18228
+
18229
+ var FormatPainterActions = /** @__PURE__ @class */ (function () {
18230
+ function FormatPainterActions(parent, options) {
18231
+ this.parent = parent;
18232
+ this.settings = options;
18233
+ this.addEventListener();
18234
+ this.setDeniedFormats();
18235
+ }
18236
+ FormatPainterActions.prototype.addEventListener = function () {
18237
+ this.parent.observer.on(FORMAT_PAINTER_ACTIONS, this.actionHandler, this);
18238
+ };
18239
+ FormatPainterActions.prototype.actionHandler = function (args) {
18240
+ if (!isNullOrUndefined(args) && !isNullOrUndefined(args.item) && !isNullOrUndefined(args.item.formatPainterAction)) {
18241
+ switch (args.item.formatPainterAction) {
18242
+ case 'format-copy':
18243
+ this.copyAction();
18244
+ break;
18245
+ case 'format-paste':
18246
+ this.pasteAction();
18247
+ break;
18248
+ case 'escape':
18249
+ this.escapeAction();
18250
+ break;
18251
+ }
18252
+ }
18253
+ };
18254
+ FormatPainterActions.prototype.generateElement = function () {
18255
+ var copyCollection = this.copyCollection.slice(); // To clone without reversing the collcection array
18256
+ copyCollection.reverse();
18257
+ var length = copyCollection.length;
18258
+ var elemCollection = createElement('div', { className: 'e-format-paste-wrapper' });
18259
+ var lastAppendChild;
18260
+ for (var i = 0; i < length; i++) {
18261
+ var _a = copyCollection[i], attrs = _a.attrs, className = _a.className, styles = _a.styles, tagName = _a.tagName;
18262
+ var elem = createElement(tagName);
18263
+ if (className !== '') {
18264
+ elem.className = className;
18265
+ }
18266
+ for (var i_1 = 0; i_1 < attrs.length; i_1++) {
18267
+ var property = attrs[i_1].name;
18268
+ var value = attrs[i_1].value;
18269
+ elem.setAttribute(property, value);
18270
+ }
18271
+ for (var i_2 = 0; i_2 < styles.length; i_2++) {
18272
+ var property = styles[i_2].property;
18273
+ var value = styles[i_2].value;
18274
+ var priority = styles[i_2].priority;
18275
+ elem.style.setProperty(property, value, priority);
18276
+ }
18277
+ if (elemCollection.childElementCount === 0) {
18278
+ elemCollection.append(elem);
18279
+ lastAppendChild = elem;
18280
+ }
18281
+ else {
18282
+ lastAppendChild.append(elem);
18283
+ lastAppendChild = elem;
18284
+ }
18285
+ }
18286
+ var elemChild = this.removeDeniedFormats(elemCollection);
18287
+ var currentElem = elemChild;
18288
+ while (currentElem) {
18289
+ if (currentElem.firstChild === null) {
18290
+ lastAppendChild = currentElem;
18291
+ currentElem = undefined;
18292
+ }
18293
+ else {
18294
+ currentElem = currentElem.firstChild;
18295
+ }
18296
+ }
18297
+ this.newElem = elemChild;
18298
+ this.newElemLastChild = lastAppendChild;
18299
+ };
18300
+ FormatPainterActions.prototype.pasteAction = function () {
18301
+ if (isNullOrUndefined(this.copyCollection) || this.copyCollection.length === 0) {
18302
+ this.paintPlainTextFormat();
18303
+ return;
18304
+ }
18305
+ this.insertFormatNode(this.newElem, this.newElemLastChild);
18306
+ this.parent.undoRedoManager.saveData();
18307
+ };
18308
+ FormatPainterActions.prototype.removeDeniedFormats = function (parentElement) {
18309
+ if (!isNullOrUndefined(this.deniedFormatsCollection) && this.deniedFormatsCollection.length > 0) {
18310
+ var deniedPropArray = this.deniedFormatsCollection;
18311
+ var length_1 = deniedPropArray.length;
18312
+ for (var i = 0; i < length_1; i++) {
18313
+ var tag = deniedPropArray[i].tag;
18314
+ if (deniedPropArray[i].tag) {
18315
+ var elementsList = parentElement.querySelectorAll(tag);
18316
+ for (var j = 0; j < elementsList.length; j++) {
18317
+ if (deniedPropArray[i].classes.length > 0) {
18318
+ var classes = deniedPropArray[i].classes;
18319
+ var classLength = classes.length;
18320
+ for (var k = 0; k < classLength; k++) {
18321
+ if (elementsList[j].classList.contains(classes[k])) {
18322
+ removeClass([elementsList[j]], classes[k]);
18323
+ }
18324
+ }
18325
+ if (elementsList[j].classList.length === 0) {
18326
+ elementsList[j].removeAttribute('class');
18327
+ }
18328
+ }
18329
+ if (deniedPropArray[i].styles.length > 0) {
18330
+ var styles = deniedPropArray[i].styles;
18331
+ var styleLength = styles.length;
18332
+ for (var k = 0; k < styleLength; k++) {
18333
+ elementsList[j].style.removeProperty(styles[k]);
18334
+ }
18335
+ if (elementsList[j].style.length === 0) {
18336
+ elementsList[j].removeAttribute('style');
18337
+ }
18338
+ }
18339
+ if (deniedPropArray[i].attributes.length > 0) {
18340
+ var attributes$$1 = deniedPropArray[i].attributes;
18341
+ var attributeLength = attributes$$1.length;
18342
+ for (var k = 0; k < attributeLength; k++) {
18343
+ elementsList[j].removeAttribute(attributes$$1[k]);
18344
+ }
18345
+ }
18346
+ }
18347
+ }
18348
+ }
18349
+ }
18350
+ return parentElement.firstElementChild;
18351
+ };
18352
+ FormatPainterActions.prototype.copyAction = function () {
18353
+ var copyCollection = [];
18354
+ var range = this.parent.nodeSelection.getRange(document);
18355
+ var parentElem = range.startContainer.parentElement;
18356
+ var currentContext = this.findCurrentContext(parentElem);
18357
+ var allowedRulesArray = this.settings.allowedFormats.split(';');
18358
+ for (var i = 0; i < allowedRulesArray.length; i++) {
18359
+ allowedRulesArray[i] = allowedRulesArray[i].trim();
18360
+ }
18361
+ var _a = this.getRangeParentElem(currentContext, range), rangeParentElem = _a[0], context = _a[1];
18362
+ if (currentContext === null) {
18363
+ currentContext = context;
18364
+ }
18365
+ if (!isNullOrUndefined(currentContext) && this.settings.allowedContext.indexOf(currentContext) > -1) {
18366
+ if (range.startContainer.nodeName === '#text') {
18367
+ parentElem = range.startContainer.parentElement;
18368
+ }
18369
+ var lastElement = parentElem;
18370
+ do {
18371
+ if (allowedRulesArray.indexOf(parentElem.nodeName.toLowerCase()) > -1) {
18372
+ var allAttributes = parentElem.attributes;
18373
+ var attribute = [];
18374
+ for (var i = 0; i < allAttributes.length; i++) {
18375
+ if (allAttributes[i].name !== 'class' && allAttributes[i].name !== 'style') {
18376
+ attribute.push(allAttributes[i]);
18377
+ }
18378
+ }
18379
+ var classes = parentElem.className;
18380
+ var allStyles = parentElem.style;
18381
+ var styleProp = [];
18382
+ for (var i = 0; i < allStyles.length; i++) {
18383
+ var property = allStyles[i];
18384
+ var value = allStyles.getPropertyValue(property);
18385
+ var priority = allStyles.getPropertyPriority(property);
18386
+ styleProp.push({ property: property, value: value, priority: priority });
18387
+ }
18388
+ copyCollection.push({
18389
+ attrs: attribute, className: classes, styles: styleProp, tagName: parentElem.nodeName
18390
+ });
18391
+ }
18392
+ if (rangeParentElem === parentElem) {
18393
+ parentElem = undefined;
18394
+ }
18395
+ else if (!isNullOrUndefined(parentElem.parentElement)) {
18396
+ parentElem = parentElem.parentElement;
18397
+ }
18398
+ if (lastElement === parentElem) {
18399
+ break;
18400
+ }
18401
+ } while (!isNullOrUndefined(parentElem) || parentElem === this.parent.editableElement);
18402
+ this.copyCollection = copyCollection;
18403
+ }
18404
+ this.generateElement();
18405
+ };
18406
+ FormatPainterActions.prototype.getRangeParentElem = function (currentContext, range) {
18407
+ var startContainer = range.startContainer;
18408
+ var rangeParentELem;
18409
+ if (startContainer.nodeType === 3) {
18410
+ startContainer = startContainer.parentElement;
18411
+ }
18412
+ switch (currentContext) {
18413
+ case 'Table':
18414
+ rangeParentELem = closest(startContainer, 'td');
18415
+ if (isNullOrUndefined(rangeParentELem)) {
18416
+ rangeParentELem = closest(startContainer, 'th');
18417
+ }
18418
+ break;
18419
+ case 'List':
18420
+ rangeParentELem = closest(startContainer, 'li');
18421
+ break;
18422
+ case 'Text':
18423
+ rangeParentELem = closest(startContainer, 'p');
18424
+ break;
18425
+ }
18426
+ if (isNullOrUndefined(rangeParentELem)) {
18427
+ var nearBlockParentName = this.getNearestBlockParentElement(range);
18428
+ if (!isNullOrUndefined(nearBlockParentName) && nearBlockParentName !== 'UL' &&
18429
+ nearBlockParentName !== 'OL' && nearBlockParentName !== 'LI') {
18430
+ rangeParentELem = closest(startContainer, nearBlockParentName);
18431
+ currentContext = 'Text';
18432
+ }
18433
+ }
18434
+ if (currentContext === 'List') {
18435
+ rangeParentELem = rangeParentELem.parentElement;
18436
+ }
18437
+ return [rangeParentELem, currentContext];
18438
+ };
18439
+ FormatPainterActions.prototype.getNearestBlockParentElement = function (range) {
18440
+ var node = range.commonAncestorContainer;
18441
+ if (node.nodeType === 3) {
18442
+ node = node.parentNode;
18443
+ }
18444
+ // iterate untill the content editable div
18445
+ while (node && node !== this.parent.editableElement) {
18446
+ // If true return the block node name.
18447
+ if (!isNullOrUndefined(node) && this.isBlockElement(node)) {
18448
+ return node.nodeName;
18449
+ }
18450
+ // if false re assign node to parent node
18451
+ node = node.parentNode;
18452
+ }
18453
+ return null;
18454
+ };
18455
+ FormatPainterActions.prototype.isBlockElement = function (node) {
18456
+ var blockTags = ['P', 'DIV', 'UL', 'OL', 'LI', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6',
18457
+ 'ADDRESS', 'ARTICLE', 'ASIDE', 'BLOCKQUOTE', 'FIGCAPTION', 'FIGURE', 'FOOTER', 'HEADER',
18458
+ 'HR', 'MAIN', 'NAV', 'SECTION', 'SUMMARY', 'PRE'];
18459
+ return blockTags.indexOf(node.nodeName) > -1;
18460
+ };
18461
+ FormatPainterActions.prototype.escapeAction = function () {
18462
+ this.copyCollection = [];
18463
+ };
18464
+ FormatPainterActions.prototype.paintPlainTextFormat = function () {
18465
+ var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
18466
+ var domSelection = this.parent.nodeSelection;
18467
+ var nodes = range.collapsed ? domSelection.getSelectionNodeCollection(range) :
18468
+ domSelection.getSelectionNodeCollectionBr(range);
18469
+ var isInValid;
18470
+ if (nodes.length > 1) {
18471
+ for (var i = 0; i < nodes.length; i++) {
18472
+ isInValid = this.validateELementTag(nodes[i]);
18473
+ }
18474
+ }
18475
+ else {
18476
+ isInValid = this.validateELementTag(range.startContainer) && this.validateELementTag(range.endContainer);
18477
+ }
18478
+ if (!isInValid) {
18479
+ this.parent.execCommand('Clear', 'ClearFormat', null, null);
18480
+ }
18481
+ };
18482
+ FormatPainterActions.prototype.validateELementTag = function (node) {
18483
+ var INVALID_TAGS = ['A', 'AUDIO', 'IMG', 'VIDEO', 'IFRAME'];
18484
+ if (node.nodeType === 3) {
18485
+ node = node.parentElement;
18486
+ }
18487
+ return INVALID_TAGS.indexOf(node.tagName) > -1;
18488
+ };
18489
+ FormatPainterActions.prototype.findCurrentContext = function (parentElem) {
18490
+ if (closest(parentElem, 'td') || closest(parentElem, 'tr') || closest(parentElem, 'tbody')) {
18491
+ return 'Table';
18186
18492
  }
18187
- else {
18188
- return false;
18493
+ else if (closest(parentElem, 'li')) {
18494
+ return 'List';
18189
18495
  }
18496
+ else if (closest(parentElem, 'p')) {
18497
+ return 'Text';
18498
+ }
18499
+ return null;
18190
18500
  };
18191
- ToolbarStatus.isAlignment = function (node) {
18192
- var align = node.style && node.style.textAlign;
18193
- if (align === 'left') {
18194
- return 'justifyleft';
18501
+ FormatPainterActions.prototype.insertFormatNode = function (elem, lastChild) {
18502
+ var endNode = this.parent.editableElement;
18503
+ var docElement = this.parent.currentDocument;
18504
+ var domSelection = this.parent.nodeSelection;
18505
+ var clonedElem = elem.cloneNode(true);
18506
+ var childElem = clonedElem.firstChild;
18507
+ var inlineElement;
18508
+ while (childElem) {
18509
+ if (this.isBlockElement(childElem)) {
18510
+ childElem = childElem.firstChild;
18511
+ }
18512
+ else {
18513
+ inlineElement = childElem.parentNode.removeChild(childElem);
18514
+ break;
18515
+ }
18195
18516
  }
18196
- else if (align === 'center') {
18197
- return 'justifycenter';
18517
+ var formatValues = {
18518
+ element: inlineElement,
18519
+ lastChild: lastChild
18520
+ };
18521
+ SelectionCommands.applyFormat(docElement, null, endNode, 'P', 'formatPainter', null, formatValues);
18522
+ var isFullNodeSelected;
18523
+ var range = this.parent.nodeSelection.getRange(docElement);
18524
+ var isCollapsed = range.collapsed;
18525
+ var nodes = range.collapsed ? domSelection.getSelectionNodeCollection(range) :
18526
+ domSelection.getSelectionNodeCollectionBr(range);
18527
+ if (nodes.length === 1) {
18528
+ while (!this.isBlockElement(nodes[0])) {
18529
+ nodes[0] = nodes[0].parentElement;
18530
+ }
18531
+ isFullNodeSelected = nodes[0].textContent.trim() === range.commonAncestorContainer.wholeText.trim();
18198
18532
  }
18199
- else if (align === 'right') {
18200
- return 'justifyright';
18533
+ if (this.isBlockElement(elem) && isCollapsed || nodes.length > 1 || isFullNodeSelected) {
18534
+ this.insertBlockNode(elem, range, docElement, endNode, nodes);
18201
18535
  }
18202
- else if (align === 'justify') {
18203
- return 'justifyfull';
18536
+ };
18537
+ FormatPainterActions.prototype.insertBlockNode = function (element, range, docElement, endNode, nodes) {
18538
+ var domSelection = this.parent.nodeSelection;
18539
+ var listElement; // To clone to multiple list elements
18540
+ var cloneListParentNode;
18541
+ if (element.nodeName === 'UL' || element.nodeName === 'OL') {
18542
+ cloneListParentNode = element.cloneNode(true);
18543
+ listElement = cloneListParentNode.firstChild;
18544
+ }
18545
+ var textNode = range.startContainer; // To set cursor position
18546
+ for (var index = 0; index < nodes.length; index++) {
18547
+ var lastTextNode = nodes[index];
18548
+ if (nodes[index].nodeType === 3) {
18549
+ nodes[index] = nodes[index].parentElement;
18550
+ }
18551
+ while (!this.isBlockElement(nodes[index])) {
18552
+ nodes[index] = nodes[index].parentElement;
18553
+ }
18554
+ var cloneParentNode = void 0;
18555
+ if (!isNullOrUndefined(cloneListParentNode)) {
18556
+ cloneParentNode = listElement.cloneNode(true);
18557
+ }
18558
+ else {
18559
+ cloneParentNode = element.cloneNode(true);
18560
+ }
18561
+ // Appending all the child elements
18562
+ while (nodes[index].firstChild) {
18563
+ if (cloneParentNode.nodeName === 'LI') {
18564
+ cloneParentNode.appendChild(nodes[index].firstChild);
18565
+ }
18566
+ else {
18567
+ // Except list nodes other block nodes replaced here
18568
+ if (nodes[index].nodeType === 3) {
18569
+ cloneParentNode.appendChild(nodes[index].firstChild);
18570
+ }
18571
+ else {
18572
+ cloneParentNode.innerHTML = nodes[index].innerHTML;
18573
+ nodes[index].innerHTML = '';
18574
+ }
18575
+ nodes[index] = nodes[index].parentNode.replaceChild(cloneParentNode, nodes[index]);
18576
+ }
18577
+ }
18578
+ if (cloneParentNode.nodeName === 'LI') {
18579
+ // Appending the li nodes to the ol or ul node
18580
+ cloneListParentNode.append(cloneParentNode);
18581
+ if (index === 0) {
18582
+ var nodeName = nodes[index].nodeName;
18583
+ nodes[index] = nodes[index].parentNode.replaceChild(cloneListParentNode, nodes[index]);
18584
+ var parent_1 = nodeName === 'LI' ? cloneListParentNode.parentElement
18585
+ : cloneListParentNode;
18586
+ // Splicing and then inserting the node to previous element sibling of the Listparent.parent
18587
+ this.parent.nodeCutter.SplitNode(range, parent_1, true);
18588
+ if (!isNullOrUndefined(parent_1.previousElementSibling)) {
18589
+ parent_1.parentNode.insertBefore(cloneListParentNode, parent_1.nextElementSibling);
18590
+ }
18591
+ else {
18592
+ parent_1.parentElement.insertBefore(cloneListParentNode, parent_1);
18593
+ }
18594
+ }
18595
+ detach(nodes[index]);
18596
+ }
18597
+ /**Removing the inserted block node in list and appending to previous element sibling */
18598
+ if (cloneParentNode.nodeName !== 'LI' && (cloneParentNode.parentElement.nodeName === 'OL' ||
18599
+ cloneParentNode.parentElement.nodeName === 'UL')) {
18600
+ var parent_2 = cloneParentNode.parentElement;
18601
+ // Cutting single ul or ol to two ul or ol based on the range
18602
+ this.parent.nodeCutter.SplitNode(range, parent_2, true);
18603
+ if (!isNullOrUndefined(parent_2.previousElementSibling)) {
18604
+ parent_2.previousElementSibling.after(cloneParentNode);
18605
+ }
18606
+ else {
18607
+ parent_2.parentElement.prepend(cloneParentNode);
18608
+ }
18609
+ }
18610
+ nodes[index] = lastTextNode;
18611
+ }
18612
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
18613
+ !isNullOrUndefined(listElement) ? detach(listElement) : false;
18614
+ this.cleanEmptyLists();
18615
+ if (nodes.length > 1) {
18616
+ var startSelectNode = nodes[0];
18617
+ var endSelectNode = nodes[nodes.length - 1];
18618
+ domSelection.setSelectionText(docElement, startSelectNode, endSelectNode, 0, endSelectNode.textContent.length);
18204
18619
  }
18205
18620
  else {
18206
- return null;
18621
+ domSelection.setCursorPoint(docElement, textNode, textNode.textContent.length);
18207
18622
  }
18208
18623
  };
18209
- ToolbarStatus.isFormats = function (node, formatNode) {
18210
- if (((formatNode === undefined || formatNode === null)
18211
- && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) > -1)
18212
- || (formatNode !== null && formatNode !== undefined
18213
- && formatNode.indexOf(node.nodeName.toLocaleLowerCase()) > -1)) {
18214
- return node.nodeName.toLocaleLowerCase();
18624
+ FormatPainterActions.prototype.cleanEmptyLists = function () {
18625
+ var listElem = this.parent.editableElement.querySelectorAll('ol, ul');
18626
+ for (var i = 0; i < listElem.length; i++) {
18627
+ if (listElem[i].textContent.trim() === '') {
18628
+ detach(listElem[i]);
18629
+ }
18215
18630
  }
18216
- else {
18217
- return null;
18631
+ };
18632
+ FormatPainterActions.prototype.setDeniedFormats = function () {
18633
+ var deniedFormatsCollection = [];
18634
+ if (isNullOrUndefined(this.settings) || isNullOrUndefined(this.settings.deniedFormats)) {
18635
+ return;
18636
+ }
18637
+ var deniedFormats = this.settings.deniedFormats.split(';');
18638
+ var length = deniedFormats.length;
18639
+ for (var i = 0; i < length; i++) {
18640
+ var formatString = deniedFormats[i];
18641
+ if (formatString !== '') {
18642
+ formatString.trim();
18643
+ var collection = this.makeDeniedFormatsCollection(formatString);
18644
+ if (!isNullOrUndefined(collection)) {
18645
+ deniedFormatsCollection.push(collection);
18646
+ }
18647
+ }
18648
+ }
18649
+ this.deniedFormatsCollection = deniedFormatsCollection;
18650
+ };
18651
+ FormatPainterActions.prototype.makeDeniedFormatsCollection = function (value) {
18652
+ var openParenIndex = value.indexOf('(');
18653
+ var closeParenIndex = value.indexOf(')');
18654
+ var openBracketIndex = value.indexOf('[');
18655
+ var closeBracketIndex = value.indexOf(']');
18656
+ var openBraceIndex = value.indexOf('{');
18657
+ var closeBraceIndex = value.indexOf('}');
18658
+ var classes = [];
18659
+ var attributes$$1 = '';
18660
+ var styles = '';
18661
+ var tagName = '';
18662
+ var classList = [];
18663
+ var attributesList = [];
18664
+ var stylesList = [];
18665
+ if (openParenIndex > -1 && closeParenIndex > -1) {
18666
+ classes = value.substring(openParenIndex + 1, closeParenIndex).split(' ');
18667
+ classList = classes[0].split(')')[0].split(',');
18668
+ }
18669
+ if (openBracketIndex > -1 && closeBracketIndex > -1) {
18670
+ attributes$$1 = value.substring(openBracketIndex + 1, closeBracketIndex);
18671
+ attributesList = attributes$$1.split(',');
18672
+ }
18673
+ if (openBraceIndex > -1 && closeBraceIndex > -1) {
18674
+ styles = value.substring(openBraceIndex + 1, closeBraceIndex);
18675
+ stylesList = styles.split(',');
18676
+ }
18677
+ var openIndexArray = [openParenIndex, openBracketIndex, openBraceIndex];
18678
+ openIndexArray = openIndexArray.filter(function (index) { return index > -1; });
18679
+ var len = openIndexArray.length;
18680
+ var min;
18681
+ if (len === 1) {
18682
+ min = openIndexArray[0];
18683
+ }
18684
+ else if (len === 2) {
18685
+ min = Math.min(openIndexArray[0], openIndexArray[1]);
18686
+ }
18687
+ else if (len === 3) {
18688
+ min = Math.min(openIndexArray[0], openIndexArray[1], openIndexArray[2]);
18689
+ }
18690
+ tagName = value.substring(0, min);
18691
+ tagName.trim();
18692
+ return ({
18693
+ tag: tagName, styles: stylesList, classes: classList,
18694
+ attributes: attributesList
18695
+ });
18696
+ };
18697
+ return FormatPainterActions;
18698
+ }());
18699
+
18700
+ /**
18701
+ * EditorManager internal component
18702
+ *
18703
+ * @hidden
18704
+ * @deprecated
18705
+ */
18706
+ var EditorManager = /** @__PURE__ @class */ (function () {
18707
+ /**
18708
+ * Constructor for creating the component
18709
+ *
18710
+ * @hidden
18711
+ * @deprecated
18712
+ * @param {ICommandModel} options - specifies the command Model
18713
+ */
18714
+ function EditorManager(options) {
18715
+ this.currentDocument = options.document;
18716
+ this.editableElement = options.editableElement;
18717
+ this.nodeSelection = new NodeSelection();
18718
+ this.nodeCutter = new NodeCutter();
18719
+ this.domNode = new DOMNode(this.editableElement, this.currentDocument);
18720
+ this.observer = new Observer(this);
18721
+ this.listObj = new Lists(this);
18722
+ this.formatObj = new Formats(this);
18723
+ this.alignmentObj = new Alignments(this);
18724
+ this.indentsObj = new Indents(this);
18725
+ this.linkObj = new LinkCommand(this);
18726
+ this.imgObj = new ImageCommand(this);
18727
+ this.audioObj = new AudioCommand(this);
18728
+ this.videoObj = new VideoCommand(this);
18729
+ this.selectionObj = new SelectionBasedExec(this);
18730
+ this.inserthtmlObj = new InsertHtmlExec(this);
18731
+ this.insertTextObj = new InsertTextExec(this);
18732
+ this.clearObj = new ClearFormatExec(this);
18733
+ this.tableObj = new TableCommand(this);
18734
+ this.undoRedoManager = new UndoRedoManager(this, options.options);
18735
+ this.msWordPaste = new MsWordPaste(this);
18736
+ this.formatPaintetrObj = new FormatPainterActions(this, options.formatPainterSettings);
18737
+ this.wireEvents();
18738
+ }
18739
+ EditorManager.prototype.wireEvents = function () {
18740
+ this.observer.on(KEY_DOWN, this.editorKeyDown, this);
18741
+ this.observer.on(KEY_UP, this.editorKeyUp, this);
18742
+ this.observer.on(KEY_UP, this.editorKeyUp, this);
18743
+ this.observer.on(MODEL_CHANGED, this.onPropertyChanged, this);
18744
+ this.observer.on(MS_WORD_CLEANUP, this.onWordPaste, this);
18745
+ this.observer.on(ON_BEGIN, this.onBegin, this);
18746
+ };
18747
+ EditorManager.prototype.onWordPaste = function (e) {
18748
+ this.observer.notify(MS_WORD_CLEANUP_PLUGIN, e);
18749
+ };
18750
+ EditorManager.prototype.onPropertyChanged = function (props) {
18751
+ this.observer.notify(MODEL_CHANGED_PLUGIN, props);
18752
+ };
18753
+ EditorManager.prototype.editorKeyDown = function (e) {
18754
+ this.observer.notify(KEY_DOWN_HANDLER, e);
18755
+ };
18756
+ EditorManager.prototype.editorKeyUp = function (e) {
18757
+ this.observer.notify(KEY_UP_HANDLER, e);
18758
+ };
18759
+ EditorManager.prototype.onBegin = function (e) {
18760
+ this.observer.notify(SPACE_ACTION, e);
18761
+ };
18762
+ /* eslint-disable */
18763
+ /**
18764
+ * execCommand
18765
+ *
18766
+ * @param {ExecCommand} command - specifies the execution command
18767
+ * @param {T} value - specifes the value.
18768
+ * @param {Event} event - specifies the call back event
18769
+ * @param {Function} callBack - specifies the function
18770
+ * @param {string} text - specifies the string value
18771
+ * @param {T} exeValue - specifies the values to be executed
18772
+ * @param {string} selector - specifies the selector values
18773
+ * @returns {void}
18774
+ * @hidden
18775
+ * @deprecated
18776
+ */
18777
+ /* eslint-enable */
18778
+ EditorManager.prototype.execCommand = function (command, value, event, callBack, text, exeValue, selector, enterAction) {
18779
+ switch (command.toLowerCase()) {
18780
+ case 'lists':
18781
+ this.observer.notify(LIST_TYPE, { subCommand: value, event: event, callBack: callBack,
18782
+ selector: selector, item: exeValue, enterAction: enterAction });
18783
+ break;
18784
+ case 'formats':
18785
+ this.observer.notify(FORMAT_TYPE, { subCommand: value, event: event, callBack: callBack,
18786
+ selector: selector, exeValue: exeValue, enterAction: enterAction
18787
+ });
18788
+ break;
18789
+ case 'alignments':
18790
+ this.observer.notify(ALIGNMENT_TYPE, {
18791
+ subCommand: value, event: event, callBack: callBack,
18792
+ selector: selector,
18793
+ value: exeValue
18794
+ });
18795
+ break;
18796
+ case 'indents':
18797
+ this.observer.notify(INDENT_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector });
18798
+ break;
18799
+ case 'links':
18800
+ this.observer.notify(LINK, { command: command, value: value, item: exeValue, event: event, callBack: callBack });
18801
+ break;
18802
+ case 'files':
18803
+ this.observer.notify(IMAGE, {
18804
+ command: command, value: 'Image', item: exeValue, event: event, callBack: callBack, selector: selector
18805
+ });
18806
+ break;
18807
+ case 'images':
18808
+ this.observer.notify(IMAGE, {
18809
+ command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
18810
+ });
18811
+ break;
18812
+ case 'audios':
18813
+ this.observer.notify(AUDIO, {
18814
+ command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
18815
+ });
18816
+ break;
18817
+ case 'videos':
18818
+ this.observer.notify(VIDEO, {
18819
+ command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
18820
+ });
18821
+ break;
18822
+ case 'table':
18823
+ switch (value.toString().toLocaleLowerCase()) {
18824
+ case 'createtable':
18825
+ this.observer.notify(TABLE, { item: exeValue, event: event, callBack: callBack, enterAction: enterAction });
18826
+ break;
18827
+ case 'insertrowbefore':
18828
+ case 'insertrowafter':
18829
+ this.observer.notify(INSERT_ROW, { item: exeValue, event: event, callBack: callBack });
18830
+ break;
18831
+ case 'insertcolumnleft':
18832
+ case 'insertcolumnright':
18833
+ this.observer.notify(INSERT_COLUMN, { item: exeValue, event: event, callBack: callBack });
18834
+ break;
18835
+ case 'deleterow':
18836
+ this.observer.notify(DELETEROW, { item: exeValue, event: event, callBack: callBack });
18837
+ break;
18838
+ case 'deletecolumn':
18839
+ this.observer.notify(DELETECOLUMN, { item: exeValue, event: event, callBack: callBack });
18840
+ break;
18841
+ case 'tableremove':
18842
+ this.observer.notify(REMOVETABLE, { item: exeValue, event: event, callBack: callBack });
18843
+ break;
18844
+ case 'tableheader':
18845
+ this.observer.notify(TABLEHEADER, { item: exeValue, event: event, callBack: callBack });
18846
+ break;
18847
+ case 'aligntop':
18848
+ case 'alignmiddle':
18849
+ case 'alignbottom':
18850
+ this.observer.notify(TABLE_VERTICAL_ALIGN, { item: exeValue, event: event, callBack: callBack });
18851
+ break;
18852
+ case 'merge':
18853
+ this.observer.notify(TABLE_MERGE, { item: exeValue, event: event, callBack: callBack });
18854
+ break;
18855
+ case 'horizontalsplit':
18856
+ this.observer.notify(TABLE_HORIZONTAL_SPLIT, { item: exeValue, event: event, callBack: callBack });
18857
+ break;
18858
+ case 'verticalsplit':
18859
+ this.observer.notify(TABLE_VERTICAL_SPLIT, { item: exeValue, event: event, callBack: callBack });
18860
+ break;
18861
+ }
18862
+ break;
18863
+ case 'font':
18864
+ case 'style':
18865
+ case 'effects':
18866
+ case 'casing':
18867
+ this.observer.notify(SELECTION_TYPE, { subCommand: value, event: event, callBack: callBack, value: text, selector: selector, enterAction: enterAction });
18868
+ break;
18869
+ case 'inserthtml':
18870
+ this.observer.notify(INSERTHTML_TYPE, { subCommand: value, callBack: callBack, value: text, enterAction: enterAction });
18871
+ break;
18872
+ case 'inserttext':
18873
+ this.observer.notify(INSERT_TEXT_TYPE, { subCommand: value, callBack: callBack, value: text });
18874
+ break;
18875
+ case 'clear':
18876
+ this.observer.notify(CLEAR_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector, enterAction: enterAction });
18877
+ break;
18878
+ case 'actions':
18879
+ this.observer.notify(ACTION, { subCommand: value, event: event, callBack: callBack, selector: selector });
18880
+ break;
18881
+ case 'formatpainter':
18882
+ this.observer.notify(FORMAT_PAINTER_ACTIONS, { item: exeValue, subCommand: value, event: event, callBack: callBack });
18883
+ break;
18218
18884
  }
18219
18885
  };
18220
- ToolbarStatus.getComputedStyle = function (docElement, node, prop) {
18221
- return docElement.defaultView.getComputedStyle(node, null).getPropertyValue(prop);
18886
+ return EditorManager;
18887
+ }());
18888
+
18889
+ var __extends$2 = (undefined && undefined.__extends) || (function () {
18890
+ var extendStatics = function (d, b) {
18891
+ extendStatics = Object.setPrototypeOf ||
18892
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
18893
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
18894
+ return extendStatics(d, b);
18895
+ };
18896
+ return function (d, b) {
18897
+ extendStatics(d, b);
18898
+ function __() { this.constructor = d; }
18899
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18222
18900
  };
18223
- ToolbarStatus.isNumberFormatList = function (node) {
18224
- var list = node.style && node.style.listStyleType;
18225
- if (list === 'lower-alpha') {
18226
- return 'Lower Alpha';
18227
- }
18228
- else if (list === 'number') {
18229
- return 'Number';
18230
- }
18231
- else if (list === 'upper-alpha') {
18232
- return 'Upper Alpha';
18233
- }
18234
- else if (list === 'lower-roman') {
18235
- return 'Lower Roman';
18236
- }
18237
- else if (list === 'upper-roman') {
18238
- return 'Upper Roman';
18239
- }
18240
- else if (list === 'lower-greek') {
18241
- return 'Lower Greek';
18242
- }
18243
- else if (list === 'none') {
18244
- return 'None';
18245
- }
18246
- else {
18247
- return null;
18901
+ })();
18902
+ /**
18903
+ * HTML adapter
18904
+ *
18905
+ * @hidden
18906
+ * @deprecated
18907
+ */
18908
+ var HTMLFormatter = /** @__PURE__ @class */ (function (_super) {
18909
+ __extends$2(HTMLFormatter, _super);
18910
+ function HTMLFormatter(options) {
18911
+ var _this = _super.call(this) || this;
18912
+ _this.initialize();
18913
+ extend(_this, _this, options, true);
18914
+ if (_this.currentDocument && _this.element) {
18915
+ _this.updateFormatter(_this.element, _this.currentDocument, options.options, options.formatPainterSettings);
18248
18916
  }
18917
+ return _this;
18918
+ }
18919
+ HTMLFormatter.prototype.initialize = function () {
18920
+ this.keyConfig = htmlKeyConfig;
18249
18921
  };
18250
- ToolbarStatus.isBulletFormatList = function (node) {
18251
- var list = node.style && node.style.listStyleType;
18252
- if (list === 'circle') {
18253
- return 'Circle';
18254
- }
18255
- else if (list === 'square') {
18256
- return 'Square';
18257
- }
18258
- else if (list === 'none') {
18259
- return 'None';
18260
- }
18261
- else if (list === 'disc') {
18262
- return 'Disc';
18263
- }
18264
- else {
18265
- return null;
18922
+ /**
18923
+ * Update the formatter of RichTextEditor
18924
+ *
18925
+ * @param {Element} editElement - specifies the edit element.
18926
+ * @param {Document} doc - specifies the doucment
18927
+ * @param {number} options - specifies the options
18928
+ * @param {FormatPainterSettingsModel} formatPainterSettings - specifies the format painter settings
18929
+ * @returns {void}
18930
+ * @hidden
18931
+ * @deprecated
18932
+ */
18933
+ HTMLFormatter.prototype.updateFormatter = function (editElement, doc, options, formatPainterSettings) {
18934
+ if (editElement && doc) {
18935
+ this.editorManager = new EditorManager({
18936
+ document: doc,
18937
+ editableElement: editElement,
18938
+ options: options,
18939
+ formatPainterSettings: formatPainterSettings
18940
+ });
18266
18941
  }
18267
18942
  };
18268
- return ToolbarStatus;
18269
- }());
18943
+ return HTMLFormatter;
18944
+ }(Formatter));
18270
18945
 
18271
18946
  /**
18272
18947
  * HtmlToolbarStatus module for refresh the toolbar status
@@ -19211,117 +19886,136 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
19211
19886
  }
19212
19887
  };
19213
19888
  HtmlEditor.prototype.onToolbarClick = function (args) {
19889
+ var _this = this;
19214
19890
  var save;
19215
19891
  var selectNodeEle;
19216
19892
  var selectParentEle;
19217
19893
  var item = args.item;
19218
19894
  var closestElement = closest(args.originalEvent.target, '.e-rte-quick-popup');
19219
- if (closestElement && !closestElement.classList.contains('e-rte-inline-popup')) {
19220
- if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
19221
- item.subCommand === 'FontColor' || item.subCommand === 'BackgroundColor')) {
19222
- if (isIDevice$1() && item.command === 'Images') {
19223
- this.nodeSelectionObj.restore();
19224
- }
19225
- var range = this.nodeSelectionObj.getRange(this.parent.contentModule.getDocument());
19226
- save = this.nodeSelectionObj.save(range, this.parent.contentModule.getDocument());
19227
- selectNodeEle = this.nodeSelectionObj.getNodeCollection(range);
19228
- selectParentEle = this.nodeSelectionObj.getParentNodeCollection(range);
19229
- }
19230
- if (item.command === 'Images') {
19231
- this.parent.notify(imageToolbarAction, {
19232
- member: 'image', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19233
- });
19234
- }
19235
- if (item.command === 'Audios') {
19236
- this.parent.notify(audioToolbarAction, {
19237
- member: 'audio', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19238
- });
19239
- }
19240
- if (item.command === 'Videos') {
19241
- this.parent.notify(videoToolbarAction, {
19242
- member: 'video', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19243
- });
19244
- }
19245
- if (item.command === 'Links') {
19246
- this.parent.notify(linkToolbarAction, {
19247
- member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19248
- });
19249
- }
19250
- if (item.command === 'Table') {
19251
- this.parent.notify(tableToolbarAction, {
19252
- member: 'table', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19253
- });
19254
- }
19255
- }
19256
- else {
19257
- var linkDialog = document.getElementById(this.parent.getID() + '_rtelink');
19258
- var imageDialog = document.getElementById(this.parent.getID() + '_image');
19259
- if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
19260
- item.subCommand === 'FontColor' || item.subCommand === 'BackgroundColor')) {
19261
- var range = this.nodeSelectionObj.getRange(this.parent.contentModule.getDocument());
19262
- if (isNullOrUndefined(linkDialog) && isNullOrUndefined(imageDialog)) {
19895
+ if (item.command !== 'FormatPainter') {
19896
+ if (closestElement && !closestElement.classList.contains('e-rte-inline-popup')) {
19897
+ if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
19898
+ item.subCommand === 'FontColor' || item.subCommand === 'BackgroundColor')) {
19899
+ if (isIDevice$1() && item.command === 'Images') {
19900
+ this.nodeSelectionObj.restore();
19901
+ }
19902
+ var range = this.nodeSelectionObj.getRange(this.parent.contentModule.getDocument());
19263
19903
  save = this.nodeSelectionObj.save(range, this.parent.contentModule.getDocument());
19904
+ selectNodeEle = this.nodeSelectionObj.getNodeCollection(range);
19905
+ selectParentEle = this.nodeSelectionObj.getParentNodeCollection(range);
19264
19906
  }
19265
- selectNodeEle = this.nodeSelectionObj.getNodeCollection(range);
19266
- selectParentEle = this.nodeSelectionObj.getParentNodeCollection(range);
19267
- }
19268
- switch (item.subCommand) {
19269
- case 'Maximize':
19270
- this.parent.notify(enableFullScreen, { args: args });
19271
- break;
19272
- case 'Minimize':
19273
- this.parent.notify(disableFullScreen, { args: args });
19274
- break;
19275
- case 'CreateLink':
19276
- this.parent.notify(insertLink, {
19277
- member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19278
- });
19279
- break;
19280
- case 'RemoveLink':
19281
- this.parent.notify(unLink, {
19282
- member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19283
- });
19284
- break;
19285
- case 'Print':
19286
- this.parent.print();
19287
- break;
19288
- case 'Image':
19289
- this.parent.notify(insertImage, {
19907
+ if (item.command === 'Images') {
19908
+ this.parent.notify(imageToolbarAction, {
19290
19909
  member: 'image', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19291
19910
  });
19292
- break;
19293
- case 'Audio':
19294
- this.parent.notify(insertAudio, {
19911
+ }
19912
+ if (item.command === 'Audios') {
19913
+ this.parent.notify(audioToolbarAction, {
19295
19914
  member: 'audio', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19296
19915
  });
19297
- break;
19298
- case 'Video':
19299
- this.parent.notify(insertVideo, {
19916
+ }
19917
+ if (item.command === 'Videos') {
19918
+ this.parent.notify(videoToolbarAction, {
19300
19919
  member: 'video', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19301
19920
  });
19302
- break;
19303
- case 'CreateTable':
19304
- this.parent.notify(createTable, {
19305
- member: 'table', args: args, selection: save
19921
+ }
19922
+ if (item.command === 'Links') {
19923
+ this.parent.notify(linkToolbarAction, {
19924
+ member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19306
19925
  });
19307
- break;
19308
- case 'SourceCode':
19309
- this.parent.notify(sourceCode, { member: 'viewSource', args: args });
19310
- break;
19311
- case 'Preview':
19312
- this.parent.notify(updateSource, { member: 'updateSource', args: args });
19313
- break;
19314
- case 'FontColor':
19315
- case 'BackgroundColor':
19316
- break;
19317
- case 'File':
19318
- this.parent.notify(renderFileManager, {
19319
- member: 'fileManager', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19926
+ }
19927
+ if (item.command === 'Table') {
19928
+ this.parent.notify(tableToolbarAction, {
19929
+ member: 'table', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19320
19930
  });
19321
- break;
19322
- default:
19323
- this.parent.formatter.process(this.parent, args, args.originalEvent, null);
19324
- break;
19931
+ }
19932
+ }
19933
+ else {
19934
+ var linkDialog = document.getElementById(this.parent.getID() + '_rtelink');
19935
+ var imageDialog = document.getElementById(this.parent.getID() + '_image');
19936
+ if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
19937
+ item.subCommand === 'FontColor' || item.subCommand === 'BackgroundColor')) {
19938
+ var range = this.nodeSelectionObj.getRange(this.parent.contentModule.getDocument());
19939
+ if (isNullOrUndefined(linkDialog) && isNullOrUndefined(imageDialog)) {
19940
+ save = this.nodeSelectionObj.save(range, this.parent.contentModule.getDocument());
19941
+ }
19942
+ selectNodeEle = this.nodeSelectionObj.getNodeCollection(range);
19943
+ selectParentEle = this.nodeSelectionObj.getParentNodeCollection(range);
19944
+ }
19945
+ switch (item.subCommand) {
19946
+ case 'Maximize':
19947
+ this.parent.notify(enableFullScreen, { args: args });
19948
+ break;
19949
+ case 'Minimize':
19950
+ this.parent.notify(disableFullScreen, { args: args });
19951
+ break;
19952
+ case 'CreateLink':
19953
+ this.parent.notify(insertLink, {
19954
+ member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19955
+ });
19956
+ break;
19957
+ case 'RemoveLink':
19958
+ this.parent.notify(unLink, {
19959
+ member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19960
+ });
19961
+ break;
19962
+ case 'Print':
19963
+ this.parent.print();
19964
+ break;
19965
+ case 'Image':
19966
+ this.parent.notify(insertImage, {
19967
+ member: 'image', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19968
+ });
19969
+ break;
19970
+ case 'Audio':
19971
+ this.parent.notify(insertAudio, {
19972
+ member: 'audio', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19973
+ });
19974
+ break;
19975
+ case 'Video':
19976
+ this.parent.notify(insertVideo, {
19977
+ member: 'video', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19978
+ });
19979
+ break;
19980
+ case 'CreateTable':
19981
+ this.parent.notify(createTable, {
19982
+ member: 'table', args: args, selection: save
19983
+ });
19984
+ break;
19985
+ case 'SourceCode':
19986
+ this.parent.notify(sourceCode, { member: 'viewSource', args: args });
19987
+ break;
19988
+ case 'Preview':
19989
+ this.parent.notify(updateSource, { member: 'updateSource', args: args });
19990
+ break;
19991
+ case 'FontColor':
19992
+ case 'BackgroundColor':
19993
+ break;
19994
+ case 'File':
19995
+ this.parent.notify(renderFileManager, {
19996
+ member: 'fileManager', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19997
+ });
19998
+ break;
19999
+ default:
20000
+ this.parent.formatter.process(this.parent, args, args.originalEvent, null);
20001
+ break;
20002
+ }
20003
+ }
20004
+ }
20005
+ else {
20006
+ if (args.originalEvent.detail === 1) {
20007
+ clearTimeout(this.clickTimeout);
20008
+ this.clickTimeout = setTimeout(function () {
20009
+ _this.parent.notify(formatPainterClick, {
20010
+ member: 'formatPainter', args: args
20011
+ });
20012
+ }, 200);
20013
+ }
20014
+ else {
20015
+ clearTimeout(this.clickTimeout);
20016
+ this.parent.notify(formatPainterDoubleClick, {
20017
+ member: 'formatPainter', args: args
20018
+ });
19325
20019
  }
19326
20020
  }
19327
20021
  };
@@ -19364,7 +20058,8 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
19364
20058
  var formatterClass = new HTMLFormatter({
19365
20059
  currentDocument: this.contentRenderer.getDocument(),
19366
20060
  element: editElement,
19367
- options: option
20061
+ options: option,
20062
+ formatPainterSettings: this.parent.formatPainterSettings
19368
20063
  });
19369
20064
  this.parent.setProperties({ formatter: formatterClass }, true);
19370
20065
  }
@@ -20858,7 +21553,6 @@ var FullScreen = /** @__PURE__ @class */ (function () {
20858
21553
  _this.parent.toolbarModule.addFixedTBarClass();
20859
21554
  }
20860
21555
  }
20861
- _this.parent.refreshUI();
20862
21556
  _this.parent.trigger(actionComplete, { requestType: 'Minimize', targetItem: 'Minimize', args: event });
20863
21557
  }
20864
21558
  });
@@ -20980,6 +21674,146 @@ function setAttributes(htmlAttributes, rte, isFrame, initial) {
20980
21674
  }
20981
21675
  }
20982
21676
 
21677
+ var FormatPainter = /** @__PURE__ @class */ (function () {
21678
+ function FormatPainter(parent) {
21679
+ this.isSticky = false;
21680
+ this.isActive = false;
21681
+ this.parent = parent;
21682
+ this.addEventListener();
21683
+ }
21684
+ FormatPainter.prototype.addEventListener = function () {
21685
+ this.parent.on(formatPainterClick, this.toolbarClick, this);
21686
+ this.parent.on(formatPainterDoubleClick, this.toolbarDoubleClick, this);
21687
+ this.parent.on(editAreaClick, this.editAreaClick, this);
21688
+ this.parent.on(keyDown, this.onKeyDown, this);
21689
+ this.parent.on(destroy, this.destroy, this);
21690
+ };
21691
+ FormatPainter.prototype.toolbarClick = function (args) {
21692
+ this.isActive = true;
21693
+ this.parent.focusIn();
21694
+ this.actionHandler(args, 'click');
21695
+ };
21696
+ FormatPainter.prototype.toolbarDoubleClick = function (args) {
21697
+ this.isActive = true;
21698
+ this.isSticky = true;
21699
+ this.parent.focusIn();
21700
+ this.actionHandler(args, 'dbClick');
21701
+ };
21702
+ FormatPainter.prototype.onKeyDown = function (event) {
21703
+ var originalEvent = event.args;
21704
+ if ((originalEvent.ctrlKey && originalEvent.shiftKey && (originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste'))
21705
+ || (originalEvent.action === 'escape' && (this.previousAction === 'format-copy' || this.previousAction === 'format-paste'))) {
21706
+ if (!isNullOrUndefined(originalEvent.key) && originalEvent.key.toLowerCase() === 'c') {
21707
+ originalEvent.preventDefault();
21708
+ }
21709
+ if (!isNullOrUndefined(originalEvent.key) && originalEvent.key.toLowerCase() === 'v' &&
21710
+ this.previousAction === 'format-copy' || this.previousAction === 'format-paste' || this.isSticky) {
21711
+ originalEvent.preventDefault();
21712
+ }
21713
+ this.actionHandler(event, 'keyBoard');
21714
+ }
21715
+ };
21716
+ FormatPainter.prototype.actionHandler = function (event, type) {
21717
+ var action;
21718
+ var isKeyboard = false;
21719
+ var originalEvent;
21720
+ var args;
21721
+ var item;
21722
+ switch (type) {
21723
+ case 'dbClick':
21724
+ args = event.args;
21725
+ item = args.item;
21726
+ originalEvent = event.args.originalEvent;
21727
+ action = 'format-copy';
21728
+ break;
21729
+ case 'keyBoard':
21730
+ args = null;
21731
+ originalEvent = event.args;
21732
+ isKeyboard = true;
21733
+ action = event.args.action;
21734
+ if (action === 'escape') {
21735
+ this.isSticky = false;
21736
+ this.isActive = false;
21737
+ }
21738
+ break;
21739
+ case 'click':
21740
+ args = event.args;
21741
+ item = args.item;
21742
+ originalEvent = event.args.originalEvent;
21743
+ action = 'format-copy';
21744
+ break;
21745
+ case 'docClick':
21746
+ originalEvent = event;
21747
+ action = 'format-paste';
21748
+ break;
21749
+ }
21750
+ this.updateCursor(isKeyboard);
21751
+ var enable = type === 'docClick' || action === 'escape' ? false : true;
21752
+ this.updateToolbarBtn(enable);
21753
+ if (isNullOrUndefined(item)) {
21754
+ item = {
21755
+ command: 'FormatPainter',
21756
+ subCommand: 'FormatPainter'
21757
+ };
21758
+ }
21759
+ var actionBeginArgs = {
21760
+ requestType: 'FormatPainter', originalEvent: originalEvent, name: action, item: item
21761
+ };
21762
+ var value = {
21763
+ formatPainterAction: action
21764
+ };
21765
+ this.parent.formatter.process(this.parent, actionBeginArgs, originalEvent, value);
21766
+ this.previousAction = action;
21767
+ };
21768
+ FormatPainter.prototype.updateCursor = function (isKeyboard) {
21769
+ if (!this.parent.inputElement.classList.contains('e-rte-cursor-brush') && !isKeyboard) {
21770
+ addClass([this.parent.inputElement], 'e-rte-cursor-brush');
21771
+ }
21772
+ else if (!this.isSticky) {
21773
+ removeClass([this.parent.inputElement], 'e-rte-cursor-brush');
21774
+ }
21775
+ };
21776
+ FormatPainter.prototype.updateToolbarBtn = function (enable) {
21777
+ var toolbarBtn = this.parent.element.querySelector('.e-rte-format-painter').parentElement.parentElement;
21778
+ if (enable) {
21779
+ addClass([toolbarBtn], 'e-active');
21780
+ }
21781
+ else if (!this.isSticky) {
21782
+ removeClass([toolbarBtn], 'e-active');
21783
+ }
21784
+ };
21785
+ FormatPainter.prototype.editAreaClick = function (args) {
21786
+ if (this.isActive) {
21787
+ if (!this.isSticky) {
21788
+ this.isActive = false;
21789
+ }
21790
+ this.actionHandler(args, 'docClick');
21791
+ this.updateToolbarBtn(false);
21792
+ }
21793
+ };
21794
+ FormatPainter.prototype.destroy = function () {
21795
+ /**Removeeventlistener */
21796
+ if (this.parent.isDestroyed) {
21797
+ return;
21798
+ }
21799
+ this.parent.off(formatPainterClick, this.toolbarClick);
21800
+ this.parent.off(editAreaClick, this.editAreaClick);
21801
+ this.parent.off(formatPainterDoubleClick, this.toolbarDoubleClick);
21802
+ this.parent.off(keyDown, this.onKeyDown);
21803
+ this.parent.off(destroy, this.destroy);
21804
+ };
21805
+ /**
21806
+ * For internal use only - Get the module name.
21807
+ *
21808
+ * @returns {void}
21809
+ * @hidden
21810
+ */
21811
+ FormatPainter.prototype.getModuleName = function () {
21812
+ return 'formatPainter';
21813
+ };
21814
+ return FormatPainter;
21815
+ }());
21816
+
20983
21817
  /**
20984
21818
  * Action export
20985
21819
  */
@@ -21279,7 +22113,8 @@ var Link = /** @__PURE__ @class */ (function () {
21279
22113
  var eventArgs = {
21280
22114
  args: event ? event.args : {
21281
22115
  item: { command: 'Links', subCommand: 'CreateLink' },
21282
- originalEvent: undefined
22116
+ originalEvent: undefined,
22117
+ name: !isInternal ? 'showDialog' : null
21283
22118
  },
21284
22119
  selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
21285
22120
  };
@@ -21998,7 +22833,8 @@ var Image = /** @__PURE__ @class */ (function () {
21998
22833
  img.setAttribute('width', (img.width + this.mouseX).toString());
21999
22834
  }
22000
22835
  else {
22001
- img.setAttribute('width', (img.offsetWidth + this.mouseX).toString());
22836
+ var currentWidth = img.offsetWidth === 0 ? img.width + this.mouseX + parseInt(img.style.outlineWidth.split('p')[0]) : img.offsetWidth + this.mouseX;
22837
+ img.setAttribute('width', (currentWidth).toString());
22002
22838
  }
22003
22839
  }
22004
22840
  }
@@ -22081,7 +22917,7 @@ var Image = /** @__PURE__ @class */ (function () {
22081
22917
  var pageX = this.getPointX(e);
22082
22918
  var pageY = this.getPointY(e);
22083
22919
  var mouseX = (this.resizeBtnStat.botLeft || this.resizeBtnStat.topLeft) ? -(pageX - this.pageX) : (pageX - this.pageX);
22084
- var mouseY = (this.resizeBtnStat.topLeft || this.resizeBtnStat.topRight) ? -(pageY - this.pageY) : (pageY - this.pageY);
22920
+ var mouseY = (this.resizeBtnStat.botLeft || this.resizeBtnStat.topLeft) ? -(pageY - this.pageY) : (pageY - this.pageY);
22085
22921
  var width = parseInt(this.imgDupPos.width, 10) + mouseX;
22086
22922
  var height = parseInt(this.imgDupPos.height, 10) + mouseY;
22087
22923
  this.mouseX = mouseX;
@@ -22252,8 +23088,9 @@ var Image = /** @__PURE__ @class */ (function () {
22252
23088
  }
22253
23089
  if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
22254
23090
  if (selectNodeEle && selectNodeEle[0].nodeName === 'IMG' && selectNodeEle.length < 1) {
22255
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
23091
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
22256
23092
  save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
23093
+ }
22257
23094
  originalEvent.preventDefault();
22258
23095
  var event_1 = {
22259
23096
  selectNode: selectNodeEle, selection: save, selectParent: selectParentEle,
@@ -22312,8 +23149,9 @@ var Image = /** @__PURE__ @class */ (function () {
22312
23149
  }
22313
23150
  break;
22314
23151
  case 'insert-image':
22315
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
23152
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
22316
23153
  save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
23154
+ }
22317
23155
  this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
22318
23156
  originalEvent.preventDefault();
22319
23157
  break;
@@ -22339,7 +23177,8 @@ var Image = /** @__PURE__ @class */ (function () {
22339
23177
  this.insertImage({
22340
23178
  args: {
22341
23179
  item: { command: 'Images', subCommand: 'Image' },
22342
- originalEvent: event
23180
+ originalEvent: event,
23181
+ name: !isInternal ? 'showDialog' : null
22343
23182
  },
22344
23183
  selectNode: selectNodeEle,
22345
23184
  selection: save,
@@ -22350,7 +23189,8 @@ var Image = /** @__PURE__ @class */ (function () {
22350
23189
  this.insertImage({
22351
23190
  args: {
22352
23191
  item: { command: 'Images', subCommand: 'Image' },
22353
- originalEvent: event
23192
+ originalEvent: event,
23193
+ name: !isInternal ? 'showDialog' : null
22354
23194
  },
22355
23195
  member: 'image',
22356
23196
  text: this.parent.formatter.editorManager.markdownSelection.getSelectedText(this.parent.contentModule.getEditPanel()),
@@ -24116,8 +24956,9 @@ var Audio = /** @__PURE__ @class */ (function () {
24116
24956
  }
24117
24957
  if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
24118
24958
  if (selectNodeEle && this.isAudioElem(selectNodeEle[0]) && selectNodeEle.length < 1) {
24119
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
24959
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
24120
24960
  save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
24961
+ }
24121
24962
  originalEvent.preventDefault();
24122
24963
  var event_1 = {
24123
24964
  selectNode: selectNodeEle, selection: save, selectParent: selectParentEle,
@@ -24166,8 +25007,9 @@ var Audio = /** @__PURE__ @class */ (function () {
24166
25007
  }
24167
25008
  break;
24168
25009
  case 'insert-audio':
24169
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
25010
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
24170
25011
  save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
25012
+ }
24171
25013
  this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
24172
25014
  originalEvent.preventDefault();
24173
25015
  break;
@@ -24193,7 +25035,8 @@ var Audio = /** @__PURE__ @class */ (function () {
24193
25035
  this.insertAudio({
24194
25036
  args: {
24195
25037
  item: { command: 'Audios', subCommand: 'Audio' },
24196
- originalEvent: event
25038
+ originalEvent: event,
25039
+ name: !isInternal ? 'showDialog' : null
24197
25040
  },
24198
25041
  selectNode: selectNodeEle,
24199
25042
  selection: save,
@@ -25217,7 +26060,7 @@ var Video = /** @__PURE__ @class */ (function () {
25217
26060
  var height = vidEleStyle.height !== '' ? parseInt(vidEleStyle.height, 10) : vid.style.height !== '' ? vid.style.height : vid.height;
25218
26061
  if (width > height) {
25219
26062
  vid.style.minWidth = this.parent.insertVideoSettings.minWidth === 0 ? '140px' : formatUnit(this.parent.insertVideoSettings.minWidth);
25220
- vid.style.minHeight = this.parent.insertVideoSettings.minHeight === 0 ? '50px' : formatUnit(this.parent.insertVideoSettings.minHeight);
26063
+ vid.style.minHeight = this.parent.insertVideoSettings.minHeight === 0 ? '60px' : formatUnit(this.parent.insertVideoSettings.minHeight);
25221
26064
  if (this.parent.insertVideoSettings.resizeByPercent) {
25222
26065
  if (parseInt('' + vid.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
25223
26066
  var percentageValue = this.pixToPerc((parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY), (vid.previousElementSibling || vid.parentElement));
@@ -25429,8 +26272,9 @@ var Video = /** @__PURE__ @class */ (function () {
25429
26272
  }
25430
26273
  if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
25431
26274
  if (selectNodeEle && (selectNodeEle[0].nodeName === 'VIDEO' || this.isEmbedVidElem(selectNodeEle[0])) && selectNodeEle.length < 1) {
25432
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
26275
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
25433
26276
  save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
26277
+ }
25434
26278
  originalEvent.preventDefault();
25435
26279
  var event_1 = {
25436
26280
  selectNode: selectNodeEle, selection: save, selectParent: selectParentEle,
@@ -25483,8 +26327,9 @@ var Video = /** @__PURE__ @class */ (function () {
25483
26327
  }
25484
26328
  break;
25485
26329
  case 'insert-video':
25486
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
26330
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
25487
26331
  save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
26332
+ }
25488
26333
  this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
25489
26334
  originalEvent.preventDefault();
25490
26335
  break;
@@ -25510,7 +26355,8 @@ var Video = /** @__PURE__ @class */ (function () {
25510
26355
  this.insertVideo({
25511
26356
  args: {
25512
26357
  item: { command: 'Videos', subCommand: 'Video' },
25513
- originalEvent: event
26358
+ originalEvent: event,
26359
+ name: !isInternal ? 'showDialog' : null
25514
26360
  },
25515
26361
  selectNode: selectNodeEle,
25516
26362
  selection: save,
@@ -25759,7 +26605,7 @@ var Video = /** @__PURE__ @class */ (function () {
25759
26605
  };
25760
26606
  Video.prototype.showVideoQuickToolbar = function (e) {
25761
26607
  var _this = this;
25762
- if (e.type !== 'Videos' || e.args.detail === 2 || isNullOrUndefined(this.parent.quickToolbarModule)
26608
+ if (e.type !== 'Videos' || (!isNullOrUndefined(e.args) && e.args.detail === 2) || isNullOrUndefined(this.parent.quickToolbarModule)
25763
26609
  || isNullOrUndefined(this.parent.quickToolbarModule.videoQTBar) || isNullOrUndefined(e.args)) {
25764
26610
  return;
25765
26611
  }
@@ -26311,7 +27157,7 @@ var ViewSource = /** @__PURE__ @class */ (function () {
26311
27157
  break;
26312
27158
  case 'toolbar-focus':
26313
27159
  if (this.parent.toolbarSettings.enable) {
26314
- var selector = '.e-toolbar-item[aria-disabled="false"][title] [tabindex]';
27160
+ var selector = '.e-toolbar-item[title] [tabindex]';
26315
27161
  this.parent.toolbarModule.baseToolbar.toolbarObj.element.querySelector(selector).focus();
26316
27162
  }
26317
27163
  break;
@@ -26681,8 +27527,9 @@ var Table = /** @__PURE__ @class */ (function () {
26681
27527
  if ((event.keyCode === 8 || event.keyCode === 46) ||
26682
27528
  (event.ctrlKey && event.keyCode === 88)) {
26683
27529
  if (ele && ele.tagName === 'TBODY') {
26684
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule)
27530
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule) {
26685
27531
  selection = this.parent.formatter.editorManager.nodeSelection.save(range, this.contentModule.getDocument());
27532
+ }
26686
27533
  event.preventDefault();
26687
27534
  proxy.removeTable(selection, event, true);
26688
27535
  }
@@ -26696,8 +27543,9 @@ var Table = /** @__PURE__ @class */ (function () {
26696
27543
  ele = !isNullOrUndefined(closestTd) && this.parent.inputElement.contains(closestTd) ? closestTd : ele;
26697
27544
  }
26698
27545
  if (ele && (ele.tagName === 'TD' || ele.tagName === 'TH')) {
26699
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule)
27546
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule) {
26700
27547
  selection = this.parent.formatter.editorManager.nodeSelection.save(range, this.contentModule.getDocument());
27548
+ }
26701
27549
  switch (event.keyCode) {
26702
27550
  case 9:
26703
27551
  case 37:
@@ -26740,7 +27588,8 @@ var Table = /** @__PURE__ @class */ (function () {
26740
27588
  item: {
26741
27589
  command: 'Table',
26742
27590
  subCommand: 'CreateTable'
26743
- }
27591
+ },
27592
+ name: !isInternal ? 'showDialog' : null
26744
27593
  };
26745
27594
  this.insertTableDialog({ self: this, args: args, selection: selection });
26746
27595
  }
@@ -26965,9 +27814,18 @@ var Table = /** @__PURE__ @class */ (function () {
26965
27814
  var range_1 = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
26966
27815
  this.parent.formatter.editorManager.nodeSelection.save(range_1, this.contentModule.getDocument());
26967
27816
  this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
26968
- var pageX = (this.parent.iframeSettings.enable) ? window.pageXOffset + this.parent.element.getBoundingClientRect().left + args.clientX : args.pageX;
26969
- var pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
26970
- this.parent.element.getBoundingClientRect().top + args.clientY : args.pageY;
27817
+ var pageX = void 0;
27818
+ var pageY = void 0;
27819
+ if (Browser.isDevice && e.args.touches) {
27820
+ pageX = e.args.changedTouches[0].pageX;
27821
+ pageY = e.args.changedTouches[0].pageY;
27822
+ }
27823
+ else {
27824
+ pageX = (this.parent.iframeSettings.enable) ? window.pageXOffset
27825
+ + this.parent.element.getBoundingClientRect().left + args.clientX : args.pageX;
27826
+ pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
27827
+ this.parent.element.getBoundingClientRect().top + args.clientY : args.pageY;
27828
+ }
26971
27829
  this.quickToolObj.tableQTBar.showPopup(pageX, pageY, target);
26972
27830
  this.parent.formatter.editorManager.nodeSelection.restore();
26973
27831
  }
@@ -28187,6 +29045,18 @@ var executeGroup = {
28187
29045
  'removeFormat': {
28188
29046
  command: 'Clear',
28189
29047
  subCommand: 'ClearFormat'
29048
+ },
29049
+ 'copyFormatPainter': {
29050
+ command: 'FormatPainter',
29051
+ value: 'format-copy'
29052
+ },
29053
+ 'applyFormatPainter': {
29054
+ command: 'FormatPainter',
29055
+ value: 'format-paste'
29056
+ },
29057
+ 'escapeFormatPainter': {
29058
+ command: 'FormatPainter',
29059
+ value: 'escape'
28190
29060
  }
28191
29061
  };
28192
29062
 
@@ -28486,6 +29356,25 @@ var QuickToolbarSettings = /** @__PURE__ @class */ (function (_super) {
28486
29356
  ], QuickToolbarSettings.prototype, "table", void 0);
28487
29357
  return QuickToolbarSettings;
28488
29358
  }(ChildProperty));
29359
+ /**
29360
+ * Configure the format painter settings of the Rich Text Editor.
29361
+ */
29362
+ var FormatPainterSettings = /** @__PURE__ @class */ (function (_super) {
29363
+ __extends$5(FormatPainterSettings, _super);
29364
+ function FormatPainterSettings() {
29365
+ return _super !== null && _super.apply(this, arguments) || this;
29366
+ }
29367
+ __decorate$2([
29368
+ Property(['Text', 'List', 'Table'])
29369
+ ], FormatPainterSettings.prototype, "allowedContext", void 0);
29370
+ __decorate$2([
29371
+ Property('b; em; font; sub; sup; kbd; i; s; u; code; strong; span; p; div; h1; h2; h3; h4; h5; h6; blockquote; table; thead; tbody; tr; td; th; ol; ul; li; pre;')
29372
+ ], FormatPainterSettings.prototype, "allowedFormats", void 0);
29373
+ __decorate$2([
29374
+ Property(null)
29375
+ ], FormatPainterSettings.prototype, "deniedFormats", void 0);
29376
+ return FormatPainterSettings;
29377
+ }(ChildProperty));
28489
29378
  /**
28490
29379
  * Configures the Paste Cleanup settings of the RichTextEditor.
28491
29380
  */
@@ -28786,7 +29675,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
28786
29675
  isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
28787
29676
  }
28788
29677
  if (e.args.which === 13 && e.args.code === 'Enter') {
28789
- if (isNullOrUndefined(this.startNode.closest('LI,UL,OL')) && isNullOrUndefined(this.endNode.closest('LI,UL,OL')) && isTableEnter &&
29678
+ if (isNullOrUndefined(this.startNode.closest('LI, UL, OL')) && isNullOrUndefined(this.endNode.closest('LI, UL, OL')) && isTableEnter &&
28790
29679
  isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
28791
29680
  var shiftKey_1 = e.args.shiftKey;
28792
29681
  var actionBeginArgs = {
@@ -28856,11 +29745,6 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
28856
29745
  }
28857
29746
  if (_this.range.startContainer === _this.range.endContainer &&
28858
29747
  _this.range.startOffset === _this.range.endOffset && _this.range.startContainer === _this.parent.inputElement) {
28859
- if (!isNullOrUndefined(_this.range.startContainer.childNodes[_this.range.startOffset]) &&
28860
- !isNullOrUndefined(_this.range.startContainer.childNodes[_this.range.startOffset].previousElementSibling) &&
28861
- _this.range.startContainer.childNodes[_this.range.startOffset].previousElementSibling.nodeName === 'TABLE') {
28862
- _this.parent.tableModule.removeResizeElement();
28863
- }
28864
29748
  if (!(_this.parent.inputElement.childNodes.length === 1 && _this.parent.inputElement.childNodes[0].nodeName === 'TABLE')) {
28865
29749
  if (isNullOrUndefined(_this.range.startContainer.childNodes[_this.range.startOffset])) {
28866
29750
  var currentLastElem = _this.range.startContainer.childNodes[_this.range.startOffset - 1];
@@ -28896,7 +29780,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
28896
29780
  var isFocusedFirst = false;
28897
29781
  if (_this.range.startOffset !== 0 && _this.range.endOffset !== 0 &&
28898
29782
  _this.range.startContainer === _this.range.endContainer && !(!isNullOrUndefined(nearBlockNode.childNodes[0])
28899
- && nearBlockNode.childNodes[0].nodeName === 'IMG' && nearBlockNode.querySelectorAll('img,audio,video').length > 0)) {
29783
+ && nearBlockNode.childNodes[0].nodeName === 'IMG' && nearBlockNode.querySelectorAll('img, audio, video').length > 0)) {
28900
29784
  var startNodeText = _this.range.startContainer.textContent;
28901
29785
  var splitFirstText = startNodeText.substring(0, _this.range.startOffset);
28902
29786
  // eslint-disable-next-line max-len
@@ -28917,8 +29801,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
28917
29801
  (_this.range.startContainer.previousSibling.nodeName === 'IMG' || _this.range.startContainer.previousSibling.nodeName === 'BR'))) {
28918
29802
  var isNearBlockLengthZero = void 0;
28919
29803
  var newElem = void 0;
28920
- if (!isNullOrUndefined(_this.range.startContainer.childNodes) && _this.range.startContainer.textContent.length === 0 &&
28921
- (_this.range.startContainer.querySelectorAll('img,audio,video').length > 0 ||
29804
+ if (!isNullOrUndefined(_this.range.startContainer.childNodes) && _this.range.startContainer.textContent.length === 0
29805
+ && (_this.range.startContainer.querySelectorAll('img, audio, video').length > 0 ||
28922
29806
  _this.range.startContainer.nodeName === 'IMG' || _this.range.startContainer.nodeName === 'TABLE')) {
28923
29807
  newElem = _this.createInsertElement(shiftKey_1);
28924
29808
  isMediaNode = true;
@@ -28927,7 +29811,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
28927
29811
  else {
28928
29812
  if ((nearBlockNode.textContent.trim().length !== 0 ||
28929
29813
  nearBlockNode.childNodes[0].nodeName === 'IMG' ||
28930
- (nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img,audio,video').length > 0))) {
29814
+ (nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img, audio, video').length > 0))) {
28931
29815
  if ((_this.range.startOffset === _this.range.endOffset && _this.range.startOffset !== 0)) {
28932
29816
  newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
28933
29817
  }
@@ -29314,6 +30198,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
29314
30198
  member: 'video',
29315
30199
  args: [this, this.serviceLocator]
29316
30200
  });
30201
+ modules.push({
30202
+ member: 'formatPainter',
30203
+ args: [this]
30204
+ });
29317
30205
  }
29318
30206
  if (this.fileManagerSettings.enable) {
29319
30207
  modules.push({ member: 'fileManager', args: [this, this.serviceLocator] });
@@ -29383,7 +30271,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
29383
30271
  this.setContainer();
29384
30272
  this.persistData();
29385
30273
  setStyleAttribute(this.element, { 'width': formatUnit(this.width) });
29386
- attributes(this.element, { role: 'application' });
30274
+ attributes(this.element, { role: 'application', 'aria-label': 'Rich Text Editor' });
29387
30275
  };
29388
30276
  RichTextEditor.prototype.persistData = function () {
29389
30277
  if (this.enablePersistence && this.originalElement.tagName === 'TEXTAREA') {
@@ -29524,6 +30412,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
29524
30412
  */
29525
30413
  RichTextEditor.prototype.executeCommand = function (commandName, value, option) {
29526
30414
  value = this.htmlPurifier(commandName, value);
30415
+ var internalValue;
29527
30416
  if (this.editorMode === 'HTML') {
29528
30417
  var range = this.getRange();
29529
30418
  if (this.iframeSettings.enable) {
@@ -29570,7 +30459,16 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
29570
30459
  return;
29571
30460
  }
29572
30461
  }
29573
- this.formatter.editorManager.execCommand(tool.command, tool.subCommand ? tool.subCommand : (value ? value : tool.value), null, null, (value ? value : tool.value), (value ? value : tool.value));
30462
+ internalValue = value;
30463
+ if (tool.command === 'FormatPainter') {
30464
+ if (!isNullOrUndefined(value)) {
30465
+ this.formatPainterSettings = value;
30466
+ }
30467
+ internalValue = {
30468
+ formatPainterAction: tool.value
30469
+ };
30470
+ }
30471
+ this.formatter.editorManager.execCommand(tool.command, tool.subCommand ? tool.subCommand : (internalValue ? internalValue : tool.value), null, null, (internalValue ? internalValue : tool.value), (internalValue ? internalValue : tool.value));
29574
30472
  if (option && option.undo) {
29575
30473
  this.formatter.saveData();
29576
30474
  this.formatter.enableUndo(this);
@@ -29824,6 +30722,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
29824
30722
  var currentEndContainer = range.endContainer;
29825
30723
  var currentStartOffset = range.startOffset;
29826
30724
  var isSameContainer = currentStartContainer === currentEndContainer ? true : false;
30725
+ var currentEndOffset = currentEndContainer.textContent.length;
29827
30726
  var endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
29828
30727
  range.endContainer;
29829
30728
  var closestLI = closest(endNode, 'LI');
@@ -29909,14 +30808,21 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
29909
30808
  this.formatter.saveData();
29910
30809
  }
29911
30810
  if (e.action !== 'insert-link' &&
30811
+ e.action !== 'format-copy' && e.action !== 'format-paste' &&
29912
30812
  (e.action && e.action !== 'paste' && e.action !== 'space'
29913
30813
  || e.which === 9 || (e.code === 'Backspace' && e.which === 8))) {
29914
- this.formatter.process(this, null, e);
30814
+ var FormatPainterEscapeAction = false;
30815
+ if (!isNullOrUndefined(this.formatPainterModule)) {
30816
+ FormatPainterEscapeAction = this.formatPainterModule.previousAction === 'escape';
30817
+ }
30818
+ if (!FormatPainterEscapeAction) {
30819
+ this.formatter.process(this, null, e);
30820
+ }
29915
30821
  switch (e.action) {
29916
30822
  case 'toolbar-focus':
29917
30823
  if (this.toolbarSettings.enable) {
29918
30824
  // eslint-disable-next-line
29919
- var selector = '.e-toolbar-item[aria-disabled="false"][title] [tabindex]';
30825
+ var selector = '.e-toolbar-item[title] [tabindex]';
29920
30826
  this.toolbarModule.baseToolbar.toolbarObj.element.querySelector(selector).focus();
29921
30827
  }
29922
30828
  break;
@@ -30864,6 +31770,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
30864
31770
  }
30865
31771
  else {
30866
31772
  var compiledTemplate = compile(this.valueTemplate)('', this, 'valueTemplate');
31773
+ // eslint-disable-next-line
30867
31774
  if (typeof this.valueTemplate !== 'string' && this.isReact) {
30868
31775
  this.displayTempElem = this.createElement('div');
30869
31776
  for (var i = 0; i < compiledTemplate.length; i++) {
@@ -30903,7 +31810,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
30903
31810
  }
30904
31811
  }
30905
31812
  };
30906
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
31813
+ // eslint-disable-next-line
30907
31814
  RichTextEditor.prototype.renderTemplates = function (callBack) {
30908
31815
  this.renderReactTemplates(callBack);
30909
31816
  };
@@ -31017,7 +31924,9 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
31017
31924
  * @public
31018
31925
  */
31019
31926
  RichTextEditor.prototype.getHtml = function () {
31020
- return this.serializeValue(this.contentModule.getEditPanel().innerHTML);
31927
+ var htmlValue = this.contentModule.getEditPanel().innerHTML;
31928
+ return (this.enableXhtml && (htmlValue === '<p><br></p>' || htmlValue === '<div><br></div>' ||
31929
+ htmlValue === '<br>') ? null : this.serializeValue(htmlValue));
31021
31930
  };
31022
31931
  /**
31023
31932
  * Retrieves the Rich Text Editor's XHTML validated HTML content when `enableXhtml` property is enabled.
@@ -31268,8 +32177,8 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
31268
32177
  }
31269
32178
  var getTextArea = this.element.querySelector('.e-rte-srctextarea');
31270
32179
  if (this.editorMode === 'HTML') {
31271
- value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>'
31272
- || this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
32180
+ value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
32181
+ this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
31273
32182
  this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
31274
32183
  if (getTextArea && getTextArea.style.display === 'block') {
31275
32184
  value = getTextArea.value;
@@ -31621,6 +32530,9 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
31621
32530
  __decorate$1([
31622
32531
  Complex({}, PasteCleanupSettings)
31623
32532
  ], RichTextEditor.prototype, "pasteCleanupSettings", void 0);
32533
+ __decorate$1([
32534
+ Complex({}, FormatPainterSettings)
32535
+ ], RichTextEditor.prototype, "formatPainterSettings", void 0);
31624
32536
  __decorate$1([
31625
32537
  Complex({}, IFrameSettings)
31626
32538
  ], RichTextEditor.prototype, "iframeSettings", void 0);
@@ -31651,6 +32563,9 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
31651
32563
  __decorate$1([
31652
32564
  Property(false)
31653
32565
  ], RichTextEditor.prototype, "enablePersistence", void 0);
32566
+ __decorate$1([
32567
+ Property(true)
32568
+ ], RichTextEditor.prototype, "showTooltip", void 0);
31654
32569
  __decorate$1([
31655
32570
  Property(false)
31656
32571
  ], RichTextEditor.prototype, "enableResize", void 0);
@@ -31891,10 +32806,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
31891
32806
  * Base export
31892
32807
  */
31893
32808
 
31894
- /**
31895
- * Base export
31896
- */
31897
-
31898
32809
  /**
31899
32810
  * Export all markdown plugins
31900
32811
  */
@@ -31911,5 +32822,5 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
31911
32822
  * Rich Text Editor component exported items
31912
32823
  */
31913
32824
 
31914
- 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, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, 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, blockEmptyNodes, inlineEmptyNodes, 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_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_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, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, 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, 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, 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 };
32825
+ 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, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, 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, blockEmptyNodes, inlineEmptyNodes, 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_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_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, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, 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, 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, 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 };
31915
32826
  //# sourceMappingURL=ej2-richtexteditor.es5.js.map