@syncfusion/ej2-richtexteditor 25.2.3 → 25.2.4

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.3
3
+ * version : 25.2.4
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.42",
3
+ "_id": "@syncfusion/ej2-richtexteditor@25.2.3",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-XGBgOsVJDjeoUg7NCBMs+ayX0m4MrTWbdXlHzdK3COGoWMO8ssDjO3iw8e+6828qeoGJnLQrJHa23r7RYWpb/Q==",
5
+ "_integrity": "sha512-l5lUzKF2Mrk2KgQR3Sez/lXpDu9vZnnUJXSfQNUHy+kfr+Z8qd+8SwR06pt7hBZjn05UTHz+TLCmRKA+uYmTHQ==",
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.42.tgz",
29
- "_shasum": "e1bb753283216537b608b5a49c85096650d5693d",
28
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-25.2.3.tgz",
29
+ "_shasum": "ca743ef7877548820123a735ac98979caf771278",
30
30
  "_spec": "@syncfusion/ej2-richtexteditor@*",
31
31
  "_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
32
32
  "author": {
@@ -38,12 +38,12 @@
38
38
  "bundleDependencies": false,
39
39
  "dependencies": {
40
40
  "@syncfusion/ej2-base": "~25.2.3",
41
- "@syncfusion/ej2-buttons": "~25.2.3",
41
+ "@syncfusion/ej2-buttons": "~25.2.4",
42
42
  "@syncfusion/ej2-filemanager": "~25.2.3",
43
43
  "@syncfusion/ej2-inputs": "~25.2.3",
44
- "@syncfusion/ej2-navigations": "~25.2.3",
45
- "@syncfusion/ej2-popups": "~25.2.3",
46
- "@syncfusion/ej2-splitbuttons": "~25.2.3"
44
+ "@syncfusion/ej2-navigations": "~25.2.4",
45
+ "@syncfusion/ej2-popups": "~25.2.4",
46
+ "@syncfusion/ej2-splitbuttons": "~25.2.4"
47
47
  },
48
48
  "deprecated": false,
49
49
  "description": "Essential JS 2 RichTextEditor component",
@@ -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.3",
82
+ "version": "25.2.4",
83
83
  "sideEffects": false
84
84
  }
@@ -318,7 +318,7 @@ var DOMNode = /** @class */ (function () {
318
318
  DOMNode.prototype.unWrap = function (element) {
319
319
  var parent = element.parentNode;
320
320
  var unWrapNode = [];
321
- while (element.firstChild) {
321
+ while (element.firstChild && (element.previousSibling !== this.parent.querySelector('.e-mention-chip') || element.textContent !== ' ')) {
322
322
  unWrapNode.push(element.firstChild);
323
323
  parent.insertBefore(element.firstChild, element);
324
324
  }
@@ -58,6 +58,7 @@ export declare class PasteCleanup {
58
58
  private docClick;
59
59
  private cleanAppleClass;
60
60
  private formatting;
61
+ private convertBlobToBase64;
61
62
  private cropImageHandler;
62
63
  private addTableClass;
63
64
  private setImageProperties;
@@ -729,11 +729,36 @@ var PasteCleanup = /** @class */ (function () {
729
729
  this.cropImageHandler(this.parent.inputElement);
730
730
  }
731
731
  };
732
+ PasteCleanup.prototype.convertBlobToBase64 = function (element) {
733
+ var imgElem = element.querySelectorAll('img');
734
+ var _loop_1 = function (i) {
735
+ if (imgElem[i].getAttribute('src') &&
736
+ imgElem[i].getAttribute('src').startsWith("blob")) {
737
+ var blobImageUrl = imgElem[i].getAttribute('src');
738
+ var img_1 = new Image();
739
+ var onImageLoadEvent_1 = function () {
740
+ var canvas = document.createElement('canvas');
741
+ var ctx = canvas.getContext('2d');
742
+ canvas.width = img_1.width;
743
+ canvas.height = img_1.height;
744
+ ctx.drawImage(img_1, 0, 0);
745
+ var base64String = canvas.toDataURL('image/png');
746
+ imgElem[i].src = base64String;
747
+ img_1.removeEventListener('load', onImageLoadEvent_1);
748
+ };
749
+ img_1.src = blobImageUrl;
750
+ img_1.addEventListener('load', onImageLoadEvent_1);
751
+ }
752
+ };
753
+ for (var i = 0; i < imgElem.length; i++) {
754
+ _loop_1(i);
755
+ }
756
+ };
732
757
  PasteCleanup.prototype.cropImageHandler = function (element) {
733
758
  var _this = this;
734
759
  var allImgElm = element.querySelectorAll('.e-img-cropped');
735
760
  if (allImgElm.length > 0) {
736
- var _loop_1 = function (i) {
761
+ var _loop_2 = function (i) {
737
762
  if (allImgElm[i].getAttribute('src').split(',')[0].indexOf('base64') >= 0) {
738
763
  var image_1 = new Image();
739
764
  image_1.src = allImgElm[i].getAttribute('src');
@@ -767,13 +792,24 @@ var PasteCleanup = /** @class */ (function () {
767
792
  }
768
793
  };
769
794
  for (var i = 0; i < allImgElm.length; i++) {
770
- _loop_1(i);
795
+ _loop_2(i);
771
796
  }
772
797
  }
773
798
  else {
774
- this.imgUploading(this.parent.inputElement);
775
- if (this.parent.iframeSettings.enable) {
776
- this.parent.updateValue();
799
+ if (!isNullOrUndefined(this.parent.insertImageSettings.saveUrl) && !isNullOrUndefined(this.parent.insertImageSettings.path) && !isNullOrUndefined(this.parent.inputElement.querySelectorAll("img")) && this.parent.inputElement.querySelectorAll("img")[0].src.startsWith("blob")) {
800
+ this.convertBlobToBase64(this.parent.inputElement);
801
+ setTimeout(function () {
802
+ _this.imgUploading(_this.parent.inputElement);
803
+ if (_this.parent.iframeSettings.enable) {
804
+ _this.parent.updateValue();
805
+ }
806
+ }, 20);
807
+ }
808
+ else {
809
+ this.imgUploading(this.parent.inputElement);
810
+ if (this.parent.iframeSettings.enable) {
811
+ this.parent.updateValue();
812
+ }
777
813
  }
778
814
  }
779
815
  };
@@ -58,6 +58,7 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
58
58
  private isResizeInitialized;
59
59
  private isValueChangeBlurhandler;
60
60
  private displayTempElem;
61
+ private beforeRenderClassValue;
61
62
  /**
62
63
  * @hidden
63
64
 
@@ -196,6 +196,7 @@ var RichTextEditor = /** @class */ (function (_super) {
196
196
  this.persistData();
197
197
  setStyleAttribute(this.element, { 'width': formatUnit(this.width) });
198
198
  attributes(this.element, { role: 'application', 'aria-label': 'Rich Text Editor' });
199
+ this.beforeRenderClassValue = this.element.getAttribute('class');
199
200
  };
200
201
  RichTextEditor.prototype.persistData = function () {
201
202
  if (this.enablePersistence && this.originalElement.tagName === 'TEXTAREA') {
@@ -1068,6 +1069,10 @@ var RichTextEditor = /** @class */ (function (_super) {
1068
1069
  if (this.isDestroyed || !this.isRendered) {
1069
1070
  return;
1070
1071
  }
1072
+ this.element.className = this.beforeRenderClassValue;
1073
+ this.removeHtmlAttributes();
1074
+ this.removeAttributes();
1075
+ this.beforeRenderClassValue = null;
1071
1076
  if (!isNOU(this.timeInterval)) {
1072
1077
  clearInterval(this.timeInterval);
1073
1078
  this.timeInterval = null;
@@ -1135,8 +1140,6 @@ var RichTextEditor = /** @class */ (function (_super) {
1135
1140
  }
1136
1141
  }
1137
1142
  }
1138
- this.removeHtmlAttributes();
1139
- this.removeAttributes();
1140
1143
  _super.prototype.destroy.call(this);
1141
1144
  this.isRendered = false;
1142
1145
  };
@@ -1167,6 +1170,7 @@ var RichTextEditor = /** @class */ (function (_super) {
1167
1170
  this.element.removeAttribute('aria-disabled');
1168
1171
  this.element.removeAttribute('role');
1169
1172
  this.element.removeAttribute('tabindex');
1173
+ this.element.removeAttribute('aria-label');
1170
1174
  };
1171
1175
  RichTextEditor.prototype.destroyDependentModules = function () {
1172
1176
  /* destroy dependent modules */