@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
|
@@ -23,7 +23,7 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
23
23
|
* @param {FormatPainterValue} painterValues specifies the element created and last child
|
|
24
24
|
* @returns {void}
|
|
25
25
|
* @hidden
|
|
26
|
-
|
|
26
|
+
* @deprecated
|
|
27
27
|
*/
|
|
28
28
|
SelectionCommands.applyFormat = function (docElement, format, endNode, enterAction, value, selector, painterValues) {
|
|
29
29
|
this.enterAction = enterAction;
|
|
@@ -38,6 +38,45 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
38
38
|
var nodeCutter = new NodeCutter();
|
|
39
39
|
var isFormatted = new IsFormatted();
|
|
40
40
|
var range = domSelection.getRange(docElement);
|
|
41
|
+
var currentAnchorNode = range.startContainer.parentElement;
|
|
42
|
+
if (range.collapsed && !isNOU(currentAnchorNode) &&
|
|
43
|
+
currentAnchorNode.tagName === 'A' &&
|
|
44
|
+
(range.startOffset === currentAnchorNode.textContent.length || range.startOffset === 0)) {
|
|
45
|
+
var emptyTextNode = document.createTextNode('');
|
|
46
|
+
if (range.startOffset === 0) {
|
|
47
|
+
currentAnchorNode.parentNode.insertBefore(emptyTextNode, currentAnchorNode);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
if (!isNOU(currentAnchorNode.nextSibling)) {
|
|
51
|
+
currentAnchorNode.parentElement.insertBefore(emptyTextNode, currentAnchorNode.nextSibling);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
currentAnchorNode.parentNode.appendChild(emptyTextNode);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Set the range to the empty text node
|
|
58
|
+
var newRange = docElement.createRange();
|
|
59
|
+
range.setStart(emptyTextNode, 0);
|
|
60
|
+
range.setEnd(emptyTextNode, 0);
|
|
61
|
+
range.collapse(true);
|
|
62
|
+
domSelection.setRange(docElement, newRange);
|
|
63
|
+
}
|
|
64
|
+
if (Browser.userAgent.indexOf('Firefox') !== -1 && range.startContainer === range.endContainer && !isNOU(endNode) && range.startContainer === endNode) {
|
|
65
|
+
var startChildNodes = range.startContainer.childNodes;
|
|
66
|
+
var startNode = ((startChildNodes[(range.startOffset > 0) ? (range.startOffset - 1) :
|
|
67
|
+
range.startOffset]) || range.startContainer);
|
|
68
|
+
var endNode_1 = (range.endContainer.childNodes[(range.endOffset > 0) ? (range.endOffset - 1) :
|
|
69
|
+
range.endOffset] || range.endContainer);
|
|
70
|
+
var lastSelectionNode = (endNode_1.lastChild.nodeName === 'BR' ? (isNOU(endNode_1.lastChild.previousSibling) ? endNode_1
|
|
71
|
+
: endNode_1.lastChild.previousSibling) : endNode_1.firstChild);
|
|
72
|
+
while (!isNOU(lastSelectionNode) && lastSelectionNode.nodeName !== '#text' && lastSelectionNode.nodeName !== 'IMG' &&
|
|
73
|
+
lastSelectionNode.nodeName !== 'BR' && lastSelectionNode.nodeName !== 'HR') {
|
|
74
|
+
lastSelectionNode = lastSelectionNode.lastChild;
|
|
75
|
+
}
|
|
76
|
+
;
|
|
77
|
+
domSelection.setSelectionText(docElement, startNode, lastSelectionNode, 0, 0);
|
|
78
|
+
range = domSelection.getRange(docElement);
|
|
79
|
+
}
|
|
41
80
|
var save = domSelection.save(range, docElement);
|
|
42
81
|
var nodes = range.collapsed ? domSelection.getSelectionNodeCollection(range) :
|
|
43
82
|
domSelection.getSelectionNodeCollectionBr(range);
|
|
@@ -185,8 +224,7 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
185
224
|
cursorNodes[0].firstElementChild.tagName.toLowerCase() === 'br')) {
|
|
186
225
|
cursorNodes[0].innerHTML = '';
|
|
187
226
|
}
|
|
188
|
-
if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' ||
|
|
189
|
-
cursorNodes[0].nextSibling.nodeName === 'BR')) {
|
|
227
|
+
if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' || (isNOU(cursorNodes[0].nextSibling) ? false : cursorNodes[0].nextSibling.nodeName === 'BR'))) {
|
|
190
228
|
detach(cursorNodes[0].nodeName === '#text' ? cursorNodes[0].nextSibling : cursorNodes[0]);
|
|
191
229
|
}
|
|
192
230
|
cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
|
|
@@ -211,11 +249,15 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
211
249
|
&& range.endOffset === range.startContainer.length)) {
|
|
212
250
|
var nodeIndex = [];
|
|
213
251
|
var cloneNode = nodes[index];
|
|
252
|
+
var clonedElement = cloneNode;
|
|
214
253
|
do {
|
|
215
254
|
nodeIndex.push(domSelection.getIndex(cloneNode));
|
|
216
255
|
cloneNode = cloneNode.parentNode;
|
|
217
256
|
} while (cloneNode && (cloneNode !== formatNode));
|
|
218
257
|
if (nodes[index].nodeName !== 'BR') {
|
|
258
|
+
if (clonedElement.nodeName === '#text' && clonedElement.textContent.includes('\u200B')) {
|
|
259
|
+
clonedElement.remove();
|
|
260
|
+
}
|
|
219
261
|
cloneNode = splitNode = (isCursor && (formatNode.textContent.length - 1) === range.startOffset) ?
|
|
220
262
|
nodeCutter.SplitNode(range, formatNode, true)
|
|
221
263
|
: nodeCutter.GetSpliceNode(range, formatNode);
|
|
@@ -293,6 +335,30 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
293
335
|
formatNode.style.textDecoration = 'none';
|
|
294
336
|
child = [formatNode];
|
|
295
337
|
}
|
|
338
|
+
else if (IsFormatted.inlineTags.indexOf(formatNodeTagName.toLowerCase()) !== -1 && isFontStyle && formatNodeTagName.toLocaleLowerCase() !== 'span') {
|
|
339
|
+
var fontNodeStyle = formatNode.style;
|
|
340
|
+
if (fontNodeStyle.color && format === 'fontcolor') {
|
|
341
|
+
if (formatNode.nodeName === 'A') {
|
|
342
|
+
fontNodeStyle.color = value;
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
fontNodeStyle.color = '';
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
else if (fontNodeStyle.backgroundColor && format === 'backgroundcolor') {
|
|
349
|
+
fontNodeStyle.backgroundColor = '';
|
|
350
|
+
}
|
|
351
|
+
else if (fontNodeStyle.fontSize && format === 'fontsize') {
|
|
352
|
+
fontNodeStyle.fontSize = '';
|
|
353
|
+
}
|
|
354
|
+
else if (fontNodeStyle.fontFamily && format === 'fontname') {
|
|
355
|
+
fontNodeStyle.fontFamily = '';
|
|
356
|
+
}
|
|
357
|
+
if (formatNode.getAttribute("style") === '') {
|
|
358
|
+
formatNode.removeAttribute("style");
|
|
359
|
+
}
|
|
360
|
+
child = [formatNode];
|
|
361
|
+
}
|
|
296
362
|
else {
|
|
297
363
|
child = InsertMethods.unwrap(formatNode);
|
|
298
364
|
var liElement = nodes[index].parentElement;
|
|
@@ -398,7 +464,10 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
398
464
|
}
|
|
399
465
|
var num = index;
|
|
400
466
|
var liChildContent = '';
|
|
401
|
-
|
|
467
|
+
/* eslint-disable security/detect-object-injection */
|
|
468
|
+
while (num >= 0 && !isNOU(liElement) && liElement.tagName.toLowerCase() === 'li' && liElement.contains(nodes[num]) &&
|
|
469
|
+
liElement.textContent.replace('/\u200B/g', '').trim().includes(nodes[num].textContent.trim())) {
|
|
470
|
+
/* eslint-enable security/detect-object-injection */
|
|
402
471
|
liChildContent = ' ' + nodes[num].textContent.trim() + liChildContent;
|
|
403
472
|
num--;
|
|
404
473
|
}
|
|
@@ -470,6 +539,48 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
470
539
|
parentElement = parentElement.parentElement;
|
|
471
540
|
liElement = parentElement;
|
|
472
541
|
}
|
|
542
|
+
if (format === 'fontcolor' || format === 'fontname') {
|
|
543
|
+
var parentElem = nodes[index].parentElement;
|
|
544
|
+
if (!isNOU(parentElem) && parentElem.childNodes) {
|
|
545
|
+
for (var i = 0; i < parentElem.childNodes.length; i++) {
|
|
546
|
+
if (this.concatenateTextExcludingList(nodes, index) === nodes[index].textContent) {
|
|
547
|
+
var liElement_1 = void 0;
|
|
548
|
+
if (parentElem.tagName === 'LI') {
|
|
549
|
+
liElement_1 = parentElem;
|
|
550
|
+
}
|
|
551
|
+
else if (parentElem.closest('li')) {
|
|
552
|
+
liElement_1 = parentElem.closest('li');
|
|
553
|
+
}
|
|
554
|
+
if (!isNOU(liElement_1)) {
|
|
555
|
+
switch (format) {
|
|
556
|
+
case 'fontcolor':
|
|
557
|
+
liElement_1.style.color = value;
|
|
558
|
+
break;
|
|
559
|
+
case 'fontname':
|
|
560
|
+
liElement_1.style.fontFamily = value;
|
|
561
|
+
break;
|
|
562
|
+
default:
|
|
563
|
+
break;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
// eslint-disable-next-line
|
|
568
|
+
var childElement = parentElem.childNodes[i];
|
|
569
|
+
if (childElement.tagName === 'OL' || childElement.tagName === 'UL') {
|
|
570
|
+
switch (format) {
|
|
571
|
+
case 'fontcolor':
|
|
572
|
+
childElement.style.color = 'initial';
|
|
573
|
+
break;
|
|
574
|
+
case 'fontname':
|
|
575
|
+
childElement.style.fontFamily = 'initial';
|
|
576
|
+
break;
|
|
577
|
+
default:
|
|
578
|
+
break;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
473
584
|
if (!isNOU(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
474
585
|
liElement.textContent.trim() === nodes[index].textContent.trim()) {
|
|
475
586
|
if (format === 'fontsize') {
|
|
@@ -769,6 +880,18 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
769
880
|
}
|
|
770
881
|
}
|
|
771
882
|
};
|
|
883
|
+
SelectionCommands.concatenateTextExcludingList = function (nodes, index) {
|
|
884
|
+
var result = '';
|
|
885
|
+
var parentNode = nodes[index].parentElement;
|
|
886
|
+
for (var i = 0; i < parentNode.childNodes.length; i++) {
|
|
887
|
+
// eslint-disable-next-line
|
|
888
|
+
var childNode = parentNode.childNodes[i];
|
|
889
|
+
if ((childNode.nodeType === 3) || (childNode.nodeType === 1 && (childNode.tagName !== 'OL' && childNode.tagName !== 'UL'))) {
|
|
890
|
+
result += childNode.textContent;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
return result;
|
|
894
|
+
};
|
|
772
895
|
SelectionCommands.enterAction = 'P';
|
|
773
896
|
return SelectionCommands;
|
|
774
897
|
}());
|
|
@@ -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 SelectionBasedExec {
|
|
9
9
|
private parent;
|
|
@@ -12,7 +12,7 @@ export declare class SelectionBasedExec {
|
|
|
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;
|
|
@@ -5,7 +5,7 @@ import * as EVENTS from './../../common/constant';
|
|
|
5
5
|
* Selection EXEC internal component
|
|
6
6
|
*
|
|
7
7
|
* @hidden
|
|
8
|
-
|
|
8
|
+
* @deprecated
|
|
9
9
|
*/
|
|
10
10
|
var SelectionBasedExec = /** @class */ (function () {
|
|
11
11
|
/**
|
|
@@ -13,7 +13,7 @@ var SelectionBasedExec = /** @class */ (function () {
|
|
|
13
13
|
*
|
|
14
14
|
* @param {EditorManager} parent - specifies the parent element
|
|
15
15
|
* @hidden
|
|
16
|
-
|
|
16
|
+
* @deprecated
|
|
17
17
|
*/
|
|
18
18
|
function SelectionBasedExec(parent) {
|
|
19
19
|
this.parent = parent;
|
|
@@ -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 TableCommand {
|
|
9
9
|
private parent;
|
|
@@ -14,13 +14,12 @@ export declare class TableCommand {
|
|
|
14
14
|
*
|
|
15
15
|
* @param {EditorManager} parent - specifies the parent element
|
|
16
16
|
* @hidden
|
|
17
|
-
|
|
17
|
+
* @deprecated
|
|
18
18
|
*/
|
|
19
19
|
constructor(parent: EditorManager);
|
|
20
20
|
private addEventListener;
|
|
21
21
|
private createTable;
|
|
22
22
|
private calculateStyleValue;
|
|
23
|
-
private removeEmptyNode;
|
|
24
23
|
private insertAfter;
|
|
25
24
|
private getSelectedCellMinMaxIndex;
|
|
26
25
|
private insertRow;
|
|
@@ -5,7 +5,7 @@ import { InsertHtml } from './inserthtml';
|
|
|
5
5
|
* Link internal component
|
|
6
6
|
*
|
|
7
7
|
* @hidden
|
|
8
|
-
|
|
8
|
+
* @deprecated
|
|
9
9
|
*/
|
|
10
10
|
var TableCommand = /** @class */ (function () {
|
|
11
11
|
/**
|
|
@@ -13,7 +13,7 @@ var TableCommand = /** @class */ (function () {
|
|
|
13
13
|
*
|
|
14
14
|
* @param {EditorManager} parent - specifies the parent element
|
|
15
15
|
* @hidden
|
|
16
|
-
|
|
16
|
+
* @deprecated
|
|
17
17
|
*/
|
|
18
18
|
function TableCommand(parent) {
|
|
19
19
|
this.parent = parent;
|
|
@@ -60,9 +60,8 @@ var TableCommand = /** @class */ (function () {
|
|
|
60
60
|
table.appendChild(tblBody);
|
|
61
61
|
e.item.selection.restore();
|
|
62
62
|
InsertHtml.Insert(this.parent.currentDocument, table, this.parent.editableElement);
|
|
63
|
-
this.removeEmptyNode();
|
|
64
63
|
e.item.selection.setSelectionText(this.parent.currentDocument, table.querySelector('td'), table.querySelector('td'), 0, 0);
|
|
65
|
-
if (table.nextElementSibling === null) {
|
|
64
|
+
if (table.nextElementSibling === null && !table.classList.contains('ignore-table')) {
|
|
66
65
|
var insertElem = void 0;
|
|
67
66
|
if (e.enterAction === 'DIV') {
|
|
68
67
|
insertElem = createElement('div');
|
|
@@ -77,6 +76,9 @@ var TableCommand = /** @class */ (function () {
|
|
|
77
76
|
}
|
|
78
77
|
this.insertAfter(insertElem, table);
|
|
79
78
|
}
|
|
79
|
+
if (table.classList.contains('ignore-table')) {
|
|
80
|
+
table.classList.remove('ignore-table');
|
|
81
|
+
}
|
|
80
82
|
table.querySelector('td').classList.add('e-cell-select');
|
|
81
83
|
if (e.callBack) {
|
|
82
84
|
e.callBack({
|
|
@@ -104,24 +106,6 @@ var TableCommand = /** @class */ (function () {
|
|
|
104
106
|
}
|
|
105
107
|
return styleValue;
|
|
106
108
|
};
|
|
107
|
-
TableCommand.prototype.removeEmptyNode = function () {
|
|
108
|
-
var emptyUl = this.parent.editableElement.querySelectorAll('ul:empty, ol:empty');
|
|
109
|
-
for (var i = 0; i < emptyUl.length; i++) {
|
|
110
|
-
detach(emptyUl[i]);
|
|
111
|
-
}
|
|
112
|
-
var emptyLiChild = this.parent.editableElement.querySelectorAll('li *:empty:not(img)');
|
|
113
|
-
for (var i = 0; i < emptyLiChild.length; i++) {
|
|
114
|
-
detach(emptyLiChild[i]);
|
|
115
|
-
if (emptyLiChild.length === i + 1) {
|
|
116
|
-
emptyLiChild = this.parent.editableElement.querySelectorAll('li *:empty:not(img)');
|
|
117
|
-
i = -1;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
var emptyLi = this.parent.editableElement.querySelectorAll('li:empty');
|
|
121
|
-
for (var i = 0; i < emptyLi.length; i++) {
|
|
122
|
-
detach(emptyLi[i]);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
109
|
TableCommand.prototype.insertAfter = function (newNode, referenceNode) {
|
|
126
110
|
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
|
|
127
111
|
};
|
|
@@ -472,14 +456,21 @@ var TableCommand = /** @class */ (function () {
|
|
|
472
456
|
}
|
|
473
457
|
};
|
|
474
458
|
TableCommand.prototype.tableVerticalAlign = function (e) {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
459
|
+
var value = '';
|
|
460
|
+
switch (e.item.subCommand) {
|
|
461
|
+
case 'AlignTop':
|
|
462
|
+
value = 'top';
|
|
463
|
+
break;
|
|
464
|
+
case 'AlignMiddle':
|
|
465
|
+
value = 'middle';
|
|
466
|
+
break;
|
|
467
|
+
case 'AlignBottom':
|
|
468
|
+
value = 'bottom';
|
|
469
|
+
break;
|
|
480
470
|
}
|
|
481
|
-
|
|
482
|
-
|
|
471
|
+
e.item.tableCell.style.verticalAlign = value;
|
|
472
|
+
if (value && value !== '' && e.item.tableCell.getAttribute('valign')) {
|
|
473
|
+
e.item.tableCell.removeAttribute('valign');
|
|
483
474
|
}
|
|
484
475
|
if (e.callBack) {
|
|
485
476
|
e.callBack({
|
|
@@ -510,10 +501,22 @@ var TableCommand = /** @class */ (function () {
|
|
|
510
501
|
firstCell.setAttribute('rowspan', (minMaxIndexes.endRow - minMaxIndexes.startRow + 1).toString());
|
|
511
502
|
}
|
|
512
503
|
var totalWidth = 0;
|
|
504
|
+
var unit;
|
|
513
505
|
for (var j = rowSelectedCells.length - 1; j >= 0; j--) {
|
|
514
|
-
|
|
506
|
+
if (!isNOU(rowSelectedCells[j].style.width)
|
|
507
|
+
&& rowSelectedCells[j].style.width !== '') {
|
|
508
|
+
if (!unit) {
|
|
509
|
+
var match = rowSelectedCells[j].style.width.match(/^([\d.]+)([a-z%]+)$/i);
|
|
510
|
+
unit = match ? match[2] : '%';
|
|
511
|
+
}
|
|
512
|
+
totalWidth = totalWidth + parseFloat(rowSelectedCells[j].style.width);
|
|
513
|
+
}
|
|
514
|
+
else {
|
|
515
|
+
totalWidth = totalWidth + ((rowSelectedCells[j].offsetWidth / this.curTable.offsetWidth) * 100);
|
|
516
|
+
unit = '%';
|
|
517
|
+
}
|
|
515
518
|
}
|
|
516
|
-
firstCell.style.width = totalWidth +
|
|
519
|
+
firstCell.style.width = totalWidth + unit;
|
|
517
520
|
for (var i = 1; i <= selectedCells.length - 1; i++) {
|
|
518
521
|
detach(selectedCells[i]);
|
|
519
522
|
}
|
|
@@ -550,7 +553,7 @@ var TableCommand = /** @class */ (function () {
|
|
|
550
553
|
var eleArray = elements;
|
|
551
554
|
//eslint-disable-next-line
|
|
552
555
|
if (min < (max = Math.min(max, eleArray[0].length - 1))) {
|
|
553
|
-
for (colIndex
|
|
556
|
+
for (colIndex = min; colIndex <= max; colIndex++) {
|
|
554
557
|
// eslint-disable-next-line
|
|
555
558
|
if (!(min < colIndex && eleArray[0][colIndex] === eleArray[0][colIndex - 1]) && 1 < (index =
|
|
556
559
|
Math.min(parseInt(eleArray[0][colIndex].getAttribute('colspan'), 10) || 1, max - min + 1)) &&
|
|
@@ -3,7 +3,7 @@ import { IToolbarStatus } from './../../common/interface';
|
|
|
3
3
|
* Update Toolbar Status
|
|
4
4
|
*
|
|
5
5
|
* @hidden
|
|
6
|
-
|
|
6
|
+
* @deprecated
|
|
7
7
|
*/
|
|
8
8
|
export declare const statusCollection: IToolbarStatus;
|
|
9
9
|
export declare class ToolbarStatus {
|
|
@@ -11,16 +11,16 @@ export declare class ToolbarStatus {
|
|
|
11
11
|
* get method
|
|
12
12
|
*
|
|
13
13
|
* @param {Document} docElement - specifies the document element
|
|
14
|
-
* @param {Node}
|
|
14
|
+
* @param {Node} rootNode - specifies the content editable element
|
|
15
15
|
* @param {string[]} formatNode - specifies the format node
|
|
16
16
|
* @param {string[]} fontSize - specifies the font size
|
|
17
17
|
* @param {string[]} fontName - specifies the font name.
|
|
18
18
|
* @param {Node} documentNode - specifies the document node.
|
|
19
19
|
* @returns {IToolbarStatus} - returns the toolbar status
|
|
20
20
|
* @hidden
|
|
21
|
-
|
|
21
|
+
* @deprecated
|
|
22
22
|
*/
|
|
23
|
-
static get(docElement: Document,
|
|
23
|
+
static get(docElement: Document, rootNode: Node, formatNode?: string[], fontSize?: string[], fontName?: string[], documentNode?: Node): IToolbarStatus;
|
|
24
24
|
private static getImmediateBlockNode;
|
|
25
25
|
private static getFormatParent;
|
|
26
26
|
private static isFormattedNode;
|
|
@@ -2,11 +2,12 @@ import { IsFormatted } from './isformatted';
|
|
|
2
2
|
import * as CONSTANT from './../base/constant';
|
|
3
3
|
import { NodeSelection } from './../../selection/index';
|
|
4
4
|
import { getDefaultHtmlTbStatus } from './../../common/util';
|
|
5
|
+
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
5
6
|
/**
|
|
6
7
|
* Update Toolbar Status
|
|
7
8
|
*
|
|
8
9
|
* @hidden
|
|
9
|
-
|
|
10
|
+
* @deprecated
|
|
10
11
|
*/
|
|
11
12
|
export var statusCollection = getDefaultHtmlTbStatus();
|
|
12
13
|
var ToolbarStatus = /** @class */ (function () {
|
|
@@ -16,16 +17,16 @@ var ToolbarStatus = /** @class */ (function () {
|
|
|
16
17
|
* get method
|
|
17
18
|
*
|
|
18
19
|
* @param {Document} docElement - specifies the document element
|
|
19
|
-
* @param {Node}
|
|
20
|
+
* @param {Node} rootNode - specifies the content editable element
|
|
20
21
|
* @param {string[]} formatNode - specifies the format node
|
|
21
22
|
* @param {string[]} fontSize - specifies the font size
|
|
22
23
|
* @param {string[]} fontName - specifies the font name.
|
|
23
24
|
* @param {Node} documentNode - specifies the document node.
|
|
24
25
|
* @returns {IToolbarStatus} - returns the toolbar status
|
|
25
26
|
* @hidden
|
|
26
|
-
|
|
27
|
+
* @deprecated
|
|
27
28
|
*/
|
|
28
|
-
ToolbarStatus.get = function (docElement,
|
|
29
|
+
ToolbarStatus.get = function (docElement, rootNode, formatNode, fontSize, fontName, documentNode) {
|
|
29
30
|
var formatCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
30
31
|
var nodeCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
31
32
|
var nodeSelection = new NodeSelection();
|
|
@@ -55,7 +56,7 @@ var ToolbarStatus = /** @class */ (function () {
|
|
|
55
56
|
}
|
|
56
57
|
for (var index = 0; index < nodes.length; index++) {
|
|
57
58
|
// eslint-disable-next-line max-len
|
|
58
|
-
formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index],
|
|
59
|
+
formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], rootNode, formatNode, fontSize, fontName);
|
|
59
60
|
if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
|
|
60
61
|
nodeCollection.bold = formatCollection.bold;
|
|
61
62
|
}
|
|
@@ -130,16 +131,24 @@ var ToolbarStatus = /** @class */ (function () {
|
|
|
130
131
|
return node;
|
|
131
132
|
};
|
|
132
133
|
ToolbarStatus.getFormatParent = function (docElement, formatCollection, node, targetNode, formatNode, fontSize, fontName) {
|
|
134
|
+
var isListUpdated = false;
|
|
135
|
+
var isComplexListUpdated = false;
|
|
133
136
|
if (targetNode.contains(node) ||
|
|
134
137
|
(node.nodeType === 3 && targetNode.nodeType !== 3 && targetNode.contains(node.parentNode))) {
|
|
135
138
|
do {
|
|
136
|
-
formatCollection = this.isFormattedNode(docElement, formatCollection, node, formatNode, fontSize, fontName);
|
|
139
|
+
formatCollection = this.isFormattedNode(docElement, formatCollection, node, isListUpdated, isComplexListUpdated, formatNode, fontSize, fontName);
|
|
140
|
+
if (formatCollection.orderedlist || formatCollection.unorderedlist) {
|
|
141
|
+
isListUpdated = true;
|
|
142
|
+
}
|
|
143
|
+
if (formatCollection.bulletFormatList || formatCollection.numberFormatList) {
|
|
144
|
+
isComplexListUpdated = true;
|
|
145
|
+
}
|
|
137
146
|
node = node.parentNode;
|
|
138
147
|
} while (node && (node !== targetNode));
|
|
139
148
|
}
|
|
140
149
|
return formatCollection;
|
|
141
150
|
};
|
|
142
|
-
ToolbarStatus.isFormattedNode = function (docElement, formatCollection, node, formatNode, fontSize, fontName) {
|
|
151
|
+
ToolbarStatus.isFormattedNode = function (docElement, formatCollection, node, isListUpdated, isComplexListUpdated, formatNode, fontSize, fontName) {
|
|
143
152
|
if (!formatCollection.bold) {
|
|
144
153
|
formatCollection.bold = IsFormatted.isBold(node);
|
|
145
154
|
}
|
|
@@ -170,10 +179,10 @@ var ToolbarStatus = /** @class */ (function () {
|
|
|
170
179
|
if (!formatCollection.backgroundcolor) {
|
|
171
180
|
formatCollection.backgroundcolor = this.isBackgroundColor(node);
|
|
172
181
|
}
|
|
173
|
-
if (!formatCollection.orderedlist) {
|
|
182
|
+
if (!formatCollection.orderedlist && !isListUpdated) {
|
|
174
183
|
formatCollection.orderedlist = this.isOrderedList(node);
|
|
175
184
|
}
|
|
176
|
-
if (!formatCollection.unorderedlist) {
|
|
185
|
+
if (!formatCollection.unorderedlist && !isListUpdated) {
|
|
177
186
|
formatCollection.unorderedlist = this.isUnorderedList(node);
|
|
178
187
|
}
|
|
179
188
|
if (!formatCollection.alignments) {
|
|
@@ -188,10 +197,10 @@ var ToolbarStatus = /** @class */ (function () {
|
|
|
188
197
|
if (!formatCollection.createlink) {
|
|
189
198
|
formatCollection.createlink = this.isLink(node);
|
|
190
199
|
}
|
|
191
|
-
if (!formatCollection.numberFormatList) {
|
|
200
|
+
if (!formatCollection.numberFormatList && !isComplexListUpdated) {
|
|
192
201
|
formatCollection.numberFormatList = this.isNumberFormatList(node);
|
|
193
202
|
}
|
|
194
|
-
if (!formatCollection.bulletFormatList) {
|
|
203
|
+
if (!formatCollection.bulletFormatList && !isComplexListUpdated) {
|
|
195
204
|
formatCollection.bulletFormatList = this.isBulletFormatList(node);
|
|
196
205
|
}
|
|
197
206
|
return formatCollection;
|
|
@@ -250,7 +259,8 @@ var ToolbarStatus = /** @class */ (function () {
|
|
|
250
259
|
// eslint-disable-next-line
|
|
251
260
|
var pattern = new RegExp(name, 'i');
|
|
252
261
|
if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
|
|
253
|
-
(value.split(',')[0] && value.split(',')[0].
|
|
262
|
+
(value.split(',')[0] && !isNullOrUndefined(value.split(',')[0].trim().match(pattern)) &&
|
|
263
|
+
value.split(',')[0].trim() === value.split(',')[0].trim().match(pattern)[0])) {
|
|
254
264
|
index = pos;
|
|
255
265
|
}
|
|
256
266
|
}) && (index !== null)))) {
|
|
@@ -24,7 +24,7 @@ export declare class UndoRedoManager {
|
|
|
24
24
|
* @param {IHtmlSubCommands} e - specifies the sub command
|
|
25
25
|
* @returns {void}
|
|
26
26
|
* @hidden
|
|
27
|
-
|
|
27
|
+
* @deprecated
|
|
28
28
|
*/
|
|
29
29
|
onAction(e: IHtmlSubCommands): void;
|
|
30
30
|
/**
|
|
@@ -33,12 +33,13 @@ export declare class UndoRedoManager {
|
|
|
33
33
|
* @function destroy
|
|
34
34
|
* @returns {void}
|
|
35
35
|
* @hidden
|
|
36
|
-
|
|
36
|
+
* @deprecated
|
|
37
37
|
*/
|
|
38
38
|
destroy(): void;
|
|
39
39
|
private keyDown;
|
|
40
40
|
private keyUp;
|
|
41
41
|
private getTextContentFromFragment;
|
|
42
|
+
private isElementStructureEqual;
|
|
42
43
|
/**
|
|
43
44
|
* RTE collection stored html format.
|
|
44
45
|
*
|
|
@@ -46,7 +47,7 @@ export declare class UndoRedoManager {
|
|
|
46
47
|
* @param {KeyboardEvent} e - specifies the keyboard event
|
|
47
48
|
* @returns {void}
|
|
48
49
|
* @hidden
|
|
49
|
-
|
|
50
|
+
* @deprecated
|
|
50
51
|
*/
|
|
51
52
|
saveData(e?: KeyboardEvent | MouseEvent | IUndoCallBack): void;
|
|
52
53
|
/**
|
|
@@ -56,7 +57,7 @@ export declare class UndoRedoManager {
|
|
|
56
57
|
* @param {IHtmlSubCommands} e - specifies the sub commands
|
|
57
58
|
* @returns {void}
|
|
58
59
|
* @hidden
|
|
59
|
-
|
|
60
|
+
* @deprecated
|
|
60
61
|
*/
|
|
61
62
|
undo(e?: IHtmlSubCommands | IHtmlKeyboardEvent): void;
|
|
62
63
|
/**
|
|
@@ -66,7 +67,7 @@ export declare class UndoRedoManager {
|
|
|
66
67
|
* @function redo
|
|
67
68
|
* @returns {void}
|
|
68
69
|
* @hidden
|
|
69
|
-
|
|
70
|
+
* @deprecated
|
|
70
71
|
*/
|
|
71
72
|
redo(e?: IHtmlSubCommands | IHtmlKeyboardEvent): void;
|
|
72
73
|
/**
|
|
@@ -74,7 +75,7 @@ export declare class UndoRedoManager {
|
|
|
74
75
|
*
|
|
75
76
|
* @returns {boolean} - returns the boolean value
|
|
76
77
|
* @hidden
|
|
77
|
-
|
|
78
|
+
* @deprecated
|
|
78
79
|
*/
|
|
79
80
|
getUndoStatus(): {
|
|
80
81
|
[key: string]: boolean;
|
|
@@ -44,7 +44,7 @@ var UndoRedoManager = /** @class */ (function () {
|
|
|
44
44
|
* @param {IHtmlSubCommands} e - specifies the sub command
|
|
45
45
|
* @returns {void}
|
|
46
46
|
* @hidden
|
|
47
|
-
|
|
47
|
+
* @deprecated
|
|
48
48
|
*/
|
|
49
49
|
UndoRedoManager.prototype.onAction = function (e) {
|
|
50
50
|
if (e.subCommand === 'Undo') {
|
|
@@ -60,7 +60,7 @@ var UndoRedoManager = /** @class */ (function () {
|
|
|
60
60
|
* @function destroy
|
|
61
61
|
* @returns {void}
|
|
62
62
|
* @hidden
|
|
63
|
-
|
|
63
|
+
* @deprecated
|
|
64
64
|
*/
|
|
65
65
|
UndoRedoManager.prototype.destroy = function () {
|
|
66
66
|
this.removeEventListener();
|
|
@@ -98,6 +98,25 @@ var UndoRedoManager = /** @class */ (function () {
|
|
|
98
98
|
}
|
|
99
99
|
return textContent;
|
|
100
100
|
};
|
|
101
|
+
UndoRedoManager.prototype.isElementStructureEqual = function (previousFragment, currentFragment) {
|
|
102
|
+
if (previousFragment.childNodes.length !== currentFragment.childNodes.length) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
for (var i = 0; i < previousFragment.childNodes.length; i++) {
|
|
106
|
+
var previousFragmentNode = previousFragment.childNodes[i];
|
|
107
|
+
var currentFragmentNode = currentFragment.childNodes[i];
|
|
108
|
+
if (!previousFragmentNode || !currentFragmentNode) {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
if (previousFragmentNode.nodeType !== currentFragmentNode.nodeType) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
if (previousFragmentNode.outerHTML !== currentFragmentNode.outerHTML) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return true;
|
|
119
|
+
};
|
|
101
120
|
/**
|
|
102
121
|
* RTE collection stored html format.
|
|
103
122
|
*
|
|
@@ -105,7 +124,7 @@ var UndoRedoManager = /** @class */ (function () {
|
|
|
105
124
|
* @param {KeyboardEvent} e - specifies the keyboard event
|
|
106
125
|
* @returns {void}
|
|
107
126
|
* @hidden
|
|
108
|
-
|
|
127
|
+
* @deprecated
|
|
109
128
|
*/
|
|
110
129
|
UndoRedoManager.prototype.saveData = function (e) {
|
|
111
130
|
var range = new NodeSelection().getRange(this.parent.currentDocument);
|
|
@@ -134,7 +153,8 @@ var UndoRedoManager = /** @class */ (function () {
|
|
|
134
153
|
(this.undoRedoStack[this.undoRedoStack.length - 1].range.endOffset === save.range.endOffset) &&
|
|
135
154
|
(this.undoRedoStack[this.undoRedoStack.length - 1].range.range.startContainer === save.range.startContainer) &&
|
|
136
155
|
(this.getTextContentFromFragment(this.undoRedoStack[this.undoRedoStack.length - 1].text).trim() ===
|
|
137
|
-
this.getTextContentFromFragment(changEle.text).trim())
|
|
156
|
+
this.getTextContentFromFragment(changEle.text).trim()) &&
|
|
157
|
+
this.isElementStructureEqual(this.undoRedoStack[this.undoRedoStack.length - 1].text, changEle.text)) {
|
|
138
158
|
return;
|
|
139
159
|
}
|
|
140
160
|
this.undoRedoStack.push(changEle);
|
|
@@ -154,7 +174,7 @@ var UndoRedoManager = /** @class */ (function () {
|
|
|
154
174
|
* @param {IHtmlSubCommands} e - specifies the sub commands
|
|
155
175
|
* @returns {void}
|
|
156
176
|
* @hidden
|
|
157
|
-
|
|
177
|
+
* @deprecated
|
|
158
178
|
*/
|
|
159
179
|
UndoRedoManager.prototype.undo = function (e) {
|
|
160
180
|
if (this.steps > 0) {
|
|
@@ -186,7 +206,7 @@ var UndoRedoManager = /** @class */ (function () {
|
|
|
186
206
|
* @function redo
|
|
187
207
|
* @returns {void}
|
|
188
208
|
* @hidden
|
|
189
|
-
|
|
209
|
+
* @deprecated
|
|
190
210
|
*/
|
|
191
211
|
UndoRedoManager.prototype.redo = function (e) {
|
|
192
212
|
if (this.undoRedoStack[this.steps + 1] != null) {
|
|
@@ -216,7 +236,7 @@ var UndoRedoManager = /** @class */ (function () {
|
|
|
216
236
|
*
|
|
217
237
|
* @returns {boolean} - returns the boolean value
|
|
218
238
|
* @hidden
|
|
219
|
-
|
|
239
|
+
* @deprecated
|
|
220
240
|
*/
|
|
221
241
|
UndoRedoManager.prototype.getUndoStatus = function () {
|
|
222
242
|
var status = { undo: false, redo: false };
|