@syncfusion/ej2-richtexteditor 20.2.36 → 20.2.40

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 (71) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/ej2-richtexteditor.umd.min.js +2 -2
  3. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-richtexteditor.es2015.js +101 -29
  5. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-richtexteditor.es5.js +99 -26
  7. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  8. package/dist/global/ej2-richtexteditor.min.js +2 -2
  9. package/dist/global/ej2-richtexteditor.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +12 -12
  12. package/src/editor-manager/plugin/lists.js +2 -0
  13. package/src/editor-manager/plugin/toolbar-status.js +1 -1
  14. package/src/rich-text-editor/actions/full-screen.js +4 -2
  15. package/src/rich-text-editor/base/constant.d.ts +6 -1
  16. package/src/rich-text-editor/base/constant.js +6 -1
  17. package/src/rich-text-editor/base/rich-text-editor.js +21 -6
  18. package/src/rich-text-editor/base/util.js +7 -3
  19. package/src/rich-text-editor/renderer/image-module.d.ts +9 -0
  20. package/src/rich-text-editor/renderer/image-module.js +32 -7
  21. package/src/rich-text-editor/renderer/link-module.d.ts +8 -0
  22. package/src/rich-text-editor/renderer/link-module.js +10 -0
  23. package/src/rich-text-editor/renderer/render.d.ts +6 -0
  24. package/src/rich-text-editor/renderer/render.js +8 -0
  25. package/src/rich-text-editor/renderer/table-module.js +5 -3
  26. package/src/rich-text-editor/renderer/toolbar-renderer.js +2 -1
  27. package/styles/bootstrap-dark.css +49 -0
  28. package/styles/bootstrap.css +49 -0
  29. package/styles/bootstrap4.css +49 -0
  30. package/styles/bootstrap5-dark.css +49 -0
  31. package/styles/bootstrap5.css +49 -0
  32. package/styles/fabric-dark.css +49 -0
  33. package/styles/fabric.css +49 -0
  34. package/styles/fluent-dark.css +52 -3
  35. package/styles/fluent.css +49 -0
  36. package/styles/highcontrast-light.css +49 -0
  37. package/styles/highcontrast.css +49 -0
  38. package/styles/material-dark.css +49 -0
  39. package/styles/material.css +49 -0
  40. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +17 -16
  41. package/styles/rich-text-editor/_bootstrap-definition.scss +17 -16
  42. package/styles/rich-text-editor/_bootstrap4-definition.scss +17 -16
  43. package/styles/rich-text-editor/_bootstrap5-definition.scss +17 -16
  44. package/styles/rich-text-editor/_fabric-dark-definition.scss +17 -16
  45. package/styles/rich-text-editor/_fabric-definition.scss +17 -16
  46. package/styles/rich-text-editor/_fluent-definition.scss +17 -16
  47. package/styles/rich-text-editor/_fusionnew-definition.scss +17 -16
  48. package/styles/rich-text-editor/_highcontrast-definition.scss +17 -16
  49. package/styles/rich-text-editor/_highcontrast-light-definition.scss +17 -16
  50. package/styles/rich-text-editor/_layout.scss +56 -0
  51. package/styles/rich-text-editor/_material-dark-definition.scss +17 -16
  52. package/styles/rich-text-editor/_material-definition.scss +17 -16
  53. package/styles/rich-text-editor/_material3-definition.scss +17 -16
  54. package/styles/rich-text-editor/_tailwind-definition.scss +17 -16
  55. package/styles/rich-text-editor/bootstrap-dark.css +49 -0
  56. package/styles/rich-text-editor/bootstrap.css +49 -0
  57. package/styles/rich-text-editor/bootstrap4.css +49 -0
  58. package/styles/rich-text-editor/bootstrap5-dark.css +49 -0
  59. package/styles/rich-text-editor/bootstrap5.css +49 -0
  60. package/styles/rich-text-editor/fabric-dark.css +49 -0
  61. package/styles/rich-text-editor/fabric.css +49 -0
  62. package/styles/rich-text-editor/fluent-dark.css +52 -3
  63. package/styles/rich-text-editor/fluent.css +49 -0
  64. package/styles/rich-text-editor/highcontrast-light.css +49 -0
  65. package/styles/rich-text-editor/highcontrast.css +49 -0
  66. package/styles/rich-text-editor/material-dark.css +49 -0
  67. package/styles/rich-text-editor/material.css +49 -0
  68. package/styles/rich-text-editor/tailwind-dark.css +49 -0
  69. package/styles/rich-text-editor/tailwind.css +49 -0
  70. package/styles/tailwind-dark.css +49 -0
  71. package/styles/tailwind.css +49 -0
@@ -658,7 +658,12 @@ var bindCssClass = 'closeTableDialog';
658
658
  * @hidden
659
659
  * @deprecated
660
660
  */
661
- var blockInlineEmptyNodes = "address:empty, article:empty, aside:empty, blockquote:empty,\n details:empty, dd:empty, div:empty, dl:empty, dt:empty, fieldset:empty, footer:empty,form:empty, h1:empty,\n h2:empty, h3:empty, h4:empty, h5:empty, h6:empty, header:empty, hgroup:empty, hr:empty, li:empty, main:empty, nav:empty,\n noscript:empty, output:empty, p:empty, pre:empty, section:empty, td:empty, th:empty,\n a:empty, abbr:empty, acronym:empty, b:empty, bdi:empty, bdo:empty, big:empty, button:empty,\n canvas:empty, cite:empty, code:empty, data:empty, datalist:empty, del:empty, dfn:empty, em:empty, font:empty, i:empty, iframe:empty,\n ins:empty, kbd:empty, label:empty, map:empty, mark:empty, meter:empty, noscript:empty, object:empty, output:empty, picture:empty, progress:empty,\n q:empty, ruby:empty, s:empty, samp:empty, script:empty, select:empty, slot:empty, small:empty, span:empty, strong:empty, strike:empty, sub:empty, sup:empty, svg:empty,\n template:empty, textarea:empty, time:empty, u:empty, tt:empty, var:empty, wbr:empty";
661
+ var blockEmptyNodes = "address:empty, article:empty, aside:empty, blockquote:empty,\n details:empty, dd:empty, div:empty, dl:empty, dt:empty, fieldset:empty, footer:empty,form:empty, h1:empty,\n h2:empty, h3:empty, h4:empty, h5:empty, h6:empty, header:empty, hgroup:empty, li:empty, main:empty, nav:empty,\n noscript:empty, output:empty, p:empty, pre:empty, section:empty, td:empty, th:empty";
662
+ /**
663
+ * @hidden
664
+ * @deprecated
665
+ */
666
+ var inlineEmptyNodes = "a:empty, abbr:empty, acronym:empty, b:empty, bdi:empty, bdo:empty, big:empty, button:empty,\n canvas:empty, cite:empty, code:empty, data:empty, datalist:empty, del:empty, dfn:empty, em:empty, font:empty, i:empty, iframe:empty,\n ins:empty, kbd:empty, label:empty, map:empty, mark:empty, meter:empty, noscript:empty, object:empty, output:empty, picture:empty, progress:empty,\n q:empty, ruby:empty, s:empty, samp:empty, script:empty, select:empty, slot:empty, small:empty, span:empty, strong:empty, strike:empty, sub:empty, sup:empty, svg:empty,\n template:empty, textarea:empty, time:empty, u:empty, tt:empty, var:empty, wbr:empty";
662
667
 
663
668
  /**
664
669
  * Rich Text Editor classes defined here.
@@ -2590,9 +2595,13 @@ function updateTextNode(value, rteObj) {
2590
2595
  var previousParent = void 0;
2591
2596
  var insertElem = void 0;
2592
2597
  while (tempNode.firstChild) {
2593
- var emptyElem = tempNode.querySelectorAll(blockInlineEmptyNodes);
2594
- for (var i = 0; i < emptyElem.length; i++) {
2595
- emptyElem[i].innerHTML = '<br>';
2598
+ var emptyBlockElem = tempNode.querySelectorAll(blockEmptyNodes);
2599
+ for (var i = 0; i < emptyBlockElem.length; i++) {
2600
+ emptyBlockElem[i].innerHTML = '<br>';
2601
+ }
2602
+ var emptyInlineElem = tempNode.querySelectorAll(inlineEmptyNodes);
2603
+ for (var i = 0; i < emptyInlineElem.length; i++) {
2604
+ emptyInlineElem[i].innerHTML = '&ZeroWidthSpace;';
2596
2605
  }
2597
2606
  if (rteObj.enterKey !== 'BR' && ((tempNode.firstChild.nodeName === '#text' &&
2598
2607
  (tempNode.firstChild.textContent.indexOf('\n') < 0 || tempNode.firstChild.textContent.trim() !== '')) ||
@@ -3250,8 +3259,9 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
3250
3259
  proxy.parent.notify(selectionRestore, {});
3251
3260
  proxy.currentElement.querySelector('.' + CLS_RTE_ELEMENTS).style.borderBottomColor = colorpickerValue;
3252
3261
  var range = proxy.parent.formatter.editorManager.nodeSelection.getRange(proxy.parent.contentModule.getDocument());
3262
+ var closestElement = closest(range.startContainer.parentNode, 'table');
3253
3263
  if ((range.startContainer.nodeName === 'TD' || range.startContainer.nodeName === 'TH' || range.startContainer.nodeName === 'BODY' ||
3254
- closest(range.startContainer.parentNode, 'td,th')) && range.collapsed && args.subCommand === 'BackgroundColor') {
3264
+ closest(range.startContainer.parentNode, 'td,th')) && range.collapsed && args.subCommand === 'BackgroundColor' && closest(closestElement, '.' + CLS_RTE)) {
3255
3265
  proxy.parent.notify(tableColorPickerChanged, colorPickerArgs);
3256
3266
  }
3257
3267
  else {
@@ -10986,6 +10996,8 @@ var Lists = /** @__PURE__ @class */ (function () {
10986
10996
  var endNode = this.parent.domNode.getSelectedNode(range.endContainer, range.endOffset);
10987
10997
  startNode = startNode.nodeName === 'BR' ? startNode.parentElement : startNode;
10988
10998
  endNode = endNode.nodeName === 'BR' ? endNode.parentElement : endNode;
10999
+ startNode = startNode.nodeName !== 'LI' && !isNullOrUndefined(startNode.closest('LI')) ? startNode.closest('LI') : startNode;
11000
+ endNode = endNode.nodeName !== 'LI' && !isNullOrUndefined(endNode.closest('LI')) ? endNode.closest('LI') : endNode;
10989
11001
  if (((range.commonAncestorContainer.nodeName === 'OL' || range.commonAncestorContainer.nodeName === 'UL' || range.commonAncestorContainer.nodeName === 'LI') &&
10990
11002
  isNullOrUndefined(endNode.nextElementSibling) && endNode.textContent.length === range.endOffset &&
10991
11003
  isNullOrUndefined(startNode.previousElementSibling) && range.startOffset === 0) ||
@@ -17111,7 +17123,7 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
17111
17123
  if ((name !== null && name !== '' && name !== undefined)
17112
17124
  && (fontName === null || fontName === undefined || (fontName.filter(function (value, pos) {
17113
17125
  var pattern = new RegExp(name, 'i');
17114
- if ((value.replace(/"/g, '').replace(/ /g, '') === name.replace(/"/g, '').replace(/ /g, '')) ||
17126
+ if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
17115
17127
  (value.search(pattern) > -1)) {
17116
17128
  index = pos;
17117
17129
  }
@@ -19665,7 +19677,8 @@ var FullScreen = /** @__PURE__ @class */ (function () {
19665
19677
  }
19666
19678
  _this.parent.element.classList.add(CLS_FULL_SCREEN);
19667
19679
  _this.toggleParentOverflow(true);
19668
- _this.parent.setContentHeight();
19680
+ var isExpand = _this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
19681
+ _this.parent.setContentHeight(null, isExpand);
19669
19682
  if (_this.parent.toolbarModule) {
19670
19683
  if (!_this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
19671
19684
  _this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
@@ -19712,7 +19725,8 @@ var FullScreen = /** @__PURE__ @class */ (function () {
19712
19725
  for (var i = 0; i < elem.length; i++) {
19713
19726
  removeClass([elem[i]], ['e-rte-overflow']);
19714
19727
  }
19715
- _this.parent.setContentHeight();
19728
+ var isExpand = _this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
19729
+ _this.parent.setContentHeight(null, isExpand);
19716
19730
  if (_this.parent.toolbarModule) {
19717
19731
  if (!_this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
19718
19732
  _this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
@@ -19901,6 +19915,14 @@ var Render = /** @__PURE__ @class */ (function () {
19901
19915
  Render.prototype.destroy = function () {
19902
19916
  this.removeEventListener();
19903
19917
  };
19918
+ /**
19919
+ * Clears the Render Module.
19920
+ *
19921
+ * @returns {void}
19922
+ */
19923
+ Render.prototype.moduleDestroy = function () {
19924
+ this.parent = null;
19925
+ };
19904
19926
  Render.prototype.addEventListener = function () {
19905
19927
  if (this.parent.isDestroyed) {
19906
19928
  return;
@@ -20458,6 +20480,16 @@ var Link = /** @__PURE__ @class */ (function () {
20458
20480
  Link.prototype.destroy = function () {
20459
20481
  this.removeEventListener();
20460
20482
  };
20483
+ /**
20484
+ * Clears the Link Module.
20485
+ *
20486
+ * @returns {void}
20487
+ * @hidden
20488
+ * @deprecated
20489
+ */
20490
+ Link.prototype.moduleDestroy = function () {
20491
+ this.parent = null;
20492
+ };
20461
20493
  /**
20462
20494
  * For internal use only - Get the module name.
20463
20495
  *
@@ -20478,6 +20510,7 @@ var Image = /** @__PURE__ @class */ (function () {
20478
20510
  this.isAllowedTypes = true;
20479
20511
  this.pageX = null;
20480
20512
  this.pageY = null;
20513
+ this.mouseX = null;
20481
20514
  this.deletedImg = [];
20482
20515
  this.parent = parent;
20483
20516
  this.rteID = parent.element.id;
@@ -20814,8 +20847,9 @@ var Image = /** @__PURE__ @class */ (function () {
20814
20847
  img.style.minWidth = this.parent.insertImageSettings.minWidth === 0 ? '20px' : formatUnit(this.parent.insertImageSettings.minWidth);
20815
20848
  if (this.parent.insertImageSettings.resizeByPercent) {
20816
20849
  if (parseInt('' + img.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
20817
- var percentageValue = this.pixToPerc((width / height * expectedY), (img.previousElementSibling || img.parentElement));
20818
- img.style.width = Math.min(Math.round((percentageValue / img.getBoundingClientRect().width) * expectedX * 100) / 100, 100) + '%';
20850
+ var original = img.offsetWidth + this.mouseX;
20851
+ var finalWidthByPerc = (original / img.offsetWidth) * (parseFloat(img.style.width).toString() == 'NaN' ? (img.offsetWidth / (parseFloat(getComputedStyle(this.parent.element).width)) * 100) : parseFloat(img.style.width));
20852
+ img.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
20819
20853
  }
20820
20854
  else {
20821
20855
  img.style.width = this.pixToPerc((width / height * expectedY), (img.previousElementSibling || img.parentElement)) + '%';
@@ -20838,13 +20872,20 @@ var Image = /** @__PURE__ @class */ (function () {
20838
20872
  img.style.height = expectedY + 'px';
20839
20873
  }
20840
20874
  else {
20841
- img.setAttribute('width', ((width / height * expectedY) + width / height).toString());
20875
+ if (this.parent.iframeSettings.enable) {
20876
+ img.setAttribute('width', (img.width + this.mouseX).toString());
20877
+ }
20878
+ else {
20879
+ img.setAttribute('width', (img.offsetWidth + this.mouseX).toString());
20880
+ }
20842
20881
  }
20843
20882
  }
20844
20883
  else if (height > width) {
20845
20884
  if (this.parent.insertImageSettings.resizeByPercent) {
20846
20885
  if (parseInt('' + img.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
20847
- img.style.width = Math.min(Math.round((width / img.getBoundingClientRect().width) * expectedX * 100) / 100, 100) + '%';
20886
+ var original = img.offsetWidth + this.mouseX;
20887
+ var finalWidthByPerc = (original / img.offsetWidth) * (parseFloat(img.style.width).toString() == 'NaN' ? (img.offsetWidth / (parseFloat(getComputedStyle(this.parent.element).width)) * 100) : parseFloat(img.style.width));
20888
+ img.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
20848
20889
  }
20849
20890
  else {
20850
20891
  img.style.width = this.pixToPerc((expectedX / height * expectedY), (img.previousElementSibling || img.parentElement)) + '%';
@@ -20911,6 +20952,7 @@ var Image = /** @__PURE__ @class */ (function () {
20911
20952
  var mouseY = (this.resizeBtnStat.topLeft || this.resizeBtnStat.topRight) ? -(pageY - this.pageY) : (pageY - this.pageY);
20912
20953
  var width = parseInt(this.imgDupPos.width, 10) + mouseX;
20913
20954
  var height = parseInt(this.imgDupPos.height, 10) + mouseY;
20955
+ this.mouseX = mouseX;
20914
20956
  this.pageX = pageX;
20915
20957
  this.pageY = pageY;
20916
20958
  if (this.resizeBtnStat.botRight) {
@@ -21438,7 +21480,8 @@ var Image = /** @__PURE__ @class */ (function () {
21438
21480
  buttonModel: {
21439
21481
  content: linkUpdate, cssClass: 'e-flat e-update-link' + ' ' + this.parent.cssClass, isPrimary: true
21440
21482
  }
21441
- }]
21483
+ }],
21484
+ cssClass: this.dialogObj.cssClass + ' e-rte-img-link-dialog'
21442
21485
  });
21443
21486
  if (!isNullOrUndefined(this.parent.cssClass)) {
21444
21487
  this.dialogObj.setProperties({ cssClass: this.parent.cssClass });
@@ -21486,7 +21529,8 @@ var Image = /** @__PURE__ @class */ (function () {
21486
21529
  buttonModel: {
21487
21530
  content: linkUpdate, cssClass: 'e-flat e-update-alt' + ' ' + this.parent.cssClass, isPrimary: true
21488
21531
  }
21489
- }]
21532
+ }],
21533
+ cssClass: this.dialogObj.cssClass + ' e-rte-img-alt-dialog'
21490
21534
  });
21491
21535
  if (!isNullOrUndefined(this.parent.cssClass)) {
21492
21536
  this.dialogObj.setProperties({ cssClass: this.parent.cssClass });
@@ -21709,7 +21753,8 @@ var Image = /** @__PURE__ @class */ (function () {
21709
21753
  buttonModel: {
21710
21754
  content: linkUpdate, cssClass: 'e-flat e-update-size' + ' ' + this.parent.cssClass, isPrimary: true
21711
21755
  }
21712
- }]
21756
+ }],
21757
+ cssClass: this.dialogObj.cssClass + ' e-rte-img-size-dialog'
21713
21758
  });
21714
21759
  if (!isNullOrUndefined(this.parent.cssClass)) {
21715
21760
  this.dialogObj.setProperties({ cssClass: this.parent.cssClass });
@@ -22742,6 +22787,18 @@ var Image = /** @__PURE__ @class */ (function () {
22742
22787
  this.prevSelectedImgEle = undefined;
22743
22788
  this.removeEventListener();
22744
22789
  };
22790
+ /* eslint-disable */
22791
+ /**
22792
+ * Clears the ImageModule.
22793
+ *
22794
+ * @returns {void}
22795
+ * @hidden
22796
+ * @deprecated
22797
+ */
22798
+ /* eslint-enable */
22799
+ Image.prototype.moduleDestroy = function () {
22800
+ this.parent = null;
22801
+ };
22745
22802
  /**
22746
22803
  * For internal use only - Get the module name.
22747
22804
  *
@@ -23554,7 +23611,8 @@ var Table = /** @__PURE__ @class */ (function () {
23554
23611
  }
23555
23612
  var target = e.target || e.targetTouches[0].target;
23556
23613
  var closestTable = closest(target, 'table.e-rte-table');
23557
- if (!isNullOrUndefined(this.curTable) && !isNullOrUndefined(closestTable) && closestTable !== this.curTable) {
23614
+ if (!isNullOrUndefined(this.curTable) && !isNullOrUndefined(closestTable) && closestTable !== this.curTable &&
23615
+ this.parent.contentModule.getEditPanel().contains(closestTable)) {
23558
23616
  this.removeResizeElement();
23559
23617
  this.removeHelper(e);
23560
23618
  this.cancelResizeAction();
@@ -23831,7 +23889,8 @@ var Table = /** @__PURE__ @class */ (function () {
23831
23889
  var rteWidth = _this.contentModule.getEditPanel().offsetWidth - (_this.contentModule.getEditPanel().offsetWidth -
23832
23890
  _this.contentModule.getEditPanel().clientWidth) - paddingSize * 2;
23833
23891
  var widthCompare = void 0;
23834
- if (!isNullOrUndefined(_this.curTable.parentElement.closest('table'))) {
23892
+ if (!isNullOrUndefined(_this.curTable.parentElement.closest('table')) && !isNullOrUndefined(_this.curTable.closest('td')) &&
23893
+ _this.contentModule.getEditPanel().contains(_this.curTable.closest('td'))) {
23835
23894
  var currentTd = _this.curTable.closest('td');
23836
23895
  var currentTDPad = +getComputedStyle(currentTd).paddingRight.match(/\d/g).join('');
23837
23896
  // Padding of the current table with the parent element multiply with 2.
@@ -24134,7 +24193,7 @@ var Table = /** @__PURE__ @class */ (function () {
24134
24193
  },
24135
24194
  buttonModel: { cssClass: 'e-flat e-cancel' + ' ' + this.parent.cssClass, content: cancel }
24136
24195
  }],
24137
- cssClass: this.parent.cssClass
24196
+ cssClass: this.editdlgObj.cssClass + ' e-rte-edit-table-prop-dialog'
24138
24197
  });
24139
24198
  this.editdlgObj.element.style.maxHeight = 'none';
24140
24199
  this.editdlgObj.content.querySelector('input').focus();
@@ -25887,19 +25946,22 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
25887
25946
  var currentEndContainer = range.endContainer;
25888
25947
  var currentStartOffset = range.startOffset;
25889
25948
  var isSameContainer = currentStartContainer === currentEndContainer ? true : false;
25890
- var currentEndOffset;
25891
25949
  var endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
25892
25950
  range.endContainer;
25893
25951
  var closestLI = closest(endNode, 'LI');
25894
25952
  if (!isNullOrUndefined(closestLI) && endNode.textContent.length === range.endOffset &&
25895
25953
  !range.collapsed && isNullOrUndefined(endNode.nextElementSibling)) {
25896
- closestLI.textContent = closestLI.textContent.trim();
25897
- currentEndOffset = closestLI.textContent.length - 1;
25954
+ for (var i = 0; i < closestLI.childNodes.length; i++) {
25955
+ if (closestLI.childNodes[i].nodeName === "#text" && closestLI.childNodes[i].textContent.trim().length === 0) {
25956
+ detach(closestLI.childNodes[i]);
25957
+ i--;
25958
+ }
25959
+ }
25898
25960
  var currentLastElem = closestLI;
25899
- while (currentLastElem.nodeName !== '#text') {
25961
+ while (currentLastElem.lastChild !== null && currentLastElem.nodeName !== '#text') {
25900
25962
  currentLastElem = currentLastElem.lastChild;
25901
25963
  }
25902
- this.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), isSameContainer ? currentLastElem : currentStartContainer, currentLastElem, currentStartOffset, currentLastElem.textContent.length);
25964
+ this.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), isSameContainer ? (currentLastElem.nodeName === 'BR' && !isNullOrUndefined(currentLastElem.previousSibling) ? currentLastElem.previousSibling : currentLastElem) : currentStartContainer, currentLastElem, currentStartOffset, (currentLastElem.nodeName === 'BR' ? 0 : currentLastElem.textContent.length));
25903
25965
  }
25904
25966
  };
25905
25967
  /**
@@ -26238,8 +26300,19 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
26238
26300
  if (this.isDestroyed || !this.isRendered) {
26239
26301
  return;
26240
26302
  }
26241
- if (this.element.offsetParent === null && !isNullOrUndefined(this.toolbarModule)) {
26242
- this.toolbarModule.destroy();
26303
+ if (this.element.offsetParent === null) {
26304
+ if (!isNullOrUndefined(this.toolbarModule)) {
26305
+ this.toolbarModule.destroy();
26306
+ }
26307
+ if (!isNullOrUndefined(this.imageModule)) {
26308
+ this.imageModule.moduleDestroy();
26309
+ }
26310
+ if (!isNullOrUndefined(this.linkModule)) {
26311
+ this.linkModule.moduleDestroy();
26312
+ }
26313
+ if (!isNullOrUndefined(this.renderModule)) {
26314
+ this.renderModule.moduleDestroy();
26315
+ }
26243
26316
  return;
26244
26317
  }
26245
26318
  this.notify(destroy, {});
@@ -27850,5 +27923,5 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
27850
27923
  * Rich Text Editor component exported items
27851
27924
  */
27852
27925
 
27853
- 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, mediaSelected, mediaUploading, mediaUploadSuccess, mediaUploadFailed, mediaRemoving, afterImageDelete, afterMediaDelete, drop, xhtmlValidation, beforeImageUpload, beforeMediaUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, closeImageDialog, closeAudioDialog, showTableDialog, closeTableDialog, bindCssClass, blockInlineEmptyNodes, 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_ALIGN_TB_BTN, CLS_FONT_COLOR_TARGET, CLS_BACKGROUND_COLOR_TARGET, CLS_COLOR_CONTENT, CLS_FONT_COLOR_DROPDOWN, CLS_BACKGROUND_COLOR_DROPDOWN, CLS_COLOR_PALETTE, CLS_FONT_COLOR_PICKER, CLS_BACKGROUND_COLOR_PICKER, CLS_RTE_READONLY, CLS_TABLE_SEL, CLS_TB_DASH_BOR, CLS_TB_ALT_BOR, CLS_TB_COL_RES, CLS_TB_ROW_RES, CLS_TB_BOX_RES, CLS_RTE_HIDDEN, CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT, CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT, CLS_RTE_RES_HANDLE, CLS_RTE_RES_EAST, CLS_RTE_IMAGE, CLS_RESIZE, CLS_IMG_FOCUS, CLS_RTE_DRAG_IMAGE, CLS_RTE_UPLOAD_POPUP, CLS_POPUP_OPEN, CLS_IMG_RESIZE, CLS_DROPAREA, CLS_IMG_INNER, CLS_UPLOAD_FILES, CLS_RTE_DIALOG_UPLOAD, CLS_RTE_RES_CNT, CLS_CUSTOM_TILE, CLS_NOCOLOR_ITEM, CLS_TABLE, CLS_TABLE_BORDER, CLS_RTE_TABLE_RESIZE, CLS_RTE_FIXED_TB_EXPAND, CLS_RTE_TB_ENABLED, CLS_RTE_RES_WEST, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, getDefaultValue, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, TABLE, LINK, INSERT_ROW, INSERT_COLUMN, DELETEROW, DELETECOLUMN, REMOVETABLE, TABLEHEADER, TABLE_VERTICAL_ALIGN, TABLE_MERGE, TABLE_VERTICAL_SPLIT, TABLE_HORIZONTAL_SPLIT, TABLE_MOVE, ALIGNMENT_TYPE, INDENT_TYPE, DEFAULT_TAG, BLOCK_TAGS, IGNORE_BLOCK_TAGS, TABLE_BLOCK_TAGS, SELECTION_TYPE, INSERTHTML_TYPE, INSERT_TEXT_TYPE, CLEAR_TYPE, SELF_CLOSING_TAGS, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_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, INSERT_TEXT_COMMAND, ClearFormat, MDLists, MDFormats, MarkdownSelection, UndoRedoCommands, MDSelectionFormats, MDLink, MDTable, markdownFormatTags, markdownSelectionTags, markdownListsTags, htmlKeyConfig, markdownKeyConfig, pasteCleanupGroupingTags, listConversionFilters, selfClosingTags, KEY_DOWN, ACTION, FORMAT_TYPE, KEY_DOWN_HANDLER, LIST_TYPE, KEY_UP_HANDLER, KEY_UP, MODEL_CHANGED_PLUGIN, MODEL_CHANGED, MS_WORD_CLEANUP_PLUGIN, MS_WORD_CLEANUP, ON_BEGIN, SPACE_ACTION };
27926
+ 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, mediaSelected, mediaUploading, mediaUploadSuccess, mediaUploadFailed, mediaRemoving, afterImageDelete, afterMediaDelete, drop, xhtmlValidation, beforeImageUpload, beforeMediaUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, closeImageDialog, closeAudioDialog, showTableDialog, closeTableDialog, bindCssClass, blockEmptyNodes, inlineEmptyNodes, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT, CLS_TB_ABS_FLOAT, CLS_INLINE, CLS_TB_INLINE, CLS_RTE_EXPAND_TB, CLS_FULL_SCREEN, CLS_QUICK_TB, CLS_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_POP, CLS_INLINE_POP, CLS_INLINE_DROPDOWN, CLS_DROPDOWN_POPUP, CLS_DROPDOWN_ICONS, CLS_DROPDOWN_ITEMS, CLS_DROPDOWN_BTN, CLS_RTE_CONTENT, CLS_TB_ITEM, CLS_TB_EXTENDED, CLS_TB_WRAP, CLS_POPUP, CLS_SEPARATOR, CLS_MINIMIZE, CLS_MAXIMIZE, CLS_BACK, CLS_SHOW, CLS_HIDE, CLS_VISIBLE, CLS_FOCUS, CLS_RM_WHITE_SPACE, CLS_IMGRIGHT, CLS_IMGLEFT, CLS_IMGCENTER, CLS_IMGBREAK, CLS_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_ALIGN_TB_BTN, CLS_FONT_COLOR_TARGET, CLS_BACKGROUND_COLOR_TARGET, CLS_COLOR_CONTENT, CLS_FONT_COLOR_DROPDOWN, CLS_BACKGROUND_COLOR_DROPDOWN, CLS_COLOR_PALETTE, CLS_FONT_COLOR_PICKER, CLS_BACKGROUND_COLOR_PICKER, CLS_RTE_READONLY, CLS_TABLE_SEL, CLS_TB_DASH_BOR, CLS_TB_ALT_BOR, CLS_TB_COL_RES, CLS_TB_ROW_RES, CLS_TB_BOX_RES, CLS_RTE_HIDDEN, CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT, CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT, CLS_RTE_RES_HANDLE, CLS_RTE_RES_EAST, CLS_RTE_IMAGE, CLS_RESIZE, CLS_IMG_FOCUS, CLS_RTE_DRAG_IMAGE, CLS_RTE_UPLOAD_POPUP, CLS_POPUP_OPEN, CLS_IMG_RESIZE, CLS_DROPAREA, CLS_IMG_INNER, CLS_UPLOAD_FILES, CLS_RTE_DIALOG_UPLOAD, CLS_RTE_RES_CNT, CLS_CUSTOM_TILE, CLS_NOCOLOR_ITEM, CLS_TABLE, CLS_TABLE_BORDER, CLS_RTE_TABLE_RESIZE, CLS_RTE_FIXED_TB_EXPAND, CLS_RTE_TB_ENABLED, CLS_RTE_RES_WEST, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, getDefaultValue, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, TABLE, LINK, INSERT_ROW, INSERT_COLUMN, DELETEROW, DELETECOLUMN, REMOVETABLE, TABLEHEADER, TABLE_VERTICAL_ALIGN, TABLE_MERGE, TABLE_VERTICAL_SPLIT, TABLE_HORIZONTAL_SPLIT, TABLE_MOVE, ALIGNMENT_TYPE, INDENT_TYPE, DEFAULT_TAG, BLOCK_TAGS, IGNORE_BLOCK_TAGS, TABLE_BLOCK_TAGS, SELECTION_TYPE, INSERTHTML_TYPE, INSERT_TEXT_TYPE, CLEAR_TYPE, SELF_CLOSING_TAGS, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_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, INSERT_TEXT_COMMAND, ClearFormat, MDLists, MDFormats, MarkdownSelection, UndoRedoCommands, MDSelectionFormats, MDLink, MDTable, markdownFormatTags, markdownSelectionTags, markdownListsTags, htmlKeyConfig, markdownKeyConfig, pasteCleanupGroupingTags, listConversionFilters, selfClosingTags, KEY_DOWN, ACTION, FORMAT_TYPE, KEY_DOWN_HANDLER, LIST_TYPE, KEY_UP_HANDLER, KEY_UP, MODEL_CHANGED_PLUGIN, MODEL_CHANGED, MS_WORD_CLEANUP_PLUGIN, MS_WORD_CLEANUP, ON_BEGIN, SPACE_ACTION };
27854
27927
  //# sourceMappingURL=ej2-richtexteditor.es5.js.map