@syncfusion/ej2-richtexteditor 19.3.46 → 19.3.47
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 +50 -7
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +50 -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 +9 -9
- package/src/editor-manager/plugin/selection-commands.js +18 -1
- package/src/rich-text-editor/actions/quick-toolbar.js +5 -2
- package/src/rich-text-editor/renderer/image-module.d.ts +2 -0
- package/src/rich-text-editor/renderer/image-module.js +23 -2
- package/src/rich-text-editor/renderer/link-module.js +3 -2
- package/src/rich-text-editor/renderer/table-module.js +3 -2
|
@@ -5813,7 +5813,10 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
5813
5813
|
else {
|
|
5814
5814
|
var closestAnchor = closest(target, 'a');
|
|
5815
5815
|
target = closestAnchor ? closestAnchor : target;
|
|
5816
|
-
|
|
5816
|
+
var startNode = this.parent.getRange().startContainer.parentElement;
|
|
5817
|
+
var endNode = this.parent.getRange().endContainer.parentElement;
|
|
5818
|
+
if ((isNullOrUndefined(closest(startNode, 'A')) || isNullOrUndefined(closest(endNode, 'A'))) && (!closest(target, 'td,th') || !range.collapsed) &&
|
|
5819
|
+
(target.tagName !== 'IMG' || this.parent.getRange().startOffset !== this.parent.getRange().endOffset)) {
|
|
5817
5820
|
if (this.parent.inlineMode.onSelection && range.collapsed) {
|
|
5818
5821
|
return;
|
|
5819
5822
|
}
|
|
@@ -14533,7 +14536,24 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
14533
14536
|
}
|
|
14534
14537
|
}
|
|
14535
14538
|
}
|
|
14536
|
-
|
|
14539
|
+
if ((['fontcolor', 'fontname', 'fontsize', 'backgroundcolor'].indexOf(format) > -1)) {
|
|
14540
|
+
if (format === 'fontcolor') {
|
|
14541
|
+
cursorFormat.style.color = value;
|
|
14542
|
+
}
|
|
14543
|
+
else if (format === 'fontname') {
|
|
14544
|
+
cursorFormat.style.fontFamily = value;
|
|
14545
|
+
}
|
|
14546
|
+
else if (format === 'fontsize') {
|
|
14547
|
+
cursorFormat.style.fontSize = value;
|
|
14548
|
+
}
|
|
14549
|
+
else {
|
|
14550
|
+
cursorFormat.style.backgroundColor = value;
|
|
14551
|
+
}
|
|
14552
|
+
cursorNode = cursorFormat;
|
|
14553
|
+
}
|
|
14554
|
+
else {
|
|
14555
|
+
InsertMethods.unwrap(cursorFormat);
|
|
14556
|
+
}
|
|
14537
14557
|
}
|
|
14538
14558
|
else {
|
|
14539
14559
|
if (cursorNodes.length > 1 && range.startOffset > 0 && (cursorNodes[0].firstElementChild &&
|
|
@@ -19472,7 +19492,8 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
19472
19492
|
this.contentModule = this.rendererFactory.getRenderer(RenderType.Content);
|
|
19473
19493
|
var isPopupOpen = this.quickToolObj.linkQTBar.element.classList.contains('e-rte-pop');
|
|
19474
19494
|
if (target.nodeName === 'A' && (target.childNodes.length > 0 && target.childNodes[0].nodeName !== 'IMG') &&
|
|
19475
|
-
e.args.target.nodeName !== 'IMG'
|
|
19495
|
+
e.args.target.nodeName !== 'IMG' &&
|
|
19496
|
+
!isNullOrUndefined(closest(this.parent.getRange().startContainer.parentElement, 'A')) && !isNullOrUndefined(closest(this.parent.getRange().endContainer.parentElement, 'A'))) {
|
|
19476
19497
|
if (isPopupOpen) {
|
|
19477
19498
|
return;
|
|
19478
19499
|
}
|
|
@@ -20652,7 +20673,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
20652
20673
|
var target = args.target;
|
|
20653
20674
|
this.contentModule = this.rendererFactory.getRenderer(RenderType.Content);
|
|
20654
20675
|
var isPopupOpen = this.quickToolObj.imageQTBar.element.classList.contains('e-rte-pop');
|
|
20655
|
-
if (target.nodeName === 'IMG' && this.parent.quickToolbarModule) {
|
|
20676
|
+
if (target.nodeName === 'IMG' && this.parent.quickToolbarModule && this.parent.getRange().startOffset === this.parent.getRange().endOffset) {
|
|
20656
20677
|
if (isPopupOpen) {
|
|
20657
20678
|
return;
|
|
20658
20679
|
}
|
|
@@ -20891,13 +20912,34 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
20891
20912
|
}
|
|
20892
20913
|
};
|
|
20893
20914
|
Image.prototype.imageRemovePost = function (src) {
|
|
20915
|
+
var proxy = this;
|
|
20916
|
+
var absoluteUrl = '';
|
|
20917
|
+
if (src.indexOf('http://') > -1 || src.indexOf('https://') > -1) {
|
|
20918
|
+
absoluteUrl = src;
|
|
20919
|
+
}
|
|
20920
|
+
else {
|
|
20921
|
+
absoluteUrl = new URL(src, document.baseURI).href;
|
|
20922
|
+
}
|
|
20923
|
+
this.removingImgName = absoluteUrl.replace(/^.*[\\\/]/, '');
|
|
20924
|
+
var xhr = new XMLHttpRequest();
|
|
20925
|
+
xhr.addEventListener("readystatechange", function () {
|
|
20926
|
+
if (this.readyState == 4 && this.status == 200) {
|
|
20927
|
+
proxy.triggerPost(this.response);
|
|
20928
|
+
}
|
|
20929
|
+
});
|
|
20930
|
+
xhr.open('GET', absoluteUrl);
|
|
20931
|
+
xhr.responseType = 'blob';
|
|
20932
|
+
xhr.send();
|
|
20933
|
+
};
|
|
20934
|
+
Image.prototype.triggerPost = function (response) {
|
|
20894
20935
|
var removeUrl = this.parent.insertImageSettings.removeUrl;
|
|
20895
20936
|
if (isNullOrUndefined(removeUrl) || removeUrl === '') {
|
|
20896
20937
|
return;
|
|
20897
20938
|
}
|
|
20939
|
+
var file = new File([response], this.removingImgName);
|
|
20898
20940
|
var ajax = new Ajax(removeUrl, 'POST', true, null);
|
|
20899
20941
|
var formData = new FormData();
|
|
20900
|
-
formData.append(
|
|
20942
|
+
formData.append('UploadFiles', file);
|
|
20901
20943
|
ajax.send(formData);
|
|
20902
20944
|
};
|
|
20903
20945
|
Image.prototype.caption = function (e) {
|
|
@@ -22655,7 +22697,9 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
22655
22697
|
}
|
|
22656
22698
|
var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
|
|
22657
22699
|
var closestTable = closest(target, 'table');
|
|
22658
|
-
|
|
22700
|
+
var startNode = this.parent.getRange().startContainer.parentElement;
|
|
22701
|
+
var endNode = this.parent.getRange().endContainer.parentElement;
|
|
22702
|
+
if (target && target.nodeName !== 'A' && target.nodeName !== 'IMG' && startNode === endNode && (target.nodeName === 'TD' || target.nodeName === 'TH' ||
|
|
22659
22703
|
target.nodeName === 'TABLE' || (closestTable && this.parent.contentModule.getEditPanel().contains(closestTable)))
|
|
22660
22704
|
&& !(range.startContainer.nodeType === 3 && !range.collapsed)) {
|
|
22661
22705
|
var range_1 = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
|
|
@@ -22742,7 +22786,6 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
22742
22786
|
tdNode : target;
|
|
22743
22787
|
removeClass(this.contentModule.getEditPanel().querySelectorAll('table td, table th'), CLS_TABLE_SEL);
|
|
22744
22788
|
if (target && (target.tagName === 'TD' || target.tagName === 'TH')) {
|
|
22745
|
-
target.removeAttribute('class');
|
|
22746
22789
|
addClass([target], CLS_TABLE_SEL);
|
|
22747
22790
|
this.activeCell = target;
|
|
22748
22791
|
this.curTable = (this.curTable) ? this.curTable : closest(target, 'table');
|