@syncfusion/ej2-richtexteditor 24.1.41 → 24.1.43-569781
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 +1927 -1775
- 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 +2601 -1077
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +2706 -1181
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- 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/config.d.ts +7 -0
- package/src/common/config.js +11 -0
- package/src/common/constant.d.ts +6 -0
- package/src/common/constant.js +6 -0
- package/src/common/interface.d.ts +19 -7
- package/src/common/types.d.ts +6 -0
- package/src/common/util.d.ts +6 -0
- package/src/common/util.js +61 -20
- package/src/editor-manager/base/classes.d.ts +1 -1
- package/src/editor-manager/base/classes.js +1 -1
- package/src/editor-manager/base/constant.d.ts +6 -0
- package/src/editor-manager/base/constant.js +6 -0
- package/src/editor-manager/base/editor-manager.d.ts +8 -3
- package/src/editor-manager/base/editor-manager.js +62 -3
- package/src/editor-manager/base/enum.d.ts +2 -2
- package/src/editor-manager/base/interface.d.ts +17 -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 +2 -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 +39 -35
- package/src/editor-manager/plugin/dom-node.js +203 -49
- package/src/editor-manager/plugin/format-painter-actions.d.ts +2 -1
- package/src/editor-manager/plugin/format-painter-actions.js +20 -2
- package/src/editor-manager/plugin/formats.d.ts +3 -2
- package/src/editor-manager/plugin/formats.js +40 -5
- package/src/editor-manager/plugin/image.d.ts +3 -3
- package/src/editor-manager/plugin/image.js +15 -19
- package/src/editor-manager/plugin/indents.d.ts +2 -2
- package/src/editor-manager/plugin/indents.js +2 -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 +3 -2
- package/src/editor-manager/plugin/inserthtml.js +64 -7
- 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 +6 -3
- package/src/editor-manager/plugin/lists.d.ts +2 -2
- package/src/editor-manager/plugin/lists.js +123 -67
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +4 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +213 -86
- 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 +2 -1
- package/src/editor-manager/plugin/selection-commands.js +127 -4
- 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 -3
- package/src/editor-manager/plugin/table.js +35 -32
- package/src/editor-manager/plugin/toolbar-status.d.ts +4 -4
- package/src/editor-manager/plugin/toolbar-status.js +22 -12
- package/src/editor-manager/plugin/undo.d.ts +7 -6
- package/src/editor-manager/plugin/undo.js +27 -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 +12 -12
- package/src/rich-text-editor/actions/base-quick-toolbar.js +57 -20
- package/src/rich-text-editor/actions/base-toolbar.d.ts +3 -3
- package/src/rich-text-editor/actions/base-toolbar.js +35 -37
- package/src/rich-text-editor/actions/color-picker.d.ts +3 -2
- package/src/rich-text-editor/actions/color-picker.js +12 -2
- package/src/rich-text-editor/actions/count.d.ts +3 -3
- package/src/rich-text-editor/actions/count.js +4 -4
- package/src/rich-text-editor/actions/dropdown-buttons.d.ts +2 -2
- package/src/rich-text-editor/actions/dropdown-buttons.js +23 -4
- package/src/rich-text-editor/actions/emoji-picker.d.ts +1 -1
- package/src/rich-text-editor/actions/emoji-picker.js +4 -4
- package/src/rich-text-editor/actions/enter-key.js +4 -3
- package/src/rich-text-editor/actions/full-screen.d.ts +3 -3
- package/src/rich-text-editor/actions/full-screen.js +6 -5
- package/src/rich-text-editor/actions/html-editor.d.ts +5 -5
- package/src/rich-text-editor/actions/html-editor.js +129 -45
- 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 +23 -21
- package/src/rich-text-editor/actions/markdown-editor.d.ts +2 -2
- package/src/rich-text-editor/actions/markdown-editor.js +5 -3
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +4 -1
- package/src/rich-text-editor/actions/paste-clean-up.js +87 -12
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +16 -9
- package/src/rich-text-editor/actions/quick-toolbar.js +33 -18
- package/src/rich-text-editor/actions/resize.js +2 -1
- package/src/rich-text-editor/actions/toolbar-action.js +1 -1
- package/src/rich-text-editor/actions/toolbar.d.ts +15 -16
- package/src/rich-text-editor/actions/toolbar.js +31 -100
- 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 -126
- package/src/rich-text-editor/base/classes.js +121 -126
- package/src/rich-text-editor/base/constant.d.ts +190 -150
- package/src/rich-text-editor/base/constant.js +359 -150
- package/src/rich-text-editor/base/enum.d.ts +1 -1
- package/src/rich-text-editor/base/enum.js +1 -1
- package/src/rich-text-editor/base/interface.d.ts +87 -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 +68 -65
- package/src/rich-text-editor/base/rich-text-editor.js +232 -199
- package/src/rich-text-editor/base/util.d.ts +5 -1
- package/src/rich-text-editor/base/util.js +47 -4
- package/src/rich-text-editor/formatter/formatter.d.ts +8 -8
- package/src/rich-text-editor/formatter/formatter.js +23 -12
- 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/default-locale.js +30 -26
- 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/items.js +2 -2
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +760 -760
- package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.js +20 -20
- package/src/rich-text-editor/renderer/audio-module.d.ts +2 -1
- package/src/rich-text-editor/renderer/audio-module.js +14 -1
- 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 +4 -2
- package/src/rich-text-editor/renderer/dialog-renderer.js +14 -3
- package/src/rich-text-editor/renderer/iframe-content-renderer.d.ts +4 -4
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +19 -18
- package/src/rich-text-editor/renderer/image-module.d.ts +10 -2
- package/src/rich-text-editor/renderer/image-module.js +200 -168
- package/src/rich-text-editor/renderer/link-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/link-module.js +11 -2
- 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 +9 -2
- package/src/rich-text-editor/renderer/table-module.js +289 -137
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +13 -9
- package/src/rich-text-editor/renderer/toolbar-renderer.js +103 -24
- package/src/rich-text-editor/renderer/video-module.d.ts +4 -1
- package/src/rich-text-editor/renderer/video-module.js +62 -35
- package/src/rich-text-editor/renderer/view-source.d.ts +7 -6
- package/src/rich-text-editor/renderer/view-source.js +18 -10
- 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 +25 -22
- package/styles/_all.scss +1 -1
- package/styles/bootstrap-dark.css +153 -49
- package/styles/bootstrap.css +158 -57
- package/styles/bootstrap4.css +145 -45
- package/styles/bootstrap5-dark.css +150 -45
- package/styles/bootstrap5.css +150 -45
- package/styles/fabric-dark.css +139 -39
- package/styles/fabric.css +140 -40
- package/styles/fluent-dark.css +147 -41
- package/styles/fluent.css +147 -41
- package/styles/highcontrast-light.css +139 -39
- package/styles/highcontrast.css +143 -40
- package/styles/material-dark.css +143 -39
- package/styles/material.css +143 -39
- package/styles/material3-dark.css +155 -49
- package/styles/material3-dark.scss +1 -1
- package/styles/material3.css +155 -49
- package/styles/material3.scss +1 -1
- package/styles/rich-text-editor/_all.scss +2 -2
- package/styles/rich-text-editor/_bds-definition.scss +279 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +281 -277
- package/styles/rich-text-editor/_bootstrap-definition.scss +337 -334
- package/styles/rich-text-editor/_bootstrap4-definition.scss +464 -460
- package/styles/rich-text-editor/_bootstrap5-definition.scss +266 -262
- package/styles/rich-text-editor/_fabric-dark-definition.scss +263 -259
- package/styles/rich-text-editor/_fabric-definition.scss +261 -257
- package/styles/rich-text-editor/_fluent-definition.scss +267 -263
- package/styles/rich-text-editor/_fusionnew-definition.scss +265 -261
- package/styles/rich-text-editor/_highcontrast-definition.scss +261 -257
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +261 -257
- package/styles/rich-text-editor/_layout.scss +2249 -2147
- package/styles/rich-text-editor/_material-dark-definition.scss +266 -262
- package/styles/rich-text-editor/_material-definition.scss +264 -260
- package/styles/rich-text-editor/_material3-definition.scss +266 -262
- package/styles/rich-text-editor/_tailwind-definition.scss +261 -257
- package/styles/rich-text-editor/_theme.scss +906 -837
- package/styles/rich-text-editor/bootstrap-dark.css +153 -49
- package/styles/rich-text-editor/bootstrap.css +158 -57
- package/styles/rich-text-editor/bootstrap4.css +145 -45
- package/styles/rich-text-editor/bootstrap5-dark.css +150 -45
- package/styles/rich-text-editor/bootstrap5.css +150 -45
- package/styles/rich-text-editor/fabric-dark.css +139 -39
- package/styles/rich-text-editor/fabric.css +140 -40
- package/styles/rich-text-editor/fluent-dark.css +147 -41
- package/styles/rich-text-editor/fluent.css +147 -41
- package/styles/rich-text-editor/highcontrast-light.css +139 -39
- package/styles/rich-text-editor/highcontrast.css +143 -40
- package/styles/rich-text-editor/icons/_bds.scss +348 -0
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +349 -349
- package/styles/rich-text-editor/icons/_bootstrap.scss +349 -349
- package/styles/rich-text-editor/icons/_bootstrap4.scss +349 -349
- package/styles/rich-text-editor/icons/_bootstrap5.scss +348 -348
- package/styles/rich-text-editor/icons/_fabric-dark.scss +349 -349
- package/styles/rich-text-editor/icons/_fabric.scss +349 -349
- package/styles/rich-text-editor/icons/_fluent.scss +348 -348
- package/styles/rich-text-editor/icons/_fusionnew.scss +348 -348
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +349 -349
- package/styles/rich-text-editor/icons/_highcontrast.scss +349 -349
- package/styles/rich-text-editor/icons/_material-dark.scss +349 -349
- package/styles/rich-text-editor/icons/_material.scss +349 -349
- package/styles/rich-text-editor/icons/_material3.scss +348 -348
- package/styles/rich-text-editor/icons/_tailwind.scss +348 -348
- package/styles/rich-text-editor/material-dark.css +143 -39
- package/styles/rich-text-editor/material.css +143 -39
- package/styles/rich-text-editor/material3-dark.css +155 -49
- package/styles/rich-text-editor/material3-dark.scss +1 -1
- package/styles/rich-text-editor/material3.css +155 -49
- package/styles/rich-text-editor/material3.scss +1 -1
- package/styles/rich-text-editor/tailwind-dark.css +194 -66
- package/styles/rich-text-editor/tailwind.css +194 -66
- package/styles/tailwind-dark.css +194 -66
- package/styles/tailwind.css +194 -66
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -41
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -27
- 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
|
@@ -7,7 +7,7 @@ import { NodeCutter } from './nodecutter';
|
|
|
7
7
|
* Formats internal component
|
|
8
8
|
*
|
|
9
9
|
* @hidden
|
|
10
|
-
|
|
10
|
+
* @deprecated
|
|
11
11
|
*/
|
|
12
12
|
var Formats = /** @class */ (function () {
|
|
13
13
|
/**
|
|
@@ -15,7 +15,7 @@ var Formats = /** @class */ (function () {
|
|
|
15
15
|
*
|
|
16
16
|
* @param {EditorManager} parent - specifies the parent element.
|
|
17
17
|
* @hidden
|
|
18
|
-
|
|
18
|
+
* @deprecated
|
|
19
19
|
*/
|
|
20
20
|
function Formats(parent) {
|
|
21
21
|
this.parent = parent;
|
|
@@ -52,6 +52,14 @@ var Formats = /** @class */ (function () {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
+
Formats.prototype.getBlockParent = function (node, endNode) {
|
|
56
|
+
var currentParent;
|
|
57
|
+
while (node != endNode) {
|
|
58
|
+
currentParent = node;
|
|
59
|
+
node = node.parentElement;
|
|
60
|
+
}
|
|
61
|
+
return currentParent;
|
|
62
|
+
};
|
|
55
63
|
Formats.prototype.onKeyDown = function (e) {
|
|
56
64
|
if (e.event.which === 13) {
|
|
57
65
|
var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
@@ -61,6 +69,8 @@ var Formats = /** @class */ (function () {
|
|
|
61
69
|
? range.endContainer : range.endContainer.parentElement;
|
|
62
70
|
var preElem = closest(startCon, 'pre');
|
|
63
71
|
var endPreElem = closest(endCon, 'pre');
|
|
72
|
+
var blockquoteEle = closest(startCon, 'blockquote');
|
|
73
|
+
var endBlockquoteEle = closest(endCon, 'blockquote');
|
|
64
74
|
var liParent = !isNOU(preElem) && !isNOU(preElem.parentElement) && preElem.parentElement.tagName === 'LI';
|
|
65
75
|
if (liParent) {
|
|
66
76
|
return;
|
|
@@ -72,6 +82,17 @@ var Formats = /** @class */ (function () {
|
|
|
72
82
|
range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
73
83
|
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, endCon, 0);
|
|
74
84
|
}
|
|
85
|
+
if (e.event.which === 13 && ((!isNOU(blockquoteEle) && !isNOU(endBlockquoteEle)) || (!isNOU(blockquoteEle) && isNOU(endBlockquoteEle)))) {
|
|
86
|
+
var startParent = this.getBlockParent(range.startContainer, blockquoteEle);
|
|
87
|
+
if ((startParent.textContent.charCodeAt(0) === 8203 &&
|
|
88
|
+
startParent.textContent.length === 1) || startParent.textContent.length === 0) {
|
|
89
|
+
if (isNOU(startParent.nextSibling) && ((startParent.previousSibling.textContent.charCodeAt(0) === 8203 &&
|
|
90
|
+
startParent.previousSibling.textContent.length === 1) || startParent.previousSibling.textContent.length === 0)) {
|
|
91
|
+
e.event.preventDefault();
|
|
92
|
+
this.paraFocus(startParent.parentElement); //Revert from blockquotes while pressing enter key
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
75
96
|
if (e.event.which === 13 && !isNOU(preElem) && !isNOU(endPreElem)) {
|
|
76
97
|
e.event.preventDefault();
|
|
77
98
|
this.deleteContent(range);
|
|
@@ -221,7 +242,7 @@ var Formats = /** @class */ (function () {
|
|
|
221
242
|
}
|
|
222
243
|
var save = this.parent.nodeSelection.save(range, this.parent.currentDocument);
|
|
223
244
|
this.parent.domNode.setMarker(save);
|
|
224
|
-
var formatsNodes = this.parent.domNode.blockNodes();
|
|
245
|
+
var formatsNodes = this.parent.domNode.blockNodes(true);
|
|
225
246
|
if (e.enterAction === 'BR') {
|
|
226
247
|
this.setSelectionBRConfig();
|
|
227
248
|
var allSelectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument);
|
|
@@ -295,7 +316,7 @@ var Formats = /** @class */ (function () {
|
|
|
295
316
|
replaceHTML = parentNode.innerHTML;
|
|
296
317
|
}
|
|
297
318
|
if ((e.subCommand.toLowerCase() === parentNode.tagName.toLowerCase() &&
|
|
298
|
-
(e.subCommand.toLowerCase() !== 'pre' ||
|
|
319
|
+
(e.subCommand.toLowerCase() !== 'pre' && e.subCommand.toLowerCase() !== 'blockquote' ||
|
|
299
320
|
(!isNOU(e.exeValue) && e.exeValue.name === 'dropDownSelect'))) ||
|
|
300
321
|
isNOU(parentNode.parentNode) ||
|
|
301
322
|
(parentNode.tagName === 'TABLE' && e.subCommand.toLowerCase() === 'pre')) {
|
|
@@ -304,7 +325,21 @@ var Formats = /** @class */ (function () {
|
|
|
304
325
|
this.cleanFormats(parentNode, e.subCommand);
|
|
305
326
|
var replaceNode = (e.subCommand.toLowerCase() === 'pre' && parentNode.tagName.toLowerCase() === 'pre') ?
|
|
306
327
|
'p' : e.subCommand;
|
|
307
|
-
var
|
|
328
|
+
var isToggleBlockquoteList = e.subCommand.toLowerCase() === parentNode.tagName.toLowerCase() &&
|
|
329
|
+
e.subCommand.toLowerCase() === 'blockquote' && this.parent.domNode.isList(parentNode.firstElementChild);
|
|
330
|
+
var isToggleBlockquote = e.subCommand.toLowerCase() === parentNode.tagName.toLowerCase()
|
|
331
|
+
&& e.subCommand.toLowerCase() === 'blockquote';
|
|
332
|
+
var replaceTag = void 0;
|
|
333
|
+
if (isToggleBlockquoteList) {
|
|
334
|
+
replaceTag = replaceHTML.replace(/>\s+</g, '><');
|
|
335
|
+
}
|
|
336
|
+
else if (isToggleBlockquote) {
|
|
337
|
+
var tagWrap = (e.enterAction == 'BR' || e.enterAction == 'P') ? 'P' : e.enterAction;
|
|
338
|
+
replaceTag = this.parent.domNode.createTagString(tagWrap, parentNode, replaceHTML.replace(/>\s+</g, '><'));
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
replaceTag = this.parent.domNode.createTagString(replaceNode, parentNode, replaceHTML.replace(/>\s+</g, '><'));
|
|
342
|
+
}
|
|
308
343
|
if (parentNode.tagName === 'LI') {
|
|
309
344
|
parentNode.innerHTML = '';
|
|
310
345
|
parentNode.insertAdjacentHTML('beforeend', replaceTag);
|
|
@@ -4,7 +4,7 @@ import { IHtmlItem } from './../base/interface';
|
|
|
4
4
|
* Link internal component
|
|
5
5
|
*
|
|
6
6
|
* @hidden
|
|
7
|
-
|
|
7
|
+
* @deprecated
|
|
8
8
|
*/
|
|
9
9
|
export declare class ImageCommand {
|
|
10
10
|
private parent;
|
|
@@ -13,7 +13,7 @@ export declare class ImageCommand {
|
|
|
13
13
|
*
|
|
14
14
|
* @param {EditorManager} parent - specifies the parent element
|
|
15
15
|
* @hidden
|
|
16
|
-
|
|
16
|
+
* @deprecated
|
|
17
17
|
*/
|
|
18
18
|
constructor(parent: EditorManager);
|
|
19
19
|
private addEventListener;
|
|
@@ -23,7 +23,7 @@ export declare class ImageCommand {
|
|
|
23
23
|
* @param {IHtmlItem} e - specifies the element
|
|
24
24
|
* @returns {void}
|
|
25
25
|
* @hidden
|
|
26
|
-
|
|
26
|
+
* @deprecated
|
|
27
27
|
*/
|
|
28
28
|
imageCommand(e: IHtmlItem): void;
|
|
29
29
|
private createImage;
|
|
@@ -6,7 +6,7 @@ import { InsertHtml } from './inserthtml';
|
|
|
6
6
|
* Link internal component
|
|
7
7
|
*
|
|
8
8
|
* @hidden
|
|
9
|
-
|
|
9
|
+
* @deprecated
|
|
10
10
|
*/
|
|
11
11
|
var ImageCommand = /** @class */ (function () {
|
|
12
12
|
/**
|
|
@@ -14,7 +14,7 @@ var ImageCommand = /** @class */ (function () {
|
|
|
14
14
|
*
|
|
15
15
|
* @param {EditorManager} parent - specifies the parent element
|
|
16
16
|
* @hidden
|
|
17
|
-
|
|
17
|
+
* @deprecated
|
|
18
18
|
*/
|
|
19
19
|
function ImageCommand(parent) {
|
|
20
20
|
this.parent = parent;
|
|
@@ -29,7 +29,7 @@ var ImageCommand = /** @class */ (function () {
|
|
|
29
29
|
* @param {IHtmlItem} e - specifies the element
|
|
30
30
|
* @returns {void}
|
|
31
31
|
* @hidden
|
|
32
|
-
|
|
32
|
+
* @deprecated
|
|
33
33
|
*/
|
|
34
34
|
ImageCommand.prototype.imageCommand = function (e) {
|
|
35
35
|
switch (e.value.toString().toLowerCase()) {
|
|
@@ -79,7 +79,6 @@ var ImageCommand = /** @class */ (function () {
|
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
81
|
ImageCommand.prototype.createImage = function (e) {
|
|
82
|
-
var _this = this;
|
|
83
82
|
var isReplaced = false;
|
|
84
83
|
e.item.url = isNOU(e.item.url) || e.item.url === 'undefined' ? e.item.src : e.item.url;
|
|
85
84
|
if (!isNOU(e.item.selectParent) && e.item.selectParent[0].tagName === 'IMG') {
|
|
@@ -109,21 +108,18 @@ var ImageCommand = /** @class */ (function () {
|
|
|
109
108
|
var selectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)[0];
|
|
110
109
|
var imgElm_1 = (e.value === 'Replace' || isReplaced) ? e.item.selectParent[0] :
|
|
111
110
|
(Browser.isIE ? selectedNode.previousSibling : selectedNode.previousElementSibling);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (e.value === 'Replace') {
|
|
125
|
-
e.item.subCommand = 'Replace';
|
|
126
|
-
this.callBack(e);
|
|
111
|
+
var imageInstance_1 = this;
|
|
112
|
+
var onImageLoadEvent_1 = function () {
|
|
113
|
+
e.callBack({
|
|
114
|
+
requestType: (e.value === 'Replace') ? (e.item.subCommand = 'Replace', "Replace") : 'Images',
|
|
115
|
+
editorMode: 'HTML',
|
|
116
|
+
event: e.event,
|
|
117
|
+
range: imageInstance_1.parent.nodeSelection.getRange(imageInstance_1.parent.currentDocument),
|
|
118
|
+
elements: [imgElm_1]
|
|
119
|
+
});
|
|
120
|
+
imgElm_1.removeEventListener('load', onImageLoadEvent_1);
|
|
121
|
+
};
|
|
122
|
+
imgElm_1.addEventListener('load', onImageLoadEvent_1);
|
|
127
123
|
}
|
|
128
124
|
};
|
|
129
125
|
ImageCommand.prototype.setStyle = function (imgElement, e, imgReplace) {
|
|
@@ -3,7 +3,7 @@ import { EditorManager } from './../base/editor-manager';
|
|
|
3
3
|
* Indents internal component
|
|
4
4
|
*
|
|
5
5
|
* @hidden
|
|
6
|
-
|
|
6
|
+
* @deprecated
|
|
7
7
|
*/
|
|
8
8
|
export declare class Indents {
|
|
9
9
|
private parent;
|
|
@@ -13,7 +13,7 @@ export declare class Indents {
|
|
|
13
13
|
*
|
|
14
14
|
* @param {EditorManager} parent - specifies the parent element
|
|
15
15
|
* @hidden
|
|
16
|
-
|
|
16
|
+
* @deprecated
|
|
17
17
|
*/
|
|
18
18
|
constructor(parent: EditorManager);
|
|
19
19
|
private addEventListener;
|
|
@@ -5,7 +5,7 @@ import { isIDevice, setEditFrameFocus } from '../../common/util';
|
|
|
5
5
|
* Indents internal component
|
|
6
6
|
*
|
|
7
7
|
* @hidden
|
|
8
|
-
|
|
8
|
+
* @deprecated
|
|
9
9
|
*/
|
|
10
10
|
var Indents = /** @class */ (function () {
|
|
11
11
|
/**
|
|
@@ -13,7 +13,7 @@ var Indents = /** @class */ (function () {
|
|
|
13
13
|
*
|
|
14
14
|
* @param {EditorManager} parent - specifies the parent element
|
|
15
15
|
* @hidden
|
|
16
|
-
|
|
16
|
+
* @deprecated
|
|
17
17
|
*/
|
|
18
18
|
function Indents(parent) {
|
|
19
19
|
this.indentValue = 20;
|
|
@@ -12,7 +12,7 @@ export declare class InsertMethods {
|
|
|
12
12
|
* @param {boolean} isAfter - specifies the boolean value
|
|
13
13
|
* @returns {Text} - returns the text value
|
|
14
14
|
* @hidden
|
|
15
|
-
|
|
15
|
+
* @deprecated
|
|
16
16
|
*/
|
|
17
17
|
static WrapBefore(textNode: Text, parentNode: HTMLElement, isAfter?: boolean): Text;
|
|
18
18
|
/**
|
|
@@ -22,7 +22,7 @@ export declare class InsertMethods {
|
|
|
22
22
|
* @param {HTMLElement} parentNode - specifies the parent node.
|
|
23
23
|
* @returns {HTMLElement} - returns the element
|
|
24
24
|
* @hidden
|
|
25
|
-
|
|
25
|
+
* @deprecated
|
|
26
26
|
*/
|
|
27
27
|
static Wrap(childNode: HTMLElement, parentNode: HTMLElement): HTMLElement;
|
|
28
28
|
/**
|
|
@@ -31,7 +31,7 @@ export declare class InsertMethods {
|
|
|
31
31
|
* @param {Node} node - specifies the node element.
|
|
32
32
|
* @returns {Node[]} - returns the array of value
|
|
33
33
|
* @hidden
|
|
34
|
-
|
|
34
|
+
* @deprecated
|
|
35
35
|
*/
|
|
36
36
|
static unwrap(node: Node | HTMLElement): Node[];
|
|
37
37
|
/**
|
|
@@ -42,7 +42,7 @@ export declare class InsertMethods {
|
|
|
42
42
|
* @param {boolean} isAfter - specifies the boolean value
|
|
43
43
|
* @returns {void}
|
|
44
44
|
* @hidden
|
|
45
|
-
|
|
45
|
+
* @deprecated
|
|
46
46
|
*/
|
|
47
47
|
static AppendBefore(textNode: HTMLElement | Text | DocumentFragment, parentNode: HTMLElement | Text | DocumentFragment, isAfter?: boolean): HTMLElement | Text | DocumentFragment;
|
|
48
48
|
}
|
|
@@ -14,7 +14,7 @@ var InsertMethods = /** @class */ (function () {
|
|
|
14
14
|
* @param {boolean} isAfter - specifies the boolean value
|
|
15
15
|
* @returns {Text} - returns the text value
|
|
16
16
|
* @hidden
|
|
17
|
-
|
|
17
|
+
* @deprecated
|
|
18
18
|
*/
|
|
19
19
|
InsertMethods.WrapBefore = function (textNode, parentNode, isAfter) {
|
|
20
20
|
parentNode.innerText = textNode.textContent;
|
|
@@ -32,7 +32,7 @@ var InsertMethods = /** @class */ (function () {
|
|
|
32
32
|
* @param {HTMLElement} parentNode - specifies the parent node.
|
|
33
33
|
* @returns {HTMLElement} - returns the element
|
|
34
34
|
* @hidden
|
|
35
|
-
|
|
35
|
+
* @deprecated
|
|
36
36
|
*/
|
|
37
37
|
InsertMethods.Wrap = function (childNode, parentNode) {
|
|
38
38
|
this.AppendBefore(parentNode, childNode);
|
|
@@ -45,7 +45,7 @@ var InsertMethods = /** @class */ (function () {
|
|
|
45
45
|
* @param {Node} node - specifies the node element.
|
|
46
46
|
* @returns {Node[]} - returns the array of value
|
|
47
47
|
* @hidden
|
|
48
|
-
|
|
48
|
+
* @deprecated
|
|
49
49
|
*/
|
|
50
50
|
InsertMethods.unwrap = function (node) {
|
|
51
51
|
var parent = node.parentNode;
|
|
@@ -64,7 +64,7 @@ var InsertMethods = /** @class */ (function () {
|
|
|
64
64
|
* @param {boolean} isAfter - specifies the boolean value
|
|
65
65
|
* @returns {void}
|
|
66
66
|
* @hidden
|
|
67
|
-
|
|
67
|
+
* @deprecated
|
|
68
68
|
*/
|
|
69
69
|
InsertMethods.AppendBefore = function (textNode, parentNode, isAfter) {
|
|
70
70
|
return (parentNode.parentNode) ? ((!isAfter) ? parentNode.parentNode.insertBefore(textNode, parentNode)
|
|
@@ -3,7 +3,7 @@ import { EditorManager } from '../base/editor-manager';
|
|
|
3
3
|
* Insert a Text Node or Text
|
|
4
4
|
*
|
|
5
5
|
* @hidden
|
|
6
|
-
|
|
6
|
+
* @deprecated
|
|
7
7
|
*/
|
|
8
8
|
export declare class InsertTextExec {
|
|
9
9
|
private parent;
|
|
@@ -12,7 +12,7 @@ export declare class InsertTextExec {
|
|
|
12
12
|
*
|
|
13
13
|
* @param {EditorManager} parent - specifies 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
|
* 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;
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* Insert a HTML Node or Text
|
|
3
3
|
*
|
|
4
4
|
* @hidden
|
|
5
|
-
|
|
5
|
+
* @deprecated
|
|
6
6
|
*/
|
|
7
7
|
export declare class InsertHtml {
|
|
8
8
|
/**
|
|
9
9
|
* Insert method
|
|
10
10
|
*
|
|
11
11
|
* @hidden
|
|
12
|
-
|
|
12
|
+
* @deprecated
|
|
13
13
|
*/
|
|
14
14
|
static inlineNode: string[];
|
|
15
15
|
static contentsDeleted: boolean;
|
|
@@ -26,4 +26,5 @@ export declare class InsertHtml {
|
|
|
26
26
|
private static findDetachEmptyElem;
|
|
27
27
|
private static removeEmptyElements;
|
|
28
28
|
private static closestEle;
|
|
29
|
+
private static insertTableInList;
|
|
29
30
|
}
|
|
@@ -3,12 +3,12 @@ import { NodeCutter } from './nodecutter';
|
|
|
3
3
|
import * as CONSTANT from './../base/constant';
|
|
4
4
|
import { detach, Browser, isNullOrUndefined as isNOU, createElement, closest } from '@syncfusion/ej2-base';
|
|
5
5
|
import { InsertMethods } from './insert-methods';
|
|
6
|
-
import { updateTextNode } from './../../common/util';
|
|
6
|
+
import { updateTextNode, nestedListCleanUp } from './../../common/util';
|
|
7
7
|
/**
|
|
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() {
|
|
@@ -59,6 +59,10 @@ var InsertHtml = /** @class */ (function () {
|
|
|
59
59
|
var isCollapsed = range.collapsed;
|
|
60
60
|
var nodes = this.getNodeCollection(range, nodeSelection, node);
|
|
61
61
|
var closestParentNode = (node.nodeName.toLowerCase() === 'table') ? this.closestEle(nodes[0].parentNode, editNode) : nodes[0];
|
|
62
|
+
if (closestParentNode && closestParentNode.nodeName === 'LI' && node.nodeName.toLowerCase() === 'table') {
|
|
63
|
+
this.insertTableInList(range, node, closestParentNode, nodes[0], nodeCutter);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
62
66
|
if (isExternal || (!isNOU(node) && !isNOU(node.classList) &&
|
|
63
67
|
node.classList.contains('pasteContent'))) {
|
|
64
68
|
this.pasteInsertHTML(nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode, enterAction);
|
|
@@ -82,7 +86,12 @@ var InsertHtml = /** @class */ (function () {
|
|
|
82
86
|
lasNode.textContent.length : lasNode.childNodes.length);
|
|
83
87
|
range = nodeSelection.getRange(docElement);
|
|
84
88
|
}
|
|
85
|
-
range.
|
|
89
|
+
if (range.startContainer.parentElement.closest('ol,ul') !== null && range.endContainer.parentElement.closest('ol,ul') !== null) {
|
|
90
|
+
nestedListCleanUp(range);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
range.extractContents();
|
|
94
|
+
}
|
|
86
95
|
if (insertNode.tagName === 'TABLE') {
|
|
87
96
|
this.removeEmptyElements(editNode);
|
|
88
97
|
}
|
|
@@ -206,7 +215,12 @@ var InsertHtml = /** @class */ (function () {
|
|
|
206
215
|
CONSTANT.TABLE_BLOCK_TAGS.indexOf(closestParentNode.tagName.toLocaleLowerCase()) !== -1))
|
|
207
216
|
|| (node.nodeName.toLowerCase() === 'table' && closestParentNode &&
|
|
208
217
|
CONSTANT.TABLE_BLOCK_TAGS.indexOf(closestParentNode.tagName.toLocaleLowerCase()) === -1))) {
|
|
209
|
-
|
|
218
|
+
if (isCollapsed) {
|
|
219
|
+
preNode = nodeCutter.SplitNode(range, closestParentNode, true);
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
preNode = nodeCutter.SplitNode(range, closestParentNode, false);
|
|
223
|
+
}
|
|
210
224
|
sibNode = isNOU(preNode.previousSibling) ? preNode.parentNode.previousSibling : preNode.previousSibling;
|
|
211
225
|
if (nodes.length === 1) {
|
|
212
226
|
nodeSelection.setSelectionContents(docElement, preNode);
|
|
@@ -243,12 +257,17 @@ var InsertHtml = /** @class */ (function () {
|
|
|
243
257
|
preNode.parentNode.replaceChild(fragment, preNode);
|
|
244
258
|
}
|
|
245
259
|
else {
|
|
260
|
+
var startContainerParent = range.startContainer.parentNode;
|
|
261
|
+
// Get the index of the start container among its siblings
|
|
262
|
+
var startIndex = Array.prototype.indexOf.call(startContainerParent.childNodes, range.startContainer);
|
|
246
263
|
range.deleteContents();
|
|
264
|
+
range.setStart(startContainerParent, startIndex);
|
|
265
|
+
range.setEnd(startContainerParent, startIndex);
|
|
247
266
|
if (!isNOU(lasNode)) {
|
|
248
267
|
detach(lasNode);
|
|
249
268
|
}
|
|
250
269
|
// eslint-disable-next-line
|
|
251
|
-
!isNOU(sibNode) ? sibNode.parentNode.appendChild(fragment) :
|
|
270
|
+
!isNOU(sibNode) ? (sibNode.parentNode === editNode ? sibNode.appendChild(fragment) : sibNode.parentNode.appendChild(fragment)) : range.insertNode(fragment);
|
|
252
271
|
}
|
|
253
272
|
}
|
|
254
273
|
else {
|
|
@@ -288,6 +307,9 @@ var InsertHtml = /** @class */ (function () {
|
|
|
288
307
|
var paraElm = void 0;
|
|
289
308
|
var previousParent = void 0;
|
|
290
309
|
if (!this.contentsDeleted) {
|
|
310
|
+
if (!isCollapsed && range.startContainer.parentElement.textContent.length === 0 && range.startContainer.nodeName === 'BR' && range.startContainer.parentElement.nodeName === 'P') {
|
|
311
|
+
editNode.removeChild(range.startContainer.parentElement);
|
|
312
|
+
}
|
|
291
313
|
range.deleteContents();
|
|
292
314
|
}
|
|
293
315
|
while (node.firstChild) {
|
|
@@ -473,7 +495,15 @@ var InsertHtml = /** @class */ (function () {
|
|
|
473
495
|
};
|
|
474
496
|
InsertHtml.imageFocus = function (node, nodeSelection, docElement) {
|
|
475
497
|
var focusNode = document.createTextNode(' ');
|
|
476
|
-
node.parentNode
|
|
498
|
+
if (node.parentNode && node.parentNode.nodeName === 'A') {
|
|
499
|
+
var anchorTag = node.parentNode;
|
|
500
|
+
var parentNode = anchorTag.parentNode;
|
|
501
|
+
parentNode.insertBefore(focusNode, anchorTag.nextSibling);
|
|
502
|
+
parentNode.insertBefore(node, focusNode);
|
|
503
|
+
}
|
|
504
|
+
else {
|
|
505
|
+
node.parentNode.insertBefore(focusNode, node.nextSibling);
|
|
506
|
+
}
|
|
477
507
|
nodeSelection.setSelectionText(docElement, node.nextSibling, node.nextSibling, 0, 0);
|
|
478
508
|
};
|
|
479
509
|
// eslint-disable-next-line
|
|
@@ -528,6 +558,9 @@ var InsertHtml = /** @class */ (function () {
|
|
|
528
558
|
};
|
|
529
559
|
InsertHtml.closestEle = function (element, editNode) {
|
|
530
560
|
var el = element;
|
|
561
|
+
if (closest(el, 'li')) {
|
|
562
|
+
return closest(el, 'li');
|
|
563
|
+
}
|
|
531
564
|
while (el && el.nodeType === 1) {
|
|
532
565
|
if (el.parentNode === editNode ||
|
|
533
566
|
(!isNOU(el.parentNode.tagName) &&
|
|
@@ -538,11 +571,35 @@ var InsertHtml = /** @class */ (function () {
|
|
|
538
571
|
}
|
|
539
572
|
return null;
|
|
540
573
|
};
|
|
574
|
+
InsertHtml.insertTableInList = function (range, insertNode, parentNode, currentNode, nodeCutter) {
|
|
575
|
+
if (range.collapsed) {
|
|
576
|
+
var isStart = range.startOffset === 0;
|
|
577
|
+
var isEnd = range.startContainer.textContent.trimEnd().length === range.startOffset;
|
|
578
|
+
if (isStart || isEnd) {
|
|
579
|
+
if (isStart) {
|
|
580
|
+
InsertMethods.AppendBefore(insertNode, currentNode, false);
|
|
581
|
+
}
|
|
582
|
+
else {
|
|
583
|
+
InsertMethods.AppendBefore(insertNode, currentNode, true);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
else {
|
|
587
|
+
var preNode = nodeCutter.SplitNode(range, parentNode, true);
|
|
588
|
+
var sibNode = preNode.previousSibling;
|
|
589
|
+
sibNode.appendChild(insertNode);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
else {
|
|
593
|
+
range.deleteContents();
|
|
594
|
+
parentNode.appendChild(insertNode);
|
|
595
|
+
}
|
|
596
|
+
insertNode.classList.add('ignore-table');
|
|
597
|
+
};
|
|
541
598
|
/**
|
|
542
599
|
* Insert method
|
|
543
600
|
*
|
|
544
601
|
* @hidden
|
|
545
|
-
|
|
602
|
+
* @deprecated
|
|
546
603
|
*/
|
|
547
604
|
InsertHtml.inlineNode = ['a', 'abbr', 'acronym', 'audio', 'b', 'bdi', 'bdo', 'big', 'br', 'button',
|
|
548
605
|
'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;
|