@syncfusion/ej2-richtexteditor 19.4.47 → 19.4.53
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 +22 -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 +33 -25
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +33 -25
- 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 +3 -2
- package/src/rich-text-editor/actions/enter-key.js +9 -4
- package/src/rich-text-editor/actions/html-editor.js +1 -1
- package/src/rich-text-editor/base/rich-text-editor.js +1 -1
- package/src/rich-text-editor/renderer/image-module.js +19 -17
|
@@ -12133,8 +12133,9 @@ class InsertHtml {
|
|
|
12133
12133
|
}
|
|
12134
12134
|
static getNodeCollection(range, nodeSelection, node) {
|
|
12135
12135
|
let nodes = [];
|
|
12136
|
-
if (range.startOffset === range.endOffset && range.startContainer === range.endContainer
|
|
12137
|
-
|
|
12136
|
+
if (range.startOffset === range.endOffset && range.startContainer === range.endContainer &&
|
|
12137
|
+
range.startContainer.nodeName != 'BR' &&
|
|
12138
|
+
(range.startContainer.nodeName === 'TD' || (range.startContainer.nodeType !== 3 &&
|
|
12138
12139
|
node.classList && node.classList.contains('pasteContent')))) {
|
|
12139
12140
|
nodes.push(range.startContainer.childNodes[range.endOffset]);
|
|
12140
12141
|
}
|
|
@@ -17347,7 +17348,7 @@ class HtmlEditor {
|
|
|
17347
17348
|
if (liElement.previousElementSibling && liElement.previousElementSibling.childElementCount > 0) {
|
|
17348
17349
|
this.oldRangeElement = liElement.previousElementSibling.lastElementChild.nodeName === 'BR' ?
|
|
17349
17350
|
liElement.previousElementSibling : liElement.previousElementSibling.lastElementChild;
|
|
17350
|
-
if (!isNullOrUndefined(liElement.lastElementChild)) {
|
|
17351
|
+
if (!isNullOrUndefined(liElement.lastElementChild) && liElement.lastElementChild.nodeName !== 'BR') {
|
|
17351
17352
|
this.rangeElement = liElement.lastElementChild;
|
|
17352
17353
|
isLiElement = true;
|
|
17353
17354
|
}
|
|
@@ -20451,26 +20452,28 @@ class Image {
|
|
|
20451
20452
|
const src = this.deletedImg[i].src;
|
|
20452
20453
|
this.imageRemovePost(src);
|
|
20453
20454
|
}
|
|
20454
|
-
if (
|
|
20455
|
-
if (
|
|
20456
|
-
if (
|
|
20457
|
-
range.startContainer.previousElementSibling.
|
|
20458
|
-
|
|
20459
|
-
|
|
20455
|
+
if (this.parent.editorMode !== 'Markdown') {
|
|
20456
|
+
if (range.startContainer.nodeType === 3) {
|
|
20457
|
+
if (originalEvent.code === 'Backspace') {
|
|
20458
|
+
if (range.startContainer.previousElementSibling && range.startOffset === 0 &&
|
|
20459
|
+
range.startContainer.previousElementSibling.classList.contains(CLS_CAPTION) &&
|
|
20460
|
+
range.startContainer.previousElementSibling.classList.contains(CLS_CAPINLINE)) {
|
|
20461
|
+
detach(range.startContainer.previousElementSibling);
|
|
20462
|
+
}
|
|
20460
20463
|
}
|
|
20461
|
-
|
|
20462
|
-
|
|
20463
|
-
|
|
20464
|
-
|
|
20465
|
-
|
|
20466
|
-
|
|
20467
|
-
|
|
20464
|
+
else {
|
|
20465
|
+
if (range.startContainer.nextElementSibling &&
|
|
20466
|
+
range.endContainer.textContent.length === range.endOffset &&
|
|
20467
|
+
range.startContainer.nextElementSibling.classList.contains(CLS_CAPTION) &&
|
|
20468
|
+
range.startContainer.nextElementSibling.classList.contains(CLS_CAPINLINE)) {
|
|
20469
|
+
detach(range.startContainer.nextElementSibling);
|
|
20470
|
+
}
|
|
20468
20471
|
}
|
|
20469
20472
|
}
|
|
20470
|
-
|
|
20471
|
-
|
|
20472
|
-
|
|
20473
|
-
|
|
20473
|
+
else if ((range.startContainer.nodeType === 1 &&
|
|
20474
|
+
range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_CAPINLINE))) {
|
|
20475
|
+
detach(range.startContainer.querySelector('.' + CLS_CAPTION + '.' + CLS_CAPINLINE));
|
|
20476
|
+
}
|
|
20474
20477
|
}
|
|
20475
20478
|
break;
|
|
20476
20479
|
case 'insert-image':
|
|
@@ -24338,7 +24341,7 @@ class EnterKeyAction {
|
|
|
24338
24341
|
currentParent = this.startNode;
|
|
24339
24342
|
}
|
|
24340
24343
|
let currentParentLastChild = currentParent.lastChild;
|
|
24341
|
-
while (!isNullOrUndefined(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text')) {
|
|
24344
|
+
while (!isNullOrUndefined(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text' || currentParentLastChild.nodeName === 'BR')) {
|
|
24342
24345
|
currentParentLastChild = currentParentLastChild.lastChild;
|
|
24343
24346
|
}
|
|
24344
24347
|
const isLastNodeLength = this.range.startContainer === currentParentLastChild ?
|
|
@@ -24348,9 +24351,14 @@ class EnterKeyAction {
|
|
|
24348
24351
|
this.range.startOffset === this.range.endOffset &&
|
|
24349
24352
|
this.range.startOffset === isLastNodeLength) {
|
|
24350
24353
|
const focusBRElem = this.parent.createElement('br');
|
|
24351
|
-
|
|
24352
|
-
|
|
24353
|
-
|
|
24354
|
+
if (currentParentLastChild.nodeName === 'BR' && currentParent.textContent.length === 0) {
|
|
24355
|
+
this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, currentParentLastChild);
|
|
24356
|
+
}
|
|
24357
|
+
else {
|
|
24358
|
+
const lineBreakBRElem = this.parent.createElement('br');
|
|
24359
|
+
this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, this.range.startContainer);
|
|
24360
|
+
this.parent.formatter.editorManager.domNode.insertAfter(lineBreakBRElem, this.range.startContainer);
|
|
24361
|
+
}
|
|
24354
24362
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), focusBRElem, 0);
|
|
24355
24363
|
}
|
|
24356
24364
|
else if (!isNullOrUndefined(currentParent) && currentParent !== this.parent.inputElement && currentParent.nodeName !== 'BR') {
|
|
@@ -25372,7 +25380,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
25372
25380
|
break;
|
|
25373
25381
|
case 'width':
|
|
25374
25382
|
this.setWidth(newProp[prop]);
|
|
25375
|
-
if (this.toolbarSettings.enable) {
|
|
25383
|
+
if (this.toolbarSettings.enable && !this.inlineMode.enable) {
|
|
25376
25384
|
this.toolbarModule.refreshToolbarOverflow();
|
|
25377
25385
|
this.resizeHandler();
|
|
25378
25386
|
}
|