@syncfusion/ej2-richtexteditor 24.2.8 → 25.1.35
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/CHANGELOG.md +34 -0
- package/dist/ej2-richtexteditor.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +955 -495
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +939 -484
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +13 -13
- package/src/common/config.d.ts +7 -0
- package/src/common/config.js +11 -0
- package/src/common/interface.d.ts +12 -0
- package/src/common/types.d.ts +6 -0
- package/src/editor-manager/plugin/dom-node.d.ts +5 -1
- package/src/editor-manager/plugin/dom-node.js +161 -12
- package/src/editor-manager/plugin/formats.js +1 -1
- package/src/editor-manager/plugin/image.js +12 -16
- package/src/editor-manager/plugin/inserthtml.d.ts +1 -0
- package/src/editor-manager/plugin/inserthtml.js +40 -1
- package/src/editor-manager/plugin/link.js +1 -1
- package/src/editor-manager/plugin/lists.js +24 -2
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +1 -0
- package/src/editor-manager/plugin/ms-word-clean-up.js +87 -58
- package/src/editor-manager/plugin/selection-commands.js +52 -3
- package/src/editor-manager/plugin/table.js +18 -3
- package/src/editor-manager/plugin/toolbar-status.d.ts +2 -2
- package/src/editor-manager/plugin/toolbar-status.js +17 -9
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +3 -3
- package/src/rich-text-editor/actions/base-quick-toolbar.js +44 -10
- package/src/rich-text-editor/actions/base-toolbar.js +24 -30
- package/src/rich-text-editor/actions/dropdown-buttons.js +4 -4
- package/src/rich-text-editor/actions/emoji-picker.js +2 -2
- package/src/rich-text-editor/actions/enter-key.js +4 -3
- package/src/rich-text-editor/actions/full-screen.js +2 -2
- package/src/rich-text-editor/actions/html-editor.d.ts +0 -2
- package/src/rich-text-editor/actions/html-editor.js +18 -31
- package/src/rich-text-editor/actions/markdown-editor.js +3 -1
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +1 -0
- package/src/rich-text-editor/actions/paste-clean-up.js +23 -0
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +7 -0
- package/src/rich-text-editor/actions/quick-toolbar.js +24 -9
- package/src/rich-text-editor/actions/resize.js +2 -1
- package/src/rich-text-editor/actions/toolbar.d.ts +0 -2
- package/src/rich-text-editor/actions/toolbar.js +13 -85
- package/src/rich-text-editor/base/classes.d.ts +0 -5
- package/src/rich-text-editor/base/classes.js +0 -5
- package/src/rich-text-editor/base/constant.d.ts +5 -0
- package/src/rich-text-editor/base/constant.js +5 -0
- package/src/rich-text-editor/base/interface.d.ts +36 -2
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +2 -2
- package/src/rich-text-editor/base/rich-text-editor.d.ts +4 -3
- package/src/rich-text-editor/base/rich-text-editor.js +81 -58
- package/src/rich-text-editor/base/util.js +8 -2
- package/src/rich-text-editor/models/default-locale.js +15 -12
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.js +1 -1
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +2 -1
- package/src/rich-text-editor/renderer/image-module.d.ts +8 -1
- package/src/rich-text-editor/renderer/image-module.js +148 -155
- package/src/rich-text-editor/renderer/table-module.d.ts +2 -0
- package/src/rich-text-editor/renderer/table-module.js +71 -8
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +3 -0
- package/src/rich-text-editor/renderer/toolbar-renderer.js +61 -2
- package/src/rich-text-editor/renderer/video-module.js +7 -4
- package/src/rich-text-editor/renderer/view-source.js +7 -4
- package/styles/bootstrap-dark.css +57 -17
- package/styles/bootstrap.css +58 -18
- package/styles/bootstrap4.css +58 -18
- package/styles/bootstrap5-dark.css +64 -17
- package/styles/bootstrap5.css +64 -17
- package/styles/fabric-dark.css +57 -17
- package/styles/fabric.css +58 -18
- package/styles/fluent-dark.css +57 -17
- package/styles/fluent.css +57 -17
- package/styles/highcontrast-light.css +57 -17
- package/styles/highcontrast.css +58 -18
- package/styles/material-dark.css +57 -17
- package/styles/material.css +57 -17
- package/styles/material3-dark.css +59 -19
- package/styles/material3.css +59 -19
- package/styles/rich-text-editor/_bds-definition.scss +279 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +1 -0
- package/styles/rich-text-editor/_bootstrap-definition.scss +1 -1
- package/styles/rich-text-editor/_bootstrap4-definition.scss +3 -2
- package/styles/rich-text-editor/_bootstrap5-definition.scss +1 -0
- package/styles/rich-text-editor/_fabric-dark-definition.scss +1 -0
- package/styles/rich-text-editor/_fabric-definition.scss +2 -1
- package/styles/rich-text-editor/_fluent-definition.scss +1 -0
- package/styles/rich-text-editor/_fusionnew-definition.scss +1 -0
- package/styles/rich-text-editor/_highcontrast-definition.scss +2 -1
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +1 -0
- package/styles/rich-text-editor/_layout.scss +47 -13
- package/styles/rich-text-editor/_material-dark-definition.scss +1 -0
- package/styles/rich-text-editor/_material-definition.scss +1 -0
- package/styles/rich-text-editor/_material3-definition.scss +1 -0
- package/styles/rich-text-editor/_tailwind-definition.scss +4 -3
- package/styles/rich-text-editor/_theme.scss +18 -5
- package/styles/rich-text-editor/bootstrap-dark.css +57 -17
- package/styles/rich-text-editor/bootstrap.css +58 -18
- package/styles/rich-text-editor/bootstrap4.css +58 -18
- package/styles/rich-text-editor/bootstrap5-dark.css +64 -17
- package/styles/rich-text-editor/bootstrap5.css +64 -17
- package/styles/rich-text-editor/fabric-dark.css +57 -17
- package/styles/rich-text-editor/fabric.css +58 -18
- package/styles/rich-text-editor/fluent-dark.css +57 -17
- package/styles/rich-text-editor/fluent.css +57 -17
- package/styles/rich-text-editor/highcontrast-light.css +57 -17
- package/styles/rich-text-editor/highcontrast.css +58 -18
- package/styles/rich-text-editor/icons/_bds.scss +351 -0
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +7 -4
- package/styles/rich-text-editor/icons/_bootstrap.scss +7 -4
- package/styles/rich-text-editor/icons/_bootstrap4.scss +7 -4
- package/styles/rich-text-editor/icons/_bootstrap5.scss +7 -4
- package/styles/rich-text-editor/icons/_fabric-dark.scss +7 -4
- package/styles/rich-text-editor/icons/_fabric.scss +7 -4
- package/styles/rich-text-editor/icons/_fluent.scss +7 -4
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +7 -4
- package/styles/rich-text-editor/icons/_highcontrast.scss +7 -4
- package/styles/rich-text-editor/icons/_material-dark.scss +7 -4
- package/styles/rich-text-editor/icons/_material.scss +7 -4
- package/styles/rich-text-editor/icons/_material3.scss +7 -4
- package/styles/rich-text-editor/icons/_tailwind.scss +7 -4
- package/styles/rich-text-editor/material-dark.css +57 -17
- package/styles/rich-text-editor/material.css +57 -17
- package/styles/rich-text-editor/material3-dark.css +59 -19
- package/styles/rich-text-editor/material3.css +59 -19
- package/styles/rich-text-editor/tailwind-dark.css +61 -21
- package/styles/rich-text-editor/tailwind.css +61 -21
- package/styles/tailwind-dark.css +61 -21
- package/styles/tailwind.css +61 -21
|
@@ -769,6 +769,11 @@ var documentClickClosedBy = 'documentClickClosedBy';
|
|
|
769
769
|
* @deprecated
|
|
770
770
|
*/
|
|
771
771
|
var showColorPicker = 'showColorPicker';
|
|
772
|
+
/**
|
|
773
|
+
* @hidden
|
|
774
|
+
* @deprecated
|
|
775
|
+
*/
|
|
776
|
+
var closeTooltip = 'closeTooltip';
|
|
772
777
|
/**
|
|
773
778
|
* @hidden
|
|
774
779
|
* @deprecated
|
|
@@ -1012,11 +1017,6 @@ var CLS_TB_FIXED = 'e-rte-tb-fixed';
|
|
|
1012
1017
|
* @deprecated
|
|
1013
1018
|
*/
|
|
1014
1019
|
var CLS_TB_FLOAT = 'e-rte-tb-float';
|
|
1015
|
-
/**
|
|
1016
|
-
* @hidden
|
|
1017
|
-
* @deprecated
|
|
1018
|
-
*/
|
|
1019
|
-
var CLS_TB_ABS_FLOAT = 'e-rte-tb-abs-float';
|
|
1020
1020
|
/**
|
|
1021
1021
|
* @hidden
|
|
1022
1022
|
* @deprecated
|
|
@@ -2687,7 +2687,7 @@ var defaultLocale = {
|
|
|
2687
2687
|
'linkTooltipLabel': 'Title',
|
|
2688
2688
|
'linkWebUrl': 'Web address',
|
|
2689
2689
|
'linkTitle': 'Enter a title',
|
|
2690
|
-
'linkurl': '
|
|
2690
|
+
'linkurl': 'https://example.com',
|
|
2691
2691
|
'linkOpenInNewWindow': 'Open link in new window',
|
|
2692
2692
|
'linkHeader': 'Insert Link',
|
|
2693
2693
|
'dialogInsert': 'Insert',
|
|
@@ -2710,9 +2710,9 @@ var defaultLocale = {
|
|
|
2710
2710
|
'imageAlternateText': 'Alternate Text',
|
|
2711
2711
|
'alternateHeader': 'Alternative Text',
|
|
2712
2712
|
'browse': 'Browse',
|
|
2713
|
-
'imageUrl': '
|
|
2714
|
-
'audioUrl': '
|
|
2715
|
-
'videoUrl': '
|
|
2713
|
+
'imageUrl': 'https://example.com/image.png',
|
|
2714
|
+
'audioUrl': 'https://example.com/audio.mp3',
|
|
2715
|
+
'videoUrl': 'https://example.com/video.mp4',
|
|
2716
2716
|
'webUrl': 'Web URL',
|
|
2717
2717
|
'embedUrl': 'Embed Code',
|
|
2718
2718
|
'imageCaption': 'Caption',
|
|
@@ -2723,7 +2723,7 @@ var defaultLocale = {
|
|
|
2723
2723
|
'videoHeight': 'Height',
|
|
2724
2724
|
'videoWidth': 'Width',
|
|
2725
2725
|
'textPlaceholder': 'Enter text',
|
|
2726
|
-
'inserttablebtn': 'Insert
|
|
2726
|
+
'inserttablebtn': 'Insert Table',
|
|
2727
2727
|
'tabledialogHeader': 'Insert Table',
|
|
2728
2728
|
'tableWidth': 'Width',
|
|
2729
2729
|
'cellpadding': 'Cell Padding',
|
|
@@ -2737,7 +2737,7 @@ var defaultLocale = {
|
|
|
2737
2737
|
'createTable': 'Create Table',
|
|
2738
2738
|
'removeTable': 'Remove Table',
|
|
2739
2739
|
'tableHeader': 'Header Row',
|
|
2740
|
-
'tableRemove': 'Delete',
|
|
2740
|
+
'tableRemove': 'Delete Table',
|
|
2741
2741
|
'tableCellBackground': 'Table Cell Background',
|
|
2742
2742
|
'tableEditProperties': 'Table Edit Properties',
|
|
2743
2743
|
'styles': 'Styles',
|
|
@@ -2799,11 +2799,11 @@ var defaultLocale = {
|
|
|
2799
2799
|
'fontNameTimesNewRoman': 'Times New Roman',
|
|
2800
2800
|
'fontNameVerdana': 'Verdana',
|
|
2801
2801
|
'numberFormatListNumber': 'Number',
|
|
2802
|
-
'numberFormatListLowerAlpha': '
|
|
2803
|
-
'numberFormatListUpperAlpha': '
|
|
2804
|
-
'numberFormatListLowerRoman': '
|
|
2805
|
-
'numberFormatListUpperRoman': '
|
|
2806
|
-
'numberFormatListLowerGreek': '
|
|
2802
|
+
'numberFormatListLowerAlpha': 'Lower Alpha',
|
|
2803
|
+
'numberFormatListUpperAlpha': 'Upper Alpha',
|
|
2804
|
+
'numberFormatListLowerRoman': 'Lower Roman',
|
|
2805
|
+
'numberFormatListUpperRoman': 'Upper Roman',
|
|
2806
|
+
'numberFormatListLowerGreek': 'Lower Greek',
|
|
2807
2807
|
'bulletFormatListDisc': 'Disc',
|
|
2808
2808
|
'bulletFormatListCircle': 'Circle',
|
|
2809
2809
|
'bulletFormatListSquare': 'Square',
|
|
@@ -2817,7 +2817,10 @@ var defaultLocale = {
|
|
|
2817
2817
|
'emojiPickerNoResultFound': 'No results found',
|
|
2818
2818
|
'emojiPickerTrySomethingElse': 'Try something else',
|
|
2819
2819
|
'linkAriaLabel': 'Open in new window',
|
|
2820
|
-
'unsupportedImage': 'Unsupported file format'
|
|
2820
|
+
'unsupportedImage': 'Unsupported file format',
|
|
2821
|
+
'mergecells': 'Merge cells',
|
|
2822
|
+
'verticalsplit': 'Vertical split',
|
|
2823
|
+
'horizontalsplit': 'Horizontal split'
|
|
2821
2824
|
};
|
|
2822
2825
|
var toolsLocale = {
|
|
2823
2826
|
'alignments': 'alignments',
|
|
@@ -3209,7 +3212,12 @@ function setToolbarStatus(e, isPopToolbar, self) {
|
|
|
3209
3212
|
}
|
|
3210
3213
|
case 'bulletFormatList':
|
|
3211
3214
|
case 'numberFormatList': {
|
|
3212
|
-
|
|
3215
|
+
if (value !== '') {
|
|
3216
|
+
addClass([e.tbElements[j]], [CLS_ACTIVE]);
|
|
3217
|
+
}
|
|
3218
|
+
else {
|
|
3219
|
+
removeClass([e.tbElements[j]], [CLS_ACTIVE]);
|
|
3220
|
+
}
|
|
3213
3221
|
}
|
|
3214
3222
|
}
|
|
3215
3223
|
}
|
|
@@ -3451,7 +3459,8 @@ function updateTextNode(value, rteObj) {
|
|
|
3451
3459
|
imageElm[i].classList.add(CLS_RTE_IMAGE);
|
|
3452
3460
|
}
|
|
3453
3461
|
if (!(imageElm[i].classList.contains(CLS_IMGINLINE) ||
|
|
3454
|
-
imageElm[i].classList.contains(CLS_IMGBREAK))
|
|
3462
|
+
imageElm[i].classList.contains(CLS_IMGBREAK)) &&
|
|
3463
|
+
!(imageElm[i].classList.contains('e-imgleft') || imageElm[i].classList.contains('e-imgright') || imageElm[i].classList.contains('e-imgcenter'))) {
|
|
3455
3464
|
imageElm[i].classList.add(CLS_IMGINLINE);
|
|
3456
3465
|
}
|
|
3457
3466
|
}
|
|
@@ -3600,6 +3609,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3600
3609
|
ToolbarRenderer.prototype.wireEvent = function () {
|
|
3601
3610
|
this.parent.on(destroy, this.unWireEvent, this);
|
|
3602
3611
|
this.parent.on(destroyTooltip, this.destroyTooltip, this);
|
|
3612
|
+
this.parent.on(closeTooltip, this.closeTooltip, this);
|
|
3603
3613
|
};
|
|
3604
3614
|
ToolbarRenderer.prototype.destroyTooltip = function () {
|
|
3605
3615
|
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
@@ -3612,6 +3622,8 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3612
3622
|
};
|
|
3613
3623
|
ToolbarRenderer.prototype.unWireEvent = function () {
|
|
3614
3624
|
this.parent.off(destroy, this.unWireEvent);
|
|
3625
|
+
this.parent.off(destroyTooltip, this.destroyTooltip);
|
|
3626
|
+
this.parent.off(closeTooltip, this.closeTooltip);
|
|
3615
3627
|
};
|
|
3616
3628
|
ToolbarRenderer.prototype.toolbarBeforeCreate = function (e) {
|
|
3617
3629
|
if (this.mode === 'Extended') {
|
|
@@ -3732,7 +3744,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3732
3744
|
windowCollision: true,
|
|
3733
3745
|
position: 'BottomCenter'
|
|
3734
3746
|
});
|
|
3735
|
-
this.tooltip.appendTo(args.target);
|
|
3747
|
+
this.tooltip.appendTo(args.target.parentElement);
|
|
3736
3748
|
}
|
|
3737
3749
|
};
|
|
3738
3750
|
/**
|
|
@@ -3864,6 +3876,32 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3864
3876
|
popupElement.setAttribute('aria-owns', this.parent.getID());
|
|
3865
3877
|
return dropDown;
|
|
3866
3878
|
};
|
|
3879
|
+
ToolbarRenderer.prototype.mouseOutHandler = function () {
|
|
3880
|
+
if (!isNullOrUndefined(this.tooltipTargetEle)) {
|
|
3881
|
+
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
3882
|
+
}
|
|
3883
|
+
else {
|
|
3884
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
3885
|
+
this.parent.contentModule.getDocument();
|
|
3886
|
+
this.tooltipTargetEle = currentDocument.querySelector('[data-title]');
|
|
3887
|
+
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
3888
|
+
}
|
|
3889
|
+
this.tooltipTargetEle.removeAttribute('data-title');
|
|
3890
|
+
EventHandler.remove(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler);
|
|
3891
|
+
};
|
|
3892
|
+
ToolbarRenderer.prototype.closeTooltip = function (args) {
|
|
3893
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
3894
|
+
this.parent.contentModule.getDocument();
|
|
3895
|
+
this.tooltipTargetEle = closest(args.target, '[data-tooltip-id]');
|
|
3896
|
+
if (!isNullOrUndefined(this.tooltipTargetEle) && this.parent.showTooltip && !isNullOrUndefined(currentDocument.querySelector('.e-tooltip-wrap'))) {
|
|
3897
|
+
this.destroyTooltip();
|
|
3898
|
+
if (!this.tooltipTargetEle.closest('.e-rte-quick-popup')) {
|
|
3899
|
+
this.tooltipTargetEle.setAttribute('data-title', this.tooltipTargetEle.getAttribute('title'));
|
|
3900
|
+
this.tooltipTargetEle.removeAttribute('title');
|
|
3901
|
+
EventHandler.add(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler, this);
|
|
3902
|
+
}
|
|
3903
|
+
}
|
|
3904
|
+
};
|
|
3867
3905
|
/**
|
|
3868
3906
|
* renderListDropDown method
|
|
3869
3907
|
*
|
|
@@ -3873,6 +3911,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3873
3911
|
* @deprecated
|
|
3874
3912
|
*/
|
|
3875
3913
|
ToolbarRenderer.prototype.renderListDropDown = function (args) {
|
|
3914
|
+
var _this = this;
|
|
3876
3915
|
// eslint-disable-next-line
|
|
3877
3916
|
var proxy = this;
|
|
3878
3917
|
var css = CLS_RTE_ELEMENTS + ' ' + CLS_TB_BTN + ((this.parent.inlineMode) ? (' ' + CLS_INLINE_DROPDOWN) : '');
|
|
@@ -3888,6 +3927,35 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3888
3927
|
enableRtl: this.parent.enableRtl,
|
|
3889
3928
|
select: this.dropDownSelected.bind(this),
|
|
3890
3929
|
beforeOpen: function (args) {
|
|
3930
|
+
if (proxy.parent.editorMode !== 'Markdown') {
|
|
3931
|
+
var startNode = proxy.parent.getRange().startContainer.parentElement;
|
|
3932
|
+
var listElem = startNode.closest('LI');
|
|
3933
|
+
var currentLiElem = !isNullOrUndefined(listElem) ? listElem.parentElement : null;
|
|
3934
|
+
if (!isNullOrUndefined(currentLiElem) && (currentLiElem.nodeName === 'OL' || currentLiElem.nodeName === 'UL')) {
|
|
3935
|
+
if (currentLiElem.nodeName === 'UL' && args.items[0].subCommand === 'NumberFormatList') {
|
|
3936
|
+
addClass([args.element.childNodes[0]], 'e-active');
|
|
3937
|
+
}
|
|
3938
|
+
else if (currentLiElem.nodeName === 'OL' && args.items[0].subCommand === 'BulletFormatList') {
|
|
3939
|
+
addClass([args.element.childNodes[0]], 'e-active');
|
|
3940
|
+
}
|
|
3941
|
+
else {
|
|
3942
|
+
var currentListStyle = currentLiElem.style.listStyleType.split('-').join('').toLocaleLowerCase();
|
|
3943
|
+
currentListStyle = currentListStyle === 'decimal' ? 'number' : currentListStyle;
|
|
3944
|
+
for (var index = 0; index < args.element.childNodes.length; index++) {
|
|
3945
|
+
if (currentListStyle === args.element.childNodes[index].innerHTML.split(' ').join('').toLocaleLowerCase()) {
|
|
3946
|
+
addClass([args.element.childNodes[index]], 'e-active');
|
|
3947
|
+
}
|
|
3948
|
+
else if (currentListStyle === '') {
|
|
3949
|
+
addClass([args.element.childNodes[index]], 'e-active');
|
|
3950
|
+
}
|
|
3951
|
+
}
|
|
3952
|
+
}
|
|
3953
|
+
}
|
|
3954
|
+
else {
|
|
3955
|
+
addClass([args.element.childNodes[0]], 'e-active');
|
|
3956
|
+
}
|
|
3957
|
+
}
|
|
3958
|
+
_this.closeTooltip({ target: args.event.target });
|
|
3891
3959
|
if (proxy.parent.readonly || !proxy.parent.enabled) {
|
|
3892
3960
|
args.cancel = true;
|
|
3893
3961
|
return;
|
|
@@ -4304,23 +4372,13 @@ var BaseToolbar = /** @__PURE__ @class */ (function () {
|
|
|
4304
4372
|
case '-':
|
|
4305
4373
|
return { type: 'Separator', cssClass: CLS_HR_SEPARATOR };
|
|
4306
4374
|
default:
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
};
|
|
4315
|
-
}
|
|
4316
|
-
else {
|
|
4317
|
-
return {
|
|
4318
|
-
id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
|
|
4319
|
-
prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
|
|
4320
|
-
command: this.tools[itemStr.toLocaleLowerCase()].command,
|
|
4321
|
-
subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
|
|
4322
|
-
};
|
|
4323
|
-
}
|
|
4375
|
+
return {
|
|
4376
|
+
id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
|
|
4377
|
+
prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
|
|
4378
|
+
tooltipText: getTooltipText(itemStr, this.locator),
|
|
4379
|
+
command: this.tools[itemStr.toLocaleLowerCase()].command,
|
|
4380
|
+
subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
|
|
4381
|
+
};
|
|
4324
4382
|
}
|
|
4325
4383
|
}
|
|
4326
4384
|
};
|
|
@@ -4373,17 +4431,21 @@ var BaseToolbar = /** @__PURE__ @class */ (function () {
|
|
|
4373
4431
|
var item = tbItems_1[_i];
|
|
4374
4432
|
_loop_1(item);
|
|
4375
4433
|
}
|
|
4376
|
-
|
|
4377
|
-
var
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4434
|
+
if (this.parent.showTooltip) {
|
|
4435
|
+
for (var num = 0; num < items.length; num++) {
|
|
4436
|
+
var tooltipText = items[num].tooltipText;
|
|
4437
|
+
var shortCutKey = void 0;
|
|
4438
|
+
if (windowKeys["" + tooltipText]) {
|
|
4439
|
+
shortCutKey = window.navigator.platform.toLocaleLowerCase().includes('mac') ? windowKeys["" + tooltipText].replace('Ctrl', 'Cmd') : windowKeys["" + tooltipText];
|
|
4440
|
+
}
|
|
4441
|
+
else {
|
|
4442
|
+
shortCutKey = tooltipText;
|
|
4443
|
+
}
|
|
4444
|
+
if (shortCutKey) {
|
|
4445
|
+
if (!(items[num].command === "Images" && items[num].subCommand === "InsertLink")) {
|
|
4446
|
+
items[num].tooltipText = (tooltipText !== shortCutKey) ? tooltipText + ' (' + shortCutKey + ')' : tooltipText;
|
|
4447
|
+
}
|
|
4448
|
+
}
|
|
4387
4449
|
}
|
|
4388
4450
|
}
|
|
4389
4451
|
return items;
|
|
@@ -4433,7 +4495,7 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
|
|
|
4433
4495
|
addClass([args.element], item.cssClass);
|
|
4434
4496
|
}
|
|
4435
4497
|
if (item.command === 'Images' || item.command === 'Videos' || item.command === 'Audios' || item.command === 'Table') {
|
|
4436
|
-
args.element.setAttribute('title', getQuickToolbarTooltipText(item.text));
|
|
4498
|
+
args.element.setAttribute('title', getQuickToolbarTooltipText(item.text) !== '' ? getQuickToolbarTooltipText(item.text) : item.text);
|
|
4437
4499
|
}
|
|
4438
4500
|
if (item.command === 'Alignments' || item.subCommand === 'JustifyLeft'
|
|
4439
4501
|
|| item.subCommand === 'JustifyRight' || item.subCommand === 'JustifyCenter') {
|
|
@@ -4443,13 +4505,13 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
|
|
|
4443
4505
|
args.element.setAttribute('title', getTooltipTextDropdownItems(item.subCommand.toLocaleLowerCase(), this.locator, formatsLocale));
|
|
4444
4506
|
}
|
|
4445
4507
|
if (item.command === 'Font') {
|
|
4446
|
-
args.element.setAttribute('title', getTooltipTextDropdownItems(item.
|
|
4508
|
+
args.element.setAttribute('title', getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, fontNameLocale) !== '' ? getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, fontNameLocale) : item.text);
|
|
4447
4509
|
}
|
|
4448
4510
|
if (item.subCommand === 'BulletFormatList') {
|
|
4449
|
-
args.element.setAttribute('title', getTooltipTextDropdownItems(item.
|
|
4511
|
+
args.element.setAttribute('title', getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, bulletFormatListLocale) !== '' ? getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, bulletFormatListLocale) : item.text);
|
|
4450
4512
|
}
|
|
4451
4513
|
if (item.subCommand === 'NumberFormatList') {
|
|
4452
|
-
args.element.setAttribute('title', getTooltipTextDropdownItems(item.text.
|
|
4514
|
+
args.element.setAttribute('title', (getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, numberFormatListLocale)) !== '' ? getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, numberFormatListLocale) : item.text);
|
|
4453
4515
|
}
|
|
4454
4516
|
if (item.subCommand === 'FontSize') {
|
|
4455
4517
|
args.element.setAttribute('title', getTooltipTextDropdownItems(item.value.toLocaleLowerCase(), null, null, this.parent));
|
|
@@ -5259,72 +5321,14 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5259
5321
|
}
|
|
5260
5322
|
};
|
|
5261
5323
|
Toolbar$$1.prototype.toggleFloatClass = function (e) {
|
|
5262
|
-
var topValue;
|
|
5263
|
-
var isBody = false;
|
|
5264
|
-
var isFloat = false;
|
|
5265
|
-
var scrollParent;
|
|
5266
5324
|
var floatOffset = this.parent.floatingToolbarOffset;
|
|
5267
|
-
if (
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
else if (e && e.target !== document) {
|
|
5271
|
-
scrollParent = e.target;
|
|
5272
|
-
}
|
|
5273
|
-
else {
|
|
5274
|
-
isBody = true;
|
|
5275
|
-
scrollParent = document.body;
|
|
5276
|
-
}
|
|
5277
|
-
var tbHeight = this.getToolbarHeight() + this.getExpandTBarPopHeight();
|
|
5278
|
-
if (this.isTransformChild) {
|
|
5279
|
-
topValue = 0;
|
|
5280
|
-
var scrollParentRelativeTop = 0;
|
|
5281
|
-
var trgHeight = this.parent.element.offsetHeight;
|
|
5282
|
-
if (isBody) {
|
|
5283
|
-
var bodyStyle = window.getComputedStyle(scrollParent);
|
|
5284
|
-
scrollParentRelativeTop = parseFloat(bodyStyle.marginTop.split('px')[0]) + parseFloat(bodyStyle.paddingTop.split('px')[0]);
|
|
5285
|
-
}
|
|
5286
|
-
var targetTop = this.parent.element.getBoundingClientRect().top;
|
|
5287
|
-
var scrollParentYOffset = (Browser.isMSPointer && isBody) ? window.pageYOffset : scrollParent.parentElement.scrollTop;
|
|
5288
|
-
var scrollParentRect = scrollParent.getBoundingClientRect();
|
|
5289
|
-
var scrollParentTop = (!isBody) ? scrollParentRect.top : (scrollParentRect.top + scrollParentYOffset);
|
|
5290
|
-
var outOfRange = ((targetTop - ((!isBody) ? scrollParentTop : 0))
|
|
5291
|
-
+ trgHeight > tbHeight + floatOffset) ? false : true;
|
|
5292
|
-
if (targetTop > (scrollParentTop + floatOffset) || targetTop < -trgHeight || ((targetTop < 0) ? outOfRange : false)) {
|
|
5293
|
-
isFloat = false;
|
|
5294
|
-
removeClass([this.tbElement], [CLS_TB_ABS_FLOAT]);
|
|
5295
|
-
}
|
|
5296
|
-
else if (targetTop < (scrollParentTop + floatOffset)) {
|
|
5297
|
-
if (targetTop < 0) {
|
|
5298
|
-
topValue = (-targetTop) + scrollParentTop;
|
|
5299
|
-
}
|
|
5300
|
-
else {
|
|
5301
|
-
topValue = scrollParentTop - targetTop;
|
|
5302
|
-
}
|
|
5303
|
-
topValue = (isBody) ? topValue - scrollParentRelativeTop : topValue;
|
|
5304
|
-
addClass([this.tbElement], [CLS_TB_ABS_FLOAT]);
|
|
5305
|
-
isFloat = true;
|
|
5306
|
-
}
|
|
5325
|
+
if (this.parent.toolbarSettings.enableFloating) {
|
|
5326
|
+
addClass([this.tbElement.parentElement], [CLS_TB_FLOAT]);
|
|
5327
|
+
setStyleAttribute(this.tbElement.parentElement, { top: (floatOffset) + 'px' });
|
|
5307
5328
|
}
|
|
5308
5329
|
else {
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
return;
|
|
5312
|
-
}
|
|
5313
|
-
topValue = (e && e.target !== document) ? scrollParent.getBoundingClientRect().top : 0;
|
|
5314
|
-
if ((parent_1.bottom < (floatOffset + tbHeight + topValue)) || parent_1.bottom < 0 || parent_1.top > floatOffset + topValue) {
|
|
5315
|
-
isFloat = false;
|
|
5316
|
-
}
|
|
5317
|
-
else if (parent_1.top < floatOffset || parent_1.top < floatOffset + topValue) {
|
|
5318
|
-
isFloat = true;
|
|
5319
|
-
}
|
|
5320
|
-
}
|
|
5321
|
-
if (!isFloat) {
|
|
5322
|
-
removeClass([this.tbElement], [CLS_TB_FLOAT]);
|
|
5323
|
-
setStyleAttribute(this.tbElement, { top: 0 + 'px', width: '100%' });
|
|
5324
|
-
}
|
|
5325
|
-
else {
|
|
5326
|
-
addClass([this.tbElement], [CLS_TB_FLOAT]);
|
|
5327
|
-
setStyleAttribute(this.tbElement, { width: this.parent.element.offsetWidth + 'px', top: (floatOffset + topValue) + 'px' });
|
|
5330
|
+
removeClass([this.tbElement.parentElement], [CLS_TB_FLOAT]);
|
|
5331
|
+
setStyleAttribute(this.tbElement.parentElement, { top: '' });
|
|
5328
5332
|
}
|
|
5329
5333
|
};
|
|
5330
5334
|
Toolbar$$1.prototype.renderToolbar = function () {
|
|
@@ -5630,19 +5634,6 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5630
5634
|
this.toolbarActionModule.parent = null;
|
|
5631
5635
|
this.dropDownModule.parent = null;
|
|
5632
5636
|
};
|
|
5633
|
-
Toolbar$$1.prototype.scrollHandler = function (e) {
|
|
5634
|
-
if (!this.parent.inlineMode.enable) {
|
|
5635
|
-
if (this.parent.toolbarSettings.enableFloating && this.getDOMVisibility(this.tbElement)) {
|
|
5636
|
-
this.toggleFloatClass(e.args);
|
|
5637
|
-
}
|
|
5638
|
-
}
|
|
5639
|
-
};
|
|
5640
|
-
Toolbar$$1.prototype.getDOMVisibility = function (el) {
|
|
5641
|
-
if (!el.offsetParent && el.offsetWidth === 0 && el.offsetHeight === 0) {
|
|
5642
|
-
return false;
|
|
5643
|
-
}
|
|
5644
|
-
return true;
|
|
5645
|
-
};
|
|
5646
5637
|
Toolbar$$1.prototype.mouseDownHandler = function () {
|
|
5647
5638
|
if (Browser.isDevice && this.parent.inlineMode.enable && !isIDevice()) {
|
|
5648
5639
|
this.showFixedTBar();
|
|
@@ -5679,11 +5670,6 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5679
5670
|
};
|
|
5680
5671
|
Toolbar$$1.prototype.adjustContentHeight = function (trg, isKeyboard) {
|
|
5681
5672
|
if (trg && this.parent.toolbarSettings.type === ToolbarType.Expand && !isNullOrUndefined(trg)) {
|
|
5682
|
-
var extendedTbar = this.tbElement.querySelector('.e-toolbar-extended');
|
|
5683
|
-
if (!isNullOrUndefined(extendedTbar)) {
|
|
5684
|
-
setStyleAttribute(extendedTbar, { maxHeight: '', display: 'block' });
|
|
5685
|
-
setStyleAttribute(extendedTbar, { maxHeight: extendedTbar.offsetHeight + 'px', display: '' });
|
|
5686
|
-
}
|
|
5687
5673
|
var hasActiveClass = trg.classList.contains('e-nav-active');
|
|
5688
5674
|
var isExpand = isKeyboard ? (hasActiveClass ? false : true) : (hasActiveClass ? true : false);
|
|
5689
5675
|
if (isExpand) {
|
|
@@ -5692,7 +5678,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5692
5678
|
else {
|
|
5693
5679
|
removeClass([this.tbElement], [CLS_EXPAND_OPEN]);
|
|
5694
5680
|
}
|
|
5695
|
-
this.parent.setContentHeight('
|
|
5681
|
+
this.parent.setContentHeight('Toolbar', isExpand);
|
|
5696
5682
|
}
|
|
5697
5683
|
else if (Browser.isDevice || this.parent.inlineMode.enable) {
|
|
5698
5684
|
this.isToolbar = true;
|
|
@@ -5717,7 +5703,6 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5717
5703
|
this.dropDownModule = new DropDownButtons(this.parent, this.locator);
|
|
5718
5704
|
this.toolbarActionModule = new ToolbarAction(this.parent);
|
|
5719
5705
|
this.parent.on(initialEnd, this.renderToolbar, this);
|
|
5720
|
-
this.parent.on(scroll, this.scrollHandler, this);
|
|
5721
5706
|
this.parent.on(bindOnEnd, this.toolbarBindEvent, this);
|
|
5722
5707
|
this.parent.on(toolbarUpdated, this.updateToolbarStatus, this);
|
|
5723
5708
|
this.parent.on(modelChanged, this.onPropertyChanged, this);
|
|
@@ -5742,7 +5727,6 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5742
5727
|
return;
|
|
5743
5728
|
}
|
|
5744
5729
|
this.parent.off(initialEnd, this.renderToolbar);
|
|
5745
|
-
this.parent.off(scroll, this.scrollHandler);
|
|
5746
5730
|
this.parent.off(bindOnEnd, this.toolbarBindEvent);
|
|
5747
5731
|
this.parent.off(toolbarUpdated, this.updateToolbarStatus);
|
|
5748
5732
|
this.parent.off(modelChanged, this.onPropertyChanged);
|
|
@@ -5777,7 +5761,8 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5777
5761
|
if (!this.parent.inlineMode.enable) {
|
|
5778
5762
|
this.refreshToolbarOverflow();
|
|
5779
5763
|
}
|
|
5780
|
-
this.parent.
|
|
5764
|
+
var isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
5765
|
+
this.parent.setContentHeight('Refresh', isExpand);
|
|
5781
5766
|
};
|
|
5782
5767
|
/**
|
|
5783
5768
|
* Called internally if any of the property value changed.
|
|
@@ -5798,6 +5783,11 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5798
5783
|
}
|
|
5799
5784
|
}
|
|
5800
5785
|
}
|
|
5786
|
+
if (!isNullOrUndefined(e.newProp.toolbarSettings)) {
|
|
5787
|
+
if (!isNullOrUndefined(e.newProp.toolbarSettings.enableFloating)) {
|
|
5788
|
+
this.toggleFloatClass();
|
|
5789
|
+
}
|
|
5790
|
+
}
|
|
5801
5791
|
if (e.module !== this.getModuleName()) {
|
|
5802
5792
|
return;
|
|
5803
5793
|
}
|
|
@@ -6322,7 +6312,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6322
6312
|
function BaseQuickToolbar(parent, locator) {
|
|
6323
6313
|
this.parent = parent;
|
|
6324
6314
|
this.locator = locator;
|
|
6325
|
-
this.
|
|
6315
|
+
this.isRendered = false;
|
|
6326
6316
|
this.renderFactory = this.locator.getService('rendererFactory');
|
|
6327
6317
|
this.contentRenderer = this.renderFactory.getRenderer(RenderType.Content);
|
|
6328
6318
|
this.popupRenderer = this.renderFactory.getRenderer(RenderType.Popup);
|
|
@@ -6386,7 +6376,18 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6386
6376
|
e.target.classList.contains('e-imgbreak')) ? false : true;
|
|
6387
6377
|
var target = !isNullOrUndefined(imgWrapper) ? imgWrapper : e.target;
|
|
6388
6378
|
addClass([this.toolbarElement], [CLS_RM_WHITE_SPACE]);
|
|
6389
|
-
var targetOffsetTop
|
|
6379
|
+
var targetOffsetTop;
|
|
6380
|
+
if (!isNullOrUndefined(closest(target, 'table'))) {
|
|
6381
|
+
targetOffsetTop = target.offsetTop;
|
|
6382
|
+
var parentTable = closest(target, 'table');
|
|
6383
|
+
while (!isNullOrUndefined(parentTable)) {
|
|
6384
|
+
targetOffsetTop += parentTable.offsetTop;
|
|
6385
|
+
parentTable = closest(parentTable.parentElement, 'table');
|
|
6386
|
+
}
|
|
6387
|
+
}
|
|
6388
|
+
else {
|
|
6389
|
+
targetOffsetTop = (target.classList.contains("e-rte-audio")) ? target.parentElement.offsetTop : target.offsetTop;
|
|
6390
|
+
}
|
|
6390
6391
|
var parentOffsetTop = window.pageYOffset + e.parentData.top;
|
|
6391
6392
|
if ((targetOffsetTop - e.editTop) > e.popHeight) {
|
|
6392
6393
|
y = parentOffsetTop + e.tBarElementHeight + (targetOffsetTop - e.editTop) - e.popHeight - 5;
|
|
@@ -6398,11 +6399,30 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6398
6399
|
y = e.y;
|
|
6399
6400
|
}
|
|
6400
6401
|
target = isAligned ? e.target : target;
|
|
6401
|
-
|
|
6402
|
-
|
|
6402
|
+
var targetOffsetLeft;
|
|
6403
|
+
var currentOffsetWidth;
|
|
6404
|
+
if (!isNullOrUndefined(closest(target, 'table'))) {
|
|
6405
|
+
targetOffsetLeft = target.offsetLeft;
|
|
6406
|
+
var parentTable = closest(target, 'table');
|
|
6407
|
+
var checkOffSetParentWidth = false;
|
|
6408
|
+
if (!isNullOrUndefined(closest(parentTable, 'TD'))) {
|
|
6409
|
+
checkOffSetParentWidth = true;
|
|
6410
|
+
}
|
|
6411
|
+
while (!isNullOrUndefined(parentTable)) {
|
|
6412
|
+
targetOffsetLeft += parentTable.offsetLeft;
|
|
6413
|
+
currentOffsetWidth = checkOffSetParentWidth ? parentTable.offsetWidth : target.offsetWidth;
|
|
6414
|
+
parentTable = closest(parentTable.parentElement, 'table');
|
|
6415
|
+
}
|
|
6416
|
+
}
|
|
6417
|
+
else {
|
|
6418
|
+
currentOffsetWidth = target.offsetWidth;
|
|
6419
|
+
targetOffsetLeft = (target.classList.contains("e-rte-audio")) ? target.parentElement.offsetLeft : target.offsetLeft;
|
|
6420
|
+
}
|
|
6421
|
+
if (currentOffsetWidth > e.popWidth) {
|
|
6422
|
+
x = (currentOffsetWidth / 2) - (e.popWidth / 2) + e.parentData.left + targetOffsetLeft;
|
|
6403
6423
|
}
|
|
6404
6424
|
else {
|
|
6405
|
-
x = e.parentData.left +
|
|
6425
|
+
x = e.parentData.left + targetOffsetLeft;
|
|
6406
6426
|
}
|
|
6407
6427
|
this.popupObj.position.X = ((x + e.popWidth) > e.parentData.right) ? e.parentData.right - e.popWidth : x;
|
|
6408
6428
|
this.popupObj.position.Y = (y >= 0) ? y : e.y + 5;
|
|
@@ -6530,6 +6550,9 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6530
6550
|
_this.parent.disableToolbarItem(_this.parent.toolbarSettings.items);
|
|
6531
6551
|
_this.parent.enableToolbarItem(['Undo', 'Redo']);
|
|
6532
6552
|
}
|
|
6553
|
+
else {
|
|
6554
|
+
_this.parent.enableToolbarItem(_this.parent.toolbarSettings.items);
|
|
6555
|
+
}
|
|
6533
6556
|
append([_this.element], document.body);
|
|
6534
6557
|
if (_this.parent.showTooltip) {
|
|
6535
6558
|
_this.tooltip = new Tooltip({
|
|
@@ -6537,7 +6560,8 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6537
6560
|
openDelay: 400,
|
|
6538
6561
|
showTipPointer: true,
|
|
6539
6562
|
windowCollision: true,
|
|
6540
|
-
position: 'BottomCenter'
|
|
6563
|
+
position: 'BottomCenter',
|
|
6564
|
+
cssClass: _this.parent.getCssClass()
|
|
6541
6565
|
});
|
|
6542
6566
|
_this.tooltip.appendTo(_this.element);
|
|
6543
6567
|
}
|
|
@@ -6571,7 +6595,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6571
6595
|
parentData: parent_1.getBoundingClientRect(),
|
|
6572
6596
|
tBarElementHeight: tBarHeight
|
|
6573
6597
|
};
|
|
6574
|
-
if ((target.tagName === 'IMG' || target.tagName === 'AUDIO' || target.tagName === 'VIDEO' || target.tagName === 'IFRAME' || (target.classList &&
|
|
6598
|
+
if ((closest(target, 'TABLE') || target.tagName === 'IMG' || target.tagName === 'AUDIO' || target.tagName === 'VIDEO' || target.tagName === 'IFRAME' || (target.classList &&
|
|
6575
6599
|
(target.classList.contains(CLS_AUDIOWRAP) || target.classList.contains(CLS_CLICKELEM) ||
|
|
6576
6600
|
target.classList.contains(CLS_VID_CLICK_ELEM)))) && (x == beforeQuickToolbarArgs.positionX || y == beforeQuickToolbarArgs.positionY)) {
|
|
6577
6601
|
_this.setPosition(showPopupData);
|
|
@@ -6591,7 +6615,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6591
6615
|
maxWidth: window.outerWidth + 'px'
|
|
6592
6616
|
});
|
|
6593
6617
|
addClass([_this.element], [CLS_POP]);
|
|
6594
|
-
_this.
|
|
6618
|
+
_this.isRendered = true;
|
|
6595
6619
|
}
|
|
6596
6620
|
});
|
|
6597
6621
|
};
|
|
@@ -6631,7 +6655,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6631
6655
|
this.parent.notify(destroyTooltip, { args: event });
|
|
6632
6656
|
}
|
|
6633
6657
|
this.removeEleFromDOM();
|
|
6634
|
-
this.
|
|
6658
|
+
this.isRendered = false;
|
|
6635
6659
|
};
|
|
6636
6660
|
/**
|
|
6637
6661
|
* @param {string} item - specifies the string value
|
|
@@ -6654,7 +6678,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6654
6678
|
};
|
|
6655
6679
|
BaseQuickToolbar.prototype.removeEleFromDOM = function () {
|
|
6656
6680
|
var element = this.popupObj.element;
|
|
6657
|
-
if (this.
|
|
6681
|
+
if (this.isRendered) {
|
|
6658
6682
|
this.dropDownButtons.destroyDropDowns();
|
|
6659
6683
|
this.colorPickerObj.destroyColorPicker();
|
|
6660
6684
|
removeClass([this.element], [CLS_POP]);
|
|
@@ -6980,7 +7004,7 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6980
7004
|
* @deprecated
|
|
6981
7005
|
*/
|
|
6982
7006
|
QuickToolbar.prototype.showInlineQTBar = function (x, y, target) {
|
|
6983
|
-
if (isNullOrUndefined(this.parent) || this.parent.readonly || target.tagName.toLowerCase() === 'img') {
|
|
7007
|
+
if (isNullOrUndefined(this.parent) || this.parent.readonly || target.tagName.toLowerCase() === 'img' || this.inlineQTBar.element.querySelector('.e-rte-color-content')) {
|
|
6984
7008
|
return;
|
|
6985
7009
|
}
|
|
6986
7010
|
this.inlineQTBar.showPopup(x, y, target);
|
|
@@ -7069,6 +7093,9 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
7069
7093
|
}
|
|
7070
7094
|
}
|
|
7071
7095
|
if (!isNullOrUndefined(this.textQTBar) && !isNullOrUndefined(this.parent.quickToolbarSettings.text) && !this.parent.inlineMode.enable) {
|
|
7096
|
+
if (!isNullOrUndefined(e) && !isNullOrUndefined(e.name) && e.name === 'sourceCodeMouseDown') {
|
|
7097
|
+
return;
|
|
7098
|
+
}
|
|
7072
7099
|
var args = e.args.touches ?
|
|
7073
7100
|
e.args.changedTouches[0] : e.args;
|
|
7074
7101
|
var target = e.args.target;
|
|
@@ -7079,7 +7106,7 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
7079
7106
|
this.offsetY = pageYOffset(args, this.parent.element, this.parent.iframeSettings.enable);
|
|
7080
7107
|
var range = this.parent.getRange();
|
|
7081
7108
|
if ((range.endContainer.parentElement.tagName === range.startContainer.parentElement.tagName && (range.startContainer.parentElement.tagName === 'A' && range.endContainer.parentElement.tagName === 'A')) ||
|
|
7082
|
-
(target.tagName === 'IMG') || (target.tagName === 'VIDEO') || (target.tagName === 'AUDIO') || (target.childNodes[0].nodeType === 1 && target.childNodes[0].classList.contains('e-rte-audio')) ||
|
|
7109
|
+
(target.tagName === 'IMG') || (target.tagName === 'VIDEO') || (target.tagName === 'AUDIO') || (target.childNodes[0] && target.childNodes[0].nodeType === 1 && target.childNodes[0].classList.contains('e-rte-audio')) ||
|
|
7083
7110
|
(this.parent.getRange().startOffset === this.parent.getRange().endOffset)) {
|
|
7084
7111
|
return;
|
|
7085
7112
|
}
|
|
@@ -7087,13 +7114,16 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
7087
7114
|
this.textQTBar.showPopup(this.offsetX, this.offsetY, target, 'text');
|
|
7088
7115
|
}
|
|
7089
7116
|
};
|
|
7090
|
-
QuickToolbar.prototype.keyDownHandler = function () {
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
this.
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7117
|
+
QuickToolbar.prototype.keyDownHandler = function (e) {
|
|
7118
|
+
var preventHide = e.args.altKey;
|
|
7119
|
+
if (!preventHide) {
|
|
7120
|
+
if ((this.parent.inlineMode.enable && (!Browser.isDevice || isIDevice()))
|
|
7121
|
+
&& !isNullOrUndefined(select('.' + CLS_INLINE_POP, document))) {
|
|
7122
|
+
this.hideInlineQTBar();
|
|
7123
|
+
}
|
|
7124
|
+
if (this.textQTBar && !hasClass(this.textQTBar.element, 'e-popup-close')) {
|
|
7125
|
+
this.textQTBar.hidePopup();
|
|
7126
|
+
}
|
|
7097
7127
|
}
|
|
7098
7128
|
};
|
|
7099
7129
|
QuickToolbar.prototype.inlineQTBarMouseDownHandler = function () {
|
|
@@ -7421,6 +7451,15 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
7421
7451
|
QuickToolbar.prototype.getModuleName = function () {
|
|
7422
7452
|
return 'quickToolbar';
|
|
7423
7453
|
};
|
|
7454
|
+
/**
|
|
7455
|
+
*
|
|
7456
|
+
* @returns {BaseQuickToolbar[]} - specifies the quick toolbar instance.
|
|
7457
|
+
* @hidden
|
|
7458
|
+
* @private
|
|
7459
|
+
*/
|
|
7460
|
+
QuickToolbar.prototype.getQuickToolbarInstance = function () {
|
|
7461
|
+
return [this.linkQTBar, this.imageQTBar, this.audioQTBar, this.videoQTBar, this.tableQTBar, this.textQTBar, this.inlineQTBar];
|
|
7462
|
+
};
|
|
7424
7463
|
return QuickToolbar;
|
|
7425
7464
|
}());
|
|
7426
7465
|
|
|
@@ -9707,6 +9746,17 @@ var selfClosingTags = [
|
|
|
9707
9746
|
'BR',
|
|
9708
9747
|
'IMG'
|
|
9709
9748
|
];
|
|
9749
|
+
/**
|
|
9750
|
+
* Resize factor for image.
|
|
9751
|
+
* @hidden
|
|
9752
|
+
*
|
|
9753
|
+
*/
|
|
9754
|
+
var imageResizeFactor = {
|
|
9755
|
+
topLeft: [-1, -1],
|
|
9756
|
+
topRight: [1, -1],
|
|
9757
|
+
botRight: [1, 1],
|
|
9758
|
+
botLeft: [-1, 1]
|
|
9759
|
+
};
|
|
9710
9760
|
|
|
9711
9761
|
/**
|
|
9712
9762
|
* `Undo` module is used to handle undo actions.
|
|
@@ -10664,7 +10714,9 @@ var MarkdownEditor = /** @__PURE__ @class */ (function () {
|
|
|
10664
10714
|
MarkdownEditor.prototype.onToolbarClick = function (args) {
|
|
10665
10715
|
var item = args.item;
|
|
10666
10716
|
var textArea = this.parent.contentModule.getEditPanel();
|
|
10667
|
-
|
|
10717
|
+
if (item.command !== 'Formats') {
|
|
10718
|
+
textArea.focus();
|
|
10719
|
+
}
|
|
10668
10720
|
var startOffset = textArea.selectionStart;
|
|
10669
10721
|
var endOffset = textArea.selectionEnd;
|
|
10670
10722
|
var text = textArea.value.substring(startOffset, endOffset);
|
|
@@ -11987,11 +12039,12 @@ var DOMNode = /** @__PURE__ @class */ (function () {
|
|
|
11987
12039
|
/**
|
|
11988
12040
|
* blockNodes method
|
|
11989
12041
|
*
|
|
12042
|
+
* @param {boolean} action - Optional Boolean that specifies the action is whether performed.
|
|
11990
12043
|
* @returns {Node[]} - returns the node array values
|
|
11991
12044
|
* @hidden
|
|
11992
12045
|
* @deprecated
|
|
11993
12046
|
*/
|
|
11994
|
-
DOMNode.prototype.blockNodes = function () {
|
|
12047
|
+
DOMNode.prototype.blockNodes = function (action) {
|
|
11995
12048
|
var collectionNodes = [];
|
|
11996
12049
|
var selection = this.getSelection();
|
|
11997
12050
|
if (this.isEditorArea() && selection.rangeCount) {
|
|
@@ -12005,23 +12058,46 @@ var DOMNode = /** @__PURE__ @class */ (function () {
|
|
|
12005
12058
|
collectionNodes.push(startNode);
|
|
12006
12059
|
}
|
|
12007
12060
|
parentNode = this.blockParentNode(startNode);
|
|
12061
|
+
var endParentNode = this.blockParentNode(endNode);
|
|
12008
12062
|
if (parentNode && collectionNodes.indexOf(parentNode) < 0) {
|
|
12009
|
-
if (
|
|
12010
|
-
|
|
12011
|
-
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
|
|
12015
|
-
|
|
12016
|
-
|
|
12017
|
-
|
|
12063
|
+
if (!isNullOrUndefined(action) && action) {
|
|
12064
|
+
if (range.commonAncestorContainer.nodeName === 'TD' || parentNode.nodeName === 'TD' || endParentNode.nodeName === 'TD') {
|
|
12065
|
+
var processedNodes = this.getPreBlockNodeCollection(range);
|
|
12066
|
+
if (processedNodes.length > 1) {
|
|
12067
|
+
this.wrapWithBlockNode(processedNodes, collectionNodes);
|
|
12068
|
+
}
|
|
12069
|
+
else if (processedNodes.length > 0) {
|
|
12070
|
+
if (startNode !== endNode && startNode.nodeName !== 'BR') {
|
|
12071
|
+
collectionNodes.push(this.createTempNode(startNode));
|
|
12072
|
+
}
|
|
12073
|
+
else if (startNode === endNode && startNode.nodeName === 'SPAN' && (startNode.classList.contains(markerClassName.startSelection)
|
|
12074
|
+
|| startNode.classList.contains(markerClassName.endSelection))) {
|
|
12075
|
+
collectionNodes.push(this.createTempNode(startNode));
|
|
12076
|
+
}
|
|
12077
|
+
}
|
|
12018
12078
|
}
|
|
12019
12079
|
else {
|
|
12020
|
-
collectionNodes.push(
|
|
12080
|
+
collectionNodes.push(parentNode);
|
|
12021
12081
|
}
|
|
12022
12082
|
}
|
|
12023
12083
|
else {
|
|
12024
|
-
|
|
12084
|
+
if (IGNORE_BLOCK_TAGS.indexOf(parentNode.tagName.toLocaleLowerCase()) >= 0 && (startNode.tagName === 'BR' ||
|
|
12085
|
+
startNode.nodeType === Node.TEXT_NODE ||
|
|
12086
|
+
startNode.classList.contains(markerClassName.startSelection) ||
|
|
12087
|
+
startNode.classList.contains(markerClassName.endSelection))) {
|
|
12088
|
+
var tempNode = startNode.previousSibling &&
|
|
12089
|
+
startNode.previousSibling.nodeType === Node.TEXT_NODE ?
|
|
12090
|
+
startNode.previousSibling : startNode;
|
|
12091
|
+
if (!startNode.nextSibling && !startNode.previousSibling && startNode.tagName === 'BR') {
|
|
12092
|
+
collectionNodes.push(tempNode);
|
|
12093
|
+
}
|
|
12094
|
+
else {
|
|
12095
|
+
collectionNodes.push(this.createTempNode(tempNode));
|
|
12096
|
+
}
|
|
12097
|
+
}
|
|
12098
|
+
else {
|
|
12099
|
+
collectionNodes.push(parentNode);
|
|
12100
|
+
}
|
|
12025
12101
|
}
|
|
12026
12102
|
}
|
|
12027
12103
|
var nodes = [];
|
|
@@ -12090,6 +12166,131 @@ var DOMNode = /** @__PURE__ @class */ (function () {
|
|
|
12090
12166
|
DOMNode.prototype.ignoreTableTag = function (element) {
|
|
12091
12167
|
return !(TABLE_BLOCK_TAGS.indexOf(element.tagName.toLocaleLowerCase()) >= 0);
|
|
12092
12168
|
};
|
|
12169
|
+
DOMNode.prototype.getPreBlockNodeCollection = function (range) {
|
|
12170
|
+
var startNode = this.getSelectedNode(range.startContainer, range.startOffset);
|
|
12171
|
+
var endNode = this.getSelectedNode(range.endContainer, range.endOffset);
|
|
12172
|
+
var nodes = [];
|
|
12173
|
+
var rootNode = startNode.closest('td, th');
|
|
12174
|
+
if (isNullOrUndefined(rootNode)) {
|
|
12175
|
+
return nodes;
|
|
12176
|
+
}
|
|
12177
|
+
var rootChildNode = Array.from(rootNode.childNodes);
|
|
12178
|
+
var isContinue = true;
|
|
12179
|
+
var processedStart = this.getClosestInlineParent(startNode, rootNode, true);
|
|
12180
|
+
var processedEnd = this.getClosestInlineParent(endNode, rootNode, false);
|
|
12181
|
+
for (var i = 0; i < rootChildNode.length; i++) {
|
|
12182
|
+
var child = rootChildNode[i];
|
|
12183
|
+
if (processedStart === processedEnd && child === processedStart) {
|
|
12184
|
+
nodes.push(child);
|
|
12185
|
+
isContinue = true;
|
|
12186
|
+
}
|
|
12187
|
+
else if (child === processedStart) {
|
|
12188
|
+
isContinue = false;
|
|
12189
|
+
}
|
|
12190
|
+
else if (child === processedEnd) {
|
|
12191
|
+
nodes.push(child); // Early Exit so Push the end node.
|
|
12192
|
+
isContinue = true;
|
|
12193
|
+
}
|
|
12194
|
+
if (isContinue) {
|
|
12195
|
+
continue;
|
|
12196
|
+
}
|
|
12197
|
+
else {
|
|
12198
|
+
nodes.push(child);
|
|
12199
|
+
}
|
|
12200
|
+
}
|
|
12201
|
+
return nodes;
|
|
12202
|
+
};
|
|
12203
|
+
DOMNode.prototype.getClosestInlineParent = function (node, rootNode, isStart) {
|
|
12204
|
+
// 1. If the node is a text node, return the node
|
|
12205
|
+
// 2. If the node is a block node return block node
|
|
12206
|
+
// 3. If the node is a inline node,
|
|
12207
|
+
// Traverse back untill the TD or TH node
|
|
12208
|
+
// Check if the the previous sibling , next sibling is a block node.
|
|
12209
|
+
// If yes return the inline node that is closest to the block node.
|
|
12210
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
12211
|
+
return node;
|
|
12212
|
+
}
|
|
12213
|
+
if (this.isBlockNode(node)) {
|
|
12214
|
+
return node;
|
|
12215
|
+
}
|
|
12216
|
+
var currentNode = node;
|
|
12217
|
+
var rootFlag = false;
|
|
12218
|
+
while (currentNode) {
|
|
12219
|
+
var previousNode = currentNode;
|
|
12220
|
+
if (rootFlag) {
|
|
12221
|
+
if (this.isBlockNode(currentNode)) {
|
|
12222
|
+
return previousNode;
|
|
12223
|
+
}
|
|
12224
|
+
if (isStart && currentNode.previousSibling) {
|
|
12225
|
+
if (this.isBlockNode(currentNode.previousSibling) || currentNode.previousSibling.nodeName === 'BR') {
|
|
12226
|
+
return previousNode;
|
|
12227
|
+
}
|
|
12228
|
+
else {
|
|
12229
|
+
currentNode = currentNode.previousSibling;
|
|
12230
|
+
}
|
|
12231
|
+
}
|
|
12232
|
+
else if (!isStart && currentNode.nextSibling) {
|
|
12233
|
+
if (this.isBlockNode(currentNode.nextSibling) || currentNode.nextSibling.nodeName === 'BR') {
|
|
12234
|
+
return previousNode;
|
|
12235
|
+
}
|
|
12236
|
+
else {
|
|
12237
|
+
currentNode = currentNode.nextSibling;
|
|
12238
|
+
}
|
|
12239
|
+
}
|
|
12240
|
+
else {
|
|
12241
|
+
return currentNode;
|
|
12242
|
+
}
|
|
12243
|
+
}
|
|
12244
|
+
else {
|
|
12245
|
+
currentNode = currentNode.parentElement;
|
|
12246
|
+
if (currentNode === rootNode) {
|
|
12247
|
+
currentNode = previousNode;
|
|
12248
|
+
rootFlag = true;
|
|
12249
|
+
}
|
|
12250
|
+
}
|
|
12251
|
+
}
|
|
12252
|
+
return null;
|
|
12253
|
+
};
|
|
12254
|
+
DOMNode.prototype.wrapWithBlockNode = function (nodes, collectionNodes) {
|
|
12255
|
+
var wrapperElement = createElement('p');
|
|
12256
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
12257
|
+
var child = nodes[i];
|
|
12258
|
+
if (child.nodeName === 'BR') {
|
|
12259
|
+
child.parentNode.insertBefore(wrapperElement, child);
|
|
12260
|
+
wrapperElement.appendChild(child);
|
|
12261
|
+
if (wrapperElement.childNodes.length > 0) {
|
|
12262
|
+
collectionNodes.push(wrapperElement);
|
|
12263
|
+
}
|
|
12264
|
+
wrapperElement = createElement('p');
|
|
12265
|
+
}
|
|
12266
|
+
else {
|
|
12267
|
+
if (!this.isBlockNode(child)) {
|
|
12268
|
+
if (child.nodeName === '#text' && child.textContent.trim() === '') {
|
|
12269
|
+
continue;
|
|
12270
|
+
}
|
|
12271
|
+
if (wrapperElement.childElementCount === 0) {
|
|
12272
|
+
child.parentNode.insertBefore(wrapperElement, child);
|
|
12273
|
+
wrapperElement.appendChild(child);
|
|
12274
|
+
}
|
|
12275
|
+
else {
|
|
12276
|
+
wrapperElement.appendChild(child);
|
|
12277
|
+
}
|
|
12278
|
+
}
|
|
12279
|
+
else {
|
|
12280
|
+
collectionNodes.push(child);
|
|
12281
|
+
}
|
|
12282
|
+
// Use case when the BR is next sibling but the BR is not the part of selection.
|
|
12283
|
+
if ((i === nodes.length - 1) && wrapperElement.nextElementSibling &&
|
|
12284
|
+
wrapperElement.querySelectorAll('br').length === 0 &&
|
|
12285
|
+
wrapperElement.nextElementSibling.nodeName === 'BR') {
|
|
12286
|
+
wrapperElement.appendChild(wrapperElement.nextElementSibling);
|
|
12287
|
+
}
|
|
12288
|
+
}
|
|
12289
|
+
}
|
|
12290
|
+
if (wrapperElement.childNodes.length > 0 && collectionNodes.indexOf(wrapperElement) < 0) {
|
|
12291
|
+
collectionNodes.push(wrapperElement);
|
|
12292
|
+
}
|
|
12293
|
+
};
|
|
12093
12294
|
return DOMNode;
|
|
12094
12295
|
}());
|
|
12095
12296
|
|
|
@@ -12202,7 +12403,8 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12202
12403
|
startNode.textContent = '';
|
|
12203
12404
|
}
|
|
12204
12405
|
var startNodeParent = startNode.parentElement;
|
|
12205
|
-
|
|
12406
|
+
var parentOfCurrentOLUL = startNodeParent.parentElement;
|
|
12407
|
+
if (isNullOrUndefined(parentOfCurrentOLUL.closest('UL')) && isNullOrUndefined(parentOfCurrentOLUL.closest('OL'))) {
|
|
12206
12408
|
if (!isNullOrUndefined(startNode.nextElementSibling)) {
|
|
12207
12409
|
var nearBlockNode = this.parent.domNode.blockParentNode(startNode);
|
|
12208
12410
|
this.parent.nodeCutter.GetSpliceNode(range, nearBlockNode);
|
|
@@ -12229,6 +12431,15 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12229
12431
|
detach(startNode);
|
|
12230
12432
|
}
|
|
12231
12433
|
}
|
|
12434
|
+
// To handle the nested enter key press in the list for the first LI element
|
|
12435
|
+
if (!isNullOrUndefined(parentOfCurrentOLUL) && (!isNullOrUndefined(parentOfCurrentOLUL.closest('UL')) || !isNullOrUndefined(parentOfCurrentOLUL.closest('OL'))) &&
|
|
12436
|
+
parentOfCurrentOLUL.nodeName === 'LI' && parentOfCurrentOLUL.style.listStyleType === 'none' &&
|
|
12437
|
+
parentOfCurrentOLUL.textContent === '' && startNode.textContent === '' && startNode === startNodeParent.firstElementChild &&
|
|
12438
|
+
isNullOrUndefined(startNode.nextSibling)) {
|
|
12439
|
+
detach(startNodeParent);
|
|
12440
|
+
parentOfCurrentOLUL.style.removeProperty('list-style-type');
|
|
12441
|
+
e.event.preventDefault();
|
|
12442
|
+
}
|
|
12232
12443
|
}
|
|
12233
12444
|
};
|
|
12234
12445
|
Lists.prototype.backspaceList = function (e) {
|
|
@@ -12602,7 +12813,7 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12602
12813
|
this.currentAction = e.subCommand;
|
|
12603
12814
|
this.currentAction = e.subCommand = this.currentAction === 'NumberFormatList' ? 'OL' : this.currentAction === 'BulletFormatList' ? 'UL' : this.currentAction;
|
|
12604
12815
|
this.domNode.setMarker(this.saveSelection);
|
|
12605
|
-
var listsNodes = this.domNode.blockNodes();
|
|
12816
|
+
var listsNodes = this.domNode.blockNodes(true);
|
|
12606
12817
|
if (e.enterAction === 'BR') {
|
|
12607
12818
|
this.setSelectionBRConfig();
|
|
12608
12819
|
var allSelectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument);
|
|
@@ -12716,6 +12927,17 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12716
12927
|
listEle.innerHTML = '<li><br/></li>';
|
|
12717
12928
|
elements[i].appendChild(listEle);
|
|
12718
12929
|
}
|
|
12930
|
+
else if ('LI' !== elements[i].tagName && isNullOrUndefined(item) &&
|
|
12931
|
+
elements[i].nodeName === 'BLOCKQUOTE') {
|
|
12932
|
+
var elemAtt = this.domNode.attributes(elements[i]);
|
|
12933
|
+
var openTag = '<' + type + '>';
|
|
12934
|
+
var closeTag = '</' + type + '>';
|
|
12935
|
+
var newTag = 'li' + elemAtt;
|
|
12936
|
+
var replaceHTML = elements[i].innerHTML;
|
|
12937
|
+
var innerHTML = this.domNode.createTagString(newTag, null, replaceHTML);
|
|
12938
|
+
var collectionString = openTag + innerHTML + closeTag;
|
|
12939
|
+
elements[i].innerHTML = collectionString;
|
|
12940
|
+
}
|
|
12719
12941
|
else if ('LI' !== elements[i].tagName && isNullOrUndefined(item)) {
|
|
12720
12942
|
var elemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
|
|
12721
12943
|
var openTag = '<' + type + '>';
|
|
@@ -13507,7 +13729,7 @@ var Formats = /** @__PURE__ @class */ (function () {
|
|
|
13507
13729
|
}
|
|
13508
13730
|
var save = this.parent.nodeSelection.save(range, this.parent.currentDocument);
|
|
13509
13731
|
this.parent.domNode.setMarker(save);
|
|
13510
|
-
var formatsNodes = this.parent.domNode.blockNodes();
|
|
13732
|
+
var formatsNodes = this.parent.domNode.blockNodes(true);
|
|
13511
13733
|
if (e.enterAction === 'BR') {
|
|
13512
13734
|
this.setSelectionBRConfig();
|
|
13513
13735
|
var allSelectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument);
|
|
@@ -13727,6 +13949,10 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
13727
13949
|
var isCollapsed = range.collapsed;
|
|
13728
13950
|
var nodes = this.getNodeCollection(range, nodeSelection, node);
|
|
13729
13951
|
var closestParentNode = (node.nodeName.toLowerCase() === 'table') ? this.closestEle(nodes[0].parentNode, editNode) : nodes[0];
|
|
13952
|
+
if (closestParentNode && closestParentNode.nodeName === 'LI' && node.nodeName.toLowerCase() === 'table') {
|
|
13953
|
+
this.insertTableInList(range, node, closestParentNode, nodes[0], nodeCutter);
|
|
13954
|
+
return;
|
|
13955
|
+
}
|
|
13730
13956
|
if (isExternal || (!isNullOrUndefined(node) && !isNullOrUndefined(node.classList) &&
|
|
13731
13957
|
node.classList.contains('pasteContent'))) {
|
|
13732
13958
|
this.pasteInsertHTML(nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode, enterAction);
|
|
@@ -13879,7 +14105,12 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
13879
14105
|
TABLE_BLOCK_TAGS.indexOf(closestParentNode.tagName.toLocaleLowerCase()) !== -1))
|
|
13880
14106
|
|| (node.nodeName.toLowerCase() === 'table' && closestParentNode &&
|
|
13881
14107
|
TABLE_BLOCK_TAGS.indexOf(closestParentNode.tagName.toLocaleLowerCase()) === -1))) {
|
|
13882
|
-
|
|
14108
|
+
if (isCollapsed) {
|
|
14109
|
+
preNode = nodeCutter.SplitNode(range, closestParentNode, true);
|
|
14110
|
+
}
|
|
14111
|
+
else {
|
|
14112
|
+
preNode = nodeCutter.SplitNode(range, closestParentNode, false);
|
|
14113
|
+
}
|
|
13883
14114
|
sibNode = isNullOrUndefined(preNode.previousSibling) ? preNode.parentNode.previousSibling : preNode.previousSibling;
|
|
13884
14115
|
if (nodes.length === 1) {
|
|
13885
14116
|
nodeSelection.setSelectionContents(docElement, preNode);
|
|
@@ -13966,6 +14197,9 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
13966
14197
|
var paraElm = void 0;
|
|
13967
14198
|
var previousParent = void 0;
|
|
13968
14199
|
if (!this.contentsDeleted) {
|
|
14200
|
+
if (!isCollapsed && range.startContainer.parentElement.textContent.length === 0 && range.startContainer.nodeName === 'BR' && range.startContainer.parentElement.nodeName === 'P') {
|
|
14201
|
+
editNode.removeChild(range.startContainer.parentElement);
|
|
14202
|
+
}
|
|
13969
14203
|
range.deleteContents();
|
|
13970
14204
|
}
|
|
13971
14205
|
while (node.firstChild) {
|
|
@@ -14214,6 +14448,9 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
14214
14448
|
};
|
|
14215
14449
|
InsertHtml.closestEle = function (element, editNode) {
|
|
14216
14450
|
var el = element;
|
|
14451
|
+
if (closest(el, 'li')) {
|
|
14452
|
+
return closest(el, 'li');
|
|
14453
|
+
}
|
|
14217
14454
|
while (el && el.nodeType === 1) {
|
|
14218
14455
|
if (el.parentNode === editNode ||
|
|
14219
14456
|
(!isNullOrUndefined(el.parentNode.tagName) &&
|
|
@@ -14224,6 +14461,30 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
14224
14461
|
}
|
|
14225
14462
|
return null;
|
|
14226
14463
|
};
|
|
14464
|
+
InsertHtml.insertTableInList = function (range, insertNode, parentNode, currentNode, nodeCutter) {
|
|
14465
|
+
if (range.collapsed) {
|
|
14466
|
+
var isStart = range.startOffset === 0;
|
|
14467
|
+
var isEnd = range.startContainer.textContent.trimEnd().length === range.startOffset;
|
|
14468
|
+
if (isStart || isEnd) {
|
|
14469
|
+
if (isStart) {
|
|
14470
|
+
InsertMethods.AppendBefore(insertNode, currentNode, false);
|
|
14471
|
+
}
|
|
14472
|
+
else {
|
|
14473
|
+
InsertMethods.AppendBefore(insertNode, currentNode, true);
|
|
14474
|
+
}
|
|
14475
|
+
}
|
|
14476
|
+
else {
|
|
14477
|
+
var preNode = nodeCutter.SplitNode(range, parentNode, true);
|
|
14478
|
+
var sibNode = preNode.previousSibling;
|
|
14479
|
+
sibNode.appendChild(insertNode);
|
|
14480
|
+
}
|
|
14481
|
+
}
|
|
14482
|
+
else {
|
|
14483
|
+
range.deleteContents();
|
|
14484
|
+
parentNode.appendChild(insertNode);
|
|
14485
|
+
}
|
|
14486
|
+
insertNode.classList.add('ignore-table');
|
|
14487
|
+
};
|
|
14227
14488
|
/**
|
|
14228
14489
|
* Insert method
|
|
14229
14490
|
*
|
|
@@ -14430,7 +14691,7 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
|
|
|
14430
14691
|
for (var i = 0, j_2 = 0, k = 0; i <= finalinlineNodes.length; i++) {
|
|
14431
14692
|
if (i === 0) {
|
|
14432
14693
|
finalinlineNodes[i].parentNode.insertBefore(anchorNodes[j_2], finalinlineNodes[i].nextSibling);
|
|
14433
|
-
if (this.parent.domNode.blockNodes().length === 1) {
|
|
14694
|
+
if (this.parent.domNode.blockNodes().length === 1 && anchorNodes.length === 1) {
|
|
14434
14695
|
this.parent.nodeSelection.setSelectionNode(this.parent.currentDocument, anchorNodes[j_2]);
|
|
14435
14696
|
}
|
|
14436
14697
|
removeNodes[k] = finalinlineNodes[i];
|
|
@@ -14861,7 +15122,6 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
|
|
|
14861
15122
|
}
|
|
14862
15123
|
};
|
|
14863
15124
|
ImageCommand.prototype.createImage = function (e) {
|
|
14864
|
-
var _this = this;
|
|
14865
15125
|
var isReplaced = false;
|
|
14866
15126
|
e.item.url = isNullOrUndefined(e.item.url) || e.item.url === 'undefined' ? e.item.src : e.item.url;
|
|
14867
15127
|
if (!isNullOrUndefined(e.item.selectParent) && e.item.selectParent[0].tagName === 'IMG') {
|
|
@@ -14891,21 +15151,18 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
|
|
|
14891
15151
|
var selectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)[0];
|
|
14892
15152
|
var imgElm_1 = (e.value === 'Replace' || isReplaced) ? e.item.selectParent[0] :
|
|
14893
15153
|
(Browser.isIE ? selectedNode.previousSibling : selectedNode.previousElementSibling);
|
|
14894
|
-
|
|
14895
|
-
|
|
14896
|
-
|
|
14897
|
-
|
|
14898
|
-
|
|
14899
|
-
|
|
14900
|
-
|
|
14901
|
-
|
|
14902
|
-
|
|
14903
|
-
|
|
14904
|
-
}
|
|
14905
|
-
|
|
14906
|
-
if (e.value === 'Replace') {
|
|
14907
|
-
e.item.subCommand = 'Replace';
|
|
14908
|
-
this.callBack(e);
|
|
15154
|
+
var imageInstance_1 = this;
|
|
15155
|
+
var onImageLoadEvent_1 = function () {
|
|
15156
|
+
e.callBack({
|
|
15157
|
+
requestType: (e.value === 'Replace') ? (e.item.subCommand = 'Replace', "Replace") : 'Images',
|
|
15158
|
+
editorMode: 'HTML',
|
|
15159
|
+
event: e.event,
|
|
15160
|
+
range: imageInstance_1.parent.nodeSelection.getRange(imageInstance_1.parent.currentDocument),
|
|
15161
|
+
elements: [imgElm_1]
|
|
15162
|
+
});
|
|
15163
|
+
imgElm_1.removeEventListener('load', onImageLoadEvent_1);
|
|
15164
|
+
};
|
|
15165
|
+
imgElm_1.addEventListener('load', onImageLoadEvent_1);
|
|
14909
15166
|
}
|
|
14910
15167
|
};
|
|
14911
15168
|
ImageCommand.prototype.setStyle = function (imgElement, e, imgReplace) {
|
|
@@ -15622,7 +15879,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
15622
15879
|
e.item.selection.restore();
|
|
15623
15880
|
InsertHtml.Insert(this.parent.currentDocument, table, this.parent.editableElement);
|
|
15624
15881
|
e.item.selection.setSelectionText(this.parent.currentDocument, table.querySelector('td'), table.querySelector('td'), 0, 0);
|
|
15625
|
-
if (table.nextElementSibling === null) {
|
|
15882
|
+
if (table.nextElementSibling === null && !table.classList.contains('ignore-table')) {
|
|
15626
15883
|
var insertElem = void 0;
|
|
15627
15884
|
if (e.enterAction === 'DIV') {
|
|
15628
15885
|
insertElem = createElement('div');
|
|
@@ -15637,6 +15894,9 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
15637
15894
|
}
|
|
15638
15895
|
this.insertAfter(insertElem, table);
|
|
15639
15896
|
}
|
|
15897
|
+
if (table.classList.contains('ignore-table')) {
|
|
15898
|
+
table.classList.remove('ignore-table');
|
|
15899
|
+
}
|
|
15640
15900
|
table.querySelector('td').classList.add('e-cell-select');
|
|
15641
15901
|
if (e.callBack) {
|
|
15642
15902
|
e.callBack({
|
|
@@ -16056,10 +16316,22 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
16056
16316
|
firstCell.setAttribute('rowspan', (minMaxIndexes.endRow - minMaxIndexes.startRow + 1).toString());
|
|
16057
16317
|
}
|
|
16058
16318
|
var totalWidth = 0;
|
|
16319
|
+
var unit;
|
|
16059
16320
|
for (var j = rowSelectedCells.length - 1; j >= 0; j--) {
|
|
16060
|
-
|
|
16321
|
+
if (!isNullOrUndefined(rowSelectedCells[j].style.width)
|
|
16322
|
+
&& rowSelectedCells[j].style.width !== '') {
|
|
16323
|
+
if (!unit) {
|
|
16324
|
+
var match = rowSelectedCells[j].style.width.match(/^([\d.]+)([a-z%]+)$/i);
|
|
16325
|
+
unit = match ? match[2] : '%';
|
|
16326
|
+
}
|
|
16327
|
+
totalWidth = totalWidth + parseFloat(rowSelectedCells[j].style.width);
|
|
16328
|
+
}
|
|
16329
|
+
else {
|
|
16330
|
+
totalWidth = totalWidth + ((rowSelectedCells[j].offsetWidth / this.curTable.offsetWidth) * 100);
|
|
16331
|
+
unit = '%';
|
|
16332
|
+
}
|
|
16061
16333
|
}
|
|
16062
|
-
firstCell.style.width = totalWidth +
|
|
16334
|
+
firstCell.style.width = totalWidth + unit;
|
|
16063
16335
|
for (var i = 1; i <= selectedCells.length - 1; i++) {
|
|
16064
16336
|
detach(selectedCells[i]);
|
|
16065
16337
|
}
|
|
@@ -17076,6 +17348,30 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
17076
17348
|
formatNode.style.textDecoration = 'none';
|
|
17077
17349
|
child = [formatNode];
|
|
17078
17350
|
}
|
|
17351
|
+
else if (IsFormatted.inlineTags.indexOf(formatNodeTagName.toLowerCase()) !== -1 && isFontStyle && formatNodeTagName.toLocaleLowerCase() !== 'span') {
|
|
17352
|
+
var fontNodeStyle = formatNode.style;
|
|
17353
|
+
if (fontNodeStyle.color && format === 'fontcolor') {
|
|
17354
|
+
if (formatNode.nodeName === 'A') {
|
|
17355
|
+
fontNodeStyle.color = value;
|
|
17356
|
+
}
|
|
17357
|
+
else {
|
|
17358
|
+
fontNodeStyle.color = '';
|
|
17359
|
+
}
|
|
17360
|
+
}
|
|
17361
|
+
else if (fontNodeStyle.backgroundColor && format === 'backgroundcolor') {
|
|
17362
|
+
fontNodeStyle.backgroundColor = '';
|
|
17363
|
+
}
|
|
17364
|
+
else if (fontNodeStyle.fontSize && format === 'fontsize') {
|
|
17365
|
+
fontNodeStyle.fontSize = '';
|
|
17366
|
+
}
|
|
17367
|
+
else if (fontNodeStyle.fontFamily && format === 'fontname') {
|
|
17368
|
+
fontNodeStyle.fontFamily = '';
|
|
17369
|
+
}
|
|
17370
|
+
if (formatNode.getAttribute("style") === '') {
|
|
17371
|
+
formatNode.removeAttribute("style");
|
|
17372
|
+
}
|
|
17373
|
+
child = [formatNode];
|
|
17374
|
+
}
|
|
17079
17375
|
else {
|
|
17080
17376
|
child = InsertMethods.unwrap(formatNode);
|
|
17081
17377
|
var liElement = nodes[index].parentElement;
|
|
@@ -17256,19 +17552,44 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
17256
17552
|
parentElement = parentElement.parentElement;
|
|
17257
17553
|
liElement = parentElement;
|
|
17258
17554
|
}
|
|
17259
|
-
if (format === 'fontcolor') {
|
|
17555
|
+
if (format === 'fontcolor' || format === 'fontname') {
|
|
17260
17556
|
var parentElem = nodes[index].parentElement;
|
|
17261
17557
|
if (!isNullOrUndefined(parentElem) && parentElem.childNodes) {
|
|
17262
17558
|
for (var i = 0; i < parentElem.childNodes.length; i++) {
|
|
17263
17559
|
if (this.concatenateTextExcludingList(nodes, index) === nodes[index].textContent) {
|
|
17560
|
+
var liElement_1 = void 0;
|
|
17264
17561
|
if (parentElem.tagName === 'LI') {
|
|
17265
|
-
|
|
17562
|
+
liElement_1 = parentElem;
|
|
17563
|
+
}
|
|
17564
|
+
else if (parentElem.closest('li')) {
|
|
17565
|
+
liElement_1 = parentElem.closest('li');
|
|
17566
|
+
}
|
|
17567
|
+
if (!isNullOrUndefined(liElement_1)) {
|
|
17568
|
+
switch (format) {
|
|
17569
|
+
case 'fontcolor':
|
|
17570
|
+
liElement_1.style.color = value;
|
|
17571
|
+
break;
|
|
17572
|
+
case 'fontname':
|
|
17573
|
+
liElement_1.style.fontFamily = value;
|
|
17574
|
+
break;
|
|
17575
|
+
default:
|
|
17576
|
+
break;
|
|
17577
|
+
}
|
|
17266
17578
|
}
|
|
17267
17579
|
}
|
|
17268
17580
|
// eslint-disable-next-line
|
|
17269
17581
|
var childElement = parentElem.childNodes[i];
|
|
17270
17582
|
if (childElement.tagName === 'OL' || childElement.tagName === 'UL') {
|
|
17271
|
-
|
|
17583
|
+
switch (format) {
|
|
17584
|
+
case 'fontcolor':
|
|
17585
|
+
childElement.style.color = 'initial';
|
|
17586
|
+
break;
|
|
17587
|
+
case 'fontname':
|
|
17588
|
+
childElement.style.fontFamily = 'initial';
|
|
17589
|
+
break;
|
|
17590
|
+
default:
|
|
17591
|
+
break;
|
|
17592
|
+
}
|
|
17272
17593
|
}
|
|
17273
17594
|
}
|
|
17274
17595
|
}
|
|
@@ -18294,6 +18615,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
18294
18615
|
var elm = createElement('p');
|
|
18295
18616
|
elm.setAttribute('id', 'MSWord-Content');
|
|
18296
18617
|
elm.innerHTML = tempHTMLContent;
|
|
18618
|
+
this.addDoubleBr(elm);
|
|
18297
18619
|
var patern = /class='?Mso|style='[^ ]*\bmso-/i;
|
|
18298
18620
|
var patern2 = /class="?Mso|style="[^ ]*\bmso-/i;
|
|
18299
18621
|
var patern3 = /(class="?Mso|class='?Mso|class="?Xl|class='?Xl|class=Xl|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument)/gi;
|
|
@@ -18328,6 +18650,26 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
18328
18650
|
e.callBack(elm.innerHTML);
|
|
18329
18651
|
}
|
|
18330
18652
|
};
|
|
18653
|
+
MsWordPaste.prototype.addDoubleBr = function (elm) {
|
|
18654
|
+
var newline = elm.querySelector('.Apple-interchange-newline');
|
|
18655
|
+
if (!isNullOrUndefined(newline) && Browser.userAgent.indexOf('Chrome') !== -1 && newline.parentElement.nodeName === 'P' && elm !== newline.parentElement) {
|
|
18656
|
+
for (var i = 0; i < elm.childNodes.length; i++) {
|
|
18657
|
+
// eslint-disable-next-line
|
|
18658
|
+
var node = elm.childNodes[i];
|
|
18659
|
+
if (node.nodeType === Node.COMMENT_NODE && node.nodeValue.includes('StartFragment')) {
|
|
18660
|
+
var newElement = document.createElement('p');
|
|
18661
|
+
newElement.innerHTML = '<br>';
|
|
18662
|
+
var cssText = newline.parentElement.style.cssText;
|
|
18663
|
+
var currentStyle = newElement.getAttribute('style') || '';
|
|
18664
|
+
var newStyle = currentStyle + cssText;
|
|
18665
|
+
newElement.setAttribute('style', newStyle);
|
|
18666
|
+
elm.insertBefore(newElement, node.nextSibling);
|
|
18667
|
+
detach(newline);
|
|
18668
|
+
break;
|
|
18669
|
+
}
|
|
18670
|
+
}
|
|
18671
|
+
}
|
|
18672
|
+
};
|
|
18331
18673
|
MsWordPaste.prototype.cleanList = function (elm, listTag) {
|
|
18332
18674
|
var replacableElem = elm.querySelectorAll(listTag + ' div');
|
|
18333
18675
|
for (var j = replacableElem.length - 1; j >= 0; j--) {
|
|
@@ -18684,72 +19026,80 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
18684
19026
|
};
|
|
18685
19027
|
MsWordPaste.prototype.styleCorrection = function (elm, wordPasteStyleConfig) {
|
|
18686
19028
|
var styleElement = elm.querySelectorAll('style');
|
|
19029
|
+
var styles = [];
|
|
18687
19030
|
if (styleElement.length > 0) {
|
|
18688
|
-
|
|
19031
|
+
if (!isNullOrUndefined(styleElement[0].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi))) {
|
|
19032
|
+
styles = styleElement[0].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);
|
|
19033
|
+
}
|
|
19034
|
+
else if (styleElement.length > 1) {
|
|
19035
|
+
styles = styleElement[1].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);
|
|
19036
|
+
}
|
|
18689
19037
|
var styleClassObject_1 = !isNullOrUndefined(styles) ? this.findStyleObject(styles) : null;
|
|
18690
|
-
|
|
18691
|
-
|
|
18692
|
-
|
|
18693
|
-
|
|
18694
|
-
|
|
18695
|
-
|
|
18696
|
-
|
|
18697
|
-
|
|
18698
|
-
|
|
18699
|
-
|
|
18700
|
-
|
|
18701
|
-
|
|
18702
|
-
|
|
18703
|
-
|
|
18704
|
-
|
|
18705
|
-
}
|
|
18706
|
-
else if (keys[i].split('.').length === 1 && keys[i].split('.')[0].indexOf('@') < 0) {
|
|
18707
|
-
resultElem = elm.getElementsByTagName(keys[i]);
|
|
18708
|
-
}
|
|
18709
|
-
else {
|
|
18710
|
-
resultElem = elm.querySelectorAll(keys[i]);
|
|
18711
|
-
}
|
|
18712
|
-
for (var j = 0; j < resultElem.length; j++) {
|
|
18713
|
-
if (resultElem[j].closest('li') && keys[i] === 'p') {
|
|
19038
|
+
if (!isNullOrUndefined(styleClassObject_1)) {
|
|
19039
|
+
var keys = Object.keys(styleClassObject_1);
|
|
19040
|
+
var values = keys.map(function (key) {
|
|
19041
|
+
return styleClassObject_1["" + key];
|
|
19042
|
+
});
|
|
19043
|
+
values = this.removeUnwantedStyle(values, wordPasteStyleConfig);
|
|
19044
|
+
this.filterStyles(elm, wordPasteStyleConfig);
|
|
19045
|
+
var resultElem = void 0;
|
|
19046
|
+
var fromClass = false;
|
|
19047
|
+
for (var i = 0; i < keys.length; i++) {
|
|
19048
|
+
if (keys[i].split('.')[0] === '') {
|
|
19049
|
+
resultElem = elm.getElementsByClassName(keys[i].split('.')[1]);
|
|
19050
|
+
fromClass = true;
|
|
19051
|
+
}
|
|
19052
|
+
else if (keys[i].split('.').length === 1 && keys[i].split('.')[0].indexOf('@') >= 0) {
|
|
18714
19053
|
continue;
|
|
18715
19054
|
}
|
|
18716
|
-
|
|
18717
|
-
|
|
18718
|
-
|
|
18719
|
-
|
|
18720
|
-
|
|
18721
|
-
|
|
18722
|
-
|
|
18723
|
-
|
|
19055
|
+
else if (keys[i].split('.').length === 1 && keys[i].split('.')[0].indexOf('@') < 0) {
|
|
19056
|
+
resultElem = elm.getElementsByTagName(keys[i]);
|
|
19057
|
+
}
|
|
19058
|
+
else {
|
|
19059
|
+
resultElem = elm.querySelectorAll(keys[i]);
|
|
19060
|
+
}
|
|
19061
|
+
for (var j = 0; j < resultElem.length; j++) {
|
|
19062
|
+
if (resultElem[j].closest('li') && keys[i] === 'p') {
|
|
19063
|
+
continue;
|
|
19064
|
+
}
|
|
19065
|
+
var styleProperty = resultElem[j].getAttribute('style');
|
|
19066
|
+
if (!isNullOrUndefined(styleProperty) && styleProperty.trim() !== '') {
|
|
19067
|
+
var valueSplit = values[i].split(';');
|
|
19068
|
+
if (!fromClass) {
|
|
19069
|
+
for (var k = 0; k < valueSplit.length; k++) {
|
|
19070
|
+
if (styleProperty.indexOf(valueSplit[k].split(':')[0]) >= 0) {
|
|
19071
|
+
valueSplit.splice(k, 1);
|
|
19072
|
+
k--;
|
|
19073
|
+
}
|
|
18724
19074
|
}
|
|
18725
19075
|
}
|
|
19076
|
+
var changedValue = styleProperty + valueSplit.join(';') + ';';
|
|
19077
|
+
resultElem[j].setAttribute('style', changedValue);
|
|
19078
|
+
}
|
|
19079
|
+
else {
|
|
19080
|
+
values[i] = values[i].replace(/text-indent:-(.*?)(?=;|$)/gm, '');
|
|
19081
|
+
resultElem[j].setAttribute('style', values[i]);
|
|
18726
19082
|
}
|
|
18727
|
-
var changedValue = styleProperty + valueSplit.join(';') + ';';
|
|
18728
|
-
resultElem[j].setAttribute('style', changedValue);
|
|
18729
|
-
}
|
|
18730
|
-
else {
|
|
18731
|
-
values[i] = values[i].replace(/text-indent:-(.*?)(?=;|$)/gm, '');
|
|
18732
|
-
resultElem[j].setAttribute('style', values[i]);
|
|
18733
19083
|
}
|
|
18734
|
-
|
|
18735
|
-
|
|
18736
|
-
|
|
18737
|
-
|
|
18738
|
-
|
|
18739
|
-
|
|
18740
|
-
|
|
18741
|
-
|
|
18742
|
-
|
|
18743
|
-
|
|
18744
|
-
|
|
18745
|
-
|
|
18746
|
-
|
|
18747
|
-
|
|
18748
|
-
|
|
18749
|
-
|
|
18750
|
-
|
|
18751
|
-
|
|
18752
|
-
|
|
19084
|
+
fromClass = false;
|
|
19085
|
+
}
|
|
19086
|
+
var listClass = ['MsoListParagraphCxSpFirst', 'MsoListParagraphCxSpMiddle', 'MsoListParagraphCxSpLast'];
|
|
19087
|
+
for (var i = 0; i < listClass.length; i++) {
|
|
19088
|
+
if (keys.indexOf('li.' + listClass[i]) > -1) {
|
|
19089
|
+
var olULElems = elm.querySelectorAll('ol.' + listClass[i] + ', ul.' + listClass[i]);
|
|
19090
|
+
for (var j = 0; j < olULElems.length; j++) {
|
|
19091
|
+
var styleProperty = olULElems[j].getAttribute('style');
|
|
19092
|
+
if (!isNullOrUndefined(styleProperty) && styleProperty.trim() !== '' && olULElems[j].style.marginLeft !== '') {
|
|
19093
|
+
var valueSplit = values[keys.indexOf('li.' + listClass[i])].split(';');
|
|
19094
|
+
for (var k = 0; k < valueSplit.length; k++) {
|
|
19095
|
+
if ('margin-left'.indexOf(valueSplit[k].split(':')[0]) >= 0) {
|
|
19096
|
+
if (!isNullOrUndefined(valueSplit[k].split(':')[1]) &&
|
|
19097
|
+
valueSplit[k].split(':')[1].indexOf('in') >= 0 &&
|
|
19098
|
+
olULElems[j].style.marginLeft.indexOf('in') >= 0) {
|
|
19099
|
+
var classStyle = parseFloat(valueSplit[k].split(':')[1].split('in')[0]);
|
|
19100
|
+
var inlineStyle = parseFloat(olULElems[j].style.marginLeft.split('in')[0]);
|
|
19101
|
+
olULElems[j].style.marginLeft = (inlineStyle - classStyle) + 'in';
|
|
19102
|
+
}
|
|
18753
19103
|
}
|
|
18754
19104
|
}
|
|
18755
19105
|
}
|
|
@@ -19324,7 +19674,7 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
19324
19674
|
* get method
|
|
19325
19675
|
*
|
|
19326
19676
|
* @param {Document} docElement - specifies the document element
|
|
19327
|
-
* @param {Node}
|
|
19677
|
+
* @param {Node} rootNode - specifies the content editable element
|
|
19328
19678
|
* @param {string[]} formatNode - specifies the format node
|
|
19329
19679
|
* @param {string[]} fontSize - specifies the font size
|
|
19330
19680
|
* @param {string[]} fontName - specifies the font name.
|
|
@@ -19333,7 +19683,7 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
19333
19683
|
* @hidden
|
|
19334
19684
|
* @deprecated
|
|
19335
19685
|
*/
|
|
19336
|
-
ToolbarStatus.get = function (docElement,
|
|
19686
|
+
ToolbarStatus.get = function (docElement, rootNode, formatNode, fontSize, fontName, documentNode) {
|
|
19337
19687
|
var formatCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
19338
19688
|
var nodeCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
19339
19689
|
var nodeSelection = new NodeSelection();
|
|
@@ -19363,7 +19713,7 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
19363
19713
|
}
|
|
19364
19714
|
for (var index = 0; index < nodes.length; index++) {
|
|
19365
19715
|
// eslint-disable-next-line max-len
|
|
19366
|
-
formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index],
|
|
19716
|
+
formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], rootNode, formatNode, fontSize, fontName);
|
|
19367
19717
|
if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
|
|
19368
19718
|
nodeCollection.bold = formatCollection.bold;
|
|
19369
19719
|
}
|
|
@@ -19438,16 +19788,24 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
19438
19788
|
return node;
|
|
19439
19789
|
};
|
|
19440
19790
|
ToolbarStatus.getFormatParent = function (docElement, formatCollection, node, targetNode, formatNode, fontSize, fontName) {
|
|
19791
|
+
var isListUpdated = false;
|
|
19792
|
+
var isComplexListUpdated = false;
|
|
19441
19793
|
if (targetNode.contains(node) ||
|
|
19442
19794
|
(node.nodeType === 3 && targetNode.nodeType !== 3 && targetNode.contains(node.parentNode))) {
|
|
19443
19795
|
do {
|
|
19444
|
-
formatCollection = this.isFormattedNode(docElement, formatCollection, node, formatNode, fontSize, fontName);
|
|
19796
|
+
formatCollection = this.isFormattedNode(docElement, formatCollection, node, isListUpdated, isComplexListUpdated, formatNode, fontSize, fontName);
|
|
19797
|
+
if (formatCollection.orderedlist || formatCollection.unorderedlist) {
|
|
19798
|
+
isListUpdated = true;
|
|
19799
|
+
}
|
|
19800
|
+
if (formatCollection.bulletFormatList || formatCollection.numberFormatList) {
|
|
19801
|
+
isComplexListUpdated = true;
|
|
19802
|
+
}
|
|
19445
19803
|
node = node.parentNode;
|
|
19446
19804
|
} while (node && (node !== targetNode));
|
|
19447
19805
|
}
|
|
19448
19806
|
return formatCollection;
|
|
19449
19807
|
};
|
|
19450
|
-
ToolbarStatus.isFormattedNode = function (docElement, formatCollection, node, formatNode, fontSize, fontName) {
|
|
19808
|
+
ToolbarStatus.isFormattedNode = function (docElement, formatCollection, node, isListUpdated, isComplexListUpdated, formatNode, fontSize, fontName) {
|
|
19451
19809
|
if (!formatCollection.bold) {
|
|
19452
19810
|
formatCollection.bold = IsFormatted.isBold(node);
|
|
19453
19811
|
}
|
|
@@ -19478,10 +19836,10 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
19478
19836
|
if (!formatCollection.backgroundcolor) {
|
|
19479
19837
|
formatCollection.backgroundcolor = this.isBackgroundColor(node);
|
|
19480
19838
|
}
|
|
19481
|
-
if (!formatCollection.orderedlist) {
|
|
19839
|
+
if (!formatCollection.orderedlist && !isListUpdated) {
|
|
19482
19840
|
formatCollection.orderedlist = this.isOrderedList(node);
|
|
19483
19841
|
}
|
|
19484
|
-
if (!formatCollection.unorderedlist) {
|
|
19842
|
+
if (!formatCollection.unorderedlist && !isListUpdated) {
|
|
19485
19843
|
formatCollection.unorderedlist = this.isUnorderedList(node);
|
|
19486
19844
|
}
|
|
19487
19845
|
if (!formatCollection.alignments) {
|
|
@@ -19496,10 +19854,10 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
19496
19854
|
if (!formatCollection.createlink) {
|
|
19497
19855
|
formatCollection.createlink = this.isLink(node);
|
|
19498
19856
|
}
|
|
19499
|
-
if (!formatCollection.numberFormatList) {
|
|
19857
|
+
if (!formatCollection.numberFormatList && !isComplexListUpdated) {
|
|
19500
19858
|
formatCollection.numberFormatList = this.isNumberFormatList(node);
|
|
19501
19859
|
}
|
|
19502
|
-
if (!formatCollection.bulletFormatList) {
|
|
19860
|
+
if (!formatCollection.bulletFormatList && !isComplexListUpdated) {
|
|
19503
19861
|
formatCollection.bulletFormatList = this.isBulletFormatList(node);
|
|
19504
19862
|
}
|
|
19505
19863
|
return formatCollection;
|
|
@@ -20833,7 +21191,7 @@ var __extends$3 = (undefined && undefined.__extends) || (function () {
|
|
|
20833
21191
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
20834
21192
|
};
|
|
20835
21193
|
})();
|
|
20836
|
-
var IFRAMEHEADER = "\n<!DOCTYPE html> \n <html>\n <head>\n <meta charset='utf-8' /> \n <style>\n @charset \"UTF-8\";\n body {\n font-family: \"Roboto\", sans-serif;\n font-size: 14px;\n }\n html, body{height: 100%;margin: 0;}\n body.e-cursor{cursor:default}\n span.e-selected-node\t{background-color: #939393;color: white;}\n span.e-selected-node.e-highlight {background-color: #1d9dd8;}\n body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}\n .e-rte-image, .e-rte-video {border: 0;cursor: pointer;display:\n block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-audio {border: 0;cursor: pointer;display:\n block;float: none;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imginline, .e-rte-audio.e-audio-inline, .e-rte-video.e-video-inline {display: inline-block;float: none;\n margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));padding: 1px;vertical-align: bottom;}\n .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;}\n .e-rte-image.e-imgright, .e-rte-video.e-video-right { float: right; margin: 0 auto;margin-left: 5px;text-align: right;}\n .e-rte-image.e-imgleft, .e-rte-video.e-video-left {float: left;margin: 0 auto;margin-right: 5px;text-align: left;}\n .e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}\n .e-img-caption.e-caption-inline {display: inline-block;float: none;\n margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));\n position: relativetext-align: center;vertical-align: bottom;}\n .e-rte-img-caption.e-imgcenter {display: contents; margin-left: auto; margin-right: auto;}\n .e-rte-img-caption.e-imgright {display: contents; margin-left: auto; margin-right: 0;}\n .e-rte-img-caption.e-imgleft {display: contents;margin-left: 0;margin-right: auto;}\n .e-img-caption.e-rte-img-caption.e-imgbreak {display: contents;}\n .e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;\n margin: auto;opacity: .9;text-align: center;width: 100%;}\n .e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}\n .e-imgleft, .e-video-left {float: left;margin: 0 5px 0 0;text-align: left;}\n .e-imgright, .e-video-right {float: right;margin: 0 0 0 5px;text-align: right;}\n .e-imgcenter, .e-video-center {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}\n .e-imginline , .e-audio-inline, .e-video-inline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;\n max-width: calc(100% - (2 * 5px));vertical-align: bottom;}\n .e-imgbreak, .e-audio-break, .e-video-break {border: 0;cursor: pointer;\n display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .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;}\n img.e-img-focus::selection, audio.e-audio-focus::selection, .e-video-focus::selection { background: transparent;color: transparent;}\n span.e-rte-imageboxmark, span.e-rte-videoboxmark { width: 10px; height: 10px; position: absolute; display: block;\n background: #4a90e2; border: 1px solid #fff; z-index: 1000;}\n .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; }\n .e-mob-rte span.e-rte-imageboxmark, .e-mob-rte span.e-rte-videoboxmark { background: #fff; border: 1px solid #4a90e2;\n border-radius: 15px; height: 20px; width: 20px; }\n .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; }\n .e-rte-content .e-content img.e-resize, .e-rte-content .e-content video.e-resize { z-index: 1000; }\n .e-img-caption .e-img-inner { outline: 0; }\n .e-img-caption a:focus-visible { outline: none; }\n .e-img-caption .e-rte-image.e-imgright
|
|
21194
|
+
var IFRAMEHEADER = "\n<!DOCTYPE html> \n <html>\n <head>\n <meta charset='utf-8' /> \n <style>\n @charset \"UTF-8\";\n body {\n font-family: \"Roboto\", sans-serif;\n font-size: 14px;\n }\n html, body{height: 100%;margin: 0;}\n body.e-cursor{cursor:default}\n span.e-selected-node\t{background-color: #939393;color: white;}\n span.e-selected-node.e-highlight {background-color: #1d9dd8;}\n body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}\n .e-rte-image, .e-rte-video {border: 0;cursor: pointer;display:\n block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-audio {border: 0;cursor: pointer;display:\n block;float: none;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imginline, .e-rte-audio.e-audio-inline, .e-rte-video.e-video-inline {display: inline-block;float: none;\n margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));padding: 1px;vertical-align: bottom;}\n .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;}\n .e-rte-image.e-imgright, .e-rte-video.e-video-right { float: right; margin: 0 auto;margin-left: 5px;text-align: right;}\n .e-rte-image.e-imgleft, .e-rte-video.e-video-left {float: left;margin: 0 auto;margin-right: 5px;text-align: left;}\n .e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}\n .e-img-caption.e-caption-inline {display: inline-block;float: none;\n margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));\n position: relativetext-align: center;vertical-align: bottom;}\n .e-rte-img-caption.e-imgcenter {display: contents; margin-left: auto; margin-right: auto;}\n .e-rte-img-caption.e-imgright {display: contents; margin-left: auto; margin-right: 0;}\n .e-rte-img-caption.e-imgleft {display: contents;margin-left: 0;margin-right: auto;}\n .e-img-caption.e-rte-img-caption.e-imgbreak {display: contents;}\n .e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;\n margin: auto;opacity: .9;text-align: center;width: 100%;}\n .e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}\n .e-imgleft, .e-video-left {float: left;margin: 0 5px 0 0;text-align: left;}\n .e-imgright, .e-video-right {float: right;margin: 0 0 0 5px;text-align: right;}\n .e-imgcenter, .e-video-center {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}\n .e-imginline , .e-audio-inline, .e-video-inline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;\n max-width: calc(100% - (2 * 5px));vertical-align: bottom;}\n .e-imgbreak, .e-audio-break, .e-video-break {border: 0;cursor: pointer;\n display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .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;}\n img.e-img-focus::selection, audio.e-audio-focus::selection, .e-video-focus::selection { background: transparent;color: transparent;}\n span.e-rte-imageboxmark, span.e-rte-videoboxmark { width: 10px; height: 10px; position: absolute; display: block;\n background: #4a90e2; border: 1px solid #fff; z-index: 1000;}\n .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; }\n .e-mob-rte span.e-rte-imageboxmark, .e-mob-rte span.e-rte-videoboxmark { background: #fff; border: 1px solid #4a90e2;\n border-radius: 15px; height: 20px; width: 20px; }\n .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; }\n .e-rte-content .e-content img.e-resize, .e-rte-content .e-content video.e-resize { z-index: 1000; }\n .e-img-caption .e-img-inner { outline: 0; }\n .e-rte-img-caption.e-imgleft .e-img-inner { float: left; text-align: left; }\n .e-rte-img-caption.e-imgright .e-img-inner { float: right; text-align: right; }\n .e-rte-img-caption.e-imgleft .e-img-wrap, .e-rte-img-caption.e-imgright .e-img-wrap { display: contents; }\n .e-img-caption a:focus-visible { outline: none; }\n .e-rte-img-caption .e-rte-image.e-imgright { margin-left: auto; margin-right: 0; }\n .e-rte-img-caption .e-rte-image.e-imgleft { margin: 0; }\n body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;\n overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}\n p{margin: 0 0 10px;margin-bottom: 10px;}\n li{margin-bottom: 10px;}\n h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}\n h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}\n h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}\n h4{font-size: 16px;font-weight: 400;line-height: 1.5;margin: 0;}\n h5{font-size: 00.8em;font-weight: 400;margin: 0;}\n h6{font-size: 00.65em;font-weight: 400;margin: 0;}\n blockquote{margin: 10px 0;margin-left: 0;padding-left: 5px;border-left: solid 2px #5c5c5c;}\n pre{background-color: inherit;border: 0;border-radius: 0;color: #333;\n font-size: inherit;line-height: inherit;margin: 0 0 10px;overflow: visible;padding: 0;\n white-space: pre-wrap;word-break: inherit;word-wrap: break-word;}\n strong, b{font-weight: 700;}\n a{text-decoration: none;user-select: auto;}\n a:hover{text-decoration: underline;};\n p:last-child, pre:last-child, blockquote:last-child{margin-bottom: 0;}\n h3+h4, h4+h5, h5+h6{margin-top: 00.6em;}\n ul:last-child{margin-bottom: 0;}\n table { border-collapse: collapse; empty-cells: show;}\n table td,table th {border: 1px solid #BDBDBD; height: 20px; padding: 2px 5px; vertical-align: middle;}\n table.e-alternate-border tbody tr:nth-child(2n) {background-color: #F5F5F5;}\n table th {background-color: #E0E0E0;}\n table.e-dashed-border td,table.e-dashed-border th { border: 1px dashed #BDBDBD} \n table .e-cell-select {border: 1px double #4a90e2;}\n span.e-table-box { cursor: nwse-resize; display: block; height: 10px; position: absolute; width: 10px; }\n span.e-table-box.e-rmob {height: 14px;width: 14px;}\n .e-row-resize, .e-column-resize { background-color: transparent; background-repeat: repeat;\n bottom: 0;cursor: col-resize;height: 1px;overflow: visible;position: absolute;width: 1px; }\n .e-row-resize { cursor: row-resize; height: 1px;}\n .e-table-rhelper { cursor: col-resize; opacity: .87;position: absolute;}\n .e-table-rhelper.e-column-helper { width: 1px; }\n .e-table-rhelper.e-row-helper {height: 1px;}\n .e-reicon::before { border-bottom: 6px solid transparent; border-right: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block; height: 0;\n position: absolute; right: 4px; top: 4px; width: 20px; }\n .e-reicon::after { border-bottom: 6px solid transparent; border-left: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block;\n height: 0; left: 4px; position: absolute; top: 4px; width: 20px; z-index: 3; }\n .e-row-helper.e-reicon::after { top: 10px; transform: rotate(90deg); }\n .e-row-helper.e-reicon::before { left: 4px; top: -20px; transform: rotate(90deg); }\n span.e-table-box { background-color: #ffffff; border: 1px solid #BDBDBD; }\n span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }\n .e-table-rhelper { background-color: #4a90e2;}\n .e-rtl { direction: rtl; }\n .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; }\n li ol, li ul { margin-block-start: 10px;}\n </style>\n </head>";
|
|
20837
21195
|
/**
|
|
20838
21196
|
* Content module is used to render Rich Text Editor content
|
|
20839
21197
|
*
|
|
@@ -20863,6 +21221,7 @@ var IframeContentRender = /** @__PURE__ @class */ (function (_super) {
|
|
|
20863
21221
|
styles: 'display:block;',
|
|
20864
21222
|
attrs: { 'srcdoc': iFrameContent }
|
|
20865
21223
|
});
|
|
21224
|
+
iframe.setAttribute("role", "none");
|
|
20866
21225
|
this.setPanel(iframe);
|
|
20867
21226
|
rteObj.element.appendChild(iframe);
|
|
20868
21227
|
iframe.contentDocument.body.id = this.parent.getID() + '_rte-edit-view';
|
|
@@ -21490,9 +21849,9 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
21490
21849
|
var liElement = this.getRangeLiNode(currentRange.startContainer);
|
|
21491
21850
|
if (liElement.previousElementSibling && liElement.previousElementSibling.childElementCount > 0) {
|
|
21492
21851
|
this.oldRangeElement = liElement.previousElementSibling.lastElementChild.nodeName === 'BR' ?
|
|
21493
|
-
liElement.previousElementSibling : liElement.previousElementSibling.
|
|
21852
|
+
liElement.previousElementSibling : liElement.previousElementSibling.lastChild;
|
|
21494
21853
|
if (!isNullOrUndefined(liElement.lastElementChild) && liElement.lastElementChild.nodeName !== 'BR' &&
|
|
21495
|
-
isNullOrUndefined(liElement.lastElementChild.previousSibling)) {
|
|
21854
|
+
isNullOrUndefined(liElement.lastElementChild.previousSibling) && liElement.lastChild.nodeName !== "#text") {
|
|
21496
21855
|
this.rangeElement = liElement.lastElementChild;
|
|
21497
21856
|
isLiElement = true;
|
|
21498
21857
|
}
|
|
@@ -21517,7 +21876,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
21517
21876
|
? this.oldRangeElement.lastElementChild.lastElementChild :
|
|
21518
21877
|
this.oldRangeElement.lastElementChild;
|
|
21519
21878
|
}
|
|
21520
|
-
var lastNode = this.oldRangeElement.lastChild;
|
|
21879
|
+
var lastNode = this.oldRangeElement.lastChild ? this.oldRangeElement.lastChild : this.oldRangeElement;
|
|
21521
21880
|
while (lastNode.nodeType !== 3 && lastNode.nodeName !== '#text' &&
|
|
21522
21881
|
lastNode.nodeName !== 'BR') {
|
|
21523
21882
|
lastNode = lastNode.lastChild;
|
|
@@ -21525,12 +21884,17 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
21525
21884
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),
|
|
21526
21885
|
// eslint-disable-next-line
|
|
21527
21886
|
lastNode, lastNode.textContent.length);
|
|
21528
|
-
if (this.oldRangeElement.querySelectorAll('BR').length === 1) {
|
|
21887
|
+
if (this.oldRangeElement.nodeName !== '#text' && this.oldRangeElement.querySelectorAll('BR').length === 1) {
|
|
21529
21888
|
detach(this.oldRangeElement.querySelector('BR'));
|
|
21530
21889
|
}
|
|
21531
21890
|
if (!isNullOrUndefined(this.rangeElement) && this.oldRangeElement !== this.rangeElement) {
|
|
21532
21891
|
while (this.rangeElement.firstChild) {
|
|
21533
|
-
this.oldRangeElement.
|
|
21892
|
+
if (this.oldRangeElement.nodeName === '#text') {
|
|
21893
|
+
this.oldRangeElement.parentElement.appendChild(this.rangeElement.childNodes[0]);
|
|
21894
|
+
}
|
|
21895
|
+
else {
|
|
21896
|
+
this.oldRangeElement.appendChild(this.rangeElement.childNodes[0]);
|
|
21897
|
+
}
|
|
21534
21898
|
}
|
|
21535
21899
|
// eslint-disable-next-line
|
|
21536
21900
|
!isLiElement ? detach(this.rangeElement) : detach(this.rangeElement.parentElement);
|
|
@@ -21567,7 +21931,11 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
21567
21931
|
(!isNullOrUndefined(this.deleteRangeElement.nextElementSibling) && this.deleteRangeElement.nextElementSibling.tagName === 'TABLE'))) {
|
|
21568
21932
|
return;
|
|
21569
21933
|
}
|
|
21570
|
-
|
|
21934
|
+
var isImgWithEmptyBlockNode = false;
|
|
21935
|
+
if (this.deleteRangeElement.querySelectorAll('img').length > 0 && this.deleteRangeElement.textContent.trim() === '') {
|
|
21936
|
+
isImgWithEmptyBlockNode = true;
|
|
21937
|
+
}
|
|
21938
|
+
if (this.getCaretIndex(currentRange, this.deleteRangeElement) === this.deleteRangeElement.textContent.length && !isImgWithEmptyBlockNode) {
|
|
21571
21939
|
if (!isNullOrUndefined(liElement)) {
|
|
21572
21940
|
if (isLiElement || !isNullOrUndefined(liElement.nextElementSibling)) {
|
|
21573
21941
|
this.deleteOldRangeElement = this.getRangeElement(liElement.nextElementSibling);
|
|
@@ -21759,19 +22127,6 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
21759
22127
|
}, e, value);
|
|
21760
22128
|
}
|
|
21761
22129
|
};
|
|
21762
|
-
HtmlEditor.prototype.mouseOutHandler = function () {
|
|
21763
|
-
if (!isNullOrUndefined(this.tooltipTargetEle)) {
|
|
21764
|
-
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
21765
|
-
}
|
|
21766
|
-
else {
|
|
21767
|
-
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
21768
|
-
this.parent.contentModule.getDocument();
|
|
21769
|
-
this.tooltipTargetEle = currentDocument.querySelector('[data-title]');
|
|
21770
|
-
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
21771
|
-
}
|
|
21772
|
-
this.tooltipTargetEle.removeAttribute('data-title');
|
|
21773
|
-
EventHandler.remove(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler);
|
|
21774
|
-
};
|
|
21775
22130
|
HtmlEditor.prototype.onToolbarClick = function (args) {
|
|
21776
22131
|
var _this = this;
|
|
21777
22132
|
var save;
|
|
@@ -21779,17 +22134,8 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
21779
22134
|
var selectParentEle;
|
|
21780
22135
|
var item = args.item;
|
|
21781
22136
|
var closestElement = closest(args.originalEvent.target, '.e-rte-quick-popup');
|
|
21782
|
-
var
|
|
21783
|
-
|
|
21784
|
-
this.tooltipTargetEle = closest(args.originalEvent.target, '[data-tooltip-id]');
|
|
21785
|
-
if (!isNullOrUndefined(this.tooltipTargetEle) && this.parent.showTooltip && !isNullOrUndefined(currentDocument.querySelector('.e-tooltip-wrap'))) {
|
|
21786
|
-
this.parent.notify(destroyTooltip, { args: event });
|
|
21787
|
-
if (!this.tooltipTargetEle.closest('.e-rte-quick-popup')) {
|
|
21788
|
-
this.tooltipTargetEle.setAttribute('data-title', this.tooltipTargetEle.getAttribute('title'));
|
|
21789
|
-
this.tooltipTargetEle.removeAttribute('title');
|
|
21790
|
-
EventHandler.add(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler, this);
|
|
21791
|
-
}
|
|
21792
|
-
}
|
|
22137
|
+
var target = args.originalEvent.target;
|
|
22138
|
+
this.parent.notify(closeTooltip, { target: target });
|
|
21793
22139
|
if (item.command !== 'FormatPainter') {
|
|
21794
22140
|
if (closestElement && !closestElement.classList.contains('e-rte-inline-popup') && !closestElement.classList.contains('e-rte-text-popup')) {
|
|
21795
22141
|
if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
|
|
@@ -22712,6 +23058,9 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
22712
23058
|
this.setImageProperties(allImg[i]);
|
|
22713
23059
|
}
|
|
22714
23060
|
this.addTempClass(clipBoardElem);
|
|
23061
|
+
if (clipBoardElem.querySelectorAll('picture').length > 0) {
|
|
23062
|
+
this.processPictureElement(clipBoardElem);
|
|
23063
|
+
}
|
|
22715
23064
|
if (clipBoardElem.textContent !== '' || !isNullOrUndefined(clipBoardElem.querySelector('img')) ||
|
|
22716
23065
|
!isNullOrUndefined(clipBoardElem.querySelector('table'))) {
|
|
22717
23066
|
var tempWrapperElem = this.parent.createElement('div');
|
|
@@ -23171,6 +23520,26 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
23171
23520
|
}
|
|
23172
23521
|
return null;
|
|
23173
23522
|
};
|
|
23523
|
+
PasteCleanup.prototype.processPictureElement = function (clipBoardElem) {
|
|
23524
|
+
var pictureElems = clipBoardElem.querySelectorAll('picture');
|
|
23525
|
+
for (var i = 0; i < pictureElems.length; i++) {
|
|
23526
|
+
var imgElem = pictureElems[i].querySelector('img');
|
|
23527
|
+
var sourceElems = pictureElems[i].querySelectorAll('source');
|
|
23528
|
+
if (imgElem && imgElem.getAttribute('src')) {
|
|
23529
|
+
var srcValue = imgElem.getAttribute('src');
|
|
23530
|
+
var url = new URL(srcValue);
|
|
23531
|
+
for (var j = 0; j < sourceElems.length; j++) {
|
|
23532
|
+
var srcset = sourceElems[j].getAttribute('srcset');
|
|
23533
|
+
if (srcset) {
|
|
23534
|
+
if (srcset.indexOf('http') === -1) {
|
|
23535
|
+
var fullPath = url.origin + srcset;
|
|
23536
|
+
sourceElems[j].setAttribute('srcset', fullPath);
|
|
23537
|
+
}
|
|
23538
|
+
}
|
|
23539
|
+
}
|
|
23540
|
+
}
|
|
23541
|
+
}
|
|
23542
|
+
};
|
|
23174
23543
|
/**
|
|
23175
23544
|
* For internal use only - Get the module name.
|
|
23176
23545
|
*
|
|
@@ -23253,7 +23622,8 @@ var Resize = /** @__PURE__ @class */ (function () {
|
|
|
23253
23622
|
this.parent.element.style.width = (!this.parent.enableRtl) ? eventType.clientX - boundRect.left + 'px' : boundRect.right - eventType.clientX + 'px';
|
|
23254
23623
|
}
|
|
23255
23624
|
if (!this.parent.toolbarSettings.enable) {
|
|
23256
|
-
this.parent.
|
|
23625
|
+
var isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
23626
|
+
this.parent.setContentHeight('Resize', isExpand);
|
|
23257
23627
|
}
|
|
23258
23628
|
this.parent.refreshUI();
|
|
23259
23629
|
};
|
|
@@ -23609,7 +23979,7 @@ var FullScreen = /** @__PURE__ @class */ (function () {
|
|
|
23609
23979
|
_this.parent.element.classList.add(CLS_FULL_SCREEN);
|
|
23610
23980
|
_this.toggleParentOverflow(true);
|
|
23611
23981
|
var isExpand = _this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
23612
|
-
_this.parent.setContentHeight(
|
|
23982
|
+
_this.parent.setContentHeight('Maximize', isExpand);
|
|
23613
23983
|
if (_this.parent.toolbarModule) {
|
|
23614
23984
|
if (!_this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
|
|
23615
23985
|
_this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
|
|
@@ -23661,7 +24031,7 @@ var FullScreen = /** @__PURE__ @class */ (function () {
|
|
|
23661
24031
|
removeClass([elem[i]], ['e-rte-overflow']);
|
|
23662
24032
|
}
|
|
23663
24033
|
var isExpand = _this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
23664
|
-
_this.parent.setContentHeight(
|
|
24034
|
+
_this.parent.setContentHeight('Minimize', isExpand);
|
|
23665
24035
|
if (_this.parent.toolbarModule) {
|
|
23666
24036
|
if (!_this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
|
|
23667
24037
|
_this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
|
|
@@ -24012,10 +24382,10 @@ var EmojiPicker = /** @__PURE__ @class */ (function () {
|
|
|
24012
24382
|
}
|
|
24013
24383
|
this.popDiv = this.parent.createElement('div', { className: 'e-rte-emojipicker-popup', id: this.parent.getID() + '_emojiPicker' });
|
|
24014
24384
|
if (!isNullOrUndefined(this.parent.getToolbar()) && !this.parent.inlineMode.enable) {
|
|
24015
|
-
this.parent.getToolbar().appendChild(this.popDiv);
|
|
24385
|
+
this.parent.getToolbar().parentElement.appendChild(this.popDiv);
|
|
24016
24386
|
}
|
|
24017
24387
|
else if (this.parent.inlineMode.enable) {
|
|
24018
|
-
this.parent.
|
|
24388
|
+
this.parent.element.appendChild(this.popDiv);
|
|
24019
24389
|
}
|
|
24020
24390
|
EventHandler.add(this.popDiv, 'keydown', this.onKeyDown, this);
|
|
24021
24391
|
EventHandler.add(this.popDiv, 'keyup', this.searchFilter, this);
|
|
@@ -25446,7 +25816,6 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25446
25816
|
this.isAllowedTypes = true;
|
|
25447
25817
|
this.pageX = null;
|
|
25448
25818
|
this.pageY = null;
|
|
25449
|
-
this.mouseX = null;
|
|
25450
25819
|
this.deletedImg = [];
|
|
25451
25820
|
this.parent = parent;
|
|
25452
25821
|
this.rteID = parent.element.id;
|
|
@@ -25604,11 +25973,6 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25604
25973
|
}
|
|
25605
25974
|
var args = { event: e, requestType: 'images' };
|
|
25606
25975
|
this.parent.trigger(resizeStop, args);
|
|
25607
|
-
/* eslint-disable */
|
|
25608
|
-
var pageX = this.getPointX(e);
|
|
25609
|
-
var pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
|
|
25610
|
-
this.parent.element.getBoundingClientRect().top + e.clientY : e.pageY;
|
|
25611
|
-
/* eslint-enable */
|
|
25612
25976
|
this.parent.formatter.editorManager.observer.on(checkUndo, this.undoStack, this);
|
|
25613
25977
|
this.parent.formatter.saveData();
|
|
25614
25978
|
};
|
|
@@ -25639,17 +26003,15 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25639
26003
|
if (this.quickToolObj) {
|
|
25640
26004
|
this.quickToolObj.imageQTBar.hidePopup();
|
|
25641
26005
|
}
|
|
25642
|
-
|
|
25643
|
-
|
|
25644
|
-
|
|
25645
|
-
|
|
25646
|
-
|
|
25647
|
-
|
|
25648
|
-
|
|
25649
|
-
|
|
25650
|
-
|
|
25651
|
-
if (target.classList.contains('e-rte-botRight')) {
|
|
25652
|
-
this.resizeBtnStat.botRight = true;
|
|
26006
|
+
var handlers = ['topLeft', 'topRight', 'botLeft', 'botRight'];
|
|
26007
|
+
for (var i = 0; i < handlers.length; i++) {
|
|
26008
|
+
var handler = handlers[i];
|
|
26009
|
+
if (target.classList.contains('e-rte-' + handler)) {
|
|
26010
|
+
this.resizeBtnStat[handler] = true;
|
|
26011
|
+
this.currentResizeHandler = handler;
|
|
26012
|
+
this.aspectRatio = this.findAspectRatio(this.imgEle);
|
|
26013
|
+
break; // Exit the loop once a match is found
|
|
26014
|
+
}
|
|
25653
26015
|
}
|
|
25654
26016
|
if (Browser.isDevice && this.contentModule.getEditPanel().contains(this.imgResizeDiv) &&
|
|
25655
26017
|
!this.imgResizeDiv.classList.contains('e-mob-span')) {
|
|
@@ -25780,89 +26142,80 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25780
26142
|
};
|
|
25781
26143
|
}
|
|
25782
26144
|
};
|
|
25783
|
-
Image.prototype.setAspectRatio = function (img, expectedX, expectedY
|
|
26145
|
+
Image.prototype.setAspectRatio = function (img, expectedX, expectedY) {
|
|
25784
26146
|
if (isNullOrUndefined(img.width)) {
|
|
25785
26147
|
return;
|
|
25786
26148
|
}
|
|
25787
|
-
|
|
25788
|
-
var
|
|
25789
|
-
|
|
25790
|
-
var
|
|
25791
|
-
|
|
25792
|
-
|
|
25793
|
-
if (
|
|
25794
|
-
if (
|
|
25795
|
-
|
|
25796
|
-
|
|
25797
|
-
img.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
|
|
26149
|
+
var width = img.width;
|
|
26150
|
+
var height = img.height;
|
|
26151
|
+
var sameHeightWidth = (width === height);
|
|
26152
|
+
var factor = this.parent.insertImageSettings.resizeByPercent ? '%' : 'px';
|
|
26153
|
+
var emptyStyleDimension = (img.style.width === '' && img.style.height === '');
|
|
26154
|
+
if (!sameHeightWidth && !emptyStyleDimension) {
|
|
26155
|
+
if (img.style.width !== '' && img.style.height !== '') {
|
|
26156
|
+
if (this.parent.insertImageSettings.resizeByPercent) {
|
|
26157
|
+
this.setImageWidth(img, expectedX, factor);
|
|
26158
|
+
this.removeImageHeight(img);
|
|
25798
26159
|
}
|
|
25799
26160
|
else {
|
|
25800
|
-
|
|
26161
|
+
this.setImageWidth(img, expectedX, factor);
|
|
26162
|
+
this.setImageHeight(img, expectedY, factor);
|
|
25801
26163
|
}
|
|
25802
|
-
img.style.height = null;
|
|
25803
|
-
img.removeAttribute('height');
|
|
25804
|
-
}
|
|
25805
|
-
else if (img.style.width === '' && img.style.height !== '') {
|
|
25806
|
-
img.style.height = expectedY + 'px';
|
|
25807
|
-
}
|
|
25808
|
-
else if (img.style.width !== '' && img.style.height === '') {
|
|
25809
|
-
var currentWidth = ((width / height * expectedY) + width / height) <
|
|
25810
|
-
(this.parent.inputElement.getBoundingClientRect().right - 32) ?
|
|
25811
|
-
((width / height * expectedY) + width / height) : (this.parent.inputElement.getBoundingClientRect().right - 32);
|
|
25812
|
-
img.style.width = currentWidth.toString() + 'px';
|
|
25813
|
-
img.style.height = expectedY + 'px';
|
|
25814
26164
|
}
|
|
25815
26165
|
else if (img.style.width !== '') {
|
|
25816
|
-
|
|
25817
|
-
|
|
25818
|
-
|
|
25819
|
-
img.style.height = expectedY + 'px';
|
|
25820
|
-
}
|
|
25821
|
-
else {
|
|
25822
|
-
if (this.parent.iframeSettings.enable) {
|
|
25823
|
-
img.setAttribute('width', (img.width + this.mouseX).toString());
|
|
26166
|
+
if (this.parent.insertImageSettings.resizeByPercent) {
|
|
26167
|
+
this.setImageWidth(img, expectedX, factor);
|
|
26168
|
+
this.removeImageHeight(img);
|
|
25824
26169
|
}
|
|
25825
26170
|
else {
|
|
25826
|
-
|
|
25827
|
-
img.setAttribute('width', (currentWidth).toString());
|
|
26171
|
+
this.setImageWidth(img, expectedX, factor);
|
|
25828
26172
|
}
|
|
25829
26173
|
}
|
|
25830
|
-
|
|
25831
|
-
|
|
25832
|
-
|
|
25833
|
-
|
|
25834
|
-
var original = img.offsetWidth + this.mouseX;
|
|
25835
|
-
var finalWidthByPerc = (original / img.offsetWidth) * (parseFloat(img.style.width).toString() === 'NaN' ?
|
|
25836
|
-
(img.offsetWidth / (parseFloat(getComputedStyle(this.parent.element).width)) * 100) :
|
|
25837
|
-
parseFloat(img.style.width));
|
|
25838
|
-
img.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
|
|
26174
|
+
else if (img.style.height !== '') {
|
|
26175
|
+
if (this.parent.insertImageSettings.resizeByPercent) {
|
|
26176
|
+
this.setImageWidth(img, expectedX, factor);
|
|
26177
|
+
this.removeImageHeight(img);
|
|
25839
26178
|
}
|
|
25840
26179
|
else {
|
|
25841
|
-
|
|
26180
|
+
this.setImageHeight(img, expectedY, factor);
|
|
25842
26181
|
}
|
|
25843
|
-
img.style.height = null;
|
|
25844
|
-
img.removeAttribute('height');
|
|
25845
|
-
}
|
|
25846
|
-
else if (img.style.width !== '') {
|
|
25847
|
-
img.style.width = expectedX + 'px';
|
|
25848
|
-
img.style.height = (height / width * expectedX) + 'px';
|
|
25849
|
-
}
|
|
25850
|
-
else {
|
|
25851
|
-
img.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - img.getBoundingClientRect().left).toString() : expectedX.toString());
|
|
25852
26182
|
}
|
|
25853
26183
|
}
|
|
25854
26184
|
else {
|
|
26185
|
+
this.setImageWidth(img, expectedX, factor);
|
|
25855
26186
|
if (this.parent.insertImageSettings.resizeByPercent) {
|
|
25856
|
-
|
|
25857
|
-
img.style.height = null;
|
|
25858
|
-
img.removeAttribute('height');
|
|
26187
|
+
this.removeImageHeight(img);
|
|
25859
26188
|
}
|
|
25860
26189
|
else {
|
|
25861
|
-
|
|
25862
|
-
img.style.height = ((expectedX >= 15) ? expectedX : 15) + 'px';
|
|
26190
|
+
this.setImageHeight(img, expectedY, factor);
|
|
25863
26191
|
}
|
|
25864
26192
|
}
|
|
25865
26193
|
};
|
|
26194
|
+
Image.prototype.setImageWidth = function (img, value, suffix) {
|
|
26195
|
+
img.style.width = this.getImageDimension(value, img) + suffix;
|
|
26196
|
+
if (!this.parent.insertImageSettings.resizeByPercent) {
|
|
26197
|
+
img.setAttribute('width', value.toString());
|
|
26198
|
+
}
|
|
26199
|
+
};
|
|
26200
|
+
Image.prototype.setImageHeight = function (img, value, suffix) {
|
|
26201
|
+
img.style.height = this.getImageDimension(value, img) + suffix;
|
|
26202
|
+
if (!this.parent.insertImageSettings.resizeByPercent) {
|
|
26203
|
+
img.setAttribute('height', value.toString());
|
|
26204
|
+
}
|
|
26205
|
+
};
|
|
26206
|
+
Image.prototype.removeImageHeight = function (img) {
|
|
26207
|
+
img.style.height = '';
|
|
26208
|
+
img.removeAttribute('height');
|
|
26209
|
+
};
|
|
26210
|
+
Image.prototype.getImageDimension = function (value, img) {
|
|
26211
|
+
if (this.parent.insertImageSettings.resizeByPercent) {
|
|
26212
|
+
var rootElem = img.parentElement || img.previousElementSibling;
|
|
26213
|
+
return this.pixToPerc(value, rootElem);
|
|
26214
|
+
}
|
|
26215
|
+
else {
|
|
26216
|
+
return value;
|
|
26217
|
+
}
|
|
26218
|
+
};
|
|
25866
26219
|
Image.prototype.pixToPerc = function (expected, parentEle) {
|
|
25867
26220
|
return expected / parseFloat(getComputedStyle(parentEle).width) * 100;
|
|
25868
26221
|
};
|
|
@@ -25885,7 +26238,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25885
26238
|
return;
|
|
25886
26239
|
}
|
|
25887
26240
|
_this.imgEle.parentElement.style.cursor = 'pointer';
|
|
25888
|
-
_this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10)
|
|
26241
|
+
_this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10));
|
|
25889
26242
|
_this.resizeImgDupPos(_this.imgEle);
|
|
25890
26243
|
_this.imgResizePos(_this.imgEle, _this.imgResizeDiv);
|
|
25891
26244
|
}
|
|
@@ -25896,35 +26249,37 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25896
26249
|
this.cancelResizeAction();
|
|
25897
26250
|
return;
|
|
25898
26251
|
}
|
|
25899
|
-
if (this.
|
|
25900
|
-
|
|
25901
|
-
|
|
25902
|
-
|
|
25903
|
-
|
|
25904
|
-
|
|
25905
|
-
|
|
25906
|
-
|
|
25907
|
-
|
|
25908
|
-
|
|
25909
|
-
|
|
25910
|
-
|
|
25911
|
-
|
|
25912
|
-
|
|
25913
|
-
|
|
25914
|
-
|
|
25915
|
-
|
|
25916
|
-
|
|
25917
|
-
|
|
25918
|
-
|
|
25919
|
-
this.
|
|
25920
|
-
|
|
25921
|
-
else if (this.resizeBtnStat.topRight) {
|
|
25922
|
-
this.imgDupMouseMove(width + 'px', height + 'px', e);
|
|
25923
|
-
}
|
|
25924
|
-
else if (this.resizeBtnStat.topLeft) {
|
|
26252
|
+
if (this.resizeBtnStat.botRight || this.resizeBtnStat.botLeft || this.resizeBtnStat.topRight || this.resizeBtnStat.topLeft) {
|
|
26253
|
+
var pageX = this.getPointX(e);
|
|
26254
|
+
var pageY = this.getPointY(e);
|
|
26255
|
+
var resizeFactor = this.getResizeFactor(this.currentResizeHandler);
|
|
26256
|
+
var diffX = (pageX - this.pageX);
|
|
26257
|
+
var diffY = (pageY - this.pageY);
|
|
26258
|
+
var currentWidth = this.imgEle.clientWidth;
|
|
26259
|
+
var currentHeight = this.imgEle.clientHeight;
|
|
26260
|
+
var width = diffX * resizeFactor[0] + currentWidth;
|
|
26261
|
+
var height = diffY * resizeFactor[1] + currentHeight;
|
|
26262
|
+
width = (width < 16) ? 16 : width;
|
|
26263
|
+
height = (height < 16) ? 16 : height;
|
|
26264
|
+
if (Math.abs(diffX) > Math.abs(diffY)) {
|
|
26265
|
+
height = Math.round(width / this.aspectRatio);
|
|
26266
|
+
width = Math.round(height * this.aspectRatio);
|
|
26267
|
+
}
|
|
26268
|
+
else {
|
|
26269
|
+
width = Math.round(height * this.aspectRatio);
|
|
26270
|
+
height = Math.round(width / this.aspectRatio);
|
|
26271
|
+
}
|
|
26272
|
+
this.pageX = pageX;
|
|
26273
|
+
this.pageY = pageY;
|
|
25925
26274
|
this.imgDupMouseMove(width + 'px', height + 'px', e);
|
|
25926
26275
|
}
|
|
25927
26276
|
};
|
|
26277
|
+
Image.prototype.getResizeFactor = function (value) {
|
|
26278
|
+
return imageResizeFactor[value];
|
|
26279
|
+
};
|
|
26280
|
+
Image.prototype.findAspectRatio = function (image) {
|
|
26281
|
+
return image.clientWidth / image.clientHeight;
|
|
26282
|
+
};
|
|
25928
26283
|
Image.prototype.cancelResizeAction = function () {
|
|
25929
26284
|
EventHandler.remove(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing);
|
|
25930
26285
|
EventHandler.remove(this.contentModule.getDocument(), Browser.touchEndEvent, this.resizeEnd);
|
|
@@ -25934,6 +26289,8 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25934
26289
|
this.imgResizeDiv = null;
|
|
25935
26290
|
this.pageX = null;
|
|
25936
26291
|
this.pageY = null;
|
|
26292
|
+
this.currentResizeHandler = null;
|
|
26293
|
+
this.aspectRatio = null;
|
|
25937
26294
|
}
|
|
25938
26295
|
};
|
|
25939
26296
|
Image.prototype.resizeImgDupPos = function (e) {
|
|
@@ -25944,6 +26301,8 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25944
26301
|
};
|
|
25945
26302
|
};
|
|
25946
26303
|
Image.prototype.resizeBtnInit = function () {
|
|
26304
|
+
this.aspectRatio = null;
|
|
26305
|
+
this.currentResizeHandler = null;
|
|
25947
26306
|
return this.resizeBtnStat = { botLeft: false, botRight: false, topRight: false, topLeft: false };
|
|
25948
26307
|
};
|
|
25949
26308
|
Image.prototype.onToolbarAction = function (args) {
|
|
@@ -26453,7 +26812,6 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26453
26812
|
selectNode: e.selectNode, selectParent: e.selectParent, link: inputLink, target: target_1, ariaLabel: imageLabel
|
|
26454
26813
|
};
|
|
26455
26814
|
this.dialogObj.setProperties({
|
|
26456
|
-
height: 'inherit',
|
|
26457
26815
|
width: '290px',
|
|
26458
26816
|
header: this.parent.localeObj.getConstant('imageInsertLinkHeader'),
|
|
26459
26817
|
content: linkWrap,
|
|
@@ -26506,7 +26864,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26506
26864
|
alt: inputAlt
|
|
26507
26865
|
};
|
|
26508
26866
|
this.dialogObj.setProperties({
|
|
26509
|
-
|
|
26867
|
+
width: '290px', header: altHeader, content: altWrap,
|
|
26510
26868
|
buttons: [{
|
|
26511
26869
|
// eslint-disable-next-line
|
|
26512
26870
|
click: function (e) {
|
|
@@ -26755,7 +27113,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26755
27113
|
var dialogContent = this.imgsizeInput(e);
|
|
26756
27114
|
var selectObj_1 = { args: e.args, selfImage: this, selection: e.selection, selectNode: e.selectNode };
|
|
26757
27115
|
this.dialogObj.setProperties({
|
|
26758
|
-
|
|
27116
|
+
width: '290px', header: imgSizeHeader, content: dialogContent,
|
|
26759
27117
|
buttons: [{
|
|
26760
27118
|
// eslint-disable-next-line
|
|
26761
27119
|
click: function (e) {
|
|
@@ -26956,7 +27314,6 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26956
27314
|
for (var i = 0; i < items.length; i++) {
|
|
26957
27315
|
removeClass([items[i]], 'e-img-focus');
|
|
26958
27316
|
removeClass([items[i]], 'e-resize');
|
|
26959
|
-
items[i].style.maxWidth = '';
|
|
26960
27317
|
}
|
|
26961
27318
|
}
|
|
26962
27319
|
};
|
|
@@ -26970,7 +27327,6 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26970
27327
|
this.cancelResizeAction();
|
|
26971
27328
|
}
|
|
26972
27329
|
};
|
|
26973
|
-
// eslint-disable-next-line
|
|
26974
27330
|
Image.prototype.imageUrlPopup = function (e) {
|
|
26975
27331
|
var _this = this;
|
|
26976
27332
|
var imgUrl = this.parent.createElement('div', { className: 'imgUrl' + this.parent.getCssClass(true) });
|
|
@@ -27057,6 +27413,12 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
27057
27413
|
var heightVal = isNullOrUndefined(this.changedHeightValue) && (selectNode.style.height.toString() === 'auto' ||
|
|
27058
27414
|
selectNode.style.height !== '') ? selectNode.style.height : !isNullOrUndefined(this.changedHeightValue) ?
|
|
27059
27415
|
this.changedHeightValue : (parseInt(selectNode.getClientRects()[0].height.toString(), 10)).toString();
|
|
27416
|
+
if (selectNode.style.width === '') {
|
|
27417
|
+
widthVal = 'auto';
|
|
27418
|
+
}
|
|
27419
|
+
if (selectNode.style.height === '') {
|
|
27420
|
+
heightVal = 'auto';
|
|
27421
|
+
}
|
|
27060
27422
|
this.changedWidthValue = null;
|
|
27061
27423
|
this.changedHeightValue = null;
|
|
27062
27424
|
var content = '<div class="e-rte-label' + this.parent.getCssClass(true) + '"><label>' + imgWidth +
|
|
@@ -27191,7 +27553,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
27191
27553
|
_this.parent.trigger(imageSelected, selectArgs, function (selectArgs) {
|
|
27192
27554
|
if (!selectArgs.cancel) {
|
|
27193
27555
|
_this.checkExtension(selectArgs.filesData[0]);
|
|
27194
|
-
altText = selectArgs.filesData[0].name;
|
|
27556
|
+
altText = selectArgs.filesData[0].name.replace(/\.[a-zA-Z0-9]+$/, '');
|
|
27195
27557
|
if (_this.parent.editorMode === 'HTML' && isNullOrUndefined(_this.parent.insertImageSettings.path)) {
|
|
27196
27558
|
var reader_1 = new FileReader();
|
|
27197
27559
|
// eslint-disable-next-line
|
|
@@ -28765,7 +29127,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
28765
29127
|
var dialogContent = this.vidsizeInput(e);
|
|
28766
29128
|
var selectObj_1 = { args: e.args, selfVideo: this, selection: e.selection, selectNode: e.selectNode };
|
|
28767
29129
|
this.dialogObj.setProperties({
|
|
28768
|
-
|
|
29130
|
+
width: '290px', header: vidSizeHeader, content: dialogContent,
|
|
28769
29131
|
buttons: [{
|
|
28770
29132
|
// eslint-disable-next-line
|
|
28771
29133
|
click: function (e) {
|
|
@@ -29137,7 +29499,6 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
29137
29499
|
_this.setAspectRatio(_this.videoEle, parseInt(width, 10), parseInt(height, 10), args);
|
|
29138
29500
|
_this.resizeVidDupPos(_this.videoEle);
|
|
29139
29501
|
_this.vidResizePos(_this.videoEle, _this.vidResizeDiv);
|
|
29140
|
-
_this.parent.setContentHeight('', false);
|
|
29141
29502
|
}
|
|
29142
29503
|
});
|
|
29143
29504
|
};
|
|
@@ -29950,8 +30311,12 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
29950
30311
|
_this.parent.trigger(fileRemoving, e, function (e) {
|
|
29951
30312
|
proxy.isVideoUploaded = false;
|
|
29952
30313
|
_this.dialogObj.getButtons(0).element.disabled = true;
|
|
29953
|
-
|
|
29954
|
-
|
|
30314
|
+
if (proxy.inputUrl.getAttribute('disabled')) {
|
|
30315
|
+
proxy.inputUrl.removeAttribute('disabled');
|
|
30316
|
+
}
|
|
30317
|
+
if (proxy.embedInputUrl.getAttribute('disabled')) {
|
|
30318
|
+
proxy.embedInputUrl.removeAttribute('disabled');
|
|
30319
|
+
}
|
|
29955
30320
|
if (proxy.uploadUrl) {
|
|
29956
30321
|
proxy.uploadUrl.url = '';
|
|
29957
30322
|
}
|
|
@@ -30187,7 +30552,6 @@ var ViewSource = /** @__PURE__ @class */ (function () {
|
|
|
30187
30552
|
rteContent.appendChild(this.previewElement);
|
|
30188
30553
|
this.parent.element.appendChild(rteContent);
|
|
30189
30554
|
rteContent.style.height = this.contentModule.getPanel().style.height;
|
|
30190
|
-
rteContent.style.marginTop = this.contentModule.getPanel().style.marginTop;
|
|
30191
30555
|
this.getPanel().value = this.getTextAreaValue();
|
|
30192
30556
|
this.contentModule.getPanel().style.display = 'none';
|
|
30193
30557
|
rteContent.style.display = 'block';
|
|
@@ -30208,14 +30572,17 @@ var ViewSource = /** @__PURE__ @class */ (function () {
|
|
|
30208
30572
|
removeClass([this.parent.getToolbar()], [CLS_EXPAND_OPEN]);
|
|
30209
30573
|
}
|
|
30210
30574
|
removeClass(tbItems, [CLS_ACTIVE]);
|
|
30211
|
-
this.parent.
|
|
30575
|
+
var isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
30576
|
+
this.parent.setContentHeight('SourceCode', isExpand);
|
|
30212
30577
|
this.wireEvent(this.previewElement);
|
|
30213
30578
|
this.unWireBaseKeyDown();
|
|
30214
30579
|
this.previewElement.focus();
|
|
30215
30580
|
this.parent.updateValue();
|
|
30216
30581
|
if (!isNullOrUndefined(this.parent.placeholder) && !this.parent.iframeSettings.enable) {
|
|
30217
30582
|
var placeHolderWrapper = this.parent.element.querySelector('.rte-placeholder.e-rte-placeholder');
|
|
30218
|
-
placeHolderWrapper
|
|
30583
|
+
if (placeHolderWrapper) {
|
|
30584
|
+
placeHolderWrapper.style.display = 'none';
|
|
30585
|
+
}
|
|
30219
30586
|
}
|
|
30220
30587
|
this.parent.trigger(actionComplete, { requestType: 'SourceCode', targetItem: 'SourceCode', args: args });
|
|
30221
30588
|
this.parent.invokeChangeEvent();
|
|
@@ -30271,7 +30638,8 @@ var ViewSource = /** @__PURE__ @class */ (function () {
|
|
|
30271
30638
|
if (this.parent.getToolbar()) {
|
|
30272
30639
|
removeClass([this.parent.getToolbar()], [CLS_EXPAND_OPEN]);
|
|
30273
30640
|
}
|
|
30274
|
-
this.parent.
|
|
30641
|
+
var isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
30642
|
+
this.parent.setContentHeight('Preview', isExpand);
|
|
30275
30643
|
this.unWireEvent();
|
|
30276
30644
|
this.wireBaseKeyDown();
|
|
30277
30645
|
this.contentModule.getEditPanel().focus();
|
|
@@ -30346,6 +30714,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30346
30714
|
this.pageY = null;
|
|
30347
30715
|
this.moveEle = null;
|
|
30348
30716
|
this.currentColumnResize = '';
|
|
30717
|
+
this.resizeEndTime = 0;
|
|
30349
30718
|
this.parent = parent;
|
|
30350
30719
|
this.rteID = parent.element.id;
|
|
30351
30720
|
this.l10n = serviceLocator.getService('rteLocale');
|
|
@@ -30503,7 +30872,15 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30503
30872
|
Table.prototype.keyUp = function (e) {
|
|
30504
30873
|
var target = e.args.target;
|
|
30505
30874
|
if (e.args.key.toLocaleLowerCase() === 'escape' && target && target.classList && (this.popupObj && !closest(target, '[id=' + "'" + this.popupObj.element.id + "'" + ']')) && this.popupObj) {
|
|
30875
|
+
var createTableToolbarBtn = this.popupObj.relateTo;
|
|
30876
|
+
if (createTableToolbarBtn.nodeName !== 'BUTTON') {
|
|
30877
|
+
createTableToolbarBtn = createTableToolbarBtn.querySelector('span.e-create-table');
|
|
30878
|
+
createTableToolbarBtn = createTableToolbarBtn.parentElement;
|
|
30879
|
+
}
|
|
30506
30880
|
this.popupObj.hide();
|
|
30881
|
+
if (createTableToolbarBtn) {
|
|
30882
|
+
createTableToolbarBtn.focus();
|
|
30883
|
+
}
|
|
30507
30884
|
}
|
|
30508
30885
|
};
|
|
30509
30886
|
Table.prototype.keyDown = function (e) {
|
|
@@ -30683,7 +31060,20 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30683
31060
|
return false;
|
|
30684
31061
|
}
|
|
30685
31062
|
};
|
|
31063
|
+
Table.prototype.removeEmptyTextNodes = function (element) {
|
|
31064
|
+
var children = element.childNodes;
|
|
31065
|
+
for (var i = children.length - 1; i >= 0; i--) {
|
|
31066
|
+
var node = children[i];
|
|
31067
|
+
if (node.nodeType === Node.TEXT_NODE && node.nodeValue.trim() === '') {
|
|
31068
|
+
element.removeChild(node);
|
|
31069
|
+
}
|
|
31070
|
+
}
|
|
31071
|
+
};
|
|
30686
31072
|
Table.prototype.tabSelection = function (event, selection, ele) {
|
|
31073
|
+
var allHeadBodyTRElements = ele.closest('table').querySelectorAll('thead, tbody, tr');
|
|
31074
|
+
for (var i = 0; i < allHeadBodyTRElements.length; i++) {
|
|
31075
|
+
this.removeEmptyTextNodes(allHeadBodyTRElements[i]);
|
|
31076
|
+
}
|
|
30687
31077
|
this.previousTableElement = ele;
|
|
30688
31078
|
var insideList = this.insideList(selection.range);
|
|
30689
31079
|
if ((event.keyCode === 37 || event.keyCode === 39) && selection.range.startContainer.nodeType === 3 ||
|
|
@@ -30820,10 +31210,12 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30820
31210
|
var startNode = this.parent.getRange().startContainer.parentElement;
|
|
30821
31211
|
var endNode = this.parent.getRange().endContainer.parentElement;
|
|
30822
31212
|
var isAnchorEle = this.getAnchorNode(target);
|
|
31213
|
+
var currentTime = new Date().getTime();
|
|
30823
31214
|
if (target && target.nodeName !== 'A' && isAnchorEle.nodeName !== 'A' && target.nodeName !== 'IMG' && target.nodeName !== 'VIDEO' && !target.classList.contains(CLS_CLICKELEM) &&
|
|
30824
31215
|
target.nodeName !== 'AUDIO' && startNode === endNode && (target.nodeName === 'TD' || target.nodeName === 'TH' ||
|
|
30825
31216
|
target.nodeName === 'TABLE' || (closestTable && this.parent.contentModule.getEditPanel().contains(closestTable)))
|
|
30826
|
-
&& !(range.startContainer.nodeType === 3 && !range.collapsed)
|
|
31217
|
+
&& !(range.startContainer.nodeType === 3 && !range.collapsed) &&
|
|
31218
|
+
currentTime - this.resizeEndTime > 100) {
|
|
30827
31219
|
var range_1 = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
|
|
30828
31220
|
this.parent.formatter.editorManager.nodeSelection.save(range_1, this.contentModule.getDocument());
|
|
30829
31221
|
this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
|
|
@@ -30919,7 +31311,10 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30919
31311
|
var tdNode = closest(target, 'td,th');
|
|
30920
31312
|
target = (target.nodeName !== 'TD' && tdNode && this.parent.contentModule.getEditPanel().contains(tdNode)) ?
|
|
30921
31313
|
tdNode : target;
|
|
30922
|
-
|
|
31314
|
+
if (!(this.parent.quickToolbarSettings.showOnRightClick && e.args.which === 3 &&
|
|
31315
|
+
target.classList.contains(CLS_TABLE_SEL))) {
|
|
31316
|
+
removeClass(this.contentModule.getEditPanel().querySelectorAll('table td, table th'), CLS_TABLE_SEL);
|
|
31317
|
+
}
|
|
30923
31318
|
if (target && (target.tagName === 'TD' || target.tagName === 'TH')) {
|
|
30924
31319
|
addClass([target], CLS_TABLE_SEL);
|
|
30925
31320
|
this.activeCell = target;
|
|
@@ -31308,6 +31703,9 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31308
31703
|
widthCompare = rteWidth;
|
|
31309
31704
|
}
|
|
31310
31705
|
if (_this.resizeBtnStat.column) {
|
|
31706
|
+
if (_this.curTable.closest('li')) {
|
|
31707
|
+
widthCompare = _this.curTable.closest('li').offsetWidth;
|
|
31708
|
+
}
|
|
31311
31709
|
var colGroup = _this.curTable.querySelectorAll('colgroup > col');
|
|
31312
31710
|
var currentTableWidth = void 0;
|
|
31313
31711
|
if (_this.curTable.style.width !== '' && _this.curTable.style.width.includes('%')) {
|
|
@@ -31333,6 +31731,15 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31333
31731
|
(_this.convertPixelToPercentage(tableWidth - mouseX, widthCompare) + '%');
|
|
31334
31732
|
var differenceWidth = currentTableWidth - _this.convertPixelToPercentage(tableWidth - mouseX, widthCompare);
|
|
31335
31733
|
var preMarginLeft = 0;
|
|
31734
|
+
var widthType = _this.curTable.style.width.indexOf('%') > -1;
|
|
31735
|
+
if (!widthType && _this.curTable.offsetWidth > _this.contentModule.getEditPanel().offsetWidth) {
|
|
31736
|
+
_this.curTable.style.width = rteWidth + 'px';
|
|
31737
|
+
return;
|
|
31738
|
+
}
|
|
31739
|
+
if (widthType && parseFloat(_this.curTable.style.width.split('%')[0]) > 100) {
|
|
31740
|
+
_this.curTable.style.width = '100%';
|
|
31741
|
+
return;
|
|
31742
|
+
}
|
|
31336
31743
|
if (!isNullOrUndefined(_this.curTable.style.marginLeft) && _this.curTable.style.marginLeft !== '') {
|
|
31337
31744
|
var regex = /[-+]?\d*\.\d+|\d+/;
|
|
31338
31745
|
var value = _this.curTable.style.marginLeft.match(regex);
|
|
@@ -31341,6 +31748,15 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31341
31748
|
}
|
|
31342
31749
|
}
|
|
31343
31750
|
var currentMarginLeft = preMarginLeft + differenceWidth;
|
|
31751
|
+
if (currentMarginLeft && currentMarginLeft > 100) {
|
|
31752
|
+
var width = parseFloat(_this.curTable.style.width);
|
|
31753
|
+
currentMarginLeft = 100 - width;
|
|
31754
|
+
}
|
|
31755
|
+
if (currentMarginLeft && currentMarginLeft < 1) {
|
|
31756
|
+
_this.curTable.style.marginLeft = null;
|
|
31757
|
+
_this.curTable.style.width = '100%';
|
|
31758
|
+
return;
|
|
31759
|
+
}
|
|
31344
31760
|
_this.curTable.style.marginLeft = 'calc(' + (_this.curTable.style.width === '100%' ? 0 : currentMarginLeft) + '%)';
|
|
31345
31761
|
for (var i = 0; i < firstColumnsCell.length; i++) {
|
|
31346
31762
|
var currentColumnCellWidth = _this.getCurrentColWidth(firstColumnsCell[i], tableWidth);
|
|
@@ -31411,15 +31827,26 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31411
31827
|
maxiumWidth = Math.abs(tableBoxPosition - currentTdElement.getBoundingClientRect().width) - 5;
|
|
31412
31828
|
_this.curTable.style.maxWidth = maxiumWidth + 'px';
|
|
31413
31829
|
}
|
|
31414
|
-
var widthType = _this.curTable.style.width.indexOf('%') > -1;
|
|
31415
|
-
_this.curTable.style.width = widthType ? _this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) + '%'
|
|
31416
|
-
: tableWidth + mouseX + 'px';
|
|
31417
31830
|
_this.curTable.style.height = tableHeight + mouseY + 'px';
|
|
31418
31831
|
if (!isNullOrUndefined(tableReBox)) {
|
|
31419
31832
|
tableReBox.classList.add('e-rbox-select');
|
|
31420
31833
|
tableReBox.style.cssText = 'top: ' + (_this.calcPos(_this.curTable).top + tableHeight - 4) +
|
|
31421
31834
|
'px; left:' + (_this.calcPos(_this.curTable).left + tableWidth - 4) + 'px;';
|
|
31422
31835
|
}
|
|
31836
|
+
if (_this.curTable.closest('li')) {
|
|
31837
|
+
widthCompare = _this.curTable.closest('li').offsetWidth;
|
|
31838
|
+
}
|
|
31839
|
+
var widthType = _this.curTable.style.width.indexOf('%') > -1;
|
|
31840
|
+
if (widthType && parseFloat(_this.curTable.style.width.split('%')[0]) > 100) {
|
|
31841
|
+
_this.curTable.style.width = '100%';
|
|
31842
|
+
return;
|
|
31843
|
+
}
|
|
31844
|
+
if (!widthType && _this.curTable.offsetWidth > _this.contentModule.getEditPanel().offsetWidth) {
|
|
31845
|
+
_this.curTable.style.width = rteWidth + 'px';
|
|
31846
|
+
return;
|
|
31847
|
+
}
|
|
31848
|
+
_this.curTable.style.width = widthType ? _this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) + '%'
|
|
31849
|
+
: tableWidth + mouseX + 'px';
|
|
31423
31850
|
}
|
|
31424
31851
|
}
|
|
31425
31852
|
});
|
|
@@ -31496,6 +31923,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31496
31923
|
var args = { event: e, requestType: 'table' };
|
|
31497
31924
|
this.parent.trigger(resizeStop, args);
|
|
31498
31925
|
this.parent.formatter.saveData();
|
|
31926
|
+
this.resizeEndTime = new Date().getTime();
|
|
31499
31927
|
};
|
|
31500
31928
|
Table.prototype.resetResizeHelper = function (curTable) {
|
|
31501
31929
|
var colHelper = this.parent.element.querySelectorAll('.e-table-rhelper.e-column-helper');
|
|
@@ -31510,6 +31938,9 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31510
31938
|
element.parentNode.removeChild(element);
|
|
31511
31939
|
}
|
|
31512
31940
|
});
|
|
31941
|
+
if (!curTable.style.width) {
|
|
31942
|
+
curTable.style.width = curTable.offsetWidth + 'px';
|
|
31943
|
+
}
|
|
31513
31944
|
var colGroup = curTable.querySelector('colgroup');
|
|
31514
31945
|
if (colGroup) {
|
|
31515
31946
|
for (var i = 0; i < curTable.rows.length; i++) {
|
|
@@ -31606,7 +32037,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31606
32037
|
this.createTableButton.isStringTemplate = true;
|
|
31607
32038
|
this.createTableButton.appendTo(btnEle);
|
|
31608
32039
|
EventHandler.add(btnEle, 'click', this.insertTableDialog, { self: this, args: args.args, selection: args.selection });
|
|
31609
|
-
this.parent.getToolbar().appendChild(this.dlgDiv);
|
|
32040
|
+
this.parent.getToolbar().parentElement.appendChild(this.dlgDiv);
|
|
31610
32041
|
var target = args.args.originalEvent.target;
|
|
31611
32042
|
target = target.classList.contains('e-toolbar-item') ? target.firstChild : target.parentElement;
|
|
31612
32043
|
this.popupObj = new Popup(this.dlgDiv, {
|
|
@@ -32644,7 +33075,7 @@ var PasteCleanupSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
32644
33075
|
Property(null)
|
|
32645
33076
|
], PasteCleanupSettings.prototype, "deniedAttrs", void 0);
|
|
32646
33077
|
__decorate$2([
|
|
32647
|
-
Property(['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'list-style-type', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width'])
|
|
33078
|
+
Property(['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'list-style-type', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-transform', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width'])
|
|
32648
33079
|
], PasteCleanupSettings.prototype, "allowedStyleProps", void 0);
|
|
32649
33080
|
__decorate$2([
|
|
32650
33081
|
Property(null)
|
|
@@ -32932,7 +33363,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
32932
33363
|
isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
|
|
32933
33364
|
}
|
|
32934
33365
|
if (e.args.which === 13 && !e.args.ctrlKey && (!Browser.isDevice ? e.args.code === 'Enter' : e.args.key === 'Enter')) {
|
|
32935
|
-
if (isNullOrUndefined(this.startNode.closest('LI, UL, OL')) && isNullOrUndefined(this.endNode.closest('LI, UL, OL')) &&
|
|
33366
|
+
if (isNullOrUndefined(this.startNode.closest('LI, UL, OL')) && isNullOrUndefined(this.endNode.closest('LI, UL, OL')) &&
|
|
33367
|
+
isNullOrUndefined(this.startNode.closest('.e-img-inner')) && isTableEnter &&
|
|
32936
33368
|
isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
|
|
32937
33369
|
var shiftKey_1 = e.args.shiftKey;
|
|
32938
33370
|
var actionBeginArgs = {
|
|
@@ -33366,10 +33798,10 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
33366
33798
|
}
|
|
33367
33799
|
var previousBlockNode = this.parent.formatter.editorManager.domNode.blockNodes()[0].previousSibling;
|
|
33368
33800
|
var nextBlockNode = this.parent.formatter.editorManager.domNode.blockNodes()[0].nextSibling;
|
|
33369
|
-
if (!isNullOrUndefined(previousBlockNode) && previousBlockNode.hasAttribute('style') && previousBlockNode.nodeName !== 'TABLE') {
|
|
33801
|
+
if (!isNullOrUndefined(previousBlockNode) && previousBlockNode.nodeName !== '#text' && previousBlockNode.hasAttribute('style') && previousBlockNode.nodeName !== 'TABLE') {
|
|
33370
33802
|
insertElem.setAttribute('style', previousBlockNode.getAttribute('style'));
|
|
33371
33803
|
}
|
|
33372
|
-
if (isNullOrUndefined(previousBlockNode) && !isNullOrUndefined(nextBlockNode) && nextBlockNode.hasAttribute('style') && nextBlockNode.nodeName !== 'TABLE') {
|
|
33804
|
+
if (isNullOrUndefined(previousBlockNode) && !isNullOrUndefined(nextBlockNode) && nextBlockNode.nodeName !== '#text' && nextBlockNode.hasAttribute('style') && nextBlockNode.nodeName !== 'TABLE') {
|
|
33373
33805
|
insertElem.setAttribute('style', nextBlockNode.getAttribute('style'));
|
|
33374
33806
|
}
|
|
33375
33807
|
return insertElem;
|
|
@@ -33447,6 +33879,14 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
33447
33879
|
member: 'image',
|
|
33448
33880
|
args: [this, this.serviceLocator]
|
|
33449
33881
|
});
|
|
33882
|
+
modules.push({
|
|
33883
|
+
member: 'audio',
|
|
33884
|
+
args: [this, this.serviceLocator]
|
|
33885
|
+
});
|
|
33886
|
+
modules.push({
|
|
33887
|
+
member: 'video',
|
|
33888
|
+
args: [this, this.serviceLocator]
|
|
33889
|
+
});
|
|
33450
33890
|
if (this.quickToolbarSettings.enable) {
|
|
33451
33891
|
modules.push({ member: 'quickToolbar', args: [this, this.serviceLocator] });
|
|
33452
33892
|
}
|
|
@@ -33460,14 +33900,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
33460
33900
|
if (this.editorMode === 'HTML') {
|
|
33461
33901
|
modules.push({ member: 'htmlEditor', args: [this, this.serviceLocator] });
|
|
33462
33902
|
modules.push({ member: 'pasteCleanup', args: [this, this.serviceLocator] });
|
|
33463
|
-
modules.push({
|
|
33464
|
-
member: 'audio',
|
|
33465
|
-
args: [this, this.serviceLocator]
|
|
33466
|
-
});
|
|
33467
|
-
modules.push({
|
|
33468
|
-
member: 'video',
|
|
33469
|
-
args: [this, this.serviceLocator]
|
|
33470
|
-
});
|
|
33471
33903
|
modules.push({
|
|
33472
33904
|
member: 'formatPainter',
|
|
33473
33905
|
args: [this]
|
|
@@ -33499,7 +33931,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
33499
33931
|
else {
|
|
33500
33932
|
if (this.getToolbar()) {
|
|
33501
33933
|
removeClass(this.getToolbar().querySelectorAll('.' + CLS_ACTIVE), CLS_ACTIVE);
|
|
33502
|
-
removeClass([this.getToolbar()], [CLS_TB_FLOAT
|
|
33934
|
+
removeClass([this.getToolbar().parentElement], [CLS_TB_FLOAT]);
|
|
33503
33935
|
}
|
|
33504
33936
|
addClass([this.element], CLS_DISABLED);
|
|
33505
33937
|
this.element.tabIndex = -1;
|
|
@@ -33920,7 +34352,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
33920
34352
|
(this.toolbarSettings.items.indexOf('Undo') > -1 && this.toolbarSettings.items.indexOf('Redo') > -1)) {
|
|
33921
34353
|
this.disableToolbarItem(['Undo', 'Redo']);
|
|
33922
34354
|
}
|
|
33923
|
-
this.setContentHeight();
|
|
34355
|
+
this.setContentHeight('Init');
|
|
33924
34356
|
if (this.value !== null) {
|
|
33925
34357
|
this.valueContainer.defaultValue = this.value;
|
|
33926
34358
|
}
|
|
@@ -34126,8 +34558,15 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34126
34558
|
case 'toolbar-focus':
|
|
34127
34559
|
if (this.toolbarSettings.enable && this.getToolbarElement()) {
|
|
34128
34560
|
var firstActiveItem = this.getToolbarElement().querySelector('.e-toolbar-item:not(.e-overlay)[title]');
|
|
34129
|
-
|
|
34130
|
-
|
|
34561
|
+
var quickToolbarElem = this.getRenderedQuickToolbarElem();
|
|
34562
|
+
if (quickToolbarElem) {
|
|
34563
|
+
firstActiveItem = quickToolbarElem.querySelector('.e-toolbar-item:not(.e-overlay)[title]');
|
|
34564
|
+
}
|
|
34565
|
+
if (firstActiveItem) {
|
|
34566
|
+
var firstChild = firstActiveItem.firstElementChild;
|
|
34567
|
+
firstChild.removeAttribute('tabindex');
|
|
34568
|
+
firstChild.focus();
|
|
34569
|
+
}
|
|
34131
34570
|
}
|
|
34132
34571
|
break;
|
|
34133
34572
|
case 'escape':
|
|
@@ -34344,6 +34783,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34344
34783
|
_this.notify(pasteClean, { args: e });
|
|
34345
34784
|
}
|
|
34346
34785
|
else {
|
|
34786
|
+
console.warn('[WARNING] :: Module "pasteCleanup" is not available in RichTextEditor component! You either misspelled the module name or forgot to load it.');
|
|
34347
34787
|
var args_2 = { requestType: 'Paste', editorMode: _this.editorMode, event: e };
|
|
34348
34788
|
var value = null;
|
|
34349
34789
|
var htmlValue = false;
|
|
@@ -34638,7 +35078,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34638
35078
|
break;
|
|
34639
35079
|
case 'height':
|
|
34640
35080
|
this.setHeight(newProp[prop]);
|
|
34641
|
-
this.setContentHeight();
|
|
35081
|
+
this.setContentHeight('Init');
|
|
34642
35082
|
this.autoResize();
|
|
34643
35083
|
break;
|
|
34644
35084
|
case 'readonly':
|
|
@@ -34685,11 +35125,11 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34685
35125
|
break;
|
|
34686
35126
|
case 'inlineMode':
|
|
34687
35127
|
this.notify(modelChanged, { module: 'quickToolbar', newProp: newProp, oldProp: oldProp });
|
|
34688
|
-
this.setContentHeight();
|
|
35128
|
+
this.setContentHeight('Init');
|
|
34689
35129
|
break;
|
|
34690
35130
|
case 'toolbarSettings':
|
|
34691
35131
|
this.notify(modelChanged, { module: 'toolbar', newProp: newProp, oldProp: oldProp });
|
|
34692
|
-
this.setContentHeight();
|
|
35132
|
+
this.setContentHeight('Init');
|
|
34693
35133
|
break;
|
|
34694
35134
|
case 'maxLength':
|
|
34695
35135
|
if (this.showCharCount) {
|
|
@@ -34848,7 +35288,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34848
35288
|
this.inputElement.setAttribute('placeholder', this.placeholder);
|
|
34849
35289
|
}
|
|
34850
35290
|
}
|
|
34851
|
-
if (this.placeholder && this.iframeSettings.enable) {
|
|
35291
|
+
if (this.placeholder && this.iframeSettings.enable && this.inputElement) {
|
|
34852
35292
|
if (this.inputElement.textContent.length === 0 && this.inputElement.childNodes.length < 2 && !isNullOrUndefined(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
|
|
34853
35293
|
((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNullOrUndefined(this.inputElement.firstChild.firstChild) &&
|
|
34854
35294
|
this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
|
|
@@ -35195,12 +35635,9 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35195
35635
|
*/
|
|
35196
35636
|
RichTextEditor.prototype.setContentHeight = function (target, isExpand) {
|
|
35197
35637
|
var heightValue;
|
|
35198
|
-
var topValue = 0;
|
|
35199
35638
|
var rteHeightPercent;
|
|
35200
35639
|
var heightPercent = typeof (this.height) === 'string' && this.height.indexOf('%') > -1;
|
|
35201
|
-
var cntEle =
|
|
35202
|
-
this.sourceCodeModule.getPanel().parentElement.style.display === 'block') ? this.sourceCodeModule.getPanel().parentElement :
|
|
35203
|
-
this.contentModule.getPanel();
|
|
35640
|
+
var cntEle = this.contentModule.getPanel();
|
|
35204
35641
|
var rteHeight = this.element.offsetHeight;
|
|
35205
35642
|
if (rteHeight === 0 && this.height !== 'auto' && !this.getToolbar()) {
|
|
35206
35643
|
rteHeight = parseInt(this.height, 10);
|
|
@@ -35212,39 +35649,36 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35212
35649
|
var rzHandle = this.element.querySelector('.' + CLS_RTE_RES_HANDLE);
|
|
35213
35650
|
var rzHeight = this.enableResize ? (!isNullOrUndefined(rzHandle) ? (rzHandle.offsetHeight + 8) : 0) : 0;
|
|
35214
35651
|
var expandPopHeight = this.getToolbar() ? this.toolbarModule.getExpandTBarPopHeight() : 0;
|
|
35215
|
-
if (this.
|
|
35216
|
-
|
|
35217
|
-
topValue = (!this.toolbarSettings.enableFloating) ? expandPopHeight : 0;
|
|
35652
|
+
if (target && target !== 'Toolbar' && expandPopHeight && this.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0) {
|
|
35653
|
+
tbHeight = tbHeight - expandPopHeight;
|
|
35218
35654
|
}
|
|
35219
|
-
|
|
35220
|
-
if (
|
|
35221
|
-
heightValue = 'auto';
|
|
35655
|
+
if (this.toolbarSettings.type === ToolbarType.Expand) {
|
|
35656
|
+
if (isExpand) {
|
|
35657
|
+
heightValue = (this.height === 'auto' && this.element.style.height === 'auto') ? 'auto' : rteHeight - (tbHeight + expandPopHeight + rzHeight) + 'px';
|
|
35222
35658
|
}
|
|
35223
35659
|
else {
|
|
35224
|
-
heightValue =
|
|
35660
|
+
heightValue = (this.height === 'auto' && this.element.style.height === 'auto') ? 'auto' : rteHeight - (tbHeight - expandPopHeight + rzHeight) + 'px';
|
|
35225
35661
|
}
|
|
35226
35662
|
}
|
|
35227
|
-
|
|
35228
|
-
|
|
35229
|
-
|
|
35230
|
-
|
|
35663
|
+
else {
|
|
35664
|
+
heightValue = (this.height === 'auto' && this.element.style.height === 'auto') ? 'auto' : rteHeight - tbHeight + 'px';
|
|
35665
|
+
}
|
|
35666
|
+
var finalHeight = heightPercent && rteHeightPercent ? rteHeightPercent : heightValue;
|
|
35667
|
+
switch (target) {
|
|
35668
|
+
case 'Init':
|
|
35669
|
+
case 'Toolbar':
|
|
35670
|
+
case 'WindowResize':
|
|
35671
|
+
case 'Refresh':
|
|
35672
|
+
if (this.element.querySelectorAll('.e-source-content').length > 0 && this.element.querySelector('.e-source-content').style.display === 'block') {
|
|
35673
|
+
setStyleAttribute(this.element.querySelector('.e-source-content'), { height: finalHeight });
|
|
35231
35674
|
}
|
|
35232
|
-
|
|
35233
|
-
|
|
35234
|
-
if (target === 'windowResize' && heightPercent) {
|
|
35235
|
-
//cntEle hide the borderBottom of RichTextEditor. so removed the 2px of cntEle height.
|
|
35236
|
-
heightValue = parseInt(heightValue, 10) - 2 + 'px';
|
|
35675
|
+
else {
|
|
35676
|
+
setStyleAttribute(cntEle, { height: finalHeight });
|
|
35237
35677
|
}
|
|
35238
|
-
|
|
35239
|
-
|
|
35240
|
-
|
|
35241
|
-
|
|
35242
|
-
var codeElement = select('.' + CLS_RTE_CONTENT, this.element);
|
|
35243
|
-
setStyleAttribute(codeElement, { height: heightValue, marginTop: topValue + 'px' });
|
|
35244
|
-
}
|
|
35245
|
-
if (this.toolbarSettings.enableFloating && this.getToolbar() && !this.inlineMode.enable) {
|
|
35246
|
-
var tbWrapHeight = (isExpand ? (tbHeight + expandPopHeight) : tbHeight) + 'px';
|
|
35247
|
-
setStyleAttribute(this.getToolbar().parentElement, { height: tbWrapHeight });
|
|
35678
|
+
break;
|
|
35679
|
+
case 'Resize':
|
|
35680
|
+
setStyleAttribute(cntEle, { height: finalHeight });
|
|
35681
|
+
break;
|
|
35248
35682
|
}
|
|
35249
35683
|
if (rzHeight === 0) {
|
|
35250
35684
|
this.autoResize();
|
|
@@ -35447,18 +35881,14 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35447
35881
|
RichTextEditor.prototype.resizeHandler = function () {
|
|
35448
35882
|
var isExpand = false;
|
|
35449
35883
|
if (!document.body.contains(this.element)) {
|
|
35450
|
-
document.defaultView.removeEventListener('resize', this.onResizeHandler, true);
|
|
35884
|
+
document.defaultView.removeEventListener('resize', debounce(this.onResizeHandler, 10), true);
|
|
35451
35885
|
return;
|
|
35452
35886
|
}
|
|
35453
35887
|
if (this.toolbarSettings.enable && !this.inlineMode.enable) {
|
|
35454
35888
|
this.toolbarModule.refreshToolbarOverflow();
|
|
35455
35889
|
isExpand = this.toolbarModule.baseToolbar.toolbarObj.element.classList.contains(CLS_EXPAND_OPEN);
|
|
35456
35890
|
}
|
|
35457
|
-
|
|
35458
|
-
// When resize the window,border bottom of cntEle and this.element border visible separatly.so none the cntEle borderBottom.
|
|
35459
|
-
this.contentModule.getPanel().style.borderBottom = 'none';
|
|
35460
|
-
}
|
|
35461
|
-
this.setContentHeight('windowResize', isExpand);
|
|
35891
|
+
this.setContentHeight('WindowResize', isExpand);
|
|
35462
35892
|
this.notify(windowResize, null);
|
|
35463
35893
|
};
|
|
35464
35894
|
RichTextEditor.prototype.scrollHandler = function (e) {
|
|
@@ -35594,6 +36024,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35594
36024
|
this.isRTE = false;
|
|
35595
36025
|
}
|
|
35596
36026
|
this.notify(docClick, { args: e });
|
|
36027
|
+
var hideQuickToolbarChecker = this.quickToolbarModule && !this.inlineMode.enable && isNullOrUndefined(this.quickToolbarModule.inlineQTBar);
|
|
36028
|
+
if ((hideQuickToolbarChecker && !isNullOrUndefined(closest(target, '.' + 'e-toolbar-wrapper'))) || (hideQuickToolbarChecker && (!isNullOrUndefined(closest(target, '.e-rte-table-resize')) || !isNullOrUndefined(closest(target, '.e-table-box'))))) {
|
|
36029
|
+
this.quickToolbarModule.hideQuickToolbars();
|
|
36030
|
+
}
|
|
35597
36031
|
if (Browser.info.name !== 'msie' && e.detail > 3) {
|
|
35598
36032
|
e.preventDefault();
|
|
35599
36033
|
}
|
|
@@ -35743,9 +36177,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35743
36177
|
this.triggerEditArea(e.originalEvent);
|
|
35744
36178
|
};
|
|
35745
36179
|
RichTextEditor.prototype.contextHandler = function (e) {
|
|
35746
|
-
var closestElem = closest(e.target, 'a, table, img');
|
|
36180
|
+
var closestElem = closest(e.target, 'a, table, img, video, audio');
|
|
35747
36181
|
if (this.inlineMode.onSelection === false || (!isNullOrUndefined(closestElem) && this.inputElement.contains(closestElem)
|
|
35748
|
-
&& (closestElem.tagName === 'IMG' || closestElem.tagName === 'TABLE' || closestElem.tagName === 'A'
|
|
36182
|
+
&& (closestElem.tagName === 'IMG' || closestElem.tagName === 'TABLE' || closestElem.tagName === 'A' ||
|
|
36183
|
+
closestElem.tagName.toLowerCase() === 'video' || closestElem.tagName.toLowerCase() === 'audio'))) {
|
|
35749
36184
|
e.preventDefault();
|
|
35750
36185
|
}
|
|
35751
36186
|
};
|
|
@@ -35779,10 +36214,21 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35779
36214
|
}
|
|
35780
36215
|
};
|
|
35781
36216
|
RichTextEditor.prototype.setAutoHeight = function (element) {
|
|
35782
|
-
if (!isNullOrUndefined(element)) {
|
|
36217
|
+
if (!isNullOrUndefined(element) && !this.iframeSettings.enable) {
|
|
35783
36218
|
element.style.height = this.inputElement.scrollHeight + 'px';
|
|
35784
36219
|
element.style.overflow = 'hidden';
|
|
35785
36220
|
}
|
|
36221
|
+
else if (!isNullOrUndefined(element) && !isNullOrUndefined(element.parentElement) && this.iframeSettings.enable) {
|
|
36222
|
+
var newRange = this.getRange();
|
|
36223
|
+
element.style.height = 'auto';
|
|
36224
|
+
var newHeight = element.contentDocument.body.scrollHeight + 'px';
|
|
36225
|
+
element.style.height = newHeight;
|
|
36226
|
+
element.style.overflow = 'hidden';
|
|
36227
|
+
// 16 px added for padding doesn't affect the editor height
|
|
36228
|
+
if (newRange.startContainer.nodeName !== '#text' && newRange.startContainer.nodeName !== 'BODY' && window.innerHeight < newRange.startContainer.getBoundingClientRect().top + element.getBoundingClientRect().top + 16) {
|
|
36229
|
+
newRange.startContainer.scrollIntoView(false);
|
|
36230
|
+
}
|
|
36231
|
+
}
|
|
35786
36232
|
};
|
|
35787
36233
|
RichTextEditor.prototype.wireEvents = function () {
|
|
35788
36234
|
this.element.addEventListener('focusin', this.onFocusHandler, true);
|
|
@@ -35837,7 +36283,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35837
36283
|
EventHandler.add(this.inputElement, Browser.touchStartEvent, this.mouseDownHandler, this);
|
|
35838
36284
|
this.wireContextEvent();
|
|
35839
36285
|
this.formatter.editorManager.observer.on(KEY_DOWN_HANDLER, this.editorKeyDown, this);
|
|
35840
|
-
this.element.ownerDocument.defaultView.addEventListener('resize', this.onResizeHandler, true);
|
|
36286
|
+
this.element.ownerDocument.defaultView.addEventListener('resize', debounce(this.onResizeHandler, 10), true);
|
|
35841
36287
|
if (this.iframeSettings.enable) {
|
|
35842
36288
|
EventHandler.add(this.inputElement, 'focusin', this.focusHandler, this);
|
|
35843
36289
|
EventHandler.add(this.inputElement, 'focusout', this.blurHandler, this);
|
|
@@ -35903,7 +36349,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35903
36349
|
if (this.formatter) {
|
|
35904
36350
|
this.formatter.editorManager.observer.off(KEY_DOWN_HANDLER, this.editorKeyDown);
|
|
35905
36351
|
}
|
|
35906
|
-
this.element.ownerDocument.defaultView.removeEventListener('resize', this.onResizeHandler, true);
|
|
36352
|
+
this.element.ownerDocument.defaultView.removeEventListener('resize', debounce(this.onResizeHandler, 10), true);
|
|
35907
36353
|
if (this.iframeSettings.enable) {
|
|
35908
36354
|
EventHandler.remove(this.inputElement, 'focusin', this.focusHandler);
|
|
35909
36355
|
EventHandler.remove(this.inputElement, 'focusout', this.blurHandler);
|
|
@@ -35968,6 +36414,15 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35968
36414
|
}
|
|
35969
36415
|
}
|
|
35970
36416
|
};
|
|
36417
|
+
RichTextEditor.prototype.getRenderedQuickToolbarElem = function () {
|
|
36418
|
+
var quickToolbars = this.quickToolbarModule.getQuickToolbarInstance();
|
|
36419
|
+
for (var i = 0; i < quickToolbars.length; i++) {
|
|
36420
|
+
if (quickToolbars[i] && quickToolbars[i].isRendered) {
|
|
36421
|
+
return quickToolbars[i].element;
|
|
36422
|
+
}
|
|
36423
|
+
}
|
|
36424
|
+
return null;
|
|
36425
|
+
};
|
|
35971
36426
|
__decorate$1([
|
|
35972
36427
|
Complex({}, ToolbarSettings$1)
|
|
35973
36428
|
], RichTextEditor.prototype, "toolbarSettings", void 0);
|
|
@@ -36272,5 +36727,5 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
36272
36727
|
* Rich Text Editor component exported items
|
|
36273
36728
|
*/
|
|
36274
36729
|
|
|
36275
|
-
export { Toolbar$2 as Toolbar, KeyboardEvents$1 as KeyboardEvents, BaseToolbar, BaseQuickToolbar, QuickToolbar, Count, ColorPickerInput, MarkdownToolbarStatus, ExecCommandCallBack, ToolbarAction, MarkdownEditor, HtmlEditor, PasteCleanup, Resize, DropDownButtons, FileManager$1 as FileManager, FullScreen, setAttributes, HtmlToolbarStatus, XhtmlValidation, FormatPainter, EmojiPicker, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, Image$1 as Image, Audio, Video, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, tableclass, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, tableModulekeyUp, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, audioToolbarAction, videoToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertAudio, insertVideo, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, audioDelete, videoDelete, imageCaption, imageSize, videoSize, sourceCode, updateSource, toolbarOpen, beforeDropDownOpen, selectionSave, selectionRestore, expandPopupClick, count, contentFocus, contentBlur, mouseDown, sourceCodeMouseDown, editAreaClick, scroll, contentscroll, colorPickerChanged, tableColorPickerChanged, focusChange, selectAll$1 as selectAll, selectRange, getSelectedHtml, renderInlineToolbar, paste, imgModule, rtlMode, createTable, docClick, tableToolbarAction, checkUndo, readOnlyMode, moduleDestroy, pasteClean, enterHandler, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, fileSelected, fileUploading, fileUploadSuccess, fileUploadFailed, fileRemoving, afterImageDelete, afterMediaDelete, drop, xhtmlValidation, beforeImageUpload, beforeFileUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, showAudioDialog, showVideoDialog, closeImageDialog, closeAudioDialog, closeVideoDialog, showTableDialog, closeTableDialog, bindCssClass, formatPainterClick, formatPainterDoubleClick, emojiPicker, destroyTooltip, hidePopup, cleanupResizeElements, afterKeyDown, updateValueOnIdle, documentClickClosedBy, showColorPicker, blockEmptyNodes, inlineEmptyNodes, supportedUnits, conversionFactors, onHandleFontsizeChange, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT,
|
|
36730
|
+
export { Toolbar$2 as Toolbar, KeyboardEvents$1 as KeyboardEvents, BaseToolbar, BaseQuickToolbar, QuickToolbar, Count, ColorPickerInput, MarkdownToolbarStatus, ExecCommandCallBack, ToolbarAction, MarkdownEditor, HtmlEditor, PasteCleanup, Resize, DropDownButtons, FileManager$1 as FileManager, FullScreen, setAttributes, HtmlToolbarStatus, XhtmlValidation, FormatPainter, EmojiPicker, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, Image$1 as Image, Audio, Video, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, tableclass, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, tableModulekeyUp, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, audioToolbarAction, videoToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertAudio, insertVideo, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, audioDelete, videoDelete, imageCaption, imageSize, videoSize, sourceCode, updateSource, toolbarOpen, beforeDropDownOpen, selectionSave, selectionRestore, expandPopupClick, count, contentFocus, contentBlur, mouseDown, sourceCodeMouseDown, editAreaClick, scroll, contentscroll, colorPickerChanged, tableColorPickerChanged, focusChange, selectAll$1 as selectAll, selectRange, getSelectedHtml, renderInlineToolbar, paste, imgModule, rtlMode, createTable, docClick, tableToolbarAction, checkUndo, readOnlyMode, moduleDestroy, pasteClean, enterHandler, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, fileSelected, fileUploading, fileUploadSuccess, fileUploadFailed, fileRemoving, afterImageDelete, afterMediaDelete, drop, xhtmlValidation, beforeImageUpload, beforeFileUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, showAudioDialog, showVideoDialog, closeImageDialog, closeAudioDialog, closeVideoDialog, showTableDialog, closeTableDialog, bindCssClass, formatPainterClick, formatPainterDoubleClick, emojiPicker, destroyTooltip, hidePopup, cleanupResizeElements, afterKeyDown, updateValueOnIdle, documentClickClosedBy, showColorPicker, closeTooltip, blockEmptyNodes, inlineEmptyNodes, supportedUnits, conversionFactors, onHandleFontsizeChange, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT, CLS_INLINE, CLS_TB_INLINE, CLS_RTE_EXPAND_TB, CLS_FULL_SCREEN, CLS_QUICK_TB, CLS_TEXT_QUICK_TB, CLS_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_POP, CLS_TEXT_POP, CLS_INLINE_POP, CLS_INLINE_DROPDOWN, CLS_DROPDOWN_POPUP, CLS_DROPDOWN_ICONS, CLS_DROPDOWN_ITEMS, CLS_DROPDOWN_BTN, CLS_RTE_CONTENT, CLS_TB_ITEM, CLS_TB_EXTENDED, CLS_TB_WRAP, CLS_POPUP, CLS_SEPARATOR, CLS_MINIMIZE, CLS_MAXIMIZE, CLS_BACK, CLS_SHOW, CLS_HIDE, CLS_VISIBLE, CLS_FOCUS, CLS_RM_WHITE_SPACE, CLS_IMGRIGHT, CLS_IMGLEFT, CLS_IMGCENTER, CLS_IMGBREAK, CLS_AUDIOBREAK, CLS_CLICKELEM, CLS_VID_CLICK_ELEM, CLS_AUDIOWRAP, CLS_VIDEOWRAP, CLS_VIDEOBREAK, CLS_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, CLS_AUDIOINLINE, CLS_VIDEOINLINE, CLS_COUNT, CLS_WARNING, CLS_ERROR, CLS_ICONS, CLS_ACTIVE, CLS_EXPAND_OPEN, CLS_RTE_ELEMENTS, CLS_TB_BTN, CLS_HR_SEPARATOR, CLS_TB_IOS_FIX, CLS_LIST_PRIMARY_CONTENT, CLS_NUMBERFORMATLIST_TB_BTN, CLS_BULLETFORMATLIST_TB_BTN, CLS_FORMATS_TB_BTN, CLS_FONT_NAME_TB_BTN, CLS_FONT_SIZE_TB_BTN, CLS_ALIGN_TB_BTN, CLS_FONT_COLOR_TARGET, CLS_BACKGROUND_COLOR_TARGET, CLS_COLOR_CONTENT, CLS_FONT_COLOR_DROPDOWN, CLS_BACKGROUND_COLOR_DROPDOWN, CLS_COLOR_PALETTE, CLS_FONT_COLOR_PICKER, CLS_BACKGROUND_COLOR_PICKER, CLS_RTE_READONLY, CLS_TABLE_SEL, CLS_TB_DASH_BOR, CLS_TB_ALT_BOR, CLS_TB_COL_RES, CLS_TB_ROW_RES, CLS_TB_BOX_RES, CLS_RTE_HIDDEN, CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT, CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT, CLS_RTE_RES_HANDLE, CLS_RTE_RES_EAST, CLS_RTE_IMAGE, CLS_RESIZE, CLS_IMG_FOCUS, CLS_AUD_FOCUS, CLS_VID_FOCUS, CLS_RTE_DRAG_IMAGE, CLS_RTE_UPLOAD_POPUP, CLS_POPUP_OPEN, CLS_IMG_RESIZE, CLS_DROPAREA, CLS_IMG_INNER, CLS_UPLOAD_FILES, CLS_RTE_DIALOG_UPLOAD, CLS_RTE_RES_CNT, CLS_CUSTOM_TILE, CLS_NOCOLOR_ITEM, CLS_TABLE, CLS_TABLE_BORDER, CLS_RTE_TABLE_RESIZE, CLS_RTE_FIXED_TB_EXPAND, CLS_RTE_TB_ENABLED, CLS_RTE_RES_WEST, CLS_RTE_SOURCE_CODE_TXTAREA, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, getTooltipTextDropdownItems, getQuickToolbarTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, getDefaultValue, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, AUDIO, VIDEO, TABLE, LINK, INSERT_ROW, INSERT_COLUMN, DELETEROW, DELETECOLUMN, REMOVETABLE, TABLEHEADER, TABLE_VERTICAL_ALIGN, TABLE_MERGE, TABLE_VERTICAL_SPLIT, TABLE_HORIZONTAL_SPLIT, TABLE_MOVE, ALIGNMENT_TYPE, INDENT_TYPE, DEFAULT_TAG, BLOCK_TAGS, IGNORE_BLOCK_TAGS, TABLE_BLOCK_TAGS, SELECTION_TYPE, INSERTHTML_TYPE, INSERT_TEXT_TYPE, CLEAR_TYPE, SELF_CLOSING_TAGS, PASTE_SOURCE, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_VIDEO_RIGHT, CLASS_VIDEO_LEFT, CLASS_VIDEO_CENTER, CLASS_IMAGE_BREAK, CLASS_AUDIO_BREAK, CLASS_VIDEO_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, CLASS_AUDIO_INLINE, CLASS_CLICK_ELEM, CLASS_VIDEO_CLICK_ELEM, CLASS_AUDIO, CLASS_VIDEO, CLASS_AUDIO_WRAP, CLASS_VIDEO_WRAP, CLASS_EMBED_VIDEO_WRAP, CLASS_AUDIO_FOCUS, CLASS_VIDEO_FOCUS, CLASS_VIDEO_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, AudioCommand, VideoCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, FormatPainterActions, EmojiPickerAction, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, INSERT_TEXT_COMMAND, ClearFormat, MDLists, MDFormats, MarkdownSelection, UndoRedoCommands, MDSelectionFormats, MDLink, MDTable, markdownFormatTags, markdownSelectionTags, markdownListsTags, htmlKeyConfig, markdownKeyConfig, pasteCleanupGroupingTags, listConversionFilters, selfClosingTags, imageResizeFactor, KEY_DOWN, ACTION, FORMAT_TYPE, KEY_DOWN_HANDLER, LIST_TYPE, KEY_UP_HANDLER, KEY_UP, MODEL_CHANGED_PLUGIN, MODEL_CHANGED, MS_WORD_CLEANUP_PLUGIN, MS_WORD_CLEANUP, ON_BEGIN, SPACE_ACTION, FORMAT_PAINTER_ACTIONS, EMOJI_PICKER_ACTIONS, MOUSE_DOWN };
|
|
36276
36731
|
//# sourceMappingURL=ej2-richtexteditor.es5.js.map
|