@syncfusion/ej2-richtexteditor 21.2.3 → 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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 21.2.3
3
+ * version : 21.2.4
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. 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@21.1.41",
3
+ "_id": "@syncfusion/ej2-richtexteditor@21.2.3",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-sZ+UzPwJaEg2z7jTscOziWpIJmJSRML5niE2J0Pq1UauQLPicefJT4M3a+qqWqQM7Nrw/cMMTXaR+7LIACWH5w==",
5
+ "_integrity": "sha512-TMIFtmxISrzabZsLLiVd5q2/b0Fo9WyHjm4XKzlEP2lA++TShF+++Pbbi0GZVYFgjYomS1TDykOppW1aWgHbUQ==",
6
6
  "_location": "/@syncfusion/ej2-richtexteditor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -19,12 +19,15 @@
19
19
  "_requiredBy": [
20
20
  "/",
21
21
  "/@syncfusion/ej2",
22
+ "/@syncfusion/ej2-angular-richtexteditor",
22
23
  "/@syncfusion/ej2-gantt",
23
24
  "/@syncfusion/ej2-inplace-editor",
24
- "/@syncfusion/ej2-pdfviewer"
25
+ "/@syncfusion/ej2-pdfviewer",
26
+ "/@syncfusion/ej2-react-richtexteditor",
27
+ "/@syncfusion/ej2-vue-richtexteditor"
25
28
  ],
26
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-21.1.41.tgz",
27
- "_shasum": "424e4613c9bdab39c5a2aafa1da22f8e2bedb831",
29
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-21.2.3.tgz",
30
+ "_shasum": "68c5732abcc257d78bd0cdfcb6d309c622b4bc32",
28
31
  "_spec": "@syncfusion/ej2-richtexteditor@*",
29
32
  "_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
30
33
  "author": {
@@ -38,9 +41,9 @@
38
41
  "@syncfusion/ej2-base": "~21.2.3",
39
42
  "@syncfusion/ej2-buttons": "~21.2.3",
40
43
  "@syncfusion/ej2-filemanager": "~21.2.3",
41
- "@syncfusion/ej2-inputs": "~21.2.3",
42
- "@syncfusion/ej2-navigations": "~21.2.3",
43
- "@syncfusion/ej2-popups": "~21.2.3",
44
+ "@syncfusion/ej2-inputs": "~21.2.4",
45
+ "@syncfusion/ej2-navigations": "~21.2.4",
46
+ "@syncfusion/ej2-popups": "~21.2.4",
44
47
  "@syncfusion/ej2-splitbuttons": "~21.2.3"
45
48
  },
46
49
  "deprecated": false,
@@ -67,6 +70,6 @@
67
70
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
68
71
  },
69
72
  "typings": "index.d.ts",
70
- "version": "21.2.3",
73
+ "version": "21.2.4",
71
74
  "sideEffects": false
72
75
  }
@@ -13,6 +13,9 @@ export declare class MsWordPaste {
13
13
  private ignorableNodes;
14
14
  private blockNode;
15
15
  private borderStyle;
16
+ private upperRomanNumber;
17
+ private lowerRomanNumber;
18
+ private lowerGreekNumber;
16
19
  private removableElements;
17
20
  private listContents;
18
21
  private addEventListener;
@@ -37,6 +37,12 @@ var MsWordPaste = /** @class */ (function () {
37
37
  'object', 'ol', 'pre', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'ul',
38
38
  'header', 'article', 'nav', 'footer', 'section', 'aside', 'main', 'figure', 'figcaption'];
39
39
  this.borderStyle = ['border-top', 'border-right', 'border-bottom', 'border-left'];
40
+ this.upperRomanNumber = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX',
41
+ 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX'];
42
+ this.lowerRomanNumber = ['i', 'ii', 'iii', 'iv', 'v', 'vi', 'vii', 'viii', 'ix',
43
+ 'x', 'xi', 'xii', 'xiii', 'xiv', 'xv', 'xvi', 'xvii', 'xviii', 'xix', 'xx'];
44
+ this.lowerGreekNumber = ['α', 'β', 'γ', 'δ', 'ε', 'ζ', 'η', 'θ', 'ι', 'κ', 'λ',
45
+ 'μ', 'ν', 'ξ', 'ο', 'π', 'ρ', 'σ', 'τ', 'υ', 'φ', 'χ', 'ψ', 'ω'];
40
46
  this.removableElements = ['o:p', 'style'];
41
47
  this.listContents = [];
42
48
  this.parent = parent;
@@ -539,6 +545,15 @@ var MsWordPaste = /** @class */ (function () {
539
545
  else if (listStyleType === 'lower-alpha') {
540
546
  startAttr = (startString.split('.')[0].charCodeAt(0) - 96);
541
547
  }
548
+ else if (listStyleType === 'upper-roman') {
549
+ startAttr = this.upperRomanNumber.indexOf(this.listContents[0].split('.')[0]) + 1;
550
+ }
551
+ else if (listStyleType === 'lower-roman') {
552
+ startAttr = this.lowerRomanNumber.indexOf(this.listContents[0].split('.')[0]) + 1;
553
+ }
554
+ else if (listStyleType === 'lower-greek') {
555
+ startAttr = this.lowerGreekNumber.indexOf(this.listContents[0].split('.')[0]) + 1;
556
+ }
542
557
  }
543
558
  if (listNodes[i].style.marginLeft !== '') {
544
559
  styleMarginLeft = listNodes[i].style.marginLeft;
@@ -586,22 +601,16 @@ var MsWordPaste = /** @class */ (function () {
586
601
  };
587
602
  MsWordPaste.prototype.getlistStyleType = function (listContent, type) {
588
603
  var currentListClass;
589
- var upperRomanNumber = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX',
590
- 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX'];
591
- var lowerRomanNumber = ['i', 'ii', 'iii', 'iv', 'v', 'vi', 'vii', 'viii', 'ix',
592
- 'x', 'xi', 'xii', 'xiii', 'xiv', 'xv', 'xvi', 'xvii', 'xviii', 'xix', 'xx'];
593
- var lowerGreekNumber = ['α', 'β', 'γ', 'δ', 'ε', 'ζ', 'η', 'θ', 'ι', 'κ', 'λ',
594
- 'μ', 'ν', 'ξ', 'ο', 'π', 'ρ', 'σ', 'τ', 'υ', 'φ', 'χ', 'ψ', 'ω'];
595
604
  if (type === 'ol') {
596
605
  var charCode = listContent.split('.')[0].charCodeAt(0);
597
606
  switch (true) {
598
- case upperRomanNumber.indexOf(listContent.split('.')[0]) > -1:
607
+ case this.upperRomanNumber.indexOf(listContent.split('.')[0]) > -1:
599
608
  currentListClass = 'upper-roman';
600
609
  break;
601
- case lowerRomanNumber.indexOf(listContent.split('.')[0]) > -1:
610
+ case this.lowerRomanNumber.indexOf(listContent.split('.')[0]) > -1:
602
611
  currentListClass = 'lower-roman';
603
612
  break;
604
- case lowerGreekNumber.indexOf(listContent.split('.')[0]) > -1:
613
+ case this.lowerGreekNumber.indexOf(listContent.split('.')[0]) > -1:
605
614
  currentListClass = 'lower-greek';
606
615
  break;
607
616
  case (charCode > 64 && charCode < 91):
@@ -71,6 +71,7 @@ var PasteCleanup = /** @class */ (function () {
71
71
  }
72
72
  this.parent.trigger(events.beforePasteCleanup, { value: value });
73
73
  if (e.args && value !== null && this.parent.editorMode === 'HTML') {
74
+ var file = void 0;
74
75
  if (value.length === 0) {
75
76
  var htmlRegex = new RegExp(/<\/[a-z][\s\S]*>/i);
76
77
  value = e.args.clipboardData.getData('text/plain');
@@ -78,7 +79,7 @@ var PasteCleanup = /** @class */ (function () {
78
79
  value = value.replace(/</g, '&lt;');
79
80
  value = value.replace(/>/g, '&gt;');
80
81
  this.containsHtml = htmlRegex.test(value);
81
- var file = e && e.args.clipboardData &&
82
+ file = e && e.args.clipboardData &&
82
83
  e.args.clipboardData.items.length > 0 ?
83
84
  (e.args.clipboardData.items[0].getAsFile() === null ?
84
85
  (!isNOU(e.args.clipboardData.items[1]) ?
@@ -118,9 +119,6 @@ var PasteCleanup = /** @class */ (function () {
118
119
  var currentDocument = this.contentRenderer.getDocument();
119
120
  var range = this.nodeSelectionObj.getRange(currentDocument);
120
121
  this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
121
- this.parent.trigger(events.afterPasteCleanup, { value: value }, function (updatedArgs) {
122
- value = updatedArgs.value;
123
- });
124
122
  var tempDivElem = this.parent.createElement('div');
125
123
  tempDivElem.innerHTML = value;
126
124
  var isValueNotEmpty = tempDivElem.textContent !== '' || !isNOU(tempDivElem.querySelector('img')) ||
@@ -130,7 +128,7 @@ var PasteCleanup = /** @class */ (function () {
130
128
  e.args.preventDefault();
131
129
  this.pasteDialog(value, args);
132
130
  }
133
- else if (Browser.userAgent.indexOf('Firefox') !== -1) {
131
+ else if (Browser.userAgent.indexOf('Firefox') !== -1 && isNOU(file)) {
134
132
  this.fireFoxImageUpload();
135
133
  }
136
134
  }
@@ -154,7 +152,6 @@ var PasteCleanup = /** @class */ (function () {
154
152
  };
155
153
  PasteCleanup.prototype.fireFoxImageUpload = function () {
156
154
  var _this = this;
157
- // Timeout 500 is added to capture after default paste image from file manager is completed.
158
155
  setTimeout(function () {
159
156
  if (Browser.userAgent.indexOf('Firefox') !== -1) {
160
157
  var currentFocusNode = _this.nodeSelectionObj.getRange(_this.contentRenderer.getDocument()).startContainer;
@@ -665,6 +662,36 @@ var PasteCleanup = /** @class */ (function () {
665
662
  this.addTempClass(clipBoardElem);
666
663
  if (clipBoardElem.textContent !== '' || !isNOU(clipBoardElem.querySelector('img')) ||
667
664
  !isNOU(clipBoardElem.querySelector('table'))) {
665
+ var tempWrapperElem = this.parent.createElement('div');
666
+ tempWrapperElem.innerHTML = value;
667
+ var filesData = [];
668
+ if (!isNOU(tempWrapperElem.querySelector('img'))) {
669
+ var imgElem = tempWrapperElem.querySelectorAll('img');
670
+ var base64Src = [];
671
+ var imgName = [];
672
+ var uploadImg = [];
673
+ for (var i = 0; i < imgElem.length; i++) {
674
+ if (imgElem[i].getAttribute('src') &&
675
+ imgElem[i].getAttribute('src').split(',')[0].indexOf('base64') >= 0) {
676
+ base64Src.push(imgElem[i].getAttribute('src'));
677
+ imgName.push(getUniqueID('rte_image'));
678
+ uploadImg.push(imgElem[i]);
679
+ }
680
+ }
681
+ var fileList = [];
682
+ var currentData = void 0;
683
+ for (var i = 0; i < base64Src.length; i++) {
684
+ fileList.push(this.base64ToFile(base64Src[i], imgName[i]));
685
+ currentData = {
686
+ name: fileList[i].name, rawFile: fileList[i],
687
+ size: fileList[i].size, type: fileList[i].type,
688
+ status: '', validationMessages: { minSize: '', maxSize: '' }, statusCode: '1'
689
+ };
690
+ filesData.push(currentData);
691
+ }
692
+ }
693
+ this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: filesData }, function (updatedArgs) { value = updatedArgs.value; });
694
+ clipBoardElem.innerHTML = value;
668
695
  this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
669
696
  extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
670
697
  _this.parent.formatter.onSuccess(_this.parent, args);
@@ -755,6 +782,8 @@ var PasteCleanup = /** @class */ (function () {
755
782
  this.saveSelection.restore();
756
783
  clipBoardElem.innerHTML = this.sanitizeHelper(clipBoardElem.innerHTML);
757
784
  this.addTempClass(clipBoardElem);
785
+ this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: null }, function (updatedArgs) { value = updatedArgs.value; });
786
+ clipBoardElem.innerHTML = value;
758
787
  this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
759
788
  extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
760
789
  _this.parent.formatter.onSuccess(_this.parent, args);
@@ -1177,6 +1177,10 @@ export interface PasteCleanupArgs {
1177
1177
  * Returns the content in the ClipboardEvent arguments.
1178
1178
  */
1179
1179
  value: string;
1180
+ /**
1181
+ * Returns the list of image files data that is pasted.
1182
+ */
1183
+ filesData: FileInfo[];
1180
1184
  }
1181
1185
  /**
1182
1186
  * Provides information about a Blur event.
@@ -375,6 +375,7 @@ var Image = /** @class */ (function () {
375
375
  (this.parent.inputElement.getBoundingClientRect().right - 32) ?
376
376
  ((width / height * expectedY) + width / height) : (this.parent.inputElement.getBoundingClientRect().right - 32);
377
377
  img.style.width = currentWidth.toString() + 'px';
378
+ img.style.height = expectedY + 'px';
378
379
  }
379
380
  else if (img.style.width !== '') {
380
381
  var currentWidth = (width / height * expectedY) < (this.parent.inputElement.getBoundingClientRect().right - 32) ?
@@ -915,7 +915,9 @@ var Table = /** @class */ (function () {
915
915
  _this.curTable.style.width = _this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) > 100 ? (100 + '%') : (_this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) + '%');
916
916
  var differenceWidth = currentTableWidth - _this.convertPixelToPercentage(tableWidth + mouseX, widthCompare);
917
917
  for (var i = 0; i < lastColumnsCell.length; i++) {
918
- _this.curTable.rows[i].cells[_this.colIndex].style.width = (currentColumnCellWidth - differenceWidth) + '%';
918
+ if (_this.curTable.rows[i].cells[_this.colIndex]) {
919
+ _this.curTable.rows[i].cells[_this.colIndex].style.width = (currentColumnCellWidth - differenceWidth) + '%';
920
+ }
919
921
  }
920
922
  }
921
923
  }
@@ -925,7 +927,7 @@ var Table = /** @class */ (function () {
925
927
  var totalwid = parseFloat(_this.columnEle.offsetWidth.toString()) +
926
928
  parseFloat(cellColl[_this.colIndex - 1].offsetWidth.toString());
927
929
  for (var i = 0; i < _this.curTable.rows.length; i++) {
928
- if ((totalwid - actualwid) > 20 && actualwid > 20) {
930
+ if ((totalwid - actualwid) > 20 && actualwid > 20 && _this.curTable.rows[i].cells[i]) {
929
931
  var leftColumnWidth = totalwid - actualwid;
930
932
  var rightColWidth = actualwid;
931
933
  var index = _this.curTable.rows[i].cells[i].hasAttribute('colspan') ?