@syncfusion/ej2-richtexteditor 19.2.57 → 19.3.43

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 (117) hide show
  1. package/.eslintrc.json +1 -1
  2. package/CHANGELOG.md +61 -9
  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 +1006 -312
  6. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  7. package/dist/es6/ej2-richtexteditor.es5.js +1014 -310
  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/types.d.ts +8 -0
  14. package/src/editor-manager/base/editor-manager.d.ts +1 -1
  15. package/src/editor-manager/base/editor-manager.js +6 -6
  16. package/src/editor-manager/base/interface.d.ts +7 -1
  17. package/src/editor-manager/plugin/clearformat-exec.js +2 -2
  18. package/src/editor-manager/plugin/clearformat.d.ts +3 -1
  19. package/src/editor-manager/plugin/clearformat.js +19 -9
  20. package/src/editor-manager/plugin/dom-node.js +2 -2
  21. package/src/editor-manager/plugin/formats.d.ts +1 -0
  22. package/src/editor-manager/plugin/formats.js +87 -7
  23. package/src/editor-manager/plugin/image.js +77 -54
  24. package/src/editor-manager/plugin/inserthtml.js +20 -2
  25. package/src/editor-manager/plugin/isformatted.js +2 -1
  26. package/src/editor-manager/plugin/lists.d.ts +1 -0
  27. package/src/editor-manager/plugin/lists.js +87 -8
  28. package/src/editor-manager/plugin/nodecutter.d.ts +1 -0
  29. package/src/editor-manager/plugin/nodecutter.js +1 -0
  30. package/src/editor-manager/plugin/selection-commands.d.ts +2 -1
  31. package/src/editor-manager/plugin/selection-commands.js +29 -12
  32. package/src/editor-manager/plugin/selection-exec.js +2 -2
  33. package/src/editor-manager/plugin/table.js +19 -9
  34. package/src/editor-manager/plugin/toolbar-status.d.ts +1 -0
  35. package/src/editor-manager/plugin/toolbar-status.js +20 -0
  36. package/src/rich-text-editor/actions/base-quick-toolbar.js +3 -4
  37. package/src/rich-text-editor/actions/enter-key.d.ts +18 -0
  38. package/src/rich-text-editor/actions/enter-key.js +290 -0
  39. package/src/rich-text-editor/actions/full-screen.js +62 -42
  40. package/src/rich-text-editor/actions/html-editor.js +30 -20
  41. package/src/rich-text-editor/actions/paste-clean-up.js +5 -5
  42. package/src/rich-text-editor/actions/resize.js +4 -4
  43. package/src/rich-text-editor/base/constant.d.ts +5 -0
  44. package/src/rich-text-editor/base/constant.js +5 -0
  45. package/src/rich-text-editor/base/interface.d.ts +15 -3
  46. package/src/rich-text-editor/base/rich-text-editor-model.d.ts +27 -1
  47. package/src/rich-text-editor/base/rich-text-editor.d.ts +34 -5
  48. package/src/rich-text-editor/base/rich-text-editor.js +66 -57
  49. package/src/rich-text-editor/base/util.d.ts +7 -1
  50. package/src/rich-text-editor/base/util.js +45 -11
  51. package/src/rich-text-editor/formatter/formatter.js +9 -7
  52. package/src/rich-text-editor/models/items.js +3 -3
  53. package/src/rich-text-editor/renderer/iframe-content-renderer.js +2 -2
  54. package/src/rich-text-editor/renderer/image-module.d.ts +6 -0
  55. package/src/rich-text-editor/renderer/image-module.js +70 -26
  56. package/src/rich-text-editor/renderer/link-module.js +4 -3
  57. package/src/rich-text-editor/renderer/popup-renderer.js +1 -2
  58. package/src/rich-text-editor/renderer/render.js +10 -2
  59. package/src/rich-text-editor/renderer/table-module.js +25 -15
  60. package/src/rich-text-editor/renderer/toolbar-renderer.js +1 -1
  61. package/src/rich-text-editor/renderer/view-source.js +21 -3
  62. package/styles/bootstrap-dark.css +25 -12
  63. package/styles/bootstrap.css +25 -12
  64. package/styles/bootstrap4.css +21 -13
  65. package/styles/bootstrap5-dark.css +3058 -0
  66. package/styles/bootstrap5-dark.scss +1 -0
  67. package/styles/bootstrap5.css +3058 -0
  68. package/styles/bootstrap5.scss +1 -0
  69. package/styles/fabric-dark.css +20 -12
  70. package/styles/fabric.css +20 -12
  71. package/styles/highcontrast-light.css +20 -12
  72. package/styles/highcontrast.css +19 -18
  73. package/styles/material-dark.css +22 -14
  74. package/styles/material.css +19 -11
  75. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +1 -1
  76. package/styles/rich-text-editor/_bootstrap-definition.scss +1 -1
  77. package/styles/rich-text-editor/_bootstrap4-definition.scss +2 -2
  78. package/styles/rich-text-editor/_bootstrap5-dark-definition.scss +1 -0
  79. package/styles/rich-text-editor/_bootstrap5-definition.scss +168 -0
  80. package/styles/rich-text-editor/_fabric-dark-definition.scss +1 -1
  81. package/styles/rich-text-editor/_fabric-definition.scss +1 -1
  82. package/styles/rich-text-editor/_highcontrast-definition.scss +2 -2
  83. package/styles/rich-text-editor/_highcontrast-light-definition.scss +1 -1
  84. package/styles/rich-text-editor/_layout.scss +64 -7
  85. package/styles/rich-text-editor/_tailwind-dark-definition.scss +1 -165
  86. package/styles/rich-text-editor/_tailwind-definition.scss +74 -72
  87. package/styles/rich-text-editor/_theme.scss +103 -3
  88. package/styles/rich-text-editor/bootstrap-dark.css +25 -12
  89. package/styles/rich-text-editor/bootstrap.css +25 -12
  90. package/styles/rich-text-editor/bootstrap4.css +21 -13
  91. package/styles/rich-text-editor/bootstrap5-dark.css +3058 -0
  92. package/styles/rich-text-editor/bootstrap5-dark.scss +4 -0
  93. package/styles/rich-text-editor/bootstrap5.css +3058 -0
  94. package/styles/rich-text-editor/bootstrap5.scss +4 -0
  95. package/styles/rich-text-editor/fabric-dark.css +20 -12
  96. package/styles/rich-text-editor/fabric.css +20 -12
  97. package/styles/rich-text-editor/highcontrast-light.css +20 -12
  98. package/styles/rich-text-editor/highcontrast.css +19 -18
  99. package/styles/rich-text-editor/icons/_bootstrap-dark.scss +1 -1
  100. package/styles/rich-text-editor/icons/_bootstrap.scss +1 -1
  101. package/styles/rich-text-editor/icons/_bootstrap4.scss +1 -1
  102. package/styles/rich-text-editor/icons/_bootstrap5-dark.scss +1 -0
  103. package/styles/rich-text-editor/icons/_bootstrap5.scss +303 -0
  104. package/styles/rich-text-editor/icons/_fabric-dark.scss +1 -1
  105. package/styles/rich-text-editor/icons/_fabric.scss +1 -1
  106. package/styles/rich-text-editor/icons/_highcontrast-light.scss +1 -1
  107. package/styles/rich-text-editor/icons/_highcontrast.scss +1 -1
  108. package/styles/rich-text-editor/icons/_material-dark.scss +1 -1
  109. package/styles/rich-text-editor/icons/_material.scss +1 -1
  110. package/styles/rich-text-editor/icons/_tailwind-dark.scss +1 -304
  111. package/styles/rich-text-editor/icons/_tailwind.scss +2 -2
  112. package/styles/rich-text-editor/material-dark.css +22 -14
  113. package/styles/rich-text-editor/material.css +19 -11
  114. package/styles/rich-text-editor/tailwind-dark.css +51 -20
  115. package/styles/rich-text-editor/tailwind.css +49 -18
  116. package/styles/tailwind-dark.css +51 -20
  117. package/styles/tailwind.css +49 -18
@@ -1,8 +1,8 @@
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, isBlazor, isNullOrUndefined, prepend, print, removeClass, select, selectAll, setStyleAttribute } from '@syncfusion/ej2-base';
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
4
  import { Dialog, Popup, getScrollableParent, isCollide } from '@syncfusion/ej2-popups';
5
- import { ColorPicker, NumericTextBox, Uploader } from '@syncfusion/ej2-inputs';
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';
8
8
 
@@ -449,6 +449,11 @@ var readOnlyMode = 'readOnlyMode';
449
449
  * @deprecated
450
450
  */
451
451
  var pasteClean = 'pasteClean';
452
+ /**
453
+ * @hidden
454
+ * @deprecated
455
+ */
456
+ var enterHandler = 'enterHandler';
452
457
  /**
453
458
  * @hidden
454
459
  * @deprecated
@@ -1351,14 +1356,14 @@ var tools = {
1351
1356
  'numberformatlist': {
1352
1357
  'id': 'NumberFormatList',
1353
1358
  'icon': 'e-order-list',
1354
- 'tooltip': 'NumberFormatList',
1359
+ 'tooltip': 'Number Format List',
1355
1360
  'command': 'NumberFormatList',
1356
1361
  'subCommand': 'NumberFormatList'
1357
1362
  },
1358
1363
  'bulletformatlist': {
1359
1364
  'id': 'BulletFormatList',
1360
1365
  'icon': 'e-unorder-list',
1361
- 'tooltip': 'BulletFormatList',
1366
+ 'tooltip': 'Bullet Format List',
1362
1367
  'command': 'BulletFormatList',
1363
1368
  'subCommand': 'BulletFormatList'
1364
1369
  },
@@ -1532,7 +1537,7 @@ var tools = {
1532
1537
  },
1533
1538
  'dimension': {
1534
1539
  'id': 'Dimension',
1535
- 'icon': 'e-dimension',
1540
+ 'icon': 'e-img-dimension',
1536
1541
  'tooltip': 'Change Size',
1537
1542
  'command': 'Images',
1538
1543
  'subCommand': 'Dimension'
@@ -2492,11 +2497,19 @@ function toObjectLowerCase(obj) {
2492
2497
  function getEditValue(value, rteObj) {
2493
2498
  var val;
2494
2499
  if (value !== null && value !== '') {
2495
- val = rteObj.enableHtmlEncode ? updateTextNode(decode(value)) : updateTextNode(value);
2500
+ val = rteObj.enableHtmlEncode ? updateTextNode(decode(value), rteObj) : updateTextNode(value, rteObj);
2496
2501
  rteObj.setProperties({ value: val }, true);
2497
2502
  }
2498
2503
  else {
2499
- val = rteObj.enableHtmlEncode ? '&lt;p&gt;&lt;br/&gt;&lt;/p&gt;' : '<p><br/></p>';
2504
+ if (rteObj.enterKey === 'DIV') {
2505
+ val = rteObj.enableHtmlEncode ? '&lt;div&gt;&lt;br/&gt;&lt;/div&gt;' : '<div><br/></div>';
2506
+ }
2507
+ else if (rteObj.enterKey === 'BR') {
2508
+ val = rteObj.enableHtmlEncode ? '&lt;br/&gt;' : '<br/>';
2509
+ }
2510
+ else {
2511
+ val = rteObj.enableHtmlEncode ? '&lt;p&gt;&lt;br/&gt;&lt;/p&gt;' : '<p><br/></p>';
2512
+ }
2500
2513
  }
2501
2514
  return val;
2502
2515
  }
@@ -2505,7 +2518,7 @@ function getEditValue(value, rteObj) {
2505
2518
  * @returns {string} - returns the string
2506
2519
  * @hidden
2507
2520
  */
2508
- function updateTextNode(value) {
2521
+ function updateTextNode(value, rteObj) {
2509
2522
  var tempNode = document.createElement('div');
2510
2523
  var resultElm = document.createElement('div');
2511
2524
  var childNodes = tempNode.childNodes;
@@ -2514,20 +2527,25 @@ function updateTextNode(value) {
2514
2527
  if (childNodes.length > 0) {
2515
2528
  var isPreviousInlineElem = void 0;
2516
2529
  var previousParent = void 0;
2517
- var paraElm = void 0;
2530
+ var insertElem = void 0;
2518
2531
  while (tempNode.firstChild) {
2519
- if ((tempNode.firstChild.nodeName === '#text' &&
2532
+ if (rteObj.enterKey !== 'BR' && ((tempNode.firstChild.nodeName === '#text' &&
2520
2533
  (tempNode.firstChild.textContent.indexOf('\n') < 0 || tempNode.firstChild.textContent.trim() !== '')) ||
2521
- inlineNode.indexOf(tempNode.firstChild.nodeName.toLocaleLowerCase()) >= 0) {
2534
+ inlineNode.indexOf(tempNode.firstChild.nodeName.toLocaleLowerCase()) >= 0)) {
2522
2535
  if (!isPreviousInlineElem) {
2523
- paraElm = createElement('p');
2524
- resultElm.appendChild(paraElm);
2525
- paraElm.appendChild(tempNode.firstChild);
2536
+ if (rteObj.enterKey === 'DIV') {
2537
+ insertElem = createElement('div');
2538
+ }
2539
+ else {
2540
+ insertElem = createElement('p');
2541
+ }
2542
+ resultElm.appendChild(insertElem);
2543
+ insertElem.appendChild(tempNode.firstChild);
2526
2544
  }
2527
2545
  else {
2528
2546
  previousParent.appendChild(tempNode.firstChild);
2529
2547
  }
2530
- previousParent = paraElm;
2548
+ previousParent = insertElem;
2531
2549
  isPreviousInlineElem = true;
2532
2550
  }
2533
2551
  else if (tempNode.firstChild.nodeName === '#text' && (tempNode.firstChild.textContent === '\n' ||
@@ -2552,13 +2570,34 @@ function updateTextNode(value) {
2552
2570
  }
2553
2571
  return resultElm.innerHTML;
2554
2572
  }
2573
+ /**
2574
+ * @param {IRichTextEditor} rteObj - specifies the rte object
2575
+ * @returns {string} - returns the value based on enter configuration.
2576
+ * @hidden
2577
+ */
2578
+ function getDefaultValue(rteObj) {
2579
+ var currentVal;
2580
+ if (rteObj.enterKey === 'DIV') {
2581
+ currentVal = rteObj.enableHtmlEncode ? '&lt;div&gt;&lt;br/&gt;&lt;/div&gt;' : '<div><br/></div>';
2582
+ }
2583
+ else if (rteObj.enterKey === 'BR') {
2584
+ currentVal = rteObj.enableHtmlEncode ? '&lt;br/&gt;' : '<br/>';
2585
+ }
2586
+ else {
2587
+ currentVal = rteObj.enableHtmlEncode ? '&lt;p&gt;&lt;br/&gt;&lt;/p&gt;' : '<p><br/></p>';
2588
+ }
2589
+ return currentVal;
2590
+ }
2555
2591
  /**
2556
2592
  * @param {string} value - specifies the value
2557
2593
  * @returns {boolean} - returns the boolean value
2558
2594
  * @hidden
2559
2595
  */
2560
2596
  function isEditableValueEmpty(value) {
2561
- return (value === '<p><br></p>' || value === '&lt;p&gt;&lt;br&gt;&lt;/p&gt;' || value === '') ? true : false;
2597
+ return (value === '<p><br></p>' || value === '&lt;p&gt;&lt;br&gt;&lt;/p&gt;'
2598
+ || value === '<div><br></div>' || value === '&lt;div&gt;&lt;br&gt;&lt;/div&gt;'
2599
+ || value === '<br>' || value === '&lt;br&gt;'
2600
+ || value === '') ? true : false;
2562
2601
  }
2563
2602
  /**
2564
2603
  * @param {string} value - specifies the string value
@@ -2685,7 +2724,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
2685
2724
  if (!this.parent.enabled) {
2686
2725
  return;
2687
2726
  }
2688
- if (!this.parent.readonly) {
2727
+ if (!this.parent.readonly || isNullOrUndefined(args.item)) {
2689
2728
  this.parent.notify(toolbarClick, args);
2690
2729
  }
2691
2730
  this.parent.trigger('toolbarClick', args);
@@ -5292,8 +5331,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
5292
5331
  */
5293
5332
  BaseQuickToolbar.prototype.showPopup = function (x, y, target) {
5294
5333
  var _this = this;
5295
- var eventArgs = isBlazor() ? { cancel: false, targetElement: target } :
5296
- { popup: this.popupObj, cancel: false, targetElement: target };
5334
+ var eventArgs = { popup: this.popupObj, cancel: false, targetElement: target };
5297
5335
  this.parent.trigger(beforeQuickToolbarOpen, eventArgs, function (beforeQuickToolbarArgs) {
5298
5336
  if (!beforeQuickToolbarArgs.cancel) {
5299
5337
  var editPanelTop = void 0;
@@ -5420,7 +5458,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
5420
5458
  this.colorPickerObj.destroyColorPicker();
5421
5459
  removeClass([this.element], [CLS_POP]);
5422
5460
  detach(element);
5423
- var args = isBlazor() ? { element: this.popupObj.element } : this.popupObj;
5461
+ var args = this.popupObj;
5424
5462
  this.parent.trigger(quickToolbarClose, args);
5425
5463
  }
5426
5464
  };
@@ -5530,7 +5568,7 @@ var PopupRenderer = /** @__PURE__ @class */ (function () {
5530
5568
  this.parent = parent;
5531
5569
  }
5532
5570
  PopupRenderer.prototype.quickToolbarOpen = function () {
5533
- var args = isBlazor() ? { element: this.popupObj.element } : this.popupObj;
5571
+ var args = this.popupObj;
5534
5572
  this.parent.trigger(quickToolbarOpen, args);
5535
5573
  };
5536
5574
  /**
@@ -6820,10 +6858,6 @@ var Formatter = /** @__PURE__ @class */ (function () {
6820
6858
  itemCollection: value
6821
6859
  };
6822
6860
  extend(args, args, items, true);
6823
- if (isBlazor()) {
6824
- delete args.item;
6825
- delete args.itemCollection;
6826
- }
6827
6861
  self.trigger(actionBegin, args, function (actionBeginArgs) {
6828
6862
  if (actionBeginArgs.cancel) {
6829
6863
  if (action_1 === 'paste' || action_1 === 'cut' || action_1 === 'copy') {
@@ -6835,10 +6869,16 @@ var Formatter = /** @__PURE__ @class */ (function () {
6835
6869
  var isTableModule = isNullOrUndefined(self.tableModule) ? true : self.tableModule ?
6836
6870
  self.tableModule.ensureInsideTableList : false;
6837
6871
  if ((event.which === 9 && isTableModule) || event.which !== 9) {
6872
+ if (event.which === 13 && self.editorMode === 'HTML') {
6873
+ value = {
6874
+ 'enterAction': self.enterKey
6875
+ };
6876
+ }
6838
6877
  this.editorManager.observer.notify((event.type === 'keydown' ? KEY_DOWN : KEY_UP), {
6839
6878
  event: event,
6840
6879
  callBack: this.onSuccess.bind(this, self),
6841
- value: value
6880
+ value: value,
6881
+ enterAction: self.enterKey
6842
6882
  });
6843
6883
  }
6844
6884
  }
@@ -6866,7 +6906,7 @@ var Formatter = /** @__PURE__ @class */ (function () {
6866
6906
  else {
6867
6907
  _this.editorManager.observer.notify(checkUndo, { subCommand: actionBeginArgs.item.subCommand });
6868
6908
  _this.editorManager.execCommand(actionBeginArgs.item.command, actionBeginArgs.item.subCommand, event, _this.onSuccess.bind(_this, self), actionBeginArgs.item.value, actionBeginArgs.item.subCommand === 'Pre' && args.name === 'dropDownSelect' ?
6869
- { name: args.name } : value, ('#' + self.getID() + ' iframe'));
6909
+ { name: args.name } : value, ('#' + self.getID() + ' iframe'), self.enterKey);
6870
6910
  }
6871
6911
  }
6872
6912
  });
@@ -10258,8 +10298,8 @@ var DOMNode = /** @__PURE__ @class */ (function () {
10258
10298
  this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
10259
10299
  }
10260
10300
  else if (start.tagName === 'BR') {
10261
- this.replaceWith(start, this.marker(markerClassName.startSelection, this.encode(start.textContent)));
10262
- var markerStart = range.startContainer.querySelector('.' + markerClassName.startSelection);
10301
+ this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
10302
+ var markerStart = range.startContainer.querySelector('.' + className);
10263
10303
  markerStart.appendChild(start);
10264
10304
  }
10265
10305
  else {
@@ -10501,7 +10541,7 @@ var Lists = /** @__PURE__ @class */ (function () {
10501
10541
  var olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
10502
10542
  if (!isNullOrUndefined(range.startContainer.textContent.slice(0, range.startOffset))) {
10503
10543
  for (var i = 0; i < olListStartRegex.length; i++) {
10504
- if (olListStartRegex[i].test(range.startContainer.textContent.slice(0, range.startOffset).trim())) {
10544
+ if (olListStartRegex[i].test(range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim())) {
10505
10545
  return true;
10506
10546
  }
10507
10547
  }
@@ -10529,8 +10569,8 @@ var Lists = /** @__PURE__ @class */ (function () {
10529
10569
  this.applyListsHandler({ subCommand: 'OL', callBack: e.callBack });
10530
10570
  e.event.preventDefault();
10531
10571
  }
10532
- else if (range.startContainer.textContent.slice(0, range.startOffset).trim() === '*' ||
10533
- range.startContainer.textContent.slice(0, range.startOffset).trim() === '-') {
10572
+ else if (range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim() === '*' ||
10573
+ range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim() === '-') {
10534
10574
  range.startContainer.textContent = range.startContainer.textContent.slice(range.startOffset, range.startContainer.textContent.length);
10535
10575
  this.applyListsHandler({ subCommand: 'UL', callBack: e.callBack });
10536
10576
  e.event.preventDefault();
@@ -10551,15 +10591,24 @@ var Lists = /** @__PURE__ @class */ (function () {
10551
10591
  var startNodeParent = startNode.parentElement;
10552
10592
  if (isNullOrUndefined(startNodeParent.parentElement.closest('UL')) && isNullOrUndefined(startNodeParent.parentElement.closest('OL'))) {
10553
10593
  if (!isNullOrUndefined(startNode.nextElementSibling)) {
10554
- //startNode.classList.add('innerNode');
10555
10594
  var nearBlockNode = this.parent.domNode.blockParentNode(startNode);
10556
10595
  this.parent.nodeCutter.GetSpliceNode(range, nearBlockNode);
10557
10596
  }
10558
- var paraTag = createElement('p');
10559
- paraTag.innerHTML = '<br>';
10560
- this.parent.domNode.insertAfter(paraTag, startNodeParent);
10597
+ var insertTag = void 0;
10598
+ if (e.enterAction === 'DIV') {
10599
+ insertTag = createElement('div');
10600
+ insertTag.innerHTML = '<br>';
10601
+ }
10602
+ else if (e.enterAction === 'P') {
10603
+ insertTag = createElement('p');
10604
+ insertTag.innerHTML = '<br>';
10605
+ }
10606
+ else {
10607
+ insertTag = createElement('br');
10608
+ }
10609
+ this.parent.domNode.insertAfter(insertTag, startNodeParent);
10561
10610
  e.event.preventDefault();
10562
- this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, paraTag, 0);
10611
+ this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, insertTag, 0);
10563
10612
  if (startNodeParent.textContent === '') {
10564
10613
  detach(startNodeParent);
10565
10614
  }
@@ -10856,6 +10905,66 @@ var Lists = /** @__PURE__ @class */ (function () {
10856
10905
  this.currentAction = e.subCommand = this.currentAction === 'NumberFormatList' ? 'OL' : this.currentAction === 'BulletFormatList' ? 'UL' : this.currentAction;
10857
10906
  this.domNode.setMarker(this.saveSelection);
10858
10907
  var listsNodes = this.domNode.blockNodes();
10908
+ if (e.enterAction === 'BR') {
10909
+ this.setSelectionBRConfig();
10910
+ var allSelectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument);
10911
+ var selectedNodes = this.parent.nodeSelection.getSelectionNodes(allSelectedNode);
10912
+ var currentFormatNodes = [];
10913
+ if (selectedNodes.length === 0) {
10914
+ selectedNodes.push(listsNodes[0]);
10915
+ }
10916
+ for (var i = 0; i < selectedNodes.length; i++) {
10917
+ var currentNode = selectedNodes[i];
10918
+ var previousCurrentNode = void 0;
10919
+ while (!this.parent.domNode.isBlockNode(currentNode) && currentNode !== this.parent.editableElement) {
10920
+ previousCurrentNode = currentNode;
10921
+ currentNode = currentNode.parentElement;
10922
+ }
10923
+ if (this.parent.domNode.isBlockNode(currentNode) && currentNode === this.parent.editableElement) {
10924
+ currentFormatNodes.push(previousCurrentNode);
10925
+ }
10926
+ }
10927
+ for (var i = 0; i < currentFormatNodes.length; i++) {
10928
+ if (!this.parent.domNode.isBlockNode(currentFormatNodes[i])) {
10929
+ var currentNode = currentFormatNodes[i];
10930
+ var previousNode = currentNode;
10931
+ while (currentNode === this.parent.editableElement) {
10932
+ previousNode = currentNode;
10933
+ currentNode = currentNode.parentElement;
10934
+ }
10935
+ var tempElem = void 0;
10936
+ if (this.parent.domNode.isBlockNode(previousNode.parentElement) &&
10937
+ previousNode.parentElement === this.parent.editableElement) {
10938
+ tempElem = createElement('p');
10939
+ previousNode.parentElement.insertBefore(tempElem, previousNode);
10940
+ tempElem.appendChild(previousNode);
10941
+ }
10942
+ else {
10943
+ tempElem = previousNode;
10944
+ }
10945
+ var preNode = tempElem.previousSibling;
10946
+ while (!isNullOrUndefined(preNode) && preNode.nodeName !== 'BR' &&
10947
+ !this.parent.domNode.isBlockNode(preNode)) {
10948
+ tempElem.firstChild.parentElement.insertBefore(preNode, tempElem.firstChild);
10949
+ preNode = tempElem.previousSibling;
10950
+ }
10951
+ if (!isNullOrUndefined(preNode) && preNode.nodeName === 'BR') {
10952
+ detach(preNode);
10953
+ }
10954
+ var postNode = tempElem.nextSibling;
10955
+ while (!isNullOrUndefined(postNode) && postNode.nodeName !== 'BR' &&
10956
+ !this.parent.domNode.isBlockNode(postNode)) {
10957
+ tempElem.appendChild(postNode);
10958
+ postNode = tempElem.nextSibling;
10959
+ }
10960
+ if (!isNullOrUndefined(postNode) && postNode.nodeName === 'BR') {
10961
+ detach(postNode);
10962
+ }
10963
+ }
10964
+ }
10965
+ this.setSelectionBRConfig();
10966
+ listsNodes = this.parent.domNode.blockNodes();
10967
+ }
10859
10968
  for (var i = 0; i < listsNodes.length; i++) {
10860
10969
  if (listsNodes[i].tagName === 'TABLE' && !range.collapsed) {
10861
10970
  listsNodes.splice(i, 1);
@@ -10876,6 +10985,16 @@ var Lists = /** @__PURE__ @class */ (function () {
10876
10985
  });
10877
10986
  }
10878
10987
  };
10988
+ Lists.prototype.setSelectionBRConfig = function () {
10989
+ var startElem = this.parent.editableElement.querySelector('.' + markerClassName.startSelection);
10990
+ var endElem = this.parent.editableElement.querySelector('.' + markerClassName.endSelection);
10991
+ if (isNullOrUndefined(endElem)) {
10992
+ this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, startElem, 0);
10993
+ }
10994
+ else {
10995
+ this.parent.nodeSelection.setSelectionText(this.parent.currentDocument, startElem, endElem, 0, 0);
10996
+ }
10997
+ };
10879
10998
  Lists.prototype.applyLists = function (elements, type, selector, item) {
10880
10999
  if (this.isRevert(elements, type) && isNullOrUndefined(item)) {
10881
11000
  this.revertList(elements);
@@ -11220,6 +11339,7 @@ var InsertMethods = /** @__PURE__ @class */ (function () {
11220
11339
  */
11221
11340
  var NodeCutter = /** @__PURE__ @class */ (function () {
11222
11341
  function NodeCutter() {
11342
+ this.enterAction = 'P';
11223
11343
  this.position = -1;
11224
11344
  this.nodeSelection = new NodeSelection();
11225
11345
  }
@@ -11453,7 +11573,7 @@ var Formats = /** @__PURE__ @class */ (function () {
11453
11573
  if (e.event.which === 13 && range.startContainer === endCon && endCon.nodeType !== 3) {
11454
11574
  var pTag = createElement('p');
11455
11575
  pTag.innerHTML = '<br>';
11456
- if (lastChild && lastChild.nodeName === 'BR' && (lastChild.previousSibling && lastChild.previousSibling.nodeName === 'TABLE')) {
11576
+ if (!isNullOrUndefined(lastChild) && lastChild && lastChild.nodeName === 'BR' && (lastChild.previousSibling && lastChild.previousSibling.nodeName === 'TABLE')) {
11457
11577
  endCon.replaceChild(pTag, lastChild);
11458
11578
  this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, pTag, 0);
11459
11579
  }
@@ -11496,7 +11616,7 @@ var Formats = /** @__PURE__ @class */ (function () {
11496
11616
  var startParent = range.startContainer;
11497
11617
  if (!isNullOrUndefined(lastEmpty) && !isNullOrUndefined(lastBeforeBr) && isNullOrUndefined(lastEmpty.nextSibling) &&
11498
11618
  lastEmpty.nodeName === 'BR' && lastBeforeBr.nodeName === 'BR') {
11499
- this.paraFocus(range.startContainer);
11619
+ this.paraFocus(range.startContainer, e.enterAction);
11500
11620
  }
11501
11621
  else if ((startParent.textContent.charCodeAt(0) === 8203 &&
11502
11622
  startParent.textContent.length === 1) || startParent.textContent.length === 0) {
@@ -11539,11 +11659,21 @@ var Formats = /** @__PURE__ @class */ (function () {
11539
11659
  range.deleteContents();
11540
11660
  }
11541
11661
  };
11542
- Formats.prototype.paraFocus = function (referNode) {
11543
- var pTag = createElement('p');
11544
- pTag.innerHTML = '<br>';
11545
- this.parent.domNode.insertAfter(pTag, referNode);
11546
- this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, pTag, 0);
11662
+ Formats.prototype.paraFocus = function (referNode, enterAction) {
11663
+ var insertTag;
11664
+ if (enterAction === 'DIV') {
11665
+ insertTag = createElement('div');
11666
+ insertTag.innerHTML = '<br>';
11667
+ }
11668
+ else if (enterAction === 'BR') {
11669
+ insertTag = createElement('br');
11670
+ }
11671
+ else {
11672
+ insertTag = createElement('p');
11673
+ insertTag.innerHTML = '<br>';
11674
+ }
11675
+ this.parent.domNode.insertAfter(insertTag, referNode);
11676
+ this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, insertTag, 0);
11547
11677
  detach(referNode.lastChild);
11548
11678
  };
11549
11679
  Formats.prototype.isNotEndCursor = function (preElem, range) {
@@ -11625,6 +11755,66 @@ var Formats = /** @__PURE__ @class */ (function () {
11625
11755
  var save = this.parent.nodeSelection.save(range, this.parent.currentDocument);
11626
11756
  this.parent.domNode.setMarker(save);
11627
11757
  var formatsNodes = this.parent.domNode.blockNodes();
11758
+ if (e.enterAction === 'BR') {
11759
+ this.setSelectionBRConfig();
11760
+ var allSelectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument);
11761
+ var selectedNodes = this.parent.nodeSelection.getSelectionNodes(allSelectedNode);
11762
+ var currentFormatNodes = [];
11763
+ if (selectedNodes.length === 0) {
11764
+ selectedNodes.push(formatsNodes[0]);
11765
+ }
11766
+ for (var i = 0; i < selectedNodes.length; i++) {
11767
+ var currentNode = selectedNodes[i];
11768
+ var previousCurrentNode = void 0;
11769
+ while (!this.parent.domNode.isBlockNode(currentNode) && currentNode !== this.parent.editableElement) {
11770
+ previousCurrentNode = currentNode;
11771
+ currentNode = currentNode.parentElement;
11772
+ }
11773
+ if (this.parent.domNode.isBlockNode(currentNode) && currentNode === this.parent.editableElement) {
11774
+ currentFormatNodes.push(previousCurrentNode);
11775
+ }
11776
+ }
11777
+ for (var i = 0; i < currentFormatNodes.length; i++) {
11778
+ if (!this.parent.domNode.isBlockNode(currentFormatNodes[i])) {
11779
+ var currentNode = currentFormatNodes[i];
11780
+ var previousNode = currentNode;
11781
+ while (currentNode === this.parent.editableElement) {
11782
+ previousNode = currentNode;
11783
+ currentNode = currentNode.parentElement;
11784
+ }
11785
+ var tempElem = void 0;
11786
+ if (this.parent.domNode.isBlockNode(previousNode.parentElement) &&
11787
+ previousNode.parentElement === this.parent.editableElement) {
11788
+ tempElem = createElement('div');
11789
+ previousNode.parentElement.insertBefore(tempElem, previousNode);
11790
+ tempElem.appendChild(previousNode);
11791
+ }
11792
+ else {
11793
+ tempElem = previousNode;
11794
+ }
11795
+ var preNode = tempElem.previousSibling;
11796
+ while (!isNullOrUndefined(preNode) && preNode.nodeName !== 'BR' &&
11797
+ !this.parent.domNode.isBlockNode(preNode)) {
11798
+ tempElem.firstChild.parentElement.insertBefore(preNode, tempElem.firstChild);
11799
+ preNode = tempElem.previousSibling;
11800
+ }
11801
+ if (!isNullOrUndefined(preNode) && preNode.nodeName === 'BR') {
11802
+ detach(preNode);
11803
+ }
11804
+ var postNode = tempElem.nextSibling;
11805
+ while (!isNullOrUndefined(postNode) && postNode.nodeName !== 'BR' &&
11806
+ !this.parent.domNode.isBlockNode(postNode)) {
11807
+ tempElem.appendChild(postNode);
11808
+ postNode = tempElem.nextSibling;
11809
+ }
11810
+ if (!isNullOrUndefined(postNode) && postNode.nodeName === 'BR') {
11811
+ detach(postNode);
11812
+ }
11813
+ }
11814
+ }
11815
+ this.setSelectionBRConfig();
11816
+ formatsNodes = this.parent.domNode.blockNodes();
11817
+ }
11628
11818
  for (var i = 0; i < formatsNodes.length; i++) {
11629
11819
  var parentNode = void 0;
11630
11820
  var replaceHTML = void 0;
@@ -11683,6 +11873,16 @@ var Formats = /** @__PURE__ @class */ (function () {
11683
11873
  });
11684
11874
  }
11685
11875
  };
11876
+ Formats.prototype.setSelectionBRConfig = function () {
11877
+ var startElem = this.parent.editableElement.querySelector('.' + markerClassName.startSelection);
11878
+ var endElem = this.parent.editableElement.querySelector('.' + markerClassName.endSelection);
11879
+ if (isNullOrUndefined(endElem)) {
11880
+ this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, startElem, 0);
11881
+ }
11882
+ else {
11883
+ this.parent.nodeSelection.setSelectionText(this.parent.currentDocument, startElem, endElem, 0, 0);
11884
+ }
11885
+ };
11686
11886
  Formats.prototype.preFormatMerge = function () {
11687
11887
  var preNodes = this.parent.editableElement.querySelectorAll('PRE');
11688
11888
  if (!isNullOrUndefined(preNodes)) {
@@ -11816,7 +12016,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
11816
12016
  }
11817
12017
  else {
11818
12018
  range.deleteContents();
11819
- if (isCursor && range.startContainer.textContent === '') {
12019
+ if (isCursor && range.startContainer.textContent === '' && range.startContainer.nodeName !== 'BR') {
11820
12020
  range.startContainer.innerHTML = '';
11821
12021
  }
11822
12022
  if (Browser.isIE) {
@@ -11824,8 +12024,23 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
11824
12024
  frag.appendChild(node);
11825
12025
  range.insertNode(frag);
11826
12026
  }
12027
+ else if (range.startContainer.nodeType === 1 && range.startContainer.nodeName.toLowerCase() === 'hr'
12028
+ && range.endContainer.nodeName.toLowerCase() === 'hr') {
12029
+ var paraElem = range.startContainer.nextElementSibling;
12030
+ if (paraElem) {
12031
+ if (paraElem.querySelector('br')) {
12032
+ detach(paraElem.querySelector('br'));
12033
+ }
12034
+ paraElem.appendChild(node);
12035
+ }
12036
+ }
11827
12037
  else {
11828
- range.insertNode(node);
12038
+ if (range.startContainer.nodeName === 'BR') {
12039
+ range.startContainer.parentElement.insertBefore(node, range.startContainer);
12040
+ }
12041
+ else {
12042
+ range.insertNode(node);
12043
+ }
11829
12044
  }
11830
12045
  if (node.nodeType !== 3 && node.childNodes.length > 0) {
11831
12046
  nodeSelection.setSelectionText(docElement, node, node, 1, 1);
@@ -12037,6 +12252,9 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
12037
12252
  range.setStart(editNode.firstElementChild, editNode.firstElementChild.textContent.length);
12038
12253
  range.setEnd(editNode.firstElementChild, editNode.firstElementChild.textContent.length);
12039
12254
  }
12255
+ if (blockNode.nodeName === 'BODY' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
12256
+ blockNode = range.startContainer;
12257
+ }
12040
12258
  if (blockNode.nodeName === 'TD' || blockNode.nodeName === 'TH') {
12041
12259
  var tempSpan = createElement('span', { className: 'tempSpan' });
12042
12260
  range.insertNode(tempSpan);
@@ -12750,14 +12968,29 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
12750
12968
  var selectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)[0];
12751
12969
  var imgElm_1 = (e.value === 'Replace' || isReplaced) ? e.item.selectParent[0] :
12752
12970
  (Browser.isIE ? selectedNode.previousSibling : selectedNode.previousElementSibling);
12971
+ var preventLoadCall_1 = false;
12753
12972
  imgElm_1.addEventListener('load', function () {
12754
- e.callBack({
12755
- requestType: 'Images',
12756
- editorMode: 'HTML',
12757
- event: e.event,
12758
- range: _this.parent.nodeSelection.getRange(_this.parent.currentDocument),
12759
- elements: [imgElm_1]
12760
- });
12973
+ if (e.value === 'Replace' || isReplaced) {
12974
+ if (!preventLoadCall_1) {
12975
+ e.callBack({
12976
+ requestType: 'Images',
12977
+ editorMode: 'HTML',
12978
+ event: e.event,
12979
+ range: _this.parent.nodeSelection.getRange(_this.parent.currentDocument),
12980
+ elements: [imgElm_1]
12981
+ });
12982
+ preventLoadCall_1 = true;
12983
+ }
12984
+ }
12985
+ else {
12986
+ e.callBack({
12987
+ requestType: 'Images',
12988
+ editorMode: 'HTML',
12989
+ event: e.event,
12990
+ range: _this.parent.nodeSelection.getRange(_this.parent.currentDocument),
12991
+ elements: [imgElm_1]
12992
+ });
12993
+ }
12761
12994
  });
12762
12995
  }
12763
12996
  };
@@ -12879,8 +13112,10 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
12879
13112
  var selectNode = e.item.selectNode[0];
12880
13113
  selectNode.style.height = '';
12881
13114
  selectNode.style.width = '';
12882
- selectNode.width = e.item.width;
12883
- selectNode.height = e.item.height;
13115
+ e.item.width !== 'auto' ? selectNode.style.width = formatUnit(e.item.width) :
13116
+ selectNode.removeAttribute('width');
13117
+ e.item.height !== 'auto' ? selectNode.style.height = formatUnit(e.item.height) :
13118
+ selectNode.removeAttribute('height');
12884
13119
  this.callBack(e);
12885
13120
  };
12886
13121
  ImageCommand.prototype.imageCaption = function (e) {
@@ -12889,59 +13124,65 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
12889
13124
  };
12890
13125
  ImageCommand.prototype.imageJustifyLeft = function (e) {
12891
13126
  var selectNode = e.item.selectNode[0];
12892
- selectNode.removeAttribute('class');
12893
- addClass([selectNode], 'e-rte-image');
12894
- if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
12895
- removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
12896
- addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
12897
- }
12898
- if (selectNode.parentElement.nodeName === 'A') {
12899
- removeClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
12900
- addClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
12901
- addClass([selectNode], CLASS_IMAGE_LEFT);
12902
- }
12903
- else {
12904
- addClass([selectNode], CLASS_IMAGE_LEFT);
13127
+ if (!isNullOrUndefined(selectNode)) {
13128
+ selectNode.removeAttribute('class');
13129
+ addClass([selectNode], 'e-rte-image');
13130
+ if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
13131
+ removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
13132
+ addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
13133
+ }
13134
+ if (selectNode.parentElement.nodeName === 'A') {
13135
+ removeClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
13136
+ addClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
13137
+ addClass([selectNode], CLASS_IMAGE_LEFT);
13138
+ }
13139
+ else {
13140
+ addClass([selectNode], CLASS_IMAGE_LEFT);
13141
+ }
13142
+ this.callBack(e);
12905
13143
  }
12906
- this.callBack(e);
12907
13144
  };
12908
13145
  ImageCommand.prototype.imageJustifyCenter = function (e) {
12909
13146
  var selectNode = e.item.selectNode[0];
12910
- selectNode.removeAttribute('class');
12911
- addClass([selectNode], 'e-rte-image');
12912
- if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
12913
- removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
12914
- removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
12915
- addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_CENTER);
12916
- }
12917
- if (selectNode.parentElement.nodeName === 'A') {
12918
- removeClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
12919
- removeClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
12920
- addClass([selectNode.parentElement], CLASS_IMAGE_CENTER);
12921
- addClass([selectNode], CLASS_IMAGE_CENTER);
12922
- }
12923
- else {
12924
- addClass([selectNode], CLASS_IMAGE_CENTER);
13147
+ if (!isNullOrUndefined(selectNode)) {
13148
+ selectNode.removeAttribute('class');
13149
+ addClass([selectNode], 'e-rte-image');
13150
+ if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
13151
+ removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
13152
+ removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
13153
+ addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_CENTER);
13154
+ }
13155
+ if (selectNode.parentElement.nodeName === 'A') {
13156
+ removeClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
13157
+ removeClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
13158
+ addClass([selectNode.parentElement], CLASS_IMAGE_CENTER);
13159
+ addClass([selectNode], CLASS_IMAGE_CENTER);
13160
+ }
13161
+ else {
13162
+ addClass([selectNode], CLASS_IMAGE_CENTER);
13163
+ }
13164
+ this.callBack(e);
12925
13165
  }
12926
- this.callBack(e);
12927
13166
  };
12928
13167
  ImageCommand.prototype.imageJustifyRight = function (e) {
12929
13168
  var selectNode = e.item.selectNode[0];
12930
- selectNode.removeAttribute('class');
12931
- addClass([selectNode], 'e-rte-image');
12932
- if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
12933
- removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
12934
- addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
12935
- }
12936
- if (selectNode.parentElement.nodeName === 'A') {
12937
- removeClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
12938
- addClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
12939
- addClass([selectNode], CLASS_IMAGE_RIGHT);
12940
- }
12941
- else {
12942
- addClass([selectNode], CLASS_IMAGE_RIGHT);
13169
+ if (!isNullOrUndefined(selectNode)) {
13170
+ selectNode.removeAttribute('class');
13171
+ addClass([selectNode], 'e-rte-image');
13172
+ if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
13173
+ removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
13174
+ addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
13175
+ }
13176
+ if (selectNode.parentElement.nodeName === 'A') {
13177
+ removeClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
13178
+ addClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
13179
+ addClass([selectNode], CLASS_IMAGE_RIGHT);
13180
+ }
13181
+ else {
13182
+ addClass([selectNode], CLASS_IMAGE_RIGHT);
13183
+ }
13184
+ this.callBack(e);
12943
13185
  }
12944
- this.callBack(e);
12945
13186
  };
12946
13187
  ImageCommand.prototype.imageInline = function (e) {
12947
13188
  var selectNode = e.item.selectNode[0];
@@ -13031,7 +13272,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
13031
13272
  }
13032
13273
  var tdWid = parseInt(e.item.width.width, 10) > 100 ?
13033
13274
  100 / e.item.columns : parseInt(e.item.width.width, 10) / e.item.columns;
13034
- for (var i = 0; i < e.item.row; i++) {
13275
+ for (var i = 0; i < e.item.rows; i++) {
13035
13276
  var row = createElement('tr');
13036
13277
  for (var j = 0; j < e.item.columns; j++) {
13037
13278
  var cell = createElement('td');
@@ -13047,9 +13288,19 @@ var TableCommand = /** @__PURE__ @class */ (function () {
13047
13288
  this.removeEmptyNode();
13048
13289
  e.item.selection.setSelectionText(this.parent.currentDocument, table.querySelector('td'), table.querySelector('td'), 0, 0);
13049
13290
  if (table.nextElementSibling === null) {
13050
- var emptyPara = createElement('p');
13051
- emptyPara.appendChild(createElement('br'));
13052
- this.insertAfter(emptyPara, table);
13291
+ var insertElem = void 0;
13292
+ if (e.enterAction === 'DIV') {
13293
+ insertElem = createElement('div');
13294
+ insertElem.appendChild(createElement('br'));
13295
+ }
13296
+ else if (e.enterAction === 'BR') {
13297
+ insertElem = createElement('br');
13298
+ }
13299
+ else {
13300
+ insertElem = createElement('p');
13301
+ insertElem.appendChild(createElement('br'));
13302
+ }
13303
+ this.insertAfter(insertElem, table);
13053
13304
  }
13054
13305
  table.querySelector('td').classList.add('e-cell-select');
13055
13306
  if (e.callBack) {
@@ -13188,16 +13439,16 @@ var TableCommand = /** @__PURE__ @class */ (function () {
13188
13439
  var curRow = closest(selectedCell, 'tr');
13189
13440
  var curCell;
13190
13441
  var allRows = closest((curRow), 'table').rows;
13191
- var colIndex = Array.prototype.slice.call(curRow.querySelectorAll('th,td')).indexOf(selectedCell);
13192
- var previousWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll('td,th').length);
13193
- var currentWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll('td,th').length + 1);
13442
+ var colIndex = Array.prototype.slice.call(curRow.querySelectorAll(':scope > td, :scope > th')).indexOf(selectedCell);
13443
+ var previousWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll(':scope > td, :scope > th').length);
13444
+ var currentWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll(':scope > td, :scope > th').length + 1);
13194
13445
  var currentTabElm = closest(curRow, 'table');
13195
13446
  var thTdElm = closest(curRow, 'table').querySelectorAll('th,td');
13196
13447
  for (var i = 0; i < thTdElm.length; i++) {
13197
13448
  thTdElm[i].dataset.oldWidth = (thTdElm[i].offsetWidth / currentTabElm.offsetWidth * 100) + "%";
13198
13449
  }
13199
13450
  for (var i = 0; i < allRows.length; i++) {
13200
- curCell = allRows[i].querySelectorAll('th,td')[colIndex];
13451
+ curCell = allRows[i].querySelectorAll(':scope > td, :scope > th')[colIndex];
13201
13452
  var colTemplate = curCell.cloneNode(true);
13202
13453
  colTemplate.innerHTML = '';
13203
13454
  colTemplate.appendChild(createElement('br'));
@@ -13730,7 +13981,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
13730
13981
  // eslint-disable-next-line
13731
13982
  var _this = this;
13732
13983
  var colspan = 0;
13733
- var allRows = _this.curTable.querySelectorAll('tr');
13984
+ var allRows = _this.curTable.rows;
13734
13985
  for (var i = 0; i <= allRows.length - 1; i++) {
13735
13986
  var ele = allRows[i];
13736
13987
  var index = 0;
@@ -14131,7 +14382,8 @@ var IsFormatted = /** @__PURE__ @class */ (function () {
14131
14382
  'sup',
14132
14383
  'tt',
14133
14384
  'u',
14134
- 'var'
14385
+ 'var',
14386
+ 'del'
14135
14387
  ];
14136
14388
  return IsFormatted;
14137
14389
  }());
@@ -14154,7 +14406,8 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
14154
14406
  * @hidden
14155
14407
  * @deprecated
14156
14408
  */
14157
- SelectionCommands.applyFormat = function (docElement, format, endNode, value, selector) {
14409
+ SelectionCommands.applyFormat = function (docElement, format, endNode, enterAction, value, selector) {
14410
+ this.enterAction = enterAction;
14158
14411
  var validFormats = ['bold', 'italic', 'underline', 'strikethrough', 'superscript',
14159
14412
  'subscript', 'uppercase', 'lowercase', 'fontcolor', 'fontname', 'fontsize', 'backgroundcolor'];
14160
14413
  if (validFormats.indexOf(format) > -1) {
@@ -14230,7 +14483,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
14230
14483
  save.restore();
14231
14484
  }
14232
14485
  if (isSubSup) {
14233
- this.applyFormat(docElement, format, endNode);
14486
+ this.applyFormat(docElement, format, endNode, enterAction);
14234
14487
  }
14235
14488
  }
14236
14489
  };
@@ -14250,6 +14503,10 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
14250
14503
  cursorNodes[0].firstElementChild.tagName.toLowerCase() === 'br')) {
14251
14504
  cursorNodes[0].innerHTML = '';
14252
14505
  }
14506
+ if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' ||
14507
+ cursorNodes[0].nextSibling.nodeName === 'BR')) {
14508
+ detach(cursorNodes[0].nodeName === '#text' ? cursorNodes[0].nextSibling : cursorNodes[0]);
14509
+ }
14253
14510
  cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
14254
14511
  }
14255
14512
  return cursorNode;
@@ -14343,6 +14600,13 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
14343
14600
  nodeCutter.SplitNode(range, textNode.parentElement, false);
14344
14601
  }
14345
14602
  }
14603
+ if (nodeTraverse.parentElement.tagName.toLocaleLowerCase() === 'span') {
14604
+ if (formatNode.style.textDecoration === 'underline' &&
14605
+ nodeTraverse.parentElement.style.textDecoration !== 'underline') {
14606
+ nodeTraverse = nodeTraverse.parentElement;
14607
+ continue;
14608
+ }
14609
+ }
14346
14610
  InsertMethods.unwrap(nodeTraverse.parentElement);
14347
14611
  nodeTraverse = !isNullOrUndefined(nodeTraverse.parentElement) && !domNode.isBlockNode(nodeTraverse.parentElement) ? textNode :
14348
14612
  nodeTraverse.parentElement;
@@ -14354,12 +14618,14 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
14354
14618
  }
14355
14619
  if (child.length > 0 && isFontStyle) {
14356
14620
  for (var num = 0; num < child.length; num++) {
14357
- child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
14358
- if (num === 0) {
14359
- range.setStartBefore(child[num]);
14360
- }
14361
- else if (num === child.length - 1) {
14362
- range.setEndAfter(child[num]);
14621
+ if (child[num].nodeType !== 3 || (child[num].textContent && child[num].textContent.trim().length > 0)) {
14622
+ child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
14623
+ if (num === 0) {
14624
+ range.setStartBefore(child[num]);
14625
+ }
14626
+ else if (num === child.length - 1) {
14627
+ range.setEndAfter(child[num]);
14628
+ }
14363
14629
  }
14364
14630
  }
14365
14631
  var currentNodeElem = nodes[index].parentElement;
@@ -14456,10 +14722,12 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
14456
14722
  return nodes[index];
14457
14723
  };
14458
14724
  SelectionCommands.applyStyles = function (nodes, index, element) {
14459
- nodes[index] = (index === (nodes.length - 1)) || nodes[index].nodeName === 'BR' ?
14460
- InsertMethods.Wrap(nodes[index], element)
14461
- : InsertMethods.WrapBefore(nodes[index], element, true);
14462
- nodes[index] = this.getChildNode(nodes[index], element);
14725
+ if (!(nodes[index].nodeName === 'BR' && this.enterAction === 'BR')) {
14726
+ nodes[index] = (index === (nodes.length - 1)) || nodes[index].nodeName === 'BR' ?
14727
+ InsertMethods.Wrap(nodes[index], element)
14728
+ : InsertMethods.WrapBefore(nodes[index], element, true);
14729
+ nodes[index] = this.getChildNode(nodes[index], element);
14730
+ }
14463
14731
  return nodes[index];
14464
14732
  };
14465
14733
  SelectionCommands.getInsertNode = function (docElement, range, format, value) {
@@ -14554,6 +14822,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
14554
14822
  ele.setAttribute('style', styles);
14555
14823
  }
14556
14824
  };
14825
+ SelectionCommands.enterAction = 'P';
14557
14826
  return SelectionCommands;
14558
14827
  }());
14559
14828
 
@@ -14584,12 +14853,12 @@ var SelectionBasedExec = /** @__PURE__ @class */ (function () {
14584
14853
  'subscript', 'uppercase', 'lowercase'];
14585
14854
  if (e.event.ctrlKey && validFormats.indexOf(e.event.action) > -1) {
14586
14855
  e.event.preventDefault();
14587
- SelectionCommands.applyFormat(this.parent.currentDocument, e.event.action, this.parent.editableElement);
14856
+ SelectionCommands.applyFormat(this.parent.currentDocument, e.event.action, this.parent.editableElement, e.enterAction);
14588
14857
  this.callBack(e, e.event.action);
14589
14858
  }
14590
14859
  };
14591
14860
  SelectionBasedExec.prototype.applySelection = function (e) {
14592
- SelectionCommands.applyFormat(this.parent.currentDocument, e.subCommand.toLocaleLowerCase(), this.parent.editableElement, e.value, e.selector);
14861
+ SelectionCommands.applyFormat(this.parent.currentDocument, e.subCommand.toLocaleLowerCase(), this.parent.editableElement, e.enterAction, e.value, e.selector);
14593
14862
  this.callBack(e, e.subCommand);
14594
14863
  };
14595
14864
  SelectionBasedExec.prototype.callBack = function (event, action) {
@@ -14672,7 +14941,9 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
14672
14941
  * @hidden
14673
14942
  * @deprecated
14674
14943
  */
14675
- ClearFormat.clear = function (docElement, endNode, selector) {
14944
+ ClearFormat.clear = function (docElement, endNode, enterAction, selector) {
14945
+ this.domNode = new DOMNode(endNode, docElement);
14946
+ this.defaultTag = enterAction === 'P' ? this.defaultTag : 'div';
14676
14947
  var nodeSelection = new NodeSelection();
14677
14948
  var nodeCutter = new NodeCutter();
14678
14949
  var range = nodeSelection.getRange(docElement);
@@ -14817,12 +15088,12 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
14817
15088
  && this.IGNORE_PARENT_TAGS.indexOf(parentNodes[index1].childNodes[0].nodeName.toLocaleLowerCase()) > -1)
14818
15089
  && !(parentNodes[index1].childNodes.length === 1
14819
15090
  && parentNodes[index1].childNodes[0].nodeName.toLocaleLowerCase() === 'p')) {
14820
- InsertMethods.Wrap(parentNodes[index1], docElement.createElement('p'));
15091
+ InsertMethods.Wrap(parentNodes[index1], docElement.createElement(this.defaultTag));
14821
15092
  }
14822
15093
  var childNodes = InsertMethods.unwrap(parentNodes[index1]);
14823
15094
  if (childNodes.length === 1
14824
15095
  && childNodes[0].parentNode.nodeName.toLocaleLowerCase() === 'p') {
14825
- InsertMethods.Wrap(parentNodes[index1], docElement.createElement('p'));
15096
+ InsertMethods.Wrap(parentNodes[index1], docElement.createElement(this.defaultTag));
14826
15097
  InsertMethods.unwrap(parentNodes[index1]);
14827
15098
  }
14828
15099
  for (var index2 = 0; index2 < childNodes.length; index2++) {
@@ -14840,13 +15111,13 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
14840
15111
  }
14841
15112
  else if (this.BLOCK_TAGS.indexOf(childNodes[index2].nodeName.toLocaleLowerCase()) > -1 &&
14842
15113
  childNodes[index2].nodeName.toLocaleLowerCase() === 'p') {
14843
- InsertMethods.Wrap(childNodes[index2], docElement.createElement('p'));
15114
+ InsertMethods.Wrap(childNodes[index2], docElement.createElement(this.defaultTag));
14844
15115
  InsertMethods.unwrap(childNodes[index2]);
14845
15116
  }
14846
15117
  }
14847
15118
  }
14848
15119
  else {
14849
- InsertMethods.Wrap(parentNodes[index1], docElement.createElement('p'));
15120
+ InsertMethods.Wrap(parentNodes[index1], docElement.createElement(this.defaultTag));
14850
15121
  InsertMethods.unwrap(parentNodes[index1]);
14851
15122
  }
14852
15123
  }
@@ -14855,10 +15126,16 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
14855
15126
  // eslint-disable-next-line
14856
15127
  endNode) {
14857
15128
  for (var index = 0; index < textNodes.length; index++) {
14858
- if (textNodes[index].parentNode &&
14859
- IsFormatted.inlineTags.indexOf(textNodes[index].parentNode.nodeName.toLocaleLowerCase()) > -1) {
14860
- nodeCutter.GetSpliceNode(range, textNodes[index].parentNode);
14861
- this.removeInlineParent(textNodes[index].parentNode);
15129
+ var currentInlineNode = textNodes[index];
15130
+ var currentNode = void 0;
15131
+ while (!this.domNode.isBlockNode(currentInlineNode)) {
15132
+ currentNode = currentInlineNode;
15133
+ currentInlineNode = currentInlineNode.parentElement;
15134
+ }
15135
+ if (currentNode &&
15136
+ IsFormatted.inlineTags.indexOf(currentNode.nodeName.toLocaleLowerCase()) > -1) {
15137
+ nodeCutter.GetSpliceNode(range, currentNode);
15138
+ this.removeInlineParent(currentNode);
14862
15139
  }
14863
15140
  }
14864
15141
  };
@@ -14881,6 +15158,7 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
14881
15158
  ClearFormat.NONVALID_PARENT_TAGS = ['thead', 'tbody', 'ul', 'ol', 'table', 'tfoot', 'tr'];
14882
15159
  ClearFormat.IGNORE_PARENT_TAGS = ['ul', 'ol', 'table'];
14883
15160
  ClearFormat.NONVALID_TAGS = ['thead', 'tbody', 'figcaption', 'td', 'tr', 'th', 'tfoot', 'figcaption', 'li'];
15161
+ ClearFormat.defaultTag = 'p';
14884
15162
  return ClearFormat;
14885
15163
  }());
14886
15164
 
@@ -14910,14 +15188,14 @@ var ClearFormatExec = /** @__PURE__ @class */ (function () {
14910
15188
  ClearFormatExec.prototype.onKeyDown = function (e) {
14911
15189
  switch (e.event.action) {
14912
15190
  case 'clear-format':
14913
- this.applyClear({ subCommand: 'ClearFormat', callBack: e.callBack });
15191
+ this.applyClear({ subCommand: 'ClearFormat', callBack: e.callBack, enterAction: e.enterAction });
14914
15192
  e.event.preventDefault();
14915
15193
  break;
14916
15194
  }
14917
15195
  };
14918
15196
  ClearFormatExec.prototype.applyClear = function (e) {
14919
15197
  if (e.subCommand === 'ClearFormat') {
14920
- ClearFormat$1.clear(this.parent.currentDocument, this.parent.editableElement, e.selector);
15198
+ ClearFormat$1.clear(this.parent.currentDocument, this.parent.editableElement, e.enterAction, e.selector);
14921
15199
  if (e.callBack) {
14922
15200
  e.callBack({
14923
15201
  requestType: e.subCommand,
@@ -15898,15 +16176,15 @@ var EditorManager = /** @__PURE__ @class */ (function () {
15898
16176
  * @deprecated
15899
16177
  */
15900
16178
  /* eslint-enable */
15901
- EditorManager.prototype.execCommand = function (command, value, event, callBack, text, exeValue, selector) {
16179
+ EditorManager.prototype.execCommand = function (command, value, event, callBack, text, exeValue, selector, enterAction) {
15902
16180
  switch (command.toLocaleLowerCase()) {
15903
16181
  case 'lists':
15904
16182
  this.observer.notify(LIST_TYPE, { subCommand: value, event: event, callBack: callBack,
15905
- selector: selector, item: exeValue });
16183
+ selector: selector, item: exeValue, enterAction: enterAction });
15906
16184
  break;
15907
16185
  case 'formats':
15908
16186
  this.observer.notify(FORMAT_TYPE, { subCommand: value, event: event, callBack: callBack,
15909
- selector: selector, exeValue: exeValue
16187
+ selector: selector, exeValue: exeValue, enterAction: enterAction
15910
16188
  });
15911
16189
  break;
15912
16190
  case 'alignments':
@@ -15935,7 +16213,7 @@ var EditorManager = /** @__PURE__ @class */ (function () {
15935
16213
  case 'table':
15936
16214
  switch (value.toString().toLocaleLowerCase()) {
15937
16215
  case 'createtable':
15938
- this.observer.notify(TABLE, { item: exeValue, event: event, callBack: callBack });
16216
+ this.observer.notify(TABLE, { item: exeValue, event: event, callBack: callBack, enterAction: enterAction });
15939
16217
  break;
15940
16218
  case 'insertrowbefore':
15941
16219
  case 'insertrowafter':
@@ -15977,7 +16255,7 @@ var EditorManager = /** @__PURE__ @class */ (function () {
15977
16255
  case 'style':
15978
16256
  case 'effects':
15979
16257
  case 'casing':
15980
- this.observer.notify(SELECTION_TYPE, { subCommand: value, event: event, callBack: callBack, value: text, selector: selector });
16258
+ this.observer.notify(SELECTION_TYPE, { subCommand: value, event: event, callBack: callBack, value: text, selector: selector, enterAction: enterAction });
15981
16259
  break;
15982
16260
  case 'inserthtml':
15983
16261
  this.observer.notify(INSERTHTML_TYPE, { subCommand: value, callBack: callBack, value: text });
@@ -15986,7 +16264,7 @@ var EditorManager = /** @__PURE__ @class */ (function () {
15986
16264
  this.observer.notify(INSERT_TEXT_TYPE, { subCommand: value, callBack: callBack, value: text });
15987
16265
  break;
15988
16266
  case 'clear':
15989
- this.observer.notify(CLEAR_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector });
16267
+ this.observer.notify(CLEAR_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector, enterAction: enterAction });
15990
16268
  break;
15991
16269
  case 'actions':
15992
16270
  this.observer.notify(ACTION, { subCommand: value, event: event, callBack: callBack, selector: selector });
@@ -16080,7 +16358,21 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
16080
16358
  var nodeSelection = new NodeSelection();
16081
16359
  var nodes = documentNode ? [documentNode] : nodeSelection.getNodeCollection(nodeSelection.getRange(docElement));
16082
16360
  var nodesLength = nodes.length;
16361
+ var isNodeChanged = false;
16362
+ var range = nodeSelection.getRange(docElement);
16083
16363
  for (var index = 0; index < nodes.length; index++) {
16364
+ while (nodes[index].nodeType === 3 && range.startContainer.nodeType === 3 && nodes[index].parentNode &&
16365
+ nodes[index].parentNode.lastElementChild && nodes[index].parentNode.lastElementChild.nodeName !== "BR" &&
16366
+ this.getImmediateBlockNode(nodes[index].parentNode, targetNode).textContent.replace(/\u200B/g, '').length === 0 &&
16367
+ range.startContainer.textContent.replace(/\u200B/g, '').length === 0 &&
16368
+ nodeSelection.get(docElement).toString().replace(/\u200B/g, '').length === 0) {
16369
+ nodes[index] = nodes[index].parentNode.lastElementChild.firstChild;
16370
+ isNodeChanged = true;
16371
+ }
16372
+ if (isNodeChanged && nodes[index]) {
16373
+ nodeSelection.setCursorPoint(docElement, nodes[index], nodes[index].textContent.length);
16374
+ isNodeChanged = false;
16375
+ }
16084
16376
  if ((nodes[index].nodeName !== 'BR' && nodes[index].nodeType !== 3) ||
16085
16377
  (nodesLength > 1 && nodes[index].nodeType === 3 && nodes[index].textContent.trim() === '')) {
16086
16378
  nodes.splice(index, 1);
@@ -16147,6 +16439,12 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
16147
16439
  }
16148
16440
  return nodeCollection;
16149
16441
  };
16442
+ ToolbarStatus.getImmediateBlockNode = function (node, editNode) {
16443
+ do {
16444
+ node = node.parentNode;
16445
+ } while (node && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) < 0);
16446
+ return node;
16447
+ };
16150
16448
  ToolbarStatus.getFormatParent = function (docElement, formatCollection, node, targetNode, formatNode, fontSize, fontName) {
16151
16449
  if (targetNode.contains(node) ||
16152
16450
  (node.nodeType === 3 && targetNode.nodeType !== 3 && targetNode.contains(node.parentNode))) {
@@ -16544,10 +16842,10 @@ var IframeContentRender = /** @__PURE__ @class */ (function (_super) {
16544
16842
  rteContent + '</body></html>';
16545
16843
  var iFrameContent = IFRAMEHEADER + iFrameBodyContent;
16546
16844
  var iframe = this.parent.createElement('iframe', {
16547
- innerHTML: iFrameContent,
16548
16845
  id: this.parent.getID() + '_rte-view',
16549
16846
  className: 'e-rte-content',
16550
- styles: 'display:block;'
16847
+ styles: 'display:block;',
16848
+ attrs: { 'srcdoc': iFrameContent }
16551
16849
  });
16552
16850
  this.setPanel(iframe);
16553
16851
  rteObj.element.appendChild(iframe);
@@ -16852,33 +17150,40 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
16852
17150
  HtmlEditor.prototype.onKeyDown = function (e) {
16853
17151
  var _this = this;
16854
17152
  var currentRange;
17153
+ var args = e.args;
16855
17154
  if (Browser.info.name === 'chrome') {
16856
17155
  currentRange = this.parent.getRange();
16857
17156
  this.backSpaceCleanup(e, currentRange);
16858
17157
  this.deleteCleanup(e, currentRange);
16859
17158
  }
16860
- if (e.args.keyCode === 9 && this.parent.enableTabKey) {
16861
- var range = this.nodeSelectionObj.getRange(this.contentRenderer.getDocument());
16862
- var parentNode = this.nodeSelectionObj.getParentNodeCollection(range);
16863
- if (!((parentNode[0].nodeName === 'LI' || closest(parentNode[0], 'li') ||
16864
- closest(parentNode[0], 'table')) && range.startOffset === 0)) {
16865
- e.args.preventDefault();
16866
- if (!e.args.shiftKey) {
16867
- InsertHtml.Insert(this.contentRenderer.getDocument(), '&nbsp;&nbsp;&nbsp;&nbsp;');
16868
- this.rangeCollection.push(this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()));
16869
- }
16870
- else if (this.rangeCollection.length > 0 &&
16871
- this.rangeCollection[this.rangeCollection.length - 1].startContainer.textContent.length === 4) {
16872
- var textCont = this.rangeCollection[this.rangeCollection.length - 1].startContainer;
16873
- this.nodeSelectionObj.setSelectionText(this.contentRenderer.getDocument(), textCont, textCont, 0, textCont.textContent.length);
16874
- InsertHtml.Insert(this.contentRenderer.getDocument(), document.createTextNode(''));
16875
- this.rangeCollection.pop();
17159
+ if (args.keyCode === 9 && this.parent.enableTabKey) {
17160
+ if (!isNullOrUndefined(args.target) && isNullOrUndefined(closest(args.target, '.e-rte-toolbar'))) {
17161
+ var range = this.nodeSelectionObj.getRange(this.contentRenderer.getDocument());
17162
+ var parentNode = this.nodeSelectionObj.getParentNodeCollection(range);
17163
+ if (!((parentNode[0].nodeName === 'LI' || closest(parentNode[0], 'li') ||
17164
+ closest(parentNode[0], 'table')) && range.startOffset === 0)) {
17165
+ args.preventDefault();
17166
+ if (!args.shiftKey) {
17167
+ InsertHtml.Insert(this.contentRenderer.getDocument(), '&nbsp;&nbsp;&nbsp;&nbsp;');
17168
+ this.rangeCollection.push(this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()));
17169
+ }
17170
+ else if (this.rangeCollection.length > 0 &&
17171
+ this.rangeCollection[this.rangeCollection.length - 1].startContainer.textContent.length === 4) {
17172
+ var textCont = this.rangeCollection[this.rangeCollection.length - 1].startContainer;
17173
+ this.nodeSelectionObj.setSelectionText(this.contentRenderer.getDocument(), textCont, textCont, 0, textCont.textContent.length);
17174
+ InsertHtml.Insert(this.contentRenderer.getDocument(), document.createTextNode(''));
17175
+ this.rangeCollection.pop();
17176
+ }
16876
17177
  }
16877
17178
  }
16878
17179
  }
16879
17180
  if (e.args.action === 'space' ||
16880
- e.args.action === 'enter') {
17181
+ e.args.action === 'enter' ||
17182
+ e.args.keyCode === 13) {
16881
17183
  this.spaceLink(e.args);
17184
+ if (this.parent.editorMode === 'HTML' && !((this.parent.shiftEnterKey === 'BR' && e.args.shiftKey))) {
17185
+ this.parent.notify(enterHandler, { args: e.args });
17186
+ }
16882
17187
  }
16883
17188
  if (e.args.action === 'space') {
16884
17189
  var currentRange_1 = this.parent.getRange();
@@ -16920,10 +17225,11 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
16920
17225
  this.oldRangeElement = null;
16921
17226
  this.deleteRangeElement = null;
16922
17227
  this.deleteOldRangeElement = null;
16923
- e.args.preventDefault();
17228
+ args.preventDefault();
16924
17229
  }
16925
17230
  };
16926
17231
  HtmlEditor.prototype.isOrderedList = function (editorValue) {
17232
+ editorValue = editorValue.replace(/\u200B/g, '');
16927
17233
  var olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
16928
17234
  if (!isNullOrUndefined(editorValue)) {
16929
17235
  for (var i = 0; i < olListStartRegex.length; i++) {
@@ -16935,6 +17241,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
16935
17241
  return false;
16936
17242
  };
16937
17243
  HtmlEditor.prototype.isUnOrderedList = function (editorValue) {
17244
+ editorValue = editorValue.replace(/\u200B/g, '');
16938
17245
  var ulListStartRegex = [/^[*]$/, /^[-]$/];
16939
17246
  if (!isNullOrUndefined(editorValue)) {
16940
17247
  for (var i = 0; i < ulListStartRegex.length; i++) {
@@ -17120,7 +17427,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
17120
17427
  var contentInnerElem = '';
17121
17428
  for (var i = 0; i < enterSplitText.length; i++) {
17122
17429
  if (enterSplitText[i].trim() === '') {
17123
- contentInnerElem += '<p><br></p>';
17430
+ contentInnerElem += getDefaultValue(this.parent);
17124
17431
  }
17125
17432
  else {
17126
17433
  var contentWithSpace = '';
@@ -17549,7 +17856,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
17549
17856
  var contentInnerElem = '';
17550
17857
  for (var i = 0; i < enterSplitText.length; i++) {
17551
17858
  if (enterSplitText[i].trim() === '') {
17552
- contentInnerElem += '<p><br></p>';
17859
+ contentInnerElem += getDefaultValue(this.parent);
17553
17860
  }
17554
17861
  else {
17555
17862
  var contentWithSpace = this.makeSpace(enterSplitText[i]);
@@ -17883,7 +18190,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
17883
18190
  dialog.hide();
17884
18191
  _this.parent.height = isHeight ? preRTEHeight : _this.parent.height;
17885
18192
  isHeight = false;
17886
- var argument = isBlazor() ? null : dialog;
18193
+ var argument = dialog;
17887
18194
  _this.dialogRenderObj.close(argument);
17888
18195
  dialog.destroy();
17889
18196
  _this.selectFormatting(value, args, keepChecked, cleanChecked);
@@ -17901,7 +18208,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
17901
18208
  dialog.hide();
17902
18209
  _this.parent.height = isHeight ? preRTEHeight : _this.parent.height;
17903
18210
  isHeight = false;
17904
- var args_1 = isBlazor() ? null : dialog;
18211
+ var args_1 = dialog;
17905
18212
  _this.dialogRenderObj.close(args_1);
17906
18213
  dialog.destroy();
17907
18214
  }
@@ -18322,7 +18629,7 @@ var Resize = /** @__PURE__ @class */ (function () {
18322
18629
  }
18323
18630
  this.wireResizeEvents();
18324
18631
  this.parent.notify(resizeInitialized, {});
18325
- var args = isBlazor() ? { requestType: 'editor' } : { event: e, requestType: 'editor' };
18632
+ var args = { event: e, requestType: 'editor' };
18326
18633
  this.parent.trigger(resizeStart, args, function (resizeStartArgs) {
18327
18634
  if (resizeStartArgs.cancel) {
18328
18635
  _this.unwireResizeEvents();
@@ -18331,7 +18638,7 @@ var Resize = /** @__PURE__ @class */ (function () {
18331
18638
  };
18332
18639
  Resize.prototype.performResize = function (e) {
18333
18640
  var _this = this;
18334
- var args = isBlazor() ? { requestType: 'editor' } : { event: e, requestType: 'editor' };
18641
+ var args = { event: e, requestType: 'editor' };
18335
18642
  this.parent.trigger(onResize, args, function (resizingArgs) {
18336
18643
  if (resizingArgs.cancel) {
18337
18644
  _this.unwireResizeEvents();
@@ -18355,7 +18662,7 @@ var Resize = /** @__PURE__ @class */ (function () {
18355
18662
  Resize.prototype.stopResize = function (e) {
18356
18663
  this.parent.refreshUI();
18357
18664
  this.unwireResizeEvents();
18358
- var args = isBlazor() ? { requestType: 'editor' } : { event: e, requestType: 'editor' };
18665
+ var args = { event: e, requestType: 'editor' };
18359
18666
  this.parent.trigger(resizeStop, args);
18360
18667
  };
18361
18668
  Resize.prototype.getEventType = function (e) {
@@ -18663,35 +18970,45 @@ var FullScreen = /** @__PURE__ @class */ (function () {
18663
18970
  * @deprecated
18664
18971
  */
18665
18972
  FullScreen.prototype.showFullScreen = function (event) {
18973
+ var _this = this;
18666
18974
  if (this.parent.toolbarSettings.enable === true && this.parent.editorMode !== 'Markdown'
18667
18975
  && !isNullOrUndefined(this.parent.quickToolbarModule)) {
18668
18976
  this.parent.quickToolbarModule.hideQuickToolbars();
18669
18977
  }
18670
18978
  this.scrollableParent = getScrollableParent(this.parent.element);
18671
18979
  if (!this.parent.element.classList.contains(CLS_FULL_SCREEN)) {
18672
- this.parent.trigger(actionBegin, { requestType: 'Maximize', targetItem: 'Maximize', args: event });
18673
- if (this.parent.toolbarSettings.enableFloating &&
18674
- !this.parent.inlineMode.enable && this.parent.toolbarSettings.enable) {
18675
- this.parent.getToolbarElement().style.width = '100%';
18676
- this.parent.getToolbarElement().style.top = '0px';
18677
- }
18678
- this.parent.element.classList.add(CLS_FULL_SCREEN);
18679
- this.toggleParentOverflow(true);
18680
- this.parent.setContentHeight();
18681
- if (this.parent.toolbarModule) {
18682
- if (!this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
18683
- this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
18684
- }
18685
- if (Browser.isDevice) {
18686
- this.parent.toolbarModule.removeFixedTBarClass();
18980
+ var evenArgs = {
18981
+ cancel: false,
18982
+ requestType: 'Maximize',
18983
+ targetItem: 'Maximize',
18984
+ args: event
18985
+ };
18986
+ this.parent.trigger(actionBegin, evenArgs, function (beginEventArgs) {
18987
+ if (!beginEventArgs.cancel) {
18988
+ if (_this.parent.toolbarSettings.enableFloating &&
18989
+ !_this.parent.inlineMode.enable && _this.parent.toolbarSettings.enable) {
18990
+ _this.parent.getToolbarElement().style.width = '100%';
18991
+ _this.parent.getToolbarElement().style.top = '0px';
18992
+ }
18993
+ _this.parent.element.classList.add(CLS_FULL_SCREEN);
18994
+ _this.toggleParentOverflow(true);
18995
+ _this.parent.setContentHeight();
18996
+ if (_this.parent.toolbarModule) {
18997
+ if (!_this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
18998
+ _this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
18999
+ }
19000
+ if (Browser.isDevice) {
19001
+ _this.parent.toolbarModule.removeFixedTBarClass();
19002
+ }
19003
+ _this.parent.toolbarModule.updateItem({
19004
+ targetItem: 'Maximize',
19005
+ updateItem: 'Minimize',
19006
+ baseToolbar: _this.parent.getBaseToolbarObject()
19007
+ });
19008
+ }
19009
+ _this.parent.trigger(actionComplete, { requestType: 'Maximize', targetItem: 'Maximize', args: event });
18687
19010
  }
18688
- this.parent.toolbarModule.updateItem({
18689
- targetItem: 'Maximize',
18690
- updateItem: 'Minimize',
18691
- baseToolbar: this.parent.getBaseToolbarObject()
18692
- });
18693
- }
18694
- this.parent.trigger(actionComplete, { requestType: 'Maximize', targetItem: 'Maximize', args: event });
19011
+ });
18695
19012
  }
18696
19013
  };
18697
19014
  /**
@@ -18703,32 +19020,42 @@ var FullScreen = /** @__PURE__ @class */ (function () {
18703
19020
  * @deprecated
18704
19021
  */
18705
19022
  FullScreen.prototype.hideFullScreen = function (event) {
19023
+ var _this = this;
18706
19024
  if (this.parent.toolbarSettings.enable === true && this.parent.editorMode !== 'Markdown'
18707
19025
  && !isNullOrUndefined(this.parent.quickToolbarModule)) {
18708
19026
  this.parent.quickToolbarModule.hideQuickToolbars();
18709
19027
  }
18710
19028
  if (this.parent.element.classList.contains(CLS_FULL_SCREEN)) {
18711
- this.parent.element.classList.remove(CLS_FULL_SCREEN);
18712
- var elem = document.querySelectorAll('.e-rte-overflow');
18713
- for (var i = 0; i < elem.length; i++) {
18714
- removeClass([elem[i]], ['e-rte-overflow']);
18715
- }
18716
- this.parent.trigger(actionBegin, { requestType: 'Minimize', targetItem: 'Minimize', args: event });
18717
- this.parent.setContentHeight();
18718
- if (this.parent.toolbarModule) {
18719
- if (!this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
18720
- this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
18721
- }
18722
- this.parent.toolbarModule.updateItem({
18723
- targetItem: 'Minimize',
18724
- updateItem: 'Maximize',
18725
- baseToolbar: this.parent.getBaseToolbarObject()
18726
- });
18727
- if (Browser.isDevice && this.parent.inlineMode.enable) {
18728
- this.parent.toolbarModule.addFixedTBarClass();
19029
+ var evenArgs = {
19030
+ cancel: false,
19031
+ requestType: 'Minimize',
19032
+ targetItem: 'Minimize',
19033
+ args: event
19034
+ };
19035
+ this.parent.trigger(actionBegin, evenArgs, function (beginEventArgs) {
19036
+ if (!beginEventArgs.cancel) {
19037
+ _this.parent.element.classList.remove(CLS_FULL_SCREEN);
19038
+ var elem = document.querySelectorAll('.e-rte-overflow');
19039
+ for (var i = 0; i < elem.length; i++) {
19040
+ removeClass([elem[i]], ['e-rte-overflow']);
19041
+ }
19042
+ _this.parent.setContentHeight();
19043
+ if (_this.parent.toolbarModule) {
19044
+ if (!_this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
19045
+ _this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
19046
+ }
19047
+ _this.parent.toolbarModule.updateItem({
19048
+ targetItem: 'Minimize',
19049
+ updateItem: 'Maximize',
19050
+ baseToolbar: _this.parent.getBaseToolbarObject()
19051
+ });
19052
+ if (Browser.isDevice && _this.parent.inlineMode.enable) {
19053
+ _this.parent.toolbarModule.addFixedTBarClass();
19054
+ }
19055
+ }
19056
+ _this.parent.trigger(actionComplete, { requestType: 'Minimize', targetItem: 'Minimize', args: event });
18729
19057
  }
18730
- }
18731
- this.parent.trigger(actionComplete, { requestType: 'Minimize', targetItem: 'Minimize', args: event });
19058
+ });
18732
19059
  }
18733
19060
  };
18734
19061
  // eslint-disable-next-line
@@ -18924,9 +19251,17 @@ var Render = /** @__PURE__ @class */ (function () {
18924
19251
  var childNodes = this.parent.contentModule.getEditPanel().childNodes;
18925
19252
  if ((childNodes.length === 0) ||
18926
19253
  (childNodes.length === 1 && childNodes[0].childNodes.length === 0 && ((childNodes[0].tagName === 'BR') ||
18927
- (childNodes[0].tagName === 'P' && childNodes[0].textContent === '')))) {
19254
+ ((childNodes[0].tagName === 'P' || childNodes[0].tagName === 'DIV') && childNodes[0].textContent === '')))) {
18928
19255
  var node = this.parent.contentModule.getEditPanel();
18929
- node.innerHTML = '<p><br/></p>';
19256
+ if (this.parent.enterKey === 'DIV') {
19257
+ node.innerHTML = '<div><br/></div>';
19258
+ }
19259
+ else if (this.parent.enterKey === 'BR') {
19260
+ node.innerHTML = '<br/>';
19261
+ }
19262
+ else {
19263
+ node.innerHTML = '<p><br/></p>';
19264
+ }
18930
19265
  this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), node.childNodes[0], 0);
18931
19266
  }
18932
19267
  break;
@@ -19223,7 +19558,7 @@ var Link = /** @__PURE__ @class */ (function () {
19223
19558
  }
19224
19559
  _this.dialogObj.destroy();
19225
19560
  detach(_this.dialogObj.element);
19226
- var args = isBlazor() ? null : _this.dialogObj;
19561
+ var args = _this.dialogObj;
19227
19562
  _this.dialogRenderObj.close(args);
19228
19563
  _this.dialogObj = null;
19229
19564
  }
@@ -19315,7 +19650,8 @@ var Link = /** @__PURE__ @class */ (function () {
19315
19650
  proxy.parent.formatter.saveData();
19316
19651
  }
19317
19652
  var argsValue;
19318
- if (this.args.code === 'KeyK') {
19653
+ if (!isNullOrUndefined(this.args) &&
19654
+ this.args.code === 'KeyK') {
19319
19655
  var originalEvent = this.args;
19320
19656
  extend(this.args, { item: { command: 'Links', subCommand: 'CreateLink' }, originalEvent: originalEvent }, true);
19321
19657
  var argsVal = {
@@ -19445,6 +19781,7 @@ var Link = /** @__PURE__ @class */ (function () {
19445
19781
  var Image = /** @__PURE__ @class */ (function () {
19446
19782
  function Image(parent, serviceLocator) {
19447
19783
  this.isImgUploaded = false;
19784
+ this.isAllowedTypes = true;
19448
19785
  this.pageX = null;
19449
19786
  this.pageY = null;
19450
19787
  this.deletedImg = [];
@@ -19565,7 +19902,7 @@ var Image = /** @__PURE__ @class */ (function () {
19565
19902
  if (Browser.isDevice) {
19566
19903
  removeClass([e.target.parentElement], 'e-mob-span');
19567
19904
  }
19568
- var args = isBlazor() ? { requestType: 'images' } : { event: e, requestType: 'images' };
19905
+ var args = { event: e, requestType: 'images' };
19569
19906
  this.parent.trigger(resizeStop, args);
19570
19907
  /* eslint-disable */
19571
19908
  var pageX = this.getPointX(e);
@@ -19619,7 +19956,7 @@ var Image = /** @__PURE__ @class */ (function () {
19619
19956
  addClass([this.imgResizeDiv], 'e-mob-span');
19620
19957
  }
19621
19958
  else {
19622
- var args = isBlazor() ? { requestType: 'images' } : { event: e, requestType: 'images' };
19959
+ var args = { event: e, requestType: 'images' };
19623
19960
  this.parent.trigger(resizeStart, args, function (resizeStartArgs) {
19624
19961
  if (resizeStartArgs.cancel) {
19625
19962
  _this.cancelResizeAction();
@@ -19754,6 +20091,12 @@ var Image = /** @__PURE__ @class */ (function () {
19754
20091
  img.style.height = null;
19755
20092
  img.removeAttribute('height');
19756
20093
  }
20094
+ else if (img.style.width === '' && img.style.height !== '') {
20095
+ img.style.height = expectedY + 'px';
20096
+ }
20097
+ else if (img.style.width !== '' && img.style.height === '') {
20098
+ img.style.width = ((width / height * expectedY) + width / height).toString() + 'px';
20099
+ }
19757
20100
  else if (img.style.width !== '') {
19758
20101
  img.style.width = (width / height * expectedY) + 'px';
19759
20102
  img.style.height = expectedY + 'px';
@@ -19802,7 +20145,7 @@ var Image = /** @__PURE__ @class */ (function () {
19802
20145
  };
19803
20146
  Image.prototype.imgDupMouseMove = function (width, height, e) {
19804
20147
  var _this = this;
19805
- var args = isBlazor() ? { requestType: 'images' } : { event: e, requestType: 'images' };
20148
+ var args = { event: e, requestType: 'images' };
19806
20149
  this.parent.trigger(onResize, args, function (resizingArgs) {
19807
20150
  if (resizingArgs.cancel) {
19808
20151
  _this.cancelResizeAction();
@@ -20629,7 +20972,7 @@ var Image = /** @__PURE__ @class */ (function () {
20629
20972
  isModal: Browser.isDevice,
20630
20973
  buttons: [{
20631
20974
  click: this.insertImageUrl.bind(selectObj),
20632
- buttonModel: { content: imgInsert, cssClass: 'e-flat e-insertImage', isPrimary: true }
20975
+ buttonModel: { content: imgInsert, cssClass: 'e-flat e-insertImage', isPrimary: true, disabled: true }
20633
20976
  },
20634
20977
  {
20635
20978
  click: function (e) {
@@ -20755,12 +21098,23 @@ var Image = /** @__PURE__ @class */ (function () {
20755
21098
  };
20756
21099
  // eslint-disable-next-line
20757
21100
  Image.prototype.imageUrlPopup = function (e) {
21101
+ var _this = this;
20758
21102
  var imgUrl = this.parent.createElement('div', { className: 'imgUrl' });
20759
21103
  var placeUrl = this.i10n.getConstant('imageUrl');
20760
21104
  this.inputUrl = this.parent.createElement('input', {
20761
21105
  className: 'e-input e-img-url',
20762
21106
  attrs: { placeholder: placeUrl, spellcheck: 'false' }
20763
21107
  });
21108
+ this.inputUrl.addEventListener('input', function () {
21109
+ if (!isNullOrUndefined(_this.inputUrl)) {
21110
+ if (_this.inputUrl.value.length === 0) {
21111
+ _this.dialogObj.getButtons(0).element.disabled = true;
21112
+ }
21113
+ else {
21114
+ _this.dialogObj.getButtons(0).element.removeAttribute('disabled');
21115
+ }
21116
+ }
21117
+ });
20764
21118
  imgUrl.appendChild(this.inputUrl);
20765
21119
  return imgUrl;
20766
21120
  };
@@ -20811,42 +21165,58 @@ var Image = /** @__PURE__ @class */ (function () {
20811
21165
  }
20812
21166
  };
20813
21167
  Image.prototype.imgsizeInput = function (e) {
21168
+ var _this = this;
20814
21169
  var selectNode = e.selectNode[0];
20815
21170
  var imgHeight = this.i10n.getConstant('imageHeight');
20816
21171
  var imgWidth = this.i10n.getConstant('imageWidth');
20817
21172
  var imgSizeWrap = this.parent.createElement('div', { className: 'e-img-sizewrap' });
20818
- var widthVal = (selectNode.getAttribute('width') === 'auto' ||
20819
- isNullOrUndefined(selectNode.getAttribute('width'))) ? selectNode.width : selectNode.getClientRects()[0].width;
20820
- var heightVal = (selectNode.getAttribute('height') === 'auto' ||
20821
- isNullOrUndefined(selectNode.getAttribute('height'))) ? selectNode.height : selectNode.getClientRects()[0].height;
21173
+ var widthVal = isNullOrUndefined(this.changedWidthValue) && (selectNode.style.width.toString() === 'auto' ||
21174
+ selectNode.style.width !== "") ? selectNode.style.width : !isNullOrUndefined(this.changedWidthValue) ?
21175
+ this.changedWidthValue : (parseInt(selectNode.getClientRects()[0].width.toString())).toString();
21176
+ var heightVal = isNullOrUndefined(this.changedHeightValue) && (selectNode.style.height.toString() === 'auto' ||
21177
+ selectNode.style.height !== "") ? selectNode.style.height : !isNullOrUndefined(this.changedHeightValue) ?
21178
+ this.changedHeightValue : (parseInt(selectNode.getClientRects()[0].height.toString())).toString();
21179
+ this.changedWidthValue = null;
21180
+ this.changedHeightValue = null;
20822
21181
  var content = '<div class="e-rte-label"><label>' + imgWidth +
20823
- '</label></div><div class="e-rte-field"><input type="text" data-role ="none" id="imgwidth" class="e-img-width" value=' +
21182
+ '</label></div><div class="e-rte-field"><input type="text" id="imgwidth" class="e-img-width" value=' +
20824
21183
  widthVal
20825
21184
  + ' /></div>' +
20826
21185
  '<div class="e-rte-label">' + '<label>' + imgHeight + '</label></div><div class="e-rte-field"> ' +
20827
- '<input type="text" data-role ="none" id="imgheight" class="e-img-height" value=' +
21186
+ '<input type="text" id="imgheight" class="e-img-height" value=' +
20828
21187
  heightVal
20829
21188
  + ' /></div>';
20830
21189
  var contentElem = parseHtml(content);
20831
21190
  imgSizeWrap.appendChild(contentElem);
20832
- var widthNum = new NumericTextBox({
20833
- format: '###.### px', min: this.parent.insertImageSettings.minWidth,
20834
- max: this.parent.getInsertImgMaxWidth(),
20835
- enableRtl: this.parent.enableRtl, locale: this.parent.locale
21191
+ var widthNum = new TextBox({
21192
+ value: formatUnit(widthVal),
21193
+ enableRtl: this.parent.enableRtl,
21194
+ input: function (e) {
21195
+ _this.inputWidthValue = formatUnit(_this.inputValue(e.value));
21196
+ }
20836
21197
  });
20837
- widthNum.isStringTemplate = true;
20838
21198
  widthNum.createElement = this.parent.createElement;
20839
21199
  widthNum.appendTo(imgSizeWrap.querySelector('#imgwidth'));
20840
- var heightNum = new NumericTextBox({
20841
- format: '###.### px', min: this.parent.insertImageSettings.minHeight,
20842
- max: this.parent.insertImageSettings.maxHeight,
20843
- enableRtl: this.parent.enableRtl, locale: this.parent.locale
21200
+ var heightNum = new TextBox({
21201
+ value: formatUnit(heightVal),
21202
+ enableRtl: this.parent.enableRtl,
21203
+ input: function (e) {
21204
+ _this.inputHeightValue = formatUnit(_this.inputValue(e.value));
21205
+ }
20844
21206
  });
20845
- heightNum.isStringTemplate = true;
20846
21207
  heightNum.createElement = this.parent.createElement;
20847
21208
  heightNum.appendTo(imgSizeWrap.querySelector('#imgheight'));
20848
21209
  return imgSizeWrap;
20849
21210
  };
21211
+ Image.prototype.inputValue = function (value) {
21212
+ if (value === 'auto' || value.indexOf('%') !== -1 || value.indexOf('px') !== -1
21213
+ || value.match(/(\d+)/)) {
21214
+ return value;
21215
+ }
21216
+ else {
21217
+ return "auto";
21218
+ }
21219
+ };
20850
21220
  Image.prototype.insertSize = function (e) {
20851
21221
  e.selection.restore();
20852
21222
  var proxy = e.selfImage;
@@ -20854,8 +21224,10 @@ var Image = /** @__PURE__ @class */ (function () {
20854
21224
  proxy.parent.formatter.saveData();
20855
21225
  }
20856
21226
  var dialogEle = proxy.dialogObj.element;
20857
- var width = parseFloat(dialogEle.querySelector('.e-img-width').value);
20858
- var height = parseFloat(dialogEle.parentElement.querySelector('.e-img-height').value);
21227
+ this.changedWidthValue = this.inputWidthValue;
21228
+ this.changedHeightValue = this.inputHeightValue;
21229
+ var width = dialogEle.querySelector('.e-img-width').value;
21230
+ var height = dialogEle.parentElement.querySelector('.e-img-height').value;
20859
21231
  proxy.parent.formatter.process(this.parent, e.args, e.args, {
20860
21232
  width: width, height: height, selectNode: e.selectNode,
20861
21233
  subCommand: e.args.item.subCommand
@@ -20965,6 +21337,10 @@ var Image = /** @__PURE__ @class */ (function () {
20965
21337
  }
20966
21338
  };
20967
21339
  proxy.inputUrl.setAttribute('disabled', 'true');
21340
+ if (isNullOrUndefined(proxy.parent.insertImageSettings.saveUrl) && _this.isAllowedTypes
21341
+ && !isNullOrUndefined(_this.dialogObj)) {
21342
+ _this.dialogObj.getButtons(0).element.removeAttribute('disabled');
21343
+ }
20968
21344
  });
20969
21345
  reader_1.readAsDataURL(selectArgs.filesData[0].rawFile);
20970
21346
  }
@@ -21020,6 +21396,9 @@ var Image = /** @__PURE__ @class */ (function () {
21020
21396
  };
21021
21397
  proxy.inputUrl.setAttribute('disabled', 'true');
21022
21398
  }
21399
+ if (e.operation === 'upload' && !isNullOrUndefined(_this.dialogObj)) {
21400
+ _this.dialogObj.getButtons(0).element.removeAttribute('disabled');
21401
+ }
21023
21402
  });
21024
21403
  },
21025
21404
  failure: function (e) {
@@ -21029,11 +21408,11 @@ var Image = /** @__PURE__ @class */ (function () {
21029
21408
  // eslint-disable-next-line
21030
21409
  _this.parent.trigger(imageRemoving, e, function (e) {
21031
21410
  proxy.isImgUploaded = false;
21411
+ _this.dialogObj.getButtons(0).element.disabled = true;
21032
21412
  proxy.inputUrl.removeAttribute('disabled');
21033
21413
  if (proxy.uploadUrl) {
21034
21414
  proxy.uploadUrl.url = '';
21035
21415
  }
21036
- _this.dialogObj.getButtons(0).element.removeAttribute('disabled');
21037
21416
  });
21038
21417
  }
21039
21418
  });
@@ -21046,9 +21425,10 @@ var Image = /** @__PURE__ @class */ (function () {
21046
21425
  if (this.uploadObj.allowedExtensions) {
21047
21426
  if (this.uploadObj.allowedExtensions.toLocaleLowerCase().indexOf(('.' + e.type).toLocaleLowerCase()) === -1) {
21048
21427
  this.dialogObj.getButtons(0).element.setAttribute('disabled', 'disabled');
21428
+ this.isAllowedTypes = false;
21049
21429
  }
21050
21430
  else {
21051
- this.dialogObj.getButtons(0).element.removeAttribute('disabled');
21431
+ this.isAllowedTypes = true;
21052
21432
  }
21053
21433
  }
21054
21434
  };
@@ -21718,7 +22098,21 @@ var ViewSource = /** @__PURE__ @class */ (function () {
21718
22098
  baseToolbar: this.parent.getBaseToolbarObject()
21719
22099
  });
21720
22100
  var serializeValue = this.parent.serializeValue(editHTML.value);
21721
- var value = (serializeValue === null || serializeValue === '') ? '<p><br/></p>' : serializeValue;
22101
+ var value;
22102
+ if (serializeValue === null || serializeValue === '') {
22103
+ if (this.parent.enterKey === 'DIV') {
22104
+ value = '<div><br/></div>';
22105
+ }
22106
+ else if (this.parent.enterKey === 'BR') {
22107
+ value = '<br/>';
22108
+ }
22109
+ else {
22110
+ value = '<p><br/></p>';
22111
+ }
22112
+ }
22113
+ else {
22114
+ value = serializeValue;
22115
+ }
21722
22116
  if (this.parent.iframeSettings.enable) {
21723
22117
  editHTML.parentElement.style.display = 'none';
21724
22118
  editHTML.style.display = 'none';
@@ -21750,9 +22144,13 @@ var ViewSource = /** @__PURE__ @class */ (function () {
21750
22144
  };
21751
22145
  ViewSource.prototype.getTextAreaValue = function () {
21752
22146
  return (this.contentModule.getEditPanel().innerHTML === '<p><br></p>') ||
22147
+ (this.contentModule.getEditPanel().innerHTML === '<div><br></div>') ||
22148
+ (this.contentModule.getEditPanel().innerHTML === '<br>') ||
21753
22149
  (this.contentModule.getEditPanel().childNodes.length === 1 &&
21754
- this.contentModule.getEditPanel().childNodes[0].tagName === 'P' &&
21755
- this.contentModule.getEditPanel().innerHTML.length === 7) ? '' : this.parent.value;
22150
+ (this.contentModule.getEditPanel().childNodes[0].tagName === 'P' &&
22151
+ this.contentModule.getEditPanel().innerHTML.length === 7) ||
22152
+ (this.contentModule.getEditPanel().childNodes[0].tagName === 'DIV' &&
22153
+ this.contentModule.getEditPanel().innerHTML.length === 11)) ? '' : this.parent.value;
21756
22154
  };
21757
22155
  /**
21758
22156
  * getPanel method
@@ -21848,14 +22246,16 @@ var Table = /** @__PURE__ @class */ (function () {
21848
22246
  }
21849
22247
  };
21850
22248
  Table.prototype.afterRender = function () {
21851
- this.contentModule = this.rendererFactory.getRenderer(RenderType.Content);
21852
- this.parent.on(tableColorPickerChanged, this.setBGColor, this);
21853
- this.parent.on(mouseDown, this.cellSelect, this);
21854
- if (this.parent.tableSettings.resize) {
21855
- EventHandler.add(this.parent.contentModule.getEditPanel(), Browser.touchStartEvent, this.resizeStart, this);
21856
- }
21857
- if (!Browser.isDevice && this.parent.tableSettings.resize) {
21858
- EventHandler.add(this.contentModule.getEditPanel(), 'mouseover', this.resizeHelper, this);
22249
+ if (isNullOrUndefined(this.contentModule)) {
22250
+ this.contentModule = this.rendererFactory.getRenderer(RenderType.Content);
22251
+ this.parent.on(tableColorPickerChanged, this.setBGColor, this);
22252
+ this.parent.on(mouseDown, this.cellSelect, this);
22253
+ if (this.parent.tableSettings.resize) {
22254
+ EventHandler.add(this.parent.contentModule.getEditPanel(), Browser.touchStartEvent, this.resizeStart, this);
22255
+ }
22256
+ if (!Browser.isDevice && this.parent.tableSettings.resize) {
22257
+ EventHandler.add(this.contentModule.getEditPanel(), 'mouseover', this.resizeHelper, this);
22258
+ }
21859
22259
  }
21860
22260
  };
21861
22261
  Table.prototype.dropdownSelect = function (e) {
@@ -21889,6 +22289,7 @@ var Table = /** @__PURE__ @class */ (function () {
21889
22289
  break;
21890
22290
  case 'Dashed':
21891
22291
  case 'Alternate':
22292
+ case 'Custom':
21892
22293
  this.tableStyles(args, item.subCommand);
21893
22294
  break;
21894
22295
  case 'Merge':
@@ -22012,6 +22413,13 @@ var Table = /** @__PURE__ @class */ (function () {
22012
22413
  table.classList.add(CLS_TB_ALT_BOR);
22013
22414
  /* eslint-enable */
22014
22415
  }
22416
+ if (args.args && args.args.item.cssClass) {
22417
+ var classList = args.args.item.cssClass.split(' ');
22418
+ for (var i = 0; i < classList.length; i++) {
22419
+ (table.classList.contains(classList[i])) ? table.classList.remove(classList[i]) :
22420
+ table.classList.add(classList[i]);
22421
+ }
22422
+ }
22015
22423
  this.parent.formatter.saveData();
22016
22424
  this.parent.formatter.editorManager.nodeSelection.restore();
22017
22425
  };
@@ -22228,7 +22636,7 @@ var Table = /** @__PURE__ @class */ (function () {
22228
22636
  selectionObj.selection = proxy.parent.formatter.editorManager.nodeSelection.save(range, proxy.contentModule.getDocument());
22229
22637
  }
22230
22638
  var value = {
22231
- row: row, columns: col, width: {
22639
+ rows: row, columns: col, width: {
22232
22640
  minWidth: proxy.parent.tableSettings.minWidth,
22233
22641
  maxWidth: proxy.parent.tableSettings.maxWidth,
22234
22642
  width: proxy.parent.tableSettings.width
@@ -22366,8 +22774,8 @@ var Table = /** @__PURE__ @class */ (function () {
22366
22774
  parentOffset = offsetParent.getBoundingClientRect();
22367
22775
  }
22368
22776
  return {
22369
- top: offset.top - parentOffset.top,
22370
- left: offset.left - parentOffset.left
22777
+ top: elem.offsetTop,
22778
+ left: elem.offsetLeft
22371
22779
  };
22372
22780
  };
22373
22781
  Table.prototype.getPointX = function (e) {
@@ -22427,7 +22835,7 @@ var Table = /** @__PURE__ @class */ (function () {
22427
22835
  EventHandler.add(this.helper, Browser.touchStartEvent, this.resizeStart, this);
22428
22836
  }
22429
22837
  else {
22430
- var args = isBlazor() ? { requestType: 'Table' } : { event: e, requestType: 'Table' };
22838
+ var args = { event: e, requestType: 'Table' };
22431
22839
  this.parent.trigger(resizeStart, args, function (resizeStartArgs) {
22432
22840
  if (resizeStartArgs.cancel) {
22433
22841
  _this.cancelResizeAction();
@@ -22504,7 +22912,7 @@ var Table = /** @__PURE__ @class */ (function () {
22504
22912
  var mouseY = (this.parent.enableRtl) ? -(pageY - this.pageY) : (pageY - this.pageY);
22505
22913
  this.pageX = pageX;
22506
22914
  this.pageY = pageY;
22507
- var args = isBlazor() ? { requestType: 'table' } : { event: e, requestType: 'table' };
22915
+ var args = { event: e, requestType: 'table' };
22508
22916
  this.parent.trigger(onResize, args, function (resizingArgs) {
22509
22917
  if (resizingArgs.cancel) {
22510
22918
  _this.cancelResizeAction();
@@ -22591,7 +22999,7 @@ var Table = /** @__PURE__ @class */ (function () {
22591
22999
  this.pageY = null;
22592
23000
  this.moveEle = null;
22593
23001
  }
22594
- var args = isBlazor() ? { requestType: 'table' } : { event: e, requestType: 'table' };
23002
+ var args = { event: e, requestType: 'table' };
22595
23003
  this.parent.trigger(resizeStop, args);
22596
23004
  this.parent.formatter.saveData();
22597
23005
  };
@@ -23696,6 +24104,294 @@ var InlineMode = /** @__PURE__ @class */ (function (_super) {
23696
24104
  return InlineMode;
23697
24105
  }(ChildProperty));
23698
24106
 
24107
+ /**
24108
+ * `EnterKey` module is used to handle enter key press actions.
24109
+ */
24110
+ var EnterKeyAction = /** @__PURE__ @class */ (function () {
24111
+ function EnterKeyAction(parent) {
24112
+ this.parent = parent;
24113
+ this.addEventListener();
24114
+ }
24115
+ EnterKeyAction.prototype.addEventListener = function () {
24116
+ this.parent.on(enterHandler, this.enterHandler, this);
24117
+ this.parent.on(destroy, this.destroy, this);
24118
+ };
24119
+ EnterKeyAction.prototype.destroy = function () {
24120
+ this.removeEventListener();
24121
+ };
24122
+ EnterKeyAction.prototype.removeEventListener = function () {
24123
+ this.parent.off(enterHandler, this.enterHandler);
24124
+ this.parent.off(destroy, this.destroy);
24125
+ };
24126
+ EnterKeyAction.prototype.getRangeNode = function () {
24127
+ this.range = this.parent.getRange();
24128
+ this.startNode = this.range.startContainer.nodeName === '#text' ? this.range.startContainer.parentElement :
24129
+ this.range.startContainer;
24130
+ this.endNode = this.range.endContainer.nodeName === '#text' ? this.range.endContainer.parentElement :
24131
+ this.range.endContainer;
24132
+ };
24133
+ EnterKeyAction.prototype.enterHandler = function (e) {
24134
+ var _this = this;
24135
+ this.getRangeNode();
24136
+ if (e.args.which === 13 && e.args.code === 'Enter') {
24137
+ if (isNullOrUndefined(this.startNode.closest('LI')) && isNullOrUndefined(this.endNode.closest('LI')) && isNullOrUndefined(this.startNode.closest('TABLE')) &&
24138
+ isNullOrUndefined(this.endNode.closest('TABLE')) && isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
24139
+ var shiftKey_1 = e.args.shiftKey;
24140
+ var actionBeginArgs = {
24141
+ cancel: false,
24142
+ name: actionBegin,
24143
+ requestType: shiftKey_1 ? 'ShiftEnterAction' : 'EnterAction',
24144
+ originalEvent: e.args
24145
+ };
24146
+ this.parent.trigger(actionBegin, actionBeginArgs, function (actionBeginArgs) {
24147
+ if (!actionBeginArgs.cancel) {
24148
+ if (!(_this.range.startOffset === _this.range.endOffset && _this.range.startContainer === _this.range.endContainer)) {
24149
+ _this.range.deleteContents();
24150
+ if (_this.range.startContainer.nodeName === '#text' && _this.range.startContainer.textContent.length === 0 &&
24151
+ _this.range.startContainer.parentElement !== _this.parent.inputElement) {
24152
+ if (_this.parent.enterKey === 'BR') {
24153
+ _this.range.startContainer.parentElement.innerHTML = '&#8203;';
24154
+ }
24155
+ else {
24156
+ _this.range.startContainer.parentElement.innerHTML = '<br>';
24157
+ }
24158
+ }
24159
+ else if (_this.range.startContainer === _this.parent.inputElement && _this.range.startContainer.innerHTML === '') {
24160
+ _this.range.startContainer.innerHTML = '<br>';
24161
+ var focusElem = _this.range.startContainer.childNodes[_this.range.startOffset];
24162
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), focusElem, 0);
24163
+ }
24164
+ else if (_this.parent.inputElement === _this.range.startContainer) {
24165
+ var focusElem = _this.range.startContainer.childNodes[_this.range.startOffset];
24166
+ if (focusElem.nodeName === '#text' && focusElem.textContent.length === 0) {
24167
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), focusElem, focusElem.previousSibling.textContent.length);
24168
+ }
24169
+ else {
24170
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), focusElem, focusElem.textContent.length >= 0 ? 0 : 1);
24171
+ if (focusElem.previousSibling.textContent.length === 0) {
24172
+ detach(focusElem.previousSibling);
24173
+ }
24174
+ else if (focusElem.textContent.length === 0) {
24175
+ var currentFocusElem = focusElem.previousSibling.lastChild;
24176
+ var finalFocusElem = void 0;
24177
+ while (currentFocusElem.nodeName !== '#text') {
24178
+ finalFocusElem = currentFocusElem;
24179
+ currentFocusElem = currentFocusElem.lastChild;
24180
+ }
24181
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), currentFocusElem, currentFocusElem.textContent.length);
24182
+ detach(focusElem);
24183
+ }
24184
+ else if (_this.parent.enterKey !== 'BR' &&
24185
+ focusElem.previousSibling.textContent.length !== 0 && focusElem.textContent.length !== 0) {
24186
+ e.args.preventDefault();
24187
+ return;
24188
+ }
24189
+ }
24190
+ _this.getRangeNode();
24191
+ }
24192
+ }
24193
+ if (_this.range.startContainer === _this.range.endContainer && _this.range.startOffset === 0 &&
24194
+ _this.range.startOffset == _this.range.endOffset && _this.range.startContainer === _this.parent.inputElement) {
24195
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.range.startContainer.childNodes[_this.range.startOffset], _this.range.startOffset);
24196
+ _this.getRangeNode();
24197
+ }
24198
+ if (_this.parent.enterKey === 'P' || _this.parent.enterKey === 'DIV' ||
24199
+ (_this.parent.shiftEnterKey === 'P' && shiftKey_1) ||
24200
+ (_this.parent.shiftEnterKey === 'DIV' && shiftKey_1)) {
24201
+ var nearBlockNode = _this.parent.formatter.editorManager.domNode.blockParentNode(_this.startNode);
24202
+ var isImageNode = false;
24203
+ if (_this.range.startOffset === 0 && _this.range.endOffset === 0 && !(!isNullOrUndefined(_this.range.startContainer.previousSibling) && _this.range.startContainer.previousSibling.nodeName === 'IMG')) {
24204
+ var isNearBlockLengthZero = void 0;
24205
+ var newElem = void 0;
24206
+ if (_this.range.startContainer.nodeName === 'IMG') {
24207
+ newElem = _this.createInsertElement(shiftKey_1);
24208
+ isImageNode = true;
24209
+ isNearBlockLengthZero = false;
24210
+ }
24211
+ else {
24212
+ if (nearBlockNode.textContent.length !== 0) {
24213
+ newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
24214
+ isNearBlockLengthZero = false;
24215
+ }
24216
+ else {
24217
+ newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true).cloneNode(true);
24218
+ isNearBlockLengthZero = true;
24219
+ }
24220
+ }
24221
+ var insertElem = _this.createInsertElement(shiftKey_1);
24222
+ while (newElem.firstChild) {
24223
+ insertElem.appendChild(newElem.firstChild);
24224
+ }
24225
+ nearBlockNode.parentElement.insertBefore(insertElem, nearBlockNode);
24226
+ if (!isNearBlockLengthZero) {
24227
+ var currentFocusElem = insertElem;
24228
+ var finalFocusElem = void 0;
24229
+ while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text') {
24230
+ finalFocusElem = currentFocusElem;
24231
+ currentFocusElem = currentFocusElem.lastChild;
24232
+ }
24233
+ finalFocusElem.innerHTML = '<br>';
24234
+ if (!isImageNode) {
24235
+ detach(nearBlockNode);
24236
+ }
24237
+ }
24238
+ }
24239
+ else if (nearBlockNode.textContent.length === 0 && !(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG')) {
24240
+ if (!isNullOrUndefined(nearBlockNode.children[0]) && nearBlockNode.children[0].tagName !== 'BR') {
24241
+ var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
24242
+ _this.parent.formatter.editorManager.domNode.insertAfter(newElem, nearBlockNode);
24243
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), newElem, newElem.textContent.length >= 0 ? 0 : 1);
24244
+ }
24245
+ else {
24246
+ var insertElem = _this.createInsertElement(shiftKey_1);
24247
+ insertElem.innerHTML = '<br>';
24248
+ _this.parent.formatter.editorManager.domNode.insertAfter(insertElem, nearBlockNode);
24249
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), insertElem, 0);
24250
+ }
24251
+ }
24252
+ else {
24253
+ var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true);
24254
+ if (!isNullOrUndefined(newElem.childNodes[0]) && newElem.childNodes[0].nodeName === '#text' &&
24255
+ newElem.childNodes[0].textContent.length === 0) {
24256
+ detach(newElem.childNodes[0]);
24257
+ }
24258
+ if (newElem.textContent.trim().length === 0) {
24259
+ var brElm = _this.parent.createElement('br');
24260
+ _this.startNode.appendChild(brElm);
24261
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.startNode, 0);
24262
+ }
24263
+ if (((_this.parent.enterKey === 'P' || _this.parent.enterKey === 'DIV') && !shiftKey_1) || ((_this.parent.shiftEnterKey === 'DIV' ||
24264
+ _this.parent.shiftEnterKey === 'P') && shiftKey_1)) {
24265
+ var insertElm = _this.createInsertElement(shiftKey_1);
24266
+ while (newElem.firstChild) {
24267
+ insertElm.appendChild(newElem.firstChild);
24268
+ }
24269
+ _this.parent.formatter.editorManager.domNode.insertAfter(insertElm, newElem);
24270
+ detach(newElem);
24271
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), insertElm, insertElm.textContent.length >= 0 ? 0 : 1);
24272
+ }
24273
+ }
24274
+ e.args.preventDefault();
24275
+ }
24276
+ if (_this.parent.enterKey === 'BR' && !shiftKey_1) {
24277
+ var currentParent = void 0;
24278
+ if (!_this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode)) {
24279
+ var currentNode = _this.startNode;
24280
+ var previousNode = currentNode;
24281
+ while (!_this.parent.formatter.editorManager.domNode.isBlockNode(currentNode)) {
24282
+ previousNode = currentNode;
24283
+ currentNode = currentNode.parentElement;
24284
+ }
24285
+ currentParent = currentNode === _this.parent.inputElement ?
24286
+ previousNode : currentNode;
24287
+ }
24288
+ else {
24289
+ currentParent = _this.startNode;
24290
+ }
24291
+ var isEmptyBrInserted = false;
24292
+ if (currentParent !== _this.parent.inputElement &&
24293
+ _this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
24294
+ _this.range.startOffset === _this.range.endOffset &&
24295
+ _this.range.startOffset === currentParent.textContent.length) {
24296
+ var outerBRElem = _this.parent.createElement('br');
24297
+ _this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
24298
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), outerBRElem, 0);
24299
+ }
24300
+ else if (!isNullOrUndefined(currentParent) && currentParent !== _this.parent.inputElement && currentParent.nodeName !== 'BR') {
24301
+ if (currentParent.textContent.trim().length === 0 || (currentParent.textContent.trim().length === 1 &&
24302
+ currentParent.textContent.charCodeAt(0) === 8203)) {
24303
+ var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, true).cloneNode(true);
24304
+ _this.parent.formatter.editorManager.domNode.insertAfter(newElem, currentParent);
24305
+ var outerBRElem = _this.parent.createElement('br');
24306
+ newElem.parentElement.insertBefore(outerBRElem, newElem);
24307
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), newElem, 0);
24308
+ }
24309
+ else {
24310
+ var newElem = void 0;
24311
+ var focusElem = void 0;
24312
+ var outerBRElem = _this.parent.createElement('br');
24313
+ if (_this.range.startOffset === 0 && _this.range.endOffset === 0 &&
24314
+ !isNullOrUndefined(currentParent.previousSibling) && currentParent.previousSibling.nodeName === 'BR') {
24315
+ focusElem = _this.range.startContainer;
24316
+ newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, false).cloneNode(true);
24317
+ _this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
24318
+ _this.insertFocusContent();
24319
+ var currentFocusElem = outerBRElem.nextSibling;
24320
+ var finalFocusElem = void 0;
24321
+ while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text') {
24322
+ finalFocusElem = currentFocusElem;
24323
+ currentFocusElem = currentFocusElem.lastChild;
24324
+ }
24325
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), currentFocusElem, 0);
24326
+ isEmptyBrInserted = true;
24327
+ }
24328
+ else {
24329
+ newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, true);
24330
+ newElem.parentElement.insertBefore(outerBRElem, newElem);
24331
+ _this.insertFocusContent();
24332
+ }
24333
+ }
24334
+ }
24335
+ else {
24336
+ var brElm = _this.parent.createElement('br');
24337
+ if (_this.startNode.nodeName === 'BR' && _this.endNode.nodeName === 'BR' && _this.range.startOffset === 0 && _this.range.startOffset === _this.range.endOffset) {
24338
+ _this.parent.formatter.editorManager.domNode.insertAfter(brElm, _this.startNode);
24339
+ isEmptyBrInserted = true;
24340
+ }
24341
+ else {
24342
+ if (_this.startNode === _this.parent.inputElement && !isNullOrUndefined(_this.range.startContainer.previousSibling) &&
24343
+ _this.range.startContainer.previousSibling.nodeName === 'BR' && _this.range.startContainer.textContent.length === 0) {
24344
+ isEmptyBrInserted = true;
24345
+ }
24346
+ _this.range.insertNode(brElm);
24347
+ }
24348
+ if (isEmptyBrInserted || (!isNullOrUndefined(brElm.nextElementSibling) && brElm.nextElementSibling.tagName === 'BR') || (!isNullOrUndefined(brElm.nextSibling) && brElm.nextSibling.textContent.length > 0)) {
24349
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), !isNullOrUndefined(brElm.nextSibling) ? brElm.nextSibling : brElm, 0);
24350
+ isEmptyBrInserted = false;
24351
+ }
24352
+ else {
24353
+ var brElm2 = _this.parent.createElement('br');
24354
+ _this.range.insertNode(brElm2);
24355
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), brElm, 0);
24356
+ }
24357
+ }
24358
+ e.args.preventDefault();
24359
+ }
24360
+ if (_this.range.startContainer.nodeName === '#text') {
24361
+ _this.range.startContainer.parentElement.scrollIntoView(false);
24362
+ }
24363
+ else {
24364
+ _this.range.startContainer.scrollIntoView(false);
24365
+ }
24366
+ _this.parent.trigger(actionComplete, { requestType: shiftKey_1 ? 'ShiftEnterAction' : 'EnterAction', args: e.args });
24367
+ }
24368
+ });
24369
+ }
24370
+ }
24371
+ };
24372
+ EnterKeyAction.prototype.insertFocusContent = function () {
24373
+ if (this.range.startContainer.textContent.length === 0) {
24374
+ if (this.range.startContainer.nodeName === '#text') {
24375
+ this.range.startContainer.parentElement.innerHTML = '&#8203;';
24376
+ }
24377
+ else {
24378
+ this.range.startContainer.innerHTML = '&#8203;';
24379
+ }
24380
+ }
24381
+ };
24382
+ EnterKeyAction.prototype.createInsertElement = function (shiftKey) {
24383
+ var insertElem;
24384
+ if ((this.parent.enterKey === 'DIV' && !shiftKey) || (this.parent.shiftEnterKey === 'DIV' && shiftKey)) {
24385
+ insertElem = this.parent.createElement('div');
24386
+ }
24387
+ else if ((this.parent.enterKey === 'P' && !shiftKey) || (this.parent.shiftEnterKey === 'P' && shiftKey)) {
24388
+ insertElem = this.parent.createElement('p');
24389
+ }
24390
+ return insertElem;
24391
+ };
24392
+ return EnterKeyAction;
24393
+ }());
24394
+
23699
24395
  var __extends$4 = (undefined && undefined.__extends) || (function () {
23700
24396
  var extendStatics = function (d, b) {
23701
24397
  extendStatics = Object.setPrototypeOf ||
@@ -23877,9 +24573,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
23877
24573
  this.htmlAttributes = { 'tabindex': this.element.getAttribute('tabindex') };
23878
24574
  this.element.removeAttribute('tabindex');
23879
24575
  }
23880
- if (!this.isBlazor()) {
23881
- this.element.innerHTML = '';
23882
- }
24576
+ this.element.innerHTML = '';
23883
24577
  var invalidAttr = ['class', 'style', 'id', 'ejs-for'];
23884
24578
  var htmlAttr = {};
23885
24579
  for (var a = 0; a < this.element.attributes.length; a++) {
@@ -23897,23 +24591,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
23897
24591
  var rteOuterWrapper = this.createElement('div', {
23898
24592
  className: this.element.getAttribute('class')
23899
24593
  });
23900
- if (!this.isBlazor()) {
23901
- this.element.innerHTML = '';
23902
- }
24594
+ this.element.innerHTML = '';
23903
24595
  this.element.parentElement.insertBefore(rteOuterWrapper, this.element);
23904
- if (isBlazor()) {
23905
- rteOuterWrapper.appendChild(this.element);
23906
- this.valueContainer = this.createElement('textarea', {
23907
- id: this.element.id + '-value'
23908
- });
23909
- }
23910
- else {
23911
- this.valueContainer = this.element;
23912
- }
24596
+ this.valueContainer = this.element;
23913
24597
  removeClass([this.valueContainer], this.element.getAttribute('class').split(' '));
23914
- if (this.isBlazor()) {
23915
- addClass([this.element], CLS_RTE_HIDDEN);
23916
- }
23917
24598
  this.element = rteOuterWrapper;
23918
24599
  }
23919
24600
  else {
@@ -24130,12 +24811,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
24130
24811
  }
24131
24812
  this.setContentHeight();
24132
24813
  if (this.value !== null) {
24133
- if (!this.isBlazor()) {
24134
- this.valueContainer.defaultValue = this.value;
24135
- }
24136
- else {
24137
- this.defaultResetValue = this.value;
24138
- }
24814
+ this.valueContainer.defaultValue = this.value;
24139
24815
  }
24140
24816
  // eslint-disable-next-line
24141
24817
  (!this.enabled) ? this.unWireEvents() : this.eventInitializer();
@@ -24238,7 +24914,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
24238
24914
  this.notify(keyUp, { member: 'keyup', args: e });
24239
24915
  if (e.code === 'KeyX' && e.which === 88 && e.keyCode === 88 && e.ctrlKey && (this.inputElement.innerHTML === '' ||
24240
24916
  this.inputElement.innerHTML === '<br>')) {
24241
- this.inputElement.innerHTML = getEditValue('<p><br></p>', this);
24917
+ this.inputElement.innerHTML = getEditValue(getDefaultValue(this), this);
24242
24918
  }
24243
24919
  var allowedKeys = e.which === 32 || e.which === 13 || e.which === 8 || e.which === 46;
24244
24920
  if (((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys) || (this.editorMode === 'Markdown'
@@ -24250,7 +24926,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
24250
24926
  this.notify(toolbarRefresh, { args: e });
24251
24927
  }
24252
24928
  if (!isNullOrUndefined(this.placeholder)) {
24253
- this.setPlaceHolder();
24929
+ if (!(e.key === 'Enter' && e.keyCode === 13) && (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
24930
+ this.inputElement.innerHTML === '<br>')) {
24931
+ this.setPlaceHolder();
24932
+ }
24254
24933
  }
24255
24934
  };
24256
24935
  /**
@@ -24479,22 +25158,16 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
24479
25158
  }
24480
25159
  this.unWireEvents();
24481
25160
  if (this.originalElement.tagName === 'TEXTAREA') {
24482
- if (isBlazor()) {
24483
- detach(this.valueContainer);
24484
- this.valueContainer = this.element.querySelector('.e-blazor-hidden.e-control.e-richtexteditor');
24485
- }
24486
25161
  this.element.parentElement.insertBefore(this.valueContainer, this.element);
24487
25162
  this.valueContainer.id = this.getID();
24488
25163
  this.valueContainer.removeAttribute('name');
24489
25164
  detach(this.element);
24490
25165
  if (this.originalElement.innerHTML.trim() !== '') {
24491
- if (!isBlazor()) {
24492
- this.valueContainer.value = this.originalElement.innerHTML.trim();
24493
- this.setProperties({ value: (!isNullOrUndefined(this.initialValue) ? this.initialValue : null) }, true);
24494
- }
25166
+ this.valueContainer.value = this.originalElement.innerHTML.trim();
25167
+ this.setProperties({ value: (!isNullOrUndefined(this.initialValue) ? this.initialValue : null) }, true);
24495
25168
  }
24496
25169
  else {
24497
- this.valueContainer.value = !this.isBlazor() ? this.valueContainer.defaultValue : this.defaultResetValue;
25170
+ this.valueContainer.value = this.valueContainer.defaultValue;
24498
25171
  }
24499
25172
  this.element = this.valueContainer;
24500
25173
  for (var i = 0; i < this.originalElement.classList.length; i++) {
@@ -24570,12 +25243,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
24570
25243
  * @returns {Element} - specifies the element.
24571
25244
  */
24572
25245
  RichTextEditor.prototype.getContent = function () {
24573
- if (this.iframeSettings.enable && isBlazor()) {
24574
- return this.inputElement;
24575
- }
24576
- else {
24577
- return this.contentModule.getPanel();
24578
- }
25246
+ return this.contentModule.getPanel();
24579
25247
  };
24580
25248
  /**
24581
25249
  * Returns the text content as string.
@@ -24647,10 +25315,23 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
24647
25315
  for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
24648
25316
  var prop = _a[_i];
24649
25317
  switch (prop) {
25318
+ case 'enterKey':
24650
25319
  case 'value': {
24651
- var nVal = newProp[prop];
25320
+ var nVal = void 0;
25321
+ if (prop === 'enterKey') {
25322
+ if (this.value === null || this.value === '<div><br></div>' || this.value === '<p><br></p>' ||
25323
+ this.value === '<br>') {
25324
+ nVal = null;
25325
+ }
25326
+ else {
25327
+ nVal = this.value;
25328
+ }
25329
+ }
25330
+ else {
25331
+ nVal = newProp[prop];
25332
+ }
24652
25333
  var val = this.editorMode === 'HTML' ? getEditValue(nVal, this) : nVal;
24653
- if (!isNullOrUndefined(nVal) && nVal !== '') {
25334
+ if ((!isNullOrUndefined(nVal) && nVal !== '') || prop === 'enterKey') {
24654
25335
  this.value = this.serializeValue(((this.enableHtmlEncode) ? this.encode(decode(val)) : val));
24655
25336
  }
24656
25337
  this.updatePanelValue();
@@ -24816,7 +25497,18 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
24816
25497
  getTextArea.value = '';
24817
25498
  }
24818
25499
  if (this.editorMode === 'HTML') {
24819
- this.inputElement.innerHTML = '<p><br/></p>';
25500
+ if (this.enterKey === 'DIV') {
25501
+ this.inputElement.innerHTML = '<div><br/></div>';
25502
+ }
25503
+ else if (this.enterKey === 'BR') {
25504
+ this.inputElement.innerHTML = '<br/>';
25505
+ }
25506
+ else {
25507
+ this.inputElement.innerHTML = '<p><br/></p>';
25508
+ if (value === '' && this.formatter && this.inputElement) {
25509
+ this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), this.inputElement.firstElementChild, this.inputElement.firstElementChild.childElementCount);
25510
+ }
25511
+ }
24820
25512
  }
24821
25513
  else {
24822
25514
  this.inputElement.value = '';
@@ -24864,10 +25556,9 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
24864
25556
  });
24865
25557
  }
24866
25558
  this.placeHolderWrapper.innerHTML = this.placeholder;
24867
- if (this.inputElement.textContent.length === 0 &&
24868
- !isNullOrUndefined(this.inputElement.firstChild) && this.inputElement.firstChild.nodeName === 'P' &&
24869
- !isNullOrUndefined(this.inputElement.firstChild.firstChild) && this.inputElement.firstChild.firstChild.nodeName === 'BR' &&
24870
- this.inputElement.innerHTML !== '<p><br></p><p><br></p>') {
25559
+ if (this.inputElement.textContent.length === 0 && !isNullOrUndefined(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
25560
+ ((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNullOrUndefined(this.inputElement.firstChild.firstChild) &&
25561
+ this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
24871
25562
  this.placeHolderWrapper.style.display = 'block';
24872
25563
  }
24873
25564
  else {
@@ -25029,6 +25720,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
25029
25720
  var rendererFactory = this.serviceLocator.getService('rendererFactory');
25030
25721
  this.contentModule = rendererFactory.getRenderer(RenderType.Content);
25031
25722
  this.fullScreenModule = new FullScreen(this);
25723
+ this.enterKeyModule = new EnterKeyAction(this);
25032
25724
  this.renderModule.render();
25033
25725
  this.inputElement = this.contentModule.getEditPanel();
25034
25726
  this.setHeight(this.height);
@@ -25098,9 +25790,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
25098
25790
  styleEle.rel = 'stylesheet';
25099
25791
  return styleEle;
25100
25792
  };
25101
- RichTextEditor.prototype.isBlazor = function () {
25102
- return (!isBlazor() ? false : true);
25103
- };
25104
25793
  RichTextEditor.prototype.setValue = function () {
25105
25794
  if (this.valueTemplate) {
25106
25795
  if (typeof this.valueTemplate === 'string') {
@@ -25192,7 +25881,14 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
25192
25881
  }
25193
25882
  }
25194
25883
  if (target !== 'windowResize') {
25195
- setStyleAttribute(cntEle, { height: heightValue, marginTop: topValue + 'px' });
25884
+ if (this.iframeSettings.enable) {
25885
+ if (heightValue !== 'auto') {
25886
+ setStyleAttribute(cntEle, { height: heightValue, marginTop: topValue + 'px' });
25887
+ }
25888
+ }
25889
+ else {
25890
+ setStyleAttribute(cntEle, { height: heightValue, marginTop: topValue + 'px' });
25891
+ }
25196
25892
  }
25197
25893
  if (this.iframeSettings.enable && target === 'sourceCode') {
25198
25894
  var codeElement = select('.' + CLS_RTE_CONTENT, this.element);
@@ -25400,7 +26096,8 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
25400
26096
  this.isFocusOut = false;
25401
26097
  addClass([this.element], [CLS_FOCUS]);
25402
26098
  if (this.editorMode === 'HTML') {
25403
- this.cloneValue = (this.inputElement.innerHTML === '<p><br></p>') ? null : this.enableHtmlEncode ?
26099
+ this.cloneValue = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
26100
+ this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
25404
26101
  this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
25405
26102
  }
25406
26103
  else {
@@ -25449,7 +26146,8 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
25449
26146
  }
25450
26147
  var getTextArea = this.element.querySelector('.e-rte-srctextarea');
25451
26148
  if (this.editorMode === 'HTML') {
25452
- value = (this.inputElement.innerHTML === '<p><br></p>') ? null : this.enableHtmlEncode ?
26149
+ value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
26150
+ this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
25453
26151
  this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
25454
26152
  if (getTextArea && getTextArea.style.display === 'block') {
25455
26153
  value = getTextArea.value;
@@ -25633,7 +26331,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
25633
26331
  };
25634
26332
  RichTextEditor.prototype.resetHandler = function () {
25635
26333
  var defaultValue = this.valueContainer.defaultValue.trim();
25636
- this.setProperties({ value: defaultValue === '' ? null : (this.isBlazor() ? this.defaultResetValue : defaultValue) });
26334
+ this.setProperties({ value: defaultValue === '' ? null : defaultValue });
25637
26335
  };
25638
26336
  /**
25639
26337
  * @returns {void}
@@ -25849,6 +26547,12 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
25849
26547
  __decorate$1([
25850
26548
  Property(null)
25851
26549
  ], RichTextEditor.prototype, "value", void 0);
26550
+ __decorate$1([
26551
+ Property('P')
26552
+ ], RichTextEditor.prototype, "enterKey", void 0);
26553
+ __decorate$1([
26554
+ Property('BR')
26555
+ ], RichTextEditor.prototype, "shiftEnterKey", void 0);
25852
26556
  __decorate$1([
25853
26557
  Property(30)
25854
26558
  ], RichTextEditor.prototype, "undoRedoSteps", void 0);
@@ -26046,5 +26750,5 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
26046
26750
  * Rich Text Editor component exported items
26047
26751
  */
26048
26752
 
26049
- 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, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, imageCaption, imageSize, 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, pasteClean, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, afterImageDelete, drop, xhtmlValidation, beforeImageUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, closeImageDialog, showTableDialog, closeTableDialog, 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_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, 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_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_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, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, 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, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_IMAGE_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, 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 };
26753
+ 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, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, imageCaption, imageSize, 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, pasteClean, enterHandler, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, afterImageDelete, drop, xhtmlValidation, beforeImageUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, closeImageDialog, showTableDialog, closeTableDialog, 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_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, 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_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_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, 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, 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, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_IMAGE_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, 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 };
26050
26754
  //# sourceMappingURL=ej2-richtexteditor.es5.js.map