@syncfusion/ej2-richtexteditor 23.1.41 → 23.1.44
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 +33 -1
- 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 +77 -41
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +76 -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/package.json +11 -11
- package/src/editor-manager/plugin/emoji-picker-action.js +1 -1
- package/src/editor-manager/plugin/inserthtml.js +12 -7
- package/src/editor-manager/plugin/link.js +7 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +10 -9
- package/src/rich-text-editor/actions/emoji-picker.js +8 -5
- package/src/rich-text-editor/actions/enter-key.js +8 -0
- package/src/rich-text-editor/actions/toolbar.js +1 -0
- package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -0
- package/src/rich-text-editor/base/rich-text-editor.js +22 -9
- package/src/rich-text-editor/renderer/image-module.js +6 -7
- package/src/rich-text-editor/renderer/toolbar-renderer.js +1 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 23.1.
|
|
3
|
+
* version : 23.1.44
|
|
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@23.1.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@23.1.43",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512
|
|
5
|
+
"_integrity": "sha512-jgzplcFRi5rmn0kbDEri7p8DT1c7WyfUq6Gc4tDWhQX0voLlzxQaCv0VOf/zK/PB4PSbu4eaTIsuvOQlY7bmzA==",
|
|
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": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-23.1.
|
|
30
|
-
"_shasum": "
|
|
29
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-23.1.43.tgz",
|
|
30
|
+
"_shasum": "c003b36ae31089222d8492e3cdb00d29a82d6703",
|
|
31
31
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
32
32
|
"_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
|
|
33
33
|
"author": {
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"bundleDependencies": false,
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@syncfusion/ej2-base": "~23.1.41",
|
|
42
|
-
"@syncfusion/ej2-buttons": "~23.1.
|
|
43
|
-
"@syncfusion/ej2-filemanager": "~23.1.
|
|
44
|
-
"@syncfusion/ej2-inputs": "~23.1.
|
|
45
|
-
"@syncfusion/ej2-navigations": "~23.1.
|
|
46
|
-
"@syncfusion/ej2-popups": "~23.1.
|
|
47
|
-
"@syncfusion/ej2-splitbuttons": "~23.1.
|
|
42
|
+
"@syncfusion/ej2-buttons": "~23.1.43",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~23.1.43",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~23.1.43",
|
|
45
|
+
"@syncfusion/ej2-navigations": "~23.1.44",
|
|
46
|
+
"@syncfusion/ej2-popups": "~23.1.44",
|
|
47
|
+
"@syncfusion/ej2-splitbuttons": "~23.1.43"
|
|
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": "23.1.
|
|
73
|
+
"version": "23.1.44",
|
|
74
74
|
"sideEffects": false
|
|
75
75
|
}
|
|
@@ -10,7 +10,7 @@ var EmojiPickerAction = /** @class */ (function () {
|
|
|
10
10
|
};
|
|
11
11
|
EmojiPickerAction.prototype.emojiInsert = function (args) {
|
|
12
12
|
var node = document.createTextNode(args.value);
|
|
13
|
-
var selection =
|
|
13
|
+
var selection = this.parent.currentDocument.getSelection();
|
|
14
14
|
var range = selection.getRangeAt(0);
|
|
15
15
|
var cursorPos = range.startOffset;
|
|
16
16
|
for (var i = cursorPos - 1; i >= cursorPos - 15; i--) {
|
|
@@ -344,7 +344,8 @@ var InsertHtml = /** @class */ (function () {
|
|
|
344
344
|
: lastSelectionNode.previousSibling) : lastSelectionNode;
|
|
345
345
|
while (!isNOU(lastSelectionNode) && lastSelectionNode.nodeName !== '#text' && lastSelectionNode.nodeName !== 'IMG' &&
|
|
346
346
|
lastSelectionNode.nodeName !== 'BR' && lastSelectionNode.nodeName !== 'HR') {
|
|
347
|
-
if (!isNOU(lastSelectionNode.lastChild) && (lastSelectionNode.lastChild.nodeName === 'P' &&
|
|
347
|
+
if (!isNOU(lastSelectionNode.lastChild) && (lastSelectionNode.lastChild.nodeName === 'P' &&
|
|
348
|
+
lastSelectionNode.lastChild.innerHTML === '')) {
|
|
348
349
|
var lineBreak = createElement('br');
|
|
349
350
|
lastSelectionNode.lastChild.appendChild(lineBreak);
|
|
350
351
|
}
|
|
@@ -502,14 +503,18 @@ var InsertHtml = /** @class */ (function () {
|
|
|
502
503
|
};
|
|
503
504
|
InsertHtml.removeEmptyElements = function (element) {
|
|
504
505
|
var emptyElements = element.querySelectorAll(':empty');
|
|
505
|
-
|
|
506
|
+
var nonSvgEmptyElements = Array.from(emptyElements).filter(function (element) {
|
|
507
|
+
// Check if the element is an SVG element or an ancestor of an SVG element
|
|
508
|
+
return !element.closest('svg') && !element.closest('canvas');
|
|
509
|
+
});
|
|
510
|
+
for (var i = 0; i < nonSvgEmptyElements.length; i++) {
|
|
506
511
|
var lineWithDiv = true;
|
|
507
|
-
if (
|
|
508
|
-
lineWithDiv =
|
|
509
|
-
|
|
512
|
+
if (nonSvgEmptyElements[i].tagName === 'DIV') {
|
|
513
|
+
lineWithDiv = nonSvgEmptyElements[i].style.borderBottom === 'none' ||
|
|
514
|
+
nonSvgEmptyElements[i].style.borderBottom === '' ? true : false;
|
|
510
515
|
}
|
|
511
|
-
if (CONSTANT.SELF_CLOSING_TAGS.indexOf(
|
|
512
|
-
var detachableElement = this.findDetachEmptyElem(
|
|
516
|
+
if (CONSTANT.SELF_CLOSING_TAGS.indexOf(nonSvgEmptyElements[i].tagName.toLowerCase()) < 0 && lineWithDiv) {
|
|
517
|
+
var detachableElement = this.findDetachEmptyElem(nonSvgEmptyElements[i]);
|
|
513
518
|
if (!isNOU(detachableElement)) {
|
|
514
519
|
detach(detachableElement);
|
|
515
520
|
}
|
|
@@ -85,6 +85,12 @@ var LinkCommand = /** @class */ (function () {
|
|
|
85
85
|
|| e.event.keyCode === 13) || e.item.action === 'Paste' || range.collapsed || text) {
|
|
86
86
|
var anchor = this.createAchorNode(e);
|
|
87
87
|
anchor.innerText = e.item.text === '' ? e.item.url : e.item.text;
|
|
88
|
+
var text_1 = anchor.innerText;
|
|
89
|
+
// Replace spaces with non-breaking spaces
|
|
90
|
+
var modifiedText = text_1.replace(/ +/g, function (match) {
|
|
91
|
+
return '\u00A0'.repeat(match.length);
|
|
92
|
+
});
|
|
93
|
+
anchor.innerText = modifiedText;
|
|
88
94
|
e.item.selection.restore();
|
|
89
95
|
InsertHtml.Insert(this.parent.currentDocument, anchor, this.parent.editableElement);
|
|
90
96
|
if (e.event && e.event.type === 'keydown' && (e.event.keyCode === 32
|
|
@@ -275,7 +281,7 @@ var LinkCommand = /** @class */ (function () {
|
|
|
275
281
|
for (var i = 0; i < blockNodes.length; i++) {
|
|
276
282
|
var linkNode = blockNodes[i].querySelectorAll('a');
|
|
277
283
|
for (var j = 0; j < linkNode.length; j++) {
|
|
278
|
-
if (
|
|
284
|
+
if (this.parent.currentDocument.getSelection().containsNode(linkNode[j], true)) {
|
|
279
285
|
linkNode[j].outerHTML = linkNode[j].innerHTML;
|
|
280
286
|
}
|
|
281
287
|
}
|
|
@@ -309,8 +309,8 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
309
309
|
}
|
|
310
310
|
isCroppedImage = ((this.extractCropValue('cropl', fullImg[i]) > 0 &&
|
|
311
311
|
this.extractCropValue('cropt', fullImg[i]) > 0) ||
|
|
312
|
-
|
|
313
|
-
|
|
312
|
+
this.extractCropValue('cropr', fullImg[i]) > 0 ||
|
|
313
|
+
this.extractCropValue('cropb', fullImg[i])) ? true : false;
|
|
314
314
|
if (isCroppedImage) {
|
|
315
315
|
goalWidth = this.extractCropValue('wgoal', fullImg[i]);
|
|
316
316
|
goalHeight = this.extractCropValue('hgoal', fullImg[i]);
|
|
@@ -337,7 +337,7 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
337
337
|
};
|
|
338
338
|
MsWordPaste.prototype.extractCropValue = function (crop, rtfData) {
|
|
339
339
|
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
340
|
-
var result = new RegExp('\\\\pic' + crop + '(\\-?\\d+)\\\\').exec(rtfData.replace(/\r\n\\/g, '\\'))[1];
|
|
340
|
+
var result = new RegExp('\\\\pic' + crop + '(\\-?\\d+)\\\\').exec(rtfData.replace(/\r\n\\/g, '\\').replace(/\n/g, '\\'))[1];
|
|
341
341
|
return parseInt(result, 10);
|
|
342
342
|
};
|
|
343
343
|
MsWordPaste.prototype.removeClassName = function (elm) {
|
|
@@ -376,6 +376,10 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
376
376
|
return removableElement;
|
|
377
377
|
};
|
|
378
378
|
MsWordPaste.prototype.removeUnwantedElements = function (elm) {
|
|
379
|
+
var styleElm = elm.querySelector('style');
|
|
380
|
+
if (!isNOU(styleElm)) {
|
|
381
|
+
detach(styleElm);
|
|
382
|
+
}
|
|
379
383
|
var innerElement = elm.innerHTML;
|
|
380
384
|
for (var i = 0; i < this.removableElements.length; i++) {
|
|
381
385
|
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
@@ -673,10 +677,8 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
673
677
|
}
|
|
674
678
|
if (!isNOU(listNodes[i].getAttribute('style'))) {
|
|
675
679
|
listNodes[i].setAttribute('style', listNodes[i].getAttribute('style').replace('text-align:start;', ''));
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
currentListStyle = listNodes[i].getAttribute('style');
|
|
679
|
-
}
|
|
680
|
+
listNodes[i].style.textIndent = '';
|
|
681
|
+
currentListStyle = listNodes[i].getAttribute('style');
|
|
680
682
|
}
|
|
681
683
|
collection.push({
|
|
682
684
|
listType: type, content: tempNode, nestedLevel: level, class: currentClassName,
|
|
@@ -884,8 +886,7 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
884
886
|
}
|
|
885
887
|
}
|
|
886
888
|
prevList.setAttribute('class', collection[index].class);
|
|
887
|
-
|
|
888
|
-
prevList.setAttribute('style', (!isNOU(currentStyle) ? currentStyle : ''));
|
|
889
|
+
prevList.setAttribute('style', (!isNOU(collection[index].listStyle) ? collection[index].listStyle : ''));
|
|
889
890
|
pLevel = collection[index].nestedLevel;
|
|
890
891
|
listCount++;
|
|
891
892
|
if (!isNOU(collection[index].start)) {
|
|
@@ -86,7 +86,7 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
86
86
|
}
|
|
87
87
|
else if (isNOU(args.x) && isNOU(args.y) && !this.parent.inlineMode.enable && isNOU(this.parent.quickToolbarSettings.text)) {
|
|
88
88
|
target = this.parent.inputElement;
|
|
89
|
-
if (
|
|
89
|
+
if (this.parent.contentModule.getDocument().getSelection().rangeCount > 0) {
|
|
90
90
|
var coordinates = this.getCoordinates();
|
|
91
91
|
xValue = coordinates.left;
|
|
92
92
|
yValue = coordinates.top;
|
|
@@ -94,7 +94,7 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
94
94
|
}
|
|
95
95
|
else if (isNOU(args.x) && isNOU(args.y) && (this.parent.inlineMode.enable || !isNOU(this.parent.quickToolbarSettings.text))) {
|
|
96
96
|
this.parent.notify(events.hidePopup, {});
|
|
97
|
-
if (
|
|
97
|
+
if (this.parent.contentModule.getDocument().getSelection().rangeCount > 0) {
|
|
98
98
|
var coordinates = this.getCoordinates();
|
|
99
99
|
xValue = coordinates.left;
|
|
100
100
|
yValue = coordinates.top;
|
|
@@ -683,7 +683,7 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
683
683
|
};
|
|
684
684
|
EmojiPicker.prototype.onkeyPress = function (e) {
|
|
685
685
|
var originalEvent = e.args;
|
|
686
|
-
var selection =
|
|
686
|
+
var selection = this.parent.contentModule.getDocument().getSelection();
|
|
687
687
|
if (selection.rangeCount <= 0) {
|
|
688
688
|
return;
|
|
689
689
|
}
|
|
@@ -713,7 +713,10 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
713
713
|
};
|
|
714
714
|
EmojiPicker.prototype.onkeyUp = function (e) {
|
|
715
715
|
var originalEvent = e.args;
|
|
716
|
-
var selection =
|
|
716
|
+
var selection = this.parent.contentModule.getDocument().getSelection();
|
|
717
|
+
if (selection.rangeCount <= 0) {
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
717
720
|
var range = selection.getRangeAt(0);
|
|
718
721
|
var cursorPos = range.startOffset;
|
|
719
722
|
// eslint-disable-next-line
|
|
@@ -736,7 +739,7 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
736
739
|
};
|
|
737
740
|
EmojiPicker.prototype.getCoordinates = function () {
|
|
738
741
|
var coordinates;
|
|
739
|
-
var selection =
|
|
742
|
+
var selection = this.parent.contentModule.getDocument().getSelection();
|
|
740
743
|
var range = selection.getRangeAt(0);
|
|
741
744
|
var firstChild;
|
|
742
745
|
if (range.startContainer.nodeName === 'P' || range.startContainer.nodeName === 'DIV') {
|
|
@@ -482,6 +482,14 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
482
482
|
else if ((this.parent.enterKey === 'P' && !shiftKey) || (this.parent.shiftEnterKey === 'P' && shiftKey)) {
|
|
483
483
|
insertElem = this.parent.createElement('p');
|
|
484
484
|
}
|
|
485
|
+
var previousBlockNode = this.parent.formatter.editorManager.domNode.blockNodes()[0].previousSibling;
|
|
486
|
+
var nextBlockNode = this.parent.formatter.editorManager.domNode.blockNodes()[0].nextSibling;
|
|
487
|
+
if (!isNOU(previousBlockNode) && previousBlockNode.hasAttribute('style')) {
|
|
488
|
+
insertElem.setAttribute('style', previousBlockNode.getAttribute('style'));
|
|
489
|
+
}
|
|
490
|
+
if (isNOU(previousBlockNode) && !isNOU(nextBlockNode) && nextBlockNode.hasAttribute('style')) {
|
|
491
|
+
insertElem.setAttribute('style', nextBlockNode.getAttribute('style'));
|
|
492
|
+
}
|
|
485
493
|
return insertElem;
|
|
486
494
|
};
|
|
487
495
|
return EnterKeyAction;
|
|
@@ -1534,6 +1534,7 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
1534
1534
|
private getUpdatedValue;
|
|
1535
1535
|
private updateValueOnIdle;
|
|
1536
1536
|
private updateIntervalValue;
|
|
1537
|
+
private removeResizeElement;
|
|
1537
1538
|
private updateStatus;
|
|
1538
1539
|
private onDocumentClick;
|
|
1539
1540
|
private blurHandler;
|
|
@@ -744,7 +744,8 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
746
|
var notFormatPainterCopy = isNOU(e.action) ? true : (e.action !== 'format-copy' ? true : false);
|
|
747
|
-
if (this.formatter.getUndoRedoStack().length === 0 && notFormatPainterCopy &&
|
|
747
|
+
if (this.formatter.getUndoRedoStack().length === 0 && notFormatPainterCopy &&
|
|
748
|
+
!(e.altKey || e.shiftKey || (e.altKey && e.shiftKey && e.which === 67))) {
|
|
748
749
|
this.formatter.saveData();
|
|
749
750
|
}
|
|
750
751
|
if (e.action !== 'insert-link' &&
|
|
@@ -1864,8 +1865,8 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1864
1865
|
}
|
|
1865
1866
|
else {
|
|
1866
1867
|
if (target === 'windowResize' && heightPercent) {
|
|
1867
|
-
//
|
|
1868
|
-
heightValue = parseInt(heightValue) - 2 + 'px';
|
|
1868
|
+
//cntEle hide the borderBottom of RichTextEditor. so removed the 2px of cntEle height.
|
|
1869
|
+
heightValue = parseInt(heightValue, 10) - 2 + 'px';
|
|
1869
1870
|
}
|
|
1870
1871
|
setStyleAttribute(cntEle, { height: heightValue, marginTop: topValue + 'px' });
|
|
1871
1872
|
}
|
|
@@ -1889,7 +1890,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1889
1890
|
* @public
|
|
1890
1891
|
*/
|
|
1891
1892
|
RichTextEditor.prototype.getHtml = function () {
|
|
1892
|
-
var htmlValue = this.contentModule.getEditPanel().innerHTML;
|
|
1893
|
+
var htmlValue = this.removeResizeElement(this.contentModule.getEditPanel().innerHTML);
|
|
1893
1894
|
return (this.enableXhtml && (htmlValue === '<p><br></p>' || htmlValue === '<div><br></div>' ||
|
|
1894
1895
|
htmlValue === '<br>') ? null : this.serializeValue(htmlValue));
|
|
1895
1896
|
};
|
|
@@ -1900,7 +1901,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1900
1901
|
* @public
|
|
1901
1902
|
*/
|
|
1902
1903
|
RichTextEditor.prototype.getXhtml = function () {
|
|
1903
|
-
var currentValue = this.value;
|
|
1904
|
+
var currentValue = this.removeResizeElement(this.value);
|
|
1904
1905
|
if (!isNOU(currentValue) && this.enableXhtml) {
|
|
1905
1906
|
currentValue = this.htmlEditorModule.xhtmlValidation.selfEncloseValidation(currentValue);
|
|
1906
1907
|
}
|
|
@@ -2141,14 +2142,11 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2141
2142
|
};
|
|
2142
2143
|
RichTextEditor.prototype.getUpdatedValue = function () {
|
|
2143
2144
|
var value;
|
|
2144
|
-
if (!isNOU(this.tableModule)) {
|
|
2145
|
-
this.tableModule.removeResizeElement();
|
|
2146
|
-
}
|
|
2147
2145
|
var getTextArea = this.element.querySelector('.e-rte-srctextarea');
|
|
2148
2146
|
if (this.editorMode === 'HTML') {
|
|
2149
2147
|
value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
2150
2148
|
this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
|
|
2151
|
-
this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
|
|
2149
|
+
this.encode(decode(this.removeResizeElement(this.inputElement.innerHTML))) : this.inputElement.innerHTML;
|
|
2152
2150
|
if (getTextArea && getTextArea.style.display === 'block') {
|
|
2153
2151
|
value = getTextArea.value;
|
|
2154
2152
|
}
|
|
@@ -2157,6 +2155,9 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2157
2155
|
value = this.inputElement.value === '' ? null :
|
|
2158
2156
|
this.inputElement.value;
|
|
2159
2157
|
}
|
|
2158
|
+
if (value != null && !this.enableHtmlEncode) {
|
|
2159
|
+
value = this.removeResizeElement(value);
|
|
2160
|
+
}
|
|
2160
2161
|
return value;
|
|
2161
2162
|
};
|
|
2162
2163
|
RichTextEditor.prototype.updateValueOnIdle = function () {
|
|
@@ -2172,6 +2173,17 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2172
2173
|
clearTimeout(this.idleInterval);
|
|
2173
2174
|
this.idleInterval = setTimeout(this.updateValueOnIdle.bind(this), 0);
|
|
2174
2175
|
};
|
|
2176
|
+
RichTextEditor.prototype.removeResizeElement = function (value) {
|
|
2177
|
+
var valueElementWrapper = document.createElement("div");
|
|
2178
|
+
valueElementWrapper.innerHTML = value;
|
|
2179
|
+
var item = valueElementWrapper.querySelectorAll('.e-column-resize, .e-row-resize, .e-table-box, .e-table-rhelper, .e-img-resize');
|
|
2180
|
+
if (item.length > 0) {
|
|
2181
|
+
for (var i = 0; i < item.length; i++) {
|
|
2182
|
+
detach(item[i]);
|
|
2183
|
+
}
|
|
2184
|
+
}
|
|
2185
|
+
return valueElementWrapper.innerHTML;
|
|
2186
|
+
};
|
|
2175
2187
|
RichTextEditor.prototype.updateStatus = function (e) {
|
|
2176
2188
|
if (!isNOU(e.html) || !isNOU(e.markdown)) {
|
|
2177
2189
|
var status_1 = this.formatter.editorManager.undoRedoManager.getUndoStatus();
|
|
@@ -2220,6 +2232,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2220
2232
|
this.notify(events.focusChange, {});
|
|
2221
2233
|
var value = this.getUpdatedValue();
|
|
2222
2234
|
this.setProperties({ value: value });
|
|
2235
|
+
this.valueContainer.value = this.value;
|
|
2223
2236
|
this.notify(events.toolbarRefresh, { args: e, documentNode: document });
|
|
2224
2237
|
this.isValueChangeBlurhandler = true;
|
|
2225
2238
|
this.invokeChangeEvent();
|
|
@@ -1046,9 +1046,10 @@ var Image = /** @class */ (function () {
|
|
|
1046
1046
|
var getAlt = (e.selectNode[0].getAttribute('alt') === null) ? '' :
|
|
1047
1047
|
e.selectNode[0].getAttribute('alt');
|
|
1048
1048
|
var content = '<div class="e-rte-field' + ' ' + this.parent.cssClass + '">' +
|
|
1049
|
-
'<input type="text" spellcheck="false"
|
|
1049
|
+
'<input type="text" spellcheck="false" class="e-input e-img-alt' + ' ' + this.parent.cssClass + '" placeholder="' + altText + '"/>' +
|
|
1050
1050
|
'</div>';
|
|
1051
1051
|
var contentElem = parseHtml(content);
|
|
1052
|
+
contentElem.querySelector('input').setAttribute('value', getAlt);
|
|
1052
1053
|
altWrap.appendChild(contentElem);
|
|
1053
1054
|
var inputAlt = altWrap.querySelector('.e-img-alt');
|
|
1054
1055
|
var altArgs_1 = {
|
|
@@ -1584,14 +1585,12 @@ var Image = /** @class */ (function () {
|
|
|
1584
1585
|
this.changedWidthValue = null;
|
|
1585
1586
|
this.changedHeightValue = null;
|
|
1586
1587
|
var content = '<div class="e-rte-label' + ' ' + this.parent.cssClass + '"><label>' + imgWidth +
|
|
1587
|
-
'</label></div><div class="e-rte-field' + ' ' + this.parent.cssClass + '"><input type="text" id="imgwidth" class="e-img-width' + ' ' + this.parent.cssClass + '
|
|
1588
|
-
widthVal
|
|
1589
|
-
+ ' /></div>' +
|
|
1588
|
+
'</label></div><div class="e-rte-field' + ' ' + this.parent.cssClass + '"><input type="text" id="imgwidth" class="e-img-width' + ' ' + this.parent.cssClass + '/></div>' +
|
|
1590
1589
|
'<div class="e-rte-label' + ' ' + this.parent.cssClass + '">' + '<label>' + imgHeight + '</label></div><div class="e-rte-field' + ' ' + this.parent.cssClass + '"> ' +
|
|
1591
|
-
'<input type="text" id="imgheight" class="e-img-height' + ' ' + this.parent.cssClass + '"
|
|
1592
|
-
heightVal
|
|
1593
|
-
+ ' /></div>';
|
|
1590
|
+
'<input type="text" id="imgheight" class="e-img-height' + ' ' + this.parent.cssClass + '"/></div>';
|
|
1594
1591
|
var contentElem = parseHtml(content);
|
|
1592
|
+
contentElem.getElementById('imgwidth').setAttribute('value', widthVal);
|
|
1593
|
+
contentElem.getElementById('imgheight').setAttribute('value', heightVal);
|
|
1595
1594
|
imgSizeWrap.appendChild(contentElem);
|
|
1596
1595
|
this.widthNum = new TextBox({
|
|
1597
1596
|
value: formatUnit(widthVal),
|
|
@@ -58,10 +58,10 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
58
58
|
if (!this.parent.enabled) {
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
+
this.parent.trigger('toolbarClick', args);
|
|
61
62
|
if (!this.parent.readonly || isNullOrUndefined(args.item)) {
|
|
62
63
|
this.parent.notify(events.toolbarClick, args);
|
|
63
64
|
}
|
|
64
|
-
this.parent.trigger('toolbarClick', args);
|
|
65
65
|
};
|
|
66
66
|
ToolbarRenderer.prototype.dropDownSelected = function (args) {
|
|
67
67
|
this.parent.notify(events.dropDownSelect, args);
|