@syncfusion/ej2-richtexteditor 19.3.45 → 19.3.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 +32 -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 +64 -10
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +64 -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 +12 -12
- package/src/editor-manager/plugin/selection-commands.js +18 -1
- package/src/rich-text-editor/actions/dropdown-buttons.js +10 -0
- package/src/rich-text-editor/actions/enter-key.js +1 -0
- package/src/rich-text-editor/actions/quick-toolbar.js +5 -2
- package/src/rich-text-editor/base/rich-text-editor.js +1 -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
- package/src/rich-text-editor/renderer/toolbar-renderer.js +3 -2
- package/styles/bootstrap-dark.css +4 -0
- package/styles/bootstrap.css +4 -0
- package/styles/bootstrap4.css +4 -0
- package/styles/bootstrap5-dark.css +4 -0
- package/styles/bootstrap5.css +4 -0
- package/styles/fabric-dark.css +4 -0
- package/styles/fabric.css +4 -0
- package/styles/highcontrast-light.css +4 -0
- package/styles/highcontrast.css +4 -0
- package/styles/material-dark.css +4 -0
- package/styles/material.css +4 -0
- package/styles/rich-text-editor/_layout.scss +4 -0
- package/styles/rich-text-editor/bootstrap-dark.css +4 -0
- package/styles/rich-text-editor/bootstrap.css +4 -0
- package/styles/rich-text-editor/bootstrap4.css +4 -0
- package/styles/rich-text-editor/bootstrap5-dark.css +4 -0
- package/styles/rich-text-editor/bootstrap5.css +4 -0
- package/styles/rich-text-editor/fabric-dark.css +4 -0
- package/styles/rich-text-editor/fabric.css +4 -0
- package/styles/rich-text-editor/highcontrast-light.css +4 -0
- package/styles/rich-text-editor/highcontrast.css +4 -0
- package/styles/rich-text-editor/material-dark.css +4 -0
- package/styles/rich-text-editor/material.css +4 -0
- package/styles/rich-text-editor/tailwind-dark.css +4 -0
- package/styles/rich-text-editor/tailwind.css +4 -0
- package/styles/tailwind-dark.css +4 -0
- package/styles/tailwind.css +4 -0
|
@@ -2741,7 +2741,8 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
2741
2741
|
this.parent.notify(beforeDropDownItemRender, args);
|
|
2742
2742
|
};
|
|
2743
2743
|
ToolbarRenderer.prototype.dropDownOpen = function (args) {
|
|
2744
|
-
if (args.element.parentElement.getAttribute('id').indexOf('TableCell') > -1)
|
|
2744
|
+
if (args.element.parentElement.getAttribute('id').indexOf('TableCell') > -1 && !isNullOrUndefined(args.element.parentElement.querySelector('.e-cell-merge')) &&
|
|
2745
|
+
(!isNullOrUndefined(args.element.parentElement.querySelector('.e-cell-horizontal-split')) || !isNullOrUndefined(args.element.parentElement.querySelector('.e-cell-vertical-split')))) {
|
|
2745
2746
|
var listEle = args.element.querySelectorAll('li');
|
|
2746
2747
|
if (this.parent.inputElement.querySelectorAll('.e-cell-select').length === 1) {
|
|
2747
2748
|
addClass([listEle[0]], 'e-disabled');
|
|
@@ -3605,6 +3606,11 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
|
|
|
3605
3606
|
var prop = _a[_i];
|
|
3606
3607
|
switch (prop) {
|
|
3607
3608
|
case 'fontFamily':
|
|
3609
|
+
if (this.parent.inlineMode.enable) {
|
|
3610
|
+
if (!isNullOrUndefined(this.parent.fontFamily.default)) {
|
|
3611
|
+
this.getEditNode().style.fontFamily = this.parent.fontFamily.default;
|
|
3612
|
+
}
|
|
3613
|
+
}
|
|
3608
3614
|
if (this.fontNameDropDown) {
|
|
3609
3615
|
for (var _b = 0, _c = Object.keys(newProp.fontFamily); _b < _c.length; _b++) {
|
|
3610
3616
|
var fontFamily$$1 = _c[_b];
|
|
@@ -3636,6 +3642,11 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
|
|
|
3636
3642
|
}
|
|
3637
3643
|
break;
|
|
3638
3644
|
case 'fontSize':
|
|
3645
|
+
if (this.parent.inlineMode) {
|
|
3646
|
+
if (!isNullOrUndefined(this.parent.fontSize.default)) {
|
|
3647
|
+
this.getEditNode().style.fontSize = this.parent.fontSize.default;
|
|
3648
|
+
}
|
|
3649
|
+
}
|
|
3639
3650
|
if (this.fontSizeDropDown) {
|
|
3640
3651
|
for (var _d = 0, _e = Object.keys(newProp.fontSize); _d < _e.length; _d++) {
|
|
3641
3652
|
var fontSize$$1 = _e[_d];
|
|
@@ -5813,7 +5824,10 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
5813
5824
|
else {
|
|
5814
5825
|
var closestAnchor = closest(target, 'a');
|
|
5815
5826
|
target = closestAnchor ? closestAnchor : target;
|
|
5816
|
-
|
|
5827
|
+
var startNode = this.parent.getRange().startContainer.parentElement;
|
|
5828
|
+
var endNode = this.parent.getRange().endContainer.parentElement;
|
|
5829
|
+
if ((isNullOrUndefined(closest(startNode, 'A')) || isNullOrUndefined(closest(endNode, 'A'))) && (!closest(target, 'td,th') || !range.collapsed) &&
|
|
5830
|
+
(target.tagName !== 'IMG' || this.parent.getRange().startOffset !== this.parent.getRange().endOffset)) {
|
|
5817
5831
|
if (this.parent.inlineMode.onSelection && range.collapsed) {
|
|
5818
5832
|
return;
|
|
5819
5833
|
}
|
|
@@ -14533,7 +14547,24 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
14533
14547
|
}
|
|
14534
14548
|
}
|
|
14535
14549
|
}
|
|
14536
|
-
|
|
14550
|
+
if ((['fontcolor', 'fontname', 'fontsize', 'backgroundcolor'].indexOf(format) > -1)) {
|
|
14551
|
+
if (format === 'fontcolor') {
|
|
14552
|
+
cursorFormat.style.color = value;
|
|
14553
|
+
}
|
|
14554
|
+
else if (format === 'fontname') {
|
|
14555
|
+
cursorFormat.style.fontFamily = value;
|
|
14556
|
+
}
|
|
14557
|
+
else if (format === 'fontsize') {
|
|
14558
|
+
cursorFormat.style.fontSize = value;
|
|
14559
|
+
}
|
|
14560
|
+
else {
|
|
14561
|
+
cursorFormat.style.backgroundColor = value;
|
|
14562
|
+
}
|
|
14563
|
+
cursorNode = cursorFormat;
|
|
14564
|
+
}
|
|
14565
|
+
else {
|
|
14566
|
+
InsertMethods.unwrap(cursorFormat);
|
|
14567
|
+
}
|
|
14537
14568
|
}
|
|
14538
14569
|
else {
|
|
14539
14570
|
if (cursorNodes.length > 1 && range.startOffset > 0 && (cursorNodes[0].firstElementChild &&
|
|
@@ -19472,7 +19503,8 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
19472
19503
|
this.contentModule = this.rendererFactory.getRenderer(RenderType.Content);
|
|
19473
19504
|
var isPopupOpen = this.quickToolObj.linkQTBar.element.classList.contains('e-rte-pop');
|
|
19474
19505
|
if (target.nodeName === 'A' && (target.childNodes.length > 0 && target.childNodes[0].nodeName !== 'IMG') &&
|
|
19475
|
-
e.args.target.nodeName !== 'IMG'
|
|
19506
|
+
e.args.target.nodeName !== 'IMG' &&
|
|
19507
|
+
!isNullOrUndefined(closest(this.parent.getRange().startContainer.parentElement, 'A')) && !isNullOrUndefined(closest(this.parent.getRange().endContainer.parentElement, 'A'))) {
|
|
19476
19508
|
if (isPopupOpen) {
|
|
19477
19509
|
return;
|
|
19478
19510
|
}
|
|
@@ -20652,7 +20684,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
20652
20684
|
var target = args.target;
|
|
20653
20685
|
this.contentModule = this.rendererFactory.getRenderer(RenderType.Content);
|
|
20654
20686
|
var isPopupOpen = this.quickToolObj.imageQTBar.element.classList.contains('e-rte-pop');
|
|
20655
|
-
if (target.nodeName === 'IMG' && this.parent.quickToolbarModule) {
|
|
20687
|
+
if (target.nodeName === 'IMG' && this.parent.quickToolbarModule && this.parent.getRange().startOffset === this.parent.getRange().endOffset) {
|
|
20656
20688
|
if (isPopupOpen) {
|
|
20657
20689
|
return;
|
|
20658
20690
|
}
|
|
@@ -20891,13 +20923,34 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
20891
20923
|
}
|
|
20892
20924
|
};
|
|
20893
20925
|
Image.prototype.imageRemovePost = function (src) {
|
|
20926
|
+
var proxy = this;
|
|
20927
|
+
var absoluteUrl = '';
|
|
20928
|
+
if (src.indexOf('http://') > -1 || src.indexOf('https://') > -1) {
|
|
20929
|
+
absoluteUrl = src;
|
|
20930
|
+
}
|
|
20931
|
+
else {
|
|
20932
|
+
absoluteUrl = new URL(src, document.baseURI).href;
|
|
20933
|
+
}
|
|
20934
|
+
this.removingImgName = absoluteUrl.replace(/^.*[\\\/]/, '');
|
|
20935
|
+
var xhr = new XMLHttpRequest();
|
|
20936
|
+
xhr.addEventListener("readystatechange", function () {
|
|
20937
|
+
if (this.readyState == 4 && this.status == 200) {
|
|
20938
|
+
proxy.triggerPost(this.response);
|
|
20939
|
+
}
|
|
20940
|
+
});
|
|
20941
|
+
xhr.open('GET', absoluteUrl);
|
|
20942
|
+
xhr.responseType = 'blob';
|
|
20943
|
+
xhr.send();
|
|
20944
|
+
};
|
|
20945
|
+
Image.prototype.triggerPost = function (response) {
|
|
20894
20946
|
var removeUrl = this.parent.insertImageSettings.removeUrl;
|
|
20895
20947
|
if (isNullOrUndefined(removeUrl) || removeUrl === '') {
|
|
20896
20948
|
return;
|
|
20897
20949
|
}
|
|
20950
|
+
var file = new File([response], this.removingImgName);
|
|
20898
20951
|
var ajax = new Ajax(removeUrl, 'POST', true, null);
|
|
20899
20952
|
var formData = new FormData();
|
|
20900
|
-
formData.append(
|
|
20953
|
+
formData.append('UploadFiles', file);
|
|
20901
20954
|
ajax.send(formData);
|
|
20902
20955
|
};
|
|
20903
20956
|
Image.prototype.caption = function (e) {
|
|
@@ -22655,7 +22708,9 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
22655
22708
|
}
|
|
22656
22709
|
var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
|
|
22657
22710
|
var closestTable = closest(target, 'table');
|
|
22658
|
-
|
|
22711
|
+
var startNode = this.parent.getRange().startContainer.parentElement;
|
|
22712
|
+
var endNode = this.parent.getRange().endContainer.parentElement;
|
|
22713
|
+
if (target && target.nodeName !== 'A' && target.nodeName !== 'IMG' && startNode === endNode && (target.nodeName === 'TD' || target.nodeName === 'TH' ||
|
|
22659
22714
|
target.nodeName === 'TABLE' || (closestTable && this.parent.contentModule.getEditPanel().contains(closestTable)))
|
|
22660
22715
|
&& !(range.startContainer.nodeType === 3 && !range.collapsed)) {
|
|
22661
22716
|
var range_1 = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
|
|
@@ -22742,7 +22797,6 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
22742
22797
|
tdNode : target;
|
|
22743
22798
|
removeClass(this.contentModule.getEditPanel().querySelectorAll('table td, table th'), CLS_TABLE_SEL);
|
|
22744
22799
|
if (target && (target.tagName === 'TD' || target.tagName === 'TH')) {
|
|
22745
|
-
target.removeAttribute('class');
|
|
22746
22800
|
addClass([target], CLS_TABLE_SEL);
|
|
22747
22801
|
this.activeCell = target;
|
|
22748
22802
|
this.curTable = (this.curTable) ? this.curTable : closest(target, 'table');
|
|
@@ -24317,6 +24371,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
24317
24371
|
detach(nearBlockNode);
|
|
24318
24372
|
}
|
|
24319
24373
|
}
|
|
24374
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), insertElem.nextElementSibling, 0);
|
|
24320
24375
|
}
|
|
24321
24376
|
else if (nearBlockNode.textContent.length === 0 && !(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG')) {
|
|
24322
24377
|
if (!isNullOrUndefined(nearBlockNode.children[0]) && nearBlockNode.children[0].tagName !== 'BR') {
|
|
@@ -25868,8 +25923,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
25868
25923
|
this.setProperties({ value: this.valueTemplate });
|
|
25869
25924
|
}
|
|
25870
25925
|
else {
|
|
25871
|
-
var
|
|
25872
|
-
var compiledTemplate = compiledString({});
|
|
25926
|
+
var compiledTemplate = compile(this.valueTemplate)('', this, 'valueTemplate');
|
|
25873
25927
|
for (var i = 0; i < compiledTemplate.length; i++) {
|
|
25874
25928
|
var item = compiledTemplate[i];
|
|
25875
25929
|
append([item], this.element);
|