@syncfusion/ej2-richtexteditor 26.2.10 → 26.2.12
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/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 +56 -16
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +56 -16
- 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/common/util.js +7 -0
- package/src/editor-manager/plugin/inserthtml.d.ts +1 -0
- package/src/editor-manager/plugin/inserthtml.js +18 -7
- package/src/editor-manager/plugin/ms-word-clean-up.js +7 -2
- package/src/editor-manager/plugin/selection-commands.js +18 -1
- package/src/editor-manager/plugin/table.js +1 -1
- package/src/rich-text-editor/renderer/image-module.js +5 -5
- package/hotfix/26.1.35_Vol2.txt +0 -1
|
@@ -4856,6 +4856,13 @@ function scrollToCursor(document, inputElement) {
|
|
|
4856
4856
|
}
|
|
4857
4857
|
}
|
|
4858
4858
|
}
|
|
4859
|
+
var scrollVal = inputElement.closest('div[style*="overflow-y: scroll"]');
|
|
4860
|
+
if (!isNullOrUndefined(scrollVal)) {
|
|
4861
|
+
var parentRect = scrollVal.getBoundingClientRect();
|
|
4862
|
+
if (cursorBottom > parentRect.bottom) {
|
|
4863
|
+
scrollVal.scrollTop += (cursorBottom - parentRect.bottom);
|
|
4864
|
+
}
|
|
4865
|
+
}
|
|
4859
4866
|
}
|
|
4860
4867
|
/**
|
|
4861
4868
|
* Inserts items at a specific index in an array.
|
|
@@ -8512,7 +8519,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
8512
8519
|
var altText;
|
|
8513
8520
|
var selectArgs;
|
|
8514
8521
|
var filesData;
|
|
8515
|
-
var
|
|
8522
|
+
var previousFileInfo = null;
|
|
8516
8523
|
this.uploadObj = new Uploader({
|
|
8517
8524
|
asyncSettings: { saveUrl: this.parent.insertImageSettings.saveUrl, removeUrl: this.parent.insertImageSettings.removeUrl },
|
|
8518
8525
|
dropArea: span, multiple: false, enableRtl: this.parent.enableRtl, cssClass: this.parent.getCssClass(),
|
|
@@ -8567,10 +8574,10 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
8567
8574
|
e.detectImageSource = ImageInputSource.Uploaded;
|
|
8568
8575
|
_this.parent.trigger(imageUploadSuccess, e, function (e) {
|
|
8569
8576
|
if (!isNullOrUndefined(_this.parent.insertImageSettings.path)) {
|
|
8570
|
-
var url = _this.parent.insertImageSettings.path + e.file.name;
|
|
8577
|
+
var url = _this.parent.insertImageSettings.path + (e).file.name;
|
|
8571
8578
|
// Update the URL of the previously uploaded image
|
|
8572
|
-
if (!isNullOrUndefined(
|
|
8573
|
-
|
|
8579
|
+
if (!isNullOrUndefined(previousFileInfo) && e.operation === 'upload') {
|
|
8580
|
+
_this.uploadObj.remove(previousFileInfo);
|
|
8574
8581
|
}
|
|
8575
8582
|
proxy.uploadUrl = {
|
|
8576
8583
|
url: url, selection: save, altText: altText, selectParent: selectParent,
|
|
@@ -8583,7 +8590,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
8583
8590
|
}
|
|
8584
8591
|
};
|
|
8585
8592
|
proxy.inputUrl.setAttribute('disabled', 'true');
|
|
8586
|
-
|
|
8593
|
+
previousFileInfo = e.file;
|
|
8587
8594
|
}
|
|
8588
8595
|
if (e.operation === 'upload' && !isNullOrUndefined(_this.dialogObj)) {
|
|
8589
8596
|
_this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|
|
@@ -23950,6 +23957,12 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
23950
23957
|
currentNode.nextSibling.nodeName === 'BR') {
|
|
23951
23958
|
detach(currentNode.nextSibling);
|
|
23952
23959
|
}
|
|
23960
|
+
if (currentNode.parentElement.nodeName === 'LI' && currentNode.parentElement.textContent === '') {
|
|
23961
|
+
this.removeListfromPaste(range);
|
|
23962
|
+
range.insertNode(node);
|
|
23963
|
+
this.contentsDeleted = true;
|
|
23964
|
+
return;
|
|
23965
|
+
}
|
|
23953
23966
|
}
|
|
23954
23967
|
else if ((currentNode.nodeName === '#text' || currentNode.nodeName === 'BR') && !isNullOrUndefined(currentNode.parentElement) &&
|
|
23955
23968
|
(currentNode.parentElement.nodeName === 'LI' || currentNode.parentElement.closest('LI') || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
|
|
@@ -23960,13 +23973,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
23960
23973
|
detach(currentNode.nextSibling);
|
|
23961
23974
|
}
|
|
23962
23975
|
if (!range.collapsed) {
|
|
23963
|
-
|
|
23964
|
-
var value = range.startContainer;
|
|
23965
|
-
if (!isNullOrUndefined(value) && value.nodeName === 'LI' && !isNullOrUndefined(value.parentElement) && (value.parentElement.nodeName === 'OL' || value.parentElement.nodeName === 'UL') && value.textContent.trim() === '') {
|
|
23966
|
-
value.parentElement.querySelectorAll('li').forEach(function (item) {
|
|
23967
|
-
item.remove();
|
|
23968
|
-
});
|
|
23969
|
-
}
|
|
23976
|
+
this.removeListfromPaste(range);
|
|
23970
23977
|
}
|
|
23971
23978
|
range.insertNode(node);
|
|
23972
23979
|
this.contentsDeleted = true;
|
|
@@ -24115,6 +24122,17 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
24115
24122
|
}
|
|
24116
24123
|
}
|
|
24117
24124
|
};
|
|
24125
|
+
InsertHtml.removeListfromPaste = function (range) {
|
|
24126
|
+
range.deleteContents();
|
|
24127
|
+
var value = range.startContainer;
|
|
24128
|
+
if (!isNullOrUndefined(value) && value.nodeName === 'LI' && !isNullOrUndefined(value.parentElement) && (value.parentElement.nodeName === 'OL' || value.parentElement.nodeName === 'UL') && value.textContent.trim() === '') {
|
|
24129
|
+
value.parentElement.querySelectorAll('li').forEach(function (item) {
|
|
24130
|
+
if (item.textContent.trim() === '') {
|
|
24131
|
+
item.remove();
|
|
24132
|
+
}
|
|
24133
|
+
});
|
|
24134
|
+
}
|
|
24135
|
+
};
|
|
24118
24136
|
/**
|
|
24119
24137
|
* Insert method
|
|
24120
24138
|
*
|
|
@@ -26104,7 +26122,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
26104
26122
|
detach(selectedCells[i]);
|
|
26105
26123
|
}
|
|
26106
26124
|
for (var i = 0; i < this.curTable.rows.length; i++) {
|
|
26107
|
-
if (this.curTable.rows[i].innerHTML === '') {
|
|
26125
|
+
if (this.curTable.rows[i].innerHTML.trim() === '') {
|
|
26108
26126
|
detach(this.curTable.rows[i]);
|
|
26109
26127
|
}
|
|
26110
26128
|
}
|
|
@@ -26868,8 +26886,25 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
26868
26886
|
if (!isNullOrUndefined(cursorNodes[0].parentElement) && IsFormatted.inlineTags.
|
|
26869
26887
|
indexOf((cursorNodes[0].parentElement).tagName.toLowerCase()) !== -1 && cursorNodes[0].textContent.includes('\u200B')) {
|
|
26870
26888
|
var element = this.GetFormatNode(format, value);
|
|
26889
|
+
var tempNode = cursorNodes[0];
|
|
26890
|
+
if (format === 'fontsize') {
|
|
26891
|
+
var currentFormatNode = cursorNodes[0];
|
|
26892
|
+
while (currentFormatNode) {
|
|
26893
|
+
var isSameTextContent = currentFormatNode.parentElement.textContent.trim()
|
|
26894
|
+
=== cursorNodes[0].textContent.trim();
|
|
26895
|
+
var previousElement = currentFormatNode.parentElement;
|
|
26896
|
+
if (!domNode.isBlockNode(previousElement) && isSameTextContent &&
|
|
26897
|
+
!(previousElement.nodeName === 'SPAN' && previousElement.classList.contains('e-img-inner'))) {
|
|
26898
|
+
currentFormatNode = previousElement;
|
|
26899
|
+
}
|
|
26900
|
+
else {
|
|
26901
|
+
break;
|
|
26902
|
+
}
|
|
26903
|
+
cursorNodes[0] = currentFormatNode;
|
|
26904
|
+
}
|
|
26905
|
+
}
|
|
26871
26906
|
this.applyStyles(cursorNodes, 0, element);
|
|
26872
|
-
return
|
|
26907
|
+
return tempNode;
|
|
26873
26908
|
}
|
|
26874
26909
|
cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
|
|
26875
26910
|
}
|
|
@@ -28318,6 +28353,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
28318
28353
|
function MsWordPaste(parent) {
|
|
28319
28354
|
this.olData = [
|
|
28320
28355
|
'decimal',
|
|
28356
|
+
'decimal-leading-zero',
|
|
28321
28357
|
'lower-alpha',
|
|
28322
28358
|
'lower-roman',
|
|
28323
28359
|
'upper-alpha',
|
|
@@ -28490,7 +28526,8 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
28490
28526
|
imgElem[i].getAttribute('v:shapes').toLowerCase().indexOf('image') < 0 &&
|
|
28491
28527
|
imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0 &&
|
|
28492
28528
|
imgElem[i].getAttribute('v:shapes').indexOf('_x0000_s') < 0 &&
|
|
28493
|
-
imgElem[i].getAttribute('v:shapes').indexOf('_x0000_i') < 0
|
|
28529
|
+
imgElem[i].getAttribute('v:shapes').indexOf('_x0000_i') < 0 &&
|
|
28530
|
+
imgElem[i].getAttribute('v:shapes').indexOf('img1') < 0) {
|
|
28494
28531
|
imgElem[i].classList.add('e-rte-image-unsupported');
|
|
28495
28532
|
}
|
|
28496
28533
|
imgElem[i].removeAttribute('v:shapes');
|
|
@@ -29000,7 +29037,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
29000
29037
|
listStyleType = this.getlistStyleType(this.listContents[0], type);
|
|
29001
29038
|
if (type === 'ol' && (i === 0 || listNodes[i - 1] === null)) {
|
|
29002
29039
|
var startString = this.listContents[0].split('.')[0];
|
|
29003
|
-
var listTypes = ['A', 'a', 'I', 'i', 'α', '1', '1-']; // Add '1-' for rare list type.
|
|
29040
|
+
var listTypes = ['A', 'a', 'I', 'i', 'α', '1', '01', '1-']; // Add '1-' for rare list type.
|
|
29004
29041
|
if (listTypes.indexOf(startString) === -1) {
|
|
29005
29042
|
if (listStyleType === 'decimal') {
|
|
29006
29043
|
// Bug in getlistStyleType() list style stype is returned as decimal for nested list with start attribute
|
|
@@ -29089,6 +29126,9 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
29089
29126
|
case (charCode > 96 && charCode < 123):
|
|
29090
29127
|
currentListClass = 'lower-alpha';
|
|
29091
29128
|
break;
|
|
29129
|
+
case (listContent.split('.')[0].length > 1 && listContent.split('.')[0][0] === '0' && !isNaN(Number(listContent.split('.')[0]))):
|
|
29130
|
+
currentListClass = 'decimal-leading-zero';
|
|
29131
|
+
break;
|
|
29092
29132
|
default:
|
|
29093
29133
|
currentListClass = 'decimal';
|
|
29094
29134
|
break;
|