@syncfusion/ej2-richtexteditor 25.1.41 → 25.1.42
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 +28 -0
- 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 +159 -72
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +159 -73
- 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 +19 -9
- package/src/editor-manager/plugin/inserthtml.js +8 -2
- package/src/editor-manager/plugin/lists.d.ts +1 -0
- package/src/editor-manager/plugin/lists.js +97 -51
- package/src/editor-manager/plugin/nodecutter.js +2 -2
- package/src/rich-text-editor/actions/emoji-picker.js +1 -1
- package/src/rich-text-editor/actions/enter-key.js +9 -0
- package/src/rich-text-editor/actions/html-editor.js +8 -2
- package/src/rich-text-editor/actions/paste-clean-up.js +2 -2
- package/src/rich-text-editor/base/enum.d.ts +4 -4
- package/src/rich-text-editor/base/enum.js +9 -9
- package/src/rich-text-editor/base/interface.d.ts +3 -3
- package/src/rich-text-editor/base/rich-text-editor.js +7 -0
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
- package/src/rich-text-editor/renderer/image-module.js +3 -3
- package/src/rich-text-editor/renderer/link-module.js +3 -0
- package/src/rich-text-editor/renderer/table-module.js +3 -0
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +2 -0
- package/src/rich-text-editor/renderer/toolbar-renderer.js +7 -1
- package/styles/bootstrap-dark.css +4 -0
- package/styles/bootstrap.css +4 -0
- package/styles/bootstrap4.css +4 -0
- package/styles/bootstrap5-dark.css +4 -0
- package/styles/bootstrap5.css +4 -0
- package/styles/fabric-dark.css +4 -0
- package/styles/fabric.css +4 -0
- package/styles/fluent-dark.css +4 -0
- package/styles/fluent.css +4 -0
- package/styles/highcontrast-light.css +4 -0
- package/styles/highcontrast.css +4 -0
- package/styles/material-dark.css +4 -0
- package/styles/material.css +4 -0
- package/styles/material3-dark.css +4 -0
- package/styles/material3.css +4 -0
- package/styles/rich-text-editor/_layout.scss +4 -0
- package/styles/rich-text-editor/bootstrap-dark.css +4 -0
- package/styles/rich-text-editor/bootstrap.css +4 -0
- package/styles/rich-text-editor/bootstrap4.css +4 -0
- package/styles/rich-text-editor/bootstrap5-dark.css +4 -0
- package/styles/rich-text-editor/bootstrap5.css +4 -0
- package/styles/rich-text-editor/fabric-dark.css +4 -0
- package/styles/rich-text-editor/fabric.css +4 -0
- package/styles/rich-text-editor/fluent-dark.css +4 -0
- package/styles/rich-text-editor/fluent.css +4 -0
- package/styles/rich-text-editor/highcontrast-light.css +4 -0
- package/styles/rich-text-editor/highcontrast.css +4 -0
- package/styles/rich-text-editor/material-dark.css +4 -0
- package/styles/rich-text-editor/material.css +4 -0
- package/styles/rich-text-editor/material3-dark.css +4 -0
- package/styles/rich-text-editor/material3.css +4 -0
- package/styles/rich-text-editor/tailwind-dark.css +4 -0
- package/styles/rich-text-editor/tailwind.css +4 -0
- package/styles/tailwind-dark.css +4 -0
- package/styles/tailwind.css +4 -0
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 25.1.
|
|
3
|
+
* version : 25.1.42
|
|
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@25.1.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@25.1.41",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512
|
|
5
|
+
"_integrity": "sha512-+SQQWuGTr85M/kWC43aUeAA8TDQsVcc+Py0S5FC0jSb88TH8ZhY1yS/N9nSsCtkk8H+9LWn3sF3xk9VNzovEdw==",
|
|
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-25.1.
|
|
29
|
-
"_shasum": "
|
|
28
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-25.1.41.tgz",
|
|
29
|
+
"_shasum": "e454a752ac8f1b765d7affaadc18316ec104e50f",
|
|
30
30
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
31
31
|
"_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
|
|
32
32
|
"author": {
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@syncfusion/ej2-base": "~25.1.35",
|
|
41
41
|
"@syncfusion/ej2-buttons": "~25.1.39",
|
|
42
42
|
"@syncfusion/ej2-filemanager": "~25.1.40",
|
|
43
|
-
"@syncfusion/ej2-inputs": "~25.1.
|
|
44
|
-
"@syncfusion/ej2-navigations": "~25.1.
|
|
45
|
-
"@syncfusion/ej2-popups": "~25.1.
|
|
43
|
+
"@syncfusion/ej2-inputs": "~25.1.42",
|
|
44
|
+
"@syncfusion/ej2-navigations": "~25.1.42",
|
|
45
|
+
"@syncfusion/ej2-popups": "~25.1.42",
|
|
46
46
|
"@syncfusion/ej2-splitbuttons": "~25.1.38"
|
|
47
47
|
},
|
|
48
48
|
"deprecated": false,
|
|
@@ -58,7 +58,17 @@
|
|
|
58
58
|
"rich-text-editor",
|
|
59
59
|
"markdown-editor",
|
|
60
60
|
"wysiwyg-markdown-editor",
|
|
61
|
-
"editor"
|
|
61
|
+
"editor",
|
|
62
|
+
"rich text editor",
|
|
63
|
+
"editing",
|
|
64
|
+
"rich text",
|
|
65
|
+
"rich editor",
|
|
66
|
+
"text editor",
|
|
67
|
+
"contenteditable",
|
|
68
|
+
"wysiwyg",
|
|
69
|
+
"html",
|
|
70
|
+
"text",
|
|
71
|
+
"markdown"
|
|
62
72
|
],
|
|
63
73
|
"license": "SEE LICENSE IN license",
|
|
64
74
|
"main": "./dist/ej2-richtexteditor.umd.min.js",
|
|
@@ -69,6 +79,6 @@
|
|
|
69
79
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
70
80
|
},
|
|
71
81
|
"typings": "index.d.ts",
|
|
72
|
-
"version": "25.1.
|
|
82
|
+
"version": "25.1.42",
|
|
73
83
|
"sideEffects": false
|
|
74
84
|
}
|
|
@@ -58,7 +58,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
58
58
|
range.startContainer === range.endContainer;
|
|
59
59
|
var isCollapsed = range.collapsed;
|
|
60
60
|
var nodes = this.getNodeCollection(range, nodeSelection, node);
|
|
61
|
-
var closestParentNode = (node.nodeName.toLowerCase() === 'table') ? this.closestEle(nodes[0].parentNode, editNode) : nodes[0];
|
|
61
|
+
var closestParentNode = (node.nodeName.toLowerCase() === 'table') ? (!isNOU(nodes[0]) ? this.closestEle(nodes[0].parentNode, editNode) : range.startContainer) : nodes[0];
|
|
62
62
|
if (closestParentNode && closestParentNode.nodeName === 'LI' && node.nodeName.toLowerCase() === 'table') {
|
|
63
63
|
this.insertTableInList(range, node, closestParentNode, nodes[0], nodeCutter);
|
|
64
64
|
return;
|
|
@@ -103,7 +103,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
103
103
|
nodes[index].parentNode.removeChild(nodes[index]);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
if (sibNode) {
|
|
106
|
+
if (!isNOU(sibNode) && !isNOU(sibNode.parentNode)) {
|
|
107
107
|
InsertMethods.AppendBefore(node, sibNode, true);
|
|
108
108
|
}
|
|
109
109
|
else {
|
|
@@ -354,6 +354,12 @@ var InsertHtml = /** @class */ (function () {
|
|
|
354
354
|
node.parentNode.replaceChild(fragment, node);
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
+
if (lastSelectionNode.nodeName === 'TABLE') {
|
|
358
|
+
var pTag = createElement('p');
|
|
359
|
+
pTag.appendChild(createElement('br'));
|
|
360
|
+
lastSelectionNode.parentElement.insertBefore(pTag, lastSelectionNode.nextSibling);
|
|
361
|
+
lastSelectionNode = pTag;
|
|
362
|
+
}
|
|
357
363
|
if (lastSelectionNode.nodeName === '#text') {
|
|
358
364
|
this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
359
365
|
}
|
|
@@ -553,58 +553,36 @@ var Lists = /** @class */ (function () {
|
|
|
553
553
|
var listsNodes = this.domNode.blockNodes(true);
|
|
554
554
|
if (e.enterAction === 'BR') {
|
|
555
555
|
this.setSelectionBRConfig();
|
|
556
|
-
var
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
while (!this.parent.domNode.isBlockNode(currentNode) && currentNode !== this.parent.editableElement) {
|
|
566
|
-
previousCurrentNode = currentNode;
|
|
567
|
-
currentNode = currentNode.parentElement;
|
|
568
|
-
}
|
|
569
|
-
if (this.parent.domNode.isBlockNode(currentNode) && currentNode === this.parent.editableElement) {
|
|
570
|
-
currentFormatNodes.push(previousCurrentNode);
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
for (var i = 0; i < currentFormatNodes.length; i++) {
|
|
574
|
-
if (!this.parent.domNode.isBlockNode(currentFormatNodes[i])) {
|
|
575
|
-
var currentNode = currentFormatNodes[i];
|
|
576
|
-
var previousNode = currentNode;
|
|
577
|
-
while (currentNode === this.parent.editableElement) {
|
|
578
|
-
previousNode = currentNode;
|
|
579
|
-
currentNode = currentNode.parentElement;
|
|
556
|
+
var selectedNodes = this.parent.domNode.blockNodes();
|
|
557
|
+
if (selectedNodes.length > 1) {
|
|
558
|
+
var i = 0;
|
|
559
|
+
var currentAlignmentNode = selectedNodes[0];
|
|
560
|
+
while (!isNOU(currentAlignmentNode)) {
|
|
561
|
+
if (currentAlignmentNode.nodeName === 'BR') {
|
|
562
|
+
var nextNode = currentAlignmentNode.nextSibling;
|
|
563
|
+
detach(currentAlignmentNode);
|
|
564
|
+
currentAlignmentNode = nextNode;
|
|
580
565
|
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
while (!isNOU(preNode) && preNode.nodeName !== 'BR' &&
|
|
593
|
-
!this.parent.domNode.isBlockNode(preNode)) {
|
|
594
|
-
tempElem.firstChild.parentElement.insertBefore(preNode, tempElem.firstChild);
|
|
595
|
-
preNode = tempElem.previousSibling;
|
|
596
|
-
}
|
|
597
|
-
if (!isNOU(preNode) && preNode.nodeName === 'BR') {
|
|
598
|
-
detach(preNode);
|
|
599
|
-
}
|
|
600
|
-
var postNode = tempElem.nextSibling;
|
|
601
|
-
while (!isNOU(postNode) && postNode.nodeName !== 'BR' &&
|
|
602
|
-
!this.parent.domNode.isBlockNode(postNode)) {
|
|
603
|
-
tempElem.appendChild(postNode);
|
|
604
|
-
postNode = tempElem.nextSibling;
|
|
566
|
+
if (!isNOU(currentAlignmentNode)) {
|
|
567
|
+
selectedNodes[i] = currentAlignmentNode.nodeName === 'LI' || this.parent.domNode.isBlockNode(currentAlignmentNode) ?
|
|
568
|
+
currentAlignmentNode : this.gatherElementsAround(currentAlignmentNode);
|
|
569
|
+
var currentSelectNode = selectedNodes[i].nodeName === 'LI' ? selectedNodes[i].parentElement : selectedNodes[i];
|
|
570
|
+
var currentElementCheckNode = currentAlignmentNode.nodeName === '#text' ? currentAlignmentNode.parentElement : currentAlignmentNode;
|
|
571
|
+
currentAlignmentNode = !isNOU(currentElementCheckNode.querySelector('.e-editor-select-end')) ||
|
|
572
|
+
!isNOU(closest(currentAlignmentNode, '.e-editor-select-end')) ?
|
|
573
|
+
null : currentSelectNode.nextSibling;
|
|
574
|
+
if (currentAlignmentNode === null && !isNOU(currentSelectNode.nextSibling) && currentSelectNode.nextSibling.nodeName === 'BR') {
|
|
575
|
+
detach(currentSelectNode.nextSibling);
|
|
576
|
+
}
|
|
605
577
|
}
|
|
606
|
-
|
|
607
|
-
|
|
578
|
+
i++;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
if (!this.parent.domNode.isBlockNode(selectedNodes[0])) {
|
|
583
|
+
selectedNodes[0] = this.gatherElementsAround(selectedNodes[0]);
|
|
584
|
+
if (!isNOU(selectedNodes[0].nextSibling) && (selectedNodes[0].nextSibling.nodeName === 'BR')) {
|
|
585
|
+
detach(selectedNodes[0].nextSibling);
|
|
608
586
|
}
|
|
609
587
|
}
|
|
610
588
|
}
|
|
@@ -710,6 +688,16 @@ var Lists = /** @class */ (function () {
|
|
|
710
688
|
}
|
|
711
689
|
}
|
|
712
690
|
this.cleanNode();
|
|
691
|
+
if (e.enterAction === 'BR') {
|
|
692
|
+
var spansToRemove = document.querySelectorAll('span#removeSpan');
|
|
693
|
+
spansToRemove.forEach(function (span) {
|
|
694
|
+
var fragment = document.createDocumentFragment();
|
|
695
|
+
while (span.firstChild) {
|
|
696
|
+
fragment.appendChild(span.firstChild);
|
|
697
|
+
}
|
|
698
|
+
span.parentNode.replaceChild(fragment, span);
|
|
699
|
+
});
|
|
700
|
+
}
|
|
713
701
|
this.parent.editableElement.focus();
|
|
714
702
|
if (isIDevice()) {
|
|
715
703
|
setEditFrameFocus(this.parent.editableElement, selector);
|
|
@@ -913,6 +901,12 @@ var Lists = /** @class */ (function () {
|
|
|
913
901
|
if (e.enterAction !== 'BR') {
|
|
914
902
|
this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapper));
|
|
915
903
|
}
|
|
904
|
+
else {
|
|
905
|
+
var wrapperSpan = '<span class=e-rte-wrap-inner id=removeSpan></span>';
|
|
906
|
+
var br = document.createElement('br');
|
|
907
|
+
this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapperSpan));
|
|
908
|
+
element.appendChild(br);
|
|
909
|
+
}
|
|
916
910
|
}
|
|
917
911
|
else if (this.domNode.contents(element)[0].nodeType === 3) {
|
|
918
912
|
var replace = this.domNode.createTagString(CONSTANT.DEFAULT_TAG, parentNode, this.parent.domNode.encode(this.domNode.contents(element)[0].textContent));
|
|
@@ -925,8 +919,18 @@ var Lists = /** @class */ (function () {
|
|
|
925
919
|
}
|
|
926
920
|
else {
|
|
927
921
|
var childNode = element.firstChild;
|
|
922
|
+
if (childNode) {
|
|
923
|
+
var attributes_1 = element.parentElement.attributes;
|
|
924
|
+
if (attributes_1.length > 0) {
|
|
925
|
+
for (var d = 0; d < attributes_1.length; d++) {
|
|
926
|
+
var e_1 = attributes_1[d];
|
|
927
|
+
var existingValue = childNode.getAttribute(e_1.nodeName);
|
|
928
|
+
var parentValue = (element.parentElement).getAttribute(e_1.nodeName);
|
|
929
|
+
childNode.setAttribute(e_1.nodeName, existingValue ? parentValue + ' ' + existingValue : parentValue);
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}
|
|
928
933
|
className = childNode.getAttribute('class');
|
|
929
|
-
attributes(childNode, this.domNode.rawAttributes(parentNode));
|
|
930
934
|
if (className && childNode.getAttribute('class')) {
|
|
931
935
|
attributes(childNode, { 'class': className + ' ' + childNode.getAttribute('class') });
|
|
932
936
|
}
|
|
@@ -967,6 +971,48 @@ var Lists = /** @class */ (function () {
|
|
|
967
971
|
Lists.prototype.closeTag = function (type) {
|
|
968
972
|
return this.domNode.parseHTMLFragment('<span class="e-rte-list-close-' + type.toLowerCase() + '"></span>');
|
|
969
973
|
};
|
|
974
|
+
Lists.prototype.gatherElementsAround = function (node) {
|
|
975
|
+
var pWrap = document.createElement('p');
|
|
976
|
+
// Insert the new div before the current node
|
|
977
|
+
var currentNode = node.previousSibling;
|
|
978
|
+
var classNode = node.parentNode;
|
|
979
|
+
if (classNode.className === 'e-editor-select-start') {
|
|
980
|
+
node.parentNode.parentNode.insertBefore(pWrap, node.parentNode);
|
|
981
|
+
}
|
|
982
|
+
else if (node.parentNode) {
|
|
983
|
+
node.parentNode.insertBefore(pWrap, node);
|
|
984
|
+
}
|
|
985
|
+
// Gather text and inline elements before the currentNode
|
|
986
|
+
var i = 0;
|
|
987
|
+
while (currentNode !== null && currentNode.nodeName !== 'BR' &&
|
|
988
|
+
!this.parent.domNode.isBlockNode(currentNode)) {
|
|
989
|
+
var prevSibling = currentNode.previousSibling;
|
|
990
|
+
if (currentNode.nodeType === 3 || currentNode.nodeType === 1) {
|
|
991
|
+
if (i === 0) {
|
|
992
|
+
pWrap.appendChild(currentNode);
|
|
993
|
+
}
|
|
994
|
+
else {
|
|
995
|
+
pWrap.insertBefore(currentNode, pWrap.firstChild);
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
currentNode = prevSibling;
|
|
999
|
+
i++;
|
|
1000
|
+
}
|
|
1001
|
+
// Add the current node to the new p
|
|
1002
|
+
pWrap.appendChild(node);
|
|
1003
|
+
// Gather text and inline elements after the currentNode
|
|
1004
|
+
currentNode = pWrap.nextSibling ? pWrap.nextSibling : pWrap.parentElement.nextSibling;
|
|
1005
|
+
while (currentNode !== null && currentNode.nodeName !== 'BR' &&
|
|
1006
|
+
!this.parent.domNode.isBlockNode(currentNode)) {
|
|
1007
|
+
var nextSibling = currentNode.nextSibling ?
|
|
1008
|
+
currentNode.nextSibling : currentNode.parentElement.nextSibling;
|
|
1009
|
+
if (currentNode.nodeType === 3 || currentNode.nodeType === 1) {
|
|
1010
|
+
pWrap.appendChild(currentNode);
|
|
1011
|
+
}
|
|
1012
|
+
currentNode = nextSibling;
|
|
1013
|
+
}
|
|
1014
|
+
return pWrap;
|
|
1015
|
+
};
|
|
970
1016
|
return Lists;
|
|
971
1017
|
}());
|
|
972
1018
|
export { Lists };
|
|
@@ -50,7 +50,7 @@ var NodeCutter = /** @class */ (function () {
|
|
|
50
50
|
fragment = this.spliceEmptyNode(fragment, false);
|
|
51
51
|
if (fragment && fragment.childNodes.length > 0) {
|
|
52
52
|
var isEmpty = (fragment.childNodes.length === 1 && fragment.childNodes[0].nodeName !== 'IMG' && !(fragment.querySelectorAll('img').length > 0)
|
|
53
|
-
&& this.isRteElm(fragment) && fragment.textContent === '') ? true : false;
|
|
53
|
+
&& this.isRteElm(fragment) && fragment.textContent.trim() === '') ? true : false;
|
|
54
54
|
if (!isEmpty) {
|
|
55
55
|
if (node) {
|
|
56
56
|
InsertMethods.AppendBefore(fragment, node);
|
|
@@ -71,7 +71,7 @@ var NodeCutter = /** @class */ (function () {
|
|
|
71
71
|
fragment = this.spliceEmptyNode(fragment, true);
|
|
72
72
|
if (fragment && fragment.childNodes.length > 0) {
|
|
73
73
|
var isEmpty = (fragment.childNodes.length === 1 && fragment.childNodes[0].nodeName !== 'IMG'
|
|
74
|
-
&& this.isRteElm(fragment) && fragment.textContent === '') ? true : false;
|
|
74
|
+
&& this.isRteElm(fragment) && fragment.textContent.trim() === '') ? true : false;
|
|
75
75
|
if (!isEmpty) {
|
|
76
76
|
if (node) {
|
|
77
77
|
InsertMethods.AppendBefore(fragment, node, true);
|
|
@@ -767,7 +767,7 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
767
767
|
var popupHeight = 330;
|
|
768
768
|
var popupTop = cursorTop;
|
|
769
769
|
var popupLeft = cursorLeft + rect.width;
|
|
770
|
-
if (rteEle.getBoundingClientRect().top < 0) {
|
|
770
|
+
if (rteEle.getBoundingClientRect().top < 0 && !this.parent.inlineMode.enable) {
|
|
771
771
|
popupTop = popupTop + rteContent.getBoundingClientRect().top - toolbarHeight;
|
|
772
772
|
}
|
|
773
773
|
if (rect.top < popupHeight) {
|
|
@@ -364,6 +364,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
364
364
|
else {
|
|
365
365
|
currentParent = _this.startNode;
|
|
366
366
|
}
|
|
367
|
+
var currentParentStyle = window.getComputedStyle(currentParent);
|
|
367
368
|
_this.removeBRElement(currentParent);
|
|
368
369
|
var isEmptyBrInserted = false;
|
|
369
370
|
var currentParentLastChild = currentParent.lastChild;
|
|
@@ -428,6 +429,14 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
428
429
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
429
430
|
isEmptyBrInserted = true;
|
|
430
431
|
}
|
|
432
|
+
else if (currentParent !== _this.parent.inputElement &&
|
|
433
|
+
(currentParentStyle.display === 'inline' || currentParentStyle.display === 'inline-block')) {
|
|
434
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
435
|
+
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, true).cloneNode(true);
|
|
436
|
+
currentParent.parentElement.insertBefore(outerBRElem, currentParent);
|
|
437
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), currentParent, 0);
|
|
438
|
+
_this.insertFocusContent();
|
|
439
|
+
}
|
|
431
440
|
else {
|
|
432
441
|
_this.insertBRElement();
|
|
433
442
|
}
|
|
@@ -216,8 +216,14 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
216
216
|
range.insertNode(tempSpan);
|
|
217
217
|
}
|
|
218
218
|
var currentChild = this.parent.inputElement.firstChild;
|
|
219
|
-
while (!isNOU(currentChild)
|
|
220
|
-
currentChild.
|
|
219
|
+
while (!isNOU(currentChild)) {
|
|
220
|
+
if (currentChild.nodeName === '#text') {
|
|
221
|
+
currentChild = currentChild.nextElementSibling;
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
if (currentChild.textContent.replace(regEx, '').trim().length > 0) {
|
|
225
|
+
currentChild.innerHTML = currentChild.innerHTML.replace(regEx, '');
|
|
226
|
+
}
|
|
221
227
|
currentChild = currentChild.nextElementSibling;
|
|
222
228
|
}
|
|
223
229
|
var tempSpanToRemove = this.parent.inputElement.querySelector('.tempSpan');
|
|
@@ -9,7 +9,7 @@ import { CLS_RTE_IMAGE, CLS_IMGINLINE, CLS_IMGBREAK } from '../base/classes';
|
|
|
9
9
|
import { pasteCleanupGroupingTags } from '../../common/config';
|
|
10
10
|
import { NodeSelection } from '../../selection/selection';
|
|
11
11
|
import * as EVENTS from './../../common/constant';
|
|
12
|
-
import { RenderType,
|
|
12
|
+
import { RenderType, ImageInputSource } from '../base/enum';
|
|
13
13
|
import { Uploader } from '@syncfusion/ej2-inputs';
|
|
14
14
|
import * as classes from '../base/classes';
|
|
15
15
|
import { sanitizeHelper, convertToBlob, getDefaultValue } from '../base/util';
|
|
@@ -410,7 +410,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
410
410
|
var _this = this;
|
|
411
411
|
this.parent.inputElement.contentEditable = 'true';
|
|
412
412
|
e.element = imgElem;
|
|
413
|
-
e.
|
|
413
|
+
e.detectImageSource = ImageInputSource.Pasted;
|
|
414
414
|
this.parent.trigger(events.imageUploadSuccess, e, function (e) {
|
|
415
415
|
if (!isNullOrUndefined(_this.parent.insertImageSettings.path)) {
|
|
416
416
|
var url = _this.parent.insertImageSettings.path + e.file.name;
|
|
@@ -67,11 +67,11 @@ export declare type ToolbarConfigItems = 'Alignments' | 'JustifyLeft' | 'Justify
|
|
|
67
67
|
/**
|
|
68
68
|
* Defines types to be used as inserted image.
|
|
69
69
|
*/
|
|
70
|
-
export declare enum
|
|
71
|
-
/** Defines
|
|
70
|
+
export declare enum ImageInputSource {
|
|
71
|
+
/** Defines ImageInputSource as Uploaded */
|
|
72
72
|
Uploaded = "Uploaded",
|
|
73
|
-
/** Defines
|
|
73
|
+
/** Defines ImageInputSource as Dropped */
|
|
74
74
|
Dropped = "Dropped",
|
|
75
|
-
/** Defines
|
|
75
|
+
/** Defines ImageInputSource as Pasted */
|
|
76
76
|
Pasted = "Pasted"
|
|
77
77
|
}
|
|
@@ -64,12 +64,12 @@ export var DialogType;
|
|
|
64
64
|
/**
|
|
65
65
|
* Defines types to be used as inserted image.
|
|
66
66
|
*/
|
|
67
|
-
export var
|
|
68
|
-
(function (
|
|
69
|
-
/** Defines
|
|
70
|
-
|
|
71
|
-
/** Defines
|
|
72
|
-
|
|
73
|
-
/** Defines
|
|
74
|
-
|
|
75
|
-
})(
|
|
67
|
+
export var ImageInputSource;
|
|
68
|
+
(function (ImageInputSource) {
|
|
69
|
+
/** Defines ImageInputSource as Uploaded */
|
|
70
|
+
ImageInputSource["Uploaded"] = "Uploaded";
|
|
71
|
+
/** Defines ImageInputSource as Dropped */
|
|
72
|
+
ImageInputSource["Dropped"] = "Dropped";
|
|
73
|
+
/** Defines ImageInputSource as Pasted */
|
|
74
|
+
ImageInputSource["Pasted"] = "Pasted";
|
|
75
|
+
})(ImageInputSource || (ImageInputSource = {}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component, Observer, L10n, KeyboardEventArgs, EmitType } from '@syncfusion/ej2-base';
|
|
2
2
|
import { ItemModel, OverflowMode } from '@syncfusion/ej2-navigations';
|
|
3
3
|
import { ItemModel as DropDownItemModel, DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
|
4
|
-
import { ToolbarType, RenderType,
|
|
4
|
+
import { ToolbarType, RenderType, ImageInputSource } from './enum';
|
|
5
5
|
import { Toolbar } from '../actions/toolbar';
|
|
6
6
|
import { UndoRedoManager } from '../../editor-manager/plugin/undo';
|
|
7
7
|
import { ClickEventArgs } from '@syncfusion/ej2-navigations';
|
|
@@ -1159,9 +1159,9 @@ export interface ImageSuccessEventArgs {
|
|
|
1159
1159
|
*/
|
|
1160
1160
|
element?: HTMLElement;
|
|
1161
1161
|
/**
|
|
1162
|
-
* Specify the
|
|
1162
|
+
* Specify the detected image source of the event.
|
|
1163
1163
|
*/
|
|
1164
|
-
|
|
1164
|
+
detectImageSource?: ImageInputSource;
|
|
1165
1165
|
}
|
|
1166
1166
|
/**
|
|
1167
1167
|
* Provides information about a ImageFailed event.
|
|
@@ -1072,6 +1072,13 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1072
1072
|
clearInterval(this.timeInterval);
|
|
1073
1073
|
this.timeInterval = null;
|
|
1074
1074
|
}
|
|
1075
|
+
var tooltipElements = document.querySelectorAll('[data-rte-id="' + this.getID() + '"]');
|
|
1076
|
+
for (var i = 0; i < tooltipElements.length; i++) {
|
|
1077
|
+
var tooltipEle = tooltipElements[i];
|
|
1078
|
+
if (this.getID() === tooltipEle.getAttribute('data-rte-id')) {
|
|
1079
|
+
detach(tooltipEle);
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1075
1082
|
if (this.element.offsetParent === null) {
|
|
1076
1083
|
if (!isNOU(this.toolbarModule)) {
|
|
1077
1084
|
this.toolbarModule.destroy();
|
|
@@ -14,7 +14,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
import { ContentRender } from '../renderer/content-renderer';
|
|
15
15
|
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
16
16
|
import { getEditValue } from '../base/util';
|
|
17
|
-
var IFRAMEHEADER = "\n<!DOCTYPE html> \n <html>\n <head>\n <meta charset='utf-8' /> \n <style>\n @charset \"UTF-8\";\n body {\n font-family: \"Roboto\", sans-serif;\n font-size: 14px;\n }\n html, body{height: 100%;margin: 0;}\n body.e-cursor{cursor:default}\n span.e-selected-node\t{background-color: #939393;color: white;}\n span.e-selected-node.e-highlight {background-color: #1d9dd8;}\n body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}\n .e-rte-image, .e-rte-video {border: 0;cursor: pointer;display:\n block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-audio {border: 0;cursor: pointer;display:\n block;float: none;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imginline, .e-rte-audio.e-audio-inline, .e-rte-video.e-video-inline {display: inline-block;float: none;\n margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));padding: 1px;vertical-align: bottom;}\n .e-rte-image.e-imgcenter, .e-rte-video.e-video-center {cursor: pointer;display: block;float: none;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imgright, .e-rte-video.e-video-right { float: right; margin: 0 auto;margin-left: 5px;text-align: right;}\n .e-rte-image.e-imgleft, .e-rte-video.e-video-left {float: left;margin: 0 auto;margin-right: 5px;text-align: left;}\n .e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}\n .e-img-caption.e-caption-inline {display: inline-block;float: none;\n margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));\n position: relativetext-align: center;vertical-align: bottom;}\n .e-rte-img-caption.e-imgcenter {display: contents; margin-left: auto; margin-right: auto;}\n .e-rte-img-caption.e-imgright {display: contents; margin-left: auto; margin-right: 0;}\n .e-rte-img-caption.e-imgleft {display: contents;margin-left: 0;margin-right: auto;}\n .e-img-caption.e-rte-img-caption.e-imgbreak {display: contents;}\n .e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;\n margin: auto;opacity: .9;text-align: center;width: 100%;}\n .e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}\n .e-imgleft, .e-video-left {float: left;margin: 0 5px 0 0;text-align: left;}\n .e-imgright, .e-video-right {float: right;margin: 0 0 0 5px;text-align: right;}\n .e-imgcenter, .e-video-center {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}\n .e-imginline , .e-audio-inline, .e-video-inline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;\n max-width: calc(100% - (2 * 5px));vertical-align: bottom;}\n .e-imgbreak, .e-audio-break, .e-video-break {border: 0;cursor: pointer;\n display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-img-focus:not(.e-resize), .e-audio-focus:not(.e-resize), .e-video-focus:not(.e-resize) {border: solid 2px #4a90e2;}\n img.e-img-focus::selection, audio.e-audio-focus::selection, .e-video-focus::selection { background: transparent;color: transparent;}\n span.e-rte-imageboxmark, span.e-rte-videoboxmark { width: 10px; height: 10px; position: absolute; display: block;\n background: #4a90e2; border: 1px solid #fff; z-index: 1000;}\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-mob-rte span.e-rte-imageboxmark, .e-mob-rte span.e-rte-videoboxmark { background: #fff; border: 1px solid #4a90e2;\n border-radius: 15px; height: 20px; width: 20px; }\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-rte-content .e-content img.e-resize, .e-rte-content .e-content video.e-resize { z-index: 1000; }\n .e-img-caption .e-img-inner { outline: 0; }\n .e-rte-img-caption.e-imgleft .e-img-inner { float: left; text-align: left; }\n .e-rte-img-caption.e-imgright .e-img-inner { float: right; text-align: right; }\n .e-rte-img-caption.e-imgleft .e-img-wrap, .e-rte-img-caption.e-imgright .e-img-wrap { display: contents; }\n .e-img-caption a:focus-visible { outline: none; }\n .e-rte-img-caption .e-rte-image.e-imgright { margin-left: auto; margin-right: 0; }\n .e-rte-img-caption .e-rte-image.e-imgleft { margin: 0; }\n body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;\n overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}\n p{margin: 0 0 10px;margin-bottom: 10px;}\n li{margin-bottom: 10px;}\n h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}\n h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}\n h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}\n h4{font-size: 16px;font-weight: 400;line-height: 1.5;margin: 0;}\n h5{font-size: 00.8em;font-weight: 400;margin: 0;}\n h6{font-size: 00.65em;font-weight: 400;margin: 0;}\n blockquote{margin: 10px 0;margin-left: 0;padding-left: 5px;border-left: solid 2px #5c5c5c;}\n pre{background-color: inherit;border: 0;border-radius: 0;color: #333;\n font-size: inherit;line-height: inherit;margin: 0 0 10px;overflow: visible;padding: 0;\n white-space: pre-wrap;word-break: inherit;word-wrap: break-word;}\n strong, b{font-weight: 700;}\n a{text-decoration: none;user-select: auto;}\n a:hover{text-decoration: underline;};\n p:last-child, pre:last-child, blockquote:last-child{margin-bottom: 0;}\n h3+h4, h4+h5, h5+h6{margin-top: 00.6em;}\n ul:last-child{margin-bottom: 0;}\n table { border-collapse: collapse; empty-cells: show;}\n table td,table th {border: 1px solid #BDBDBD; height: 20px; padding: 2px 5px; vertical-align: middle;}\n table.e-alternate-border tbody tr:nth-child(2n) {background-color: #F5F5F5;}\n table th {background-color: #E0E0E0;}\n table.e-dashed-border td,table.e-dashed-border th { border: 1px dashed #BDBDBD} \n table .e-cell-select {border: 1px double #4a90e2;}\n span.e-table-box { cursor: nwse-resize; display: block; height: 10px; position: absolute; width: 10px; }\n span.e-table-box.e-rmob {height: 14px;width: 14px;}\n .e-row-resize, .e-column-resize { background-color: transparent; background-repeat: repeat;\n bottom: 0;cursor: col-resize;height: 1px;overflow: visible;position: absolute;width: 1px; }\n .e-row-resize { cursor: row-resize; height: 1px;}\n .e-table-rhelper { cursor: col-resize; opacity: .87;position: absolute;}\n .e-table-rhelper.e-column-helper { width: 1px; }\n .e-table-rhelper.e-row-helper {height: 1px;}\n .e-reicon::before { border-bottom: 6px solid transparent; border-right: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block; height: 0;\n position: absolute; right: 4px; top: 4px; width: 20px; }\n .e-reicon::after { border-bottom: 6px solid transparent; border-left: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block;\n height: 0; left: 4px; position: absolute; top: 4px; width: 20px; z-index: 3; }\n .e-row-helper.e-reicon::after { top: 10px; transform: rotate(90deg); }\n .e-row-helper.e-reicon::before { left: 4px; top: -20px; transform: rotate(90deg); }\n span.e-table-box { background-color: #ffffff; border: 1px solid #BDBDBD; }\n span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }\n .e-table-rhelper { background-color: #4a90e2;}\n .e-rtl { direction: rtl; }\n .e-rte-placeholder::before { content: attr(placeholder); opacity: 0.54; overflow: hidden; padding-top: 16px; position: absolute; text-align: start; top: 0; z-index: 1; }\n li ol, li ul { margin-block-start: 10px;}\n </style>\n </head>";
|
|
17
|
+
var IFRAMEHEADER = "\n<!DOCTYPE html> \n <html>\n <head>\n <meta charset='utf-8' /> \n <style>\n @charset \"UTF-8\";\n body {\n font-family: \"Roboto\", sans-serif;\n font-size: 14px;\n }\n html, body{height: 100%;margin: 0;}\n body.e-cursor{cursor:default}\n span.e-selected-node\t{background-color: #939393;color: white;}\n span.e-selected-node.e-highlight {background-color: #1d9dd8;}\n body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}\n .e-rte-image, .e-rte-video {border: 0;cursor: pointer;display:\n block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-audio {border: 0;cursor: pointer;display:\n block;float: none;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imginline, .e-rte-audio.e-audio-inline, .e-rte-video.e-video-inline {display: inline-block;float: none;\n margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));padding: 1px;vertical-align: bottom;}\n .e-rte-image.e-imgcenter, .e-rte-video.e-video-center {cursor: pointer;display: block;float: none;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imgright, .e-rte-video.e-video-right { float: right; margin: 0 auto;margin-left: 5px;text-align: right;}\n .e-rte-image.e-imgleft, .e-rte-video.e-video-left {float: left;margin: 0 auto;margin-right: 5px;text-align: left;}\n .e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}\n .e-img-caption.e-caption-inline {display: inline-block;float: none;\n margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));\n position: relativetext-align: center;vertical-align: bottom;}\n .e-rte-img-caption.e-imgcenter {display: contents; margin-left: auto; margin-right: auto;}\n .e-rte-img-caption.e-imgright {display: contents; margin-left: auto; margin-right: 0;}\n .e-rte-img-caption.e-imgleft {display: contents;margin-left: 0;margin-right: auto;}\n .e-img-caption.e-rte-img-caption.e-imgbreak {display: contents;}\n .e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;\n margin: auto;opacity: .9;text-align: center;width: 100%;}\n .e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}\n .e-imgleft, .e-video-left {float: left;margin: 0 5px 0 0;text-align: left;}\n .e-imgright, .e-video-right {float: right;margin: 0 0 0 5px;text-align: right;}\n .e-imgcenter, .e-video-center {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}\n .e-imginline , .e-audio-inline, .e-video-inline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;\n max-width: calc(100% - (2 * 5px));vertical-align: bottom;}\n .e-imgbreak, .e-audio-break, .e-video-break {border: 0;cursor: pointer;\n display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-img-focus:not(.e-resize), .e-audio-focus:not(.e-resize), .e-video-focus:not(.e-resize) {border: solid 2px #4a90e2;}\n img.e-img-focus::selection, audio.e-audio-focus::selection, .e-video-focus::selection { background: transparent;color: transparent;}\n span.e-rte-imageboxmark, span.e-rte-videoboxmark { width: 10px; height: 10px; position: absolute; display: block;\n background: #4a90e2; border: 1px solid #fff; z-index: 1000;}\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-mob-rte span.e-rte-imageboxmark, .e-mob-rte span.e-rte-videoboxmark { background: #fff; border: 1px solid #4a90e2;\n border-radius: 15px; height: 20px; width: 20px; }\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-rte-content .e-content img.e-resize, .e-rte-content .e-content video.e-resize { z-index: 1000; }\n .e-img-caption .e-img-inner { outline: 0; }\n .e-rte-img-caption.e-imgleft .e-img-inner { float: left; text-align: left; }\n .e-rte-img-caption.e-imgright .e-img-inner { float: right; text-align: right; }\n .e-rte-img-caption.e-imgleft .e-img-wrap, .e-rte-img-caption.e-imgright .e-img-wrap { display: contents; }\n .e-img-caption a:focus-visible { outline: none; }\n .e-rte-img-caption .e-rte-image.e-imgright { margin-left: auto; margin-right: 0; }\n .e-rte-img-caption .e-rte-image.e-imgleft { margin: 0; }\n body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;\n overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}\n p{margin: 0 0 10px;margin-bottom: 10px;}\n li{margin-bottom: 10px;}\n table{margin-bottom: 10px;}\n h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}\n h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}\n h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}\n h4{font-size: 16px;font-weight: 400;line-height: 1.5;margin: 0;}\n h5{font-size: 00.8em;font-weight: 400;margin: 0;}\n h6{font-size: 00.65em;font-weight: 400;margin: 0;}\n blockquote{margin: 10px 0;margin-left: 0;padding-left: 5px;border-left: solid 2px #5c5c5c;}\n pre{background-color: inherit;border: 0;border-radius: 0;color: #333;\n font-size: inherit;line-height: inherit;margin: 0 0 10px;overflow: visible;padding: 0;\n white-space: pre-wrap;word-break: inherit;word-wrap: break-word;}\n strong, b{font-weight: 700;}\n a{text-decoration: none;user-select: auto;}\n a:hover{text-decoration: underline;};\n p:last-child, pre:last-child, blockquote:last-child{margin-bottom: 0;}\n h3+h4, h4+h5, h5+h6{margin-top: 00.6em;}\n ul:last-child{margin-bottom: 0;}\n table { border-collapse: collapse; empty-cells: show;}\n table td,table th {border: 1px solid #BDBDBD; height: 20px; padding: 2px 5px; vertical-align: middle;}\n table.e-alternate-border tbody tr:nth-child(2n) {background-color: #F5F5F5;}\n table th {background-color: #E0E0E0;}\n table.e-dashed-border td,table.e-dashed-border th { border: 1px dashed #BDBDBD} \n table .e-cell-select {border: 1px double #4a90e2;}\n span.e-table-box { cursor: nwse-resize; display: block; height: 10px; position: absolute; width: 10px; }\n span.e-table-box.e-rmob {height: 14px;width: 14px;}\n .e-row-resize, .e-column-resize { background-color: transparent; background-repeat: repeat;\n bottom: 0;cursor: col-resize;height: 1px;overflow: visible;position: absolute;width: 1px; }\n .e-row-resize { cursor: row-resize; height: 1px;}\n .e-table-rhelper { cursor: col-resize; opacity: .87;position: absolute;}\n .e-table-rhelper.e-column-helper { width: 1px; }\n .e-table-rhelper.e-row-helper {height: 1px;}\n .e-reicon::before { border-bottom: 6px solid transparent; border-right: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block; height: 0;\n position: absolute; right: 4px; top: 4px; width: 20px; }\n .e-reicon::after { border-bottom: 6px solid transparent; border-left: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block;\n height: 0; left: 4px; position: absolute; top: 4px; width: 20px; z-index: 3; }\n .e-row-helper.e-reicon::after { top: 10px; transform: rotate(90deg); }\n .e-row-helper.e-reicon::before { left: 4px; top: -20px; transform: rotate(90deg); }\n span.e-table-box { background-color: #ffffff; border: 1px solid #BDBDBD; }\n span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }\n .e-table-rhelper { background-color: #4a90e2;}\n .e-rtl { direction: rtl; }\n .e-rte-placeholder::before { content: attr(placeholder); opacity: 0.54; overflow: hidden; padding-top: 16px; position: absolute; text-align: start; top: 0; z-index: 1; }\n li ol, li ul { margin-block-start: 10px;}\n </style>\n </head>";
|
|
18
18
|
/**
|
|
19
19
|
* Content module is used to render Rich Text Editor content
|
|
20
20
|
*
|
|
@@ -5,7 +5,7 @@ import * as classes from '../base/classes';
|
|
|
5
5
|
import { Uploader, TextBox } from '@syncfusion/ej2-inputs';
|
|
6
6
|
import { Popup } from '@syncfusion/ej2-popups';
|
|
7
7
|
import { Button, CheckBox } from '@syncfusion/ej2-buttons';
|
|
8
|
-
import { RenderType,
|
|
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
11
|
import { imageResizeFactor } from '../../common/config';
|
|
@@ -1797,7 +1797,7 @@ var Image = /** @class */ (function () {
|
|
|
1797
1797
|
}
|
|
1798
1798
|
},
|
|
1799
1799
|
success: function (e) {
|
|
1800
|
-
e.
|
|
1800
|
+
e.detectImageSource = ImageInputSource.Uploaded;
|
|
1801
1801
|
_this.parent.trigger(events.imageUploadSuccess, e, function (e) {
|
|
1802
1802
|
if (!isNOU(_this.parent.insertImageSettings.path)) {
|
|
1803
1803
|
var url = _this.parent.insertImageSettings.path + e.file.name;
|
|
@@ -2243,7 +2243,7 @@ var Image = /** @class */ (function () {
|
|
|
2243
2243
|
imageElement.style.opacity = '1';
|
|
2244
2244
|
imageElement.classList.add(classes.CLS_IMG_FOCUS);
|
|
2245
2245
|
e.element = imageElement;
|
|
2246
|
-
e.
|
|
2246
|
+
e.detectImageSource = ImageInputSource.Dropped;
|
|
2247
2247
|
this.parent.trigger(events.imageUploadSuccess, e, function (e) {
|
|
2248
2248
|
if (!isNOU(_this.parent.insertImageSettings.path)) {
|
|
2249
2249
|
var url = _this.parent.insertImageSettings.path + e.file.name;
|
|
@@ -527,7 +527,10 @@ var Link = /** @class */ (function () {
|
|
|
527
527
|
this.selection.restore();
|
|
528
528
|
}
|
|
529
529
|
else {
|
|
530
|
+
var x = window.scrollX;
|
|
531
|
+
var y = window.scrollY;
|
|
530
532
|
this.selfLink.parent.contentModule.getEditPanel().focus();
|
|
533
|
+
window.scrollTo(x, y);
|
|
531
534
|
}
|
|
532
535
|
};
|
|
533
536
|
Link.prototype.onDocumentClick = function (e) {
|
|
@@ -605,8 +605,11 @@ var Table = /** @class */ (function () {
|
|
|
605
605
|
if (proxy.editdlgObj) {
|
|
606
606
|
proxy.editdlgObj.hide();
|
|
607
607
|
}
|
|
608
|
+
var x = window.scrollX;
|
|
609
|
+
var y = window.scrollY;
|
|
608
610
|
proxy.parent.formatter.process(proxy.parent, selectionObj.args, selectionObj.args.originalEvent, value);
|
|
609
611
|
proxy.contentModule.getEditPanel().focus();
|
|
612
|
+
window.scrollTo(x, y);
|
|
610
613
|
proxy.parent.on(events.mouseDown, proxy.cellSelect, proxy);
|
|
611
614
|
};
|
|
612
615
|
Table.prototype.cellSelect = function (e) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
|
2
|
+
import { TooltipEventArgs } from '@syncfusion/ej2-popups';
|
|
2
3
|
import { IRenderer, IRichTextEditor, IToolbarOptions, IDropDownModel, IColorPickerModel } from '../base/interface';
|
|
3
4
|
import { ColorPicker } from '@syncfusion/ej2-inputs';
|
|
4
5
|
import { ServiceLocator } from '../services/service-locator';
|
|
@@ -94,6 +95,7 @@ export declare class ToolbarRenderer implements IRenderer {
|
|
|
94
95
|
|
|
95
96
|
*/
|
|
96
97
|
renderColorPicker(args: IColorPickerModel, item: string): ColorPicker;
|
|
98
|
+
tooltipBeforeOpen(args: TooltipEventArgs): void;
|
|
97
99
|
/**
|
|
98
100
|
* The function is used to render Rich Text Editor toolbar
|
|
99
101
|
*
|
|
@@ -153,6 +153,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
153
153
|
openDelay: 400,
|
|
154
154
|
opensOn: 'Hover',
|
|
155
155
|
beforeRender: this.tooltipBeforeRender.bind(this),
|
|
156
|
+
beforeOpen: this.tooltipBeforeOpen.bind(this),
|
|
156
157
|
cssClass: this.parent.getCssClass(),
|
|
157
158
|
windowCollision: true,
|
|
158
159
|
position: 'BottomCenter'
|
|
@@ -275,7 +276,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
275
276
|
if ((divNode.textContent.trim() !== ''
|
|
276
277
|
&& args.element.childNodes[index].textContent.trim() === divNode.textContent.trim()) ||
|
|
277
278
|
((args.items[0].command === 'Formats' && !isNOU(toolbarStatus.formats) && _this.parent.format.types[index].value.toLowerCase() === toolbarStatus.formats.toLowerCase() && args.element.childNodes[index].classList.contains(_this.parent.format.types[index].cssClass))
|
|
278
|
-
|| (args.items[0].command === 'Font' && !isNOU(toolbarStatus.fontname) && _this.parent.fontFamily.items[index].value.toLowerCase() === toolbarStatus.fontname.toLowerCase() && args.element.childNodes[index].classList.contains(_this.parent.fontFamily.items[index].cssClass)))) {
|
|
279
|
+
|| (args.items[0].subCommand === 'FontName' && args.items[0].command === 'Font' && !isNOU(toolbarStatus.fontname) && !isNOU(_this.parent.fontFamily.items[index]) && _this.parent.fontFamily.items[index].value.toLowerCase() === toolbarStatus.fontname.toLowerCase() && args.element.childNodes[index].classList.contains(_this.parent.fontFamily.items[index].cssClass)))) {
|
|
279
280
|
if (!args.element.childNodes[index].classList.contains('e-active')) {
|
|
280
281
|
addClass([args.element.childNodes[index]], 'e-active');
|
|
281
282
|
}
|
|
@@ -661,6 +662,11 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
661
662
|
colorPicker.appendTo(document.getElementById(args.target));
|
|
662
663
|
return colorPicker;
|
|
663
664
|
};
|
|
665
|
+
ToolbarRenderer.prototype.tooltipBeforeOpen = function (args) {
|
|
666
|
+
if (args.element) {
|
|
667
|
+
args.element.setAttribute('data-rte-id', this.parent.getID());
|
|
668
|
+
}
|
|
669
|
+
};
|
|
664
670
|
/**
|
|
665
671
|
* The function is used to render Rich Text Editor toolbar
|
|
666
672
|
*
|
|
@@ -896,6 +896,10 @@
|
|
|
896
896
|
margin-left: 0;
|
|
897
897
|
padding-left: 5px;
|
|
898
898
|
}
|
|
899
|
+
.e-richtexteditor .e-rte-content .e-content table,
|
|
900
|
+
.e-richtexteditor .e-source-content .e-content table {
|
|
901
|
+
margin-bottom: 10px;
|
|
902
|
+
}
|
|
899
903
|
.e-richtexteditor .e-rte-content .e-content pre,
|
|
900
904
|
.e-richtexteditor .e-source-content .e-content pre {
|
|
901
905
|
background-color: inherit;
|