@syncfusion/ej2-richtexteditor 24.1.47 → 24.2.4

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 (106) hide show
  1. package/CHANGELOG.md +30 -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 +832 -209
  6. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  7. package/dist/es6/ej2-richtexteditor.es5.js +835 -203
  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 +12 -12
  13. package/src/common/constant.d.ts +6 -0
  14. package/src/common/constant.js +6 -0
  15. package/src/common/util.d.ts +6 -0
  16. package/src/common/util.js +58 -20
  17. package/src/editor-manager/base/constant.d.ts +6 -0
  18. package/src/editor-manager/base/constant.js +6 -0
  19. package/src/editor-manager/base/editor-manager.d.ts +5 -0
  20. package/src/editor-manager/base/editor-manager.js +59 -0
  21. package/src/editor-manager/base/interface.d.ts +8 -0
  22. package/src/editor-manager/plugin/dom-node.js +3 -1
  23. package/src/editor-manager/plugin/format-painter-actions.js +1 -1
  24. package/src/editor-manager/plugin/inserthtml.js +7 -2
  25. package/src/editor-manager/plugin/ms-word-clean-up.d.ts +2 -0
  26. package/src/editor-manager/plugin/ms-word-clean-up.js +39 -10
  27. package/src/editor-manager/plugin/selection-commands.js +16 -0
  28. package/src/editor-manager/plugin/table.d.ts +0 -1
  29. package/src/editor-manager/plugin/table.js +14 -26
  30. package/src/editor-manager/plugin/undo.d.ts +1 -0
  31. package/src/editor-manager/plugin/undo.js +21 -1
  32. package/src/rich-text-editor/actions/base-quick-toolbar.js +3 -0
  33. package/src/rich-text-editor/actions/base-toolbar.js +8 -4
  34. package/src/rich-text-editor/actions/count.js +1 -1
  35. package/src/rich-text-editor/actions/dropdown-buttons.js +21 -2
  36. package/src/rich-text-editor/actions/emoji-picker.js +1 -1
  37. package/src/rich-text-editor/actions/full-screen.js +1 -0
  38. package/src/rich-text-editor/actions/html-editor.d.ts +2 -0
  39. package/src/rich-text-editor/actions/html-editor.js +88 -4
  40. package/src/rich-text-editor/actions/keyboard.js +3 -1
  41. package/src/rich-text-editor/actions/paste-clean-up.d.ts +1 -0
  42. package/src/rich-text-editor/actions/paste-clean-up.js +32 -4
  43. package/src/rich-text-editor/actions/toolbar.d.ts +2 -1
  44. package/src/rich-text-editor/base/constant.d.ts +25 -0
  45. package/src/rich-text-editor/base/constant.js +194 -0
  46. package/src/rich-text-editor/base/interface.d.ts +6 -1
  47. package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -0
  48. package/src/rich-text-editor/base/rich-text-editor.js +34 -64
  49. package/src/rich-text-editor/base/util.d.ts +4 -0
  50. package/src/rich-text-editor/base/util.js +35 -1
  51. package/src/rich-text-editor/formatter/formatter.js +15 -4
  52. package/src/rich-text-editor/models/default-locale.js +17 -17
  53. package/src/rich-text-editor/models/items.js +2 -2
  54. package/src/rich-text-editor/renderer/audio-module.d.ts +1 -0
  55. package/src/rich-text-editor/renderer/audio-module.js +13 -0
  56. package/src/rich-text-editor/renderer/dialog-renderer.d.ts +2 -0
  57. package/src/rich-text-editor/renderer/dialog-renderer.js +7 -0
  58. package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
  59. package/src/rich-text-editor/renderer/image-module.d.ts +1 -0
  60. package/src/rich-text-editor/renderer/image-module.js +20 -2
  61. package/src/rich-text-editor/renderer/link-module.js +10 -1
  62. package/src/rich-text-editor/renderer/table-module.d.ts +2 -0
  63. package/src/rich-text-editor/renderer/table-module.js +22 -2
  64. package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +1 -0
  65. package/src/rich-text-editor/renderer/toolbar-renderer.js +25 -3
  66. package/src/rich-text-editor/renderer/video-module.d.ts +3 -0
  67. package/src/rich-text-editor/renderer/video-module.js +54 -30
  68. package/src/selection/selection.js +3 -0
  69. package/styles/bootstrap-dark.css +44 -6
  70. package/styles/bootstrap.css +44 -6
  71. package/styles/bootstrap4.css +44 -6
  72. package/styles/bootstrap5-dark.css +44 -6
  73. package/styles/bootstrap5.css +44 -6
  74. package/styles/fabric-dark.css +44 -6
  75. package/styles/fabric.css +44 -6
  76. package/styles/fluent-dark.css +44 -6
  77. package/styles/fluent.css +44 -6
  78. package/styles/highcontrast-light.css +44 -6
  79. package/styles/highcontrast.css +44 -6
  80. package/styles/material-dark.css +44 -6
  81. package/styles/material.css +44 -6
  82. package/styles/material3-dark.css +58 -14
  83. package/styles/material3.css +58 -14
  84. package/styles/rich-text-editor/_layout.scss +39 -2
  85. package/styles/rich-text-editor/_material-definition.scss +0 -1
  86. package/styles/rich-text-editor/_material3-definition.scss +7 -7
  87. package/styles/rich-text-editor/_theme.scss +12 -5
  88. package/styles/rich-text-editor/bootstrap-dark.css +44 -6
  89. package/styles/rich-text-editor/bootstrap.css +44 -6
  90. package/styles/rich-text-editor/bootstrap4.css +44 -6
  91. package/styles/rich-text-editor/bootstrap5-dark.css +44 -6
  92. package/styles/rich-text-editor/bootstrap5.css +44 -6
  93. package/styles/rich-text-editor/fabric-dark.css +44 -6
  94. package/styles/rich-text-editor/fabric.css +44 -6
  95. package/styles/rich-text-editor/fluent-dark.css +44 -6
  96. package/styles/rich-text-editor/fluent.css +44 -6
  97. package/styles/rich-text-editor/highcontrast-light.css +44 -6
  98. package/styles/rich-text-editor/highcontrast.css +44 -6
  99. package/styles/rich-text-editor/material-dark.css +44 -6
  100. package/styles/rich-text-editor/material.css +44 -6
  101. package/styles/rich-text-editor/material3-dark.css +58 -14
  102. package/styles/rich-text-editor/material3.css +58 -14
  103. package/styles/rich-text-editor/tailwind-dark.css +44 -6
  104. package/styles/rich-text-editor/tailwind.css +44 -6
  105. package/styles/tailwind-dark.css +44 -6
  106. package/styles/tailwind.css +44 -6
@@ -3,7 +3,8 @@ import { RenderType } from '../base/enum';
3
3
  import { getIndex } from '../base/util';
4
4
  import * as events from '../base/constant';
5
5
  import * as classes from '../base/classes';
6
- import { getDropDownValue, getFormattedFontSize, getTooltipText } from '../base/util';
6
+ import { getDropDownValue, getFormattedFontSize, getTooltipText, getTooltipTextDropdownItems, getQuickToolbarTooltipText } from '../base/util';
7
+ import { fontNameLocale, formatsLocale, numberFormatListLocale, bulletFormatListLocale } from '../models/default-locale';
7
8
  import * as model from '../models/items';
8
9
  import { dispatchEvent } from '../base/util';
9
10
  /**
@@ -24,10 +25,28 @@ var DropDownButtons = /** @class */ (function () {
24
25
  if (item.cssClass) {
25
26
  addClass([args.element], item.cssClass);
26
27
  }
28
+ if (item.command === 'Images' || item.command === 'Videos' || item.command === 'Audios' || item.command === 'Table') {
29
+ args.element.setAttribute('title', getQuickToolbarTooltipText(item.text));
30
+ }
27
31
  if (item.command === 'Alignments' || item.subCommand === 'JustifyLeft'
28
32
  || item.subCommand === 'JustifyRight' || item.subCommand === 'JustifyCenter') {
29
33
  args.element.setAttribute('title', getTooltipText(item.subCommand.toLocaleLowerCase(), this.locator));
30
34
  }
35
+ if (item.command === 'Formats') {
36
+ args.element.setAttribute('title', getTooltipTextDropdownItems(item.subCommand.toLocaleLowerCase(), this.locator, formatsLocale));
37
+ }
38
+ if (item.command === 'Font') {
39
+ args.element.setAttribute('title', getTooltipTextDropdownItems(item.value.toLocaleLowerCase(), this.locator, fontNameLocale));
40
+ }
41
+ if (item.subCommand === 'BulletFormatList') {
42
+ args.element.setAttribute('title', getTooltipTextDropdownItems(item.value.toLocaleLowerCase(), this.locator, bulletFormatListLocale));
43
+ }
44
+ if (item.subCommand === 'NumberFormatList') {
45
+ args.element.setAttribute('title', getTooltipTextDropdownItems(item.text.replace(/\s/g, '').toLocaleLowerCase(), this.locator, numberFormatListLocale));
46
+ }
47
+ if (item.subCommand === 'FontSize') {
48
+ args.element.setAttribute('title', getTooltipTextDropdownItems(item.value.toLocaleLowerCase(), null, null, this.parent));
49
+ }
31
50
  };
32
51
  DropDownButtons.prototype.dropdownContent = function (width, type, content) {
33
52
  return ('<span style="display: inline-flex;' + 'width:' + ((type === 'quick') ? 'auto' : width) + '" >' +
@@ -134,7 +153,7 @@ var DropDownButtons = /** @class */ (function () {
134
153
  if (isNullOrUndefined(targetElement) || targetElement.classList.contains(classes.CLS_DROPDOWN_BTN)) {
135
154
  return;
136
155
  }
137
- var fontsize = _this.parent.fontSize.items.slice();
156
+ var fontsize = !isNullOrUndefined(_this.fontSizeDropDown) && !isNullOrUndefined(_this.fontSizeDropDown.items) && _this.fontSizeDropDown.items.length > 0 ? _this.fontSizeDropDown.items : JSON.parse(JSON.stringify(_this.parent.fontSize.items.slice()));
138
157
  fontsize.forEach(function (item) {
139
158
  Object.defineProperties(item, {
140
159
  command: { value: 'Font', enumerable: true }, subCommand: { value: 'FontSize', enumerable: true }
@@ -643,7 +643,7 @@ var EmojiPicker = /** @class */ (function () {
643
643
  noEmojiObj.style.margin = '55px';
644
644
  emojipickerAll.appendChild(noEmojiObj);
645
645
  }
646
- else if (!noEMoji && this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji') || (inputValue === '' && value === ':')) {
646
+ else if (!noEMoji && this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji') || (inputValue === '' && value === ':') || (inputValue === '' && this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji'))) {
647
647
  emojipickerAll.removeChild(this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji'));
648
648
  }
649
649
  emojipickerAll.appendChild(emojiBtnDiv);
@@ -112,6 +112,7 @@ var FullScreen = /** @class */ (function () {
112
112
  _this.parent.toolbarModule.addFixedTBarClass();
113
113
  }
114
114
  }
115
+ _this.parent.refreshUI();
115
116
  _this.parent.trigger(events.actionComplete, { requestType: 'Minimize', targetItem: 'Minimize', args: event });
116
117
  }
117
118
  });
@@ -45,6 +45,8 @@ export declare class HtmlEditor {
45
45
  private onSelectionSave;
46
46
  private onSelectionRestore;
47
47
  private isTableClassAdded;
48
+ private onHandleFontsizeChange;
49
+ private convertFontSize;
48
50
  private onKeyUp;
49
51
  private onKeyDown;
50
52
  private isOrderedList;
@@ -14,6 +14,7 @@ import { getTextNodesUnder, sanitizeHelper, getDefaultValue } from '../base/util
14
14
  import { isIDevice } from '../../common/util';
15
15
  import { XhtmlValidation } from './xhtml-validation';
16
16
  import { ON_BEGIN } from './../../common/constant';
17
+ import * as CONSTANT from '../base/constant';
17
18
  /**
18
19
  * `HtmlEditor` module is used to HTML editor
19
20
  */
@@ -70,6 +71,7 @@ var HtmlEditor = /** @class */ (function () {
70
71
  this.parent.on(events.readOnlyMode, this.updateReadOnly, this);
71
72
  this.parent.on(events.paste, this.onPaste, this);
72
73
  this.parent.on(events.tableclass, this.isTableClassAdded, this);
74
+ this.parent.on(events.onHandleFontsizeChange, this.onHandleFontsizeChange, this);
73
75
  };
74
76
  HtmlEditor.prototype.updateReadOnly = function () {
75
77
  if (this.parent.readonly) {
@@ -88,7 +90,9 @@ var HtmlEditor = /** @class */ (function () {
88
90
  };
89
91
  HtmlEditor.prototype.onSelectionRestore = function (e) {
90
92
  this.parent.isBlur = false;
91
- this.contentRenderer.getEditPanel().focus();
93
+ if (isNOU(this.saveSelection) || isNOU(closest(this.saveSelection.range.startContainer.parentElement, ".e-img-caption")) ? true : !(closest(this.saveSelection.range.startContainer.parentElement, ".e-img-caption").getAttribute("contenteditable") == "false")) {
94
+ this.contentRenderer.getEditPanel().focus();
95
+ }
92
96
  if (isNullOrUndefined(e.items) || e.items) {
93
97
  this.saveSelection.restore();
94
98
  }
@@ -96,11 +100,91 @@ var HtmlEditor = /** @class */ (function () {
96
100
  HtmlEditor.prototype.isTableClassAdded = function () {
97
101
  var tableElement = this.parent.inputElement.querySelectorAll('table');
98
102
  for (var i = 0; i < tableElement.length; i++) {
99
- if (!tableElement[i].classList.contains('e-rte-table')) {
103
+ if (!tableElement[i].classList.contains('e-rte-table') && !tableElement[i].classList.contains('e-rte-paste-table')) {
100
104
  tableElement[i].classList.add('e-rte-table');
101
105
  }
102
106
  }
103
107
  };
108
+ HtmlEditor.prototype.onHandleFontsizeChange = function (e) {
109
+ var keyboardArgs = e.args;
110
+ var args = { name: 'dropDownSelect' };
111
+ args.item = {
112
+ command: 'Font',
113
+ subCommand: 'FontSize'
114
+ };
115
+ var items = this.parent.fontSize.items;
116
+ var activeElem;
117
+ if (this.parent.toolbarModule && this.parent.toolbarModule.dropDownModule &&
118
+ this.parent.toolbarModule.dropDownModule.fontSizeDropDown && !isNOU(this.parent.toolbarModule.dropDownModule.fontSizeDropDown.activeElem[0].textContent) && this.parent.toolbarModule.dropDownModule.fontSizeDropDown.activeElem[0].textContent !== '') {
119
+ activeElem = this.parent.toolbarModule.dropDownModule.fontSizeDropDown.activeElem[0].textContent;
120
+ }
121
+ else {
122
+ var fontSizeValue = void 0;
123
+ var selection = this.parent.contentModule.getDocument().getSelection();
124
+ if (selection && selection.focusNode && selection.focusNode.parentElement) {
125
+ fontSizeValue = document.defaultView.getComputedStyle(selection.focusNode.parentElement, null).getPropertyValue('font-size');
126
+ }
127
+ else {
128
+ fontSizeValue = this.parent.fontSize.width;
129
+ }
130
+ fontSizeValue = isNOU(fontSizeValue) ? this.parent.fontSize.width : fontSizeValue;
131
+ var actualTxtFontValues = fontSizeValue.match(/^([\d.]+)(\D+)$/);
132
+ var size_1 = parseInt(actualTxtFontValues[1], 10);
133
+ var unit = actualTxtFontValues[2];
134
+ var defaultFontValues = items[0].value.match(/^([\d.]+)(\D+)$/);
135
+ if (defaultFontValues[2] === unit) {
136
+ var index = items.findIndex(function (_a) {
137
+ var value = _a.value;
138
+ return parseInt(value, 10) >= size_1;
139
+ });
140
+ activeElem = items[index].text;
141
+ }
142
+ else {
143
+ var convertedSize_1 = this.convertFontSize(size_1, unit, defaultFontValues[2]);
144
+ var index = items.findIndex(function (_a) {
145
+ var value = _a.value;
146
+ return parseInt(value, 10) >= convertedSize_1;
147
+ });
148
+ activeElem = items[index].text;
149
+ }
150
+ }
151
+ var fontIndex = items.findIndex(function (size) { return size.text === activeElem; });
152
+ if (keyboardArgs.action === 'increase-fontsize' && fontIndex !== -1) {
153
+ if (fontIndex >= items.length - 1) {
154
+ var fontValues = items[fontIndex].value.match(/^([\d.]+)(\D+)$/);
155
+ if (fontValues) {
156
+ var size = parseInt(fontValues[1], 10);
157
+ var unit = fontValues[2];
158
+ var roundedSize = size % 10 === 0 ? Math.ceil((size + 1) / 10) * 10 : Math.ceil(size / 10) * 10;
159
+ args.item.value = roundedSize.toLocaleString() + unit;
160
+ args.item.text = roundedSize.toLocaleString() + ' ' + unit;
161
+ }
162
+ this.parent.fontSize.items.push(args.item);
163
+ }
164
+ else {
165
+ args.item.value = items[fontIndex + 1].value;
166
+ args.item.text = items[fontIndex + 1].text;
167
+ }
168
+ }
169
+ else if (keyboardArgs.action === 'decrease-fontsize' && fontIndex !== -1 && fontIndex > 0) {
170
+ args.item.value = items[fontIndex - 1].value;
171
+ args.item.text = items[fontIndex - 1].text;
172
+ }
173
+ else {
174
+ if (fontIndex >= 0 && fontIndex < items.length && items[fontIndex]) {
175
+ args.item.value = items[fontIndex].value;
176
+ args.item.text = items[fontIndex].text;
177
+ }
178
+ }
179
+ this.parent.formatter.process(this.parent, args, keyboardArgs);
180
+ };
181
+ HtmlEditor.prototype.convertFontSize = function (value, originalUnit, targetUnit) {
182
+ if (CONSTANT.supportedUnits.indexOf(originalUnit) !== -1 || CONSTANT.supportedUnits.indexOf(targetUnit) !== -1) {
183
+ originalUnit = 'px';
184
+ }
185
+ var convertedValue = value * CONSTANT.conversionFactors[originalUnit][targetUnit];
186
+ return convertedValue;
187
+ };
104
188
  HtmlEditor.prototype.onKeyUp = function (e) {
105
189
  var args = e.args;
106
190
  var restrictKeys = [8, 9, 13, 16, 17, 18, 20, 27, 37, 38, 39, 40, 44, 45, 46, 91,
@@ -222,7 +306,7 @@ var HtmlEditor = /** @class */ (function () {
222
306
  e.args.keyCode === 13) {
223
307
  this.spaceLink(e.args);
224
308
  if (this.parent.editorMode === 'HTML' && !this.parent.readonly) {
225
- var currentLength = this.parent.getText().trim().replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length;
309
+ var currentLength = this.parent.getText().trim().replace(/(\r\n|\n|\r|\t)/gm, '').replace(/\u200B/g, '').length;
226
310
  var selectionLength = this.parent.getSelection().length;
227
311
  var totalLength = (currentLength - selectionLength) + 1;
228
312
  if (!(this.parent.maxLength === -1 || totalLength <= this.parent.maxLength) &&
@@ -384,7 +468,7 @@ var HtmlEditor = /** @class */ (function () {
384
468
  var liElement;
385
469
  var rootElement;
386
470
  if (e.args.code === 'Delete' && e.args.keyCode === 46 &&
387
- this.parent.contentModule.getText().trim().replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length !== 0 && this.parent.getSelection().length === 0 && currentRange.startContainer.parentElement.tagName !== 'TD' &&
471
+ this.parent.contentModule.getText().trim().replace(/(\r\n|\n|\r|\t)/gm, '').replace(/\u200B/g, '').length !== 0 && this.parent.getSelection().length === 0 && currentRange.startContainer.parentElement.tagName !== 'TD' &&
388
472
  currentRange.startContainer.parentElement.tagName !== 'TH') {
389
473
  this.deleteRangeElement = rootElement = this.getRootBlockNode(currentRange.startContainer);
390
474
  if (this.deleteRangeElement.tagName === 'OL' || this.deleteRangeElement.tagName === 'UL') {
@@ -65,7 +65,9 @@ var keyCode = {
65
65
  'singlequote': 222,
66
66
  ']': 221,
67
67
  '[': 219,
68
- '=': 187
68
+ '=': 187,
69
+ '<': 188,
70
+ '>': 190
69
71
  };
70
72
  /**
71
73
  * KeyboardEvents class enables you to bind key action desired key combinations for ex., Ctrl+A, Delete, Alt+Space etc.
@@ -75,6 +75,7 @@ export declare class PasteCleanup {
75
75
  private deniedTags;
76
76
  private deniedAttributes;
77
77
  private allowedStyle;
78
+ private findLastElement;
78
79
  /**
79
80
  * For internal use only - Get the module name.
80
81
  *
@@ -113,7 +113,8 @@ var PasteCleanup = /** @class */ (function () {
113
113
  args: e.args,
114
114
  text: e.text,
115
115
  allowedStylePropertiesArray: this.parent.pasteCleanupSettings.allowedStyleProps,
116
- callBack: function (a, cropImageData) {
116
+ callBack: function (a, cropImageData, pasteTableSource) {
117
+ args.pasteTableSource = pasteTableSource;
117
118
  value = a.trim();
118
119
  _this.cropImageData = cropImageData;
119
120
  }
@@ -691,10 +692,24 @@ var PasteCleanup = /** @class */ (function () {
691
692
  }
692
693
  this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: filesData }, function (updatedArgs) { value = updatedArgs.value; });
693
694
  clipBoardElem.innerHTML = this.parent.addAnchorAriaLabel(value);
694
- clipBoardElem = this.addTableClass(clipBoardElem);
695
+ clipBoardElem = this.addTableClass(clipBoardElem, args.pasteTableSource);
695
696
  this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
696
697
  extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
697
698
  _this.parent.formatter.onSuccess(_this.parent, args);
699
+ if (!isNOU(returnArgs.elements) && !isNOU(returnArgs.imgElem)) {
700
+ var pasteContent = returnArgs.elements;
701
+ var imageContent = returnArgs.imgElem;
702
+ var lastElementChild = _this.findLastElement(pasteContent[pasteContent.length - 1]);
703
+ var isImageAtLast = !isNOU(lastElementChild) ? lastElementChild.nodeName === 'IMG' : false;
704
+ if (isImageAtLast || pasteContent[pasteContent.length - 1] === imageContent[imageContent.length - 1]) {
705
+ _this.parent.notify(events.insertCompleted, {
706
+ args: args.event,
707
+ type: 'Images',
708
+ isNotify: true,
709
+ elements: imageContent[imageContent.length - 1]
710
+ });
711
+ }
712
+ }
698
713
  }, clipBoardElem, null, null, this.parent.enterKey);
699
714
  this.removeTempClass();
700
715
  this.parent.notify(events.toolbarRefresh, {});
@@ -749,12 +764,15 @@ var PasteCleanup = /** @class */ (function () {
749
764
  }
750
765
  }
751
766
  };
752
- PasteCleanup.prototype.addTableClass = function (element) {
767
+ PasteCleanup.prototype.addTableClass = function (element, source) {
753
768
  var tableElement = element.querySelectorAll('table');
754
769
  for (var i = 0; i < tableElement.length; i++) {
755
- if (!tableElement[i].classList.contains('e-rte-table')) {
770
+ if (!tableElement[i].classList.contains('e-rte-table') && (source === 'html' || source === '')) {
756
771
  tableElement[i].classList.add('e-rte-table');
757
772
  }
773
+ else if (source && source !== 'html') {
774
+ tableElement[i].classList.add('e-rte-paste-' + source + '-table');
775
+ }
758
776
  }
759
777
  return element;
760
778
  };
@@ -1089,6 +1107,16 @@ var PasteCleanup = /** @class */ (function () {
1089
1107
  }
1090
1108
  return clipBoardElem;
1091
1109
  };
1110
+ PasteCleanup.prototype.findLastElement = function (element) {
1111
+ if (!isNOU(element) && !isNOU(element.lastElementChild)) {
1112
+ var lastChild = element.lastElementChild;
1113
+ while (lastChild && lastChild.lastElementChild) {
1114
+ lastChild = lastChild.lastElementChild;
1115
+ }
1116
+ return lastChild;
1117
+ }
1118
+ return null;
1119
+ };
1092
1120
  /**
1093
1121
  * For internal use only - Get the module name.
1094
1122
  *
@@ -4,6 +4,7 @@ import { IUpdateItemsModel } from '../base/interface';
4
4
  import { ServiceLocator } from '../services/service-locator';
5
5
  import { RendererFactory } from '../services/renderer-factory';
6
6
  import { BaseToolbar } from './base-toolbar';
7
+ import { DropDownButtons } from './dropdown-buttons';
7
8
  import { RichTextEditorModel } from '../base/rich-text-editor-model';
8
9
  /**
9
10
  * `Toolbar` module is used to handle Toolbar actions.
@@ -22,7 +23,7 @@ export declare class Toolbar {
22
23
  private isTransformChild;
23
24
  private contentRenderer;
24
25
  protected toolbarRenderer: IRenderer;
25
- private dropDownModule;
26
+ dropDownModule: DropDownButtons;
26
27
  private toolbarActionModule;
27
28
  protected renderFactory: RendererFactory;
28
29
  private keyBoardModule;
@@ -744,11 +744,21 @@ export declare const cleanupResizeElements: string;
744
744
  /**
745
745
  * @hidden
746
746
 
747
+ */
748
+ export declare const afterKeyDown: string;
749
+ /**
750
+ * @hidden
751
+
747
752
  */
748
753
  export declare const updateValueOnIdle: string;
749
754
  /**
750
755
  * @hidden
751
756
 
757
+ */
758
+ export declare const documentClickClosedBy: string;
759
+ /**
760
+ * @hidden
761
+
752
762
  */
753
763
  export declare const blockEmptyNodes: string;
754
764
  /**
@@ -756,3 +766,18 @@ export declare const blockEmptyNodes: string;
756
766
 
757
767
  */
758
768
  export declare const inlineEmptyNodes: string;
769
+ /**
770
+ * @hidden
771
+
772
+ */
773
+ export declare const supportedUnits: string[];
774
+ /**
775
+ * @hidden
776
+
777
+ */
778
+ export declare const conversionFactors: Record<string, Record<string, number>>;
779
+ /**
780
+ * @hidden
781
+
782
+ */
783
+ export declare const onHandleFontsizeChange: string;
@@ -744,11 +744,21 @@ export var cleanupResizeElements = 'cleanupResizeElements';
744
744
  /**
745
745
  * @hidden
746
746
 
747
+ */
748
+ export var afterKeyDown = 'afterKeyDown';
749
+ /**
750
+ * @hidden
751
+
747
752
  */
748
753
  export var updateValueOnIdle = 'updateValueOnIdle';
749
754
  /**
750
755
  * @hidden
751
756
 
757
+ */
758
+ export var documentClickClosedBy = 'documentClickClosedBy';
759
+ /**
760
+ * @hidden
761
+
752
762
  */
753
763
  export var blockEmptyNodes = "address:empty, article:empty, aside:empty, blockquote:empty,\n details:empty, dd:empty, div:empty, dl:empty, dt:empty, fieldset:empty, footer:empty,form:empty, h1:empty,\n h2:empty, h3:empty, h4:empty, h5:empty, h6:empty, header:empty, hgroup:empty, li:empty, main:empty, nav:empty,\n noscript:empty, output:empty, p:empty, pre:empty, section:empty, td:empty, th:empty";
754
764
  /**
@@ -756,3 +766,187 @@ export var blockEmptyNodes = "address:empty, article:empty, aside:empty, blockqu
756
766
 
757
767
  */
758
768
  export var inlineEmptyNodes = "a:empty, abbr:empty, acronym:empty, b:empty, bdi:empty, bdo:empty, big:empty, button:empty,\ncanvas:empty, cite:empty, code:empty, data:empty, datalist:empty, del:empty, dfn:empty, em:empty, font:empty, i:empty, iframe:empty,\nins:empty, kbd:empty, label:empty, map:empty, mark:empty, meter:empty, noscript:empty, object:empty, output:empty, picture:empty, progress:empty,\nq:empty, ruby:empty, s:empty, samp:empty, script:empty, select:empty, slot:empty, small:empty, span:empty, strong:empty, strike:empty, sub:empty, sup:empty, svg:empty,\ntemplate:empty, textarea:empty, time:empty, u:empty, tt:empty, var:empty, wbr:empty";
769
+ /**
770
+ * @hidden
771
+
772
+ */
773
+ export var supportedUnits = ['px', 'em', 'rem', 'pt', 'cm', 'mm', 'in', 'pc', 'vw', 'vh', 'vmin', 'vmax'];
774
+ /**
775
+ * @hidden
776
+
777
+ */
778
+ export var conversionFactors = {
779
+ 'px': {
780
+ 'px': 1,
781
+ 'em': 0.0625,
782
+ 'rem': 0.0625,
783
+ 'pt': 0.75,
784
+ 'cm': 0.0264583,
785
+ 'mm': 0.0026458,
786
+ 'in': 0.0104167,
787
+ 'pc': 0.0625,
788
+ 'vw': 0.00625,
789
+ 'vh': 0.00625,
790
+ 'vmin': 0.00625,
791
+ 'vmax': 0.00625
792
+ },
793
+ 'em': {
794
+ 'px': 16,
795
+ 'em': 1,
796
+ 'rem': 1,
797
+ 'pt': 12,
798
+ 'cm': 0.423333,
799
+ 'mm': 0.0423333,
800
+ 'in': 0.166667,
801
+ 'pc': 0.0625,
802
+ 'vw': 1,
803
+ 'vh': 1,
804
+ 'vmin': 1,
805
+ 'vmax': 1
806
+ },
807
+ 'rem': {
808
+ 'px': 16,
809
+ 'em': 1,
810
+ 'rem': 1,
811
+ 'pt': 12,
812
+ 'cm': 0.423333,
813
+ 'mm': 0.0423333,
814
+ 'in': 0.166667,
815
+ 'pc': 0.0625,
816
+ 'vw': 1,
817
+ 'vh': 1,
818
+ 'vmin': 1,
819
+ 'vmax': 1
820
+ },
821
+ 'pt': {
822
+ 'px': 1.33333,
823
+ 'em': 0.0833333,
824
+ 'rem': 0.0833333,
825
+ 'pt': 1,
826
+ 'cm': 0.0352778,
827
+ 'mm': 0.0035278,
828
+ 'in': 0.0138889,
829
+ 'pc': 0.0416667,
830
+ 'vw': 0.00416667,
831
+ 'vh': 0.00416667,
832
+ 'vmin': 0.00416667,
833
+ 'vmax': 0.00416667
834
+ },
835
+ 'cm': {
836
+ 'px': 37.7953,
837
+ 'em': 2.3622,
838
+ 'rem': 2.3622,
839
+ 'pt': 28.3465,
840
+ 'cm': 1,
841
+ 'mm': 0.1,
842
+ 'in': 0.393701,
843
+ 'pc': 0.148148,
844
+ 'vw': 0.0377953,
845
+ 'vh': 0.0377953,
846
+ 'vmin': 0.0377953,
847
+ 'vmax': 0.0377953
848
+ },
849
+ 'mm': {
850
+ 'px': 3.77953,
851
+ 'em': 0.23622,
852
+ 'rem': 0.23622,
853
+ 'pt': 2.83465,
854
+ 'cm': 10,
855
+ 'mm': 1,
856
+ 'in': 0.0393701,
857
+ 'pc': 0.0148148,
858
+ 'vw': 0.00377953,
859
+ 'vh': 0.00377953,
860
+ 'vmin': 0.00377953,
861
+ 'vmax': 0.00377953
862
+ },
863
+ 'in': {
864
+ 'px': 96,
865
+ 'em': 6,
866
+ 'rem': 6,
867
+ 'pt': 72,
868
+ 'cm': 2.54,
869
+ 'mm': 25.4,
870
+ 'in': 1,
871
+ 'pc': 0.375,
872
+ 'vw': 0.09375,
873
+ 'vh': 0.09375,
874
+ 'vmin': 0.09375,
875
+ 'vmax': 0.09375
876
+ },
877
+ 'pc': {
878
+ 'px': 16,
879
+ 'em': 1,
880
+ 'rem': 1,
881
+ 'pt': 12,
882
+ 'cm': 0.423333,
883
+ 'mm': 0.0423333,
884
+ 'in': 0.166667,
885
+ 'pc': 1,
886
+ 'vw': 0.0625,
887
+ 'vh': 0.0625,
888
+ 'vmin': 0.0625,
889
+ 'vmax': 0.0625
890
+ },
891
+ 'vw': {
892
+ 'px': 160,
893
+ 'em': 10,
894
+ 'rem': 10,
895
+ 'pt': 120,
896
+ 'cm': 4.23333,
897
+ 'mm': 0.423333,
898
+ 'in': 1.66667,
899
+ 'pc': 0.625,
900
+ 'vw': 1,
901
+ 'vh': 1,
902
+ 'vmin': 1,
903
+ 'vmax': 1
904
+ },
905
+ 'vh': {
906
+ 'px': 160,
907
+ 'em': 10,
908
+ 'rem': 10,
909
+ 'pt': 120,
910
+ 'cm': 4.23333,
911
+ 'mm': 0.423333,
912
+ 'in': 1.66667,
913
+ 'pc': 0.625,
914
+ 'vw': 1,
915
+ 'vh': 1,
916
+ 'vmin': 1,
917
+ 'vmax': 1
918
+ },
919
+ 'vmin': {
920
+ 'px': 160,
921
+ 'em': 10,
922
+ 'rem': 10,
923
+ 'pt': 120,
924
+ 'cm': 4.23333,
925
+ 'mm': 0.423333,
926
+ 'in': 1.66667,
927
+ 'pc': 0.625,
928
+ 'vw': 1,
929
+ 'vh': 1,
930
+ 'vmin': 1,
931
+ 'vmax': 1
932
+ },
933
+ 'vmax': {
934
+ 'px': 160,
935
+ 'em': 10,
936
+ 'rem': 10,
937
+ 'pt': 120,
938
+ 'cm': 4.23333,
939
+ 'mm': 0.423333,
940
+ 'in': 1.66667,
941
+ 'pc': 0.625,
942
+ 'vw': 1,
943
+ 'vh': 1,
944
+ 'vmin': 1,
945
+ 'vmax': 1
946
+ }
947
+ };
948
+ /**
949
+ * @hidden
950
+
951
+ */
952
+ export var onHandleFontsizeChange = 'onHandleFontsizeChange';
@@ -254,7 +254,7 @@ export interface NotifyArgs {
254
254
  action?: string;
255
255
  callBack?(args?: string | IImageCommandsArgs, cropImageData?: {
256
256
  [key: string]: string | boolean | number;
257
- }[]): void;
257
+ }[], pasteTableSource?: string): void;
258
258
  file?: Blob;
259
259
  insertElement?: Element;
260
260
  touchData?: ITouchData;
@@ -262,6 +262,11 @@ export interface NotifyArgs {
262
262
  formatPainterSettings?: FormatPainterSettingsModel;
263
263
  emojiPickerSettings?: EmojiSettingsModel;
264
264
  ariaLabel?: string;
265
+ /**
266
+ * Defines the source of the Table content.
267
+ * @private
268
+ */
269
+ pasteTableSource?: string;
265
270
  }
266
271
  /**
267
272
  * Provides information about the current and previous cssClass property .
@@ -1607,4 +1607,5 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
1607
1607
  * @hidden
1608
1608
  */
1609
1609
  private resetToolbarTabIndex;
1610
+ private removeSelectionClassStates;
1610
1611
  }