@syncfusion/ej2-richtexteditor 20.3.59 → 20.3.61
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/.eslintrc.json +244 -0
- package/CHANGELOG.md +28 -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 +49 -7
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +49 -7
- 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 +7 -7
- package/src/editor-manager/plugin/inserthtml.js +2 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +3 -1
- package/src/editor-manager/plugin/nodecutter.js +1 -0
- package/src/editor-manager/plugin/selection-commands.js +36 -1
- package/src/editor-manager/plugin/toolbar-status.js +1 -1
- package/src/rich-text-editor/actions/enter-key.js +2 -1
- package/src/rich-text-editor/base/rich-text-editor.js +2 -0
- package/src/rich-text-editor/models/items.js +2 -2
- package/tslint.json +111 -0
|
@@ -1971,8 +1971,8 @@ var videoAlignItems = [
|
|
|
1971
1971
|
{ iconCss: 'e-icons e-justify-right', command: 'Videos', subCommand: 'JustifyRight' },
|
|
1972
1972
|
];
|
|
1973
1973
|
var displayLocale = [
|
|
1974
|
-
{ locale: '
|
|
1975
|
-
{ locale: '
|
|
1974
|
+
{ locale: 'imageDisplayDropDownInline', value: 'Inline' },
|
|
1975
|
+
{ locale: 'imageDisplayDropDownBreak', value: 'Break' }
|
|
1976
1976
|
];
|
|
1977
1977
|
var audioLayoutOptionLocale = [
|
|
1978
1978
|
{ locale: 'audioLayoutOptionDropDownInline', value: 'Inline' },
|
|
@@ -12192,6 +12192,7 @@ var NodeCutter = /** @__PURE__ @class */ (function () {
|
|
|
12192
12192
|
for (var i = 0; !isNullOrUndefined(firstChild.childNodes) && i < firstChild.childNodes.length; i++) {
|
|
12193
12193
|
if (firstChild.childNodes[i].nodeName === 'IMG' || (firstChild.childNodes[i].nodeName === 'SPAN' &&
|
|
12194
12194
|
(firstChild.childNodes[i].classList.contains('e-video-wrap') ||
|
|
12195
|
+
firstChild.childNodes[i].classList.contains('e-embed-video-wrap') ||
|
|
12195
12196
|
firstChild.childNodes[i].classList.contains('e-audio-wrap')))) {
|
|
12196
12197
|
result = false;
|
|
12197
12198
|
}
|
|
@@ -13058,7 +13059,8 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
13058
13059
|
}
|
|
13059
13060
|
}
|
|
13060
13061
|
else if (currentNode.nodeName === '#text' && !isNullOrUndefined(currentNode.parentElement) &&
|
|
13061
|
-
currentNode.parentElement.nodeName === 'LI' && currentNode.parentElement
|
|
13062
|
+
(currentNode.parentElement.nodeName === 'LI' || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
|
|
13063
|
+
currentNode.parentElement.textContent.trim().length > 0) {
|
|
13062
13064
|
splitedElm = currentNode;
|
|
13063
13065
|
if (currentNode.parentElement.nodeName === 'LI' && !isNullOrUndefined(currentNode.nextSibling) &&
|
|
13064
13066
|
currentNode.nextSibling.nodeName === 'BR') {
|
|
@@ -15684,6 +15686,15 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15684
15686
|
isSubSup = formatNode === null ? false : true;
|
|
15685
15687
|
}
|
|
15686
15688
|
}
|
|
15689
|
+
else if (formatNode.textContent !== nodes[index].textContent && formatNode.nodeName === 'SPAN' && formatNode.style[0] === 'font-size') {
|
|
15690
|
+
var currentParentElem = nodes[index].parentElement.textContent !== nodes[index].textContent ? nodes[index] : nodes[index].parentElement;
|
|
15691
|
+
var isSameTextContent = true;
|
|
15692
|
+
while (currentParentElem.textContent !== nodes[index].textContent && nodes[index].style[0] !== format && currentParentElem.nodeName === 'SPAN') {
|
|
15693
|
+
isSameTextContent = currentParentElem.textContent === currentParentElem.parentElement.textContent;
|
|
15694
|
+
currentParentElem = !isNullOrUndefined(currentParentElem.parentElement) && isSameTextContent ? currentParentElem.parentElement : currentParentElem;
|
|
15695
|
+
}
|
|
15696
|
+
formatNode = currentParentElem;
|
|
15697
|
+
}
|
|
15687
15698
|
if (index === 0 && formatNode === null) {
|
|
15688
15699
|
isFormat = true;
|
|
15689
15700
|
}
|
|
@@ -15975,7 +15986,33 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15975
15986
|
liElement.style.textDecoration = 'inherit';
|
|
15976
15987
|
}
|
|
15977
15988
|
}
|
|
15978
|
-
|
|
15989
|
+
var enterType = isNullOrUndefined(this.enterAction) ? 'P' : this.enterAction.toString();
|
|
15990
|
+
var currentNode = nodes[index];
|
|
15991
|
+
var isNestedNode = !isNullOrUndefined(currentNode) && nodes[index].nodeName === '#text' && nodes[index].parentElement.nodeName !== enterType;
|
|
15992
|
+
var currentParentElem = currentNode.parentElement.textContent !== currentNode.textContent ? currentNode : currentNode.parentElement;
|
|
15993
|
+
if (isNestedNode) {
|
|
15994
|
+
var isSameTextContent = true;
|
|
15995
|
+
isNestedNode = false;
|
|
15996
|
+
while (!isNullOrUndefined(currentParentElem) && isSameTextContent && currentParentElem.parentElement.nodeName !== enterType
|
|
15997
|
+
&& (currentParentElem.nodeName === 'SPAN' && (currentParentElem.style.textDecoration === 'line-through' || 'underline')
|
|
15998
|
+
|| currentParentElem.nodeName === 'SPAN' && (currentParentElem.style[0] === 'background-color' || 'font-family' || 'color')
|
|
15999
|
+
|| (currentParentElem.nodeName === 'EM' || 'STRONG' || 'SUB' || 'SUP'))) {
|
|
16000
|
+
isSameTextContent = currentParentElem.textContent === currentParentElem.parentElement.textContent;
|
|
16001
|
+
currentParentElem = !isNullOrUndefined(currentParentElem.parentElement) && isSameTextContent ? currentParentElem.parentElement : currentParentElem;
|
|
16002
|
+
}
|
|
16003
|
+
if (!isNullOrUndefined(currentParentElem) && currentParentElem.childNodes.length > 0) {
|
|
16004
|
+
var nodeList = currentParentElem.querySelectorAll('span,strong,em,sub,sup');
|
|
16005
|
+
isNestedNode = nodeList.length > 0 && isSameTextContent;
|
|
16006
|
+
}
|
|
16007
|
+
}
|
|
16008
|
+
if (isNestedNode) {
|
|
16009
|
+
var nodeList = [];
|
|
16010
|
+
nodeList[0] = currentParentElem;
|
|
16011
|
+
this.applyStyles(nodeList, index, element);
|
|
16012
|
+
}
|
|
16013
|
+
else {
|
|
16014
|
+
nodes[index] = this.applyStyles(nodes, index, element);
|
|
16015
|
+
}
|
|
15979
16016
|
if (format === 'fontsize') {
|
|
15980
16017
|
var bg = closest(nodes[index].parentElement, 'span[style*=' + 'background-color' + ']');
|
|
15981
16018
|
if (!isNullOrUndefined(bg)) {
|
|
@@ -16944,7 +16981,9 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16944
16981
|
for (var i = 0; i < allElements.length; i++) {
|
|
16945
16982
|
if (allElements[i].children.length === 0 && allElements[i].innerHTML === ' ' &&
|
|
16946
16983
|
(allElements[i].innerHTML === ' ' && !allElements[i].closest('li')) &&
|
|
16947
|
-
!allElements[i].closest('td')
|
|
16984
|
+
!allElements[i].closest('td') && (allElements[i].nodeName !== 'SPAN' ||
|
|
16985
|
+
allElements[i].nodeName === 'SPAN' && (isNullOrUndefined(allElements[i].previousElementSibling) &&
|
|
16986
|
+
isNullOrUndefined(allElements[i].nextElementSibling)))) {
|
|
16948
16987
|
var detachableElement = this.findDetachElem(allElements[i]);
|
|
16949
16988
|
var brElement = createElement('br');
|
|
16950
16989
|
if (!isNullOrUndefined(detachableElement.parentElement)) {
|
|
@@ -17908,7 +17947,7 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
17908
17947
|
&& (fontName === null || fontName === undefined || (fontName.filter(function (value, pos) {
|
|
17909
17948
|
var pattern = new RegExp(name, 'i');
|
|
17910
17949
|
if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
|
|
17911
|
-
(value.search(pattern) > -1)) {
|
|
17950
|
+
(value.split(',')[0] && value.split(',')[0].search(pattern) > -1)) {
|
|
17912
17951
|
index = pos;
|
|
17913
17952
|
}
|
|
17914
17953
|
}) && (index !== null)))) {
|
|
@@ -28601,7 +28640,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28601
28640
|
}
|
|
28602
28641
|
else {
|
|
28603
28642
|
if ((nearBlockNode.textContent.trim().length !== 0 ||
|
|
28604
|
-
nearBlockNode.childNodes[0].nodeName === 'IMG'
|
|
28643
|
+
nearBlockNode.childNodes[0].nodeName === 'IMG' ||
|
|
28644
|
+
(nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img').length > 0))) {
|
|
28605
28645
|
if ((_this.range.startOffset === _this.range.endOffset && _this.range.startOffset != 0)) {
|
|
28606
28646
|
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
|
|
28607
28647
|
}
|
|
@@ -30260,9 +30300,11 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30260
30300
|
this.notify(rtlMode, { enableRtl: this.enableRtl });
|
|
30261
30301
|
if (this.enableRtl) {
|
|
30262
30302
|
this.element.classList.add(CLS_RTL);
|
|
30303
|
+
this.inputElement.classList.add(CLS_RTL);
|
|
30263
30304
|
}
|
|
30264
30305
|
else {
|
|
30265
30306
|
this.element.classList.remove(CLS_RTL);
|
|
30307
|
+
this.inputElement.classList.remove(CLS_RTL);
|
|
30266
30308
|
}
|
|
30267
30309
|
};
|
|
30268
30310
|
RichTextEditor.prototype.updateReadOnly = function () {
|