@syncfusion/ej2-richtexteditor 24.2.7 → 24.2.8
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 +12 -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 +294 -147
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +295 -146
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +7 -7
- package/src/editor-manager/plugin/dom-node.js +3 -1
- package/src/editor-manager/plugin/format-painter-actions.d.ts +1 -0
- package/src/editor-manager/plugin/format-painter-actions.js +18 -0
- package/src/editor-manager/plugin/lists.js +79 -70
- package/src/rich-text-editor/actions/base-quick-toolbar.js +2 -2
- package/src/rich-text-editor/actions/color-picker.d.ts +1 -0
- package/src/rich-text-editor/actions/color-picker.js +10 -0
- package/src/rich-text-editor/actions/toolbar.js +3 -0
- package/src/rich-text-editor/base/constant.d.ts +5 -0
- package/src/rich-text-editor/base/constant.js +5 -0
- package/src/rich-text-editor/base/rich-text-editor.js +21 -5
- package/src/rich-text-editor/models/default-locale.js +1 -1
- package/src/rich-text-editor/renderer/dialog-renderer.js +5 -1
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
- package/src/rich-text-editor/renderer/image-module.js +28 -7
- package/src/rich-text-editor/renderer/table-module.d.ts +3 -1
- package/src/rich-text-editor/renderer/table-module.js +111 -50
- package/src/rich-text-editor/renderer/toolbar-renderer.js +13 -13
- package/styles/bootstrap-dark.css +32 -13
- package/styles/bootstrap.css +36 -20
- package/styles/bootstrap4.css +18 -3
- package/styles/bootstrap5-dark.css +22 -9
- package/styles/bootstrap5.css +22 -9
- package/styles/fabric-dark.css +18 -3
- package/styles/fabric.css +18 -3
- package/styles/fluent-dark.css +24 -3
- package/styles/fluent.css +24 -3
- package/styles/highcontrast-light.css +18 -3
- package/styles/highcontrast.css +21 -3
- package/styles/material-dark.css +22 -3
- package/styles/material.css +22 -3
- package/styles/material3-dark.css +19 -4
- package/styles/material3.css +19 -4
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +8 -8
- package/styles/rich-text-editor/_bootstrap-definition.scss +14 -14
- package/styles/rich-text-editor/_layout.scss +11 -0
- package/styles/rich-text-editor/_material3-definition.scss +1 -1
- package/styles/rich-text-editor/_theme.scss +47 -13
- package/styles/rich-text-editor/bootstrap-dark.css +32 -13
- package/styles/rich-text-editor/bootstrap.css +36 -20
- package/styles/rich-text-editor/bootstrap4.css +18 -3
- package/styles/rich-text-editor/bootstrap5-dark.css +22 -9
- package/styles/rich-text-editor/bootstrap5.css +22 -9
- package/styles/rich-text-editor/fabric-dark.css +18 -3
- package/styles/rich-text-editor/fabric.css +18 -3
- package/styles/rich-text-editor/fluent-dark.css +24 -3
- package/styles/rich-text-editor/fluent.css +24 -3
- package/styles/rich-text-editor/highcontrast-light.css +18 -3
- package/styles/rich-text-editor/highcontrast.css +21 -3
- package/styles/rich-text-editor/material-dark.css +22 -3
- package/styles/rich-text-editor/material.css +22 -3
- package/styles/rich-text-editor/material3-dark.css +19 -4
- package/styles/rich-text-editor/material3.css +19 -4
- package/styles/rich-text-editor/tailwind-dark.css +30 -3
- package/styles/rich-text-editor/tailwind.css +30 -3
- package/styles/tailwind-dark.css +30 -3
- package/styles/tailwind.css +30 -3
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -41
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -27
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 24.2.
|
|
3
|
+
* version : 24.2.8
|
|
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@24.2.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@24.2.7",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-LAwzVB7DsDIemywqqLxTjUPWekzjmy1o9UDLYXMT+MHewJcUqD6wVlupgs4/Tej+ZAE275Bt25VKHA/Zl06IMg==",
|
|
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-24.2.
|
|
29
|
-
"_shasum": "
|
|
28
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-24.2.7.tgz",
|
|
29
|
+
"_shasum": "4baefba0381f2363ff721f0972d9319c4edf05ab",
|
|
30
30
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
31
31
|
"_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
|
|
32
32
|
"author": {
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"@syncfusion/ej2-buttons": "~24.2.7",
|
|
42
42
|
"@syncfusion/ej2-filemanager": "~24.2.7",
|
|
43
43
|
"@syncfusion/ej2-inputs": "~24.2.7",
|
|
44
|
-
"@syncfusion/ej2-navigations": "~24.2.
|
|
45
|
-
"@syncfusion/ej2-popups": "~24.2.
|
|
44
|
+
"@syncfusion/ej2-navigations": "~24.2.8",
|
|
45
|
+
"@syncfusion/ej2-popups": "~24.2.8",
|
|
46
46
|
"@syncfusion/ej2-splitbuttons": "~24.2.7"
|
|
47
47
|
},
|
|
48
48
|
"deprecated": false,
|
|
@@ -69,6 +69,6 @@
|
|
|
69
69
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
70
70
|
},
|
|
71
71
|
"typings": "index.d.ts",
|
|
72
|
-
"version": "24.2.
|
|
72
|
+
"version": "24.2.8",
|
|
73
73
|
"sideEffects": false
|
|
74
74
|
}
|
|
@@ -490,9 +490,11 @@ var DOMNode = /** @class */ (function () {
|
|
|
490
490
|
var range = save.range;
|
|
491
491
|
var startChildNodes = range.startContainer.childNodes;
|
|
492
492
|
var isTableStart = startChildNodes.length > 1 && startChildNodes[0].nodeName === 'TABLE';
|
|
493
|
+
var isImgOnlySelected = startChildNodes.length > 1 && startChildNodes[0].nodeName === 'IMAGE' &&
|
|
494
|
+
range.endOffset === 1 && range.endContainer.nodeName === '#text' && range.endContainer.textContent.length === 0;
|
|
493
495
|
var start = ((isTableStart ? getLastTextNode(startChildNodes[range.startOffset + 1]) :
|
|
494
496
|
startChildNodes[(range.startOffset > 0) ? (range.startOffset - 1) : range.startOffset]) || range.startContainer);
|
|
495
|
-
var end = (range.endContainer.childNodes[(range.endOffset > 0) ? (range.endOffset - 1) : range.endOffset]
|
|
497
|
+
var end = (range.endContainer.childNodes[(range.endOffset > 0) ? (isImgOnlySelected ? range.endOffset : (range.endOffset - 1)) : range.endOffset]
|
|
496
498
|
|| range.endContainer);
|
|
497
499
|
if ((start.nodeType === Node.ELEMENT_NODE && end.nodeType === Node.ELEMENT_NODE) && (start.contains(end) || end.contains(start))) {
|
|
498
500
|
var existNode = start.contains(end) ? start : end;
|
|
@@ -35,6 +35,7 @@ export declare class FormatPainterActions implements IFormatPainterEditor {
|
|
|
35
35
|
private validateELementTag;
|
|
36
36
|
private findCurrentContext;
|
|
37
37
|
private insertFormatNode;
|
|
38
|
+
private isListCopied;
|
|
38
39
|
private insertBlockNode;
|
|
39
40
|
private insertNewList;
|
|
40
41
|
private insertSameList;
|
|
@@ -363,6 +363,14 @@ var FormatPainterActions = /** @class */ (function () {
|
|
|
363
363
|
var range = this.parent.nodeSelection.getRange(docElement);
|
|
364
364
|
var isCollapsed = range.collapsed;
|
|
365
365
|
var blockNodes = this.parent.domNode.blockNodes();
|
|
366
|
+
var isListCopied = this.isListCopied();
|
|
367
|
+
if (isListCopied) {
|
|
368
|
+
for (var i = 0; i < blockNodes.length; i++) {
|
|
369
|
+
if (closest(blockNodes[i], 'li')) {
|
|
370
|
+
blockNodes[i] = closest(blockNodes[i], 'li');
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
366
374
|
var isFullNodeSelected = false;
|
|
367
375
|
if (blockNodes.length === 1) {
|
|
368
376
|
isFullNodeSelected = blockNodes[0].textContent.trim() === range.toString().trim();
|
|
@@ -371,6 +379,16 @@ var FormatPainterActions = /** @class */ (function () {
|
|
|
371
379
|
this.insertBlockNode(clonedElem, range, docElement, blockNodes);
|
|
372
380
|
}
|
|
373
381
|
};
|
|
382
|
+
FormatPainterActions.prototype.isListCopied = function () {
|
|
383
|
+
var isListCopied = false;
|
|
384
|
+
for (var i = 0; i < this.copyCollection.length; i++) {
|
|
385
|
+
if (this.copyCollection[i].tagName === 'OL' || this.copyCollection[i].tagName === 'UL') {
|
|
386
|
+
isListCopied = true;
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return isListCopied;
|
|
391
|
+
};
|
|
374
392
|
FormatPainterActions.prototype.insertBlockNode = function (element, range, docElement, nodes) {
|
|
375
393
|
var domSelection = this.parent.nodeSelection;
|
|
376
394
|
var saveSelection = domSelection.save(range, docElement);
|
|
@@ -72,14 +72,21 @@ var Lists = /** @class */ (function () {
|
|
|
72
72
|
var preElementOLTest = this.testList(preElement);
|
|
73
73
|
var nextElementOLTest = this.testList(nextElement);
|
|
74
74
|
if (!preElementOLTest && !nextElementOLTest && preElemULStart !== '*' && nextElemULStart !== '*') {
|
|
75
|
+
var brElement = createElement('br');
|
|
75
76
|
if (startElementOLTest) {
|
|
76
77
|
range.startContainer.textContent = range.startContainer.textContent.slice(range.startOffset, range.startContainer.textContent.length);
|
|
78
|
+
if (range.startContainer.nodeName === '#text' && range.startContainer.textContent.length === 0) {
|
|
79
|
+
this.parent.domNode.insertAfter(brElement, range.startContainer);
|
|
80
|
+
}
|
|
77
81
|
this.applyListsHandler({ subCommand: 'OL', callBack: e.callBack });
|
|
78
82
|
e.event.preventDefault();
|
|
79
83
|
}
|
|
80
84
|
else if (range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim() === '*' ||
|
|
81
85
|
range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim() === '-') {
|
|
82
86
|
range.startContainer.textContent = range.startContainer.textContent.slice(range.startOffset, range.startContainer.textContent.length);
|
|
87
|
+
if (range.startContainer.nodeName === '#text' && range.startContainer.textContent.length === 0) {
|
|
88
|
+
this.parent.domNode.insertAfter(brElement, range.startContainer);
|
|
89
|
+
}
|
|
83
90
|
this.applyListsHandler({ subCommand: 'UL', callBack: e.callBack });
|
|
84
91
|
e.event.preventDefault();
|
|
85
92
|
}
|
|
@@ -190,11 +197,11 @@ var Lists = /** @class */ (function () {
|
|
|
190
197
|
};
|
|
191
198
|
Lists.prototype.removeList = function (range, e) {
|
|
192
199
|
var startNode = this.parent.domNode.getSelectedNode(range.startContainer, range.startOffset);
|
|
193
|
-
var endNode = this.parent.domNode.getSelectedNode(range.endContainer, range.endOffset);
|
|
200
|
+
var endNode = (!isNOU(range.endContainer.parentElement.closest('li')) && range.endContainer.parentElement.closest('li').childElementCount > 1 && range.endContainer.nodeName === '#text') ? range.endContainer : this.parent.domNode.getSelectedNode(range.endContainer, range.endOffset);
|
|
194
201
|
startNode = startNode.nodeName === 'BR' ? startNode.parentElement : startNode;
|
|
195
202
|
endNode = endNode.nodeName === 'BR' ? endNode.parentElement : endNode;
|
|
196
203
|
startNode = startNode.nodeName !== 'LI' && !isNOU(startNode.closest('LI')) ? startNode.closest('LI') : startNode;
|
|
197
|
-
endNode = endNode.nodeName !== 'LI' && !isNOU(endNode.closest('LI')) ? endNode.closest('LI') : endNode;
|
|
204
|
+
endNode = endNode.nodeName !== 'LI' && endNode.nodeName !== '#text' && !isNOU(endNode.closest('LI')) ? endNode.closest('LI') : endNode;
|
|
198
205
|
if (((range.commonAncestorContainer.nodeName === 'OL' || range.commonAncestorContainer.nodeName === 'UL' || range.commonAncestorContainer.nodeName === 'LI') &&
|
|
199
206
|
isNOU(endNode.nextElementSibling) && endNode.textContent.length === range.endOffset &&
|
|
200
207
|
isNOU(startNode.previousElementSibling) && range.startOffset === 0) ||
|
|
@@ -600,7 +607,7 @@ var Lists = /** @class */ (function () {
|
|
|
600
607
|
};
|
|
601
608
|
Lists.prototype.applyLists = function (elements, type, selector, item, e) {
|
|
602
609
|
var isReverse = true;
|
|
603
|
-
if (this.isRevert(elements, type, item) && isNOU(item)) {
|
|
610
|
+
if (this.isRevert(elements, type, item) && isNOU(item) || (!isNOU(item) && item.listStyle === 'none')) {
|
|
604
611
|
this.revertList(elements, e);
|
|
605
612
|
this.removeEmptyListElements();
|
|
606
613
|
}
|
|
@@ -790,82 +797,84 @@ var Lists = /** @class */ (function () {
|
|
|
790
797
|
var viewNode = [];
|
|
791
798
|
for (var i = 0; i < elements.length; i++) {
|
|
792
799
|
var element = elements[i];
|
|
793
|
-
if (
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
800
|
+
if ((isNullOrUndefined(e.item)) || ((element.nodeName === 'LI' && e.item.listStyle === 'none'))) {
|
|
801
|
+
if (this.domNode.contents(element)[0].nodeType === 3 && this.domNode.contents(element)[0].textContent.trim().length === 0) {
|
|
802
|
+
detach(this.domNode.contents(element)[0]);
|
|
803
|
+
}
|
|
804
|
+
var parentNode = elements[i].parentNode;
|
|
805
|
+
var className = element.getAttribute('class');
|
|
806
|
+
if (temp.length === 0) {
|
|
807
|
+
var siblingList = elements[i].querySelectorAll('ul, ol');
|
|
808
|
+
var firstNode = siblingList[0];
|
|
809
|
+
if (firstNode) {
|
|
810
|
+
var child = firstNode
|
|
811
|
+
.querySelectorAll('li');
|
|
812
|
+
if (child) {
|
|
813
|
+
var nestedElement = createElement(firstNode.tagName);
|
|
814
|
+
append([nestedElement], firstNode.parentNode);
|
|
815
|
+
var nestedElementLI = createElement('li', { styles: 'list-style-type: none;' });
|
|
816
|
+
append([nestedElementLI], nestedElement);
|
|
817
|
+
append([firstNode], nestedElementLI);
|
|
818
|
+
}
|
|
810
819
|
}
|
|
811
820
|
}
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
classAttr += ' class="' + className + '"';
|
|
823
|
-
}
|
|
824
|
-
if (CONSTANT.DEFAULT_TAG && 0 === element.querySelectorAll(CONSTANT.BLOCK_TAGS.join(', ')).length) {
|
|
825
|
-
var wrapperclass = isNullOrUndefined(className) ? ' class="e-rte-wrap-inner"' :
|
|
826
|
-
' class="' + className + ' e-rte-wrap-inner"';
|
|
827
|
-
var parentElement = parentNode;
|
|
828
|
-
if (!isNOU(parentElement.style.listStyleType)) {
|
|
829
|
-
parentNode.style.removeProperty("list-style-type");
|
|
821
|
+
if (element.parentNode.insertBefore(this.closeTag(parentNode.tagName), element),
|
|
822
|
+
'LI' === parentNode.parentNode.tagName || 'OL' === parentNode.parentNode.tagName ||
|
|
823
|
+
'UL' === parentNode.parentNode.tagName) {
|
|
824
|
+
element.parentNode.insertBefore(this.closeTag('LI'), element);
|
|
825
|
+
}
|
|
826
|
+
else {
|
|
827
|
+
var classAttr = '';
|
|
828
|
+
if (className) {
|
|
829
|
+
// eslint-disable-next-line
|
|
830
|
+
classAttr += ' class="' + className + '"';
|
|
830
831
|
}
|
|
831
|
-
if (
|
|
832
|
-
|
|
832
|
+
if (CONSTANT.DEFAULT_TAG && 0 === element.querySelectorAll(CONSTANT.BLOCK_TAGS.join(', ')).length) {
|
|
833
|
+
var wrapperclass = isNullOrUndefined(className) ? ' class="e-rte-wrap-inner"' :
|
|
834
|
+
' class="' + className + ' e-rte-wrap-inner"';
|
|
835
|
+
var parentElement = parentNode;
|
|
836
|
+
if (!isNOU(parentElement.style.listStyleType)) {
|
|
837
|
+
parentNode.style.removeProperty("list-style-type");
|
|
838
|
+
}
|
|
839
|
+
if (!isNOU(parentElement.style.listStyleImage)) {
|
|
840
|
+
parentNode.style.removeProperty("list-style-image");
|
|
841
|
+
}
|
|
842
|
+
if (parentElement.style.length === 0) {
|
|
843
|
+
parentNode.removeAttribute("style");
|
|
844
|
+
}
|
|
845
|
+
var wrapper = '<' + CONSTANT.DEFAULT_TAG + wrapperclass +
|
|
846
|
+
this.domNode.attributes(parentElement) + '></' + CONSTANT.DEFAULT_TAG + '>';
|
|
847
|
+
if (e.enterAction !== 'BR') {
|
|
848
|
+
this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapper));
|
|
849
|
+
}
|
|
833
850
|
}
|
|
834
|
-
if (
|
|
835
|
-
parentNode.
|
|
851
|
+
else if (this.domNode.contents(element)[0].nodeType === 3) {
|
|
852
|
+
var replace = this.domNode.createTagString(CONSTANT.DEFAULT_TAG, parentNode, this.parent.domNode.encode(this.domNode.contents(element)[0].textContent));
|
|
853
|
+
this.domNode.replaceWith(this.domNode.contents(element)[0], replace);
|
|
836
854
|
}
|
|
837
|
-
|
|
838
|
-
this.domNode.
|
|
839
|
-
|
|
840
|
-
this.domNode.
|
|
855
|
+
else if (this.domNode.contents(element)[0].classList.contains(markerClassName.startSelection) ||
|
|
856
|
+
this.domNode.contents(element)[0].classList.contains(markerClassName.endSelection)) {
|
|
857
|
+
var replace = this.domNode.createTagString(CONSTANT.DEFAULT_TAG, parentNode, this.domNode.contents(element)[0].outerHTML);
|
|
858
|
+
this.domNode.replaceWith(this.domNode.contents(element)[0], replace);
|
|
841
859
|
}
|
|
860
|
+
else {
|
|
861
|
+
var childNode = element.firstChild;
|
|
862
|
+
className = childNode.getAttribute('class');
|
|
863
|
+
attributes(childNode, this.domNode.rawAttributes(parentNode));
|
|
864
|
+
if (className && childNode.getAttribute('class')) {
|
|
865
|
+
attributes(childNode, { 'class': className + ' ' + childNode.getAttribute('class') });
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
append([this.openTag('LI')], element);
|
|
869
|
+
prepend([this.closeTag('LI')], element);
|
|
842
870
|
}
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
}
|
|
847
|
-
else if (this.domNode.contents(element)[0].classList.contains(markerClassName.startSelection) ||
|
|
848
|
-
this.domNode.contents(element)[0].classList.contains(markerClassName.endSelection)) {
|
|
849
|
-
var replace = this.domNode.createTagString(CONSTANT.DEFAULT_TAG, parentNode, this.domNode.contents(element)[0].outerHTML);
|
|
850
|
-
this.domNode.replaceWith(this.domNode.contents(element)[0], replace);
|
|
871
|
+
this.domNode.insertAfter(this.openTag(parentNode.tagName), element);
|
|
872
|
+
if (parentNode.parentNode.tagName === 'LI') {
|
|
873
|
+
parentNode = parentNode.parentNode.parentNode;
|
|
851
874
|
}
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
className = childNode.getAttribute('class');
|
|
855
|
-
attributes(childNode, this.domNode.rawAttributes(parentNode));
|
|
856
|
-
if (className && childNode.getAttribute('class')) {
|
|
857
|
-
attributes(childNode, { 'class': className + ' ' + childNode.getAttribute('class') });
|
|
858
|
-
}
|
|
875
|
+
if (viewNode.indexOf(parentNode) < 0) {
|
|
876
|
+
viewNode.push(parentNode);
|
|
859
877
|
}
|
|
860
|
-
append([this.openTag('LI')], element);
|
|
861
|
-
prepend([this.closeTag('LI')], element);
|
|
862
|
-
}
|
|
863
|
-
this.domNode.insertAfter(this.openTag(parentNode.tagName), element);
|
|
864
|
-
if (parentNode.parentNode.tagName === 'LI') {
|
|
865
|
-
parentNode = parentNode.parentNode.parentNode;
|
|
866
|
-
}
|
|
867
|
-
if (viewNode.indexOf(parentNode) < 0) {
|
|
868
|
-
viewNode.push(parentNode);
|
|
869
878
|
}
|
|
870
879
|
}
|
|
871
880
|
for (var i = 0; i < viewNode.length; i++) {
|
|
@@ -264,9 +264,9 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
264
264
|
parentData: parent_1.getBoundingClientRect(),
|
|
265
265
|
tBarElementHeight: tBarHeight
|
|
266
266
|
};
|
|
267
|
-
if (target.tagName === 'IMG' || target.tagName === 'AUDIO' || target.tagName === 'VIDEO' || target.tagName === 'IFRAME' || (target.classList &&
|
|
267
|
+
if ((target.tagName === 'IMG' || target.tagName === 'AUDIO' || target.tagName === 'VIDEO' || target.tagName === 'IFRAME' || (target.classList &&
|
|
268
268
|
(target.classList.contains(classes.CLS_AUDIOWRAP) || target.classList.contains(classes.CLS_CLICKELEM) ||
|
|
269
|
-
target.classList.contains(classes.CLS_VID_CLICK_ELEM)))) {
|
|
269
|
+
target.classList.contains(classes.CLS_VID_CLICK_ELEM)))) && (x == beforeQuickToolbarArgs.positionX || y == beforeQuickToolbarArgs.positionY)) {
|
|
270
270
|
_this.setPosition(showPopupData);
|
|
271
271
|
}
|
|
272
272
|
if (!_this.parent.inlineMode.enable) {
|
|
@@ -170,6 +170,15 @@ var ColorPickerInput = /** @class */ (function () {
|
|
|
170
170
|
this.parent.on(events.destroyColorPicker, this.destroyColorPicker, this);
|
|
171
171
|
this.parent.on(events.modelChanged, this.onPropertyChanged, this);
|
|
172
172
|
this.parent.on(events.bindCssClass, this.setCssClass, this);
|
|
173
|
+
this.parent.on(events.showColorPicker, this.showColorPicker, this);
|
|
174
|
+
};
|
|
175
|
+
ColorPickerInput.prototype.showColorPicker = function (e) {
|
|
176
|
+
if (!isNullOrUndefined(this.fontColorPicker) && (e.toolbarClick === "fontcolor")) {
|
|
177
|
+
this.fontColorDropDown.toggle();
|
|
178
|
+
}
|
|
179
|
+
else if (!isNullOrUndefined(this.backgroundColorPicker) && (e.toolbarClick === "backgroundcolor")) {
|
|
180
|
+
this.backgroundColorDropDown.toggle();
|
|
181
|
+
}
|
|
173
182
|
};
|
|
174
183
|
ColorPickerInput.prototype.onPropertyChanged = function (model) {
|
|
175
184
|
var newProp = model.newProp;
|
|
@@ -243,6 +252,7 @@ var ColorPickerInput = /** @class */ (function () {
|
|
|
243
252
|
this.parent.off(events.destroyColorPicker, this.destroyColorPicker);
|
|
244
253
|
this.parent.off(events.modelChanged, this.onPropertyChanged);
|
|
245
254
|
this.parent.off(events.bindCssClass, this.setCssClass);
|
|
255
|
+
this.parent.off(events.showColorPicker, this.showColorPicker);
|
|
246
256
|
};
|
|
247
257
|
return ColorPickerInput;
|
|
248
258
|
}());
|
|
@@ -56,6 +56,9 @@ var Toolbar = /** @class */ (function () {
|
|
|
56
56
|
if (e.target.classList.contains('e-hor-nav')) {
|
|
57
57
|
this.adjustContentHeight(e.target, true);
|
|
58
58
|
}
|
|
59
|
+
if (!isNullOrUndefined(e.target) && (e.target.classList.contains("e-rte-fontcolor-dropdown") || e.target.classList.contains("e-rte-backgroundcolor-dropdown"))) {
|
|
60
|
+
this.parent.notify(events.showColorPicker, { toolbarClick: e.target.classList.contains("e-rte-fontcolor-dropdown") ? "fontcolor" : "backgroundcolor" });
|
|
61
|
+
}
|
|
59
62
|
}
|
|
60
63
|
};
|
|
61
64
|
Toolbar.prototype.createToolbarElement = function () {
|
|
@@ -759,6 +759,11 @@ export var documentClickClosedBy = 'documentClickClosedBy';
|
|
|
759
759
|
/**
|
|
760
760
|
* @hidden
|
|
761
761
|
|
|
762
|
+
*/
|
|
763
|
+
export var showColorPicker = 'showColorPicker';
|
|
764
|
+
/**
|
|
765
|
+
* @hidden
|
|
766
|
+
|
|
762
767
|
*/
|
|
763
768
|
export var blockEmptyNodes = "address:empty, article:empty, aside:empty, blockquote:empty,\n details:empty, dd:empty, div:empty, dl:empty, dt:empty, fieldset:empty, footer:empty,form:empty, h1:empty,\n h2:empty, h3:empty, h4:empty, h5:empty, h6:empty, header:empty, hgroup:empty, li:empty, main:empty, nav:empty,\n noscript:empty, output:empty, p:empty, pre:empty, section:empty, td:empty, th:empty";
|
|
764
769
|
/**
|
|
@@ -911,11 +911,14 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
911
911
|
clientX: touch.clientX, clientY: touch.clientY }
|
|
912
912
|
});
|
|
913
913
|
if (this.inputElement && ((this.editorMode === 'HTML' && this.inputElement.textContent.length !== 0) ||
|
|
914
|
-
(this.editorMode === 'Markdown' && this.inputElement.value.length !== 0)) ||
|
|
915
|
-
|
|
916
|
-
(e.target.
|
|
917
|
-
e.target.
|
|
918
|
-
e.target.
|
|
914
|
+
(this.editorMode === 'Markdown' && this.inputElement.value.length !== 0)) ||
|
|
915
|
+
(e.target && !isNOU(closest(e.target, 'table'))) ||
|
|
916
|
+
(e.target && (e.target.nodeName === 'VIDEO' ||
|
|
917
|
+
e.target.querySelectorAll('.' + classes.CLS_VIDEOWRAP).length > 0) ||
|
|
918
|
+
(e.target && e.target.nodeName !== 'BR' &&
|
|
919
|
+
(e.target.classList.contains(classes.CLS_AUDIOWRAP) ||
|
|
920
|
+
e.target.classList.contains(classes.CLS_CLICKELEM) ||
|
|
921
|
+
e.target.classList.contains(classes.CLS_VID_CLICK_ELEM))))) {
|
|
919
922
|
this.notify(events.toolbarRefresh, { args: e });
|
|
920
923
|
}
|
|
921
924
|
this.triggerEditArea(e);
|
|
@@ -1799,6 +1802,13 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1799
1802
|
var imgPadding = 12;
|
|
1800
1803
|
var imgResizeBorder = 2;
|
|
1801
1804
|
var editEle = this.contentModule.getEditPanel();
|
|
1805
|
+
if (this.editorMode === "HTML" && !isNOU(this.formatter.editorManager.nodeSelection) && !isNOU(this.formatter.editorManager.nodeSelection.range)) {
|
|
1806
|
+
var currentRange = this.formatter.editorManager.nodeSelection.range;
|
|
1807
|
+
if (currentRange.startContainer.nodeType !== 3 && currentRange.startContainer.closest &&
|
|
1808
|
+
!isNOU(currentRange.startContainer.closest('TD'))) {
|
|
1809
|
+
editEle = currentRange.startContainer;
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1802
1812
|
var eleStyle = window.getComputedStyle(editEle);
|
|
1803
1813
|
var editEleMaxWidth = editEle.offsetWidth - (imgPadding + imgResizeBorder +
|
|
1804
1814
|
parseFloat(eleStyle.paddingLeft.split('px')[0]) + parseFloat(eleStyle.paddingRight.split('px')[0]) +
|
|
@@ -2242,6 +2252,12 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2242
2252
|
var trg = e.relatedTarget;
|
|
2243
2253
|
if (trg) {
|
|
2244
2254
|
var rteElement = closest(trg, '.' + classes.CLS_RTE);
|
|
2255
|
+
if (!rteElement && this.iframeSettings.enable) {
|
|
2256
|
+
var iframeElement = this.element.querySelector('#' + this.getID() + '_rte-view');
|
|
2257
|
+
if (iframeElement && iframeElement.contentWindow.document.body.contains(trg)) {
|
|
2258
|
+
rteElement = closest(iframeElement, '.' + classes.CLS_RTE);
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2245
2261
|
if (rteElement && rteElement === this.element) {
|
|
2246
2262
|
this.isBlur = false;
|
|
2247
2263
|
if (trg === this.getToolbarElement()) {
|
|
@@ -94,7 +94,7 @@ export var defaultLocale = {
|
|
|
94
94
|
'browse': 'Browse',
|
|
95
95
|
'imageUrl': 'http://example.com/image.png',
|
|
96
96
|
'audioUrl': 'http://example.com/audio.mp3',
|
|
97
|
-
'videoUrl': 'http://example.com/video.
|
|
97
|
+
'videoUrl': 'http://example.com/video.mp4',
|
|
98
98
|
'webUrl': 'Web URL',
|
|
99
99
|
'embedUrl': 'Embed Code',
|
|
100
100
|
'imageCaption': 'Caption',
|
|
@@ -37,7 +37,11 @@ var DialogRenderer = /** @class */ (function () {
|
|
|
37
37
|
var dlgObj;
|
|
38
38
|
e.beforeOpen = this.beforeOpen.bind(this);
|
|
39
39
|
e.open = this.open.bind(this);
|
|
40
|
-
e.position = {
|
|
40
|
+
e.position = {
|
|
41
|
+
X: 'center',
|
|
42
|
+
Y: (e.target !== 'string' && e.target.nodeName === 'BODY' &&
|
|
43
|
+
!isNOU(e.position)) ? e.position.Y : this.getDialogPosition()
|
|
44
|
+
};
|
|
41
45
|
if (isNOU(e.close)) {
|
|
42
46
|
e.close = this.close.bind(this);
|
|
43
47
|
}
|
|
@@ -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;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-img-caption a:focus-visible { outline: none; }\n .e-img-caption .e-rte-image.e-imgright, .e-img-caption .e-rte-image.e-imgleft { float: none; 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 </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-img-caption a:focus-visible { outline: none; }\n .e-img-caption .e-rte-image.e-imgright, .e-img-caption .e-rte-image.e-imgleft { float: none; 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 </style>\n </head>";
|
|
18
18
|
/**
|
|
19
19
|
* Content module is used to render Rich Text Editor content
|
|
20
20
|
*
|
|
@@ -234,6 +234,7 @@ var Image = /** @class */ (function () {
|
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
|
+
EventHandler.add(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing, this);
|
|
237
238
|
EventHandler.add(this.contentModule.getDocument(), Browser.touchEndEvent, this.resizeEnd, this);
|
|
238
239
|
}
|
|
239
240
|
};
|
|
@@ -285,7 +286,6 @@ var Image = /** @class */ (function () {
|
|
|
285
286
|
this.imgResizePos(e, this.imgResizeDiv);
|
|
286
287
|
this.resizeImgDupPos(e);
|
|
287
288
|
this.contentModule.getEditPanel().appendChild(this.imgResizeDiv);
|
|
288
|
-
EventHandler.add(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing, this);
|
|
289
289
|
};
|
|
290
290
|
Image.prototype.getPointX = function (e) {
|
|
291
291
|
if (e.touches && e.touches.length) {
|
|
@@ -644,7 +644,9 @@ var Image = /** @class */ (function () {
|
|
|
644
644
|
}
|
|
645
645
|
}
|
|
646
646
|
if (originalEvent.ctrlKey && (originalEvent.keyCode === 89 || originalEvent.keyCode === 90)) {
|
|
647
|
-
|
|
647
|
+
if (this.parent.editorMode !== 'Markdown') {
|
|
648
|
+
this.undoStack({ subCommand: (originalEvent.keyCode === 90 ? 'undo' : 'redo') });
|
|
649
|
+
}
|
|
648
650
|
}
|
|
649
651
|
if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
|
|
650
652
|
if (selectNodeEle && selectNodeEle[0].nodeName === 'IMG' && selectNodeEle.length < 1) {
|
|
@@ -1169,7 +1171,29 @@ var Image = /** @class */ (function () {
|
|
|
1169
1171
|
if (this.parent.formatter.getUndoRedoStack().length === 0) {
|
|
1170
1172
|
this.parent.formatter.saveData();
|
|
1171
1173
|
}
|
|
1172
|
-
e.selection.
|
|
1174
|
+
var restoreStartElement = e.selection.range.startContainer;
|
|
1175
|
+
if (e.selection.range.startContainer.nodeName === 'SPAN' &&
|
|
1176
|
+
restoreStartElement.classList.contains('e-img-wrap') &&
|
|
1177
|
+
restoreStartElement.parentElement.classList.contains('e-img-caption')) {
|
|
1178
|
+
restoreStartElement = restoreStartElement.parentElement;
|
|
1179
|
+
if (!isNOU(restoreStartElement.previousSibling)) {
|
|
1180
|
+
var lastNode = restoreStartElement.previousSibling;
|
|
1181
|
+
while (lastNode.nodeName !== '#text' && lastNode.nodeName !== 'BR') {
|
|
1182
|
+
lastNode = lastNode.lastChild;
|
|
1183
|
+
}
|
|
1184
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), lastNode, lastNode.nodeName !== 'BR' ? lastNode.textContent.length : 0);
|
|
1185
|
+
}
|
|
1186
|
+
else if (!isNOU(restoreStartElement.nextSibling)) {
|
|
1187
|
+
var firstNode = restoreStartElement.nextSibling;
|
|
1188
|
+
while (firstNode.nodeName !== '#text' && firstNode.nodeName !== 'BR') {
|
|
1189
|
+
firstNode = firstNode.firstChild;
|
|
1190
|
+
}
|
|
1191
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), firstNode, 0);
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
else {
|
|
1195
|
+
e.selection.restore();
|
|
1196
|
+
}
|
|
1173
1197
|
if (this.contentModule.getEditPanel().querySelector('.e-img-resize')) {
|
|
1174
1198
|
this.removeResizeEle();
|
|
1175
1199
|
}
|
|
@@ -1383,7 +1407,7 @@ var Image = /** @class */ (function () {
|
|
|
1383
1407
|
animationSettings: { effect: 'None' },
|
|
1384
1408
|
close: function (event) {
|
|
1385
1409
|
if (_this.isImgUploaded) {
|
|
1386
|
-
_this.uploadObj.
|
|
1410
|
+
_this.uploadObj.remove();
|
|
1387
1411
|
}
|
|
1388
1412
|
_this.parent.isBlur = false;
|
|
1389
1413
|
if (event && event.event.returnValue) {
|
|
@@ -1451,9 +1475,6 @@ var Image = /** @class */ (function () {
|
|
|
1451
1475
|
Image.prototype.cancelDialog = function (e) {
|
|
1452
1476
|
this.parent.isBlur = false;
|
|
1453
1477
|
this.dialogObj.hide({ returnValue: true });
|
|
1454
|
-
if (this.isImgUploaded) {
|
|
1455
|
-
this.uploadObj.removing();
|
|
1456
|
-
}
|
|
1457
1478
|
};
|
|
1458
1479
|
Image.prototype.onDocumentClick = function (e) {
|
|
1459
1480
|
var target = e.target;
|
|
@@ -33,7 +33,6 @@ export declare class Table {
|
|
|
33
33
|
private helper;
|
|
34
34
|
private dialogRenderObj;
|
|
35
35
|
private currentColumnResize;
|
|
36
|
-
private currentMarginLeft;
|
|
37
36
|
private previousTableElement;
|
|
38
37
|
private constructor();
|
|
39
38
|
protected addEventListener(): void;
|
|
@@ -83,11 +82,13 @@ export declare class Table {
|
|
|
83
82
|
private updateHelper;
|
|
84
83
|
private calMaxCol;
|
|
85
84
|
private resizing;
|
|
85
|
+
private getCurrentColWidth;
|
|
86
86
|
private getCurrentTableWidth;
|
|
87
87
|
private findFirstLastColCells;
|
|
88
88
|
private convertPixelToPercentage;
|
|
89
89
|
private cancelResizeAction;
|
|
90
90
|
private resizeEnd;
|
|
91
|
+
private resetResizeHelper;
|
|
91
92
|
private resizeBtnInit;
|
|
92
93
|
private addRow;
|
|
93
94
|
private addColumn;
|
|
@@ -123,4 +124,5 @@ export declare class Table {
|
|
|
123
124
|
*/
|
|
124
125
|
private getModuleName;
|
|
125
126
|
private afterKeyDown;
|
|
127
|
+
private updateResizeIconPosition;
|
|
126
128
|
}
|