@syncfusion/ej2-richtexteditor 20.3.56 → 20.3.60
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 +24 -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 +59 -10
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +59 -10
- 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/plugin/inserthtml.js +2 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +4 -3
- package/src/editor-manager/plugin/selection-commands.js +36 -1
- package/src/rich-text-editor/actions/enter-key.js +10 -3
- package/src/rich-text-editor/actions/html-editor.js +5 -0
- package/src/rich-text-editor/models/items.js +2 -2
- package/styles/bootstrap-dark.css +1 -1
- package/styles/bootstrap.css +1 -1
- package/styles/bootstrap4.css +1 -1
- package/styles/bootstrap5-dark.css +1 -1
- package/styles/bootstrap5.css +1 -1
- package/styles/fabric-dark.css +1 -1
- package/styles/fabric.css +1 -1
- package/styles/fluent-dark.css +1 -1
- package/styles/fluent.css +1 -1
- package/styles/highcontrast-light.css +1 -1
- package/styles/highcontrast.css +1 -1
- package/styles/material-dark.css +1 -1
- package/styles/material.css +1 -1
- package/styles/rich-text-editor/bootstrap-dark.css +1 -1
- package/styles/rich-text-editor/bootstrap.css +1 -1
- package/styles/rich-text-editor/bootstrap4.css +1 -1
- package/styles/rich-text-editor/bootstrap5-dark.css +1 -1
- package/styles/rich-text-editor/bootstrap5.css +1 -1
- package/styles/rich-text-editor/fabric-dark.css +1 -1
- package/styles/rich-text-editor/fabric.css +1 -1
- package/styles/rich-text-editor/fluent-dark.css +1 -1
- package/styles/rich-text-editor/fluent.css +1 -1
- package/styles/rich-text-editor/highcontrast-light.css +1 -1
- package/styles/rich-text-editor/highcontrast.css +1 -1
- package/styles/rich-text-editor/material-dark.css +1 -1
- package/styles/rich-text-editor/material.css +1 -1
- package/styles/rich-text-editor/tailwind-dark.css +1 -1
- package/styles/rich-text-editor/tailwind.css +1 -1
- package/styles/tailwind-dark.css +1 -1
- package/styles/tailwind.css +1 -1
|
@@ -1978,8 +1978,8 @@ let videoAlignItems = [
|
|
|
1978
1978
|
{ iconCss: 'e-icons e-justify-right', command: 'Videos', subCommand: 'JustifyRight' },
|
|
1979
1979
|
];
|
|
1980
1980
|
let displayLocale = [
|
|
1981
|
-
{ locale: '
|
|
1982
|
-
{ locale: '
|
|
1981
|
+
{ locale: 'imageDisplayDropDownInline', value: 'Inline' },
|
|
1982
|
+
{ locale: 'imageDisplayDropDownBreak', value: 'Break' }
|
|
1983
1983
|
];
|
|
1984
1984
|
let audioLayoutOptionLocale = [
|
|
1985
1985
|
{ locale: 'audioLayoutOptionDropDownInline', value: 'Inline' },
|
|
@@ -12960,7 +12960,8 @@ class InsertHtml {
|
|
|
12960
12960
|
}
|
|
12961
12961
|
}
|
|
12962
12962
|
else if (currentNode.nodeName === '#text' && !isNullOrUndefined(currentNode.parentElement) &&
|
|
12963
|
-
currentNode.parentElement.nodeName === 'LI' && currentNode.parentElement
|
|
12963
|
+
(currentNode.parentElement.nodeName === 'LI' || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
|
|
12964
|
+
currentNode.parentElement.textContent.trim().length > 0) {
|
|
12964
12965
|
splitedElm = currentNode;
|
|
12965
12966
|
if (currentNode.parentElement.nodeName === 'LI' && !isNullOrUndefined(currentNode.nextSibling) &&
|
|
12966
12967
|
currentNode.nextSibling.nodeName === 'BR') {
|
|
@@ -15567,6 +15568,15 @@ class SelectionCommands {
|
|
|
15567
15568
|
isSubSup = formatNode === null ? false : true;
|
|
15568
15569
|
}
|
|
15569
15570
|
}
|
|
15571
|
+
else if (formatNode.textContent !== nodes[index].textContent && formatNode.nodeName === 'SPAN' && formatNode.style[0] === 'font-size') {
|
|
15572
|
+
let currentParentElem = nodes[index].parentElement.textContent !== nodes[index].textContent ? nodes[index] : nodes[index].parentElement;
|
|
15573
|
+
let isSameTextContent = true;
|
|
15574
|
+
while (currentParentElem.textContent !== nodes[index].textContent && nodes[index].style[0] !== format && currentParentElem.nodeName === 'SPAN') {
|
|
15575
|
+
isSameTextContent = currentParentElem.textContent === currentParentElem.parentElement.textContent;
|
|
15576
|
+
currentParentElem = !isNullOrUndefined(currentParentElem.parentElement) && isSameTextContent ? currentParentElem.parentElement : currentParentElem;
|
|
15577
|
+
}
|
|
15578
|
+
formatNode = currentParentElem;
|
|
15579
|
+
}
|
|
15570
15580
|
if (index === 0 && formatNode === null) {
|
|
15571
15581
|
isFormat = true;
|
|
15572
15582
|
}
|
|
@@ -15858,7 +15868,33 @@ class SelectionCommands {
|
|
|
15858
15868
|
liElement.style.textDecoration = 'inherit';
|
|
15859
15869
|
}
|
|
15860
15870
|
}
|
|
15861
|
-
|
|
15871
|
+
let enterType = isNullOrUndefined(this.enterAction) ? 'P' : this.enterAction.toString();
|
|
15872
|
+
const currentNode = nodes[index];
|
|
15873
|
+
let isNestedNode = !isNullOrUndefined(currentNode) && nodes[index].nodeName === '#text' && nodes[index].parentElement.nodeName !== enterType;
|
|
15874
|
+
let currentParentElem = currentNode.parentElement.textContent !== currentNode.textContent ? currentNode : currentNode.parentElement;
|
|
15875
|
+
if (isNestedNode) {
|
|
15876
|
+
let isSameTextContent = true;
|
|
15877
|
+
isNestedNode = false;
|
|
15878
|
+
while (!isNullOrUndefined(currentParentElem) && isSameTextContent && currentParentElem.parentElement.nodeName !== enterType
|
|
15879
|
+
&& (currentParentElem.nodeName === 'SPAN' && (currentParentElem.style.textDecoration === 'line-through' || 'underline')
|
|
15880
|
+
|| currentParentElem.nodeName === 'SPAN' && (currentParentElem.style[0] === 'background-color' || 'font-family' || 'color')
|
|
15881
|
+
|| (currentParentElem.nodeName === 'EM' || 'STRONG' || 'SUB' || 'SUP'))) {
|
|
15882
|
+
isSameTextContent = currentParentElem.textContent === currentParentElem.parentElement.textContent;
|
|
15883
|
+
currentParentElem = !isNullOrUndefined(currentParentElem.parentElement) && isSameTextContent ? currentParentElem.parentElement : currentParentElem;
|
|
15884
|
+
}
|
|
15885
|
+
if (!isNullOrUndefined(currentParentElem) && currentParentElem.childNodes.length > 0) {
|
|
15886
|
+
let nodeList = currentParentElem.querySelectorAll('span,strong,em,sub,sup');
|
|
15887
|
+
isNestedNode = nodeList.length > 0 && isSameTextContent;
|
|
15888
|
+
}
|
|
15889
|
+
}
|
|
15890
|
+
if (isNestedNode) {
|
|
15891
|
+
let nodeList = [];
|
|
15892
|
+
nodeList[0] = currentParentElem;
|
|
15893
|
+
this.applyStyles(nodeList, index, element);
|
|
15894
|
+
}
|
|
15895
|
+
else {
|
|
15896
|
+
nodes[index] = this.applyStyles(nodes, index, element);
|
|
15897
|
+
}
|
|
15862
15898
|
if (format === 'fontsize') {
|
|
15863
15899
|
const bg = closest(nodes[index].parentElement, 'span[style*=' + 'background-color' + ']');
|
|
15864
15900
|
if (!isNullOrUndefined(bg)) {
|
|
@@ -16818,7 +16854,9 @@ class MsWordPaste {
|
|
|
16818
16854
|
for (let i = 0; i < allElements.length; i++) {
|
|
16819
16855
|
if (allElements[i].children.length === 0 && allElements[i].innerHTML === ' ' &&
|
|
16820
16856
|
(allElements[i].innerHTML === ' ' && !allElements[i].closest('li')) &&
|
|
16821
|
-
!allElements[i].closest('td')
|
|
16857
|
+
!allElements[i].closest('td') && (allElements[i].nodeName !== 'SPAN' ||
|
|
16858
|
+
allElements[i].nodeName === 'SPAN' && (isNullOrUndefined(allElements[i].previousElementSibling) &&
|
|
16859
|
+
isNullOrUndefined(allElements[i].nextElementSibling)))) {
|
|
16822
16860
|
const detachableElement = this.findDetachElem(allElements[i]);
|
|
16823
16861
|
const brElement = createElement('br');
|
|
16824
16862
|
if (!isNullOrUndefined(detachableElement.parentElement)) {
|
|
@@ -16924,8 +16962,7 @@ class MsWordPaste {
|
|
|
16924
16962
|
}
|
|
16925
16963
|
}
|
|
16926
16964
|
}
|
|
16927
|
-
|
|
16928
|
-
const changedValue = styleProperty + values[i];
|
|
16965
|
+
const changedValue = styleProperty + valueSplit.join(';') + ';';
|
|
16929
16966
|
resultElem[j].setAttribute('style', changedValue);
|
|
16930
16967
|
}
|
|
16931
16968
|
else {
|
|
@@ -18612,6 +18649,11 @@ class HtmlEditor {
|
|
|
18612
18649
|
if (e.args.code === 'Backspace' && e.args.keyCode === 8 && currentRange.startOffset === 0 &&
|
|
18613
18650
|
currentRange.endOffset === 0 && this.parent.getSelection().length === 0 && currentRange.startContainer.textContent.length > 0 &&
|
|
18614
18651
|
currentRange.startContainer.parentElement.tagName !== 'TD' && currentRange.startContainer.parentElement.tagName !== 'TH') {
|
|
18652
|
+
let checkNode = currentRange.startContainer.nodeName === '#text' ? currentRange.startContainer.parentElement : currentRange.startContainer;
|
|
18653
|
+
if (!this.parent.formatter.editorManager.domNode.isBlockNode(checkNode) &&
|
|
18654
|
+
!isNullOrUndefined(checkNode.previousSibling) && checkNode.previousSibling.nodeName === 'BR') {
|
|
18655
|
+
return;
|
|
18656
|
+
}
|
|
18615
18657
|
this.rangeElement = this.getRootBlockNode(currentRange.startContainer);
|
|
18616
18658
|
if (this.rangeElement.tagName === 'OL' || this.rangeElement.tagName === 'UL') {
|
|
18617
18659
|
const liElement = this.getRangeLiNode(currentRange.startContainer);
|
|
@@ -28334,7 +28376,8 @@ class EnterKeyAction {
|
|
|
28334
28376
|
}
|
|
28335
28377
|
else {
|
|
28336
28378
|
if ((nearBlockNode.textContent.trim().length !== 0 ||
|
|
28337
|
-
nearBlockNode.childNodes[0].nodeName === 'IMG'
|
|
28379
|
+
nearBlockNode.childNodes[0].nodeName === 'IMG' ||
|
|
28380
|
+
(nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img').length > 0))) {
|
|
28338
28381
|
if ((this.range.startOffset === this.range.endOffset && this.range.startOffset != 0)) {
|
|
28339
28382
|
newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, false).cloneNode(true);
|
|
28340
28383
|
}
|
|
@@ -28363,9 +28406,15 @@ class EnterKeyAction {
|
|
|
28363
28406
|
if (!isNearBlockLengthZero) {
|
|
28364
28407
|
let currentFocusElem = insertElem;
|
|
28365
28408
|
let finalFocusElem;
|
|
28366
|
-
|
|
28409
|
+
if (this.range.startOffset === this.range.endOffset && this.range.startOffset != 0) {
|
|
28410
|
+
while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text' &&
|
|
28411
|
+
currentFocusElem.nodeName !== 'BR') {
|
|
28412
|
+
finalFocusElem = currentFocusElem;
|
|
28413
|
+
currentFocusElem = currentFocusElem.lastChild;
|
|
28414
|
+
}
|
|
28415
|
+
}
|
|
28416
|
+
else {
|
|
28367
28417
|
finalFocusElem = currentFocusElem;
|
|
28368
|
-
currentFocusElem = currentFocusElem.lastChild;
|
|
28369
28418
|
}
|
|
28370
28419
|
finalFocusElem.innerHTML = '<br>';
|
|
28371
28420
|
if (!isImageNode) {
|