@syncfusion/ej2-richtexteditor 19.4.38 → 19.4.50
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 +42 -0
- package/README.md +1 -1
- 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 +115 -60
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +115 -60
- 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 +12 -12
- package/src/editor-manager/plugin/inserthtml.js +3 -2
- package/src/editor-manager/plugin/lists.js +4 -2
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +1 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +53 -19
- package/src/editor-manager/plugin/selection-commands.js +10 -5
- package/src/rich-text-editor/actions/color-picker.d.ts +1 -0
- package/src/rich-text-editor/actions/color-picker.js +2 -1
- package/src/rich-text-editor/actions/enter-key.js +11 -4
- package/src/rich-text-editor/actions/html-editor.js +3 -2
- package/src/rich-text-editor/base/interface.d.ts +1 -1
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +1 -1
- package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -1
- package/src/rich-text-editor/base/rich-text-editor.js +1 -1
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.js +1 -1
- package/src/rich-text-editor/renderer/image-module.js +24 -21
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +1 -1
- package/src/rich-text-editor/renderer/toolbar-renderer.js +3 -2
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 19.4.
|
|
3
|
+
* version : 19.4.50
|
|
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.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@19.4.48",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-QieTgmAYkkOwu3ZFdLGHs+y4zOaWVeX0ega0Y+aKDujLdgrOd6roe6wdZrAnFGypJmN1kw1ZzpXOl7Z58J95Rg==",
|
|
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-
|
|
30
|
-
"_shasum": "
|
|
29
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-19.4.48.tgz",
|
|
30
|
+
"_shasum": "bcbe604657f0ddbca36bee320dd63465c8c861ff",
|
|
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.
|
|
42
|
-
"@syncfusion/ej2-buttons": "~19.4.
|
|
43
|
-
"@syncfusion/ej2-filemanager": "~19.4.
|
|
44
|
-
"@syncfusion/ej2-inputs": "~19.4.
|
|
45
|
-
"@syncfusion/ej2-navigations": "~19.4.
|
|
46
|
-
"@syncfusion/ej2-popups": "~19.4.
|
|
47
|
-
"@syncfusion/ej2-splitbuttons": "~19.4.
|
|
41
|
+
"@syncfusion/ej2-base": "~19.4.48",
|
|
42
|
+
"@syncfusion/ej2-buttons": "~19.4.50",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~19.4.50",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~19.4.48",
|
|
45
|
+
"@syncfusion/ej2-navigations": "~19.4.50",
|
|
46
|
+
"@syncfusion/ej2-popups": "~19.4.50",
|
|
47
|
+
"@syncfusion/ej2-splitbuttons": "~19.4.48"
|
|
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.
|
|
73
|
+
"version": "19.4.50",
|
|
74
74
|
"sideEffects": false
|
|
75
75
|
}
|
|
@@ -311,8 +311,9 @@ var InsertHtml = /** @class */ (function () {
|
|
|
311
311
|
};
|
|
312
312
|
InsertHtml.getNodeCollection = function (range, nodeSelection, node) {
|
|
313
313
|
var nodes = [];
|
|
314
|
-
if (range.startOffset === range.endOffset && range.startContainer === range.endContainer
|
|
315
|
-
|
|
314
|
+
if (range.startOffset === range.endOffset && range.startContainer === range.endContainer &&
|
|
315
|
+
range.startContainer.nodeName != 'BR' &&
|
|
316
|
+
(range.startContainer.nodeName === 'TD' || (range.startContainer.nodeType !== 3 &&
|
|
316
317
|
node.classList && node.classList.contains('pasteContent')))) {
|
|
317
318
|
nodes.push(range.startContainer.childNodes[range.endOffset]);
|
|
318
319
|
}
|
|
@@ -46,8 +46,9 @@ var Lists = /** @class */ (function () {
|
|
|
46
46
|
Lists.prototype.testCurrentList = function (range) {
|
|
47
47
|
var olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
|
|
48
48
|
if (!isNullOrUndefined(range.startContainer.textContent.slice(0, range.startOffset))) {
|
|
49
|
+
var currentContent = range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim();
|
|
49
50
|
for (var i = 0; i < olListStartRegex.length; i++) {
|
|
50
|
-
if (olListStartRegex[i].test(
|
|
51
|
+
if (olListStartRegex[i].test(currentContent) && currentContent.length === 2) {
|
|
51
52
|
return true;
|
|
52
53
|
}
|
|
53
54
|
}
|
|
@@ -89,7 +90,8 @@ var Lists = /** @class */ (function () {
|
|
|
89
90
|
range.startContainer.parentElement.closest('LI');
|
|
90
91
|
var endNode = range.endContainer.nodeName === 'LI' ? range.endContainer :
|
|
91
92
|
range.endContainer.parentElement.closest('LI');
|
|
92
|
-
if (!isNOU(startNode) && !isNOU(endNode) && startNode === endNode && startNode.tagName === 'LI' &&
|
|
93
|
+
if (!isNOU(startNode) && !isNOU(endNode) && startNode === endNode && startNode.tagName === 'LI' &&
|
|
94
|
+
startNode.textContent.trim() === '' && startNode.querySelectorAll('IMG').length === 0) {
|
|
93
95
|
if (startNode.textContent.charCodeAt(0) === 65279) {
|
|
94
96
|
startNode.textContent = '';
|
|
95
97
|
}
|
|
@@ -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.
|
|
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'
|
|
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.
|
|
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.
|
|
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.
|
|
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 : '')
|
|
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;
|
|
@@ -188,6 +188,9 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
188
188
|
};
|
|
189
189
|
SelectionCommands.removeFormat = function (nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode) {
|
|
190
190
|
var splitNode = null;
|
|
191
|
+
var startText = range.startContainer.nodeName === '#text' ?
|
|
192
|
+
range.startContainer.textContent.substring(range.startOffset, range.startContainer.textContent.length) :
|
|
193
|
+
range.startContainer.textContent;
|
|
191
194
|
if (!(range.startContainer === range.endContainer && range.startOffset === 0
|
|
192
195
|
&& range.endOffset === range.startContainer.length)) {
|
|
193
196
|
var nodeIndex = [];
|
|
@@ -287,11 +290,13 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
287
290
|
for (var num = 0; num < child.length; num++) {
|
|
288
291
|
if (child[num].nodeType !== 3 || (child[num].textContent && child[num].textContent.trim().length > 0)) {
|
|
289
292
|
child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
|
|
290
|
-
if (num ===
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
if (child[num].textContent === startText) {
|
|
294
|
+
if (num === 0) {
|
|
295
|
+
range.setStartBefore(child[num]);
|
|
296
|
+
}
|
|
297
|
+
else if (num === child.length - 1) {
|
|
298
|
+
range.setEndAfter(child[num]);
|
|
299
|
+
}
|
|
295
300
|
}
|
|
296
301
|
}
|
|
297
302
|
}
|
|
@@ -5,6 +5,7 @@ import { RendererFactory } from '../services/renderer-factory';
|
|
|
5
5
|
* `Color Picker` module is used to handle ColorPicker actions.
|
|
6
6
|
*/
|
|
7
7
|
export declare class ColorPickerInput {
|
|
8
|
+
private defaultColorPicker;
|
|
8
9
|
private fontColorPicker;
|
|
9
10
|
private backgroundColorPicker;
|
|
10
11
|
private fontColorDropDown;
|
|
@@ -77,7 +77,7 @@ var ColorPickerInput = /** @class */ (function () {
|
|
|
77
77
|
target: (targetID)
|
|
78
78
|
};
|
|
79
79
|
_this.backgroundColorPicker = _this.toolbarRenderer.renderColorPicker(options, 'backgroundcolor');
|
|
80
|
-
_this.backgroundColorDropDown = _this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', _this.backgroundColorPicker);
|
|
80
|
+
_this.backgroundColorDropDown = _this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', _this.backgroundColorPicker, _this.defaultColorPicker);
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -112,6 +112,7 @@ var ColorPickerInput = /** @class */ (function () {
|
|
|
112
112
|
if (this.backgroundColorDropDown && !this.backgroundColorDropDown.isDestroyed) {
|
|
113
113
|
var innerEle = this.backgroundColorDropDown.element.querySelector('.e-rte-color-content');
|
|
114
114
|
if (innerEle) {
|
|
115
|
+
this.defaultColorPicker = innerEle.children[0].style.borderBottomColor;
|
|
115
116
|
detach(innerEle);
|
|
116
117
|
}
|
|
117
118
|
this.backgroundColorDropDown.destroy();
|
|
@@ -228,7 +228,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
228
228
|
}
|
|
229
229
|
var isEmptyBrInserted = false;
|
|
230
230
|
var currentParentLastChild = currentParent.lastChild;
|
|
231
|
-
while (!isNOU(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text')) {
|
|
231
|
+
while (!isNOU(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text' || currentParentLastChild.nodeName === 'BR')) {
|
|
232
232
|
currentParentLastChild = currentParentLastChild.lastChild;
|
|
233
233
|
}
|
|
234
234
|
var isLastNodeLength = _this.range.startContainer === currentParentLastChild ?
|
|
@@ -237,9 +237,16 @@ 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
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
var focusBRElem = _this.parent.createElement('br');
|
|
241
|
+
if (currentParentLastChild.nodeName === 'BR' && currentParent.textContent.length === 0) {
|
|
242
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, currentParentLastChild);
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
var lineBreakBRElem = _this.parent.createElement('br');
|
|
246
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, _this.range.startContainer);
|
|
247
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(lineBreakBRElem, _this.range.startContainer);
|
|
248
|
+
}
|
|
249
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), focusBRElem, 0);
|
|
243
250
|
}
|
|
244
251
|
else if (!isNOU(currentParent) && currentParent !== _this.parent.inputElement && currentParent.nodeName !== 'BR') {
|
|
245
252
|
if (currentParent.textContent.trim().length === 0 || (currentParent.textContent.trim().length === 1 &&
|
|
@@ -229,8 +229,9 @@ 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
|
|
233
|
-
|
|
232
|
+
this.oldRangeElement = liElement.previousElementSibling.lastElementChild.nodeName === 'BR' ?
|
|
233
|
+
liElement.previousElementSibling : liElement.previousElementSibling.lastElementChild;
|
|
234
|
+
if (!isNullOrUndefined(liElement.lastElementChild) && liElement.lastElementChild.nodeName !== 'BR') {
|
|
234
235
|
this.rangeElement = liElement.lastElementChild;
|
|
235
236
|
isLiElement = true;
|
|
236
237
|
}
|
|
@@ -169,7 +169,7 @@ export interface IRenderer {
|
|
|
169
169
|
renderPopup?(args: BaseQuickToolbar): void;
|
|
170
170
|
renderDropDownButton?(args: DropDownItemModel): DropDownButton;
|
|
171
171
|
renderColorPicker?(args: IColorPickerModel, item?: string): ColorPicker;
|
|
172
|
-
renderColorPickerDropDown?(args?: IColorPickerModel, item?: string, colorPicker?: ColorPicker): DropDownButton;
|
|
172
|
+
renderColorPickerDropDown?(args?: IColorPickerModel, item?: string, colorPicker?: ColorPicker, defaultColor?: string): DropDownButton;
|
|
173
173
|
renderListDropDown?(args: IDropDownModel): DropDownButton;
|
|
174
174
|
}
|
|
175
175
|
/**
|
|
@@ -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)
|
|
@@ -304,7 +304,7 @@ var Image = /** @class */ (function () {
|
|
|
304
304
|
left: elem.offsetLeft
|
|
305
305
|
};
|
|
306
306
|
};
|
|
307
|
-
Image.prototype.setAspectRatio = function (img, expectedX, expectedY) {
|
|
307
|
+
Image.prototype.setAspectRatio = function (img, expectedX, expectedY, e) {
|
|
308
308
|
if (isNullOrUndefined(img.width)) {
|
|
309
309
|
return;
|
|
310
310
|
}
|
|
@@ -358,7 +358,7 @@ var Image = /** @class */ (function () {
|
|
|
358
358
|
img.style.height = (height / width * expectedX) + 'px';
|
|
359
359
|
}
|
|
360
360
|
else {
|
|
361
|
-
img.setAttribute('width', expectedX.toString());
|
|
361
|
+
img.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - img.getBoundingClientRect().left).toString() : expectedX.toString());
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
else {
|
|
@@ -399,7 +399,7 @@ var Image = /** @class */ (function () {
|
|
|
399
399
|
return;
|
|
400
400
|
}
|
|
401
401
|
_this.imgEle.parentElement.style.cursor = 'pointer';
|
|
402
|
-
_this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10));
|
|
402
|
+
_this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10), args);
|
|
403
403
|
_this.resizeImgDupPos(_this.imgEle);
|
|
404
404
|
_this.imgResizePos(_this.imgEle, _this.imgResizeDiv);
|
|
405
405
|
_this.parent.setContentHeight('', false);
|
|
@@ -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 !== ''
|
|
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
|
};
|
|
@@ -612,26 +613,28 @@ var Image = /** @class */ (function () {
|
|
|
612
613
|
var src = this.deletedImg[i].src;
|
|
613
614
|
this.imageRemovePost(src);
|
|
614
615
|
}
|
|
615
|
-
if (
|
|
616
|
-
if (
|
|
617
|
-
if (
|
|
618
|
-
range.startContainer.previousElementSibling.
|
|
619
|
-
|
|
620
|
-
|
|
616
|
+
if (this.parent.editorMode !== 'Markdown') {
|
|
617
|
+
if (range.startContainer.nodeType === 3) {
|
|
618
|
+
if (originalEvent.code === 'Backspace') {
|
|
619
|
+
if (range.startContainer.previousElementSibling && range.startOffset === 0 &&
|
|
620
|
+
range.startContainer.previousElementSibling.classList.contains(classes.CLS_CAPTION) &&
|
|
621
|
+
range.startContainer.previousElementSibling.classList.contains(classes.CLS_CAPINLINE)) {
|
|
622
|
+
detach(range.startContainer.previousElementSibling);
|
|
623
|
+
}
|
|
621
624
|
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
625
|
+
else {
|
|
626
|
+
if (range.startContainer.nextElementSibling &&
|
|
627
|
+
range.endContainer.textContent.length === range.endOffset &&
|
|
628
|
+
range.startContainer.nextElementSibling.classList.contains(classes.CLS_CAPTION) &&
|
|
629
|
+
range.startContainer.nextElementSibling.classList.contains(classes.CLS_CAPINLINE)) {
|
|
630
|
+
detach(range.startContainer.nextElementSibling);
|
|
631
|
+
}
|
|
629
632
|
}
|
|
630
633
|
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
634
|
+
else if ((range.startContainer.nodeType === 1 &&
|
|
635
|
+
range.startContainer.querySelector('.' + classes.CLS_CAPTION + '.' + classes.CLS_CAPINLINE))) {
|
|
636
|
+
detach(range.startContainer.querySelector('.' + classes.CLS_CAPTION + '.' + classes.CLS_CAPINLINE));
|
|
637
|
+
}
|
|
635
638
|
}
|
|
636
639
|
break;
|
|
637
640
|
case 'insert-image':
|
|
@@ -71,7 +71,7 @@ export declare class ToolbarRenderer implements IRenderer {
|
|
|
71
71
|
* @hidden
|
|
72
72
|
|
|
73
73
|
*/
|
|
74
|
-
renderColorPickerDropDown(args: IColorPickerModel, item: string, colorPicker: ColorPicker): DropDownButton;
|
|
74
|
+
renderColorPickerDropDown(args: IColorPickerModel, item: string, colorPicker: ColorPicker, defaultColor: string): DropDownButton;
|
|
75
75
|
private pickerRefresh;
|
|
76
76
|
private popupModal;
|
|
77
77
|
private setColorPickerContentWidth;
|
|
@@ -289,7 +289,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
289
289
|
* @hidden
|
|
290
290
|
|
|
291
291
|
*/
|
|
292
|
-
ToolbarRenderer.prototype.renderColorPickerDropDown = function (args, item, colorPicker) {
|
|
292
|
+
ToolbarRenderer.prototype.renderColorPickerDropDown = function (args, item, colorPicker, defaultColor) {
|
|
293
293
|
var _this = this;
|
|
294
294
|
// eslint-disable-next-line
|
|
295
295
|
var proxy = this;
|
|
@@ -298,8 +298,9 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
298
298
|
var content = proxy.parent.createElement('span', { className: CLS_COLOR_CONTENT });
|
|
299
299
|
var inlineEle = proxy.parent.createElement('span', { className: args.cssClass });
|
|
300
300
|
var range;
|
|
301
|
+
var initialBackgroundColor = (isNullOrUndefined(defaultColor)) ? proxy.parent.backgroundColor.default : defaultColor;
|
|
301
302
|
inlineEle.style.borderBottomColor = (item === 'backgroundcolor') ?
|
|
302
|
-
|
|
303
|
+
initialBackgroundColor : proxy.parent.fontColor.default;
|
|
303
304
|
content.appendChild(inlineEle);
|
|
304
305
|
var dropDown = new DropDownButton({
|
|
305
306
|
target: colorPicker.element.parentElement, cssClass: css,
|