@syncfusion/ej2-richtexteditor 26.1.42 → 26.2.4
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 +34 -39
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +35 -40
- 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/hotfix/26.1.35_Vol2.txt +1 -0
- package/package.json +12 -12
- package/src/editor-manager/plugin/inserthtml.js +12 -0
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +0 -1
- package/src/rich-text-editor/actions/paste-clean-up.js +16 -40
- package/src/rich-text-editor/base/rich-text-editor.js +1 -1
- package/src/rich-text-editor/renderer/image-module.js +6 -0
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 26.
|
|
3
|
+
* version : 26.2.4
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
hotfix/26.1.35_Vol2
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-richtexteditor@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-richtexteditor@26.1.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@26.1.42",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512
|
|
5
|
+
"_integrity": "sha512-+J5Gcfx+Iy1jkGYJSc91pqv+Gk9ZGDhmyIanP++dUVEI5yXAEUTetX7LTTe0C9PNu51rauOHW57z2NdKnx1dmg==",
|
|
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.1.
|
|
29
|
-
"_shasum": "
|
|
28
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-26.1.42.tgz",
|
|
29
|
+
"_shasum": "b6e37c254d3fa473264c42e80c6b919f5d1ddad5",
|
|
30
30
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
31
31
|
"_where": "/jenkins/workspace/elease-automation_release_26.1.1/packages/included",
|
|
32
32
|
"author": {
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
},
|
|
38
38
|
"bundleDependencies": false,
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@syncfusion/ej2-base": "~26.
|
|
41
|
-
"@syncfusion/ej2-buttons": "~26.
|
|
42
|
-
"@syncfusion/ej2-filemanager": "~26.
|
|
43
|
-
"@syncfusion/ej2-inputs": "~26.
|
|
44
|
-
"@syncfusion/ej2-navigations": "~26.
|
|
45
|
-
"@syncfusion/ej2-popups": "~26.
|
|
46
|
-
"@syncfusion/ej2-splitbuttons": "~26.
|
|
40
|
+
"@syncfusion/ej2-base": "~26.2.4",
|
|
41
|
+
"@syncfusion/ej2-buttons": "~26.2.4",
|
|
42
|
+
"@syncfusion/ej2-filemanager": "~26.2.4",
|
|
43
|
+
"@syncfusion/ej2-inputs": "~26.2.4",
|
|
44
|
+
"@syncfusion/ej2-navigations": "~26.2.4",
|
|
45
|
+
"@syncfusion/ej2-popups": "~26.2.4",
|
|
46
|
+
"@syncfusion/ej2-splitbuttons": "~26.2.4"
|
|
47
47
|
},
|
|
48
48
|
"deprecated": false,
|
|
49
49
|
"description": "Essential JS 2 RichTextEditor component",
|
|
@@ -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.
|
|
82
|
+
"version": "26.2.4",
|
|
83
83
|
"sideEffects": false
|
|
84
84
|
}
|
|
@@ -203,6 +203,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
203
203
|
return null;
|
|
204
204
|
};
|
|
205
205
|
InsertHtml.pasteInsertHTML = function (nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode, enterAction) {
|
|
206
|
+
var _this = this;
|
|
206
207
|
var isCursor = range.startOffset === range.endOffset &&
|
|
207
208
|
range.startContainer === range.endContainer;
|
|
208
209
|
if (isCursor && range.startContainer === editNode && editNode.textContent === '') {
|
|
@@ -369,6 +370,17 @@ var InsertHtml = /** @class */ (function () {
|
|
|
369
370
|
else {
|
|
370
371
|
this.cursorPos(lastSelectionNode, node, nodeSelection, docElement, editNode, enterAction);
|
|
371
372
|
}
|
|
373
|
+
var spanAligns = editNode.querySelectorAll('span[style*="text-align"]');
|
|
374
|
+
if (spanAligns.length > 0) {
|
|
375
|
+
spanAligns.forEach(function (spanAlign) {
|
|
376
|
+
if (!isNOU(spanAlign)) {
|
|
377
|
+
var blockAlign = _this.getImmediateBlockNode(spanAlign, null);
|
|
378
|
+
if (blockAlign && blockAlign.textContent.trim() === spanAlign.textContent.trim()) {
|
|
379
|
+
blockAlign.style.textAlign = spanAlign.style.textAlign;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
}
|
|
372
384
|
};
|
|
373
385
|
InsertHtml.placeCursorEnd = function (lastSelectionNode, node, nodeSelection, docElement, editNode) {
|
|
374
386
|
lastSelectionNode = lastSelectionNode.nodeName === 'BR' ? (isNOU(lastSelectionNode.previousSibling) ? lastSelectionNode.parentNode
|
|
@@ -5,7 +5,6 @@ import { isNullOrUndefined as isNOU, isNullOrUndefined, detach, extend, addClass
|
|
|
5
5
|
import { getUniqueID, Browser, closest } from '@syncfusion/ej2-base';
|
|
6
6
|
import { CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT } from '../base/classes';
|
|
7
7
|
import { CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT } from '../base/classes';
|
|
8
|
-
import { CLS_RTE_IMAGE, CLS_IMGINLINE, CLS_IMGBREAK } from '../base/classes';
|
|
9
8
|
import { pasteCleanupGroupingTags } from '../../common/config';
|
|
10
9
|
import { NodeSelection } from '../../selection/selection';
|
|
11
10
|
import * as EVENTS from './../../common/constant';
|
|
@@ -190,13 +189,6 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
190
189
|
e.args.preventDefault();
|
|
191
190
|
this.pasteDialog(value, args, isClipboardHTMLDataNull);
|
|
192
191
|
}
|
|
193
|
-
else if (Browser.userAgent.indexOf('Firefox') !== -1 && isNOU(file)) {
|
|
194
|
-
this.fireFoxImageUpload();
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
else if (!isValueNotEmpty && !this.parent.pasteCleanupSettings.plainText &&
|
|
198
|
-
Browser.userAgent.indexOf('Firefox') !== -1) {
|
|
199
|
-
this.fireFoxImageUpload();
|
|
200
192
|
}
|
|
201
193
|
else if (this.parent.pasteCleanupSettings.plainText) {
|
|
202
194
|
e.args.preventDefault();
|
|
@@ -212,33 +204,6 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
212
204
|
}
|
|
213
205
|
}
|
|
214
206
|
};
|
|
215
|
-
PasteCleanup.prototype.fireFoxImageUpload = function () {
|
|
216
|
-
var _this = this;
|
|
217
|
-
this.fireFoxUploadTime = setTimeout(function () {
|
|
218
|
-
if (Browser.userAgent.indexOf('Firefox') !== -1) {
|
|
219
|
-
var currentFocusNode = _this.nodeSelectionObj.getRange(_this.contentRenderer.getDocument()).startContainer;
|
|
220
|
-
if (currentFocusNode.nodeName !== '#text') {
|
|
221
|
-
// eslint-disable-next-line
|
|
222
|
-
currentFocusNode = currentFocusNode.childNodes[_this.nodeSelectionObj.getRange(_this.contentRenderer.getDocument()).startOffset];
|
|
223
|
-
}
|
|
224
|
-
if (currentFocusNode.previousSibling.nodeName === 'IMG') {
|
|
225
|
-
if (!isNOU(currentFocusNode.previousSibling.getAttribute('src'))) {
|
|
226
|
-
currentFocusNode.previousSibling.classList.add('pasteContent_Img');
|
|
227
|
-
}
|
|
228
|
-
currentFocusNode.previousSibling.classList.add(CLS_RTE_IMAGE);
|
|
229
|
-
if (_this.parent.insertImageSettings.display === 'inline') {
|
|
230
|
-
currentFocusNode.previousSibling.classList.add(CLS_IMGINLINE);
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
currentFocusNode.previousSibling.classList.add(CLS_IMGBREAK);
|
|
234
|
-
}
|
|
235
|
-
currentFocusNode.previousSibling.classList.add();
|
|
236
|
-
_this.setImageProperties(currentFocusNode.previousSibling);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
_this.imgUploading(_this.parent.inputElement);
|
|
240
|
-
}, 500);
|
|
241
|
-
};
|
|
242
207
|
PasteCleanup.prototype.splitBreakLine = function (value) {
|
|
243
208
|
var enterSplitText = value.split('\n');
|
|
244
209
|
var contentInnerElem = '';
|
|
@@ -452,11 +417,22 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
452
417
|
this.parent.inputElement.contentEditable = 'true';
|
|
453
418
|
e.element = imgElem;
|
|
454
419
|
e.detectImageSource = ImageInputSource.Pasted;
|
|
455
|
-
|
|
456
|
-
if (
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
420
|
+
uploadObj.filesData.forEach(function (element) {
|
|
421
|
+
if (element.statusCode === '2') {
|
|
422
|
+
_this.parent.trigger(events.imageUploadSuccess, e, function (e) {
|
|
423
|
+
if (!isNullOrUndefined(_this.parent.insertImageSettings.path)) {
|
|
424
|
+
var url = _this.parent.insertImageSettings.path + e.file.name;
|
|
425
|
+
imgElem.src = url;
|
|
426
|
+
imgElem.setAttribute('alt', e.file.name);
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
else if (element.statusCode === '5') {
|
|
431
|
+
_this.parent.trigger(events.imageRemoving, e, function (e) {
|
|
432
|
+
if (!isNullOrUndefined(e.element.src)) {
|
|
433
|
+
e.element.src = '';
|
|
434
|
+
}
|
|
435
|
+
});
|
|
460
436
|
}
|
|
461
437
|
});
|
|
462
438
|
popupObj.close();
|
|
@@ -761,7 +761,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
761
761
|
var preventingMention = false;
|
|
762
762
|
if (this.editorMode === 'HTML') {
|
|
763
763
|
var range = this.getRange();
|
|
764
|
-
preventingMention = !isNOU(range.startContainer) && range.startContainer === range.endContainer && range.endContainer.childNodes.length > 1 && !isNOU(range.startContainer.childNodes[range.startOffset - 1]) && range.startContainer.childNodes[range.startOffset - 1].nodeName === '#text' && !isNOU(range.startContainer.childNodes[range.startOffset - 1].previousSibling) && range.startContainer.childNodes[range.startOffset - 1].textContent.charCodeAt(0) === 32 && range.startContainer.childNodes[1].previousSibling.classList.contains("e-mention-chip");
|
|
764
|
+
preventingMention = !isNOU(range.startContainer) && range.startContainer === range.endContainer && range.endContainer.childNodes.length > 1 && !isNOU(range.startContainer.childNodes[range.startOffset - 1]) && range.startContainer.childNodes[range.startOffset - 1].nodeName === '#text' && !isNOU(range.startContainer.childNodes[range.startOffset - 1].previousSibling) && range.startContainer.childNodes[range.startOffset - 1].textContent.charCodeAt(0) === 32 && range.startContainer.childNodes[range.startOffset - 1].previousSibling.classList.contains("e-mention-chip");
|
|
765
765
|
}
|
|
766
766
|
var keyboardEventAction = ['insert-link', 'format-copy', 'format-paste', 'insert-image', 'insert-table', 'insert-audio', 'insert-video'];
|
|
767
767
|
if (keyboardEventAction.indexOf(e.action) === -1 &&
|
|
@@ -1788,6 +1788,7 @@ var Image = /** @class */ (function () {
|
|
|
1788
1788
|
var altText;
|
|
1789
1789
|
var selectArgs;
|
|
1790
1790
|
var filesData;
|
|
1791
|
+
var previousURL = null;
|
|
1791
1792
|
this.uploadObj = new Uploader({
|
|
1792
1793
|
asyncSettings: { saveUrl: this.parent.insertImageSettings.saveUrl, removeUrl: this.parent.insertImageSettings.removeUrl },
|
|
1793
1794
|
dropArea: span, multiple: false, enableRtl: this.parent.enableRtl, cssClass: this.parent.getCssClass(),
|
|
@@ -1843,6 +1844,10 @@ var Image = /** @class */ (function () {
|
|
|
1843
1844
|
_this.parent.trigger(events.imageUploadSuccess, e, function (e) {
|
|
1844
1845
|
if (!isNOU(_this.parent.insertImageSettings.path)) {
|
|
1845
1846
|
var url = _this.parent.insertImageSettings.path + e.file.name;
|
|
1847
|
+
// Update the URL of the previously uploaded image
|
|
1848
|
+
if (!isNOU(previousURL) && e.operation === 'upload') {
|
|
1849
|
+
proxy.imageRemovePost(previousURL);
|
|
1850
|
+
}
|
|
1846
1851
|
// eslint-disable-next-line
|
|
1847
1852
|
var value = { url: url, selection: save };
|
|
1848
1853
|
proxy.uploadUrl = {
|
|
@@ -1856,6 +1861,7 @@ var Image = /** @class */ (function () {
|
|
|
1856
1861
|
}
|
|
1857
1862
|
};
|
|
1858
1863
|
proxy.inputUrl.setAttribute('disabled', 'true');
|
|
1864
|
+
previousURL = url;
|
|
1859
1865
|
}
|
|
1860
1866
|
if (e.operation === 'upload' && !isNOU(_this.dialogObj)) {
|
|
1861
1867
|
_this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|