@syncfusion/ej2-richtexteditor 26.2.8 → 26.2.9
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 +25 -6
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +25 -6
- 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 +6 -6
- package/src/editor-manager/plugin/selection-commands.js +6 -0
- package/src/rich-text-editor/actions/html-editor.js +11 -2
- package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -0
- package/src/rich-text-editor/base/rich-text-editor.js +8 -4
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 26.2.
|
|
3
|
+
* version : 26.2.9
|
|
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@26.2.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@26.2.8",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512
|
|
5
|
+
"_integrity": "sha512-32e+vCj/g/TFDS2cffJN/VSiGWWm98qhLXyVgxifCU+QoRXgpsdeI6jvmCzRC4UTlH4k+V58PYEO+UNRGt5mrQ==",
|
|
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-26.2.
|
|
29
|
-
"_shasum": "
|
|
28
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-26.2.8.tgz",
|
|
29
|
+
"_shasum": "9aff95f472285a7694f794e3b2820e56721cd13b",
|
|
30
30
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
31
31
|
"_where": "/jenkins/workspace/elease-automation_release_26.1.1/packages/included",
|
|
32
32
|
"author": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"bundleDependencies": false,
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@syncfusion/ej2-base": "~26.2.5",
|
|
41
|
-
"@syncfusion/ej2-buttons": "~26.2.
|
|
41
|
+
"@syncfusion/ej2-buttons": "~26.2.9",
|
|
42
42
|
"@syncfusion/ej2-filemanager": "~26.2.7",
|
|
43
43
|
"@syncfusion/ej2-inputs": "~26.2.5",
|
|
44
44
|
"@syncfusion/ej2-navigations": "~26.2.8",
|
|
@@ -79,6 +79,6 @@
|
|
|
79
79
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
80
80
|
},
|
|
81
81
|
"typings": "index.d.ts",
|
|
82
|
-
"version": "26.2.
|
|
82
|
+
"version": "26.2.9",
|
|
83
83
|
"sideEffects": false
|
|
84
84
|
}
|
|
@@ -243,6 +243,12 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
243
243
|
if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' || (isNOU(cursorNodes[0].nextSibling) ? false : cursorNodes[0].nextSibling.nodeName === 'BR'))) {
|
|
244
244
|
detach(cursorNodes[0].nodeName === '#text' ? cursorNodes[0].nextSibling : cursorNodes[0]);
|
|
245
245
|
}
|
|
246
|
+
if (!isNOU(cursorNodes[0].parentElement) && IsFormatted.inlineTags.
|
|
247
|
+
indexOf((cursorNodes[0].parentElement).tagName.toLowerCase()) !== -1 && cursorNodes[0].textContent.includes('\u200B')) {
|
|
248
|
+
var element = this.GetFormatNode(format, value);
|
|
249
|
+
this.applyStyles(cursorNodes, 0, element);
|
|
250
|
+
return cursorNodes[0];
|
|
251
|
+
}
|
|
246
252
|
cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
|
|
247
253
|
}
|
|
248
254
|
return cursorNode;
|
|
@@ -216,7 +216,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
216
216
|
};
|
|
217
217
|
HtmlEditor.prototype.onKeyUp = function (e) {
|
|
218
218
|
var args = e.args;
|
|
219
|
-
var restrictKeys = [8, 9, 13,
|
|
219
|
+
var restrictKeys = [8, 9, 13, 17, 18, 20, 27, 37, 38, 39, 40, 44, 45, 46, 91,
|
|
220
220
|
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123];
|
|
221
221
|
var range = this.parent.getRange();
|
|
222
222
|
var regEx = new RegExp('\u200B', 'g');
|
|
@@ -224,9 +224,18 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
224
224
|
range.startOffset === 1 && range.startContainer.textContent.length === 1 &&
|
|
225
225
|
range.startContainer.textContent.charCodeAt(0) === 8203 &&
|
|
226
226
|
range.startContainer.textContent.replace(regEx, '').length === 0;
|
|
227
|
+
var isMention = false;
|
|
228
|
+
if (range.startContainer === range.endContainer &&
|
|
229
|
+
range.startOffset === range.endOffset && (range.startContainer !== this.parent.inputElement && range.startOffset !== 0)) {
|
|
230
|
+
var mentionStartNode = range.startContainer.nodeType === 3 ?
|
|
231
|
+
range.startContainer : range.startContainer.childNodes[range.startOffset - 1];
|
|
232
|
+
isMention = args.keyCode === 16 &&
|
|
233
|
+
mentionStartNode.textContent.charCodeAt(0) === 8203 &&
|
|
234
|
+
!isNOU(mentionStartNode.previousSibling) && mentionStartNode.previousSibling.contentEditable === 'false';
|
|
235
|
+
}
|
|
227
236
|
var pointer;
|
|
228
237
|
var isRootParent = false;
|
|
229
|
-
if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey && !isEmptyNode) {
|
|
238
|
+
if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey && !isEmptyNode && !isMention) {
|
|
230
239
|
pointer = range.startOffset;
|
|
231
240
|
var container = range.startContainer;
|
|
232
241
|
// Check if the container is a text node and contains a zero-width space
|
|
@@ -52,6 +52,7 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
52
52
|
private onBlurHandler;
|
|
53
53
|
private onResizeHandler;
|
|
54
54
|
private timeInterval;
|
|
55
|
+
private autoSaveTimeOut;
|
|
55
56
|
private idleInterval;
|
|
56
57
|
private touchModule;
|
|
57
58
|
private defaultResetValue;
|
|
@@ -825,7 +825,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
825
825
|
this.inputElement.innerHTML = this.enterKey !== 'BR' ? '<' + this.enterKey + '><br></' + this.enterKey + '>' : '<br>';
|
|
826
826
|
this.isSelectAll = false;
|
|
827
827
|
}
|
|
828
|
-
if (selection.rangeCount > 0 && this.contentModule.getDocument().activeElement.tagName !== 'INPUT' && this.inputElement.contains(this.contentModule.getDocument().activeElement)) {
|
|
828
|
+
if (selection.rangeCount > 0 && this.contentModule.getDocument().activeElement.tagName !== 'INPUT' && this.inputElement.contains(this.contentModule.getDocument().activeElement) && range.startContainer.innerHTML === '<br>' && range.startContainer.textContent === '') {
|
|
829
829
|
selection.removeAllRanges();
|
|
830
830
|
selection.addRange(currentRange);
|
|
831
831
|
}
|
|
@@ -1088,6 +1088,10 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1088
1088
|
clearInterval(this.timeInterval);
|
|
1089
1089
|
this.timeInterval = null;
|
|
1090
1090
|
}
|
|
1091
|
+
if (!isNOU(this.autoSaveTimeOut)) {
|
|
1092
|
+
clearTimeout(this.autoSaveTimeOut);
|
|
1093
|
+
this.autoSaveTimeOut = null;
|
|
1094
|
+
}
|
|
1091
1095
|
if (!isNOU(this.idleInterval)) {
|
|
1092
1096
|
clearTimeout(this.idleInterval);
|
|
1093
1097
|
this.idleInterval = null;
|
|
@@ -2122,7 +2126,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2122
2126
|
}
|
|
2123
2127
|
this.preventDefaultResize(e);
|
|
2124
2128
|
this.trigger('focus', { event: e, isInteracted: Object.keys(e).length === 0 ? false : true });
|
|
2125
|
-
if (!isNOU(this.saveInterval) && this.saveInterval > 0 && !this.autoSaveOnIdle) {
|
|
2129
|
+
if (!isNOU(this.saveInterval) && this.saveInterval > 0 && !this.autoSaveOnIdle && isNOU(this.timeInterval)) {
|
|
2126
2130
|
this.timeInterval = setInterval(this.updateValueOnIdle.bind(this), this.saveInterval);
|
|
2127
2131
|
}
|
|
2128
2132
|
EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
|
|
@@ -2291,8 +2295,8 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2291
2295
|
RichTextEditor.prototype.contentChanged = function () {
|
|
2292
2296
|
if (this.autoSaveOnIdle) {
|
|
2293
2297
|
if (!isNOU(this.saveInterval)) {
|
|
2294
|
-
clearTimeout(this.
|
|
2295
|
-
this.
|
|
2298
|
+
clearTimeout(this.autoSaveTimeOut);
|
|
2299
|
+
this.autoSaveTimeOut = setTimeout(this.updateIntervalValue.bind(this), this.saveInterval);
|
|
2296
2300
|
}
|
|
2297
2301
|
}
|
|
2298
2302
|
};
|