@syncfusion/ej2-richtexteditor 22.2.10 → 23.1.36
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 +46 -0
- 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 +381 -262
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +381 -258
- 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/editor-manager/plugin/dom-node.js +6 -5
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +2 -0
- package/src/editor-manager/plugin/ms-word-clean-up.js +68 -11
- package/src/editor-manager/plugin/table.js +1 -1
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +2 -1
- package/src/rich-text-editor/actions/base-quick-toolbar.js +10 -6
- package/src/rich-text-editor/actions/emoji-picker.js +29 -14
- package/src/rich-text-editor/actions/enter-key.js +6 -2
- package/src/rich-text-editor/actions/format-painter.js +12 -6
- package/src/rich-text-editor/actions/html-editor.js +14 -1
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +2 -0
- package/src/rich-text-editor/actions/paste-clean-up.js +63 -32
- package/src/rich-text-editor/actions/quick-toolbar.js +32 -2
- package/src/rich-text-editor/actions/toolbar.js +1 -1
- package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
- 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 +5 -0
- package/src/rich-text-editor/base/constant.js +5 -0
- package/src/rich-text-editor/base/enum.d.ts +4 -0
- package/src/rich-text-editor/base/interface.d.ts +10 -22
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +1 -39
- package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -39
- package/src/rich-text-editor/base/rich-text-editor.js +2 -8
- package/src/rich-text-editor/base/util.js +5 -1
- package/src/rich-text-editor/models/items.js +34 -22
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +4 -5
- package/src/rich-text-editor/models/toolbar-settings.d.ts +4 -5
- package/src/rich-text-editor/models/toolbar-settings.js +1 -1
- package/src/rich-text-editor/renderer/audio-module.js +5 -33
- package/src/rich-text-editor/renderer/dialog-renderer.d.ts +2 -0
- package/src/rich-text-editor/renderer/dialog-renderer.js +16 -1
- package/src/rich-text-editor/renderer/image-module.js +9 -65
- package/src/rich-text-editor/renderer/link-module.js +3 -0
- package/src/rich-text-editor/renderer/table-module.js +18 -7
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +5 -1
- package/src/rich-text-editor/renderer/toolbar-renderer.js +28 -2
- package/src/rich-text-editor/renderer/video-module.js +6 -33
- package/src/rich-text-editor/renderer/view-source.js +1 -0
- package/styles/material-dark.css +0 -1
- package/styles/material.css +0 -1
- package/styles/material3-dark.css +0 -1
- package/styles/material3-dark.scss +1 -1
- package/styles/material3.css +0 -1
- package/styles/material3.scss +1 -1
- package/styles/rich-text-editor/bootstrap-dark.scss +1 -1
- package/styles/rich-text-editor/bootstrap.scss +1 -1
- package/styles/rich-text-editor/bootstrap4.scss +1 -1
- package/styles/rich-text-editor/bootstrap5-dark.scss +1 -1
- package/styles/rich-text-editor/bootstrap5.scss +1 -1
- package/styles/rich-text-editor/fabric-dark.scss +1 -1
- package/styles/rich-text-editor/fabric.scss +1 -1
- package/styles/rich-text-editor/fluent-dark.scss +1 -1
- package/styles/rich-text-editor/fluent.scss +1 -1
- package/styles/rich-text-editor/highcontrast-light.scss +1 -1
- package/styles/rich-text-editor/highcontrast.scss +1 -1
- package/styles/rich-text-editor/material-dark.css +0 -1
- package/styles/rich-text-editor/material-dark.scss +1 -1
- package/styles/rich-text-editor/material.css +0 -1
- package/styles/rich-text-editor/material.scss +1 -1
- package/styles/rich-text-editor/material3-dark.css +0 -1
- package/styles/rich-text-editor/material3-dark.scss +1 -1
- package/styles/rich-text-editor/material3.css +0 -1
- package/styles/rich-text-editor/material3.scss +1 -1
- package/styles/rich-text-editor/tailwind-dark.css +0 -1
- package/styles/rich-text-editor/tailwind-dark.scss +1 -1
- package/styles/rich-text-editor/tailwind.css +0 -1
- package/styles/rich-text-editor/tailwind.scss +1 -1
- package/styles/tailwind-dark.css +0 -1
- package/styles/tailwind.css +0 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 23.1.36
|
|
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@
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@21.8.0",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-BEsWdjIVfT1nygxINHX88ZqEtXGIp/dcT/JC5PX6I9VKT+jWeMMYKneZt2xb/KfyOw/q7yDNNnBIUXEykMtk+w==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-richtexteditor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"/@syncfusion/ej2-react-richtexteditor",
|
|
27
27
|
"/@syncfusion/ej2-vue-richtexteditor"
|
|
28
28
|
],
|
|
29
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-
|
|
30
|
-
"_shasum": "
|
|
29
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-21.8.0.tgz",
|
|
30
|
+
"_shasum": "9e2bc90fda2f3e7c4210a07c7fe34ce7d2e87ff4",
|
|
31
31
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
32
|
-
"_where": "/jenkins/workspace/elease-
|
|
32
|
+
"_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
|
|
33
33
|
"author": {
|
|
34
34
|
"name": "Syncfusion Inc."
|
|
35
35
|
},
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
},
|
|
39
39
|
"bundleDependencies": false,
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@syncfusion/ej2-base": "~
|
|
42
|
-
"@syncfusion/ej2-buttons": "~
|
|
43
|
-
"@syncfusion/ej2-filemanager": "~
|
|
44
|
-
"@syncfusion/ej2-inputs": "~
|
|
45
|
-
"@syncfusion/ej2-navigations": "~
|
|
46
|
-
"@syncfusion/ej2-popups": "~
|
|
47
|
-
"@syncfusion/ej2-splitbuttons": "~
|
|
41
|
+
"@syncfusion/ej2-base": "~23.1.36",
|
|
42
|
+
"@syncfusion/ej2-buttons": "~23.1.36",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~23.1.36",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~23.1.36",
|
|
45
|
+
"@syncfusion/ej2-navigations": "~23.1.36",
|
|
46
|
+
"@syncfusion/ej2-popups": "~23.1.36",
|
|
47
|
+
"@syncfusion/ej2-splitbuttons": "~23.1.36"
|
|
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": "
|
|
73
|
+
"version": "23.1.36",
|
|
74
74
|
"sideEffects": false
|
|
75
75
|
}
|
|
@@ -452,11 +452,12 @@ var DOMNode = /** @class */ (function () {
|
|
|
452
452
|
var startTextNode;
|
|
453
453
|
var endTextNode;
|
|
454
454
|
if (start.textContent === '' && isNOU(end) && action !== 'tab') {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
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') {
|
|
460
461
|
start.innerHTML = '<br>';
|
|
461
462
|
}
|
|
462
463
|
else {
|
|
@@ -19,6 +19,7 @@ export declare class MsWordPaste {
|
|
|
19
19
|
private removableElements;
|
|
20
20
|
private listContents;
|
|
21
21
|
private addEventListener;
|
|
22
|
+
private cropImageDimensions;
|
|
22
23
|
private wordCleanup;
|
|
23
24
|
private cleanList;
|
|
24
25
|
private insertAfter;
|
|
@@ -31,6 +32,7 @@ export declare class MsWordPaste {
|
|
|
31
32
|
private conBytesToBase64;
|
|
32
33
|
private conHexStringToBytes;
|
|
33
34
|
private hexConversion;
|
|
35
|
+
private extractCropValue;
|
|
34
36
|
private removeClassName;
|
|
35
37
|
private breakLineAddition;
|
|
36
38
|
private findDetachElem;
|
|
@@ -45,6 +45,7 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
45
45
|
'μ', 'ν', 'ξ', 'ο', 'π', 'ρ', 'σ', 'τ', 'υ', 'φ', 'χ', 'ψ', 'ω'];
|
|
46
46
|
this.removableElements = ['o:p', 'style'];
|
|
47
47
|
this.listContents = [];
|
|
48
|
+
this.cropImageDimensions = [];
|
|
48
49
|
this.parent = parent;
|
|
49
50
|
this.addEventListener();
|
|
50
51
|
}
|
|
@@ -94,7 +95,7 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
|
-
e.callBack(elm.innerHTML);
|
|
98
|
+
e.callBack(elm.innerHTML, this.cropImageDimensions);
|
|
98
99
|
}
|
|
99
100
|
else {
|
|
100
101
|
e.callBack(elm.innerHTML);
|
|
@@ -162,7 +163,8 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
162
163
|
imgElem[i].getAttribute('v:shapes').indexOf('Grafik') < 0 &&
|
|
163
164
|
imgElem[i].getAttribute('v:shapes').toLowerCase().indexOf('image') < 0 &&
|
|
164
165
|
imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0 &&
|
|
165
|
-
imgElem[i].getAttribute('v:shapes').indexOf('_x0000_s') < 0
|
|
166
|
+
imgElem[i].getAttribute('v:shapes').indexOf('_x0000_s') < 0 &&
|
|
167
|
+
imgElem[i].getAttribute('v:shapes').indexOf('_x0000_i') < 0) {
|
|
166
168
|
detach(imgElem[i]);
|
|
167
169
|
}
|
|
168
170
|
}
|
|
@@ -179,14 +181,36 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
179
181
|
}
|
|
180
182
|
var hexValue = this.hexConversion(rtfData);
|
|
181
183
|
for (var i = 0; i < hexValue.length; i++) {
|
|
182
|
-
base64Src.push(
|
|
184
|
+
base64Src.push({
|
|
185
|
+
base64Data: !isNOU(hexValue[i].hex) ? this.convertToBase64(hexValue[i]) : null,
|
|
186
|
+
isCroppedImage: hexValue[i].isCroppedImage
|
|
187
|
+
});
|
|
188
|
+
if (hexValue[i].isCroppedImage) {
|
|
189
|
+
this.cropImageDimensions.push({
|
|
190
|
+
goalWidth: hexValue[i].goalWidth,
|
|
191
|
+
goalHeight: hexValue[i].goalHeight,
|
|
192
|
+
cropLength: hexValue[i].cropLength,
|
|
193
|
+
cropTop: hexValue[i].cropTop,
|
|
194
|
+
cropR: hexValue[i].cropR,
|
|
195
|
+
cropB: hexValue[i].cropB
|
|
196
|
+
});
|
|
197
|
+
}
|
|
183
198
|
}
|
|
184
199
|
for (var i = 0; i < imgElem.length; i++) {
|
|
185
200
|
if (imgSrc[i].match(linkRegex)) {
|
|
186
201
|
imgElem[i].setAttribute('src', imgSrc[i]);
|
|
187
202
|
}
|
|
188
203
|
else {
|
|
189
|
-
|
|
204
|
+
if (!isNOU(base64Src[i]) && !isNOU(base64Src[i].base64Data)) {
|
|
205
|
+
imgElem[i].setAttribute('src', base64Src[i].base64Data);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
imgElem[i].removeAttribute('src');
|
|
209
|
+
imgElem[i].setAttribute('alt', 'Unsupported file format');
|
|
210
|
+
}
|
|
211
|
+
if (!isNOU(base64Src[i]) && base64Src[i].isCroppedImage) {
|
|
212
|
+
imgElem[i].classList.add('e-img-cropped');
|
|
213
|
+
}
|
|
190
214
|
}
|
|
191
215
|
imgElem[i].setAttribute('id', 'msWordImg-' + imgName[i]);
|
|
192
216
|
}
|
|
@@ -263,6 +287,13 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
263
287
|
var result = [];
|
|
264
288
|
if (!isNOU(fullImg)) {
|
|
265
289
|
for (var i = 0; i < fullImg.length; i++) {
|
|
290
|
+
var isCroppedImage = false;
|
|
291
|
+
var goalWidth = 0;
|
|
292
|
+
var goalHeight = 0;
|
|
293
|
+
var cropLength = 0;
|
|
294
|
+
var cropTop = 0;
|
|
295
|
+
var cropR = 0;
|
|
296
|
+
var cropB = 0;
|
|
266
297
|
if (picHead.test(fullImg[i])) {
|
|
267
298
|
if (fullImg[i].indexOf('\\pngblip') !== -1) {
|
|
268
299
|
imgType = 'image/png';
|
|
@@ -270,20 +301,45 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
270
301
|
else if (fullImg[i].indexOf('\\jpegblip') !== -1) {
|
|
271
302
|
imgType = 'image/jpeg';
|
|
272
303
|
}
|
|
304
|
+
else if (fullImg[i].indexOf('\\picprop') !== -1) {
|
|
305
|
+
imgType = null;
|
|
306
|
+
}
|
|
273
307
|
else {
|
|
274
308
|
continue;
|
|
275
309
|
}
|
|
310
|
+
isCroppedImage = this.extractCropValue('cropl', fullImg[i]) > 0 &&
|
|
311
|
+
this.extractCropValue('cropt', fullImg[i]) > 0 ? true : false;
|
|
312
|
+
if (isCroppedImage) {
|
|
313
|
+
goalWidth = this.extractCropValue('wgoal', fullImg[i]);
|
|
314
|
+
goalHeight = this.extractCropValue('hgoal', fullImg[i]);
|
|
315
|
+
cropLength = this.extractCropValue('cropl', fullImg[i]);
|
|
316
|
+
cropTop = this.extractCropValue('cropt', fullImg[i]);
|
|
317
|
+
cropR = this.extractCropValue('cropr', fullImg[i]);
|
|
318
|
+
cropB = this.extractCropValue('cropb', fullImg[i]);
|
|
319
|
+
}
|
|
276
320
|
result.push({
|
|
277
321
|
hex: imgType ? fullImg[i].replace(picHead, '').replace(/[^\da-fA-F]/g, '') : null,
|
|
278
|
-
type: imgType
|
|
322
|
+
type: imgType,
|
|
323
|
+
isCroppedImage: isCroppedImage,
|
|
324
|
+
goalWidth: goalWidth,
|
|
325
|
+
goalHeight: goalHeight,
|
|
326
|
+
cropLength: cropLength,
|
|
327
|
+
cropTop: cropTop,
|
|
328
|
+
cropR: cropR,
|
|
329
|
+
cropB: cropB
|
|
279
330
|
});
|
|
280
331
|
}
|
|
281
332
|
}
|
|
282
333
|
}
|
|
283
334
|
return result;
|
|
284
335
|
};
|
|
336
|
+
MsWordPaste.prototype.extractCropValue = function (crop, rtfData) {
|
|
337
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
338
|
+
var result = new RegExp('\\\\pic' + crop + '(\\-?\\d+)\\\\').exec(rtfData.replace('\r\n\\', '\\'))[1];
|
|
339
|
+
return parseInt(result, 10);
|
|
340
|
+
};
|
|
285
341
|
MsWordPaste.prototype.removeClassName = function (elm) {
|
|
286
|
-
var elmWithClass = elm.querySelectorAll('*[class]');
|
|
342
|
+
var elmWithClass = elm.querySelectorAll('*[class]:not(.e-img-cropped)');
|
|
287
343
|
for (var i = 0; i < elmWithClass.length; i++) {
|
|
288
344
|
elmWithClass[i].removeAttribute('class');
|
|
289
345
|
}
|
|
@@ -620,8 +676,10 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
620
676
|
currentListStyle = listNodes[i].getAttribute('style');
|
|
621
677
|
}
|
|
622
678
|
}
|
|
623
|
-
collection.push({
|
|
624
|
-
|
|
679
|
+
collection.push({
|
|
680
|
+
listType: type, content: tempNode, nestedLevel: level, class: currentClassName,
|
|
681
|
+
listStyle: currentListStyle, listStyleTypeName: listStyleType, start: startAttr, styleMarginLeft: styleMarginLeft
|
|
682
|
+
});
|
|
625
683
|
}
|
|
626
684
|
}
|
|
627
685
|
stNode = listNodes.shift();
|
|
@@ -749,8 +807,7 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
749
807
|
}
|
|
750
808
|
else {
|
|
751
809
|
if (collection[index].nestedLevel > pLevel && isNormalList) {
|
|
752
|
-
var initialNode =
|
|
753
|
-
initialNode = createElement(collection[index].listType);
|
|
810
|
+
var initialNode = createElement(collection[index].listType);
|
|
754
811
|
prevList = createElement('li');
|
|
755
812
|
initialNode.appendChild(prevList);
|
|
756
813
|
initialNode.style.listStyleType = 'none';
|
|
@@ -839,7 +896,7 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
839
896
|
if (firstChild.childNodes.length > 0) {
|
|
840
897
|
var listIgnoreTag = firstChild.querySelectorAll('[style*="mso-list"]');
|
|
841
898
|
for (var i = 0; i < listIgnoreTag.length; i++) {
|
|
842
|
-
listIgnoreTag[i].setAttribute('style', listIgnoreTag[i].getAttribute('style').replace(/\n/g,
|
|
899
|
+
listIgnoreTag[i].setAttribute('style', listIgnoreTag[i].getAttribute('style').replace(/\n/g, ''));
|
|
843
900
|
}
|
|
844
901
|
var listOrder = firstChild.querySelector('span[style="mso-list:Ignore"]');
|
|
845
902
|
if (!isNOU(listOrder)) {
|
|
@@ -92,7 +92,7 @@ var TableCommand = /** @class */ (function () {
|
|
|
92
92
|
TableCommand.prototype.calculateStyleValue = function (value) {
|
|
93
93
|
var styleValue;
|
|
94
94
|
if (typeof (value) === 'string') {
|
|
95
|
-
if (value.indexOf('px') || value.indexOf('%') || value.indexOf('auto')) {
|
|
95
|
+
if (value.indexOf('px') >= 0 || value.indexOf('%') >= 0 || value.indexOf('auto') >= 0) {
|
|
96
96
|
styleValue = value;
|
|
97
97
|
}
|
|
98
98
|
else {
|
|
@@ -42,11 +42,12 @@ export declare class BaseQuickToolbar {
|
|
|
42
42
|
* @param {number} x - specifies the x value
|
|
43
43
|
* @param {number} y - specifies the y value
|
|
44
44
|
* @param {Element} target - specifies the element
|
|
45
|
+
* @param {string} type - specifies the type
|
|
45
46
|
* @returns {void}
|
|
46
47
|
* @hidden
|
|
47
48
|
|
|
48
49
|
*/
|
|
49
|
-
showPopup(x: number, y: number, target: Element): void;
|
|
50
|
+
showPopup(x: number, y: number, target: Element, type?: string): void;
|
|
50
51
|
/**
|
|
51
52
|
* hidePopup method
|
|
52
53
|
*
|
|
@@ -42,6 +42,9 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
42
42
|
else if (args.popupType === 'Inline') {
|
|
43
43
|
className = classes.CLS_INLINE_POP;
|
|
44
44
|
}
|
|
45
|
+
else if (args.popupType === 'Text') {
|
|
46
|
+
className = classes.CLS_TEXT_POP;
|
|
47
|
+
}
|
|
45
48
|
else {
|
|
46
49
|
className = '';
|
|
47
50
|
}
|
|
@@ -121,7 +124,7 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
121
124
|
case 'bottom': {
|
|
122
125
|
var posY = void 0;
|
|
123
126
|
if (viewPort === 'document') {
|
|
124
|
-
if (type === 'inline') {
|
|
127
|
+
if (type === 'inline' || type === 'text') {
|
|
125
128
|
posY = (e.y - e.popHeight - 10);
|
|
126
129
|
}
|
|
127
130
|
else {
|
|
@@ -150,7 +153,7 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
150
153
|
break;
|
|
151
154
|
}
|
|
152
155
|
case 'right':
|
|
153
|
-
if (type === 'inline') {
|
|
156
|
+
if (type === 'inline' || type === 'text') {
|
|
154
157
|
x = window.pageXOffset + (e.windowWidth - (e.popWidth + e.bodyRightSpace + 10));
|
|
155
158
|
}
|
|
156
159
|
else {
|
|
@@ -158,7 +161,7 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
158
161
|
}
|
|
159
162
|
break;
|
|
160
163
|
case 'left':
|
|
161
|
-
if (type === 'inline') {
|
|
164
|
+
if (type === 'inline' || type === 'text') {
|
|
162
165
|
x = 0;
|
|
163
166
|
}
|
|
164
167
|
else {
|
|
@@ -177,11 +180,12 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
177
180
|
* @param {number} x - specifies the x value
|
|
178
181
|
* @param {number} y - specifies the y value
|
|
179
182
|
* @param {Element} target - specifies the element
|
|
183
|
+
* @param {string} type - specifies the type
|
|
180
184
|
* @returns {void}
|
|
181
185
|
* @hidden
|
|
182
186
|
|
|
183
187
|
*/
|
|
184
|
-
BaseQuickToolbar.prototype.showPopup = function (x, y, target) {
|
|
188
|
+
BaseQuickToolbar.prototype.showPopup = function (x, y, target, type) {
|
|
185
189
|
var _this = this;
|
|
186
190
|
var eventArgs = { popup: this.popupObj, cancel: false, targetElement: target,
|
|
187
191
|
positionX: x, positionY: y };
|
|
@@ -212,7 +216,7 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
212
216
|
editPanelTop = (cntEle) ? cntEle.scrollTop : 0;
|
|
213
217
|
editPanelHeight = (cntEle) ? cntEle.offsetHeight : 0;
|
|
214
218
|
}
|
|
215
|
-
if (!_this.parent.inlineMode.enable && !closest(target, 'table')) {
|
|
219
|
+
if (!_this.parent.inlineMode.enable && !closest(target, 'table') && type !== 'text') {
|
|
216
220
|
_this.parent.disableToolbarItem(_this.parent.toolbarSettings.items);
|
|
217
221
|
_this.parent.enableToolbarItem(['Undo', 'Redo']);
|
|
218
222
|
}
|
|
@@ -265,7 +269,7 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
265
269
|
if (!_this.parent.inlineMode.enable) {
|
|
266
270
|
_this.checkCollision(showPopupData, 'parent', '');
|
|
267
271
|
}
|
|
268
|
-
_this.checkCollision(showPopupData, 'document', ((_this.parent.inlineMode.enable) ? 'inline' : ''));
|
|
272
|
+
_this.checkCollision(showPopupData, 'document', ((_this.parent.inlineMode.enable) ? 'inline' : (type === 'text') ? 'text' : ''));
|
|
269
273
|
_this.popupObj.element.classList.remove('e-popup-open');
|
|
270
274
|
removeClass([_this.element], [classes.CLS_HIDE]);
|
|
271
275
|
_this.popupObj.show({ name: 'ZoomIn', duration: (Browser.isIE ? 250 : 400) });
|
|
@@ -36,7 +36,13 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
36
36
|
EmojiPicker.prototype.toolbarClick = function (args) {
|
|
37
37
|
var _this = this;
|
|
38
38
|
var _a, _b;
|
|
39
|
-
var spanElement
|
|
39
|
+
var spanElement;
|
|
40
|
+
if (!isNOU(this.parent.element.querySelector('.e-emoji'))) {
|
|
41
|
+
spanElement = this.parent.element.querySelector('.e-emoji');
|
|
42
|
+
}
|
|
43
|
+
else if (this.parent.inlineMode.enable) {
|
|
44
|
+
spanElement = this.parent.element.ownerDocument.querySelector('.e-emoji');
|
|
45
|
+
}
|
|
40
46
|
this.divElement = spanElement.closest('div');
|
|
41
47
|
var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
42
48
|
this.save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
@@ -51,7 +57,12 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
51
57
|
this.popupObj.hide();
|
|
52
58
|
}
|
|
53
59
|
this.popDiv = this.parent.createElement('div', { className: 'e-rte-emojipicker-popup', id: this.parent.getID() + '_emojiPicker' });
|
|
54
|
-
this.parent.getToolbar()
|
|
60
|
+
if (!isNOU(this.parent.getToolbar()) && !this.parent.inlineMode.enable) {
|
|
61
|
+
this.parent.getToolbar().appendChild(this.popDiv);
|
|
62
|
+
}
|
|
63
|
+
else if (this.parent.inlineMode.enable) {
|
|
64
|
+
this.parent.inputElement.appendChild(this.popDiv);
|
|
65
|
+
}
|
|
55
66
|
EventHandler.add(this.popDiv, 'keydown', this.onKeyDown, this);
|
|
56
67
|
EventHandler.add(this.popDiv, 'keyup', this.searchFilter, this);
|
|
57
68
|
var extendEle = this.parent.element.querySelector('.e-toolbar-extended');
|
|
@@ -66,13 +77,14 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
66
77
|
var target;
|
|
67
78
|
var xValue;
|
|
68
79
|
var yValue;
|
|
69
|
-
if (!isNOU(args.args)
|
|
80
|
+
if (!isNOU(args.args) && !this.parent.inlineMode.enable &&
|
|
81
|
+
isNOU(this.parent.quickToolbarSettings.text)) {
|
|
70
82
|
target = args.args.originalEvent.target;
|
|
71
83
|
target = target.classList.contains('e-toolbar-item') ? target.firstChild : target.parentElement;
|
|
72
84
|
xValue = 'left';
|
|
73
85
|
yValue = 'bottom';
|
|
74
86
|
}
|
|
75
|
-
else if (isNOU(args.x) && isNOU(args.y)) {
|
|
87
|
+
else if (isNOU(args.x) && isNOU(args.y) && !this.parent.inlineMode.enable && isNOU(this.parent.quickToolbarSettings.text)) {
|
|
76
88
|
target = this.parent.inputElement;
|
|
77
89
|
if (window.getSelection().rangeCount > 0) {
|
|
78
90
|
var coordinates = this.getCoordinates();
|
|
@@ -80,6 +92,14 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
80
92
|
yValue = coordinates.top;
|
|
81
93
|
}
|
|
82
94
|
}
|
|
95
|
+
else if (isNOU(args.x) && isNOU(args.y) && (this.parent.inlineMode.enable || !isNOU(this.parent.quickToolbarSettings.text))) {
|
|
96
|
+
this.parent.notify(events.hidePopup, {});
|
|
97
|
+
if (window.getSelection().rangeCount > 0) {
|
|
98
|
+
var coordinates = this.getCoordinates();
|
|
99
|
+
xValue = coordinates.left;
|
|
100
|
+
yValue = coordinates.top;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
83
103
|
else {
|
|
84
104
|
target = this.parent.inputElement;
|
|
85
105
|
xValue = args.x;
|
|
@@ -106,7 +126,8 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
106
126
|
addClass([this.popupObj.element], 'e-popup-open');
|
|
107
127
|
this.popupObj.refreshPosition(target);
|
|
108
128
|
// header search element
|
|
109
|
-
if ((!isNOU(args.args) || (isNOU(args.x) && isNOU(args.y))) &&
|
|
129
|
+
if ((!isNOU(args.args) || (isNOU(args.x) && isNOU(args.y))) &&
|
|
130
|
+
this.parent.emojiPickerSettings.showSearchBox) {
|
|
110
131
|
var inputEle = createElement('input', { id: 'e-rte-emoji-search', className: 'e-rte-emoji-search' });
|
|
111
132
|
this.popDiv.append(inputEle);
|
|
112
133
|
var inputobj = new TextBox({
|
|
@@ -142,7 +163,8 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
142
163
|
this.popDiv.appendChild(emojiBtnDiv);
|
|
143
164
|
var height;
|
|
144
165
|
var popupBorder = window.getComputedStyle(this.popDiv);
|
|
145
|
-
if ((isNOU(args.args) && !(isNOU(args.x) && isNOU(args.y))) ||
|
|
166
|
+
if ((isNOU(args.args) && !(isNOU(args.x) && isNOU(args.y))) ||
|
|
167
|
+
!this.parent.emojiPickerSettings.showSearchBox) {
|
|
146
168
|
height = (this.popDiv.getBoundingClientRect().height - emojiToolBar.getBoundingClientRect().height - (2 * parseFloat(popupBorder.borderWidth))) + 'px';
|
|
147
169
|
emojiBtnDiv.style.setProperty('height', height, 'important');
|
|
148
170
|
}
|
|
@@ -188,13 +210,6 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
188
210
|
if (!isNOU(popup)) {
|
|
189
211
|
scrollTop = Math.round(popup.scrollTop);
|
|
190
212
|
}
|
|
191
|
-
for (var i = 0; i < toolbarName.length; i++) {
|
|
192
|
-
/* eslint-disable */
|
|
193
|
-
if (toolbarName[i].classList.contains('e-selected')) {
|
|
194
|
-
removeClass([toolbarName[i]], 'e-selected');
|
|
195
|
-
}
|
|
196
|
-
/* eslint-enable */
|
|
197
|
-
}
|
|
198
213
|
if (scrollTop < toolbarName[0].offsetHeight) {
|
|
199
214
|
addClass([toolbarName[0]], 'e-selected');
|
|
200
215
|
}
|
|
@@ -649,7 +664,7 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
649
664
|
var startOffset = this.save.startOffset;
|
|
650
665
|
var textContent = this.save.range.startContainer.textContent;
|
|
651
666
|
var previousText = textContent.substring(startOffset, startOffset + 1);
|
|
652
|
-
// When toolbar action is clicked then only restore the range.
|
|
667
|
+
// When toolbar action is clicked then only restore the range.
|
|
653
668
|
if (!isNOU(this.clickEvent) || previousText !== ':') {
|
|
654
669
|
this.save.restore();
|
|
655
670
|
}
|
|
@@ -173,8 +173,12 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
173
173
|
(_this.range.startContainer.previousSibling.nodeName === 'IMG' || _this.range.startContainer.previousSibling.nodeName === 'BR'))) {
|
|
174
174
|
var isNearBlockLengthZero = void 0;
|
|
175
175
|
var newElem = void 0;
|
|
176
|
-
if (!isNOU(_this.range.startContainer.childNodes) &&
|
|
177
|
-
|
|
176
|
+
if (!isNOU(_this.range.startContainer.childNodes) &&
|
|
177
|
+
(_this.range.startContainer.textContent.length === 0 ||
|
|
178
|
+
(_this.range.startContainer.nodeName !== '#text' && !isNOU(_this.range.startContainer.querySelector('.e-video-clickelem')) &&
|
|
179
|
+
_this.range.startContainer.querySelector('.e-video-clickelem').textContent.length === 0)) &&
|
|
180
|
+
(_this.range.startContainer.querySelectorAll('img, audio, video').length > 0 ||
|
|
181
|
+
!isNOU(_this.range.startContainer.querySelector('.e-video-clickelem')) ||
|
|
178
182
|
_this.range.startContainer.nodeName === 'IMG' || _this.range.startContainer.nodeName === 'TABLE')) {
|
|
179
183
|
newElem = _this.createInsertElement(shiftKey_1);
|
|
180
184
|
isMediaNode = true;
|
|
@@ -25,6 +25,10 @@ var FormatPainter = /** @class */ (function () {
|
|
|
25
25
|
clickargs.args.action = 'escape';
|
|
26
26
|
this.actionHandler(clickargs, 'keyBoard');
|
|
27
27
|
}
|
|
28
|
+
if (this.parent.quickToolbarModule && !isNOU(this.parent.quickToolbarSettings.text) &&
|
|
29
|
+
this.parent.element.ownerDocument.contains(this.parent.quickToolbarModule.textQTBar.element)) {
|
|
30
|
+
this.parent.quickToolbarModule.textQTBar.hidePopup();
|
|
31
|
+
}
|
|
28
32
|
};
|
|
29
33
|
FormatPainter.prototype.toolbarDoubleClick = function (args) {
|
|
30
34
|
this.isActive = true;
|
|
@@ -103,12 +107,14 @@ var FormatPainter = /** @class */ (function () {
|
|
|
103
107
|
}
|
|
104
108
|
};
|
|
105
109
|
FormatPainter.prototype.updateToolbarBtn = function (enable) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
if (!isNOU(this.parent.element.querySelector('.e-rte-format-painter'))) {
|
|
111
|
+
var toolbarBtn = this.parent.element.querySelector('.e-rte-format-painter').parentElement.parentElement;
|
|
112
|
+
if (enable) {
|
|
113
|
+
addClass([toolbarBtn], 'e-active');
|
|
114
|
+
}
|
|
115
|
+
else if (!this.isSticky) {
|
|
116
|
+
removeClass([toolbarBtn], 'e-active');
|
|
117
|
+
}
|
|
112
118
|
}
|
|
113
119
|
};
|
|
114
120
|
FormatPainter.prototype.editAreaClick = function (args) {
|
|
@@ -126,11 +126,24 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
126
126
|
var currentLength = this.parent.inputElement.innerHTML.replace(regEx, '').length;
|
|
127
127
|
var focusNode = range.startContainer;
|
|
128
128
|
if (previousLength > currentLength && !isRootParent) {
|
|
129
|
+
if (focusNode.textContent.trim().length !== 0 && focusNode.previousSibling) {
|
|
130
|
+
var tempSpan = document.createElement('span');
|
|
131
|
+
tempSpan.className = 'tempSpan';
|
|
132
|
+
range.insertNode(tempSpan);
|
|
133
|
+
}
|
|
129
134
|
var currentChild = this.parent.inputElement.firstChild;
|
|
130
135
|
while (!isNOU(currentChild) && currentChild.textContent.replace(regEx, '').trim().length > 0) {
|
|
131
136
|
currentChild.innerHTML = currentChild.innerHTML.replace(regEx, '');
|
|
132
137
|
currentChild = currentChild.nextElementSibling;
|
|
133
138
|
}
|
|
139
|
+
var tempSpanToRemove = this.parent.inputElement.querySelector('.tempSpan');
|
|
140
|
+
if (tempSpanToRemove && tempSpanToRemove.previousSibling && focusNode.textContent.trim().length !== 0) {
|
|
141
|
+
focusNode = tempSpanToRemove.previousSibling;
|
|
142
|
+
pointer = tempSpanToRemove.previousSibling.textContent.length;
|
|
143
|
+
var parentElement = tempSpanToRemove.parentNode;
|
|
144
|
+
parentElement.removeChild(tempSpanToRemove);
|
|
145
|
+
tempSpanToRemove = null;
|
|
146
|
+
}
|
|
134
147
|
var currentChildNode = this.parent.inputElement.querySelector('.currentStartMark').childNodes;
|
|
135
148
|
if (currentChildNode.length > 1) {
|
|
136
149
|
for (var i = 0; i < currentChildNode.length; i++) {
|
|
@@ -585,7 +598,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
585
598
|
var item = args.item;
|
|
586
599
|
var closestElement = closest(args.originalEvent.target, '.e-rte-quick-popup');
|
|
587
600
|
if (item.command !== 'FormatPainter') {
|
|
588
|
-
if (closestElement && !closestElement.classList.contains('e-rte-inline-popup')) {
|
|
601
|
+
if (closestElement && !closestElement.classList.contains('e-rte-inline-popup') && !closestElement.classList.contains('e-rte-text-popup')) {
|
|
589
602
|
if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
|
|
590
603
|
item.subCommand === 'FontColor' || item.subCommand === 'BackgroundColor')) {
|
|
591
604
|
if (isIDevice() && item.command === 'Images') {
|
|
@@ -22,6 +22,7 @@ export declare class PasteCleanup {
|
|
|
22
22
|
private blockNode;
|
|
23
23
|
private isNotFromHtml;
|
|
24
24
|
private containsHtml;
|
|
25
|
+
private cropImageData;
|
|
25
26
|
constructor(parent?: IRichTextEditor, serviceLocator?: ServiceLocator);
|
|
26
27
|
private addEventListener;
|
|
27
28
|
private destroy;
|
|
@@ -56,6 +57,7 @@ export declare class PasteCleanup {
|
|
|
56
57
|
private destroyDialog;
|
|
57
58
|
private cleanAppleClass;
|
|
58
59
|
private formatting;
|
|
60
|
+
private cropImageHandler;
|
|
59
61
|
private addTableClass;
|
|
60
62
|
private setImageProperties;
|
|
61
63
|
private addTempClass;
|