@syncfusion/ej2-richtexteditor 24.1.41-569421 → 24.1.41-581025
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 +0 -176
- 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 +7822 -9502
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +5674 -7355
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/package.json +12 -12
- package/src/common/config.d.ts +0 -7
- package/src/common/config.js +0 -11
- package/src/common/constant.d.ts +0 -6
- package/src/common/constant.js +0 -6
- package/src/common/interface.d.ts +0 -12
- package/src/common/types.d.ts +0 -6
- package/src/common/util.d.ts +0 -6
- package/src/common/util.js +20 -61
- package/src/editor-manager/base/constant.d.ts +0 -6
- package/src/editor-manager/base/constant.js +0 -6
- package/src/editor-manager/base/editor-manager.d.ts +0 -5
- package/src/editor-manager/base/editor-manager.js +0 -59
- package/src/editor-manager/base/interface.d.ts +0 -8
- package/src/editor-manager/plugin/dom-node.d.ts +1 -5
- package/src/editor-manager/plugin/dom-node.js +15 -169
- package/src/editor-manager/plugin/format-painter-actions.d.ts +0 -1
- package/src/editor-manager/plugin/format-painter-actions.js +1 -19
- package/src/editor-manager/plugin/formats.d.ts +0 -1
- package/src/editor-manager/plugin/formats.js +3 -38
- package/src/editor-manager/plugin/image.js +16 -12
- package/src/editor-manager/plugin/indents.js +1 -1
- package/src/editor-manager/plugin/inserthtml.d.ts +0 -1
- package/src/editor-manager/plugin/inserthtml.js +18 -78
- package/src/editor-manager/plugin/link.js +3 -8
- package/src/editor-manager/plugin/lists.js +70 -159
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +0 -3
- package/src/editor-manager/plugin/ms-word-clean-up.js +85 -212
- package/src/editor-manager/plugin/nodecutter.js +2 -5
- package/src/editor-manager/plugin/selection-commands.d.ts +0 -2
- package/src/editor-manager/plugin/selection-commands.js +4 -209
- package/src/editor-manager/plugin/table.d.ts +1 -4
- package/src/editor-manager/plugin/table.js +49 -95
- package/src/editor-manager/plugin/toolbar-status.d.ts +2 -2
- package/src/editor-manager/plugin/toolbar-status.js +10 -20
- package/src/editor-manager/plugin/undo.d.ts +0 -1
- package/src/editor-manager/plugin/undo.js +1 -21
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +3 -4
- package/src/rich-text-editor/actions/base-quick-toolbar.js +10 -43
- package/src/rich-text-editor/actions/base-toolbar.js +34 -33
- package/src/rich-text-editor/actions/color-picker.d.ts +0 -1
- package/src/rich-text-editor/actions/color-picker.js +0 -10
- package/src/rich-text-editor/actions/count.js +1 -1
- package/src/rich-text-editor/actions/dropdown-buttons.d.ts +0 -1
- package/src/rich-text-editor/actions/dropdown-buttons.js +4 -8
- package/src/rich-text-editor/actions/emoji-picker.js +4 -4
- package/src/rich-text-editor/actions/enter-key.js +4 -8
- package/src/rich-text-editor/actions/format-painter.js +1 -4
- package/src/rich-text-editor/actions/full-screen.js +2 -3
- package/src/rich-text-editor/actions/html-editor.d.ts +2 -2
- package/src/rich-text-editor/actions/html-editor.js +42 -123
- package/src/rich-text-editor/actions/keyboard.js +1 -3
- package/src/rich-text-editor/actions/markdown-editor.js +1 -3
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +0 -3
- package/src/rich-text-editor/actions/paste-clean-up.js +14 -85
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +0 -8
- package/src/rich-text-editor/actions/quick-toolbar.js +9 -37
- package/src/rich-text-editor/actions/resize.js +1 -2
- package/src/rich-text-editor/actions/toolbar-action.js +1 -1
- package/src/rich-text-editor/actions/toolbar.d.ts +3 -2
- package/src/rich-text-editor/actions/toolbar.js +87 -18
- 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 +0 -40
- package/src/rich-text-editor/base/constant.js +0 -209
- package/src/rich-text-editor/base/interface.d.ts +3 -37
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +3 -3
- package/src/rich-text-editor/base/rich-text-editor.d.ts +4 -7
- package/src/rich-text-editor/base/rich-text-editor.js +132 -156
- package/src/rich-text-editor/base/util.js +2 -11
- package/src/rich-text-editor/formatter/formatter.js +4 -16
- package/src/rich-text-editor/models/default-locale.js +26 -30
- package/src/rich-text-editor/models/items.js +2 -2
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.js +1 -1
- package/src/rich-text-editor/renderer/audio-module.d.ts +0 -1
- package/src/rich-text-editor/renderer/audio-module.js +4 -22
- package/src/rich-text-editor/renderer/dialog-renderer.d.ts +0 -2
- package/src/rich-text-editor/renderer/dialog-renderer.js +1 -12
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -2
- package/src/rich-text-editor/renderer/image-module.d.ts +1 -9
- package/src/rich-text-editor/renderer/image-module.js +168 -203
- package/src/rich-text-editor/renderer/link-module.js +1 -10
- package/src/rich-text-editor/renderer/table-module.d.ts +1 -8
- package/src/rich-text-editor/renderer/table-module.js +139 -301
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +0 -3
- package/src/rich-text-editor/renderer/toolbar-renderer.js +9 -94
- package/src/rich-text-editor/renderer/video-module.d.ts +0 -3
- package/src/rich-text-editor/renderer/video-module.js +41 -82
- package/src/rich-text-editor/renderer/view-source.d.ts +0 -1
- package/src/rich-text-editor/renderer/view-source.js +4 -12
- package/src/selection/selection.js +0 -3
- package/styles/bootstrap-dark.css +53 -161
- package/styles/bootstrap.css +61 -162
- package/styles/bootstrap4.css +46 -146
- package/styles/bootstrap5-dark.css +46 -151
- package/styles/bootstrap5.css +46 -151
- package/styles/fabric-dark.css +40 -140
- package/styles/fabric.css +41 -141
- package/styles/fluent-dark.css +47 -165
- package/styles/fluent.css +47 -165
- package/styles/highcontrast-light.css +40 -140
- package/styles/highcontrast.css +41 -144
- package/styles/material-dark.css +41 -145
- package/styles/material.css +41 -145
- package/styles/material3-dark.css +50 -156
- package/styles/material3.css +50 -156
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +13 -17
- package/styles/rich-text-editor/_bootstrap-definition.scss +19 -22
- package/styles/rich-text-editor/_bootstrap4-definition.scss +7 -11
- package/styles/rich-text-editor/_bootstrap5-definition.scss +3 -7
- package/styles/rich-text-editor/_fabric-dark-definition.scss +2 -6
- package/styles/rich-text-editor/_fabric-definition.scss +3 -7
- package/styles/rich-text-editor/_fluent-definition.scss +9 -13
- package/styles/rich-text-editor/_fusionnew-definition.scss +3 -7
- package/styles/rich-text-editor/_highcontrast-definition.scss +3 -7
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +2 -6
- package/styles/rich-text-editor/_layout.scss +31 -133
- package/styles/rich-text-editor/_material-dark-definition.scss +2 -6
- package/styles/rich-text-editor/_material-definition.scss +2 -6
- package/styles/rich-text-editor/_material3-definition.scss +12 -16
- package/styles/rich-text-editor/_tailwind-definition.scss +19 -23
- package/styles/rich-text-editor/_theme.scss +23 -112
- package/styles/rich-text-editor/bootstrap-dark.css +53 -161
- package/styles/rich-text-editor/bootstrap.css +61 -162
- package/styles/rich-text-editor/bootstrap4.css +46 -146
- package/styles/rich-text-editor/bootstrap5-dark.css +46 -151
- package/styles/rich-text-editor/bootstrap5.css +46 -151
- package/styles/rich-text-editor/fabric-dark.css +40 -140
- package/styles/rich-text-editor/fabric.css +41 -141
- package/styles/rich-text-editor/fluent-dark.css +47 -165
- package/styles/rich-text-editor/fluent.css +47 -165
- package/styles/rich-text-editor/highcontrast-light.css +40 -140
- package/styles/rich-text-editor/highcontrast.css +41 -144
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +2 -2
- package/styles/rich-text-editor/icons/_bootstrap.scss +2 -2
- package/styles/rich-text-editor/icons/_bootstrap4.scss +2 -2
- package/styles/rich-text-editor/icons/_bootstrap5.scss +2 -2
- package/styles/rich-text-editor/icons/_fabric-dark.scss +2 -2
- package/styles/rich-text-editor/icons/_fabric.scss +2 -2
- package/styles/rich-text-editor/icons/_fluent.scss +2 -2
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +2 -2
- package/styles/rich-text-editor/icons/_highcontrast.scss +2 -2
- package/styles/rich-text-editor/icons/_material-dark.scss +2 -2
- package/styles/rich-text-editor/icons/_material.scss +2 -2
- package/styles/rich-text-editor/icons/_material3.scss +2 -2
- package/styles/rich-text-editor/icons/_tailwind.scss +2 -2
- package/styles/rich-text-editor/material-dark.css +41 -145
- package/styles/rich-text-editor/material.css +41 -145
- package/styles/rich-text-editor/material3-dark.css +50 -156
- package/styles/rich-text-editor/material3.css +50 -156
- package/styles/rich-text-editor/tailwind-dark.css +63 -191
- package/styles/rich-text-editor/tailwind.css +63 -191
- package/styles/tailwind-dark.css +63 -191
- package/styles/tailwind.css +63 -191
- package/.eslintrc.json +0 -260
- package/src/global.d.ts +0 -1
- package/styles/rich-text-editor/_bds-definition.scss +0 -279
- package/styles/rich-text-editor/icons/_bds.scss +0 -348
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-richtexteditor@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-richtexteditor@
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@23.1.53",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-tB7WAmGNNbrQpGA3CqujRthIZdrsIWUwzNgUwtPIF0jcUlCRthnZbbPbV7SJ4pbfzwZJLoIE6qFsWt36HnVLNg==",
|
|
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.syncfusion.com/repository/ej2-
|
|
29
|
-
"_shasum": "
|
|
28
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-23.1.53.tgz",
|
|
29
|
+
"_shasum": "43db30cc27624e6357af8b3ae8d9fd955e04cef8",
|
|
30
30
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
31
31
|
"_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
|
|
32
32
|
"author": {
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
},
|
|
38
38
|
"bundleDependencies": false,
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@syncfusion/ej2-base": "24.1.41",
|
|
41
|
-
"@syncfusion/ej2-buttons": "24.1.41",
|
|
42
|
-
"@syncfusion/ej2-filemanager": "24.1.41",
|
|
43
|
-
"@syncfusion/ej2-inputs": "24.1.41",
|
|
44
|
-
"@syncfusion/ej2-navigations": "24.1.41",
|
|
45
|
-
"@syncfusion/ej2-popups": "24.1.41",
|
|
46
|
-
"@syncfusion/ej2-splitbuttons": "24.1.41"
|
|
40
|
+
"@syncfusion/ej2-base": "~24.1.41",
|
|
41
|
+
"@syncfusion/ej2-buttons": "~24.1.41",
|
|
42
|
+
"@syncfusion/ej2-filemanager": "~24.1.41",
|
|
43
|
+
"@syncfusion/ej2-inputs": "~24.1.41",
|
|
44
|
+
"@syncfusion/ej2-navigations": "~24.1.41",
|
|
45
|
+
"@syncfusion/ej2-popups": "~24.1.41",
|
|
46
|
+
"@syncfusion/ej2-splitbuttons": "~24.1.41"
|
|
47
47
|
},
|
|
48
48
|
"deprecated": false,
|
|
49
49
|
"description": "Essential JS 2 RichTextEditor component",
|
|
@@ -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.1.41-
|
|
72
|
+
"version": "24.1.41-581025",
|
|
73
73
|
"sideEffects": false
|
|
74
74
|
}
|
package/src/common/config.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IImageResizeFactor } from "./interface";
|
|
2
1
|
/**
|
|
3
2
|
* Default Markdown formats config for adapter
|
|
4
3
|
*/
|
|
@@ -47,9 +46,3 @@ export declare const listConversionFilters: {
|
|
|
47
46
|
* @hidden
|
|
48
47
|
*/
|
|
49
48
|
export declare const selfClosingTags: string[];
|
|
50
|
-
/**
|
|
51
|
-
* Resize factor for image.
|
|
52
|
-
* @hidden
|
|
53
|
-
*
|
|
54
|
-
*/
|
|
55
|
-
export declare const imageResizeFactor: IImageResizeFactor;
|
package/src/common/config.js
CHANGED
|
@@ -128,14 +128,3 @@ export var selfClosingTags = [
|
|
|
128
128
|
'BR',
|
|
129
129
|
'IMG'
|
|
130
130
|
];
|
|
131
|
-
/**
|
|
132
|
-
* Resize factor for image.
|
|
133
|
-
* @hidden
|
|
134
|
-
*
|
|
135
|
-
*/
|
|
136
|
-
export var imageResizeFactor = {
|
|
137
|
-
topLeft: [-1, -1],
|
|
138
|
-
topRight: [1, -1],
|
|
139
|
-
botRight: [1, 1],
|
|
140
|
-
botLeft: [-1, 1]
|
|
141
|
-
};
|
package/src/common/constant.d.ts
CHANGED
package/src/common/constant.js
CHANGED
|
@@ -77,15 +77,3 @@ export interface IToolbarStatus {
|
|
|
77
77
|
numberFormatList?: string | boolean;
|
|
78
78
|
bulletFormatList?: string | boolean;
|
|
79
79
|
}
|
|
80
|
-
/**
|
|
81
|
-
* @deprecated
|
|
82
|
-
* @private
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* */
|
|
86
|
-
export interface IImageResizeFactor {
|
|
87
|
-
topLeft: [number, number];
|
|
88
|
-
topRight: [number, number];
|
|
89
|
-
botLeft: [number, number];
|
|
90
|
-
botRight: [number, number];
|
|
91
|
-
}
|
package/src/common/types.d.ts
CHANGED
|
@@ -18,9 +18,3 @@ export declare type EnterKey = 'P' | 'DIV' | 'BR';
|
|
|
18
18
|
* Defines tag to be used when shift + enter key is pressed.
|
|
19
19
|
*/
|
|
20
20
|
export declare type ShiftEnterKey = 'P' | 'DIV' | 'BR';
|
|
21
|
-
/**
|
|
22
|
-
* Defines the types of action to be used in the Rich Text Editor.
|
|
23
|
-
* @hidden
|
|
24
|
-
* @private
|
|
25
|
-
*/
|
|
26
|
-
export declare type ContentHeightSource = 'SourceCode' | 'Init' | 'Preview' | 'Maximize' | 'Minimize' | 'WindowResize' | 'Toolbar' | 'Resize' | 'Refresh';
|
package/src/common/util.d.ts
CHANGED
|
@@ -34,9 +34,3 @@ export declare function getDefaultHtmlTbStatus(): IToolbarStatus;
|
|
|
34
34
|
* @hidden
|
|
35
35
|
*/
|
|
36
36
|
export declare function getDefaultMDTbStatus(): IToolbarStatus;
|
|
37
|
-
/**
|
|
38
|
-
* @param {Range} range - specifies the range
|
|
39
|
-
* @returns {void}
|
|
40
|
-
* @hidden
|
|
41
|
-
*/
|
|
42
|
-
export declare function nestedListCleanUp(range: Range): void;
|
package/src/common/util.js
CHANGED
|
@@ -82,47 +82,33 @@ export function updateTextNode(value, enterAction) {
|
|
|
82
82
|
}
|
|
83
83
|
var tableElm = resultElm.querySelectorAll('table');
|
|
84
84
|
for (var i = 0; i < tableElm.length; i++) {
|
|
85
|
-
if (tableElm[i].
|
|
86
|
-
tableElm[i].
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
if (tableElm[i].getAttribute('border') === '0') {
|
|
86
|
+
tableElm[i].removeAttribute('border');
|
|
87
|
+
}
|
|
88
|
+
var tdElm = tableElm[i].querySelectorAll('td');
|
|
89
|
+
for (var j = 0; j < tdElm.length; j++) {
|
|
90
|
+
if (tdElm[j].style.borderLeft === 'none') {
|
|
91
|
+
tdElm[j].style.removeProperty('border-left');
|
|
90
92
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
tdElm[j].style.removeProperty('border-left');
|
|
100
|
-
}
|
|
101
|
-
if (tdElm[j].style.borderRight === 'none') {
|
|
102
|
-
tdElm[j].style.removeProperty('border-right');
|
|
103
|
-
}
|
|
104
|
-
if (tdElm[j].style.borderBottom === 'none') {
|
|
105
|
-
tdElm[j].style.removeProperty('border-bottom');
|
|
106
|
-
}
|
|
107
|
-
if (tdElm[j].style.borderTop === 'none') {
|
|
108
|
-
tdElm[j].style.removeProperty('border-top');
|
|
109
|
-
}
|
|
110
|
-
if (tdElm[j].style.border === 'none') {
|
|
111
|
-
tdElm[j].style.removeProperty('border');
|
|
112
|
-
}
|
|
113
|
-
}
|
|
93
|
+
if (tdElm[j].style.borderRight === 'none') {
|
|
94
|
+
tdElm[j].style.removeProperty('border-right');
|
|
95
|
+
}
|
|
96
|
+
if (tdElm[j].style.borderBottom === 'none') {
|
|
97
|
+
tdElm[j].style.removeProperty('border-bottom');
|
|
98
|
+
}
|
|
99
|
+
if (tdElm[j].style.borderTop === 'none') {
|
|
100
|
+
tdElm[j].style.removeProperty('border-top');
|
|
114
101
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
continue;
|
|
102
|
+
if (tdElm[j].style.border === 'none') {
|
|
103
|
+
tdElm[j].style.removeProperty('border');
|
|
118
104
|
}
|
|
119
105
|
}
|
|
106
|
+
if (!tableElm[i].classList.contains('e-rte-table')) {
|
|
107
|
+
tableElm[i].classList.add('e-rte-table');
|
|
108
|
+
}
|
|
120
109
|
}
|
|
121
110
|
var imageElm = resultElm.querySelectorAll('img');
|
|
122
111
|
for (var i = 0; i < imageElm.length; i++) {
|
|
123
|
-
if (imageElm[i].classList.contains('e-rte-image-unsupported')) {
|
|
124
|
-
continue; // Should not add the class if the image is Broken.
|
|
125
|
-
}
|
|
126
112
|
if (!imageElm[i].classList.contains('e-rte-image')) {
|
|
127
113
|
imageElm[i].classList.add('e-rte-image');
|
|
128
114
|
}
|
|
@@ -193,30 +179,3 @@ export function getDefaultMDTbStatus() {
|
|
|
193
179
|
formats: null
|
|
194
180
|
};
|
|
195
181
|
}
|
|
196
|
-
/**
|
|
197
|
-
* @param {Range} range - specifies the range
|
|
198
|
-
* @returns {void}
|
|
199
|
-
* @hidden
|
|
200
|
-
*/
|
|
201
|
-
export function nestedListCleanUp(range) {
|
|
202
|
-
if (range.startContainer.parentElement.closest('ol,ul') !== null && range.endContainer.parentElement.closest('ol,ul') !== null) {
|
|
203
|
-
range.extractContents();
|
|
204
|
-
while ((range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll('li :empty').length > 0 ||
|
|
205
|
-
(range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll('ol :empty').length > 0) {
|
|
206
|
-
var emptyLI = (range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll('li :empty');
|
|
207
|
-
if (emptyLI.length > 0) {
|
|
208
|
-
emptyLI.forEach(function (item) {
|
|
209
|
-
item.remove();
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
var liElem = (range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll("li");
|
|
214
|
-
if (liElem.length > 0) {
|
|
215
|
-
liElem.forEach(function (item) {
|
|
216
|
-
if (item.firstChild.nodeName === "OL" || item.firstChild.nodeName === "UL") {
|
|
217
|
-
item.style.listStyleType = "none";
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
@@ -87,9 +87,3 @@ export var CLEAR_TYPE = 'clear-type';
|
|
|
87
87
|
* @hidden
|
|
88
88
|
*/
|
|
89
89
|
export var SELF_CLOSING_TAGS = ['area', 'base', 'br', 'embed', 'hr', 'img', 'input', 'param', 'source', 'track', 'wbr', 'iframe', 'td', 'table'];
|
|
90
|
-
/**
|
|
91
|
-
* Source
|
|
92
|
-
*
|
|
93
|
-
* @hidden
|
|
94
|
-
*/
|
|
95
|
-
export var PASTE_SOURCE = ['word', 'excel', 'onenote'];
|
|
@@ -79,9 +79,4 @@ export declare class EditorManager {
|
|
|
79
79
|
* @deprecated
|
|
80
80
|
*/
|
|
81
81
|
execCommand<T>(command: ExecCommand, value: T, event?: Event, callBack?: Function, text?: string | Node, exeValue?: T, selector?: string, enterAction?: string): void;
|
|
82
|
-
private editorMouseDown;
|
|
83
|
-
private tripleClickSelection;
|
|
84
|
-
private getParentBlockNode;
|
|
85
|
-
private getLastTextNode;
|
|
86
|
-
private getFirstTextNode;
|
|
87
82
|
}
|
|
@@ -68,7 +68,6 @@ var EditorManager = /** @class */ (function () {
|
|
|
68
68
|
this.observer.on(EVENTS.MODEL_CHANGED, this.onPropertyChanged, this);
|
|
69
69
|
this.observer.on(EVENTS.MS_WORD_CLEANUP, this.onWordPaste, this);
|
|
70
70
|
this.observer.on(EVENTS.ON_BEGIN, this.onBegin, this);
|
|
71
|
-
this.observer.on(EVENTS.MOUSE_DOWN, this.editorMouseDown, this);
|
|
72
71
|
};
|
|
73
72
|
EditorManager.prototype.onWordPaste = function (e) {
|
|
74
73
|
this.observer.notify(EVENTS.MS_WORD_CLEANUP_PLUGIN, e);
|
|
@@ -212,64 +211,6 @@ var EditorManager = /** @class */ (function () {
|
|
|
212
211
|
event: event, callBack: callBack });
|
|
213
212
|
}
|
|
214
213
|
};
|
|
215
|
-
EditorManager.prototype.editorMouseDown = function (e) {
|
|
216
|
-
if (e.args.detail === 3) {
|
|
217
|
-
this.tripleClickSelection(e.args);
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
EditorManager.prototype.tripleClickSelection = function (e) {
|
|
221
|
-
var range = this.nodeSelection.getRange(this.currentDocument);
|
|
222
|
-
var selection = this.nodeSelection.get(this.currentDocument);
|
|
223
|
-
if (selection.rangeCount > 0 && selection.toString() !== '') {
|
|
224
|
-
var startBlockNode = this.getParentBlockNode(range.startContainer);
|
|
225
|
-
var endBlockNode = this.getParentBlockNode(range.endContainer);
|
|
226
|
-
if (startBlockNode && endBlockNode && startBlockNode === endBlockNode) {
|
|
227
|
-
var newRange = this.currentDocument.createRange();
|
|
228
|
-
var startTextNode = this.getFirstTextNode(startBlockNode);
|
|
229
|
-
var endTextNode = this.getLastTextNode(endBlockNode);
|
|
230
|
-
if (startTextNode && endTextNode) {
|
|
231
|
-
newRange.setStart(startTextNode, 0);
|
|
232
|
-
newRange.setEnd(endTextNode, endTextNode.textContent.length);
|
|
233
|
-
this.nodeSelection.setRange(this.currentDocument, newRange);
|
|
234
|
-
e.preventDefault();
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
EditorManager.prototype.getParentBlockNode = function (node) {
|
|
240
|
-
var treeWalker = this.currentDocument.createTreeWalker(this.editableElement, // root
|
|
241
|
-
NodeFilter.SHOW_ELEMENT, // whatToShow
|
|
242
|
-
{
|
|
243
|
-
acceptNode: function (currentNode) {
|
|
244
|
-
// Check if the node is a block element
|
|
245
|
-
var displayStyle = window.getComputedStyle(currentNode).display;
|
|
246
|
-
if (displayStyle.indexOf('inline') < 0) {
|
|
247
|
-
return NodeFilter.FILTER_ACCEPT;
|
|
248
|
-
}
|
|
249
|
-
else {
|
|
250
|
-
return NodeFilter.FILTER_SKIP;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
treeWalker.currentNode = node;
|
|
255
|
-
var blockParent = treeWalker.parentNode();
|
|
256
|
-
return blockParent;
|
|
257
|
-
};
|
|
258
|
-
EditorManager.prototype.getLastTextNode = function (node) {
|
|
259
|
-
var treeWalker = this.currentDocument.createTreeWalker(node, NodeFilter.SHOW_TEXT, null);
|
|
260
|
-
var lastTextNode = null;
|
|
261
|
-
var currentNode = treeWalker.nextNode();
|
|
262
|
-
while (currentNode) {
|
|
263
|
-
lastTextNode = currentNode;
|
|
264
|
-
currentNode = treeWalker.nextNode();
|
|
265
|
-
}
|
|
266
|
-
return lastTextNode;
|
|
267
|
-
};
|
|
268
|
-
EditorManager.prototype.getFirstTextNode = function (node) {
|
|
269
|
-
var treeWalker = this.currentDocument.createTreeWalker(node, NodeFilter.SHOW_TEXT, null);
|
|
270
|
-
var firstTextNode = treeWalker.nextNode();
|
|
271
|
-
return firstTextNode;
|
|
272
|
-
};
|
|
273
214
|
return EditorManager;
|
|
274
215
|
}());
|
|
275
216
|
export { EditorManager };
|
|
@@ -317,14 +317,10 @@ export declare class DOMNode {
|
|
|
317
317
|
/**
|
|
318
318
|
* blockNodes method
|
|
319
319
|
*
|
|
320
|
-
* @param {boolean} action - Optional Boolean that specifies the action is whether performed.
|
|
321
320
|
* @returns {Node[]} - returns the node array values
|
|
322
321
|
* @hidden
|
|
323
322
|
* @deprecated
|
|
324
323
|
*/
|
|
325
|
-
blockNodes(
|
|
324
|
+
blockNodes(): Node[];
|
|
326
325
|
private ignoreTableTag;
|
|
327
|
-
private getPreBlockNodeCollection;
|
|
328
|
-
private getClosestInlineParent;
|
|
329
|
-
private wrapWithBlockNode;
|
|
330
326
|
}
|
|
@@ -490,11 +490,9 @@ 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;
|
|
495
493
|
var start = ((isTableStart ? getLastTextNode(startChildNodes[range.startOffset + 1]) :
|
|
496
494
|
startChildNodes[(range.startOffset > 0) ? (range.startOffset - 1) : range.startOffset]) || range.startContainer);
|
|
497
|
-
var end = (range.endContainer.childNodes[(range.endOffset > 0) ? (
|
|
495
|
+
var end = (range.endContainer.childNodes[(range.endOffset > 0) ? (range.endOffset - 1) : range.endOffset]
|
|
498
496
|
|| range.endContainer);
|
|
499
497
|
if ((start.nodeType === Node.ELEMENT_NODE && end.nodeType === Node.ELEMENT_NODE) && (start.contains(end) || end.contains(start))) {
|
|
500
498
|
var existNode = start.contains(end) ? start : end;
|
|
@@ -575,13 +573,10 @@ var DOMNode = /** @class */ (function () {
|
|
|
575
573
|
else if (start.tagName === 'BR') {
|
|
576
574
|
this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
|
|
577
575
|
var markerStart = range.startContainer.querySelector('.' + className);
|
|
578
|
-
|
|
579
|
-
markerStart.parentElement.appendChild(start);
|
|
580
|
-
}
|
|
576
|
+
markerStart.parentElement.appendChild(start);
|
|
581
577
|
}
|
|
582
578
|
else {
|
|
583
|
-
|
|
584
|
-
if (start.tagName === 'IMG' && tagName !== 'p' && tagName !== 'div') {
|
|
579
|
+
if (start.tagName === 'IMG') {
|
|
585
580
|
var parNode = document.createElement('p');
|
|
586
581
|
start.parentElement.insertBefore(parNode, start);
|
|
587
582
|
parNode.appendChild(start);
|
|
@@ -671,12 +666,11 @@ var DOMNode = /** @class */ (function () {
|
|
|
671
666
|
/**
|
|
672
667
|
* blockNodes method
|
|
673
668
|
*
|
|
674
|
-
* @param {boolean} action - Optional Boolean that specifies the action is whether performed.
|
|
675
669
|
* @returns {Node[]} - returns the node array values
|
|
676
670
|
* @hidden
|
|
677
671
|
* @deprecated
|
|
678
672
|
*/
|
|
679
|
-
DOMNode.prototype.blockNodes = function (
|
|
673
|
+
DOMNode.prototype.blockNodes = function () {
|
|
680
674
|
var collectionNodes = [];
|
|
681
675
|
var selection = this.getSelection();
|
|
682
676
|
if (this.isEditorArea() && selection.rangeCount) {
|
|
@@ -690,46 +684,23 @@ var DOMNode = /** @class */ (function () {
|
|
|
690
684
|
collectionNodes.push(startNode);
|
|
691
685
|
}
|
|
692
686
|
parentNode = this.blockParentNode(startNode);
|
|
693
|
-
var endParentNode = this.blockParentNode(endNode);
|
|
694
687
|
if (parentNode && collectionNodes.indexOf(parentNode) < 0) {
|
|
695
|
-
if (
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
}
|
|
705
|
-
else if (startNode === endNode && startNode.nodeName === 'SPAN' && (startNode.classList.contains(markerClassName.startSelection)
|
|
706
|
-
|| startNode.classList.contains(markerClassName.endSelection))) {
|
|
707
|
-
collectionNodes.push(this.createTempNode(startNode));
|
|
708
|
-
}
|
|
709
|
-
}
|
|
688
|
+
if (CONSTANT.IGNORE_BLOCK_TAGS.indexOf(parentNode.tagName.toLocaleLowerCase()) >= 0 && (startNode.tagName === 'BR' ||
|
|
689
|
+
startNode.nodeType === Node.TEXT_NODE ||
|
|
690
|
+
startNode.classList.contains(markerClassName.startSelection) ||
|
|
691
|
+
startNode.classList.contains(markerClassName.endSelection))) {
|
|
692
|
+
var tempNode = startNode.previousSibling &&
|
|
693
|
+
startNode.previousSibling.nodeType === Node.TEXT_NODE ?
|
|
694
|
+
startNode.previousSibling : startNode;
|
|
695
|
+
if (!startNode.nextSibling && !startNode.previousSibling && startNode.tagName === 'BR') {
|
|
696
|
+
collectionNodes.push(tempNode);
|
|
710
697
|
}
|
|
711
698
|
else {
|
|
712
|
-
collectionNodes.push(
|
|
699
|
+
collectionNodes.push(this.createTempNode(tempNode));
|
|
713
700
|
}
|
|
714
701
|
}
|
|
715
702
|
else {
|
|
716
|
-
|
|
717
|
-
startNode.nodeType === Node.TEXT_NODE ||
|
|
718
|
-
startNode.classList.contains(markerClassName.startSelection) ||
|
|
719
|
-
startNode.classList.contains(markerClassName.endSelection))) {
|
|
720
|
-
var tempNode = startNode.previousSibling &&
|
|
721
|
-
startNode.previousSibling.nodeType === Node.TEXT_NODE ?
|
|
722
|
-
startNode.previousSibling : startNode;
|
|
723
|
-
if (!startNode.nextSibling && !startNode.previousSibling && startNode.tagName === 'BR') {
|
|
724
|
-
collectionNodes.push(tempNode);
|
|
725
|
-
}
|
|
726
|
-
else {
|
|
727
|
-
collectionNodes.push(this.createTempNode(tempNode));
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
else {
|
|
731
|
-
collectionNodes.push(parentNode);
|
|
732
|
-
}
|
|
703
|
+
collectionNodes.push(parentNode);
|
|
733
704
|
}
|
|
734
705
|
}
|
|
735
706
|
var nodes = [];
|
|
@@ -798,131 +769,6 @@ var DOMNode = /** @class */ (function () {
|
|
|
798
769
|
DOMNode.prototype.ignoreTableTag = function (element) {
|
|
799
770
|
return !(CONSTANT.TABLE_BLOCK_TAGS.indexOf(element.tagName.toLocaleLowerCase()) >= 0);
|
|
800
771
|
};
|
|
801
|
-
DOMNode.prototype.getPreBlockNodeCollection = function (range) {
|
|
802
|
-
var startNode = this.getSelectedNode(range.startContainer, range.startOffset);
|
|
803
|
-
var endNode = this.getSelectedNode(range.endContainer, range.endOffset);
|
|
804
|
-
var nodes = [];
|
|
805
|
-
var rootNode = startNode.closest('td, th');
|
|
806
|
-
if (isNOU(rootNode)) {
|
|
807
|
-
return nodes;
|
|
808
|
-
}
|
|
809
|
-
var rootChildNode = Array.from(rootNode.childNodes);
|
|
810
|
-
var isContinue = true;
|
|
811
|
-
var processedStart = this.getClosestInlineParent(startNode, rootNode, true);
|
|
812
|
-
var processedEnd = this.getClosestInlineParent(endNode, rootNode, false);
|
|
813
|
-
for (var i = 0; i < rootChildNode.length; i++) {
|
|
814
|
-
var child = rootChildNode[i];
|
|
815
|
-
if (processedStart === processedEnd && child === processedStart) {
|
|
816
|
-
nodes.push(child);
|
|
817
|
-
isContinue = true;
|
|
818
|
-
}
|
|
819
|
-
else if (child === processedStart) {
|
|
820
|
-
isContinue = false;
|
|
821
|
-
}
|
|
822
|
-
else if (child === processedEnd) {
|
|
823
|
-
nodes.push(child); // Early Exit so Push the end node.
|
|
824
|
-
isContinue = true;
|
|
825
|
-
}
|
|
826
|
-
if (isContinue) {
|
|
827
|
-
continue;
|
|
828
|
-
}
|
|
829
|
-
else {
|
|
830
|
-
nodes.push(child);
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
return nodes;
|
|
834
|
-
};
|
|
835
|
-
DOMNode.prototype.getClosestInlineParent = function (node, rootNode, isStart) {
|
|
836
|
-
// 1. If the node is a text node, return the node
|
|
837
|
-
// 2. If the node is a block node return block node
|
|
838
|
-
// 3. If the node is a inline node,
|
|
839
|
-
// Traverse back untill the TD or TH node
|
|
840
|
-
// Check if the the previous sibling , next sibling is a block node.
|
|
841
|
-
// If yes return the inline node that is closest to the block node.
|
|
842
|
-
if (node.nodeType === Node.TEXT_NODE) {
|
|
843
|
-
return node;
|
|
844
|
-
}
|
|
845
|
-
if (this.isBlockNode(node)) {
|
|
846
|
-
return node;
|
|
847
|
-
}
|
|
848
|
-
var currentNode = node;
|
|
849
|
-
var rootFlag = false;
|
|
850
|
-
while (currentNode) {
|
|
851
|
-
var previousNode = currentNode;
|
|
852
|
-
if (rootFlag) {
|
|
853
|
-
if (this.isBlockNode(currentNode)) {
|
|
854
|
-
return previousNode;
|
|
855
|
-
}
|
|
856
|
-
if (isStart && currentNode.previousSibling) {
|
|
857
|
-
if (this.isBlockNode(currentNode.previousSibling) || currentNode.previousSibling.nodeName === 'BR') {
|
|
858
|
-
return previousNode;
|
|
859
|
-
}
|
|
860
|
-
else {
|
|
861
|
-
currentNode = currentNode.previousSibling;
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
else if (!isStart && currentNode.nextSibling) {
|
|
865
|
-
if (this.isBlockNode(currentNode.nextSibling) || currentNode.nextSibling.nodeName === 'BR') {
|
|
866
|
-
return previousNode;
|
|
867
|
-
}
|
|
868
|
-
else {
|
|
869
|
-
currentNode = currentNode.nextSibling;
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
else {
|
|
873
|
-
return currentNode;
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
else {
|
|
877
|
-
currentNode = currentNode.parentElement;
|
|
878
|
-
if (currentNode === rootNode) {
|
|
879
|
-
currentNode = previousNode;
|
|
880
|
-
rootFlag = true;
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
return null;
|
|
885
|
-
};
|
|
886
|
-
DOMNode.prototype.wrapWithBlockNode = function (nodes, collectionNodes) {
|
|
887
|
-
var wrapperElement = createElement('p');
|
|
888
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
889
|
-
var child = nodes[i];
|
|
890
|
-
if (child.nodeName === 'BR') {
|
|
891
|
-
child.parentNode.insertBefore(wrapperElement, child);
|
|
892
|
-
wrapperElement.appendChild(child);
|
|
893
|
-
if (wrapperElement.childNodes.length > 0) {
|
|
894
|
-
collectionNodes.push(wrapperElement);
|
|
895
|
-
}
|
|
896
|
-
wrapperElement = createElement('p');
|
|
897
|
-
}
|
|
898
|
-
else {
|
|
899
|
-
if (!this.isBlockNode(child)) {
|
|
900
|
-
if (child.nodeName === '#text' && child.textContent.trim() === '') {
|
|
901
|
-
continue;
|
|
902
|
-
}
|
|
903
|
-
if (wrapperElement.childElementCount === 0) {
|
|
904
|
-
child.parentNode.insertBefore(wrapperElement, child);
|
|
905
|
-
wrapperElement.appendChild(child);
|
|
906
|
-
}
|
|
907
|
-
else {
|
|
908
|
-
wrapperElement.appendChild(child);
|
|
909
|
-
}
|
|
910
|
-
}
|
|
911
|
-
else {
|
|
912
|
-
collectionNodes.push(child);
|
|
913
|
-
}
|
|
914
|
-
// Use case when the BR is next sibling but the BR is not the part of selection.
|
|
915
|
-
if ((i === nodes.length - 1) && wrapperElement.nextElementSibling &&
|
|
916
|
-
wrapperElement.querySelectorAll('br').length === 0 &&
|
|
917
|
-
wrapperElement.nextElementSibling.nodeName === 'BR') {
|
|
918
|
-
wrapperElement.appendChild(wrapperElement.nextElementSibling);
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
if (wrapperElement.childNodes.length > 0 && collectionNodes.indexOf(wrapperElement) < 0) {
|
|
923
|
-
collectionNodes.push(wrapperElement);
|
|
924
|
-
}
|
|
925
|
-
};
|
|
926
772
|
return DOMNode;
|
|
927
773
|
}());
|
|
928
774
|
export { DOMNode };
|
|
@@ -35,7 +35,6 @@ export declare class FormatPainterActions implements IFormatPainterEditor {
|
|
|
35
35
|
private validateELementTag;
|
|
36
36
|
private findCurrentContext;
|
|
37
37
|
private insertFormatNode;
|
|
38
|
-
private isListCopied;
|
|
39
38
|
private insertBlockNode;
|
|
40
39
|
private insertNewList;
|
|
41
40
|
private insertSameList;
|