@syncfusion/ej2-richtexteditor 25.1.38 → 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 (92) hide show
  1. package/CHANGELOG.md +22 -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 +1926 -1773
  6. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  7. package/dist/es6/ej2-richtexteditor.es5.js +1987 -1835
  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 +9 -9
  13. package/src/editor-manager/plugin/indents.js +1 -1
  14. package/src/editor-manager/plugin/inserthtml.js +8 -2
  15. package/src/editor-manager/plugin/link.js +4 -2
  16. package/src/editor-manager/plugin/lists.js +38 -14
  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 -4
  31. package/src/rich-text-editor/actions/quick-toolbar.d.ts +2 -0
  32. package/src/rich-text-editor/actions/quick-toolbar.js +14 -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 +27 -23
  42. package/src/rich-text-editor/renderer/video-module.js +29 -15
  43. package/styles/bootstrap-dark.css +11 -0
  44. package/styles/bootstrap.css +11 -0
  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 +11 -0
  51. package/styles/fluent.css +11 -0
  52. package/styles/highcontrast-light.css +11 -0
  53. package/styles/highcontrast.css +11 -0
  54. package/styles/material-dark.css +11 -0
  55. package/styles/material.css +11 -0
  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 +6 -0
  60. package/styles/rich-text-editor/_bootstrap-definition.scss +6 -0
  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 +6 -0
  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 +10 -0
  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 +6 -0
  74. package/styles/rich-text-editor/bootstrap-dark.css +11 -0
  75. package/styles/rich-text-editor/bootstrap.css +11 -0
  76. package/styles/rich-text-editor/bootstrap4.css +11 -0
  77. package/styles/rich-text-editor/bootstrap5-dark.css +11 -0
  78. package/styles/rich-text-editor/bootstrap5.css +11 -0
  79. package/styles/rich-text-editor/fabric-dark.css +11 -0
  80. package/styles/rich-text-editor/fabric.css +11 -0
  81. package/styles/rich-text-editor/fluent-dark.css +11 -0
  82. package/styles/rich-text-editor/fluent.css +11 -0
  83. package/styles/rich-text-editor/highcontrast-light.css +11 -0
  84. package/styles/rich-text-editor/highcontrast.css +11 -0
  85. package/styles/rich-text-editor/material-dark.css +11 -0
  86. package/styles/rich-text-editor/material.css +11 -0
  87. package/styles/rich-text-editor/material3-dark.css +11 -0
  88. package/styles/rich-text-editor/material3.css +11 -0
  89. package/styles/rich-text-editor/tailwind-dark.css +11 -0
  90. package/styles/rich-text-editor/tailwind.css +11 -0
  91. package/styles/tailwind-dark.css +11 -0
  92. package/styles/tailwind.css +11 -0
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 25.1.38
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.37",
3
+ "_id": "@syncfusion/ej2-richtexteditor@25.1.38",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-CEvrleMxqO4OKhdhi18qBG/K230NQEOrIMhby9ijEpKXDIZMDr5Ya3WHfVA+ODcCjIYsSy3kIJcH13sjKdwcyQ==",
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.37.tgz",
29
- "_shasum": "33b50ff739e07452c07dcd7aeb20843177c42689",
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,11 +38,11 @@
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.38",
41
+ "@syncfusion/ej2-buttons": "~25.1.39",
42
+ "@syncfusion/ej2-filemanager": "~25.1.39",
43
43
  "@syncfusion/ej2-inputs": "~25.1.38",
44
- "@syncfusion/ej2-navigations": "~25.1.38",
45
- "@syncfusion/ej2-popups": "~25.1.38",
44
+ "@syncfusion/ej2-navigations": "~25.1.39",
45
+ "@syncfusion/ej2-popups": "~25.1.39",
46
46
  "@syncfusion/ej2-splitbuttons": "~25.1.38"
47
47
  },
48
48
  "deprecated": false,
@@ -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.38",
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
  }
@@ -427,7 +427,7 @@ var InsertHtml = /** @class */ (function () {
427
427
  if (blockNode.nodeName === 'BODY' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
428
428
  blockNode = range.startContainer;
429
429
  }
430
- if (blockNode.closest('LI') && node && node.firstElementChild &&
430
+ if (blockNode.closest('LI') && blockNode.nodeName !== 'TD' && blockNode.nodeName !== 'TH' && blockNode.nodeName !== 'TR' && node && node.firstElementChild &&
431
431
  ((node).firstElementChild.tagName === 'OL' || node.firstElementChild.tagName === 'UL')) {
432
432
  var liNode = void 0;
433
433
  while (node.firstElementChild.lastElementChild && node.firstElementChild.lastElementChild.tagName === 'LI') {
@@ -457,7 +457,7 @@ var InsertHtml = /** @class */ (function () {
457
457
  }
458
458
  }
459
459
  else if ((currentNode.nodeName === '#text' || currentNode.nodeName === 'BR') && !isNOU(currentNode.parentElement) &&
460
- (currentNode.parentElement.nodeName === 'LI' || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
460
+ (currentNode.parentElement.nodeName === 'LI' || currentNode.parentElement.closest('LI') || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
461
461
  currentNode.parentElement.textContent.trim().length > 0) {
462
462
  splitedElm = currentNode;
463
463
  if (currentNode.parentElement.nodeName === 'LI' && !isNOU(currentNode.nextSibling) &&
@@ -466,6 +466,12 @@ var InsertHtml = /** @class */ (function () {
466
466
  }
467
467
  if (!range.collapsed) {
468
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
+ }
469
475
  }
470
476
  range.insertNode(node);
471
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,11 +208,17 @@ 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;
214
221
  endNode = endNode.nodeName !== 'LI' && endNode.nodeName !== '#text' && !isNOU(endNode.closest('LI')) ? endNode.closest('LI') : endNode;
215
- var parentList = (range.startContainer.nodeName === '#text') ? range.startContainer.parentElement.closest('li') : range.startContainer.closest('li');
216
222
  if (((range.commonAncestorContainer.nodeName === 'OL' || range.commonAncestorContainer.nodeName === 'UL' || range.commonAncestorContainer.nodeName === 'LI') &&
217
223
  isNOU(endNode.nextElementSibling) && endNode.textContent.length === range.endOffset &&
218
224
  isNOU(startNode.previousElementSibling) && range.startOffset === 0) ||
@@ -229,10 +235,23 @@ var Lists = /** @class */ (function () {
229
235
  }
230
236
  e.event.preventDefault();
231
237
  }
232
- else if (!isNOU(parentList) && parentList.textContent === range.startContainer.textContent && parentList.closest('li').previousElementSibling === null) {
238
+ else if (!isNOU(parentList) && !range.collapsed && parentList.textContent === fullContent) {
233
239
  range.deleteContents();
234
- this.parent.editableElement.querySelectorAll('li:empty').forEach(function (e) { return e.remove(); });
235
- this.parent.editableElement.querySelectorAll('ol:empty').forEach(function (e) { return e.remove(); });
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
+ });
236
255
  e.event.preventDefault();
237
256
  }
238
257
  };
@@ -630,6 +649,10 @@ var Lists = /** @class */ (function () {
630
649
  }
631
650
  else {
632
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
+ }
633
656
  for (var i = 0; i < elements.length; i++) {
634
657
  if (!isNOU(item) && !isNOU(item.listStyle)) {
635
658
  if (item.listStyle === 'listImage') {
@@ -640,6 +663,9 @@ var Lists = /** @class */ (function () {
640
663
  setStyleAttribute(elements[i], { 'list-style-type': item.listStyle.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase() });
641
664
  }
642
665
  }
666
+ var elemAtt = void 0;
667
+ elements[i].style.removeProperty('margin-left');
668
+ elemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
643
669
  if (elements[i].getAttribute('contenteditable') === 'true'
644
670
  && elements[i].childNodes.length === 1 && elements[i].childNodes[0].nodeName === 'TABLE') {
645
671
  var listEle = document.createElement(type);
@@ -649,8 +675,7 @@ var Lists = /** @class */ (function () {
649
675
  else if ('LI' !== elements[i].tagName && isNOU(item) &&
650
676
  elements[i].nodeName === 'BLOCKQUOTE') {
651
677
  isReverse = false;
652
- var elemAtt = this.domNode.attributes(elements[i]);
653
- var openTag = '<' + type + '>';
678
+ var openTag = '<' + type + marginLeftAttribute + '>';
654
679
  var closeTag = '</' + type + '>';
655
680
  var newTag = 'li' + elemAtt;
656
681
  var replaceHTML = elements[i].innerHTML;
@@ -660,8 +685,7 @@ var Lists = /** @class */ (function () {
660
685
  }
661
686
  else if ('LI' !== elements[i].tagName && isNOU(item)) {
662
687
  isReverse = false;
663
- var elemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
664
- var openTag = '<' + type + '>';
688
+ var openTag = '<' + type + marginLeftAttribute + '>';
665
689
  var closeTag = '</' + type + '>';
666
690
  var newTag = 'li' + elemAtt;
667
691
  var replaceHTML = (elements[i].tagName.toLowerCase() === CONSTANT.DEFAULT_TAG ?
@@ -673,8 +697,8 @@ var Lists = /** @class */ (function () {
673
697
  else if (!isNOU(item) && 'LI' !== elements[i].tagName) {
674
698
  // eslint-disable-next-line
675
699
  isReverse = false;
676
- var elemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
677
- var openTag = '<' + type + elemAtt + '>';
700
+ var currentElemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
701
+ var openTag = '<' + type + currentElemAtt + '>';
678
702
  var closeTag = '</' + type + '>';
679
703
  var newTag = 'li';
680
704
  var replaceHTML = (elements[i].tagName.toLowerCase() === CONSTANT.DEFAULT_TAG ?
@@ -876,16 +900,16 @@ var Lists = /** @class */ (function () {
876
900
  var parentElement = parentNode;
877
901
  if (elements.length === parentElement.querySelectorAll('li').length) {
878
902
  if (!isNOU(parentElement.style.listStyleType)) {
879
- parentNode.style.removeProperty('list-style-type');
903
+ parentNode.style.removeProperty("list-style-type");
880
904
  }
881
905
  if (!isNOU(parentElement.style.listStyleImage)) {
882
- parentNode.style.removeProperty('list-style-image');
906
+ parentNode.style.removeProperty("list-style-image");
883
907
  }
884
908
  if (parentElement.style.length === 0) {
885
- parentNode.removeAttribute('style');
909
+ parentNode.removeAttribute("style");
886
910
  }
887
911
  }
888
- var wrapper = '<' + CONSTANT.DEFAULT_TAG + wrapperclass + '></' + CONSTANT.DEFAULT_TAG + '>';
912
+ var wrapper = '<' + CONSTANT.DEFAULT_TAG + wrapperclass + this.domNode.attributes(element) + '></' + CONSTANT.DEFAULT_TAG + '>';
889
913
  if (e.enterAction !== 'BR') {
890
914
  this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapper));
891
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
  };
@@ -170,15 +170,16 @@ var BaseToolbar = /** @class */ (function () {
170
170
  for (var num = 0; num < items.length; num++) {
171
171
  var tooltipText = items[num].tooltipText;
172
172
  var shortCutKey = void 0;
173
+ var isMacDev = window.navigator.platform.toLocaleLowerCase().includes('mac');
173
174
  if (windowKeys["" + tooltipText]) {
174
- shortCutKey = window.navigator.platform.toLocaleLowerCase().includes('mac') ? windowKeys["" + tooltipText].replace('Ctrl', 'Cmd') : windowKeys["" + tooltipText];
175
+ shortCutKey = isMacDev ? windowKeys["" + tooltipText].replace('Ctrl+', '').replace('Shift+', '⇧').replace('Alt+', '⌥') : windowKeys["" + tooltipText];
175
176
  }
176
177
  else {
177
178
  shortCutKey = tooltipText;
178
179
  }
179
180
  if (shortCutKey) {
180
181
  if (!(items[num].command === "Images" && items[num].subCommand === "InsertLink")) {
181
- items[num].tooltipText = (tooltipText !== shortCutKey) ? tooltipText + ' (' + shortCutKey + ')' : tooltipText;
182
+ items[num].tooltipText = (tooltipText !== shortCutKey) ? (isMacDev) ? shortCutKey : tooltipText + ' (' + shortCutKey + ')' : tooltipText;
182
183
  }
183
184
  }
184
185
  }
@@ -16,6 +16,7 @@ export declare class DropDownButtons {
16
16
  displayDropDown: DropDownButton;
17
17
  tableRowsDropDown: DropDownButton;
18
18
  tableColumnsDropDown: DropDownButton;
19
+ tableCellDropDown: DropDownButton;
19
20
  tableCellVerticalAlignDropDown: DropDownButton;
20
21
  /**
21
22
  *