@syncfusion/ej2-richtexteditor 19.4.40 → 19.4.52
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 +30 -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 +96 -49
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +96 -49
- 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 +2 -1
- 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/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/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 +2 -2
- 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 +21 -18
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.52
|
|
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.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@19.4.50",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-Dftmdla20Jks8BOKPNXpXnuFgKKJrFpTZ96N1tBqOdY2ztRJkCX/xRzH7piEaw8FSRpPX+ouLKRUistuRodm2w==",
|
|
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.
|
|
30
|
-
"_shasum": "
|
|
29
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-19.4.50.tgz",
|
|
30
|
+
"_shasum": "a6c82c29e63820e3c8c1f930e93cd1c9c0eb6ec6",
|
|
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.52",
|
|
42
|
+
"@syncfusion/ej2-buttons": "~19.4.52",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~19.4.52",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~19.4.52",
|
|
45
|
+
"@syncfusion/ej2-navigations": "~19.4.52",
|
|
46
|
+
"@syncfusion/ej2-popups": "~19.4.52",
|
|
47
|
+
"@syncfusion/ej2-splitbuttons": "~19.4.52"
|
|
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.52",
|
|
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
|
}
|
|
@@ -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' &&
|
|
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
|
}
|
|
@@ -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;
|
|
@@ -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
|
}
|
|
@@ -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',
|
|
@@ -988,7 +988,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
988
988
|
break;
|
|
989
989
|
case 'width':
|
|
990
990
|
this.setWidth(newProp[prop]);
|
|
991
|
-
if (this.toolbarSettings.enable) {
|
|
991
|
+
if (this.toolbarSettings.enable && !this.inlineMode.enable) {
|
|
992
992
|
this.toolbarModule.refreshToolbarOverflow();
|
|
993
993
|
this.resizeHandler();
|
|
994
994
|
}
|
|
@@ -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 !== ''
|
|
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':
|