@syncfusion/ej2-richtexteditor 23.2.7 → 24.1.43
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 +35 -1
- package/dist/ej2-richtexteditor.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +574 -309
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +573 -308
- 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 +13 -13
- package/src/common/config.js +1 -1
- package/src/editor-manager/plugin/audio.js +13 -3
- package/src/editor-manager/plugin/dom-node.js +1 -14
- package/src/editor-manager/plugin/image.js +30 -3
- package/src/editor-manager/plugin/inserthtml.js +5 -2
- package/src/editor-manager/plugin/ms-word-clean-up.js +4 -1
- package/src/editor-manager/plugin/nodecutter.js +1 -1
- package/src/editor-manager/plugin/selection-commands.js +39 -0
- package/src/rich-text-editor/actions/base-quick-toolbar.js +18 -4
- package/src/rich-text-editor/actions/color-picker.js +3 -3
- package/src/rich-text-editor/actions/dropdown-buttons.js +4 -2
- package/src/rich-text-editor/actions/emoji-picker.js +12 -3
- package/src/rich-text-editor/actions/enter-key.js +2 -1
- package/src/rich-text-editor/actions/file-manager.js +1 -1
- package/src/rich-text-editor/actions/format-painter.js +1 -1
- package/src/rich-text-editor/actions/full-screen.js +2 -2
- package/src/rich-text-editor/actions/html-editor.d.ts +2 -0
- package/src/rich-text-editor/actions/html-editor.js +36 -5
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +2 -0
- package/src/rich-text-editor/actions/paste-clean-up.js +75 -19
- package/src/rich-text-editor/actions/quick-toolbar.js +24 -5
- package/src/rich-text-editor/actions/toolbar.d.ts +1 -0
- package/src/rich-text-editor/actions/toolbar.js +18 -10
- package/src/rich-text-editor/base/classes.d.ts +5 -0
- package/src/rich-text-editor/base/classes.js +5 -0
- package/src/rich-text-editor/base/constant.d.ts +6 -1
- package/src/rich-text-editor/base/constant.js +6 -1
- package/src/rich-text-editor/base/interface.d.ts +11 -0
- 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 +9 -0
- package/src/rich-text-editor/base/rich-text-editor.js +80 -17
- package/src/rich-text-editor/base/util.js +11 -2
- package/src/rich-text-editor/formatter/formatter.js +1 -1
- package/src/rich-text-editor/models/default-locale.js +2 -0
- package/src/rich-text-editor/models/items.js +1 -1
- package/src/rich-text-editor/renderer/dialog-renderer.js +10 -1
- package/src/rich-text-editor/renderer/image-module.js +68 -59
- package/src/rich-text-editor/renderer/link-module.js +43 -23
- package/src/rich-text-editor/renderer/table-module.d.ts +2 -0
- package/src/rich-text-editor/renderer/table-module.js +43 -30
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +0 -6
- package/src/rich-text-editor/renderer/toolbar-renderer.js +13 -93
- package/src/rich-text-editor/renderer/view-source.js +3 -1
- package/styles/bootstrap-dark.css +194 -52
- package/styles/bootstrap.css +197 -53
- package/styles/bootstrap4.css +194 -52
- package/styles/bootstrap5-dark.css +195 -53
- package/styles/bootstrap5.css +195 -53
- package/styles/fabric-dark.css +194 -52
- package/styles/fabric.css +194 -52
- package/styles/fluent-dark.css +197 -53
- package/styles/fluent.css +197 -53
- package/styles/highcontrast-light.css +194 -52
- package/styles/highcontrast.css +194 -52
- package/styles/material-dark.css +196 -53
- package/styles/material.css +196 -53
- package/styles/material3-dark.css +194 -52
- package/styles/material3.css +194 -52
- package/styles/rich-text-editor/_bootstrap5-definition.scss +1 -1
- package/styles/rich-text-editor/_fluent-definition.scss +1 -1
- package/styles/rich-text-editor/_layout.scss +78 -3
- package/styles/rich-text-editor/_theme.scss +1 -1
- package/styles/rich-text-editor/bootstrap-dark.css +194 -52
- package/styles/rich-text-editor/bootstrap.css +197 -53
- package/styles/rich-text-editor/bootstrap4.css +194 -52
- package/styles/rich-text-editor/bootstrap5-dark.css +195 -53
- package/styles/rich-text-editor/bootstrap5.css +195 -53
- package/styles/rich-text-editor/fabric-dark.css +194 -52
- package/styles/rich-text-editor/fabric.css +194 -52
- package/styles/rich-text-editor/fluent-dark.css +197 -53
- package/styles/rich-text-editor/fluent.css +197 -53
- package/styles/rich-text-editor/highcontrast-light.css +194 -52
- package/styles/rich-text-editor/highcontrast.css +194 -52
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +3 -3
- package/styles/rich-text-editor/icons/_bootstrap.scss +3 -3
- package/styles/rich-text-editor/icons/_bootstrap4.scss +3 -3
- package/styles/rich-text-editor/icons/_bootstrap5.scss +3 -3
- package/styles/rich-text-editor/icons/_fabric-dark.scss +3 -3
- package/styles/rich-text-editor/icons/_fabric.scss +3 -3
- package/styles/rich-text-editor/icons/_fluent.scss +3 -3
- package/styles/rich-text-editor/icons/_fusionnew.scss +3 -3
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +3 -3
- package/styles/rich-text-editor/icons/_highcontrast.scss +3 -3
- package/styles/rich-text-editor/icons/_material-dark.scss +3 -3
- package/styles/rich-text-editor/icons/_material.scss +3 -3
- package/styles/rich-text-editor/icons/_material3.scss +3 -3
- package/styles/rich-text-editor/icons/_tailwind.scss +3 -3
- package/styles/rich-text-editor/material-dark.css +196 -53
- package/styles/rich-text-editor/material.css +196 -53
- package/styles/rich-text-editor/material3-dark.css +194 -52
- package/styles/rich-text-editor/material3.css +194 -52
- package/styles/rich-text-editor/tailwind-dark.css +194 -52
- package/styles/rich-text-editor/tailwind.css +194 -52
- package/styles/tailwind-dark.css +194 -52
- package/styles/tailwind.css +194 -52
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 24.1.43
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. 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@
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@24.1.41",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-h4DVBcoJwsAW5vm0Y6Ffg3KcNNeCxkj2MwOW+z+Aa8puZZETLQitQl8yt76IFRoxTY/MCdkoTWVILD5mstwkFg==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-richtexteditor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"/@syncfusion/ej2-react-richtexteditor",
|
|
26
26
|
"/@syncfusion/ej2-vue-richtexteditor"
|
|
27
27
|
],
|
|
28
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-
|
|
29
|
-
"_shasum": "
|
|
28
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-24.1.41.tgz",
|
|
29
|
+
"_shasum": "b0643450fa79cf814e9386718d1e011876c3946a",
|
|
30
30
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
31
|
-
"_where": "/jenkins/workspace/elease-
|
|
31
|
+
"_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
|
|
32
32
|
"author": {
|
|
33
33
|
"name": "Syncfusion Inc."
|
|
34
34
|
},
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
},
|
|
38
38
|
"bundleDependencies": false,
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@syncfusion/ej2-base": "~
|
|
41
|
-
"@syncfusion/ej2-buttons": "~
|
|
42
|
-
"@syncfusion/ej2-filemanager": "~
|
|
43
|
-
"@syncfusion/ej2-inputs": "~
|
|
44
|
-
"@syncfusion/ej2-navigations": "~
|
|
45
|
-
"@syncfusion/ej2-popups": "~
|
|
46
|
-
"@syncfusion/ej2-splitbuttons": "~
|
|
40
|
+
"@syncfusion/ej2-base": "~24.1.42",
|
|
41
|
+
"@syncfusion/ej2-buttons": "~24.1.41",
|
|
42
|
+
"@syncfusion/ej2-filemanager": "~24.1.43",
|
|
43
|
+
"@syncfusion/ej2-inputs": "~24.1.41",
|
|
44
|
+
"@syncfusion/ej2-navigations": "~24.1.41",
|
|
45
|
+
"@syncfusion/ej2-popups": "~24.1.41",
|
|
46
|
+
"@syncfusion/ej2-splitbuttons": "~24.1.41"
|
|
47
47
|
},
|
|
48
48
|
"deprecated": false,
|
|
49
49
|
"description": "Essential JS 2 RichTextEditor component",
|
|
@@ -69,6 +69,6 @@
|
|
|
69
69
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
70
70
|
},
|
|
71
71
|
"typings": "index.d.ts",
|
|
72
|
-
"version": "
|
|
72
|
+
"version": "24.1.43",
|
|
73
73
|
"sideEffects": false
|
|
74
74
|
}
|
package/src/common/config.js
CHANGED
|
@@ -41,7 +41,7 @@ export var htmlKeyConfig = {
|
|
|
41
41
|
'insert-link': 'ctrl+k',
|
|
42
42
|
'insert-image': 'ctrl+shift+i',
|
|
43
43
|
'insert-audio': 'ctrl+shift+a',
|
|
44
|
-
'insert-video': 'ctrl+
|
|
44
|
+
'insert-video': 'ctrl+alt+v',
|
|
45
45
|
'insert-table': 'ctrl+shift+e',
|
|
46
46
|
'undo': 'ctrl+z',
|
|
47
47
|
'redo': 'ctrl+y',
|
|
@@ -113,9 +113,19 @@ var AudioCommand = /** @class */ (function () {
|
|
|
113
113
|
if (!isNOU(e.item.url)) {
|
|
114
114
|
sourceElement.setAttribute('src', e.item.url);
|
|
115
115
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
var fileExtension = e.item.fileName ? e.item.fileName.split('.').pop().toLowerCase() :
|
|
117
|
+
e.item.url ? e.item.url.split('.').pop().toLowerCase() : '';
|
|
118
|
+
if (fileExtension === 'opus') {
|
|
119
|
+
sourceElement.type = 'audio/ogg';
|
|
120
|
+
}
|
|
121
|
+
else if (fileExtension === 'm4a') {
|
|
122
|
+
sourceElement.type = 'audio/mp4';
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
sourceElement.type = e.item.fileName && e.item.fileName.split('.').length > 0 ?
|
|
126
|
+
'audio/' + e.item.fileName.split('.')[e.item.fileName.split('.').length - 1] :
|
|
127
|
+
e.item.url && e.item.url.split('.').length > 0 ? 'audio/' + e.item.url.split('.')[e.item.url.split('.').length - 1] : '';
|
|
128
|
+
}
|
|
119
129
|
};
|
|
120
130
|
AudioCommand.prototype.callBack = function (e) {
|
|
121
131
|
if (e.callBack) {
|
|
@@ -451,19 +451,6 @@ var DOMNode = /** @class */ (function () {
|
|
|
451
451
|
var end = this.parent.querySelector('.' + markerClassName.endSelection);
|
|
452
452
|
var startTextNode;
|
|
453
453
|
var endTextNode;
|
|
454
|
-
if (start.textContent === '' && isNOU(end) && action !== 'tab') {
|
|
455
|
-
// To Do Apply Heading and Back space press in empty content.
|
|
456
|
-
// if (isNOU(action) && save.range.startContainer.nodeType === 1 &&
|
|
457
|
-
// (save.range.startContainer as HTMLElement).querySelectorAll('audio,video,image').length === 0) {
|
|
458
|
-
// start.innerHTML = '<br>';
|
|
459
|
-
// }
|
|
460
|
-
if (start.childNodes.length === 1 && start.childNodes[0].nodeName === 'BR') {
|
|
461
|
-
start.innerHTML = '<br>';
|
|
462
|
-
}
|
|
463
|
-
else {
|
|
464
|
-
start.innerHTML = '';
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
454
|
if (this.hasClass(start, markerClassName.startSelection) && start.classList.length > 1) {
|
|
468
455
|
var replace = this.createTagString(CONSTANT.DEFAULT_TAG, start, this.encode(start.textContent));
|
|
469
456
|
this.replaceWith(start, replace);
|
|
@@ -586,7 +573,7 @@ var DOMNode = /** @class */ (function () {
|
|
|
586
573
|
else if (start.tagName === 'BR') {
|
|
587
574
|
this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
|
|
588
575
|
var markerStart = range.startContainer.querySelector('.' + className);
|
|
589
|
-
markerStart.appendChild(start);
|
|
576
|
+
markerStart.parentElement.appendChild(start);
|
|
590
577
|
}
|
|
591
578
|
else {
|
|
592
579
|
if (start.tagName === 'IMG') {
|
|
@@ -84,8 +84,8 @@ var ImageCommand = /** @class */ (function () {
|
|
|
84
84
|
e.item.url = isNOU(e.item.url) || e.item.url === 'undefined' ? e.item.src : e.item.url;
|
|
85
85
|
if (!isNOU(e.item.selectParent) && e.item.selectParent[0].tagName === 'IMG') {
|
|
86
86
|
var imgEle = e.item.selectParent[0];
|
|
87
|
-
this.setStyle(imgEle, e);
|
|
88
87
|
isReplaced = true;
|
|
88
|
+
this.setStyle(imgEle, e, isReplaced);
|
|
89
89
|
}
|
|
90
90
|
else {
|
|
91
91
|
var imgElement = createElement('img');
|
|
@@ -121,12 +121,34 @@ var ImageCommand = /** @class */ (function () {
|
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
+
if (e.value === 'Replace') {
|
|
125
|
+
e.item.subCommand = 'Replace';
|
|
126
|
+
this.callBack(e);
|
|
127
|
+
}
|
|
124
128
|
};
|
|
125
|
-
ImageCommand.prototype.setStyle = function (imgElement, e) {
|
|
129
|
+
ImageCommand.prototype.setStyle = function (imgElement, e, imgReplace) {
|
|
126
130
|
if (!isNOU(e.item.url)) {
|
|
127
131
|
imgElement.setAttribute('src', e.item.url);
|
|
128
132
|
}
|
|
129
|
-
|
|
133
|
+
var alignClassName;
|
|
134
|
+
if (imgReplace) {
|
|
135
|
+
var alignClass = {
|
|
136
|
+
'e-imgcenter': 'e-imgcenter',
|
|
137
|
+
'e-imgright': 'e-imgright',
|
|
138
|
+
'e-imgleft': 'e-imgleft'
|
|
139
|
+
};
|
|
140
|
+
var imgClassList = imgElement.classList;
|
|
141
|
+
var classArray = [];
|
|
142
|
+
for (var i = 0; i < imgClassList.length; i++) {
|
|
143
|
+
// eslint-disable-next-line
|
|
144
|
+
if (!isNOU(alignClass[imgClassList[i]])) {
|
|
145
|
+
// eslint-disable-next-line
|
|
146
|
+
alignClassName = alignClass[imgClassList[i]];
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
imgElement.setAttribute('class', 'e-rte-image' + (isNOU(e.item.cssClass) ? '' : ' ' + e.item.cssClass)
|
|
151
|
+
+ (isNOU(alignClassName) ? '' : ' ' + alignClassName));
|
|
130
152
|
if (!isNOU(e.item.altText)) {
|
|
131
153
|
imgElement.setAttribute('alt', e.item.altText);
|
|
132
154
|
}
|
|
@@ -178,6 +200,9 @@ var ImageCommand = /** @class */ (function () {
|
|
|
178
200
|
if (!isNOU(e.item.target)) {
|
|
179
201
|
anchor.setAttribute('target', e.item.target);
|
|
180
202
|
}
|
|
203
|
+
if (!isNOU(e.item.ariaLabel)) {
|
|
204
|
+
anchor.setAttribute('aria-label', e.item.ariaLabel);
|
|
205
|
+
}
|
|
181
206
|
InsertHtml.Insert(this.parent.currentDocument, anchor, this.parent.editableElement);
|
|
182
207
|
this.callBack(e);
|
|
183
208
|
};
|
|
@@ -209,9 +234,11 @@ var ImageCommand = /** @class */ (function () {
|
|
|
209
234
|
e.item.selectNode[0].parentElement.href = e.item.url;
|
|
210
235
|
if (isNOU(e.item.target)) {
|
|
211
236
|
e.item.selectNode[0].parentElement.removeAttribute('target');
|
|
237
|
+
e.item.selectNode[0].parentElement.removeAttribute('aria-label');
|
|
212
238
|
}
|
|
213
239
|
else {
|
|
214
240
|
e.item.selectNode[0].parentElement.target = e.item.target;
|
|
241
|
+
e.item.selectNode[0].parentElement.ariaLabel = e.item.ariaLabel;
|
|
215
242
|
}
|
|
216
243
|
this.callBack(e);
|
|
217
244
|
};
|
|
@@ -119,6 +119,9 @@ var InsertHtml = /** @class */ (function () {
|
|
|
119
119
|
InsertMethods.AppendBefore(node, parentNode.firstChild, false);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
+
else if (isNOU(preNode.previousSibling) && insertNode.tagName === 'TABLE') {
|
|
123
|
+
parentNode.prepend(node);
|
|
124
|
+
}
|
|
122
125
|
else {
|
|
123
126
|
parentNode.appendChild(node);
|
|
124
127
|
}
|
|
@@ -296,7 +299,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
296
299
|
(this.inlineNode.indexOf(node.firstChild.nodeName.toLocaleLowerCase()) >= 0 && isFirstTextNode)) {
|
|
297
300
|
lastSelectionNode = node.firstChild;
|
|
298
301
|
if (isNOU(node.previousElementSibling)) {
|
|
299
|
-
var firstParaElm = createElement('p');
|
|
302
|
+
var firstParaElm = enterAction === 'DIV' ? createElement('div') : createElement('p');
|
|
300
303
|
node.parentElement.insertBefore(firstParaElm, node);
|
|
301
304
|
}
|
|
302
305
|
if (node.previousElementSibling.nodeName === 'BR') {
|
|
@@ -311,7 +314,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
311
314
|
if (node.firstChild.nodeName === '#text' ||
|
|
312
315
|
(this.inlineNode.indexOf(node.firstChild.nodeName.toLocaleLowerCase()) >= 0)) {
|
|
313
316
|
if (!isPreviousInlineElem) {
|
|
314
|
-
paraElm = createElement('p');
|
|
317
|
+
paraElm = enterAction === 'DIV' ? createElement('div') : createElement('p');
|
|
315
318
|
paraElm.appendChild(node.firstChild);
|
|
316
319
|
fragment.appendChild(paraElm);
|
|
317
320
|
}
|
|
@@ -474,6 +474,9 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
474
474
|
resultElem = elm.querySelectorAll(keys[i]);
|
|
475
475
|
}
|
|
476
476
|
for (var j = 0; j < resultElem.length; j++) {
|
|
477
|
+
if (resultElem[j].closest('li') && keys[i] === 'p') {
|
|
478
|
+
continue;
|
|
479
|
+
}
|
|
477
480
|
var styleProperty = resultElem[j].getAttribute('style');
|
|
478
481
|
if (!isNOU(styleProperty) && styleProperty.trim() !== '') {
|
|
479
482
|
var valueSplit = values[i].split(';');
|
|
@@ -772,7 +775,7 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
772
775
|
!isNormalList) {
|
|
773
776
|
prevList = null;
|
|
774
777
|
}
|
|
775
|
-
var pElement = createElement('p');
|
|
778
|
+
var pElement = createElement('p', { className: 'MsoNormal' });
|
|
776
779
|
pElement.innerHTML = collection[index].content.join(' ');
|
|
777
780
|
if ((collection[index].nestedLevel === 1) && listCount === 0 && collection[index].content) {
|
|
778
781
|
root.appendChild(temp = createElement(collection[index].listType, { className: collection[index].class }));
|
|
@@ -171,7 +171,7 @@ var NodeCutter = /** @class */ (function () {
|
|
|
171
171
|
if ((indexes.indexOf(range.startOffset) >= 0)
|
|
172
172
|
|| ((indexes.indexOf(range.startOffset - 1) >= 0) && (range.startOffset !== 1
|
|
173
173
|
|| (range.startOffset === 1 && new RegExp('\\s').test(str[0])))
|
|
174
|
-
|| ((indexes[indexes.length - 1] - 1) === range.startOffset))) {
|
|
174
|
+
|| (((indexes[indexes.length - 1] - 1) === range.startOffset) && !new RegExp('\\s').test(str[0])))) {
|
|
175
175
|
cursorRange = range;
|
|
176
176
|
this.position = 1;
|
|
177
177
|
}
|
|
@@ -295,6 +295,19 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
295
295
|
}
|
|
296
296
|
else {
|
|
297
297
|
child = InsertMethods.unwrap(formatNode);
|
|
298
|
+
var liElement = nodes[index].parentElement;
|
|
299
|
+
if (!isNOU(liElement) && liElement.tagName.toLowerCase() !== 'li') {
|
|
300
|
+
liElement = closest(liElement, 'li');
|
|
301
|
+
}
|
|
302
|
+
if (!isNOU(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
303
|
+
liElement.textContent.trim() === nodes[index].textContent.trim()) {
|
|
304
|
+
if (format === 'bold') {
|
|
305
|
+
liElement.style.fontWeight = 'normal';
|
|
306
|
+
}
|
|
307
|
+
else if (format === "italic") {
|
|
308
|
+
liElement.style.fontStyle = 'normal';
|
|
309
|
+
}
|
|
310
|
+
}
|
|
298
311
|
}
|
|
299
312
|
if (child[0] && !isFontStyle) {
|
|
300
313
|
var nodeTraverse = child[index] ? child[index] : child[0];
|
|
@@ -343,6 +356,16 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
343
356
|
if (child[num].nodeType !== 3 || (child[num].textContent &&
|
|
344
357
|
child[num].textContent.trim().length > 0)) {
|
|
345
358
|
child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
|
|
359
|
+
var liElement = nodes[index].parentElement;
|
|
360
|
+
if (!isNOU(liElement) && liElement.tagName.toLowerCase() !== 'li') {
|
|
361
|
+
liElement = closest(liElement, 'li');
|
|
362
|
+
}
|
|
363
|
+
if (!isNOU(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
364
|
+
liElement.textContent.trim() === nodes[index].textContent.trim()) {
|
|
365
|
+
if (format === 'fontname') {
|
|
366
|
+
liElement.style.fontFamily = value;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
346
369
|
if (child[num].textContent === startText) {
|
|
347
370
|
if (num === 0) {
|
|
348
371
|
range.setStartBefore(child[num]);
|
|
@@ -456,6 +479,9 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
456
479
|
liElement.style.color = value;
|
|
457
480
|
liElement.style.textDecoration = 'inherit';
|
|
458
481
|
}
|
|
482
|
+
else if (format === 'fontname') {
|
|
483
|
+
liElement.style.fontFamily = value;
|
|
484
|
+
}
|
|
459
485
|
}
|
|
460
486
|
if (value === 'formatPainter') {
|
|
461
487
|
return this.insertFormatPainterElem(nodes, index, range, nodeCutter, painterValues, domNode);
|
|
@@ -503,6 +529,19 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
503
529
|
}
|
|
504
530
|
else {
|
|
505
531
|
nodes[index] = this.applyStyles(nodes, index, element);
|
|
532
|
+
var liElement = nodes[index].parentElement;
|
|
533
|
+
if (!isNOU(liElement) && liElement.tagName.toLowerCase() !== 'li') {
|
|
534
|
+
liElement = closest(liElement, 'li');
|
|
535
|
+
}
|
|
536
|
+
if (!isNOU(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
537
|
+
liElement.textContent.trim() === nodes[index].textContent.trim()) {
|
|
538
|
+
if (format === 'bold') {
|
|
539
|
+
liElement.style.fontWeight = 'bold';
|
|
540
|
+
}
|
|
541
|
+
else if (format === "italic") {
|
|
542
|
+
liElement.style.fontStyle = 'italic';
|
|
543
|
+
}
|
|
544
|
+
}
|
|
506
545
|
}
|
|
507
546
|
}
|
|
508
547
|
}
|
|
@@ -24,6 +24,9 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
24
24
|
}
|
|
25
25
|
BaseQuickToolbar.prototype.appendPopupContent = function () {
|
|
26
26
|
this.toolbarElement = this.parent.createElement('div', { className: classes.CLS_QUICK_TB });
|
|
27
|
+
if (this.element.classList.contains(classes.CLS_TEXT_POP)) {
|
|
28
|
+
this.toolbarElement.classList.add(classes.CLS_TEXT_QUICK_TB);
|
|
29
|
+
}
|
|
27
30
|
this.element.appendChild(this.toolbarElement);
|
|
28
31
|
};
|
|
29
32
|
/**
|
|
@@ -216,7 +219,7 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
216
219
|
editPanelTop = (cntEle) ? cntEle.scrollTop : 0;
|
|
217
220
|
editPanelHeight = (cntEle) ? cntEle.offsetHeight : 0;
|
|
218
221
|
}
|
|
219
|
-
if (!_this.parent.inlineMode.enable && !closest(target, 'table') && type !== 'text') {
|
|
222
|
+
if ((!_this.parent.inlineMode.enable && !closest(target, 'table') && type !== 'text' && type !== 'link') || target.tagName === 'IMG') {
|
|
220
223
|
_this.parent.disableToolbarItem(_this.parent.toolbarSettings.items);
|
|
221
224
|
_this.parent.enableToolbarItem(['Undo', 'Redo']);
|
|
222
225
|
}
|
|
@@ -359,7 +362,18 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
359
362
|
tbItems: this.quickTBarObj.toolbarObj.items
|
|
360
363
|
};
|
|
361
364
|
setToolbarStatus(options, true, this.parent);
|
|
362
|
-
if (
|
|
365
|
+
if (this.parent.quickToolbarSettings.text && this.parent.quickToolbarModule.textQTBar) {
|
|
366
|
+
var options_1 = {
|
|
367
|
+
args: args,
|
|
368
|
+
dropDownModule: this.parent.quickToolbarModule.textQTBar.dropDownButtons,
|
|
369
|
+
parent: this.parent,
|
|
370
|
+
tbElements: selectAll('.' + classes.CLS_TB_ITEM, this.parent.quickToolbarModule.textQTBar.element),
|
|
371
|
+
tbItems: this.parent.quickToolbarModule.textQTBar.quickTBarObj.toolbarObj.items
|
|
372
|
+
};
|
|
373
|
+
setToolbarStatus(options_1, true, this.parent);
|
|
374
|
+
updateUndoRedoStatus(this.parent.quickToolbarModule.textQTBar.quickTBarObj, this.parent.formatter.editorManager.undoRedoManager.getUndoStatus());
|
|
375
|
+
}
|
|
376
|
+
if (!select('.' + classes.CLS_RTE_SOURCE_CODE_TXTAREA, this.parent.element)) {
|
|
363
377
|
updateUndoRedoStatus(this.parent.getBaseToolbarObject(), this.parent.formatter.editorManager.undoRedoManager.getUndoStatus());
|
|
364
378
|
}
|
|
365
379
|
};
|
|
@@ -391,7 +405,7 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
391
405
|
}
|
|
392
406
|
this.parent.on(events.destroy, this.destroy, this);
|
|
393
407
|
this.parent.on(events.modelChanged, this.onPropertyChanged, this);
|
|
394
|
-
if (this.parent.inlineMode.enable) {
|
|
408
|
+
if (this.parent.inlineMode.enable || this.parent.quickToolbarSettings.text) {
|
|
395
409
|
this.parent.on(events.toolbarUpdated, this.updateStatus, this);
|
|
396
410
|
}
|
|
397
411
|
};
|
|
@@ -433,7 +447,7 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
433
447
|
}
|
|
434
448
|
this.parent.off(events.destroy, this.destroy);
|
|
435
449
|
this.parent.off(events.modelChanged, this.onPropertyChanged);
|
|
436
|
-
if (this.parent.inlineMode.enable) {
|
|
450
|
+
if (this.parent.inlineMode.enable || this.parent.quickToolbarSettings.text) {
|
|
437
451
|
this.parent.off(events.toolbarUpdated, this.updateStatus);
|
|
438
452
|
}
|
|
439
453
|
};
|
|
@@ -58,7 +58,7 @@ var ColorPickerInput = /** @class */ (function () {
|
|
|
58
58
|
document.body.appendChild(fontNode);
|
|
59
59
|
options = {
|
|
60
60
|
cssClass: _this.tools[item.toLocaleLowerCase()].icon
|
|
61
|
-
+ ' ' + classes.CLS_RTE_ELEMENTS + ' ' + classes.CLS_ICONS +
|
|
61
|
+
+ ' ' + classes.CLS_RTE_ELEMENTS + ' ' + classes.CLS_ICONS + _this.parent.getCssClass(true),
|
|
62
62
|
value: _this.tools[item.toLocaleLowerCase()].value,
|
|
63
63
|
command: _this.tools[item.toLocaleLowerCase()].command,
|
|
64
64
|
subCommand: _this.tools[item.toLocaleLowerCase()].subCommand,
|
|
@@ -85,7 +85,7 @@ var ColorPickerInput = /** @class */ (function () {
|
|
|
85
85
|
document.body.appendChild(backNode);
|
|
86
86
|
options = {
|
|
87
87
|
cssClass: _this.tools[item.toLocaleLowerCase()].icon
|
|
88
|
-
+ ' ' + classes.CLS_RTE_ELEMENTS + ' ' + classes.CLS_ICONS +
|
|
88
|
+
+ ' ' + classes.CLS_RTE_ELEMENTS + ' ' + classes.CLS_ICONS + _this.parent.getCssClass(true),
|
|
89
89
|
value: _this.tools[item.toLocaleLowerCase()].value,
|
|
90
90
|
command: _this.tools[item.toLocaleLowerCase()].command,
|
|
91
91
|
subCommand: _this.tools[item.toLocaleLowerCase()].subCommand,
|
|
@@ -100,7 +100,7 @@ var ColorPickerInput = /** @class */ (function () {
|
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
if (this.parent.inlineMode.enable) {
|
|
103
|
-
this.setCssClass({ cssClass: this.parent.
|
|
103
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
ColorPickerInput.prototype.destroy = function () {
|
|
@@ -191,7 +191,7 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
193
|
if (this.parent.inlineMode.enable) {
|
|
194
|
-
this.setCssClass({ cssClass: this.parent.
|
|
194
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
197
|
DropDownButtons.prototype.getUpdateItems = function (items, value) {
|
|
@@ -512,7 +512,9 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
512
512
|
this.parent.on(events.bindCssClass, this.setCssClass, this);
|
|
513
513
|
};
|
|
514
514
|
DropDownButtons.prototype.onIframeMouseDown = function () {
|
|
515
|
-
|
|
515
|
+
if (this.parent.getToolbarElement().querySelectorAll('.e-rte-dropdown-btn[aria-expanded="true"]').length > 0) {
|
|
516
|
+
dispatchEvent(document, 'mousedown');
|
|
517
|
+
}
|
|
516
518
|
};
|
|
517
519
|
DropDownButtons.prototype.removeEventListener = function () {
|
|
518
520
|
if (this.parent.isDestroyed) {
|
|
@@ -44,6 +44,9 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
44
44
|
spanElement = this.parent.element.ownerDocument.querySelector('.e-emoji');
|
|
45
45
|
}
|
|
46
46
|
this.divElement = spanElement.closest('div');
|
|
47
|
+
if (!(this.parent.inputElement.contains(this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()).startContainer))) {
|
|
48
|
+
this.parent.contentModule.getEditPanel().focus();
|
|
49
|
+
}
|
|
47
50
|
var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
48
51
|
this.save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
49
52
|
this.clickEvent = args.args;
|
|
@@ -683,7 +686,8 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
683
686
|
};
|
|
684
687
|
EmojiPicker.prototype.onkeyPress = function (e) {
|
|
685
688
|
var originalEvent = e.args;
|
|
686
|
-
var selection = this.parent.contentModule.
|
|
689
|
+
var selection = (this.parent.iframeSettings.enable) ? this.parent.contentModule.getPanel().contentWindow.getSelection() :
|
|
690
|
+
this.parent.contentModule.getDocument().getSelection();
|
|
687
691
|
if (selection.rangeCount <= 0) {
|
|
688
692
|
return;
|
|
689
693
|
}
|
|
@@ -703,6 +707,10 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
703
707
|
}
|
|
704
708
|
if (originalEvent.keyCode === 32 && isPrevColon && this.popupObj) {
|
|
705
709
|
removeClass([this.divElement], 'e-active');
|
|
710
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument : this.parent.contentModule.getDocument();
|
|
711
|
+
if (this.parent.showTooltip && !isNOU(currentDocument.querySelector('.e-tooltip-wrap'))) {
|
|
712
|
+
this.parent.notify(events.destroyTooltip, { args: event });
|
|
713
|
+
}
|
|
706
714
|
this.popupObj.hide();
|
|
707
715
|
}
|
|
708
716
|
if (this.popupObj && (originalEvent.keyCode === 37 || originalEvent.keyCode === 38 || originalEvent.keyCode === 39
|
|
@@ -713,7 +721,8 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
713
721
|
};
|
|
714
722
|
EmojiPicker.prototype.onkeyUp = function (e) {
|
|
715
723
|
var originalEvent = e.args;
|
|
716
|
-
var selection = this.parent.contentModule.
|
|
724
|
+
var selection = (this.parent.iframeSettings.enable) ? this.parent.contentModule.getPanel().contentWindow.getSelection() :
|
|
725
|
+
this.parent.contentModule.getDocument().getSelection();
|
|
717
726
|
if (selection.rangeCount <= 0) {
|
|
718
727
|
return;
|
|
719
728
|
}
|
|
@@ -739,7 +748,7 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
739
748
|
};
|
|
740
749
|
EmojiPicker.prototype.getCoordinates = function () {
|
|
741
750
|
var coordinates;
|
|
742
|
-
var selection = this.parent.contentModule.
|
|
751
|
+
var selection = (this.parent.iframeSettings.enable) ? this.parent.contentModule.getPanel().contentWindow.getSelection() : window.getSelection();
|
|
743
752
|
var range = selection.getRangeAt(0);
|
|
744
753
|
var firstChild;
|
|
745
754
|
if (range.startContainer.nodeName === 'P' || range.startContainer.nodeName === 'DIV') {
|
|
@@ -236,7 +236,8 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
236
236
|
}
|
|
237
237
|
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), insertElem.nextElementSibling, 0);
|
|
238
238
|
}
|
|
239
|
-
else if (nearBlockNode.textContent.length === 0 && !(!isNOU(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG'
|
|
239
|
+
else if (nearBlockNode.textContent.length === 0 && !(!isNOU(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG' ||
|
|
240
|
+
(nearBlockNode.querySelectorAll('video').length > 0) || (nearBlockNode.querySelectorAll('audio').length > 0) || (nearBlockNode.querySelectorAll('img').length > 0))) {
|
|
240
241
|
if (!isNOU(nearBlockNode.children[0]) && nearBlockNode.children[0].tagName !== 'BR') {
|
|
241
242
|
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
|
|
242
243
|
_this.parent.formatter.editorManager.domNode.insertAfter(newElem, nearBlockNode);
|
|
@@ -78,7 +78,7 @@ var FileManager = /** @class */ (function () {
|
|
|
78
78
|
this.dialogObj.createElement = this.parent.createElement;
|
|
79
79
|
this.dialogObj.appendTo(dlgTarget);
|
|
80
80
|
this.dialogObj.show(Browser.isDevice ? true : false);
|
|
81
|
-
this.setCssClass({ cssClass: this.parent.
|
|
81
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
82
82
|
};
|
|
83
83
|
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
84
84
|
FileManager.prototype.setCssClass = function (e) {
|
|
@@ -38,7 +38,7 @@ var FormatPainter = /** @class */ (function () {
|
|
|
38
38
|
};
|
|
39
39
|
FormatPainter.prototype.onKeyDown = function (event) {
|
|
40
40
|
var originalEvent = event.args;
|
|
41
|
-
if ((originalEvent
|
|
41
|
+
if (!isNOU(originalEvent) && !isNOU(originalEvent.action) && (originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste')
|
|
42
42
|
|| (originalEvent.action === 'escape' && (this.previousAction === 'format-copy' || this.previousAction === 'format-paste'))) {
|
|
43
43
|
if ((originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste')) {
|
|
44
44
|
originalEvent.stopPropagation();
|
|
@@ -26,7 +26,7 @@ var FullScreen = /** @class */ (function () {
|
|
|
26
26
|
this.parent.quickToolbarModule.hideQuickToolbars();
|
|
27
27
|
}
|
|
28
28
|
if (this.parent.showTooltip && !isNOU(document.querySelector('.e-tooltip-wrap'))) {
|
|
29
|
-
this.parent.notify(events.
|
|
29
|
+
this.parent.notify(events.destroyTooltip, { args: event });
|
|
30
30
|
}
|
|
31
31
|
this.scrollableParent = getScrollableParent(this.parent.element);
|
|
32
32
|
if (!this.parent.element.classList.contains(classes.CLS_FULL_SCREEN)) {
|
|
@@ -81,7 +81,7 @@ var FullScreen = /** @class */ (function () {
|
|
|
81
81
|
this.parent.quickToolbarModule.hideQuickToolbars();
|
|
82
82
|
}
|
|
83
83
|
if (this.parent.showTooltip && !isNOU(document.querySelector('.e-tooltip-wrap'))) {
|
|
84
|
-
this.parent.notify(events.
|
|
84
|
+
this.parent.notify(events.destroyTooltip, { args: event });
|
|
85
85
|
}
|
|
86
86
|
if (this.parent.element.classList.contains(classes.CLS_FULL_SCREEN)) {
|
|
87
87
|
var evenArgs = {
|
|
@@ -22,6 +22,7 @@ export declare class HtmlEditor {
|
|
|
22
22
|
private saveSelection;
|
|
23
23
|
xhtmlValidation: XhtmlValidation;
|
|
24
24
|
private clickTimeout;
|
|
25
|
+
private tooltipTargetEle;
|
|
25
26
|
constructor(parent?: IRichTextEditor, serviceLocator?: ServiceLocator);
|
|
26
27
|
/**
|
|
27
28
|
* Destroys the Markdown.
|
|
@@ -56,6 +57,7 @@ export declare class HtmlEditor {
|
|
|
56
57
|
private getRangeLiNode;
|
|
57
58
|
private onPaste;
|
|
58
59
|
private spaceLink;
|
|
60
|
+
private mouseOutHandler;
|
|
59
61
|
private onToolbarClick;
|
|
60
62
|
private renderColorPicker;
|
|
61
63
|
private instantiateRenderer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as events from '../base/constant';
|
|
2
|
-
import { isNullOrUndefined, closest, attributes, removeClass, addClass, Browser, detach } from '@syncfusion/ej2-base';
|
|
2
|
+
import { isNullOrUndefined, closest, attributes, removeClass, addClass, Browser, detach, EventHandler } from '@syncfusion/ej2-base';
|
|
3
3
|
import { isNullOrUndefined as isNOU } from '@syncfusion/ej2-base';
|
|
4
4
|
import { HTMLFormatter } from '../formatter/html-formatter';
|
|
5
5
|
import { RenderType } from '../base/enum';
|
|
@@ -222,7 +222,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
222
222
|
e.args.keyCode === 13) {
|
|
223
223
|
this.spaceLink(e.args);
|
|
224
224
|
if (this.parent.editorMode === 'HTML' && !this.parent.readonly) {
|
|
225
|
-
var currentLength = this.parent.getText().trim().length;
|
|
225
|
+
var currentLength = this.parent.getText().trim().replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length;
|
|
226
226
|
var selectionLength = this.parent.getSelection().length;
|
|
227
227
|
var totalLength = (currentLength - selectionLength) + 1;
|
|
228
228
|
if (!(this.parent.maxLength === -1 || totalLength <= this.parent.maxLength) &&
|
|
@@ -232,6 +232,10 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
232
232
|
}
|
|
233
233
|
else {
|
|
234
234
|
this.parent.notify(events.enterHandler, { args: e.args });
|
|
235
|
+
var newRange = this.parent.getRange();
|
|
236
|
+
if (!isNOU(newRange.startContainer) && newRange.startContainer === this.parent.inputElement.lastChild && newRange.startContainer.nodeName !== '#text') {
|
|
237
|
+
newRange.startContainer.scrollIntoView({ block: "end", inline: "nearest" });
|
|
238
|
+
}
|
|
235
239
|
}
|
|
236
240
|
}
|
|
237
241
|
}
|
|
@@ -380,7 +384,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
380
384
|
var liElement;
|
|
381
385
|
var rootElement;
|
|
382
386
|
if (e.args.code === 'Delete' && e.args.keyCode === 46 &&
|
|
383
|
-
this.parent.contentModule.getText().trim().length !== 0 && this.parent.getSelection().length === 0 && currentRange.startContainer.parentElement.tagName !== 'TD' &&
|
|
387
|
+
this.parent.contentModule.getText().trim().replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length !== 0 && this.parent.getSelection().length === 0 && currentRange.startContainer.parentElement.tagName !== 'TD' &&
|
|
384
388
|
currentRange.startContainer.parentElement.tagName !== 'TH') {
|
|
385
389
|
this.deleteRangeElement = rootElement = this.getRootBlockNode(currentRange.startContainer);
|
|
386
390
|
if (this.deleteRangeElement.tagName === 'OL' || this.deleteRangeElement.tagName === 'UL') {
|
|
@@ -428,8 +432,13 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
428
432
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.deleteRangeElement, this.deleteRangeElement.childNodes.length);
|
|
429
433
|
this.isImageDelete = false;
|
|
430
434
|
}
|
|
431
|
-
|
|
432
|
-
|
|
435
|
+
var brNode = this.deleteRangeElement.querySelector('BR');
|
|
436
|
+
if (brNode && brNode.classList.contains('e-rte-image-remove-focus')) {
|
|
437
|
+
removeClass([brNode], ['e-rte-image-focus']);
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
else if (brNode) {
|
|
441
|
+
detach(brNode);
|
|
433
442
|
}
|
|
434
443
|
if (!isNullOrUndefined(this.deleteRangeElement) && (this.deleteOldRangeElement.tagName !== 'OL' && this.deleteOldRangeElement.tagName !== 'UL')
|
|
435
444
|
&& this.deleteOldRangeElement !== this.deleteRangeElement) {
|
|
@@ -590,6 +599,19 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
590
599
|
}, e, value);
|
|
591
600
|
}
|
|
592
601
|
};
|
|
602
|
+
HtmlEditor.prototype.mouseOutHandler = function () {
|
|
603
|
+
if (!isNOU(this.tooltipTargetEle)) {
|
|
604
|
+
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
608
|
+
this.parent.contentModule.getDocument();
|
|
609
|
+
this.tooltipTargetEle = currentDocument.querySelector('[data-title]');
|
|
610
|
+
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
611
|
+
}
|
|
612
|
+
this.tooltipTargetEle.removeAttribute('data-title');
|
|
613
|
+
EventHandler.remove(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler);
|
|
614
|
+
};
|
|
593
615
|
HtmlEditor.prototype.onToolbarClick = function (args) {
|
|
594
616
|
var _this = this;
|
|
595
617
|
var save;
|
|
@@ -597,6 +619,15 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
597
619
|
var selectParentEle;
|
|
598
620
|
var item = args.item;
|
|
599
621
|
var closestElement = closest(args.originalEvent.target, '.e-rte-quick-popup');
|
|
622
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
623
|
+
this.parent.contentModule.getDocument();
|
|
624
|
+
this.tooltipTargetEle = closest(args.originalEvent.target, '[data-tooltip-id]');
|
|
625
|
+
if (!isNOU(this.tooltipTargetEle) && this.parent.showTooltip && !isNOU(currentDocument.querySelector('.e-tooltip-wrap'))) {
|
|
626
|
+
this.parent.notify(events.destroyTooltip, { args: event });
|
|
627
|
+
this.tooltipTargetEle.setAttribute('data-title', this.tooltipTargetEle.getAttribute('title'));
|
|
628
|
+
this.tooltipTargetEle.removeAttribute('title');
|
|
629
|
+
EventHandler.add(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler, this);
|
|
630
|
+
}
|
|
600
631
|
if (item.command !== 'FormatPainter') {
|
|
601
632
|
if (closestElement && !closestElement.classList.contains('e-rte-inline-popup') && !closestElement.classList.contains('e-rte-text-popup')) {
|
|
602
633
|
if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
|