@syncfusion/ej2-richtexteditor 18.4.34 → 18.4.42-70943
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 +782 -718
- package/README.md +67 -67
- package/dist/ej2-richtexteditor.umd.min.js +1 -1
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +271 -153
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +393 -275
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/helpers/e2e/index.js +3 -3
- package/license +9 -9
- package/package.json +76 -53
- package/src/editor-manager/plugin/image.js +2 -1
- package/src/editor-manager/plugin/inserthtml.js +14 -10
- package/src/editor-manager/plugin/link.js +6 -6
- package/src/editor-manager/plugin/lists.js +6 -2
- package/src/editor-manager/plugin/ms-word-clean-up.js +22 -6
- package/src/editor-manager/plugin/selection-commands.d.ts +1 -0
- package/src/editor-manager/plugin/selection-commands.js +34 -3
- package/src/editor-manager/plugin/table.js +2 -1
- package/src/global.d.ts +1 -0
- package/src/rich-text-editor/actions/full-screen.d.ts +0 -1
- package/src/rich-text-editor/actions/full-screen.js +6 -4
- package/src/rich-text-editor/actions/keyboard-model.d.ts +13 -13
- package/src/rich-text-editor/actions/keyboard.js +21 -20
- package/src/rich-text-editor/actions/resize.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-model.d.ts +701 -701
- package/src/rich-text-editor/base/rich-text-editor.js +61 -36
- package/src/rich-text-editor/formatter/html-formatter.js +13 -13
- package/src/rich-text-editor/formatter/markdown-formatter.js +13 -13
- package/src/rich-text-editor/models/iframe-settings-model.d.ts +21 -21
- package/src/rich-text-editor/models/iframe-settings.js +19 -19
- package/src/rich-text-editor/models/inline-mode-model.d.ts +9 -9
- package/src/rich-text-editor/models/inline-mode.js +19 -19
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +328 -328
- package/src/rich-text-editor/models/toolbar-settings.js +19 -19
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +13 -13
- package/src/rich-text-editor/renderer/image-module.d.ts +2 -0
- package/src/rich-text-editor/renderer/image-module.js +28 -8
- package/src/rich-text-editor/renderer/table-module.js +6 -1
- package/styles/_all.scss +2 -2
- package/styles/bootstrap-dark.css +22 -1
- package/styles/bootstrap.css +22 -1
- package/styles/bootstrap4.css +22 -1
- package/styles/bootstrap5-dark.css +0 -0
- package/styles/bootstrap5-dark.scss +0 -0
- package/styles/bootstrap5.css +0 -0
- package/styles/bootstrap5.scss +0 -0
- package/styles/fabric-dark.css +22 -1
- package/styles/fabric.css +22 -1
- package/styles/highcontrast-light.css +22 -1
- package/styles/highcontrast.css +22 -1
- package/styles/material-dark.css +22 -1
- package/styles/material.css +22 -1
- package/styles/rich-text-editor/_all.scss +2 -2
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +151 -151
- package/styles/rich-text-editor/_bootstrap-definition.scss +184 -184
- package/styles/rich-text-editor/_bootstrap4-definition.scss +307 -307
- package/styles/rich-text-editor/_fabric-dark-definition.scss +150 -150
- package/styles/rich-text-editor/_fabric-definition.scss +148 -148
- package/styles/rich-text-editor/_highcontrast-definition.scss +148 -148
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +148 -148
- package/styles/rich-text-editor/_layout.scss +1416 -1405
- package/styles/rich-text-editor/_material-dark-definition.scss +151 -151
- package/styles/rich-text-editor/_material-definition.scss +150 -150
- package/styles/rich-text-editor/_theme.scss +499 -489
- package/styles/rich-text-editor/bootstrap-dark.css +22 -1
- package/styles/rich-text-editor/bootstrap.css +22 -1
- package/styles/rich-text-editor/bootstrap4.css +22 -1
- package/styles/rich-text-editor/fabric-dark.css +22 -1
- package/styles/rich-text-editor/fabric.css +22 -1
- package/styles/rich-text-editor/highcontrast-light.css +22 -1
- package/styles/rich-text-editor/highcontrast.css +22 -1
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +289 -289
- package/styles/rich-text-editor/icons/_bootstrap.scss +288 -288
- package/styles/rich-text-editor/icons/_bootstrap4.scss +288 -288
- package/styles/rich-text-editor/icons/_fabric-dark.scss +288 -288
- package/styles/rich-text-editor/icons/_fabric.scss +288 -288
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +288 -288
- package/styles/rich-text-editor/icons/_highcontrast.scss +288 -288
- package/styles/rich-text-editor/icons/_material-dark.scss +288 -288
- package/styles/rich-text-editor/icons/_material.scss +288 -288
- package/styles/rich-text-editor/material-dark.css +22 -1
- package/styles/rich-text-editor/material.css +22 -1
- package/styles/tailwind-dark.css +0 -0
- package/styles/tailwind-dark.scss +0 -0
- package/styles/tailwind.css +0 -0
- package/styles/tailwind.scss +0 -0
- package/dist/global/ej2-richtexteditor.min.js +0 -2
- package/dist/global/ej2-richtexteditor.min.js.map +0 -1
- package/dist/global/index.d.ts +0 -5
package/helpers/e2e/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
function __export(m) {
|
|
3
|
-
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
4
|
-
}
|
|
2
|
+
function __export(m) {
|
|
3
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
4
|
+
}
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
__export(require("./rte-helper"));
|
package/license
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
Essential JS 2 library is available under the Syncfusion Essential Studio program, and can be licensed either under the Syncfusion Community License Program or the Syncfusion commercial license.
|
|
2
|
-
|
|
3
|
-
To be qualified for the Syncfusion Community License Program you must have a gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD) per year and have less than five (5) developers in your organization, and agree to be bound by Syncfusion’s terms and conditions.
|
|
4
|
-
|
|
5
|
-
Customers who do not qualify for the community license can contact sales@syncfusion.com for commercial licensing options.
|
|
6
|
-
|
|
7
|
-
Under no circumstances can you use this product without (1) either a Community License or a commercial license and (2) without agreeing and abiding by Syncfusion’s license containing all terms and conditions.
|
|
8
|
-
|
|
9
|
-
The Syncfusion license that contains the terms and conditions can be found at
|
|
1
|
+
Essential JS 2 library is available under the Syncfusion Essential Studio program, and can be licensed either under the Syncfusion Community License Program or the Syncfusion commercial license.
|
|
2
|
+
|
|
3
|
+
To be qualified for the Syncfusion Community License Program you must have a gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD) per year and have less than five (5) developers in your organization, and agree to be bound by Syncfusion’s terms and conditions.
|
|
4
|
+
|
|
5
|
+
Customers who do not qualify for the community license can contact sales@syncfusion.com for commercial licensing options.
|
|
6
|
+
|
|
7
|
+
Under no circumstances can you use this product without (1) either a Community License or a commercial license and (2) without agreeing and abiding by Syncfusion’s license containing all terms and conditions.
|
|
8
|
+
|
|
9
|
+
The Syncfusion license that contains the terms and conditions can be found at
|
|
10
10
|
https://www.syncfusion.com/content/downloads/syncfusion_license.pdf
|
package/package.json
CHANGED
|
@@ -1,53 +1,76 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
{
|
|
2
|
+
"_from": "@syncfusion/ej2-richtexteditor@*",
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@18.4.39",
|
|
4
|
+
"_inBundle": false,
|
|
5
|
+
"_integrity": "sha512-zQHQfwpxLkp6Ywsv7i9qBAUoy9KTFpzuJcGacCbyRkc1rG5jJMWPlKQRJPl/x+OwsMLB/oa7g33B4fYwC09KlA==",
|
|
6
|
+
"_location": "/@syncfusion/ej2-richtexteditor",
|
|
7
|
+
"_phantomChildren": {},
|
|
8
|
+
"_requested": {
|
|
9
|
+
"type": "range",
|
|
10
|
+
"registry": true,
|
|
11
|
+
"raw": "@syncfusion/ej2-richtexteditor@*",
|
|
12
|
+
"name": "@syncfusion/ej2-richtexteditor",
|
|
13
|
+
"escapedName": "@syncfusion%2fej2-richtexteditor",
|
|
14
|
+
"scope": "@syncfusion",
|
|
15
|
+
"rawSpec": "*",
|
|
16
|
+
"saveSpec": null,
|
|
17
|
+
"fetchSpec": "*"
|
|
18
|
+
},
|
|
19
|
+
"_requiredBy": [
|
|
20
|
+
"/",
|
|
21
|
+
"/@syncfusion/ej2",
|
|
22
|
+
"/@syncfusion/ej2-angular-richtexteditor",
|
|
23
|
+
"/@syncfusion/ej2-gantt",
|
|
24
|
+
"/@syncfusion/ej2-inplace-editor",
|
|
25
|
+
"/@syncfusion/ej2-pdfviewer",
|
|
26
|
+
"/@syncfusion/ej2-react-richtexteditor",
|
|
27
|
+
"/@syncfusion/ej2-vue-richtexteditor"
|
|
28
|
+
],
|
|
29
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-18.4.39.tgz",
|
|
30
|
+
"_shasum": "e1873daf7b0bb36340b1a545b2c05aab37501994",
|
|
31
|
+
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
32
|
+
"_where": "/jenkins/workspace/automation_release_18.4.0.1-WOJ6QVY6EU5ONBWOYGQFKS2VU2UW7E67MOXUPKCE5AX7QQX7M5JQ/packages/included",
|
|
33
|
+
"author": {
|
|
34
|
+
"name": "Syncfusion Inc."
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/syncfusion/ej2-javascript-ui-controls/issues"
|
|
38
|
+
},
|
|
39
|
+
"bundleDependencies": false,
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@syncfusion/ej2-base": "~18.4.42",
|
|
42
|
+
"@syncfusion/ej2-buttons": "~18.4.41",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~18.4.41",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~18.4.41",
|
|
45
|
+
"@syncfusion/ej2-navigations": "~18.4.42",
|
|
46
|
+
"@syncfusion/ej2-popups": "~18.4.41",
|
|
47
|
+
"@syncfusion/ej2-splitbuttons": "~18.4.41"
|
|
48
|
+
},
|
|
49
|
+
"deprecated": false,
|
|
50
|
+
"description": "Essential JS 2 RichTextEditor component",
|
|
51
|
+
"devDependencies": {},
|
|
52
|
+
"es2015": "./dist/es6/ej2-richtexteditor.es2015.js",
|
|
53
|
+
"homepage": "https://github.com/syncfusion/ej2-javascript-ui-controls#readme",
|
|
54
|
+
"keywords": [
|
|
55
|
+
"ej2",
|
|
56
|
+
"syncfusion",
|
|
57
|
+
"ej2-richtexteditor",
|
|
58
|
+
"richtexteditor",
|
|
59
|
+
"rich-text-editor",
|
|
60
|
+
"markdowneditor",
|
|
61
|
+
"markdown-editor",
|
|
62
|
+
"editor"
|
|
63
|
+
],
|
|
64
|
+
"license": "SEE LICENSE IN license",
|
|
65
|
+
"main": "./dist/ej2-richtexteditor.umd.min.js",
|
|
66
|
+
"module": "./index.js",
|
|
67
|
+
"name": "@syncfusion/ej2-richtexteditor",
|
|
68
|
+
"repository": {
|
|
69
|
+
"type": "git",
|
|
70
|
+
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
71
|
+
},
|
|
72
|
+
"typings": "index.d.ts",
|
|
73
|
+
"version": "18.4.42-70943",
|
|
74
|
+
"sideEffects": false
|
|
75
|
+
}
|
|
76
|
+
|
|
@@ -98,8 +98,9 @@ var ImageCommand = /** @class */ (function () {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
if (e.callBack && (isNOU(e.selector) || !isNOU(e.selector) && e.selector !== 'pasteCleanupModule')) {
|
|
101
|
+
var selectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)[0];
|
|
101
102
|
var imgElm_1 = e.value === 'Replace' ? e.item.selectParent[0] :
|
|
102
|
-
|
|
103
|
+
(Browser.isIE ? selectedNode.previousSibling : selectedNode.previousElementSibling);
|
|
103
104
|
imgElm_1.addEventListener('load', function () {
|
|
104
105
|
e.callBack({
|
|
105
106
|
requestType: 'Image',
|
|
@@ -36,7 +36,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
36
36
|
var isCursor = range.startOffset === range.endOffset && range.startOffset === 0 &&
|
|
37
37
|
range.startContainer === range.endContainer;
|
|
38
38
|
var isCollapsed = range.collapsed;
|
|
39
|
-
var nodes = this.getNodeCollection(range, nodeSelection);
|
|
39
|
+
var nodes = this.getNodeCollection(range, nodeSelection, node);
|
|
40
40
|
var closestParentNode = (node.nodeName.toLowerCase() === 'table') ? this.closestEle(nodes[0].parentNode, editNode) : nodes[0];
|
|
41
41
|
if (isExternal || (!isNOU(node) && !isNOU(node.classList) &&
|
|
42
42
|
node.classList.contains('pasteContent'))) {
|
|
@@ -261,9 +261,10 @@ var InsertHtml = /** @class */ (function () {
|
|
|
261
261
|
}
|
|
262
262
|
};
|
|
263
263
|
InsertHtml.placeCursorEnd = function (lastSelectionNode, node, nodeSelection, docElement, editNode) {
|
|
264
|
-
lastSelectionNode = lastSelectionNode.nodeName === 'BR' ? lastSelectionNode.previousSibling
|
|
264
|
+
lastSelectionNode = lastSelectionNode.nodeName === 'BR' ? (isNOU(lastSelectionNode.previousSibling) ? lastSelectionNode.parentNode
|
|
265
|
+
: lastSelectionNode.previousSibling) : lastSelectionNode;
|
|
265
266
|
while (!isNOU(lastSelectionNode) && lastSelectionNode.nodeName !== '#text' && lastSelectionNode.nodeName !== 'IMG' &&
|
|
266
|
-
lastSelectionNode.nodeName !== 'BR') {
|
|
267
|
+
lastSelectionNode.nodeName !== 'BR' && lastSelectionNode.nodeName !== 'HR') {
|
|
267
268
|
lastSelectionNode = lastSelectionNode.lastChild;
|
|
268
269
|
}
|
|
269
270
|
lastSelectionNode = isNOU(lastSelectionNode) ? node : lastSelectionNode;
|
|
@@ -275,10 +276,11 @@ var InsertHtml = /** @class */ (function () {
|
|
|
275
276
|
}
|
|
276
277
|
this.removeEmptyElements(editNode);
|
|
277
278
|
};
|
|
278
|
-
InsertHtml.getNodeCollection = function (range, nodeSelection) {
|
|
279
|
+
InsertHtml.getNodeCollection = function (range, nodeSelection, node) {
|
|
279
280
|
var nodes = [];
|
|
280
|
-
if (range.startOffset === range.endOffset && range.startContainer === range.endContainer
|
|
281
|
-
range.startContainer.nodeName === 'TD'
|
|
281
|
+
if (range.startOffset === range.endOffset && range.startContainer === range.endContainer
|
|
282
|
+
&& (range.startContainer.nodeName === 'TD' || (range.startContainer.nodeType !== 3 &&
|
|
283
|
+
node.classList && node.classList.contains('pasteContent')))) {
|
|
282
284
|
nodes.push(range.startContainer.childNodes[range.endOffset]);
|
|
283
285
|
}
|
|
284
286
|
else {
|
|
@@ -317,10 +319,12 @@ var InsertHtml = /** @class */ (function () {
|
|
|
317
319
|
lastSelectionNode.classList.add('lastNode');
|
|
318
320
|
editNode.innerHTML = updateTextNode(editNode.innerHTML);
|
|
319
321
|
lastSelectionNode = editNode.querySelector('.lastNode');
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
lastSelectionNode.
|
|
322
|
+
if (!isNOU(lastSelectionNode)) {
|
|
323
|
+
this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
324
|
+
lastSelectionNode.classList.remove('lastNode');
|
|
325
|
+
if (lastSelectionNode.classList.length === 0) {
|
|
326
|
+
lastSelectionNode.removeAttribute('class');
|
|
327
|
+
}
|
|
324
328
|
}
|
|
325
329
|
};
|
|
326
330
|
InsertHtml.imageFocus = function (node, nodeSelection, docElement) {
|
|
@@ -125,17 +125,17 @@ var LinkCommand = /** @class */ (function () {
|
|
|
125
125
|
var check = true;
|
|
126
126
|
currentNode = txtArray[i];
|
|
127
127
|
while (check === true) {
|
|
128
|
-
if (currentNode.
|
|
129
|
-
var anchorEle = currentNode.
|
|
130
|
-
currentNode.
|
|
131
|
-
currentNode.
|
|
128
|
+
if (currentNode.parentNode.nodeName === 'A') {
|
|
129
|
+
var anchorEle = currentNode.parentNode;
|
|
130
|
+
currentNode.parentNode.parentNode.insertBefore(anchorEle.firstChild, anchorEle);
|
|
131
|
+
currentNode.parentNode.removeChild(anchorEle);
|
|
132
132
|
}
|
|
133
|
-
if (this.isBlockNode(currentNode.
|
|
133
|
+
if (this.isBlockNode(currentNode.parentNode) || txtArray.length === 0 || i === 0 || i === txtArray.length - 1) {
|
|
134
134
|
inlineNodes[i] = currentNode;
|
|
135
135
|
check = false;
|
|
136
136
|
}
|
|
137
137
|
else {
|
|
138
|
-
currentNode = currentNode.
|
|
138
|
+
currentNode = currentNode.parentNode;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
}
|
|
@@ -93,11 +93,15 @@ var Lists = /** @class */ (function () {
|
|
|
93
93
|
startNode = startNode.nodeName === 'BR' ? startNode.parentElement : startNode;
|
|
94
94
|
endNode = endNode.nodeName === 'BR' ? endNode.parentElement : endNode;
|
|
95
95
|
if (startNode === endNode && !isNullOrUndefined(closest(startNode, 'li')) &&
|
|
96
|
-
startNode.textContent.trim() === '' && startNode.textContent.charCodeAt(0) === 65279)
|
|
96
|
+
((startNode.textContent.trim() === '' && startNode.textContent.charCodeAt(0) === 65279) ||
|
|
97
|
+
(startNode.textContent.length === 1 && startNode.textContent.charCodeAt(0) === 8203))) {
|
|
97
98
|
startNode.textContent = '';
|
|
98
99
|
}
|
|
99
100
|
if (startNode === endNode && startNode.textContent === '') {
|
|
100
|
-
if (startNode.
|
|
101
|
+
if (startNode.parentElement.tagName === 'LI' && endNode.parentElement.tagName === 'LI') {
|
|
102
|
+
detach(startNode);
|
|
103
|
+
}
|
|
104
|
+
else if (startNode.closest('ul') || startNode.closest('ol')) {
|
|
101
105
|
var parentList = !isNOU(startNode.closest('ul')) ? startNode.closest('ul') : startNode.closest('ol');
|
|
102
106
|
if (parentList.firstElementChild === startNode && !isNOU(parentList.children[1]) &&
|
|
103
107
|
(parentList.children[1].tagName === 'OL' || parentList.children[1].tagName === 'UL')) {
|
|
@@ -575,18 +575,34 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
575
575
|
};
|
|
576
576
|
MsWordPaste.prototype.getListContent = function (elem) {
|
|
577
577
|
var pushContent = '';
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
578
|
+
var firstChild = elem.firstElementChild;
|
|
579
|
+
if (firstChild.textContent.trim() === '' && !isNOU(firstChild.firstElementChild) &&
|
|
580
|
+
firstChild.firstElementChild.nodeName === 'IMG') {
|
|
581
581
|
pushContent = elem.innerHTML.trim();
|
|
582
582
|
this.listContents.push('');
|
|
583
583
|
this.listContents.push(pushContent);
|
|
584
584
|
}
|
|
585
585
|
else {
|
|
586
|
-
|
|
587
|
-
|
|
586
|
+
var styleNodes = ['b', 'em'];
|
|
587
|
+
if (firstChild.childNodes.length > 0 && (firstChild.querySelectorAll('b').length > 0
|
|
588
|
+
|| firstChild.querySelectorAll('em').length > 0)) {
|
|
589
|
+
for (var i = 0; i < firstChild.childNodes.length; i++) {
|
|
590
|
+
var nodeName = firstChild.childNodes[i].nodeName.toLowerCase();
|
|
591
|
+
if (firstChild.childNodes[i].textContent.trim().length > 1 && styleNodes.indexOf(nodeName) !== -1) {
|
|
592
|
+
pushContent = '<' + nodeName + '>' + firstChild.childNodes[i].textContent + '</' + nodeName + '>';
|
|
593
|
+
this.listContents.push(pushContent);
|
|
594
|
+
}
|
|
595
|
+
else if (firstChild.childNodes[i].textContent.trim().length === 1) {
|
|
596
|
+
this.listContents.push(firstChild.childNodes[i].textContent.trim());
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
else {
|
|
601
|
+
pushContent = firstChild.textContent.trim();
|
|
602
|
+
this.listContents.push(pushContent);
|
|
603
|
+
}
|
|
588
604
|
}
|
|
589
|
-
detach(
|
|
605
|
+
detach(firstChild);
|
|
590
606
|
this.listContents.push(elem.innerHTML);
|
|
591
607
|
};
|
|
592
608
|
return MsWordPaste;
|
|
@@ -6,6 +6,7 @@ export declare class SelectionCommands {
|
|
|
6
6
|
*/
|
|
7
7
|
static applyFormat(docElement: Document, format: string, endNode: Node, value?: string, selector?: string): void;
|
|
8
8
|
private static insertCursorNode;
|
|
9
|
+
private static getCursorFormat;
|
|
9
10
|
private static removeFormat;
|
|
10
11
|
private static insertFormat;
|
|
11
12
|
private static applyStyles;
|
|
@@ -22,6 +22,7 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
22
22
|
if (format === 'backgroundcolor' && value === '') {
|
|
23
23
|
value = 'transparent';
|
|
24
24
|
}
|
|
25
|
+
var preventRestore = false;
|
|
25
26
|
var domSelection = new NodeSelection();
|
|
26
27
|
var nodeCutter = new NodeCutter();
|
|
27
28
|
var isFormatted = new IsFormatted();
|
|
@@ -38,10 +39,23 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
38
39
|
isCollapsed = true;
|
|
39
40
|
range = nodeCutter.GetCursorRange(docElement, range, nodes[0]);
|
|
40
41
|
}
|
|
42
|
+
else if (range.startContainer.nodeType === 3 && range.startContainer.parentElement.childElementCount > 0 &&
|
|
43
|
+
range.startOffset > 0 && range.startContainer.parentElement.firstElementChild.tagName.toLowerCase() !== 'br') {
|
|
44
|
+
isCollapsed = true;
|
|
45
|
+
range = nodeCutter.GetCursorRange(docElement, range, range.startContainer);
|
|
46
|
+
nodes.push(range.startContainer);
|
|
47
|
+
}
|
|
41
48
|
else if (range.startContainer.nodeName.toLowerCase() !== 'td') {
|
|
42
49
|
var cursorNode = this.insertCursorNode(docElement, domSelection, range, isFormatted, nodeCutter, format, value, endNode);
|
|
43
50
|
domSelection.endContainer = domSelection.startContainer = domSelection.getNodeArray(cursorNode, true);
|
|
44
|
-
|
|
51
|
+
var childNodes = cursorNode.nodeName === 'BR' && cursorNode.parentNode.childNodes;
|
|
52
|
+
if (!isNOU(childNodes) && childNodes.length === 1 && childNodes[0].nodeName === 'BR' && nodes.length === 0) {
|
|
53
|
+
domSelection.setSelectionText(docElement, range.startContainer, range.endContainer, 0, 0);
|
|
54
|
+
preventRestore = true;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
domSelection.endOffset = domSelection.startOffset = 1;
|
|
58
|
+
}
|
|
45
59
|
}
|
|
46
60
|
}
|
|
47
61
|
isCursor = range.collapsed;
|
|
@@ -72,7 +86,9 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
72
86
|
if (isIDevice()) {
|
|
73
87
|
setEditFrameFocus(endNode, selector);
|
|
74
88
|
}
|
|
75
|
-
|
|
89
|
+
if (!preventRestore) {
|
|
90
|
+
save.restore();
|
|
91
|
+
}
|
|
76
92
|
if (isSubSup) {
|
|
77
93
|
this.applyFormat(docElement, format, endNode);
|
|
78
94
|
}
|
|
@@ -80,17 +96,32 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
80
96
|
};
|
|
81
97
|
SelectionCommands.insertCursorNode = function (docElement, domSelection, range, isFormatted, nodeCutter, format, value, endNode) {
|
|
82
98
|
var cursorNodes = domSelection.getNodeCollection(range);
|
|
83
|
-
var cursorFormat = (cursorNodes.length > 0) ?
|
|
99
|
+
var cursorFormat = (cursorNodes.length > 0) ?
|
|
100
|
+
(cursorNodes.length > 1 && range.startContainer === range.endContainer) ?
|
|
101
|
+
this.getCursorFormat(isFormatted, cursorNodes, format, endNode) :
|
|
102
|
+
isFormatted.getFormattedNode(cursorNodes[0], format, endNode) : null;
|
|
84
103
|
var cursorNode = null;
|
|
85
104
|
if (cursorFormat) {
|
|
86
105
|
cursorNode = cursorNodes[0];
|
|
87
106
|
InsertMethods.unwrap(cursorFormat);
|
|
88
107
|
}
|
|
89
108
|
else {
|
|
109
|
+
if (cursorNodes.length > 1 && range.startOffset > 0 && (cursorNodes[0].firstElementChild &&
|
|
110
|
+
cursorNodes[0].firstElementChild.tagName.toLowerCase() === 'br')) {
|
|
111
|
+
cursorNodes[0].innerHTML = '';
|
|
112
|
+
}
|
|
90
113
|
cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
|
|
91
114
|
}
|
|
92
115
|
return cursorNode;
|
|
93
116
|
};
|
|
117
|
+
SelectionCommands.getCursorFormat = function (isFormatted, cursorNodes, format, endNode) {
|
|
118
|
+
var currentNode;
|
|
119
|
+
for (var index = 0; index < cursorNodes.length; index++) {
|
|
120
|
+
currentNode = cursorNodes[index].lastElementChild ?
|
|
121
|
+
cursorNodes[index].lastElementChild : cursorNodes[index];
|
|
122
|
+
}
|
|
123
|
+
return isFormatted.getFormattedNode(currentNode, format, endNode);
|
|
124
|
+
};
|
|
94
125
|
SelectionCommands.removeFormat = function (nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection) {
|
|
95
126
|
var splitNode = null;
|
|
96
127
|
if (!(range.startContainer === range.endContainer && range.startOffset === 0
|
|
@@ -38,7 +38,8 @@ var TableCommand = /** @class */ (function () {
|
|
|
38
38
|
if (!isNOU(e.item.width.maxWidth)) {
|
|
39
39
|
table.style.maxWidth = this.calculateStyleValue(e.item.width.maxWidth);
|
|
40
40
|
}
|
|
41
|
-
var tdWid = parseInt(e.item.width.width, 10)
|
|
41
|
+
var tdWid = parseInt(e.item.width.width, 10) > 100 ?
|
|
42
|
+
100 / e.item.columns : parseInt(e.item.width.width, 10) / e.item.columns;
|
|
42
43
|
for (var i = 0; i < e.item.row; i++) {
|
|
43
44
|
var row = createElement('tr');
|
|
44
45
|
for (var j = 0; j < e.item.columns; j++) {
|
package/src/global.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index';
|
|
@@ -4,7 +4,6 @@ import { IRichTextEditor } from '../base/interface';
|
|
|
4
4
|
* `FullScreen` module is used to maximize and minimize screen
|
|
5
5
|
*/
|
|
6
6
|
export declare class FullScreen {
|
|
7
|
-
private overflowData;
|
|
8
7
|
protected parent: IRichTextEditor;
|
|
9
8
|
private scrollableParent;
|
|
10
9
|
constructor(parent?: IRichTextEditor);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Browser, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
1
|
+
import { Browser, isNullOrUndefined as isNOU } from '@syncfusion/ej2-base';
|
|
2
2
|
import { getScrollableParent } from '@syncfusion/ej2-popups';
|
|
3
3
|
import * as events from '../base/constant';
|
|
4
4
|
import * as classes from '../base/classes';
|
|
@@ -17,7 +17,8 @@ var FullScreen = /** @class */ (function () {
|
|
|
17
17
|
* @deprecated
|
|
18
18
|
*/
|
|
19
19
|
FullScreen.prototype.showFullScreen = function (event) {
|
|
20
|
-
if (this.parent.toolbarSettings.enable === true && this.parent.editorMode !== 'Markdown'
|
|
20
|
+
if (this.parent.toolbarSettings.enable === true && this.parent.editorMode !== 'Markdown'
|
|
21
|
+
&& !isNOU(this.parent.quickToolbarModule)) {
|
|
21
22
|
this.parent.quickToolbarModule.hideQuickToolbars();
|
|
22
23
|
}
|
|
23
24
|
this.scrollableParent = getScrollableParent(this.parent.element);
|
|
@@ -53,7 +54,8 @@ var FullScreen = /** @class */ (function () {
|
|
|
53
54
|
* @deprecated
|
|
54
55
|
*/
|
|
55
56
|
FullScreen.prototype.hideFullScreen = function (event) {
|
|
56
|
-
if (this.parent.toolbarSettings.enable === true && this.parent.editorMode !== 'Markdown'
|
|
57
|
+
if (this.parent.toolbarSettings.enable === true && this.parent.editorMode !== 'Markdown'
|
|
58
|
+
&& !isNOU(this.parent.quickToolbarModule)) {
|
|
57
59
|
this.parent.quickToolbarModule.hideQuickToolbars();
|
|
58
60
|
}
|
|
59
61
|
if (this.parent.element.classList.contains(classes.CLS_FULL_SCREEN)) {
|
|
@@ -81,7 +83,7 @@ var FullScreen = /** @class */ (function () {
|
|
|
81
83
|
}
|
|
82
84
|
};
|
|
83
85
|
FullScreen.prototype.toggleParentOverflow = function (isAdd) {
|
|
84
|
-
if (
|
|
86
|
+
if (isNOU(this.scrollableParent)) {
|
|
85
87
|
return;
|
|
86
88
|
}
|
|
87
89
|
for (var i = 0; i < this.scrollableParent.length; i++) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Property, NotifyPropertyChanges, INotifyPropertyChanged, Event } from '@syncfusion/ej2-base';
|
|
1
|
+
import { Property, NotifyPropertyChanges, INotifyPropertyChanged, Event } from '@syncfusion/ej2-base';
|
|
2
2
|
import {KeyboardEventArgs} from "./keyboard";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -7,21 +7,21 @@ import {KeyboardEventArgs} from "./keyboard";
|
|
|
7
7
|
export interface KeyboardEventsModel {
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Specifies key combination and it respective action name.
|
|
11
|
-
* @default null
|
|
12
|
-
*/
|
|
13
|
-
keyConfigs?: { [key: string]: string };
|
|
10
|
+
* Specifies key combination and it respective action name.
|
|
11
|
+
* @default null
|
|
12
|
+
*/
|
|
13
|
+
keyConfigs?: { [key: string]: string };
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* Specifies on which event keyboardEvents class should listen for key press. For ex., `keyup`, `keydown` or `keypress`
|
|
17
|
-
* @default 'keyup'
|
|
18
|
-
*/
|
|
19
|
-
eventName?: string;
|
|
16
|
+
* Specifies on which event keyboardEvents class should listen for key press. For ex., `keyup`, `keydown` or `keypress`
|
|
17
|
+
* @default 'keyup'
|
|
18
|
+
*/
|
|
19
|
+
eventName?: string;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* Specifies the listener when keyboard actions is performed.
|
|
23
|
-
* @event
|
|
24
|
-
*/
|
|
25
|
-
keyAction?: EmitType<KeyboardEventArgs>;
|
|
22
|
+
* Specifies the listener when keyboard actions is performed.
|
|
23
|
+
* @event
|
|
24
|
+
*/
|
|
25
|
+
keyAction?: EmitType<KeyboardEventArgs>;
|
|
26
26
|
|
|
27
27
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
}
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
-
};
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
};
|
|
20
20
|
import { Property, NotifyPropertyChanges, Event } from '@syncfusion/ej2-base';
|
|
21
21
|
import { Base } from '@syncfusion/ej2-base';
|
|
22
22
|
var keyCode = {
|
|
@@ -101,6 +101,7 @@ var KeyboardEvents = /** @class */ (function (_super) {
|
|
|
101
101
|
var isAltKey = e.altKey;
|
|
102
102
|
var isCtrlKey = e.ctrlKey;
|
|
103
103
|
var isShiftKey = e.shiftKey;
|
|
104
|
+
var isMetaKey = e.metaKey;
|
|
104
105
|
var curkeyCode = e.which;
|
|
105
106
|
var keys = Object.keys(_this.keyConfigs);
|
|
106
107
|
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
|
|
@@ -109,7 +110,7 @@ var KeyboardEvents = /** @class */ (function (_super) {
|
|
|
109
110
|
for (var _a = 0, configCollection_1 = configCollection; _a < configCollection_1.length; _a++) {
|
|
110
111
|
var rconfig = configCollection_1[_a];
|
|
111
112
|
var rKeyObj = KeyboardEvents_1.getKeyConfigData(rconfig.trim());
|
|
112
|
-
if (isAltKey === rKeyObj.altKey && isCtrlKey === rKeyObj.ctrlKey &&
|
|
113
|
+
if (isAltKey === rKeyObj.altKey && (isCtrlKey === rKeyObj.ctrlKey || isMetaKey) &&
|
|
113
114
|
isShiftKey === rKeyObj.shiftKey && curkeyCode === rKeyObj.keyCode) {
|
|
114
115
|
e.action = key;
|
|
115
116
|
}
|
|
@@ -59,6 +59,9 @@ var Resize = /** @class */ (function () {
|
|
|
59
59
|
this.parent.element.style.height = eventType.clientY - boundRect.top + 'px';
|
|
60
60
|
this.parent.element.style.width = eventType.clientX - boundRect.left + 'px';
|
|
61
61
|
}
|
|
62
|
+
if (!this.parent.toolbarSettings.enable) {
|
|
63
|
+
this.parent.setContentHeight('', false);
|
|
64
|
+
}
|
|
62
65
|
this.parent.refreshUI();
|
|
63
66
|
};
|
|
64
67
|
Resize.prototype.stopResize = function (e) {
|
|
@@ -151,6 +151,11 @@ export declare const imageToolbarAction: string;
|
|
|
151
151
|
* @deprecated
|
|
152
152
|
*/
|
|
153
153
|
export declare const linkToolbarAction: string;
|
|
154
|
+
/**
|
|
155
|
+
* @hidden
|
|
156
|
+
* @deprecated
|
|
157
|
+
*/
|
|
158
|
+
export declare const windowResize: string;
|
|
154
159
|
/**
|
|
155
160
|
* @hidden
|
|
156
161
|
* @deprecated
|
|
@@ -151,6 +151,11 @@ export var imageToolbarAction = 'image-toolbar-action';
|
|
|
151
151
|
* @deprecated
|
|
152
152
|
*/
|
|
153
153
|
export var linkToolbarAction = 'link-toolbar-action';
|
|
154
|
+
/**
|
|
155
|
+
* @hidden
|
|
156
|
+
* @deprecated
|
|
157
|
+
*/
|
|
158
|
+
export var windowResize = 'resize';
|
|
154
159
|
/**
|
|
155
160
|
* @hidden
|
|
156
161
|
* @deprecated
|