@syncfusion/ej2-richtexteditor 19.3.57 → 19.4.48
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/.github/PULL_REQUEST_TEMPLATE/Bug.md +41 -0
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +27 -0
- package/CHANGELOG.md +24 -12
- 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 +150 -62
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +149 -61
- 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/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 +54 -20
- package/src/editor-manager/plugin/selection-commands.js +10 -5
- package/src/editor-manager/plugin/undo.js +10 -1
- 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/dropdown-buttons.js +0 -10
- package/src/rich-text-editor/actions/enter-key.js +55 -11
- package/src/rich-text-editor/actions/html-editor.js +3 -2
- package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
- 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 +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 +5 -4
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +1 -1
- package/src/rich-text-editor/renderer/toolbar-renderer.js +3 -2
- package/styles/rich-text-editor/_fluent-definition.scss +168 -0
- package/styles/rich-text-editor/_layout.scss +1 -1
- package/styles/rich-text-editor/icons/_fluent.scss +303 -0
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 19.
|
|
3
|
+
* version : 19.4.48
|
|
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.47",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-UdMD8BtRya7fywqWMoRBQGJsAmkrmqRxuVvA/aDi6KoTJ2pmK5vEaPin/recIzlBQ0RfvsiNgPmlzUnvyuenOg==",
|
|
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.
|
|
30
|
-
"_shasum": "
|
|
29
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-19.4.47.tgz",
|
|
30
|
+
"_shasum": "852f8dfe39b8c7c165871e683a87f5d4425aae5e",
|
|
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.
|
|
42
|
-
"@syncfusion/ej2-buttons": "~19.
|
|
43
|
-
"@syncfusion/ej2-filemanager": "~19.
|
|
44
|
-
"@syncfusion/ej2-inputs": "~19.
|
|
45
|
-
"@syncfusion/ej2-navigations": "~19.
|
|
46
|
-
"@syncfusion/ej2-popups": "~19.
|
|
47
|
-
"@syncfusion/ej2-splitbuttons": "~19.
|
|
41
|
+
"@syncfusion/ej2-base": "~19.4.48",
|
|
42
|
+
"@syncfusion/ej2-buttons": "~19.4.48",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~19.4.48",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~19.4.48",
|
|
45
|
+
"@syncfusion/ej2-navigations": "~19.4.48",
|
|
46
|
+
"@syncfusion/ej2-popups": "~19.4.48",
|
|
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.
|
|
73
|
+
"version": "19.4.48",
|
|
74
74
|
"sideEffects": false
|
|
75
75
|
}
|
|
@@ -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
|
}
|
|
@@ -46,7 +46,7 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
46
46
|
this.parent.observer.on(EVENTS.MS_WORD_CLEANUP_PLUGIN, this.wordCleanup, this);
|
|
47
47
|
};
|
|
48
48
|
MsWordPaste.prototype.wordCleanup = function (e) {
|
|
49
|
-
var wordPasteStyleConfig = e.allowedStylePropertiesArray;
|
|
49
|
+
var wordPasteStyleConfig = !isNOU(e.allowedStylePropertiesArray) ? e.allowedStylePropertiesArray : [];
|
|
50
50
|
var listNodes = [];
|
|
51
51
|
var tempHTMLContent = e.args.clipboardData.getData('text/HTML');
|
|
52
52
|
var rtfData = e.args.clipboardData.getData('text/rtf');
|
|
@@ -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
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { debounce, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
1
|
+
import { debounce, isNullOrUndefined, detach } from '@syncfusion/ej2-base';
|
|
2
2
|
import { NodeSelection } from './../../selection/selection';
|
|
3
3
|
import * as EVENTS from './../../common/constant';
|
|
4
4
|
import { isIDevice, setEditFrameFocus } from '../../common/util';
|
|
@@ -96,6 +96,15 @@ var UndoRedoManager = /** @class */ (function () {
|
|
|
96
96
|
*/
|
|
97
97
|
UndoRedoManager.prototype.saveData = function (e) {
|
|
98
98
|
var range = new NodeSelection().getRange(this.parent.currentDocument);
|
|
99
|
+
var currentContainer = range.startContainer;
|
|
100
|
+
for (var i = currentContainer.childNodes.length - 1; i >= 0; i--) {
|
|
101
|
+
if (!isNullOrUndefined(currentContainer.childNodes[i]) && currentContainer.childNodes[i].nodeName === '#text' &&
|
|
102
|
+
currentContainer.childNodes[i].textContent.length === 0 && currentContainer.childNodes[i].nodeName !== 'IMG' &&
|
|
103
|
+
currentContainer.childNodes[i].nodeName !== 'BR' && currentContainer.childNodes[i].nodeName && 'HR') {
|
|
104
|
+
detach(currentContainer.childNodes[i]);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
range = new NodeSelection().getRange(this.parent.currentDocument);
|
|
99
108
|
var save = new NodeSelection().save(range, this.parent.currentDocument);
|
|
100
109
|
var htmlText = this.parent.editableElement.innerHTML;
|
|
101
110
|
var changEle = { text: htmlText, range: save };
|
|
@@ -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();
|
|
@@ -206,11 +206,6 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
206
206
|
var prop = _a[_i];
|
|
207
207
|
switch (prop) {
|
|
208
208
|
case 'fontFamily':
|
|
209
|
-
if (this.parent.inlineMode.enable) {
|
|
210
|
-
if (!isNullOrUndefined(this.parent.fontFamily.default)) {
|
|
211
|
-
this.getEditNode().style.fontFamily = this.parent.fontFamily.default;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
209
|
if (this.fontNameDropDown) {
|
|
215
210
|
for (var _b = 0, _c = Object.keys(newProp.fontFamily); _b < _c.length; _b++) {
|
|
216
211
|
var fontFamily = _c[_b];
|
|
@@ -242,11 +237,6 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
242
237
|
}
|
|
243
238
|
break;
|
|
244
239
|
case 'fontSize':
|
|
245
|
-
if (this.parent.inlineMode) {
|
|
246
|
-
if (!isNullOrUndefined(this.parent.fontSize.default)) {
|
|
247
|
-
this.getEditNode().style.fontSize = this.parent.fontSize.default;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
240
|
if (this.fontSizeDropDown) {
|
|
251
241
|
for (var _d = 0, _e = Object.keys(newProp.fontSize); _d < _e.length; _d++) {
|
|
252
242
|
var fontSize = _e[_d];
|
|
@@ -29,9 +29,20 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
29
29
|
EnterKeyAction.prototype.enterHandler = function (e) {
|
|
30
30
|
var _this = this;
|
|
31
31
|
this.getRangeNode();
|
|
32
|
+
var isTableEnter = true;
|
|
33
|
+
if (!isNOU(this.startNode.closest('TABLE')) && !isNOU(this.endNode.closest('TABLE'))) {
|
|
34
|
+
isTableEnter = false;
|
|
35
|
+
var curElement = this.startNode;
|
|
36
|
+
var blockElement = curElement;
|
|
37
|
+
while (!this.parent.formatter.editorManager.domNode.isBlockNode(curElement)) {
|
|
38
|
+
blockElement = curElement;
|
|
39
|
+
curElement = curElement.parentElement;
|
|
40
|
+
}
|
|
41
|
+
isTableEnter = blockElement.tagName === 'TD' ? false : true;
|
|
42
|
+
}
|
|
32
43
|
if (e.args.which === 13 && e.args.code === 'Enter') {
|
|
33
|
-
if (isNOU(this.startNode.closest('LI')) && isNOU(this.endNode.closest('LI')) &&
|
|
34
|
-
isNOU(this.
|
|
44
|
+
if (isNOU(this.startNode.closest('LI')) && isNOU(this.endNode.closest('LI')) && isTableEnter &&
|
|
45
|
+
isNOU(this.startNode.closest('PRE')) && isNOU(this.endNode.closest('PRE'))) {
|
|
35
46
|
var shiftKey_1 = e.args.shiftKey;
|
|
36
47
|
var actionBeginArgs = {
|
|
37
48
|
cancel: false,
|
|
@@ -92,10 +103,29 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
92
103
|
if ((_this.parent.enterKey === 'P' && !shiftKey_1) || (_this.parent.enterKey === 'DIV' && !shiftKey_1) ||
|
|
93
104
|
(_this.parent.shiftEnterKey === 'P' && shiftKey_1) ||
|
|
94
105
|
(_this.parent.shiftEnterKey === 'DIV' && shiftKey_1)) {
|
|
95
|
-
var nearBlockNode =
|
|
106
|
+
var nearBlockNode = void 0;
|
|
107
|
+
if (isTableEnter && _this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode)) {
|
|
108
|
+
nearBlockNode = _this.startNode;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
nearBlockNode = _this.parent.formatter.editorManager.domNode.blockParentNode(_this.startNode);
|
|
112
|
+
}
|
|
96
113
|
var isImageNode = false;
|
|
97
|
-
|
|
98
|
-
|
|
114
|
+
var isFocusedFirst = false;
|
|
115
|
+
if (_this.range.startOffset != 0 && _this.range.endOffset != 0 && _this.range.startContainer === _this.range.endContainer &&
|
|
116
|
+
!(!isNOU(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG')) {
|
|
117
|
+
var startNodeText = _this.range.startContainer.textContent;
|
|
118
|
+
var splitFirstText = startNodeText.substring(0, _this.range.startOffset);
|
|
119
|
+
if (splitFirstText.charCodeAt(_this.range.startOffset - 1) != 160 && splitFirstText.trim().length === 0) {
|
|
120
|
+
isFocusedFirst = true;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
else if (_this.range.startOffset === 0 && _this.range.endOffset === 0) {
|
|
124
|
+
isFocusedFirst = true;
|
|
125
|
+
}
|
|
126
|
+
if (((_this.range.startOffset === 0 && _this.range.endOffset === 0) || isFocusedFirst) &&
|
|
127
|
+
!(!isNOU(_this.range.startContainer.previousSibling) &&
|
|
128
|
+
(_this.range.startContainer.previousSibling.nodeName === 'IMG' || _this.range.startContainer.previousSibling.nodeName === 'BR'))) {
|
|
99
129
|
var isNearBlockLengthZero = void 0;
|
|
100
130
|
var newElem = void 0;
|
|
101
131
|
if (_this.range.startContainer.nodeName === 'IMG') {
|
|
@@ -104,7 +134,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
104
134
|
isNearBlockLengthZero = false;
|
|
105
135
|
}
|
|
106
136
|
else {
|
|
107
|
-
if (nearBlockNode.textContent.length !== 0) {
|
|
137
|
+
if (nearBlockNode.textContent.trim().length !== 0) {
|
|
108
138
|
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
|
|
109
139
|
isNearBlockLengthZero = false;
|
|
110
140
|
}
|
|
@@ -153,7 +183,18 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
153
183
|
}
|
|
154
184
|
if (newElem.textContent.trim().length === 0) {
|
|
155
185
|
var brElm = _this.parent.createElement('br');
|
|
156
|
-
_this.startNode.
|
|
186
|
+
if (_this.startNode.nodeName === 'A') {
|
|
187
|
+
var startParentElem = _this.startNode.parentElement;
|
|
188
|
+
_this.startNode.parentElement.insertBefore(brElm, _this.startNode);
|
|
189
|
+
detach(_this.startNode);
|
|
190
|
+
_this.startNode = startParentElem;
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
_this.startNode.appendChild(brElm);
|
|
194
|
+
}
|
|
195
|
+
if (newElem.childNodes[0].textContent === '\n') {
|
|
196
|
+
detach(newElem.childNodes[0]);
|
|
197
|
+
}
|
|
157
198
|
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.startNode, 0);
|
|
158
199
|
}
|
|
159
200
|
if (((_this.parent.enterKey === 'P' || _this.parent.enterKey === 'DIV') && !shiftKey_1) || ((_this.parent.shiftEnterKey === 'DIV' ||
|
|
@@ -164,7 +205,8 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
164
205
|
}
|
|
165
206
|
_this.parent.formatter.editorManager.domNode.insertAfter(insertElm, newElem);
|
|
166
207
|
detach(newElem);
|
|
167
|
-
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode) ?
|
|
208
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode) ?
|
|
209
|
+
insertElm : _this.startNode, 0);
|
|
168
210
|
}
|
|
169
211
|
}
|
|
170
212
|
e.args.preventDefault();
|
|
@@ -195,9 +237,11 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
195
237
|
_this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
|
|
196
238
|
_this.range.startOffset === _this.range.endOffset &&
|
|
197
239
|
_this.range.startOffset === isLastNodeLength) {
|
|
198
|
-
var
|
|
199
|
-
_this.parent.
|
|
200
|
-
_this.parent.formatter.editorManager.
|
|
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);
|
|
201
245
|
}
|
|
202
246
|
else if (!isNOU(currentParent) && currentParent !== _this.parent.inputElement && currentParent.nodeName !== 'BR') {
|
|
203
247
|
if (currentParent.textContent.trim().length === 0 || (currentParent.textContent.trim().length === 1 &&
|
|
@@ -149,7 +149,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
149
149
|
e.args.action === 'enter' ||
|
|
150
150
|
e.args.keyCode === 13) {
|
|
151
151
|
this.spaceLink(e.args);
|
|
152
|
-
if (this.parent.editorMode === 'HTML') {
|
|
152
|
+
if (this.parent.editorMode === 'HTML' && !this.parent.readonly) {
|
|
153
153
|
this.parent.notify(events.enterHandler, { args: e.args });
|
|
154
154
|
}
|
|
155
155
|
}
|
|
@@ -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;
|
|
@@ -29,7 +29,7 @@ var XhtmlValidation = /** @class */ (function () {
|
|
|
29
29
|
this.ImageTags();
|
|
30
30
|
this.removeTags();
|
|
31
31
|
this.RemoveUnsupported();
|
|
32
|
-
this.currentElement.innerHTML = this.selfEncloseValidation(this.currentElement.innerHTML, this.currentElement.innerText ===
|
|
32
|
+
this.currentElement.innerHTML = this.selfEncloseValidation(this.currentElement.innerHTML, this.currentElement.innerText === "\n" ?
|
|
33
33
|
this.currentElement.innerText.length : this.currentElement.innerText.trim().length);
|
|
34
34
|
this.parent.setProperties({ value: this.currentElement.innerHTML }, true);
|
|
35
35
|
}
|
|
@@ -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',
|
|
@@ -1431,7 +1431,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1431
1431
|
this.setProperties({ value: this.valueTemplate });
|
|
1432
1432
|
}
|
|
1433
1433
|
else {
|
|
1434
|
-
var compiledTemplate = compile(this.valueTemplate)(
|
|
1434
|
+
var compiledTemplate = compile(this.valueTemplate)("", this, 'valueTemplate');
|
|
1435
1435
|
for (var i = 0; i < compiledTemplate.length; i++) {
|
|
1436
1436
|
var item = compiledTemplate[i];
|
|
1437
1437
|
append([item], this.element);
|
|
@@ -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)
|