@syncfusion/ej2-richtexteditor 27.1.55 → 27.1.57
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 +105 -25
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +104 -24
- 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/config.d.ts +7 -0
- package/src/common/config.js +12 -0
- package/src/editor-manager/plugin/image.js +2 -2
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +1 -0
- package/src/editor-manager/plugin/ms-word-clean-up.js +16 -0
- package/src/rich-text-editor/actions/resize.js +4 -0
- package/src/rich-text-editor/renderer/audio-module.js +7 -1
- package/src/rich-text-editor/renderer/image-module.js +51 -18
- package/src/rich-text-editor/renderer/link-module.js +3 -0
- package/src/rich-text-editor/renderer/table-module.js +3 -2
- package/src/rich-text-editor/renderer/video-module.js +7 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 27.1.
|
|
3
|
+
* version : 27.1.57
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-richtexteditor@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-richtexteditor@27.1.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@27.1.55",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-FkQvU6rbg+RgDWBi+nu3SpZ2kwoDNif3vbSxDqbVh3crbjTrl8mnEY2l9DPXgzMI8AKbrzkywhmbz+QU7Py+Xg==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-richtexteditor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"/@syncfusion/ej2-react-richtexteditor",
|
|
26
26
|
"/@syncfusion/ej2-vue-richtexteditor"
|
|
27
27
|
],
|
|
28
|
-
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-27.1.
|
|
29
|
-
"_shasum": "
|
|
28
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-27.1.55.tgz",
|
|
29
|
+
"_shasum": "a888e8865fd0e8182ac49c4f745d8f6f78b6bf6a",
|
|
30
30
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
31
31
|
"_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
|
|
32
32
|
"author": {
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@syncfusion/ej2-base": "~27.1.55",
|
|
41
41
|
"@syncfusion/ej2-buttons": "~27.1.53",
|
|
42
|
-
"@syncfusion/ej2-dropdowns": "~27.1.
|
|
42
|
+
"@syncfusion/ej2-dropdowns": "~27.1.57",
|
|
43
43
|
"@syncfusion/ej2-filemanager": "~27.1.55",
|
|
44
44
|
"@syncfusion/ej2-inputs": "~27.1.55",
|
|
45
|
-
"@syncfusion/ej2-navigations": "~27.1.
|
|
46
|
-
"@syncfusion/ej2-popups": "~27.1.
|
|
47
|
-
"@syncfusion/ej2-splitbuttons": "~27.1.
|
|
45
|
+
"@syncfusion/ej2-navigations": "~27.1.57",
|
|
46
|
+
"@syncfusion/ej2-popups": "~27.1.57",
|
|
47
|
+
"@syncfusion/ej2-splitbuttons": "~27.1.56"
|
|
48
48
|
},
|
|
49
49
|
"deprecated": false,
|
|
50
50
|
"description": "Essential JS 2 RichTextEditor component",
|
|
@@ -80,6 +80,6 @@
|
|
|
80
80
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
81
81
|
},
|
|
82
82
|
"typings": "index.d.ts",
|
|
83
|
-
"version": "27.1.
|
|
83
|
+
"version": "27.1.57",
|
|
84
84
|
"sideEffects": false
|
|
85
85
|
}
|
package/src/common/config.d.ts
CHANGED
|
@@ -54,6 +54,13 @@ export declare const selfClosingTags: string[];
|
|
|
54
54
|
*
|
|
55
55
|
*/
|
|
56
56
|
export declare const imageResizeFactor: IImageResizeFactor;
|
|
57
|
+
/**
|
|
58
|
+
* Resize factor for image in iframe editor.
|
|
59
|
+
*
|
|
60
|
+
*@hidden
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
export declare const iframeResizeFactor: IImageResizeFactor;
|
|
57
64
|
/**
|
|
58
65
|
* Mention restrict key configuration.
|
|
59
66
|
*
|
package/src/common/config.js
CHANGED
|
@@ -142,6 +142,18 @@ export var imageResizeFactor = {
|
|
|
142
142
|
botRight: [1, 1],
|
|
143
143
|
botLeft: [-1, 1]
|
|
144
144
|
};
|
|
145
|
+
/**
|
|
146
|
+
* Resize factor for image in iframe editor.
|
|
147
|
+
*
|
|
148
|
+
*@hidden
|
|
149
|
+
*
|
|
150
|
+
*/
|
|
151
|
+
export var iframeResizeFactor = {
|
|
152
|
+
topLeft: [-1.2, -1.2],
|
|
153
|
+
topRight: [1.2, -1.2],
|
|
154
|
+
botRight: [1.2, 1.2],
|
|
155
|
+
botLeft: [-1.2, 1.2]
|
|
156
|
+
};
|
|
145
157
|
/**
|
|
146
158
|
* Mention restrict key configuration.
|
|
147
159
|
*
|
|
@@ -119,8 +119,8 @@ var ImageCommand = /** @class */ (function () {
|
|
|
119
119
|
(Browser.isIE ? selectedNode.previousSibling : selectedNode.previousElementSibling);
|
|
120
120
|
var onImageLoadEvent_1 = function () {
|
|
121
121
|
if (!isNOU(_this.parent.currentDocument)) {
|
|
122
|
-
imgElm_1.setAttribute('width',
|
|
123
|
-
imgElm_1.setAttribute('height',
|
|
122
|
+
imgElm_1.setAttribute('width', imgElm_1.offsetWidth.toString());
|
|
123
|
+
imgElm_1.setAttribute('height', imgElm_1.offsetHeight.toString());
|
|
124
124
|
e.callBack({
|
|
125
125
|
requestType: (e.value === 'Replace') ? (e.item.subCommand = 'Replace', 'Replace') : 'Images',
|
|
126
126
|
editorMode: 'HTML',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as EVENTS from '../../common/constant';
|
|
2
2
|
import { createElement, isNullOrUndefined as isNOU, detach, addClass, Browser } from '@syncfusion/ej2-base';
|
|
3
3
|
import { PASTE_SOURCE } from '../base/constant';
|
|
4
|
+
import { InsertMethods } from './insert-methods';
|
|
4
5
|
/**
|
|
5
6
|
* PasteCleanup for MsWord content
|
|
6
7
|
*
|
|
@@ -99,6 +100,9 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
99
100
|
e.callBack(elm.innerHTML, this.cropImageDimensions, source);
|
|
100
101
|
}
|
|
101
102
|
else {
|
|
103
|
+
if (source === PASTE_SOURCE[2]) {
|
|
104
|
+
this.handleOneNoteContent(elm);
|
|
105
|
+
}
|
|
102
106
|
e.callBack(elm.innerHTML, null, source);
|
|
103
107
|
}
|
|
104
108
|
};
|
|
@@ -1093,6 +1097,18 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
1093
1097
|
}
|
|
1094
1098
|
return 'html';
|
|
1095
1099
|
};
|
|
1100
|
+
MsWordPaste.prototype.handleOneNoteContent = function (element) {
|
|
1101
|
+
var allListElements = element.querySelectorAll('ul, ol');
|
|
1102
|
+
if (allListElements.length > 0) {
|
|
1103
|
+
for (var i = 0; i < allListElements.length; i++) {
|
|
1104
|
+
// Removing the ul and ol parent node for the p tag
|
|
1105
|
+
var currentList = allListElements[i];
|
|
1106
|
+
if (currentList.querySelectorAll('li').length === 0 && currentList.childNodes.length > 0) {
|
|
1107
|
+
InsertMethods.unwrap(currentList);
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
};
|
|
1096
1112
|
MsWordPaste.prototype.destroy = function () {
|
|
1097
1113
|
this.removeEventListener();
|
|
1098
1114
|
};
|
|
@@ -80,6 +80,10 @@ var Resize = /** @class */ (function () {
|
|
|
80
80
|
this.parent.element.style.height = eventType.clientY - boundRect.top + 'px';
|
|
81
81
|
this.parent.element.style.width = (!this.parent.enableRtl) ? eventType.clientX - boundRect.left + 'px' : boundRect.right - eventType.clientX + 'px';
|
|
82
82
|
}
|
|
83
|
+
var rteContent = this.parent.element.querySelector('#' + this.parent.getID() + '_source-view');
|
|
84
|
+
if (!isNullOrUndefined(rteContent)) {
|
|
85
|
+
rteContent.style.height = this.parent.element.style.height;
|
|
86
|
+
}
|
|
83
87
|
this.parent.refreshUI();
|
|
84
88
|
};
|
|
85
89
|
Resize.prototype.stopResize = function (e) {
|
|
@@ -844,6 +844,9 @@ var Audio = /** @class */ (function () {
|
|
|
844
844
|
proxy.uploadUrl.cssClass = (proxy.parent.insertAudioSettings.layoutOption === 'Inline' ?
|
|
845
845
|
classes.CLS_AUDIOINLINE : classes.CLS_AUDIOBREAK);
|
|
846
846
|
proxy.dialogObj.hide({ returnValue: false });
|
|
847
|
+
if (proxy.dialogObj !== null) {
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
847
850
|
proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, proxy.uploadUrl);
|
|
848
851
|
proxy.uploadUrl.url = '';
|
|
849
852
|
}
|
|
@@ -862,8 +865,11 @@ var Audio = /** @class */ (function () {
|
|
|
862
865
|
url: url, selection: this.selection, fileName: name_1,
|
|
863
866
|
selectParent: this.selectParent
|
|
864
867
|
};
|
|
865
|
-
proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, value);
|
|
866
868
|
proxy.dialogObj.hide({ returnValue: false });
|
|
869
|
+
if (proxy.dialogObj !== null) {
|
|
870
|
+
return;
|
|
871
|
+
}
|
|
872
|
+
proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, value);
|
|
867
873
|
}
|
|
868
874
|
};
|
|
869
875
|
/* eslint-disable */
|
|
@@ -8,7 +8,7 @@ import { Button, CheckBox } from '@syncfusion/ej2-buttons';
|
|
|
8
8
|
import { RenderType, ImageInputSource } from '../base/enum';
|
|
9
9
|
import { dispatchEvent, parseHtml, hasClass, convertToBlob } from '../base/util';
|
|
10
10
|
import { isIDevice } from '../../common/util';
|
|
11
|
-
import { imageResizeFactor } from '../../common/config';
|
|
11
|
+
import { iframeResizeFactor, imageResizeFactor } from '../../common/config';
|
|
12
12
|
/**
|
|
13
13
|
* `Image` module is used to handle image actions.
|
|
14
14
|
*/
|
|
@@ -208,8 +208,14 @@ var Image = /** @class */ (function () {
|
|
|
208
208
|
if (this.parent.formatter.getUndoRedoStack().length === 0) {
|
|
209
209
|
this.parent.formatter.saveData();
|
|
210
210
|
}
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
if (this.parent.iframeSettings.enable) {
|
|
212
|
+
this.pageX = e.screenX;
|
|
213
|
+
this.pageY = e.screenY;
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
this.pageX = this.getPointX(e);
|
|
217
|
+
this.pageY = this.getPointY(e);
|
|
218
|
+
}
|
|
213
219
|
e.preventDefault();
|
|
214
220
|
e.stopImmediatePropagation();
|
|
215
221
|
this.resizeBtnInit();
|
|
@@ -474,29 +480,50 @@ var Image = /** @class */ (function () {
|
|
|
474
480
|
return;
|
|
475
481
|
}
|
|
476
482
|
if (this.resizeBtnStat.botRight || this.resizeBtnStat.botLeft || this.resizeBtnStat.topRight || this.resizeBtnStat.topLeft) {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
483
|
+
if (this.parent.iframeSettings.enable) {
|
|
484
|
+
var resizeFactor = this.getResizeFactor(this.currentResizeHandler);
|
|
485
|
+
var currentScreenX = e.screenX;
|
|
486
|
+
var currentScreenY = e.screenY;
|
|
487
|
+
var currentWidth = this.imgEle.clientWidth;
|
|
488
|
+
var currentHeight = this.imgEle.clientHeight;
|
|
489
|
+
var deltaX = currentScreenX - this.pageX;
|
|
490
|
+
var deltaY = currentScreenY - this.pageY;
|
|
491
|
+
var width = deltaX * resizeFactor[0] + currentWidth;
|
|
492
|
+
var height = deltaY * resizeFactor[1] + currentHeight;
|
|
493
|
+
var dimensions = this.adjustDimensions(width, height, deltaX, deltaY, this.aspectRatio);
|
|
494
|
+
this.pageX = currentScreenX;
|
|
495
|
+
this.pageY = currentScreenY;
|
|
496
|
+
this.imgDupMouseMove(dimensions.width + 'px', dimensions.height + 'px', e);
|
|
497
|
+
this.parent.autoResize();
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
var pageX = this.getPointX(e);
|
|
501
|
+
var pageY = this.getPointY(e);
|
|
502
|
+
var resizeFactor = this.getResizeFactor(this.currentResizeHandler);
|
|
503
|
+
var diffX = (pageX - this.pageX);
|
|
504
|
+
var diffY = (pageY - this.pageY);
|
|
505
|
+
var currentWidth = this.imgEle.clientWidth;
|
|
506
|
+
var currentHeight = this.imgEle.clientHeight;
|
|
507
|
+
var width = diffX * resizeFactor[0] + currentWidth;
|
|
508
|
+
var height = diffY * resizeFactor[1] + currentHeight;
|
|
509
|
+
var dimensions = this.adjustDimensions(width, height, diffX, diffY, this.aspectRatio);
|
|
510
|
+
this.pageX = pageX;
|
|
511
|
+
this.pageY = pageY;
|
|
512
|
+
this.imgDupMouseMove(dimensions.width + 'px', dimensions.height + 'px', e);
|
|
513
|
+
}
|
|
490
514
|
}
|
|
491
515
|
};
|
|
492
516
|
Image.prototype.adjustDimensions = function (width, height, diffX, diffY, aspectRatio) {
|
|
493
517
|
width = (width < 16) ? 16 : width;
|
|
494
518
|
height = (height < 16) ? 16 : height;
|
|
495
|
-
var isWidthPrimary =
|
|
519
|
+
var isWidthPrimary = width > height;
|
|
496
520
|
var dimensions = this.adjustDimensionsByAspectRatio(width, height, aspectRatio, isWidthPrimary);
|
|
497
521
|
return dimensions;
|
|
498
522
|
};
|
|
499
523
|
Image.prototype.getResizeFactor = function (value) {
|
|
524
|
+
if (this.parent.iframeSettings.enable) {
|
|
525
|
+
return iframeResizeFactor[value];
|
|
526
|
+
}
|
|
500
527
|
return imageResizeFactor[value];
|
|
501
528
|
};
|
|
502
529
|
Image.prototype.findAspectRatio = function (image) {
|
|
@@ -1590,6 +1617,9 @@ var Image = /** @class */ (function () {
|
|
|
1590
1617
|
proxy.uploadUrl.cssClass = (proxy.parent.insertImageSettings.display === 'inline' ?
|
|
1591
1618
|
classes.CLS_IMGINLINE : classes.CLS_IMGBREAK);
|
|
1592
1619
|
proxy.dialogObj.hide({ returnValue: false });
|
|
1620
|
+
if (proxy.dialogObj !== null) {
|
|
1621
|
+
return;
|
|
1622
|
+
}
|
|
1593
1623
|
proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, proxy.uploadUrl);
|
|
1594
1624
|
proxy.uploadUrl.url = '';
|
|
1595
1625
|
if (proxy.contentModule.getEditPanel().querySelector('.e-img-resize')) {
|
|
@@ -1620,8 +1650,11 @@ var Image = /** @class */ (function () {
|
|
|
1620
1650
|
maxHeight: proxy.parent.insertImageSettings.maxHeight
|
|
1621
1651
|
}
|
|
1622
1652
|
};
|
|
1623
|
-
proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, value);
|
|
1624
1653
|
proxy.dialogObj.hide({ returnValue: false });
|
|
1654
|
+
if (proxy.dialogObj !== null) {
|
|
1655
|
+
return;
|
|
1656
|
+
}
|
|
1657
|
+
proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, value);
|
|
1625
1658
|
}
|
|
1626
1659
|
};
|
|
1627
1660
|
Image.prototype.imgsizeInput = function (e) {
|
|
@@ -427,6 +427,9 @@ var Link = /** @class */ (function () {
|
|
|
427
427
|
if (document.body.contains(proxy.dialogObj.element)) {
|
|
428
428
|
this.selfLink.dialogObj.hide({ returnValue: false });
|
|
429
429
|
}
|
|
430
|
+
if (this.selfLink.dialogObj !== null) {
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
430
433
|
if (isIDevice() && proxy.parent.iframeSettings.enable) {
|
|
431
434
|
select('iframe', proxy.parent.element).contentWindow.focus();
|
|
432
435
|
}
|
|
@@ -1419,7 +1419,8 @@ var Table = /** @class */ (function () {
|
|
|
1419
1419
|
else {
|
|
1420
1420
|
var tableReBox = _this.contentModule.getEditPanel().querySelector('.e-table-box');
|
|
1421
1421
|
var tableWidth = parseInt(getComputedStyle(_this.curTable).width, 10);
|
|
1422
|
-
var tableHeight = parseInt(
|
|
1422
|
+
var tableHeight = !isNaN(parseInt(_this.curTable.style.height, 10)) ?
|
|
1423
|
+
parseInt(_this.curTable.style.height, 10) : parseInt(getComputedStyle(_this.curTable).height, 10);
|
|
1423
1424
|
var paddingSize = +getComputedStyle(_this.contentModule.getEditPanel()).paddingRight.match(/\d/g).join('');
|
|
1424
1425
|
var rteWidth = _this.contentModule.getEditPanel().offsetWidth -
|
|
1425
1426
|
(_this.contentModule.getEditPanel().offsetWidth -
|
|
@@ -1564,7 +1565,7 @@ var Table = /** @class */ (function () {
|
|
|
1564
1565
|
_this.curTable.style.height = tableHeight + mouseY + 'px';
|
|
1565
1566
|
if (!isNOU(tableReBox)) {
|
|
1566
1567
|
tableReBox.classList.add('e-rbox-select');
|
|
1567
|
-
tableReBox.style.cssText = 'top: ' + (_this.calcPos(_this.curTable).top +
|
|
1568
|
+
tableReBox.style.cssText = 'top: ' + (_this.calcPos(_this.curTable).top + parseInt(getComputedStyle(_this.curTable).height, 10) - 4) +
|
|
1568
1569
|
'px; left:' + (_this.calcPos(_this.curTable).left + tableWidth - 4) + 'px;';
|
|
1569
1570
|
}
|
|
1570
1571
|
if (_this.curTable.closest('li')) {
|
|
@@ -1446,6 +1446,9 @@ var Video = /** @class */ (function () {
|
|
|
1446
1446
|
maxHeight: proxy.parent.insertVideoSettings.maxHeight
|
|
1447
1447
|
};
|
|
1448
1448
|
proxy.dialogObj.hide({ returnValue: false });
|
|
1449
|
+
if (proxy.dialogObj !== null) {
|
|
1450
|
+
return;
|
|
1451
|
+
}
|
|
1449
1452
|
proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, proxy.uploadUrl);
|
|
1450
1453
|
proxy.uploadUrl.url = '';
|
|
1451
1454
|
}
|
|
@@ -1472,8 +1475,11 @@ var Video = /** @class */ (function () {
|
|
|
1472
1475
|
maxHeight: proxy.parent.insertVideoSettings.maxHeight
|
|
1473
1476
|
}
|
|
1474
1477
|
};
|
|
1475
|
-
proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, value);
|
|
1476
1478
|
proxy.dialogObj.hide({ returnValue: false });
|
|
1479
|
+
if (proxy.dialogObj !== null) {
|
|
1480
|
+
return;
|
|
1481
|
+
}
|
|
1482
|
+
proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, value);
|
|
1477
1483
|
}
|
|
1478
1484
|
};
|
|
1479
1485
|
/* eslint-disable */
|