@syncfusion/ej2-richtexteditor 23.2.7-52849 → 24.1.41-569421
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/.eslintrc.json +260 -0
- package/CHANGELOG.md +203 -1
- package/dist/ej2-richtexteditor.umd.min.js +1 -1
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +9873 -7941
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +9967 -8034
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/package.json +13 -13
- package/src/common/config.d.ts +7 -0
- package/src/common/config.js +12 -1
- package/src/common/constant.d.ts +6 -0
- package/src/common/constant.js +6 -0
- package/src/common/interface.d.ts +12 -0
- package/src/common/types.d.ts +6 -0
- package/src/common/util.d.ts +6 -0
- package/src/common/util.js +61 -20
- package/src/editor-manager/base/constant.d.ts +6 -0
- package/src/editor-manager/base/constant.js +6 -0
- package/src/editor-manager/base/editor-manager.d.ts +5 -0
- package/src/editor-manager/base/editor-manager.js +59 -0
- package/src/editor-manager/base/interface.d.ts +8 -0
- package/src/editor-manager/plugin/audio.js +13 -3
- package/src/editor-manager/plugin/dom-node.d.ts +5 -1
- package/src/editor-manager/plugin/dom-node.js +169 -28
- package/src/editor-manager/plugin/format-painter-actions.d.ts +1 -0
- package/src/editor-manager/plugin/format-painter-actions.js +19 -1
- package/src/editor-manager/plugin/formats.d.ts +1 -0
- package/src/editor-manager/plugin/formats.js +38 -3
- package/src/editor-manager/plugin/image.js +38 -15
- package/src/editor-manager/plugin/indents.js +1 -1
- package/src/editor-manager/plugin/inserthtml.d.ts +1 -0
- package/src/editor-manager/plugin/inserthtml.js +83 -20
- package/src/editor-manager/plugin/link.js +8 -3
- package/src/editor-manager/plugin/lists.js +159 -70
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +3 -0
- package/src/editor-manager/plugin/ms-word-clean-up.js +215 -85
- package/src/editor-manager/plugin/nodecutter.js +5 -2
- package/src/editor-manager/plugin/selection-commands.d.ts +2 -0
- package/src/editor-manager/plugin/selection-commands.js +248 -4
- package/src/editor-manager/plugin/table.d.ts +4 -1
- package/src/editor-manager/plugin/table.js +95 -49
- package/src/editor-manager/plugin/toolbar-status.d.ts +2 -2
- package/src/editor-manager/plugin/toolbar-status.js +20 -10
- package/src/editor-manager/plugin/undo.d.ts +1 -0
- package/src/editor-manager/plugin/undo.js +21 -1
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +4 -3
- package/src/rich-text-editor/actions/base-quick-toolbar.js +61 -14
- package/src/rich-text-editor/actions/base-toolbar.js +33 -34
- package/src/rich-text-editor/actions/color-picker.d.ts +1 -0
- package/src/rich-text-editor/actions/color-picker.js +13 -3
- package/src/rich-text-editor/actions/count.js +1 -1
- package/src/rich-text-editor/actions/dropdown-buttons.d.ts +1 -0
- package/src/rich-text-editor/actions/dropdown-buttons.js +11 -5
- package/src/rich-text-editor/actions/emoji-picker.js +16 -7
- package/src/rich-text-editor/actions/enter-key.js +10 -5
- package/src/rich-text-editor/actions/file-manager.js +1 -1
- package/src/rich-text-editor/actions/format-painter.js +5 -2
- package/src/rich-text-editor/actions/full-screen.js +5 -4
- package/src/rich-text-editor/actions/html-editor.d.ts +2 -0
- package/src/rich-text-editor/actions/html-editor.js +124 -17
- package/src/rich-text-editor/actions/keyboard.js +3 -1
- package/src/rich-text-editor/actions/markdown-editor.js +3 -1
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +5 -0
- package/src/rich-text-editor/actions/paste-clean-up.js +156 -28
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +8 -0
- package/src/rich-text-editor/actions/quick-toolbar.js +59 -12
- package/src/rich-text-editor/actions/resize.js +2 -1
- package/src/rich-text-editor/actions/toolbar-action.js +1 -1
- package/src/rich-text-editor/actions/toolbar.d.ts +3 -3
- package/src/rich-text-editor/actions/toolbar.js +35 -96
- package/src/rich-text-editor/base/classes.d.ts +5 -5
- package/src/rich-text-editor/base/classes.js +5 -5
- package/src/rich-text-editor/base/constant.d.ts +46 -1
- package/src/rich-text-editor/base/constant.js +215 -1
- package/src/rich-text-editor/base/interface.d.ts +47 -3
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +3 -3
- package/src/rich-text-editor/base/rich-text-editor.d.ts +16 -4
- package/src/rich-text-editor/base/rich-text-editor.js +184 -97
- package/src/rich-text-editor/base/util.js +22 -4
- package/src/rich-text-editor/formatter/formatter.js +16 -4
- package/src/rich-text-editor/models/default-locale.js +31 -25
- package/src/rich-text-editor/models/items.js +3 -3
- 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/audio-module.d.ts +1 -0
- package/src/rich-text-editor/renderer/audio-module.js +22 -4
- package/src/rich-text-editor/renderer/dialog-renderer.d.ts +2 -0
- package/src/rich-text-editor/renderer/dialog-renderer.js +22 -2
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +2 -1
- package/src/rich-text-editor/renderer/image-module.d.ts +9 -1
- package/src/rich-text-editor/renderer/image-module.js +248 -213
- package/src/rich-text-editor/renderer/link-module.js +53 -24
- package/src/rich-text-editor/renderer/table-module.d.ts +10 -1
- package/src/rich-text-editor/renderer/table-module.js +343 -168
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +3 -6
- package/src/rich-text-editor/renderer/toolbar-renderer.js +106 -101
- package/src/rich-text-editor/renderer/video-module.d.ts +3 -0
- package/src/rich-text-editor/renderer/video-module.js +82 -41
- package/src/rich-text-editor/renderer/view-source.d.ts +1 -0
- package/src/rich-text-editor/renderer/view-source.js +15 -5
- package/src/selection/selection.js +3 -0
- package/styles/bootstrap-dark.css +353 -103
- package/styles/bootstrap.css +357 -112
- package/styles/bootstrap4.css +338 -96
- package/styles/bootstrap5-dark.css +344 -97
- package/styles/bootstrap5.css +344 -97
- package/styles/fabric-dark.css +332 -90
- package/styles/fabric.css +333 -91
- package/styles/fluent-dark.css +360 -98
- package/styles/fluent.css +360 -98
- package/styles/highcontrast-light.css +332 -90
- package/styles/highcontrast.css +336 -91
- package/styles/material-dark.css +339 -92
- package/styles/material.css +339 -92
- package/styles/material3-dark.css +348 -100
- package/styles/material3.css +348 -100
- package/styles/rich-text-editor/_bds-definition.scss +279 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +17 -13
- package/styles/rich-text-editor/_bootstrap-definition.scss +22 -19
- package/styles/rich-text-editor/_bootstrap4-definition.scss +11 -7
- package/styles/rich-text-editor/_bootstrap5-definition.scss +8 -4
- package/styles/rich-text-editor/_fabric-dark-definition.scss +6 -2
- package/styles/rich-text-editor/_fabric-definition.scss +7 -3
- package/styles/rich-text-editor/_fluent-definition.scss +14 -10
- package/styles/rich-text-editor/_fusionnew-definition.scss +7 -3
- package/styles/rich-text-editor/_highcontrast-definition.scss +7 -3
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +6 -2
- package/styles/rich-text-editor/_layout.scss +211 -34
- package/styles/rich-text-editor/_material-dark-definition.scss +6 -2
- package/styles/rich-text-editor/_material-definition.scss +6 -2
- package/styles/rich-text-editor/_material3-definition.scss +16 -12
- package/styles/rich-text-editor/_tailwind-definition.scss +23 -19
- package/styles/rich-text-editor/_theme.scss +113 -24
- package/styles/rich-text-editor/bootstrap-dark.css +353 -103
- package/styles/rich-text-editor/bootstrap.css +357 -112
- package/styles/rich-text-editor/bootstrap4.css +338 -96
- package/styles/rich-text-editor/bootstrap5-dark.css +344 -97
- package/styles/rich-text-editor/bootstrap5.css +344 -97
- package/styles/rich-text-editor/fabric-dark.css +332 -90
- package/styles/rich-text-editor/fabric.css +333 -91
- package/styles/rich-text-editor/fluent-dark.css +360 -98
- package/styles/rich-text-editor/fluent.css +360 -98
- package/styles/rich-text-editor/highcontrast-light.css +332 -90
- package/styles/rich-text-editor/highcontrast.css +336 -91
- package/styles/rich-text-editor/icons/_bds.scss +348 -0
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +4 -4
- package/styles/rich-text-editor/icons/_bootstrap.scss +4 -4
- package/styles/rich-text-editor/icons/_bootstrap4.scss +4 -4
- package/styles/rich-text-editor/icons/_bootstrap5.scss +4 -4
- package/styles/rich-text-editor/icons/_fabric-dark.scss +4 -4
- package/styles/rich-text-editor/icons/_fabric.scss +4 -4
- package/styles/rich-text-editor/icons/_fluent.scss +4 -4
- package/styles/rich-text-editor/icons/_fusionnew.scss +3 -3
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +4 -4
- package/styles/rich-text-editor/icons/_highcontrast.scss +4 -4
- package/styles/rich-text-editor/icons/_material-dark.scss +4 -4
- package/styles/rich-text-editor/icons/_material.scss +4 -4
- package/styles/rich-text-editor/icons/_material3.scss +4 -4
- package/styles/rich-text-editor/icons/_tailwind.scss +4 -4
- package/styles/rich-text-editor/material-dark.css +339 -92
- package/styles/rich-text-editor/material.css +339 -92
- package/styles/rich-text-editor/material3-dark.css +348 -100
- package/styles/rich-text-editor/material3.css +348 -100
- package/styles/rich-text-editor/tailwind-dark.css +383 -113
- package/styles/rich-text-editor/tailwind.css +383 -113
- package/styles/tailwind-dark.css +383 -113
- package/styles/tailwind.css +383 -113
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -41
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -27
|
@@ -2,7 +2,7 @@ import * as events from '../base/constant';
|
|
|
2
2
|
import { Popup } from '@syncfusion/ej2-popups';
|
|
3
3
|
import { RadioButton } from '@syncfusion/ej2-buttons';
|
|
4
4
|
import { isNullOrUndefined as isNOU, isNullOrUndefined, detach, extend, addClass, removeClass } from '@syncfusion/ej2-base';
|
|
5
|
-
import { getUniqueID, Browser } from '@syncfusion/ej2-base';
|
|
5
|
+
import { getUniqueID, Browser, closest } from '@syncfusion/ej2-base';
|
|
6
6
|
import { CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT } from '../base/classes';
|
|
7
7
|
import { CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT } from '../base/classes';
|
|
8
8
|
import { CLS_RTE_IMAGE, CLS_IMGINLINE, CLS_IMGBREAK } from '../base/classes';
|
|
@@ -46,6 +46,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
46
46
|
this.parent.on(events.pasteClean, this.pasteClean, this);
|
|
47
47
|
this.parent.on(events.bindCssClass, this.setCssClass, this);
|
|
48
48
|
this.parent.on(events.destroy, this.destroy, this);
|
|
49
|
+
this.parent.on(events.docClick, this.docClick, this);
|
|
49
50
|
};
|
|
50
51
|
PasteCleanup.prototype.destroy = function () {
|
|
51
52
|
this.removeEventListener();
|
|
@@ -57,6 +58,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
57
58
|
this.parent.off(events.pasteClean, this.pasteClean);
|
|
58
59
|
this.parent.off(events.bindCssClass, this.setCssClass);
|
|
59
60
|
this.parent.off(events.destroy, this.destroy);
|
|
61
|
+
this.parent.off(events.docClick, this.docClick);
|
|
60
62
|
};
|
|
61
63
|
PasteCleanup.prototype.pasteClean = function (e) {
|
|
62
64
|
var _this = this;
|
|
@@ -66,6 +68,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
66
68
|
event: e
|
|
67
69
|
};
|
|
68
70
|
var value = null;
|
|
71
|
+
var isClipboardHTMLDataNull = false;
|
|
69
72
|
var imageproperties;
|
|
70
73
|
if (e.args && !isNOU(e.args.clipboardData)) {
|
|
71
74
|
value = e.args.clipboardData.getData('text/html');
|
|
@@ -104,6 +107,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
104
107
|
var divElement = this.parent.createElement('div');
|
|
105
108
|
divElement.innerHTML = this.splitBreakLine(value);
|
|
106
109
|
value = divElement.innerHTML;
|
|
110
|
+
isClipboardHTMLDataNull = true;
|
|
107
111
|
}
|
|
108
112
|
}
|
|
109
113
|
else if (value.length > 0) {
|
|
@@ -111,7 +115,8 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
111
115
|
args: e.args,
|
|
112
116
|
text: e.text,
|
|
113
117
|
allowedStylePropertiesArray: this.parent.pasteCleanupSettings.allowedStyleProps,
|
|
114
|
-
callBack: function (a, cropImageData) {
|
|
118
|
+
callBack: function (a, cropImageData, pasteTableSource) {
|
|
119
|
+
args.pasteTableSource = pasteTableSource;
|
|
115
120
|
value = a.trim();
|
|
116
121
|
_this.cropImageData = cropImageData;
|
|
117
122
|
}
|
|
@@ -123,12 +128,24 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
123
128
|
this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
|
|
124
129
|
var tempDivElem = this.parent.createElement('div');
|
|
125
130
|
tempDivElem.innerHTML = value;
|
|
131
|
+
var unsupportedImg = tempDivElem.querySelectorAll('.e-rte-image-unsupported');
|
|
132
|
+
for (var index = 0; index < unsupportedImg.length; index++) {
|
|
133
|
+
unsupportedImg[index].setAttribute('alt', this.i10n.getConstant('unsupportedImage'));
|
|
134
|
+
unsupportedImg[index].classList.remove('e-rte-image-unsupported');
|
|
135
|
+
}
|
|
136
|
+
value = tempDivElem.innerHTML;
|
|
126
137
|
var isValueNotEmpty = tempDivElem.textContent !== '' || !isNOU(tempDivElem.querySelector('img')) ||
|
|
127
138
|
!isNOU(tempDivElem.querySelector('table'));
|
|
139
|
+
this.parent.notify(events.cleanupResizeElements, {
|
|
140
|
+
value: value,
|
|
141
|
+
callBack: function (currentValue) {
|
|
142
|
+
value = currentValue;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
128
145
|
if (this.parent.pasteCleanupSettings.prompt) {
|
|
129
146
|
if (isValueNotEmpty) {
|
|
130
147
|
e.args.preventDefault();
|
|
131
|
-
this.pasteDialog(value, args);
|
|
148
|
+
this.pasteDialog(value, args, isClipboardHTMLDataNull);
|
|
132
149
|
}
|
|
133
150
|
else if (Browser.userAgent.indexOf('Firefox') !== -1 && isNOU(file)) {
|
|
134
151
|
this.fireFoxImageUpload();
|
|
@@ -140,7 +157,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
140
157
|
}
|
|
141
158
|
else if (this.parent.pasteCleanupSettings.plainText) {
|
|
142
159
|
e.args.preventDefault();
|
|
143
|
-
this.plainFormatting(value, args);
|
|
160
|
+
this.plainFormatting(value, args, isClipboardHTMLDataNull);
|
|
144
161
|
}
|
|
145
162
|
else if (this.parent.pasteCleanupSettings.keepFormat) {
|
|
146
163
|
e.args.preventDefault();
|
|
@@ -182,13 +199,17 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
182
199
|
PasteCleanup.prototype.splitBreakLine = function (value) {
|
|
183
200
|
var enterSplitText = value.split('\n');
|
|
184
201
|
var contentInnerElem = '';
|
|
202
|
+
var startNode = this.parent.enterKey === 'P' ? '<p>' : (this.parent.enterKey === 'DIV' ? '<div>' : '');
|
|
203
|
+
var endNode = this.parent.enterKey === 'P' ? '</p>' : (this.parent.enterKey === 'DIV' ? '</div>' : '<br>');
|
|
185
204
|
for (var i = 0; i < enterSplitText.length; i++) {
|
|
186
205
|
if (enterSplitText[i].trim() === '') {
|
|
187
206
|
contentInnerElem += getDefaultValue(this.parent);
|
|
188
207
|
}
|
|
189
208
|
else {
|
|
190
209
|
var contentWithSpace = this.makeSpace(enterSplitText[i]);
|
|
191
|
-
contentInnerElem += (i === 0
|
|
210
|
+
contentInnerElem += (i === 0 && this.parent.enterKey !== 'BR' ? '<span>' : startNode) +
|
|
211
|
+
(contentWithSpace.trim() === '' ? '<br>' : contentWithSpace.trim()) +
|
|
212
|
+
(enterSplitText.length - 1 === i && this.parent.enterKey === 'BR' ? '' : (i === 0 && this.parent.enterKey !== 'BR' ? '</span>' : endNode));
|
|
192
213
|
}
|
|
193
214
|
}
|
|
194
215
|
return contentInnerElem;
|
|
@@ -398,7 +419,9 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
398
419
|
});
|
|
399
420
|
popupObj.close();
|
|
400
421
|
imgElem.style.opacity = '1';
|
|
401
|
-
uploadObj.
|
|
422
|
+
if (!uploadObj.isDestroyed) {
|
|
423
|
+
uploadObj.destroy();
|
|
424
|
+
}
|
|
402
425
|
this.toolbarEnableDisable(false);
|
|
403
426
|
};
|
|
404
427
|
PasteCleanup.prototype.refreshPopup = function (imageElement, popupObj) {
|
|
@@ -457,10 +480,10 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
457
480
|
var range = this.nodeSelectionObj.getRange(currentDocument);
|
|
458
481
|
this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
|
|
459
482
|
if (this.parent.pasteCleanupSettings.prompt) {
|
|
460
|
-
this.pasteDialog(imageValue, pasteArgs);
|
|
483
|
+
this.pasteDialog(imageValue, pasteArgs, false);
|
|
461
484
|
}
|
|
462
485
|
else if (this.parent.pasteCleanupSettings.plainText) {
|
|
463
|
-
this.plainFormatting(imageValue, pasteArgs);
|
|
486
|
+
this.plainFormatting(imageValue, pasteArgs, false);
|
|
464
487
|
}
|
|
465
488
|
else if (this.parent.pasteCleanupSettings.keepFormat) {
|
|
466
489
|
this.formatting(imageValue, false, pasteArgs);
|
|
@@ -484,7 +507,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
484
507
|
var plainTextElement = this.parent.element.querySelector('#plainTextFormat');
|
|
485
508
|
this.plainTextRadioButton.appendTo(plainTextElement);
|
|
486
509
|
};
|
|
487
|
-
PasteCleanup.prototype.selectFormatting = function (value, args, keepChecked, cleanChecked) {
|
|
510
|
+
PasteCleanup.prototype.selectFormatting = function (value, args, keepChecked, cleanChecked, isClipboardHTMLDataNull) {
|
|
488
511
|
if (keepChecked) {
|
|
489
512
|
this.formatting(value, false, args);
|
|
490
513
|
}
|
|
@@ -492,10 +515,10 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
492
515
|
this.formatting(value, true, args);
|
|
493
516
|
}
|
|
494
517
|
else {
|
|
495
|
-
this.plainFormatting(value, args);
|
|
518
|
+
this.plainFormatting(value, args, isClipboardHTMLDataNull);
|
|
496
519
|
}
|
|
497
520
|
};
|
|
498
|
-
PasteCleanup.prototype.pasteDialog = function (value, args) {
|
|
521
|
+
PasteCleanup.prototype.pasteDialog = function (value, args, isClipboardHTMLDataNull) {
|
|
499
522
|
var _this = this;
|
|
500
523
|
var isHeight = false;
|
|
501
524
|
var preRTEHeight = this.parent.height;
|
|
@@ -512,7 +535,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
512
535
|
var argument = _this.dialogObj;
|
|
513
536
|
_this.dialogRenderObj.close(argument);
|
|
514
537
|
_this.dialogObj.destroy();
|
|
515
|
-
_this.selectFormatting(value, args, keepChecked, cleanChecked);
|
|
538
|
+
_this.selectFormatting(value, args, keepChecked, cleanChecked, isClipboardHTMLDataNull);
|
|
516
539
|
}
|
|
517
540
|
},
|
|
518
541
|
buttonModel: {
|
|
@@ -549,7 +572,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
549
572
|
width: '300px',
|
|
550
573
|
height: '265px',
|
|
551
574
|
cssClass: CLS_RTE_DIALOG_MIN_HEIGHT,
|
|
552
|
-
isModal:
|
|
575
|
+
isModal: Browser.isDevice,
|
|
553
576
|
visible: false
|
|
554
577
|
};
|
|
555
578
|
this.dialogObj = this.dialogRenderObj.render(dialogModel);
|
|
@@ -573,7 +596,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
573
596
|
isHeight = true;
|
|
574
597
|
}
|
|
575
598
|
this.dialogObj.show();
|
|
576
|
-
this.setCssClass({ cssClass: this.parent.
|
|
599
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
577
600
|
};
|
|
578
601
|
PasteCleanup.prototype.updateCss = function (currentObj, e) {
|
|
579
602
|
if (currentObj && e.cssClass) {
|
|
@@ -603,13 +626,22 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
603
626
|
this.updateCss(this.keepRadioButton, e);
|
|
604
627
|
};
|
|
605
628
|
PasteCleanup.prototype.destroyDialog = function (rteDialogWrapper) {
|
|
606
|
-
var rteDialogContainer = this.parent.element.querySelector('.e-
|
|
629
|
+
var rteDialogContainer = this.parent.element.querySelector('.e-rte-dialog-minheight');
|
|
607
630
|
detach(rteDialogContainer);
|
|
608
631
|
var rteDialogWrapperChildLength = rteDialogWrapper.children.length;
|
|
609
632
|
for (var i = 0; i < rteDialogWrapperChildLength; i++) {
|
|
610
633
|
detach(rteDialogWrapper.children[0]);
|
|
611
634
|
}
|
|
612
635
|
};
|
|
636
|
+
PasteCleanup.prototype.docClick = function (e) {
|
|
637
|
+
var target = e.args.target;
|
|
638
|
+
if (target && target.classList && ((this.dialogObj && !closest(target, '[id=' + "'" + this.dialogObj.element.id + "'" + ']')))
|
|
639
|
+
&& (!target.classList.contains('e-toolbar-item'))) {
|
|
640
|
+
if (this.dialogObj) {
|
|
641
|
+
this.dialogObj.hide();
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
};
|
|
613
645
|
PasteCleanup.prototype.cleanAppleClass = function (elem) {
|
|
614
646
|
var appleClassElem = elem.querySelectorAll('br.Apple-interchange-newline');
|
|
615
647
|
for (var i = 0; i < appleClassElem.length; i++) {
|
|
@@ -647,6 +679,9 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
647
679
|
this.setImageProperties(allImg[i]);
|
|
648
680
|
}
|
|
649
681
|
this.addTempClass(clipBoardElem);
|
|
682
|
+
if (clipBoardElem.querySelectorAll('picture').length > 0) {
|
|
683
|
+
this.processPictureElement(clipBoardElem);
|
|
684
|
+
}
|
|
650
685
|
if (clipBoardElem.textContent !== '' || !isNOU(clipBoardElem.querySelector('img')) ||
|
|
651
686
|
!isNOU(clipBoardElem.querySelector('table'))) {
|
|
652
687
|
var tempWrapperElem = this.parent.createElement('div');
|
|
@@ -678,11 +713,26 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
678
713
|
}
|
|
679
714
|
}
|
|
680
715
|
this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: filesData }, function (updatedArgs) { value = updatedArgs.value; });
|
|
681
|
-
clipBoardElem.innerHTML = value;
|
|
682
|
-
clipBoardElem = this.addTableClass(clipBoardElem);
|
|
716
|
+
clipBoardElem.innerHTML = this.parent.addAnchorAriaLabel(value);
|
|
717
|
+
clipBoardElem = this.addTableClass(clipBoardElem, args.pasteTableSource);
|
|
683
718
|
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
|
|
684
719
|
extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
|
|
685
720
|
_this.parent.formatter.onSuccess(_this.parent, args);
|
|
721
|
+
if (!isNOU(returnArgs.elements) && !isNOU(returnArgs.imgElem) &&
|
|
722
|
+
returnArgs.imgElem.length > 0) {
|
|
723
|
+
var pasteContent = returnArgs.elements;
|
|
724
|
+
var imageContent = returnArgs.imgElem;
|
|
725
|
+
var lastElementChild = _this.findLastElement(pasteContent[pasteContent.length - 1]);
|
|
726
|
+
var isImageAtLast = !isNOU(lastElementChild) ? lastElementChild.nodeName === 'IMG' : false;
|
|
727
|
+
if (isImageAtLast || pasteContent[pasteContent.length - 1] === imageContent[imageContent.length - 1]) {
|
|
728
|
+
_this.parent.notify(events.insertCompleted, {
|
|
729
|
+
args: args.event,
|
|
730
|
+
type: 'Images',
|
|
731
|
+
isNotify: true,
|
|
732
|
+
elements: imageContent[imageContent.length - 1]
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
}
|
|
686
736
|
}, clipBoardElem, null, null, this.parent.enterKey);
|
|
687
737
|
this.removeTempClass();
|
|
688
738
|
this.parent.notify(events.toolbarRefresh, {});
|
|
@@ -737,12 +787,16 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
737
787
|
}
|
|
738
788
|
}
|
|
739
789
|
};
|
|
740
|
-
PasteCleanup.prototype.addTableClass = function (element) {
|
|
790
|
+
PasteCleanup.prototype.addTableClass = function (element, source) {
|
|
791
|
+
source = isNOU(source) ? '' : source;
|
|
741
792
|
var tableElement = element.querySelectorAll('table');
|
|
742
793
|
for (var i = 0; i < tableElement.length; i++) {
|
|
743
|
-
if (!tableElement[i].classList.contains('e-rte-table')) {
|
|
794
|
+
if (!tableElement[i].classList.contains('e-rte-table') && (source === 'html' || source === '')) {
|
|
744
795
|
tableElement[i].classList.add('e-rte-table');
|
|
745
796
|
}
|
|
797
|
+
else if (source && source !== 'html') {
|
|
798
|
+
tableElement[i].classList.add('e-rte-paste-' + source + '-table');
|
|
799
|
+
}
|
|
746
800
|
}
|
|
747
801
|
return element;
|
|
748
802
|
};
|
|
@@ -786,7 +840,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
786
840
|
return value;
|
|
787
841
|
};
|
|
788
842
|
//Plain Formatting
|
|
789
|
-
PasteCleanup.prototype.plainFormatting = function (value, args) {
|
|
843
|
+
PasteCleanup.prototype.plainFormatting = function (value, args, isClipboardHTMLDataNull) {
|
|
790
844
|
var _this = this;
|
|
791
845
|
var clipBoardElem = this.parent.createElement('div', { className: 'pasteContent', styles: 'display:inline;' });
|
|
792
846
|
clipBoardElem.innerHTML = value;
|
|
@@ -824,6 +878,13 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
824
878
|
this.saveSelection.restore();
|
|
825
879
|
clipBoardElem.innerHTML = this.sanitizeHelper(clipBoardElem.innerHTML);
|
|
826
880
|
this.addTempClass(clipBoardElem);
|
|
881
|
+
this.removingComments(clipBoardElem);
|
|
882
|
+
if (this.parent.enterKey === 'BR' && !isClipboardHTMLDataNull) {
|
|
883
|
+
clipBoardElem = this.reframeToBrContent(clipBoardElem);
|
|
884
|
+
}
|
|
885
|
+
else if (this.parent.enterKey === 'DIV') {
|
|
886
|
+
clipBoardElem.innerHTML = clipBoardElem.innerHTML.replace(/<p class="pasteContent_RTE">/g, '<div>').replace(/<\/p>/g, '</div>');
|
|
887
|
+
}
|
|
827
888
|
this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: null }, function (updatedArgs) { value = updatedArgs.value; });
|
|
828
889
|
clipBoardElem.innerHTML = value;
|
|
829
890
|
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
|
|
@@ -838,6 +899,41 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
838
899
|
this.parent.formatter.onSuccess(this.parent, args);
|
|
839
900
|
}
|
|
840
901
|
};
|
|
902
|
+
PasteCleanup.prototype.removingComments = function (elm) {
|
|
903
|
+
var innerElement = elm.innerHTML;
|
|
904
|
+
innerElement = innerElement.replace(/<!--[\s\S]*?-->/g, '');
|
|
905
|
+
elm.innerHTML = innerElement;
|
|
906
|
+
};
|
|
907
|
+
PasteCleanup.prototype.reframeToBrContent = function (clipBoardElem) {
|
|
908
|
+
var newClipBoardElem = this.parent.createElement('div', { className: 'pasteContent', styles: 'display:inline;' });
|
|
909
|
+
while (!isNOU(clipBoardElem.firstChild)) {
|
|
910
|
+
var brElem = this.parent.createElement('br');
|
|
911
|
+
var currentFirstChild = clipBoardElem.firstChild;
|
|
912
|
+
if (currentFirstChild.nodeName === '#text') {
|
|
913
|
+
var isNextSibPresent = !isNOU(currentFirstChild.nextSibling);
|
|
914
|
+
newClipBoardElem.appendChild(currentFirstChild);
|
|
915
|
+
if (isNextSibPresent) {
|
|
916
|
+
newClipBoardElem.appendChild(brElem);
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
else {
|
|
920
|
+
var isCurrentNodeBRElm = currentFirstChild.nodeName === 'BR';
|
|
921
|
+
if (isCurrentNodeBRElm) {
|
|
922
|
+
newClipBoardElem.appendChild(currentFirstChild);
|
|
923
|
+
}
|
|
924
|
+
else {
|
|
925
|
+
newClipBoardElem.appendChild(currentFirstChild.childNodes[0]);
|
|
926
|
+
}
|
|
927
|
+
if (!isNOU(currentFirstChild) && !isNOU(currentFirstChild.nextSibling)) {
|
|
928
|
+
newClipBoardElem.appendChild(brElem);
|
|
929
|
+
}
|
|
930
|
+
if (!isCurrentNodeBRElm && !isNOU(currentFirstChild)) {
|
|
931
|
+
detach(currentFirstChild);
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
return newClipBoardElem;
|
|
936
|
+
};
|
|
841
937
|
PasteCleanup.prototype.getTextContent = function (clipBoardElem) {
|
|
842
938
|
for (var i = 0; i < this.blockNode.length; i++) {
|
|
843
939
|
var inElem = clipBoardElem.querySelectorAll(this.blockNode[i]);
|
|
@@ -885,14 +981,16 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
885
981
|
for (var i = 0; i < this.inlineNode.length; i++) {
|
|
886
982
|
var inElem = clipBoardElem.querySelectorAll(this.inlineNode[i]);
|
|
887
983
|
for (var j = 0; j < inElem.length; j++) {
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
984
|
+
if (!(inElem[j] === clipBoardElem.firstChild && inElem[j].nodeName === 'SPAN')) {
|
|
985
|
+
var parElem = void 0;
|
|
986
|
+
for (var k = 0; k < inElem[j].childNodes.length; k++) {
|
|
987
|
+
parElem = inElem[j].childNodes[k].parentElement;
|
|
988
|
+
inElem[j].childNodes[k].parentElement.parentElement.insertBefore(inElem[j].childNodes[k], inElem[j].childNodes[k].parentElement);
|
|
989
|
+
k--;
|
|
990
|
+
}
|
|
991
|
+
if (!isNOU(parElem)) {
|
|
992
|
+
detach(parElem);
|
|
993
|
+
}
|
|
896
994
|
}
|
|
897
995
|
}
|
|
898
996
|
}
|
|
@@ -1033,6 +1131,36 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
1033
1131
|
}
|
|
1034
1132
|
return clipBoardElem;
|
|
1035
1133
|
};
|
|
1134
|
+
PasteCleanup.prototype.findLastElement = function (element) {
|
|
1135
|
+
if (!isNOU(element) && !isNOU(element.lastElementChild)) {
|
|
1136
|
+
var lastChild = element.lastElementChild;
|
|
1137
|
+
while (lastChild && lastChild.lastElementChild) {
|
|
1138
|
+
lastChild = lastChild.lastElementChild;
|
|
1139
|
+
}
|
|
1140
|
+
return lastChild;
|
|
1141
|
+
}
|
|
1142
|
+
return null;
|
|
1143
|
+
};
|
|
1144
|
+
PasteCleanup.prototype.processPictureElement = function (clipBoardElem) {
|
|
1145
|
+
var pictureElems = clipBoardElem.querySelectorAll('picture');
|
|
1146
|
+
for (var i = 0; i < pictureElems.length; i++) {
|
|
1147
|
+
var imgElem = pictureElems[i].querySelector('img');
|
|
1148
|
+
var sourceElems = pictureElems[i].querySelectorAll('source');
|
|
1149
|
+
if (imgElem && imgElem.getAttribute('src')) {
|
|
1150
|
+
var srcValue = imgElem.getAttribute('src');
|
|
1151
|
+
var url = new URL(srcValue);
|
|
1152
|
+
for (var j = 0; j < sourceElems.length; j++) {
|
|
1153
|
+
var srcset = sourceElems[j].getAttribute('srcset');
|
|
1154
|
+
if (srcset) {
|
|
1155
|
+
if (srcset.indexOf('http') === -1) {
|
|
1156
|
+
var fullPath = url.origin + srcset;
|
|
1157
|
+
sourceElems[j].setAttribute('srcset', fullPath);
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
};
|
|
1036
1164
|
/**
|
|
1037
1165
|
* For internal use only - Get the module name.
|
|
1038
1166
|
*
|
|
@@ -72,6 +72,7 @@ export declare class QuickToolbar {
|
|
|
72
72
|
hideQuickToolbars(): void;
|
|
73
73
|
private deBounce;
|
|
74
74
|
private mouseUpHandler;
|
|
75
|
+
private isEmbedVidElem;
|
|
75
76
|
private keyDownHandler;
|
|
76
77
|
private inlineQTBarMouseDownHandler;
|
|
77
78
|
private keyUpHandler;
|
|
@@ -137,4 +138,11 @@ export declare class QuickToolbar {
|
|
|
137
138
|
* @hidden
|
|
138
139
|
*/
|
|
139
140
|
private getModuleName;
|
|
141
|
+
/**
|
|
142
|
+
*
|
|
143
|
+
* @returns {BaseQuickToolbar[]} - specifies the quick toolbar instance.
|
|
144
|
+
* @hidden
|
|
145
|
+
* @private
|
|
146
|
+
*/
|
|
147
|
+
getQuickToolbarInstance(): BaseQuickToolbar[];
|
|
140
148
|
}
|
|
@@ -4,7 +4,7 @@ import * as events from '../base/constant';
|
|
|
4
4
|
import { pageYOffset, hasClass, isIDevice } from '../base/util';
|
|
5
5
|
import { BaseQuickToolbar } from './base-quick-toolbar';
|
|
6
6
|
import { PopupRenderer } from '../renderer/popup-renderer';
|
|
7
|
-
import { CLS_INLINE_POP, CLS_INLINE } from '../base/classes';
|
|
7
|
+
import { CLS_INLINE_POP, CLS_INLINE, CLS_VID_CLICK_ELEM } from '../base/classes';
|
|
8
8
|
/**
|
|
9
9
|
* `Quick toolbar` module is used to handle Quick toolbar actions.
|
|
10
10
|
*/
|
|
@@ -47,7 +47,7 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
47
47
|
toolbarItems: items,
|
|
48
48
|
mode: mode,
|
|
49
49
|
renderType: type,
|
|
50
|
-
cssClass: this.parent.
|
|
50
|
+
cssClass: this.parent.getCssClass()
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
53
|
/**
|
|
@@ -149,7 +149,7 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
149
149
|
* @deprecated
|
|
150
150
|
*/
|
|
151
151
|
QuickToolbar.prototype.showInlineQTBar = function (x, y, target) {
|
|
152
|
-
if (isNOU(this.parent) || this.parent.readonly || target.tagName.toLowerCase() === 'img') {
|
|
152
|
+
if (isNOU(this.parent) || this.parent.readonly || target.tagName.toLowerCase() === 'img' || this.inlineQTBar.element.querySelector('.e-rte-color-content')) {
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
this.inlineQTBar.showPopup(x, y, target);
|
|
@@ -238,6 +238,9 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
if (!isNOU(this.textQTBar) && !isNOU(this.parent.quickToolbarSettings.text) && !this.parent.inlineMode.enable) {
|
|
241
|
+
if (!isNOU(e) && !isNOU(e.name) && e.name === 'sourceCodeMouseDown') {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
241
244
|
var args = e.args.touches ?
|
|
242
245
|
e.args.changedTouches[0] : e.args;
|
|
243
246
|
var target = e.args.target;
|
|
@@ -248,7 +251,7 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
248
251
|
this.offsetY = pageYOffset(args, this.parent.element, this.parent.iframeSettings.enable);
|
|
249
252
|
var range = this.parent.getRange();
|
|
250
253
|
if ((range.endContainer.parentElement.tagName === range.startContainer.parentElement.tagName && (range.startContainer.parentElement.tagName === 'A' && range.endContainer.parentElement.tagName === 'A')) ||
|
|
251
|
-
(target.tagName === 'IMG') || (target.tagName === 'VIDEO') || (target.tagName === 'AUDIO') || (target.childNodes[0].nodeType === 1 && target.childNodes[0].classList.contains('e-rte-audio')) ||
|
|
254
|
+
(target.tagName === 'IMG') || (target.tagName === 'VIDEO' || this.isEmbedVidElem(target)) || (target.tagName === 'AUDIO') || (target.childNodes[0] && target.childNodes[0].nodeType === 1 && target.childNodes[0].classList.contains('e-rte-audio')) ||
|
|
252
255
|
(this.parent.getRange().startOffset === this.parent.getRange().endOffset)) {
|
|
253
256
|
return;
|
|
254
257
|
}
|
|
@@ -256,10 +259,29 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
256
259
|
this.textQTBar.showPopup(this.offsetX, this.offsetY, target, 'text');
|
|
257
260
|
}
|
|
258
261
|
};
|
|
259
|
-
QuickToolbar.prototype.
|
|
260
|
-
if ((
|
|
261
|
-
&&
|
|
262
|
-
|
|
262
|
+
QuickToolbar.prototype.isEmbedVidElem = function (target) {
|
|
263
|
+
if ((target && target.nodeType !== 3 && target.nodeName !== 'BR' && (target.classList && target.classList.contains(CLS_VID_CLICK_ELEM))) ||
|
|
264
|
+
(target && target.nodeName === 'IFRAME')) {
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
QuickToolbar.prototype.keyDownHandler = function (e) {
|
|
272
|
+
var preventHide = e.args.altKey;
|
|
273
|
+
if (this.parent.inlineMode.enable && e.args.metaKey && e.args.keyCode === 65) {
|
|
274
|
+
this.showInlineQTBar(this.offsetX, this.offsetY, e.args.target);
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
if (!preventHide) {
|
|
278
|
+
if ((this.parent.inlineMode.enable && (!Browser.isDevice || isIDevice()))
|
|
279
|
+
&& !isNullOrUndefined(select('.' + CLS_INLINE_POP, document))) {
|
|
280
|
+
this.hideInlineQTBar();
|
|
281
|
+
}
|
|
282
|
+
if (this.textQTBar && !hasClass(this.textQTBar.element, 'e-popup-close')) {
|
|
283
|
+
this.textQTBar.hidePopup();
|
|
284
|
+
}
|
|
263
285
|
}
|
|
264
286
|
};
|
|
265
287
|
QuickToolbar.prototype.inlineQTBarMouseDownHandler = function () {
|
|
@@ -274,8 +296,8 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
274
296
|
}
|
|
275
297
|
};
|
|
276
298
|
QuickToolbar.prototype.keyUpHandler = function (e) {
|
|
299
|
+
var args = e.args;
|
|
277
300
|
if (this.parent.inlineMode.enable && !Browser.isDevice) {
|
|
278
|
-
var args = e.args;
|
|
279
301
|
if (this.parent.inlineMode.onSelection) {
|
|
280
302
|
if (this.parent.getSelection().length > 0) {
|
|
281
303
|
if ((args.ctrlKey && args.keyCode === 65) || (args.shiftKey && (args.keyCode === 33 || args.keyCode === 34 ||
|
|
@@ -288,6 +310,13 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
288
310
|
}
|
|
289
311
|
this.deBounce(this.offsetX, this.offsetY, args.target);
|
|
290
312
|
}
|
|
313
|
+
if (this.parent.quickToolbarSettings.text && !Browser.isDevice) {
|
|
314
|
+
if ((args.ctrlKey && args.keyCode === 65) || (args.shiftKey && (args.keyCode === 33 || args.keyCode === 34 ||
|
|
315
|
+
args.keyCode === 35 || args.keyCode === 36 || args.keyCode === 37 || args.keyCode === 38 ||
|
|
316
|
+
args.keyCode === 39 || args.keyCode === 40))) {
|
|
317
|
+
this.textQTBar.showPopup(this.offsetX, this.offsetY, args.target, 'text');
|
|
318
|
+
}
|
|
319
|
+
}
|
|
291
320
|
};
|
|
292
321
|
QuickToolbar.prototype.selectionChangeHandler = function (e) {
|
|
293
322
|
var _this = this;
|
|
@@ -447,6 +476,15 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
447
476
|
if (this.videoQTBar && !hasClass(this.videoQTBar.element, 'e-popup-close')) {
|
|
448
477
|
this.videoQTBar.hidePopup();
|
|
449
478
|
}
|
|
479
|
+
if (this.tableQTBar && !hasClass(this.tableQTBar.element, 'e-popup-close')) {
|
|
480
|
+
this.tableQTBar.hidePopup();
|
|
481
|
+
}
|
|
482
|
+
if (this.linkQTBar && !hasClass(this.linkQTBar.element, 'e-popup-close')) {
|
|
483
|
+
this.linkQTBar.hidePopup();
|
|
484
|
+
}
|
|
485
|
+
if (this.textQTBar && !hasClass(this.textQTBar.element, 'e-popup-close')) {
|
|
486
|
+
this.textQTBar.hidePopup();
|
|
487
|
+
}
|
|
450
488
|
}
|
|
451
489
|
};
|
|
452
490
|
QuickToolbar.prototype.onIframeMouseDown = function () {
|
|
@@ -499,6 +537,9 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
499
537
|
* @deprecated
|
|
500
538
|
*/
|
|
501
539
|
QuickToolbar.prototype.removeEventListener = function () {
|
|
540
|
+
if (this.deBouncer) {
|
|
541
|
+
clearTimeout(this.deBouncer);
|
|
542
|
+
}
|
|
502
543
|
if (this.parent.isDestroyed) {
|
|
503
544
|
return;
|
|
504
545
|
}
|
|
@@ -519,9 +560,6 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
519
560
|
this.parent.off(events.rtlMode, this.setRtl);
|
|
520
561
|
this.parent.off(events.bindCssClass, this.setCssClass);
|
|
521
562
|
this.parent.off(events.hidePopup, this.hideQuickToolbars);
|
|
522
|
-
if (this.deBouncer) {
|
|
523
|
-
clearTimeout(this.deBouncer);
|
|
524
|
-
}
|
|
525
563
|
};
|
|
526
564
|
/**
|
|
527
565
|
* Called internally if any of the property value changed.
|
|
@@ -571,6 +609,15 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
571
609
|
QuickToolbar.prototype.getModuleName = function () {
|
|
572
610
|
return 'quickToolbar';
|
|
573
611
|
};
|
|
612
|
+
/**
|
|
613
|
+
*
|
|
614
|
+
* @returns {BaseQuickToolbar[]} - specifies the quick toolbar instance.
|
|
615
|
+
* @hidden
|
|
616
|
+
* @private
|
|
617
|
+
*/
|
|
618
|
+
QuickToolbar.prototype.getQuickToolbarInstance = function () {
|
|
619
|
+
return [this.linkQTBar, this.imageQTBar, this.audioQTBar, this.videoQTBar, this.tableQTBar, this.textQTBar, this.inlineQTBar];
|
|
620
|
+
};
|
|
574
621
|
return QuickToolbar;
|
|
575
622
|
}());
|
|
576
623
|
export { QuickToolbar };
|
|
@@ -71,7 +71,8 @@ var Resize = /** @class */ (function () {
|
|
|
71
71
|
this.parent.element.style.width = (!this.parent.enableRtl) ? eventType.clientX - boundRect.left + 'px' : boundRect.right - eventType.clientX + 'px';
|
|
72
72
|
}
|
|
73
73
|
if (!this.parent.toolbarSettings.enable) {
|
|
74
|
-
this.parent.
|
|
74
|
+
var isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
75
|
+
this.parent.setContentHeight('Resize', isExpand);
|
|
75
76
|
}
|
|
76
77
|
this.parent.refreshUI();
|
|
77
78
|
};
|
|
@@ -39,7 +39,7 @@ var ToolbarAction = /** @class */ (function () {
|
|
|
39
39
|
if (args.item.command === 'Lists') {
|
|
40
40
|
if (args.originalEvent.target.classList.contains('e-caret') &&
|
|
41
41
|
(args.originalEvent.target.parentElement.classList.contains('e-rte-bulletformatlist-dropdown') || args.originalEvent.target.parentElement.classList.contains('e-rte-numberformatlist-dropdown'))) {
|
|
42
|
-
|
|
42
|
+
return;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
this.parent.notify(events.htmlToolbarClick, args);
|
|
@@ -4,6 +4,7 @@ import { IUpdateItemsModel } from '../base/interface';
|
|
|
4
4
|
import { ServiceLocator } from '../services/service-locator';
|
|
5
5
|
import { RendererFactory } from '../services/renderer-factory';
|
|
6
6
|
import { BaseToolbar } from './base-toolbar';
|
|
7
|
+
import { DropDownButtons } from './dropdown-buttons';
|
|
7
8
|
import { RichTextEditorModel } from '../base/rich-text-editor-model';
|
|
8
9
|
/**
|
|
9
10
|
* `Toolbar` module is used to handle Toolbar actions.
|
|
@@ -22,7 +23,7 @@ export declare class Toolbar {
|
|
|
22
23
|
private isTransformChild;
|
|
23
24
|
private contentRenderer;
|
|
24
25
|
protected toolbarRenderer: IRenderer;
|
|
25
|
-
|
|
26
|
+
dropDownModule: DropDownButtons;
|
|
26
27
|
private toolbarActionModule;
|
|
27
28
|
protected renderFactory: RendererFactory;
|
|
28
29
|
private keyBoardModule;
|
|
@@ -150,13 +151,12 @@ export declare class Toolbar {
|
|
|
150
151
|
*/
|
|
151
152
|
destroy(): void;
|
|
152
153
|
private moduleDestroy;
|
|
153
|
-
private scrollHandler;
|
|
154
|
-
private getDOMVisibility;
|
|
155
154
|
private mouseDownHandler;
|
|
156
155
|
private focusChangeHandler;
|
|
157
156
|
private dropDownBeforeOpenHandler;
|
|
158
157
|
private tbFocusHandler;
|
|
159
158
|
private toolbarClickHandler;
|
|
159
|
+
private adjustContentHeight;
|
|
160
160
|
protected wireEvents(): void;
|
|
161
161
|
protected unWireEvents(): void;
|
|
162
162
|
protected addEventListener(): void;
|