@syncfusion/ej2-richtexteditor 26.2.10 → 26.2.12

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.
@@ -4854,6 +4854,13 @@ function scrollToCursor(document, inputElement) {
4854
4854
  }
4855
4855
  }
4856
4856
  }
4857
+ const scrollVal = inputElement.closest('div[style*="overflow-y: scroll"]');
4858
+ if (!isNullOrUndefined(scrollVal)) {
4859
+ const parentRect = scrollVal.getBoundingClientRect();
4860
+ if (cursorBottom > parentRect.bottom) {
4861
+ scrollVal.scrollTop += (cursorBottom - parentRect.bottom);
4862
+ }
4863
+ }
4857
4864
  }
4858
4865
  /**
4859
4866
  * Inserts items at a specific index in an array.
@@ -8488,7 +8495,7 @@ class Image$1 {
8488
8495
  let altText;
8489
8496
  let selectArgs;
8490
8497
  let filesData;
8491
- let previousURL = null;
8498
+ let previousFileInfo = null;
8492
8499
  this.uploadObj = new Uploader({
8493
8500
  asyncSettings: { saveUrl: this.parent.insertImageSettings.saveUrl, removeUrl: this.parent.insertImageSettings.removeUrl },
8494
8501
  dropArea: span, multiple: false, enableRtl: this.parent.enableRtl, cssClass: this.parent.getCssClass(),
@@ -8543,10 +8550,10 @@ class Image$1 {
8543
8550
  e.detectImageSource = ImageInputSource.Uploaded;
8544
8551
  this.parent.trigger(imageUploadSuccess, e, (e) => {
8545
8552
  if (!isNullOrUndefined(this.parent.insertImageSettings.path)) {
8546
- const url = this.parent.insertImageSettings.path + e.file.name;
8553
+ const url = this.parent.insertImageSettings.path + (e).file.name;
8547
8554
  // Update the URL of the previously uploaded image
8548
- if (!isNullOrUndefined(previousURL) && e.operation === 'upload') {
8549
- proxy.imageRemovePost(previousURL);
8555
+ if (!isNullOrUndefined(previousFileInfo) && e.operation === 'upload') {
8556
+ this.uploadObj.remove(previousFileInfo);
8550
8557
  }
8551
8558
  proxy.uploadUrl = {
8552
8559
  url: url, selection: save, altText: altText, selectParent: selectParent,
@@ -8559,7 +8566,7 @@ class Image$1 {
8559
8566
  }
8560
8567
  };
8561
8568
  proxy.inputUrl.setAttribute('disabled', 'true');
8562
- previousURL = url;
8569
+ previousFileInfo = e.file;
8563
8570
  }
8564
8571
  if (e.operation === 'upload' && !isNullOrUndefined(this.dialogObj)) {
8565
8572
  this.dialogObj.getButtons(0).element.removeAttribute('disabled');
@@ -23894,6 +23901,12 @@ class InsertHtml {
23894
23901
  currentNode.nextSibling.nodeName === 'BR') {
23895
23902
  detach(currentNode.nextSibling);
23896
23903
  }
23904
+ if (currentNode.parentElement.nodeName === 'LI' && currentNode.parentElement.textContent === '') {
23905
+ this.removeListfromPaste(range);
23906
+ range.insertNode(node);
23907
+ this.contentsDeleted = true;
23908
+ return;
23909
+ }
23897
23910
  }
23898
23911
  else if ((currentNode.nodeName === '#text' || currentNode.nodeName === 'BR') && !isNullOrUndefined(currentNode.parentElement) &&
23899
23912
  (currentNode.parentElement.nodeName === 'LI' || currentNode.parentElement.closest('LI') || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
@@ -23904,13 +23917,7 @@ class InsertHtml {
23904
23917
  detach(currentNode.nextSibling);
23905
23918
  }
23906
23919
  if (!range.collapsed) {
23907
- range.deleteContents();
23908
- const value = range.startContainer;
23909
- if (!isNullOrUndefined(value) && value.nodeName === 'LI' && !isNullOrUndefined(value.parentElement) && (value.parentElement.nodeName === 'OL' || value.parentElement.nodeName === 'UL') && value.textContent.trim() === '') {
23910
- value.parentElement.querySelectorAll('li').forEach((item) => {
23911
- item.remove();
23912
- });
23913
- }
23920
+ this.removeListfromPaste(range);
23914
23921
  }
23915
23922
  range.insertNode(node);
23916
23923
  this.contentsDeleted = true;
@@ -24059,6 +24066,17 @@ class InsertHtml {
24059
24066
  }
24060
24067
  }
24061
24068
  }
24069
+ static removeListfromPaste(range) {
24070
+ range.deleteContents();
24071
+ const value = range.startContainer;
24072
+ if (!isNullOrUndefined(value) && value.nodeName === 'LI' && !isNullOrUndefined(value.parentElement) && (value.parentElement.nodeName === 'OL' || value.parentElement.nodeName === 'UL') && value.textContent.trim() === '') {
24073
+ value.parentElement.querySelectorAll('li').forEach((item) => {
24074
+ if (item.textContent.trim() === '') {
24075
+ item.remove();
24076
+ }
24077
+ });
24078
+ }
24079
+ }
24062
24080
  }
24063
24081
  /**
24064
24082
  * Insert method
@@ -26038,7 +26056,7 @@ class TableCommand {
26038
26056
  detach(selectedCells[i]);
26039
26057
  }
26040
26058
  for (let i = 0; i < this.curTable.rows.length; i++) {
26041
- if (this.curTable.rows[i].innerHTML === '') {
26059
+ if (this.curTable.rows[i].innerHTML.trim() === '') {
26042
26060
  detach(this.curTable.rows[i]);
26043
26061
  }
26044
26062
  }
@@ -26796,8 +26814,25 @@ class SelectionCommands {
26796
26814
  if (!isNullOrUndefined(cursorNodes[0].parentElement) && IsFormatted.inlineTags.
26797
26815
  indexOf((cursorNodes[0].parentElement).tagName.toLowerCase()) !== -1 && cursorNodes[0].textContent.includes('\u200B')) {
26798
26816
  const element = this.GetFormatNode(format, value);
26817
+ const tempNode = cursorNodes[0];
26818
+ if (format === 'fontsize') {
26819
+ let currentFormatNode = cursorNodes[0];
26820
+ while (currentFormatNode) {
26821
+ const isSameTextContent = currentFormatNode.parentElement.textContent.trim()
26822
+ === cursorNodes[0].textContent.trim();
26823
+ const previousElement = currentFormatNode.parentElement;
26824
+ if (!domNode.isBlockNode(previousElement) && isSameTextContent &&
26825
+ !(previousElement.nodeName === 'SPAN' && previousElement.classList.contains('e-img-inner'))) {
26826
+ currentFormatNode = previousElement;
26827
+ }
26828
+ else {
26829
+ break;
26830
+ }
26831
+ cursorNodes[0] = currentFormatNode;
26832
+ }
26833
+ }
26799
26834
  this.applyStyles(cursorNodes, 0, element);
26800
- return cursorNodes[0];
26835
+ return tempNode;
26801
26836
  }
26802
26837
  cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
26803
26838
  }
@@ -28237,6 +28272,7 @@ class MsWordPaste {
28237
28272
  constructor(parent) {
28238
28273
  this.olData = [
28239
28274
  'decimal',
28275
+ 'decimal-leading-zero',
28240
28276
  'lower-alpha',
28241
28277
  'lower-roman',
28242
28278
  'upper-alpha',
@@ -28409,7 +28445,8 @@ class MsWordPaste {
28409
28445
  imgElem[i].getAttribute('v:shapes').toLowerCase().indexOf('image') < 0 &&
28410
28446
  imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0 &&
28411
28447
  imgElem[i].getAttribute('v:shapes').indexOf('_x0000_s') < 0 &&
28412
- imgElem[i].getAttribute('v:shapes').indexOf('_x0000_i') < 0) {
28448
+ imgElem[i].getAttribute('v:shapes').indexOf('_x0000_i') < 0 &&
28449
+ imgElem[i].getAttribute('v:shapes').indexOf('img1') < 0) {
28413
28450
  imgElem[i].classList.add('e-rte-image-unsupported');
28414
28451
  }
28415
28452
  imgElem[i].removeAttribute('v:shapes');
@@ -28919,7 +28956,7 @@ class MsWordPaste {
28919
28956
  listStyleType = this.getlistStyleType(this.listContents[0], type);
28920
28957
  if (type === 'ol' && (i === 0 || listNodes[i - 1] === null)) {
28921
28958
  const startString = this.listContents[0].split('.')[0];
28922
- const listTypes = ['A', 'a', 'I', 'i', 'α', '1', '1-']; // Add '1-' for rare list type.
28959
+ const listTypes = ['A', 'a', 'I', 'i', 'α', '1', '01', '1-']; // Add '1-' for rare list type.
28923
28960
  if (listTypes.indexOf(startString) === -1) {
28924
28961
  if (listStyleType === 'decimal') {
28925
28962
  // Bug in getlistStyleType() list style stype is returned as decimal for nested list with start attribute
@@ -29008,6 +29045,9 @@ class MsWordPaste {
29008
29045
  case (charCode > 96 && charCode < 123):
29009
29046
  currentListClass = 'lower-alpha';
29010
29047
  break;
29048
+ case (listContent.split('.')[0].length > 1 && listContent.split('.')[0][0] === '0' && !isNaN(Number(listContent.split('.')[0]))):
29049
+ currentListClass = 'decimal-leading-zero';
29050
+ break;
29011
29051
  default:
29012
29052
  currentListClass = 'decimal';
29013
29053
  break;