@syncfusion/ej2-richtexteditor 21.1.41 → 21.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.
@@ -17157,6 +17157,12 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
17157
17157
  'object', 'ol', 'pre', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'ul',
17158
17158
  'header', 'article', 'nav', 'footer', 'section', 'aside', 'main', 'figure', 'figcaption'];
17159
17159
  this.borderStyle = ['border-top', 'border-right', 'border-bottom', 'border-left'];
17160
+ this.upperRomanNumber = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX',
17161
+ 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX'];
17162
+ this.lowerRomanNumber = ['i', 'ii', 'iii', 'iv', 'v', 'vi', 'vii', 'viii', 'ix',
17163
+ 'x', 'xi', 'xii', 'xiii', 'xiv', 'xv', 'xvi', 'xvii', 'xviii', 'xix', 'xx'];
17164
+ this.lowerGreekNumber = ['α', 'β', 'γ', 'δ', 'ε', 'ζ', 'η', 'θ', 'ι', 'κ', 'λ',
17165
+ 'μ', 'ν', 'ξ', 'ο', 'π', 'ρ', 'σ', 'τ', 'υ', 'φ', 'χ', 'ψ', 'ω'];
17160
17166
  this.removableElements = ['o:p', 'style'];
17161
17167
  this.listContents = [];
17162
17168
  this.parent = parent;
@@ -17658,6 +17664,15 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
17658
17664
  else if (listStyleType === 'lower-alpha') {
17659
17665
  startAttr = (startString.split('.')[0].charCodeAt(0) - 96);
17660
17666
  }
17667
+ else if (listStyleType === 'upper-roman') {
17668
+ startAttr = this.upperRomanNumber.indexOf(this.listContents[0].split('.')[0]) + 1;
17669
+ }
17670
+ else if (listStyleType === 'lower-roman') {
17671
+ startAttr = this.lowerRomanNumber.indexOf(this.listContents[0].split('.')[0]) + 1;
17672
+ }
17673
+ else if (listStyleType === 'lower-greek') {
17674
+ startAttr = this.lowerGreekNumber.indexOf(this.listContents[0].split('.')[0]) + 1;
17675
+ }
17661
17676
  }
17662
17677
  if (listNodes[i].style.marginLeft !== '') {
17663
17678
  styleMarginLeft = listNodes[i].style.marginLeft;
@@ -17705,22 +17720,16 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
17705
17720
  };
17706
17721
  MsWordPaste.prototype.getlistStyleType = function (listContent, type) {
17707
17722
  var currentListClass;
17708
- var upperRomanNumber = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX',
17709
- 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX'];
17710
- var lowerRomanNumber = ['i', 'ii', 'iii', 'iv', 'v', 'vi', 'vii', 'viii', 'ix',
17711
- 'x', 'xi', 'xii', 'xiii', 'xiv', 'xv', 'xvi', 'xvii', 'xviii', 'xix', 'xx'];
17712
- var lowerGreekNumber = ['α', 'β', 'γ', 'δ', 'ε', 'ζ', 'η', 'θ', 'ι', 'κ', 'λ',
17713
- 'μ', 'ν', 'ξ', 'ο', 'π', 'ρ', 'σ', 'τ', 'υ', 'φ', 'χ', 'ψ', 'ω'];
17714
17723
  if (type === 'ol') {
17715
17724
  var charCode = listContent.split('.')[0].charCodeAt(0);
17716
17725
  switch (true) {
17717
- case upperRomanNumber.indexOf(listContent.split('.')[0]) > -1:
17726
+ case this.upperRomanNumber.indexOf(listContent.split('.')[0]) > -1:
17718
17727
  currentListClass = 'upper-roman';
17719
17728
  break;
17720
- case lowerRomanNumber.indexOf(listContent.split('.')[0]) > -1:
17729
+ case this.lowerRomanNumber.indexOf(listContent.split('.')[0]) > -1:
17721
17730
  currentListClass = 'lower-roman';
17722
17731
  break;
17723
- case lowerGreekNumber.indexOf(listContent.split('.')[0]) > -1:
17732
+ case this.lowerGreekNumber.indexOf(listContent.split('.')[0]) > -1:
17724
17733
  currentListClass = 'lower-greek';
17725
17734
  break;
17726
17735
  case (charCode > 64 && charCode < 91):
@@ -20257,6 +20266,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
20257
20266
  }
20258
20267
  this.parent.trigger(beforePasteCleanup, { value: value });
20259
20268
  if (e.args && value !== null && this.parent.editorMode === 'HTML') {
20269
+ var file = void 0;
20260
20270
  if (value.length === 0) {
20261
20271
  var htmlRegex = new RegExp(/<\/[a-z][\s\S]*>/i);
20262
20272
  value = e.args.clipboardData.getData('text/plain');
@@ -20264,7 +20274,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
20264
20274
  value = value.replace(/</g, '&lt;');
20265
20275
  value = value.replace(/>/g, '&gt;');
20266
20276
  this.containsHtml = htmlRegex.test(value);
20267
- var file = e && e.args.clipboardData &&
20277
+ file = e && e.args.clipboardData &&
20268
20278
  e.args.clipboardData.items.length > 0 ?
20269
20279
  (e.args.clipboardData.items[0].getAsFile() === null ?
20270
20280
  (!isNullOrUndefined(e.args.clipboardData.items[1]) ?
@@ -20304,9 +20314,6 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
20304
20314
  var currentDocument = this.contentRenderer.getDocument();
20305
20315
  var range = this.nodeSelectionObj.getRange(currentDocument);
20306
20316
  this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
20307
- this.parent.trigger(afterPasteCleanup, { value: value }, function (updatedArgs) {
20308
- value = updatedArgs.value;
20309
- });
20310
20317
  var tempDivElem = this.parent.createElement('div');
20311
20318
  tempDivElem.innerHTML = value;
20312
20319
  var isValueNotEmpty = tempDivElem.textContent !== '' || !isNullOrUndefined(tempDivElem.querySelector('img')) ||
@@ -20316,7 +20323,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
20316
20323
  e.args.preventDefault();
20317
20324
  this.pasteDialog(value, args);
20318
20325
  }
20319
- else if (Browser.userAgent.indexOf('Firefox') !== -1) {
20326
+ else if (Browser.userAgent.indexOf('Firefox') !== -1 && isNullOrUndefined(file)) {
20320
20327
  this.fireFoxImageUpload();
20321
20328
  }
20322
20329
  }
@@ -20340,7 +20347,6 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
20340
20347
  };
20341
20348
  PasteCleanup.prototype.fireFoxImageUpload = function () {
20342
20349
  var _this = this;
20343
- // Timeout 500 is added to capture after default paste image from file manager is completed.
20344
20350
  setTimeout(function () {
20345
20351
  if (Browser.userAgent.indexOf('Firefox') !== -1) {
20346
20352
  var currentFocusNode = _this.nodeSelectionObj.getRange(_this.contentRenderer.getDocument()).startContainer;
@@ -20851,6 +20857,36 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
20851
20857
  this.addTempClass(clipBoardElem);
20852
20858
  if (clipBoardElem.textContent !== '' || !isNullOrUndefined(clipBoardElem.querySelector('img')) ||
20853
20859
  !isNullOrUndefined(clipBoardElem.querySelector('table'))) {
20860
+ var tempWrapperElem = this.parent.createElement('div');
20861
+ tempWrapperElem.innerHTML = value;
20862
+ var filesData = [];
20863
+ if (!isNullOrUndefined(tempWrapperElem.querySelector('img'))) {
20864
+ var imgElem = tempWrapperElem.querySelectorAll('img');
20865
+ var base64Src = [];
20866
+ var imgName = [];
20867
+ var uploadImg = [];
20868
+ for (var i = 0; i < imgElem.length; i++) {
20869
+ if (imgElem[i].getAttribute('src') &&
20870
+ imgElem[i].getAttribute('src').split(',')[0].indexOf('base64') >= 0) {
20871
+ base64Src.push(imgElem[i].getAttribute('src'));
20872
+ imgName.push(getUniqueID('rte_image'));
20873
+ uploadImg.push(imgElem[i]);
20874
+ }
20875
+ }
20876
+ var fileList = [];
20877
+ var currentData = void 0;
20878
+ for (var i = 0; i < base64Src.length; i++) {
20879
+ fileList.push(this.base64ToFile(base64Src[i], imgName[i]));
20880
+ currentData = {
20881
+ name: fileList[i].name, rawFile: fileList[i],
20882
+ size: fileList[i].size, type: fileList[i].type,
20883
+ status: '', validationMessages: { minSize: '', maxSize: '' }, statusCode: '1'
20884
+ };
20885
+ filesData.push(currentData);
20886
+ }
20887
+ }
20888
+ this.parent.trigger(afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: filesData }, function (updatedArgs) { value = updatedArgs.value; });
20889
+ clipBoardElem.innerHTML = value;
20854
20890
  this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
20855
20891
  extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
20856
20892
  _this.parent.formatter.onSuccess(_this.parent, args);
@@ -20941,6 +20977,8 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
20941
20977
  this.saveSelection.restore();
20942
20978
  clipBoardElem.innerHTML = this.sanitizeHelper(clipBoardElem.innerHTML);
20943
20979
  this.addTempClass(clipBoardElem);
20980
+ this.parent.trigger(afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: null }, function (updatedArgs) { value = updatedArgs.value; });
20981
+ clipBoardElem.innerHTML = value;
20944
20982
  this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
20945
20983
  extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
20946
20984
  _this.parent.formatter.onSuccess(_this.parent, args);
@@ -22911,6 +22949,7 @@ var Image = /** @__PURE__ @class */ (function () {
22911
22949
  (this.parent.inputElement.getBoundingClientRect().right - 32) ?
22912
22950
  ((width / height * expectedY) + width / height) : (this.parent.inputElement.getBoundingClientRect().right - 32);
22913
22951
  img.style.width = currentWidth.toString() + 'px';
22952
+ img.style.height = expectedY + 'px';
22914
22953
  }
22915
22954
  else if (img.style.width !== '') {
22916
22955
  var currentWidth = (width / height * expectedY) < (this.parent.inputElement.getBoundingClientRect().right - 32) ?
@@ -28348,7 +28387,9 @@ var Table = /** @__PURE__ @class */ (function () {
28348
28387
  _this.curTable.style.width = _this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) > 100 ? (100 + '%') : (_this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) + '%');
28349
28388
  var differenceWidth = currentTableWidth - _this.convertPixelToPercentage(tableWidth + mouseX, widthCompare);
28350
28389
  for (var i = 0; i < lastColumnsCell.length; i++) {
28351
- _this.curTable.rows[i].cells[_this.colIndex].style.width = (currentColumnCellWidth - differenceWidth) + '%';
28390
+ if (_this.curTable.rows[i].cells[_this.colIndex]) {
28391
+ _this.curTable.rows[i].cells[_this.colIndex].style.width = (currentColumnCellWidth - differenceWidth) + '%';
28392
+ }
28352
28393
  }
28353
28394
  }
28354
28395
  }
@@ -28358,7 +28399,7 @@ var Table = /** @__PURE__ @class */ (function () {
28358
28399
  var totalwid = parseFloat(_this.columnEle.offsetWidth.toString()) +
28359
28400
  parseFloat(cellColl[_this.colIndex - 1].offsetWidth.toString());
28360
28401
  for (var i = 0; i < _this.curTable.rows.length; i++) {
28361
- if ((totalwid - actualwid) > 20 && actualwid > 20) {
28402
+ if ((totalwid - actualwid) > 20 && actualwid > 20 && _this.curTable.rows[i].cells[i]) {
28362
28403
  var leftColumnWidth = totalwid - actualwid;
28363
28404
  var rightColWidth = actualwid;
28364
28405
  var index = _this.curTable.rows[i].cells[i].hasAttribute('colspan') ?