@syncfusion/ej2-richtexteditor 23.2.5 → 23.2.7
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 +36 -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 +191 -55
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +191 -55
- 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 +9 -9
- package/src/editor-manager/base/interface.d.ts +1 -0
- package/src/editor-manager/plugin/inserthtml.js +3 -1
- package/src/editor-manager/plugin/link.js +2 -0
- package/src/editor-manager/plugin/ms-word-clean-up.js +6 -2
- package/src/rich-text-editor/actions/enter-key.js +1 -1
- package/src/rich-text-editor/actions/html-editor.js +3 -0
- package/src/rich-text-editor/actions/paste-clean-up.js +4 -2
- package/src/rich-text-editor/actions/quick-toolbar.js +4 -1
- package/src/rich-text-editor/actions/toolbar.d.ts +0 -1
- package/src/rich-text-editor/actions/toolbar.js +0 -8
- 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/interface.d.ts +1 -0
- package/src/rich-text-editor/base/rich-text-editor.d.ts +12 -0
- package/src/rich-text-editor/base/rich-text-editor.js +49 -13
- package/src/rich-text-editor/models/default-locale.js +1 -0
- package/src/rich-text-editor/renderer/audio-module.js +0 -1
- package/src/rich-text-editor/renderer/dialog-renderer.d.ts +1 -0
- package/src/rich-text-editor/renderer/dialog-renderer.js +11 -0
- package/src/rich-text-editor/renderer/image-module.js +2 -4
- package/src/rich-text-editor/renderer/link-module.js +2 -1
- package/src/rich-text-editor/renderer/table-module.d.ts +1 -0
- package/src/rich-text-editor/renderer/table-module.js +9 -1
- package/src/rich-text-editor/renderer/toolbar-renderer.js +79 -10
- package/src/rich-text-editor/renderer/video-module.js +1 -2
- package/src/rich-text-editor/renderer/view-source.js +9 -8
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 23.2.
|
|
3
|
+
* version : 23.2.7
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-richtexteditor@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-richtexteditor@23.2.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@23.2.6",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-yiMdrOTe/kK+B6CGHKyKTYE+XvhMVnznfPPgziZDZgT11BPn/mdRhpMyCtfjlTybpQ5ohE9WGNqpeWndalRhZA==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-richtexteditor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"/@syncfusion/ej2-react-richtexteditor",
|
|
26
26
|
"/@syncfusion/ej2-vue-richtexteditor"
|
|
27
27
|
],
|
|
28
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-23.2.
|
|
29
|
-
"_shasum": "
|
|
28
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-23.2.6.tgz",
|
|
29
|
+
"_shasum": "b567bbae22fa4e6718a8f076b6c14c4a16e2977b",
|
|
30
30
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
31
31
|
"_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
|
|
32
32
|
"author": {
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
},
|
|
38
38
|
"bundleDependencies": false,
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@syncfusion/ej2-base": "~23.2.
|
|
41
|
-
"@syncfusion/ej2-buttons": "~23.2.
|
|
42
|
-
"@syncfusion/ej2-filemanager": "~23.2.
|
|
40
|
+
"@syncfusion/ej2-base": "~23.2.6",
|
|
41
|
+
"@syncfusion/ej2-buttons": "~23.2.7",
|
|
42
|
+
"@syncfusion/ej2-filemanager": "~23.2.6",
|
|
43
43
|
"@syncfusion/ej2-inputs": "~23.2.4",
|
|
44
|
-
"@syncfusion/ej2-navigations": "~23.2.
|
|
44
|
+
"@syncfusion/ej2-navigations": "~23.2.7",
|
|
45
45
|
"@syncfusion/ej2-popups": "~23.2.4",
|
|
46
46
|
"@syncfusion/ej2-splitbuttons": "~23.2.4"
|
|
47
47
|
},
|
|
@@ -69,6 +69,6 @@
|
|
|
69
69
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
70
70
|
},
|
|
71
71
|
"typings": "index.d.ts",
|
|
72
|
-
"version": "23.2.
|
|
72
|
+
"version": "23.2.7",
|
|
73
73
|
"sideEffects": false
|
|
74
74
|
}
|
|
@@ -488,7 +488,9 @@ var InsertHtml = /** @class */ (function () {
|
|
|
488
488
|
InsertHtml.findDetachEmptyElem = function (element) {
|
|
489
489
|
var removableElement;
|
|
490
490
|
if (!isNOU(element.parentElement)) {
|
|
491
|
-
|
|
491
|
+
var hasNbsp = element.parentElement.textContent.length > 0 && element.parentElement.textContent.match(/\u00a0/g)
|
|
492
|
+
&& element.parentElement.textContent.match(/\u00a0/g).length > 0;
|
|
493
|
+
if (!hasNbsp && element.parentElement.textContent.trim() === '' && element.parentElement.contentEditable !== 'true' &&
|
|
492
494
|
isNOU(element.parentElement.querySelector('img'))) {
|
|
493
495
|
removableElement = this.findDetachEmptyElem(element.parentElement);
|
|
494
496
|
}
|
|
@@ -58,9 +58,11 @@ var LinkCommand = /** @class */ (function () {
|
|
|
58
58
|
}
|
|
59
59
|
if (!isNOU(e.item.target)) {
|
|
60
60
|
anchorEle.setAttribute('target', e.item.target);
|
|
61
|
+
anchorEle.setAttribute('aria-label', e.item.ariaLabel);
|
|
61
62
|
}
|
|
62
63
|
else {
|
|
63
64
|
anchorEle.removeAttribute('target');
|
|
65
|
+
anchorEle.removeAttribute('aria-label');
|
|
64
66
|
}
|
|
65
67
|
if (linkText === e.item.text) {
|
|
66
68
|
e.item.selection.setSelectionText(this.parent.currentDocument, anchorEle, anchorEle, 1, 1);
|
|
@@ -356,7 +356,9 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
356
356
|
isNOU(allElements[i].nextElementSibling)))) {
|
|
357
357
|
var detachableElement = this.findDetachElem(allElements[i]);
|
|
358
358
|
var brElement = createElement('br');
|
|
359
|
-
|
|
359
|
+
var hasNbsp = detachableElement.textContent.length > 0 && detachableElement.textContent.match(/\u00a0/g)
|
|
360
|
+
&& detachableElement.textContent.match(/\u00a0/g).length > 0;
|
|
361
|
+
if (!hasNbsp && !isNOU(detachableElement.parentElement)) {
|
|
360
362
|
detachableElement.parentElement.insertBefore(brElement, detachableElement);
|
|
361
363
|
detach(detachableElement);
|
|
362
364
|
}
|
|
@@ -395,7 +397,9 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
395
397
|
MsWordPaste.prototype.findDetachEmptyElem = function (element) {
|
|
396
398
|
var removableElement;
|
|
397
399
|
if (!isNOU(element.parentElement)) {
|
|
398
|
-
|
|
400
|
+
var hasNbsp = element.parentElement.textContent.length > 0 && element.parentElement.textContent.match(/\u00a0/g)
|
|
401
|
+
&& element.parentElement.textContent.match(/\u00a0/g).length > 0;
|
|
402
|
+
if (!hasNbsp && element.parentElement.textContent.trim() === '' &&
|
|
399
403
|
element.parentElement.getAttribute('id') !== 'MSWord-Content' &&
|
|
400
404
|
!(this.hasParentWithClass(element, 'MsoListParagraph')) &&
|
|
401
405
|
isNOU(element.parentElement.querySelector('img'))) {
|
|
@@ -399,7 +399,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
399
399
|
var newElem = void 0;
|
|
400
400
|
var outerBRElem = _this.parent.createElement('br');
|
|
401
401
|
if (_this.range.startOffset === 0 && _this.range.endOffset === 0 &&
|
|
402
|
-
!isNOU(currentParent.previousSibling) && currentParent.previousSibling.nodeName === 'BR') {
|
|
402
|
+
!isNOU(currentParent.previousSibling) && currentParent.previousSibling.nodeName === 'BR' && currentParent.nodeName !== 'P' && currentParent.nodeName !== 'DIV') {
|
|
403
403
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
404
404
|
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, false).cloneNode(true);
|
|
405
405
|
_this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
|
|
@@ -800,6 +800,9 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
800
800
|
*/
|
|
801
801
|
HtmlEditor.prototype.onPropertyChanged = function (e) {
|
|
802
802
|
// On property code change here
|
|
803
|
+
if (!isNOU(e) && !isNOU(e.newProp.toolbarSettings) && !isNOU(e.newProp.toolbarSettings.enable)) {
|
|
804
|
+
this.toolbarUpdate = new HtmlToolbarStatus(this.parent);
|
|
805
|
+
}
|
|
803
806
|
if (!isNullOrUndefined(e.newProp.formatter)) {
|
|
804
807
|
var editElement = this.contentRenderer.getEditPanel();
|
|
805
808
|
var option = { undoRedoSteps: this.parent.undoRedoSteps,
|
|
@@ -269,7 +269,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
269
269
|
var popupEle = this.parent.createElement('div');
|
|
270
270
|
this.parent.element.appendChild(popupEle);
|
|
271
271
|
var contentEle = this.parent.createElement('input', {
|
|
272
|
-
id: this.parent.
|
|
272
|
+
id: this.parent.getID() + '_upload', attrs: { type: 'File', name: 'UploadFiles' }
|
|
273
273
|
});
|
|
274
274
|
var offsetY = this.parent.iframeSettings.enable ? -50 : -90;
|
|
275
275
|
this.popupObj = new Popup(popupEle, {
|
|
@@ -900,7 +900,9 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
900
900
|
PasteCleanup.prototype.findDetachEmptyElem = function (element) {
|
|
901
901
|
var removableElement;
|
|
902
902
|
if (!isNOU(element.parentElement)) {
|
|
903
|
-
|
|
903
|
+
var hasNbsp = element.parentElement.textContent.length > 0 && element.parentElement.textContent.match(/\u00a0/g)
|
|
904
|
+
&& element.parentElement.textContent.match(/\u00a0/g).length > 0;
|
|
905
|
+
if (!hasNbsp && element.parentElement.textContent.trim() === '' &&
|
|
904
906
|
element.parentElement.getAttribute('class') !== 'pasteContent') {
|
|
905
907
|
removableElement = this.findDetachEmptyElem(element.parentElement);
|
|
906
908
|
}
|
|
@@ -149,7 +149,7 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
149
149
|
|
|
150
150
|
*/
|
|
151
151
|
QuickToolbar.prototype.showInlineQTBar = function (x, y, target) {
|
|
152
|
-
if (this.parent.readonly || target.tagName.toLowerCase() === 'img') {
|
|
152
|
+
if (isNOU(this.parent) || this.parent.readonly || target.tagName.toLowerCase() === 'img') {
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
this.inlineQTBar.showPopup(x, y, target);
|
|
@@ -519,6 +519,9 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
519
519
|
this.parent.off(events.rtlMode, this.setRtl);
|
|
520
520
|
this.parent.off(events.bindCssClass, this.setCssClass);
|
|
521
521
|
this.parent.off(events.hidePopup, this.hideQuickToolbars);
|
|
522
|
+
if (this.deBouncer) {
|
|
523
|
+
clearTimeout(this.deBouncer);
|
|
524
|
+
}
|
|
522
525
|
};
|
|
523
526
|
/**
|
|
524
527
|
* Called internally if any of the property value changed.
|
|
@@ -156,7 +156,6 @@ export declare class Toolbar {
|
|
|
156
156
|
private focusChangeHandler;
|
|
157
157
|
private dropDownBeforeOpenHandler;
|
|
158
158
|
private tbFocusHandler;
|
|
159
|
-
private tbKeydownHandler;
|
|
160
159
|
private toolbarClickHandler;
|
|
161
160
|
protected wireEvents(): void;
|
|
162
161
|
protected unWireEvents(): void;
|
|
@@ -557,12 +557,6 @@ var Toolbar = /** @class */ (function () {
|
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
};
|
|
560
|
-
Toolbar.prototype.tbKeydownHandler = function (e) {
|
|
561
|
-
if (e.target.classList.contains('e-dropdown-btn') ||
|
|
562
|
-
e.target.getAttribute('id') === this.parent.getID() + '_toolbar_CreateTable') {
|
|
563
|
-
e.target.setAttribute('tabindex', '0');
|
|
564
|
-
}
|
|
565
|
-
};
|
|
566
560
|
Toolbar.prototype.toolbarClickHandler = function (e) {
|
|
567
561
|
var trg = closest(e.originalEvent.target, '.e-hor-nav');
|
|
568
562
|
if (trg && this.parent.toolbarSettings.type === ToolbarType.Expand && !isNOU(trg)) {
|
|
@@ -592,11 +586,9 @@ var Toolbar = /** @class */ (function () {
|
|
|
592
586
|
return;
|
|
593
587
|
}
|
|
594
588
|
EventHandler.add(this.tbElement, 'focusin', this.tbFocusHandler, this);
|
|
595
|
-
EventHandler.add(this.tbElement, 'keydown', this.tbKeydownHandler, this);
|
|
596
589
|
};
|
|
597
590
|
Toolbar.prototype.unWireEvents = function () {
|
|
598
591
|
EventHandler.remove(this.tbElement, 'focusin', this.tbFocusHandler);
|
|
599
|
-
EventHandler.remove(this.tbElement, 'keydown', this.tbKeydownHandler);
|
|
600
592
|
};
|
|
601
593
|
Toolbar.prototype.addEventListener = function () {
|
|
602
594
|
if (this.parent.isDestroyed) {
|
|
@@ -258,6 +258,7 @@ export interface NotifyArgs {
|
|
|
258
258
|
allowedStylePropertiesArray?: string[];
|
|
259
259
|
formatPainterSettings?: FormatPainterSettingsModel;
|
|
260
260
|
emojiPickerSettings?: EmojiSettingsModel;
|
|
261
|
+
ariaLabel?: string;
|
|
261
262
|
}
|
|
262
263
|
/**
|
|
263
264
|
* Provides information about the current and previous cssClass property .
|
|
@@ -1585,4 +1585,16 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
1585
1585
|
private editorKeyDown;
|
|
1586
1586
|
private unWireEvents;
|
|
1587
1587
|
private unbindEvents;
|
|
1588
|
+
/**
|
|
1589
|
+
*
|
|
1590
|
+
* @param e Focus event
|
|
1591
|
+
* @returns string Returns the current focus either `editArea` or `toolbar` or `textArea` or `sourceCode` or `outside` of the RichTextEditor.
|
|
1592
|
+
* @hidden
|
|
1593
|
+
*/
|
|
1594
|
+
private getCurrentFocus;
|
|
1595
|
+
/**
|
|
1596
|
+
* @param {FocusEvent} e - specifies the event.
|
|
1597
|
+
* @hidden
|
|
1598
|
+
*/
|
|
1599
|
+
private resetToolbarTabIndex;
|
|
1588
1600
|
}
|
|
@@ -762,10 +762,10 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
762
762
|
}
|
|
763
763
|
switch (e.action) {
|
|
764
764
|
case 'toolbar-focus':
|
|
765
|
-
if (this.toolbarSettings.enable) {
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
765
|
+
if (this.toolbarSettings.enable && this.getToolbarElement()) {
|
|
766
|
+
var firstActiveItem = this.getToolbarElement().querySelector('.e-toolbar-item:not(.e-overlay)[title]');
|
|
767
|
+
firstActiveItem.firstElementChild.removeAttribute('tabindex');
|
|
768
|
+
firstActiveItem.firstElementChild.focus();
|
|
769
769
|
}
|
|
770
770
|
break;
|
|
771
771
|
case 'escape':
|
|
@@ -2128,15 +2128,10 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2128
2128
|
}
|
|
2129
2129
|
EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
|
|
2130
2130
|
}
|
|
2131
|
-
if (!
|
|
2132
|
-
var
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
!toolbarItem[i].classList.contains('e-insert-table-btn')) &&
|
|
2136
|
-
(!toolbarItem[i].hasAttribute('tabindex') ||
|
|
2137
|
-
toolbarItem[i].getAttribute('tabindex') !== '-1')) {
|
|
2138
|
-
toolbarItem[i].setAttribute('tabindex', '-1');
|
|
2139
|
-
}
|
|
2131
|
+
if (!this.readonly) {
|
|
2132
|
+
var currentFocus = this.getCurrentFocus(e);
|
|
2133
|
+
if (currentFocus === 'editArea' || currentFocus === 'textArea' || currentFocus === 'sourceCode') {
|
|
2134
|
+
this.resetToolbarTabIndex();
|
|
2140
2135
|
}
|
|
2141
2136
|
}
|
|
2142
2137
|
};
|
|
@@ -2253,6 +2248,9 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2253
2248
|
else {
|
|
2254
2249
|
this.isRTE = true;
|
|
2255
2250
|
}
|
|
2251
|
+
if (!this.readonly && this.getCurrentFocus(e) === 'outside') {
|
|
2252
|
+
this.resetToolbarTabIndex();
|
|
2253
|
+
}
|
|
2256
2254
|
};
|
|
2257
2255
|
/**
|
|
2258
2256
|
* invokeChangeEvent method
|
|
@@ -2507,6 +2505,44 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2507
2505
|
}
|
|
2508
2506
|
this.unWireScrollElementsEvents();
|
|
2509
2507
|
};
|
|
2508
|
+
/**
|
|
2509
|
+
*
|
|
2510
|
+
* @param e Focus event
|
|
2511
|
+
* @returns string Returns the current focus either `editArea` or `toolbar` or `textArea` or `sourceCode` or `outside` of the RichTextEditor.
|
|
2512
|
+
* @hidden
|
|
2513
|
+
*/
|
|
2514
|
+
RichTextEditor.prototype.getCurrentFocus = function (e) {
|
|
2515
|
+
if (e.target === this.inputElement && document.activeElement === this.inputElement) {
|
|
2516
|
+
return 'editArea';
|
|
2517
|
+
}
|
|
2518
|
+
else if (e.target === this.getToolbarElement() || (!isNOU(e.relatedTarget) && closest(e.relatedTarget, '.e-rte-toolbar') === this.getToolbarElement())) {
|
|
2519
|
+
return 'toolbar';
|
|
2520
|
+
}
|
|
2521
|
+
else if (e.target === this.valueContainer && document.activeElement === this.valueContainer) {
|
|
2522
|
+
return 'textArea';
|
|
2523
|
+
}
|
|
2524
|
+
else if (!isNOU(e.target) && e.target.classList.contains(classes.CLS_RTE_SOURCE_CODE_TXTAREA) && document.activeElement === e.target) {
|
|
2525
|
+
return 'sourceCode';
|
|
2526
|
+
}
|
|
2527
|
+
return 'outside';
|
|
2528
|
+
};
|
|
2529
|
+
/**
|
|
2530
|
+
* @param {FocusEvent} e - specifies the event.
|
|
2531
|
+
* @hidden
|
|
2532
|
+
*/
|
|
2533
|
+
RichTextEditor.prototype.resetToolbarTabIndex = function () {
|
|
2534
|
+
if (this.getToolbarElement()) {
|
|
2535
|
+
var toolbarItem = this.getToolbarElement().querySelectorAll('input,select,button,a,[tabindex]');
|
|
2536
|
+
for (var i = 0; i < toolbarItem.length; i++) {
|
|
2537
|
+
if ((!toolbarItem[i].classList.contains('e-rte-dropdown-btn') &&
|
|
2538
|
+
!toolbarItem[i].classList.contains('e-insert-table-btn')) &&
|
|
2539
|
+
(!toolbarItem[i].hasAttribute('tabindex') ||
|
|
2540
|
+
toolbarItem[i].getAttribute('tabindex') !== '-1')) {
|
|
2541
|
+
toolbarItem[i].setAttribute('tabindex', '-1');
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
};
|
|
2510
2546
|
__decorate([
|
|
2511
2547
|
Complex({}, ToolbarSettings)
|
|
2512
2548
|
], RichTextEditor.prototype, "toolbarSettings", void 0);
|
|
@@ -198,6 +198,7 @@ export var defaultLocale = {
|
|
|
198
198
|
'emojiPickerTypeToFind': 'Type to find',
|
|
199
199
|
'emojiPickerNoResultFound': 'No results found',
|
|
200
200
|
'emojiPickerTrySomethingElse': 'Try something else',
|
|
201
|
+
'linkAriaLabel': 'Open in new window',
|
|
201
202
|
};
|
|
202
203
|
export var toolsLocale = {
|
|
203
204
|
'alignments': 'alignments',
|
|
@@ -555,7 +555,6 @@ var Audio = /** @class */ (function () {
|
|
|
555
555
|
enableRtl: this.parent.enableRtl,
|
|
556
556
|
locale: this.parent.locale,
|
|
557
557
|
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
558
|
-
position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
|
|
559
558
|
isModal: Browser.isDevice,
|
|
560
559
|
buttons: [{
|
|
561
560
|
click: this.insertAudioUrl.bind(selectObj),
|
|
@@ -35,6 +35,7 @@ var DialogRenderer = /** @class */ (function () {
|
|
|
35
35
|
var dlgObj;
|
|
36
36
|
e.beforeOpen = this.beforeOpen.bind(this);
|
|
37
37
|
e.open = this.open.bind(this);
|
|
38
|
+
e.position = { X: 'center', Y: this.getDialogPosition() };
|
|
38
39
|
if (isNOU(e.close)) {
|
|
39
40
|
e.close = this.close.bind(this);
|
|
40
41
|
}
|
|
@@ -79,6 +80,16 @@ var DialogRenderer = /** @class */ (function () {
|
|
|
79
80
|
}
|
|
80
81
|
});
|
|
81
82
|
};
|
|
83
|
+
DialogRenderer.prototype.getDialogPosition = function () {
|
|
84
|
+
var distanceFromVisibleTop = this.parent.element.getBoundingClientRect().top;
|
|
85
|
+
if (distanceFromVisibleTop < 0) {
|
|
86
|
+
distanceFromVisibleTop = Math.abs(distanceFromVisibleTop);
|
|
87
|
+
return distanceFromVisibleTop.toString();
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
return 'top';
|
|
91
|
+
}
|
|
92
|
+
};
|
|
82
93
|
/**
|
|
83
94
|
* dialog close method
|
|
84
95
|
*
|
|
@@ -1007,7 +1007,6 @@ var Image = /** @class */ (function () {
|
|
|
1007
1007
|
width: '290px',
|
|
1008
1008
|
header: this.parent.localeObj.getConstant('imageInsertLinkHeader'),
|
|
1009
1009
|
content: linkWrap,
|
|
1010
|
-
position: { X: 'center', Y: 'center' },
|
|
1011
1010
|
buttons: [{
|
|
1012
1011
|
// eslint-disable-next-line
|
|
1013
1012
|
click: function (e) {
|
|
@@ -1057,7 +1056,7 @@ var Image = /** @class */ (function () {
|
|
|
1057
1056
|
alt: inputAlt
|
|
1058
1057
|
};
|
|
1059
1058
|
this.dialogObj.setProperties({
|
|
1060
|
-
height: 'inherit', width: '290px', header: altHeader, content: altWrap,
|
|
1059
|
+
height: 'inherit', width: '290px', header: altHeader, content: altWrap,
|
|
1061
1060
|
buttons: [{
|
|
1062
1061
|
// eslint-disable-next-line
|
|
1063
1062
|
click: function (e) {
|
|
@@ -1284,7 +1283,7 @@ var Image = /** @class */ (function () {
|
|
|
1284
1283
|
var dialogContent = this.imgsizeInput(e);
|
|
1285
1284
|
var selectObj_1 = { args: e.args, selfImage: this, selection: e.selection, selectNode: e.selectNode };
|
|
1286
1285
|
this.dialogObj.setProperties({
|
|
1287
|
-
height: (Browser.isDevice) ? '300px' : 'inherit', width: '290px', header: imgSizeHeader, content: dialogContent,
|
|
1286
|
+
height: (Browser.isDevice) ? '300px' : 'inherit', width: '290px', header: imgSizeHeader, content: dialogContent,
|
|
1288
1287
|
buttons: [{
|
|
1289
1288
|
// eslint-disable-next-line
|
|
1290
1289
|
click: function (e) {
|
|
@@ -1350,7 +1349,6 @@ var Image = /** @class */ (function () {
|
|
|
1350
1349
|
enableRtl: this.parent.enableRtl,
|
|
1351
1350
|
locale: this.parent.locale,
|
|
1352
1351
|
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
1353
|
-
position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
|
|
1354
1352
|
isModal: Browser.isDevice,
|
|
1355
1353
|
buttons: [{
|
|
1356
1354
|
click: this.insertImageUrl.bind(selectObj),
|
|
@@ -365,6 +365,7 @@ var Link = /** @class */ (function () {
|
|
|
365
365
|
linkTitle = linkEle.querySelector('.e-rte-linkTitle').value;
|
|
366
366
|
}
|
|
367
367
|
var target = (this.selfLink.checkBoxObj.checked) ? '_blank' : null;
|
|
368
|
+
var linkLabel = (this.selfLink.checkBoxObj.checked) ? this.selfLink.i10n.getConstant('linkAriaLabel') : null;
|
|
368
369
|
if (linkUrl === '') {
|
|
369
370
|
this.selfLink.checkUrl(true);
|
|
370
371
|
return;
|
|
@@ -395,7 +396,7 @@ var Link = /** @class */ (function () {
|
|
|
395
396
|
this.selectParent = proxy.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
396
397
|
}
|
|
397
398
|
var value = {
|
|
398
|
-
url: linkUrl, text: linkText, title: linkTitle, target: target,
|
|
399
|
+
url: linkUrl, text: linkText, title: linkTitle, target: target, ariaLabel: linkLabel,
|
|
399
400
|
selection: this.selection, selectParent: this.selectParent
|
|
400
401
|
};
|
|
401
402
|
if (document.body.contains(proxy.dialogObj.element)) {
|
|
@@ -40,6 +40,7 @@ var Table = /** @class */ (function () {
|
|
|
40
40
|
this.parent.on(events.tableToolbarAction, this.onToolbarAction, this);
|
|
41
41
|
this.parent.on(events.dropDownSelect, this.dropdownSelect, this);
|
|
42
42
|
this.parent.on(events.keyDown, this.keyDown, this);
|
|
43
|
+
this.parent.on(events.keyUp, this.keyUp, this);
|
|
43
44
|
this.parent.on(events.mouseUp, this.selectionTable, this);
|
|
44
45
|
this.parent.on(events.tableModulekeyUp, this.tableModulekeyUp, this);
|
|
45
46
|
this.parent.on(events.bindCssClass, this.setCssClass, this);
|
|
@@ -62,6 +63,7 @@ var Table = /** @class */ (function () {
|
|
|
62
63
|
this.parent.off(events.dropDownSelect, this.dropdownSelect);
|
|
63
64
|
this.parent.off(events.mouseDown, this.cellSelect);
|
|
64
65
|
this.parent.off(events.tableColorPickerChanged, this.setBGColor);
|
|
66
|
+
this.parent.off(events.keyUp, this.keyUp);
|
|
65
67
|
this.parent.off(events.keyDown, this.keyDown);
|
|
66
68
|
this.parent.off(events.mouseUp, this.selectionTable);
|
|
67
69
|
this.parent.off(events.tableModulekeyUp, this.tableModulekeyUp);
|
|
@@ -166,6 +168,12 @@ var Table = /** @class */ (function () {
|
|
|
166
168
|
this.parent.formatter.process(this.parent, e, e, { selection: selectCell, subCommand: e.item.subCommand });
|
|
167
169
|
this.hideTableQuickToolbar();
|
|
168
170
|
};
|
|
171
|
+
Table.prototype.keyUp = function (e) {
|
|
172
|
+
var target = e.args.target;
|
|
173
|
+
if (e.args.key.toLocaleLowerCase() === 'escape' && target && target.classList && (this.popupObj && !closest(target, '[id=' + "'" + this.popupObj.element.id + "'" + ']')) && this.popupObj) {
|
|
174
|
+
this.popupObj.hide();
|
|
175
|
+
}
|
|
176
|
+
};
|
|
169
177
|
Table.prototype.keyDown = function (e) {
|
|
170
178
|
var event = e.args;
|
|
171
179
|
// eslint-disable-next-line
|
|
@@ -1351,7 +1359,7 @@ var Table = /** @class */ (function () {
|
|
|
1351
1359
|
value: 3,
|
|
1352
1360
|
placeholder: tableRow,
|
|
1353
1361
|
floatLabelType: 'Auto',
|
|
1354
|
-
max:
|
|
1362
|
+
max: 1000,
|
|
1355
1363
|
enableRtl: this.parent.enableRtl, locale: this.parent.locale,
|
|
1356
1364
|
cssClass: this.parent.cssClass
|
|
1357
1365
|
});
|
|
@@ -34,7 +34,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
34
34
|
};
|
|
35
35
|
ToolbarRenderer.prototype.destroyTooltip = function () {
|
|
36
36
|
if (!isNullOrUndefined(document.querySelector('.e-tooltip-wrap')) && !isNullOrUndefined(document.querySelector(' [data-tooltip-id]'))) {
|
|
37
|
-
var tooltipTargetEle =
|
|
37
|
+
var tooltipTargetEle = this.parent.element.querySelector('[data-tooltip-id]');
|
|
38
38
|
var event_1 = new MouseEvent('mouseleave', { bubbles: true, cancelable: true });
|
|
39
39
|
tooltipTargetEle.dispatchEvent(event_1);
|
|
40
40
|
}
|
|
@@ -195,17 +195,86 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
197
|
// eslint-disable-next-line
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
198
|
+
// Table styles dropdown preselect
|
|
199
|
+
if (proxy.parent.editorMode !== 'Markdown') {
|
|
200
|
+
var startNode = proxy.parent.getRange().startContainer.parentElement;
|
|
201
|
+
var tableEle = startNode.closest('table');
|
|
202
|
+
var trow = startNode.closest('tr');
|
|
203
|
+
if (!isNOU(tableEle) && tableEle.classList.contains('e-dashed-border')) {
|
|
204
|
+
for (var index = 0; index < args.element.childNodes.length; index++) {
|
|
205
|
+
if (args.element.childNodes[index].classList.contains('e-dashed-borders')) {
|
|
206
|
+
addClass([args.element.childNodes[index]], 'e-active');
|
|
207
|
+
}
|
|
205
208
|
}
|
|
206
209
|
}
|
|
207
|
-
else {
|
|
208
|
-
|
|
210
|
+
else if (!isNOU(tableEle) && !tableEle.classList.contains('e-dashed-border') && tableEle.classList.contains('e-alternate-rows') && window.getComputedStyle(trow).backgroundColor !== '') {
|
|
211
|
+
for (var index = 0; index < args.element.childNodes.length; index++) {
|
|
212
|
+
if (args.element.childNodes[index].classList.contains('e-alternate-rows')) {
|
|
213
|
+
addClass([args.element.childNodes[index]], 'e-active');
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
//Alignments preselect
|
|
218
|
+
var alignEle = proxy.parent.getRange().startContainer;
|
|
219
|
+
while (alignEle !== proxy.parent.element.querySelector('.e-content') && !isNOU(alignEle.parentElement)) {
|
|
220
|
+
if (alignEle.nodeName === '#text') {
|
|
221
|
+
alignEle = alignEle.parentElement;
|
|
222
|
+
}
|
|
223
|
+
var alignStyle = window.getComputedStyle(alignEle).textAlign;
|
|
224
|
+
if (args.items[0].command === 'Alignments') {
|
|
225
|
+
if ((args.items[0].text === 'Align Left' && (alignStyle === 'left') || alignStyle === 'start')) {
|
|
226
|
+
addClass([args.element.childNodes[0]], 'e-active');
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
else if (args.items[1].text === 'Align Center' && alignStyle === 'center') {
|
|
230
|
+
addClass([args.element.childNodes[1]], 'e-active');
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
else if (args.items[2].text === 'Align Right' && alignStyle === 'right') {
|
|
234
|
+
addClass([args.element.childNodes[2]], 'e-active');
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
else if (args.items[3].text === 'Align Justify' && alignStyle === 'justify') {
|
|
238
|
+
addClass([args.element.childNodes[3]], 'e-active');
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
alignEle = alignEle.parentElement;
|
|
243
|
+
}
|
|
244
|
+
//image preselect
|
|
245
|
+
var imageEle = startNode.closest('img') ? startNode.closest('img') : startNode.querySelector('img');
|
|
246
|
+
if (args.items[0].command === 'Images') {
|
|
247
|
+
if (!isNOU(imageEle)) {
|
|
248
|
+
var index = void 0;
|
|
249
|
+
if (imageEle.classList.contains('e-imgleft') || imageEle.classList.contains('e-imginline')) {
|
|
250
|
+
index = 0;
|
|
251
|
+
}
|
|
252
|
+
else if (imageEle.classList.contains('e-imgcenter') || imageEle.classList.contains('e-imgbreak')) {
|
|
253
|
+
index = 1;
|
|
254
|
+
}
|
|
255
|
+
else if (imageEle.classList.contains('e-imgright')) {
|
|
256
|
+
index = 2;
|
|
257
|
+
}
|
|
258
|
+
if (!isNOU(args.element.childNodes[index])) {
|
|
259
|
+
addClass([args.element.childNodes[index]], 'e-active');
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
//Formats preselect
|
|
264
|
+
if (args.items[0].command === 'Formats') {
|
|
265
|
+
for (var index = 0; index < args.element.childNodes.length; index++) {
|
|
266
|
+
var divNode = _this.parent.createElement('div');
|
|
267
|
+
divNode.innerHTML = dropDown.content.trim();
|
|
268
|
+
if (divNode.textContent.trim() !== ''
|
|
269
|
+
&& args.element.childNodes[index].textContent.trim() === divNode.textContent.trim()) {
|
|
270
|
+
if (!args.element.childNodes[index].classList.contains('e-active')) {
|
|
271
|
+
addClass([args.element.childNodes[index]], 'e-active');
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
removeClass([args.element.childNodes[index]], 'e-active');
|
|
276
|
+
}
|
|
277
|
+
}
|
|
209
278
|
}
|
|
210
279
|
}
|
|
211
280
|
proxy.parent.notify(events.beforeDropDownOpen, args);
|
|
@@ -143,7 +143,7 @@ var Video = /** @class */ (function () {
|
|
|
143
143
|
var dialogContent = this.vidsizeInput(e);
|
|
144
144
|
var selectObj_1 = { args: e.args, selfVideo: this, selection: e.selection, selectNode: e.selectNode };
|
|
145
145
|
this.dialogObj.setProperties({
|
|
146
|
-
height: 'inherit', width: '290px', header: vidSizeHeader, content: dialogContent,
|
|
146
|
+
height: 'inherit', width: '290px', header: vidSizeHeader, content: dialogContent,
|
|
147
147
|
buttons: [{
|
|
148
148
|
// eslint-disable-next-line
|
|
149
149
|
click: function (e) {
|
|
@@ -1048,7 +1048,6 @@ var Video = /** @class */ (function () {
|
|
|
1048
1048
|
enableRtl: this.parent.enableRtl,
|
|
1049
1049
|
locale: this.parent.locale,
|
|
1050
1050
|
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
1051
|
-
position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
|
|
1052
1051
|
isModal: Browser.isDevice,
|
|
1053
1052
|
buttons: [{
|
|
1054
1053
|
click: this.insertVideoUrl.bind(selectObj),
|