@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 @@ const readOnlyMode = 'readOnlyMode';
449
449
  * @deprecated
450
450
  */
451
451
  const pasteClean = 'pasteClean';
452
+ /**
453
+ * @hidden
454
+ * @deprecated
455
+ */
456
+ const enterHandler = 'enterHandler';
452
457
  /**
453
458
  * @hidden
454
459
  * @deprecated
@@ -1351,14 +1356,14 @@ let 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 @@ let 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'
@@ -2490,11 +2495,19 @@ function toObjectLowerCase(obj) {
2490
2495
  function getEditValue(value, rteObj) {
2491
2496
  let val;
2492
2497
  if (value !== null && value !== '') {
2493
- val = rteObj.enableHtmlEncode ? updateTextNode(decode(value)) : updateTextNode(value);
2498
+ val = rteObj.enableHtmlEncode ? updateTextNode(decode(value), rteObj) : updateTextNode(value, rteObj);
2494
2499
  rteObj.setProperties({ value: val }, true);
2495
2500
  }
2496
2501
  else {
2497
- val = rteObj.enableHtmlEncode ? '&lt;p&gt;&lt;br/&gt;&lt;/p&gt;' : '<p><br/></p>';
2502
+ if (rteObj.enterKey === 'DIV') {
2503
+ val = rteObj.enableHtmlEncode ? '&lt;div&gt;&lt;br/&gt;&lt;/div&gt;' : '<div><br/></div>';
2504
+ }
2505
+ else if (rteObj.enterKey === 'BR') {
2506
+ val = rteObj.enableHtmlEncode ? '&lt;br/&gt;' : '<br/>';
2507
+ }
2508
+ else {
2509
+ val = rteObj.enableHtmlEncode ? '&lt;p&gt;&lt;br/&gt;&lt;/p&gt;' : '<p><br/></p>';
2510
+ }
2498
2511
  }
2499
2512
  return val;
2500
2513
  }
@@ -2503,7 +2516,7 @@ function getEditValue(value, rteObj) {
2503
2516
  * @returns {string} - returns the string
2504
2517
  * @hidden
2505
2518
  */
2506
- function updateTextNode(value) {
2519
+ function updateTextNode(value, rteObj) {
2507
2520
  const tempNode = document.createElement('div');
2508
2521
  const resultElm = document.createElement('div');
2509
2522
  const childNodes = tempNode.childNodes;
@@ -2512,20 +2525,25 @@ function updateTextNode(value) {
2512
2525
  if (childNodes.length > 0) {
2513
2526
  let isPreviousInlineElem;
2514
2527
  let previousParent;
2515
- let paraElm;
2528
+ let insertElem;
2516
2529
  while (tempNode.firstChild) {
2517
- if ((tempNode.firstChild.nodeName === '#text' &&
2530
+ if (rteObj.enterKey !== 'BR' && ((tempNode.firstChild.nodeName === '#text' &&
2518
2531
  (tempNode.firstChild.textContent.indexOf('\n') < 0 || tempNode.firstChild.textContent.trim() !== '')) ||
2519
- inlineNode.indexOf(tempNode.firstChild.nodeName.toLocaleLowerCase()) >= 0) {
2532
+ inlineNode.indexOf(tempNode.firstChild.nodeName.toLocaleLowerCase()) >= 0)) {
2520
2533
  if (!isPreviousInlineElem) {
2521
- paraElm = createElement('p');
2522
- resultElm.appendChild(paraElm);
2523
- paraElm.appendChild(tempNode.firstChild);
2534
+ if (rteObj.enterKey === 'DIV') {
2535
+ insertElem = createElement('div');
2536
+ }
2537
+ else {
2538
+ insertElem = createElement('p');
2539
+ }
2540
+ resultElm.appendChild(insertElem);
2541
+ insertElem.appendChild(tempNode.firstChild);
2524
2542
  }
2525
2543
  else {
2526
2544
  previousParent.appendChild(tempNode.firstChild);
2527
2545
  }
2528
- previousParent = paraElm;
2546
+ previousParent = insertElem;
2529
2547
  isPreviousInlineElem = true;
2530
2548
  }
2531
2549
  else if (tempNode.firstChild.nodeName === '#text' && (tempNode.firstChild.textContent === '\n' ||
@@ -2550,13 +2568,34 @@ function updateTextNode(value) {
2550
2568
  }
2551
2569
  return resultElm.innerHTML;
2552
2570
  }
2571
+ /**
2572
+ * @param {IRichTextEditor} rteObj - specifies the rte object
2573
+ * @returns {string} - returns the value based on enter configuration.
2574
+ * @hidden
2575
+ */
2576
+ function getDefaultValue(rteObj) {
2577
+ let currentVal;
2578
+ if (rteObj.enterKey === 'DIV') {
2579
+ currentVal = rteObj.enableHtmlEncode ? '&lt;div&gt;&lt;br/&gt;&lt;/div&gt;' : '<div><br/></div>';
2580
+ }
2581
+ else if (rteObj.enterKey === 'BR') {
2582
+ currentVal = rteObj.enableHtmlEncode ? '&lt;br/&gt;' : '<br/>';
2583
+ }
2584
+ else {
2585
+ currentVal = rteObj.enableHtmlEncode ? '&lt;p&gt;&lt;br/&gt;&lt;/p&gt;' : '<p><br/></p>';
2586
+ }
2587
+ return currentVal;
2588
+ }
2553
2589
  /**
2554
2590
  * @param {string} value - specifies the value
2555
2591
  * @returns {boolean} - returns the boolean value
2556
2592
  * @hidden
2557
2593
  */
2558
2594
  function isEditableValueEmpty(value) {
2559
- return (value === '<p><br></p>' || value === '&lt;p&gt;&lt;br&gt;&lt;/p&gt;' || value === '') ? true : false;
2595
+ return (value === '<p><br></p>' || value === '&lt;p&gt;&lt;br&gt;&lt;/p&gt;'
2596
+ || value === '<div><br></div>' || value === '&lt;div&gt;&lt;br&gt;&lt;/div&gt;'
2597
+ || value === '<br>' || value === '&lt;br&gt;'
2598
+ || value === '') ? true : false;
2560
2599
  }
2561
2600
  /**
2562
2601
  * @param {string} value - specifies the string value
@@ -2683,7 +2722,7 @@ class ToolbarRenderer {
2683
2722
  if (!this.parent.enabled) {
2684
2723
  return;
2685
2724
  }
2686
- if (!this.parent.readonly) {
2725
+ if (!this.parent.readonly || isNullOrUndefined(args.item)) {
2687
2726
  this.parent.notify(toolbarClick, args);
2688
2727
  }
2689
2728
  this.parent.trigger('toolbarClick', args);
@@ -5244,8 +5283,7 @@ class BaseQuickToolbar {
5244
5283
  * @deprecated
5245
5284
  */
5246
5285
  showPopup(x, y, target) {
5247
- const eventArgs = isBlazor() ? { cancel: false, targetElement: target } :
5248
- { popup: this.popupObj, cancel: false, targetElement: target };
5286
+ const eventArgs = { popup: this.popupObj, cancel: false, targetElement: target };
5249
5287
  this.parent.trigger(beforeQuickToolbarOpen, eventArgs, (beforeQuickToolbarArgs) => {
5250
5288
  if (!beforeQuickToolbarArgs.cancel) {
5251
5289
  let editPanelTop;
@@ -5372,7 +5410,7 @@ class BaseQuickToolbar {
5372
5410
  this.colorPickerObj.destroyColorPicker();
5373
5411
  removeClass([this.element], [CLS_POP]);
5374
5412
  detach(element);
5375
- const args = isBlazor() ? { element: this.popupObj.element } : this.popupObj;
5413
+ const args = this.popupObj;
5376
5414
  this.parent.trigger(quickToolbarClose, args);
5377
5415
  }
5378
5416
  }
@@ -5480,7 +5518,7 @@ class PopupRenderer {
5480
5518
  this.parent = parent;
5481
5519
  }
5482
5520
  quickToolbarOpen() {
5483
- const args = isBlazor() ? { element: this.popupObj.element } : this.popupObj;
5521
+ const args = this.popupObj;
5484
5522
  this.parent.trigger(quickToolbarOpen, args);
5485
5523
  }
5486
5524
  /**
@@ -6756,10 +6794,6 @@ class Formatter {
6756
6794
  itemCollection: value
6757
6795
  };
6758
6796
  extend(args, args, items, true);
6759
- if (isBlazor()) {
6760
- delete args.item;
6761
- delete args.itemCollection;
6762
- }
6763
6797
  self.trigger(actionBegin, args, (actionBeginArgs) => {
6764
6798
  if (actionBeginArgs.cancel) {
6765
6799
  if (action === 'paste' || action === 'cut' || action === 'copy') {
@@ -6771,10 +6805,16 @@ class Formatter {
6771
6805
  const isTableModule = isNullOrUndefined(self.tableModule) ? true : self.tableModule ?
6772
6806
  self.tableModule.ensureInsideTableList : false;
6773
6807
  if ((event.which === 9 && isTableModule) || event.which !== 9) {
6808
+ if (event.which === 13 && self.editorMode === 'HTML') {
6809
+ value = {
6810
+ 'enterAction': self.enterKey
6811
+ };
6812
+ }
6774
6813
  this.editorManager.observer.notify((event.type === 'keydown' ? KEY_DOWN : KEY_UP), {
6775
6814
  event: event,
6776
6815
  callBack: this.onSuccess.bind(this, self),
6777
- value: value
6816
+ value: value,
6817
+ enterAction: self.enterKey
6778
6818
  });
6779
6819
  }
6780
6820
  }
@@ -6802,7 +6842,7 @@ class Formatter {
6802
6842
  else {
6803
6843
  this.editorManager.observer.notify(checkUndo, { subCommand: actionBeginArgs.item.subCommand });
6804
6844
  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' ?
6805
- { name: args.name } : value, ('#' + self.getID() + ' iframe'));
6845
+ { name: args.name } : value, ('#' + self.getID() + ' iframe'), self.enterKey);
6806
6846
  }
6807
6847
  }
6808
6848
  });
@@ -10164,8 +10204,8 @@ class DOMNode {
10164
10204
  this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
10165
10205
  }
10166
10206
  else if (start.tagName === 'BR') {
10167
- this.replaceWith(start, this.marker(markerClassName.startSelection, this.encode(start.textContent)));
10168
- const markerStart = range.startContainer.querySelector('.' + markerClassName.startSelection);
10207
+ this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
10208
+ const markerStart = range.startContainer.querySelector('.' + className);
10169
10209
  markerStart.appendChild(start);
10170
10210
  }
10171
10211
  else {
@@ -10406,7 +10446,7 @@ class Lists {
10406
10446
  const olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
10407
10447
  if (!isNullOrUndefined(range.startContainer.textContent.slice(0, range.startOffset))) {
10408
10448
  for (let i = 0; i < olListStartRegex.length; i++) {
10409
- if (olListStartRegex[i].test(range.startContainer.textContent.slice(0, range.startOffset).trim())) {
10449
+ if (olListStartRegex[i].test(range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim())) {
10410
10450
  return true;
10411
10451
  }
10412
10452
  }
@@ -10434,8 +10474,8 @@ class Lists {
10434
10474
  this.applyListsHandler({ subCommand: 'OL', callBack: e.callBack });
10435
10475
  e.event.preventDefault();
10436
10476
  }
10437
- else if (range.startContainer.textContent.slice(0, range.startOffset).trim() === '*' ||
10438
- range.startContainer.textContent.slice(0, range.startOffset).trim() === '-') {
10477
+ else if (range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim() === '*' ||
10478
+ range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim() === '-') {
10439
10479
  range.startContainer.textContent = range.startContainer.textContent.slice(range.startOffset, range.startContainer.textContent.length);
10440
10480
  this.applyListsHandler({ subCommand: 'UL', callBack: e.callBack });
10441
10481
  e.event.preventDefault();
@@ -10456,15 +10496,24 @@ class Lists {
10456
10496
  const startNodeParent = startNode.parentElement;
10457
10497
  if (isNullOrUndefined(startNodeParent.parentElement.closest('UL')) && isNullOrUndefined(startNodeParent.parentElement.closest('OL'))) {
10458
10498
  if (!isNullOrUndefined(startNode.nextElementSibling)) {
10459
- //startNode.classList.add('innerNode');
10460
10499
  const nearBlockNode = this.parent.domNode.blockParentNode(startNode);
10461
10500
  this.parent.nodeCutter.GetSpliceNode(range, nearBlockNode);
10462
10501
  }
10463
- const paraTag = createElement('p');
10464
- paraTag.innerHTML = '<br>';
10465
- this.parent.domNode.insertAfter(paraTag, startNodeParent);
10502
+ let insertTag;
10503
+ if (e.enterAction === 'DIV') {
10504
+ insertTag = createElement('div');
10505
+ insertTag.innerHTML = '<br>';
10506
+ }
10507
+ else if (e.enterAction === 'P') {
10508
+ insertTag = createElement('p');
10509
+ insertTag.innerHTML = '<br>';
10510
+ }
10511
+ else {
10512
+ insertTag = createElement('br');
10513
+ }
10514
+ this.parent.domNode.insertAfter(insertTag, startNodeParent);
10466
10515
  e.event.preventDefault();
10467
- this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, paraTag, 0);
10516
+ this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, insertTag, 0);
10468
10517
  if (startNodeParent.textContent === '') {
10469
10518
  detach(startNodeParent);
10470
10519
  }
@@ -10760,7 +10809,67 @@ class Lists {
10760
10809
  this.currentAction = e.subCommand;
10761
10810
  this.currentAction = e.subCommand = this.currentAction === 'NumberFormatList' ? 'OL' : this.currentAction === 'BulletFormatList' ? 'UL' : this.currentAction;
10762
10811
  this.domNode.setMarker(this.saveSelection);
10763
- const listsNodes = this.domNode.blockNodes();
10812
+ let listsNodes = this.domNode.blockNodes();
10813
+ if (e.enterAction === 'BR') {
10814
+ this.setSelectionBRConfig();
10815
+ const allSelectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument);
10816
+ const selectedNodes = this.parent.nodeSelection.getSelectionNodes(allSelectedNode);
10817
+ const currentFormatNodes = [];
10818
+ if (selectedNodes.length === 0) {
10819
+ selectedNodes.push(listsNodes[0]);
10820
+ }
10821
+ for (let i = 0; i < selectedNodes.length; i++) {
10822
+ let currentNode = selectedNodes[i];
10823
+ let previousCurrentNode;
10824
+ while (!this.parent.domNode.isBlockNode(currentNode) && currentNode !== this.parent.editableElement) {
10825
+ previousCurrentNode = currentNode;
10826
+ currentNode = currentNode.parentElement;
10827
+ }
10828
+ if (this.parent.domNode.isBlockNode(currentNode) && currentNode === this.parent.editableElement) {
10829
+ currentFormatNodes.push(previousCurrentNode);
10830
+ }
10831
+ }
10832
+ for (let i = 0; i < currentFormatNodes.length; i++) {
10833
+ if (!this.parent.domNode.isBlockNode(currentFormatNodes[i])) {
10834
+ let currentNode = currentFormatNodes[i];
10835
+ let previousNode = currentNode;
10836
+ while (currentNode === this.parent.editableElement) {
10837
+ previousNode = currentNode;
10838
+ currentNode = currentNode.parentElement;
10839
+ }
10840
+ let tempElem;
10841
+ if (this.parent.domNode.isBlockNode(previousNode.parentElement) &&
10842
+ previousNode.parentElement === this.parent.editableElement) {
10843
+ tempElem = createElement('p');
10844
+ previousNode.parentElement.insertBefore(tempElem, previousNode);
10845
+ tempElem.appendChild(previousNode);
10846
+ }
10847
+ else {
10848
+ tempElem = previousNode;
10849
+ }
10850
+ let preNode = tempElem.previousSibling;
10851
+ while (!isNullOrUndefined(preNode) && preNode.nodeName !== 'BR' &&
10852
+ !this.parent.domNode.isBlockNode(preNode)) {
10853
+ tempElem.firstChild.parentElement.insertBefore(preNode, tempElem.firstChild);
10854
+ preNode = tempElem.previousSibling;
10855
+ }
10856
+ if (!isNullOrUndefined(preNode) && preNode.nodeName === 'BR') {
10857
+ detach(preNode);
10858
+ }
10859
+ let postNode = tempElem.nextSibling;
10860
+ while (!isNullOrUndefined(postNode) && postNode.nodeName !== 'BR' &&
10861
+ !this.parent.domNode.isBlockNode(postNode)) {
10862
+ tempElem.appendChild(postNode);
10863
+ postNode = tempElem.nextSibling;
10864
+ }
10865
+ if (!isNullOrUndefined(postNode) && postNode.nodeName === 'BR') {
10866
+ detach(postNode);
10867
+ }
10868
+ }
10869
+ }
10870
+ this.setSelectionBRConfig();
10871
+ listsNodes = this.parent.domNode.blockNodes();
10872
+ }
10764
10873
  for (let i = 0; i < listsNodes.length; i++) {
10765
10874
  if (listsNodes[i].tagName === 'TABLE' && !range.collapsed) {
10766
10875
  listsNodes.splice(i, 1);
@@ -10781,6 +10890,16 @@ class Lists {
10781
10890
  });
10782
10891
  }
10783
10892
  }
10893
+ setSelectionBRConfig() {
10894
+ const startElem = this.parent.editableElement.querySelector('.' + markerClassName.startSelection);
10895
+ const endElem = this.parent.editableElement.querySelector('.' + markerClassName.endSelection);
10896
+ if (isNullOrUndefined(endElem)) {
10897
+ this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, startElem, 0);
10898
+ }
10899
+ else {
10900
+ this.parent.nodeSelection.setSelectionText(this.parent.currentDocument, startElem, endElem, 0, 0);
10901
+ }
10902
+ }
10784
10903
  applyLists(elements, type, selector, item) {
10785
10904
  if (this.isRevert(elements, type) && isNullOrUndefined(item)) {
10786
10905
  this.revertList(elements);
@@ -11121,6 +11240,7 @@ class InsertMethods {
11121
11240
  */
11122
11241
  class NodeCutter {
11123
11242
  constructor() {
11243
+ this.enterAction = 'P';
11124
11244
  this.position = -1;
11125
11245
  this.nodeSelection = new NodeSelection();
11126
11246
  }
@@ -11353,7 +11473,7 @@ class Formats {
11353
11473
  if (e.event.which === 13 && range.startContainer === endCon && endCon.nodeType !== 3) {
11354
11474
  const pTag = createElement('p');
11355
11475
  pTag.innerHTML = '<br>';
11356
- if (lastChild && lastChild.nodeName === 'BR' && (lastChild.previousSibling && lastChild.previousSibling.nodeName === 'TABLE')) {
11476
+ if (!isNullOrUndefined(lastChild) && lastChild && lastChild.nodeName === 'BR' && (lastChild.previousSibling && lastChild.previousSibling.nodeName === 'TABLE')) {
11357
11477
  endCon.replaceChild(pTag, lastChild);
11358
11478
  this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, pTag, 0);
11359
11479
  }
@@ -11396,7 +11516,7 @@ class Formats {
11396
11516
  let startParent = range.startContainer;
11397
11517
  if (!isNullOrUndefined(lastEmpty) && !isNullOrUndefined(lastBeforeBr) && isNullOrUndefined(lastEmpty.nextSibling) &&
11398
11518
  lastEmpty.nodeName === 'BR' && lastBeforeBr.nodeName === 'BR') {
11399
- this.paraFocus(range.startContainer);
11519
+ this.paraFocus(range.startContainer, e.enterAction);
11400
11520
  }
11401
11521
  else if ((startParent.textContent.charCodeAt(0) === 8203 &&
11402
11522
  startParent.textContent.length === 1) || startParent.textContent.length === 0) {
@@ -11439,11 +11559,21 @@ class Formats {
11439
11559
  range.deleteContents();
11440
11560
  }
11441
11561
  }
11442
- paraFocus(referNode) {
11443
- const pTag = createElement('p');
11444
- pTag.innerHTML = '<br>';
11445
- this.parent.domNode.insertAfter(pTag, referNode);
11446
- this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, pTag, 0);
11562
+ paraFocus(referNode, enterAction) {
11563
+ let insertTag;
11564
+ if (enterAction === 'DIV') {
11565
+ insertTag = createElement('div');
11566
+ insertTag.innerHTML = '<br>';
11567
+ }
11568
+ else if (enterAction === 'BR') {
11569
+ insertTag = createElement('br');
11570
+ }
11571
+ else {
11572
+ insertTag = createElement('p');
11573
+ insertTag.innerHTML = '<br>';
11574
+ }
11575
+ this.parent.domNode.insertAfter(insertTag, referNode);
11576
+ this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, insertTag, 0);
11447
11577
  detach(referNode.lastChild);
11448
11578
  }
11449
11579
  isNotEndCursor(preElem, range) {
@@ -11524,7 +11654,67 @@ class Formats {
11524
11654
  }
11525
11655
  let save = this.parent.nodeSelection.save(range, this.parent.currentDocument);
11526
11656
  this.parent.domNode.setMarker(save);
11527
- const formatsNodes = this.parent.domNode.blockNodes();
11657
+ let formatsNodes = this.parent.domNode.blockNodes();
11658
+ if (e.enterAction === 'BR') {
11659
+ this.setSelectionBRConfig();
11660
+ const allSelectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument);
11661
+ const selectedNodes = this.parent.nodeSelection.getSelectionNodes(allSelectedNode);
11662
+ const currentFormatNodes = [];
11663
+ if (selectedNodes.length === 0) {
11664
+ selectedNodes.push(formatsNodes[0]);
11665
+ }
11666
+ for (let i = 0; i < selectedNodes.length; i++) {
11667
+ let currentNode = selectedNodes[i];
11668
+ let previousCurrentNode;
11669
+ while (!this.parent.domNode.isBlockNode(currentNode) && currentNode !== this.parent.editableElement) {
11670
+ previousCurrentNode = currentNode;
11671
+ currentNode = currentNode.parentElement;
11672
+ }
11673
+ if (this.parent.domNode.isBlockNode(currentNode) && currentNode === this.parent.editableElement) {
11674
+ currentFormatNodes.push(previousCurrentNode);
11675
+ }
11676
+ }
11677
+ for (let i = 0; i < currentFormatNodes.length; i++) {
11678
+ if (!this.parent.domNode.isBlockNode(currentFormatNodes[i])) {
11679
+ let currentNode = currentFormatNodes[i];
11680
+ let previousNode = currentNode;
11681
+ while (currentNode === this.parent.editableElement) {
11682
+ previousNode = currentNode;
11683
+ currentNode = currentNode.parentElement;
11684
+ }
11685
+ let tempElem;
11686
+ if (this.parent.domNode.isBlockNode(previousNode.parentElement) &&
11687
+ previousNode.parentElement === this.parent.editableElement) {
11688
+ tempElem = createElement('div');
11689
+ previousNode.parentElement.insertBefore(tempElem, previousNode);
11690
+ tempElem.appendChild(previousNode);
11691
+ }
11692
+ else {
11693
+ tempElem = previousNode;
11694
+ }
11695
+ let preNode = tempElem.previousSibling;
11696
+ while (!isNullOrUndefined(preNode) && preNode.nodeName !== 'BR' &&
11697
+ !this.parent.domNode.isBlockNode(preNode)) {
11698
+ tempElem.firstChild.parentElement.insertBefore(preNode, tempElem.firstChild);
11699
+ preNode = tempElem.previousSibling;
11700
+ }
11701
+ if (!isNullOrUndefined(preNode) && preNode.nodeName === 'BR') {
11702
+ detach(preNode);
11703
+ }
11704
+ let postNode = tempElem.nextSibling;
11705
+ while (!isNullOrUndefined(postNode) && postNode.nodeName !== 'BR' &&
11706
+ !this.parent.domNode.isBlockNode(postNode)) {
11707
+ tempElem.appendChild(postNode);
11708
+ postNode = tempElem.nextSibling;
11709
+ }
11710
+ if (!isNullOrUndefined(postNode) && postNode.nodeName === 'BR') {
11711
+ detach(postNode);
11712
+ }
11713
+ }
11714
+ }
11715
+ this.setSelectionBRConfig();
11716
+ formatsNodes = this.parent.domNode.blockNodes();
11717
+ }
11528
11718
  for (let i = 0; i < formatsNodes.length; i++) {
11529
11719
  let parentNode;
11530
11720
  let replaceHTML;
@@ -11583,6 +11773,16 @@ class Formats {
11583
11773
  });
11584
11774
  }
11585
11775
  }
11776
+ setSelectionBRConfig() {
11777
+ const startElem = this.parent.editableElement.querySelector('.' + markerClassName.startSelection);
11778
+ const endElem = this.parent.editableElement.querySelector('.' + markerClassName.endSelection);
11779
+ if (isNullOrUndefined(endElem)) {
11780
+ this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, startElem, 0);
11781
+ }
11782
+ else {
11783
+ this.parent.nodeSelection.setSelectionText(this.parent.currentDocument, startElem, endElem, 0, 0);
11784
+ }
11785
+ }
11586
11786
  preFormatMerge() {
11587
11787
  const preNodes = this.parent.editableElement.querySelectorAll('PRE');
11588
11788
  if (!isNullOrUndefined(preNodes)) {
@@ -11713,7 +11913,7 @@ class InsertHtml {
11713
11913
  }
11714
11914
  else {
11715
11915
  range.deleteContents();
11716
- if (isCursor && range.startContainer.textContent === '') {
11916
+ if (isCursor && range.startContainer.textContent === '' && range.startContainer.nodeName !== 'BR') {
11717
11917
  range.startContainer.innerHTML = '';
11718
11918
  }
11719
11919
  if (Browser.isIE) {
@@ -11721,8 +11921,23 @@ class InsertHtml {
11721
11921
  frag.appendChild(node);
11722
11922
  range.insertNode(frag);
11723
11923
  }
11924
+ else if (range.startContainer.nodeType === 1 && range.startContainer.nodeName.toLowerCase() === 'hr'
11925
+ && range.endContainer.nodeName.toLowerCase() === 'hr') {
11926
+ const paraElem = range.startContainer.nextElementSibling;
11927
+ if (paraElem) {
11928
+ if (paraElem.querySelector('br')) {
11929
+ detach(paraElem.querySelector('br'));
11930
+ }
11931
+ paraElem.appendChild(node);
11932
+ }
11933
+ }
11724
11934
  else {
11725
- range.insertNode(node);
11935
+ if (range.startContainer.nodeName === 'BR') {
11936
+ range.startContainer.parentElement.insertBefore(node, range.startContainer);
11937
+ }
11938
+ else {
11939
+ range.insertNode(node);
11940
+ }
11726
11941
  }
11727
11942
  if (node.nodeType !== 3 && node.childNodes.length > 0) {
11728
11943
  nodeSelection.setSelectionText(docElement, node, node, 1, 1);
@@ -11934,6 +12149,9 @@ class InsertHtml {
11934
12149
  range.setStart(editNode.firstElementChild, editNode.firstElementChild.textContent.length);
11935
12150
  range.setEnd(editNode.firstElementChild, editNode.firstElementChild.textContent.length);
11936
12151
  }
12152
+ if (blockNode.nodeName === 'BODY' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
12153
+ blockNode = range.startContainer;
12154
+ }
11937
12155
  if (blockNode.nodeName === 'TD' || blockNode.nodeName === 'TH') {
11938
12156
  const tempSpan = createElement('span', { className: 'tempSpan' });
11939
12157
  range.insertNode(tempSpan);
@@ -12642,14 +12860,29 @@ class ImageCommand {
12642
12860
  const selectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)[0];
12643
12861
  const imgElm = (e.value === 'Replace' || isReplaced) ? e.item.selectParent[0] :
12644
12862
  (Browser.isIE ? selectedNode.previousSibling : selectedNode.previousElementSibling);
12863
+ let preventLoadCall = false;
12645
12864
  imgElm.addEventListener('load', () => {
12646
- e.callBack({
12647
- requestType: 'Images',
12648
- editorMode: 'HTML',
12649
- event: e.event,
12650
- range: this.parent.nodeSelection.getRange(this.parent.currentDocument),
12651
- elements: [imgElm]
12652
- });
12865
+ if (e.value === 'Replace' || isReplaced) {
12866
+ if (!preventLoadCall) {
12867
+ e.callBack({
12868
+ requestType: 'Images',
12869
+ editorMode: 'HTML',
12870
+ event: e.event,
12871
+ range: this.parent.nodeSelection.getRange(this.parent.currentDocument),
12872
+ elements: [imgElm]
12873
+ });
12874
+ preventLoadCall = true;
12875
+ }
12876
+ }
12877
+ else {
12878
+ e.callBack({
12879
+ requestType: 'Images',
12880
+ editorMode: 'HTML',
12881
+ event: e.event,
12882
+ range: this.parent.nodeSelection.getRange(this.parent.currentDocument),
12883
+ elements: [imgElm]
12884
+ });
12885
+ }
12653
12886
  });
12654
12887
  }
12655
12888
  }
@@ -12771,8 +13004,10 @@ class ImageCommand {
12771
13004
  const selectNode = e.item.selectNode[0];
12772
13005
  selectNode.style.height = '';
12773
13006
  selectNode.style.width = '';
12774
- selectNode.width = e.item.width;
12775
- selectNode.height = e.item.height;
13007
+ e.item.width !== 'auto' ? selectNode.style.width = formatUnit(e.item.width) :
13008
+ selectNode.removeAttribute('width');
13009
+ e.item.height !== 'auto' ? selectNode.style.height = formatUnit(e.item.height) :
13010
+ selectNode.removeAttribute('height');
12776
13011
  this.callBack(e);
12777
13012
  }
12778
13013
  imageCaption(e) {
@@ -12781,59 +13016,65 @@ class ImageCommand {
12781
13016
  }
12782
13017
  imageJustifyLeft(e) {
12783
13018
  const selectNode = e.item.selectNode[0];
12784
- selectNode.removeAttribute('class');
12785
- addClass([selectNode], 'e-rte-image');
12786
- if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
12787
- removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
12788
- addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
12789
- }
12790
- if (selectNode.parentElement.nodeName === 'A') {
12791
- removeClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
12792
- addClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
12793
- addClass([selectNode], CLASS_IMAGE_LEFT);
12794
- }
12795
- else {
12796
- addClass([selectNode], CLASS_IMAGE_LEFT);
13019
+ if (!isNullOrUndefined(selectNode)) {
13020
+ selectNode.removeAttribute('class');
13021
+ addClass([selectNode], 'e-rte-image');
13022
+ if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
13023
+ removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
13024
+ addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
13025
+ }
13026
+ if (selectNode.parentElement.nodeName === 'A') {
13027
+ removeClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
13028
+ addClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
13029
+ addClass([selectNode], CLASS_IMAGE_LEFT);
13030
+ }
13031
+ else {
13032
+ addClass([selectNode], CLASS_IMAGE_LEFT);
13033
+ }
13034
+ this.callBack(e);
12797
13035
  }
12798
- this.callBack(e);
12799
13036
  }
12800
13037
  imageJustifyCenter(e) {
12801
13038
  const selectNode = e.item.selectNode[0];
12802
- selectNode.removeAttribute('class');
12803
- addClass([selectNode], 'e-rte-image');
12804
- if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
12805
- removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
12806
- removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
12807
- addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_CENTER);
12808
- }
12809
- if (selectNode.parentElement.nodeName === 'A') {
12810
- removeClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
12811
- removeClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
12812
- addClass([selectNode.parentElement], CLASS_IMAGE_CENTER);
12813
- addClass([selectNode], CLASS_IMAGE_CENTER);
12814
- }
12815
- else {
12816
- addClass([selectNode], CLASS_IMAGE_CENTER);
13039
+ if (!isNullOrUndefined(selectNode)) {
13040
+ selectNode.removeAttribute('class');
13041
+ addClass([selectNode], 'e-rte-image');
13042
+ if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
13043
+ removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
13044
+ removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
13045
+ addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_CENTER);
13046
+ }
13047
+ if (selectNode.parentElement.nodeName === 'A') {
13048
+ removeClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
13049
+ removeClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
13050
+ addClass([selectNode.parentElement], CLASS_IMAGE_CENTER);
13051
+ addClass([selectNode], CLASS_IMAGE_CENTER);
13052
+ }
13053
+ else {
13054
+ addClass([selectNode], CLASS_IMAGE_CENTER);
13055
+ }
13056
+ this.callBack(e);
12817
13057
  }
12818
- this.callBack(e);
12819
13058
  }
12820
13059
  imageJustifyRight(e) {
12821
13060
  const selectNode = e.item.selectNode[0];
12822
- selectNode.removeAttribute('class');
12823
- addClass([selectNode], 'e-rte-image');
12824
- if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
12825
- removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
12826
- addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
12827
- }
12828
- if (selectNode.parentElement.nodeName === 'A') {
12829
- removeClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
12830
- addClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
12831
- addClass([selectNode], CLASS_IMAGE_RIGHT);
12832
- }
12833
- else {
12834
- addClass([selectNode], CLASS_IMAGE_RIGHT);
13061
+ if (!isNullOrUndefined(selectNode)) {
13062
+ selectNode.removeAttribute('class');
13063
+ addClass([selectNode], 'e-rte-image');
13064
+ if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
13065
+ removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
13066
+ addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
13067
+ }
13068
+ if (selectNode.parentElement.nodeName === 'A') {
13069
+ removeClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
13070
+ addClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
13071
+ addClass([selectNode], CLASS_IMAGE_RIGHT);
13072
+ }
13073
+ else {
13074
+ addClass([selectNode], CLASS_IMAGE_RIGHT);
13075
+ }
13076
+ this.callBack(e);
12835
13077
  }
12836
- this.callBack(e);
12837
13078
  }
12838
13079
  imageInline(e) {
12839
13080
  const selectNode = e.item.selectNode[0];
@@ -12922,7 +13163,7 @@ class TableCommand {
12922
13163
  }
12923
13164
  const tdWid = parseInt(e.item.width.width, 10) > 100 ?
12924
13165
  100 / e.item.columns : parseInt(e.item.width.width, 10) / e.item.columns;
12925
- for (let i = 0; i < e.item.row; i++) {
13166
+ for (let i = 0; i < e.item.rows; i++) {
12926
13167
  const row = createElement('tr');
12927
13168
  for (let j = 0; j < e.item.columns; j++) {
12928
13169
  const cell = createElement('td');
@@ -12938,9 +13179,19 @@ class TableCommand {
12938
13179
  this.removeEmptyNode();
12939
13180
  e.item.selection.setSelectionText(this.parent.currentDocument, table.querySelector('td'), table.querySelector('td'), 0, 0);
12940
13181
  if (table.nextElementSibling === null) {
12941
- const emptyPara = createElement('p');
12942
- emptyPara.appendChild(createElement('br'));
12943
- this.insertAfter(emptyPara, table);
13182
+ let insertElem;
13183
+ if (e.enterAction === 'DIV') {
13184
+ insertElem = createElement('div');
13185
+ insertElem.appendChild(createElement('br'));
13186
+ }
13187
+ else if (e.enterAction === 'BR') {
13188
+ insertElem = createElement('br');
13189
+ }
13190
+ else {
13191
+ insertElem = createElement('p');
13192
+ insertElem.appendChild(createElement('br'));
13193
+ }
13194
+ this.insertAfter(insertElem, table);
12944
13195
  }
12945
13196
  table.querySelector('td').classList.add('e-cell-select');
12946
13197
  if (e.callBack) {
@@ -13079,16 +13330,16 @@ class TableCommand {
13079
13330
  const curRow = closest(selectedCell, 'tr');
13080
13331
  let curCell;
13081
13332
  const allRows = closest((curRow), 'table').rows;
13082
- const colIndex = Array.prototype.slice.call(curRow.querySelectorAll('th,td')).indexOf(selectedCell);
13083
- const previousWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll('td,th').length);
13084
- const currentWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll('td,th').length + 1);
13333
+ const colIndex = Array.prototype.slice.call(curRow.querySelectorAll(':scope > td, :scope > th')).indexOf(selectedCell);
13334
+ const previousWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll(':scope > td, :scope > th').length);
13335
+ const currentWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll(':scope > td, :scope > th').length + 1);
13085
13336
  let currentTabElm = closest(curRow, 'table');
13086
13337
  let thTdElm = closest(curRow, 'table').querySelectorAll('th,td');
13087
13338
  for (let i = 0; i < thTdElm.length; i++) {
13088
13339
  thTdElm[i].dataset.oldWidth = (thTdElm[i].offsetWidth / currentTabElm.offsetWidth * 100) + "%";
13089
13340
  }
13090
13341
  for (let i = 0; i < allRows.length; i++) {
13091
- curCell = allRows[i].querySelectorAll('th,td')[colIndex];
13342
+ curCell = allRows[i].querySelectorAll(':scope > td, :scope > th')[colIndex];
13092
13343
  const colTemplate = curCell.cloneNode(true);
13093
13344
  colTemplate.innerHTML = '';
13094
13345
  colTemplate.appendChild(createElement('br'));
@@ -13621,7 +13872,7 @@ class TableCommand {
13621
13872
  // eslint-disable-next-line
13622
13873
  let _this = this;
13623
13874
  const colspan = 0;
13624
- const allRows = _this.curTable.querySelectorAll('tr');
13875
+ const allRows = _this.curTable.rows;
13625
13876
  for (let i = 0; i <= allRows.length - 1; i++) {
13626
13877
  const ele = allRows[i];
13627
13878
  let index = 0;
@@ -14017,7 +14268,8 @@ IsFormatted.inlineTags = [
14017
14268
  'sup',
14018
14269
  'tt',
14019
14270
  'u',
14020
- 'var'
14271
+ 'var',
14272
+ 'del'
14021
14273
  ];
14022
14274
 
14023
14275
  /**
@@ -14036,7 +14288,8 @@ class SelectionCommands {
14036
14288
  * @hidden
14037
14289
  * @deprecated
14038
14290
  */
14039
- static applyFormat(docElement, format, endNode, value, selector) {
14291
+ static applyFormat(docElement, format, endNode, enterAction, value, selector) {
14292
+ this.enterAction = enterAction;
14040
14293
  const validFormats = ['bold', 'italic', 'underline', 'strikethrough', 'superscript',
14041
14294
  'subscript', 'uppercase', 'lowercase', 'fontcolor', 'fontname', 'fontsize', 'backgroundcolor'];
14042
14295
  if (validFormats.indexOf(format) > -1) {
@@ -14112,7 +14365,7 @@ class SelectionCommands {
14112
14365
  save.restore();
14113
14366
  }
14114
14367
  if (isSubSup) {
14115
- this.applyFormat(docElement, format, endNode);
14368
+ this.applyFormat(docElement, format, endNode, enterAction);
14116
14369
  }
14117
14370
  }
14118
14371
  }
@@ -14132,6 +14385,10 @@ class SelectionCommands {
14132
14385
  cursorNodes[0].firstElementChild.tagName.toLowerCase() === 'br')) {
14133
14386
  cursorNodes[0].innerHTML = '';
14134
14387
  }
14388
+ if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' ||
14389
+ cursorNodes[0].nextSibling.nodeName === 'BR')) {
14390
+ detach(cursorNodes[0].nodeName === '#text' ? cursorNodes[0].nextSibling : cursorNodes[0]);
14391
+ }
14135
14392
  cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
14136
14393
  }
14137
14394
  return cursorNode;
@@ -14225,6 +14482,13 @@ class SelectionCommands {
14225
14482
  nodeCutter.SplitNode(range, textNode.parentElement, false);
14226
14483
  }
14227
14484
  }
14485
+ if (nodeTraverse.parentElement.tagName.toLocaleLowerCase() === 'span') {
14486
+ if (formatNode.style.textDecoration === 'underline' &&
14487
+ nodeTraverse.parentElement.style.textDecoration !== 'underline') {
14488
+ nodeTraverse = nodeTraverse.parentElement;
14489
+ continue;
14490
+ }
14491
+ }
14228
14492
  InsertMethods.unwrap(nodeTraverse.parentElement);
14229
14493
  nodeTraverse = !isNullOrUndefined(nodeTraverse.parentElement) && !domNode.isBlockNode(nodeTraverse.parentElement) ? textNode :
14230
14494
  nodeTraverse.parentElement;
@@ -14236,12 +14500,14 @@ class SelectionCommands {
14236
14500
  }
14237
14501
  if (child.length > 0 && isFontStyle) {
14238
14502
  for (let num = 0; num < child.length; num++) {
14239
- child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
14240
- if (num === 0) {
14241
- range.setStartBefore(child[num]);
14242
- }
14243
- else if (num === child.length - 1) {
14244
- range.setEndAfter(child[num]);
14503
+ if (child[num].nodeType !== 3 || (child[num].textContent && child[num].textContent.trim().length > 0)) {
14504
+ child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
14505
+ if (num === 0) {
14506
+ range.setStartBefore(child[num]);
14507
+ }
14508
+ else if (num === child.length - 1) {
14509
+ range.setEndAfter(child[num]);
14510
+ }
14245
14511
  }
14246
14512
  }
14247
14513
  const currentNodeElem = nodes[index].parentElement;
@@ -14338,10 +14604,12 @@ class SelectionCommands {
14338
14604
  return nodes[index];
14339
14605
  }
14340
14606
  static applyStyles(nodes, index, element) {
14341
- nodes[index] = (index === (nodes.length - 1)) || nodes[index].nodeName === 'BR' ?
14342
- InsertMethods.Wrap(nodes[index], element)
14343
- : InsertMethods.WrapBefore(nodes[index], element, true);
14344
- nodes[index] = this.getChildNode(nodes[index], element);
14607
+ if (!(nodes[index].nodeName === 'BR' && this.enterAction === 'BR')) {
14608
+ nodes[index] = (index === (nodes.length - 1)) || nodes[index].nodeName === 'BR' ?
14609
+ InsertMethods.Wrap(nodes[index], element)
14610
+ : InsertMethods.WrapBefore(nodes[index], element, true);
14611
+ nodes[index] = this.getChildNode(nodes[index], element);
14612
+ }
14345
14613
  return nodes[index];
14346
14614
  }
14347
14615
  static getInsertNode(docElement, range, format, value) {
@@ -14437,6 +14705,7 @@ class SelectionCommands {
14437
14705
  }
14438
14706
  }
14439
14707
  }
14708
+ SelectionCommands.enterAction = 'P';
14440
14709
 
14441
14710
  /**
14442
14711
  * Selection EXEC internal component
@@ -14465,12 +14734,12 @@ class SelectionBasedExec {
14465
14734
  'subscript', 'uppercase', 'lowercase'];
14466
14735
  if (e.event.ctrlKey && validFormats.indexOf(e.event.action) > -1) {
14467
14736
  e.event.preventDefault();
14468
- SelectionCommands.applyFormat(this.parent.currentDocument, e.event.action, this.parent.editableElement);
14737
+ SelectionCommands.applyFormat(this.parent.currentDocument, e.event.action, this.parent.editableElement, e.enterAction);
14469
14738
  this.callBack(e, e.event.action);
14470
14739
  }
14471
14740
  }
14472
14741
  applySelection(e) {
14473
- SelectionCommands.applyFormat(this.parent.currentDocument, e.subCommand.toLocaleLowerCase(), this.parent.editableElement, e.value, e.selector);
14742
+ SelectionCommands.applyFormat(this.parent.currentDocument, e.subCommand.toLocaleLowerCase(), this.parent.editableElement, e.enterAction, e.value, e.selector);
14474
14743
  this.callBack(e, e.subCommand);
14475
14744
  }
14476
14745
  callBack(event, action) {
@@ -14549,7 +14818,9 @@ class ClearFormat$1 {
14549
14818
  * @hidden
14550
14819
  * @deprecated
14551
14820
  */
14552
- static clear(docElement, endNode, selector) {
14821
+ static clear(docElement, endNode, enterAction, selector) {
14822
+ this.domNode = new DOMNode(endNode, docElement);
14823
+ this.defaultTag = enterAction === 'P' ? this.defaultTag : 'div';
14553
14824
  const nodeSelection = new NodeSelection();
14554
14825
  const nodeCutter = new NodeCutter();
14555
14826
  let range = nodeSelection.getRange(docElement);
@@ -14694,12 +14965,12 @@ class ClearFormat$1 {
14694
14965
  && this.IGNORE_PARENT_TAGS.indexOf(parentNodes[index1].childNodes[0].nodeName.toLocaleLowerCase()) > -1)
14695
14966
  && !(parentNodes[index1].childNodes.length === 1
14696
14967
  && parentNodes[index1].childNodes[0].nodeName.toLocaleLowerCase() === 'p')) {
14697
- InsertMethods.Wrap(parentNodes[index1], docElement.createElement('p'));
14968
+ InsertMethods.Wrap(parentNodes[index1], docElement.createElement(this.defaultTag));
14698
14969
  }
14699
14970
  const childNodes = InsertMethods.unwrap(parentNodes[index1]);
14700
14971
  if (childNodes.length === 1
14701
14972
  && childNodes[0].parentNode.nodeName.toLocaleLowerCase() === 'p') {
14702
- InsertMethods.Wrap(parentNodes[index1], docElement.createElement('p'));
14973
+ InsertMethods.Wrap(parentNodes[index1], docElement.createElement(this.defaultTag));
14703
14974
  InsertMethods.unwrap(parentNodes[index1]);
14704
14975
  }
14705
14976
  for (let index2 = 0; index2 < childNodes.length; index2++) {
@@ -14717,13 +14988,13 @@ class ClearFormat$1 {
14717
14988
  }
14718
14989
  else if (this.BLOCK_TAGS.indexOf(childNodes[index2].nodeName.toLocaleLowerCase()) > -1 &&
14719
14990
  childNodes[index2].nodeName.toLocaleLowerCase() === 'p') {
14720
- InsertMethods.Wrap(childNodes[index2], docElement.createElement('p'));
14991
+ InsertMethods.Wrap(childNodes[index2], docElement.createElement(this.defaultTag));
14721
14992
  InsertMethods.unwrap(childNodes[index2]);
14722
14993
  }
14723
14994
  }
14724
14995
  }
14725
14996
  else {
14726
- InsertMethods.Wrap(parentNodes[index1], docElement.createElement('p'));
14997
+ InsertMethods.Wrap(parentNodes[index1], docElement.createElement(this.defaultTag));
14727
14998
  InsertMethods.unwrap(parentNodes[index1]);
14728
14999
  }
14729
15000
  }
@@ -14732,10 +15003,16 @@ class ClearFormat$1 {
14732
15003
  // eslint-disable-next-line
14733
15004
  endNode) {
14734
15005
  for (let index = 0; index < textNodes.length; index++) {
14735
- if (textNodes[index].parentNode &&
14736
- IsFormatted.inlineTags.indexOf(textNodes[index].parentNode.nodeName.toLocaleLowerCase()) > -1) {
14737
- nodeCutter.GetSpliceNode(range, textNodes[index].parentNode);
14738
- this.removeInlineParent(textNodes[index].parentNode);
15006
+ let currentInlineNode = textNodes[index];
15007
+ let currentNode;
15008
+ while (!this.domNode.isBlockNode(currentInlineNode)) {
15009
+ currentNode = currentInlineNode;
15010
+ currentInlineNode = currentInlineNode.parentElement;
15011
+ }
15012
+ if (currentNode &&
15013
+ IsFormatted.inlineTags.indexOf(currentNode.nodeName.toLocaleLowerCase()) > -1) {
15014
+ nodeCutter.GetSpliceNode(range, currentNode);
15015
+ this.removeInlineParent(currentNode);
14739
15016
  }
14740
15017
  }
14741
15018
  }
@@ -14759,6 +15036,7 @@ ClearFormat$1.BLOCK_TAGS = ['address', 'article', 'aside', 'blockquote',
14759
15036
  ClearFormat$1.NONVALID_PARENT_TAGS = ['thead', 'tbody', 'ul', 'ol', 'table', 'tfoot', 'tr'];
14760
15037
  ClearFormat$1.IGNORE_PARENT_TAGS = ['ul', 'ol', 'table'];
14761
15038
  ClearFormat$1.NONVALID_TAGS = ['thead', 'tbody', 'figcaption', 'td', 'tr', 'th', 'tfoot', 'figcaption', 'li'];
15039
+ ClearFormat$1.defaultTag = 'p';
14762
15040
 
14763
15041
  /**
14764
15042
  * Clear Format EXEC internal component
@@ -14786,14 +15064,14 @@ class ClearFormatExec {
14786
15064
  onKeyDown(e) {
14787
15065
  switch (e.event.action) {
14788
15066
  case 'clear-format':
14789
- this.applyClear({ subCommand: 'ClearFormat', callBack: e.callBack });
15067
+ this.applyClear({ subCommand: 'ClearFormat', callBack: e.callBack, enterAction: e.enterAction });
14790
15068
  e.event.preventDefault();
14791
15069
  break;
14792
15070
  }
14793
15071
  }
14794
15072
  applyClear(e) {
14795
15073
  if (e.subCommand === 'ClearFormat') {
14796
- ClearFormat$1.clear(this.parent.currentDocument, this.parent.editableElement, e.selector);
15074
+ ClearFormat$1.clear(this.parent.currentDocument, this.parent.editableElement, e.enterAction, e.selector);
14797
15075
  if (e.callBack) {
14798
15076
  e.callBack({
14799
15077
  requestType: e.subCommand,
@@ -15769,15 +16047,15 @@ class EditorManager {
15769
16047
  * @deprecated
15770
16048
  */
15771
16049
  /* eslint-enable */
15772
- execCommand(command, value, event, callBack, text, exeValue, selector) {
16050
+ execCommand(command, value, event, callBack, text, exeValue, selector, enterAction) {
15773
16051
  switch (command.toLocaleLowerCase()) {
15774
16052
  case 'lists':
15775
16053
  this.observer.notify(LIST_TYPE, { subCommand: value, event: event, callBack: callBack,
15776
- selector: selector, item: exeValue });
16054
+ selector: selector, item: exeValue, enterAction: enterAction });
15777
16055
  break;
15778
16056
  case 'formats':
15779
16057
  this.observer.notify(FORMAT_TYPE, { subCommand: value, event: event, callBack: callBack,
15780
- selector: selector, exeValue: exeValue
16058
+ selector: selector, exeValue: exeValue, enterAction: enterAction
15781
16059
  });
15782
16060
  break;
15783
16061
  case 'alignments':
@@ -15806,7 +16084,7 @@ class EditorManager {
15806
16084
  case 'table':
15807
16085
  switch (value.toString().toLocaleLowerCase()) {
15808
16086
  case 'createtable':
15809
- this.observer.notify(TABLE, { item: exeValue, event: event, callBack: callBack });
16087
+ this.observer.notify(TABLE, { item: exeValue, event: event, callBack: callBack, enterAction: enterAction });
15810
16088
  break;
15811
16089
  case 'insertrowbefore':
15812
16090
  case 'insertrowafter':
@@ -15848,7 +16126,7 @@ class EditorManager {
15848
16126
  case 'style':
15849
16127
  case 'effects':
15850
16128
  case 'casing':
15851
- this.observer.notify(SELECTION_TYPE, { subCommand: value, event: event, callBack: callBack, value: text, selector: selector });
16129
+ this.observer.notify(SELECTION_TYPE, { subCommand: value, event: event, callBack: callBack, value: text, selector: selector, enterAction: enterAction });
15852
16130
  break;
15853
16131
  case 'inserthtml':
15854
16132
  this.observer.notify(INSERTHTML_TYPE, { subCommand: value, callBack: callBack, value: text });
@@ -15857,7 +16135,7 @@ class EditorManager {
15857
16135
  this.observer.notify(INSERT_TEXT_TYPE, { subCommand: value, callBack: callBack, value: text });
15858
16136
  break;
15859
16137
  case 'clear':
15860
- this.observer.notify(CLEAR_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector });
16138
+ this.observer.notify(CLEAR_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector, enterAction: enterAction });
15861
16139
  break;
15862
16140
  case 'actions':
15863
16141
  this.observer.notify(ACTION, { subCommand: value, event: event, callBack: callBack, selector: selector });
@@ -15932,7 +16210,21 @@ class ToolbarStatus {
15932
16210
  const nodeSelection = new NodeSelection();
15933
16211
  const nodes = documentNode ? [documentNode] : nodeSelection.getNodeCollection(nodeSelection.getRange(docElement));
15934
16212
  const nodesLength = nodes.length;
16213
+ let isNodeChanged = false;
16214
+ const range = nodeSelection.getRange(docElement);
15935
16215
  for (let index = 0; index < nodes.length; index++) {
16216
+ while (nodes[index].nodeType === 3 && range.startContainer.nodeType === 3 && nodes[index].parentNode &&
16217
+ nodes[index].parentNode.lastElementChild && nodes[index].parentNode.lastElementChild.nodeName !== "BR" &&
16218
+ this.getImmediateBlockNode(nodes[index].parentNode, targetNode).textContent.replace(/\u200B/g, '').length === 0 &&
16219
+ range.startContainer.textContent.replace(/\u200B/g, '').length === 0 &&
16220
+ nodeSelection.get(docElement).toString().replace(/\u200B/g, '').length === 0) {
16221
+ nodes[index] = nodes[index].parentNode.lastElementChild.firstChild;
16222
+ isNodeChanged = true;
16223
+ }
16224
+ if (isNodeChanged && nodes[index]) {
16225
+ nodeSelection.setCursorPoint(docElement, nodes[index], nodes[index].textContent.length);
16226
+ isNodeChanged = false;
16227
+ }
15936
16228
  if ((nodes[index].nodeName !== 'BR' && nodes[index].nodeType !== 3) ||
15937
16229
  (nodesLength > 1 && nodes[index].nodeType === 3 && nodes[index].textContent.trim() === '')) {
15938
16230
  nodes.splice(index, 1);
@@ -15999,6 +16291,12 @@ class ToolbarStatus {
15999
16291
  }
16000
16292
  return nodeCollection;
16001
16293
  }
16294
+ static getImmediateBlockNode(node, editNode) {
16295
+ do {
16296
+ node = node.parentNode;
16297
+ } while (node && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) < 0);
16298
+ return node;
16299
+ }
16002
16300
  static getFormatParent(docElement, formatCollection, node, targetNode, formatNode, fontSize, fontName) {
16003
16301
  if (targetNode.contains(node) ||
16004
16302
  (node.nodeType === 3 && targetNode.nodeType !== 3 && targetNode.contains(node.parentNode))) {
@@ -16468,10 +16766,10 @@ class IframeContentRender extends ContentRender {
16468
16766
  rteContent + '</body></html>';
16469
16767
  let iFrameContent = IFRAMEHEADER + iFrameBodyContent;
16470
16768
  const iframe = this.parent.createElement('iframe', {
16471
- innerHTML: iFrameContent,
16472
16769
  id: this.parent.getID() + '_rte-view',
16473
16770
  className: 'e-rte-content',
16474
- styles: 'display:block;'
16771
+ styles: 'display:block;',
16772
+ attrs: { 'srcdoc': iFrameContent }
16475
16773
  });
16476
16774
  this.setPanel(iframe);
16477
16775
  rteObj.element.appendChild(iframe);
@@ -16773,33 +17071,40 @@ class HtmlEditor {
16773
17071
  }
16774
17072
  onKeyDown(e) {
16775
17073
  let currentRange;
17074
+ let args = e.args;
16776
17075
  if (Browser.info.name === 'chrome') {
16777
17076
  currentRange = this.parent.getRange();
16778
17077
  this.backSpaceCleanup(e, currentRange);
16779
17078
  this.deleteCleanup(e, currentRange);
16780
17079
  }
16781
- if (e.args.keyCode === 9 && this.parent.enableTabKey) {
16782
- const range = this.nodeSelectionObj.getRange(this.contentRenderer.getDocument());
16783
- const parentNode = this.nodeSelectionObj.getParentNodeCollection(range);
16784
- if (!((parentNode[0].nodeName === 'LI' || closest(parentNode[0], 'li') ||
16785
- closest(parentNode[0], 'table')) && range.startOffset === 0)) {
16786
- e.args.preventDefault();
16787
- if (!e.args.shiftKey) {
16788
- InsertHtml.Insert(this.contentRenderer.getDocument(), '&nbsp;&nbsp;&nbsp;&nbsp;');
16789
- this.rangeCollection.push(this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()));
16790
- }
16791
- else if (this.rangeCollection.length > 0 &&
16792
- this.rangeCollection[this.rangeCollection.length - 1].startContainer.textContent.length === 4) {
16793
- const textCont = this.rangeCollection[this.rangeCollection.length - 1].startContainer;
16794
- this.nodeSelectionObj.setSelectionText(this.contentRenderer.getDocument(), textCont, textCont, 0, textCont.textContent.length);
16795
- InsertHtml.Insert(this.contentRenderer.getDocument(), document.createTextNode(''));
16796
- this.rangeCollection.pop();
17080
+ if (args.keyCode === 9 && this.parent.enableTabKey) {
17081
+ if (!isNullOrUndefined(args.target) && isNullOrUndefined(closest(args.target, '.e-rte-toolbar'))) {
17082
+ const range = this.nodeSelectionObj.getRange(this.contentRenderer.getDocument());
17083
+ const parentNode = this.nodeSelectionObj.getParentNodeCollection(range);
17084
+ if (!((parentNode[0].nodeName === 'LI' || closest(parentNode[0], 'li') ||
17085
+ closest(parentNode[0], 'table')) && range.startOffset === 0)) {
17086
+ args.preventDefault();
17087
+ if (!args.shiftKey) {
17088
+ InsertHtml.Insert(this.contentRenderer.getDocument(), '&nbsp;&nbsp;&nbsp;&nbsp;');
17089
+ this.rangeCollection.push(this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()));
17090
+ }
17091
+ else if (this.rangeCollection.length > 0 &&
17092
+ this.rangeCollection[this.rangeCollection.length - 1].startContainer.textContent.length === 4) {
17093
+ const textCont = this.rangeCollection[this.rangeCollection.length - 1].startContainer;
17094
+ this.nodeSelectionObj.setSelectionText(this.contentRenderer.getDocument(), textCont, textCont, 0, textCont.textContent.length);
17095
+ InsertHtml.Insert(this.contentRenderer.getDocument(), document.createTextNode(''));
17096
+ this.rangeCollection.pop();
17097
+ }
16797
17098
  }
16798
17099
  }
16799
17100
  }
16800
17101
  if (e.args.action === 'space' ||
16801
- e.args.action === 'enter') {
17102
+ e.args.action === 'enter' ||
17103
+ e.args.keyCode === 13) {
16802
17104
  this.spaceLink(e.args);
17105
+ if (this.parent.editorMode === 'HTML' && !((this.parent.shiftEnterKey === 'BR' && e.args.shiftKey))) {
17106
+ this.parent.notify(enterHandler, { args: e.args });
17107
+ }
16803
17108
  }
16804
17109
  if (e.args.action === 'space') {
16805
17110
  const currentRange = this.parent.getRange();
@@ -16841,10 +17146,11 @@ class HtmlEditor {
16841
17146
  this.oldRangeElement = null;
16842
17147
  this.deleteRangeElement = null;
16843
17148
  this.deleteOldRangeElement = null;
16844
- e.args.preventDefault();
17149
+ args.preventDefault();
16845
17150
  }
16846
17151
  }
16847
17152
  isOrderedList(editorValue) {
17153
+ editorValue = editorValue.replace(/\u200B/g, '');
16848
17154
  const olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
16849
17155
  if (!isNullOrUndefined(editorValue)) {
16850
17156
  for (let i = 0; i < olListStartRegex.length; i++) {
@@ -16856,6 +17162,7 @@ class HtmlEditor {
16856
17162
  return false;
16857
17163
  }
16858
17164
  isUnOrderedList(editorValue) {
17165
+ editorValue = editorValue.replace(/\u200B/g, '');
16859
17166
  const ulListStartRegex = [/^[*]$/, /^[-]$/];
16860
17167
  if (!isNullOrUndefined(editorValue)) {
16861
17168
  for (let i = 0; i < ulListStartRegex.length; i++) {
@@ -17041,7 +17348,7 @@ class HtmlEditor {
17041
17348
  let contentInnerElem = '';
17042
17349
  for (let i = 0; i < enterSplitText.length; i++) {
17043
17350
  if (enterSplitText[i].trim() === '') {
17044
- contentInnerElem += '<p><br></p>';
17351
+ contentInnerElem += getDefaultValue(this.parent);
17045
17352
  }
17046
17353
  else {
17047
17354
  let contentWithSpace = '';
@@ -17468,7 +17775,7 @@ class PasteCleanup {
17468
17775
  let contentInnerElem = '';
17469
17776
  for (let i = 0; i < enterSplitText.length; i++) {
17470
17777
  if (enterSplitText[i].trim() === '') {
17471
- contentInnerElem += '<p><br></p>';
17778
+ contentInnerElem += getDefaultValue(this.parent);
17472
17779
  }
17473
17780
  else {
17474
17781
  const contentWithSpace = this.makeSpace(enterSplitText[i]);
@@ -17799,7 +18106,7 @@ class PasteCleanup {
17799
18106
  dialog.hide();
17800
18107
  this.parent.height = isHeight ? preRTEHeight : this.parent.height;
17801
18108
  isHeight = false;
17802
- const argument = isBlazor() ? null : dialog;
18109
+ const argument = dialog;
17803
18110
  this.dialogRenderObj.close(argument);
17804
18111
  dialog.destroy();
17805
18112
  this.selectFormatting(value, args, keepChecked, cleanChecked);
@@ -17817,7 +18124,7 @@ class PasteCleanup {
17817
18124
  dialog.hide();
17818
18125
  this.parent.height = isHeight ? preRTEHeight : this.parent.height;
17819
18126
  isHeight = false;
17820
- const args = isBlazor() ? null : dialog;
18127
+ const args = dialog;
17821
18128
  this.dialogRenderObj.close(args);
17822
18129
  dialog.destroy();
17823
18130
  }
@@ -18237,7 +18544,7 @@ class Resize {
18237
18544
  }
18238
18545
  this.wireResizeEvents();
18239
18546
  this.parent.notify(resizeInitialized, {});
18240
- const args = isBlazor() ? { requestType: 'editor' } : { event: e, requestType: 'editor' };
18547
+ const args = { event: e, requestType: 'editor' };
18241
18548
  this.parent.trigger(resizeStart, args, (resizeStartArgs) => {
18242
18549
  if (resizeStartArgs.cancel) {
18243
18550
  this.unwireResizeEvents();
@@ -18245,7 +18552,7 @@ class Resize {
18245
18552
  });
18246
18553
  }
18247
18554
  performResize(e) {
18248
- const args = isBlazor() ? { requestType: 'editor' } : { event: e, requestType: 'editor' };
18555
+ const args = { event: e, requestType: 'editor' };
18249
18556
  this.parent.trigger(onResize, args, (resizingArgs) => {
18250
18557
  if (resizingArgs.cancel) {
18251
18558
  this.unwireResizeEvents();
@@ -18269,7 +18576,7 @@ class Resize {
18269
18576
  stopResize(e) {
18270
18577
  this.parent.refreshUI();
18271
18578
  this.unwireResizeEvents();
18272
- const args = isBlazor() ? { requestType: 'editor' } : { event: e, requestType: 'editor' };
18579
+ const args = { event: e, requestType: 'editor' };
18273
18580
  this.parent.trigger(resizeStop, args);
18274
18581
  }
18275
18582
  getEventType(e) {
@@ -18579,29 +18886,38 @@ class FullScreen {
18579
18886
  }
18580
18887
  this.scrollableParent = getScrollableParent(this.parent.element);
18581
18888
  if (!this.parent.element.classList.contains(CLS_FULL_SCREEN)) {
18582
- this.parent.trigger(actionBegin, { requestType: 'Maximize', targetItem: 'Maximize', args: event });
18583
- if (this.parent.toolbarSettings.enableFloating &&
18584
- !this.parent.inlineMode.enable && this.parent.toolbarSettings.enable) {
18585
- this.parent.getToolbarElement().style.width = '100%';
18586
- this.parent.getToolbarElement().style.top = '0px';
18587
- }
18588
- this.parent.element.classList.add(CLS_FULL_SCREEN);
18589
- this.toggleParentOverflow(true);
18590
- this.parent.setContentHeight();
18591
- if (this.parent.toolbarModule) {
18592
- if (!this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
18593
- this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
18594
- }
18595
- if (Browser.isDevice) {
18596
- this.parent.toolbarModule.removeFixedTBarClass();
18889
+ const evenArgs = {
18890
+ cancel: false,
18891
+ requestType: 'Maximize',
18892
+ targetItem: 'Maximize',
18893
+ args: event
18894
+ };
18895
+ this.parent.trigger(actionBegin, evenArgs, (beginEventArgs) => {
18896
+ if (!beginEventArgs.cancel) {
18897
+ if (this.parent.toolbarSettings.enableFloating &&
18898
+ !this.parent.inlineMode.enable && this.parent.toolbarSettings.enable) {
18899
+ this.parent.getToolbarElement().style.width = '100%';
18900
+ this.parent.getToolbarElement().style.top = '0px';
18901
+ }
18902
+ this.parent.element.classList.add(CLS_FULL_SCREEN);
18903
+ this.toggleParentOverflow(true);
18904
+ this.parent.setContentHeight();
18905
+ if (this.parent.toolbarModule) {
18906
+ if (!this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
18907
+ this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
18908
+ }
18909
+ if (Browser.isDevice) {
18910
+ this.parent.toolbarModule.removeFixedTBarClass();
18911
+ }
18912
+ this.parent.toolbarModule.updateItem({
18913
+ targetItem: 'Maximize',
18914
+ updateItem: 'Minimize',
18915
+ baseToolbar: this.parent.getBaseToolbarObject()
18916
+ });
18917
+ }
18918
+ this.parent.trigger(actionComplete, { requestType: 'Maximize', targetItem: 'Maximize', args: event });
18597
18919
  }
18598
- this.parent.toolbarModule.updateItem({
18599
- targetItem: 'Maximize',
18600
- updateItem: 'Minimize',
18601
- baseToolbar: this.parent.getBaseToolbarObject()
18602
- });
18603
- }
18604
- this.parent.trigger(actionComplete, { requestType: 'Maximize', targetItem: 'Maximize', args: event });
18920
+ });
18605
18921
  }
18606
18922
  }
18607
18923
  /**
@@ -18618,27 +18934,36 @@ class FullScreen {
18618
18934
  this.parent.quickToolbarModule.hideQuickToolbars();
18619
18935
  }
18620
18936
  if (this.parent.element.classList.contains(CLS_FULL_SCREEN)) {
18621
- this.parent.element.classList.remove(CLS_FULL_SCREEN);
18622
- const elem = document.querySelectorAll('.e-rte-overflow');
18623
- for (let i = 0; i < elem.length; i++) {
18624
- removeClass([elem[i]], ['e-rte-overflow']);
18625
- }
18626
- this.parent.trigger(actionBegin, { requestType: 'Minimize', targetItem: 'Minimize', args: event });
18627
- this.parent.setContentHeight();
18628
- if (this.parent.toolbarModule) {
18629
- if (!this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
18630
- this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
18631
- }
18632
- this.parent.toolbarModule.updateItem({
18633
- targetItem: 'Minimize',
18634
- updateItem: 'Maximize',
18635
- baseToolbar: this.parent.getBaseToolbarObject()
18636
- });
18637
- if (Browser.isDevice && this.parent.inlineMode.enable) {
18638
- this.parent.toolbarModule.addFixedTBarClass();
18937
+ const evenArgs = {
18938
+ cancel: false,
18939
+ requestType: 'Minimize',
18940
+ targetItem: 'Minimize',
18941
+ args: event
18942
+ };
18943
+ this.parent.trigger(actionBegin, evenArgs, (beginEventArgs) => {
18944
+ if (!beginEventArgs.cancel) {
18945
+ this.parent.element.classList.remove(CLS_FULL_SCREEN);
18946
+ const elem = document.querySelectorAll('.e-rte-overflow');
18947
+ for (let i = 0; i < elem.length; i++) {
18948
+ removeClass([elem[i]], ['e-rte-overflow']);
18949
+ }
18950
+ this.parent.setContentHeight();
18951
+ if (this.parent.toolbarModule) {
18952
+ if (!this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
18953
+ this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
18954
+ }
18955
+ this.parent.toolbarModule.updateItem({
18956
+ targetItem: 'Minimize',
18957
+ updateItem: 'Maximize',
18958
+ baseToolbar: this.parent.getBaseToolbarObject()
18959
+ });
18960
+ if (Browser.isDevice && this.parent.inlineMode.enable) {
18961
+ this.parent.toolbarModule.addFixedTBarClass();
18962
+ }
18963
+ }
18964
+ this.parent.trigger(actionComplete, { requestType: 'Minimize', targetItem: 'Minimize', args: event });
18639
18965
  }
18640
- }
18641
- this.parent.trigger(actionComplete, { requestType: 'Minimize', targetItem: 'Minimize', args: event });
18966
+ });
18642
18967
  }
18643
18968
  }
18644
18969
  // eslint-disable-next-line
@@ -18831,9 +19156,17 @@ class Render {
18831
19156
  const childNodes = this.parent.contentModule.getEditPanel().childNodes;
18832
19157
  if ((childNodes.length === 0) ||
18833
19158
  (childNodes.length === 1 && childNodes[0].childNodes.length === 0 && ((childNodes[0].tagName === 'BR') ||
18834
- (childNodes[0].tagName === 'P' && childNodes[0].textContent === '')))) {
19159
+ ((childNodes[0].tagName === 'P' || childNodes[0].tagName === 'DIV') && childNodes[0].textContent === '')))) {
18835
19160
  const node = this.parent.contentModule.getEditPanel();
18836
- node.innerHTML = '<p><br/></p>';
19161
+ if (this.parent.enterKey === 'DIV') {
19162
+ node.innerHTML = '<div><br/></div>';
19163
+ }
19164
+ else if (this.parent.enterKey === 'BR') {
19165
+ node.innerHTML = '<br/>';
19166
+ }
19167
+ else {
19168
+ node.innerHTML = '<p><br/></p>';
19169
+ }
18837
19170
  this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), node.childNodes[0], 0);
18838
19171
  }
18839
19172
  break;
@@ -19128,7 +19461,7 @@ class Link {
19128
19461
  }
19129
19462
  this.dialogObj.destroy();
19130
19463
  detach(this.dialogObj.element);
19131
- const args = isBlazor() ? null : this.dialogObj;
19464
+ const args = this.dialogObj;
19132
19465
  this.dialogRenderObj.close(args);
19133
19466
  this.dialogObj = null;
19134
19467
  }
@@ -19220,7 +19553,8 @@ class Link {
19220
19553
  proxy.parent.formatter.saveData();
19221
19554
  }
19222
19555
  let argsValue;
19223
- if (this.args.code === 'KeyK') {
19556
+ if (!isNullOrUndefined(this.args) &&
19557
+ this.args.code === 'KeyK') {
19224
19558
  const originalEvent = this.args;
19225
19559
  extend(this.args, { item: { command: 'Links', subCommand: 'CreateLink' }, originalEvent: originalEvent }, true);
19226
19560
  const argsVal = {
@@ -19349,6 +19683,7 @@ class Link {
19349
19683
  class Image {
19350
19684
  constructor(parent, serviceLocator) {
19351
19685
  this.isImgUploaded = false;
19686
+ this.isAllowedTypes = true;
19352
19687
  this.pageX = null;
19353
19688
  this.pageY = null;
19354
19689
  this.deletedImg = [];
@@ -19469,7 +19804,7 @@ class Image {
19469
19804
  if (Browser.isDevice) {
19470
19805
  removeClass([e.target.parentElement], 'e-mob-span');
19471
19806
  }
19472
- const args = isBlazor() ? { requestType: 'images' } : { event: e, requestType: 'images' };
19807
+ const args = { event: e, requestType: 'images' };
19473
19808
  this.parent.trigger(resizeStop, args);
19474
19809
  /* eslint-disable */
19475
19810
  let pageX = this.getPointX(e);
@@ -19522,7 +19857,7 @@ class Image {
19522
19857
  addClass([this.imgResizeDiv], 'e-mob-span');
19523
19858
  }
19524
19859
  else {
19525
- const args = isBlazor() ? { requestType: 'images' } : { event: e, requestType: 'images' };
19860
+ const args = { event: e, requestType: 'images' };
19526
19861
  this.parent.trigger(resizeStart, args, (resizeStartArgs) => {
19527
19862
  if (resizeStartArgs.cancel) {
19528
19863
  this.cancelResizeAction();
@@ -19657,6 +19992,12 @@ class Image {
19657
19992
  img.style.height = null;
19658
19993
  img.removeAttribute('height');
19659
19994
  }
19995
+ else if (img.style.width === '' && img.style.height !== '') {
19996
+ img.style.height = expectedY + 'px';
19997
+ }
19998
+ else if (img.style.width !== '' && img.style.height === '') {
19999
+ img.style.width = ((width / height * expectedY) + width / height).toString() + 'px';
20000
+ }
19660
20001
  else if (img.style.width !== '') {
19661
20002
  img.style.width = (width / height * expectedY) + 'px';
19662
20003
  img.style.height = expectedY + 'px';
@@ -19704,7 +20045,7 @@ class Image {
19704
20045
  return expected / parseFloat(getComputedStyle(parentEle).width) * 100;
19705
20046
  }
19706
20047
  imgDupMouseMove(width, height, e) {
19707
- const args = isBlazor() ? { requestType: 'images' } : { event: e, requestType: 'images' };
20048
+ const args = { event: e, requestType: 'images' };
19708
20049
  this.parent.trigger(onResize, args, (resizingArgs) => {
19709
20050
  if (resizingArgs.cancel) {
19710
20051
  this.cancelResizeAction();
@@ -20526,7 +20867,7 @@ class Image {
20526
20867
  isModal: Browser.isDevice,
20527
20868
  buttons: [{
20528
20869
  click: this.insertImageUrl.bind(selectObj),
20529
- buttonModel: { content: imgInsert, cssClass: 'e-flat e-insertImage', isPrimary: true }
20870
+ buttonModel: { content: imgInsert, cssClass: 'e-flat e-insertImage', isPrimary: true, disabled: true }
20530
20871
  },
20531
20872
  {
20532
20873
  click: (e) => {
@@ -20658,6 +20999,16 @@ class Image {
20658
20999
  className: 'e-input e-img-url',
20659
21000
  attrs: { placeholder: placeUrl, spellcheck: 'false' }
20660
21001
  });
21002
+ this.inputUrl.addEventListener('input', () => {
21003
+ if (!isNullOrUndefined(this.inputUrl)) {
21004
+ if (this.inputUrl.value.length === 0) {
21005
+ this.dialogObj.getButtons(0).element.disabled = true;
21006
+ }
21007
+ else {
21008
+ this.dialogObj.getButtons(0).element.removeAttribute('disabled');
21009
+ }
21010
+ }
21011
+ });
20661
21012
  imgUrl.appendChild(this.inputUrl);
20662
21013
  return imgUrl;
20663
21014
  }
@@ -20712,38 +21063,53 @@ class Image {
20712
21063
  const imgHeight = this.i10n.getConstant('imageHeight');
20713
21064
  const imgWidth = this.i10n.getConstant('imageWidth');
20714
21065
  const imgSizeWrap = this.parent.createElement('div', { className: 'e-img-sizewrap' });
20715
- const widthVal = (selectNode.getAttribute('width') === 'auto' ||
20716
- isNullOrUndefined(selectNode.getAttribute('width'))) ? selectNode.width : selectNode.getClientRects()[0].width;
20717
- const heightVal = (selectNode.getAttribute('height') === 'auto' ||
20718
- isNullOrUndefined(selectNode.getAttribute('height'))) ? selectNode.height : selectNode.getClientRects()[0].height;
21066
+ const widthVal = isNullOrUndefined(this.changedWidthValue) && (selectNode.style.width.toString() === 'auto' ||
21067
+ selectNode.style.width !== "") ? selectNode.style.width : !isNullOrUndefined(this.changedWidthValue) ?
21068
+ this.changedWidthValue : (parseInt(selectNode.getClientRects()[0].width.toString())).toString();
21069
+ const heightVal = isNullOrUndefined(this.changedHeightValue) && (selectNode.style.height.toString() === 'auto' ||
21070
+ selectNode.style.height !== "") ? selectNode.style.height : !isNullOrUndefined(this.changedHeightValue) ?
21071
+ this.changedHeightValue : (parseInt(selectNode.getClientRects()[0].height.toString())).toString();
21072
+ this.changedWidthValue = null;
21073
+ this.changedHeightValue = null;
20719
21074
  const content = '<div class="e-rte-label"><label>' + imgWidth +
20720
- '</label></div><div class="e-rte-field"><input type="text" data-role ="none" id="imgwidth" class="e-img-width" value=' +
21075
+ '</label></div><div class="e-rte-field"><input type="text" id="imgwidth" class="e-img-width" value=' +
20721
21076
  widthVal
20722
21077
  + ' /></div>' +
20723
21078
  '<div class="e-rte-label">' + '<label>' + imgHeight + '</label></div><div class="e-rte-field"> ' +
20724
- '<input type="text" data-role ="none" id="imgheight" class="e-img-height" value=' +
21079
+ '<input type="text" id="imgheight" class="e-img-height" value=' +
20725
21080
  heightVal
20726
21081
  + ' /></div>';
20727
21082
  const contentElem = parseHtml(content);
20728
21083
  imgSizeWrap.appendChild(contentElem);
20729
- const widthNum = new NumericTextBox({
20730
- format: '###.### px', min: this.parent.insertImageSettings.minWidth,
20731
- max: this.parent.getInsertImgMaxWidth(),
20732
- enableRtl: this.parent.enableRtl, locale: this.parent.locale
21084
+ const widthNum = new TextBox({
21085
+ value: formatUnit(widthVal),
21086
+ enableRtl: this.parent.enableRtl,
21087
+ input: (e) => {
21088
+ this.inputWidthValue = formatUnit(this.inputValue(e.value));
21089
+ }
20733
21090
  });
20734
- widthNum.isStringTemplate = true;
20735
21091
  widthNum.createElement = this.parent.createElement;
20736
21092
  widthNum.appendTo(imgSizeWrap.querySelector('#imgwidth'));
20737
- const heightNum = new NumericTextBox({
20738
- format: '###.### px', min: this.parent.insertImageSettings.minHeight,
20739
- max: this.parent.insertImageSettings.maxHeight,
20740
- enableRtl: this.parent.enableRtl, locale: this.parent.locale
21093
+ const heightNum = new TextBox({
21094
+ value: formatUnit(heightVal),
21095
+ enableRtl: this.parent.enableRtl,
21096
+ input: (e) => {
21097
+ this.inputHeightValue = formatUnit(this.inputValue(e.value));
21098
+ }
20741
21099
  });
20742
- heightNum.isStringTemplate = true;
20743
21100
  heightNum.createElement = this.parent.createElement;
20744
21101
  heightNum.appendTo(imgSizeWrap.querySelector('#imgheight'));
20745
21102
  return imgSizeWrap;
20746
21103
  }
21104
+ inputValue(value) {
21105
+ if (value === 'auto' || value.indexOf('%') !== -1 || value.indexOf('px') !== -1
21106
+ || value.match(/(\d+)/)) {
21107
+ return value;
21108
+ }
21109
+ else {
21110
+ return "auto";
21111
+ }
21112
+ }
20747
21113
  insertSize(e) {
20748
21114
  e.selection.restore();
20749
21115
  const proxy = e.selfImage;
@@ -20751,8 +21117,10 @@ class Image {
20751
21117
  proxy.parent.formatter.saveData();
20752
21118
  }
20753
21119
  const dialogEle = proxy.dialogObj.element;
20754
- const width = parseFloat(dialogEle.querySelector('.e-img-width').value);
20755
- const height = parseFloat(dialogEle.parentElement.querySelector('.e-img-height').value);
21120
+ this.changedWidthValue = this.inputWidthValue;
21121
+ this.changedHeightValue = this.inputHeightValue;
21122
+ const width = dialogEle.querySelector('.e-img-width').value;
21123
+ const height = dialogEle.parentElement.querySelector('.e-img-height').value;
20756
21124
  proxy.parent.formatter.process(this.parent, e.args, e.args, {
20757
21125
  width: width, height: height, selectNode: e.selectNode,
20758
21126
  subCommand: e.args.item.subCommand
@@ -20861,6 +21229,10 @@ class Image {
20861
21229
  }
20862
21230
  };
20863
21231
  proxy.inputUrl.setAttribute('disabled', 'true');
21232
+ if (isNullOrUndefined(proxy.parent.insertImageSettings.saveUrl) && this.isAllowedTypes
21233
+ && !isNullOrUndefined(this.dialogObj)) {
21234
+ this.dialogObj.getButtons(0).element.removeAttribute('disabled');
21235
+ }
20864
21236
  });
20865
21237
  reader.readAsDataURL(selectArgs.filesData[0].rawFile);
20866
21238
  }
@@ -20916,6 +21288,9 @@ class Image {
20916
21288
  };
20917
21289
  proxy.inputUrl.setAttribute('disabled', 'true');
20918
21290
  }
21291
+ if (e.operation === 'upload' && !isNullOrUndefined(this.dialogObj)) {
21292
+ this.dialogObj.getButtons(0).element.removeAttribute('disabled');
21293
+ }
20919
21294
  });
20920
21295
  },
20921
21296
  failure: (e) => {
@@ -20925,11 +21300,11 @@ class Image {
20925
21300
  // eslint-disable-next-line
20926
21301
  this.parent.trigger(imageRemoving, e, (e) => {
20927
21302
  proxy.isImgUploaded = false;
21303
+ this.dialogObj.getButtons(0).element.disabled = true;
20928
21304
  proxy.inputUrl.removeAttribute('disabled');
20929
21305
  if (proxy.uploadUrl) {
20930
21306
  proxy.uploadUrl.url = '';
20931
21307
  }
20932
- this.dialogObj.getButtons(0).element.removeAttribute('disabled');
20933
21308
  });
20934
21309
  }
20935
21310
  });
@@ -20942,9 +21317,10 @@ class Image {
20942
21317
  if (this.uploadObj.allowedExtensions) {
20943
21318
  if (this.uploadObj.allowedExtensions.toLocaleLowerCase().indexOf(('.' + e.type).toLocaleLowerCase()) === -1) {
20944
21319
  this.dialogObj.getButtons(0).element.setAttribute('disabled', 'disabled');
21320
+ this.isAllowedTypes = false;
20945
21321
  }
20946
21322
  else {
20947
- this.dialogObj.getButtons(0).element.removeAttribute('disabled');
21323
+ this.isAllowedTypes = true;
20948
21324
  }
20949
21325
  }
20950
21326
  }
@@ -21606,7 +21982,21 @@ class ViewSource {
21606
21982
  baseToolbar: this.parent.getBaseToolbarObject()
21607
21983
  });
21608
21984
  const serializeValue = this.parent.serializeValue(editHTML.value);
21609
- const value = (serializeValue === null || serializeValue === '') ? '<p><br/></p>' : serializeValue;
21985
+ let value;
21986
+ if (serializeValue === null || serializeValue === '') {
21987
+ if (this.parent.enterKey === 'DIV') {
21988
+ value = '<div><br/></div>';
21989
+ }
21990
+ else if (this.parent.enterKey === 'BR') {
21991
+ value = '<br/>';
21992
+ }
21993
+ else {
21994
+ value = '<p><br/></p>';
21995
+ }
21996
+ }
21997
+ else {
21998
+ value = serializeValue;
21999
+ }
21610
22000
  if (this.parent.iframeSettings.enable) {
21611
22001
  editHTML.parentElement.style.display = 'none';
21612
22002
  editHTML.style.display = 'none';
@@ -21638,9 +22028,13 @@ class ViewSource {
21638
22028
  }
21639
22029
  getTextAreaValue() {
21640
22030
  return (this.contentModule.getEditPanel().innerHTML === '<p><br></p>') ||
22031
+ (this.contentModule.getEditPanel().innerHTML === '<div><br></div>') ||
22032
+ (this.contentModule.getEditPanel().innerHTML === '<br>') ||
21641
22033
  (this.contentModule.getEditPanel().childNodes.length === 1 &&
21642
- this.contentModule.getEditPanel().childNodes[0].tagName === 'P' &&
21643
- this.contentModule.getEditPanel().innerHTML.length === 7) ? '' : this.parent.value;
22034
+ (this.contentModule.getEditPanel().childNodes[0].tagName === 'P' &&
22035
+ this.contentModule.getEditPanel().innerHTML.length === 7) ||
22036
+ (this.contentModule.getEditPanel().childNodes[0].tagName === 'DIV' &&
22037
+ this.contentModule.getEditPanel().innerHTML.length === 11)) ? '' : this.parent.value;
21644
22038
  }
21645
22039
  /**
21646
22040
  * getPanel method
@@ -21735,14 +22129,16 @@ class Table {
21735
22129
  }
21736
22130
  }
21737
22131
  afterRender() {
21738
- this.contentModule = this.rendererFactory.getRenderer(RenderType.Content);
21739
- this.parent.on(tableColorPickerChanged, this.setBGColor, this);
21740
- this.parent.on(mouseDown, this.cellSelect, this);
21741
- if (this.parent.tableSettings.resize) {
21742
- EventHandler.add(this.parent.contentModule.getEditPanel(), Browser.touchStartEvent, this.resizeStart, this);
21743
- }
21744
- if (!Browser.isDevice && this.parent.tableSettings.resize) {
21745
- EventHandler.add(this.contentModule.getEditPanel(), 'mouseover', this.resizeHelper, this);
22132
+ if (isNullOrUndefined(this.contentModule)) {
22133
+ this.contentModule = this.rendererFactory.getRenderer(RenderType.Content);
22134
+ this.parent.on(tableColorPickerChanged, this.setBGColor, this);
22135
+ this.parent.on(mouseDown, this.cellSelect, this);
22136
+ if (this.parent.tableSettings.resize) {
22137
+ EventHandler.add(this.parent.contentModule.getEditPanel(), Browser.touchStartEvent, this.resizeStart, this);
22138
+ }
22139
+ if (!Browser.isDevice && this.parent.tableSettings.resize) {
22140
+ EventHandler.add(this.contentModule.getEditPanel(), 'mouseover', this.resizeHelper, this);
22141
+ }
21746
22142
  }
21747
22143
  }
21748
22144
  dropdownSelect(e) {
@@ -21776,6 +22172,7 @@ class Table {
21776
22172
  break;
21777
22173
  case 'Dashed':
21778
22174
  case 'Alternate':
22175
+ case 'Custom':
21779
22176
  this.tableStyles(args, item.subCommand);
21780
22177
  break;
21781
22178
  case 'Merge':
@@ -21899,6 +22296,13 @@ class Table {
21899
22296
  table.classList.add(CLS_TB_ALT_BOR);
21900
22297
  /* eslint-enable */
21901
22298
  }
22299
+ if (args.args && args.args.item.cssClass) {
22300
+ const classList = args.args.item.cssClass.split(' ');
22301
+ for (let i = 0; i < classList.length; i++) {
22302
+ (table.classList.contains(classList[i])) ? table.classList.remove(classList[i]) :
22303
+ table.classList.add(classList[i]);
22304
+ }
22305
+ }
21902
22306
  this.parent.formatter.saveData();
21903
22307
  this.parent.formatter.editorManager.nodeSelection.restore();
21904
22308
  }
@@ -22115,7 +22519,7 @@ class Table {
22115
22519
  selectionObj.selection = proxy.parent.formatter.editorManager.nodeSelection.save(range, proxy.contentModule.getDocument());
22116
22520
  }
22117
22521
  const value = {
22118
- row: row, columns: col, width: {
22522
+ rows: row, columns: col, width: {
22119
22523
  minWidth: proxy.parent.tableSettings.minWidth,
22120
22524
  maxWidth: proxy.parent.tableSettings.maxWidth,
22121
22525
  width: proxy.parent.tableSettings.width
@@ -22253,8 +22657,8 @@ class Table {
22253
22657
  parentOffset = offsetParent.getBoundingClientRect();
22254
22658
  }
22255
22659
  return {
22256
- top: offset.top - parentOffset.top,
22257
- left: offset.left - parentOffset.left
22660
+ top: elem.offsetTop,
22661
+ left: elem.offsetLeft
22258
22662
  };
22259
22663
  }
22260
22664
  getPointX(e) {
@@ -22313,7 +22717,7 @@ class Table {
22313
22717
  EventHandler.add(this.helper, Browser.touchStartEvent, this.resizeStart, this);
22314
22718
  }
22315
22719
  else {
22316
- const args = isBlazor() ? { requestType: 'Table' } : { event: e, requestType: 'Table' };
22720
+ const args = { event: e, requestType: 'Table' };
22317
22721
  this.parent.trigger(resizeStart, args, (resizeStartArgs) => {
22318
22722
  if (resizeStartArgs.cancel) {
22319
22723
  this.cancelResizeAction();
@@ -22389,7 +22793,7 @@ class Table {
22389
22793
  const mouseY = (this.parent.enableRtl) ? -(pageY - this.pageY) : (pageY - this.pageY);
22390
22794
  this.pageX = pageX;
22391
22795
  this.pageY = pageY;
22392
- const args = isBlazor() ? { requestType: 'table' } : { event: e, requestType: 'table' };
22796
+ const args = { event: e, requestType: 'table' };
22393
22797
  this.parent.trigger(onResize, args, (resizingArgs) => {
22394
22798
  if (resizingArgs.cancel) {
22395
22799
  this.cancelResizeAction();
@@ -22476,7 +22880,7 @@ class Table {
22476
22880
  this.pageY = null;
22477
22881
  this.moveEle = null;
22478
22882
  }
22479
- const args = isBlazor() ? { requestType: 'table' } : { event: e, requestType: 'table' };
22883
+ const args = { event: e, requestType: 'table' };
22480
22884
  this.parent.trigger(resizeStop, args);
22481
22885
  this.parent.formatter.saveData();
22482
22886
  }
@@ -23457,6 +23861,288 @@ __decorate$4([
23457
23861
  Property(true)
23458
23862
  ], InlineMode.prototype, "onSelection", void 0);
23459
23863
 
23864
+ /**
23865
+ * `EnterKey` module is used to handle enter key press actions.
23866
+ */
23867
+ class EnterKeyAction {
23868
+ constructor(parent) {
23869
+ this.parent = parent;
23870
+ this.addEventListener();
23871
+ }
23872
+ addEventListener() {
23873
+ this.parent.on(enterHandler, this.enterHandler, this);
23874
+ this.parent.on(destroy, this.destroy, this);
23875
+ }
23876
+ destroy() {
23877
+ this.removeEventListener();
23878
+ }
23879
+ removeEventListener() {
23880
+ this.parent.off(enterHandler, this.enterHandler);
23881
+ this.parent.off(destroy, this.destroy);
23882
+ }
23883
+ getRangeNode() {
23884
+ this.range = this.parent.getRange();
23885
+ this.startNode = this.range.startContainer.nodeName === '#text' ? this.range.startContainer.parentElement :
23886
+ this.range.startContainer;
23887
+ this.endNode = this.range.endContainer.nodeName === '#text' ? this.range.endContainer.parentElement :
23888
+ this.range.endContainer;
23889
+ }
23890
+ enterHandler(e) {
23891
+ this.getRangeNode();
23892
+ if (e.args.which === 13 && e.args.code === 'Enter') {
23893
+ if (isNullOrUndefined(this.startNode.closest('LI')) && isNullOrUndefined(this.endNode.closest('LI')) && isNullOrUndefined(this.startNode.closest('TABLE')) &&
23894
+ isNullOrUndefined(this.endNode.closest('TABLE')) && isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
23895
+ const shiftKey = e.args.shiftKey;
23896
+ const actionBeginArgs = {
23897
+ cancel: false,
23898
+ name: actionBegin,
23899
+ requestType: shiftKey ? 'ShiftEnterAction' : 'EnterAction',
23900
+ originalEvent: e.args
23901
+ };
23902
+ this.parent.trigger(actionBegin, actionBeginArgs, (actionBeginArgs) => {
23903
+ if (!actionBeginArgs.cancel) {
23904
+ if (!(this.range.startOffset === this.range.endOffset && this.range.startContainer === this.range.endContainer)) {
23905
+ this.range.deleteContents();
23906
+ if (this.range.startContainer.nodeName === '#text' && this.range.startContainer.textContent.length === 0 &&
23907
+ this.range.startContainer.parentElement !== this.parent.inputElement) {
23908
+ if (this.parent.enterKey === 'BR') {
23909
+ this.range.startContainer.parentElement.innerHTML = '&#8203;';
23910
+ }
23911
+ else {
23912
+ this.range.startContainer.parentElement.innerHTML = '<br>';
23913
+ }
23914
+ }
23915
+ else if (this.range.startContainer === this.parent.inputElement && this.range.startContainer.innerHTML === '') {
23916
+ this.range.startContainer.innerHTML = '<br>';
23917
+ const focusElem = this.range.startContainer.childNodes[this.range.startOffset];
23918
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), focusElem, 0);
23919
+ }
23920
+ else if (this.parent.inputElement === this.range.startContainer) {
23921
+ const focusElem = this.range.startContainer.childNodes[this.range.startOffset];
23922
+ if (focusElem.nodeName === '#text' && focusElem.textContent.length === 0) {
23923
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), focusElem, focusElem.previousSibling.textContent.length);
23924
+ }
23925
+ else {
23926
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), focusElem, focusElem.textContent.length >= 0 ? 0 : 1);
23927
+ if (focusElem.previousSibling.textContent.length === 0) {
23928
+ detach(focusElem.previousSibling);
23929
+ }
23930
+ else if (focusElem.textContent.length === 0) {
23931
+ let currentFocusElem = focusElem.previousSibling.lastChild;
23932
+ while (currentFocusElem.nodeName !== '#text') {
23933
+ currentFocusElem = currentFocusElem.lastChild;
23934
+ }
23935
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), currentFocusElem, currentFocusElem.textContent.length);
23936
+ detach(focusElem);
23937
+ }
23938
+ else if (this.parent.enterKey !== 'BR' &&
23939
+ focusElem.previousSibling.textContent.length !== 0 && focusElem.textContent.length !== 0) {
23940
+ e.args.preventDefault();
23941
+ return;
23942
+ }
23943
+ }
23944
+ this.getRangeNode();
23945
+ }
23946
+ }
23947
+ if (this.range.startContainer === this.range.endContainer && this.range.startOffset === 0 &&
23948
+ this.range.startOffset == this.range.endOffset && this.range.startContainer === this.parent.inputElement) {
23949
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.range.startContainer.childNodes[this.range.startOffset], this.range.startOffset);
23950
+ this.getRangeNode();
23951
+ }
23952
+ if (this.parent.enterKey === 'P' || this.parent.enterKey === 'DIV' ||
23953
+ (this.parent.shiftEnterKey === 'P' && shiftKey) ||
23954
+ (this.parent.shiftEnterKey === 'DIV' && shiftKey)) {
23955
+ const nearBlockNode = this.parent.formatter.editorManager.domNode.blockParentNode(this.startNode);
23956
+ let isImageNode = false;
23957
+ if (this.range.startOffset === 0 && this.range.endOffset === 0 && !(!isNullOrUndefined(this.range.startContainer.previousSibling) && this.range.startContainer.previousSibling.nodeName === 'IMG')) {
23958
+ let isNearBlockLengthZero;
23959
+ let newElem;
23960
+ if (this.range.startContainer.nodeName === 'IMG') {
23961
+ newElem = this.createInsertElement(shiftKey);
23962
+ isImageNode = true;
23963
+ isNearBlockLengthZero = false;
23964
+ }
23965
+ else {
23966
+ if (nearBlockNode.textContent.length !== 0) {
23967
+ newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, false).cloneNode(true);
23968
+ isNearBlockLengthZero = false;
23969
+ }
23970
+ else {
23971
+ newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, true).cloneNode(true);
23972
+ isNearBlockLengthZero = true;
23973
+ }
23974
+ }
23975
+ const insertElem = this.createInsertElement(shiftKey);
23976
+ while (newElem.firstChild) {
23977
+ insertElem.appendChild(newElem.firstChild);
23978
+ }
23979
+ nearBlockNode.parentElement.insertBefore(insertElem, nearBlockNode);
23980
+ if (!isNearBlockLengthZero) {
23981
+ let currentFocusElem = insertElem;
23982
+ let finalFocusElem;
23983
+ while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text') {
23984
+ finalFocusElem = currentFocusElem;
23985
+ currentFocusElem = currentFocusElem.lastChild;
23986
+ }
23987
+ finalFocusElem.innerHTML = '<br>';
23988
+ if (!isImageNode) {
23989
+ detach(nearBlockNode);
23990
+ }
23991
+ }
23992
+ }
23993
+ else if (nearBlockNode.textContent.length === 0 && !(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG')) {
23994
+ if (!isNullOrUndefined(nearBlockNode.children[0]) && nearBlockNode.children[0].tagName !== 'BR') {
23995
+ const newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, false).cloneNode(true);
23996
+ this.parent.formatter.editorManager.domNode.insertAfter(newElem, nearBlockNode);
23997
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), newElem, newElem.textContent.length >= 0 ? 0 : 1);
23998
+ }
23999
+ else {
24000
+ const insertElem = this.createInsertElement(shiftKey);
24001
+ insertElem.innerHTML = '<br>';
24002
+ this.parent.formatter.editorManager.domNode.insertAfter(insertElem, nearBlockNode);
24003
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), insertElem, 0);
24004
+ }
24005
+ }
24006
+ else {
24007
+ const newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, true);
24008
+ if (!isNullOrUndefined(newElem.childNodes[0]) && newElem.childNodes[0].nodeName === '#text' &&
24009
+ newElem.childNodes[0].textContent.length === 0) {
24010
+ detach(newElem.childNodes[0]);
24011
+ }
24012
+ if (newElem.textContent.trim().length === 0) {
24013
+ const brElm = this.parent.createElement('br');
24014
+ this.startNode.appendChild(brElm);
24015
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.startNode, 0);
24016
+ }
24017
+ if (((this.parent.enterKey === 'P' || this.parent.enterKey === 'DIV') && !shiftKey) || ((this.parent.shiftEnterKey === 'DIV' ||
24018
+ this.parent.shiftEnterKey === 'P') && shiftKey)) {
24019
+ const insertElm = this.createInsertElement(shiftKey);
24020
+ while (newElem.firstChild) {
24021
+ insertElm.appendChild(newElem.firstChild);
24022
+ }
24023
+ this.parent.formatter.editorManager.domNode.insertAfter(insertElm, newElem);
24024
+ detach(newElem);
24025
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), insertElm, insertElm.textContent.length >= 0 ? 0 : 1);
24026
+ }
24027
+ }
24028
+ e.args.preventDefault();
24029
+ }
24030
+ if (this.parent.enterKey === 'BR' && !shiftKey) {
24031
+ let currentParent;
24032
+ if (!this.parent.formatter.editorManager.domNode.isBlockNode(this.startNode)) {
24033
+ let currentNode = this.startNode;
24034
+ let previousNode = currentNode;
24035
+ while (!this.parent.formatter.editorManager.domNode.isBlockNode(currentNode)) {
24036
+ previousNode = currentNode;
24037
+ currentNode = currentNode.parentElement;
24038
+ }
24039
+ currentParent = currentNode === this.parent.inputElement ?
24040
+ previousNode : currentNode;
24041
+ }
24042
+ else {
24043
+ currentParent = this.startNode;
24044
+ }
24045
+ let isEmptyBrInserted = false;
24046
+ if (currentParent !== this.parent.inputElement &&
24047
+ this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
24048
+ this.range.startOffset === this.range.endOffset &&
24049
+ this.range.startOffset === currentParent.textContent.length) {
24050
+ const outerBRElem = this.parent.createElement('br');
24051
+ this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
24052
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), outerBRElem, 0);
24053
+ }
24054
+ else if (!isNullOrUndefined(currentParent) && currentParent !== this.parent.inputElement && currentParent.nodeName !== 'BR') {
24055
+ if (currentParent.textContent.trim().length === 0 || (currentParent.textContent.trim().length === 1 &&
24056
+ currentParent.textContent.charCodeAt(0) === 8203)) {
24057
+ const newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, currentParent, true).cloneNode(true);
24058
+ this.parent.formatter.editorManager.domNode.insertAfter(newElem, currentParent);
24059
+ const outerBRElem = this.parent.createElement('br');
24060
+ newElem.parentElement.insertBefore(outerBRElem, newElem);
24061
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), newElem, 0);
24062
+ }
24063
+ else {
24064
+ let newElem;
24065
+ let focusElem;
24066
+ const outerBRElem = this.parent.createElement('br');
24067
+ if (this.range.startOffset === 0 && this.range.endOffset === 0 &&
24068
+ !isNullOrUndefined(currentParent.previousSibling) && currentParent.previousSibling.nodeName === 'BR') {
24069
+ focusElem = this.range.startContainer;
24070
+ newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, currentParent, false).cloneNode(true);
24071
+ this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
24072
+ this.insertFocusContent();
24073
+ let currentFocusElem = outerBRElem.nextSibling;
24074
+ while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text') {
24075
+ currentFocusElem = currentFocusElem.lastChild;
24076
+ }
24077
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), currentFocusElem, 0);
24078
+ isEmptyBrInserted = true;
24079
+ }
24080
+ else {
24081
+ newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, currentParent, true);
24082
+ newElem.parentElement.insertBefore(outerBRElem, newElem);
24083
+ this.insertFocusContent();
24084
+ }
24085
+ }
24086
+ }
24087
+ else {
24088
+ const brElm = this.parent.createElement('br');
24089
+ if (this.startNode.nodeName === 'BR' && this.endNode.nodeName === 'BR' && this.range.startOffset === 0 && this.range.startOffset === this.range.endOffset) {
24090
+ this.parent.formatter.editorManager.domNode.insertAfter(brElm, this.startNode);
24091
+ isEmptyBrInserted = true;
24092
+ }
24093
+ else {
24094
+ if (this.startNode === this.parent.inputElement && !isNullOrUndefined(this.range.startContainer.previousSibling) &&
24095
+ this.range.startContainer.previousSibling.nodeName === 'BR' && this.range.startContainer.textContent.length === 0) {
24096
+ isEmptyBrInserted = true;
24097
+ }
24098
+ this.range.insertNode(brElm);
24099
+ }
24100
+ if (isEmptyBrInserted || (!isNullOrUndefined(brElm.nextElementSibling) && brElm.nextElementSibling.tagName === 'BR') || (!isNullOrUndefined(brElm.nextSibling) && brElm.nextSibling.textContent.length > 0)) {
24101
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), !isNullOrUndefined(brElm.nextSibling) ? brElm.nextSibling : brElm, 0);
24102
+ isEmptyBrInserted = false;
24103
+ }
24104
+ else {
24105
+ const brElm2 = this.parent.createElement('br');
24106
+ this.range.insertNode(brElm2);
24107
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), brElm, 0);
24108
+ }
24109
+ }
24110
+ e.args.preventDefault();
24111
+ }
24112
+ if (this.range.startContainer.nodeName === '#text') {
24113
+ this.range.startContainer.parentElement.scrollIntoView(false);
24114
+ }
24115
+ else {
24116
+ this.range.startContainer.scrollIntoView(false);
24117
+ }
24118
+ this.parent.trigger(actionComplete, { requestType: shiftKey ? 'ShiftEnterAction' : 'EnterAction', args: e.args });
24119
+ }
24120
+ });
24121
+ }
24122
+ }
24123
+ }
24124
+ insertFocusContent() {
24125
+ if (this.range.startContainer.textContent.length === 0) {
24126
+ if (this.range.startContainer.nodeName === '#text') {
24127
+ this.range.startContainer.parentElement.innerHTML = '&#8203;';
24128
+ }
24129
+ else {
24130
+ this.range.startContainer.innerHTML = '&#8203;';
24131
+ }
24132
+ }
24133
+ }
24134
+ createInsertElement(shiftKey) {
24135
+ let insertElem;
24136
+ if ((this.parent.enterKey === 'DIV' && !shiftKey) || (this.parent.shiftEnterKey === 'DIV' && shiftKey)) {
24137
+ insertElem = this.parent.createElement('div');
24138
+ }
24139
+ else if ((this.parent.enterKey === 'P' && !shiftKey) || (this.parent.shiftEnterKey === 'P' && shiftKey)) {
24140
+ insertElem = this.parent.createElement('p');
24141
+ }
24142
+ return insertElem;
24143
+ }
24144
+ }
24145
+
23460
24146
  var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
23461
24147
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
23462
24148
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -23612,9 +24298,7 @@ let RichTextEditor = class RichTextEditor extends Component {
23612
24298
  this.htmlAttributes = { 'tabindex': this.element.getAttribute('tabindex') };
23613
24299
  this.element.removeAttribute('tabindex');
23614
24300
  }
23615
- if (!this.isBlazor()) {
23616
- this.element.innerHTML = '';
23617
- }
24301
+ this.element.innerHTML = '';
23618
24302
  const invalidAttr = ['class', 'style', 'id', 'ejs-for'];
23619
24303
  const htmlAttr = {};
23620
24304
  for (let a = 0; a < this.element.attributes.length; a++) {
@@ -23632,23 +24316,10 @@ let RichTextEditor = class RichTextEditor extends Component {
23632
24316
  const rteOuterWrapper = this.createElement('div', {
23633
24317
  className: this.element.getAttribute('class')
23634
24318
  });
23635
- if (!this.isBlazor()) {
23636
- this.element.innerHTML = '';
23637
- }
24319
+ this.element.innerHTML = '';
23638
24320
  this.element.parentElement.insertBefore(rteOuterWrapper, this.element);
23639
- if (isBlazor()) {
23640
- rteOuterWrapper.appendChild(this.element);
23641
- this.valueContainer = this.createElement('textarea', {
23642
- id: this.element.id + '-value'
23643
- });
23644
- }
23645
- else {
23646
- this.valueContainer = this.element;
23647
- }
24321
+ this.valueContainer = this.element;
23648
24322
  removeClass([this.valueContainer], this.element.getAttribute('class').split(' '));
23649
- if (this.isBlazor()) {
23650
- addClass([this.element], CLS_RTE_HIDDEN);
23651
- }
23652
24323
  this.element = rteOuterWrapper;
23653
24324
  }
23654
24325
  else {
@@ -23865,12 +24536,7 @@ let RichTextEditor = class RichTextEditor extends Component {
23865
24536
  }
23866
24537
  this.setContentHeight();
23867
24538
  if (this.value !== null) {
23868
- if (!this.isBlazor()) {
23869
- this.valueContainer.defaultValue = this.value;
23870
- }
23871
- else {
23872
- this.defaultResetValue = this.value;
23873
- }
24539
+ this.valueContainer.defaultValue = this.value;
23874
24540
  }
23875
24541
  // eslint-disable-next-line
23876
24542
  (!this.enabled) ? this.unWireEvents() : this.eventInitializer();
@@ -23973,7 +24639,7 @@ let RichTextEditor = class RichTextEditor extends Component {
23973
24639
  this.notify(keyUp, { member: 'keyup', args: e });
23974
24640
  if (e.code === 'KeyX' && e.which === 88 && e.keyCode === 88 && e.ctrlKey && (this.inputElement.innerHTML === '' ||
23975
24641
  this.inputElement.innerHTML === '<br>')) {
23976
- this.inputElement.innerHTML = getEditValue('<p><br></p>', this);
24642
+ this.inputElement.innerHTML = getEditValue(getDefaultValue(this), this);
23977
24643
  }
23978
24644
  const allowedKeys = e.which === 32 || e.which === 13 || e.which === 8 || e.which === 46;
23979
24645
  if (((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys) || (this.editorMode === 'Markdown'
@@ -23985,7 +24651,10 @@ let RichTextEditor = class RichTextEditor extends Component {
23985
24651
  this.notify(toolbarRefresh, { args: e });
23986
24652
  }
23987
24653
  if (!isNullOrUndefined(this.placeholder)) {
23988
- this.setPlaceHolder();
24654
+ if (!(e.key === 'Enter' && e.keyCode === 13) && (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
24655
+ this.inputElement.innerHTML === '<br>')) {
24656
+ this.setPlaceHolder();
24657
+ }
23989
24658
  }
23990
24659
  }
23991
24660
  /**
@@ -24213,22 +24882,16 @@ let RichTextEditor = class RichTextEditor extends Component {
24213
24882
  }
24214
24883
  this.unWireEvents();
24215
24884
  if (this.originalElement.tagName === 'TEXTAREA') {
24216
- if (isBlazor()) {
24217
- detach(this.valueContainer);
24218
- this.valueContainer = this.element.querySelector('.e-blazor-hidden.e-control.e-richtexteditor');
24219
- }
24220
24885
  this.element.parentElement.insertBefore(this.valueContainer, this.element);
24221
24886
  this.valueContainer.id = this.getID();
24222
24887
  this.valueContainer.removeAttribute('name');
24223
24888
  detach(this.element);
24224
24889
  if (this.originalElement.innerHTML.trim() !== '') {
24225
- if (!isBlazor()) {
24226
- this.valueContainer.value = this.originalElement.innerHTML.trim();
24227
- this.setProperties({ value: (!isNullOrUndefined(this.initialValue) ? this.initialValue : null) }, true);
24228
- }
24890
+ this.valueContainer.value = this.originalElement.innerHTML.trim();
24891
+ this.setProperties({ value: (!isNullOrUndefined(this.initialValue) ? this.initialValue : null) }, true);
24229
24892
  }
24230
24893
  else {
24231
- this.valueContainer.value = !this.isBlazor() ? this.valueContainer.defaultValue : this.defaultResetValue;
24894
+ this.valueContainer.value = this.valueContainer.defaultValue;
24232
24895
  }
24233
24896
  this.element = this.valueContainer;
24234
24897
  for (let i = 0; i < this.originalElement.classList.length; i++) {
@@ -24304,12 +24967,7 @@ let RichTextEditor = class RichTextEditor extends Component {
24304
24967
  * @returns {Element} - specifies the element.
24305
24968
  */
24306
24969
  getContent() {
24307
- if (this.iframeSettings.enable && isBlazor()) {
24308
- return this.inputElement;
24309
- }
24310
- else {
24311
- return this.contentModule.getPanel();
24312
- }
24970
+ return this.contentModule.getPanel();
24313
24971
  }
24314
24972
  /**
24315
24973
  * Returns the text content as string.
@@ -24380,10 +25038,23 @@ let RichTextEditor = class RichTextEditor extends Component {
24380
25038
  onPropertyChanged(newProp, oldProp) {
24381
25039
  for (const prop of Object.keys(newProp)) {
24382
25040
  switch (prop) {
25041
+ case 'enterKey':
24383
25042
  case 'value': {
24384
- const nVal = newProp[prop];
25043
+ let nVal;
25044
+ if (prop === 'enterKey') {
25045
+ if (this.value === null || this.value === '<div><br></div>' || this.value === '<p><br></p>' ||
25046
+ this.value === '<br>') {
25047
+ nVal = null;
25048
+ }
25049
+ else {
25050
+ nVal = this.value;
25051
+ }
25052
+ }
25053
+ else {
25054
+ nVal = newProp[prop];
25055
+ }
24385
25056
  const val = this.editorMode === 'HTML' ? getEditValue(nVal, this) : nVal;
24386
- if (!isNullOrUndefined(nVal) && nVal !== '') {
25057
+ if ((!isNullOrUndefined(nVal) && nVal !== '') || prop === 'enterKey') {
24387
25058
  this.value = this.serializeValue(((this.enableHtmlEncode) ? this.encode(decode(val)) : val));
24388
25059
  }
24389
25060
  this.updatePanelValue();
@@ -24549,7 +25220,18 @@ let RichTextEditor = class RichTextEditor extends Component {
24549
25220
  getTextArea.value = '';
24550
25221
  }
24551
25222
  if (this.editorMode === 'HTML') {
24552
- this.inputElement.innerHTML = '<p><br/></p>';
25223
+ if (this.enterKey === 'DIV') {
25224
+ this.inputElement.innerHTML = '<div><br/></div>';
25225
+ }
25226
+ else if (this.enterKey === 'BR') {
25227
+ this.inputElement.innerHTML = '<br/>';
25228
+ }
25229
+ else {
25230
+ this.inputElement.innerHTML = '<p><br/></p>';
25231
+ if (value === '' && this.formatter && this.inputElement) {
25232
+ this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), this.inputElement.firstElementChild, this.inputElement.firstElementChild.childElementCount);
25233
+ }
25234
+ }
24553
25235
  }
24554
25236
  else {
24555
25237
  this.inputElement.value = '';
@@ -24597,10 +25279,9 @@ let RichTextEditor = class RichTextEditor extends Component {
24597
25279
  });
24598
25280
  }
24599
25281
  this.placeHolderWrapper.innerHTML = this.placeholder;
24600
- if (this.inputElement.textContent.length === 0 &&
24601
- !isNullOrUndefined(this.inputElement.firstChild) && this.inputElement.firstChild.nodeName === 'P' &&
24602
- !isNullOrUndefined(this.inputElement.firstChild.firstChild) && this.inputElement.firstChild.firstChild.nodeName === 'BR' &&
24603
- this.inputElement.innerHTML !== '<p><br></p><p><br></p>') {
25282
+ if (this.inputElement.textContent.length === 0 && !isNullOrUndefined(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
25283
+ ((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNullOrUndefined(this.inputElement.firstChild.firstChild) &&
25284
+ this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
24604
25285
  this.placeHolderWrapper.style.display = 'block';
24605
25286
  }
24606
25287
  else {
@@ -24761,6 +25442,7 @@ let RichTextEditor = class RichTextEditor extends Component {
24761
25442
  const rendererFactory = this.serviceLocator.getService('rendererFactory');
24762
25443
  this.contentModule = rendererFactory.getRenderer(RenderType.Content);
24763
25444
  this.fullScreenModule = new FullScreen(this);
25445
+ this.enterKeyModule = new EnterKeyAction(this);
24764
25446
  this.renderModule.render();
24765
25447
  this.inputElement = this.contentModule.getEditPanel();
24766
25448
  this.setHeight(this.height);
@@ -24830,9 +25512,6 @@ let RichTextEditor = class RichTextEditor extends Component {
24830
25512
  styleEle.rel = 'stylesheet';
24831
25513
  return styleEle;
24832
25514
  }
24833
- isBlazor() {
24834
- return (!isBlazor() ? false : true);
24835
- }
24836
25515
  setValue() {
24837
25516
  if (this.valueTemplate) {
24838
25517
  if (typeof this.valueTemplate === 'string') {
@@ -24924,7 +25603,14 @@ let RichTextEditor = class RichTextEditor extends Component {
24924
25603
  }
24925
25604
  }
24926
25605
  if (target !== 'windowResize') {
24927
- setStyleAttribute(cntEle, { height: heightValue, marginTop: topValue + 'px' });
25606
+ if (this.iframeSettings.enable) {
25607
+ if (heightValue !== 'auto') {
25608
+ setStyleAttribute(cntEle, { height: heightValue, marginTop: topValue + 'px' });
25609
+ }
25610
+ }
25611
+ else {
25612
+ setStyleAttribute(cntEle, { height: heightValue, marginTop: topValue + 'px' });
25613
+ }
24928
25614
  }
24929
25615
  if (this.iframeSettings.enable && target === 'sourceCode') {
24930
25616
  const codeElement = select('.' + CLS_RTE_CONTENT, this.element);
@@ -25132,7 +25818,8 @@ let RichTextEditor = class RichTextEditor extends Component {
25132
25818
  this.isFocusOut = false;
25133
25819
  addClass([this.element], [CLS_FOCUS]);
25134
25820
  if (this.editorMode === 'HTML') {
25135
- this.cloneValue = (this.inputElement.innerHTML === '<p><br></p>') ? null : this.enableHtmlEncode ?
25821
+ this.cloneValue = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
25822
+ this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
25136
25823
  this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
25137
25824
  }
25138
25825
  else {
@@ -25181,7 +25868,8 @@ let RichTextEditor = class RichTextEditor extends Component {
25181
25868
  }
25182
25869
  const getTextArea = this.element.querySelector('.e-rte-srctextarea');
25183
25870
  if (this.editorMode === 'HTML') {
25184
- value = (this.inputElement.innerHTML === '<p><br></p>') ? null : this.enableHtmlEncode ?
25871
+ value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
25872
+ this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
25185
25873
  this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
25186
25874
  if (getTextArea && getTextArea.style.display === 'block') {
25187
25875
  value = getTextArea.value;
@@ -25363,7 +26051,7 @@ let RichTextEditor = class RichTextEditor extends Component {
25363
26051
  }
25364
26052
  resetHandler() {
25365
26053
  const defaultValue = this.valueContainer.defaultValue.trim();
25366
- this.setProperties({ value: defaultValue === '' ? null : (this.isBlazor() ? this.defaultResetValue : defaultValue) });
26054
+ this.setProperties({ value: defaultValue === '' ? null : defaultValue });
25367
26055
  }
25368
26056
  /**
25369
26057
  * @returns {void}
@@ -25579,6 +26267,12 @@ __decorate$1([
25579
26267
  __decorate$1([
25580
26268
  Property(null)
25581
26269
  ], RichTextEditor.prototype, "value", void 0);
26270
+ __decorate$1([
26271
+ Property('P')
26272
+ ], RichTextEditor.prototype, "enterKey", void 0);
26273
+ __decorate$1([
26274
+ Property('BR')
26275
+ ], RichTextEditor.prototype, "shiftEnterKey", void 0);
25582
26276
  __decorate$1([
25583
26277
  Property(30)
25584
26278
  ], RichTextEditor.prototype, "undoRedoSteps", void 0);
@@ -25774,5 +26468,5 @@ RichTextEditor = __decorate$1([
25774
26468
  * Rich Text Editor component exported items
25775
26469
  */
25776
26470
 
25777
- 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 };
26471
+ 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 };
25778
26472
  //# sourceMappingURL=ej2-richtexteditor.es2015.js.map