@syncfusion/ej2-richtexteditor 28.1.36 → 28.1.38-680214
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/README.md +1 -1
- package/dist/ej2-richtexteditor.min.js +1 -1
- package/dist/ej2-richtexteditor.umd.min.js +1 -1
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +221 -167
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +221 -167
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +1 -1
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/package.json +59 -82
- package/src/common/interface.d.ts +8 -8
- package/src/common/util.d.ts +1 -2
- package/src/common/util.js +49 -95
- 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 +3 -3
- package/src/editor-manager/base/enum.d.ts +2 -2
- package/src/editor-manager/base/interface.d.ts +17 -9
- package/src/editor-manager/base/types.d.ts +1 -1
- package/src/editor-manager/plugin/alignments.d.ts +2 -2
- package/src/editor-manager/plugin/alignments.js +2 -2
- package/src/editor-manager/plugin/audio.d.ts +3 -3
- package/src/editor-manager/plugin/audio.js +3 -3
- package/src/editor-manager/plugin/clearformat-exec.d.ts +2 -2
- package/src/editor-manager/plugin/clearformat-exec.js +2 -2
- package/src/editor-manager/plugin/clearformat.d.ts +1 -1
- package/src/editor-manager/plugin/clearformat.js +1 -1
- package/src/editor-manager/plugin/dom-node.d.ts +36 -36
- package/src/editor-manager/plugin/dom-node.js +36 -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 +2 -2
- 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 +2 -2
- package/src/editor-manager/plugin/insert-methods.d.ts +4 -4
- package/src/editor-manager/plugin/insert-methods.js +4 -4
- package/src/editor-manager/plugin/insert-text.d.ts +2 -2
- package/src/editor-manager/plugin/insert-text.js +2 -2
- package/src/editor-manager/plugin/inserthtml-exec.d.ts +2 -2
- package/src/editor-manager/plugin/inserthtml-exec.js +2 -2
- package/src/editor-manager/plugin/inserthtml.d.ts +2 -2
- package/src/editor-manager/plugin/inserthtml.js +5 -5
- package/src/editor-manager/plugin/isformatted.d.ts +9 -9
- package/src/editor-manager/plugin/isformatted.js +9 -9
- 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 +3 -2
- package/src/editor-manager/plugin/lists.js +15 -3
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +1 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +1 -1
- 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 +2 -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 +6 -6
- 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.js +37 -5
- package/src/rich-text-editor/actions/full-screen.d.ts +3 -3
- package/src/rich-text-editor/actions/full-screen.js +3 -3
- package/src/rich-text-editor/actions/html-editor.d.ts +3 -3
- package/src/rich-text-editor/actions/html-editor.js +28 -6
- package/src/rich-text-editor/actions/keyboard.d.ts +1 -1
- package/src/rich-text-editor/actions/keyboard.js +1 -1
- 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 +1 -1
- package/src/rich-text-editor/actions/paste-clean-up.js +27 -11
- 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/resize.d.ts +2 -0
- package/src/rich-text-editor/actions/resize.js +14 -2
- 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 +125 -125
- package/src/rich-text-editor/base/classes.js +125 -125
- 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 +51 -51
- package/src/rich-text-editor/base/interface.js +1 -1
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +1 -1
- package/src/rich-text-editor/base/rich-text-editor.d.ts +62 -62
- package/src/rich-text-editor/base/rich-text-editor.js +34 -35
- 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 +9 -9
- package/src/rich-text-editor/formatter/html-formatter.d.ts +2 -2
- package/src/rich-text-editor/formatter/html-formatter.js +2 -2
- package/src/rich-text-editor/formatter/markdown-formatter.d.ts +2 -2
- package/src/rich-text-editor/formatter/markdown-formatter.js +2 -2
- package/src/rich-text-editor/renderer/audio-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/audio-module.js +1 -1
- package/src/rich-text-editor/renderer/content-renderer.d.ts +6 -6
- package/src/rich-text-editor/renderer/content-renderer.js +6 -6
- package/src/rich-text-editor/renderer/dialog-renderer.d.ts +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 +4 -4
- package/src/rich-text-editor/renderer/image-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/image-module.js +1 -1
- package/src/rich-text-editor/renderer/link-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/link-module.js +3 -3
- 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 +3 -2
- package/src/rich-text-editor/renderer/table-module.js +44 -41
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +9 -9
- package/src/rich-text-editor/renderer/toolbar-renderer.js +16 -13
- package/src/rich-text-editor/renderer/video-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/video-module.js +1 -1
- package/src/rich-text-editor/renderer/view-source.d.ts +5 -5
- package/src/rich-text-editor/renderer/view-source.js +5 -5
- 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/bootstrap5.3-lite.css +5 -0
- package/styles/bootstrap5.3.css +5 -0
- package/styles/material3-dark.scss +1 -1
- package/styles/material3.scss +1 -1
- package/styles/rich-text-editor/_layout.scss +1 -1
- package/styles/rich-text-editor/_theme.scss +1 -1
- package/styles/rich-text-editor/bootstrap5.3.css +5 -0
- package/styles/rich-text-editor/material3-dark.scss +1 -1
- package/styles/rich-text-editor/material3.scss +1 -1
- package/styles/rich-text-editor/tailwind3.css +5 -0
- package/styles/tailwind3-lite.css +5 -0
- package/styles/tailwind3.css +5 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isNullOrUndefined, Browser, addClass, removeClass, selectAll as selectAll$1, createElement, detach, SanitizeHtmlHelper, extend, EventHandler, closest, getInstance, formatUnit, select, Ajax, Property, Event as Event$1, NotifyPropertyChanges, Base, ChildProperty, KeyboardEvents as KeyboardEvents$1, setStyleAttribute, getUniqueID, append, debounce, Observer, prepend, attributes,
|
|
1
|
+
import { isNullOrUndefined, Browser, addClass, removeClass, selectAll as selectAll$1, createElement, detach, SanitizeHtmlHelper, extend, EventHandler, closest, getInstance, formatUnit, select, Ajax, Property, Event as Event$1, NotifyPropertyChanges, Base, getComponent, ChildProperty, KeyboardEvents as KeyboardEvents$1, setStyleAttribute, getUniqueID, append, debounce, Observer, prepend, attributes, getEnumValue, Complex, print, L10n, compile, Touch, Component } from '@syncfusion/ej2-base';
|
|
2
2
|
import { Toolbar as Toolbar$1 } from '@syncfusion/ej2-navigations';
|
|
3
3
|
import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
|
4
4
|
import { Tooltip, Popup, Dialog, isCollide, getScrollableParent } from '@syncfusion/ej2-popups';
|
|
@@ -4795,11 +4795,6 @@ var NodeSelection = /** @__PURE__ @class */ (function () {
|
|
|
4795
4795
|
/**
|
|
4796
4796
|
* Defines common util methods used by Rich Text Editor.
|
|
4797
4797
|
*/
|
|
4798
|
-
var inlineNode$1 = ['a', 'abbr', 'acronym', 'audio', 'b', 'bdi', 'bdo', 'big', 'br', 'button',
|
|
4799
|
-
'canvas', 'cite', 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'font', 'i', 'iframe', 'img', 'input',
|
|
4800
|
-
'ins', 'kbd', 'label', 'map', 'mark', 'meter', 'noscript', 'object', 'output', 'picture', 'progress',
|
|
4801
|
-
'q', 'ruby', 's', 'samp', 'script', 'select', 'slot', 'small', 'span', 'strong', 'strike', 'sub', 'sup', 'svg',
|
|
4802
|
-
'template', 'textarea', 'time', 'u', 'tt', 'var', 'video', 'wbr'];
|
|
4803
4798
|
/**
|
|
4804
4799
|
* @returns {void}
|
|
4805
4800
|
* @hidden
|
|
@@ -4827,109 +4822,68 @@ function setEditFrameFocus(editableElement, selector) {
|
|
|
4827
4822
|
}
|
|
4828
4823
|
/**
|
|
4829
4824
|
* @param {string} value - specifies the string value
|
|
4830
|
-
* @param {string} enterAction - specifies the enter key action API
|
|
4831
4825
|
* @returns {void}
|
|
4832
4826
|
* @hidden
|
|
4833
4827
|
*/
|
|
4834
|
-
function updateTextNode$1(value
|
|
4835
|
-
var tempNode = document.createElement('div');
|
|
4836
|
-
tempNode.innerHTML = value;
|
|
4837
|
-
tempNode.setAttribute('class', 'tempDiv');
|
|
4828
|
+
function updateTextNode$1(value) {
|
|
4838
4829
|
var resultElm = document.createElement('div');
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
if (
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
if (!isPreviousInlineElem) {
|
|
4849
|
-
if (enterAction === 'BR') {
|
|
4850
|
-
resultElm.appendChild(tempNode.firstChild);
|
|
4851
|
-
previousParent = resultElm;
|
|
4852
|
-
}
|
|
4853
|
-
else {
|
|
4854
|
-
paraElm = createElement('p');
|
|
4855
|
-
resultElm.appendChild(paraElm);
|
|
4856
|
-
paraElm.appendChild(tempNode.firstChild);
|
|
4857
|
-
previousParent = paraElm;
|
|
4858
|
-
isPreviousInlineElem = true;
|
|
4859
|
-
}
|
|
4860
|
-
}
|
|
4861
|
-
else {
|
|
4862
|
-
previousParent.appendChild(tempNode.firstChild);
|
|
4863
|
-
previousParent = paraElm;
|
|
4864
|
-
isPreviousInlineElem = true;
|
|
4865
|
-
}
|
|
4830
|
+
resultElm.innerHTML = value;
|
|
4831
|
+
var tableElm = resultElm.querySelectorAll('table');
|
|
4832
|
+
for (var i = 0; i < tableElm.length; i++) {
|
|
4833
|
+
if (tableElm[i].classList.length > 0 &&
|
|
4834
|
+
!tableElm[i].classList.contains('e-rte-table') && !tableElm[i].classList.contains('e-rte-custom-table')) {
|
|
4835
|
+
tableElm[i].classList.add('e-rte-paste-table');
|
|
4836
|
+
if (tableElm[i].classList.contains('e-rte-paste-word-table')) {
|
|
4837
|
+
tableElm[i].classList.remove('e-rte-paste-word-table');
|
|
4838
|
+
continue; // Skiping the removal of the border if the source is from word.
|
|
4866
4839
|
}
|
|
4867
|
-
else if (
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
else {
|
|
4872
|
-
resultElm.appendChild(tempNode.firstChild);
|
|
4873
|
-
isPreviousInlineElem = false;
|
|
4874
|
-
}
|
|
4875
|
-
}
|
|
4876
|
-
var tableElm = resultElm.querySelectorAll('table');
|
|
4877
|
-
for (var i = 0; i < tableElm.length; i++) {
|
|
4878
|
-
if (tableElm[i].classList.length > 0 &&
|
|
4879
|
-
!tableElm[i].classList.contains('e-rte-table') && !tableElm[i].classList.contains('e-rte-custom-table')) {
|
|
4880
|
-
tableElm[i].classList.add('e-rte-paste-table');
|
|
4881
|
-
if (tableElm[i].classList.contains('e-rte-paste-word-table')) {
|
|
4882
|
-
tableElm[i].classList.remove('e-rte-paste-word-table');
|
|
4883
|
-
continue; // Skiping the removal of the border if the source is from word.
|
|
4840
|
+
else if (tableElm[i].classList.contains('e-rte-paste-excel-table')) {
|
|
4841
|
+
tableElm[i].classList.remove('e-rte-paste-excel-table');
|
|
4842
|
+
if (tableElm[i].getAttribute('border') === '0') {
|
|
4843
|
+
tableElm[i].removeAttribute('border');
|
|
4884
4844
|
}
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
if (
|
|
4888
|
-
|
|
4845
|
+
var tdElm = tableElm[i].querySelectorAll('td');
|
|
4846
|
+
for (var j = 0; j < tdElm.length; j++) {
|
|
4847
|
+
if (tdElm[j].style.borderLeft === 'none') {
|
|
4848
|
+
tdElm[j].style.removeProperty('border-left');
|
|
4889
4849
|
}
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
if (tdElm[j].style.borderTop === 'none') {
|
|
4902
|
-
tdElm[j].style.removeProperty('border-top');
|
|
4903
|
-
}
|
|
4904
|
-
if (tdElm[j].style.border === 'none') {
|
|
4905
|
-
tdElm[j].style.removeProperty('border');
|
|
4906
|
-
}
|
|
4850
|
+
if (tdElm[j].style.borderRight === 'none') {
|
|
4851
|
+
tdElm[j].style.removeProperty('border-right');
|
|
4852
|
+
}
|
|
4853
|
+
if (tdElm[j].style.borderBottom === 'none') {
|
|
4854
|
+
tdElm[j].style.removeProperty('border-bottom');
|
|
4855
|
+
}
|
|
4856
|
+
if (tdElm[j].style.borderTop === 'none') {
|
|
4857
|
+
tdElm[j].style.removeProperty('border-top');
|
|
4858
|
+
}
|
|
4859
|
+
if (tdElm[j].style.border === 'none') {
|
|
4860
|
+
tdElm[j].style.removeProperty('border');
|
|
4907
4861
|
}
|
|
4908
|
-
}
|
|
4909
|
-
else if (tableElm[i].classList.contains('e-rte-paste-onenote-table')) {
|
|
4910
|
-
tableElm[i].classList.remove('e-rte-paste-onenote-table');
|
|
4911
|
-
continue;
|
|
4912
|
-
}
|
|
4913
|
-
else if (tableElm[i].classList.contains('e-rte-paste-html-table')) {
|
|
4914
|
-
tableElm[i].classList.remove('e-rte-paste-html-table');
|
|
4915
|
-
continue;
|
|
4916
4862
|
}
|
|
4917
4863
|
}
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
if (imageElm[i].classList.contains('e-rte-image-unsupported')) {
|
|
4922
|
-
continue; // Should not add the class if the image is Broken.
|
|
4923
|
-
}
|
|
4924
|
-
if (!imageElm[i].classList.contains('e-rte-image')) {
|
|
4925
|
-
imageElm[i].classList.add('e-rte-image');
|
|
4864
|
+
else if (tableElm[i].classList.contains('e-rte-paste-onenote-table')) {
|
|
4865
|
+
tableElm[i].classList.remove('e-rte-paste-onenote-table');
|
|
4866
|
+
continue;
|
|
4926
4867
|
}
|
|
4927
|
-
if (
|
|
4928
|
-
|
|
4929
|
-
|
|
4868
|
+
else if (tableElm[i].classList.contains('e-rte-paste-html-table')) {
|
|
4869
|
+
tableElm[i].classList.remove('e-rte-paste-html-table');
|
|
4870
|
+
continue;
|
|
4930
4871
|
}
|
|
4931
4872
|
}
|
|
4932
4873
|
}
|
|
4874
|
+
var imageElm = resultElm.querySelectorAll('img');
|
|
4875
|
+
for (var i = 0; i < imageElm.length; i++) {
|
|
4876
|
+
if (imageElm[i].classList.contains('e-rte-image-unsupported')) {
|
|
4877
|
+
continue; // Should not add the class if the image is Broken.
|
|
4878
|
+
}
|
|
4879
|
+
if (!imageElm[i].classList.contains('e-rte-image')) {
|
|
4880
|
+
imageElm[i].classList.add('e-rte-image');
|
|
4881
|
+
}
|
|
4882
|
+
if (!(imageElm[i].classList.contains('e-imginline') ||
|
|
4883
|
+
imageElm[i].classList.contains('e-imgbreak'))) {
|
|
4884
|
+
imageElm[i].classList.add('e-imginline');
|
|
4885
|
+
}
|
|
4886
|
+
}
|
|
4933
4887
|
return resultElm.innerHTML;
|
|
4934
4888
|
}
|
|
4935
4889
|
/**
|
|
@@ -6154,7 +6108,6 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
6154
6108
|
var proxy = this;
|
|
6155
6109
|
var value;
|
|
6156
6110
|
var colorPicker = new ColorPicker({
|
|
6157
|
-
enablePersistence: this.parent.enablePersistence,
|
|
6158
6111
|
enableRtl: this.parent.enableRtl,
|
|
6159
6112
|
inline: true,
|
|
6160
6113
|
value: null,
|
|
@@ -6190,17 +6143,21 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
6190
6143
|
value: colorpickerValue
|
|
6191
6144
|
};
|
|
6192
6145
|
proxy.parent.notify(selectionRestore, {});
|
|
6193
|
-
proxy.currentElement
|
|
6146
|
+
if (proxy.currentElement) {
|
|
6147
|
+
proxy.currentElement.querySelector('.' + CLS_RTE_ELEMENTS).style.borderBottomColor = colorpickerValue;
|
|
6148
|
+
}
|
|
6194
6149
|
var range = proxy.parent.formatter.editorManager.nodeSelection.getRange(proxy.parent.contentModule.getDocument());
|
|
6195
6150
|
var closestElement = closest(range.startContainer.parentNode, 'table');
|
|
6196
6151
|
if ((range.startContainer.nodeName === 'TD' || range.startContainer.nodeName === 'TH' || range.startContainer.nodeName === 'BODY' ||
|
|
6197
|
-
closest(range.startContainer.parentNode, 'td,th')) && range.collapsed && args.subCommand === 'BackgroundColor' && (closest(closestElement, '.' + CLS_RTE) || proxy.parent.iframeSettings.enable)) {
|
|
6152
|
+
(range.startContainer.parentNode && closest(range.startContainer.parentNode, 'td,th'))) && range.collapsed && args.subCommand === 'BackgroundColor' && (closestElement && closest(closestElement, '.' + CLS_RTE) || proxy.parent.iframeSettings.enable)) {
|
|
6198
6153
|
proxy.parent.notify(tableColorPickerChanged, colorPickerArgs);
|
|
6199
6154
|
}
|
|
6200
6155
|
else {
|
|
6201
6156
|
proxy.parent.notify(colorPickerChanged, colorPickerArgs);
|
|
6202
6157
|
}
|
|
6203
|
-
proxy.currentDropdown
|
|
6158
|
+
if (proxy.currentDropdown) {
|
|
6159
|
+
proxy.currentDropdown.toggle();
|
|
6160
|
+
}
|
|
6204
6161
|
},
|
|
6205
6162
|
beforeModeSwitch: function (args) {
|
|
6206
6163
|
value = colorPicker.value;
|
|
@@ -6663,10 +6620,10 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
6663
6620
|
}
|
|
6664
6621
|
if (!this.selfLink.isUrl(linkUrl)) {
|
|
6665
6622
|
if (this.selfLink.parent.editorMode === 'Markdown') {
|
|
6666
|
-
linkText = (linkText !== '') ? linkText : '';
|
|
6623
|
+
linkText = (linkText.trim() !== '') ? linkText : '';
|
|
6667
6624
|
}
|
|
6668
6625
|
else {
|
|
6669
|
-
linkText = (linkText === '') ? linkUrl : linkText;
|
|
6626
|
+
linkText = (linkText.trim() === '') ? linkUrl : linkText;
|
|
6670
6627
|
}
|
|
6671
6628
|
if (!this.selfLink.parent.enableAutoUrl) {
|
|
6672
6629
|
linkUrl = linkUrl.indexOf('http') > -1 ? linkUrl : 'http://' + linkUrl;
|
|
@@ -12552,7 +12509,6 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
12552
12509
|
this.parent.on(tableToolbarAction, this.onToolbarAction, this);
|
|
12553
12510
|
this.parent.on(dropDownSelect, this.dropdownSelect, this);
|
|
12554
12511
|
this.parent.on(keyDown, this.keyDown, this);
|
|
12555
|
-
this.parent.on(keyUp, this.keyUp, this);
|
|
12556
12512
|
this.parent.on(tableModulekeyUp, this.tableModulekeyUp, this);
|
|
12557
12513
|
this.parent.on(bindCssClass, this.setCssClass, this);
|
|
12558
12514
|
this.parent.on(destroy, this.destroy, this);
|
|
@@ -12573,7 +12529,6 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
12573
12529
|
this.parent.off(mouseDown, this.cellSelect);
|
|
12574
12530
|
this.parent.off(tableColorPickerChanged, this.setBGColor);
|
|
12575
12531
|
this.parent.off(keyDown, this.keyDown);
|
|
12576
|
-
this.parent.off(keyUp, this.keyUp);
|
|
12577
12532
|
this.parent.off(tableModulekeyUp, this.tableModulekeyUp);
|
|
12578
12533
|
this.parent.off(bindCssClass, this.setCssClass);
|
|
12579
12534
|
this.parent.off(destroy, this.destroy);
|
|
@@ -12670,20 +12625,6 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
12670
12625
|
this.parent.formatter.process(this.parent, e, e, { selection: selectCell, subCommand: e.item.subCommand });
|
|
12671
12626
|
this.hideTableQuickToolbar();
|
|
12672
12627
|
};
|
|
12673
|
-
Table.prototype.keyUp = function (e) {
|
|
12674
|
-
var target = e.args.target;
|
|
12675
|
-
if (e.args.key.toLocaleLowerCase() === 'escape' && target && target.classList && (this.popupObj && !closest(target, '[id=' + '\'' + this.popupObj.element.id + '\'' + ']')) && this.popupObj) {
|
|
12676
|
-
var createTableToolbarBtn = this.popupObj.relateTo;
|
|
12677
|
-
if (createTableToolbarBtn.nodeName !== 'BUTTON') {
|
|
12678
|
-
createTableToolbarBtn = createTableToolbarBtn.querySelector('span.e-create-table');
|
|
12679
|
-
createTableToolbarBtn = createTableToolbarBtn.parentElement;
|
|
12680
|
-
}
|
|
12681
|
-
this.popupObj.hide();
|
|
12682
|
-
if (createTableToolbarBtn) {
|
|
12683
|
-
createTableToolbarBtn.focus();
|
|
12684
|
-
}
|
|
12685
|
-
}
|
|
12686
|
-
};
|
|
12687
12628
|
Table.prototype.keyDown = function (e) {
|
|
12688
12629
|
var event = e.args;
|
|
12689
12630
|
// eslint-disable-next-line
|
|
@@ -14262,6 +14203,8 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
14262
14203
|
var header = '1X1';
|
|
14263
14204
|
var insertbtn = this.l10n.getConstant('inserttablebtn');
|
|
14264
14205
|
this.dlgDiv = this.parent.createElement('div', { className: 'e-rte-table-popup' + this.parent.getCssClass(true), id: this.rteID + '_table' });
|
|
14206
|
+
this.createTablePopupBoundFn = this.createTablePopupKeyDown.bind(this);
|
|
14207
|
+
this.dlgDiv.addEventListener('keydown', this.createTablePopupBoundFn);
|
|
14265
14208
|
this.tblHeader = this.parent.createElement('div', { className: 'e-rte-popup-header' + this.parent.getCssClass(true) });
|
|
14266
14209
|
this.tblHeader.innerHTML = header;
|
|
14267
14210
|
this.dlgDiv.appendChild(this.tblHeader);
|
|
@@ -14299,6 +14242,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
14299
14242
|
// eslint-disable-next-line
|
|
14300
14243
|
close: function (event) {
|
|
14301
14244
|
EventHandler.remove(btnEle, 'click', _this.insertTableDialog);
|
|
14245
|
+
_this.dlgDiv.removeEventListener('keydown', _this.createTablePopupBoundFn);
|
|
14302
14246
|
detach(btnEle);
|
|
14303
14247
|
if (_this.createTableButton && !_this.createTableButton.isDestroyed) {
|
|
14304
14248
|
_this.createTableButton.destroy();
|
|
@@ -14554,34 +14498,40 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
14554
14498
|
// eslint-disable-next-line
|
|
14555
14499
|
Table.prototype.applyProperties = function (args, e) {
|
|
14556
14500
|
var dialogEle = this.editdlgObj.element;
|
|
14557
|
-
|
|
14558
|
-
|
|
14559
|
-
|
|
14560
|
-
|
|
14561
|
-
|
|
14562
|
-
|
|
14563
|
-
|
|
14564
|
-
if (
|
|
14565
|
-
|
|
14566
|
-
|
|
14501
|
+
if (dialogEle && args && args.selectNode.length > 0 && args.selectNode[0]) {
|
|
14502
|
+
var selectedElement = (args.selectNode[0] && args.selectNode[0].nodeType === 3 ?
|
|
14503
|
+
args.selectNode[0].parentNode : args.selectNode[0]);
|
|
14504
|
+
var table = selectedElement ? closest(selectedElement, 'table') : null;
|
|
14505
|
+
if (table) {
|
|
14506
|
+
table.style.width = dialogEle.querySelector('.e-table-width') ? dialogEle.querySelector('.e-table-width').value + 'px'
|
|
14507
|
+
: table.style.width;
|
|
14508
|
+
if (dialogEle.querySelector('.e-cell-padding') && dialogEle.querySelector('.e-cell-padding').value !== '') {
|
|
14509
|
+
var tdElm = table.querySelectorAll('td');
|
|
14510
|
+
for (var i = 0; i < tdElm.length; i++) {
|
|
14511
|
+
var padVal = '';
|
|
14512
|
+
if (tdElm[i].style.padding === '') {
|
|
14513
|
+
padVal = tdElm[i].getAttribute('style') + ' padding:' +
|
|
14514
|
+
dialogEle.querySelector('.e-cell-padding').value + 'px;';
|
|
14515
|
+
}
|
|
14516
|
+
else {
|
|
14517
|
+
tdElm[i].style.padding = dialogEle.querySelector('.e-cell-padding').value + 'px';
|
|
14518
|
+
padVal = tdElm[i].getAttribute('style');
|
|
14519
|
+
}
|
|
14520
|
+
tdElm[i].setAttribute('style', padVal);
|
|
14521
|
+
}
|
|
14522
|
+
}
|
|
14523
|
+
table.cellSpacing = dialogEle.querySelector('.e-cell-spacing') ? dialogEle.querySelector('.e-cell-spacing').value
|
|
14524
|
+
: table.cellSpacing;
|
|
14525
|
+
if (!isNullOrUndefined(table.cellSpacing) && table.cellSpacing !== '0') {
|
|
14526
|
+
addClass([table], CLS_TABLE_BORDER);
|
|
14567
14527
|
}
|
|
14568
14528
|
else {
|
|
14569
|
-
|
|
14570
|
-
padVal = tdElm[i].getAttribute('style');
|
|
14529
|
+
removeClassWithAttr([table], CLS_TABLE_BORDER);
|
|
14571
14530
|
}
|
|
14572
|
-
|
|
14531
|
+
this.parent.formatter.saveData();
|
|
14532
|
+
this.editdlgObj.hide({ returnValue: true });
|
|
14573
14533
|
}
|
|
14574
14534
|
}
|
|
14575
|
-
table.cellSpacing = dialogEle.querySelector('.e-cell-spacing') ? dialogEle.querySelector('.e-cell-spacing').value
|
|
14576
|
-
: table.cellSpacing;
|
|
14577
|
-
if (!isNullOrUndefined(table.cellSpacing) && table.cellSpacing !== '0') {
|
|
14578
|
-
addClass([table], CLS_TABLE_BORDER);
|
|
14579
|
-
}
|
|
14580
|
-
else {
|
|
14581
|
-
removeClassWithAttr([table], CLS_TABLE_BORDER);
|
|
14582
|
-
}
|
|
14583
|
-
this.parent.formatter.saveData();
|
|
14584
|
-
this.editdlgObj.hide({ returnValue: true });
|
|
14585
14535
|
};
|
|
14586
14536
|
Table.prototype.tableDlgContent = function (e) {
|
|
14587
14537
|
var selectNode = e.selectParent[0];
|
|
@@ -14676,6 +14626,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
14676
14626
|
this.createTableButton.destroy();
|
|
14677
14627
|
this.createTableButton = null;
|
|
14678
14628
|
}
|
|
14629
|
+
this.createTablePopupBoundFn = null;
|
|
14679
14630
|
this.isDestroyed = true;
|
|
14680
14631
|
};
|
|
14681
14632
|
/**
|
|
@@ -14702,6 +14653,15 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
14702
14653
|
'px; left:' + (tablePosition.left + parseInt(getComputedStyle(this.curTable).width, 10) - 4) + 'px;';
|
|
14703
14654
|
}
|
|
14704
14655
|
};
|
|
14656
|
+
Table.prototype.createTablePopupKeyDown = function (e) {
|
|
14657
|
+
if (e.key === 'Escape') {
|
|
14658
|
+
var popupRootElem = e.target.closest('.e-rte-table-popup');
|
|
14659
|
+
var popup = getComponent(popupRootElem, 'popup');
|
|
14660
|
+
var tableToolbarButton = popup.relateTo;
|
|
14661
|
+
popup.hide();
|
|
14662
|
+
tableToolbarButton.focus({ preventScroll: true });
|
|
14663
|
+
}
|
|
14664
|
+
};
|
|
14705
14665
|
return Table;
|
|
14706
14666
|
}());
|
|
14707
14667
|
|
|
@@ -18965,7 +18925,7 @@ var Formatter = /** @__PURE__ @class */ (function () {
|
|
|
18965
18925
|
}
|
|
18966
18926
|
}
|
|
18967
18927
|
var command = actionBeginArgs.item.subCommand.toLocaleLowerCase();
|
|
18968
|
-
if (command === 'image') {
|
|
18928
|
+
if (command === 'image' || command === 'file' || command === 'replace') {
|
|
18969
18929
|
value = actionBeginArgs.itemCollection;
|
|
18970
18930
|
}
|
|
18971
18931
|
if (command === 'paste' || command === 'cut' || command === 'copy') {
|
|
@@ -21893,7 +21853,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
21893
21853
|
nodeSelection.setSelectionText(docElement, lastSelectionNode, lastSelectionNode, 0, 0);
|
|
21894
21854
|
}
|
|
21895
21855
|
else {
|
|
21896
|
-
this.cursorPos(lastSelectionNode, node, nodeSelection, docElement, editNode
|
|
21856
|
+
this.cursorPos(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
21897
21857
|
}
|
|
21898
21858
|
this.alignCheck(editNode);
|
|
21899
21859
|
this.listCleanUp(nodeSelection, docElement);
|
|
@@ -22157,9 +22117,9 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
22157
22117
|
}
|
|
22158
22118
|
}
|
|
22159
22119
|
};
|
|
22160
|
-
InsertHtml.cursorPos = function (lastSelectionNode, node, nodeSelection, docElement, editNode
|
|
22120
|
+
InsertHtml.cursorPos = function (lastSelectionNode, node, nodeSelection, docElement, editNode) {
|
|
22161
22121
|
lastSelectionNode.classList.add('lastNode');
|
|
22162
|
-
editNode.innerHTML = updateTextNode$1(editNode.innerHTML
|
|
22122
|
+
editNode.innerHTML = updateTextNode$1(editNode.innerHTML);
|
|
22163
22123
|
lastSelectionNode = editNode.querySelector('.lastNode');
|
|
22164
22124
|
if (!isNullOrUndefined(lastSelectionNode)) {
|
|
22165
22125
|
this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
@@ -23647,6 +23607,17 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
23647
23607
|
}
|
|
23648
23608
|
return false;
|
|
23649
23609
|
};
|
|
23610
|
+
Lists.prototype.createAutoList = function (enterKey, shiftEnterKey) {
|
|
23611
|
+
var autoListRules = {
|
|
23612
|
+
BR: { BR: true, P: true, DIV: true },
|
|
23613
|
+
P: { BR: false, P: true, DIV: true },
|
|
23614
|
+
DIV: { BR: false, P: true, DIV: true }
|
|
23615
|
+
};
|
|
23616
|
+
if (autoListRules[enterKey] && autoListRules[enterKey][shiftEnterKey] !== undefined) {
|
|
23617
|
+
return autoListRules[enterKey][shiftEnterKey];
|
|
23618
|
+
}
|
|
23619
|
+
return false;
|
|
23620
|
+
};
|
|
23650
23621
|
Lists.prototype.spaceList = function (e) {
|
|
23651
23622
|
var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
23652
23623
|
this.saveSelection = this.parent.nodeSelection.save(range, this.parent.currentDocument);
|
|
@@ -23662,7 +23633,8 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
23662
23633
|
var startElementOLTest = this.testCurrentList(range);
|
|
23663
23634
|
var preElementOLTest = this.testList(preElement);
|
|
23664
23635
|
var nextElementOLTest = this.testList(nextElement);
|
|
23665
|
-
|
|
23636
|
+
var nextElementBRTest = range.startContainer.previousElementSibling && range.startContainer.previousElementSibling.tagName === 'BR';
|
|
23637
|
+
if (!preElementOLTest && !nextElementOLTest && preElemULStart !== '*' && nextElemULStart !== '*' && (this.createAutoList(e.enterKey, e.shiftEnterKey) || !nextElementBRTest)) {
|
|
23666
23638
|
var brElement = createElement('br');
|
|
23667
23639
|
if (startElementOLTest) {
|
|
23668
23640
|
range.startContainer.textContent = range.startContainer.textContent.slice(range.startOffset, range.startContainer.textContent.length);
|
|
@@ -28220,6 +28192,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
28220
28192
|
}
|
|
28221
28193
|
else {
|
|
28222
28194
|
InsertMethods.unwrap(cursorFormat);
|
|
28195
|
+
domSelection.setCursorPoint(docElement, cursorNode, 0);
|
|
28223
28196
|
}
|
|
28224
28197
|
}
|
|
28225
28198
|
else {
|
|
@@ -32361,7 +32334,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
32361
32334
|
HtmlEditor.prototype.onSelectionRestore = function (e) {
|
|
32362
32335
|
this.parent.isBlur = false;
|
|
32363
32336
|
this.contentRenderer.getEditPanel().focus({ preventScroll: true });
|
|
32364
|
-
if (isNullOrUndefined(e.items) || e.items) {
|
|
32337
|
+
if ((isNullOrUndefined(e.items) || e.items) && (!isNullOrUndefined(this.saveSelection))) {
|
|
32365
32338
|
this.saveSelection.restore();
|
|
32366
32339
|
}
|
|
32367
32340
|
};
|
|
@@ -32668,7 +32641,9 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
32668
32641
|
var eventArgs_1 = {
|
|
32669
32642
|
callBack: null,
|
|
32670
32643
|
event: e.args,
|
|
32671
|
-
name: 'keydown-handler'
|
|
32644
|
+
name: 'keydown-handler',
|
|
32645
|
+
enterKey: this.parent.enterKey,
|
|
32646
|
+
shiftEnterKey: this.parent.shiftEnterKey
|
|
32672
32647
|
};
|
|
32673
32648
|
var actionBeginArgs = {
|
|
32674
32649
|
cancel: false,
|
|
@@ -32804,6 +32779,26 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
32804
32779
|
if (isNullOrUndefined(this.oldRangeElement)) {
|
|
32805
32780
|
return;
|
|
32806
32781
|
}
|
|
32782
|
+
else if (findBlockElement[0].previousSibling) {
|
|
32783
|
+
var prevSibling = findBlockElement[0].previousSibling;
|
|
32784
|
+
var currentElement = findBlockElement[0];
|
|
32785
|
+
if (prevSibling.textContent.trim()) {
|
|
32786
|
+
if (prevSibling.lastChild.nodeName === 'BR') {
|
|
32787
|
+
prevSibling.removeChild(prevSibling.lastChild);
|
|
32788
|
+
}
|
|
32789
|
+
var cursorpointer = prevSibling.lastChild.textContent.length;
|
|
32790
|
+
var lastChild = prevSibling.lastChild;
|
|
32791
|
+
var childNodes = Array.from(currentElement.childNodes);
|
|
32792
|
+
for (var i = 0; i < childNodes.length; i++) {
|
|
32793
|
+
prevSibling.appendChild(childNodes[i].cloneNode(true));
|
|
32794
|
+
}
|
|
32795
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), lastChild, cursorpointer);
|
|
32796
|
+
currentElement.parentNode.removeChild(currentElement);
|
|
32797
|
+
}
|
|
32798
|
+
else {
|
|
32799
|
+
prevSibling.parentNode.removeChild(prevSibling);
|
|
32800
|
+
}
|
|
32801
|
+
}
|
|
32807
32802
|
else {
|
|
32808
32803
|
if (this.oldRangeElement.tagName === 'OL' || this.oldRangeElement.tagName === 'UL') {
|
|
32809
32804
|
this.oldRangeElement = this.oldRangeElement.lastElementChild.lastElementChild
|
|
@@ -32826,7 +32821,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
32826
32821
|
var checkParent = false;
|
|
32827
32822
|
if (this.oldRangeElement && this.oldRangeElement.nodeName !== '#text' && this.oldRangeElement.querySelectorAll('BR').length === 1) {
|
|
32828
32823
|
var brElement = this.oldRangeElement.querySelector('BR');
|
|
32829
|
-
if (brElement) {
|
|
32824
|
+
if (brElement && isNullOrUndefined(brElement.nextSibling)) {
|
|
32830
32825
|
var brParentElement = brElement.parentNode;
|
|
32831
32826
|
var currentState = this.oldRangeElement.innerHTML;
|
|
32832
32827
|
this.parent.formatter.saveData(currentState);
|
|
@@ -33586,6 +33581,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
33586
33581
|
var isValueNotEmpty = tempDivElem.textContent !== '' || !isNullOrUndefined(tempDivElem.querySelector('img')) ||
|
|
33587
33582
|
!isNullOrUndefined(tempDivElem.querySelector('table'));
|
|
33588
33583
|
var imgElements = tempDivElem.querySelectorAll('img');
|
|
33584
|
+
var base_1 = this.parent.contentModule.getDocument().location.origin;
|
|
33589
33585
|
imgElements.forEach(function (imgElement) {
|
|
33590
33586
|
var imageFileFormat;
|
|
33591
33587
|
var imgElementSrc = imgElement.getAttribute('src');
|
|
@@ -33594,7 +33590,9 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
33594
33590
|
imageFileFormat = imgElementSrc.split(';')[0].split('/')[1];
|
|
33595
33591
|
}
|
|
33596
33592
|
else {
|
|
33597
|
-
|
|
33593
|
+
var parsedUrl = imgElementSrc.indexOf('http') > -1 ? new URL(imgElementSrc) : new URL(imgElementSrc, base_1);
|
|
33594
|
+
var path = parsedUrl.pathname;
|
|
33595
|
+
imageFileFormat = path.split('.').pop().toLowerCase();
|
|
33598
33596
|
}
|
|
33599
33597
|
if (!isNullOrUndefined(imageFileFormat) &&
|
|
33600
33598
|
allowedTypes.every(function (type) { return imageFileFormat !== type.substring(1).toLowerCase(); }) &&
|
|
@@ -33853,7 +33851,11 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
33853
33851
|
this.parent.inputElement.contentEditable = 'true';
|
|
33854
33852
|
detach(imgElem);
|
|
33855
33853
|
if (popupObj) {
|
|
33856
|
-
|
|
33854
|
+
this.parent.isBlur = false;
|
|
33855
|
+
popupObj.destroy();
|
|
33856
|
+
if (!isNullOrUndefined(popupObj.element)) {
|
|
33857
|
+
detach(popupObj.element);
|
|
33858
|
+
}
|
|
33857
33859
|
}
|
|
33858
33860
|
this.parent.trigger(imageUploadFailed, e);
|
|
33859
33861
|
if (uploadObj && document.body.contains(uploadObj.element)) {
|
|
@@ -33870,7 +33872,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
33870
33872
|
this.parent.trigger(imageUploadSuccess, e, function (e) {
|
|
33871
33873
|
if (!isNullOrUndefined(_this.parent.insertImageSettings.path)) {
|
|
33872
33874
|
var url = _this.parent.insertImageSettings.path + e.file.name;
|
|
33873
|
-
if (!_this.parent.inputElement.contains(imgElem)) {
|
|
33875
|
+
if (!_this.parent.inputElement.contains(imgElem) && imgElem.id) {
|
|
33874
33876
|
var imgHtmlElems = _this.parent.inputElement.querySelectorAll('#' + imgElem.id);
|
|
33875
33877
|
for (var i = 0; i < imgHtmlElems.length; i++) {
|
|
33876
33878
|
var imgHtmlElem = imgHtmlElems[i];
|
|
@@ -33895,13 +33897,22 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
33895
33897
|
});
|
|
33896
33898
|
}
|
|
33897
33899
|
this.popupCloseTime = setTimeout(function () {
|
|
33898
|
-
popupObj
|
|
33899
|
-
|
|
33900
|
-
|
|
33901
|
-
|
|
33902
|
-
|
|
33903
|
-
|
|
33904
|
-
|
|
33900
|
+
if (popupObj) {
|
|
33901
|
+
_this.parent.isBlur = false;
|
|
33902
|
+
popupObj.destroy();
|
|
33903
|
+
if (!isNullOrUndefined(popupObj.element)) {
|
|
33904
|
+
detach(popupObj.element);
|
|
33905
|
+
}
|
|
33906
|
+
}
|
|
33907
|
+
if (!_this.parent.inputElement.contains(imgElem) && (imgElem.id || imgElem.alt)) {
|
|
33908
|
+
var selector = imgElem.id ? "#" + imgElem.id : "[alt=\"" + imgElem.alt + "\"]";
|
|
33909
|
+
if (selector) {
|
|
33910
|
+
var imgHtmlElems = _this.parent.inputElement.querySelectorAll(selector);
|
|
33911
|
+
for (var i = 0; i < imgHtmlElems.length; i++) {
|
|
33912
|
+
var imgHtmlElem = imgHtmlElems[i];
|
|
33913
|
+
if (imgHtmlElem && imgHtmlElem.style && imgHtmlElem.style.opacity === '0.5') {
|
|
33914
|
+
imgHtmlElem.style.opacity = '1';
|
|
33915
|
+
}
|
|
33905
33916
|
}
|
|
33906
33917
|
}
|
|
33907
33918
|
}
|
|
@@ -34707,13 +34718,24 @@ var Resize = /** @__PURE__ @class */ (function () {
|
|
|
34707
34718
|
this.iframeElement = this.parent.contentModule.getDocument().querySelectorAll('iframe');
|
|
34708
34719
|
if (!isNullOrUndefined(this.iframeElement)) {
|
|
34709
34720
|
this.iframeElement.forEach(function (iframe) {
|
|
34710
|
-
EventHandler.add(iframe
|
|
34721
|
+
EventHandler.add(iframe, 'load', _this.onIFrameLoad, _this);
|
|
34711
34722
|
});
|
|
34712
34723
|
}
|
|
34713
34724
|
this.touchStartEvent = (Browser.info.name === 'msie') ? 'pointerdown' : 'touchstart';
|
|
34714
34725
|
EventHandler.add(this.resizer, 'mousedown', this.resizeStart, this);
|
|
34715
34726
|
EventHandler.add(this.resizer, this.touchStartEvent, this.resizeStart, this);
|
|
34716
34727
|
};
|
|
34728
|
+
Resize.prototype.onIFrameLoad = function (e) {
|
|
34729
|
+
var iframe = e.target;
|
|
34730
|
+
if (iframe.nodeName === 'IFRAME' && iframe.contentDocument) {
|
|
34731
|
+
EventHandler.add(iframe.contentDocument, 'mouseup', this.stopResize, this);
|
|
34732
|
+
}
|
|
34733
|
+
};
|
|
34734
|
+
Resize.prototype.removeMouseUpEventListener = function (iframe) {
|
|
34735
|
+
if (iframe.contentDocument) {
|
|
34736
|
+
EventHandler.remove(iframe.contentDocument, 'mouseup', this.stopResize);
|
|
34737
|
+
}
|
|
34738
|
+
};
|
|
34717
34739
|
Resize.prototype.resizeStart = function (e) {
|
|
34718
34740
|
var _this = this;
|
|
34719
34741
|
this.isResizing = false;
|
|
@@ -34820,7 +34842,8 @@ var Resize = /** @__PURE__ @class */ (function () {
|
|
|
34820
34842
|
}
|
|
34821
34843
|
if (!isNullOrUndefined(this.iframeElement)) {
|
|
34822
34844
|
this.iframeElement.forEach(function (iframe) {
|
|
34823
|
-
|
|
34845
|
+
_this.removeMouseUpEventListener(iframe);
|
|
34846
|
+
EventHandler.remove(iframe, 'load', _this.onIFrameLoad);
|
|
34824
34847
|
});
|
|
34825
34848
|
}
|
|
34826
34849
|
if (this.resizer) {
|
|
@@ -37574,7 +37597,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
37574
37597
|
if ((_this.parent.enterKey === 'P' && !shiftKey_1) || (_this.parent.enterKey === 'DIV' && !shiftKey_1) ||
|
|
37575
37598
|
(_this.parent.shiftEnterKey === 'P' && shiftKey_1) ||
|
|
37576
37599
|
(_this.parent.shiftEnterKey === 'DIV' && shiftKey_1)) {
|
|
37577
|
-
if ((_this.range.startOffset === 1 && _this.parent.inputElement.childNodes.length === 1 && _this.parent.inputElement.childNodes[0].nodeName === 'TABLE')
|
|
37600
|
+
if ((_this.range.startOffset === 1 && _this.parent.inputElement.childNodes.length === 1 && _this.parent.inputElement.childNodes[0].nodeName === 'TABLE')) {
|
|
37578
37601
|
var newElem = _this.createInsertElement(shiftKey_1);
|
|
37579
37602
|
newElem.appendChild(_this.parent.createElement('BR'));
|
|
37580
37603
|
_this.parent.inputElement.appendChild(newElem);
|
|
@@ -37616,7 +37639,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
37616
37639
|
&& isSplitTextEmpty && !isPreWrapApplied && !isTextWrapApplied;
|
|
37617
37640
|
var isCursorAtStartPreWrapWithContent = lastCharBeforeCursor === 32
|
|
37618
37641
|
&& (isPreWrapApplied || isTextWrapApplied) && isSplitTextEmpty && hasContentAfterCursor;
|
|
37619
|
-
if (isCursorAtStartNonPreWrap || isCursorAtStartPreWrapWithContent)
|
|
37642
|
+
if ((isCursorAtStartNonPreWrap || isCursorAtStartPreWrapWithContent) &&
|
|
37643
|
+
!_this.range.startContainer.previousSibling) {
|
|
37620
37644
|
isFocusedFirst = true;
|
|
37621
37645
|
}
|
|
37622
37646
|
}
|
|
@@ -37625,15 +37649,16 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
37625
37649
|
}
|
|
37626
37650
|
_this.removeBRElement(nearBlockNode);
|
|
37627
37651
|
var fireFoxEnterAtMiddle = Browser.userAgent.indexOf('Firefox') !== -1 && _this.range.startOffset === 0 && _this.range.startContainer === _this.range.endContainer &&
|
|
37628
|
-
_this.range.startContainer.nodeName === '#text' && !_this.parent.formatter.editorManager.domNode.isBlockNode(_this.range.startContainer.previousSibling) &&
|
|
37652
|
+
_this.range.startContainer.nodeName === '#text' && !isNullOrUndefined(_this.range.startContainer.previousSibling) && !_this.parent.formatter.editorManager.domNode.isBlockNode(_this.range.startContainer.previousSibling) &&
|
|
37629
37653
|
_this.range.startContainer.parentElement === _this.range.startContainer.previousSibling.parentElement;
|
|
37630
37654
|
var preventZeroWithSpace = ((_this.range.startContainer.nodeName === '#text' && _this.range.startContainer.textContent.includes('\u200B') &&
|
|
37631
37655
|
_this.range.startContainer.textContent.trim() === '\u200B') ||
|
|
37632
37656
|
(_this.range.startContainer.nodeName === '#text' && !isNullOrUndefined(_this.range.startContainer.textContent[_this.range.startOffset]) &&
|
|
37633
37657
|
_this.range.startContainer.textContent[_this.range.startOffset].includes('\u200B') && _this.range.startContainer.textContent[_this.range.startOffset] === '\u200B' &&
|
|
37634
37658
|
_this.parent.inputElement.textContent[0] !== '\u200B'));
|
|
37659
|
+
var preventEnterkeyShiftKey = (_this.range.startContainer.nodeName === '#text' || _this.range.startContainer.nodeName === 'BR') && (_this.range.startOffset === 0 && _this.range.endOffset === 0) && _this.range.startContainer.parentElement === _this.parent.inputElement && _this.parent.enterKey === 'BR' && shiftKey_1;
|
|
37635
37660
|
// eslint-disable-next-line max-len
|
|
37636
|
-
if (!preventZeroWithSpace && !fireFoxEnterAtMiddle && ((_this.range.startOffset === 0 && _this.range.endOffset === 0) || isFocusedFirst) &&
|
|
37661
|
+
if (!preventEnterkeyShiftKey && !preventZeroWithSpace && !fireFoxEnterAtMiddle && ((_this.range.startOffset === 0 && _this.range.endOffset === 0) || isFocusedFirst) &&
|
|
37637
37662
|
!(!isNullOrUndefined(_this.range.startContainer.previousSibling) &&
|
|
37638
37663
|
(_this.range.startContainer.previousSibling.nodeName === 'IMG' || _this.range.startContainer.previousSibling.nodeName === 'BR'))) {
|
|
37639
37664
|
var isNearBlockLengthZero = void 0;
|
|
@@ -37698,7 +37723,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
37698
37723
|
}
|
|
37699
37724
|
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), insertElem.nextElementSibling, 0);
|
|
37700
37725
|
}
|
|
37701
|
-
else if (nearBlockNode.textContent.length === 0 && !(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG' ||
|
|
37726
|
+
else if (nearBlockNode !== _this.parent.inputElement && nearBlockNode.textContent.length === 0 && !(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG' ||
|
|
37702
37727
|
(nearBlockNode.querySelectorAll('video').length > 0) || (nearBlockNode.querySelectorAll('audio').length > 0) || (nearBlockNode.querySelectorAll('img').length > 0))) {
|
|
37703
37728
|
if (!isNullOrUndefined(nearBlockNode.children[0]) && nearBlockNode.children[0].tagName !== 'BR') {
|
|
37704
37729
|
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
|
|
@@ -37754,6 +37779,36 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
37754
37779
|
_this.parent.videoModule.hideVideoQuickToolbar();
|
|
37755
37780
|
}
|
|
37756
37781
|
}
|
|
37782
|
+
else if (_this.parent.enterKey === 'BR' && shiftKey_1 && _this.range.startContainer.nodeType === Node.TEXT_NODE && _this.range.startContainer.parentElement && _this.range.startContainer.parentElement === _this.parent.inputElement) {
|
|
37783
|
+
var range = _this.range;
|
|
37784
|
+
var startContainer = range.startContainer;
|
|
37785
|
+
var startOffset = range.startOffset;
|
|
37786
|
+
var newElement = _this.parent.createElement(_this.parent.shiftEnterKey);
|
|
37787
|
+
if (startContainer.nodeType === Node.TEXT_NODE && range.endOffset !== 0 && range.startOffset !== 0) {
|
|
37788
|
+
var textNode = startContainer;
|
|
37789
|
+
if (startOffset < textNode.length) {
|
|
37790
|
+
var newTextNode = textNode.splitText(startOffset);
|
|
37791
|
+
newElement.appendChild(newTextNode);
|
|
37792
|
+
}
|
|
37793
|
+
else {
|
|
37794
|
+
newElement.innerHTML = '<br>';
|
|
37795
|
+
}
|
|
37796
|
+
textNode.parentNode.insertBefore(newElement, textNode.nextSibling);
|
|
37797
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), newElement, 0);
|
|
37798
|
+
}
|
|
37799
|
+
else if (startOffset === 0 && range.endOffset === 0) {
|
|
37800
|
+
newElement.innerHTML = '<br>';
|
|
37801
|
+
if (range.endOffset === startContainer.textContent.length) {
|
|
37802
|
+
var brElement = _this.parent.createElement('br');
|
|
37803
|
+
startContainer.parentNode.insertBefore(brElement, startContainer);
|
|
37804
|
+
}
|
|
37805
|
+
startContainer.parentNode.insertBefore(newElement, startContainer);
|
|
37806
|
+
var cursorTarget = (range.endOffset === startContainer.textContent.length)
|
|
37807
|
+
? newElement : newElement.nextSibling;
|
|
37808
|
+
startContainer.parentNode.insertBefore(newElement, startContainer);
|
|
37809
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), cursorTarget, 0);
|
|
37810
|
+
}
|
|
37811
|
+
}
|
|
37757
37812
|
else {
|
|
37758
37813
|
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true);
|
|
37759
37814
|
if (!isNullOrUndefined(newElem.childNodes[0]) && newElem.childNodes[0].nodeName === '#text' &&
|
|
@@ -39648,7 +39703,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
39648
39703
|
this.placeHolderWrapper.innerHTML = this.placeholder;
|
|
39649
39704
|
if (this.inputElement.textContent.length === 0 && this.inputElement.childNodes.length < 2 && !isNullOrUndefined(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
|
|
39650
39705
|
((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNullOrUndefined(this.inputElement.firstChild.firstChild) &&
|
|
39651
|
-
this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
|
|
39706
|
+
this.inputElement.firstChild.childNodes.length < 2 && this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
|
|
39652
39707
|
this.placeHolderWrapper.classList.add('enabled');
|
|
39653
39708
|
}
|
|
39654
39709
|
else {
|
|
@@ -40384,7 +40439,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
40384
40439
|
var value = this.getUpdatedValue();
|
|
40385
40440
|
this.setProperties({ value: value });
|
|
40386
40441
|
this.valueContainer.value = this.value;
|
|
40387
|
-
this.notify(toolbarRefresh, { args: e, documentNode: document });
|
|
40388
40442
|
this.isValueChangeBlurhandler = true;
|
|
40389
40443
|
this.invokeChangeEvent();
|
|
40390
40444
|
this.isFocusOut = true;
|