@syncfusion/ej2-richtexteditor 26.2.9 → 26.2.11

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');
@@ -26796,8 +26803,25 @@ class SelectionCommands {
26796
26803
  if (!isNullOrUndefined(cursorNodes[0].parentElement) && IsFormatted.inlineTags.
26797
26804
  indexOf((cursorNodes[0].parentElement).tagName.toLowerCase()) !== -1 && cursorNodes[0].textContent.includes('\u200B')) {
26798
26805
  const element = this.GetFormatNode(format, value);
26806
+ const tempNode = cursorNodes[0];
26807
+ if (format === 'fontsize') {
26808
+ let currentFormatNode = cursorNodes[0];
26809
+ while (currentFormatNode) {
26810
+ const isSameTextContent = currentFormatNode.parentElement.textContent.trim()
26811
+ === cursorNodes[0].textContent.trim();
26812
+ const previousElement = currentFormatNode.parentElement;
26813
+ if (!domNode.isBlockNode(previousElement) && isSameTextContent &&
26814
+ !(previousElement.nodeName === 'SPAN' && previousElement.classList.contains('e-img-inner'))) {
26815
+ currentFormatNode = previousElement;
26816
+ }
26817
+ else {
26818
+ break;
26819
+ }
26820
+ cursorNodes[0] = currentFormatNode;
26821
+ }
26822
+ }
26799
26823
  this.applyStyles(cursorNodes, 0, element);
26800
- return cursorNodes[0];
26824
+ return tempNode;
26801
26825
  }
26802
26826
  cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
26803
26827
  }
@@ -28237,6 +28261,7 @@ class MsWordPaste {
28237
28261
  constructor(parent) {
28238
28262
  this.olData = [
28239
28263
  'decimal',
28264
+ 'decimal-leading-zero',
28240
28265
  'lower-alpha',
28241
28266
  'lower-roman',
28242
28267
  'upper-alpha',
@@ -28409,7 +28434,8 @@ class MsWordPaste {
28409
28434
  imgElem[i].getAttribute('v:shapes').toLowerCase().indexOf('image') < 0 &&
28410
28435
  imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0 &&
28411
28436
  imgElem[i].getAttribute('v:shapes').indexOf('_x0000_s') < 0 &&
28412
- imgElem[i].getAttribute('v:shapes').indexOf('_x0000_i') < 0) {
28437
+ imgElem[i].getAttribute('v:shapes').indexOf('_x0000_i') < 0 &&
28438
+ imgElem[i].getAttribute('v:shapes').indexOf('img1') < 0) {
28413
28439
  imgElem[i].classList.add('e-rte-image-unsupported');
28414
28440
  }
28415
28441
  imgElem[i].removeAttribute('v:shapes');
@@ -28919,7 +28945,7 @@ class MsWordPaste {
28919
28945
  listStyleType = this.getlistStyleType(this.listContents[0], type);
28920
28946
  if (type === 'ol' && (i === 0 || listNodes[i - 1] === null)) {
28921
28947
  const startString = this.listContents[0].split('.')[0];
28922
- const listTypes = ['A', 'a', 'I', 'i', 'α', '1', '1-']; // Add '1-' for rare list type.
28948
+ const listTypes = ['A', 'a', 'I', 'i', 'α', '1', '01', '1-']; // Add '1-' for rare list type.
28923
28949
  if (listTypes.indexOf(startString) === -1) {
28924
28950
  if (listStyleType === 'decimal') {
28925
28951
  // Bug in getlistStyleType() list style stype is returned as decimal for nested list with start attribute
@@ -29008,6 +29034,9 @@ class MsWordPaste {
29008
29034
  case (charCode > 96 && charCode < 123):
29009
29035
  currentListClass = 'lower-alpha';
29010
29036
  break;
29037
+ case (listContent.split('.')[0].length > 1 && listContent.split('.')[0][0] === '0' && !isNaN(Number(listContent.split('.')[0]))):
29038
+ currentListClass = 'decimal-leading-zero';
29039
+ break;
29011
29040
  default:
29012
29041
  currentListClass = 'decimal';
29013
29042
  break;
@@ -32030,9 +32059,7 @@ class PasteCleanup {
32030
32059
  dropArea: this.parent.inputElement,
32031
32060
  allowedExtensions: this.parent.insertImageSettings.allowedTypes.toString(),
32032
32061
  success: (e) => {
32033
- this.popupCloseTime = setTimeout(() => {
32034
- this.popupClose(this.popupObj, this.uploadObj, imgElem, e);
32035
- }, 900);
32062
+ this.popupClose(this.popupObj, this.uploadObj, imgElem, e);
32036
32063
  },
32037
32064
  uploading: (e) => {
32038
32065
  if (!this.parent.isServerRendered) {
@@ -32113,30 +32140,31 @@ class PasteCleanup {
32113
32140
  this.parent.inputElement.contentEditable = 'true';
32114
32141
  e.element = imgElem;
32115
32142
  e.detectImageSource = ImageInputSource.Pasted;
32116
- uploadObj.filesData.forEach((element) => {
32117
- if (element.statusCode === '2') {
32118
- this.parent.trigger(imageUploadSuccess, e, (e) => {
32119
- if (!isNullOrUndefined(this.parent.insertImageSettings.path)) {
32120
- const url = this.parent.insertImageSettings.path + e.file.name;
32121
- imgElem.src = url;
32122
- imgElem.setAttribute('alt', e.file.name);
32123
- }
32124
- });
32125
- }
32126
- else if (element.statusCode === '5') {
32127
- this.parent.trigger(imageRemoving, e, (e) => {
32128
- if (!isNullOrUndefined(e.element.src)) {
32129
- e.element.src = '';
32130
- }
32131
- });
32132
- }
32133
- });
32134
- popupObj.close();
32135
- imgElem.style.opacity = '1';
32136
- if (uploadObj && document.body.contains(uploadObj.element)) {
32137
- uploadObj.destroy();
32143
+ const element = e.file;
32144
+ if (element.statusCode === '2') {
32145
+ this.parent.trigger(imageUploadSuccess, e, (e) => {
32146
+ if (!isNullOrUndefined(this.parent.insertImageSettings.path)) {
32147
+ const url = this.parent.insertImageSettings.path + e.file.name;
32148
+ imgElem.src = url;
32149
+ imgElem.setAttribute('alt', e.file.name);
32150
+ }
32151
+ });
32138
32152
  }
32139
- this.toolbarEnableDisable(false);
32153
+ else if (element.statusCode === '5') {
32154
+ this.parent.trigger(imageRemoving, e, (e) => {
32155
+ if (!isNullOrUndefined(e.element.src)) {
32156
+ e.element.src = '';
32157
+ }
32158
+ });
32159
+ }
32160
+ this.popupCloseTime = setTimeout(function () {
32161
+ popupObj.close();
32162
+ imgElem.style.opacity = '1';
32163
+ this.toolbarEnableDisable(false);
32164
+ if (uploadObj && document.body.contains(uploadObj.element)) {
32165
+ uploadObj.destroy();
32166
+ }
32167
+ }.bind(this), 1500);
32140
32168
  }
32141
32169
  refreshPopup(imageElement, popupObj) {
32142
32170
  const imgPosition = this.parent.iframeSettings.enable ? this.parent.element.offsetTop +