@syncfusion/ej2-richtexteditor 24.2.9 → 25.1.37
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 +32 -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 +936 -500
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +921 -490
- 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 +163 -13
- 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 +31 -0
- package/src/editor-manager/plugin/link.js +1 -1
- package/src/editor-manager/plugin/lists.js +36 -2
- package/src/editor-manager/plugin/ms-word-clean-up.js +67 -59
- package/src/editor-manager/plugin/selection-commands.js +56 -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 +41 -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 +1 -1
- package/src/rich-text-editor/actions/enter-key.js +2 -1
- 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 +8 -26
- 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 +23 -8
- 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 +83 -62
- 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 +68 -11
- 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 +61 -17
- package/styles/bootstrap.css +62 -18
- package/styles/bootstrap4.css +62 -18
- package/styles/bootstrap5-dark.css +68 -17
- package/styles/bootstrap5.css +68 -17
- package/styles/fabric-dark.css +61 -17
- package/styles/fabric.css +62 -18
- package/styles/fluent-dark.css +61 -17
- package/styles/fluent.css +61 -17
- package/styles/highcontrast-light.css +61 -17
- package/styles/highcontrast.css +62 -18
- package/styles/material-dark.css +61 -17
- package/styles/material.css +61 -17
- package/styles/material3-dark.css +63 -19
- package/styles/material3.css +63 -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 +51 -17
- 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 +61 -17
- package/styles/rich-text-editor/bootstrap.css +62 -18
- package/styles/rich-text-editor/bootstrap4.css +62 -18
- package/styles/rich-text-editor/bootstrap5-dark.css +68 -17
- package/styles/rich-text-editor/bootstrap5.css +68 -17
- package/styles/rich-text-editor/fabric-dark.css +61 -17
- package/styles/rich-text-editor/fabric.css +62 -18
- package/styles/rich-text-editor/fluent-dark.css +61 -17
- package/styles/rich-text-editor/fluent.css +61 -17
- package/styles/rich-text-editor/highcontrast-light.css +61 -17
- package/styles/rich-text-editor/highcontrast.css +62 -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 +61 -17
- package/styles/rich-text-editor/material.css +61 -17
- package/styles/rich-text-editor/material3-dark.css +63 -19
- package/styles/rich-text-editor/material3.css +63 -19
- package/styles/rich-text-editor/tailwind-dark.css +65 -25
- package/styles/rich-text-editor/tailwind.css +65 -25
- package/styles/tailwind-dark.css +65 -25
- package/styles/tailwind.css +65 -25
|
@@ -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;
|
|
@@ -3967,8 +4035,6 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3967
4035
|
target: colorPicker.element.parentElement, cssClass: css,
|
|
3968
4036
|
enablePersistence: this.parent.enablePersistence, enableRtl: this.parent.enableRtl,
|
|
3969
4037
|
beforeOpen: function (dropDownArgs) {
|
|
3970
|
-
colorPicker.inline = true;
|
|
3971
|
-
colorPicker.dataBind();
|
|
3972
4038
|
if (proxy.parent.readonly || !proxy.parent.enabled) {
|
|
3973
4039
|
dropDownArgs.cancel = true;
|
|
3974
4040
|
return;
|
|
@@ -4107,14 +4173,18 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
4107
4173
|
var colorPicker = new ColorPicker({
|
|
4108
4174
|
enablePersistence: this.parent.enablePersistence,
|
|
4109
4175
|
enableRtl: this.parent.enableRtl,
|
|
4110
|
-
inline:
|
|
4111
|
-
value:
|
|
4176
|
+
inline: true,
|
|
4177
|
+
value: null,
|
|
4178
|
+
cssClass: ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass + ' ' + 'e-rte-picker-init',
|
|
4112
4179
|
created: function () {
|
|
4113
4180
|
var value = (item === 'backgroundcolor') ? proxy.parent.backgroundColor.default : proxy.parent.fontColor.default;
|
|
4114
|
-
colorPicker.
|
|
4181
|
+
colorPicker.cssClass = ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass;
|
|
4182
|
+
colorPicker.value = value;
|
|
4115
4183
|
},
|
|
4116
4184
|
mode: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.mode : proxy.parent.fontColor.mode),
|
|
4117
4185
|
modeSwitcher: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.modeSwitcher : proxy.parent.fontColor.modeSwitcher),
|
|
4186
|
+
presetColors: (item === 'backgroundcolor') ? this.parent.backgroundColor.colorCode : this.parent.fontColor.colorCode,
|
|
4187
|
+
columns: (item === 'backgroundcolor') ? this.parent.backgroundColor.columns : this.parent.fontColor.columns,
|
|
4118
4188
|
beforeTileRender: function (args) {
|
|
4119
4189
|
args.element.classList.add(CLS_COLOR_PALETTE);
|
|
4120
4190
|
args.element.classList.add(CLS_CUSTOM_TILE);
|
|
@@ -4159,10 +4229,6 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
4159
4229
|
}
|
|
4160
4230
|
});
|
|
4161
4231
|
colorPicker.isStringTemplate = true;
|
|
4162
|
-
colorPicker.columns = (item === 'backgroundcolor') ? this.parent.backgroundColor.columns : this.parent.fontColor.columns;
|
|
4163
|
-
colorPicker.presetColors = (item === 'backgroundcolor') ? this.parent.backgroundColor.colorCode :
|
|
4164
|
-
this.parent.fontColor.colorCode;
|
|
4165
|
-
colorPicker.cssClass = ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass;
|
|
4166
4232
|
colorPicker.createElement = this.parent.createElement;
|
|
4167
4233
|
colorPicker.appendTo(document.getElementById(args.target));
|
|
4168
4234
|
return colorPicker;
|
|
@@ -4304,23 +4370,13 @@ var BaseToolbar = /** @__PURE__ @class */ (function () {
|
|
|
4304
4370
|
case '-':
|
|
4305
4371
|
return { type: 'Separator', cssClass: CLS_HR_SEPARATOR };
|
|
4306
4372
|
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
|
-
}
|
|
4373
|
+
return {
|
|
4374
|
+
id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
|
|
4375
|
+
prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
|
|
4376
|
+
tooltipText: getTooltipText(itemStr, this.locator),
|
|
4377
|
+
command: this.tools[itemStr.toLocaleLowerCase()].command,
|
|
4378
|
+
subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
|
|
4379
|
+
};
|
|
4324
4380
|
}
|
|
4325
4381
|
}
|
|
4326
4382
|
};
|
|
@@ -4373,17 +4429,21 @@ var BaseToolbar = /** @__PURE__ @class */ (function () {
|
|
|
4373
4429
|
var item = tbItems_1[_i];
|
|
4374
4430
|
_loop_1(item);
|
|
4375
4431
|
}
|
|
4376
|
-
|
|
4377
|
-
var
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4432
|
+
if (this.parent.showTooltip) {
|
|
4433
|
+
for (var num = 0; num < items.length; num++) {
|
|
4434
|
+
var tooltipText = items[num].tooltipText;
|
|
4435
|
+
var shortCutKey = void 0;
|
|
4436
|
+
if (windowKeys["" + tooltipText]) {
|
|
4437
|
+
shortCutKey = window.navigator.platform.toLocaleLowerCase().includes('mac') ? windowKeys["" + tooltipText].replace('Ctrl', 'Cmd') : windowKeys["" + tooltipText];
|
|
4438
|
+
}
|
|
4439
|
+
else {
|
|
4440
|
+
shortCutKey = tooltipText;
|
|
4441
|
+
}
|
|
4442
|
+
if (shortCutKey) {
|
|
4443
|
+
if (!(items[num].command === "Images" && items[num].subCommand === "InsertLink")) {
|
|
4444
|
+
items[num].tooltipText = (tooltipText !== shortCutKey) ? tooltipText + ' (' + shortCutKey + ')' : tooltipText;
|
|
4445
|
+
}
|
|
4446
|
+
}
|
|
4387
4447
|
}
|
|
4388
4448
|
}
|
|
4389
4449
|
return items;
|
|
@@ -4433,7 +4493,7 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
|
|
|
4433
4493
|
addClass([args.element], item.cssClass);
|
|
4434
4494
|
}
|
|
4435
4495
|
if (item.command === 'Images' || item.command === 'Videos' || item.command === 'Audios' || item.command === 'Table') {
|
|
4436
|
-
args.element.setAttribute('title', getQuickToolbarTooltipText(item.text));
|
|
4496
|
+
args.element.setAttribute('title', getQuickToolbarTooltipText(item.text) !== '' ? getQuickToolbarTooltipText(item.text) : item.text);
|
|
4437
4497
|
}
|
|
4438
4498
|
if (item.command === 'Alignments' || item.subCommand === 'JustifyLeft'
|
|
4439
4499
|
|| item.subCommand === 'JustifyRight' || item.subCommand === 'JustifyCenter') {
|
|
@@ -4443,13 +4503,13 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
|
|
|
4443
4503
|
args.element.setAttribute('title', getTooltipTextDropdownItems(item.subCommand.toLocaleLowerCase(), this.locator, formatsLocale));
|
|
4444
4504
|
}
|
|
4445
4505
|
if (item.command === 'Font') {
|
|
4446
|
-
args.element.setAttribute('title', getTooltipTextDropdownItems(item.
|
|
4506
|
+
args.element.setAttribute('title', getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, fontNameLocale) !== '' ? getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, fontNameLocale) : item.text);
|
|
4447
4507
|
}
|
|
4448
4508
|
if (item.subCommand === 'BulletFormatList') {
|
|
4449
|
-
args.element.setAttribute('title', getTooltipTextDropdownItems(item.
|
|
4509
|
+
args.element.setAttribute('title', getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, bulletFormatListLocale) !== '' ? getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, bulletFormatListLocale) : item.text);
|
|
4450
4510
|
}
|
|
4451
4511
|
if (item.subCommand === 'NumberFormatList') {
|
|
4452
|
-
args.element.setAttribute('title', getTooltipTextDropdownItems(item.text.
|
|
4512
|
+
args.element.setAttribute('title', (getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, numberFormatListLocale)) !== '' ? getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, numberFormatListLocale) : item.text);
|
|
4453
4513
|
}
|
|
4454
4514
|
if (item.subCommand === 'FontSize') {
|
|
4455
4515
|
args.element.setAttribute('title', getTooltipTextDropdownItems(item.value.toLocaleLowerCase(), null, null, this.parent));
|
|
@@ -5259,72 +5319,14 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5259
5319
|
}
|
|
5260
5320
|
};
|
|
5261
5321
|
Toolbar$$1.prototype.toggleFloatClass = function (e) {
|
|
5262
|
-
var topValue;
|
|
5263
|
-
var isBody = false;
|
|
5264
|
-
var isFloat = false;
|
|
5265
|
-
var scrollParent;
|
|
5266
5322
|
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
|
-
}
|
|
5307
|
-
}
|
|
5308
|
-
else {
|
|
5309
|
-
var parent_1 = this.parent.element.getBoundingClientRect();
|
|
5310
|
-
if (window.innerHeight < parent_1.top) {
|
|
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%' });
|
|
5323
|
+
if (this.parent.toolbarSettings.enableFloating) {
|
|
5324
|
+
addClass([this.tbElement.parentElement], [CLS_TB_FLOAT]);
|
|
5325
|
+
setStyleAttribute(this.tbElement.parentElement, { top: (floatOffset) + 'px' });
|
|
5324
5326
|
}
|
|
5325
5327
|
else {
|
|
5326
|
-
|
|
5327
|
-
setStyleAttribute(this.tbElement, {
|
|
5328
|
+
removeClass([this.tbElement.parentElement], [CLS_TB_FLOAT]);
|
|
5329
|
+
setStyleAttribute(this.tbElement.parentElement, { top: '' });
|
|
5328
5330
|
}
|
|
5329
5331
|
};
|
|
5330
5332
|
Toolbar$$1.prototype.renderToolbar = function () {
|
|
@@ -5630,19 +5632,6 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5630
5632
|
this.toolbarActionModule.parent = null;
|
|
5631
5633
|
this.dropDownModule.parent = null;
|
|
5632
5634
|
};
|
|
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
5635
|
Toolbar$$1.prototype.mouseDownHandler = function () {
|
|
5647
5636
|
if (Browser.isDevice && this.parent.inlineMode.enable && !isIDevice()) {
|
|
5648
5637
|
this.showFixedTBar();
|
|
@@ -5679,11 +5668,6 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5679
5668
|
};
|
|
5680
5669
|
Toolbar$$1.prototype.adjustContentHeight = function (trg, isKeyboard) {
|
|
5681
5670
|
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
5671
|
var hasActiveClass = trg.classList.contains('e-nav-active');
|
|
5688
5672
|
var isExpand = isKeyboard ? (hasActiveClass ? false : true) : (hasActiveClass ? true : false);
|
|
5689
5673
|
if (isExpand) {
|
|
@@ -5692,7 +5676,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5692
5676
|
else {
|
|
5693
5677
|
removeClass([this.tbElement], [CLS_EXPAND_OPEN]);
|
|
5694
5678
|
}
|
|
5695
|
-
this.parent.setContentHeight('
|
|
5679
|
+
this.parent.setContentHeight('Toolbar', isExpand);
|
|
5696
5680
|
}
|
|
5697
5681
|
else if (Browser.isDevice || this.parent.inlineMode.enable) {
|
|
5698
5682
|
this.isToolbar = true;
|
|
@@ -5717,7 +5701,6 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5717
5701
|
this.dropDownModule = new DropDownButtons(this.parent, this.locator);
|
|
5718
5702
|
this.toolbarActionModule = new ToolbarAction(this.parent);
|
|
5719
5703
|
this.parent.on(initialEnd, this.renderToolbar, this);
|
|
5720
|
-
this.parent.on(scroll, this.scrollHandler, this);
|
|
5721
5704
|
this.parent.on(bindOnEnd, this.toolbarBindEvent, this);
|
|
5722
5705
|
this.parent.on(toolbarUpdated, this.updateToolbarStatus, this);
|
|
5723
5706
|
this.parent.on(modelChanged, this.onPropertyChanged, this);
|
|
@@ -5742,7 +5725,6 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5742
5725
|
return;
|
|
5743
5726
|
}
|
|
5744
5727
|
this.parent.off(initialEnd, this.renderToolbar);
|
|
5745
|
-
this.parent.off(scroll, this.scrollHandler);
|
|
5746
5728
|
this.parent.off(bindOnEnd, this.toolbarBindEvent);
|
|
5747
5729
|
this.parent.off(toolbarUpdated, this.updateToolbarStatus);
|
|
5748
5730
|
this.parent.off(modelChanged, this.onPropertyChanged);
|
|
@@ -5777,7 +5759,8 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5777
5759
|
if (!this.parent.inlineMode.enable) {
|
|
5778
5760
|
this.refreshToolbarOverflow();
|
|
5779
5761
|
}
|
|
5780
|
-
this.parent.
|
|
5762
|
+
var isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
5763
|
+
this.parent.setContentHeight('Refresh', isExpand);
|
|
5781
5764
|
};
|
|
5782
5765
|
/**
|
|
5783
5766
|
* Called internally if any of the property value changed.
|
|
@@ -5798,6 +5781,11 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5798
5781
|
}
|
|
5799
5782
|
}
|
|
5800
5783
|
}
|
|
5784
|
+
if (!isNullOrUndefined(e.newProp.toolbarSettings)) {
|
|
5785
|
+
if (!isNullOrUndefined(e.newProp.toolbarSettings.enableFloating)) {
|
|
5786
|
+
this.toggleFloatClass();
|
|
5787
|
+
}
|
|
5788
|
+
}
|
|
5801
5789
|
if (e.module !== this.getModuleName()) {
|
|
5802
5790
|
return;
|
|
5803
5791
|
}
|
|
@@ -6322,7 +6310,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6322
6310
|
function BaseQuickToolbar(parent, locator) {
|
|
6323
6311
|
this.parent = parent;
|
|
6324
6312
|
this.locator = locator;
|
|
6325
|
-
this.
|
|
6313
|
+
this.isRendered = false;
|
|
6326
6314
|
this.renderFactory = this.locator.getService('rendererFactory');
|
|
6327
6315
|
this.contentRenderer = this.renderFactory.getRenderer(RenderType.Content);
|
|
6328
6316
|
this.popupRenderer = this.renderFactory.getRenderer(RenderType.Popup);
|
|
@@ -6386,7 +6374,18 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6386
6374
|
e.target.classList.contains('e-imgbreak')) ? false : true;
|
|
6387
6375
|
var target = !isNullOrUndefined(imgWrapper) ? imgWrapper : e.target;
|
|
6388
6376
|
addClass([this.toolbarElement], [CLS_RM_WHITE_SPACE]);
|
|
6389
|
-
var targetOffsetTop
|
|
6377
|
+
var targetOffsetTop;
|
|
6378
|
+
if (!isNullOrUndefined(closest(target, 'table'))) {
|
|
6379
|
+
targetOffsetTop = target.offsetTop;
|
|
6380
|
+
var parentTable = closest(target, 'table');
|
|
6381
|
+
while (!isNullOrUndefined(parentTable)) {
|
|
6382
|
+
targetOffsetTop += parentTable.offsetTop;
|
|
6383
|
+
parentTable = closest(parentTable.parentElement, 'table');
|
|
6384
|
+
}
|
|
6385
|
+
}
|
|
6386
|
+
else {
|
|
6387
|
+
targetOffsetTop = (target.classList.contains("e-rte-audio")) ? target.parentElement.offsetTop : target.offsetTop;
|
|
6388
|
+
}
|
|
6390
6389
|
var parentOffsetTop = window.pageYOffset + e.parentData.top;
|
|
6391
6390
|
if ((targetOffsetTop - e.editTop) > e.popHeight) {
|
|
6392
6391
|
y = parentOffsetTop + e.tBarElementHeight + (targetOffsetTop - e.editTop) - e.popHeight - 5;
|
|
@@ -6398,11 +6397,30 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6398
6397
|
y = e.y;
|
|
6399
6398
|
}
|
|
6400
6399
|
target = isAligned ? e.target : target;
|
|
6401
|
-
|
|
6402
|
-
|
|
6400
|
+
var targetOffsetLeft;
|
|
6401
|
+
var currentOffsetWidth;
|
|
6402
|
+
if (!isNullOrUndefined(closest(target, 'table'))) {
|
|
6403
|
+
targetOffsetLeft = target.offsetLeft;
|
|
6404
|
+
var parentTable = closest(target, 'table');
|
|
6405
|
+
var checkOffSetParentWidth = false;
|
|
6406
|
+
if (!isNullOrUndefined(closest(parentTable, 'TD'))) {
|
|
6407
|
+
checkOffSetParentWidth = true;
|
|
6408
|
+
}
|
|
6409
|
+
while (!isNullOrUndefined(parentTable)) {
|
|
6410
|
+
targetOffsetLeft += parentTable.offsetLeft;
|
|
6411
|
+
currentOffsetWidth = checkOffSetParentWidth ? parentTable.offsetWidth : target.offsetWidth;
|
|
6412
|
+
parentTable = closest(parentTable.parentElement, 'table');
|
|
6413
|
+
}
|
|
6403
6414
|
}
|
|
6404
6415
|
else {
|
|
6405
|
-
|
|
6416
|
+
currentOffsetWidth = target.offsetWidth;
|
|
6417
|
+
targetOffsetLeft = (target.classList.contains("e-rte-audio")) ? target.parentElement.offsetLeft : target.offsetLeft;
|
|
6418
|
+
}
|
|
6419
|
+
if (currentOffsetWidth > e.popWidth) {
|
|
6420
|
+
x = (currentOffsetWidth / 2) - (e.popWidth / 2) + e.parentData.left + targetOffsetLeft;
|
|
6421
|
+
}
|
|
6422
|
+
else {
|
|
6423
|
+
x = e.parentData.left + targetOffsetLeft;
|
|
6406
6424
|
}
|
|
6407
6425
|
this.popupObj.position.X = ((x + e.popWidth) > e.parentData.right) ? e.parentData.right - e.popWidth : x;
|
|
6408
6426
|
this.popupObj.position.Y = (y >= 0) ? y : e.y + 5;
|
|
@@ -6540,7 +6558,8 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6540
6558
|
openDelay: 400,
|
|
6541
6559
|
showTipPointer: true,
|
|
6542
6560
|
windowCollision: true,
|
|
6543
|
-
position: 'BottomCenter'
|
|
6561
|
+
position: 'BottomCenter',
|
|
6562
|
+
cssClass: _this.parent.getCssClass()
|
|
6544
6563
|
});
|
|
6545
6564
|
_this.tooltip.appendTo(_this.element);
|
|
6546
6565
|
}
|
|
@@ -6574,7 +6593,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6574
6593
|
parentData: parent_1.getBoundingClientRect(),
|
|
6575
6594
|
tBarElementHeight: tBarHeight
|
|
6576
6595
|
};
|
|
6577
|
-
if ((target.tagName === 'IMG' || target.tagName === 'AUDIO' || target.tagName === 'VIDEO' || target.tagName === 'IFRAME' || (target.classList &&
|
|
6596
|
+
if ((closest(target, 'TABLE') || target.tagName === 'IMG' || target.tagName === 'AUDIO' || target.tagName === 'VIDEO' || target.tagName === 'IFRAME' || (target.classList &&
|
|
6578
6597
|
(target.classList.contains(CLS_AUDIOWRAP) || target.classList.contains(CLS_CLICKELEM) ||
|
|
6579
6598
|
target.classList.contains(CLS_VID_CLICK_ELEM)))) && (x == beforeQuickToolbarArgs.positionX || y == beforeQuickToolbarArgs.positionY)) {
|
|
6580
6599
|
_this.setPosition(showPopupData);
|
|
@@ -6594,7 +6613,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6594
6613
|
maxWidth: window.outerWidth + 'px'
|
|
6595
6614
|
});
|
|
6596
6615
|
addClass([_this.element], [CLS_POP]);
|
|
6597
|
-
_this.
|
|
6616
|
+
_this.isRendered = true;
|
|
6598
6617
|
}
|
|
6599
6618
|
});
|
|
6600
6619
|
};
|
|
@@ -6634,7 +6653,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6634
6653
|
this.parent.notify(destroyTooltip, { args: event });
|
|
6635
6654
|
}
|
|
6636
6655
|
this.removeEleFromDOM();
|
|
6637
|
-
this.
|
|
6656
|
+
this.isRendered = false;
|
|
6638
6657
|
};
|
|
6639
6658
|
/**
|
|
6640
6659
|
* @param {string} item - specifies the string value
|
|
@@ -6657,7 +6676,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6657
6676
|
};
|
|
6658
6677
|
BaseQuickToolbar.prototype.removeEleFromDOM = function () {
|
|
6659
6678
|
var element = this.popupObj.element;
|
|
6660
|
-
if (this.
|
|
6679
|
+
if (this.isRendered) {
|
|
6661
6680
|
this.dropDownButtons.destroyDropDowns();
|
|
6662
6681
|
this.colorPickerObj.destroyColorPicker();
|
|
6663
6682
|
removeClass([this.element], [CLS_POP]);
|
|
@@ -7072,6 +7091,9 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
7072
7091
|
}
|
|
7073
7092
|
}
|
|
7074
7093
|
if (!isNullOrUndefined(this.textQTBar) && !isNullOrUndefined(this.parent.quickToolbarSettings.text) && !this.parent.inlineMode.enable) {
|
|
7094
|
+
if (!isNullOrUndefined(e) && !isNullOrUndefined(e.name) && e.name === 'sourceCodeMouseDown') {
|
|
7095
|
+
return;
|
|
7096
|
+
}
|
|
7075
7097
|
var args = e.args.touches ?
|
|
7076
7098
|
e.args.changedTouches[0] : e.args;
|
|
7077
7099
|
var target = e.args.target;
|
|
@@ -7082,7 +7104,7 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
7082
7104
|
this.offsetY = pageYOffset(args, this.parent.element, this.parent.iframeSettings.enable);
|
|
7083
7105
|
var range = this.parent.getRange();
|
|
7084
7106
|
if ((range.endContainer.parentElement.tagName === range.startContainer.parentElement.tagName && (range.startContainer.parentElement.tagName === 'A' && range.endContainer.parentElement.tagName === 'A')) ||
|
|
7085
|
-
(target.tagName === 'IMG') || (target.tagName === 'VIDEO') || (target.tagName === 'AUDIO') || (target.childNodes[0].nodeType === 1 && target.childNodes[0].classList.contains('e-rte-audio')) ||
|
|
7107
|
+
(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')) ||
|
|
7086
7108
|
(this.parent.getRange().startOffset === this.parent.getRange().endOffset)) {
|
|
7087
7109
|
return;
|
|
7088
7110
|
}
|
|
@@ -7090,13 +7112,16 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
7090
7112
|
this.textQTBar.showPopup(this.offsetX, this.offsetY, target, 'text');
|
|
7091
7113
|
}
|
|
7092
7114
|
};
|
|
7093
|
-
QuickToolbar.prototype.keyDownHandler = function () {
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
this.
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7115
|
+
QuickToolbar.prototype.keyDownHandler = function (e) {
|
|
7116
|
+
var preventHide = e.args.altKey;
|
|
7117
|
+
if (!preventHide) {
|
|
7118
|
+
if ((this.parent.inlineMode.enable && (!Browser.isDevice || isIDevice()))
|
|
7119
|
+
&& !isNullOrUndefined(select('.' + CLS_INLINE_POP, document))) {
|
|
7120
|
+
this.hideInlineQTBar();
|
|
7121
|
+
}
|
|
7122
|
+
if (this.textQTBar && !hasClass(this.textQTBar.element, 'e-popup-close')) {
|
|
7123
|
+
this.textQTBar.hidePopup();
|
|
7124
|
+
}
|
|
7100
7125
|
}
|
|
7101
7126
|
};
|
|
7102
7127
|
QuickToolbar.prototype.inlineQTBarMouseDownHandler = function () {
|
|
@@ -7424,6 +7449,15 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
7424
7449
|
QuickToolbar.prototype.getModuleName = function () {
|
|
7425
7450
|
return 'quickToolbar';
|
|
7426
7451
|
};
|
|
7452
|
+
/**
|
|
7453
|
+
*
|
|
7454
|
+
* @returns {BaseQuickToolbar[]} - specifies the quick toolbar instance.
|
|
7455
|
+
* @hidden
|
|
7456
|
+
* @private
|
|
7457
|
+
*/
|
|
7458
|
+
QuickToolbar.prototype.getQuickToolbarInstance = function () {
|
|
7459
|
+
return [this.linkQTBar, this.imageQTBar, this.audioQTBar, this.videoQTBar, this.tableQTBar, this.textQTBar, this.inlineQTBar];
|
|
7460
|
+
};
|
|
7427
7461
|
return QuickToolbar;
|
|
7428
7462
|
}());
|
|
7429
7463
|
|
|
@@ -9710,6 +9744,17 @@ var selfClosingTags = [
|
|
|
9710
9744
|
'BR',
|
|
9711
9745
|
'IMG'
|
|
9712
9746
|
];
|
|
9747
|
+
/**
|
|
9748
|
+
* Resize factor for image.
|
|
9749
|
+
* @hidden
|
|
9750
|
+
*
|
|
9751
|
+
*/
|
|
9752
|
+
var imageResizeFactor = {
|
|
9753
|
+
topLeft: [-1, -1],
|
|
9754
|
+
topRight: [1, -1],
|
|
9755
|
+
botRight: [1, 1],
|
|
9756
|
+
botLeft: [-1, 1]
|
|
9757
|
+
};
|
|
9713
9758
|
|
|
9714
9759
|
/**
|
|
9715
9760
|
* `Undo` module is used to handle undo actions.
|
|
@@ -10667,7 +10712,9 @@ var MarkdownEditor = /** @__PURE__ @class */ (function () {
|
|
|
10667
10712
|
MarkdownEditor.prototype.onToolbarClick = function (args) {
|
|
10668
10713
|
var item = args.item;
|
|
10669
10714
|
var textArea = this.parent.contentModule.getEditPanel();
|
|
10670
|
-
|
|
10715
|
+
if (item.command !== 'Formats') {
|
|
10716
|
+
textArea.focus();
|
|
10717
|
+
}
|
|
10671
10718
|
var startOffset = textArea.selectionStart;
|
|
10672
10719
|
var endOffset = textArea.selectionEnd;
|
|
10673
10720
|
var text = textArea.value.substring(startOffset, endOffset);
|
|
@@ -11900,7 +11947,8 @@ var DOMNode = /** @__PURE__ @class */ (function () {
|
|
|
11900
11947
|
}
|
|
11901
11948
|
}
|
|
11902
11949
|
else {
|
|
11903
|
-
|
|
11950
|
+
var tagName = !isNullOrUndefined(start.parentElement) ? start.parentElement.tagName.toLocaleLowerCase() : '';
|
|
11951
|
+
if (start.tagName === 'IMG' && tagName !== 'p' && tagName !== 'div') {
|
|
11904
11952
|
var parNode = document.createElement('p');
|
|
11905
11953
|
start.parentElement.insertBefore(parNode, start);
|
|
11906
11954
|
parNode.appendChild(start);
|
|
@@ -11990,11 +12038,12 @@ var DOMNode = /** @__PURE__ @class */ (function () {
|
|
|
11990
12038
|
/**
|
|
11991
12039
|
* blockNodes method
|
|
11992
12040
|
*
|
|
12041
|
+
* @param {boolean} action - Optional Boolean that specifies the action is whether performed.
|
|
11993
12042
|
* @returns {Node[]} - returns the node array values
|
|
11994
12043
|
* @hidden
|
|
11995
12044
|
* @deprecated
|
|
11996
12045
|
*/
|
|
11997
|
-
DOMNode.prototype.blockNodes = function () {
|
|
12046
|
+
DOMNode.prototype.blockNodes = function (action) {
|
|
11998
12047
|
var collectionNodes = [];
|
|
11999
12048
|
var selection = this.getSelection();
|
|
12000
12049
|
if (this.isEditorArea() && selection.rangeCount) {
|
|
@@ -12008,23 +12057,46 @@ var DOMNode = /** @__PURE__ @class */ (function () {
|
|
|
12008
12057
|
collectionNodes.push(startNode);
|
|
12009
12058
|
}
|
|
12010
12059
|
parentNode = this.blockParentNode(startNode);
|
|
12060
|
+
var endParentNode = this.blockParentNode(endNode);
|
|
12011
12061
|
if (parentNode && collectionNodes.indexOf(parentNode) < 0) {
|
|
12012
|
-
if (
|
|
12013
|
-
|
|
12014
|
-
|
|
12015
|
-
|
|
12016
|
-
|
|
12017
|
-
|
|
12018
|
-
|
|
12019
|
-
|
|
12020
|
-
|
|
12062
|
+
if (!isNullOrUndefined(action) && action) {
|
|
12063
|
+
if (range.commonAncestorContainer.nodeName === 'TD' || parentNode.nodeName === 'TD' || endParentNode.nodeName === 'TD') {
|
|
12064
|
+
var processedNodes = this.getPreBlockNodeCollection(range);
|
|
12065
|
+
if (processedNodes.length > 1) {
|
|
12066
|
+
this.wrapWithBlockNode(processedNodes, collectionNodes);
|
|
12067
|
+
}
|
|
12068
|
+
else if (processedNodes.length > 0) {
|
|
12069
|
+
if (startNode !== endNode && startNode.nodeName !== 'BR') {
|
|
12070
|
+
collectionNodes.push(this.createTempNode(startNode));
|
|
12071
|
+
}
|
|
12072
|
+
else if (startNode === endNode && startNode.nodeName === 'SPAN' && (startNode.classList.contains(markerClassName.startSelection)
|
|
12073
|
+
|| startNode.classList.contains(markerClassName.endSelection))) {
|
|
12074
|
+
collectionNodes.push(this.createTempNode(startNode));
|
|
12075
|
+
}
|
|
12076
|
+
}
|
|
12021
12077
|
}
|
|
12022
12078
|
else {
|
|
12023
|
-
collectionNodes.push(
|
|
12079
|
+
collectionNodes.push(parentNode);
|
|
12024
12080
|
}
|
|
12025
12081
|
}
|
|
12026
12082
|
else {
|
|
12027
|
-
|
|
12083
|
+
if (IGNORE_BLOCK_TAGS.indexOf(parentNode.tagName.toLocaleLowerCase()) >= 0 && (startNode.tagName === 'BR' ||
|
|
12084
|
+
startNode.nodeType === Node.TEXT_NODE ||
|
|
12085
|
+
startNode.classList.contains(markerClassName.startSelection) ||
|
|
12086
|
+
startNode.classList.contains(markerClassName.endSelection))) {
|
|
12087
|
+
var tempNode = startNode.previousSibling &&
|
|
12088
|
+
startNode.previousSibling.nodeType === Node.TEXT_NODE ?
|
|
12089
|
+
startNode.previousSibling : startNode;
|
|
12090
|
+
if (!startNode.nextSibling && !startNode.previousSibling && startNode.tagName === 'BR') {
|
|
12091
|
+
collectionNodes.push(tempNode);
|
|
12092
|
+
}
|
|
12093
|
+
else {
|
|
12094
|
+
collectionNodes.push(this.createTempNode(tempNode));
|
|
12095
|
+
}
|
|
12096
|
+
}
|
|
12097
|
+
else {
|
|
12098
|
+
collectionNodes.push(parentNode);
|
|
12099
|
+
}
|
|
12028
12100
|
}
|
|
12029
12101
|
}
|
|
12030
12102
|
var nodes = [];
|
|
@@ -12093,6 +12165,131 @@ var DOMNode = /** @__PURE__ @class */ (function () {
|
|
|
12093
12165
|
DOMNode.prototype.ignoreTableTag = function (element) {
|
|
12094
12166
|
return !(TABLE_BLOCK_TAGS.indexOf(element.tagName.toLocaleLowerCase()) >= 0);
|
|
12095
12167
|
};
|
|
12168
|
+
DOMNode.prototype.getPreBlockNodeCollection = function (range) {
|
|
12169
|
+
var startNode = this.getSelectedNode(range.startContainer, range.startOffset);
|
|
12170
|
+
var endNode = this.getSelectedNode(range.endContainer, range.endOffset);
|
|
12171
|
+
var nodes = [];
|
|
12172
|
+
var rootNode = startNode.closest('td, th');
|
|
12173
|
+
if (isNullOrUndefined(rootNode)) {
|
|
12174
|
+
return nodes;
|
|
12175
|
+
}
|
|
12176
|
+
var rootChildNode = Array.from(rootNode.childNodes);
|
|
12177
|
+
var isContinue = true;
|
|
12178
|
+
var processedStart = this.getClosestInlineParent(startNode, rootNode, true);
|
|
12179
|
+
var processedEnd = this.getClosestInlineParent(endNode, rootNode, false);
|
|
12180
|
+
for (var i = 0; i < rootChildNode.length; i++) {
|
|
12181
|
+
var child = rootChildNode[i];
|
|
12182
|
+
if (processedStart === processedEnd && child === processedStart) {
|
|
12183
|
+
nodes.push(child);
|
|
12184
|
+
isContinue = true;
|
|
12185
|
+
}
|
|
12186
|
+
else if (child === processedStart) {
|
|
12187
|
+
isContinue = false;
|
|
12188
|
+
}
|
|
12189
|
+
else if (child === processedEnd) {
|
|
12190
|
+
nodes.push(child); // Early Exit so Push the end node.
|
|
12191
|
+
isContinue = true;
|
|
12192
|
+
}
|
|
12193
|
+
if (isContinue) {
|
|
12194
|
+
continue;
|
|
12195
|
+
}
|
|
12196
|
+
else {
|
|
12197
|
+
nodes.push(child);
|
|
12198
|
+
}
|
|
12199
|
+
}
|
|
12200
|
+
return nodes;
|
|
12201
|
+
};
|
|
12202
|
+
DOMNode.prototype.getClosestInlineParent = function (node, rootNode, isStart) {
|
|
12203
|
+
// 1. If the node is a text node, return the node
|
|
12204
|
+
// 2. If the node is a block node return block node
|
|
12205
|
+
// 3. If the node is a inline node,
|
|
12206
|
+
// Traverse back untill the TD or TH node
|
|
12207
|
+
// Check if the the previous sibling , next sibling is a block node.
|
|
12208
|
+
// If yes return the inline node that is closest to the block node.
|
|
12209
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
12210
|
+
return node;
|
|
12211
|
+
}
|
|
12212
|
+
if (this.isBlockNode(node)) {
|
|
12213
|
+
return node;
|
|
12214
|
+
}
|
|
12215
|
+
var currentNode = node;
|
|
12216
|
+
var rootFlag = false;
|
|
12217
|
+
while (currentNode) {
|
|
12218
|
+
var previousNode = currentNode;
|
|
12219
|
+
if (rootFlag) {
|
|
12220
|
+
if (this.isBlockNode(currentNode)) {
|
|
12221
|
+
return previousNode;
|
|
12222
|
+
}
|
|
12223
|
+
if (isStart && currentNode.previousSibling) {
|
|
12224
|
+
if (this.isBlockNode(currentNode.previousSibling) || currentNode.previousSibling.nodeName === 'BR') {
|
|
12225
|
+
return previousNode;
|
|
12226
|
+
}
|
|
12227
|
+
else {
|
|
12228
|
+
currentNode = currentNode.previousSibling;
|
|
12229
|
+
}
|
|
12230
|
+
}
|
|
12231
|
+
else if (!isStart && currentNode.nextSibling) {
|
|
12232
|
+
if (this.isBlockNode(currentNode.nextSibling) || currentNode.nextSibling.nodeName === 'BR') {
|
|
12233
|
+
return previousNode;
|
|
12234
|
+
}
|
|
12235
|
+
else {
|
|
12236
|
+
currentNode = currentNode.nextSibling;
|
|
12237
|
+
}
|
|
12238
|
+
}
|
|
12239
|
+
else {
|
|
12240
|
+
return currentNode;
|
|
12241
|
+
}
|
|
12242
|
+
}
|
|
12243
|
+
else {
|
|
12244
|
+
currentNode = currentNode.parentElement;
|
|
12245
|
+
if (currentNode === rootNode) {
|
|
12246
|
+
currentNode = previousNode;
|
|
12247
|
+
rootFlag = true;
|
|
12248
|
+
}
|
|
12249
|
+
}
|
|
12250
|
+
}
|
|
12251
|
+
return null;
|
|
12252
|
+
};
|
|
12253
|
+
DOMNode.prototype.wrapWithBlockNode = function (nodes, collectionNodes) {
|
|
12254
|
+
var wrapperElement = createElement('p');
|
|
12255
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
12256
|
+
var child = nodes[i];
|
|
12257
|
+
if (child.nodeName === 'BR') {
|
|
12258
|
+
child.parentNode.insertBefore(wrapperElement, child);
|
|
12259
|
+
wrapperElement.appendChild(child);
|
|
12260
|
+
if (wrapperElement.childNodes.length > 0) {
|
|
12261
|
+
collectionNodes.push(wrapperElement);
|
|
12262
|
+
}
|
|
12263
|
+
wrapperElement = createElement('p');
|
|
12264
|
+
}
|
|
12265
|
+
else {
|
|
12266
|
+
if (!this.isBlockNode(child)) {
|
|
12267
|
+
if (child.nodeName === '#text' && child.textContent.trim() === '') {
|
|
12268
|
+
continue;
|
|
12269
|
+
}
|
|
12270
|
+
if (wrapperElement.childElementCount === 0) {
|
|
12271
|
+
child.parentNode.insertBefore(wrapperElement, child);
|
|
12272
|
+
wrapperElement.appendChild(child);
|
|
12273
|
+
}
|
|
12274
|
+
else {
|
|
12275
|
+
wrapperElement.appendChild(child);
|
|
12276
|
+
}
|
|
12277
|
+
}
|
|
12278
|
+
else {
|
|
12279
|
+
collectionNodes.push(child);
|
|
12280
|
+
}
|
|
12281
|
+
// Use case when the BR is next sibling but the BR is not the part of selection.
|
|
12282
|
+
if ((i === nodes.length - 1) && wrapperElement.nextElementSibling &&
|
|
12283
|
+
wrapperElement.querySelectorAll('br').length === 0 &&
|
|
12284
|
+
wrapperElement.nextElementSibling.nodeName === 'BR') {
|
|
12285
|
+
wrapperElement.appendChild(wrapperElement.nextElementSibling);
|
|
12286
|
+
}
|
|
12287
|
+
}
|
|
12288
|
+
}
|
|
12289
|
+
if (wrapperElement.childNodes.length > 0 && collectionNodes.indexOf(wrapperElement) < 0) {
|
|
12290
|
+
collectionNodes.push(wrapperElement);
|
|
12291
|
+
}
|
|
12292
|
+
};
|
|
12096
12293
|
return DOMNode;
|
|
12097
12294
|
}());
|
|
12098
12295
|
|
|
@@ -12205,7 +12402,8 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12205
12402
|
startNode.textContent = '';
|
|
12206
12403
|
}
|
|
12207
12404
|
var startNodeParent = startNode.parentElement;
|
|
12208
|
-
|
|
12405
|
+
var parentOfCurrentOLUL = startNodeParent.parentElement;
|
|
12406
|
+
if (isNullOrUndefined(parentOfCurrentOLUL.closest('UL')) && isNullOrUndefined(parentOfCurrentOLUL.closest('OL'))) {
|
|
12209
12407
|
if (!isNullOrUndefined(startNode.nextElementSibling)) {
|
|
12210
12408
|
var nearBlockNode = this.parent.domNode.blockParentNode(startNode);
|
|
12211
12409
|
this.parent.nodeCutter.GetSpliceNode(range, nearBlockNode);
|
|
@@ -12232,6 +12430,15 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12232
12430
|
detach(startNode);
|
|
12233
12431
|
}
|
|
12234
12432
|
}
|
|
12433
|
+
// To handle the nested enter key press in the list for the first LI element
|
|
12434
|
+
if (!isNullOrUndefined(parentOfCurrentOLUL) && (!isNullOrUndefined(parentOfCurrentOLUL.closest('UL')) || !isNullOrUndefined(parentOfCurrentOLUL.closest('OL'))) &&
|
|
12435
|
+
parentOfCurrentOLUL.nodeName === 'LI' && parentOfCurrentOLUL.style.listStyleType === 'none' &&
|
|
12436
|
+
parentOfCurrentOLUL.textContent === '' && startNode.textContent === '' && startNode === startNodeParent.firstElementChild &&
|
|
12437
|
+
isNullOrUndefined(startNode.nextSibling)) {
|
|
12438
|
+
detach(startNodeParent);
|
|
12439
|
+
parentOfCurrentOLUL.style.removeProperty('list-style-type');
|
|
12440
|
+
e.event.preventDefault();
|
|
12441
|
+
}
|
|
12235
12442
|
}
|
|
12236
12443
|
};
|
|
12237
12444
|
Lists.prototype.backspaceList = function (e) {
|
|
@@ -12605,7 +12812,7 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12605
12812
|
this.currentAction = e.subCommand;
|
|
12606
12813
|
this.currentAction = e.subCommand = this.currentAction === 'NumberFormatList' ? 'OL' : this.currentAction === 'BulletFormatList' ? 'UL' : this.currentAction;
|
|
12607
12814
|
this.domNode.setMarker(this.saveSelection);
|
|
12608
|
-
var listsNodes = this.domNode.blockNodes();
|
|
12815
|
+
var listsNodes = this.domNode.blockNodes(true);
|
|
12609
12816
|
if (e.enterAction === 'BR') {
|
|
12610
12817
|
this.setSelectionBRConfig();
|
|
12611
12818
|
var allSelectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument);
|
|
@@ -12719,6 +12926,17 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12719
12926
|
listEle.innerHTML = '<li><br/></li>';
|
|
12720
12927
|
elements[i].appendChild(listEle);
|
|
12721
12928
|
}
|
|
12929
|
+
else if ('LI' !== elements[i].tagName && isNullOrUndefined(item) &&
|
|
12930
|
+
elements[i].nodeName === 'BLOCKQUOTE') {
|
|
12931
|
+
var elemAtt = this.domNode.attributes(elements[i]);
|
|
12932
|
+
var openTag = '<' + type + '>';
|
|
12933
|
+
var closeTag = '</' + type + '>';
|
|
12934
|
+
var newTag = 'li' + elemAtt;
|
|
12935
|
+
var replaceHTML = elements[i].innerHTML;
|
|
12936
|
+
var innerHTML = this.domNode.createTagString(newTag, null, replaceHTML);
|
|
12937
|
+
var collectionString = openTag + innerHTML + closeTag;
|
|
12938
|
+
elements[i].innerHTML = collectionString;
|
|
12939
|
+
}
|
|
12722
12940
|
else if ('LI' !== elements[i].tagName && isNullOrUndefined(item)) {
|
|
12723
12941
|
var elemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
|
|
12724
12942
|
var openTag = '<' + type + '>';
|
|
@@ -12809,8 +13027,17 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12809
13027
|
};
|
|
12810
13028
|
Lists.prototype.cleanNode = function () {
|
|
12811
13029
|
var liParents = this.parent.editableElement.querySelectorAll('ol + ol, ul + ul');
|
|
13030
|
+
var listStyleType;
|
|
13031
|
+
var firstNodeOL;
|
|
12812
13032
|
for (var c = 0; c < liParents.length; c++) {
|
|
12813
13033
|
var node = liParents[c];
|
|
13034
|
+
var toFindtopOlUl = true;
|
|
13035
|
+
if (toFindtopOlUl && (liParents[c].parentElement.parentElement.nodeName === 'OL' || liParents[c].parentElement.parentElement.nodeName === 'UL')) {
|
|
13036
|
+
toFindtopOlUl = false;
|
|
13037
|
+
var preElement = liParents[c].parentElement.parentElement;
|
|
13038
|
+
listStyleType = preElement.style.listStyleType;
|
|
13039
|
+
firstNodeOL = node.previousElementSibling;
|
|
13040
|
+
}
|
|
12814
13041
|
if (this.domNode.isList(node.previousElementSibling) &&
|
|
12815
13042
|
this.domNode.openTagString(node) === this.domNode.openTagString(node.previousElementSibling)) {
|
|
12816
13043
|
var contentNodes = this.domNode.contents(node);
|
|
@@ -12825,6 +13052,9 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12825
13052
|
}
|
|
12826
13053
|
}
|
|
12827
13054
|
}
|
|
13055
|
+
if (firstNodeOL) {
|
|
13056
|
+
firstNodeOL.style.listStyleType = listStyleType;
|
|
13057
|
+
}
|
|
12828
13058
|
};
|
|
12829
13059
|
Lists.prototype.findUnSelected = function (temp, elements) {
|
|
12830
13060
|
temp = temp.slice().reverse();
|
|
@@ -13510,7 +13740,7 @@ var Formats = /** @__PURE__ @class */ (function () {
|
|
|
13510
13740
|
}
|
|
13511
13741
|
var save = this.parent.nodeSelection.save(range, this.parent.currentDocument);
|
|
13512
13742
|
this.parent.domNode.setMarker(save);
|
|
13513
|
-
var formatsNodes = this.parent.domNode.blockNodes();
|
|
13743
|
+
var formatsNodes = this.parent.domNode.blockNodes(true);
|
|
13514
13744
|
if (e.enterAction === 'BR') {
|
|
13515
13745
|
this.setSelectionBRConfig();
|
|
13516
13746
|
var allSelectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument);
|
|
@@ -13730,6 +13960,10 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
13730
13960
|
var isCollapsed = range.collapsed;
|
|
13731
13961
|
var nodes = this.getNodeCollection(range, nodeSelection, node);
|
|
13732
13962
|
var closestParentNode = (node.nodeName.toLowerCase() === 'table') ? this.closestEle(nodes[0].parentNode, editNode) : nodes[0];
|
|
13963
|
+
if (closestParentNode && closestParentNode.nodeName === 'LI' && node.nodeName.toLowerCase() === 'table') {
|
|
13964
|
+
this.insertTableInList(range, node, closestParentNode, nodes[0], nodeCutter);
|
|
13965
|
+
return;
|
|
13966
|
+
}
|
|
13733
13967
|
if (isExternal || (!isNullOrUndefined(node) && !isNullOrUndefined(node.classList) &&
|
|
13734
13968
|
node.classList.contains('pasteContent'))) {
|
|
13735
13969
|
this.pasteInsertHTML(nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode, enterAction);
|
|
@@ -14225,6 +14459,9 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
14225
14459
|
};
|
|
14226
14460
|
InsertHtml.closestEle = function (element, editNode) {
|
|
14227
14461
|
var el = element;
|
|
14462
|
+
if (closest(el, 'li')) {
|
|
14463
|
+
return closest(el, 'li');
|
|
14464
|
+
}
|
|
14228
14465
|
while (el && el.nodeType === 1) {
|
|
14229
14466
|
if (el.parentNode === editNode ||
|
|
14230
14467
|
(!isNullOrUndefined(el.parentNode.tagName) &&
|
|
@@ -14235,6 +14472,30 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
14235
14472
|
}
|
|
14236
14473
|
return null;
|
|
14237
14474
|
};
|
|
14475
|
+
InsertHtml.insertTableInList = function (range, insertNode, parentNode, currentNode, nodeCutter) {
|
|
14476
|
+
if (range.collapsed) {
|
|
14477
|
+
var isStart = range.startOffset === 0;
|
|
14478
|
+
var isEnd = range.startContainer.textContent.trimEnd().length === range.startOffset;
|
|
14479
|
+
if (isStart || isEnd) {
|
|
14480
|
+
if (isStart) {
|
|
14481
|
+
InsertMethods.AppendBefore(insertNode, currentNode, false);
|
|
14482
|
+
}
|
|
14483
|
+
else {
|
|
14484
|
+
InsertMethods.AppendBefore(insertNode, currentNode, true);
|
|
14485
|
+
}
|
|
14486
|
+
}
|
|
14487
|
+
else {
|
|
14488
|
+
var preNode = nodeCutter.SplitNode(range, parentNode, true);
|
|
14489
|
+
var sibNode = preNode.previousSibling;
|
|
14490
|
+
sibNode.appendChild(insertNode);
|
|
14491
|
+
}
|
|
14492
|
+
}
|
|
14493
|
+
else {
|
|
14494
|
+
range.deleteContents();
|
|
14495
|
+
parentNode.appendChild(insertNode);
|
|
14496
|
+
}
|
|
14497
|
+
insertNode.classList.add('ignore-table');
|
|
14498
|
+
};
|
|
14238
14499
|
/**
|
|
14239
14500
|
* Insert method
|
|
14240
14501
|
*
|
|
@@ -14441,7 +14702,7 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
|
|
|
14441
14702
|
for (var i = 0, j_2 = 0, k = 0; i <= finalinlineNodes.length; i++) {
|
|
14442
14703
|
if (i === 0) {
|
|
14443
14704
|
finalinlineNodes[i].parentNode.insertBefore(anchorNodes[j_2], finalinlineNodes[i].nextSibling);
|
|
14444
|
-
if (this.parent.domNode.blockNodes().length === 1) {
|
|
14705
|
+
if (this.parent.domNode.blockNodes().length === 1 && anchorNodes.length === 1) {
|
|
14445
14706
|
this.parent.nodeSelection.setSelectionNode(this.parent.currentDocument, anchorNodes[j_2]);
|
|
14446
14707
|
}
|
|
14447
14708
|
removeNodes[k] = finalinlineNodes[i];
|
|
@@ -14872,7 +15133,6 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
|
|
|
14872
15133
|
}
|
|
14873
15134
|
};
|
|
14874
15135
|
ImageCommand.prototype.createImage = function (e) {
|
|
14875
|
-
var _this = this;
|
|
14876
15136
|
var isReplaced = false;
|
|
14877
15137
|
e.item.url = isNullOrUndefined(e.item.url) || e.item.url === 'undefined' ? e.item.src : e.item.url;
|
|
14878
15138
|
if (!isNullOrUndefined(e.item.selectParent) && e.item.selectParent[0].tagName === 'IMG') {
|
|
@@ -14902,21 +15162,18 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
|
|
|
14902
15162
|
var selectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)[0];
|
|
14903
15163
|
var imgElm_1 = (e.value === 'Replace' || isReplaced) ? e.item.selectParent[0] :
|
|
14904
15164
|
(Browser.isIE ? selectedNode.previousSibling : selectedNode.previousElementSibling);
|
|
14905
|
-
|
|
14906
|
-
|
|
14907
|
-
|
|
14908
|
-
|
|
14909
|
-
|
|
14910
|
-
|
|
14911
|
-
|
|
14912
|
-
|
|
14913
|
-
|
|
14914
|
-
|
|
14915
|
-
}
|
|
14916
|
-
|
|
14917
|
-
if (e.value === 'Replace') {
|
|
14918
|
-
e.item.subCommand = 'Replace';
|
|
14919
|
-
this.callBack(e);
|
|
15165
|
+
var imageInstance_1 = this;
|
|
15166
|
+
var onImageLoadEvent_1 = function () {
|
|
15167
|
+
e.callBack({
|
|
15168
|
+
requestType: (e.value === 'Replace') ? (e.item.subCommand = 'Replace', "Replace") : 'Images',
|
|
15169
|
+
editorMode: 'HTML',
|
|
15170
|
+
event: e.event,
|
|
15171
|
+
range: imageInstance_1.parent.nodeSelection.getRange(imageInstance_1.parent.currentDocument),
|
|
15172
|
+
elements: [imgElm_1]
|
|
15173
|
+
});
|
|
15174
|
+
imgElm_1.removeEventListener('load', onImageLoadEvent_1);
|
|
15175
|
+
};
|
|
15176
|
+
imgElm_1.addEventListener('load', onImageLoadEvent_1);
|
|
14920
15177
|
}
|
|
14921
15178
|
};
|
|
14922
15179
|
ImageCommand.prototype.setStyle = function (imgElement, e, imgReplace) {
|
|
@@ -15633,7 +15890,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
15633
15890
|
e.item.selection.restore();
|
|
15634
15891
|
InsertHtml.Insert(this.parent.currentDocument, table, this.parent.editableElement);
|
|
15635
15892
|
e.item.selection.setSelectionText(this.parent.currentDocument, table.querySelector('td'), table.querySelector('td'), 0, 0);
|
|
15636
|
-
if (table.nextElementSibling === null) {
|
|
15893
|
+
if (table.nextElementSibling === null && !table.classList.contains('ignore-table')) {
|
|
15637
15894
|
var insertElem = void 0;
|
|
15638
15895
|
if (e.enterAction === 'DIV') {
|
|
15639
15896
|
insertElem = createElement('div');
|
|
@@ -15648,6 +15905,9 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
15648
15905
|
}
|
|
15649
15906
|
this.insertAfter(insertElem, table);
|
|
15650
15907
|
}
|
|
15908
|
+
if (table.classList.contains('ignore-table')) {
|
|
15909
|
+
table.classList.remove('ignore-table');
|
|
15910
|
+
}
|
|
15651
15911
|
table.querySelector('td').classList.add('e-cell-select');
|
|
15652
15912
|
if (e.callBack) {
|
|
15653
15913
|
e.callBack({
|
|
@@ -16067,10 +16327,22 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
16067
16327
|
firstCell.setAttribute('rowspan', (minMaxIndexes.endRow - minMaxIndexes.startRow + 1).toString());
|
|
16068
16328
|
}
|
|
16069
16329
|
var totalWidth = 0;
|
|
16330
|
+
var unit;
|
|
16070
16331
|
for (var j = rowSelectedCells.length - 1; j >= 0; j--) {
|
|
16071
|
-
|
|
16332
|
+
if (!isNullOrUndefined(rowSelectedCells[j].style.width)
|
|
16333
|
+
&& rowSelectedCells[j].style.width !== '') {
|
|
16334
|
+
if (!unit) {
|
|
16335
|
+
var match = rowSelectedCells[j].style.width.match(/^([\d.]+)([a-z%]+)$/i);
|
|
16336
|
+
unit = match ? match[2] : '%';
|
|
16337
|
+
}
|
|
16338
|
+
totalWidth = totalWidth + parseFloat(rowSelectedCells[j].style.width);
|
|
16339
|
+
}
|
|
16340
|
+
else {
|
|
16341
|
+
totalWidth = totalWidth + ((rowSelectedCells[j].offsetWidth / this.curTable.offsetWidth) * 100);
|
|
16342
|
+
unit = '%';
|
|
16343
|
+
}
|
|
16072
16344
|
}
|
|
16073
|
-
firstCell.style.width = totalWidth +
|
|
16345
|
+
firstCell.style.width = totalWidth + unit;
|
|
16074
16346
|
for (var i = 1; i <= selectedCells.length - 1; i++) {
|
|
16075
16347
|
detach(selectedCells[i]);
|
|
16076
16348
|
}
|
|
@@ -17005,11 +17277,15 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
17005
17277
|
&& range.endOffset === range.startContainer.length)) {
|
|
17006
17278
|
var nodeIndex = [];
|
|
17007
17279
|
var cloneNode = nodes[index];
|
|
17280
|
+
var clonedElement = cloneNode;
|
|
17008
17281
|
do {
|
|
17009
17282
|
nodeIndex.push(domSelection.getIndex(cloneNode));
|
|
17010
17283
|
cloneNode = cloneNode.parentNode;
|
|
17011
17284
|
} while (cloneNode && (cloneNode !== formatNode));
|
|
17012
17285
|
if (nodes[index].nodeName !== 'BR') {
|
|
17286
|
+
if (clonedElement.nodeName === '#text' && clonedElement.textContent.includes('\u200B')) {
|
|
17287
|
+
clonedElement.remove();
|
|
17288
|
+
}
|
|
17013
17289
|
cloneNode = splitNode = (isCursor && (formatNode.textContent.length - 1) === range.startOffset) ?
|
|
17014
17290
|
nodeCutter.SplitNode(range, formatNode, true)
|
|
17015
17291
|
: nodeCutter.GetSpliceNode(range, formatNode);
|
|
@@ -17087,6 +17363,30 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
17087
17363
|
formatNode.style.textDecoration = 'none';
|
|
17088
17364
|
child = [formatNode];
|
|
17089
17365
|
}
|
|
17366
|
+
else if (IsFormatted.inlineTags.indexOf(formatNodeTagName.toLowerCase()) !== -1 && isFontStyle && formatNodeTagName.toLocaleLowerCase() !== 'span') {
|
|
17367
|
+
var fontNodeStyle = formatNode.style;
|
|
17368
|
+
if (fontNodeStyle.color && format === 'fontcolor') {
|
|
17369
|
+
if (formatNode.nodeName === 'A') {
|
|
17370
|
+
fontNodeStyle.color = value;
|
|
17371
|
+
}
|
|
17372
|
+
else {
|
|
17373
|
+
fontNodeStyle.color = '';
|
|
17374
|
+
}
|
|
17375
|
+
}
|
|
17376
|
+
else if (fontNodeStyle.backgroundColor && format === 'backgroundcolor') {
|
|
17377
|
+
fontNodeStyle.backgroundColor = '';
|
|
17378
|
+
}
|
|
17379
|
+
else if (fontNodeStyle.fontSize && format === 'fontsize') {
|
|
17380
|
+
fontNodeStyle.fontSize = '';
|
|
17381
|
+
}
|
|
17382
|
+
else if (fontNodeStyle.fontFamily && format === 'fontname') {
|
|
17383
|
+
fontNodeStyle.fontFamily = '';
|
|
17384
|
+
}
|
|
17385
|
+
if (formatNode.getAttribute("style") === '') {
|
|
17386
|
+
formatNode.removeAttribute("style");
|
|
17387
|
+
}
|
|
17388
|
+
child = [formatNode];
|
|
17389
|
+
}
|
|
17090
17390
|
else {
|
|
17091
17391
|
child = InsertMethods.unwrap(formatNode);
|
|
17092
17392
|
var liElement = nodes[index].parentElement;
|
|
@@ -17267,19 +17567,44 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
17267
17567
|
parentElement = parentElement.parentElement;
|
|
17268
17568
|
liElement = parentElement;
|
|
17269
17569
|
}
|
|
17270
|
-
if (format === 'fontcolor') {
|
|
17570
|
+
if (format === 'fontcolor' || format === 'fontname') {
|
|
17271
17571
|
var parentElem = nodes[index].parentElement;
|
|
17272
17572
|
if (!isNullOrUndefined(parentElem) && parentElem.childNodes) {
|
|
17273
17573
|
for (var i = 0; i < parentElem.childNodes.length; i++) {
|
|
17274
17574
|
if (this.concatenateTextExcludingList(nodes, index) === nodes[index].textContent) {
|
|
17575
|
+
var liElement_1 = void 0;
|
|
17275
17576
|
if (parentElem.tagName === 'LI') {
|
|
17276
|
-
|
|
17577
|
+
liElement_1 = parentElem;
|
|
17578
|
+
}
|
|
17579
|
+
else if (parentElem.closest('li')) {
|
|
17580
|
+
liElement_1 = parentElem.closest('li');
|
|
17581
|
+
}
|
|
17582
|
+
if (!isNullOrUndefined(liElement_1)) {
|
|
17583
|
+
switch (format) {
|
|
17584
|
+
case 'fontcolor':
|
|
17585
|
+
liElement_1.style.color = value;
|
|
17586
|
+
break;
|
|
17587
|
+
case 'fontname':
|
|
17588
|
+
liElement_1.style.fontFamily = value;
|
|
17589
|
+
break;
|
|
17590
|
+
default:
|
|
17591
|
+
break;
|
|
17592
|
+
}
|
|
17277
17593
|
}
|
|
17278
17594
|
}
|
|
17279
17595
|
// eslint-disable-next-line
|
|
17280
17596
|
var childElement = parentElem.childNodes[i];
|
|
17281
17597
|
if (childElement.tagName === 'OL' || childElement.tagName === 'UL') {
|
|
17282
|
-
|
|
17598
|
+
switch (format) {
|
|
17599
|
+
case 'fontcolor':
|
|
17600
|
+
childElement.style.color = 'initial';
|
|
17601
|
+
break;
|
|
17602
|
+
case 'fontname':
|
|
17603
|
+
childElement.style.fontFamily = 'initial';
|
|
17604
|
+
break;
|
|
17605
|
+
default:
|
|
17606
|
+
break;
|
|
17607
|
+
}
|
|
17283
17608
|
}
|
|
17284
17609
|
}
|
|
17285
17610
|
}
|
|
@@ -18288,7 +18613,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
18288
18613
|
'x', 'xi', 'xii', 'xiii', 'xiv', 'xv', 'xvi', 'xvii', 'xviii', 'xix', 'xx'];
|
|
18289
18614
|
this.lowerGreekNumber = ['α', 'β', 'γ', 'δ', 'ε', 'ζ', 'η', 'θ', 'ι', 'κ', 'λ',
|
|
18290
18615
|
'μ', 'ν', 'ξ', 'ο', 'π', 'ρ', 'σ', 'τ', 'υ', 'φ', 'χ', 'ψ', 'ω'];
|
|
18291
|
-
this.removableElements = ['o:p', 'style'];
|
|
18616
|
+
this.removableElements = ['o:p', 'style', 'w:sdt'];
|
|
18292
18617
|
this.listContents = [];
|
|
18293
18618
|
this.cropImageDimensions = [];
|
|
18294
18619
|
this.parent = parent;
|
|
@@ -18653,7 +18978,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
18653
18978
|
var innerElement = elm.innerHTML;
|
|
18654
18979
|
for (var i = 0; i < this.removableElements.length; i++) {
|
|
18655
18980
|
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
18656
|
-
var regExpStartElem = new RegExp('<' + this.removableElements[i] + '
|
|
18981
|
+
var regExpStartElem = new RegExp('<' + this.removableElements[i] + '\\s*[^>]*>', 'g');
|
|
18657
18982
|
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
18658
18983
|
var regExpEndElem = new RegExp('</' + this.removableElements[i] + '>', 'g');
|
|
18659
18984
|
innerElement = innerElement.replace(regExpStartElem, '');
|
|
@@ -18716,72 +19041,80 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
18716
19041
|
};
|
|
18717
19042
|
MsWordPaste.prototype.styleCorrection = function (elm, wordPasteStyleConfig) {
|
|
18718
19043
|
var styleElement = elm.querySelectorAll('style');
|
|
19044
|
+
var styles = [];
|
|
18719
19045
|
if (styleElement.length > 0) {
|
|
18720
|
-
|
|
19046
|
+
if (!isNullOrUndefined(styleElement[0].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi))) {
|
|
19047
|
+
styles = styleElement[0].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);
|
|
19048
|
+
}
|
|
19049
|
+
else if (styleElement.length > 1) {
|
|
19050
|
+
styles = styleElement[1].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);
|
|
19051
|
+
}
|
|
18721
19052
|
var styleClassObject_1 = !isNullOrUndefined(styles) ? this.findStyleObject(styles) : null;
|
|
18722
|
-
|
|
18723
|
-
|
|
18724
|
-
|
|
18725
|
-
|
|
18726
|
-
|
|
18727
|
-
|
|
18728
|
-
|
|
18729
|
-
|
|
18730
|
-
|
|
18731
|
-
|
|
18732
|
-
|
|
18733
|
-
|
|
18734
|
-
|
|
18735
|
-
|
|
18736
|
-
|
|
18737
|
-
}
|
|
18738
|
-
else if (keys[i].split('.').length === 1 && keys[i].split('.')[0].indexOf('@') < 0) {
|
|
18739
|
-
resultElem = elm.getElementsByTagName(keys[i]);
|
|
18740
|
-
}
|
|
18741
|
-
else {
|
|
18742
|
-
resultElem = elm.querySelectorAll(keys[i]);
|
|
18743
|
-
}
|
|
18744
|
-
for (var j = 0; j < resultElem.length; j++) {
|
|
18745
|
-
if (resultElem[j].closest('li') && keys[i] === 'p') {
|
|
19053
|
+
if (!isNullOrUndefined(styleClassObject_1)) {
|
|
19054
|
+
var keys = Object.keys(styleClassObject_1);
|
|
19055
|
+
var values = keys.map(function (key) {
|
|
19056
|
+
return styleClassObject_1["" + key];
|
|
19057
|
+
});
|
|
19058
|
+
values = this.removeUnwantedStyle(values, wordPasteStyleConfig);
|
|
19059
|
+
this.filterStyles(elm, wordPasteStyleConfig);
|
|
19060
|
+
var resultElem = void 0;
|
|
19061
|
+
var fromClass = false;
|
|
19062
|
+
for (var i = 0; i < keys.length; i++) {
|
|
19063
|
+
if (keys[i].split('.')[0] === '') {
|
|
19064
|
+
resultElem = elm.getElementsByClassName(keys[i].split('.')[1]);
|
|
19065
|
+
fromClass = true;
|
|
19066
|
+
}
|
|
19067
|
+
else if (keys[i].split('.').length === 1 && keys[i].split('.')[0].indexOf('@') >= 0) {
|
|
18746
19068
|
continue;
|
|
18747
19069
|
}
|
|
18748
|
-
|
|
18749
|
-
|
|
18750
|
-
|
|
18751
|
-
|
|
18752
|
-
|
|
18753
|
-
|
|
18754
|
-
|
|
18755
|
-
|
|
19070
|
+
else if (keys[i].split('.').length === 1 && keys[i].split('.')[0].indexOf('@') < 0) {
|
|
19071
|
+
resultElem = elm.getElementsByTagName(keys[i]);
|
|
19072
|
+
}
|
|
19073
|
+
else {
|
|
19074
|
+
resultElem = elm.querySelectorAll(keys[i]);
|
|
19075
|
+
}
|
|
19076
|
+
for (var j = 0; j < resultElem.length; j++) {
|
|
19077
|
+
if (resultElem[j].closest('li') && keys[i] === 'p') {
|
|
19078
|
+
continue;
|
|
19079
|
+
}
|
|
19080
|
+
var styleProperty = resultElem[j].getAttribute('style');
|
|
19081
|
+
if (!isNullOrUndefined(styleProperty) && styleProperty.trim() !== '') {
|
|
19082
|
+
var valueSplit = values[i].split(';');
|
|
19083
|
+
if (!fromClass) {
|
|
19084
|
+
for (var k = 0; k < valueSplit.length; k++) {
|
|
19085
|
+
if (styleProperty.indexOf(valueSplit[k].split(':')[0]) >= 0) {
|
|
19086
|
+
valueSplit.splice(k, 1);
|
|
19087
|
+
k--;
|
|
19088
|
+
}
|
|
18756
19089
|
}
|
|
18757
19090
|
}
|
|
19091
|
+
var changedValue = styleProperty + valueSplit.join(';') + ';';
|
|
19092
|
+
resultElem[j].setAttribute('style', changedValue);
|
|
19093
|
+
}
|
|
19094
|
+
else {
|
|
19095
|
+
values[i] = values[i].replace(/text-indent:-(.*?)(?=;|$)/gm, '');
|
|
19096
|
+
resultElem[j].setAttribute('style', values[i]);
|
|
18758
19097
|
}
|
|
18759
|
-
var changedValue = styleProperty + valueSplit.join(';') + ';';
|
|
18760
|
-
resultElem[j].setAttribute('style', changedValue);
|
|
18761
|
-
}
|
|
18762
|
-
else {
|
|
18763
|
-
values[i] = values[i].replace(/text-indent:-(.*?)(?=;|$)/gm, '');
|
|
18764
|
-
resultElem[j].setAttribute('style', values[i]);
|
|
18765
19098
|
}
|
|
18766
|
-
|
|
18767
|
-
|
|
18768
|
-
|
|
18769
|
-
|
|
18770
|
-
|
|
18771
|
-
|
|
18772
|
-
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
|
|
18776
|
-
|
|
18777
|
-
|
|
18778
|
-
|
|
18779
|
-
|
|
18780
|
-
|
|
18781
|
-
|
|
18782
|
-
|
|
18783
|
-
|
|
18784
|
-
|
|
19099
|
+
fromClass = false;
|
|
19100
|
+
}
|
|
19101
|
+
var listClass = ['MsoListParagraphCxSpFirst', 'MsoListParagraphCxSpMiddle', 'MsoListParagraphCxSpLast'];
|
|
19102
|
+
for (var i = 0; i < listClass.length; i++) {
|
|
19103
|
+
if (keys.indexOf('li.' + listClass[i]) > -1) {
|
|
19104
|
+
var olULElems = elm.querySelectorAll('ol.' + listClass[i] + ', ul.' + listClass[i]);
|
|
19105
|
+
for (var j = 0; j < olULElems.length; j++) {
|
|
19106
|
+
var styleProperty = olULElems[j].getAttribute('style');
|
|
19107
|
+
if (!isNullOrUndefined(styleProperty) && styleProperty.trim() !== '' && olULElems[j].style.marginLeft !== '') {
|
|
19108
|
+
var valueSplit = values[keys.indexOf('li.' + listClass[i])].split(';');
|
|
19109
|
+
for (var k = 0; k < valueSplit.length; k++) {
|
|
19110
|
+
if ('margin-left'.indexOf(valueSplit[k].split(':')[0]) >= 0) {
|
|
19111
|
+
if (!isNullOrUndefined(valueSplit[k].split(':')[1]) &&
|
|
19112
|
+
valueSplit[k].split(':')[1].indexOf('in') >= 0 &&
|
|
19113
|
+
olULElems[j].style.marginLeft.indexOf('in') >= 0) {
|
|
19114
|
+
var classStyle = parseFloat(valueSplit[k].split(':')[1].split('in')[0]);
|
|
19115
|
+
var inlineStyle = parseFloat(olULElems[j].style.marginLeft.split('in')[0]);
|
|
19116
|
+
olULElems[j].style.marginLeft = (inlineStyle - classStyle) + 'in';
|
|
19117
|
+
}
|
|
18785
19118
|
}
|
|
18786
19119
|
}
|
|
18787
19120
|
}
|
|
@@ -19356,7 +19689,7 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
19356
19689
|
* get method
|
|
19357
19690
|
*
|
|
19358
19691
|
* @param {Document} docElement - specifies the document element
|
|
19359
|
-
* @param {Node}
|
|
19692
|
+
* @param {Node} rootNode - specifies the content editable element
|
|
19360
19693
|
* @param {string[]} formatNode - specifies the format node
|
|
19361
19694
|
* @param {string[]} fontSize - specifies the font size
|
|
19362
19695
|
* @param {string[]} fontName - specifies the font name.
|
|
@@ -19365,7 +19698,7 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
19365
19698
|
* @hidden
|
|
19366
19699
|
* @deprecated
|
|
19367
19700
|
*/
|
|
19368
|
-
ToolbarStatus.get = function (docElement,
|
|
19701
|
+
ToolbarStatus.get = function (docElement, rootNode, formatNode, fontSize, fontName, documentNode) {
|
|
19369
19702
|
var formatCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
19370
19703
|
var nodeCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
19371
19704
|
var nodeSelection = new NodeSelection();
|
|
@@ -19395,7 +19728,7 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
19395
19728
|
}
|
|
19396
19729
|
for (var index = 0; index < nodes.length; index++) {
|
|
19397
19730
|
// eslint-disable-next-line max-len
|
|
19398
|
-
formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index],
|
|
19731
|
+
formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], rootNode, formatNode, fontSize, fontName);
|
|
19399
19732
|
if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
|
|
19400
19733
|
nodeCollection.bold = formatCollection.bold;
|
|
19401
19734
|
}
|
|
@@ -19470,16 +19803,24 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
19470
19803
|
return node;
|
|
19471
19804
|
};
|
|
19472
19805
|
ToolbarStatus.getFormatParent = function (docElement, formatCollection, node, targetNode, formatNode, fontSize, fontName) {
|
|
19806
|
+
var isListUpdated = false;
|
|
19807
|
+
var isComplexListUpdated = false;
|
|
19473
19808
|
if (targetNode.contains(node) ||
|
|
19474
19809
|
(node.nodeType === 3 && targetNode.nodeType !== 3 && targetNode.contains(node.parentNode))) {
|
|
19475
19810
|
do {
|
|
19476
|
-
formatCollection = this.isFormattedNode(docElement, formatCollection, node, formatNode, fontSize, fontName);
|
|
19811
|
+
formatCollection = this.isFormattedNode(docElement, formatCollection, node, isListUpdated, isComplexListUpdated, formatNode, fontSize, fontName);
|
|
19812
|
+
if (formatCollection.orderedlist || formatCollection.unorderedlist) {
|
|
19813
|
+
isListUpdated = true;
|
|
19814
|
+
}
|
|
19815
|
+
if (formatCollection.bulletFormatList || formatCollection.numberFormatList) {
|
|
19816
|
+
isComplexListUpdated = true;
|
|
19817
|
+
}
|
|
19477
19818
|
node = node.parentNode;
|
|
19478
19819
|
} while (node && (node !== targetNode));
|
|
19479
19820
|
}
|
|
19480
19821
|
return formatCollection;
|
|
19481
19822
|
};
|
|
19482
|
-
ToolbarStatus.isFormattedNode = function (docElement, formatCollection, node, formatNode, fontSize, fontName) {
|
|
19823
|
+
ToolbarStatus.isFormattedNode = function (docElement, formatCollection, node, isListUpdated, isComplexListUpdated, formatNode, fontSize, fontName) {
|
|
19483
19824
|
if (!formatCollection.bold) {
|
|
19484
19825
|
formatCollection.bold = IsFormatted.isBold(node);
|
|
19485
19826
|
}
|
|
@@ -19510,10 +19851,10 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
19510
19851
|
if (!formatCollection.backgroundcolor) {
|
|
19511
19852
|
formatCollection.backgroundcolor = this.isBackgroundColor(node);
|
|
19512
19853
|
}
|
|
19513
|
-
if (!formatCollection.orderedlist) {
|
|
19854
|
+
if (!formatCollection.orderedlist && !isListUpdated) {
|
|
19514
19855
|
formatCollection.orderedlist = this.isOrderedList(node);
|
|
19515
19856
|
}
|
|
19516
|
-
if (!formatCollection.unorderedlist) {
|
|
19857
|
+
if (!formatCollection.unorderedlist && !isListUpdated) {
|
|
19517
19858
|
formatCollection.unorderedlist = this.isUnorderedList(node);
|
|
19518
19859
|
}
|
|
19519
19860
|
if (!formatCollection.alignments) {
|
|
@@ -19528,10 +19869,10 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
19528
19869
|
if (!formatCollection.createlink) {
|
|
19529
19870
|
formatCollection.createlink = this.isLink(node);
|
|
19530
19871
|
}
|
|
19531
|
-
if (!formatCollection.numberFormatList) {
|
|
19872
|
+
if (!formatCollection.numberFormatList && !isComplexListUpdated) {
|
|
19532
19873
|
formatCollection.numberFormatList = this.isNumberFormatList(node);
|
|
19533
19874
|
}
|
|
19534
|
-
if (!formatCollection.bulletFormatList) {
|
|
19875
|
+
if (!formatCollection.bulletFormatList && !isComplexListUpdated) {
|
|
19535
19876
|
formatCollection.bulletFormatList = this.isBulletFormatList(node);
|
|
19536
19877
|
}
|
|
19537
19878
|
return formatCollection;
|
|
@@ -20865,7 +21206,7 @@ var __extends$3 = (undefined && undefined.__extends) || (function () {
|
|
|
20865
21206
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
20866
21207
|
};
|
|
20867
21208
|
})();
|
|
20868
|
-
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
|
|
21209
|
+
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>";
|
|
20869
21210
|
/**
|
|
20870
21211
|
* Content module is used to render Rich Text Editor content
|
|
20871
21212
|
*
|
|
@@ -20895,6 +21236,7 @@ var IframeContentRender = /** @__PURE__ @class */ (function (_super) {
|
|
|
20895
21236
|
styles: 'display:block;',
|
|
20896
21237
|
attrs: { 'srcdoc': iFrameContent }
|
|
20897
21238
|
});
|
|
21239
|
+
iframe.setAttribute("role", "none");
|
|
20898
21240
|
this.setPanel(iframe);
|
|
20899
21241
|
rteObj.element.appendChild(iframe);
|
|
20900
21242
|
iframe.contentDocument.body.id = this.parent.getID() + '_rte-edit-view';
|
|
@@ -21604,7 +21946,11 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
21604
21946
|
(!isNullOrUndefined(this.deleteRangeElement.nextElementSibling) && this.deleteRangeElement.nextElementSibling.tagName === 'TABLE'))) {
|
|
21605
21947
|
return;
|
|
21606
21948
|
}
|
|
21607
|
-
|
|
21949
|
+
var isImgWithEmptyBlockNode = false;
|
|
21950
|
+
if (this.deleteRangeElement.querySelectorAll('img').length > 0 && this.deleteRangeElement.textContent.trim() === '') {
|
|
21951
|
+
isImgWithEmptyBlockNode = true;
|
|
21952
|
+
}
|
|
21953
|
+
if (this.getCaretIndex(currentRange, this.deleteRangeElement) === this.deleteRangeElement.textContent.length && !isImgWithEmptyBlockNode) {
|
|
21608
21954
|
if (!isNullOrUndefined(liElement)) {
|
|
21609
21955
|
if (isLiElement || !isNullOrUndefined(liElement.nextElementSibling)) {
|
|
21610
21956
|
this.deleteOldRangeElement = this.getRangeElement(liElement.nextElementSibling);
|
|
@@ -21796,19 +22142,6 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
21796
22142
|
}, e, value);
|
|
21797
22143
|
}
|
|
21798
22144
|
};
|
|
21799
|
-
HtmlEditor.prototype.mouseOutHandler = function () {
|
|
21800
|
-
if (!isNullOrUndefined(this.tooltipTargetEle)) {
|
|
21801
|
-
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
21802
|
-
}
|
|
21803
|
-
else {
|
|
21804
|
-
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
21805
|
-
this.parent.contentModule.getDocument();
|
|
21806
|
-
this.tooltipTargetEle = currentDocument.querySelector('[data-title]');
|
|
21807
|
-
this.tooltipTargetEle.setAttribute('title', this.tooltipTargetEle.getAttribute('data-title'));
|
|
21808
|
-
}
|
|
21809
|
-
this.tooltipTargetEle.removeAttribute('data-title');
|
|
21810
|
-
EventHandler.remove(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler);
|
|
21811
|
-
};
|
|
21812
22145
|
HtmlEditor.prototype.onToolbarClick = function (args) {
|
|
21813
22146
|
var _this = this;
|
|
21814
22147
|
var save;
|
|
@@ -21816,17 +22149,8 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
21816
22149
|
var selectParentEle;
|
|
21817
22150
|
var item = args.item;
|
|
21818
22151
|
var closestElement = closest(args.originalEvent.target, '.e-rte-quick-popup');
|
|
21819
|
-
var
|
|
21820
|
-
|
|
21821
|
-
this.tooltipTargetEle = closest(args.originalEvent.target, '[data-tooltip-id]');
|
|
21822
|
-
if (!isNullOrUndefined(this.tooltipTargetEle) && this.parent.showTooltip && !isNullOrUndefined(currentDocument.querySelector('.e-tooltip-wrap'))) {
|
|
21823
|
-
this.parent.notify(destroyTooltip, { args: event });
|
|
21824
|
-
if (!this.tooltipTargetEle.closest('.e-rte-quick-popup')) {
|
|
21825
|
-
this.tooltipTargetEle.setAttribute('data-title', this.tooltipTargetEle.getAttribute('title'));
|
|
21826
|
-
this.tooltipTargetEle.removeAttribute('title');
|
|
21827
|
-
EventHandler.add(this.tooltipTargetEle, 'mouseout', this.mouseOutHandler, this);
|
|
21828
|
-
}
|
|
21829
|
-
}
|
|
22152
|
+
var target = args.originalEvent.target;
|
|
22153
|
+
this.parent.notify(closeTooltip, { target: target });
|
|
21830
22154
|
if (item.command !== 'FormatPainter') {
|
|
21831
22155
|
if (closestElement && !closestElement.classList.contains('e-rte-inline-popup') && !closestElement.classList.contains('e-rte-text-popup')) {
|
|
21832
22156
|
if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
|
|
@@ -22749,6 +23073,9 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
22749
23073
|
this.setImageProperties(allImg[i]);
|
|
22750
23074
|
}
|
|
22751
23075
|
this.addTempClass(clipBoardElem);
|
|
23076
|
+
if (clipBoardElem.querySelectorAll('picture').length > 0) {
|
|
23077
|
+
this.processPictureElement(clipBoardElem);
|
|
23078
|
+
}
|
|
22752
23079
|
if (clipBoardElem.textContent !== '' || !isNullOrUndefined(clipBoardElem.querySelector('img')) ||
|
|
22753
23080
|
!isNullOrUndefined(clipBoardElem.querySelector('table'))) {
|
|
22754
23081
|
var tempWrapperElem = this.parent.createElement('div');
|
|
@@ -23208,6 +23535,26 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
23208
23535
|
}
|
|
23209
23536
|
return null;
|
|
23210
23537
|
};
|
|
23538
|
+
PasteCleanup.prototype.processPictureElement = function (clipBoardElem) {
|
|
23539
|
+
var pictureElems = clipBoardElem.querySelectorAll('picture');
|
|
23540
|
+
for (var i = 0; i < pictureElems.length; i++) {
|
|
23541
|
+
var imgElem = pictureElems[i].querySelector('img');
|
|
23542
|
+
var sourceElems = pictureElems[i].querySelectorAll('source');
|
|
23543
|
+
if (imgElem && imgElem.getAttribute('src')) {
|
|
23544
|
+
var srcValue = imgElem.getAttribute('src');
|
|
23545
|
+
var url = new URL(srcValue);
|
|
23546
|
+
for (var j = 0; j < sourceElems.length; j++) {
|
|
23547
|
+
var srcset = sourceElems[j].getAttribute('srcset');
|
|
23548
|
+
if (srcset) {
|
|
23549
|
+
if (srcset.indexOf('http') === -1) {
|
|
23550
|
+
var fullPath = url.origin + srcset;
|
|
23551
|
+
sourceElems[j].setAttribute('srcset', fullPath);
|
|
23552
|
+
}
|
|
23553
|
+
}
|
|
23554
|
+
}
|
|
23555
|
+
}
|
|
23556
|
+
}
|
|
23557
|
+
};
|
|
23211
23558
|
/**
|
|
23212
23559
|
* For internal use only - Get the module name.
|
|
23213
23560
|
*
|
|
@@ -23290,7 +23637,8 @@ var Resize = /** @__PURE__ @class */ (function () {
|
|
|
23290
23637
|
this.parent.element.style.width = (!this.parent.enableRtl) ? eventType.clientX - boundRect.left + 'px' : boundRect.right - eventType.clientX + 'px';
|
|
23291
23638
|
}
|
|
23292
23639
|
if (!this.parent.toolbarSettings.enable) {
|
|
23293
|
-
this.parent.
|
|
23640
|
+
var isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
23641
|
+
this.parent.setContentHeight('Resize', isExpand);
|
|
23294
23642
|
}
|
|
23295
23643
|
this.parent.refreshUI();
|
|
23296
23644
|
};
|
|
@@ -23646,7 +23994,7 @@ var FullScreen = /** @__PURE__ @class */ (function () {
|
|
|
23646
23994
|
_this.parent.element.classList.add(CLS_FULL_SCREEN);
|
|
23647
23995
|
_this.toggleParentOverflow(true);
|
|
23648
23996
|
var isExpand = _this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
23649
|
-
_this.parent.setContentHeight(
|
|
23997
|
+
_this.parent.setContentHeight('Maximize', isExpand);
|
|
23650
23998
|
if (_this.parent.toolbarModule) {
|
|
23651
23999
|
if (!_this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
|
|
23652
24000
|
_this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
|
|
@@ -23698,7 +24046,7 @@ var FullScreen = /** @__PURE__ @class */ (function () {
|
|
|
23698
24046
|
removeClass([elem[i]], ['e-rte-overflow']);
|
|
23699
24047
|
}
|
|
23700
24048
|
var isExpand = _this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
23701
|
-
_this.parent.setContentHeight(
|
|
24049
|
+
_this.parent.setContentHeight('Minimize', isExpand);
|
|
23702
24050
|
if (_this.parent.toolbarModule) {
|
|
23703
24051
|
if (!_this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
|
|
23704
24052
|
_this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
|
|
@@ -24049,7 +24397,7 @@ var EmojiPicker = /** @__PURE__ @class */ (function () {
|
|
|
24049
24397
|
}
|
|
24050
24398
|
this.popDiv = this.parent.createElement('div', { className: 'e-rte-emojipicker-popup', id: this.parent.getID() + '_emojiPicker' });
|
|
24051
24399
|
if (!isNullOrUndefined(this.parent.getToolbar()) && !this.parent.inlineMode.enable) {
|
|
24052
|
-
this.parent.getToolbar().appendChild(this.popDiv);
|
|
24400
|
+
this.parent.getToolbar().parentElement.appendChild(this.popDiv);
|
|
24053
24401
|
}
|
|
24054
24402
|
else if (this.parent.inlineMode.enable) {
|
|
24055
24403
|
this.parent.element.appendChild(this.popDiv);
|
|
@@ -25483,7 +25831,6 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25483
25831
|
this.isAllowedTypes = true;
|
|
25484
25832
|
this.pageX = null;
|
|
25485
25833
|
this.pageY = null;
|
|
25486
|
-
this.mouseX = null;
|
|
25487
25834
|
this.deletedImg = [];
|
|
25488
25835
|
this.parent = parent;
|
|
25489
25836
|
this.rteID = parent.element.id;
|
|
@@ -25641,11 +25988,6 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25641
25988
|
}
|
|
25642
25989
|
var args = { event: e, requestType: 'images' };
|
|
25643
25990
|
this.parent.trigger(resizeStop, args);
|
|
25644
|
-
/* eslint-disable */
|
|
25645
|
-
var pageX = this.getPointX(e);
|
|
25646
|
-
var pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
|
|
25647
|
-
this.parent.element.getBoundingClientRect().top + e.clientY : e.pageY;
|
|
25648
|
-
/* eslint-enable */
|
|
25649
25991
|
this.parent.formatter.editorManager.observer.on(checkUndo, this.undoStack, this);
|
|
25650
25992
|
this.parent.formatter.saveData();
|
|
25651
25993
|
};
|
|
@@ -25676,17 +26018,15 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25676
26018
|
if (this.quickToolObj) {
|
|
25677
26019
|
this.quickToolObj.imageQTBar.hidePopup();
|
|
25678
26020
|
}
|
|
25679
|
-
|
|
25680
|
-
|
|
25681
|
-
|
|
25682
|
-
|
|
25683
|
-
|
|
25684
|
-
|
|
25685
|
-
|
|
25686
|
-
|
|
25687
|
-
|
|
25688
|
-
if (target.classList.contains('e-rte-botRight')) {
|
|
25689
|
-
this.resizeBtnStat.botRight = true;
|
|
26021
|
+
var handlers = ['topLeft', 'topRight', 'botLeft', 'botRight'];
|
|
26022
|
+
for (var i = 0; i < handlers.length; i++) {
|
|
26023
|
+
var handler = handlers[i];
|
|
26024
|
+
if (target.classList.contains('e-rte-' + handler)) {
|
|
26025
|
+
this.resizeBtnStat[handler] = true;
|
|
26026
|
+
this.currentResizeHandler = handler;
|
|
26027
|
+
this.aspectRatio = this.findAspectRatio(this.imgEle);
|
|
26028
|
+
break; // Exit the loop once a match is found
|
|
26029
|
+
}
|
|
25690
26030
|
}
|
|
25691
26031
|
if (Browser.isDevice && this.contentModule.getEditPanel().contains(this.imgResizeDiv) &&
|
|
25692
26032
|
!this.imgResizeDiv.classList.contains('e-mob-span')) {
|
|
@@ -25817,89 +26157,80 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25817
26157
|
};
|
|
25818
26158
|
}
|
|
25819
26159
|
};
|
|
25820
|
-
Image.prototype.setAspectRatio = function (img, expectedX, expectedY
|
|
26160
|
+
Image.prototype.setAspectRatio = function (img, expectedX, expectedY) {
|
|
25821
26161
|
if (isNullOrUndefined(img.width)) {
|
|
25822
26162
|
return;
|
|
25823
26163
|
}
|
|
25824
|
-
|
|
25825
|
-
var
|
|
25826
|
-
|
|
25827
|
-
var
|
|
25828
|
-
|
|
25829
|
-
|
|
25830
|
-
if (
|
|
25831
|
-
if (
|
|
25832
|
-
|
|
25833
|
-
|
|
25834
|
-
img.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
|
|
26164
|
+
var width = img.width;
|
|
26165
|
+
var height = img.height;
|
|
26166
|
+
var sameHeightWidth = (width === height);
|
|
26167
|
+
var factor = this.parent.insertImageSettings.resizeByPercent ? '%' : 'px';
|
|
26168
|
+
var emptyStyleDimension = (img.style.width === '' && img.style.height === '');
|
|
26169
|
+
if (!sameHeightWidth && !emptyStyleDimension) {
|
|
26170
|
+
if (img.style.width !== '' && img.style.height !== '') {
|
|
26171
|
+
if (this.parent.insertImageSettings.resizeByPercent) {
|
|
26172
|
+
this.setImageWidth(img, expectedX, factor);
|
|
26173
|
+
this.removeImageHeight(img);
|
|
25835
26174
|
}
|
|
25836
26175
|
else {
|
|
25837
|
-
|
|
26176
|
+
this.setImageWidth(img, expectedX, factor);
|
|
26177
|
+
this.setImageHeight(img, expectedY, factor);
|
|
25838
26178
|
}
|
|
25839
|
-
img.style.height = null;
|
|
25840
|
-
img.removeAttribute('height');
|
|
25841
|
-
}
|
|
25842
|
-
else if (img.style.width === '' && img.style.height !== '') {
|
|
25843
|
-
img.style.height = expectedY + 'px';
|
|
25844
|
-
}
|
|
25845
|
-
else if (img.style.width !== '' && img.style.height === '') {
|
|
25846
|
-
var currentWidth = ((width / height * expectedY) + width / height) <
|
|
25847
|
-
(this.parent.inputElement.getBoundingClientRect().right - 32) ?
|
|
25848
|
-
((width / height * expectedY) + width / height) : (this.parent.inputElement.getBoundingClientRect().right - 32);
|
|
25849
|
-
img.style.width = currentWidth.toString() + 'px';
|
|
25850
|
-
img.style.height = expectedY + 'px';
|
|
25851
26179
|
}
|
|
25852
26180
|
else if (img.style.width !== '') {
|
|
25853
|
-
|
|
25854
|
-
|
|
25855
|
-
|
|
25856
|
-
img.style.height = expectedY + 'px';
|
|
25857
|
-
}
|
|
25858
|
-
else {
|
|
25859
|
-
if (this.parent.iframeSettings.enable) {
|
|
25860
|
-
img.setAttribute('width', (img.width + this.mouseX).toString());
|
|
26181
|
+
if (this.parent.insertImageSettings.resizeByPercent) {
|
|
26182
|
+
this.setImageWidth(img, expectedX, factor);
|
|
26183
|
+
this.removeImageHeight(img);
|
|
25861
26184
|
}
|
|
25862
26185
|
else {
|
|
25863
|
-
|
|
25864
|
-
img.setAttribute('width', (currentWidth).toString());
|
|
26186
|
+
this.setImageWidth(img, expectedX, factor);
|
|
25865
26187
|
}
|
|
25866
26188
|
}
|
|
25867
|
-
|
|
25868
|
-
|
|
25869
|
-
|
|
25870
|
-
|
|
25871
|
-
var original = img.offsetWidth + this.mouseX;
|
|
25872
|
-
var finalWidthByPerc = (original / img.offsetWidth) * (parseFloat(img.style.width).toString() === 'NaN' ?
|
|
25873
|
-
(img.offsetWidth / (parseFloat(getComputedStyle(this.parent.element).width)) * 100) :
|
|
25874
|
-
parseFloat(img.style.width));
|
|
25875
|
-
img.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
|
|
26189
|
+
else if (img.style.height !== '') {
|
|
26190
|
+
if (this.parent.insertImageSettings.resizeByPercent) {
|
|
26191
|
+
this.setImageWidth(img, expectedX, factor);
|
|
26192
|
+
this.removeImageHeight(img);
|
|
25876
26193
|
}
|
|
25877
26194
|
else {
|
|
25878
|
-
|
|
26195
|
+
this.setImageHeight(img, expectedY, factor);
|
|
25879
26196
|
}
|
|
25880
|
-
img.style.height = null;
|
|
25881
|
-
img.removeAttribute('height');
|
|
25882
|
-
}
|
|
25883
|
-
else if (img.style.width !== '') {
|
|
25884
|
-
img.style.width = expectedX + 'px';
|
|
25885
|
-
img.style.height = (height / width * expectedX) + 'px';
|
|
25886
|
-
}
|
|
25887
|
-
else {
|
|
25888
|
-
img.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - img.getBoundingClientRect().left).toString() : expectedX.toString());
|
|
25889
26197
|
}
|
|
25890
26198
|
}
|
|
25891
26199
|
else {
|
|
26200
|
+
this.setImageWidth(img, expectedX, factor);
|
|
25892
26201
|
if (this.parent.insertImageSettings.resizeByPercent) {
|
|
25893
|
-
|
|
25894
|
-
img.style.height = null;
|
|
25895
|
-
img.removeAttribute('height');
|
|
26202
|
+
this.removeImageHeight(img);
|
|
25896
26203
|
}
|
|
25897
26204
|
else {
|
|
25898
|
-
|
|
25899
|
-
img.style.height = ((expectedX >= 15) ? expectedX : 15) + 'px';
|
|
26205
|
+
this.setImageHeight(img, expectedY, factor);
|
|
25900
26206
|
}
|
|
25901
26207
|
}
|
|
25902
26208
|
};
|
|
26209
|
+
Image.prototype.setImageWidth = function (img, value, suffix) {
|
|
26210
|
+
img.style.width = this.getImageDimension(value, img) + suffix;
|
|
26211
|
+
if (!this.parent.insertImageSettings.resizeByPercent) {
|
|
26212
|
+
img.setAttribute('width', value.toString());
|
|
26213
|
+
}
|
|
26214
|
+
};
|
|
26215
|
+
Image.prototype.setImageHeight = function (img, value, suffix) {
|
|
26216
|
+
img.style.height = this.getImageDimension(value, img) + suffix;
|
|
26217
|
+
if (!this.parent.insertImageSettings.resizeByPercent) {
|
|
26218
|
+
img.setAttribute('height', value.toString());
|
|
26219
|
+
}
|
|
26220
|
+
};
|
|
26221
|
+
Image.prototype.removeImageHeight = function (img) {
|
|
26222
|
+
img.style.height = '';
|
|
26223
|
+
img.removeAttribute('height');
|
|
26224
|
+
};
|
|
26225
|
+
Image.prototype.getImageDimension = function (value, img) {
|
|
26226
|
+
if (this.parent.insertImageSettings.resizeByPercent) {
|
|
26227
|
+
var rootElem = img.parentElement || img.previousElementSibling;
|
|
26228
|
+
return this.pixToPerc(value, rootElem);
|
|
26229
|
+
}
|
|
26230
|
+
else {
|
|
26231
|
+
return value;
|
|
26232
|
+
}
|
|
26233
|
+
};
|
|
25903
26234
|
Image.prototype.pixToPerc = function (expected, parentEle) {
|
|
25904
26235
|
return expected / parseFloat(getComputedStyle(parentEle).width) * 100;
|
|
25905
26236
|
};
|
|
@@ -25922,7 +26253,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25922
26253
|
return;
|
|
25923
26254
|
}
|
|
25924
26255
|
_this.imgEle.parentElement.style.cursor = 'pointer';
|
|
25925
|
-
_this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10)
|
|
26256
|
+
_this.setAspectRatio(_this.imgEle, parseInt(width, 10), parseInt(height, 10));
|
|
25926
26257
|
_this.resizeImgDupPos(_this.imgEle);
|
|
25927
26258
|
_this.imgResizePos(_this.imgEle, _this.imgResizeDiv);
|
|
25928
26259
|
}
|
|
@@ -25933,35 +26264,37 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25933
26264
|
this.cancelResizeAction();
|
|
25934
26265
|
return;
|
|
25935
26266
|
}
|
|
25936
|
-
if (this.
|
|
25937
|
-
|
|
25938
|
-
|
|
25939
|
-
|
|
25940
|
-
|
|
25941
|
-
|
|
25942
|
-
|
|
25943
|
-
|
|
25944
|
-
|
|
25945
|
-
|
|
25946
|
-
|
|
25947
|
-
|
|
25948
|
-
|
|
25949
|
-
|
|
25950
|
-
|
|
25951
|
-
|
|
25952
|
-
|
|
25953
|
-
|
|
25954
|
-
|
|
25955
|
-
|
|
25956
|
-
this.
|
|
25957
|
-
|
|
25958
|
-
else if (this.resizeBtnStat.topRight) {
|
|
25959
|
-
this.imgDupMouseMove(width + 'px', height + 'px', e);
|
|
25960
|
-
}
|
|
25961
|
-
else if (this.resizeBtnStat.topLeft) {
|
|
26267
|
+
if (this.resizeBtnStat.botRight || this.resizeBtnStat.botLeft || this.resizeBtnStat.topRight || this.resizeBtnStat.topLeft) {
|
|
26268
|
+
var pageX = this.getPointX(e);
|
|
26269
|
+
var pageY = this.getPointY(e);
|
|
26270
|
+
var resizeFactor = this.getResizeFactor(this.currentResizeHandler);
|
|
26271
|
+
var diffX = (pageX - this.pageX);
|
|
26272
|
+
var diffY = (pageY - this.pageY);
|
|
26273
|
+
var currentWidth = this.imgEle.clientWidth;
|
|
26274
|
+
var currentHeight = this.imgEle.clientHeight;
|
|
26275
|
+
var width = diffX * resizeFactor[0] + currentWidth;
|
|
26276
|
+
var height = diffY * resizeFactor[1] + currentHeight;
|
|
26277
|
+
width = (width < 16) ? 16 : width;
|
|
26278
|
+
height = (height < 16) ? 16 : height;
|
|
26279
|
+
if (Math.abs(diffX) > Math.abs(diffY)) {
|
|
26280
|
+
height = Math.round(width / this.aspectRatio);
|
|
26281
|
+
width = Math.round(height * this.aspectRatio);
|
|
26282
|
+
}
|
|
26283
|
+
else {
|
|
26284
|
+
width = Math.round(height * this.aspectRatio);
|
|
26285
|
+
height = Math.round(width / this.aspectRatio);
|
|
26286
|
+
}
|
|
26287
|
+
this.pageX = pageX;
|
|
26288
|
+
this.pageY = pageY;
|
|
25962
26289
|
this.imgDupMouseMove(width + 'px', height + 'px', e);
|
|
25963
26290
|
}
|
|
25964
26291
|
};
|
|
26292
|
+
Image.prototype.getResizeFactor = function (value) {
|
|
26293
|
+
return imageResizeFactor[value];
|
|
26294
|
+
};
|
|
26295
|
+
Image.prototype.findAspectRatio = function (image) {
|
|
26296
|
+
return image.clientWidth / image.clientHeight;
|
|
26297
|
+
};
|
|
25965
26298
|
Image.prototype.cancelResizeAction = function () {
|
|
25966
26299
|
EventHandler.remove(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing);
|
|
25967
26300
|
EventHandler.remove(this.contentModule.getDocument(), Browser.touchEndEvent, this.resizeEnd);
|
|
@@ -25971,6 +26304,8 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25971
26304
|
this.imgResizeDiv = null;
|
|
25972
26305
|
this.pageX = null;
|
|
25973
26306
|
this.pageY = null;
|
|
26307
|
+
this.currentResizeHandler = null;
|
|
26308
|
+
this.aspectRatio = null;
|
|
25974
26309
|
}
|
|
25975
26310
|
};
|
|
25976
26311
|
Image.prototype.resizeImgDupPos = function (e) {
|
|
@@ -25981,6 +26316,8 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
25981
26316
|
};
|
|
25982
26317
|
};
|
|
25983
26318
|
Image.prototype.resizeBtnInit = function () {
|
|
26319
|
+
this.aspectRatio = null;
|
|
26320
|
+
this.currentResizeHandler = null;
|
|
25984
26321
|
return this.resizeBtnStat = { botLeft: false, botRight: false, topRight: false, topLeft: false };
|
|
25985
26322
|
};
|
|
25986
26323
|
Image.prototype.onToolbarAction = function (args) {
|
|
@@ -26490,7 +26827,6 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26490
26827
|
selectNode: e.selectNode, selectParent: e.selectParent, link: inputLink, target: target_1, ariaLabel: imageLabel
|
|
26491
26828
|
};
|
|
26492
26829
|
this.dialogObj.setProperties({
|
|
26493
|
-
height: 'inherit',
|
|
26494
26830
|
width: '290px',
|
|
26495
26831
|
header: this.parent.localeObj.getConstant('imageInsertLinkHeader'),
|
|
26496
26832
|
content: linkWrap,
|
|
@@ -26543,7 +26879,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26543
26879
|
alt: inputAlt
|
|
26544
26880
|
};
|
|
26545
26881
|
this.dialogObj.setProperties({
|
|
26546
|
-
|
|
26882
|
+
width: '290px', header: altHeader, content: altWrap,
|
|
26547
26883
|
buttons: [{
|
|
26548
26884
|
// eslint-disable-next-line
|
|
26549
26885
|
click: function (e) {
|
|
@@ -26792,7 +27128,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26792
27128
|
var dialogContent = this.imgsizeInput(e);
|
|
26793
27129
|
var selectObj_1 = { args: e.args, selfImage: this, selection: e.selection, selectNode: e.selectNode };
|
|
26794
27130
|
this.dialogObj.setProperties({
|
|
26795
|
-
|
|
27131
|
+
width: '290px', header: imgSizeHeader, content: dialogContent,
|
|
26796
27132
|
buttons: [{
|
|
26797
27133
|
// eslint-disable-next-line
|
|
26798
27134
|
click: function (e) {
|
|
@@ -26993,7 +27329,6 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
26993
27329
|
for (var i = 0; i < items.length; i++) {
|
|
26994
27330
|
removeClass([items[i]], 'e-img-focus');
|
|
26995
27331
|
removeClass([items[i]], 'e-resize');
|
|
26996
|
-
items[i].style.maxWidth = '';
|
|
26997
27332
|
}
|
|
26998
27333
|
}
|
|
26999
27334
|
};
|
|
@@ -27007,7 +27342,6 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
27007
27342
|
this.cancelResizeAction();
|
|
27008
27343
|
}
|
|
27009
27344
|
};
|
|
27010
|
-
// eslint-disable-next-line
|
|
27011
27345
|
Image.prototype.imageUrlPopup = function (e) {
|
|
27012
27346
|
var _this = this;
|
|
27013
27347
|
var imgUrl = this.parent.createElement('div', { className: 'imgUrl' + this.parent.getCssClass(true) });
|
|
@@ -27094,6 +27428,12 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
27094
27428
|
var heightVal = isNullOrUndefined(this.changedHeightValue) && (selectNode.style.height.toString() === 'auto' ||
|
|
27095
27429
|
selectNode.style.height !== '') ? selectNode.style.height : !isNullOrUndefined(this.changedHeightValue) ?
|
|
27096
27430
|
this.changedHeightValue : (parseInt(selectNode.getClientRects()[0].height.toString(), 10)).toString();
|
|
27431
|
+
if (selectNode.style.width === '') {
|
|
27432
|
+
widthVal = 'auto';
|
|
27433
|
+
}
|
|
27434
|
+
if (selectNode.style.height === '') {
|
|
27435
|
+
heightVal = 'auto';
|
|
27436
|
+
}
|
|
27097
27437
|
this.changedWidthValue = null;
|
|
27098
27438
|
this.changedHeightValue = null;
|
|
27099
27439
|
var content = '<div class="e-rte-label' + this.parent.getCssClass(true) + '"><label>' + imgWidth +
|
|
@@ -27228,7 +27568,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
27228
27568
|
_this.parent.trigger(imageSelected, selectArgs, function (selectArgs) {
|
|
27229
27569
|
if (!selectArgs.cancel) {
|
|
27230
27570
|
_this.checkExtension(selectArgs.filesData[0]);
|
|
27231
|
-
altText = selectArgs.filesData[0].name;
|
|
27571
|
+
altText = selectArgs.filesData[0].name.replace(/\.[a-zA-Z0-9]+$/, '');
|
|
27232
27572
|
if (_this.parent.editorMode === 'HTML' && isNullOrUndefined(_this.parent.insertImageSettings.path)) {
|
|
27233
27573
|
var reader_1 = new FileReader();
|
|
27234
27574
|
// eslint-disable-next-line
|
|
@@ -28802,7 +29142,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
28802
29142
|
var dialogContent = this.vidsizeInput(e);
|
|
28803
29143
|
var selectObj_1 = { args: e.args, selfVideo: this, selection: e.selection, selectNode: e.selectNode };
|
|
28804
29144
|
this.dialogObj.setProperties({
|
|
28805
|
-
|
|
29145
|
+
width: '290px', header: vidSizeHeader, content: dialogContent,
|
|
28806
29146
|
buttons: [{
|
|
28807
29147
|
// eslint-disable-next-line
|
|
28808
29148
|
click: function (e) {
|
|
@@ -29174,7 +29514,6 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
29174
29514
|
_this.setAspectRatio(_this.videoEle, parseInt(width, 10), parseInt(height, 10), args);
|
|
29175
29515
|
_this.resizeVidDupPos(_this.videoEle);
|
|
29176
29516
|
_this.vidResizePos(_this.videoEle, _this.vidResizeDiv);
|
|
29177
|
-
_this.parent.setContentHeight('', false);
|
|
29178
29517
|
}
|
|
29179
29518
|
});
|
|
29180
29519
|
};
|
|
@@ -29987,8 +30326,12 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
29987
30326
|
_this.parent.trigger(fileRemoving, e, function (e) {
|
|
29988
30327
|
proxy.isVideoUploaded = false;
|
|
29989
30328
|
_this.dialogObj.getButtons(0).element.disabled = true;
|
|
29990
|
-
|
|
29991
|
-
|
|
30329
|
+
if (proxy.inputUrl.getAttribute('disabled')) {
|
|
30330
|
+
proxy.inputUrl.removeAttribute('disabled');
|
|
30331
|
+
}
|
|
30332
|
+
if (proxy.embedInputUrl.getAttribute('disabled')) {
|
|
30333
|
+
proxy.embedInputUrl.removeAttribute('disabled');
|
|
30334
|
+
}
|
|
29992
30335
|
if (proxy.uploadUrl) {
|
|
29993
30336
|
proxy.uploadUrl.url = '';
|
|
29994
30337
|
}
|
|
@@ -30224,7 +30567,6 @@ var ViewSource = /** @__PURE__ @class */ (function () {
|
|
|
30224
30567
|
rteContent.appendChild(this.previewElement);
|
|
30225
30568
|
this.parent.element.appendChild(rteContent);
|
|
30226
30569
|
rteContent.style.height = this.contentModule.getPanel().style.height;
|
|
30227
|
-
rteContent.style.marginTop = this.contentModule.getPanel().style.marginTop;
|
|
30228
30570
|
this.getPanel().value = this.getTextAreaValue();
|
|
30229
30571
|
this.contentModule.getPanel().style.display = 'none';
|
|
30230
30572
|
rteContent.style.display = 'block';
|
|
@@ -30245,14 +30587,17 @@ var ViewSource = /** @__PURE__ @class */ (function () {
|
|
|
30245
30587
|
removeClass([this.parent.getToolbar()], [CLS_EXPAND_OPEN]);
|
|
30246
30588
|
}
|
|
30247
30589
|
removeClass(tbItems, [CLS_ACTIVE]);
|
|
30248
|
-
this.parent.
|
|
30590
|
+
var isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
30591
|
+
this.parent.setContentHeight('SourceCode', isExpand);
|
|
30249
30592
|
this.wireEvent(this.previewElement);
|
|
30250
30593
|
this.unWireBaseKeyDown();
|
|
30251
30594
|
this.previewElement.focus();
|
|
30252
30595
|
this.parent.updateValue();
|
|
30253
30596
|
if (!isNullOrUndefined(this.parent.placeholder) && !this.parent.iframeSettings.enable) {
|
|
30254
30597
|
var placeHolderWrapper = this.parent.element.querySelector('.rte-placeholder.e-rte-placeholder');
|
|
30255
|
-
placeHolderWrapper
|
|
30598
|
+
if (placeHolderWrapper) {
|
|
30599
|
+
placeHolderWrapper.style.display = 'none';
|
|
30600
|
+
}
|
|
30256
30601
|
}
|
|
30257
30602
|
this.parent.trigger(actionComplete, { requestType: 'SourceCode', targetItem: 'SourceCode', args: args });
|
|
30258
30603
|
this.parent.invokeChangeEvent();
|
|
@@ -30308,7 +30653,8 @@ var ViewSource = /** @__PURE__ @class */ (function () {
|
|
|
30308
30653
|
if (this.parent.getToolbar()) {
|
|
30309
30654
|
removeClass([this.parent.getToolbar()], [CLS_EXPAND_OPEN]);
|
|
30310
30655
|
}
|
|
30311
|
-
this.parent.
|
|
30656
|
+
var isExpand = this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
30657
|
+
this.parent.setContentHeight('Preview', isExpand);
|
|
30312
30658
|
this.unWireEvent();
|
|
30313
30659
|
this.wireBaseKeyDown();
|
|
30314
30660
|
this.contentModule.getEditPanel().focus();
|
|
@@ -30383,6 +30729,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30383
30729
|
this.pageY = null;
|
|
30384
30730
|
this.moveEle = null;
|
|
30385
30731
|
this.currentColumnResize = '';
|
|
30732
|
+
this.resizeEndTime = 0;
|
|
30386
30733
|
this.parent = parent;
|
|
30387
30734
|
this.rteID = parent.element.id;
|
|
30388
30735
|
this.l10n = serviceLocator.getService('rteLocale');
|
|
@@ -30540,7 +30887,15 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30540
30887
|
Table.prototype.keyUp = function (e) {
|
|
30541
30888
|
var target = e.args.target;
|
|
30542
30889
|
if (e.args.key.toLocaleLowerCase() === 'escape' && target && target.classList && (this.popupObj && !closest(target, '[id=' + "'" + this.popupObj.element.id + "'" + ']')) && this.popupObj) {
|
|
30890
|
+
var createTableToolbarBtn = this.popupObj.relateTo;
|
|
30891
|
+
if (createTableToolbarBtn.nodeName !== 'BUTTON') {
|
|
30892
|
+
createTableToolbarBtn = createTableToolbarBtn.querySelector('span.e-create-table');
|
|
30893
|
+
createTableToolbarBtn = createTableToolbarBtn.parentElement;
|
|
30894
|
+
}
|
|
30543
30895
|
this.popupObj.hide();
|
|
30896
|
+
if (createTableToolbarBtn) {
|
|
30897
|
+
createTableToolbarBtn.focus();
|
|
30898
|
+
}
|
|
30544
30899
|
}
|
|
30545
30900
|
};
|
|
30546
30901
|
Table.prototype.keyDown = function (e) {
|
|
@@ -30720,7 +31075,20 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30720
31075
|
return false;
|
|
30721
31076
|
}
|
|
30722
31077
|
};
|
|
31078
|
+
Table.prototype.removeEmptyTextNodes = function (element) {
|
|
31079
|
+
var children = element.childNodes;
|
|
31080
|
+
for (var i = children.length - 1; i >= 0; i--) {
|
|
31081
|
+
var node = children[i];
|
|
31082
|
+
if (node.nodeType === Node.TEXT_NODE && node.nodeValue.trim() === '') {
|
|
31083
|
+
element.removeChild(node);
|
|
31084
|
+
}
|
|
31085
|
+
}
|
|
31086
|
+
};
|
|
30723
31087
|
Table.prototype.tabSelection = function (event, selection, ele) {
|
|
31088
|
+
var allHeadBodyTRElements = ele.closest('table').querySelectorAll('thead, tbody, tr');
|
|
31089
|
+
for (var i = 0; i < allHeadBodyTRElements.length; i++) {
|
|
31090
|
+
this.removeEmptyTextNodes(allHeadBodyTRElements[i]);
|
|
31091
|
+
}
|
|
30724
31092
|
this.previousTableElement = ele;
|
|
30725
31093
|
var insideList = this.insideList(selection.range);
|
|
30726
31094
|
if ((event.keyCode === 37 || event.keyCode === 39) && selection.range.startContainer.nodeType === 3 ||
|
|
@@ -30857,10 +31225,12 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30857
31225
|
var startNode = this.parent.getRange().startContainer.parentElement;
|
|
30858
31226
|
var endNode = this.parent.getRange().endContainer.parentElement;
|
|
30859
31227
|
var isAnchorEle = this.getAnchorNode(target);
|
|
31228
|
+
var currentTime = new Date().getTime();
|
|
30860
31229
|
if (target && target.nodeName !== 'A' && isAnchorEle.nodeName !== 'A' && target.nodeName !== 'IMG' && target.nodeName !== 'VIDEO' && !target.classList.contains(CLS_CLICKELEM) &&
|
|
30861
31230
|
target.nodeName !== 'AUDIO' && startNode === endNode && (target.nodeName === 'TD' || target.nodeName === 'TH' ||
|
|
30862
31231
|
target.nodeName === 'TABLE' || (closestTable && this.parent.contentModule.getEditPanel().contains(closestTable)))
|
|
30863
|
-
&& !(range.startContainer.nodeType === 3 && !range.collapsed)
|
|
31232
|
+
&& !(range.startContainer.nodeType === 3 && !range.collapsed) &&
|
|
31233
|
+
currentTime - this.resizeEndTime > 100) {
|
|
30864
31234
|
var range_1 = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
|
|
30865
31235
|
this.parent.formatter.editorManager.nodeSelection.save(range_1, this.contentModule.getDocument());
|
|
30866
31236
|
this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
|
|
@@ -30956,7 +31326,10 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
30956
31326
|
var tdNode = closest(target, 'td,th');
|
|
30957
31327
|
target = (target.nodeName !== 'TD' && tdNode && this.parent.contentModule.getEditPanel().contains(tdNode)) ?
|
|
30958
31328
|
tdNode : target;
|
|
30959
|
-
|
|
31329
|
+
if (!(this.parent.quickToolbarSettings.showOnRightClick && e.args.which === 3 &&
|
|
31330
|
+
target.classList.contains(CLS_TABLE_SEL))) {
|
|
31331
|
+
removeClass(this.contentModule.getEditPanel().querySelectorAll('table td, table th'), CLS_TABLE_SEL);
|
|
31332
|
+
}
|
|
30960
31333
|
if (target && (target.tagName === 'TD' || target.tagName === 'TH')) {
|
|
30961
31334
|
addClass([target], CLS_TABLE_SEL);
|
|
30962
31335
|
this.activeCell = target;
|
|
@@ -31345,6 +31718,9 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31345
31718
|
widthCompare = rteWidth;
|
|
31346
31719
|
}
|
|
31347
31720
|
if (_this.resizeBtnStat.column) {
|
|
31721
|
+
if (_this.curTable.closest('li')) {
|
|
31722
|
+
widthCompare = _this.curTable.closest('li').offsetWidth;
|
|
31723
|
+
}
|
|
31348
31724
|
var colGroup = _this.curTable.querySelectorAll('colgroup > col');
|
|
31349
31725
|
var currentTableWidth = void 0;
|
|
31350
31726
|
if (_this.curTable.style.width !== '' && _this.curTable.style.width.includes('%')) {
|
|
@@ -31370,6 +31746,15 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31370
31746
|
(_this.convertPixelToPercentage(tableWidth - mouseX, widthCompare) + '%');
|
|
31371
31747
|
var differenceWidth = currentTableWidth - _this.convertPixelToPercentage(tableWidth - mouseX, widthCompare);
|
|
31372
31748
|
var preMarginLeft = 0;
|
|
31749
|
+
var widthType = _this.curTable.style.width.indexOf('%') > -1;
|
|
31750
|
+
if (!widthType && _this.curTable.offsetWidth > _this.contentModule.getEditPanel().offsetWidth) {
|
|
31751
|
+
_this.curTable.style.width = rteWidth + 'px';
|
|
31752
|
+
return;
|
|
31753
|
+
}
|
|
31754
|
+
if (widthType && parseFloat(_this.curTable.style.width.split('%')[0]) > 100) {
|
|
31755
|
+
_this.curTable.style.width = '100%';
|
|
31756
|
+
return;
|
|
31757
|
+
}
|
|
31373
31758
|
if (!isNullOrUndefined(_this.curTable.style.marginLeft) && _this.curTable.style.marginLeft !== '') {
|
|
31374
31759
|
var regex = /[-+]?\d*\.\d+|\d+/;
|
|
31375
31760
|
var value = _this.curTable.style.marginLeft.match(regex);
|
|
@@ -31378,6 +31763,15 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31378
31763
|
}
|
|
31379
31764
|
}
|
|
31380
31765
|
var currentMarginLeft = preMarginLeft + differenceWidth;
|
|
31766
|
+
if (currentMarginLeft && currentMarginLeft > 100) {
|
|
31767
|
+
var width = parseFloat(_this.curTable.style.width);
|
|
31768
|
+
currentMarginLeft = 100 - width;
|
|
31769
|
+
}
|
|
31770
|
+
if (currentMarginLeft && currentMarginLeft < 1) {
|
|
31771
|
+
_this.curTable.style.marginLeft = null;
|
|
31772
|
+
_this.curTable.style.width = '100%';
|
|
31773
|
+
return;
|
|
31774
|
+
}
|
|
31381
31775
|
_this.curTable.style.marginLeft = 'calc(' + (_this.curTable.style.width === '100%' ? 0 : currentMarginLeft) + '%)';
|
|
31382
31776
|
for (var i = 0; i < firstColumnsCell.length; i++) {
|
|
31383
31777
|
var currentColumnCellWidth = _this.getCurrentColWidth(firstColumnsCell[i], tableWidth);
|
|
@@ -31448,15 +31842,26 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31448
31842
|
maxiumWidth = Math.abs(tableBoxPosition - currentTdElement.getBoundingClientRect().width) - 5;
|
|
31449
31843
|
_this.curTable.style.maxWidth = maxiumWidth + 'px';
|
|
31450
31844
|
}
|
|
31451
|
-
var widthType = _this.curTable.style.width.indexOf('%') > -1;
|
|
31452
|
-
_this.curTable.style.width = widthType ? _this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) + '%'
|
|
31453
|
-
: tableWidth + mouseX + 'px';
|
|
31454
31845
|
_this.curTable.style.height = tableHeight + mouseY + 'px';
|
|
31455
31846
|
if (!isNullOrUndefined(tableReBox)) {
|
|
31456
31847
|
tableReBox.classList.add('e-rbox-select');
|
|
31457
31848
|
tableReBox.style.cssText = 'top: ' + (_this.calcPos(_this.curTable).top + tableHeight - 4) +
|
|
31458
31849
|
'px; left:' + (_this.calcPos(_this.curTable).left + tableWidth - 4) + 'px;';
|
|
31459
31850
|
}
|
|
31851
|
+
if (_this.curTable.closest('li')) {
|
|
31852
|
+
widthCompare = _this.curTable.closest('li').offsetWidth;
|
|
31853
|
+
}
|
|
31854
|
+
var widthType = _this.curTable.style.width.indexOf('%') > -1;
|
|
31855
|
+
if (widthType && parseFloat(_this.curTable.style.width.split('%')[0]) > 100) {
|
|
31856
|
+
_this.curTable.style.width = '100%';
|
|
31857
|
+
return;
|
|
31858
|
+
}
|
|
31859
|
+
if (!widthType && _this.curTable.offsetWidth > _this.contentModule.getEditPanel().offsetWidth) {
|
|
31860
|
+
_this.curTable.style.width = rteWidth + 'px';
|
|
31861
|
+
return;
|
|
31862
|
+
}
|
|
31863
|
+
_this.curTable.style.width = widthType ? _this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) + '%'
|
|
31864
|
+
: tableWidth + mouseX + 'px';
|
|
31460
31865
|
}
|
|
31461
31866
|
}
|
|
31462
31867
|
});
|
|
@@ -31533,6 +31938,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31533
31938
|
var args = { event: e, requestType: 'table' };
|
|
31534
31939
|
this.parent.trigger(resizeStop, args);
|
|
31535
31940
|
this.parent.formatter.saveData();
|
|
31941
|
+
this.resizeEndTime = new Date().getTime();
|
|
31536
31942
|
};
|
|
31537
31943
|
Table.prototype.resetResizeHelper = function (curTable) {
|
|
31538
31944
|
var colHelper = this.parent.element.querySelectorAll('.e-table-rhelper.e-column-helper');
|
|
@@ -31547,6 +31953,9 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31547
31953
|
element.parentNode.removeChild(element);
|
|
31548
31954
|
}
|
|
31549
31955
|
});
|
|
31956
|
+
if (!curTable.style.width) {
|
|
31957
|
+
curTable.style.width = curTable.offsetWidth + 'px';
|
|
31958
|
+
}
|
|
31550
31959
|
var colGroup = curTable.querySelector('colgroup');
|
|
31551
31960
|
if (colGroup) {
|
|
31552
31961
|
for (var i = 0; i < curTable.rows.length; i++) {
|
|
@@ -31643,7 +32052,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31643
32052
|
this.createTableButton.isStringTemplate = true;
|
|
31644
32053
|
this.createTableButton.appendTo(btnEle);
|
|
31645
32054
|
EventHandler.add(btnEle, 'click', this.insertTableDialog, { self: this, args: args.args, selection: args.selection });
|
|
31646
|
-
this.parent.getToolbar().appendChild(this.dlgDiv);
|
|
32055
|
+
this.parent.getToolbar().parentElement.appendChild(this.dlgDiv);
|
|
31647
32056
|
var target = args.args.originalEvent.target;
|
|
31648
32057
|
target = target.classList.contains('e-toolbar-item') ? target.firstChild : target.parentElement;
|
|
31649
32058
|
this.popupObj = new Popup(this.dlgDiv, {
|
|
@@ -32681,7 +33090,7 @@ var PasteCleanupSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
32681
33090
|
Property(null)
|
|
32682
33091
|
], PasteCleanupSettings.prototype, "deniedAttrs", void 0);
|
|
32683
33092
|
__decorate$2([
|
|
32684
|
-
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'])
|
|
33093
|
+
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'])
|
|
32685
33094
|
], PasteCleanupSettings.prototype, "allowedStyleProps", void 0);
|
|
32686
33095
|
__decorate$2([
|
|
32687
33096
|
Property(null)
|
|
@@ -32969,7 +33378,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
32969
33378
|
isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
|
|
32970
33379
|
}
|
|
32971
33380
|
if (e.args.which === 13 && !e.args.ctrlKey && (!Browser.isDevice ? e.args.code === 'Enter' : e.args.key === 'Enter')) {
|
|
32972
|
-
if (isNullOrUndefined(this.startNode.closest('LI, UL, OL')) && isNullOrUndefined(this.endNode.closest('LI, UL, OL')) &&
|
|
33381
|
+
if (isNullOrUndefined(this.startNode.closest('LI, UL, OL')) && isNullOrUndefined(this.endNode.closest('LI, UL, OL')) &&
|
|
33382
|
+
isNullOrUndefined(this.startNode.closest('.e-img-inner')) && isTableEnter &&
|
|
32973
33383
|
isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
|
|
32974
33384
|
var shiftKey_1 = e.args.shiftKey;
|
|
32975
33385
|
var actionBeginArgs = {
|
|
@@ -33484,6 +33894,14 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
33484
33894
|
member: 'image',
|
|
33485
33895
|
args: [this, this.serviceLocator]
|
|
33486
33896
|
});
|
|
33897
|
+
modules.push({
|
|
33898
|
+
member: 'audio',
|
|
33899
|
+
args: [this, this.serviceLocator]
|
|
33900
|
+
});
|
|
33901
|
+
modules.push({
|
|
33902
|
+
member: 'video',
|
|
33903
|
+
args: [this, this.serviceLocator]
|
|
33904
|
+
});
|
|
33487
33905
|
if (this.quickToolbarSettings.enable) {
|
|
33488
33906
|
modules.push({ member: 'quickToolbar', args: [this, this.serviceLocator] });
|
|
33489
33907
|
}
|
|
@@ -33497,14 +33915,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
33497
33915
|
if (this.editorMode === 'HTML') {
|
|
33498
33916
|
modules.push({ member: 'htmlEditor', args: [this, this.serviceLocator] });
|
|
33499
33917
|
modules.push({ member: 'pasteCleanup', args: [this, this.serviceLocator] });
|
|
33500
|
-
modules.push({
|
|
33501
|
-
member: 'audio',
|
|
33502
|
-
args: [this, this.serviceLocator]
|
|
33503
|
-
});
|
|
33504
|
-
modules.push({
|
|
33505
|
-
member: 'video',
|
|
33506
|
-
args: [this, this.serviceLocator]
|
|
33507
|
-
});
|
|
33508
33918
|
modules.push({
|
|
33509
33919
|
member: 'formatPainter',
|
|
33510
33920
|
args: [this]
|
|
@@ -33536,7 +33946,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
33536
33946
|
else {
|
|
33537
33947
|
if (this.getToolbar()) {
|
|
33538
33948
|
removeClass(this.getToolbar().querySelectorAll('.' + CLS_ACTIVE), CLS_ACTIVE);
|
|
33539
|
-
removeClass([this.getToolbar()], [CLS_TB_FLOAT
|
|
33949
|
+
removeClass([this.getToolbar().parentElement], [CLS_TB_FLOAT]);
|
|
33540
33950
|
}
|
|
33541
33951
|
addClass([this.element], CLS_DISABLED);
|
|
33542
33952
|
this.element.tabIndex = -1;
|
|
@@ -33957,7 +34367,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
33957
34367
|
(this.toolbarSettings.items.indexOf('Undo') > -1 && this.toolbarSettings.items.indexOf('Redo') > -1)) {
|
|
33958
34368
|
this.disableToolbarItem(['Undo', 'Redo']);
|
|
33959
34369
|
}
|
|
33960
|
-
this.setContentHeight();
|
|
34370
|
+
this.setContentHeight('Init');
|
|
33961
34371
|
if (this.value !== null) {
|
|
33962
34372
|
this.valueContainer.defaultValue = this.value;
|
|
33963
34373
|
}
|
|
@@ -34163,8 +34573,15 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34163
34573
|
case 'toolbar-focus':
|
|
34164
34574
|
if (this.toolbarSettings.enable && this.getToolbarElement()) {
|
|
34165
34575
|
var firstActiveItem = this.getToolbarElement().querySelector('.e-toolbar-item:not(.e-overlay)[title]');
|
|
34166
|
-
|
|
34167
|
-
|
|
34576
|
+
var quickToolbarElem = this.getRenderedQuickToolbarElem();
|
|
34577
|
+
if (quickToolbarElem) {
|
|
34578
|
+
firstActiveItem = quickToolbarElem.querySelector('.e-toolbar-item:not(.e-overlay)[title]');
|
|
34579
|
+
}
|
|
34580
|
+
if (firstActiveItem) {
|
|
34581
|
+
var firstChild = firstActiveItem.firstElementChild;
|
|
34582
|
+
firstChild.removeAttribute('tabindex');
|
|
34583
|
+
firstChild.focus();
|
|
34584
|
+
}
|
|
34168
34585
|
}
|
|
34169
34586
|
break;
|
|
34170
34587
|
case 'escape':
|
|
@@ -34381,6 +34798,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34381
34798
|
_this.notify(pasteClean, { args: e });
|
|
34382
34799
|
}
|
|
34383
34800
|
else {
|
|
34801
|
+
console.warn('[WARNING] :: Module "pasteCleanup" is not available in RichTextEditor component! You either misspelled the module name or forgot to load it.');
|
|
34384
34802
|
var args_2 = { requestType: 'Paste', editorMode: _this.editorMode, event: e };
|
|
34385
34803
|
var value = null;
|
|
34386
34804
|
var htmlValue = false;
|
|
@@ -34675,7 +35093,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34675
35093
|
break;
|
|
34676
35094
|
case 'height':
|
|
34677
35095
|
this.setHeight(newProp[prop]);
|
|
34678
|
-
this.setContentHeight();
|
|
35096
|
+
this.setContentHeight('Init');
|
|
34679
35097
|
this.autoResize();
|
|
34680
35098
|
break;
|
|
34681
35099
|
case 'readonly':
|
|
@@ -34722,11 +35140,11 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34722
35140
|
break;
|
|
34723
35141
|
case 'inlineMode':
|
|
34724
35142
|
this.notify(modelChanged, { module: 'quickToolbar', newProp: newProp, oldProp: oldProp });
|
|
34725
|
-
this.setContentHeight();
|
|
35143
|
+
this.setContentHeight('Init');
|
|
34726
35144
|
break;
|
|
34727
35145
|
case 'toolbarSettings':
|
|
34728
35146
|
this.notify(modelChanged, { module: 'toolbar', newProp: newProp, oldProp: oldProp });
|
|
34729
|
-
this.setContentHeight();
|
|
35147
|
+
this.setContentHeight('Init');
|
|
34730
35148
|
break;
|
|
34731
35149
|
case 'maxLength':
|
|
34732
35150
|
if (this.showCharCount) {
|
|
@@ -34885,7 +35303,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34885
35303
|
this.inputElement.setAttribute('placeholder', this.placeholder);
|
|
34886
35304
|
}
|
|
34887
35305
|
}
|
|
34888
|
-
if (this.placeholder && this.iframeSettings.enable) {
|
|
35306
|
+
if (this.placeholder && this.iframeSettings.enable && this.inputElement) {
|
|
34889
35307
|
if (this.inputElement.textContent.length === 0 && this.inputElement.childNodes.length < 2 && !isNullOrUndefined(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
|
|
34890
35308
|
((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNullOrUndefined(this.inputElement.firstChild.firstChild) &&
|
|
34891
35309
|
this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
|
|
@@ -35232,12 +35650,9 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35232
35650
|
*/
|
|
35233
35651
|
RichTextEditor.prototype.setContentHeight = function (target, isExpand) {
|
|
35234
35652
|
var heightValue;
|
|
35235
|
-
var topValue = 0;
|
|
35236
35653
|
var rteHeightPercent;
|
|
35237
35654
|
var heightPercent = typeof (this.height) === 'string' && this.height.indexOf('%') > -1;
|
|
35238
|
-
var cntEle =
|
|
35239
|
-
this.sourceCodeModule.getPanel().parentElement.style.display === 'block') ? this.sourceCodeModule.getPanel().parentElement :
|
|
35240
|
-
this.contentModule.getPanel();
|
|
35655
|
+
var cntEle = this.contentModule.getPanel();
|
|
35241
35656
|
var rteHeight = this.element.offsetHeight;
|
|
35242
35657
|
if (rteHeight === 0 && this.height !== 'auto' && !this.getToolbar()) {
|
|
35243
35658
|
rteHeight = parseInt(this.height, 10);
|
|
@@ -35249,39 +35664,36 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35249
35664
|
var rzHandle = this.element.querySelector('.' + CLS_RTE_RES_HANDLE);
|
|
35250
35665
|
var rzHeight = this.enableResize ? (!isNullOrUndefined(rzHandle) ? (rzHandle.offsetHeight + 8) : 0) : 0;
|
|
35251
35666
|
var expandPopHeight = this.getToolbar() ? this.toolbarModule.getExpandTBarPopHeight() : 0;
|
|
35252
|
-
if (this.
|
|
35253
|
-
|
|
35254
|
-
topValue = (!this.toolbarSettings.enableFloating) ? expandPopHeight : 0;
|
|
35667
|
+
if (target && target !== 'Toolbar' && expandPopHeight && this.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0) {
|
|
35668
|
+
tbHeight = tbHeight - expandPopHeight;
|
|
35255
35669
|
}
|
|
35256
|
-
|
|
35257
|
-
if (
|
|
35258
|
-
heightValue = 'auto';
|
|
35670
|
+
if (this.toolbarSettings.type === ToolbarType.Expand) {
|
|
35671
|
+
if (isExpand) {
|
|
35672
|
+
heightValue = (this.height === 'auto' && this.element.style.height === 'auto') ? 'auto' : rteHeight - (tbHeight + expandPopHeight + rzHeight) + 'px';
|
|
35259
35673
|
}
|
|
35260
35674
|
else {
|
|
35261
|
-
heightValue =
|
|
35675
|
+
heightValue = (this.height === 'auto' && this.element.style.height === 'auto') ? 'auto' : rteHeight - (tbHeight - expandPopHeight + rzHeight) + 'px';
|
|
35262
35676
|
}
|
|
35263
35677
|
}
|
|
35264
|
-
|
|
35265
|
-
|
|
35266
|
-
|
|
35267
|
-
|
|
35678
|
+
else {
|
|
35679
|
+
heightValue = (this.height === 'auto' && this.element.style.height === 'auto') ? 'auto' : rteHeight - tbHeight + 'px';
|
|
35680
|
+
}
|
|
35681
|
+
var finalHeight = heightPercent && rteHeightPercent ? rteHeightPercent : heightValue;
|
|
35682
|
+
switch (target) {
|
|
35683
|
+
case 'Init':
|
|
35684
|
+
case 'Toolbar':
|
|
35685
|
+
case 'WindowResize':
|
|
35686
|
+
case 'Refresh':
|
|
35687
|
+
if (this.element.querySelectorAll('.e-source-content').length > 0 && this.element.querySelector('.e-source-content').style.display === 'block') {
|
|
35688
|
+
setStyleAttribute(this.element.querySelector('.e-source-content'), { height: finalHeight });
|
|
35268
35689
|
}
|
|
35269
|
-
|
|
35270
|
-
|
|
35271
|
-
if (target === 'windowResize' && heightPercent) {
|
|
35272
|
-
//cntEle hide the borderBottom of RichTextEditor. so removed the 2px of cntEle height.
|
|
35273
|
-
heightValue = parseInt(heightValue, 10) - 2 + 'px';
|
|
35690
|
+
else {
|
|
35691
|
+
setStyleAttribute(cntEle, { height: finalHeight });
|
|
35274
35692
|
}
|
|
35275
|
-
|
|
35276
|
-
|
|
35277
|
-
|
|
35278
|
-
|
|
35279
|
-
var codeElement = select('.' + CLS_RTE_CONTENT, this.element);
|
|
35280
|
-
setStyleAttribute(codeElement, { height: heightValue, marginTop: topValue + 'px' });
|
|
35281
|
-
}
|
|
35282
|
-
if (this.toolbarSettings.enableFloating && this.getToolbar() && !this.inlineMode.enable) {
|
|
35283
|
-
var tbWrapHeight = (isExpand ? (tbHeight + expandPopHeight) : tbHeight) + 'px';
|
|
35284
|
-
setStyleAttribute(this.getToolbar().parentElement, { height: tbWrapHeight });
|
|
35693
|
+
break;
|
|
35694
|
+
case 'Resize':
|
|
35695
|
+
setStyleAttribute(cntEle, { height: finalHeight });
|
|
35696
|
+
break;
|
|
35285
35697
|
}
|
|
35286
35698
|
if (rzHeight === 0) {
|
|
35287
35699
|
this.autoResize();
|
|
@@ -35484,18 +35896,14 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35484
35896
|
RichTextEditor.prototype.resizeHandler = function () {
|
|
35485
35897
|
var isExpand = false;
|
|
35486
35898
|
if (!document.body.contains(this.element)) {
|
|
35487
|
-
document.defaultView.removeEventListener('resize', this.onResizeHandler, true);
|
|
35899
|
+
document.defaultView.removeEventListener('resize', debounce(this.onResizeHandler, 10), true);
|
|
35488
35900
|
return;
|
|
35489
35901
|
}
|
|
35490
35902
|
if (this.toolbarSettings.enable && !this.inlineMode.enable) {
|
|
35491
35903
|
this.toolbarModule.refreshToolbarOverflow();
|
|
35492
35904
|
isExpand = this.toolbarModule.baseToolbar.toolbarObj.element.classList.contains(CLS_EXPAND_OPEN);
|
|
35493
35905
|
}
|
|
35494
|
-
|
|
35495
|
-
// When resize the window,border bottom of cntEle and this.element border visible separatly.so none the cntEle borderBottom.
|
|
35496
|
-
this.contentModule.getPanel().style.borderBottom = 'none';
|
|
35497
|
-
}
|
|
35498
|
-
this.setContentHeight('windowResize', isExpand);
|
|
35906
|
+
this.setContentHeight('WindowResize', isExpand);
|
|
35499
35907
|
this.notify(windowResize, null);
|
|
35500
35908
|
};
|
|
35501
35909
|
RichTextEditor.prototype.scrollHandler = function (e) {
|
|
@@ -35631,6 +36039,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35631
36039
|
this.isRTE = false;
|
|
35632
36040
|
}
|
|
35633
36041
|
this.notify(docClick, { args: e });
|
|
36042
|
+
var hideQuickToolbarChecker = this.quickToolbarModule && !this.inlineMode.enable && isNullOrUndefined(this.quickToolbarModule.inlineQTBar);
|
|
36043
|
+
if ((hideQuickToolbarChecker && !isNullOrUndefined(closest(target, '.' + 'e-toolbar-wrapper'))) || (hideQuickToolbarChecker && (!isNullOrUndefined(closest(target, '.e-rte-table-resize')) || !isNullOrUndefined(closest(target, '.e-table-box'))))) {
|
|
36044
|
+
this.quickToolbarModule.hideQuickToolbars();
|
|
36045
|
+
}
|
|
35634
36046
|
if (Browser.info.name !== 'msie' && e.detail > 3) {
|
|
35635
36047
|
e.preventDefault();
|
|
35636
36048
|
}
|
|
@@ -35780,9 +36192,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35780
36192
|
this.triggerEditArea(e.originalEvent);
|
|
35781
36193
|
};
|
|
35782
36194
|
RichTextEditor.prototype.contextHandler = function (e) {
|
|
35783
|
-
var closestElem = closest(e.target, 'a, table, img');
|
|
36195
|
+
var closestElem = closest(e.target, 'a, table, img, video, audio');
|
|
35784
36196
|
if (this.inlineMode.onSelection === false || (!isNullOrUndefined(closestElem) && this.inputElement.contains(closestElem)
|
|
35785
|
-
&& (closestElem.tagName === 'IMG' || closestElem.tagName === 'TABLE' || closestElem.tagName === 'A'
|
|
36197
|
+
&& (closestElem.tagName === 'IMG' || closestElem.tagName === 'TABLE' || closestElem.tagName === 'A' ||
|
|
36198
|
+
closestElem.tagName.toLowerCase() === 'video' || closestElem.tagName.toLowerCase() === 'audio'))) {
|
|
35786
36199
|
e.preventDefault();
|
|
35787
36200
|
}
|
|
35788
36201
|
};
|
|
@@ -35804,10 +36217,8 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35804
36217
|
}, 0);
|
|
35805
36218
|
}
|
|
35806
36219
|
else if (this.iframeSettings.enable) {
|
|
35807
|
-
var
|
|
35808
|
-
|
|
35809
|
-
_this.setAutoHeight(iframeElement_1);
|
|
35810
|
-
}, 100);
|
|
36220
|
+
var iframeElement = this.element.querySelector('#' + this.getID() + '_rte-view');
|
|
36221
|
+
this.setAutoHeight(iframeElement);
|
|
35811
36222
|
this.inputElement.style.overflow = 'hidden';
|
|
35812
36223
|
}
|
|
35813
36224
|
}
|
|
@@ -35816,10 +36227,21 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35816
36227
|
}
|
|
35817
36228
|
};
|
|
35818
36229
|
RichTextEditor.prototype.setAutoHeight = function (element) {
|
|
35819
|
-
if (!isNullOrUndefined(element)) {
|
|
36230
|
+
if (!isNullOrUndefined(element) && !this.iframeSettings.enable) {
|
|
35820
36231
|
element.style.height = this.inputElement.scrollHeight + 'px';
|
|
35821
36232
|
element.style.overflow = 'hidden';
|
|
35822
36233
|
}
|
|
36234
|
+
else if (!isNullOrUndefined(element) && !isNullOrUndefined(element.parentElement) && this.iframeSettings.enable) {
|
|
36235
|
+
var newRange = this.getRange();
|
|
36236
|
+
element.style.height = 'auto';
|
|
36237
|
+
var newHeight = element.contentDocument.body.scrollHeight + 'px';
|
|
36238
|
+
element.style.height = newHeight;
|
|
36239
|
+
element.style.overflow = 'hidden';
|
|
36240
|
+
// 16 px added for padding doesn't affect the editor height
|
|
36241
|
+
if (newRange.startContainer.nodeName !== '#text' && newRange.startContainer.nodeName !== 'BODY' && window.innerHeight < newRange.startContainer.getBoundingClientRect().top + element.getBoundingClientRect().top + 16) {
|
|
36242
|
+
newRange.startContainer.scrollIntoView(false);
|
|
36243
|
+
}
|
|
36244
|
+
}
|
|
35823
36245
|
};
|
|
35824
36246
|
RichTextEditor.prototype.wireEvents = function () {
|
|
35825
36247
|
this.element.addEventListener('focusin', this.onFocusHandler, true);
|
|
@@ -35874,7 +36296,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35874
36296
|
EventHandler.add(this.inputElement, Browser.touchStartEvent, this.mouseDownHandler, this);
|
|
35875
36297
|
this.wireContextEvent();
|
|
35876
36298
|
this.formatter.editorManager.observer.on(KEY_DOWN_HANDLER, this.editorKeyDown, this);
|
|
35877
|
-
this.element.ownerDocument.defaultView.addEventListener('resize', this.onResizeHandler, true);
|
|
36299
|
+
this.element.ownerDocument.defaultView.addEventListener('resize', debounce(this.onResizeHandler, 10), true);
|
|
35878
36300
|
if (this.iframeSettings.enable) {
|
|
35879
36301
|
EventHandler.add(this.inputElement, 'focusin', this.focusHandler, this);
|
|
35880
36302
|
EventHandler.add(this.inputElement, 'focusout', this.blurHandler, this);
|
|
@@ -35940,7 +36362,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
35940
36362
|
if (this.formatter) {
|
|
35941
36363
|
this.formatter.editorManager.observer.off(KEY_DOWN_HANDLER, this.editorKeyDown);
|
|
35942
36364
|
}
|
|
35943
|
-
this.element.ownerDocument.defaultView.removeEventListener('resize', this.onResizeHandler, true);
|
|
36365
|
+
this.element.ownerDocument.defaultView.removeEventListener('resize', debounce(this.onResizeHandler, 10), true);
|
|
35944
36366
|
if (this.iframeSettings.enable) {
|
|
35945
36367
|
EventHandler.remove(this.inputElement, 'focusin', this.focusHandler);
|
|
35946
36368
|
EventHandler.remove(this.inputElement, 'focusout', this.blurHandler);
|
|
@@ -36005,6 +36427,15 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
36005
36427
|
}
|
|
36006
36428
|
}
|
|
36007
36429
|
};
|
|
36430
|
+
RichTextEditor.prototype.getRenderedQuickToolbarElem = function () {
|
|
36431
|
+
var quickToolbars = this.quickToolbarModule.getQuickToolbarInstance();
|
|
36432
|
+
for (var i = 0; i < quickToolbars.length; i++) {
|
|
36433
|
+
if (quickToolbars[i] && quickToolbars[i].isRendered) {
|
|
36434
|
+
return quickToolbars[i].element;
|
|
36435
|
+
}
|
|
36436
|
+
}
|
|
36437
|
+
return null;
|
|
36438
|
+
};
|
|
36008
36439
|
__decorate$1([
|
|
36009
36440
|
Complex({}, ToolbarSettings$1)
|
|
36010
36441
|
], RichTextEditor.prototype, "toolbarSettings", void 0);
|
|
@@ -36309,5 +36740,5 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
36309
36740
|
* Rich Text Editor component exported items
|
|
36310
36741
|
*/
|
|
36311
36742
|
|
|
36312
|
-
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,
|
|
36743
|
+
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 };
|
|
36313
36744
|
//# sourceMappingURL=ej2-richtexteditor.es5.js.map
|