@syncfusion/ej2-richtexteditor 20.4.48 → 20.4.49
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.
- package/CHANGELOG.md +11 -1
- package/dist/ej2-richtexteditor.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +71 -2
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +71 -2
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +8 -8
- package/src/editor-manager/plugin/ms-word-clean-up.js +29 -1
- package/src/editor-manager/plugin/selection-commands.js +42 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 20.4.
|
|
3
|
+
* version : 20.4.49
|
|
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.4.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@20.4.48",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-H6KAc1JCJivUzVg/b6EJ7wbeb9ekQ4berFtJf4FBBH3N+rZfEDFLjIiPJDhBgqsEW2CwPvOHoj1TrFGykTs0yA==",
|
|
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.4.
|
|
30
|
-
"_shasum": "
|
|
29
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.4.48.tgz",
|
|
30
|
+
"_shasum": "640aa234816a05b9366d297fa130c09b643cf112",
|
|
31
31
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
32
32
|
"_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
|
|
33
33
|
"author": {
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"bundleDependencies": false,
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@syncfusion/ej2-base": "~20.4.48",
|
|
42
|
-
"@syncfusion/ej2-buttons": "~20.4.
|
|
42
|
+
"@syncfusion/ej2-buttons": "~20.4.49",
|
|
43
43
|
"@syncfusion/ej2-filemanager": "~20.4.48",
|
|
44
44
|
"@syncfusion/ej2-inputs": "~20.4.48",
|
|
45
|
-
"@syncfusion/ej2-navigations": "~20.4.
|
|
46
|
-
"@syncfusion/ej2-popups": "~20.4.
|
|
45
|
+
"@syncfusion/ej2-navigations": "~20.4.49",
|
|
46
|
+
"@syncfusion/ej2-popups": "~20.4.49",
|
|
47
47
|
"@syncfusion/ej2-splitbuttons": "~20.4.48"
|
|
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.4.
|
|
73
|
+
"version": "20.4.49",
|
|
74
74
|
"sideEffects": false
|
|
75
75
|
}
|
|
@@ -76,6 +76,15 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
76
76
|
if (pattern4.test(tempHTMLContent)) {
|
|
77
77
|
this.addTableBorderClass(elm);
|
|
78
78
|
}
|
|
79
|
+
// Removing the margin for list items
|
|
80
|
+
var liChildren = elm.querySelectorAll('li');
|
|
81
|
+
if (liChildren.length > 0) {
|
|
82
|
+
for (var i = 0; i < liChildren.length; i++) {
|
|
83
|
+
if (!isNOU(liChildren[i].style.marginLeft)) {
|
|
84
|
+
liChildren[i].style.marginLeft = '';
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
79
88
|
e.callBack(elm.innerHTML);
|
|
80
89
|
}
|
|
81
90
|
else {
|
|
@@ -482,9 +491,25 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
482
491
|
this.getListContent(listNodes[i]);
|
|
483
492
|
var type = void 0;
|
|
484
493
|
var listStyleType = void 0;
|
|
494
|
+
var startAttr = void 0;
|
|
485
495
|
if (!isNOU(this.listContents[0])) {
|
|
486
496
|
type = this.listContents[0].trim().length > 1 ? 'ol' : 'ul';
|
|
487
497
|
listStyleType = this.getlistStyleType(this.listContents[0], type);
|
|
498
|
+
if (type === 'ol' && listNodes[i - 1] === null) {
|
|
499
|
+
var startString = this.listContents[0].split('.')[0];
|
|
500
|
+
var listTypes = ['A', 'a', 'I', 'i', 'α', '1'];
|
|
501
|
+
if (listTypes.indexOf(startString) === -1) {
|
|
502
|
+
if (listStyleType === 'decimal') {
|
|
503
|
+
// Bug in getlistStyleType() list style stype is returned as decimal for nested list with start attribute
|
|
504
|
+
if (!isNaN(parseInt(startString))) {
|
|
505
|
+
startAttr = parseInt(startString);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
else if (listStyleType === 'upper-alpha' || listStyleType === 'lower-alpha') {
|
|
509
|
+
startAttr = parseInt(startString.toLowerCase()) - 96;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
488
513
|
var tempNode = [];
|
|
489
514
|
for (var j = 1; j < this.listContents.length; j++) {
|
|
490
515
|
tempNode.push(this.listContents[j]);
|
|
@@ -501,7 +526,7 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
501
526
|
}
|
|
502
527
|
}
|
|
503
528
|
collection.push({ listType: type, content: tempNode, nestedLevel: level, class: currentClassName,
|
|
504
|
-
listStyle: currentListStyle, listStyleTypeName: listStyleType });
|
|
529
|
+
listStyle: currentListStyle, listStyleTypeName: listStyleType, start: startAttr });
|
|
505
530
|
}
|
|
506
531
|
}
|
|
507
532
|
stNode = listNodes.shift();
|
|
@@ -665,6 +690,9 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
665
690
|
prevList.setAttribute('style', (!isNOU(currentStyle) ? currentStyle : ''));
|
|
666
691
|
pLevel = collection[index].nestedLevel;
|
|
667
692
|
listCount++;
|
|
693
|
+
if (!isNOU(collection[index].start)) {
|
|
694
|
+
temp.setAttribute('start', collection[index].start.toString());
|
|
695
|
+
}
|
|
668
696
|
}
|
|
669
697
|
return root;
|
|
670
698
|
};
|
|
@@ -208,6 +208,7 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
208
208
|
var startText = range.startContainer.nodeName === '#text' ?
|
|
209
209
|
range.startContainer.textContent.substring(range.startOffset, range.startContainer.textContent.length) :
|
|
210
210
|
range.startContainer.textContent;
|
|
211
|
+
var nodeText = nodes[index].textContent;
|
|
211
212
|
if (!(range.startContainer === range.endContainer && range.startOffset === 0
|
|
212
213
|
&& range.endOffset === range.startContainer.length)) {
|
|
213
214
|
var nodeIndex = [];
|
|
@@ -346,8 +347,25 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
346
347
|
parentElement = parentElement.parentElement;
|
|
347
348
|
liElement = parentElement;
|
|
348
349
|
}
|
|
350
|
+
var num = index;
|
|
351
|
+
var liChildContent = '';
|
|
352
|
+
while (num >= 0 && !isNOU(liElement) && liElement.tagName.toLowerCase() === 'li' && liElement.textContent.replace('/\u200B/g', '').trim().includes(nodes[num].textContent.trim())) {
|
|
353
|
+
liChildContent = ' ' + nodes[num].textContent.trim() + liChildContent;
|
|
354
|
+
num--;
|
|
355
|
+
}
|
|
356
|
+
var isNestedList = false;
|
|
357
|
+
var nestedListCount = 0;
|
|
358
|
+
var isNestedListItem = false;
|
|
359
|
+
if (!isNOU(liElement) && liElement.childNodes) {
|
|
360
|
+
for (var num_1 = 0; num_1 < liElement.childNodes.length; num_1++) {
|
|
361
|
+
if (liElement.childNodes[num_1].nodeName === ('OL' || 'UL')) {
|
|
362
|
+
nestedListCount++;
|
|
363
|
+
isNestedList = true;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
349
367
|
if (!isNOU(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
350
|
-
liElement.textContent.trim() ===
|
|
368
|
+
liElement.textContent.split('\u200B').join('').trim() === liChildContent.split('\u200B').join('').trim()) {
|
|
351
369
|
if (format === 'fontsize') {
|
|
352
370
|
liElement.style.fontSize = value;
|
|
353
371
|
}
|
|
@@ -356,6 +374,29 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
356
374
|
liElement.style.textDecoration = 'inherit';
|
|
357
375
|
}
|
|
358
376
|
}
|
|
377
|
+
else if (!isNOU(liElement) && liElement.tagName.toLowerCase() === 'li' && isNestedList) {
|
|
378
|
+
if (isNestedList && nestedListCount > 0) {
|
|
379
|
+
for (var num_2 = 0; num_2 < liElement.childNodes.length; num_2++) {
|
|
380
|
+
if (nodes[index].textContent === liElement.childNodes[num_2].textContent && nodes[index].textContent === nodeText && liElement.textContent.replace('/\u200B/g', '').trim().includes(liChildContent.split('\u200B').join('').trim())) {
|
|
381
|
+
isNestedListItem = true;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
if (isNestedListItem) {
|
|
386
|
+
for (var num_3 = 0; num_3 < liElement.childNodes.length; num_3++) {
|
|
387
|
+
if (liElement.childNodes[num_3].nodeName === ('OL' || 'UL')) {
|
|
388
|
+
liElement.childNodes[num_3].style.fontSize = 'initial';
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
if (format === 'fontsize') {
|
|
392
|
+
liElement.style.fontSize = value;
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
liElement.style.color = value;
|
|
396
|
+
liElement.style.textDecoration = 'inherit';
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
359
400
|
}
|
|
360
401
|
}
|
|
361
402
|
return nodes[index];
|