@syncfusion/ej2-richtexteditor 28.1.33 → 28.1.36
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 +1 -10
- package/dist/ej2-richtexteditor.umd.min.js +1 -10
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +67 -18
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +67 -18
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +1 -10
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/package.json +9 -10
- package/src/editor-manager/plugin/inserthtml.js +15 -4
- package/src/editor-manager/plugin/link.js +1 -0
- package/src/editor-manager/plugin/ms-word-clean-up.js +4 -2
- package/src/rich-text-editor/actions/enter-key.js +10 -3
- package/src/rich-text-editor/actions/paste-clean-up.js +26 -3
- package/src/rich-text-editor/renderer/toolbar-renderer.js +11 -6
- package/styles/bds-lite.css +8 -2
- package/styles/bds.css +8 -2
- package/styles/bootstrap-dark-lite.css +8 -2
- package/styles/bootstrap-dark.css +8 -2
- package/styles/bootstrap-lite.css +8 -2
- package/styles/bootstrap.css +8 -2
- package/styles/bootstrap4-lite.css +8 -2
- package/styles/bootstrap4.css +8 -2
- package/styles/bootstrap5-dark-lite.css +8 -2
- package/styles/bootstrap5-dark.css +8 -2
- package/styles/bootstrap5-lite.css +8 -2
- package/styles/bootstrap5.3-lite.css +8 -2
- package/styles/bootstrap5.3.css +8 -2
- package/styles/bootstrap5.css +8 -2
- package/styles/fabric-dark-lite.css +8 -2
- package/styles/fabric-dark.css +8 -2
- package/styles/fabric-lite.css +8 -2
- package/styles/fabric.css +8 -2
- package/styles/fluent-dark-lite.css +8 -2
- package/styles/fluent-dark.css +8 -2
- package/styles/fluent-lite.css +8 -2
- package/styles/fluent.css +8 -2
- package/styles/fluent2-lite.css +8 -2
- package/styles/fluent2.css +8 -2
- package/styles/highcontrast-light-lite.css +8 -2
- package/styles/highcontrast-light.css +8 -2
- package/styles/highcontrast-lite.css +8 -2
- package/styles/highcontrast.css +8 -2
- package/styles/material-dark-lite.css +8 -2
- package/styles/material-dark.css +8 -2
- package/styles/material-lite.css +8 -2
- package/styles/material.css +8 -2
- package/styles/material3-dark-lite.css +8 -2
- package/styles/material3-dark.css +8 -2
- package/styles/material3-lite.css +8 -2
- package/styles/material3.css +8 -2
- package/styles/rich-text-editor/_layout.scss +6 -5
- package/styles/rich-text-editor/_tailwind3-definition.scss +1 -1
- package/styles/rich-text-editor/bds.css +8 -2
- package/styles/rich-text-editor/bootstrap-dark.css +8 -2
- package/styles/rich-text-editor/bootstrap.css +8 -2
- package/styles/rich-text-editor/bootstrap4.css +8 -2
- package/styles/rich-text-editor/bootstrap5-dark.css +8 -2
- package/styles/rich-text-editor/bootstrap5.3.css +8 -2
- package/styles/rich-text-editor/bootstrap5.css +8 -2
- package/styles/rich-text-editor/fabric-dark.css +8 -2
- package/styles/rich-text-editor/fabric.css +8 -2
- package/styles/rich-text-editor/fluent-dark.css +8 -2
- package/styles/rich-text-editor/fluent.css +8 -2
- package/styles/rich-text-editor/fluent2.css +8 -2
- package/styles/rich-text-editor/highcontrast-light.css +8 -2
- package/styles/rich-text-editor/highcontrast.css +8 -2
- package/styles/rich-text-editor/material-dark.css +8 -2
- package/styles/rich-text-editor/material.css +8 -2
- package/styles/rich-text-editor/material3-dark.css +8 -2
- package/styles/rich-text-editor/material3.css +8 -2
- package/styles/rich-text-editor/tailwind-dark.css +8 -2
- package/styles/rich-text-editor/tailwind.css +8 -2
- package/styles/rich-text-editor/tailwind3.css +13 -8
- package/styles/tailwind-dark-lite.css +8 -2
- package/styles/tailwind-dark.css +8 -2
- package/styles/tailwind-lite.css +8 -2
- package/styles/tailwind.css +8 -2
- package/styles/tailwind3-lite.css +13 -8
- package/styles/tailwind3.css +13 -8
|
@@ -5937,7 +5937,9 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
5937
5937
|
args.cancel = true;
|
|
5938
5938
|
return;
|
|
5939
5939
|
}
|
|
5940
|
-
|
|
5940
|
+
if (Browser.info.name === 'safari') {
|
|
5941
|
+
proxy.parent.notify(selectionRestore, {});
|
|
5942
|
+
}
|
|
5941
5943
|
var element = (args.event) ? args.event.target : null;
|
|
5942
5944
|
proxy.currentElement = dropDown.element;
|
|
5943
5945
|
proxy.currentDropdown = dropDown;
|
|
@@ -5965,10 +5967,14 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
5965
5967
|
args.element.tabIndex = -1;
|
|
5966
5968
|
dropDown.element.removeAttribute('type');
|
|
5967
5969
|
dropDown.element.onmousedown = function () {
|
|
5968
|
-
|
|
5970
|
+
if (Browser.info.name === 'safari') {
|
|
5971
|
+
proxy.parent.notify(selectionSave, {});
|
|
5972
|
+
}
|
|
5969
5973
|
};
|
|
5970
5974
|
dropDown.element.onkeydown = function () {
|
|
5971
|
-
|
|
5975
|
+
if (Browser.info.name === 'safari') {
|
|
5976
|
+
proxy.parent.notify(selectionSave, {});
|
|
5977
|
+
}
|
|
5972
5978
|
};
|
|
5973
5979
|
return dropDown;
|
|
5974
5980
|
};
|
|
@@ -6152,11 +6158,10 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
6152
6158
|
enableRtl: this.parent.enableRtl,
|
|
6153
6159
|
inline: true,
|
|
6154
6160
|
value: null,
|
|
6155
|
-
cssClass: ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass
|
|
6161
|
+
cssClass: ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass,
|
|
6156
6162
|
created: function () {
|
|
6157
6163
|
var value = (item === 'backgroundcolor') ? proxy.parent.backgroundColor.default : proxy.parent.fontColor.default;
|
|
6158
|
-
|
|
6159
|
-
colorPicker.setProperties({ value: value, cssClass: cssClass });
|
|
6164
|
+
colorPicker.setProperties({ value: value });
|
|
6160
6165
|
},
|
|
6161
6166
|
mode: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.mode : proxy.parent.fontColor.mode),
|
|
6162
6167
|
modeSwitcher: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.modeSwitcher : proxy.parent.fontColor.modeSwitcher),
|
|
@@ -21701,7 +21706,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
21701
21706
|
InsertHtml.pasteInsertHTML = function (nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode, enterAction) {
|
|
21702
21707
|
var isCursor = range.startOffset === range.endOffset &&
|
|
21703
21708
|
range.startContainer === range.endContainer;
|
|
21704
|
-
if (isCursor && range.startContainer === editNode && editNode.textContent === '') {
|
|
21709
|
+
if (isCursor && range.startContainer === editNode && editNode.textContent === '' && range.startOffset === 0 && range.endOffset === 0) {
|
|
21705
21710
|
var currentBlockNode = this.getImmediateBlockNode(nodes[nodes.length - 1], editNode);
|
|
21706
21711
|
nodeSelection.setSelectionText(docElement, currentBlockNode, currentBlockNode, 0, 0);
|
|
21707
21712
|
range = nodeSelection.getRange(docElement);
|
|
@@ -22092,9 +22097,20 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
22092
22097
|
}
|
|
22093
22098
|
}
|
|
22094
22099
|
if (blockNode && blockNode.nodeName === 'TD' || blockNode.nodeName === 'TH' || blockNode.nodeName === 'TR') {
|
|
22095
|
-
var
|
|
22096
|
-
|
|
22097
|
-
|
|
22100
|
+
var parentElem = range.startContainer;
|
|
22101
|
+
while (!isNullOrUndefined(parentElem) && parentElem.parentElement !== blockNode) {
|
|
22102
|
+
parentElem = parentElem.parentElement;
|
|
22103
|
+
}
|
|
22104
|
+
range.deleteContents();
|
|
22105
|
+
var splitedElm = nodeCutter.GetSpliceNode(range, parentElem);
|
|
22106
|
+
if (splitedElm) {
|
|
22107
|
+
splitedElm.parentNode.replaceChild(node, splitedElm);
|
|
22108
|
+
}
|
|
22109
|
+
else {
|
|
22110
|
+
range.insertNode(node);
|
|
22111
|
+
}
|
|
22112
|
+
this.contentsDeleted = true;
|
|
22113
|
+
return;
|
|
22098
22114
|
}
|
|
22099
22115
|
else {
|
|
22100
22116
|
var nodeSelection = new NodeSelection(editNode);
|
|
@@ -25533,6 +25549,7 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
|
|
|
25533
25549
|
if (child && child.length === 1) {
|
|
25534
25550
|
e.item.selection.startContainer = e.item.selection.getNodeArray(child[child.length - 1], true);
|
|
25535
25551
|
e.item.selection.endContainer = e.item.selection.startContainer;
|
|
25552
|
+
e.item.selection.endOffset = child[child.length - 1].textContent.length;
|
|
25536
25553
|
}
|
|
25537
25554
|
e.item.selection = this.parent.domNode.saveMarker(e.item.selection);
|
|
25538
25555
|
}
|
|
@@ -29890,7 +29907,8 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
29890
29907
|
imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0 &&
|
|
29891
29908
|
imgElem[i].getAttribute('v:shapes').indexOf('_x0000_s') < 0 &&
|
|
29892
29909
|
imgElem[i].getAttribute('v:shapes').indexOf('_x0000_i') < 0 &&
|
|
29893
|
-
imgElem[i].getAttribute('v:shapes').indexOf('img1') < 0
|
|
29910
|
+
imgElem[i].getAttribute('v:shapes').indexOf('img1') < 0 &&
|
|
29911
|
+
imgElem[i].getAttribute('v:shapes').indexOf('Immagine') < 0) {
|
|
29894
29912
|
imgElem[i].classList.add('e-rte-image-unsupported');
|
|
29895
29913
|
}
|
|
29896
29914
|
imgElem[i].removeAttribute('v:shapes');
|
|
@@ -29904,7 +29922,8 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
29904
29922
|
if (imgElem.length > 0) {
|
|
29905
29923
|
for (var i = 0; i < imgElem.length; i++) {
|
|
29906
29924
|
imgSrc.push(imgElem[i].getAttribute('src'));
|
|
29907
|
-
|
|
29925
|
+
var imageName = imgElem[i].getAttribute('src').split('/')[imgElem[i].getAttribute('src').split('/').length - 1].split('.')[0] + i;
|
|
29926
|
+
imgName.push(imageName);
|
|
29908
29927
|
}
|
|
29909
29928
|
var hexValue = this.hexConversion(rtfData);
|
|
29910
29929
|
for (var i = 0; i < hexValue.length; i++) {
|
|
@@ -33851,8 +33870,20 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
33851
33870
|
this.parent.trigger(imageUploadSuccess, e, function (e) {
|
|
33852
33871
|
if (!isNullOrUndefined(_this.parent.insertImageSettings.path)) {
|
|
33853
33872
|
var url = _this.parent.insertImageSettings.path + e.file.name;
|
|
33854
|
-
imgElem
|
|
33855
|
-
|
|
33873
|
+
if (!_this.parent.inputElement.contains(imgElem)) {
|
|
33874
|
+
var imgHtmlElems = _this.parent.inputElement.querySelectorAll('#' + imgElem.id);
|
|
33875
|
+
for (var i = 0; i < imgHtmlElems.length; i++) {
|
|
33876
|
+
var imgHtmlElem = imgHtmlElems[i];
|
|
33877
|
+
if (imgHtmlElem && imgHtmlElem.style && imgHtmlElem.style.opacity === '0.5') {
|
|
33878
|
+
imgHtmlElem.src = url;
|
|
33879
|
+
imgHtmlElem.setAttribute('alt', e.file.name);
|
|
33880
|
+
}
|
|
33881
|
+
}
|
|
33882
|
+
}
|
|
33883
|
+
else {
|
|
33884
|
+
imgElem.src = url;
|
|
33885
|
+
imgElem.setAttribute('alt', e.file.name);
|
|
33886
|
+
}
|
|
33856
33887
|
}
|
|
33857
33888
|
});
|
|
33858
33889
|
}
|
|
@@ -33865,7 +33896,18 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
33865
33896
|
}
|
|
33866
33897
|
this.popupCloseTime = setTimeout(function () {
|
|
33867
33898
|
popupObj.close();
|
|
33868
|
-
|
|
33899
|
+
if (!_this.parent.inputElement.contains(imgElem)) {
|
|
33900
|
+
var imgHtmlElems = _this.parent.inputElement.querySelectorAll('#' + imgElem.id);
|
|
33901
|
+
for (var i = 0; i < imgHtmlElems.length; i++) {
|
|
33902
|
+
var imgHtmlElem = imgHtmlElems[i];
|
|
33903
|
+
if (imgHtmlElem && imgHtmlElem.style && imgHtmlElem.style.opacity === '0.5') {
|
|
33904
|
+
imgHtmlElem.style.opacity = '1';
|
|
33905
|
+
}
|
|
33906
|
+
}
|
|
33907
|
+
}
|
|
33908
|
+
else {
|
|
33909
|
+
imgElem.style.opacity = '1';
|
|
33910
|
+
}
|
|
33869
33911
|
_this.toolbarEnableDisable(false);
|
|
33870
33912
|
if (uploadObj && document.body.contains(uploadObj.element)) {
|
|
33871
33913
|
uploadObj.destroy();
|
|
@@ -37554,7 +37596,14 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
37554
37596
|
var isMediaNode = false; // To check the image audio and video node cases
|
|
37555
37597
|
var isFocusedFirst = false;
|
|
37556
37598
|
var parentElement = _this.range.startContainer.parentElement;
|
|
37557
|
-
var isPreWrapApplied =
|
|
37599
|
+
var isPreWrapApplied = false;
|
|
37600
|
+
var isTextWrapApplied = false;
|
|
37601
|
+
if (parentElement) {
|
|
37602
|
+
// eslint-disable-next-line max-len
|
|
37603
|
+
var computedStyle = _this.parent.contentModule.getDocument().defaultView.getComputedStyle(parentElement);
|
|
37604
|
+
isPreWrapApplied = computedStyle.getPropertyValue('white-space') === 'pre-wrap';
|
|
37605
|
+
isTextWrapApplied = computedStyle.getPropertyValue('text-wrap') === 'nowrap';
|
|
37606
|
+
}
|
|
37558
37607
|
if (_this.range.startOffset !== 0 && _this.range.endOffset !== 0 &&
|
|
37559
37608
|
_this.range.startContainer === _this.range.endContainer && !(!isNullOrUndefined(nearBlockNode.childNodes[0])
|
|
37560
37609
|
&& (nearBlockNode.childNodes[0].nodeName === 'IMG' || nearBlockNode.querySelectorAll('img, audio, video').length > 0))) {
|
|
@@ -37564,9 +37613,9 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
37564
37613
|
var isSplitTextEmpty = splitFirstText.trim().length === 0;
|
|
37565
37614
|
var hasContentAfterCursor = startNodeText.slice(_this.range.startOffset).trim().length !== 0;
|
|
37566
37615
|
var isCursorAtStartNonPreWrap = lastCharBeforeCursor !== 160
|
|
37567
|
-
&& isSplitTextEmpty && !isPreWrapApplied;
|
|
37616
|
+
&& isSplitTextEmpty && !isPreWrapApplied && !isTextWrapApplied;
|
|
37568
37617
|
var isCursorAtStartPreWrapWithContent = lastCharBeforeCursor === 32
|
|
37569
|
-
&& isPreWrapApplied && isSplitTextEmpty && hasContentAfterCursor;
|
|
37618
|
+
&& (isPreWrapApplied || isTextWrapApplied) && isSplitTextEmpty && hasContentAfterCursor;
|
|
37570
37619
|
if (isCursorAtStartNonPreWrap || isCursorAtStartPreWrapWithContent) {
|
|
37571
37620
|
isFocusedFirst = true;
|
|
37572
37621
|
}
|