@syncfusion/ej2-richtexteditor 20.4.42 → 20.4.43
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 +14 -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 +58 -41
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +58 -41
- 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 +8 -8
- package/src/editor-manager/plugin/inserthtml.js +48 -38
- package/src/rich-text-editor/actions/html-editor.js +4 -2
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +2 -2
- package/src/rich-text-editor/base/rich-text-editor.d.ts +2 -2
- package/src/rich-text-editor/renderer/image-module.js +4 -0
- package/src/rich-text-editor/renderer/table-module.js +2 -1
|
@@ -12946,52 +12946,62 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
12946
12946
|
}
|
|
12947
12947
|
}
|
|
12948
12948
|
else {
|
|
12949
|
-
|
|
12950
|
-
|
|
12951
|
-
|
|
12952
|
-
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12956
|
-
}
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12949
|
+
var parentElem = range.startContainer;
|
|
12950
|
+
while (!isNullOrUndefined(parentElem) && parentElem.nodeName !== 'PRE' && parentElem !== editNode) {
|
|
12951
|
+
parentElem = parentElem.parentElement;
|
|
12952
|
+
}
|
|
12953
|
+
if (!isNullOrUndefined(node) && !isNullOrUndefined(parentElem) && parentElem.nodeName === 'PRE') {
|
|
12954
|
+
range.insertNode(node);
|
|
12955
|
+
lastSelectionNode = node.lastChild;
|
|
12956
|
+
}
|
|
12957
|
+
else {
|
|
12958
|
+
this.insertTempNode(range, node, nodes, nodeCutter, editNode);
|
|
12959
|
+
var isFirstTextNode = true;
|
|
12960
|
+
var isPreviousInlineElem = void 0;
|
|
12961
|
+
var paraElm = void 0;
|
|
12962
|
+
var previousParent = void 0;
|
|
12963
|
+
if (!this.contentsDeleted) {
|
|
12964
|
+
range.deleteContents();
|
|
12961
12965
|
}
|
|
12962
|
-
|
|
12963
|
-
(
|
|
12964
|
-
|
|
12965
|
-
|
|
12966
|
-
var firstParaElm = createElement('p');
|
|
12967
|
-
node.parentElement.insertBefore(firstParaElm, node);
|
|
12966
|
+
while (node.firstChild) {
|
|
12967
|
+
if (node.firstChild.nodeName === '#text' && node.firstChild.textContent.trim() === '') {
|
|
12968
|
+
detach(node.firstChild);
|
|
12969
|
+
continue;
|
|
12968
12970
|
}
|
|
12969
|
-
|
|
12970
|
-
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
|
|
12975
|
-
if (!isPreviousInlineElem) {
|
|
12976
|
-
paraElm = createElement('p');
|
|
12977
|
-
paraElm.appendChild(node.firstChild);
|
|
12978
|
-
fragment.appendChild(paraElm);
|
|
12971
|
+
if (node.firstChild.nodeName === '#text' && isFirstTextNode ||
|
|
12972
|
+
(this.inlineNode.indexOf(node.firstChild.nodeName.toLocaleLowerCase()) >= 0 && isFirstTextNode)) {
|
|
12973
|
+
lastSelectionNode = node.firstChild;
|
|
12974
|
+
if (isNullOrUndefined(node.previousElementSibling)) {
|
|
12975
|
+
var firstParaElm = createElement('p');
|
|
12976
|
+
node.parentElement.insertBefore(firstParaElm, node);
|
|
12979
12977
|
}
|
|
12980
|
-
|
|
12981
|
-
previousParent.appendChild(node.firstChild);
|
|
12982
|
-
fragment.appendChild(previousParent);
|
|
12983
|
-
}
|
|
12984
|
-
previousParent = paraElm;
|
|
12985
|
-
isPreviousInlineElem = true;
|
|
12978
|
+
node.previousElementSibling.appendChild(node.firstChild);
|
|
12986
12979
|
}
|
|
12987
12980
|
else {
|
|
12988
|
-
|
|
12989
|
-
|
|
12981
|
+
lastSelectionNode = node.firstChild;
|
|
12982
|
+
if (node.firstChild.nodeName === '#text' ||
|
|
12983
|
+
(this.inlineNode.indexOf(node.firstChild.nodeName.toLocaleLowerCase()) >= 0)) {
|
|
12984
|
+
if (!isPreviousInlineElem) {
|
|
12985
|
+
paraElm = createElement('p');
|
|
12986
|
+
paraElm.appendChild(node.firstChild);
|
|
12987
|
+
fragment.appendChild(paraElm);
|
|
12988
|
+
}
|
|
12989
|
+
else {
|
|
12990
|
+
previousParent.appendChild(node.firstChild);
|
|
12991
|
+
fragment.appendChild(previousParent);
|
|
12992
|
+
}
|
|
12993
|
+
previousParent = paraElm;
|
|
12994
|
+
isPreviousInlineElem = true;
|
|
12995
|
+
}
|
|
12996
|
+
else {
|
|
12997
|
+
fragment.appendChild(node.firstChild);
|
|
12998
|
+
isPreviousInlineElem = false;
|
|
12999
|
+
}
|
|
13000
|
+
isFirstTextNode = false;
|
|
12990
13001
|
}
|
|
12991
|
-
isFirstTextNode = false;
|
|
12992
13002
|
}
|
|
13003
|
+
node.parentNode.replaceChild(fragment, node);
|
|
12993
13004
|
}
|
|
12994
|
-
node.parentNode.replaceChild(fragment, node);
|
|
12995
13005
|
}
|
|
12996
13006
|
if (lastSelectionNode.nodeName === '#text') {
|
|
12997
13007
|
this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
@@ -18573,10 +18583,12 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
18573
18583
|
// eslint-disable-next-line
|
|
18574
18584
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
18575
18585
|
var pointer;
|
|
18586
|
+
var isRootParent = false;
|
|
18576
18587
|
if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey) {
|
|
18577
18588
|
pointer = range.startOffset;
|
|
18578
18589
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
18579
|
-
range.startContainer.nodeName === '#text' ? range.startContainer.parentElement.
|
|
18590
|
+
range.startContainer.nodeName === '#text' ? range.startContainer.parentElement !== this.parent.inputElement ? range.startContainer.parentElement.classList.add('currentStartMark')
|
|
18591
|
+
: isRootParent = true : range.startContainer.classList.add('currentStartMark');
|
|
18580
18592
|
if (range.startContainer.textContent.charCodeAt(0) === 8203) {
|
|
18581
18593
|
pointer = range.startOffset === 0 ? range.startOffset : range.startOffset - 1;
|
|
18582
18594
|
range.startContainer.textContent = range.startContainer.textContent.replace(regEx, '');
|
|
@@ -18585,7 +18597,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
18585
18597
|
var previousLength = this.parent.inputElement.innerHTML.length;
|
|
18586
18598
|
var currentLength = this.parent.inputElement.innerHTML.replace(regEx, '').length;
|
|
18587
18599
|
var focusNode = range.startContainer;
|
|
18588
|
-
if (previousLength > currentLength) {
|
|
18600
|
+
if (previousLength > currentLength && !isRootParent) {
|
|
18589
18601
|
var currentChild = this.parent.inputElement.firstChild;
|
|
18590
18602
|
while (!isNullOrUndefined(currentChild) && currentChild.textContent.replace(regEx, '').trim().length > 0) {
|
|
18591
18603
|
currentChild.innerHTML = currentChild.innerHTML.replace(regEx, '');
|
|
@@ -21879,6 +21891,10 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21879
21891
|
});
|
|
21880
21892
|
};
|
|
21881
21893
|
Image.prototype.resizing = function (e) {
|
|
21894
|
+
if (!this.parent) {
|
|
21895
|
+
this.cancelResizeAction();
|
|
21896
|
+
return;
|
|
21897
|
+
}
|
|
21882
21898
|
if (this.imgEle.offsetWidth >= this.parent.getInsertImgMaxWidth()) {
|
|
21883
21899
|
this.imgEle.style.maxHeight = this.imgEle.offsetHeight + 'px';
|
|
21884
21900
|
}
|
|
@@ -26761,9 +26777,10 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26761
26777
|
var range_1 = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
|
|
26762
26778
|
this.parent.formatter.editorManager.nodeSelection.save(range_1, this.contentModule.getDocument());
|
|
26763
26779
|
this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
|
|
26780
|
+
var pageX = (this.parent.iframeSettings.enable) ? window.pageXOffset + this.parent.element.getBoundingClientRect().left + args.clientX : args.pageX;
|
|
26764
26781
|
var pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
|
|
26765
26782
|
this.parent.element.getBoundingClientRect().top + args.clientY : args.pageY;
|
|
26766
|
-
this.quickToolObj.tableQTBar.showPopup(
|
|
26783
|
+
this.quickToolObj.tableQTBar.showPopup(pageX, pageY, target);
|
|
26767
26784
|
this.parent.formatter.editorManager.nodeSelection.restore();
|
|
26768
26785
|
}
|
|
26769
26786
|
else {
|