@syncfusion/ej2-richtexteditor 20.1.61 → 20.2.39
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 +32 -0
- 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 +468 -191
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +460 -181
- 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/helpers/e2e/index.js +8 -6
- package/helpers/e2e/rte-helper.js +80 -64
- package/package.json +12 -12
- package/src/common/util.js +7 -8
- package/src/editor-manager/plugin/inserthtml.d.ts +1 -0
- package/src/editor-manager/plugin/inserthtml.js +25 -3
- package/src/editor-manager/plugin/lists.js +14 -4
- package/src/markdown-parser/base/constant.d.ts +6 -0
- package/src/markdown-parser/base/constant.js +6 -0
- package/src/markdown-parser/base/markdown-parser.d.ts +2 -0
- package/src/markdown-parser/base/markdown-parser.js +6 -0
- package/src/markdown-parser/base/types.d.ts +1 -1
- package/src/markdown-parser/plugin/insert-text.d.ts +22 -0
- package/src/markdown-parser/plugin/insert-text.js +51 -0
- package/src/rich-text-editor/actions/color-picker.js +20 -4
- package/src/rich-text-editor/actions/full-screen.js +4 -2
- package/src/rich-text-editor/actions/resize.js +4 -3
- package/src/rich-text-editor/actions/toolbar.js +4 -2
- package/src/rich-text-editor/base/classes.d.ts +5 -0
- package/src/rich-text-editor/base/classes.js +5 -0
- package/src/rich-text-editor/base/constant.d.ts +46 -1
- package/src/rich-text-editor/base/constant.js +46 -1
- package/src/rich-text-editor/base/interface.d.ts +2 -0
- package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -0
- package/src/rich-text-editor/base/rich-text-editor.js +34 -27
- package/src/rich-text-editor/base/util.js +10 -6
- package/src/rich-text-editor/formatter/formatter.js +1 -1
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
- package/src/rich-text-editor/renderer/image-module.d.ts +1 -0
- package/src/rich-text-editor/renderer/image-module.js +58 -44
- package/src/rich-text-editor/renderer/link-module.js +16 -14
- package/src/rich-text-editor/renderer/markdown-renderer.js +2 -1
- package/src/rich-text-editor/renderer/table-module.d.ts +3 -0
- package/src/rich-text-editor/renderer/table-module.js +133 -56
- package/src/rich-text-editor/renderer/toolbar-renderer.js +13 -2
- package/src/rich-text-editor/renderer/view-source.js +1 -1
- package/styles/bootstrap-dark.css +49 -0
- package/styles/bootstrap.css +49 -0
- package/styles/bootstrap4.css +49 -0
- package/styles/bootstrap5-dark.css +49 -0
- package/styles/bootstrap5.css +49 -0
- package/styles/fabric-dark.css +49 -0
- package/styles/fabric.css +49 -0
- package/styles/fluent-dark.css +53 -3
- package/styles/fluent.css +50 -0
- package/styles/highcontrast-light.css +49 -0
- package/styles/highcontrast.css +49 -0
- package/styles/material-dark.css +49 -0
- package/styles/material.css +49 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +17 -16
- package/styles/rich-text-editor/_bootstrap-definition.scss +17 -16
- package/styles/rich-text-editor/_bootstrap4-definition.scss +17 -16
- package/styles/rich-text-editor/_bootstrap5-definition.scss +17 -16
- package/styles/rich-text-editor/_fabric-dark-definition.scss +17 -16
- package/styles/rich-text-editor/_fabric-definition.scss +17 -16
- package/styles/rich-text-editor/_fluent-definition.scss +18 -16
- package/styles/rich-text-editor/_fusionnew-definition.scss +190 -0
- package/styles/rich-text-editor/_highcontrast-definition.scss +17 -16
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +17 -16
- package/styles/rich-text-editor/_layout.scss +59 -0
- package/styles/rich-text-editor/_material-dark-definition.scss +17 -16
- package/styles/rich-text-editor/_material-definition.scss +17 -16
- package/styles/rich-text-editor/_material3-definition.scss +190 -0
- package/styles/rich-text-editor/_tailwind-definition.scss +17 -16
- package/styles/rich-text-editor/bootstrap-dark.css +49 -0
- package/styles/rich-text-editor/bootstrap.css +49 -0
- package/styles/rich-text-editor/bootstrap4.css +49 -0
- package/styles/rich-text-editor/bootstrap5-dark.css +49 -0
- package/styles/rich-text-editor/bootstrap5.css +49 -0
- package/styles/rich-text-editor/fabric-dark.css +49 -0
- package/styles/rich-text-editor/fabric.css +49 -0
- package/styles/rich-text-editor/fluent-dark.css +53 -3
- package/styles/rich-text-editor/fluent.css +50 -0
- package/styles/rich-text-editor/highcontrast-light.css +49 -0
- package/styles/rich-text-editor/highcontrast.css +49 -0
- package/styles/rich-text-editor/icons/_fusionnew.scss +303 -0
- package/styles/rich-text-editor/icons/_material3.scss +303 -0
- package/styles/rich-text-editor/material-dark.css +49 -0
- package/styles/rich-text-editor/material.css +49 -0
- package/styles/rich-text-editor/tailwind-dark.css +49 -0
- package/styles/rich-text-editor/tailwind.css +49 -0
- package/styles/tailwind-dark.css +49 -0
- package/styles/tailwind.css +49 -0
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 20.
|
|
3
|
+
* version : 20.2.39
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. 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/helpers/e2e/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
define(["require", "exports", "./rte-helper"], function (require, exports, rte_helper_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
function __export(m) {
|
|
4
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
5
|
+
}
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
__export(rte_helper_1);
|
|
8
|
+
});
|
|
@@ -1,65 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
define(["require", "exports", "@syncfusion/ej2-base/helpers/e2e"], function (require, exports, e2e_1) {
|
|
15
|
+
"use strict";
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var RichTextEditorHelper = (function (_super) {
|
|
18
|
+
__extends(RichTextEditorHelper, _super);
|
|
19
|
+
function RichTextEditorHelper(id, wrapperFn) {
|
|
20
|
+
var _this = _super.call(this) || this;
|
|
21
|
+
_this.id = id;
|
|
22
|
+
if (wrapperFn !== undefined) {
|
|
23
|
+
_this.wrapperFn = wrapperFn;
|
|
24
|
+
}
|
|
25
|
+
return _this;
|
|
10
26
|
}
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
27
|
+
RichTextEditorHelper.prototype.getElement = function () {
|
|
28
|
+
return this.selector('#' + this.id);
|
|
29
|
+
};
|
|
30
|
+
RichTextEditorHelper.prototype.getQuickToolbarElement = function () {
|
|
31
|
+
return this.selector(".e-rte-quick-popup");
|
|
32
|
+
};
|
|
33
|
+
RichTextEditorHelper.prototype.getToolbar = function () {
|
|
34
|
+
return this.selector('#' + this.id + "_toolbar");
|
|
35
|
+
};
|
|
36
|
+
RichTextEditorHelper.prototype.getCharCount = function () {
|
|
37
|
+
return this.selector(".e-rte-character-count");
|
|
38
|
+
};
|
|
39
|
+
RichTextEditorHelper.prototype.getTableDialog = function () {
|
|
40
|
+
return this.selector('#' + this.id + "_tabledialog");
|
|
41
|
+
};
|
|
42
|
+
RichTextEditorHelper.prototype.getImageDialog = function () {
|
|
43
|
+
return this.selector('#' + this.id + "_defaultRTE_image");
|
|
44
|
+
};
|
|
45
|
+
RichTextEditorHelper.prototype.getLinkDialog = function () {
|
|
46
|
+
return this.selector('#' + this.id + "_rtelink");
|
|
47
|
+
};
|
|
48
|
+
RichTextEditorHelper.prototype.getFontNamePopup = function () {
|
|
49
|
+
return this.selector('#' + this.id + "_toolbar_FontName-popup");
|
|
50
|
+
};
|
|
51
|
+
RichTextEditorHelper.prototype.getFontSizePopup = function () {
|
|
52
|
+
return this.selector('#' + this.id + "_toolbar_FontSize-popup");
|
|
53
|
+
};
|
|
54
|
+
RichTextEditorHelper.prototype.getFontColorPopup = function () {
|
|
55
|
+
return this.selector('#' + this.id + "toolbar_FontColor-popup");
|
|
56
|
+
};
|
|
57
|
+
RichTextEditorHelper.prototype.getBackgroundColorPopup = function () {
|
|
58
|
+
return this.selector('#' + this.id + "toolbar_BackgroundColor-popup");
|
|
59
|
+
};
|
|
60
|
+
RichTextEditorHelper.prototype.getFormatPopup = function () {
|
|
61
|
+
return this.selector('#' + this.id + "toolbar_Formats-popup");
|
|
62
|
+
};
|
|
63
|
+
RichTextEditorHelper.prototype.getAlignmentPopup = function () {
|
|
64
|
+
return this.selector('#' + this.id + "toolbar_Alignments-popup");
|
|
65
|
+
};
|
|
66
|
+
RichTextEditorHelper.prototype.getContent = function () {
|
|
67
|
+
return this.selector(".e-rte-content");
|
|
68
|
+
};
|
|
69
|
+
RichTextEditorHelper.prototype.getModel = function (property) {
|
|
70
|
+
this.getModel(property);
|
|
71
|
+
};
|
|
72
|
+
RichTextEditorHelper.prototype.setModel = function (property, value) {
|
|
73
|
+
this.setModel(property, value);
|
|
74
|
+
};
|
|
75
|
+
RichTextEditorHelper.prototype.invoke = function (fName, args) {
|
|
76
|
+
this.invoke(fName, args);
|
|
77
|
+
};
|
|
78
|
+
return RichTextEditorHelper;
|
|
79
|
+
}(e2e_1.TestHelper));
|
|
80
|
+
exports.RichTextEditorHelper = RichTextEditorHelper;
|
|
81
|
+
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-richtexteditor@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-richtexteditor@20.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@20.2.38",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-R8AtoHAIPqpoh/7JpkRUms9eRZPs7tWWTid2D9gZXd/JieNhPPEcoRKYjavpVRx/Cj4O7umyzzXHIekW+8h3Xw==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-richtexteditor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"/@syncfusion/ej2-react-richtexteditor",
|
|
27
27
|
"/@syncfusion/ej2-vue-richtexteditor"
|
|
28
28
|
],
|
|
29
|
-
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.
|
|
30
|
-
"_shasum": "
|
|
29
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.2.38.tgz",
|
|
30
|
+
"_shasum": "332d081f0e815d62053ba5a2d14d14f9a0813411",
|
|
31
31
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
32
32
|
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
|
|
33
33
|
"author": {
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
},
|
|
39
39
|
"bundleDependencies": false,
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@syncfusion/ej2-base": "~20.
|
|
42
|
-
"@syncfusion/ej2-buttons": "~20.
|
|
43
|
-
"@syncfusion/ej2-filemanager": "~20.
|
|
44
|
-
"@syncfusion/ej2-inputs": "~20.
|
|
45
|
-
"@syncfusion/ej2-navigations": "~20.
|
|
46
|
-
"@syncfusion/ej2-popups": "~20.
|
|
47
|
-
"@syncfusion/ej2-splitbuttons": "~20.
|
|
41
|
+
"@syncfusion/ej2-base": "~20.2.38",
|
|
42
|
+
"@syncfusion/ej2-buttons": "~20.2.38",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~20.2.39",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~20.2.38",
|
|
45
|
+
"@syncfusion/ej2-navigations": "~20.2.39",
|
|
46
|
+
"@syncfusion/ej2-popups": "~20.2.39",
|
|
47
|
+
"@syncfusion/ej2-splitbuttons": "~20.2.38"
|
|
48
48
|
},
|
|
49
49
|
"deprecated": false,
|
|
50
50
|
"description": "Essential JS 2 RichTextEditor component",
|
|
@@ -70,6 +70,6 @@
|
|
|
70
70
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
71
71
|
},
|
|
72
72
|
"typings": "index.d.ts",
|
|
73
|
-
"version": "20.
|
|
73
|
+
"version": "20.2.39",
|
|
74
74
|
"sideEffects": false
|
|
75
75
|
}
|
package/src/common/util.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Defines common util methods used by Rich Text Editor.
|
|
3
3
|
*/
|
|
4
4
|
import { isNullOrUndefined, Browser, createElement, detach } from '@syncfusion/ej2-base';
|
|
5
|
-
import * as classes from '../rich-text-editor/base/classes';
|
|
6
5
|
var inlineNode = ['a', 'abbr', 'acronym', 'audio', 'b', 'bdi', 'bdo', 'big', 'br', 'button',
|
|
7
6
|
'canvas', 'cite', 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'font', 'i', 'iframe', 'img', 'input',
|
|
8
7
|
'ins', 'kbd', 'label', 'map', 'mark', 'meter', 'noscript', 'object', 'output', 'picture', 'progress',
|
|
@@ -95,18 +94,18 @@ export function updateTextNode(value) {
|
|
|
95
94
|
tdElm[j].style.removeProperty('border');
|
|
96
95
|
}
|
|
97
96
|
}
|
|
98
|
-
if (!tableElm[i].classList.contains(
|
|
99
|
-
tableElm[i].classList.add(
|
|
97
|
+
if (!tableElm[i].classList.contains('e-rte-table')) {
|
|
98
|
+
tableElm[i].classList.add('e-rte-table');
|
|
100
99
|
}
|
|
101
100
|
}
|
|
102
101
|
var imageElm = resultElm.querySelectorAll('img');
|
|
103
102
|
for (var i = 0; i < imageElm.length; i++) {
|
|
104
|
-
if (!imageElm[i].classList.contains(
|
|
105
|
-
imageElm[i].classList.add(
|
|
103
|
+
if (!imageElm[i].classList.contains('e-rte-image')) {
|
|
104
|
+
imageElm[i].classList.add('e-rte-image');
|
|
106
105
|
}
|
|
107
|
-
if (!(imageElm[i].classList.contains(
|
|
108
|
-
imageElm[i].classList.contains(
|
|
109
|
-
imageElm[i].classList.add(
|
|
106
|
+
if (!(imageElm[i].classList.contains('e-imginline') ||
|
|
107
|
+
imageElm[i].classList.contains('e-imgbreak'))) {
|
|
108
|
+
imageElm[i].classList.add('e-imginline');
|
|
110
109
|
}
|
|
111
110
|
}
|
|
112
111
|
}
|
|
@@ -12,6 +12,7 @@ export declare class InsertHtml {
|
|
|
12
12
|
|
|
13
13
|
*/
|
|
14
14
|
static inlineNode: string[];
|
|
15
|
+
static contentsDeleted: boolean;
|
|
15
16
|
static Insert(docElement: Document, insertNode: Node | string, editNode?: Element, isExternal?: boolean): void;
|
|
16
17
|
private static pasteInsertHTML;
|
|
17
18
|
private static placeCursorEnd;
|
|
@@ -252,7 +252,9 @@ var InsertHtml = /** @class */ (function () {
|
|
|
252
252
|
var isPreviousInlineElem = void 0;
|
|
253
253
|
var paraElm = void 0;
|
|
254
254
|
var previousParent = void 0;
|
|
255
|
-
|
|
255
|
+
if (!this.contentsDeleted) {
|
|
256
|
+
range.deleteContents();
|
|
257
|
+
}
|
|
256
258
|
while (node.firstChild) {
|
|
257
259
|
if (node.firstChild.nodeName === '#text' && node.firstChild.textContent.trim() === '') {
|
|
258
260
|
detach(node.firstChild);
|
|
@@ -380,9 +382,28 @@ var InsertHtml = /** @class */ (function () {
|
|
|
380
382
|
var nodeSelection = new NodeSelection();
|
|
381
383
|
var currentNode = this.getNodeCollection(range, nodeSelection, node)[this.getNodeCollection(range, nodeSelection, node).length - 1];
|
|
382
384
|
var splitedElm = void 0;
|
|
383
|
-
if ((currentNode.nodeName === 'BR' || currentNode.nodeName === 'HR'
|
|
384
|
-
currentNode.parentElement.
|
|
385
|
+
if ((currentNode.nodeName === 'BR' || currentNode.nodeName === 'HR' ||
|
|
386
|
+
(currentNode.nodeName === '#text' && !isNOU(currentNode.parentElement) && currentNode.parentElement.nodeName === 'LI')) &&
|
|
387
|
+
(!isNOU(currentNode.parentElement) && currentNode.parentElement.textContent.trim().length === 0)) {
|
|
388
|
+
splitedElm = currentNode;
|
|
389
|
+
if (currentNode.parentElement.nodeName === 'LI' && !isNOU(currentNode.nextSibling) &&
|
|
390
|
+
currentNode.nextSibling.nodeName === 'BR') {
|
|
391
|
+
detach(currentNode.nextSibling);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
else if (currentNode.nodeName === '#text' && !isNOU(currentNode.parentElement) &&
|
|
395
|
+
currentNode.parentElement.nodeName === 'LI' && currentNode.parentElement.textContent.trim().length > 0) {
|
|
385
396
|
splitedElm = currentNode;
|
|
397
|
+
if (currentNode.parentElement.nodeName === 'LI' && !isNOU(currentNode.nextSibling) &&
|
|
398
|
+
currentNode.nextSibling.nodeName === 'BR') {
|
|
399
|
+
detach(currentNode.nextSibling);
|
|
400
|
+
}
|
|
401
|
+
if (!range.collapsed) {
|
|
402
|
+
range.deleteContents();
|
|
403
|
+
}
|
|
404
|
+
range.insertNode(node);
|
|
405
|
+
this.contentsDeleted = true;
|
|
406
|
+
return;
|
|
386
407
|
}
|
|
387
408
|
else {
|
|
388
409
|
splitedElm = nodeCutter.GetSpliceNode(range, blockNode);
|
|
@@ -469,6 +490,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
469
490
|
'ins', 'kbd', 'label', 'map', 'mark', 'meter', 'noscript', 'object', 'output', 'picture', 'progress',
|
|
470
491
|
'q', 'ruby', 's', 'samp', 'script', 'select', 'slot', 'small', 'span', 'strong', 'sub', 'sup', 'svg',
|
|
471
492
|
'template', 'textarea', 'time', 'u', 'tt', 'var', 'video', 'wbr'];
|
|
493
|
+
InsertHtml.contentsDeleted = false;
|
|
472
494
|
return InsertHtml;
|
|
473
495
|
}());
|
|
474
496
|
export { InsertHtml };
|
|
@@ -185,6 +185,8 @@ var Lists = /** @class */ (function () {
|
|
|
185
185
|
var endNode = this.parent.domNode.getSelectedNode(range.endContainer, range.endOffset);
|
|
186
186
|
startNode = startNode.nodeName === 'BR' ? startNode.parentElement : startNode;
|
|
187
187
|
endNode = endNode.nodeName === 'BR' ? endNode.parentElement : endNode;
|
|
188
|
+
startNode = startNode.nodeName !== 'LI' && !isNOU(startNode.closest('LI')) ? startNode.closest('LI') : startNode;
|
|
189
|
+
endNode = endNode.nodeName !== 'LI' && !isNOU(endNode.closest('LI')) ? endNode.closest('LI') : endNode;
|
|
188
190
|
if (((range.commonAncestorContainer.nodeName === 'OL' || range.commonAncestorContainer.nodeName === 'UL' || range.commonAncestorContainer.nodeName === 'LI') &&
|
|
189
191
|
isNOU(endNode.nextElementSibling) && endNode.textContent.length === range.endOffset &&
|
|
190
192
|
isNOU(startNode.previousElementSibling) && range.startOffset === 0) ||
|
|
@@ -559,7 +561,7 @@ var Lists = /** @class */ (function () {
|
|
|
559
561
|
};
|
|
560
562
|
Lists.prototype.applyLists = function (elements, type, selector, item, e) {
|
|
561
563
|
var isReverse = true;
|
|
562
|
-
if (this.isRevert(elements, type) && isNOU(item)) {
|
|
564
|
+
if (this.isRevert(elements, type, item) && isNOU(item)) {
|
|
563
565
|
this.revertList(elements, e);
|
|
564
566
|
this.removeEmptyListElements();
|
|
565
567
|
}
|
|
@@ -624,13 +626,14 @@ var Lists = /** @class */ (function () {
|
|
|
624
626
|
}
|
|
625
627
|
}
|
|
626
628
|
};
|
|
627
|
-
Lists.prototype.isRevert = function (nodes, tagName) {
|
|
629
|
+
Lists.prototype.isRevert = function (nodes, tagName, item) {
|
|
628
630
|
var isRevert = true;
|
|
629
631
|
for (var i = 0; i < nodes.length; i++) {
|
|
630
632
|
if (nodes[i].tagName !== 'LI') {
|
|
631
633
|
return false;
|
|
632
634
|
}
|
|
633
|
-
if (nodes[i].parentNode.tagName !== tagName
|
|
635
|
+
if (nodes[i].parentNode.tagName !== tagName ||
|
|
636
|
+
isNOU(item) && nodes[i].parentNode.style.listStyleType !== '') {
|
|
634
637
|
isRevert = false;
|
|
635
638
|
}
|
|
636
639
|
}
|
|
@@ -653,6 +656,12 @@ var Lists = /** @class */ (function () {
|
|
|
653
656
|
(nodes[i].tagName === 'LI' && node.tagName === tagName && nodesTemp.indexOf(node) < 0 && item !== null)) {
|
|
654
657
|
nodesTemp.push(node);
|
|
655
658
|
}
|
|
659
|
+
if (isNOU(item) && (node.tagName === tagName ||
|
|
660
|
+
((node.tagName === 'UL' || node.tagName === 'OL') && node.hasAttribute('style')))) {
|
|
661
|
+
if (node.hasAttribute('style')) {
|
|
662
|
+
node.removeAttribute('style');
|
|
663
|
+
}
|
|
664
|
+
}
|
|
656
665
|
}
|
|
657
666
|
for (var j = nodesTemp.length - 1; j >= 0; j--) {
|
|
658
667
|
var h = nodesTemp[j];
|
|
@@ -755,7 +764,8 @@ var Lists = /** @class */ (function () {
|
|
|
755
764
|
}
|
|
756
765
|
}
|
|
757
766
|
if (element.parentNode.insertBefore(this.closeTag(parentNode.tagName), element),
|
|
758
|
-
'LI' === parentNode.parentNode.tagName
|
|
767
|
+
'LI' === parentNode.parentNode.tagName || 'OL' === parentNode.parentNode.tagName ||
|
|
768
|
+
'UL' === parentNode.parentNode.tagName) {
|
|
759
769
|
element.parentNode.insertBefore(this.closeTag('LI'), element);
|
|
760
770
|
}
|
|
761
771
|
else {
|
|
@@ -9,6 +9,7 @@ import { UndoRedoCommands } from './../plugin/undo';
|
|
|
9
9
|
import { MDLink } from './../plugin/link';
|
|
10
10
|
import { MDTable } from './../plugin/table';
|
|
11
11
|
import { ClearFormat } from './../plugin/clearformat';
|
|
12
|
+
import { MDInsertText } from './../plugin/insert-text';
|
|
12
13
|
/**
|
|
13
14
|
* MarkdownParser internal component
|
|
14
15
|
*
|
|
@@ -35,6 +36,7 @@ export declare class MarkdownParser {
|
|
|
35
36
|
linkObj: MDLink;
|
|
36
37
|
tableObj: MDTable;
|
|
37
38
|
clearObj: ClearFormat;
|
|
39
|
+
insertTextObj: MDInsertText;
|
|
38
40
|
/**
|
|
39
41
|
* Constructor for creating the component
|
|
40
42
|
*
|
|
@@ -11,6 +11,7 @@ import { MDLink } from './../plugin/link';
|
|
|
11
11
|
import { MDTable } from './../plugin/table';
|
|
12
12
|
import * as EVENTS from './../../common/constant';
|
|
13
13
|
import { ClearFormat } from './../plugin/clearformat';
|
|
14
|
+
import { MDInsertText } from './../plugin/insert-text';
|
|
14
15
|
/**
|
|
15
16
|
* MarkdownParser internal component
|
|
16
17
|
*
|
|
@@ -37,6 +38,7 @@ var MarkdownParser = /** @class */ (function () {
|
|
|
37
38
|
this.linkObj = new MDLink(this);
|
|
38
39
|
this.tableObj = new MDTable({ parent: this, syntaxTag: ({ Formats: this.formatTags, List: this.listTags }) });
|
|
39
40
|
this.clearObj = new ClearFormat(this);
|
|
41
|
+
this.insertTextObj = new MDInsertText(this);
|
|
40
42
|
this.wireEvents();
|
|
41
43
|
}
|
|
42
44
|
MarkdownParser.prototype.initialize = function () {
|
|
@@ -103,6 +105,10 @@ var MarkdownParser = /** @class */ (function () {
|
|
|
103
105
|
case 'clear':
|
|
104
106
|
this.observer.notify(CONSTANT.CLEAR_COMMAND, { subCommand: value, event: event, callBack: callBack });
|
|
105
107
|
break;
|
|
108
|
+
case 'inserttext':
|
|
109
|
+
this.observer.notify(CONSTANT.INSERT_TEXT_COMMAND, { subCommand: value, event: event, callBack: callBack,
|
|
110
|
+
value: { text: exeValue } });
|
|
111
|
+
break;
|
|
106
112
|
}
|
|
107
113
|
};
|
|
108
114
|
return MarkdownParser;
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @hidden
|
|
5
5
|
|
|
6
6
|
*/
|
|
7
|
-
export declare type MarkdownExecCommand = 'Indents' | 'Lists' | 'Formats' | 'Alignments' | 'Style' | 'Effects' | 'Casing' | 'Actions' | 'table' | 'Links' | 'Images' | 'Clear';
|
|
7
|
+
export declare type MarkdownExecCommand = 'Indents' | 'Lists' | 'Formats' | 'Alignments' | 'Style' | 'Effects' | 'Casing' | 'Actions' | 'table' | 'Links' | 'Images' | 'Clear' | 'Inserttext';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MarkdownParser } from './../base/markdown-parser';
|
|
2
|
+
/**
|
|
3
|
+
* Link internal component
|
|
4
|
+
*
|
|
5
|
+
* @hidden
|
|
6
|
+
|
|
7
|
+
*/
|
|
8
|
+
export declare class MDInsertText {
|
|
9
|
+
private parent;
|
|
10
|
+
private selection;
|
|
11
|
+
/**
|
|
12
|
+
* Constructor for creating the insert text plugin
|
|
13
|
+
*
|
|
14
|
+
* @param {MarkdownParser} parent - specifies the parent element
|
|
15
|
+
* @hidden
|
|
16
|
+
|
|
17
|
+
*/
|
|
18
|
+
constructor(parent: MarkdownParser);
|
|
19
|
+
private addEventListener;
|
|
20
|
+
private InsertTextExec;
|
|
21
|
+
private restore;
|
|
22
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as CONSTANT from './../base/constant';
|
|
2
|
+
/**
|
|
3
|
+
* Link internal component
|
|
4
|
+
*
|
|
5
|
+
* @hidden
|
|
6
|
+
|
|
7
|
+
*/
|
|
8
|
+
var MDInsertText = /** @class */ (function () {
|
|
9
|
+
/**
|
|
10
|
+
* Constructor for creating the insert text plugin
|
|
11
|
+
*
|
|
12
|
+
* @param {MarkdownParser} parent - specifies the parent element
|
|
13
|
+
* @hidden
|
|
14
|
+
|
|
15
|
+
*/
|
|
16
|
+
function MDInsertText(parent) {
|
|
17
|
+
this.parent = parent;
|
|
18
|
+
this.selection = this.parent.markdownSelection;
|
|
19
|
+
this.addEventListener();
|
|
20
|
+
}
|
|
21
|
+
MDInsertText.prototype.addEventListener = function () {
|
|
22
|
+
this.parent.observer.on(CONSTANT.INSERT_TEXT_COMMAND, this.InsertTextExec, this);
|
|
23
|
+
};
|
|
24
|
+
MDInsertText.prototype.InsertTextExec = function (e) {
|
|
25
|
+
var textArea = this.parent.element;
|
|
26
|
+
textArea.focus();
|
|
27
|
+
var start = textArea.selectionStart;
|
|
28
|
+
var end = textArea.selectionEnd;
|
|
29
|
+
var text = e.value.text;
|
|
30
|
+
var startOffset = start + text.length;
|
|
31
|
+
var endOffset = end + text.length;
|
|
32
|
+
textArea.value = textArea.value.substr(0, start)
|
|
33
|
+
+ text + textArea.value.substr(end, textArea.value.length);
|
|
34
|
+
this.parent.markdownSelection.setSelection(textArea, startOffset, endOffset);
|
|
35
|
+
this.restore(textArea, startOffset, endOffset, e);
|
|
36
|
+
};
|
|
37
|
+
MDInsertText.prototype.restore = function (textArea, start, end, event) {
|
|
38
|
+
this.selection.save(start, end);
|
|
39
|
+
this.selection.restore(textArea);
|
|
40
|
+
if (event && event.callBack) {
|
|
41
|
+
event.callBack({
|
|
42
|
+
requestType: event.subCommand,
|
|
43
|
+
selectedText: this.selection.getSelectedText(textArea),
|
|
44
|
+
editorMode: 'Markdown',
|
|
45
|
+
event: event.event
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return MDInsertText;
|
|
50
|
+
}());
|
|
51
|
+
export { MDInsertText };
|
|
@@ -47,10 +47,18 @@ var ColorPickerInput = /** @class */ (function () {
|
|
|
47
47
|
var fontNode = _this.parent.createElement('input');
|
|
48
48
|
fontNode.id = targetID;
|
|
49
49
|
fontNode.classList.add(classes.CLS_FONT_COLOR_TARGET);
|
|
50
|
+
if (!isNullOrUndefined(_this.parent.cssClass)) {
|
|
51
|
+
var allClassName = _this.parent.cssClass.split(' ');
|
|
52
|
+
for (var i = 0; i < allClassName.length; i++) {
|
|
53
|
+
if (allClassName[i].trim() !== '') {
|
|
54
|
+
fontNode.classList.add(allClassName[i]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
50
58
|
document.body.appendChild(fontNode);
|
|
51
59
|
options = {
|
|
52
60
|
cssClass: _this.tools[item.toLocaleLowerCase()].icon
|
|
53
|
-
+ ' ' + classes.CLS_RTE_ELEMENTS + ' ' + classes.CLS_ICONS,
|
|
61
|
+
+ ' ' + classes.CLS_RTE_ELEMENTS + ' ' + classes.CLS_ICONS + ' ' + _this.parent.cssClass,
|
|
54
62
|
value: _this.tools[item.toLocaleLowerCase()].value,
|
|
55
63
|
command: _this.tools[item.toLocaleLowerCase()].command,
|
|
56
64
|
subCommand: _this.tools[item.toLocaleLowerCase()].subCommand,
|
|
@@ -66,10 +74,18 @@ var ColorPickerInput = /** @class */ (function () {
|
|
|
66
74
|
var backNode = _this.parent.createElement('input');
|
|
67
75
|
backNode.id = targetID;
|
|
68
76
|
backNode.classList.add(classes.CLS_BACKGROUND_COLOR_TARGET);
|
|
77
|
+
if (!isNullOrUndefined(_this.parent.cssClass)) {
|
|
78
|
+
var allClassName = _this.parent.cssClass.split(' ');
|
|
79
|
+
for (var i = 0; i < allClassName.length; i++) {
|
|
80
|
+
if (allClassName[i].trim() !== '') {
|
|
81
|
+
backNode.classList.add(allClassName[i]);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
69
85
|
document.body.appendChild(backNode);
|
|
70
86
|
options = {
|
|
71
87
|
cssClass: _this.tools[item.toLocaleLowerCase()].icon
|
|
72
|
-
+ ' ' + classes.CLS_RTE_ELEMENTS + ' ' + classes.CLS_ICONS,
|
|
88
|
+
+ ' ' + classes.CLS_RTE_ELEMENTS + ' ' + classes.CLS_ICONS + ' ' + _this.parent.cssClass,
|
|
73
89
|
value: _this.tools[item.toLocaleLowerCase()].value,
|
|
74
90
|
command: _this.tools[item.toLocaleLowerCase()].command,
|
|
75
91
|
subCommand: _this.tools[item.toLocaleLowerCase()].subCommand,
|
|
@@ -142,8 +158,8 @@ var ColorPickerInput = /** @class */ (function () {
|
|
|
142
158
|
dropDownObj.setProperties({ cssClass: (dropDownObj.cssClass + ' ' + e.cssClass).trim() });
|
|
143
159
|
}
|
|
144
160
|
else {
|
|
145
|
-
colorPickerObj.setProperties({ cssClass: (colorPickerObj.cssClass.replace(e.oldCssClass, '').trim() + ' ' + e.cssClass).trim() });
|
|
146
|
-
dropDownObj.setProperties({ cssClass: (dropDownObj.cssClass.replace(e.oldCssClass, '').trim() + ' ' + e.cssClass).trim() });
|
|
161
|
+
colorPickerObj.setProperties({ cssClass: (colorPickerObj.cssClass.replace(e.oldCssClass, '').replace(' ', ' ').trim() + ' ' + e.cssClass).trim() });
|
|
162
|
+
dropDownObj.setProperties({ cssClass: (dropDownObj.cssClass.replace(e.oldCssClass, '').replace(' ', ' ').trim() + ' ' + e.cssClass).trim() });
|
|
147
163
|
}
|
|
148
164
|
}
|
|
149
165
|
};
|
|
@@ -42,7 +42,8 @@ var FullScreen = /** @class */ (function () {
|
|
|
42
42
|
}
|
|
43
43
|
_this.parent.element.classList.add(classes.CLS_FULL_SCREEN);
|
|
44
44
|
_this.toggleParentOverflow(true);
|
|
45
|
-
_this.parent.
|
|
45
|
+
var isExpand = _this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
46
|
+
_this.parent.setContentHeight(null, isExpand);
|
|
46
47
|
if (_this.parent.toolbarModule) {
|
|
47
48
|
if (!_this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
|
|
48
49
|
_this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
|
|
@@ -89,7 +90,8 @@ var FullScreen = /** @class */ (function () {
|
|
|
89
90
|
for (var i = 0; i < elem.length; i++) {
|
|
90
91
|
removeClass([elem[i]], ['e-rte-overflow']);
|
|
91
92
|
}
|
|
92
|
-
_this.parent.
|
|
93
|
+
var isExpand = _this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
94
|
+
_this.parent.setContentHeight(null, isExpand);
|
|
93
95
|
if (_this.parent.toolbarModule) {
|
|
94
96
|
if (!_this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
|
|
95
97
|
_this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
|
|
@@ -17,9 +17,10 @@ var Resize = /** @class */ (function () {
|
|
|
17
17
|
this.parent.on(events.destroy, this.destroy, this);
|
|
18
18
|
};
|
|
19
19
|
Resize.prototype.renderResizable = function () {
|
|
20
|
+
var enableRtlClass = (this.parent.enableRtl) ? classes.CLS_RTE_RES_WEST : classes.CLS_RTE_RES_EAST;
|
|
20
21
|
this.resizer = this.parent.createElement('div', {
|
|
21
22
|
id: this.parent.getID() + '-resizable', className: 'e-icons'
|
|
22
|
-
+ ' ' + classes.CLS_RTE_RES_HANDLE + ' ' +
|
|
23
|
+
+ ' ' + classes.CLS_RTE_RES_HANDLE + ' ' + enableRtlClass
|
|
23
24
|
});
|
|
24
25
|
this.parent.element.classList.add(classes.CLS_RTE_RES_CNT);
|
|
25
26
|
this.parent.element.appendChild(this.resizer);
|
|
@@ -52,12 +53,12 @@ var Resize = /** @class */ (function () {
|
|
|
52
53
|
var boundRect = this.parent.element.getBoundingClientRect();
|
|
53
54
|
if (this.isMouseEvent(e)) {
|
|
54
55
|
this.parent.element.style.height = e.clientY - boundRect.top + 'px';
|
|
55
|
-
this.parent.element.style.width = e.clientX - boundRect.left + 'px';
|
|
56
|
+
this.parent.element.style.width = (!this.parent.enableRtl) ? e.clientX - boundRect.left + 'px' : boundRect.right - e.clientX + 'px';
|
|
56
57
|
}
|
|
57
58
|
else {
|
|
58
59
|
var eventType = Browser.info.name !== 'msie' ? e.touches[0] : e;
|
|
59
60
|
this.parent.element.style.height = eventType.clientY - boundRect.top + 'px';
|
|
60
|
-
this.parent.element.style.width =
|
|
61
|
+
this.parent.element.style.width = (!this.parent.enableRtl) ? e.clientX - boundRect.left + 'px' : boundRect.right - e.clientX + 'px';
|
|
61
62
|
}
|
|
62
63
|
if (!this.parent.toolbarSettings.enable) {
|
|
63
64
|
this.parent.setContentHeight('', false);
|