@syncfusion/ej2-richtexteditor 19.4.38 → 19.4.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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- 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 +20 -12
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +20 -12
- 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 +7 -7
- package/src/editor-manager/plugin/lists.js +2 -1
- package/src/editor-manager/plugin/selection-commands.js +10 -5
- package/src/rich-text-editor/actions/color-picker.d.ts +1 -0
- package/src/rich-text-editor/actions/color-picker.js +2 -1
- package/src/rich-text-editor/base/interface.d.ts +1 -1
- package/src/rich-text-editor/renderer/image-module.js +3 -3
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +1 -1
- package/src/rich-text-editor/renderer/toolbar-renderer.js +3 -2
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 19.4.
|
|
3
|
+
* version : 19.4.40
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. 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@19.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@19.4.38",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-6lQRXzKBKx2rTh/eLeuOvRrNIGH+pQWuxYXfpi1Hsp2ufATyr9PRjEWAM412RFF5QJD2Ujy36dYqDh31SwcuLQ==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-richtexteditor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"/@syncfusion/ej2-react-richtexteditor",
|
|
27
27
|
"/@syncfusion/ej2-vue-richtexteditor"
|
|
28
28
|
],
|
|
29
|
-
"_resolved": "http://nexus.syncfusion.com/repository/ej2-
|
|
30
|
-
"_shasum": "
|
|
29
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-19.4.38.tgz",
|
|
30
|
+
"_shasum": "626f34d5f0affb5b5fbd7f5f0435b6abe546d7bd",
|
|
31
31
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
32
32
|
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
|
|
33
33
|
"author": {
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"@syncfusion/ej2-buttons": "~19.4.38",
|
|
43
43
|
"@syncfusion/ej2-filemanager": "~19.4.38",
|
|
44
44
|
"@syncfusion/ej2-inputs": "~19.4.38",
|
|
45
|
-
"@syncfusion/ej2-navigations": "~19.4.
|
|
45
|
+
"@syncfusion/ej2-navigations": "~19.4.40",
|
|
46
46
|
"@syncfusion/ej2-popups": "~19.4.38",
|
|
47
|
-
"@syncfusion/ej2-splitbuttons": "~19.4.
|
|
47
|
+
"@syncfusion/ej2-splitbuttons": "~19.4.40"
|
|
48
48
|
},
|
|
49
49
|
"deprecated": false,
|
|
50
50
|
"description": "Essential JS 2 RichTextEditor component",
|
|
@@ -70,6 +70,6 @@
|
|
|
70
70
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
71
71
|
},
|
|
72
72
|
"typings": "index.d.ts",
|
|
73
|
-
"version": "19.4.
|
|
73
|
+
"version": "19.4.40",
|
|
74
74
|
"sideEffects": false
|
|
75
75
|
}
|
|
@@ -46,8 +46,9 @@ var Lists = /** @class */ (function () {
|
|
|
46
46
|
Lists.prototype.testCurrentList = function (range) {
|
|
47
47
|
var olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
|
|
48
48
|
if (!isNullOrUndefined(range.startContainer.textContent.slice(0, range.startOffset))) {
|
|
49
|
+
var currentContent = range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim();
|
|
49
50
|
for (var i = 0; i < olListStartRegex.length; i++) {
|
|
50
|
-
if (olListStartRegex[i].test(
|
|
51
|
+
if (olListStartRegex[i].test(currentContent) && currentContent.length === 2) {
|
|
51
52
|
return true;
|
|
52
53
|
}
|
|
53
54
|
}
|
|
@@ -188,6 +188,9 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
188
188
|
};
|
|
189
189
|
SelectionCommands.removeFormat = function (nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode) {
|
|
190
190
|
var splitNode = null;
|
|
191
|
+
var startText = range.startContainer.nodeName === '#text' ?
|
|
192
|
+
range.startContainer.textContent.substring(range.startOffset, range.startContainer.textContent.length) :
|
|
193
|
+
range.startContainer.textContent;
|
|
191
194
|
if (!(range.startContainer === range.endContainer && range.startOffset === 0
|
|
192
195
|
&& range.endOffset === range.startContainer.length)) {
|
|
193
196
|
var nodeIndex = [];
|
|
@@ -287,11 +290,13 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
287
290
|
for (var num = 0; num < child.length; num++) {
|
|
288
291
|
if (child[num].nodeType !== 3 || (child[num].textContent && child[num].textContent.trim().length > 0)) {
|
|
289
292
|
child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
|
|
290
|
-
if (num ===
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
if (child[num].textContent === startText) {
|
|
294
|
+
if (num === 0) {
|
|
295
|
+
range.setStartBefore(child[num]);
|
|
296
|
+
}
|
|
297
|
+
else if (num === child.length - 1) {
|
|
298
|
+
range.setEndAfter(child[num]);
|
|
299
|
+
}
|
|
295
300
|
}
|
|
296
301
|
}
|
|
297
302
|
}
|
|
@@ -5,6 +5,7 @@ import { RendererFactory } from '../services/renderer-factory';
|
|
|
5
5
|
* `Color Picker` module is used to handle ColorPicker actions.
|
|
6
6
|
*/
|
|
7
7
|
export declare class ColorPickerInput {
|
|
8
|
+
private defaultColorPicker;
|
|
8
9
|
private fontColorPicker;
|
|
9
10
|
private backgroundColorPicker;
|
|
10
11
|
private fontColorDropDown;
|
|
@@ -77,7 +77,7 @@ var ColorPickerInput = /** @class */ (function () {
|
|
|
77
77
|
target: (targetID)
|
|
78
78
|
};
|
|
79
79
|
_this.backgroundColorPicker = _this.toolbarRenderer.renderColorPicker(options, 'backgroundcolor');
|
|
80
|
-
_this.backgroundColorDropDown = _this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', _this.backgroundColorPicker);
|
|
80
|
+
_this.backgroundColorDropDown = _this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', _this.backgroundColorPicker, _this.defaultColorPicker);
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -112,6 +112,7 @@ var ColorPickerInput = /** @class */ (function () {
|
|
|
112
112
|
if (this.backgroundColorDropDown && !this.backgroundColorDropDown.isDestroyed) {
|
|
113
113
|
var innerEle = this.backgroundColorDropDown.element.querySelector('.e-rte-color-content');
|
|
114
114
|
if (innerEle) {
|
|
115
|
+
this.defaultColorPicker = innerEle.children[0].style.borderBottomColor;
|
|
115
116
|
detach(innerEle);
|
|
116
117
|
}
|
|
117
118
|
this.backgroundColorDropDown.destroy();
|
|
@@ -169,7 +169,7 @@ export interface IRenderer {
|
|
|
169
169
|
renderPopup?(args: BaseQuickToolbar): void;
|
|
170
170
|
renderDropDownButton?(args: DropDownItemModel): DropDownButton;
|
|
171
171
|
renderColorPicker?(args: IColorPickerModel, item?: string): ColorPicker;
|
|
172
|
-
renderColorPickerDropDown?(args?: IColorPickerModel, item?: string, colorPicker?: ColorPicker): DropDownButton;
|
|
172
|
+
renderColorPickerDropDown?(args?: IColorPickerModel, item?: string, colorPicker?: ColorPicker, defaultColor?: string): DropDownButton;
|
|
173
173
|
renderListDropDown?(args: IDropDownModel): DropDownButton;
|
|
174
174
|
}
|
|
175
175
|
/**
|
|
@@ -304,7 +304,7 @@ var Image = /** @class */ (function () {
|
|
|
304
304
|
left: elem.offsetLeft
|
|
305
305
|
};
|
|
306
306
|
};
|
|
307
|
-
Image.prototype.setAspectRatio = function (img, expectedX, expectedY) {
|
|
307
|
+
Image.prototype.setAspectRatio = function (img, expectedX, expectedY, e) {
|
|
308
308
|
if (isNullOrUndefined(img.width)) {
|
|
309
309
|
return;
|
|
310
310
|
}
|
|
@@ -358,7 +358,7 @@ var Image = /** @class */ (function () {
|
|
|
358
358
|
img.style.height = (height / width * expectedX) + 'px';
|
|
359
359
|
}
|
|
360
360
|
else {
|
|
361
|
-
img.setAttribute('width', expectedX.toString());
|
|
361
|
+
img.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - img.getBoundingClientRect().left).toString() : expectedX.toString());
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
else {
|
|
@@ -399,7 +399,7 @@ var Image = /** @class */ (function () {
|
|
|
399
399
|
return;
|
|
400
400
|
}
|
|
401
401
|
_this.imgEle.parentElement.style.cursor = 'pointer';
|
|
402
|
-
_this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10));
|
|
402
|
+
_this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10), args);
|
|
403
403
|
_this.resizeImgDupPos(_this.imgEle);
|
|
404
404
|
_this.imgResizePos(_this.imgEle, _this.imgResizeDiv);
|
|
405
405
|
_this.parent.setContentHeight('', false);
|
|
@@ -71,7 +71,7 @@ export declare class ToolbarRenderer implements IRenderer {
|
|
|
71
71
|
* @hidden
|
|
72
72
|
|
|
73
73
|
*/
|
|
74
|
-
renderColorPickerDropDown(args: IColorPickerModel, item: string, colorPicker: ColorPicker): DropDownButton;
|
|
74
|
+
renderColorPickerDropDown(args: IColorPickerModel, item: string, colorPicker: ColorPicker, defaultColor: string): DropDownButton;
|
|
75
75
|
private pickerRefresh;
|
|
76
76
|
private popupModal;
|
|
77
77
|
private setColorPickerContentWidth;
|
|
@@ -289,7 +289,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
289
289
|
* @hidden
|
|
290
290
|
|
|
291
291
|
*/
|
|
292
|
-
ToolbarRenderer.prototype.renderColorPickerDropDown = function (args, item, colorPicker) {
|
|
292
|
+
ToolbarRenderer.prototype.renderColorPickerDropDown = function (args, item, colorPicker, defaultColor) {
|
|
293
293
|
var _this = this;
|
|
294
294
|
// eslint-disable-next-line
|
|
295
295
|
var proxy = this;
|
|
@@ -298,8 +298,9 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
298
298
|
var content = proxy.parent.createElement('span', { className: CLS_COLOR_CONTENT });
|
|
299
299
|
var inlineEle = proxy.parent.createElement('span', { className: args.cssClass });
|
|
300
300
|
var range;
|
|
301
|
+
var initialBackgroundColor = (isNullOrUndefined(defaultColor)) ? proxy.parent.backgroundColor.default : defaultColor;
|
|
301
302
|
inlineEle.style.borderBottomColor = (item === 'backgroundcolor') ?
|
|
302
|
-
|
|
303
|
+
initialBackgroundColor : proxy.parent.fontColor.default;
|
|
303
304
|
content.appendChild(inlineEle);
|
|
304
305
|
var dropDown = new DropDownButton({
|
|
305
306
|
target: colorPicker.element.parentElement, cssClass: css,
|