@syncfusion/ej2-richtexteditor 27.1.50 → 27.1.51
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.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +46 -8
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +46 -8
- 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/inserthtml.js +21 -0
- package/src/editor-manager/plugin/ms-word-clean-up.js +9 -2
- package/src/editor-manager/plugin/table.js +3 -0
- package/src/rich-text-editor/actions/enter-key.js +7 -2
- package/src/rich-text-editor/actions/html-editor.js +3 -2
- package/src/rich-text-editor/actions/paste-clean-up.js +2 -1
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +8 -8
- package/src/rich-text-editor/base/rich-text-editor.d.ts +8 -8
- package/src/rich-text-editor/renderer/image-module.js +1 -1
- package/dist/ej2-richtexteditor.min.js +0 -10
|
@@ -8661,7 +8661,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
8661
8661
|
};
|
|
8662
8662
|
proxy.inputUrl.setAttribute('disabled', 'true');
|
|
8663
8663
|
if (isNullOrUndefined(proxy.parent.insertImageSettings.saveUrl) && _this.isAllowedTypes
|
|
8664
|
-
&& !isNullOrUndefined(_this.dialogObj)) {
|
|
8664
|
+
&& !isNullOrUndefined(_this.dialogObj) && selectArgs.filesData[0].size <= _this.uploadObj.maxFileSize) {
|
|
8665
8665
|
_this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|
|
8666
8666
|
}
|
|
8667
8667
|
});
|
|
@@ -24276,6 +24276,9 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
24276
24276
|
var rangeElement = closest(nearestAnchor, 'span');
|
|
24277
24277
|
rangeElement.appendChild(tempSpan);
|
|
24278
24278
|
}
|
|
24279
|
+
else if (nodes[0].nodeName === '#text' && nodes[0].nodeValue.includes('\u200B') && !isNullOrUndefined(nodes[0].parentElement) && !isNullOrUndefined(nodes[0].parentElement.previousElementSibling) && nodes[0].parentElement.previousElementSibling.classList.contains('e-mention-chip')) {
|
|
24280
|
+
range.startContainer.parentElement.insertAdjacentElement('afterend', tempSpan);
|
|
24281
|
+
}
|
|
24279
24282
|
else {
|
|
24280
24283
|
range.insertNode(tempSpan);
|
|
24281
24284
|
}
|
|
@@ -24361,6 +24364,24 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
24361
24364
|
if (lastSelectionNode.nodeName === '#text') {
|
|
24362
24365
|
this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
24363
24366
|
}
|
|
24367
|
+
else if (lastSelectionNode.nodeName === 'HR') {
|
|
24368
|
+
var nextSiblingNode = lastSelectionNode.nextSibling ? lastSelectionNode.nextSibling : null;
|
|
24369
|
+
var siblingTag = enterAction === 'DIV' ? createElement('div') : createElement('p');
|
|
24370
|
+
siblingTag.appendChild(createElement('br'));
|
|
24371
|
+
if (!isNullOrUndefined(nextSiblingNode) && nextSiblingNode.nodeName === 'HR') {
|
|
24372
|
+
lastSelectionNode.parentNode.insertBefore(siblingTag, nextSiblingNode);
|
|
24373
|
+
lastSelectionNode = siblingTag;
|
|
24374
|
+
}
|
|
24375
|
+
else if (!isNullOrUndefined(nextSiblingNode)) {
|
|
24376
|
+
lastSelectionNode = nextSiblingNode;
|
|
24377
|
+
}
|
|
24378
|
+
else {
|
|
24379
|
+
lastSelectionNode.parentNode.appendChild(siblingTag);
|
|
24380
|
+
lastSelectionNode.parentNode.insertBefore(lastSelectionNode, siblingTag);
|
|
24381
|
+
lastSelectionNode = siblingTag;
|
|
24382
|
+
}
|
|
24383
|
+
nodeSelection.setSelectionText(docElement, lastSelectionNode, lastSelectionNode, 0, 0);
|
|
24384
|
+
}
|
|
24364
24385
|
else {
|
|
24365
24386
|
this.cursorPos(lastSelectionNode, node, nodeSelection, docElement, editNode, enterAction);
|
|
24366
24387
|
}
|
|
@@ -26315,6 +26336,9 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
26315
26336
|
for (var i = 0; i < thTdElm.length; i++) {
|
|
26316
26337
|
thTdElm[i].dataset.oldWidth = (thTdElm[i].offsetWidth / currentTabElm.offsetWidth * 100) + '%';
|
|
26317
26338
|
}
|
|
26339
|
+
if (isNullOrUndefined(currentTabElm.style.width) || currentTabElm.style.width === '') {
|
|
26340
|
+
currentTabElm.style.width = currentTabElm.offsetWidth + 'px';
|
|
26341
|
+
}
|
|
26318
26342
|
for (var i = 0; i < allRows.length; i++) {
|
|
26319
26343
|
curCell = allRows[i].querySelectorAll(':scope > td, :scope > th')[colIndex];
|
|
26320
26344
|
var colTemplate = curCell.cloneNode(true);
|
|
@@ -29380,15 +29404,22 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
29380
29404
|
var styleProperty = resultElem[j].getAttribute('style');
|
|
29381
29405
|
if (!isNullOrUndefined(styleProperty) && styleProperty.trim() !== '') {
|
|
29382
29406
|
var valueSplit = values[i].split(';');
|
|
29407
|
+
for (var q = 0; q < valueSplit.length; q++) {
|
|
29408
|
+
if (valueSplit[q].split(':')[0] === 'border' && valueSplit[q].split(':')[1] === 'none') {
|
|
29409
|
+
valueSplit.splice(q, 1);
|
|
29410
|
+
q--;
|
|
29411
|
+
}
|
|
29412
|
+
}
|
|
29383
29413
|
if (!fromClass) {
|
|
29384
29414
|
for (var k = 0; k < valueSplit.length; k++) {
|
|
29385
|
-
|
|
29415
|
+
var propertyName = valueSplit[k].split(':')[0];
|
|
29416
|
+
if (styleProperty.includes(propertyName + ':')) {
|
|
29386
29417
|
valueSplit.splice(k, 1);
|
|
29387
29418
|
k--;
|
|
29388
29419
|
}
|
|
29389
29420
|
}
|
|
29390
29421
|
}
|
|
29391
|
-
var changedValue =
|
|
29422
|
+
var changedValue = valueSplit.join(';') + ';' + styleProperty;
|
|
29392
29423
|
resultElem[j].setAttribute('style', changedValue);
|
|
29393
29424
|
}
|
|
29394
29425
|
else {
|
|
@@ -31968,12 +31999,13 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
31968
31999
|
this.isImageDelete = false;
|
|
31969
32000
|
}
|
|
31970
32001
|
var brNode = this.deleteRangeElement.querySelector('BR');
|
|
32002
|
+
var brLastChildNode = this.deleteRangeElement.lastChild;
|
|
31971
32003
|
if (brNode && brNode.classList.contains('e-rte-image-remove-focus')) {
|
|
31972
32004
|
removeClass([brNode], ['e-rte-image-focus']);
|
|
31973
32005
|
return;
|
|
31974
32006
|
}
|
|
31975
|
-
else if (brNode) {
|
|
31976
|
-
detach(
|
|
32007
|
+
else if (brNode && brLastChildNode && brLastChildNode.nodeName === 'BR') {
|
|
32008
|
+
detach(brLastChildNode);
|
|
31977
32009
|
e.args.preventDefault();
|
|
31978
32010
|
}
|
|
31979
32011
|
if (!isNullOrUndefined(this.deleteRangeElement) && (this.deleteOldRangeElement.tagName !== 'OL' && this.deleteOldRangeElement.tagName !== 'UL')
|
|
@@ -32556,12 +32588,12 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
32556
32588
|
if (e.args && !isNullOrUndefined(e.args.clipboardData)) {
|
|
32557
32589
|
value = e.args.clipboardData.getData('text/html');
|
|
32558
32590
|
}
|
|
32559
|
-
this.parent.trigger(beforePasteCleanup, { value: value });
|
|
32560
32591
|
if (e.args && value !== null && this.parent.editorMode === 'HTML') {
|
|
32561
32592
|
var file = void 0;
|
|
32562
32593
|
if (value.length === 0) {
|
|
32563
32594
|
var htmlRegex = new RegExp(/<\/[a-z][\s\S]*>/i);
|
|
32564
32595
|
value = e.args.clipboardData.getData('text/plain');
|
|
32596
|
+
this.parent.trigger(beforePasteCleanup, { value: value });
|
|
32565
32597
|
this.isNotFromHtml = value !== '' ? true : false;
|
|
32566
32598
|
value = value.replace(/</g, '<');
|
|
32567
32599
|
value = value.replace(/>/g, '>');
|
|
@@ -32594,6 +32626,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
32594
32626
|
}
|
|
32595
32627
|
}
|
|
32596
32628
|
else if (value.length > 0) {
|
|
32629
|
+
this.parent.trigger(beforePasteCleanup, { value: value });
|
|
32597
32630
|
this.parent.formatter.editorManager.observer.notify(MS_WORD_CLEANUP, {
|
|
32598
32631
|
args: e.args,
|
|
32599
32632
|
text: e.text,
|
|
@@ -36469,7 +36502,12 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
36469
36502
|
else {
|
|
36470
36503
|
var nearBlockNode = void 0;
|
|
36471
36504
|
if (isTableEnter && _this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode)) {
|
|
36472
|
-
|
|
36505
|
+
if (_this.range.startContainer.nodeName === '#text' && !isNullOrUndefined(_this.range.startContainer.previousSibling) && _this.range.startContainer.previousSibling.nodeName === 'HR') {
|
|
36506
|
+
nearBlockNode = _this.range.startContainer.nextSibling;
|
|
36507
|
+
}
|
|
36508
|
+
else {
|
|
36509
|
+
nearBlockNode = _this.startNode;
|
|
36510
|
+
}
|
|
36473
36511
|
}
|
|
36474
36512
|
else {
|
|
36475
36513
|
nearBlockNode = _this.parent.formatter.editorManager.domNode.blockParentNode(_this.startNode);
|
|
@@ -36517,7 +36555,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
36517
36555
|
}
|
|
36518
36556
|
else {
|
|
36519
36557
|
if ((nearBlockNode.textContent.trim().length !== 0 ||
|
|
36520
|
-
nearBlockNode.childNodes[0].nodeName === 'IMG' ||
|
|
36558
|
+
(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG') ||
|
|
36521
36559
|
(nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img, audio, video').length > 0))) {
|
|
36522
36560
|
if ((_this.range.startOffset === _this.range.endOffset && _this.range.startOffset !== 0)) {
|
|
36523
36561
|
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
|