@syncfusion/ej2-richtexteditor 19.3.47 → 19.3.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +133 -45
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +133 -45
- 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 +12 -12
- package/src/editor-manager/plugin/inserthtml.js +9 -1
- package/src/rich-text-editor/actions/dropdown-buttons.js +10 -0
- package/src/rich-text-editor/actions/enter-key.d.ts +1 -0
- package/src/rich-text-editor/actions/enter-key.js +38 -28
- package/src/rich-text-editor/actions/html-editor.js +2 -2
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +1 -0
- package/src/rich-text-editor/actions/quick-toolbar.js +16 -1
- package/src/rich-text-editor/base/interface.d.ts +2 -0
- package/src/rich-text-editor/base/rich-text-editor.js +1 -2
- package/src/rich-text-editor/formatter/formatter.js +3 -3
- package/src/rich-text-editor/renderer/image-module.js +49 -4
- package/src/rich-text-editor/renderer/toolbar-renderer.js +3 -2
- package/src/selection/selection.js +2 -1
- package/styles/bootstrap-dark.css +4 -0
- package/styles/bootstrap.css +4 -0
- package/styles/bootstrap4.css +4 -0
- package/styles/bootstrap5-dark.css +4 -0
- package/styles/bootstrap5.css +4 -0
- package/styles/fabric-dark.css +4 -0
- package/styles/fabric.css +4 -0
- package/styles/highcontrast-light.css +4 -0
- package/styles/highcontrast.css +4 -0
- package/styles/material-dark.css +4 -0
- package/styles/material.css +4 -0
- package/styles/rich-text-editor/_layout.scss +4 -0
- package/styles/rich-text-editor/bootstrap-dark.css +4 -0
- package/styles/rich-text-editor/bootstrap.css +4 -0
- package/styles/rich-text-editor/bootstrap4.css +4 -0
- package/styles/rich-text-editor/bootstrap5-dark.css +4 -0
- package/styles/rich-text-editor/bootstrap5.css +4 -0
- package/styles/rich-text-editor/fabric-dark.css +4 -0
- package/styles/rich-text-editor/fabric.css +4 -0
- package/styles/rich-text-editor/highcontrast-light.css +4 -0
- package/styles/rich-text-editor/highcontrast.css +4 -0
- package/styles/rich-text-editor/material-dark.css +4 -0
- package/styles/rich-text-editor/material.css +4 -0
- package/styles/rich-text-editor/tailwind-dark.css +4 -0
- package/styles/rich-text-editor/tailwind.css +4 -0
- package/styles/tailwind-dark.css +4 -0
- package/styles/tailwind.css +4 -0
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 19.3.
|
|
3
|
+
* version : 19.3.57
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-richtexteditor@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-richtexteditor@19.3.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@19.3.55",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-D/DsRzXeFfRt5Dpl70MOKjgCZWbAvgLyeukh+TFdyGjtKeX3+QOcYK+UqdvSmOnjU1K006D1qL8HAWJJ+qko8w==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-richtexteditor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"/@syncfusion/ej2-react-richtexteditor",
|
|
27
27
|
"/@syncfusion/ej2-vue-richtexteditor"
|
|
28
28
|
],
|
|
29
|
-
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-19.3.
|
|
30
|
-
"_shasum": "
|
|
29
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-19.3.55.tgz",
|
|
30
|
+
"_shasum": "a67a4621ca30dd75181f6d3bf53341c29b0d0e0c",
|
|
31
31
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
32
32
|
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
|
|
33
33
|
"author": {
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
},
|
|
39
39
|
"bundleDependencies": false,
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@syncfusion/ej2-base": "~19.3.
|
|
42
|
-
"@syncfusion/ej2-buttons": "~19.3.
|
|
43
|
-
"@syncfusion/ej2-filemanager": "~19.3.
|
|
44
|
-
"@syncfusion/ej2-inputs": "~19.3.
|
|
45
|
-
"@syncfusion/ej2-navigations": "~19.3.
|
|
46
|
-
"@syncfusion/ej2-popups": "~19.3.
|
|
47
|
-
"@syncfusion/ej2-splitbuttons": "~19.3.
|
|
41
|
+
"@syncfusion/ej2-base": "~19.3.56",
|
|
42
|
+
"@syncfusion/ej2-buttons": "~19.3.53",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~19.3.55",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~19.3.57",
|
|
45
|
+
"@syncfusion/ej2-navigations": "~19.3.57",
|
|
46
|
+
"@syncfusion/ej2-popups": "~19.3.57",
|
|
47
|
+
"@syncfusion/ej2-splitbuttons": "~19.3.53"
|
|
48
48
|
},
|
|
49
49
|
"deprecated": false,
|
|
50
50
|
"description": "Essential JS 2 RichTextEditor component",
|
|
@@ -70,6 +70,6 @@
|
|
|
70
70
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
71
71
|
},
|
|
72
72
|
"typings": "index.d.ts",
|
|
73
|
-
"version": "19.3.
|
|
73
|
+
"version": "19.3.57",
|
|
74
74
|
"sideEffects": false
|
|
75
75
|
}
|
|
@@ -370,7 +370,15 @@ var InsertHtml = /** @class */ (function () {
|
|
|
370
370
|
tempSpan.parentNode.replaceChild(node, tempSpan);
|
|
371
371
|
}
|
|
372
372
|
else {
|
|
373
|
-
var
|
|
373
|
+
var currentNode = nodes[nodes.length - 1];
|
|
374
|
+
var splitedElm = void 0;
|
|
375
|
+
if ((currentNode.nodeName === 'BR' || currentNode.nodeName === 'HR') && !isNOU(currentNode.parentElement) &&
|
|
376
|
+
currentNode.parentElement.textContent.trim().length === 0 && !node.classList.contains('pasteContent')) {
|
|
377
|
+
splitedElm = currentNode;
|
|
378
|
+
}
|
|
379
|
+
else {
|
|
380
|
+
splitedElm = nodeCutter.GetSpliceNode(range, blockNode);
|
|
381
|
+
}
|
|
374
382
|
splitedElm.parentNode.replaceChild(node, splitedElm);
|
|
375
383
|
}
|
|
376
384
|
}
|
|
@@ -206,6 +206,11 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
206
206
|
var prop = _a[_i];
|
|
207
207
|
switch (prop) {
|
|
208
208
|
case 'fontFamily':
|
|
209
|
+
if (this.parent.inlineMode.enable) {
|
|
210
|
+
if (!isNullOrUndefined(this.parent.fontFamily.default)) {
|
|
211
|
+
this.getEditNode().style.fontFamily = this.parent.fontFamily.default;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
209
214
|
if (this.fontNameDropDown) {
|
|
210
215
|
for (var _b = 0, _c = Object.keys(newProp.fontFamily); _b < _c.length; _b++) {
|
|
211
216
|
var fontFamily = _c[_b];
|
|
@@ -237,6 +242,11 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
237
242
|
}
|
|
238
243
|
break;
|
|
239
244
|
case 'fontSize':
|
|
245
|
+
if (this.parent.inlineMode) {
|
|
246
|
+
if (!isNullOrUndefined(this.parent.fontSize.default)) {
|
|
247
|
+
this.getEditNode().style.fontSize = this.parent.fontSize.default;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
240
250
|
if (this.fontSizeDropDown) {
|
|
241
251
|
for (var _d = 0, _e = Object.keys(newProp.fontSize); _d < _e.length; _d++) {
|
|
242
252
|
var fontSize = _e[_d];
|
|
@@ -89,12 +89,13 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
89
89
|
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.range.startContainer.childNodes[_this.range.startOffset], 0);
|
|
90
90
|
_this.getRangeNode();
|
|
91
91
|
}
|
|
92
|
-
if (_this.parent.enterKey === 'P' || _this.parent.enterKey === 'DIV' ||
|
|
92
|
+
if ((_this.parent.enterKey === 'P' && !shiftKey_1) || (_this.parent.enterKey === 'DIV' && !shiftKey_1) ||
|
|
93
93
|
(_this.parent.shiftEnterKey === 'P' && shiftKey_1) ||
|
|
94
94
|
(_this.parent.shiftEnterKey === 'DIV' && shiftKey_1)) {
|
|
95
95
|
var nearBlockNode = _this.parent.formatter.editorManager.domNode.blockParentNode(_this.startNode);
|
|
96
96
|
var isImageNode = false;
|
|
97
|
-
if (_this.range.startOffset === 0 && _this.range.endOffset === 0 && !(!isNOU(_this.range.startContainer.previousSibling) &&
|
|
97
|
+
if (_this.range.startOffset === 0 && _this.range.endOffset === 0 && !(!isNOU(_this.range.startContainer.previousSibling) &&
|
|
98
|
+
(_this.range.startContainer.previousSibling.nodeName === 'IMG' || _this.range.startContainer.previousSibling.nodeName === 'BR'))) {
|
|
98
99
|
var isNearBlockLengthZero = void 0;
|
|
99
100
|
var newElem = void 0;
|
|
100
101
|
if (_this.range.startContainer.nodeName === 'IMG') {
|
|
@@ -129,6 +130,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
129
130
|
detach(nearBlockNode);
|
|
130
131
|
}
|
|
131
132
|
}
|
|
133
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), insertElem.nextElementSibling, 0);
|
|
132
134
|
}
|
|
133
135
|
else if (nearBlockNode.textContent.length === 0 && !(!isNOU(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG')) {
|
|
134
136
|
if (!isNOU(nearBlockNode.children[0]) && nearBlockNode.children[0].tagName !== 'BR') {
|
|
@@ -167,7 +169,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
167
169
|
}
|
|
168
170
|
e.args.preventDefault();
|
|
169
171
|
}
|
|
170
|
-
if (_this.parent.enterKey === 'BR' && !shiftKey_1) {
|
|
172
|
+
if ((_this.parent.enterKey === 'BR' && !shiftKey_1) || (_this.parent.shiftEnterKey === 'BR' && shiftKey_1)) {
|
|
171
173
|
var currentParent = void 0;
|
|
172
174
|
if (!_this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode)) {
|
|
173
175
|
var currentNode = _this.startNode;
|
|
@@ -183,10 +185,16 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
183
185
|
currentParent = _this.startNode;
|
|
184
186
|
}
|
|
185
187
|
var isEmptyBrInserted = false;
|
|
188
|
+
var currentParentLastChild = currentParent.lastChild;
|
|
189
|
+
while (!isNOU(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text')) {
|
|
190
|
+
currentParentLastChild = currentParentLastChild.lastChild;
|
|
191
|
+
}
|
|
192
|
+
var isLastNodeLength = _this.range.startContainer === currentParentLastChild ?
|
|
193
|
+
_this.range.startContainer.textContent.length : currentParent.textContent.length;
|
|
186
194
|
if (currentParent !== _this.parent.inputElement &&
|
|
187
195
|
_this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
|
|
188
196
|
_this.range.startOffset === _this.range.endOffset &&
|
|
189
|
-
_this.range.startOffset ===
|
|
197
|
+
_this.range.startOffset === isLastNodeLength) {
|
|
190
198
|
var outerBRElem = _this.parent.createElement('br');
|
|
191
199
|
_this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
|
|
192
200
|
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), outerBRElem, 0);
|
|
@@ -216,34 +224,12 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
216
224
|
isEmptyBrInserted = true;
|
|
217
225
|
}
|
|
218
226
|
else {
|
|
219
|
-
|
|
220
|
-
newElem.parentElement.insertBefore(outerBRElem, newElem);
|
|
221
|
-
_this.insertFocusContent();
|
|
227
|
+
_this.insertBRElement();
|
|
222
228
|
}
|
|
223
229
|
}
|
|
224
230
|
}
|
|
225
231
|
else {
|
|
226
|
-
|
|
227
|
-
if (_this.startNode.nodeName === 'BR' && _this.endNode.nodeName === 'BR' && _this.range.startOffset === 0 && _this.range.startOffset === _this.range.endOffset) {
|
|
228
|
-
_this.parent.formatter.editorManager.domNode.insertAfter(brElm, _this.startNode);
|
|
229
|
-
isEmptyBrInserted = true;
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
if (_this.startNode === _this.parent.inputElement && !isNOU(_this.range.startContainer.previousSibling) &&
|
|
233
|
-
_this.range.startContainer.previousSibling.nodeName === 'BR' && _this.range.startContainer.textContent.length === 0) {
|
|
234
|
-
isEmptyBrInserted = true;
|
|
235
|
-
}
|
|
236
|
-
_this.range.insertNode(brElm);
|
|
237
|
-
}
|
|
238
|
-
if (isEmptyBrInserted || (!isNOU(brElm.nextElementSibling) && brElm.nextElementSibling.tagName === 'BR') || (!isNOU(brElm.nextSibling) && brElm.nextSibling.textContent.length > 0)) {
|
|
239
|
-
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), !isNOU(brElm.nextSibling) ? brElm.nextSibling : brElm, 0);
|
|
240
|
-
isEmptyBrInserted = false;
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
var brElm2 = _this.parent.createElement('br');
|
|
244
|
-
_this.range.insertNode(brElm2);
|
|
245
|
-
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), brElm, 0);
|
|
246
|
-
}
|
|
232
|
+
_this.insertBRElement();
|
|
247
233
|
}
|
|
248
234
|
e.args.preventDefault();
|
|
249
235
|
}
|
|
@@ -253,6 +239,30 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
253
239
|
}
|
|
254
240
|
}
|
|
255
241
|
};
|
|
242
|
+
EnterKeyAction.prototype.insertBRElement = function () {
|
|
243
|
+
var isEmptyBrInserted = false;
|
|
244
|
+
var brElm = this.parent.createElement('br');
|
|
245
|
+
if (this.startNode.nodeName === 'BR' && this.endNode.nodeName === 'BR' && this.range.startOffset === 0 && this.range.startOffset === this.range.endOffset) {
|
|
246
|
+
this.parent.formatter.editorManager.domNode.insertAfter(brElm, this.startNode);
|
|
247
|
+
isEmptyBrInserted = true;
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
if (this.startNode === this.parent.inputElement && !isNOU(this.range.startContainer.previousSibling) &&
|
|
251
|
+
this.range.startContainer.previousSibling.nodeName === 'BR' && this.range.startContainer.textContent.length === 0) {
|
|
252
|
+
isEmptyBrInserted = true;
|
|
253
|
+
}
|
|
254
|
+
this.range.insertNode(brElm);
|
|
255
|
+
}
|
|
256
|
+
if (isEmptyBrInserted || (!isNOU(brElm.nextElementSibling) && brElm.nextElementSibling.tagName === 'BR') || (!isNOU(brElm.nextSibling) && brElm.nextSibling.textContent.length > 0)) {
|
|
257
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), !isNOU(brElm.nextSibling) ? brElm.nextSibling : brElm, 0);
|
|
258
|
+
isEmptyBrInserted = false;
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
var brElm2 = this.parent.createElement('br');
|
|
262
|
+
this.range.insertNode(brElm2);
|
|
263
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), brElm, 0);
|
|
264
|
+
}
|
|
265
|
+
};
|
|
256
266
|
EnterKeyAction.prototype.insertFocusContent = function () {
|
|
257
267
|
if (this.range.startContainer.textContent.length === 0) {
|
|
258
268
|
if (this.range.startContainer.nodeName === '#text') {
|
|
@@ -149,7 +149,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
149
149
|
e.args.action === 'enter' ||
|
|
150
150
|
e.args.keyCode === 13) {
|
|
151
151
|
this.spaceLink(e.args);
|
|
152
|
-
if (this.parent.editorMode === 'HTML'
|
|
152
|
+
if (this.parent.editorMode === 'HTML') {
|
|
153
153
|
this.parent.notify(events.enterHandler, { args: e.args });
|
|
154
154
|
}
|
|
155
155
|
}
|
|
@@ -426,7 +426,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
426
426
|
var divElement = this.parent.createElement('div');
|
|
427
427
|
divElement.setAttribute('class', 'pasteContent');
|
|
428
428
|
divElement.style.display = 'inline';
|
|
429
|
-
divElement.innerHTML = contentInnerElem;
|
|
429
|
+
divElement.innerHTML = contentInnerElem.replace('¶', '&para');
|
|
430
430
|
var paraElem = divElement.querySelectorAll('span, p');
|
|
431
431
|
for (var i = 0; i < paraElem.length; i++) {
|
|
432
432
|
var splitTextContent = paraElem[i].innerHTML.split(' ');
|
|
@@ -38,6 +38,7 @@ export declare class QuickToolbar {
|
|
|
38
38
|
createQTBar(popupType: string, mode: string, items: (string | IToolbarItems)[], type: RenderType): BaseQuickToolbar;
|
|
39
39
|
private initializeQuickToolbars;
|
|
40
40
|
private onMouseDown;
|
|
41
|
+
private keyUpQT;
|
|
41
42
|
private renderQuickToolbars;
|
|
42
43
|
private renderInlineQuickToolbar;
|
|
43
44
|
/**
|
|
@@ -80,6 +80,11 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
80
80
|
this.parent.isBlur = false;
|
|
81
81
|
this.parent.isRTE = true;
|
|
82
82
|
};
|
|
83
|
+
QuickToolbar.prototype.keyUpQT = function (e) {
|
|
84
|
+
if (e.which == 27) {
|
|
85
|
+
this.hideQuickToolbars();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
83
88
|
QuickToolbar.prototype.renderQuickToolbars = function () {
|
|
84
89
|
if (this.linkQTBar || this.imageQTBar || this.textQTBar || this.tableQTBar) {
|
|
85
90
|
return;
|
|
@@ -94,15 +99,19 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
94
99
|
this.renderFactory.addRenderer(RenderType.TableToolbar, this.tableQTBar);
|
|
95
100
|
if (this.linkQTBar) {
|
|
96
101
|
EventHandler.add(this.linkQTBar.element, 'mousedown', this.onMouseDown, this);
|
|
102
|
+
EventHandler.add(this.linkQTBar.element, 'keyup', this.keyUpQT, this);
|
|
97
103
|
}
|
|
98
104
|
if (this.imageQTBar) {
|
|
99
105
|
EventHandler.add(this.imageQTBar.element, 'mousedown', this.onMouseDown, this);
|
|
106
|
+
EventHandler.add(this.imageQTBar.element, 'keyup', this.keyUpQT, this);
|
|
100
107
|
}
|
|
101
108
|
if (this.textQTBar) {
|
|
102
109
|
EventHandler.add(this.textQTBar.element, 'mousedown', this.onMouseDown, this);
|
|
110
|
+
EventHandler.add(this.textQTBar.element, 'keyup', this.keyUpQT, this);
|
|
103
111
|
}
|
|
104
112
|
if (this.tableQTBar) {
|
|
105
113
|
EventHandler.add(this.tableQTBar.element, 'mousedown', this.onMouseDown, this);
|
|
114
|
+
EventHandler.add(this.tableQTBar.element, 'keyup', this.keyUpQT, this);
|
|
106
115
|
}
|
|
107
116
|
};
|
|
108
117
|
QuickToolbar.prototype.renderInlineQuickToolbar = function () {
|
|
@@ -111,6 +120,7 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
111
120
|
this.inlineQTBar = this.createQTBar('Inline', 'MultiRow', this.parent.toolbarSettings.items, RenderType.InlineToolbar);
|
|
112
121
|
this.renderFactory.addRenderer(RenderType.InlineToolbar, this.inlineQTBar);
|
|
113
122
|
EventHandler.add(this.inlineQTBar.element, 'mousedown', this.onMouseDown, this);
|
|
123
|
+
EventHandler.add(this.inlineQTBar.element, 'keyup', this.keyUpQT, this);
|
|
114
124
|
}
|
|
115
125
|
};
|
|
116
126
|
/**
|
|
@@ -124,7 +134,7 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
124
134
|
|
|
125
135
|
*/
|
|
126
136
|
QuickToolbar.prototype.showInlineQTBar = function (x, y, target) {
|
|
127
|
-
if (this.parent.readonly) {
|
|
137
|
+
if (this.parent.readonly || target.tagName.toLowerCase() === "img") {
|
|
128
138
|
return;
|
|
129
139
|
}
|
|
130
140
|
this.inlineQTBar.showPopup(x, y, target);
|
|
@@ -265,22 +275,27 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
265
275
|
QuickToolbar.prototype.destroy = function () {
|
|
266
276
|
if (this.linkQTBar) {
|
|
267
277
|
EventHandler.remove(this.linkQTBar.element, 'mousedown', this.onMouseDown);
|
|
278
|
+
EventHandler.remove(this.linkQTBar.element, 'keyup', this.keyUpQT);
|
|
268
279
|
this.linkQTBar.destroy();
|
|
269
280
|
}
|
|
270
281
|
if (this.textQTBar) {
|
|
271
282
|
EventHandler.remove(this.textQTBar.element, 'mousedown', this.onMouseDown);
|
|
283
|
+
EventHandler.remove(this.textQTBar.element, 'keyup', this.keyUpQT);
|
|
272
284
|
this.textQTBar.destroy();
|
|
273
285
|
}
|
|
274
286
|
if (this.imageQTBar) {
|
|
275
287
|
EventHandler.remove(this.imageQTBar.element, 'mousedown', this.onMouseDown);
|
|
288
|
+
EventHandler.remove(this.imageQTBar.element, 'keyup', this.keyUpQT);
|
|
276
289
|
this.imageQTBar.destroy();
|
|
277
290
|
}
|
|
278
291
|
if (this.tableQTBar) {
|
|
279
292
|
EventHandler.remove(this.tableQTBar.element, 'mousedown', this.onMouseDown);
|
|
293
|
+
EventHandler.remove(this.tableQTBar.element, 'keyup', this.keyUpQT);
|
|
280
294
|
this.tableQTBar.destroy();
|
|
281
295
|
}
|
|
282
296
|
if (this.inlineQTBar) {
|
|
283
297
|
EventHandler.remove(this.inlineQTBar.element, 'mousedown', this.onMouseDown);
|
|
298
|
+
EventHandler.remove(this.inlineQTBar.element, 'keyup', this.keyUpQT);
|
|
284
299
|
if (isIDevice()) {
|
|
285
300
|
EventHandler.remove(document, 'selectionchange', this.selectionChangeHandler);
|
|
286
301
|
}
|
|
@@ -576,6 +576,8 @@ export interface ActionBeginEventArgs {
|
|
|
576
576
|
originalEvent?: MouseEvent | KeyboardEvent;
|
|
577
577
|
/** Defines the event name. */
|
|
578
578
|
name?: string;
|
|
579
|
+
/** Defines the selection type is dropdown. */
|
|
580
|
+
selectType?: string;
|
|
579
581
|
/**
|
|
580
582
|
* Defines the url action details.
|
|
581
583
|
*
|
|
@@ -1431,8 +1431,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1431
1431
|
this.setProperties({ value: this.valueTemplate });
|
|
1432
1432
|
}
|
|
1433
1433
|
else {
|
|
1434
|
-
var
|
|
1435
|
-
var compiledTemplate = compiledString({});
|
|
1434
|
+
var compiledTemplate = compile(this.valueTemplate)('', this, 'valueTemplate');
|
|
1436
1435
|
for (var i = 0; i < compiledTemplate.length; i++) {
|
|
1437
1436
|
var item = compiledTemplate[i];
|
|
1438
1437
|
append([item], this.element);
|
|
@@ -88,7 +88,7 @@ var Formatter = /** @class */ (function () {
|
|
|
88
88
|
|| ((args.item.subCommand === 'FontName' || args.item.subCommand === 'FontSize') && args.name === 'dropDownSelect')
|
|
89
89
|
|| ((args.item.subCommand === 'BackgroundColor' || args.item.subCommand === 'FontColor')
|
|
90
90
|
&& args.name === 'colorPickerChanged'))) {
|
|
91
|
-
extend(args, args, { requestType: args.item.subCommand, cancel: false, itemCollection: value }, true);
|
|
91
|
+
extend(args, args, { requestType: args.item.subCommand, cancel: false, itemCollection: value, selectType: args.name }, true);
|
|
92
92
|
self.trigger(CONSTANT.actionBegin, args, function (actionBeginArgs) {
|
|
93
93
|
if (!actionBeginArgs.cancel) {
|
|
94
94
|
if (_this.getUndoRedoStack().length === 0 && actionBeginArgs.item.command !== 'Links'
|
|
@@ -106,8 +106,8 @@ var Formatter = /** @class */ (function () {
|
|
|
106
106
|
}
|
|
107
107
|
else {
|
|
108
108
|
_this.editorManager.observer.notify(CONSTANT.checkUndo, { subCommand: actionBeginArgs.item.subCommand });
|
|
109
|
-
_this.editorManager.execCommand(actionBeginArgs.item.command, actionBeginArgs.item.subCommand, event, _this.onSuccess.bind(_this, self), actionBeginArgs.item.value, actionBeginArgs.item.subCommand === 'Pre' &&
|
|
110
|
-
{ name:
|
|
109
|
+
_this.editorManager.execCommand(actionBeginArgs.item.command, actionBeginArgs.item.subCommand, event, _this.onSuccess.bind(_this, self), actionBeginArgs.item.value, actionBeginArgs.item.subCommand === 'Pre' && actionBeginArgs.selectType === 'dropDownSelect' ?
|
|
110
|
+
{ name: actionBeginArgs.selectType } : value, ('#' + self.getID() + ' iframe'), self.enterKey);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
});
|
|
@@ -328,10 +328,14 @@ var Image = /** @class */ (function () {
|
|
|
328
328
|
img.style.height = expectedY + 'px';
|
|
329
329
|
}
|
|
330
330
|
else if (img.style.width !== '' && img.style.height === '') {
|
|
331
|
-
|
|
331
|
+
var currentWidth = ((width / height * expectedY) + width / height) < (this.parent.inputElement.getBoundingClientRect().right - 32) ?
|
|
332
|
+
((width / height * expectedY) + width / height) : (this.parent.inputElement.getBoundingClientRect().right - 32);
|
|
333
|
+
img.style.width = currentWidth.toString() + 'px';
|
|
332
334
|
}
|
|
333
335
|
else if (img.style.width !== '') {
|
|
334
|
-
|
|
336
|
+
var currentWidth = (width / height * expectedY) < (this.parent.inputElement.getBoundingClientRect().right - 32) ?
|
|
337
|
+
(width / height * expectedY) : (this.parent.inputElement.getBoundingClientRect().right - 32);
|
|
338
|
+
img.style.width = currentWidth + 'px';
|
|
335
339
|
img.style.height = expectedY + 'px';
|
|
336
340
|
}
|
|
337
341
|
else {
|
|
@@ -440,7 +444,7 @@ var Image = /** @class */ (function () {
|
|
|
440
444
|
};
|
|
441
445
|
Image.prototype.resizeImgDupPos = function (e) {
|
|
442
446
|
this.imgDupPos = {
|
|
443
|
-
width: (e.style.
|
|
447
|
+
width: (e.style.width !== '') ? this.imgEle.style.width : e.width + 'px',
|
|
444
448
|
height: (e.style.height !== '') ? this.imgEle.style.height : e.height + 'px'
|
|
445
449
|
};
|
|
446
450
|
};
|
|
@@ -608,6 +612,27 @@ var Image = /** @class */ (function () {
|
|
|
608
612
|
var src = this.deletedImg[i].src;
|
|
609
613
|
this.imageRemovePost(src);
|
|
610
614
|
}
|
|
615
|
+
if (range.startContainer.nodeType === 3) {
|
|
616
|
+
if (originalEvent.code === 'Backspace') {
|
|
617
|
+
if (range.startContainer.previousElementSibling && range.startOffset === 0 &&
|
|
618
|
+
range.startContainer.previousElementSibling.classList.contains(classes.CLS_CAPTION) &&
|
|
619
|
+
range.startContainer.previousElementSibling.classList.contains(classes.CLS_CAPINLINE)) {
|
|
620
|
+
detach(range.startContainer.previousElementSibling);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
else {
|
|
624
|
+
if (range.startContainer.nextElementSibling &&
|
|
625
|
+
range.endContainer.textContent.length === range.endOffset &&
|
|
626
|
+
range.startContainer.nextElementSibling.classList.contains(classes.CLS_CAPTION) &&
|
|
627
|
+
range.startContainer.nextElementSibling.classList.contains(classes.CLS_CAPINLINE)) {
|
|
628
|
+
detach(range.startContainer.nextElementSibling);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
else if ((range.startContainer.nodeType === 1 &&
|
|
633
|
+
range.startContainer.querySelector('.' + classes.CLS_CAPTION + '.' + classes.CLS_CAPINLINE))) {
|
|
634
|
+
detach(range.startContainer.querySelector('.' + classes.CLS_CAPTION + '.' + classes.CLS_CAPINLINE));
|
|
635
|
+
}
|
|
611
636
|
break;
|
|
612
637
|
case 'insert-image':
|
|
613
638
|
this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
|
|
@@ -813,7 +838,7 @@ var Image = /** @class */ (function () {
|
|
|
813
838
|
var target = args.target;
|
|
814
839
|
this.contentModule = this.rendererFactory.getRenderer(RenderType.Content);
|
|
815
840
|
var isPopupOpen = this.quickToolObj.imageQTBar.element.classList.contains('e-rte-pop');
|
|
816
|
-
if (target.nodeName === 'IMG' && this.parent.quickToolbarModule
|
|
841
|
+
if (target.nodeName === 'IMG' && this.parent.quickToolbarModule) {
|
|
817
842
|
if (isPopupOpen) {
|
|
818
843
|
return;
|
|
819
844
|
}
|
|
@@ -1054,6 +1079,9 @@ var Image = /** @class */ (function () {
|
|
|
1054
1079
|
Image.prototype.imageRemovePost = function (src) {
|
|
1055
1080
|
var proxy = this;
|
|
1056
1081
|
var absoluteUrl = '';
|
|
1082
|
+
if (isNOU(this.parent.insertImageSettings.removeUrl) || this.parent.insertImageSettings.removeUrl === '') {
|
|
1083
|
+
return;
|
|
1084
|
+
}
|
|
1057
1085
|
if (src.indexOf('http://') > -1 || src.indexOf('https://') > -1) {
|
|
1058
1086
|
absoluteUrl = src;
|
|
1059
1087
|
}
|
|
@@ -1899,6 +1927,7 @@ var Image = /** @class */ (function () {
|
|
|
1899
1927
|
imageTag.addEventListener('load', function () {
|
|
1900
1928
|
_this.parent.trigger(events.actionComplete, e);
|
|
1901
1929
|
});
|
|
1930
|
+
detach(parentElement);
|
|
1902
1931
|
};
|
|
1903
1932
|
/**
|
|
1904
1933
|
* Rendering uploader and popup for drag and drop
|
|
@@ -1934,6 +1963,9 @@ var Image = /** @class */ (function () {
|
|
|
1934
1963
|
_this.popupObj.destroy();
|
|
1935
1964
|
detach(_this.popupObj.element);
|
|
1936
1965
|
_this.popupObj = null;
|
|
1966
|
+
if (!_this.parent.inlineMode.enable) {
|
|
1967
|
+
_this.parent.toolbarModule.baseToolbar.toolbarObj.disable(false);
|
|
1968
|
+
}
|
|
1937
1969
|
}
|
|
1938
1970
|
});
|
|
1939
1971
|
this.popupObj.element.style.display = 'none';
|
|
@@ -1965,6 +1997,10 @@ var Image = /** @class */ (function () {
|
|
|
1965
1997
|
isUploading = false;
|
|
1966
1998
|
detach(imageElement);
|
|
1967
1999
|
_this.popupObj.close();
|
|
2000
|
+
_this.quickToolObj.imageQTBar.hidePopup();
|
|
2001
|
+
setTimeout(function () {
|
|
2002
|
+
_this.uploadObj.destroy();
|
|
2003
|
+
}, 900);
|
|
1968
2004
|
},
|
|
1969
2005
|
beforeUpload: function (args) {
|
|
1970
2006
|
if (_this.parent.isServerRendered) {
|
|
@@ -1976,6 +2012,9 @@ var Image = /** @class */ (function () {
|
|
|
1976
2012
|
if (beforeUploadArgs.cancel) {
|
|
1977
2013
|
return;
|
|
1978
2014
|
}
|
|
2015
|
+
if (!_this.parent.inlineMode.enable) {
|
|
2016
|
+
_this.parent.toolbarModule.baseToolbar.toolbarObj.disable(true);
|
|
2017
|
+
}
|
|
1979
2018
|
/* eslint-disable */
|
|
1980
2019
|
_this.uploadObj.currentRequestHeader = beforeUploadArgs.currentRequest ?
|
|
1981
2020
|
beforeUploadArgs.currentRequest : _this.uploadObj.currentRequestHeader;
|
|
@@ -1988,6 +2027,9 @@ var Image = /** @class */ (function () {
|
|
|
1988
2027
|
}
|
|
1989
2028
|
else {
|
|
1990
2029
|
_this.parent.trigger(events.beforeImageUpload, args);
|
|
2030
|
+
if (!_this.parent.inlineMode.enable) {
|
|
2031
|
+
_this.parent.toolbarModule.baseToolbar.toolbarObj.disable(true);
|
|
2032
|
+
}
|
|
1991
2033
|
}
|
|
1992
2034
|
},
|
|
1993
2035
|
uploading: function (e) {
|
|
@@ -2030,6 +2072,9 @@ var Image = /** @class */ (function () {
|
|
|
2030
2072
|
}, 900);
|
|
2031
2073
|
},
|
|
2032
2074
|
success: function (e) {
|
|
2075
|
+
if (e.operation === "cancel") {
|
|
2076
|
+
return;
|
|
2077
|
+
}
|
|
2033
2078
|
isUploading = false;
|
|
2034
2079
|
_this.parent.inputElement.contentEditable = 'true';
|
|
2035
2080
|
var args = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addClass, Browser, removeClass, EventHandler, formatUnit, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
1
|
+
import { addClass, Browser, removeClass, EventHandler, formatUnit, isNullOrUndefined, isNullOrUndefined as isNOU } from '@syncfusion/ej2-base';
|
|
2
2
|
import { getInstance, closest, selectAll, detach } from '@syncfusion/ej2-base';
|
|
3
3
|
import { Toolbar } from '@syncfusion/ej2-navigations';
|
|
4
4
|
import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
|
@@ -62,7 +62,8 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
62
62
|
this.parent.notify(events.beforeDropDownItemRender, args);
|
|
63
63
|
};
|
|
64
64
|
ToolbarRenderer.prototype.dropDownOpen = function (args) {
|
|
65
|
-
if (args.element.parentElement.getAttribute('id').indexOf('TableCell') > -1)
|
|
65
|
+
if (args.element.parentElement.getAttribute('id').indexOf('TableCell') > -1 && !isNOU(args.element.parentElement.querySelector('.e-cell-merge')) &&
|
|
66
|
+
(!isNOU(args.element.parentElement.querySelector('.e-cell-horizontal-split')) || !isNOU(args.element.parentElement.querySelector('.e-cell-vertical-split')))) {
|
|
66
67
|
var listEle = args.element.querySelectorAll('li');
|
|
67
68
|
if (this.parent.inputElement.querySelectorAll('.e-cell-select').length === 1) {
|
|
68
69
|
addClass([listEle[0]], 'e-disabled');
|
|
@@ -116,7 +116,8 @@ var NodeSelection = /** @class */ (function () {
|
|
|
116
116
|
|| range.startContainer;
|
|
117
117
|
var endNode = range.endContainer.childNodes[(range.endOffset > 0) ? (range.endOffset - 1) : range.endOffset]
|
|
118
118
|
|| range.endContainer;
|
|
119
|
-
if (startNode === endNode && startNode.childNodes.
|
|
119
|
+
if ((startNode === endNode || (startNode.nodeName === 'BR' && startNode === range.endContainer.childNodes[range.endOffset])) &&
|
|
120
|
+
startNode.childNodes.length === 0) {
|
|
120
121
|
return [startNode];
|
|
121
122
|
}
|
|
122
123
|
if (range.startOffset === range.endOffset && range.startOffset !== 0 && range.startContainer.nodeName === 'PRE') {
|
|
@@ -1324,6 +1324,10 @@
|
|
|
1324
1324
|
margin-top: 0;
|
|
1325
1325
|
}
|
|
1326
1326
|
|
|
1327
|
+
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-file-abort-btn.e-icons {
|
|
1328
|
+
margin-right: 30px;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1327
1331
|
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-upload-file-list {
|
|
1328
1332
|
border-bottom: 0 solid transparent;
|
|
1329
1333
|
min-height: initial;
|
package/styles/bootstrap.css
CHANGED
|
@@ -1470,6 +1470,10 @@
|
|
|
1470
1470
|
margin-top: 0;
|
|
1471
1471
|
}
|
|
1472
1472
|
|
|
1473
|
+
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-file-abort-btn.e-icons {
|
|
1474
|
+
margin-right: 30px;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1473
1477
|
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-upload-file-list {
|
|
1474
1478
|
border-bottom: 0 solid transparent;
|
|
1475
1479
|
min-height: initial;
|
package/styles/bootstrap4.css
CHANGED
|
@@ -1603,6 +1603,10 @@
|
|
|
1603
1603
|
margin-top: 0;
|
|
1604
1604
|
}
|
|
1605
1605
|
|
|
1606
|
+
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-file-abort-btn.e-icons {
|
|
1607
|
+
margin-right: 30px;
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1606
1610
|
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-upload-file-list {
|
|
1607
1611
|
border-bottom: 0 solid transparent;
|
|
1608
1612
|
min-height: initial;
|
|
@@ -1320,6 +1320,10 @@
|
|
|
1320
1320
|
margin-top: 0;
|
|
1321
1321
|
}
|
|
1322
1322
|
|
|
1323
|
+
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-file-abort-btn.e-icons {
|
|
1324
|
+
margin-right: 30px;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1323
1327
|
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-upload-file-list {
|
|
1324
1328
|
border-bottom: 0 solid transparent;
|
|
1325
1329
|
min-height: initial;
|
package/styles/bootstrap5.css
CHANGED
|
@@ -1320,6 +1320,10 @@
|
|
|
1320
1320
|
margin-top: 0;
|
|
1321
1321
|
}
|
|
1322
1322
|
|
|
1323
|
+
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-file-abort-btn.e-icons {
|
|
1324
|
+
margin-right: 30px;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1323
1327
|
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-upload-file-list {
|
|
1324
1328
|
border-bottom: 0 solid transparent;
|
|
1325
1329
|
min-height: initial;
|
package/styles/fabric-dark.css
CHANGED
|
@@ -1313,6 +1313,10 @@
|
|
|
1313
1313
|
margin-top: 0;
|
|
1314
1314
|
}
|
|
1315
1315
|
|
|
1316
|
+
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-file-abort-btn.e-icons {
|
|
1317
|
+
margin-right: 30px;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1316
1320
|
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-upload-file-list {
|
|
1317
1321
|
border-bottom: 0 solid transparent;
|
|
1318
1322
|
min-height: initial;
|
package/styles/fabric.css
CHANGED
|
@@ -1313,6 +1313,10 @@
|
|
|
1313
1313
|
margin-top: 0;
|
|
1314
1314
|
}
|
|
1315
1315
|
|
|
1316
|
+
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-file-abort-btn.e-icons {
|
|
1317
|
+
margin-right: 30px;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1316
1320
|
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-upload-file-list {
|
|
1317
1321
|
border-bottom: 0 solid transparent;
|
|
1318
1322
|
min-height: initial;
|
|
@@ -1313,6 +1313,10 @@
|
|
|
1313
1313
|
margin-top: 0;
|
|
1314
1314
|
}
|
|
1315
1315
|
|
|
1316
|
+
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-file-abort-btn.e-icons {
|
|
1317
|
+
margin-right: 30px;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1316
1320
|
.e-richtexteditor .e-img-uploadwrap.e-droparea .e-upload .e-upload-files .e-upload-file-list {
|
|
1317
1321
|
border-bottom: 0 solid transparent;
|
|
1318
1322
|
min-height: initial;
|