@syncfusion/ej2-richtexteditor 25.1.37 → 25.1.39

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 (93) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/ej2-richtexteditor.min.js +2 -2
  3. package/dist/ej2-richtexteditor.umd.min.js +2 -2
  4. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-richtexteditor.es2015.js +2793 -2632
  6. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  7. package/dist/es6/ej2-richtexteditor.es5.js +7506 -7346
  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 +11 -11
  13. package/src/editor-manager/plugin/indents.js +1 -1
  14. package/src/editor-manager/plugin/inserthtml.js +24 -21
  15. package/src/editor-manager/plugin/link.js +4 -2
  16. package/src/editor-manager/plugin/lists.js +49 -17
  17. package/src/editor-manager/plugin/nodecutter.js +3 -0
  18. package/src/editor-manager/plugin/selection-commands.d.ts +1 -0
  19. package/src/editor-manager/plugin/selection-commands.js +84 -2
  20. package/src/editor-manager/plugin/table.d.ts +4 -0
  21. package/src/editor-manager/plugin/table.js +62 -19
  22. package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +1 -0
  23. package/src/rich-text-editor/actions/base-quick-toolbar.js +9 -13
  24. package/src/rich-text-editor/actions/base-toolbar.js +3 -2
  25. package/src/rich-text-editor/actions/dropdown-buttons.d.ts +1 -0
  26. package/src/rich-text-editor/actions/dropdown-buttons.js +8 -23
  27. package/src/rich-text-editor/actions/emoji-picker.js +1 -1
  28. package/src/rich-text-editor/actions/enter-key.js +4 -1
  29. package/src/rich-text-editor/actions/format-painter.js +4 -1
  30. package/src/rich-text-editor/actions/html-editor.js +9 -7
  31. package/src/rich-text-editor/actions/quick-toolbar.d.ts +2 -0
  32. package/src/rich-text-editor/actions/quick-toolbar.js +18 -4
  33. package/src/rich-text-editor/base/rich-text-editor.js +4 -18
  34. package/src/rich-text-editor/base/util.d.ts +0 -4
  35. package/src/rich-text-editor/base/util.js +1 -35
  36. package/src/rich-text-editor/formatter/formatter.js +2 -1
  37. package/src/rich-text-editor/renderer/audio-module.js +9 -4
  38. package/src/rich-text-editor/renderer/image-module.js +4 -1
  39. package/src/rich-text-editor/renderer/table-module.js +15 -5
  40. package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +0 -1
  41. package/src/rich-text-editor/renderer/toolbar-renderer.js +30 -24
  42. package/src/rich-text-editor/renderer/video-module.js +29 -15
  43. package/styles/bootstrap-dark.css +21 -7
  44. package/styles/bootstrap.css +14 -3
  45. package/styles/bootstrap4.css +11 -0
  46. package/styles/bootstrap5-dark.css +11 -0
  47. package/styles/bootstrap5.css +11 -0
  48. package/styles/fabric-dark.css +11 -0
  49. package/styles/fabric.css +11 -0
  50. package/styles/fluent-dark.css +28 -5
  51. package/styles/fluent.css +28 -5
  52. package/styles/highcontrast-light.css +11 -0
  53. package/styles/highcontrast.css +11 -0
  54. package/styles/material-dark.css +12 -1
  55. package/styles/material.css +12 -1
  56. package/styles/material3-dark.css +11 -0
  57. package/styles/material3.css +11 -0
  58. package/styles/rich-text-editor/_bds-definition.scss +6 -0
  59. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +10 -4
  60. package/styles/rich-text-editor/_bootstrap-definition.scss +8 -2
  61. package/styles/rich-text-editor/_bootstrap4-definition.scss +6 -0
  62. package/styles/rich-text-editor/_bootstrap5-definition.scss +6 -0
  63. package/styles/rich-text-editor/_fabric-dark-definition.scss +6 -0
  64. package/styles/rich-text-editor/_fabric-definition.scss +6 -0
  65. package/styles/rich-text-editor/_fluent-definition.scss +11 -5
  66. package/styles/rich-text-editor/_fusionnew-definition.scss +6 -0
  67. package/styles/rich-text-editor/_highcontrast-definition.scss +6 -0
  68. package/styles/rich-text-editor/_highcontrast-light-definition.scss +6 -0
  69. package/styles/rich-text-editor/_layout.scss +13 -3
  70. package/styles/rich-text-editor/_material-dark-definition.scss +6 -0
  71. package/styles/rich-text-editor/_material-definition.scss +6 -0
  72. package/styles/rich-text-editor/_material3-definition.scss +6 -0
  73. package/styles/rich-text-editor/_tailwind-definition.scss +11 -5
  74. package/styles/rich-text-editor/_theme.scss +21 -0
  75. package/styles/rich-text-editor/bootstrap-dark.css +21 -7
  76. package/styles/rich-text-editor/bootstrap.css +14 -3
  77. package/styles/rich-text-editor/bootstrap4.css +11 -0
  78. package/styles/rich-text-editor/bootstrap5-dark.css +11 -0
  79. package/styles/rich-text-editor/bootstrap5.css +11 -0
  80. package/styles/rich-text-editor/fabric-dark.css +11 -0
  81. package/styles/rich-text-editor/fabric.css +11 -0
  82. package/styles/rich-text-editor/fluent-dark.css +28 -5
  83. package/styles/rich-text-editor/fluent.css +28 -5
  84. package/styles/rich-text-editor/highcontrast-light.css +11 -0
  85. package/styles/rich-text-editor/highcontrast.css +11 -0
  86. package/styles/rich-text-editor/material-dark.css +12 -1
  87. package/styles/rich-text-editor/material.css +12 -1
  88. package/styles/rich-text-editor/material3-dark.css +11 -0
  89. package/styles/rich-text-editor/material3.css +11 -0
  90. package/styles/rich-text-editor/tailwind-dark.css +20 -9
  91. package/styles/rich-text-editor/tailwind.css +20 -9
  92. package/styles/tailwind-dark.css +20 -9
  93. package/styles/tailwind.css +20 -9
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 25.1.37
3
+ * version : 25.1.39
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-richtexteditor@*",
3
- "_id": "@syncfusion/ej2-richtexteditor@25.1.35",
3
+ "_id": "@syncfusion/ej2-richtexteditor@25.1.38",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-+ZVGzeuC6zPgsx8Ydma2G5WgxqpfYz7NnO17cQwk7cLzhoGTJqSrY/dcHCwPYe884mJ4hm0P6QB1mD9kUXywFA==",
5
+ "_integrity": "sha512-z1RBMwgqZdkE0VMxfBJILZ7asZ8xdJ5S87vxM7QVQSwgX1Xa/Yt7+pohXotJlmXCMLarZwZJ9ecU5KCfBqF4Qw==",
6
6
  "_location": "/@syncfusion/ej2-richtexteditor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -25,8 +25,8 @@
25
25
  "/@syncfusion/ej2-react-richtexteditor",
26
26
  "/@syncfusion/ej2-vue-richtexteditor"
27
27
  ],
28
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-25.1.35.tgz",
29
- "_shasum": "9b56182752bfc14fa4ccfbe95f8a3875a66ecabc",
28
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-25.1.38.tgz",
29
+ "_shasum": "632ae6ac93a8c7190d9a9825e42f10cf16693584",
30
30
  "_spec": "@syncfusion/ej2-richtexteditor@*",
31
31
  "_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
32
32
  "author": {
@@ -38,12 +38,12 @@
38
38
  "bundleDependencies": false,
39
39
  "dependencies": {
40
40
  "@syncfusion/ej2-base": "~25.1.35",
41
- "@syncfusion/ej2-buttons": "~25.1.35",
42
- "@syncfusion/ej2-filemanager": "~25.1.37",
43
- "@syncfusion/ej2-inputs": "~25.1.37",
44
- "@syncfusion/ej2-navigations": "~25.1.37",
45
- "@syncfusion/ej2-popups": "~25.1.35",
46
- "@syncfusion/ej2-splitbuttons": "~25.1.37"
41
+ "@syncfusion/ej2-buttons": "~25.1.39",
42
+ "@syncfusion/ej2-filemanager": "~25.1.39",
43
+ "@syncfusion/ej2-inputs": "~25.1.38",
44
+ "@syncfusion/ej2-navigations": "~25.1.39",
45
+ "@syncfusion/ej2-popups": "~25.1.39",
46
+ "@syncfusion/ej2-splitbuttons": "~25.1.38"
47
47
  },
48
48
  "deprecated": false,
49
49
  "description": "Essential JS 2 RichTextEditor component",
@@ -69,6 +69,6 @@
69
69
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
70
70
  },
71
71
  "typings": "index.d.ts",
72
- "version": "25.1.37",
72
+ "version": "25.1.39",
73
73
  "sideEffects": false
74
74
  }
@@ -81,7 +81,7 @@ var Indents = /** @class */ (function () {
81
81
  isRtl ? (parentNode.style.marginRight = indentsValue) : (parentNode.style.marginLeft = indentsValue);
82
82
  }
83
83
  else {
84
- indentsValue = (marginLeftOrRight === '' || marginLeftOrRight === '0px') ? '' : parseInt(marginLeftOrRight, null) - this.indentValue + 'px';
84
+ indentsValue = (marginLeftOrRight === '' || marginLeftOrRight === '0px' || marginLeftOrRight === '0in') ? '' : parseInt(marginLeftOrRight, null) - this.indentValue + 'px';
85
85
  isRtl ? (parentNode.style.marginRight = indentsValue) : (parentNode.style.marginLeft = indentsValue);
86
86
  /* eslint-enable */
87
87
  }
@@ -215,25 +215,22 @@ var InsertHtml = /** @class */ (function () {
215
215
  CONSTANT.TABLE_BLOCK_TAGS.indexOf(closestParentNode.tagName.toLocaleLowerCase()) !== -1))
216
216
  || (node.nodeName.toLowerCase() === 'table' && closestParentNode &&
217
217
  CONSTANT.TABLE_BLOCK_TAGS.indexOf(closestParentNode.tagName.toLocaleLowerCase()) === -1))) {
218
- if (isCollapsed) {
219
- preNode = nodeCutter.SplitNode(range, closestParentNode, true);
220
- }
221
- else {
222
- preNode = nodeCutter.SplitNode(range, closestParentNode, false);
223
- }
224
- sibNode = isNOU(preNode.previousSibling) ? preNode.parentNode.previousSibling : preNode.previousSibling;
225
- if (nodes.length === 1) {
226
- nodeSelection.setSelectionContents(docElement, preNode);
227
- range = nodeSelection.getRange(docElement);
228
- isSingleNode = true;
229
- }
230
- else {
231
- lasNode = nodeCutter.GetSpliceNode(range, nodes[nodes.length - 1].parentElement);
232
- lasNode = isNOU(lasNode) ? preNode : lasNode;
233
- nodeSelection.setSelectionText(docElement, preNode, lasNode, 0, (lasNode.nodeType === 3) ?
234
- lasNode.textContent.length : lasNode.childNodes.length);
235
- range = nodeSelection.getRange(docElement);
236
- isSingleNode = false;
218
+ preNode = nodeCutter.GetSpliceNode(range, closestParentNode);
219
+ if (!isNOU(preNode)) {
220
+ sibNode = isNOU(preNode.previousSibling) ? preNode.parentNode.previousSibling : preNode.previousSibling;
221
+ if (nodes.length === 1) {
222
+ nodeSelection.setSelectionContents(docElement, preNode);
223
+ range = nodeSelection.getRange(docElement);
224
+ isSingleNode = true;
225
+ }
226
+ else {
227
+ lasNode = nodeCutter.GetSpliceNode(range, nodes[nodes.length - 1].parentElement);
228
+ lasNode = isNOU(lasNode) ? preNode : lasNode;
229
+ nodeSelection.setSelectionText(docElement, preNode, lasNode, 0, (lasNode.nodeType === 3) ?
230
+ lasNode.textContent.length : lasNode.childNodes.length);
231
+ range = nodeSelection.getRange(docElement);
232
+ isSingleNode = false;
233
+ }
237
234
  }
238
235
  }
239
236
  var containsBlockNode = false;
@@ -430,7 +427,7 @@ var InsertHtml = /** @class */ (function () {
430
427
  if (blockNode.nodeName === 'BODY' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
431
428
  blockNode = range.startContainer;
432
429
  }
433
- if (blockNode.closest('LI') && node && node.firstElementChild &&
430
+ if (blockNode.closest('LI') && blockNode.nodeName !== 'TD' && blockNode.nodeName !== 'TH' && blockNode.nodeName !== 'TR' && node && node.firstElementChild &&
434
431
  ((node).firstElementChild.tagName === 'OL' || node.firstElementChild.tagName === 'UL')) {
435
432
  var liNode = void 0;
436
433
  while (node.firstElementChild.lastElementChild && node.firstElementChild.lastElementChild.tagName === 'LI') {
@@ -460,7 +457,7 @@ var InsertHtml = /** @class */ (function () {
460
457
  }
461
458
  }
462
459
  else if ((currentNode.nodeName === '#text' || currentNode.nodeName === 'BR') && !isNOU(currentNode.parentElement) &&
463
- (currentNode.parentElement.nodeName === 'LI' || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
460
+ (currentNode.parentElement.nodeName === 'LI' || currentNode.parentElement.closest('LI') || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
464
461
  currentNode.parentElement.textContent.trim().length > 0) {
465
462
  splitedElm = currentNode;
466
463
  if (currentNode.parentElement.nodeName === 'LI' && !isNOU(currentNode.nextSibling) &&
@@ -469,6 +466,12 @@ var InsertHtml = /** @class */ (function () {
469
466
  }
470
467
  if (!range.collapsed) {
471
468
  range.deleteContents();
469
+ var value = range.startContainer;
470
+ if (!isNOU(value) && value.nodeName === 'LI' && !isNOU(value.parentElement) && (value.parentElement.nodeName === 'OL' || value.parentElement.nodeName === 'UL') && value.textContent.trim() === '') {
471
+ value.parentElement.querySelectorAll('li').forEach(function (item) {
472
+ item.remove();
473
+ });
474
+ }
472
475
  }
473
476
  range.insertNode(node);
474
477
  this.contentsDeleted = true;
@@ -54,7 +54,8 @@ var LinkCommand = /** @class */ (function () {
54
54
  }
55
55
  if (!isNOU(e.item.text) && e.item.text !== '') {
56
56
  linkText = anchorEle.innerText;
57
- anchorEle.innerText = e.item.text;
57
+ anchorEle.firstChild.nodeName === '#text' ? anchorEle.innerText = e.item.text :
58
+ anchorEle.firstChild.innerText = e.item.text;
58
59
  }
59
60
  if (!isNOU(e.item.target)) {
60
61
  anchorEle.setAttribute('target', e.item.target);
@@ -70,7 +71,8 @@ var LinkCommand = /** @class */ (function () {
70
71
  }
71
72
  else {
72
73
  var startIndex = e.item.action === 'Paste' ? anchorEle.childNodes[0].textContent.length : 0;
73
- e.item.selection.setSelectionText(this.parent.currentDocument, anchorEle.childNodes[0], anchorEle.childNodes[0], startIndex, anchorEle.childNodes[0].textContent.length);
74
+ var endIndex = anchorEle.firstChild.nodeName === '#text' ? anchorEle.childNodes[0].textContent.length : anchorEle.childNodes.length;
75
+ e.item.selection.setSelectionText(this.parent.currentDocument, anchorEle.childNodes[0], anchorEle.childNodes[0], startIndex, endIndex);
74
76
  }
75
77
  }
76
78
  else {
@@ -208,6 +208,13 @@ var Lists = /** @class */ (function () {
208
208
  Lists.prototype.removeList = function (range, e) {
209
209
  var startNode = this.parent.domNode.getSelectedNode(range.startContainer, range.startOffset);
210
210
  var endNode = (!isNOU(range.endContainer.parentElement.closest('li')) && range.endContainer.parentElement.closest('li').childElementCount > 1 && range.endContainer.nodeName === '#text') ? range.endContainer : this.parent.domNode.getSelectedNode(range.endContainer, range.endOffset);
211
+ var parentList = (range.startContainer.nodeName === '#text') ? range.startContainer.parentElement.closest('li') : range.startContainer.closest('li');
212
+ var fullContent = '';
213
+ if (!isNOU(parentList) && !isNOU(parentList.childNodes)) {
214
+ parentList.childNodes.forEach(function (e) {
215
+ fullContent = fullContent + e.textContent;
216
+ });
217
+ }
211
218
  startNode = startNode.nodeName === 'BR' ? startNode.parentElement : startNode;
212
219
  endNode = endNode.nodeName === 'BR' ? endNode.parentElement : endNode;
213
220
  startNode = startNode.nodeName !== 'LI' && !isNOU(startNode.closest('LI')) ? startNode.closest('LI') : startNode;
@@ -228,6 +235,25 @@ var Lists = /** @class */ (function () {
228
235
  }
229
236
  e.event.preventDefault();
230
237
  }
238
+ else if (!isNOU(parentList) && !range.collapsed && parentList.textContent === fullContent) {
239
+ range.deleteContents();
240
+ this.parent.editableElement.querySelectorAll('li').forEach(function (li) {
241
+ if (!li.firstChild || li.textContent.trim() === '') {
242
+ li.parentNode.removeChild(li);
243
+ }
244
+ });
245
+ this.parent.editableElement.querySelectorAll('ol').forEach(function (ol) {
246
+ if (!ol.firstChild || ol.textContent.trim() === '') {
247
+ ol.parentNode.removeChild(ol);
248
+ }
249
+ });
250
+ this.parent.editableElement.querySelectorAll('ul').forEach(function (ul) {
251
+ if (!ul.firstChild || ul.textContent.trim() === '') {
252
+ ul.parentNode.removeChild(ul);
253
+ }
254
+ });
255
+ e.event.preventDefault();
256
+ }
231
257
  };
232
258
  Lists.prototype.onKeyUp = function () {
233
259
  if (!isNOU(this.commonLIParent) && !isNOU(this.commonLIParent.querySelector('.removeList'))) {
@@ -267,7 +293,7 @@ var Lists = /** @class */ (function () {
267
293
  if (e.event.which === 8) {
268
294
  this.backspaceList(e);
269
295
  }
270
- if (e.event.which === 46 && e.event.action === 'delete') {
296
+ if ((e.event.which === 46 && e.event.action === 'delete') || (e.event.which === 88 && e.event.action === 'cut')) {
271
297
  var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
272
298
  var commonAncestor = range.commonAncestorContainer;
273
299
  var startEle = range.startContainer;
@@ -623,6 +649,10 @@ var Lists = /** @class */ (function () {
623
649
  }
624
650
  else {
625
651
  this.checkLists(elements, type, item);
652
+ var marginLeftAttribute = '';
653
+ if (elements[0].style.marginLeft !== '') {
654
+ marginLeftAttribute = ' style = "margin-left: ' + elements[0].style.marginLeft + ';"';
655
+ }
626
656
  for (var i = 0; i < elements.length; i++) {
627
657
  if (!isNOU(item) && !isNOU(item.listStyle)) {
628
658
  if (item.listStyle === 'listImage') {
@@ -633,6 +663,9 @@ var Lists = /** @class */ (function () {
633
663
  setStyleAttribute(elements[i], { 'list-style-type': item.listStyle.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase() });
634
664
  }
635
665
  }
666
+ var elemAtt = void 0;
667
+ elements[i].style.removeProperty('margin-left');
668
+ elemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
636
669
  if (elements[i].getAttribute('contenteditable') === 'true'
637
670
  && elements[i].childNodes.length === 1 && elements[i].childNodes[0].nodeName === 'TABLE') {
638
671
  var listEle = document.createElement(type);
@@ -642,8 +675,7 @@ var Lists = /** @class */ (function () {
642
675
  else if ('LI' !== elements[i].tagName && isNOU(item) &&
643
676
  elements[i].nodeName === 'BLOCKQUOTE') {
644
677
  isReverse = false;
645
- var elemAtt = this.domNode.attributes(elements[i]);
646
- var openTag = '<' + type + '>';
678
+ var openTag = '<' + type + marginLeftAttribute + '>';
647
679
  var closeTag = '</' + type + '>';
648
680
  var newTag = 'li' + elemAtt;
649
681
  var replaceHTML = elements[i].innerHTML;
@@ -653,8 +685,7 @@ var Lists = /** @class */ (function () {
653
685
  }
654
686
  else if ('LI' !== elements[i].tagName && isNOU(item)) {
655
687
  isReverse = false;
656
- var elemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
657
- var openTag = '<' + type + '>';
688
+ var openTag = '<' + type + marginLeftAttribute + '>';
658
689
  var closeTag = '</' + type + '>';
659
690
  var newTag = 'li' + elemAtt;
660
691
  var replaceHTML = (elements[i].tagName.toLowerCase() === CONSTANT.DEFAULT_TAG ?
@@ -666,8 +697,8 @@ var Lists = /** @class */ (function () {
666
697
  else if (!isNOU(item) && 'LI' !== elements[i].tagName) {
667
698
  // eslint-disable-next-line
668
699
  isReverse = false;
669
- var elemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
670
- var openTag = '<' + type + elemAtt + '>';
700
+ var currentElemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
701
+ var openTag = '<' + type + currentElemAtt + '>';
671
702
  var closeTag = '</' + type + '>';
672
703
  var newTag = 'li';
673
704
  var replaceHTML = (elements[i].tagName.toLowerCase() === CONSTANT.DEFAULT_TAG ?
@@ -867,17 +898,18 @@ var Lists = /** @class */ (function () {
867
898
  var wrapperclass = isNullOrUndefined(className) ? ' class="e-rte-wrap-inner"' :
868
899
  ' class="' + className + ' e-rte-wrap-inner"';
869
900
  var parentElement = parentNode;
870
- if (!isNOU(parentElement.style.listStyleType)) {
871
- parentNode.style.removeProperty("list-style-type");
872
- }
873
- if (!isNOU(parentElement.style.listStyleImage)) {
874
- parentNode.style.removeProperty("list-style-image");
875
- }
876
- if (parentElement.style.length === 0) {
877
- parentNode.removeAttribute("style");
901
+ if (elements.length === parentElement.querySelectorAll('li').length) {
902
+ if (!isNOU(parentElement.style.listStyleType)) {
903
+ parentNode.style.removeProperty("list-style-type");
904
+ }
905
+ if (!isNOU(parentElement.style.listStyleImage)) {
906
+ parentNode.style.removeProperty("list-style-image");
907
+ }
908
+ if (parentElement.style.length === 0) {
909
+ parentNode.removeAttribute("style");
910
+ }
878
911
  }
879
- var wrapper = '<' + CONSTANT.DEFAULT_TAG + wrapperclass +
880
- this.domNode.attributes(parentElement) + '></' + CONSTANT.DEFAULT_TAG + '>';
912
+ var wrapper = '<' + CONSTANT.DEFAULT_TAG + wrapperclass + this.domNode.attributes(element) + '></' + CONSTANT.DEFAULT_TAG + '>';
881
913
  if (e.enterAction !== 'BR') {
882
914
  this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapper));
883
915
  }
@@ -178,6 +178,9 @@ var NodeCutter = /** @class */ (function () {
178
178
  else {
179
179
  var startOffset = this.GetCursorStart(indexes, range.startOffset, true);
180
180
  this.position = range.startOffset - startOffset;
181
+ if (startOffset !== 0 && str[startOffset] && str[startOffset] === ' ') {
182
+ startOffset = startOffset + 1;
183
+ }
181
184
  cursorRange.setStart(range.startContainer, startOffset);
182
185
  cursorRange.setEnd(range.startContainer, this.GetCursorStart(indexes, range.startOffset, false));
183
186
  }
@@ -30,4 +30,5 @@ export declare class SelectionCommands {
30
30
  private static insertFormatPainterElem;
31
31
  private static formatPainterCleanup;
32
32
  private static concatenateTextExcludingList;
33
+ private static conCatenateTextNode;
33
34
  }
@@ -374,6 +374,10 @@ var SelectionCommands = /** @class */ (function () {
374
374
  liElement.style.fontStyle = 'normal';
375
375
  }
376
376
  }
377
+ else if (!isNOU(liElement) && liElement.tagName.toLowerCase() === 'li'
378
+ && liElement.textContent.trim() !== nodes[index].textContent.trim()) {
379
+ SelectionCommands.conCatenateTextNode(liElement, format, '', 'normal');
380
+ }
377
381
  }
378
382
  if (child[0] && !isFontStyle) {
379
383
  var nodeTraverse = child[index] ? child[index] : child[0];
@@ -432,6 +436,10 @@ var SelectionCommands = /** @class */ (function () {
432
436
  liElement.style.fontFamily = value;
433
437
  }
434
438
  }
439
+ if (!isNOU(liElement) && liElement.tagName.toLowerCase() === 'li'
440
+ && liElement.textContent.trim() !== nodes[index].textContent.trim()) {
441
+ SelectionCommands.conCatenateTextNode(liElement, format, liElement.textContent, format, value);
442
+ }
435
443
  if (child[num].textContent === startText) {
436
444
  if (num === 0) {
437
445
  range.setStartBefore(child[num]);
@@ -539,7 +547,7 @@ var SelectionCommands = /** @class */ (function () {
539
547
  parentElement = parentElement.parentElement;
540
548
  liElement = parentElement;
541
549
  }
542
- if (format === 'fontcolor' || format === 'fontname') {
550
+ if (format === 'fontcolor' || format === 'fontname' || format === 'fontsize') {
543
551
  var parentElem = nodes[index].parentElement;
544
552
  if (!isNOU(parentElem) && parentElem.childNodes) {
545
553
  for (var i = 0; i < parentElem.childNodes.length; i++) {
@@ -559,6 +567,9 @@ var SelectionCommands = /** @class */ (function () {
559
567
  case 'fontname':
560
568
  liElement_1.style.fontFamily = value;
561
569
  break;
570
+ case 'fontsize':
571
+ liElement_1.style.fontSize = value;
572
+ break;
562
573
  default:
563
574
  break;
564
575
  }
@@ -574,6 +585,9 @@ var SelectionCommands = /** @class */ (function () {
574
585
  case 'fontname':
575
586
  childElement.style.fontFamily = 'initial';
576
587
  break;
588
+ case 'fontsize':
589
+ childElement.style.fontSize = 'initial';
590
+ break;
577
591
  default:
578
592
  break;
579
593
  }
@@ -633,6 +647,10 @@ var SelectionCommands = /** @class */ (function () {
633
647
  }
634
648
  nodeList[0] = currentFormatNode;
635
649
  this.applyStyles(nodeList, 0, element);
650
+ if (!isNOU(liElement) && liElement.tagName.toLowerCase() === 'li'
651
+ && liElement.textContent.trim() !== nodes[index].textContent.trim()) {
652
+ SelectionCommands.conCatenateTextNode(liElement, format, liElement.textContent, format, value);
653
+ }
636
654
  }
637
655
  else {
638
656
  nodes[index] = this.applyStyles(nodes, index, element);
@@ -653,6 +671,10 @@ var SelectionCommands = /** @class */ (function () {
653
671
  liElement.style.fontStyle = 'italic';
654
672
  }
655
673
  }
674
+ else if (!isNOU(liElement) && liElement.tagName.toLowerCase() === 'li'
675
+ && liElement.textContent.trim() !== nodes[index].textContent.trim()) {
676
+ SelectionCommands.conCatenateTextNode(liElement, format, liElement.textContent, format);
677
+ }
656
678
  }
657
679
  }
658
680
  }
@@ -856,7 +878,9 @@ var SelectionCommands = /** @class */ (function () {
856
878
  }
857
879
  var blockChildNodes = parent.parentElement.childNodes;
858
880
  for (var k = 0; k < blockChildNodes.length; k++) {
859
- if (blockChildNodes[k].textContent.trim() === '' || blockChildNodes[k].textContent.length === 0) {
881
+ if ((blockChildNodes[k].textContent.trim() === '' || blockChildNodes[k].textContent.length === 0) &&
882
+ blockChildNodes[k].textContent.charCodeAt(0) !== 160) {
883
+ // 160 is the char code for &nbsp;
860
884
  detach(blockChildNodes[k]);
861
885
  }
862
886
  }
@@ -892,6 +916,64 @@ var SelectionCommands = /** @class */ (function () {
892
916
  }
893
917
  return result;
894
918
  };
919
+ SelectionCommands.conCatenateTextNode = function (liElement, format, value, formatStr, constVal) {
920
+ var result = '';
921
+ switch (format) {
922
+ case 'bold':
923
+ liElement.querySelectorAll('strong').forEach(function (e) {
924
+ result = result + e.textContent;
925
+ });
926
+ if (result === value) {
927
+ liElement.style.fontWeight = formatStr;
928
+ }
929
+ break;
930
+ case 'italic':
931
+ liElement.querySelectorAll('em').forEach(function (e) {
932
+ result = result + e.textContent;
933
+ });
934
+ if (result === value) {
935
+ liElement.style.fontStyle = formatStr;
936
+ }
937
+ break;
938
+ case 'fontcolor':
939
+ var colorStyle_1 = '';
940
+ liElement.querySelectorAll('span').forEach(function (span) {
941
+ colorStyle_1 = span.style.color;
942
+ if (colorStyle_1 === constVal) {
943
+ result = result + span.textContent;
944
+ }
945
+ });
946
+ if (result === value) {
947
+ liElement.style.color = colorStyle_1;
948
+ liElement.style.textDecoration = 'inherit';
949
+ }
950
+ break;
951
+ case 'fontsize':
952
+ var fontSize_1 = '';
953
+ liElement.querySelectorAll('span').forEach(function (span) {
954
+ fontSize_1 = span.style.getPropertyValue('font-size');
955
+ if (fontSize_1 === constVal) {
956
+ result = result + span.textContent;
957
+ }
958
+ });
959
+ if (result === value) {
960
+ liElement.style.fontSize = fontSize_1;
961
+ }
962
+ break;
963
+ case 'fontname':
964
+ var fontFamily_1 = '';
965
+ liElement.querySelectorAll('span').forEach(function (span) {
966
+ fontFamily_1 = span.style.getPropertyValue('font-family');
967
+ if (fontFamily_1 === constVal) {
968
+ result = result + span.textContent;
969
+ }
970
+ });
971
+ if (result === value) {
972
+ liElement.style.fontFamily = fontFamily_1;
973
+ }
974
+ break;
975
+ }
976
+ };
895
977
  SelectionCommands.enterAction = 'P';
896
978
  return SelectionCommands;
897
979
  }());
@@ -38,6 +38,10 @@ export declare class TableCommand {
38
38
  private getSelectedMinMaxIndexes;
39
39
  private HorizontalSplit;
40
40
  private VerticalSplit;
41
+ private getSplitColWidth;
42
+ private getColSizes;
43
+ private getCellIndex;
44
+ private convertPixelToPercentage;
41
45
  private getCorrespondingColumns;
42
46
  private FindIndex;
43
47
  private getCorrespondingIndex;
@@ -744,28 +744,23 @@ var TableCommand = /** @class */ (function () {
744
744
  var newCell = this.activeCell.cloneNode(true);
745
745
  newCell.removeAttribute('class');
746
746
  newCell.innerHTML = '</br>';
747
- var avgWidth = parseFloat(this.activeCell.style.width) / 2;
748
- if (this.activeCell.tagName === 'TH' && isNaN(avgWidth)) {
749
- var cellCount = this.curTable.querySelector('tr').childElementCount;
750
- var colSpanCount = 0;
751
- for (var i = 0; i < cellCount; i++) {
752
- colSpanCount = colSpanCount + (parseInt(this.curTable.querySelector('tr').children[i].getAttribute('colspan'), 10) || 1);
753
- }
754
- avgWidth = parseFloat((((this.activeCell.offsetWidth / 2) / this.curTable.offsetWidth) * 100).toFixed(1));
755
- }
756
747
  var activeCellIndex = this.getCorrespondingIndex(this.activeCell, this.getCorrespondingColumns());
757
748
  var correspondingColumns = this.getCorrespondingColumns();
758
- var activeCellcolSpan = parseInt(this.activeCell.getAttribute('colspan'), 10);
749
+ var activeCellcolSpan = parseInt(this.activeCell.getAttribute('colspan'), 10) || 1;
759
750
  if (activeCellcolSpan > 1) {
760
- // eslint-disable-next-line
761
- 1 < Math.ceil(activeCellcolSpan / 2) ? this.activeCell.setAttribute('colspan', (activeCellcolSpan / 2).toString())
762
- : this.activeCell.removeAttribute('colspan');
763
- // eslint-disable-next-line
764
- 1 < (activeCellcolSpan - activeCellcolSpan / 2) ? newCell.setAttribute('colspan',
765
- // eslint-disable-next-line
766
- (activeCellcolSpan - activeCellcolSpan / 2).toString()) : newCell.removeAttribute('colspan');
751
+ var colSpan = Math.ceil(activeCellcolSpan / 2);
752
+ var getColSizes = this.getColSizes(this.curTable);
753
+ var activeCellUpdatedWidth = this.getSplitColWidth(activeCellIndex[1], activeCellIndex[1] + colSpan - 1, getColSizes);
754
+ var newCellWidth = this.getSplitColWidth(activeCellIndex[1] + colSpan, activeCellIndex[1] + activeCellcolSpan - 1, getColSizes);
755
+ var activeCellWidth = this.convertPixelToPercentage(this.activeCell.offsetWidth, this.curTable.offsetWidth);
756
+ newCellWidth = (activeCellWidth - activeCellUpdatedWidth) < newCellWidth ? (activeCellWidth - activeCellUpdatedWidth) : newCellWidth;
757
+ 1 < colSpan ? this.activeCell.setAttribute('colspan', colSpan.toString()) : this.activeCell.removeAttribute('colspan');
758
+ 1 < activeCellcolSpan - colSpan ? newCell.setAttribute('colspan', (activeCellcolSpan - colSpan).toString()) : newCell.removeAttribute('colspan');
759
+ this.activeCell.style.width = activeCellUpdatedWidth + '%';
760
+ newCell.style.width = newCellWidth + '%';
767
761
  }
768
762
  else {
763
+ var avgWidth = parseFloat(this.activeCell.style.width) / 2;
769
764
  for (var i = 0; i <= allRows.length - 1; i++) {
770
765
  if (0 === i || correspondingColumns[i][activeCellIndex[1]] !== correspondingColumns[i - 1][activeCellIndex[1]]) {
771
766
  var currentCell = correspondingColumns[i][activeCellIndex[1]];
@@ -775,9 +770,9 @@ var TableCommand = /** @class */ (function () {
775
770
  }
776
771
  }
777
772
  }
773
+ this.activeCell.style.width = avgWidth + '%';
774
+ newCell.style.width = avgWidth + '%';
778
775
  }
779
- this.activeCell.style.width = avgWidth + '%';
780
- newCell.style.width = avgWidth + '%';
781
776
  this.activeCell.parentNode.insertBefore(newCell, this.activeCell.nextSibling);
782
777
  if (e.callBack) {
783
778
  e.callBack({
@@ -789,6 +784,54 @@ var TableCommand = /** @class */ (function () {
789
784
  });
790
785
  }
791
786
  };
787
+ TableCommand.prototype.getSplitColWidth = function (startIndex, endInex, sizes) {
788
+ var width = 0;
789
+ for (var i = startIndex; i <= endInex; i++) {
790
+ width += sizes[i];
791
+ }
792
+ return this.convertPixelToPercentage(width, this.curTable.offsetWidth);
793
+ };
794
+ TableCommand.prototype.getColSizes = function (curTable) {
795
+ var cellColl = curTable.rows[0].cells;
796
+ var cellCount = 0;
797
+ for (var cell = 0; cell < cellColl.length; cell++) {
798
+ cellCount = cellCount + cellColl[cell].colSpan;
799
+ }
800
+ var sizes = new Array(cellCount);
801
+ var rowSpanCells = new Map();
802
+ for (var i = 0; i < curTable.rows.length; i++) {
803
+ var currentColIndex = 0;
804
+ for (var k = 0; k < curTable.rows[i].cells.length; k++) {
805
+ for (var l = 1; l < curTable.rows[i].cells[k].rowSpan; l++) {
806
+ var key = "" + (i + l) + currentColIndex;
807
+ rowSpanCells.set(key, curTable.rows[i].cells[k]);
808
+ }
809
+ var cellIndex = this.getCellIndex(rowSpanCells, i, k);
810
+ if (cellIndex > currentColIndex) {
811
+ currentColIndex = cellIndex;
812
+ }
813
+ var width = curTable.rows[i].cells[k].offsetWidth;
814
+ if (!sizes[currentColIndex] || width < sizes[currentColIndex]) {
815
+ sizes[currentColIndex] = width;
816
+ }
817
+ currentColIndex += 1 + curTable.rows[i].cells[k].colSpan - 1;
818
+ }
819
+ }
820
+ return sizes;
821
+ };
822
+ TableCommand.prototype.getCellIndex = function (rowSpanCells, rowIndex, colIndex) {
823
+ var cellKey = "" + rowIndex + colIndex;
824
+ var spannedCell = rowSpanCells.get(cellKey);
825
+ if (spannedCell) {
826
+ return this.getCellIndex(rowSpanCells, rowIndex, colIndex + spannedCell.colSpan);
827
+ }
828
+ else {
829
+ return colIndex;
830
+ }
831
+ };
832
+ TableCommand.prototype.convertPixelToPercentage = function (value, offsetValue) {
833
+ return (value / offsetValue) * 100;
834
+ };
792
835
  TableCommand.prototype.getCorrespondingColumns = function () {
793
836
  var elementArray = [];
794
837
  // eslint-disable-next-line
@@ -48,6 +48,7 @@ export declare class BaseQuickToolbar implements IBaseQuickToolbar {
48
48
 
49
49
  */
50
50
  showPopup(x: number, y: number, target: Element, type?: string): void;
51
+ private tooltipBeforeRender;
51
52
  /**
52
53
  * hidePopup method
53
54
  *
@@ -103,26 +103,19 @@ var BaseQuickToolbar = /** @class */ (function () {
103
103
  }
104
104
  target = isAligned ? e.target : target;
105
105
  var targetOffsetLeft;
106
- var currentOffsetWidth;
107
106
  if (!isNOU(closest(target, 'table'))) {
108
107
  targetOffsetLeft = target.offsetLeft;
109
- var parentTable = closest(target, 'table');
110
- var checkOffSetParentWidth = false;
111
- if (!isNOU(closest(parentTable, 'TD'))) {
112
- checkOffSetParentWidth = true;
113
- }
108
+ var parentTable = closest(target.parentElement, 'td');
114
109
  while (!isNOU(parentTable)) {
115
110
  targetOffsetLeft += parentTable.offsetLeft;
116
- currentOffsetWidth = checkOffSetParentWidth ? parentTable.offsetWidth : target.offsetWidth;
117
111
  parentTable = closest(parentTable.parentElement, 'table');
118
112
  }
119
113
  }
120
114
  else {
121
- currentOffsetWidth = target.offsetWidth;
122
115
  targetOffsetLeft = (target.classList.contains("e-rte-audio")) ? target.parentElement.offsetLeft : target.offsetLeft;
123
116
  }
124
- if (currentOffsetWidth > e.popWidth) {
125
- x = (currentOffsetWidth / 2) - (e.popWidth / 2) + e.parentData.left + targetOffsetLeft;
117
+ if (target.offsetWidth > e.popWidth) {
118
+ x = (target.offsetWidth / 2) - (e.popWidth / 2) + e.parentData.left + targetOffsetLeft;
126
119
  }
127
120
  else {
128
121
  x = e.parentData.left + targetOffsetLeft;
@@ -262,6 +255,7 @@ var BaseQuickToolbar = /** @class */ (function () {
262
255
  target: '#' + _this.element.id + ' [title]',
263
256
  openDelay: 400,
264
257
  showTipPointer: true,
258
+ beforeRender: _this.tooltipBeforeRender.bind(_this),
265
259
  windowCollision: true,
266
260
  position: 'BottomCenter',
267
261
  cssClass: _this.parent.getCssClass()
@@ -322,6 +316,11 @@ var BaseQuickToolbar = /** @class */ (function () {
322
316
  }
323
317
  });
324
318
  };
319
+ BaseQuickToolbar.prototype.tooltipBeforeRender = function (args) {
320
+ if (args.target.querySelector('.e-active')) {
321
+ args.cancel = true;
322
+ }
323
+ };
325
324
  /**
326
325
  * hidePopup method
327
326
  *
@@ -354,9 +353,6 @@ var BaseQuickToolbar = /** @class */ (function () {
354
353
  this.parent.enableToolbarItem(this.parent.toolbarSettings.items);
355
354
  }
356
355
  }
357
- if (this.parent.showTooltip && !isNOU(document.querySelector('.e-tooltip-wrap'))) {
358
- this.parent.notify(events.destroyTooltip, { args: event });
359
- }
360
356
  this.removeEleFromDOM();
361
357
  this.isRendered = false;
362
358
  };