@syncfusion/ej2-richtexteditor 19.4.40 → 19.4.47

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 : 19.4.40
3
+ * version : 19.4.47
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@19.4.38",
3
+ "_id": "@syncfusion/ej2-richtexteditor@19.4.40",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-6lQRXzKBKx2rTh/eLeuOvRrNIGH+pQWuxYXfpi1Hsp2ufATyr9PRjEWAM412RFF5QJD2Ujy36dYqDh31SwcuLQ==",
5
+ "_integrity": "sha512-NXliovnItdi7jrn+x5uT0dk6n171w7mBNe3K8VkThnEoJ80R6o419mz36rq9IyB2jZJoDBlSO7WrU8Lel+5lWA==",
6
6
  "_location": "/@syncfusion/ej2-richtexteditor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -26,8 +26,8 @@
26
26
  "/@syncfusion/ej2-react-richtexteditor",
27
27
  "/@syncfusion/ej2-vue-richtexteditor"
28
28
  ],
29
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-19.4.38.tgz",
30
- "_shasum": "626f34d5f0affb5b5fbd7f5f0435b6abe546d7bd",
29
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-19.4.40.tgz",
30
+ "_shasum": "6a824e374410a7eda59dc02e5886f29637159629",
31
31
  "_spec": "@syncfusion/ej2-richtexteditor@*",
32
32
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
33
33
  "author": {
@@ -38,13 +38,13 @@
38
38
  },
39
39
  "bundleDependencies": false,
40
40
  "dependencies": {
41
- "@syncfusion/ej2-base": "~19.4.38",
42
- "@syncfusion/ej2-buttons": "~19.4.38",
43
- "@syncfusion/ej2-filemanager": "~19.4.38",
44
- "@syncfusion/ej2-inputs": "~19.4.38",
45
- "@syncfusion/ej2-navigations": "~19.4.40",
46
- "@syncfusion/ej2-popups": "~19.4.38",
47
- "@syncfusion/ej2-splitbuttons": "~19.4.40"
41
+ "@syncfusion/ej2-base": "~19.4.42",
42
+ "@syncfusion/ej2-buttons": "~19.4.42",
43
+ "@syncfusion/ej2-filemanager": "~19.4.47",
44
+ "@syncfusion/ej2-inputs": "~19.4.47",
45
+ "@syncfusion/ej2-navigations": "~19.4.47",
46
+ "@syncfusion/ej2-popups": "~19.4.47",
47
+ "@syncfusion/ej2-splitbuttons": "~19.4.47"
48
48
  },
49
49
  "deprecated": false,
50
50
  "description": "Essential JS 2 RichTextEditor component",
@@ -70,6 +70,6 @@
70
70
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
71
71
  },
72
72
  "typings": "index.d.ts",
73
- "version": "19.4.40",
73
+ "version": "19.4.47",
74
74
  "sideEffects": false
75
75
  }
@@ -90,7 +90,8 @@ var Lists = /** @class */ (function () {
90
90
  range.startContainer.parentElement.closest('LI');
91
91
  var endNode = range.endContainer.nodeName === 'LI' ? range.endContainer :
92
92
  range.endContainer.parentElement.closest('LI');
93
- if (!isNOU(startNode) && !isNOU(endNode) && startNode === endNode && startNode.tagName === 'LI' && startNode.textContent.trim() === '') {
93
+ if (!isNOU(startNode) && !isNOU(endNode) && startNode === endNode && startNode.tagName === 'LI' &&
94
+ startNode.textContent.trim() === '' && startNode.querySelectorAll('IMG').length === 0) {
94
95
  if (startNode.textContent.charCodeAt(0) === 65279) {
95
96
  startNode.textContent = '';
96
97
  }
@@ -38,7 +38,7 @@ export declare class MsWordPaste {
38
38
  private removingComments;
39
39
  private cleanUp;
40
40
  private listConverter;
41
+ private getlistStyleType;
41
42
  private makeConversion;
42
- private getListStyle;
43
43
  private getListContent;
44
44
  }
@@ -471,8 +471,10 @@ var MsWordPaste = /** @class */ (function () {
471
471
  this.listContents = [];
472
472
  this.getListContent(listNodes[i]);
473
473
  var type = void 0;
474
+ var listStyleType = void 0;
474
475
  if (!isNOU(this.listContents[0])) {
475
476
  type = this.listContents[0].trim().length > 1 ? 'ol' : 'ul';
477
+ listStyleType = this.getlistStyleType(this.listContents[0], type);
476
478
  var tempNode = [];
477
479
  for (var j = 1; j < this.listContents.length; j++) {
478
480
  tempNode.push(this.listContents[j]);
@@ -489,7 +491,7 @@ var MsWordPaste = /** @class */ (function () {
489
491
  }
490
492
  }
491
493
  collection.push({ listType: type, content: tempNode, nestedLevel: level, class: currentClassName,
492
- listStyle: currentListStyle });
494
+ listStyle: currentListStyle, listStyleTypeName: listStyleType });
493
495
  }
494
496
  }
495
497
  stNode = listNodes.shift();
@@ -513,6 +515,45 @@ var MsWordPaste = /** @class */ (function () {
513
515
  }
514
516
  }
515
517
  };
518
+ MsWordPaste.prototype.getlistStyleType = function (listContent, type) {
519
+ var currentListClass;
520
+ if (type === 'ol') {
521
+ switch (listContent.split('.')[0]) {
522
+ case "A":
523
+ currentListClass = "upper-alpha";
524
+ break;
525
+ case "a":
526
+ currentListClass = "lower-alpha";
527
+ break;
528
+ case "I":
529
+ currentListClass = "upper-roman";
530
+ break;
531
+ case "i":
532
+ currentListClass = "lower-roman";
533
+ break;
534
+ case "α":
535
+ currentListClass = "lower-greek";
536
+ break;
537
+ default:
538
+ currentListClass = "decimal";
539
+ break;
540
+ }
541
+ }
542
+ else {
543
+ switch (listContent.split('.')[0]) {
544
+ case "o":
545
+ currentListClass = "circle";
546
+ break;
547
+ case "§":
548
+ currentListClass = "square";
549
+ break;
550
+ default:
551
+ currentListClass = "disc";
552
+ break;
553
+ }
554
+ }
555
+ return currentListClass;
556
+ };
516
557
  MsWordPaste.prototype.makeConversion = function (collection) {
517
558
  var root = createElement('div');
518
559
  var temp;
@@ -529,7 +570,7 @@ var MsWordPaste = /** @class */ (function () {
529
570
  prevList.appendChild(pElement);
530
571
  temp.appendChild(prevList);
531
572
  temp.setAttribute('level', collection[index].nestedLevel.toString());
532
- temp.style.listStyle = this.getListStyle(collection[index].listType, collection[index].nestedLevel);
573
+ temp.style.listStyleType = collection[index].listStyleTypeName;
533
574
  }
534
575
  else if (collection[index].nestedLevel === pLevel) {
535
576
  if (prevList.parentElement.tagName.toLowerCase() === collection[index].listType) {
@@ -538,6 +579,7 @@ var MsWordPaste = /** @class */ (function () {
538
579
  }
539
580
  else {
540
581
  temp = createElement(collection[index].listType);
582
+ temp.style.listStyleType = collection[index].listStyleTypeName;
541
583
  prevList.parentElement.parentElement.appendChild(temp);
542
584
  prevList = createElement('li');
543
585
  prevList.appendChild(pElement);
@@ -549,14 +591,15 @@ var MsWordPaste = /** @class */ (function () {
549
591
  if (!isNOU(prevList)) {
550
592
  for (var j = 0; j < collection[index].nestedLevel - pLevel; j++) {
551
593
  prevList.appendChild(temp = createElement(collection[index].listType));
552
- prevList = createElement('li', { styles: 'list-style-type: none;' });
594
+ prevList = createElement('li');
595
+ if (j != collection[index].nestedLevel - pLevel - 1 && collection[index].nestedLevel - pLevel > 1) {
596
+ prevList.style.listStyleType = "none";
597
+ }
553
598
  temp.appendChild(prevList);
554
599
  }
555
600
  prevList.appendChild(pElement);
556
601
  temp.setAttribute('level', collection[index].nestedLevel.toString());
557
- temp.style.listStyle = this.getListStyle(collection[index].listType, collection[index].nestedLevel);
558
- temp.childNodes[0].style.listStyle =
559
- this.getListStyle(collection[index].listType, collection[index].nestedLevel);
602
+ temp.style.listStyleType = collection[index].listStyleTypeName;
560
603
  }
561
604
  else {
562
605
  root.appendChild(temp = createElement(collection[index].listType));
@@ -564,7 +607,7 @@ var MsWordPaste = /** @class */ (function () {
564
607
  prevList.appendChild(pElement);
565
608
  temp.appendChild(prevList);
566
609
  temp.setAttribute('level', collection[index].nestedLevel.toString());
567
- temp.style.listStyle = this.getListStyle(collection[index].listType, collection[index].nestedLevel);
610
+ temp.style.listStyleType = collection[index].listStyleTypeName;
568
611
  }
569
612
  }
570
613
  else if (collection[index].nestedLevel === 1) {
@@ -573,12 +616,12 @@ var MsWordPaste = /** @class */ (function () {
573
616
  }
574
617
  else {
575
618
  root.appendChild(temp = createElement(collection[index].listType));
619
+ temp.style.listStyleType = collection[index].listStyleTypeName;
576
620
  }
577
621
  prevList = createElement('li');
578
622
  prevList.appendChild(pElement);
579
623
  temp.appendChild(prevList);
580
624
  temp.setAttribute('level', collection[index].nestedLevel.toString());
581
- temp.style.listStyle = this.getListStyle(collection[index].listType, collection[index].nestedLevel);
582
625
  }
583
626
  else {
584
627
  elem = prevList;
@@ -599,7 +642,7 @@ var MsWordPaste = /** @class */ (function () {
599
642
  prevList.appendChild(pElement);
600
643
  temp.appendChild(prevList);
601
644
  temp.setAttribute('level', collection[index].nestedLevel.toString());
602
- temp.style.listStyle = this.getListStyle(collection[index].listType, collection[index].nestedLevel);
645
+ temp.style.listStyleType = collection[index].listStyleTypeName;
603
646
  break;
604
647
  }
605
648
  }
@@ -608,21 +651,12 @@ var MsWordPaste = /** @class */ (function () {
608
651
  }
609
652
  prevList.setAttribute('class', collection[index].class);
610
653
  var currentStyle = prevList.getAttribute('style');
611
- prevList.setAttribute('style', (!isNOU(currentStyle) ? currentStyle : '') + collection[index].listStyle);
654
+ prevList.setAttribute('style', (!isNOU(currentStyle) ? currentStyle : ''));
612
655
  pLevel = collection[index].nestedLevel;
613
656
  listCount++;
614
657
  }
615
658
  return root;
616
659
  };
617
- MsWordPaste.prototype.getListStyle = function (listType, nestedLevel) {
618
- nestedLevel = (nestedLevel > 0) ? nestedLevel - 1 : nestedLevel;
619
- if (listType === 'ol') {
620
- return (nestedLevel < this.olData.length ? this.olData[nestedLevel] : this.olData[0]);
621
- }
622
- else {
623
- return (nestedLevel < this.ulData.length ? this.ulData[nestedLevel] : this.ulData[0]);
624
- }
625
- };
626
660
  MsWordPaste.prototype.getListContent = function (elem) {
627
661
  var pushContent = '';
628
662
  var firstChild = elem.firstElementChild;
@@ -237,9 +237,11 @@ var EnterKeyAction = /** @class */ (function () {
237
237
  _this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
238
238
  _this.range.startOffset === _this.range.endOffset &&
239
239
  _this.range.startOffset === isLastNodeLength) {
240
- var outerBRElem = _this.parent.createElement('br');
241
- _this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
242
- _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), outerBRElem, 0);
240
+ var focusBRElem = _this.parent.createElement('br');
241
+ var lineBreakBRElem = _this.parent.createElement('br');
242
+ _this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, _this.range.startContainer);
243
+ _this.parent.formatter.editorManager.domNode.insertAfter(lineBreakBRElem, _this.range.startContainer);
244
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), focusBRElem, 0);
243
245
  }
244
246
  else if (!isNOU(currentParent) && currentParent !== _this.parent.inputElement && currentParent.nodeName !== 'BR') {
245
247
  if (currentParent.textContent.trim().length === 0 || (currentParent.textContent.trim().length === 1 &&
@@ -229,7 +229,8 @@ var HtmlEditor = /** @class */ (function () {
229
229
  if (this.rangeElement.tagName === 'OL' || this.rangeElement.tagName === 'UL') {
230
230
  var liElement = this.getRangeLiNode(currentRange.startContainer);
231
231
  if (liElement.previousElementSibling && liElement.previousElementSibling.childElementCount > 0) {
232
- this.oldRangeElement = liElement.previousElementSibling.lastElementChild;
232
+ this.oldRangeElement = liElement.previousElementSibling.lastElementChild.nodeName === 'BR' ?
233
+ liElement.previousElementSibling : liElement.previousElementSibling.lastElementChild;
233
234
  if (!isNullOrUndefined(liElement.lastElementChild)) {
234
235
  this.rangeElement = liElement.lastElementChild;
235
236
  isLiElement = true;
@@ -78,7 +78,7 @@ export interface RichTextEditorModel extends ComponentModel{
78
78
  * allowedStyleProps: ['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius',
79
79
  * 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor',
80
80
  * 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style',
81
- * 'height', 'left', 'line-height', 'margin', 'margin-top', 'margin-left',
81
+ * 'height', 'left', 'line-height', 'list-style-type', 'margin', 'margin-top', 'margin-left',
82
82
  * 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width',
83
83
  * 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right',
84
84
  * 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent',
@@ -230,7 +230,7 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
230
230
  * allowedStyleProps: ['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius',
231
231
  * 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor',
232
232
  * 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style',
233
- * 'height', 'left', 'line-height', 'margin', 'margin-top', 'margin-left',
233
+ * 'height', 'left', 'line-height', 'list-style-type', 'margin', 'margin-top', 'margin-left',
234
234
  * 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width',
235
235
  * 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right',
236
236
  * 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent',
@@ -1826,7 +1826,7 @@ var RichTextEditor = /** @class */ (function (_super) {
1826
1826
  this.isRTE = false;
1827
1827
  }
1828
1828
  this.notify(events.docClick, { args: e });
1829
- if (e.detail > 3) {
1829
+ if (Browser.info.name !== 'msie' && e.detail > 3) {
1830
1830
  e.preventDefault();
1831
1831
  }
1832
1832
  };
@@ -429,7 +429,7 @@ export interface PasteCleanupSettingsModel {
429
429
  /**
430
430
  * Specifies the allowed style properties when pasting in RichTextEditor.
431
431
  *
432
- * @default ['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width']
432
+ * @default ['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'list-style-type', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width']
433
433
  */
434
434
  allowedStyleProps?: string[];
435
435
 
@@ -374,7 +374,7 @@ export declare class PasteCleanupSettings extends ChildProperty<PasteCleanupSett
374
374
  /**
375
375
  * Specifies the allowed style properties when pasting in RichTextEditor.
376
376
  *
377
- * @default ['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width']
377
+ * @default ['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'list-style-type', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width']
378
378
  */
379
379
  allowedStyleProps: string[];
380
380
  /**
@@ -236,7 +236,7 @@ var PasteCleanupSettings = /** @class */ (function (_super) {
236
236
  Property(null)
237
237
  ], PasteCleanupSettings.prototype, "deniedAttrs", void 0);
238
238
  __decorate([
239
- Property(['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width'])
239
+ Property(['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'list-style-type', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width'])
240
240
  ], PasteCleanupSettings.prototype, "allowedStyleProps", void 0);
241
241
  __decorate([
242
242
  Property(null)
@@ -444,7 +444,8 @@ var Image = /** @class */ (function () {
444
444
  };
445
445
  Image.prototype.resizeImgDupPos = function (e) {
446
446
  this.imgDupPos = {
447
- width: (e.style.width !== '') ? this.imgEle.style.width : e.width + 'px',
447
+ width: (e.style.width !== '' && (this.parent.insertImageSettings &&
448
+ !this.parent.insertImageSettings.resizeByPercent)) ? this.imgEle.style.width : e.width + 'px',
448
449
  height: (e.style.height !== '') ? this.imgEle.style.height : e.height + 'px'
449
450
  };
450
451
  };