@syncfusion/ej2-richtexteditor 25.1.42 → 25.2.4-621927
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 -2001
- 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 +642 -305
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +742 -401
- 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 +84 -84
- 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 +5 -2
- 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 -3
- package/src/editor-manager/plugin/lists.js +57 -80
- 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 +6 -6
- 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 +1 -1
- package/src/rich-text-editor/actions/enter-key.d.ts +5 -0
- package/src/rich-text-editor/actions/enter-key.js +98 -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 +4 -3
- package/src/rich-text-editor/actions/html-editor.js +68 -23
- 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 +55 -14
- 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 +1 -1
- package/src/rich-text-editor/base/enum.js +1 -1
- package/src/rich-text-editor/base/interface.d.ts +50 -50
- 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 +82 -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 +17 -17
- package/src/rich-text-editor/renderer/image-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/image-module.js +10 -5
- package/src/rich-text-editor/renderer/link-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/link-module.js +1 -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 +3 -2
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +9 -9
- package/src/rich-text-editor/renderer/toolbar-renderer.js +16 -18
- 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 +705 -801
- package/styles/bootstrap-dark.scss +4 -1
- package/styles/bootstrap.css +689 -801
- package/styles/bootstrap.scss +4 -1
- package/styles/bootstrap4.css +692 -803
- package/styles/bootstrap4.scss +4 -1
- package/styles/bootstrap5-dark.css +716 -840
- package/styles/bootstrap5-dark.scss +4 -1
- package/styles/bootstrap5.css +715 -839
- package/styles/bootstrap5.scss +4 -1
- package/styles/fabric-dark.css +690 -797
- package/styles/fabric-dark.scss +4 -1
- package/styles/fabric.css +686 -797
- package/styles/fabric.scss +4 -1
- package/styles/fluent-dark.css +693 -820
- package/styles/fluent-dark.scss +4 -1
- package/styles/fluent.css +692 -819
- package/styles/fluent.scss +4 -1
- package/styles/fluent2.css +4219 -0
- package/styles/fluent2.scss +4 -0
- package/styles/highcontrast-light.css +661 -795
- package/styles/highcontrast-light.scss +4 -1
- package/styles/highcontrast.css +667 -793
- package/styles/highcontrast.scss +4 -1
- package/styles/material-dark.css +682 -798
- package/styles/material-dark.scss +4 -1
- package/styles/material.css +679 -800
- package/styles/material.scss +4 -1
- package/styles/material3-dark.css +717 -857
- package/styles/material3-dark.scss +4 -1
- package/styles/material3.css +717 -857
- package/styles/material3.scss +4 -1
- package/styles/rich-text-editor/_all.scss +2 -2
- package/styles/rich-text-editor/_bds-definition.scss +288 -285
- package/styles/rich-text-editor/_bigger.scss +610 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +289 -287
- package/styles/rich-text-editor/_bootstrap-definition.scss +347 -343
- package/styles/rich-text-editor/_bootstrap4-definition.scss +474 -470
- package/styles/rich-text-editor/_bootstrap5-definition.scss +276 -272
- package/styles/rich-text-editor/_bootstrap5.3-definition.scss +276 -0
- package/styles/rich-text-editor/_fabric-dark-definition.scss +273 -269
- package/styles/rich-text-editor/_fabric-definition.scss +271 -267
- package/styles/rich-text-editor/_fluent-definition.scss +277 -273
- package/styles/rich-text-editor/_fluent2-definition.scss +285 -0
- package/styles/rich-text-editor/_fusionnew-definition.scss +274 -271
- package/styles/rich-text-editor/_highcontrast-definition.scss +272 -267
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +271 -267
- package/styles/rich-text-editor/_layout.scss +2148 -2272
- package/styles/rich-text-editor/_material-dark-definition.scss +276 -272
- package/styles/rich-text-editor/_material-definition.scss +274 -270
- package/styles/rich-text-editor/_material3-definition.scss +276 -272
- package/styles/rich-text-editor/_tailwind-definition.scss +271 -267
- package/styles/rich-text-editor/_theme.scss +802 -927
- package/styles/rich-text-editor/bootstrap-dark.css +705 -801
- package/styles/rich-text-editor/bootstrap.css +689 -801
- package/styles/rich-text-editor/bootstrap4.css +692 -803
- package/styles/rich-text-editor/bootstrap5-dark.css +716 -840
- package/styles/rich-text-editor/bootstrap5.css +715 -839
- package/styles/rich-text-editor/fabric-dark.css +690 -797
- package/styles/rich-text-editor/fabric.css +686 -797
- package/styles/rich-text-editor/fluent-dark.css +693 -820
- package/styles/rich-text-editor/fluent.css +692 -819
- package/styles/rich-text-editor/fluent2.css +4219 -0
- package/styles/rich-text-editor/fluent2.scss +4 -0
- package/styles/rich-text-editor/highcontrast-light.css +661 -795
- package/styles/rich-text-editor/highcontrast.css +667 -793
- 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 +361 -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/material-dark.css +682 -798
- package/styles/rich-text-editor/material.css +679 -800
- package/styles/rich-text-editor/material3-dark.css +717 -857
- package/styles/rich-text-editor/material3-dark.scss +1 -1
- package/styles/rich-text-editor/material3.css +717 -857
- package/styles/rich-text-editor/material3.scss +1 -1
- package/styles/rich-text-editor/tailwind-dark.css +705 -828
- package/styles/rich-text-editor/tailwind.css +705 -828
- package/styles/tailwind-dark.css +705 -828
- package/styles/tailwind-dark.scss +4 -1
- package/styles/tailwind.css +705 -828
- 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
|
@@ -778,18 +778,18 @@ const closeTooltip = 'closeTooltip';
|
|
|
778
778
|
* @hidden
|
|
779
779
|
* @deprecated
|
|
780
780
|
*/
|
|
781
|
-
const blockEmptyNodes = `address:empty, article:empty, aside:empty, blockquote:empty,
|
|
782
|
-
details:empty, dd:empty, div:empty, dl:empty, dt:empty, fieldset:empty, footer:empty,form:empty, h1:empty,
|
|
783
|
-
h2:empty, h3:empty, h4:empty, h5:empty, h6:empty, header:empty, hgroup:empty, li:empty, main:empty, nav:empty,
|
|
781
|
+
const blockEmptyNodes = `address:empty, article:empty, aside:empty, blockquote:empty,
|
|
782
|
+
details:empty, dd:empty, div:empty, dl:empty, dt:empty, fieldset:empty, footer:empty,form:empty, h1:empty,
|
|
783
|
+
h2:empty, h3:empty, h4:empty, h5:empty, h6:empty, header:empty, hgroup:empty, li:empty, main:empty, nav:empty,
|
|
784
784
|
noscript:empty, output:empty, p:empty, pre:empty, section:empty, td:empty, th:empty`;
|
|
785
785
|
/**
|
|
786
786
|
* @hidden
|
|
787
787
|
* @deprecated
|
|
788
788
|
*/
|
|
789
|
-
const inlineEmptyNodes = `a:empty, abbr:empty, acronym:empty, b:empty, bdi:empty, bdo:empty, big:empty, button:empty,
|
|
790
|
-
canvas:empty, cite:empty, code:empty, data:empty, datalist:empty, del:empty, dfn:empty, em:empty, font:empty, i:empty, iframe:empty,
|
|
791
|
-
ins:empty, kbd:empty, label:empty, map:empty, mark:empty, meter:empty, noscript:empty, object:empty, output:empty, picture:empty, progress:empty,
|
|
792
|
-
q:empty, ruby:empty, s:empty, samp:empty, script:empty, select:empty, slot:empty, small:empty, span:empty, strong:empty, strike:empty, sub:empty, sup:empty, svg:empty,
|
|
789
|
+
const inlineEmptyNodes = `a:empty, abbr:empty, acronym:empty, b:empty, bdi:empty, bdo:empty, big:empty, button:empty,
|
|
790
|
+
canvas:empty, cite:empty, code:empty, data:empty, datalist:empty, del:empty, dfn:empty, em:empty, font:empty, i:empty, iframe:empty,
|
|
791
|
+
ins:empty, kbd:empty, label:empty, map:empty, mark:empty, meter:empty, noscript:empty, object:empty, output:empty, picture:empty, progress:empty,
|
|
792
|
+
q:empty, ruby:empty, s:empty, samp:empty, script:empty, select:empty, slot:empty, small:empty, span:empty, strong:empty, strike:empty, sub:empty, sup:empty, svg:empty,
|
|
793
793
|
template:empty, textarea:empty, time:empty, u:empty, tt:empty, var:empty, wbr:empty`;
|
|
794
794
|
/**
|
|
795
795
|
* @hidden
|
|
@@ -4477,6 +4477,10 @@ function updateTextNode$1(value, enterAction) {
|
|
|
4477
4477
|
tableElm[i].classList.remove('e-rte-paste-onenote-table');
|
|
4478
4478
|
continue;
|
|
4479
4479
|
}
|
|
4480
|
+
else if (tableElm[i].classList.contains('e-rte-paste-html-table')) {
|
|
4481
|
+
tableElm[i].classList.remove('e-rte-paste-html-table');
|
|
4482
|
+
continue;
|
|
4483
|
+
}
|
|
4480
4484
|
}
|
|
4481
4485
|
}
|
|
4482
4486
|
const imageElm = resultElm.querySelectorAll('img');
|
|
@@ -4570,17 +4574,68 @@ function nestedListCleanUp(range) {
|
|
|
4570
4574
|
item.remove();
|
|
4571
4575
|
});
|
|
4572
4576
|
}
|
|
4577
|
+
else {
|
|
4578
|
+
break;
|
|
4579
|
+
}
|
|
4573
4580
|
}
|
|
4574
4581
|
let liElem = (range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll("li");
|
|
4575
4582
|
if (liElem.length > 0) {
|
|
4576
4583
|
liElem.forEach((item) => {
|
|
4577
|
-
if (item.firstChild.nodeName === "OL" || item.firstChild.nodeName === "UL") {
|
|
4584
|
+
if (!isNullOrUndefined(item.firstChild) && (item.firstChild.nodeName === "OL" || item.firstChild.nodeName === "UL")) {
|
|
4578
4585
|
item.style.listStyleType = "none";
|
|
4579
4586
|
}
|
|
4580
4587
|
});
|
|
4581
4588
|
}
|
|
4582
4589
|
}
|
|
4583
4590
|
}
|
|
4591
|
+
/**
|
|
4592
|
+
* Method to scroll the content to the cursor position
|
|
4593
|
+
*
|
|
4594
|
+
* @param {Document} document - specifies the document.
|
|
4595
|
+
* @param {HTMLElement | HTMLBodyElement} inputElement - specifies the input element.
|
|
4596
|
+
* @returns {void}
|
|
4597
|
+
*/
|
|
4598
|
+
function scrollToCursor(document, inputElement) {
|
|
4599
|
+
const rootElement = inputElement.nodeName === 'BODY' ?
|
|
4600
|
+
inputElement.ownerDocument.defaultView.frameElement.closest('.e-richtexteditor') :
|
|
4601
|
+
inputElement.closest('.e-richtexteditor');
|
|
4602
|
+
const height = rootElement.style.height;
|
|
4603
|
+
if (document.getSelection().rangeCount === 0) {
|
|
4604
|
+
return;
|
|
4605
|
+
}
|
|
4606
|
+
const range = document.getSelection().getRangeAt(0);
|
|
4607
|
+
const finalFocusElement = range.startContainer.nodeName === '#text' ? range.startContainer.parentElement :
|
|
4608
|
+
range.startContainer;
|
|
4609
|
+
const rect = finalFocusElement.getBoundingClientRect();
|
|
4610
|
+
const cursorTop = rect.top;
|
|
4611
|
+
const cursorBottom = rect.bottom;
|
|
4612
|
+
const rootRect = rootElement.getBoundingClientRect();
|
|
4613
|
+
const hasMargin = rootElement.querySelectorAll('.e-count-enabled, .e-resize-enabled').length > 0;
|
|
4614
|
+
if (inputElement.nodeName === 'BODY') {
|
|
4615
|
+
if (height === 'auto') {
|
|
4616
|
+
if (window.innerHeight < cursorTop) {
|
|
4617
|
+
finalFocusElement.scrollIntoView(false);
|
|
4618
|
+
}
|
|
4619
|
+
}
|
|
4620
|
+
else {
|
|
4621
|
+
if (cursorTop > inputElement.getBoundingClientRect().height) {
|
|
4622
|
+
finalFocusElement.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
|
4623
|
+
}
|
|
4624
|
+
}
|
|
4625
|
+
}
|
|
4626
|
+
else {
|
|
4627
|
+
if (height === 'auto') {
|
|
4628
|
+
if (window.innerHeight < cursorTop) {
|
|
4629
|
+
finalFocusElement.scrollIntoView({ block: 'end', inline: 'nearest' });
|
|
4630
|
+
}
|
|
4631
|
+
}
|
|
4632
|
+
else {
|
|
4633
|
+
if (cursorBottom > rootRect.bottom) {
|
|
4634
|
+
rootElement.querySelector('.e-rte-content').scrollTop += (cursorBottom - rootRect.bottom) + (hasMargin ? 20 : 0);
|
|
4635
|
+
}
|
|
4636
|
+
}
|
|
4637
|
+
}
|
|
4638
|
+
}
|
|
4584
4639
|
|
|
4585
4640
|
/**
|
|
4586
4641
|
* Update Toolbar Status
|
|
@@ -5397,8 +5452,6 @@ class ToolbarRenderer {
|
|
|
5397
5452
|
target: colorPicker.element.parentElement, cssClass: css,
|
|
5398
5453
|
enablePersistence: this.parent.enablePersistence, enableRtl: this.parent.enableRtl,
|
|
5399
5454
|
beforeOpen: (dropDownArgs) => {
|
|
5400
|
-
colorPicker.inline = true;
|
|
5401
|
-
colorPicker.dataBind();
|
|
5402
5455
|
if (proxy.parent.readonly || !proxy.parent.enabled) {
|
|
5403
5456
|
dropDownArgs.cancel = true;
|
|
5404
5457
|
return;
|
|
@@ -5536,14 +5589,18 @@ class ToolbarRenderer {
|
|
|
5536
5589
|
const colorPicker = new ColorPicker({
|
|
5537
5590
|
enablePersistence: this.parent.enablePersistence,
|
|
5538
5591
|
enableRtl: this.parent.enableRtl,
|
|
5539
|
-
inline:
|
|
5540
|
-
value:
|
|
5592
|
+
inline: true,
|
|
5593
|
+
value: null,
|
|
5594
|
+
cssClass: ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass + ' ' + 'e-rte-picker-init',
|
|
5541
5595
|
created: () => {
|
|
5542
5596
|
const value = (item === 'backgroundcolor') ? proxy.parent.backgroundColor.default : proxy.parent.fontColor.default;
|
|
5543
|
-
colorPicker.
|
|
5597
|
+
colorPicker.cssClass = ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass;
|
|
5598
|
+
colorPicker.value = value;
|
|
5544
5599
|
},
|
|
5545
5600
|
mode: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.mode : proxy.parent.fontColor.mode),
|
|
5546
5601
|
modeSwitcher: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.modeSwitcher : proxy.parent.fontColor.modeSwitcher),
|
|
5602
|
+
presetColors: (item === 'backgroundcolor') ? this.parent.backgroundColor.colorCode : this.parent.fontColor.colorCode,
|
|
5603
|
+
columns: (item === 'backgroundcolor') ? this.parent.backgroundColor.columns : this.parent.fontColor.columns,
|
|
5547
5604
|
beforeTileRender: (args) => {
|
|
5548
5605
|
args.element.classList.add(CLS_COLOR_PALETTE);
|
|
5549
5606
|
args.element.classList.add(CLS_CUSTOM_TILE);
|
|
@@ -5588,10 +5645,6 @@ class ToolbarRenderer {
|
|
|
5588
5645
|
}
|
|
5589
5646
|
});
|
|
5590
5647
|
colorPicker.isStringTemplate = true;
|
|
5591
|
-
colorPicker.columns = (item === 'backgroundcolor') ? this.parent.backgroundColor.columns : this.parent.fontColor.columns;
|
|
5592
|
-
colorPicker.presetColors = (item === 'backgroundcolor') ? this.parent.backgroundColor.colorCode :
|
|
5593
|
-
this.parent.fontColor.colorCode;
|
|
5594
|
-
colorPicker.cssClass = ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass;
|
|
5595
5648
|
colorPicker.createElement = this.parent.createElement;
|
|
5596
5649
|
colorPicker.appendTo(document.getElementById(args.target));
|
|
5597
5650
|
return colorPicker;
|
|
@@ -7158,12 +7211,12 @@ class Toolbar$2 {
|
|
|
7158
7211
|
}
|
|
7159
7212
|
}
|
|
7160
7213
|
|
|
7161
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
7162
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7163
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7164
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7165
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7166
|
-
};
|
|
7214
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
7215
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7216
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7217
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7218
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7219
|
+
};
|
|
7167
7220
|
var KeyboardEvents_1;
|
|
7168
7221
|
const keyCode = {
|
|
7169
7222
|
'backspace': 8,
|
|
@@ -12198,7 +12251,7 @@ class DOMNode {
|
|
|
12198
12251
|
unWrap(element) {
|
|
12199
12252
|
const parent = element.parentNode;
|
|
12200
12253
|
let unWrapNode = [];
|
|
12201
|
-
while (element.firstChild) {
|
|
12254
|
+
while (element.firstChild && (element.previousSibling !== this.parent.querySelector('.e-mention-chip') || element.textContent !== ' ')) {
|
|
12202
12255
|
unWrapNode.push(element.firstChild);
|
|
12203
12256
|
parent.insertBefore(element.firstChild, element);
|
|
12204
12257
|
}
|
|
@@ -12548,6 +12601,109 @@ class DOMNode {
|
|
|
12548
12601
|
}
|
|
12549
12602
|
return null;
|
|
12550
12603
|
}
|
|
12604
|
+
/**
|
|
12605
|
+
* Method to wrap the inline and text node with block node.
|
|
12606
|
+
*
|
|
12607
|
+
* @param {HTMLElement} node - specifies the element sent to wrap the node around it with block nodes.
|
|
12608
|
+
* @param {string} wrapperElement - specifies which block nodes to wrap around.
|
|
12609
|
+
* @returns {HTMLElement} - returns the wrapped element.
|
|
12610
|
+
* @hidden
|
|
12611
|
+
* @deprecated
|
|
12612
|
+
*/
|
|
12613
|
+
gatherElementsAround(node, wrapperElement) {
|
|
12614
|
+
const newWrapElem = createElement(wrapperElement);
|
|
12615
|
+
// Insert the new div element before the current node.
|
|
12616
|
+
let currentNode = node.previousSibling;
|
|
12617
|
+
const currentNodeParent = node.parentElement;
|
|
12618
|
+
if (currentNodeParent.className === 'e-editor-select-start') {
|
|
12619
|
+
currentNodeParent.parentNode.insertBefore(newWrapElem, currentNodeParent);
|
|
12620
|
+
}
|
|
12621
|
+
else if (currentNodeParent) {
|
|
12622
|
+
currentNodeParent.insertBefore(newWrapElem, node);
|
|
12623
|
+
}
|
|
12624
|
+
let i = 0;
|
|
12625
|
+
while (currentNode !== null && currentNode.nodeName !== 'BR' &&
|
|
12626
|
+
!this.isBlockNode(currentNode)) {
|
|
12627
|
+
const prevSibling = currentNode.previousSibling;
|
|
12628
|
+
if (currentNode.nodeType === 3 || currentNode.nodeType === 1) {
|
|
12629
|
+
if (i === 0) {
|
|
12630
|
+
newWrapElem.appendChild(currentNode);
|
|
12631
|
+
}
|
|
12632
|
+
else {
|
|
12633
|
+
newWrapElem.insertBefore(currentNode, newWrapElem.firstChild);
|
|
12634
|
+
}
|
|
12635
|
+
}
|
|
12636
|
+
currentNode = prevSibling;
|
|
12637
|
+
i++;
|
|
12638
|
+
}
|
|
12639
|
+
// Add the current node to the new div
|
|
12640
|
+
newWrapElem.appendChild(node);
|
|
12641
|
+
// Gather text and inline elements after the currentNode
|
|
12642
|
+
currentNode = newWrapElem.nextSibling ? newWrapElem.nextSibling :
|
|
12643
|
+
newWrapElem.parentElement.nextSibling;
|
|
12644
|
+
while (currentNode !== null && currentNode.nodeName !== 'BR' &&
|
|
12645
|
+
!this.isBlockNode(currentNode)) {
|
|
12646
|
+
const nextSibling = currentNode.nextSibling ?
|
|
12647
|
+
currentNode.nextSibling : currentNode.parentElement.nextSibling;
|
|
12648
|
+
if (currentNode.nodeType === 3 || currentNode.nodeType === 1) {
|
|
12649
|
+
newWrapElem.appendChild(currentNode);
|
|
12650
|
+
}
|
|
12651
|
+
currentNode = nextSibling;
|
|
12652
|
+
}
|
|
12653
|
+
return newWrapElem;
|
|
12654
|
+
}
|
|
12655
|
+
/**
|
|
12656
|
+
* Method to convert all the inline nodes between the selection to block nodes.
|
|
12657
|
+
*
|
|
12658
|
+
* @param {Node[]} selectedNodes - specifies the nodes of the start and end selection.
|
|
12659
|
+
* @param {boolean} fromList - specifies if the method is called from list module.
|
|
12660
|
+
* @returns {Node[]} - returns the selected list of elements as block nodes.
|
|
12661
|
+
* @hidden
|
|
12662
|
+
* @deprecated
|
|
12663
|
+
*/
|
|
12664
|
+
convertToBlockNodes(selectedNodes, fromList) {
|
|
12665
|
+
if (selectedNodes.length > 1) {
|
|
12666
|
+
let i = 0;
|
|
12667
|
+
let currentSelectedNode = selectedNodes[0];
|
|
12668
|
+
while (!isNullOrUndefined(currentSelectedNode)) {
|
|
12669
|
+
if (currentSelectedNode.nodeName === 'BR') {
|
|
12670
|
+
const nextNode = currentSelectedNode.nextSibling;
|
|
12671
|
+
detach(currentSelectedNode);
|
|
12672
|
+
currentSelectedNode = nextNode;
|
|
12673
|
+
}
|
|
12674
|
+
if (!isNullOrUndefined(currentSelectedNode)) {
|
|
12675
|
+
if (fromList) {
|
|
12676
|
+
selectedNodes[i] = currentSelectedNode.nodeName === 'LI' || this.isBlockNode(currentSelectedNode) ?
|
|
12677
|
+
currentSelectedNode :
|
|
12678
|
+
this.gatherElementsAround(currentSelectedNode, (fromList ? 'p' : 'div'));
|
|
12679
|
+
}
|
|
12680
|
+
else {
|
|
12681
|
+
selectedNodes[i] = !this.isBlockNode(selectedNodes[i]) ?
|
|
12682
|
+
this.gatherElementsAround(currentSelectedNode, (fromList ? 'p' : 'div')) :
|
|
12683
|
+
selectedNodes[i];
|
|
12684
|
+
}
|
|
12685
|
+
const currentProcessNode = selectedNodes[i].nodeName === 'LI' ? selectedNodes[i].parentElement : selectedNodes[i];
|
|
12686
|
+
const currentElementCheckNode = currentProcessNode.nodeName === '#text' ? currentProcessNode.parentElement : currentProcessNode;
|
|
12687
|
+
currentSelectedNode = !isNullOrUndefined(currentElementCheckNode.querySelector('.e-editor-select-end')) ||
|
|
12688
|
+
!isNullOrUndefined(closest(currentSelectedNode, '.e-editor-select-end')) ?
|
|
12689
|
+
null : currentProcessNode.nextSibling;
|
|
12690
|
+
if (currentSelectedNode === null && !isNullOrUndefined(currentProcessNode.nextSibling) && currentProcessNode.nextSibling.nodeName === 'BR') {
|
|
12691
|
+
detach(currentProcessNode.nextSibling);
|
|
12692
|
+
}
|
|
12693
|
+
}
|
|
12694
|
+
i++;
|
|
12695
|
+
}
|
|
12696
|
+
}
|
|
12697
|
+
else {
|
|
12698
|
+
if (!this.isBlockNode(selectedNodes[0])) {
|
|
12699
|
+
selectedNodes[0] = this.gatherElementsAround(selectedNodes[0], (fromList ? 'p' : 'div'));
|
|
12700
|
+
if (!isNullOrUndefined(selectedNodes[0].nextSibling) && (selectedNodes[0].nextSibling.nodeName === 'BR')) {
|
|
12701
|
+
detach(selectedNodes[0].nextSibling);
|
|
12702
|
+
}
|
|
12703
|
+
}
|
|
12704
|
+
}
|
|
12705
|
+
return selectedNodes;
|
|
12706
|
+
}
|
|
12551
12707
|
/**
|
|
12552
12708
|
* blockNodes method
|
|
12553
12709
|
*
|
|
@@ -13055,7 +13211,7 @@ class Lists {
|
|
|
13055
13211
|
e.event.preventDefault();
|
|
13056
13212
|
}
|
|
13057
13213
|
}
|
|
13058
|
-
onKeyUp() {
|
|
13214
|
+
onKeyUp(e) {
|
|
13059
13215
|
if (!isNullOrUndefined(this.commonLIParent) && !isNullOrUndefined(this.commonLIParent.querySelector('.removeList'))) {
|
|
13060
13216
|
const currentLIElem = this.commonLIParent.querySelector('.removeList');
|
|
13061
13217
|
while (!isNullOrUndefined(currentLIElem.firstChild)) {
|
|
@@ -13063,6 +13219,14 @@ class Lists {
|
|
|
13063
13219
|
}
|
|
13064
13220
|
detach(currentLIElem);
|
|
13065
13221
|
}
|
|
13222
|
+
if (e.event.keyCode === 13) {
|
|
13223
|
+
const listElements = this.parent.editableElement.querySelectorAll('UL, OL');
|
|
13224
|
+
for (let i = 0; i < listElements.length; i++) {
|
|
13225
|
+
if (!isNullOrUndefined(listElements[i]) && !isNullOrUndefined(listElements[i].parentElement) && !isNullOrUndefined(listElements[i].previousElementSibling) && (listElements[i].parentElement.nodeName === 'UL' || listElements[i].parentElement.nodeName === 'OL')) {
|
|
13226
|
+
listElements[i].previousElementSibling.appendChild(listElements[i]);
|
|
13227
|
+
}
|
|
13228
|
+
}
|
|
13229
|
+
}
|
|
13066
13230
|
}
|
|
13067
13231
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13068
13232
|
firstListBackSpace(range, _e) {
|
|
@@ -13304,6 +13468,8 @@ class Lists {
|
|
|
13304
13468
|
else {
|
|
13305
13469
|
if (prevSibling.tagName === 'LI') {
|
|
13306
13470
|
const nestedElement = createElement(elements[i].parentNode.tagName);
|
|
13471
|
+
nestedElement.style.listStyleType =
|
|
13472
|
+
elements[i].parentNode.style.listStyleType;
|
|
13307
13473
|
append([nestedElement], prevSibling);
|
|
13308
13474
|
append([elements[i]], nestedElement);
|
|
13309
13475
|
}
|
|
@@ -13353,39 +13519,7 @@ class Lists {
|
|
|
13353
13519
|
let listsNodes = this.domNode.blockNodes(true);
|
|
13354
13520
|
if (e.enterAction === 'BR') {
|
|
13355
13521
|
this.setSelectionBRConfig();
|
|
13356
|
-
|
|
13357
|
-
if (selectedNodes.length > 1) {
|
|
13358
|
-
let i = 0;
|
|
13359
|
-
let currentAlignmentNode = selectedNodes[0];
|
|
13360
|
-
while (!isNullOrUndefined(currentAlignmentNode)) {
|
|
13361
|
-
if (currentAlignmentNode.nodeName === 'BR') {
|
|
13362
|
-
const nextNode = currentAlignmentNode.nextSibling;
|
|
13363
|
-
detach(currentAlignmentNode);
|
|
13364
|
-
currentAlignmentNode = nextNode;
|
|
13365
|
-
}
|
|
13366
|
-
if (!isNullOrUndefined(currentAlignmentNode)) {
|
|
13367
|
-
selectedNodes[i] = currentAlignmentNode.nodeName === 'LI' || this.parent.domNode.isBlockNode(currentAlignmentNode) ?
|
|
13368
|
-
currentAlignmentNode : this.gatherElementsAround(currentAlignmentNode);
|
|
13369
|
-
const currentSelectNode = selectedNodes[i].nodeName === 'LI' ? selectedNodes[i].parentElement : selectedNodes[i];
|
|
13370
|
-
const currentElementCheckNode = currentAlignmentNode.nodeName === '#text' ? currentAlignmentNode.parentElement : currentAlignmentNode;
|
|
13371
|
-
currentAlignmentNode = !isNullOrUndefined(currentElementCheckNode.querySelector('.e-editor-select-end')) ||
|
|
13372
|
-
!isNullOrUndefined(closest(currentAlignmentNode, '.e-editor-select-end')) ?
|
|
13373
|
-
null : currentSelectNode.nextSibling;
|
|
13374
|
-
if (currentAlignmentNode === null && !isNullOrUndefined(currentSelectNode.nextSibling) && currentSelectNode.nextSibling.nodeName === 'BR') {
|
|
13375
|
-
detach(currentSelectNode.nextSibling);
|
|
13376
|
-
}
|
|
13377
|
-
}
|
|
13378
|
-
i++;
|
|
13379
|
-
}
|
|
13380
|
-
}
|
|
13381
|
-
else {
|
|
13382
|
-
if (!this.parent.domNode.isBlockNode(selectedNodes[0])) {
|
|
13383
|
-
selectedNodes[0] = this.gatherElementsAround(selectedNodes[0]);
|
|
13384
|
-
if (!isNullOrUndefined(selectedNodes[0].nextSibling) && (selectedNodes[0].nextSibling.nodeName === 'BR')) {
|
|
13385
|
-
detach(selectedNodes[0].nextSibling);
|
|
13386
|
-
}
|
|
13387
|
-
}
|
|
13388
|
-
}
|
|
13522
|
+
this.parent.domNode.convertToBlockNodes(this.parent.domNode.blockNodes(), true);
|
|
13389
13523
|
this.setSelectionBRConfig();
|
|
13390
13524
|
listsNodes = this.parent.domNode.blockNodes();
|
|
13391
13525
|
}
|
|
@@ -13442,7 +13576,7 @@ class Lists {
|
|
|
13442
13576
|
}
|
|
13443
13577
|
let elemAtt;
|
|
13444
13578
|
elements[i].style.removeProperty('margin-left');
|
|
13445
|
-
elemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
|
|
13579
|
+
elemAtt = elements[i].tagName === 'IMG' || elements[i].classList.contains('e-editor-select-start') ? '' : this.domNode.attributes(elements[i]);
|
|
13446
13580
|
if (elements[i].getAttribute('contenteditable') === 'true'
|
|
13447
13581
|
&& elements[i].childNodes.length === 1 && elements[i].childNodes[0].nodeName === 'TABLE') {
|
|
13448
13582
|
const listEle = document.createElement(type);
|
|
@@ -13563,6 +13697,13 @@ class Lists {
|
|
|
13563
13697
|
for (let c = 0; c < liParents.length; c++) {
|
|
13564
13698
|
const node = liParents[c];
|
|
13565
13699
|
let toFindtopOlUl = true;
|
|
13700
|
+
let containsListElements = node;
|
|
13701
|
+
while (containsListElements.parentElement) {
|
|
13702
|
+
if (containsListElements.parentElement && containsListElements.parentElement.tagName !== 'LI' && containsListElements.parentElement.tagName !== 'OL' && containsListElements.parentElement.tagName !== 'UL') {
|
|
13703
|
+
break;
|
|
13704
|
+
}
|
|
13705
|
+
containsListElements = containsListElements.parentElement;
|
|
13706
|
+
}
|
|
13566
13707
|
if (toFindtopOlUl && (liParents[c].parentElement.parentElement.nodeName === 'OL' || liParents[c].parentElement.parentElement.nodeName === 'UL')) {
|
|
13567
13708
|
toFindtopOlUl = false;
|
|
13568
13709
|
const preElement = liParents[c].parentElement.parentElement;
|
|
@@ -13582,9 +13723,43 @@ class Lists {
|
|
|
13582
13723
|
node.previousElementSibling.lastChild.append(node);
|
|
13583
13724
|
}
|
|
13584
13725
|
}
|
|
13726
|
+
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'))) {
|
|
13727
|
+
const contentNodes = this.domNode.contents(node);
|
|
13728
|
+
for (let f = 0; f < contentNodes.length; f++) {
|
|
13729
|
+
node.previousElementSibling.appendChild(contentNodes[f]);
|
|
13730
|
+
}
|
|
13731
|
+
node.parentNode.removeChild(node);
|
|
13732
|
+
}
|
|
13585
13733
|
}
|
|
13586
13734
|
if (firstNodeOL) {
|
|
13587
13735
|
firstNodeOL.style.listStyleType = listStyleType;
|
|
13736
|
+
const range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
13737
|
+
let listOlUlElements = [];
|
|
13738
|
+
if (range.commonAncestorContainer.nodeName === 'UL' || range.commonAncestorContainer.nodeName === 'OL') {
|
|
13739
|
+
if (range.commonAncestorContainer instanceof Element) {
|
|
13740
|
+
listOlUlElements.push(range.commonAncestorContainer);
|
|
13741
|
+
}
|
|
13742
|
+
listOlUlElements = listOlUlElements.concat(Array.from(range.commonAncestorContainer.querySelectorAll('ol, ul')));
|
|
13743
|
+
}
|
|
13744
|
+
else {
|
|
13745
|
+
listOlUlElements = Array.from(range.commonAncestorContainer.querySelectorAll('ol, ul'));
|
|
13746
|
+
}
|
|
13747
|
+
for (let k = 0; k < listOlUlElements.length; k++) {
|
|
13748
|
+
let listStyle;
|
|
13749
|
+
let listElements = listOlUlElements[k];
|
|
13750
|
+
while (listElements) {
|
|
13751
|
+
if (listElements.nodeName === 'OL' || listElements.nodeName === 'OL') {
|
|
13752
|
+
if (listElements.style.listStyleType !== '' && listElements.style.listStyleType !== 'none' && listElements.nodeName !== 'LI') {
|
|
13753
|
+
listStyle = listElements.style.listStyleType;
|
|
13754
|
+
}
|
|
13755
|
+
else if (!isNullOrUndefined(listStyle) && (listElements.style.listStyleType === '' || listElements.style.listStyleType === 'none') &&
|
|
13756
|
+
listElements.nodeName !== 'LI' && (listElements.nodeName === 'UL' || listElements.nodeName === 'OL')) {
|
|
13757
|
+
listElements.style.listStyleType = listStyle;
|
|
13758
|
+
}
|
|
13759
|
+
}
|
|
13760
|
+
listElements = listElements.querySelector('UL,OL');
|
|
13761
|
+
}
|
|
13762
|
+
}
|
|
13588
13763
|
}
|
|
13589
13764
|
}
|
|
13590
13765
|
findUnSelected(temp, elements) {
|
|
@@ -13687,7 +13862,7 @@ class Lists {
|
|
|
13687
13862
|
parentNode.removeAttribute("style");
|
|
13688
13863
|
}
|
|
13689
13864
|
}
|
|
13690
|
-
const wrapper = '<' +
|
|
13865
|
+
const wrapper = '<' + e.enterAction + wrapperclass + this.domNode.attributes(element) + '></' + e.enterAction + '>';
|
|
13691
13866
|
if (e.enterAction !== 'BR') {
|
|
13692
13867
|
this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapper));
|
|
13693
13868
|
}
|
|
@@ -13761,48 +13936,6 @@ class Lists {
|
|
|
13761
13936
|
closeTag(type) {
|
|
13762
13937
|
return this.domNode.parseHTMLFragment('<span class="e-rte-list-close-' + type.toLowerCase() + '"></span>');
|
|
13763
13938
|
}
|
|
13764
|
-
gatherElementsAround(node) {
|
|
13765
|
-
const pWrap = document.createElement('p');
|
|
13766
|
-
// Insert the new div before the current node
|
|
13767
|
-
let currentNode = node.previousSibling;
|
|
13768
|
-
const classNode = node.parentNode;
|
|
13769
|
-
if (classNode.className === 'e-editor-select-start') {
|
|
13770
|
-
node.parentNode.parentNode.insertBefore(pWrap, node.parentNode);
|
|
13771
|
-
}
|
|
13772
|
-
else if (node.parentNode) {
|
|
13773
|
-
node.parentNode.insertBefore(pWrap, node);
|
|
13774
|
-
}
|
|
13775
|
-
// Gather text and inline elements before the currentNode
|
|
13776
|
-
let i = 0;
|
|
13777
|
-
while (currentNode !== null && currentNode.nodeName !== 'BR' &&
|
|
13778
|
-
!this.parent.domNode.isBlockNode(currentNode)) {
|
|
13779
|
-
const prevSibling = currentNode.previousSibling;
|
|
13780
|
-
if (currentNode.nodeType === 3 || currentNode.nodeType === 1) {
|
|
13781
|
-
if (i === 0) {
|
|
13782
|
-
pWrap.appendChild(currentNode);
|
|
13783
|
-
}
|
|
13784
|
-
else {
|
|
13785
|
-
pWrap.insertBefore(currentNode, pWrap.firstChild);
|
|
13786
|
-
}
|
|
13787
|
-
}
|
|
13788
|
-
currentNode = prevSibling;
|
|
13789
|
-
i++;
|
|
13790
|
-
}
|
|
13791
|
-
// Add the current node to the new p
|
|
13792
|
-
pWrap.appendChild(node);
|
|
13793
|
-
// Gather text and inline elements after the currentNode
|
|
13794
|
-
currentNode = pWrap.nextSibling ? pWrap.nextSibling : pWrap.parentElement.nextSibling;
|
|
13795
|
-
while (currentNode !== null && currentNode.nodeName !== 'BR' &&
|
|
13796
|
-
!this.parent.domNode.isBlockNode(currentNode)) {
|
|
13797
|
-
const nextSibling = currentNode.nextSibling ?
|
|
13798
|
-
currentNode.nextSibling : currentNode.parentElement.nextSibling;
|
|
13799
|
-
if (currentNode.nodeType === 3 || currentNode.nodeType === 1) {
|
|
13800
|
-
pWrap.appendChild(currentNode);
|
|
13801
|
-
}
|
|
13802
|
-
currentNode = nextSibling;
|
|
13803
|
-
}
|
|
13804
|
-
return pWrap;
|
|
13805
|
-
}
|
|
13806
13939
|
}
|
|
13807
13940
|
|
|
13808
13941
|
/**
|
|
@@ -14137,8 +14270,8 @@ class Formats {
|
|
|
14137
14270
|
}
|
|
14138
14271
|
}
|
|
14139
14272
|
}
|
|
14140
|
-
if (e.enterAction !== 'BR' && !isNullOrUndefined(range.startContainer) && !isNullOrUndefined(range.startContainer.parentElement) && range.startContainer === range.endContainer && range.startContainer.nodeName === '#text' && range.startContainer.parentElement.classList.contains(
|
|
14141
|
-
|
|
14273
|
+
if (e.enterAction !== 'BR' && !isNullOrUndefined(range.startContainer) && !isNullOrUndefined(range.startContainer.parentElement) && range.startContainer === range.endContainer && range.startContainer.nodeName === '#text' && range.startContainer.parentElement.classList.contains('e-content') && range.startContainer.parentElement.isContentEditable) {
|
|
14274
|
+
const pTag = createElement(e.enterAction);
|
|
14142
14275
|
range.startContainer.parentElement.insertBefore(pTag, range.startContainer);
|
|
14143
14276
|
pTag.appendChild(range.startContainer);
|
|
14144
14277
|
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, pTag, 1);
|
|
@@ -14555,6 +14688,9 @@ class InsertHtml {
|
|
|
14555
14688
|
this.insertTableInList(range, node, closestParentNode, nodes[0], nodeCutter);
|
|
14556
14689
|
return;
|
|
14557
14690
|
}
|
|
14691
|
+
if (isCursor && range.startContainer.textContent === '' && range.startContainer.nodeName !== 'BR' && enterAction !== 'BR' && node.nodeName !== '#text' && !isNullOrUndefined(node.children[0]) && !isNullOrUndefined(node.children[0].tagName) && node.children[0].tagName === 'IMG' && node.children.length === 1) {
|
|
14692
|
+
range.startContainer.innerHTML = '';
|
|
14693
|
+
}
|
|
14558
14694
|
if (isExternal || (!isNullOrUndefined(node) && !isNullOrUndefined(node.classList) &&
|
|
14559
14695
|
node.classList.contains('pasteContent'))) {
|
|
14560
14696
|
this.pasteInsertHTML(nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode, enterAction);
|
|
@@ -15478,7 +15614,10 @@ class Alignments {
|
|
|
15478
15614
|
let save = this.parent.nodeSelection.save(range, this.parent.currentDocument);
|
|
15479
15615
|
if (!isTableAlign) {
|
|
15480
15616
|
this.parent.domNode.setMarker(save);
|
|
15481
|
-
|
|
15617
|
+
let alignmentNodes = this.parent.domNode.blockNodes();
|
|
15618
|
+
if (e.enterAction === 'BR') {
|
|
15619
|
+
alignmentNodes = this.parent.domNode.convertToBlockNodes(alignmentNodes, false);
|
|
15620
|
+
}
|
|
15482
15621
|
for (let i = 0; i < alignmentNodes.length; i++) {
|
|
15483
15622
|
const parentNode = alignmentNodes[i];
|
|
15484
15623
|
setStyleAttribute(parentNode, { 'text-align': this.alignments[e.subCommand] });
|
|
@@ -15560,7 +15699,10 @@ class Indents {
|
|
|
15560
15699
|
const range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
15561
15700
|
let save = this.parent.nodeSelection.save(range, this.parent.currentDocument);
|
|
15562
15701
|
this.parent.domNode.setMarker(save);
|
|
15563
|
-
|
|
15702
|
+
let indentsNodes = this.parent.domNode.blockNodes();
|
|
15703
|
+
if (e.enterAction === 'BR') {
|
|
15704
|
+
indentsNodes = this.parent.domNode.convertToBlockNodes(indentsNodes, false);
|
|
15705
|
+
}
|
|
15564
15706
|
const parentNodes = indentsNodes.slice();
|
|
15565
15707
|
const listsNodes = [];
|
|
15566
15708
|
for (let i = 0; i < parentNodes.length; i++) {
|
|
@@ -18953,6 +19095,7 @@ class UndoRedoManager {
|
|
|
18953
19095
|
this.parent.editableElement.innerHTML = '';
|
|
18954
19096
|
this.parent.editableElement.appendChild(removedContent.cloneNode(true));
|
|
18955
19097
|
this.parent.editableElement.focus();
|
|
19098
|
+
scrollToCursor(this.parent.currentDocument, this.parent.editableElement);
|
|
18956
19099
|
if (isIDevice$1()) {
|
|
18957
19100
|
setEditFrameFocus(this.parent.editableElement, e.selector);
|
|
18958
19101
|
}
|
|
@@ -18985,6 +19128,7 @@ class UndoRedoManager {
|
|
|
18985
19128
|
this.parent.editableElement.innerHTML = '';
|
|
18986
19129
|
this.parent.editableElement.appendChild(addedContent.cloneNode(true));
|
|
18987
19130
|
this.parent.editableElement.focus();
|
|
19131
|
+
scrollToCursor(this.parent.currentDocument, this.parent.editableElement);
|
|
18988
19132
|
if (isIDevice$1()) {
|
|
18989
19133
|
setEditFrameFocus(this.parent.editableElement, e.selector);
|
|
18990
19134
|
}
|
|
@@ -19085,9 +19229,9 @@ class MsWordPaste {
|
|
|
19085
19229
|
const patern2 = /class="?Mso|style="[^ ]*\bmso-/i;
|
|
19086
19230
|
const patern3 = /(class="?Mso|class='?Mso|class="?Xl|class='?Xl|class=Xl|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument)/gi;
|
|
19087
19231
|
const pattern4 = /style='mso-width-source:/i;
|
|
19232
|
+
const source = this.findSource(elm);
|
|
19088
19233
|
if (patern.test(tempHTMLContent) || patern2.test(tempHTMLContent) || patern3.test(tempHTMLContent) ||
|
|
19089
19234
|
pattern4.test(tempHTMLContent)) {
|
|
19090
|
-
const source = this.findSource(elm);
|
|
19091
19235
|
tempHTMLContent = tempHTMLContent.replace(/<img[^>]+>/i, '');
|
|
19092
19236
|
this.addListClass(elm);
|
|
19093
19237
|
listNodes = this.cleanUp(elm, listNodes);
|
|
@@ -19112,7 +19256,7 @@ class MsWordPaste {
|
|
|
19112
19256
|
e.callBack(elm.innerHTML, this.cropImageDimensions, source);
|
|
19113
19257
|
}
|
|
19114
19258
|
else {
|
|
19115
|
-
e.callBack(elm.innerHTML);
|
|
19259
|
+
e.callBack(elm.innerHTML, null, source);
|
|
19116
19260
|
}
|
|
19117
19261
|
}
|
|
19118
19262
|
addDoubleBr(elm) {
|
|
@@ -19840,7 +19984,7 @@ class MsWordPaste {
|
|
|
19840
19984
|
!isNormalList) {
|
|
19841
19985
|
prevList = null;
|
|
19842
19986
|
}
|
|
19843
|
-
const pElement = createElement('p', { className: '
|
|
19987
|
+
const pElement = createElement('p', { className: 'MsoNoSpacing' });
|
|
19844
19988
|
pElement.innerHTML = collection[index].content.join(' ');
|
|
19845
19989
|
if ((collection[index].nestedLevel === 1) &&
|
|
19846
19990
|
(listCount === 0 || lfo !== collection[index].listFormatOverride) &&
|
|
@@ -20916,12 +21060,14 @@ class EditorManager {
|
|
|
20916
21060
|
case 'alignments':
|
|
20917
21061
|
this.observer.notify(ALIGNMENT_TYPE, {
|
|
20918
21062
|
subCommand: value, event: event, callBack: callBack,
|
|
20919
|
-
selector: selector,
|
|
20920
|
-
value: exeValue
|
|
21063
|
+
selector: selector, value: exeValue, enterAction: enterAction
|
|
20921
21064
|
});
|
|
20922
21065
|
break;
|
|
20923
21066
|
case 'indents':
|
|
20924
|
-
this.observer.notify(INDENT_TYPE, {
|
|
21067
|
+
this.observer.notify(INDENT_TYPE, {
|
|
21068
|
+
subCommand: value, event: event, callBack: callBack,
|
|
21069
|
+
selector: selector, enterAction: enterAction
|
|
21070
|
+
});
|
|
20925
21071
|
break;
|
|
20926
21072
|
case 'links':
|
|
20927
21073
|
this.observer.notify(LINK, { command: command, value: value, item: exeValue, event: event, callBack: callBack });
|
|
@@ -21250,116 +21396,116 @@ class ContentRender {
|
|
|
21250
21396
|
}
|
|
21251
21397
|
}
|
|
21252
21398
|
|
|
21253
|
-
const IFRAMEHEADER = `
|
|
21254
|
-
<!DOCTYPE html>
|
|
21255
|
-
<html>
|
|
21256
|
-
<head>
|
|
21257
|
-
<meta charset='utf-8' />
|
|
21258
|
-
<style>
|
|
21259
|
-
@charset "UTF-8";
|
|
21260
|
-
body {
|
|
21261
|
-
font-family: "Roboto", sans-serif;
|
|
21262
|
-
font-size: 14px;
|
|
21263
|
-
}
|
|
21264
|
-
html, body{height: 100%;margin: 0;}
|
|
21265
|
-
body.e-cursor{cursor:default}
|
|
21266
|
-
span.e-selected-node {background-color: #939393;color: white;}
|
|
21267
|
-
span.e-selected-node.e-highlight {background-color: #1d9dd8;}
|
|
21268
|
-
body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}
|
|
21269
|
-
.e-rte-image, .e-rte-video {border: 0;cursor: pointer;display:
|
|
21270
|
-
block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}
|
|
21271
|
-
.e-rte-audio {border: 0;cursor: pointer;display:
|
|
21272
|
-
block;float: none;margin: 5px auto;max-width: 100%;position: relative;}
|
|
21273
|
-
.e-rte-image.e-imginline, .e-rte-audio.e-audio-inline, .e-rte-video.e-video-inline {display: inline-block;float: none;
|
|
21274
|
-
margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));padding: 1px;vertical-align: bottom;}
|
|
21275
|
-
.e-rte-image.e-imgcenter, .e-rte-video.e-video-center {cursor: pointer;display: block;float: none;margin: 5px auto;max-width: 100%;position: relative;}
|
|
21276
|
-
.e-rte-image.e-imgright, .e-rte-video.e-video-right { float: right; margin: 0 auto;margin-left: 5px;text-align: right;}
|
|
21277
|
-
.e-rte-image.e-imgleft, .e-rte-video.e-video-left {float: left;margin: 0 auto;margin-right: 5px;text-align: left;}
|
|
21278
|
-
.e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}
|
|
21279
|
-
.e-img-caption.e-caption-inline {display: inline-block;float: none;
|
|
21280
|
-
margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));
|
|
21281
|
-
position: relativetext-align: center;vertical-align: bottom;}
|
|
21282
|
-
.e-rte-img-caption.e-imgcenter {display: contents; margin-left: auto; margin-right: auto;}
|
|
21283
|
-
.e-rte-img-caption.e-imgright {display: contents; margin-left: auto; margin-right: 0;}
|
|
21284
|
-
.e-rte-img-caption.e-imgleft {display: contents;margin-left: 0;margin-right: auto;}
|
|
21285
|
-
.e-img-caption.e-rte-img-caption.e-imgbreak {display: contents;}
|
|
21286
|
-
.e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;
|
|
21287
|
-
margin: auto;opacity: .9;text-align: center;width: 100%;}
|
|
21288
|
-
.e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}
|
|
21289
|
-
.e-imgleft, .e-video-left {float: left;margin: 0 5px 0 0;text-align: left;}
|
|
21290
|
-
.e-imgright, .e-video-right {float: right;margin: 0 0 0 5px;text-align: right;}
|
|
21291
|
-
.e-imgcenter, .e-video-center {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}
|
|
21292
|
-
.e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}
|
|
21293
|
-
.e-imginline , .e-audio-inline, .e-video-inline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;
|
|
21294
|
-
max-width: calc(100% - (2 * 5px));vertical-align: bottom;}
|
|
21295
|
-
.e-imgbreak, .e-audio-break, .e-video-break {border: 0;cursor: pointer;
|
|
21296
|
-
display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}
|
|
21297
|
-
.e-rte-image.e-img-focus:not(.e-resize), .e-audio-focus:not(.e-resize), .e-video-focus:not(.e-resize) {border: solid 2px #4a90e2;}
|
|
21298
|
-
img.e-img-focus::selection, audio.e-audio-focus::selection, .e-video-focus::selection { background: transparent;color: transparent;}
|
|
21299
|
-
span.e-rte-imageboxmark, span.e-rte-videoboxmark { width: 10px; height: 10px; position: absolute; display: block;
|
|
21300
|
-
background: #4a90e2; border: 1px solid #fff; z-index: 1000;}
|
|
21301
|
-
.e-mob-rte.e-mob-span span.e-rte-imageboxmark, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { background: #4a90e2; border: 1px solid #fff; }
|
|
21302
|
-
.e-mob-rte span.e-rte-imageboxmark, .e-mob-rte span.e-rte-videoboxmark { background: #fff; border: 1px solid #4a90e2;
|
|
21303
|
-
border-radius: 15px; height: 20px; width: 20px; }
|
|
21304
|
-
.e-mob-rte.e-mob-span span.e-rte-imageboxmark, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { background: #4a90e2; border: 1px solid #fff; }
|
|
21305
|
-
.e-rte-content .e-content img.e-resize, .e-rte-content .e-content video.e-resize { z-index: 1000; }
|
|
21306
|
-
.e-img-caption .e-img-inner { outline: 0; }
|
|
21307
|
-
.e-rte-img-caption.e-imgleft .e-img-inner { float: left; text-align: left; }
|
|
21308
|
-
.e-rte-img-caption.e-imgright .e-img-inner { float: right; text-align: right; }
|
|
21309
|
-
.e-rte-img-caption.e-imgleft .e-img-wrap, .e-rte-img-caption.e-imgright .e-img-wrap { display: contents; }
|
|
21310
|
-
.e-img-caption a:focus-visible { outline: none; }
|
|
21311
|
-
.e-rte-img-caption .e-rte-image.e-imgright { margin-left: auto; margin-right: 0; }
|
|
21312
|
-
.e-rte-img-caption .e-rte-image.e-imgleft { margin: 0; }
|
|
21313
|
-
body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;
|
|
21314
|
-
overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}
|
|
21315
|
-
p{margin: 0 0 10px;margin-bottom: 10px;}
|
|
21316
|
-
li{margin-bottom: 10px;}
|
|
21317
|
-
table{margin-bottom: 10px;}
|
|
21318
|
-
h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}
|
|
21319
|
-
h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}
|
|
21320
|
-
h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}
|
|
21321
|
-
h4{font-size: 16px;font-weight: 400;line-height: 1.5;margin: 0;}
|
|
21322
|
-
h5{font-size: 00.8em;font-weight: 400;margin: 0;}
|
|
21323
|
-
h6{font-size: 00.65em;font-weight: 400;margin: 0;}
|
|
21324
|
-
blockquote{margin: 10px 0;margin-left: 0;padding-left: 5px;border-left: solid 2px #5c5c5c;}
|
|
21325
|
-
pre{background-color: inherit;border: 0;border-radius: 0;color: #333;
|
|
21326
|
-
font-size: inherit;line-height: inherit;margin: 0 0 10px;overflow: visible;padding: 0;
|
|
21327
|
-
white-space: pre-wrap;word-break: inherit;word-wrap: break-word;}
|
|
21328
|
-
strong, b{font-weight: 700;}
|
|
21329
|
-
a{text-decoration: none;user-select: auto;}
|
|
21330
|
-
a:hover{text-decoration: underline;};
|
|
21331
|
-
p:last-child, pre:last-child, blockquote:last-child{margin-bottom: 0;}
|
|
21332
|
-
h3+h4, h4+h5, h5+h6{margin-top: 00.6em;}
|
|
21333
|
-
ul:last-child{margin-bottom: 0;}
|
|
21334
|
-
table { border-collapse: collapse; empty-cells: show;}
|
|
21335
|
-
table td,table th {border: 1px solid #BDBDBD; height: 20px; padding: 2px 5px; vertical-align: middle;}
|
|
21336
|
-
table.e-alternate-border tbody tr:nth-child(2n) {background-color: #F5F5F5;}
|
|
21337
|
-
table th {background-color: #E0E0E0;}
|
|
21338
|
-
table.e-dashed-border td,table.e-dashed-border th { border: 1px dashed #BDBDBD}
|
|
21339
|
-
table .e-cell-select {border: 1px double #4a90e2;}
|
|
21340
|
-
span.e-table-box { cursor: nwse-resize; display: block; height: 10px; position: absolute; width: 10px; }
|
|
21341
|
-
span.e-table-box.e-rmob {height: 14px;width: 14px;}
|
|
21342
|
-
.e-row-resize, .e-column-resize { background-color: transparent; background-repeat: repeat;
|
|
21343
|
-
bottom: 0;cursor: col-resize;height: 1px;overflow: visible;position: absolute;width: 1px; }
|
|
21344
|
-
.e-row-resize { cursor: row-resize; height: 1px;}
|
|
21345
|
-
.e-table-rhelper { cursor: col-resize; opacity: .87;position: absolute;}
|
|
21346
|
-
.e-table-rhelper.e-column-helper { width: 1px; }
|
|
21347
|
-
.e-table-rhelper.e-row-helper {height: 1px;}
|
|
21348
|
-
.e-reicon::before { border-bottom: 6px solid transparent; border-right: 6px solid;
|
|
21349
|
-
border-top: 6px solid transparent; content: ''; display: block; height: 0;
|
|
21350
|
-
position: absolute; right: 4px; top: 4px; width: 20px; }
|
|
21351
|
-
.e-reicon::after { border-bottom: 6px solid transparent; border-left: 6px solid;
|
|
21352
|
-
border-top: 6px solid transparent; content: ''; display: block;
|
|
21353
|
-
height: 0; left: 4px; position: absolute; top: 4px; width: 20px; z-index: 3; }
|
|
21354
|
-
.e-row-helper.e-reicon::after { top: 10px; transform: rotate(90deg); }
|
|
21355
|
-
.e-row-helper.e-reicon::before { left: 4px; top: -20px; transform: rotate(90deg); }
|
|
21356
|
-
span.e-table-box { background-color: #ffffff; border: 1px solid #BDBDBD; }
|
|
21357
|
-
span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }
|
|
21358
|
-
.e-table-rhelper { background-color: #4a90e2;}
|
|
21359
|
-
.e-rtl { direction: rtl; }
|
|
21360
|
-
.e-rte-placeholder::before { content: attr(placeholder); opacity: 0.54; overflow: hidden; padding-top: 16px; position: absolute; text-align: start; top: 0; z-index: 1; }
|
|
21361
|
-
li ol, li ul { margin-block-start: 10px;}
|
|
21362
|
-
</style>
|
|
21399
|
+
const IFRAMEHEADER = `
|
|
21400
|
+
<!DOCTYPE html>
|
|
21401
|
+
<html>
|
|
21402
|
+
<head>
|
|
21403
|
+
<meta charset='utf-8' />
|
|
21404
|
+
<style>
|
|
21405
|
+
@charset "UTF-8";
|
|
21406
|
+
body {
|
|
21407
|
+
font-family: "Roboto", sans-serif;
|
|
21408
|
+
font-size: 14px;
|
|
21409
|
+
}
|
|
21410
|
+
html, body{height: 100%;margin: 0;}
|
|
21411
|
+
body.e-cursor{cursor:default}
|
|
21412
|
+
span.e-selected-node {background-color: #939393;color: white;}
|
|
21413
|
+
span.e-selected-node.e-highlight {background-color: #1d9dd8;}
|
|
21414
|
+
body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}
|
|
21415
|
+
.e-rte-image, .e-rte-video {border: 0;cursor: pointer;display:
|
|
21416
|
+
block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}
|
|
21417
|
+
.e-rte-audio {border: 0;cursor: pointer;display:
|
|
21418
|
+
block;float: none;margin: 5px auto;max-width: 100%;position: relative;}
|
|
21419
|
+
.e-rte-image.e-imginline, .e-rte-audio.e-audio-inline, .e-rte-video.e-video-inline {display: inline-block;float: none;
|
|
21420
|
+
margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));padding: 1px;vertical-align: bottom;}
|
|
21421
|
+
.e-rte-image.e-imgcenter, .e-rte-video.e-video-center {cursor: pointer;display: block;float: none;margin: 5px auto;max-width: 100%;position: relative;}
|
|
21422
|
+
.e-rte-image.e-imgright, .e-rte-video.e-video-right { float: right; margin: 0 auto;margin-left: 5px;text-align: right;}
|
|
21423
|
+
.e-rte-image.e-imgleft, .e-rte-video.e-video-left {float: left;margin: 0 auto;margin-right: 5px;text-align: left;}
|
|
21424
|
+
.e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}
|
|
21425
|
+
.e-img-caption.e-caption-inline {display: inline-block;float: none;
|
|
21426
|
+
margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));
|
|
21427
|
+
position: relativetext-align: center;vertical-align: bottom;}
|
|
21428
|
+
.e-rte-img-caption.e-imgcenter {display: contents; margin-left: auto; margin-right: auto;}
|
|
21429
|
+
.e-rte-img-caption.e-imgright {display: contents; margin-left: auto; margin-right: 0;}
|
|
21430
|
+
.e-rte-img-caption.e-imgleft {display: contents;margin-left: 0;margin-right: auto;}
|
|
21431
|
+
.e-img-caption.e-rte-img-caption.e-imgbreak {display: contents;}
|
|
21432
|
+
.e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;
|
|
21433
|
+
margin: auto;opacity: .9;text-align: center;width: 100%;}
|
|
21434
|
+
.e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}
|
|
21435
|
+
.e-imgleft, .e-video-left {float: left;margin: 0 5px 0 0;text-align: left;}
|
|
21436
|
+
.e-imgright, .e-video-right {float: right;margin: 0 0 0 5px;text-align: right;}
|
|
21437
|
+
.e-imgcenter, .e-video-center {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}
|
|
21438
|
+
.e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}
|
|
21439
|
+
.e-imginline , .e-audio-inline, .e-video-inline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;
|
|
21440
|
+
max-width: calc(100% - (2 * 5px));vertical-align: bottom;}
|
|
21441
|
+
.e-imgbreak, .e-audio-break, .e-video-break {border: 0;cursor: pointer;
|
|
21442
|
+
display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}
|
|
21443
|
+
.e-rte-image.e-img-focus:not(.e-resize), .e-audio-focus:not(.e-resize), .e-video-focus:not(.e-resize) {border: solid 2px #4a90e2;}
|
|
21444
|
+
img.e-img-focus::selection, audio.e-audio-focus::selection, .e-video-focus::selection { background: transparent;color: transparent;}
|
|
21445
|
+
span.e-rte-imageboxmark, span.e-rte-videoboxmark { width: 10px; height: 10px; position: absolute; display: block;
|
|
21446
|
+
background: #4a90e2; border: 1px solid #fff; z-index: 1000;}
|
|
21447
|
+
.e-mob-rte.e-mob-span span.e-rte-imageboxmark, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { background: #4a90e2; border: 1px solid #fff; }
|
|
21448
|
+
.e-mob-rte span.e-rte-imageboxmark, .e-mob-rte span.e-rte-videoboxmark { background: #fff; border: 1px solid #4a90e2;
|
|
21449
|
+
border-radius: 15px; height: 20px; width: 20px; }
|
|
21450
|
+
.e-mob-rte.e-mob-span span.e-rte-imageboxmark, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { background: #4a90e2; border: 1px solid #fff; }
|
|
21451
|
+
.e-rte-content .e-content img.e-resize, .e-rte-content .e-content video.e-resize { z-index: 1000; }
|
|
21452
|
+
.e-img-caption .e-img-inner { outline: 0; }
|
|
21453
|
+
.e-rte-img-caption.e-imgleft .e-img-inner { float: left; text-align: left; }
|
|
21454
|
+
.e-rte-img-caption.e-imgright .e-img-inner { float: right; text-align: right; }
|
|
21455
|
+
.e-rte-img-caption.e-imgleft .e-img-wrap, .e-rte-img-caption.e-imgright .e-img-wrap { display: contents; }
|
|
21456
|
+
.e-img-caption a:focus-visible { outline: none; }
|
|
21457
|
+
.e-rte-img-caption .e-rte-image.e-imgright { margin-left: auto; margin-right: 0; }
|
|
21458
|
+
.e-rte-img-caption .e-rte-image.e-imgleft { margin: 0; }
|
|
21459
|
+
body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;
|
|
21460
|
+
overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}
|
|
21461
|
+
p{margin: 0 0 10px;margin-bottom: 10px;}
|
|
21462
|
+
li{margin-bottom: 10px;}
|
|
21463
|
+
table{margin-bottom: 10px;}
|
|
21464
|
+
h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}
|
|
21465
|
+
h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}
|
|
21466
|
+
h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}
|
|
21467
|
+
h4{font-size: 16px;font-weight: 400;line-height: 1.5;margin: 0;}
|
|
21468
|
+
h5{font-size: 00.8em;font-weight: 400;margin: 0;}
|
|
21469
|
+
h6{font-size: 00.65em;font-weight: 400;margin: 0;}
|
|
21470
|
+
blockquote{margin: 10px 0;margin-left: 0;padding-left: 5px;border-left: solid 2px #5c5c5c;}
|
|
21471
|
+
pre{background-color: inherit;border: 0;border-radius: 0;color: #333;
|
|
21472
|
+
font-size: inherit;line-height: inherit;margin: 0 0 10px;overflow: visible;padding: 0;
|
|
21473
|
+
white-space: pre-wrap;word-break: inherit;word-wrap: break-word;}
|
|
21474
|
+
strong, b{font-weight: 700;}
|
|
21475
|
+
a{text-decoration: none;user-select: auto;}
|
|
21476
|
+
a:hover{text-decoration: underline;};
|
|
21477
|
+
p:last-child, pre:last-child, blockquote:last-child{margin-bottom: 0;}
|
|
21478
|
+
h3+h4, h4+h5, h5+h6{margin-top: 00.6em;}
|
|
21479
|
+
ul:last-child{margin-bottom: 0;}
|
|
21480
|
+
table { border-collapse: collapse; empty-cells: show;}
|
|
21481
|
+
table td,table th {border: 1px solid #BDBDBD; height: 20px; padding: 2px 5px; vertical-align: middle;}
|
|
21482
|
+
table.e-alternate-border tbody tr:nth-child(2n) {background-color: #F5F5F5;}
|
|
21483
|
+
table th {background-color: #E0E0E0;}
|
|
21484
|
+
table.e-dashed-border td,table.e-dashed-border th { border: 1px dashed #BDBDBD}
|
|
21485
|
+
table .e-cell-select {border: 1px double #4a90e2;}
|
|
21486
|
+
span.e-table-box { cursor: nwse-resize; display: block; height: 10px; position: absolute; width: 10px; }
|
|
21487
|
+
span.e-table-box.e-rmob {height: 14px;width: 14px;}
|
|
21488
|
+
.e-row-resize, .e-column-resize { background-color: transparent; background-repeat: repeat;
|
|
21489
|
+
bottom: 0;cursor: col-resize;height: 1px;overflow: visible;position: absolute;width: 1px; }
|
|
21490
|
+
.e-row-resize { cursor: row-resize; height: 1px;}
|
|
21491
|
+
.e-table-rhelper { cursor: col-resize; opacity: .87;position: absolute;}
|
|
21492
|
+
.e-table-rhelper.e-column-helper { width: 1px; }
|
|
21493
|
+
.e-table-rhelper.e-row-helper {height: 1px;}
|
|
21494
|
+
.e-reicon::before { border-bottom: 6px solid transparent; border-right: 6px solid;
|
|
21495
|
+
border-top: 6px solid transparent; content: ''; display: block; height: 0;
|
|
21496
|
+
position: absolute; right: 4px; top: 4px; width: 20px; }
|
|
21497
|
+
.e-reicon::after { border-bottom: 6px solid transparent; border-left: 6px solid;
|
|
21498
|
+
border-top: 6px solid transparent; content: ''; display: block;
|
|
21499
|
+
height: 0; left: 4px; position: absolute; top: 4px; width: 20px; z-index: 3; }
|
|
21500
|
+
.e-row-helper.e-reicon::after { top: 10px; transform: rotate(90deg); }
|
|
21501
|
+
.e-row-helper.e-reicon::before { left: 4px; top: -20px; transform: rotate(90deg); }
|
|
21502
|
+
span.e-table-box { background-color: #ffffff; border: 1px solid #BDBDBD; }
|
|
21503
|
+
span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }
|
|
21504
|
+
.e-table-rhelper { background-color: #4a90e2;}
|
|
21505
|
+
.e-rtl { direction: rtl; }
|
|
21506
|
+
.e-rte-placeholder::before { content: attr(placeholder); opacity: 0.54; overflow: hidden; padding-top: 16px; position: absolute; text-align: start; top: 0; z-index: 1; }
|
|
21507
|
+
li ol, li ul { margin-block-start: 10px;}
|
|
21508
|
+
</style>
|
|
21363
21509
|
</head>`;
|
|
21364
21510
|
/**
|
|
21365
21511
|
* Content module is used to render Rich Text Editor content
|
|
@@ -21867,25 +22013,54 @@ class HtmlEditor {
|
|
|
21867
22013
|
this.deleteCleanup(e, currentRange);
|
|
21868
22014
|
}
|
|
21869
22015
|
if (args.keyCode === 9 && this.parent.enableTabKey) {
|
|
22016
|
+
this.parent.formatter.saveData(e);
|
|
21870
22017
|
if (!isNullOrUndefined(args.target) && isNullOrUndefined(closest(args.target, '.e-rte-toolbar'))) {
|
|
21871
22018
|
const range = this.nodeSelectionObj.getRange(this.contentRenderer.getDocument());
|
|
21872
22019
|
const parentNode = this.nodeSelectionObj.getParentNodeCollection(range);
|
|
21873
22020
|
if (!((parentNode[0].nodeName === 'LI' || closest(parentNode[0], 'li') ||
|
|
21874
|
-
closest(parentNode[0], 'table'))
|
|
22021
|
+
closest(parentNode[0], 'table')))) {
|
|
21875
22022
|
args.preventDefault();
|
|
21876
|
-
|
|
21877
|
-
|
|
21878
|
-
|
|
22023
|
+
const selection = this.contentRenderer.getDocument().getSelection().getRangeAt(0);
|
|
22024
|
+
let alignmentNodes = this.parent.formatter.editorManager.domNode.blockNodes();
|
|
22025
|
+
if (this.parent.enterKey === 'BR') {
|
|
22026
|
+
if (selection.startOffset !== selection.endOffset && selection.startOffset === 0) {
|
|
22027
|
+
let save = this.nodeSelectionObj.save(range, this.contentRenderer.getDocument());
|
|
22028
|
+
this.parent.formatter.editorManager.domNode.setMarker(save);
|
|
22029
|
+
alignmentNodes = this.parent.formatter.editorManager.domNode.blockNodes();
|
|
22030
|
+
this.parent.formatter.editorManager.domNode.convertToBlockNodes(alignmentNodes, false);
|
|
22031
|
+
this.marginTabAdd(args.shiftKey, alignmentNodes);
|
|
22032
|
+
save = this.parent.formatter.editorManager.domNode.saveMarker(save);
|
|
22033
|
+
save.restore();
|
|
22034
|
+
}
|
|
22035
|
+
else {
|
|
22036
|
+
InsertHtml.Insert(this.contentRenderer.getDocument(), ' ');
|
|
22037
|
+
this.rangeCollection.push(this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()));
|
|
22038
|
+
}
|
|
21879
22039
|
}
|
|
21880
|
-
else
|
|
21881
|
-
|
|
21882
|
-
|
|
21883
|
-
|
|
21884
|
-
|
|
21885
|
-
|
|
22040
|
+
else {
|
|
22041
|
+
if (!args.shiftKey) {
|
|
22042
|
+
if (selection.startOffset !== selection.endOffset && selection.startOffset === 0) {
|
|
22043
|
+
this.marginTabAdd(args.shiftKey, alignmentNodes);
|
|
22044
|
+
}
|
|
22045
|
+
else {
|
|
22046
|
+
InsertHtml.Insert(this.contentRenderer.getDocument(), ' ');
|
|
22047
|
+
this.rangeCollection.push(this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()));
|
|
22048
|
+
}
|
|
22049
|
+
}
|
|
22050
|
+
else if (this.rangeCollection.length > 0 &&
|
|
22051
|
+
this.rangeCollection[this.rangeCollection.length - 1].startContainer.textContent.length === 4) {
|
|
22052
|
+
const textCont = this.rangeCollection[this.rangeCollection.length - 1].startContainer;
|
|
22053
|
+
this.nodeSelectionObj.setSelectionText(this.contentRenderer.getDocument(), textCont, textCont, 0, textCont.textContent.length);
|
|
22054
|
+
InsertHtml.Insert(this.contentRenderer.getDocument(), document.createTextNode(''));
|
|
22055
|
+
this.rangeCollection.pop();
|
|
22056
|
+
}
|
|
22057
|
+
else {
|
|
22058
|
+
this.marginTabAdd(args.shiftKey, alignmentNodes);
|
|
22059
|
+
}
|
|
21886
22060
|
}
|
|
21887
22061
|
}
|
|
21888
22062
|
}
|
|
22063
|
+
this.parent.formatter.saveData(e);
|
|
21889
22064
|
}
|
|
21890
22065
|
if (e.args.action === 'space' ||
|
|
21891
22066
|
e.args.action === 'enter' ||
|
|
@@ -21902,15 +22077,7 @@ class HtmlEditor {
|
|
|
21902
22077
|
}
|
|
21903
22078
|
else {
|
|
21904
22079
|
this.parent.notify(enterHandler, { args: e.args });
|
|
21905
|
-
|
|
21906
|
-
if (!isNullOrUndefined(newRange.startContainer) && this.parent.height !== 'auto' && newRange.startContainer.nodeName !== '#text'
|
|
21907
|
-
&& !this.parent.iframeSettings.enable && newRange.startContainer.getBoundingClientRect().bottom > this.parent.element.getBoundingClientRect().bottom) {
|
|
21908
|
-
this.parent.element.querySelector('.e-rte-content').scrollTop += newRange.startContainer.getBoundingClientRect().bottom - this.parent.element.getBoundingClientRect().bottom;
|
|
21909
|
-
}
|
|
21910
|
-
else if (!isNullOrUndefined(newRange.startContainer) && this.parent.height === 'auto' && newRange.startContainer.nodeName !== '#text'
|
|
21911
|
-
&& !this.parent.iframeSettings.enable && window.innerHeight < newRange.startContainer.getBoundingClientRect().top) {
|
|
21912
|
-
newRange.startContainer.scrollIntoView({ block: 'end', inline: 'nearest' });
|
|
21913
|
-
}
|
|
22080
|
+
scrollToCursor(this.parent.contentModule.getDocument(), this.parent.inputElement);
|
|
21914
22081
|
}
|
|
21915
22082
|
}
|
|
21916
22083
|
}
|
|
@@ -22555,6 +22722,30 @@ class HtmlEditor {
|
|
|
22555
22722
|
getSelectedHtml(e) {
|
|
22556
22723
|
e.callBack(this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()).toString());
|
|
22557
22724
|
}
|
|
22725
|
+
marginTabAdd(val, alignmentNodes) {
|
|
22726
|
+
for (let index = 0; index < alignmentNodes.length; index++) {
|
|
22727
|
+
const element = alignmentNodes[index];
|
|
22728
|
+
if (element.closest('li')) {
|
|
22729
|
+
continue;
|
|
22730
|
+
}
|
|
22731
|
+
if (element.style.marginLeft) {
|
|
22732
|
+
let count$$1 = parseInt(element.style.marginLeft, 10);
|
|
22733
|
+
if (val) {
|
|
22734
|
+
count$$1 -= 20;
|
|
22735
|
+
}
|
|
22736
|
+
else {
|
|
22737
|
+
count$$1 += 20;
|
|
22738
|
+
}
|
|
22739
|
+
element.style.marginLeft = count$$1.toString() + 'px';
|
|
22740
|
+
if (element.style.marginLeft === '0px') {
|
|
22741
|
+
element.removeAttribute('style');
|
|
22742
|
+
}
|
|
22743
|
+
}
|
|
22744
|
+
else if (!val) {
|
|
22745
|
+
element.style.marginLeft = '20px';
|
|
22746
|
+
}
|
|
22747
|
+
}
|
|
22748
|
+
}
|
|
22558
22749
|
}
|
|
22559
22750
|
|
|
22560
22751
|
/**
|
|
@@ -22942,7 +23133,9 @@ class PasteCleanup {
|
|
|
22942
23133
|
popupObj.close();
|
|
22943
23134
|
}
|
|
22944
23135
|
this.parent.trigger(imageUploadFailed, e);
|
|
22945
|
-
uploadObj.
|
|
23136
|
+
if (uploadObj && document.body.contains(uploadObj.element)) {
|
|
23137
|
+
uploadObj.destroy();
|
|
23138
|
+
}
|
|
22946
23139
|
}
|
|
22947
23140
|
popupClose(popupObj, uploadObj, imgElem, e) {
|
|
22948
23141
|
this.parent.inputElement.contentEditable = 'true';
|
|
@@ -22957,7 +23150,7 @@ class PasteCleanup {
|
|
|
22957
23150
|
});
|
|
22958
23151
|
popupObj.close();
|
|
22959
23152
|
imgElem.style.opacity = '1';
|
|
22960
|
-
if (
|
|
23153
|
+
if (uploadObj && document.body.contains(uploadObj.element)) {
|
|
22961
23154
|
uploadObj.destroy();
|
|
22962
23155
|
}
|
|
22963
23156
|
this.toolbarEnableDisable(false);
|
|
@@ -23206,7 +23399,8 @@ class PasteCleanup {
|
|
|
23206
23399
|
clipBoardElem = this.allowedStyle(clipBoardElem);
|
|
23207
23400
|
}
|
|
23208
23401
|
this.saveSelection.restore();
|
|
23209
|
-
|
|
23402
|
+
const newText = clipBoardElem.innerHTML.split("&").join("&");
|
|
23403
|
+
clipBoardElem.innerHTML = this.sanitizeHelper(newText);
|
|
23210
23404
|
const allImg = clipBoardElem.querySelectorAll('img');
|
|
23211
23405
|
for (let i = 0; i < allImg.length; i++) {
|
|
23212
23406
|
if (!isNullOrUndefined(allImg[i].getAttribute('src'))) {
|
|
@@ -23255,11 +23449,34 @@ class PasteCleanup {
|
|
|
23255
23449
|
extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
|
|
23256
23450
|
this.parent.formatter.onSuccess(this.parent, args);
|
|
23257
23451
|
}, clipBoardElem, null, null, this.parent.enterKey);
|
|
23452
|
+
scrollToCursor(this.parent.contentModule.getDocument(), this.parent.inputElement);
|
|
23258
23453
|
this.removeTempClass();
|
|
23259
23454
|
this.parent.notify(toolbarRefresh, {});
|
|
23260
23455
|
this.cropImageHandler(this.parent.inputElement);
|
|
23261
23456
|
}
|
|
23262
23457
|
}
|
|
23458
|
+
convertBlobToBase64(element) {
|
|
23459
|
+
const imgElem = element.querySelectorAll('img');
|
|
23460
|
+
for (let i = 0; i < imgElem.length; i++) {
|
|
23461
|
+
if (imgElem[i].getAttribute('src') &&
|
|
23462
|
+
imgElem[i].getAttribute('src').startsWith("blob")) {
|
|
23463
|
+
let blobImageUrl = imgElem[i].getAttribute('src');
|
|
23464
|
+
let img = new Image();
|
|
23465
|
+
const onImageLoadEvent = () => {
|
|
23466
|
+
let canvas = document.createElement('canvas');
|
|
23467
|
+
let ctx = canvas.getContext('2d');
|
|
23468
|
+
canvas.width = img.width;
|
|
23469
|
+
canvas.height = img.height;
|
|
23470
|
+
ctx.drawImage(img, 0, 0);
|
|
23471
|
+
let base64String = canvas.toDataURL('image/png');
|
|
23472
|
+
imgElem[i].src = base64String;
|
|
23473
|
+
img.removeEventListener('load', onImageLoadEvent);
|
|
23474
|
+
};
|
|
23475
|
+
img.src = blobImageUrl;
|
|
23476
|
+
img.addEventListener('load', onImageLoadEvent);
|
|
23477
|
+
}
|
|
23478
|
+
}
|
|
23479
|
+
}
|
|
23263
23480
|
cropImageHandler(element) {
|
|
23264
23481
|
const allImgElm = element.querySelectorAll('.e-img-cropped');
|
|
23265
23482
|
if (allImgElm.length > 0) {
|
|
@@ -23298,22 +23515,33 @@ class PasteCleanup {
|
|
|
23298
23515
|
}
|
|
23299
23516
|
}
|
|
23300
23517
|
else {
|
|
23301
|
-
this.
|
|
23302
|
-
|
|
23303
|
-
|
|
23518
|
+
if (!isNullOrUndefined(this.parent.insertImageSettings.saveUrl) && !isNullOrUndefined(this.parent.insertImageSettings.path) && !isNullOrUndefined(this.parent.inputElement.querySelectorAll("img")) && this.parent.inputElement.querySelectorAll("img")[0].src.startsWith("blob")) {
|
|
23519
|
+
this.convertBlobToBase64(this.parent.inputElement);
|
|
23520
|
+
setTimeout(() => {
|
|
23521
|
+
this.imgUploading(this.parent.inputElement);
|
|
23522
|
+
if (this.parent.iframeSettings.enable) {
|
|
23523
|
+
this.parent.updateValue();
|
|
23524
|
+
}
|
|
23525
|
+
}, 20);
|
|
23526
|
+
}
|
|
23527
|
+
else {
|
|
23528
|
+
this.imgUploading(this.parent.inputElement);
|
|
23529
|
+
if (this.parent.iframeSettings.enable) {
|
|
23530
|
+
this.parent.updateValue();
|
|
23531
|
+
}
|
|
23304
23532
|
}
|
|
23305
23533
|
}
|
|
23306
23534
|
}
|
|
23307
23535
|
addTableClass(element, source) {
|
|
23308
|
-
source = isNullOrUndefined(source) ? '' : source;
|
|
23309
23536
|
const tableElement = element.querySelectorAll('table');
|
|
23310
23537
|
for (let i = 0; i < tableElement.length; i++) {
|
|
23311
|
-
|
|
23312
|
-
|
|
23313
|
-
}
|
|
23314
|
-
else if (source && source !== 'html') {
|
|
23538
|
+
const isMSTeamsTable = tableElement[i].parentElement.nodeName === 'FIGURE';
|
|
23539
|
+
if (this.parent.pasteCleanupSettings.keepFormat && source && !isMSTeamsTable) {
|
|
23315
23540
|
tableElement[i].classList.add('e-rte-paste-' + source + '-table');
|
|
23316
23541
|
}
|
|
23542
|
+
else if (!tableElement[i].classList.contains('e-rte-table')) {
|
|
23543
|
+
tableElement[i].classList.add('e-rte-table');
|
|
23544
|
+
}
|
|
23317
23545
|
}
|
|
23318
23546
|
return element;
|
|
23319
23547
|
}
|
|
@@ -24080,9 +24308,6 @@ class FullScreen {
|
|
|
24080
24308
|
&& !isNullOrUndefined(this.parent.quickToolbarModule)) {
|
|
24081
24309
|
this.parent.quickToolbarModule.hideQuickToolbars();
|
|
24082
24310
|
}
|
|
24083
|
-
if (this.parent.showTooltip && !isNullOrUndefined(document.querySelector('.e-tooltip-wrap'))) {
|
|
24084
|
-
this.parent.notify(destroyTooltip, { args: event });
|
|
24085
|
-
}
|
|
24086
24311
|
this.scrollableParent = getScrollableParent(this.parent.element);
|
|
24087
24312
|
if (!this.parent.element.classList.contains(CLS_FULL_SCREEN)) {
|
|
24088
24313
|
const evenArgs = {
|
|
@@ -24134,9 +24359,6 @@ class FullScreen {
|
|
|
24134
24359
|
&& !isNullOrUndefined(this.parent.quickToolbarModule)) {
|
|
24135
24360
|
this.parent.quickToolbarModule.hideQuickToolbars();
|
|
24136
24361
|
}
|
|
24137
|
-
if (this.parent.showTooltip && !isNullOrUndefined(document.querySelector('.e-tooltip-wrap'))) {
|
|
24138
|
-
this.parent.notify(destroyTooltip, { args: event });
|
|
24139
|
-
}
|
|
24140
24362
|
if (this.parent.element.classList.contains(CLS_FULL_SCREEN)) {
|
|
24141
24363
|
const evenArgs = {
|
|
24142
24364
|
cancel: false,
|
|
@@ -26537,13 +26759,13 @@ class Image$1 {
|
|
|
26537
26759
|
selectParentEle = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
26538
26760
|
if (!originalEvent.ctrlKey && originalEvent.key && (originalEvent.key.length === 1 || originalEvent.action === 'enter') &&
|
|
26539
26761
|
(!isNullOrUndefined(selectParentEle[0]) && selectParentEle[0].tagName === 'IMG') && selectParentEle[0].parentElement) {
|
|
26540
|
-
const prev = selectParentEle[0].parentElement.childNodes[0];
|
|
26541
26762
|
if (this.contentModule.getEditPanel().querySelector('.e-img-resize')) {
|
|
26542
26763
|
this.removeResizeEle();
|
|
26543
26764
|
}
|
|
26544
|
-
this.parent.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), prev, prev, prev.textContent.length, prev.textContent.length);
|
|
26545
26765
|
removeClass([selectParentEle[0]], 'e-img-focus');
|
|
26546
|
-
this.quickToolObj.imageQTBar
|
|
26766
|
+
if (this.quickToolObj && this.quickToolObj.imageQTBar) {
|
|
26767
|
+
this.quickToolObj.imageQTBar.hidePopup();
|
|
26768
|
+
}
|
|
26547
26769
|
}
|
|
26548
26770
|
}
|
|
26549
26771
|
if (originalEvent.ctrlKey && (originalEvent.keyCode === 89 || originalEvent.keyCode === 90)) {
|
|
@@ -27304,7 +27526,12 @@ class Image$1 {
|
|
|
27304
27526
|
animationSettings: { effect: 'None' },
|
|
27305
27527
|
close: (event) => {
|
|
27306
27528
|
if (this.isImgUploaded) {
|
|
27307
|
-
this.
|
|
27529
|
+
if (this.dialogObj.element.querySelector('.e-file-abort-btn')) {
|
|
27530
|
+
this.dialogObj.element.querySelector('.e-file-abort-btn').click();
|
|
27531
|
+
}
|
|
27532
|
+
else {
|
|
27533
|
+
this.uploadObj.remove();
|
|
27534
|
+
}
|
|
27308
27535
|
}
|
|
27309
27536
|
this.parent.isBlur = false;
|
|
27310
27537
|
if (event && !isNullOrUndefined(event.event) && event.event.returnValue) {
|
|
@@ -28811,7 +29038,12 @@ class Audio {
|
|
|
28811
29038
|
animationSettings: { effect: 'None' },
|
|
28812
29039
|
close: (event) => {
|
|
28813
29040
|
if (this.isAudioUploaded) {
|
|
28814
|
-
this.
|
|
29041
|
+
if (this.dialogObj.element.querySelector('.e-file-abort-btn')) {
|
|
29042
|
+
this.dialogObj.element.querySelector('.e-file-abort-btn').click();
|
|
29043
|
+
}
|
|
29044
|
+
else {
|
|
29045
|
+
this.uploadObj.remove();
|
|
29046
|
+
}
|
|
28815
29047
|
}
|
|
28816
29048
|
this.parent.isBlur = false;
|
|
28817
29049
|
if (event && !isNullOrUndefined(event.event) && event.event.returnValue) {
|
|
@@ -30162,7 +30394,12 @@ class Video {
|
|
|
30162
30394
|
animationSettings: { effect: 'None' },
|
|
30163
30395
|
close: (event) => {
|
|
30164
30396
|
if (this.isVideoUploaded) {
|
|
30165
|
-
this.
|
|
30397
|
+
if (this.dialogObj.element.querySelector('.e-file-abort-btn')) {
|
|
30398
|
+
this.dialogObj.element.querySelector('.e-file-abort-btn').click();
|
|
30399
|
+
}
|
|
30400
|
+
else {
|
|
30401
|
+
this.uploadObj.remove();
|
|
30402
|
+
}
|
|
30166
30403
|
}
|
|
30167
30404
|
this.parent.isBlur = false;
|
|
30168
30405
|
if (event && !isNullOrUndefined(event.event) && event.event.returnValue) {
|
|
@@ -32389,7 +32626,8 @@ class Table {
|
|
|
32389
32626
|
const argument = ((Browser.isDevice || (!isNullOrUndefined(args.args)
|
|
32390
32627
|
&& !isNullOrUndefined(args.args.originalEvent) &&
|
|
32391
32628
|
args.args.originalEvent.action === 'insert-table')
|
|
32392
|
-
|| proxy.parent.inlineMode.enable || !isNullOrUndefined(proxy.parent.quickToolbarSettings.text))
|
|
32629
|
+
|| proxy.parent.inlineMode.enable || ((!isNullOrUndefined(proxy.parent.quickToolbarSettings.text)) &&
|
|
32630
|
+
!(args instanceof PointerEvent))) ? args :
|
|
32393
32631
|
this);
|
|
32394
32632
|
proxy.tableInsert(proxy.rowTextBox.value, proxy.columnTextBox.value, e, argument);
|
|
32395
32633
|
}
|
|
@@ -32838,12 +33076,12 @@ const executeGroup = {
|
|
|
32838
33076
|
}
|
|
32839
33077
|
};
|
|
32840
33078
|
|
|
32841
|
-
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
32842
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
32843
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
32844
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
32845
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
32846
|
-
};
|
|
33079
|
+
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
33080
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
33081
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
33082
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
33083
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
33084
|
+
};
|
|
32847
33085
|
/**
|
|
32848
33086
|
* Configures the toolbar settings of the RichTextEditor.
|
|
32849
33087
|
*/
|
|
@@ -33233,12 +33471,12 @@ __decorate$2([
|
|
|
33233
33471
|
Property(bulletFormatList)
|
|
33234
33472
|
], BulletFormatList.prototype, "types", void 0);
|
|
33235
33473
|
|
|
33236
|
-
var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
33237
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
33238
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
33239
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
33240
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
33241
|
-
};
|
|
33474
|
+
var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
33475
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
33476
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
33477
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
33478
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
33479
|
+
};
|
|
33242
33480
|
/**
|
|
33243
33481
|
* Objects used for configuring the iframe resources properties.
|
|
33244
33482
|
*/
|
|
@@ -33265,12 +33503,12 @@ __decorate$3([
|
|
|
33265
33503
|
Complex({}, Resources)
|
|
33266
33504
|
], IFrameSettings.prototype, "resources", void 0);
|
|
33267
33505
|
|
|
33268
|
-
var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
33269
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
33270
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
33271
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
33272
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
33273
|
-
};
|
|
33506
|
+
var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
33507
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
33508
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
33509
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
33510
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
33511
|
+
};
|
|
33274
33512
|
/**
|
|
33275
33513
|
* Configures the inlineMode property of the RTE.
|
|
33276
33514
|
*/
|
|
@@ -33321,16 +33559,18 @@ class EnterKeyAction {
|
|
|
33321
33559
|
this.getRangeNode();
|
|
33322
33560
|
let isTableEnter = true;
|
|
33323
33561
|
this.formatTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote'];
|
|
33324
|
-
const
|
|
33325
|
-
|
|
33326
|
-
|
|
33327
|
-
|
|
33328
|
-
|
|
33329
|
-
|
|
33330
|
-
|
|
33331
|
-
if (
|
|
33332
|
-
this.
|
|
33333
|
-
|
|
33562
|
+
const tableImagCursor = this.processedTableImageCursor();
|
|
33563
|
+
if (tableImagCursor.start || tableImagCursor.end) {
|
|
33564
|
+
if (tableImagCursor.startName === 'TABLE' || tableImagCursor.endName === 'TABLE') { // Default browser action prevented and hanled manually.
|
|
33565
|
+
this.handleCursorAtTableSide(e, tableImagCursor.start, tableImagCursor.end);
|
|
33566
|
+
return;
|
|
33567
|
+
}
|
|
33568
|
+
}
|
|
33569
|
+
if (tableImagCursor.start || tableImagCursor.end || this.range.startContainer.nodeName === 'IMG') {
|
|
33570
|
+
if (this.parent.enterKey === 'BR' && (tableImagCursor.startName === 'IMG' || tableImagCursor.endName === 'IMG' || this.range.startContainer.nodeName === 'IMG')) { // Default browser action prevented and hanled manually.
|
|
33571
|
+
this.handleEnterKeyAtImageSide(e, tableImagCursor.start, tableImagCursor.end);
|
|
33572
|
+
return;
|
|
33573
|
+
}
|
|
33334
33574
|
}
|
|
33335
33575
|
if (!isNullOrUndefined(this.startNode.closest('TABLE')) && !isNullOrUndefined(this.endNode.closest('TABLE'))) {
|
|
33336
33576
|
isTableEnter = false;
|
|
@@ -33698,7 +33938,6 @@ class EnterKeyAction {
|
|
|
33698
33938
|
const outerBRElem = this.parent.createElement('br');
|
|
33699
33939
|
if (this.range.startOffset === 0 && this.range.endOffset === 0 &&
|
|
33700
33940
|
!isNullOrUndefined(currentParent.previousSibling) && currentParent.previousSibling.nodeName === 'BR' && currentParent.nodeName !== 'P' && currentParent.nodeName !== 'DIV') {
|
|
33701
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
33702
33941
|
newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, currentParent, false).cloneNode(true);
|
|
33703
33942
|
this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
|
|
33704
33943
|
this.insertFocusContent();
|
|
@@ -33728,7 +33967,7 @@ class EnterKeyAction {
|
|
|
33728
33967
|
}
|
|
33729
33968
|
e.args.preventDefault();
|
|
33730
33969
|
}
|
|
33731
|
-
this.
|
|
33970
|
+
this.triggerActionComplete(e, shiftKey);
|
|
33732
33971
|
}
|
|
33733
33972
|
});
|
|
33734
33973
|
}
|
|
@@ -33798,6 +34037,9 @@ class EnterKeyAction {
|
|
|
33798
34037
|
}
|
|
33799
34038
|
return insertElem;
|
|
33800
34039
|
}
|
|
34040
|
+
triggerActionComplete(e, shiftKey) {
|
|
34041
|
+
this.parent.trigger(actionComplete, { requestType: shiftKey ? 'ShiftEnterAction' : 'EnterAction', args: e.args });
|
|
34042
|
+
}
|
|
33801
34043
|
handleCursorAtTableSide(e, isStart, isEnd) {
|
|
33802
34044
|
if (this.parent.enterKey !== 'BR') {
|
|
33803
34045
|
const shiftKey = e.args.shiftKey;
|
|
@@ -33827,19 +34069,99 @@ class EnterKeyAction {
|
|
|
33827
34069
|
}
|
|
33828
34070
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), newElement, 0);
|
|
33829
34071
|
e.args.preventDefault();
|
|
33830
|
-
this.
|
|
34072
|
+
this.triggerActionComplete(e, shiftKey);
|
|
33831
34073
|
}
|
|
33832
34074
|
});
|
|
33833
34075
|
}
|
|
33834
34076
|
}
|
|
34077
|
+
handleEnterKeyAtImageSide(e, isStart, isEnd) {
|
|
34078
|
+
const actionBeginArgs = {
|
|
34079
|
+
cancel: false,
|
|
34080
|
+
name: actionBegin,
|
|
34081
|
+
requestType: e.args.shiftKey ? 'ShiftEnterAction' : 'EnterAction',
|
|
34082
|
+
originalEvent: e.args
|
|
34083
|
+
};
|
|
34084
|
+
let directRange = false;
|
|
34085
|
+
if (this.range.startContainer.nodeName === 'IMG' && this.range.startOffset === 0) {
|
|
34086
|
+
directRange = true;
|
|
34087
|
+
}
|
|
34088
|
+
this.parent.trigger(actionBegin, actionBeginArgs, (actionBeginArgs) => {
|
|
34089
|
+
if (!actionBeginArgs.cancel) {
|
|
34090
|
+
if (this.parent.enterKey === 'BR') {
|
|
34091
|
+
const newElement = this.parent.createElement('BR');
|
|
34092
|
+
let imageElement;
|
|
34093
|
+
if (directRange) {
|
|
34094
|
+
imageElement = this.range.startContainer;
|
|
34095
|
+
imageElement.parentElement.insertBefore(newElement, imageElement);
|
|
34096
|
+
this.parent.formatter.editorManager.nodeSelection.
|
|
34097
|
+
setCursorPoint(this.parent.contentModule.getDocument(), imageElement, 0);
|
|
34098
|
+
}
|
|
34099
|
+
if (isStart) {
|
|
34100
|
+
imageElement = this.range.startContainer.childNodes[this.range.startOffset];
|
|
34101
|
+
imageElement.parentElement.insertBefore(newElement, imageElement);
|
|
34102
|
+
this.parent.formatter.editorManager.nodeSelection.
|
|
34103
|
+
setCursorPoint(this.parent.contentModule.getDocument(), imageElement, 0);
|
|
34104
|
+
}
|
|
34105
|
+
if (isEnd) {
|
|
34106
|
+
imageElement = this.range.startContainer.childNodes[this.range.startOffset - 1];
|
|
34107
|
+
if (!isNullOrUndefined(imageElement.nextSibling)) {
|
|
34108
|
+
imageElement.parentElement.insertBefore(newElement, imageElement.nextSibling);
|
|
34109
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), newElement.nextSibling, 0);
|
|
34110
|
+
}
|
|
34111
|
+
else if (isNullOrUndefined(imageElement.nextSibling)) {
|
|
34112
|
+
imageElement.parentElement.appendChild(newElement);
|
|
34113
|
+
const brElement = this.parent.createElement('BR');
|
|
34114
|
+
imageElement.parentElement.appendChild(brElement);
|
|
34115
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), brElement, 0);
|
|
34116
|
+
}
|
|
34117
|
+
}
|
|
34118
|
+
e.args.preventDefault();
|
|
34119
|
+
this.triggerActionComplete(e, e.args.shiftKey);
|
|
34120
|
+
}
|
|
34121
|
+
}
|
|
34122
|
+
});
|
|
34123
|
+
}
|
|
34124
|
+
isTableOrImageStart() {
|
|
34125
|
+
const customHandlerElements = ['IMG', 'TABLE'];
|
|
34126
|
+
const startContainer = this.range.startContainer;
|
|
34127
|
+
const startOffset = this.range.startOffset;
|
|
34128
|
+
const isCursorAtStart = this.range.collapsed && (startContainer.nodeType === 1) &&
|
|
34129
|
+
startContainer.isContentEditable && startContainer.childNodes[startOffset] &&
|
|
34130
|
+
(customHandlerElements.indexOf(startContainer.childNodes[startOffset].nodeName) > -1);
|
|
34131
|
+
if (isCursorAtStart) {
|
|
34132
|
+
return { start: isCursorAtStart, startNodeName: startContainer.childNodes[startOffset].nodeName };
|
|
34133
|
+
}
|
|
34134
|
+
else {
|
|
34135
|
+
return { start: false, startNodeName: '' };
|
|
34136
|
+
}
|
|
34137
|
+
}
|
|
34138
|
+
isTableOrImageEnd() {
|
|
34139
|
+
const customHandlerElements = ['IMG', 'TABLE'];
|
|
34140
|
+
const startContainer = this.range.startContainer;
|
|
34141
|
+
const startOffset = this.range.startOffset;
|
|
34142
|
+
const isCursorAtEnd = this.range.collapsed && (startContainer.nodeType === 1) &&
|
|
34143
|
+
startContainer.isContentEditable && startContainer.childNodes[startOffset - 1] &&
|
|
34144
|
+
(customHandlerElements.indexOf(startContainer.childNodes[startOffset - 1].nodeName) > -1);
|
|
34145
|
+
if (isCursorAtEnd) {
|
|
34146
|
+
return { end: isCursorAtEnd, endNodeName: startContainer.childNodes[startOffset - 1].nodeName };
|
|
34147
|
+
}
|
|
34148
|
+
else {
|
|
34149
|
+
return { end: false, endNodeName: '' };
|
|
34150
|
+
}
|
|
34151
|
+
}
|
|
34152
|
+
processedTableImageCursor() {
|
|
34153
|
+
const { start, startNodeName } = this.isTableOrImageStart();
|
|
34154
|
+
const { end, endNodeName } = this.isTableOrImageEnd();
|
|
34155
|
+
return { start, startName: startNodeName, end, endName: endNodeName };
|
|
34156
|
+
}
|
|
33835
34157
|
}
|
|
33836
34158
|
|
|
33837
|
-
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
33838
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
33839
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
33840
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
33841
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
33842
|
-
};
|
|
34159
|
+
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
34160
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
34161
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
34162
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
34163
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
34164
|
+
};
|
|
33843
34165
|
/**
|
|
33844
34166
|
* Represents the Rich Text Editor component.
|
|
33845
34167
|
* ```html
|
|
@@ -33977,6 +34299,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
33977
34299
|
this.persistData();
|
|
33978
34300
|
setStyleAttribute(this.element, { 'width': formatUnit(this.width) });
|
|
33979
34301
|
attributes(this.element, { role: 'application', 'aria-label': 'Rich Text Editor' });
|
|
34302
|
+
this.beforeRenderClassValue = this.element.getAttribute('class');
|
|
33980
34303
|
}
|
|
33981
34304
|
persistData() {
|
|
33982
34305
|
if (this.enablePersistence && this.originalElement.tagName === 'TEXTAREA') {
|
|
@@ -34847,6 +35170,10 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
34847
35170
|
if (this.isDestroyed || !this.isRendered) {
|
|
34848
35171
|
return;
|
|
34849
35172
|
}
|
|
35173
|
+
this.element.className = this.beforeRenderClassValue;
|
|
35174
|
+
this.removeHtmlAttributes();
|
|
35175
|
+
this.removeAttributes();
|
|
35176
|
+
this.beforeRenderClassValue = null;
|
|
34850
35177
|
if (!isNullOrUndefined(this.timeInterval)) {
|
|
34851
35178
|
clearInterval(this.timeInterval);
|
|
34852
35179
|
this.timeInterval = null;
|
|
@@ -34914,8 +35241,6 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
34914
35241
|
}
|
|
34915
35242
|
}
|
|
34916
35243
|
}
|
|
34917
|
-
this.removeHtmlAttributes();
|
|
34918
|
-
this.removeAttributes();
|
|
34919
35244
|
super.destroy();
|
|
34920
35245
|
this.isRendered = false;
|
|
34921
35246
|
}
|
|
@@ -34946,6 +35271,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
34946
35271
|
this.element.removeAttribute('aria-disabled');
|
|
34947
35272
|
this.element.removeAttribute('role');
|
|
34948
35273
|
this.element.removeAttribute('tabindex');
|
|
35274
|
+
this.element.removeAttribute('aria-label');
|
|
34949
35275
|
}
|
|
34950
35276
|
destroyDependentModules() {
|
|
34951
35277
|
/* destroy dependent modules */
|
|
@@ -35199,7 +35525,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
35199
35525
|
}
|
|
35200
35526
|
}
|
|
35201
35527
|
updatePanelValue() {
|
|
35202
|
-
let value = this.value;
|
|
35528
|
+
let value = this.listOrderCorrection(this.value);
|
|
35203
35529
|
value = (this.enableHtmlEncode && this.value) ? decode(value) : value;
|
|
35204
35530
|
const getTextArea = this.element.querySelector('.' + CLS_RTE_SOURCE_CODE_TXTAREA);
|
|
35205
35531
|
if (value) {
|
|
@@ -35243,6 +35569,17 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
35243
35569
|
this.countModule.refresh();
|
|
35244
35570
|
}
|
|
35245
35571
|
}
|
|
35572
|
+
listOrderCorrection(value) {
|
|
35573
|
+
const valueElementWrapper = this.createElement('div');
|
|
35574
|
+
valueElementWrapper.innerHTML = value;
|
|
35575
|
+
const listElements = valueElementWrapper.querySelectorAll('UL, OL');
|
|
35576
|
+
for (let i = 0; i < listElements.length; i++) {
|
|
35577
|
+
if (!isNullOrUndefined(listElements[i]) && !isNullOrUndefined(listElements[i].parentElement) && !isNullOrUndefined(listElements[i].previousElementSibling) && (listElements[i].parentElement.nodeName === 'UL' || listElements[i].parentElement.nodeName === 'OL')) {
|
|
35578
|
+
listElements[i].previousElementSibling.appendChild(listElements[i]);
|
|
35579
|
+
}
|
|
35580
|
+
}
|
|
35581
|
+
return valueElementWrapper.innerHTML;
|
|
35582
|
+
}
|
|
35246
35583
|
setHeight(height) {
|
|
35247
35584
|
if (height !== 'auto') {
|
|
35248
35585
|
this.element.style.height = formatUnit(height);
|