@syncfusion/ej2-richtexteditor 25.2.4 → 25.2.5

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 25.2.4
3
+ * version : 25.2.5
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.2.3",
3
+ "_id": "@syncfusion/ej2-richtexteditor@25.2.4",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-l5lUzKF2Mrk2KgQR3Sez/lXpDu9vZnnUJXSfQNUHy+kfr+Z8qd+8SwR06pt7hBZjn05UTHz+TLCmRKA+uYmTHQ==",
5
+ "_integrity": "sha512-axjlW/M2AfJzH2TUhZ6jxy0E69gZEmC+Oxm+OBXnGOWNez043U4Nw8uw+eV/UuK52BrzdX0n99k9vxWwlIoKcw==",
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.2.3.tgz",
29
- "_shasum": "ca743ef7877548820123a735ac98979caf771278",
28
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-25.2.4.tgz",
29
+ "_shasum": "b32bf82ce555a4b5b2905f206d207d22866194fd",
30
30
  "_spec": "@syncfusion/ej2-richtexteditor@*",
31
31
  "_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
32
32
  "author": {
@@ -37,10 +37,10 @@
37
37
  },
38
38
  "bundleDependencies": false,
39
39
  "dependencies": {
40
- "@syncfusion/ej2-base": "~25.2.3",
40
+ "@syncfusion/ej2-base": "~25.2.5",
41
41
  "@syncfusion/ej2-buttons": "~25.2.4",
42
42
  "@syncfusion/ej2-filemanager": "~25.2.3",
43
- "@syncfusion/ej2-inputs": "~25.2.3",
43
+ "@syncfusion/ej2-inputs": "~25.2.5",
44
44
  "@syncfusion/ej2-navigations": "~25.2.4",
45
45
  "@syncfusion/ej2-popups": "~25.2.4",
46
46
  "@syncfusion/ej2-splitbuttons": "~25.2.4"
@@ -79,6 +79,6 @@
79
79
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
80
80
  },
81
81
  "typings": "index.d.ts",
82
- "version": "25.2.4",
82
+ "version": "25.2.5",
83
83
  "sideEffects": false
84
84
  }
@@ -213,11 +213,14 @@ export function nestedListCleanUp(range) {
213
213
  item.remove();
214
214
  });
215
215
  }
216
+ else {
217
+ break;
218
+ }
216
219
  }
217
220
  var liElem = (range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll("li");
218
221
  if (liElem.length > 0) {
219
222
  liElem.forEach(function (item) {
220
- if (item.firstChild.nodeName === "OL" || item.firstChild.nodeName === "UL") {
223
+ if (!isNullOrUndefined(item.firstChild) && (item.firstChild.nodeName === "OL" || item.firstChild.nodeName === "UL")) {
221
224
  item.style.listStyleType = "none";
222
225
  }
223
226
  });
@@ -115,12 +115,14 @@ var EditorManager = /** @class */ (function () {
115
115
  case 'alignments':
116
116
  this.observer.notify(CONSTANT.ALIGNMENT_TYPE, {
117
117
  subCommand: value, event: event, callBack: callBack,
118
- selector: selector,
119
- value: exeValue
118
+ selector: selector, value: exeValue, enterAction: enterAction
120
119
  });
121
120
  break;
122
121
  case 'indents':
123
- this.observer.notify(CONSTANT.INDENT_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector });
122
+ this.observer.notify(CONSTANT.INDENT_TYPE, {
123
+ subCommand: value, event: event, callBack: callBack,
124
+ selector: selector, enterAction: enterAction
125
+ });
124
126
  break;
125
127
  case 'links':
126
128
  this.observer.notify(CONSTANT.LINK, { command: command, value: value, item: exeValue, event: event, callBack: callBack });
@@ -64,6 +64,9 @@ var Alignments = /** @class */ (function () {
64
64
  if (!isTableAlign) {
65
65
  this.parent.domNode.setMarker(save);
66
66
  var alignmentNodes = this.parent.domNode.blockNodes();
67
+ if (e.enterAction === 'BR') {
68
+ alignmentNodes = this.parent.domNode.convertToBlockNodes(alignmentNodes, false);
69
+ }
67
70
  for (var i = 0; i < alignmentNodes.length; i++) {
68
71
  var parentNode = alignmentNodes[i];
69
72
  setStyleAttribute(parentNode, { 'text-align': this.alignments[e.subCommand] });
@@ -314,6 +314,26 @@ export declare class DOMNode {
314
314
 
315
315
  */
316
316
  getImageTagInSelection(): NodeListOf<HTMLImageElement>;
317
+ /**
318
+ * Method to wrap the inline and text node with block node.
319
+ *
320
+ * @param {HTMLElement} node - specifies the element sent to wrap the node around it with block nodes.
321
+ * @param {string} wrapperElement - specifies which block nodes to wrap around.
322
+ * @returns {HTMLElement} - returns the wrapped element.
323
+ * @hidden
324
+
325
+ */
326
+ gatherElementsAround(node: HTMLElement, wrapperElement: string): HTMLElement;
327
+ /**
328
+ * Method to convert all the inline nodes between the selection to block nodes.
329
+ *
330
+ * @param {Node[]} selectedNodes - specifies the nodes of the start and end selection.
331
+ * @param {boolean} fromList - specifies if the method is called from list module.
332
+ * @returns {Node[]} - returns the selected list of elements as block nodes.
333
+ * @hidden
334
+
335
+ */
336
+ convertToBlockNodes(selectedNodes: Node[], fromList: boolean): Node[];
317
337
  /**
318
338
  * blockNodes method
319
339
  *
@@ -1,5 +1,5 @@
1
1
  import * as CONSTANT from './../base/constant';
2
- import { append, detach, createElement, isNullOrUndefined as isNOU } from '@syncfusion/ej2-base';
2
+ import { append, detach, createElement, isNullOrUndefined as isNOU, closest } from '@syncfusion/ej2-base';
3
3
  import { NodeSelection } from './../../selection/index';
4
4
  import { selfClosingTags } from '../../common/config';
5
5
  import { getLastTextNode } from '../../common/util';
@@ -668,6 +668,109 @@ var DOMNode = /** @class */ (function () {
668
668
  }
669
669
  return null;
670
670
  };
671
+ /**
672
+ * Method to wrap the inline and text node with block node.
673
+ *
674
+ * @param {HTMLElement} node - specifies the element sent to wrap the node around it with block nodes.
675
+ * @param {string} wrapperElement - specifies which block nodes to wrap around.
676
+ * @returns {HTMLElement} - returns the wrapped element.
677
+ * @hidden
678
+
679
+ */
680
+ DOMNode.prototype.gatherElementsAround = function (node, wrapperElement) {
681
+ var newWrapElem = createElement(wrapperElement);
682
+ // Insert the new div element before the current node.
683
+ var currentNode = node.previousSibling;
684
+ var currentNodeParent = node.parentElement;
685
+ if (currentNodeParent.className === 'e-editor-select-start') {
686
+ currentNodeParent.parentNode.insertBefore(newWrapElem, currentNodeParent);
687
+ }
688
+ else if (currentNodeParent) {
689
+ currentNodeParent.insertBefore(newWrapElem, node);
690
+ }
691
+ var i = 0;
692
+ while (currentNode !== null && currentNode.nodeName !== 'BR' &&
693
+ !this.isBlockNode(currentNode)) {
694
+ var prevSibling = currentNode.previousSibling;
695
+ if (currentNode.nodeType === 3 || currentNode.nodeType === 1) {
696
+ if (i === 0) {
697
+ newWrapElem.appendChild(currentNode);
698
+ }
699
+ else {
700
+ newWrapElem.insertBefore(currentNode, newWrapElem.firstChild);
701
+ }
702
+ }
703
+ currentNode = prevSibling;
704
+ i++;
705
+ }
706
+ // Add the current node to the new div
707
+ newWrapElem.appendChild(node);
708
+ // Gather text and inline elements after the currentNode
709
+ currentNode = newWrapElem.nextSibling ? newWrapElem.nextSibling :
710
+ newWrapElem.parentElement.nextSibling;
711
+ while (currentNode !== null && currentNode.nodeName !== 'BR' &&
712
+ !this.isBlockNode(currentNode)) {
713
+ var nextSibling = currentNode.nextSibling ?
714
+ currentNode.nextSibling : currentNode.parentElement.nextSibling;
715
+ if (currentNode.nodeType === 3 || currentNode.nodeType === 1) {
716
+ newWrapElem.appendChild(currentNode);
717
+ }
718
+ currentNode = nextSibling;
719
+ }
720
+ return newWrapElem;
721
+ };
722
+ /**
723
+ * Method to convert all the inline nodes between the selection to block nodes.
724
+ *
725
+ * @param {Node[]} selectedNodes - specifies the nodes of the start and end selection.
726
+ * @param {boolean} fromList - specifies if the method is called from list module.
727
+ * @returns {Node[]} - returns the selected list of elements as block nodes.
728
+ * @hidden
729
+
730
+ */
731
+ DOMNode.prototype.convertToBlockNodes = function (selectedNodes, fromList) {
732
+ if (selectedNodes.length > 1) {
733
+ var i = 0;
734
+ var currentSelectedNode = selectedNodes[0];
735
+ while (!isNOU(currentSelectedNode)) {
736
+ if (currentSelectedNode.nodeName === 'BR') {
737
+ var nextNode = currentSelectedNode.nextSibling;
738
+ detach(currentSelectedNode);
739
+ currentSelectedNode = nextNode;
740
+ }
741
+ if (!isNOU(currentSelectedNode)) {
742
+ if (fromList) {
743
+ selectedNodes[i] = currentSelectedNode.nodeName === 'LI' || this.isBlockNode(currentSelectedNode) ?
744
+ currentSelectedNode :
745
+ this.gatherElementsAround(currentSelectedNode, (fromList ? 'p' : 'div'));
746
+ }
747
+ else {
748
+ selectedNodes[i] = !this.isBlockNode(selectedNodes[i]) ?
749
+ this.gatherElementsAround(currentSelectedNode, (fromList ? 'p' : 'div')) :
750
+ selectedNodes[i];
751
+ }
752
+ var currentProcessNode = selectedNodes[i].nodeName === 'LI' ? selectedNodes[i].parentElement : selectedNodes[i];
753
+ var currentElementCheckNode = currentProcessNode.nodeName === '#text' ? currentProcessNode.parentElement : currentProcessNode;
754
+ currentSelectedNode = !isNOU(currentElementCheckNode.querySelector('.e-editor-select-end')) ||
755
+ !isNOU(closest(currentSelectedNode, '.e-editor-select-end')) ?
756
+ null : currentProcessNode.nextSibling;
757
+ if (currentSelectedNode === null && !isNOU(currentProcessNode.nextSibling) && currentProcessNode.nextSibling.nodeName === 'BR') {
758
+ detach(currentProcessNode.nextSibling);
759
+ }
760
+ }
761
+ i++;
762
+ }
763
+ }
764
+ else {
765
+ if (!this.isBlockNode(selectedNodes[0])) {
766
+ selectedNodes[0] = this.gatherElementsAround(selectedNodes[0], (fromList ? 'p' : 'div'));
767
+ if (!isNOU(selectedNodes[0].nextSibling) && (selectedNodes[0].nextSibling.nodeName === 'BR')) {
768
+ detach(selectedNodes[0].nextSibling);
769
+ }
770
+ }
771
+ }
772
+ return selectedNodes;
773
+ };
671
774
  /**
672
775
  * blockNodes method
673
776
  *
@@ -51,7 +51,7 @@ var Formats = /** @class */ (function () {
51
51
  }
52
52
  }
53
53
  }
54
- if (e.enterAction !== 'BR' && !isNOU(range.startContainer) && !isNOU(range.startContainer.parentElement) && range.startContainer === range.endContainer && range.startContainer.nodeName === '#text' && range.startContainer.parentElement.classList.contains("e-content") && range.startContainer.parentElement.isContentEditable) {
54
+ if (e.enterAction !== 'BR' && !isNOU(range.startContainer) && !isNOU(range.startContainer.parentElement) && range.startContainer === range.endContainer && range.startContainer.nodeName === '#text' && range.startContainer.parentElement.classList.contains('e-content') && range.startContainer.parentElement.isContentEditable) {
55
55
  var pTag = createElement(e.enterAction);
56
56
  range.startContainer.parentElement.insertBefore(pTag, range.startContainer);
57
57
  pTag.appendChild(range.startContainer);
@@ -43,6 +43,9 @@ var Indents = /** @class */ (function () {
43
43
  var save = this.parent.nodeSelection.save(range, this.parent.currentDocument);
44
44
  this.parent.domNode.setMarker(save);
45
45
  var indentsNodes = this.parent.domNode.blockNodes();
46
+ if (e.enterAction === 'BR') {
47
+ indentsNodes = this.parent.domNode.convertToBlockNodes(indentsNodes, false);
48
+ }
46
49
  var parentNodes = indentsNodes.slice();
47
50
  var listsNodes = [];
48
51
  for (var i = 0; i < parentNodes.length; i++) {
@@ -47,5 +47,4 @@ export declare class Lists {
47
47
  private revertList;
48
48
  private openTag;
49
49
  private closeTag;
50
- private gatherElementsAround;
51
50
  }
@@ -553,39 +553,7 @@ var Lists = /** @class */ (function () {
553
553
  var listsNodes = this.domNode.blockNodes(true);
554
554
  if (e.enterAction === 'BR') {
555
555
  this.setSelectionBRConfig();
556
- var selectedNodes = this.parent.domNode.blockNodes();
557
- if (selectedNodes.length > 1) {
558
- var i = 0;
559
- var currentAlignmentNode = selectedNodes[0];
560
- while (!isNOU(currentAlignmentNode)) {
561
- if (currentAlignmentNode.nodeName === 'BR') {
562
- var nextNode = currentAlignmentNode.nextSibling;
563
- detach(currentAlignmentNode);
564
- currentAlignmentNode = nextNode;
565
- }
566
- if (!isNOU(currentAlignmentNode)) {
567
- selectedNodes[i] = currentAlignmentNode.nodeName === 'LI' || this.parent.domNode.isBlockNode(currentAlignmentNode) ?
568
- currentAlignmentNode : this.gatherElementsAround(currentAlignmentNode);
569
- var currentSelectNode = selectedNodes[i].nodeName === 'LI' ? selectedNodes[i].parentElement : selectedNodes[i];
570
- var currentElementCheckNode = currentAlignmentNode.nodeName === '#text' ? currentAlignmentNode.parentElement : currentAlignmentNode;
571
- currentAlignmentNode = !isNOU(currentElementCheckNode.querySelector('.e-editor-select-end')) ||
572
- !isNOU(closest(currentAlignmentNode, '.e-editor-select-end')) ?
573
- null : currentSelectNode.nextSibling;
574
- if (currentAlignmentNode === null && !isNOU(currentSelectNode.nextSibling) && currentSelectNode.nextSibling.nodeName === 'BR') {
575
- detach(currentSelectNode.nextSibling);
576
- }
577
- }
578
- i++;
579
- }
580
- }
581
- else {
582
- if (!this.parent.domNode.isBlockNode(selectedNodes[0])) {
583
- selectedNodes[0] = this.gatherElementsAround(selectedNodes[0]);
584
- if (!isNOU(selectedNodes[0].nextSibling) && (selectedNodes[0].nextSibling.nodeName === 'BR')) {
585
- detach(selectedNodes[0].nextSibling);
586
- }
587
- }
588
- }
556
+ this.parent.domNode.convertToBlockNodes(this.parent.domNode.blockNodes(), true);
589
557
  this.setSelectionBRConfig();
590
558
  listsNodes = this.parent.domNode.blockNodes();
591
559
  }
@@ -897,7 +865,7 @@ var Lists = /** @class */ (function () {
897
865
  parentNode.removeAttribute("style");
898
866
  }
899
867
  }
900
- var wrapper = '<' + CONSTANT.DEFAULT_TAG + wrapperclass + this.domNode.attributes(element) + '></' + CONSTANT.DEFAULT_TAG + '>';
868
+ var wrapper = '<' + e.enterAction + wrapperclass + this.domNode.attributes(element) + '></' + e.enterAction + '>';
901
869
  if (e.enterAction !== 'BR') {
902
870
  this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapper));
903
871
  }
@@ -971,48 +939,6 @@ var Lists = /** @class */ (function () {
971
939
  Lists.prototype.closeTag = function (type) {
972
940
  return this.domNode.parseHTMLFragment('<span class="e-rte-list-close-' + type.toLowerCase() + '"></span>');
973
941
  };
974
- Lists.prototype.gatherElementsAround = function (node) {
975
- var pWrap = document.createElement('p');
976
- // Insert the new div before the current node
977
- var currentNode = node.previousSibling;
978
- var classNode = node.parentNode;
979
- if (classNode.className === 'e-editor-select-start') {
980
- node.parentNode.parentNode.insertBefore(pWrap, node.parentNode);
981
- }
982
- else if (node.parentNode) {
983
- node.parentNode.insertBefore(pWrap, node);
984
- }
985
- // Gather text and inline elements before the currentNode
986
- var i = 0;
987
- while (currentNode !== null && currentNode.nodeName !== 'BR' &&
988
- !this.parent.domNode.isBlockNode(currentNode)) {
989
- var prevSibling = currentNode.previousSibling;
990
- if (currentNode.nodeType === 3 || currentNode.nodeType === 1) {
991
- if (i === 0) {
992
- pWrap.appendChild(currentNode);
993
- }
994
- else {
995
- pWrap.insertBefore(currentNode, pWrap.firstChild);
996
- }
997
- }
998
- currentNode = prevSibling;
999
- i++;
1000
- }
1001
- // Add the current node to the new p
1002
- pWrap.appendChild(node);
1003
- // Gather text and inline elements after the currentNode
1004
- currentNode = pWrap.nextSibling ? pWrap.nextSibling : pWrap.parentElement.nextSibling;
1005
- while (currentNode !== null && currentNode.nodeName !== 'BR' &&
1006
- !this.parent.domNode.isBlockNode(currentNode)) {
1007
- var nextSibling = currentNode.nextSibling ?
1008
- currentNode.nextSibling : currentNode.parentElement.nextSibling;
1009
- if (currentNode.nodeType === 3 || currentNode.nodeType === 1) {
1010
- pWrap.appendChild(currentNode);
1011
- }
1012
- currentNode = nextSibling;
1013
- }
1014
- return pWrap;
1015
- };
1016
942
  return Lists;
1017
943
  }());
1018
944
  export { Lists };
@@ -25,9 +25,6 @@ var FullScreen = /** @class */ (function () {
25
25
  && !isNOU(this.parent.quickToolbarModule)) {
26
26
  this.parent.quickToolbarModule.hideQuickToolbars();
27
27
  }
28
- if (this.parent.showTooltip && !isNOU(document.querySelector('.e-tooltip-wrap'))) {
29
- this.parent.notify(events.destroyTooltip, { args: event });
30
- }
31
28
  this.scrollableParent = getScrollableParent(this.parent.element);
32
29
  if (!this.parent.element.classList.contains(classes.CLS_FULL_SCREEN)) {
33
30
  var evenArgs = {
@@ -80,9 +77,6 @@ var FullScreen = /** @class */ (function () {
80
77
  && !isNOU(this.parent.quickToolbarModule)) {
81
78
  this.parent.quickToolbarModule.hideQuickToolbars();
82
79
  }
83
- if (this.parent.showTooltip && !isNOU(document.querySelector('.e-tooltip-wrap'))) {
84
- this.parent.notify(events.destroyTooltip, { args: event });
85
- }
86
80
  if (this.parent.element.classList.contains(classes.CLS_FULL_SCREEN)) {
87
81
  var evenArgs = {
88
82
  cancel: false,
@@ -106,4 +106,5 @@ export declare class HtmlEditor {
106
106
  * @hidden
107
107
  */
108
108
  private getSelectedHtml;
109
+ private marginTabAdd;
109
110
  }
@@ -287,25 +287,54 @@ var HtmlEditor = /** @class */ (function () {
287
287
  this.deleteCleanup(e, currentRange);
288
288
  }
289
289
  if (args.keyCode === 9 && this.parent.enableTabKey) {
290
+ this.parent.formatter.saveData(e);
290
291
  if (!isNOU(args.target) && isNullOrUndefined(closest(args.target, '.e-rte-toolbar'))) {
291
292
  var range = this.nodeSelectionObj.getRange(this.contentRenderer.getDocument());
292
293
  var parentNode = this.nodeSelectionObj.getParentNodeCollection(range);
293
294
  if (!((parentNode[0].nodeName === 'LI' || closest(parentNode[0], 'li') ||
294
295
  closest(parentNode[0], 'table')) && range.startOffset === 0)) {
295
296
  args.preventDefault();
296
- if (!args.shiftKey) {
297
- InsertHtml.Insert(this.contentRenderer.getDocument(), '&nbsp;&nbsp;&nbsp;&nbsp;');
298
- this.rangeCollection.push(this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()));
297
+ var selection = this.contentRenderer.getDocument().getSelection().getRangeAt(0);
298
+ var alignmentNodes = this.parent.formatter.editorManager.domNode.blockNodes();
299
+ if (this.parent.enterKey === 'BR') {
300
+ if (selection.startOffset !== selection.endOffset && selection.startOffset === 0) {
301
+ var save = this.nodeSelectionObj.save(range, this.contentRenderer.getDocument());
302
+ this.parent.formatter.editorManager.domNode.setMarker(save);
303
+ alignmentNodes = this.parent.formatter.editorManager.domNode.blockNodes();
304
+ this.parent.formatter.editorManager.domNode.convertToBlockNodes(alignmentNodes, false);
305
+ this.marginTabAdd(args.shiftKey, alignmentNodes);
306
+ save = this.parent.formatter.editorManager.domNode.saveMarker(save);
307
+ save.restore();
308
+ }
309
+ else {
310
+ InsertHtml.Insert(this.contentRenderer.getDocument(), '&nbsp;&nbsp;&nbsp;&nbsp;');
311
+ this.rangeCollection.push(this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()));
312
+ }
299
313
  }
300
- else if (this.rangeCollection.length > 0 &&
301
- this.rangeCollection[this.rangeCollection.length - 1].startContainer.textContent.length === 4) {
302
- var textCont = this.rangeCollection[this.rangeCollection.length - 1].startContainer;
303
- this.nodeSelectionObj.setSelectionText(this.contentRenderer.getDocument(), textCont, textCont, 0, textCont.textContent.length);
304
- InsertHtml.Insert(this.contentRenderer.getDocument(), document.createTextNode(''));
305
- this.rangeCollection.pop();
314
+ else {
315
+ if (!args.shiftKey) {
316
+ if (selection.startOffset !== selection.endOffset && selection.startOffset === 0) {
317
+ this.marginTabAdd(args.shiftKey, alignmentNodes);
318
+ }
319
+ else {
320
+ InsertHtml.Insert(this.contentRenderer.getDocument(), '&nbsp;&nbsp;&nbsp;&nbsp;');
321
+ this.rangeCollection.push(this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()));
322
+ }
323
+ }
324
+ else if (this.rangeCollection.length > 0 &&
325
+ this.rangeCollection[this.rangeCollection.length - 1].startContainer.textContent.length === 4) {
326
+ var textCont = this.rangeCollection[this.rangeCollection.length - 1].startContainer;
327
+ this.nodeSelectionObj.setSelectionText(this.contentRenderer.getDocument(), textCont, textCont, 0, textCont.textContent.length);
328
+ InsertHtml.Insert(this.contentRenderer.getDocument(), document.createTextNode(''));
329
+ this.rangeCollection.pop();
330
+ }
331
+ else {
332
+ this.marginTabAdd(args.shiftKey, alignmentNodes);
333
+ }
306
334
  }
307
335
  }
308
336
  }
337
+ this.parent.formatter.saveData(e);
309
338
  }
310
339
  if (e.args.action === 'space' ||
311
340
  e.args.action === 'enter' ||
@@ -968,6 +997,30 @@ var HtmlEditor = /** @class */ (function () {
968
997
  HtmlEditor.prototype.getSelectedHtml = function (e) {
969
998
  e.callBack(this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()).toString());
970
999
  };
1000
+ HtmlEditor.prototype.marginTabAdd = function (val, alignmentNodes) {
1001
+ for (var index = 0; index < alignmentNodes.length; index++) {
1002
+ var element = alignmentNodes[index];
1003
+ if (element.closest('li')) {
1004
+ continue;
1005
+ }
1006
+ if (element.style.marginLeft) {
1007
+ var count = parseInt(element.style.marginLeft, 10);
1008
+ if (val) {
1009
+ count -= 20;
1010
+ }
1011
+ else {
1012
+ count += 20;
1013
+ }
1014
+ element.style.marginLeft = count.toString() + 'px';
1015
+ if (element.style.marginLeft === '0px') {
1016
+ element.removeAttribute('style');
1017
+ }
1018
+ }
1019
+ else if (!val) {
1020
+ element.style.marginLeft = '20px';
1021
+ }
1022
+ }
1023
+ };
971
1024
  return HtmlEditor;
972
1025
  }());
973
1026
  export { HtmlEditor };
@@ -462,8 +462,6 @@ var ToolbarRenderer = /** @class */ (function () {
462
462
  target: colorPicker.element.parentElement, cssClass: css,
463
463
  enablePersistence: this.parent.enablePersistence, enableRtl: this.parent.enableRtl,
464
464
  beforeOpen: function (dropDownArgs) {
465
- colorPicker.inline = true;
466
- colorPicker.dataBind();
467
465
  if (proxy.parent.readonly || !proxy.parent.enabled) {
468
466
  dropDownArgs.cancel = true;
469
467
  return;
@@ -602,14 +600,18 @@ var ToolbarRenderer = /** @class */ (function () {
602
600
  var colorPicker = new ColorPicker({
603
601
  enablePersistence: this.parent.enablePersistence,
604
602
  enableRtl: this.parent.enableRtl,
605
- inline: false,
606
- value: '#fff',
603
+ inline: true,
604
+ value: null,
605
+ cssClass: ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass + ' ' + 'e-rte-picker-init',
607
606
  created: function () {
608
607
  var value = (item === 'backgroundcolor') ? proxy.parent.backgroundColor.default : proxy.parent.fontColor.default;
609
- colorPicker.setProperties({ value: value });
608
+ colorPicker.cssClass = ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass;
609
+ colorPicker.value = value;
610
610
  },
611
611
  mode: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.mode : proxy.parent.fontColor.mode),
612
612
  modeSwitcher: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.modeSwitcher : proxy.parent.fontColor.modeSwitcher),
613
+ presetColors: (item === 'backgroundcolor') ? this.parent.backgroundColor.colorCode : this.parent.fontColor.colorCode,
614
+ columns: (item === 'backgroundcolor') ? this.parent.backgroundColor.columns : this.parent.fontColor.columns,
613
615
  beforeTileRender: function (args) {
614
616
  args.element.classList.add(CLS_COLOR_PALETTE);
615
617
  args.element.classList.add(CLS_CUSTOM_TILE);
@@ -654,10 +656,6 @@ var ToolbarRenderer = /** @class */ (function () {
654
656
  }
655
657
  });
656
658
  colorPicker.isStringTemplate = true;
657
- colorPicker.columns = (item === 'backgroundcolor') ? this.parent.backgroundColor.columns : this.parent.fontColor.columns;
658
- colorPicker.presetColors = (item === 'backgroundcolor') ? this.parent.backgroundColor.colorCode :
659
- this.parent.fontColor.colorCode;
660
- colorPicker.cssClass = ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass;
661
659
  colorPicker.createElement = this.parent.createElement;
662
660
  colorPicker.appendTo(document.getElementById(args.target));
663
661
  return colorPicker;