@syncfusion/ej2-richtexteditor 19.3.55 → 19.4.47

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 (43) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +41 -0
  2. package/.github/PULL_REQUEST_TEMPLATE/Feature.md +27 -0
  3. package/CHANGELOG.md +37 -1
  4. package/README.md +1 -1
  5. package/dist/ej2-richtexteditor.umd.min.js +2 -2
  6. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-richtexteditor.es2015.js +250 -100
  8. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  9. package/dist/es6/ej2-richtexteditor.es5.js +249 -99
  10. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  11. package/dist/global/ej2-richtexteditor.min.js +2 -2
  12. package/dist/global/ej2-richtexteditor.min.js.map +1 -1
  13. package/dist/global/index.d.ts +1 -1
  14. package/package.json +12 -12
  15. package/src/editor-manager/plugin/inserthtml.js +9 -1
  16. package/src/editor-manager/plugin/lists.js +4 -2
  17. package/src/editor-manager/plugin/ms-word-clean-up.d.ts +1 -1
  18. package/src/editor-manager/plugin/ms-word-clean-up.js +54 -20
  19. package/src/editor-manager/plugin/selection-commands.js +10 -5
  20. package/src/editor-manager/plugin/undo.js +10 -1
  21. package/src/rich-text-editor/actions/color-picker.d.ts +1 -0
  22. package/src/rich-text-editor/actions/color-picker.js +2 -1
  23. package/src/rich-text-editor/actions/dropdown-buttons.js +0 -10
  24. package/src/rich-text-editor/actions/enter-key.d.ts +1 -0
  25. package/src/rich-text-editor/actions/enter-key.js +90 -37
  26. package/src/rich-text-editor/actions/html-editor.js +4 -3
  27. package/src/rich-text-editor/actions/quick-toolbar.js +1 -1
  28. package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
  29. package/src/rich-text-editor/base/interface.d.ts +3 -1
  30. package/src/rich-text-editor/base/rich-text-editor-model.d.ts +1 -1
  31. package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -1
  32. package/src/rich-text-editor/base/rich-text-editor.js +2 -2
  33. package/src/rich-text-editor/formatter/formatter.js +3 -3
  34. package/src/rich-text-editor/models/toolbar-settings-model.d.ts +1 -1
  35. package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
  36. package/src/rich-text-editor/models/toolbar-settings.js +1 -1
  37. package/src/rich-text-editor/renderer/image-module.js +53 -7
  38. package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +1 -1
  39. package/src/rich-text-editor/renderer/toolbar-renderer.js +3 -2
  40. package/src/selection/selection.js +2 -1
  41. package/styles/rich-text-editor/_fluent-definition.scss +168 -0
  42. package/styles/rich-text-editor/_layout.scss +1 -1
  43. package/styles/rich-text-editor/icons/_fluent.scss +303 -0
@@ -2968,7 +2968,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
2968
2968
  * @hidden
2969
2969
  * @deprecated
2970
2970
  */
2971
- ToolbarRenderer.prototype.renderColorPickerDropDown = function (args, item, colorPicker) {
2971
+ ToolbarRenderer.prototype.renderColorPickerDropDown = function (args, item, colorPicker, defaultColor) {
2972
2972
  var _this = this;
2973
2973
  // eslint-disable-next-line
2974
2974
  var proxy = this;
@@ -2977,8 +2977,9 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
2977
2977
  var content = proxy.parent.createElement('span', { className: CLS_COLOR_CONTENT });
2978
2978
  var inlineEle = proxy.parent.createElement('span', { className: args.cssClass });
2979
2979
  var range;
2980
+ var initialBackgroundColor = (isNullOrUndefined(defaultColor)) ? proxy.parent.backgroundColor.default : defaultColor;
2980
2981
  inlineEle.style.borderBottomColor = (item === 'backgroundcolor') ?
2981
- proxy.parent.backgroundColor.default : proxy.parent.fontColor.default;
2982
+ initialBackgroundColor : proxy.parent.fontColor.default;
2982
2983
  content.appendChild(inlineEle);
2983
2984
  var dropDown = new DropDownButton({
2984
2985
  target: colorPicker.element.parentElement, cssClass: css,
@@ -3606,11 +3607,6 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
3606
3607
  var prop = _a[_i];
3607
3608
  switch (prop) {
3608
3609
  case 'fontFamily':
3609
- if (this.parent.inlineMode.enable) {
3610
- if (!isNullOrUndefined(this.parent.fontFamily.default)) {
3611
- this.getEditNode().style.fontFamily = this.parent.fontFamily.default;
3612
- }
3613
- }
3614
3610
  if (this.fontNameDropDown) {
3615
3611
  for (var _b = 0, _c = Object.keys(newProp.fontFamily); _b < _c.length; _b++) {
3616
3612
  var fontFamily$$1 = _c[_b];
@@ -3642,11 +3638,6 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
3642
3638
  }
3643
3639
  break;
3644
3640
  case 'fontSize':
3645
- if (this.parent.inlineMode) {
3646
- if (!isNullOrUndefined(this.parent.fontSize.default)) {
3647
- this.getEditNode().style.fontSize = this.parent.fontSize.default;
3648
- }
3649
- }
3650
3641
  if (this.fontSizeDropDown) {
3651
3642
  for (var _d = 0, _e = Object.keys(newProp.fontSize); _d < _e.length; _d++) {
3652
3643
  var fontSize$$1 = _e[_d];
@@ -5040,7 +5031,7 @@ var ColorPickerInput = /** @__PURE__ @class */ (function () {
5040
5031
  target: (targetID)
5041
5032
  };
5042
5033
  _this.backgroundColorPicker = _this.toolbarRenderer.renderColorPicker(options, 'backgroundcolor');
5043
- _this.backgroundColorDropDown = _this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', _this.backgroundColorPicker);
5034
+ _this.backgroundColorDropDown = _this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', _this.backgroundColorPicker, _this.defaultColorPicker);
5044
5035
  break;
5045
5036
  }
5046
5037
  }
@@ -5075,6 +5066,7 @@ var ColorPickerInput = /** @__PURE__ @class */ (function () {
5075
5066
  if (this.backgroundColorDropDown && !this.backgroundColorDropDown.isDestroyed) {
5076
5067
  var innerEle = this.backgroundColorDropDown.element.querySelector('.e-rte-color-content');
5077
5068
  if (innerEle) {
5069
+ this.defaultColorPicker = innerEle.children[0].style.borderBottomColor;
5078
5070
  detach(innerEle);
5079
5071
  }
5080
5072
  this.backgroundColorDropDown.destroy();
@@ -5765,7 +5757,7 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
5765
5757
  * @deprecated
5766
5758
  */
5767
5759
  QuickToolbar.prototype.showInlineQTBar = function (x, y, target) {
5768
- if (this.parent.readonly) {
5760
+ if (this.parent.readonly || target.tagName.toLowerCase() === "img") {
5769
5761
  return;
5770
5762
  }
5771
5763
  this.inlineQTBar.showPopup(x, y, target);
@@ -6917,7 +6909,7 @@ var Formatter = /** @__PURE__ @class */ (function () {
6917
6909
  || ((args.item.subCommand === 'FontName' || args.item.subCommand === 'FontSize') && args.name === 'dropDownSelect')
6918
6910
  || ((args.item.subCommand === 'BackgroundColor' || args.item.subCommand === 'FontColor')
6919
6911
  && args.name === 'colorPickerChanged'))) {
6920
- extend(args, args, { requestType: args.item.subCommand, cancel: false, itemCollection: value }, true);
6912
+ extend(args, args, { requestType: args.item.subCommand, cancel: false, itemCollection: value, selectType: args.name }, true);
6921
6913
  self.trigger(actionBegin, args, function (actionBeginArgs) {
6922
6914
  if (!actionBeginArgs.cancel) {
6923
6915
  if (_this.getUndoRedoStack().length === 0 && actionBeginArgs.item.command !== 'Links'
@@ -6935,8 +6927,8 @@ var Formatter = /** @__PURE__ @class */ (function () {
6935
6927
  }
6936
6928
  else {
6937
6929
  _this.editorManager.observer.notify(checkUndo, { subCommand: actionBeginArgs.item.subCommand });
6938
- _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' ?
6939
- { name: args.name } : value, ('#' + self.getID() + ' iframe'), self.enterKey);
6930
+ _this.editorManager.execCommand(actionBeginArgs.item.command, actionBeginArgs.item.subCommand, event, _this.onSuccess.bind(_this, self), actionBeginArgs.item.value, actionBeginArgs.item.subCommand === 'Pre' && actionBeginArgs.selectType === 'dropDownSelect' ?
6931
+ { name: actionBeginArgs.selectType } : value, ('#' + self.getID() + ' iframe'), self.enterKey);
6940
6932
  }
6941
6933
  }
6942
6934
  });
@@ -9436,7 +9428,8 @@ var NodeSelection = /** @__PURE__ @class */ (function () {
9436
9428
  || range.startContainer;
9437
9429
  var endNode = range.endContainer.childNodes[(range.endOffset > 0) ? (range.endOffset - 1) : range.endOffset]
9438
9430
  || range.endContainer;
9439
- if (startNode === endNode && startNode.childNodes.length === 0) {
9431
+ if ((startNode === endNode || (startNode.nodeName === 'BR' && startNode === range.endContainer.childNodes[range.endOffset])) &&
9432
+ startNode.childNodes.length === 0) {
9440
9433
  return [startNode];
9441
9434
  }
9442
9435
  if (range.startOffset === range.endOffset && range.startOffset !== 0 && range.startContainer.nodeName === 'PRE') {
@@ -10570,8 +10563,9 @@ var Lists = /** @__PURE__ @class */ (function () {
10570
10563
  Lists.prototype.testCurrentList = function (range) {
10571
10564
  var olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
10572
10565
  if (!isNullOrUndefined(range.startContainer.textContent.slice(0, range.startOffset))) {
10566
+ var currentContent = range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim();
10573
10567
  for (var i = 0; i < olListStartRegex.length; i++) {
10574
- if (olListStartRegex[i].test(range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim())) {
10568
+ if (olListStartRegex[i].test(currentContent) && currentContent.length === 2) {
10575
10569
  return true;
10576
10570
  }
10577
10571
  }
@@ -10613,7 +10607,8 @@ var Lists = /** @__PURE__ @class */ (function () {
10613
10607
  range.startContainer.parentElement.closest('LI');
10614
10608
  var endNode = range.endContainer.nodeName === 'LI' ? range.endContainer :
10615
10609
  range.endContainer.parentElement.closest('LI');
10616
- if (!isNullOrUndefined(startNode) && !isNullOrUndefined(endNode) && startNode === endNode && startNode.tagName === 'LI' && startNode.textContent.trim() === '') {
10610
+ if (!isNullOrUndefined(startNode) && !isNullOrUndefined(endNode) && startNode === endNode && startNode.tagName === 'LI' &&
10611
+ startNode.textContent.trim() === '' && startNode.querySelectorAll('IMG').length === 0) {
10617
10612
  if (startNode.textContent.charCodeAt(0) === 65279) {
10618
10613
  startNode.textContent = '';
10619
10614
  }
@@ -12300,7 +12295,15 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
12300
12295
  tempSpan.parentNode.replaceChild(node, tempSpan);
12301
12296
  }
12302
12297
  else {
12303
- var splitedElm = nodeCutter.GetSpliceNode(range, blockNode);
12298
+ var currentNode = nodes[nodes.length - 1];
12299
+ var splitedElm = void 0;
12300
+ if ((currentNode.nodeName === 'BR' || currentNode.nodeName === 'HR') && !isNullOrUndefined(currentNode.parentElement) &&
12301
+ currentNode.parentElement.textContent.trim().length === 0 && !node.classList.contains('pasteContent')) {
12302
+ splitedElm = currentNode;
12303
+ }
12304
+ else {
12305
+ splitedElm = nodeCutter.GetSpliceNode(range, blockNode);
12306
+ }
12304
12307
  splitedElm.parentNode.replaceChild(node, splitedElm);
12305
12308
  }
12306
12309
  }
@@ -14604,6 +14607,9 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
14604
14607
  };
14605
14608
  SelectionCommands.removeFormat = function (nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode) {
14606
14609
  var splitNode = null;
14610
+ var startText = range.startContainer.nodeName === '#text' ?
14611
+ range.startContainer.textContent.substring(range.startOffset, range.startContainer.textContent.length) :
14612
+ range.startContainer.textContent;
14607
14613
  if (!(range.startContainer === range.endContainer && range.startOffset === 0
14608
14614
  && range.endOffset === range.startContainer.length)) {
14609
14615
  var nodeIndex = [];
@@ -14703,11 +14709,13 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
14703
14709
  for (var num = 0; num < child.length; num++) {
14704
14710
  if (child[num].nodeType !== 3 || (child[num].textContent && child[num].textContent.trim().length > 0)) {
14705
14711
  child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
14706
- if (num === 0) {
14707
- range.setStartBefore(child[num]);
14708
- }
14709
- else if (num === child.length - 1) {
14710
- range.setEndAfter(child[num]);
14712
+ if (child[num].textContent === startText) {
14713
+ if (num === 0) {
14714
+ range.setStartBefore(child[num]);
14715
+ }
14716
+ else if (num === child.length - 1) {
14717
+ range.setEndAfter(child[num]);
14718
+ }
14711
14719
  }
14712
14720
  }
14713
14721
  }
@@ -15388,6 +15396,15 @@ var UndoRedoManager = /** @__PURE__ @class */ (function () {
15388
15396
  */
15389
15397
  UndoRedoManager.prototype.saveData = function (e) {
15390
15398
  var range = new NodeSelection().getRange(this.parent.currentDocument);
15399
+ var currentContainer = range.startContainer;
15400
+ for (var i = currentContainer.childNodes.length - 1; i >= 0; i--) {
15401
+ if (!isNullOrUndefined(currentContainer.childNodes[i]) && currentContainer.childNodes[i].nodeName === '#text' &&
15402
+ currentContainer.childNodes[i].textContent.length === 0 && currentContainer.childNodes[i].nodeName !== 'IMG' &&
15403
+ currentContainer.childNodes[i].nodeName !== 'BR' && currentContainer.childNodes[i].nodeName && 'HR') {
15404
+ detach(currentContainer.childNodes[i]);
15405
+ }
15406
+ }
15407
+ range = new NodeSelection().getRange(this.parent.currentDocument);
15391
15408
  var save = new NodeSelection().save(range, this.parent.currentDocument);
15392
15409
  var htmlText = this.parent.editableElement.innerHTML;
15393
15410
  var changEle = { text: htmlText, range: save };
@@ -15538,7 +15555,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
15538
15555
  this.parent.observer.on(MS_WORD_CLEANUP_PLUGIN, this.wordCleanup, this);
15539
15556
  };
15540
15557
  MsWordPaste.prototype.wordCleanup = function (e) {
15541
- var wordPasteStyleConfig = e.allowedStylePropertiesArray;
15558
+ var wordPasteStyleConfig = !isNullOrUndefined(e.allowedStylePropertiesArray) ? e.allowedStylePropertiesArray : [];
15542
15559
  var listNodes = [];
15543
15560
  var tempHTMLContent = e.args.clipboardData.getData('text/HTML');
15544
15561
  var rtfData = e.args.clipboardData.getData('text/rtf');
@@ -15962,8 +15979,10 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
15962
15979
  this.listContents = [];
15963
15980
  this.getListContent(listNodes[i]);
15964
15981
  var type = void 0;
15982
+ var listStyleType = void 0;
15965
15983
  if (!isNullOrUndefined(this.listContents[0])) {
15966
15984
  type = this.listContents[0].trim().length > 1 ? 'ol' : 'ul';
15985
+ listStyleType = this.getlistStyleType(this.listContents[0], type);
15967
15986
  var tempNode = [];
15968
15987
  for (var j = 1; j < this.listContents.length; j++) {
15969
15988
  tempNode.push(this.listContents[j]);
@@ -15980,7 +15999,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
15980
15999
  }
15981
16000
  }
15982
16001
  collection.push({ listType: type, content: tempNode, nestedLevel: level, class: currentClassName,
15983
- listStyle: currentListStyle });
16002
+ listStyle: currentListStyle, listStyleTypeName: listStyleType });
15984
16003
  }
15985
16004
  }
15986
16005
  stNode = listNodes.shift();
@@ -16004,6 +16023,45 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
16004
16023
  }
16005
16024
  }
16006
16025
  };
16026
+ MsWordPaste.prototype.getlistStyleType = function (listContent, type) {
16027
+ var currentListClass;
16028
+ if (type === 'ol') {
16029
+ switch (listContent.split('.')[0]) {
16030
+ case "A":
16031
+ currentListClass = "upper-alpha";
16032
+ break;
16033
+ case "a":
16034
+ currentListClass = "lower-alpha";
16035
+ break;
16036
+ case "I":
16037
+ currentListClass = "upper-roman";
16038
+ break;
16039
+ case "i":
16040
+ currentListClass = "lower-roman";
16041
+ break;
16042
+ case "α":
16043
+ currentListClass = "lower-greek";
16044
+ break;
16045
+ default:
16046
+ currentListClass = "decimal";
16047
+ break;
16048
+ }
16049
+ }
16050
+ else {
16051
+ switch (listContent.split('.')[0]) {
16052
+ case "o":
16053
+ currentListClass = "circle";
16054
+ break;
16055
+ case "§":
16056
+ currentListClass = "square";
16057
+ break;
16058
+ default:
16059
+ currentListClass = "disc";
16060
+ break;
16061
+ }
16062
+ }
16063
+ return currentListClass;
16064
+ };
16007
16065
  MsWordPaste.prototype.makeConversion = function (collection) {
16008
16066
  var root = createElement('div');
16009
16067
  var temp;
@@ -16020,7 +16078,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
16020
16078
  prevList.appendChild(pElement);
16021
16079
  temp.appendChild(prevList);
16022
16080
  temp.setAttribute('level', collection[index].nestedLevel.toString());
16023
- temp.style.listStyle = this.getListStyle(collection[index].listType, collection[index].nestedLevel);
16081
+ temp.style.listStyleType = collection[index].listStyleTypeName;
16024
16082
  }
16025
16083
  else if (collection[index].nestedLevel === pLevel) {
16026
16084
  if (prevList.parentElement.tagName.toLowerCase() === collection[index].listType) {
@@ -16029,6 +16087,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
16029
16087
  }
16030
16088
  else {
16031
16089
  temp = createElement(collection[index].listType);
16090
+ temp.style.listStyleType = collection[index].listStyleTypeName;
16032
16091
  prevList.parentElement.parentElement.appendChild(temp);
16033
16092
  prevList = createElement('li');
16034
16093
  prevList.appendChild(pElement);
@@ -16040,14 +16099,15 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
16040
16099
  if (!isNullOrUndefined(prevList)) {
16041
16100
  for (var j = 0; j < collection[index].nestedLevel - pLevel; j++) {
16042
16101
  prevList.appendChild(temp = createElement(collection[index].listType));
16043
- prevList = createElement('li', { styles: 'list-style-type: none;' });
16102
+ prevList = createElement('li');
16103
+ if (j != collection[index].nestedLevel - pLevel - 1 && collection[index].nestedLevel - pLevel > 1) {
16104
+ prevList.style.listStyleType = "none";
16105
+ }
16044
16106
  temp.appendChild(prevList);
16045
16107
  }
16046
16108
  prevList.appendChild(pElement);
16047
16109
  temp.setAttribute('level', collection[index].nestedLevel.toString());
16048
- temp.style.listStyle = this.getListStyle(collection[index].listType, collection[index].nestedLevel);
16049
- temp.childNodes[0].style.listStyle =
16050
- this.getListStyle(collection[index].listType, collection[index].nestedLevel);
16110
+ temp.style.listStyleType = collection[index].listStyleTypeName;
16051
16111
  }
16052
16112
  else {
16053
16113
  root.appendChild(temp = createElement(collection[index].listType));
@@ -16055,7 +16115,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
16055
16115
  prevList.appendChild(pElement);
16056
16116
  temp.appendChild(prevList);
16057
16117
  temp.setAttribute('level', collection[index].nestedLevel.toString());
16058
- temp.style.listStyle = this.getListStyle(collection[index].listType, collection[index].nestedLevel);
16118
+ temp.style.listStyleType = collection[index].listStyleTypeName;
16059
16119
  }
16060
16120
  }
16061
16121
  else if (collection[index].nestedLevel === 1) {
@@ -16064,12 +16124,12 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
16064
16124
  }
16065
16125
  else {
16066
16126
  root.appendChild(temp = createElement(collection[index].listType));
16127
+ temp.style.listStyleType = collection[index].listStyleTypeName;
16067
16128
  }
16068
16129
  prevList = createElement('li');
16069
16130
  prevList.appendChild(pElement);
16070
16131
  temp.appendChild(prevList);
16071
16132
  temp.setAttribute('level', collection[index].nestedLevel.toString());
16072
- temp.style.listStyle = this.getListStyle(collection[index].listType, collection[index].nestedLevel);
16073
16133
  }
16074
16134
  else {
16075
16135
  elem = prevList;
@@ -16090,7 +16150,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
16090
16150
  prevList.appendChild(pElement);
16091
16151
  temp.appendChild(prevList);
16092
16152
  temp.setAttribute('level', collection[index].nestedLevel.toString());
16093
- temp.style.listStyle = this.getListStyle(collection[index].listType, collection[index].nestedLevel);
16153
+ temp.style.listStyleType = collection[index].listStyleTypeName;
16094
16154
  break;
16095
16155
  }
16096
16156
  }
@@ -16099,21 +16159,12 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
16099
16159
  }
16100
16160
  prevList.setAttribute('class', collection[index].class);
16101
16161
  var currentStyle = prevList.getAttribute('style');
16102
- prevList.setAttribute('style', (!isNullOrUndefined(currentStyle) ? currentStyle : '') + collection[index].listStyle);
16162
+ prevList.setAttribute('style', (!isNullOrUndefined(currentStyle) ? currentStyle : ''));
16103
16163
  pLevel = collection[index].nestedLevel;
16104
16164
  listCount++;
16105
16165
  }
16106
16166
  return root;
16107
16167
  };
16108
- MsWordPaste.prototype.getListStyle = function (listType, nestedLevel) {
16109
- nestedLevel = (nestedLevel > 0) ? nestedLevel - 1 : nestedLevel;
16110
- if (listType === 'ol') {
16111
- return (nestedLevel < this.olData.length ? this.olData[nestedLevel] : this.olData[0]);
16112
- }
16113
- else {
16114
- return (nestedLevel < this.ulData.length ? this.ulData[nestedLevel] : this.ulData[0]);
16115
- }
16116
- };
16117
16168
  MsWordPaste.prototype.getListContent = function (elem) {
16118
16169
  var pushContent = '';
16119
16170
  var firstChild = elem.firstElementChild;
@@ -17007,7 +17058,7 @@ var XhtmlValidation = /** @__PURE__ @class */ (function () {
17007
17058
  this.ImageTags();
17008
17059
  this.removeTags();
17009
17060
  this.RemoveUnsupported();
17010
- this.currentElement.innerHTML = this.selfEncloseValidation(this.currentElement.innerHTML, this.currentElement.innerText === '\n' ?
17061
+ this.currentElement.innerHTML = this.selfEncloseValidation(this.currentElement.innerHTML, this.currentElement.innerText === "\n" ?
17011
17062
  this.currentElement.innerText.length : this.currentElement.innerText.trim().length);
17012
17063
  this.parent.setProperties({ value: this.currentElement.innerHTML }, true);
17013
17064
  }
@@ -17293,7 +17344,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
17293
17344
  e.args.action === 'enter' ||
17294
17345
  e.args.keyCode === 13) {
17295
17346
  this.spaceLink(e.args);
17296
- if (this.parent.editorMode === 'HTML' && !((this.parent.shiftEnterKey === 'BR' && e.args.shiftKey))) {
17347
+ if (this.parent.editorMode === 'HTML' && !this.parent.readonly) {
17297
17348
  this.parent.notify(enterHandler, { args: e.args });
17298
17349
  }
17299
17350
  }
@@ -17373,7 +17424,8 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
17373
17424
  if (this.rangeElement.tagName === 'OL' || this.rangeElement.tagName === 'UL') {
17374
17425
  var liElement = this.getRangeLiNode(currentRange.startContainer);
17375
17426
  if (liElement.previousElementSibling && liElement.previousElementSibling.childElementCount > 0) {
17376
- this.oldRangeElement = liElement.previousElementSibling.lastElementChild;
17427
+ this.oldRangeElement = liElement.previousElementSibling.lastElementChild.nodeName === 'BR' ?
17428
+ liElement.previousElementSibling : liElement.previousElementSibling.lastElementChild;
17377
17429
  if (!isNullOrUndefined(liElement.lastElementChild)) {
17378
17430
  this.rangeElement = liElement.lastElementChild;
17379
17431
  isLiElement = true;
@@ -17570,7 +17622,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
17570
17622
  var divElement = this.parent.createElement('div');
17571
17623
  divElement.setAttribute('class', 'pasteContent');
17572
17624
  divElement.style.display = 'inline';
17573
- divElement.innerHTML = contentInnerElem;
17625
+ divElement.innerHTML = contentInnerElem.replace('&para', '&amp;para');
17574
17626
  var paraElem = divElement.querySelectorAll('span, p');
17575
17627
  for (var i = 0; i < paraElem.length; i++) {
17576
17628
  var splitTextContent = paraElem[i].innerHTML.split(' ');
@@ -20190,7 +20242,7 @@ var Image = /** @__PURE__ @class */ (function () {
20190
20242
  left: elem.offsetLeft
20191
20243
  };
20192
20244
  };
20193
- Image.prototype.setAspectRatio = function (img, expectedX, expectedY) {
20245
+ Image.prototype.setAspectRatio = function (img, expectedX, expectedY, e) {
20194
20246
  if (isNullOrUndefined(img.width)) {
20195
20247
  return;
20196
20248
  }
@@ -20214,10 +20266,14 @@ var Image = /** @__PURE__ @class */ (function () {
20214
20266
  img.style.height = expectedY + 'px';
20215
20267
  }
20216
20268
  else if (img.style.width !== '' && img.style.height === '') {
20217
- img.style.width = ((width / height * expectedY) + width / height).toString() + 'px';
20269
+ var currentWidth = ((width / height * expectedY) + width / height) < (this.parent.inputElement.getBoundingClientRect().right - 32) ?
20270
+ ((width / height * expectedY) + width / height) : (this.parent.inputElement.getBoundingClientRect().right - 32);
20271
+ img.style.width = currentWidth.toString() + 'px';
20218
20272
  }
20219
20273
  else if (img.style.width !== '') {
20220
- img.style.width = (width / height * expectedY) + 'px';
20274
+ var currentWidth = (width / height * expectedY) < (this.parent.inputElement.getBoundingClientRect().right - 32) ?
20275
+ (width / height * expectedY) : (this.parent.inputElement.getBoundingClientRect().right - 32);
20276
+ img.style.width = currentWidth + 'px';
20221
20277
  img.style.height = expectedY + 'px';
20222
20278
  }
20223
20279
  else {
@@ -20240,7 +20296,7 @@ var Image = /** @__PURE__ @class */ (function () {
20240
20296
  img.style.height = (height / width * expectedX) + 'px';
20241
20297
  }
20242
20298
  else {
20243
- img.setAttribute('width', expectedX.toString());
20299
+ img.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - img.getBoundingClientRect().left).toString() : expectedX.toString());
20244
20300
  }
20245
20301
  }
20246
20302
  else {
@@ -20281,7 +20337,7 @@ var Image = /** @__PURE__ @class */ (function () {
20281
20337
  return;
20282
20338
  }
20283
20339
  _this.imgEle.parentElement.style.cursor = 'pointer';
20284
- _this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10));
20340
+ _this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10), args);
20285
20341
  _this.resizeImgDupPos(_this.imgEle);
20286
20342
  _this.imgResizePos(_this.imgEle, _this.imgResizeDiv);
20287
20343
  _this.parent.setContentHeight('', false);
@@ -20326,7 +20382,8 @@ var Image = /** @__PURE__ @class */ (function () {
20326
20382
  };
20327
20383
  Image.prototype.resizeImgDupPos = function (e) {
20328
20384
  this.imgDupPos = {
20329
- width: (e.style.height !== '') ? this.imgEle.style.width : e.width + 'px',
20385
+ width: (e.style.width !== '' && (this.parent.insertImageSettings &&
20386
+ !this.parent.insertImageSettings.resizeByPercent)) ? this.imgEle.style.width : e.width + 'px',
20330
20387
  height: (e.style.height !== '') ? this.imgEle.style.height : e.height + 'px'
20331
20388
  };
20332
20389
  };
@@ -20494,6 +20551,27 @@ var Image = /** @__PURE__ @class */ (function () {
20494
20551
  var src = this.deletedImg[i].src;
20495
20552
  this.imageRemovePost(src);
20496
20553
  }
20554
+ if (range.startContainer.nodeType === 3) {
20555
+ if (originalEvent.code === 'Backspace') {
20556
+ if (range.startContainer.previousElementSibling && range.startOffset === 0 &&
20557
+ range.startContainer.previousElementSibling.classList.contains(CLS_CAPTION) &&
20558
+ range.startContainer.previousElementSibling.classList.contains(CLS_CAPINLINE)) {
20559
+ detach(range.startContainer.previousElementSibling);
20560
+ }
20561
+ }
20562
+ else {
20563
+ if (range.startContainer.nextElementSibling &&
20564
+ range.endContainer.textContent.length === range.endOffset &&
20565
+ range.startContainer.nextElementSibling.classList.contains(CLS_CAPTION) &&
20566
+ range.startContainer.nextElementSibling.classList.contains(CLS_CAPINLINE)) {
20567
+ detach(range.startContainer.nextElementSibling);
20568
+ }
20569
+ }
20570
+ }
20571
+ else if ((range.startContainer.nodeType === 1 &&
20572
+ range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_CAPINLINE))) {
20573
+ detach(range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_CAPINLINE));
20574
+ }
20497
20575
  break;
20498
20576
  case 'insert-image':
20499
20577
  this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
@@ -20699,7 +20777,7 @@ var Image = /** @__PURE__ @class */ (function () {
20699
20777
  var target = args.target;
20700
20778
  this.contentModule = this.rendererFactory.getRenderer(RenderType.Content);
20701
20779
  var isPopupOpen = this.quickToolObj.imageQTBar.element.classList.contains('e-rte-pop');
20702
- if (target.nodeName === 'IMG' && this.parent.quickToolbarModule && this.parent.getRange().startOffset === this.parent.getRange().endOffset) {
20780
+ if (target.nodeName === 'IMG' && this.parent.quickToolbarModule) {
20703
20781
  if (isPopupOpen) {
20704
20782
  return;
20705
20783
  }
@@ -20940,6 +21018,9 @@ var Image = /** @__PURE__ @class */ (function () {
20940
21018
  Image.prototype.imageRemovePost = function (src) {
20941
21019
  var proxy = this;
20942
21020
  var absoluteUrl = '';
21021
+ if (isNullOrUndefined(this.parent.insertImageSettings.removeUrl) || this.parent.insertImageSettings.removeUrl === '') {
21022
+ return;
21023
+ }
20943
21024
  if (src.indexOf('http://') > -1 || src.indexOf('https://') > -1) {
20944
21025
  absoluteUrl = src;
20945
21026
  }
@@ -21784,6 +21865,7 @@ var Image = /** @__PURE__ @class */ (function () {
21784
21865
  imageTag.addEventListener('load', function () {
21785
21866
  _this.parent.trigger(actionComplete, e);
21786
21867
  });
21868
+ detach(parentElement);
21787
21869
  };
21788
21870
  /**
21789
21871
  * Rendering uploader and popup for drag and drop
@@ -21819,6 +21901,9 @@ var Image = /** @__PURE__ @class */ (function () {
21819
21901
  _this.popupObj.destroy();
21820
21902
  detach(_this.popupObj.element);
21821
21903
  _this.popupObj = null;
21904
+ if (!_this.parent.inlineMode.enable) {
21905
+ _this.parent.toolbarModule.baseToolbar.toolbarObj.disable(false);
21906
+ }
21822
21907
  }
21823
21908
  });
21824
21909
  this.popupObj.element.style.display = 'none';
@@ -21850,6 +21935,10 @@ var Image = /** @__PURE__ @class */ (function () {
21850
21935
  isUploading = false;
21851
21936
  detach(imageElement);
21852
21937
  _this.popupObj.close();
21938
+ _this.quickToolObj.imageQTBar.hidePopup();
21939
+ setTimeout(function () {
21940
+ _this.uploadObj.destroy();
21941
+ }, 900);
21853
21942
  },
21854
21943
  beforeUpload: function (args) {
21855
21944
  if (_this.parent.isServerRendered) {
@@ -21861,6 +21950,9 @@ var Image = /** @__PURE__ @class */ (function () {
21861
21950
  if (beforeUploadArgs.cancel) {
21862
21951
  return;
21863
21952
  }
21953
+ if (!_this.parent.inlineMode.enable) {
21954
+ _this.parent.toolbarModule.baseToolbar.toolbarObj.disable(true);
21955
+ }
21864
21956
  /* eslint-disable */
21865
21957
  _this.uploadObj.currentRequestHeader = beforeUploadArgs.currentRequest ?
21866
21958
  beforeUploadArgs.currentRequest : _this.uploadObj.currentRequestHeader;
@@ -21873,6 +21965,9 @@ var Image = /** @__PURE__ @class */ (function () {
21873
21965
  }
21874
21966
  else {
21875
21967
  _this.parent.trigger(beforeImageUpload, args);
21968
+ if (!_this.parent.inlineMode.enable) {
21969
+ _this.parent.toolbarModule.baseToolbar.toolbarObj.disable(true);
21970
+ }
21876
21971
  }
21877
21972
  },
21878
21973
  uploading: function (e) {
@@ -21915,6 +22010,9 @@ var Image = /** @__PURE__ @class */ (function () {
21915
22010
  }, 900);
21916
22011
  },
21917
22012
  success: function (e) {
22013
+ if (e.operation === "cancel") {
22014
+ return;
22015
+ }
21918
22016
  isUploading = false;
21919
22017
  _this.parent.inputElement.contentEditable = 'true';
21920
22018
  var args = {
@@ -24019,7 +24117,7 @@ var PasteCleanupSettings = /** @__PURE__ @class */ (function (_super) {
24019
24117
  Property(null)
24020
24118
  ], PasteCleanupSettings.prototype, "deniedAttrs", void 0);
24021
24119
  __decorate$2([
24022
- Property(['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width'])
24120
+ Property(['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'list-style-type', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width'])
24023
24121
  ], PasteCleanupSettings.prototype, "allowedStyleProps", void 0);
24024
24122
  __decorate$2([
24025
24123
  Property(null)
@@ -24286,9 +24384,20 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
24286
24384
  EnterKeyAction.prototype.enterHandler = function (e) {
24287
24385
  var _this = this;
24288
24386
  this.getRangeNode();
24387
+ var isTableEnter = true;
24388
+ if (!isNullOrUndefined(this.startNode.closest('TABLE')) && !isNullOrUndefined(this.endNode.closest('TABLE'))) {
24389
+ isTableEnter = false;
24390
+ var curElement = this.startNode;
24391
+ var blockElement = curElement;
24392
+ while (!this.parent.formatter.editorManager.domNode.isBlockNode(curElement)) {
24393
+ blockElement = curElement;
24394
+ curElement = curElement.parentElement;
24395
+ }
24396
+ isTableEnter = blockElement.tagName === 'TD' ? false : true;
24397
+ }
24289
24398
  if (e.args.which === 13 && e.args.code === 'Enter') {
24290
- if (isNullOrUndefined(this.startNode.closest('LI')) && isNullOrUndefined(this.endNode.closest('LI')) && isNullOrUndefined(this.startNode.closest('TABLE')) &&
24291
- isNullOrUndefined(this.endNode.closest('TABLE')) && isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
24399
+ if (isNullOrUndefined(this.startNode.closest('LI')) && isNullOrUndefined(this.endNode.closest('LI')) && isTableEnter &&
24400
+ isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
24292
24401
  var shiftKey_1 = e.args.shiftKey;
24293
24402
  var actionBeginArgs = {
24294
24403
  cancel: false,
@@ -24346,12 +24455,32 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
24346
24455
  _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.range.startContainer.childNodes[_this.range.startOffset], 0);
24347
24456
  _this.getRangeNode();
24348
24457
  }
24349
- if (_this.parent.enterKey === 'P' || _this.parent.enterKey === 'DIV' ||
24458
+ if ((_this.parent.enterKey === 'P' && !shiftKey_1) || (_this.parent.enterKey === 'DIV' && !shiftKey_1) ||
24350
24459
  (_this.parent.shiftEnterKey === 'P' && shiftKey_1) ||
24351
24460
  (_this.parent.shiftEnterKey === 'DIV' && shiftKey_1)) {
24352
- var nearBlockNode = _this.parent.formatter.editorManager.domNode.blockParentNode(_this.startNode);
24461
+ var nearBlockNode = void 0;
24462
+ if (isTableEnter && _this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode)) {
24463
+ nearBlockNode = _this.startNode;
24464
+ }
24465
+ else {
24466
+ nearBlockNode = _this.parent.formatter.editorManager.domNode.blockParentNode(_this.startNode);
24467
+ }
24353
24468
  var isImageNode = false;
24354
- if (_this.range.startOffset === 0 && _this.range.endOffset === 0 && !(!isNullOrUndefined(_this.range.startContainer.previousSibling) && _this.range.startContainer.previousSibling.nodeName === 'IMG')) {
24469
+ var isFocusedFirst = false;
24470
+ if (_this.range.startOffset != 0 && _this.range.endOffset != 0 && _this.range.startContainer === _this.range.endContainer &&
24471
+ !(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG')) {
24472
+ var startNodeText = _this.range.startContainer.textContent;
24473
+ var splitFirstText = startNodeText.substring(0, _this.range.startOffset);
24474
+ if (splitFirstText.charCodeAt(_this.range.startOffset - 1) != 160 && splitFirstText.trim().length === 0) {
24475
+ isFocusedFirst = true;
24476
+ }
24477
+ }
24478
+ else if (_this.range.startOffset === 0 && _this.range.endOffset === 0) {
24479
+ isFocusedFirst = true;
24480
+ }
24481
+ if (((_this.range.startOffset === 0 && _this.range.endOffset === 0) || isFocusedFirst) &&
24482
+ !(!isNullOrUndefined(_this.range.startContainer.previousSibling) &&
24483
+ (_this.range.startContainer.previousSibling.nodeName === 'IMG' || _this.range.startContainer.previousSibling.nodeName === 'BR'))) {
24355
24484
  var isNearBlockLengthZero = void 0;
24356
24485
  var newElem = void 0;
24357
24486
  if (_this.range.startContainer.nodeName === 'IMG') {
@@ -24360,7 +24489,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
24360
24489
  isNearBlockLengthZero = false;
24361
24490
  }
24362
24491
  else {
24363
- if (nearBlockNode.textContent.length !== 0) {
24492
+ if (nearBlockNode.textContent.trim().length !== 0) {
24364
24493
  newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
24365
24494
  isNearBlockLengthZero = false;
24366
24495
  }
@@ -24409,7 +24538,18 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
24409
24538
  }
24410
24539
  if (newElem.textContent.trim().length === 0) {
24411
24540
  var brElm = _this.parent.createElement('br');
24412
- _this.startNode.appendChild(brElm);
24541
+ if (_this.startNode.nodeName === 'A') {
24542
+ var startParentElem = _this.startNode.parentElement;
24543
+ _this.startNode.parentElement.insertBefore(brElm, _this.startNode);
24544
+ detach(_this.startNode);
24545
+ _this.startNode = startParentElem;
24546
+ }
24547
+ else {
24548
+ _this.startNode.appendChild(brElm);
24549
+ }
24550
+ if (newElem.childNodes[0].textContent === '\n') {
24551
+ detach(newElem.childNodes[0]);
24552
+ }
24413
24553
  _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.startNode, 0);
24414
24554
  }
24415
24555
  if (((_this.parent.enterKey === 'P' || _this.parent.enterKey === 'DIV') && !shiftKey_1) || ((_this.parent.shiftEnterKey === 'DIV' ||
@@ -24420,12 +24560,13 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
24420
24560
  }
24421
24561
  _this.parent.formatter.editorManager.domNode.insertAfter(insertElm, newElem);
24422
24562
  detach(newElem);
24423
- _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode) ? insertElm : _this.startNode, 0);
24563
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode) ?
24564
+ insertElm : _this.startNode, 0);
24424
24565
  }
24425
24566
  }
24426
24567
  e.args.preventDefault();
24427
24568
  }
24428
- if (_this.parent.enterKey === 'BR' && !shiftKey_1) {
24569
+ if ((_this.parent.enterKey === 'BR' && !shiftKey_1) || (_this.parent.shiftEnterKey === 'BR' && shiftKey_1)) {
24429
24570
  var currentParent = void 0;
24430
24571
  if (!_this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode)) {
24431
24572
  var currentNode = _this.startNode;
@@ -24440,14 +24581,21 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
24440
24581
  else {
24441
24582
  currentParent = _this.startNode;
24442
24583
  }
24443
- var isEmptyBrInserted = false;
24584
+ var currentParentLastChild = currentParent.lastChild;
24585
+ while (!isNullOrUndefined(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text')) {
24586
+ currentParentLastChild = currentParentLastChild.lastChild;
24587
+ }
24588
+ var isLastNodeLength = _this.range.startContainer === currentParentLastChild ?
24589
+ _this.range.startContainer.textContent.length : currentParent.textContent.length;
24444
24590
  if (currentParent !== _this.parent.inputElement &&
24445
24591
  _this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
24446
24592
  _this.range.startOffset === _this.range.endOffset &&
24447
- _this.range.startOffset === currentParent.textContent.length) {
24448
- var outerBRElem = _this.parent.createElement('br');
24449
- _this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
24450
- _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), outerBRElem, 0);
24593
+ _this.range.startOffset === isLastNodeLength) {
24594
+ var focusBRElem = _this.parent.createElement('br');
24595
+ var lineBreakBRElem = _this.parent.createElement('br');
24596
+ _this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, _this.range.startContainer);
24597
+ _this.parent.formatter.editorManager.domNode.insertAfter(lineBreakBRElem, _this.range.startContainer);
24598
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), focusBRElem, 0);
24451
24599
  }
24452
24600
  else if (!isNullOrUndefined(currentParent) && currentParent !== _this.parent.inputElement && currentParent.nodeName !== 'BR') {
24453
24601
  if (currentParent.textContent.trim().length === 0 || (currentParent.textContent.trim().length === 1 &&
@@ -24471,37 +24619,15 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
24471
24619
  currentFocusElem = currentFocusElem.lastChild;
24472
24620
  }
24473
24621
  _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), currentFocusElem, 0);
24474
- isEmptyBrInserted = true;
24622
+
24475
24623
  }
24476
24624
  else {
24477
- newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, true);
24478
- newElem.parentElement.insertBefore(outerBRElem, newElem);
24479
- _this.insertFocusContent();
24625
+ _this.insertBRElement();
24480
24626
  }
24481
24627
  }
24482
24628
  }
24483
24629
  else {
24484
- var brElm = _this.parent.createElement('br');
24485
- if (_this.startNode.nodeName === 'BR' && _this.endNode.nodeName === 'BR' && _this.range.startOffset === 0 && _this.range.startOffset === _this.range.endOffset) {
24486
- _this.parent.formatter.editorManager.domNode.insertAfter(brElm, _this.startNode);
24487
- isEmptyBrInserted = true;
24488
- }
24489
- else {
24490
- if (_this.startNode === _this.parent.inputElement && !isNullOrUndefined(_this.range.startContainer.previousSibling) &&
24491
- _this.range.startContainer.previousSibling.nodeName === 'BR' && _this.range.startContainer.textContent.length === 0) {
24492
- isEmptyBrInserted = true;
24493
- }
24494
- _this.range.insertNode(brElm);
24495
- }
24496
- if (isEmptyBrInserted || (!isNullOrUndefined(brElm.nextElementSibling) && brElm.nextElementSibling.tagName === 'BR') || (!isNullOrUndefined(brElm.nextSibling) && brElm.nextSibling.textContent.length > 0)) {
24497
- _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), !isNullOrUndefined(brElm.nextSibling) ? brElm.nextSibling : brElm, 0);
24498
- isEmptyBrInserted = false;
24499
- }
24500
- else {
24501
- var brElm2 = _this.parent.createElement('br');
24502
- _this.range.insertNode(brElm2);
24503
- _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), brElm, 0);
24504
- }
24630
+ _this.insertBRElement();
24505
24631
  }
24506
24632
  e.args.preventDefault();
24507
24633
  }
@@ -24511,6 +24637,30 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
24511
24637
  }
24512
24638
  }
24513
24639
  };
24640
+ EnterKeyAction.prototype.insertBRElement = function () {
24641
+ var isEmptyBrInserted = false;
24642
+ var brElm = this.parent.createElement('br');
24643
+ if (this.startNode.nodeName === 'BR' && this.endNode.nodeName === 'BR' && this.range.startOffset === 0 && this.range.startOffset === this.range.endOffset) {
24644
+ this.parent.formatter.editorManager.domNode.insertAfter(brElm, this.startNode);
24645
+ isEmptyBrInserted = true;
24646
+ }
24647
+ else {
24648
+ if (this.startNode === this.parent.inputElement && !isNullOrUndefined(this.range.startContainer.previousSibling) &&
24649
+ this.range.startContainer.previousSibling.nodeName === 'BR' && this.range.startContainer.textContent.length === 0) {
24650
+ isEmptyBrInserted = true;
24651
+ }
24652
+ this.range.insertNode(brElm);
24653
+ }
24654
+ if (isEmptyBrInserted || (!isNullOrUndefined(brElm.nextElementSibling) && brElm.nextElementSibling.tagName === 'BR') || (!isNullOrUndefined(brElm.nextSibling) && brElm.nextSibling.textContent.length > 0)) {
24655
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), !isNullOrUndefined(brElm.nextSibling) ? brElm.nextSibling : brElm, 0);
24656
+ isEmptyBrInserted = false;
24657
+ }
24658
+ else {
24659
+ var brElm2 = this.parent.createElement('br');
24660
+ this.range.insertNode(brElm2);
24661
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), brElm, 0);
24662
+ }
24663
+ };
24514
24664
  EnterKeyAction.prototype.insertFocusContent = function () {
24515
24665
  if (this.range.startContainer.textContent.length === 0) {
24516
24666
  if (this.range.startContainer.nodeName === '#text') {
@@ -25938,7 +26088,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
25938
26088
  this.setProperties({ value: this.valueTemplate });
25939
26089
  }
25940
26090
  else {
25941
- var compiledTemplate = compile(this.valueTemplate)('', this, 'valueTemplate');
26091
+ var compiledTemplate = compile(this.valueTemplate)("", this, 'valueTemplate');
25942
26092
  for (var i = 0; i < compiledTemplate.length; i++) {
25943
26093
  var item = compiledTemplate[i];
25944
26094
  append([item], this.element);
@@ -26333,7 +26483,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
26333
26483
  this.isRTE = false;
26334
26484
  }
26335
26485
  this.notify(docClick, { args: e });
26336
- if (e.detail > 3) {
26486
+ if (Browser.info.name !== 'msie' && e.detail > 3) {
26337
26487
  e.preventDefault();
26338
26488
  }
26339
26489
  };