@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 @@ const closeTableDialog = 'closeTableDialog';
719
719
  * @deprecated
720
720
  */
721
721
  const bindCssClass = 'closeTableDialog';
722
+ /**
723
+ * @hidden
724
+ * @deprecated
725
+ */
726
+ const formatPainterClick = 'formatPainterClick';
727
+ /**
728
+ * @hidden
729
+ * @deprecated
730
+ */
731
+ const formatPainterDoubleClick = 'formatPainterDoubleClick';
722
732
  /**
723
733
  * @hidden
724
734
  * @deprecated
@@ -1953,6 +1963,13 @@ let tools = {
1953
1963
  'tooltip': 'Styles',
1954
1964
  'command': 'Table',
1955
1965
  'subCommand': 'Styles'
1966
+ },
1967
+ 'formatpainter': {
1968
+ 'id': 'FormatPainter',
1969
+ 'icon': 'e-rte-format-painter',
1970
+ 'tooltip': 'Format Painter',
1971
+ 'command': 'FormatPainter',
1972
+ 'subCommand': 'FormatPainter'
1956
1973
  }
1957
1974
  };
1958
1975
  let alignmentLocale = [
@@ -2142,6 +2159,31 @@ function updateDropDownLocale(self) {
2142
2159
  TableStyleItems[i].text = getLocale(self, tableStyleLocale, TableStyleItems[i]);
2143
2160
  });
2144
2161
  }
2162
+ let windowKeys = {
2163
+ 'Insert Link': 'Ctrl + K',
2164
+ 'Insert Image': 'Ctrl + Shift + I',
2165
+ 'Create Table': 'Ctrl + Shift + E',
2166
+ 'Undo': 'Ctrl + Z',
2167
+ 'Redo': 'Ctrl + Y',
2168
+ 'Copy': 'Ctrl + C',
2169
+ 'Cut': 'Ctrl + X',
2170
+ 'Paste': 'Ctrl + V',
2171
+ 'Bold': 'Ctrl + B',
2172
+ 'Italic': 'Ctrl + I',
2173
+ 'Underline': 'Ctrl + U',
2174
+ 'Strikethrough': 'Ctrl + Shift + S',
2175
+ 'Upper Case': 'Ctrl + Shift + U',
2176
+ 'Lower Case': 'Ctrl + Shift + L',
2177
+ 'Superscript': 'Ctrl + Shift + =',
2178
+ 'Subscript': 'Ctrl + =',
2179
+ 'Source Code': 'Ctrl + Shift + H',
2180
+ 'Maximize': 'Ctrl + Shift + F',
2181
+ 'Minimize': 'Esc',
2182
+ 'Clear Format': 'Ctrl + Shift + R',
2183
+ 'Numbered List': 'Ctrl + Shift + O',
2184
+ 'Bulleted List': 'Ctrl + Alt + O',
2185
+ 'Format Painter': 'Ctrl + Shift + C, Ctrl + Shift + V'
2186
+ };
2145
2187
 
2146
2188
  /* eslint-disable */
2147
2189
  /**
@@ -2335,7 +2377,8 @@ let defaultLocale = {
2335
2377
  'bulletFormatListCircle': 'Circle',
2336
2378
  'bulletFormatListSquare': 'Square',
2337
2379
  'numberFormatListNone': 'None',
2338
- 'bulletFormatListNone': 'None'
2380
+ 'bulletFormatListNone': 'None',
2381
+ 'formatPainter': 'Format Painter'
2339
2382
  };
2340
2383
  let toolsLocale = {
2341
2384
  'alignments': 'alignments',
@@ -2422,7 +2465,8 @@ let toolsLocale = {
2422
2465
  'alignbottom': 'AlignBottom',
2423
2466
  'insertrowbefore': 'insertRowBefore',
2424
2467
  'insertrowafter': 'insertRowAfter',
2425
- 'deleterow': 'deleteRow'
2468
+ 'deleterow': 'deleteRow',
2469
+ 'formatpainter': 'formatPainter'
2426
2470
  };
2427
2471
  let fontNameLocale = [
2428
2472
  { locale: 'fontNameSegoeUI', value: 'Segoe UI' },
@@ -2964,6 +3008,8 @@ function decode(value) {
2964
3008
  function sanitizeHelper(value, parent) {
2965
3009
  if (parent.enableHtmlSanitizer) {
2966
3010
  const item = SanitizeHtmlHelper.beforeSanitize();
3011
+ if (item.selectors.tags[2] && item.selectors.tags[2].indexOf('iframe') > -1)
3012
+ item.selectors.tags[2] = 'iframe:not(.e-rte-embed-url)';
2967
3013
  const beforeEvent = {
2968
3014
  cancel: false,
2969
3015
  helper: null
@@ -3144,6 +3190,14 @@ class ToolbarRenderer {
3144
3190
  args.rteToolbarObj.toolbarObj.isStringTemplate = true;
3145
3191
  args.rteToolbarObj.toolbarObj.createElement = this.parent.createElement;
3146
3192
  args.rteToolbarObj.toolbarObj.appendTo(args.target);
3193
+ if (this.parent.showTooltip) {
3194
+ const tooltip = new Tooltip({
3195
+ target: '#' + this.parent.getID() + '_toolbar_wrapper [title]',
3196
+ showTipPointer: true,
3197
+ cssClass: this.parent.cssClass
3198
+ });
3199
+ tooltip.appendTo(args.target);
3200
+ }
3147
3201
  }
3148
3202
  /**
3149
3203
  * renderDropDownButton method
@@ -3249,6 +3303,7 @@ class ToolbarRenderer {
3249
3303
  dropDown.createElement = proxy.parent.createElement;
3250
3304
  dropDown.appendTo(args.element);
3251
3305
  args.element.tabIndex = -1;
3306
+ args.element.setAttribute('role', 'button');
3252
3307
  const popupElement = document.getElementById(dropDown.element.id + '-popup');
3253
3308
  popupElement.setAttribute('aria-owns', this.parent.getID());
3254
3309
  if (args.element.childElementCount === 1) {
@@ -3694,13 +3749,23 @@ class BaseToolbar {
3694
3749
  case '-':
3695
3750
  return { type: 'Separator', cssClass: CLS_HR_SEPARATOR };
3696
3751
  default:
3697
- return {
3698
- id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
3699
- prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
3700
- tooltipText: getTooltipText(itemStr, this.locator),
3701
- command: this.tools[itemStr.toLocaleLowerCase()].command,
3702
- subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
3703
- };
3752
+ if (this.parent.showTooltip) {
3753
+ return {
3754
+ id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
3755
+ prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
3756
+ tooltipText: getTooltipText(itemStr, this.locator),
3757
+ command: this.tools[itemStr.toLocaleLowerCase()].command,
3758
+ subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
3759
+ };
3760
+ }
3761
+ else {
3762
+ return {
3763
+ id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
3764
+ prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
3765
+ command: this.tools[itemStr.toLocaleLowerCase()].command,
3766
+ subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
3767
+ };
3768
+ }
3704
3769
  }
3705
3770
  }
3706
3771
  }
@@ -3742,6 +3807,19 @@ class BaseToolbar {
3742
3807
  items.push(item);
3743
3808
  }
3744
3809
  }
3810
+ for (let num = 0; num < items.length; num++) {
3811
+ const tooltipText = items[num].tooltipText;
3812
+ let shortCutKey;
3813
+ if (windowKeys[`${tooltipText}`]) {
3814
+ shortCutKey = Browser.isDevice && isIDevice() ? windowKeys[`${tooltipText}`].replace('Ctrl', 'Cmd') : windowKeys[`${tooltipText}`];
3815
+ }
3816
+ else {
3817
+ shortCutKey = tooltipText;
3818
+ }
3819
+ if (shortCutKey) {
3820
+ items[num].tooltipText = (tooltipText !== shortCutKey) ? tooltipText + ' (' + shortCutKey + ')' : tooltipText;
3821
+ }
3822
+ }
3745
3823
  return items;
3746
3824
  }
3747
3825
  getToolbarOptions(args) {
@@ -4740,7 +4818,7 @@ class Toolbar$2 {
4740
4818
  * @deprecated
4741
4819
  */
4742
4820
  updateItem(args) {
4743
- let item = this.tools[args.updateItem.toLocaleLowerCase()];
4821
+ const item = this.tools[args.updateItem.toLocaleLowerCase()];
4744
4822
  if (this.parent.locale !== 'en-US') {
4745
4823
  item.tooltip = getTooltipText(args.updateItem.toLocaleLowerCase(), this.locator);
4746
4824
  }
@@ -4753,6 +4831,7 @@ class Toolbar$2 {
4753
4831
  args.baseToolbar.toolbarObj.items[index].tooltipText = item.tooltip;
4754
4832
  args.baseToolbar.toolbarObj.items[index].subCommand = item.subCommand;
4755
4833
  args.baseToolbar.toolbarObj.dataBind();
4834
+ args.baseToolbar.toolbarObj.refreshOverflow();
4756
4835
  }
4757
4836
  else {
4758
4837
  this.addTBarItem(args, 0);
@@ -4893,7 +4972,11 @@ class Toolbar$2 {
4893
4972
  * @deprecated
4894
4973
  */
4895
4974
  refreshToolbarOverflow() {
4975
+ this.parent.element.classList.remove(CLS_RTL);
4896
4976
  this.baseToolbar.toolbarObj.refreshOverflow();
4977
+ if (this.parent.enableRtl) {
4978
+ this.parent.element.classList.add(CLS_RTL);
4979
+ }
4897
4980
  }
4898
4981
  isToolbarDestroyed() {
4899
4982
  return this.baseToolbar.toolbarObj && !this.baseToolbar.toolbarObj.isDestroyed;
@@ -5652,7 +5735,9 @@ class BaseQuickToolbar {
5652
5735
  let x;
5653
5736
  let y;
5654
5737
  const imgWrapper = closest(e.target, '.e-img-caption');
5655
- const target = !isNullOrUndefined(imgWrapper) ? imgWrapper : e.target;
5738
+ const isAligned = (e.target.classList.contains('e-imginline') ||
5739
+ e.target.classList.contains('e-imgbreak')) ? false : true;
5740
+ let target = !isNullOrUndefined(imgWrapper) ? imgWrapper : e.target;
5656
5741
  addClass([this.toolbarElement], [CLS_RM_WHITE_SPACE]);
5657
5742
  const targetOffsetTop = target.offsetTop;
5658
5743
  const parentOffsetTop = window.pageYOffset + e.parentData.top;
@@ -5665,6 +5750,7 @@ class BaseQuickToolbar {
5665
5750
  else {
5666
5751
  y = e.y;
5667
5752
  }
5753
+ target = isAligned ? e.target : target;
5668
5754
  if (target.offsetWidth > e.popWidth) {
5669
5755
  x = (target.offsetWidth / 2) - (e.popWidth / 2) + e.parentData.left + target.offsetLeft;
5670
5756
  }
@@ -5795,6 +5881,13 @@ class BaseQuickToolbar {
5795
5881
  this.parent.enableToolbarItem(['Undo', 'Redo']);
5796
5882
  }
5797
5883
  append([this.element], document.body);
5884
+ if (this.parent.showTooltip) {
5885
+ this.tooltip = new Tooltip({
5886
+ target: '#' + this.element.id + ' [title]',
5887
+ showTipPointer: true
5888
+ });
5889
+ this.tooltip.appendTo(this.element);
5890
+ }
5798
5891
  this.popupObj.position.X = x + 20;
5799
5892
  this.popupObj.position.Y = y + 20;
5800
5893
  this.popupObj.dataBind();
@@ -5861,6 +5954,16 @@ class BaseQuickToolbar {
5861
5954
  if (Browser.isDevice && !isIDevice()) {
5862
5955
  removeClass([this.parent.getToolbar()], [CLS_HIDE]);
5863
5956
  }
5957
+ if (!isNullOrUndefined(document.querySelector('.e-tooltip-wrap'))) {
5958
+ if (!isNullOrUndefined(document.querySelector('#' + this.element.id + ' [data-tooltip-id]'))) {
5959
+ let tooltipTargetEle = document.querySelector('#' + this.element.id + ' [data-tooltip-id]');
5960
+ let dataContent = tooltipTargetEle.getAttribute('data-content');
5961
+ tooltipTargetEle.removeAttribute('data-content');
5962
+ tooltipTargetEle.setAttribute('title', dataContent);
5963
+ tooltipTargetEle.removeAttribute('data-tooltip-id');
5964
+ }
5965
+ this.tooltip.destroy();
5966
+ }
5864
5967
  if (!isNullOrUndefined(this.parent.getToolbar()) && !this.parent.inlineMode.enable) {
5865
5968
  if (isNullOrUndefined(viewSourcePanel) || viewSourcePanel.style.display === 'none') {
5866
5969
  this.parent.enableToolbarItem(this.parent.toolbarSettings.items);
@@ -6962,6 +7065,7 @@ function setEditFrameFocus(editableElement, selector) {
6962
7065
  }
6963
7066
  /**
6964
7067
  * @param {string} value - specifies the string value
7068
+ * @param {string} enterAction - specifies the enter key action API
6965
7069
  * @returns {void}
6966
7070
  * @hidden
6967
7071
  */
@@ -7333,6 +7437,12 @@ const ON_BEGIN = 'onBegin';
7333
7437
  * @hidden
7334
7438
  */
7335
7439
  const SPACE_ACTION = 'actionBegin';
7440
+ /**
7441
+ * Format painter event constant
7442
+ *
7443
+ * @hidden
7444
+ */
7445
+ const FORMAT_PAINTER_ACTIONS = 'format_painter_actions';
7336
7446
 
7337
7447
  /**
7338
7448
  * Formatter
@@ -7356,8 +7466,14 @@ class Formatter {
7356
7466
  const selection = self.contentModule.getDocument().getSelection();
7357
7467
  const range = (selection.rangeCount > 0) ? selection.getRangeAt(selection.rangeCount - 1) : null;
7358
7468
  let saveSelection;
7469
+ const isKeyboardVideoInsert = (!isNullOrUndefined(value) && !isNullOrUndefined(value.cssClass) &&
7470
+ value.cssClass !== 'e-video-inline');
7359
7471
  if (self.editorMode === 'HTML') {
7360
- saveSelection = this.editorManager.nodeSelection.save(range, self.contentModule.getDocument());
7472
+ if (!isNullOrUndefined(args) && !isKeyboardVideoInsert) {
7473
+ if (isNullOrUndefined(args.name) || (!isNullOrUndefined(args.name) && args.name !== 'showDialog')) {
7474
+ saveSelection = this.editorManager.nodeSelection.save(range, self.contentModule.getDocument());
7475
+ }
7476
+ }
7361
7477
  }
7362
7478
  if (!isNullOrUndefined(args)
7363
7479
  && args.item.command
@@ -7433,18 +7549,21 @@ class Formatter {
7433
7549
  && args.item.command !== 'Font')
7434
7550
  || ((args.item.subCommand === 'FontName' || args.item.subCommand === 'FontSize') && args.name === 'dropDownSelect')
7435
7551
  || ((args.item.subCommand === 'BackgroundColor' || args.item.subCommand === 'FontColor')
7436
- && args.name === 'colorPickerChanged'))) {
7552
+ && args.name === 'colorPickerChanged') || args.item.subCommand === 'FormatPainter')) {
7437
7553
  extend(args, args, { requestType: args.item.subCommand, cancel: false, itemCollection: value, selectType: args.name }, true);
7438
7554
  self.trigger(actionBegin, args, (actionBeginArgs) => {
7439
7555
  if (!actionBeginArgs.cancel) {
7556
+ const formatPainterCopyAction = !isNullOrUndefined(actionBeginArgs.name) && actionBeginArgs.name === 'format-copy';
7440
7557
  if (this.getUndoRedoStack().length === 0 && actionBeginArgs.item.command !== 'Links'
7441
- && actionBeginArgs.item.command !== 'Images') {
7558
+ && actionBeginArgs.item.command !== 'Images' && !formatPainterCopyAction) {
7442
7559
  this.saveData();
7443
7560
  }
7444
7561
  self.isBlur = false;
7445
7562
  self.contentModule.getEditPanel().focus();
7446
- if (self.editorMode === 'HTML') {
7447
- saveSelection.restore();
7563
+ if (self.editorMode === 'HTML' && !isKeyboardVideoInsert) {
7564
+ if (isNullOrUndefined(args.selectType) || (!isNullOrUndefined(args.selectType) && args.selectType !== 'showDialog')) {
7565
+ saveSelection.restore();
7566
+ }
7448
7567
  }
7449
7568
  const command = actionBeginArgs.item.subCommand.toLocaleLowerCase();
7450
7569
  if (command === 'paste' || command === 'cut' || command === 'copy') {
@@ -8713,7 +8832,9 @@ const htmlKeyConfig = {
8713
8832
  'space': '32',
8714
8833
  'enter': '13',
8715
8834
  'tab': 'tab',
8716
- 'delete': '46'
8835
+ 'delete': '46',
8836
+ 'format-copy': 'ctrl+shift+c',
8837
+ 'format-paste': 'ctrl+shift+v'
8717
8838
  };
8718
8839
  /**
8719
8840
  * Default markdown key config for adapter
@@ -11240,7 +11361,7 @@ class Lists {
11240
11361
  this.parent.domNode.insertAfter(insertTag, startNodeParent);
11241
11362
  e.event.preventDefault();
11242
11363
  this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, insertTag, 0);
11243
- if (startNodeParent.textContent === '') {
11364
+ if (startNodeParent.textContent === '' && (startNodeParent.querySelectorAll('audio,video').length === 0)) {
11244
11365
  detach(startNodeParent);
11245
11366
  }
11246
11367
  else {
@@ -12849,7 +12970,9 @@ class InsertHtml {
12849
12970
  }
12850
12971
  else {
12851
12972
  range.deleteContents();
12852
- detach(lasNode);
12973
+ if (!isNullOrUndefined(lasNode)) {
12974
+ detach(lasNode);
12975
+ }
12853
12976
  // eslint-disable-next-line
12854
12977
  !isNullOrUndefined(sibNode) ? sibNode.parentNode.appendChild(fragment) : editNode.appendChild(fragment);
12855
12978
  }
@@ -13035,7 +13158,7 @@ class InsertHtml {
13035
13158
  detach(currentNode.nextSibling);
13036
13159
  }
13037
13160
  }
13038
- else if ((currentNode.nodeName === '#text' || currentNode.nodeName === "BR") && !isNullOrUndefined(currentNode.parentElement) &&
13161
+ else if ((currentNode.nodeName === '#text' || currentNode.nodeName === 'BR') && !isNullOrUndefined(currentNode.parentElement) &&
13039
13162
  (currentNode.parentElement.nodeName === 'LI' || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
13040
13163
  currentNode.parentElement.textContent.trim().length > 0) {
13041
13164
  splitedElm = currentNode;
@@ -13385,7 +13508,6 @@ class LinkCommand {
13385
13508
  return arr.join(' ') + ' ';
13386
13509
  }
13387
13510
  openLink(e) {
13388
- // eslint-disable-next-line security/detect-non-literal-fs-filename
13389
13511
  document.defaultView.open(e.item.url, e.item.target);
13390
13512
  this.callBack(e);
13391
13513
  }
@@ -13849,7 +13971,6 @@ class ImageCommand {
13849
13971
  this.callBack(e);
13850
13972
  }
13851
13973
  openImageLink(e) {
13852
- // eslint-disable-next-line security/detect-non-literal-fs-filename
13853
13974
  document.defaultView.open(e.item.url, e.item.target);
13854
13975
  this.callBack(e);
13855
13976
  }
@@ -14319,6 +14440,8 @@ class VideoCommand {
14319
14440
  : (Browser.isIE ? selectedNode : !e.item.isEmbedUrl ? selectedNode.lastElementChild : selectedNode.querySelector('iframe'));
14320
14441
  videoElm.addEventListener(videoElm.tagName !== 'IFRAME' ? 'loadeddata' : 'load', () => {
14321
14442
  if (e.value !== 'VideoReplace' || !isReplaced) {
14443
+ if (e.item.isEmbedUrl && videoElm)
14444
+ videoElm.classList.add('e-rte-embed-url');
14322
14445
  e.callBack({
14323
14446
  requestType: 'Videos',
14324
14447
  editorMode: 'HTML',
@@ -15551,6 +15674,7 @@ IsFormatted.inlineTags = [
15551
15674
  'code',
15552
15675
  'dfn',
15553
15676
  'em',
15677
+ 'font',
15554
15678
  'i',
15555
15679
  'kbd',
15556
15680
  'label',
@@ -15580,15 +15704,16 @@ class SelectionCommands {
15580
15704
  * @param {string} enterAction - specifies the enter key action
15581
15705
  * @param {string} value - specifies the string value
15582
15706
  * @param {string} selector - specifies the string
15707
+ * @param {FormatPainterValue} painterValues specifies the element created and last child
15583
15708
  * @returns {void}
15584
15709
  * @hidden
15585
15710
  * @deprecated
15586
15711
  */
15587
- static applyFormat(docElement, format, endNode, enterAction, value, selector) {
15712
+ static applyFormat(docElement, format, endNode, enterAction, value, selector, painterValues) {
15588
15713
  this.enterAction = enterAction;
15589
15714
  const validFormats = ['bold', 'italic', 'underline', 'strikethrough', 'superscript',
15590
15715
  'subscript', 'uppercase', 'lowercase', 'fontcolor', 'fontname', 'fontsize', 'backgroundcolor'];
15591
- if (validFormats.indexOf(format) > -1) {
15716
+ if (validFormats.indexOf(format) > -1 || value === 'formatPainter') {
15592
15717
  if (format === 'backgroundcolor' && value === '') {
15593
15718
  value = 'transparent';
15594
15719
  }
@@ -15664,8 +15789,10 @@ class SelectionCommands {
15664
15789
  if (formatNode !== null && (!isFormat || isFontStyle)) {
15665
15790
  nodes[index] = this.removeFormat(nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode);
15666
15791
  }
15667
- else if (range.startContainer.parentElement !== endNode || (range.commonAncestorContainer === endNode || nodes.length === 1)) {
15668
- nodes[index] = this.insertFormat(docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domNode, endNode);
15792
+ else if (range.startContainer.parentElement !== endNode ||
15793
+ (range.commonAncestorContainer !== endNode && range.startContainer.parentElement === endNode)
15794
+ || (range.commonAncestorContainer === endNode || nodes.length === 1)) {
15795
+ nodes[index] = this.insertFormat(docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, painterValues, domNode, endNode);
15669
15796
  }
15670
15797
  domSelection = this.applySelection(nodes, domSelection, nodeCutter, index, isCollapsed);
15671
15798
  }
@@ -15961,7 +16088,7 @@ class SelectionCommands {
15961
16088
  }
15962
16089
  return nodes[index];
15963
16090
  }
15964
- static insertFormat(docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domNode, endNode) {
16091
+ static insertFormat(docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, painterValues, domNode, endNode) {
15965
16092
  let rootElementNode;
15966
16093
  if (!isCursor) {
15967
16094
  if ((formatNode === null && isFormat) || isFontStyle) {
@@ -15988,11 +16115,11 @@ class SelectionCommands {
15988
16115
  }
15989
16116
  else if (!(isFontStyle === true && value === '')) {
15990
16117
  const element = this.GetFormatNode(format, value);
15991
- if (format === 'fontsize' || format === 'fontcolor' || format === 'fontname' || format === 'backgroundcolor') {
16118
+ if (value === 'formatPainter' || format === 'fontsize' || format === 'fontcolor' || format === 'fontname' || format === 'backgroundcolor') {
15992
16119
  if (format !== 'fontname' && format !== 'backgroundcolor') {
15993
16120
  let liElement = nodes[index].parentElement;
15994
16121
  let parentElement = nodes[index].parentElement;
15995
- while (!isNullOrUndefined(parentElement) && parentElement.tagName.toLowerCase() !== 'li' && parentElement !== endNode) {
16122
+ while (!isNullOrUndefined(parentElement) && parentElement.tagName.toLowerCase() !== 'li') {
15996
16123
  parentElement = parentElement.parentElement;
15997
16124
  liElement = parentElement;
15998
16125
  }
@@ -16007,11 +16134,11 @@ class SelectionCommands {
16007
16134
  }
16008
16135
  }
16009
16136
  }
16010
- if (rootElementNode && rootElementNode.nodeType !== 3) {
16137
+ if (rootElementNode && rootElementNode.nodeType !== 3 && rootElementNode.nodeName !== 'A') {
16011
16138
  const save = new NodeSelection();
16012
16139
  save.save(range, docElement);
16013
16140
  domNode.setMarker(save);
16014
- var cloneNode = rootElementNode.cloneNode(true);
16141
+ const cloneNode = rootElementNode.cloneNode(true);
16015
16142
  element.appendChild(cloneNode);
16016
16143
  domNode.replaceWith(rootElementNode, element.outerHTML);
16017
16144
  const currentStartNode = endNode.querySelector('.e-editor-select-start');
@@ -16027,7 +16154,12 @@ class SelectionCommands {
16027
16154
  domNode.saveMarker(save, null);
16028
16155
  }
16029
16156
  else {
16030
- nodes[index] = this.applyStyles(nodes, index, element);
16157
+ if (value === 'formatPainter') {
16158
+ return this.insertFormatPainterElem(nodes, index, range, nodeCutter, painterValues, domNode);
16159
+ }
16160
+ else {
16161
+ nodes[index] = this.applyStyles(nodes, index, element);
16162
+ }
16031
16163
  }
16032
16164
  if (format === 'fontsize') {
16033
16165
  const bg = closest(nodes[index].parentElement, 'span[style*=' + 'background-color' + ']');
@@ -16158,6 +16290,59 @@ class SelectionCommands {
16158
16290
  ele.setAttribute('style', styles);
16159
16291
  }
16160
16292
  }
16293
+ // Below function is used to insert the element created by the format painter plugin.
16294
+ static insertFormatPainterElem(nodes, index, range, nodeCutter, painterValues, domNode) {
16295
+ let parent = nodes[index].parentElement;
16296
+ if (!domNode.isBlockNode(parent)) {
16297
+ // The below code is used to remove the already present inline style from the text node.
16298
+ while (parent.textContent.trim() === parent.parentElement.textContent.trim() && !domNode.isBlockNode(parent.parentElement)) {
16299
+ parent = parent.parentElement;
16300
+ }
16301
+ if (parent.textContent.trim() !== nodes[index].textContent.trim()) {
16302
+ nodeCutter.SplitNode(range, parent, true);
16303
+ const childELemList = nodes[index].parentElement.childNodes;
16304
+ for (let i = 0; i < childELemList.length; i++) {
16305
+ if (childELemList[i].textContent.trim() === nodes[i].textContent.trim()) {
16306
+ parent.parentNode.insertBefore(childELemList[i], parent);
16307
+ break;
16308
+ }
16309
+ }
16310
+ const blockChildNodes = parent.parentElement.childNodes;
16311
+ for (let k = 0; k < blockChildNodes.length; k++) {
16312
+ if (blockChildNodes[k].textContent.trim() === '' || blockChildNodes[k].textContent.length === 0) {
16313
+ detach(blockChildNodes[k]);
16314
+ }
16315
+ }
16316
+ }
16317
+ else {
16318
+ InsertMethods.unwrap(parent);
16319
+ }
16320
+ }
16321
+ const elem = painterValues.element;
16322
+ if (!isNullOrUndefined(elem)) {
16323
+ // Step 1: Cloning the element that is created by format painter.
16324
+ // Step 2: Finding the last child of the nested elememt using the paintervalues.lastchild nodename
16325
+ // Step 3: Assigning the nodes[index] text content to the last child element.
16326
+ // Step 4: Wrapping the cloned element with the nodes[index]
16327
+ const clonedElement = elem.cloneNode(true);
16328
+ const elemList = clonedElement.querySelectorAll(painterValues.lastChild.nodeName);
16329
+ let lastElement;
16330
+ if (elemList.length > 0) {
16331
+ lastElement = elemList[elemList.length - 1];
16332
+ }
16333
+ else {
16334
+ if (!isNullOrUndefined(clonedElement) && clonedElement.nodeName === painterValues.lastChild.nodeName) {
16335
+ lastElement = clonedElement;
16336
+ }
16337
+ }
16338
+ lastElement.textContent = nodes[index].textContent;
16339
+ const lastChild = lastElement.childNodes[0];
16340
+ nodes[index] = InsertMethods.Wrap(nodes[index], clonedElement);
16341
+ nodes[index].textContent = '';
16342
+ nodes[index] = lastChild;
16343
+ }
16344
+ return nodes[index];
16345
+ }
16161
16346
  }
16162
16347
  SelectionCommands.enterAction = 'P';
16163
16348
 
@@ -16279,12 +16464,18 @@ class ClearFormat$1 {
16279
16464
  const nodeSelection = new NodeSelection();
16280
16465
  const nodeCutter = new NodeCutter();
16281
16466
  let range = nodeSelection.getRange(docElement);
16282
- const isCollapsed = range.collapsed;
16283
- const nodes = nodeSelection.getInsertNodeCollection(range);
16467
+ const nodes = range.collapsed ? nodeSelection.getSelectionNodeCollection(range) :
16468
+ nodeSelection.getSelectionNodeCollectionBr(range);
16284
16469
  const save = nodeSelection.save(range, docElement);
16470
+ let cursorRange = false;
16471
+ if (range.collapsed) {
16472
+ cursorRange = true;
16473
+ range = nodeCutter.GetCursorRange(docElement, range, nodes[0]);
16474
+ }
16475
+ const isCollapsed = range.collapsed;
16285
16476
  if (!isCollapsed) {
16286
16477
  let preNode;
16287
- if (nodes[0].nodeName === 'BR' && closest(nodes[0], 'table')) {
16478
+ if (nodes.length > 0 && nodes[0].nodeName === 'BR' && closest(nodes[0], 'table')) {
16288
16479
  preNode = nodeCutter.GetSpliceNode(range, closest(nodes[0], 'table'));
16289
16480
  }
16290
16481
  else {
@@ -16294,7 +16485,7 @@ class ClearFormat$1 {
16294
16485
  nodeSelection.setSelectionContents(docElement, preNode);
16295
16486
  range = nodeSelection.getRange(docElement);
16296
16487
  }
16297
- else {
16488
+ else if (nodes.length > 1) {
16298
16489
  let i = 1;
16299
16490
  let lastText = nodes[nodes.length - i];
16300
16491
  while (nodes.length <= i && nodes[nodes.length - i].nodeName === 'BR') {
@@ -16319,6 +16510,9 @@ class ClearFormat$1 {
16319
16510
  }
16320
16511
  this.reSelection(docElement, save, exactNodes);
16321
16512
  }
16513
+ if (cursorRange) {
16514
+ nodeSelection.setCursorPoint(docElement, range.endContainer, range.endOffset);
16515
+ }
16322
16516
  }
16323
16517
  static reSelection(docElement, save, exactNodes) {
16324
16518
  const selectionNodes = save.getInsertNodes(exactNodes);
@@ -16824,7 +17018,7 @@ class MsWordPaste {
16824
17018
  if (pattern4.test(tempHTMLContent)) {
16825
17019
  this.addTableBorderClass(elm);
16826
17020
  }
16827
- // Removing the margin for list items
17021
+ // Removing the margin for list items
16828
17022
  const liChildren = elm.querySelectorAll('li');
16829
17023
  if (liChildren.length > 0) {
16830
17024
  for (let i = 0; i < liChildren.length; i++) {
@@ -17271,12 +17465,12 @@ class MsWordPaste {
17271
17465
  listStyleType = this.getlistStyleType(this.listContents[0], type);
17272
17466
  if (type === 'ol' && (i === 0 || listNodes[i - 1] === null)) {
17273
17467
  const startString = this.listContents[0].split('.')[0];
17274
- const listTypes = ['A', 'a', 'I', 'i', 'α', '1', '1-']; // Add '1-' for rare list type.
17468
+ const listTypes = ['A', 'a', 'I', 'i', 'α', '1', '1-']; // Add '1-' for rare list type.
17275
17469
  if (listTypes.indexOf(startString) === -1) {
17276
17470
  if (listStyleType === 'decimal') {
17277
17471
  // Bug in getlistStyleType() list style stype is returned as decimal for nested list with start attribute
17278
- if (!isNaN(parseInt(startString))) {
17279
- startAttr = parseInt(startString);
17472
+ if (!isNaN(parseInt(startString, 10))) {
17473
+ startAttr = parseInt(startString, 10);
17280
17474
  }
17281
17475
  }
17282
17476
  else if (listStyleType === 'upper-alpha') {
@@ -17555,353 +17749,130 @@ class InsertTextExec {
17555
17749
  }
17556
17750
 
17557
17751
  /**
17558
- * EditorManager internal component
17752
+ * Update Toolbar Status
17559
17753
  *
17560
17754
  * @hidden
17561
17755
  * @deprecated
17562
17756
  */
17563
- class EditorManager {
17757
+ const statusCollection = getDefaultHtmlTbStatus();
17758
+ class ToolbarStatus {
17564
17759
  /**
17565
- * Constructor for creating the component
17760
+ * get method
17566
17761
  *
17762
+ * @param {Document} docElement - specifies the document element
17763
+ * @param {Node} targetNode - specifies the target node
17764
+ * @param {string[]} formatNode - specifies the format node
17765
+ * @param {string[]} fontSize - specifies the font size
17766
+ * @param {string[]} fontName - specifies the font name.
17767
+ * @param {Node} documentNode - specifies the document node.
17768
+ * @returns {IToolbarStatus} - returns the toolbar status
17567
17769
  * @hidden
17568
17770
  * @deprecated
17569
- * @param {ICommandModel} options - specifies the command Model
17570
17771
  */
17571
- constructor(options) {
17572
- this.currentDocument = options.document;
17573
- this.editableElement = options.editableElement;
17574
- this.nodeSelection = new NodeSelection();
17575
- this.nodeCutter = new NodeCutter();
17576
- this.domNode = new DOMNode(this.editableElement, this.currentDocument);
17577
- this.observer = new Observer(this);
17578
- this.listObj = new Lists(this);
17579
- this.formatObj = new Formats(this);
17580
- this.alignmentObj = new Alignments(this);
17581
- this.indentsObj = new Indents(this);
17582
- this.linkObj = new LinkCommand(this);
17583
- this.imgObj = new ImageCommand(this);
17584
- this.audioObj = new AudioCommand(this);
17585
- this.videoObj = new VideoCommand(this);
17586
- this.selectionObj = new SelectionBasedExec(this);
17587
- this.inserthtmlObj = new InsertHtmlExec(this);
17588
- this.insertTextObj = new InsertTextExec(this);
17589
- this.clearObj = new ClearFormatExec(this);
17590
- this.tableObj = new TableCommand(this);
17591
- this.undoRedoManager = new UndoRedoManager(this, options.options);
17592
- this.msWordPaste = new MsWordPaste(this);
17593
- this.wireEvents();
17594
- }
17595
- wireEvents() {
17596
- this.observer.on(KEY_DOWN, this.editorKeyDown, this);
17597
- this.observer.on(KEY_UP, this.editorKeyUp, this);
17598
- this.observer.on(KEY_UP, this.editorKeyUp, this);
17599
- this.observer.on(MODEL_CHANGED, this.onPropertyChanged, this);
17600
- this.observer.on(MS_WORD_CLEANUP, this.onWordPaste, this);
17601
- this.observer.on(ON_BEGIN, this.onBegin, this);
17602
- }
17603
- onWordPaste(e) {
17604
- this.observer.notify(MS_WORD_CLEANUP_PLUGIN, e);
17605
- }
17606
- onPropertyChanged(props) {
17607
- this.observer.notify(MODEL_CHANGED_PLUGIN, props);
17608
- }
17609
- editorKeyDown(e) {
17610
- this.observer.notify(KEY_DOWN_HANDLER, e);
17772
+ static get(docElement, targetNode, formatNode, fontSize, fontName, documentNode) {
17773
+ let formatCollection = JSON.parse(JSON.stringify(statusCollection));
17774
+ const nodeCollection = JSON.parse(JSON.stringify(statusCollection));
17775
+ const nodeSelection = new NodeSelection();
17776
+ const range = nodeSelection.getRange(docElement);
17777
+ const nodes = documentNode ? [documentNode] : range.collapsed ? nodeSelection.getNodeCollection(range) :
17778
+ nodeSelection.getSelectionNodeCollectionBr(range);
17779
+ const nodesLength = nodes.length;
17780
+ let isNodeChanged = false;
17781
+ for (let index = 0; index < nodes.length; index++) {
17782
+ while (nodes[index].nodeType === 3 && range.startContainer.nodeType === 3 && nodes[index].parentNode &&
17783
+ nodes[index].parentNode.lastElementChild && nodes[index].parentNode.lastElementChild.nodeName !== 'BR' &&
17784
+ (this.getImmediateBlockNode(nodes[index].parentNode)).textContent.replace(/\u200B/g, '').length === 0 &&
17785
+ range.startContainer.textContent.replace(/\u200B/g, '').length === 0 &&
17786
+ nodeSelection.get(docElement).toString().replace(/\u200B/g, '').length === 0) {
17787
+ nodes[index] = nodes[index].parentNode.lastElementChild.firstChild;
17788
+ isNodeChanged = true;
17789
+ }
17790
+ if (isNodeChanged && nodes[index]) {
17791
+ nodeSelection.setCursorPoint(docElement, nodes[index], nodes[index].textContent.length);
17792
+ isNodeChanged = false;
17793
+ }
17794
+ if ((nodes[index].nodeName !== 'BR' && nodes[index].nodeType !== 3) ||
17795
+ (nodesLength > 1 && nodes[index].nodeType === 3 && nodes[index].textContent.trim() === '')) {
17796
+ nodes.splice(index, 1);
17797
+ index--;
17798
+ }
17799
+ }
17800
+ for (let index = 0; index < nodes.length; index++) {
17801
+ // eslint-disable-next-line max-len
17802
+ formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], targetNode, formatNode, fontSize, fontName);
17803
+ if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
17804
+ nodeCollection.bold = formatCollection.bold;
17805
+ }
17806
+ if ((index === 0 && formatCollection.insertcode) || !formatCollection.insertcode) {
17807
+ nodeCollection.insertcode = formatCollection.insertcode;
17808
+ }
17809
+ if ((index === 0 && formatCollection.italic) || !formatCollection.italic) {
17810
+ nodeCollection.italic = formatCollection.italic;
17811
+ }
17812
+ if ((index === 0 && formatCollection.underline) || !formatCollection.underline) {
17813
+ nodeCollection.underline = formatCollection.underline;
17814
+ }
17815
+ if ((index === 0 && formatCollection.strikethrough) || !formatCollection.strikethrough) {
17816
+ nodeCollection.strikethrough = formatCollection.strikethrough;
17817
+ }
17818
+ if ((index === 0 && formatCollection.superscript) || !formatCollection.superscript) {
17819
+ nodeCollection.superscript = formatCollection.superscript;
17820
+ }
17821
+ if ((index === 0 && formatCollection.subscript) || !formatCollection.subscript) {
17822
+ nodeCollection.subscript = formatCollection.subscript;
17823
+ }
17824
+ if ((index === 0 && formatCollection.fontcolor) || !formatCollection.fontcolor) {
17825
+ nodeCollection.fontcolor = formatCollection.fontcolor;
17826
+ }
17827
+ if ((index === 0 && formatCollection.fontname) || !formatCollection.fontname) {
17828
+ nodeCollection.fontname = formatCollection.fontname;
17829
+ }
17830
+ if ((index === 0 && formatCollection.fontsize) || !formatCollection.fontsize) {
17831
+ nodeCollection.fontsize = formatCollection.fontsize;
17832
+ }
17833
+ if ((index === 0 && formatCollection.backgroundcolor) || !formatCollection.backgroundcolor) {
17834
+ nodeCollection.backgroundcolor = formatCollection.backgroundcolor;
17835
+ }
17836
+ if ((index === 0 && formatCollection.orderedlist) || !formatCollection.orderedlist) {
17837
+ nodeCollection.orderedlist = formatCollection.orderedlist;
17838
+ }
17839
+ if ((index === 0 && formatCollection.unorderedlist) || !formatCollection.unorderedlist) {
17840
+ nodeCollection.unorderedlist = formatCollection.unorderedlist;
17841
+ }
17842
+ if ((index === 0 && formatCollection.alignments) || !formatCollection.alignments) {
17843
+ nodeCollection.alignments = formatCollection.alignments;
17844
+ }
17845
+ if ((index === 0 && formatCollection.formats) || !formatCollection.formats) {
17846
+ nodeCollection.formats = formatCollection.formats;
17847
+ }
17848
+ if ((index === 0 && formatCollection.createlink) || !formatCollection.createlink) {
17849
+ nodeCollection.createlink = formatCollection.createlink;
17850
+ }
17851
+ if ((index === 0 && formatCollection.numberFormatList) || !formatCollection.numberFormatList) {
17852
+ nodeCollection.numberFormatList = formatCollection.numberFormatList;
17853
+ }
17854
+ if ((index === 0 && formatCollection.bulletFormatList) || !formatCollection.bulletFormatList) {
17855
+ nodeCollection.bulletFormatList = formatCollection.bulletFormatList;
17856
+ }
17857
+ formatCollection = JSON.parse(JSON.stringify(statusCollection));
17858
+ }
17859
+ return nodeCollection;
17611
17860
  }
17612
- editorKeyUp(e) {
17613
- this.observer.notify(KEY_UP_HANDLER, e);
17861
+ static getImmediateBlockNode(node) {
17862
+ do {
17863
+ node = node.parentNode;
17864
+ } while (node && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) < 0);
17865
+ return node;
17614
17866
  }
17615
- onBegin(e) {
17616
- this.observer.notify(SPACE_ACTION, e);
17617
- }
17618
- /* eslint-disable */
17619
- /**
17620
- * execCommand
17621
- *
17622
- * @param {ExecCommand} command - specifies the execution command
17623
- * @param {T} value - specifes the value.
17624
- * @param {Event} event - specifies the call back event
17625
- * @param {Function} callBack - specifies the function
17626
- * @param {string} text - specifies the string value
17627
- * @param {T} exeValue - specifies the values to be executed
17628
- * @param {string} selector - specifies the selector values
17629
- * @returns {void}
17630
- * @hidden
17631
- * @deprecated
17632
- */
17633
- /* eslint-enable */
17634
- execCommand(command, value, event, callBack, text, exeValue, selector, enterAction) {
17635
- switch (command.toLowerCase()) {
17636
- case 'lists':
17637
- this.observer.notify(LIST_TYPE, { subCommand: value, event: event, callBack: callBack,
17638
- selector: selector, item: exeValue, enterAction: enterAction });
17639
- break;
17640
- case 'formats':
17641
- this.observer.notify(FORMAT_TYPE, { subCommand: value, event: event, callBack: callBack,
17642
- selector: selector, exeValue: exeValue, enterAction: enterAction
17643
- });
17644
- break;
17645
- case 'alignments':
17646
- this.observer.notify(ALIGNMENT_TYPE, {
17647
- subCommand: value, event: event, callBack: callBack,
17648
- selector: selector,
17649
- value: exeValue
17650
- });
17651
- break;
17652
- case 'indents':
17653
- this.observer.notify(INDENT_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector });
17654
- break;
17655
- case 'links':
17656
- this.observer.notify(LINK, { command: command, value: value, item: exeValue, event: event, callBack: callBack });
17657
- break;
17658
- case 'files':
17659
- this.observer.notify(IMAGE, {
17660
- command: command, value: 'Image', item: exeValue, event: event, callBack: callBack, selector: selector
17661
- });
17662
- break;
17663
- case 'images':
17664
- this.observer.notify(IMAGE, {
17665
- command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
17666
- });
17667
- break;
17668
- case 'audios':
17669
- this.observer.notify(AUDIO, {
17670
- command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
17671
- });
17672
- break;
17673
- case 'videos':
17674
- this.observer.notify(VIDEO, {
17675
- command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
17676
- });
17677
- break;
17678
- case 'table':
17679
- switch (value.toString().toLocaleLowerCase()) {
17680
- case 'createtable':
17681
- this.observer.notify(TABLE, { item: exeValue, event: event, callBack: callBack, enterAction: enterAction });
17682
- break;
17683
- case 'insertrowbefore':
17684
- case 'insertrowafter':
17685
- this.observer.notify(INSERT_ROW, { item: exeValue, event: event, callBack: callBack });
17686
- break;
17687
- case 'insertcolumnleft':
17688
- case 'insertcolumnright':
17689
- this.observer.notify(INSERT_COLUMN, { item: exeValue, event: event, callBack: callBack });
17690
- break;
17691
- case 'deleterow':
17692
- this.observer.notify(DELETEROW, { item: exeValue, event: event, callBack: callBack });
17693
- break;
17694
- case 'deletecolumn':
17695
- this.observer.notify(DELETECOLUMN, { item: exeValue, event: event, callBack: callBack });
17696
- break;
17697
- case 'tableremove':
17698
- this.observer.notify(REMOVETABLE, { item: exeValue, event: event, callBack: callBack });
17699
- break;
17700
- case 'tableheader':
17701
- this.observer.notify(TABLEHEADER, { item: exeValue, event: event, callBack: callBack });
17702
- break;
17703
- case 'aligntop':
17704
- case 'alignmiddle':
17705
- case 'alignbottom':
17706
- this.observer.notify(TABLE_VERTICAL_ALIGN, { item: exeValue, event: event, callBack: callBack });
17707
- break;
17708
- case 'merge':
17709
- this.observer.notify(TABLE_MERGE, { item: exeValue, event: event, callBack: callBack });
17710
- break;
17711
- case 'horizontalsplit':
17712
- this.observer.notify(TABLE_HORIZONTAL_SPLIT, { item: exeValue, event: event, callBack: callBack });
17713
- break;
17714
- case 'verticalsplit':
17715
- this.observer.notify(TABLE_VERTICAL_SPLIT, { item: exeValue, event: event, callBack: callBack });
17716
- break;
17717
- }
17718
- break;
17719
- case 'font':
17720
- case 'style':
17721
- case 'effects':
17722
- case 'casing':
17723
- this.observer.notify(SELECTION_TYPE, { subCommand: value, event: event, callBack: callBack, value: text, selector: selector, enterAction: enterAction });
17724
- break;
17725
- case 'inserthtml':
17726
- this.observer.notify(INSERTHTML_TYPE, { subCommand: value, callBack: callBack, value: text, enterAction: enterAction });
17727
- break;
17728
- case 'inserttext':
17729
- this.observer.notify(INSERT_TEXT_TYPE, { subCommand: value, callBack: callBack, value: text });
17730
- break;
17731
- case 'clear':
17732
- this.observer.notify(CLEAR_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector, enterAction: enterAction });
17733
- break;
17734
- case 'actions':
17735
- this.observer.notify(ACTION, { subCommand: value, event: event, callBack: callBack, selector: selector });
17736
- break;
17737
- }
17738
- }
17739
- }
17740
-
17741
- /**
17742
- * HTML adapter
17743
- *
17744
- * @hidden
17745
- * @deprecated
17746
- */
17747
- class HTMLFormatter extends Formatter {
17748
- constructor(options) {
17749
- super();
17750
- this.initialize();
17751
- extend(this, this, options, true);
17752
- if (this.currentDocument && this.element) {
17753
- this.updateFormatter(this.element, this.currentDocument, options.options);
17754
- }
17755
- }
17756
- initialize() {
17757
- this.keyConfig = htmlKeyConfig;
17758
- }
17759
- /**
17760
- * Update the formatter of RichTextEditor
17761
- *
17762
- * @param {Element} editElement - specifies the edit element.
17763
- * @param {Document} doc - specifies the doucment
17764
- * @param {number} options - specifies the options
17765
- * @returns {void}
17766
- * @hidden
17767
- * @deprecated
17768
- */
17769
- updateFormatter(editElement, doc, options) {
17770
- if (editElement && doc) {
17771
- this.editorManager = new EditorManager({
17772
- document: doc,
17773
- editableElement: editElement,
17774
- options: options
17775
- });
17776
- }
17777
- }
17778
- }
17779
-
17780
- /**
17781
- * Update Toolbar Status
17782
- *
17783
- * @hidden
17784
- * @deprecated
17785
- */
17786
- const statusCollection = getDefaultHtmlTbStatus();
17787
- class ToolbarStatus {
17788
- /**
17789
- * get method
17790
- *
17791
- * @param {Document} docElement - specifies the document element
17792
- * @param {Node} targetNode - specifies the target node
17793
- * @param {string[]} formatNode - specifies the format node
17794
- * @param {string[]} fontSize - specifies the font size
17795
- * @param {string[]} fontName - specifies the font name.
17796
- * @param {Node} documentNode - specifies the document node.
17797
- * @returns {IToolbarStatus} - returns the toolbar status
17798
- * @hidden
17799
- * @deprecated
17800
- */
17801
- static get(docElement, targetNode, formatNode, fontSize, fontName, documentNode) {
17802
- let formatCollection = JSON.parse(JSON.stringify(statusCollection));
17803
- const nodeCollection = JSON.parse(JSON.stringify(statusCollection));
17804
- const nodeSelection = new NodeSelection();
17805
- const range = nodeSelection.getRange(docElement);
17806
- const nodes = documentNode ? [documentNode] : range.collapsed ? nodeSelection.getNodeCollection(range) :
17807
- nodeSelection.getSelectionNodeCollectionBr(range);
17808
- const nodesLength = nodes.length;
17809
- let isNodeChanged = false;
17810
- for (let index = 0; index < nodes.length; index++) {
17811
- while (nodes[index].nodeType === 3 && range.startContainer.nodeType === 3 && nodes[index].parentNode &&
17812
- nodes[index].parentNode.lastElementChild && nodes[index].parentNode.lastElementChild.nodeName !== 'BR' &&
17813
- (this.getImmediateBlockNode(nodes[index].parentNode)).textContent.replace(/\u200B/g, '').length === 0 &&
17814
- range.startContainer.textContent.replace(/\u200B/g, '').length === 0 &&
17815
- nodeSelection.get(docElement).toString().replace(/\u200B/g, '').length === 0) {
17816
- nodes[index] = nodes[index].parentNode.lastElementChild.firstChild;
17817
- isNodeChanged = true;
17818
- }
17819
- if (isNodeChanged && nodes[index]) {
17820
- nodeSelection.setCursorPoint(docElement, nodes[index], nodes[index].textContent.length);
17821
- isNodeChanged = false;
17822
- }
17823
- if ((nodes[index].nodeName !== 'BR' && nodes[index].nodeType !== 3) ||
17824
- (nodesLength > 1 && nodes[index].nodeType === 3 && nodes[index].textContent.trim() === '')) {
17825
- nodes.splice(index, 1);
17826
- index--;
17827
- }
17828
- }
17829
- for (let index = 0; index < nodes.length; index++) {
17830
- // eslint-disable-next-line max-len
17831
- formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], targetNode, formatNode, fontSize, fontName);
17832
- if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
17833
- nodeCollection.bold = formatCollection.bold;
17834
- }
17835
- if ((index === 0 && formatCollection.insertcode) || !formatCollection.insertcode) {
17836
- nodeCollection.insertcode = formatCollection.insertcode;
17837
- }
17838
- if ((index === 0 && formatCollection.italic) || !formatCollection.italic) {
17839
- nodeCollection.italic = formatCollection.italic;
17840
- }
17841
- if ((index === 0 && formatCollection.underline) || !formatCollection.underline) {
17842
- nodeCollection.underline = formatCollection.underline;
17843
- }
17844
- if ((index === 0 && formatCollection.strikethrough) || !formatCollection.strikethrough) {
17845
- nodeCollection.strikethrough = formatCollection.strikethrough;
17846
- }
17847
- if ((index === 0 && formatCollection.superscript) || !formatCollection.superscript) {
17848
- nodeCollection.superscript = formatCollection.superscript;
17849
- }
17850
- if ((index === 0 && formatCollection.subscript) || !formatCollection.subscript) {
17851
- nodeCollection.subscript = formatCollection.subscript;
17852
- }
17853
- if ((index === 0 && formatCollection.fontcolor) || !formatCollection.fontcolor) {
17854
- nodeCollection.fontcolor = formatCollection.fontcolor;
17855
- }
17856
- if ((index === 0 && formatCollection.fontname) || !formatCollection.fontname) {
17857
- nodeCollection.fontname = formatCollection.fontname;
17858
- }
17859
- if ((index === 0 && formatCollection.fontsize) || !formatCollection.fontsize) {
17860
- nodeCollection.fontsize = formatCollection.fontsize;
17861
- }
17862
- if ((index === 0 && formatCollection.backgroundcolor) || !formatCollection.backgroundcolor) {
17863
- nodeCollection.backgroundcolor = formatCollection.backgroundcolor;
17864
- }
17865
- if ((index === 0 && formatCollection.orderedlist) || !formatCollection.orderedlist) {
17866
- nodeCollection.orderedlist = formatCollection.orderedlist;
17867
- }
17868
- if ((index === 0 && formatCollection.unorderedlist) || !formatCollection.unorderedlist) {
17869
- nodeCollection.unorderedlist = formatCollection.unorderedlist;
17870
- }
17871
- if ((index === 0 && formatCollection.alignments) || !formatCollection.alignments) {
17872
- nodeCollection.alignments = formatCollection.alignments;
17873
- }
17874
- if ((index === 0 && formatCollection.formats) || !formatCollection.formats) {
17875
- nodeCollection.formats = formatCollection.formats;
17876
- }
17877
- if ((index === 0 && formatCollection.createlink) || !formatCollection.createlink) {
17878
- nodeCollection.createlink = formatCollection.createlink;
17879
- }
17880
- if ((index === 0 && formatCollection.numberFormatList) || !formatCollection.numberFormatList) {
17881
- nodeCollection.numberFormatList = formatCollection.numberFormatList;
17882
- }
17883
- if ((index === 0 && formatCollection.bulletFormatList) || !formatCollection.bulletFormatList) {
17884
- nodeCollection.bulletFormatList = formatCollection.bulletFormatList;
17885
- }
17886
- formatCollection = JSON.parse(JSON.stringify(statusCollection));
17887
- }
17888
- return nodeCollection;
17889
- }
17890
- static getImmediateBlockNode(node) {
17891
- do {
17892
- node = node.parentNode;
17893
- } while (node && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) < 0);
17894
- return node;
17895
- }
17896
- static getFormatParent(docElement, formatCollection, node, targetNode, formatNode, fontSize, fontName) {
17897
- if (targetNode.contains(node) ||
17898
- (node.nodeType === 3 && targetNode.nodeType !== 3 && targetNode.contains(node.parentNode))) {
17899
- do {
17900
- formatCollection = this.isFormattedNode(docElement, formatCollection, node, formatNode, fontSize, fontName);
17901
- node = node.parentNode;
17902
- } while (node && (node !== targetNode));
17903
- }
17904
- return formatCollection;
17867
+ static getFormatParent(docElement, formatCollection, node, targetNode, formatNode, fontSize, fontName) {
17868
+ if (targetNode.contains(node) ||
17869
+ (node.nodeType === 3 && targetNode.nodeType !== 3 && targetNode.contains(node.parentNode))) {
17870
+ do {
17871
+ formatCollection = this.isFormattedNode(docElement, formatCollection, node, formatNode, fontSize, fontName);
17872
+ node = node.parentNode;
17873
+ } while (node && (node !== targetNode));
17874
+ }
17875
+ return formatCollection;
17905
17876
  }
17906
17877
  static isFormattedNode(docElement, formatCollection, node, formatNode, fontSize, fontName) {
17907
17878
  if (!formatCollection.bold) {
@@ -18059,63 +18030,766 @@ class ToolbarStatus {
18059
18030
  return null;
18060
18031
  }
18061
18032
  }
18062
- static isFormats(node, formatNode) {
18063
- if (((formatNode === undefined || formatNode === null)
18064
- && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) > -1)
18065
- || (formatNode !== null && formatNode !== undefined
18066
- && formatNode.indexOf(node.nodeName.toLocaleLowerCase()) > -1)) {
18067
- return node.nodeName.toLocaleLowerCase();
18068
- }
18069
- else {
18070
- return null;
18033
+ static isFormats(node, formatNode) {
18034
+ if (((formatNode === undefined || formatNode === null)
18035
+ && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) > -1)
18036
+ || (formatNode !== null && formatNode !== undefined
18037
+ && formatNode.indexOf(node.nodeName.toLocaleLowerCase()) > -1)) {
18038
+ return node.nodeName.toLocaleLowerCase();
18039
+ }
18040
+ else {
18041
+ return null;
18042
+ }
18043
+ }
18044
+ static getComputedStyle(docElement, node, prop) {
18045
+ return docElement.defaultView.getComputedStyle(node, null).getPropertyValue(prop);
18046
+ }
18047
+ static isNumberFormatList(node) {
18048
+ const list = node.style && node.style.listStyleType;
18049
+ if (list === 'lower-alpha') {
18050
+ return 'Lower Alpha';
18051
+ }
18052
+ else if (list === 'number') {
18053
+ return 'Number';
18054
+ }
18055
+ else if (list === 'upper-alpha') {
18056
+ return 'Upper Alpha';
18057
+ }
18058
+ else if (list === 'lower-roman') {
18059
+ return 'Lower Roman';
18060
+ }
18061
+ else if (list === 'upper-roman') {
18062
+ return 'Upper Roman';
18063
+ }
18064
+ else if (list === 'lower-greek') {
18065
+ return 'Lower Greek';
18066
+ }
18067
+ else if (list === 'none') {
18068
+ return 'None';
18069
+ }
18070
+ else {
18071
+ return null;
18072
+ }
18073
+ }
18074
+ static isBulletFormatList(node) {
18075
+ const list = node.style && node.style.listStyleType;
18076
+ if (list === 'circle') {
18077
+ return 'Circle';
18078
+ }
18079
+ else if (list === 'square') {
18080
+ return 'Square';
18081
+ }
18082
+ else if (list === 'none') {
18083
+ return 'None';
18084
+ }
18085
+ else if (list === 'disc') {
18086
+ return 'Disc';
18087
+ }
18088
+ else {
18089
+ return null;
18090
+ }
18091
+ }
18092
+ }
18093
+
18094
+ /**
18095
+ * Base export
18096
+ */
18097
+
18098
+ class FormatPainterActions {
18099
+ constructor(parent, options) {
18100
+ this.parent = parent;
18101
+ this.settings = options;
18102
+ this.addEventListener();
18103
+ this.setDeniedFormats();
18104
+ }
18105
+ addEventListener() {
18106
+ this.parent.observer.on(FORMAT_PAINTER_ACTIONS, this.actionHandler, this);
18107
+ }
18108
+ actionHandler(args) {
18109
+ if (!isNullOrUndefined(args) && !isNullOrUndefined(args.item) && !isNullOrUndefined(args.item.formatPainterAction)) {
18110
+ switch (args.item.formatPainterAction) {
18111
+ case 'format-copy':
18112
+ this.copyAction();
18113
+ break;
18114
+ case 'format-paste':
18115
+ this.pasteAction();
18116
+ break;
18117
+ case 'escape':
18118
+ this.escapeAction();
18119
+ break;
18120
+ }
18121
+ }
18122
+ }
18123
+ generateElement() {
18124
+ const copyCollection = this.copyCollection.slice(); // To clone without reversing the collcection array
18125
+ copyCollection.reverse();
18126
+ const length = copyCollection.length;
18127
+ const elemCollection = createElement('div', { className: 'e-format-paste-wrapper' });
18128
+ let lastAppendChild;
18129
+ for (let i = 0; i < length; i++) {
18130
+ const { attrs, className, styles, tagName } = copyCollection[i];
18131
+ const elem = createElement(tagName);
18132
+ if (className !== '') {
18133
+ elem.className = className;
18134
+ }
18135
+ for (let i = 0; i < attrs.length; i++) {
18136
+ const property = attrs[i].name;
18137
+ const value = attrs[i].value;
18138
+ elem.setAttribute(property, value);
18139
+ }
18140
+ for (let i = 0; i < styles.length; i++) {
18141
+ const property = styles[i].property;
18142
+ const value = styles[i].value;
18143
+ const priority = styles[i].priority;
18144
+ elem.style.setProperty(property, value, priority);
18145
+ }
18146
+ if (elemCollection.childElementCount === 0) {
18147
+ elemCollection.append(elem);
18148
+ lastAppendChild = elem;
18149
+ }
18150
+ else {
18151
+ lastAppendChild.append(elem);
18152
+ lastAppendChild = elem;
18153
+ }
18154
+ }
18155
+ const elemChild = this.removeDeniedFormats(elemCollection);
18156
+ let currentElem = elemChild;
18157
+ while (currentElem) {
18158
+ if (currentElem.firstChild === null) {
18159
+ lastAppendChild = currentElem;
18160
+ currentElem = undefined;
18161
+ }
18162
+ else {
18163
+ currentElem = currentElem.firstChild;
18164
+ }
18165
+ }
18166
+ this.newElem = elemChild;
18167
+ this.newElemLastChild = lastAppendChild;
18168
+ }
18169
+ pasteAction() {
18170
+ if (isNullOrUndefined(this.copyCollection) || this.copyCollection.length === 0) {
18171
+ this.paintPlainTextFormat();
18172
+ return;
18173
+ }
18174
+ this.insertFormatNode(this.newElem, this.newElemLastChild);
18175
+ this.parent.undoRedoManager.saveData();
18176
+ }
18177
+ removeDeniedFormats(parentElement) {
18178
+ if (!isNullOrUndefined(this.deniedFormatsCollection) && this.deniedFormatsCollection.length > 0) {
18179
+ const deniedPropArray = this.deniedFormatsCollection;
18180
+ const length = deniedPropArray.length;
18181
+ for (let i = 0; i < length; i++) {
18182
+ const tag = deniedPropArray[i].tag;
18183
+ if (deniedPropArray[i].tag) {
18184
+ const elementsList = parentElement.querySelectorAll(tag);
18185
+ for (let j = 0; j < elementsList.length; j++) {
18186
+ if (deniedPropArray[i].classes.length > 0) {
18187
+ const classes = deniedPropArray[i].classes;
18188
+ const classLength = classes.length;
18189
+ for (let k = 0; k < classLength; k++) {
18190
+ if (elementsList[j].classList.contains(classes[k])) {
18191
+ removeClass([elementsList[j]], classes[k]);
18192
+ }
18193
+ }
18194
+ if (elementsList[j].classList.length === 0) {
18195
+ elementsList[j].removeAttribute('class');
18196
+ }
18197
+ }
18198
+ if (deniedPropArray[i].styles.length > 0) {
18199
+ const styles = deniedPropArray[i].styles;
18200
+ const styleLength = styles.length;
18201
+ for (let k = 0; k < styleLength; k++) {
18202
+ elementsList[j].style.removeProperty(styles[k]);
18203
+ }
18204
+ if (elementsList[j].style.length === 0) {
18205
+ elementsList[j].removeAttribute('style');
18206
+ }
18207
+ }
18208
+ if (deniedPropArray[i].attributes.length > 0) {
18209
+ const attributes$$1 = deniedPropArray[i].attributes;
18210
+ const attributeLength = attributes$$1.length;
18211
+ for (let k = 0; k < attributeLength; k++) {
18212
+ elementsList[j].removeAttribute(attributes$$1[k]);
18213
+ }
18214
+ }
18215
+ }
18216
+ }
18217
+ }
18218
+ }
18219
+ return parentElement.firstElementChild;
18220
+ }
18221
+ copyAction() {
18222
+ const copyCollection = [];
18223
+ const range = this.parent.nodeSelection.getRange(document);
18224
+ let parentElem = range.startContainer.parentElement;
18225
+ let currentContext = this.findCurrentContext(parentElem);
18226
+ const allowedRulesArray = this.settings.allowedFormats.split(';');
18227
+ for (let i = 0; i < allowedRulesArray.length; i++) {
18228
+ allowedRulesArray[i] = allowedRulesArray[i].trim();
18229
+ }
18230
+ const [rangeParentElem, context] = this.getRangeParentElem(currentContext, range);
18231
+ if (currentContext === null) {
18232
+ currentContext = context;
18233
+ }
18234
+ if (!isNullOrUndefined(currentContext) && this.settings.allowedContext.indexOf(currentContext) > -1) {
18235
+ if (range.startContainer.nodeName === '#text') {
18236
+ parentElem = range.startContainer.parentElement;
18237
+ }
18238
+ const lastElement = parentElem;
18239
+ do {
18240
+ if (allowedRulesArray.indexOf(parentElem.nodeName.toLowerCase()) > -1) {
18241
+ const allAttributes = parentElem.attributes;
18242
+ const attribute = [];
18243
+ for (let i = 0; i < allAttributes.length; i++) {
18244
+ if (allAttributes[i].name !== 'class' && allAttributes[i].name !== 'style') {
18245
+ attribute.push(allAttributes[i]);
18246
+ }
18247
+ }
18248
+ const classes = parentElem.className;
18249
+ const allStyles = parentElem.style;
18250
+ const styleProp = [];
18251
+ for (let i = 0; i < allStyles.length; i++) {
18252
+ const property = allStyles[i];
18253
+ const value = allStyles.getPropertyValue(property);
18254
+ const priority = allStyles.getPropertyPriority(property);
18255
+ styleProp.push({ property: property, value: value, priority: priority });
18256
+ }
18257
+ copyCollection.push({
18258
+ attrs: attribute, className: classes, styles: styleProp, tagName: parentElem.nodeName
18259
+ });
18260
+ }
18261
+ if (rangeParentElem === parentElem) {
18262
+ parentElem = undefined;
18263
+ }
18264
+ else if (!isNullOrUndefined(parentElem.parentElement)) {
18265
+ parentElem = parentElem.parentElement;
18266
+ }
18267
+ if (lastElement === parentElem) {
18268
+ break;
18269
+ }
18270
+ } while (!isNullOrUndefined(parentElem) || parentElem === this.parent.editableElement);
18271
+ this.copyCollection = copyCollection;
18272
+ }
18273
+ this.generateElement();
18274
+ }
18275
+ getRangeParentElem(currentContext, range) {
18276
+ let startContainer = range.startContainer;
18277
+ let rangeParentELem;
18278
+ if (startContainer.nodeType === 3) {
18279
+ startContainer = startContainer.parentElement;
18280
+ }
18281
+ switch (currentContext) {
18282
+ case 'Table':
18283
+ rangeParentELem = closest(startContainer, 'td');
18284
+ if (isNullOrUndefined(rangeParentELem)) {
18285
+ rangeParentELem = closest(startContainer, 'th');
18286
+ }
18287
+ break;
18288
+ case 'List':
18289
+ rangeParentELem = closest(startContainer, 'li');
18290
+ break;
18291
+ case 'Text':
18292
+ rangeParentELem = closest(startContainer, 'p');
18293
+ break;
18294
+ }
18295
+ if (isNullOrUndefined(rangeParentELem)) {
18296
+ const nearBlockParentName = this.getNearestBlockParentElement(range);
18297
+ if (!isNullOrUndefined(nearBlockParentName) && nearBlockParentName !== 'UL' &&
18298
+ nearBlockParentName !== 'OL' && nearBlockParentName !== 'LI') {
18299
+ rangeParentELem = closest(startContainer, nearBlockParentName);
18300
+ currentContext = 'Text';
18301
+ }
18302
+ }
18303
+ if (currentContext === 'List') {
18304
+ rangeParentELem = rangeParentELem.parentElement;
18305
+ }
18306
+ return [rangeParentELem, currentContext];
18307
+ }
18308
+ getNearestBlockParentElement(range) {
18309
+ let node = range.commonAncestorContainer;
18310
+ if (node.nodeType === 3) {
18311
+ node = node.parentNode;
18312
+ }
18313
+ // iterate untill the content editable div
18314
+ while (node && node !== this.parent.editableElement) {
18315
+ // If true return the block node name.
18316
+ if (!isNullOrUndefined(node) && this.isBlockElement(node)) {
18317
+ return node.nodeName;
18318
+ }
18319
+ // if false re assign node to parent node
18320
+ node = node.parentNode;
18321
+ }
18322
+ return null;
18323
+ }
18324
+ isBlockElement(node) {
18325
+ const blockTags = ['P', 'DIV', 'UL', 'OL', 'LI', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6',
18326
+ 'ADDRESS', 'ARTICLE', 'ASIDE', 'BLOCKQUOTE', 'FIGCAPTION', 'FIGURE', 'FOOTER', 'HEADER',
18327
+ 'HR', 'MAIN', 'NAV', 'SECTION', 'SUMMARY', 'PRE'];
18328
+ return blockTags.indexOf(node.nodeName) > -1;
18329
+ }
18330
+ escapeAction() {
18331
+ this.copyCollection = [];
18332
+ }
18333
+ paintPlainTextFormat() {
18334
+ const range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
18335
+ const domSelection = this.parent.nodeSelection;
18336
+ const nodes = range.collapsed ? domSelection.getSelectionNodeCollection(range) :
18337
+ domSelection.getSelectionNodeCollectionBr(range);
18338
+ let isInValid;
18339
+ if (nodes.length > 1) {
18340
+ for (let i = 0; i < nodes.length; i++) {
18341
+ isInValid = this.validateELementTag(nodes[i]);
18342
+ }
18343
+ }
18344
+ else {
18345
+ isInValid = this.validateELementTag(range.startContainer) && this.validateELementTag(range.endContainer);
18346
+ }
18347
+ if (!isInValid) {
18348
+ this.parent.execCommand('Clear', 'ClearFormat', null, null);
18349
+ }
18350
+ }
18351
+ validateELementTag(node) {
18352
+ const INVALID_TAGS = ['A', 'AUDIO', 'IMG', 'VIDEO', 'IFRAME'];
18353
+ if (node.nodeType === 3) {
18354
+ node = node.parentElement;
18355
+ }
18356
+ return INVALID_TAGS.indexOf(node.tagName) > -1;
18357
+ }
18358
+ findCurrentContext(parentElem) {
18359
+ if (closest(parentElem, 'td') || closest(parentElem, 'tr') || closest(parentElem, 'tbody')) {
18360
+ return 'Table';
18361
+ }
18362
+ else if (closest(parentElem, 'li')) {
18363
+ return 'List';
18364
+ }
18365
+ else if (closest(parentElem, 'p')) {
18366
+ return 'Text';
18367
+ }
18368
+ return null;
18369
+ }
18370
+ insertFormatNode(elem, lastChild) {
18371
+ const endNode = this.parent.editableElement;
18372
+ const docElement = this.parent.currentDocument;
18373
+ const domSelection = this.parent.nodeSelection;
18374
+ const clonedElem = elem.cloneNode(true);
18375
+ let childElem = clonedElem.firstChild;
18376
+ let inlineElement;
18377
+ while (childElem) {
18378
+ if (this.isBlockElement(childElem)) {
18379
+ childElem = childElem.firstChild;
18380
+ }
18381
+ else {
18382
+ inlineElement = childElem.parentNode.removeChild(childElem);
18383
+ break;
18384
+ }
18385
+ }
18386
+ const formatValues = {
18387
+ element: inlineElement,
18388
+ lastChild: lastChild
18389
+ };
18390
+ SelectionCommands.applyFormat(docElement, null, endNode, 'P', 'formatPainter', null, formatValues);
18391
+ let isFullNodeSelected;
18392
+ const range = this.parent.nodeSelection.getRange(docElement);
18393
+ const isCollapsed = range.collapsed;
18394
+ const nodes = range.collapsed ? domSelection.getSelectionNodeCollection(range) :
18395
+ domSelection.getSelectionNodeCollectionBr(range);
18396
+ if (nodes.length === 1) {
18397
+ while (!this.isBlockElement(nodes[0])) {
18398
+ nodes[0] = nodes[0].parentElement;
18399
+ }
18400
+ isFullNodeSelected = nodes[0].textContent.trim() === range.commonAncestorContainer.wholeText.trim();
18401
+ }
18402
+ if (this.isBlockElement(elem) && isCollapsed || nodes.length > 1 || isFullNodeSelected) {
18403
+ this.insertBlockNode(elem, range, docElement, endNode, nodes);
18404
+ }
18405
+ }
18406
+ insertBlockNode(element, range, docElement, endNode, nodes) {
18407
+ const domSelection = this.parent.nodeSelection;
18408
+ let listElement; // To clone to multiple list elements
18409
+ let cloneListParentNode;
18410
+ if (element.nodeName === 'UL' || element.nodeName === 'OL') {
18411
+ cloneListParentNode = element.cloneNode(true);
18412
+ listElement = cloneListParentNode.firstChild;
18413
+ }
18414
+ const textNode = range.startContainer; // To set cursor position
18415
+ for (let index = 0; index < nodes.length; index++) {
18416
+ const lastTextNode = nodes[index];
18417
+ if (nodes[index].nodeType === 3) {
18418
+ nodes[index] = nodes[index].parentElement;
18419
+ }
18420
+ while (!this.isBlockElement(nodes[index])) {
18421
+ nodes[index] = nodes[index].parentElement;
18422
+ }
18423
+ let cloneParentNode;
18424
+ if (!isNullOrUndefined(cloneListParentNode)) {
18425
+ cloneParentNode = listElement.cloneNode(true);
18426
+ }
18427
+ else {
18428
+ cloneParentNode = element.cloneNode(true);
18429
+ }
18430
+ // Appending all the child elements
18431
+ while (nodes[index].firstChild) {
18432
+ if (cloneParentNode.nodeName === 'LI') {
18433
+ cloneParentNode.appendChild(nodes[index].firstChild);
18434
+ }
18435
+ else {
18436
+ // Except list nodes other block nodes replaced here
18437
+ if (nodes[index].nodeType === 3) {
18438
+ cloneParentNode.appendChild(nodes[index].firstChild);
18439
+ }
18440
+ else {
18441
+ cloneParentNode.innerHTML = nodes[index].innerHTML;
18442
+ nodes[index].innerHTML = '';
18443
+ }
18444
+ nodes[index] = nodes[index].parentNode.replaceChild(cloneParentNode, nodes[index]);
18445
+ }
18446
+ }
18447
+ if (cloneParentNode.nodeName === 'LI') {
18448
+ // Appending the li nodes to the ol or ul node
18449
+ cloneListParentNode.append(cloneParentNode);
18450
+ if (index === 0) {
18451
+ const nodeName = nodes[index].nodeName;
18452
+ nodes[index] = nodes[index].parentNode.replaceChild(cloneListParentNode, nodes[index]);
18453
+ const parent = nodeName === 'LI' ? cloneListParentNode.parentElement
18454
+ : cloneListParentNode;
18455
+ // Splicing and then inserting the node to previous element sibling of the Listparent.parent
18456
+ this.parent.nodeCutter.SplitNode(range, parent, true);
18457
+ if (!isNullOrUndefined(parent.previousElementSibling)) {
18458
+ parent.parentNode.insertBefore(cloneListParentNode, parent.nextElementSibling);
18459
+ }
18460
+ else {
18461
+ parent.parentElement.insertBefore(cloneListParentNode, parent);
18462
+ }
18463
+ }
18464
+ detach(nodes[index]);
18465
+ }
18466
+ /**Removing the inserted block node in list and appending to previous element sibling */
18467
+ if (cloneParentNode.nodeName !== 'LI' && (cloneParentNode.parentElement.nodeName === 'OL' ||
18468
+ cloneParentNode.parentElement.nodeName === 'UL')) {
18469
+ const parent = cloneParentNode.parentElement;
18470
+ // Cutting single ul or ol to two ul or ol based on the range
18471
+ this.parent.nodeCutter.SplitNode(range, parent, true);
18472
+ if (!isNullOrUndefined(parent.previousElementSibling)) {
18473
+ parent.previousElementSibling.after(cloneParentNode);
18474
+ }
18475
+ else {
18476
+ parent.parentElement.prepend(cloneParentNode);
18477
+ }
18478
+ }
18479
+ nodes[index] = lastTextNode;
18480
+ }
18481
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
18482
+ !isNullOrUndefined(listElement) ? detach(listElement) : false;
18483
+ this.cleanEmptyLists();
18484
+ if (nodes.length > 1) {
18485
+ const startSelectNode = nodes[0];
18486
+ const endSelectNode = nodes[nodes.length - 1];
18487
+ domSelection.setSelectionText(docElement, startSelectNode, endSelectNode, 0, endSelectNode.textContent.length);
18488
+ }
18489
+ else {
18490
+ domSelection.setCursorPoint(docElement, textNode, textNode.textContent.length);
18491
+ }
18492
+ }
18493
+ cleanEmptyLists() {
18494
+ const listElem = this.parent.editableElement.querySelectorAll('ol, ul');
18495
+ for (let i = 0; i < listElem.length; i++) {
18496
+ if (listElem[i].textContent.trim() === '') {
18497
+ detach(listElem[i]);
18498
+ }
18499
+ }
18500
+ }
18501
+ setDeniedFormats() {
18502
+ const deniedFormatsCollection = [];
18503
+ if (isNullOrUndefined(this.settings) || isNullOrUndefined(this.settings.deniedFormats)) {
18504
+ return;
18505
+ }
18506
+ const deniedFormats = this.settings.deniedFormats.split(';');
18507
+ const length = deniedFormats.length;
18508
+ for (let i = 0; i < length; i++) {
18509
+ const formatString = deniedFormats[i];
18510
+ if (formatString !== '') {
18511
+ formatString.trim();
18512
+ const collection = this.makeDeniedFormatsCollection(formatString);
18513
+ if (!isNullOrUndefined(collection)) {
18514
+ deniedFormatsCollection.push(collection);
18515
+ }
18516
+ }
18517
+ }
18518
+ this.deniedFormatsCollection = deniedFormatsCollection;
18519
+ }
18520
+ makeDeniedFormatsCollection(value) {
18521
+ const openParenIndex = value.indexOf('(');
18522
+ const closeParenIndex = value.indexOf(')');
18523
+ const openBracketIndex = value.indexOf('[');
18524
+ const closeBracketIndex = value.indexOf(']');
18525
+ const openBraceIndex = value.indexOf('{');
18526
+ const closeBraceIndex = value.indexOf('}');
18527
+ let classes = [];
18528
+ let attributes$$1 = '';
18529
+ let styles = '';
18530
+ let tagName = '';
18531
+ let classList = [];
18532
+ let attributesList = [];
18533
+ let stylesList = [];
18534
+ if (openParenIndex > -1 && closeParenIndex > -1) {
18535
+ classes = value.substring(openParenIndex + 1, closeParenIndex).split(' ');
18536
+ classList = classes[0].split(')')[0].split(',');
18537
+ }
18538
+ if (openBracketIndex > -1 && closeBracketIndex > -1) {
18539
+ attributes$$1 = value.substring(openBracketIndex + 1, closeBracketIndex);
18540
+ attributesList = attributes$$1.split(',');
18541
+ }
18542
+ if (openBraceIndex > -1 && closeBraceIndex > -1) {
18543
+ styles = value.substring(openBraceIndex + 1, closeBraceIndex);
18544
+ stylesList = styles.split(',');
18545
+ }
18546
+ let openIndexArray = [openParenIndex, openBracketIndex, openBraceIndex];
18547
+ openIndexArray = openIndexArray.filter((index) => index > -1);
18548
+ const len = openIndexArray.length;
18549
+ let min;
18550
+ if (len === 1) {
18551
+ min = openIndexArray[0];
18552
+ }
18553
+ else if (len === 2) {
18554
+ min = Math.min(openIndexArray[0], openIndexArray[1]);
18555
+ }
18556
+ else if (len === 3) {
18557
+ min = Math.min(openIndexArray[0], openIndexArray[1], openIndexArray[2]);
18558
+ }
18559
+ tagName = value.substring(0, min);
18560
+ tagName.trim();
18561
+ return ({
18562
+ tag: tagName, styles: stylesList, classes: classList,
18563
+ attributes: attributesList
18564
+ });
18565
+ }
18566
+ }
18567
+
18568
+ /**
18569
+ * EditorManager internal component
18570
+ *
18571
+ * @hidden
18572
+ * @deprecated
18573
+ */
18574
+ class EditorManager {
18575
+ /**
18576
+ * Constructor for creating the component
18577
+ *
18578
+ * @hidden
18579
+ * @deprecated
18580
+ * @param {ICommandModel} options - specifies the command Model
18581
+ */
18582
+ constructor(options) {
18583
+ this.currentDocument = options.document;
18584
+ this.editableElement = options.editableElement;
18585
+ this.nodeSelection = new NodeSelection();
18586
+ this.nodeCutter = new NodeCutter();
18587
+ this.domNode = new DOMNode(this.editableElement, this.currentDocument);
18588
+ this.observer = new Observer(this);
18589
+ this.listObj = new Lists(this);
18590
+ this.formatObj = new Formats(this);
18591
+ this.alignmentObj = new Alignments(this);
18592
+ this.indentsObj = new Indents(this);
18593
+ this.linkObj = new LinkCommand(this);
18594
+ this.imgObj = new ImageCommand(this);
18595
+ this.audioObj = new AudioCommand(this);
18596
+ this.videoObj = new VideoCommand(this);
18597
+ this.selectionObj = new SelectionBasedExec(this);
18598
+ this.inserthtmlObj = new InsertHtmlExec(this);
18599
+ this.insertTextObj = new InsertTextExec(this);
18600
+ this.clearObj = new ClearFormatExec(this);
18601
+ this.tableObj = new TableCommand(this);
18602
+ this.undoRedoManager = new UndoRedoManager(this, options.options);
18603
+ this.msWordPaste = new MsWordPaste(this);
18604
+ this.formatPaintetrObj = new FormatPainterActions(this, options.formatPainterSettings);
18605
+ this.wireEvents();
18606
+ }
18607
+ wireEvents() {
18608
+ this.observer.on(KEY_DOWN, this.editorKeyDown, this);
18609
+ this.observer.on(KEY_UP, this.editorKeyUp, this);
18610
+ this.observer.on(KEY_UP, this.editorKeyUp, this);
18611
+ this.observer.on(MODEL_CHANGED, this.onPropertyChanged, this);
18612
+ this.observer.on(MS_WORD_CLEANUP, this.onWordPaste, this);
18613
+ this.observer.on(ON_BEGIN, this.onBegin, this);
18614
+ }
18615
+ onWordPaste(e) {
18616
+ this.observer.notify(MS_WORD_CLEANUP_PLUGIN, e);
18617
+ }
18618
+ onPropertyChanged(props) {
18619
+ this.observer.notify(MODEL_CHANGED_PLUGIN, props);
18620
+ }
18621
+ editorKeyDown(e) {
18622
+ this.observer.notify(KEY_DOWN_HANDLER, e);
18623
+ }
18624
+ editorKeyUp(e) {
18625
+ this.observer.notify(KEY_UP_HANDLER, e);
18626
+ }
18627
+ onBegin(e) {
18628
+ this.observer.notify(SPACE_ACTION, e);
18629
+ }
18630
+ /* eslint-disable */
18631
+ /**
18632
+ * execCommand
18633
+ *
18634
+ * @param {ExecCommand} command - specifies the execution command
18635
+ * @param {T} value - specifes the value.
18636
+ * @param {Event} event - specifies the call back event
18637
+ * @param {Function} callBack - specifies the function
18638
+ * @param {string} text - specifies the string value
18639
+ * @param {T} exeValue - specifies the values to be executed
18640
+ * @param {string} selector - specifies the selector values
18641
+ * @returns {void}
18642
+ * @hidden
18643
+ * @deprecated
18644
+ */
18645
+ /* eslint-enable */
18646
+ execCommand(command, value, event, callBack, text, exeValue, selector, enterAction) {
18647
+ switch (command.toLowerCase()) {
18648
+ case 'lists':
18649
+ this.observer.notify(LIST_TYPE, { subCommand: value, event: event, callBack: callBack,
18650
+ selector: selector, item: exeValue, enterAction: enterAction });
18651
+ break;
18652
+ case 'formats':
18653
+ this.observer.notify(FORMAT_TYPE, { subCommand: value, event: event, callBack: callBack,
18654
+ selector: selector, exeValue: exeValue, enterAction: enterAction
18655
+ });
18656
+ break;
18657
+ case 'alignments':
18658
+ this.observer.notify(ALIGNMENT_TYPE, {
18659
+ subCommand: value, event: event, callBack: callBack,
18660
+ selector: selector,
18661
+ value: exeValue
18662
+ });
18663
+ break;
18664
+ case 'indents':
18665
+ this.observer.notify(INDENT_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector });
18666
+ break;
18667
+ case 'links':
18668
+ this.observer.notify(LINK, { command: command, value: value, item: exeValue, event: event, callBack: callBack });
18669
+ break;
18670
+ case 'files':
18671
+ this.observer.notify(IMAGE, {
18672
+ command: command, value: 'Image', item: exeValue, event: event, callBack: callBack, selector: selector
18673
+ });
18674
+ break;
18675
+ case 'images':
18676
+ this.observer.notify(IMAGE, {
18677
+ command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
18678
+ });
18679
+ break;
18680
+ case 'audios':
18681
+ this.observer.notify(AUDIO, {
18682
+ command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
18683
+ });
18684
+ break;
18685
+ case 'videos':
18686
+ this.observer.notify(VIDEO, {
18687
+ command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
18688
+ });
18689
+ break;
18690
+ case 'table':
18691
+ switch (value.toString().toLocaleLowerCase()) {
18692
+ case 'createtable':
18693
+ this.observer.notify(TABLE, { item: exeValue, event: event, callBack: callBack, enterAction: enterAction });
18694
+ break;
18695
+ case 'insertrowbefore':
18696
+ case 'insertrowafter':
18697
+ this.observer.notify(INSERT_ROW, { item: exeValue, event: event, callBack: callBack });
18698
+ break;
18699
+ case 'insertcolumnleft':
18700
+ case 'insertcolumnright':
18701
+ this.observer.notify(INSERT_COLUMN, { item: exeValue, event: event, callBack: callBack });
18702
+ break;
18703
+ case 'deleterow':
18704
+ this.observer.notify(DELETEROW, { item: exeValue, event: event, callBack: callBack });
18705
+ break;
18706
+ case 'deletecolumn':
18707
+ this.observer.notify(DELETECOLUMN, { item: exeValue, event: event, callBack: callBack });
18708
+ break;
18709
+ case 'tableremove':
18710
+ this.observer.notify(REMOVETABLE, { item: exeValue, event: event, callBack: callBack });
18711
+ break;
18712
+ case 'tableheader':
18713
+ this.observer.notify(TABLEHEADER, { item: exeValue, event: event, callBack: callBack });
18714
+ break;
18715
+ case 'aligntop':
18716
+ case 'alignmiddle':
18717
+ case 'alignbottom':
18718
+ this.observer.notify(TABLE_VERTICAL_ALIGN, { item: exeValue, event: event, callBack: callBack });
18719
+ break;
18720
+ case 'merge':
18721
+ this.observer.notify(TABLE_MERGE, { item: exeValue, event: event, callBack: callBack });
18722
+ break;
18723
+ case 'horizontalsplit':
18724
+ this.observer.notify(TABLE_HORIZONTAL_SPLIT, { item: exeValue, event: event, callBack: callBack });
18725
+ break;
18726
+ case 'verticalsplit':
18727
+ this.observer.notify(TABLE_VERTICAL_SPLIT, { item: exeValue, event: event, callBack: callBack });
18728
+ break;
18729
+ }
18730
+ break;
18731
+ case 'font':
18732
+ case 'style':
18733
+ case 'effects':
18734
+ case 'casing':
18735
+ this.observer.notify(SELECTION_TYPE, { subCommand: value, event: event, callBack: callBack, value: text, selector: selector, enterAction: enterAction });
18736
+ break;
18737
+ case 'inserthtml':
18738
+ this.observer.notify(INSERTHTML_TYPE, { subCommand: value, callBack: callBack, value: text, enterAction: enterAction });
18739
+ break;
18740
+ case 'inserttext':
18741
+ this.observer.notify(INSERT_TEXT_TYPE, { subCommand: value, callBack: callBack, value: text });
18742
+ break;
18743
+ case 'clear':
18744
+ this.observer.notify(CLEAR_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector, enterAction: enterAction });
18745
+ break;
18746
+ case 'actions':
18747
+ this.observer.notify(ACTION, { subCommand: value, event: event, callBack: callBack, selector: selector });
18748
+ break;
18749
+ case 'formatpainter':
18750
+ this.observer.notify(FORMAT_PAINTER_ACTIONS, { item: exeValue, subCommand: value, event: event, callBack: callBack });
18751
+ break;
18752
+ }
18753
+ }
18754
+ }
18755
+
18756
+ /**
18757
+ * HTML adapter
18758
+ *
18759
+ * @hidden
18760
+ * @deprecated
18761
+ */
18762
+ class HTMLFormatter extends Formatter {
18763
+ constructor(options) {
18764
+ super();
18765
+ this.initialize();
18766
+ extend(this, this, options, true);
18767
+ if (this.currentDocument && this.element) {
18768
+ this.updateFormatter(this.element, this.currentDocument, options.options, options.formatPainterSettings);
18071
18769
  }
18072
18770
  }
18073
- static getComputedStyle(docElement, node, prop) {
18074
- return docElement.defaultView.getComputedStyle(node, null).getPropertyValue(prop);
18075
- }
18076
- static isNumberFormatList(node) {
18077
- const list = node.style && node.style.listStyleType;
18078
- if (list === 'lower-alpha') {
18079
- return 'Lower Alpha';
18080
- }
18081
- else if (list === 'number') {
18082
- return 'Number';
18083
- }
18084
- else if (list === 'upper-alpha') {
18085
- return 'Upper Alpha';
18086
- }
18087
- else if (list === 'lower-roman') {
18088
- return 'Lower Roman';
18089
- }
18090
- else if (list === 'upper-roman') {
18091
- return 'Upper Roman';
18092
- }
18093
- else if (list === 'lower-greek') {
18094
- return 'Lower Greek';
18095
- }
18096
- else if (list === 'none') {
18097
- return 'None';
18098
- }
18099
- else {
18100
- return null;
18101
- }
18771
+ initialize() {
18772
+ this.keyConfig = htmlKeyConfig;
18102
18773
  }
18103
- static isBulletFormatList(node) {
18104
- const list = node.style && node.style.listStyleType;
18105
- if (list === 'circle') {
18106
- return 'Circle';
18107
- }
18108
- else if (list === 'square') {
18109
- return 'Square';
18110
- }
18111
- else if (list === 'none') {
18112
- return 'None';
18113
- }
18114
- else if (list === 'disc') {
18115
- return 'Disc';
18116
- }
18117
- else {
18118
- return null;
18774
+ /**
18775
+ * Update the formatter of RichTextEditor
18776
+ *
18777
+ * @param {Element} editElement - specifies the edit element.
18778
+ * @param {Document} doc - specifies the doucment
18779
+ * @param {number} options - specifies the options
18780
+ * @param {FormatPainterSettingsModel} formatPainterSettings - specifies the format painter settings
18781
+ * @returns {void}
18782
+ * @hidden
18783
+ * @deprecated
18784
+ */
18785
+ updateFormatter(editElement, doc, options, formatPainterSettings) {
18786
+ if (editElement && doc) {
18787
+ this.editorManager = new EditorManager({
18788
+ document: doc,
18789
+ editableElement: editElement,
18790
+ options: options,
18791
+ formatPainterSettings: formatPainterSettings
18792
+ });
18119
18793
  }
18120
18794
  }
18121
18795
  }
@@ -19142,112 +19816,130 @@ class HtmlEditor {
19142
19816
  let selectParentEle;
19143
19817
  const item = args.item;
19144
19818
  const closestElement = closest(args.originalEvent.target, '.e-rte-quick-popup');
19145
- if (closestElement && !closestElement.classList.contains('e-rte-inline-popup')) {
19146
- if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
19147
- item.subCommand === 'FontColor' || item.subCommand === 'BackgroundColor')) {
19148
- if (isIDevice$1() && item.command === 'Images') {
19149
- this.nodeSelectionObj.restore();
19150
- }
19151
- const range = this.nodeSelectionObj.getRange(this.parent.contentModule.getDocument());
19152
- save = this.nodeSelectionObj.save(range, this.parent.contentModule.getDocument());
19153
- selectNodeEle = this.nodeSelectionObj.getNodeCollection(range);
19154
- selectParentEle = this.nodeSelectionObj.getParentNodeCollection(range);
19155
- }
19156
- if (item.command === 'Images') {
19157
- this.parent.notify(imageToolbarAction, {
19158
- member: 'image', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19159
- });
19160
- }
19161
- if (item.command === 'Audios') {
19162
- this.parent.notify(audioToolbarAction, {
19163
- member: 'audio', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19164
- });
19165
- }
19166
- if (item.command === 'Videos') {
19167
- this.parent.notify(videoToolbarAction, {
19168
- member: 'video', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19169
- });
19170
- }
19171
- if (item.command === 'Links') {
19172
- this.parent.notify(linkToolbarAction, {
19173
- member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19174
- });
19175
- }
19176
- if (item.command === 'Table') {
19177
- this.parent.notify(tableToolbarAction, {
19178
- member: 'table', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19179
- });
19180
- }
19181
- }
19182
- else {
19183
- const linkDialog = document.getElementById(this.parent.getID() + '_rtelink');
19184
- const imageDialog = document.getElementById(this.parent.getID() + '_image');
19185
- if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
19186
- item.subCommand === 'FontColor' || item.subCommand === 'BackgroundColor')) {
19187
- const range = this.nodeSelectionObj.getRange(this.parent.contentModule.getDocument());
19188
- if (isNullOrUndefined(linkDialog) && isNullOrUndefined(imageDialog)) {
19819
+ if (item.command !== 'FormatPainter') {
19820
+ if (closestElement && !closestElement.classList.contains('e-rte-inline-popup')) {
19821
+ if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
19822
+ item.subCommand === 'FontColor' || item.subCommand === 'BackgroundColor')) {
19823
+ if (isIDevice$1() && item.command === 'Images') {
19824
+ this.nodeSelectionObj.restore();
19825
+ }
19826
+ const range = this.nodeSelectionObj.getRange(this.parent.contentModule.getDocument());
19189
19827
  save = this.nodeSelectionObj.save(range, this.parent.contentModule.getDocument());
19828
+ selectNodeEle = this.nodeSelectionObj.getNodeCollection(range);
19829
+ selectParentEle = this.nodeSelectionObj.getParentNodeCollection(range);
19190
19830
  }
19191
- selectNodeEle = this.nodeSelectionObj.getNodeCollection(range);
19192
- selectParentEle = this.nodeSelectionObj.getParentNodeCollection(range);
19193
- }
19194
- switch (item.subCommand) {
19195
- case 'Maximize':
19196
- this.parent.notify(enableFullScreen, { args: args });
19197
- break;
19198
- case 'Minimize':
19199
- this.parent.notify(disableFullScreen, { args: args });
19200
- break;
19201
- case 'CreateLink':
19202
- this.parent.notify(insertLink, {
19203
- member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19204
- });
19205
- break;
19206
- case 'RemoveLink':
19207
- this.parent.notify(unLink, {
19208
- member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19209
- });
19210
- break;
19211
- case 'Print':
19212
- this.parent.print();
19213
- break;
19214
- case 'Image':
19215
- this.parent.notify(insertImage, {
19831
+ if (item.command === 'Images') {
19832
+ this.parent.notify(imageToolbarAction, {
19216
19833
  member: 'image', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19217
19834
  });
19218
- break;
19219
- case 'Audio':
19220
- this.parent.notify(insertAudio, {
19835
+ }
19836
+ if (item.command === 'Audios') {
19837
+ this.parent.notify(audioToolbarAction, {
19221
19838
  member: 'audio', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19222
19839
  });
19223
- break;
19224
- case 'Video':
19225
- this.parent.notify(insertVideo, {
19840
+ }
19841
+ if (item.command === 'Videos') {
19842
+ this.parent.notify(videoToolbarAction, {
19226
19843
  member: 'video', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19227
19844
  });
19228
- break;
19229
- case 'CreateTable':
19230
- this.parent.notify(createTable, {
19231
- member: 'table', args: args, selection: save
19845
+ }
19846
+ if (item.command === 'Links') {
19847
+ this.parent.notify(linkToolbarAction, {
19848
+ member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19232
19849
  });
19233
- break;
19234
- case 'SourceCode':
19235
- this.parent.notify(sourceCode, { member: 'viewSource', args: args });
19236
- break;
19237
- case 'Preview':
19238
- this.parent.notify(updateSource, { member: 'updateSource', args: args });
19239
- break;
19240
- case 'FontColor':
19241
- case 'BackgroundColor':
19242
- break;
19243
- case 'File':
19244
- this.parent.notify(renderFileManager, {
19245
- member: 'fileManager', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19850
+ }
19851
+ if (item.command === 'Table') {
19852
+ this.parent.notify(tableToolbarAction, {
19853
+ member: 'table', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19246
19854
  });
19247
- break;
19248
- default:
19249
- this.parent.formatter.process(this.parent, args, args.originalEvent, null);
19250
- break;
19855
+ }
19856
+ }
19857
+ else {
19858
+ const linkDialog = document.getElementById(this.parent.getID() + '_rtelink');
19859
+ const imageDialog = document.getElementById(this.parent.getID() + '_image');
19860
+ if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
19861
+ item.subCommand === 'FontColor' || item.subCommand === 'BackgroundColor')) {
19862
+ const range = this.nodeSelectionObj.getRange(this.parent.contentModule.getDocument());
19863
+ if (isNullOrUndefined(linkDialog) && isNullOrUndefined(imageDialog)) {
19864
+ save = this.nodeSelectionObj.save(range, this.parent.contentModule.getDocument());
19865
+ }
19866
+ selectNodeEle = this.nodeSelectionObj.getNodeCollection(range);
19867
+ selectParentEle = this.nodeSelectionObj.getParentNodeCollection(range);
19868
+ }
19869
+ switch (item.subCommand) {
19870
+ case 'Maximize':
19871
+ this.parent.notify(enableFullScreen, { args: args });
19872
+ break;
19873
+ case 'Minimize':
19874
+ this.parent.notify(disableFullScreen, { args: args });
19875
+ break;
19876
+ case 'CreateLink':
19877
+ this.parent.notify(insertLink, {
19878
+ member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19879
+ });
19880
+ break;
19881
+ case 'RemoveLink':
19882
+ this.parent.notify(unLink, {
19883
+ member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19884
+ });
19885
+ break;
19886
+ case 'Print':
19887
+ this.parent.print();
19888
+ break;
19889
+ case 'Image':
19890
+ this.parent.notify(insertImage, {
19891
+ member: 'image', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19892
+ });
19893
+ break;
19894
+ case 'Audio':
19895
+ this.parent.notify(insertAudio, {
19896
+ member: 'audio', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19897
+ });
19898
+ break;
19899
+ case 'Video':
19900
+ this.parent.notify(insertVideo, {
19901
+ member: 'video', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19902
+ });
19903
+ break;
19904
+ case 'CreateTable':
19905
+ this.parent.notify(createTable, {
19906
+ member: 'table', args: args, selection: save
19907
+ });
19908
+ break;
19909
+ case 'SourceCode':
19910
+ this.parent.notify(sourceCode, { member: 'viewSource', args: args });
19911
+ break;
19912
+ case 'Preview':
19913
+ this.parent.notify(updateSource, { member: 'updateSource', args: args });
19914
+ break;
19915
+ case 'FontColor':
19916
+ case 'BackgroundColor':
19917
+ break;
19918
+ case 'File':
19919
+ this.parent.notify(renderFileManager, {
19920
+ member: 'fileManager', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
19921
+ });
19922
+ break;
19923
+ default:
19924
+ this.parent.formatter.process(this.parent, args, args.originalEvent, null);
19925
+ break;
19926
+ }
19927
+ }
19928
+ }
19929
+ else {
19930
+ if (args.originalEvent.detail === 1) {
19931
+ clearTimeout(this.clickTimeout);
19932
+ this.clickTimeout = setTimeout(() => {
19933
+ this.parent.notify(formatPainterClick, {
19934
+ member: 'formatPainter', args: args
19935
+ });
19936
+ }, 200);
19937
+ }
19938
+ else {
19939
+ clearTimeout(this.clickTimeout);
19940
+ this.parent.notify(formatPainterDoubleClick, {
19941
+ member: 'formatPainter', args: args
19942
+ });
19251
19943
  }
19252
19944
  }
19253
19945
  }
@@ -19290,7 +19982,8 @@ class HtmlEditor {
19290
19982
  const formatterClass = new HTMLFormatter({
19291
19983
  currentDocument: this.contentRenderer.getDocument(),
19292
19984
  element: editElement,
19293
- options: option
19985
+ options: option,
19986
+ formatPainterSettings: this.parent.formatPainterSettings
19294
19987
  });
19295
19988
  this.parent.setProperties({ formatter: formatterClass }, true);
19296
19989
  }
@@ -20771,7 +21464,6 @@ class FullScreen {
20771
21464
  this.parent.toolbarModule.addFixedTBarClass();
20772
21465
  }
20773
21466
  }
20774
- this.parent.refreshUI();
20775
21467
  this.parent.trigger(actionComplete, { requestType: 'Minimize', targetItem: 'Minimize', args: event });
20776
21468
  }
20777
21469
  });
@@ -20891,6 +21583,145 @@ function setAttributes(htmlAttributes, rte, isFrame, initial) {
20891
21583
  }
20892
21584
  }
20893
21585
 
21586
+ class FormatPainter {
21587
+ constructor(parent) {
21588
+ this.isSticky = false;
21589
+ this.isActive = false;
21590
+ this.parent = parent;
21591
+ this.addEventListener();
21592
+ }
21593
+ addEventListener() {
21594
+ this.parent.on(formatPainterClick, this.toolbarClick, this);
21595
+ this.parent.on(formatPainterDoubleClick, this.toolbarDoubleClick, this);
21596
+ this.parent.on(editAreaClick, this.editAreaClick, this);
21597
+ this.parent.on(keyDown, this.onKeyDown, this);
21598
+ this.parent.on(destroy, this.destroy, this);
21599
+ }
21600
+ toolbarClick(args) {
21601
+ this.isActive = true;
21602
+ this.parent.focusIn();
21603
+ this.actionHandler(args, 'click');
21604
+ }
21605
+ toolbarDoubleClick(args) {
21606
+ this.isActive = true;
21607
+ this.isSticky = true;
21608
+ this.parent.focusIn();
21609
+ this.actionHandler(args, 'dbClick');
21610
+ }
21611
+ onKeyDown(event) {
21612
+ const originalEvent = event.args;
21613
+ if ((originalEvent.ctrlKey && originalEvent.shiftKey && (originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste'))
21614
+ || (originalEvent.action === 'escape' && (this.previousAction === 'format-copy' || this.previousAction === 'format-paste'))) {
21615
+ if (!isNullOrUndefined(originalEvent.key) && originalEvent.key.toLowerCase() === 'c') {
21616
+ originalEvent.preventDefault();
21617
+ }
21618
+ if (!isNullOrUndefined(originalEvent.key) && originalEvent.key.toLowerCase() === 'v' &&
21619
+ this.previousAction === 'format-copy' || this.previousAction === 'format-paste' || this.isSticky) {
21620
+ originalEvent.preventDefault();
21621
+ }
21622
+ this.actionHandler(event, 'keyBoard');
21623
+ }
21624
+ }
21625
+ actionHandler(event, type) {
21626
+ let action;
21627
+ let isKeyboard = false;
21628
+ let originalEvent;
21629
+ let args;
21630
+ let item;
21631
+ switch (type) {
21632
+ case 'dbClick':
21633
+ args = event.args;
21634
+ item = args.item;
21635
+ originalEvent = event.args.originalEvent;
21636
+ action = 'format-copy';
21637
+ break;
21638
+ case 'keyBoard':
21639
+ args = null;
21640
+ originalEvent = event.args;
21641
+ isKeyboard = true;
21642
+ action = event.args.action;
21643
+ if (action === 'escape') {
21644
+ this.isSticky = false;
21645
+ this.isActive = false;
21646
+ }
21647
+ break;
21648
+ case 'click':
21649
+ args = event.args;
21650
+ item = args.item;
21651
+ originalEvent = event.args.originalEvent;
21652
+ action = 'format-copy';
21653
+ break;
21654
+ case 'docClick':
21655
+ originalEvent = event;
21656
+ action = 'format-paste';
21657
+ break;
21658
+ }
21659
+ this.updateCursor(isKeyboard);
21660
+ const enable = type === 'docClick' || action === 'escape' ? false : true;
21661
+ this.updateToolbarBtn(enable);
21662
+ if (isNullOrUndefined(item)) {
21663
+ item = {
21664
+ command: 'FormatPainter',
21665
+ subCommand: 'FormatPainter'
21666
+ };
21667
+ }
21668
+ const actionBeginArgs = {
21669
+ requestType: 'FormatPainter', originalEvent: originalEvent, name: action, item: item
21670
+ };
21671
+ const value = {
21672
+ formatPainterAction: action
21673
+ };
21674
+ this.parent.formatter.process(this.parent, actionBeginArgs, originalEvent, value);
21675
+ this.previousAction = action;
21676
+ }
21677
+ updateCursor(isKeyboard) {
21678
+ if (!this.parent.inputElement.classList.contains('e-rte-cursor-brush') && !isKeyboard) {
21679
+ addClass([this.parent.inputElement], 'e-rte-cursor-brush');
21680
+ }
21681
+ else if (!this.isSticky) {
21682
+ removeClass([this.parent.inputElement], 'e-rte-cursor-brush');
21683
+ }
21684
+ }
21685
+ updateToolbarBtn(enable) {
21686
+ const toolbarBtn = this.parent.element.querySelector('.e-rte-format-painter').parentElement.parentElement;
21687
+ if (enable) {
21688
+ addClass([toolbarBtn], 'e-active');
21689
+ }
21690
+ else if (!this.isSticky) {
21691
+ removeClass([toolbarBtn], 'e-active');
21692
+ }
21693
+ }
21694
+ editAreaClick(args) {
21695
+ if (this.isActive) {
21696
+ if (!this.isSticky) {
21697
+ this.isActive = false;
21698
+ }
21699
+ this.actionHandler(args, 'docClick');
21700
+ this.updateToolbarBtn(false);
21701
+ }
21702
+ }
21703
+ destroy() {
21704
+ /**Removeeventlistener */
21705
+ if (this.parent.isDestroyed) {
21706
+ return;
21707
+ }
21708
+ this.parent.off(formatPainterClick, this.toolbarClick);
21709
+ this.parent.off(editAreaClick, this.editAreaClick);
21710
+ this.parent.off(formatPainterDoubleClick, this.toolbarDoubleClick);
21711
+ this.parent.off(keyDown, this.onKeyDown);
21712
+ this.parent.off(destroy, this.destroy);
21713
+ }
21714
+ /**
21715
+ * For internal use only - Get the module name.
21716
+ *
21717
+ * @returns {void}
21718
+ * @hidden
21719
+ */
21720
+ getModuleName() {
21721
+ return 'formatPainter';
21722
+ }
21723
+ }
21724
+
20894
21725
  /**
20895
21726
  * Action export
20896
21727
  */
@@ -21188,7 +22019,8 @@ class Link {
21188
22019
  const eventArgs = {
21189
22020
  args: event ? event.args : {
21190
22021
  item: { command: 'Links', subCommand: 'CreateLink' },
21191
- originalEvent: undefined
22022
+ originalEvent: undefined,
22023
+ name: !isInternal ? 'showDialog' : null
21192
22024
  },
21193
22025
  selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
21194
22026
  };
@@ -21904,7 +22736,8 @@ class Image {
21904
22736
  img.setAttribute('width', (img.width + this.mouseX).toString());
21905
22737
  }
21906
22738
  else {
21907
- img.setAttribute('width', (img.offsetWidth + this.mouseX).toString());
22739
+ const currentWidth = img.offsetWidth === 0 ? img.width + this.mouseX + parseInt(img.style.outlineWidth.split('p')[0]) : img.offsetWidth + this.mouseX;
22740
+ img.setAttribute('width', (currentWidth).toString());
21908
22741
  }
21909
22742
  }
21910
22743
  }
@@ -21986,7 +22819,7 @@ class Image {
21986
22819
  const pageX = this.getPointX(e);
21987
22820
  const pageY = this.getPointY(e);
21988
22821
  const mouseX = (this.resizeBtnStat.botLeft || this.resizeBtnStat.topLeft) ? -(pageX - this.pageX) : (pageX - this.pageX);
21989
- const mouseY = (this.resizeBtnStat.topLeft || this.resizeBtnStat.topRight) ? -(pageY - this.pageY) : (pageY - this.pageY);
22822
+ const mouseY = (this.resizeBtnStat.botLeft || this.resizeBtnStat.topLeft) ? -(pageY - this.pageY) : (pageY - this.pageY);
21990
22823
  const width = parseInt(this.imgDupPos.width, 10) + mouseX;
21991
22824
  const height = parseInt(this.imgDupPos.height, 10) + mouseY;
21992
22825
  this.mouseX = mouseX;
@@ -22157,8 +22990,9 @@ class Image {
22157
22990
  }
22158
22991
  if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
22159
22992
  if (selectNodeEle && selectNodeEle[0].nodeName === 'IMG' && selectNodeEle.length < 1) {
22160
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
22993
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
22161
22994
  save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
22995
+ }
22162
22996
  originalEvent.preventDefault();
22163
22997
  const event = {
22164
22998
  selectNode: selectNodeEle, selection: save, selectParent: selectParentEle,
@@ -22217,8 +23051,9 @@ class Image {
22217
23051
  }
22218
23052
  break;
22219
23053
  case 'insert-image':
22220
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
23054
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
22221
23055
  save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
23056
+ }
22222
23057
  this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
22223
23058
  originalEvent.preventDefault();
22224
23059
  break;
@@ -22244,7 +23079,8 @@ class Image {
22244
23079
  this.insertImage({
22245
23080
  args: {
22246
23081
  item: { command: 'Images', subCommand: 'Image' },
22247
- originalEvent: event
23082
+ originalEvent: event,
23083
+ name: !isInternal ? 'showDialog' : null
22248
23084
  },
22249
23085
  selectNode: selectNodeEle,
22250
23086
  selection: save,
@@ -22255,7 +23091,8 @@ class Image {
22255
23091
  this.insertImage({
22256
23092
  args: {
22257
23093
  item: { command: 'Images', subCommand: 'Image' },
22258
- originalEvent: event
23094
+ originalEvent: event,
23095
+ name: !isInternal ? 'showDialog' : null
22259
23096
  },
22260
23097
  member: 'image',
22261
23098
  text: this.parent.formatter.editorManager.markdownSelection.getSelectedText(this.parent.contentModule.getEditPanel()),
@@ -24005,8 +24842,9 @@ class Audio {
24005
24842
  }
24006
24843
  if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
24007
24844
  if (selectNodeEle && this.isAudioElem(selectNodeEle[0]) && selectNodeEle.length < 1) {
24008
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
24845
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
24009
24846
  save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
24847
+ }
24010
24848
  originalEvent.preventDefault();
24011
24849
  const event = {
24012
24850
  selectNode: selectNodeEle, selection: save, selectParent: selectParentEle,
@@ -24055,8 +24893,9 @@ class Audio {
24055
24893
  }
24056
24894
  break;
24057
24895
  case 'insert-audio':
24058
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
24896
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
24059
24897
  save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
24898
+ }
24060
24899
  this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
24061
24900
  originalEvent.preventDefault();
24062
24901
  break;
@@ -24082,7 +24921,8 @@ class Audio {
24082
24921
  this.insertAudio({
24083
24922
  args: {
24084
24923
  item: { command: 'Audios', subCommand: 'Audio' },
24085
- originalEvent: event
24924
+ originalEvent: event,
24925
+ name: !isInternal ? 'showDialog' : null
24086
24926
  },
24087
24927
  selectNode: selectNodeEle,
24088
24928
  selection: save,
@@ -25098,7 +25938,7 @@ class Video {
25098
25938
  const height = vidEleStyle.height !== '' ? parseInt(vidEleStyle.height, 10) : vid.style.height !== '' ? vid.style.height : vid.height;
25099
25939
  if (width > height) {
25100
25940
  vid.style.minWidth = this.parent.insertVideoSettings.minWidth === 0 ? '140px' : formatUnit(this.parent.insertVideoSettings.minWidth);
25101
- vid.style.minHeight = this.parent.insertVideoSettings.minHeight === 0 ? '50px' : formatUnit(this.parent.insertVideoSettings.minHeight);
25941
+ vid.style.minHeight = this.parent.insertVideoSettings.minHeight === 0 ? '60px' : formatUnit(this.parent.insertVideoSettings.minHeight);
25102
25942
  if (this.parent.insertVideoSettings.resizeByPercent) {
25103
25943
  if (parseInt('' + vid.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
25104
25944
  const percentageValue = this.pixToPerc((parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY), (vid.previousElementSibling || vid.parentElement));
@@ -25309,8 +26149,9 @@ class Video {
25309
26149
  }
25310
26150
  if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
25311
26151
  if (selectNodeEle && (selectNodeEle[0].nodeName === 'VIDEO' || this.isEmbedVidElem(selectNodeEle[0])) && selectNodeEle.length < 1) {
25312
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
26152
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
25313
26153
  save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
26154
+ }
25314
26155
  originalEvent.preventDefault();
25315
26156
  const event = {
25316
26157
  selectNode: selectNodeEle, selection: save, selectParent: selectParentEle,
@@ -25363,8 +26204,9 @@ class Video {
25363
26204
  }
25364
26205
  break;
25365
26206
  case 'insert-video':
25366
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
26207
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
25367
26208
  save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
26209
+ }
25368
26210
  this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
25369
26211
  originalEvent.preventDefault();
25370
26212
  break;
@@ -25390,7 +26232,8 @@ class Video {
25390
26232
  this.insertVideo({
25391
26233
  args: {
25392
26234
  item: { command: 'Videos', subCommand: 'Video' },
25393
- originalEvent: event
26235
+ originalEvent: event,
26236
+ name: !isInternal ? 'showDialog' : null
25394
26237
  },
25395
26238
  selectNode: selectNodeEle,
25396
26239
  selection: save,
@@ -25638,7 +26481,7 @@ class Video {
25638
26481
  }
25639
26482
  }
25640
26483
  showVideoQuickToolbar(e) {
25641
- if (e.type !== 'Videos' || e.args.detail === 2 || isNullOrUndefined(this.parent.quickToolbarModule)
26484
+ if (e.type !== 'Videos' || (!isNullOrUndefined(e.args) && e.args.detail === 2) || isNullOrUndefined(this.parent.quickToolbarModule)
25642
26485
  || isNullOrUndefined(this.parent.quickToolbarModule.videoQTBar) || isNullOrUndefined(e.args)) {
25643
26486
  return;
25644
26487
  }
@@ -26186,7 +27029,7 @@ class ViewSource {
26186
27029
  break;
26187
27030
  case 'toolbar-focus':
26188
27031
  if (this.parent.toolbarSettings.enable) {
26189
- const selector = '.e-toolbar-item[aria-disabled="false"][title] [tabindex]';
27032
+ const selector = '.e-toolbar-item[title] [tabindex]';
26190
27033
  this.parent.toolbarModule.baseToolbar.toolbarObj.element.querySelector(selector).focus();
26191
27034
  }
26192
27035
  break;
@@ -26555,8 +27398,9 @@ class Table {
26555
27398
  if ((event.keyCode === 8 || event.keyCode === 46) ||
26556
27399
  (event.ctrlKey && event.keyCode === 88)) {
26557
27400
  if (ele && ele.tagName === 'TBODY') {
26558
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule)
27401
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule) {
26559
27402
  selection = this.parent.formatter.editorManager.nodeSelection.save(range, this.contentModule.getDocument());
27403
+ }
26560
27404
  event.preventDefault();
26561
27405
  proxy.removeTable(selection, event, true);
26562
27406
  }
@@ -26570,8 +27414,9 @@ class Table {
26570
27414
  ele = !isNullOrUndefined(closestTd) && this.parent.inputElement.contains(closestTd) ? closestTd : ele;
26571
27415
  }
26572
27416
  if (ele && (ele.tagName === 'TD' || ele.tagName === 'TH')) {
26573
- if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule)
27417
+ if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule) {
26574
27418
  selection = this.parent.formatter.editorManager.nodeSelection.save(range, this.contentModule.getDocument());
27419
+ }
26575
27420
  switch (event.keyCode) {
26576
27421
  case 9:
26577
27422
  case 37:
@@ -26614,7 +27459,8 @@ class Table {
26614
27459
  item: {
26615
27460
  command: 'Table',
26616
27461
  subCommand: 'CreateTable'
26617
- }
27462
+ },
27463
+ name: !isInternal ? 'showDialog' : null
26618
27464
  };
26619
27465
  this.insertTableDialog({ self: this, args: args, selection: selection });
26620
27466
  }
@@ -26839,9 +27685,18 @@ class Table {
26839
27685
  const range = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
26840
27686
  this.parent.formatter.editorManager.nodeSelection.save(range, this.contentModule.getDocument());
26841
27687
  this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
26842
- const pageX = (this.parent.iframeSettings.enable) ? window.pageXOffset + this.parent.element.getBoundingClientRect().left + args.clientX : args.pageX;
26843
- const pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
26844
- this.parent.element.getBoundingClientRect().top + args.clientY : args.pageY;
27688
+ let pageX;
27689
+ let pageY;
27690
+ if (Browser.isDevice && e.args.touches) {
27691
+ pageX = e.args.changedTouches[0].pageX;
27692
+ pageY = e.args.changedTouches[0].pageY;
27693
+ }
27694
+ else {
27695
+ pageX = (this.parent.iframeSettings.enable) ? window.pageXOffset
27696
+ + this.parent.element.getBoundingClientRect().left + args.clientX : args.pageX;
27697
+ pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
27698
+ this.parent.element.getBoundingClientRect().top + args.clientY : args.pageY;
27699
+ }
26845
27700
  this.quickToolObj.tableQTBar.showPopup(pageX, pageY, target);
26846
27701
  this.parent.formatter.editorManager.nodeSelection.restore();
26847
27702
  }
@@ -28054,6 +28909,18 @@ const executeGroup = {
28054
28909
  'removeFormat': {
28055
28910
  command: 'Clear',
28056
28911
  subCommand: 'ClearFormat'
28912
+ },
28913
+ 'copyFormatPainter': {
28914
+ command: 'FormatPainter',
28915
+ value: 'format-copy'
28916
+ },
28917
+ 'applyFormatPainter': {
28918
+ command: 'FormatPainter',
28919
+ value: 'format-paste'
28920
+ },
28921
+ 'escapeFormatPainter': {
28922
+ command: 'FormatPainter',
28923
+ value: 'escape'
28057
28924
  }
28058
28925
  };
28059
28926
 
@@ -28305,6 +29172,20 @@ __decorate$2([
28305
29172
  __decorate$2([
28306
29173
  Property(['TableHeader', 'TableRows', 'TableColumns', 'BackgroundColor', '-', 'TableRemove', 'Alignments', 'TableCellVerticalAlign', 'Styles'])
28307
29174
  ], QuickToolbarSettings.prototype, "table", void 0);
29175
+ /**
29176
+ * Configure the format painter settings of the Rich Text Editor.
29177
+ */
29178
+ class FormatPainterSettings extends ChildProperty {
29179
+ }
29180
+ __decorate$2([
29181
+ Property(['Text', 'List', 'Table'])
29182
+ ], FormatPainterSettings.prototype, "allowedContext", void 0);
29183
+ __decorate$2([
29184
+ 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;')
29185
+ ], FormatPainterSettings.prototype, "allowedFormats", void 0);
29186
+ __decorate$2([
29187
+ Property(null)
29188
+ ], FormatPainterSettings.prototype, "deniedFormats", void 0);
28308
29189
  /**
28309
29190
  * Configures the Paste Cleanup settings of the RichTextEditor.
28310
29191
  */
@@ -28523,7 +29404,7 @@ class EnterKeyAction {
28523
29404
  isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
28524
29405
  }
28525
29406
  if (e.args.which === 13 && e.args.code === 'Enter') {
28526
- if (isNullOrUndefined(this.startNode.closest('LI,UL,OL')) && isNullOrUndefined(this.endNode.closest('LI,UL,OL')) && isTableEnter &&
29407
+ if (isNullOrUndefined(this.startNode.closest('LI, UL, OL')) && isNullOrUndefined(this.endNode.closest('LI, UL, OL')) && isTableEnter &&
28527
29408
  isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
28528
29409
  const shiftKey = e.args.shiftKey;
28529
29410
  const actionBeginArgs = {
@@ -28593,11 +29474,6 @@ class EnterKeyAction {
28593
29474
  }
28594
29475
  if (this.range.startContainer === this.range.endContainer &&
28595
29476
  this.range.startOffset === this.range.endOffset && this.range.startContainer === this.parent.inputElement) {
28596
- if (!isNullOrUndefined(this.range.startContainer.childNodes[this.range.startOffset]) &&
28597
- !isNullOrUndefined(this.range.startContainer.childNodes[this.range.startOffset].previousElementSibling) &&
28598
- this.range.startContainer.childNodes[this.range.startOffset].previousElementSibling.nodeName === 'TABLE') {
28599
- this.parent.tableModule.removeResizeElement();
28600
- }
28601
29477
  if (!(this.parent.inputElement.childNodes.length === 1 && this.parent.inputElement.childNodes[0].nodeName === 'TABLE')) {
28602
29478
  if (isNullOrUndefined(this.range.startContainer.childNodes[this.range.startOffset])) {
28603
29479
  let currentLastElem = this.range.startContainer.childNodes[this.range.startOffset - 1];
@@ -28633,7 +29509,7 @@ class EnterKeyAction {
28633
29509
  let isFocusedFirst = false;
28634
29510
  if (this.range.startOffset !== 0 && this.range.endOffset !== 0 &&
28635
29511
  this.range.startContainer === this.range.endContainer && !(!isNullOrUndefined(nearBlockNode.childNodes[0])
28636
- && nearBlockNode.childNodes[0].nodeName === 'IMG' && nearBlockNode.querySelectorAll('img,audio,video').length > 0)) {
29512
+ && nearBlockNode.childNodes[0].nodeName === 'IMG' && nearBlockNode.querySelectorAll('img, audio, video').length > 0)) {
28637
29513
  const startNodeText = this.range.startContainer.textContent;
28638
29514
  const splitFirstText = startNodeText.substring(0, this.range.startOffset);
28639
29515
  // eslint-disable-next-line max-len
@@ -28654,8 +29530,8 @@ class EnterKeyAction {
28654
29530
  (this.range.startContainer.previousSibling.nodeName === 'IMG' || this.range.startContainer.previousSibling.nodeName === 'BR'))) {
28655
29531
  let isNearBlockLengthZero;
28656
29532
  let newElem;
28657
- if (!isNullOrUndefined(this.range.startContainer.childNodes) && this.range.startContainer.textContent.length === 0 &&
28658
- (this.range.startContainer.querySelectorAll('img,audio,video').length > 0 ||
29533
+ if (!isNullOrUndefined(this.range.startContainer.childNodes) && this.range.startContainer.textContent.length === 0
29534
+ && (this.range.startContainer.querySelectorAll('img, audio, video').length > 0 ||
28659
29535
  this.range.startContainer.nodeName === 'IMG' || this.range.startContainer.nodeName === 'TABLE')) {
28660
29536
  newElem = this.createInsertElement(shiftKey);
28661
29537
  isMediaNode = true;
@@ -28664,7 +29540,7 @@ class EnterKeyAction {
28664
29540
  else {
28665
29541
  if ((nearBlockNode.textContent.trim().length !== 0 ||
28666
29542
  nearBlockNode.childNodes[0].nodeName === 'IMG' ||
28667
- (nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img,audio,video').length > 0))) {
29543
+ (nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img, audio, video').length > 0))) {
28668
29544
  if ((this.range.startOffset === this.range.endOffset && this.range.startOffset !== 0)) {
28669
29545
  newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, false).cloneNode(true);
28670
29546
  }
@@ -28728,7 +29604,7 @@ class EnterKeyAction {
28728
29604
  this.range.startContainer.classList.contains('e-audio-wrap'))) {
28729
29605
  if (nearBlockNode.textContent.trim().length > 0) {
28730
29606
  const newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, true);
28731
- let audioVideoElem = !isNullOrUndefined(newElem.previousSibling.querySelector('.e-video-wrap')) ?
29607
+ const audioVideoElem = !isNullOrUndefined(newElem.previousSibling.querySelector('.e-video-wrap')) ?
28732
29608
  newElem.previousSibling.querySelector('.e-video-wrap') : newElem.previousSibling.querySelector('.e-audio-wrap');
28733
29609
  let isBRInserted = false;
28734
29610
  let lastNode = audioVideoElem.previousSibling;
@@ -28750,7 +29626,7 @@ class EnterKeyAction {
28750
29626
  }
28751
29627
  else {
28752
29628
  const newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, true);
28753
- let focusElem = newElem.previousSibling;
29629
+ const focusElem = newElem.previousSibling;
28754
29630
  while (!isNullOrUndefined(focusElem.firstChild)) {
28755
29631
  detach(focusElem.firstChild);
28756
29632
  }
@@ -29024,6 +29900,10 @@ let RichTextEditor = class RichTextEditor extends Component {
29024
29900
  member: 'video',
29025
29901
  args: [this, this.serviceLocator]
29026
29902
  });
29903
+ modules.push({
29904
+ member: 'formatPainter',
29905
+ args: [this]
29906
+ });
29027
29907
  }
29028
29908
  if (this.fileManagerSettings.enable) {
29029
29909
  modules.push({ member: 'fileManager', args: [this, this.serviceLocator] });
@@ -29093,7 +29973,7 @@ let RichTextEditor = class RichTextEditor extends Component {
29093
29973
  this.setContainer();
29094
29974
  this.persistData();
29095
29975
  setStyleAttribute(this.element, { 'width': formatUnit(this.width) });
29096
- attributes(this.element, { role: 'application' });
29976
+ attributes(this.element, { role: 'application', 'aria-label': 'Rich Text Editor' });
29097
29977
  }
29098
29978
  persistData() {
29099
29979
  if (this.enablePersistence && this.originalElement.tagName === 'TEXTAREA') {
@@ -29234,6 +30114,7 @@ let RichTextEditor = class RichTextEditor extends Component {
29234
30114
  */
29235
30115
  executeCommand(commandName, value, option) {
29236
30116
  value = this.htmlPurifier(commandName, value);
30117
+ let internalValue;
29237
30118
  if (this.editorMode === 'HTML') {
29238
30119
  const range = this.getRange();
29239
30120
  if (this.iframeSettings.enable) {
@@ -29280,7 +30161,16 @@ let RichTextEditor = class RichTextEditor extends Component {
29280
30161
  return;
29281
30162
  }
29282
30163
  }
29283
- this.formatter.editorManager.execCommand(tool.command, tool.subCommand ? tool.subCommand : (value ? value : tool.value), null, null, (value ? value : tool.value), (value ? value : tool.value));
30164
+ internalValue = value;
30165
+ if (tool.command === 'FormatPainter') {
30166
+ if (!isNullOrUndefined(value)) {
30167
+ this.formatPainterSettings = value;
30168
+ }
30169
+ internalValue = {
30170
+ formatPainterAction: tool.value
30171
+ };
30172
+ }
30173
+ this.formatter.editorManager.execCommand(tool.command, tool.subCommand ? tool.subCommand : (internalValue ? internalValue : tool.value), null, null, (internalValue ? internalValue : tool.value), (internalValue ? internalValue : tool.value));
29284
30174
  if (option && option.undo) {
29285
30175
  this.formatter.saveData();
29286
30176
  this.formatter.enableUndo(this);
@@ -29533,6 +30423,7 @@ let RichTextEditor = class RichTextEditor extends Component {
29533
30423
  const currentEndContainer = range.endContainer;
29534
30424
  const currentStartOffset = range.startOffset;
29535
30425
  const isSameContainer = currentStartContainer === currentEndContainer ? true : false;
30426
+ const currentEndOffset = currentEndContainer.textContent.length;
29536
30427
  const endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
29537
30428
  range.endContainer;
29538
30429
  const closestLI = closest(endNode, 'LI');
@@ -29618,14 +30509,21 @@ let RichTextEditor = class RichTextEditor extends Component {
29618
30509
  this.formatter.saveData();
29619
30510
  }
29620
30511
  if (e.action !== 'insert-link' &&
30512
+ e.action !== 'format-copy' && e.action !== 'format-paste' &&
29621
30513
  (e.action && e.action !== 'paste' && e.action !== 'space'
29622
30514
  || e.which === 9 || (e.code === 'Backspace' && e.which === 8))) {
29623
- this.formatter.process(this, null, e);
30515
+ let FormatPainterEscapeAction = false;
30516
+ if (!isNullOrUndefined(this.formatPainterModule)) {
30517
+ FormatPainterEscapeAction = this.formatPainterModule.previousAction === 'escape';
30518
+ }
30519
+ if (!FormatPainterEscapeAction) {
30520
+ this.formatter.process(this, null, e);
30521
+ }
29624
30522
  switch (e.action) {
29625
30523
  case 'toolbar-focus':
29626
30524
  if (this.toolbarSettings.enable) {
29627
30525
  // eslint-disable-next-line
29628
- let selector = '.e-toolbar-item[aria-disabled="false"][title] [tabindex]';
30526
+ let selector = '.e-toolbar-item[title] [tabindex]';
29629
30527
  this.toolbarModule.baseToolbar.toolbarObj.element.querySelector(selector).focus();
29630
30528
  }
29631
30529
  break;
@@ -30569,6 +31467,7 @@ let RichTextEditor = class RichTextEditor extends Component {
30569
31467
  }
30570
31468
  else {
30571
31469
  const compiledTemplate = compile(this.valueTemplate)('', this, 'valueTemplate');
31470
+ // eslint-disable-next-line
30572
31471
  if (typeof this.valueTemplate !== 'string' && this.isReact) {
30573
31472
  this.displayTempElem = this.createElement('div');
30574
31473
  for (let i = 0; i < compiledTemplate.length; i++) {
@@ -30608,7 +31507,7 @@ let RichTextEditor = class RichTextEditor extends Component {
30608
31507
  }
30609
31508
  }
30610
31509
  }
30611
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
31510
+ // eslint-disable-next-line
30612
31511
  renderTemplates(callBack) {
30613
31512
  this.renderReactTemplates(callBack);
30614
31513
  }
@@ -30722,7 +31621,9 @@ let RichTextEditor = class RichTextEditor extends Component {
30722
31621
  * @public
30723
31622
  */
30724
31623
  getHtml() {
30725
- return this.serializeValue(this.contentModule.getEditPanel().innerHTML);
31624
+ const htmlValue = this.contentModule.getEditPanel().innerHTML;
31625
+ return (this.enableXhtml && (htmlValue === '<p><br></p>' || htmlValue === '<div><br></div>' ||
31626
+ htmlValue === '<br>') ? null : this.serializeValue(htmlValue));
30726
31627
  }
30727
31628
  /**
30728
31629
  * Retrieves the Rich Text Editor's XHTML validated HTML content when `enableXhtml` property is enabled.
@@ -30973,8 +31874,8 @@ let RichTextEditor = class RichTextEditor extends Component {
30973
31874
  }
30974
31875
  const getTextArea = this.element.querySelector('.e-rte-srctextarea');
30975
31876
  if (this.editorMode === 'HTML') {
30976
- value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>'
30977
- || this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
31877
+ value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
31878
+ this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
30978
31879
  this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
30979
31880
  if (getTextArea && getTextArea.style.display === 'block') {
30980
31881
  value = getTextArea.value;
@@ -31324,6 +32225,9 @@ __decorate$1([
31324
32225
  __decorate$1([
31325
32226
  Complex({}, PasteCleanupSettings)
31326
32227
  ], RichTextEditor.prototype, "pasteCleanupSettings", void 0);
32228
+ __decorate$1([
32229
+ Complex({}, FormatPainterSettings)
32230
+ ], RichTextEditor.prototype, "formatPainterSettings", void 0);
31327
32231
  __decorate$1([
31328
32232
  Complex({}, IFrameSettings)
31329
32233
  ], RichTextEditor.prototype, "iframeSettings", void 0);
@@ -31354,6 +32258,9 @@ __decorate$1([
31354
32258
  __decorate$1([
31355
32259
  Property(false)
31356
32260
  ], RichTextEditor.prototype, "enablePersistence", void 0);
32261
+ __decorate$1([
32262
+ Property(true)
32263
+ ], RichTextEditor.prototype, "showTooltip", void 0);
31357
32264
  __decorate$1([
31358
32265
  Property(false)
31359
32266
  ], RichTextEditor.prototype, "enableResize", void 0);
@@ -31592,10 +32499,6 @@ RichTextEditor = __decorate$1([
31592
32499
  * Base export
31593
32500
  */
31594
32501
 
31595
- /**
31596
- * Base export
31597
- */
31598
-
31599
32502
  /**
31600
32503
  * Export all markdown plugins
31601
32504
  */
@@ -31612,5 +32515,5 @@ RichTextEditor = __decorate$1([
31612
32515
  * Rich Text Editor component exported items
31613
32516
  */
31614
32517
 
31615
- 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 };
32518
+ 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 };
31616
32519
  //# sourceMappingURL=ej2-richtexteditor.es2015.js.map