@syncfusion/ej2-richtexteditor 26.1.38 → 26.1.40
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 +74 -26
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +74 -26
- 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/ms-word-clean-up.js +1 -1
- package/src/editor-manager/plugin/video.js +12 -1
- package/src/rich-text-editor/actions/base-quick-toolbar.js +1 -1
- package/src/rich-text-editor/actions/enter-key.js +31 -5
- package/src/rich-text-editor/actions/html-editor.js +4 -0
- package/src/rich-text-editor/actions/toolbar.js +2 -1
- package/src/rich-text-editor/base/rich-text-editor.js +0 -9
- package/src/rich-text-editor/renderer/image-module.d.ts +4 -0
- package/src/rich-text-editor/renderer/image-module.js +16 -8
- package/src/rich-text-editor/renderer/table-module.js +1 -1
- package/src/rich-text-editor/renderer/video-module.js +8 -0
- package/styles/fluent2.css +5 -5
- package/styles/material3-dark.css +6 -6
- package/styles/material3.css +6 -6
- package/styles/rich-text-editor/_layout.scss +8 -8
- package/styles/rich-text-editor/_material3-definition.scss +2 -2
- package/styles/rich-text-editor/fluent2.css +5 -5
- package/styles/rich-text-editor/material3-dark.css +6 -6
- package/styles/rich-text-editor/material3.css +6 -6
|
@@ -6949,7 +6949,7 @@ var Toolbar = /** @__PURE__ @class */ (function () {
|
|
|
6949
6949
|
*/
|
|
6950
6950
|
Toolbar.prototype.updateItem = function (args) {
|
|
6951
6951
|
var item = this.tools[args.updateItem.toLocaleLowerCase()];
|
|
6952
|
-
if (this.parent.locale !== 'en-US') {
|
|
6952
|
+
if ((getTooltipText(args.updateItem.toLocaleLowerCase(), this.locator) !== 'Code View' && getTooltipText(args.updateItem.toLocaleLowerCase(), this.locator) !== 'Preview') || this.parent.locale !== 'en-US') {
|
|
6953
6953
|
item.tooltip = getTooltipText(args.updateItem.toLocaleLowerCase(), this.locator);
|
|
6954
6954
|
}
|
|
6955
6955
|
var trgItem = this.tools[args.targetItem.toLocaleLowerCase()];
|
|
@@ -8091,7 +8091,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
8091
8091
|
_this.checkCollision(showPopupData, 'document', ((_this.parent.inlineMode.enable) ? 'inline' : (type === 'text') ? 'text' : ''));
|
|
8092
8092
|
_this.popupObj.element.classList.remove('e-popup-open');
|
|
8093
8093
|
removeClass([_this.element], [CLS_HIDE]);
|
|
8094
|
-
_this.popupObj.show({ name: 'ZoomIn', duration: (Browser.isIE ? 250 : 400) });
|
|
8094
|
+
_this.popupObj.show({ name: 'ZoomIn', duration: (Browser.isIE ? 250 : 400) }, target);
|
|
8095
8095
|
if (_this.popupObj && _this.parent.cssClass) {
|
|
8096
8096
|
removeClass([_this.popupObj.element], _this.parent.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
8097
8097
|
addClass([_this.popupObj.element], _this.parent.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
@@ -16976,6 +16976,7 @@ var VideoCommand = /** @__PURE__ @class */ (function () {
|
|
|
16976
16976
|
clickElement.appendChild(temp.content);
|
|
16977
16977
|
this.vidElement = sourceElement = clickElement.firstElementChild;
|
|
16978
16978
|
this.setStyle(sourceElement, e, this.vidElement);
|
|
16979
|
+
wrapElement.style.display = (e.item.cssClass === CLASS_VIDEO_INLINE) ? 'inline-block' : 'block';
|
|
16979
16980
|
wrapElement.appendChild(clickElement);
|
|
16980
16981
|
}
|
|
16981
16982
|
else {
|
|
@@ -17108,6 +17109,16 @@ var VideoCommand = /** @__PURE__ @class */ (function () {
|
|
|
17108
17109
|
if (!isNullOrUndefined(e.item.height) && !isNullOrUndefined(e.item.height.maxHeight)) {
|
|
17109
17110
|
videoEle.style.maxHeight = formatUnit(e.item.height.maxHeight);
|
|
17110
17111
|
}
|
|
17112
|
+
if (!isNullOrUndefined(e.item.cssClass)) {
|
|
17113
|
+
if (e.item.cssClass === CLASS_VIDEO_BREAK) {
|
|
17114
|
+
addClass([videoEle], [CLASS_VIDEO_BREAK]);
|
|
17115
|
+
removeClass([videoEle], [CLASS_VIDEO_INLINE]);
|
|
17116
|
+
}
|
|
17117
|
+
else {
|
|
17118
|
+
addClass([videoEle], [CLASS_VIDEO_INLINE]);
|
|
17119
|
+
removeClass([videoEle], [CLASS_VIDEO_BREAK]);
|
|
17120
|
+
}
|
|
17121
|
+
}
|
|
17111
17122
|
};
|
|
17112
17123
|
VideoCommand.prototype.videoDimension = function (e) {
|
|
17113
17124
|
var selectNode = !(e.item.selectNode[0].classList.contains(CLASS_VIDEO_CLICK_ELEM)) ? e.item.selectNode[0] :
|
|
@@ -20479,7 +20490,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
20479
20490
|
if (content && content.indexOf('mso-list:') !== -1) {
|
|
20480
20491
|
var msoListValue = void 0;
|
|
20481
20492
|
if (content.match(/mso-list:[^;]+;?/)) {
|
|
20482
|
-
var changedContent = content.replace('\n', '').split(' ').join('');
|
|
20493
|
+
var changedContent = content.replace(new RegExp('\n', 'g'), '').split(' ').join('');
|
|
20483
20494
|
msoListValue = changedContent.match(/mso-list:[^;]+;?/)[0].split(':l');
|
|
20484
20495
|
listFormatOverride = isNullOrUndefined(msoListValue) ? null : parseInt(msoListValue[1].split('level')[0], 10);
|
|
20485
20496
|
}
|
|
@@ -23007,6 +23018,10 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
23007
23018
|
}
|
|
23008
23019
|
paraElem[i].innerHTML = resultSplitContent.trim();
|
|
23009
23020
|
}
|
|
23021
|
+
var anchorElement = divElement.childNodes[0];
|
|
23022
|
+
if (!isNullOrUndefined(anchorElement) && !isNullOrUndefined(anchorElement.childNodes[0]) && anchorElement.nodeName === 'SPAN' && anchorElement.childNodes[0].nodeName === 'A') {
|
|
23023
|
+
divElement.innerHTML = divElement.innerHTML.replace('<span>', '').replace('</span>', '');
|
|
23024
|
+
}
|
|
23010
23025
|
if (!isNullOrUndefined(this.parent.pasteCleanupModule)) {
|
|
23011
23026
|
e.callBack(divElement.innerHTML);
|
|
23012
23027
|
}
|
|
@@ -26792,6 +26807,10 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26792
26807
|
this.rendererFactory = serviceLocator.getService('rendererFactory');
|
|
26793
26808
|
this.dialogRenderObj = serviceLocator.getService('dialogRenderObject');
|
|
26794
26809
|
this.addEventListener();
|
|
26810
|
+
this.drop = this.dragDrop.bind(this);
|
|
26811
|
+
this.drag = this.dragOver.bind(this);
|
|
26812
|
+
this.enter = this.dragEnter.bind(this);
|
|
26813
|
+
this.start = this.dragStart.bind(this);
|
|
26795
26814
|
}
|
|
26796
26815
|
Image.prototype.addEventListener = function () {
|
|
26797
26816
|
if (this.parent.isDestroyed) {
|
|
@@ -26850,10 +26869,14 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26850
26869
|
this.parent.off(moduleDestroy, this.moduleDestroy);
|
|
26851
26870
|
var dropElement = this.parent.iframeSettings.enable ? this.parent.inputElement.ownerDocument
|
|
26852
26871
|
: this.parent.inputElement;
|
|
26853
|
-
dropElement.removeEventListener('drop', this.
|
|
26854
|
-
dropElement.removeEventListener('dragstart', this.
|
|
26855
|
-
dropElement.removeEventListener('dragenter', this.
|
|
26856
|
-
dropElement.removeEventListener('dragover', this.
|
|
26872
|
+
dropElement.removeEventListener('drop', this.drop, true);
|
|
26873
|
+
dropElement.removeEventListener('dragstart', this.drag, true);
|
|
26874
|
+
dropElement.removeEventListener('dragenter', this.enter, true);
|
|
26875
|
+
dropElement.removeEventListener('dragover', this.start, true);
|
|
26876
|
+
this.drop = null;
|
|
26877
|
+
this.drag = null;
|
|
26878
|
+
this.enter = null;
|
|
26879
|
+
this.start = null;
|
|
26857
26880
|
if (!isNullOrUndefined(this.contentModule)) {
|
|
26858
26881
|
EventHandler.remove(this.contentModule.getEditPanel(), Browser.touchEndEvent, this.imageClick);
|
|
26859
26882
|
this.parent.formatter.editorManager.observer.off(checkUndo, this.undoStack);
|
|
@@ -26907,10 +26930,10 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26907
26930
|
}
|
|
26908
26931
|
var dropElement = this.parent.iframeSettings.enable ? this.parent.inputElement.ownerDocument :
|
|
26909
26932
|
this.parent.inputElement;
|
|
26910
|
-
dropElement.addEventListener('drop', this.
|
|
26911
|
-
dropElement.addEventListener('dragstart', this.
|
|
26912
|
-
dropElement.addEventListener('dragenter', this.
|
|
26913
|
-
dropElement.addEventListener('dragover', this.
|
|
26933
|
+
dropElement.addEventListener('drop', this.drop, true);
|
|
26934
|
+
dropElement.addEventListener('dragstart', this.drag, true);
|
|
26935
|
+
dropElement.addEventListener('dragenter', this.enter, true);
|
|
26936
|
+
dropElement.addEventListener('dragover', this.start, true);
|
|
26914
26937
|
};
|
|
26915
26938
|
Image.prototype.undoStack = function (args) {
|
|
26916
26939
|
if (args.subCommand.toLowerCase() === 'undo' || args.subCommand.toLowerCase() === 'redo') {
|
|
@@ -31362,6 +31385,14 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
31362
31385
|
if (!isNullOrUndefined(proxy.uploadUrl) && proxy.uploadUrl.url !== '') {
|
|
31363
31386
|
proxy.uploadUrl.cssClass = (proxy.parent.insertVideoSettings.layoutOption === 'Inline' ?
|
|
31364
31387
|
CLS_VIDEOINLINE : CLS_VIDEOBREAK);
|
|
31388
|
+
proxy.uploadUrl.width = {
|
|
31389
|
+
width: proxy.parent.insertVideoSettings.width, minWidth: proxy.parent.insertVideoSettings.minWidth,
|
|
31390
|
+
maxWidth: proxy.parent.getInsertImgMaxWidth()
|
|
31391
|
+
};
|
|
31392
|
+
proxy.uploadUrl.height = {
|
|
31393
|
+
height: proxy.parent.insertVideoSettings.height, minHeight: proxy.parent.insertVideoSettings.minHeight,
|
|
31394
|
+
maxHeight: proxy.parent.insertVideoSettings.maxHeight
|
|
31395
|
+
};
|
|
31365
31396
|
proxy.dialogObj.hide({ returnValue: false });
|
|
31366
31397
|
proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, proxy.uploadUrl);
|
|
31367
31398
|
proxy.uploadUrl.url = '';
|
|
@@ -33677,7 +33708,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
33677
33708
|
var argument = ((Browser.isDevice || (!isNullOrUndefined(args.args)
|
|
33678
33709
|
&& !isNullOrUndefined(args.args.originalEvent) &&
|
|
33679
33710
|
args.args.originalEvent.action === 'insert-table')
|
|
33680
|
-
|| proxy.parent.inlineMode.enable || !isNullOrUndefined(proxy.parent.quickToolbarSettings.text)) ? args :
|
|
33711
|
+
|| proxy.parent.inlineMode.enable || ((!isNullOrUndefined(proxy.parent.quickToolbarSettings.text)) && !(args instanceof PointerEvent))) ? args :
|
|
33681
33712
|
this);
|
|
33682
33713
|
proxy.tableInsert(proxy.rowTextBox.value, proxy.columnTextBox.value, e, argument);
|
|
33683
33714
|
}
|
|
@@ -35116,8 +35147,17 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
35116
35147
|
}
|
|
35117
35148
|
else {
|
|
35118
35149
|
var lineBreakBRElem = _this.parent.createElement('br');
|
|
35119
|
-
_this.
|
|
35120
|
-
|
|
35150
|
+
var anchorElement = (!isNullOrUndefined(_this.range.startContainer.parentElement) && _this.range.startContainer.parentElement.nodeName === 'A'
|
|
35151
|
+
&& _this.range.startContainer.parentElement.textContent.length === _this.range.startOffset)
|
|
35152
|
+
? _this.range.startContainer.parentElement : _this.range.startContainer;
|
|
35153
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, anchorElement);
|
|
35154
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(lineBreakBRElem, anchorElement);
|
|
35155
|
+
var brSibling = anchorElement.nextElementSibling;
|
|
35156
|
+
var brNextSibling = !isNullOrUndefined(brSibling) ? brSibling.nextElementSibling : null;
|
|
35157
|
+
if (!isNullOrUndefined(brSibling) && !isNullOrUndefined(brNextSibling) && !isNullOrUndefined(brNextSibling.nextElementSibling) &&
|
|
35158
|
+
brSibling.nodeName === 'BR' && brNextSibling.nodeName === 'BR' && brNextSibling.nextElementSibling.nodeName === 'BR') {
|
|
35159
|
+
brNextSibling.nextElementSibling.remove();
|
|
35160
|
+
}
|
|
35121
35161
|
}
|
|
35122
35162
|
}
|
|
35123
35163
|
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), focusBRElem, 0);
|
|
@@ -35184,6 +35224,13 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
35184
35224
|
isFocusTextNode = false;
|
|
35185
35225
|
}
|
|
35186
35226
|
var brElm = this.parent.createElement('br');
|
|
35227
|
+
var findAnchorLastChild = this.startNode;
|
|
35228
|
+
while (findAnchorLastChild.lastChild) {
|
|
35229
|
+
findAnchorLastChild = findAnchorLastChild.lastChild;
|
|
35230
|
+
}
|
|
35231
|
+
var findAnchorElement = this.startNode.nodeName === 'A' && this.endNode.nodeName === 'A' &&
|
|
35232
|
+
!isNullOrUndefined(this.range.startContainer.parentElement) && this.range.startOffset === this.range.endOffset &&
|
|
35233
|
+
this.range.startContainer.textContent.trim().length === findAnchorLastChild.textContent.trim().length;
|
|
35187
35234
|
if (this.startNode.nodeName === 'BR' && this.endNode.nodeName === 'BR' && this.range.startOffset === 0 && this.range.startOffset === this.range.endOffset) {
|
|
35188
35235
|
this.parent.formatter.editorManager.domNode.insertAfter(brElm, this.startNode);
|
|
35189
35236
|
isEmptyBrInserted = true;
|
|
@@ -35193,15 +35240,25 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
35193
35240
|
this.range.startContainer.previousSibling.nodeName === 'BR' && this.range.startContainer.textContent.length === 0) {
|
|
35194
35241
|
isEmptyBrInserted = true;
|
|
35195
35242
|
}
|
|
35196
|
-
|
|
35243
|
+
if (findAnchorElement) {
|
|
35244
|
+
this.parent.formatter.editorManager.domNode.insertAfter(brElm, this.startNode);
|
|
35245
|
+
}
|
|
35246
|
+
else {
|
|
35247
|
+
this.range.insertNode(brElm);
|
|
35248
|
+
}
|
|
35197
35249
|
}
|
|
35198
35250
|
if (isEmptyBrInserted || (!isNullOrUndefined(brElm.nextElementSibling) && brElm.nextElementSibling.tagName === 'BR') || (!isNullOrUndefined(brElm.nextSibling) && brElm.nextSibling.textContent.length > 0)) {
|
|
35199
35251
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), !isNullOrUndefined(brElm.nextSibling) && isFocusTextNode ? brElm.nextSibling : brElm, 0);
|
|
35200
35252
|
isEmptyBrInserted = false;
|
|
35201
35253
|
}
|
|
35202
35254
|
else {
|
|
35203
|
-
var
|
|
35204
|
-
|
|
35255
|
+
var brElements = this.parent.createElement('br');
|
|
35256
|
+
if (findAnchorElement) {
|
|
35257
|
+
this.parent.formatter.editorManager.domNode.insertAfter(brElements, this.startNode);
|
|
35258
|
+
}
|
|
35259
|
+
else {
|
|
35260
|
+
this.range.insertNode(brElements);
|
|
35261
|
+
}
|
|
35205
35262
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), brElm, 0);
|
|
35206
35263
|
}
|
|
35207
35264
|
};
|
|
@@ -36406,15 +36463,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
36406
36463
|
detach(tooltipEle);
|
|
36407
36464
|
}
|
|
36408
36465
|
}
|
|
36409
|
-
if (this.element.offsetParent === null) {
|
|
36410
|
-
if (!isNullOrUndefined(this.toolbarModule)) {
|
|
36411
|
-
this.toolbarModule.destroy();
|
|
36412
|
-
}
|
|
36413
|
-
this.notify(moduleDestroy, {});
|
|
36414
|
-
_super.prototype.destroy.call(this);
|
|
36415
|
-
this.isRendered = false;
|
|
36416
|
-
return;
|
|
36417
|
-
}
|
|
36418
36466
|
this.notify(destroy, {});
|
|
36419
36467
|
this.destroyDependentModules();
|
|
36420
36468
|
this.unWireEvents();
|