@syncfusion/ej2-richtexteditor 20.3.59 → 20.3.61

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 : 20.3.59
3
+ * version : 20.3.61
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@20.3.56",
3
+ "_id": "@syncfusion/ej2-richtexteditor@20.3.60",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-GX0LVZvQQDLl5IjbQCCiHxI1SsLtTTKpOq3j8e4Xgs/7SPn/ZVNWdV9K1wLcHer8DFruuZMW/4vsw0bDDn2mBg==",
5
+ "_integrity": "sha512-Udnf4TdzmcsEtjgXDNhzK0xLSblQcpSJadLiOOLQo25IDxSLFwO/2n1o2nlb7YSXykAQ+47iTkE1is58GqEgkw==",
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": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.3.56.tgz",
30
- "_shasum": "95846fbcc0d3e51f0339f71e72c675b64323b020",
29
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.3.60.tgz",
30
+ "_shasum": "3c91a1071f6723039a43de31b6d0f61bfd02b2aa",
31
31
  "_spec": "@syncfusion/ej2-richtexteditor@*",
32
32
  "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
33
33
  "author": {
@@ -42,8 +42,8 @@
42
42
  "@syncfusion/ej2-buttons": "~20.3.58",
43
43
  "@syncfusion/ej2-filemanager": "~20.3.56",
44
44
  "@syncfusion/ej2-inputs": "~20.3.57",
45
- "@syncfusion/ej2-navigations": "~20.3.58",
46
- "@syncfusion/ej2-popups": "~20.3.59",
45
+ "@syncfusion/ej2-navigations": "~20.3.60",
46
+ "@syncfusion/ej2-popups": "~20.3.60",
47
47
  "@syncfusion/ej2-splitbuttons": "~20.3.56"
48
48
  },
49
49
  "deprecated": false,
@@ -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": "20.3.59",
73
+ "version": "20.3.61",
74
74
  "sideEffects": false
75
75
  }
@@ -392,7 +392,8 @@ var InsertHtml = /** @class */ (function () {
392
392
  }
393
393
  }
394
394
  else if (currentNode.nodeName === '#text' && !isNOU(currentNode.parentElement) &&
395
- currentNode.parentElement.nodeName === 'LI' && currentNode.parentElement.textContent.trim().length > 0) {
395
+ (currentNode.parentElement.nodeName === 'LI' || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
396
+ currentNode.parentElement.textContent.trim().length > 0) {
396
397
  splitedElm = currentNode;
397
398
  if (currentNode.parentElement.nodeName === 'LI' && !isNOU(currentNode.nextSibling) &&
398
399
  currentNode.nextSibling.nodeName === 'BR') {
@@ -241,7 +241,9 @@ var MsWordPaste = /** @class */ (function () {
241
241
  for (var i = 0; i < allElements.length; i++) {
242
242
  if (allElements[i].children.length === 0 && allElements[i].innerHTML === '&nbsp;' &&
243
243
  (allElements[i].innerHTML === '&nbsp;' && !allElements[i].closest('li')) &&
244
- !allElements[i].closest('td')) {
244
+ !allElements[i].closest('td') && (allElements[i].nodeName !== 'SPAN' ||
245
+ allElements[i].nodeName === 'SPAN' && (isNOU(allElements[i].previousElementSibling) &&
246
+ isNOU(allElements[i].nextElementSibling)))) {
245
247
  var detachableElement = this.findDetachElem(allElements[i]);
246
248
  var brElement = createElement('br');
247
249
  if (!isNOU(detachableElement.parentElement)) {
@@ -99,6 +99,7 @@ var NodeCutter = /** @class */ (function () {
99
99
  for (var i = 0; !isNOU(firstChild.childNodes) && i < firstChild.childNodes.length; i++) {
100
100
  if (firstChild.childNodes[i].nodeName === 'IMG' || (firstChild.childNodes[i].nodeName === 'SPAN' &&
101
101
  (firstChild.childNodes[i].classList.contains('e-video-wrap') ||
102
+ firstChild.childNodes[i].classList.contains('e-embed-video-wrap') ||
102
103
  firstChild.childNodes[i].classList.contains('e-audio-wrap')))) {
103
104
  result = false;
104
105
  }
@@ -93,6 +93,15 @@ var SelectionCommands = /** @class */ (function () {
93
93
  isSubSup = formatNode === null ? false : true;
94
94
  }
95
95
  }
96
+ else if (formatNode.textContent !== nodes[index].textContent && formatNode.nodeName === 'SPAN' && formatNode.style[0] === 'font-size') {
97
+ var currentParentElem = nodes[index].parentElement.textContent !== nodes[index].textContent ? nodes[index] : nodes[index].parentElement;
98
+ var isSameTextContent = true;
99
+ while (currentParentElem.textContent !== nodes[index].textContent && nodes[index].style[0] !== format && currentParentElem.nodeName === 'SPAN') {
100
+ isSameTextContent = currentParentElem.textContent === currentParentElem.parentElement.textContent;
101
+ currentParentElem = !isNOU(currentParentElem.parentElement) && isSameTextContent ? currentParentElem.parentElement : currentParentElem;
102
+ }
103
+ formatNode = currentParentElem;
104
+ }
96
105
  if (index === 0 && formatNode === null) {
97
106
  isFormat = true;
98
107
  }
@@ -385,7 +394,33 @@ var SelectionCommands = /** @class */ (function () {
385
394
  liElement.style.textDecoration = 'inherit';
386
395
  }
387
396
  }
388
- nodes[index] = this.applyStyles(nodes, index, element);
397
+ var enterType = isNOU(this.enterAction) ? 'P' : this.enterAction.toString();
398
+ var currentNode = nodes[index];
399
+ var isNestedNode = !isNOU(currentNode) && nodes[index].nodeName === '#text' && nodes[index].parentElement.nodeName !== enterType;
400
+ var currentParentElem = currentNode.parentElement.textContent !== currentNode.textContent ? currentNode : currentNode.parentElement;
401
+ if (isNestedNode) {
402
+ var isSameTextContent = true;
403
+ isNestedNode = false;
404
+ while (!isNOU(currentParentElem) && isSameTextContent && currentParentElem.parentElement.nodeName !== enterType
405
+ && (currentParentElem.nodeName === 'SPAN' && (currentParentElem.style.textDecoration === 'line-through' || 'underline')
406
+ || currentParentElem.nodeName === 'SPAN' && (currentParentElem.style[0] === 'background-color' || 'font-family' || 'color')
407
+ || (currentParentElem.nodeName === 'EM' || 'STRONG' || 'SUB' || 'SUP'))) {
408
+ isSameTextContent = currentParentElem.textContent === currentParentElem.parentElement.textContent;
409
+ currentParentElem = !isNOU(currentParentElem.parentElement) && isSameTextContent ? currentParentElem.parentElement : currentParentElem;
410
+ }
411
+ if (!isNOU(currentParentElem) && currentParentElem.childNodes.length > 0) {
412
+ var nodeList = currentParentElem.querySelectorAll('span,strong,em,sub,sup');
413
+ isNestedNode = nodeList.length > 0 && isSameTextContent;
414
+ }
415
+ }
416
+ if (isNestedNode) {
417
+ var nodeList = [];
418
+ nodeList[0] = currentParentElem;
419
+ this.applyStyles(nodeList, index, element);
420
+ }
421
+ else {
422
+ nodes[index] = this.applyStyles(nodes, index, element);
423
+ }
389
424
  if (format === 'fontsize') {
390
425
  var bg = closest(nodes[index].parentElement, 'span[style*=' + 'background-color' + ']');
391
426
  if (!isNOU(bg)) {
@@ -234,7 +234,7 @@ var ToolbarStatus = /** @class */ (function () {
234
234
  && (fontName === null || fontName === undefined || (fontName.filter(function (value, pos) {
235
235
  var pattern = new RegExp(name, 'i');
236
236
  if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
237
- (value.search(pattern) > -1)) {
237
+ (value.split(',')[0] && value.split(',')[0].search(pattern) > -1)) {
238
238
  index = pos;
239
239
  }
240
240
  }) && (index !== null)))) {
@@ -171,7 +171,8 @@ var EnterKeyAction = /** @class */ (function () {
171
171
  }
172
172
  else {
173
173
  if ((nearBlockNode.textContent.trim().length !== 0 ||
174
- nearBlockNode.childNodes[0].nodeName === 'IMG')) {
174
+ nearBlockNode.childNodes[0].nodeName === 'IMG' ||
175
+ (nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img').length > 0))) {
175
176
  if ((_this.range.startOffset === _this.range.endOffset && _this.range.startOffset != 0)) {
176
177
  newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
177
178
  }
@@ -1444,9 +1444,11 @@ var RichTextEditor = /** @class */ (function (_super) {
1444
1444
  this.notify(events.rtlMode, { enableRtl: this.enableRtl });
1445
1445
  if (this.enableRtl) {
1446
1446
  this.element.classList.add(classes.CLS_RTL);
1447
+ this.inputElement.classList.add(classes.CLS_RTL);
1447
1448
  }
1448
1449
  else {
1449
1450
  this.element.classList.remove(classes.CLS_RTL);
1451
+ this.inputElement.classList.remove(classes.CLS_RTL);
1450
1452
  }
1451
1453
  };
1452
1454
  RichTextEditor.prototype.updateReadOnly = function () {
@@ -576,8 +576,8 @@ export var videoAlignItems = [
576
576
  { iconCss: 'e-icons e-justify-right', command: 'Videos', subCommand: 'JustifyRight' },
577
577
  ];
578
578
  var displayLocale = [
579
- { locale: 'imageLayoutOptionDropDownInline', value: 'Inline' },
580
- { locale: 'imageLayoutOptionDropDownBreak', value: 'Break' }
579
+ { locale: 'imageDisplayDropDownInline', value: 'Inline' },
580
+ { locale: 'imageDisplayDropDownBreak', value: 'Break' }
581
581
  ];
582
582
  var audioLayoutOptionLocale = [
583
583
  { locale: 'audioLayoutOptionDropDownInline', value: 'Inline' },
package/tslint.json ADDED
@@ -0,0 +1,111 @@
1
+ {
2
+ "rules": {
3
+ "chai-vague-errors": true,
4
+ "use-isnan": true,
5
+ "missing-jsdoc": true,
6
+ "missing-optional-annotation": true,
7
+ "no-backbone-get-set-outside-model": true,
8
+ "no-banned-terms": true,
9
+ "no-constant-condition": true,
10
+ "no-control-regex": true,
11
+ "no-cookies": true,
12
+ "no-delete-expression": true,
13
+ "no-document-write": true,
14
+ "no-document-domain": true,
15
+ "no-disable-auto-sanitization": true,
16
+ "no-duplicate-case": true,
17
+ "no-duplicate-parameter-names": true,
18
+ "no-empty-interfaces": true,
19
+ "no-exec-script": true,
20
+ "no-function-constructor-with-string-args": true,
21
+ "no-function-expression": true,
22
+ "no-invalid-regexp": true,
23
+ "no-for-in": true,
24
+ "member-access": true,
25
+ "no-multiline-string": true,
26
+ "no-multiple-var-decl": true,
27
+ "no-unnecessary-bind": true,
28
+ "no-unnecessary-semicolons": true,
29
+ "no-octal-literal": true,
30
+ "no-regex-spaces": true,
31
+ "no-sparse-arrays": true,
32
+ "no-string-based-set-immediate": true,
33
+ "no-string-based-set-interval": true,
34
+ "no-unused-imports": true,
35
+ "no-with-statement": true,
36
+ "prefer-array-literal": true,
37
+ "promise-must-complete": false,
38
+ "react-no-dangerous-html": true,
39
+ "use-named-parameter": true,
40
+ "valid-typeof": true,
41
+ "max-func-body-length": [true, 100, {
42
+ "ignore-parameters-to-function-regex": "describe"
43
+ }],
44
+ "class-name": true,
45
+ "curly": true,
46
+ "eofline": false,
47
+ "forin": true,
48
+ "indent": [
49
+ true,
50
+ "spaces"
51
+ ],
52
+ "label-position": true,
53
+ "max-line-length": [true, 140],
54
+ "no-arg": true,
55
+ "no-console": [true,
56
+ "debug",
57
+ "info",
58
+ "log",
59
+ "time",
60
+ "timeEnd",
61
+ "trace"
62
+ ],
63
+ "no-construct": true,
64
+ "no-parameter-properties": true,
65
+ "no-debugger": true,
66
+ "no-duplicate-variable": true,
67
+ "no-empty": true,
68
+ "no-eval": true,
69
+ "no-string-literal": true,
70
+ "no-switch-case-fall-through": true,
71
+ "trailing-comma": true,
72
+ "no-trailing-whitespace": true,
73
+ "no-unused-expression": true,
74
+ "no-use-before-declare": false,
75
+ "no-var-requires": true,
76
+ "one-line": [true,
77
+ "check-open-brace",
78
+ "check-catch",
79
+ "check-else",
80
+ "check-whitespace"
81
+ ],
82
+ "no-any": true,
83
+ "no-conditional-assignment": true,
84
+ "no-angle-bracket-type-assertion": false,
85
+ "align": [true, "parameters", "arguments", "statements"],
86
+ "no-empty-line-after-opening-brace": false,
87
+ "typedef-whitespace": [false],
88
+ "ban": true,
89
+ "quotemark": [true, "single"],
90
+ "semicolon": true,
91
+ "triple-equals": [true, "allow-null-check"],
92
+ "typedef": [true,
93
+ "call-signature",
94
+ "parameter",
95
+ "property-declaration",
96
+ "variable-declaration",
97
+ "arrow-parameter",
98
+ "member-variable-declaration"],
99
+ "variable-name": true,
100
+ "whitespace": [true,
101
+ "check-branch",
102
+ "check-decl",
103
+ "check-operator",
104
+ "check-separator",
105
+ "check-type"
106
+ ],
107
+ "jsdoc-format": true,
108
+ "no-var-keyword": true,
109
+ "radix": true
110
+ }
111
+ }