@syncfusion/ej2-richtexteditor 25.1.38 → 25.1.40
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 +34 -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 +1996 -1801
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +2058 -1863
- 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 +10 -10
- package/src/editor-manager/plugin/audio.js +1 -1
- package/src/editor-manager/plugin/formats.js +6 -0
- package/src/editor-manager/plugin/indents.js +1 -1
- package/src/editor-manager/plugin/inserthtml.js +9 -3
- package/src/editor-manager/plugin/link.js +4 -2
- package/src/editor-manager/plugin/lists.js +38 -14
- package/src/editor-manager/plugin/nodecutter.js +3 -0
- package/src/editor-manager/plugin/selection-commands.d.ts +1 -0
- package/src/editor-manager/plugin/selection-commands.js +84 -2
- package/src/editor-manager/plugin/table.d.ts +4 -0
- package/src/editor-manager/plugin/table.js +62 -19
- package/src/editor-manager/plugin/video.js +1 -1
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +1 -0
- package/src/rich-text-editor/actions/base-quick-toolbar.js +9 -13
- package/src/rich-text-editor/actions/base-toolbar.js +3 -2
- package/src/rich-text-editor/actions/dropdown-buttons.d.ts +1 -0
- package/src/rich-text-editor/actions/dropdown-buttons.js +8 -23
- package/src/rich-text-editor/actions/emoji-picker.js +1 -1
- package/src/rich-text-editor/actions/enter-key.d.ts +1 -0
- package/src/rich-text-editor/actions/enter-key.js +50 -1
- package/src/rich-text-editor/actions/format-painter.js +4 -1
- package/src/rich-text-editor/actions/html-editor.js +9 -4
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +0 -1
- package/src/rich-text-editor/actions/paste-clean-up.js +2 -26
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +2 -0
- package/src/rich-text-editor/actions/quick-toolbar.js +14 -4
- package/src/rich-text-editor/base/enum.d.ts +11 -0
- package/src/rich-text-editor/base/enum.js +12 -0
- package/src/rich-text-editor/base/interface.d.ts +9 -1
- package/src/rich-text-editor/base/rich-text-editor.d.ts +2 -2
- package/src/rich-text-editor/base/rich-text-editor.js +4 -18
- package/src/rich-text-editor/base/util.d.ts +0 -4
- package/src/rich-text-editor/base/util.js +1 -35
- package/src/rich-text-editor/formatter/formatter.js +4 -2
- package/src/rich-text-editor/renderer/audio-module.js +9 -4
- package/src/rich-text-editor/renderer/image-module.js +7 -2
- package/src/rich-text-editor/renderer/table-module.js +15 -5
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +0 -1
- package/src/rich-text-editor/renderer/toolbar-renderer.js +27 -23
- package/src/rich-text-editor/renderer/video-module.js +29 -15
- package/styles/bootstrap-dark.css +11 -0
- package/styles/bootstrap.css +11 -0
- package/styles/bootstrap4.css +11 -0
- package/styles/bootstrap5-dark.css +11 -0
- package/styles/bootstrap5.css +11 -0
- package/styles/fabric-dark.css +11 -0
- package/styles/fabric.css +11 -0
- package/styles/fluent-dark.css +11 -0
- package/styles/fluent.css +11 -0
- package/styles/highcontrast-light.css +11 -0
- package/styles/highcontrast.css +11 -0
- package/styles/material-dark.css +11 -0
- package/styles/material.css +11 -0
- package/styles/material3-dark.css +11 -0
- package/styles/material3.css +11 -0
- package/styles/rich-text-editor/_bds-definition.scss +6 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +6 -0
- package/styles/rich-text-editor/_bootstrap-definition.scss +6 -0
- package/styles/rich-text-editor/_bootstrap4-definition.scss +6 -0
- package/styles/rich-text-editor/_bootstrap5-definition.scss +6 -0
- package/styles/rich-text-editor/_fabric-dark-definition.scss +6 -0
- package/styles/rich-text-editor/_fabric-definition.scss +6 -0
- package/styles/rich-text-editor/_fluent-definition.scss +6 -0
- package/styles/rich-text-editor/_fusionnew-definition.scss +6 -0
- package/styles/rich-text-editor/_highcontrast-definition.scss +6 -0
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +6 -0
- package/styles/rich-text-editor/_layout.scss +10 -0
- package/styles/rich-text-editor/_material-dark-definition.scss +6 -0
- package/styles/rich-text-editor/_material-definition.scss +6 -0
- package/styles/rich-text-editor/_material3-definition.scss +6 -0
- package/styles/rich-text-editor/_tailwind-definition.scss +6 -0
- package/styles/rich-text-editor/bootstrap-dark.css +11 -0
- package/styles/rich-text-editor/bootstrap.css +11 -0
- package/styles/rich-text-editor/bootstrap4.css +11 -0
- package/styles/rich-text-editor/bootstrap5-dark.css +11 -0
- package/styles/rich-text-editor/bootstrap5.css +11 -0
- package/styles/rich-text-editor/fabric-dark.css +11 -0
- package/styles/rich-text-editor/fabric.css +11 -0
- package/styles/rich-text-editor/fluent-dark.css +11 -0
- package/styles/rich-text-editor/fluent.css +11 -0
- package/styles/rich-text-editor/highcontrast-light.css +11 -0
- package/styles/rich-text-editor/highcontrast.css +11 -0
- package/styles/rich-text-editor/material-dark.css +11 -0
- package/styles/rich-text-editor/material.css +11 -0
- package/styles/rich-text-editor/material3-dark.css +11 -0
- package/styles/rich-text-editor/material3.css +11 -0
- package/styles/rich-text-editor/tailwind-dark.css +11 -0
- package/styles/rich-text-editor/tailwind.css +11 -0
- package/styles/tailwind-dark.css +11 -0
- package/styles/tailwind.css +11 -0
|
@@ -170,15 +170,16 @@ var BaseToolbar = /** @class */ (function () {
|
|
|
170
170
|
for (var num = 0; num < items.length; num++) {
|
|
171
171
|
var tooltipText = items[num].tooltipText;
|
|
172
172
|
var shortCutKey = void 0;
|
|
173
|
+
var isMacDev = window.navigator.platform.toLocaleLowerCase().includes('mac');
|
|
173
174
|
if (windowKeys["" + tooltipText]) {
|
|
174
|
-
shortCutKey =
|
|
175
|
+
shortCutKey = isMacDev ? windowKeys["" + tooltipText].replace('Ctrl+', '⌘').replace('Shift+', '⇧').replace('Alt+', '⌥') : windowKeys["" + tooltipText];
|
|
175
176
|
}
|
|
176
177
|
else {
|
|
177
178
|
shortCutKey = tooltipText;
|
|
178
179
|
}
|
|
179
180
|
if (shortCutKey) {
|
|
180
181
|
if (!(items[num].command === "Images" && items[num].subCommand === "InsertLink")) {
|
|
181
|
-
items[num].tooltipText = (tooltipText !== shortCutKey) ? tooltipText + ' (' + shortCutKey + ')' : tooltipText;
|
|
182
|
+
items[num].tooltipText = (tooltipText !== shortCutKey) ? (isMacDev) ? shortCutKey : tooltipText + ' (' + shortCutKey + ')' : tooltipText;
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
185
|
}
|
|
@@ -3,8 +3,7 @@ import { RenderType } from '../base/enum';
|
|
|
3
3
|
import { getIndex } from '../base/util';
|
|
4
4
|
import * as events from '../base/constant';
|
|
5
5
|
import * as classes from '../base/classes';
|
|
6
|
-
import { getDropDownValue, getFormattedFontSize, getTooltipText
|
|
7
|
-
import { fontNameLocale, formatsLocale, numberFormatListLocale, bulletFormatListLocale } from '../models/default-locale';
|
|
6
|
+
import { getDropDownValue, getFormattedFontSize, getTooltipText } from '../base/util';
|
|
8
7
|
import * as model from '../models/items';
|
|
9
8
|
import { dispatchEvent } from '../base/util';
|
|
10
9
|
/**
|
|
@@ -25,28 +24,10 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
25
24
|
if (item.cssClass) {
|
|
26
25
|
addClass([args.element], item.cssClass);
|
|
27
26
|
}
|
|
28
|
-
if (item.command === 'Images' || item.command === 'Videos' || item.command === 'Audios' || item.command === 'Table') {
|
|
29
|
-
args.element.setAttribute('title', getQuickToolbarTooltipText(item.text) !== '' ? getQuickToolbarTooltipText(item.text) : item.text);
|
|
30
|
-
}
|
|
31
27
|
if (item.command === 'Alignments' || item.subCommand === 'JustifyLeft'
|
|
32
28
|
|| item.subCommand === 'JustifyRight' || item.subCommand === 'JustifyCenter') {
|
|
33
29
|
args.element.setAttribute('title', getTooltipText(item.subCommand.toLocaleLowerCase(), this.locator));
|
|
34
30
|
}
|
|
35
|
-
if (item.command === 'Formats') {
|
|
36
|
-
args.element.setAttribute('title', getTooltipTextDropdownItems(item.subCommand.toLocaleLowerCase(), this.locator, formatsLocale));
|
|
37
|
-
}
|
|
38
|
-
if (item.command === 'Font') {
|
|
39
|
-
args.element.setAttribute('title', getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, fontNameLocale) !== '' ? getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, fontNameLocale) : item.text);
|
|
40
|
-
}
|
|
41
|
-
if (item.subCommand === 'BulletFormatList') {
|
|
42
|
-
args.element.setAttribute('title', getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, bulletFormatListLocale) !== '' ? getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, bulletFormatListLocale) : item.text);
|
|
43
|
-
}
|
|
44
|
-
if (item.subCommand === 'NumberFormatList') {
|
|
45
|
-
args.element.setAttribute('title', (getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, numberFormatListLocale)) !== '' ? getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, numberFormatListLocale) : item.text);
|
|
46
|
-
}
|
|
47
|
-
if (item.subCommand === 'FontSize') {
|
|
48
|
-
args.element.setAttribute('title', getTooltipTextDropdownItems(item.value.toLocaleLowerCase(), null, null, this.parent));
|
|
49
|
-
}
|
|
50
31
|
};
|
|
51
32
|
DropDownButtons.prototype.dropdownContent = function (width, type, content) {
|
|
52
33
|
return ('<span style="display: inline-flex;' + 'width:' + ((type === 'quick') ? 'auto' : width) + '" >' +
|
|
@@ -352,7 +333,7 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
352
333
|
if (targetElement.classList.contains(classes.CLS_DROPDOWN_BTN)) {
|
|
353
334
|
return;
|
|
354
335
|
}
|
|
355
|
-
this.
|
|
336
|
+
this.tableCellDropDown = this.toolbarRenderer.renderDropDownButton({
|
|
356
337
|
iconCss: 'e-table-cell e-icons',
|
|
357
338
|
cssClass: classes.CLS_DROPDOWN_POPUP + ' ' + classes.CLS_DROPDOWN_ITEMS + ' ' + classes.CLS_QUICK_DROPDOWN,
|
|
358
339
|
itemName: 'TableCell',
|
|
@@ -460,6 +441,10 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
460
441
|
this.removeDropDownClasses(this.tableColumnsDropDown.element);
|
|
461
442
|
this.tableColumnsDropDown.destroy();
|
|
462
443
|
}
|
|
444
|
+
if (this.tableCellDropDown) {
|
|
445
|
+
this.removeDropDownClasses(this.tableCellDropDown.element);
|
|
446
|
+
this.tableCellDropDown.destroy();
|
|
447
|
+
}
|
|
463
448
|
if (this.tableCellVerticalAlignDropDown) {
|
|
464
449
|
this.removeDropDownClasses(this.tableCellVerticalAlignDropDown.element);
|
|
465
450
|
this.tableCellVerticalAlignDropDown.destroy();
|
|
@@ -513,7 +498,7 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
513
498
|
var dropDownObj = [
|
|
514
499
|
this.formatDropDown, this.fontNameDropDown, this.fontSizeDropDown, this.alignDropDown, this.imageAlignDropDown,
|
|
515
500
|
this.displayDropDown, this.numberFormatListDropDown, this.bulletFormatListDropDown, this.tableRowsDropDown,
|
|
516
|
-
this.tableColumnsDropDown, this.tableCellVerticalAlignDropDown
|
|
501
|
+
this.tableColumnsDropDown, this.tableCellDropDown, this.tableCellVerticalAlignDropDown
|
|
517
502
|
];
|
|
518
503
|
for (var i = 0; i < dropDownObj.length; i++) {
|
|
519
504
|
this.updateCss(dropDownObj[i], e);
|
|
@@ -531,7 +516,7 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
531
516
|
this.parent.on(events.bindCssClass, this.setCssClass, this);
|
|
532
517
|
};
|
|
533
518
|
DropDownButtons.prototype.onIframeMouseDown = function () {
|
|
534
|
-
if (this.parent.getToolbarElement().querySelectorAll('.e-rte-dropdown-btn[aria-expanded="true"]').length > 0) {
|
|
519
|
+
if (!isNullOrUndefined(this.parent.getToolbarElement()) && (this.parent.getToolbarElement().querySelectorAll('.e-rte-dropdown-btn[aria-expanded="true"]').length > 0 || this.parent.getToolbarElement().querySelectorAll('.e-dropdown-btn.e-rte-inline-dropdown[aria-expanded="true"]').length > 0)) {
|
|
535
520
|
dispatchEvent(document, 'mousedown');
|
|
536
521
|
}
|
|
537
522
|
};
|
|
@@ -638,7 +638,7 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
|
-
if (noEMoji && !this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji') && (inputValue !== '' && value !== ':')) {
|
|
641
|
+
if (noEMoji && !this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji') && (inputValue !== '' && value !== ':' && value !== ': :')) {
|
|
642
642
|
noEmojiObj.innerHTML = '<span style="color: rgba(0, 0, 0, 0.75); font-weight: 500; font-size: 16px;">' + this.i10n.getConstant('emojiPickerNoResultFound') + ' 😥 </span>' + '<br>' + '<span style="color: rgba(0, 0, 0, 0.75);"> ' + this.i10n.getConstant('emojiPickerTrySomethingElse') + ' ? </span>';
|
|
643
643
|
noEmojiObj.style.margin = '55px';
|
|
644
644
|
emojipickerAll.appendChild(noEmojiObj);
|
|
@@ -39,6 +39,17 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
39
39
|
this.getRangeNode();
|
|
40
40
|
var isTableEnter = true;
|
|
41
41
|
this.formatTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote'];
|
|
42
|
+
var isCursorAtTableEnd = this.range.collapsed && (this.range.startContainer.nodeType === 1) &&
|
|
43
|
+
this.range.startContainer.isContentEditable &&
|
|
44
|
+
this.range.startContainer.childNodes[this.range.startOffset - 1] &&
|
|
45
|
+
this.range.startContainer.childNodes[this.range.startOffset - 1].nodeName === 'TABLE';
|
|
46
|
+
var isCursorAtTableStart = this.range.collapsed && (this.range.startContainer.nodeType === 1) &&
|
|
47
|
+
this.range.startContainer.isContentEditable && this.range.startContainer.childNodes[this.range.startOffset] &&
|
|
48
|
+
this.range.startContainer.childNodes[this.range.startOffset].nodeName === 'TABLE';
|
|
49
|
+
if (isCursorAtTableEnd || isCursorAtTableStart) {
|
|
50
|
+
this.handleCursorAtTableSide(e, isCursorAtTableStart, isCursorAtTableEnd);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
42
53
|
if (!isNOU(this.startNode.closest('TABLE')) && !isNOU(this.endNode.closest('TABLE'))) {
|
|
43
54
|
isTableEnter = false;
|
|
44
55
|
var curElement = this.startNode;
|
|
@@ -47,7 +58,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
47
58
|
curElement = curElement.parentElement;
|
|
48
59
|
blockElement = curElement;
|
|
49
60
|
}
|
|
50
|
-
isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
|
|
61
|
+
isTableEnter = blockElement.tagName === 'TH' || blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
|
|
51
62
|
}
|
|
52
63
|
if (e.args.which === 13 && !e.args.ctrlKey && (!Browser.isDevice ? e.args.code === 'Enter' : e.args.key === 'Enter')) {
|
|
53
64
|
if (isNOU(this.startNode.closest('LI, UL, OL')) && isNOU(this.endNode.closest('LI, UL, OL')) &&
|
|
@@ -62,6 +73,9 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
62
73
|
};
|
|
63
74
|
this.parent.trigger(events.actionBegin, actionBeginArgs, function (actionBeginArgs) {
|
|
64
75
|
if (!actionBeginArgs.cancel) {
|
|
76
|
+
if (_this.parent.formatter.getUndoRedoStack().length === 0) {
|
|
77
|
+
_this.parent.formatter.saveData();
|
|
78
|
+
}
|
|
65
79
|
if (!(_this.range.startOffset === _this.range.endOffset && _this.range.startContainer === _this.range.endContainer)) {
|
|
66
80
|
if (!(_this.range.startContainer.nodeName === 'SPAN' && (_this.range.startContainer.classList.contains('e-video-wrap') ||
|
|
67
81
|
_this.range.startContainer.classList.contains('e-audio-wrap')))) {
|
|
@@ -494,6 +508,41 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
494
508
|
}
|
|
495
509
|
return insertElem;
|
|
496
510
|
};
|
|
511
|
+
EnterKeyAction.prototype.handleCursorAtTableSide = function (e, isStart, isEnd) {
|
|
512
|
+
var _this = this;
|
|
513
|
+
if (this.parent.enterKey !== 'BR') {
|
|
514
|
+
var shiftKey_2 = e.args.shiftKey;
|
|
515
|
+
var actionBeginArgs = {
|
|
516
|
+
cancel: false,
|
|
517
|
+
name: events.actionBegin,
|
|
518
|
+
requestType: shiftKey_2 ? 'ShiftEnterAction' : 'EnterAction',
|
|
519
|
+
originalEvent: e.args
|
|
520
|
+
};
|
|
521
|
+
this.parent.trigger(events.actionBegin, actionBeginArgs, function (actionBeginArgs) {
|
|
522
|
+
if (!actionBeginArgs.cancel) {
|
|
523
|
+
var newElement = _this.parent.createElement(_this.parent.enterKey);
|
|
524
|
+
newElement.innerHTML = '<br>';
|
|
525
|
+
var tableElement = void 0;
|
|
526
|
+
if (isStart) {
|
|
527
|
+
tableElement = _this.range.startContainer.childNodes[_this.range.startOffset];
|
|
528
|
+
tableElement.parentElement.insertBefore(newElement, tableElement);
|
|
529
|
+
}
|
|
530
|
+
if (isEnd) {
|
|
531
|
+
tableElement = _this.range.startContainer.childNodes[_this.range.startOffset - 1];
|
|
532
|
+
if (!isNOU(tableElement.nextSibling)) {
|
|
533
|
+
tableElement.parentElement.insertBefore(newElement, tableElement.nextSibling);
|
|
534
|
+
}
|
|
535
|
+
else if (isNOU(tableElement.nextSibling)) {
|
|
536
|
+
tableElement.parentElement.appendChild(newElement);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), newElement, 0);
|
|
540
|
+
e.args.preventDefault();
|
|
541
|
+
_this.parent.trigger(events.actionComplete, { requestType: shiftKey_2 ? 'ShiftEnterAction' : 'EnterAction', args: e.args });
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
};
|
|
497
546
|
return EnterKeyAction;
|
|
498
547
|
}());
|
|
499
548
|
export { EnterKeyAction };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addClass, isNullOrUndefined as isNOU, removeClass } from '@syncfusion/ej2-base';
|
|
1
|
+
import { addClass, Browser, isNullOrUndefined as isNOU, removeClass } from '@syncfusion/ej2-base';
|
|
2
2
|
import * as events from '../base/constant';
|
|
3
3
|
var FormatPainter = /** @class */ (function () {
|
|
4
4
|
function FormatPainter(parent) {
|
|
@@ -43,6 +43,9 @@ var FormatPainter = /** @class */ (function () {
|
|
|
43
43
|
if ((originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste')) {
|
|
44
44
|
originalEvent.stopPropagation();
|
|
45
45
|
}
|
|
46
|
+
if (Browser.userAgent.indexOf('Firefox') !== -1) {
|
|
47
|
+
originalEvent.preventDefault();
|
|
48
|
+
}
|
|
46
49
|
this.actionHandler(event, 'keyBoard');
|
|
47
50
|
}
|
|
48
51
|
};
|
|
@@ -451,12 +451,17 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
451
451
|
}
|
|
452
452
|
var lastNode = this.oldRangeElement.lastChild ? this.oldRangeElement.lastChild : this.oldRangeElement;
|
|
453
453
|
while (lastNode.nodeType !== 3 && lastNode.nodeName !== '#text' &&
|
|
454
|
-
lastNode.nodeName !== 'BR') {
|
|
454
|
+
lastNode.nodeName !== 'BR' && !isNOU(lastNode.lastChild)) {
|
|
455
455
|
lastNode = lastNode.lastChild;
|
|
456
456
|
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
457
|
+
if (lastNode.nodeName === 'IMG') {
|
|
458
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), lastNode.parentElement, lastNode.parentElement.childNodes.length);
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),
|
|
462
|
+
// eslint-disable-next-line
|
|
463
|
+
lastNode, lastNode.textContent.length);
|
|
464
|
+
}
|
|
460
465
|
if (this.oldRangeElement.nodeName !== '#text' && this.oldRangeElement.querySelectorAll('BR').length === 1) {
|
|
461
466
|
detach(this.oldRangeElement.querySelector('BR'));
|
|
462
467
|
}
|
|
@@ -9,7 +9,7 @@ import { CLS_RTE_IMAGE, CLS_IMGINLINE, CLS_IMGBREAK } from '../base/classes';
|
|
|
9
9
|
import { pasteCleanupGroupingTags } from '../../common/config';
|
|
10
10
|
import { NodeSelection } from '../../selection/selection';
|
|
11
11
|
import * as EVENTS from './../../common/constant';
|
|
12
|
-
import { RenderType } from '../base/enum';
|
|
12
|
+
import { RenderType, UploadRequest } from '../base/enum';
|
|
13
13
|
import { Uploader } from '@syncfusion/ej2-inputs';
|
|
14
14
|
import * as classes from '../base/classes';
|
|
15
15
|
import { sanitizeHelper, convertToBlob, getDefaultValue } from '../base/util';
|
|
@@ -410,6 +410,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
410
410
|
var _this = this;
|
|
411
411
|
this.parent.inputElement.contentEditable = 'true';
|
|
412
412
|
e.element = imgElem;
|
|
413
|
+
e.requestType = UploadRequest.Pasted;
|
|
413
414
|
this.parent.trigger(events.imageUploadSuccess, e, function (e) {
|
|
414
415
|
if (!isNullOrUndefined(_this.parent.insertImageSettings.path)) {
|
|
415
416
|
var url = _this.parent.insertImageSettings.path + e.file.name;
|
|
@@ -718,21 +719,6 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
718
719
|
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
|
|
719
720
|
extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
|
|
720
721
|
_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
|
-
}
|
|
736
722
|
}, clipBoardElem, null, null, this.parent.enterKey);
|
|
737
723
|
this.removeTempClass();
|
|
738
724
|
this.parent.notify(events.toolbarRefresh, {});
|
|
@@ -1131,16 +1117,6 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
1131
1117
|
}
|
|
1132
1118
|
return clipBoardElem;
|
|
1133
1119
|
};
|
|
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
1120
|
PasteCleanup.prototype.processPictureElement = function (clipBoardElem) {
|
|
1145
1121
|
var pictureElems = clipBoardElem.querySelectorAll('picture');
|
|
1146
1122
|
for (var i = 0; i < pictureElems.length; i++) {
|
|
@@ -22,6 +22,7 @@ export declare class QuickToolbar {
|
|
|
22
22
|
videoQTBar: BaseQuickToolbar;
|
|
23
23
|
tableQTBar: BaseQuickToolbar;
|
|
24
24
|
inlineQTBar: BaseQuickToolbar;
|
|
25
|
+
debounceTimeout: number;
|
|
25
26
|
private renderFactory;
|
|
26
27
|
constructor(parent?: IRichTextEditor, locator?: ServiceLocator);
|
|
27
28
|
private formatItems;
|
|
@@ -72,6 +73,7 @@ export declare class QuickToolbar {
|
|
|
72
73
|
hideQuickToolbars(): void;
|
|
73
74
|
private deBounce;
|
|
74
75
|
private mouseUpHandler;
|
|
76
|
+
private isEmbedVidElem;
|
|
75
77
|
private keyDownHandler;
|
|
76
78
|
private inlineQTBarMouseDownHandler;
|
|
77
79
|
private keyUpHandler;
|
|
@@ -4,12 +4,13 @@ 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
|
*/
|
|
11
11
|
var QuickToolbar = /** @class */ (function () {
|
|
12
12
|
function QuickToolbar(parent, locator) {
|
|
13
|
+
this.debounceTimeout = 1000;
|
|
13
14
|
this.parent = parent;
|
|
14
15
|
this.locator = locator;
|
|
15
16
|
this.renderFactory = this.locator.getService('rendererFactory');
|
|
@@ -201,7 +202,7 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
201
202
|
clearTimeout(this.deBouncer);
|
|
202
203
|
this.deBouncer = window.setTimeout(function () {
|
|
203
204
|
_this.showInlineQTBar(x, y, target);
|
|
204
|
-
},
|
|
205
|
+
}, this.debounceTimeout);
|
|
205
206
|
};
|
|
206
207
|
QuickToolbar.prototype.mouseUpHandler = function (e) {
|
|
207
208
|
if (this.parent.inlineMode.enable && (!Browser.isDevice || isIDevice())) {
|
|
@@ -251,7 +252,7 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
251
252
|
this.offsetY = pageYOffset(args, this.parent.element, this.parent.iframeSettings.enable);
|
|
252
253
|
var range = this.parent.getRange();
|
|
253
254
|
if ((range.endContainer.parentElement.tagName === range.startContainer.parentElement.tagName && (range.startContainer.parentElement.tagName === 'A' && range.endContainer.parentElement.tagName === 'A')) ||
|
|
254
|
-
(target.tagName === 'IMG') || (target.tagName === 'VIDEO') || (target.tagName === 'AUDIO') || (target.childNodes[0] && target.childNodes[0].nodeType === 1 && target.childNodes[0].classList.contains('e-rte-audio')) ||
|
|
255
|
+
(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')) ||
|
|
255
256
|
(this.parent.getRange().startOffset === this.parent.getRange().endOffset)) {
|
|
256
257
|
return;
|
|
257
258
|
}
|
|
@@ -259,6 +260,15 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
259
260
|
this.textQTBar.showPopup(this.offsetX, this.offsetY, target, 'text');
|
|
260
261
|
}
|
|
261
262
|
};
|
|
263
|
+
QuickToolbar.prototype.isEmbedVidElem = function (target) {
|
|
264
|
+
if ((target && target.nodeType !== 3 && target.nodeName !== 'BR' && (target.classList && target.classList.contains(CLS_VID_CLICK_ELEM))) ||
|
|
265
|
+
(target && target.nodeName === 'IFRAME')) {
|
|
266
|
+
return true;
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
271
|
+
};
|
|
262
272
|
QuickToolbar.prototype.keyDownHandler = function (e) {
|
|
263
273
|
var preventHide = e.args.altKey;
|
|
264
274
|
if (this.parent.inlineMode.enable && e.args.metaKey && e.args.keyCode === 65) {
|
|
@@ -314,7 +324,7 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
314
324
|
clearTimeout(this.deBouncer);
|
|
315
325
|
this.deBouncer = window.setTimeout(function () {
|
|
316
326
|
_this.onSelectionChange(e);
|
|
317
|
-
},
|
|
327
|
+
}, this.debounceTimeout);
|
|
318
328
|
};
|
|
319
329
|
QuickToolbar.prototype.onSelectionChange = function (e) {
|
|
320
330
|
if (!isNullOrUndefined(select('.' + CLS_INLINE_POP, document.body))) {
|
|
@@ -64,3 +64,14 @@ export declare type ToolbarItems = 'alignments' | 'justifyLeft' | 'justifyCenter
|
|
|
64
64
|
* Defines types to be used to configure the toolbarSettings items.
|
|
65
65
|
*/
|
|
66
66
|
export declare type ToolbarConfigItems = 'Alignments' | 'JustifyLeft' | 'JustifyCenter' | 'JustifyRight' | 'JustifyFull' | 'FontName' | 'FontSize' | 'FontColor' | 'BackgroundColor' | 'Bold' | 'Italic' | 'Underline' | 'StrikeThrough' | 'ClearFormat' | 'ClearAll' | 'Cut' | 'Copy' | 'Paste' | 'UnorderedList' | 'OrderedList' | 'Indent' | 'Outdent' | 'Undo' | 'Redo' | 'SuperScript' | 'SubScript' | 'CreateLink' | 'Image' | 'CreateTable' | 'InsertLink' | 'FullScreen' | 'LowerCase' | 'UpperCase' | 'Print' | 'Formats' | 'FormatPainter' | 'EmojiPicker' | 'UnderLine' | 'ZoomOut' | 'ZoomIn' | 'SourceCode' | 'Preview' | 'ViewSide' | 'InsertCode' | 'Audio' | 'Video' | 'NumberFormatList' | 'BulletFormatList' | 'FileManager' | '|' | '-';
|
|
67
|
+
/**
|
|
68
|
+
* Defines types to be used as inserted image.
|
|
69
|
+
*/
|
|
70
|
+
export declare enum UploadRequest {
|
|
71
|
+
/** Defines UploadRequest as Uploaded */
|
|
72
|
+
Uploaded = "Uploaded",
|
|
73
|
+
/** Defines UploadRequest as Dropped */
|
|
74
|
+
Dropped = "Dropped",
|
|
75
|
+
/** Defines UploadRequest as Pasted */
|
|
76
|
+
Pasted = "Pasted"
|
|
77
|
+
}
|
|
@@ -61,3 +61,15 @@ export var DialogType;
|
|
|
61
61
|
DialogType["InsertTable"] = "InsertTable";
|
|
62
62
|
/* eslint-enable */
|
|
63
63
|
})(DialogType || (DialogType = {}));
|
|
64
|
+
/**
|
|
65
|
+
* Defines types to be used as inserted image.
|
|
66
|
+
*/
|
|
67
|
+
export var UploadRequest;
|
|
68
|
+
(function (UploadRequest) {
|
|
69
|
+
/** Defines UploadRequest as Uploaded */
|
|
70
|
+
UploadRequest["Uploaded"] = "Uploaded";
|
|
71
|
+
/** Defines UploadRequest as Dropped */
|
|
72
|
+
UploadRequest["Dropped"] = "Dropped";
|
|
73
|
+
/** Defines UploadRequest as Pasted */
|
|
74
|
+
UploadRequest["Pasted"] = "Pasted";
|
|
75
|
+
})(UploadRequest || (UploadRequest = {}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component, Observer, L10n, KeyboardEventArgs, EmitType } from '@syncfusion/ej2-base';
|
|
2
2
|
import { ItemModel, OverflowMode } from '@syncfusion/ej2-navigations';
|
|
3
3
|
import { ItemModel as DropDownItemModel, DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
|
4
|
-
import { ToolbarType, RenderType } from './enum';
|
|
4
|
+
import { ToolbarType, RenderType, UploadRequest } from './enum';
|
|
5
5
|
import { Toolbar } from '../actions/toolbar';
|
|
6
6
|
import { UndoRedoManager } from '../../editor-manager/plugin/undo';
|
|
7
7
|
import { ClickEventArgs } from '@syncfusion/ej2-navigations';
|
|
@@ -428,6 +428,8 @@ export interface IAudioCommandsArgs {
|
|
|
428
428
|
cssClass?: string;
|
|
429
429
|
/** Defines the audio element to be edited */
|
|
430
430
|
selectParent?: Node[];
|
|
431
|
+
/** Defines the title of the audio */
|
|
432
|
+
title?: string;
|
|
431
433
|
}
|
|
432
434
|
/**
|
|
433
435
|
* Provides information about a Video added in the Rich Text Editor.
|
|
@@ -457,6 +459,8 @@ export interface IVideoCommandsArgs {
|
|
|
457
459
|
cssClass?: string;
|
|
458
460
|
/** Defines the video element to be edited */
|
|
459
461
|
selectParent?: Node[];
|
|
462
|
+
/** Defines the title of the video */
|
|
463
|
+
title?: string;
|
|
460
464
|
}
|
|
461
465
|
/**
|
|
462
466
|
|
|
@@ -1154,6 +1158,10 @@ export interface ImageSuccessEventArgs {
|
|
|
1154
1158
|
* Specify the name of the event.
|
|
1155
1159
|
*/
|
|
1156
1160
|
element?: HTMLElement;
|
|
1161
|
+
/**
|
|
1162
|
+
* Specify the request type of the event.
|
|
1163
|
+
*/
|
|
1164
|
+
requestType?: UploadRequest;
|
|
1157
1165
|
}
|
|
1158
1166
|
/**
|
|
1159
1167
|
* Provides information about a ImageFailed event.
|
|
@@ -7,7 +7,7 @@ import { ViewSource } from '../renderer/view-source';
|
|
|
7
7
|
import { IRenderer, IFormatter, ActionCompleteEventArgs, ActionBeginEventArgs, ImageDropEventArgs } from './interface';
|
|
8
8
|
import { CommandName, ResizeArgs, ToolbarStatusEventArgs } from './interface';
|
|
9
9
|
import { BeforeQuickToolbarOpenArgs, ChangeEventArgs, AfterImageDeleteEventArgs, AfterMediaDeleteEventArgs, PasteCleanupArgs } from './interface';
|
|
10
|
-
import { ILinkCommandsArgs, IImageCommandsArgs, BeforeSanitizeHtmlArgs, ITableCommandsArgs, ExecuteCommandOption } from './interface';
|
|
10
|
+
import { ILinkCommandsArgs, IImageCommandsArgs, IAudioCommandsArgs, IVideoCommandsArgs, BeforeSanitizeHtmlArgs, ITableCommandsArgs, ExecuteCommandOption } from './interface';
|
|
11
11
|
import { ServiceLocator } from '../services/service-locator';
|
|
12
12
|
import { DialogType } from './enum';
|
|
13
13
|
import { EditorMode, ShiftEnterKey, EnterKey, ContentHeightSource } from './../../common/types';
|
|
@@ -1163,7 +1163,7 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
1163
1163
|
* @param {ExecuteCommandOption} option - specifies the command option
|
|
1164
1164
|
* @public
|
|
1165
1165
|
*/
|
|
1166
|
-
executeCommand(commandName: CommandName, value?: string | HTMLElement | ILinkCommandsArgs | IImageCommandsArgs | ITableCommandsArgs | FormatPainterSettingsModel, option?: ExecuteCommandOption): void;
|
|
1166
|
+
executeCommand(commandName: CommandName, value?: string | HTMLElement | ILinkCommandsArgs | IImageCommandsArgs | ITableCommandsArgs | FormatPainterSettingsModel | IAudioCommandsArgs | IVideoCommandsArgs, option?: ExecuteCommandOption): void;
|
|
1167
1167
|
private htmlPurifier;
|
|
1168
1168
|
private encode;
|
|
1169
1169
|
/**
|
|
@@ -755,8 +755,8 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
755
755
|
!(e.altKey || e.shiftKey || (e.altKey && e.shiftKey && e.which == 67))) {
|
|
756
756
|
this.formatter.saveData();
|
|
757
757
|
}
|
|
758
|
-
|
|
759
|
-
|
|
758
|
+
var keyboardEventAction = ['insert-link', 'format-copy', 'format-paste', 'insert-image', 'insert-table', 'insert-audio', 'insert-video'];
|
|
759
|
+
if (keyboardEventAction.indexOf(e.action) === -1 &&
|
|
760
760
|
(!e.target || !(e.target.classList.contains('e-mention') && !isNOU(document.querySelector('#' + e.target.id + '_popup.e-popup-open')) && e.code === 'Tab')) &&
|
|
761
761
|
(e.action && e.action !== 'paste' && e.action !== 'space'
|
|
762
762
|
|| e.which === 9 || (e.code === 'Backspace' && e.which === 8))) {
|
|
@@ -2412,12 +2412,9 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2412
2412
|
|
|
2413
2413
|
*/
|
|
2414
2414
|
RichTextEditor.prototype.autoResize = function () {
|
|
2415
|
-
var _this = this;
|
|
2416
2415
|
if (this.height === 'auto') {
|
|
2417
2416
|
if (this.editorMode === 'Markdown') {
|
|
2418
|
-
|
|
2419
|
-
_this.setAutoHeight(_this.inputElement);
|
|
2420
|
-
}, 0);
|
|
2417
|
+
this.setAutoHeight(this.inputElement);
|
|
2421
2418
|
}
|
|
2422
2419
|
else if (this.iframeSettings.enable) {
|
|
2423
2420
|
var iframeElement = this.element.querySelector('#' + this.getID() + '_rte-view');
|
|
@@ -2430,21 +2427,10 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2430
2427
|
}
|
|
2431
2428
|
};
|
|
2432
2429
|
RichTextEditor.prototype.setAutoHeight = function (element) {
|
|
2433
|
-
if (!isNOU(element)
|
|
2430
|
+
if (!isNOU(element)) {
|
|
2434
2431
|
element.style.height = this.inputElement.scrollHeight + 'px';
|
|
2435
2432
|
element.style.overflow = 'hidden';
|
|
2436
2433
|
}
|
|
2437
|
-
else if (!isNOU(element) && !isNOU(element.parentElement) && this.iframeSettings.enable) {
|
|
2438
|
-
var newRange = this.getRange();
|
|
2439
|
-
element.style.height = 'auto';
|
|
2440
|
-
var newHeight = element.contentDocument.body.scrollHeight + 'px';
|
|
2441
|
-
element.style.height = newHeight;
|
|
2442
|
-
element.style.overflow = 'hidden';
|
|
2443
|
-
// 16 px added for padding doesn't affect the editor height
|
|
2444
|
-
if (newRange.startContainer.nodeName !== '#text' && newRange.startContainer.nodeName !== 'BODY' && window.innerHeight < newRange.startContainer.getBoundingClientRect().top + element.getBoundingClientRect().top + 16) {
|
|
2445
|
-
newRange.startContainer.scrollIntoView(false);
|
|
2446
|
-
}
|
|
2447
|
-
}
|
|
2448
2434
|
};
|
|
2449
2435
|
RichTextEditor.prototype.wireEvents = function () {
|
|
2450
2436
|
this.element.addEventListener('focusin', this.onFocusHandler, true);
|
|
@@ -51,10 +51,6 @@ export declare function pageYOffset(e: MouseEvent | Touch, parentElement: HTMLEl
|
|
|
51
51
|
* @hidden
|
|
52
52
|
*/
|
|
53
53
|
export declare function getTooltipText(item: string, serviceLocator: ServiceLocator): string;
|
|
54
|
-
export declare function getTooltipTextDropdownItems(item: string, serviceLocator: ServiceLocator, localeItems: {
|
|
55
|
-
[ket: string]: string;
|
|
56
|
-
}[], rteObj?: IRichTextEditor): string;
|
|
57
|
-
export declare function getQuickToolbarTooltipText(item: string): string;
|
|
58
54
|
/**
|
|
59
55
|
* @param {ISetToolbarStatusArgs} e - specifies the e element
|
|
60
56
|
* @param {boolean} isPopToolbar - specifies the boolean value
|
|
@@ -6,7 +6,7 @@ import { Browser, detach, SanitizeHtmlHelper, extend } from '@syncfusion/ej2-bas
|
|
|
6
6
|
import * as classes from '../base/classes';
|
|
7
7
|
import * as CONSTANT from '../base/constant';
|
|
8
8
|
import * as model from '../models/items';
|
|
9
|
-
import { toolsLocale, fontNameLocale, formatsLocale, numberFormatListLocale, bulletFormatListLocale
|
|
9
|
+
import { toolsLocale, fontNameLocale, formatsLocale, numberFormatListLocale, bulletFormatListLocale } from '../models/default-locale';
|
|
10
10
|
var undoRedoItems = ['Undo', 'Redo'];
|
|
11
11
|
var inlineNode = ['a', 'abbr', 'acronym', 'audio', 'b', 'bdi', 'bdo', 'big', 'br', 'button',
|
|
12
12
|
'canvas', 'cite', 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'font', 'i', 'iframe', 'img', 'input',
|
|
@@ -134,40 +134,6 @@ export function getTooltipText(item, serviceLocator) {
|
|
|
134
134
|
var tooltipText = i10n.getConstant(itemLocale);
|
|
135
135
|
return tooltipText;
|
|
136
136
|
}
|
|
137
|
-
export function getTooltipTextDropdownItems(item, serviceLocator, localeItems, rteObj) {
|
|
138
|
-
if (localeItems) {
|
|
139
|
-
var i10n = serviceLocator.getService('rteLocale');
|
|
140
|
-
for (var i = 0; i < localeItems.length; i++) {
|
|
141
|
-
var itemLocale = localeItems[i].value.toLocaleLowerCase();
|
|
142
|
-
var numberValue = localeItems[i].locale;
|
|
143
|
-
var numberLocale = defaultLocale["" + numberValue].toLocaleLowerCase();
|
|
144
|
-
if (item === itemLocale || item === numberLocale) {
|
|
145
|
-
var tooltipText = localeItems[i].locale;
|
|
146
|
-
return i10n.getConstant(tooltipText);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
var fontsize = rteObj.fontSize.items;
|
|
152
|
-
for (var i = 0; i < fontsize.length; i++) {
|
|
153
|
-
if (item === rteObj.fontSize.items[i].value) {
|
|
154
|
-
var fontSize = rteObj.fontSize.items[i].text;
|
|
155
|
-
return fontSize;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return '';
|
|
160
|
-
}
|
|
161
|
-
export function getQuickToolbarTooltipText(item) {
|
|
162
|
-
var keys = Object.keys(defaultLocale);
|
|
163
|
-
for (var i = 0; i < keys.length; i++) {
|
|
164
|
-
var tooltipText = defaultLocale["" + keys[i]];
|
|
165
|
-
if (item === tooltipText) {
|
|
166
|
-
return tooltipText;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
return '';
|
|
170
|
-
}
|
|
171
137
|
/**
|
|
172
138
|
* @param {ISetToolbarStatusArgs} e - specifies the e element
|
|
173
139
|
* @param {boolean} isPopToolbar - specifies the boolean value
|
|
@@ -133,7 +133,8 @@ var Formatter = /** @class */ (function () {
|
|
|
133
133
|
_this.saveData();
|
|
134
134
|
}
|
|
135
135
|
self.isBlur = false;
|
|
136
|
-
|
|
136
|
+
var quickToolbarAction = !isNOU(event) && !isNOU(event.target) && (!isNOU(closest(event.target, ".e-rte-elements.e-dropdown-popup.e-rte-dropdown-popup.e-quick-dropdown.e-popup-open")) || !isNOU(closest(event.target, ".e-rte-elements.e-rte-quick-popup.e-popup-open")));
|
|
137
|
+
if (isNOU(saveSelection) || (!quickToolbarAction && (isNOU(closest(saveSelection.range.startContainer.parentElement, ".e-img-caption")) ? true : !(closest(saveSelection.range.startContainer.parentElement, ".e-img-caption").getAttribute("contenteditable") == "false")))) {
|
|
137
138
|
self.contentModule.getEditPanel().focus();
|
|
138
139
|
}
|
|
139
140
|
if (self.editorMode === 'HTML' && !isKeyboardVideoInsert) {
|
|
@@ -176,7 +177,8 @@ var Formatter = /** @class */ (function () {
|
|
|
176
177
|
event: e, callBack: function () {
|
|
177
178
|
self.notify(CONSTANT.contentChanged, {});
|
|
178
179
|
_this.enableUndo(self);
|
|
179
|
-
}
|
|
180
|
+
},
|
|
181
|
+
enterAction: self.enterKey
|
|
180
182
|
});
|
|
181
183
|
};
|
|
182
184
|
/**
|