@syncfusion/ej2-richtexteditor 19.4.53 → 19.4.54
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 +20 -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 +55 -3
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +55 -3
- 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 +5 -5
- package/src/editor-manager/plugin/inserthtml.js +1 -1
- package/src/rich-text-editor/actions/enter-key.d.ts +1 -0
- package/src/rich-text-editor/actions/enter-key.js +10 -1
- package/src/rich-text-editor/actions/html-editor.d.ts +1 -0
- package/src/rich-text-editor/actions/html-editor.js +13 -2
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +1 -0
- package/src/rich-text-editor/actions/paste-clean-up.js +8 -0
- package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -0
- package/src/rich-text-editor/base/rich-text-editor.js +24 -0
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 19.4.
|
|
3
|
+
* version : 19.4.54
|
|
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.4.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@19.4.53",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-wTMXB43eT3dngxxLXS+5BzGvEwh5tZOHKUd+5lLXgD0eWrFWAljm79JdfitOb89dyPBUGVHvbEcYbentqdKbgg==",
|
|
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-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-19.4.
|
|
30
|
-
"_shasum": "
|
|
29
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-19.4.53.tgz",
|
|
30
|
+
"_shasum": "f7a93f74a7396e02d0f4694f12c06a20e088ae84",
|
|
31
31
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
32
32
|
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
|
|
33
33
|
"author": {
|
|
@@ -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.4.
|
|
73
|
+
"version": "19.4.54",
|
|
74
74
|
"sideEffects": false
|
|
75
75
|
}
|
|
@@ -374,7 +374,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
374
374
|
var currentNode = nodes[nodes.length - 1];
|
|
375
375
|
var splitedElm = void 0;
|
|
376
376
|
if ((currentNode.nodeName === 'BR' || currentNode.nodeName === 'HR') && !isNOU(currentNode.parentElement) &&
|
|
377
|
-
currentNode.parentElement.textContent.trim().length === 0 && !node.classList.contains('pasteContent')) {
|
|
377
|
+
currentNode.parentElement.textContent.trim().length === 0 && (currentNode.parentElement === editNode || !node.classList.contains('pasteContent'))) {
|
|
378
378
|
splitedElm = currentNode;
|
|
379
379
|
}
|
|
380
380
|
else {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isNullOrUndefined as isNOU, detach } from '@syncfusion/ej2-base';
|
|
1
|
+
import { isNullOrUndefined as isNOU, detach, Browser } from '@syncfusion/ej2-base';
|
|
2
2
|
import * as events from '../base/constant';
|
|
3
3
|
/**
|
|
4
4
|
* `EnterKey` module is used to handle enter key press actions.
|
|
@@ -123,6 +123,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
123
123
|
else if (_this.range.startOffset === 0 && _this.range.endOffset === 0) {
|
|
124
124
|
isFocusedFirst = true;
|
|
125
125
|
}
|
|
126
|
+
_this.removeBRElement(nearBlockNode);
|
|
126
127
|
if (((_this.range.startOffset === 0 && _this.range.endOffset === 0) || isFocusedFirst) &&
|
|
127
128
|
!(!isNOU(_this.range.startContainer.previousSibling) &&
|
|
128
129
|
(_this.range.startContainer.previousSibling.nodeName === 'IMG' || _this.range.startContainer.previousSibling.nodeName === 'BR'))) {
|
|
@@ -226,6 +227,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
226
227
|
else {
|
|
227
228
|
currentParent = _this.startNode;
|
|
228
229
|
}
|
|
230
|
+
_this.removeBRElement(currentParent);
|
|
229
231
|
var isEmptyBrInserted = false;
|
|
230
232
|
var currentParentLastChild = currentParent.lastChild;
|
|
231
233
|
while (!isNOU(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text' || currentParentLastChild.nodeName === 'BR')) {
|
|
@@ -288,6 +290,13 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
288
290
|
}
|
|
289
291
|
}
|
|
290
292
|
};
|
|
293
|
+
EnterKeyAction.prototype.removeBRElement = function (currentElement) {
|
|
294
|
+
if (Browser.userAgent.indexOf('Firefox') != -1 &&
|
|
295
|
+
this.range.endOffset === currentElement.textContent.length &&
|
|
296
|
+
currentElement.lastChild.nodeName === 'BR') {
|
|
297
|
+
detach(currentElement.lastChild);
|
|
298
|
+
}
|
|
299
|
+
};
|
|
291
300
|
EnterKeyAction.prototype.insertBRElement = function () {
|
|
292
301
|
var isEmptyBrInserted = false;
|
|
293
302
|
var brElm = this.parent.createElement('br');
|
|
@@ -18,6 +18,7 @@ export declare class HtmlEditor {
|
|
|
18
18
|
private oldRangeElement;
|
|
19
19
|
private deleteRangeElement;
|
|
20
20
|
private deleteOldRangeElement;
|
|
21
|
+
private isImageDelete;
|
|
21
22
|
private saveSelection;
|
|
22
23
|
xhtmlValidation: XhtmlValidation;
|
|
23
24
|
constructor(parent?: IRichTextEditor, serviceLocator?: ServiceLocator);
|
|
@@ -20,6 +20,7 @@ import { ON_BEGIN } from './../../common/constant';
|
|
|
20
20
|
var HtmlEditor = /** @class */ (function () {
|
|
21
21
|
function HtmlEditor(parent, serviceLocator) {
|
|
22
22
|
this.rangeCollection = [];
|
|
23
|
+
this.isImageDelete = false;
|
|
23
24
|
this.parent = parent;
|
|
24
25
|
this.locator = serviceLocator;
|
|
25
26
|
this.renderFactory = this.locator.getService('rendererFactory');
|
|
@@ -193,7 +194,9 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
193
194
|
this.oldRangeElement = null;
|
|
194
195
|
this.deleteRangeElement = null;
|
|
195
196
|
this.deleteOldRangeElement = null;
|
|
196
|
-
|
|
197
|
+
if (!this.isImageDelete) {
|
|
198
|
+
args.preventDefault();
|
|
199
|
+
}
|
|
197
200
|
}
|
|
198
201
|
};
|
|
199
202
|
HtmlEditor.prototype.isOrderedList = function (editorValue) {
|
|
@@ -317,7 +320,15 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
317
320
|
return;
|
|
318
321
|
}
|
|
319
322
|
else {
|
|
320
|
-
|
|
323
|
+
if (currentRange.startOffset === 0 && currentRange.endOffset === 1 &&
|
|
324
|
+
this.deleteRangeElement.childNodes[0].nodeName === 'IMG') {
|
|
325
|
+
this.parent.formatter.editorManager.nodeSelection.setSelectionText(this.parent.contentModule.getDocument(), this.deleteRangeElement, this.deleteRangeElement, 0, 1);
|
|
326
|
+
this.isImageDelete = true;
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.deleteRangeElement, this.deleteRangeElement.childNodes.length);
|
|
330
|
+
this.isImageDelete = false;
|
|
331
|
+
}
|
|
321
332
|
if (this.deleteRangeElement.querySelector('BR')) {
|
|
322
333
|
detach(this.deleteRangeElement.querySelector('BR'));
|
|
323
334
|
}
|
|
@@ -212,6 +212,11 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
};
|
|
215
|
+
PasteCleanup.prototype.toolbarEnableDisable = function (state) {
|
|
216
|
+
if (!this.parent.inlineMode.enable) {
|
|
217
|
+
this.parent.toolbarModule.baseToolbar.toolbarObj.disable(state);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
215
220
|
PasteCleanup.prototype.uploadMethod = function (fileList, imgElem) {
|
|
216
221
|
var _this = this;
|
|
217
222
|
var uploadEle = document.createElement('div');
|
|
@@ -288,6 +293,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
288
293
|
if (beforeUploadArgs.cancel) {
|
|
289
294
|
return;
|
|
290
295
|
}
|
|
296
|
+
_this.toolbarEnableDisable(true);
|
|
291
297
|
/* eslint-disable */
|
|
292
298
|
uploadObj.currentRequestHeader = beforeUploadArgs.currentRequest ?
|
|
293
299
|
beforeUploadArgs.currentRequest : uploadObj.currentRequestHeader;
|
|
@@ -299,6 +305,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
299
305
|
}
|
|
300
306
|
else {
|
|
301
307
|
_this.parent.trigger(events.beforeImageUpload, args);
|
|
308
|
+
_this.toolbarEnableDisable(true);
|
|
302
309
|
}
|
|
303
310
|
},
|
|
304
311
|
// eslint-disable-next-line
|
|
@@ -371,6 +378,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
371
378
|
popupObj.close();
|
|
372
379
|
imgElem.style.opacity = '1';
|
|
373
380
|
uploadObj.destroy();
|
|
381
|
+
this.toolbarEnableDisable(false);
|
|
374
382
|
};
|
|
375
383
|
PasteCleanup.prototype.refreshPopup = function (imageElement, popupObj) {
|
|
376
384
|
var imgPosition = this.parent.iframeSettings.enable ? this.parent.element.offsetTop +
|
|
@@ -1059,6 +1059,7 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
1059
1059
|
* @hidden
|
|
1060
1060
|
*/
|
|
1061
1061
|
protected eventInitializer(): void;
|
|
1062
|
+
cleanList(e: KeyboardEvent): void;
|
|
1062
1063
|
/**
|
|
1063
1064
|
* For internal use only - keydown the event handler;
|
|
1064
1065
|
*
|
|
@@ -463,6 +463,27 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
463
463
|
RichTextEditor.prototype.eventInitializer = function () {
|
|
464
464
|
this.wireEvents();
|
|
465
465
|
};
|
|
466
|
+
RichTextEditor.prototype.cleanList = function (e) {
|
|
467
|
+
var range = this.getRange();
|
|
468
|
+
var currentStartContainer = range.startContainer;
|
|
469
|
+
var currentEndContainer = range.endContainer;
|
|
470
|
+
var currentStartOffset = range.startOffset;
|
|
471
|
+
var isSameContainer = currentStartContainer === currentEndContainer ? true : false;
|
|
472
|
+
var currentEndOffset;
|
|
473
|
+
var endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
|
|
474
|
+
range.endContainer;
|
|
475
|
+
var closestLI = closest(endNode, 'LI');
|
|
476
|
+
if (!isNOU(closestLI) && endNode.textContent.length === range.endOffset &&
|
|
477
|
+
!range.collapsed) {
|
|
478
|
+
closestLI.textContent = closestLI.textContent.trim();
|
|
479
|
+
currentEndOffset = closestLI.textContent.length - 1;
|
|
480
|
+
var currentLastElem = closestLI;
|
|
481
|
+
while (currentLastElem.nodeName !== '#text') {
|
|
482
|
+
currentLastElem = currentLastElem.lastChild;
|
|
483
|
+
}
|
|
484
|
+
this.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), isSameContainer ? currentLastElem : currentStartContainer, currentLastElem, currentStartOffset, currentLastElem.textContent.length);
|
|
485
|
+
}
|
|
486
|
+
};
|
|
466
487
|
/**
|
|
467
488
|
* For internal use only - keydown the event handler;
|
|
468
489
|
*
|
|
@@ -475,6 +496,9 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
475
496
|
RichTextEditor.prototype.keyDown = function (e) {
|
|
476
497
|
this.notify(events.keyDown, { member: 'keydown', args: e });
|
|
477
498
|
this.restrict(e);
|
|
499
|
+
if (this.editorMode === 'HTML') {
|
|
500
|
+
this.cleanList(e);
|
|
501
|
+
}
|
|
478
502
|
if (this.editorMode === 'HTML' && ((e.which === 8 && e.code === 'Backspace') || (e.which === 46 && e.code === 'Delete'))) {
|
|
479
503
|
var range = this.getRange();
|
|
480
504
|
var startNode = range.startContainer.nodeName === '#text' ? range.startContainer.parentElement :
|