@syncfusion/ej2-richtexteditor 25.1.40 → 25.1.41-85815
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/.eslintrc.json +259 -259
- package/CHANGELOG.md +2067 -1973
- package/README.md +76 -76
- package/dist/ej2-richtexteditor.umd.min.js +1 -10
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +760 -307
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +861 -405
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/ej2-richtexteditor-component.sln +30 -0
- package/helpers/e2e/index.js +3 -3
- package/helpers/e2e/rte-helper.js +13 -13
- package/license +9 -9
- package/package.json +74 -74
- package/src/common/interface.d.ts +22 -8
- package/src/common/util.d.ts +8 -0
- package/src/common/util.js +56 -1
- package/src/editor-manager/base/classes.d.ts +1 -1
- package/src/editor-manager/base/classes.js +1 -1
- package/src/editor-manager/base/editor-manager.d.ts +3 -3
- package/src/editor-manager/base/editor-manager.js +8 -6
- package/src/editor-manager/base/enum.d.ts +2 -2
- package/src/editor-manager/base/interface.d.ts +9 -9
- package/src/editor-manager/base/types.d.ts +1 -1
- package/src/editor-manager/plugin/alignments.d.ts +2 -2
- package/src/editor-manager/plugin/alignments.js +5 -2
- package/src/editor-manager/plugin/audio.d.ts +3 -3
- package/src/editor-manager/plugin/audio.js +3 -3
- package/src/editor-manager/plugin/clearformat-exec.d.ts +2 -2
- package/src/editor-manager/plugin/clearformat-exec.js +2 -2
- package/src/editor-manager/plugin/clearformat.d.ts +1 -1
- package/src/editor-manager/plugin/clearformat.js +1 -1
- package/src/editor-manager/plugin/dom-node.d.ts +54 -34
- package/src/editor-manager/plugin/dom-node.js +139 -36
- package/src/editor-manager/plugin/format-painter-actions.d.ts +1 -1
- package/src/editor-manager/plugin/format-painter-actions.js +1 -1
- package/src/editor-manager/plugin/formats.d.ts +2 -2
- package/src/editor-manager/plugin/formats.js +3 -3
- package/src/editor-manager/plugin/image.d.ts +3 -3
- package/src/editor-manager/plugin/image.js +3 -3
- package/src/editor-manager/plugin/indents.d.ts +2 -2
- package/src/editor-manager/plugin/indents.js +5 -2
- package/src/editor-manager/plugin/insert-methods.d.ts +4 -4
- package/src/editor-manager/plugin/insert-methods.js +4 -4
- package/src/editor-manager/plugin/insert-text.d.ts +2 -2
- package/src/editor-manager/plugin/insert-text.js +2 -2
- package/src/editor-manager/plugin/inserthtml-exec.d.ts +2 -2
- package/src/editor-manager/plugin/inserthtml-exec.js +2 -2
- package/src/editor-manager/plugin/inserthtml.d.ts +2 -2
- package/src/editor-manager/plugin/inserthtml.js +13 -4
- package/src/editor-manager/plugin/isformatted.d.ts +8 -8
- package/src/editor-manager/plugin/isformatted.js +8 -8
- package/src/editor-manager/plugin/link.d.ts +2 -2
- package/src/editor-manager/plugin/link.js +2 -2
- package/src/editor-manager/plugin/lists.d.ts +2 -2
- package/src/editor-manager/plugin/lists.js +84 -61
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +1 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +4 -4
- package/src/editor-manager/plugin/nodecutter.d.ts +6 -6
- package/src/editor-manager/plugin/nodecutter.js +8 -8
- package/src/editor-manager/plugin/selection-commands.d.ts +1 -1
- package/src/editor-manager/plugin/selection-commands.js +1 -1
- package/src/editor-manager/plugin/selection-exec.d.ts +2 -2
- package/src/editor-manager/plugin/selection-exec.js +2 -2
- package/src/editor-manager/plugin/table.d.ts +2 -2
- package/src/editor-manager/plugin/table.js +2 -2
- package/src/editor-manager/plugin/toolbar-status.d.ts +2 -2
- package/src/editor-manager/plugin/toolbar-status.js +2 -2
- package/src/editor-manager/plugin/undo.d.ts +6 -6
- package/src/editor-manager/plugin/undo.js +9 -7
- package/src/editor-manager/plugin/video.d.ts +3 -3
- package/src/editor-manager/plugin/video.js +3 -3
- package/src/markdown-parser/base/interface.d.ts +10 -10
- package/src/markdown-parser/base/markdown-parser.d.ts +3 -3
- package/src/markdown-parser/base/markdown-parser.js +3 -3
- package/src/markdown-parser/base/types.d.ts +1 -1
- package/src/markdown-parser/plugin/clearformat.d.ts +2 -2
- package/src/markdown-parser/plugin/clearformat.js +2 -2
- package/src/markdown-parser/plugin/formats.d.ts +2 -2
- package/src/markdown-parser/plugin/formats.js +2 -2
- package/src/markdown-parser/plugin/insert-text.d.ts +2 -2
- package/src/markdown-parser/plugin/insert-text.js +2 -2
- package/src/markdown-parser/plugin/link.d.ts +2 -2
- package/src/markdown-parser/plugin/link.js +2 -2
- package/src/markdown-parser/plugin/markdown-selection.d.ts +14 -14
- package/src/markdown-parser/plugin/markdown-selection.js +14 -14
- package/src/markdown-parser/plugin/md-selection-formats.d.ts +1 -1
- package/src/markdown-parser/plugin/md-selection-formats.js +1 -1
- package/src/markdown-parser/plugin/table.d.ts +3 -3
- package/src/markdown-parser/plugin/table.js +3 -3
- package/src/markdown-parser/plugin/undo.d.ts +6 -6
- package/src/markdown-parser/plugin/undo.js +6 -6
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +9 -9
- package/src/rich-text-editor/actions/base-quick-toolbar.js +9 -9
- package/src/rich-text-editor/actions/base-toolbar.d.ts +3 -3
- package/src/rich-text-editor/actions/base-toolbar.js +3 -3
- package/src/rich-text-editor/actions/color-picker.d.ts +2 -2
- package/src/rich-text-editor/actions/color-picker.js +2 -2
- package/src/rich-text-editor/actions/count.d.ts +3 -3
- package/src/rich-text-editor/actions/count.js +3 -3
- package/src/rich-text-editor/actions/dropdown-buttons.d.ts +2 -2
- package/src/rich-text-editor/actions/dropdown-buttons.js +2 -2
- package/src/rich-text-editor/actions/emoji-picker.d.ts +1 -1
- package/src/rich-text-editor/actions/emoji-picker.js +2 -2
- package/src/rich-text-editor/actions/enter-key.d.ts +5 -0
- package/src/rich-text-editor/actions/enter-key.js +107 -13
- package/src/rich-text-editor/actions/full-screen.d.ts +3 -3
- package/src/rich-text-editor/actions/full-screen.js +3 -9
- package/src/rich-text-editor/actions/html-editor.d.ts +5 -3
- package/src/rich-text-editor/actions/html-editor.js +106 -26
- package/src/rich-text-editor/actions/keyboard-model.d.ts +16 -16
- package/src/rich-text-editor/actions/keyboard.d.ts +1 -1
- package/src/rich-text-editor/actions/keyboard.js +20 -20
- package/src/rich-text-editor/actions/markdown-editor.d.ts +2 -2
- package/src/rich-text-editor/actions/markdown-editor.js +2 -2
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +2 -1
- package/src/rich-text-editor/actions/paste-clean-up.js +57 -16
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +9 -9
- package/src/rich-text-editor/actions/quick-toolbar.js +9 -9
- package/src/rich-text-editor/actions/toolbar.d.ts +13 -13
- package/src/rich-text-editor/actions/toolbar.js +13 -13
- package/src/rich-text-editor/actions/xhtml-validation.d.ts +1 -1
- package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
- package/src/rich-text-editor/base/classes.d.ts +121 -121
- package/src/rich-text-editor/base/classes.js +121 -121
- package/src/rich-text-editor/base/constant.d.ts +158 -158
- package/src/rich-text-editor/base/constant.js +158 -158
- package/src/rich-text-editor/base/enum.d.ts +5 -5
- package/src/rich-text-editor/base/enum.js +10 -10
- package/src/rich-text-editor/base/interface.d.ts +53 -53
- package/src/rich-text-editor/base/interface.js +1 -1
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +891 -891
- package/src/rich-text-editor/base/rich-text-editor.d.ts +63 -61
- package/src/rich-text-editor/base/rich-text-editor.js +89 -67
- package/src/rich-text-editor/base/util.d.ts +1 -1
- package/src/rich-text-editor/base/util.js +1 -1
- package/src/rich-text-editor/formatter/formatter.d.ts +8 -8
- package/src/rich-text-editor/formatter/formatter.js +8 -8
- package/src/rich-text-editor/formatter/html-formatter.d.ts +2 -2
- package/src/rich-text-editor/formatter/html-formatter.js +15 -15
- package/src/rich-text-editor/formatter/markdown-formatter.d.ts +2 -2
- package/src/rich-text-editor/formatter/markdown-formatter.js +15 -15
- package/src/rich-text-editor/models/iframe-settings-model.d.ts +26 -26
- package/src/rich-text-editor/models/iframe-settings.js +19 -19
- package/src/rich-text-editor/models/inline-mode-model.d.ts +11 -11
- package/src/rich-text-editor/models/inline-mode.js +19 -19
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +760 -760
- package/src/rich-text-editor/models/toolbar-settings.js +19 -19
- package/src/rich-text-editor/renderer/audio-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/audio-module.js +7 -2
- package/src/rich-text-editor/renderer/content-renderer.d.ts +6 -6
- package/src/rich-text-editor/renderer/content-renderer.js +6 -6
- package/src/rich-text-editor/renderer/dialog-renderer.d.ts +2 -2
- package/src/rich-text-editor/renderer/dialog-renderer.js +2 -2
- package/src/rich-text-editor/renderer/iframe-content-renderer.d.ts +4 -4
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +18 -18
- package/src/rich-text-editor/renderer/image-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/image-module.js +13 -8
- package/src/rich-text-editor/renderer/link-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/link-module.js +4 -1
- package/src/rich-text-editor/renderer/markdown-renderer.d.ts +6 -6
- package/src/rich-text-editor/renderer/markdown-renderer.js +6 -6
- package/src/rich-text-editor/renderer/popup-renderer.d.ts +5 -5
- package/src/rich-text-editor/renderer/popup-renderer.js +5 -5
- package/src/rich-text-editor/renderer/render.d.ts +2 -2
- package/src/rich-text-editor/renderer/render.js +2 -2
- package/src/rich-text-editor/renderer/table-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/table-module.js +6 -2
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +11 -9
- package/src/rich-text-editor/renderer/toolbar-renderer.js +23 -19
- package/src/rich-text-editor/renderer/video-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/video-module.js +7 -2
- package/src/rich-text-editor/renderer/view-source.d.ts +6 -6
- package/src/rich-text-editor/renderer/view-source.js +6 -6
- package/src/rich-text-editor/services/renderer-factory.d.ts +3 -3
- package/src/rich-text-editor/services/renderer-factory.js +3 -3
- package/src/rich-text-editor/services/service-locator.d.ts +3 -3
- package/src/rich-text-editor/services/service-locator.js +3 -3
- package/src/selection/selection.d.ts +22 -22
- package/src/selection/selection.js +22 -22
- package/styles/_all.scss +1 -1
- package/styles/bootstrap-dark.css +739 -801
- package/styles/bootstrap-dark.scss +4 -1
- package/styles/bootstrap.css +723 -801
- package/styles/bootstrap.scss +4 -1
- package/styles/bootstrap4.css +726 -803
- package/styles/bootstrap4.scss +4 -1
- package/styles/bootstrap5-dark.css +750 -840
- package/styles/bootstrap5-dark.scss +4 -1
- package/styles/bootstrap5.css +749 -839
- package/styles/bootstrap5.scss +4 -1
- package/styles/fabric-dark.css +724 -797
- package/styles/fabric-dark.scss +4 -1
- package/styles/fabric.css +720 -797
- package/styles/fabric.scss +4 -1
- package/styles/fluent-dark.css +727 -820
- package/styles/fluent-dark.scss +4 -1
- package/styles/fluent.css +726 -819
- package/styles/fluent.scss +4 -1
- package/styles/fluent2.css +4255 -0
- package/styles/fluent2.scss +4 -0
- package/styles/highcontrast-light.css +695 -795
- package/styles/highcontrast-light.scss +4 -1
- package/styles/highcontrast.css +717 -797
- package/styles/highcontrast.scss +4 -1
- package/styles/material-dark.css +716 -798
- package/styles/material-dark.scss +4 -1
- package/styles/material.css +713 -800
- package/styles/material.scss +4 -1
- package/styles/material3-dark.css +751 -857
- package/styles/material3-dark.scss +4 -1
- package/styles/material3.css +751 -857
- package/styles/material3.scss +4 -1
- package/styles/rich-text-editor/_all.scss +2 -2
- package/styles/rich-text-editor/_bds-definition.scss +290 -285
- package/styles/rich-text-editor/_bigger.scss +610 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +291 -287
- package/styles/rich-text-editor/_bootstrap-definition.scss +349 -343
- package/styles/rich-text-editor/_bootstrap4-definition.scss +476 -470
- package/styles/rich-text-editor/_bootstrap5-definition.scss +278 -272
- package/styles/rich-text-editor/_bootstrap5.3-definition.scss +278 -0
- package/styles/rich-text-editor/_fabric-dark-definition.scss +275 -269
- package/styles/rich-text-editor/_fabric-definition.scss +273 -267
- package/styles/rich-text-editor/_fluent-definition.scss +279 -273
- package/styles/rich-text-editor/_fluent2-definition.scss +287 -0
- package/styles/rich-text-editor/_fusionnew-definition.scss +276 -271
- package/styles/rich-text-editor/_highcontrast-definition.scss +274 -267
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +273 -267
- package/styles/rich-text-editor/_layout.scss +2175 -2268
- package/styles/rich-text-editor/_material-dark-definition.scss +278 -272
- package/styles/rich-text-editor/_material-definition.scss +276 -270
- package/styles/rich-text-editor/_material3-definition.scss +278 -272
- package/styles/rich-text-editor/_tailwind-definition.scss +273 -267
- package/styles/rich-text-editor/_tailwind4-definition.scss +278 -0
- package/styles/rich-text-editor/_theme.scss +844 -927
- package/styles/rich-text-editor/bootstrap-dark.css +739 -801
- package/styles/rich-text-editor/bootstrap.css +723 -801
- package/styles/rich-text-editor/bootstrap4.css +726 -803
- package/styles/rich-text-editor/bootstrap5-dark.css +750 -840
- package/styles/rich-text-editor/bootstrap5.css +749 -839
- package/styles/rich-text-editor/fabric-dark.css +724 -797
- package/styles/rich-text-editor/fabric.css +720 -797
- package/styles/rich-text-editor/fluent-dark.css +727 -820
- package/styles/rich-text-editor/fluent.css +726 -819
- package/styles/rich-text-editor/fluent2.css +4255 -0
- package/styles/rich-text-editor/fluent2.scss +4 -0
- package/styles/rich-text-editor/highcontrast-light.css +695 -795
- package/styles/rich-text-editor/highcontrast.css +717 -797
- package/styles/rich-text-editor/icons/_bds.scss +372 -351
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +373 -352
- package/styles/rich-text-editor/icons/_bootstrap.scss +373 -352
- package/styles/rich-text-editor/icons/_bootstrap4.scss +373 -352
- package/styles/rich-text-editor/icons/_bootstrap5.3.scss +372 -0
- package/styles/rich-text-editor/icons/_bootstrap5.scss +372 -351
- package/styles/rich-text-editor/icons/_fabric-dark.scss +373 -352
- package/styles/rich-text-editor/icons/_fabric.scss +373 -352
- package/styles/rich-text-editor/icons/_fluent.scss +372 -351
- package/styles/rich-text-editor/icons/_fluent2.scss +369 -0
- package/styles/rich-text-editor/icons/_fusionnew.scss +357 -348
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +361 -352
- package/styles/rich-text-editor/icons/_highcontrast.scss +373 -352
- package/styles/rich-text-editor/icons/_material-dark.scss +373 -352
- package/styles/rich-text-editor/icons/_material.scss +373 -352
- package/styles/rich-text-editor/icons/_material3.scss +372 -351
- package/styles/rich-text-editor/icons/_tailwind.scss +372 -351
- package/styles/rich-text-editor/icons/_tailwind4.scss +372 -0
- package/styles/rich-text-editor/material-dark.css +716 -798
- package/styles/rich-text-editor/material.css +713 -800
- package/styles/rich-text-editor/material3-dark.css +751 -857
- package/styles/rich-text-editor/material3-dark.scss +1 -1
- package/styles/rich-text-editor/material3.css +751 -857
- package/styles/rich-text-editor/material3.scss +1 -1
- package/styles/rich-text-editor/tailwind-dark.css +740 -829
- package/styles/rich-text-editor/tailwind.css +740 -829
- package/styles/tailwind-dark.css +740 -829
- package/styles/tailwind-dark.scss +4 -1
- package/styles/tailwind.css +740 -829
- package/styles/tailwind.scss +4 -1
- package/dist/ej2-richtexteditor.min.js +0 -10
- package/dist/global/ej2-richtexteditor.min.js +0 -11
- package/dist/global/ej2-richtexteditor.min.js.map +0 -1
- package/dist/global/index.d.ts +0 -14
- package/tslint.json +0 -111
|
@@ -4,7 +4,7 @@ import { InsertHtml } from './inserthtml';
|
|
|
4
4
|
* Insert a Text Node or Text
|
|
5
5
|
*
|
|
6
6
|
* @hidden
|
|
7
|
-
|
|
7
|
+
* @deprecated
|
|
8
8
|
*/
|
|
9
9
|
var InsertTextExec = /** @class */ (function () {
|
|
10
10
|
/**
|
|
@@ -12,7 +12,7 @@ var InsertTextExec = /** @class */ (function () {
|
|
|
12
12
|
*
|
|
13
13
|
* @param {EditorManager} parent - specifies the parent element
|
|
14
14
|
* @hidden
|
|
15
|
-
|
|
15
|
+
* @deprecated
|
|
16
16
|
*/
|
|
17
17
|
function InsertTextExec(parent) {
|
|
18
18
|
this.parent = parent;
|
|
@@ -3,7 +3,7 @@ import { EditorManager } from './../base/editor-manager';
|
|
|
3
3
|
* Selection EXEC internal component
|
|
4
4
|
*
|
|
5
5
|
* @hidden
|
|
6
|
-
|
|
6
|
+
* @deprecated
|
|
7
7
|
*/
|
|
8
8
|
export declare class InsertHtmlExec {
|
|
9
9
|
private parent;
|
|
@@ -12,7 +12,7 @@ export declare class InsertHtmlExec {
|
|
|
12
12
|
*
|
|
13
13
|
* @param {EditorManager} parent - sepcifies the parent element
|
|
14
14
|
* @hidden
|
|
15
|
-
|
|
15
|
+
* @deprecated
|
|
16
16
|
*/
|
|
17
17
|
constructor(parent: EditorManager);
|
|
18
18
|
private addEventListener;
|
|
@@ -4,7 +4,7 @@ import { InsertHtml } from './inserthtml';
|
|
|
4
4
|
* Selection EXEC internal component
|
|
5
5
|
*
|
|
6
6
|
* @hidden
|
|
7
|
-
|
|
7
|
+
* @deprecated
|
|
8
8
|
*/
|
|
9
9
|
var InsertHtmlExec = /** @class */ (function () {
|
|
10
10
|
/**
|
|
@@ -12,7 +12,7 @@ var InsertHtmlExec = /** @class */ (function () {
|
|
|
12
12
|
*
|
|
13
13
|
* @param {EditorManager} parent - sepcifies the parent element
|
|
14
14
|
* @hidden
|
|
15
|
-
|
|
15
|
+
* @deprecated
|
|
16
16
|
*/
|
|
17
17
|
function InsertHtmlExec(parent) {
|
|
18
18
|
this.parent = parent;
|
|
@@ -8,7 +8,7 @@ import { updateTextNode, nestedListCleanUp } from './../../common/util';
|
|
|
8
8
|
* Insert a HTML Node or Text
|
|
9
9
|
*
|
|
10
10
|
* @hidden
|
|
11
|
-
|
|
11
|
+
* @deprecated
|
|
12
12
|
*/
|
|
13
13
|
var InsertHtml = /** @class */ (function () {
|
|
14
14
|
function InsertHtml() {
|
|
@@ -58,11 +58,14 @@ var InsertHtml = /** @class */ (function () {
|
|
|
58
58
|
range.startContainer === range.endContainer;
|
|
59
59
|
var isCollapsed = range.collapsed;
|
|
60
60
|
var nodes = this.getNodeCollection(range, nodeSelection, node);
|
|
61
|
-
var closestParentNode = (node.nodeName.toLowerCase() === 'table') ? this.closestEle(nodes[0].parentNode, editNode) : nodes[0];
|
|
61
|
+
var closestParentNode = (node.nodeName.toLowerCase() === 'table') ? (!isNOU(nodes[0]) ? this.closestEle(nodes[0].parentNode, editNode) : range.startContainer) : nodes[0];
|
|
62
62
|
if (closestParentNode && closestParentNode.nodeName === 'LI' && node.nodeName.toLowerCase() === 'table') {
|
|
63
63
|
this.insertTableInList(range, node, closestParentNode, nodes[0], nodeCutter);
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
|
+
if (isCursor && range.startContainer.textContent === '' && range.startContainer.nodeName !== 'BR' && enterAction !== 'BR' && node.nodeName !== '#text' && !isNOU(node.children[0]) && !isNOU(node.children[0].tagName) && node.children[0].tagName === 'IMG' && node.children.length === 1) {
|
|
67
|
+
range.startContainer.innerHTML = '';
|
|
68
|
+
}
|
|
66
69
|
if (isExternal || (!isNOU(node) && !isNOU(node.classList) &&
|
|
67
70
|
node.classList.contains('pasteContent'))) {
|
|
68
71
|
this.pasteInsertHTML(nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode, enterAction);
|
|
@@ -103,7 +106,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
103
106
|
nodes[index].parentNode.removeChild(nodes[index]);
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
|
-
if (sibNode) {
|
|
109
|
+
if (!isNOU(sibNode) && !isNOU(sibNode.parentNode)) {
|
|
107
110
|
InsertMethods.AppendBefore(node, sibNode, true);
|
|
108
111
|
}
|
|
109
112
|
else {
|
|
@@ -354,6 +357,12 @@ var InsertHtml = /** @class */ (function () {
|
|
|
354
357
|
node.parentNode.replaceChild(fragment, node);
|
|
355
358
|
}
|
|
356
359
|
}
|
|
360
|
+
if (lastSelectionNode.nodeName === 'TABLE') {
|
|
361
|
+
var pTag = createElement('p');
|
|
362
|
+
pTag.appendChild(createElement('br'));
|
|
363
|
+
lastSelectionNode.parentElement.insertBefore(pTag, lastSelectionNode.nextSibling);
|
|
364
|
+
lastSelectionNode = pTag;
|
|
365
|
+
}
|
|
357
366
|
if (lastSelectionNode.nodeName === '#text') {
|
|
358
367
|
this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
359
368
|
}
|
|
@@ -602,7 +611,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
602
611
|
* Insert method
|
|
603
612
|
*
|
|
604
613
|
* @hidden
|
|
605
|
-
|
|
614
|
+
* @deprecated
|
|
606
615
|
*/
|
|
607
616
|
InsertHtml.inlineNode = ['a', 'abbr', 'acronym', 'audio', 'b', 'bdi', 'bdo', 'big', 'br', 'button',
|
|
608
617
|
'canvas', 'cite', 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'font', 'i', 'iframe', 'img', 'input',
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Is formatted or not.
|
|
3
3
|
*
|
|
4
4
|
* @hidden
|
|
5
|
-
|
|
5
|
+
* @deprecated
|
|
6
6
|
*/
|
|
7
7
|
export declare class IsFormatted {
|
|
8
8
|
static inlineTags: string[];
|
|
@@ -14,7 +14,7 @@ export declare class IsFormatted {
|
|
|
14
14
|
* @param {Node} endNode - specifies the end node
|
|
15
15
|
* @returns {Node} - returns the node
|
|
16
16
|
* @hidden
|
|
17
|
-
|
|
17
|
+
* @deprecated
|
|
18
18
|
*/
|
|
19
19
|
getFormattedNode(node: Node, format: string, endNode: Node): Node;
|
|
20
20
|
private getFormatParent;
|
|
@@ -25,7 +25,7 @@ export declare class IsFormatted {
|
|
|
25
25
|
* @param {Node} node - specifies the node value
|
|
26
26
|
* @returns {boolean} - returns the boolean value
|
|
27
27
|
* @hidden
|
|
28
|
-
|
|
28
|
+
* @deprecated
|
|
29
29
|
*/
|
|
30
30
|
static isBold(node: Node): boolean;
|
|
31
31
|
/**
|
|
@@ -34,7 +34,7 @@ export declare class IsFormatted {
|
|
|
34
34
|
* @param {Node} node - specifies the node value
|
|
35
35
|
* @returns {boolean} - returns the boolean value
|
|
36
36
|
* @hidden
|
|
37
|
-
|
|
37
|
+
* @deprecated
|
|
38
38
|
*/
|
|
39
39
|
static isItalic(node: Node): boolean;
|
|
40
40
|
/**
|
|
@@ -43,7 +43,7 @@ export declare class IsFormatted {
|
|
|
43
43
|
* @param {Node} node - specifies the node value
|
|
44
44
|
* @returns {boolean} - returns the boolean value
|
|
45
45
|
* @hidden
|
|
46
|
-
|
|
46
|
+
* @deprecated
|
|
47
47
|
*/
|
|
48
48
|
static isUnderline(node: Node): boolean;
|
|
49
49
|
/**
|
|
@@ -52,7 +52,7 @@ export declare class IsFormatted {
|
|
|
52
52
|
* @param {Node} node - specifies the node value
|
|
53
53
|
* @returns {boolean} - returns the boolean value
|
|
54
54
|
* @hidden
|
|
55
|
-
|
|
55
|
+
* @deprecated
|
|
56
56
|
*/
|
|
57
57
|
static isStrikethrough(node: Node): boolean;
|
|
58
58
|
/**
|
|
@@ -61,7 +61,7 @@ export declare class IsFormatted {
|
|
|
61
61
|
* @param {Node} node - specifies the node value
|
|
62
62
|
* @returns {boolean} - returns the boolean value
|
|
63
63
|
* @hidden
|
|
64
|
-
|
|
64
|
+
* @deprecated
|
|
65
65
|
*/
|
|
66
66
|
static isSuperscript(node: Node): boolean;
|
|
67
67
|
/**
|
|
@@ -70,7 +70,7 @@ export declare class IsFormatted {
|
|
|
70
70
|
* @param {Node} node - specifies the node value
|
|
71
71
|
* @returns {boolean} - returns the boolean value
|
|
72
72
|
* @hidden
|
|
73
|
-
|
|
73
|
+
* @deprecated
|
|
74
74
|
*/
|
|
75
75
|
static isSubscript(node: Node): boolean;
|
|
76
76
|
private isFontColor;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Is formatted or not.
|
|
3
3
|
*
|
|
4
4
|
* @hidden
|
|
5
|
-
|
|
5
|
+
* @deprecated
|
|
6
6
|
*/
|
|
7
7
|
var IsFormatted = /** @class */ (function () {
|
|
8
8
|
function IsFormatted() {
|
|
@@ -15,7 +15,7 @@ var IsFormatted = /** @class */ (function () {
|
|
|
15
15
|
* @param {Node} endNode - specifies the end node
|
|
16
16
|
* @returns {Node} - returns the node
|
|
17
17
|
* @hidden
|
|
18
|
-
|
|
18
|
+
* @deprecated
|
|
19
19
|
*/
|
|
20
20
|
IsFormatted.prototype.getFormattedNode = function (node, format, endNode) {
|
|
21
21
|
var parentNode = this.getFormatParent(node, format, endNode);
|
|
@@ -62,7 +62,7 @@ var IsFormatted = /** @class */ (function () {
|
|
|
62
62
|
* @param {Node} node - specifies the node value
|
|
63
63
|
* @returns {boolean} - returns the boolean value
|
|
64
64
|
* @hidden
|
|
65
|
-
|
|
65
|
+
* @deprecated
|
|
66
66
|
*/
|
|
67
67
|
IsFormatted.isBold = function (node) {
|
|
68
68
|
var validTags = ['strong', 'b'];
|
|
@@ -83,7 +83,7 @@ var IsFormatted = /** @class */ (function () {
|
|
|
83
83
|
* @param {Node} node - specifies the node value
|
|
84
84
|
* @returns {boolean} - returns the boolean value
|
|
85
85
|
* @hidden
|
|
86
|
-
|
|
86
|
+
* @deprecated
|
|
87
87
|
*/
|
|
88
88
|
IsFormatted.isItalic = function (node) {
|
|
89
89
|
var validTags = ['em', 'i'];
|
|
@@ -104,7 +104,7 @@ var IsFormatted = /** @class */ (function () {
|
|
|
104
104
|
* @param {Node} node - specifies the node value
|
|
105
105
|
* @returns {boolean} - returns the boolean value
|
|
106
106
|
* @hidden
|
|
107
|
-
|
|
107
|
+
* @deprecated
|
|
108
108
|
*/
|
|
109
109
|
IsFormatted.isUnderline = function (node) {
|
|
110
110
|
var validTags = ['u'];
|
|
@@ -128,7 +128,7 @@ var IsFormatted = /** @class */ (function () {
|
|
|
128
128
|
* @param {Node} node - specifies the node value
|
|
129
129
|
* @returns {boolean} - returns the boolean value
|
|
130
130
|
* @hidden
|
|
131
|
-
|
|
131
|
+
* @deprecated
|
|
132
132
|
*/
|
|
133
133
|
IsFormatted.isStrikethrough = function (node) {
|
|
134
134
|
var validTags = ['del', 'strike'];
|
|
@@ -152,7 +152,7 @@ var IsFormatted = /** @class */ (function () {
|
|
|
152
152
|
* @param {Node} node - specifies the node value
|
|
153
153
|
* @returns {boolean} - returns the boolean value
|
|
154
154
|
* @hidden
|
|
155
|
-
|
|
155
|
+
* @deprecated
|
|
156
156
|
*/
|
|
157
157
|
IsFormatted.isSuperscript = function (node) {
|
|
158
158
|
var validTags = ['sup'];
|
|
@@ -169,7 +169,7 @@ var IsFormatted = /** @class */ (function () {
|
|
|
169
169
|
* @param {Node} node - specifies the node value
|
|
170
170
|
* @returns {boolean} - returns the boolean value
|
|
171
171
|
* @hidden
|
|
172
|
-
|
|
172
|
+
* @deprecated
|
|
173
173
|
*/
|
|
174
174
|
IsFormatted.isSubscript = function (node) {
|
|
175
175
|
var validTags = ['sub'];
|
|
@@ -3,7 +3,7 @@ import { EditorManager } from './../base/editor-manager';
|
|
|
3
3
|
* Link internal component
|
|
4
4
|
*
|
|
5
5
|
* @hidden
|
|
6
|
-
|
|
6
|
+
* @deprecated
|
|
7
7
|
*/
|
|
8
8
|
export declare class LinkCommand {
|
|
9
9
|
private parent;
|
|
@@ -12,7 +12,7 @@ export declare class LinkCommand {
|
|
|
12
12
|
*
|
|
13
13
|
* @param {EditorManager} parent - specifies the editor manager
|
|
14
14
|
* @hidden
|
|
15
|
-
|
|
15
|
+
* @deprecated
|
|
16
16
|
*/
|
|
17
17
|
constructor(parent: EditorManager);
|
|
18
18
|
private addEventListener;
|
|
@@ -7,7 +7,7 @@ import { createElement, isNullOrUndefined as isNOU, closest } from '@syncfusion/
|
|
|
7
7
|
* Link internal component
|
|
8
8
|
*
|
|
9
9
|
* @hidden
|
|
10
|
-
|
|
10
|
+
* @deprecated
|
|
11
11
|
*/
|
|
12
12
|
var LinkCommand = /** @class */ (function () {
|
|
13
13
|
/**
|
|
@@ -15,7 +15,7 @@ var LinkCommand = /** @class */ (function () {
|
|
|
15
15
|
*
|
|
16
16
|
* @param {EditorManager} parent - specifies the editor manager
|
|
17
17
|
* @hidden
|
|
18
|
-
|
|
18
|
+
* @deprecated
|
|
19
19
|
*/
|
|
20
20
|
function LinkCommand(parent) {
|
|
21
21
|
this.parent = parent;
|
|
@@ -3,7 +3,7 @@ import { EditorManager } from './../base/editor-manager';
|
|
|
3
3
|
* Lists internal component
|
|
4
4
|
*
|
|
5
5
|
* @hidden
|
|
6
|
-
|
|
6
|
+
* @deprecated
|
|
7
7
|
*/
|
|
8
8
|
export declare class Lists {
|
|
9
9
|
private parent;
|
|
@@ -18,7 +18,7 @@ export declare class Lists {
|
|
|
18
18
|
*
|
|
19
19
|
* @param {EditorManager} parent - specifies the parent element
|
|
20
20
|
* @hidden
|
|
21
|
-
|
|
21
|
+
* @deprecated
|
|
22
22
|
*/
|
|
23
23
|
constructor(parent: EditorManager);
|
|
24
24
|
private addEventListener;
|
|
@@ -9,7 +9,7 @@ import { isNullOrUndefined, isNullOrUndefined as isNOU, closest } from '@syncfus
|
|
|
9
9
|
* Lists internal component
|
|
10
10
|
*
|
|
11
11
|
* @hidden
|
|
12
|
-
|
|
12
|
+
* @deprecated
|
|
13
13
|
*/
|
|
14
14
|
var Lists = /** @class */ (function () {
|
|
15
15
|
/**
|
|
@@ -17,7 +17,7 @@ var Lists = /** @class */ (function () {
|
|
|
17
17
|
*
|
|
18
18
|
* @param {EditorManager} parent - specifies the parent element
|
|
19
19
|
* @hidden
|
|
20
|
-
|
|
20
|
+
* @deprecated
|
|
21
21
|
*/
|
|
22
22
|
function Lists(parent) {
|
|
23
23
|
this.parent = parent;
|
|
@@ -255,7 +255,7 @@ var Lists = /** @class */ (function () {
|
|
|
255
255
|
e.event.preventDefault();
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
|
-
Lists.prototype.onKeyUp = function () {
|
|
258
|
+
Lists.prototype.onKeyUp = function (e) {
|
|
259
259
|
if (!isNOU(this.commonLIParent) && !isNOU(this.commonLIParent.querySelector('.removeList'))) {
|
|
260
260
|
var currentLIElem = this.commonLIParent.querySelector('.removeList');
|
|
261
261
|
while (!isNOU(currentLIElem.firstChild)) {
|
|
@@ -263,6 +263,14 @@ var Lists = /** @class */ (function () {
|
|
|
263
263
|
}
|
|
264
264
|
detach(currentLIElem);
|
|
265
265
|
}
|
|
266
|
+
if (e.event.keyCode === 13) {
|
|
267
|
+
var listElements = this.parent.editableElement.querySelectorAll('UL, OL');
|
|
268
|
+
for (var i = 0; i < listElements.length; i++) {
|
|
269
|
+
if (!isNullOrUndefined(listElements[i]) && !isNullOrUndefined(listElements[i].parentElement) && !isNullOrUndefined(listElements[i].previousElementSibling) && (listElements[i].parentElement.nodeName === 'UL' || listElements[i].parentElement.nodeName === 'OL')) {
|
|
270
|
+
listElements[i].previousElementSibling.appendChild(listElements[i]);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
266
274
|
};
|
|
267
275
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
268
276
|
Lists.prototype.firstListBackSpace = function (range, _e) {
|
|
@@ -504,6 +512,8 @@ var Lists = /** @class */ (function () {
|
|
|
504
512
|
else {
|
|
505
513
|
if (prevSibling.tagName === 'LI') {
|
|
506
514
|
var nestedElement = createElement(elements[i].parentNode.tagName);
|
|
515
|
+
nestedElement.style.listStyleType =
|
|
516
|
+
elements[i].parentNode.style.listStyleType;
|
|
507
517
|
append([nestedElement], prevSibling);
|
|
508
518
|
append([elements[i]], nestedElement);
|
|
509
519
|
}
|
|
@@ -553,61 +563,7 @@ var Lists = /** @class */ (function () {
|
|
|
553
563
|
var listsNodes = this.domNode.blockNodes(true);
|
|
554
564
|
if (e.enterAction === 'BR') {
|
|
555
565
|
this.setSelectionBRConfig();
|
|
556
|
-
|
|
557
|
-
var selectedNodes = this.parent.nodeSelection.getSelectionNodes(allSelectedNode);
|
|
558
|
-
var currentFormatNodes = [];
|
|
559
|
-
if (selectedNodes.length === 0) {
|
|
560
|
-
selectedNodes.push(listsNodes[0]);
|
|
561
|
-
}
|
|
562
|
-
for (var i = 0; i < selectedNodes.length; i++) {
|
|
563
|
-
var currentNode = selectedNodes[i];
|
|
564
|
-
var previousCurrentNode = void 0;
|
|
565
|
-
while (!this.parent.domNode.isBlockNode(currentNode) && currentNode !== this.parent.editableElement) {
|
|
566
|
-
previousCurrentNode = currentNode;
|
|
567
|
-
currentNode = currentNode.parentElement;
|
|
568
|
-
}
|
|
569
|
-
if (this.parent.domNode.isBlockNode(currentNode) && currentNode === this.parent.editableElement) {
|
|
570
|
-
currentFormatNodes.push(previousCurrentNode);
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
for (var i = 0; i < currentFormatNodes.length; i++) {
|
|
574
|
-
if (!this.parent.domNode.isBlockNode(currentFormatNodes[i])) {
|
|
575
|
-
var currentNode = currentFormatNodes[i];
|
|
576
|
-
var previousNode = currentNode;
|
|
577
|
-
while (currentNode === this.parent.editableElement) {
|
|
578
|
-
previousNode = currentNode;
|
|
579
|
-
currentNode = currentNode.parentElement;
|
|
580
|
-
}
|
|
581
|
-
var tempElem = void 0;
|
|
582
|
-
if (this.parent.domNode.isBlockNode(previousNode.parentElement) &&
|
|
583
|
-
previousNode.parentElement === this.parent.editableElement) {
|
|
584
|
-
tempElem = createElement('p');
|
|
585
|
-
previousNode.parentElement.insertBefore(tempElem, previousNode);
|
|
586
|
-
tempElem.appendChild(previousNode);
|
|
587
|
-
}
|
|
588
|
-
else {
|
|
589
|
-
tempElem = previousNode;
|
|
590
|
-
}
|
|
591
|
-
var preNode = tempElem.previousSibling;
|
|
592
|
-
while (!isNOU(preNode) && preNode.nodeName !== 'BR' &&
|
|
593
|
-
!this.parent.domNode.isBlockNode(preNode)) {
|
|
594
|
-
tempElem.firstChild.parentElement.insertBefore(preNode, tempElem.firstChild);
|
|
595
|
-
preNode = tempElem.previousSibling;
|
|
596
|
-
}
|
|
597
|
-
if (!isNOU(preNode) && preNode.nodeName === 'BR') {
|
|
598
|
-
detach(preNode);
|
|
599
|
-
}
|
|
600
|
-
var postNode = tempElem.nextSibling;
|
|
601
|
-
while (!isNOU(postNode) && postNode.nodeName !== 'BR' &&
|
|
602
|
-
!this.parent.domNode.isBlockNode(postNode)) {
|
|
603
|
-
tempElem.appendChild(postNode);
|
|
604
|
-
postNode = tempElem.nextSibling;
|
|
605
|
-
}
|
|
606
|
-
if (!isNOU(postNode) && postNode.nodeName === 'BR') {
|
|
607
|
-
detach(postNode);
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
}
|
|
566
|
+
this.parent.domNode.convertToBlockNodes(this.parent.domNode.blockNodes(), true);
|
|
611
567
|
this.setSelectionBRConfig();
|
|
612
568
|
listsNodes = this.parent.domNode.blockNodes();
|
|
613
569
|
}
|
|
@@ -665,7 +621,7 @@ var Lists = /** @class */ (function () {
|
|
|
665
621
|
}
|
|
666
622
|
var elemAtt = void 0;
|
|
667
623
|
elements[i].style.removeProperty('margin-left');
|
|
668
|
-
elemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
|
|
624
|
+
elemAtt = elements[i].tagName === 'IMG' || elements[i].classList.contains('e-editor-select-start') ? '' : this.domNode.attributes(elements[i]);
|
|
669
625
|
if (elements[i].getAttribute('contenteditable') === 'true'
|
|
670
626
|
&& elements[i].childNodes.length === 1 && elements[i].childNodes[0].nodeName === 'TABLE') {
|
|
671
627
|
var listEle = document.createElement(type);
|
|
@@ -710,6 +666,16 @@ var Lists = /** @class */ (function () {
|
|
|
710
666
|
}
|
|
711
667
|
}
|
|
712
668
|
this.cleanNode();
|
|
669
|
+
if (e.enterAction === 'BR') {
|
|
670
|
+
var spansToRemove = document.querySelectorAll('span#removeSpan');
|
|
671
|
+
spansToRemove.forEach(function (span) {
|
|
672
|
+
var fragment = document.createDocumentFragment();
|
|
673
|
+
while (span.firstChild) {
|
|
674
|
+
fragment.appendChild(span.firstChild);
|
|
675
|
+
}
|
|
676
|
+
span.parentNode.replaceChild(fragment, span);
|
|
677
|
+
});
|
|
678
|
+
}
|
|
713
679
|
this.parent.editableElement.focus();
|
|
714
680
|
if (isIDevice()) {
|
|
715
681
|
setEditFrameFocus(this.parent.editableElement, selector);
|
|
@@ -779,6 +745,13 @@ var Lists = /** @class */ (function () {
|
|
|
779
745
|
for (var c = 0; c < liParents.length; c++) {
|
|
780
746
|
var node = liParents[c];
|
|
781
747
|
var toFindtopOlUl = true;
|
|
748
|
+
var containsListElements = node;
|
|
749
|
+
while (containsListElements.parentElement) {
|
|
750
|
+
if (containsListElements.parentElement && containsListElements.parentElement.tagName !== 'LI' && containsListElements.parentElement.tagName !== 'OL' && containsListElements.parentElement.tagName !== 'UL') {
|
|
751
|
+
break;
|
|
752
|
+
}
|
|
753
|
+
containsListElements = containsListElements.parentElement;
|
|
754
|
+
}
|
|
782
755
|
if (toFindtopOlUl && (liParents[c].parentElement.parentElement.nodeName === 'OL' || liParents[c].parentElement.parentElement.nodeName === 'UL')) {
|
|
783
756
|
toFindtopOlUl = false;
|
|
784
757
|
var preElement = liParents[c].parentElement.parentElement;
|
|
@@ -798,9 +771,43 @@ var Lists = /** @class */ (function () {
|
|
|
798
771
|
node.previousElementSibling.lastChild.append(node);
|
|
799
772
|
}
|
|
800
773
|
}
|
|
774
|
+
else if (this.domNode.isList(node.previousElementSibling) && containsListElements.contains(node.previousElementSibling) && ((node.tagName === 'OL' || node.tagName === 'UL') && (node.previousElementSibling.nodeName === 'OL' || node.previousElementSibling.nodeName === 'UL'))) {
|
|
775
|
+
var contentNodes = this.domNode.contents(node);
|
|
776
|
+
for (var f = 0; f < contentNodes.length; f++) {
|
|
777
|
+
node.previousElementSibling.appendChild(contentNodes[f]);
|
|
778
|
+
}
|
|
779
|
+
node.parentNode.removeChild(node);
|
|
780
|
+
}
|
|
801
781
|
}
|
|
802
782
|
if (firstNodeOL) {
|
|
803
783
|
firstNodeOL.style.listStyleType = listStyleType;
|
|
784
|
+
var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
785
|
+
var listOlUlElements = [];
|
|
786
|
+
if (range.commonAncestorContainer.nodeName === 'UL' || range.commonAncestorContainer.nodeName === 'OL') {
|
|
787
|
+
if (range.commonAncestorContainer instanceof Element) {
|
|
788
|
+
listOlUlElements.push(range.commonAncestorContainer);
|
|
789
|
+
}
|
|
790
|
+
listOlUlElements = listOlUlElements.concat(Array.from(range.commonAncestorContainer.querySelectorAll('ol, ul')));
|
|
791
|
+
}
|
|
792
|
+
else {
|
|
793
|
+
listOlUlElements = Array.from(range.commonAncestorContainer.querySelectorAll('ol, ul'));
|
|
794
|
+
}
|
|
795
|
+
for (var k = 0; k < listOlUlElements.length; k++) {
|
|
796
|
+
var listStyle = void 0;
|
|
797
|
+
var listElements = listOlUlElements[k];
|
|
798
|
+
while (listElements) {
|
|
799
|
+
if (listElements.nodeName === 'OL' || listElements.nodeName === 'OL') {
|
|
800
|
+
if (listElements.style.listStyleType !== '' && listElements.style.listStyleType !== 'none' && listElements.nodeName !== 'LI') {
|
|
801
|
+
listStyle = listElements.style.listStyleType;
|
|
802
|
+
}
|
|
803
|
+
else if (!isNOU(listStyle) && (listElements.style.listStyleType === '' || listElements.style.listStyleType === 'none') &&
|
|
804
|
+
listElements.nodeName !== 'LI' && (listElements.nodeName === 'UL' || listElements.nodeName === 'OL')) {
|
|
805
|
+
listElements.style.listStyleType = listStyle;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
listElements = listElements.querySelector('UL,OL');
|
|
809
|
+
}
|
|
810
|
+
}
|
|
804
811
|
}
|
|
805
812
|
};
|
|
806
813
|
Lists.prototype.findUnSelected = function (temp, elements) {
|
|
@@ -909,10 +916,16 @@ var Lists = /** @class */ (function () {
|
|
|
909
916
|
parentNode.removeAttribute("style");
|
|
910
917
|
}
|
|
911
918
|
}
|
|
912
|
-
var wrapper = '<' +
|
|
919
|
+
var wrapper = '<' + e.enterAction + wrapperclass + this.domNode.attributes(element) + '></' + e.enterAction + '>';
|
|
913
920
|
if (e.enterAction !== 'BR') {
|
|
914
921
|
this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapper));
|
|
915
922
|
}
|
|
923
|
+
else {
|
|
924
|
+
var wrapperSpan = '<span class=e-rte-wrap-inner id=removeSpan></span>';
|
|
925
|
+
var br = document.createElement('br');
|
|
926
|
+
this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapperSpan));
|
|
927
|
+
element.appendChild(br);
|
|
928
|
+
}
|
|
916
929
|
}
|
|
917
930
|
else if (this.domNode.contents(element)[0].nodeType === 3) {
|
|
918
931
|
var replace = this.domNode.createTagString(CONSTANT.DEFAULT_TAG, parentNode, this.parent.domNode.encode(this.domNode.contents(element)[0].textContent));
|
|
@@ -925,8 +938,18 @@ var Lists = /** @class */ (function () {
|
|
|
925
938
|
}
|
|
926
939
|
else {
|
|
927
940
|
var childNode = element.firstChild;
|
|
941
|
+
if (childNode) {
|
|
942
|
+
var attributes_1 = element.parentElement.attributes;
|
|
943
|
+
if (attributes_1.length > 0) {
|
|
944
|
+
for (var d = 0; d < attributes_1.length; d++) {
|
|
945
|
+
var e_1 = attributes_1[d];
|
|
946
|
+
var existingValue = childNode.getAttribute(e_1.nodeName);
|
|
947
|
+
var parentValue = (element.parentElement).getAttribute(e_1.nodeName);
|
|
948
|
+
childNode.setAttribute(e_1.nodeName, existingValue ? parentValue + ' ' + existingValue : parentValue);
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
}
|
|
928
952
|
className = childNode.getAttribute('class');
|
|
929
|
-
attributes(childNode, this.domNode.rawAttributes(parentNode));
|
|
930
953
|
if (className && childNode.getAttribute('class')) {
|
|
931
954
|
attributes(childNode, { 'class': className + ' ' + childNode.getAttribute('class') });
|
|
932
955
|
}
|
|
@@ -5,7 +5,7 @@ import { PASTE_SOURCE } from '../base/constant';
|
|
|
5
5
|
* PasteCleanup for MsWord content
|
|
6
6
|
*
|
|
7
7
|
* @hidden
|
|
8
|
-
|
|
8
|
+
* @deprecated
|
|
9
9
|
*/
|
|
10
10
|
var MsWordPaste = /** @class */ (function () {
|
|
11
11
|
function MsWordPaste(parent) {
|
|
@@ -66,9 +66,9 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
66
66
|
var patern2 = /class="?Mso|style="[^ ]*\bmso-/i;
|
|
67
67
|
var patern3 = /(class="?Mso|class='?Mso|class="?Xl|class='?Xl|class=Xl|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument)/gi;
|
|
68
68
|
var pattern4 = /style='mso-width-source:/i;
|
|
69
|
+
var source = this.findSource(elm);
|
|
69
70
|
if (patern.test(tempHTMLContent) || patern2.test(tempHTMLContent) || patern3.test(tempHTMLContent) ||
|
|
70
71
|
pattern4.test(tempHTMLContent)) {
|
|
71
|
-
var source = this.findSource(elm);
|
|
72
72
|
tempHTMLContent = tempHTMLContent.replace(/<img[^>]+>/i, '');
|
|
73
73
|
this.addListClass(elm);
|
|
74
74
|
listNodes = this.cleanUp(elm, listNodes);
|
|
@@ -93,7 +93,7 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
93
93
|
e.callBack(elm.innerHTML, this.cropImageDimensions, source);
|
|
94
94
|
}
|
|
95
95
|
else {
|
|
96
|
-
e.callBack(elm.innerHTML);
|
|
96
|
+
e.callBack(elm.innerHTML, null, source);
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
MsWordPaste.prototype.addDoubleBr = function (elm) {
|
|
@@ -821,7 +821,7 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
821
821
|
!isNormalList) {
|
|
822
822
|
prevList = null;
|
|
823
823
|
}
|
|
824
|
-
var pElement = createElement('p', { className: '
|
|
824
|
+
var pElement = createElement('p', { className: 'MsoNoSpacing' });
|
|
825
825
|
pElement.innerHTML = collection[index].content.join(' ');
|
|
826
826
|
if ((collection[index].nestedLevel === 1) &&
|
|
827
827
|
(listCount === 0 || lfo !== collection[index].listFormatOverride) &&
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Split the Node based on selection
|
|
3
3
|
*
|
|
4
4
|
* @hidden
|
|
5
|
-
|
|
5
|
+
* @deprecated
|
|
6
6
|
*/
|
|
7
7
|
export declare class NodeCutter {
|
|
8
8
|
enterAction: string;
|
|
@@ -15,7 +15,7 @@ export declare class NodeCutter {
|
|
|
15
15
|
* @param {HTMLElement} node - specifies the node element.
|
|
16
16
|
* @returns {Node} - returns the node value
|
|
17
17
|
* @hidden
|
|
18
|
-
|
|
18
|
+
* @deprecated
|
|
19
19
|
*/
|
|
20
20
|
GetSpliceNode(range: Range, node: HTMLElement): Node;
|
|
21
21
|
/**
|
|
@@ -24,7 +24,7 @@ export declare class NodeCutter {
|
|
|
24
24
|
* @param {boolean} isCollapsed - specifies the boolean value
|
|
25
25
|
* @returns {HTMLElement} - returns the element
|
|
26
26
|
* @hidden
|
|
27
|
-
|
|
27
|
+
* @deprecated
|
|
28
28
|
*/
|
|
29
29
|
SplitNode(range: Range, node: HTMLElement, isCollapsed: boolean): HTMLElement;
|
|
30
30
|
private isRteElm;
|
|
@@ -38,7 +38,7 @@ export declare class NodeCutter {
|
|
|
38
38
|
* @param {Node} node - specifies the node.
|
|
39
39
|
* @returns {Range} - returns the range value
|
|
40
40
|
* @hidden
|
|
41
|
-
|
|
41
|
+
* @deprecated
|
|
42
42
|
*/
|
|
43
43
|
GetCursorRange(docElement: Document, range: Range, node: Node): Range;
|
|
44
44
|
/**
|
|
@@ -49,7 +49,7 @@ export declare class NodeCutter {
|
|
|
49
49
|
* @param {Node} node - specifies the node.
|
|
50
50
|
* @returns {Node} - returns the node value
|
|
51
51
|
* @hidden
|
|
52
|
-
|
|
52
|
+
* @deprecated
|
|
53
53
|
*/
|
|
54
54
|
GetCursorNode(docElement: Document, range: Range, node: Node): Node;
|
|
55
55
|
/**
|
|
@@ -58,7 +58,7 @@ export declare class NodeCutter {
|
|
|
58
58
|
* @param {string} line - specifies the string value.
|
|
59
59
|
* @returns {string} - returns the string
|
|
60
60
|
* @hidden
|
|
61
|
-
|
|
61
|
+
* @deprecated
|
|
62
62
|
*/
|
|
63
63
|
TrimLineBreak(line: string): string;
|
|
64
64
|
}
|