@syncfusion/ej2-richtexteditor 20.4.49 → 20.4.51

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.
@@ -12649,8 +12649,8 @@ class InsertHtml {
12649
12649
  }
12650
12650
  if (range.startContainer.nodeName === 'BR' && range.startOffset === 0 && range.startOffset === range.endOffset &&
12651
12651
  range.startContainer === range.endContainer) {
12652
- const currentIndex = Array.prototype.slice.call(range.startContainer.parentElement.children).indexOf(range.startContainer);
12653
- nodeSelection.setSelectionText(docElement, range.startContainer.parentElement, range.startContainer.parentElement, currentIndex + 1, currentIndex + 1);
12652
+ const currentIndex = Array.prototype.slice.call(range.startContainer.parentElement.childNodes).indexOf(range.startContainer);
12653
+ nodeSelection.setSelectionText(docElement, range.startContainer.parentElement, range.startContainer.parentElement, currentIndex, currentIndex);
12654
12654
  range = nodeSelection.getRange(docElement);
12655
12655
  }
12656
12656
  const isCursor = range.startOffset === range.endOffset && range.startOffset === 0 &&
@@ -18377,7 +18377,6 @@ class XhtmlValidation {
18377
18377
  this.currentElement = this.parent.inputElement;
18378
18378
  }
18379
18379
  this.clean(this.currentElement);
18380
- this.AddRootElement();
18381
18380
  this.ImageTags();
18382
18381
  this.removeTags();
18383
18382
  this.RemoveUnsupported();
@@ -18424,16 +18423,6 @@ class XhtmlValidation {
18424
18423
  }
18425
18424
  return currentValue;
18426
18425
  }
18427
- AddRootElement() {
18428
- if ((this.currentElement.childNodes.length === 1 && this.currentElement.firstChild.nodeName !== 'DIV') ||
18429
- this.currentElement.childNodes.length > 1) {
18430
- const parentEle = this.parent.createElement('div');
18431
- while (this.currentElement.childNodes.length > 0) {
18432
- parentEle.appendChild(this.currentElement.childNodes[0]);
18433
- }
18434
- this.currentElement.appendChild(parentEle);
18435
- }
18436
- }
18437
18426
  clean(node) {
18438
18427
  for (let n = 0; n < node.childNodes.length; n++) {
18439
18428
  const child = node.childNodes[n];
@@ -19851,7 +19840,7 @@ class PasteCleanup {
19851
19840
  this.radioRender();
19852
19841
  /* eslint-disable */
19853
19842
  if (this.parent.element.offsetHeight < parseInt(this.dialogObj.height.split('px')[0], null)) {
19854
- this.parent.height = parseInt(this.dialogObj.height.split('px')[0], null) + 40;
19843
+ this.parent.setProperties({ height: parseInt(this.dialogObj.height.split('px')[0], null) + 40 });
19855
19844
  /* eslint-enable */
19856
19845
  isHeight = true;
19857
19846
  }
@@ -27176,7 +27165,7 @@ class Table {
27176
27165
  const width = parseFloat(this.columnEle.offsetWidth.toString());
27177
27166
  const cellRow = this.curTable.rows[0].cells[0].nodeName === 'TH' ? 1 : 0;
27178
27167
  const currentTableWidth = parseFloat(this.curTable.style.width.split('%')[0]);
27179
- const currentColumnCellWidth = parseFloat(this.curTable.rows[cellRow].cells[this.colIndex].style.width.split('%')[0]);
27168
+ const currentColumnCellWidth = parseFloat(this.curTable.rows[cellRow].cells[this.colIndex >= this.curTable.rows[cellRow].cells.length ? this.curTable.rows[cellRow].cells.length - 1 : this.colIndex].style.width.split('%')[0]);
27180
27169
  if (this.currentColumnResize === 'first') {
27181
27170
  mouseX = mouseX - 0.75; //This was done for to make the gripper and the table first/last column will be close.
27182
27171
  this.removeResizeElement();
@@ -28461,7 +28450,7 @@ class EnterKeyAction {
28461
28450
  isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
28462
28451
  }
28463
28452
  if (e.args.which === 13 && e.args.code === 'Enter') {
28464
- if (isNullOrUndefined(this.startNode.closest('LI')) && isNullOrUndefined(this.endNode.closest('LI')) && isTableEnter &&
28453
+ if (isNullOrUndefined(this.startNode.closest('LI,UL,OL')) && isNullOrUndefined(this.endNode.closest('LI,UL,OL')) && isTableEnter &&
28465
28454
  isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
28466
28455
  const shiftKey = e.args.shiftKey;
28467
28456
  const actionBeginArgs = {
@@ -29608,6 +29597,7 @@ let RichTextEditor = class RichTextEditor extends Component {
29608
29597
  }
29609
29598
  else {
29610
29599
  value = this.htmlEditorModule.sanitizeHelper(value);
29600
+ value = this.enableXhtml ? this.htmlEditorModule.xhtmlValidation.selfEncloseValidation(value) : value;
29611
29601
  }
29612
29602
  }
29613
29603
  return value;
@@ -30884,8 +30874,8 @@ let RichTextEditor = class RichTextEditor extends Component {
30884
30874
  }
30885
30875
  const getTextArea = this.element.querySelector('.e-rte-srctextarea');
30886
30876
  if (this.editorMode === 'HTML') {
30887
- value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
30888
- this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
30877
+ value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>'
30878
+ || this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
30889
30879
  this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
30890
30880
  if (getTextArea && getTextArea.style.display === 'block') {
30891
30881
  value = getTextArea.value;